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

Commit da9185b8 authored by Automerger Merge Worker's avatar Automerger Merge Worker
Browse files

Merge "Change to public POWER_SAVE_MODE_CHANGED broadcast." into rvc-dev am: 1a847190

Change-Id: I6807e9d6a88c7a82b5835c773f1216bbe5cd3f24
parents e1c3cdf6 1a847190
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -39,7 +39,7 @@ public class BatterySaverReceiver extends BroadcastReceiver {
    public void onReceive(Context context, Intent intent) {
        if (DEBUG) Log.d(TAG, "Received " + intent.getAction());
        String action = intent.getAction();
        if (PowerManager.ACTION_POWER_SAVE_MODE_CHANGING.equals(action)) {
        if (PowerManager.ACTION_POWER_SAVE_MODE_CHANGED.equals(action)) {
            if (mBatterySaverListener != null) {
                mBatterySaverListener.onPowerSaveModeChanged();
            }
@@ -55,7 +55,7 @@ public class BatterySaverReceiver extends BroadcastReceiver {
    public void setListening(boolean listening) {
        if (listening && !mRegistered) {
            final IntentFilter ifilter = new IntentFilter();
            ifilter.addAction(PowerManager.ACTION_POWER_SAVE_MODE_CHANGING);
            ifilter.addAction(PowerManager.ACTION_POWER_SAVE_MODE_CHANGED);
            ifilter.addAction(Intent.ACTION_BATTERY_CHANGED);
            mContext.registerReceiver(this, ifilter);
            mRegistered = true;
+1 −1
Original line number Diff line number Diff line
@@ -68,7 +68,7 @@ public class BatterySaverReceiverTest {

    @Test
    public void testOnReceive_powerSaveModeChanged_invokeCallback() {
        Intent intent = new Intent(PowerManager.ACTION_POWER_SAVE_MODE_CHANGING);
        Intent intent = new Intent(PowerManager.ACTION_POWER_SAVE_MODE_CHANGED);

        mBatterySaverReceiver.onReceive(mContext, intent);