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

Commit cfa3db2d authored by Beth Thibodeau's avatar Beth Thibodeau Committed by Automerger Merge Worker
Browse files

Merge "Do not allow focus on invisible buttons" into udc-dev am: 12305746

parents 2e27842b 12305746
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -946,10 +946,15 @@ public class PipController implements PipTransitionController.PipTransitionCallb
                    mPipBoundsState.getDisplayBounds().right,
                    mPipBoundsState.getDisplayBounds().bottom);
            mPipBoundsState.addNamedUnrestrictedKeepClearArea(LAUNCHER_KEEP_CLEAR_AREA_TAG, rect);
            updatePipPositionForKeepClearAreas();
        } else {
            mPipBoundsState.removeNamedUnrestrictedKeepClearArea(LAUNCHER_KEEP_CLEAR_AREA_TAG);
            // postpone moving in response to hide of Launcher in case there's another change
            mMainExecutor.removeCallbacks(mMovePipInResponseToKeepClearAreasChangeCallback);
            mMainExecutor.executeDelayed(
                    mMovePipInResponseToKeepClearAreasChangeCallback,
                    PIP_KEEP_CLEAR_AREAS_DELAY);
        }
        updatePipPositionForKeepClearAreas();
    }

    private void setLauncherAppIconSize(int iconSizePx) {
+2 −0
Original line number Diff line number Diff line
@@ -1235,6 +1235,8 @@ public class MediaControlPanel {
        if ((buttonId == R.id.actionPrev && semanticActions.getReservePrev())
                || (buttonId == R.id.actionNext && semanticActions.getReserveNext())) {
            notVisibleValue = ConstraintSet.INVISIBLE;
            mMediaViewHolder.getAction(buttonId).setFocusable(visible);
            mMediaViewHolder.getAction(buttonId).setClickable(visible);
        } else {
            notVisibleValue = ConstraintSet.GONE;
        }
+6 −0
Original line number Diff line number Diff line
@@ -530,6 +530,8 @@ public class MediaControlPanelTest : SysuiTestCase() {
        verify(collapsedSet).setVisibility(R.id.actionPlayPause, ConstraintSet.VISIBLE)

        assertThat(actionNext.isEnabled()).isTrue()
        assertThat(actionNext.isFocusable()).isTrue()
        assertThat(actionNext.isClickable()).isTrue()
        assertThat(actionNext.contentDescription).isEqualTo("next")
        verify(collapsedSet).setVisibility(R.id.actionNext, ConstraintSet.VISIBLE)

@@ -576,6 +578,8 @@ public class MediaControlPanelTest : SysuiTestCase() {

        assertThat(actionPrev.isEnabled()).isFalse()
        assertThat(actionPrev.drawable).isNull()
        assertThat(actionPrev.isFocusable()).isFalse()
        assertThat(actionPrev.isClickable()).isFalse()
        verify(expandedSet).setVisibility(R.id.actionPrev, ConstraintSet.INVISIBLE)

        assertThat(actionNext.isEnabled()).isFalse()
@@ -610,6 +614,8 @@ public class MediaControlPanelTest : SysuiTestCase() {

        assertThat(actionNext.isEnabled()).isFalse()
        assertThat(actionNext.drawable).isNull()
        assertThat(actionNext.isFocusable()).isFalse()
        assertThat(actionNext.isClickable()).isFalse()
        verify(expandedSet).setVisibility(R.id.actionNext, ConstraintSet.INVISIBLE)
    }