summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Anton Potapov <apotapov@google.com> 2024-03-27 14:40:33 +0000
committer Anton Potapov <apotapov@google.com> 2024-03-28 12:54:44 +0000
commita80495d9dc34901b18ed2049f2e44adf240a0fc5 (patch)
tree6b2748aedb4df0ab7d6b19fcc515c809adc41666
parentca5e3d42afdf45e8947324ae7defd600a2c78ded (diff)
Rework starting settings activity from Volume Panel bottom bar.
The problem is that ActivityStarterImpl overrides flags passed within the Intent. This CL ensures that Intent.FLAG_ACTIVITY_REORDER_TO_FRONT reaches the activity startup. Flag: aconfig new_volume_panel TRUNKFOOD Test: manually on the phone. Open settings from the Volume Panel Bug: 330814968 Change-Id: Idda64e37e1fc9f0e442fe89abbdbd2336ffc5558
-rw-r--r--packages/SystemUI/multivalentTests/src/com/android/systemui/volume/panel/component/bottombar/ui/viewmodel/BottomBarViewModelTest.kt13
-rw-r--r--packages/SystemUI/src/com/android/systemui/volume/panel/component/bottombar/ui/viewmodel/BottomBarViewModel.kt15
2 files changed, 21 insertions, 7 deletions
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/volume/panel/component/bottombar/ui/viewmodel/BottomBarViewModelTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/volume/panel/component/bottombar/ui/viewmodel/BottomBarViewModelTest.kt
index 8e925573d40a..2cc1ad335535 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/volume/panel/component/bottombar/ui/viewmodel/BottomBarViewModelTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/volume/panel/component/bottombar/ui/viewmodel/BottomBarViewModelTest.kt
@@ -84,8 +84,17 @@ class BottomBarViewModelTest : SysuiTestCase() {
runCurrent()
- verify(activityStarter).startActivity(capture(intentCaptor), eq(true),
- capture(activityStartedCaptor))
+ verify(activityStarter)
+ .startActivityDismissingKeyguard(
+ /* intent = */ capture(intentCaptor),
+ /* onlyProvisioned = */ eq(false),
+ /* dismissShade = */ eq(true),
+ /* disallowEnterPictureInPictureWhileLaunching = */ eq(false),
+ /* callback = */ capture(activityStartedCaptor),
+ /* flags = */ eq(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT),
+ /* animationController = */ eq(null),
+ /* userHandle = */ eq(null),
+ )
assertThat(intentCaptor.value.action).isEqualTo(Settings.ACTION_SOUND_SETTINGS)
activityStartedCaptor.value.onActivityStarted(ActivityManager.START_SUCCESS)
diff --git a/packages/SystemUI/src/com/android/systemui/volume/panel/component/bottombar/ui/viewmodel/BottomBarViewModel.kt b/packages/SystemUI/src/com/android/systemui/volume/panel/component/bottombar/ui/viewmodel/BottomBarViewModel.kt
index 0207d6e8e8c2..04d7b1fa6532 100644
--- a/packages/SystemUI/src/com/android/systemui/volume/panel/component/bottombar/ui/viewmodel/BottomBarViewModel.kt
+++ b/packages/SystemUI/src/com/android/systemui/volume/panel/component/bottombar/ui/viewmodel/BottomBarViewModel.kt
@@ -36,10 +36,15 @@ constructor(
}
fun onSettingsClicked() {
- activityStarter.startActivity(
- Intent(Settings.ACTION_SOUND_SETTINGS)
- .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_REORDER_TO_FRONT),
- true,
- ) { volumePanelViewModel.dismissPanel() }
+ activityStarter.startActivityDismissingKeyguard(
+ /* intent = */ Intent(Settings.ACTION_SOUND_SETTINGS),
+ /* onlyProvisioned = */ false,
+ /* dismissShade = */ true,
+ /* disallowEnterPictureInPictureWhileLaunching = */ false,
+ /* callback = */ { volumePanelViewModel.dismissPanel() },
+ /* flags = */ Intent.FLAG_ACTIVITY_REORDER_TO_FRONT,
+ /* animationController = */ null,
+ /* userHandle = */ null,
+ )
}
}