Replace some "write" permissions with with "read" ones.

Notes for backup related classes.
This commit is contained in:
Anton Chekulaev 2020-09-11 12:11:46 +10:00
parent 7319ac4682
commit f20ebc31f3
4 changed files with 4 additions and 2 deletions

View File

@ -268,7 +268,7 @@ public class RegistrationActivity extends BaseActionBarActivity implements Verif
@SuppressLint("StaticFieldLeak") @SuppressLint("StaticFieldLeak")
private void initializeBackupDetection() { private void initializeBackupDetection() {
if (!Permissions.hasAll(this, Manifest.permission.WRITE_EXTERNAL_STORAGE)) { if (!Permissions.hasAll(this, Manifest.permission.READ_EXTERNAL_STORAGE)) {
Log.i(TAG, "Skipping backup detection. We don't have the permission."); Log.i(TAG, "Skipping backup detection. We don't have the permission.");
return; return;
} }

View File

@ -110,7 +110,7 @@ public class AttachmentTypeSelector extends PopupWindow {
public void show(@NonNull Activity activity, final @NonNull View anchor) { public void show(@NonNull Activity activity, final @NonNull View anchor) {
updateHeight(); updateHeight();
if (Permissions.hasAll(activity, Manifest.permission.WRITE_EXTERNAL_STORAGE)) { if (Permissions.hasAll(activity, Manifest.permission.READ_EXTERNAL_STORAGE)) {
recentRail.setVisibility(View.VISIBLE); recentRail.setVisibility(View.VISIBLE);
loaderManager.restartLoader(1, null, recentRail); loaderManager.restartLoader(1, null, recentRail);
} else { } else {

View File

@ -26,6 +26,7 @@ import java.util.Locale;
import network.loki.messenger.R; import network.loki.messenger.R;
//TODO AC: Needs to be refactored to use Storage Access Framework or Media Store API.
public class LocalBackupJob extends BaseJob { public class LocalBackupJob extends BaseJob {
public static final String KEY = "LocalBackupJob"; public static final String KEY = "LocalBackupJob";

View File

@ -16,6 +16,7 @@ import java.util.Arrays;
import java.util.Calendar; import java.util.Calendar;
import java.util.Locale; import java.util.Locale;
//TODO AC: Needs to be refactored to use Storage Access Framework or Media Store API.
public class BackupUtil { public class BackupUtil {
private static final String TAG = BackupUtil.class.getSimpleName(); private static final String TAG = BackupUtil.class.getSimpleName();