Loading packages/SystemUI/src/com/android/systemui/doze/DozeMachine.java +7 −4 Original line number Diff line number Diff line Loading @@ -43,6 +43,8 @@ public class DozeMachine { static final String TAG = "DozeMachine"; static final boolean DEBUG = DozeService.DEBUG; private static final String REASON_CHANGE_STATE = "DozeMachine#requestState"; private static final String REASON_HELD_FOR_STATE = "DozeMachine#heldForState"; public enum State { /** Default state. Transition to INITIALIZED to get Doze going. */ Loading Loading @@ -167,14 +169,14 @@ public class DozeMachine { boolean runNow = !isExecutingTransition(); mQueuedRequests.add(requestedState); if (runNow) { mWakeLock.acquire(); mWakeLock.acquire(REASON_CHANGE_STATE); for (int i = 0; i < mQueuedRequests.size(); i++) { // Transitions in Parts can call back into requestState, which will // cause mQueuedRequests to grow. transitionTo(mQueuedRequests.get(i), pulseReason); } mQueuedRequests.clear(); mWakeLock.release(); mWakeLock.release(REASON_CHANGE_STATE); } } Loading Loading @@ -311,10 +313,10 @@ public class DozeMachine { private void updateWakeLockState(State newState) { boolean staysAwake = newState.staysAwake(); if (mWakeLockHeldForCurrentState && !staysAwake) { mWakeLock.release(); mWakeLock.release(REASON_HELD_FOR_STATE); mWakeLockHeldForCurrentState = false; } else if (!mWakeLockHeldForCurrentState && staysAwake) { mWakeLock.acquire(); mWakeLock.acquire(REASON_HELD_FOR_STATE); mWakeLockHeldForCurrentState = true; } } Loading @@ -336,6 +338,7 @@ public class DozeMachine { public void dump(PrintWriter pw) { pw.print(" state="); pw.println(mState); pw.print(" wakeLockHeldForCurrentState="); pw.println(mWakeLockHeldForCurrentState); pw.print(" wakeLock="); pw.println(mWakeLock); pw.println("Parts:"); for (Part p : mParts) { p.dump(pw); Loading packages/SystemUI/src/com/android/systemui/doze/DozeScreenState.java +1 −1 Original line number Diff line number Diff line Loading @@ -57,7 +57,7 @@ public class DozeScreenState implements DozeMachine.Part { mDozeService = service; mHandler = handler; mParameters = parameters; mWakeLock = new SettableWakeLock(wakeLock); mWakeLock = new SettableWakeLock(wakeLock, TAG); } @Override Loading packages/SystemUI/src/com/android/systemui/doze/DozeTriggers.java +2 −2 Original line number Diff line number Diff line Loading @@ -348,7 +348,7 @@ public class DozeTriggers implements DozeMachine.Part { mSensorManager.registerListener(this, sensor, SensorManager.SENSOR_DELAY_NORMAL, 0, mHandler); mHandler.postDelayed(this, TIMEOUT_DELAY_MS); mWakeLock.acquire(); mWakeLock.acquire(TAG); mRegistered = true; } Loading Loading @@ -383,7 +383,7 @@ public class DozeTriggers implements DozeMachine.Part { } onProximityResult(result); if (wasRegistered) { mWakeLock.release(); mWakeLock.release(TAG); } mFinished = true; } Loading packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java +1 −1 Original line number Diff line number Diff line Loading @@ -130,7 +130,7 @@ public class KeyguardIndicationController implements StateListener { mTextView.getTextColors() : ColorStateList.valueOf(Color.WHITE); mDisclosure = indicationArea.findViewById(R.id.keyguard_indication_enterprise_disclosure); mLockIcon = lockIcon; mWakeLock = new SettableWakeLock(wakeLock); mWakeLock = new SettableWakeLock(wakeLock, TAG); Resources res = context.getResources(); mSlowThreshold = res.getInteger(R.integer.config_chargingSlowlyThreshold); Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java +2 −2 Original line number Diff line number Diff line Loading @@ -340,7 +340,7 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, OnCo if (!mWakeLockHeld) { if (mWakeLock != null) { mWakeLockHeld = true; mWakeLock.acquire(); mWakeLock.acquire(TAG); } else { Log.w(TAG, "Cannot hold wake lock, it has not been set yet"); } Loading Loading @@ -654,7 +654,7 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, OnCo private void onFinished(Callback callback) { if (mWakeLockHeld) { mWakeLock.release(); mWakeLock.release(TAG); mWakeLockHeld = false; } Loading Loading
packages/SystemUI/src/com/android/systemui/doze/DozeMachine.java +7 −4 Original line number Diff line number Diff line Loading @@ -43,6 +43,8 @@ public class DozeMachine { static final String TAG = "DozeMachine"; static final boolean DEBUG = DozeService.DEBUG; private static final String REASON_CHANGE_STATE = "DozeMachine#requestState"; private static final String REASON_HELD_FOR_STATE = "DozeMachine#heldForState"; public enum State { /** Default state. Transition to INITIALIZED to get Doze going. */ Loading Loading @@ -167,14 +169,14 @@ public class DozeMachine { boolean runNow = !isExecutingTransition(); mQueuedRequests.add(requestedState); if (runNow) { mWakeLock.acquire(); mWakeLock.acquire(REASON_CHANGE_STATE); for (int i = 0; i < mQueuedRequests.size(); i++) { // Transitions in Parts can call back into requestState, which will // cause mQueuedRequests to grow. transitionTo(mQueuedRequests.get(i), pulseReason); } mQueuedRequests.clear(); mWakeLock.release(); mWakeLock.release(REASON_CHANGE_STATE); } } Loading Loading @@ -311,10 +313,10 @@ public class DozeMachine { private void updateWakeLockState(State newState) { boolean staysAwake = newState.staysAwake(); if (mWakeLockHeldForCurrentState && !staysAwake) { mWakeLock.release(); mWakeLock.release(REASON_HELD_FOR_STATE); mWakeLockHeldForCurrentState = false; } else if (!mWakeLockHeldForCurrentState && staysAwake) { mWakeLock.acquire(); mWakeLock.acquire(REASON_HELD_FOR_STATE); mWakeLockHeldForCurrentState = true; } } Loading @@ -336,6 +338,7 @@ public class DozeMachine { public void dump(PrintWriter pw) { pw.print(" state="); pw.println(mState); pw.print(" wakeLockHeldForCurrentState="); pw.println(mWakeLockHeldForCurrentState); pw.print(" wakeLock="); pw.println(mWakeLock); pw.println("Parts:"); for (Part p : mParts) { p.dump(pw); Loading
packages/SystemUI/src/com/android/systemui/doze/DozeScreenState.java +1 −1 Original line number Diff line number Diff line Loading @@ -57,7 +57,7 @@ public class DozeScreenState implements DozeMachine.Part { mDozeService = service; mHandler = handler; mParameters = parameters; mWakeLock = new SettableWakeLock(wakeLock); mWakeLock = new SettableWakeLock(wakeLock, TAG); } @Override Loading
packages/SystemUI/src/com/android/systemui/doze/DozeTriggers.java +2 −2 Original line number Diff line number Diff line Loading @@ -348,7 +348,7 @@ public class DozeTriggers implements DozeMachine.Part { mSensorManager.registerListener(this, sensor, SensorManager.SENSOR_DELAY_NORMAL, 0, mHandler); mHandler.postDelayed(this, TIMEOUT_DELAY_MS); mWakeLock.acquire(); mWakeLock.acquire(TAG); mRegistered = true; } Loading Loading @@ -383,7 +383,7 @@ public class DozeTriggers implements DozeMachine.Part { } onProximityResult(result); if (wasRegistered) { mWakeLock.release(); mWakeLock.release(TAG); } mFinished = true; } Loading
packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java +1 −1 Original line number Diff line number Diff line Loading @@ -130,7 +130,7 @@ public class KeyguardIndicationController implements StateListener { mTextView.getTextColors() : ColorStateList.valueOf(Color.WHITE); mDisclosure = indicationArea.findViewById(R.id.keyguard_indication_enterprise_disclosure); mLockIcon = lockIcon; mWakeLock = new SettableWakeLock(wakeLock); mWakeLock = new SettableWakeLock(wakeLock, TAG); Resources res = context.getResources(); mSlowThreshold = res.getInteger(R.integer.config_chargingSlowlyThreshold); Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java +2 −2 Original line number Diff line number Diff line Loading @@ -340,7 +340,7 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, OnCo if (!mWakeLockHeld) { if (mWakeLock != null) { mWakeLockHeld = true; mWakeLock.acquire(); mWakeLock.acquire(TAG); } else { Log.w(TAG, "Cannot hold wake lock, it has not been set yet"); } Loading Loading @@ -654,7 +654,7 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, OnCo private void onFinished(Callback callback) { if (mWakeLockHeld) { mWakeLock.release(); mWakeLock.release(TAG); mWakeLockHeld = false; } Loading