parent
1879d2d9be
commit
d765ef2185
|
@ -35,8 +35,8 @@ android {
|
|||
applicationId "org.mariotaku.twidere"
|
||||
minSdkVersion 14
|
||||
targetSdkVersion 25
|
||||
versionCode 240
|
||||
versionName '3.3.22'
|
||||
versionCode 241
|
||||
versionName '3.3.23'
|
||||
multiDexEnabled true
|
||||
|
||||
buildConfigField 'boolean', 'LEAK_CANARY_ENABLED', 'Boolean.parseBoolean("true")'
|
||||
|
|
|
@ -27,10 +27,7 @@ import android.content.pm.PackageManager;
|
|||
import android.content.pm.ResolveInfo;
|
||||
import android.os.Bundle;
|
||||
import android.os.IBinder;
|
||||
import android.os.RemoteException;
|
||||
import android.util.Log;
|
||||
|
||||
import org.mariotaku.twidere.BuildConfig;
|
||||
import org.mariotaku.twidere.IMediaUploader;
|
||||
import org.mariotaku.twidere.model.MediaUploadResult;
|
||||
import org.mariotaku.twidere.model.ParcelableStatus;
|
||||
|
@ -40,7 +37,6 @@ import org.mariotaku.twidere.model.UserKey;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
import static org.mariotaku.twidere.TwidereConstants.LOGTAG;
|
||||
import static org.mariotaku.twidere.constant.IntentConstants.INTENT_ACTION_EXTENSION_UPLOAD_MEDIA;
|
||||
|
||||
public final class MediaUploaderInterface extends AbsServiceInterface<IMediaUploader> {
|
||||
|
@ -58,13 +54,10 @@ public final class MediaUploaderInterface extends AbsServiceInterface<IMediaUplo
|
|||
final String mediaJson = JsonSerializer.serialize(media, UploaderMediaItem.class);
|
||||
return JsonSerializer.parse(iface.upload(statusJson, currentAccountKey.toString(),
|
||||
mediaJson), MediaUploadResult.class);
|
||||
} catch (final RemoteException e) {
|
||||
if (BuildConfig.DEBUG) {
|
||||
Log.w(LOGTAG, e);
|
||||
} catch (final Exception e) {
|
||||
return MediaUploadResult.error(2, e.getMessage());
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
public boolean callback(MediaUploadResult uploadResult, ParcelableStatus status) {
|
||||
|
@ -74,13 +67,10 @@ public final class MediaUploaderInterface extends AbsServiceInterface<IMediaUplo
|
|||
final String resultJson = JsonSerializer.serialize(uploadResult, MediaUploadResult.class);
|
||||
final String statusJson = JsonSerializer.serialize(status, ParcelableStatus.class);
|
||||
return iface.callback(resultJson, statusJson);
|
||||
} catch (final RemoteException e) {
|
||||
if (BuildConfig.DEBUG) {
|
||||
Log.w(LOGTAG, e);
|
||||
}
|
||||
}
|
||||
} catch (final Exception e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected IMediaUploader onServiceConnected(ComponentName service, IBinder obj) {
|
||||
|
|
|
@ -27,10 +27,7 @@ import android.content.pm.PackageManager;
|
|||
import android.content.pm.ResolveInfo;
|
||||
import android.os.Bundle;
|
||||
import android.os.IBinder;
|
||||
import android.os.RemoteException;
|
||||
import android.util.Log;
|
||||
|
||||
import org.mariotaku.twidere.BuildConfig;
|
||||
import org.mariotaku.twidere.IStatusShortener;
|
||||
import org.mariotaku.twidere.model.ParcelableStatus;
|
||||
import org.mariotaku.twidere.model.ParcelableStatusUpdate;
|
||||
|
@ -39,7 +36,6 @@ import org.mariotaku.twidere.model.UserKey;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
import static org.mariotaku.twidere.TwidereConstants.LOGTAG;
|
||||
import static org.mariotaku.twidere.constant.IntentConstants.INTENT_ACTION_EXTENSION_SHORTEN_STATUS;
|
||||
|
||||
public final class StatusShortenerInterface extends AbsServiceInterface<IStatusShortener> {
|
||||
|
@ -63,13 +59,10 @@ public final class StatusShortenerInterface extends AbsServiceInterface<IStatusS
|
|||
final String resultJson = iface.shorten(statusJson, currentAccountId.toString(),
|
||||
overrideStatusText);
|
||||
return JsonSerializer.parse(resultJson, StatusShortenResult.class);
|
||||
} catch (final RemoteException e) {
|
||||
if (BuildConfig.DEBUG) {
|
||||
Log.w(LOGTAG, e);
|
||||
} catch (final Exception e) {
|
||||
return StatusShortenResult.error(2, e.getMessage());
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public boolean callback(StatusShortenResult result, ParcelableStatus status) {
|
||||
final IStatusShortener iface = getInterface();
|
||||
|
@ -78,13 +71,10 @@ public final class StatusShortenerInterface extends AbsServiceInterface<IStatusS
|
|||
final String resultJson = JsonSerializer.serialize(result, StatusShortenResult.class);
|
||||
final String statusJson = JsonSerializer.serialize(status, ParcelableStatus.class);
|
||||
return iface.callback(resultJson, statusJson);
|
||||
} catch (final RemoteException e) {
|
||||
if (BuildConfig.DEBUG) {
|
||||
Log.w(LOGTAG, e);
|
||||
}
|
||||
}
|
||||
} catch (final Exception e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static StatusShortenerInterface getInstance(final Application application, final String shortenerName) {
|
||||
if (shortenerName == null) return null;
|
||||
|
|
|
@ -387,13 +387,11 @@ class UpdateStatusTask(
|
|||
throw ExtensionVersionMismatchException()
|
||||
}
|
||||
}
|
||||
} catch (e: AbsServiceInterface.CheckServiceException) {
|
||||
if (e is ExtensionVersionMismatchException) {
|
||||
} catch (e: ExtensionVersionMismatchException) {
|
||||
throw ShortenException(context.getString(R.string.shortener_version_incompatible))
|
||||
}
|
||||
} catch (e: AbsServiceInterface.CheckServiceException) {
|
||||
throw ShortenException(e)
|
||||
}
|
||||
|
||||
return shortener
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue