Skip to content

Commit b499b1f

Browse files
committed
Don't crash if no ECA.
(Phone landscape pattern lock, for example.) Bug: 7502613 Change-Id: I3f48c4351ea04db2d8ad9a410166f60257f3d954
1 parent 7a73344 commit b499b1f

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)