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

Commit 2e33f592 authored by Philip Junker's avatar Philip Junker Committed by Android (Google) Code Review
Browse files

Merge "Restrict device wakeup via PowerManager.ACQUIRE_CAUSES_WAKEUP."

parents ca29d4cb 5adcf3bc
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -191,6 +191,7 @@ package android {
    field public static final String SUBSCRIBE_TO_KEYGUARD_LOCKED_STATE = "android.permission.SUBSCRIBE_TO_KEYGUARD_LOCKED_STATE";
    field public static final String SYSTEM_ALERT_WINDOW = "android.permission.SYSTEM_ALERT_WINDOW";
    field public static final String TRANSMIT_IR = "android.permission.TRANSMIT_IR";
    field public static final String TURN_SCREEN_ON = "android.permission.TURN_SCREEN_ON";
    field public static final String UNINSTALL_SHORTCUT = "com.android.launcher.permission.UNINSTALL_SHORTCUT";
    field public static final String UPDATE_DEVICE_STATS = "android.permission.UPDATE_DEVICE_STATS";
    field public static final String UPDATE_PACKAGES_WITHOUT_USER_ACTION = "android.permission.UPDATE_PACKAGES_WITHOUT_USER_ACTION";
@@ -31900,7 +31901,7 @@ package android.os {
    method public android.os.PowerManager.WakeLock newWakeLock(int, String);
    method @RequiresPermission(android.Manifest.permission.REBOOT) public void reboot(@Nullable String);
    method public void removeThermalStatusListener(@NonNull android.os.PowerManager.OnThermalStatusChangedListener);
    field @Deprecated public static final int ACQUIRE_CAUSES_WAKEUP = 268435456; // 0x10000000
    field @Deprecated @RequiresPermission(value=android.Manifest.permission.TURN_SCREEN_ON, conditional=true) public static final int ACQUIRE_CAUSES_WAKEUP = 268435456; // 0x10000000
    field public static final String ACTION_DEVICE_IDLE_MODE_CHANGED = "android.os.action.DEVICE_IDLE_MODE_CHANGED";
    field public static final String ACTION_DEVICE_LIGHT_IDLE_MODE_CHANGED = "android.os.action.LIGHT_DEVICE_IDLE_MODE_CHANGED";
    field public static final String ACTION_LOW_POWER_STANDBY_ENABLED_CHANGED = "android.os.action.LOW_POWER_STANDBY_ENABLED_CHANGED";
+5 −4
Original line number Diff line number Diff line
@@ -1906,6 +1906,7 @@ public class AppOpsManager {
            OP_USE_ICC_AUTH_WITH_DEVICE_IDENTIFIER,
            OP_SCHEDULE_EXACT_ALARM,
            OP_MANAGE_MEDIA,
            OP_TURN_SCREEN_ON,
    };

    /**
@@ -2362,7 +2363,7 @@ public class AppOpsManager {
            null,
            Manifest.permission.READ_EXTERNAL_STORAGE,
            Manifest.permission.WRITE_EXTERNAL_STORAGE,
            null, // no permission for turning the screen on
            Manifest.permission.TURN_SCREEN_ON,
            Manifest.permission.GET_ACCOUNTS,
            null, // no permission for running in background
            null, // no permission for changing accessibility volume
@@ -2491,7 +2492,7 @@ public class AppOpsManager {
            null, // MOCK_LOCATION
            null, // READ_EXTERNAL_STORAGE
            null, // WRITE_EXTERNAL_STORAGE
            null, // TURN_ON_SCREEN
            null, // TURN_SCREEN_ON
            null, // GET_ACCOUNTS
            null, // RUN_IN_BACKGROUND
            UserManager.DISALLOW_ADJUST_VOLUME, //AUDIO_ACCESSIBILITY_VOLUME
@@ -2619,7 +2620,7 @@ public class AppOpsManager {
            null, // MOCK_LOCATION
            null, // READ_EXTERNAL_STORAGE
            null, // WRITE_EXTERNAL_STORAGE
            null, // TURN_ON_SCREEN
            null, // TURN_SCREEN_ON
            null, // GET_ACCOUNTS
            null, // RUN_IN_BACKGROUND
            null, // AUDIO_ACCESSIBILITY_VOLUME
@@ -2746,7 +2747,7 @@ public class AppOpsManager {
            AppOpsManager.MODE_ERRORED, // MOCK_LOCATION
            AppOpsManager.MODE_ALLOWED, // READ_EXTERNAL_STORAGE
            AppOpsManager.MODE_ALLOWED, // WRITE_EXTERNAL_STORAGE
            AppOpsManager.MODE_ALLOWED, // TURN_SCREEN_ON
            AppOpsManager.MODE_ERRORED, // TURN_SCREEN_ON
            AppOpsManager.MODE_ALLOWED, // GET_ACCOUNTS
            AppOpsManager.MODE_ALLOWED, // RUN_IN_BACKGROUND
            AppOpsManager.MODE_ALLOWED, // AUDIO_ACCESSIBILITY_VOLUME
+5 −2
Original line number Diff line number Diff line
@@ -183,6 +183,9 @@ public final class PowerManager {
    /**
     * Wake lock flag: Turn the screen on when the wake lock is acquired.
     * <p>
     * This flag requires {@link android.Manifest.permission#TURN_SCREEN_ON} for apps targeting
     * Android version {@link Build.VERSION_CODES#UPSIDE_DOWN_CAKE} and higher.
     * </p><p>
     * Normally wake locks don't actually wake the device, they just cause the screen to remain on
     * once it's already on. This flag will cause the device to wake up when the wake lock is
     * acquired.
@@ -195,10 +198,10 @@ public final class PowerManager {
     *
     * @deprecated Most applications should use {@link android.R.attr#turnScreenOn} or
     * {@link android.app.Activity#setTurnScreenOn(boolean)} instead, as this prevents the previous
     * foreground app from being resumed first when the screen turns on. Note that this flag may
     * require a permission in the future.
     * foreground app from being resumed first when the screen turns on.
     */
    @Deprecated
    @RequiresPermission(value = android.Manifest.permission.TURN_SCREEN_ON, conditional = true)
    public static final int ACQUIRE_CAUSES_WAKEUP = 0x10000000;

    /**
+10 −1
Original line number Diff line number Diff line
@@ -1702,7 +1702,7 @@
        android:description="@string/permdesc_useBiometric"
        android:protectionLevel="normal" />

   <!-- ======================================================================= -->
    <!-- ====================================================================== -->
    <!-- Permissions for posting notifications                                  -->
    <!-- ====================================================================== -->
    <eat-comment />
@@ -2468,6 +2468,15 @@
        android:description="@string/permdesc_transmitIr"
        android:protectionLevel="normal" />

    <!-- Allows an app to turn on the screen on, e.g. with
         {@link android.os.PowerManager#ACQUIRE_CAUSES_WAKEUP}.
         <p>Intended to only be used by home automation apps.
    -->
    <permission android:name="android.permission.TURN_SCREEN_ON"
        android:label="@string/permlab_turnScreenOn"
        android:description="@string/permdesc_turnScreenOn"
        android:protectionLevel="normal|appop" />

    <!-- ==================================================== -->
    <!-- Permissions related to changing audio settings   -->
    <!-- ==================================================== -->
+5 −0
Original line number Diff line number Diff line
@@ -1618,6 +1618,11 @@
    <!-- Description of an application permission, listed so the user can choose whether they want to allow the application to do this. [CHAR_LIMIT=NONE] -->
    <string name="permdesc_postNotification">Allows the app to show notifications</string>

    <!-- Title of an application permission, listed so the user can choose whether they want to allow the application to do this. [CHAR_LIMIT=NONE] -->
    <string name="permlab_turnScreenOn">turn on the screen</string>
    <!-- Description of an application permission, listed so the user can choose whether they want to allow the application to do this. [CHAR_LIMIT=NONE] -->
    <string name="permdesc_turnScreenOn">Allows the app to turn on the screen.</string>

    <!-- Title of an application permission, listed so the user can choose whether they want to allow the application to do this. [CHAR_LIMIT=NONE] -->
    <string name="permlab_useBiometric">use biometric hardware</string>
    <!-- Description of an application permission, listed so the user can choose whether they want to allow the application to do this.[CHAR_LIMIT=NONE] -->
Loading