Skip to content

Commit 82b18e8

Browse files
dsandlerAndroid Git Automerger
authored andcommitted
am 9de5901: Merge "Don\'t crash if no ECA." into jb-mr1-lockscreen-dev
* commit '9de5901bb37ad2a42d334405f41e629fa29dfd46': Don't crash if no ECA.
2 parents f080dc0 + 9de5901 commit 82b18e8

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

policy/src/com/android/internal/policy/impl/keyguard/KeyguardPatternView.java

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -129,12 +129,15 @@ protected void onFinishInflate() {
129129
mLockPatternView.setTactileFeedbackEnabled(mLockPatternUtils.isTactileFeedbackEnabled());
130130

131131
mForgotPatternButton = (Button) findViewById(R.id.forgot_password_button);
132-
mForgotPatternButton.setText(R.string.kg_forgot_pattern_button_text);
133-
mForgotPatternButton.setOnClickListener(new OnClickListener() {
134-
public void onClick(View v) {
135-
mCallback.showBackupSecurity();
136-
}
137-
});
132+
// note: some configurations don't have an emergency call area
133+
if (mForgotPatternButton != null) {
134+
mForgotPatternButton.setText(R.string.kg_forgot_pattern_button_text);
135+
mForgotPatternButton.setOnClickListener(new OnClickListener() {
136+
public void onClick(View v) {
137+
mCallback.showBackupSecurity();
138+
}
139+
});
140+
}
138141

139142
setFocusableInTouchMode(true);
140143

@@ -148,6 +151,8 @@ public void onClick(View v) {
148151
}
149152

150153
private void updateFooter(FooterMode mode) {
154+
if (mForgotPatternButton == null) return; // no ECA? no footer
155+
151156
switch (mode) {
152157
case Normal:
153158
if (DEBUG) Log.d(TAG, "mode normal");

0 commit comments

Comments
 (0)