Loading policy/com/android/internal/policy/impl/KeyguardUpdateMonitor.java +15 −3 Original line number Diff line number Diff line Loading @@ -492,7 +492,11 @@ public class KeyguardUpdateMonitor { * @param callback The callback. */ public void registerConfigurationChangeCallback(ConfigurationChangeCallback callback) { if (!mConfigurationChangeCallbacks.contains(callback)) { mConfigurationChangeCallbacks.add(callback); } else { Log.e(TAG, "Object tried to add another CONFIG callback", new Exception("Whoops")); } } /** Loading @@ -501,7 +505,11 @@ public class KeyguardUpdateMonitor { * @param callback The callback. */ public void registerInfoCallback(InfoCallback callback) { if (!mInfoCallbacks.contains(callback)) { mInfoCallbacks.add(callback); } else { Log.e(TAG, "Object tried to add another INFO callback", new Exception("Whoops")); } } /** Loading @@ -509,7 +517,11 @@ public class KeyguardUpdateMonitor { * @param callback The callback. */ public void registerSimStateCallback(SimStateCallback callback) { if (!mSimStateCallbacks.contains(callback)) { mSimStateCallbacks.add(callback); } else { Log.e(TAG, "Object tried to add another SIM callback", new Exception("Whoops")); } } public IccCard.State getSimState() { Loading policy/com/android/internal/policy/impl/LockPatternKeyguardView.java +4 −6 Original line number Diff line number Diff line Loading @@ -173,8 +173,8 @@ public class LockPatternKeyguardView extends KeyguardViewBase if (mUnlockScreen == null) { Log.w(TAG, "no unlock screen when receiving AccountManager information"); } else if (mUnlockScreen instanceof UnlockScreen) { ((UnlockScreen)mUnlockScreen).setEnableFallback(mEnableFallback); } else if (mUnlockScreen instanceof PatternUnlockScreen) { ((PatternUnlockScreen)mUnlockScreen).setEnableFallback(mEnableFallback); } } Loading Loading @@ -411,7 +411,6 @@ public class LockPatternKeyguardView extends KeyguardViewBase } } private void recreateScreens() { if (mLockScreen.getVisibility() == View.VISIBLE) { ((KeyguardScreen) mLockScreen).onPause(); Loading Loading @@ -504,8 +503,7 @@ public class LockPatternKeyguardView extends KeyguardViewBase mMode = mode; final View goneScreen = (mode == Mode.LockScreen) ? mUnlockScreen : mLockScreen; final View visibleScreen = (mode == Mode.LockScreen) ? mLockScreen : getUnlockScreenForCurrentUnlockMode(); final View visibleScreen = (mode == Mode.LockScreen) ? mLockScreen : mUnlockScreen; // do this before changing visibility so focus isn't requested before the input // flag is set Loading Loading @@ -544,7 +542,7 @@ public class LockPatternKeyguardView extends KeyguardViewBase mIsPortrait = getResources().getBoolean(R.bool.lockscreen_isPortrait); if (unlockMode == UnlockMode.Pattern) { UnlockScreen view = new UnlockScreen( PatternUnlockScreen view = new PatternUnlockScreen( mContext, mLockPatternUtils, mUpdateMonitor, Loading policy/com/android/internal/policy/impl/PasswordUnlockScreen.java +8 −8 Original line number Diff line number Diff line Loading @@ -53,6 +53,7 @@ public class PasswordUnlockScreen extends LinearLayout implements KeyguardScreen private LockPatternUtils mLockPatternUtils; private PasswordEntryKeyboardView mKeyboardView; private PasswordEntryKeyboardHelper mKeyboardHelper; private boolean mIsInPortrait; // To avoid accidental lockout due to events while the device in in the pocket, ignore // any passwords with length less than or equal to this length. Loading @@ -66,10 +67,10 @@ public class PasswordUnlockScreen extends LinearLayout implements KeyguardScreen mCreatedWithKeyboardOpen = mUpdateMonitor.isKeyboardOpen(); LayoutInflater layoutInflater = LayoutInflater.from(context); if (mCreatedWithKeyboardOpen) { layoutInflater.inflate(R.layout.keyguard_screen_password_landscape, this, true); } else { if (mUpdateMonitor.isInPortrait()) { layoutInflater.inflate(R.layout.keyguard_screen_password_portrait, this, true); } else { layoutInflater.inflate(R.layout.keyguard_screen_password_landscape, this, true); } boolean isAlpha = lockPatternUtils.getPasswordMode() == LockPatternUtils.MODE_PASSWORD; Loading @@ -85,7 +86,7 @@ public class PasswordUnlockScreen extends LinearLayout implements KeyguardScreen mKeyboardHelper.setKeyboardMode(isAlpha ? PasswordEntryKeyboardHelper.KEYBOARD_MODE_ALPHA : PasswordEntryKeyboardHelper.KEYBOARD_MODE_NUMERIC); updateMonitor.registerConfigurationChangeCallback(this); mKeyboardView.setVisibility(mCreatedWithKeyboardOpen ? View.INVISIBLE : View.VISIBLE); mPasswordEntry.requestFocus(); } Loading Loading @@ -144,13 +145,12 @@ public class PasswordUnlockScreen extends LinearLayout implements KeyguardScreen } public void onOrientationChange(boolean inPortrait) { mCallback.recreateMe(); } public void onKeyboardChange(boolean isKeyboardOpen) { if (isKeyboardOpen != mCreatedWithKeyboardOpen) { mCallback.recreateMe(); } // Don't show the soft keyboard when the real keyboard is open mKeyboardView.setVisibility(isKeyboardOpen ? View.INVISIBLE : View.VISIBLE); } public boolean onEditorAction(TextView v, int actionId, KeyEvent event) { Loading policy/com/android/internal/policy/impl/UnlockScreen.java→policy/com/android/internal/policy/impl/PatternUnlockScreen.java +2 −2 Original line number Diff line number Diff line Loading @@ -42,7 +42,7 @@ import java.util.Date; * This is the screen that shows the 9 circle unlock widget and instructs * the user how to unlock their device, or make an emergency call. */ class UnlockScreen extends LinearLayoutWithDefaultTouchRecepient class PatternUnlockScreen extends LinearLayoutWithDefaultTouchRecepient implements KeyguardScreen, KeyguardUpdateMonitor.ConfigurationChangeCallback, KeyguardUpdateMonitor.InfoCallback, KeyguardUpdateMonitor.SimStateCallback { Loading Loading @@ -160,7 +160,7 @@ class UnlockScreen extends LinearLayoutWithDefaultTouchRecepient * their pattern (e.g they have a google account so we can show them the account based * backup option). */ UnlockScreen(Context context, PatternUnlockScreen(Context context, LockPatternUtils lockPatternUtils, KeyguardUpdateMonitor updateMonitor, KeyguardScreenCallback callback, Loading Loading
policy/com/android/internal/policy/impl/KeyguardUpdateMonitor.java +15 −3 Original line number Diff line number Diff line Loading @@ -492,7 +492,11 @@ public class KeyguardUpdateMonitor { * @param callback The callback. */ public void registerConfigurationChangeCallback(ConfigurationChangeCallback callback) { if (!mConfigurationChangeCallbacks.contains(callback)) { mConfigurationChangeCallbacks.add(callback); } else { Log.e(TAG, "Object tried to add another CONFIG callback", new Exception("Whoops")); } } /** Loading @@ -501,7 +505,11 @@ public class KeyguardUpdateMonitor { * @param callback The callback. */ public void registerInfoCallback(InfoCallback callback) { if (!mInfoCallbacks.contains(callback)) { mInfoCallbacks.add(callback); } else { Log.e(TAG, "Object tried to add another INFO callback", new Exception("Whoops")); } } /** Loading @@ -509,7 +517,11 @@ public class KeyguardUpdateMonitor { * @param callback The callback. */ public void registerSimStateCallback(SimStateCallback callback) { if (!mSimStateCallbacks.contains(callback)) { mSimStateCallbacks.add(callback); } else { Log.e(TAG, "Object tried to add another SIM callback", new Exception("Whoops")); } } public IccCard.State getSimState() { Loading
policy/com/android/internal/policy/impl/LockPatternKeyguardView.java +4 −6 Original line number Diff line number Diff line Loading @@ -173,8 +173,8 @@ public class LockPatternKeyguardView extends KeyguardViewBase if (mUnlockScreen == null) { Log.w(TAG, "no unlock screen when receiving AccountManager information"); } else if (mUnlockScreen instanceof UnlockScreen) { ((UnlockScreen)mUnlockScreen).setEnableFallback(mEnableFallback); } else if (mUnlockScreen instanceof PatternUnlockScreen) { ((PatternUnlockScreen)mUnlockScreen).setEnableFallback(mEnableFallback); } } Loading Loading @@ -411,7 +411,6 @@ public class LockPatternKeyguardView extends KeyguardViewBase } } private void recreateScreens() { if (mLockScreen.getVisibility() == View.VISIBLE) { ((KeyguardScreen) mLockScreen).onPause(); Loading Loading @@ -504,8 +503,7 @@ public class LockPatternKeyguardView extends KeyguardViewBase mMode = mode; final View goneScreen = (mode == Mode.LockScreen) ? mUnlockScreen : mLockScreen; final View visibleScreen = (mode == Mode.LockScreen) ? mLockScreen : getUnlockScreenForCurrentUnlockMode(); final View visibleScreen = (mode == Mode.LockScreen) ? mLockScreen : mUnlockScreen; // do this before changing visibility so focus isn't requested before the input // flag is set Loading Loading @@ -544,7 +542,7 @@ public class LockPatternKeyguardView extends KeyguardViewBase mIsPortrait = getResources().getBoolean(R.bool.lockscreen_isPortrait); if (unlockMode == UnlockMode.Pattern) { UnlockScreen view = new UnlockScreen( PatternUnlockScreen view = new PatternUnlockScreen( mContext, mLockPatternUtils, mUpdateMonitor, Loading
policy/com/android/internal/policy/impl/PasswordUnlockScreen.java +8 −8 Original line number Diff line number Diff line Loading @@ -53,6 +53,7 @@ public class PasswordUnlockScreen extends LinearLayout implements KeyguardScreen private LockPatternUtils mLockPatternUtils; private PasswordEntryKeyboardView mKeyboardView; private PasswordEntryKeyboardHelper mKeyboardHelper; private boolean mIsInPortrait; // To avoid accidental lockout due to events while the device in in the pocket, ignore // any passwords with length less than or equal to this length. Loading @@ -66,10 +67,10 @@ public class PasswordUnlockScreen extends LinearLayout implements KeyguardScreen mCreatedWithKeyboardOpen = mUpdateMonitor.isKeyboardOpen(); LayoutInflater layoutInflater = LayoutInflater.from(context); if (mCreatedWithKeyboardOpen) { layoutInflater.inflate(R.layout.keyguard_screen_password_landscape, this, true); } else { if (mUpdateMonitor.isInPortrait()) { layoutInflater.inflate(R.layout.keyguard_screen_password_portrait, this, true); } else { layoutInflater.inflate(R.layout.keyguard_screen_password_landscape, this, true); } boolean isAlpha = lockPatternUtils.getPasswordMode() == LockPatternUtils.MODE_PASSWORD; Loading @@ -85,7 +86,7 @@ public class PasswordUnlockScreen extends LinearLayout implements KeyguardScreen mKeyboardHelper.setKeyboardMode(isAlpha ? PasswordEntryKeyboardHelper.KEYBOARD_MODE_ALPHA : PasswordEntryKeyboardHelper.KEYBOARD_MODE_NUMERIC); updateMonitor.registerConfigurationChangeCallback(this); mKeyboardView.setVisibility(mCreatedWithKeyboardOpen ? View.INVISIBLE : View.VISIBLE); mPasswordEntry.requestFocus(); } Loading Loading @@ -144,13 +145,12 @@ public class PasswordUnlockScreen extends LinearLayout implements KeyguardScreen } public void onOrientationChange(boolean inPortrait) { mCallback.recreateMe(); } public void onKeyboardChange(boolean isKeyboardOpen) { if (isKeyboardOpen != mCreatedWithKeyboardOpen) { mCallback.recreateMe(); } // Don't show the soft keyboard when the real keyboard is open mKeyboardView.setVisibility(isKeyboardOpen ? View.INVISIBLE : View.VISIBLE); } public boolean onEditorAction(TextView v, int actionId, KeyEvent event) { Loading
policy/com/android/internal/policy/impl/UnlockScreen.java→policy/com/android/internal/policy/impl/PatternUnlockScreen.java +2 −2 Original line number Diff line number Diff line Loading @@ -42,7 +42,7 @@ import java.util.Date; * This is the screen that shows the 9 circle unlock widget and instructs * the user how to unlock their device, or make an emergency call. */ class UnlockScreen extends LinearLayoutWithDefaultTouchRecepient class PatternUnlockScreen extends LinearLayoutWithDefaultTouchRecepient implements KeyguardScreen, KeyguardUpdateMonitor.ConfigurationChangeCallback, KeyguardUpdateMonitor.InfoCallback, KeyguardUpdateMonitor.SimStateCallback { Loading Loading @@ -160,7 +160,7 @@ class UnlockScreen extends LinearLayoutWithDefaultTouchRecepient * their pattern (e.g they have a google account so we can show them the account based * backup option). */ UnlockScreen(Context context, PatternUnlockScreen(Context context, LockPatternUtils lockPatternUtils, KeyguardUpdateMonitor updateMonitor, KeyguardScreenCallback callback, Loading