Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6d3a1b80 authored by Hai Zhang's avatar Hai Zhang
Browse files

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
parent b4632bca
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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 {
+1 −0
Original line number Diff line number Diff line
@@ -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
  }

}
+2 −0
Original line number Diff line number Diff line
@@ -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 -->
+2 −0
Original line number Diff line number Diff line
@@ -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">
+0 −6
Original line number Diff line number Diff line
@@ -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(