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

Commit 0ec09c63 authored by Mayank Garg's avatar Mayank Garg
Browse files

Make isInteractive(display) a testAPI

The API would be required in CTS to check the interactiveness of individual displays. In case of MUMD (multi user multi display) devices, it is possible that only one display (ex. driver display) is off, and PM#isInteractive returns true.

Flag: NONE hidden to test API

Bug: 369415968
Test: m
Change-Id: Id0d194984e37779c805eed8509025e43fccb89f1
parent 205cd9fd
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -2463,6 +2463,7 @@ package android.os {
    method public boolean areAutoPowerSaveModesEnabled();
    method @RequiresPermission(anyOf={android.Manifest.permission.MANAGE_LOW_POWER_STANDBY, android.Manifest.permission.DEVICE_POWER}) public void forceLowPowerStandbyActive(boolean);
    method @FlaggedApi("android.os.battery_saver_supported_check_api") public boolean isBatterySaverSupported();
    method public boolean isInteractive(int);
    field public static final String ACTION_ENHANCED_DISCHARGE_PREDICTION_CHANGED = "android.os.action.ENHANCED_DISCHARGE_PREDICTION_CHANGED";
    field @RequiresPermission(android.Manifest.permission.DEVICE_POWER) public static final int SYSTEM_WAKELOCK = -2147483648; // 0x80000000
  }
+2 −0
Original line number Diff line number Diff line
@@ -2127,6 +2127,8 @@ UnflaggedApi: android.os.BugreportParams#BUGREPORT_MODE_MAX_VALUE:
    New API must be flagged with @FlaggedApi: field android.os.BugreportParams.BUGREPORT_MODE_MAX_VALUE
UnflaggedApi: android.os.PowerManager#isBatterySaverSupported():
    New API must be flagged with @FlaggedApi: method android.os.PowerManager.isBatterySaverSupported()
UnflaggedApi: android.os.PowerManager#isInteractive(int):
    New API must be flagged with @FlaggedApi: method android.os.PowerManager.isInteractive(int)
UnflaggedApi: android.os.UserHandle#USER_CURRENT:
    New API must be flagged with @FlaggedApi: field android.os.UserHandle.USER_CURRENT
UnflaggedApi: android.os.UserManager#getAliveUsers():
+6 −4
Original line number Diff line number Diff line
@@ -1811,14 +1811,16 @@ public final class PowerManager {
    }

    /**
     * Returns the interactive state for a specific display, which may not be the same as the
     * global wakefulness (which is true when any display is awake).
     * Returns true if the specified display is in an interactive state. This may not be the
     * same as the global wakefulness (which is true when any display is interactive).
     * @see #isInteractive()
     *
     * @param displayId
     * @return whether the given display is present and interactive, or false
     * @param displayId The Display ID to check for interactivity.
     * @return True if the display is in an interactive state.
     *
     * @hide
     */
    @TestApi
    public boolean isInteractive(int displayId) {
        return mInteractiveCache.query(displayId);
    }