Merge "Don't crash if no ECA." into jb-mr1-lockscreen-dev

This commit is contained in:
Daniel Sandler
2012-11-08 09:48:28 -08:00
committed by Android (Google) Code Review

View File

@@ -129,12 +129,15 @@ public class KeyguardPatternView extends LinearLayout implements KeyguardSecurit
mLockPatternView.setTactileFeedbackEnabled(mLockPatternUtils.isTactileFeedbackEnabled()); mLockPatternView.setTactileFeedbackEnabled(mLockPatternUtils.isTactileFeedbackEnabled());
mForgotPatternButton = (Button) findViewById(R.id.forgot_password_button); mForgotPatternButton = (Button) findViewById(R.id.forgot_password_button);
mForgotPatternButton.setText(R.string.kg_forgot_pattern_button_text); // note: some configurations don't have an emergency call area
mForgotPatternButton.setOnClickListener(new OnClickListener() { if (mForgotPatternButton != null) {
public void onClick(View v) { mForgotPatternButton.setText(R.string.kg_forgot_pattern_button_text);
mCallback.showBackupSecurity(); mForgotPatternButton.setOnClickListener(new OnClickListener() {
} public void onClick(View v) {
}); mCallback.showBackupSecurity();
}
});
}
setFocusableInTouchMode(true); setFocusableInTouchMode(true);
@@ -148,6 +151,8 @@ public class KeyguardPatternView extends LinearLayout implements KeyguardSecurit
} }
private void updateFooter(FooterMode mode) { private void updateFooter(FooterMode mode) {
if (mForgotPatternButton == null) return; // no ECA? no footer
switch (mode) { switch (mode) {
case Normal: case Normal:
if (DEBUG) Log.d(TAG, "mode normal"); if (DEBUG) Log.d(TAG, "mode normal");