From de862be6a88ff74c0378f3f506919ec2880bf6ba Mon Sep 17 00:00:00 2001 From: Abhijeet Kaur Date: Fri, 19 Feb 2021 16:43:59 +0000 Subject: [PATCH] Disable resetting WRITE_MEDIA_IMAGES and WRITE_MEDIA_VIDEO appops App holding System Gallery role is allowed WRITE_MEDIA_* appops by virtue of the role. This allows the System Gallery app write-access for images and videos. When app preferences are reset AppOpsService toggles the appops for all apps. Only the appops mentioned in sOpDisableReset are not toggled. Disable WRITE_MEDIA_* appops to reset, as the system gallery app loses write access on images/videos. Bug: 179133883 Test: atest android.scopedstorage.cts.device.ScopedStorageDeviceTest#testDisableOpResetForSystemGallery Change-Id: I168221c641566a9f691ed7956c038206b114d802 --- core/java/android/app/AppOpsManager.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/java/android/app/AppOpsManager.java b/core/java/android/app/AppOpsManager.java index b85b1861aa025..62bff8f60e1fa 100644 --- a/core/java/android/app/AppOpsManager.java +++ b/core/java/android/app/AppOpsManager.java @@ -2529,9 +2529,9 @@ public class AppOpsManager { false, // READ_MEDIA_AUDIO false, // WRITE_MEDIA_AUDIO false, // READ_MEDIA_VIDEO - false, // WRITE_MEDIA_VIDEO + true, // WRITE_MEDIA_VIDEO false, // READ_MEDIA_IMAGES - false, // WRITE_MEDIA_IMAGES + true, // WRITE_MEDIA_IMAGES true, // LEGACY_STORAGE false, // ACCESS_ACCESSIBILITY false, // READ_DEVICE_IDENTIFIERS