From 0b3dfd55f06c8e6dd316d893fec4de9303c9af87 Mon Sep 17 00:00:00 2001 From: Chris Göllner Date: Fri, 21 Jun 2024 14:08:14 +0100 Subject: Shortcut Helper - Connect interactor with system shortcuts Flag: com.android.systemui.keyboard_shortcut_helper_rewrite Test: Unit tests in this CL Bug: 341045652 Change-Id: I03dfbc69cd300225aceeab3d3004ec5ca9d7c50f --- packages/SystemUI/res/values/strings.xml | 16 +++ .../keyboard/shortcut/ShortcutHelperModule.kt | 6 +- .../ShortcutHelperCategoriesRepository.kt | 38 +++++++ .../data/repository/ShortcutHelperRepository.kt | 112 --------------------- .../repository/ShortcutHelperStateRepository.kt | 112 +++++++++++++++++++++ .../data/source/MultitaskingShortcutsSource.kt | 21 +++- .../shortcut/data/source/SystemShortcutsSource.kt | 21 +++- .../ShortcutHelperCategoriesInteractor.kt | 47 +++++++++ .../domain/interactor/ShortcutHelperInteractor.kt | 59 ----------- .../interactor/ShortcutHelperStateInteractor.kt | 59 +++++++++++ .../keyboard/shortcut/shared/model/Shortcut.kt | 10 +- .../shortcut/shared/model/ShortcutCategory.kt | 40 ++++++++ .../shortcut/shared/model/ShortcutCommand.kt | 2 +- .../shortcut/shared/model/ShortcutSubCategory.kt | 19 ++++ .../ui/viewmodel/ShortcutHelperViewModel.kt | 10 +- .../repository/ShortcutHelperRepositoryTest.kt | 102 ------------------- .../ShortcutHelperStateRepositoryTest.kt | 102 +++++++++++++++++++ .../ShortcutHelperCategoriesInteractorTest.kt | 81 +++++++++++++++ .../shortcut/KeyboardShortcutHelperKosmos.kt | 48 +++++++-- .../data/repository/ShortcutHelperTestHelper.kt | 2 +- 20 files changed, 604 insertions(+), 303 deletions(-) create mode 100644 packages/SystemUI/src/com/android/systemui/keyboard/shortcut/data/repository/ShortcutHelperCategoriesRepository.kt delete mode 100644 packages/SystemUI/src/com/android/systemui/keyboard/shortcut/data/repository/ShortcutHelperRepository.kt create mode 100644 packages/SystemUI/src/com/android/systemui/keyboard/shortcut/data/repository/ShortcutHelperStateRepository.kt create mode 100644 packages/SystemUI/src/com/android/systemui/keyboard/shortcut/domain/interactor/ShortcutHelperCategoriesInteractor.kt delete mode 100644 packages/SystemUI/src/com/android/systemui/keyboard/shortcut/domain/interactor/ShortcutHelperInteractor.kt create mode 100644 packages/SystemUI/src/com/android/systemui/keyboard/shortcut/domain/interactor/ShortcutHelperStateInteractor.kt create mode 100644 packages/SystemUI/src/com/android/systemui/keyboard/shortcut/shared/model/ShortcutCategory.kt create mode 100644 packages/SystemUI/src/com/android/systemui/keyboard/shortcut/shared/model/ShortcutSubCategory.kt delete mode 100644 packages/SystemUI/tests/src/com/android/systemui/keyboard/shortcut/data/repository/ShortcutHelperRepositoryTest.kt create mode 100644 packages/SystemUI/tests/src/com/android/systemui/keyboard/shortcut/data/repository/ShortcutHelperStateRepositoryTest.kt create mode 100644 packages/SystemUI/tests/src/com/android/systemui/keyboard/shortcut/domain/interactor/ShortcutHelperCategoriesInteractorTest.kt diff --git a/packages/SystemUI/res/values/strings.xml b/packages/SystemUI/res/values/strings.xml index abafb01cc646..f533cb84da03 100644 --- a/packages/SystemUI/res/values/strings.xml +++ b/packages/SystemUI/res/values/strings.xml @@ -3543,10 +3543,26 @@ shows the user which keyboard shortcuts they can use. The "System" shortcuts are for example "Take a screenshot" or "Go back". [CHAR LIMIT=NONE] --> System + + System controls + + System apps Multitasking + + Recent apps + + Split screen