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

Commit dd7a7649 authored by Fabián Kozynski's avatar Fabián Kozynski
Browse files

Null guard QuickSettingsController#disallowTouches

mQs is set externally and can be null.

Test: atest QuickSettingsControllerTest
Fixes: 305745783
Change-Id: I9498f0bad32ed5361a7ba97f484fa6c7a4cc3775
parent 721668de
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -736,7 +736,11 @@ public class QuickSettingsController implements Dumpable {

    /** Returns whether touches from the notification panel should be disallowed */
    public boolean disallowTouches() {
        if (mQs != null) {
            return mQs.disallowPanelTouches();
        } else {
            return false;
        }
    }

    void setListening(boolean listening) {
+6 −0
Original line number Diff line number Diff line
@@ -398,6 +398,12 @@ public class QuickSettingsControllerTest extends QuickSettingsControllerBaseTest
                .isEqualTo(mQsController.getScrimCornerRadius());
    }

    @Test
    public void disallowTouches_nullQs_false() {
        mQsController.setQs(null);
        assertThat(mQsController.disallowTouches()).isFalse();
    }

    private void lockScreen() {
        mQsController.setBarState(KEYGUARD);
    }