From 4e909ff3b96d4af6337a07f484ad2ef88d1d1dad Mon Sep 17 00:00:00 2001 From: Anton Chekulaev Date: Wed, 9 Sep 2020 18:21:35 +1000 Subject: [PATCH] Write external storage permission replaced with the read one. --- src/org/thoughtcrime/securesms/CreateProfileActivity.java | 8 ++++---- .../securesms/database/loaders/RecentPhotosLoader.java | 2 +- src/org/thoughtcrime/securesms/mms/AttachmentManager.java | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/org/thoughtcrime/securesms/CreateProfileActivity.java b/src/org/thoughtcrime/securesms/CreateProfileActivity.java index 9be993d218..57836e6bd6 100644 --- a/src/org/thoughtcrime/securesms/CreateProfileActivity.java +++ b/src/org/thoughtcrime/securesms/CreateProfileActivity.java @@ -213,10 +213,10 @@ public class CreateProfileActivity extends BaseActionBarActivity implements Inje this.reveal = ViewUtil.findById(this, R.id.reveal); this.nextIntent = getIntent().getParcelableExtra(NEXT_INTENT); - this.avatar.setOnClickListener(view -> Permissions.with(this) - .request(Manifest.permission.CAMERA, Manifest.permission.WRITE_EXTERNAL_STORAGE) - .onAnyResult(this::startAvatarSelection) - .execute()); +// this.avatar.setOnClickListener(view -> Permissions.with(this) +// .request(Manifest.permission.CAMERA, Manifest.permission.WRITE_EXTERNAL_STORAGE) +// .onAnyResult(this::startAvatarSelection) +// .execute()); this.name.getInput().addTextChangedListener(new TextWatcher() { @Override diff --git a/src/org/thoughtcrime/securesms/database/loaders/RecentPhotosLoader.java b/src/org/thoughtcrime/securesms/database/loaders/RecentPhotosLoader.java index 7ed0184e8e..21ed07ac66 100644 --- a/src/org/thoughtcrime/securesms/database/loaders/RecentPhotosLoader.java +++ b/src/org/thoughtcrime/securesms/database/loaders/RecentPhotosLoader.java @@ -35,7 +35,7 @@ public class RecentPhotosLoader extends CursorLoader { @Override public Cursor loadInBackground() { - if (Permissions.hasAll(context, Manifest.permission.WRITE_EXTERNAL_STORAGE)) { + if (Permissions.hasAll(context, Manifest.permission.READ_EXTERNAL_STORAGE)) { return context.getContentResolver().query(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, PROJECTION, null, null, MediaStore.Images.ImageColumns.DATE_MODIFIED + " DESC"); diff --git a/src/org/thoughtcrime/securesms/mms/AttachmentManager.java b/src/org/thoughtcrime/securesms/mms/AttachmentManager.java index 60c6628203..16c0d44ed0 100644 --- a/src/org/thoughtcrime/securesms/mms/AttachmentManager.java +++ b/src/org/thoughtcrime/securesms/mms/AttachmentManager.java @@ -376,7 +376,7 @@ public class AttachmentManager { public static void selectGallery(Activity activity, int requestCode, @NonNull Recipient recipient, @NonNull String body, @NonNull TransportOption transport) { Permissions.with(activity) - .request(Manifest.permission.WRITE_EXTERNAL_STORAGE) + .request(Manifest.permission.READ_EXTERNAL_STORAGE) .withPermanentDenialDialog(activity.getString(R.string.AttachmentManager_signal_requires_the_external_storage_permission_in_order_to_attach_photos_videos_or_audio)) // .onAllGranted(() -> selectMediaType(activity, "image/*", new String[] {"image/*", "video/*"}, requestCode)) .onAllGranted(() -> activity.startActivityForResult(MediaSendActivity.buildGalleryIntent(activity, recipient, body, transport), requestCode))