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

Commit 7c3b70bd authored by Amith Yamasani's avatar Amith Yamasani
Browse files

Intent API for background restriction settings

The intent allows developers to request the user to
unrestrict an app that has background restrictions set
on it.

Bug: 323201239
Test: atest ActivityManagerTest

Change-Id: I8af7b45f4b096e5415808e6f6323f61e1db92f51
parent d2d7a20f
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -36923,6 +36923,7 @@ package android.provider {
    field public static final String ACTION_APP_USAGE_SETTINGS = "android.settings.action.APP_USAGE_SETTINGS";
    field @FlaggedApi("android.app.modes_api") public static final String ACTION_AUTOMATIC_ZEN_RULE_SETTINGS = "android.settings.AUTOMATIC_ZEN_RULE_SETTINGS";
    field public static final String ACTION_AUTO_ROTATE_SETTINGS = "android.settings.AUTO_ROTATE_SETTINGS";
    field @FlaggedApi("android.app.app_restrictions_api") public static final String ACTION_BACKGROUND_RESTRICTIONS_SETTINGS = "android.settings.BACKGROUND_RESTRICTIONS_SETTINGS";
    field public static final String ACTION_BATTERY_SAVER_SETTINGS = "android.settings.BATTERY_SAVER_SETTINGS";
    field public static final String ACTION_BIOMETRIC_ENROLL = "android.settings.BIOMETRIC_ENROLL";
    field public static final String ACTION_BLUETOOTH_SETTINGS = "android.settings.BLUETOOTH_SETTINGS";
+17 −0
Original line number Diff line number Diff line
@@ -1533,6 +1533,23 @@ public final class Settings {
    public static final String ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS =
            "android.settings.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS";
    /**
     * Activity Action: Show screen for controlling any background restrictions imposed on
     * an app. If the system returns true for
     * {@link android.app.ActivityManager#isBackgroundRestricted()}, and the app is not able to
     * satisfy user requests due to being restricted in the background, then this intent can be
     * used to request the user to unrestrict the app.
     * <p>
     * Input: The Intent's data URI must specify the application package name
     *        to be shown, with the "package" scheme, such as "package:com.my.app".
     * <p>
     * Output: Nothing.
     */
    @FlaggedApi(android.app.Flags.FLAG_APP_RESTRICTIONS_API)
    @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
    public static final String ACTION_BACKGROUND_RESTRICTIONS_SETTINGS =
            "android.settings.BACKGROUND_RESTRICTIONS_SETTINGS";
    /**
     * Activity Action: Open the advanced power usage details page of an associated app.
     * <p>