From 911486490dd544dfe8d8c164a6d374e941a9d32b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Ciche=C5=84ski?= Date: Thu, 11 May 2023 22:48:05 +0000 Subject: [PATCH 1/2] Fix Maps PiP entrance to not bounce down and up Quickstep hides itself for moment, which resets setLauncherKeepClearAreaHeight and causes the bounce. Adding delay prevents the movement to trigger too soon. Bug: 282068601 Test: manually, enter PiP in Maps Test: before http://recall/-/ekEuGtt9d9HWqkUtAzpHx8/c0eQkqhMV58ESQTwP6UKSm Test: after http://recall/-/ekEuGtt9d9HWqkUtAzpHx8/gCTmeKSerYbRKsHM5ZsVjp Change-Id: Ic070f63be805ef249f270a6dd1b2180c08e0fa0c --- .../src/com/android/wm/shell/pip/phone/PipController.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipController.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipController.java index f8e1435755830..9e6bd47609005 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipController.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipController.java @@ -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) { From 0dd009333a01a92a9aeca2e5a487a52c5317e047 Mon Sep 17 00:00:00 2001 From: Beth Thibodeau Date: Fri, 12 May 2023 14:42:12 -0500 Subject: [PATCH 2/2] Do not allow focus on invisible buttons Fixes: 282157959 Test: atest MediaControlPanelTest Test: manual with Talkback Change-Id: I0c6d1d5e7e071f9ff6825c8eabe25ecba73271f3 --- .../systemui/media/controls/ui/MediaControlPanel.java | 2 ++ .../systemui/media/controls/ui/MediaControlPanelTest.kt | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/packages/SystemUI/src/com/android/systemui/media/controls/ui/MediaControlPanel.java b/packages/SystemUI/src/com/android/systemui/media/controls/ui/MediaControlPanel.java index 8f0ac28382a48..9eda7ae2586d0 100644 --- a/packages/SystemUI/src/com/android/systemui/media/controls/ui/MediaControlPanel.java +++ b/packages/SystemUI/src/com/android/systemui/media/controls/ui/MediaControlPanel.java @@ -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; } diff --git a/packages/SystemUI/tests/src/com/android/systemui/media/controls/ui/MediaControlPanelTest.kt b/packages/SystemUI/tests/src/com/android/systemui/media/controls/ui/MediaControlPanelTest.kt index 1e465c7917952..68c33fb93fe6f 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/media/controls/ui/MediaControlPanelTest.kt +++ b/packages/SystemUI/tests/src/com/android/systemui/media/controls/ui/MediaControlPanelTest.kt @@ -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) }