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

Commit 1884e57d authored by Robyn Coultas's avatar Robyn Coultas Committed by Itzhak Katzenelson
Browse files

Wake screen when timer klaxon starts

Bug:7300009
Change-Id: Id84cf53c373bca19a3086f9c522ee3ea8d729760
parent 386d8b05
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -42,6 +42,16 @@ class AlarmAlertWakeLock {
        sCpuWakeLock.acquire();
    }

    static void acquireScreenCpuWakeLock(Context context) {
        if (sCpuWakeLock != null) {
            return;
        }
        PowerManager pm = (PowerManager) context.getSystemService(Context.POWER_SERVICE);
        sCpuWakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK
                | PowerManager.ACQUIRE_CAUSES_WAKEUP | PowerManager.ON_AFTER_RELEASE, Log.LOGTAG);
        sCpuWakeLock.acquire();
    }

    static void releaseCpuLock() {
        if (sCpuWakeLock != null) {
            sCpuWakeLock.release();
+1 −1
Original line number Diff line number Diff line
@@ -63,7 +63,7 @@ public class TimerRingService extends Service {
                (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);
        mTelephonyManager.listen(
                mPhoneStateListener, PhoneStateListener.LISTEN_CALL_STATE);
        AlarmAlertWakeLock.acquireCpuWakeLock(this);
        AlarmAlertWakeLock.acquireScreenCpuWakeLock(this);
    }

    @Override