Loading policy/src/com/android/internal/policy/impl/PhoneWindowManager.java +44 −6 Original line number Diff line number Diff line Loading @@ -412,7 +412,17 @@ public class PhoneWindowManager implements WindowManagerPolicy { boolean mForceStatusBar; boolean mForceStatusBarFromKeyguard; boolean mHideLockScreen; boolean mDismissKeyguard; // States of keyguard dismiss. private static final int DISMISS_KEYGUARD_NONE = 0; // Keyguard not being dismissed. private static final int DISMISS_KEYGUARD_START = 1; // Keyguard needs to be dismissed. private static final int DISMISS_KEYGUARD_CONTINUE = 2; // Keyguard has been dismissed. int mDismissKeyguard = DISMISS_KEYGUARD_NONE; /** The window that is currently dismissing the keyguard. Dismissing the keyguard must only * be done once per window. */ private WindowState mWinDismissingKeyguard; boolean mShowingLockscreen; boolean mShowingDream; boolean mDreamingLockscreen; Loading Loading @@ -2921,6 +2931,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { } /** {@inheritDoc} */ @Override public void beginPostLayoutPolicyLw(int displayWidth, int displayHeight) { mTopFullscreenOpaqueWindowState = null; mForceStatusBar = false; Loading @@ -2928,12 +2939,13 @@ public class PhoneWindowManager implements WindowManagerPolicy { mHideLockScreen = false; mAllowLockscreenWhenOn = false; mDismissKeyguard = false; mDismissKeyguard = DISMISS_KEYGUARD_NONE; mShowingLockscreen = false; mShowingDream = false; } /** {@inheritDoc} */ @Override public void applyPostLayoutPolicyLw(WindowState win, WindowManager.LayoutParams attrs) { if (DEBUG_LAYOUT) Slog.i(TAG, "Win " + win + ": isVisibleOrBehindKeyguardLw=" Loading Loading @@ -2971,9 +2983,12 @@ public class PhoneWindowManager implements WindowManagerPolicy { mHideLockScreen = true; mForceStatusBarFromKeyguard = false; } if ((attrs.flags & FLAG_DISMISS_KEYGUARD) != 0) { if ((attrs.flags & FLAG_DISMISS_KEYGUARD) != 0 && mDismissKeyguard == DISMISS_KEYGUARD_NONE) { if (DEBUG_LAYOUT) Log.v(TAG, "Setting mDismissKeyguard to true by win " + win); mDismissKeyguard = true; mDismissKeyguard = mWinDismissingKeyguard == win ? DISMISS_KEYGUARD_CONTINUE : DISMISS_KEYGUARD_START; mWinDismissingKeyguard = win; mForceStatusBarFromKeyguard = false; } if ((attrs.flags & FLAG_ALLOW_LOCK_WHILE_SCREEN_ON) != 0) { Loading @@ -2984,6 +2999,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { } /** {@inheritDoc} */ @Override public int finishPostLayoutPolicyLw() { int changes = 0; boolean topIsFullscreen = false; Loading Loading @@ -3023,7 +3039,9 @@ public class PhoneWindowManager implements WindowManagerPolicy { if (mStatusBar.hideLw(true)) { changes |= FINISH_LAYOUT_REDO_LAYOUT; mHandler.post(new Runnable() { public void run() { mHandler.post(new Runnable() { @Override public void run() { try { IStatusBarService statusbar = getStatusBarService(); if (statusbar != null) { Loading Loading @@ -3051,7 +3069,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { if (mKeyguard != null) { if (localLOGV) Log.v(TAG, "finishPostLayoutPolicyLw: mHideKeyguard=" + mHideLockScreen); if (mDismissKeyguard && !mKeyguardMediator.isSecure()) { if (mDismissKeyguard != DISMISS_KEYGUARD_NONE && !mKeyguardMediator.isSecure()) { if (mKeyguard.hideLw(true)) { changes |= FINISH_LAYOUT_REDO_LAYOUT | FINISH_LAYOUT_REDO_CONFIG Loading @@ -3059,6 +3077,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { } if (mKeyguardMediator.isShowing()) { mHandler.post(new Runnable() { @Override public void run() { mKeyguardMediator.keyguardDone(false, false); } Loading @@ -3071,7 +3090,25 @@ public class PhoneWindowManager implements WindowManagerPolicy { | FINISH_LAYOUT_REDO_WALLPAPER; } mKeyguardMediator.setHidden(true); } else if (mDismissKeyguard != DISMISS_KEYGUARD_NONE) { // This is the case of keyguard isSecure() and not mHideLockScreen. if (mDismissKeyguard == DISMISS_KEYGUARD_START) { // Only launch the next keyguard unlock window once per window. if (mKeyguard.showLw(true)) { changes |= FINISH_LAYOUT_REDO_LAYOUT | FINISH_LAYOUT_REDO_CONFIG | FINISH_LAYOUT_REDO_WALLPAPER; } mKeyguardMediator.setHidden(false); mHandler.post(new Runnable() { @Override public void run() { mKeyguardMediator.dismiss(); } }); } } else { mWinDismissingKeyguard = null; if (mKeyguard.showLw(true)) { changes |= FINISH_LAYOUT_REDO_LAYOUT | FINISH_LAYOUT_REDO_CONFIG Loading Loading @@ -4549,6 +4586,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { pw.print(" mForceStatusBarFromKeyguard="); pw.println(mForceStatusBarFromKeyguard); pw.print(prefix); pw.print("mDismissKeyguard="); pw.print(mDismissKeyguard); pw.print(" mWinDismissingKeyguard="); pw.print(mWinDismissingKeyguard); pw.print(" mHomePressed="); pw.println(mHomePressed); pw.print(prefix); pw.print("mAllowLockscreenWhenOn="); pw.print(mAllowLockscreenWhenOn); pw.print(" mLockScreenTimeout="); pw.print(mLockScreenTimeout); Loading policy/src/com/android/internal/policy/impl/keyguard/KeyguardHostView.java +6 −0 Original line number Diff line number Diff line Loading @@ -1205,4 +1205,10 @@ public class KeyguardHostView extends KeyguardViewBase { return false; } /** * Dismisses the keyguard by going to the next screen or making it gone. */ public void dismiss() { showNextSecurityScreenOrFinish(false); } } policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewManager.java +12 −0 Original line number Diff line number Diff line Loading @@ -65,6 +65,7 @@ public class KeyguardViewManager { private FrameLayout mKeyguardHost; private KeyguardHostView mKeyguardView; private boolean mScreenOn = false; private LockPatternUtils mLockPatternUtils; public interface ShowListener { Loading Loading @@ -302,6 +303,7 @@ public class KeyguardViewManager { public synchronized void onScreenTurnedOff() { if (DEBUG) Log.d(TAG, "onScreenTurnedOff()"); mScreenOn = false; if (mKeyguardView != null) { mKeyguardView.onScreenTurnedOff(); } Loading @@ -310,6 +312,7 @@ public class KeyguardViewManager { public synchronized void onScreenTurnedOn( final KeyguardViewManager.ShowListener showListener) { if (DEBUG) Log.d(TAG, "onScreenTurnedOn()"); mScreenOn = true; if (mKeyguardView != null) { mKeyguardView.onScreenTurnedOn(); Loading Loading @@ -397,6 +400,15 @@ public class KeyguardViewManager { } } /** * Dismisses the keyguard by going to the next screen or making it gone. */ public synchronized void dismiss() { if (mScreenOn) { mKeyguardView.dismiss(); } } /** * @return Whether the keyguard is showing */ Loading policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewMediator.java +8 −3 Original line number Diff line number Diff line Loading @@ -813,9 +813,7 @@ public class KeyguardViewMediator { } /** * Enable the keyguard if the settings are appropriate. Return true if all * work that will happen is done; returns false if the caller can wait for * the keyguard to be shown. * Enable the keyguard if the settings are appropriate. */ private void doKeyguardLocked(Bundle options) { // if another app is disabling us, don't show Loading Loading @@ -866,6 +864,13 @@ public class KeyguardViewMediator { showLocked(options); } /** * Dismiss the keyguard through the security layers. */ public void dismiss() { mKeyguardViewManager.dismiss(); } /** * Send message to keyguard telling it to reset its state. * @param options options about how to show the keyguard Loading services/java/com/android/server/wm/WindowState.java +1 −1 Original line number Diff line number Diff line Loading @@ -282,7 +282,7 @@ final class WindowState implements WindowManagerPolicy.WindowState { mEnforceSizeCompat = (mAttrs.flags & FLAG_COMPATIBLE_WINDOW) != 0; if (WindowManagerService.localLOGV) Slog.v( TAG, "Window " + this + " client=" + c.asBinder() + " token=" + token + " (" + mAttrs.token + ")"); + " token=" + token + " (" + mAttrs.token + ")" + " params=" + a); try { c.asBinder().linkToDeath(deathRecipient, 0); } catch (RemoteException e) { Loading Loading
policy/src/com/android/internal/policy/impl/PhoneWindowManager.java +44 −6 Original line number Diff line number Diff line Loading @@ -412,7 +412,17 @@ public class PhoneWindowManager implements WindowManagerPolicy { boolean mForceStatusBar; boolean mForceStatusBarFromKeyguard; boolean mHideLockScreen; boolean mDismissKeyguard; // States of keyguard dismiss. private static final int DISMISS_KEYGUARD_NONE = 0; // Keyguard not being dismissed. private static final int DISMISS_KEYGUARD_START = 1; // Keyguard needs to be dismissed. private static final int DISMISS_KEYGUARD_CONTINUE = 2; // Keyguard has been dismissed. int mDismissKeyguard = DISMISS_KEYGUARD_NONE; /** The window that is currently dismissing the keyguard. Dismissing the keyguard must only * be done once per window. */ private WindowState mWinDismissingKeyguard; boolean mShowingLockscreen; boolean mShowingDream; boolean mDreamingLockscreen; Loading Loading @@ -2921,6 +2931,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { } /** {@inheritDoc} */ @Override public void beginPostLayoutPolicyLw(int displayWidth, int displayHeight) { mTopFullscreenOpaqueWindowState = null; mForceStatusBar = false; Loading @@ -2928,12 +2939,13 @@ public class PhoneWindowManager implements WindowManagerPolicy { mHideLockScreen = false; mAllowLockscreenWhenOn = false; mDismissKeyguard = false; mDismissKeyguard = DISMISS_KEYGUARD_NONE; mShowingLockscreen = false; mShowingDream = false; } /** {@inheritDoc} */ @Override public void applyPostLayoutPolicyLw(WindowState win, WindowManager.LayoutParams attrs) { if (DEBUG_LAYOUT) Slog.i(TAG, "Win " + win + ": isVisibleOrBehindKeyguardLw=" Loading Loading @@ -2971,9 +2983,12 @@ public class PhoneWindowManager implements WindowManagerPolicy { mHideLockScreen = true; mForceStatusBarFromKeyguard = false; } if ((attrs.flags & FLAG_DISMISS_KEYGUARD) != 0) { if ((attrs.flags & FLAG_DISMISS_KEYGUARD) != 0 && mDismissKeyguard == DISMISS_KEYGUARD_NONE) { if (DEBUG_LAYOUT) Log.v(TAG, "Setting mDismissKeyguard to true by win " + win); mDismissKeyguard = true; mDismissKeyguard = mWinDismissingKeyguard == win ? DISMISS_KEYGUARD_CONTINUE : DISMISS_KEYGUARD_START; mWinDismissingKeyguard = win; mForceStatusBarFromKeyguard = false; } if ((attrs.flags & FLAG_ALLOW_LOCK_WHILE_SCREEN_ON) != 0) { Loading @@ -2984,6 +2999,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { } /** {@inheritDoc} */ @Override public int finishPostLayoutPolicyLw() { int changes = 0; boolean topIsFullscreen = false; Loading Loading @@ -3023,7 +3039,9 @@ public class PhoneWindowManager implements WindowManagerPolicy { if (mStatusBar.hideLw(true)) { changes |= FINISH_LAYOUT_REDO_LAYOUT; mHandler.post(new Runnable() { public void run() { mHandler.post(new Runnable() { @Override public void run() { try { IStatusBarService statusbar = getStatusBarService(); if (statusbar != null) { Loading Loading @@ -3051,7 +3069,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { if (mKeyguard != null) { if (localLOGV) Log.v(TAG, "finishPostLayoutPolicyLw: mHideKeyguard=" + mHideLockScreen); if (mDismissKeyguard && !mKeyguardMediator.isSecure()) { if (mDismissKeyguard != DISMISS_KEYGUARD_NONE && !mKeyguardMediator.isSecure()) { if (mKeyguard.hideLw(true)) { changes |= FINISH_LAYOUT_REDO_LAYOUT | FINISH_LAYOUT_REDO_CONFIG Loading @@ -3059,6 +3077,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { } if (mKeyguardMediator.isShowing()) { mHandler.post(new Runnable() { @Override public void run() { mKeyguardMediator.keyguardDone(false, false); } Loading @@ -3071,7 +3090,25 @@ public class PhoneWindowManager implements WindowManagerPolicy { | FINISH_LAYOUT_REDO_WALLPAPER; } mKeyguardMediator.setHidden(true); } else if (mDismissKeyguard != DISMISS_KEYGUARD_NONE) { // This is the case of keyguard isSecure() and not mHideLockScreen. if (mDismissKeyguard == DISMISS_KEYGUARD_START) { // Only launch the next keyguard unlock window once per window. if (mKeyguard.showLw(true)) { changes |= FINISH_LAYOUT_REDO_LAYOUT | FINISH_LAYOUT_REDO_CONFIG | FINISH_LAYOUT_REDO_WALLPAPER; } mKeyguardMediator.setHidden(false); mHandler.post(new Runnable() { @Override public void run() { mKeyguardMediator.dismiss(); } }); } } else { mWinDismissingKeyguard = null; if (mKeyguard.showLw(true)) { changes |= FINISH_LAYOUT_REDO_LAYOUT | FINISH_LAYOUT_REDO_CONFIG Loading Loading @@ -4549,6 +4586,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { pw.print(" mForceStatusBarFromKeyguard="); pw.println(mForceStatusBarFromKeyguard); pw.print(prefix); pw.print("mDismissKeyguard="); pw.print(mDismissKeyguard); pw.print(" mWinDismissingKeyguard="); pw.print(mWinDismissingKeyguard); pw.print(" mHomePressed="); pw.println(mHomePressed); pw.print(prefix); pw.print("mAllowLockscreenWhenOn="); pw.print(mAllowLockscreenWhenOn); pw.print(" mLockScreenTimeout="); pw.print(mLockScreenTimeout); Loading
policy/src/com/android/internal/policy/impl/keyguard/KeyguardHostView.java +6 −0 Original line number Diff line number Diff line Loading @@ -1205,4 +1205,10 @@ public class KeyguardHostView extends KeyguardViewBase { return false; } /** * Dismisses the keyguard by going to the next screen or making it gone. */ public void dismiss() { showNextSecurityScreenOrFinish(false); } }
policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewManager.java +12 −0 Original line number Diff line number Diff line Loading @@ -65,6 +65,7 @@ public class KeyguardViewManager { private FrameLayout mKeyguardHost; private KeyguardHostView mKeyguardView; private boolean mScreenOn = false; private LockPatternUtils mLockPatternUtils; public interface ShowListener { Loading Loading @@ -302,6 +303,7 @@ public class KeyguardViewManager { public synchronized void onScreenTurnedOff() { if (DEBUG) Log.d(TAG, "onScreenTurnedOff()"); mScreenOn = false; if (mKeyguardView != null) { mKeyguardView.onScreenTurnedOff(); } Loading @@ -310,6 +312,7 @@ public class KeyguardViewManager { public synchronized void onScreenTurnedOn( final KeyguardViewManager.ShowListener showListener) { if (DEBUG) Log.d(TAG, "onScreenTurnedOn()"); mScreenOn = true; if (mKeyguardView != null) { mKeyguardView.onScreenTurnedOn(); Loading Loading @@ -397,6 +400,15 @@ public class KeyguardViewManager { } } /** * Dismisses the keyguard by going to the next screen or making it gone. */ public synchronized void dismiss() { if (mScreenOn) { mKeyguardView.dismiss(); } } /** * @return Whether the keyguard is showing */ Loading
policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewMediator.java +8 −3 Original line number Diff line number Diff line Loading @@ -813,9 +813,7 @@ public class KeyguardViewMediator { } /** * Enable the keyguard if the settings are appropriate. Return true if all * work that will happen is done; returns false if the caller can wait for * the keyguard to be shown. * Enable the keyguard if the settings are appropriate. */ private void doKeyguardLocked(Bundle options) { // if another app is disabling us, don't show Loading Loading @@ -866,6 +864,13 @@ public class KeyguardViewMediator { showLocked(options); } /** * Dismiss the keyguard through the security layers. */ public void dismiss() { mKeyguardViewManager.dismiss(); } /** * Send message to keyguard telling it to reset its state. * @param options options about how to show the keyguard Loading
services/java/com/android/server/wm/WindowState.java +1 −1 Original line number Diff line number Diff line Loading @@ -282,7 +282,7 @@ final class WindowState implements WindowManagerPolicy.WindowState { mEnforceSizeCompat = (mAttrs.flags & FLAG_COMPATIBLE_WINDOW) != 0; if (WindowManagerService.localLOGV) Slog.v( TAG, "Window " + this + " client=" + c.asBinder() + " token=" + token + " (" + mAttrs.token + ")"); + " token=" + token + " (" + mAttrs.token + ")" + " params=" + a); try { c.asBinder().linkToDeath(deathRecipient, 0); } catch (RemoteException e) { Loading