Merge "Make isInteractive(display) a testAPI" into main
diff --git a/core/api/test-current.txt b/core/api/test-current.txt
index ad1d937..bc2bc89 100644
--- a/core/api/test-current.txt
+++ b/core/api/test-current.txt
@@ -2493,6 +2493,7 @@
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
}
diff --git a/core/api/test-lint-baseline.txt b/core/api/test-lint-baseline.txt
index c2fac70..9140bdf 100644
--- a/core/api/test-lint-baseline.txt
+++ b/core/api/test-lint-baseline.txt
@@ -2139,6 +2139,8 @@
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():
diff --git a/core/java/android/os/PowerManager.java b/core/java/android/os/PowerManager.java
index 07fded1..9e7bf47 100644
--- a/core/java/android/os/PowerManager.java
+++ b/core/java/android/os/PowerManager.java
@@ -1823,14 +1823,16 @@
}
/**
- * 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);
}