Loading res/values/strings.xml +3 −6 Original line number Diff line number Diff line Loading @@ -448,12 +448,6 @@ <!-- Label for showing a permission group's description in the header of the list of apps that have the location permission [CHAR LIMIT=none] --> <string name="permission_description_summary_location">Apps with this permission can access this device\'s location</string> <!-- Label for showing a permission group's description in the header of the list of apps that have the media_aural permission [CHAR LIMIT=none] --> <string name="permission_description_summary_media_aural">Apps with this permission can access your music</string> <!-- Label for showing a permission group's description in the header of the list of apps that have the media_visual permission [CHAR LIMIT=none] --> <string name="permission_description_summary_media_visual">Apps with this permission can access your photos & videos</string> <!-- Label for showing a permission group's description in the header of the list of apps that have the microphone permission [CHAR LIMIT=none] --> <string name="permission_description_summary_microphone">Apps with this permission can record audio</string> Loading @@ -466,6 +460,9 @@ <!-- Label for showing a permission group's description in the header of the list of apps that have the SMS permission [CHAR LIMIT=none] --> <string name="permission_description_summary_sms">Apps with this permission can send and view SMS messages</string> <!-- Label for showing a permission group's description in the header of the list of apps that have the Storage permission [CHAR LIMIT=none] --> <string name="permission_description_summary_storage">Apps with this permission can access photos, media, and files on your device</string> <!-- Summary for showing the time and/or date of the most recent access of a permission by an app [CHAR LIMIT=60] --> <string name="app_permission_most_recent_summary">Last access: <xliff:g id="time_date" example="12:42 PM">%1$s</xliff:g></string> Loading res/xml/roles.xml +6 −11 Original line number Diff line number Diff line Loading @@ -68,13 +68,9 @@ <permission name="android.permission.BODY_SENSORS" /> </permission-set> <permission-set name="media_aural"> <permission name="android.permission.READ_MEDIA_AUDIO" /> </permission-set> <permission-set name="media_visual"> <permission name="android.permission.READ_MEDIA_VIDEO" /> <permission name="android.permission.READ_MEDIA_IMAGES" /> <permission-set name="storage"> <permission name="android.permission.READ_EXTERNAL_STORAGE" /> <permission name="android.permission.WRITE_EXTERNAL_STORAGE" /> </permission-set> <role Loading Loading @@ -263,8 +259,7 @@ <permission-set name="phone" /> <permission-set name="contacts" /> <permission-set name="sms" /> <permission-set name="media_aural" /> <permission-set name="media_visual" /> <permission-set name="storage" /> <permission-set name="microphone" /> <permission-set name="camera" /> </permissions> Loading Loading @@ -387,7 +382,7 @@ </activity> </required-components> <permissions> <permission-set name="media_aural" /> <permission-set name="storage" /> </permissions> <app-ops> <app-op name="android:write_media_audio" mode="allowed" /> Loading Loading @@ -426,7 +421,7 @@ </activity> </required-components> <permissions> <permission-set name="media_visual" /> <permission-set name="storage" /> </permissions> <app-ops> <app-op name="android:write_media_video" mode="allowed" /> Loading src/com/android/packageinstaller/permission/model/AppPermissionGroup.java +8 −15 Original line number Diff line number Diff line Loading @@ -22,7 +22,6 @@ import static android.app.AppOpsManager.MODE_ALLOWED; import static android.app.AppOpsManager.MODE_FOREGROUND; import static android.app.AppOpsManager.MODE_IGNORED; import static android.app.AppOpsManager.OPSTR_LEGACY_STORAGE; import static android.content.pm.PackageManager.FLAG_PERMISSION_HIDDEN; import static android.content.pm.PackageManager.PERMISSION_GRANTED; import android.app.ActivityManager; Loading Loading @@ -106,7 +105,7 @@ public final class AppPermissionGroup implements Comparable<AppPermissionGroup> private final boolean mAppSupportsRuntimePermissions; private final boolean mIsEphemeralApp; private final boolean mIsGrandfatheredModernStorageGroup; private final boolean mIsNonIsolatedStorage; private boolean mContainsEphemeralPermission; private boolean mContainsPreRuntimePermission; Loading Loading @@ -306,10 +305,6 @@ public final class AppPermissionGroup implements Comparable<AppPermissionGroup> for (int i = 0; i < numPermissions; i++) { Permission permission = allPermissions.valueAt(i); if ((permission.getFlags() & FLAG_PERMISSION_HIDDEN) != 0) { continue; } if (permission.isBackgroundPermission()) { if (group.getBackgroundPermissions() == null) { group.mBackgroundPermissions = new AppPermissionGroup(group.mContext, Loading Loading @@ -410,8 +405,7 @@ public final class AppPermissionGroup implements Comparable<AppPermissionGroup> mIconResId = R.drawable.ic_perm_device_info; } mIsGrandfatheredModernStorageGroup = targetSDK >= Build.VERSION_CODES.Q && mAppOps.unsafeCheckOpNoThrow(OPSTR_LEGACY_STORAGE, mIsNonIsolatedStorage = mAppOps.unsafeCheckOpNoThrow(OPSTR_LEGACY_STORAGE, packageInfo.applicationInfo.uid, packageInfo.packageName) == MODE_ALLOWED; } Loading Loading @@ -1065,15 +1059,14 @@ public final class AppPermissionGroup implements Comparable<AppPermissionGroup> } /** * Is the group a grandfathered modern storage permission group. * * <p>Such permissions cannot be revoked. The user needs to uninstall and reinstall the app to * reset the permission * Is the group a storage permission group that is referring to an app that does not have * isolated storage * * @return {@code true} iff this is a grandfathered modern storage permission group. * @return {@code true} iff this is a storage group on an app that does not have isolated * storage */ public boolean isGrandfatheredModernStorageGroup() { return mIsGrandfatheredModernStorageGroup; public boolean isNonIsolatedStorage() { return mIsNonIsolatedStorage; } /** Loading src/com/android/packageinstaller/permission/ui/handheld/AppPermissionFragment.java +1 −7 Original line number Diff line number Diff line Loading @@ -366,13 +366,7 @@ public class AppPermissionFragment extends SettingsWithLargeHeader { } // Handle the UI for various special cases. if (mGroup.isGrandfatheredModernStorageGroup()) { mAlwaysButton.setClickable(false); mDenyButton.setClickable(false); mRadioGroup.setClickable(true); mRadioGroup.setOnClickListener(v -> showGrandfatheredModernStorageGroupWarningDialog()); } else if (isSystemFixed() || isPolicyFullyFixed() || isForegroundDisabledByPolicy()) { if (isSystemFixed() || isPolicyFullyFixed() || isForegroundDisabledByPolicy()) { // Disable changing permissions and potentially show administrator message. mAlwaysButton.setEnabled(false); mForegroundOnlyButton.setEnabled(false); Loading src/com/android/packageinstaller/permission/utils/Utils.java +3 −12 Original line number Diff line number Diff line Loading @@ -23,8 +23,6 @@ import static android.Manifest.permission_group.CALL_LOG; import static android.Manifest.permission_group.CAMERA; import static android.Manifest.permission_group.CONTACTS; import static android.Manifest.permission_group.LOCATION; import static android.Manifest.permission_group.MEDIA_AURAL; import static android.Manifest.permission_group.MEDIA_VISUAL; import static android.Manifest.permission_group.MICROPHONE; import static android.Manifest.permission_group.PHONE; import static android.Manifest.permission_group.SENSORS; Loading Loading @@ -134,12 +132,7 @@ public final class Utils { PLATFORM_PERMISSIONS.put(Manifest.permission.READ_EXTERNAL_STORAGE, STORAGE); PLATFORM_PERMISSIONS.put(Manifest.permission.WRITE_EXTERNAL_STORAGE, STORAGE); PLATFORM_PERMISSIONS.put(Manifest.permission.READ_MEDIA_AUDIO, MEDIA_AURAL); PLATFORM_PERMISSIONS.put(Manifest.permission.READ_MEDIA_IMAGES, MEDIA_VISUAL); PLATFORM_PERMISSIONS.put(Manifest.permission.READ_MEDIA_VIDEO, MEDIA_VISUAL); PLATFORM_PERMISSIONS.put(Manifest.permission.ACCESS_MEDIA_LOCATION, MEDIA_VISUAL); PLATFORM_PERMISSIONS.put(Manifest.permission.ACCESS_MEDIA_LOCATION, STORAGE); PLATFORM_PERMISSIONS.put(Manifest.permission.ACCESS_FINE_LOCATION, LOCATION); PLATFORM_PERMISSIONS.put(Manifest.permission.ACCESS_COARSE_LOCATION, LOCATION); Loading Loading @@ -726,10 +719,6 @@ public final class Utils { return context.getString(R.string.permission_description_summary_contacts); case LOCATION: return context.getString(R.string.permission_description_summary_location); case MEDIA_AURAL: return context.getString(R.string.permission_description_summary_media_aural); case MEDIA_VISUAL: return context.getString(R.string.permission_description_summary_media_visual); case MICROPHONE: return context.getString(R.string.permission_description_summary_microphone); case PHONE: Loading @@ -738,6 +727,8 @@ public final class Utils { return context.getString(R.string.permission_description_summary_sensors); case SMS: return context.getString(R.string.permission_description_summary_sms); case STORAGE: return context.getString(R.string.permission_description_summary_storage); default: return context.getString(R.string.permission_description_summary_generic, description); Loading Loading
res/values/strings.xml +3 −6 Original line number Diff line number Diff line Loading @@ -448,12 +448,6 @@ <!-- Label for showing a permission group's description in the header of the list of apps that have the location permission [CHAR LIMIT=none] --> <string name="permission_description_summary_location">Apps with this permission can access this device\'s location</string> <!-- Label for showing a permission group's description in the header of the list of apps that have the media_aural permission [CHAR LIMIT=none] --> <string name="permission_description_summary_media_aural">Apps with this permission can access your music</string> <!-- Label for showing a permission group's description in the header of the list of apps that have the media_visual permission [CHAR LIMIT=none] --> <string name="permission_description_summary_media_visual">Apps with this permission can access your photos & videos</string> <!-- Label for showing a permission group's description in the header of the list of apps that have the microphone permission [CHAR LIMIT=none] --> <string name="permission_description_summary_microphone">Apps with this permission can record audio</string> Loading @@ -466,6 +460,9 @@ <!-- Label for showing a permission group's description in the header of the list of apps that have the SMS permission [CHAR LIMIT=none] --> <string name="permission_description_summary_sms">Apps with this permission can send and view SMS messages</string> <!-- Label for showing a permission group's description in the header of the list of apps that have the Storage permission [CHAR LIMIT=none] --> <string name="permission_description_summary_storage">Apps with this permission can access photos, media, and files on your device</string> <!-- Summary for showing the time and/or date of the most recent access of a permission by an app [CHAR LIMIT=60] --> <string name="app_permission_most_recent_summary">Last access: <xliff:g id="time_date" example="12:42 PM">%1$s</xliff:g></string> Loading
res/xml/roles.xml +6 −11 Original line number Diff line number Diff line Loading @@ -68,13 +68,9 @@ <permission name="android.permission.BODY_SENSORS" /> </permission-set> <permission-set name="media_aural"> <permission name="android.permission.READ_MEDIA_AUDIO" /> </permission-set> <permission-set name="media_visual"> <permission name="android.permission.READ_MEDIA_VIDEO" /> <permission name="android.permission.READ_MEDIA_IMAGES" /> <permission-set name="storage"> <permission name="android.permission.READ_EXTERNAL_STORAGE" /> <permission name="android.permission.WRITE_EXTERNAL_STORAGE" /> </permission-set> <role Loading Loading @@ -263,8 +259,7 @@ <permission-set name="phone" /> <permission-set name="contacts" /> <permission-set name="sms" /> <permission-set name="media_aural" /> <permission-set name="media_visual" /> <permission-set name="storage" /> <permission-set name="microphone" /> <permission-set name="camera" /> </permissions> Loading Loading @@ -387,7 +382,7 @@ </activity> </required-components> <permissions> <permission-set name="media_aural" /> <permission-set name="storage" /> </permissions> <app-ops> <app-op name="android:write_media_audio" mode="allowed" /> Loading Loading @@ -426,7 +421,7 @@ </activity> </required-components> <permissions> <permission-set name="media_visual" /> <permission-set name="storage" /> </permissions> <app-ops> <app-op name="android:write_media_video" mode="allowed" /> Loading
src/com/android/packageinstaller/permission/model/AppPermissionGroup.java +8 −15 Original line number Diff line number Diff line Loading @@ -22,7 +22,6 @@ import static android.app.AppOpsManager.MODE_ALLOWED; import static android.app.AppOpsManager.MODE_FOREGROUND; import static android.app.AppOpsManager.MODE_IGNORED; import static android.app.AppOpsManager.OPSTR_LEGACY_STORAGE; import static android.content.pm.PackageManager.FLAG_PERMISSION_HIDDEN; import static android.content.pm.PackageManager.PERMISSION_GRANTED; import android.app.ActivityManager; Loading Loading @@ -106,7 +105,7 @@ public final class AppPermissionGroup implements Comparable<AppPermissionGroup> private final boolean mAppSupportsRuntimePermissions; private final boolean mIsEphemeralApp; private final boolean mIsGrandfatheredModernStorageGroup; private final boolean mIsNonIsolatedStorage; private boolean mContainsEphemeralPermission; private boolean mContainsPreRuntimePermission; Loading Loading @@ -306,10 +305,6 @@ public final class AppPermissionGroup implements Comparable<AppPermissionGroup> for (int i = 0; i < numPermissions; i++) { Permission permission = allPermissions.valueAt(i); if ((permission.getFlags() & FLAG_PERMISSION_HIDDEN) != 0) { continue; } if (permission.isBackgroundPermission()) { if (group.getBackgroundPermissions() == null) { group.mBackgroundPermissions = new AppPermissionGroup(group.mContext, Loading Loading @@ -410,8 +405,7 @@ public final class AppPermissionGroup implements Comparable<AppPermissionGroup> mIconResId = R.drawable.ic_perm_device_info; } mIsGrandfatheredModernStorageGroup = targetSDK >= Build.VERSION_CODES.Q && mAppOps.unsafeCheckOpNoThrow(OPSTR_LEGACY_STORAGE, mIsNonIsolatedStorage = mAppOps.unsafeCheckOpNoThrow(OPSTR_LEGACY_STORAGE, packageInfo.applicationInfo.uid, packageInfo.packageName) == MODE_ALLOWED; } Loading Loading @@ -1065,15 +1059,14 @@ public final class AppPermissionGroup implements Comparable<AppPermissionGroup> } /** * Is the group a grandfathered modern storage permission group. * * <p>Such permissions cannot be revoked. The user needs to uninstall and reinstall the app to * reset the permission * Is the group a storage permission group that is referring to an app that does not have * isolated storage * * @return {@code true} iff this is a grandfathered modern storage permission group. * @return {@code true} iff this is a storage group on an app that does not have isolated * storage */ public boolean isGrandfatheredModernStorageGroup() { return mIsGrandfatheredModernStorageGroup; public boolean isNonIsolatedStorage() { return mIsNonIsolatedStorage; } /** Loading
src/com/android/packageinstaller/permission/ui/handheld/AppPermissionFragment.java +1 −7 Original line number Diff line number Diff line Loading @@ -366,13 +366,7 @@ public class AppPermissionFragment extends SettingsWithLargeHeader { } // Handle the UI for various special cases. if (mGroup.isGrandfatheredModernStorageGroup()) { mAlwaysButton.setClickable(false); mDenyButton.setClickable(false); mRadioGroup.setClickable(true); mRadioGroup.setOnClickListener(v -> showGrandfatheredModernStorageGroupWarningDialog()); } else if (isSystemFixed() || isPolicyFullyFixed() || isForegroundDisabledByPolicy()) { if (isSystemFixed() || isPolicyFullyFixed() || isForegroundDisabledByPolicy()) { // Disable changing permissions and potentially show administrator message. mAlwaysButton.setEnabled(false); mForegroundOnlyButton.setEnabled(false); Loading
src/com/android/packageinstaller/permission/utils/Utils.java +3 −12 Original line number Diff line number Diff line Loading @@ -23,8 +23,6 @@ import static android.Manifest.permission_group.CALL_LOG; import static android.Manifest.permission_group.CAMERA; import static android.Manifest.permission_group.CONTACTS; import static android.Manifest.permission_group.LOCATION; import static android.Manifest.permission_group.MEDIA_AURAL; import static android.Manifest.permission_group.MEDIA_VISUAL; import static android.Manifest.permission_group.MICROPHONE; import static android.Manifest.permission_group.PHONE; import static android.Manifest.permission_group.SENSORS; Loading Loading @@ -134,12 +132,7 @@ public final class Utils { PLATFORM_PERMISSIONS.put(Manifest.permission.READ_EXTERNAL_STORAGE, STORAGE); PLATFORM_PERMISSIONS.put(Manifest.permission.WRITE_EXTERNAL_STORAGE, STORAGE); PLATFORM_PERMISSIONS.put(Manifest.permission.READ_MEDIA_AUDIO, MEDIA_AURAL); PLATFORM_PERMISSIONS.put(Manifest.permission.READ_MEDIA_IMAGES, MEDIA_VISUAL); PLATFORM_PERMISSIONS.put(Manifest.permission.READ_MEDIA_VIDEO, MEDIA_VISUAL); PLATFORM_PERMISSIONS.put(Manifest.permission.ACCESS_MEDIA_LOCATION, MEDIA_VISUAL); PLATFORM_PERMISSIONS.put(Manifest.permission.ACCESS_MEDIA_LOCATION, STORAGE); PLATFORM_PERMISSIONS.put(Manifest.permission.ACCESS_FINE_LOCATION, LOCATION); PLATFORM_PERMISSIONS.put(Manifest.permission.ACCESS_COARSE_LOCATION, LOCATION); Loading Loading @@ -726,10 +719,6 @@ public final class Utils { return context.getString(R.string.permission_description_summary_contacts); case LOCATION: return context.getString(R.string.permission_description_summary_location); case MEDIA_AURAL: return context.getString(R.string.permission_description_summary_media_aural); case MEDIA_VISUAL: return context.getString(R.string.permission_description_summary_media_visual); case MICROPHONE: return context.getString(R.string.permission_description_summary_microphone); case PHONE: Loading @@ -738,6 +727,8 @@ public final class Utils { return context.getString(R.string.permission_description_summary_sensors); case SMS: return context.getString(R.string.permission_description_summary_sms); case STORAGE: return context.getString(R.string.permission_description_summary_storage); default: return context.getString(R.string.permission_description_summary_generic, description); Loading