Loading core/java/android/view/IWindowManager.aidl +3 −2 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ import android.content.res.Configuration; import android.graphics.Bitmap; import android.graphics.Point; import android.graphics.Rect; import android.os.Bundle; import android.os.IRemoteCallback; import android.view.IApplicationToken; import android.view.IDisplayContentChangeListener; Loading Loading @@ -209,9 +210,9 @@ interface IWindowManager boolean hasNavigationBar(); /** * Lock the device immediately. * Lock the device immediately with the specified options (can be null). */ void lockNow(); void lockNow(in Bundle options); /** * Gets the token for the focused window. Loading core/java/android/view/WindowManagerPolicy.java +2 −1 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import android.content.res.CompatibilityInfo; import android.content.res.Configuration; import android.graphics.Rect; import android.graphics.RectF; import android.os.Bundle; import android.os.IBinder; import android.os.Looper; import android.view.animation.Animation; Loading Loading @@ -1096,7 +1097,7 @@ public interface WindowManagerPolicy { /** * Lock the device now. */ public void lockNow(); public void lockNow(Bundle options); /** * Set the last used input method window state. This state is used to make IME transition Loading core/java/com/android/internal/widget/LockPatternUtils.java +21 −0 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ import android.content.Context; import android.content.Intent; import android.content.pm.PackageManager; import android.os.Binder; import android.os.Bundle; import android.os.IBinder; import android.os.Process; import android.os.RemoteException; Loading Loading @@ -98,6 +99,26 @@ public class LockPatternUtils { */ public static final int MIN_PATTERN_REGISTER_FAIL = MIN_LOCK_PATTERN_SIZE; /** * Tells the keyguard to show the user switcher when the keyguard is created. */ public static final String KEYGUARD_SHOW_USER_SWITCHER = "showuserswitcher"; /** * Tells the keyguard to show the security challenge when the keyguard is created. */ public static final String KEYGUARD_SHOW_SECURITY_CHALLENGE = "showsecuritychallenge"; /** * Options used to lock the device upon user switch. */ public static final Bundle USER_SWITCH_LOCK_OPTIONS = new Bundle(); static { USER_SWITCH_LOCK_OPTIONS.putBoolean(KEYGUARD_SHOW_USER_SWITCHER, true); USER_SWITCH_LOCK_OPTIONS.putBoolean(KEYGUARD_SHOW_SECURITY_CHALLENGE, true); } /** * The bit in LOCK_BIOMETRIC_WEAK_FLAGS to be used to indicate whether liveliness should * be used Loading policy/src/com/android/internal/policy/impl/PhoneWindowManager.java +19 −4 Original line number Diff line number Diff line Loading @@ -4047,21 +4047,36 @@ public class PhoneWindowManager implements WindowManagerPolicy { } } Runnable mScreenLockTimeout = new Runnable() { class ScreenLockTimeout implements Runnable { Bundle options; @Override public void run() { synchronized (this) { if (localLOGV) Log.v(TAG, "mScreenLockTimeout activating keyguard"); if (mKeyguardMediator != null) { mKeyguardMediator.doKeyguardTimeout(); mKeyguardMediator.doKeyguardTimeout(options); } mLockScreenTimerActive = false; options = null; } } public void setLockOptions(Bundle options) { this.options = options; } } }; public void lockNow() { ScreenLockTimeout mScreenLockTimeout = new ScreenLockTimeout(); public void lockNow(Bundle options) { mContext.enforceCallingOrSelfPermission(android.Manifest.permission.DEVICE_POWER, null); mHandler.removeCallbacks(mScreenLockTimeout); if (options != null) { // In case multiple calls are made to lockNow, we don't wipe out the options // until the runnable actually executes. mScreenLockTimeout.setLockOptions(options); } mHandler.post(mScreenLockTimeout); } Loading policy/src/com/android/internal/policy/impl/keyguard/KeyguardMultiUserSelectorView.java +0 −6 Original line number Diff line number Diff line Loading @@ -119,12 +119,6 @@ public class KeyguardMultiUserSelectorView extends FrameLayout implements View.O public void run() { try { ActivityManagerNative.getDefault().switchUser(avatar.getUserInfo().id); WindowManagerGlobal.getWindowManagerService().lockNow(); // Set the new active user, and make it appear active avatar.resetPressedState(); mCallback.showSecurityView(); mActiveUserAvatar = avatar; mActiveUserAvatar.setActive(true, false, 0, null); } catch (RemoteException re) { Log.e(TAG, "Couldn't switch user " + re); } Loading Loading
core/java/android/view/IWindowManager.aidl +3 −2 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ import android.content.res.Configuration; import android.graphics.Bitmap; import android.graphics.Point; import android.graphics.Rect; import android.os.Bundle; import android.os.IRemoteCallback; import android.view.IApplicationToken; import android.view.IDisplayContentChangeListener; Loading Loading @@ -209,9 +210,9 @@ interface IWindowManager boolean hasNavigationBar(); /** * Lock the device immediately. * Lock the device immediately with the specified options (can be null). */ void lockNow(); void lockNow(in Bundle options); /** * Gets the token for the focused window. Loading
core/java/android/view/WindowManagerPolicy.java +2 −1 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import android.content.res.CompatibilityInfo; import android.content.res.Configuration; import android.graphics.Rect; import android.graphics.RectF; import android.os.Bundle; import android.os.IBinder; import android.os.Looper; import android.view.animation.Animation; Loading Loading @@ -1096,7 +1097,7 @@ public interface WindowManagerPolicy { /** * Lock the device now. */ public void lockNow(); public void lockNow(Bundle options); /** * Set the last used input method window state. This state is used to make IME transition Loading
core/java/com/android/internal/widget/LockPatternUtils.java +21 −0 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ import android.content.Context; import android.content.Intent; import android.content.pm.PackageManager; import android.os.Binder; import android.os.Bundle; import android.os.IBinder; import android.os.Process; import android.os.RemoteException; Loading Loading @@ -98,6 +99,26 @@ public class LockPatternUtils { */ public static final int MIN_PATTERN_REGISTER_FAIL = MIN_LOCK_PATTERN_SIZE; /** * Tells the keyguard to show the user switcher when the keyguard is created. */ public static final String KEYGUARD_SHOW_USER_SWITCHER = "showuserswitcher"; /** * Tells the keyguard to show the security challenge when the keyguard is created. */ public static final String KEYGUARD_SHOW_SECURITY_CHALLENGE = "showsecuritychallenge"; /** * Options used to lock the device upon user switch. */ public static final Bundle USER_SWITCH_LOCK_OPTIONS = new Bundle(); static { USER_SWITCH_LOCK_OPTIONS.putBoolean(KEYGUARD_SHOW_USER_SWITCHER, true); USER_SWITCH_LOCK_OPTIONS.putBoolean(KEYGUARD_SHOW_SECURITY_CHALLENGE, true); } /** * The bit in LOCK_BIOMETRIC_WEAK_FLAGS to be used to indicate whether liveliness should * be used Loading
policy/src/com/android/internal/policy/impl/PhoneWindowManager.java +19 −4 Original line number Diff line number Diff line Loading @@ -4047,21 +4047,36 @@ public class PhoneWindowManager implements WindowManagerPolicy { } } Runnable mScreenLockTimeout = new Runnable() { class ScreenLockTimeout implements Runnable { Bundle options; @Override public void run() { synchronized (this) { if (localLOGV) Log.v(TAG, "mScreenLockTimeout activating keyguard"); if (mKeyguardMediator != null) { mKeyguardMediator.doKeyguardTimeout(); mKeyguardMediator.doKeyguardTimeout(options); } mLockScreenTimerActive = false; options = null; } } public void setLockOptions(Bundle options) { this.options = options; } } }; public void lockNow() { ScreenLockTimeout mScreenLockTimeout = new ScreenLockTimeout(); public void lockNow(Bundle options) { mContext.enforceCallingOrSelfPermission(android.Manifest.permission.DEVICE_POWER, null); mHandler.removeCallbacks(mScreenLockTimeout); if (options != null) { // In case multiple calls are made to lockNow, we don't wipe out the options // until the runnable actually executes. mScreenLockTimeout.setLockOptions(options); } mHandler.post(mScreenLockTimeout); } Loading
policy/src/com/android/internal/policy/impl/keyguard/KeyguardMultiUserSelectorView.java +0 −6 Original line number Diff line number Diff line Loading @@ -119,12 +119,6 @@ public class KeyguardMultiUserSelectorView extends FrameLayout implements View.O public void run() { try { ActivityManagerNative.getDefault().switchUser(avatar.getUserInfo().id); WindowManagerGlobal.getWindowManagerService().lockNow(); // Set the new active user, and make it appear active avatar.resetPressedState(); mCallback.showSecurityView(); mActiveUserAvatar = avatar; mActiveUserAvatar.setActive(true, false, 0, null); } catch (RemoteException re) { Log.e(TAG, "Couldn't switch user " + re); } Loading