Loading packages/SystemUI/AndroidManifest.xml +1 −2 Original line number Diff line number Diff line Loading @@ -1110,7 +1110,6 @@ <activity android:name="com.android.systemui.keyboard.shortcut.ui.view.ShortcutHelperActivity" android:exported="false" android:theme="@style/ShortcutHelperTheme" android:excludeFromRecents="true" android:finishOnCloseSystemDialogs="true" /> android:excludeFromRecents="true" /> </application> </manifest> packages/SystemUI/src/com/android/systemui/keyboard/shortcut/data/repository/ShortcutHelperRepository.kt +4 −0 Original line number Diff line number Diff line Loading @@ -49,6 +49,10 @@ constructor( action = Intent.ACTION_DISMISS_KEYBOARD_SHORTCUTS, onReceive = { state.value = Inactive } ) registerBroadcastReceiver( action = Intent.ACTION_CLOSE_SYSTEM_DIALOGS, onReceive = { state.value = Inactive } ) commandQueue.addCallback( object : CommandQueue.Callbacks { override fun dismissKeyboardShortcutsMenu() { Loading packages/SystemUI/tests/src/com/android/systemui/keyboard/shortcut/ui/viewmodel/ShortcutHelperViewModelTest.kt +11 −0 Original line number Diff line number Diff line Loading @@ -102,6 +102,17 @@ class ShortcutHelperViewModelTest : SysuiTestCase() { assertThat(shouldShow).isFalse() } @Test fun shouldShow_falseAfterCloseSystemDialogs() = testScope.runTest { val shouldShow by collectLastValue(viewModel.shouldShow) testHelper.showFromActivity() testHelper.hideThroughCloseSystemDialogs() assertThat(shouldShow).isFalse() } @Test fun shouldShow_doesNotEmitDuplicateValues() = testScope.runTest { Loading packages/SystemUI/tests/utils/src/com/android/systemui/keyboard/shortcut/data/repository/ShortcutHelperTestHelper.kt +7 −0 Original line number Diff line number Diff line Loading @@ -32,6 +32,13 @@ class ShortcutHelperTestHelper( repo.start() } fun hideThroughCloseSystemDialogs() { fakeBroadcastDispatcher.sendIntentToMatchingReceiversOnly( context, Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS) ) } fun hideFromActivity() { fakeBroadcastDispatcher.sendIntentToMatchingReceiversOnly( context, Loading Loading
packages/SystemUI/AndroidManifest.xml +1 −2 Original line number Diff line number Diff line Loading @@ -1110,7 +1110,6 @@ <activity android:name="com.android.systemui.keyboard.shortcut.ui.view.ShortcutHelperActivity" android:exported="false" android:theme="@style/ShortcutHelperTheme" android:excludeFromRecents="true" android:finishOnCloseSystemDialogs="true" /> android:excludeFromRecents="true" /> </application> </manifest>
packages/SystemUI/src/com/android/systemui/keyboard/shortcut/data/repository/ShortcutHelperRepository.kt +4 −0 Original line number Diff line number Diff line Loading @@ -49,6 +49,10 @@ constructor( action = Intent.ACTION_DISMISS_KEYBOARD_SHORTCUTS, onReceive = { state.value = Inactive } ) registerBroadcastReceiver( action = Intent.ACTION_CLOSE_SYSTEM_DIALOGS, onReceive = { state.value = Inactive } ) commandQueue.addCallback( object : CommandQueue.Callbacks { override fun dismissKeyboardShortcutsMenu() { Loading
packages/SystemUI/tests/src/com/android/systemui/keyboard/shortcut/ui/viewmodel/ShortcutHelperViewModelTest.kt +11 −0 Original line number Diff line number Diff line Loading @@ -102,6 +102,17 @@ class ShortcutHelperViewModelTest : SysuiTestCase() { assertThat(shouldShow).isFalse() } @Test fun shouldShow_falseAfterCloseSystemDialogs() = testScope.runTest { val shouldShow by collectLastValue(viewModel.shouldShow) testHelper.showFromActivity() testHelper.hideThroughCloseSystemDialogs() assertThat(shouldShow).isFalse() } @Test fun shouldShow_doesNotEmitDuplicateValues() = testScope.runTest { Loading
packages/SystemUI/tests/utils/src/com/android/systemui/keyboard/shortcut/data/repository/ShortcutHelperTestHelper.kt +7 −0 Original line number Diff line number Diff line Loading @@ -32,6 +32,13 @@ class ShortcutHelperTestHelper( repo.start() } fun hideThroughCloseSystemDialogs() { fakeBroadcastDispatcher.sendIntentToMatchingReceiversOnly( context, Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS) ) } fun hideFromActivity() { fakeBroadcastDispatcher.sendIntentToMatchingReceiversOnly( context, Loading