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

Commit d7d452b8 authored by Justin Weir's avatar Justin Weir
Browse files

Prevent setting expansion height to the current value

This removes the possibility of infinite loops

Fixes: 350192955
Test: Manually verified basic QS CUJs
Flag: EXEMPT bug fix
Change-Id: Ic87c711eb1759e3a8d0aa5e14c7e8657b11d5359
parent 5d4a89bf
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -789,6 +789,9 @@ public class QuickSettingsControllerImpl implements QuickSettingsController, Dum

    /** update Qs height state */
    void setExpansionHeight(float height) {
        if (mExpansionHeight == height) {
            return;
        }
        int maxHeight = getMaxExpansionHeight();
        height = Math.min(Math.max(
                height, getMinExpansionHeight()), maxHeight);
+1 −1
Original line number Diff line number Diff line
@@ -61,7 +61,7 @@ public class QuickSettingsControllerImplTest extends QuickSettingsControllerImpl
    public void testCloseQsSideEffects() {
        enableSplitShade(true);
        mQsController.setExpandImmediate(true);
        mQsController.setExpanded(true);
        mQsController.setExpansionHeight(800);
        mQsController.closeQs();

        assertThat(mQsController.getExpanded()).isEqualTo(false);