summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Hai Zhang <zhanghai@google.com> 2019-11-13 15:53:37 -0800
committer Hai Zhang <zhanghai@google.com> 2020-01-09 13:24:45 -0800
commit6d3a1b80b038cc98794b6c7e19a320f330eab75a (patch)
treebfe61be1a2c2c9d448ac1bfd0b58bf6119f99687
parentb4632bca2e330dfdea959665e86153b985da5fd5 (diff)
Replace system gallery permission granting with system gallery role.
This change also adds a system API config_systemGallery, because the old way of determining the system gallery app by Intent.CATEGORY_APP_GALLERY is considered unreliable. Bug: 144307267 Bug: 136500975 Test: manually confirm that the system default gallery is granted privileges Change-Id: I8b1bf79e9041108ed5253fd6c89c9ee8e78faac8
-rwxr-xr-xapi/system-current.txt1
-rw-r--r--api/test-current.txt1
-rw-r--r--core/res/res/values/config.xml2
-rw-r--r--core/res/res/values/public.xml2
-rw-r--r--services/core/java/com/android/server/pm/permission/DefaultPermissionGrantPolicy.java6
5 files changed, 6 insertions, 6 deletions
diff --git a/api/system-current.txt b/api/system-current.txt
index 384dc13ff567..2fb731bab5fc 100755
--- a/api/system-current.txt
+++ b/api/system-current.txt
@@ -282,6 +282,7 @@ package android {
field public static final int config_helpIntentNameKey = 17039390; // 0x104001e
field public static final int config_helpPackageNameKey = 17039387; // 0x104001b
field public static final int config_helpPackageNameValue = 17039388; // 0x104001c
+ field public static final int config_systemGallery = 17039402; // 0x104002a
}
public static final class R.style {
diff --git a/api/test-current.txt b/api/test-current.txt
index d017dd63bdd3..2a30a35f8552 100644
--- a/api/test-current.txt
+++ b/api/test-current.txt
@@ -34,6 +34,7 @@ package android {
public static final class R.string {
field public static final int config_defaultAssistant = 17039393; // 0x1040021
field public static final int config_defaultDialer = 17039395; // 0x1040023
+ field public static final int config_systemGallery = 17039402; // 0x104002a
}
}
diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml
index 245aed1484f7..c3ddb1531bf7 100644
--- a/core/res/res/values/config.xml
+++ b/core/res/res/values/config.xml
@@ -1895,6 +1895,8 @@
<string name="config_defaultCallRedirection" translatable="false"></string>
<!-- The name of the package that will hold the call screening role by default. -->
<string name="config_defaultCallScreening" translatable="false"></string>
+ <!-- The name of the package that will hold the system gallery role. -->
+ <string name="config_systemGallery" translatable="false">com.android.gallery</string>
<!-- Enable/disable default bluetooth profiles:
HSP_AG, ObexObjectPush, Audio, NAP -->
diff --git a/core/res/res/values/public.xml b/core/res/res/values/public.xml
index 817ccde98504..732114682bd8 100644
--- a/core/res/res/values/public.xml
+++ b/core/res/res/values/public.xml
@@ -3031,6 +3031,8 @@
<public name="config_defaultCallRedirection" />
<!-- @hide @SystemApi -->
<public name="config_defaultCallScreening" />
+ <!-- @hide @SystemApi @TestApi -->
+ <public name="config_systemGallery" />
</public-group>
<public-group type="bool" first-id="0x01110005">
diff --git a/services/core/java/com/android/server/pm/permission/DefaultPermissionGrantPolicy.java b/services/core/java/com/android/server/pm/permission/DefaultPermissionGrantPolicy.java
index 6d6ec250e4cc..46893b25de9a 100644
--- a/services/core/java/com/android/server/pm/permission/DefaultPermissionGrantPolicy.java
+++ b/services/core/java/com/android/server/pm/permission/DefaultPermissionGrantPolicy.java
@@ -592,12 +592,6 @@ public final class DefaultPermissionGrantPolicy {
getDefaultSystemHandlerActivityPackageForCategory(Intent.CATEGORY_APP_MAPS, userId),
userId, ALWAYS_LOCATION_PERMISSIONS);
- // Gallery
- grantPermissionsToSystemPackage(
- getDefaultSystemHandlerActivityPackageForCategory(
- Intent.CATEGORY_APP_GALLERY, userId),
- userId, STORAGE_PERMISSIONS);
-
// Email
grantPermissionsToSystemPackage(
getDefaultSystemHandlerActivityPackageForCategory(