summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Sandler <dsandler@android.com>2012-11-08 12:42:54 -0500
committerDaniel Sandler <dsandler@android.com>2012-11-08 12:42:54 -0500
commitb499b1fa082147ad37e1211f32210b44bdbc0750 (patch)
tree1057a5aad1478e980bed311e1a8d2e96ff567672
parent7a73344bbe1636fd01a8b551b0b539168a9a9987 (diff)
downloadframeworks_base-b499b1fa082147ad37e1211f32210b44bdbc0750.zip
frameworks_base-b499b1fa082147ad37e1211f32210b44bdbc0750.tar.gz
frameworks_base-b499b1fa082147ad37e1211f32210b44bdbc0750.tar.bz2
Don't crash if no ECA.
(Phone landscape pattern lock, for example.) Bug: 7502613 Change-Id: I3f48c4351ea04db2d8ad9a410166f60257f3d954
-rw-r--r--policy/src/com/android/internal/policy/impl/keyguard/KeyguardPatternView.java17
1 files changed, 11 insertions, 6 deletions
diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardPatternView.java b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardPatternView.java
index 67469d9..e114b78 100644
--- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardPatternView.java
+++ b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardPatternView.java
@@ -129,12 +129,15 @@ public class KeyguardPatternView extends LinearLayout implements KeyguardSecurit
mLockPatternView.setTactileFeedbackEnabled(mLockPatternUtils.isTactileFeedbackEnabled());
mForgotPatternButton = (Button) findViewById(R.id.forgot_password_button);
- mForgotPatternButton.setText(R.string.kg_forgot_pattern_button_text);
- mForgotPatternButton.setOnClickListener(new OnClickListener() {
- public void onClick(View v) {
- mCallback.showBackupSecurity();
- }
- });
+ // note: some configurations don't have an emergency call area
+ if (mForgotPatternButton != null) {
+ mForgotPatternButton.setText(R.string.kg_forgot_pattern_button_text);
+ mForgotPatternButton.setOnClickListener(new OnClickListener() {
+ public void onClick(View v) {
+ mCallback.showBackupSecurity();
+ }
+ });
+ }
setFocusableInTouchMode(true);
@@ -148,6 +151,8 @@ public class KeyguardPatternView extends LinearLayout implements KeyguardSecurit
}
private void updateFooter(FooterMode mode) {
+ if (mForgotPatternButton == null) return; // no ECA? no footer
+
switch (mode) {
case Normal:
if (DEBUG) Log.d(TAG, "mode normal");