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

Commit ee7d195f authored by Bernardo Rufino's avatar Bernardo Rufino Committed by Android (Google) Code Review
Browse files

Merge "Add MANAGE_APP_OVERLAY_PERMISSION intent action"

parents ae03befa 8fefb946
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -7031,6 +7031,7 @@ package android.provider {
    field public static final String ACTION_ACCESSIBILITY_DETAILS_SETTINGS = "android.settings.ACCESSIBILITY_DETAILS_SETTINGS";
    field public static final String ACTION_ENTERPRISE_PRIVACY_SETTINGS = "android.settings.ENTERPRISE_PRIVACY_SETTINGS";
    field public static final String ACTION_LOCATION_CONTROLLER_EXTRA_PACKAGE_SETTINGS = "android.settings.LOCATION_CONTROLLER_EXTRA_PACKAGE_SETTINGS";
    field public static final String ACTION_MANAGE_APP_OVERLAY_PERMISSION = "android.settings.MANAGE_APP_OVERLAY_PERMISSION";
    field public static final String ACTION_MANAGE_DOMAIN_URLS = "android.settings.MANAGE_DOMAIN_URLS";
    field public static final String ACTION_MANAGE_MORE_DEFAULT_APPS_SETTINGS = "android.settings.MANAGE_MORE_DEFAULT_APPS_SETTINGS";
    field public static final String ACTION_NOTIFICATION_POLICY_ACCESS_DETAIL_SETTINGS = "android.settings.NOTIFICATION_POLICY_ACCESS_DETAIL_SETTINGS";
+1 −0
Original line number Diff line number Diff line
@@ -2462,6 +2462,7 @@ package android.provider {

  public final class Settings {
    field public static final String ACTION_ENTERPRISE_PRIVACY_SETTINGS = "android.settings.ENTERPRISE_PRIVACY_SETTINGS";
    field public static final String ACTION_MANAGE_APP_OVERLAY_PERMISSION = "android.settings.MANAGE_APP_OVERLAY_PERMISSION";
    field public static final String ACTION_REQUEST_ENABLE_CONTENT_CAPTURE = "android.settings.REQUEST_ENABLE_CONTENT_CAPTURE";
    field public static final int RESET_MODE_PACKAGE_DEFAULTS = 1; // 0x1
  }
+26 −2
Original line number Diff line number Diff line
@@ -832,8 +832,7 @@ public final class Settings {
    /**
     * Activity Action: Show screen for controlling which apps can draw on top of other apps.
     * <p>
     * In some cases, a matching Activity may not exist, so ensure you
     * safeguard against this.
     * In some cases, a matching Activity may not exist, so ensure you safeguard against this.
     * <p>
     * Input: Optionally, in versions of Android prior to 11, the Intent's data URI can specify the
     * application package name to directly invoke the management GUI specific to the package name.
@@ -845,6 +844,31 @@ public final class Settings {
    public static final String ACTION_MANAGE_OVERLAY_PERMISSION =
            "android.settings.action.MANAGE_OVERLAY_PERMISSION";
    /**
     * Activity Action: Show screen for controlling if the app specified in the data URI of the
     * intent can draw on top of other apps.
     * <p>
     * Unlike {@link #ACTION_MANAGE_OVERLAY_PERMISSION}, which in Android 11 can't be used to show
     * a GUI for a specific package, permission {@code android.permission.INTERNAL_SYSTEM_WINDOW} is
     * needed to start an activity with this intent.
     * <p>
     * In some cases, a matching Activity may not exist, so ensure you
     * safeguard against this.
     * <p>
     * Input: The Intent's data URI MUST specify the application package name whose ability of
     * drawing on top of other apps you want to control.
     * For example "package:com.my.app".
     * <p>
     * Output: Nothing.
     *
     * @hide
     */
    @TestApi
    @SystemApi
    @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
    public static final String ACTION_MANAGE_APP_OVERLAY_PERMISSION =
            "android.settings.MANAGE_APP_OVERLAY_PERMISSION";
    /**
     * Activity Action: Show screen for controlling which apps are allowed to write/modify
     * system settings.
+1 −1
Original line number Diff line number Diff line
@@ -174,7 +174,7 @@ public class NotificationGutsManager implements Dumpable, NotificationLifetimeEx
            if (ops.contains(OP_CAMERA) || ops.contains(OP_RECORD_AUDIO)) {
                startAppDetailsSettingsActivity(pkg, uid, null, row);
            } else {
                Intent intent = new Intent(Settings.ACTION_MANAGE_OVERLAY_PERMISSION);
                Intent intent = new Intent(Settings.ACTION_MANAGE_APP_OVERLAY_PERMISSION);
                intent.setData(Uri.fromParts("package", pkg, null));
                mNotificationActivityStarter.startNotificationGutsIntent(intent, uid, row);
            }
+1 −1
Original line number Diff line number Diff line
@@ -274,7 +274,7 @@ public class NotificationGutsManagerTest extends SysuiTestCase {
        ArgumentCaptor<Intent> captor = ArgumentCaptor.forClass(Intent.class);
        verify(mNotificationActivityStarter, times(1))
                .startNotificationGutsIntent(captor.capture(), anyInt(), any());
        assertEquals(Settings.ACTION_MANAGE_OVERLAY_PERMISSION, captor.getValue().getAction());
        assertEquals(Settings.ACTION_MANAGE_APP_OVERLAY_PERMISSION, captor.getValue().getAction());
    }

    @Test
Loading