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

Commit 9f5961a4 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Remove POWER_SAVE_MODE_CHANGING broadcast."

parents 8733431e f7cd0673
Loading
Loading
Loading
Loading
+0 −27
Original line number Diff line number Diff line
@@ -2220,33 +2220,6 @@ public final class PowerManager {
    public static final String ACTION_POWER_SAVE_TEMP_WHITELIST_CHANGED
            = "android.os.action.POWER_SAVE_TEMP_WHITELIST_CHANGED";

    /**
     * Intent that is broadcast when the state of {@link #isPowerSaveMode()} is about to change.
     * This broadcast is only sent to registered receivers.
     *
     * @deprecated This is sent at the same time as {@link #ACTION_POWER_SAVE_MODE_CHANGED} so it
     * does not provide advanced warning. As such it will be removed in future Android versions.
     * Use {@link #ACTION_POWER_SAVE_MODE_CHANGED} and {@link #isPowerSaveMode()} instead.
     *
     * @hide
     */
    @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.Q,
            publicAlternatives = "Use {@link #ACTION_POWER_SAVE_MODE_CHANGED} instead.")
    @SdkConstant(SdkConstant.SdkConstantType.BROADCAST_INTENT_ACTION)
    @Deprecated
    public static final String ACTION_POWER_SAVE_MODE_CHANGING
            = "android.os.action.POWER_SAVE_MODE_CHANGING";

    /**
     * @deprecated Use {@link #isPowerSaveMode()} instead.
     *
     * @hide
     */
    @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.Q,
            publicAlternatives = "Use {@link #isPowerSaveMode()} instead.")
    @Deprecated
    public static final String EXTRA_POWER_SAVE_MODE = "mode";

    /**
     * Constant for PreIdleTimeout normal mode (default mode, not short nor extend timeout) .
     * @hide
+0 −1
Original line number Diff line number Diff line
@@ -99,7 +99,6 @@
    <protected-broadcast android:name="android.intent.action.LOAD_DATA" />

    <protected-broadcast android:name="android.os.action.POWER_SAVE_MODE_CHANGED" />
    <protected-broadcast android:name="android.os.action.POWER_SAVE_MODE_CHANGING" />
    <protected-broadcast android:name="android.os.action.DEVICE_IDLE_MODE_CHANGED" />
    <protected-broadcast android:name="android.os.action.POWER_SAVE_WHITELIST_CHANGED" />
    <protected-broadcast android:name="android.os.action.POWER_SAVE_TEMP_WHITELIST_CHANGED" />
+1 −6
Original line number Diff line number Diff line
@@ -497,12 +497,7 @@ public class BatterySaverController implements BatterySaverPolicyListener {

            // Send the broadcasts and notify the listeners. We only do this when the battery saver
            // mode changes, but not when only the screen state changes.
            Intent intent = new Intent(PowerManager.ACTION_POWER_SAVE_MODE_CHANGING)
                    .putExtra(PowerManager.EXTRA_POWER_SAVE_MODE, isEnabled())
                    .addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY);
            mContext.sendBroadcastAsUser(intent, UserHandle.ALL);

            intent = new Intent(PowerManager.ACTION_POWER_SAVE_MODE_CHANGED);
            Intent intent = new Intent(PowerManager.ACTION_POWER_SAVE_MODE_CHANGED);
            intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY);
            mContext.sendBroadcastAsUser(intent, UserHandle.ALL);