Loading core/java/android/view/WindowManagerPolicy.java +4 −6 Original line number Diff line number Diff line Loading @@ -443,8 +443,6 @@ public interface WindowManagerPolicy { public final int OFF_BECAUSE_OF_USER = 2; /** Screen turned off because of timeout */ public final int OFF_BECAUSE_OF_TIMEOUT = 3; /** Screen turned off because of proximity sensor */ public final int OFF_BECAUSE_OF_PROX_SENSOR = 4; /** @hide */ @IntDef({USER_ROTATION_FREE, USER_ROTATION_LOCKED}) Loading Loading @@ -900,23 +898,23 @@ public interface WindowManagerPolicy { public int focusChangedLw(WindowState lastFocus, WindowState newFocus); /** * Called after the screen turns off. * Called when the device is going to sleep. * * @param why {@link #OFF_BECAUSE_OF_USER} or * {@link #OFF_BECAUSE_OF_TIMEOUT}. */ public void screenTurnedOff(int why); public void goingToSleep(int why); public interface ScreenOnListener { void onScreenOn(); } /** * Called when the power manager would like to turn the screen on. * Called when the device is waking up. * Must call back on the listener to tell it when the higher-level system * is ready for the screen to go on (i.e. the lock screen is shown). */ public void screenTurningOn(ScreenOnListener screenOnListener); public void wakingUp(ScreenOnListener screenOnListener); /** * Return whether the screen is about to turn on or is currently on. Loading packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitorCallback.java +3 −3 Original line number Diff line number Diff line Loading @@ -168,9 +168,9 @@ public class KeyguardUpdateMonitorCallback { /** * Called when the screen turns off * @param why {@link WindowManagerPolicy#OFF_BECAUSE_OF_USER}, * {@link WindowManagerPolicy#OFF_BECAUSE_OF_TIMEOUT} or * {@link WindowManagerPolicy#OFF_BECAUSE_OF_PROX_SENSOR}. * @param why either {@link WindowManagerPolicy#OFF_BECAUSE_OF_ADMIN}, * {@link WindowManagerPolicy#OFF_BECAUSE_OF_USER}, or * {@link WindowManagerPolicy#OFF_BECAUSE_OF_TIMEOUT}. */ public void onScreenTurnedOff(int why) { } Loading packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java +2 −5 Original line number Diff line number Diff line Loading @@ -542,9 +542,8 @@ public class KeyguardViewMediator extends SystemUI { /** * Called to let us know the screen was turned off. * @param why either {@link android.view.WindowManagerPolicy#OFF_BECAUSE_OF_USER}, * {@link android.view.WindowManagerPolicy#OFF_BECAUSE_OF_TIMEOUT} or * {@link android.view.WindowManagerPolicy#OFF_BECAUSE_OF_PROX_SENSOR}. * @param why either {@link android.view.WindowManagerPolicy#OFF_BECAUSE_OF_USER} or * {@link android.view.WindowManagerPolicy#OFF_BECAUSE_OF_TIMEOUT}. */ public void onScreenTurnedOff(int why) { synchronized (this) { Loading Loading @@ -576,8 +575,6 @@ public class KeyguardViewMediator extends SystemUI { } else if (why == WindowManagerPolicy.OFF_BECAUSE_OF_TIMEOUT || (why == WindowManagerPolicy.OFF_BECAUSE_OF_USER && !lockImmediately)) { doKeyguardLaterLocked(); } else if (why == WindowManagerPolicy.OFF_BECAUSE_OF_PROX_SENSOR) { // Do not enable the keyguard if the prox sensor forced the screen off. } else { doKeyguardLocked(null); } Loading policy/src/com/android/internal/policy/impl/PhoneWindowManager.java +4 −4 Original line number Diff line number Diff line Loading @@ -990,9 +990,9 @@ public class PhoneWindowManager implements WindowManagerPolicy { // Match current screen state. if (mPowerManager.isInteractive()) { screenTurningOn(null); wakingUp(null); } else { screenTurnedOff(WindowManagerPolicy.OFF_BECAUSE_OF_USER); goingToSleep(WindowManagerPolicy.OFF_BECAUSE_OF_USER); } } Loading Loading @@ -4314,7 +4314,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { } @Override public void screenTurnedOff(int why) { public void goingToSleep(int why) { EventLog.writeEvent(70000, 0); synchronized (mLock) { mScreenOnEarly = false; Loading @@ -4330,7 +4330,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { } @Override public void screenTurningOn(final ScreenOnListener screenOnListener) { public void wakingUp(final ScreenOnListener screenOnListener) { EventLog.writeEvent(70000, 1); if (false) { RuntimeException here = new RuntimeException("here"); Loading services/core/java/com/android/server/power/Notifier.java +2 −2 Original line number Diff line number Diff line Loading @@ -409,7 +409,7 @@ final class Notifier { EventLog.writeEvent(EventLogTags.POWER_SCREEN_STATE, 1, 0, 0, 0); mPolicy.screenTurningOn(mScreenOnListener); mPolicy.wakingUp(mScreenOnListener); mActivityManagerInternal.wakingUp(); if (ActivityManagerNative.isSystemReady()) { Loading Loading @@ -460,7 +460,7 @@ final class Notifier { EventLog.writeEvent(EventLogTags.POWER_SCREEN_STATE, 0, why, 0, 0); mPolicy.screenTurnedOff(why); mPolicy.goingToSleep(why); mActivityManagerInternal.goingToSleep(); if (ActivityManagerNative.isSystemReady()) { Loading Loading
core/java/android/view/WindowManagerPolicy.java +4 −6 Original line number Diff line number Diff line Loading @@ -443,8 +443,6 @@ public interface WindowManagerPolicy { public final int OFF_BECAUSE_OF_USER = 2; /** Screen turned off because of timeout */ public final int OFF_BECAUSE_OF_TIMEOUT = 3; /** Screen turned off because of proximity sensor */ public final int OFF_BECAUSE_OF_PROX_SENSOR = 4; /** @hide */ @IntDef({USER_ROTATION_FREE, USER_ROTATION_LOCKED}) Loading Loading @@ -900,23 +898,23 @@ public interface WindowManagerPolicy { public int focusChangedLw(WindowState lastFocus, WindowState newFocus); /** * Called after the screen turns off. * Called when the device is going to sleep. * * @param why {@link #OFF_BECAUSE_OF_USER} or * {@link #OFF_BECAUSE_OF_TIMEOUT}. */ public void screenTurnedOff(int why); public void goingToSleep(int why); public interface ScreenOnListener { void onScreenOn(); } /** * Called when the power manager would like to turn the screen on. * Called when the device is waking up. * Must call back on the listener to tell it when the higher-level system * is ready for the screen to go on (i.e. the lock screen is shown). */ public void screenTurningOn(ScreenOnListener screenOnListener); public void wakingUp(ScreenOnListener screenOnListener); /** * Return whether the screen is about to turn on or is currently on. Loading
packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitorCallback.java +3 −3 Original line number Diff line number Diff line Loading @@ -168,9 +168,9 @@ public class KeyguardUpdateMonitorCallback { /** * Called when the screen turns off * @param why {@link WindowManagerPolicy#OFF_BECAUSE_OF_USER}, * {@link WindowManagerPolicy#OFF_BECAUSE_OF_TIMEOUT} or * {@link WindowManagerPolicy#OFF_BECAUSE_OF_PROX_SENSOR}. * @param why either {@link WindowManagerPolicy#OFF_BECAUSE_OF_ADMIN}, * {@link WindowManagerPolicy#OFF_BECAUSE_OF_USER}, or * {@link WindowManagerPolicy#OFF_BECAUSE_OF_TIMEOUT}. */ public void onScreenTurnedOff(int why) { } Loading
packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java +2 −5 Original line number Diff line number Diff line Loading @@ -542,9 +542,8 @@ public class KeyguardViewMediator extends SystemUI { /** * Called to let us know the screen was turned off. * @param why either {@link android.view.WindowManagerPolicy#OFF_BECAUSE_OF_USER}, * {@link android.view.WindowManagerPolicy#OFF_BECAUSE_OF_TIMEOUT} or * {@link android.view.WindowManagerPolicy#OFF_BECAUSE_OF_PROX_SENSOR}. * @param why either {@link android.view.WindowManagerPolicy#OFF_BECAUSE_OF_USER} or * {@link android.view.WindowManagerPolicy#OFF_BECAUSE_OF_TIMEOUT}. */ public void onScreenTurnedOff(int why) { synchronized (this) { Loading Loading @@ -576,8 +575,6 @@ public class KeyguardViewMediator extends SystemUI { } else if (why == WindowManagerPolicy.OFF_BECAUSE_OF_TIMEOUT || (why == WindowManagerPolicy.OFF_BECAUSE_OF_USER && !lockImmediately)) { doKeyguardLaterLocked(); } else if (why == WindowManagerPolicy.OFF_BECAUSE_OF_PROX_SENSOR) { // Do not enable the keyguard if the prox sensor forced the screen off. } else { doKeyguardLocked(null); } Loading
policy/src/com/android/internal/policy/impl/PhoneWindowManager.java +4 −4 Original line number Diff line number Diff line Loading @@ -990,9 +990,9 @@ public class PhoneWindowManager implements WindowManagerPolicy { // Match current screen state. if (mPowerManager.isInteractive()) { screenTurningOn(null); wakingUp(null); } else { screenTurnedOff(WindowManagerPolicy.OFF_BECAUSE_OF_USER); goingToSleep(WindowManagerPolicy.OFF_BECAUSE_OF_USER); } } Loading Loading @@ -4314,7 +4314,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { } @Override public void screenTurnedOff(int why) { public void goingToSleep(int why) { EventLog.writeEvent(70000, 0); synchronized (mLock) { mScreenOnEarly = false; Loading @@ -4330,7 +4330,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { } @Override public void screenTurningOn(final ScreenOnListener screenOnListener) { public void wakingUp(final ScreenOnListener screenOnListener) { EventLog.writeEvent(70000, 1); if (false) { RuntimeException here = new RuntimeException("here"); Loading
services/core/java/com/android/server/power/Notifier.java +2 −2 Original line number Diff line number Diff line Loading @@ -409,7 +409,7 @@ final class Notifier { EventLog.writeEvent(EventLogTags.POWER_SCREEN_STATE, 1, 0, 0, 0); mPolicy.screenTurningOn(mScreenOnListener); mPolicy.wakingUp(mScreenOnListener); mActivityManagerInternal.wakingUp(); if (ActivityManagerNative.isSystemReady()) { Loading Loading @@ -460,7 +460,7 @@ final class Notifier { EventLog.writeEvent(EventLogTags.POWER_SCREEN_STATE, 0, why, 0, 0); mPolicy.screenTurnedOff(why); mPolicy.goingToSleep(why); mActivityManagerInternal.goingToSleep(); if (ActivityManagerNative.isSystemReady()) { Loading