Remove unnecessary pre-19 code branches.

Now that our minSdk is 19, we can remove a lot of old code paths that
only ran pre-19.
This commit is contained in:
Greyson Parrelli
2019-03-20 15:09:27 -07:00
parent a52c295a38
commit 8caaf057e8
42 changed files with 125 additions and 387 deletions

View File

@@ -252,24 +252,22 @@ public class MultiDeviceContactUpdateJob extends ContextJob implements Injectabl
return Optional.absent();
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
Uri displayPhotoUri = Uri.withAppendedPath(uri, ContactsContract.Contacts.Photo.DISPLAY_PHOTO);
Uri displayPhotoUri = Uri.withAppendedPath(uri, ContactsContract.Contacts.Photo.DISPLAY_PHOTO);
try {
AssetFileDescriptor fd = context.getContentResolver().openAssetFileDescriptor(displayPhotoUri, "r");
try {
AssetFileDescriptor fd = context.getContentResolver().openAssetFileDescriptor(displayPhotoUri, "r");
if (fd == null) {
return Optional.absent();
}
return Optional.of(SignalServiceAttachment.newStreamBuilder()
.withStream(fd.createInputStream())
.withContentType("image/*")
.withLength(fd.getLength())
.build());
} catch (IOException e) {
Log.i(TAG, "Could not find avatar for URI: " + displayPhotoUri);
if (fd == null) {
return Optional.absent();
}
return Optional.of(SignalServiceAttachment.newStreamBuilder()
.withStream(fd.createInputStream())
.withContentType("image/*")
.withLength(fd.getLength())
.build());
} catch (IOException e) {
Log.i(TAG, "Could not find avatar for URI: " + displayPhotoUri);
}
Uri photoUri = Uri.withAppendedPath(uri, ContactsContract.Contacts.Photo.CONTENT_DIRECTORY);

View File

@@ -160,10 +160,7 @@ public class UpdateApkJob extends ContextJob {
downloadRequest.setDescription("Downloading Signal " + versionName);
downloadRequest.setVisibleInDownloadsUi(false);
downloadRequest.setDestinationInExternalFilesDir(context, null, "signal-update.apk");
if (Build.VERSION.SDK_INT >= 11) {
downloadRequest.setNotificationVisibility(DownloadManager.Request.VISIBILITY_HIDDEN);
}
downloadRequest.setNotificationVisibility(DownloadManager.Request.VISIBILITY_HIDDEN);
long downloadId = downloadManager.enqueue(downloadRequest);
TextSecurePreferences.setUpdateApkDownloadId(context, downloadId);