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

Commit d4aa6edf authored by Kweku Adams's avatar Kweku Adams
Browse files

Stop listening to POWER_SAVE_MODE_CHANGING broadcast.

The POWER_SAVE_MODE_CHANGING broadcast is sent at the same time as the
POWER_SAVE_MODE_CHANGED broadcast. Since broadcasts are asynchronous,
there's no reason to have both or listen to both, especially since it
potentially lead to inconsistency.

Bug: 79580230
Test: Android builds
Change-Id: I5c0448e98cc83a0d0d02e95f477e6632f79fd039
parent 3bdd15fb
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -99,7 +99,6 @@ public class BatteryControllerImpl extends BroadcastReceiver implements BatteryC
        IntentFilter filter = new IntentFilter();
        filter.addAction(Intent.ACTION_BATTERY_CHANGED);
        filter.addAction(PowerManager.ACTION_POWER_SAVE_MODE_CHANGED);
        filter.addAction(PowerManager.ACTION_POWER_SAVE_MODE_CHANGING);
        filter.addAction(ACTION_LEVEL_TEST);
        mBroadcastDispatcher.registerReceiver(this, filter);
    }
@@ -155,8 +154,6 @@ public class BatteryControllerImpl extends BroadcastReceiver implements BatteryC
            fireBatteryLevelChanged();
        } else if (action.equals(PowerManager.ACTION_POWER_SAVE_MODE_CHANGED)) {
            updatePowerSave();
        } else if (action.equals(PowerManager.ACTION_POWER_SAVE_MODE_CHANGING)) {
            setPowerSave(intent.getBooleanExtra(PowerManager.EXTRA_POWER_SAVE_MODE, false));
        } else if (action.equals(ACTION_LEVEL_TEST)) {
            mTestmode = true;
            mMainHandler.post(new Runnable() {