Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f98f7b96 authored by Andrew Lee's avatar Andrew Lee
Browse files

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
parent d8f32ea2
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -87,8 +87,10 @@ public abstract class KeyguardAbsKeyInputView extends LinearLayout
        mEcaView = findViewById(R.id.keyguard_selector_fade_container);

        EmergencyButton button = (EmergencyButton) findViewById(R.id.emergency_call_button);
        if (button != null) {
            button.setCallback(this);
        }
    }

    public void onEmergencyButtonClickedWhenInCall() {
        mCallback.reset();
+3 −1
Original line number Diff line number Diff line
@@ -143,8 +143,10 @@ public class KeyguardPatternView extends LinearLayout implements KeyguardSecurit
        mHelpMessage = (KeyguardMessageArea) findViewById(R.id.keyguard_message_area);

        EmergencyButton button = (EmergencyButton) findViewById(R.id.emergency_call_button);
        if (button != null) {
            button.setCallback(this);
        }
    }

    public void onEmergencyButtonClickedWhenInCall() {
        mCallback.reset();