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

Commit 88f186ee authored by Harshad Dhabu's avatar Harshad Dhabu Committed by Android (Google) Code Review
Browse files

Merge "Introduce battery_saver_supported_check_api flag" into main

parents 53087582 2fa323d8
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -2287,7 +2287,7 @@ package android.os {
  public final class PowerManager {
  public final class PowerManager {
    method public boolean areAutoPowerSaveModesEnabled();
    method public boolean areAutoPowerSaveModesEnabled();
    method @RequiresPermission(anyOf={android.Manifest.permission.MANAGE_LOW_POWER_STANDBY, android.Manifest.permission.DEVICE_POWER}) public void forceLowPowerStandbyActive(boolean);
    method @RequiresPermission(anyOf={android.Manifest.permission.MANAGE_LOW_POWER_STANDBY, android.Manifest.permission.DEVICE_POWER}) public void forceLowPowerStandbyActive(boolean);
    method public boolean isBatterySaverSupported();
    method @FlaggedApi("android.os.battery_saver_supported_check_api") public boolean isBatterySaverSupported();
    field public static final String ACTION_ENHANCED_DISCHARGE_PREDICTION_CHANGED = "android.os.action.ENHANCED_DISCHARGE_PREDICTION_CHANGED";
    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
    field @RequiresPermission(android.Manifest.permission.DEVICE_POWER) public static final int SYSTEM_WAKELOCK = -2147483648; // 0x80000000
  }
  }
+2 −0
Original line number Original line Diff line number Diff line
@@ -16,6 +16,7 @@


package android.os;
package android.os;


import android.annotation.FlaggedApi;
import android.Manifest.permission;
import android.Manifest.permission;
import android.annotation.CallbackExecutor;
import android.annotation.CallbackExecutor;
import android.annotation.CurrentTimeMillisLong;
import android.annotation.CurrentTimeMillisLong;
@@ -1940,6 +1941,7 @@ public final class PowerManager {
     *
     *
     * @hide
     * @hide
     */
     */
    @FlaggedApi(android.os.Flags.FLAG_BATTERY_SAVER_SUPPORTED_CHECK_API)
    @TestApi
    @TestApi
    public boolean isBatterySaverSupported() {
    public boolean isBatterySaverSupported() {
        try {
        try {
+7 −0
Original line number Original line Diff line number Diff line
@@ -41,3 +41,10 @@ flag {
    description: "Guards the ADPF power efficiency API"
    description: "Guards the ADPF power efficiency API"
    bug: "288117936"
    bug: "288117936"
}
}

flag {
    name: "battery_saver_supported_check_api"
    namespace: "backstage_power"
    description: "Guards a new API in PowerManager to check if battery saver is supported or not."
    bug: "305067031"
}
 No newline at end of file