mirror of
https://github.com/oxen-io/session-android.git
synced 2025-10-24 07:38:49 +00:00
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:
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user