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

Commit d6825722 authored by Robert Horvath's avatar Robert Horvath Committed by Android (Google) Code Review
Browse files

Merge "Open POLICY_CHANGED broadcast up to public API"

parents ab3b2e35 a7a93b53
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -33458,6 +33458,7 @@ package android.os {
    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";
    field public static final String ACTION_LOW_POWER_STANDBY_POLICY_CHANGED = "android.os.action.LOW_POWER_STANDBY_POLICY_CHANGED";
    field public static final String ACTION_POWER_SAVE_MODE_CHANGED = "android.os.action.POWER_SAVE_MODE_CHANGED";
    field @Deprecated public static final int FULL_WAKE_LOCK = 26; // 0x1a
    field public static final int LOCATION_MODE_ALL_DISABLED_WHEN_SCREEN_OFF = 2; // 0x2
+0 −1
Original line number Diff line number Diff line
@@ -10660,7 +10660,6 @@ package android.os {
    method @RequiresPermission(anyOf={android.Manifest.permission.DEVICE_POWER, android.Manifest.permission.POWER_SAVER}) public boolean setPowerSaveModeEnabled(boolean);
    method @RequiresPermission(android.Manifest.permission.WRITE_DREAM_STATE) public void suppressAmbientDisplay(@NonNull String, boolean);
    method @RequiresPermission(anyOf={android.Manifest.permission.DEVICE_POWER, android.Manifest.permission.USER_ACTIVITY}) public void userActivity(long, int, int);
    field @RequiresPermission(android.Manifest.permission.MANAGE_LOW_POWER_STANDBY) public static final String ACTION_LOW_POWER_STANDBY_POLICY_CHANGED = "android.os.action.LOW_POWER_STANDBY_POLICY_CHANGED";
    field public static final int POWER_SAVE_MODE_TRIGGER_DYNAMIC = 1; // 0x1
    field public static final int POWER_SAVE_MODE_TRIGGER_PERCENTAGE = 0; // 0x0
    field public static final String REBOOT_USERSPACE = "userspace";
+4 −6
Original line number Diff line number Diff line
@@ -2968,15 +2968,13 @@ public final class PowerManager {
            "android.os.action.LOW_POWER_STANDBY_ENABLED_CHANGED";

    /**
     * Intent that is broadcast when Low Power Standby is enabled or disabled.
     * Intent that is broadcast when Low Power Standby policy is changed.
     * This broadcast is only sent to registered receivers.
     *
     * @see #getLowPowerStandbyPolicy
     * @see #setLowPowerStandbyPolicy
     * @hide
     * @see #isExemptFromLowPowerStandby()
     * @see #isAllowedInLowPowerStandby(int)
     * @see #isAllowedInLowPowerStandby(String)
     */
    @SystemApi
    @RequiresPermission(android.Manifest.permission.MANAGE_LOW_POWER_STANDBY)
    @SdkConstant(SdkConstant.SdkConstantType.BROADCAST_INTENT_ACTION)
    public static final String ACTION_LOW_POWER_STANDBY_POLICY_CHANGED =
            "android.os.action.LOW_POWER_STANDBY_POLICY_CHANGED";
+1 −3
Original line number Diff line number Diff line
@@ -19,7 +19,6 @@ package com.android.server.power;
import static android.os.PowerManager.LOW_POWER_STANDBY_ALLOWED_REASON_TEMP_POWER_SAVE_ALLOWLIST;
import static android.os.PowerManager.lowPowerStandbyAllowedReasonsToString;

import android.Manifest;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.app.AlarmManager;
@@ -692,8 +691,7 @@ public class LowPowerStandbyController {
        final Intent intent = new Intent(
                PowerManager.ACTION_LOW_POWER_STANDBY_POLICY_CHANGED);
        intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY | Intent.FLAG_RECEIVER_FOREGROUND);
        mContext.sendBroadcastAsUser(intent, UserHandle.ALL,
                Manifest.permission.MANAGE_LOW_POWER_STANDBY);
        mContext.sendBroadcastAsUser(intent, UserHandle.ALL);
    }

    private void onStandbyTimeoutExpired() {