diff options
author | Andrew Lee <anwlee@google.com> | 2015-02-02 15:50:29 -0800 |
---|---|---|
committer | Andrew Lee <anwlee@google.com> | 2015-02-02 16:08:41 -0800 |
commit | f98f7b969b55fe517eda9cebcd645309badccae8 (patch) | |
tree | f16d48a25e3b3f2026e78a9652be3122b680dd26 /packages/Keyguard | |
parent | d8f32ea2dffd3f6a080b4eb55a11c0f1c6d7a3a6 (diff) | |
download | frameworks_base-f98f7b969b55fe517eda9cebcd645309badccae8.zip frameworks_base-f98f7b969b55fe517eda9cebcd645309badccae8.tar.gz frameworks_base-f98f7b969b55fe517eda9cebcd645309badccae8.tar.bz2 |
Null-protect attempt to get EmergencyButton.
Not all device layouts, such as for tablets, will have an Emergency
Button, so check for null before attempting to set a callback.
Bug: 18977746
Change-Id: I0e909e71c51f6923edda4707bb25053a5f2de398
Diffstat (limited to 'packages/Keyguard')
-rw-r--r-- | packages/Keyguard/src/com/android/keyguard/KeyguardAbsKeyInputView.java | 4 | ||||
-rw-r--r-- | packages/Keyguard/src/com/android/keyguard/KeyguardPatternView.java | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/packages/Keyguard/src/com/android/keyguard/KeyguardAbsKeyInputView.java b/packages/Keyguard/src/com/android/keyguard/KeyguardAbsKeyInputView.java index 6f322b6..b2e4728 100644 --- a/packages/Keyguard/src/com/android/keyguard/KeyguardAbsKeyInputView.java +++ b/packages/Keyguard/src/com/android/keyguard/KeyguardAbsKeyInputView.java @@ -87,7 +87,9 @@ public abstract class KeyguardAbsKeyInputView extends LinearLayout mEcaView = findViewById(R.id.keyguard_selector_fade_container); EmergencyButton button = (EmergencyButton) findViewById(R.id.emergency_call_button); - button.setCallback(this); + if (button != null) { + button.setCallback(this); + } } public void onEmergencyButtonClickedWhenInCall() { diff --git a/packages/Keyguard/src/com/android/keyguard/KeyguardPatternView.java b/packages/Keyguard/src/com/android/keyguard/KeyguardPatternView.java index 053b309..9aa5729 100644 --- a/packages/Keyguard/src/com/android/keyguard/KeyguardPatternView.java +++ b/packages/Keyguard/src/com/android/keyguard/KeyguardPatternView.java @@ -143,7 +143,9 @@ public class KeyguardPatternView extends LinearLayout implements KeyguardSecurit mHelpMessage = (KeyguardMessageArea) findViewById(R.id.keyguard_message_area); EmergencyButton button = (EmergencyButton) findViewById(R.id.emergency_call_button); - button.setCallback(this); + if (button != null) { + button.setCallback(this); + } } public void onEmergencyButtonClickedWhenInCall() { |