Loading packages/SystemUI/src/com/android/keyguard/KeyguardHostViewController.java +0 −6 Original line number Diff line number Diff line Loading @@ -67,12 +67,6 @@ public class KeyguardHostViewController extends ViewController<KeyguardHostView> private final KeyguardUpdateMonitorCallback mUpdateCallback = new KeyguardUpdateMonitorCallback() { @Override public void onUserSwitchComplete(int userId) { mKeyguardSecurityContainerController.showPrimarySecurityScreen( false /* turning off */); } @Override public void onTrustGrantedWithFlags(int flags, int userId) { if (userId != KeyguardUpdateMonitor.getCurrentUser()) return; Loading packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainerController.java +4 −0 Original line number Diff line number Diff line Loading @@ -97,6 +97,8 @@ public class KeyguardSecurityContainerController extends ViewController<Keyguard private int mLastOrientation = Configuration.ORIENTATION_UNDEFINED; private SecurityMode mCurrentSecurityMode = SecurityMode.Invalid; private UserSwitcherController.UserSwitchCallback mUserSwitchCallback = () -> showPrimarySecurityScreen(false); @VisibleForTesting final Gefingerpoken mGlobalTouchListener = new Gefingerpoken() { Loading Loading @@ -295,6 +297,7 @@ public class KeyguardSecurityContainerController extends ViewController<Keyguard mView.setSwipeListener(mSwipeListener); mView.addMotionEventListener(mGlobalTouchListener); mConfigurationController.addCallback(mConfigurationListener); mUserSwitcherController.addUserSwitchCallback(mUserSwitchCallback); } @Override Loading @@ -302,6 +305,7 @@ public class KeyguardSecurityContainerController extends ViewController<Keyguard mUpdateMonitor.removeCallback(mKeyguardUpdateMonitorCallback); mConfigurationController.removeCallback(mConfigurationListener); mView.removeMotionEventListener(mGlobalTouchListener); mUserSwitcherController.removeUserSwitchCallback(mUserSwitchCallback); } /** */ Loading packages/SystemUI/tests/src/com/android/keyguard/KeyguardSecurityContainerControllerTest.java +10 −0 Original line number Diff line number Diff line Loading @@ -287,4 +287,14 @@ public class KeyguardSecurityContainerControllerTest extends SysuiTestCase { verify(mView).initMode(MODE_DEFAULT, mGlobalSettings, mFalsingManager, mUserSwitcherController); } @Test public void addUserSwitchCallback() { mKeyguardSecurityContainerController.onViewAttached(); verify(mUserSwitcherController) .addUserSwitchCallback(any(UserSwitcherController.UserSwitchCallback.class)); mKeyguardSecurityContainerController.onViewDetached(); verify(mUserSwitcherController) .removeUserSwitchCallback(any(UserSwitcherController.UserSwitchCallback.class)); } } Loading
packages/SystemUI/src/com/android/keyguard/KeyguardHostViewController.java +0 −6 Original line number Diff line number Diff line Loading @@ -67,12 +67,6 @@ public class KeyguardHostViewController extends ViewController<KeyguardHostView> private final KeyguardUpdateMonitorCallback mUpdateCallback = new KeyguardUpdateMonitorCallback() { @Override public void onUserSwitchComplete(int userId) { mKeyguardSecurityContainerController.showPrimarySecurityScreen( false /* turning off */); } @Override public void onTrustGrantedWithFlags(int flags, int userId) { if (userId != KeyguardUpdateMonitor.getCurrentUser()) return; Loading
packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainerController.java +4 −0 Original line number Diff line number Diff line Loading @@ -97,6 +97,8 @@ public class KeyguardSecurityContainerController extends ViewController<Keyguard private int mLastOrientation = Configuration.ORIENTATION_UNDEFINED; private SecurityMode mCurrentSecurityMode = SecurityMode.Invalid; private UserSwitcherController.UserSwitchCallback mUserSwitchCallback = () -> showPrimarySecurityScreen(false); @VisibleForTesting final Gefingerpoken mGlobalTouchListener = new Gefingerpoken() { Loading Loading @@ -295,6 +297,7 @@ public class KeyguardSecurityContainerController extends ViewController<Keyguard mView.setSwipeListener(mSwipeListener); mView.addMotionEventListener(mGlobalTouchListener); mConfigurationController.addCallback(mConfigurationListener); mUserSwitcherController.addUserSwitchCallback(mUserSwitchCallback); } @Override Loading @@ -302,6 +305,7 @@ public class KeyguardSecurityContainerController extends ViewController<Keyguard mUpdateMonitor.removeCallback(mKeyguardUpdateMonitorCallback); mConfigurationController.removeCallback(mConfigurationListener); mView.removeMotionEventListener(mGlobalTouchListener); mUserSwitcherController.removeUserSwitchCallback(mUserSwitchCallback); } /** */ Loading
packages/SystemUI/tests/src/com/android/keyguard/KeyguardSecurityContainerControllerTest.java +10 −0 Original line number Diff line number Diff line Loading @@ -287,4 +287,14 @@ public class KeyguardSecurityContainerControllerTest extends SysuiTestCase { verify(mView).initMode(MODE_DEFAULT, mGlobalSettings, mFalsingManager, mUserSwitcherController); } @Test public void addUserSwitchCallback() { mKeyguardSecurityContainerController.onViewAttached(); verify(mUserSwitcherController) .addUserSwitchCallback(any(UserSwitcherController.UserSwitchCallback.class)); mKeyguardSecurityContainerController.onViewDetached(); verify(mUserSwitcherController) .removeUserSwitchCallback(any(UserSwitcherController.UserSwitchCallback.class)); } }