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

Commit e6f8cb29 authored by Julius D'souza's avatar Julius D'souza
Browse files

fix case issues with mGoingIdleWakeLock in DeviceIdleController

Bug: 31900521

Change-Id: I9484b10f0e6b99dfaf11266bb275a31d7ff3868c
parent f9f39cc4
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -172,7 +172,7 @@ public class DeviceIdleController extends SystemService
    /**
     * Wakelock held when going idle so hardware (especially NetworkPolicyManager) can shut down.
     */
    private PowerManager.WakeLock mGoingIdleWakelock;
    private PowerManager.WakeLock mGoingIdleWakeLock;

    public final AtomicFile mConfigFile;

@@ -710,7 +710,7 @@ public class DeviceIdleController extends SystemService
                    handleWriteConfigFile();
                } break;
                case MSG_REPORT_IDLE_ON: {
                    // mGoingIdleWakelock is held at this point
                    // mGoingIdleWakeLock is held at this point
                    EventLogTags.writeDeviceIdleOnStart();
                    mLocalPowerManager.setDeviceIdleMode(true);
                    try {
@@ -720,7 +720,7 @@ public class DeviceIdleController extends SystemService
                    }
                    getContext().sendBroadcastAsUser(mIdleIntent, UserHandle.ALL);
                    EventLogTags.writeDeviceIdleOnComplete();
                    mGoingIdleWakelock.release();
                    mGoingIdleWakeLock.release();
                } break;
                case MSG_REPORT_IDLE_OFF: {
                    EventLogTags.writeDeviceIdleOffStart("unknown");
@@ -1411,7 +1411,7 @@ public class DeviceIdleController extends SystemService
                mNextIdleDelay = Math.min(mNextIdleDelay, mConstants.MAX_IDLE_TIMEOUT);
                mState = STATE_IDLE;
                EventLogTags.writeDeviceIdle(mState, "step");
                mGoingIdleWakelock.acquire();
                mGoingIdleWakeLock.acquire();
                mHandler.sendEmptyMessage(MSG_REPORT_IDLE_ON);
                break;
            case STATE_IDLE: