summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--AconfigFlags.bp21
-rw-r--r--MULTIUSER_OWNERS2
-rw-r--r--OWNERS18
-rw-r--r--apct-tests/perftests/core/src/android/os/MessageQueuePerfTest.java213
-rw-r--r--apex/jobscheduler/service/aconfig/app_idle.aconfig9
-rw-r--r--apex/jobscheduler/service/java/com/android/server/DeviceIdleController.java2
-rw-r--r--apex/jobscheduler/service/java/com/android/server/usage/AppIdleHistory.java13
-rw-r--r--core/api/current.txt48
-rw-r--r--core/api/system-current.txt22
-rw-r--r--core/java/android/animation/AnimationHandler.java52
-rw-r--r--core/java/android/animation/Animator.java39
-rw-r--r--core/java/android/animation/AnimatorSet.java9
-rw-r--r--core/java/android/animation/ValueAnimator.java13
-rw-r--r--core/java/android/app/Notification.java2
-rw-r--r--core/java/android/app/NotificationChannel.java14
-rw-r--r--core/java/android/app/OWNERS64
-rw-r--r--core/java/android/app/PropertyInvalidatedCache.java203
-rw-r--r--core/java/android/app/SystemServiceRegistry.java98
-rw-r--r--core/java/android/content/Context.java30
-rw-r--r--core/java/android/content/OWNERS6
-rw-r--r--core/java/android/content/pm/IPackageInstaller.aidl6
-rw-r--r--core/java/android/content/pm/PackageInstaller.java149
-rw-r--r--core/java/android/content/pm/flags.aconfig8
-rw-r--r--core/java/android/content/pm/multiuser.aconfig22
-rw-r--r--core/java/android/content/pm/verify/pkg/IVerificationSessionCallback.aidl34
-rw-r--r--core/java/android/content/pm/verify/pkg/IVerificationSessionInterface.aidl13
-rw-r--r--core/java/android/content/pm/verify/pkg/VerificationSession.java68
-rw-r--r--core/java/android/hardware/DataSpace.java18
-rw-r--r--core/java/android/hardware/HardwareBuffer.java2
-rw-r--r--core/java/android/hardware/display/DisplayManager.java16
-rw-r--r--core/java/android/hardware/input/input_framework.aconfig8
-rw-r--r--core/java/android/hardware/radio/RadioAlert.java40
-rw-r--r--core/java/android/net/vcn/VcnFrameworkInitializer.java106
-rw-r--r--core/java/android/net/vcn/flags.aconfig7
-rw-r--r--core/java/android/os/BatteryUsageStats.java5
-rw-r--r--core/java/android/os/BatteryUsageStatsQuery.java70
-rw-r--r--core/java/android/os/ConcurrentMessageQueue/MessageQueue.java2
-rw-r--r--core/java/android/os/GraphicsEnvironment.java84
-rw-r--r--core/java/android/os/OWNERS3
-rw-r--r--core/java/android/os/RemoteCallbackList.java470
-rw-r--r--core/java/android/os/SemiConcurrentMessageQueue/MessageQueue.java2
-rw-r--r--core/java/android/os/StatsBootstrapAtomValue.aidl42
-rw-r--r--core/java/android/os/UidBatteryConsumer.java8
-rw-r--r--core/java/android/os/UserManager.java8
-rw-r--r--core/java/android/os/ZygoteProcess.java52
-rw-r--r--core/java/android/permission/flags.aconfig9
-rw-r--r--core/java/android/provider/Settings.java6
-rw-r--r--core/java/android/security/advancedprotection/AdvancedProtectionManager.java164
-rw-r--r--core/java/android/security/advancedprotection/IAdvancedProtectionCallback.aidl25
-rw-r--r--core/java/android/security/advancedprotection/IAdvancedProtectionService.aidl35
-rw-r--r--core/java/android/security/flags.aconfig7
-rw-r--r--core/java/android/security/forensic/IForensicService.aidl32
-rw-r--r--core/java/android/security/forensic/IForensicServiceCommandCallback.aidl33
-rw-r--r--core/java/android/security/forensic/IForensicServiceStateCallback.aidl31
-rw-r--r--core/java/android/security/responsible_apis_flags.aconfig9
-rw-r--r--core/java/android/service/wallpaper/Android.bp24
-rw-r--r--core/java/android/telephony/TelephonyCallback.java2
-rw-r--r--core/java/android/view/DisplayEventReceiver.java2
-rw-r--r--core/java/android/view/LetterboxScrollProcessor.java40
-rw-r--r--core/java/android/view/MotionEvent.java4
-rw-r--r--core/java/android/view/OWNERS1
-rw-r--r--core/java/android/view/RoundScrollbarRenderer.java249
-rw-r--r--core/java/android/view/SurfaceView.java7
-rw-r--r--core/java/android/view/View.java4
-rw-r--r--core/java/android/view/ViewRootImpl.java9
-rw-r--r--core/java/android/view/WindowlessWindowManager.java5
-rw-r--r--core/java/android/view/accessibility/AccessibilityNodeInfo.java5
-rw-r--r--core/java/android/view/flags/refresh_rate_flags.aconfig8
-rw-r--r--core/java/android/view/flags/view_flags.aconfig8
-rw-r--r--core/java/android/webkit/WebChromeClient.java52
-rw-r--r--core/java/android/webkit/WebView.java7
-rw-r--r--core/java/android/webkit/flags.aconfig16
-rw-r--r--core/java/android/window/flags/lse_desktop_experience.aconfig7
-rw-r--r--core/java/android/window/flags/windowing_sdk.aconfig7
-rw-r--r--core/java/com/android/internal/jank/FrameTracker.java4
-rw-r--r--core/java/com/android/internal/os/BatteryStatsHistory.java22
-rw-r--r--core/java/com/android/internal/protolog/ProtoLogViewerConfigReader.java1
-rw-r--r--core/jni/Android.bp20
-rw-r--r--core/jni/android_database_CursorWindow.cpp84
-rw-r--r--core/jni/android_hardware_camera2_CameraMetadata.cpp19
-rw-r--r--core/jni/android_view_InputDevice.cpp2
-rw-r--r--core/jni/platform/host/HostRuntime.cpp2
-rw-r--r--core/proto/android/app/OWNERS2
-rw-r--r--core/res/Android.bp1
-rw-r--r--core/res/AndroidManifest.xml31
-rw-r--r--core/res/OWNERS2
-rw-r--r--core/res/res/values-iw/strings.xml2
-rw-r--r--core/res/res/values/config.xml5
-rw-r--r--core/res/res/values/config_battery_stats.xml7
-rw-r--r--core/res/res/values/symbols.xml2
-rw-r--r--core/res/res/values/themes_device_defaults.xml176
-rw-r--r--core/tests/coretests/src/android/animation/ValueAnimatorTests.java30
-rw-r--r--core/tests/coretests/src/android/app/NotificationChannelTest.java25
-rw-r--r--core/tests/coretests/src/android/app/PropertyInvalidatedCacheTests.java60
-rw-r--r--core/tests/coretests/src/android/content/pm/verify/VerificationSessionTest.java59
-rw-r--r--core/tests/coretests/src/android/content/pm/verify/VerifierServiceTest.java8
-rw-r--r--core/tests/coretests/src/android/os/IpcDataCacheTest.java58
-rw-r--r--core/tests/coretests/src/android/text/LayoutTest.java4
-rw-r--r--core/tests/coretests/src/android/view/LetterboxScrollProcessorTest.java147
-rw-r--r--core/tests/coretests/src/android/view/RoundScrollbarRendererTest.java146
-rw-r--r--core/tests/coretests/src/android/view/ViewFrameRateTest.java62
-rw-r--r--core/tests/coretests/src/com/android/internal/jank/FrameTrackerTest.java41
-rw-r--r--data/etc/privapp-permissions-platform.xml4
-rw-r--r--graphics/java/android/framework_graphics.aconfig9
-rw-r--r--graphics/java/android/graphics/Bitmap.java29
-rw-r--r--graphics/java/android/graphics/ColorSpace.java52
-rw-r--r--graphics/java/android/graphics/text/PositionedGlyphs.java42
-rw-r--r--keystore/java/android/security/OWNERS1
-rw-r--r--keystore/java/android/security/keystore/KeyStoreManager.java327
-rw-r--r--keystore/java/android/security/keystore2/AndroidKeyStoreProvider.java41
-rw-r--r--keystore/java/android/security/keystore2/AndroidKeyStorePublicKey.java16
-rw-r--r--libcore-readonly.aconfig25
-rw-r--r--libs/WindowManager/Jetpack/src/androidx/window/extensions/WindowExtensionsImpl.java12
-rw-r--r--libs/WindowManager/Jetpack/src/androidx/window/extensions/embedding/DividerPresenter.java3
-rw-r--r--libs/WindowManager/Shell/res/layout/desktop_mode_window_decor_handle_menu.xml1
-rw-r--r--libs/WindowManager/Shell/res/values-af/strings.xml6
-rw-r--r--libs/WindowManager/Shell/res/values-am/strings.xml6
-rw-r--r--libs/WindowManager/Shell/res/values-ar/strings.xml6
-rw-r--r--libs/WindowManager/Shell/res/values-as/strings.xml6
-rw-r--r--libs/WindowManager/Shell/res/values-az/strings.xml6
-rw-r--r--libs/WindowManager/Shell/res/values-b+sr+Latn/strings.xml6
-rw-r--r--libs/WindowManager/Shell/res/values-be/strings.xml6
-rw-r--r--libs/WindowManager/Shell/res/values-bg/strings.xml6
-rw-r--r--libs/WindowManager/Shell/res/values-bn/strings.xml6
-rw-r--r--libs/WindowManager/Shell/res/values-bs/strings.xml6
-rw-r--r--libs/WindowManager/Shell/res/values-ca/strings.xml6
-rw-r--r--libs/WindowManager/Shell/res/values-cs/strings.xml6
-rw-r--r--libs/WindowManager/Shell/res/values-da/strings.xml6
-rw-r--r--libs/WindowManager/Shell/res/values-de/strings.xml21
-rw-r--r--libs/WindowManager/Shell/res/values-el/strings.xml6
-rw-r--r--libs/WindowManager/Shell/res/values-en-rAU/strings.xml6
-rw-r--r--libs/WindowManager/Shell/res/values-en-rCA/strings.xml6
-rw-r--r--libs/WindowManager/Shell/res/values-en-rGB/strings.xml6
-rw-r--r--libs/WindowManager/Shell/res/values-en-rIN/strings.xml6
-rw-r--r--libs/WindowManager/Shell/res/values-es-rUS/strings.xml6
-rw-r--r--libs/WindowManager/Shell/res/values-es/strings.xml21
-rw-r--r--libs/WindowManager/Shell/res/values-et/strings.xml6
-rw-r--r--libs/WindowManager/Shell/res/values-eu/strings.xml6
-rw-r--r--libs/WindowManager/Shell/res/values-fa/strings.xml6
-rw-r--r--libs/WindowManager/Shell/res/values-fi/strings.xml6
-rw-r--r--libs/WindowManager/Shell/res/values-fr-rCA/strings.xml21
-rw-r--r--libs/WindowManager/Shell/res/values-fr/strings.xml21
-rw-r--r--libs/WindowManager/Shell/res/values-gl/strings.xml6
-rw-r--r--libs/WindowManager/Shell/res/values-gu/strings.xml6
-rw-r--r--libs/WindowManager/Shell/res/values-hi/strings.xml6
-rw-r--r--libs/WindowManager/Shell/res/values-hr/strings.xml6
-rw-r--r--libs/WindowManager/Shell/res/values-hu/strings.xml6
-rw-r--r--libs/WindowManager/Shell/res/values-hy/strings.xml6
-rw-r--r--libs/WindowManager/Shell/res/values-in/strings.xml6
-rw-r--r--libs/WindowManager/Shell/res/values-is/strings.xml6
-rw-r--r--libs/WindowManager/Shell/res/values-it/strings.xml21
-rw-r--r--libs/WindowManager/Shell/res/values-iw/strings.xml6
-rw-r--r--libs/WindowManager/Shell/res/values-ja/strings.xml6
-rw-r--r--libs/WindowManager/Shell/res/values-ka/strings.xml6
-rw-r--r--libs/WindowManager/Shell/res/values-kk/strings.xml6
-rw-r--r--libs/WindowManager/Shell/res/values-km/strings.xml6
-rw-r--r--libs/WindowManager/Shell/res/values-kn/strings.xml6
-rw-r--r--libs/WindowManager/Shell/res/values-ko/strings.xml6
-rw-r--r--libs/WindowManager/Shell/res/values-ky/strings.xml6
-rw-r--r--libs/WindowManager/Shell/res/values-lo/strings.xml6
-rw-r--r--libs/WindowManager/Shell/res/values-lt/strings.xml6
-rw-r--r--libs/WindowManager/Shell/res/values-lv/strings.xml6
-rw-r--r--libs/WindowManager/Shell/res/values-mk/strings.xml21
-rw-r--r--libs/WindowManager/Shell/res/values-ml/strings.xml6
-rw-r--r--libs/WindowManager/Shell/res/values-mn/strings.xml6
-rw-r--r--libs/WindowManager/Shell/res/values-mr/strings.xml6
-rw-r--r--libs/WindowManager/Shell/res/values-ms/strings.xml6
-rw-r--r--libs/WindowManager/Shell/res/values-my/strings.xml6
-rw-r--r--libs/WindowManager/Shell/res/values-nb/strings.xml6
-rw-r--r--libs/WindowManager/Shell/res/values-ne/strings.xml6
-rw-r--r--libs/WindowManager/Shell/res/values-nl/strings.xml6
-rw-r--r--libs/WindowManager/Shell/res/values-or/strings.xml21
-rw-r--r--libs/WindowManager/Shell/res/values-pa/strings.xml6
-rw-r--r--libs/WindowManager/Shell/res/values-pl/strings.xml6
-rw-r--r--libs/WindowManager/Shell/res/values-pt-rBR/strings.xml6
-rw-r--r--libs/WindowManager/Shell/res/values-pt-rPT/strings.xml6
-rw-r--r--libs/WindowManager/Shell/res/values-pt/strings.xml6
-rw-r--r--libs/WindowManager/Shell/res/values-ro/strings.xml6
-rw-r--r--libs/WindowManager/Shell/res/values-ru/strings.xml6
-rw-r--r--libs/WindowManager/Shell/res/values-si/strings.xml6
-rw-r--r--libs/WindowManager/Shell/res/values-sk/strings.xml6
-rw-r--r--libs/WindowManager/Shell/res/values-sl/strings.xml6
-rw-r--r--libs/WindowManager/Shell/res/values-sq/strings.xml21
-rw-r--r--libs/WindowManager/Shell/res/values-sr/strings.xml6
-rw-r--r--libs/WindowManager/Shell/res/values-sv/strings.xml8
-rw-r--r--libs/WindowManager/Shell/res/values-sw/strings.xml6
-rw-r--r--libs/WindowManager/Shell/res/values-ta/strings.xml6
-rw-r--r--libs/WindowManager/Shell/res/values-te/strings.xml6
-rw-r--r--libs/WindowManager/Shell/res/values-th/strings.xml6
-rw-r--r--libs/WindowManager/Shell/res/values-tl/strings.xml6
-rw-r--r--libs/WindowManager/Shell/res/values-tr/strings.xml6
-rw-r--r--libs/WindowManager/Shell/res/values-uk/strings.xml21
-rw-r--r--libs/WindowManager/Shell/res/values-ur/strings.xml6
-rw-r--r--libs/WindowManager/Shell/res/values-uz/strings.xml21
-rw-r--r--libs/WindowManager/Shell/res/values-vi/strings.xml6
-rw-r--r--libs/WindowManager/Shell/res/values-zh-rCN/strings.xml6
-rw-r--r--libs/WindowManager/Shell/res/values-zh-rHK/strings.xml6
-rw-r--r--libs/WindowManager/Shell/res/values-zh-rTW/strings.xml6
-rw-r--r--libs/WindowManager/Shell/res/values-zu/strings.xml6
-rw-r--r--libs/WindowManager/Shell/res/values/styles.xml3
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/dagger/WMShellModule.java3
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopFullImmersiveTransitionHandler.kt71
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopModeUtils.kt17
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopRepository.kt12
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopTasksController.kt93
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopTasksTransitionObserver.kt5
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/IDesktopMode.aidl9
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/minimize/DesktopWindowLimitRemoteHandler.kt100
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipTransition.java9
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/pip2/animation/PipEnterAnimator.java18
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/pip2/phone/PipMotionHelper.java7
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/pip2/phone/PipTouchHandler.java15
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/pip2/phone/PipTransition.java51
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageTaskListener.java3
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/unfold/UnfoldTransitionHandler.java22
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopHandleManageWindowsMenu.kt16
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopHeaderManageWindowsMenu.kt58
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecoration.java22
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/HandleMenu.kt48
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/WindowDecoration.java6
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/additionalviewcontainer/AdditionalSystemViewContainer.kt3
-rw-r--r--libs/WindowManager/Shell/tests/e2e/desktopmode/flicker-service/src/com/android/wm/shell/flicker/DesktopModeFlickerScenarios.kt3
-rw-r--r--libs/WindowManager/Shell/tests/e2e/desktopmode/flicker-service/src/com/android/wm/shell/flicker/ResizeAppToMaximumWindowSizeLandscape.kt4
-rw-r--r--libs/WindowManager/Shell/tests/e2e/desktopmode/flicker-service/src/com/android/wm/shell/flicker/ResizeAppToMaximumWindowSizePortrait.kt4
-rw-r--r--libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/src/com/android/wm/shell/scenarios/MaximiseAppWithCornerResize.kt94
-rw-r--r--libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/src/com/android/wm/shell/scenarios/ResizeAppWithCornerResize.kt29
-rw-r--r--libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/desktopmode/DesktopFullImmersiveTransitionHandlerTest.kt223
-rw-r--r--libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/desktopmode/DesktopRepositoryTest.kt34
-rw-r--r--libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/desktopmode/DesktopTasksControllerTest.kt47
-rw-r--r--libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/desktopmode/DesktopTasksTransitionObserverTest.kt28
-rw-r--r--libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/desktopmode/minimize/DesktopWindowLimitRemoteHandlerTest.kt167
-rw-r--r--libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/unfold/UnfoldTransitionHandlerTest.java30
-rw-r--r--libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/DesktopHeaderManageWindowsMenuTest.kt111
-rw-r--r--libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecorationTests.java38
-rw-r--r--libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/HandleMenuTest.kt57
-rw-r--r--libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/WindowDecorationTests.java17
-rw-r--r--libs/androidfw/Android.bp7
-rw-r--r--libs/androidfw/CursorWindow.cpp23
-rw-r--r--libs/androidfw/include/androidfw/CursorWindow.h8
-rw-r--r--libs/hwui/jni/text/TextShaper.cpp97
-rw-r--r--libs/hwui/utils/Color.cpp13
-rw-r--r--nfc/java/android/nfc/NfcAdapter.java10
-rw-r--r--nfc/java/android/nfc/NfcOemExtension.java7
-rw-r--r--nfc/java/android/nfc/cardemulation/ApduServiceInfo.java2
-rw-r--r--packages/CompanionDeviceManager/res/values-bn/strings.xml18
-rw-r--r--packages/CompanionDeviceManager/res/values-ca/strings.xml4
-rw-r--r--packages/CompanionDeviceManager/res/values-de/strings.xml18
-rw-r--r--packages/CompanionDeviceManager/res/values-es-rUS/strings.xml18
-rw-r--r--packages/CompanionDeviceManager/res/values-es/strings.xml18
-rw-r--r--packages/CompanionDeviceManager/res/values-fr-rCA/strings.xml18
-rw-r--r--packages/CompanionDeviceManager/res/values-fr/strings.xml18
-rw-r--r--packages/CompanionDeviceManager/res/values-hy/strings.xml18
-rw-r--r--packages/CompanionDeviceManager/res/values-it/strings.xml18
-rw-r--r--packages/CompanionDeviceManager/res/values-mk/strings.xml18
-rw-r--r--packages/CompanionDeviceManager/res/values-mn/strings.xml18
-rw-r--r--packages/CompanionDeviceManager/res/values-ms/strings.xml4
-rw-r--r--packages/CompanionDeviceManager/res/values-sq/strings.xml18
-rw-r--r--packages/CompanionDeviceManager/res/values-ta/strings.xml18
-rw-r--r--packages/CompanionDeviceManager/res/values-tr/strings.xml18
-rw-r--r--packages/CompanionDeviceManager/res/values-uk/strings.xml18
-rw-r--r--packages/CredentialManager/src/com/android/credentialmanager/common/ui/SnackBar.kt14
-rw-r--r--packages/PrintSpooler/res/values-kn/strings.xml2
-rw-r--r--packages/SettingsLib/DataStore/src/com/android/settingslib/datastore/SettingsGlobalStore.kt4
-rw-r--r--packages/SettingsLib/DataStore/src/com/android/settingslib/datastore/SettingsSecureStore.kt4
-rw-r--r--packages/SettingsLib/DataStore/src/com/android/settingslib/datastore/SettingsStore.kt41
-rw-r--r--packages/SettingsLib/DataStore/src/com/android/settingslib/datastore/SettingsSystemStore.kt4
-rw-r--r--packages/SettingsLib/DeviceStateRotationLock/src/com.android.settingslib.devicestate/DeviceStateRotationLockSettingsManager.java14
-rw-r--r--packages/SettingsLib/DeviceStateRotationLock/src/com.android.settingslib.devicestate/PosturesHelper.kt81
-rw-r--r--packages/SettingsLib/Preference/src/com/android/settingslib/preference/PreferenceScreenBindingHelper.kt13
-rw-r--r--packages/SettingsLib/Preference/testutils/com/android/settingslib/preference/CatalystScreenTestCase.kt11
-rw-r--r--packages/SettingsLib/Spa/gallery/src/com/android/settingslib/spa/gallery/GallerySpaEnvironment.kt2
-rw-r--r--packages/SettingsLib/Spa/gallery/src/com/android/settingslib/spa/gallery/card/CardPageProvider.kt104
-rw-r--r--packages/SettingsLib/Spa/gallery/src/com/android/settingslib/spa/gallery/home/HomePageProvider.kt2
-rw-r--r--packages/SettingsLib/Spa/spa/src/com/android/settingslib/spa/framework/theme/SettingsDimension.kt8
-rw-r--r--packages/SettingsLib/Spa/spa/src/com/android/settingslib/spa/framework/theme/SettingsShape.kt2
-rw-r--r--packages/SettingsLib/Spa/spa/src/com/android/settingslib/spa/widget/card/SuggestionCard.kt166
-rw-r--r--packages/SettingsLib/Spa/spa/src/com/android/settingslib/spa/widget/ui/Category.kt8
-rw-r--r--packages/SettingsLib/Spa/spa/src/com/android/settingslib/spa/widget/ui/Spinner.kt4
-rw-r--r--packages/SettingsLib/Spa/tests/src/com/android/settingslib/spa/widget/banner/SettingsBannerTest.kt (renamed from packages/SettingsLib/Spa/tests/src/com/android/settingslib/spa/widget/card/SettingsBannerTest.kt)0
-rw-r--r--packages/SettingsLib/Spa/tests/src/com/android/settingslib/spa/widget/banner/SettingsCollapsibleBannerTest.kt (renamed from packages/SettingsLib/Spa/tests/src/com/android/settingslib/spa/widget/card/SettingsCollapsibleBannerTest.kt)0
-rw-r--r--packages/SettingsLib/Spa/tests/src/com/android/settingslib/spa/widget/card/SuggestionCardTest.kt84
-rw-r--r--packages/SettingsLib/SpaPrivileged/src/com/android/settingslib/spaprivileged/template/app/AppInfo.kt91
-rw-r--r--packages/SettingsLib/res/values-af/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-am/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-ar/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-as/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-az/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-b+sr+Latn/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-be/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-bg/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-bn/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-bs/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-ca/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-cs/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-da/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-de/strings.xml9
-rw-r--r--packages/SettingsLib/res/values-el/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-en-rAU/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-en-rCA/strings.xml4
-rw-r--r--packages/SettingsLib/res/values-en-rGB/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-en-rIN/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-es-rUS/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-es/strings.xml9
-rw-r--r--packages/SettingsLib/res/values-et/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-eu/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-fa/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-fi/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-fr-rCA/strings.xml11
-rw-r--r--packages/SettingsLib/res/values-fr/strings.xml9
-rw-r--r--packages/SettingsLib/res/values-gl/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-gu/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-hi/arrays.xml4
-rw-r--r--packages/SettingsLib/res/values-hi/strings.xml8
-rw-r--r--packages/SettingsLib/res/values-hr/strings.xml8
-rw-r--r--packages/SettingsLib/res/values-hu/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-hy/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-in/strings.xml8
-rw-r--r--packages/SettingsLib/res/values-is/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-it/strings.xml9
-rw-r--r--packages/SettingsLib/res/values-iw/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-ja/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-ka/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-kk/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-km/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-kn/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-ko/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-ky/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-lo/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-lt/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-lv/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-mk/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-ml/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-mn/arrays.xml2
-rw-r--r--packages/SettingsLib/res/values-mn/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-mr/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-ms/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-my/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-nb/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-ne/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-nl/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-or/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-pa/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-pl/strings.xml4
-rw-r--r--packages/SettingsLib/res/values-pt-rBR/arrays.xml12
-rw-r--r--packages/SettingsLib/res/values-pt-rBR/strings.xml10
-rw-r--r--packages/SettingsLib/res/values-pt-rPT/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-pt/arrays.xml12
-rw-r--r--packages/SettingsLib/res/values-pt/strings.xml10
-rw-r--r--packages/SettingsLib/res/values-ro/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-ru/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-si/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-sk/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-sl/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-sq/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-sr/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-sv/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-sw/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-ta/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-te/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-th/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-tl/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-tr/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-uk/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-ur/strings.xml10
-rw-r--r--packages/SettingsLib/res/values-uz/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-vi/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-zh-rCN/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-zh-rHK/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-zh-rTW/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-zu/strings.xml6
-rw-r--r--packages/SettingsLib/src/com/android/settingslib/display/DisplayDensityUtils.java248
-rw-r--r--packages/SettingsLib/tests/integ/src/com/android/settingslib/devicestate/DeviceStateRotationLockSettingsManagerTest.java42
-rw-r--r--packages/SettingsLib/tests/integ/src/com/android/settingslib/devicestate/PosturesHelperTest.kt126
-rw-r--r--packages/SettingsProvider/src/android/provider/settings/backup/SecureSettings.java1
-rw-r--r--packages/SettingsProvider/src/android/provider/settings/validators/SecureSettingsValidators.java1
-rw-r--r--packages/Shell/Android.bp11
-rw-r--r--packages/Shell/AndroidManifest.xml6
-rw-r--r--packages/SystemUI/AndroidManifest.xml6
-rw-r--r--packages/SystemUI/aconfig/systemui.aconfig50
-rw-r--r--packages/SystemUI/animation/src/com/android/systemui/surfaceeffects/turbulencenoise/TurbulenceNoiseShader.kt36
-rw-r--r--packages/SystemUI/compose/features/src/com/android/systemui/bouncer/ui/composable/BouncerContent.kt239
-rw-r--r--packages/SystemUI/compose/features/src/com/android/systemui/communal/ui/compose/CommunalHub.kt95
-rw-r--r--packages/SystemUI/compose/features/src/com/android/systemui/communal/ui/compose/GridDragDropState.kt23
-rw-r--r--packages/SystemUI/compose/features/src/com/android/systemui/communal/ui/compose/ResizeableItemFrame.kt73
-rw-r--r--packages/SystemUI/compose/features/src/com/android/systemui/notifications/ui/composable/Notifications.kt63
-rw-r--r--packages/SystemUI/compose/features/src/com/android/systemui/qs/ui/composable/QuickSettingsScene.kt20
-rw-r--r--packages/SystemUI/compose/features/src/com/android/systemui/statusbar/phone/SystemUIDialogFactoryExt.kt126
-rw-r--r--packages/SystemUI/compose/features/src/com/android/systemui/volume/panel/ui/composable/VolumePanelRoot.kt48
-rw-r--r--packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/ElementMatcher.kt47
-rw-r--r--packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/SceneTransitionLayoutState.kt4
-rw-r--r--packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/SceneTransitions.kt35
-rw-r--r--packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/TransitionDsl.kt3
-rw-r--r--packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/TransitionDslImpl.kt21
-rw-r--r--packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/ElementMatcherTest.kt56
-rw-r--r--packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/ElementTest.kt4
-rw-r--r--packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/OverlayTest.kt6
-rw-r--r--packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/TransitionDslTest.kt111
-rw-r--r--packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/transformation/SharedElementTest.kt6
-rw-r--r--packages/SystemUI/compose/scene/tests/utils/src/com/android/compose/animation/scene/TestMatchers.kt4
-rw-r--r--packages/SystemUI/customization/src/com/android/systemui/shared/clocks/AssetLoader.kt5
-rw-r--r--packages/SystemUI/customization/src/com/android/systemui/shared/clocks/DefaultClockProvider.kt6
-rw-r--r--packages/SystemUI/customization/src/com/android/systemui/shared/clocks/FlexClockFaceController.kt4
-rw-r--r--packages/SystemUI/multivalentTests/src/com/android/keyguard/KeyguardClockSwitchControllerBaseTest.java4
-rw-r--r--packages/SystemUI/multivalentTests/src/com/android/keyguard/KeyguardClockSwitchControllerWithCoroutinesTest.kt62
-rw-r--r--packages/SystemUI/multivalentTests/src/com/android/systemui/accessibility/hearingaid/HearingDevicesDialogDelegateTest.java17
-rw-r--r--packages/SystemUI/multivalentTests/src/com/android/systemui/accessibility/hearingaid/HearingDevicesToolItemParserTest.java14
-rw-r--r--packages/SystemUI/multivalentTests/src/com/android/systemui/communal/ui/compose/CommunalHubUtilsTest.kt41
-rw-r--r--packages/SystemUI/multivalentTests/src/com/android/systemui/communal/ui/viewmodel/ResizeableItemFrameViewModelTest.kt187
-rw-r--r--packages/SystemUI/multivalentTests/src/com/android/systemui/display/data/repository/DeviceStateRepositoryTest.kt132
-rw-r--r--packages/SystemUI/multivalentTests/src/com/android/systemui/display/data/repository/PerDisplayStoreImplTest.kt (renamed from packages/SystemUI/tests/src/com/android/systemui/statusbar/window/MultiDisplayStatusBarWindowControllerStoreTest.kt)59
-rw-r--r--packages/SystemUI/multivalentTests/src/com/android/systemui/education/domain/interactor/KeyboardTouchpadEduInteractorTest.kt148
-rw-r--r--packages/SystemUI/multivalentTests/src/com/android/systemui/education/domain/interactor/KeyboardTouchpadStatsInteractorTest.kt172
-rw-r--r--packages/SystemUI/multivalentTests/src/com/android/systemui/education/domain/ui/view/ContextualEduDialogTest.kt72
-rw-r--r--packages/SystemUI/multivalentTests/src/com/android/systemui/keyboard/shortcut/ui/ShortcutHelperDialogStarterTest.kt (renamed from packages/SystemUI/multivalentTests/src/com/android/systemui/keyboard/shortcut/ui)79
-rw-r--r--packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/KeyguardUnlockAnimationControllerTest.kt12
-rw-r--r--packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/domain/interactor/KeyguardInteractorTest.kt71
-rw-r--r--packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/domain/interactor/KeyguardTransitionScenariosTest.kt185
-rw-r--r--packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/domain/interactor/LightRevealScrimInteractorTest.kt26
-rw-r--r--packages/SystemUI/multivalentTests/src/com/android/systemui/qs/composefragment/viewmodel/AbstractQSFragmentComposeViewModelTest.kt5
-rw-r--r--packages/SystemUI/multivalentTests/src/com/android/systemui/qs/composefragment/viewmodel/QSFragmentComposeViewModelForceQSTest.kt14
-rw-r--r--packages/SystemUI/multivalentTests/src/com/android/systemui/qs/composefragment/viewmodel/QSFragmentComposeViewModelTest.kt75
-rw-r--r--packages/SystemUI/multivalentTests/src/com/android/systemui/qs/panels/data/repository/QSColumnsRepositoryTest.kt18
-rw-r--r--packages/SystemUI/multivalentTests/src/com/android/systemui/qs/panels/domain/interactor/QSColumnsInteractorTest.kt101
-rw-r--r--packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/modes/domain/interactor/ModesTileDataInteractorTest.kt17
-rw-r--r--packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/modes/ui/ModesTileMapperTest.kt46
-rw-r--r--packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/rotation/ui/mapper/RotationLockTileMapperTest.kt13
-rw-r--r--packages/SystemUI/multivalentTests/src/com/android/systemui/screenshot/data/model/DisplayContentScenarios.kt137
-rw-r--r--packages/SystemUI/multivalentTests/src/com/android/systemui/screenshot/policy/NewRootTaskInfo.kt4
-rw-r--r--packages/SystemUI/multivalentTests/src/com/android/systemui/screenshot/policy/PrivateProfilePolicyTest.kt49
-rw-r--r--packages/SystemUI/multivalentTests/src/com/android/systemui/screenshot/policy/ScreenshotPolicyTest.kt351
-rw-r--r--packages/SystemUI/multivalentTests/src/com/android/systemui/screenshot/policy/WorkProfilePolicyTest.kt75
-rw-r--r--packages/SystemUI/multivalentTests/src/com/android/systemui/shade/NotificationPanelViewControllerBaseTest.java8
-rw-r--r--packages/SystemUI/multivalentTests/src/com/android/systemui/shade/NotificationShadeWindowViewControllerTest.kt5
-rw-r--r--packages/SystemUI/multivalentTests/src/com/android/systemui/shade/NotificationShadeWindowViewTest.kt4
-rw-r--r--packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/KeyguardIndicationControllerBaseTest.java2
-rw-r--r--packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/core/StatusBarInitializerTest.kt26
-rw-r--r--packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/data/repository/StatusBarModeRepositoryImplTest.kt52
-rw-r--r--packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/events/SystemEventChipAnimationControllerTest.kt18
-rw-r--r--packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/collection/coordinator/DreamCoordinatorTest.kt166
-rw-r--r--packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/stack/NotificationSwipeHelperTest.java54
-rw-r--r--packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/phone/StatusBarContentInsetsProviderTest.kt113
-rw-r--r--packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/pipeline/shared/ui/viewmodel/FakeHomeStatusBarViewBinder.kt (renamed from packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/pipeline/shared/ui/viewmodel/FakeCollapsedStatusBarViewBinder.kt)8
-rw-r--r--packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/pipeline/shared/ui/viewmodel/FakeHomeStatusBarViewModel.kt (renamed from packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/pipeline/shared/ui/viewmodel/FakeCollapsedStatusBarViewModel.kt)8
-rw-r--r--packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/pipeline/shared/ui/viewmodel/HomeStatusBarViewModelImplTest.kt (renamed from packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/pipeline/shared/ui/viewmodel/CollapsedStatusBarViewModelImplTest.kt)47
-rw-r--r--packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/policy/ZenModesCleanupStartableTest.kt2
-rw-r--r--packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/window/StatusBarWindowControllerImplTest.kt62
-rw-r--r--packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/window/StatusBarWindowViewTest.kt56
-rw-r--r--packages/SystemUI/multivalentTests/src/com/android/systemui/surfaceeffects/turbulencenoise/TurbulenceNoiseShaderTest.kt14
-rw-r--r--packages/SystemUI/multivalentTests/src/com/android/systemui/unfold/DisplaySwitchLatencyTrackerTest.kt28
-rw-r--r--packages/SystemUI/multivalentTests/src/com/android/systemui/unfold/UnfoldLatencyTrackerTest.kt13
-rw-r--r--packages/SystemUI/multivalentTests/src/com/android/systemui/unfold/util/FoldableTestUtils.kt59
-rw-r--r--packages/SystemUI/multivalentTests/src/com/android/systemui/util/UtilsTest.kt123
-rw-r--r--packages/SystemUI/multivalentTests/src/com/android/systemui/volume/panel/component/volume/domain/interactor/AudioSlidersInteractorTest.kt19
-rw-r--r--packages/SystemUI/res/anim/shortcut_helper_close_anim.xml26
-rw-r--r--packages/SystemUI/res/anim/shortcut_helper_launch_anim.xml27
-rw-r--r--packages/SystemUI/res/drawable/qs_hearing_devices_related_tools_background.xml5
-rw-r--r--packages/SystemUI/res/layout/hearing_devices_tile_dialog.xml17
-rw-r--r--packages/SystemUI/res/layout/hearing_tool_item.xml10
-rw-r--r--packages/SystemUI/res/values-af/strings.xml10
-rw-r--r--packages/SystemUI/res/values-am/strings.xml10
-rw-r--r--packages/SystemUI/res/values-ar/strings.xml10
-rw-r--r--packages/SystemUI/res/values-as/strings.xml10
-rw-r--r--packages/SystemUI/res/values-az/strings.xml10
-rw-r--r--packages/SystemUI/res/values-b+sr+Latn/strings.xml10
-rw-r--r--packages/SystemUI/res/values-be/strings.xml10
-rw-r--r--packages/SystemUI/res/values-bg/strings.xml10
-rw-r--r--packages/SystemUI/res/values-bn/strings.xml49
-rw-r--r--packages/SystemUI/res/values-bs/strings.xml10
-rw-r--r--packages/SystemUI/res/values-ca/strings.xml12
-rw-r--r--packages/SystemUI/res/values-cs/strings.xml14
-rw-r--r--packages/SystemUI/res/values-da/strings.xml10
-rw-r--r--packages/SystemUI/res/values-de/strings.xml49
-rw-r--r--packages/SystemUI/res/values-el/strings.xml10
-rw-r--r--packages/SystemUI/res/values-en-rAU/strings.xml10
-rw-r--r--packages/SystemUI/res/values-en-rCA/strings.xml10
-rw-r--r--packages/SystemUI/res/values-en-rGB/strings.xml10
-rw-r--r--packages/SystemUI/res/values-en-rIN/strings.xml10
-rw-r--r--packages/SystemUI/res/values-es-rUS/strings.xml49
-rw-r--r--packages/SystemUI/res/values-es/strings.xml49
-rw-r--r--packages/SystemUI/res/values-et/strings.xml10
-rw-r--r--packages/SystemUI/res/values-eu/strings.xml10
-rw-r--r--packages/SystemUI/res/values-fa/strings.xml10
-rw-r--r--packages/SystemUI/res/values-fi/strings.xml10
-rw-r--r--packages/SystemUI/res/values-fr-rCA/strings.xml49
-rw-r--r--packages/SystemUI/res/values-fr/strings.xml49
-rw-r--r--packages/SystemUI/res/values-gl/strings.xml10
-rw-r--r--packages/SystemUI/res/values-gu/strings.xml10
-rw-r--r--packages/SystemUI/res/values-hi/strings.xml10
-rw-r--r--packages/SystemUI/res/values-hr/strings.xml10
-rw-r--r--packages/SystemUI/res/values-hu/strings.xml10
-rw-r--r--packages/SystemUI/res/values-hy/strings.xml49
-rw-r--r--packages/SystemUI/res/values-in/strings.xml10
-rw-r--r--packages/SystemUI/res/values-is/strings.xml10
-rw-r--r--packages/SystemUI/res/values-it/strings.xml49
-rw-r--r--packages/SystemUI/res/values-iw/strings.xml12
-rw-r--r--packages/SystemUI/res/values-ja/strings.xml10
-rw-r--r--packages/SystemUI/res/values-ka/strings.xml10
-rw-r--r--packages/SystemUI/res/values-kk/strings.xml10
-rw-r--r--packages/SystemUI/res/values-km/strings.xml10
-rw-r--r--packages/SystemUI/res/values-kn/strings.xml10
-rw-r--r--packages/SystemUI/res/values-ko/strings.xml10
-rw-r--r--packages/SystemUI/res/values-ky/strings.xml10
-rw-r--r--packages/SystemUI/res/values-lo/strings.xml10
-rw-r--r--packages/SystemUI/res/values-lt/strings.xml10
-rw-r--r--packages/SystemUI/res/values-lv/strings.xml10
-rw-r--r--packages/SystemUI/res/values-mk/strings.xml49
-rw-r--r--packages/SystemUI/res/values-ml/strings.xml10
-rw-r--r--packages/SystemUI/res/values-mn/strings.xml49
-rw-r--r--packages/SystemUI/res/values-mr/strings.xml10
-rw-r--r--packages/SystemUI/res/values-ms/strings.xml12
-rw-r--r--packages/SystemUI/res/values-my/strings.xml10
-rw-r--r--packages/SystemUI/res/values-nb/strings.xml10
-rw-r--r--packages/SystemUI/res/values-ne/strings.xml10
-rw-r--r--packages/SystemUI/res/values-night/styles.xml4
-rw-r--r--packages/SystemUI/res/values-nl/strings.xml10
-rw-r--r--packages/SystemUI/res/values-or/strings.xml10
-rw-r--r--packages/SystemUI/res/values-pa/strings.xml10
-rw-r--r--packages/SystemUI/res/values-pl/strings.xml10
-rw-r--r--packages/SystemUI/res/values-pt-rBR/strings.xml10
-rw-r--r--packages/SystemUI/res/values-pt-rPT/strings.xml10
-rw-r--r--packages/SystemUI/res/values-pt/strings.xml10
-rw-r--r--packages/SystemUI/res/values-ro/strings.xml10
-rw-r--r--packages/SystemUI/res/values-ru/strings.xml10
-rw-r--r--packages/SystemUI/res/values-si/strings.xml10
-rw-r--r--packages/SystemUI/res/values-sk/strings.xml10
-rw-r--r--packages/SystemUI/res/values-sl/strings.xml10
-rw-r--r--packages/SystemUI/res/values-sq/strings.xml49
-rw-r--r--packages/SystemUI/res/values-sr/strings.xml10
-rw-r--r--packages/SystemUI/res/values-sv/strings.xml10
-rw-r--r--packages/SystemUI/res/values-sw/strings.xml10
-rw-r--r--packages/SystemUI/res/values-ta/strings.xml49
-rw-r--r--packages/SystemUI/res/values-te/strings.xml10
-rw-r--r--packages/SystemUI/res/values-th/strings.xml10
-rw-r--r--packages/SystemUI/res/values-tl/strings.xml10
-rw-r--r--packages/SystemUI/res/values-tr/strings.xml49
-rw-r--r--packages/SystemUI/res/values-uk/strings.xml49
-rw-r--r--packages/SystemUI/res/values-ur/strings.xml10
-rw-r--r--packages/SystemUI/res/values-uz/strings.xml10
-rw-r--r--packages/SystemUI/res/values-vi/strings.xml10
-rw-r--r--packages/SystemUI/res/values-zh-rCN/strings.xml10
-rw-r--r--packages/SystemUI/res/values-zh-rHK/strings.xml10
-rw-r--r--packages/SystemUI/res/values-zh-rTW/strings.xml10
-rw-r--r--packages/SystemUI/res/values-zu/strings.xml10
-rw-r--r--packages/SystemUI/res/values/config.xml21
-rw-r--r--packages/SystemUI/res/values/dimens.xml2
-rw-r--r--packages/SystemUI/res/values/styles.xml28
-rw-r--r--packages/SystemUI/shared/src/com/android/systemui/shared/plugins/PluginManagerImpl.java8
-rw-r--r--packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java33
-rw-r--r--packages/SystemUI/src/com/android/systemui/CameraProtectionLoader.kt18
-rw-r--r--packages/SystemUI/src/com/android/systemui/CameraProtectionModule.kt15
-rw-r--r--packages/SystemUI/src/com/android/systemui/ScreenDecorationsModule.kt16
-rw-r--r--packages/SystemUI/src/com/android/systemui/SysUICutoutProvider.kt43
-rw-r--r--packages/SystemUI/src/com/android/systemui/accessibility/hearingaid/HearingDevicesDialogDelegate.java19
-rw-r--r--packages/SystemUI/src/com/android/systemui/accessibility/hearingaid/HearingDevicesToolItemParser.java5
-rw-r--r--packages/SystemUI/src/com/android/systemui/accessibility/hearingaid/ToolItem.kt1
-rw-r--r--packages/SystemUI/src/com/android/systemui/bouncer/domain/interactor/BouncerActionButtonInteractor.kt2
-rw-r--r--packages/SystemUI/src/com/android/systemui/bouncer/ui/binder/BouncerViewBinder.kt12
-rw-r--r--packages/SystemUI/src/com/android/systemui/bouncer/ui/binder/ComposeBouncerViewBinder.kt36
-rw-r--r--packages/SystemUI/src/com/android/systemui/bouncer/ui/viewmodel/BouncerContainerViewModel.kt22
-rw-r--r--packages/SystemUI/src/com/android/systemui/bouncer/ui/viewmodel/BouncerSceneContentViewModel.kt6
-rw-r--r--packages/SystemUI/src/com/android/systemui/classifier/FalsingModule.java12
-rw-r--r--packages/SystemUI/src/com/android/systemui/communal/ui/viewmodel/ResizeableItemFrameViewModel.kt107
-rw-r--r--packages/SystemUI/src/com/android/systemui/dagger/ReferenceSystemUIModule.java2
-rw-r--r--packages/SystemUI/src/com/android/systemui/dagger/SystemUICoreStartableModule.kt6
-rw-r--r--packages/SystemUI/src/com/android/systemui/dagger/SystemUIModule.java4
-rw-r--r--packages/SystemUI/src/com/android/systemui/decor/CutoutDecorProviderFactory.kt11
-rw-r--r--packages/SystemUI/src/com/android/systemui/decor/DecorProviderFactory.kt8
-rw-r--r--packages/SystemUI/src/com/android/systemui/decor/FaceScanningProviderFactory.kt177
-rw-r--r--packages/SystemUI/src/com/android/systemui/decor/PrivacyDotDecorProviderFactory.kt29
-rw-r--r--packages/SystemUI/src/com/android/systemui/decor/RoundedCornerDecorProviderFactory.kt123
-rw-r--r--packages/SystemUI/src/com/android/systemui/display/data/repository/DeviceStateRepository.kt55
-rw-r--r--packages/SystemUI/src/com/android/systemui/display/data/repository/PerDisplayStore.kt108
-rw-r--r--packages/SystemUI/src/com/android/systemui/education/dagger/ContextualEducationModule.kt21
-rw-r--r--packages/SystemUI/src/com/android/systemui/education/domain/interactor/KeyboardTouchpadEduInteractor.kt85
-rw-r--r--packages/SystemUI/src/com/android/systemui/education/domain/interactor/KeyboardTouchpadEduStatsInteractor.kt111
-rw-r--r--packages/SystemUI/src/com/android/systemui/education/ui/view/ContextualEduDialog.kt30
-rw-r--r--packages/SystemUI/src/com/android/systemui/education/ui/view/ContextualEduUiCoordinator.kt4
-rw-r--r--packages/SystemUI/src/com/android/systemui/inputdevice/tutorial/ui/composable/ActionTutorialContent.kt133
-rw-r--r--packages/SystemUI/src/com/android/systemui/inputdevice/tutorial/ui/composable/LottieHelpers.kt41
-rw-r--r--packages/SystemUI/src/com/android/systemui/inputdevice/tutorial/ui/composable/TutorialAnimation.kt149
-rw-r--r--packages/SystemUI/src/com/android/systemui/keyboard/shortcut/ShortcutHelperModule.kt13
-rw-r--r--packages/SystemUI/src/com/android/systemui/keyboard/shortcut/ui/ShortcutHelperActivityStarter.kt66
-rw-r--r--packages/SystemUI/src/com/android/systemui/keyboard/shortcut/ui/ShortcutHelperDialogStarter.kt102
-rw-r--r--packages/SystemUI/src/com/android/systemui/keyboard/shortcut/ui/composable/ShortcutHelperUtils.kt22
-rw-r--r--packages/SystemUI/src/com/android/systemui/keyboard/shortcut/ui/view/ShortcutHelperActivity.kt184
-rw-r--r--packages/SystemUI/src/com/android/systemui/keyguard/KeyguardUnlockAnimationController.kt12
-rw-r--r--packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewConfigurator.kt16
-rw-r--r--packages/SystemUI/src/com/android/systemui/keyguard/data/repository/LightRevealScrimRepository.kt7
-rw-r--r--packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/FromDreamingLockscreenHostedTransitionInteractor.kt138
-rw-r--r--packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/FromGoneTransitionInteractor.kt22
-rw-r--r--packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/FromLockscreenTransitionInteractor.kt13
-rw-r--r--packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/FromPrimaryBouncerTransitionInteractor.kt26
-rw-r--r--packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/KeyguardInteractor.kt39
-rw-r--r--packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/KeyguardTransitionCoreStartable.kt1
-rw-r--r--packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/LightRevealScrimInteractor.kt53
-rw-r--r--packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/StartKeyguardTransitionModule.kt6
-rw-r--r--packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/LightRevealScrimViewBinder.kt32
-rw-r--r--packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/DreamingHostedToLockscreenTransitionViewModel.kt48
-rw-r--r--packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/GoneToDreamingLockscreenHostedTransitionViewModel.kt57
-rw-r--r--packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/KeyguardQuickAffordancesCombinedViewModel.kt18
-rw-r--r--packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/LightRevealScrimViewModel.kt9
-rw-r--r--packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/LockscreenToDreamingHostedTransitionViewModel.kt49
-rw-r--r--packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputAdapter.java24
-rw-r--r--packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputBaseAdapter.java59
-rw-r--r--packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBarControllerImpl.java17
-rw-r--r--packages/SystemUI/src/com/android/systemui/qs/QSTileIcon.kt11
-rw-r--r--packages/SystemUI/src/com/android/systemui/qs/composefragment/QSFragmentCompose.kt101
-rw-r--r--packages/SystemUI/src/com/android/systemui/qs/composefragment/viewmodel/QSFragmentComposeViewModel.kt483
-rw-r--r--packages/SystemUI/src/com/android/systemui/qs/panels/data/repository/QSColumnsRepository.kt31
-rw-r--r--packages/SystemUI/src/com/android/systemui/qs/panels/domain/interactor/QSColumnsInteractor.kt28
-rw-r--r--packages/SystemUI/src/com/android/systemui/qs/tiles/ModesTile.kt2
-rw-r--r--packages/SystemUI/src/com/android/systemui/qs/tiles/impl/modes/domain/interactor/ModesTileDataInteractor.kt6
-rw-r--r--packages/SystemUI/src/com/android/systemui/qs/tiles/impl/modes/domain/model/ModesTileModel.kt4
-rw-r--r--packages/SystemUI/src/com/android/systemui/qs/tiles/impl/modes/ui/ModesTileMapper.kt35
-rw-r--r--packages/SystemUI/src/com/android/systemui/qs/tiles/impl/rotation/ui/mapper/RotationLockTileMapper.kt12
-rw-r--r--packages/SystemUI/src/com/android/systemui/reardisplay/RearDisplayDialogController.java47
-rw-r--r--packages/SystemUI/src/com/android/systemui/recents/OverviewProxyService.java34
-rw-r--r--packages/SystemUI/src/com/android/systemui/screenshot/ScreenshotActionsProvider.kt25
-rw-r--r--packages/SystemUI/src/com/android/systemui/screenshot/policy/CaptureType.kt8
-rw-r--r--packages/SystemUI/src/com/android/systemui/screenshot/policy/PolicyRequestProcessor.kt26
-rw-r--r--packages/SystemUI/src/com/android/systemui/screenshot/policy/RootTaskInfoExt.kt4
-rw-r--r--packages/SystemUI/src/com/android/systemui/screenshot/policy/ScreenshotPolicy.kt155
-rw-r--r--packages/SystemUI/src/com/android/systemui/screenshot/policy/ScreenshotPolicyModule.kt5
-rw-r--r--packages/SystemUI/src/com/android/systemui/screenshot/policy/WorkProfilePolicy.kt15
-rw-r--r--packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java62
-rw-r--r--packages/SystemUI/src/com/android/systemui/shade/NotificationShadeWindowViewController.java13
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java22
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/NotificationShadeDepthController.kt304
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/core/StatusBarInitializer.kt57
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/core/StatusBarInitializerStore.kt70
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/core/StatusBarOrchestrator.kt4
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/dagger/StatusBarModule.kt28
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/data/StatusBarDataLayerModule.kt4
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/data/repository/StatusBarConfigurationControllerStore.kt117
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/data/repository/StatusBarModePerDisplayRepository.kt11
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/data/repository/StatusBarModeRepositoryStore.kt4
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/events/StatusBarEventsModule.kt4
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/events/SystemEventChipAnimationController.kt412
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/coordinator/DreamCoordinator.kt91
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/coordinator/NotifCoordinators.kt13
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java79
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutController.java11
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationSwipeHelper.java12
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ScrollViewFields.kt27
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/data/repository/NotificationPlaceholderRepository.kt13
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/domain/interactor/NotificationStackAppearanceInteractor.kt27
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/shared/model/AccessibilityScrollEvent.kt26
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/shared/model/ShadeScrollState.kt38
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ui/view/NotificationScrollView.kt12
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ui/viewbinder/NotificationScrollViewBinder.kt20
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/NotificationScrollViewModel.kt14
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/NotificationsPlaceholderViewModel.kt14
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java24
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/ConfigurationControllerImpl.kt3
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/FoldStateListener.kt16
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/HeadsUpAppearanceController.java6
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/LegacyLightsOutNotifController.java6
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java90
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimState.java19
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarBoundsProvider.kt12
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarContentInsetsProvider.kt179
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarDemoMode.java6
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/fragment/CollapsedStatusBarFragment.java50
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/fragment/CollapsedStatusBarFragmentStartable.kt6
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/fragment/dagger/HomeStatusBarComponent.java (renamed from packages/SystemUI/src/com/android/systemui/statusbar/phone/fragment/dagger/StatusBarFragmentComponent.java)30
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/fragment/dagger/HomeStatusBarModule.java (renamed from packages/SystemUI/src/com/android/systemui/statusbar/phone/fragment/dagger/StatusBarFragmentModule.java)47
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/fragment/dagger/HomeStatusBarScope.java (renamed from packages/SystemUI/src/com/android/systemui/statusbar/phone/fragment/dagger/StatusBarFragmentScope.java)4
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/fragment/dagger/StatusBarStartablesModule.kt2
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/pipeline/dagger/StatusBarPipelineModule.kt18
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/pipeline/shared/ui/binder/HomeStatusBarViewBinder.kt (renamed from packages/SystemUI/src/com/android/systemui/statusbar/pipeline/shared/ui/binder/CollapsedStatusBarViewBinder.kt)24
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/pipeline/shared/ui/composable/RetroText.kt66
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/pipeline/shared/ui/composable/StatusBarRoot.kt193
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/pipeline/shared/ui/viewmodel/HomeStatusBarViewModel.kt (renamed from packages/SystemUI/src/com/android/systemui/statusbar/pipeline/shared/ui/viewmodel/CollapsedStatusBarViewModel.kt)45
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/window/StatusBarWindowController.kt2
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/window/StatusBarWindowControllerImpl.java14
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/window/StatusBarWindowControllerStore.kt81
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/window/StatusBarWindowView.java50
-rw-r--r--packages/SystemUI/src/com/android/systemui/touchpad/tutorial/ui/composable/BackGestureTutorialScreen.kt21
-rw-r--r--packages/SystemUI/src/com/android/systemui/touchpad/tutorial/ui/composable/GestureTutorialScreen.kt42
-rw-r--r--packages/SystemUI/src/com/android/systemui/touchpad/tutorial/ui/composable/HomeGestureTutorialScreen.kt21
-rw-r--r--packages/SystemUI/src/com/android/systemui/touchpad/tutorial/ui/composable/RecentAppsGestureTutorialScreen.kt34
-rw-r--r--packages/SystemUI/src/com/android/systemui/touchpad/tutorial/ui/composable/TutorialSelectionScreen.kt14
-rw-r--r--packages/SystemUI/src/com/android/systemui/unfold/DisplaySwitchLatencyTracker.kt6
-rw-r--r--packages/SystemUI/src/com/android/systemui/unfold/UnfoldLatencyTracker.kt9
-rw-r--r--packages/SystemUI/src/com/android/systemui/unfold/UnfoldTraceLogger.kt11
-rw-r--r--packages/SystemUI/src/com/android/systemui/util/Utils.java26
-rw-r--r--packages/SystemUI/src/com/android/systemui/volume/dagger/AudioModule.kt8
-rw-r--r--packages/SystemUI/src/com/android/systemui/volume/panel/component/volume/domain/interactor/AudioSlidersInteractor.kt13
-rw-r--r--packages/SystemUI/src/com/android/systemui/volume/ui/navigation/VolumeNavigator.kt6
-rw-r--r--packages/SystemUI/src/com/android/systemui/wallpapers/data/repository/WallpaperRepository.kt14
-rw-r--r--packages/SystemUI/src/com/android/systemui/wallpapers/domain/interactor/WallpaperInteractor.kt4
-rw-r--r--packages/SystemUI/src/com/android/systemui/wallpapers/ui/viewmodel/WallpaperViewModel.kt25
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/CameraProtectionLoaderImplTest.kt8
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/FaceScanningProviderFactoryTest.kt9
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/SysUICutoutProviderTest.kt46
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/bouncer/ui/composable/BouncerContentTest.kt16
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/keyguard/ui/viewmodel/KeyguardQuickAffordancesCombinedViewModelTest.kt30
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/media/dialog/MediaOutputAdapterTest.java67
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/navigationbar/NavigationBarControllerImplTest.java6
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/reardisplay/RearDisplayDialogControllerTest.java45
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/recents/OverviewProxyServiceTest.kt5
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/screenshot/DefaultScreenshotActionsProviderTest.kt46
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/screenshot/policy/PolicyRequestProcessorTest.kt116
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/KeyguardIndicationControllerWithCoroutinesTest.kt34
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/core/MultiDisplayStatusBarInitializerStoreTest.kt97
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/events/SystemStatusAnimationSchedulerImplTest.kt28
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/CentralSurfacesImplTest.java62
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/FoldStateListenerTest.kt28
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/ScrimControllerTest.java139
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/fragment/CollapsedStatusBarFragmentTest.java24
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/DeviceStateRotationLockSettingControllerTest.java87
-rw-r--r--packages/SystemUI/tests/utils/src/com/android/systemui/DeviceStateManagerKosmos.kt133
-rw-r--r--packages/SystemUI/tests/utils/src/com/android/systemui/display/data/repository/PerDisplayStoreKosmos.kt49
-rw-r--r--packages/SystemUI/tests/utils/src/com/android/systemui/education/domain/interactor/KeyboardTouchpadEduInteractorKosmos.kt25
-rw-r--r--packages/SystemUI/tests/utils/src/com/android/systemui/fragments/FragmentServiceKosmos.kt (renamed from packages/SystemUI/tests/utils/src/com/android/systemui/keyboard/shortcut/FakeShortcutHelperStartActivity.kt)14
-rw-r--r--packages/SystemUI/tests/utils/src/com/android/systemui/keyboard/shortcut/KeyboardShortcutHelperKosmos.kt26
-rw-r--r--packages/SystemUI/tests/utils/src/com/android/systemui/keyguard/data/repository/FakeLightRevealScrimRepository.kt7
-rw-r--r--packages/SystemUI/tests/utils/src/com/android/systemui/keyguard/domain/interactor/FromDreamingLockscreenHostedTransitionInteractorKosmos.kt39
-rw-r--r--packages/SystemUI/tests/utils/src/com/android/systemui/qs/composefragment/viewmodel/QSFragmentComposeViewModelKosmos.kt4
-rw-r--r--packages/SystemUI/tests/utils/src/com/android/systemui/qs/panels/data/repository/QSColumnsRepositoryKosmos.kt7
-rw-r--r--packages/SystemUI/tests/utils/src/com/android/systemui/qs/panels/domain/interactor/QSColumnsInteractorKosmos.kt7
-rw-r--r--packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/core/StatusBarInitializerKosmos.kt2
-rw-r--r--packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/phone/StatusBarContentInsetsProviderKosmos.kt25
-rw-r--r--packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/pipeline/shared/ui/viewmodel/HomeStatusBarViewModelKosmos.kt (renamed from packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/pipeline/shared/ui/viewmodel/CollapsedStatusBarViewModelKosmos.kt)6
-rw-r--r--packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/policy/ConfigurationControllerKosmos.kt3
-rw-r--r--packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/policy/FakeConfigurationController.kt5
-rw-r--r--packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/window/FakeStatusBarWindowControllerFactory.kt2
-rw-r--r--packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/window/FakeStatusBarWindowViewInflater.kt29
-rw-r--r--packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/window/StatusBarWindowControllerKosmos.kt21
-rw-r--r--packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/window/StatusBarWindowViewKosmos.kt24
-rw-r--r--packages/SystemUI/tests/utils/src/com/android/systemui/volume/data/repository/AudioSystemRepositoryKosmos.kt21
-rw-r--r--packages/SystemUI/tests/utils/src/com/android/systemui/volume/data/repository/FakeAudioSystemRepository.kt28
-rw-r--r--packages/SystemUI/tests/utils/src/com/android/systemui/volume/panel/component/volume/domain/interactor/AudioSlidersInteractorKosmos.kt2
-rw-r--r--ravenwood/Android.bp4
-rw-r--r--ravenwood/Framework.bp54
-rw-r--r--ravenwood/junit-impl-src/android/platform/test/ravenwood/RavenwoodRuntimeEnvironmentController.java22
-rw-r--r--ravenwood/runtime-helper-src/framework/android/provider/DeviceConfig_host.java33
-rw-r--r--ravenwood/runtime-helper-src/framework/android/provider/RavenwoodConfigDataStore.java253
-rw-r--r--services/accessibility/OWNERS3
-rw-r--r--services/accessibility/accessibility.aconfig10
-rw-r--r--services/accessibility/java/com/android/server/accessibility/AbstractAccessibilityServiceConnection.java78
-rw-r--r--services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java15
-rw-r--r--services/appfunctions/java/com/android/server/appfunctions/AppFunctionExecutors.java3
-rw-r--r--services/appfunctions/java/com/android/server/appfunctions/MetadataSyncAdapter.java4
-rw-r--r--services/appfunctions/java/com/android/server/appfunctions/NamedThreadFactory.java40
-rw-r--r--services/companion/java/com/android/server/companion/transport/CompanionTransportManager.java29
-rw-r--r--services/companion/java/com/android/server/companion/transport/Transport.java32
-rw-r--r--services/core/java/com/android/server/am/ActivityManagerService.java53
-rw-r--r--services/core/java/com/android/server/am/ActivityManagerShellCommand.java14
-rw-r--r--services/core/java/com/android/server/am/BatteryStatsService.java53
-rw-r--r--services/core/java/com/android/server/am/BroadcastController.java1
-rw-r--r--services/core/java/com/android/server/am/ContentProviderConnection.java18
-rw-r--r--services/core/java/com/android/server/am/OomAdjuster.java4
-rw-r--r--services/core/java/com/android/server/am/ProcessList.java1
-rw-r--r--services/core/java/com/android/server/am/SettingsToPropertiesMapper.java1
-rw-r--r--services/core/java/com/android/server/biometrics/sensors/AuthenticationClient.java2
-rw-r--r--services/core/java/com/android/server/content/OWNERS4
-rw-r--r--services/core/java/com/android/server/display/color/ColorDisplayService.java2
-rw-r--r--services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java477
-rw-r--r--services/core/java/com/android/server/media/projection/MediaProjectionManagerService.java14
-rw-r--r--services/core/java/com/android/server/net/OWNERS2
-rw-r--r--services/core/java/com/android/server/notification/GroupHelper.java11
-rw-r--r--services/core/java/com/android/server/notification/ManagedServices.java66
-rw-r--r--services/core/java/com/android/server/notification/NotificationManagerService.java5
-rw-r--r--services/core/java/com/android/server/notification/NotificationShellCmd.java8
-rw-r--r--services/core/java/com/android/server/notification/flags.aconfig10
-rw-r--r--services/core/java/com/android/server/pm/BroadcastHelper.java95
-rw-r--r--services/core/java/com/android/server/pm/PackageInstallerService.java40
-rw-r--r--services/core/java/com/android/server/pm/PackageInstallerSession.java251
-rw-r--r--services/core/java/com/android/server/pm/PackageManagerService.java25
-rw-r--r--services/core/java/com/android/server/pm/PackageManagerShellCommand.java4
-rw-r--r--services/core/java/com/android/server/pm/UserManagerService.java43
-rw-r--r--services/core/java/com/android/server/pm/verify/pkg/VerificationStatusTracker.java12
-rw-r--r--services/core/java/com/android/server/pm/verify/pkg/VerifierController.java95
-rw-r--r--services/core/java/com/android/server/power/stats/BatteryExternalStatsWorker.java187
-rw-r--r--services/core/java/com/android/server/power/stats/BatteryStatsImpl.java53
-rw-r--r--services/core/java/com/android/server/power/stats/BatteryUsageStatsProvider.java271
-rw-r--r--services/core/java/com/android/server/power/stats/PowerStatsSpan.java35
-rw-r--r--services/core/java/com/android/server/power/stats/PowerStatsStore.java23
-rw-r--r--services/core/java/com/android/server/power/stats/WakelockStatsFrameworkEvents.java77
-rw-r--r--services/core/java/com/android/server/power/stats/format/BinaryStatePowerStatsLayout.java2
-rw-r--r--services/core/java/com/android/server/power/stats/processor/PowerStatsExporter.java23
-rw-r--r--services/core/java/com/android/server/security/advancedprotection/AdvancedProtectionService.java247
-rw-r--r--services/core/java/com/android/server/security/advancedprotection/AdvancedProtectionShellCommand.java82
-rw-r--r--services/core/java/com/android/server/security/advancedprotection/OWNERS1
-rw-r--r--services/core/java/com/android/server/security/forensic/ForensicService.java294
-rw-r--r--services/core/java/com/android/server/stats/bootstrap/StatsBootstrapAtomService.java36
-rw-r--r--services/core/java/com/android/server/vcn/VcnContext.java4
-rw-r--r--services/core/java/com/android/server/vcn/VcnGatewayConnection.java1
-rw-r--r--services/core/java/com/android/server/vcn/routeselection/NetworkMetricMonitor.java6
-rw-r--r--services/core/java/com/android/server/vcn/routeselection/UnderlyingNetworkController.java15
-rw-r--r--services/core/java/com/android/server/vcn/routeselection/UnderlyingNetworkEvaluator.java3
-rw-r--r--services/core/java/com/android/server/wallpaper/WallpaperManagerService.java2
-rw-r--r--services/core/java/com/android/server/wm/ActivityTaskManagerService.java2
-rw-r--r--services/core/java/com/android/server/wm/BackNavigationController.java6
-rw-r--r--services/core/java/com/android/server/wm/InputManagerCallback.java4
-rw-r--r--services/core/java/com/android/server/wm/InsetsSourceProvider.java3
-rw-r--r--services/core/java/com/android/server/wm/ScreenRotationAnimation.java32
-rw-r--r--services/core/java/com/android/server/wm/Task.java4
-rw-r--r--services/core/java/com/android/server/wm/WindowProcessController.java7
-rw-r--r--services/core/java/com/android/server/wm/WindowTracingPerfetto.java12
-rw-r--r--services/java/com/android/server/SystemServer.java34
-rw-r--r--services/java/com/android/server/flags.aconfig8
-rw-r--r--services/tests/PackageManagerServiceTests/server/src/com/android/server/pm/PackageInstallerSessionTest.kt16
-rw-r--r--services/tests/PackageManagerServiceTests/server/src/com/android/server/pm/verify/pkg/VerificationStatusTrackerTest.java2
-rw-r--r--services/tests/PackageManagerServiceTests/server/src/com/android/server/pm/verify/pkg/VerifierControllerTest.java117
-rw-r--r--services/tests/mockingservicestests/src/com/android/server/alarm/OWNERS2
-rw-r--r--services/tests/mockingservicestests/src/com/android/server/am/MockingOomAdjusterTests.java2
-rw-r--r--services/tests/mockingservicestests/src/com/android/server/job/OWNERS2
-rw-r--r--services/tests/mockingservicestests/src/com/android/server/pm/DistractingPackageHelperTest.kt3
-rw-r--r--services/tests/mockingservicestests/src/com/android/server/pm/StagingManagerTest.java3
-rw-r--r--services/tests/powerstatstests/Android.bp7
-rw-r--r--services/tests/powerstatstests/src/com/android/server/power/stats/BatteryExternalStatsWorkerTest.java13
-rw-r--r--services/tests/powerstatstests/src/com/android/server/power/stats/BatteryStatsHistoryIteratorTest.java4
-rw-r--r--services/tests/powerstatstests/src/com/android/server/power/stats/BatteryStatsHistoryTest.java38
-rw-r--r--services/tests/powerstatstests/src/com/android/server/power/stats/BatteryStatsImplTest.java2
-rw-r--r--services/tests/powerstatstests/src/com/android/server/power/stats/BatteryStatsUserLifecycleTests.java2
-rw-r--r--services/tests/powerstatstests/src/com/android/server/power/stats/BatteryUsageStatsProviderTest.java96
-rw-r--r--services/tests/powerstatstests/src/com/android/server/power/stats/MockBatteryStatsImpl.java19
-rw-r--r--services/tests/powerstatstests/src/com/android/server/power/stats/WakelockPowerStatsCollectorTest.java11
-rw-r--r--services/tests/powerstatstests/src/com/android/server/power/stats/WakelockStatsFrameworkEventsTest.java422
-rw-r--r--services/tests/security/forensic/Android.bp41
-rw-r--r--services/tests/security/forensic/AndroidManifest.xml (renamed from core/java/android/service/wallpaper/AndroidManifest.xml)13
-rw-r--r--services/tests/security/forensic/AndroidTest.xml32
-rw-r--r--services/tests/security/forensic/TEST_MAPPING7
-rw-r--r--services/tests/security/forensic/src/com/android/server/security/forensic/ForensicServiceTest.java387
-rw-r--r--services/tests/servicestests/src/com/android/server/OWNERS2
-rw-r--r--services/tests/servicestests/src/com/android/server/am/BatteryStatsServiceTest.java1
-rw-r--r--services/tests/servicestests/src/com/android/server/integrity/AppIntegrityManagerServiceImplTest.java5
-rw-r--r--services/tests/servicestests/src/com/android/server/media/projection/MediaProjectionManagerServiceTest.java48
-rw-r--r--services/tests/servicestests/src/com/android/server/pm/UserManagerTest.java73
-rw-r--r--services/tests/servicestests/src/com/android/server/security/advancedprotection/AdvancedProtectionServiceTest.java93
-rw-r--r--services/tests/servicestests/src/com/android/server/usage/AppStandbyControllerTests.java35
-rw-r--r--services/tests/uiservicestests/src/com/android/server/notification/ManagedServicesTest.java298
-rw-r--r--services/tests/uiservicestests/src/com/android/server/notification/NotificationAssistantsTest.java10
-rw-r--r--services/tests/wmtests/src/com/android/server/wm/InsetsSourceProviderTest.java22
-rw-r--r--services/usage/OWNERS1
-rw-r--r--tests/BootImageProfileTest/Android.bp1
-rw-r--r--tests/FlickerTests/test-apps/app-helpers/src/com/android/server/wm/flicker/helpers/DesktopModeAppHelper.kt5
-rw-r--r--tests/FlickerTests/test-apps/app-helpers/src/com/android/server/wm/flicker/helpers/LetterboxAppHelper.kt2
-rw-r--r--tests/JobSchedulerPerfTests/OWNERS2
-rw-r--r--tests/JobSchedulerTestApp/OWNERS2
-rw-r--r--tests/Tracing/src/com/android/internal/protolog/ProtoLogViewerConfigReaderTest.java8
-rw-r--r--tests/vcn/java/com/android/server/vcn/VcnGatewayConnectionTestBase.java1
-rw-r--r--tests/vcn/java/com/android/server/vcn/routeselection/NetworkEvaluationTestBase.java1
-rw-r--r--tests/vcn/java/com/android/server/vcn/routeselection/UnderlyingNetworkControllerTest.java1
846 files changed, 17913 insertions, 9381 deletions
diff --git a/AconfigFlags.bp b/AconfigFlags.bp
index 0080a8d63bfc..1ae9ada41338 100644
--- a/AconfigFlags.bp
+++ b/AconfigFlags.bp
@@ -110,6 +110,7 @@ aconfig_declarations_group {
"hwui_flags_java_lib",
"interaction_jank_monitor_flags_lib",
"libcore_exported_aconfig_flags_lib",
+ "libcore_readonly_aconfig_flags_lib",
"libgui_flags_java_lib",
"power_flags_lib",
"sdk_sandbox_flags_lib",
@@ -169,6 +170,26 @@ java_aconfig_library {
defaults: ["framework-minus-apex-aconfig-java-defaults"],
}
+// See b/368409430 - This is for libcore flags to be generated with
+// force-read-only mode, so access to the flags does not involve I/O,
+// which could break Isolated Processes with I/O permission disabled.
+// The issue will be addressed once new Aconfig storage API is landed
+// and the readonly version will be removed.
+aconfig_declarations {
+ name: "libcore-readonly-aconfig-flags",
+ package: "com.android.libcore.readonly",
+ container: "system",
+ srcs: ["libcore-readonly.aconfig"],
+}
+
+// Core Libraries / libcore
+java_aconfig_library {
+ name: "libcore_readonly_aconfig_flags_lib",
+ aconfig_declarations: "libcore-readonly-aconfig-flags",
+ mode: "force-read-only",
+ defaults: ["framework-minus-apex-aconfig-java-defaults"],
+}
+
// Telecom
java_aconfig_library {
name: "telecom_flags_core_java_lib",
diff --git a/MULTIUSER_OWNERS b/MULTIUSER_OWNERS
index b8857ecd0a93..1738a35c6925 100644
--- a/MULTIUSER_OWNERS
+++ b/MULTIUSER_OWNERS
@@ -3,7 +3,5 @@ annabauza@google.com
bookatz@google.com
nykkumar@google.com
olilan@google.com
-omakoto@google.com
tetianameronyk@google.com
tyk@google.com
-yamasani@google.com
diff --git a/OWNERS b/OWNERS
index afa60bea5aa0..eb2bfcfdf82d 100644
--- a/OWNERS
+++ b/OWNERS
@@ -7,8 +7,6 @@ dsandler@google.com #{LAST_RESORT_SUGGESTION}
hackbod@android.com #{LAST_RESORT_SUGGESTION}
hackbod@google.com #{LAST_RESORT_SUGGESTION}
jjaggi@google.com #{LAST_RESORT_SUGGESTION}
-jsharkey@android.com #{LAST_RESORT_SUGGESTION}
-jsharkey@google.com #{LAST_RESORT_SUGGESTION}
lorenzo@google.com #{LAST_RESORT_SUGGESTION}
michaelwr@google.com #{LAST_RESORT_SUGGESTION}
nandana@google.com #{LAST_RESORT_SUGGESTION}
@@ -33,19 +31,19 @@ per-file **.bp,**.mk =joeo@google.com, lamontjones@google.com
per-file TestProtoLibraries.bp = file:platform/platform_testing:/libraries/health/OWNERS
per-file TestProtoLibraries.bp = file:platform/tools/tradefederation:/OWNERS
-per-file INPUT_OWNERS = file:/INPUT_OWNERS
-per-file ZYGOTE_OWNERS = file:/ZYGOTE_OWNERS
-per-file SQLITE_OWNERS = file:/SQLITE_OWNERS
-
per-file *ravenwood* = file:ravenwood/OWNERS
per-file *Ravenwood* = file:ravenwood/OWNERS
+per-file INPUT_OWNERS = file:/INPUT_OWNERS
+per-file ZYGOTE_OWNERS = file:/ZYGOTE_OWNERS
+per-file SQLITE_OWNERS = file:/SQLITE_OWNERS
per-file PERFORMANCE_OWNERS = file:/PERFORMANCE_OWNERS
-
per-file PACKAGE_MANAGER_OWNERS = file:/PACKAGE_MANAGER_OWNERS
-
per-file WEAR_OWNERS = file:/WEAR_OWNERS
-
+per-file ACTIVITY_MANAGER_OWNERS = file:/ACTIVITY_MANAGER_OWNERS
+per-file BATTERY_STATS_OWNERS = file:/BATTERY_STATS_OWNERS
+per-file OOM_ADJUSTER_OWNERS = file:/OOM_ADJUSTER_OWNERS
+per-file MULTIUSER_OWNERS = file:/MULTIUSER_OWNERS
+per-file BROADCASTS_OWNERS = file:/BROADCASTS_OWNERS
per-file ADPF_OWNERS = file:/ADPF_OWNERS
-
per-file GAME_MANAGER_OWNERS = file:/GAME_MANAGER_OWNERS
diff --git a/apct-tests/perftests/core/src/android/os/MessageQueuePerfTest.java b/apct-tests/perftests/core/src/android/os/MessageQueuePerfTest.java
new file mode 100644
index 000000000000..b14de836fa78
--- /dev/null
+++ b/apct-tests/perftests/core/src/android/os/MessageQueuePerfTest.java
@@ -0,0 +1,213 @@
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.os;
+
+import android.app.Activity;
+import android.app.Instrumentation;
+import android.os.Handler;
+import android.os.HandlerThread;
+import android.os.Looper;
+import android.os.Message;
+import android.os.SystemClock;
+import android.perftests.utils.Stats;
+import android.util.Log;
+
+import androidx.test.InstrumentationRegistry;
+import androidx.test.filters.LargeTest;
+import androidx.test.runner.AndroidJUnit4;
+
+import java.util.ArrayList;
+import java.util.concurrent.CountDownLatch;
+import java.util.Random;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+/**
+ * Performance tests for {@link MessageQueue}.
+ */
+@RunWith(AndroidJUnit4.class)
+@LargeTest
+public class MessageQueuePerfTest {
+ static final String TAG = "MessageQueuePerfTest";
+ private static final int PER_THREAD_MESSAGE_COUNT = 1000;
+ private static final int THREAD_COUNT = 8;
+ private static final int TOTAL_MESSAGE_COUNT = PER_THREAD_MESSAGE_COUNT * THREAD_COUNT;
+
+ static Object sLock = new Object();
+ private ArrayList<Long> mResults;
+
+ @Before
+ public void setUp() { }
+
+ @After
+ public void tearDown() { }
+
+ class EnqueueThread extends Thread {
+ CountDownLatch mStartLatch;
+ CountDownLatch mEndLatch;
+ Handler mHandler;
+ int mMessageStartIdx;
+ Message[] mMessages;
+ long[] mDelays;
+
+ EnqueueThread(CountDownLatch startLatch, CountDownLatch endLatch, Handler handler,
+ int startIdx, Message[] messages, long[] delays) {
+ super();
+ mStartLatch = startLatch;
+ mEndLatch = endLatch;
+ mHandler = handler;
+ mMessageStartIdx = startIdx;
+ mMessages = messages;
+ mDelays = delays;
+ }
+
+ @Override
+ public void run() {
+ Log.d(TAG, "Enqueue thread started at message index " + mMessageStartIdx);
+ try {
+ mStartLatch.await();
+ } catch (InterruptedException e) {
+
+ }
+ long now = SystemClock.uptimeMillis();
+ long startTimeNS = SystemClock.elapsedRealtimeNanos();
+ for (int i = mMessageStartIdx; i < (mMessageStartIdx + PER_THREAD_MESSAGE_COUNT); i++) {
+ if (mDelays[i] == 0) {
+ mHandler.sendMessageAtFrontOfQueue(mMessages[i]);
+ } else {
+ mHandler.sendMessageAtTime(mMessages[i], now + mDelays[i]);
+ }
+ }
+ long endTimeNS = SystemClock.elapsedRealtimeNanos();
+
+ synchronized (sLock) {
+ mResults.add(endTimeNS - startTimeNS);
+ }
+ mEndLatch.countDown();
+ }
+ }
+
+ class TestHandler extends Handler {
+ TestHandler(Looper looper) {
+ super(looper);
+ }
+
+ public void handleMessage(Message msg) { }
+ }
+
+ void reportPerf(String prefix, int threadCount, int perThreadMessageCount) {
+ Instrumentation instrumentation = InstrumentationRegistry.getInstrumentation();
+ Stats stats = new Stats(mResults);
+
+ Log.d(TAG, "Reporting perf now");
+
+ Bundle status = new Bundle();
+ status.putLong(prefix + "_median_ns", stats.getMedian());
+ status.putLong(prefix + "_mean_ns", (long) stats.getMean());
+ status.putLong(prefix + "_min_ns", stats.getMin());
+ status.putLong(prefix + "_max_ns", stats.getMax());
+ status.putLong(prefix + "_stddev_ns", (long) stats.getStandardDeviation());
+ status.putLong(prefix + "_nr_threads", threadCount);
+ status.putLong(prefix + "_msgs_per_thread", perThreadMessageCount);
+ instrumentation.sendStatus(Activity.RESULT_OK, status);
+ }
+
+ HandlerThread mHandlerThread;
+
+ private void fillMessagesArray(Message[] messages) {
+ for (int i = 0; i < messages.length; i++) {
+ messages[i] = mHandlerThread.getThreadHandler().obtainMessage(i);
+ }
+ }
+
+ private void startTestAndWaitOnThreads(CountDownLatch threadStartLatch, CountDownLatch threadEndLatch) {
+ try {
+ threadStartLatch.countDown();
+ Log.e(TAG, "Test threads started");
+ threadEndLatch.await();
+ } catch (InterruptedException ignored) {
+ }
+ Log.e(TAG, "Test threads ended, quitting handler thread");
+ }
+
+ @Test
+ public void benchmarkEnqueueAtFrontOfQueue() {
+ CountDownLatch threadStartLatch = new CountDownLatch(1);
+ CountDownLatch threadEndLatch = new CountDownLatch(THREAD_COUNT);
+ mHandlerThread = new HandlerThread("MessageQueuePerfTest");
+ mHandlerThread.start();
+ Message[] messages = new Message[TOTAL_MESSAGE_COUNT];
+ fillMessagesArray(messages);
+
+ long[] delays = new long[TOTAL_MESSAGE_COUNT];
+ mResults = new ArrayList<>();
+
+ TestHandler handler = new TestHandler(mHandlerThread.getLooper());
+ for (int i = 0; i < THREAD_COUNT; i++) {
+ EnqueueThread thread = new EnqueueThread(threadStartLatch, threadEndLatch, handler,
+ i * PER_THREAD_MESSAGE_COUNT, messages, delays);
+ thread.start();
+ }
+
+ startTestAndWaitOnThreads(threadStartLatch, threadEndLatch);
+
+ mHandlerThread.quitSafely();
+
+ reportPerf("enqueueAtFront", THREAD_COUNT, PER_THREAD_MESSAGE_COUNT);
+ }
+
+ /**
+ * Fill array with random delays, for benchmarkEnqueueDelayed
+ */
+ public long[] fillDelayArray() {
+ long[] delays = new long[TOTAL_MESSAGE_COUNT];
+ Random rand = new Random(0xDEADBEEF);
+ for (int i = 0; i < TOTAL_MESSAGE_COUNT; i++) {
+ delays[i] = Math.abs(rand.nextLong() % 5000);
+ }
+ return delays;
+ }
+
+ @Test
+ public void benchmarkEnqueueDelayed() {
+ CountDownLatch threadStartLatch = new CountDownLatch(1);
+ CountDownLatch threadEndLatch = new CountDownLatch(THREAD_COUNT);
+ mHandlerThread = new HandlerThread("MessageQueuePerfTest");
+ mHandlerThread.start();
+ Message[] messages = new Message[TOTAL_MESSAGE_COUNT];
+ fillMessagesArray(messages);
+
+ long[] delays = fillDelayArray();
+ mResults = new ArrayList<>();
+
+ TestHandler handler = new TestHandler(mHandlerThread.getLooper());
+ for (int i = 0; i < THREAD_COUNT; i++) {
+ EnqueueThread thread = new EnqueueThread(threadStartLatch, threadEndLatch, handler,
+ i * PER_THREAD_MESSAGE_COUNT, messages, delays);
+ thread.start();
+ }
+
+ startTestAndWaitOnThreads(threadStartLatch, threadEndLatch);
+
+ mHandlerThread.quitSafely();
+
+ reportPerf("enqueueDelayed", THREAD_COUNT, PER_THREAD_MESSAGE_COUNT);
+ }
+}
diff --git a/apex/jobscheduler/service/aconfig/app_idle.aconfig b/apex/jobscheduler/service/aconfig/app_idle.aconfig
index c8976ca8361e..f079c02707e0 100644
--- a/apex/jobscheduler/service/aconfig/app_idle.aconfig
+++ b/apex/jobscheduler/service/aconfig/app_idle.aconfig
@@ -12,3 +12,12 @@ flag {
}
}
+flag {
+ name: "screen_time_bypass"
+ namespace: "backstage_power"
+ description: "Bypass the screen time check for bucket evaluation"
+ bug: "374114769"
+ metadata {
+ purpose: PURPOSE_BUGFIX
+ }
+}
diff --git a/apex/jobscheduler/service/java/com/android/server/DeviceIdleController.java b/apex/jobscheduler/service/java/com/android/server/DeviceIdleController.java
index c1894f0f795f..a37779e681fb 100644
--- a/apex/jobscheduler/service/java/com/android/server/DeviceIdleController.java
+++ b/apex/jobscheduler/service/java/com/android/server/DeviceIdleController.java
@@ -3568,7 +3568,7 @@ public class DeviceIdleController extends SystemService
Slog.i(TAG, "becomeActiveLocked, reason=" + activeReason
+ ", changeLightIdle=" + changeLightIdle);
}
- if (mState != STATE_ACTIVE || mLightState != STATE_ACTIVE) {
+ if (mState != STATE_ACTIVE || mLightState != LIGHT_STATE_ACTIVE) {
moveToStateLocked(STATE_ACTIVE, activeReason);
mInactiveTimeout = newInactiveTimeout;
resetIdleManagementLocked();
diff --git a/apex/jobscheduler/service/java/com/android/server/usage/AppIdleHistory.java b/apex/jobscheduler/service/java/com/android/server/usage/AppIdleHistory.java
index 6265d9bb815f..a8641ae43509 100644
--- a/apex/jobscheduler/service/java/com/android/server/usage/AppIdleHistory.java
+++ b/apex/jobscheduler/service/java/com/android/server/usage/AppIdleHistory.java
@@ -629,14 +629,15 @@ public class AppIdleHistory {
}
/**
- * Returns the index in the arrays of screenTimeThresholds and elapsedTimeThresholds
- * that corresponds to how long since the app was used.
+ * Returns the index in the array of elapsedTimeThresholds that corresponds to
+ * how long since the app was used.
* @param packageName
* @param userId
* @param elapsedRealtime current time
- * @param screenTimeThresholds Array of screen times, in ascending order, first one is 0
+ * @param screenTimeThresholds Array of screen times, in ascending order,
+ * first one is 0 (this will not be used any more)
* @param elapsedTimeThresholds Array of elapsed time, in ascending order, first one is 0
- * @return The index whose values the app's used time exceeds (in both arrays) or {@code -1} to
+ * @return The index whose values the app's used time exceeds or {@code -1} to
* indicate that the app has never been used.
*/
int getThresholdIndex(String packageName, int userId, long elapsedRealtime,
@@ -646,7 +647,7 @@ public class AppIdleHistory {
elapsedRealtime, false);
// If we don't have any state for the app, assume never used
if (appUsageHistory == null || appUsageHistory.lastUsedElapsedTime < 0
- || appUsageHistory.lastUsedScreenTime < 0) {
+ || (!Flags.screenTimeBypass() && appUsageHistory.lastUsedScreenTime < 0)) {
return -1;
}
@@ -659,7 +660,7 @@ public class AppIdleHistory {
if (DEBUG) Slog.d(TAG, packageName + " screenOn=" + screenOnDelta
+ ", elapsed=" + elapsedDelta);
for (int i = screenTimeThresholds.length - 1; i >= 0; i--) {
- if (screenOnDelta >= screenTimeThresholds[i]
+ if ((Flags.screenTimeBypass() || screenOnDelta >= screenTimeThresholds[i])
&& elapsedDelta >= elapsedTimeThresholds[i]) {
return i;
}
diff --git a/core/api/current.txt b/core/api/current.txt
index 14a91c9033c5..ff203848fa3a 100644
--- a/core/api/current.txt
+++ b/core/api/current.txt
@@ -239,6 +239,7 @@ package android {
field @Deprecated public static final String PROCESS_OUTGOING_CALLS = "android.permission.PROCESS_OUTGOING_CALLS";
field public static final String PROVIDE_OWN_AUTOFILL_SUGGESTIONS = "android.permission.PROVIDE_OWN_AUTOFILL_SUGGESTIONS";
field public static final String PROVIDE_REMOTE_CREDENTIALS = "android.permission.PROVIDE_REMOTE_CREDENTIALS";
+ field @FlaggedApi("android.security.aapm_api") public static final String QUERY_ADVANCED_PROTECTION_MODE = "android.permission.QUERY_ADVANCED_PROTECTION_MODE";
field public static final String QUERY_ALL_PACKAGES = "android.permission.QUERY_ALL_PACKAGES";
field public static final String READ_ASSISTANT_APP_SEARCH_DATA = "android.permission.READ_ASSISTANT_APP_SEARCH_DATA";
field public static final String READ_BASIC_PHONE_STATE = "android.permission.READ_BASIC_PHONE_STATE";
@@ -10801,6 +10802,7 @@ package android.content {
field public static final String ACCESSIBILITY_SERVICE = "accessibility";
field public static final String ACCOUNT_SERVICE = "account";
field public static final String ACTIVITY_SERVICE = "activity";
+ field @FlaggedApi("android.security.aapm_api") public static final String ADVANCED_PROTECTION_SERVICE = "advanced_protection";
field public static final String ALARM_SERVICE = "alarm";
field public static final String APPWIDGET_SERVICE = "appwidget";
field @FlaggedApi("android.app.appfunctions.flags.enable_app_function_manager") public static final String APP_FUNCTION_SERVICE = "app_function";
@@ -10862,6 +10864,7 @@ package android.content {
field public static final String IPSEC_SERVICE = "ipsec";
field public static final String JOB_SCHEDULER_SERVICE = "jobscheduler";
field public static final String KEYGUARD_SERVICE = "keyguard";
+ field @FlaggedApi("android.security.keystore_grant_api") public static final String KEYSTORE_SERVICE = "keystore";
field public static final String LAUNCHER_APPS_SERVICE = "launcherapps";
field @UiContext public static final String LAYOUT_INFLATER_SERVICE = "layout_inflater";
field public static final String LOCALE_SERVICE = "locale";
@@ -16101,6 +16104,7 @@ package android.graphics {
enum_constant public static final android.graphics.ColorSpace.Named CIE_LAB;
enum_constant public static final android.graphics.ColorSpace.Named CIE_XYZ;
enum_constant public static final android.graphics.ColorSpace.Named DCI_P3;
+ enum_constant @FlaggedApi("com.android.graphics.flags.display_bt2020_colorspace") public static final android.graphics.ColorSpace.Named DISPLAY_BT2020;
enum_constant public static final android.graphics.ColorSpace.Named DISPLAY_P3;
enum_constant public static final android.graphics.ColorSpace.Named EXTENDED_SRGB;
enum_constant public static final android.graphics.ColorSpace.Named LINEAR_EXTENDED_SRGB;
@@ -18617,6 +18621,7 @@ package android.hardware {
field public static final int DATASPACE_BT709 = 281083904; // 0x10c10000
field public static final int DATASPACE_DCI_P3 = 155844608; // 0x94a0000
field public static final int DATASPACE_DEPTH = 4096; // 0x1000
+ field @FlaggedApi("com.android.graphics.flags.display_bt2020_colorspace") public static final int DATASPACE_DISPLAY_BT2020 = 142999552; // 0x8860000
field public static final int DATASPACE_DISPLAY_P3 = 143261696; // 0x88a0000
field public static final int DATASPACE_DYNAMIC_DEPTH = 4098; // 0x1002
field public static final int DATASPACE_HEIF = 4100; // 0x1004
@@ -33965,9 +33970,12 @@ package android.os {
public class RemoteCallbackList<E extends android.os.IInterface> {
ctor public RemoteCallbackList();
method public int beginBroadcast();
+ method @FlaggedApi("android.os.binder_frozen_state_change_callback") public void broadcast(@NonNull java.util.function.Consumer<E>);
method public void finishBroadcast();
method public Object getBroadcastCookie(int);
method public E getBroadcastItem(int);
+ method @FlaggedApi("android.os.binder_frozen_state_change_callback") public int getFrozenCalleePolicy();
+ method @FlaggedApi("android.os.binder_frozen_state_change_callback") public int getMaxQueueSize();
method public Object getRegisteredCallbackCookie(int);
method public int getRegisteredCallbackCount();
method public E getRegisteredCallbackItem(int);
@@ -33977,6 +33985,16 @@ package android.os {
method public boolean register(E);
method public boolean register(E, Object);
method public boolean unregister(E);
+ field @FlaggedApi("android.os.binder_frozen_state_change_callback") public static final int FROZEN_CALLEE_POLICY_DROP = 3; // 0x3
+ field @FlaggedApi("android.os.binder_frozen_state_change_callback") public static final int FROZEN_CALLEE_POLICY_ENQUEUE_ALL = 1; // 0x1
+ field @FlaggedApi("android.os.binder_frozen_state_change_callback") public static final int FROZEN_CALLEE_POLICY_ENQUEUE_MOST_RECENT = 2; // 0x2
+ field @FlaggedApi("android.os.binder_frozen_state_change_callback") public static final int FROZEN_CALLEE_POLICY_UNSET = 0; // 0x0
+ }
+
+ @FlaggedApi("android.os.binder_frozen_state_change_callback") public static final class RemoteCallbackList.Builder<E extends android.os.IInterface> {
+ ctor public RemoteCallbackList.Builder(int);
+ method @NonNull public android.os.RemoteCallbackList<E> build();
+ method @NonNull public android.os.RemoteCallbackList.Builder setMaxQueueSize(int);
}
public class RemoteException extends android.util.AndroidException {
@@ -39718,6 +39736,20 @@ package android.security {
}
+package android.security.advancedprotection {
+
+ @FlaggedApi("android.security.aapm_api") public class AdvancedProtectionManager {
+ method @RequiresPermission(android.Manifest.permission.QUERY_ADVANCED_PROTECTION_MODE) public boolean isAdvancedProtectionEnabled();
+ method @RequiresPermission(android.Manifest.permission.QUERY_ADVANCED_PROTECTION_MODE) public void registerAdvancedProtectionCallback(@NonNull java.util.concurrent.Executor, @NonNull android.security.advancedprotection.AdvancedProtectionManager.Callback);
+ method @RequiresPermission(android.Manifest.permission.QUERY_ADVANCED_PROTECTION_MODE) public void unregisterAdvancedProtectionCallback(@NonNull android.security.advancedprotection.AdvancedProtectionManager.Callback);
+ }
+
+ @FlaggedApi("android.security.aapm_api") public static interface AdvancedProtectionManager.Callback {
+ method public void onAdvancedProtectionChanged(boolean);
+ }
+
+}
+
package android.security.identity {
public class AccessControlProfile {
@@ -40135,6 +40167,14 @@ package android.security.keystore {
method @NonNull public android.security.keystore.KeyProtection.Builder setUserPresenceRequired(boolean);
}
+ @FlaggedApi("android.security.keystore_grant_api") public class KeyStoreManager {
+ method @NonNull public java.util.List<java.security.cert.X509Certificate> getGrantedCertificateChainFromId(long) throws android.security.keystore.KeyPermanentlyInvalidatedException, java.security.UnrecoverableKeyException;
+ method @NonNull public java.security.Key getGrantedKeyFromId(long) throws android.security.keystore.KeyPermanentlyInvalidatedException, java.security.UnrecoverableKeyException;
+ method @NonNull public java.security.KeyPair getGrantedKeyPairFromId(long) throws android.security.keystore.KeyPermanentlyInvalidatedException, java.security.UnrecoverableKeyException;
+ method public long grantKeyAccess(@NonNull String, int) throws android.security.KeyStoreException, java.security.UnrecoverableKeyException;
+ method public void revokeKeyAccess(@NonNull String, int) throws android.security.KeyStoreException, java.security.UnrecoverableKeyException;
+ }
+
public class SecureKeyImportUnavailableException extends java.security.ProviderException {
ctor public SecureKeyImportUnavailableException();
ctor public SecureKeyImportUnavailableException(String);
@@ -52200,7 +52240,7 @@ package android.view {
method public void clear();
method public void copyFrom(android.view.MotionEvent.PointerCoords);
method public float getAxisValue(int);
- method @FlaggedApi("com.android.hardware.input.pointer_coords_is_resampled_api") public boolean isResampled();
+ method public boolean isResampled();
method public void setAxisValue(int, float);
field public float orientation;
field public float pressure;
@@ -58150,12 +58190,16 @@ package android.webkit {
method public abstract String[] getAcceptTypes();
method @Nullable public abstract String getFilenameHint();
method public abstract int getMode();
+ method @FlaggedApi("android.webkit.file_system_access") public int getPermissionMode();
method @Nullable public abstract CharSequence getTitle();
method public abstract boolean isCaptureEnabled();
method @Nullable public static android.net.Uri[] parseResult(int, android.content.Intent);
field public static final int MODE_OPEN = 0; // 0x0
+ field @FlaggedApi("android.webkit.file_system_access") public static final int MODE_OPEN_FOLDER = 2; // 0x2
field public static final int MODE_OPEN_MULTIPLE = 1; // 0x1
field public static final int MODE_SAVE = 3; // 0x3
+ field @FlaggedApi("android.webkit.file_system_access") public static final int PERMISSION_MODE_READ = 0; // 0x0
+ field @FlaggedApi("android.webkit.file_system_access") public static final int PERMISSION_MODE_READ_WRITE = 1; // 0x1
}
public abstract class WebHistoryItem implements java.lang.Cloneable {
@@ -58512,7 +58556,7 @@ package android.webkit {
method public void setWebViewRenderProcessClient(@Nullable android.webkit.WebViewRenderProcessClient);
method @Deprecated public boolean shouldDelayChildPressedState();
method @Deprecated public boolean showFindDialog(@Nullable String, boolean);
- method public static void startSafeBrowsing(@NonNull android.content.Context, @Nullable android.webkit.ValueCallback<java.lang.Boolean>);
+ method @Deprecated @FlaggedApi("android.webkit.deprecate_start_safe_browsing") public static void startSafeBrowsing(@NonNull android.content.Context, @Nullable android.webkit.ValueCallback<java.lang.Boolean>);
method public void stopLoading();
method public void zoomBy(float);
method public boolean zoomIn();
diff --git a/core/api/system-current.txt b/core/api/system-current.txt
index fa4fc43c3418..207f4b57e8bf 100644
--- a/core/api/system-current.txt
+++ b/core/api/system-current.txt
@@ -362,6 +362,7 @@ package android {
field public static final String SERIAL_PORT = "android.permission.SERIAL_PORT";
field @FlaggedApi("android.security.fsverity_api") public static final String SETUP_FSVERITY = "android.permission.SETUP_FSVERITY";
field public static final String SET_ACTIVITY_WATCHER = "android.permission.SET_ACTIVITY_WATCHER";
+ field @FlaggedApi("android.security.aapm_api") public static final String SET_ADVANCED_PROTECTION_MODE = "android.permission.SET_ADVANCED_PROTECTION_MODE";
field public static final String SET_CLIP_SOURCE = "android.permission.SET_CLIP_SOURCE";
field public static final String SET_DEFAULT_ACCOUNT_FOR_CONTACTS = "android.permission.SET_DEFAULT_ACCOUNT_FOR_CONTACTS";
field public static final String SET_HARMFUL_APP_WARNINGS = "android.permission.SET_HARMFUL_APP_WARNINGS";
@@ -4170,9 +4171,11 @@ package android.content.pm {
}
public class PackageInstaller {
+ method @FlaggedApi("android.content.pm.verification_service") @RequiresPermission(android.Manifest.permission.VERIFICATION_AGENT) public final int getVerificationPolicy();
method @NonNull public android.content.pm.PackageInstaller.InstallInfo readInstallInfo(@NonNull java.io.File, int) throws android.content.pm.PackageInstaller.PackageParsingException;
method @FlaggedApi("android.content.pm.read_install_info") @NonNull public android.content.pm.PackageInstaller.InstallInfo readInstallInfo(@NonNull android.os.ParcelFileDescriptor, @Nullable String, int) throws android.content.pm.PackageInstaller.PackageParsingException;
method @RequiresPermission(android.Manifest.permission.INSTALL_PACKAGES) public void setPermissionsResult(int, boolean);
+ method @FlaggedApi("android.content.pm.verification_service") @RequiresPermission(android.Manifest.permission.VERIFICATION_AGENT) public final boolean setVerificationPolicy(int);
field public static final String ACTION_CONFIRM_INSTALL = "android.content.pm.action.CONFIRM_INSTALL";
field public static final String ACTION_CONFIRM_PRE_APPROVAL = "android.content.pm.action.CONFIRM_PRE_APPROVAL";
field public static final int DATA_LOADER_TYPE_INCREMENTAL = 2; // 0x2
@@ -4183,12 +4186,20 @@ package android.content.pm {
field @FlaggedApi("android.content.pm.archiving") public static final String EXTRA_DELETE_FLAGS = "android.content.pm.extra.DELETE_FLAGS";
field public static final String EXTRA_LEGACY_STATUS = "android.content.pm.extra.LEGACY_STATUS";
field @Deprecated public static final String EXTRA_RESOLVED_BASE_PATH = "android.content.pm.extra.RESOLVED_BASE_PATH";
+ field @FlaggedApi("android.content.pm.verification_service") public static final String EXTRA_VERIFICATION_FAILURE_REASON = "android.content.pm.extra.VERIFICATION_FAILURE_REASON";
field public static final int LOCATION_DATA_APP = 0; // 0x0
field public static final int LOCATION_MEDIA_DATA = 2; // 0x2
field public static final int LOCATION_MEDIA_OBB = 1; // 0x1
field public static final int REASON_CONFIRM_PACKAGE_CHANGE = 0; // 0x0
field public static final int REASON_OWNERSHIP_CHANGED = 1; // 0x1
field public static final int REASON_REMIND_OWNERSHIP = 2; // 0x2
+ field @FlaggedApi("android.content.pm.verification_service") public static final int VERIFICATION_FAILED_REASON_NETWORK_UNAVAILABLE = 1; // 0x1
+ field @FlaggedApi("android.content.pm.verification_service") public static final int VERIFICATION_FAILED_REASON_PACKAGE_BLOCKED = 2; // 0x2
+ field @FlaggedApi("android.content.pm.verification_service") public static final int VERIFICATION_FAILED_REASON_UNKNOWN = 0; // 0x0
+ field @FlaggedApi("android.content.pm.verification_service") public static final int VERIFICATION_POLICY_BLOCK_FAIL_CLOSED = 3; // 0x3
+ field @FlaggedApi("android.content.pm.verification_service") public static final int VERIFICATION_POLICY_BLOCK_FAIL_OPEN = 1; // 0x1
+ field @FlaggedApi("android.content.pm.verification_service") public static final int VERIFICATION_POLICY_BLOCK_FAIL_WARN = 2; // 0x2
+ field @FlaggedApi("android.content.pm.verification_service") public static final int VERIFICATION_POLICY_NONE = 0; // 0x0
}
public static class PackageInstaller.InstallInfo {
@@ -4635,12 +4646,13 @@ package android.content.pm.verify.pkg {
method @NonNull public android.content.pm.SigningInfo getSigningInfo();
method @NonNull public android.net.Uri getStagedPackageUri();
method @RequiresPermission(android.Manifest.permission.VERIFICATION_AGENT) public long getTimeoutTime();
+ method public int getVerificationPolicy();
method @RequiresPermission(android.Manifest.permission.VERIFICATION_AGENT) public void reportVerificationComplete(@NonNull android.content.pm.verify.pkg.VerificationStatus);
method @RequiresPermission(android.Manifest.permission.VERIFICATION_AGENT) public void reportVerificationComplete(@NonNull android.content.pm.verify.pkg.VerificationStatus, @NonNull android.os.PersistableBundle);
method @RequiresPermission(android.Manifest.permission.VERIFICATION_AGENT) public void reportVerificationIncomplete(int);
+ method @RequiresPermission(android.Manifest.permission.VERIFICATION_AGENT) public boolean setVerificationPolicy(int);
method public void writeToParcel(@NonNull android.os.Parcel, int);
field @NonNull public static final android.os.Parcelable.Creator<android.content.pm.verify.pkg.VerificationSession> CREATOR;
- field public static final int VERIFICATION_INCOMPLETE_NETWORK_LIMITED = 2; // 0x2
field public static final int VERIFICATION_INCOMPLETE_NETWORK_UNAVAILABLE = 1; // 0x1
field public static final int VERIFICATION_INCOMPLETE_UNKNOWN = 0; // 0x0
}
@@ -12322,6 +12334,14 @@ package android.security {
}
+package android.security.advancedprotection {
+
+ @FlaggedApi("android.security.aapm_api") public class AdvancedProtectionManager {
+ method @RequiresPermission(android.Manifest.permission.SET_ADVANCED_PROTECTION_MODE) public void setAdvancedProtectionEnabled(boolean);
+ }
+
+}
+
package android.security.keystore {
public class AndroidKeyStoreProvider extends java.security.Provider {
diff --git a/core/java/android/animation/AnimationHandler.java b/core/java/android/animation/AnimationHandler.java
index 4fc90ae9d22c..d84a4c12a2cd 100644
--- a/core/java/android/animation/AnimationHandler.java
+++ b/core/java/android/animation/AnimationHandler.java
@@ -81,6 +81,25 @@ public class AnimationHandler {
*/
private final ArrayList<WeakReference<Object>> mAnimatorRequestors = new ArrayList<>();
+ /**
+ * The callbacks which will invoke {@link Animator#notifyEndListeners(boolean)} on next frame.
+ * It is only used if {@link Animator#setPostNotifyEndListenerEnabled(boolean)} sets true.
+ */
+ private ArrayList<Runnable> mPendingEndAnimationListeners;
+
+ /**
+ * The value of {@link Choreographer#getVsyncId()} at the last animation frame.
+ * It is only used if {@link Animator#setPostNotifyEndListenerEnabled(boolean)} sets true.
+ */
+ private long mLastAnimationFrameVsyncId;
+
+ /**
+ * The value of {@link Choreographer#getVsyncId()} when calling
+ * {@link Animator#notifyEndListeners(boolean)}.
+ * It is only used if {@link Animator#setPostNotifyEndListenerEnabled(boolean)} sets true.
+ */
+ private long mEndAnimationFrameVsyncId;
+
private final Choreographer.FrameCallback mFrameCallback = new Choreographer.FrameCallback() {
@Override
public void doFrame(long frameTimeNanos) {
@@ -332,6 +351,39 @@ public class AnimationHandler {
}
}
+ /**
+ * Returns the vsyncId of last animation frame if the given {@param currentVsyncId} matches
+ * the vsyncId from the end callback of animation. Otherwise it returns the given vsyncId.
+ * It only takes effect if {@link #postEndAnimationCallback(Runnable)} is called.
+ */
+ public long getLastAnimationFrameVsyncId(long currentVsyncId) {
+ return currentVsyncId == mEndAnimationFrameVsyncId && mLastAnimationFrameVsyncId != 0
+ ? mLastAnimationFrameVsyncId : currentVsyncId;
+ }
+
+ /** Runs the given callback on next frame to notify the end of the animation. */
+ public void postEndAnimationCallback(Runnable notifyEndAnimation) {
+ if (mPendingEndAnimationListeners == null) {
+ mPendingEndAnimationListeners = new ArrayList<>();
+ }
+ mPendingEndAnimationListeners.add(notifyEndAnimation);
+ if (mPendingEndAnimationListeners.size() > 1) {
+ return;
+ }
+ final Choreographer choreographer = Choreographer.getInstance();
+ mLastAnimationFrameVsyncId = choreographer.getVsyncId();
+ getProvider().postFrameCallback(frame -> {
+ mEndAnimationFrameVsyncId = choreographer.getVsyncId();
+ // The animation listeners can only get vsyncId of last animation frame in this frame
+ // by getLastAnimationFrameVsyncId(currentVsyncId).
+ while (mPendingEndAnimationListeners.size() > 0) {
+ mPendingEndAnimationListeners.remove(0).run();
+ }
+ mEndAnimationFrameVsyncId = 0;
+ mLastAnimationFrameVsyncId = 0;
+ });
+ }
+
private void doAnimationFrame(long frameTime) {
long currentTime = SystemClock.uptimeMillis();
final int size = mAnimationCallbacks.size();
diff --git a/core/java/android/animation/Animator.java b/core/java/android/animation/Animator.java
index c58624e9dfab..d1eb8e8fa2ff 100644
--- a/core/java/android/animation/Animator.java
+++ b/core/java/android/animation/Animator.java
@@ -16,6 +16,7 @@
package android.animation;
+import android.annotation.CallSuper;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.TestApi;
@@ -23,6 +24,7 @@ import android.compat.annotation.UnsupportedAppUsage;
import android.content.pm.ActivityInfo.Config;
import android.content.res.ConstantState;
import android.os.Build;
+import android.os.Trace;
import android.util.LongArray;
import java.util.ArrayList;
@@ -73,6 +75,13 @@ public abstract class Animator implements Cloneable {
private static long sBackgroundPauseDelay = 1000;
/**
+ * If true, when the animation plays normally to the end, the callback
+ * {@link AnimatorListener#onAnimationEnd(Animator)} will be scheduled on the next frame.
+ * It is to avoid the last animation frame being delayed by the implementation of listeners.
+ */
+ static boolean sPostNotifyEndListenerEnabled;
+
+ /**
* A cache of the values in a list. Used so that when calling the list, we have a copy
* of it in case the list is modified while iterating. The array can be reused to avoid
* allocation on every notification.
@@ -124,6 +133,14 @@ public abstract class Animator implements Cloneable {
}
/**
+ * @see #sPostNotifyEndListenerEnabled
+ * @hide
+ */
+ public static void setPostNotifyEndListenerEnabled(boolean enable) {
+ sPostNotifyEndListenerEnabled = enable;
+ }
+
+ /**
* Starts this animation. If the animation has a nonzero startDelay, the animation will start
* running after that delay elapses. A non-delayed animation will have its initial
* value(s) set immediately, followed by calls to
@@ -635,6 +652,28 @@ public abstract class Animator implements Cloneable {
}
}
+ void notifyEndListenersFromEndAnimation(boolean isReversing, boolean postNotifyEndListener) {
+ if (postNotifyEndListener) {
+ AnimationHandler.getInstance().postEndAnimationCallback(
+ () -> completeEndAnimation(isReversing, "postNotifyAnimEnd"));
+ } else {
+ completeEndAnimation(isReversing, "notifyAnimEnd");
+ }
+ }
+
+ @CallSuper
+ void completeEndAnimation(boolean isReversing, String notifyListenerTraceName) {
+ final boolean useTrace = mListeners != null && Trace.isTagEnabled(Trace.TRACE_TAG_VIEW);
+ if (useTrace) {
+ Trace.traceBegin(Trace.TRACE_TAG_VIEW, notifyListenerTraceName
+ + "-" + getClass().getSimpleName());
+ }
+ notifyEndListeners(isReversing);
+ if (useTrace) {
+ Trace.traceEnd(Trace.TRACE_TAG_VIEW);
+ }
+ }
+
/**
* Calls <code>call</code> for every item in <code>list</code> with <code>animator</code> and
* <code>isReverse</code> as parameters.
diff --git a/core/java/android/animation/AnimatorSet.java b/core/java/android/animation/AnimatorSet.java
index ac3711366ec7..76098db2dc5b 100644
--- a/core/java/android/animation/AnimatorSet.java
+++ b/core/java/android/animation/AnimatorSet.java
@@ -1442,6 +1442,8 @@ public final class AnimatorSet extends Animator implements AnimationHandler.Anim
}
private void endAnimation() {
+ final boolean postNotifyEndListener = sPostNotifyEndListenerEnabled && mListeners != null
+ && mLastFrameTime > 0;
mStarted = false;
mLastFrameTime = -1;
mFirstFrame = -1;
@@ -1453,7 +1455,12 @@ public final class AnimatorSet extends Animator implements AnimationHandler.Anim
// No longer receive callbacks
removeAnimationCallback();
- notifyEndListeners(mReversing);
+ notifyEndListenersFromEndAnimation(mReversing, postNotifyEndListener);
+ }
+
+ @Override
+ void completeEndAnimation(boolean isReversing, String notifyListenerTraceName) {
+ super.completeEndAnimation(isReversing, notifyListenerTraceName);
removeAnimationEndListener();
mSelfPulse = true;
mReversing = false;
diff --git a/core/java/android/animation/ValueAnimator.java b/core/java/android/animation/ValueAnimator.java
index 5de7f387b206..e849abaf4aec 100644
--- a/core/java/android/animation/ValueAnimator.java
+++ b/core/java/android/animation/ValueAnimator.java
@@ -1289,6 +1289,8 @@ public class ValueAnimator extends Animator implements AnimationHandler.Animatio
if (mAnimationEndRequested) {
return;
}
+ final boolean postNotifyEndListener = sPostNotifyEndListenerEnabled && mListeners != null
+ && mLastFrameTime > 0;
removeAnimationCallback();
mAnimationEndRequested = true;
@@ -1303,15 +1305,20 @@ public class ValueAnimator extends Animator implements AnimationHandler.Animatio
mStartTime = -1;
mRunning = false;
mStarted = false;
- notifyEndListeners(mReversing);
- // mReversing needs to be reset *after* notifying the listeners for the end callbacks.
- mReversing = false;
+ notifyEndListenersFromEndAnimation(mReversing, postNotifyEndListener);
if (Trace.isTagEnabled(Trace.TRACE_TAG_VIEW)) {
Trace.asyncTraceEnd(Trace.TRACE_TAG_VIEW, getNameForTrace(),
System.identityHashCode(this));
}
}
+ @Override
+ void completeEndAnimation(boolean isReversing, String notifyListenerTraceName) {
+ super.completeEndAnimation(isReversing, notifyListenerTraceName);
+ // mReversing needs to be reset *after* notifying the listeners for the end callbacks.
+ mReversing = false;
+ }
+
/**
* Called internally to start an animation by adding it to the active animations list. Must be
* called on the UI thread.
diff --git a/core/java/android/app/Notification.java b/core/java/android/app/Notification.java
index 4ef5b5163fef..64aa705447aa 100644
--- a/core/java/android/app/Notification.java
+++ b/core/java/android/app/Notification.java
@@ -11176,7 +11176,7 @@ public class Notification implements Parcelable
}
/**
- * A Notification Style used to to define a notification whose expanded state includes
+ * A Notification Style used to define a notification whose expanded state includes
* a highly customizable progress bar with segments, points, a custom tracker icon,
* and custom icons at the start and end of the progress bar.
*
diff --git a/core/java/android/app/NotificationChannel.java b/core/java/android/app/NotificationChannel.java
index 4a2b016456f7..ebe7b3a4fc51 100644
--- a/core/java/android/app/NotificationChannel.java
+++ b/core/java/android/app/NotificationChannel.java
@@ -38,6 +38,7 @@ import android.provider.Settings;
import android.service.notification.NotificationListenerService;
import android.text.TextUtils;
import android.util.Log;
+import android.util.Slog;
import android.util.proto.ProtoOutputStream;
import com.android.internal.util.Preconditions;
@@ -1369,12 +1370,17 @@ public final class NotificationChannel implements Parcelable {
if (sound == null || Uri.EMPTY.equals(sound)) {
return null;
}
- Uri canonicalSound = getCanonicalizedSoundUri(context.getContentResolver(), sound);
- if (canonicalSound == null) {
- // The content provider does not support canonical uris so we backup the default
+ try {
+ Uri canonicalSound = getCanonicalizedSoundUri(context.getContentResolver(), sound);
+ if (canonicalSound == null) {
+ // The content provider does not support canonical uris so we backup the default
+ return Settings.System.DEFAULT_NOTIFICATION_URI;
+ }
+ return canonicalSound;
+ } catch (Exception e) {
+ Slog.e(TAG, "Cannot find file for sound " + sound + " using default");
return Settings.System.DEFAULT_NOTIFICATION_URI;
}
- return canonicalSound;
}
/**
diff --git a/core/java/android/app/OWNERS b/core/java/android/app/OWNERS
index ba71afb49629..6e4c28f3eca6 100644
--- a/core/java/android/app/OWNERS
+++ b/core/java/android/app/OWNERS
@@ -3,50 +3,54 @@
per-file ContextImpl.java = *
# ActivityManager
-per-file ActivityManager* = file:/services/core/java/com/android/server/am/OWNERS
-per-file *ApplicationStartInfo* = file:/services/core/java/com/android/server/am/OWNERS
-per-file ApplicationErrorReport* = file:/services/core/java/com/android/server/am/OWNERS
-per-file ApplicationExitInfo* = file:/services/core/java/com/android/server/am/OWNERS
-per-file Application.java = file:/services/core/java/com/android/server/am/OWNERS
-per-file ApplicationLoaders.java = file:/services/core/java/com/android/server/am/OWNERS
-per-file ApplicationThreadConstants.java = file:/services/core/java/com/android/server/am/OWNERS
-per-file ContentProviderHolder* = file:/services/core/java/com/android/server/am/OWNERS
-per-file *ForegroundService* = file:/services/core/java/com/android/server/am/OWNERS
-per-file IActivityController.aidl = file:/services/core/java/com/android/server/am/OWNERS
-per-file IActivityManager.aidl = file:/services/core/java/com/android/server/am/OWNERS
-per-file IApplicationThread.aidl = file:/services/core/java/com/android/server/am/OWNERS
-per-file IAppTraceRetriever.aidl = file:/services/core/java/com/android/server/am/OWNERS
-per-file IForegroundServiceObserver.aidl = file:/services/core/java/com/android/server/am/OWNERS
-per-file IInstrumentationWatcher.aidl = file:/services/core/java/com/android/server/am/OWNERS
-per-file IntentService.aidl = file:/services/core/java/com/android/server/am/OWNERS
-per-file IServiceConnection.aidl = file:/services/core/java/com/android/server/am/OWNERS
-per-file IStopUserCallback.aidl = file:/services/core/java/com/android/server/am/OWNERS
-per-file IUidObserver.aidl = file:/services/core/java/com/android/server/am/OWNERS
-per-file LoadedApk.java = file:/services/core/java/com/android/server/am/OWNERS
-per-file LocalActivityManager.java = file:/services/core/java/com/android/server/am/OWNERS
-per-file PendingIntent* = file:/services/core/java/com/android/server/am/OWNERS
-per-file *Process* = file:/services/core/java/com/android/server/am/OWNERS
-per-file ProfilerInfo* = file:/services/core/java/com/android/server/am/OWNERS
-per-file Service* = file:/services/core/java/com/android/server/am/OWNERS
-per-file SystemServiceRegistry.java = file:/services/core/java/com/android/server/am/OWNERS
-per-file *UserSwitchObserver* = file:/services/core/java/com/android/server/am/OWNERS
+per-file ActivityManager* = file:/ACTIVITY_MANAGER_OWNERS
+per-file Application.java = file:/ACTIVITY_MANAGER_OWNERS
+per-file ApplicationErrorReport* = file:/ACTIVITY_MANAGER_OWNERS
+per-file ApplicationLoaders.java = file:/ACTIVITY_MANAGER_OWNERS
+per-file ApplicationThreadConstants.java = file:/ACTIVITY_MANAGER_OWNERS
+per-file ContentProviderHolder* = file:/ACTIVITY_MANAGER_OWNERS
+per-file *ForegroundService* = file:/ACTIVITY_MANAGER_OWNERS
+per-file IActivityController.aidl = file:/ACTIVITY_MANAGER_OWNERS
+per-file IActivityManager.aidl = file:/ACTIVITY_MANAGER_OWNERS
+per-file IApplicationThread.aidl = file:/ACTIVITY_MANAGER_OWNERS
+per-file IAppTraceRetriever.aidl = file:/ACTIVITY_MANAGER_OWNERS
+per-file IForegroundServiceObserver.aidl = file:/ACTIVITY_MANAGER_OWNERS
+per-file IInstrumentationWatcher.aidl = file:/ACTIVITY_MANAGER_OWNERS
+per-file IntentService.aidl = file:/ACTIVITY_MANAGER_OWNERS
+per-file IServiceConnection.aidl = file:/ACTIVITY_MANAGER_OWNERS
+per-file IStopUserCallback.aidl = file:/ACTIVITY_MANAGER_OWNERS
+per-file IUidObserver.aidl = file:/ACTIVITY_MANAGER_OWNERS
+per-file LoadedApk.java = file:/ACTIVITY_MANAGER_OWNERS
+per-file LocalActivityManager.java = file:/ACTIVITY_MANAGER_OWNERS
+per-file PendingIntent* = file:/ACTIVITY_MANAGER_OWNERS
+per-file *Process* = file:/ACTIVITY_MANAGER_OWNERS
+per-file ProfilerInfo* = file:/ACTIVITY_MANAGER_OWNERS
+per-file Service* = file:/ACTIVITY_MANAGER_OWNERS
+per-file SystemServiceRegistry.java = file:/ACTIVITY_MANAGER_OWNERS
+per-file *UserSwitchObserver* = file:/ACTIVITY_MANAGER_OWNERS
+
+# UI Automation
per-file *UiAutomation* = file:/services/accessibility/OWNERS
per-file *UiAutomation* = file:/core/java/android/permission/OWNERS
+
+# Game Manager
per-file GameManager* = file:/GAME_MANAGER_OWNERS
per-file GameMode* = file:/GAME_MANAGER_OWNERS
per-file GameState* = file:/GAME_MANAGER_OWNERS
per-file IGameManager* = file:/GAME_MANAGER_OWNERS
per-file IGameMode* = file:/GAME_MANAGER_OWNERS
+
+# Background Starts
per-file BackgroundStartPrivileges.java = file:/BAL_OWNERS
per-file activity_manager.aconfig = file:/ACTIVITY_MANAGER_OWNERS
# ActivityThread
-per-file ActivityThread.java = file:/services/core/java/com/android/server/am/OWNERS
+per-file ActivityThread.java = file:/ACTIVITY_MANAGER_OWNERS
per-file ActivityThread.java = file:/services/core/java/com/android/server/wm/OWNERS
per-file ActivityThread.java = file:RESOURCES_OWNERS
# Alarm
-per-file *Alarm* = file:/apex/jobscheduler/OWNERS
+per-file *Alarm* = file:/apex/jobscheduler/ALARM_OWNERS
# AppOps
per-file *AppOp* = file:/core/java/android/permission/OWNERS
@@ -97,6 +101,8 @@ per-file InstantAppResolveInfo.aidl = file:/services/core/java/com/android/serve
# Performance
per-file PropertyInvalidatedCache.java = file:/PERFORMANCE_OWNERS
+per-file *ApplicationStartInfo* = file:/PERFORMANCE_OWNERS
+per-file ApplicationExitInfo* = file:/PERFORMANCE_OWNERS
per-file performance.aconfig = file:/PERFORMANCE_OWNERS
# Pinner
diff --git a/core/java/android/app/PropertyInvalidatedCache.java b/core/java/android/app/PropertyInvalidatedCache.java
index 55296ebbf18e..e4d3baa2f05a 100644
--- a/core/java/android/app/PropertyInvalidatedCache.java
+++ b/core/java/android/app/PropertyInvalidatedCache.java
@@ -233,9 +233,9 @@ public class PropertyInvalidatedCache<Query, Result> {
// This is the initial value of all cache keys. It is changed when a cache is invalidated.
private static final int NONCE_UNSET = 0;
// This value is used in two ways. First, it is used internally to indicate that the cache is
- // disabled for the current query. Secondly, it is used to global disable the cache across the
- // entire system. Once a cache is disabled, there is no way to enable it again. The global
- // behavior is unused and will likely be removed in the future.
+ // disabled for the current query. Secondly, it is used to globally disable the cache across
+ // the entire system. Once a cache is disabled, there is no way to enable it again. The
+ // global behavior is unused and will likely be removed in the future.
private static final int NONCE_DISABLED = 1;
// The cache is corked, which means that clients must act as though the cache is always
// invalid. This is used when the server is processing updates that continuously invalidate
@@ -257,10 +257,22 @@ public class PropertyInvalidatedCache<Query, Result> {
private static final String[] sNonceName =
new String[]{ "unset", "disabled", "corked", "bypass" };
+ // The standard tag for logging.
private static final String TAG = "PropertyInvalidatedCache";
+
+ // Set this true to enable very chatty logging. Never commit this true.
private static final boolean DEBUG = false;
+
+ // Set this true to enable cache verification. On every cache hit, the cache will compare the
+ // cached value to a value pulled directly from the source. This completely negates any
+ // performance advantage of the cache. Enable it only to test if a particular cache is not
+ // being properly invalidated.
private static final boolean VERIFY = false;
+ // The test mode. This is only used to ensure that the test functions setTestMode() and
+ // testPropertyName() are used correctly.
+ private static boolean sTestMode = false;
+
/**
* The object-private lock.
*/
@@ -403,15 +415,56 @@ public class PropertyInvalidatedCache<Query, Result> {
@GuardedBy("mLock")
private int mCorks = 0;
- // The methods to get and set a nonce from whatever storage is being used.
- abstract long getNonce();
- abstract void setNonce(long value);
+ // True if this handler is in test mode. If it is in test mode, then nonces are stored
+ // and retrieved from mTestNonce.
+ @GuardedBy("mLock")
+ private boolean mTestMode = false;
+
+ /**
+ * The local value of the handler, used during testing but also used directly by the
+ * NonceLocal handler.
+ */
+ @GuardedBy("mLock")
+ protected long mTestNonce = NONCE_UNSET;
+
+ /**
+ * The methods to get and set a nonce from whatever storage is being used. mLock may be
+ * held when these methods are called. Implementations that take locks must behave as
+ * though mLock could be held.
+ */
+ abstract long getNonceInternal();
+ abstract void setNonceInternal(long value);
NonceHandler(@NonNull String name) {
mName = name;
}
/**
+ * Get a nonce from storage. If the handler is in test mode, the nonce is returned from
+ * the local mTestNonce.
+ */
+ long getNonce() {
+ synchronized (mLock) {
+ if (mTestMode) return mTestNonce;
+ }
+ return getNonceInternal();
+ }
+
+ /**
+ * Write a nonce to storage. If the handler is in test mode, the nonce is written to the
+ * local mTestNonce and storage is not affected.
+ */
+ void setNonce(long val) {
+ synchronized (mLock) {
+ if (mTestMode) {
+ mTestNonce = val;
+ return;
+ }
+ }
+ setNonceInternal(val);
+ }
+
+ /**
* Write the invalidation nonce for the property.
*/
void invalidate() {
@@ -521,6 +574,10 @@ public class PropertyInvalidatedCache<Query, Result> {
}
}
+ /**
+ * Globally (that is, system-wide) disable all caches that use this key. There is no way
+ * to re-enable these caches.
+ */
void disable() {
if (!sEnabled) {
return;
@@ -530,6 +587,21 @@ public class PropertyInvalidatedCache<Query, Result> {
}
}
+ /**
+ * Put this handler in or out of test mode. Regardless of the current and next mode, the
+ * test nonce variable is reset to UNSET.
+ */
+ void setTestMode(boolean mode) {
+ synchronized (mLock) {
+ mTestMode = mode;
+ mTestNonce = NONCE_UNSET;
+ }
+ }
+
+ /**
+ * Return the statistics associated with the key. These statistics are not associated
+ * with any individual cache.
+ */
record Stats(int invalidated, int corkedInvalidates) {}
Stats getStats() {
synchronized (mLock) {
@@ -549,21 +621,32 @@ public class PropertyInvalidatedCache<Query, Result> {
super(name);
}
+ /**
+ * Retrieve the nonce from the system property. If the handle is null, this method
+ * attempts to create a handle. If handle creation fails, the method returns UNSET. If
+ * the handle is not null, the method returns a value read via the handle. This read
+ * occurs outside any lock.
+ */
@Override
- long getNonce() {
+ long getNonceInternal() {
if (mHandle == null) {
synchronized (mLock) {
- mHandle = SystemProperties.find(mName);
if (mHandle == null) {
- return NONCE_UNSET;
+ mHandle = SystemProperties.find(mName);
+ if (mHandle == null) {
+ return NONCE_UNSET;
+ }
}
}
}
return mHandle.getLong(NONCE_UNSET);
}
+ /**
+ * Write a nonce to a system property.
+ */
@Override
- void setNonce(long value) {
+ void setNonceInternal(long value) {
// Failing to set the nonce is a fatal error. Failures setting a system property have
// been reported; given that the failure is probably transient, this function includes
// a retry.
@@ -600,44 +683,34 @@ public class PropertyInvalidatedCache<Query, Result> {
/**
* SystemProperties and shared storage are protected and cannot be written by random
- * processes. So, for testing purposes, the NonceTest handler stores the nonce locally.
+ * processes. So, for testing purposes, the NonceLocal handler stores the nonce locally. The
+ * NonceLocal uses the mTestNonce in the superclass, regardless of test mode.
*/
- private static class NonceTest extends NonceHandler {
+ private static class NonceLocal extends NonceHandler {
// The saved nonce.
private long mValue;
- // If this flag is false, the handler has been shutdown during a test. Access to the
- // handler in this state is an error.
- private boolean mIsActive = true;
-
- NonceTest(@NonNull String name) {
+ NonceLocal(@NonNull String name) {
super(name);
}
- void shutdown() {
- // The handler has been discarded as part of test cleanup. Further access is an
- // error.
- mIsActive = false;
- }
-
@Override
- long getNonce() {
- if (!mIsActive) {
- throw new IllegalStateException("handler " + mName + " is shutdown");
- }
- return mValue;
+ long getNonceInternal() {
+ return mTestNonce;
}
@Override
- void setNonce(long value) {
- if (!mIsActive) {
- throw new IllegalStateException("handler " + mName + " is shutdown");
- }
- mValue = value;
+ void setNonceInternal(long value) {
+ mTestNonce = value;
}
}
/**
+ * Complete key prefixes.
+ */
+ private static final String PREFIX_TEST = CACHE_KEY_PREFIX + "." + MODULE_TEST + ".";
+
+ /**
* A static list of nonce handlers, indexed by name. NonceHandlers can be safely shared by
* multiple threads, and can therefore be shared by multiple instances of the same cache, and
* with static calls (see {@link #invalidateCache}. Addition and removal are guarded by the
@@ -655,8 +728,8 @@ public class PropertyInvalidatedCache<Query, Result> {
synchronized (sGlobalLock) {
h = sHandlers.get(name);
if (h == null) {
- if (name.startsWith("cache_key.test.")) {
- h = new NonceTest(name);
+ if (name.startsWith(PREFIX_TEST)) {
+ h = new NonceLocal(name);
} else {
h = new NonceSysprop(name);
}
@@ -769,44 +842,55 @@ public class PropertyInvalidatedCache<Query, Result> {
}
/**
- * Enable or disable testing. At this time, no action is taken when testing begins.
+ * Enable or disable testing. The protocol requires that the mode toggle: for instance, it is
+ * illegal to clear the test mode if the test mode is already off. The purpose is solely to
+ * ensure that test clients do not forget to use the test mode properly, even though the
+ * current logic does not care.
* @hide
*/
@TestApi
public static void setTestMode(boolean mode) {
- if (mode) {
- // No action when testing begins.
- } else {
- resetAfterTest();
+ synchronized (sGlobalLock) {
+ if (sTestMode == mode) {
+ throw new IllegalStateException("cannot set test mode redundantly: mode=" + mode);
+ }
+ sTestMode = mode;
+ if (mode) {
+ // No action when testing begins.
+ } else {
+ resetAfterTestLocked();
+ }
}
}
/**
- * Enable testing the specific cache key. This is a legacy API that will be removed as part of
- * b/360897450.
- * @hide
+ * Clean up when testing ends. All handlers are reset out of test mode. NonceLocal handlers
+ * (MODULE_TEST) are reset to the NONCE_UNSET state. This has no effect on any other handlers
+ * that were not originally in test mode.
*/
- @TestApi
- public void testPropertyName() {
+ @GuardedBy("sGlobalLock")
+ private static void resetAfterTestLocked() {
+ for (Iterator<String> e = sHandlers.keys().asIterator(); e.hasNext(); ) {
+ String s = e.next();
+ final NonceHandler h = sHandlers.get(s);
+ h.setTestMode(false);
+ }
}
/**
- * Clean up when testing ends. All NonceTest handlers are erased from the global list and are
- * poisoned, just in case the test program has retained a handle to one of the associated
- * caches.
+ * Enable testing the specific cache key. This API allows a test process to invalidate caches
+ * for which it would not otherwise have permission. Caches in test mode do NOT write their
+ * values to the system properties. The effect is local to the current process. Test mode
+ * must be true when this method is called.
* @hide
*/
- @VisibleForTesting
- public static void resetAfterTest() {
+ @TestApi
+ public void testPropertyName() {
synchronized (sGlobalLock) {
- for (Iterator<String> e = sHandlers.keys().asIterator(); e.hasNext(); ) {
- String s = e.next();
- final NonceHandler h = sHandlers.get(s);
- if (h instanceof NonceTest t) {
- t.shutdown();
- sHandlers.remove(s);
- }
+ if (sTestMode == false) {
+ throw new IllegalStateException("cannot test property name with test mode off");
}
+ mNonce.setTestMode(true);
}
}
@@ -1112,8 +1196,9 @@ public class PropertyInvalidatedCache<Query, Result> {
}
/**
- * Non-static convenience version of invalidateCache() for situations in which only a single
- * PropertyInvalidatedCache is keyed on a particular property value.
+ * Non-static version of invalidateCache() for situations in which a cache instance is
+ * available. This is slightly faster than than the static versions because it does not have
+ * to look up the NonceHandler for a given property name.
* @hide
*/
@TestApi
diff --git a/core/java/android/app/SystemServiceRegistry.java b/core/java/android/app/SystemServiceRegistry.java
index ea4148c8ffa1..bd26db55052b 100644
--- a/core/java/android/app/SystemServiceRegistry.java
+++ b/core/java/android/app/SystemServiceRegistry.java
@@ -76,7 +76,6 @@ import android.companion.virtual.VirtualDeviceManager;
import android.compat.Compatibility;
import android.compat.annotation.ChangeId;
import android.compat.annotation.EnabledAfter;
-import android.compat.annotation.EnabledSince;
import android.content.ClipboardManager;
import android.content.ContentCaptureOptions;
import android.content.Context;
@@ -172,8 +171,7 @@ import android.net.NetworkWatchlistManager;
import android.net.PacProxyManager;
import android.net.TetheringManager;
import android.net.VpnManager;
-import android.net.vcn.IVcnManagementService;
-import android.net.vcn.VcnManager;
+import android.net.vcn.VcnFrameworkInitializer;
import android.net.wifi.WifiFrameworkInitializer;
import android.net.wifi.nl80211.WifiNl80211Manager;
import android.net.wifi.sharedconnectivity.app.SharedConnectivityManager;
@@ -208,7 +206,6 @@ import android.os.ServiceManager;
import android.os.ServiceManager.ServiceNotFoundException;
import android.os.StatsFrameworkInitializer;
import android.os.SystemConfigManager;
-import android.os.SystemProperties;
import android.os.SystemUpdateManager;
import android.os.SystemVibrator;
import android.os.SystemVibratorManager;
@@ -235,8 +232,11 @@ import android.safetycenter.SafetyCenterFrameworkInitializer;
import android.scheduling.SchedulingFrameworkInitializer;
import android.security.FileIntegrityManager;
import android.security.IFileIntegrityService;
+import android.security.advancedprotection.AdvancedProtectionManager;
+import android.security.advancedprotection.IAdvancedProtectionService;
import android.security.attestationverification.AttestationVerificationManager;
import android.security.attestationverification.IAttestationVerificationManagerService;
+import android.security.keystore.KeyStoreManager;
import android.service.oemlock.IOemLockService;
import android.service.oemlock.OemLockManager;
import android.service.persistentdata.IPersistentDataBlockService;
@@ -300,18 +300,6 @@ public final class SystemServiceRegistry {
public static boolean sEnableServiceNotFoundWtf = false;
/**
- * Starting with {@link VANILLA_ICE_CREAM}, Telephony feature flags
- * (e.g. {@link PackageManager#FEATURE_TELEPHONY_SUBSCRIPTION}) are being checked before
- * returning managers that depend on them. If the feature is missing,
- * {@link Context#getSystemService} will return null.
- *
- * This change is specific to VcnManager.
- */
- @ChangeId
- @EnabledSince(targetSdkVersion = Build.VERSION_CODES.VANILLA_ICE_CREAM)
- static final long ENABLE_CHECKING_TELEPHONY_FEATURES_FOR_VCN = 330902016;
-
- /**
* After {@link Build.VERSION_CODES.VANILLA_ICE_CREAM}, Wear devices will be allowed to publish
* no {@link GameManager} instance. This is because the respective system service is no longer
* started for Wear devices given that the applications of the service do not currently apply to
@@ -321,16 +309,6 @@ public final class SystemServiceRegistry {
@EnabledAfter(targetSdkVersion = Build.VERSION_CODES.VANILLA_ICE_CREAM)
static final long NULL_GAME_MANAGER_IN_WEAR = 340929737;
- /**
- * The corresponding vendor API for Android V
- *
- * <p>Starting with Android V, the vendor API format has switched to YYYYMM.
- *
- * @see <a href="https://preview.source.android.com/docs/core/architecture/api-flags">Vendor API
- * level</a>
- */
- private static final int VENDOR_API_FOR_ANDROID_V = 202404;
-
// Service registry information.
// This information is never changed once static initialization has completed.
private static final Map<Class<?>, String> SYSTEM_SERVICE_NAMES =
@@ -497,22 +475,6 @@ public final class SystemServiceRegistry {
return new VpnManager(ctx, service);
}});
- registerService(Context.VCN_MANAGEMENT_SERVICE, VcnManager.class,
- new CachedServiceFetcher<VcnManager>() {
- @Override
- public VcnManager createService(ContextImpl ctx) throws ServiceNotFoundException {
- final String telephonyFeatureToCheck = getVcnFeatureDependency();
-
- if (telephonyFeatureToCheck != null
- && !ctx.getPackageManager().hasSystemFeature(telephonyFeatureToCheck)) {
- return null;
- }
-
- IBinder b = ServiceManager.getService(Context.VCN_MANAGEMENT_SERVICE);
- IVcnManagementService service = IVcnManagementService.Stub.asInterface(b);
- return new VcnManager(ctx, service);
- }});
-
registerService(Context.COUNTRY_DETECTOR, CountryDetector.class,
new StaticServiceFetcher<CountryDetector>() {
@Override
@@ -1744,6 +1706,17 @@ public final class SystemServiceRegistry {
}
});
+ registerService(Context.KEYSTORE_SERVICE, KeyStoreManager.class,
+ new StaticServiceFetcher<KeyStoreManager>() {
+ @Override
+ public KeyStoreManager createService()
+ throws ServiceNotFoundException {
+ if (!android.security.Flags.keystoreGrantApi()) {
+ throw new ServiceNotFoundException("KeyStoreManager is not supported");
+ }
+ return KeyStoreManager.getInstance();
+ }});
+
registerService(Context.CONTACT_KEYS_SERVICE, E2eeContactKeysManager.class,
new CachedServiceFetcher<E2eeContactKeysManager>() {
@Override
@@ -1771,6 +1744,21 @@ public final class SystemServiceRegistry {
return new SupervisionManager(ctx, service);
}
});
+ if (android.security.Flags.aapmApi()) {
+ registerService(Context.ADVANCED_PROTECTION_SERVICE, AdvancedProtectionManager.class,
+ new CachedServiceFetcher<>() {
+ @Override
+ public AdvancedProtectionManager createService(ContextImpl ctx)
+ throws ServiceNotFoundException {
+ IBinder iBinder = ServiceManager.getServiceOrThrow(
+ Context.ADVANCED_PROTECTION_SERVICE);
+ IAdvancedProtectionService service =
+ IAdvancedProtectionService.Stub.asInterface(iBinder);
+ return new AdvancedProtectionManager(service);
+ }
+ });
+ }
+
// DO NOT do a flag check like this unless the flag is read-only.
// (because this code is executed during preload in zygote.)
// If the flag is mutable, the check should be inside CachedServiceFetcher.
@@ -1812,6 +1800,8 @@ public final class SystemServiceRegistry {
OnDevicePersonalizationFrameworkInitializer.registerServiceWrappers();
DeviceLockFrameworkInitializer.registerServiceWrappers();
VirtualizationFrameworkInitializer.registerServiceWrappers();
+ VcnFrameworkInitializer.registerServiceWrappers();
+
if (com.android.server.telecom.flags.Flags.telecomMainlineBlockedNumbersManager()) {
ProviderFrameworkInitializer.registerServiceWrappers();
}
@@ -1873,30 +1863,6 @@ public final class SystemServiceRegistry {
return manager.hasSystemFeature(featureName);
}
- // Suppressing AndroidFrameworkCompatChange because we're querying vendor
- // partition SDK level, not application's target SDK version (which BTW we
- // also check through Compatibility framework a few lines below).
- @SuppressWarnings("AndroidFrameworkCompatChange")
- @Nullable
- private static String getVcnFeatureDependency() {
- // Check SDK version of the client app. Apps targeting pre-V SDK might
- // have not checked for existence of these features.
- if (!Compatibility.isChangeEnabled(ENABLE_CHECKING_TELEPHONY_FEATURES_FOR_VCN)) {
- return null;
- }
-
- // Check SDK version of the vendor partition. Pre-V devices might have
- // incorrectly under-declared telephony features.
- final int vendorApiLevel = SystemProperties.getInt(
- "ro.vendor.api_level", Build.VERSION.DEVICE_INITIAL_SDK_INT);
- if (vendorApiLevel < VENDOR_API_FOR_ANDROID_V) {
- return PackageManager.FEATURE_TELEPHONY;
- } else {
- return PackageManager.FEATURE_TELEPHONY_SUBSCRIPTION;
- }
-
- }
-
/**
* Gets a system service from a given context.
* @hide
diff --git a/core/java/android/content/Context.java b/core/java/android/content/Context.java
index 91f7a8bae163..07106e8359d4 100644
--- a/core/java/android/content/Context.java
+++ b/core/java/android/content/Context.java
@@ -4325,6 +4325,7 @@ public abstract class Context {
//@hide: ECM_ENHANCED_CONFIRMATION_SERVICE,
CONTACT_KEYS_SERVICE,
RANGING_SERVICE,
+ ADVANCED_PROTECTION_SERVICE,
})
@Retention(RetentionPolicy.SOURCE)
@@ -4769,6 +4770,18 @@ public abstract class Context {
/**
* Use with {@link #getSystemService(String)} to retrieve a {@link
+ * android.security.keystore.KeyStoreManager} for accessing
+ * <a href="/privacy-and-security/keystore">Android Keystore</a>
+ * functions.
+ *
+ * @see #getSystemService(String)
+ * @see android.security.keystore.KeyStoreManager
+ */
+ @FlaggedApi(android.security.Flags.FLAG_KEYSTORE_GRANT_API)
+ public static final String KEYSTORE_SERVICE = "keystore";
+
+ /**
+ * Use with {@link #getSystemService(String)} to retrieve a {@link
* android.os.storage.StorageManager} for accessing system storage
* functions.
*
@@ -5658,6 +5671,14 @@ public abstract class Context {
public static final String BINARY_TRANSPARENCY_SERVICE = "transparency";
/**
+ * System service name for ForensicService.
+ * The service manages the forensic info on device.
+ * @hide
+ */
+ @FlaggedApi(android.security.Flags.FLAG_AFL_API)
+ public static final String FORENSIC_SERVICE = "forensic";
+
+ /**
* System service name for the DeviceIdleManager.
* @see #getSystemService(String)
* @hide
@@ -6368,6 +6389,15 @@ public abstract class Context {
/**
* Use with {@link #getSystemService(String)} to retrieve an
+ * {@link android.security.advancedprotection.AdvancedProtectionManager}
+ * @see #getSystemService(String)
+ * @see android.security.advancedprotection.AdvancedProtectionManager
+ */
+ @FlaggedApi(android.security.Flags.FLAG_AAPM_API)
+ public static final String ADVANCED_PROTECTION_SERVICE = "advanced_protection";
+
+ /**
+ * Use with {@link #getSystemService(String)} to retrieve an
* {@link android.security.FileIntegrityManager}.
* @see #getSystemService(String)
* @see android.security.FileIntegrityManager
diff --git a/core/java/android/content/OWNERS b/core/java/android/content/OWNERS
index 6d9dc456f38d..392f62a87302 100644
--- a/core/java/android/content/OWNERS
+++ b/core/java/android/content/OWNERS
@@ -1,11 +1,11 @@
# Remain no owner because multiple modules may touch this file.
per-file Context.java = *
per-file ContextWrapper.java = *
-per-file *Content* = file:/services/core/java/com/android/server/am/OWNERS
-per-file *Sync* = file:/services/core/java/com/android/server/am/OWNERS
+per-file *Content* = varunshah@google.com, yamasani@google.com
+per-file *Sync* = file:/apex/jobscheduler/JOB_OWNERS
per-file IntentFilter.java = file:/PACKAGE_MANAGER_OWNERS
per-file UriRelativeFilter* = file:/PACKAGE_MANAGER_OWNERS
-per-file IntentFilter.java = file:/services/core/java/com/android/server/am/OWNERS
+per-file IntentFilter.java = file:/INTENT_OWNERS
per-file Intent.java = file:/INTENT_OWNERS
per-file AutofillOptions* = file:/core/java/android/service/autofill/OWNERS
per-file ContentCaptureOptions* = file:/core/java/android/service/contentcapture/OWNERS
diff --git a/core/java/android/content/pm/IPackageInstaller.aidl b/core/java/android/content/pm/IPackageInstaller.aidl
index 451c0e5e079a..c911326ccffd 100644
--- a/core/java/android/content/pm/IPackageInstaller.aidl
+++ b/core/java/android/content/pm/IPackageInstaller.aidl
@@ -93,4 +93,10 @@ interface IPackageInstaller {
@JavaPassthrough(annotation="@android.annotation.RequiresPermission(anyOf={android.Manifest.permission.INSTALL_PACKAGES,android.Manifest.permission.REQUEST_INSTALL_PACKAGES})")
void reportUnarchivalStatus(int unarchiveId, int status, long requiredStorageBytes, in PendingIntent userActionIntent, in UserHandle userHandle);
+
+ @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.VERIFICATION_AGENT)")
+ int getVerificationPolicy();
+
+ @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.VERIFICATION_AGENT)")
+ boolean setVerificationPolicy(int policy);
}
diff --git a/core/java/android/content/pm/PackageInstaller.java b/core/java/android/content/pm/PackageInstaller.java
index c673d5846d5d..5da1444ac1db 100644
--- a/core/java/android/content/pm/PackageInstaller.java
+++ b/core/java/android/content/pm/PackageInstaller.java
@@ -62,6 +62,8 @@ import android.content.pm.parsing.PackageLite;
import android.content.pm.parsing.result.ParseResult;
import android.content.pm.parsing.result.ParseTypeImpl;
import android.content.pm.verify.domain.DomainSet;
+import android.content.pm.verify.pkg.VerificationSession;
+import android.content.pm.verify.pkg.VerificationStatus;
import android.graphics.Bitmap;
import android.icu.util.ULocale;
import android.net.Uri;
@@ -418,6 +420,21 @@ public class PackageInstaller {
public static final String EXTRA_WARNINGS = "android.content.pm.extra.WARNINGS";
/**
+ * When verification is blocked as part of the installation, additional reason for the block
+ * will be provided to the installer with a {@link VerificationFailedReason} as part of the
+ * installation result returned via the {@link IntentSender} in
+ * {@link Session#commit(IntentSender)}. This extra is provided only when the installation has
+ * failed. Installers can use this extra to check if the installation failure was caused by a
+ * verification failure.
+ *
+ * @hide
+ */
+ @FlaggedApi(Flags.FLAG_VERIFICATION_SERVICE)
+ @SystemApi
+ public static final String EXTRA_VERIFICATION_FAILURE_REASON =
+ "android.content.pm.extra.VERIFICATION_FAILURE_REASON";
+
+ /**
* Streaming installation pending.
* Caller should make sure DataLoader is able to prepare image and reinitiate the operation.
*
@@ -760,6 +777,90 @@ public class PackageInstaller {
@Retention(RetentionPolicy.SOURCE)
public @interface UnarchivalStatus {}
+ /**
+ * Verification failed because of unknown reasons, such as when the verifier times out or cannot
+ * be connected. It can also corresponds to the status of
+ * {@link VerificationSession#VERIFICATION_INCOMPLETE_UNKNOWN} reported by the verifier via
+ * {@link VerificationSession#reportVerificationIncomplete(int)}.
+ * @hide
+ */
+ @FlaggedApi(Flags.FLAG_VERIFICATION_SERVICE)
+ @SystemApi
+ public static final int VERIFICATION_FAILED_REASON_UNKNOWN = 0;
+
+ /**
+ * Verification failed because the network is unavailable. This corresponds to the status of
+ * {@link VerificationSession#VERIFICATION_INCOMPLETE_NETWORK_UNAVAILABLE} reported by the
+ * verifier via {@link VerificationSession#reportVerificationIncomplete(int)}.
+ *
+ * @hide
+ */
+ @FlaggedApi(Flags.FLAG_VERIFICATION_SERVICE)
+ @SystemApi
+ public static final int VERIFICATION_FAILED_REASON_NETWORK_UNAVAILABLE = 1;
+
+ /**
+ * Verification failed because the package is blocked, as reported by the verifier via
+ * {@link VerificationSession#reportVerificationComplete(VerificationStatus)} or
+ * {@link VerificationSession#reportVerificationComplete(VerificationStatus, PersistableBundle)}
+ * @hide
+ */
+ @FlaggedApi(Flags.FLAG_VERIFICATION_SERVICE)
+ @SystemApi
+ public static final int VERIFICATION_FAILED_REASON_PACKAGE_BLOCKED = 2;
+
+ /**
+ * @hide
+ */
+ @IntDef(value = {
+ VERIFICATION_FAILED_REASON_UNKNOWN,
+ VERIFICATION_FAILED_REASON_NETWORK_UNAVAILABLE,
+ VERIFICATION_FAILED_REASON_PACKAGE_BLOCKED,
+ })
+ public @interface VerificationFailedReason {
+ }
+
+ /**
+ * Do not block installs, regardless of verification status.
+ * @hide
+ */
+ @FlaggedApi(Flags.FLAG_VERIFICATION_SERVICE)
+ @SystemApi
+ public static final int VERIFICATION_POLICY_NONE = 0; // platform default
+ /**
+ * Only block installations on {@link #VERIFICATION_FAILED_REASON_PACKAGE_BLOCKED}.
+ * @hide
+ */
+ @FlaggedApi(Flags.FLAG_VERIFICATION_SERVICE)
+ @SystemApi
+ public static final int VERIFICATION_POLICY_BLOCK_FAIL_OPEN = 1;
+ /**
+ * Only block installations on {@link #VERIFICATION_FAILED_REASON_PACKAGE_BLOCKED} and ask the
+ * user if they'd like to install anyway when the verification is blocked for other reason.
+ * @hide
+ */
+ @FlaggedApi(Flags.FLAG_VERIFICATION_SERVICE)
+ @SystemApi
+ public static final int VERIFICATION_POLICY_BLOCK_FAIL_WARN = 2;
+ /**
+ * Block installations whose verification status is blocked for any reason.
+ * @hide
+ */
+ @FlaggedApi(Flags.FLAG_VERIFICATION_SERVICE)
+ @SystemApi
+ public static final int VERIFICATION_POLICY_BLOCK_FAIL_CLOSED = 3;
+ /**
+ * @hide
+ */
+ @IntDef(value = {
+ VERIFICATION_POLICY_NONE,
+ VERIFICATION_POLICY_BLOCK_FAIL_OPEN,
+ VERIFICATION_POLICY_BLOCK_FAIL_WARN,
+ VERIFICATION_POLICY_BLOCK_FAIL_CLOSED,
+ })
+ @Retention(RetentionPolicy.SOURCE)
+ public @interface VerificationPolicy {
+ }
/** Default set of checksums - includes all available checksums.
* @see Session#requestChecksums */
@@ -1503,6 +1604,40 @@ public class PackageInstaller {
}
/**
+ * Return the current verification enforcement policy. This may only be called by the
+ * package currently set by the system as the verifier agent.
+ * @hide
+ */
+ @FlaggedApi(Flags.FLAG_VERIFICATION_SERVICE)
+ @SystemApi
+ @RequiresPermission(android.Manifest.permission.VERIFICATION_AGENT)
+ public final @VerificationPolicy int getVerificationPolicy() {
+ try {
+ return mInstaller.getVerificationPolicy();
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
+ }
+
+ /**
+ * Set the current verification enforcement policy which will be applied to all the future
+ * installation sessions. This may only be called by the package currently set by the system as
+ * the verifier agent.
+ * @hide
+ * @return whether the new policy was successfully set.
+ */
+ @FlaggedApi(Flags.FLAG_VERIFICATION_SERVICE)
+ @SystemApi
+ @RequiresPermission(android.Manifest.permission.VERIFICATION_AGENT)
+ public final boolean setVerificationPolicy(@VerificationPolicy int policy) {
+ try {
+ return mInstaller.setVerificationPolicy(policy);
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
+ }
+
+ /**
* An installation that is being actively staged. For an install to succeed,
* all existing and new packages must have identical package names, version
* codes, and signing certificates.
@@ -2799,6 +2934,8 @@ public class PackageInstaller {
public int unarchiveId = -1;
/** {@hide} */
public @Nullable String dexoptCompilerFilter = null;
+ /** {@hide} */
+ public boolean forceVerification;
private final ArrayMap<String, Integer> mPermissionStates;
@@ -2853,6 +2990,7 @@ public class PackageInstaller {
developmentInstallFlags = source.readInt();
unarchiveId = source.readInt();
dexoptCompilerFilter = source.readString();
+ forceVerification = source.readBoolean();
}
/** {@hide} */
@@ -2889,6 +3027,7 @@ public class PackageInstaller {
ret.developmentInstallFlags = developmentInstallFlags;
ret.unarchiveId = unarchiveId;
ret.dexoptCompilerFilter = dexoptCompilerFilter;
+ ret.forceVerification = forceVerification;
return ret;
}
@@ -3597,6 +3736,14 @@ public class PackageInstaller {
return grantedPermissions.toArray(ArrayUtils.emptyArray(String.class));
}
+ /**
+ * Used by adb installations to force enable the verification for this install.
+ * {@hide}
+ */
+ public void setForceVerification() {
+ this.forceVerification = true;
+ }
+
/** {@hide} */
public void dump(IndentingPrintWriter pw) {
pw.printPair("mode", mode);
@@ -3632,6 +3779,7 @@ public class PackageInstaller {
pw.printHexPair("developmentInstallFlags", developmentInstallFlags);
pw.printPair("unarchiveId", unarchiveId);
pw.printPair("dexoptCompilerFilter", dexoptCompilerFilter);
+ pw.printPair("forceVerification", forceVerification);
pw.println();
}
@@ -3678,6 +3826,7 @@ public class PackageInstaller {
dest.writeInt(developmentInstallFlags);
dest.writeInt(unarchiveId);
dest.writeString(dexoptCompilerFilter);
+ dest.writeBoolean(forceVerification);
}
public static final Parcelable.Creator<SessionParams>
diff --git a/core/java/android/content/pm/flags.aconfig b/core/java/android/content/pm/flags.aconfig
index 52d733314eb6..5b38942d468d 100644
--- a/core/java/android/content/pm/flags.aconfig
+++ b/core/java/android/content/pm/flags.aconfig
@@ -334,3 +334,11 @@ flag {
bug: "364771256"
is_fixed_read_only: true
}
+
+flag {
+ name: "reduce_broadcasts_for_component_state_changes"
+ namespace: "package_manager_service"
+ description: "Feature flag to limit sending of the PACKAGE_CHANGED broadcast to only the system and the application itself during component state changes."
+ bug: "292261144"
+ is_fixed_read_only: true
+}
diff --git a/core/java/android/content/pm/multiuser.aconfig b/core/java/android/content/pm/multiuser.aconfig
index 7de7131fc2ad..35f9cff1aedb 100644
--- a/core/java/android/content/pm/multiuser.aconfig
+++ b/core/java/android/content/pm/multiuser.aconfig
@@ -211,6 +211,18 @@ flag {
}
flag {
+ name: "property_invalidated_cache_bypass_mismatched_uids"
+ namespace: "multiuser"
+ description: "Bypass the cache when the process UID does not match the binder UID."
+ bug: "373752556"
+ metadata {
+ purpose: PURPOSE_BUGFIX
+ }
+ is_fixed_read_only: true
+}
+
+
+flag {
name: "cache_profile_parent_read_only"
namespace: "multiuser"
description: "Cache getProfileParent to avoid unnecessary binder calls"
@@ -521,3 +533,13 @@ flag {
purpose: PURPOSE_BUGFIX
}
}
+
+flag {
+ name: "ignore_restrictions_when_deleting_private_profile"
+ namespace: "multiuser"
+ description: "Ignore any user restrictions when deleting private profiles."
+ bug: "350953833"
+ metadata {
+ purpose: PURPOSE_BUGFIX
+ }
+}
diff --git a/core/java/android/content/pm/verify/pkg/IVerificationSessionCallback.aidl b/core/java/android/content/pm/verify/pkg/IVerificationSessionCallback.aidl
deleted file mode 100644
index 38a7956603ae..000000000000
--- a/core/java/android/content/pm/verify/pkg/IVerificationSessionCallback.aidl
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright (C) 2024 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.content.pm.verify.pkg;
-
-import android.content.pm.verify.pkg.VerificationStatus;
-import android.os.PersistableBundle;
-
-/**
- * Oneway interface that allows the verifier to send response or verification results back to
- * the system.
- * @hide
- */
-oneway interface IVerificationSessionCallback {
- @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.VERIFICATION_AGENT)")
- void reportVerificationIncomplete(int verificationId, int reason);
- @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.VERIFICATION_AGENT)")
- void reportVerificationComplete(int verificationId, in VerificationStatus status);
- @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.VERIFICATION_AGENT)")
- void reportVerificationCompleteWithExtensionResponse(int verificationId, in VerificationStatus status, in PersistableBundle response);
-}
diff --git a/core/java/android/content/pm/verify/pkg/IVerificationSessionInterface.aidl b/core/java/android/content/pm/verify/pkg/IVerificationSessionInterface.aidl
index 7a9484abd1b1..66caf2d0fec0 100644
--- a/core/java/android/content/pm/verify/pkg/IVerificationSessionInterface.aidl
+++ b/core/java/android/content/pm/verify/pkg/IVerificationSessionInterface.aidl
@@ -16,8 +16,11 @@
package android.content.pm.verify.pkg;
+import android.content.pm.verify.pkg.VerificationStatus;
+import android.os.PersistableBundle;
+
/**
- * Non-oneway interface that allows the verifier to retrieve information from the system.
+ * Non-oneway interface that allows the verifier to communicate with the system.
* @hide
*/
interface IVerificationSessionInterface {
@@ -25,4 +28,12 @@ interface IVerificationSessionInterface {
long getTimeoutTime(int verificationId);
@JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.VERIFICATION_AGENT)")
long extendTimeRemaining(int verificationId, long additionalMs);
+ @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.VERIFICATION_AGENT)")
+ boolean setVerificationPolicy(int verificationId, int policy);
+ @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.VERIFICATION_AGENT)")
+ void reportVerificationIncomplete(int verificationId, int reason);
+ @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.VERIFICATION_AGENT)")
+ void reportVerificationComplete(int verificationId, in VerificationStatus status);
+ @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.VERIFICATION_AGENT)")
+ void reportVerificationCompleteWithExtensionResponse(int verificationId, in VerificationStatus status, in PersistableBundle response);
} \ No newline at end of file
diff --git a/core/java/android/content/pm/verify/pkg/VerificationSession.java b/core/java/android/content/pm/verify/pkg/VerificationSession.java
index 70b4a022f521..4ade21198f37 100644
--- a/core/java/android/content/pm/verify/pkg/VerificationSession.java
+++ b/core/java/android/content/pm/verify/pkg/VerificationSession.java
@@ -22,6 +22,7 @@ import android.annotation.NonNull;
import android.annotation.RequiresPermission;
import android.annotation.SystemApi;
import android.content.pm.Flags;
+import android.content.pm.PackageInstaller;
import android.content.pm.SharedLibraryInfo;
import android.content.pm.SigningInfo;
import android.net.Uri;
@@ -52,17 +53,12 @@ public final class VerificationSession implements Parcelable {
* The verification cannot be completed because the network is unavailable.
*/
public static final int VERIFICATION_INCOMPLETE_NETWORK_UNAVAILABLE = 1;
- /**
- * The verification cannot be completed because the network is limited.
- */
- public static final int VERIFICATION_INCOMPLETE_NETWORK_LIMITED = 2;
/**
* @hide
*/
@IntDef(prefix = {"VERIFICATION_INCOMPLETE_"}, value = {
VERIFICATION_INCOMPLETE_NETWORK_UNAVAILABLE,
- VERIFICATION_INCOMPLETE_NETWORK_LIMITED,
VERIFICATION_INCOMPLETE_UNKNOWN,
})
@Retention(RetentionPolicy.SOURCE)
@@ -83,8 +79,15 @@ public final class VerificationSession implements Parcelable {
private final PersistableBundle mExtensionParams;
@NonNull
private final IVerificationSessionInterface mSession;
- @NonNull
- private final IVerificationSessionCallback mCallback;
+ /**
+ * The current policy that is active for the session. It might not be
+ * the same as the original policy that was initially assigned for this verification session,
+ * because the active policy can be overridden by {@link #setVerificationPolicy(int)}.
+ * <p>To improve the latency, store the original policy value and any changes made to it,
+ * so that {@link #getVerificationPolicy()} does not need to make a binder call to retrieve the
+ * currently active policy.</p>
+ */
+ private volatile @PackageInstaller.VerificationPolicy int mVerificationPolicy;
/**
* Constructor used by the system to describe the details of a verification session.
@@ -94,8 +97,8 @@ public final class VerificationSession implements Parcelable {
@NonNull Uri stagedPackageUri, @NonNull SigningInfo signingInfo,
@NonNull List<SharedLibraryInfo> declaredLibraries,
@NonNull PersistableBundle extensionParams,
- @NonNull IVerificationSessionInterface session,
- @NonNull IVerificationSessionCallback callback) {
+ @PackageInstaller.VerificationPolicy int defaultPolicy,
+ @NonNull IVerificationSessionInterface session) {
mId = id;
mInstallSessionId = installSessionId;
mPackageName = packageName;
@@ -103,8 +106,8 @@ public final class VerificationSession implements Parcelable {
mSigningInfo = signingInfo;
mDeclaredLibraries = declaredLibraries;
mExtensionParams = extensionParams;
+ mVerificationPolicy = defaultPolicy;
mSession = session;
- mCallback = callback;
}
/**
@@ -144,7 +147,7 @@ public final class VerificationSession implements Parcelable {
/**
* Returns a mapping of any shared libraries declared in the manifest
- * to the {@link SharedLibraryInfo#Type} that is declared. This will be an empty
+ * to the {@link SharedLibraryInfo.Type} that is declared. This will be an empty
* map if no shared libraries are declared by the package.
*/
@NonNull
@@ -174,6 +177,39 @@ public final class VerificationSession implements Parcelable {
}
/**
+ * Return the current policy that is active for this session.
+ * <p>If the policy for this session has been changed by {@link #setVerificationPolicy},
+ * the return value of this method is the current policy that is active for this session.
+ * Otherwise, the return value is the same as the initial policy that was assigned to the
+ * session when it was first created.</p>
+ */
+ public @PackageInstaller.VerificationPolicy int getVerificationPolicy() {
+ return mVerificationPolicy;
+ }
+
+ /**
+ * Override the verification policy for this session.
+ * @return True if the override was successful, False otherwise.
+ */
+ @RequiresPermission(android.Manifest.permission.VERIFICATION_AGENT)
+ public boolean setVerificationPolicy(@PackageInstaller.VerificationPolicy int policy) {
+ if (mVerificationPolicy == policy) {
+ // No effective policy change
+ return true;
+ }
+ try {
+ if (mSession.setVerificationPolicy(mId, policy)) {
+ mVerificationPolicy = policy;
+ return true;
+ } else {
+ return false;
+ }
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
+ }
+
+ /**
* Extend the timeout for this session by the provided additionalMs to
* fetch relevant information over the network or wait for the network.
* This may be called multiple times. If the request would bypass any max
@@ -196,7 +232,7 @@ public final class VerificationSession implements Parcelable {
@RequiresPermission(android.Manifest.permission.VERIFICATION_AGENT)
public void reportVerificationIncomplete(@VerificationIncompleteReason int reason) {
try {
- mCallback.reportVerificationIncomplete(mId, reason);
+ mSession.reportVerificationIncomplete(mId, reason);
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
@@ -210,7 +246,7 @@ public final class VerificationSession implements Parcelable {
@RequiresPermission(android.Manifest.permission.VERIFICATION_AGENT)
public void reportVerificationComplete(@NonNull VerificationStatus status) {
try {
- mCallback.reportVerificationComplete(mId, status);
+ mSession.reportVerificationComplete(mId, status);
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
@@ -225,7 +261,7 @@ public final class VerificationSession implements Parcelable {
public void reportVerificationComplete(@NonNull VerificationStatus status,
@NonNull PersistableBundle response) {
try {
- mCallback.reportVerificationCompleteWithExtensionResponse(mId, status, response);
+ mSession.reportVerificationCompleteWithExtensionResponse(mId, status, response);
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
@@ -239,8 +275,8 @@ public final class VerificationSession implements Parcelable {
mSigningInfo = SigningInfo.CREATOR.createFromParcel(in);
mDeclaredLibraries = in.createTypedArrayList(SharedLibraryInfo.CREATOR);
mExtensionParams = in.readPersistableBundle(getClass().getClassLoader());
+ mVerificationPolicy = in.readInt();
mSession = IVerificationSessionInterface.Stub.asInterface(in.readStrongBinder());
- mCallback = IVerificationSessionCallback.Stub.asInterface(in.readStrongBinder());
}
@Override
@@ -257,8 +293,8 @@ public final class VerificationSession implements Parcelable {
mSigningInfo.writeToParcel(dest, flags);
dest.writeTypedList(mDeclaredLibraries);
dest.writePersistableBundle(mExtensionParams);
+ dest.writeInt(mVerificationPolicy);
dest.writeStrongBinder(mSession.asBinder());
- dest.writeStrongBinder(mCallback.asBinder());
}
@NonNull
diff --git a/core/java/android/hardware/DataSpace.java b/core/java/android/hardware/DataSpace.java
index 312bfdf777d6..611738435f7e 100644
--- a/core/java/android/hardware/DataSpace.java
+++ b/core/java/android/hardware/DataSpace.java
@@ -15,9 +15,12 @@
*/
package android.hardware;
+import android.annotation.FlaggedApi;
import android.annotation.IntDef;
import android.view.SurfaceControl;
+import com.android.graphics.flags.Flags;
+
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@@ -639,6 +642,18 @@ public final class DataSpace {
*/
public static final int DATASPACE_SRGB_LINEAR = 138477568;
+ /**
+ * Display BT. 2020 encoding.
+ *
+ * <p>Composed of the following -</p>
+ * <pre>
+ * Primaries: STANDARD_BT2020
+ * Transfer: TRANSFER_SRGB
+ * Range: RANGE_FULL</pre>
+ */
+ @FlaggedApi(Flags.FLAG_DISPLAY_BT2020_COLORSPACE)
+ public static final int DATASPACE_DISPLAY_BT2020 = 142999552;
+
/** @hide */
@Retention(RetentionPolicy.SOURCE)
@IntDef(flag = true, value = {
@@ -660,7 +675,8 @@ public final class DataSpace {
DATASPACE_BT2020,
DATASPACE_BT709,
DATASPACE_DCI_P3,
- DATASPACE_SRGB_LINEAR
+ DATASPACE_SRGB_LINEAR,
+ DATASPACE_DISPLAY_BT2020
})
public @interface NamedDataSpace {};
diff --git a/core/java/android/hardware/HardwareBuffer.java b/core/java/android/hardware/HardwareBuffer.java
index 8c87ad3353b6..93958443c01b 100644
--- a/core/java/android/hardware/HardwareBuffer.java
+++ b/core/java/android/hardware/HardwareBuffer.java
@@ -283,7 +283,7 @@ public final class HardwareBuffer implements Parcelable, AutoCloseable {
private static NativeAllocationRegistry getRegistry(long size) {
final long func = nGetNativeFinalizer();
final Class cls = HardwareBuffer.class;
- return com.android.libcore.Flags.nativeMetrics()
+ return com.android.libcore.readonly.Flags.nativeMetrics()
? NativeAllocationRegistry.createNonmalloced(cls, func, size)
: NativeAllocationRegistry.createNonmalloced(cls.getClassLoader(), func, size);
}
diff --git a/core/java/android/hardware/display/DisplayManager.java b/core/java/android/hardware/display/DisplayManager.java
index 97f6899ff141..b0ea92d140a5 100644
--- a/core/java/android/hardware/display/DisplayManager.java
+++ b/core/java/android/hardware/display/DisplayManager.java
@@ -18,6 +18,7 @@ package android.hardware.display;
import static android.view.Display.DEFAULT_DISPLAY;
import static android.view.Display.HdrCapabilities.HdrType;
+import static android.view.Display.INVALID_DISPLAY;
import android.Manifest;
import android.annotation.FlaggedApi;
@@ -47,6 +48,7 @@ import android.os.Looper;
import android.os.Process;
import android.os.RemoteException;
import android.os.ServiceManager;
+import android.os.UserManager;
import android.util.Log;
import android.util.Pair;
import android.util.Slog;
@@ -96,6 +98,8 @@ public final class DisplayManager {
@GuardedBy("mLock")
private final WeakDisplayCache mDisplayCache = new WeakDisplayCache();
+ private int mDisplayIdToMirror = INVALID_DISPLAY;
+
/**
* Broadcast receiver that indicates when the Wifi display status changes.
* <p>
@@ -1086,6 +1090,7 @@ public final class DisplayManager {
if (surface != null) {
builder.setSurface(surface);
}
+ builder.setDisplayIdToMirror(getDisplayIdToMirror());
return createVirtualDisplay(builder.build(), handler, callback);
}
@@ -1163,6 +1168,7 @@ public final class DisplayManager {
if (surface != null) {
builder.setSurface(surface);
}
+ builder.setDisplayIdToMirror(getDisplayIdToMirror());
return createVirtualDisplay(projection, builder.build(), callback, handler);
}
@@ -1708,6 +1714,16 @@ public final class DisplayManager {
return mGlobal.getDefaultDozeBrightness(displayId);
}
+ private int getDisplayIdToMirror() {
+ if (mDisplayIdToMirror == INVALID_DISPLAY) {
+ final UserManager userManager = mContext.getSystemService(UserManager.class);
+ mDisplayIdToMirror = userManager.isVisibleBackgroundUsersSupported()
+ ? userManager.getMainDisplayIdAssignedToUser()
+ : DEFAULT_DISPLAY;
+ }
+ return mDisplayIdToMirror;
+ }
+
/**
* Listens for changes in available display devices.
*/
diff --git a/core/java/android/hardware/input/input_framework.aconfig b/core/java/android/hardware/input/input_framework.aconfig
index f03a4a954842..66697546a24a 100644
--- a/core/java/android/hardware/input/input_framework.aconfig
+++ b/core/java/android/hardware/input/input_framework.aconfig
@@ -27,14 +27,6 @@ flag {
flag {
namespace: "input_native"
- name: "pointer_coords_is_resampled_api"
- is_exported: true
- description: "Makes MotionEvent.PointerCoords#isResampled() a public API"
- bug: "298197511"
-}
-
-flag {
- namespace: "input_native"
name: "emoji_and_screenshot_keycodes_available"
is_exported: true
description: "Add new KeyEvent keycodes for opening Emoji Picker and Taking Screenshots"
diff --git a/core/java/android/hardware/radio/RadioAlert.java b/core/java/android/hardware/radio/RadioAlert.java
index b55dcd82ef7b..9b93e73555f0 100644
--- a/core/java/android/hardware/radio/RadioAlert.java
+++ b/core/java/android/hardware/radio/RadioAlert.java
@@ -332,6 +332,7 @@ public final class RadioAlert implements Parcelable {
private final int mCertainty;
private final String mTextualMessage;
private final List<AlertArea> mAreaList;
+ @Nullable private final String mLanguage;
/**
* Constructor for alert info.
@@ -343,17 +344,19 @@ public final class RadioAlert implements Parcelable {
* @param textualMessage Textual descriptions of the subject event
* @param areaList The array of geographic areas to which the alert info segment in which
* it appears applies
+ * @param language The optional language field of the alert info
* @hide
*/
public AlertInfo(@NonNull List<Integer> categoryList, int urgency,
- int severity, int certainty,
- String textualMessage, @NonNull List<AlertArea> areaList) {
+ int severity, int certainty, String textualMessage,
+ @NonNull List<AlertArea> areaList, @Nullable String language) {
mCategoryList = Objects.requireNonNull(categoryList, "Category list can not be null");
mUrgency = urgency;
mSeverity = severity;
mCertainty = certainty;
mTextualMessage = textualMessage;
mAreaList = Objects.requireNonNull(areaList, "Area list can not be null");
+ mLanguage = language;
}
private AlertInfo(Parcel in) {
@@ -364,6 +367,12 @@ public final class RadioAlert implements Parcelable {
mTextualMessage = in.readString8();
mAreaList = new ArrayList<>();
in.readTypedList(mAreaList, AlertArea.CREATOR);
+ boolean hasLanguage = in.readBoolean();
+ if (hasLanguage) {
+ mLanguage = in.readString8();
+ } else {
+ mLanguage = null;
+ }
}
public static final @NonNull Creator<AlertInfo> CREATOR = new Creator<AlertInfo>() {
@@ -391,6 +400,12 @@ public final class RadioAlert implements Parcelable {
dest.writeInt(mCertainty);
dest.writeString8(mTextualMessage);
dest.writeTypedList(mAreaList);
+ if (mLanguage == null) {
+ dest.writeBoolean(false);
+ } else {
+ dest.writeBoolean(true);
+ dest.writeString8(mLanguage);
+ }
}
@NonNull
@@ -398,13 +413,14 @@ public final class RadioAlert implements Parcelable {
public String toString() {
return "AlertInfo [categoryList=" + mCategoryList + ", urgency=" + mUrgency
+ ", severity=" + mSeverity + ", certainty=" + mCertainty
- + ", textualMessage=" + mTextualMessage + ", areaList=" + mAreaList + "]";
+ + ", textualMessage=" + mTextualMessage + ", areaList=" + mAreaList
+ + ", language=" + mLanguage + "]";
}
@Override
public int hashCode() {
return Objects.hash(mCategoryList, mUrgency, mSeverity, mCertainty, mTextualMessage,
- mAreaList);
+ mAreaList, mLanguage);
}
@Override
@@ -419,14 +435,14 @@ public final class RadioAlert implements Parcelable {
return mCategoryList.equals(other.mCategoryList) && mUrgency == other.mUrgency
&& mSeverity == other.mSeverity && mCertainty == other.mCertainty
&& mTextualMessage.equals(other.mTextualMessage)
- && mAreaList.equals(other.mAreaList);
+ && mAreaList.equals(other.mAreaList)
+ && Objects.equals(mLanguage, other.mLanguage);
}
}
private final int mStatus;
private final int mMessageType;
private final List<AlertInfo> mInfoList;
- private final int mScope;
/**
* Constructor of radio alert message.
@@ -434,15 +450,13 @@ public final class RadioAlert implements Parcelable {
* @param status Status of alert message
* @param messageType Message type of alert message
* @param infoList List of alert info
- * @param scope Scope of alert message
* @hide
*/
public RadioAlert(int status, int messageType,
- @NonNull List<AlertInfo> infoList, int scope) {
+ @NonNull List<AlertInfo> infoList) {
mStatus = status;
mMessageType = messageType;
mInfoList = Objects.requireNonNull(infoList, "Alert info list can not be null");
- mScope = scope;
}
private RadioAlert(Parcel in) {
@@ -450,7 +464,6 @@ public final class RadioAlert implements Parcelable {
mMessageType = in.readInt();
mInfoList = in.readParcelableList(new ArrayList<>(), AlertInfo.class.getClassLoader(),
AlertInfo.class);
- mScope = in.readInt();
}
@Override
@@ -458,7 +471,6 @@ public final class RadioAlert implements Parcelable {
dest.writeInt(mStatus);
dest.writeInt(mMessageType);
dest.writeParcelableList(mInfoList, /* flags= */ 0);
- dest.writeInt(mScope);
}
@Override
@@ -470,12 +482,12 @@ public final class RadioAlert implements Parcelable {
@Override
public String toString() {
return "RadioAlert [status=" + mStatus + ", messageType=" + mMessageType
- + ", infoList= " + mInfoList + ", scope=" + mScope + "]";
+ + ", infoList= " + mInfoList + "]";
}
@Override
public int hashCode() {
- return Objects.hash(mStatus, mMessageType, mInfoList, mScope);
+ return Objects.hash(mStatus, mMessageType, mInfoList);
}
@Override
@@ -488,7 +500,7 @@ public final class RadioAlert implements Parcelable {
}
return mStatus == other.mStatus && mMessageType == other.mMessageType
- && mInfoList.equals(other.mInfoList) && mScope == other.mScope;
+ && mInfoList.equals(other.mInfoList);
}
public static final @NonNull Creator<RadioAlert> CREATOR = new Creator<RadioAlert>() {
diff --git a/core/java/android/net/vcn/VcnFrameworkInitializer.java b/core/java/android/net/vcn/VcnFrameworkInitializer.java
new file mode 100644
index 000000000000..8cb213b306be
--- /dev/null
+++ b/core/java/android/net/vcn/VcnFrameworkInitializer.java
@@ -0,0 +1,106 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.net.vcn;
+
+import android.annotation.Nullable;
+import android.app.SystemServiceRegistry;
+import android.compat.Compatibility;
+import android.compat.annotation.ChangeId;
+import android.compat.annotation.EnabledSince;
+import android.content.Context;
+import android.content.pm.PackageManager;
+import android.os.Build;
+import android.os.SystemProperties;
+
+/**
+ * Class for performing registration for VCN service.
+ *
+ * @hide
+ */
+// TODO: Expose it as @SystemApi(client = MODULE_LIBRARIES)
+public final class VcnFrameworkInitializer {
+ /**
+ * Starting with {@link VANILLA_ICE_CREAM}, Telephony feature flags (e.g. {@link
+ * PackageManager#FEATURE_TELEPHONY_SUBSCRIPTION}) are being checked before returning managers
+ * that depend on them. If the feature is missing, {@link Context#getSystemService} will return
+ * null.
+ *
+ * <p>This change is specific to VcnManager.
+ */
+ @ChangeId
+ @EnabledSince(targetSdkVersion = Build.VERSION_CODES.VANILLA_ICE_CREAM)
+ private static final long ENABLE_CHECKING_TELEPHONY_FEATURES_FOR_VCN = 330902016;
+
+ /**
+ * The corresponding vendor API for Android V
+ *
+ * <p>Starting with Android V, the vendor API format has switched to YYYYMM.
+ *
+ * @see <a href="https://preview.source.android.com/docs/core/architecture/api-flags">Vendor API
+ * level</a>
+ */
+ private static final int VENDOR_API_FOR_ANDROID_V = 202404;
+
+ private VcnFrameworkInitializer() {}
+
+ // Suppressing AndroidFrameworkCompatChange because we're querying vendor
+ // partition SDK level, not application's target SDK version (which BTW we
+ // also check through Compatibility framework a few lines below).
+ @Nullable
+ private static String getVcnFeatureDependency() {
+ // Check SDK version of the client app. Apps targeting pre-V SDK might
+ // have not checked for existence of these features.
+ if (!Compatibility.isChangeEnabled(ENABLE_CHECKING_TELEPHONY_FEATURES_FOR_VCN)) {
+ return null;
+ }
+
+ // Check SDK version of the vendor partition. Pre-V devices might have
+ // incorrectly under-declared telephony features.
+ final int vendorApiLevel =
+ SystemProperties.getInt(
+ "ro.vendor.api_level", Build.VERSION.DEVICE_INITIAL_SDK_INT);
+ if (vendorApiLevel < VENDOR_API_FOR_ANDROID_V) {
+ return PackageManager.FEATURE_TELEPHONY;
+ } else {
+ return PackageManager.FEATURE_TELEPHONY_SUBSCRIPTION;
+ }
+ }
+
+ /**
+ * Register VCN service to {@link Context}, so that {@link Context#getSystemService} can return
+ * a VcnManager.
+ *
+ * @throws IllegalStateException if this is called anywhere besides {@link
+ * SystemServiceRegistry}.
+ */
+ public static void registerServiceWrappers() {
+ SystemServiceRegistry.registerContextAwareService(
+ VcnManager.VCN_MANAGEMENT_SERVICE_STRING,
+ VcnManager.class,
+ (context, serviceBinder) -> {
+ final String telephonyFeatureToCheck = getVcnFeatureDependency();
+ if (telephonyFeatureToCheck != null
+ && !context.getPackageManager()
+ .hasSystemFeature(telephonyFeatureToCheck)) {
+ return null;
+ }
+ IVcnManagementService service =
+ IVcnManagementService.Stub.asInterface(serviceBinder);
+ return new VcnManager(context, service);
+ });
+ }
+}
diff --git a/core/java/android/net/vcn/flags.aconfig b/core/java/android/net/vcn/flags.aconfig
index efddd1f9fc6f..5b306243fc36 100644
--- a/core/java/android/net/vcn/flags.aconfig
+++ b/core/java/android/net/vcn/flags.aconfig
@@ -14,11 +14,4 @@ flag {
namespace: "vcn"
description: "Feature flag for adjustable safe mode timeout"
bug: "317406085"
-}
-
-flag{
- name: "network_metric_monitor"
- namespace: "vcn"
- description: "Feature flag for enabling network metric monitor"
- bug: "282996138"
} \ No newline at end of file
diff --git a/core/java/android/os/BatteryUsageStats.java b/core/java/android/os/BatteryUsageStats.java
index a698b9d97215..ddcb5c60ab80 100644
--- a/core/java/android/os/BatteryUsageStats.java
+++ b/core/java/android/os/BatteryUsageStats.java
@@ -1031,7 +1031,10 @@ public final class BatteryUsageStats implements Parcelable, Closeable {
return this;
}
- private long getStatsDuration() {
+ /**
+ * Returns the duration of the battery session reflected by these stats.
+ */
+ public long getStatsDuration() {
if (mStatsDurationMs != -1) {
return mStatsDurationMs;
} else {
diff --git a/core/java/android/os/BatteryUsageStatsQuery.java b/core/java/android/os/BatteryUsageStatsQuery.java
index b533225192ba..e68c4ca5c070 100644
--- a/core/java/android/os/BatteryUsageStatsQuery.java
+++ b/core/java/android/os/BatteryUsageStatsQuery.java
@@ -20,6 +20,8 @@ import android.annotation.IntDef;
import android.annotation.NonNull;
import android.util.IntArray;
+import com.android.internal.os.MonotonicClock;
+
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@@ -85,8 +87,11 @@ public final class BatteryUsageStatsQuery implements Parcelable {
@NonNull
private final int[] mUserIds;
private final long mMaxStatsAgeMs;
- private final long mFromTimestamp;
- private final long mToTimestamp;
+
+ private final long mAggregatedFromTimestamp;
+ private final long mAggregatedToTimestamp;
+ private long mMonotonicStartTime;
+ private long mMonotonicEndTime;
private final double mMinConsumedPowerThreshold;
private final @BatteryConsumer.PowerComponentId int[] mPowerComponents;
@@ -96,8 +101,10 @@ public final class BatteryUsageStatsQuery implements Parcelable {
: new int[]{UserHandle.USER_ALL};
mMaxStatsAgeMs = builder.mMaxStatsAgeMs;
mMinConsumedPowerThreshold = builder.mMinConsumedPowerThreshold;
- mFromTimestamp = builder.mFromTimestamp;
- mToTimestamp = builder.mToTimestamp;
+ mAggregatedFromTimestamp = builder.mAggregateFromTimestamp;
+ mAggregatedToTimestamp = builder.mAggregateToTimestamp;
+ mMonotonicStartTime = builder.mMonotonicStartTime;
+ mMonotonicEndTime = builder.mMonotonicEndTime;
mPowerComponents = builder.mPowerComponents;
}
@@ -163,11 +170,27 @@ public final class BatteryUsageStatsQuery implements Parcelable {
}
/**
+ * Returns the exclusive lower bound of the battery history that should be included in
+ * the aggregated battery usage stats.
+ */
+ public long getMonotonicStartTime() {
+ return mMonotonicStartTime;
+ }
+
+ /**
+ * Returns the inclusive upper bound of the battery history that should be included in
+ * the aggregated battery usage stats.
+ */
+ public long getMonotonicEndTime() {
+ return mMonotonicEndTime;
+ }
+
+ /**
* Returns the exclusive lower bound of the stored snapshot timestamps that should be included
- * in the aggregation. Ignored if {@link #getToTimestamp()} is zero.
+ * in the aggregation. Ignored if {@link #getAggregatedToTimestamp()} is zero.
*/
- public long getFromTimestamp() {
- return mFromTimestamp;
+ public long getAggregatedFromTimestamp() {
+ return mAggregatedFromTimestamp;
}
/**
@@ -175,8 +198,8 @@ public final class BatteryUsageStatsQuery implements Parcelable {
* be included in the aggregation. The default is to include only the current stats
* accumulated since the latest battery reset.
*/
- public long getToTimestamp() {
- return mToTimestamp;
+ public long getAggregatedToTimestamp() {
+ return mAggregatedToTimestamp;
}
private BatteryUsageStatsQuery(Parcel in) {
@@ -185,8 +208,8 @@ public final class BatteryUsageStatsQuery implements Parcelable {
in.readIntArray(mUserIds);
mMaxStatsAgeMs = in.readLong();
mMinConsumedPowerThreshold = in.readDouble();
- mFromTimestamp = in.readLong();
- mToTimestamp = in.readLong();
+ mAggregatedFromTimestamp = in.readLong();
+ mAggregatedToTimestamp = in.readLong();
mPowerComponents = in.createIntArray();
}
@@ -197,8 +220,8 @@ public final class BatteryUsageStatsQuery implements Parcelable {
dest.writeIntArray(mUserIds);
dest.writeLong(mMaxStatsAgeMs);
dest.writeDouble(mMinConsumedPowerThreshold);
- dest.writeLong(mFromTimestamp);
- dest.writeLong(mToTimestamp);
+ dest.writeLong(mAggregatedFromTimestamp);
+ dest.writeLong(mAggregatedToTimestamp);
dest.writeIntArray(mPowerComponents);
}
@@ -228,8 +251,10 @@ public final class BatteryUsageStatsQuery implements Parcelable {
private int mFlags;
private IntArray mUserIds;
private long mMaxStatsAgeMs = DEFAULT_MAX_STATS_AGE_MS;
- private long mFromTimestamp;
- private long mToTimestamp;
+ private long mMonotonicStartTime = MonotonicClock.UNDEFINED;
+ private long mMonotonicEndTime = MonotonicClock.UNDEFINED;
+ private long mAggregateFromTimestamp;
+ private long mAggregateToTimestamp;
private double mMinConsumedPowerThreshold = 0;
private @BatteryConsumer.PowerComponentId int[] mPowerComponents;
@@ -241,6 +266,17 @@ public final class BatteryUsageStatsQuery implements Parcelable {
}
/**
+ * Specifies the time range for the requested stats, in terms of MonotonicClock
+ * @param monotonicStartTime Inclusive starting monotonic timestamp
+ * @param monotonicEndTime Exclusive ending timestamp. Can be MonotonicClock.UNDEFINED
+ */
+ public Builder monotonicTimeRange(long monotonicStartTime, long monotonicEndTime) {
+ mMonotonicStartTime = monotonicStartTime;
+ mMonotonicEndTime = monotonicEndTime;
+ return this;
+ }
+
+ /**
* Add a user whose battery stats should be included in the battery usage stats.
* {@link UserHandle#USER_ALL} will be used by default if no users are added explicitly.
*/
@@ -345,8 +381,8 @@ public final class BatteryUsageStatsQuery implements Parcelable {
*/
// TODO(b/298459065): switch to monotonic clock
public Builder aggregateSnapshots(long fromTimestamp, long toTimestamp) {
- mFromTimestamp = fromTimestamp;
- mToTimestamp = toTimestamp;
+ mAggregateFromTimestamp = fromTimestamp;
+ mAggregateToTimestamp = toTimestamp;
return this;
}
diff --git a/core/java/android/os/ConcurrentMessageQueue/MessageQueue.java b/core/java/android/os/ConcurrentMessageQueue/MessageQueue.java
index b2d926044869..6afb8e097121 100644
--- a/core/java/android/os/ConcurrentMessageQueue/MessageQueue.java
+++ b/core/java/android/os/ConcurrentMessageQueue/MessageQueue.java
@@ -754,7 +754,7 @@ public final class MessageQueue {
// Idle handles only run if the queue is empty or if the first message
// in the queue (possibly a barrier) is due to be handled in the future.
if (pendingIdleHandlerCount < 0
- && mNextPollTimeoutMillis != 0) {
+ && isIdle()) {
pendingIdleHandlerCount = mIdleHandlers.size();
}
if (pendingIdleHandlerCount <= 0) {
diff --git a/core/java/android/os/GraphicsEnvironment.java b/core/java/android/os/GraphicsEnvironment.java
index 2d3dd1b9383b..94768d111ca4 100644
--- a/core/java/android/os/GraphicsEnvironment.java
+++ b/core/java/android/os/GraphicsEnvironment.java
@@ -32,6 +32,8 @@ import android.text.TextUtils;
import android.util.Log;
import android.widget.Toast;
+import com.android.internal.R;
+
import dalvik.system.VMRuntime;
import java.io.BufferedReader;
@@ -174,19 +176,6 @@ public class GraphicsEnvironment {
nativeToggleAngleAsSystemDriver(enabled);
}
- /**
- * Query to determine the ANGLE driver choice.
- */
- private String queryAngleChoice(Context context, Bundle coreSettings,
- String packageName) {
- if (TextUtils.isEmpty(packageName)) {
- Log.v(TAG, "No package name specified; use the system driver");
- return ANGLE_GL_DRIVER_CHOICE_DEFAULT;
- }
-
- return queryAngleChoiceInternal(context, coreSettings, packageName);
- }
-
private int getVulkanVersion(PackageManager pm) {
// PackageManager doesn't have an API to retrieve the version of a specific feature, and we
// need to avoid retrieving all system features here and looping through them.
@@ -403,11 +392,13 @@ public class GraphicsEnvironment {
* Settings.Global.ANGLE_GL_DRIVER_SELECTION_VALUES; which corresponds to the
* “angle_gl_driver_selection_pkgs” and “angle_gl_driver_selection_values” settings); if it
* forces a choice.
+ * 3) The per-application ANGLE allowlist contained in the platform. This is an array of
+ * strings containing package names that should use ANGLE.
*/
- private String queryAngleChoiceInternal(Context context, Bundle bundle,
- String packageName) {
+ private String queryAngleChoice(Context context, Bundle bundle, String packageName) {
// Make sure we have a good package name
if (TextUtils.isEmpty(packageName)) {
+ Log.v(TAG, "No package name specified; use the system driver");
return ANGLE_GL_DRIVER_CHOICE_DEFAULT;
}
@@ -436,8 +427,8 @@ public class GraphicsEnvironment {
Log.v(TAG, " angle_gl_driver_selection_pkgs=" + optInPackages);
Log.v(TAG, " angle_gl_driver_selection_values=" + optInValues);
- // Make sure we have good settings to use
- if (optInPackages.size() == 0 || optInPackages.size() != optInValues.size()) {
+ // Make sure we have valid settings, if any provided
+ if (optInPackages.size() != optInValues.size()) {
Log.v(TAG,
"Global.Settings values are invalid: "
+ "number of packages: "
@@ -449,24 +440,53 @@ public class GraphicsEnvironment {
// See if this application is listed in the per-application settings list
final int pkgIndex = getPackageIndex(packageName, optInPackages);
-
- if (pkgIndex < 0) {
- Log.v(TAG, packageName + " is not listed in per-application setting");
- return ANGLE_GL_DRIVER_CHOICE_DEFAULT;
+ if (pkgIndex >= 0) {
+ mAngleOptInIndex = pkgIndex;
+
+ // The application IS listed in the per-application settings list; and so use the
+ // setting--choosing the current system driver if the setting is "default"
+ String optInValue = optInValues.get(pkgIndex);
+ Log.v(
+ TAG,
+ "ANGLE Developer option for '"
+ + packageName
+ + "' "
+ + "set to: '"
+ + optInValue
+ + "'");
+ if (optInValue.equals(ANGLE_GL_DRIVER_CHOICE_ANGLE)) {
+ return ANGLE_GL_DRIVER_CHOICE_ANGLE;
+ } else if (optInValue.equals(ANGLE_GL_DRIVER_CHOICE_NATIVE)) {
+ return ANGLE_GL_DRIVER_CHOICE_NATIVE;
+ }
}
- mAngleOptInIndex = pkgIndex;
- // The application IS listed in the per-application settings list; and so use the
- // setting--choosing the current system driver if the setting is "default"
- String optInValue = optInValues.get(pkgIndex);
- Log.v(TAG,
- "ANGLE Developer option for '" + packageName + "' "
- + "set to: '" + optInValue + "'");
- if (optInValue.equals(ANGLE_GL_DRIVER_CHOICE_ANGLE)) {
- return ANGLE_GL_DRIVER_CHOICE_ANGLE;
- } else if (optInValue.equals(ANGLE_GL_DRIVER_CHOICE_NATIVE)) {
- return ANGLE_GL_DRIVER_CHOICE_NATIVE;
+ Log.v(TAG, packageName + " is not listed in per-application setting");
+
+ // Check the per-device allowlist shipped in the platform
+ if (android.os.Flags.enableAngleAllowList()) {
+ String[] angleAllowListPackages =
+ context.getResources().getStringArray(R.array.config_angleAllowList);
+
+ String allowListPackageList = String.join(" ", angleAllowListPackages);
+ Log.v(TAG, "ANGLE allowlist from config: " + allowListPackageList);
+
+ for (String allowedPackage : angleAllowListPackages) {
+ if (allowedPackage.equals(packageName)) {
+ Log.v(
+ TAG,
+ "Package name "
+ + packageName
+ + " is listed in config_angleAllowList, enabling ANGLE");
+ return ANGLE_GL_DRIVER_CHOICE_ANGLE;
+ }
+ }
+ Log.v(
+ TAG,
+ packageName
+ + " is not listed in ANGLE allowlist or settings, returning default");
}
+
// The user either chose default or an invalid value; go with the default driver.
return ANGLE_GL_DRIVER_CHOICE_DEFAULT;
}
diff --git a/core/java/android/os/OWNERS b/core/java/android/os/OWNERS
index a1b75034442e..590ddb404b63 100644
--- a/core/java/android/os/OWNERS
+++ b/core/java/android/os/OWNERS
@@ -122,3 +122,6 @@ per-file StatsBootstrapAtom.aidl = file:/services/core/java/com/android/server/s
per-file StatsBootstrapAtomValue.aidl = file:/services/core/java/com/android/server/stats/OWNERS
per-file StatsBootstrapAtomService.java = file:/services/core/java/com/android/server/stats/OWNERS
per-file StatsServiceManager.java = file:/services/core/java/com/android/server/stats/OWNERS
+
+# Dropbox
+per-file DropBoxManager* = mwachens@google.com
diff --git a/core/java/android/os/RemoteCallbackList.java b/core/java/android/os/RemoteCallbackList.java
index 769cbdd9886d..f82c8221e4f9 100644
--- a/core/java/android/os/RemoteCallbackList.java
+++ b/core/java/android/os/RemoteCallbackList.java
@@ -16,11 +16,18 @@
package android.os;
+import android.annotation.FlaggedApi;
+import android.annotation.IntDef;
+import android.annotation.NonNull;
import android.compat.annotation.UnsupportedAppUsage;
import android.util.ArrayMap;
import android.util.Slog;
import java.io.PrintWriter;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.util.Queue;
+import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
@@ -30,7 +37,7 @@ import java.util.function.Consumer;
* {@link android.app.Service} to its clients. In particular, this:
*
* <ul>
- * <li> Keeps track of a set of registered {@link IInterface} callbacks,
+ * <li> Keeps track of a set of registered {@link IInterface} objects,
* taking care to identify them through their underlying unique {@link IBinder}
* (by calling {@link IInterface#asBinder IInterface.asBinder()}.
* <li> Attaches a {@link IBinder.DeathRecipient IBinder.DeathRecipient} to
@@ -47,7 +54,7 @@ import java.util.function.Consumer;
* the registered clients, use {@link #beginBroadcast},
* {@link #getBroadcastItem}, and {@link #finishBroadcast}.
*
- * <p>If a registered callback's process goes away, this class will take
+ * <p>If a registered interface's process goes away, this class will take
* care of automatically removing it from the list. If you want to do
* additional work in this situation, you can create a subclass that
* implements the {@link #onCallbackDied} method.
@@ -56,78 +63,310 @@ import java.util.function.Consumer;
public class RemoteCallbackList<E extends IInterface> {
private static final String TAG = "RemoteCallbackList";
+ private static final int DEFAULT_MAX_QUEUE_SIZE = 1000;
+
+
+ /**
+ * @hide
+ */
+ @IntDef(prefix = {"FROZEN_CALLEE_POLICY_"}, value = {
+ FROZEN_CALLEE_POLICY_UNSET,
+ FROZEN_CALLEE_POLICY_ENQUEUE_ALL,
+ FROZEN_CALLEE_POLICY_ENQUEUE_MOST_RECENT,
+ FROZEN_CALLEE_POLICY_DROP,
+ })
+ @Retention(RetentionPolicy.SOURCE)
+ @interface FrozenCalleePolicy {
+ }
+
+ /**
+ * Callbacks are invoked immediately regardless of the frozen state of the target process.
+ *
+ * Not recommended. Only exists for backward-compatibility. This represents the behavior up to
+ * SDK 35. Starting with SDK 36, clients should set a policy to govern callback invocations when
+ * recipients are frozen.
+ */
+ @FlaggedApi(Flags.FLAG_BINDER_FROZEN_STATE_CHANGE_CALLBACK)
+ public static final int FROZEN_CALLEE_POLICY_UNSET = 0;
+
+ /**
+ * When the callback recipient's process is frozen, callbacks are enqueued so they're invoked
+ * after the recipient is unfrozen.
+ *
+ * This is commonly used when the recipient wants to receive all callbacks without losing any
+ * history, e.g. the recipient maintains a running count of events that occurred.
+ *
+ * Queued callbacks are invoked in the order they were originally broadcasted.
+ */
+ @FlaggedApi(Flags.FLAG_BINDER_FROZEN_STATE_CHANGE_CALLBACK)
+ public static final int FROZEN_CALLEE_POLICY_ENQUEUE_ALL = 1;
+
+ /**
+ * When the callback recipient's process is frozen, only the most recent callback is enqueued,
+ * which is later invoked after the recipient is unfrozen.
+ *
+ * This can be used when only the most recent state matters, for instance when clients are
+ * listening to screen brightness changes.
+ */
+ @FlaggedApi(Flags.FLAG_BINDER_FROZEN_STATE_CHANGE_CALLBACK)
+ public static final int FROZEN_CALLEE_POLICY_ENQUEUE_MOST_RECENT = 2;
+
+ /**
+ * When the callback recipient's process is frozen, callbacks are suppressed as if they never
+ * happened.
+ *
+ * This could be useful in the case where the recipient wishes to react to callbacks only when
+ * they occur while the recipient is not frozen. For example, certain network events are only
+ * worth responding to if the response can be immediate. Another example is recipients having
+ * another way of getting the latest state once it's unfrozen. Therefore there is no need to
+ * save callbacks that happened while the recipient was frozen.
+ */
+ @FlaggedApi(Flags.FLAG_BINDER_FROZEN_STATE_CHANGE_CALLBACK)
+ public static final int FROZEN_CALLEE_POLICY_DROP = 3;
+
@UnsupportedAppUsage
- /*package*/ ArrayMap<IBinder, Callback> mCallbacks
- = new ArrayMap<IBinder, Callback>();
+ /*package*/ ArrayMap<IBinder, Interface> mInterfaces = new ArrayMap<IBinder, Interface>();
private Object[] mActiveBroadcast;
private int mBroadcastCount = -1;
private boolean mKilled = false;
private StringBuilder mRecentCallers;
- private final class Callback implements IBinder.DeathRecipient {
- final E mCallback;
+ private final @FrozenCalleePolicy int mFrozenCalleePolicy;
+ private final int mMaxQueueSize;
+
+ private final class Interface implements IBinder.DeathRecipient,
+ IBinder.FrozenStateChangeCallback {
+ final IBinder mBinder;
+ final E mInterface;
final Object mCookie;
+ final Queue<Consumer<E>> mCallbackQueue;
+ int mCurrentState = IBinder.FrozenStateChangeCallback.STATE_UNFROZEN;
- Callback(E callback, Object cookie) {
- mCallback = callback;
+ Interface(E callbackInterface, Object cookie) {
+ mBinder = callbackInterface.asBinder();
+ mInterface = callbackInterface;
mCookie = cookie;
+ mCallbackQueue = mFrozenCalleePolicy == FROZEN_CALLEE_POLICY_ENQUEUE_ALL
+ || mFrozenCalleePolicy == FROZEN_CALLEE_POLICY_ENQUEUE_MOST_RECENT
+ ? new ConcurrentLinkedQueue<>() : null;
+ }
+
+ @Override
+ public synchronized void onFrozenStateChanged(@NonNull IBinder who, int state) {
+ if (state == STATE_UNFROZEN && mCallbackQueue != null) {
+ while (!mCallbackQueue.isEmpty()) {
+ Consumer<E> callback = mCallbackQueue.poll();
+ callback.accept(mInterface);
+ }
+ }
+ mCurrentState = state;
+ }
+
+ void addCallback(@NonNull Consumer<E> callback) {
+ if (mFrozenCalleePolicy == FROZEN_CALLEE_POLICY_UNSET) {
+ callback.accept(mInterface);
+ return;
+ }
+ synchronized (this) {
+ if (mCurrentState == STATE_UNFROZEN) {
+ callback.accept(mInterface);
+ return;
+ }
+ switch (mFrozenCalleePolicy) {
+ case FROZEN_CALLEE_POLICY_ENQUEUE_ALL:
+ if (mCallbackQueue.size() >= mMaxQueueSize) {
+ mCallbackQueue.poll();
+ }
+ mCallbackQueue.offer(callback);
+ break;
+ case FROZEN_CALLEE_POLICY_ENQUEUE_MOST_RECENT:
+ mCallbackQueue.clear();
+ mCallbackQueue.offer(callback);
+ break;
+ case FROZEN_CALLEE_POLICY_DROP:
+ // Do nothing. Just ignore the callback.
+ break;
+ case FROZEN_CALLEE_POLICY_UNSET:
+ // Do nothing. Should have returned at the start of the method.
+ break;
+ }
+ }
+ }
+
+ public void maybeSubscribeToFrozenCallback() throws RemoteException {
+ if (mFrozenCalleePolicy != FROZEN_CALLEE_POLICY_UNSET) {
+ mBinder.addFrozenStateChangeCallback(this);
+ }
+ }
+
+ public void maybeUnsubscribeFromFrozenCallback() {
+ if (mFrozenCalleePolicy != FROZEN_CALLEE_POLICY_UNSET) {
+ mBinder.removeFrozenStateChangeCallback(this);
+ }
}
public void binderDied() {
- synchronized (mCallbacks) {
- mCallbacks.remove(mCallback.asBinder());
+ synchronized (mInterfaces) {
+ mInterfaces.remove(mBinder);
+ maybeUnsubscribeFromFrozenCallback();
+ }
+ onCallbackDied(mInterface, mCookie);
+ }
+ }
+
+ /**
+ * Builder for {@link RemoteCallbackList}.
+ *
+ * @param <E> The remote callback interface type.
+ */
+ @FlaggedApi(Flags.FLAG_BINDER_FROZEN_STATE_CHANGE_CALLBACK)
+ public static final class Builder<E extends IInterface> {
+ private @FrozenCalleePolicy int mFrozenCalleePolicy;
+ private int mMaxQueueSize = DEFAULT_MAX_QUEUE_SIZE;
+
+ /**
+ * Creates a Builder for {@link RemoteCallbackList}.
+ *
+ * @param frozenCalleePolicy When the callback recipient's process is frozen, this parameter
+ * specifies when/whether callbacks are invoked. It's important to choose a strategy that's
+ * right for the use case. Leaving the policy unset with {@link #FROZEN_CALLEE_POLICY_UNSET}
+ * is not recommended as it allows callbacks to be invoked while the recipient is frozen.
+ */
+ public Builder(@FrozenCalleePolicy int frozenCalleePolicy) {
+ mFrozenCalleePolicy = frozenCalleePolicy;
+ }
+
+ /**
+ * Sets the max queue size.
+ *
+ * @param maxQueueSize The max size limit on the queue that stores callbacks added when the
+ * recipient's process is frozen. Once the limit is reached, the oldest callback is dropped
+ * to keep the size under the limit. Should only be called for
+ * {@link #FROZEN_CALLEE_POLICY_ENQUEUE_ALL}.
+ *
+ * @return This builder.
+ * @throws IllegalArgumentException if the maxQueueSize is not positive.
+ * @throws UnsupportedOperationException if frozenCalleePolicy is not
+ * {@link #FROZEN_CALLEE_POLICY_ENQUEUE_ALL}.
+ */
+ public @NonNull Builder setMaxQueueSize(int maxQueueSize) {
+ if (maxQueueSize <= 0) {
+ throw new IllegalArgumentException("maxQueueSize must be positive");
+ }
+ if (mFrozenCalleePolicy != FROZEN_CALLEE_POLICY_ENQUEUE_ALL) {
+ throw new UnsupportedOperationException(
+ "setMaxQueueSize can only be called for FROZEN_CALLEE_POLICY_ENQUEUE_ALL");
}
- onCallbackDied(mCallback, mCookie);
+ mMaxQueueSize = maxQueueSize;
+ return this;
+ }
+
+ /**
+ * Builds and returns a {@link RemoteCallbackList}.
+ *
+ * @return The built {@link RemoteCallbackList} object.
+ */
+ public @NonNull RemoteCallbackList<E> build() {
+ return new RemoteCallbackList<E>(mFrozenCalleePolicy, mMaxQueueSize);
}
}
/**
+ * Returns the frozen callee policy.
+ *
+ * @return The frozen callee policy.
+ */
+ @FlaggedApi(Flags.FLAG_BINDER_FROZEN_STATE_CHANGE_CALLBACK)
+ public @FrozenCalleePolicy int getFrozenCalleePolicy() {
+ return mFrozenCalleePolicy;
+ }
+
+ /**
+ * Returns the max queue size.
+ *
+ * @return The max queue size.
+ */
+ @FlaggedApi(Flags.FLAG_BINDER_FROZEN_STATE_CHANGE_CALLBACK)
+ public int getMaxQueueSize() {
+ return mMaxQueueSize;
+ }
+
+ /**
+ * Creates a RemoteCallbackList with {@link #FROZEN_CALLEE_POLICY_UNSET}. This is equivalent to
+ * <pre>
+ * new RemoteCallbackList.Build(RemoteCallbackList.FROZEN_CALLEE_POLICY_UNSET).build()
+ * </pre>
+ */
+ public RemoteCallbackList() {
+ this(FROZEN_CALLEE_POLICY_UNSET, DEFAULT_MAX_QUEUE_SIZE);
+ }
+
+ /**
+ * Creates a RemoteCallbackList with the specified frozen callee policy.
+ *
+ * @param frozenCalleePolicy When the callback recipient's process is frozen, this parameter
+ * specifies when/whether callbacks are invoked. It's important to choose a strategy that's
+ * right for the use case. Leaving the policy unset with {@link #FROZEN_CALLEE_POLICY_UNSET}
+ * is not recommended as it allows callbacks to be invoked while the recipient is frozen.
+ *
+ * @param maxQueueSize The max size limit on the queue that stores callbacks added when the
+ * recipient's process is frozen. Once the limit is reached, the oldest callbacks would be
+ * dropped to keep the size under limit. Ignored except for
+ * {@link #FROZEN_CALLEE_POLICY_ENQUEUE_ALL}.
+ */
+ private RemoteCallbackList(@FrozenCalleePolicy int frozenCalleePolicy, int maxQueueSize) {
+ mFrozenCalleePolicy = frozenCalleePolicy;
+ mMaxQueueSize = maxQueueSize;
+ }
+
+ /**
* Simple version of {@link RemoteCallbackList#register(E, Object)}
* that does not take a cookie object.
*/
- public boolean register(E callback) {
- return register(callback, null);
+ public boolean register(E callbackInterface) {
+ return register(callbackInterface, null);
}
/**
- * Add a new callback to the list. This callback will remain in the list
+ * Add a new interface to the list. This interface will remain in the list
* until a corresponding call to {@link #unregister} or its hosting process
- * goes away. If the callback was already registered (determined by
- * checking to see if the {@link IInterface#asBinder callback.asBinder()}
- * object is already in the list), then it will be replaced with the new callback.
+ * goes away. If the interface was already registered (determined by
+ * checking to see if the {@link IInterface#asBinder callbackInterface.asBinder()}
+ * object is already in the list), then it will be replaced with the new interface.
* Registrations are not counted; a single call to {@link #unregister}
- * will remove a callback after any number calls to register it.
+ * will remove an interface after any number calls to register it.
*
- * @param callback The callback interface to be added to the list. Must
+ * @param callbackInterface The callback interface to be added to the list. Must
* not be null -- passing null here will cause a NullPointerException.
* Most services will want to check for null before calling this with
* an object given from a client, so that clients can't crash the
* service with bad data.
*
* @param cookie Optional additional data to be associated with this
- * callback.
+ * interface.
*
- * @return Returns true if the callback was successfully added to the list.
+ * @return Returns true if the interface was successfully added to the list.
* Returns false if it was not added, either because {@link #kill} had
- * previously been called or the callback's process has gone away.
+ * previously been called or the interface's process has gone away.
*
* @see #unregister
* @see #kill
* @see #onCallbackDied
*/
- public boolean register(E callback, Object cookie) {
- synchronized (mCallbacks) {
+ public boolean register(E callbackInterface, Object cookie) {
+ synchronized (mInterfaces) {
if (mKilled) {
return false;
}
// Flag unusual case that could be caused by a leak. b/36778087
- logExcessiveCallbacks();
- IBinder binder = callback.asBinder();
+ logExcessiveInterfaces();
+ IBinder binder = callbackInterface.asBinder();
try {
- Callback cb = new Callback(callback, cookie);
- unregister(callback);
- binder.linkToDeath(cb, 0);
- mCallbacks.put(binder, cb);
+ Interface i = new Interface(callbackInterface, cookie);
+ unregister(callbackInterface);
+ binder.linkToDeath(i, 0);
+ i.maybeSubscribeToFrozenCallback();
+ mInterfaces.put(binder, i);
return true;
} catch (RemoteException e) {
return false;
@@ -136,27 +375,28 @@ public class RemoteCallbackList<E extends IInterface> {
}
/**
- * Remove from the list a callback that was previously added with
+ * Remove from the list an interface that was previously added with
* {@link #register}. This uses the
- * {@link IInterface#asBinder callback.asBinder()} object to correctly
+ * {@link IInterface#asBinder callbackInterface.asBinder()} object to correctly
* find the previous registration.
* Registrations are not counted; a single unregister call will remove
- * a callback after any number calls to {@link #register} for it.
+ * an interface after any number calls to {@link #register} for it.
*
- * @param callback The callback to be removed from the list. Passing
+ * @param callbackInterface The interface to be removed from the list. Passing
* null here will cause a NullPointerException, so you will generally want
* to check for null before calling.
*
- * @return Returns true if the callback was found and unregistered. Returns
- * false if the given callback was not found on the list.
+ * @return Returns true if the interface was found and unregistered. Returns
+ * false if the given interface was not found on the list.
*
* @see #register
*/
- public boolean unregister(E callback) {
- synchronized (mCallbacks) {
- Callback cb = mCallbacks.remove(callback.asBinder());
- if (cb != null) {
- cb.mCallback.asBinder().unlinkToDeath(cb, 0);
+ public boolean unregister(E callbackInterface) {
+ synchronized (mInterfaces) {
+ Interface i = mInterfaces.remove(callbackInterface.asBinder());
+ if (i != null) {
+ i.mInterface.asBinder().unlinkToDeath(i, 0);
+ i.maybeUnsubscribeFromFrozenCallback();
return true;
}
return false;
@@ -164,20 +404,21 @@ public class RemoteCallbackList<E extends IInterface> {
}
/**
- * Disable this callback list. All registered callbacks are unregistered,
+ * Disable this interface list. All registered interfaces are unregistered,
* and the list is disabled so that future calls to {@link #register} will
* fail. This should be used when a Service is stopping, to prevent clients
- * from registering callbacks after it is stopped.
+ * from registering interfaces after it is stopped.
*
* @see #register
*/
public void kill() {
- synchronized (mCallbacks) {
- for (int cbi=mCallbacks.size()-1; cbi>=0; cbi--) {
- Callback cb = mCallbacks.valueAt(cbi);
- cb.mCallback.asBinder().unlinkToDeath(cb, 0);
+ synchronized (mInterfaces) {
+ for (int cbi = mInterfaces.size() - 1; cbi >= 0; cbi--) {
+ Interface i = mInterfaces.valueAt(cbi);
+ i.mInterface.asBinder().unlinkToDeath(i, 0);
+ i.maybeUnsubscribeFromFrozenCallback();
}
- mCallbacks.clear();
+ mInterfaces.clear();
mKilled = true;
}
}
@@ -186,15 +427,15 @@ public class RemoteCallbackList<E extends IInterface> {
* Old version of {@link #onCallbackDied(E, Object)} that
* does not provide a cookie.
*/
- public void onCallbackDied(E callback) {
+ public void onCallbackDied(E callbackInterface) {
}
/**
- * Called when the process hosting a callback in the list has gone away.
+ * Called when the process hosting an interface in the list has gone away.
* The default implementation calls {@link #onCallbackDied(E)}
* for backwards compatibility.
*
- * @param callback The callback whose process has died. Note that, since
+ * @param callbackInterface The interface whose process has died. Note that, since
* its process has died, you can not make any calls on to this interface.
* You can, however, retrieve its IBinder and compare it with another
* IBinder to see if it is the same object.
@@ -203,13 +444,15 @@ public class RemoteCallbackList<E extends IInterface> {
*
* @see #register
*/
- public void onCallbackDied(E callback, Object cookie) {
- onCallbackDied(callback);
+ public void onCallbackDied(E callbackInterface, Object cookie) {
+ onCallbackDied(callbackInterface);
}
/**
- * Prepare to start making calls to the currently registered callbacks.
- * This creates a copy of the callback list, which you can retrieve items
+ * Use {@link #broadcast(Consumer)} instead to ensure proper handling of frozen processes.
+ *
+ * Prepare to start making calls to the currently registered interfaces.
+ * This creates a copy of the interface list, which you can retrieve items
* from using {@link #getBroadcastItem}. Note that only one broadcast can
* be active at a time, so you must be sure to always call this from the
* same thread (usually by scheduling with {@link Handler}) or
@@ -219,44 +462,56 @@ public class RemoteCallbackList<E extends IInterface> {
* <p>A typical loop delivering a broadcast looks like this:
*
* <pre>
- * int i = callbacks.beginBroadcast();
+ * int i = interfaces.beginBroadcast();
* while (i &gt; 0) {
* i--;
* try {
- * callbacks.getBroadcastItem(i).somethingHappened();
+ * interfaces.getBroadcastItem(i).somethingHappened();
* } catch (RemoteException e) {
* // The RemoteCallbackList will take care of removing
* // the dead object for us.
* }
* }
- * callbacks.finishBroadcast();</pre>
+ * interfaces.finishBroadcast();</pre>
*
- * @return Returns the number of callbacks in the broadcast, to be used
+ * Note that this method is only supported for {@link #FROZEN_CALLEE_POLICY_UNSET}. For other
+ * policies use {@link #broadcast(Consumer)} instead.
+ *
+ * @return Returns the number of interfaces in the broadcast, to be used
* with {@link #getBroadcastItem} to determine the range of indices you
* can supply.
*
+ * @throws UnsupportedOperationException if an frozen callee policy is set.
+ *
* @see #getBroadcastItem
* @see #finishBroadcast
*/
public int beginBroadcast() {
- synchronized (mCallbacks) {
+ if (mFrozenCalleePolicy != FROZEN_CALLEE_POLICY_UNSET) {
+ throw new UnsupportedOperationException();
+ }
+ return beginBroadcastInternal();
+ }
+
+ private int beginBroadcastInternal() {
+ synchronized (mInterfaces) {
if (mBroadcastCount > 0) {
throw new IllegalStateException(
"beginBroadcast() called while already in a broadcast");
}
- final int N = mBroadcastCount = mCallbacks.size();
- if (N <= 0) {
+ final int n = mBroadcastCount = mInterfaces.size();
+ if (n <= 0) {
return 0;
}
Object[] active = mActiveBroadcast;
- if (active == null || active.length < N) {
- mActiveBroadcast = active = new Object[N];
+ if (active == null || active.length < n) {
+ mActiveBroadcast = active = new Object[n];
}
- for (int i=0; i<N; i++) {
- active[i] = mCallbacks.valueAt(i);
+ for (int i = 0; i < n; i++) {
+ active[i] = mInterfaces.valueAt(i);
}
- return N;
+ return n;
}
}
@@ -267,24 +522,23 @@ public class RemoteCallbackList<E extends IInterface> {
* calling {@link #finishBroadcast}.
*
* <p>Note that it is possible for the process of one of the returned
- * callbacks to go away before you call it, so you will need to catch
+ * interfaces to go away before you call it, so you will need to catch
* {@link RemoteException} when calling on to the returned object.
- * The callback list itself, however, will take care of unregistering
+ * The interface list itself, however, will take care of unregistering
* these objects once it detects that it is no longer valid, so you can
* handle such an exception by simply ignoring it.
*
- * @param index Which of the registered callbacks you would like to
+ * @param index Which of the registered interfaces you would like to
* retrieve. Ranges from 0 to {@link #beginBroadcast}-1, inclusive.
*
- * @return Returns the callback interface that you can call. This will
- * always be non-null.
+ * @return Returns the interface that you can call. This will always be non-null.
*
* @see #beginBroadcast
*/
public E getBroadcastItem(int index) {
- return ((Callback)mActiveBroadcast[index]).mCallback;
+ return ((Interface) mActiveBroadcast[index]).mInterface;
}
-
+
/**
* Retrieve the cookie associated with the item
* returned by {@link #getBroadcastItem(int)}.
@@ -292,7 +546,7 @@ public class RemoteCallbackList<E extends IInterface> {
* @see #getBroadcastItem
*/
public Object getBroadcastCookie(int index) {
- return ((Callback)mActiveBroadcast[index]).mCookie;
+ return ((Interface) mActiveBroadcast[index]).mCookie;
}
/**
@@ -303,7 +557,7 @@ public class RemoteCallbackList<E extends IInterface> {
* @see #beginBroadcast
*/
public void finishBroadcast() {
- synchronized (mCallbacks) {
+ synchronized (mInterfaces) {
if (mBroadcastCount < 0) {
throw new IllegalStateException(
"finishBroadcast() called outside of a broadcast");
@@ -322,16 +576,18 @@ public class RemoteCallbackList<E extends IInterface> {
}
/**
- * Performs {@code action} on each callback, calling
- * {@link #beginBroadcast()}/{@link #finishBroadcast()} before/after looping
+ * Performs {@code callback} on each registered interface.
*
- * @hide
+ * This is equivalent to #beginBroadcast, followed by iterating over the items using
+ * #getBroadcastItem and then @finishBroadcast, except that this method supports
+ * frozen callee policies.
*/
- public void broadcast(Consumer<E> action) {
- int itemCount = beginBroadcast();
+ @FlaggedApi(Flags.FLAG_BINDER_FROZEN_STATE_CHANGE_CALLBACK)
+ public void broadcast(@NonNull Consumer<E> callback) {
+ int itemCount = beginBroadcastInternal();
try {
for (int i = 0; i < itemCount; i++) {
- action.accept(getBroadcastItem(i));
+ ((Interface) mActiveBroadcast[i]).addCallback(callback);
}
} finally {
finishBroadcast();
@@ -339,16 +595,16 @@ public class RemoteCallbackList<E extends IInterface> {
}
/**
- * Performs {@code action} for each cookie associated with a callback, calling
+ * Performs {@code callback} for each cookie associated with an interface, calling
* {@link #beginBroadcast()}/{@link #finishBroadcast()} before/after looping
*
* @hide
*/
- public <C> void broadcastForEachCookie(Consumer<C> action) {
+ public <C> void broadcastForEachCookie(Consumer<C> callback) {
int itemCount = beginBroadcast();
try {
for (int i = 0; i < itemCount; i++) {
- action.accept((C) getBroadcastCookie(i));
+ callback.accept((C) getBroadcastCookie(i));
}
} finally {
finishBroadcast();
@@ -356,16 +612,16 @@ public class RemoteCallbackList<E extends IInterface> {
}
/**
- * Performs {@code action} on each callback and associated cookie, calling {@link
+ * Performs {@code callback} on each interface and associated cookie, calling {@link
* #beginBroadcast()}/{@link #finishBroadcast()} before/after looping.
*
* @hide
*/
- public <C> void broadcast(BiConsumer<E, C> action) {
+ public <C> void broadcast(BiConsumer<E, C> callback) {
int itemCount = beginBroadcast();
try {
for (int i = 0; i < itemCount; i++) {
- action.accept(getBroadcastItem(i), (C) getBroadcastCookie(i));
+ callback.accept(getBroadcastItem(i), (C) getBroadcastCookie(i));
}
} finally {
finishBroadcast();
@@ -373,10 +629,10 @@ public class RemoteCallbackList<E extends IInterface> {
}
/**
- * Returns the number of registered callbacks. Note that the number of registered
- * callbacks may differ from the value returned by {@link #beginBroadcast()} since
- * the former returns the number of callbacks registered at the time of the call
- * and the second the number of callback to which the broadcast will be delivered.
+ * Returns the number of registered interfaces. Note that the number of registered
+ * interfaces may differ from the value returned by {@link #beginBroadcast()} since
+ * the former returns the number of interfaces registered at the time of the call
+ * and the second the number of interfaces to which the broadcast will be delivered.
* <p>
* This function is useful to decide whether to schedule a broadcast if this
* requires doing some work which otherwise would not be performed.
@@ -385,39 +641,39 @@ public class RemoteCallbackList<E extends IInterface> {
* @return The size.
*/
public int getRegisteredCallbackCount() {
- synchronized (mCallbacks) {
+ synchronized (mInterfaces) {
if (mKilled) {
return 0;
}
- return mCallbacks.size();
+ return mInterfaces.size();
}
}
/**
- * Return a currently registered callback. Note that this is
+ * Return a currently registered interface. Note that this is
* <em>not</em> the same as {@link #getBroadcastItem} and should not be used
- * interchangeably with it. This method returns the registered callback at the given
+ * interchangeably with it. This method returns the registered interface at the given
* index, not the current broadcast state. This means that it is not itself thread-safe:
* any call to {@link #register} or {@link #unregister} will change these indices, so you
* must do your own thread safety between these to protect from such changes.
*
- * @param index Index of which callback registration to return, from 0 to
+ * @param index Index of which interface registration to return, from 0 to
* {@link #getRegisteredCallbackCount()} - 1.
*
- * @return Returns whatever callback is associated with this index, or null if
+ * @return Returns whatever interface is associated with this index, or null if
* {@link #kill()} has been called.
*/
public E getRegisteredCallbackItem(int index) {
- synchronized (mCallbacks) {
+ synchronized (mInterfaces) {
if (mKilled) {
return null;
}
- return mCallbacks.valueAt(index).mCallback;
+ return mInterfaces.valueAt(index).mInterface;
}
}
/**
- * Return any cookie associated with a currently registered callback. Note that this is
+ * Return any cookie associated with a currently registered interface. Note that this is
* <em>not</em> the same as {@link #getBroadcastCookie} and should not be used
* interchangeably with it. This method returns the current cookie registered at the given
* index, not the current broadcast state. This means that it is not itself thread-safe:
@@ -431,25 +687,25 @@ public class RemoteCallbackList<E extends IInterface> {
* {@link #kill()} has been called.
*/
public Object getRegisteredCallbackCookie(int index) {
- synchronized (mCallbacks) {
+ synchronized (mInterfaces) {
if (mKilled) {
return null;
}
- return mCallbacks.valueAt(index).mCookie;
+ return mInterfaces.valueAt(index).mCookie;
}
}
/** @hide */
public void dump(PrintWriter pw, String prefix) {
- synchronized (mCallbacks) {
- pw.print(prefix); pw.print("callbacks: "); pw.println(mCallbacks.size());
+ synchronized (mInterfaces) {
+ pw.print(prefix); pw.print("callbacks: "); pw.println(mInterfaces.size());
pw.print(prefix); pw.print("killed: "); pw.println(mKilled);
pw.print(prefix); pw.print("broadcasts count: "); pw.println(mBroadcastCount);
}
}
- private void logExcessiveCallbacks() {
- final long size = mCallbacks.size();
+ private void logExcessiveInterfaces() {
+ final long size = mInterfaces.size();
final long TOO_MANY = 3000;
final long MAX_CHARS = 1000;
if (size >= TOO_MANY) {
diff --git a/core/java/android/os/SemiConcurrentMessageQueue/MessageQueue.java b/core/java/android/os/SemiConcurrentMessageQueue/MessageQueue.java
index 80c24a9003e8..023359726f90 100644
--- a/core/java/android/os/SemiConcurrentMessageQueue/MessageQueue.java
+++ b/core/java/android/os/SemiConcurrentMessageQueue/MessageQueue.java
@@ -712,7 +712,7 @@ public final class MessageQueue {
// Idle handles only run if the queue is empty or if the first message
// in the queue (possibly a barrier) is due to be handled in the future.
if (pendingIdleHandlerCount < 0
- && mNextPollTimeoutMillis != 0) {
+ && isIdle()) {
pendingIdleHandlerCount = mIdleHandlers.size();
}
if (pendingIdleHandlerCount <= 0) {
diff --git a/core/java/android/os/StatsBootstrapAtomValue.aidl b/core/java/android/os/StatsBootstrapAtomValue.aidl
index b59bc062648f..b31eb6f78355 100644
--- a/core/java/android/os/StatsBootstrapAtomValue.aidl
+++ b/core/java/android/os/StatsBootstrapAtomValue.aidl
@@ -19,12 +19,36 @@ package android.os;
*
* @hide
*/
-union StatsBootstrapAtomValue {
- boolean boolValue;
- int intValue;
- long longValue;
- float floatValue;
- String stringValue;
- byte[] bytesValue;
- String[] stringArrayValue;
-} \ No newline at end of file
+parcelable StatsBootstrapAtomValue {
+ union Primitive {
+ boolean boolValue;
+ int intValue;
+ long longValue;
+ float floatValue;
+ String stringValue;
+ byte[] bytesValue;
+ String[] stringArrayValue;
+ }
+
+ Primitive value;
+
+ parcelable Annotation {
+ // Match the definitions in
+ // packages/modules/StatsD/framework/java/android/util/StatsLog.java
+ // Only supports UIDs for now.
+ @Backing(type="byte")
+ enum Id {
+ NONE,
+ IS_UID,
+ }
+ Id id;
+
+ union Primitive {
+ boolean boolValue;
+ int intValue;
+ }
+ Primitive value;
+ }
+
+ Annotation[] annotations;
+}
diff --git a/core/java/android/os/UidBatteryConsumer.java b/core/java/android/os/UidBatteryConsumer.java
index 7f7ef0467e08..f893739fcf28 100644
--- a/core/java/android/os/UidBatteryConsumer.java
+++ b/core/java/android/os/UidBatteryConsumer.java
@@ -109,9 +109,11 @@ public final class UidBatteryConsumer extends BatteryConsumer {
* Returns the amount of time in milliseconds this UID spent in the specified process state.
*/
public long getTimeInProcessStateMs(@ProcessState int state) {
- Key key = getKey(POWER_COMPONENT_BASE, state);
- if (key != null) {
- return getUsageDurationMillis(key);
+ if (state != BatteryConsumer.PROCESS_STATE_UNSPECIFIED) {
+ Key key = getKey(POWER_COMPONENT_BASE, state);
+ if (key != null) {
+ return getUsageDurationMillis(key);
+ }
}
return 0;
}
diff --git a/core/java/android/os/UserManager.java b/core/java/android/os/UserManager.java
index bd3da0d56cbd..acf4a2f3ec71 100644
--- a/core/java/android/os/UserManager.java
+++ b/core/java/android/os/UserManager.java
@@ -772,9 +772,10 @@ public class UserManager {
public static final String DISALLOW_CONFIG_CREDENTIALS = "no_config_credentials";
/**
- * When set on the admin user this specifies if the user can remove users.
+ * When set on the admin user this specifies if the user can remove secondary users. Managed
+ * profiles and private profiles can still be removed even if this is set on the admin user.
* When set on a non-admin secondary user, this specifies if the user can remove itself.
- * This restriction has no effect on managed profiles.
+ * This restriction has no effect when set on managed profiles.
* The default value is <code>false</code>.
*
* <p>Holders of the permission
@@ -793,7 +794,8 @@ public class UserManager {
* Specifies if managed profiles of this user can be removed, other than by its profile owner.
* The default value is <code>false</code>.
* <p>
- * This restriction has no effect on managed profiles.
+ * This restriction has no effect on managed profiles, and this restriction does not block the
+ * removal of private profiles of this user.
*
* <p>Key for user restrictions.
* <p>Type: Boolean
diff --git a/core/java/android/os/ZygoteProcess.java b/core/java/android/os/ZygoteProcess.java
index 6a2daeab5f0a..73a74b2f8abc 100644
--- a/core/java/android/os/ZygoteProcess.java
+++ b/core/java/android/os/ZygoteProcess.java
@@ -73,6 +73,9 @@ public class ZygoteProcess {
private static final int ZYGOTE_CONNECT_TIMEOUT_MS = 60000;
+ // How long we wait for an AppZygote to complete pre-loading; this is a pretty conservative
+ // value that we can probably decrease over time, but we want to be careful here.
+ public static volatile int sAppZygotePreloadTimeoutMs = 15000;
/**
* Use a relatively short delay, because for app zygote, this is in the critical path of
* service launch.
@@ -1100,31 +1103,52 @@ public class ZygoteProcess {
}
/**
+ * Updates the timeout used when preloading code in the app-zygote
+ *
+ * @param timeoutMs timeout in milliseconds
+ */
+ public static void setAppZygotePreloadTimeout(int timeoutMs) {
+ Slog.i(LOG_TAG, "Changing app-zygote preload timeout to " + timeoutMs + " ms.");
+
+ sAppZygotePreloadTimeoutMs = timeoutMs;
+ }
+
+ /**
* Instructs the zygote to pre-load the application code for the given Application.
* Only the app zygote supports this function.
*/
public boolean preloadApp(ApplicationInfo appInfo, String abi)
throws ZygoteStartFailedEx, IOException {
synchronized (mLock) {
+ int ret;
ZygoteState state = openZygoteSocketIfNeeded(abi);
- state.mZygoteOutputWriter.write("2");
- state.mZygoteOutputWriter.newLine();
+ int previousSocketTimeout = state.mZygoteSessionSocket.getSoTimeout();
- state.mZygoteOutputWriter.write("--preload-app");
- state.mZygoteOutputWriter.newLine();
+ try {
+ state.mZygoteSessionSocket.setSoTimeout(sAppZygotePreloadTimeoutMs);
- // Zygote args needs to be strings, so in order to pass ApplicationInfo,
- // write it to a Parcel, and base64 the raw Parcel bytes to the other side.
- Parcel parcel = Parcel.obtain();
- appInfo.writeToParcel(parcel, 0 /* flags */);
- String encodedParcelData = Base64.getEncoder().encodeToString(parcel.marshall());
- parcel.recycle();
- state.mZygoteOutputWriter.write(encodedParcelData);
- state.mZygoteOutputWriter.newLine();
+ state.mZygoteOutputWriter.write("2");
+ state.mZygoteOutputWriter.newLine();
- state.mZygoteOutputWriter.flush();
+ state.mZygoteOutputWriter.write("--preload-app");
+ state.mZygoteOutputWriter.newLine();
- return (state.mZygoteInputStream.readInt() == 0);
+ // Zygote args needs to be strings, so in order to pass ApplicationInfo,
+ // write it to a Parcel, and base64 the raw Parcel bytes to the other side.
+ Parcel parcel = Parcel.obtain();
+ appInfo.writeToParcel(parcel, 0 /* flags */);
+ String encodedParcelData = Base64.getEncoder().encodeToString(parcel.marshall());
+ parcel.recycle();
+ state.mZygoteOutputWriter.write(encodedParcelData);
+ state.mZygoteOutputWriter.newLine();
+
+ state.mZygoteOutputWriter.flush();
+
+ ret = state.mZygoteInputStream.readInt();
+ } finally {
+ state.mZygoteSessionSocket.setSoTimeout(previousSocketTimeout);
+ }
+ return ret == 0;
}
}
diff --git a/core/java/android/permission/flags.aconfig b/core/java/android/permission/flags.aconfig
index e59501f2742a..bfefba5b36e6 100644
--- a/core/java/android/permission/flags.aconfig
+++ b/core/java/android/permission/flags.aconfig
@@ -273,3 +273,12 @@ flag {
purpose: PURPOSE_BUGFIX
}
}
+
+flag {
+ name: "platform_skin_temperature_enabled"
+ is_fixed_read_only: true
+ is_exported: true
+ namespace: "android_health_services"
+ description: "This fixed read-only flag is used to enable platform support for Skin Temperature."
+ bug: "369872443"
+}
diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java
index 594005c3ebd6..0be55844b829 100644
--- a/core/java/android/provider/Settings.java
+++ b/core/java/android/provider/Settings.java
@@ -12845,6 +12845,12 @@ public final class Settings {
*/
@Readable
public static final String CONTEXTUAL_SEARCH_PACKAGE = "contextual_search_package";
+
+ /**
+ * Inetger property which determines whether advanced protection is on or not.
+ * @hide
+ */
+ public static final String ADVANCED_PROTECTION_MODE = "advanced_protection_mode";
}
/**
diff --git a/core/java/android/security/advancedprotection/AdvancedProtectionManager.java b/core/java/android/security/advancedprotection/AdvancedProtectionManager.java
new file mode 100644
index 000000000000..59dd680f17be
--- /dev/null
+++ b/core/java/android/security/advancedprotection/AdvancedProtectionManager.java
@@ -0,0 +1,164 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.security.advancedprotection;
+
+import android.Manifest;
+import android.annotation.CallbackExecutor;
+import android.annotation.FlaggedApi;
+import android.annotation.NonNull;
+import android.annotation.RequiresPermission;
+import android.annotation.SystemApi;
+import android.annotation.SystemService;
+import android.content.Context;
+import android.os.Binder;
+import android.os.RemoteException;
+import android.security.Flags;
+import android.util.Log;
+
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.Executor;
+
+/**
+ * <p>Advanced Protection is a mode that users can enroll their device into, that enhances security
+ * by enabling features and restrictions across both the platform and user apps.
+ *
+ * <p>This class provides methods to query and control the advanced protection mode
+ * for the device.
+ */
+@FlaggedApi(Flags.FLAG_AAPM_API)
+@SystemService(Context.ADVANCED_PROTECTION_SERVICE)
+public class AdvancedProtectionManager {
+ private static final String TAG = "AdvancedProtectionM";
+
+ private final ConcurrentHashMap<Callback, IAdvancedProtectionCallback>
+ mCallbackMap = new ConcurrentHashMap<>();
+
+ @NonNull
+ private final IAdvancedProtectionService mService;
+
+ /** @hide */
+ public AdvancedProtectionManager(@NonNull IAdvancedProtectionService service) {
+ mService = service;
+ }
+
+ /**
+ * Checks if advanced protection is enabled on the device.
+ *
+ * @return {@code true} if advanced protection is enabled, {@code false} otherwise.
+ */
+ @RequiresPermission(Manifest.permission.QUERY_ADVANCED_PROTECTION_MODE)
+ public boolean isAdvancedProtectionEnabled() {
+ try {
+ return mService.isAdvancedProtectionEnabled();
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
+ }
+
+ /**
+ * Registers a {@link Callback} to be notified of changes to the Advanced Protection state.
+ *
+ * <p>The provided callback will be called on the specified executor with the updated
+ * {@link AdvancedProtectionState}. Methods are called when the state changes, as well as once
+ * on initial registration.
+ *
+ * @param executor The executor of where the callback will execute.
+ * @param callback The {@link Callback} object to register..
+ */
+ @RequiresPermission(Manifest.permission.QUERY_ADVANCED_PROTECTION_MODE)
+ public void registerAdvancedProtectionCallback(@NonNull @CallbackExecutor Executor executor,
+ @NonNull Callback callback) {
+ if (mCallbackMap.get(callback) != null) {
+ Log.d(TAG, "registerAdvancedProtectionCallback callback already present");
+ return;
+ }
+
+ IAdvancedProtectionCallback delegate = new IAdvancedProtectionCallback.Stub() {
+ @Override
+ public void onAdvancedProtectionChanged(boolean enabled) {
+ final long identity = Binder.clearCallingIdentity();
+ try {
+ executor.execute(() -> callback.onAdvancedProtectionChanged(enabled));
+ } finally {
+ Binder.restoreCallingIdentity(identity);
+ }
+ }
+ };
+
+ try {
+ mService.registerAdvancedProtectionCallback(delegate);
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
+
+ mCallbackMap.put(callback, delegate);
+ }
+
+ /**
+ * Unregister an existing {@link Callback}.
+ *
+ * @param callback The {@link Callback} object to unregister.
+ */
+ @RequiresPermission(Manifest.permission.QUERY_ADVANCED_PROTECTION_MODE)
+ public void unregisterAdvancedProtectionCallback(@NonNull Callback callback) {
+ IAdvancedProtectionCallback delegate = mCallbackMap.get(callback);
+ if (delegate == null) {
+ Log.d(TAG, "unregisterAdvancedProtectionCallback callback not present");
+ return;
+ }
+
+ try {
+ mService.unregisterAdvancedProtectionCallback(delegate);
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
+
+ mCallbackMap.remove(callback);
+ }
+
+ /**
+ * Enables or disables advanced protection on the device.
+ *
+ * @param enabled {@code true} to enable advanced protection, {@code false} to disable it.
+ * @hide
+ */
+ @SystemApi
+ @RequiresPermission(Manifest.permission.SET_ADVANCED_PROTECTION_MODE)
+ public void setAdvancedProtectionEnabled(boolean enabled) {
+ try {
+ mService.setAdvancedProtectionEnabled(enabled);
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
+ }
+
+ /**
+ * A callback class for monitoring changes to Advanced Protection state
+ *
+ * <p>To register a callback, implement this interface, and register it with
+ * {@link AdvancedProtectionManager#registerAdvancedProtectionCallback(Executor, Callback)}.
+ * Methods are called when the state changes, as well as once on initial registration.
+ */
+ @FlaggedApi(Flags.FLAG_AAPM_API)
+ public interface Callback {
+ /**
+ * Called when advanced protection state changes
+ * @param enabled the new state
+ */
+ void onAdvancedProtectionChanged(boolean enabled);
+ }
+}
diff --git a/core/java/android/security/advancedprotection/IAdvancedProtectionCallback.aidl b/core/java/android/security/advancedprotection/IAdvancedProtectionCallback.aidl
new file mode 100644
index 000000000000..828ce47e652b
--- /dev/null
+++ b/core/java/android/security/advancedprotection/IAdvancedProtectionCallback.aidl
@@ -0,0 +1,25 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.security.advancedprotection;
+
+/**
+ * A callback class for monitoring changes to Advanced Protection state
+ * @hide
+ */
+oneway interface IAdvancedProtectionCallback {
+ void onAdvancedProtectionChanged(boolean enabled);
+} \ No newline at end of file
diff --git a/core/java/android/security/advancedprotection/IAdvancedProtectionService.aidl b/core/java/android/security/advancedprotection/IAdvancedProtectionService.aidl
new file mode 100644
index 000000000000..ef0abf4f23a0
--- /dev/null
+++ b/core/java/android/security/advancedprotection/IAdvancedProtectionService.aidl
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.security.advancedprotection;
+
+import android.security.advancedprotection.IAdvancedProtectionCallback;
+
+/**
+ * Binder interface for apps to communicate with system server implementations of
+ * AdvancedProtectionService.
+ * @hide
+ */
+interface IAdvancedProtectionService {
+ @EnforcePermission("QUERY_ADVANCED_PROTECTION_MODE")
+ boolean isAdvancedProtectionEnabled();
+ @EnforcePermission("QUERY_ADVANCED_PROTECTION_MODE")
+ void registerAdvancedProtectionCallback(IAdvancedProtectionCallback callback);
+ @EnforcePermission("QUERY_ADVANCED_PROTECTION_MODE")
+ void unregisterAdvancedProtectionCallback(IAdvancedProtectionCallback callback);
+ @EnforcePermission("SET_ADVANCED_PROTECTION_MODE")
+ void setAdvancedProtectionEnabled(boolean enabled);
+} \ No newline at end of file
diff --git a/core/java/android/security/flags.aconfig b/core/java/android/security/flags.aconfig
index aedf8e097e67..1d35344e5218 100644
--- a/core/java/android/security/flags.aconfig
+++ b/core/java/android/security/flags.aconfig
@@ -113,3 +113,10 @@ flag {
description: "AFL feature"
bug: "365994454"
}
+
+flag {
+ name: "keystore_grant_api"
+ namespace: "hardware_backed_security"
+ description: "Feature flag for exposing KeyStore grant APIs"
+ bug: "351158708"
+}
diff --git a/core/java/android/security/forensic/IForensicService.aidl b/core/java/android/security/forensic/IForensicService.aidl
new file mode 100644
index 000000000000..a944b18cb26d
--- /dev/null
+++ b/core/java/android/security/forensic/IForensicService.aidl
@@ -0,0 +1,32 @@
+/*
+ * Copyright 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.security.forensic;
+
+import android.security.forensic.IForensicServiceCommandCallback;
+import android.security.forensic.IForensicServiceStateCallback;
+
+/**
+ * Binder interface to communicate with ForensicService.
+ * @hide
+ */
+interface IForensicService {
+ void monitorState(IForensicServiceStateCallback callback);
+ void makeVisible(IForensicServiceCommandCallback callback);
+ void makeInvisible(IForensicServiceCommandCallback callback);
+ void enable(IForensicServiceCommandCallback callback);
+ void disable(IForensicServiceCommandCallback callback);
+}
diff --git a/core/java/android/security/forensic/IForensicServiceCommandCallback.aidl b/core/java/android/security/forensic/IForensicServiceCommandCallback.aidl
new file mode 100644
index 000000000000..7fa0c7f72690
--- /dev/null
+++ b/core/java/android/security/forensic/IForensicServiceCommandCallback.aidl
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.security.forensic;
+
+/**
+ * @hide
+ */
+ oneway interface IForensicServiceCommandCallback {
+ @Backing(type="int")
+ enum ErrorCode{
+ UNKNOWN = 0,
+ PERMISSION_DENIED = 1,
+ INVALID_STATE_TRANSITION = 2,
+ BACKUP_TRANSPORT_UNAVAILABLE = 3,
+ DATA_SOURCE_UNAVAILABLE = 3,
+ }
+ void onSuccess();
+ void onFailure(ErrorCode error);
+ }
diff --git a/core/java/android/security/forensic/IForensicServiceStateCallback.aidl b/core/java/android/security/forensic/IForensicServiceStateCallback.aidl
new file mode 100644
index 000000000000..0cda35083ffd
--- /dev/null
+++ b/core/java/android/security/forensic/IForensicServiceStateCallback.aidl
@@ -0,0 +1,31 @@
+/*
+ * Copyright 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.security.forensic;
+
+/**
+ * @hide
+ */
+ oneway interface IForensicServiceStateCallback {
+ @Backing(type="int")
+ enum State{
+ UNKNOWN = 0,
+ INVISIBLE = 1,
+ VISIBLE = 2,
+ ENABLED = 3,
+ }
+ void onStateChange(State state);
+ }
diff --git a/core/java/android/security/responsible_apis_flags.aconfig b/core/java/android/security/responsible_apis_flags.aconfig
index 5457bbee8ad3..b593902a95d4 100644
--- a/core/java/android/security/responsible_apis_flags.aconfig
+++ b/core/java/android/security/responsible_apis_flags.aconfig
@@ -33,7 +33,6 @@ flag {
}
}
-
flag {
name: "content_uri_permission_apis"
is_exported: true
@@ -65,6 +64,14 @@ flag {
}
flag {
+ name: "aapm_api"
+ namespace: "responsible_apis"
+ description: "Android Advanced Protection Mode Service and Manager"
+ bug: "352420507"
+ is_fixed_read_only: true
+}
+
+flag {
name: "prevent_intent_redirect"
namespace: "responsible_apis"
description: "Prevent intent redirect attacks"
diff --git a/core/java/android/service/wallpaper/Android.bp b/core/java/android/service/wallpaper/Android.bp
deleted file mode 100644
index 552a07d97bf5..000000000000
--- a/core/java/android/service/wallpaper/Android.bp
+++ /dev/null
@@ -1,24 +0,0 @@
-package {
- default_team: "trendy_team_system_ui_please_use_a_more_specific_subteam_if_possible_",
- // See: http://go/android-license-faq
- // A large-scale-change added 'default_applicable_licenses' to import
- // all of the 'license_kinds' from "frameworks_base_license"
- // to get the below license kinds:
- // SPDX-license-identifier-Apache-2.0
- default_applicable_licenses: ["frameworks_base_license"],
-}
-
-android_library {
-
- name: "WallpaperSharedLib",
- srcs: [
- "*.java",
- "I*.aidl",
- ],
-
- libs: ["unsupportedappusage"],
-
- // Enforce that the library is built against java 8 so that there are
- // no compatibility issues with launcher
- java_version: "1.8",
-}
diff --git a/core/java/android/telephony/TelephonyCallback.java b/core/java/android/telephony/TelephonyCallback.java
index 14d5800e4db7..5295b606dd19 100644
--- a/core/java/android/telephony/TelephonyCallback.java
+++ b/core/java/android/telephony/TelephonyCallback.java
@@ -33,6 +33,7 @@ import android.telephony.ims.MediaThreshold;
import android.util.Log;
import com.android.internal.annotations.VisibleForTesting;
+import com.android.internal.annotations.WeaklyReferencedCallback;
import com.android.internal.telephony.IPhoneStateListener;
import com.android.internal.telephony.flags.Flags;
@@ -70,6 +71,7 @@ import java.util.stream.Collectors;
* its manifest file. Where permissions apply, they are noted in the
* appropriate sub-interfaces.
*/
+@WeaklyReferencedCallback
public class TelephonyCallback {
private static final String LOG_TAG = "TelephonyCallback";
/**
diff --git a/core/java/android/view/DisplayEventReceiver.java b/core/java/android/view/DisplayEventReceiver.java
index 18080e4478fc..fc7a65dbdc41 100644
--- a/core/java/android/view/DisplayEventReceiver.java
+++ b/core/java/android/view/DisplayEventReceiver.java
@@ -24,6 +24,7 @@ import android.os.MessageQueue;
import android.util.Log;
import com.android.internal.annotations.VisibleForTesting;
+import com.android.internal.annotations.WeaklyReferencedCallback;
import dalvik.annotation.optimization.FastNative;
@@ -40,6 +41,7 @@ import java.lang.ref.WeakReference;
*
* @hide
*/
+@WeaklyReferencedCallback
public abstract class DisplayEventReceiver {
/**
diff --git a/core/java/android/view/LetterboxScrollProcessor.java b/core/java/android/view/LetterboxScrollProcessor.java
index dc736d6abf7d..1364a82e60a1 100644
--- a/core/java/android/view/LetterboxScrollProcessor.java
+++ b/core/java/android/view/LetterboxScrollProcessor.java
@@ -16,6 +16,8 @@
package android.view;
+import static com.android.internal.annotations.VisibleForTesting.Visibility.PACKAGE;
+
import android.annotation.Nullable;
import android.content.Context;
import android.graphics.Rect;
@@ -23,6 +25,8 @@ import android.os.Handler;
import androidx.annotation.NonNull;
+import com.android.internal.annotations.VisibleForTesting;
+
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
@@ -35,6 +39,7 @@ import java.util.Set;
*
* @hide
*/
+@VisibleForTesting(visibility = PACKAGE)
public class LetterboxScrollProcessor {
private enum LetterboxScrollState {
@@ -53,6 +58,7 @@ public class LetterboxScrollProcessor {
/** IDs of events generated from this class */
private final Set<Integer> mGeneratedEventIds = new HashSet<>();
+ @VisibleForTesting(visibility = PACKAGE)
public LetterboxScrollProcessor(@NonNull Context context, @Nullable Handler handler) {
mContext = context;
mScrollDetector = new GestureDetector(context, new ScrollListener(), handler);
@@ -69,7 +75,9 @@ public class LetterboxScrollProcessor {
* @return The list of adjusted events, or null if no adjustments are needed. The list is empty
* if the event should be ignored. Do not keep a reference to the output as the list is reused.
*/
- public List<MotionEvent> processMotionEvent(MotionEvent motionEvent) {
+ @Nullable
+ @VisibleForTesting(visibility = PACKAGE)
+ public List<MotionEvent> processMotionEvent(@NonNull MotionEvent motionEvent) {
mProcessedEvents.clear();
final Rect appBounds = getAppBounds();
@@ -124,11 +132,9 @@ public class LetterboxScrollProcessor {
mState = LetterboxScrollState.AWAITING_GESTURE_START;
}
- if (makeNoAdjustments) return null;
- return mProcessedEvents;
+ return makeNoAdjustments ? null : mProcessedEvents;
}
-
/**
* Processes the InputEvent for compatibility before it is finished by calling
* InputEventReceiver#finishInputEvent().
@@ -136,21 +142,33 @@ public class LetterboxScrollProcessor {
* @param motionEvent The MotionEvent to process.
* @return The motionEvent to finish, or null if it should not be finished.
*/
- public InputEvent processMotionEventBeforeFinish(MotionEvent motionEvent) {
- if (mGeneratedEventIds.remove(motionEvent.getId())) return null;
- return motionEvent;
+ @Nullable
+ @VisibleForTesting(visibility = PACKAGE)
+ public InputEvent processMotionEventBeforeFinish(@NonNull MotionEvent motionEvent) {
+ return mGeneratedEventIds.remove(motionEvent.getId()) ? null : motionEvent;
}
+ @NonNull
private Rect getAppBounds() {
return mContext.getResources().getConfiguration().windowConfiguration.getBounds();
}
- private boolean isOutsideAppBounds(MotionEvent motionEvent, Rect appBounds) {
- return motionEvent.getX() < 0 || motionEvent.getX() >= appBounds.width()
- || motionEvent.getY() < 0 || motionEvent.getY() >= appBounds.height();
+ /** Checks whether the gesture is located on the letterbox area. */
+ private boolean isOutsideAppBounds(@NonNull MotionEvent motionEvent, @NonNull Rect appBounds) {
+ // The events are in the coordinate system of the ViewRootImpl (window). The window might
+ // not have the same dimensions as the app bounds - for example in case of Dialogs - thus
+ // `getRawX()` and `getRawY()` are used, with the absolute bounds (left, top, etc) instead
+ // of width and height.
+ // The event should be passed to the app if it has happened anywhere in the app area,
+ // irrespective of the current window size, therefore the app bounds are used instead of the
+ // current window.
+ return motionEvent.getRawX() < appBounds.left
+ || motionEvent.getRawX() >= appBounds.right
+ || motionEvent.getRawY() < appBounds.top
+ || motionEvent.getRawY() >= appBounds.bottom;
}
- private void applyOffset(MotionEvent event, Rect appBounds) {
+ private void applyOffset(@NonNull MotionEvent event, @NonNull Rect appBounds) {
float horizontalOffset = calculateOffset(event.getX(), appBounds.width());
float verticalOffset = calculateOffset(event.getY(), appBounds.height());
// Apply the offset to the motion event so it is over the app's view.
diff --git a/core/java/android/view/MotionEvent.java b/core/java/android/view/MotionEvent.java
index 326e34b258e5..bd6ff4c2af02 100644
--- a/core/java/android/view/MotionEvent.java
+++ b/core/java/android/view/MotionEvent.java
@@ -20,7 +20,6 @@ import static android.view.Display.DEFAULT_DISPLAY;
import static java.lang.annotation.RetentionPolicy.SOURCE;
-import android.annotation.FlaggedApi;
import android.annotation.IntDef;
import android.annotation.NonNull;
import android.annotation.Nullable;
@@ -36,8 +35,6 @@ import android.os.SystemClock;
import android.util.Log;
import android.util.SparseArray;
-import com.android.hardware.input.Flags;
-
import dalvik.annotation.optimization.CriticalNative;
import dalvik.annotation.optimization.FastNative;
@@ -4436,7 +4433,6 @@ public final class MotionEvent extends InputEvent implements Parcelable {
* @see android.view.View#requestUnbufferedDispatch(int)
* @see android.view.View#requestUnbufferedDispatch(MotionEvent)
*/
- @FlaggedApi(Flags.FLAG_POINTER_COORDS_IS_RESAMPLED_API)
public boolean isResampled() {
return isResampled;
}
diff --git a/core/java/android/view/OWNERS b/core/java/android/view/OWNERS
index 1ea58bcbb76a..80484a6328e0 100644
--- a/core/java/android/view/OWNERS
+++ b/core/java/android/view/OWNERS
@@ -88,6 +88,7 @@ per-file OnReceiveContentListener.java = file:/core/java/android/service/autofil
per-file OnReceiveContentListener.java = file:/core/java/android/widget/OWNERS
per-file ContentInfo.java = file:/core/java/android/service/autofill/OWNERS
per-file ContentInfo.java = file:/core/java/android/widget/OWNERS
+per-file view_flags.aconfig = file:/services/core/java/com/android/server/wm/OWNERS
# WindowManager
per-file ContentRecordingSession.aidl = file:/services/core/java/com/android/server/wm/OWNERS
diff --git a/core/java/android/view/RoundScrollbarRenderer.java b/core/java/android/view/RoundScrollbarRenderer.java
index 5f6d5e29570e..59c2598f00f0 100644
--- a/core/java/android/view/RoundScrollbarRenderer.java
+++ b/core/java/android/view/RoundScrollbarRenderer.java
@@ -16,17 +16,26 @@
package android.view;
+import static android.util.MathUtils.acos;
+
+import static java.lang.Math.sin;
+
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Rect;
import android.graphics.RectF;
+import android.os.SystemProperties;
import android.util.DisplayMetrics;
+import android.view.flags.Flags;
/**
* Helper class for drawing round scroll bars on round Wear devices.
+ *
+ * @hide
*/
-class RoundScrollbarRenderer {
+public class RoundScrollbarRenderer {
+ private static final String BLUECHIP_ENABLED_SYSPROP = "persist.cw_build.bluechip.enabled";
// The range of the scrollbar position represented as an angle in degrees.
private static final float SCROLLBAR_ANGLE_RANGE = 28.8f;
private static final float MAX_SCROLLBAR_ANGLE_SWIPE = 26.3f; // 90%
@@ -45,12 +54,15 @@ class RoundScrollbarRenderer {
private final Paint mTrackPaint = new Paint();
private final RectF mRect = new RectF();
private final View mParent;
- private final int mMaskThickness;
+ private final float mInset;
private float mPreviousMaxScroll = 0;
private float mMaxScrollDiff = 0;
private float mPreviousCurrentScroll = 0;
private float mCurrentScrollDiff = 0;
+ private float mThumbStrokeWidthAsDegrees = 0;
+ private boolean mDrawToLeft;
+ private boolean mUseRefactoredRoundScrollbar;
public RoundScrollbarRenderer(View parent) {
// Paints for the round scrollbar.
@@ -69,29 +81,36 @@ class RoundScrollbarRenderer {
// Fetch the resource indicating the thickness of CircularDisplayMask, rounding in the same
// way WindowManagerService.showCircularMask does. The scroll bar is inset by this amount so
// that it doesn't get clipped.
- mMaskThickness = parent.getContext().getResources().getDimensionPixelSize(
- com.android.internal.R.dimen.circular_display_mask_thickness);
- }
+ int maskThickness =
+ parent.getContext()
+ .getResources()
+ .getDimensionPixelSize(
+ com.android.internal.R.dimen.circular_display_mask_thickness);
- public void drawRoundScrollbars(Canvas canvas, float alpha, Rect bounds, boolean drawToLeft) {
- if (alpha == 0) {
- return;
- }
- // Get information about the current scroll state of the parent view.
- float maxScroll = mParent.computeVerticalScrollRange();
- float scrollExtent = mParent.computeVerticalScrollExtent();
- float newScroll = mParent.computeVerticalScrollOffset();
+ float thumbWidth = dpToPx(THUMB_WIDTH_DP);
+ mThumbPaint.setStrokeWidth(thumbWidth);
+ mTrackPaint.setStrokeWidth(thumbWidth);
+ mInset = thumbWidth / 2 + maskThickness;
+
+ mUseRefactoredRoundScrollbar =
+ Flags.useRefactoredRoundScrollbar()
+ && SystemProperties.getBoolean(BLUECHIP_ENABLED_SYSPROP, false);
+ }
+ private float computeScrollExtent(float scrollExtent, float maxScroll) {
if (scrollExtent <= 0) {
if (!mParent.canScrollVertically(1) && !mParent.canScrollVertically(-1)) {
- return;
+ return -1f;
} else {
- scrollExtent = 0;
+ return 0f;
}
} else if (maxScroll <= scrollExtent) {
- return;
+ return -1f;
}
+ return scrollExtent;
+ }
+ private void resizeGradually(float maxScroll, float newScroll) {
// Make changes to the VerticalScrollRange happen gradually
if (Math.abs(maxScroll - mPreviousMaxScroll) > RESIZING_THRESHOLD_PX
&& mPreviousMaxScroll != 0) {
@@ -106,51 +125,81 @@ class RoundScrollbarRenderer {
|| Math.abs(mCurrentScrollDiff) > RESIZING_THRESHOLD_PX) {
mMaxScrollDiff *= RESIZING_RATE;
mCurrentScrollDiff *= RESIZING_RATE;
-
- maxScroll -= mMaxScrollDiff;
- newScroll -= mCurrentScrollDiff;
} else {
mMaxScrollDiff = 0;
mCurrentScrollDiff = 0;
}
+ }
- float currentScroll = Math.max(0, newScroll);
- float linearThumbLength = scrollExtent;
- float thumbWidth = dpToPx(THUMB_WIDTH_DP);
- mThumbPaint.setStrokeWidth(thumbWidth);
- mTrackPaint.setStrokeWidth(thumbWidth);
+ public void drawRoundScrollbars(Canvas canvas, float alpha, Rect bounds, boolean drawToLeft) {
+ if (alpha == 0) {
+ return;
+ }
+ // Get information about the current scroll state of the parent view.
+ float maxScroll = mParent.computeVerticalScrollRange();
+ float scrollExtent = mParent.computeVerticalScrollExtent();
+ float newScroll = mParent.computeVerticalScrollOffset();
- setThumbColor(applyAlpha(DEFAULT_THUMB_COLOR, alpha));
- setTrackColor(applyAlpha(DEFAULT_TRACK_COLOR, alpha));
+ scrollExtent = computeScrollExtent(scrollExtent, maxScroll);
+ if (scrollExtent < 0f) {
+ return;
+ }
- // Normalize the sweep angle for the scroll bar.
- float sweepAngle = (linearThumbLength / maxScroll) * SCROLLBAR_ANGLE_RANGE;
- sweepAngle = clamp(sweepAngle, MIN_SCROLLBAR_ANGLE_SWIPE, MAX_SCROLLBAR_ANGLE_SWIPE);
- // Normalize the start angle so that it falls on the track.
- float startAngle = (currentScroll * (SCROLLBAR_ANGLE_RANGE - sweepAngle))
- / (maxScroll - linearThumbLength) - SCROLLBAR_ANGLE_RANGE / 2f;
- startAngle = clamp(startAngle, -SCROLLBAR_ANGLE_RANGE / 2f,
- SCROLLBAR_ANGLE_RANGE / 2f - sweepAngle);
+ // Make changes to the VerticalScrollRange happen gradually
+ resizeGradually(maxScroll, newScroll);
+ maxScroll -= mMaxScrollDiff;
+ newScroll -= mCurrentScrollDiff;
- // Draw the track and the thumb.
- float inset = thumbWidth / 2 + mMaskThickness;
- mRect.set(
- bounds.left + inset,
- bounds.top + inset,
- bounds.right - inset,
- bounds.bottom - inset);
-
- if (drawToLeft) {
- canvas.drawArc(mRect, 180 + SCROLLBAR_ANGLE_RANGE / 2f, -SCROLLBAR_ANGLE_RANGE, false,
- mTrackPaint);
- canvas.drawArc(mRect, 180 - startAngle, -sweepAngle, false, mThumbPaint);
+ applyThumbColor(alpha);
+
+ float sweepAngle = computeSweepAngle(scrollExtent, maxScroll);
+ float startAngle =
+ computeStartAngle(Math.max(0, newScroll), sweepAngle, maxScroll, scrollExtent);
+
+ updateBounds(bounds);
+
+ mDrawToLeft = drawToLeft;
+ drawRoundScrollbars(canvas, startAngle, sweepAngle, alpha);
+ }
+
+ private void drawRoundScrollbars(
+ Canvas canvas, float startAngle, float sweepAngle, float alpha) {
+ if (mUseRefactoredRoundScrollbar) {
+ draw(canvas, startAngle, sweepAngle, alpha);
} else {
- canvas.drawArc(mRect, -SCROLLBAR_ANGLE_RANGE / 2f, SCROLLBAR_ANGLE_RANGE, false,
- mTrackPaint);
- canvas.drawArc(mRect, startAngle, sweepAngle, false, mThumbPaint);
+ applyTrackColor(alpha);
+ drawArc(canvas, -SCROLLBAR_ANGLE_RANGE / 2f, SCROLLBAR_ANGLE_RANGE, mTrackPaint);
+ drawArc(canvas, startAngle, sweepAngle, mThumbPaint);
}
}
+ /** Returns true if horizontal bounds are updated */
+ private void updateBounds(Rect bounds) {
+ mRect.set(
+ bounds.left + mInset,
+ bounds.top + mInset,
+ bounds.right - mInset,
+ bounds.bottom - mInset);
+ mThumbStrokeWidthAsDegrees =
+ getVertexAngle((mRect.right - mRect.left) / 2f, mThumbPaint.getStrokeWidth() / 2f);
+ }
+
+ private float computeSweepAngle(float scrollExtent, float maxScroll) {
+ // Normalize the sweep angle for the scroll bar.
+ float sweepAngle = (scrollExtent / maxScroll) * SCROLLBAR_ANGLE_RANGE;
+ return clamp(sweepAngle, MIN_SCROLLBAR_ANGLE_SWIPE, MAX_SCROLLBAR_ANGLE_SWIPE);
+ }
+
+ private float computeStartAngle(
+ float currentScroll, float sweepAngle, float maxScroll, float scrollExtent) {
+ // Normalize the start angle so that it falls on the track.
+ float startAngle =
+ (currentScroll * (SCROLLBAR_ANGLE_RANGE - sweepAngle)) / (maxScroll - scrollExtent)
+ - SCROLLBAR_ANGLE_RANGE / 2f;
+ return clamp(
+ startAngle, -SCROLLBAR_ANGLE_RANGE / 2f, SCROLLBAR_ANGLE_RANGE / 2f - sweepAngle);
+ }
+
void getRoundVerticalScrollBarBounds(Rect bounds) {
float padding = dpToPx(OUTER_PADDING_DP);
final int width = mParent.mRight - mParent.mLeft;
@@ -164,10 +213,8 @@ class RoundScrollbarRenderer {
private static float clamp(float val, float min, float max) {
if (val < min) {
return min;
- } else if (val > max) {
- return max;
} else {
- return val;
+ return Math.min(val, max);
}
}
@@ -176,15 +223,17 @@ class RoundScrollbarRenderer {
return Color.argb(alphaByte, Color.red(color), Color.green(color), Color.blue(color));
}
- private void setThumbColor(int thumbColor) {
- if (mThumbPaint.getColor() != thumbColor) {
- mThumbPaint.setColor(thumbColor);
+ private void applyThumbColor(float alpha) {
+ int color = applyAlpha(DEFAULT_THUMB_COLOR, alpha);
+ if (mThumbPaint.getColor() != color) {
+ mThumbPaint.setColor(color);
}
}
- private void setTrackColor(int trackColor) {
- if (mTrackPaint.getColor() != trackColor) {
- mTrackPaint.setColor(trackColor);
+ private void applyTrackColor(float alpha) {
+ int color = applyAlpha(DEFAULT_TRACK_COLOR, alpha);
+ if (mTrackPaint.getColor() != color) {
+ mTrackPaint.setColor(color);
}
}
@@ -192,4 +241,88 @@ class RoundScrollbarRenderer {
return dp * ((float) mParent.getContext().getResources().getDisplayMetrics().densityDpi)
/ DisplayMetrics.DENSITY_DEFAULT;
}
+
+ private static float getVertexAngle(float edge, float base) {
+ float edgeSquare = edge * edge * 2;
+ float baseSquare = base * base;
+ float gapInRadians = acos(((edgeSquare - baseSquare) / edgeSquare));
+ return (float) Math.toDegrees(gapInRadians);
+ }
+
+ private static float getKiteEdge(float knownEdge, float angleBetweenKnownEdgesInDegrees) {
+ return (float) (2 * knownEdge * sin(Math.toRadians(angleBetweenKnownEdgesInDegrees / 2)));
+ }
+
+ private void draw(Canvas canvas, float thumbStartAngle, float thumbSweepAngle, float alpha) {
+ // Draws the top arc
+ drawTrack(
+ canvas,
+ // The highest point of the top track on a vertical scale. Here the thumb width is
+ // reduced to account for the arc formed by ROUND stroke style
+ -SCROLLBAR_ANGLE_RANGE / 2f - mThumbStrokeWidthAsDegrees,
+ // The lowest point of the top track on a vertical scale. Here the thumb width is
+ // reduced twice to (a) account for the arc formed by ROUND stroke style (b) gap
+ // between thumb and top track
+ thumbStartAngle - mThumbStrokeWidthAsDegrees * 2,
+ alpha);
+ // Draws the thumb
+ drawArc(canvas, thumbStartAngle, thumbSweepAngle, mThumbPaint);
+ // Draws the bottom arc
+ drawTrack(
+ canvas,
+ // The highest point of the bottom track on a vertical scale. Here the thumb width
+ // is added twice to (a) account for the arc formed by ROUND stroke style (b) gap
+ // between thumb and bottom track
+ (thumbStartAngle + thumbSweepAngle) + mThumbStrokeWidthAsDegrees * 2,
+ // The lowest point of the top track on a vertical scale. Here the thumb width is
+ // added to account for the arc formed by ROUND stroke style
+ SCROLLBAR_ANGLE_RANGE / 2f + mThumbStrokeWidthAsDegrees,
+ alpha);
+ }
+
+ private void drawTrack(Canvas canvas, float beginAngle, float endAngle, float alpha) {
+ // Angular distance between end and begin
+ float angleBetweenEndAndBegin = endAngle - beginAngle;
+ // The sweep angle for the track is the angular distance between end and begin less the
+ // thumb width twice to account for top and bottom arc formed by the ROUND stroke style
+ float sweepAngle = angleBetweenEndAndBegin - 2 * mThumbStrokeWidthAsDegrees;
+
+ float startAngle = -1f;
+ float strokeWidth = -1f;
+ if (sweepAngle > 0f) {
+ // The angle is greater than 0 which means a normal arc should be drawn with stroke
+ // width same as the thumb. The ROUND stroke style will cover the top/bottom arc of the
+ // track
+ startAngle = beginAngle + mThumbStrokeWidthAsDegrees;
+ strokeWidth = mThumbPaint.getStrokeWidth();
+ } else if (Math.abs(sweepAngle) < 2 * mThumbStrokeWidthAsDegrees) {
+ // The sweep angle is less than 0 but is still relevant in creating a circle for the
+ // top/bottom track. The start angle is adjusted to account for being the mid point of
+ // begin / end angle.
+ startAngle = beginAngle + angleBetweenEndAndBegin / 2;
+ // The radius of this circle forms a kite with the radius of the arc drawn for the rect
+ // with the given angular difference between the arc radius which is used to compute the
+ // new stroke width.
+ strokeWidth = getKiteEdge(((mRect.right - mRect.left) / 2), angleBetweenEndAndBegin);
+ // The opacity is decreased proportionally, if the stroke width of the track is 50% or
+ // less that that of the thumb
+ alpha = alpha * Math.min(1f, 2 * strokeWidth / mThumbPaint.getStrokeWidth());
+ // As we desire a circle to be drawn, the sweep angle is set to a minimal value
+ sweepAngle = Float.MIN_NORMAL;
+ } else {
+ return;
+ }
+
+ applyTrackColor(alpha);
+ mTrackPaint.setStrokeWidth(strokeWidth);
+ drawArc(canvas, startAngle, sweepAngle, mTrackPaint);
+ }
+
+ private void drawArc(Canvas canvas, float startAngle, float sweepAngle, Paint paint) {
+ if (mDrawToLeft) {
+ canvas.drawArc(mRect, /* startAngle= */ 180 - startAngle, -sweepAngle, false, paint);
+ } else {
+ canvas.drawArc(mRect, startAngle, sweepAngle, /* useCenter= */ false, paint);
+ }
+ }
}
diff --git a/core/java/android/view/SurfaceView.java b/core/java/android/view/SurfaceView.java
index eb59e21cd7e2..82235d252a72 100644
--- a/core/java/android/view/SurfaceView.java
+++ b/core/java/android/view/SurfaceView.java
@@ -192,7 +192,6 @@ public class SurfaceView extends View implements ViewRootImpl.SurfaceChangedCall
boolean mDrawFinished = false;
final Rect mScreenRect = new Rect();
- private final SurfaceSession mSurfaceSession = new SurfaceSession();
private final boolean mLimitedHdrEnabled = Flags.limitedHdr();
SurfaceControl mSurfaceControl;
@@ -1549,7 +1548,7 @@ public class SurfaceView extends View implements ViewRootImpl.SurfaceChangedCall
private void createBlastSurfaceControls(ViewRootImpl viewRoot, String name,
Transaction surfaceUpdateTransaction) {
if (mSurfaceControl == null) {
- mSurfaceControl = new SurfaceControl.Builder(mSurfaceSession)
+ mSurfaceControl = new SurfaceControl.Builder()
.setName(name)
.setLocalOwnerView(this)
.setParent(viewRoot.updateAndGetBoundsLayer(surfaceUpdateTransaction))
@@ -1559,7 +1558,7 @@ public class SurfaceView extends View implements ViewRootImpl.SurfaceChangedCall
}
if (mBlastSurfaceControl == null) {
- mBlastSurfaceControl = new SurfaceControl.Builder(mSurfaceSession)
+ mBlastSurfaceControl = new SurfaceControl.Builder()
.setName(name + "(BLAST)")
.setLocalOwnerView(this)
.setParent(mSurfaceControl)
@@ -1577,7 +1576,7 @@ public class SurfaceView extends View implements ViewRootImpl.SurfaceChangedCall
}
if (mBackgroundControl == null) {
- mBackgroundControl = new SurfaceControl.Builder(mSurfaceSession)
+ mBackgroundControl = new SurfaceControl.Builder()
.setName("Background for " + name)
.setLocalOwnerView(this)
.setOpaque(true)
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java
index 1b62cfdf5dcb..d9092ee737ce 100644
--- a/core/java/android/view/View.java
+++ b/core/java/android/view/View.java
@@ -29217,8 +29217,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
+ " shadowX=" + shadowTouchPoint.x + " shadowY=" + shadowTouchPoint.y);
}
- final SurfaceSession session = new SurfaceSession();
- final SurfaceControl surfaceControl = new SurfaceControl.Builder(session)
+ final SurfaceControl surfaceControl = new SurfaceControl.Builder()
.setName("drag surface")
.setParent(root.getSurfaceControl())
.setBufferSize(shadowSize.x, shadowSize.y)
@@ -29284,7 +29283,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
if (token == null) {
surface.destroy();
}
- session.kill();
surfaceControl.release();
}
}
diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java
index 1f17e8ec7b85..0efded2d0eb9 100644
--- a/core/java/android/view/ViewRootImpl.java
+++ b/core/java/android/view/ViewRootImpl.java
@@ -118,6 +118,7 @@ import static android.view.flags.Flags.disableDrawWakeLock;
import static android.view.flags.Flags.sensitiveContentAppProtection;
import static android.view.flags.Flags.sensitiveContentPrematureProtectionRemovedFix;
import static android.view.flags.Flags.toolkitFrameRateFunctionEnablingReadOnly;
+import static android.view.flags.Flags.toolkitFrameRateTouchBoost25q1;
import static android.view.flags.Flags.toolkitFrameRateTypingReadOnly;
import static android.view.flags.Flags.toolkitFrameRateVelocityMappingReadOnly;
import static android.view.flags.Flags.toolkitFrameRateViewEnablingReadOnly;
@@ -840,7 +841,6 @@ public final class ViewRootImpl implements ViewParent,
* surfaces can ensure they do not draw into the surface inset region set by the parent window.
*/
private SurfaceControl mBoundsLayer;
- private final SurfaceSession mSurfaceSession = new SurfaceSession();
private final Transaction mTransaction = new Transaction();
private final Transaction mFrameRateTransaction = new Transaction();
@@ -2711,7 +2711,7 @@ public final class ViewRootImpl implements ViewParent,
*/
public SurfaceControl updateAndGetBoundsLayer(Transaction t) {
if (mBoundsLayer == null) {
- mBoundsLayer = new SurfaceControl.Builder(mSurfaceSession)
+ mBoundsLayer = new SurfaceControl.Builder()
.setContainerLayer()
.setName("Bounds for - " + getTitle().toString())
.setParent(getSurfaceControl())
@@ -13109,6 +13109,11 @@ public final class ViewRootImpl implements ViewParent,
boolean desiredAction = motionEventAction != MotionEvent.ACTION_OUTSIDE;
boolean undesiredType = windowType == TYPE_INPUT_METHOD
&& sToolkitFrameRateTypingReadOnlyFlagValue;
+
+ // don't suppress touch boost for TYPE_INPUT_METHOD in ViewRootImpl
+ if (toolkitFrameRateTouchBoost25q1()) {
+ return desiredAction && shouldEnableDvrr() && getFrameRateBoostOnTouchEnabled();
+ }
// use toolkitSetFrameRate flag to gate the change
return desiredAction && !undesiredType && shouldEnableDvrr()
&& getFrameRateBoostOnTouchEnabled();
diff --git a/core/java/android/view/WindowlessWindowManager.java b/core/java/android/view/WindowlessWindowManager.java
index 5129461095a3..65e993049979 100644
--- a/core/java/android/view/WindowlessWindowManager.java
+++ b/core/java/android/view/WindowlessWindowManager.java
@@ -86,7 +86,6 @@ public class WindowlessWindowManager implements IWindowSession {
final HashMap<IBinder, ResizeCompleteCallback> mResizeCompletionForWindow =
new HashMap<IBinder, ResizeCompleteCallback>();
- private final SurfaceSession mSurfaceSession = new SurfaceSession();
protected final SurfaceControl mRootSurface;
private final Configuration mConfiguration;
private final IWindowSession mRealWm;
@@ -184,13 +183,13 @@ public class WindowlessWindowManager implements IWindowSession {
InputChannel outInputChannel, InsetsState outInsetsState,
InsetsSourceControl.Array outActiveControls, Rect outAttachedFrame,
float[] outSizeCompatScale) {
- final SurfaceControl leash = new SurfaceControl.Builder(mSurfaceSession)
+ final SurfaceControl leash = new SurfaceControl.Builder()
.setName(attrs.getTitle().toString() + "Leash")
.setCallsite("WindowlessWindowManager.addToDisplay")
.setParent(getParentSurface(window, attrs))
.build();
- final SurfaceControl sc = new SurfaceControl.Builder(mSurfaceSession)
+ final SurfaceControl sc = new SurfaceControl.Builder()
.setFormat(attrs.format)
.setBLASTLayer()
.setName(attrs.getTitle().toString())
diff --git a/core/java/android/view/accessibility/AccessibilityNodeInfo.java b/core/java/android/view/accessibility/AccessibilityNodeInfo.java
index c5ca059d1cea..60ccb77e1317 100644
--- a/core/java/android/view/accessibility/AccessibilityNodeInfo.java
+++ b/core/java/android/view/accessibility/AccessibilityNodeInfo.java
@@ -2288,10 +2288,7 @@ public class AccessibilityNodeInfo implements Parcelable {
/**
* Gets the node bounds in window coordinates.
* <p>
- * When magnification is enabled, the bounds in window are scaled up by magnification scale
- * and the positions are also adjusted according to the offset of magnification viewport.
- * For example, it returns Rect(-180, -180, 0, 0) for original bounds Rect(10, 10, 100, 100),
- * when the magnification scale is 2 and offsets for X and Y are both 200.
+ * The node bounds returned are not scaled by magnification.
* <p/>
*
* @param outBounds The output node bounds.
diff --git a/core/java/android/view/flags/refresh_rate_flags.aconfig b/core/java/android/view/flags/refresh_rate_flags.aconfig
index 7b049278731d..c31df73fbeae 100644
--- a/core/java/android/view/flags/refresh_rate_flags.aconfig
+++ b/core/java/android/view/flags/refresh_rate_flags.aconfig
@@ -119,4 +119,12 @@ flag {
description: "Feature flag to enable the fix for applyLegacyAnimation for VRR V QPR2"
bug: "335874198"
is_fixed_read_only: true
+}
+
+flag {
+ name: "toolkit_frame_rate_touch_boost_25q1"
+ namespace: "toolkit"
+ description: "Feature flag to not suppress touch boost for specific windowTypes in VRR V QPR2"
+ bug: "335874198"
+ is_exported: true
} \ No newline at end of file
diff --git a/core/java/android/view/flags/view_flags.aconfig b/core/java/android/view/flags/view_flags.aconfig
index 1cf26ab64c09..bb61ae49259c 100644
--- a/core/java/android/view/flags/view_flags.aconfig
+++ b/core/java/android/view/flags/view_flags.aconfig
@@ -116,4 +116,12 @@ flag {
description: "Add a SurfaceView composition order control API."
bug: "341021569"
is_fixed_read_only: true
+}
+
+flag {
+ name: "use_refactored_round_scrollbar"
+ namespace: "wear_frameworks"
+ description: "Use refactored round scrollbar."
+ bug: "333417898"
+ is_fixed_read_only: true
} \ No newline at end of file
diff --git a/core/java/android/webkit/WebChromeClient.java b/core/java/android/webkit/WebChromeClient.java
index b7ee0b8a238a..877fa74138fe 100644
--- a/core/java/android/webkit/WebChromeClient.java
+++ b/core/java/android/webkit/WebChromeClient.java
@@ -16,6 +16,8 @@
package android.webkit;
+import android.annotation.FlaggedApi;
+import android.annotation.IntDef;
import android.annotation.Nullable;
import android.annotation.SystemApi;
import android.content.Intent;
@@ -25,6 +27,9 @@ import android.net.Uri;
import android.os.Message;
import android.view.View;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+
public class WebChromeClient {
/**
@@ -547,18 +552,41 @@ public class WebChromeClient {
* Parameters used in the {@link #onShowFileChooser} method.
*/
public static abstract class FileChooserParams {
+ /** @hide */
+ @IntDef(prefix = { "MODE_" }, value = {
+ MODE_OPEN,
+ MODE_OPEN_MULTIPLE,
+ MODE_OPEN_FOLDER,
+ MODE_SAVE,
+ })
+ @Retention(RetentionPolicy.SOURCE)
+ public @interface Mode {}
+
/** Open single file. Requires that the file exists before allowing the user to pick it. */
public static final int MODE_OPEN = 0;
/** Like Open but allows multiple files to be selected. */
public static final int MODE_OPEN_MULTIPLE = 1;
- /** Like Open but allows a folder to be selected. The implementation should enumerate
- all files selected by this operation.
- This feature is not supported at the moment.
- @hide */
+ /** Like Open but allows a folder to be selected. */
+ @FlaggedApi(android.webkit.Flags.FLAG_FILE_SYSTEM_ACCESS)
public static final int MODE_OPEN_FOLDER = 2;
/** Allows picking a nonexistent file and saving it. */
public static final int MODE_SAVE = 3;
+ /** @hide */
+ @IntDef(prefix = { "PERMISSION_MODE_" }, value = {
+ PERMISSION_MODE_READ,
+ PERMISSION_MODE_READ_WRITE,
+ })
+ @Retention(RetentionPolicy.SOURCE)
+ public @interface PermissionMode {}
+
+ /** File or directory should be opened for reading only. */
+ @FlaggedApi(android.webkit.Flags.FLAG_FILE_SYSTEM_ACCESS)
+ public static final int PERMISSION_MODE_READ = 0;
+ /** File or directory should be opened for read and write. */
+ @FlaggedApi(android.webkit.Flags.FLAG_FILE_SYSTEM_ACCESS)
+ public static final int PERMISSION_MODE_READ_WRITE = 1;
+
/**
* Parse the result returned by the file picker activity. This method should be used with
* {@link #createIntent}. Refer to {@link #createIntent} for how to use it.
@@ -585,6 +613,7 @@ public class WebChromeClient {
/**
* Returns file chooser mode.
*/
+ @Mode
public abstract int getMode();
/**
@@ -616,6 +645,21 @@ public class WebChromeClient {
public abstract String getFilenameHint();
/**
+ * Returns permission mode {@link #PERMISSION_MODE_READ} or
+ * {@link #PERMISSION_MODE_READ_WRITE} which indicates the intended mode for opening a file
+ * or directory.
+ *
+ * This can be used to determine whether an Intent such as
+ * {@link android.content.Intent#ACTION_OPEN_DOCUMENT} should be used rather than
+ * {@link android.content.Intent#ACTION_GET_CONTENT} to choose files.
+ */
+ @FlaggedApi(Flags.FLAG_FILE_SYSTEM_ACCESS)
+ @PermissionMode
+ public int getPermissionMode() {
+ return PERMISSION_MODE_READ;
+ }
+
+ /**
* Creates an intent that would start a file picker for file selection.
* The Intent supports choosing files from simple file sources available
* on the device. Some advanced sources (for example, live media capture)
diff --git a/core/java/android/webkit/WebView.java b/core/java/android/webkit/WebView.java
index ffe8c80023c4..b6663992b851 100644
--- a/core/java/android/webkit/WebView.java
+++ b/core/java/android/webkit/WebView.java
@@ -17,6 +17,7 @@
package android.webkit;
import android.annotation.CallbackExecutor;
+import android.annotation.FlaggedApi;
import android.annotation.IntDef;
import android.annotation.NonNull;
import android.annotation.Nullable;
@@ -1495,7 +1496,13 @@ public class WebView extends AbsoluteLayout
* @param context Application Context.
* @param callback will be called on the UI thread with {@code true} if initialization is
* successful, {@code false} otherwise.
+ * @deprecated In WebView version 122.0.6174.0 and later, this initialization is done
+ * automatically, so there is no need to call this API. If called, this API will invoke
+ * the {@code callback} immediately with {@code true}, given that Safe Browsing
+ * is enabled and supported on the device.
*/
+ @Deprecated
+ @FlaggedApi(android.webkit.Flags.FLAG_DEPRECATE_START_SAFE_BROWSING)
public static void startSafeBrowsing(@NonNull Context context,
@Nullable ValueCallback<Boolean> callback) {
getFactory().getStatics().initSafeBrowsing(context, callback);
diff --git a/core/java/android/webkit/flags.aconfig b/core/java/android/webkit/flags.aconfig
index d1013a92476f..c9e94d2f57f6 100644
--- a/core/java/android/webkit/flags.aconfig
+++ b/core/java/android/webkit/flags.aconfig
@@ -11,6 +11,14 @@ flag {
}
flag {
+ name: "deprecate_start_safe_browsing"
+ is_exported: true
+ namespace: "webview"
+ description: "Deprecating startSafeBrowsing API because it is a NOOP"
+ bug: "372193372"
+}
+
+flag {
name: "mainline_apis"
is_exported: true
namespace: "webview"
@@ -26,3 +34,11 @@ flag {
description: "New feature reduce user-agent for webview"
bug: "371034303"
}
+
+flag {
+ name: "file_system_access"
+ is_exported: true
+ namespace: "webview"
+ description: "New APIs required by File System Access"
+ bug: "40101963"
+}
diff --git a/core/java/android/window/flags/lse_desktop_experience.aconfig b/core/java/android/window/flags/lse_desktop_experience.aconfig
index 45f6480b0b7f..0bcc9c1f58c5 100644
--- a/core/java/android/window/flags/lse_desktop_experience.aconfig
+++ b/core/java/android/window/flags/lse_desktop_experience.aconfig
@@ -341,3 +341,10 @@ flag {
description: "Add new keyboard shortcut of moving a task into next display"
bug: "364154795"
}
+
+flag {
+ name: "enable_drag_to_maximize"
+ namespace: "lse_desktop_experience"
+ description: "Enables a switch to change the concequence of dragging a window to the top edge."
+ bug: "372614715"
+}
diff --git a/core/java/android/window/flags/windowing_sdk.aconfig b/core/java/android/window/flags/windowing_sdk.aconfig
index f0ea7a82d763..b7012b68d459 100644
--- a/core/java/android/window/flags/windowing_sdk.aconfig
+++ b/core/java/android/window/flags/windowing_sdk.aconfig
@@ -108,3 +108,10 @@ flag {
description: "Makes WindowLayoutInfo accessible without racing in the Activity#onCreate()"
bug: "337820752"
}
+
+flag {
+ namespace: "windowing_sdk"
+ name: "better_support_non_match_parent_activity"
+ description: "Relax the assumption of non-match parent activity"
+ bug: "356277166"
+}
diff --git a/core/java/com/android/internal/jank/FrameTracker.java b/core/java/com/android/internal/jank/FrameTracker.java
index d474c6db4f02..6448f10f01b9 100644
--- a/core/java/com/android/internal/jank/FrameTracker.java
+++ b/core/java/com/android/internal/jank/FrameTracker.java
@@ -30,6 +30,7 @@ import static com.android.internal.jank.InteractionJankMonitor.ACTION_SESSION_CA
import static com.android.internal.jank.InteractionJankMonitor.ACTION_SESSION_END;
import static com.android.internal.jank.InteractionJankMonitor.EXECUTOR_TASK_TIMEOUT;
+import android.animation.AnimationHandler;
import android.annotation.IntDef;
import android.annotation.NonNull;
import android.annotation.Nullable;
@@ -344,7 +345,8 @@ public class FrameTracker implements HardwareRendererObserver.OnFrameMetricsAvai
@UiThread
public boolean end(@Reasons int reason) {
if (mCancelled || mEndVsyncId != INVALID_ID) return false;
- mEndVsyncId = mChoreographer.getVsyncId();
+ mEndVsyncId = AnimationHandler.getInstance().getLastAnimationFrameVsyncId(
+ mChoreographer.getVsyncId());
// Cancel the session if:
// 1. The session begins and ends at the same vsync id.
// 2. The session never begun.
diff --git a/core/java/com/android/internal/os/BatteryStatsHistory.java b/core/java/com/android/internal/os/BatteryStatsHistory.java
index d61785e5f3e9..07aa7206c0e7 100644
--- a/core/java/com/android/internal/os/BatteryStatsHistory.java
+++ b/core/java/com/android/internal/os/BatteryStatsHistory.java
@@ -83,7 +83,7 @@ public class BatteryStatsHistory {
private static final String TAG = "BatteryStatsHistory";
// Current on-disk Parcel version. Must be updated when the format of the parcelable changes
- private static final int VERSION = 210;
+ private static final int VERSION = 211;
private static final String HISTORY_DIR = "battery-history";
private static final String FILE_SUFFIX = ".bh";
@@ -210,6 +210,8 @@ public class BatteryStatsHistory {
private final MonotonicClock mMonotonicClock;
// Monotonic time when we started writing to the history buffer
private long mHistoryBufferStartTime;
+ // Monotonically increasing size of written history
+ private long mMonotonicHistorySize;
private final ArraySet<PowerStats.Descriptor> mWrittenPowerStatsDescriptors = new ArraySet<>();
private byte mLastHistoryStepLevel = 0;
private boolean mMutable = true;
@@ -909,6 +911,8 @@ public class BatteryStatsHistory {
}
// skip monotonic time field.
p.readLong();
+ // skip monotonic size field
+ p.readLong();
final int bufSize = p.readInt();
final int curPos = p.dataPosition();
@@ -964,6 +968,8 @@ public class BatteryStatsHistory {
}
// skip monotonic time field.
out.readLong();
+ // skip monotonic size field
+ out.readLong();
return true;
}
@@ -987,6 +993,7 @@ public class BatteryStatsHistory {
p.setDataPosition(0);
p.readInt(); // Skip the version field
long monotonicTime = p.readLong();
+ p.readLong(); // Skip monotonic size field
p.setDataPosition(pos);
return monotonicTime;
}
@@ -1819,6 +1826,7 @@ public class BatteryStatsHistory {
// as long as no bit has changed both between now and the last entry, as
// well as the last entry and the one before it (so we capture any toggles).
if (DEBUG) Slog.i(TAG, "ADD: rewinding back to " + mHistoryBufferLastPos);
+ mMonotonicHistorySize -= (mHistoryBuffer.dataSize() - mHistoryBufferLastPos);
mHistoryBuffer.setDataSize(mHistoryBufferLastPos);
mHistoryBuffer.setDataPosition(mHistoryBufferLastPos);
mHistoryBufferLastPos = -1;
@@ -1934,6 +1942,7 @@ public class BatteryStatsHistory {
}
mHistoryLastWritten.tagsFirstOccurrence = hasTags;
writeHistoryDelta(mHistoryBuffer, mHistoryLastWritten, mHistoryLastLastWritten);
+ mMonotonicHistorySize += (mHistoryBuffer.dataSize() - mHistoryBufferLastPos);
cur.wakelockTag = null;
cur.wakeReasonTag = null;
cur.eventCode = HistoryItem.EVENT_NONE;
@@ -2344,6 +2353,8 @@ public class BatteryStatsHistory {
}
mHistoryBufferStartTime = in.readLong();
+ mMonotonicHistorySize = in.readLong();
+
mHistoryBuffer.setDataSize(0);
mHistoryBuffer.setDataPosition(0);
@@ -2370,6 +2381,7 @@ public class BatteryStatsHistory {
private void writeHistoryBuffer(Parcel out) {
out.writeInt(BatteryStatsHistory.VERSION);
out.writeLong(mHistoryBufferStartTime);
+ out.writeLong(mMonotonicHistorySize);
out.writeInt(mHistoryBuffer.dataSize());
if (DEBUG) {
Slog.i(TAG, "***************** WRITING HISTORY: "
@@ -2457,6 +2469,14 @@ public class BatteryStatsHistory {
}
/**
+ * Returns the monotonically increasing size of written history, including the buffers
+ * that have already been discarded.
+ */
+ public long getMonotonicHistorySize() {
+ return mMonotonicHistorySize;
+ }
+
+ /**
* Prints battery stats history for debugging.
*/
public void dump(PrintWriter pw, long startTimeMs, long endTimeMs) {
diff --git a/core/java/com/android/internal/protolog/ProtoLogViewerConfigReader.java b/core/java/com/android/internal/protolog/ProtoLogViewerConfigReader.java
index 3c201fc42df3..571fe0ba37b2 100644
--- a/core/java/com/android/internal/protolog/ProtoLogViewerConfigReader.java
+++ b/core/java/com/android/internal/protolog/ProtoLogViewerConfigReader.java
@@ -96,6 +96,7 @@ public class ProtoLogViewerConfigReader {
logger.log("Unloading viewer config hash " + hash);
mLogMessageMap.remove(hash);
}
+ mGroupHashes.remove(group);
}
}
diff --git a/core/jni/Android.bp b/core/jni/Android.bp
index 2bc32657bd4a..816ace2310a5 100644
--- a/core/jni/Android.bp
+++ b/core/jni/Android.bp
@@ -73,12 +73,6 @@ cc_library_shared_for_libandroid_runtime {
srcs: [
"android_animation_PropertyValuesHolder.cpp",
- "android_database_CursorWindow.cpp",
- "android_database_SQLiteCommon.cpp",
- "android_database_SQLiteConnection.cpp",
- "android_database_SQLiteGlobal.cpp",
- "android_database_SQLiteDebug.cpp",
- "android_database_SQLiteRawStatement.cpp",
"android_os_SystemClock.cpp",
"android_os_SystemProperties.cpp",
"android_os_Trace.cpp",
@@ -163,6 +157,12 @@ cc_library_shared_for_libandroid_runtime {
"android_opengl_GLES31.cpp",
"android_opengl_GLES31Ext.cpp",
"android_opengl_GLES32.cpp",
+ "android_database_CursorWindow.cpp",
+ "android_database_SQLiteCommon.cpp",
+ "android_database_SQLiteConnection.cpp",
+ "android_database_SQLiteGlobal.cpp",
+ "android_database_SQLiteDebug.cpp",
+ "android_database_SQLiteRawStatement.cpp",
"android_graphics_GraphicBuffer.cpp",
"android_graphics_SurfaceTexture.cpp",
"android_view_CompositionSamplingListener.cpp",
@@ -428,7 +428,6 @@ cc_library_shared_for_libandroid_runtime {
"libnativehelper_jvm",
"libpiex",
"libpng",
- "libsqlite",
"libtiff_directory",
"libui-types",
"libutils",
@@ -444,6 +443,12 @@ cc_library_shared_for_libandroid_runtime {
host_linux: {
srcs: [
"android_content_res_ApkAssets.cpp",
+ "android_database_CursorWindow.cpp",
+ "android_database_SQLiteCommon.cpp",
+ "android_database_SQLiteConnection.cpp",
+ "android_database_SQLiteGlobal.cpp",
+ "android_database_SQLiteDebug.cpp",
+ "android_database_SQLiteRawStatement.cpp",
"android_hardware_input_InputApplicationHandle.cpp",
"android_os_MessageQueue.cpp",
"android_os_Parcel.cpp",
@@ -459,6 +464,7 @@ cc_library_shared_for_libandroid_runtime {
],
static_libs: [
"libbinderthreadstateutils",
+ "libsqlite",
"libgui_window_info_static",
],
shared_libs: [
diff --git a/core/jni/android_database_CursorWindow.cpp b/core/jni/android_database_CursorWindow.cpp
index 18c314610bb2..c0e9215267e6 100644
--- a/core/jni/android_database_CursorWindow.cpp
+++ b/core/jni/android_database_CursorWindow.cpp
@@ -38,9 +38,7 @@
#define LOG_NDEBUG 1
#include <androidfw/CursorWindow.h>
-#ifdef __linux__
#include "android_os_Parcel.h"
-#endif
#include "android_util_Binder.h"
#include "android_database_SQLiteCommon.h"
@@ -113,7 +111,6 @@ fail:
return 0;
}
-#ifdef __linux__
static jlong nativeCreateFromParcel(JNIEnv* env, jclass clazz, jobject parcelObj) {
Parcel* parcel = parcelForJavaObject(env, parcelObj);
@@ -131,7 +128,6 @@ static jlong nativeCreateFromParcel(JNIEnv* env, jclass clazz, jobject parcelObj
window->getNumRows(), window->getNumColumns(), window);
return reinterpret_cast<jlong>(window);
}
-#endif
static void nativeDispose(JNIEnv* env, jclass clazz, jlong windowPtr) {
CursorWindow* window = reinterpret_cast<CursorWindow*>(windowPtr);
@@ -146,7 +142,6 @@ static jstring nativeGetName(JNIEnv* env, jclass clazz, jlong windowPtr) {
return env->NewStringUTF(window->name().c_str());
}
-#ifdef __linux__
static void nativeWriteToParcel(JNIEnv * env, jclass clazz, jlong windowPtr,
jobject parcelObj) {
CursorWindow* window = reinterpret_cast<CursorWindow*>(windowPtr);
@@ -159,7 +154,6 @@ static void nativeWriteToParcel(JNIEnv * env, jclass clazz, jlong windowPtr,
jniThrowRuntimeException(env, msg.c_str());
}
}
-#endif
static void nativeClear(JNIEnv * env, jclass clazz, jlong windowPtr) {
CursorWindow* window = reinterpret_cast<CursorWindow*>(windowPtr);
@@ -526,35 +520,55 @@ static jboolean nativePutNull(JNIEnv* env, jclass clazz, jlong windowPtr,
return true;
}
-static const JNINativeMethod sMethods[] = {
- /* name, signature, funcPtr */
- {"nativeCreate", "(Ljava/lang/String;I)J", (void*)nativeCreate},
- {"nativeDispose", "(J)V", (void*)nativeDispose},
-#ifdef __linux__
- {"nativeCreateFromParcel", "(Landroid/os/Parcel;)J", (void*)nativeCreateFromParcel},
- {"nativeWriteToParcel", "(JLandroid/os/Parcel;)V", (void*)nativeWriteToParcel},
-#endif
- {"nativeGetName", "(J)Ljava/lang/String;", (void*)nativeGetName},
- {"nativeGetBlob", "(JII)[B", (void*)nativeGetBlob},
- {"nativeGetString", "(JII)Ljava/lang/String;", (void*)nativeGetString},
- {"nativeCopyStringToBuffer", "(JIILandroid/database/CharArrayBuffer;)V",
- (void*)nativeCopyStringToBuffer},
- {"nativePutBlob", "(J[BII)Z", (void*)nativePutBlob},
- {"nativePutString", "(JLjava/lang/String;II)Z", (void*)nativePutString},
-
- // ------- @FastNative below here ----------------------
- {"nativeClear", "(J)V", (void*)nativeClear},
- {"nativeGetNumRows", "(J)I", (void*)nativeGetNumRows},
- {"nativeSetNumColumns", "(JI)Z", (void*)nativeSetNumColumns},
- {"nativeAllocRow", "(J)Z", (void*)nativeAllocRow},
- {"nativeFreeLastRow", "(J)V", (void*)nativeFreeLastRow},
- {"nativeGetType", "(JII)I", (void*)nativeGetType},
- {"nativeGetLong", "(JII)J", (void*)nativeGetLong},
- {"nativeGetDouble", "(JII)D", (void*)nativeGetDouble},
-
- {"nativePutLong", "(JJII)Z", (void*)nativePutLong},
- {"nativePutDouble", "(JDII)Z", (void*)nativePutDouble},
- {"nativePutNull", "(JII)Z", (void*)nativePutNull},
+static const JNINativeMethod sMethods[] =
+{
+ /* name, signature, funcPtr */
+ { "nativeCreate", "(Ljava/lang/String;I)J",
+ (void*)nativeCreate },
+ { "nativeCreateFromParcel", "(Landroid/os/Parcel;)J",
+ (void*)nativeCreateFromParcel },
+ { "nativeDispose", "(J)V",
+ (void*)nativeDispose },
+ { "nativeWriteToParcel", "(JLandroid/os/Parcel;)V",
+ (void*)nativeWriteToParcel },
+
+ { "nativeGetName", "(J)Ljava/lang/String;",
+ (void*)nativeGetName },
+ { "nativeGetBlob", "(JII)[B",
+ (void*)nativeGetBlob },
+ { "nativeGetString", "(JII)Ljava/lang/String;",
+ (void*)nativeGetString },
+ { "nativeCopyStringToBuffer", "(JIILandroid/database/CharArrayBuffer;)V",
+ (void*)nativeCopyStringToBuffer },
+ { "nativePutBlob", "(J[BII)Z",
+ (void*)nativePutBlob },
+ { "nativePutString", "(JLjava/lang/String;II)Z",
+ (void*)nativePutString },
+
+ // ------- @FastNative below here ----------------------
+ { "nativeClear", "(J)V",
+ (void*)nativeClear },
+ { "nativeGetNumRows", "(J)I",
+ (void*)nativeGetNumRows },
+ { "nativeSetNumColumns", "(JI)Z",
+ (void*)nativeSetNumColumns },
+ { "nativeAllocRow", "(J)Z",
+ (void*)nativeAllocRow },
+ { "nativeFreeLastRow", "(J)V",
+ (void*)nativeFreeLastRow },
+ { "nativeGetType", "(JII)I",
+ (void*)nativeGetType },
+ { "nativeGetLong", "(JII)J",
+ (void*)nativeGetLong },
+ { "nativeGetDouble", "(JII)D",
+ (void*)nativeGetDouble },
+
+ { "nativePutLong", "(JJII)Z",
+ (void*)nativePutLong },
+ { "nativePutDouble", "(JDII)Z",
+ (void*)nativePutDouble },
+ { "nativePutNull", "(JII)Z",
+ (void*)nativePutNull },
};
int register_android_database_CursorWindow(JNIEnv* env)
diff --git a/core/jni/android_hardware_camera2_CameraMetadata.cpp b/core/jni/android_hardware_camera2_CameraMetadata.cpp
index 041fed74c573..a0987373687b 100644
--- a/core/jni/android_hardware_camera2_CameraMetadata.cpp
+++ b/core/jni/android_hardware_camera2_CameraMetadata.cpp
@@ -336,7 +336,7 @@ static void CameraMetadata_swap(JNIEnv *env, jclass thiz, jlong ptr, jlong other
static jbyteArray CameraMetadata_readValues(JNIEnv *env, jclass thiz, jint tag, jlong ptr) {
ALOGV("%s (tag = %d)", __FUNCTION__, tag);
- CameraMetadata* metadata = CameraMetadata_getPointerThrow(env, ptr);
+ const CameraMetadata *metadata = CameraMetadata_getPointerThrow(env, ptr);
if (metadata == NULL) return NULL;
const camera_metadata_t *metaBuffer = metadata->getAndLock();
@@ -349,16 +349,15 @@ static jbyteArray CameraMetadata_readValues(JNIEnv *env, jclass thiz, jint tag,
}
size_t tagSize = Helpers::getTypeSize(tagType);
- camera_metadata_entry entry = metadata->find(tag);
+ camera_metadata_ro_entry entry = metadata->find(tag);
if (entry.count == 0) {
- if (!metadata->exists(tag)) {
- ALOGV("%s: Tag %d does not have any entries", __FUNCTION__, tag);
- return NULL;
- } else {
- // OK: we will return a 0-sized array.
- ALOGV("%s: Tag %d had an entry, but it had 0 data", __FUNCTION__,
- tag);
- }
+ if (!metadata->exists(tag)) {
+ ALOGV("%s: Tag %d does not have any entries", __FUNCTION__, tag);
+ return NULL;
+ } else {
+ // OK: we will return a 0-sized array.
+ ALOGV("%s: Tag %d had an entry, but it had 0 data", __FUNCTION__, tag);
+ }
}
jsize byteCount = entry.count * tagSize;
diff --git a/core/jni/android_view_InputDevice.cpp b/core/jni/android_view_InputDevice.cpp
index f5992d906323..ce40e51bee99 100644
--- a/core/jni/android_view_InputDevice.cpp
+++ b/core/jni/android_view_InputDevice.cpp
@@ -60,7 +60,7 @@ jobject android_view_InputDevice_create(JNIEnv* env, const InputDeviceInfo& devi
? layoutInfo->layoutType.c_str()
: NULL));
- std::shared_ptr<KeyCharacterMap> map = deviceInfo.getKeyCharacterMap();
+ const KeyCharacterMap* map = deviceInfo.getKeyCharacterMap();
std::unique_ptr<KeyCharacterMap> mapCopy;
if (map != nullptr) {
mapCopy = std::make_unique<KeyCharacterMap>(*map);
diff --git a/core/jni/platform/host/HostRuntime.cpp b/core/jni/platform/host/HostRuntime.cpp
index bd403c7d9713..24551a4956a7 100644
--- a/core/jni/platform/host/HostRuntime.cpp
+++ b/core/jni/platform/host/HostRuntime.cpp
@@ -120,6 +120,7 @@ static const std::unordered_map<std::string, RegJNIRec> gRegJNIMap = {
#endif
{"android.content.res.StringBlock", REG_JNI(register_android_content_StringBlock)},
{"android.content.res.XmlBlock", REG_JNI(register_android_content_XmlBlock)},
+#ifdef __linux__
{"android.database.CursorWindow", REG_JNI(register_android_database_CursorWindow)},
{"android.database.sqlite.SQLiteConnection",
REG_JNI(register_android_database_SQLiteConnection)},
@@ -127,7 +128,6 @@ static const std::unordered_map<std::string, RegJNIRec> gRegJNIMap = {
{"android.database.sqlite.SQLiteDebug", REG_JNI(register_android_database_SQLiteDebug)},
{"android.database.sqlite.SQLiteRawStatement",
REG_JNI(register_android_database_SQLiteRawStatement)},
-#ifdef __linux__
{"android.os.Binder", REG_JNI(register_android_os_Binder)},
{"android.os.FileObserver", REG_JNI(register_android_os_FileObserver)},
{"android.os.MessageQueue", REG_JNI(register_android_os_MessageQueue)},
diff --git a/core/proto/android/app/OWNERS b/core/proto/android/app/OWNERS
index a137ea97b3a4..519bf9a7fa4b 100644
--- a/core/proto/android/app/OWNERS
+++ b/core/proto/android/app/OWNERS
@@ -1,3 +1,3 @@
-per-file appstartinfo.proto = file:/services/core/java/com/android/server/am/OWNERS
+per-file appstartinfo.proto = file:/PERFORMANCE_OWNERS
per-file location_time_zone_manager.proto = file:platform/frameworks/base:/services/core/java/com/android/server/timezonedetector/OWNERS
per-file time_zone_detector.proto = file:platform/frameworks/base:/services/core/java/com/android/server/timezonedetector/OWNERS
diff --git a/core/res/Android.bp b/core/res/Android.bp
index 17d7bfa40f90..aa324fcaca58 100644
--- a/core/res/Android.bp
+++ b/core/res/Android.bp
@@ -167,6 +167,7 @@ android_app {
"android.os.flags-aconfig",
"android.os.vibrator.flags-aconfig",
"android.media.tv.flags-aconfig",
+ "android.security.flags-aconfig",
"com.android.hardware.input.input-aconfig",
],
}
diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml
index 5693d666adc2..6ab64768d9f0 100644
--- a/core/res/AndroidManifest.xml
+++ b/core/res/AndroidManifest.xml
@@ -852,6 +852,7 @@
<protected-broadcast android:name="android.service.ondeviceintelligence.MODEL_LOADED" />
<protected-broadcast android:name="android.service.ondeviceintelligence.MODEL_UNLOADED" />
+
<!-- ====================================================================== -->
<!-- RUNTIME PERMISSIONS -->
<!-- ====================================================================== -->
@@ -4105,6 +4106,24 @@
android:protectionLevel="signature|installer" />
<uses-permission android:name="android.permission.MANAGE_ENHANCED_CONFIRMATION_STATES" />
+ <!-- Allows an application to toggle the device's advanced protection mode status.
+ @FlaggedApi("android.security.aapm_api")
+ @SystemApi
+ @hide -->
+ <permission android:name="android.permission.SET_ADVANCED_PROTECTION_MODE"
+ android:protectionLevel="signature|privileged"
+ android:featureFlag="android.security.aapm_api"/>
+ <uses-permission android:name="android.permission.SET_ADVANCED_PROTECTION_MODE"
+ android:featureFlag="android.security.aapm_api"/>
+
+ <!-- Allows an application to query the device's advanced protection mode status.
+ @FlaggedApi("android.security.aapm_api") -->
+ <permission android:name="android.permission.QUERY_ADVANCED_PROTECTION_MODE"
+ android:protectionLevel="normal"
+ android:featureFlag="android.security.aapm_api"/>
+ <uses-permission android:name="android.permission.QUERY_ADVANCED_PROTECTION_MODE"
+ android:featureFlag="android.security.aapm_api"/>
+
<!-- @SystemApi @hide Allows an application to set a device owner on retail demo devices.-->
<permission android:name="android.permission.PROVISION_DEMO_DEVICE"
android:protectionLevel="signature|setup|knownSigner"
@@ -8479,6 +8498,18 @@
android:protectionLevel="internal"
android:featureFlag="android.content.pm.verification_service" />
+ <!--
+ This permission allows the system to receive PACKAGE_CHANGED broadcasts when the component
+ state of a non-exported component has been changed.
+ <p>Not for use by third-party applications. </p>
+ <p>Protection level: internal
+ @hide
+ -->
+ <permission
+ android:name="android.permission.RECEIVE_PACKAGE_CHANGED_BROADCAST_ON_COMPONENT_STATE_CHANGED"
+ android:protectionLevel="internal"
+ android:featureFlag="android.content.pm.reduce_broadcasts_for_component_state_changes"/>
+
<!-- Attribution for Geofencing service. -->
<attribution android:tag="GeofencingService" android:label="@string/geofencing_service"/>
<!-- Attribution for Country Detector. -->
diff --git a/core/res/OWNERS b/core/res/OWNERS
index d109cee5d910..faed4d80f39b 100644
--- a/core/res/OWNERS
+++ b/core/res/OWNERS
@@ -53,7 +53,7 @@ per-file res/values/config_battery_saver.xml = file:/services/core/java/com/andr
per-file res/values/dimens_car.xml = file:/platform/packages/services/Car:/OWNERS
# Device Idle
-per-file res/values/config_device_idle.xml = file:/apex/jobscheduler/OWNERS
+per-file res/values/config_device_idle.xml = file:/apex/jobscheduler/DEVICE_IDLE_OWNERS
# Display Manager
per-file res/values/config_display.xml = file:/services/core/java/com/android/server/display/OWNERS
diff --git a/core/res/res/values-iw/strings.xml b/core/res/res/values-iw/strings.xml
index 8f4fbcd76939..9323276c2d5a 100644
--- a/core/res/res/values-iw/strings.xml
+++ b/core/res/res/values-iw/strings.xml
@@ -2122,7 +2122,7 @@
<string name="shortcut_restore_signature_mismatch" msgid="579345304221605479">"לא ניתן היה לשחזר את קיצור הדרך עקב חוסר התאמה בחתימה על האפליקציות"</string>
<string name="shortcut_restore_unknown_issue" msgid="2478146134395982154">"לא ניתן היה לשחזר את קיצור הדרך"</string>
<string name="shortcut_disabled_reason_unknown" msgid="753074793553599166">"מקש הקיצור מושבת"</string>
- <string name="harmful_app_warning_uninstall" msgid="6472912975664191772">"הסרת התקנה"</string>
+ <string name="harmful_app_warning_uninstall" msgid="6472912975664191772">"הסרה"</string>
<string name="harmful_app_warning_open_anyway" msgid="5963657791740211807">"לפתוח בכל זאת"</string>
<string name="harmful_app_warning_title" msgid="8794823880881113856">"אותרה אפליקציה מזיקה"</string>
<string name="slices_permission_request" msgid="3677129866636153406">"<xliff:g id="APP_0">%1$s</xliff:g> רוצה להציג חלקים מ-<xliff:g id="APP_2">%2$s</xliff:g>"</string>
diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml
index 91b482051065..41981715a855 100644
--- a/core/res/res/values/config.xml
+++ b/core/res/res/values/config.xml
@@ -4870,7 +4870,7 @@
See android.credentials.CredentialManager
-->
<string name="config_defaultCredentialManagerHybridService" translatable="false"></string>
-
+
<!-- The component name, flattened to a string, for the system's credential manager
autofill service. This service allows interceding autofill requests and routing
them to credential manager.
@@ -5783,6 +5783,9 @@
of known compatibility issues. -->
<string-array name="config_highRefreshRateBlacklist"></string-array>
+ <!-- The list of packages that will use ANGLE as the GLES driver -->
+ <string-array name="config_angleAllowList"></string-array>
+
<!-- The list of packages to automatically opt in to refresh rate suppressing by small area
detection. Format of this array should be packageName:threshold and threshold value should
be between 0 to 1-->
diff --git a/core/res/res/values/config_battery_stats.xml b/core/res/res/values/config_battery_stats.xml
index 80cf0881e8cc..9498273e17e0 100644
--- a/core/res/res/values/config_battery_stats.xml
+++ b/core/res/res/values/config_battery_stats.xml
@@ -45,7 +45,12 @@
<integer name="config_powerStatsAggregationPeriod">14400000</integer>
<!-- PowerStats aggregation span duration in milliseconds. This is the length of battery
- history time for every aggregated power stats span that is stored stored in PowerStatsStore.
+ history time for every aggregated power stats span that is stored in PowerStatsStore.
It should not be larger than config_powerStatsAggregationPeriod (but it can be the same) -->
<integer name="config_aggregatedPowerStatsSpanDuration">3600000</integer>
+
+ <!-- BatteryUsageStats accumulation period as determined by the size of accumulated
+ battery history, in bytes. -->
+ <integer name="config_accumulatedBatteryUsageStatsSpanSize">32768</integer>
+
</resources>
diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml
index 0348b4685a66..0b2b3453f20a 100644
--- a/core/res/res/values/symbols.xml
+++ b/core/res/res/values/symbols.xml
@@ -4459,6 +4459,7 @@
<java-symbol type="string" name="config_factoryResetPackage" />
<java-symbol type="array" name="config_highRefreshRateBlacklist" />
+ <java-symbol type="array" name="config_angleAllowList" />
<java-symbol type="array" name="config_forceSlowJpegModeList" />
<java-symbol type="array" name="pause_wallpaper_render_when_state_change" />
<java-symbol type="bool" name="config_pauseWallpaperRenderWhenStateChangeEnabled" />
@@ -5300,6 +5301,7 @@
<java-symbol type="string" name="config_powerStatsThrottlePeriods" />
<java-symbol type="integer" name="config_powerStatsAggregationPeriod" />
<java-symbol type="integer" name="config_aggregatedPowerStatsSpanDuration" />
+ <java-symbol type="integer" name="config_accumulatedBatteryUsageStatsSpanSize" />
<java-symbol name="materialColorOnSecondaryFixedVariant" type="attr"/>
<java-symbol name="materialColorOnTertiaryFixedVariant" type="attr"/>
diff --git a/core/res/res/values/themes_device_defaults.xml b/core/res/res/values/themes_device_defaults.xml
index d35bfb7bc1a1..352c3904406c 100644
--- a/core/res/res/values/themes_device_defaults.xml
+++ b/core/res/res/values/themes_device_defaults.xml
@@ -212,9 +212,9 @@ easier.
<!-- Color palette -->
<item name="colorPrimary">@color/primary_device_default_dark</item>
- <item name="colorPrimaryDark">@color/primary_device_default_dark</item>
+ <item name="colorPrimaryDark">@color/primary_dark_device_default_dark</item>
<item name="colorAccent">@color/accent_device_default_dark</item>
- <item name="colorAccentPrimary">@color/system_primary_dark</item>
+ <item name="colorAccentPrimary">@color/accent_primary_device_default</item>
<item name="colorAccentSecondary">@color/system_secondary_dark</item>
<item name="colorAccentTertiary">@color/system_tertiary_dark</item>
<item name="colorAccentPrimaryVariant">@color/system_primary_container_dark</item>
@@ -314,9 +314,9 @@ easier.
<style name="Theme.DeviceDefault.NoActionBar" parent="Theme.Material.NoActionBar">
<!-- Color palette -->
<item name="colorPrimary">@color/primary_device_default_dark</item>
- <item name="colorPrimaryDark">@color/primary_device_default_dark</item>
+ <item name="colorPrimaryDark">@color/primary_dark_device_default_dark</item>
<item name="colorAccent">@color/accent_device_default_dark</item>
- <item name="colorAccentPrimary">@color/system_primary_dark</item>
+ <item name="colorAccentPrimary">@color/accent_primary_device_default</item>
<item name="colorAccentSecondary">@color/system_secondary_dark</item>
<item name="colorAccentTertiary">@color/system_tertiary_dark</item>
<item name="colorAccentPrimaryVariant">@color/system_primary_container_dark</item>
@@ -431,9 +431,9 @@ easier.
<style name="Theme.DeviceDefault.NoActionBar.Fullscreen" parent="Theme.Material.NoActionBar.Fullscreen">
<!-- Color palette -->
<item name="colorPrimary">@color/primary_device_default_dark</item>
- <item name="colorPrimaryDark">@color/primary_device_default_dark</item>
+ <item name="colorPrimaryDark">@color/primary_dark_device_default_dark</item>
<item name="colorAccent">@color/accent_device_default_dark</item>
- <item name="colorAccentPrimary">@color/system_primary_dark</item>
+ <item name="colorAccentPrimary">@color/accent_primary_device_default</item>
<item name="colorAccentSecondary">@color/system_secondary_dark</item>
<item name="colorAccentTertiary">@color/system_tertiary_dark</item>
<item name="colorAccentPrimaryVariant">@color/system_primary_container_dark</item>
@@ -550,9 +550,9 @@ easier.
<style name="Theme.DeviceDefault.NoActionBar.Overscan" parent="Theme.Material.NoActionBar.Overscan">
<!-- Color palette -->
<item name="colorPrimary">@color/primary_device_default_dark</item>
- <item name="colorPrimaryDark">@color/primary_device_default_dark</item>
+ <item name="colorPrimaryDark">@color/primary_dark_device_default_dark</item>
<item name="colorAccent">@color/accent_device_default_dark</item>
- <item name="colorAccentPrimary">@color/system_primary_dark</item>
+ <item name="colorAccentPrimary">@color/accent_primary_device_default</item>
<item name="colorAccentSecondary">@color/system_secondary_dark</item>
<item name="colorAccentTertiary">@color/system_tertiary_dark</item>
<item name="colorAccentPrimaryVariant">@color/system_primary_container_dark</item>
@@ -668,9 +668,9 @@ easier.
<style name="Theme.DeviceDefault.NoActionBar.TranslucentDecor" parent="Theme.Material.NoActionBar.TranslucentDecor">
<!-- Color palette -->
<item name="colorPrimary">@color/primary_device_default_dark</item>
- <item name="colorPrimaryDark">@color/primary_device_default_dark</item>
+ <item name="colorPrimaryDark">@color/primary_dark_device_default_dark</item>
<item name="colorAccent">@color/accent_device_default_dark</item>
- <item name="colorAccentPrimary">@color/system_primary_dark</item>
+ <item name="colorAccentPrimary">@color/accent_primary_device_default</item>
<item name="colorAccentSecondary">@color/system_secondary_dark</item>
<item name="colorAccentTertiary">@color/system_tertiary_dark</item>
<item name="colorAccentPrimaryVariant">@color/system_primary_container_dark</item>
@@ -801,9 +801,9 @@ easier.
<!-- Color palette -->
<item name="colorPrimary">@color/primary_device_default_dark</item>
- <item name="colorPrimaryDark">@color/primary_device_default_dark</item>
+ <item name="colorPrimaryDark">@color/primary_dark_device_default_dark</item>
<item name="colorAccent">@color/accent_device_default_dark</item>
- <item name="colorAccentPrimary">@color/system_primary_dark</item>
+ <item name="colorAccentPrimary">@color/accent_primary_device_default</item>
<item name="colorAccentSecondary">@color/system_secondary_dark</item>
<item name="colorAccentTertiary">@color/system_tertiary_dark</item>
<item name="colorAccentPrimaryVariant">@color/system_primary_container_dark</item>
@@ -911,9 +911,9 @@ easier.
<style name="Theme.DeviceDefault.Dialog.MinWidth" parent="Theme.Material.Dialog.MinWidth">
<!-- Color palette -->
<item name="colorPrimary">@color/primary_device_default_dark</item>
- <item name="colorPrimaryDark">@color/primary_device_default_dark</item>
+ <item name="colorPrimaryDark">@color/primary_dark_device_default_dark</item>
<item name="colorAccent">@color/accent_device_default_dark</item>
- <item name="colorAccentPrimary">@color/system_primary_dark</item>
+ <item name="colorAccentPrimary">@color/accent_primary_device_default</item>
<item name="colorAccentSecondary">@color/system_secondary_dark</item>
<item name="colorAccentTertiary">@color/system_tertiary_dark</item>
<item name="colorAccentPrimaryVariant">@color/system_primary_container_dark</item>
@@ -1027,9 +1027,9 @@ easier.
<style name="Theme.DeviceDefault.Dialog.NoActionBar" parent="Theme.Material.Dialog.NoActionBar">
<!-- Color palette -->
<item name="colorPrimary">@color/primary_device_default_dark</item>
- <item name="colorPrimaryDark">@color/primary_device_default_dark</item>
+ <item name="colorPrimaryDark">@color/primary_dark_device_default_dark</item>
<item name="colorAccent">@color/accent_device_default_dark</item>
- <item name="colorAccentPrimary">@color/system_primary_dark</item>
+ <item name="colorAccentPrimary">@color/accent_primary_device_default</item>
<item name="colorAccentSecondary">@color/system_secondary_dark</item>
<item name="colorAccentTertiary">@color/system_tertiary_dark</item>
<item name="colorAccentPrimaryVariant">@color/system_primary_container_dark</item>
@@ -1144,9 +1144,9 @@ easier.
<style name="Theme.DeviceDefault.Dialog.NoActionBar.MinWidth" parent="Theme.Material.Dialog.NoActionBar.MinWidth">
<!-- Color palette -->
<item name="colorPrimary">@color/primary_device_default_dark</item>
- <item name="colorPrimaryDark">@color/primary_device_default_dark</item>
+ <item name="colorPrimaryDark">@color/primary_dark_device_default_dark</item>
<item name="colorAccent">@color/accent_device_default_dark</item>
- <item name="colorAccentPrimary">@color/system_primary_dark</item>
+ <item name="colorAccentPrimary">@color/accent_primary_device_default</item>
<item name="colorAccentSecondary">@color/system_secondary_dark</item>
<item name="colorAccentTertiary">@color/system_tertiary_dark</item>
<item name="colorAccentPrimaryVariant">@color/system_primary_container_dark</item>
@@ -1277,9 +1277,9 @@ easier.
<style name="Theme.DeviceDefault.DialogWhenLarge" parent="Theme.Material.DialogWhenLarge">
<!-- Color palette -->
<item name="colorPrimary">@color/primary_device_default_dark</item>
- <item name="colorPrimaryDark">@color/primary_device_default_dark</item>
+ <item name="colorPrimaryDark">@color/primary_dark_device_default_dark</item>
<item name="colorAccent">@color/accent_device_default_dark</item>
- <item name="colorAccentPrimary">@color/system_primary_dark</item>
+ <item name="colorAccentPrimary">@color/accent_primary_device_default</item>
<item name="colorAccentSecondary">@color/system_secondary_dark</item>
<item name="colorAccentTertiary">@color/system_tertiary_dark</item>
<item name="colorAccentPrimaryVariant">@color/system_primary_container_dark</item>
@@ -1395,9 +1395,9 @@ easier.
<style name="Theme.DeviceDefault.DialogWhenLarge.NoActionBar" parent="Theme.Material.DialogWhenLarge.NoActionBar">
<!-- Color palette -->
<item name="colorPrimary">@color/primary_device_default_dark</item>
- <item name="colorPrimaryDark">@color/primary_device_default_dark</item>
+ <item name="colorPrimaryDark">@color/primary_dark_device_default_dark</item>
<item name="colorAccent">@color/accent_device_default_dark</item>
- <item name="colorAccentPrimary">@color/system_primary_dark</item>
+ <item name="colorAccentPrimary">@color/accent_primary_device_default</item>
<item name="colorAccentSecondary">@color/system_secondary_dark</item>
<item name="colorAccentTertiary">@color/system_tertiary_dark</item>
<item name="colorAccentPrimaryVariant">@color/system_primary_container_dark</item>
@@ -1511,9 +1511,9 @@ easier.
<style name="Theme.DeviceDefault.Dialog.Presentation" parent="Theme.Material.Dialog.Presentation">
<!-- Color palette -->
<item name="colorPrimary">@color/primary_device_default_dark</item>
- <item name="colorPrimaryDark">@color/primary_device_default_dark</item>
+ <item name="colorPrimaryDark">@color/primary_dark_device_default_dark</item>
<item name="colorAccent">@color/accent_device_default_dark</item>
- <item name="colorAccentPrimary">@color/system_primary_dark</item>
+ <item name="colorAccentPrimary">@color/accent_primary_device_default</item>
<item name="colorAccentSecondary">@color/system_secondary_dark</item>
<item name="colorAccentTertiary">@color/system_tertiary_dark</item>
<item name="colorAccentPrimaryVariant">@color/system_primary_container_dark</item>
@@ -1629,9 +1629,9 @@ easier.
<style name="Theme.DeviceDefault.Panel" parent="Theme.Material.Panel">
<!-- Color palette -->
<item name="colorPrimary">@color/primary_device_default_dark</item>
- <item name="colorPrimaryDark">@color/primary_device_default_dark</item>
+ <item name="colorPrimaryDark">@color/primary_dark_device_default_dark</item>
<item name="colorAccent">@color/accent_device_default_dark</item>
- <item name="colorAccentPrimary">@color/system_primary_dark</item>
+ <item name="colorAccentPrimary">@color/accent_primary_device_default</item>
<item name="colorAccentSecondary">@color/system_secondary_dark</item>
<item name="colorAccentTertiary">@color/system_tertiary_dark</item>
<item name="colorAccentPrimaryVariant">@color/system_primary_container_dark</item>
@@ -1746,9 +1746,9 @@ easier.
<style name="Theme.DeviceDefault.Wallpaper" parent="Theme.Material.Wallpaper">
<!-- Color palette -->
<item name="colorPrimary">@color/primary_device_default_dark</item>
- <item name="colorPrimaryDark">@color/primary_device_default_dark</item>
+ <item name="colorPrimaryDark">@color/primary_dark_device_default_dark</item>
<item name="colorAccent">@color/accent_device_default_dark</item>
- <item name="colorAccentPrimary">@color/system_primary_dark</item>
+ <item name="colorAccentPrimary">@color/accent_primary_device_default</item>
<item name="colorAccentSecondary">@color/system_secondary_dark</item>
<item name="colorAccentTertiary">@color/system_tertiary_dark</item>
<item name="colorAccentPrimaryVariant">@color/system_primary_container_dark</item>
@@ -1863,9 +1863,9 @@ easier.
<style name="Theme.DeviceDefault.Wallpaper.NoTitleBar" parent="Theme.Material.Wallpaper.NoTitleBar">
<!-- Color palette -->
<item name="colorPrimary">@color/primary_device_default_dark</item>
- <item name="colorPrimaryDark">@color/primary_device_default_dark</item>
+ <item name="colorPrimaryDark">@color/primary_dark_device_default_dark</item>
<item name="colorAccent">@color/accent_device_default_dark</item>
- <item name="colorAccentPrimary">@color/system_primary_dark</item>
+ <item name="colorAccentPrimary">@color/accent_primary_device_default</item>
<item name="colorAccentSecondary">@color/system_secondary_dark</item>
<item name="colorAccentTertiary">@color/system_tertiary_dark</item>
<item name="colorAccentPrimaryVariant">@color/system_primary_container_dark</item>
@@ -1980,9 +1980,9 @@ easier.
<style name="Theme.DeviceDefault.InputMethod" parent="Theme.Material.InputMethod">
<!-- Color palette -->
<item name="colorPrimary">@color/primary_device_default_light</item>
- <item name="colorPrimaryDark">@color/primary_device_default_light</item>
+ <item name="colorPrimaryDark">@color/primary_dark_device_default_light</item>
<item name="colorAccent">@color/accent_device_default_light</item>
- <item name="colorAccentPrimary">@color/system_primary_dark</item>
+ <item name="colorAccentPrimary">@color/accent_primary_device_default</item>
<item name="colorAccentSecondary">@color/system_secondary_dark</item>
<item name="colorAccentTertiary">@color/system_tertiary_dark</item>
<item name="colorAccentPrimaryVariant">@color/system_primary_container_light</item>
@@ -2097,9 +2097,9 @@ easier.
<style name="Theme.DeviceDefault.VoiceInteractionSession" parent="Theme.Material.VoiceInteractionSession">
<!-- Color palette -->
<item name="colorPrimary">@color/primary_device_default_light</item>
- <item name="colorPrimaryDark">@color/primary_device_default_light</item>
+ <item name="colorPrimaryDark">@color/primary_dark_device_default_light</item>
<item name="colorAccent">@color/accent_device_default_light</item>
- <item name="colorAccentPrimary">@color/system_primary_dark</item>
+ <item name="colorAccentPrimary">@color/accent_primary_device_default</item>
<item name="colorAccentSecondary">@color/system_secondary_dark</item>
<item name="colorAccentTertiary">@color/system_tertiary_dark</item>
<item name="colorAccentPrimaryVariant">@color/system_primary_container_light</item>
@@ -2218,9 +2218,9 @@ easier.
<!-- Color palette -->
<item name="colorPrimary">@color/primary_device_default_dark</item>
- <item name="colorPrimaryDark">@color/primary_device_default_dark</item>
+ <item name="colorPrimaryDark">@color/primary_dark_device_default_dark</item>
<item name="colorAccent">@color/accent_device_default_dark</item>
- <item name="colorAccentPrimary">@color/system_primary_dark</item>
+ <item name="colorAccentPrimary">@color/accent_primary_device_default</item>
<item name="colorAccentSecondary">@color/system_secondary_dark</item>
<item name="colorAccentTertiary">@color/system_tertiary_dark</item>
<item name="colorAccentPrimaryVariant">@color/system_primary_container_dark</item>
@@ -2336,9 +2336,9 @@ easier.
<style name="Theme.DeviceDefault.SearchBar" parent="Theme.Material.SearchBar">
<!-- Color palette -->
<item name="colorPrimary">@color/primary_device_default_dark</item>
- <item name="colorPrimaryDark">@color/primary_device_default_dark</item>
+ <item name="colorPrimaryDark">@color/primary_dark_device_default_dark</item>
<item name="colorAccent">@color/accent_device_default_dark</item>
- <item name="colorAccentPrimary">@color/system_primary_dark</item>
+ <item name="colorAccentPrimary">@color/accent_primary_device_default</item>
<item name="colorAccentSecondary">@color/system_secondary_dark</item>
<item name="colorAccentTertiary">@color/system_tertiary_dark</item>
<item name="colorAccentPrimaryVariant">@color/system_primary_container_dark</item>
@@ -2451,9 +2451,9 @@ easier.
<style name="Theme.DeviceDefault.Dialog.NoFrame" parent="Theme.Material.Dialog.NoFrame">
<!-- Color palette -->
<item name="colorPrimary">@color/primary_device_default_dark</item>
- <item name="colorPrimaryDark">@color/primary_device_default_dark</item>
+ <item name="colorPrimaryDark">@color/primary_dark_device_default_dark</item>
<item name="colorAccent">@color/accent_device_default_dark</item>
- <item name="colorAccentPrimary">@color/system_primary_dark</item>
+ <item name="colorAccentPrimary">@color/accent_primary_device_default</item>
<item name="colorAccentSecondary">@color/system_secondary_dark</item>
<item name="colorAccentTertiary">@color/system_tertiary_dark</item>
<item name="colorAccentPrimaryVariant">@color/system_primary_container_dark</item>
@@ -2720,9 +2720,9 @@ easier.
<!-- Color palette -->
<item name="colorPrimary">@color/primary_device_default_light</item>
- <item name="colorPrimaryDark">@color/primary_device_default_light</item>
+ <item name="colorPrimaryDark">@color/primary_dark_device_default_light</item>
<item name="colorAccent">@color/accent_device_default_light</item>
- <item name="colorAccentPrimary">@color/system_primary_dark</item>
+ <item name="colorAccentPrimary">@color/accent_primary_device_default</item>
<item name="colorAccentSecondary">@color/system_secondary_dark</item>
<item name="colorAccentTertiary">@color/system_tertiary_dark</item>
<item name="colorAccentPrimaryVariant">@color/system_primary_container_light</item>
@@ -2821,9 +2821,9 @@ easier.
<style name="Theme.DeviceDefault.Light.DarkActionBar" parent="Theme.Material.Light.DarkActionBar">
<!-- Color palette -->
<item name="colorPrimary">@color/primary_device_default_dark</item>
- <item name="colorPrimaryDark">@color/primary_device_default_dark</item>
+ <item name="colorPrimaryDark">@color/primary_dark_device_default_dark</item>
<item name="colorAccent">@color/accent_device_default_light</item>
- <item name="colorAccentPrimary">@color/system_primary_dark</item>
+ <item name="colorAccentPrimary">@color/accent_primary_device_default</item>
<item name="colorAccentSecondary">@color/system_secondary_dark</item>
<item name="colorAccentTertiary">@color/system_tertiary_dark</item>
<item name="colorAccentPrimaryVariant">@color/system_primary_container_light</item>
@@ -2937,9 +2937,9 @@ easier.
<style name="Theme.DeviceDefault.Light.NoActionBar" parent="Theme.Material.Light.NoActionBar">
<!-- Color palette -->
<item name="colorPrimary">@color/primary_device_default_light</item>
- <item name="colorPrimaryDark">@color/primary_device_default_light</item>
+ <item name="colorPrimaryDark">@color/primary_dark_device_default_light</item>
<item name="colorAccent">@color/accent_device_default_light</item>
- <item name="colorAccentPrimary">@color/system_primary_dark</item>
+ <item name="colorAccentPrimary">@color/accent_primary_device_default</item>
<item name="colorAccentSecondary">@color/system_secondary_dark</item>
<item name="colorAccentTertiary">@color/system_tertiary_dark</item>
<item name="colorAccentPrimaryVariant">@color/system_primary_container_light</item>
@@ -3054,9 +3054,9 @@ easier.
<style name="Theme.DeviceDefault.Light.NoActionBar.Fullscreen" parent="Theme.Material.Light.NoActionBar.Fullscreen">
<!-- Color palette -->
<item name="colorPrimary">@color/primary_device_default_light</item>
- <item name="colorPrimaryDark">@color/primary_device_default_light</item>
+ <item name="colorPrimaryDark">@color/primary_dark_device_default_light</item>
<item name="colorAccent">@color/accent_device_default_light</item>
- <item name="colorAccentPrimary">@color/system_primary_dark</item>
+ <item name="colorAccentPrimary">@color/accent_primary_device_default</item>
<item name="colorAccentSecondary">@color/system_secondary_dark</item>
<item name="colorAccentTertiary">@color/system_tertiary_dark</item>
<item name="colorAccentPrimaryVariant">@color/system_primary_container_light</item>
@@ -3173,9 +3173,9 @@ easier.
<style name="Theme.DeviceDefault.Light.NoActionBar.Overscan" parent="Theme.Material.Light.NoActionBar.Overscan">
<!-- Color palette -->
<item name="colorPrimary">@color/primary_device_default_light</item>
- <item name="colorPrimaryDark">@color/primary_device_default_light</item>
+ <item name="colorPrimaryDark">@color/primary_dark_device_default_light</item>
<item name="colorAccent">@color/accent_device_default_light</item>
- <item name="colorAccentPrimary">@color/system_primary_dark</item>
+ <item name="colorAccentPrimary">@color/accent_primary_device_default</item>
<item name="colorAccentSecondary">@color/system_secondary_dark</item>
<item name="colorAccentTertiary">@color/system_tertiary_dark</item>
<item name="colorAccentPrimaryVariant">@color/system_primary_container_light</item>
@@ -3291,9 +3291,9 @@ easier.
<style name="Theme.DeviceDefault.Light.NoActionBar.TranslucentDecor" parent="Theme.Material.Light.NoActionBar.TranslucentDecor">
<!-- Color palette -->
<item name="colorPrimary">@color/primary_device_default_light</item>
- <item name="colorPrimaryDark">@color/primary_device_default_light</item>
+ <item name="colorPrimaryDark">@color/primary_dark_device_default_light</item>
<item name="colorAccent">@color/accent_device_default_light</item>
- <item name="colorAccentPrimary">@color/system_primary_dark</item>
+ <item name="colorAccentPrimary">@color/accent_primary_device_default</item>
<item name="colorAccentSecondary">@color/system_secondary_dark</item>
<item name="colorAccentTertiary">@color/system_tertiary_dark</item>
<item name="colorAccentPrimaryVariant">@color/system_primary_container_light</item>
@@ -3426,9 +3426,9 @@ easier.
<!-- Color palette -->
<item name="colorPrimary">@color/primary_device_default_light</item>
- <item name="colorPrimaryDark">@color/primary_device_default_light</item>
+ <item name="colorPrimaryDark">@color/primary_dark_device_default_light</item>
<item name="colorAccent">@color/accent_device_default_light</item>
- <item name="colorAccentPrimary">@color/system_primary_dark</item>
+ <item name="colorAccentPrimary">@color/accent_primary_device_default</item>
<item name="colorAccentSecondary">@color/system_secondary_dark</item>
<item name="colorAccentTertiary">@color/system_tertiary_dark</item>
<item name="colorAccentPrimaryVariant">@color/system_primary_container_light</item>
@@ -3535,9 +3535,9 @@ easier.
<!-- Color palette -->
<item name="colorPrimary">@color/primary_device_default_light</item>
- <item name="colorPrimaryDark">@color/primary_device_default_light</item>
+ <item name="colorPrimaryDark">@color/primary_dark_device_default_light</item>
<item name="colorAccent">@color/accent_device_default_light</item>
- <item name="colorAccentPrimary">@color/system_primary_dark</item>
+ <item name="colorAccentPrimary">@color/accent_primary_device_default</item>
<item name="colorAccentSecondary">@color/system_secondary_dark</item>
<item name="colorAccentTertiary">@color/system_tertiary_dark</item>
<item name="colorAccentPrimaryVariant">@color/system_primary_container_light</item>
@@ -3654,9 +3654,9 @@ easier.
<!-- Color palette -->
<item name="colorPrimary">@color/primary_device_default_light</item>
- <item name="colorPrimaryDark">@color/primary_device_default_light</item>
+ <item name="colorPrimaryDark">@color/primary_dark_device_default_light</item>
<item name="colorAccent">@color/accent_device_default_light</item>
- <item name="colorAccentPrimary">@color/system_primary_dark</item>
+ <item name="colorAccentPrimary">@color/accent_primary_device_default</item>
<item name="colorAccentSecondary">@color/system_secondary_dark</item>
<item name="colorAccentTertiary">@color/system_tertiary_dark</item>
<item name="colorAccentPrimaryVariant">@color/system_primary_container_light</item>
@@ -3774,9 +3774,9 @@ easier.
<!-- Color palette -->
<item name="colorPrimary">@color/primary_device_default_light</item>
- <item name="colorPrimaryDark">@color/primary_device_default_light</item>
+ <item name="colorPrimaryDark">@color/primary_dark_device_default_light</item>
<item name="colorAccent">@color/accent_device_default_light</item>
- <item name="colorAccentPrimary">@color/system_primary_dark</item>
+ <item name="colorAccentPrimary">@color/accent_primary_device_default</item>
<item name="colorAccentSecondary">@color/system_secondary_dark</item>
<item name="colorAccentTertiary">@color/system_tertiary_dark</item>
<item name="colorAccentPrimaryVariant">@color/system_primary_container_light</item>
@@ -3895,9 +3895,9 @@ easier.
<!-- Color palette -->
<item name="colorPrimary">@color/primary_device_default_light</item>
- <item name="colorPrimaryDark">@color/primary_device_default_light</item>
+ <item name="colorPrimaryDark">@color/primary_dark_device_default_light</item>
<item name="colorAccent">@color/accent_device_default_light</item>
- <item name="colorAccentPrimary">@color/system_primary_dark</item>
+ <item name="colorAccentPrimary">@color/accent_primary_device_default</item>
<item name="colorAccentSecondary">@color/system_secondary_dark</item>
<item name="colorAccentTertiary">@color/system_tertiary_dark</item>
<item name="colorAccentPrimaryVariant">@color/system_primary_container_light</item>
@@ -3996,9 +3996,9 @@ easier.
<!-- Color palette -->
<item name="colorPrimary">@color/primary_device_default_light</item>
- <item name="colorPrimaryDark">@color/primary_device_default_light</item>
+ <item name="colorPrimaryDark">@color/primary_dark_device_default_light</item>
<item name="colorAccent">@color/accent_device_default_light</item>
- <item name="colorAccentPrimary">@color/system_primary_dark</item>
+ <item name="colorAccentPrimary">@color/accent_primary_device_default</item>
<item name="colorAccentSecondary">@color/system_secondary_dark</item>
<item name="colorAccentTertiary">@color/system_tertiary_dark</item>
<item name="colorAccentPrimaryVariant">@color/system_primary_container_light</item>
@@ -4096,9 +4096,9 @@ easier.
<!-- Color palette -->
<item name="colorPrimary">@color/primary_device_default_light</item>
- <item name="colorPrimaryDark">@color/primary_device_default_light</item>
+ <item name="colorPrimaryDark">@color/primary_dark_device_default_light</item>
<item name="colorAccent">@color/accent_device_default_light</item>
- <item name="colorAccentPrimary">@color/system_primary_dark</item>
+ <item name="colorAccentPrimary">@color/accent_primary_device_default</item>
<item name="colorAccentSecondary">@color/system_secondary_dark</item>
<item name="colorAccentTertiary">@color/system_tertiary_dark</item>
<item name="colorAccentPrimaryVariant">@color/system_primary_container_light</item>
@@ -4217,9 +4217,9 @@ easier.
<!-- Color palette -->
<item name="colorPrimary">@color/primary_device_default_light</item>
- <item name="colorPrimaryDark">@color/primary_device_default_light</item>
+ <item name="colorPrimaryDark">@color/primary_dark_device_default_light</item>
<item name="colorAccent">@color/accent_device_default_light</item>
- <item name="colorAccentPrimary">@color/system_primary_dark</item>
+ <item name="colorAccentPrimary">@color/accent_primary_device_default</item>
<item name="colorAccentSecondary">@color/system_secondary_dark</item>
<item name="colorAccentTertiary">@color/system_tertiary_dark</item>
<item name="colorAccentPrimaryVariant">@color/system_primary_container_light</item>
@@ -4336,9 +4336,9 @@ easier.
<!-- Color palette -->
<item name="colorPrimary">@color/primary_device_default_light</item>
- <item name="colorPrimaryDark">@color/primary_device_default_light</item>
+ <item name="colorPrimaryDark">@color/primary_dark_device_default_light</item>
<item name="colorAccent">@color/accent_device_default_light</item>
- <item name="colorAccentPrimary">@color/system_primary_dark</item>
+ <item name="colorAccentPrimary">@color/accent_primary_device_default</item>
<item name="colorAccentSecondary">@color/system_secondary_dark</item>
<item name="colorAccentTertiary">@color/system_tertiary_dark</item>
<item name="colorAccentPrimaryVariant">@color/system_primary_container_light</item>
@@ -4454,9 +4454,9 @@ easier.
<style name="Theme.DeviceDefault.Light.Panel" parent="Theme.Material.Light.Panel">
<!-- Color palette -->
<item name="colorPrimary">@color/primary_device_default_light</item>
- <item name="colorPrimaryDark">@color/primary_device_default_light</item>
+ <item name="colorPrimaryDark">@color/primary_dark_device_default_light</item>
<item name="colorAccent">@color/accent_device_default_light</item>
- <item name="colorAccentPrimary">@color/system_primary_dark</item>
+ <item name="colorAccentPrimary">@color/accent_primary_device_default</item>
<item name="colorAccentSecondary">@color/system_secondary_dark</item>
<item name="colorAccentTertiary">@color/system_tertiary_dark</item>
<item name="colorAccentPrimaryVariant">@color/system_primary_container_light</item>
@@ -4571,9 +4571,9 @@ easier.
<!-- Color palette -->
<item name="colorPrimary">@color/primary_device_default_light</item>
- <item name="colorPrimaryDark">@color/primary_device_default_light</item>
+ <item name="colorPrimaryDark">@color/primary_dark_device_default_light</item>
<item name="colorAccent">@color/accent_device_default_light</item>
- <item name="colorAccentPrimary">@color/system_primary_dark</item>
+ <item name="colorAccentPrimary">@color/accent_primary_device_default</item>
<item name="colorAccentSecondary">@color/system_secondary_dark</item>
<item name="colorAccentTertiary">@color/system_tertiary_dark</item>
<item name="colorAccentPrimaryVariant">@color/system_primary_container_light</item>
@@ -4688,9 +4688,9 @@ easier.
<style name="Theme.DeviceDefault.Light.SearchBar" parent="Theme.Material.Light.SearchBar">
<!-- Color palette -->
<item name="colorPrimary">@color/primary_device_default_light</item>
- <item name="colorPrimaryDark">@color/primary_device_default_light</item>
+ <item name="colorPrimaryDark">@color/primary_dark_device_default_light</item>
<item name="colorAccent">@color/accent_device_default_light</item>
- <item name="colorAccentPrimary">@color/system_primary_dark</item>
+ <item name="colorAccentPrimary">@color/accent_primary_device_default</item>
<item name="colorAccentSecondary">@color/system_secondary_dark</item>
<item name="colorAccentTertiary">@color/system_tertiary_dark</item>
<item name="colorAccentPrimaryVariant">@color/system_primary_container_light</item>
@@ -4803,9 +4803,9 @@ easier.
<style name="Theme.DeviceDefault.Light.Voice" parent="Theme.Material.Light.Voice">
<!-- Color palette -->
<item name="colorPrimary">@color/primary_device_default_light</item>
- <item name="colorPrimaryDark">@color/primary_device_default_light</item>
+ <item name="colorPrimaryDark">@color/primary_dark_device_default_light</item>
<item name="colorAccent">@color/accent_device_default_light</item>
- <item name="colorAccentPrimary">@color/system_primary_dark</item>
+ <item name="colorAccentPrimary">@color/accent_primary_device_default</item>
<item name="colorAccentSecondary">@color/system_secondary_dark</item>
<item name="colorAccentTertiary">@color/system_tertiary_dark</item>
<item name="colorAccentPrimaryVariant">@color/system_primary_container_light</item>
@@ -4937,7 +4937,7 @@ easier.
<item name="colorPrimaryDark">@color/primary_dark_device_default_settings_light</item>
<item name="colorSecondary">@color/secondary_device_default_settings_light</item>
<item name="colorAccent">@color/accent_device_default_light</item>
- <item name="colorAccentPrimary">@color/system_primary_dark</item>
+ <item name="colorAccentPrimary">@color/accent_primary_device_default</item>
<item name="colorAccentSecondary">@color/system_secondary_dark</item>
<item name="colorAccentTertiary">@color/system_tertiary_dark</item>
<item name="colorAccentPrimaryVariant">@color/system_primary_container_light</item>
@@ -5044,7 +5044,7 @@ easier.
<item name="colorPrimaryDark">@color/primary_dark_device_default_settings_light</item>
<item name="colorSecondary">@color/secondary_device_default_settings_light</item>
<item name="colorAccent">@color/accent_device_default_light</item>
- <item name="colorAccentPrimary">@color/system_primary_dark</item>
+ <item name="colorAccentPrimary">@color/accent_primary_device_default</item>
<item name="colorAccentSecondary">@color/system_secondary_dark</item>
<item name="colorAccentTertiary">@color/system_tertiary_dark</item>
<item name="colorAccentPrimaryVariant">@color/system_primary_container_light</item>
@@ -5148,7 +5148,7 @@ easier.
<item name="colorPrimaryDark">@color/primary_dark_device_default_settings_light</item>
<item name="colorSecondary">@color/secondary_device_default_settings_light</item>
<item name="colorAccent">@color/accent_device_default_light</item>
- <item name="colorAccentPrimary">@color/system_primary_dark</item>
+ <item name="colorAccentPrimary">@color/accent_primary_device_default</item>
<item name="colorAccentSecondary">@color/system_secondary_dark</item>
<item name="colorAccentTertiary">@color/system_tertiary_dark</item>
<item name="colorAccentPrimaryVariant">@color/system_primary_container_light</item>
@@ -5245,7 +5245,7 @@ easier.
<item name="colorPrimaryDark">@color/primary_dark_device_default_settings</item>
<item name="colorSecondary">@color/secondary_device_default_settings</item>
<item name="colorAccent">@color/accent_device_default_dark</item>
- <item name="colorAccentPrimary">@color/system_primary_dark</item>
+ <item name="colorAccentPrimary">@color/accent_primary_device_default</item>
<item name="colorAccentSecondary">@color/system_secondary_dark</item>
<item name="colorAccentTertiary">@color/system_tertiary_dark</item>
<item name="colorAccentPrimaryVariant">@color/system_primary_container_dark</item>
@@ -5361,7 +5361,7 @@ easier.
<item name="colorPrimaryDark">@color/primary_dark_device_default_settings</item>
<item name="colorSecondary">@color/secondary_device_default_settings</item>
<item name="colorAccent">@color/accent_device_default_light</item>
- <item name="colorAccentPrimary">@color/system_primary_dark</item>
+ <item name="colorAccentPrimary">@color/accent_primary_device_default</item>
<item name="colorAccentSecondary">@color/system_secondary_dark</item>
<item name="colorAccentTertiary">@color/system_tertiary_dark</item>
<item name="colorAccentPrimaryVariant">@color/system_primary_container_light</item>
@@ -5487,7 +5487,7 @@ easier.
<item name="colorPrimaryDark">@color/primary_dark_device_default_settings</item>
<item name="colorSecondary">@color/secondary_device_default_settings</item>
<item name="colorAccent">@color/accent_device_default_light</item>
- <item name="colorAccentPrimary">@color/system_primary_dark</item>
+ <item name="colorAccentPrimary">@color/accent_primary_device_default</item>
<item name="colorAccentSecondary">@color/system_secondary_dark</item>
<item name="colorAccentTertiary">@color/system_tertiary_dark</item>
<item name="colorAccentPrimaryVariant">@color/system_primary_container_light</item>
@@ -5606,7 +5606,7 @@ easier.
<item name="colorPrimaryDark">@color/primary_dark_device_default_settings</item>
<item name="colorSecondary">@color/secondary_device_default_settings</item>
<item name="colorAccent">@color/accent_device_default_light</item>
- <item name="colorAccentPrimary">@color/system_primary_dark</item>
+ <item name="colorAccentPrimary">@color/accent_primary_device_default</item>
<item name="colorAccentSecondary">@color/system_secondary_dark</item>
<item name="colorAccentTertiary">@color/system_tertiary_dark</item>
<item name="colorAccentPrimaryVariant">@color/system_primary_container_light</item>
@@ -5788,7 +5788,7 @@ easier.
<style name="ThemeOverlay.DeviceDefault.Accent">
<item name="colorAccent">@color/accent_device_default_dark</item>
- <item name="colorAccentPrimary">@color/system_primary_dark</item>
+ <item name="colorAccentPrimary">@color/accent_primary_device_default</item>
<item name="colorAccentSecondary">@color/system_secondary_dark</item>
<item name="colorAccentTertiary">@color/system_tertiary_dark</item>
@@ -5863,7 +5863,7 @@ easier.
<style name="ThemeOverlay.DeviceDefault.Accent.Light">
<item name="colorAccent">@color/accent_device_default_light</item>
- <item name="colorAccentPrimary">@color/system_primary_dark</item>
+ <item name="colorAccentPrimary">@color/accent_primary_device_default</item>
<item name="colorAccentSecondary">@color/system_secondary_dark</item>
<item name="colorAccentTertiary">@color/system_tertiary_dark</item>
@@ -5942,7 +5942,7 @@ easier.
<style name="ThemeOverlay.DeviceDefault.Dark.ActionBar.Accent" parent="ThemeOverlay.Material.Dark.ActionBar">
<item name="colorAccent">@color/accent_device_default_dark</item>
- <item name="colorAccentPrimary">@color/system_primary_dark</item>
+ <item name="colorAccentPrimary">@color/accent_primary_device_default</item>
<item name="colorAccentSecondary">@color/system_secondary_dark</item>
<item name="colorAccentTertiary">@color/system_tertiary_dark</item>
diff --git a/core/tests/coretests/src/android/animation/ValueAnimatorTests.java b/core/tests/coretests/src/android/animation/ValueAnimatorTests.java
index eb463fd9a76b..04698465e971 100644
--- a/core/tests/coretests/src/android/animation/ValueAnimatorTests.java
+++ b/core/tests/coretests/src/android/animation/ValueAnimatorTests.java
@@ -18,6 +18,8 @@ package android.animation;
import static android.test.MoreAsserts.assertNotEqual;
+import static com.google.common.truth.Truth.assertThat;
+
import static junit.framework.Assert.assertEquals;
import static junit.framework.Assert.assertFalse;
import static junit.framework.Assert.assertNotNull;
@@ -892,6 +894,34 @@ public class ValueAnimatorTests {
}
@Test
+ public void testPostNotifyEndListener() throws Throwable {
+ ValueAnimator.setPostNotifyEndListenerEnabled(true);
+ final CountDownLatch latch = new CountDownLatch(1);
+ final long[] lastAnimFrameId = new long[1];
+ final long[] endAnimCallbackId = new long[1];
+ try {
+ a1.addUpdateListener(animator -> {
+ if (animator.getAnimatedFraction() == 1f) {
+ lastAnimFrameId[0] = Choreographer.getInstance().getVsyncId();
+ }
+ });
+ a1.addListener(new MyListener() {
+ @Override
+ public void onAnimationEnd(Animator animation) {
+ super.onAnimationEnd(animation);
+ endAnimCallbackId[0] = Choreographer.getInstance().getVsyncId();
+ latch.countDown();
+ }
+ });
+ mActivityRule.runOnUiThread(() -> a1.start());
+ assertTrue(latch.await(1, TimeUnit.SECONDS));
+ assertThat(endAnimCallbackId[0]).isGreaterThan(lastAnimFrameId[0]);
+ } finally {
+ ValueAnimator.setPostNotifyEndListenerEnabled(false);
+ }
+ }
+
+ @Test
public void testZeroDuration() throws Throwable {
// Run two animators with zero duration, with one running forward and the other one
// backward. Check that the animations start and finish with the correct end fractions.
diff --git a/core/tests/coretests/src/android/app/NotificationChannelTest.java b/core/tests/coretests/src/android/app/NotificationChannelTest.java
index e19f887c1284..e4b54071e892 100644
--- a/core/tests/coretests/src/android/app/NotificationChannelTest.java
+++ b/core/tests/coretests/src/android/app/NotificationChannelTest.java
@@ -27,6 +27,7 @@ import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.argThat;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.doAnswer;
+import static org.mockito.Mockito.doThrow;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
@@ -51,6 +52,7 @@ import android.platform.test.annotations.UsesFlags;
import android.platform.test.flag.junit.FlagsParameterization;
import android.platform.test.flag.junit.SetFlagsRule;
import android.provider.MediaStore.Audio.AudioColumns;
+import android.provider.Settings;
import android.test.mock.MockContentResolver;
import android.util.Xml;
@@ -399,6 +401,29 @@ public class NotificationChannelTest {
}
@Test
+ public void testWriteXmlForBackup_noAccessToFile() throws Exception {
+ Uri uri = Uri.parse("content://media/1");
+
+ AudioAttributes mAudioAttributes =
+ new AudioAttributes.Builder()
+ .setContentType(AudioAttributes.CONTENT_TYPE_UNKNOWN)
+ .setUsage(AudioAttributes.USAGE_NOTIFICATION)
+ .setFlags(AudioAttributes.FLAG_AUDIBILITY_ENFORCED)
+ .build();
+
+ NotificationChannel channel = new NotificationChannel("id", "name", 3);
+ channel.setSound(uri, mAudioAttributes);
+
+ when(mIContentProvider.canonicalize(any(), any())).thenThrow(new SecurityException(""));
+ doThrow(new SecurityException("")).when(mIContentProvider)
+ .canonicalizeAsync(any(), any(), any());
+
+ NotificationChannel restoredChannel = backUpAndRestore(channel);
+ assertThat(restoredChannel.getSound())
+ .isEqualTo(Settings.System.DEFAULT_NOTIFICATION_URI);
+ }
+
+ @Test
public void testVibrationGetters_nonPatternBasedVibrationEffect_waveform() throws Exception {
mSetFlagsRule.enableFlags(Flags.FLAG_NOTIFICATION_CHANNEL_VIBRATION_EFFECT_API);
NotificationChannel channel = new NotificationChannel("id", "name", 3);
diff --git a/core/tests/coretests/src/android/app/PropertyInvalidatedCacheTests.java b/core/tests/coretests/src/android/app/PropertyInvalidatedCacheTests.java
index 228647ae9094..dcea5b299829 100644
--- a/core/tests/coretests/src/android/app/PropertyInvalidatedCacheTests.java
+++ b/core/tests/coretests/src/android/app/PropertyInvalidatedCacheTests.java
@@ -19,6 +19,7 @@ package android.app;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotSame;
import static org.junit.Assert.assertSame;
+import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import android.platform.test.annotations.IgnoreUnderRavenwood;
@@ -86,16 +87,23 @@ public class PropertyInvalidatedCacheTests {
public Boolean apply(Integer x) {
return mServer.query(x);
}
+
@Override
public boolean shouldBypassCache(Integer x) {
return x % 13 == 0;
}
}
- // Ensure all test nonces are cleared after the test ends.
+ // Prepare for testing.
+ @Before
+ public void setUp() throws Exception {
+ PropertyInvalidatedCache.setTestMode(true);
+ }
+
+ // Ensure all test configurations are cleared.
@After
public void tearDown() throws Exception {
- PropertyInvalidatedCache.resetAfterTest();
+ PropertyInvalidatedCache.setTestMode(false);
}
// This test is disabled pending an sepolicy change that allows any app to set the
@@ -368,17 +376,51 @@ public class PropertyInvalidatedCacheTests {
assertEquals(n1, "cache_key.bluetooth.get_state");
}
- // It is illegal to continue to use a cache with a test key after calling setTestMode(false).
- // This test verifies the code detects errors in calling setTestMode().
+ // Verify that test mode works properly.
@Test
public void testTestMode() {
- TestCache cache = new TestCache();
- cache.invalidateCache();
- PropertyInvalidatedCache.resetAfterTest();
+ // Create a cache that will write a system nonce.
+ TestCache sysCache = new TestCache(PropertyInvalidatedCache.MODULE_SYSTEM, "mode1");
+ try {
+ // Invalidate the cache, which writes the system property. There must be a permission
+ // failure.
+ sysCache.invalidateCache();
+ fail("expected permission failure");
+ } catch (RuntimeException e) {
+ // The expected exception is a bare RuntimeException. The test does not attempt to
+ // validate the text of the exception message.
+ }
+
+ sysCache.testPropertyName();
+ // Invalidate the cache. This must succeed because the property has been marked for
+ // testing.
+ sysCache.invalidateCache();
+
+ // Create a cache that uses MODULE_TEST. Invalidation succeeds whether or not the
+ // property is tagged as being tested.
+ TestCache testCache = new TestCache(PropertyInvalidatedCache.MODULE_TEST, "mode2");
+ testCache.invalidateCache();
+ testCache.testPropertyName();
+ testCache.invalidateCache();
+
+ // Clear test mode. This fails if test mode is not enabled.
+ PropertyInvalidatedCache.setTestMode(false);
try {
- cache.invalidateCache();
+ PropertyInvalidatedCache.setTestMode(false);
fail("expected an IllegalStateException");
- } catch (IllegalStateException expected) {
+ } catch (IllegalStateException e) {
+ // The expected exception.
}
+ // Configuring a property for testing must fail if test mode is false.
+ TestCache cache2 = new TestCache(PropertyInvalidatedCache.MODULE_SYSTEM, "mode3");
+ try {
+ cache2.testPropertyName();
+ fail("expected an IllegalStateException");
+ } catch (IllegalStateException e) {
+ // The expected exception.
+ }
+
+ // Re-enable test mode (so that the cleanup for the test does not throw).
+ PropertyInvalidatedCache.setTestMode(true);
}
}
diff --git a/core/tests/coretests/src/android/content/pm/verify/VerificationSessionTest.java b/core/tests/coretests/src/android/content/pm/verify/VerificationSessionTest.java
index 987f68d4f9e1..90ae306952fe 100644
--- a/core/tests/coretests/src/android/content/pm/verify/VerificationSessionTest.java
+++ b/core/tests/coretests/src/android/content/pm/verify/VerificationSessionTest.java
@@ -16,6 +16,9 @@
package android.content.pm.verify;
+import static android.content.pm.PackageInstaller.VERIFICATION_POLICY_BLOCK_FAIL_CLOSED;
+import static android.content.pm.PackageInstaller.VERIFICATION_POLICY_BLOCK_FAIL_WARN;
+
import static com.google.common.truth.Truth.assertThat;
import static org.mockito.ArgumentMatchers.anyInt;
@@ -23,12 +26,13 @@ import static org.mockito.ArgumentMatchers.anyLong;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.verifyNoMoreInteractions;
+import static org.mockito.Mockito.verifyZeroInteractions;
import static org.mockito.Mockito.when;
import android.content.pm.SharedLibraryInfo;
import android.content.pm.SigningInfo;
import android.content.pm.VersionedPackage;
-import android.content.pm.verify.pkg.IVerificationSessionCallback;
import android.content.pm.verify.pkg.IVerificationSessionInterface;
import android.content.pm.verify.pkg.VerificationSession;
import android.content.pm.verify.pkg.VerificationStatus;
@@ -73,13 +77,12 @@ public class VerificationSessionTest {
private static final long TEST_EXTEND_TIME = 2000L;
private static final String TEST_KEY = "test key";
private static final String TEST_VALUE = "test value";
+ private static final int TEST_POLICY = VERIFICATION_POLICY_BLOCK_FAIL_CLOSED;
private final ArrayList<SharedLibraryInfo> mTestDeclaredLibraries = new ArrayList<>();
private final PersistableBundle mTestExtensionParams = new PersistableBundle();
@Mock
private IVerificationSessionInterface mTestSessionInterface;
- @Mock
- private IVerificationSessionCallback mTestCallback;
private VerificationSession mTestSession;
@Before
@@ -90,7 +93,7 @@ public class VerificationSessionTest {
mTestExtensionParams.putString(TEST_KEY, TEST_VALUE);
mTestSession = new VerificationSession(TEST_ID, TEST_INSTALL_SESSION_ID,
TEST_PACKAGE_NAME, TEST_PACKAGE_URI, TEST_SIGNING_INFO, mTestDeclaredLibraries,
- mTestExtensionParams, mTestSessionInterface, mTestCallback);
+ mTestExtensionParams, TEST_POLICY, mTestSessionInterface);
}
@Test
@@ -118,6 +121,7 @@ public class VerificationSessionTest {
// structure is different, but all the key/value pairs should be preserved as before.
assertThat(sessionFromParcel.getExtensionParams().getString(TEST_KEY))
.isEqualTo(mTestExtensionParams.getString(TEST_KEY));
+ assertThat(sessionFromParcel.getVerificationPolicy()).isEqualTo(TEST_POLICY);
}
@Test
@@ -131,25 +135,60 @@ public class VerificationSessionTest {
assertThat(mTestSession.extendTimeRemaining(TEST_EXTEND_TIME)).isEqualTo(TEST_EXTEND_TIME);
verify(mTestSessionInterface, times(1)).extendTimeRemaining(
eq(TEST_ID), eq(TEST_EXTEND_TIME));
- }
- @Test
- public void testCallback() throws Exception {
PersistableBundle response = new PersistableBundle();
response.putString("test key", "test value");
final VerificationStatus status =
new VerificationStatus.Builder().setVerified(true).build();
mTestSession.reportVerificationComplete(status);
- verify(mTestCallback, times(1)).reportVerificationComplete(
+ verify(mTestSessionInterface, times(1)).reportVerificationComplete(
eq(TEST_ID), eq(status));
mTestSession.reportVerificationComplete(status, response);
- verify(mTestCallback, times(1))
+ verify(mTestSessionInterface, times(1))
.reportVerificationCompleteWithExtensionResponse(
eq(TEST_ID), eq(status), eq(response));
final int reason = VerificationSession.VERIFICATION_INCOMPLETE_UNKNOWN;
mTestSession.reportVerificationIncomplete(reason);
- verify(mTestCallback, times(1)).reportVerificationIncomplete(
+ verify(mTestSessionInterface, times(1)).reportVerificationIncomplete(
eq(TEST_ID), eq(reason));
}
+
+ @Test
+ public void testPolicyNoOverride() {
+ assertThat(mTestSession.getVerificationPolicy()).isEqualTo(TEST_POLICY);
+ // This "set" is a no-op
+ assertThat(mTestSession.setVerificationPolicy(TEST_POLICY)).isTrue();
+ assertThat(mTestSession.getVerificationPolicy()).isEqualTo(TEST_POLICY);
+ verifyZeroInteractions(mTestSessionInterface);
+ }
+
+ @Test
+ public void testPolicyOverrideFail() throws Exception {
+ final int newPolicy = VERIFICATION_POLICY_BLOCK_FAIL_WARN;
+ when(mTestSessionInterface.setVerificationPolicy(anyInt(), anyInt())).thenReturn(false);
+ assertThat(mTestSession.setVerificationPolicy(newPolicy)).isFalse();
+ verify(mTestSessionInterface, times(1))
+ .setVerificationPolicy(eq(TEST_ID), eq(newPolicy));
+ // Next "get" should not trigger binder call because the previous "set" has failed
+ assertThat(mTestSession.getVerificationPolicy()).isEqualTo(TEST_POLICY);
+ verifyNoMoreInteractions(mTestSessionInterface);
+ }
+
+ @Test
+ public void testPolicyOverrideSuccess() throws Exception {
+ final int newPolicy = VERIFICATION_POLICY_BLOCK_FAIL_WARN;
+ when(mTestSessionInterface.setVerificationPolicy(anyInt(), anyInt())).thenReturn(true);
+ assertThat(mTestSession.setVerificationPolicy(newPolicy)).isTrue();
+ verify(mTestSessionInterface, times(1))
+ .setVerificationPolicy(eq(TEST_ID), eq(newPolicy));
+ assertThat(mTestSession.getVerificationPolicy()).isEqualTo(newPolicy);
+ assertThat(mTestSession.getVerificationPolicy()).isEqualTo(newPolicy);
+
+ // Setting back to the original policy should still trigger binder calls
+ assertThat(mTestSession.setVerificationPolicy(TEST_POLICY)).isTrue();
+ verify(mTestSessionInterface, times(1))
+ .setVerificationPolicy(eq(TEST_ID), eq(TEST_POLICY));
+ assertThat(mTestSession.getVerificationPolicy()).isEqualTo(TEST_POLICY);
+ }
}
diff --git a/core/tests/coretests/src/android/content/pm/verify/VerifierServiceTest.java b/core/tests/coretests/src/android/content/pm/verify/VerifierServiceTest.java
index 7f73a1eb4b48..56fc66a286c3 100644
--- a/core/tests/coretests/src/android/content/pm/verify/VerifierServiceTest.java
+++ b/core/tests/coretests/src/android/content/pm/verify/VerifierServiceTest.java
@@ -16,6 +16,8 @@
package android.content.pm.verify;
+import static android.content.pm.PackageInstaller.VERIFICATION_POLICY_BLOCK_FAIL_CLOSED;
+
import static com.google.common.truth.Truth.assertThat;
import static org.mockito.ArgumentMatchers.eq;
@@ -25,6 +27,7 @@ import static org.mockito.Mockito.when;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.pm.SigningInfo;
+import android.content.pm.verify.pkg.IVerificationSessionInterface;
import android.content.pm.verify.pkg.IVerifierService;
import android.content.pm.verify.pkg.VerificationSession;
import android.content.pm.verify.pkg.VerifierService;
@@ -52,6 +55,7 @@ public class VerifierServiceTest {
private static final String TEST_PACKAGE_NAME = "com.foo";
private static final Uri TEST_PACKAGE_URI = Uri.parse("test://test");
private static final SigningInfo TEST_SIGNING_INFO = new SigningInfo();
+ private static final int TEST_POLICY = VERIFICATION_POLICY_BLOCK_FAIL_CLOSED;
private VerifierService mService;
private VerificationSession mSession;
@@ -60,8 +64,8 @@ public class VerifierServiceTest {
mService = Mockito.mock(VerifierService.class, Answers.CALLS_REAL_METHODS);
mSession = new VerificationSession(TEST_ID, TEST_INSTALL_SESSION_ID,
TEST_PACKAGE_NAME, TEST_PACKAGE_URI, TEST_SIGNING_INFO,
- new ArrayList<>(),
- new PersistableBundle(), null, null);
+ new ArrayList<>(), new PersistableBundle(), TEST_POLICY, Mockito.mock(
+ IVerificationSessionInterface.class));
}
@Test
diff --git a/core/tests/coretests/src/android/os/IpcDataCacheTest.java b/core/tests/coretests/src/android/os/IpcDataCacheTest.java
index 5852bee53778..5c56fdcd4a2a 100644
--- a/core/tests/coretests/src/android/os/IpcDataCacheTest.java
+++ b/core/tests/coretests/src/android/os/IpcDataCacheTest.java
@@ -101,10 +101,16 @@ public class IpcDataCacheTest {
}
}
- // Ensure all test nonces are cleared after the test ends.
+ // Prepare for testing.
+ @Before
+ public void setUp() throws Exception {
+ IpcDataCache.setTestMode(true);
+ }
+
+ // Ensure all test configurations are cleared.
@After
public void tearDown() throws Exception {
- IpcDataCache.resetAfterTest();
+ IpcDataCache.setTestMode(false);
}
// This test is disabled pending an sepolicy change that allows any app to set the
@@ -446,17 +452,51 @@ public class IpcDataCacheTest {
assertEquals(ec.isDisabled(), true);
}
- // It is illegal to continue to use a cache with a test key after calling setTestMode(false).
- // This test verifies the code detects errors in calling setTestMode().
+ // Verify that test mode works properly.
@Test
public void testTestMode() {
- TestCache cache = new TestCache();
- cache.invalidateCache();
- IpcDataCache.resetAfterTest();
+ // Create a cache that will write a system nonce.
+ TestCache sysCache = new TestCache(IpcDataCache.MODULE_SYSTEM, "mode1");
+ try {
+ // Invalidate the cache, which writes the system property. There must be a permission
+ // failure.
+ sysCache.invalidateCache();
+ fail("expected permission failure");
+ } catch (RuntimeException e) {
+ // The expected exception is a bare RuntimeException. The test does not attempt to
+ // validate the text of the exception message.
+ }
+
+ sysCache.testPropertyName();
+ // Invalidate the cache. This must succeed because the property has been marked for
+ // testing.
+ sysCache.invalidateCache();
+
+ // Create a cache that uses MODULE_TEST. Invalidation succeeds whether or not the
+ // property is tagged as being tested.
+ TestCache testCache = new TestCache(IpcDataCache.MODULE_TEST, "mode2");
+ testCache.invalidateCache();
+ testCache.testPropertyName();
+ testCache.invalidateCache();
+
+ // Clear test mode. This fails if test mode is not enabled.
+ IpcDataCache.setTestMode(false);
try {
- cache.invalidateCache();
+ IpcDataCache.setTestMode(false);
fail("expected an IllegalStateException");
- } catch (IllegalStateException expected) {
+ } catch (IllegalStateException e) {
+ // The expected exception.
}
+ // Configuring a property for testing must fail if test mode is false.
+ TestCache cache2 = new TestCache(IpcDataCache.MODULE_SYSTEM, "mode3");
+ try {
+ cache2.testPropertyName();
+ fail("expected an IllegalStateException");
+ } catch (IllegalStateException e) {
+ // The expected exception.
+ }
+
+ // Re-enable test mode (so that the cleanup for the test does not throw).
+ IpcDataCache.setTestMode(true);
}
}
diff --git a/core/tests/coretests/src/android/text/LayoutTest.java b/core/tests/coretests/src/android/text/LayoutTest.java
index 6311298ec8cf..c7d85d4b9b76 100644
--- a/core/tests/coretests/src/android/text/LayoutTest.java
+++ b/core/tests/coretests/src/android/text/LayoutTest.java
@@ -73,6 +73,7 @@ public class LayoutTest {
private static final int STATIC_LINE_COUNT = 9;
private static final int LINE_HEIGHT = 12;
private static final int LINE_DESCENT = 4;
+ private static final int LINE_HEIGHT_TOLERANCE_PER_ITERATION = 3;
private static final CharSequence LAYOUT_TEXT = "alwei\t;sdfs\ndf @";
private SpannableString mSpannedText;
@@ -918,7 +919,8 @@ public class LayoutTest {
expect.that(removeAlpha(drawCommand.paint.getColor())).isEqualTo(Color.BLACK);
expect.that(drawCommand.rect.height()).isAtLeast(LINE_HEIGHT);
expect.that(drawCommand.rect.width()).isGreaterThan(0);
- float expectedY = (numBackgroundsFound) * (LINE_HEIGHT + LINE_DESCENT);
+ float expectedY = numBackgroundsFound
+ * (LINE_HEIGHT + LINE_DESCENT - LINE_HEIGHT_TOLERANCE_PER_ITERATION);
expect.that(drawCommand.rect.bottom).isAtLeast(expectedY);
} else if (drawCommand.text != null) {
// draw text
diff --git a/core/tests/coretests/src/android/view/LetterboxScrollProcessorTest.java b/core/tests/coretests/src/android/view/LetterboxScrollProcessorTest.java
index f8ec9f4fb51b..235625d8f14c 100644
--- a/core/tests/coretests/src/android/view/LetterboxScrollProcessorTest.java
+++ b/core/tests/coretests/src/android/view/LetterboxScrollProcessorTest.java
@@ -31,13 +31,13 @@ import android.os.Handler;
import android.os.Looper;
import android.platform.test.annotations.Presubmit;
+import androidx.annotation.NonNull;
import androidx.test.filters.SmallTest;
import androidx.test.platform.app.InstrumentationRegistry;
import org.junit.Before;
import org.junit.Test;
-
import java.util.ArrayList;
import java.util.List;
@@ -54,30 +54,32 @@ public class LetterboxScrollProcessorTest {
private LetterboxScrollProcessor mLetterboxScrollProcessor;
private Context mContext;
- // Constant delta used when comparing coordinates (floats)
+ // Constant delta used when comparing coordinates (floats).
private static final float EPSILON = 0.1f;
+ private static final Rect APP_BOUNDS =
+ new Rect(/* left= */ 200, /* top= */ 200, /* right= */ 600, /* bottom= */ 1000);
+
@Before
public void setUp() {
mContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
// Set app bounds as if it was letterboxed.
- mContext.getResources().getConfiguration().windowConfiguration
- .setBounds(new Rect(200, 200, 600, 1000));
-
- Handler handler = new Handler(Looper.getMainLooper());
+ mContext.getResources().getConfiguration().windowConfiguration.setBounds(APP_BOUNDS);
// Recreate to reset LetterboxScrollProcessor state.
- mLetterboxScrollProcessor = new LetterboxScrollProcessor(mContext, handler);
+ mLetterboxScrollProcessor = new LetterboxScrollProcessor(mContext,
+ new Handler(Looper.getMainLooper()));
}
@Test
public void testGestureInBoundsHasNoAdjustments() {
// Tap-like gesture in bounds (non-scroll).
- List<MotionEvent> tapGestureEvents = createTapGestureEvents(0f, 0f);
+ final List<MotionEvent> tapGestureEvents = createTapGestureEvents(
+ /* startX= */ 0f, /* startY= */ 0f);
// Get processed events from Letterbox Scroll Processor.
- List<MotionEvent> processedEvents = processMotionEvents(tapGestureEvents);
+ final List<MotionEvent> processedEvents = processMotionEvents(tapGestureEvents);
// Ensure no changes are made to events after processing - event locations should not be
// adjusted because the gesture started in the app's bounds (for all gestures).
@@ -87,12 +89,31 @@ public class LetterboxScrollProcessorTest {
}
@Test
+ public void testGestureInAppBoundsButOutsideTopWindowAlsoForwardedToTheApp() {
+ final Rect dialogBounds =
+ new Rect(/* left= */ 300, /* top= */ 500, /* right= */ 500, /* bottom= */ 700);
+ // Tap-like gesture outside the dialog, but in app bounds.
+ List<MotionEvent> tapGestureEvents = createTapGestureEventsWithCoordinateSystem(0f, 0f,
+ dialogBounds);
+
+ // Get processed events from Letterbox Scroll Processor.
+ List<MotionEvent> processedEvents = processMotionEvents(tapGestureEvents);
+
+ // Ensure no changes are made to events after processing - the event should be forwarded as
+ // normal.
+ assertEventLocationsAreNotAdjusted(tapGestureEvents, processedEvents);
+ // Ensure all of these events should be finished (expect no generated events).
+ assertMotionEventsShouldBeFinished(processedEvents);
+ }
+
+ @Test
public void testGestureOutsideBoundsIsIgnored() {
// Tap-like gesture outside bounds (non-scroll).
- List<MotionEvent> tapGestureEvents = createTapGestureEvents(-100f, -100f);
+ final List<MotionEvent> tapGestureEvents = createTapGestureEvents(
+ /* startX= */ -100f, /* startY= */ -100f);
// Get processed events from Letterbox Scroll Processor.
- List<MotionEvent> processedEvents = processMotionEvents(tapGestureEvents);
+ final List<MotionEvent> processedEvents = processMotionEvents(tapGestureEvents);
// All events should be ignored since it was a non-scroll gesture and out of bounds.
assertEquals(0, processedEvents.size());
@@ -101,10 +122,11 @@ public class LetterboxScrollProcessorTest {
@Test
public void testScrollGestureInBoundsHasNoAdjustments() {
// Scroll gesture in bounds (non-scroll).
- List<MotionEvent> scrollGestureEvents = createScrollGestureEvents(0f, 0f);
+ final List<MotionEvent> scrollGestureEvents = createScrollGestureEvents(
+ /* startX= */ 0f, /* startY= */ 0f);
// Get processed events from Letterbox Scroll Processor.
- List<MotionEvent> processedEvents = processMotionEvents(scrollGestureEvents);
+ final List<MotionEvent> processedEvents = processMotionEvents(scrollGestureEvents);
// Ensure no changes are made to events after processing - event locations should not be
// adjusted because the gesture started in the app's bounds (for all gestures).
@@ -116,10 +138,11 @@ public class LetterboxScrollProcessorTest {
@Test
public void testScrollGestureInBoundsThenLeavesBoundsHasNoAdjustments() {
// Scroll gesture in bounds (non-scroll) that moves out of bounds.
- List<MotionEvent> scrollGestureEvents = createScrollGestureEvents(390f, 790f);
+ final List<MotionEvent> scrollGestureEvents = createScrollGestureEvents(
+ /* startX= */ 390f, /* startY= */ 790f);
// Get processed events from Letterbox Scroll Processor.
- List<MotionEvent> processedEvents = processMotionEvents(scrollGestureEvents);
+ final List<MotionEvent> processedEvents = processMotionEvents(scrollGestureEvents);
// Ensure no changes are made to events after processing - event locations should not be
// adjusted because the gesture started in the app's bounds (for all gestures), even if it
@@ -132,7 +155,8 @@ public class LetterboxScrollProcessorTest {
@Test
public void testScrollGestureOutsideBoundsIsStartedInBounds() {
// Scroll gesture outside bounds.
- List<MotionEvent> scrollGestureEvents = createScrollGestureEvents(-100f, 0f);
+ List<MotionEvent> scrollGestureEvents = createScrollGestureEvents(
+ /* startX= */ -100f, /* startY= */ 0f);
// Get processed events from Letterbox Scroll Processor.
List<MotionEvent> processedEvents = processMotionEvents(scrollGestureEvents);
@@ -142,9 +166,9 @@ public class LetterboxScrollProcessorTest {
// Ensure offset ACTION_DOWN is first event received.
MotionEvent firstProcessedEvent = processedEvents.getFirst();
- assertEquals(firstProcessedEvent.getAction(), ACTION_DOWN);
- assertEquals(firstProcessedEvent.getX(), 0, EPSILON);
- assertEquals(firstProcessedEvent.getY(), 0, EPSILON);
+ assertEquals(ACTION_DOWN, firstProcessedEvent.getAction());
+ assertEquals(0, firstProcessedEvent.getX(), EPSILON);
+ assertEquals(0, firstProcessedEvent.getY(), EPSILON);
// Ensure this event is not finished (because it was generated by LetterboxScrollProcessor).
assertNull(mLetterboxScrollProcessor.processMotionEventBeforeFinish(firstProcessedEvent));
}
@@ -152,16 +176,17 @@ public class LetterboxScrollProcessorTest {
@Test
public void testScrollGestureOutsideBoundsIsMovedInBounds() {
// Scroll gesture outside bounds.
- List<MotionEvent> scrollGestureEvents = createScrollGestureEvents(-100f, 0f);
+ final List<MotionEvent> scrollGestureEvents = createScrollGestureEvents(
+ /* startX= */ -100f, /* startY= */ 0f);
// Get processed events from Letterbox Scroll Processor.
- List<MotionEvent> processedEvents = processMotionEvents(scrollGestureEvents);
+ final List<MotionEvent> processedEvents = processMotionEvents(scrollGestureEvents);
// When a scroll occurs outside bounds: once detected as a scroll, an offset ACTION_DOWN is
// placed and then the rest of the gesture is offset also. Some ACTION_MOVE events may be
// ignored until the gesture is 'detected as a scroll'.
// For this test, we expect the first ACTION_MOVE event to be ignored:
- scrollGestureEvents.remove(1);
+ scrollGestureEvents.remove(/* index= */ 1);
// Ensure all processed events (that are not ignored) are offset over the app.
assertXCoordinatesAdjustedToZero(scrollGestureEvents, processedEvents);
@@ -170,8 +195,9 @@ public class LetterboxScrollProcessorTest {
assertMotionEventsShouldBeFinished(processedEvents.subList(1, processedEvents.size()));
}
- private List<MotionEvent> processMotionEvents(List<MotionEvent> motionEvents) {
- List<MotionEvent> processedEvents = new ArrayList<>();
+ @NonNull
+ private List<MotionEvent> processMotionEvents(@NonNull List<MotionEvent> motionEvents) {
+ final List<MotionEvent> processedEvents = new ArrayList<>();
for (MotionEvent motionEvent : motionEvents) {
MotionEvent clonedEvent = MotionEvent.obtain(motionEvent);
List<MotionEvent> letterboxScrollCompatEvents =
@@ -187,39 +213,76 @@ public class LetterboxScrollProcessorTest {
return processedEvents;
}
+ /**
+ * Creates and returns a tap gesture with X and Y in reference to the app bounds (top left
+ * corner is x=0, y=0).
+ */
+ @NonNull
private List<MotionEvent> createTapGestureEvents(float startX, float startY) {
+ return createTapGestureEventsWithCoordinateSystem(startX, startY, APP_BOUNDS);
+ }
+
+ /**
+ * @param referenceWindowBounds the amount the event will be translated by.
+ */
+ private List<MotionEvent> createTapGestureEventsWithCoordinateSystem(float startX, float startY,
+ @NonNull Rect referenceWindowBounds) {
// Events for tap-like gesture (non-scroll)
List<MotionEvent> motionEvents = new ArrayList<>();
- motionEvents.add(createBasicMotionEvent(0, ACTION_DOWN, startX, startY));
- motionEvents.add(createBasicMotionEvent(10, ACTION_UP, startX , startY));
+ motionEvents.add(createBasicMotionEventWithCoordinateSystem(0, ACTION_DOWN,
+ startX, startY, referenceWindowBounds));
+ motionEvents.add(createBasicMotionEventWithCoordinateSystem(10, ACTION_UP,
+ startX , startY, referenceWindowBounds));
return motionEvents;
}
+ @NonNull
private List<MotionEvent> createScrollGestureEvents(float startX, float startY) {
- float touchSlop = (float) ViewConfiguration.get(mContext).getScaledTouchSlop();
+ final float touchSlop = (float) ViewConfiguration.get(mContext).getScaledTouchSlop();
- // Events for scroll gesture (starts at (startX, startY) then moves down-right
- List<MotionEvent> motionEvents = new ArrayList<>();
- motionEvents.add(createBasicMotionEvent(0, ACTION_DOWN, startX, startY));
- motionEvents.add(createBasicMotionEvent(10, ACTION_MOVE,
+ // Events for scroll gesture (starts at (startX, startY) then moves down-right.
+ final List<MotionEvent> motionEvents = new ArrayList<>();
+ motionEvents.add(createBasicMotionEvent(/* downTime= */ 0, ACTION_DOWN, startX, startY));
+ motionEvents.add(createBasicMotionEvent(/* downTime= */ 10, ACTION_MOVE,
startX + touchSlop / 2, startY + touchSlop / 2));
- // Below event is first event in the scroll gesture where distance > touchSlop
- motionEvents.add(createBasicMotionEvent(20, ACTION_MOVE,
+ // Below event is first event in the scroll gesture where distance > touchSlop.
+ motionEvents.add(createBasicMotionEvent(/* downTime= */ 20, ACTION_MOVE,
startX + touchSlop * 2, startY + touchSlop * 2));
- motionEvents.add(createBasicMotionEvent(30, ACTION_MOVE,
+ motionEvents.add(createBasicMotionEvent(/* downTime= */ 30, ACTION_MOVE,
startX + touchSlop * 3, startY + touchSlop * 3));
- motionEvents.add(createBasicMotionEvent(40, ACTION_UP,
+ motionEvents.add(createBasicMotionEvent(/* downTime= */ 40, ACTION_UP,
startX + touchSlop * 3, startY + touchSlop * 3));
return motionEvents;
}
- private MotionEvent createBasicMotionEvent(int downTime, int action, float x, float y) {
- return MotionEvent.obtain(0, downTime, action, x, y, 0);
+ /**
+ * Creates and returns an event with X and Y in reference to the app bounds (top left corner is
+ * x=0, y=0).
+ */
+ @NonNull
+ private MotionEvent createBasicMotionEvent(int eventTime, int action, float x, float y) {
+ return createBasicMotionEventWithCoordinateSystem(eventTime, action, x, y, APP_BOUNDS);
+ }
+
+ /**
+ * @param referenceWindowBounds the amount the event will be translated by.
+ */
+ @NonNull
+ private MotionEvent createBasicMotionEventWithCoordinateSystem(int eventTime, int action,
+ float x, float y, @NonNull Rect referenceWindowBounds) {
+ final float rawX = referenceWindowBounds.left + x;
+ final float rawY = referenceWindowBounds.top + y;
+ // RawX and RawY cannot be changed once the event is created. Therefore, pass rawX and rawY
+ // according to the app's bounds on the display, and then offset to make X and Y relative to
+ // the app's bounds.
+ final MotionEvent event = MotionEvent.obtain(0, eventTime, action, rawX, rawY, 0);
+ event.offsetLocation(-referenceWindowBounds.left, -referenceWindowBounds.top);
+ return event;
}
private void assertEventLocationsAreNotAdjusted(
- List<MotionEvent> originalEvents,
- List<MotionEvent> processedEvents) {
+ @NonNull List<MotionEvent> originalEvents,
+ @NonNull List<MotionEvent> processedEvents) {
assertEquals("MotionEvent arrays are not the same size",
originalEvents.size(), processedEvents.size());
@@ -232,8 +295,8 @@ public class LetterboxScrollProcessorTest {
}
private void assertXCoordinatesAdjustedToZero(
- List<MotionEvent> originalEvents,
- List<MotionEvent> processedEvents) {
+ @NonNull List<MotionEvent> originalEvents,
+ @NonNull List<MotionEvent> processedEvents) {
assertEquals("MotionEvent arrays are not the same size",
originalEvents.size(), processedEvents.size());
@@ -245,7 +308,7 @@ public class LetterboxScrollProcessorTest {
}
}
- private void assertMotionEventsShouldBeFinished(List<MotionEvent> processedEvents) {
+ private void assertMotionEventsShouldBeFinished(@NonNull List<MotionEvent> processedEvents) {
for (MotionEvent processedEvent : processedEvents) {
assertNotNull(mLetterboxScrollProcessor.processMotionEventBeforeFinish(processedEvent));
}
diff --git a/core/tests/coretests/src/android/view/RoundScrollbarRendererTest.java b/core/tests/coretests/src/android/view/RoundScrollbarRendererTest.java
new file mode 100644
index 000000000000..262bd5cd6c01
--- /dev/null
+++ b/core/tests/coretests/src/android/view/RoundScrollbarRendererTest.java
@@ -0,0 +1,146 @@
+/*
+ * Copyright 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.view;
+
+import static org.junit.Assert.assertEquals;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyFloat;
+import static org.mockito.ArgumentMatchers.anyInt;
+import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.Mockito.spy;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
+import android.content.Context;
+import android.graphics.Canvas;
+import android.graphics.Paint;
+import android.graphics.Rect;
+import android.platform.test.annotations.Presubmit;
+import android.platform.test.annotations.RequiresFlagsDisabled;
+import android.platform.test.annotations.RequiresFlagsEnabled;
+import android.platform.test.flag.junit.CheckFlagsRule;
+import android.platform.test.flag.junit.DeviceFlagsValueProvider;
+import android.view.flags.Flags;
+
+import androidx.test.core.app.ApplicationProvider;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+import androidx.test.filters.SmallTest;
+
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.ArgumentCaptor;
+import org.mockito.Captor;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+
+/**
+ * Tests for {@link RoundScrollbarRenderer}.
+ *
+ * <p>Build/Install/Run: atest FrameworksCoreTests:android.view.RoundScrollbarRendererTest
+ */
+@RunWith(AndroidJUnit4.class)
+@SmallTest
+@Presubmit
+public class RoundScrollbarRendererTest {
+
+ private static final int DEFAULT_VERTICAL_SCROLL_RANGE = 100;
+ private static final int DEFAULT_VERTICAL_SCROLL_EXTENT = 20;
+ private static final int DEFAULT_VERTICAL_SCROLL_OFFSET = 40;
+ private static final float DEFAULT_ALPHA = 0.5f;
+ private static final Rect BOUNDS = new Rect(0, 0, 200, 200);
+
+ @Rule
+ public final CheckFlagsRule mCheckFlagsRule = DeviceFlagsValueProvider.createCheckFlagsRule();
+
+ @Mock private Canvas mCanvas;
+ @Captor private ArgumentCaptor<Paint> mPaintCaptor;
+ private RoundScrollbarRenderer mScrollbar;
+
+ @Before
+ public void setup() {
+ MockitoAnnotations.initMocks(this);
+
+ MockView view = spy(new MockView(ApplicationProvider.getApplicationContext()));
+ when(view.canScrollVertically(anyInt())).thenReturn(true);
+ when(view.computeVerticalScrollRange()).thenReturn(DEFAULT_VERTICAL_SCROLL_RANGE);
+ when(view.computeVerticalScrollExtent()).thenReturn(DEFAULT_VERTICAL_SCROLL_EXTENT);
+ when(view.computeVerticalScrollOffset()).thenReturn(DEFAULT_VERTICAL_SCROLL_OFFSET);
+ mPaintCaptor = ArgumentCaptor.forClass(Paint.class);
+
+ mScrollbar = new RoundScrollbarRenderer(view);
+ }
+
+ @Test
+ @RequiresFlagsDisabled(Flags.FLAG_USE_REFACTORED_ROUND_SCROLLBAR)
+ public void testScrollbarDrawn_legacy() {
+ mScrollbar.drawRoundScrollbars(mCanvas, DEFAULT_ALPHA, BOUNDS, /* drawToLeft= */ false);
+
+ // The arc will be drawn twice, i.e. once for track and once for thumb
+ verify(mCanvas, times(2))
+ .drawArc(any(), anyFloat(), anyFloat(), eq(false), mPaintCaptor.capture());
+
+ Paint thumbPaint = mPaintCaptor.getAllValues().getFirst();
+ assertEquals(Paint.Cap.ROUND, thumbPaint.getStrokeCap());
+ assertEquals(Paint.Style.STROKE, thumbPaint.getStyle());
+ Paint trackPaint = mPaintCaptor.getAllValues().get(1);
+ assertEquals(Paint.Cap.ROUND, trackPaint.getStrokeCap());
+ assertEquals(Paint.Style.STROKE, trackPaint.getStyle());
+ }
+
+ @Test
+ @RequiresFlagsEnabled(Flags.FLAG_USE_REFACTORED_ROUND_SCROLLBAR)
+ public void testScrollbarDrawn() {
+ mScrollbar.drawRoundScrollbars(mCanvas, DEFAULT_ALPHA, BOUNDS, /* drawToLeft= */ false);
+
+ // The arc will be drawn thrice, i.e. twice for track and once for thumb
+ verify(mCanvas, times(3))
+ .drawArc(any(), anyFloat(), anyFloat(), eq(false), mPaintCaptor.capture());
+
+ // Verify paint styles
+ Paint thumbPaint = mPaintCaptor.getAllValues().getFirst();
+ assertEquals(Paint.Cap.ROUND, thumbPaint.getStrokeCap());
+ assertEquals(Paint.Style.STROKE, thumbPaint.getStyle());
+ Paint trackPaint = mPaintCaptor.getAllValues().get(1);
+ assertEquals(Paint.Cap.ROUND, trackPaint.getStrokeCap());
+ assertEquals(Paint.Style.STROKE, trackPaint.getStyle());
+ }
+
+ public static class MockView extends View {
+
+ public MockView(Context context) {
+ super(context);
+ }
+
+ @Override
+ public int computeVerticalScrollRange() {
+ return super.getHeight();
+ }
+
+ @Override
+ public int computeVerticalScrollOffset() {
+ return super.computeVerticalScrollOffset();
+ }
+
+ @Override
+ public int computeVerticalScrollExtent() {
+ return super.computeVerticalScrollExtent();
+ }
+ }
+}
diff --git a/core/tests/coretests/src/android/view/ViewFrameRateTest.java b/core/tests/coretests/src/android/view/ViewFrameRateTest.java
index c98142357d69..483ebc2c8649 100644
--- a/core/tests/coretests/src/android/view/ViewFrameRateTest.java
+++ b/core/tests/coretests/src/android/view/ViewFrameRateTest.java
@@ -24,6 +24,7 @@ import static android.view.Surface.FRAME_RATE_CATEGORY_NO_PREFERENCE;
import static android.view.WindowManager.LayoutParams.TYPE_INPUT_METHOD;
import static android.view.flags.Flags.FLAG_TOOLKIT_FRAME_RATE_ANIMATION_BUGFIX_25Q1;
import static android.view.flags.Flags.FLAG_TOOLKIT_FRAME_RATE_VELOCITY_MAPPING_READ_ONLY;
+import static android.view.flags.Flags.FLAG_TOOLKIT_FRAME_RATE_TOUCH_BOOST_25Q1;
import static android.view.flags.Flags.FLAG_TOOLKIT_FRAME_RATE_VIEW_ENABLING_READ_ONLY;
import static android.view.flags.Flags.FLAG_TOOLKIT_SET_FRAME_RATE_READ_ONLY;
import static android.view.flags.Flags.FLAG_VIEW_VELOCITY_API;
@@ -118,6 +119,67 @@ public class ViewFrameRateTest {
}
@Test
+ @RequiresFlagsEnabled(FLAG_TOOLKIT_FRAME_RATE_TOUCH_BOOST_25Q1)
+ public void shouldNotSuppressTouchBoost() throws Throwable {
+ if (!ViewProperties.vrr_enabled().orElse(true)) {
+ return;
+ }
+
+ mActivityRule.runOnUiThread(() -> {
+ ViewGroup.LayoutParams layoutParams = mMovingView.getLayoutParams();
+ layoutParams.width = ViewGroup.LayoutParams.MATCH_PARENT;
+ layoutParams.height = ViewGroup.LayoutParams.MATCH_PARENT;
+ mMovingView.setLayoutParams(layoutParams);
+ mMovingView.setOnClickListener((v) -> {});
+ });
+ waitForFrameRateCategoryToSettle();
+
+ int[] position = new int[2];
+ mActivityRule.runOnUiThread(() -> {
+ mMovingView.getLocationOnScreen(position);
+ position[0] += mMovingView.getWidth() / 2;
+ position[1] += mMovingView.getHeight() / 2;
+ });
+ final Instrumentation instrumentation = InstrumentationRegistry.getInstrumentation();
+
+ // update the window type to TYPE_INPUT_METHOD
+ int windowType = mViewRoot.mWindowAttributes.type;
+ final WindowManager.LayoutParams attrs = mViewRoot.mWindowAttributes;
+ attrs.type = TYPE_INPUT_METHOD;
+ instrumentation.runOnMainSync(() -> {
+ mViewRoot.setLayoutParams(attrs, false);
+ });
+ instrumentation.waitForIdleSync();
+
+ final WindowManager.LayoutParams newAttrs = mViewRoot.mWindowAttributes;
+ assertTrue(newAttrs.type == TYPE_INPUT_METHOD);
+
+ long now = SystemClock.uptimeMillis();
+ MotionEvent down = MotionEvent.obtain(
+ now, // downTime
+ now, // eventTime
+ MotionEvent.ACTION_DOWN, // action
+ position[0], // x
+ position[1], // y
+ 0 // metaState
+ );
+ down.setSource(InputDevice.SOURCE_TOUCHSCREEN);
+ instrumentation.sendPointerSync(down);
+ down.recycle();
+
+ // should have touch boost
+ assertTrue(mViewRoot.getIsTouchBoosting());
+
+ // Reset the window type back to the original one.
+ newAttrs.type = windowType;
+ instrumentation.runOnMainSync(() -> {
+ mViewRoot.setLayoutParams(newAttrs, false);
+ });
+ instrumentation.waitForIdleSync();
+ assertTrue(mViewRoot.mWindowAttributes.type == windowType);
+ }
+
+ @Test
@RequiresFlagsEnabled(FLAG_TOOLKIT_FRAME_RATE_VIEW_ENABLING_READ_ONLY)
public void inputMethodWithContentMoves() throws Throwable {
if (!ViewProperties.vrr_enabled().orElse(true)) {
diff --git a/core/tests/coretests/src/com/android/internal/jank/FrameTrackerTest.java b/core/tests/coretests/src/com/android/internal/jank/FrameTrackerTest.java
index c3a5b19c9442..1cbc7d6d3f98 100644
--- a/core/tests/coretests/src/com/android/internal/jank/FrameTrackerTest.java
+++ b/core/tests/coretests/src/com/android/internal/jank/FrameTrackerTest.java
@@ -40,7 +40,10 @@ import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
+import android.animation.AnimationHandler;
+import android.os.ConditionVariable;
import android.os.Handler;
+import android.view.Choreographer;
import android.view.FrameMetrics;
import android.view.SurfaceControl;
import android.view.SurfaceControl.JankData;
@@ -576,6 +579,44 @@ public class FrameTrackerTest {
}
@Test
+ public void testEndAnimationWithLastFrameSyncId() {
+ final long[] expectedLastAnimationFrameVsyncId = { 0 };
+ final long[] lastAnimationFrameVsyncId = { 0 };
+ final long[] endAnimationVsyncId = { 0 };
+ final ConditionVariable condition = new ConditionVariable();
+ final FrameTracker tracker = spyFrameTracker(/* surfaceOnly= */ false);
+ mActivity.runOnUiThread(() -> {
+ final AnimationHandler animationHandler = AnimationHandler.getInstance();
+ final Choreographer realChoreographer = Choreographer.getInstance();
+ // 3 v-sync ids:
+ // 1. Begin mocked vsyncId = 0
+ // 2. Current real vsyncId = last animation frame
+ // 3. Posted real vsyncId = end animation
+ when(mChoreographer.getVsyncId()).thenReturn(0L);
+ tracker.begin();
+ mRunnableArgumentCaptor.getValue().run();
+ when(mChoreographer.getVsyncId()).thenAnswer(a -> realChoreographer.getVsyncId());
+ expectedLastAnimationFrameVsyncId[0] = realChoreographer.getVsyncId();
+ // Simulate ending multiple animators. Their callbacks should run in a batch.
+ animationHandler.postEndAnimationCallback(() -> {
+ endAnimationVsyncId[0] = realChoreographer.getVsyncId();
+ lastAnimationFrameVsyncId[0] =
+ animationHandler.getLastAnimationFrameVsyncId(endAnimationVsyncId[0]);
+ });
+ animationHandler.postEndAnimationCallback(() -> {
+ tracker.end(FrameTracker.REASON_END_NORMAL);
+ condition.open();
+ });
+ });
+
+ condition.block(1000L /* timeoutMs */);
+ assertThat(lastAnimationFrameVsyncId[0]).isEqualTo(expectedLastAnimationFrameVsyncId[0]);
+ assertThat(endAnimationVsyncId[0]).isGreaterThan(lastAnimationFrameVsyncId[0]);
+ // Verifies that FrameTracker#mEndVsyncId uses the vsyncId from AnimationHandler.
+ verify(mJankStatsRegistration).removeAfter(eq(lastAnimationFrameVsyncId[0]));
+ }
+
+ @Test
public void testMaxSuccessiveMissedFramesCount() {
FrameTracker tracker = spyFrameTracker(/* surfaceOnly= */ true);
when(mChoreographer.getVsyncId()).thenReturn(100L);
diff --git a/data/etc/privapp-permissions-platform.xml b/data/etc/privapp-permissions-platform.xml
index 2e72f0ec90b8..a028e1829ac6 100644
--- a/data/etc/privapp-permissions-platform.xml
+++ b/data/etc/privapp-permissions-platform.xml
@@ -572,6 +572,7 @@ applications that come with the platform
<permission name="android.permission.READ_BLOCKED_NUMBERS" />
<!-- Permission required for CTS test - PackageManagerTest -->
<permission name="android.permission.DOMAIN_VERIFICATION_AGENT"/>
+ <permission name="android.permission.VERIFICATION_AGENT"/>
<!-- Permission required for CTS test CtsInputTestCases -->
<permission name="android.permission.OVERRIDE_SYSTEM_KEY_BEHAVIOR_IN_FOCUSED_WINDOW" />
<!-- Permission required for CTS test - PackageManagerShellCommandInstallTest -->
@@ -587,6 +588,9 @@ applications that come with the platform
<permission name="android.permission.NFC_SET_CONTROLLER_ALWAYS_ON" />
<!-- Permission required for CTS test - CtsAppTestCases -->
<permission name="android.permission.KILL_UID" />
+ <!-- Permission required for CTS test - AdvancedProtectionManagerTest -->
+ <permission name="android.permission.SET_ADVANCED_PROTECTION_MODE" />
+ <permission name="android.permission.QUERY_ADVANCED_PROTECTION_MODE" />
</privapp-permissions>
<privapp-permissions package="com.android.statementservice">
diff --git a/graphics/java/android/framework_graphics.aconfig b/graphics/java/android/framework_graphics.aconfig
index 5ad97e6d8992..a63cbee4d707 100644
--- a/graphics/java/android/framework_graphics.aconfig
+++ b/graphics/java/android/framework_graphics.aconfig
@@ -33,3 +33,12 @@ flag {
description: "Add OkLab ColorSpace support"
bug: "344038816"
}
+
+flag {
+ name: "display_bt2020_colorspace"
+ is_exported: true
+ is_fixed_read_only: true
+ namespace: "core_graphics"
+ description: "Add DISPLAY_BT2020 ColorSpace support"
+ bug: "344038816"
+}
diff --git a/graphics/java/android/graphics/Bitmap.java b/graphics/java/android/graphics/Bitmap.java
index 6d31578ac020..461a5aec27ec 100644
--- a/graphics/java/android/graphics/Bitmap.java
+++ b/graphics/java/android/graphics/Bitmap.java
@@ -128,6 +128,22 @@ public final class Bitmap implements Parcelable {
private static final WeakHashMap<Bitmap, Void> sAllBitmaps = new WeakHashMap<>();
/**
+ * @hide
+ */
+ private static NativeAllocationRegistry getRegistry(boolean malloc, long size) {
+ final long free = nativeGetNativeFinalizer();
+ if (com.android.libcore.readonly.Flags.nativeMetrics()) {
+ Class cls = Bitmap.class;
+ return malloc ? NativeAllocationRegistry.createMalloced(cls, free, size)
+ : NativeAllocationRegistry.createNonmalloced(cls, free, size);
+ } else {
+ ClassLoader loader = Bitmap.class.getClassLoader();
+ return malloc ? NativeAllocationRegistry.createMalloced(loader, free, size)
+ : NativeAllocationRegistry.createNonmalloced(loader, free, size);
+ }
+ }
+
+ /**
* Private constructor that must receive an already allocated native bitmap
* int (pointer).
*/
@@ -151,7 +167,6 @@ public final class Bitmap implements Parcelable {
mWidth = width;
mHeight = height;
mRequestPremultiplied = requestPremultiplied;
-
mNinePatchChunk = ninePatchChunk;
mNinePatchInsets = ninePatchInsets;
if (density >= 0) {
@@ -159,17 +174,9 @@ public final class Bitmap implements Parcelable {
}
mNativePtr = nativeBitmap;
-
final int allocationByteCount = getAllocationByteCount();
- NativeAllocationRegistry registry;
- if (fromMalloc) {
- registry = NativeAllocationRegistry.createMalloced(
- Bitmap.class.getClassLoader(), nativeGetNativeFinalizer(), allocationByteCount);
- } else {
- registry = NativeAllocationRegistry.createNonmalloced(
- Bitmap.class.getClassLoader(), nativeGetNativeFinalizer(), allocationByteCount);
- }
- registry.registerNativeAllocation(this, nativeBitmap);
+ getRegistry(fromMalloc, allocationByteCount).registerNativeAllocation(this, mNativePtr);
+
synchronized (Bitmap.class) {
sAllBitmaps.put(this, null);
}
diff --git a/graphics/java/android/graphics/ColorSpace.java b/graphics/java/android/graphics/ColorSpace.java
index 3752257da2bc..4c47de0ca754 100644
--- a/graphics/java/android/graphics/ColorSpace.java
+++ b/graphics/java/android/graphics/ColorSpace.java
@@ -768,7 +768,44 @@ public abstract class ColorSpace {
* </table>
*/
@FlaggedApi(Flags.FLAG_OK_LAB_COLORSPACE)
- OK_LAB
+ OK_LAB,
+
+ /**
+ * <p>{@link ColorSpace.Rgb RGB} color space BT.2020 based on Rec. ITU-R BT.2020-1 and IEC 61966-2.1:1999.</p></p>
+ * <table summary="Color space definition">
+ * <tr>
+ * <th>Chromaticity</th><th>Red</th><th>Green</th><th>Blue</th><th>White point</th>
+ * </tr>
+ * <tr><td>x</td><td>0.708</td><td>0.170</td><td>0.131</td><td>0.3127</td></tr>
+ * <tr><td>y</td><td>0.292</td><td>0.797</td><td>0.046</td><td>0.3290</td></tr>
+ * <tr><th>Property</th><th colspan="4">Value</th></tr>
+ * <tr><td>Name</td><td colspan="4">Rec. ITU-R BT.2020-1</td></tr>
+ * <tr><td>CIE standard illuminant</td><td colspan="4">D65</td></tr>
+ * <tr>
+ * <td>Opto-electronic transfer function (OETF)</td>
+ * <td colspan="4">\(\begin{equation}
+ * C_{DisplayBT2020} = \begin{cases} 12.92 \times C_{linear} & C_{linear} \lt 0.0030186 \\\
+ * 1.055 \times C_{linear}^{\frac{1}{2.4}} - 0.055 & C_{linear} \ge 0.0030186 \end{cases}
+ * \end{equation}\)
+ * </td>
+ * </tr>
+ * <tr>
+ * <td>Electro-optical transfer function (EOTF)</td>
+ * <td colspan="4">\(\begin{equation}
+ * C_{linear} = \begin{cases}\frac{C_{DisplayBT2020}}{12.92} & C_{sRGB} \lt 0.04045 \\\
+ * \left( \frac{C_{DisplayBT2020} + 0.055}{1.055} \right) ^{2.4} & C_{sRGB} \ge 0.04045 \end{cases}
+ * \end{equation}\)
+ * </td>
+ * </tr>
+ * <tr><td>Range</td><td colspan="4">\([0..1]\)</td></tr>
+ * </table>
+ * <p>
+ * <img style="display: block; margin: 0 auto;" src="{@docRoot}reference/android/images/graphics/colorspace_bt2020.png" />
+ * <figcaption style="text-align: center;">BT.2020 (orange) vs sRGB (white)</figcaption>
+ * </p>
+ */
+ @FlaggedApi(Flags.FLAG_DISPLAY_BT2020_COLORSPACE)
+ DISPLAY_BT2020
// Update the initialization block next to #get(Named) when adding new values
}
@@ -1721,6 +1758,19 @@ public abstract class ColorSpace {
Named.OK_LAB.ordinal()
));
}
+
+ if (Flags.displayBt2020Colorspace()) {
+ sNamedColorSpaceMap.put(Named.DISPLAY_BT2020.ordinal(), new ColorSpace.Rgb(
+ "BT 2020",
+ BT2020_PRIMARIES,
+ ILLUMINANT_D65,
+ null,
+ SRGB_TRANSFER_PARAMETERS,
+ Named.DISPLAY_BT2020.ordinal()
+ ));
+ sDataToColorSpaces.put(DataSpace.DATASPACE_DISPLAY_BT2020,
+ Named.DISPLAY_BT2020.ordinal());
+ }
}
private static double transferHLGOETF(Rgb.TransferParameters params, double x) {
diff --git a/graphics/java/android/graphics/text/PositionedGlyphs.java b/graphics/java/android/graphics/text/PositionedGlyphs.java
index 671eb6e514c5..792e248ce839 100644
--- a/graphics/java/android/graphics/text/PositionedGlyphs.java
+++ b/graphics/java/android/graphics/text/PositionedGlyphs.java
@@ -24,8 +24,10 @@ import android.annotation.NonNull;
import android.graphics.Paint;
import android.graphics.Typeface;
import android.graphics.fonts.Font;
+import android.os.Build;
import com.android.internal.util.Preconditions;
+import com.android.text.flags.Flags;
import dalvik.annotation.optimization.CriticalNative;
@@ -52,6 +54,8 @@ public final class PositionedGlyphs {
Typeface.class.getClassLoader(), nReleaseFunc());
}
+ private static boolean sIsRobolectric = Build.FINGERPRINT.equals("robolectric");
+
private final long mLayoutPtr;
private final float mXOffset;
private final float mYOffset;
@@ -132,6 +136,9 @@ public final class PositionedGlyphs {
@NonNull
public Font getFont(@IntRange(from = 0) int index) {
Preconditions.checkArgumentInRange(index, 0, glyphCount() - 1, "index");
+ if (Flags.typefaceRedesign()) {
+ return mFonts.get(nGetFontId(mLayoutPtr, index));
+ }
return mFonts.get(index);
}
@@ -245,20 +252,29 @@ public final class PositionedGlyphs {
*/
public PositionedGlyphs(long layoutPtr, float xOffset, float yOffset) {
mLayoutPtr = layoutPtr;
- int glyphCount = nGetGlyphCount(layoutPtr);
- mFonts = new ArrayList<>(glyphCount);
mXOffset = xOffset;
mYOffset = yOffset;
- long prevPtr = 0;
- Font prevFont = null;
- for (int i = 0; i < glyphCount; ++i) {
- long ptr = nGetFont(layoutPtr, i);
- if (prevPtr != ptr) {
- prevPtr = ptr;
- prevFont = new Font(ptr);
+ if (!sIsRobolectric && Flags.typefaceRedesign()) {
+ int fontCount = nGetFontCount(layoutPtr);
+ mFonts = new ArrayList<>(fontCount);
+ for (int i = 0; i < fontCount; ++i) {
+ mFonts.add(new Font(nGetFontRef(layoutPtr, i)));
+ }
+ } else {
+ int glyphCount = nGetGlyphCount(layoutPtr);
+ mFonts = new ArrayList<>(glyphCount);
+
+ long prevPtr = 0;
+ Font prevFont = null;
+ for (int i = 0; i < glyphCount; ++i) {
+ long ptr = nGetFont(layoutPtr, i);
+ if (prevPtr != ptr) {
+ prevPtr = ptr;
+ prevFont = new Font(ptr);
+ }
+ mFonts.add(prevFont);
}
- mFonts.add(prevFont);
}
NoImagePreloadHolder.REGISTRY.registerNativeAllocation(this, layoutPtr);
@@ -290,6 +306,12 @@ public final class PositionedGlyphs {
private static native float nGetWeightOverride(long minikinLayout, int i);
@CriticalNative
private static native float nGetItalicOverride(long minikinLayout, int i);
+ @CriticalNative
+ private static native int nGetFontCount(long minikinLayout);
+ @CriticalNative
+ private static native long nGetFontRef(long minikinLayout, int fontId);
+ @CriticalNative
+ private static native int nGetFontId(long minikinLayout, int glyphIndex);
@Override
public boolean equals(Object o) {
diff --git a/keystore/java/android/security/OWNERS b/keystore/java/android/security/OWNERS
index ed30587418dd..32759b2402a9 100644
--- a/keystore/java/android/security/OWNERS
+++ b/keystore/java/android/security/OWNERS
@@ -1 +1,2 @@
per-file *.java,*.aidl = eranm@google.com,pgrafov@google.com,rubinxu@google.com
+per-file KeyStoreManager.java = mpgroover@google.com
diff --git a/keystore/java/android/security/keystore/KeyStoreManager.java b/keystore/java/android/security/keystore/KeyStoreManager.java
new file mode 100644
index 000000000000..197aaba4bcb5
--- /dev/null
+++ b/keystore/java/android/security/keystore/KeyStoreManager.java
@@ -0,0 +1,327 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.security.keystore;
+
+import android.annotation.FlaggedApi;
+import android.annotation.NonNull;
+import android.annotation.SystemService;
+import android.content.Context;
+import android.security.KeyStore2;
+import android.security.KeyStoreException;
+import android.security.keystore2.AndroidKeyStoreProvider;
+import android.security.keystore2.AndroidKeyStorePublicKey;
+import android.system.keystore2.Domain;
+import android.system.keystore2.KeyDescriptor;
+import android.system.keystore2.KeyPermission;
+import android.util.Log;
+
+import com.android.internal.annotations.GuardedBy;
+
+import java.io.ByteArrayInputStream;
+import java.security.Key;
+import java.security.KeyPair;
+import java.security.PublicKey;
+import java.security.UnrecoverableKeyException;
+import java.security.cert.CertificateFactory;
+import java.security.cert.X509Certificate;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * This class provides methods for interacting with keys stored within the
+ * <a href="/privacy-and-security/keystore">Android Keystore</a>.
+ */
+@FlaggedApi(android.security.Flags.FLAG_KEYSTORE_GRANT_API)
+@SystemService(Context.KEYSTORE_SERVICE)
+public class KeyStoreManager {
+ private static final String TAG = "KeyStoreManager";
+
+ private static final Object sInstanceLock = new Object();
+ @GuardedBy("sInstanceLock")
+ private static KeyStoreManager sInstance;
+
+ private final KeyStore2 mKeyStore2;
+
+ /**
+ * Private constructor to ensure only a single instance is created.
+ */
+ private KeyStoreManager() {
+ mKeyStore2 = KeyStore2.getInstance();
+ }
+
+ /**
+ * Returns the single instance of the {@code KeyStoreManager}.
+ *
+ * @hide
+ */
+ public static KeyStoreManager getInstance() {
+ synchronized (sInstanceLock) {
+ if (sInstance == null) {
+ sInstance = new KeyStoreManager();
+ }
+ return sInstance;
+ }
+ }
+
+ /**
+ * Grants access to the key owned by the calling app stored under the specified {@code alias}
+ * to another app on the device with the provided {@code uid}.
+ *
+ * <p>This method supports granting access to instances of both {@link javax.crypto.SecretKey}
+ * and {@link java.security.PrivateKey}. The resulting ID will persist across reboots and can be
+ * used by the grantee app for the life of the key or until access is revoked with {@link
+ * #revokeKeyAccess(String, int)}.
+ *
+ * <p>If the provided {@code alias} does not correspond to a key in the Android KeyStore, then
+ * an {@link UnrecoverableKeyException} is thrown.
+ *
+ * @param alias the alias of the key to be granted to another app
+ * @param uid the uid of the app to which the key should be granted
+ * @return the ID of the granted key; this can be shared with the specified app, and that
+ * app can use {@link #getGrantedKeyFromId(long)} to access the key
+ * @throws UnrecoverableKeyException if the specified key cannot be recovered
+ * @throws KeyStoreException if an error is encountered when attempting to grant access to
+ * the key
+ * @see #getGrantedKeyFromId(long)
+ */
+ public long grantKeyAccess(@NonNull String alias, int uid)
+ throws KeyStoreException, UnrecoverableKeyException {
+ KeyDescriptor keyDescriptor = createKeyDescriptorFromAlias(alias);
+ final int grantAccessVector = KeyPermission.USE | KeyPermission.GET_INFO;
+ // When a key is in the GRANT domain, the nspace field of the KeyDescriptor contains its ID.
+ KeyDescriptor result = null;
+ try {
+ result = mKeyStore2.grant(keyDescriptor, uid, grantAccessVector);
+ } catch (KeyStoreException e) {
+ // If the provided alias does not correspond to a valid key in the KeyStore, then throw
+ // an UnrecoverableKeyException to remain consistent with other APIs in this class.
+ if (e.getNumericErrorCode() == KeyStoreException.ERROR_KEY_DOES_NOT_EXIST) {
+ throw new UnrecoverableKeyException("No key found by the given alias");
+ }
+ throw e;
+ }
+ if (result == null) {
+ Log.e(TAG, "Received a null KeyDescriptor from grant");
+ throw new KeyStoreException(KeyStoreException.ERROR_INTERNAL_SYSTEM_ERROR,
+ "No ID was returned for the grant request for alias " + alias + " to uid "
+ + uid);
+ } else if (result.domain != Domain.GRANT) {
+ Log.e(TAG, "Received a result outside the grant domain: " + result.domain);
+ throw new KeyStoreException(KeyStoreException.ERROR_INTERNAL_SYSTEM_ERROR,
+ "Unable to obtain a grant ID for alias " + alias + " to uid " + uid);
+ }
+ return result.nspace;
+ }
+
+ /**
+ * Revokes access to the key in the app's namespace stored under the specified {@code
+ * alias} that was previously granted to another app on the device with the provided
+ * {@code uid}.
+ *
+ * <p>If the provided {@code alias} does not correspond to a key in the Android KeyStore, then
+ * an {@link UnrecoverableKeyException} is thrown.
+ *
+ * @param alias the alias of the key to be revoked from another app
+ * @param uid the uid of the app from which the key access should be revoked
+ * @throws UnrecoverableKeyException if the specified key cannot be recovered
+ * @throws KeyStoreException if an error is encountered when attempting to revoke access
+ * to the key
+ */
+ public void revokeKeyAccess(@NonNull String alias, int uid)
+ throws KeyStoreException, UnrecoverableKeyException {
+ KeyDescriptor keyDescriptor = createKeyDescriptorFromAlias(alias);
+ try {
+ mKeyStore2.ungrant(keyDescriptor, uid);
+ } catch (KeyStoreException e) {
+ // If the provided alias does not correspond to a valid key in the KeyStore, then throw
+ // an UnrecoverableKeyException to remain consistent with other APIs in this class.
+ if (e.getNumericErrorCode() == KeyStoreException.ERROR_KEY_DOES_NOT_EXIST) {
+ throw new UnrecoverableKeyException("No key found by the given alias");
+ }
+ throw e;
+ }
+ }
+
+ /**
+ * Returns the key with the specified {@code id} that was previously shared with the
+ * app.
+ *
+ * <p>This method can return instances of both {@link javax.crypto.SecretKey} and {@link
+ * java.security.PrivateKey}. If a key with the provide {@code id} has not been granted to the
+ * caller, then an {@link UnrecoverableKeyException} is thrown.
+ *
+ * @param id the ID of the key that was shared with the app
+ * @return the {@link Key} that was shared with the app
+ * @throws UnrecoverableKeyException if the specified key cannot be recovered
+ * @throws KeyPermanentlyInvalidatedException if the specified key was authorized to only
+ * be used if the user has been authenticated and a
+ * change has been made to the users
+ * lockscreen or biometric enrollment that
+ * permanently invalidates the key
+ * @see #grantKeyAccess(String, int)
+ */
+ public @NonNull Key getGrantedKeyFromId(long id)
+ throws UnrecoverableKeyException, KeyPermanentlyInvalidatedException {
+ Key result = AndroidKeyStoreProvider.loadAndroidKeyStoreKeyFromKeystore(mKeyStore2, null,
+ id, Domain.GRANT);
+ if (result == null) {
+ throw new UnrecoverableKeyException("No key found by the given alias");
+ }
+ return result;
+ }
+
+ /**
+ * Returns a {@link KeyPair} containing the public and private key associated with
+ * the key that was previously shared with the app under the provided {@code id}.
+ *
+ * <p>If a {@link java.security.PrivateKey} has not been granted to the caller with the
+ * specified {@code id}, then an {@link UnrecoverableKeyException} is thrown.
+ *
+ * @param id the ID of the private key that was shared with the app
+ * @return a KeyPair containing the public and private key shared with the app
+ * @throws UnrecoverableKeyException if the specified key cannot be recovered
+ * @throws KeyPermanentlyInvalidatedException if the specified key was authorized to only
+ * be used if the user has been authenticated and a
+ * change has been made to the users
+ * lockscreen or biometric enrollment that
+ * permanently invalidates the key
+ */
+ public @NonNull KeyPair getGrantedKeyPairFromId(long id)
+ throws UnrecoverableKeyException, KeyPermanentlyInvalidatedException {
+ KeyDescriptor keyDescriptor = createKeyDescriptorFromId(id, Domain.GRANT);
+ return AndroidKeyStoreProvider.loadAndroidKeyStoreKeyPairFromKeystore(mKeyStore2,
+ keyDescriptor);
+ }
+
+ /**
+ * Returns a {@link List} of {@link X509Certificate} instances representing the certificate
+ * chain for the key that was previously shared with the app under the provided {@code id}.
+ *
+ * <p>If a {@link java.security.PrivateKey} has not been granted to the caller with the
+ * specified {@code id}, then an {@link UnrecoverableKeyException} is thrown.
+ *
+ * @param id the ID of the asymmetric key that was shared with the app
+ * @return a List of X509Certificates with the certificate at index 0 corresponding to
+ * the private key shared with the app
+ * @throws UnrecoverableKeyException if the specified key cannot be recovered
+ * @throws KeyPermanentlyInvalidatedException if the specified key was authorized to only
+ * be used if the user has been authenticated and a
+ * change has been made to the users
+ * lockscreen or biometric enrollment that
+ * permanently invalidates the key
+ * @see #grantKeyAccess(String, int)
+ */
+ // Java APIs should prefer mutable collection return types with the exception being
+ // Collection.empty return types.
+ @SuppressWarnings("MixedMutabilityReturnType")
+ public @NonNull List<X509Certificate> getGrantedCertificateChainFromId(long id)
+ throws UnrecoverableKeyException, KeyPermanentlyInvalidatedException {
+ KeyDescriptor keyDescriptor = createKeyDescriptorFromId(id, Domain.GRANT);
+ KeyPair keyPair = AndroidKeyStoreProvider.loadAndroidKeyStoreKeyPairFromKeystore(mKeyStore2,
+ keyDescriptor);
+ PublicKey keyStoreKey = keyPair.getPublic();
+ if (keyStoreKey instanceof AndroidKeyStorePublicKey) {
+ AndroidKeyStorePublicKey androidKeyStorePublicKey =
+ (AndroidKeyStorePublicKey) keyStoreKey;
+ byte[] certBytes = androidKeyStorePublicKey.getCertificate();
+ X509Certificate cert = getCertificate(certBytes);
+ // If the leaf certificate is null, then a chain should not exist either
+ if (cert == null) {
+ return Collections.emptyList();
+ }
+ List<X509Certificate> result = new ArrayList<>();
+ result.add(cert);
+ byte[] certificateChain = androidKeyStorePublicKey.getCertificateChain();
+ Collection<X509Certificate> certificates = getCertificates(certificateChain);
+ result.addAll(certificates);
+ return result;
+ } else {
+ Log.e(TAG, "keyStoreKey is not of the expected type: " + keyStoreKey);
+ }
+ return Collections.emptyList();
+ }
+
+ /**
+ * Returns an {@link X509Certificate} instance from the provided {@code certificate} byte
+ * encoding of the certificate, or null if the provided encoding is null.
+ */
+ private static X509Certificate getCertificate(byte[] certificate) {
+ X509Certificate result = null;
+ if (certificate != null) {
+ try {
+ CertificateFactory certificateFactory = CertificateFactory.getInstance("X.509");
+ result = (X509Certificate) certificateFactory.generateCertificate(
+ new ByteArrayInputStream(certificate));
+ } catch (Exception e) {
+ Log.e(TAG, "Caught an exception parsing the certificate: ", e);
+ }
+ }
+ return result;
+ }
+
+ /**
+ * Returns a {@link Collection} of {@link X509Certificate} instances from the provided
+ * {@code certificateChain} byte encoding of the certificates, or null if the provided
+ * encoding is null.
+ */
+ private static Collection<X509Certificate> getCertificates(byte[] certificateChain) {
+ if (certificateChain != null) {
+ try {
+ CertificateFactory certificateFactory = CertificateFactory.getInstance("X.509");
+ Collection<X509Certificate> certificates =
+ (Collection<X509Certificate>) certificateFactory.generateCertificates(
+ new ByteArrayInputStream(certificateChain));
+ if (certificates == null) {
+ Log.e(TAG, "Received null certificates from a non-null certificateChain");
+ return Collections.emptyList();
+ }
+ return certificates;
+ } catch (Exception e) {
+ Log.e(TAG, "Caught an exception parsing the certs: ", e);
+ }
+ }
+ return Collections.emptyList();
+ }
+
+ /**
+ * Returns a new {@link KeyDescriptor} instance in the app domain / namespace with the {@code
+ * alias} set to the provided value.
+ */
+ private static KeyDescriptor createKeyDescriptorFromAlias(String alias) {
+ KeyDescriptor keyDescriptor = new KeyDescriptor();
+ keyDescriptor.domain = Domain.APP;
+ keyDescriptor.nspace = KeyProperties.NAMESPACE_APPLICATION;
+ keyDescriptor.alias = alias;
+ keyDescriptor.blob = null;
+ return keyDescriptor;
+ }
+
+ /**
+ * Returns a new {@link KeyDescriptor} instance in the provided {@code domain} with the nspace
+ * field set to the provided {@code id}.
+ */
+ private static KeyDescriptor createKeyDescriptorFromId(long id, int domain) {
+ KeyDescriptor keyDescriptor = new KeyDescriptor();
+ keyDescriptor.domain = domain;
+ keyDescriptor.nspace = id;
+ keyDescriptor.alias = null;
+ keyDescriptor.blob = null;
+ return keyDescriptor;
+ }
+}
diff --git a/keystore/java/android/security/keystore2/AndroidKeyStoreProvider.java b/keystore/java/android/security/keystore2/AndroidKeyStoreProvider.java
index 99100de12684..dcc8844b59bd 100644
--- a/keystore/java/android/security/keystore2/AndroidKeyStoreProvider.java
+++ b/keystore/java/android/security/keystore2/AndroidKeyStoreProvider.java
@@ -17,6 +17,7 @@
package android.security.keystore2;
import android.annotation.NonNull;
+import android.annotation.Nullable;
import android.security.KeyStore2;
import android.security.KeyStoreSecurityLevel;
import android.security.keymaster.KeymasterDefs;
@@ -335,11 +336,11 @@ public class AndroidKeyStoreProvider extends Provider {
}
/**
- * Loads an an AndroidKeyStoreKey from the AndroidKeyStore backend.
+ * Loads an AndroidKeyStoreKey from the AndroidKeyStore backend.
*
* @param keyStore The keystore2 backend.
* @param alias The alias of the key in the Keystore database.
- * @param namespace The a Keystore namespace. This is used by system api only to request
+ * @param namespace The Keystore namespace. This is used by system api only to request
* Android system specific keystore namespace, which can be configured
* in the device's SEPolicy. Third party apps and most system components
* set this parameter to -1 to indicate their application specific namespace.
@@ -351,14 +352,40 @@ public class AndroidKeyStoreProvider extends Provider {
public static AndroidKeyStoreKey loadAndroidKeyStoreKeyFromKeystore(
@NonNull KeyStore2 keyStore, @NonNull String alias, int namespace)
throws UnrecoverableKeyException, KeyPermanentlyInvalidatedException {
- KeyDescriptor descriptor = new KeyDescriptor();
+ int descriptorNamespace;
+ int descriptorDomain;
if (namespace == KeyProperties.NAMESPACE_APPLICATION) {
- descriptor.nspace = KeyProperties.NAMESPACE_APPLICATION; // ignored;
- descriptor.domain = Domain.APP;
+ descriptorNamespace = KeyProperties.NAMESPACE_APPLICATION; // ignored;
+ descriptorDomain = Domain.APP;
} else {
- descriptor.nspace = namespace;
- descriptor.domain = Domain.SELINUX;
+ descriptorNamespace = namespace;
+ descriptorDomain = Domain.SELINUX;
}
+ return loadAndroidKeyStoreKeyFromKeystore(keyStore, alias, descriptorNamespace,
+ descriptorDomain);
+ }
+
+ /**
+ * Loads an AndroidKeyStoreKey from the AndroidKeyStore backend.
+ *
+ * @param keyStore The keystore2 backend
+ * @param alias The alias of the key in the Keystore database
+ * @param namespace The Keystore namespace. This is used by system api only to request
+ * Android system specific keystore namespace, which can be configured
+ * in the device's SEPolicy. Third party apps and most system components
+ * set this parameter to -1 to indicate their application specific namespace.
+ * See <a href="https://source.android.com/security/keystore#access-control">
+ * Keystore 2.0 access control</a>
+ * @param domain The Keystore domain
+ * @return an AndroidKeyStoreKey corresponding to the provided values for the KeyDescriptor
+ * @hide
+ */
+ public static AndroidKeyStoreKey loadAndroidKeyStoreKeyFromKeystore(@NonNull KeyStore2 keyStore,
+ @Nullable String alias, long namespace, int domain)
+ throws UnrecoverableKeyException, KeyPermanentlyInvalidatedException {
+ KeyDescriptor descriptor = new KeyDescriptor();
+ descriptor.nspace = namespace;
+ descriptor.domain = domain;
descriptor.alias = alias;
descriptor.blob = null;
diff --git a/keystore/java/android/security/keystore2/AndroidKeyStorePublicKey.java b/keystore/java/android/security/keystore2/AndroidKeyStorePublicKey.java
index 0b3be327b521..bcf619b66439 100644
--- a/keystore/java/android/security/keystore2/AndroidKeyStorePublicKey.java
+++ b/keystore/java/android/security/keystore2/AndroidKeyStorePublicKey.java
@@ -44,6 +44,22 @@ public abstract class AndroidKeyStorePublicKey extends AndroidKeyStoreKey implem
mEncoded = x509EncodedForm;
}
+ /**
+ * Returns the byte array encoding of the certificate corresponding to this public key.
+ * @hide
+ */
+ public byte[] getCertificate() {
+ return mCertificate;
+ }
+
+ /**
+ * Returns the byte array encoding of the certificate chain for this public key.
+ * @hide
+ */
+ public byte[] getCertificateChain() {
+ return mCertificateChain;
+ }
+
abstract AndroidKeyStorePrivateKey getPrivateKey();
@Override
diff --git a/libcore-readonly.aconfig b/libcore-readonly.aconfig
new file mode 100644
index 000000000000..3cda92c45190
--- /dev/null
+++ b/libcore-readonly.aconfig
@@ -0,0 +1,25 @@
+package: "com.android.libcore.readonly"
+container: "system"
+
+# These are the read-only version of the aconfig flags in com.android.libcore
+# that will be built with 'force-read-only' mode.
+# See b/368409430 - these flags will be removed once the new aconfig API landed.
+flag {
+ namespace: "core_libraries"
+ name: "post_cleanup_apis"
+ is_exported: false
+ description: "This flag includes APIs to add/remove/call callbacks post-cleanup"
+ bug: "331243037"
+ # APIs provided by a mainline module can only use a frozen flag.
+ is_fixed_read_only: true
+}
+
+flag {
+ namespace: "core_libraries"
+ name: "native_metrics"
+ is_exported: false
+ description: "This flag includes APIs fo maintaining and exposing native allocation metrics"
+ bug: "331243037"
+ # APIs provided by a mainline module can only use a frozen flag.
+ is_fixed_read_only: true
+}
diff --git a/libs/WindowManager/Jetpack/src/androidx/window/extensions/WindowExtensionsImpl.java b/libs/WindowManager/Jetpack/src/androidx/window/extensions/WindowExtensionsImpl.java
index 7f11feaa585e..2ab0310d6789 100644
--- a/libs/WindowManager/Jetpack/src/androidx/window/extensions/WindowExtensionsImpl.java
+++ b/libs/WindowManager/Jetpack/src/androidx/window/extensions/WindowExtensionsImpl.java
@@ -57,9 +57,9 @@ class WindowExtensionsImpl implements WindowExtensions {
*/
private static final int NO_LEVEL_OVERRIDE = -1;
- private static final int EXTENSIONS_VERSION_V7 = 7;
+ private static final int EXTENSIONS_VERSION_V8 = 8;
- private static final int EXTENSIONS_VERSION_V6 = 6;
+ private static final int EXTENSIONS_VERSION_V7 = 7;
private final Object mLock = new Object();
private volatile DeviceStateManagerFoldingFeatureProducer mFoldingFeatureProducer;
@@ -80,12 +80,10 @@ class WindowExtensionsImpl implements WindowExtensions {
*/
@VisibleForTesting
static int getExtensionsVersionCurrentPlatform() {
- if (Flags.activityEmbeddingAnimationCustomizationFlag()) {
- // Activity Embedding animation customization is the only major feature for v7.
- return EXTENSIONS_VERSION_V7;
- } else {
- return EXTENSIONS_VERSION_V6;
+ if (Flags.aeBackStackRestore()) {
+ return EXTENSIONS_VERSION_V8;
}
+ return EXTENSIONS_VERSION_V7;
}
private String generateLogMessage() {
diff --git a/libs/WindowManager/Jetpack/src/androidx/window/extensions/embedding/DividerPresenter.java b/libs/WindowManager/Jetpack/src/androidx/window/extensions/embedding/DividerPresenter.java
index 882a8d035e93..ad194f707cf3 100644
--- a/libs/WindowManager/Jetpack/src/androidx/window/extensions/embedding/DividerPresenter.java
+++ b/libs/WindowManager/Jetpack/src/androidx/window/extensions/embedding/DividerPresenter.java
@@ -1255,7 +1255,8 @@ class DividerPresenter implements View.OnTouchListener {
// Update divider line surface visibility and color.
// If a container is fully expanded, the divider line is invisible unless dragging.
- final boolean isDividerLineVisible = !mProperties.mIsDraggableExpandType || mIsDragging;
+ final boolean isDividerLineVisible = mProperties.mDividerWidthPx > 0
+ && (!mProperties.mIsDraggableExpandType || mIsDragging);
t.setVisibility(mDividerLineSurface, isDividerLineVisible);
t.setColor(mDividerLineSurface, colorToFloatArray(
Color.valueOf(mProperties.mDividerAttributes.getDividerColor())));
diff --git a/libs/WindowManager/Shell/res/layout/desktop_mode_window_decor_handle_menu.xml b/libs/WindowManager/Shell/res/layout/desktop_mode_window_decor_handle_menu.xml
index aeb734e2d2d3..5609663c01a0 100644
--- a/libs/WindowManager/Shell/res/layout/desktop_mode_window_decor_handle_menu.xml
+++ b/libs/WindowManager/Shell/res/layout/desktop_mode_window_decor_handle_menu.xml
@@ -184,6 +184,7 @@
android:layout_height="20dp"
android:layout_gravity="end|center_vertical"
android:layout_marginEnd="16dp"
+ android:layout_marginStart="10dp"
android:contentDescription="@string/open_by_default_settings_text"
android:src="@drawable/desktop_mode_ic_handle_menu_open_by_default_settings"
android:tint="?androidprv:attr/materialColorOnSurface"/>
diff --git a/libs/WindowManager/Shell/res/values-af/strings.xml b/libs/WindowManager/Shell/res/values-af/strings.xml
index be5a74b7be4d..a0718d9ba148 100644
--- a/libs/WindowManager/Shell/res/values-af/strings.xml
+++ b/libs/WindowManager/Shell/res/values-af/strings.xml
@@ -97,9 +97,9 @@
<string name="camera_compat_treatment_suggested_button_description" msgid="8103916969024076767">"Kamerakwessies?\nTik om aan te pas"</string>
<string name="camera_compat_treatment_applied_button_description" msgid="2944157113330703897">"Nie opgelos nie?\nTik om terug te stel"</string>
<string name="camera_compat_dismiss_button_description" msgid="2795364433503817511">"Geen kamerakwessies nie? Tik om toe te maak."</string>
- <string name="windowing_app_handle_education_tooltip" msgid="6398482412956375783">"Tik om die appkieslys oop te maak"</string>
- <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="6285279585554484957">"Tik om verskeie apps saam te wys"</string>
- <string name="windowing_desktop_mode_exit_education_tooltip" msgid="6685429075790085337">"Keer terug na volskerm van die appkieslys af"</string>
+ <string name="windowing_app_handle_education_tooltip" msgid="2929643449849791854">"Die appkieslys kan hier gevind word"</string>
+ <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="2523468503353474095">"Maak rekenaaraansig oop om veelvuldige apps saam oop te maak"</string>
+ <string name="windowing_desktop_mode_exit_education_tooltip" msgid="5225660258192054132">"Keer enige tyd terug na volskerm vanaf die appkieslys"</string>
<string name="letterbox_education_dialog_title" msgid="7739895354143295358">"Sien en doen meer"</string>
<string name="letterbox_education_split_screen_text" msgid="449233070804658627">"Sleep ’n ander app in vir verdeelde skerm"</string>
<string name="letterbox_education_reposition_text" msgid="4589957299813220661">"Dubbeltik buite ’n program om dit te herposisioneer"</string>
diff --git a/libs/WindowManager/Shell/res/values-am/strings.xml b/libs/WindowManager/Shell/res/values-am/strings.xml
index 8c3e3faa2042..f160c70b7505 100644
--- a/libs/WindowManager/Shell/res/values-am/strings.xml
+++ b/libs/WindowManager/Shell/res/values-am/strings.xml
@@ -97,9 +97,9 @@
<string name="camera_compat_treatment_suggested_button_description" msgid="8103916969024076767">"የካሜራ ችግሮች አሉ?\nዳግም ለማበጀት መታ ያድርጉ"</string>
<string name="camera_compat_treatment_applied_button_description" msgid="2944157113330703897">"አልተስተካከለም?\nለማህደር መታ ያድርጉ"</string>
<string name="camera_compat_dismiss_button_description" msgid="2795364433503817511">"ምንም የካሜራ ችግሮች የሉም? ለማሰናበት መታ ያድርጉ።"</string>
- <string name="windowing_app_handle_education_tooltip" msgid="6398482412956375783">"የመተግበሪያ ምናሌውን ለመክፈት መታ ያድርጉ"</string>
- <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="6285279585554484957">"በርካታ መተግበሪያዎችን በአንድ ላይ ለማየት መታ ያድርጉ"</string>
- <string name="windowing_desktop_mode_exit_education_tooltip" msgid="6685429075790085337">"ከመተግበሪያ ምናሌው ወደ ሙሉ ማያ ገፅ ይመለሱ"</string>
+ <string name="windowing_app_handle_education_tooltip" msgid="2929643449849791854">"የመተግበሪያ ምናሌው እዚህ መገኘት ይችላል"</string>
+ <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="2523468503353474095">"በርካታ መተግበሪያዎችን በአንድ ላይ ለመክፈት ወደ የዴስክቶፕ እይታ ይግቡ"</string>
+ <string name="windowing_desktop_mode_exit_education_tooltip" msgid="5225660258192054132">"በማንኛውም ጊዜ ከመተግበሪያ ምናሌው ላይ ወደ ሙሉ ገጽ እይታ ይመለሱ"</string>
<string name="letterbox_education_dialog_title" msgid="7739895354143295358">"ተጨማሪ ይመልከቱ እና ያድርጉ"</string>
<string name="letterbox_education_split_screen_text" msgid="449233070804658627">"ለተከፈለ ማያ ገፅ ሌላ መተግበሪያ ይጎትቱ"</string>
<string name="letterbox_education_reposition_text" msgid="4589957299813220661">"ቦታውን ለመቀየር ከመተግበሪያው ውጭ ሁለቴ መታ ያድርጉ"</string>
diff --git a/libs/WindowManager/Shell/res/values-ar/strings.xml b/libs/WindowManager/Shell/res/values-ar/strings.xml
index 4a34ce6ad5cf..81706a21f77f 100644
--- a/libs/WindowManager/Shell/res/values-ar/strings.xml
+++ b/libs/WindowManager/Shell/res/values-ar/strings.xml
@@ -97,9 +97,9 @@
<string name="camera_compat_treatment_suggested_button_description" msgid="8103916969024076767">"هل هناك مشاكل في الكاميرا؟\nانقر لإعادة الضبط."</string>
<string name="camera_compat_treatment_applied_button_description" msgid="2944157113330703897">"ألم يتم حل المشكلة؟\nانقر للعودة"</string>
<string name="camera_compat_dismiss_button_description" msgid="2795364433503817511">"أليس هناك مشاكل في الكاميرا؟ انقر للإغلاق."</string>
- <string name="windowing_app_handle_education_tooltip" msgid="6398482412956375783">"انقر لفتح قائمة التطبيق"</string>
- <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="6285279585554484957">"انقر لعرض عدة تطبيقات معًا"</string>
- <string name="windowing_desktop_mode_exit_education_tooltip" msgid="6685429075790085337">"الرجوع إلى وضع ملء الشاشة من قائمة التطبيق"</string>
+ <string name="windowing_app_handle_education_tooltip" msgid="2929643449849791854">"يمكن العثور على قائمة التطبيقات هنا"</string>
+ <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="2523468503353474095">"يمكنك الدخول إلى وضع العرض المخصّص للكمبيوتر المكتبي لفتح عدة تطبيقات معًا"</string>
+ <string name="windowing_desktop_mode_exit_education_tooltip" msgid="5225660258192054132">"يمكنك الرجوع إلى وضع ملء الشاشة في أي وقت من قائمة التطبيقات"</string>
<string name="letterbox_education_dialog_title" msgid="7739895354143295358">"استخدام تطبيقات متعدّدة في وقت واحد"</string>
<string name="letterbox_education_split_screen_text" msgid="449233070804658627">"اسحب تطبيقًا آخر لاستخدام وضع تقسيم الشاشة."</string>
<string name="letterbox_education_reposition_text" msgid="4589957299813220661">"انقر مرّتين خارج تطبيق لتغيير موضعه."</string>
diff --git a/libs/WindowManager/Shell/res/values-as/strings.xml b/libs/WindowManager/Shell/res/values-as/strings.xml
index 94c9ba37c7dc..9fd4941afe84 100644
--- a/libs/WindowManager/Shell/res/values-as/strings.xml
+++ b/libs/WindowManager/Shell/res/values-as/strings.xml
@@ -97,9 +97,9 @@
<string name="camera_compat_treatment_suggested_button_description" msgid="8103916969024076767">"কেমেৰাৰ কোনো সমস্যা হৈছে নেকি?\nপুনৰ খাপ খোৱাবলৈ টিপক"</string>
<string name="camera_compat_treatment_applied_button_description" msgid="2944157113330703897">"এইটো সমাধান কৰা নাই নেকি?\nপূৰ্বাৱস্থালৈ নিবলৈ টিপক"</string>
<string name="camera_compat_dismiss_button_description" msgid="2795364433503817511">"কেমেৰাৰ কোনো সমস্যা নাই নেকি? অগ্ৰাহ্য কৰিবলৈ টিপক।"</string>
- <string name="windowing_app_handle_education_tooltip" msgid="6398482412956375783">"এপৰ মেনুখন খুলিবলৈ টিপক"</string>
- <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="6285279585554484957">"একাধিক এপ্ একেলগে দেখুৱাবলৈ টিপক"</string>
- <string name="windowing_desktop_mode_exit_education_tooltip" msgid="6685429075790085337">"এপৰ মেনুখনৰ পৰা পূৰ্ণ স্ক্ৰীনলৈ উভতি যাওক"</string>
+ <string name="windowing_app_handle_education_tooltip" msgid="2929643449849791854">"এপৰ মেনু ইয়াত বিচাৰি পোৱা যাব"</string>
+ <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="2523468503353474095">"একেলগে একাধিক এপ্‌ খুলিবলৈ ডেস্কটপ ভিউলৈ যাওক"</string>
+ <string name="windowing_desktop_mode_exit_education_tooltip" msgid="5225660258192054132">"এপৰ মেনুৰ পৰা যিকোনো সময়তে পূৰ্ণ স্ক্ৰীনলৈ উভতি যাওক"</string>
<string name="letterbox_education_dialog_title" msgid="7739895354143295358">"চাওক আৰু অধিক কৰক"</string>
<string name="letterbox_education_split_screen_text" msgid="449233070804658627">"বিভাজিত স্ক্ৰীনৰ বাবে অন্য এটা এপ্‌ টানি আনি এৰক"</string>
<string name="letterbox_education_reposition_text" msgid="4589957299813220661">"এপ্‌টোৰ স্থান সলনি কৰিবলৈ ইয়াৰ বাহিৰত দুবাৰ টিপক"</string>
diff --git a/libs/WindowManager/Shell/res/values-az/strings.xml b/libs/WindowManager/Shell/res/values-az/strings.xml
index 191d074ee714..3ab639730a90 100644
--- a/libs/WindowManager/Shell/res/values-az/strings.xml
+++ b/libs/WindowManager/Shell/res/values-az/strings.xml
@@ -97,9 +97,9 @@
<string name="camera_compat_treatment_suggested_button_description" msgid="8103916969024076767">"Kamera problemi var?\nBərpa etmək üçün toxunun"</string>
<string name="camera_compat_treatment_applied_button_description" msgid="2944157113330703897">"Düzəltməmisiniz?\nGeri qaytarmaq üçün toxunun"</string>
<string name="camera_compat_dismiss_button_description" msgid="2795364433503817511">"Kamera problemi yoxdur? Qapatmaq üçün toxunun."</string>
- <string name="windowing_app_handle_education_tooltip" msgid="6398482412956375783">"Tətbiq menyusunu açmaq üçün toxunun"</string>
- <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="6285279585554484957">"Bir neçə tətbiqi birlikdə göstərmək üçün toxunun"</string>
- <string name="windowing_desktop_mode_exit_education_tooltip" msgid="6685429075790085337">"Tətbiq menyusundan tam ekrana qayıdın"</string>
+ <string name="windowing_app_handle_education_tooltip" msgid="2929643449849791854">"Tətbiq menyusunu burada tapa bilərsiniz"</string>
+ <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="2523468503353474095">"Bir neçə tətbiqi birlikdə açmaq üçün masaüstü görünüşə daxil olun"</string>
+ <string name="windowing_desktop_mode_exit_education_tooltip" msgid="5225660258192054132">"İstənilən vaxt tətbiq menyusundan tam ekrana qayıdın"</string>
<string name="letterbox_education_dialog_title" msgid="7739895354143295358">"Ardını görün və edin"</string>
<string name="letterbox_education_split_screen_text" msgid="449233070804658627">"Bölünmüş ekran üçün başqa tətbiq sürüşdürün"</string>
<string name="letterbox_education_reposition_text" msgid="4589957299813220661">"Tətbiqin yerini dəyişmək üçün kənarına iki dəfə toxunun"</string>
diff --git a/libs/WindowManager/Shell/res/values-b+sr+Latn/strings.xml b/libs/WindowManager/Shell/res/values-b+sr+Latn/strings.xml
index 852c90e535a1..507625661527 100644
--- a/libs/WindowManager/Shell/res/values-b+sr+Latn/strings.xml
+++ b/libs/WindowManager/Shell/res/values-b+sr+Latn/strings.xml
@@ -97,9 +97,9 @@
<string name="camera_compat_treatment_suggested_button_description" msgid="8103916969024076767">"Imate problema sa kamerom?\nDodirnite da biste ponovo uklopili"</string>
<string name="camera_compat_treatment_applied_button_description" msgid="2944157113330703897">"Problem nije rešen?\nDodirnite da biste vratili"</string>
<string name="camera_compat_dismiss_button_description" msgid="2795364433503817511">"Nemate problema sa kamerom? Dodirnite da biste odbacili."</string>
- <string name="windowing_app_handle_education_tooltip" msgid="6398482412956375783">"Dodirnite da biste otvorili meni aplikacije"</string>
- <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="6285279585554484957">"Dodirnite da biste prikazali više aplikacija zajedno"</string>
- <string name="windowing_desktop_mode_exit_education_tooltip" msgid="6685429075790085337">"Vratite se iz menija aplikacije na prikaz preko celog ekrana"</string>
+ <string name="windowing_app_handle_education_tooltip" msgid="2929643449849791854">"Meni aplikacije možete da pronađete ovde"</string>
+ <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="2523468503353474095">"Uđite u prikaz za računare da biste istovremeno otvorili više aplikacija"</string>
+ <string name="windowing_desktop_mode_exit_education_tooltip" msgid="5225660258192054132">"Vratite se na ceo ekran bilo kada iz menija aplikacije"</string>
<string name="letterbox_education_dialog_title" msgid="7739895354143295358">"Vidite i uradite više"</string>
<string name="letterbox_education_split_screen_text" msgid="449233070804658627">"Prevucite drugu aplikaciju da biste koristili podeljeni ekran"</string>
<string name="letterbox_education_reposition_text" msgid="4589957299813220661">"Dvaput dodirnite izvan aplikacije da biste promenili njenu poziciju"</string>
diff --git a/libs/WindowManager/Shell/res/values-be/strings.xml b/libs/WindowManager/Shell/res/values-be/strings.xml
index 661b6c7aa920..95530c44562e 100644
--- a/libs/WindowManager/Shell/res/values-be/strings.xml
+++ b/libs/WindowManager/Shell/res/values-be/strings.xml
@@ -97,9 +97,9 @@
<string name="camera_compat_treatment_suggested_button_description" msgid="8103916969024076767">"Праблемы з камерай?\nНацісніце, каб пераабсталяваць"</string>
<string name="camera_compat_treatment_applied_button_description" msgid="2944157113330703897">"Не ўдалося выправіць?\nНацісніце, каб аднавіць"</string>
<string name="camera_compat_dismiss_button_description" msgid="2795364433503817511">"Ніякіх праблем з камерай? Націсніце, каб адхіліць."</string>
- <string name="windowing_app_handle_education_tooltip" msgid="6398482412956375783">"Адкрыць меню праграмы"</string>
- <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="6285279585554484957">"Паказаць некалькі праграм разам"</string>
- <string name="windowing_desktop_mode_exit_education_tooltip" msgid="6685429075790085337">"Вярнуцца ў поўнаэкранны рэжым з меню праграмы"</string>
+ <string name="windowing_app_handle_education_tooltip" msgid="2929643449849791854">"Меню праграмы шукайце тут"</string>
+ <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="2523468503353474095">"Каб адкрыць некалькі праграм адначасова, увайдзіце ў версію для камп’ютараў"</string>
+ <string name="windowing_desktop_mode_exit_education_tooltip" msgid="5225660258192054132">"Вы можаце вярнуцца ў поўнаэкранны рэжым у любы час з меню праграмы"</string>
<string name="letterbox_education_dialog_title" msgid="7739895354143295358">"Адначасова выконвайце розныя задачы"</string>
<string name="letterbox_education_split_screen_text" msgid="449233070804658627">"Перацягніце іншую праграму, каб выкарыстоўваць падзелены экран"</string>
<string name="letterbox_education_reposition_text" msgid="4589957299813220661">"Двойчы націсніце экран па-за праграмай, каб перамясціць яе"</string>
diff --git a/libs/WindowManager/Shell/res/values-bg/strings.xml b/libs/WindowManager/Shell/res/values-bg/strings.xml
index d6da2a8703f3..db498c1dfe1a 100644
--- a/libs/WindowManager/Shell/res/values-bg/strings.xml
+++ b/libs/WindowManager/Shell/res/values-bg/strings.xml
@@ -97,9 +97,9 @@
<string name="camera_compat_treatment_suggested_button_description" msgid="8103916969024076767">"Имате проблеми с камерата?\nДокоснете за ремонтиране"</string>
<string name="camera_compat_treatment_applied_button_description" msgid="2944157113330703897">"Проблемът не се отстрани?\nДокоснете за връщане в предишното състояние"</string>
<string name="camera_compat_dismiss_button_description" msgid="2795364433503817511">"Нямате проблеми с камерата? Докоснете, за да отхвърлите."</string>
- <string name="windowing_app_handle_education_tooltip" msgid="6398482412956375783">"Докоснете, за да отворите менюто на приложението"</string>
- <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="6285279585554484957">"Докоснете, за да видите няколко приложения заедно"</string>
- <string name="windowing_desktop_mode_exit_education_tooltip" msgid="6685429075790085337">"Връщане към цял екран от менюто на приложението"</string>
+ <string name="windowing_app_handle_education_tooltip" msgid="2929643449849791854">"Можете да намерите менюто на приложението тук"</string>
+ <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="2523468503353474095">"Активирайте изгледа за настолни компютри, за да отворите няколко приложения едновременно"</string>
+ <string name="windowing_desktop_mode_exit_education_tooltip" msgid="5225660258192054132">"Преминете към цял екран по всяко време от менюто на приложението"</string>
<string name="letterbox_education_dialog_title" msgid="7739895354143295358">"Преглеждайте и правете повече неща"</string>
<string name="letterbox_education_split_screen_text" msgid="449233070804658627">"Преместете друго приложение с плъзгане, за да преминете в режим за разделен екран"</string>
<string name="letterbox_education_reposition_text" msgid="4589957299813220661">"Докоснете два пъти извън дадено приложение, за да промените позицията му"</string>
diff --git a/libs/WindowManager/Shell/res/values-bn/strings.xml b/libs/WindowManager/Shell/res/values-bn/strings.xml
index 62e26b11fa21..4c2025378f04 100644
--- a/libs/WindowManager/Shell/res/values-bn/strings.xml
+++ b/libs/WindowManager/Shell/res/values-bn/strings.xml
@@ -97,9 +97,9 @@
<string name="camera_compat_treatment_suggested_button_description" msgid="8103916969024076767">"ক্যামেরা সংক্রান্ত সমস্যা?\nরিফিট করতে ট্যাপ করুন"</string>
<string name="camera_compat_treatment_applied_button_description" msgid="2944157113330703897">"এখনও সমাধান হয়নি?\nরিভার্ট করার জন্য ট্যাপ করুন"</string>
<string name="camera_compat_dismiss_button_description" msgid="2795364433503817511">"ক্যামেরা সংক্রান্ত সমস্যা নেই? বাতিল করতে ট্যাপ করুন।"</string>
- <string name="windowing_app_handle_education_tooltip" msgid="6398482412956375783">"অ্যাপ মেনু খুলতে ট্যাপ করুন"</string>
- <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="6285279585554484957">"একাধিক অ্যাপ একসাথে দেখতে ট্যাপ করুন"</string>
- <string name="windowing_desktop_mode_exit_education_tooltip" msgid="6685429075790085337">"অ্যাপ মেনু থেকে ফুল-স্ক্রিন মোডে ফিরে যান"</string>
+ <string name="windowing_app_handle_education_tooltip" msgid="2929643449849791854">"অ্যাপ মেনু এখানে খুঁজে পাওয়া যাবে"</string>
+ <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="2523468503353474095">"একসাথে একাধিক অ্যাপ খোলার জন্য ডেস্কটপ ভিউতে যান"</string>
+ <string name="windowing_desktop_mode_exit_education_tooltip" msgid="5225660258192054132">"অ্যাপ মেনু থেকে ফুল-স্ক্রিন মোডে যেকোনও সময়ে ফিরে আসুন"</string>
<string name="letterbox_education_dialog_title" msgid="7739895354143295358">"দেখুন ও আরও অনেক কিছু করুন"</string>
<string name="letterbox_education_split_screen_text" msgid="449233070804658627">"স্প্লিট স্ক্রিনের ক্ষেত্রে অন্য কোনও অ্যাপ টেনে আনুন"</string>
<string name="letterbox_education_reposition_text" msgid="4589957299813220661">"কোনও অ্যাপের স্থান পরিবর্তন করতে তার বাইরে ডবল ট্যাপ করুন"</string>
diff --git a/libs/WindowManager/Shell/res/values-bs/strings.xml b/libs/WindowManager/Shell/res/values-bs/strings.xml
index 15b6058c3196..102a91233627 100644
--- a/libs/WindowManager/Shell/res/values-bs/strings.xml
+++ b/libs/WindowManager/Shell/res/values-bs/strings.xml
@@ -97,9 +97,9 @@
<string name="camera_compat_treatment_suggested_button_description" msgid="8103916969024076767">"Problemi s kamerom?\nDodirnite da ponovo namjestite"</string>
<string name="camera_compat_treatment_applied_button_description" msgid="2944157113330703897">"Nije popravljeno?\nDodirnite da vratite"</string>
<string name="camera_compat_dismiss_button_description" msgid="2795364433503817511">"Nema problema s kamerom? Dodirnite da odbacite."</string>
- <string name="windowing_app_handle_education_tooltip" msgid="6398482412956375783">"Otvaranje menija aplikacije dodirom"</string>
- <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="6285279585554484957">"Istovremeni prikaz više aplikacija dodirom"</string>
- <string name="windowing_desktop_mode_exit_education_tooltip" msgid="6685429075790085337">"Povratak na prikaz preko cijelog ekrana putem menija aplikacije"</string>
+ <string name="windowing_app_handle_education_tooltip" msgid="2929643449849791854">"Ovdje možete pronaći meni aplikacije"</string>
+ <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="2523468503353474095">"Ulazak u prikaz na računaru radi istovremenog otvaranja više aplikacija"</string>
+ <string name="windowing_desktop_mode_exit_education_tooltip" msgid="5225660258192054132">"Povratak na prikaz preko cijelog ekrana bilo kada putem menija aplikacije"</string>
<string name="letterbox_education_dialog_title" msgid="7739895354143295358">"Pogledajte i učinite više"</string>
<string name="letterbox_education_split_screen_text" msgid="449233070804658627">"Prevucite još jednu aplikaciju za podijeljeni ekran"</string>
<string name="letterbox_education_reposition_text" msgid="4589957299813220661">"Dvaput dodirnite izvan aplikacije da promijenite njen položaj"</string>
diff --git a/libs/WindowManager/Shell/res/values-ca/strings.xml b/libs/WindowManager/Shell/res/values-ca/strings.xml
index 7cc65a7b075e..3e3fcd05a05b 100644
--- a/libs/WindowManager/Shell/res/values-ca/strings.xml
+++ b/libs/WindowManager/Shell/res/values-ca/strings.xml
@@ -97,9 +97,9 @@
<string name="camera_compat_treatment_suggested_button_description" msgid="8103916969024076767">"Tens problemes amb la càmera?\nToca per resoldre\'ls"</string>
<string name="camera_compat_treatment_applied_button_description" msgid="2944157113330703897">"El problema no s\'ha resolt?\nToca per desfer els canvis"</string>
<string name="camera_compat_dismiss_button_description" msgid="2795364433503817511">"No tens cap problema amb la càmera? Toca per ignorar."</string>
- <string name="windowing_app_handle_education_tooltip" msgid="6398482412956375783">"Toca per obrir el menú de l\'aplicació"</string>
- <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="6285279585554484957">"Toca per mostrar diverses aplicacions alhora"</string>
- <string name="windowing_desktop_mode_exit_education_tooltip" msgid="6685429075790085337">"Torna a la pantalla completa des del menú de l\'aplicació"</string>
+ <string name="windowing_app_handle_education_tooltip" msgid="2929643449849791854">"Pots trobar el menú de l\'aplicació aquí"</string>
+ <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="2523468503353474095">"Accedeix a la visualització per a ordinadors per obrir diverses aplicacions alhora"</string>
+ <string name="windowing_desktop_mode_exit_education_tooltip" msgid="5225660258192054132">"Torna a la pantalla completa en qualsevol moment des del menú de l\'aplicació"</string>
<string name="letterbox_education_dialog_title" msgid="7739895354143295358">"Consulta i fes més coses"</string>
<string name="letterbox_education_split_screen_text" msgid="449233070804658627">"Arrossega una altra aplicació per utilitzar la pantalla dividida"</string>
<string name="letterbox_education_reposition_text" msgid="4589957299813220661">"Fes doble toc fora d\'una aplicació per canviar-ne la posició"</string>
diff --git a/libs/WindowManager/Shell/res/values-cs/strings.xml b/libs/WindowManager/Shell/res/values-cs/strings.xml
index f8bdcafd8645..0627f54ecf47 100644
--- a/libs/WindowManager/Shell/res/values-cs/strings.xml
+++ b/libs/WindowManager/Shell/res/values-cs/strings.xml
@@ -97,9 +97,9 @@
<string name="camera_compat_treatment_suggested_button_description" msgid="8103916969024076767">"Problémy s fotoaparátem?\nKlepnutím vyřešíte"</string>
<string name="camera_compat_treatment_applied_button_description" msgid="2944157113330703897">"Nepomohlo to?\nKlepnutím se vrátíte"</string>
<string name="camera_compat_dismiss_button_description" msgid="2795364433503817511">"Žádné problémy s fotoaparátem? Klepnutím zavřete."</string>
- <string name="windowing_app_handle_education_tooltip" msgid="6398482412956375783">"Klepnutím otevřete nabídku aplikace"</string>
- <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="6285279585554484957">"Klepnutím zobrazíte několik aplikací najednou"</string>
- <string name="windowing_desktop_mode_exit_education_tooltip" msgid="6685429075790085337">"Návrat na celou obrazovku z nabídky aplikace"</string>
+ <string name="windowing_app_handle_education_tooltip" msgid="2929643449849791854">"Najdete tu nabídku aplikace"</string>
+ <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="2523468503353474095">"Pokud chcete otevřít několik aplikací současně, přejděte na zobrazení na počítači"</string>
+ <string name="windowing_desktop_mode_exit_education_tooltip" msgid="5225660258192054132">"Na celou obrazovku se můžete kdykoli vrátit z nabídky aplikace"</string>
<string name="letterbox_education_dialog_title" msgid="7739895354143295358">"Lepší zobrazení a více možností"</string>
<string name="letterbox_education_split_screen_text" msgid="449233070804658627">"Přetáhnutím druhé aplikace použijete rozdělenou obrazovku"</string>
<string name="letterbox_education_reposition_text" msgid="4589957299813220661">"Dvojitým klepnutím mimo aplikaci změníte její umístění"</string>
diff --git a/libs/WindowManager/Shell/res/values-da/strings.xml b/libs/WindowManager/Shell/res/values-da/strings.xml
index 1e05069f739a..ed9e5f07bad3 100644
--- a/libs/WindowManager/Shell/res/values-da/strings.xml
+++ b/libs/WindowManager/Shell/res/values-da/strings.xml
@@ -97,9 +97,9 @@
<string name="camera_compat_treatment_suggested_button_description" msgid="8103916969024076767">"Har du problemer med dit kamera?\nTryk for at gendanne det oprindelige format"</string>
<string name="camera_compat_treatment_applied_button_description" msgid="2944157113330703897">"Løste det ikke problemet?\nTryk for at fortryde"</string>
<string name="camera_compat_dismiss_button_description" msgid="2795364433503817511">"Har du ingen problemer med dit kamera? Tryk for at afvise."</string>
- <string name="windowing_app_handle_education_tooltip" msgid="6398482412956375783">"Tryk for at åbne appmenuen"</string>
- <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="6285279585554484957">"Tryk for at se flere apps på én gang"</string>
- <string name="windowing_desktop_mode_exit_education_tooltip" msgid="6685429075790085337">"Gå tilbage til fuld skærm via appmenuen"</string>
+ <string name="windowing_app_handle_education_tooltip" msgid="2929643449849791854">"Appmenuen kan findes her"</string>
+ <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="2523468503353474095">"Gå til computervenlig visning for at åbne flere apps på én gang"</string>
+ <string name="windowing_desktop_mode_exit_education_tooltip" msgid="5225660258192054132">"Gå tilbage til fuld skærm når som helst via appmenuen"</string>
<string name="letterbox_education_dialog_title" msgid="7739895354143295358">"Se og gør mere"</string>
<string name="letterbox_education_split_screen_text" msgid="449233070804658627">"Træk en anden app hertil for at bruge opdelt skærm"</string>
<string name="letterbox_education_reposition_text" msgid="4589957299813220661">"Tryk to gange uden for en app for at justere dens placering"</string>
diff --git a/libs/WindowManager/Shell/res/values-de/strings.xml b/libs/WindowManager/Shell/res/values-de/strings.xml
index bccd4ae1d6df..ec1cb03d7108 100644
--- a/libs/WindowManager/Shell/res/values-de/strings.xml
+++ b/libs/WindowManager/Shell/res/values-de/strings.xml
@@ -97,9 +97,9 @@
<string name="camera_compat_treatment_suggested_button_description" msgid="8103916969024076767">"Probleme mit der Kamera?\nZum Anpassen tippen."</string>
<string name="camera_compat_treatment_applied_button_description" msgid="2944157113330703897">"Das Problem ist nicht behoben?\nZum Rückgängigmachen tippen."</string>
<string name="camera_compat_dismiss_button_description" msgid="2795364433503817511">"Keine Probleme mit der Kamera? Zum Schließen tippen."</string>
- <string name="windowing_app_handle_education_tooltip" msgid="6398482412956375783">"Zum Öffnen des App-Menüs tippen"</string>
- <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="6285279585554484957">"Tippen, um mehrere Apps gleichzeitig anzuzeigen"</string>
- <string name="windowing_desktop_mode_exit_education_tooltip" msgid="6685429075790085337">"Über das App-Menü zum Vollbildmodus zurückkehren"</string>
+ <string name="windowing_app_handle_education_tooltip" msgid="2929643449849791854">"Das App-Menü findest du hier"</string>
+ <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="2523468503353474095">"Über die Desktop-Ansicht kannst du mehrere Apps gleichzeitig öffnen"</string>
+ <string name="windowing_desktop_mode_exit_education_tooltip" msgid="5225660258192054132">"Über das App-Menü kannst du jederzeit zum Vollbildmodus zurückkehren"</string>
<string name="letterbox_education_dialog_title" msgid="7739895354143295358">"Mehr sehen und erledigen"</string>
<string name="letterbox_education_split_screen_text" msgid="449233070804658627">"Für Splitscreen-Modus weitere App hineinziehen"</string>
<string name="letterbox_education_reposition_text" msgid="4589957299813220661">"Außerhalb einer App doppeltippen, um die Position zu ändern"</string>
@@ -136,14 +136,9 @@
<string name="desktop_mode_maximize_menu_maximize_button_text" msgid="3090199175564175845">"Maximieren"</string>
<string name="desktop_mode_maximize_menu_snap_left_button_text" msgid="8077452201179893424">"Links andocken"</string>
<string name="desktop_mode_maximize_menu_snap_right_button_text" msgid="7117751068945657304">"Rechts andocken"</string>
- <!-- no translation found for open_by_default_settings_text (2526548548598185500) -->
- <skip />
- <!-- no translation found for open_by_default_dialog_subheader_text (1729599730664063881) -->
- <skip />
- <!-- no translation found for open_by_default_dialog_in_app_text (6978022419634199806) -->
- <skip />
- <!-- no translation found for open_by_default_dialog_in_browser_text (8042769465958497081) -->
- <skip />
- <!-- no translation found for open_by_default_dialog_dismiss_button_text (3487238795534582291) -->
- <skip />
+ <string name="open_by_default_settings_text" msgid="2526548548598185500">"Einstellungen für die Option „Standardmäßig öffnen“"</string>
+ <string name="open_by_default_dialog_subheader_text" msgid="1729599730664063881">"Festlegen, wie Weblinks für diese App geöffnet werden"</string>
+ <string name="open_by_default_dialog_in_app_text" msgid="6978022419634199806">"In der App"</string>
+ <string name="open_by_default_dialog_in_browser_text" msgid="8042769465958497081">"In deinem Browser"</string>
+ <string name="open_by_default_dialog_dismiss_button_text" msgid="3487238795534582291">"Ok"</string>
</resources>
diff --git a/libs/WindowManager/Shell/res/values-el/strings.xml b/libs/WindowManager/Shell/res/values-el/strings.xml
index 6466215c2865..7a690ce2e188 100644
--- a/libs/WindowManager/Shell/res/values-el/strings.xml
+++ b/libs/WindowManager/Shell/res/values-el/strings.xml
@@ -97,9 +97,9 @@
<string name="camera_compat_treatment_suggested_button_description" msgid="8103916969024076767">"Προβλήματα με την κάμερα;\nΠατήστε για επιδιόρθωση."</string>
<string name="camera_compat_treatment_applied_button_description" msgid="2944157113330703897">"Δεν διορθώθηκε;\nΠατήστε για επαναφορά."</string>
<string name="camera_compat_dismiss_button_description" msgid="2795364433503817511">"Δεν αντιμετωπίζετε προβλήματα με την κάμερα; Πατήστε για παράβλεψη."</string>
- <string name="windowing_app_handle_education_tooltip" msgid="6398482412956375783">"Πατήστε για άνοιγμα του μενού της εφαρμογής"</string>
- <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="6285279585554484957">"Πατήστε για εμφάνιση πολλών εφαρμογών μαζί"</string>
- <string name="windowing_desktop_mode_exit_education_tooltip" msgid="6685429075790085337">"Επιστρέψτε στην πλήρη οθόνη από το μενού της εφαρμογής"</string>
+ <string name="windowing_app_handle_education_tooltip" msgid="2929643449849791854">"Μπορείτε να βρείτε το μενού εφαρμογών εδώ"</string>
+ <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="2523468503353474095">"Μεταβείτε στην προβολή για υπολογιστές, για να ανοίξετε πολλές εφαρμογές μαζί"</string>
+ <string name="windowing_desktop_mode_exit_education_tooltip" msgid="5225660258192054132">"Επιστρέψτε στην πλήρη οθόνη ανά πάσα στιγμή από το μενού της εφαρμογής"</string>
<string name="letterbox_education_dialog_title" msgid="7739895354143295358">"Δείτε και κάντε περισσότερα"</string>
<string name="letterbox_education_split_screen_text" msgid="449233070804658627">"Σύρετε σε μια άλλη εφαρμογή για διαχωρισμό οθόνης."</string>
<string name="letterbox_education_reposition_text" msgid="4589957299813220661">"Πατήστε δύο φορές έξω από μια εφαρμογή για να αλλάξετε τη θέση της"</string>
diff --git a/libs/WindowManager/Shell/res/values-en-rAU/strings.xml b/libs/WindowManager/Shell/res/values-en-rAU/strings.xml
index 018291533e41..afb3f8e1a5ce 100644
--- a/libs/WindowManager/Shell/res/values-en-rAU/strings.xml
+++ b/libs/WindowManager/Shell/res/values-en-rAU/strings.xml
@@ -97,9 +97,9 @@
<string name="camera_compat_treatment_suggested_button_description" msgid="8103916969024076767">"Camera issues?\nTap to refit"</string>
<string name="camera_compat_treatment_applied_button_description" msgid="2944157113330703897">"Didn’t fix it?\nTap to revert"</string>
<string name="camera_compat_dismiss_button_description" msgid="2795364433503817511">"No camera issues? Tap to dismiss."</string>
- <string name="windowing_app_handle_education_tooltip" msgid="6398482412956375783">"Tap to open the app menu"</string>
- <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="6285279585554484957">"Tap to show multiple apps together"</string>
- <string name="windowing_desktop_mode_exit_education_tooltip" msgid="6685429075790085337">"Return to fullscreen from the app menu"</string>
+ <string name="windowing_app_handle_education_tooltip" msgid="2929643449849791854">"The app menu can be found here"</string>
+ <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="2523468503353474095">"Enter desktop view to open multiple apps together"</string>
+ <string name="windowing_desktop_mode_exit_education_tooltip" msgid="5225660258192054132">"Return to full screen at any time from the app menu"</string>
<string name="letterbox_education_dialog_title" msgid="7739895354143295358">"See and do more"</string>
<string name="letterbox_education_split_screen_text" msgid="449233070804658627">"Drag in another app for split screen"</string>
<string name="letterbox_education_reposition_text" msgid="4589957299813220661">"Double-tap outside an app to reposition it"</string>
diff --git a/libs/WindowManager/Shell/res/values-en-rCA/strings.xml b/libs/WindowManager/Shell/res/values-en-rCA/strings.xml
index 9d581092748b..aa392519145b 100644
--- a/libs/WindowManager/Shell/res/values-en-rCA/strings.xml
+++ b/libs/WindowManager/Shell/res/values-en-rCA/strings.xml
@@ -97,9 +97,9 @@
<string name="camera_compat_treatment_suggested_button_description" msgid="8103916969024076767">"Camera issues?\nTap to refit"</string>
<string name="camera_compat_treatment_applied_button_description" msgid="2944157113330703897">"Didn’t fix it?\nTap to revert"</string>
<string name="camera_compat_dismiss_button_description" msgid="2795364433503817511">"No camera issues? Tap to dismiss."</string>
- <string name="windowing_app_handle_education_tooltip" msgid="6398482412956375783">"Tap to open the app menu"</string>
- <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="6285279585554484957">"Tap to show multiple apps together"</string>
- <string name="windowing_desktop_mode_exit_education_tooltip" msgid="6685429075790085337">"Return to fullscreen from the app menu"</string>
+ <string name="windowing_app_handle_education_tooltip" msgid="2929643449849791854">"The app menu can be found here"</string>
+ <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="2523468503353474095">"Enter desktop view to open multiple apps together"</string>
+ <string name="windowing_desktop_mode_exit_education_tooltip" msgid="5225660258192054132">"Return to full screen anytime from the app menu"</string>
<string name="letterbox_education_dialog_title" msgid="7739895354143295358">"See and do more"</string>
<string name="letterbox_education_split_screen_text" msgid="449233070804658627">"Drag in another app for split screen"</string>
<string name="letterbox_education_reposition_text" msgid="4589957299813220661">"Double-tap outside an app to reposition it"</string>
diff --git a/libs/WindowManager/Shell/res/values-en-rGB/strings.xml b/libs/WindowManager/Shell/res/values-en-rGB/strings.xml
index 018291533e41..afb3f8e1a5ce 100644
--- a/libs/WindowManager/Shell/res/values-en-rGB/strings.xml
+++ b/libs/WindowManager/Shell/res/values-en-rGB/strings.xml
@@ -97,9 +97,9 @@
<string name="camera_compat_treatment_suggested_button_description" msgid="8103916969024076767">"Camera issues?\nTap to refit"</string>
<string name="camera_compat_treatment_applied_button_description" msgid="2944157113330703897">"Didn’t fix it?\nTap to revert"</string>
<string name="camera_compat_dismiss_button_description" msgid="2795364433503817511">"No camera issues? Tap to dismiss."</string>
- <string name="windowing_app_handle_education_tooltip" msgid="6398482412956375783">"Tap to open the app menu"</string>
- <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="6285279585554484957">"Tap to show multiple apps together"</string>
- <string name="windowing_desktop_mode_exit_education_tooltip" msgid="6685429075790085337">"Return to fullscreen from the app menu"</string>
+ <string name="windowing_app_handle_education_tooltip" msgid="2929643449849791854">"The app menu can be found here"</string>
+ <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="2523468503353474095">"Enter desktop view to open multiple apps together"</string>
+ <string name="windowing_desktop_mode_exit_education_tooltip" msgid="5225660258192054132">"Return to full screen at any time from the app menu"</string>
<string name="letterbox_education_dialog_title" msgid="7739895354143295358">"See and do more"</string>
<string name="letterbox_education_split_screen_text" msgid="449233070804658627">"Drag in another app for split screen"</string>
<string name="letterbox_education_reposition_text" msgid="4589957299813220661">"Double-tap outside an app to reposition it"</string>
diff --git a/libs/WindowManager/Shell/res/values-en-rIN/strings.xml b/libs/WindowManager/Shell/res/values-en-rIN/strings.xml
index 018291533e41..afb3f8e1a5ce 100644
--- a/libs/WindowManager/Shell/res/values-en-rIN/strings.xml
+++ b/libs/WindowManager/Shell/res/values-en-rIN/strings.xml
@@ -97,9 +97,9 @@
<string name="camera_compat_treatment_suggested_button_description" msgid="8103916969024076767">"Camera issues?\nTap to refit"</string>
<string name="camera_compat_treatment_applied_button_description" msgid="2944157113330703897">"Didn’t fix it?\nTap to revert"</string>
<string name="camera_compat_dismiss_button_description" msgid="2795364433503817511">"No camera issues? Tap to dismiss."</string>
- <string name="windowing_app_handle_education_tooltip" msgid="6398482412956375783">"Tap to open the app menu"</string>
- <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="6285279585554484957">"Tap to show multiple apps together"</string>
- <string name="windowing_desktop_mode_exit_education_tooltip" msgid="6685429075790085337">"Return to fullscreen from the app menu"</string>
+ <string name="windowing_app_handle_education_tooltip" msgid="2929643449849791854">"The app menu can be found here"</string>
+ <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="2523468503353474095">"Enter desktop view to open multiple apps together"</string>
+ <string name="windowing_desktop_mode_exit_education_tooltip" msgid="5225660258192054132">"Return to full screen at any time from the app menu"</string>
<string name="letterbox_education_dialog_title" msgid="7739895354143295358">"See and do more"</string>
<string name="letterbox_education_split_screen_text" msgid="449233070804658627">"Drag in another app for split screen"</string>
<string name="letterbox_education_reposition_text" msgid="4589957299813220661">"Double-tap outside an app to reposition it"</string>
diff --git a/libs/WindowManager/Shell/res/values-es-rUS/strings.xml b/libs/WindowManager/Shell/res/values-es-rUS/strings.xml
index 630d8067f381..5244a61883d0 100644
--- a/libs/WindowManager/Shell/res/values-es-rUS/strings.xml
+++ b/libs/WindowManager/Shell/res/values-es-rUS/strings.xml
@@ -97,9 +97,9 @@
<string name="camera_compat_treatment_suggested_button_description" msgid="8103916969024076767">"¿Tienes problemas con la cámara?\nPresiona para reajustarla"</string>
<string name="camera_compat_treatment_applied_button_description" msgid="2944157113330703897">"¿No se resolvió?\nPresiona para revertir los cambios"</string>
<string name="camera_compat_dismiss_button_description" msgid="2795364433503817511">"¿No tienes problemas con la cámara? Presionar para descartar."</string>
- <string name="windowing_app_handle_education_tooltip" msgid="6398482412956375783">"Presiona para abrir el menú de la app"</string>
- <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="6285279585554484957">"Presiona para mostrar varias apps juntas"</string>
- <string name="windowing_desktop_mode_exit_education_tooltip" msgid="6685429075790085337">"Regresa a pantalla completa desde el menú de la app"</string>
+ <string name="windowing_app_handle_education_tooltip" msgid="2929643449849791854">"El menú de la app se encuentra aquí"</string>
+ <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="2523468503353474095">"Entra a la vista de escritorio para abrir varias apps a la vez"</string>
+ <string name="windowing_desktop_mode_exit_education_tooltip" msgid="5225660258192054132">"Regresa a pantalla completa en cualquier momento desde el menú de la app"</string>
<string name="letterbox_education_dialog_title" msgid="7739895354143295358">"Aprovecha más"</string>
<string name="letterbox_education_split_screen_text" msgid="449233070804658627">"Arrastra otra app para el modo de pantalla dividida"</string>
<string name="letterbox_education_reposition_text" msgid="4589957299813220661">"Presiona dos veces fuera de una app para cambiar su ubicación"</string>
diff --git a/libs/WindowManager/Shell/res/values-es/strings.xml b/libs/WindowManager/Shell/res/values-es/strings.xml
index 9f6b2e65c27c..a673351f8316 100644
--- a/libs/WindowManager/Shell/res/values-es/strings.xml
+++ b/libs/WindowManager/Shell/res/values-es/strings.xml
@@ -97,9 +97,9 @@
<string name="camera_compat_treatment_suggested_button_description" msgid="8103916969024076767">"¿Problemas con la cámara?\nToca para reajustar"</string>
<string name="camera_compat_treatment_applied_button_description" msgid="2944157113330703897">"¿No se ha solucionado?\nToca para revertir"</string>
<string name="camera_compat_dismiss_button_description" msgid="2795364433503817511">"¿No hay problemas con la cámara? Toca para cerrar."</string>
- <string name="windowing_app_handle_education_tooltip" msgid="6398482412956375783">"Toca para abrir el menú de aplicaciones"</string>
- <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="6285279585554484957">"Toca para mostrar varias aplicaciones a la vez"</string>
- <string name="windowing_desktop_mode_exit_education_tooltip" msgid="6685429075790085337">"Vuelve a pantalla completa desde el menú de aplicaciones"</string>
+ <string name="windowing_app_handle_education_tooltip" msgid="2929643449849791854">"El menú de la aplicación se encuentra aquí"</string>
+ <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="2523468503353474095">"Entra en la vista para ordenador si quieres abrir varias aplicaciones a la vez"</string>
+ <string name="windowing_desktop_mode_exit_education_tooltip" msgid="5225660258192054132">"Vuelve a la pantalla completa en cualquier momento desde el menú de aplicaciones"</string>
<string name="letterbox_education_dialog_title" msgid="7739895354143295358">"Consulta más información y haz más"</string>
<string name="letterbox_education_split_screen_text" msgid="449233070804658627">"Arrastra otra aplicación para activar la pantalla dividida"</string>
<string name="letterbox_education_reposition_text" msgid="4589957299813220661">"Toca dos veces fuera de una aplicación para cambiarla de posición"</string>
@@ -136,14 +136,9 @@
<string name="desktop_mode_maximize_menu_maximize_button_text" msgid="3090199175564175845">"Maximizar"</string>
<string name="desktop_mode_maximize_menu_snap_left_button_text" msgid="8077452201179893424">"Acoplar a la izquierda"</string>
<string name="desktop_mode_maximize_menu_snap_right_button_text" msgid="7117751068945657304">"Acoplar a la derecha"</string>
- <!-- no translation found for open_by_default_settings_text (2526548548598185500) -->
- <skip />
- <!-- no translation found for open_by_default_dialog_subheader_text (1729599730664063881) -->
- <skip />
- <!-- no translation found for open_by_default_dialog_in_app_text (6978022419634199806) -->
- <skip />
- <!-- no translation found for open_by_default_dialog_in_browser_text (8042769465958497081) -->
- <skip />
- <!-- no translation found for open_by_default_dialog_dismiss_button_text (3487238795534582291) -->
- <skip />
+ <string name="open_by_default_settings_text" msgid="2526548548598185500">"Abrir con los ajustes predeterminados"</string>
+ <string name="open_by_default_dialog_subheader_text" msgid="1729599730664063881">"Elige cómo quieres abrir los enlaces web de esta aplicación"</string>
+ <string name="open_by_default_dialog_in_app_text" msgid="6978022419634199806">"En la aplicación"</string>
+ <string name="open_by_default_dialog_in_browser_text" msgid="8042769465958497081">"En el navegador"</string>
+ <string name="open_by_default_dialog_dismiss_button_text" msgid="3487238795534582291">"Aceptar"</string>
</resources>
diff --git a/libs/WindowManager/Shell/res/values-et/strings.xml b/libs/WindowManager/Shell/res/values-et/strings.xml
index 25c068b1fa43..686385c4bdb8 100644
--- a/libs/WindowManager/Shell/res/values-et/strings.xml
+++ b/libs/WindowManager/Shell/res/values-et/strings.xml
@@ -97,9 +97,9 @@
<string name="camera_compat_treatment_suggested_button_description" msgid="8103916969024076767">"Kas teil on kaameraprobleeme?\nPuudutage ümberpaigutamiseks."</string>
<string name="camera_compat_treatment_applied_button_description" msgid="2944157113330703897">"Kas probleemi ei lahendatud?\nPuudutage ennistamiseks."</string>
<string name="camera_compat_dismiss_button_description" msgid="2795364433503817511">"Kas kaameraprobleeme pole? Puudutage loobumiseks."</string>
- <string name="windowing_app_handle_education_tooltip" msgid="6398482412956375783">"Puudutage rakenduse menüü avamiseks"</string>
- <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="6285279585554484957">"Puudutage mitme rakenduse koos kuvamiseks"</string>
- <string name="windowing_desktop_mode_exit_education_tooltip" msgid="6685429075790085337">"Minge rakenduse menüüst tagasi täisekraanile"</string>
+ <string name="windowing_app_handle_education_tooltip" msgid="2929643449849791854">"Rakenduse menüü leiate siit"</string>
+ <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="2523468503353474095">"Mitme rakenduse koos avamiseks avage arvutivaade"</string>
+ <string name="windowing_desktop_mode_exit_education_tooltip" msgid="5225660258192054132">"Saate rakenduse menüüst igal ajal täisekraanile naasta"</string>
<string name="letterbox_education_dialog_title" msgid="7739895354143295358">"Vaadake ja tehke rohkem"</string>
<string name="letterbox_education_split_screen_text" msgid="449233070804658627">"Lohistage muusse rakendusse, et jagatud ekraanikuva kasutada"</string>
<string name="letterbox_education_reposition_text" msgid="4589957299813220661">"Topeltpuudutage rakendusest väljaspool, et selle asendit muuta"</string>
diff --git a/libs/WindowManager/Shell/res/values-eu/strings.xml b/libs/WindowManager/Shell/res/values-eu/strings.xml
index ba4cbc88120b..1f0e54cedd58 100644
--- a/libs/WindowManager/Shell/res/values-eu/strings.xml
+++ b/libs/WindowManager/Shell/res/values-eu/strings.xml
@@ -97,9 +97,9 @@
<string name="camera_compat_treatment_suggested_button_description" msgid="8103916969024076767">"Arazoak dauzkazu kamerarekin?\nBerriro doitzeko, sakatu hau."</string>
<string name="camera_compat_treatment_applied_button_description" msgid="2944157113330703897">"Ez al da konpondu?\nLeheneratzeko, sakatu hau."</string>
<string name="camera_compat_dismiss_button_description" msgid="2795364433503817511">"Ez daukazu arazorik kamerarekin? Baztertzeko, sakatu hau."</string>
- <string name="windowing_app_handle_education_tooltip" msgid="6398482412956375783">"Sakatu hau aplikazioen menua irekitzeko"</string>
- <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="6285279585554484957">"Sakatu hau aplikazio bat baino gehiago aldi berean erakusteko"</string>
- <string name="windowing_desktop_mode_exit_education_tooltip" msgid="6685429075790085337">"Itzuli pantaila osora aplikazioen menutik"</string>
+ <string name="windowing_app_handle_education_tooltip" msgid="2929643449849791854">"Aplikazioaren menua dago hemen"</string>
+ <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="2523468503353474095">"Sartu ordenagailuetarako ikuspegian aplikazio bat baino gehiago batera irekitzeko"</string>
+ <string name="windowing_desktop_mode_exit_education_tooltip" msgid="5225660258192054132">"Pantaila osoko modura itzultzeko, erabili aplikazioaren menua"</string>
<string name="letterbox_education_dialog_title" msgid="7739895354143295358">"Ikusi eta egin gauza gehiago"</string>
<string name="letterbox_education_split_screen_text" msgid="449233070804658627">"Pantaila zatitua ikusteko, arrastatu beste aplikazio bat"</string>
<string name="letterbox_education_reposition_text" msgid="4589957299813220661">"Aplikazioaren posizioa aldatzeko, sakatu birritan haren kanpoaldea"</string>
diff --git a/libs/WindowManager/Shell/res/values-fa/strings.xml b/libs/WindowManager/Shell/res/values-fa/strings.xml
index 95bad9cce976..ad39b28eed1e 100644
--- a/libs/WindowManager/Shell/res/values-fa/strings.xml
+++ b/libs/WindowManager/Shell/res/values-fa/strings.xml
@@ -97,9 +97,9 @@
<string name="camera_compat_treatment_suggested_button_description" msgid="8103916969024076767">"دوربین مشکل دارد؟\nبرای تنظیم مجدد اندازه تک‌ضرب بزنید"</string>
<string name="camera_compat_treatment_applied_button_description" msgid="2944157113330703897">"مشکل برطرف نشد؟\nبرای برگرداندن تک‌ضرب بزنید"</string>
<string name="camera_compat_dismiss_button_description" msgid="2795364433503817511">"دوربین مشکلی ندارد؟ برای بستن تک‌ضرب بزنید."</string>
- <string name="windowing_app_handle_education_tooltip" msgid="6398482412956375783">"برای باز کردن منو برنامه، تک‌ضرب بزنید"</string>
- <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="6285279585554484957">"برای نمایش چند برنامه با هم، تک‌ضرب بزنید"</string>
- <string name="windowing_desktop_mode_exit_education_tooltip" msgid="6685429075790085337">"از منو برنامه به تمام‌صفحه برگردید"</string>
+ <string name="windowing_app_handle_education_tooltip" msgid="2929643449849791854">"منو برنامه را می‌توانید اینجا ببینید"</string>
+ <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="2523468503353474095">"برای باز کردن هم‌زمان چند برنامه، وارد نمای ویژه رایانه شوید"</string>
+ <string name="windowing_desktop_mode_exit_education_tooltip" msgid="5225660258192054132">"هروقت خواستید از منو برنامه به حالت تمام‌صفحه برگردید"</string>
<string name="letterbox_education_dialog_title" msgid="7739895354143295358">"از چندین برنامه به‌طور هم‌زمان استفاده کنید"</string>
<string name="letterbox_education_split_screen_text" msgid="449233070804658627">"برای حالت صفحهٔ دونیمه، در برنامه‌ای دیگر بکشید"</string>
<string name="letterbox_education_reposition_text" msgid="4589957299813220661">"برای جابه‌جا کردن برنامه، بیرون از آن دو تک‌ضرب بزنید"</string>
diff --git a/libs/WindowManager/Shell/res/values-fi/strings.xml b/libs/WindowManager/Shell/res/values-fi/strings.xml
index 9c841afc9983..2f0edd33226b 100644
--- a/libs/WindowManager/Shell/res/values-fi/strings.xml
+++ b/libs/WindowManager/Shell/res/values-fi/strings.xml
@@ -97,9 +97,9 @@
<string name="camera_compat_treatment_suggested_button_description" msgid="8103916969024076767">"Onko kameran kanssa ongelmia?\nKorjaa napauttamalla"</string>
<string name="camera_compat_treatment_applied_button_description" msgid="2944157113330703897">"Eikö ongelma ratkennut?\nKumoa napauttamalla"</string>
<string name="camera_compat_dismiss_button_description" msgid="2795364433503817511">"Ei ongelmia kameran kanssa? Hylkää napauttamalla."</string>
- <string name="windowing_app_handle_education_tooltip" msgid="6398482412956375783">"Avaa sovellusvalikko napauttamalla"</string>
- <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="6285279585554484957">"Näytä useita sovelluksia yhdessä napauttamalla"</string>
- <string name="windowing_desktop_mode_exit_education_tooltip" msgid="6685429075790085337">"Palaa koko näytön tilaan sovellusvalikosta"</string>
+ <string name="windowing_app_handle_education_tooltip" msgid="2929643449849791854">"Sovellusvalikko löytyy täältä"</string>
+ <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="2523468503353474095">"Siirry työpöytänäkymään, niin voit avata useita sovelluksia kerralla"</string>
+ <string name="windowing_desktop_mode_exit_education_tooltip" msgid="5225660258192054132">"Voit palata koko näytön tilaan milloin tahansa sovellusvalikosta"</string>
<string name="letterbox_education_dialog_title" msgid="7739895354143295358">"Näe ja tee enemmän"</string>
<string name="letterbox_education_split_screen_text" msgid="449233070804658627">"Käytä jaettua näyttöä vetämällä tähän toinen sovellus"</string>
<string name="letterbox_education_reposition_text" msgid="4589957299813220661">"Kaksoisnapauta sovelluksen ulkopuolella, jos haluat siirtää sitä"</string>
diff --git a/libs/WindowManager/Shell/res/values-fr-rCA/strings.xml b/libs/WindowManager/Shell/res/values-fr-rCA/strings.xml
index c163165a8296..245396156aad 100644
--- a/libs/WindowManager/Shell/res/values-fr-rCA/strings.xml
+++ b/libs/WindowManager/Shell/res/values-fr-rCA/strings.xml
@@ -97,9 +97,9 @@
<string name="camera_compat_treatment_suggested_button_description" msgid="8103916969024076767">"Problèmes d\'appareil photo?\nTouchez pour réajuster"</string>
<string name="camera_compat_treatment_applied_button_description" msgid="2944157113330703897">"Problème non résolu?\nTouchez pour rétablir"</string>
<string name="camera_compat_dismiss_button_description" msgid="2795364433503817511">"Aucun problème d\'appareil photo? Touchez pour ignorer."</string>
- <string name="windowing_app_handle_education_tooltip" msgid="6398482412956375783">"Toucher ici pour ouvrir le menu de l\'appli"</string>
- <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="6285279585554484957">"Toucher ici pour afficher plusieurs applis ensemble"</string>
- <string name="windowing_desktop_mode_exit_education_tooltip" msgid="6685429075790085337">"Revenir au mode Plein écran à partir du menu de l\'appli"</string>
+ <string name="windowing_app_handle_education_tooltip" msgid="2929643449849791854">"Le menu de l\'appli se trouve ici"</string>
+ <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="2523468503353474095">"Accéder à l\'affichage sur un ordinateur de bureau pour ouvrir plusieurs applis simultanément"</string>
+ <string name="windowing_desktop_mode_exit_education_tooltip" msgid="5225660258192054132">"Revenir au mode Plein écran à tout moment à partir du menu de l\'appli"</string>
<string name="letterbox_education_dialog_title" msgid="7739895354143295358">"Voir et en faire plus"</string>
<string name="letterbox_education_split_screen_text" msgid="449233070804658627">"Faites glisser une autre appli pour utiliser l\'écran partagé"</string>
<string name="letterbox_education_reposition_text" msgid="4589957299813220661">"Touchez deux fois à côté d\'une appli pour la repositionner"</string>
@@ -136,14 +136,9 @@
<string name="desktop_mode_maximize_menu_maximize_button_text" msgid="3090199175564175845">"Agrandir"</string>
<string name="desktop_mode_maximize_menu_snap_left_button_text" msgid="8077452201179893424">"Épingler à gauche"</string>
<string name="desktop_mode_maximize_menu_snap_right_button_text" msgid="7117751068945657304">"Épingler à droite"</string>
- <!-- no translation found for open_by_default_settings_text (2526548548598185500) -->
- <skip />
- <!-- no translation found for open_by_default_dialog_subheader_text (1729599730664063881) -->
- <skip />
- <!-- no translation found for open_by_default_dialog_in_app_text (6978022419634199806) -->
- <skip />
- <!-- no translation found for open_by_default_dialog_in_browser_text (8042769465958497081) -->
- <skip />
- <!-- no translation found for open_by_default_dialog_dismiss_button_text (3487238795534582291) -->
- <skip />
+ <string name="open_by_default_settings_text" msgid="2526548548598185500">"Ouvrir les paramètres par défaut"</string>
+ <string name="open_by_default_dialog_subheader_text" msgid="1729599730664063881">"Choisissez comment ouvrir les liens Web pour cette appli"</string>
+ <string name="open_by_default_dialog_in_app_text" msgid="6978022419634199806">"Dans l\'appli"</string>
+ <string name="open_by_default_dialog_in_browser_text" msgid="8042769465958497081">"Dans votre navigateur"</string>
+ <string name="open_by_default_dialog_dismiss_button_text" msgid="3487238795534582291">"OK"</string>
</resources>
diff --git a/libs/WindowManager/Shell/res/values-fr/strings.xml b/libs/WindowManager/Shell/res/values-fr/strings.xml
index b2a6f16733b3..aee234565ad0 100644
--- a/libs/WindowManager/Shell/res/values-fr/strings.xml
+++ b/libs/WindowManager/Shell/res/values-fr/strings.xml
@@ -97,9 +97,9 @@
<string name="camera_compat_treatment_suggested_button_description" msgid="8103916969024076767">"Problèmes d\'appareil photo ?\nAppuyez pour réajuster"</string>
<string name="camera_compat_treatment_applied_button_description" msgid="2944157113330703897">"Problème non résolu ?\nAppuyez pour rétablir"</string>
<string name="camera_compat_dismiss_button_description" msgid="2795364433503817511">"Aucun problème d\'appareil photo ? Appuyez pour ignorer."</string>
- <string name="windowing_app_handle_education_tooltip" msgid="6398482412956375783">"Appuyer pour ouvrir le menu de l\'appli"</string>
- <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="6285279585554484957">"Appuyer pour afficher plusieurs applis simultanément"</string>
- <string name="windowing_desktop_mode_exit_education_tooltip" msgid="6685429075790085337">"Revenir en plein écran depuis le menu de l\'appli"</string>
+ <string name="windowing_app_handle_education_tooltip" msgid="2929643449849791854">"Le menu de l\'application se trouve ici"</string>
+ <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="2523468503353474095">"Passer à l\'affichage sur ordinateur pour ouvrir plusieurs applications simultanément"</string>
+ <string name="windowing_desktop_mode_exit_education_tooltip" msgid="5225660258192054132">"Revenir en plein écran à tout moment depuis le menu de l\'application"</string>
<string name="letterbox_education_dialog_title" msgid="7739895354143295358">"Voir et interagir plus"</string>
<string name="letterbox_education_split_screen_text" msgid="449233070804658627">"Faites glisser une autre appli pour utiliser l\'écran partagé"</string>
<string name="letterbox_education_reposition_text" msgid="4589957299813220661">"Appuyez deux fois en dehors d\'une appli pour la repositionner"</string>
@@ -136,14 +136,9 @@
<string name="desktop_mode_maximize_menu_maximize_button_text" msgid="3090199175564175845">"Agrandir"</string>
<string name="desktop_mode_maximize_menu_snap_left_button_text" msgid="8077452201179893424">"Ancrer à gauche"</string>
<string name="desktop_mode_maximize_menu_snap_right_button_text" msgid="7117751068945657304">"Ancrer à droite"</string>
- <!-- no translation found for open_by_default_settings_text (2526548548598185500) -->
- <skip />
- <!-- no translation found for open_by_default_dialog_subheader_text (1729599730664063881) -->
- <skip />
- <!-- no translation found for open_by_default_dialog_in_app_text (6978022419634199806) -->
- <skip />
- <!-- no translation found for open_by_default_dialog_in_browser_text (8042769465958497081) -->
- <skip />
- <!-- no translation found for open_by_default_dialog_dismiss_button_text (3487238795534582291) -->
- <skip />
+ <string name="open_by_default_settings_text" msgid="2526548548598185500">"Ouvrir les paramètres par défaut"</string>
+ <string name="open_by_default_dialog_subheader_text" msgid="1729599730664063881">"Choisir comment ouvrir les liens Web pour cette appli"</string>
+ <string name="open_by_default_dialog_in_app_text" msgid="6978022419634199806">"Dans l\'application"</string>
+ <string name="open_by_default_dialog_in_browser_text" msgid="8042769465958497081">"Dans votre navigateur"</string>
+ <string name="open_by_default_dialog_dismiss_button_text" msgid="3487238795534582291">"OK"</string>
</resources>
diff --git a/libs/WindowManager/Shell/res/values-gl/strings.xml b/libs/WindowManager/Shell/res/values-gl/strings.xml
index 0cc559f79dfa..b61588ac24ed 100644
--- a/libs/WindowManager/Shell/res/values-gl/strings.xml
+++ b/libs/WindowManager/Shell/res/values-gl/strings.xml
@@ -97,9 +97,9 @@
<string name="camera_compat_treatment_suggested_button_description" msgid="8103916969024076767">"Tes problemas coa cámara?\nToca para reaxustala"</string>
<string name="camera_compat_treatment_applied_button_description" msgid="2944157113330703897">"Non se solucionaron os problemas?\nToca para reverter o seu tratamento"</string>
<string name="camera_compat_dismiss_button_description" msgid="2795364433503817511">"Non hai problemas coa cámara? Tocar para ignorar."</string>
- <string name="windowing_app_handle_education_tooltip" msgid="6398482412956375783">"Toca para abrir o menú da aplicación"</string>
- <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="6285279585554484957">"Toca para mostrar varias aplicacións xuntas"</string>
- <string name="windowing_desktop_mode_exit_education_tooltip" msgid="6685429075790085337">"Volve á pantalla completa desde o menú da aplicación"</string>
+ <string name="windowing_app_handle_education_tooltip" msgid="2929643449849791854">"Aquí podes ver o menú da aplicación"</string>
+ <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="2523468503353474095">"Vai á vista para ordenadores se queres abrir varias aplicacións á vez"</string>
+ <string name="windowing_desktop_mode_exit_education_tooltip" msgid="5225660258192054132">"Volve á pantalla completa en calquera momento desde o menú da aplicación"</string>
<string name="letterbox_education_dialog_title" msgid="7739895354143295358">"Ver e facer máis"</string>
<string name="letterbox_education_split_screen_text" msgid="449233070804658627">"Arrastra outra aplicación para usar a pantalla dividida"</string>
<string name="letterbox_education_reposition_text" msgid="4589957299813220661">"Toca dúas veces fóra da aplicación para cambiala de posición"</string>
diff --git a/libs/WindowManager/Shell/res/values-gu/strings.xml b/libs/WindowManager/Shell/res/values-gu/strings.xml
index 460f8709ccc0..fd4f2baeb871 100644
--- a/libs/WindowManager/Shell/res/values-gu/strings.xml
+++ b/libs/WindowManager/Shell/res/values-gu/strings.xml
@@ -97,9 +97,9 @@
<string name="camera_compat_treatment_suggested_button_description" msgid="8103916969024076767">"કૅમેરામાં સમસ્યાઓ છે?\nફરીથી ફિટ કરવા માટે ટૅપ કરો"</string>
<string name="camera_compat_treatment_applied_button_description" msgid="2944157113330703897">"સુધારો નથી થયો?\nપહેલાંના પર પાછું ફેરવવા માટે ટૅપ કરો"</string>
<string name="camera_compat_dismiss_button_description" msgid="2795364433503817511">"કૅમેરામાં કોઈ સમસ્યા નથી? છોડી દેવા માટે ટૅપ કરો."</string>
- <string name="windowing_app_handle_education_tooltip" msgid="6398482412956375783">"ઍપ મેનૂ ખોલવા માટે ટૅપ કરો"</string>
- <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="6285279585554484957">"એકથી વધુ ઍપ એકસાથે બતાવવા માટે ટૅપ કરો"</string>
- <string name="windowing_desktop_mode_exit_education_tooltip" msgid="6685429075790085337">"ઍપ મેનૂમાંથી પૂર્ણસ્ક્રીન પર પાછા ફરો"</string>
+ <string name="windowing_app_handle_education_tooltip" msgid="2929643449849791854">"ઍપ મેનૂ અહીં જોવા મળી શકે છે"</string>
+ <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="2523468503353474095">"એકથી વધુ ઍપ એકસાથે ખોલવા માટે ડેસ્કટૉપ વ્યૂ દાખલ કરો"</string>
+ <string name="windowing_desktop_mode_exit_education_tooltip" msgid="5225660258192054132">"ઍપ મેનૂમાંથી કોઈપણ સમયે પૂર્ણ સ્ક્રીન પર પાછા ફરો"</string>
<string name="letterbox_education_dialog_title" msgid="7739895354143295358">"જુઓ અને બીજું ઘણું કરો"</string>
<string name="letterbox_education_split_screen_text" msgid="449233070804658627">"વિભાજિત સ્ક્રીન માટે કોઈ અન્ય ઍપમાં ખેંચો"</string>
<string name="letterbox_education_reposition_text" msgid="4589957299813220661">"કોઈ ઍપની જગ્યા બદલવા માટે, તેની બહાર બે વાર ટૅપ કરો"</string>
diff --git a/libs/WindowManager/Shell/res/values-hi/strings.xml b/libs/WindowManager/Shell/res/values-hi/strings.xml
index 17ceca187b39..d2cd23df8296 100644
--- a/libs/WindowManager/Shell/res/values-hi/strings.xml
+++ b/libs/WindowManager/Shell/res/values-hi/strings.xml
@@ -97,9 +97,9 @@
<string name="camera_compat_treatment_suggested_button_description" msgid="8103916969024076767">"क्या कैमरे से जुड़ी कोई समस्या है?\nफिर से फ़िट करने के लिए टैप करें"</string>
<string name="camera_compat_treatment_applied_button_description" msgid="2944157113330703897">"क्या समस्या ठीक नहीं हुई?\nपहले जैसा करने के लिए टैप करें"</string>
<string name="camera_compat_dismiss_button_description" msgid="2795364433503817511">"क्या कैमरे से जुड़ी कोई समस्या नहीं है? खारिज करने के लिए टैप करें."</string>
- <string name="windowing_app_handle_education_tooltip" msgid="6398482412956375783">"ऐप्लिकेशन मेन्यू खोलने के लिए टैप करें"</string>
- <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="6285279585554484957">"कई ऐप्लिकेशन एक साथ दिखाने के लिए टैप करें"</string>
- <string name="windowing_desktop_mode_exit_education_tooltip" msgid="6685429075790085337">"ऐप्लिकेशन मेन्यू से फ़ुलस्क्रीन मोड पर वापस जाएं"</string>
+ <string name="windowing_app_handle_education_tooltip" msgid="2929643449849791854">"ऐप्लिकेशन मेन्यू यहां पाया जा सकता है"</string>
+ <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="2523468503353474095">"एक साथ कई ऐप्लिकेशन खोलने के लिए, डेस्कटॉप व्यू में जाएं"</string>
+ <string name="windowing_desktop_mode_exit_education_tooltip" msgid="5225660258192054132">"ऐप्लिकेशन मेन्यू से फ़ुल स्क्रीन मोड पर किसी भी समय वापस जाएं"</string>
<string name="letterbox_education_dialog_title" msgid="7739895354143295358">"पूरी जानकारी लेकर, बेहतर तरीके से काम करें"</string>
<string name="letterbox_education_split_screen_text" msgid="449233070804658627">"स्प्लिट स्क्रीन का इस्तेमाल करने के लिए, किसी अन्य ऐप्लिकेशन को खींचें और छोड़ें"</string>
<string name="letterbox_education_reposition_text" msgid="4589957299813220661">"किसी ऐप्लिकेशन की जगह बदलने के लिए, उसके बाहर दो बार टैप करें"</string>
diff --git a/libs/WindowManager/Shell/res/values-hr/strings.xml b/libs/WindowManager/Shell/res/values-hr/strings.xml
index 20fa5468e296..80949b4c8edd 100644
--- a/libs/WindowManager/Shell/res/values-hr/strings.xml
+++ b/libs/WindowManager/Shell/res/values-hr/strings.xml
@@ -97,9 +97,9 @@
<string name="camera_compat_treatment_suggested_button_description" msgid="8103916969024076767">"Problemi s fotoaparatom?\nDodirnite za popravak"</string>
<string name="camera_compat_treatment_applied_button_description" msgid="2944157113330703897">"Problem nije riješen?\nDodirnite za vraćanje"</string>
<string name="camera_compat_dismiss_button_description" msgid="2795364433503817511">"Nemate problema s fotoaparatom? Dodirnite za odbacivanje."</string>
- <string name="windowing_app_handle_education_tooltip" msgid="6398482412956375783">"Dodirnite za otvaranje izbornika aplikacije"</string>
- <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="6285279585554484957">"Dodirnite za prikaz više aplikacija zajedno"</string>
- <string name="windowing_desktop_mode_exit_education_tooltip" msgid="6685429075790085337">"Vratite se na cijeli zaslon iz izbornika aplikacije"</string>
+ <string name="windowing_app_handle_education_tooltip" msgid="2929643449849791854">"Izbornik aplikacije možete pronaći ovdje"</string>
+ <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="2523468503353474095">"Otvorite prikaz na računalu da biste otvorili više aplikacija zajedno"</string>
+ <string name="windowing_desktop_mode_exit_education_tooltip" msgid="5225660258192054132">"Vratite se na cijeli zaslon bilo kad iz izbornika aplikacije"</string>
<string name="letterbox_education_dialog_title" msgid="7739895354143295358">"Gledajte i učinite više"</string>
<string name="letterbox_education_split_screen_text" msgid="449233070804658627">"Povucite drugu aplikaciju unutra da biste podijelili zaslon"</string>
<string name="letterbox_education_reposition_text" msgid="4589957299813220661">"Dvaput dodirnite izvan aplikacije da biste je premjestili"</string>
diff --git a/libs/WindowManager/Shell/res/values-hu/strings.xml b/libs/WindowManager/Shell/res/values-hu/strings.xml
index 78cec15cc44a..cebf5857db34 100644
--- a/libs/WindowManager/Shell/res/values-hu/strings.xml
+++ b/libs/WindowManager/Shell/res/values-hu/strings.xml
@@ -97,9 +97,9 @@
<string name="camera_compat_treatment_suggested_button_description" msgid="8103916969024076767">"Kamerával kapcsolatos problémába ütközött?\nKoppintson a megoldáshoz."</string>
<string name="camera_compat_treatment_applied_button_description" msgid="2944157113330703897">"Nem sikerült a hiba kijavítása?\nKoppintson a visszaállításhoz."</string>
<string name="camera_compat_dismiss_button_description" msgid="2795364433503817511">"Nincsenek problémái kamerával? Koppintson az elvetéshez."</string>
- <string name="windowing_app_handle_education_tooltip" msgid="6398482412956375783">"Koppintson az alkalmazásmenü megnyitásához"</string>
- <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="6285279585554484957">"Koppintson több alkalmazás együttes megjelenítéséhez"</string>
- <string name="windowing_desktop_mode_exit_education_tooltip" msgid="6685429075790085337">"A teljes képernyőre az alkalmazásmenüben térhet vissza"</string>
+ <string name="windowing_app_handle_education_tooltip" msgid="2929643449849791854">"Az alkalmazásmenü itt található"</string>
+ <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="2523468503353474095">"Asztali nézetbe lépve több alkalmazást nyithat meg egyidejűleg"</string>
+ <string name="windowing_desktop_mode_exit_education_tooltip" msgid="5225660258192054132">"Az alkalmazásmenüből bármikor visszatérhet a teljes képernyőre"</string>
<string name="letterbox_education_dialog_title" msgid="7739895354143295358">"Több mindent láthat és tehet"</string>
<string name="letterbox_education_split_screen_text" msgid="449233070804658627">"Húzzon ide egy másik alkalmazást az osztott képernyő használatához"</string>
<string name="letterbox_education_reposition_text" msgid="4589957299813220661">"Koppintson duplán az alkalmazáson kívül az áthelyezéséhez"</string>
diff --git a/libs/WindowManager/Shell/res/values-hy/strings.xml b/libs/WindowManager/Shell/res/values-hy/strings.xml
index 1461322da16e..63a9d6d92134 100644
--- a/libs/WindowManager/Shell/res/values-hy/strings.xml
+++ b/libs/WindowManager/Shell/res/values-hy/strings.xml
@@ -97,9 +97,9 @@
<string name="camera_compat_treatment_suggested_button_description" msgid="8103916969024076767">"Տեսախցիկի հետ կապված խնդիրնե՞ր կան։\nՀպեք՝ վերակարգավորելու համար։"</string>
<string name="camera_compat_treatment_applied_button_description" msgid="2944157113330703897">"Չհաջողվե՞ց շտկել։\nՀպեք՝ փոփոխությունները չեղարկելու համար։"</string>
<string name="camera_compat_dismiss_button_description" msgid="2795364433503817511">"Տեսախցիկի հետ կապված խնդիրներ չկա՞ն։ Փակելու համար հպեք։"</string>
- <string name="windowing_app_handle_education_tooltip" msgid="6398482412956375783">"Հպեք՝ հավելվածի ընտրացանկը բացելու համար"</string>
- <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="6285279585554484957">"Հպեք՝ էկրանին մի քանի հավելված միասին դիտելու համար"</string>
- <string name="windowing_desktop_mode_exit_education_tooltip" msgid="6685429075790085337">"Հավելվածի ընտրացանկից վերադառնալ լիաէկրան ռեժիմ"</string>
+ <string name="windowing_app_handle_education_tooltip" msgid="2929643449849791854">"Հավելվածի ընտրացանկն այստեղ է"</string>
+ <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="2523468503353474095">"Անցեք համակարգչային տարբերակին՝ միաժամանակ մի քանի հավելված բացելու համար"</string>
+ <string name="windowing_desktop_mode_exit_education_tooltip" msgid="5225660258192054132">"Ցանկացած ժամանակ հավելվածի ընտրացանկից վերադարձեք լիաէկրան ռեժիմ"</string>
<string name="letterbox_education_dialog_title" msgid="7739895354143295358">"Միաժամանակ կատարեք մի քանի առաջադրանք"</string>
<string name="letterbox_education_split_screen_text" msgid="449233070804658627">"Քաշեք մյուս հավելվածի մեջ՝ էկրանի տրոհումն օգտագործելու համար"</string>
<string name="letterbox_education_reposition_text" msgid="4589957299813220661">"Կրկնակի հպեք հավելվածի կողքին՝ այն տեղափոխելու համար"</string>
diff --git a/libs/WindowManager/Shell/res/values-in/strings.xml b/libs/WindowManager/Shell/res/values-in/strings.xml
index 23626e49b8db..a06d01cc524a 100644
--- a/libs/WindowManager/Shell/res/values-in/strings.xml
+++ b/libs/WindowManager/Shell/res/values-in/strings.xml
@@ -97,9 +97,9 @@
<string name="camera_compat_treatment_suggested_button_description" msgid="8103916969024076767">"Masalah kamera?\nKetuk untuk memperbaiki"</string>
<string name="camera_compat_treatment_applied_button_description" msgid="2944157113330703897">"Tidak dapat diperbaiki?\nKetuk untuk mengembalikan"</string>
<string name="camera_compat_dismiss_button_description" msgid="2795364433503817511">"Tidak ada masalah kamera? Ketuk untuk menutup."</string>
- <string name="windowing_app_handle_education_tooltip" msgid="6398482412956375783">"Ketuk untuk membuka menu aplikasi"</string>
- <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="6285279585554484957">"Ketuk untuk menampilkan beberapa aplikasi secara bersamaan"</string>
- <string name="windowing_desktop_mode_exit_education_tooltip" msgid="6685429075790085337">"Kembali ke layar penuh dari menu aplikasi"</string>
+ <string name="windowing_app_handle_education_tooltip" msgid="2929643449849791854">"Menu aplikasi dapat ditemukan di sini"</string>
+ <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="2523468503353474095">"Buka tampilan desktop untuk membuka beberapa aplikasi secara bersamaan"</string>
+ <string name="windowing_desktop_mode_exit_education_tooltip" msgid="5225660258192054132">"Kembali ke layar penuh kapan saja dari menu aplikasi"</string>
<string name="letterbox_education_dialog_title" msgid="7739895354143295358">"Lihat dan lakukan lebih banyak hal"</string>
<string name="letterbox_education_split_screen_text" msgid="449233070804658627">"Tarik aplikasi lain untuk menggunakan layar terpisah"</string>
<string name="letterbox_education_reposition_text" msgid="4589957299813220661">"Ketuk dua kali di luar aplikasi untuk mengubah posisinya"</string>
diff --git a/libs/WindowManager/Shell/res/values-is/strings.xml b/libs/WindowManager/Shell/res/values-is/strings.xml
index 6ae4c7c60bc7..a20f4604ff90 100644
--- a/libs/WindowManager/Shell/res/values-is/strings.xml
+++ b/libs/WindowManager/Shell/res/values-is/strings.xml
@@ -97,9 +97,9 @@
<string name="camera_compat_treatment_suggested_button_description" msgid="8103916969024076767">"Myndavélavesen?\nÝttu til að breyta stærð"</string>
<string name="camera_compat_treatment_applied_button_description" msgid="2944157113330703897">"Ennþá vesen?\nÝttu til að afturkalla"</string>
<string name="camera_compat_dismiss_button_description" msgid="2795364433503817511">"Ekkert myndavélavesen? Ýttu til að hunsa."</string>
- <string name="windowing_app_handle_education_tooltip" msgid="6398482412956375783">"Ýttu til að opna forritavalmyndina"</string>
- <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="6285279585554484957">"Ýttu til að sjá mörg forrit saman"</string>
- <string name="windowing_desktop_mode_exit_education_tooltip" msgid="6685429075790085337">"Opnaðu allan skjáinn aftur á forritavalmyndinni"</string>
+ <string name="windowing_app_handle_education_tooltip" msgid="2929643449849791854">"Hér finnurðu forritavalmyndina"</string>
+ <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="2523468503353474095">"Veldu tölvuútgáfu til að opna mörg forrit samtímis"</string>
+ <string name="windowing_desktop_mode_exit_education_tooltip" msgid="5225660258192054132">"Þú getur skipt aftur í allan skjáinn hvenær sem er af forritavalmyndinni"</string>
<string name="letterbox_education_dialog_title" msgid="7739895354143295358">"Sjáðu og gerðu meira"</string>
<string name="letterbox_education_split_screen_text" msgid="449233070804658627">"Dragðu annað forrit inn til að nota skjáskiptingu"</string>
<string name="letterbox_education_reposition_text" msgid="4589957299813220661">"Ýttu tvisvar utan við forrit til að færa það"</string>
diff --git a/libs/WindowManager/Shell/res/values-it/strings.xml b/libs/WindowManager/Shell/res/values-it/strings.xml
index b56424594f29..39fd6ba326a6 100644
--- a/libs/WindowManager/Shell/res/values-it/strings.xml
+++ b/libs/WindowManager/Shell/res/values-it/strings.xml
@@ -97,9 +97,9 @@
<string name="camera_compat_treatment_suggested_button_description" msgid="8103916969024076767">"Problemi con la fotocamera?\nTocca per risolverli"</string>
<string name="camera_compat_treatment_applied_button_description" msgid="2944157113330703897">"Il problema non si è risolto?\nTocca per ripristinare"</string>
<string name="camera_compat_dismiss_button_description" msgid="2795364433503817511">"Nessun problema con la fotocamera? Tocca per ignorare."</string>
- <string name="windowing_app_handle_education_tooltip" msgid="6398482412956375783">"Tocca per aprire il menu dell\'app"</string>
- <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="6285279585554484957">"Tocca per mostrare più app insieme"</string>
- <string name="windowing_desktop_mode_exit_education_tooltip" msgid="6685429075790085337">"Torna allo schermo intero dal menu dell\'app"</string>
+ <string name="windowing_app_handle_education_tooltip" msgid="2929643449849791854">"Il menu dell\'app si trova qui"</string>
+ <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="2523468503353474095">"Entra nella visualizzazione desktop per aprire più app contemporaneamente"</string>
+ <string name="windowing_desktop_mode_exit_education_tooltip" msgid="5225660258192054132">"Torna allo schermo intero in qualsiasi momento dal menu dell\'app"</string>
<string name="letterbox_education_dialog_title" msgid="7739895354143295358">"Visualizza più contenuti e fai di più"</string>
<string name="letterbox_education_split_screen_text" msgid="449233070804658627">"Trascina in un\'altra app per usare lo schermo diviso"</string>
<string name="letterbox_education_reposition_text" msgid="4589957299813220661">"Tocca due volte fuori da un\'app per riposizionarla"</string>
@@ -136,14 +136,9 @@
<string name="desktop_mode_maximize_menu_maximize_button_text" msgid="3090199175564175845">"Ingrandisci"</string>
<string name="desktop_mode_maximize_menu_snap_left_button_text" msgid="8077452201179893424">"Aggancia a sinistra"</string>
<string name="desktop_mode_maximize_menu_snap_right_button_text" msgid="7117751068945657304">"Aggancia a destra"</string>
- <!-- no translation found for open_by_default_settings_text (2526548548598185500) -->
- <skip />
- <!-- no translation found for open_by_default_dialog_subheader_text (1729599730664063881) -->
- <skip />
- <!-- no translation found for open_by_default_dialog_in_app_text (6978022419634199806) -->
- <skip />
- <!-- no translation found for open_by_default_dialog_in_browser_text (8042769465958497081) -->
- <skip />
- <!-- no translation found for open_by_default_dialog_dismiss_button_text (3487238795534582291) -->
- <skip />
+ <string name="open_by_default_settings_text" msgid="2526548548598185500">"Apri in base alle impostazioni predefinite"</string>
+ <string name="open_by_default_dialog_subheader_text" msgid="1729599730664063881">"Scegli come aprire i link web per questa app"</string>
+ <string name="open_by_default_dialog_in_app_text" msgid="6978022419634199806">"All\'interno dell\'app"</string>
+ <string name="open_by_default_dialog_in_browser_text" msgid="8042769465958497081">"Nel browser"</string>
+ <string name="open_by_default_dialog_dismiss_button_text" msgid="3487238795534582291">"Ok"</string>
</resources>
diff --git a/libs/WindowManager/Shell/res/values-iw/strings.xml b/libs/WindowManager/Shell/res/values-iw/strings.xml
index 41765e3c56d5..0586d1f8cd16 100644
--- a/libs/WindowManager/Shell/res/values-iw/strings.xml
+++ b/libs/WindowManager/Shell/res/values-iw/strings.xml
@@ -97,9 +97,9 @@
<string name="camera_compat_treatment_suggested_button_description" msgid="8103916969024076767">"בעיות במצלמה?\nאפשר להקיש כדי לבצע התאמה מחדש"</string>
<string name="camera_compat_treatment_applied_button_description" msgid="2944157113330703897">"הבעיה לא נפתרה?\nאפשר להקיש כדי לחזור לגרסה הקודמת"</string>
<string name="camera_compat_dismiss_button_description" msgid="2795364433503817511">"אין בעיות במצלמה? אפשר להקיש כדי לסגור."</string>
- <string name="windowing_app_handle_education_tooltip" msgid="6398482412956375783">"צריך להקיש כדי לפתוח את תפריט האפליקציה"</string>
- <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="6285279585554484957">"אפשר להקיש כדי להציג כמה אפליקציות יחד"</string>
- <string name="windowing_desktop_mode_exit_education_tooltip" msgid="6685429075790085337">"חזרה למסך מלא מתפריט האפליקציה"</string>
+ <string name="windowing_app_handle_education_tooltip" msgid="2929643449849791854">"תפריט האפליקציה נמצא כאן"</string>
+ <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="2523468503353474095">"כדי לפתוח כמה אפליקציות יחד, צריך לעבור למצב תצוגה למחשב"</string>
+ <string name="windowing_desktop_mode_exit_education_tooltip" msgid="5225660258192054132">"אפשר לחזור למסך מלא בכל שלב מתפריט האפליקציה"</string>
<string name="letterbox_education_dialog_title" msgid="7739895354143295358">"רוצה לראות ולעשות יותר?"</string>
<string name="letterbox_education_split_screen_text" msgid="449233070804658627">"צריך לגרור אפליקציה אחרת כדי להשתמש במסך המפוצל"</string>
<string name="letterbox_education_reposition_text" msgid="4589957299813220661">"צריך להקיש הקשה כפולה מחוץ לאפליקציה כדי למקם אותה מחדש"</string>
diff --git a/libs/WindowManager/Shell/res/values-ja/strings.xml b/libs/WindowManager/Shell/res/values-ja/strings.xml
index c7dfd457950a..8aa8269af8a5 100644
--- a/libs/WindowManager/Shell/res/values-ja/strings.xml
+++ b/libs/WindowManager/Shell/res/values-ja/strings.xml
@@ -97,9 +97,9 @@
<string name="camera_compat_treatment_suggested_button_description" msgid="8103916969024076767">"カメラに関する問題の場合は、\nタップすると修正できます"</string>
<string name="camera_compat_treatment_applied_button_description" msgid="2944157113330703897">"修正されなかった場合は、\nタップすると元に戻ります"</string>
<string name="camera_compat_dismiss_button_description" msgid="2795364433503817511">"カメラに関する問題でない場合は、タップすると閉じます。"</string>
- <string name="windowing_app_handle_education_tooltip" msgid="6398482412956375783">"タップするとアプリメニューが開きます"</string>
- <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="6285279585554484957">"タップすると複数のアプリが同時に表示されます"</string>
- <string name="windowing_desktop_mode_exit_education_tooltip" msgid="6685429075790085337">"アプリメニューから全画面表示に戻ります"</string>
+ <string name="windowing_app_handle_education_tooltip" msgid="2929643449849791854">"アプリメニューはここにあります"</string>
+ <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="2523468503353474095">"デスクトップ ビューに切り替えて複数のアプリを同時に開けます"</string>
+ <string name="windowing_desktop_mode_exit_education_tooltip" msgid="5225660258192054132">"アプリメニューからいつでも全画面表示に戻れます"</string>
<string name="letterbox_education_dialog_title" msgid="7739895354143295358">"表示を拡大して機能を強化"</string>
<string name="letterbox_education_split_screen_text" msgid="449233070804658627">"分割画面にするにはもう 1 つのアプリをドラッグしてください"</string>
<string name="letterbox_education_reposition_text" msgid="4589957299813220661">"位置を変えるにはアプリの外側をダブルタップしてください"</string>
diff --git a/libs/WindowManager/Shell/res/values-ka/strings.xml b/libs/WindowManager/Shell/res/values-ka/strings.xml
index 4986c2d63761..6672599d2763 100644
--- a/libs/WindowManager/Shell/res/values-ka/strings.xml
+++ b/libs/WindowManager/Shell/res/values-ka/strings.xml
@@ -97,9 +97,9 @@
<string name="camera_compat_treatment_suggested_button_description" msgid="8103916969024076767">"კამერად პრობლემები აქვს?\nშეეხეთ გამოსასწორებლად"</string>
<string name="camera_compat_treatment_applied_button_description" msgid="2944157113330703897">"არ გამოსწორდა?\nშეეხეთ წინა ვერსიის დასაბრუნებლად"</string>
<string name="camera_compat_dismiss_button_description" msgid="2795364433503817511">"კამერას პრობლემები არ აქვს? შეეხეთ უარყოფისთვის."</string>
- <string name="windowing_app_handle_education_tooltip" msgid="6398482412956375783">"შეეხეთ აპის მენიუს გასახსნელად"</string>
- <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="6285279585554484957">"შეეხეთ რამდენიმე აპის ერთად საჩვენებლად"</string>
- <string name="windowing_desktop_mode_exit_education_tooltip" msgid="6685429075790085337">"სრულეკრანიან რეჟიმზე დაბრუნდით აპის მენიუდან"</string>
+ <string name="windowing_app_handle_education_tooltip" msgid="2929643449849791854">"აპის მენიუ შეგიძლიათ იხილოთ აქ"</string>
+ <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="2523468503353474095">"რამდენიმე აპის ერთდროულად გასახსნელად შედით დესკტოპის ხედში"</string>
+ <string name="windowing_desktop_mode_exit_education_tooltip" msgid="5225660258192054132">"სრულ ეკრანზე ნებისმიერ დროს შეგიძლიათ დაბრუნდეთ აპის მენიუდან"</string>
<string name="letterbox_education_dialog_title" msgid="7739895354143295358">"მეტის ნახვა და გაკეთება"</string>
<string name="letterbox_education_split_screen_text" msgid="449233070804658627">"ეკრანის გასაყოფად ჩავლებით გადაიტანეთ სხვა აპში"</string>
<string name="letterbox_education_reposition_text" msgid="4589957299813220661">"ორმაგად შეეხეთ აპის გარშემო სივრცეს, რათა ის სხვაგან გადაიტანოთ"</string>
diff --git a/libs/WindowManager/Shell/res/values-kk/strings.xml b/libs/WindowManager/Shell/res/values-kk/strings.xml
index 7c49ae5abf4e..56ae4416192a 100644
--- a/libs/WindowManager/Shell/res/values-kk/strings.xml
+++ b/libs/WindowManager/Shell/res/values-kk/strings.xml
@@ -97,9 +97,9 @@
<string name="camera_compat_treatment_suggested_button_description" msgid="8103916969024076767">"Камерада қателер шықты ма?\nЖөндеу үшін түртіңіз."</string>
<string name="camera_compat_treatment_applied_button_description" msgid="2944157113330703897">"Жөнделмеді ме?\nҚайтару үшін түртіңіз."</string>
<string name="camera_compat_dismiss_button_description" msgid="2795364433503817511">"Камерада қателер шықпады ма? Жабу үшін түртіңіз."</string>
- <string name="windowing_app_handle_education_tooltip" msgid="6398482412956375783">"Қолданба мәзірін ашу үшін түртіңіз"</string>
- <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="6285279585554484957">"Бірнеше қолданбаны қатар көрсету үшін түртіңіз"</string>
- <string name="windowing_desktop_mode_exit_education_tooltip" msgid="6685429075790085337">"Қолданба мәзірінен толық экран режиміне қайту"</string>
+ <string name="windowing_app_handle_education_tooltip" msgid="2929643449849791854">"Қолданба мәзірін осы жерден табуға болады."</string>
+ <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="2523468503353474095">"Бірнеше қолданбаны бірге ашу үшін компьютерлік нұсқаны қосыңыз."</string>
+ <string name="windowing_desktop_mode_exit_education_tooltip" msgid="5225660258192054132">"Қолданба мәзірінен кез келген уақытта толық экранға оралыңыз."</string>
<string name="letterbox_education_dialog_title" msgid="7739895354143295358">"Қосымша ақпаратты қарап, әрекеттер жасау"</string>
<string name="letterbox_education_split_screen_text" msgid="449233070804658627">"Экранды бөлу үшін басқа қолданбаға өтіңіз."</string>
<string name="letterbox_education_reposition_text" msgid="4589957299813220661">"Қолданбаның орнын өзгерту үшін одан тыс жерді екі рет түртіңіз."</string>
diff --git a/libs/WindowManager/Shell/res/values-km/strings.xml b/libs/WindowManager/Shell/res/values-km/strings.xml
index c6af12528d93..460b8678c2c9 100644
--- a/libs/WindowManager/Shell/res/values-km/strings.xml
+++ b/libs/WindowManager/Shell/res/values-km/strings.xml
@@ -97,9 +97,9 @@
<string name="camera_compat_treatment_suggested_button_description" msgid="8103916969024076767">"មានបញ្ហា​ពាក់ព័ន្ធនឹង​កាមេរ៉ាឬ?\nចុចដើម្បី​ដោះស្រាយ"</string>
<string name="camera_compat_treatment_applied_button_description" msgid="2944157113330703897">"មិនបាន​ដោះស្រាយ​បញ្ហានេះទេឬ?\nចុចដើម្បី​ត្រឡប់"</string>
<string name="camera_compat_dismiss_button_description" msgid="2795364433503817511">"មិនមាន​បញ្ហាពាក់ព័ន្ធនឹង​កាមេរ៉ាទេឬ? ចុចដើម្បី​ច្រានចោល។"</string>
- <string name="windowing_app_handle_education_tooltip" msgid="6398482412956375783">"ចុច​ដើម្បីបើក​ម៉ឺនុយ​កម្មវិធី"</string>
- <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="6285279585554484957">"ចុច​ដើម្បីបង្ហាញ​កម្មវិធី​ច្រើនរួមគ្នា"</string>
- <string name="windowing_desktop_mode_exit_education_tooltip" msgid="6685429075790085337">"ត្រឡប់ទៅ​អេក្រង់​ពេញវិញ​ពីម៉ឺនុយ​កម្មវិធី"</string>
+ <string name="windowing_app_handle_education_tooltip" msgid="2929643449849791854">"អាចរកឃើញម៉ឺនុយកម្មវិធីនៅទីនេះ"</string>
+ <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="2523468503353474095">"ចូលទិដ្ឋភាព​លើកុំព្យូទ័រ ដើម្បីបើកកម្មវិធីច្រើនជាមួយគ្នា"</string>
+ <string name="windowing_desktop_mode_exit_education_tooltip" msgid="5225660258192054132">"ត្រឡប់ទៅអេក្រង់ពេញវិញនៅពេលណាក៏បានពីម៉ឺនុយកម្មវិធី"</string>
<string name="letterbox_education_dialog_title" msgid="7739895354143295358">"មើលឃើញ និងធ្វើបានកាន់តែច្រើន"</string>
<string name="letterbox_education_split_screen_text" msgid="449233070804658627">"អូស​កម្មវិធី​មួយ​ទៀត​ចូល ដើម្បី​ប្រើ​មុខងារ​បំបែកអេក្រង់"</string>
<string name="letterbox_education_reposition_text" msgid="4589957299813220661">"ចុចពីរដង​នៅ​ក្រៅ​កម្មវិធី ដើម្បី​ប្ដូរ​ទីតាំង​កម្មវិធី​នោះ"</string>
diff --git a/libs/WindowManager/Shell/res/values-kn/strings.xml b/libs/WindowManager/Shell/res/values-kn/strings.xml
index 498ad0f04a5e..2e2be46c21f6 100644
--- a/libs/WindowManager/Shell/res/values-kn/strings.xml
+++ b/libs/WindowManager/Shell/res/values-kn/strings.xml
@@ -97,9 +97,9 @@
<string name="camera_compat_treatment_suggested_button_description" msgid="8103916969024076767">"ಕ್ಯಾಮರಾ ಸಮಸ್ಯೆಗಳಿವೆಯೇ?\nಮರುಹೊಂದಿಸಲು ಟ್ಯಾಪ್ ಮಾಡಿ"</string>
<string name="camera_compat_treatment_applied_button_description" msgid="2944157113330703897">"ಅದನ್ನು ಸರಿಪಡಿಸಲಿಲ್ಲವೇ?\nಹಿಂತಿರುಗಿಸಲು ಟ್ಯಾಪ್ ಮಾಡಿ"</string>
<string name="camera_compat_dismiss_button_description" msgid="2795364433503817511">"ಕ್ಯಾಮರಾ ಸಮಸ್ಯೆಗಳಿಲ್ಲವೇ? ವಜಾಗೊಳಿಸಲು ಟ್ಯಾಪ್ ಮಾಡಿ."</string>
- <string name="windowing_app_handle_education_tooltip" msgid="6398482412956375783">"ಆ್ಯಪ್‌ ಮೆನುವನ್ನು ತೆರೆಯಲು ಟ್ಯಾಪ್‌ ಮಾಡಿ"</string>
- <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="6285279585554484957">"ಅನೇಕ ಆ್ಯಪ್‌ಗಳನ್ನು ಒಟ್ಟಿಗೆ ತೋರಿಸಲು ಟ್ಯಾಪ್‌ ಮಾಡಿ"</string>
- <string name="windowing_desktop_mode_exit_education_tooltip" msgid="6685429075790085337">"ಆ್ಯಪ್‌ ಮೆನುವಿನಿಂದ ಫುಲ್‌ಸ್ಕ್ರೀನ್‌ಗೆ ಹಿಂತಿರುಗಿ"</string>
+ <string name="windowing_app_handle_education_tooltip" msgid="2929643449849791854">"ಆ್ಯಪ್ ಮೆನುವನ್ನು ಇಲ್ಲಿ ಕಾಣಬಹುದು"</string>
+ <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="2523468503353474095">"ಹಲವು ಆ್ಯಪ್‌ಗಳನ್ನು ಒಟ್ಟಿಗೆ ತೆರೆಯಲು ಡೆಸ್ಕ್‌ಟಾಪ್ ವೀಕ್ಷಣೆಯನ್ನು ನಮೂದಿಸಿ"</string>
+ <string name="windowing_desktop_mode_exit_education_tooltip" msgid="5225660258192054132">"ಆ್ಯಪ್ ಮೆನುವಿನಿಂದ ಯಾವಾಗ ಬೇಕಾದರೂ ಫುಲ್‌ಸ್ಕ್ರೀನ್‌ಗೆ ಹಿಂತಿರುಗಿ"</string>
<string name="letterbox_education_dialog_title" msgid="7739895354143295358">"ನೋಡಿ ಮತ್ತು ಹೆಚ್ಚಿನದನ್ನು ಮಾಡಿ"</string>
<string name="letterbox_education_split_screen_text" msgid="449233070804658627">"ಸ್ಪ್ಲಿಟ್‌ ಸ್ಕ್ರೀನ್‌ಗಾಗಿ ಮತ್ತೊಂದು ಆ್ಯಪ್‌ನಲ್ಲಿ ಡ್ರ್ಯಾಗ್ ಮಾಡಿ"</string>
<string name="letterbox_education_reposition_text" msgid="4589957299813220661">"ಆ್ಯಪ್ ಒಂದರ ಸ್ಥಾನವನ್ನು ಬದಲಾಯಿಸಲು ಅದರ ಹೊರಗೆ ಡಬಲ್-ಟ್ಯಾಪ್ ಮಾಡಿ"</string>
diff --git a/libs/WindowManager/Shell/res/values-ko/strings.xml b/libs/WindowManager/Shell/res/values-ko/strings.xml
index a92d3cb21b76..4bcc76dd0259 100644
--- a/libs/WindowManager/Shell/res/values-ko/strings.xml
+++ b/libs/WindowManager/Shell/res/values-ko/strings.xml
@@ -97,9 +97,9 @@
<string name="camera_compat_treatment_suggested_button_description" msgid="8103916969024076767">"카메라 문제가 있나요?\n해결하려면 탭하세요."</string>
<string name="camera_compat_treatment_applied_button_description" msgid="2944157113330703897">"해결되지 않았나요?\n되돌리려면 탭하세요."</string>
<string name="camera_compat_dismiss_button_description" msgid="2795364433503817511">"카메라에 문제가 없나요? 닫으려면 탭하세요."</string>
- <string name="windowing_app_handle_education_tooltip" msgid="6398482412956375783">"탭하여 앱 메뉴 열기"</string>
- <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="6285279585554484957">"탭하여 여러 앱을 함께 표시하기"</string>
- <string name="windowing_desktop_mode_exit_education_tooltip" msgid="6685429075790085337">"앱 메뉴에서 전체 화면으로 돌아가기"</string>
+ <string name="windowing_app_handle_education_tooltip" msgid="2929643449849791854">"앱 메뉴는 여기에서 찾을 수 있습니다."</string>
+ <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="2523468503353474095">"데스크톱 뷰를 실행하여 여러 앱을 함께 열 수 있습니다."</string>
+ <string name="windowing_desktop_mode_exit_education_tooltip" msgid="5225660258192054132">"언제든지 앱 메뉴에서 전체 화면으로 돌아갈 수 있습니다."</string>
<string name="letterbox_education_dialog_title" msgid="7739895354143295358">"더 많은 정보를 보고 더 많은 작업을 처리하세요"</string>
<string name="letterbox_education_split_screen_text" msgid="449233070804658627">"화면 분할을 사용하려면 다른 앱을 드래그해 가져옵니다."</string>
<string name="letterbox_education_reposition_text" msgid="4589957299813220661">"앱 위치를 조정하려면 앱 외부를 두 번 탭합니다."</string>
diff --git a/libs/WindowManager/Shell/res/values-ky/strings.xml b/libs/WindowManager/Shell/res/values-ky/strings.xml
index b01659d95407..6ae51a4ab770 100644
--- a/libs/WindowManager/Shell/res/values-ky/strings.xml
+++ b/libs/WindowManager/Shell/res/values-ky/strings.xml
@@ -97,9 +97,9 @@
<string name="camera_compat_treatment_suggested_button_description" msgid="8103916969024076767">"Камерада маселелер келип чыктыбы?\nОңдоо үчүн таптаңыз"</string>
<string name="camera_compat_treatment_applied_button_description" msgid="2944157113330703897">"Оңдолгон жокпу?\nАртка кайтаруу үчүн таптаңыз"</string>
<string name="camera_compat_dismiss_button_description" msgid="2795364433503817511">"Камерада маселе жокпу? Этибарга албоо үчүн таптаңыз."</string>
- <string name="windowing_app_handle_education_tooltip" msgid="6398482412956375783">"Колдонмонун менюсун ачуу үчүн таптап коюңуз"</string>
- <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="6285279585554484957">"Бир нече колдонмону чогуу көрүү үчүн таптап коюңуз"</string>
- <string name="windowing_desktop_mode_exit_education_tooltip" msgid="6685429075790085337">"Колдонмонун менюсунан толук экранга кайтыңыз"</string>
+ <string name="windowing_app_handle_education_tooltip" msgid="2929643449849791854">"Колдонмонун менюсун ушул жерден таба аласыз"</string>
+ <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="2523468503353474095">"Бир убакта бир нече колдонмону ачуу үчүн компьютердик версияга өтүңүз"</string>
+ <string name="windowing_desktop_mode_exit_education_tooltip" msgid="5225660258192054132">"Каалаган убакта колдонмонун менюсунан толук экранга кайта аласыз"</string>
<string name="letterbox_education_dialog_title" msgid="7739895354143295358">"Көрүп, көбүрөөк нерселерди жасаңыз"</string>
<string name="letterbox_education_split_screen_text" msgid="449233070804658627">"Экранды бөлүү үчүн башка колдонмону сүйрөңүз"</string>
<string name="letterbox_education_reposition_text" msgid="4589957299813220661">"Колдонмону жылдыруу үчүн сырт жагын эки жолу таптаңыз"</string>
diff --git a/libs/WindowManager/Shell/res/values-lo/strings.xml b/libs/WindowManager/Shell/res/values-lo/strings.xml
index f3e7169e1431..f8a09da308b9 100644
--- a/libs/WindowManager/Shell/res/values-lo/strings.xml
+++ b/libs/WindowManager/Shell/res/values-lo/strings.xml
@@ -97,9 +97,9 @@
<string name="camera_compat_treatment_suggested_button_description" msgid="8103916969024076767">"ມີບັນຫາກ້ອງຖ່າຍຮູບບໍ?\nແຕະເພື່ອປັບໃໝ່"</string>
<string name="camera_compat_treatment_applied_button_description" msgid="2944157113330703897">"ບໍ່ໄດ້ແກ້ໄຂມັນບໍ?\nແຕະເພື່ອແປງກັບຄືນ"</string>
<string name="camera_compat_dismiss_button_description" msgid="2795364433503817511">"ບໍ່ມີບັນຫາກ້ອງຖ່າຍຮູບບໍ? ແຕະເພື່ອ​ປິດ​ໄວ້."</string>
- <string name="windowing_app_handle_education_tooltip" msgid="6398482412956375783">"ແຕະເພື່ອເປີດເມນູແອັບ"</string>
- <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="6285279585554484957">"ແຕະເພື່ອສະແດງແອັບຫຼາຍລາຍການພ້ອມກັນ"</string>
- <string name="windowing_desktop_mode_exit_education_tooltip" msgid="6685429075790085337">"ກັບຄືນໄປຫາໂໝດເຕັມຈໍຈາກເມນູແອັບ"</string>
+ <string name="windowing_app_handle_education_tooltip" msgid="2929643449849791854">"ສາມາດເບິ່ງເມນູແອັບໄດ້ບ່ອນນີ້"</string>
+ <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="2523468503353474095">"ເຂົ້າສູ່ມຸມມອງເດັສທັອບເພື່ອເປີດຫຼາຍແອັບພ້ອມກັນ"</string>
+ <string name="windowing_desktop_mode_exit_education_tooltip" msgid="5225660258192054132">"ກັບຄືນໄປຫາໂໝດເຕັມຈໍໄດ້ທຸກເວລາຈາກເມນູແອັບ"</string>
<string name="letterbox_education_dialog_title" msgid="7739895354143295358">"ເບິ່ງ ແລະ ເຮັດຫຼາຍຂຶ້ນ"</string>
<string name="letterbox_education_split_screen_text" msgid="449233070804658627">"ລາກໄປໄວ້ໃນແອັບອື່ນເພື່ອແບ່ງໜ້າຈໍ"</string>
<string name="letterbox_education_reposition_text" msgid="4589957299813220661">"ແຕະສອງເທື່ອໃສ່ນອກແອັບໃດໜຶ່ງເພື່ອຈັດຕຳແໜ່ງຂອງມັນຄືນໃໝ່"</string>
diff --git a/libs/WindowManager/Shell/res/values-lt/strings.xml b/libs/WindowManager/Shell/res/values-lt/strings.xml
index 719cf60d18e2..857e90e6d340 100644
--- a/libs/WindowManager/Shell/res/values-lt/strings.xml
+++ b/libs/WindowManager/Shell/res/values-lt/strings.xml
@@ -97,9 +97,9 @@
<string name="camera_compat_treatment_suggested_button_description" msgid="8103916969024076767">"Iškilo problemų dėl kameros?\nPalieskite, kad pritaikytumėte iš naujo"</string>
<string name="camera_compat_treatment_applied_button_description" msgid="2944157113330703897">"Nepavyko pataisyti?\nPalieskite, kad grąžintumėte"</string>
<string name="camera_compat_dismiss_button_description" msgid="2795364433503817511">"Nėra jokių problemų dėl kameros? Palieskite, kad atsisakytumėte."</string>
- <string name="windowing_app_handle_education_tooltip" msgid="6398482412956375783">"Palieskite, kad atidarytumėte programos meniu"</string>
- <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="6285279585554484957">"Palieskite, kad būtų rodomos kelios programos kartu"</string>
- <string name="windowing_desktop_mode_exit_education_tooltip" msgid="6685429075790085337">"Grįžkite į viso ekrano režimą iš programos meniu"</string>
+ <string name="windowing_app_handle_education_tooltip" msgid="2929643449849791854">"Programos meniu rasite čia"</string>
+ <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="2523468503353474095">"Įjunkite rodinio versiją staliniams kompiuteriams, kad vienu metu atidarytumėte kelias programas"</string>
+ <string name="windowing_desktop_mode_exit_education_tooltip" msgid="5225660258192054132">"Bet kada iš programos meniu grįžkite į viso ekrano režimą"</string>
<string name="letterbox_education_dialog_title" msgid="7739895354143295358">"Daugiau turinio ir funkcijų"</string>
<string name="letterbox_education_split_screen_text" msgid="449233070804658627">"Vilkite kitoje programoje, kad galėtumėte naudoti išskaidyto ekrano režimą"</string>
<string name="letterbox_education_reposition_text" msgid="4589957299813220661">"Dukart palieskite už programos ribų, kad pakeistumėte jos poziciją"</string>
diff --git a/libs/WindowManager/Shell/res/values-lv/strings.xml b/libs/WindowManager/Shell/res/values-lv/strings.xml
index 1649a2e54c12..e56363e06c46 100644
--- a/libs/WindowManager/Shell/res/values-lv/strings.xml
+++ b/libs/WindowManager/Shell/res/values-lv/strings.xml
@@ -97,9 +97,9 @@
<string name="camera_compat_treatment_suggested_button_description" msgid="8103916969024076767">"Vai ir problēmas ar kameru?\nPieskarieties, lai tās novērstu."</string>
<string name="camera_compat_treatment_applied_button_description" msgid="2944157113330703897">"Vai problēma netika novērsta?\nPieskarieties, lai atjaunotu."</string>
<string name="camera_compat_dismiss_button_description" msgid="2795364433503817511">"Vai nav problēmu ar kameru? Pieskarieties, lai nerādītu."</string>
- <string name="windowing_app_handle_education_tooltip" msgid="6398482412956375783">"Lai atvērtu lietotnes izvēlni, pieskarieties."</string>
- <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="6285279585554484957">"Lai parādītu vairākas lietotnes kopā, pieskarieties."</string>
- <string name="windowing_desktop_mode_exit_education_tooltip" msgid="6685429075790085337">"Varat atgriezties pilnekrāna režīmā no lietotnes izvēlnes."</string>
+ <string name="windowing_app_handle_education_tooltip" msgid="2929643449849791854">"Šeit ir pieejama lietotņu izvēlne"</string>
+ <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="2523468503353474095">"Lai atvērtu vairākas lietotnes vienlaikus, pārejiet uz skatu datorā"</string>
+ <string name="windowing_desktop_mode_exit_education_tooltip" msgid="5225660258192054132">"No lietotnes izvēlnes varat jebkurā brīdī atgriezties pilnekrāna režīmā."</string>
<string name="letterbox_education_dialog_title" msgid="7739895354143295358">"Uzziniet un paveiciet vairāk"</string>
<string name="letterbox_education_split_screen_text" msgid="449233070804658627">"Lai izmantotu sadalītu ekrānu, ievelciet vēl vienu lietotni"</string>
<string name="letterbox_education_reposition_text" msgid="4589957299813220661">"Lai pārvietotu lietotni, veiciet dubultskārienu ārpus lietotnes"</string>
diff --git a/libs/WindowManager/Shell/res/values-mk/strings.xml b/libs/WindowManager/Shell/res/values-mk/strings.xml
index 4922d042c6ac..1bf7a28aa410 100644
--- a/libs/WindowManager/Shell/res/values-mk/strings.xml
+++ b/libs/WindowManager/Shell/res/values-mk/strings.xml
@@ -97,9 +97,9 @@
<string name="camera_compat_treatment_suggested_button_description" msgid="8103916969024076767">"Проблеми со камерата?\nДопрете за да се совпадне повторно"</string>
<string name="camera_compat_treatment_applied_button_description" msgid="2944157113330703897">"Не се поправи?\nДопрете за враќање"</string>
<string name="camera_compat_dismiss_button_description" msgid="2795364433503817511">"Нема проблеми со камерата? Допрете за отфрлање."</string>
- <string name="windowing_app_handle_education_tooltip" msgid="6398482412956375783">"Допрете за да го отворите менито со апликации"</string>
- <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="6285279585554484957">"Допрете за да се прикажат повеќе апликации заедно"</string>
- <string name="windowing_desktop_mode_exit_education_tooltip" msgid="6685429075790085337">"Вратете се на цел екран од менито со апликации"</string>
+ <string name="windowing_app_handle_education_tooltip" msgid="2929643449849791854">"Менито со апликации може да го најдете овде"</string>
+ <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="2523468503353474095">"Влезете во приказот на компјутер за да отворите повеќе апликации заедно"</string>
+ <string name="windowing_desktop_mode_exit_education_tooltip" msgid="5225660258192054132">"Вратете се на цел екран од менито со апликации кога сакате"</string>
<string name="letterbox_education_dialog_title" msgid="7739895354143295358">"Погледнете и направете повеќе"</string>
<string name="letterbox_education_split_screen_text" msgid="449233070804658627">"Повлечете друга апликација за поделен екран"</string>
<string name="letterbox_education_reposition_text" msgid="4589957299813220661">"Допрете двапати надвор од некоја апликација за да ја преместите"</string>
@@ -136,14 +136,9 @@
<string name="desktop_mode_maximize_menu_maximize_button_text" msgid="3090199175564175845">"Максимизирај"</string>
<string name="desktop_mode_maximize_menu_snap_left_button_text" msgid="8077452201179893424">"Фотографирај лево"</string>
<string name="desktop_mode_maximize_menu_snap_right_button_text" msgid="7117751068945657304">"Фотографирај десно"</string>
- <!-- no translation found for open_by_default_settings_text (2526548548598185500) -->
- <skip />
- <!-- no translation found for open_by_default_dialog_subheader_text (1729599730664063881) -->
- <skip />
- <!-- no translation found for open_by_default_dialog_in_app_text (6978022419634199806) -->
- <skip />
- <!-- no translation found for open_by_default_dialog_in_browser_text (8042769465958497081) -->
- <skip />
- <!-- no translation found for open_by_default_dialog_dismiss_button_text (3487238795534582291) -->
- <skip />
+ <string name="open_by_default_settings_text" msgid="2526548548598185500">"Отвори според стандардните поставки"</string>
+ <string name="open_by_default_dialog_subheader_text" msgid="1729599730664063881">"Изберете како да се отвораат линковите за апликацијава"</string>
+ <string name="open_by_default_dialog_in_app_text" msgid="6978022419634199806">"Во апликацијата"</string>
+ <string name="open_by_default_dialog_in_browser_text" msgid="8042769465958497081">"Во прелистувачот"</string>
+ <string name="open_by_default_dialog_dismiss_button_text" msgid="3487238795534582291">"Во ред"</string>
</resources>
diff --git a/libs/WindowManager/Shell/res/values-ml/strings.xml b/libs/WindowManager/Shell/res/values-ml/strings.xml
index 4df5d6f0fc8e..3401f6d6b54a 100644
--- a/libs/WindowManager/Shell/res/values-ml/strings.xml
+++ b/libs/WindowManager/Shell/res/values-ml/strings.xml
@@ -97,9 +97,9 @@
<string name="camera_compat_treatment_suggested_button_description" msgid="8103916969024076767">"ക്യാമറ പ്രശ്നങ്ങളുണ്ടോ?\nശരിയാക്കാൻ ടാപ്പ് ചെയ്യുക"</string>
<string name="camera_compat_treatment_applied_button_description" msgid="2944157113330703897">"അത് പരിഹരിച്ചില്ലേ?\nപുനഃസ്ഥാപിക്കാൻ ടാപ്പ് ചെയ്യുക"</string>
<string name="camera_compat_dismiss_button_description" msgid="2795364433503817511">"ക്യാമറാ പ്രശ്നങ്ങളൊന്നുമില്ലേ? നിരസിക്കാൻ ടാപ്പ് ചെയ്യുക."</string>
- <string name="windowing_app_handle_education_tooltip" msgid="6398482412956375783">"ആപ്പ് മെനു തുറക്കാൻ ടാപ്പ് ചെയ്യുക"</string>
- <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="6285279585554484957">"ഒന്നിലധികം ആപ്പുകൾ ഒരുമിച്ച് കാണിക്കാൻ ടാപ്പ് ചെയ്യുക"</string>
- <string name="windowing_desktop_mode_exit_education_tooltip" msgid="6685429075790085337">"ആപ്പ് മെനുവിൽ നിന്ന് പൂർണ്ണസ്‌ക്രീനിലേക്ക് മടങ്ങുക"</string>
+ <string name="windowing_app_handle_education_tooltip" msgid="2929643449849791854">"ആപ്പ് മെനു ഇവിടെ കണ്ടെത്താനാകും"</string>
+ <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="2523468503353474095">"ഒന്നിലധികം ആപ്പുകൾ ഒരുമിച്ച് തുറക്കാൻ ഡെസ്‌ക്‌‌ടോപ്പ് വ്യൂവിൽ പ്രവേശിക്കുക"</string>
+ <string name="windowing_desktop_mode_exit_education_tooltip" msgid="5225660258192054132">"ആപ്പ് മെനുവിൽ നിന്ന് ഏതുസമയത്തും പൂർണ്ണ സ്‌ക്രീനിലേക്ക് മടങ്ങുക"</string>
<string name="letterbox_education_dialog_title" msgid="7739895354143295358">"കൂടുതൽ കാണുക, ചെയ്യുക"</string>
<string name="letterbox_education_split_screen_text" msgid="449233070804658627">"സ്‌ക്രീൻ വിഭജന മോഡിന്, മറ്റൊരു ആപ്പ് വലിച്ചിടുക"</string>
<string name="letterbox_education_reposition_text" msgid="4589957299813220661">"ആപ്പിന്റെ സ്ഥാനം മാറ്റാൻ അതിന് പുറത്ത് ഡബിൾ ടാപ്പ് ചെയ്യുക"</string>
diff --git a/libs/WindowManager/Shell/res/values-mn/strings.xml b/libs/WindowManager/Shell/res/values-mn/strings.xml
index 70f6a0806468..87708d0a0cc2 100644
--- a/libs/WindowManager/Shell/res/values-mn/strings.xml
+++ b/libs/WindowManager/Shell/res/values-mn/strings.xml
@@ -97,9 +97,9 @@
<string name="camera_compat_treatment_suggested_button_description" msgid="8103916969024076767">"Камерын асуудал гарсан уу?\nДахин тааруулахын тулд товшино уу"</string>
<string name="camera_compat_treatment_applied_button_description" msgid="2944157113330703897">"Үүнийг засаагүй юу?\nБуцаахын тулд товшино уу"</string>
<string name="camera_compat_dismiss_button_description" msgid="2795364433503817511">"Камерын асуудал байхгүй юу? Хаахын тулд товшино уу."</string>
- <string name="windowing_app_handle_education_tooltip" msgid="6398482412956375783">"Аппын цэсийг нээхийн тулд товшино уу"</string>
- <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="6285279585554484957">"Олон аппыг хамтад нь харуулахын тулд товшино уу"</string>
- <string name="windowing_desktop_mode_exit_education_tooltip" msgid="6685429075790085337">"Аппын цэсээс бүтэн дэлгэц рүү буцна уу"</string>
+ <string name="windowing_app_handle_education_tooltip" msgid="2929643449849791854">"Аппын цэсийг эндээс олох боломжтой"</string>
+ <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="2523468503353474095">"Олон аппыг хамтад нь нээхийн тулд дэлгэц дээр харагдах байдалд орно уу"</string>
+ <string name="windowing_desktop_mode_exit_education_tooltip" msgid="5225660258192054132">"Аппын цэсээс бүтэн дэлгэц рүү хүссэн үедээ буцна уу"</string>
<string name="letterbox_education_dialog_title" msgid="7739895354143295358">"Харж илүү ихийг хий"</string>
<string name="letterbox_education_split_screen_text" msgid="449233070804658627">"Дэлгэц хуваах горимд ашиглахын тулд өөр аппыг чирнэ үү"</string>
<string name="letterbox_education_reposition_text" msgid="4589957299813220661">"Аппыг дахин байрлуулахын тулд гадна талд нь хоёр товшино"</string>
diff --git a/libs/WindowManager/Shell/res/values-mr/strings.xml b/libs/WindowManager/Shell/res/values-mr/strings.xml
index e2844861e31a..1ea41e557c4f 100644
--- a/libs/WindowManager/Shell/res/values-mr/strings.xml
+++ b/libs/WindowManager/Shell/res/values-mr/strings.xml
@@ -97,9 +97,9 @@
<string name="camera_compat_treatment_suggested_button_description" msgid="8103916969024076767">"कॅमेराशी संबंधित काही समस्या आहेत का?\nपुन्हा फिट करण्यासाठी टॅप करा"</string>
<string name="camera_compat_treatment_applied_button_description" msgid="2944157113330703897">"निराकरण झाले नाही?\nरिव्हर्ट करण्यासाठी कृपया टॅप करा"</string>
<string name="camera_compat_dismiss_button_description" msgid="2795364433503817511">"कॅमेराशी संबंधित कोणत्याही समस्या नाहीत का? डिसमिस करण्‍यासाठी टॅप करा."</string>
- <string name="windowing_app_handle_education_tooltip" msgid="6398482412956375783">"अ‍ॅप मेनू उघडण्यासाठी टॅप करा"</string>
- <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="6285279585554484957">"एकाहून अधिक ॲप्स एकत्र दाखवण्यासाठी टॅप करा"</string>
- <string name="windowing_desktop_mode_exit_education_tooltip" msgid="6685429075790085337">"ॲप मेनूमधून फुलस्क्रीनवर परत या"</string>
+ <string name="windowing_app_handle_education_tooltip" msgid="2929643449849791854">"ॲप मेनू इथे आढळू शकतो"</string>
+ <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="2523468503353474095">"एकाहून अधिक ॲप्स एकत्र उघडण्यासाठी डेस्कटॉप दृश्यात एंटर करा"</string>
+ <string name="windowing_desktop_mode_exit_education_tooltip" msgid="5225660258192054132">"ॲप मेनूमधून कधीही फुल स्क्रीनवर परत या"</string>
<string name="letterbox_education_dialog_title" msgid="7739895354143295358">"पहा आणि आणखी बरेच काही करा"</string>
<string name="letterbox_education_split_screen_text" msgid="449233070804658627">"स्प्लिट स्क्रीन वापरण्यासाठी दुसरे ॲप ड्रॅग करा"</string>
<string name="letterbox_education_reposition_text" msgid="4589957299813220661">"ॲपची स्थिती पुन्हा बदलण्यासाठी, त्याच्या बाहेर दोनदा टॅप करा"</string>
diff --git a/libs/WindowManager/Shell/res/values-ms/strings.xml b/libs/WindowManager/Shell/res/values-ms/strings.xml
index 59032fb91d92..ca248e133eb8 100644
--- a/libs/WindowManager/Shell/res/values-ms/strings.xml
+++ b/libs/WindowManager/Shell/res/values-ms/strings.xml
@@ -97,9 +97,9 @@
<string name="camera_compat_treatment_suggested_button_description" msgid="8103916969024076767">"Isu kamera?\nKetik untuk memuatkan semula"</string>
<string name="camera_compat_treatment_applied_button_description" msgid="2944157113330703897">"Isu tidak dibetulkan?\nKetik untuk kembali"</string>
<string name="camera_compat_dismiss_button_description" msgid="2795364433503817511">"Tiada isu kamera? Ketik untuk mengetepikan."</string>
- <string name="windowing_app_handle_education_tooltip" msgid="6398482412956375783">"Ketik untuk membuka menu apl"</string>
- <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="6285279585554484957">"Ketik untuk memaparkan berbilang apl serentak"</string>
- <string name="windowing_desktop_mode_exit_education_tooltip" msgid="6685429075790085337">"Kembali kepada skrin penuh daripada menu apl"</string>
+ <string name="windowing_app_handle_education_tooltip" msgid="2929643449849791854">"Menu apl boleh ditemukan di sini"</string>
+ <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="2523468503353474095">"Masuki paparan desktop untuk membuka berbilang apl serentak"</string>
+ <string name="windowing_desktop_mode_exit_education_tooltip" msgid="5225660258192054132">"Kembali kepada skrin penuh pada bila-bila masa daripada menu apl"</string>
<string name="letterbox_education_dialog_title" msgid="7739895354143295358">"Lihat dan lakukan lebih"</string>
<string name="letterbox_education_split_screen_text" msgid="449233070804658627">"Seret masuk apl lain untuk menggunakan skrin pisah"</string>
<string name="letterbox_education_reposition_text" msgid="4589957299813220661">"Ketik dua kali di luar apl untuk menempatkan semula apl itu"</string>
diff --git a/libs/WindowManager/Shell/res/values-my/strings.xml b/libs/WindowManager/Shell/res/values-my/strings.xml
index 7b952c1f3fa8..3c4325bfc5b8 100644
--- a/libs/WindowManager/Shell/res/values-my/strings.xml
+++ b/libs/WindowManager/Shell/res/values-my/strings.xml
@@ -97,9 +97,9 @@
<string name="camera_compat_treatment_suggested_button_description" msgid="8103916969024076767">"ကင်မရာပြဿနာလား။\nပြင်ဆင်ရန် တို့ပါ"</string>
<string name="camera_compat_treatment_applied_button_description" msgid="2944157113330703897">"ကောင်းမသွားဘူးလား။\nပြန်ပြောင်းရန် တို့ပါ"</string>
<string name="camera_compat_dismiss_button_description" msgid="2795364433503817511">"ကင်မရာပြဿနာ မရှိဘူးလား။ ပယ်ရန် တို့ပါ။"</string>
- <string name="windowing_app_handle_education_tooltip" msgid="6398482412956375783">"အက်ပ်မီနူးကိုဖွင့်ရန် တို့ပါ"</string>
- <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="6285279585554484957">"အက်ပ်များစွာကို အတူတကွပြရန် တို့ပါ"</string>
- <string name="windowing_desktop_mode_exit_education_tooltip" msgid="6685429075790085337">"အက်ပ်မီနူးမှ ဖန်သားပြင်အပြည့်သို့ ပြန်သွားပါ"</string>
+ <string name="windowing_app_handle_education_tooltip" msgid="2929643449849791854">"အက်ပ်မီနူးကို ဤနေရာတွင် တွေ့နိုင်သည်"</string>
+ <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="2523468503353474095">"အက်ပ်များစွာကို အတူတကွဖွင့်ရန်အတွက် ဒက်စ်တော့မြင်ကွင်းသို့ ဝင်ရောက်နိုင်သည်"</string>
+ <string name="windowing_desktop_mode_exit_education_tooltip" msgid="5225660258192054132">"အက်ပ်မီနူးမှ ဖန်သားပြင်အပြည့်သို့ အချိန်မရွေး ပြန်သွားနိုင်သည်"</string>
<string name="letterbox_education_dialog_title" msgid="7739895354143295358">"ကြည့်ပြီး ပိုမိုလုပ်ဆောင်ပါ"</string>
<string name="letterbox_education_split_screen_text" msgid="449233070804658627">"မျက်နှာပြင် ခွဲ၍ပြသခြင်းအတွက် အက်ပ်နောက်တစ်ခုကို ဖိဆွဲပါ"</string>
<string name="letterbox_education_reposition_text" msgid="4589957299813220661">"နေရာပြန်ချရန် အက်ပ်အပြင်ဘက်ကို နှစ်ချက်တို့ပါ"</string>
diff --git a/libs/WindowManager/Shell/res/values-nb/strings.xml b/libs/WindowManager/Shell/res/values-nb/strings.xml
index 8733a7f7f7ef..4096bbf69fe7 100644
--- a/libs/WindowManager/Shell/res/values-nb/strings.xml
+++ b/libs/WindowManager/Shell/res/values-nb/strings.xml
@@ -97,9 +97,9 @@
<string name="camera_compat_treatment_suggested_button_description" msgid="8103916969024076767">"Har du kameraproblemer?\nTrykk for å tilpasse"</string>
<string name="camera_compat_treatment_applied_button_description" msgid="2944157113330703897">"Ble ikke problemet løst?\nTrykk for å gå tilbake"</string>
<string name="camera_compat_dismiss_button_description" msgid="2795364433503817511">"Har du ingen kameraproblemer? Trykk for å lukke."</string>
- <string name="windowing_app_handle_education_tooltip" msgid="6398482412956375783">"Trykk for å åpne appmenyen"</string>
- <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="6285279585554484957">"Trykk for å vise flere apper sammen"</string>
- <string name="windowing_desktop_mode_exit_education_tooltip" msgid="6685429075790085337">"Gå tilbake til fullskjerm fra appmenyen"</string>
+ <string name="windowing_app_handle_education_tooltip" msgid="2929643449849791854">"Her finner du appmenyen"</string>
+ <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="2523468503353474095">"Gå til skrivebordsvisningen for å åpne flere apper samtidig"</string>
+ <string name="windowing_desktop_mode_exit_education_tooltip" msgid="5225660258192054132">"Du kan gå tilbake til fullskjermmodusen når som helst fra appmenyen"</string>
<string name="letterbox_education_dialog_title" msgid="7739895354143295358">"Se og gjør mer"</string>
<string name="letterbox_education_split_screen_text" msgid="449233070804658627">"Dra inn en annen app for å bruke delt skjerm"</string>
<string name="letterbox_education_reposition_text" msgid="4589957299813220661">"Dobbelttrykk utenfor en app for å flytte den"</string>
diff --git a/libs/WindowManager/Shell/res/values-ne/strings.xml b/libs/WindowManager/Shell/res/values-ne/strings.xml
index cdd2a1f80d1d..2fc5e0902efa 100644
--- a/libs/WindowManager/Shell/res/values-ne/strings.xml
+++ b/libs/WindowManager/Shell/res/values-ne/strings.xml
@@ -97,9 +97,9 @@
<string name="camera_compat_treatment_suggested_button_description" msgid="8103916969024076767">"क्यामेरासम्बन्धी समस्या देखियो?\nसमस्या हल गर्न ट्याप गर्नुहोस्"</string>
<string name="camera_compat_treatment_applied_button_description" msgid="2944157113330703897">"समस्या हल भएन?\nपहिलेको जस्तै बनाउन ट्याप गर्नुहोस्"</string>
<string name="camera_compat_dismiss_button_description" msgid="2795364433503817511">"क्यामेरासम्बन्धी कुनै पनि समस्या छैन? खारेज गर्न ट्याप गर्नुहोस्।"</string>
- <string name="windowing_app_handle_education_tooltip" msgid="6398482412956375783">"एपको मेनु खोल्न ट्याप गर्नुहोस्"</string>
- <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="6285279585554484957">"एकभन्दा बढी एपहरू सँगै देखाउन ट्याप गर्नुहोस्"</string>
- <string name="windowing_desktop_mode_exit_education_tooltip" msgid="6685429075790085337">"एपको मेनुबाट फुल स्क्रिनमा फर्कनुहोस्"</string>
+ <string name="windowing_app_handle_education_tooltip" msgid="2929643449849791854">"एपको मेनु यहाँ भेट्टाउन सकिन्छ"</string>
+ <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="2523468503353474095">"एकभन्दा बढी एपहरू सँगै देखाउन डेस्कटप भ्यू हाल्नुहोस्"</string>
+ <string name="windowing_desktop_mode_exit_education_tooltip" msgid="5225660258192054132">"जुनसुकै बेला एपको मेनुबाट फुल स्क्रिनमा फर्कनुहोस्"</string>
<string name="letterbox_education_dialog_title" msgid="7739895354143295358">"थप कुरा हेर्नुहोस् र गर्नुहोस्"</string>
<string name="letterbox_education_split_screen_text" msgid="449233070804658627">"स्प्लिट स्क्रिन मोड प्रयोग गर्न अर्को एप ड्रयाग एन्ड ड्रप गर्नुहोस्"</string>
<string name="letterbox_education_reposition_text" msgid="4589957299813220661">"तपाईं जुन एपको स्थिति मिलाउन चाहनुहुन्छ सोही एपको बाहिर डबल ट्याप गर्नुहोस्"</string>
diff --git a/libs/WindowManager/Shell/res/values-nl/strings.xml b/libs/WindowManager/Shell/res/values-nl/strings.xml
index d8a285649952..65fd8ea44d2e 100644
--- a/libs/WindowManager/Shell/res/values-nl/strings.xml
+++ b/libs/WindowManager/Shell/res/values-nl/strings.xml
@@ -97,9 +97,9 @@
<string name="camera_compat_treatment_suggested_button_description" msgid="8103916969024076767">"Cameraproblemen?\nTik om opnieuw passend te maken."</string>
<string name="camera_compat_treatment_applied_button_description" msgid="2944157113330703897">"Is dit geen oplossing?\nTik om terug te zetten."</string>
<string name="camera_compat_dismiss_button_description" msgid="2795364433503817511">"Geen cameraproblemen? Tik om te sluiten."</string>
- <string name="windowing_app_handle_education_tooltip" msgid="6398482412956375783">"Tik om het app-menu te openen"</string>
- <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="6285279585554484957">"Tik om meerdere apps tegelijk te tonen"</string>
- <string name="windowing_desktop_mode_exit_education_tooltip" msgid="6685429075790085337">"Terug naar volledig scherm vanuit het app-menu"</string>
+ <string name="windowing_app_handle_education_tooltip" msgid="2929643449849791854">"Het app-menu vind je hier"</string>
+ <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="2523468503353474095">"Ga naar de desktopweergave om meerdere apps tegelijk te openen"</string>
+ <string name="windowing_desktop_mode_exit_education_tooltip" msgid="5225660258192054132">"Ga wanneer je wilt terug naar volledig scherm vanuit het app-menu"</string>
<string name="letterbox_education_dialog_title" msgid="7739895354143295358">"Zie en doe meer"</string>
<string name="letterbox_education_split_screen_text" msgid="449233070804658627">"Sleep een andere app hier naartoe om het scherm te splitsen"</string>
<string name="letterbox_education_reposition_text" msgid="4589957299813220661">"Dubbeltik naast een app om deze opnieuw te positioneren"</string>
diff --git a/libs/WindowManager/Shell/res/values-or/strings.xml b/libs/WindowManager/Shell/res/values-or/strings.xml
index baf009e8f28c..1f96daad93b9 100644
--- a/libs/WindowManager/Shell/res/values-or/strings.xml
+++ b/libs/WindowManager/Shell/res/values-or/strings.xml
@@ -97,9 +97,9 @@
<string name="camera_compat_treatment_suggested_button_description" msgid="8103916969024076767">"କ୍ୟାମେରାରେ ସମସ୍ୟା ଅଛି?\nପୁଣି ଫିଟ କରିବାକୁ ଟାପ କରନ୍ତୁ"</string>
<string name="camera_compat_treatment_applied_button_description" msgid="2944157113330703897">"ଏହାର ସମାଧାନ ହୋଇନାହିଁ?\nଫେରିଯିବା ପାଇଁ ଟାପ କରନ୍ତୁ"</string>
<string name="camera_compat_dismiss_button_description" msgid="2795364433503817511">"କ୍ୟାମେରାରେ କିଛି ସମସ୍ୟା ନାହିଁ? ଖାରଜ କରିବାକୁ ଟାପ କରନ୍ତୁ।"</string>
- <string name="windowing_app_handle_education_tooltip" msgid="6398482412956375783">"ଆପ ମେନୁ ଖୋଲିବାକୁ ଟାପ କରନ୍ତୁ"</string>
- <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="6285279585554484957">"ଏକାଠି ଏକାଧିକ ଆପ୍ସ ଦେଖାଇବା ପାଇଁ ଟାପ କରନ୍ତୁ"</string>
- <string name="windowing_desktop_mode_exit_education_tooltip" msgid="6685429075790085337">"ଆପ ମେନୁରୁ ପୂର୍ଣ୍ଣସ୍କ୍ରିନକୁ ଫେରନ୍ତୁ"</string>
+ <string name="windowing_app_handle_education_tooltip" msgid="2929643449849791854">"ଆପ ମେନୁ ଏଠାରେ ମିଳିପାରିବ"</string>
+ <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="2523468503353474095">"ଏକାଠି ଏକାଧିକ ଆପ୍ସ ଖୋଲିବାକୁ ଡେସ୍କଟପ ଭ୍ୟୁରେ ପ୍ରବେଶ କରନ୍ତୁ"</string>
+ <string name="windowing_desktop_mode_exit_education_tooltip" msgid="5225660258192054132">"ଆପ ମେନୁରୁ ଯେ କୌଣସି ସମୟରେ ପୂର୍ଣ୍ଣ ସ୍କ୍ରିନକୁ ଫେରନ୍ତୁ"</string>
<string name="letterbox_education_dialog_title" msgid="7739895354143295358">"ଦେଖନ୍ତୁ ଏବଂ ଆହୁରି ଅନେକ କିଛି କରନ୍ତୁ"</string>
<string name="letterbox_education_split_screen_text" msgid="449233070804658627">"ସ୍ପ୍ଲିଟ ସ୍କ୍ରିନ ପାଇଁ ଅନ୍ୟ ଏକ ଆପକୁ ଡ୍ରାଗ କରନ୍ତୁ"</string>
<string name="letterbox_education_reposition_text" msgid="4589957299813220661">"ଏକ ଆପକୁ ରିପୋଜିସନ କରିବା ପାଇଁ ଏହାର ବାହାରେ ଦୁଇଥର-ଟାପ କରନ୍ତୁ"</string>
@@ -136,14 +136,9 @@
<string name="desktop_mode_maximize_menu_maximize_button_text" msgid="3090199175564175845">"ବଡ଼ କରନ୍ତୁ"</string>
<string name="desktop_mode_maximize_menu_snap_left_button_text" msgid="8077452201179893424">"ବାମରେ ସ୍ନାପ କରନ୍ତୁ"</string>
<string name="desktop_mode_maximize_menu_snap_right_button_text" msgid="7117751068945657304">"ଡାହାଣରେ ସ୍ନାପ କରନ୍ତୁ"</string>
- <!-- no translation found for open_by_default_settings_text (2526548548598185500) -->
- <skip />
- <!-- no translation found for open_by_default_dialog_subheader_text (1729599730664063881) -->
- <skip />
- <!-- no translation found for open_by_default_dialog_in_app_text (6978022419634199806) -->
- <skip />
- <!-- no translation found for open_by_default_dialog_in_browser_text (8042769465958497081) -->
- <skip />
- <!-- no translation found for open_by_default_dialog_dismiss_button_text (3487238795534582291) -->
- <skip />
+ <string name="open_by_default_settings_text" msgid="2526548548598185500">"ଡିଫଲ୍ଟ ସେଟିଂସକୁ ଖୋଲନ୍ତୁ"</string>
+ <string name="open_by_default_dialog_subheader_text" msgid="1729599730664063881">"ଏହି ଆପ ପାଇଁ ୱେବ ଲିଙ୍କଗୁଡ଼ିକୁ କିପରି ଖୋଲିବେ, ତାହା ବାଛନ୍ତୁ"</string>
+ <string name="open_by_default_dialog_in_app_text" msgid="6978022419634199806">"ଆପରେ"</string>
+ <string name="open_by_default_dialog_in_browser_text" msgid="8042769465958497081">"ଆପଣଙ୍କ ବ୍ରାଉଜରରେ"</string>
+ <string name="open_by_default_dialog_dismiss_button_text" msgid="3487238795534582291">"ଠିକ ଅଛି"</string>
</resources>
diff --git a/libs/WindowManager/Shell/res/values-pa/strings.xml b/libs/WindowManager/Shell/res/values-pa/strings.xml
index 06e1f54e9e9b..f93f5097ac66 100644
--- a/libs/WindowManager/Shell/res/values-pa/strings.xml
+++ b/libs/WindowManager/Shell/res/values-pa/strings.xml
@@ -97,9 +97,9 @@
<string name="camera_compat_treatment_suggested_button_description" msgid="8103916969024076767">"ਕੀ ਕੈਮਰੇ ਸੰਬੰਧੀ ਸਮੱਸਿਆਵਾਂ ਹਨ?\nਮੁੜ-ਫਿੱਟ ਕਰਨ ਲਈ ਟੈਪ ਕਰੋ"</string>
<string name="camera_compat_treatment_applied_button_description" msgid="2944157113330703897">"ਕੀ ਇਹ ਠੀਕ ਨਹੀਂ ਹੋਈ?\nਵਾਪਸ ਉਹੀ ਕਰਨ ਲਈ ਟੈਪ ਕਰੋ"</string>
<string name="camera_compat_dismiss_button_description" msgid="2795364433503817511">"ਕੀ ਕੈਮਰੇ ਸੰਬੰਧੀ ਕੋਈ ਸਮੱਸਿਆ ਨਹੀਂ ਹੈ? ਖਾਰਜ ਕਰਨ ਲਈ ਟੈਪ ਕਰੋ।"</string>
- <string name="windowing_app_handle_education_tooltip" msgid="6398482412956375783">"ਐਪ ਮੀਨੂ ਨੂੰ ਖੋਲ੍ਹਣ ਲਈ ਟੈਪ ਕਰੋ"</string>
- <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="6285279585554484957">"ਕਈ ਐਪਾਂ ਇਕੱਠੀਆਂ ਦਿਖਾਉਣ ਲਈ ਟੈਪ ਕਰੋ"</string>
- <string name="windowing_desktop_mode_exit_education_tooltip" msgid="6685429075790085337">"ਐਪ ਮੀਨੂ ਤੋਂ ਪੂਰੀ-ਸਕ੍ਰੀਨ ਮੋਡ \'ਤੇ ਵਾਪਸ ਜਾਓ"</string>
+ <string name="windowing_app_handle_education_tooltip" msgid="2929643449849791854">"ਐਪ ਮੀਨੂ ਇੱਥੇ ਮਿਲ ਸਕਦਾ ਹੈ"</string>
+ <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="2523468503353474095">"ਕਈ ਐਪਾਂ ਨੂੰ ਇਕੱਠੇ ਖੋਲ੍ਹਣ ਲਈ ਡੈਸਕਟਾਪ ਦ੍ਰਿਸ਼ ਵਿੱਚ ਦਾਖਲ ਹੋਵੋ"</string>
+ <string name="windowing_desktop_mode_exit_education_tooltip" msgid="5225660258192054132">"ਐਪ ਮੀਨੂ ਤੋਂ ਕਿਸੇ ਵੀ ਸਮੇਂ ਪੂਰੀ ਸਕ੍ਰੀਨ \'ਤੇ ਵਾਪਸ ਜਾਓ"</string>
<string name="letterbox_education_dialog_title" msgid="7739895354143295358">"ਦੇਖੋ ਅਤੇ ਹੋਰ ਬਹੁਤ ਕੁਝ ਕਰੋ"</string>
<string name="letterbox_education_split_screen_text" msgid="449233070804658627">"ਸਪਲਿਟ ਸਕ੍ਰੀਨ ਦੇ ਲਈ ਕਿਸੇ ਹੋਰ ਐਪ ਵਿੱਚ ਘਸੀਟੋ"</string>
<string name="letterbox_education_reposition_text" msgid="4589957299813220661">"ਕਿਸੇ ਐਪ ਦੀ ਜਗ੍ਹਾ ਬਦਲਣ ਲਈ ਉਸ ਦੇ ਬਾਹਰ ਡਬਲ ਟੈਪ ਕਰੋ"</string>
diff --git a/libs/WindowManager/Shell/res/values-pl/strings.xml b/libs/WindowManager/Shell/res/values-pl/strings.xml
index 90d374cb446c..1e76e82094d8 100644
--- a/libs/WindowManager/Shell/res/values-pl/strings.xml
+++ b/libs/WindowManager/Shell/res/values-pl/strings.xml
@@ -97,9 +97,9 @@
<string name="camera_compat_treatment_suggested_button_description" msgid="8103916969024076767">"Problemy z aparatem?\nKliknij, aby dopasować"</string>
<string name="camera_compat_treatment_applied_button_description" msgid="2944157113330703897">"Naprawa się nie udała?\nKliknij, aby cofnąć"</string>
<string name="camera_compat_dismiss_button_description" msgid="2795364433503817511">"Brak problemów z aparatem? Kliknij, aby zamknąć"</string>
- <string name="windowing_app_handle_education_tooltip" msgid="6398482412956375783">"Kliknij, aby otworzyć menu aplikacji"</string>
- <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="6285279585554484957">"Kliknij, aby wyświetlić jednocześnie kilka aplikacji"</string>
- <string name="windowing_desktop_mode_exit_education_tooltip" msgid="6685429075790085337">"Wróć do trybu pełnoekranowego z menu aplikacji"</string>
+ <string name="windowing_app_handle_education_tooltip" msgid="2929643449849791854">"Tu znajdziesz menu aplikacji"</string>
+ <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="2523468503353474095">"Aby otworzyć kilka aplikacji jednocześnie, przejdź do widoku pulpitu"</string>
+ <string name="windowing_desktop_mode_exit_education_tooltip" msgid="5225660258192054132">"Z menu aplikacji w każdej chwili możesz wrócić do pełnego ekranu"</string>
<string name="letterbox_education_dialog_title" msgid="7739895354143295358">"Zobacz i zrób więcej"</string>
<string name="letterbox_education_split_screen_text" msgid="449233070804658627">"Aby podzielić ekran, przeciągnij drugą aplikację"</string>
<string name="letterbox_education_reposition_text" msgid="4589957299813220661">"Kliknij dwukrotnie poza aplikacją, aby ją przenieść"</string>
diff --git a/libs/WindowManager/Shell/res/values-pt-rBR/strings.xml b/libs/WindowManager/Shell/res/values-pt-rBR/strings.xml
index a7cf9d87dbd3..0bdb0786ef71 100644
--- a/libs/WindowManager/Shell/res/values-pt-rBR/strings.xml
+++ b/libs/WindowManager/Shell/res/values-pt-rBR/strings.xml
@@ -97,9 +97,9 @@
<string name="camera_compat_treatment_suggested_button_description" msgid="8103916969024076767">"Problemas com a câmera?\nToque para ajustar o enquadramento"</string>
<string name="camera_compat_treatment_applied_button_description" msgid="2944157113330703897">"O problema não foi corrigido?\nToque para reverter"</string>
<string name="camera_compat_dismiss_button_description" msgid="2795364433503817511">"Não tem problemas com a câmera? Toque para dispensar."</string>
- <string name="windowing_app_handle_education_tooltip" msgid="6398482412956375783">"Toque para abrir o menu do app"</string>
- <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="6285279585554484957">"Toque para mostrar vários apps juntos"</string>
- <string name="windowing_desktop_mode_exit_education_tooltip" msgid="6685429075790085337">"Volte para a tela cheia no menu do app"</string>
+ <string name="windowing_app_handle_education_tooltip" msgid="2929643449849791854">"O menu do app está aqui"</string>
+ <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="2523468503353474095">"Acesse a versão para computadores para abrir vários apps ao mesmo tempo"</string>
+ <string name="windowing_desktop_mode_exit_education_tooltip" msgid="5225660258192054132">"Volte para a tela cheia a qualquer momento no menu do app"</string>
<string name="letterbox_education_dialog_title" msgid="7739895354143295358">"Veja e faça mais"</string>
<string name="letterbox_education_split_screen_text" msgid="449233070804658627">"Arraste outro app para dividir a tela"</string>
<string name="letterbox_education_reposition_text" msgid="4589957299813220661">"Toque duas vezes fora de um app para reposicionar"</string>
diff --git a/libs/WindowManager/Shell/res/values-pt-rPT/strings.xml b/libs/WindowManager/Shell/res/values-pt-rPT/strings.xml
index 40241b4710ce..0e10da1e6e0a 100644
--- a/libs/WindowManager/Shell/res/values-pt-rPT/strings.xml
+++ b/libs/WindowManager/Shell/res/values-pt-rPT/strings.xml
@@ -97,9 +97,9 @@
<string name="camera_compat_treatment_suggested_button_description" msgid="8103916969024076767">"Problemas com a câmara?\nToque aqui para reajustar"</string>
<string name="camera_compat_treatment_applied_button_description" msgid="2944157113330703897">"Não foi corrigido?\nToque para reverter"</string>
<string name="camera_compat_dismiss_button_description" msgid="2795364433503817511">"Nenhum problema com a câmara? Toque para ignorar."</string>
- <string name="windowing_app_handle_education_tooltip" msgid="6398482412956375783">"Toque para abrir o menu de apps"</string>
- <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="6285279585554484957">"Toque para mostrar várias apps em conjunto"</string>
- <string name="windowing_desktop_mode_exit_education_tooltip" msgid="6685429075790085337">"Regresse ao ecrã inteiro a partir do menu de apps"</string>
+ <string name="windowing_app_handle_education_tooltip" msgid="2929643449849791854">"O menu da app pode ser encontrado aqui"</string>
+ <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="2523468503353474095">"Entre na vista de computador para abrir várias apps em conjunto"</string>
+ <string name="windowing_desktop_mode_exit_education_tooltip" msgid="5225660258192054132">"Regresse ao ecrã inteiro em qualquer altura a partir do menu da app"</string>
<string name="letterbox_education_dialog_title" msgid="7739895354143295358">"Veja e faça mais"</string>
<string name="letterbox_education_split_screen_text" msgid="449233070804658627">"Arraste outra app para usar o ecrã dividido"</string>
<string name="letterbox_education_reposition_text" msgid="4589957299813220661">"Toque duas vezes fora de uma app para a reposicionar"</string>
diff --git a/libs/WindowManager/Shell/res/values-pt/strings.xml b/libs/WindowManager/Shell/res/values-pt/strings.xml
index a7cf9d87dbd3..0bdb0786ef71 100644
--- a/libs/WindowManager/Shell/res/values-pt/strings.xml
+++ b/libs/WindowManager/Shell/res/values-pt/strings.xml
@@ -97,9 +97,9 @@
<string name="camera_compat_treatment_suggested_button_description" msgid="8103916969024076767">"Problemas com a câmera?\nToque para ajustar o enquadramento"</string>
<string name="camera_compat_treatment_applied_button_description" msgid="2944157113330703897">"O problema não foi corrigido?\nToque para reverter"</string>
<string name="camera_compat_dismiss_button_description" msgid="2795364433503817511">"Não tem problemas com a câmera? Toque para dispensar."</string>
- <string name="windowing_app_handle_education_tooltip" msgid="6398482412956375783">"Toque para abrir o menu do app"</string>
- <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="6285279585554484957">"Toque para mostrar vários apps juntos"</string>
- <string name="windowing_desktop_mode_exit_education_tooltip" msgid="6685429075790085337">"Volte para a tela cheia no menu do app"</string>
+ <string name="windowing_app_handle_education_tooltip" msgid="2929643449849791854">"O menu do app está aqui"</string>
+ <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="2523468503353474095">"Acesse a versão para computadores para abrir vários apps ao mesmo tempo"</string>
+ <string name="windowing_desktop_mode_exit_education_tooltip" msgid="5225660258192054132">"Volte para a tela cheia a qualquer momento no menu do app"</string>
<string name="letterbox_education_dialog_title" msgid="7739895354143295358">"Veja e faça mais"</string>
<string name="letterbox_education_split_screen_text" msgid="449233070804658627">"Arraste outro app para dividir a tela"</string>
<string name="letterbox_education_reposition_text" msgid="4589957299813220661">"Toque duas vezes fora de um app para reposicionar"</string>
diff --git a/libs/WindowManager/Shell/res/values-ro/strings.xml b/libs/WindowManager/Shell/res/values-ro/strings.xml
index f323ff8f5109..c94273630432 100644
--- a/libs/WindowManager/Shell/res/values-ro/strings.xml
+++ b/libs/WindowManager/Shell/res/values-ro/strings.xml
@@ -97,9 +97,9 @@
<string name="camera_compat_treatment_suggested_button_description" msgid="8103916969024076767">"Ai probleme cu camera foto?\nAtinge pentru a reîncadra"</string>
<string name="camera_compat_treatment_applied_button_description" msgid="2944157113330703897">"Nu ai remediat problema?\nAtinge pentru a reveni"</string>
<string name="camera_compat_dismiss_button_description" msgid="2795364433503817511">"Nu ai probleme cu camera foto? Atinge pentru a închide."</string>
- <string name="windowing_app_handle_education_tooltip" msgid="6398482412956375783">"Atinge pentru a deschide meniul aplicației"</string>
- <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="6285279585554484957">"Atinge pentru a afișa mai multe aplicații împreună"</string>
- <string name="windowing_desktop_mode_exit_education_tooltip" msgid="6685429075790085337">"Revino la ecranul complet din meniul aplicației"</string>
+ <string name="windowing_app_handle_education_tooltip" msgid="2929643449849791854">"Meniul aplicației poate fi găsit aici"</string>
+ <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="2523468503353474095">"Accesează afișarea pe desktop pentru a deschide mai multe aplicații simultan"</string>
+ <string name="windowing_desktop_mode_exit_education_tooltip" msgid="5225660258192054132">"Revino oricând la ecranul complet din meniul aplicației"</string>
<string name="letterbox_education_dialog_title" msgid="7739895354143295358">"Vezi și fă mai multe"</string>
<string name="letterbox_education_split_screen_text" msgid="449233070804658627">"Trage în altă aplicație pentru a folosi ecranul împărțit"</string>
<string name="letterbox_education_reposition_text" msgid="4589957299813220661">"Atinge de două ori lângă o aplicație pentru a o repoziționa"</string>
diff --git a/libs/WindowManager/Shell/res/values-ru/strings.xml b/libs/WindowManager/Shell/res/values-ru/strings.xml
index 45da723e5e97..e2c39387c8b4 100644
--- a/libs/WindowManager/Shell/res/values-ru/strings.xml
+++ b/libs/WindowManager/Shell/res/values-ru/strings.xml
@@ -97,9 +97,9 @@
<string name="camera_compat_treatment_suggested_button_description" msgid="8103916969024076767">"Проблемы с камерой?\nНажмите, чтобы исправить."</string>
<string name="camera_compat_treatment_applied_button_description" msgid="2944157113330703897">"Не помогло?\nНажмите, чтобы отменить изменения."</string>
<string name="camera_compat_dismiss_button_description" msgid="2795364433503817511">"Нет проблем с камерой? Нажмите, чтобы закрыть."</string>
- <string name="windowing_app_handle_education_tooltip" msgid="6398482412956375783">"Нажмите, чтобы открыть меню приложения"</string>
- <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="6285279585554484957">"Нажмите, чтобы на экране размещались сразу несколько приложений"</string>
- <string name="windowing_desktop_mode_exit_education_tooltip" msgid="6685429075790085337">"Вернуться из меню приложения в режим полного экрана"</string>
+ <string name="windowing_app_handle_education_tooltip" msgid="2929643449849791854">"Здесь вы найдете меню приложения"</string>
+ <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="2523468503353474095">"Чтобы открыть сразу несколько приложений, перейдите в режим компьютера"</string>
+ <string name="windowing_desktop_mode_exit_education_tooltip" msgid="5225660258192054132">"Вернуться в полноэкранный режим можно из меню приложения"</string>
<string name="letterbox_education_dialog_title" msgid="7739895354143295358">"Выполняйте несколько задач одновременно"</string>
<string name="letterbox_education_split_screen_text" msgid="449233070804658627">"Перетащите сюда другое приложение, чтобы использовать разделение экрана."</string>
<string name="letterbox_education_reposition_text" msgid="4589957299813220661">"Чтобы переместить приложение, дважды нажмите рядом с ним."</string>
diff --git a/libs/WindowManager/Shell/res/values-si/strings.xml b/libs/WindowManager/Shell/res/values-si/strings.xml
index 0b1a2390b892..83a09f5beffe 100644
--- a/libs/WindowManager/Shell/res/values-si/strings.xml
+++ b/libs/WindowManager/Shell/res/values-si/strings.xml
@@ -97,9 +97,9 @@
<string name="camera_compat_treatment_suggested_button_description" msgid="8103916969024076767">"කැමරා ගැටලුද?\nයළි සවි කිරීමට තට්ටු කරන්න"</string>
<string name="camera_compat_treatment_applied_button_description" msgid="2944157113330703897">"එය විසඳුවේ නැතිද?\nප්‍රතිවර්තනය කිරීමට තට්ටු කරන්න"</string>
<string name="camera_compat_dismiss_button_description" msgid="2795364433503817511">"කැමරා ගැටලු නොමැතිද? ඉවත දැමීමට තට්ටු කරන්න"</string>
- <string name="windowing_app_handle_education_tooltip" msgid="6398482412956375783">"යෙදුම් මෙනුව විවෘත කිරීමට තට්ටු කරන්න"</string>
- <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="6285279585554484957">"යෙදුම් කිහිපයක් එකට පෙන්වීමට තට්ටු කරන්න"</string>
- <string name="windowing_desktop_mode_exit_education_tooltip" msgid="6685429075790085337">"යෙදුම් මෙනුවෙන් පූර්ණ තිරය වෙත ආපසු යන්න"</string>
+ <string name="windowing_app_handle_education_tooltip" msgid="2929643449849791854">"යෙදුම් මෙනුව මෙතැනින් සොයා ගත හැක"</string>
+ <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="2523468503353474095">"යෙදුම් කිහිපයක් එකට විවෘත කිරීමට ඩෙස්ක්ටොප් දසුනට ඇතුළු වන්න"</string>
+ <string name="windowing_desktop_mode_exit_education_tooltip" msgid="5225660258192054132">"යෙදුම් මෙනුවෙන් ඕනෑම වේලාවක පූර්ණ තිරය වෙත ආපසු යන්න"</string>
<string name="letterbox_education_dialog_title" msgid="7739895354143295358">"බලන්න සහ තවත් දේ කරන්න"</string>
<string name="letterbox_education_split_screen_text" msgid="449233070804658627">"බෙදුම් තිරය සඳහා වෙනත් යෙදුමකට අදින්න"</string>
<string name="letterbox_education_reposition_text" msgid="4589957299813220661">"යෙදුමක් නැවත ස්ථානගත කිරීමට පිටතින් දෙවරක් තට්ටු කරන්න"</string>
diff --git a/libs/WindowManager/Shell/res/values-sk/strings.xml b/libs/WindowManager/Shell/res/values-sk/strings.xml
index 7d1a408f3172..1b3907e5775b 100644
--- a/libs/WindowManager/Shell/res/values-sk/strings.xml
+++ b/libs/WindowManager/Shell/res/values-sk/strings.xml
@@ -97,9 +97,9 @@
<string name="camera_compat_treatment_suggested_button_description" msgid="8103916969024076767">"Problémy s kamerou?\nKlepnutím znova upravte."</string>
<string name="camera_compat_treatment_applied_button_description" msgid="2944157113330703897">"Nevyriešilo sa to?\nKlepnutím sa vráťte."</string>
<string name="camera_compat_dismiss_button_description" msgid="2795364433503817511">"Nemáte problémy s kamerou? Klepnutím zatvoríte."</string>
- <string name="windowing_app_handle_education_tooltip" msgid="6398482412956375783">"Klepnúť a otvoriť tak ponuku aplikácií"</string>
- <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="6285279585554484957">"Klepnúť a zobraziť tak viacero aplikácií naraz"</string>
- <string name="windowing_desktop_mode_exit_education_tooltip" msgid="6685429075790085337">"Prejsť späť na celú obrazovku z ponuky aplikácií"</string>
+ <string name="windowing_app_handle_education_tooltip" msgid="2929643449849791854">"Ponuku aplikácie nájdete tu"</string>
+ <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="2523468503353474095">"Prejdite do zobrazenia v počítači a otvorte viac aplikácií naraz"</string>
+ <string name="windowing_desktop_mode_exit_education_tooltip" msgid="5225660258192054132">"Z ponuky aplikácie sa môžete kedykoľvek vrátiť na celú obrazovku"</string>
<string name="letterbox_education_dialog_title" msgid="7739895354143295358">"Zobrazte si a zvládnite toho viac"</string>
<string name="letterbox_education_split_screen_text" msgid="449233070804658627">"Rozdelenú obrazovku môžete použiť presunutím do inej aplikácie"</string>
<string name="letterbox_education_reposition_text" msgid="4589957299813220661">"Dvojitým klepnutím mimo aplikácie zmeníte jej pozíciu"</string>
diff --git a/libs/WindowManager/Shell/res/values-sl/strings.xml b/libs/WindowManager/Shell/res/values-sl/strings.xml
index a50397f0e973..0a1b4a691313 100644
--- a/libs/WindowManager/Shell/res/values-sl/strings.xml
+++ b/libs/WindowManager/Shell/res/values-sl/strings.xml
@@ -97,9 +97,9 @@
<string name="camera_compat_treatment_suggested_button_description" msgid="8103916969024076767">"Težave s fotoaparatom?\nDotaknite se za vnovično prilagoditev"</string>
<string name="camera_compat_treatment_applied_button_description" msgid="2944157113330703897">"To ni odpravilo težave?\nDotaknite se za povrnitev"</string>
<string name="camera_compat_dismiss_button_description" msgid="2795364433503817511">"Nimate težav s fotoaparatom? Dotaknite se za opustitev."</string>
- <string name="windowing_app_handle_education_tooltip" msgid="6398482412956375783">"Dotaknite se, če želite odpreti meni aplikacije"</string>
- <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="6285279585554484957">"Dotaknite se, če želite prikazati več aplikacij hkrati"</string>
- <string name="windowing_desktop_mode_exit_education_tooltip" msgid="6685429075790085337">"Nazaj v celozaslonski način iz menija aplikacije"</string>
+ <string name="windowing_app_handle_education_tooltip" msgid="2929643449849791854">"Meni aplikacije najdete tukaj"</string>
+ <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="2523468503353474095">"Preklopite v pogled za namizni računalnik, če želite odpreti več aplikacij hkrati"</string>
+ <string name="windowing_desktop_mode_exit_education_tooltip" msgid="5225660258192054132">"V meniju aplikacije se lahko kadar koli vrnete v celozaslonski način"</string>
<string name="letterbox_education_dialog_title" msgid="7739895354143295358">"Oglejte si in naredite več"</string>
<string name="letterbox_education_split_screen_text" msgid="449233070804658627">"Za razdeljeni zaslon povlecite sem še eno aplikacijo."</string>
<string name="letterbox_education_reposition_text" msgid="4589957299813220661">"Dvakrat se dotaknite zunaj aplikacije, če jo želite prestaviti."</string>
diff --git a/libs/WindowManager/Shell/res/values-sq/strings.xml b/libs/WindowManager/Shell/res/values-sq/strings.xml
index 480e2a4d7f68..75120d2418b5 100644
--- a/libs/WindowManager/Shell/res/values-sq/strings.xml
+++ b/libs/WindowManager/Shell/res/values-sq/strings.xml
@@ -97,9 +97,9 @@
<string name="camera_compat_treatment_suggested_button_description" msgid="8103916969024076767">"Ka probleme me kamerën?\nTrokit për ta ripërshtatur"</string>
<string name="camera_compat_treatment_applied_button_description" msgid="2944157113330703897">"Nuk u rregullua?\nTrokit për ta rikthyer"</string>
<string name="camera_compat_dismiss_button_description" msgid="2795364433503817511">"Nuk ka probleme me kamerën? Trokit për ta shpërfillur."</string>
- <string name="windowing_app_handle_education_tooltip" msgid="6398482412956375783">"Trokit për të hapur menynë e aplikacionit"</string>
- <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="6285279585554484957">"Trokit për të shfaqur disa aplikacione bashkë"</string>
- <string name="windowing_desktop_mode_exit_education_tooltip" msgid="6685429075790085337">"Kthehu tek ekrani i plotë nga menyja e aplikacionit"</string>
+ <string name="windowing_app_handle_education_tooltip" msgid="2929643449849791854">"Menyja e aplikacioneve mund të gjendet këtu"</string>
+ <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="2523468503353474095">"Kalo te pamja e desktopit për të hapur disa aplikacione së bashku"</string>
+ <string name="windowing_desktop_mode_exit_education_tooltip" msgid="5225660258192054132">"Kthehu tek ekrani i plotë në çdo kohë nga menyja e aplikacioneve"</string>
<string name="letterbox_education_dialog_title" msgid="7739895354143295358">"Shiko dhe bëj më shumë"</string>
<string name="letterbox_education_split_screen_text" msgid="449233070804658627">"Zvarrite në një aplikacion tjetër për ekranin e ndarë"</string>
<string name="letterbox_education_reposition_text" msgid="4589957299813220661">"Trokit dy herë jashtë një aplikacioni për ta ripozicionuar"</string>
@@ -136,14 +136,9 @@
<string name="desktop_mode_maximize_menu_maximize_button_text" msgid="3090199175564175845">"Maksimizo"</string>
<string name="desktop_mode_maximize_menu_snap_left_button_text" msgid="8077452201179893424">"Zhvendos majtas"</string>
<string name="desktop_mode_maximize_menu_snap_right_button_text" msgid="7117751068945657304">"Zhvendos djathtas"</string>
- <!-- no translation found for open_by_default_settings_text (2526548548598185500) -->
- <skip />
- <!-- no translation found for open_by_default_dialog_subheader_text (1729599730664063881) -->
- <skip />
- <!-- no translation found for open_by_default_dialog_in_app_text (6978022419634199806) -->
- <skip />
- <!-- no translation found for open_by_default_dialog_in_browser_text (8042769465958497081) -->
- <skip />
- <!-- no translation found for open_by_default_dialog_dismiss_button_text (3487238795534582291) -->
- <skip />
+ <string name="open_by_default_settings_text" msgid="2526548548598185500">"Hap sipas cilësimeve të parazgjedhura"</string>
+ <string name="open_by_default_dialog_subheader_text" msgid="1729599730664063881">"Zgjidh si do t\'i hapësh lidhjet e uebit për këtë aplikacion"</string>
+ <string name="open_by_default_dialog_in_app_text" msgid="6978022419634199806">"Në aplikacion"</string>
+ <string name="open_by_default_dialog_in_browser_text" msgid="8042769465958497081">"Në shfletuesin tënd"</string>
+ <string name="open_by_default_dialog_dismiss_button_text" msgid="3487238795534582291">"Në rregull"</string>
</resources>
diff --git a/libs/WindowManager/Shell/res/values-sr/strings.xml b/libs/WindowManager/Shell/res/values-sr/strings.xml
index d8debc01cae2..8b5c4dfff363 100644
--- a/libs/WindowManager/Shell/res/values-sr/strings.xml
+++ b/libs/WindowManager/Shell/res/values-sr/strings.xml
@@ -97,9 +97,9 @@
<string name="camera_compat_treatment_suggested_button_description" msgid="8103916969024076767">"Имате проблема са камером?\nДодирните да бисте поново уклопили"</string>
<string name="camera_compat_treatment_applied_button_description" msgid="2944157113330703897">"Проблем није решен?\nДодирните да бисте вратили"</string>
<string name="camera_compat_dismiss_button_description" msgid="2795364433503817511">"Немате проблема са камером? Додирните да бисте одбацили."</string>
- <string name="windowing_app_handle_education_tooltip" msgid="6398482412956375783">"Додирните да бисте отворили мени апликације"</string>
- <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="6285279585554484957">"Додирните да бисте приказали више апликација заједно"</string>
- <string name="windowing_desktop_mode_exit_education_tooltip" msgid="6685429075790085337">"Вратите се из менија апликације на приказ преко целог екрана"</string>
+ <string name="windowing_app_handle_education_tooltip" msgid="2929643449849791854">"Мени апликације можете да пронађете овде"</string>
+ <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="2523468503353474095">"Уђите у приказ за рачунаре да бисте истовремено отворили више апликација"</string>
+ <string name="windowing_desktop_mode_exit_education_tooltip" msgid="5225660258192054132">"Вратите се на цео екран било када из менија апликације"</string>
<string name="letterbox_education_dialog_title" msgid="7739895354143295358">"Видите и урадите више"</string>
<string name="letterbox_education_split_screen_text" msgid="449233070804658627">"Превуците другу апликацију да бисте користили подељени екран"</string>
<string name="letterbox_education_reposition_text" msgid="4589957299813220661">"Двапут додирните изван апликације да бисте променили њену позицију"</string>
diff --git a/libs/WindowManager/Shell/res/values-sv/strings.xml b/libs/WindowManager/Shell/res/values-sv/strings.xml
index e262a9b477d3..e40b6492fc71 100644
--- a/libs/WindowManager/Shell/res/values-sv/strings.xml
+++ b/libs/WindowManager/Shell/res/values-sv/strings.xml
@@ -97,9 +97,9 @@
<string name="camera_compat_treatment_suggested_button_description" msgid="8103916969024076767">"Problem med kameran?\nTryck för att anpassa på nytt"</string>
<string name="camera_compat_treatment_applied_button_description" msgid="2944157113330703897">"Löstes inte problemet?\nTryck för att återställa"</string>
<string name="camera_compat_dismiss_button_description" msgid="2795364433503817511">"Inga problem med kameran? Tryck för att ignorera."</string>
- <string name="windowing_app_handle_education_tooltip" msgid="6398482412956375783">"Tryck för att öppna appmenyn"</string>
- <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="6285279585554484957">"Tryck för att visa flera appar tillsammans"</string>
- <string name="windowing_desktop_mode_exit_education_tooltip" msgid="6685429075790085337">"Återgå till helskärm från appmenyn"</string>
+ <string name="windowing_app_handle_education_tooltip" msgid="2929643449849791854">"Appmenyn finns här"</string>
+ <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="2523468503353474095">"Starta datorvyn för att öppna flera appar samtidigt"</string>
+ <string name="windowing_desktop_mode_exit_education_tooltip" msgid="5225660258192054132">"Återgå till helskärm när som helst från appmenyn"</string>
<string name="letterbox_education_dialog_title" msgid="7739895354143295358">"Se och gör mer"</string>
<string name="letterbox_education_split_screen_text" msgid="449233070804658627">"Dra till en annan app för att dela upp skärmen"</string>
<string name="letterbox_education_reposition_text" msgid="4589957299813220661">"Tryck snabbt två gånger utanför en app för att flytta den"</string>
@@ -136,7 +136,7 @@
<string name="desktop_mode_maximize_menu_maximize_button_text" msgid="3090199175564175845">"Utöka"</string>
<string name="desktop_mode_maximize_menu_snap_left_button_text" msgid="8077452201179893424">"Fäst till vänster"</string>
<string name="desktop_mode_maximize_menu_snap_right_button_text" msgid="7117751068945657304">"Fäst till höger"</string>
- <string name="open_by_default_settings_text" msgid="2526548548598185500">"Inställningar för öppna som standard"</string>
+ <string name="open_by_default_settings_text" msgid="2526548548598185500">"Inställningar för Öppna som standard"</string>
<string name="open_by_default_dialog_subheader_text" msgid="1729599730664063881">"Välj hur webblänkar ska öppnas för den här appen"</string>
<string name="open_by_default_dialog_in_app_text" msgid="6978022419634199806">"I appen"</string>
<string name="open_by_default_dialog_in_browser_text" msgid="8042769465958497081">"I webbläsaren"</string>
diff --git a/libs/WindowManager/Shell/res/values-sw/strings.xml b/libs/WindowManager/Shell/res/values-sw/strings.xml
index b1679c078aac..e63229ccf2cd 100644
--- a/libs/WindowManager/Shell/res/values-sw/strings.xml
+++ b/libs/WindowManager/Shell/res/values-sw/strings.xml
@@ -97,9 +97,9 @@
<string name="camera_compat_treatment_suggested_button_description" msgid="8103916969024076767">"Je, kuna hitilafu za kamera?\nGusa ili urekebishe"</string>
<string name="camera_compat_treatment_applied_button_description" msgid="2944157113330703897">"Umeshindwa kurekebisha?\nGusa ili urejeshe nakala ya awali"</string>
<string name="camera_compat_dismiss_button_description" msgid="2795364433503817511">"Je, hakuna hitilafu za kamera? Gusa ili uondoe."</string>
- <string name="windowing_app_handle_education_tooltip" msgid="6398482412956375783">"Gusa ili ufungue menyu ya programu"</string>
- <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="6285279585554484957">"Gusa ili uonyeshe programu nyingi kwa pamoja"</string>
- <string name="windowing_desktop_mode_exit_education_tooltip" msgid="6685429075790085337">"Rudi kwenye skrini nzima katika menyu ya programu"</string>
+ <string name="windowing_app_handle_education_tooltip" msgid="2929643449849791854">"Unaweza kupata menyu ya programu hapa"</string>
+ <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="2523468503353474095">"Tumia mwonekano wa kompyuta ili ufungue programu nyingi pamoja"</string>
+ <string name="windowing_desktop_mode_exit_education_tooltip" msgid="5225660258192054132">"Rudi kwenye skrini nzima wakati wowote ukitumia menyu ya programu"</string>
<string name="letterbox_education_dialog_title" msgid="7739895354143295358">"Angalia na ufanye zaidi"</string>
<string name="letterbox_education_split_screen_text" msgid="449233070804658627">"Buruta katika programu nyingine ili utumie skrini iliyogawanywa"</string>
<string name="letterbox_education_reposition_text" msgid="4589957299813220661">"Gusa mara mbili nje ya programu ili uihamishe"</string>
diff --git a/libs/WindowManager/Shell/res/values-ta/strings.xml b/libs/WindowManager/Shell/res/values-ta/strings.xml
index 8df170df794b..95972f1f9486 100644
--- a/libs/WindowManager/Shell/res/values-ta/strings.xml
+++ b/libs/WindowManager/Shell/res/values-ta/strings.xml
@@ -97,9 +97,9 @@
<string name="camera_compat_treatment_suggested_button_description" msgid="8103916969024076767">"கேமரா தொடர்பான சிக்கல்களா?\nமீண்டும் பொருத்த தட்டவும்"</string>
<string name="camera_compat_treatment_applied_button_description" msgid="2944157113330703897">"சிக்கல்கள் சரிசெய்யப்படவில்லையா?\nமாற்றியமைக்க தட்டவும்"</string>
<string name="camera_compat_dismiss_button_description" msgid="2795364433503817511">"கேமரா தொடர்பான சிக்கல்கள் எதுவும் இல்லையா? நிராகரிக்க தட்டவும்."</string>
- <string name="windowing_app_handle_education_tooltip" msgid="6398482412956375783">"ஆப்ஸ் மெனுவைத் திறக்க தட்டவும்"</string>
- <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="6285279585554484957">"பல ஆப்ஸை ஒன்றாகக் காட்ட தட்டவும்"</string>
- <string name="windowing_desktop_mode_exit_education_tooltip" msgid="6685429075790085337">"ஆப்ஸ் மெனுவில் இருந்து முழுத்திரைக்குச் செல்லும்"</string>
+ <string name="windowing_app_handle_education_tooltip" msgid="2929643449849791854">"ஆப்ஸ் மெனுவை இங்கே பார்க்கலாம்"</string>
+ <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="2523468503353474095">"பல ஆப்ஸை ஒன்றாகத் திறக்க டெஸ்க்டாப் காட்சிக்குச் செல்லலாம்"</string>
+ <string name="windowing_desktop_mode_exit_education_tooltip" msgid="5225660258192054132">"ஆப்ஸ் மெனுவிலிருந்து எப்போது வேண்டுமானாலும் முழுத்திரைக்குத் திரும்பலாம்"</string>
<string name="letterbox_education_dialog_title" msgid="7739895354143295358">"பலவற்றைப் பார்த்தல் மற்றும் செய்தல்"</string>
<string name="letterbox_education_split_screen_text" msgid="449233070804658627">"திரைப் பிரிப்புக்கு மற்றொரு ஆப்ஸை இழுக்கலாம்"</string>
<string name="letterbox_education_reposition_text" msgid="4589957299813220661">"ஆப்ஸை இடம் மாற்ற அதன் வெளியில் இருமுறை தட்டலாம்"</string>
diff --git a/libs/WindowManager/Shell/res/values-te/strings.xml b/libs/WindowManager/Shell/res/values-te/strings.xml
index 82523b68308a..6223c83d7599 100644
--- a/libs/WindowManager/Shell/res/values-te/strings.xml
+++ b/libs/WindowManager/Shell/res/values-te/strings.xml
@@ -97,9 +97,9 @@
<string name="camera_compat_treatment_suggested_button_description" msgid="8103916969024076767">"కెమెరా సమస్యలు ఉన్నాయా?\nరీఫిట్ చేయడానికి ట్యాప్ చేయండి"</string>
<string name="camera_compat_treatment_applied_button_description" msgid="2944157113330703897">"దాని సమస్యను పరిష్కరించలేదా?\nపూర్వస్థితికి మార్చడానికి ట్యాప్ చేయండి"</string>
<string name="camera_compat_dismiss_button_description" msgid="2795364433503817511">"కెమెరా సమస్యలు లేవా? తీసివేయడానికి ట్యాప్ చేయండి."</string>
- <string name="windowing_app_handle_education_tooltip" msgid="6398482412956375783">"యాప్ మెనూని తెరవడానికి ట్యాప్ చేయండి"</string>
- <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="6285279585554484957">"పలు యాప్‌లను కలిపి చూడటానికి ట్యాప్ చేయండి"</string>
- <string name="windowing_desktop_mode_exit_education_tooltip" msgid="6685429075790085337">"యాప్ మెనూ నుండి ఫుల్ స్క్రీన్‌కు తిరిగి రండి"</string>
+ <string name="windowing_app_handle_education_tooltip" msgid="2929643449849791854">"యాప్ మెనూను ఇక్కడ పొందవచ్చు"</string>
+ <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="2523468503353474095">"పలు యాప్‌లను ఒకేసారి తెరవడానికి డెస్క్‌టాప్ వీక్షణకు ఎంటర్ అవ్వండి"</string>
+ <string name="windowing_desktop_mode_exit_education_tooltip" msgid="5225660258192054132">"యాప్ మెనూ నుండి ఏ సమయంలోనైనా ఫుల్ స్క్రీన్‌కు తిరిగి రండి"</string>
<string name="letterbox_education_dialog_title" msgid="7739895354143295358">"చూసి, మరిన్ని చేయండి"</string>
<string name="letterbox_education_split_screen_text" msgid="449233070804658627">"స్ప్లిట్ స్క్రీన్ కోసం మరొక యాప్‌లోకి లాగండి"</string>
<string name="letterbox_education_reposition_text" msgid="4589957299813220661">"యాప్ స్థానాన్ని మార్చడానికి దాని వెలుపల డబుల్-ట్యాప్ చేయండి"</string>
diff --git a/libs/WindowManager/Shell/res/values-th/strings.xml b/libs/WindowManager/Shell/res/values-th/strings.xml
index cc7a60384bf6..f74499c0ddbf 100644
--- a/libs/WindowManager/Shell/res/values-th/strings.xml
+++ b/libs/WindowManager/Shell/res/values-th/strings.xml
@@ -97,9 +97,9 @@
<string name="camera_compat_treatment_suggested_button_description" msgid="8103916969024076767">"หากพบปัญหากับกล้อง\nแตะเพื่อแก้ไข"</string>
<string name="camera_compat_treatment_applied_button_description" msgid="2944157113330703897">"หากไม่ได้แก้ไข\nแตะเพื่อเปลี่ยนกลับ"</string>
<string name="camera_compat_dismiss_button_description" msgid="2795364433503817511">"หากไม่พบปัญหากับกล้อง แตะเพื่อปิด"</string>
- <string name="windowing_app_handle_education_tooltip" msgid="6398482412956375783">"แตะเพื่อเปิดเมนูแอป"</string>
- <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="6285279585554484957">"แตะเพื่อแสดงแอปหลายรายการพร้อมกัน"</string>
- <string name="windowing_desktop_mode_exit_education_tooltip" msgid="6685429075790085337">"กลับไปที่เต็มหน้าจอจากเมนูแอป"</string>
+ <string name="windowing_app_handle_education_tooltip" msgid="2929643449849791854">"ดูเมนูแอปที่นี่ได้"</string>
+ <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="2523468503353474095">"เข้าสู่มุมมองบนเดสก์ท็อปเพื่อเปิดหลายแอปพร้อมกัน"</string>
+ <string name="windowing_desktop_mode_exit_education_tooltip" msgid="5225660258192054132">"กลับไปที่โหมดเต็มหน้าจอได้ทุกเมื่อจากเมนูแอป"</string>
<string name="letterbox_education_dialog_title" msgid="7739895354143295358">"รับชมและทำสิ่งต่างๆ ได้มากขึ้น"</string>
<string name="letterbox_education_split_screen_text" msgid="449233070804658627">"ลากไปไว้ในแอปอื่นเพื่อแยกหน้าจอ"</string>
<string name="letterbox_education_reposition_text" msgid="4589957299813220661">"แตะสองครั้งด้านนอกแอปเพื่อเปลี่ยนตำแหน่ง"</string>
diff --git a/libs/WindowManager/Shell/res/values-tl/strings.xml b/libs/WindowManager/Shell/res/values-tl/strings.xml
index bb543f3f6ee9..7d984e0a1c14 100644
--- a/libs/WindowManager/Shell/res/values-tl/strings.xml
+++ b/libs/WindowManager/Shell/res/values-tl/strings.xml
@@ -97,9 +97,9 @@
<string name="camera_compat_treatment_suggested_button_description" msgid="8103916969024076767">"May mga isyu sa camera?\nI-tap para i-refit"</string>
<string name="camera_compat_treatment_applied_button_description" msgid="2944157113330703897">"Hindi ito naayos?\nI-tap para i-revert"</string>
<string name="camera_compat_dismiss_button_description" msgid="2795364433503817511">"Walang isyu sa camera? I-tap para i-dismiss."</string>
- <string name="windowing_app_handle_education_tooltip" msgid="6398482412956375783">"I-tap para buksan ang menu ng app"</string>
- <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="6285279585554484957">"I-tap para ipakita nang magkakasama ang maraming app"</string>
- <string name="windowing_desktop_mode_exit_education_tooltip" msgid="6685429075790085337">"Bumalik sa fullscreen mula sa menu ng app"</string>
+ <string name="windowing_app_handle_education_tooltip" msgid="2929643449849791854">"Makikita rito ang menu ng app"</string>
+ <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="2523468503353474095">"Pumasok sa desktop view para magbukas ng maraming app nang sabay-sabay"</string>
+ <string name="windowing_desktop_mode_exit_education_tooltip" msgid="5225660258192054132">"Bumalik sa full screen anumang oras mula sa menu ng app"</string>
<string name="letterbox_education_dialog_title" msgid="7739895354143295358">"Tumingin at gumawa ng higit pa"</string>
<string name="letterbox_education_split_screen_text" msgid="449233070804658627">"Mag-drag ng isa pang app para sa split screen"</string>
<string name="letterbox_education_reposition_text" msgid="4589957299813220661">"Mag-double tap sa labas ng app para baguhin ang posisyon nito"</string>
diff --git a/libs/WindowManager/Shell/res/values-tr/strings.xml b/libs/WindowManager/Shell/res/values-tr/strings.xml
index c8dcefbe3728..ba186aae80c8 100644
--- a/libs/WindowManager/Shell/res/values-tr/strings.xml
+++ b/libs/WindowManager/Shell/res/values-tr/strings.xml
@@ -97,9 +97,9 @@
<string name="camera_compat_treatment_suggested_button_description" msgid="8103916969024076767">"Kameranızda sorun mu var?\nDüzeltmek için dokunun"</string>
<string name="camera_compat_treatment_applied_button_description" msgid="2944157113330703897">"Bu işlem sorunu düzeltmedi mi?\nİşlemi geri almak için dokunun"</string>
<string name="camera_compat_dismiss_button_description" msgid="2795364433503817511">"Kameranızda sorun yok mu? Kapatmak için dokunun."</string>
- <string name="windowing_app_handle_education_tooltip" msgid="6398482412956375783">"Uygulama menüsünü açmak için dokunun"</string>
- <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="6285279585554484957">"Birden fazla uygulamayı birlikte göstermek için dokunun"</string>
- <string name="windowing_desktop_mode_exit_education_tooltip" msgid="6685429075790085337">"Uygulama menüsünden tam ekrana dönün"</string>
+ <string name="windowing_app_handle_education_tooltip" msgid="2929643449849791854">"Uygulama menüsünü burada bulabilirsiniz"</string>
+ <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="2523468503353474095">"Birden fazla uygulamayı birlikte açmak için masaüstü görünümüne geçin"</string>
+ <string name="windowing_desktop_mode_exit_education_tooltip" msgid="5225660258192054132">"Uygulama menüsünden dilediğiniz zaman tam ekrana dönebilirsiniz"</string>
<string name="letterbox_education_dialog_title" msgid="7739895354143295358">"Daha fazlasını görün ve yapın"</string>
<string name="letterbox_education_split_screen_text" msgid="449233070804658627">"Bölünmüş ekran için başka bir uygulamayı sürükleyin"</string>
<string name="letterbox_education_reposition_text" msgid="4589957299813220661">"Yeniden konumlandırmak için uygulamanın dışına iki kez dokunun"</string>
diff --git a/libs/WindowManager/Shell/res/values-uk/strings.xml b/libs/WindowManager/Shell/res/values-uk/strings.xml
index 90a3bc33b3e2..756e64da4574 100644
--- a/libs/WindowManager/Shell/res/values-uk/strings.xml
+++ b/libs/WindowManager/Shell/res/values-uk/strings.xml
@@ -97,9 +97,9 @@
<string name="camera_compat_treatment_suggested_button_description" msgid="8103916969024076767">"Проблеми з камерою?\nНатисніть, щоб пристосувати"</string>
<string name="camera_compat_treatment_applied_button_description" msgid="2944157113330703897">"Проблему не вирішено?\nНатисніть, щоб скасувати зміни"</string>
<string name="camera_compat_dismiss_button_description" msgid="2795364433503817511">"Немає проблем із камерою? Торкніться, щоб закрити."</string>
- <string name="windowing_app_handle_education_tooltip" msgid="6398482412956375783">"Натисніть, щоб відкрити меню додатка"</string>
- <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="6285279585554484957">"Натисніть, щоб переглянути кілька додатків одночасно"</string>
- <string name="windowing_desktop_mode_exit_education_tooltip" msgid="6685429075790085337">"Повернутися з меню додатка в повноекранний режим"</string>
+ <string name="windowing_app_handle_education_tooltip" msgid="2929643449849791854">"Тут ви знайдете меню додатка"</string>
+ <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="2523468503353474095">"Щоб відкрити кілька додатків одночасно, перейдіть у режим робочого стола"</string>
+ <string name="windowing_desktop_mode_exit_education_tooltip" msgid="5225660258192054132">"З меню додатка можна будь-коли повернутися в повноекранний режим"</string>
<string name="letterbox_education_dialog_title" msgid="7739895354143295358">"Більше простору та можливостей"</string>
<string name="letterbox_education_split_screen_text" msgid="449233070804658627">"Щоб перейти в режим розділення екрана, перетягніть сюди інший додаток"</string>
<string name="letterbox_education_reposition_text" msgid="4589957299813220661">"Щоб перемістити додаток, двічі торкніться області поза ним"</string>
@@ -136,14 +136,9 @@
<string name="desktop_mode_maximize_menu_maximize_button_text" msgid="3090199175564175845">"Розгорнути"</string>
<string name="desktop_mode_maximize_menu_snap_left_button_text" msgid="8077452201179893424">"Закріпити ліворуч"</string>
<string name="desktop_mode_maximize_menu_snap_right_button_text" msgid="7117751068945657304">"Закріпити праворуч"</string>
- <!-- no translation found for open_by_default_settings_text (2526548548598185500) -->
- <skip />
- <!-- no translation found for open_by_default_dialog_subheader_text (1729599730664063881) -->
- <skip />
- <!-- no translation found for open_by_default_dialog_in_app_text (6978022419634199806) -->
- <skip />
- <!-- no translation found for open_by_default_dialog_in_browser_text (8042769465958497081) -->
- <skip />
- <!-- no translation found for open_by_default_dialog_dismiss_button_text (3487238795534582291) -->
- <skip />
+ <string name="open_by_default_settings_text" msgid="2526548548598185500">"Налаштування \"Відкривати за умовчанням\""</string>
+ <string name="open_by_default_dialog_subheader_text" msgid="1729599730664063881">"Виберіть, як відкривати вебпосилання в цьому додатку"</string>
+ <string name="open_by_default_dialog_in_app_text" msgid="6978022419634199806">"У додатку"</string>
+ <string name="open_by_default_dialog_in_browser_text" msgid="8042769465958497081">"У вебпереглядачі"</string>
+ <string name="open_by_default_dialog_dismiss_button_text" msgid="3487238795534582291">"OK"</string>
</resources>
diff --git a/libs/WindowManager/Shell/res/values-ur/strings.xml b/libs/WindowManager/Shell/res/values-ur/strings.xml
index eca6801a6af3..8aaa306a2ada 100644
--- a/libs/WindowManager/Shell/res/values-ur/strings.xml
+++ b/libs/WindowManager/Shell/res/values-ur/strings.xml
@@ -97,9 +97,9 @@
<string name="camera_compat_treatment_suggested_button_description" msgid="8103916969024076767">"کیمرے کے مسائل؟\nدوبارہ فٹ کرنے کیلئے تھپتھپائیں"</string>
<string name="camera_compat_treatment_applied_button_description" msgid="2944157113330703897">"یہ حل نہیں ہوا؟\nلوٹانے کیلئے تھپتھپائیں"</string>
<string name="camera_compat_dismiss_button_description" msgid="2795364433503817511">"کوئی کیمرے کا مسئلہ نہیں ہے؟ برخاست کرنے کیلئے تھپتھپائیں۔"</string>
- <string name="windowing_app_handle_education_tooltip" msgid="6398482412956375783">"ایپ مینو کھولنے کیلئے تھپتھپائیں"</string>
- <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="6285279585554484957">"متعدد ایپس ایک ساتھ دکھانے کیلئے تھپتھپائیں"</string>
- <string name="windowing_desktop_mode_exit_education_tooltip" msgid="6685429075790085337">"ایپ مینو سے مکمل اسکرین پر واپس جائیں"</string>
+ <string name="windowing_app_handle_education_tooltip" msgid="2929643449849791854">"ایپ کا مینو یہاں پایا جا سکتا ہے"</string>
+ <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="2523468503353474095">"متعدد ایپس کو ایک ساتھ کھولنے کے لیے ڈیسک ٹاپ منظر میں داخل ہوں"</string>
+ <string name="windowing_desktop_mode_exit_education_tooltip" msgid="5225660258192054132">"ایپ مینو سے کسی بھی وقت فُل اسکرین پر واپس جائیں"</string>
<string name="letterbox_education_dialog_title" msgid="7739895354143295358">"دیکھیں اور بہت کچھ کریں"</string>
<string name="letterbox_education_split_screen_text" msgid="449233070804658627">"اسپلٹ اسکرین کے ليے دوسری ایپ میں گھسیٹیں"</string>
<string name="letterbox_education_reposition_text" msgid="4589957299813220661">"کسی ایپ کی پوزیشن تبدیل کرنے کے لیے اس ایپ کے باہر دو بار تھپتھپائیں"</string>
diff --git a/libs/WindowManager/Shell/res/values-uz/strings.xml b/libs/WindowManager/Shell/res/values-uz/strings.xml
index 4b163f79f970..4e4a58ba25dc 100644
--- a/libs/WindowManager/Shell/res/values-uz/strings.xml
+++ b/libs/WindowManager/Shell/res/values-uz/strings.xml
@@ -97,9 +97,9 @@
<string name="camera_compat_treatment_suggested_button_description" msgid="8103916969024076767">"Kamera nosozmi?\nQayta moslash uchun bosing"</string>
<string name="camera_compat_treatment_applied_button_description" msgid="2944157113330703897">"Tuzatilmadimi?\nQaytarish uchun bosing"</string>
<string name="camera_compat_dismiss_button_description" msgid="2795364433503817511">"Kamera muammosizmi? Yopish uchun bosing."</string>
- <string name="windowing_app_handle_education_tooltip" msgid="6398482412956375783">"Ilova menyusini ochish uchun bosing"</string>
- <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="6285279585554484957">"Bir nechta ilovani birga chiqarish uchun bosing"</string>
- <string name="windowing_desktop_mode_exit_education_tooltip" msgid="6685429075790085337">"Ilova menyusidan butun ekranga qayting"</string>
+ <string name="windowing_app_handle_education_tooltip" msgid="2929643449849791854">"Ilova menyusi shu yerda chiqadi"</string>
+ <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="2523468503353474095">"Bir nechta ilovani birga ochish uchun kompyuter versiyasiga kiring"</string>
+ <string name="windowing_desktop_mode_exit_education_tooltip" msgid="5225660258192054132">"Ilova menyusi orqali istalganda butun ekranga qaytish mumkin"</string>
<string name="letterbox_education_dialog_title" msgid="7739895354143295358">"Yana boshqa amallar"</string>
<string name="letterbox_education_split_screen_text" msgid="449233070804658627">"Ekranni ikkiga ajratish uchun boshqa ilovani bu yerga torting"</string>
<string name="letterbox_education_reposition_text" msgid="4589957299813220661">"Qayta joylash uchun ilova tashqarisiga ikki marta bosing"</string>
@@ -136,14 +136,9 @@
<string name="desktop_mode_maximize_menu_maximize_button_text" msgid="3090199175564175845">"Yoyish"</string>
<string name="desktop_mode_maximize_menu_snap_left_button_text" msgid="8077452201179893424">"Chapga tortish"</string>
<string name="desktop_mode_maximize_menu_snap_right_button_text" msgid="7117751068945657304">"Oʻngga tortish"</string>
- <!-- no translation found for open_by_default_settings_text (2526548548598185500) -->
- <skip />
- <!-- no translation found for open_by_default_dialog_subheader_text (1729599730664063881) -->
- <skip />
- <!-- no translation found for open_by_default_dialog_in_app_text (6978022419634199806) -->
- <skip />
- <!-- no translation found for open_by_default_dialog_in_browser_text (8042769465958497081) -->
- <skip />
- <!-- no translation found for open_by_default_dialog_dismiss_button_text (3487238795534582291) -->
- <skip />
+ <string name="open_by_default_settings_text" msgid="2526548548598185500">"Birlamchi sozlamalar asosida ochish"</string>
+ <string name="open_by_default_dialog_subheader_text" msgid="1729599730664063881">"Bu ilovalardagi veb havolalar qanday ochilishini tanlang"</string>
+ <string name="open_by_default_dialog_in_app_text" msgid="6978022419634199806">"Ilovada"</string>
+ <string name="open_by_default_dialog_in_browser_text" msgid="8042769465958497081">"Brauzerda"</string>
+ <string name="open_by_default_dialog_dismiss_button_text" msgid="3487238795534582291">"OK"</string>
</resources>
diff --git a/libs/WindowManager/Shell/res/values-vi/strings.xml b/libs/WindowManager/Shell/res/values-vi/strings.xml
index e381c9860738..09a143af61a0 100644
--- a/libs/WindowManager/Shell/res/values-vi/strings.xml
+++ b/libs/WindowManager/Shell/res/values-vi/strings.xml
@@ -97,9 +97,9 @@
<string name="camera_compat_treatment_suggested_button_description" msgid="8103916969024076767">"Có vấn đề với máy ảnh?\nHãy nhấn để sửa lỗi"</string>
<string name="camera_compat_treatment_applied_button_description" msgid="2944157113330703897">"Bạn chưa khắc phục vấn đề?\nHãy nhấn để hủy bỏ"</string>
<string name="camera_compat_dismiss_button_description" msgid="2795364433503817511">"Không có vấn đề với máy ảnh? Hãy nhấn để đóng."</string>
- <string name="windowing_app_handle_education_tooltip" msgid="6398482412956375783">"Nhấn để mở trình đơn ứng dụng"</string>
- <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="6285279585554484957">"Nhấn để hiển thị nhiều ứng dụng cùng lúc"</string>
- <string name="windowing_desktop_mode_exit_education_tooltip" msgid="6685429075790085337">"Quay lại chế độ toàn màn hình từ trình đơn ứng dụng"</string>
+ <string name="windowing_app_handle_education_tooltip" msgid="2929643449849791854">"Bạn có thể tìm thấy trình đơn ứng dụng tại đây"</string>
+ <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="2523468503353474095">"Chuyển sang chế độ xem trên máy tính để bàn để mở nhiều ứng dụng cùng lúc"</string>
+ <string name="windowing_desktop_mode_exit_education_tooltip" msgid="5225660258192054132">"Trở về chế độ toàn màn hình bất cứ lúc nào từ trình đơn ứng dụng"</string>
<string name="letterbox_education_dialog_title" msgid="7739895354143295358">"Xem và làm được nhiều việc hơn"</string>
<string name="letterbox_education_split_screen_text" msgid="449233070804658627">"Kéo một ứng dụng khác vào để chia đôi màn hình"</string>
<string name="letterbox_education_reposition_text" msgid="4589957299813220661">"Nhấn đúp bên ngoài ứng dụng để đặt lại vị trí"</string>
diff --git a/libs/WindowManager/Shell/res/values-zh-rCN/strings.xml b/libs/WindowManager/Shell/res/values-zh-rCN/strings.xml
index e39a64df95fc..795febb0ee3f 100644
--- a/libs/WindowManager/Shell/res/values-zh-rCN/strings.xml
+++ b/libs/WindowManager/Shell/res/values-zh-rCN/strings.xml
@@ -97,9 +97,9 @@
<string name="camera_compat_treatment_suggested_button_description" msgid="8103916969024076767">"相机有问题?\n点按即可整修"</string>
<string name="camera_compat_treatment_applied_button_description" msgid="2944157113330703897">"没有解决此问题?\n点按即可恢复"</string>
<string name="camera_compat_dismiss_button_description" msgid="2795364433503817511">"相机没有问题?点按即可忽略。"</string>
- <string name="windowing_app_handle_education_tooltip" msgid="6398482412956375783">"点按可打开应用菜单"</string>
- <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="6285279585554484957">"点按可同时显示多个应用"</string>
- <string name="windowing_desktop_mode_exit_education_tooltip" msgid="6685429075790085337">"从应用菜单可返回到全屏"</string>
+ <string name="windowing_app_handle_education_tooltip" msgid="2929643449849791854">"您可以在此处找到应用菜单"</string>
+ <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="2523468503353474095">"进入桌面版视图可同时打开多个应用"</string>
+ <string name="windowing_desktop_mode_exit_education_tooltip" msgid="5225660258192054132">"随时从应用菜单返回全屏模式"</string>
<string name="letterbox_education_dialog_title" msgid="7739895354143295358">"查看和处理更多任务"</string>
<string name="letterbox_education_split_screen_text" msgid="449233070804658627">"拖入另一个应用,即可使用分屏模式"</string>
<string name="letterbox_education_reposition_text" msgid="4589957299813220661">"在某个应用外连续点按两次,即可调整它的位置"</string>
diff --git a/libs/WindowManager/Shell/res/values-zh-rHK/strings.xml b/libs/WindowManager/Shell/res/values-zh-rHK/strings.xml
index 6cd2567bda45..0c6ad618ec58 100644
--- a/libs/WindowManager/Shell/res/values-zh-rHK/strings.xml
+++ b/libs/WindowManager/Shell/res/values-zh-rHK/strings.xml
@@ -97,9 +97,9 @@
<string name="camera_compat_treatment_suggested_button_description" msgid="8103916969024076767">"相機有問題?\n輕按即可修正"</string>
<string name="camera_compat_treatment_applied_button_description" msgid="2944157113330703897">"未能修正問題?\n輕按即可還原"</string>
<string name="camera_compat_dismiss_button_description" msgid="2795364433503817511">"相機冇問題?㩒一下就可以即可閂咗佢。"</string>
- <string name="windowing_app_handle_education_tooltip" msgid="6398482412956375783">"輕按即可開啟應用程式選單"</string>
- <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="6285279585554484957">"輕按即可同時顯示多個應用程式"</string>
- <string name="windowing_desktop_mode_exit_education_tooltip" msgid="6685429075790085337">"從應用程式選單返回全螢幕"</string>
+ <string name="windowing_app_handle_education_tooltip" msgid="2929643449849791854">"你可在這裡找到應用程式選單"</string>
+ <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="2523468503353474095">"進入桌面電腦檢視模式以同時開啟多個應用程式"</string>
+ <string name="windowing_desktop_mode_exit_education_tooltip" msgid="5225660258192054132">"你可隨時從應用程式選單返回全螢幕"</string>
<string name="letterbox_education_dialog_title" msgid="7739895354143295358">"瀏覽更多內容及執行更多操作"</string>
<string name="letterbox_education_split_screen_text" msgid="449233070804658627">"拖入另一個應用程式即可分割螢幕"</string>
<string name="letterbox_education_reposition_text" msgid="4589957299813220661">"在應用程式外輕按兩下即可調整位置"</string>
diff --git a/libs/WindowManager/Shell/res/values-zh-rTW/strings.xml b/libs/WindowManager/Shell/res/values-zh-rTW/strings.xml
index c14f66449a0e..442a6feae787 100644
--- a/libs/WindowManager/Shell/res/values-zh-rTW/strings.xml
+++ b/libs/WindowManager/Shell/res/values-zh-rTW/strings.xml
@@ -97,9 +97,9 @@
<string name="camera_compat_treatment_suggested_button_description" msgid="8103916969024076767">"相機有問題嗎?\n輕觸即可修正"</string>
<string name="camera_compat_treatment_applied_button_description" msgid="2944157113330703897">"未修正問題嗎?\n輕觸即可還原"</string>
<string name="camera_compat_dismiss_button_description" msgid="2795364433503817511">"相機沒問題嗎?輕觸即可關閉。"</string>
- <string name="windowing_app_handle_education_tooltip" msgid="6398482412956375783">"輕觸即可開啟應用程式選單"</string>
- <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="6285279585554484957">"輕觸即可一次顯示多個應用程式"</string>
- <string name="windowing_desktop_mode_exit_education_tooltip" msgid="6685429075790085337">"從應用程式選單返回全螢幕"</string>
+ <string name="windowing_app_handle_education_tooltip" msgid="2929643449849791854">"你可以在這裡查看應用程式選單"</string>
+ <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="2523468503353474095">"進入電腦檢視畫面可以同時開啟多個應用程式"</string>
+ <string name="windowing_desktop_mode_exit_education_tooltip" msgid="5225660258192054132">"你隨時可以從應用程式選單返回全螢幕模式"</string>
<string name="letterbox_education_dialog_title" msgid="7739895354143295358">"瀏覽更多內容及執行更多操作"</string>
<string name="letterbox_education_split_screen_text" msgid="449233070804658627">"拖進另一個應用程式即可使用分割畫面模式"</string>
<string name="letterbox_education_reposition_text" msgid="4589957299813220661">"在應用程式外輕觸兩下即可調整位置"</string>
diff --git a/libs/WindowManager/Shell/res/values-zu/strings.xml b/libs/WindowManager/Shell/res/values-zu/strings.xml
index 70a35422982a..47613d451a33 100644
--- a/libs/WindowManager/Shell/res/values-zu/strings.xml
+++ b/libs/WindowManager/Shell/res/values-zu/strings.xml
@@ -97,9 +97,9 @@
<string name="camera_compat_treatment_suggested_button_description" msgid="8103916969024076767">"Izinkinga zekhamera?\nThepha ukuze uyilinganise kabusha"</string>
<string name="camera_compat_treatment_applied_button_description" msgid="2944157113330703897">"Akuyilungisanga?\nThepha ukuze ubuyele"</string>
<string name="camera_compat_dismiss_button_description" msgid="2795364433503817511">"Azikho izinkinga zekhamera? Thepha ukuze ucashise."</string>
- <string name="windowing_app_handle_education_tooltip" msgid="6398482412956375783">"Thepha ukuze uvule imenyu ye-app"</string>
- <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="6285279585554484957">"Thepha ukuze ubonise ama-app amaningi ndawonye"</string>
- <string name="windowing_desktop_mode_exit_education_tooltip" msgid="6685429075790085337">"Buyela esikrinini esigcwele ukusuka kumenyu ye-app"</string>
+ <string name="windowing_app_handle_education_tooltip" msgid="2929643449849791854">"Imenyu ye-app ingatholakala lapha"</string>
+ <string name="windowing_desktop_mode_image_button_education_tooltip" msgid="2523468503353474095">"Faka ukubuka kwedeskithophu ukuze uvule ama-app amaningi ndawonye"</string>
+ <string name="windowing_desktop_mode_exit_education_tooltip" msgid="5225660258192054132">"Buyela esikrinini esigcwele noma nini ukusuka kumenyu ye-app"</string>
<string name="letterbox_education_dialog_title" msgid="7739895354143295358">"Bona futhi wenze okuningi"</string>
<string name="letterbox_education_split_screen_text" msgid="449233070804658627">"Hudula kwenye i-app mayelana nokuhlukanisa isikrini"</string>
<string name="letterbox_education_reposition_text" msgid="4589957299813220661">"Thepha kabili ngaphandle kwe-app ukuze uyimise kabusha"</string>
diff --git a/libs/WindowManager/Shell/res/values/styles.xml b/libs/WindowManager/Shell/res/values/styles.xml
index d061ae1ef1a7..55cda783005f 100644
--- a/libs/WindowManager/Shell/res/values/styles.xml
+++ b/libs/WindowManager/Shell/res/values/styles.xml
@@ -43,7 +43,8 @@
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">52dp</item>
<item name="android:gravity">start|center_vertical</item>
- <item name="android:padding">16dp</item>
+ <item name="android:paddingStart">16dp</item>
+ <item name="android:paddingEnd">0dp</item>
<item name="android:textSize">14sp</item>
<item name="android:textFontWeight">500</item>
<item name="android:textColor">?androidprv:attr/materialColorOnSurface</item>
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/dagger/WMShellModule.java b/libs/WindowManager/Shell/src/com/android/wm/shell/dagger/WMShellModule.java
index 97397cea4a38..03a851bb9507 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/dagger/WMShellModule.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/dagger/WMShellModule.java
@@ -597,9 +597,10 @@ public abstract class WMShellModule {
TransactionPool transactionPool,
Transitions transitions,
@ShellMainThread ShellExecutor executor,
+ @ShellMainThread Handler handler,
ShellInit shellInit) {
return new UnfoldTransitionHandler(shellInit, progressProvider.get(), animator,
- unfoldAnimator, transactionPool, executor, transitions);
+ unfoldAnimator, transactionPool, executor, handler, transitions);
}
@WMSingleton
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopFullImmersiveTransitionHandler.kt b/libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopFullImmersiveTransitionHandler.kt
index 679179a7ff68..320c003f41eb 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopFullImmersiveTransitionHandler.kt
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopFullImmersiveTransitionHandler.kt
@@ -23,6 +23,7 @@ import android.os.IBinder
import android.view.SurfaceControl
import android.view.WindowManager.TRANSIT_CHANGE
import android.view.animation.DecelerateInterpolator
+import android.window.DesktopModeFlags.ENABLE_WINDOWING_DYNAMIC_INITIAL_BOUNDS
import android.window.TransitionInfo
import android.window.TransitionRequestInfo
import android.window.WindowContainerTransaction
@@ -102,10 +103,8 @@ class DesktopFullImmersiveTransitionHandler(
return
}
- val displayLayout = displayController.getDisplayLayout(taskInfo.displayId) ?: return
- val destinationBounds = calculateMaximizeBounds(displayLayout, taskInfo)
val wct = WindowContainerTransaction().apply {
- setBounds(taskInfo.token, destinationBounds)
+ setBounds(taskInfo.token, getExitDestinationBounds(taskInfo))
}
logV("Moving task ${taskInfo.taskId} out of immersive mode")
val transition = transitions.startTransition(TRANSIT_CHANGE, wct, /* handler= */ this)
@@ -145,11 +144,10 @@ class DesktopFullImmersiveTransitionHandler(
displayId: Int
): ((IBinder) -> Unit)? {
if (!Flags.enableFullyImmersiveInDesktop()) return null
- val displayLayout = displayController.getDisplayLayout(displayId) ?: return null
val immersiveTask = desktopRepository.getTaskInFullImmersiveState(displayId) ?: return null
val taskInfo = shellTaskOrganizer.getRunningTaskInfo(immersiveTask) ?: return null
logV("Appending immersive exit for task: $immersiveTask in display: $displayId")
- wct.setBounds(taskInfo.token, calculateMaximizeBounds(displayLayout, taskInfo))
+ wct.setBounds(taskInfo.token, getExitDestinationBounds(taskInfo))
return { transition -> addPendingImmersiveExit(immersiveTask, displayId, transition) }
}
@@ -168,16 +166,14 @@ class DesktopFullImmersiveTransitionHandler(
if (desktopRepository.isTaskInFullImmersiveState(taskInfo.taskId)) {
// A full immersive task is being minimized, make sure the immersive state is broken
// (i.e. resize back to max bounds).
- displayController.getDisplayLayout(taskInfo.displayId)?.let { displayLayout ->
- wct.setBounds(taskInfo.token, calculateMaximizeBounds(displayLayout, taskInfo))
- logV("Appending immersive exit for task: ${taskInfo.taskId}")
- return { transition ->
- addPendingImmersiveExit(
- taskId = taskInfo.taskId,
- displayId = taskInfo.displayId,
- transition = transition
- )
- }
+ wct.setBounds(taskInfo.token, getExitDestinationBounds(taskInfo))
+ logV("Appending immersive exit for task: ${taskInfo.taskId}")
+ return { transition ->
+ addPendingImmersiveExit(
+ taskId = taskInfo.taskId,
+ displayId = taskInfo.displayId,
+ transition = transition
+ )
}
}
return null
@@ -302,14 +298,19 @@ class DesktopFullImmersiveTransitionHandler(
taskId = pendingExit.taskId,
immersive = false
)
+ if (Flags.enableRestoreToPreviousSizeFromDesktopImmersive()) {
+ desktopRepository.removeBoundsBeforeFullImmersive(pendingExit.taskId)
+ }
}
}
return
}
// Check if this is a direct immersive enter/exit transition.
- val state = this.state ?: return
- if (transition == state.transition) {
+ if (transition == state?.transition) {
+ val state = requireState()
+ val startBounds = info.changes.first { c -> c.taskInfo?.taskId == state.taskId }
+ .startAbsBounds
logV("Direct move for task ${state.taskId} in ${state.direction} direction verified")
when (state.direction) {
Direction.ENTER -> {
@@ -318,6 +319,9 @@ class DesktopFullImmersiveTransitionHandler(
taskId = state.taskId,
immersive = true
)
+ if (Flags.enableRestoreToPreviousSizeFromDesktopImmersive()) {
+ desktopRepository.saveBoundsBeforeFullImmersive(state.taskId, startBounds)
+ }
}
Direction.EXIT -> {
desktopRepository.setTaskInFullImmersiveState(
@@ -325,15 +329,48 @@ class DesktopFullImmersiveTransitionHandler(
taskId = state.taskId,
immersive = false
)
+ if (Flags.enableRestoreToPreviousSizeFromDesktopImmersive()) {
+ desktopRepository.removeBoundsBeforeFullImmersive(state.taskId)
+ }
}
}
+ return
}
+
+ // Check if this is an untracked exit transition, like display rotation.
+ info.changes
+ .filter { c -> c.taskInfo != null }
+ .filter { c -> desktopRepository.isTaskInFullImmersiveState(c.taskInfo!!.taskId) }
+ .filter { c -> c.startRotation != c.endRotation }
+ .forEach { c ->
+ logV("Detected immersive exit due to rotation for task: ${c.taskInfo!!.taskId}")
+ desktopRepository.setTaskInFullImmersiveState(
+ displayId = c.taskInfo!!.displayId,
+ taskId = c.taskInfo!!.taskId,
+ immersive = false
+ )
+ }
}
private fun clearState() {
state = null
}
+ private fun getExitDestinationBounds(taskInfo: RunningTaskInfo): Rect {
+ val displayLayout = displayController.getDisplayLayout(taskInfo.displayId)
+ ?: error("Expected non-null display layout for displayId: ${taskInfo.displayId}")
+ return if (Flags.enableRestoreToPreviousSizeFromDesktopImmersive()) {
+ desktopRepository.removeBoundsBeforeFullImmersive(taskInfo.taskId)
+ ?: if (ENABLE_WINDOWING_DYNAMIC_INITIAL_BOUNDS.isTrue()) {
+ calculateInitialBounds(displayLayout, taskInfo)
+ } else {
+ calculateDefaultDesktopTaskBounds(displayLayout)
+ }
+ } else {
+ return calculateMaximizeBounds(displayLayout, taskInfo)
+ }
+ }
+
private fun requireState(): TransitionState =
state ?: error("Expected non-null transition state")
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopModeUtils.kt b/libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopModeUtils.kt
index 6d4792250be2..edcc877ef58e 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopModeUtils.kt
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopModeUtils.kt
@@ -37,6 +37,23 @@ val DESKTOP_MODE_LANDSCAPE_APP_PADDING: Int =
SystemProperties.getInt("persist.wm.debug.desktop_mode_landscape_app_padding", 25)
/**
+ * Calculates the initial bounds to enter desktop, centered on the display.
+ */
+fun calculateDefaultDesktopTaskBounds(displayLayout: DisplayLayout): Rect {
+ // TODO(b/319819547): Account for app constraints so apps do not become letterboxed
+ val desiredWidth = (displayLayout.width() * DESKTOP_MODE_INITIAL_BOUNDS_SCALE).toInt()
+ val desiredHeight = (displayLayout.height() * DESKTOP_MODE_INITIAL_BOUNDS_SCALE).toInt()
+ val heightOffset = (displayLayout.height() - desiredHeight) / 2
+ val widthOffset = (displayLayout.width() - desiredWidth) / 2
+ return Rect(
+ widthOffset,
+ heightOffset,
+ desiredWidth + widthOffset,
+ desiredHeight + heightOffset
+ )
+}
+
+/**
* Calculates the initial bounds required for an application to fill a scale of the display bounds
* without any letterboxing. This is done by taking into account the applications fullscreen size,
* aspect ratio, orientation and resizability to calculate an area this is compatible with the
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopRepository.kt b/libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopRepository.kt
index 5ac4ef5cf049..eeb7ac852070 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopRepository.kt
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopRepository.kt
@@ -102,6 +102,9 @@ class DesktopRepository (
/* Tracks last bounds of task before toggled to stable bounds. */
private val boundsBeforeMaximizeByTaskId = SparseArray<Rect>()
+ /* Tracks last bounds of task before toggled to immersive state. */
+ private val boundsBeforeFullImmersiveByTaskId = SparseArray<Rect>()
+
private var desktopGestureExclusionListener: Consumer<Region>? = null
private var desktopGestureExclusionExecutor: Executor? = null
@@ -414,6 +417,7 @@ class DesktopRepository (
logD("Removes freeform task: taskId=%d, displayId=%d", taskId, displayId)
desktopTaskDataByDisplayId[displayId]?.freeformTasksInZOrder?.remove(taskId)
boundsBeforeMaximizeByTaskId.remove(taskId)
+ boundsBeforeFullImmersiveByTaskId.remove(taskId)
logD("Remaining freeform tasks: %s",
desktopTaskDataByDisplayId[displayId]?.freeformTasksInZOrder?.toDumpString())
// Remove task from unminimized task if it is minimized.
@@ -472,6 +476,14 @@ class DesktopRepository (
fun saveBoundsBeforeMaximize(taskId: Int, bounds: Rect) =
boundsBeforeMaximizeByTaskId.set(taskId, Rect(bounds))
+ /** Removes and returns the bounds saved before entering immersive with the given task. */
+ fun removeBoundsBeforeFullImmersive(taskId: Int): Rect? =
+ boundsBeforeFullImmersiveByTaskId.removeReturnOld(taskId)
+
+ /** Saves the bounds of the given task before entering immersive. */
+ fun saveBoundsBeforeFullImmersive(taskId: Int, bounds: Rect) =
+ boundsBeforeFullImmersiveByTaskId.set(taskId, Rect(bounds))
+
private fun updatePersistentRepository(displayId: Int) {
// Create a deep copy of the data
desktopTaskDataByDisplayId[displayId]?.deepCopy()?.let { desktopTaskDataByDisplayIdCopy ->
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopTasksController.kt b/libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopTasksController.kt
index 4440778a5a45..29e302a0f0cc 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopTasksController.kt
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopTasksController.kt
@@ -82,6 +82,7 @@ import com.android.wm.shell.desktopmode.DesktopRepository.VisibleTasksListener
import com.android.wm.shell.desktopmode.DesktopModeVisualIndicator.DragStartState
import com.android.wm.shell.desktopmode.DesktopModeVisualIndicator.IndicatorType
import com.android.wm.shell.desktopmode.DragToDesktopTransitionHandler.DragToDesktopStateListener
+import com.android.wm.shell.desktopmode.minimize.DesktopWindowLimitRemoteHandler
import com.android.wm.shell.draganddrop.DragAndDropController
import com.android.wm.shell.protolog.ShellProtoLogGroup.WM_SHELL_DESKTOP_MODE
import com.android.wm.shell.recents.RecentTasksController
@@ -562,10 +563,20 @@ class DesktopTasksController(
)
}
- /** Move a task to the front */
- fun moveTaskToFront(taskId: Int) {
+ /**
+ * Move a task to the front, using [remoteTransition].
+ *
+ * Note: beyond moving a task to the front, this method will minimize a task if we reach the
+ * Desktop task limit, so [remoteTransition] should also handle any such minimize change.
+ */
+ @JvmOverloads
+ fun moveTaskToFront(taskId: Int, remoteTransition: RemoteTransition? = null) {
val task = shellTaskOrganizer.getRunningTaskInfo(taskId)
- if (task == null) moveBackgroundTaskToFront(taskId) else moveTaskToFront(task)
+ if (task == null) {
+ moveBackgroundTaskToFront(taskId, remoteTransition)
+ } else {
+ moveTaskToFront(task, remoteTransition)
+ }
}
/**
@@ -573,12 +584,10 @@ class DesktopTasksController(
* desktop. If outside of desktop and want to launch a background task in desktop, use
* [moveBackgroundTaskToDesktop] instead.
*/
- private fun moveBackgroundTaskToFront(taskId: Int) {
+ private fun moveBackgroundTaskToFront(taskId: Int, remoteTransition: RemoteTransition?) {
logV("moveBackgroundTaskToFront taskId=%s", taskId)
val wct = WindowContainerTransaction()
// TODO: b/342378842 - Instead of using default display, support multiple displays
- val taskToMinimize: RunningTaskInfo? =
- addAndGetMinimizeChangesIfNeeded(DEFAULT_DISPLAY, wct, taskId)
val runOnTransit = immersiveTransitionHandler
.exitImmersiveIfApplicable(wct, DEFAULT_DISPLAY)
wct.startTask(
@@ -587,26 +596,56 @@ class DesktopTasksController(
launchWindowingMode = WINDOWING_MODE_FREEFORM
}.toBundle(),
)
- val transition = transitions.startTransition(TRANSIT_OPEN, wct, null /* handler */)
- addPendingMinimizeTransition(transition, taskToMinimize)
+ val transition = startLaunchTransition(TRANSIT_OPEN, wct, taskId, remoteTransition)
runOnTransit?.invoke(transition)
}
- /** Move a task to the front */
- fun moveTaskToFront(taskInfo: RunningTaskInfo) {
+ /**
+ * Move a task to the front, using [remoteTransition].
+ *
+ * Note: beyond moving a task to the front, this method will minimize a task if we reach the
+ * Desktop task limit, so [remoteTransition] should also handle any such minimize change.
+ */
+ @JvmOverloads
+ fun moveTaskToFront(taskInfo: RunningTaskInfo, remoteTransition: RemoteTransition? = null) {
logV("moveTaskToFront taskId=%s", taskInfo.taskId)
val wct = WindowContainerTransaction()
wct.reorder(taskInfo.token, true /* onTop */, true /* includingParents */)
val runOnTransit = immersiveTransitionHandler.exitImmersiveIfApplicable(
wct, taskInfo.displayId)
- val taskToMinimize =
- addAndGetMinimizeChangesIfNeeded(taskInfo.displayId, wct, taskInfo.taskId)
-
- val transition = transitions.startTransition(TRANSIT_TO_FRONT, wct, null /* handler */)
- addPendingMinimizeTransition(transition, taskToMinimize)
+ val transition =
+ startLaunchTransition(TRANSIT_TO_FRONT, wct, taskInfo.taskId, remoteTransition)
runOnTransit?.invoke(transition)
}
+ private fun startLaunchTransition(
+ transitionType: Int,
+ wct: WindowContainerTransaction,
+ taskId: Int,
+ remoteTransition: RemoteTransition?,
+ ): IBinder {
+ val taskToMinimize: RunningTaskInfo? =
+ addAndGetMinimizeChangesIfNeeded(DEFAULT_DISPLAY, wct, taskId)
+ if (remoteTransition == null) {
+ val t = transitions.startTransition(transitionType, wct, null /* handler */)
+ addPendingMinimizeTransition(t, taskToMinimize)
+ return t
+ }
+ if (taskToMinimize == null) {
+ val remoteTransitionHandler = OneShotRemoteHandler(mainExecutor, remoteTransition)
+ val t = transitions.startTransition(transitionType, wct, remoteTransitionHandler)
+ remoteTransitionHandler.setTransition(t)
+ return t
+ }
+ val remoteTransitionHandler =
+ DesktopWindowLimitRemoteHandler(
+ mainExecutor, rootTaskDisplayAreaOrganizer, remoteTransition, taskToMinimize.taskId)
+ val t = transitions.startTransition(transitionType, wct, remoteTransitionHandler)
+ remoteTransitionHandler.setTransition(t)
+ addPendingMinimizeTransition(t, taskToMinimize)
+ return t
+ }
+
/**
* Move task to the next display.
*
@@ -712,7 +751,7 @@ class DesktopTasksController(
if (ENABLE_WINDOWING_DYNAMIC_INITIAL_BOUNDS.isTrue()) {
destinationBounds.set(calculateInitialBounds(displayLayout, taskInfo))
} else {
- destinationBounds.set(getDefaultDesktopTaskBounds(displayLayout))
+ destinationBounds.set(calculateDefaultDesktopTaskBounds(displayLayout))
}
}
} else {
@@ -881,20 +920,6 @@ class DesktopTasksController(
}
}
- private fun getDefaultDesktopTaskBounds(displayLayout: DisplayLayout): Rect {
- // TODO(b/319819547): Account for app constraints so apps do not become letterboxed
- val desiredWidth = (displayLayout.width() * DESKTOP_MODE_INITIAL_BOUNDS_SCALE).toInt()
- val desiredHeight = (displayLayout.height() * DESKTOP_MODE_INITIAL_BOUNDS_SCALE).toInt()
- val heightOffset = (displayLayout.height() - desiredHeight) / 2
- val widthOffset = (displayLayout.width() - desiredWidth) / 2
- return Rect(
- widthOffset,
- heightOffset,
- desiredWidth + widthOffset,
- desiredHeight + heightOffset
- )
- }
-
private fun getSnapBounds(taskInfo: RunningTaskInfo, position: SnapPosition): Rect {
val displayLayout = displayController.getDisplayLayout(taskInfo.displayId) ?: return Rect()
@@ -1448,7 +1473,7 @@ class DesktopTasksController(
val bounds = if (ENABLE_WINDOWING_DYNAMIC_INITIAL_BOUNDS.isTrue) {
calculateInitialBounds(displayLayout, taskInfo)
} else {
- getDefaultDesktopTaskBounds(displayLayout)
+ calculateDefaultDesktopTaskBounds(displayLayout)
}
if (DesktopModeFlags.ENABLE_CASCADING_WINDOWS.isTrue) {
@@ -1844,7 +1869,7 @@ class DesktopTasksController(
when (indicatorType) {
IndicatorType.TO_DESKTOP_INDICATOR -> {
// Use default bounds, but with the top-center at the drop point.
- newWindowBounds.set(getDefaultDesktopTaskBounds(displayLayout))
+ newWindowBounds.set(calculateDefaultDesktopTaskBounds(displayLayout))
newWindowBounds.offsetTo(
dragEvent.x.toInt() - (newWindowBounds.width() / 2),
dragEvent.y.toInt()
@@ -2031,9 +2056,9 @@ class DesktopTasksController(
}
}
- override fun showDesktopApp(taskId: Int) {
+ override fun showDesktopApp(taskId: Int, remoteTransition: RemoteTransition?) {
executeRemoteCallWithTaskPermission(controller, "showDesktopApp") { c ->
- c.moveTaskToFront(taskId)
+ c.moveTaskToFront(taskId, remoteTransition)
}
}
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopTasksTransitionObserver.kt b/libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopTasksTransitionObserver.kt
index 0b1bb8f36fa8..d1534da9a078 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopTasksTransitionObserver.kt
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopTasksTransitionObserver.kt
@@ -29,6 +29,7 @@ import android.window.DesktopModeFlags
import android.window.DesktopModeFlags.ENABLE_DESKTOP_WINDOWING_WALLPAPER_ACTIVITY
import com.android.internal.protolog.ProtoLog
import com.android.wm.shell.ShellTaskOrganizer
+import com.android.wm.shell.desktopmode.DesktopModeTransitionTypes.isExitDesktopModeTransition
import com.android.wm.shell.protolog.ShellProtoLogGroup.WM_SHELL_DESKTOP_MODE
import com.android.wm.shell.shared.TransitionUtil
import com.android.wm.shell.shared.desktopmode.DesktopModeStatus
@@ -79,7 +80,9 @@ class DesktopTasksTransitionObserver(
private fun removeTaskIfNeeded(info: TransitionInfo) {
// Since we are no longer removing all the tasks [onTaskVanished], we need to remove them by
// checking the transitions.
- if (!TransitionUtil.isOpeningType(info.type)) return
+ if (!(TransitionUtil.isOpeningType(info.type) || info.type.isExitDesktopModeTransition())) {
+ return
+ }
// Remove a task from the repository if the app is launched outside of desktop.
for (change in info.changes) {
val taskInfo = change.taskInfo
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/IDesktopMode.aidl b/libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/IDesktopMode.aidl
index c27813de5358..aac2361f717e 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/IDesktopMode.aidl
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/IDesktopMode.aidl
@@ -35,8 +35,13 @@ interface IDesktopMode {
/** @deprecated this is no longer supported. */
void hideStashedDesktopApps(int displayId);
- /** Bring task with the given id to front */
- oneway void showDesktopApp(int taskId);
+ /**
+ * Bring task with the given id to front, using the given remote transition.
+ *
+ * <p> Note: beyond moving a task to the front, this method will minimize a task if we reach the
+ * Desktop task limit, so {@code remoteTransition} should also handle any such minimize change.
+ */
+ oneway void showDesktopApp(int taskId, in @nullable RemoteTransition remoteTransition);
/** Get count of visible desktop tasks on the given display */
int getVisibleTaskCount(int displayId);
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/minimize/DesktopWindowLimitRemoteHandler.kt b/libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/minimize/DesktopWindowLimitRemoteHandler.kt
new file mode 100644
index 000000000000..7554cbb96606
--- /dev/null
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/minimize/DesktopWindowLimitRemoteHandler.kt
@@ -0,0 +1,100 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.wm.shell.desktopmode.minimize
+
+import android.os.IBinder
+import android.view.SurfaceControl
+import android.view.WindowManager.TRANSIT_TO_BACK
+import android.window.RemoteTransition
+import android.window.TransitionInfo
+import android.window.TransitionInfo.Change
+import android.window.TransitionRequestInfo
+import android.window.WindowContainerTransaction
+import com.android.wm.shell.RootTaskDisplayAreaOrganizer
+import com.android.wm.shell.common.ShellExecutor
+import com.android.wm.shell.shared.TransitionUtil
+import com.android.wm.shell.transition.OneShotRemoteHandler
+import com.android.wm.shell.transition.Transitions
+import com.android.wm.shell.transition.Transitions.TransitionHandler
+
+/**
+ * Handles transitions that result in hitting the Desktop window limit, by performing some
+ * preparation work and then delegating to [remoteTransition].
+ *
+ * This transition handler prepares the leash of the minimizing change referenced by
+ * [taskIdToMinimize], and then delegates to [remoteTransition] to perform the actual transition.
+ */
+class DesktopWindowLimitRemoteHandler(
+ mainExecutor: ShellExecutor,
+ private val rootTaskDisplayAreaOrganizer: RootTaskDisplayAreaOrganizer,
+ remoteTransition: RemoteTransition,
+ private val taskIdToMinimize: Int,
+ ) : TransitionHandler {
+
+ private val oneShotRemoteHandler = OneShotRemoteHandler(mainExecutor, remoteTransition)
+ private var transition: IBinder? = null
+
+ /** Sets the transition that will be handled - this must be called before [startAnimation]. */
+ fun setTransition(transition: IBinder) {
+ this.transition = transition
+ oneShotRemoteHandler.setTransition(transition)
+ }
+
+ override fun handleRequest(
+ transition: IBinder,
+ request: TransitionRequestInfo
+ ): WindowContainerTransaction? {
+ this.transition = transition
+ return oneShotRemoteHandler.handleRequest(transition, request)
+ }
+
+ override fun startAnimation(
+ transition: IBinder,
+ info: TransitionInfo,
+ startTransaction: SurfaceControl.Transaction,
+ finishTransaction: SurfaceControl.Transaction,
+ finishCallback: Transitions.TransitionFinishCallback
+ ): Boolean {
+ if (transition != this.transition) return false
+ val minimizeChange = findMinimizeChange(info, taskIdToMinimize) ?: return false
+ // Reparent the minimize change back to the root task display area, so the minimizing window
+ // isn't shown in front of other windows. We do this here in Shell since Launcher doesn't
+ // have access to RootTaskDisplayAreaOrganizer.
+ applyMinimizeChangeReparenting(info, minimizeChange, startTransaction)
+ return oneShotRemoteHandler.startAnimation(
+ transition, info, startTransaction, finishTransaction, finishCallback)
+ }
+
+ private fun applyMinimizeChangeReparenting(
+ info: TransitionInfo,
+ minimizeChange: Change,
+ startTransaction: SurfaceControl.Transaction,
+ ) {
+ val taskInfo = minimizeChange.taskInfo ?: return
+ if (taskInfo.isFreeform && TransitionUtil.isOpeningMode(info.type)) {
+ rootTaskDisplayAreaOrganizer.reparentToDisplayArea(
+ taskInfo.displayId, minimizeChange.leash, startTransaction)
+ }
+ }
+
+ private fun findMinimizeChange(
+ info: TransitionInfo,
+ taskIdToMinimize: Int,
+ ): Change? =
+ info.changes.find { change ->
+ change.taskInfo?.taskId == taskIdToMinimize && change.mode == TRANSIT_TO_BACK }
+}
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipTransition.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipTransition.java
index 1453886e056b..6da39951efbe 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipTransition.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipTransition.java
@@ -463,7 +463,7 @@ public class PipTransition extends PipTransitionController {
// so update fixed rotation state to default.
mFixedRotationState = FIXED_ROTATION_UNDEFINED;
- if (transition != mExitTransition) {
+ if (transition != mExitTransition && transition != mMoveToBackTransition) {
return;
}
// This means an expand happened before enter-pip finished and we are now "merging" a
@@ -477,8 +477,10 @@ public class PipTransition extends PipTransitionController {
cancelled = true;
}
- // Unset exitTransition AFTER cancel so that finishResize knows we are merging.
+ // Unset both exitTransition and moveToBackTransition AFTER cancel so that
+ // finishResize knows we are merging.
mExitTransition = null;
+ mMoveToBackTransition = null;
if (!cancelled) return;
final ActivityManager.RunningTaskInfo taskInfo = mPipOrganizer.getTaskInfo();
if (taskInfo != null) {
@@ -515,7 +517,8 @@ public class PipTransition extends PipTransitionController {
// means we're expecting the exit transition will be "merged" into another transition
// (likely a remote like launcher), so don't fire the finish-callback here -- wait until
// the exit transition is merged.
- if ((mExitTransition == null || isAnimatingLocally()) && mFinishCallback != null) {
+ if ((mExitTransition == null || mMoveToBackTransition == null || isAnimatingLocally())
+ && mFinishCallback != null) {
final SurfaceControl leash = mPipOrganizer.getSurfaceControl();
final boolean hasValidLeash = leash != null && leash.isValid();
WindowContainerTransaction wct = null;
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip2/animation/PipEnterAnimator.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip2/animation/PipEnterAnimator.java
index fcd5c3baab5d..5381a626ddcf 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip2/animation/PipEnterAnimator.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip2/animation/PipEnterAnimator.java
@@ -110,8 +110,7 @@ public class PipEnterAnimator extends ValueAnimator
mAnimationStartCallback.run();
}
if (mStartTransaction != null) {
- onEnterAnimationUpdate(mInitScale, mInitPos, mInitCrop,
- 0f /* fraction */, mStartTransaction);
+ onEnterAnimationUpdate(0f /* fraction */, mStartTransaction);
mStartTransaction.apply();
}
}
@@ -119,8 +118,7 @@ public class PipEnterAnimator extends ValueAnimator
@Override
public void onAnimationEnd(@NonNull Animator animation) {
if (mFinishTransaction != null) {
- onEnterAnimationUpdate(mInitScale, mInitPos, mInitCrop,
- 1f /* fraction */, mFinishTransaction);
+ onEnterAnimationUpdate(1f /* fraction */, mFinishTransaction);
}
if (mAnimationEndCallback != null) {
mAnimationEndCallback.run();
@@ -131,10 +129,20 @@ public class PipEnterAnimator extends ValueAnimator
public void onAnimationUpdate(@NonNull ValueAnimator animation) {
final SurfaceControl.Transaction tx = mSurfaceControlTransactionFactory.getTransaction();
final float fraction = getAnimatedFraction();
- onEnterAnimationUpdate(mInitScale, mInitPos, mInitCrop, fraction, tx);
+ onEnterAnimationUpdate(fraction, tx);
tx.apply();
}
+ /**
+ * Updates the transaction to reflect the state of PiP leash at a certain fraction during enter.
+ *
+ * @param fraction the fraction of the animator going from 0f to 1f.
+ * @param tx the transaction to modify the transform of.
+ */
+ public void onEnterAnimationUpdate(float fraction, SurfaceControl.Transaction tx) {
+ onEnterAnimationUpdate(mInitScale, mInitPos, mInitCrop, fraction, tx);
+ }
+
private void onEnterAnimationUpdate(PointF initScale, PointF initPos, Rect initCrop,
float fraction, SurfaceControl.Transaction tx) {
float scaleX = 1 + (initScale.x - 1) * (1 - fraction);
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip2/phone/PipMotionHelper.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip2/phone/PipMotionHelper.java
index 537ef182bb04..810eff8a055c 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip2/phone/PipMotionHelper.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip2/phone/PipMotionHelper.java
@@ -776,6 +776,10 @@ public class PipMotionHelper implements PipAppOpsListener.Callback,
cancelPhysicsAnimation();
settlePipBoundsAfterPhysicsAnimation(false /* animatingAfter */);
break;
+ case PipTransitionState.CHANGED_PIP_BOUNDS:
+ // Check whether changed bounds imply we need to update stash state too.
+ stashEndActionIfNeeded();
+ break;
}
}
@@ -829,9 +833,6 @@ public class PipMotionHelper implements PipAppOpsListener.Callback,
mPipBoundsState.getMotionBoundsState().onPhysicsAnimationEnded();
mSpringingToTouch = false;
mDismissalPending = false;
-
- // Check whether new bounds after fling imply we need to update stash state too.
- stashEndActionIfNeeded();
}
private void stashEndActionIfNeeded() {
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip2/phone/PipTouchHandler.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip2/phone/PipTouchHandler.java
index 4d0432e1066e..19d293e829ad 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip2/phone/PipTouchHandler.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip2/phone/PipTouchHandler.java
@@ -1013,21 +1013,6 @@ public class PipTouchHandler implements PipTransitionState.PipTransitionStateCha
return true;
}
- private void stashEndAction() {
- if (mPipBoundsState.getBounds().left < 0
- && mPipBoundsState.getStashedState() != STASH_TYPE_LEFT) {
- mPipUiEventLogger.log(
- PipUiEventLogger.PipUiEventEnum.PICTURE_IN_PICTURE_STASH_LEFT);
- mPipBoundsState.setStashed(STASH_TYPE_LEFT);
- } else if (mPipBoundsState.getBounds().left >= 0
- && mPipBoundsState.getStashedState() != STASH_TYPE_RIGHT) {
- mPipUiEventLogger.log(
- PipUiEventLogger.PipUiEventEnum.PICTURE_IN_PICTURE_STASH_RIGHT);
- mPipBoundsState.setStashed(STASH_TYPE_RIGHT);
- }
- mMenuController.hideMenu();
- }
-
private void flingEndAction() {
if (mShouldHideMenuAfterFling) {
// If the menu is not visible, then we can still be showing the activity for the
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip2/phone/PipTransition.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip2/phone/PipTransition.java
index 779e4ea51347..b286211eb6d0 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip2/phone/PipTransition.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip2/phone/PipTransition.java
@@ -37,7 +37,6 @@ import android.annotation.NonNull;
import android.app.ActivityManager;
import android.app.PictureInPictureParams;
import android.content.Context;
-import android.graphics.Matrix;
import android.graphics.Point;
import android.graphics.Rect;
import android.os.Bundle;
@@ -316,6 +315,14 @@ public class PipTransition extends PipTransitionController implements
if (pipChange == null) {
return false;
}
+
+ // We expect the PiP activity as a separate change in a config-at-end transition.
+ TransitionInfo.Change pipActivityChange = getDeferConfigActivityChange(info,
+ pipChange.getTaskInfo().getToken());
+ if (pipActivityChange == null) {
+ return false;
+ }
+
SurfaceControl pipLeash = pipChange.getLeash();
Preconditions.checkNotNull(pipLeash, "Leash is null for swipe-up transition.");
@@ -333,27 +340,27 @@ public class PipTransition extends PipTransitionController implements
(destinationBounds.width() - overlaySize) / 2f,
(destinationBounds.height() - overlaySize) / 2f);
}
- startTransaction.merge(finishTransaction);
final int startRotation = pipChange.getStartRotation();
final int endRotation = mPipDisplayLayoutState.getRotation();
- if (endRotation != startRotation) {
- boolean isClockwise = (endRotation - startRotation) == -ROTATION_270;
-
- // Display bounds were already updated to represent the final orientation,
- // so we just need to readjust the origin, and perform rotation about (0, 0).
- Rect displayBounds = mPipDisplayLayoutState.getDisplayBounds();
- int originTranslateX = isClockwise ? 0 : -displayBounds.width();
- int originTranslateY = isClockwise ? -displayBounds.height() : 0;
-
- Matrix transformTensor = new Matrix();
- final float[] matrixTmp = new float[9];
- transformTensor.setTranslate(originTranslateX + destinationBounds.left,
- originTranslateY + destinationBounds.top);
- final float degrees = (endRotation - startRotation) * 90f;
- transformTensor.postRotate(degrees);
- startTransaction.setMatrix(pipLeash, transformTensor, matrixTmp);
+ final int delta = endRotation == ROTATION_UNDEFINED ? ROTATION_0
+ : startRotation - endRotation;
+ if (delta != ROTATION_0) {
+ mPipTransitionState.setInFixedRotation(true);
+ handleBoundsTypeFixedRotation(pipChange, pipActivityChange, endRotation);
}
+
+ Rect sourceRectHint = null;
+ if (pipChange.getTaskInfo() != null
+ && pipChange.getTaskInfo().pictureInPictureParams != null) {
+ sourceRectHint = pipChange.getTaskInfo().pictureInPictureParams.getSourceRectHint();
+ }
+
+ startTransaction.merge(finishTransaction);
+ PipEnterAnimator animator = new PipEnterAnimator(mContext, pipLeash,
+ startTransaction, finishTransaction, destinationBounds, sourceRectHint, delta);
+ animator.setEnterStartState(pipChange, pipActivityChange);
+ animator.onEnterAnimationUpdate(1.0f /* fraction */, startTransaction);
startTransaction.apply();
finishInner();
return true;
@@ -399,7 +406,6 @@ public class PipTransition extends PipTransitionController implements
}
Rect endBounds = pipChange.getEndAbsBounds();
- Rect activityEndBounds = pipActivityChange.getEndAbsBounds();
SurfaceControl pipLeash = mPipTransitionState.mPinnedTaskLeash;
Preconditions.checkNotNull(pipLeash, "Leash is null for bounds transition.");
@@ -430,7 +436,8 @@ public class PipTransition extends PipTransitionController implements
if (delta != ROTATION_0) {
mPipTransitionState.setInFixedRotation(true);
- handleBoundsTypeFixedRotation(pipChange, pipActivityChange, fixedRotationChange);
+ handleBoundsTypeFixedRotation(pipChange, pipActivityChange,
+ fixedRotationChange.getEndFixedRotation());
}
PipEnterAnimator animator = new PipEnterAnimator(mContext, pipLeash,
@@ -443,12 +450,10 @@ public class PipTransition extends PipTransitionController implements
}
private void handleBoundsTypeFixedRotation(TransitionInfo.Change pipTaskChange,
- TransitionInfo.Change pipActivityChange,
- TransitionInfo.Change fixedRotationChange) {
+ TransitionInfo.Change pipActivityChange, int endRotation) {
final Rect endBounds = pipTaskChange.getEndAbsBounds();
final Rect endActivityBounds = pipActivityChange.getEndAbsBounds();
int startRotation = pipTaskChange.getStartRotation();
- int endRotation = fixedRotationChange.getEndFixedRotation();
// Cache the task to activity offset to potentially restore later.
Point activityEndOffset = new Point(endActivityBounds.left - endBounds.left,
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageTaskListener.java b/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageTaskListener.java
index ae4bd1615ae1..6313231b449e 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageTaskListener.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageTaskListener.java
@@ -244,8 +244,9 @@ public class StageTaskListener implements ShellTaskOrganizer.TaskListener {
return;
}
mChildrenTaskInfo.put(taskInfo.taskId, taskInfo);
+ mVisible = taskInfo.isVisible && taskInfo.isVisibleRequested;
mCallbacks.onChildTaskStatusChanged(this, taskInfo.taskId, true /* present */,
- taskInfo.isVisible && taskInfo.isVisibleRequested);
+ mVisible);
} else {
throw new IllegalArgumentException(this + "\n Unknown task: " + taskInfo
+ "\n mRootTaskInfo: " + mRootTaskInfo);
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/unfold/UnfoldTransitionHandler.java b/libs/WindowManager/Shell/src/com/android/wm/shell/unfold/UnfoldTransitionHandler.java
index 5a2abe1e7e25..3e0e15afc53a 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/unfold/UnfoldTransitionHandler.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/unfold/UnfoldTransitionHandler.java
@@ -24,7 +24,9 @@ import static com.android.wm.shell.protolog.ShellProtoLogGroup.WM_SHELL_TRANSITI
import android.animation.ValueAnimator;
import android.app.ActivityManager;
+import android.os.Handler;
import android.os.IBinder;
+import android.util.Slog;
import android.view.SurfaceControl;
import android.window.TransitionInfo;
import android.window.TransitionRequestInfo;
@@ -33,6 +35,7 @@ import android.window.WindowContainerTransaction;
import androidx.annotation.IntDef;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
+import androidx.annotation.VisibleForTesting;
import com.android.internal.protolog.ProtoLog;
import com.android.wm.shell.shared.TransactionPool;
@@ -59,6 +62,10 @@ import java.util.concurrent.Executor;
*/
public class UnfoldTransitionHandler implements TransitionHandler, UnfoldListener {
+ private static final String TAG = "UnfoldTransitionHandler";
+ @VisibleForTesting
+ static final int FINISH_ANIMATION_TIMEOUT_MILLIS = 5_000;
+
@Retention(RetentionPolicy.SOURCE)
@IntDef({
DefaultDisplayChange.DEFAULT_DISPLAY_NO_CHANGE,
@@ -75,6 +82,7 @@ public class UnfoldTransitionHandler implements TransitionHandler, UnfoldListene
private final Transitions mTransitions;
private final Executor mExecutor;
private final TransactionPool mTransactionPool;
+ private final Handler mHandler;
@Nullable
private TransitionFinishCallback mFinishCallback;
@@ -87,17 +95,25 @@ public class UnfoldTransitionHandler implements TransitionHandler, UnfoldListene
private float mLastAnimationProgress = 0.0f;
private final List<UnfoldTaskAnimator> mAnimators = new ArrayList<>();
+ private final Runnable mAnimationPlayingTimeoutRunnable = () -> {
+ Slog.wtf(TAG, "Timeout occurred when playing the unfold animation, "
+ + "force finishing the transition");
+ finishTransitionIfNeeded();
+ };
+
public UnfoldTransitionHandler(ShellInit shellInit,
ShellUnfoldProgressProvider unfoldProgressProvider,
FullscreenUnfoldTaskAnimator fullscreenUnfoldAnimator,
SplitTaskUnfoldAnimator splitUnfoldTaskAnimator,
TransactionPool transactionPool,
Executor executor,
+ Handler handler,
Transitions transitions) {
mUnfoldProgressProvider = unfoldProgressProvider;
mTransitions = transitions;
mTransactionPool = transactionPool;
mExecutor = executor;
+ mHandler = handler;
mAnimators.add(splitUnfoldTaskAnimator);
mAnimators.add(fullscreenUnfoldAnimator);
@@ -159,6 +175,11 @@ public class UnfoldTransitionHandler implements TransitionHandler, UnfoldListene
// finish shell transition immediately
if (mAnimationFinished) {
finishTransitionIfNeeded();
+ } else {
+ // TODO: b/318803244 - remove timeout handling when we could guarantee that
+ // the animation will be always finished after receiving startAnimation
+ mHandler.removeCallbacks(mAnimationPlayingTimeoutRunnable);
+ mHandler.postDelayed(mAnimationPlayingTimeoutRunnable, FINISH_ANIMATION_TIMEOUT_MILLIS);
}
return true;
@@ -333,6 +354,7 @@ public class UnfoldTransitionHandler implements TransitionHandler, UnfoldListene
animator.stop();
}
+ mHandler.removeCallbacks(mAnimationPlayingTimeoutRunnable);
mFinishCallback.onTransitionFinished(null);
mFinishCallback = null;
mTransition = null;
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopHandleManageWindowsMenu.kt b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopHandleManageWindowsMenu.kt
index 13a805aef0f1..e71b4f3abf14 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopHandleManageWindowsMenu.kt
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopHandleManageWindowsMenu.kt
@@ -95,15 +95,15 @@ class DesktopHandleManageWindowsMenu(
override fun addToContainer(menuView: ManageWindowsView) {
val menuPosition = calculateMenuPosition()
menuViewContainer = AdditionalSystemViewContainer(
- windowManagerWrapper,
- callerTaskInfo.taskId,
- menuPosition.x,
- menuPosition.y,
- menuView.menuWidth,
- menuView.menuHeight,
- WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE or
+ windowManagerWrapper = windowManagerWrapper,
+ taskId = callerTaskInfo.taskId,
+ x = menuPosition.x,
+ y = menuPosition.y,
+ width = menuView.menuWidth,
+ height = menuView.menuHeight,
+ flags = WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE or
WindowManager.LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH,
- menuView.rootView
+ view = menuView.rootView,
)
}
}
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopHeaderManageWindowsMenu.kt b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopHeaderManageWindowsMenu.kt
index 05391a8343a5..173bc08970ca 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopHeaderManageWindowsMenu.kt
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopHeaderManageWindowsMenu.kt
@@ -22,14 +22,19 @@ import android.graphics.PixelFormat
import android.graphics.Point
import android.view.SurfaceControl
import android.view.SurfaceControlViewHost
+import android.view.WindowInsets.Type.systemBars
import android.view.WindowManager
import android.view.WindowlessWindowManager
import android.window.TaskConstants
import android.window.TaskSnapshot
import androidx.compose.ui.graphics.toArgb
+import com.android.internal.annotations.VisibleForTesting
+import com.android.window.flags.Flags
import com.android.wm.shell.RootTaskDisplayAreaOrganizer
import com.android.wm.shell.common.DisplayController
+import com.android.wm.shell.desktopmode.DesktopRepository
import com.android.wm.shell.shared.desktopmode.ManageWindowsViewContainer
+import com.android.wm.shell.windowdecor.additionalviewcontainer.AdditionalSystemViewContainer
import com.android.wm.shell.windowdecor.additionalviewcontainer.AdditionalViewContainer
import com.android.wm.shell.windowdecor.additionalviewcontainer.AdditionalViewHostViewContainer
import com.android.wm.shell.windowdecor.common.DecorThemeUtil
@@ -41,9 +46,12 @@ import java.util.function.Supplier
*/
class DesktopHeaderManageWindowsMenu(
private val callerTaskInfo: RunningTaskInfo,
+ private val x: Int,
+ private val y: Int,
private val displayController: DisplayController,
private val rootTdaOrganizer: RootTaskDisplayAreaOrganizer,
context: Context,
+ private val desktopRepository: DesktopRepository,
private val surfaceControlBuilderSupplier: Supplier<SurfaceControl.Builder>,
private val surfaceControlTransactionSupplier: Supplier<SurfaceControl.Transaction>,
snapshotList: List<Pair<Int, TaskSnapshot>>,
@@ -53,7 +61,8 @@ class DesktopHeaderManageWindowsMenu(
context,
DecorThemeUtil(context).getColorScheme(callerTaskInfo).background.toArgb()
) {
- private var menuViewContainer: AdditionalViewContainer? = null
+ @VisibleForTesting
+ var menuViewContainer: AdditionalViewContainer? = null
init {
show(snapshotList, onIconClickListener, onOutsideClickListener)
@@ -64,8 +73,37 @@ class DesktopHeaderManageWindowsMenu(
}
override fun addToContainer(menuView: ManageWindowsView) {
- val taskBounds = callerTaskInfo.getConfiguration().windowConfiguration.bounds
- val menuPosition = Point(taskBounds.left, taskBounds.top)
+ val menuPosition = Point(x, y)
+ val flags = WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE or
+ WindowManager.LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH or
+ WindowManager.LayoutParams.FLAG_SPLIT_TOUCH
+ menuViewContainer = if (Flags.enableFullyImmersiveInDesktop()
+ && desktopRepository.isTaskInFullImmersiveState(callerTaskInfo.taskId)) {
+ // Use system view container so that forcibly shown system bars take effect in
+ // immersive.
+ createAsSystemViewContainer(menuPosition, flags)
+ } else {
+ createAsViewHostContainer(menuPosition, flags)
+ }
+ }
+
+ private fun createAsSystemViewContainer(position: Point, flags: Int): AdditionalViewContainer {
+ return AdditionalSystemViewContainer(
+ windowManagerWrapper = WindowManagerWrapper(
+ context.getSystemService(WindowManager::class.java)
+ ),
+ taskId = callerTaskInfo.taskId,
+ x = position.x,
+ y = position.y,
+ width = menuView.menuWidth,
+ height = menuView.menuHeight,
+ flags = flags,
+ forciblyShownTypes = systemBars(),
+ view = menuView.rootView
+ )
+ }
+
+ private fun createAsViewHostContainer(position: Point, flags: Int): AdditionalViewContainer {
val builder = surfaceControlBuilderSupplier.get()
rootTdaOrganizer.attachToDisplayArea(callerTaskInfo.displayId, builder)
val leash = builder
@@ -73,11 +111,10 @@ class DesktopHeaderManageWindowsMenu(
.setContainerLayer()
.build()
val lp = WindowManager.LayoutParams(
- menuView.menuWidth, menuView.menuHeight,
+ menuView.menuWidth,
+ menuView.menuHeight,
WindowManager.LayoutParams.TYPE_APPLICATION,
- WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE
- or WindowManager.LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH
- or WindowManager.LayoutParams.FLAG_SPLIT_TOUCH,
+ flags,
PixelFormat.TRANSPARENT
)
val windowManager = WindowlessWindowManager(
@@ -93,11 +130,12 @@ class DesktopHeaderManageWindowsMenu(
menuView.let { viewHost.setView(it.rootView, lp) }
val t = surfaceControlTransactionSupplier.get()
t.setLayer(leash, TaskConstants.TASK_CHILD_LAYER_FLOATING_MENU)
- .setPosition(leash, menuPosition.x.toFloat(), menuPosition.y.toFloat())
+ .setPosition(leash, position.x.toFloat(), position.y.toFloat())
.show(leash)
t.apply()
- menuViewContainer = AdditionalViewHostViewContainer(
- leash, viewHost,
+ return AdditionalViewHostViewContainer(
+ leash,
+ viewHost,
surfaceControlTransactionSupplier
)
}
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecoration.java b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecoration.java
index d3b7ca15856f..6eb20b9e3ae5 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecoration.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecoration.java
@@ -454,7 +454,13 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin
}
if (isHandleMenuActive()) {
- mHandleMenu.relayout(startT, mResult.mCaptionX);
+ mHandleMenu.relayout(
+ startT,
+ mResult.mCaptionX,
+ // Add top padding to the caption Y so that the menu is shown over what is the
+ // actual contents of the caption, ignoring padding. This is currently relevant
+ // to the Header in desktop immersive.
+ mResult.mCaptionY + mResult.mCaptionTopPadding);
}
if (isOpenByDefaultDialogActive()) {
@@ -1258,6 +1264,8 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin
&& Flags.enableDesktopWindowingMultiInstanceFeatures();
final boolean shouldShowManageWindowsButton = supportsMultiInstance
&& mMinimumInstancesFound;
+ final boolean inDesktopImmersive = mDesktopRepository
+ .isTaskInFullImmersiveState(mTaskInfo.taskId);
mHandleMenu = mHandleMenuFactory.create(
this,
mWindowManagerWrapper,
@@ -1271,7 +1279,11 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin
getBrowserLink(),
mResult.mCaptionWidth,
mResult.mCaptionHeight,
- mResult.mCaptionX
+ mResult.mCaptionX,
+ // Add top padding to the caption Y so that the menu is shown over what is the
+ // actual contents of the caption, ignoring padding. This is currently relevant
+ // to the Header in desktop immersive.
+ mResult.mCaptionY + mResult.mCaptionTopPadding
);
mWindowDecorViewHolder.onHandleMenuOpened();
mHandleMenu.show(
@@ -1302,7 +1314,8 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin
/* onOutsideTouchListener= */ () -> {
closeHandleMenu();
return Unit.INSTANCE;
- }
+ },
+ /* forceShowSystemBars= */ inDesktopImmersive
);
if (canEnterDesktopMode(mContext) && Flags.enableDesktopWindowingAppHandleEducation()) {
notifyCaptionStateChanged();
@@ -1316,9 +1329,12 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin
if (mTaskInfo.isFreeform()) {
mManageWindowsMenu = new DesktopHeaderManageWindowsMenu(
mTaskInfo,
+ /* x= */ mResult.mCaptionX,
+ /* y= */ mResult.mCaptionY + mResult.mCaptionTopPadding,
mDisplayController,
mRootTaskDisplayAreaOrganizer,
mContext,
+ mDesktopRepository,
mSurfaceControlBuilderSupplier,
mSurfaceControlTransactionSupplier,
snapshotList,
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/HandleMenu.kt b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/HandleMenu.kt
index 2e327035bddf..93bd9290dfeb 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/HandleMenu.kt
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/HandleMenu.kt
@@ -32,6 +32,7 @@ import android.view.MotionEvent
import android.view.MotionEvent.ACTION_OUTSIDE
import android.view.SurfaceControl
import android.view.View
+import android.view.WindowInsets.Type.systemBars
import android.view.WindowManager
import android.widget.Button
import android.widget.ImageButton
@@ -73,7 +74,8 @@ class HandleMenu(
private val openInBrowserIntent: Intent?,
private val captionWidth: Int,
private val captionHeight: Int,
- captionX: Int
+ captionX: Int,
+ captionY: Int
) {
private val context: Context = parentDecor.mDecorWindowContext
private val taskInfo: RunningTaskInfo = parentDecor.mTaskInfo
@@ -110,7 +112,7 @@ class HandleMenu(
get() = openInBrowserIntent != null
init {
- updateHandleMenuPillPositions(captionX)
+ updateHandleMenuPillPositions(captionX, captionY)
}
fun show(
@@ -123,6 +125,7 @@ class HandleMenu(
onOpenByDefaultClickListener: () -> Unit,
onCloseMenuClickListener: () -> Unit,
onOutsideTouchListener: () -> Unit,
+ forceShowSystemBars: Boolean = false,
) {
val ssg = SurfaceSyncGroup(TAG)
val t = SurfaceControl.Transaction()
@@ -139,6 +142,7 @@ class HandleMenu(
onOpenByDefaultClickListener = onOpenByDefaultClickListener,
onCloseMenuClickListener = onCloseMenuClickListener,
onOutsideTouchListener = onOutsideTouchListener,
+ forceShowSystemBars = forceShowSystemBars,
)
ssg.addTransaction(t)
ssg.markSyncReady()
@@ -157,7 +161,8 @@ class HandleMenu(
openInBrowserClickListener: (Intent) -> Unit,
onOpenByDefaultClickListener: () -> Unit,
onCloseMenuClickListener: () -> Unit,
- onOutsideTouchListener: () -> Unit
+ onOutsideTouchListener: () -> Unit,
+ forceShowSystemBars: Boolean = false,
) {
val handleMenuView = HandleMenuView(
context = context,
@@ -185,7 +190,7 @@ class HandleMenu(
val x = handleMenuPosition.x.toInt()
val y = handleMenuPosition.y.toInt()
handleMenuViewContainer =
- if (!taskInfo.isFreeform && Flags.enableHandleInputFix()) {
+ if ((!taskInfo.isFreeform && Flags.enableHandleInputFix()) || forceShowSystemBars) {
AdditionalSystemViewContainer(
windowManagerWrapper = windowManagerWrapper,
taskId = taskInfo.taskId,
@@ -196,7 +201,8 @@ class HandleMenu(
flags = WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE or
WindowManager.LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH or
WindowManager.LayoutParams.FLAG_SPLIT_TOUCH,
- view = handleMenuView.rootView
+ view = handleMenuView.rootView,
+ forciblyShownTypes = if (forceShowSystemBars) { systemBars() } else { 0 }
)
} else {
parentDecor.addWindow(
@@ -210,15 +216,15 @@ class HandleMenu(
/**
* Updates handle menu's position variables to reflect its next position.
*/
- private fun updateHandleMenuPillPositions(captionX: Int) {
+ private fun updateHandleMenuPillPositions(captionX: Int, captionY: Int) {
val menuX: Int
val menuY: Int
val taskBounds = taskInfo.getConfiguration().windowConfiguration.bounds
- updateGlobalMenuPosition(taskBounds, captionX)
+ updateGlobalMenuPosition(taskBounds, captionX, captionY)
if (layoutResId == R.layout.desktop_mode_app_header) {
// Align the handle menu to the left side of the caption.
menuX = marginMenuStart
- menuY = marginMenuTop
+ menuY = captionY + marginMenuTop
} else {
if (Flags.enableHandleInputFix()) {
// In a focused decor, we use global coordinates for handle menu. Therefore we
@@ -228,26 +234,26 @@ class HandleMenu(
menuY = globalMenuPosition.y
} else {
menuX = (taskBounds.width() / 2) - (menuWidth / 2)
- menuY = marginMenuTop
+ menuY = captionY + marginMenuTop
}
}
// Handle Menu position setup.
handleMenuPosition.set(menuX.toFloat(), menuY.toFloat())
}
- private fun updateGlobalMenuPosition(taskBounds: Rect, captionX: Int) {
+ private fun updateGlobalMenuPosition(taskBounds: Rect, captionX: Int, captionY: Int) {
val nonFreeformX = captionX + (captionWidth / 2) - (menuWidth / 2)
when {
taskInfo.isFreeform -> {
globalMenuPosition.set(
/* x = */ taskBounds.left + marginMenuStart,
- /* y = */ taskBounds.top + marginMenuTop
+ /* y = */ taskBounds.top + captionY + marginMenuTop
)
}
taskInfo.isFullscreen -> {
globalMenuPosition.set(
/* x = */ nonFreeformX,
- /* y = */ marginMenuTop
+ /* y = */ marginMenuTop + captionY
)
}
taskInfo.isMultiWindow -> {
@@ -261,13 +267,13 @@ class HandleMenu(
SplitScreenConstants.SPLIT_POSITION_BOTTOM_OR_RIGHT -> {
globalMenuPosition.set(
/* x = */ leftOrTopStageBounds.width() + nonFreeformX,
- /* y = */ marginMenuTop
+ /* y = */ captionY + marginMenuTop
)
}
SplitScreenConstants.SPLIT_POSITION_TOP_OR_LEFT -> {
globalMenuPosition.set(
/* x = */ nonFreeformX,
- /* y = */ marginMenuTop
+ /* y = */ captionY + marginMenuTop
)
}
}
@@ -280,10 +286,11 @@ class HandleMenu(
*/
fun relayout(
t: SurfaceControl.Transaction,
- captionX: Int
+ captionX: Int,
+ captionY: Int,
) {
handleMenuViewContainer?.let { container ->
- updateHandleMenuPillPositions(captionX)
+ updateHandleMenuPillPositions(captionX, captionY)
container.setPosition(t, handleMenuPosition.x, handleMenuPosition.y)
}
}
@@ -675,7 +682,8 @@ interface HandleMenuFactory {
openInBrowserIntent: Intent?,
captionWidth: Int,
captionHeight: Int,
- captionX: Int
+ captionX: Int,
+ captionY: Int,
): HandleMenu
}
@@ -694,7 +702,8 @@ object DefaultHandleMenuFactory : HandleMenuFactory {
openInBrowserIntent: Intent?,
captionWidth: Int,
captionHeight: Int,
- captionX: Int
+ captionX: Int,
+ captionY: Int,
): HandleMenu {
return HandleMenu(
parentDecor,
@@ -709,7 +718,8 @@ object DefaultHandleMenuFactory : HandleMenuFactory {
openInBrowserIntent,
captionWidth,
captionHeight,
- captionX
+ captionX,
+ captionY,
)
}
}
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/WindowDecoration.java b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/WindowDecoration.java
index ce5cfd0bdc36..6b3b357f2f7b 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/WindowDecoration.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/WindowDecoration.java
@@ -256,6 +256,8 @@ public abstract class WindowDecoration<T extends View & TaskFocusStateConsumer>
outResult.mCaptionWidth = params.mCaptionWidthId != Resources.ID_NULL
? loadDimensionPixelSize(resources, params.mCaptionWidthId) : taskBounds.width();
outResult.mCaptionX = (outResult.mWidth - outResult.mCaptionWidth) / 2;
+ outResult.mCaptionY = 0;
+ outResult.mCaptionTopPadding = params.mCaptionTopPadding;
updateDecorationContainerSurface(startT, outResult);
updateCaptionContainerSurface(startT, outResult);
@@ -786,6 +788,8 @@ public abstract class WindowDecoration<T extends View & TaskFocusStateConsumer>
int mCaptionHeight;
int mCaptionWidth;
int mCaptionX;
+ int mCaptionY;
+ int mCaptionTopPadding;
final Region mCustomizableCaptionRegion = Region.obtain();
int mWidth;
int mHeight;
@@ -797,6 +801,8 @@ public abstract class WindowDecoration<T extends View & TaskFocusStateConsumer>
mCaptionHeight = 0;
mCaptionWidth = 0;
mCaptionX = 0;
+ mCaptionY = 0;
+ mCaptionTopPadding = 0;
mCustomizableCaptionRegion.setEmpty();
mRootView = null;
}
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/additionalviewcontainer/AdditionalSystemViewContainer.kt b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/additionalviewcontainer/AdditionalSystemViewContainer.kt
index 1be26f080ac8..8b6aaaf619e0 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/additionalviewcontainer/AdditionalSystemViewContainer.kt
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/additionalviewcontainer/AdditionalSystemViewContainer.kt
@@ -23,6 +23,7 @@ import android.view.Gravity
import android.view.LayoutInflater
import android.view.SurfaceControl
import android.view.View
+import android.view.WindowInsets
import android.view.WindowManager
import com.android.wm.shell.windowdecor.WindowManagerWrapper
@@ -38,6 +39,7 @@ class AdditionalSystemViewContainer(
width: Int,
height: Int,
flags: Int,
+ @WindowInsets.Type.InsetsType forciblyShownTypes: Int = 0,
override val view: View
) : AdditionalViewContainer() {
val lp: WindowManager.LayoutParams = WindowManager.LayoutParams(
@@ -49,6 +51,7 @@ class AdditionalSystemViewContainer(
title = "Additional view container of Task=$taskId"
gravity = Gravity.LEFT or Gravity.TOP
setTrustedOverlay()
+ this.forciblyShownTypes = forciblyShownTypes
}
constructor(
diff --git a/libs/WindowManager/Shell/tests/e2e/desktopmode/flicker-service/src/com/android/wm/shell/flicker/DesktopModeFlickerScenarios.kt b/libs/WindowManager/Shell/tests/e2e/desktopmode/flicker-service/src/com/android/wm/shell/flicker/DesktopModeFlickerScenarios.kt
index 7640cb1fb616..b7ddfd1fc6eb 100644
--- a/libs/WindowManager/Shell/tests/e2e/desktopmode/flicker-service/src/com/android/wm/shell/flicker/DesktopModeFlickerScenarios.kt
+++ b/libs/WindowManager/Shell/tests/e2e/desktopmode/flicker-service/src/com/android/wm/shell/flicker/DesktopModeFlickerScenarios.kt
@@ -154,6 +154,7 @@ class DesktopModeFlickerScenarios {
TaggedCujTransitionMatcher(associatedTransitionRequired = false)
)
.build(),
+ // TODO(373638597) Add AppLayerIncreasesInSize assertion
assertions = AssertionTemplates.DESKTOP_MODE_APP_VISIBILITY_ASSERTIONS
)
@@ -208,7 +209,7 @@ class DesktopModeFlickerScenarios {
assertions =
AssertionTemplates.DESKTOP_MODE_APP_VISIBILITY_ASSERTIONS +
listOf(
- AppLayerIncreasesInSize(DESKTOP_MODE_APP),
+ // TODO(373638597) Add AppLayerIncreasesInSize assertion
AppWindowHasMaxDisplayHeight(DESKTOP_MODE_APP),
AppWindowHasMaxDisplayWidth(DESKTOP_MODE_APP)
).associateBy({ it }, { AssertionInvocationGroup.BLOCKING }),
diff --git a/libs/WindowManager/Shell/tests/e2e/desktopmode/flicker-service/src/com/android/wm/shell/flicker/ResizeAppToMaximumWindowSizeLandscape.kt b/libs/WindowManager/Shell/tests/e2e/desktopmode/flicker-service/src/com/android/wm/shell/flicker/ResizeAppToMaximumWindowSizeLandscape.kt
index 0b98ba2a9cd4..aa4f133123f5 100644
--- a/libs/WindowManager/Shell/tests/e2e/desktopmode/flicker-service/src/com/android/wm/shell/flicker/ResizeAppToMaximumWindowSizeLandscape.kt
+++ b/libs/WindowManager/Shell/tests/e2e/desktopmode/flicker-service/src/com/android/wm/shell/flicker/ResizeAppToMaximumWindowSizeLandscape.kt
@@ -24,7 +24,7 @@ import android.tools.flicker.config.FlickerConfig
import android.tools.flicker.config.FlickerServiceConfig
import android.tools.flicker.junit.FlickerServiceJUnit4ClassRunner
import com.android.wm.shell.flicker.DesktopModeFlickerScenarios.Companion.CORNER_RESIZE_TO_MAXIMUM_SIZE
-import com.android.wm.shell.scenarios.ResizeAppWithCornerResize
+import com.android.wm.shell.scenarios.MaximiseAppWithCornerResize
import org.junit.Test
import org.junit.runner.RunWith
@@ -35,7 +35,7 @@ import org.junit.runner.RunWith
* Assert that the maximum window size constraint is maintained.
*/
@RunWith(FlickerServiceJUnit4ClassRunner::class)
-class ResizeAppToMaximumWindowSizeLandscape : ResizeAppWithCornerResize(
+class ResizeAppToMaximumWindowSizeLandscape : MaximiseAppWithCornerResize(
rotation = Rotation.ROTATION_90
) {
@ExpectedScenarios(["CORNER_RESIZE_TO_MAXIMUM_SIZE"])
diff --git a/libs/WindowManager/Shell/tests/e2e/desktopmode/flicker-service/src/com/android/wm/shell/flicker/ResizeAppToMaximumWindowSizePortrait.kt b/libs/WindowManager/Shell/tests/e2e/desktopmode/flicker-service/src/com/android/wm/shell/flicker/ResizeAppToMaximumWindowSizePortrait.kt
index b1c04d38a46c..e6b1ccf0111f 100644
--- a/libs/WindowManager/Shell/tests/e2e/desktopmode/flicker-service/src/com/android/wm/shell/flicker/ResizeAppToMaximumWindowSizePortrait.kt
+++ b/libs/WindowManager/Shell/tests/e2e/desktopmode/flicker-service/src/com/android/wm/shell/flicker/ResizeAppToMaximumWindowSizePortrait.kt
@@ -23,7 +23,7 @@ import android.tools.flicker.config.FlickerConfig
import android.tools.flicker.config.FlickerServiceConfig
import android.tools.flicker.junit.FlickerServiceJUnit4ClassRunner
import com.android.wm.shell.flicker.DesktopModeFlickerScenarios.Companion.CORNER_RESIZE_TO_MAXIMUM_SIZE
-import com.android.wm.shell.scenarios.ResizeAppWithCornerResize
+import com.android.wm.shell.scenarios.MaximiseAppWithCornerResize
import org.junit.Test
import org.junit.runner.RunWith
@@ -34,7 +34,7 @@ import org.junit.runner.RunWith
* Assert that the maximum window size constraint is maintained.
*/
@RunWith(FlickerServiceJUnit4ClassRunner::class)
-class ResizeAppToMaximumWindowSizePortrait : ResizeAppWithCornerResize() {
+class ResizeAppToMaximumWindowSizePortrait : MaximiseAppWithCornerResize() {
@ExpectedScenarios(["CORNER_RESIZE_TO_MAXIMUM_SIZE"])
@Test
override fun resizeAppWithCornerResizeToMaximumSize() =
diff --git a/libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/src/com/android/wm/shell/scenarios/MaximiseAppWithCornerResize.kt b/libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/src/com/android/wm/shell/scenarios/MaximiseAppWithCornerResize.kt
new file mode 100644
index 000000000000..6637b01f9d9c
--- /dev/null
+++ b/libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/src/com/android/wm/shell/scenarios/MaximiseAppWithCornerResize.kt
@@ -0,0 +1,94 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.wm.shell.scenarios
+
+import android.app.Instrumentation
+import android.tools.NavBar
+import android.tools.Rotation
+import android.tools.flicker.rules.ChangeDisplayOrientationRule
+import android.tools.traces.parsers.WindowManagerStateHelper
+import androidx.test.platform.app.InstrumentationRegistry
+import androidx.test.uiautomator.UiDevice
+import com.android.launcher3.tapl.LauncherInstrumentation
+import com.android.server.wm.flicker.helpers.DesktopModeAppHelper
+import com.android.server.wm.flicker.helpers.DesktopModeAppHelper.AppProperty
+import com.android.server.wm.flicker.helpers.NonResizeableAppHelper
+import com.android.server.wm.flicker.helpers.SimpleAppHelper
+import com.android.window.flags.Flags
+import com.android.wm.shell.Utils
+import org.junit.After
+import org.junit.Assume
+import org.junit.Before
+import org.junit.Ignore
+import org.junit.Rule
+import org.junit.Test
+
+@Ignore("Test Base Class")
+abstract class MaximiseAppWithCornerResize(
+ val rotation: Rotation = Rotation.ROTATION_0,
+ val appProperty: AppProperty = AppProperty.STANDARD
+) {
+
+ private val instrumentation: Instrumentation = InstrumentationRegistry.getInstrumentation()
+ private val tapl = LauncherInstrumentation()
+ private val wmHelper = WindowManagerStateHelper(instrumentation)
+ private val device = UiDevice.getInstance(instrumentation)
+ private val maxResizeChange = 3000
+ private val testApp =
+ DesktopModeAppHelper(
+ when (appProperty) {
+ AppProperty.STANDARD -> SimpleAppHelper(instrumentation)
+ AppProperty.NON_RESIZABLE -> NonResizeableAppHelper(instrumentation)
+ }
+ )
+
+ @Rule
+ @JvmField
+ val testSetupRule = Utils.testSetupRule(NavBar.MODE_GESTURAL, rotation)
+
+ @Before
+ fun setup() {
+ Assume.assumeTrue(Flags.enableDesktopWindowingMode() && tapl.isTablet)
+ tapl.setEnableRotation(true)
+ tapl.setExpectedRotation(rotation.value)
+ ChangeDisplayOrientationRule.setRotation(rotation)
+ testApp.enterDesktopWithDrag(wmHelper, device)
+ testApp.cornerResize(
+ wmHelper,
+ device,
+ DesktopModeAppHelper.Corners.RIGHT_TOP,
+ maxResizeChange,
+ -maxResizeChange
+ )
+ }
+
+ @Test
+ open fun resizeAppWithCornerResizeToMaximumSize() {
+ testApp.cornerResize(
+ wmHelper,
+ device,
+ DesktopModeAppHelper.Corners.LEFT_BOTTOM,
+ -maxResizeChange,
+ maxResizeChange
+ )
+ }
+
+ @After
+ fun teardown() {
+ testApp.exit(wmHelper)
+ }
+}
diff --git a/libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/src/com/android/wm/shell/scenarios/ResizeAppWithCornerResize.kt b/libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/src/com/android/wm/shell/scenarios/ResizeAppWithCornerResize.kt
index bd25639466a3..a7cebf402d8e 100644
--- a/libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/src/com/android/wm/shell/scenarios/ResizeAppWithCornerResize.kt
+++ b/libs/WindowManager/Shell/tests/e2e/desktopmode/scenarios/src/com/android/wm/shell/scenarios/ResizeAppWithCornerResize.kt
@@ -19,11 +19,13 @@ package com.android.wm.shell.scenarios
import android.app.Instrumentation
import android.tools.NavBar
import android.tools.Rotation
+import android.tools.flicker.rules.ChangeDisplayOrientationRule
import android.tools.traces.parsers.WindowManagerStateHelper
import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.uiautomator.UiDevice
import com.android.launcher3.tapl.LauncherInstrumentation
import com.android.server.wm.flicker.helpers.DesktopModeAppHelper
+import com.android.server.wm.flicker.helpers.DesktopModeAppHelper.AppProperty
import com.android.server.wm.flicker.helpers.NonResizeableAppHelper
import com.android.server.wm.flicker.helpers.SimpleAppHelper
import com.android.window.flags.Flags
@@ -63,6 +65,7 @@ abstract class ResizeAppWithCornerResize(
fun setup() {
Assume.assumeTrue(Flags.enableDesktopWindowingMode() && tapl.isTablet)
tapl.setEnableRotation(true)
+ ChangeDisplayOrientationRule.setRotation(rotation)
tapl.setExpectedRotation(rotation.value)
testApp.enterDesktopWithDrag(wmHelper, device)
}
@@ -78,34 +81,8 @@ abstract class ResizeAppWithCornerResize(
)
}
- @Test
- open fun resizeAppWithCornerResizeToMaximumSize() {
- val maxResizeChange = 3000
- testApp.cornerResize(
- wmHelper,
- device,
- DesktopModeAppHelper.Corners.RIGHT_TOP,
- maxResizeChange,
- -maxResizeChange
- )
- testApp.cornerResize(
- wmHelper,
- device,
- DesktopModeAppHelper.Corners.LEFT_BOTTOM,
- -maxResizeChange,
- maxResizeChange
- )
- }
-
@After
fun teardown() {
testApp.exit(wmHelper)
}
-
- companion object {
- enum class AppProperty {
- STANDARD,
- NON_RESIZABLE
- }
- }
}
diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/desktopmode/DesktopFullImmersiveTransitionHandlerTest.kt b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/desktopmode/DesktopFullImmersiveTransitionHandlerTest.kt
index 2e9effb44d67..b13746814f58 100644
--- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/desktopmode/DesktopFullImmersiveTransitionHandlerTest.kt
+++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/desktopmode/DesktopFullImmersiveTransitionHandlerTest.kt
@@ -16,12 +16,15 @@
package com.android.wm.shell.desktopmode
import android.app.WindowConfiguration.WINDOW_CONFIG_BOUNDS
+import android.graphics.Rect
import android.os.Binder
import android.os.IBinder
+import android.platform.test.annotations.DisableFlags
import android.platform.test.annotations.EnableFlags
import android.platform.test.flag.junit.SetFlagsRule
import android.testing.AndroidTestingRunner
import android.view.Display.DEFAULT_DISPLAY
+import android.view.Surface
import android.view.SurfaceControl
import android.view.WindowManager.TRANSIT_CHANGE
import android.view.WindowManager.TransitionFlags
@@ -68,6 +71,7 @@ class DesktopFullImmersiveTransitionHandlerTest : ShellTestCase() {
private lateinit var desktopRepository: DesktopRepository
@Mock private lateinit var mockDisplayController: DisplayController
@Mock private lateinit var mockShellTaskOrganizer: ShellTaskOrganizer
+ @Mock private lateinit var mockDisplayLayout: DisplayLayout
private val transactionSupplier = { SurfaceControl.Transaction() }
private lateinit var immersiveHandler: DesktopFullImmersiveTransitionHandler
@@ -78,7 +82,10 @@ class DesktopFullImmersiveTransitionHandlerTest : ShellTestCase() {
context, ShellInit(TestShellExecutor()), mock(), mock()
)
whenever(mockDisplayController.getDisplayLayout(DEFAULT_DISPLAY))
- .thenReturn(DisplayLayout())
+ .thenReturn(mockDisplayLayout)
+ whenever(mockDisplayLayout.getStableBounds(any())).thenAnswer { invocation ->
+ (invocation.getArgument(0) as Rect).set(STABLE_BOUNDS)
+ }
immersiveHandler = DesktopFullImmersiveTransitionHandler(
transitions = mockTransitions,
desktopRepository = desktopRepository,
@@ -101,12 +108,50 @@ class DesktopFullImmersiveTransitionHandlerTest : ShellTestCase() {
)
immersiveHandler.moveTaskToImmersive(task)
- immersiveHandler.onTransitionReady(mockBinder, createTransitionInfo())
+ immersiveHandler.onTransitionReady(
+ transition = mockBinder,
+ info = createTransitionInfo(
+ changes = listOf(
+ TransitionInfo.Change(task.token, SurfaceControl()).apply {
+ taskInfo = task
+ }
+ )
+ )
+ )
assertThat(desktopRepository.isTaskInFullImmersiveState(task.taskId)).isTrue()
}
@Test
+ @EnableFlags(Flags.FLAG_ENABLE_RESTORE_TO_PREVIOUS_SIZE_FROM_DESKTOP_IMMERSIVE)
+ fun enterImmersive_savesPreImmersiveBounds() {
+ val task = createFreeformTask()
+ val mockBinder = mock(IBinder::class.java)
+ whenever(mockTransitions.startTransition(eq(TRANSIT_CHANGE), any(), eq(immersiveHandler)))
+ .thenReturn(mockBinder)
+ desktopRepository.setTaskInFullImmersiveState(
+ displayId = task.displayId,
+ taskId = task.taskId,
+ immersive = false
+ )
+ assertThat(desktopRepository.removeBoundsBeforeFullImmersive(task.taskId)).isNull()
+
+ immersiveHandler.moveTaskToImmersive(task)
+ immersiveHandler.onTransitionReady(
+ transition = mockBinder,
+ info = createTransitionInfo(
+ changes = listOf(
+ TransitionInfo.Change(task.token, SurfaceControl()).apply {
+ taskInfo = task
+ }
+ )
+ )
+ )
+
+ assertThat(desktopRepository.removeBoundsBeforeFullImmersive(task.taskId)).isNotNull()
+ }
+
+ @Test
fun exitImmersive_transitionReady_updatesRepository() {
val task = createFreeformTask()
val mockBinder = mock(IBinder::class.java)
@@ -119,7 +164,69 @@ class DesktopFullImmersiveTransitionHandlerTest : ShellTestCase() {
)
immersiveHandler.moveTaskToNonImmersive(task)
- immersiveHandler.onTransitionReady(mockBinder, createTransitionInfo())
+ immersiveHandler.onTransitionReady(
+ transition = mockBinder,
+ info = createTransitionInfo(
+ changes = listOf(
+ TransitionInfo.Change(task.token, SurfaceControl()).apply {
+ taskInfo = task
+ }
+ )
+ )
+ )
+
+ assertThat(desktopRepository.isTaskInFullImmersiveState(task.taskId)).isFalse()
+ }
+
+ @Test
+ @EnableFlags(Flags.FLAG_ENABLE_RESTORE_TO_PREVIOUS_SIZE_FROM_DESKTOP_IMMERSIVE)
+ fun exitImmersive_onTransitionReady_removesBoundsBeforeImmersive() {
+ val task = createFreeformTask()
+ val mockBinder = mock(IBinder::class.java)
+ whenever(mockTransitions.startTransition(eq(TRANSIT_CHANGE), any(), eq(immersiveHandler)))
+ .thenReturn(mockBinder)
+ desktopRepository.setTaskInFullImmersiveState(
+ displayId = task.displayId,
+ taskId = task.taskId,
+ immersive = true
+ )
+ desktopRepository.saveBoundsBeforeFullImmersive(task.taskId, Rect(100, 100, 600, 600))
+
+ immersiveHandler.moveTaskToNonImmersive(task)
+ immersiveHandler.onTransitionReady(
+ transition = mockBinder,
+ info = createTransitionInfo(
+ changes = listOf(
+ TransitionInfo.Change(task.token, SurfaceControl()).apply {
+ taskInfo = task
+ }
+ )
+ )
+ )
+
+ assertThat(desktopRepository.removeBoundsBeforeMaximize(task.taskId)).isNull()
+ }
+
+ @Test
+ fun onTransitionReady_displayRotation_exitsImmersive() {
+ val task = createFreeformTask()
+ desktopRepository.setTaskInFullImmersiveState(
+ displayId = task.displayId,
+ taskId = task.taskId,
+ immersive = true
+ )
+
+ immersiveHandler.onTransitionReady(
+ transition = mock(IBinder::class.java),
+ info = createTransitionInfo(
+ changes = listOf(
+ TransitionInfo.Change(task.token, SurfaceControl()).apply {
+ taskInfo = task
+ setRotation(/* start= */ Surface.ROTATION_0, /* end= */ Surface.ROTATION_90)
+ }
+ )
+ )
+ )
assertThat(desktopRepository.isTaskInFullImmersiveState(task.taskId)).isFalse()
}
@@ -361,6 +468,103 @@ class DesktopFullImmersiveTransitionHandlerTest : ShellTestCase() {
assertThat(desktopRepository.isTaskInFullImmersiveState(task.taskId)).isFalse()
}
+ @Test
+ @EnableFlags(
+ Flags.FLAG_ENABLE_FULLY_IMMERSIVE_IN_DESKTOP,
+ Flags.FLAG_ENABLE_RESTORE_TO_PREVIOUS_SIZE_FROM_DESKTOP_IMMERSIVE
+ )
+ fun onTransitionReady_pendingExit_removesBoundsBeforeImmersive() {
+ val task = createFreeformTask()
+ whenever(mockShellTaskOrganizer.getRunningTaskInfo(task.taskId)).thenReturn(task)
+ val wct = WindowContainerTransaction()
+ val transition = Binder()
+ desktopRepository.setTaskInFullImmersiveState(
+ displayId = DEFAULT_DISPLAY,
+ taskId = task.taskId,
+ immersive = true
+ )
+ desktopRepository.saveBoundsBeforeFullImmersive(task.taskId, Rect(100, 100, 600, 600))
+ immersiveHandler.exitImmersiveIfApplicable(transition, wct, DEFAULT_DISPLAY)
+
+ immersiveHandler.onTransitionReady(
+ transition = transition,
+ info = createTransitionInfo(
+ changes = listOf(
+ TransitionInfo.Change(task.token, SurfaceControl()).apply { taskInfo = task }
+ )
+ )
+ )
+
+ assertThat(desktopRepository.removeBoundsBeforeMaximize(task.taskId)).isNull()
+ }
+
+ @Test
+ @EnableFlags(Flags.FLAG_ENABLE_FULLY_IMMERSIVE_IN_DESKTOP)
+ @DisableFlags(Flags.FLAG_ENABLE_RESTORE_TO_PREVIOUS_SIZE_FROM_DESKTOP_IMMERSIVE)
+ fun exitImmersiveIfApplicable_changesBoundsToMaximize() {
+ val task = createFreeformTask()
+ whenever(mockShellTaskOrganizer.getRunningTaskInfo(task.taskId)).thenReturn(task)
+ val wct = WindowContainerTransaction()
+ desktopRepository.setTaskInFullImmersiveState(
+ displayId = DEFAULT_DISPLAY,
+ taskId = task.taskId,
+ immersive = true
+ )
+
+ immersiveHandler.exitImmersiveIfApplicable(wct = wct, taskInfo = task)
+
+ assertThat(
+ wct.hasBoundsChange(task.token, calculateMaximizeBounds(mockDisplayLayout, task))
+ ).isTrue()
+ }
+
+ @Test
+ @EnableFlags(
+ Flags.FLAG_ENABLE_FULLY_IMMERSIVE_IN_DESKTOP,
+ Flags.FLAG_ENABLE_RESTORE_TO_PREVIOUS_SIZE_FROM_DESKTOP_IMMERSIVE
+ )
+ fun exitImmersiveIfApplicable_preImmersiveBoundsSaved_changesBoundsToPreImmersiveBounds() {
+ val task = createFreeformTask()
+ whenever(mockShellTaskOrganizer.getRunningTaskInfo(task.taskId)).thenReturn(task)
+ val wct = WindowContainerTransaction()
+ desktopRepository.setTaskInFullImmersiveState(
+ displayId = DEFAULT_DISPLAY,
+ taskId = task.taskId,
+ immersive = true
+ )
+ val preImmersiveBounds = Rect(100, 100, 500, 500)
+ desktopRepository.saveBoundsBeforeFullImmersive(task.taskId, preImmersiveBounds)
+
+ immersiveHandler.exitImmersiveIfApplicable(wct = wct, taskInfo = task)
+
+ assertThat(
+ wct.hasBoundsChange(task.token, preImmersiveBounds)
+ ).isTrue()
+ }
+
+ @Test
+ @EnableFlags(
+ Flags.FLAG_ENABLE_FULLY_IMMERSIVE_IN_DESKTOP,
+ Flags.FLAG_ENABLE_RESTORE_TO_PREVIOUS_SIZE_FROM_DESKTOP_IMMERSIVE,
+ Flags.FLAG_ENABLE_WINDOWING_DYNAMIC_INITIAL_BOUNDS
+ )
+ fun exitImmersiveIfApplicable_preImmersiveBoundsNotSaved_changesBoundsToInitialBounds() {
+ val task = createFreeformTask()
+ whenever(mockShellTaskOrganizer.getRunningTaskInfo(task.taskId)).thenReturn(task)
+ val wct = WindowContainerTransaction()
+ desktopRepository.setTaskInFullImmersiveState(
+ displayId = DEFAULT_DISPLAY,
+ taskId = task.taskId,
+ immersive = true
+ )
+
+ immersiveHandler.exitImmersiveIfApplicable(wct = wct, taskInfo = task)
+
+ assertThat(
+ wct.hasBoundsChange(task.token, calculateInitialBounds(mockDisplayLayout, task))
+ ).isTrue()
+ }
+
private fun createTransitionInfo(
@TransitionType type: Int = TRANSIT_CHANGE,
@TransitionFlags flags: Int = 0,
@@ -374,4 +578,17 @@ class DesktopFullImmersiveTransitionHandlerTest : ShellTestCase() {
change.key == token.asBinder()
&& (change.value.windowSetMask and WINDOW_CONFIG_BOUNDS) != 0
}
+
+ private fun WindowContainerTransaction.hasBoundsChange(
+ token: WindowContainerToken,
+ bounds: Rect,
+ ): Boolean = this.changes.any { change ->
+ change.key == token.asBinder()
+ && (change.value.windowSetMask and WINDOW_CONFIG_BOUNDS) != 0
+ && change.value.configuration.windowConfiguration.bounds == bounds
+ }
+
+ companion object {
+ private val STABLE_BOUNDS = Rect(0, 100, 2000, 1900)
+ }
}
diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/desktopmode/DesktopRepositoryTest.kt b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/desktopmode/DesktopRepositoryTest.kt
index e20f0ecb1f3b..3e2280393c2b 100644
--- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/desktopmode/DesktopRepositoryTest.kt
+++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/desktopmode/DesktopRepositoryTest.kt
@@ -746,6 +746,18 @@ class DesktopRepositoryTest : ShellTestCase() {
}
@Test
+ fun removeFreeformTask_removesTaskBoundsBeforeImmersive() {
+ val taskId = 1
+ repo.addActiveTask(THIRD_DISPLAY, taskId)
+ repo.addOrMoveFreeformTaskToTop(THIRD_DISPLAY, taskId)
+ repo.saveBoundsBeforeFullImmersive(taskId, Rect(0, 0, 200, 200))
+
+ repo.removeFreeformTask(THIRD_DISPLAY, taskId)
+
+ assertThat(repo.removeBoundsBeforeFullImmersive(taskId)).isNull()
+ }
+
+ @Test
fun removeFreeformTask_removesActiveTask() {
val taskId = 1
val listener = TestListener()
@@ -805,6 +817,28 @@ class DesktopRepositoryTest : ShellTestCase() {
}
@Test
+ fun saveBoundsBeforeImmersive_boundsSavedByTaskId() {
+ val taskId = 1
+ val bounds = Rect(0, 0, 200, 200)
+
+ repo.saveBoundsBeforeFullImmersive(taskId, bounds)
+
+ assertThat(repo.removeBoundsBeforeFullImmersive(taskId)).isEqualTo(bounds)
+ }
+
+ @Test
+ fun removeBoundsBeforeImmersive_returnsNullAfterBoundsRemoved() {
+ val taskId = 1
+ val bounds = Rect(0, 0, 200, 200)
+ repo.saveBoundsBeforeFullImmersive(taskId, bounds)
+ repo.removeBoundsBeforeFullImmersive(taskId)
+
+ val boundsBeforeImmersive = repo.removeBoundsBeforeFullImmersive(taskId)
+
+ assertThat(boundsBeforeImmersive).isNull()
+ }
+
+ @Test
fun isMinimizedTask_minimizeTaskNotCalled_noTasksMinimized() {
assertThat(repo.isMinimizedTask(taskId = 0)).isFalse()
assertThat(repo.isMinimizedTask(taskId = 1)).isFalse()
diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/desktopmode/DesktopTasksControllerTest.kt b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/desktopmode/DesktopTasksControllerTest.kt
index f9376570dc83..113990e9d7d2 100644
--- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/desktopmode/DesktopTasksControllerTest.kt
+++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/desktopmode/DesktopTasksControllerTest.kt
@@ -97,6 +97,7 @@ import com.android.wm.shell.desktopmode.DesktopTestHelpers.Companion.createFreef
import com.android.wm.shell.desktopmode.DesktopTestHelpers.Companion.createFullscreenTask
import com.android.wm.shell.desktopmode.DesktopTestHelpers.Companion.createHomeTask
import com.android.wm.shell.desktopmode.DesktopTestHelpers.Companion.createSplitScreenTask
+import com.android.wm.shell.desktopmode.minimize.DesktopWindowLimitRemoteHandler
import com.android.wm.shell.desktopmode.persistence.Desktop
import com.android.wm.shell.desktopmode.persistence.DesktopPersistentRepository
import com.android.wm.shell.draganddrop.DragAndDropController
@@ -122,6 +123,7 @@ import java.util.function.Consumer
import java.util.Optional
import junit.framework.Assert.assertFalse
import junit.framework.Assert.assertTrue
+import kotlin.test.assertIs
import kotlin.test.assertNotNull
import kotlin.test.assertNull
import kotlinx.coroutines.CoroutineScope
@@ -1338,7 +1340,7 @@ class DesktopTasksControllerTest : ShellTestCase() {
val task1 = setUpFreeformTask()
setUpFreeformTask()
- controller.moveTaskToFront(task1)
+ controller.moveTaskToFront(task1, remoteTransition = null)
val wct = getLatestWct(type = TRANSIT_TO_FRONT)
assertThat(wct.hierarchyOps).hasSize(1)
@@ -1350,7 +1352,7 @@ class DesktopTasksControllerTest : ShellTestCase() {
setUpHomeTask()
val freeformTasks = (1..MAX_TASK_LIMIT + 1).map { _ -> setUpFreeformTask() }
- controller.moveTaskToFront(freeformTasks[0])
+ controller.moveTaskToFront(freeformTasks[0], remoteTransition = null)
val wct = getLatestWct(type = TRANSIT_TO_FRONT)
assertThat(wct.hierarchyOps.size).isEqualTo(2) // move-to-front + minimize
@@ -1359,11 +1361,40 @@ class DesktopTasksControllerTest : ShellTestCase() {
}
@Test
+ fun moveTaskToFront_remoteTransition_usesOneshotHandler() {
+ setUpHomeTask()
+ val freeformTasks = List(MAX_TASK_LIMIT) { setUpFreeformTask() }
+ val transitionHandlerArgCaptor = ArgumentCaptor.forClass(TransitionHandler::class.java)
+ whenever(
+ transitions.startTransition(anyInt(), any(), transitionHandlerArgCaptor.capture())
+ ).thenReturn(Binder())
+
+ controller.moveTaskToFront(freeformTasks[0], RemoteTransition(TestRemoteTransition()))
+
+ assertIs<OneShotRemoteHandler>(transitionHandlerArgCaptor.value)
+ }
+
+ @Test
+ fun moveTaskToFront_bringsTasksOverLimit_remoteTransition_usesWindowLimitHandler() {
+ setUpHomeTask()
+ val freeformTasks = List(MAX_TASK_LIMIT + 1) { setUpFreeformTask() }
+ val transitionHandlerArgCaptor = ArgumentCaptor.forClass(TransitionHandler::class.java)
+ whenever(
+ transitions.startTransition(anyInt(), any(), transitionHandlerArgCaptor.capture())
+ ).thenReturn(Binder())
+
+ controller.moveTaskToFront(freeformTasks[0], RemoteTransition(TestRemoteTransition()))
+
+ assertThat(transitionHandlerArgCaptor.value)
+ .isInstanceOf(DesktopWindowLimitRemoteHandler::class.java)
+ }
+
+ @Test
fun moveTaskToFront_backgroundTask_launchesTask() {
val task = createTaskInfo(1)
whenever(shellTaskOrganizer.getRunningTaskInfo(anyInt())).thenReturn(null)
- controller.moveTaskToFront(task.taskId)
+ controller.moveTaskToFront(task.taskId, remoteTransition = null)
val wct = getLatestWct(type = TRANSIT_OPEN)
assertThat(wct.hierarchyOps).hasSize(1)
@@ -1376,12 +1407,12 @@ class DesktopTasksControllerTest : ShellTestCase() {
val task = createTaskInfo(1001)
whenever(shellTaskOrganizer.getRunningTaskInfo(task.taskId)).thenReturn(null)
- controller.moveTaskToFront(task.taskId)
+ controller.moveTaskToFront(task.taskId, remoteTransition = null)
val wct = getLatestWct(type = TRANSIT_OPEN)
assertThat(wct.hierarchyOps.size).isEqualTo(2) // launch + minimize
- wct.assertReorderAt(0, freeformTasks[0], toTop = false)
- wct.assertLaunchTaskAt(1, task.taskId, WINDOWING_MODE_FREEFORM)
+ wct.assertLaunchTaskAt(0, task.taskId, WINDOWING_MODE_FREEFORM)
+ wct.assertReorderAt(1, freeformTasks[0], toTop = false)
}
@Test
@@ -3372,7 +3403,7 @@ class DesktopTasksControllerTest : ShellTestCase() {
.exitImmersiveIfApplicable(any(), eq(task.displayId))).thenReturn(runOnStartTransit)
whenever(transitions.startTransition(any(), any(), anyOrNull())).thenReturn(transition)
- controller.moveTaskToFront(task.taskId)
+ controller.moveTaskToFront(task.taskId, remoteTransition = null)
verify(mockDesktopFullImmersiveTransitionHandler)
.exitImmersiveIfApplicable(any(), eq(task.displayId))
@@ -3388,7 +3419,7 @@ class DesktopTasksControllerTest : ShellTestCase() {
.exitImmersiveIfApplicable(any(), eq(task.displayId))).thenReturn(runOnStartTransit)
whenever(transitions.startTransition(any(), any(), anyOrNull())).thenReturn(transition)
- controller.moveTaskToFront(task.taskId)
+ controller.moveTaskToFront(task.taskId, remoteTransition = null)
verify(mockDesktopFullImmersiveTransitionHandler)
.exitImmersiveIfApplicable(any(), eq(task.displayId))
diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/desktopmode/DesktopTasksTransitionObserverTest.kt b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/desktopmode/DesktopTasksTransitionObserverTest.kt
index fe87aa88a8db..737439ce3cfe 100644
--- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/desktopmode/DesktopTasksTransitionObserverTest.kt
+++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/desktopmode/DesktopTasksTransitionObserverTest.kt
@@ -40,6 +40,7 @@ import com.android.window.flags.Flags
import com.android.wm.shell.MockToken
import com.android.wm.shell.ShellTaskOrganizer
import com.android.wm.shell.common.ShellExecutor
+import com.android.wm.shell.desktopmode.DesktopModeTransitionTypes.TRANSIT_EXIT_DESKTOP_MODE_TASK_DRAG
import com.android.wm.shell.shared.desktopmode.DesktopModeStatus
import com.android.wm.shell.sysui.ShellInit
import com.android.wm.shell.transition.Transitions
@@ -126,14 +127,32 @@ class DesktopTasksTransitionObserverTest {
@Test
@EnableFlags(Flags.FLAG_ENABLE_DESKTOP_WINDOWING_BACK_NAVIGATION)
- fun removeTasks_onTaskFullscreenLaunch_taskRemovedFromRepo() {
+ fun removeTasks_onTaskFullscreenLaunchWithOpenTransition_taskRemovedFromRepo() {
val task = createTaskInfo(1, WINDOWING_MODE_FULLSCREEN)
whenever(taskRepository.getVisibleTaskCount(any())).thenReturn(1)
whenever(taskRepository.isActiveTask(task.taskId)).thenReturn(true)
transitionObserver.onTransitionReady(
transition = mock(),
- info = createOpenTransition(task),
+ info = createOpenChangeTransition(task),
+ startTransaction = mock(),
+ finishTransaction = mock(),
+ )
+
+ verify(taskRepository, never()).minimizeTask(task.displayId, task.taskId)
+ verify(taskRepository).removeFreeformTask(task.displayId, task.taskId)
+ }
+
+ @Test
+ @EnableFlags(Flags.FLAG_ENABLE_DESKTOP_WINDOWING_BACK_NAVIGATION)
+ fun removeTasks_onTaskFullscreenLaunchExitDesktopTransition_taskRemovedFromRepo() {
+ val task = createTaskInfo(1, WINDOWING_MODE_FULLSCREEN)
+ whenever(taskRepository.getVisibleTaskCount(any())).thenReturn(1)
+ whenever(taskRepository.isActiveTask(task.taskId)).thenReturn(true)
+
+ transitionObserver.onTransitionReady(
+ transition = mock(),
+ info = createOpenChangeTransition(task, TRANSIT_EXIT_DESKTOP_MODE_TASK_DRAG),
startTransaction = mock(),
finishTransaction = mock(),
)
@@ -178,8 +197,9 @@ class DesktopTasksTransitionObserverTest {
}
}
- private fun createOpenTransition(
- task: RunningTaskInfo?
+ private fun createOpenChangeTransition(
+ task: RunningTaskInfo?,
+ type: Int = TRANSIT_OPEN
): TransitionInfo {
return TransitionInfo(TRANSIT_OPEN, 0 /* flags */).apply {
addChange(
diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/desktopmode/minimize/DesktopWindowLimitRemoteHandlerTest.kt b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/desktopmode/minimize/DesktopWindowLimitRemoteHandlerTest.kt
new file mode 100644
index 000000000000..6a5d9f67e4a7
--- /dev/null
+++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/desktopmode/minimize/DesktopWindowLimitRemoteHandlerTest.kt
@@ -0,0 +1,167 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.wm.shell.desktopmode.minimize
+
+import android.app.ActivityManager
+import android.app.WindowConfiguration.WINDOWING_MODE_FREEFORM
+import android.os.Binder
+import android.os.IBinder
+import android.testing.AndroidTestingRunner
+import android.view.SurfaceControl.Transaction
+import android.view.WindowManager.TRANSIT_TO_BACK
+import android.view.WindowManager.TRANSIT_TO_FRONT
+import android.window.IRemoteTransition
+import android.window.RemoteTransition
+import androidx.test.filters.SmallTest
+import com.android.wm.shell.RootTaskDisplayAreaOrganizer
+import com.android.wm.shell.TestRunningTaskInfoBuilder
+import com.android.wm.shell.TestShellExecutor
+import com.android.wm.shell.transition.TransitionInfoBuilder
+import com.android.wm.shell.transition.Transitions
+import com.google.common.truth.Truth.assertThat
+import org.junit.Before
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.mockito.ArgumentMatchers.any
+import org.mockito.ArgumentMatchers.anyInt
+import org.mockito.Mockito.mock
+import org.mockito.Mockito.times
+import org.mockito.Mockito.verify
+import org.mockito.kotlin.mock
+import org.mockito.kotlin.whenever
+
+@SmallTest
+@RunWith(AndroidTestingRunner::class)
+class DesktopWindowLimitRemoteHandlerTest {
+
+ private val shellExecutor = TestShellExecutor()
+ private val transition: IBinder = Binder()
+
+ private val rootTaskDisplayAreaOrganizer = mock<RootTaskDisplayAreaOrganizer>()
+ private val remoteTransition = mock<RemoteTransition>()
+ private val iRemoteTransition = mock<IRemoteTransition>()
+ private val startT = mock<Transaction>()
+ private val finishT = mock<Transaction>()
+ private val finishCallback = mock<Transitions.TransitionFinishCallback>()
+
+ @Before
+ fun setUp() {
+ whenever(remoteTransition.remoteTransition).thenReturn(iRemoteTransition)
+ whenever(iRemoteTransition.asBinder()).thenReturn(mock(IBinder::class.java))
+ }
+
+ private fun createRemoteHandler(taskIdToMinimize: Int) =
+ DesktopWindowLimitRemoteHandler(
+ shellExecutor, rootTaskDisplayAreaOrganizer, remoteTransition, taskIdToMinimize)
+
+ @Test
+ fun startAnimation_dontSetTransition_returnsFalse() {
+ val minimizeTask = createDesktopTask()
+ val remoteHandler = createRemoteHandler(taskIdToMinimize = minimizeTask.taskId)
+
+ assertThat(remoteHandler.startAnimation(transition,
+ createMinimizeTransitionInfo(minimizeTask), startT, finishT, finishCallback)
+ ).isFalse()
+ }
+
+ @Test
+ fun startAnimation_noMinimizeChange_returnsFalse() {
+ val remoteHandler = createRemoteHandler(taskIdToMinimize = 1)
+ remoteHandler.setTransition(transition)
+ val info = createToFrontTransitionInfo()
+
+ assertThat(
+ remoteHandler.startAnimation(transition, info, startT, finishT, finishCallback)
+ ).isFalse()
+ }
+
+ @Test
+ fun startAnimation_correctTransition_returnsTrue() {
+ val minimizeTask = createDesktopTask()
+ val remoteHandler = createRemoteHandler(taskIdToMinimize = minimizeTask.taskId)
+ remoteHandler.setTransition(transition)
+ val info = createMinimizeTransitionInfo(minimizeTask)
+
+ assertThat(
+ remoteHandler.startAnimation(transition, info, startT, finishT, finishCallback)
+ ).isTrue()
+ }
+
+ @Test
+ fun startAnimation_noMinimizeChange_doesNotReparentMinimizeChange() {
+ val remoteHandler = createRemoteHandler(taskIdToMinimize = 1)
+ remoteHandler.setTransition(transition)
+ val info = createToFrontTransitionInfo()
+
+ remoteHandler.startAnimation(transition, info, startT, finishT, finishCallback)
+
+ verify(rootTaskDisplayAreaOrganizer, times(0))
+ .reparentToDisplayArea(anyInt(), any(), any())
+ }
+
+ @Test
+ fun startAnimation_hasMinimizeChange_reparentsMinimizeChange() {
+ val minimizeTask = createDesktopTask()
+ val remoteHandler = createRemoteHandler(taskIdToMinimize = minimizeTask.taskId)
+ remoteHandler.setTransition(transition)
+ val info = createMinimizeTransitionInfo(minimizeTask)
+
+ remoteHandler.startAnimation(transition, info, startT, finishT, finishCallback)
+
+ verify(rootTaskDisplayAreaOrganizer).reparentToDisplayArea(anyInt(), any(), any())
+ }
+
+ @Test
+ fun startAnimation_noMinimizeChange_doesNotStartRemoteAnimation() {
+ val minimizeTask = createDesktopTask()
+ val remoteHandler = createRemoteHandler(taskIdToMinimize = minimizeTask.taskId)
+ remoteHandler.setTransition(transition)
+ val info = createToFrontTransitionInfo()
+
+ remoteHandler.startAnimation(transition, info, startT, finishT, finishCallback)
+
+ verify(iRemoteTransition, times(0)).startAnimation(any(), any(), any(), any())
+ }
+
+ @Test
+ fun startAnimation_hasMinimizeChange_startsRemoteAnimation() {
+ val minimizeTask = createDesktopTask()
+ val remoteHandler = createRemoteHandler(taskIdToMinimize = minimizeTask.taskId)
+ remoteHandler.setTransition(transition)
+ val info = createMinimizeTransitionInfo(minimizeTask)
+
+ remoteHandler.startAnimation(transition, info, startT, finishT, finishCallback)
+
+ verify(iRemoteTransition).startAnimation(any(), any(), any(), any())
+ }
+
+ private fun createDesktopTask() =
+ TestRunningTaskInfoBuilder().setWindowingMode(WINDOWING_MODE_FREEFORM).build()
+
+ private fun createToFrontTransitionInfo() =
+ TransitionInfoBuilder(TRANSIT_TO_FRONT)
+ .addChange(TRANSIT_TO_FRONT,
+ TestRunningTaskInfoBuilder().setWindowingMode(WINDOWING_MODE_FREEFORM).build())
+ .build()
+
+ private fun createMinimizeTransitionInfo(minimizeTask: ActivityManager.RunningTaskInfo) =
+ TransitionInfoBuilder(TRANSIT_TO_FRONT)
+ .addChange(TRANSIT_TO_FRONT,
+ TestRunningTaskInfoBuilder().setWindowingMode(WINDOWING_MODE_FREEFORM).build())
+ .addChange(TRANSIT_TO_BACK, minimizeTask)
+ .build()
+}
diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/unfold/UnfoldTransitionHandlerTest.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/unfold/UnfoldTransitionHandlerTest.java
index 22da66dd5e67..c36b88e34835 100644
--- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/unfold/UnfoldTransitionHandlerTest.java
+++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/unfold/UnfoldTransitionHandlerTest.java
@@ -20,6 +20,8 @@ import static android.view.WindowManager.TRANSIT_CHANGE;
import static android.view.WindowManager.TRANSIT_FLAG_KEYGUARD_GOING_AWAY;
import static android.view.WindowManager.TRANSIT_NONE;
+import static com.android.wm.shell.unfold.UnfoldTransitionHandler.FINISH_ANIMATION_TIMEOUT_MILLIS;
+
import static com.google.common.truth.Truth.assertThat;
import static org.mockito.ArgumentMatchers.any;
@@ -32,7 +34,9 @@ import static org.mockito.Mockito.verify;
import android.app.ActivityManager;
import android.graphics.Rect;
import android.os.Binder;
+import android.os.Handler;
import android.os.IBinder;
+import android.os.test.TestLooper;
import android.view.Display;
import android.view.SurfaceControl;
import android.window.TransitionInfo;
@@ -67,6 +71,8 @@ public class UnfoldTransitionHandlerTest {
private FullscreenUnfoldTaskAnimator mFullscreenUnfoldTaskAnimator;
private SplitTaskUnfoldAnimator mSplitTaskUnfoldAnimator;
private Transitions mTransitions;
+ private TestLooper mTestLooper;
+ private Handler mHandler;
private final IBinder mTransition = new Binder();
@@ -75,6 +81,9 @@ public class UnfoldTransitionHandlerTest {
final ShellExecutor executor = new TestSyncExecutor();
final ShellInit shellInit = new ShellInit(executor);
+ mTestLooper = new TestLooper();
+ mHandler = new Handler(mTestLooper.getLooper());
+
mFullscreenUnfoldTaskAnimator = mock(FullscreenUnfoldTaskAnimator.class);
mSplitTaskUnfoldAnimator = mock(SplitTaskUnfoldAnimator.class);
mTransitions = mock(Transitions.class);
@@ -86,6 +95,7 @@ public class UnfoldTransitionHandlerTest {
mSplitTaskUnfoldAnimator,
mTransactionPool,
executor,
+ mHandler,
mTransitions
);
@@ -159,6 +169,7 @@ public class UnfoldTransitionHandlerTest {
TransitionFinishCallback mergeFinishCallback = mock(TransitionFinishCallback.class);
mUnfoldTransitionHandler.mergeAnimation(new Binder(), createFoldTransitionInfo(),
mock(SurfaceControl.Transaction.class), mTransition, mergeFinishCallback);
+ mTestLooper.dispatchAll();
// Verify that fold transition is merged into unfold and that unfold is finished
final InOrder inOrder = inOrder(mergeFinishCallback, finishCallback);
@@ -201,6 +212,25 @@ public class UnfoldTransitionHandlerTest {
}
@Test
+ public void startAnimation_animationHasNotFinishedAfterTimeout_finishesTheTransition() {
+ TransitionRequestInfo requestInfo = createUnfoldTransitionRequestInfo();
+ mUnfoldTransitionHandler.handleRequest(mTransition, requestInfo);
+ TransitionFinishCallback finishCallback = mock(TransitionFinishCallback.class);
+ mUnfoldTransitionHandler.startAnimation(
+ mTransition,
+ mock(TransitionInfo.class),
+ mock(SurfaceControl.Transaction.class),
+ mock(SurfaceControl.Transaction.class),
+ finishCallback
+ );
+
+ mTestLooper.moveTimeForward(FINISH_ANIMATION_TIMEOUT_MILLIS + 1);
+ mTestLooper.dispatchAll();
+
+ verify(finishCallback).onTransitionFinished(any());
+ }
+
+ @Test
public void startAnimation_differentTransitionFromRequestWithResize_doesNotStartAnimation() {
mUnfoldTransitionHandler.handleRequest(new Binder(), createNoneTransitionInfo());
TransitionFinishCallback finishCallback = mock(TransitionFinishCallback.class);
diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/DesktopHeaderManageWindowsMenuTest.kt b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/DesktopHeaderManageWindowsMenuTest.kt
new file mode 100644
index 000000000000..f9f760e3f482
--- /dev/null
+++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/DesktopHeaderManageWindowsMenuTest.kt
@@ -0,0 +1,111 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.wm.shell.windowdecor
+
+import android.app.ActivityManager.RunningTaskInfo
+import android.app.WindowConfiguration.ACTIVITY_TYPE_STANDARD
+import android.app.WindowConfiguration.WINDOWING_MODE_FREEFORM
+import android.platform.test.annotations.EnableFlags
+import android.platform.test.flag.junit.SetFlagsRule
+import android.testing.AndroidTestingRunner
+import android.testing.TestableLooper
+import android.view.SurfaceControl
+import androidx.test.filters.SmallTest
+import com.android.window.flags.Flags
+import com.android.wm.shell.MockToken
+import com.android.wm.shell.ShellTestCase
+import com.android.wm.shell.TestRunningTaskInfoBuilder
+import com.android.wm.shell.TestShellExecutor
+import com.android.wm.shell.desktopmode.DesktopRepository
+import com.android.wm.shell.sysui.ShellInit
+import com.android.wm.shell.windowdecor.additionalviewcontainer.AdditionalSystemViewContainer
+import com.google.common.truth.Truth.assertThat
+import org.junit.After
+import org.junit.Before
+import org.junit.Rule
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.mockito.kotlin.mock
+
+/**
+ * Tests for [DesktopHeaderManageWindowsMenu].
+ *
+ * Build/Install/Run:
+ * atest WMShellUnitTests:DesktopHeaderManageWindowsMenuTest
+ */
+@SmallTest
+@TestableLooper.RunWithLooper
+@RunWith(AndroidTestingRunner::class)
+class DesktopHeaderManageWindowsMenuTest : ShellTestCase() {
+
+ @JvmField
+ @Rule
+ val setFlagsRule: SetFlagsRule = SetFlagsRule()
+
+ private lateinit var desktopRepository: DesktopRepository
+ private lateinit var menu: DesktopHeaderManageWindowsMenu
+
+ @Before
+ fun setUp() {
+ desktopRepository = DesktopRepository(
+ context = context,
+ shellInit = ShellInit(TestShellExecutor()),
+ persistentRepository = mock(),
+ mainCoroutineScope = mock()
+ )
+ }
+
+ @After
+ fun tearDown() {
+ menu.close()
+ }
+
+ @Test
+ @EnableFlags(Flags.FLAG_ENABLE_FULLY_IMMERSIVE_IN_DESKTOP)
+ fun testShow_forImmersiveTask_usesSystemViewContainer() {
+ val task = createFreeformTask()
+ desktopRepository.setTaskInFullImmersiveState(
+ displayId = task.displayId,
+ taskId = task.taskId,
+ immersive = true
+ )
+
+ menu = createMenu(task)
+
+ assertThat(menu.menuViewContainer).isInstanceOf(AdditionalSystemViewContainer::class.java)
+ }
+
+ private fun createMenu(task: RunningTaskInfo) = DesktopHeaderManageWindowsMenu(
+ callerTaskInfo = task,
+ x = 0,
+ y = 0,
+ displayController = mock(),
+ rootTdaOrganizer = mock(),
+ context = context,
+ desktopRepository = desktopRepository,
+ surfaceControlBuilderSupplier = { SurfaceControl.Builder() },
+ surfaceControlTransactionSupplier = { SurfaceControl.Transaction() },
+ snapshotList = emptyList(),
+ onIconClickListener = {},
+ onOutsideClickListener = {},
+ )
+
+ private fun createFreeformTask(): RunningTaskInfo = TestRunningTaskInfoBuilder()
+ .setToken(MockToken().token())
+ .setActivityType(ACTIVITY_TYPE_STANDARD)
+ .setWindowingMode(WINDOWING_MODE_FREEFORM)
+ .build()
+}
diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecorationTests.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecorationTests.java
index 1d11d2e8ff06..320887212f54 100644
--- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecorationTests.java
+++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecorationTests.java
@@ -259,7 +259,8 @@ public class DesktopModeWindowDecorationTests extends ShellTestCase {
doReturn(defaultDisplay).when(mMockDisplayController).getDisplay(Display.DEFAULT_DISPLAY);
doReturn(mInsetsState).when(mMockDisplayController).getInsetsState(anyInt());
when(mMockHandleMenuFactory.create(any(), any(), anyInt(), any(), any(), any(),
- anyBoolean(), anyBoolean(), anyBoolean(), any(), anyInt(), anyInt(), anyInt()))
+ anyBoolean(), anyBoolean(), anyBoolean(), any(), anyInt(), anyInt(), anyInt(),
+ anyInt()))
.thenReturn(mMockHandleMenu);
when(mMockMultiInstanceHelper.supportsMultiInstanceSplit(any())).thenReturn(false);
when(mMockAppHeaderViewHolderFactory.create(any(), any(), any(), any(), any(), any(), any(),
@@ -1070,7 +1071,8 @@ public class DesktopModeWindowDecorationTests extends ShellTestCase {
openInBrowserCaptor.capture(),
any(),
any(),
- any()
+ any(),
+ anyBoolean()
);
openInBrowserCaptor.getValue().invoke(new Intent(Intent.ACTION_MAIN, TEST_URI1));
@@ -1099,7 +1101,8 @@ public class DesktopModeWindowDecorationTests extends ShellTestCase {
openInBrowserCaptor.capture(),
any(),
any(),
- any()
+ any(),
+ anyBoolean()
);
openInBrowserCaptor.getValue().invoke(new Intent(Intent.ACTION_MAIN, TEST_URI1));
@@ -1151,7 +1154,8 @@ public class DesktopModeWindowDecorationTests extends ShellTestCase {
any(),
any(),
closeClickListener.capture(),
- any()
+ any(),
+ anyBoolean()
);
closeClickListener.getValue().invoke();
@@ -1161,6 +1165,30 @@ public class DesktopModeWindowDecorationTests extends ShellTestCase {
}
@Test
+ public void createHandleMenu_immersiveWindow_forceShowsSystemBars() {
+ final ActivityManager.RunningTaskInfo taskInfo = createTaskInfo(/* visible= */ true);
+ final DesktopModeWindowDecoration decoration = createWindowDecoration(taskInfo,
+ true /* relayout */);
+ when(mMockDesktopRepository.isTaskInFullImmersiveState(taskInfo.taskId))
+ .thenReturn(true);
+
+ createHandleMenu(decoration);
+
+ verify(mMockHandleMenu).show(
+ any(),
+ any(),
+ any(),
+ any(),
+ any(),
+ any(),
+ any(),
+ any(),
+ any(),
+ /* forceShowSystemBars= */ eq(true)
+ );
+ }
+
+ @Test
@DisableFlags(Flags.FLAG_ENABLE_DESKTOP_WINDOWING_APP_HANDLE_EDUCATION)
public void notifyCaptionStateChanged_flagDisabled_doNoNotify() {
when(DesktopModeStatus.canEnterDesktopMode(mContext)).thenReturn(true);
@@ -1301,7 +1329,7 @@ public class DesktopModeWindowDecorationTests extends ShellTestCase {
verify(mMockHandleMenuFactory).create(any(), any(), anyInt(), any(), any(),
any(), anyBoolean(), anyBoolean(), anyBoolean(),
argThat(intent -> (uri == null && intent == null) || intent.getData().equals(uri)),
- anyInt(), anyInt(), anyInt());
+ anyInt(), anyInt(), anyInt(), anyInt());
}
private void createMaximizeMenu(DesktopModeWindowDecoration decoration, MaximizeMenu menu) {
diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/HandleMenuTest.kt b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/HandleMenuTest.kt
index 1820133a4795..9544fa823b5a 100644
--- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/HandleMenuTest.kt
+++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/HandleMenuTest.kt
@@ -33,6 +33,7 @@ import android.view.LayoutInflater
import android.view.SurfaceControl
import android.view.SurfaceControlViewHost
import android.view.View
+import android.view.WindowInsets.Type.systemBars
import android.view.WindowManager
import androidx.core.graphics.toPointF
import androidx.test.filters.SmallTest
@@ -186,13 +187,35 @@ class HandleMenuTest : ShellTestCase() {
assertEquals(expected.toPointF(), handleMenu.handleMenuPosition)
}
- private fun createTaskInfo(windowingMode: Int, splitPosition: Int) {
+ @Test
+ fun testCreate_forceShowSystemBars_usesSystemViewContainer() {
+ createTaskInfo(WINDOWING_MODE_FREEFORM)
+
+ handleMenu = createAndShowHandleMenu(forceShowSystemBars = true)
+
+ // Only AdditionalSystemViewContainer supports force showing system bars.
+ assertTrue(handleMenu.handleMenuViewContainer is AdditionalSystemViewContainer)
+ }
+
+ @Test
+ fun testCreate_forceShowSystemBars() {
+ createTaskInfo(WINDOWING_MODE_FREEFORM)
+
+ handleMenu = createAndShowHandleMenu(forceShowSystemBars = true)
+
+ val types = (handleMenu.handleMenuViewContainer as AdditionalSystemViewContainer)
+ .lp.forciblyShownTypes
+ assertTrue((types and systemBars()) != 0)
+ }
+
+ private fun createTaskInfo(windowingMode: Int, splitPosition: Int? = null) {
val taskDescriptionBuilder = ActivityManager.TaskDescription.Builder()
.setBackgroundColor(Color.YELLOW)
val bounds = when (windowingMode) {
WINDOWING_MODE_FULLSCREEN -> DISPLAY_BOUNDS
WINDOWING_MODE_FREEFORM -> FREEFORM_BOUNDS
WINDOWING_MODE_MULTI_WINDOW -> {
+ checkNotNull(splitPosition)
if (splitPosition == SPLIT_POSITION_TOP_OR_LEFT) {
SPLIT_LEFT_BOUNDS
} else {
@@ -208,14 +231,19 @@ class HandleMenuTest : ShellTestCase() {
.setBounds(bounds)
.setVisible(true)
.build()
- whenever(splitScreenController.getSplitPosition(any())).thenReturn(splitPosition)
- whenever(splitScreenController.getStageBounds(any(), any())).thenAnswer {
- (it.arguments.first() as Rect).set(SPLIT_LEFT_BOUNDS)
- (it.arguments[1] as Rect).set(SPLIT_RIGHT_BOUNDS)
+ if (windowingMode == WINDOWING_MODE_MULTI_WINDOW) {
+ whenever(splitScreenController.getSplitPosition(any())).thenReturn(splitPosition)
+ whenever(splitScreenController.getStageBounds(any(), any())).thenAnswer {
+ (it.arguments.first() as Rect).set(SPLIT_LEFT_BOUNDS)
+ (it.arguments[1] as Rect).set(SPLIT_RIGHT_BOUNDS)
+ }
}
}
- private fun createAndShowHandleMenu(splitPosition: Int): HandleMenu {
+ private fun createAndShowHandleMenu(
+ splitPosition: Int? = null,
+ forceShowSystemBars: Boolean = false,
+ ): HandleMenu {
val layoutId = if (mockDesktopWindowDecoration.mTaskInfo.isFreeform) {
R.layout.desktop_mode_app_header
} else {
@@ -225,6 +253,7 @@ class HandleMenuTest : ShellTestCase() {
WINDOWING_MODE_FULLSCREEN -> (DISPLAY_BOUNDS.width() / 2) - (HANDLE_WIDTH / 2)
WINDOWING_MODE_FREEFORM -> 0
WINDOWING_MODE_MULTI_WINDOW -> {
+ checkNotNull(splitPosition)
if (splitPosition == SPLIT_POSITION_TOP_OR_LEFT) {
(SPLIT_LEFT_BOUNDS.width() / 2) - (HANDLE_WIDTH / 2)
} else {
@@ -238,9 +267,21 @@ class HandleMenuTest : ShellTestCase() {
layoutId, appIcon, appName, splitScreenController, shouldShowWindowingPill = true,
shouldShowNewWindowButton = true, shouldShowManageWindowsButton = false,
null /* openInBrowserLink */, captionWidth = HANDLE_WIDTH, captionHeight = 50,
- captionX = captionX
+ captionX = captionX,
+ captionY = 0,
+ )
+ handleMenu.show(
+ onToDesktopClickListener = mock(),
+ onToFullscreenClickListener = mock(),
+ onToSplitScreenClickListener = mock(),
+ onNewWindowClickListener = mock(),
+ onManageWindowsClickListener = mock(),
+ openInBrowserClickListener = mock(),
+ onOpenByDefaultClickListener = mock(),
+ onCloseMenuClickListener = mock(),
+ onOutsideTouchListener = mock(),
+ forceShowSystemBars = forceShowSystemBars
)
- handleMenu.show(mock(), mock(), mock(), mock(), mock(), mock(), mock(), mock(), mock())
return handleMenu
}
diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/WindowDecorationTests.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/WindowDecorationTests.java
index bb41e9c81ece..fb17ae93030d 100644
--- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/WindowDecorationTests.java
+++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/WindowDecorationTests.java
@@ -515,6 +515,23 @@ public class WindowDecorationTests extends ShellTestCase {
}
@Test
+ public void testRelayout_withPadding_setsOnResult() {
+ final ActivityManager.RunningTaskInfo taskInfo = new TestRunningTaskInfoBuilder()
+ .setDisplayId(Display.DEFAULT_DISPLAY)
+ .setBounds(TASK_BOUNDS)
+ .setPositionInParent(TASK_POSITION_IN_PARENT.x, TASK_POSITION_IN_PARENT.y)
+ .setVisible(true)
+ .build();
+ final TestWindowDecoration windowDecor = createWindowDecoration(taskInfo);
+ mRelayoutParams.mCaptionTopPadding = 50;
+
+ windowDecor.relayout(taskInfo, false /* applyStartTransactionOnDraw */,
+ true /* hasGlobalFocus */);
+
+ assertEquals(50, mRelayoutResult.mCaptionTopPadding);
+ }
+
+ @Test
public void testRelayout_fluidResizeEnabled_freeformTask_setTaskSurfaceColor() {
StaticMockitoSession mockitoSession = mockitoSession().mockStatic(
DesktopModeStatus.class).strictness(
diff --git a/libs/androidfw/Android.bp b/libs/androidfw/Android.bp
index 385fbfe1a86a..a39f30bbad1f 100644
--- a/libs/androidfw/Android.bp
+++ b/libs/androidfw/Android.bp
@@ -75,7 +75,6 @@ cc_library {
"BigBufferStream.cpp",
"ChunkIterator.cpp",
"ConfigDescription.cpp",
- "CursorWindow.cpp",
"FileStream.cpp",
"Idmap.cpp",
"LoadedArsc.cpp",
@@ -114,6 +113,7 @@ cc_library {
srcs: [
"BackupData.cpp",
"BackupHelpers.cpp",
+ "CursorWindow.cpp",
],
shared_libs: [
"libbase",
@@ -147,6 +147,11 @@ cc_library {
"libz",
],
},
+ host_linux: {
+ srcs: [
+ "CursorWindow.cpp",
+ ],
+ },
windows: {
enabled: true,
},
diff --git a/libs/androidfw/CursorWindow.cpp b/libs/androidfw/CursorWindow.cpp
index abf2b0a91642..5e645cceea2d 100644
--- a/libs/androidfw/CursorWindow.cpp
+++ b/libs/androidfw/CursorWindow.cpp
@@ -18,12 +18,11 @@
#include <androidfw/CursorWindow.h>
+#include <sys/mman.h>
+
#include "android-base/logging.h"
-#include "android-base/mapped_file.h"
#include "cutils/ashmem.h"
-using android::base::MappedFile;
-
namespace android {
/**
@@ -40,7 +39,7 @@ CursorWindow::CursorWindow() {
CursorWindow::~CursorWindow() {
if (mAshmemFd != -1) {
- mMappedFile.reset();
+ ::munmap(mData, mSize);
::close(mAshmemFd);
} else {
free(mData);
@@ -76,7 +75,6 @@ fail_silent:
status_t CursorWindow::maybeInflate() {
int ashmemFd = 0;
void* newData = nullptr;
- std::unique_ptr<MappedFile> mappedFile;
// Bail early when we can't expand any further
if (mReadOnly || mSize == mInflatedSize) {
@@ -97,12 +95,11 @@ status_t CursorWindow::maybeInflate() {
goto fail_silent;
}
- mappedFile = MappedFile::FromFd(ashmemFd, 0, mInflatedSize, PROT_READ | PROT_WRITE);
- if (mappedFile == nullptr) {
+ newData = ::mmap(nullptr, mInflatedSize, PROT_READ | PROT_WRITE, MAP_SHARED, ashmemFd, 0);
+ if (newData == MAP_FAILED) {
PLOG(ERROR) << "Failed mmap";
goto fail_silent;
}
- newData = mappedFile->data();
if (ashmem_set_prot_region(ashmemFd, PROT_READ) < 0) {
PLOG(ERROR) << "Failed ashmem_set_prot_region";
@@ -123,7 +120,6 @@ status_t CursorWindow::maybeInflate() {
mData = newData;
mSize = mInflatedSize;
mSlotsOffset = newSlotsOffset;
- mMappedFile = std::move(mappedFile);
updateSlotsData();
}
@@ -134,12 +130,11 @@ status_t CursorWindow::maybeInflate() {
fail:
LOG(ERROR) << "Failed maybeInflate";
fail_silent:
- mappedFile.reset();
+ ::munmap(newData, mInflatedSize);
::close(ashmemFd);
return UNKNOWN_ERROR;
}
-#ifdef __linux__
status_t CursorWindow::createFromParcel(Parcel* parcel, CursorWindow** outWindow) {
*outWindow = nullptr;
@@ -172,12 +167,11 @@ status_t CursorWindow::createFromParcel(Parcel* parcel, CursorWindow** outWindow
goto fail_silent;
}
- window->mMappedFile = MappedFile::FromFd(window->mAshmemFd, 0, window->mSize, PROT_READ);
- if (window->mMappedFile == nullptr) {
+ window->mData = ::mmap(nullptr, window->mSize, PROT_READ, MAP_SHARED, window->mAshmemFd, 0);
+ if (window->mData == MAP_FAILED) {
PLOG(ERROR) << "Failed mmap";
goto fail_silent;
}
- window->mData = window->mMappedFile->data();
} else {
window->mAshmemFd = -1;
@@ -241,7 +235,6 @@ fail:
fail_silent:
return UNKNOWN_ERROR;
}
-#endif
status_t CursorWindow::clear() {
if (mReadOnly) {
diff --git a/libs/androidfw/include/androidfw/CursorWindow.h b/libs/androidfw/include/androidfw/CursorWindow.h
index 0996355cd2c4..9ec026a19c4c 100644
--- a/libs/androidfw/include/androidfw/CursorWindow.h
+++ b/libs/androidfw/include/androidfw/CursorWindow.h
@@ -23,13 +23,9 @@
#include <string>
#include "android-base/stringprintf.h"
-#ifdef __linux__
#include "binder/Parcel.h"
-#endif
#include "utils/String8.h"
-#include "android-base/mapped_file.h"
-
#define LOG_WINDOW(...)
namespace android {
@@ -84,11 +80,9 @@ public:
~CursorWindow();
static status_t create(const String8& name, size_t size, CursorWindow** outCursorWindow);
-#ifdef __linux__
static status_t createFromParcel(Parcel* parcel, CursorWindow** outCursorWindow);
status_t writeToParcel(Parcel* parcel);
-#endif
inline String8 name() { return mName; }
inline size_t size() { return mSize; }
@@ -155,8 +149,6 @@ private:
String8 mName;
int mAshmemFd = -1;
void* mData = nullptr;
- std::unique_ptr<android::base::MappedFile> mMappedFile;
-
/**
* Pointer to the first FieldSlot, used to optimize the extremely
* hot code path of getFieldSlot().
diff --git a/libs/hwui/jni/text/TextShaper.cpp b/libs/hwui/jni/text/TextShaper.cpp
index 456338631ae4..70e6beda6cb9 100644
--- a/libs/hwui/jni/text/TextShaper.cpp
+++ b/libs/hwui/jni/text/TextShaper.cpp
@@ -31,12 +31,34 @@
namespace android {
+struct FakedFontKey {
+ uint32_t operator()(const minikin::FakedFont& fakedFont) const {
+ return minikin::Hasher()
+ .update(reinterpret_cast<uintptr_t>(fakedFont.font.get()))
+ .update(fakedFont.fakery.bits())
+ .update(fakedFont.fakery.variationSettings())
+ .hash();
+ }
+};
+
struct LayoutWrapper {
LayoutWrapper(minikin::Layout&& layout, float ascent, float descent)
: layout(std::move(layout)), ascent(ascent), descent(descent) {}
+
+ LayoutWrapper(minikin::Layout&& layout, float ascent, float descent, std::vector<jlong>&& fonts,
+ std::vector<uint32_t>&& fontIds)
+ : layout(std::move(layout))
+ , ascent(ascent)
+ , descent(descent)
+ , fonts(std::move(fonts))
+ , fontIds(std::move(fontIds)) {}
+
minikin::Layout layout;
float ascent;
float descent;
+
+ std::vector<jlong> fonts;
+ std::vector<uint32_t> fontIds; // per glyph
};
static void releaseLayout(jlong ptr) {
@@ -64,6 +86,43 @@ static jlong shapeTextRun(const uint16_t* text, int textSize, int start, int cou
overallDescent = std::max(overallDescent, extent.descent);
}
+ if (text_feature::typeface_redesign()) {
+ uint32_t runCount = layout.getFontRunCount();
+
+ std::unordered_map<minikin::FakedFont, uint32_t, FakedFontKey> fakedToFontIds;
+ std::vector<jlong> fonts;
+ std::vector<uint32_t> fontIds;
+
+ fontIds.resize(layout.nGlyphs());
+ for (uint32_t ri = 0; ri < runCount; ++ri) {
+ const minikin::FakedFont& fakedFont = layout.getFontRunFont(ri);
+
+ auto it = fakedToFontIds.find(fakedFont);
+ uint32_t fontId;
+ if (it != fakedToFontIds.end()) {
+ fontId = it->second; // We've seen it.
+ } else {
+ fontId = fonts.size(); // This is new to us. Create new one.
+ std::shared_ptr<minikin::Font> font = std::make_shared<minikin::Font>(
+ fakedFont.font, fakedFont.fakery.variationSettings());
+ fonts.push_back(reinterpret_cast<jlong>(new FontWrapper(std::move(font))));
+ fakedToFontIds.insert(std::make_pair(fakedFont, fontId));
+ }
+
+ const uint32_t runStart = layout.getFontRunStart(ri);
+ const uint32_t runEnd = layout.getFontRunEnd(ri);
+ for (uint32_t i = runStart; i < runEnd; ++i) {
+ fontIds[i] = fontId;
+ }
+ }
+
+ std::unique_ptr<LayoutWrapper> ptr =
+ std::make_unique<LayoutWrapper>(std::move(layout), overallAscent, overallDescent,
+ std::move(fonts), std::move(fontIds));
+
+ return reinterpret_cast<jlong>(ptr.release());
+ }
+
std::unique_ptr<LayoutWrapper> ptr = std::make_unique<LayoutWrapper>(
std::move(layout), overallAscent, overallDescent
);
@@ -156,6 +215,8 @@ static jboolean TextShaper_Result_getFakeItalic(CRITICAL_JNI_PARAMS_COMMA jlong
return layout->layout.getFakery(i).isFakeItalic();
}
+constexpr float NO_OVERRIDE = -1;
+
float findValueFromVariationSettings(const minikin::FontFakery& fakery, minikin::AxisTag tag) {
for (const minikin::FontVariation& fv : fakery.variationSettings()) {
if (fv.axisTag == tag) {
@@ -171,12 +232,7 @@ static jfloat TextShaper_Result_getWeightOverride(CRITICAL_JNI_PARAMS_COMMA jlon
if (text_feature::typeface_redesign()) {
float value =
findValueFromVariationSettings(layout->layout.getFakery(i), minikin::TAG_wght);
- if (!std::isnan(value)) {
- return value;
- } else {
- const std::shared_ptr<minikin::Font>& font = layout->layout.getFontRef(i);
- return font->style().weight();
- }
+ return std::isnan(value) ? NO_OVERRIDE : value;
} else {
return layout->layout.getFakery(i).wghtAdjustment();
}
@@ -188,12 +244,7 @@ static jfloat TextShaper_Result_getItalicOverride(CRITICAL_JNI_PARAMS_COMMA jlon
if (text_feature::typeface_redesign()) {
float value =
findValueFromVariationSettings(layout->layout.getFakery(i), minikin::TAG_ital);
- if (!std::isnan(value)) {
- return value;
- } else {
- const std::shared_ptr<minikin::Font>& font = layout->layout.getFontRef(i);
- return font->style().isItalic();
- }
+ return std::isnan(value) ? NO_OVERRIDE : value;
} else {
return layout->layout.getFakery(i).italAdjustment();
}
@@ -207,6 +258,24 @@ static jlong TextShaper_Result_getFont(CRITICAL_JNI_PARAMS_COMMA jlong ptr, jint
}
// CriticalNative
+static jint TextShaper_Result_getFontCount(CRITICAL_JNI_PARAMS_COMMA jlong ptr) {
+ const LayoutWrapper* layout = reinterpret_cast<LayoutWrapper*>(ptr);
+ return layout->fonts.size();
+}
+
+// CriticalNative
+static jlong TextShaper_Result_getFontRef(CRITICAL_JNI_PARAMS_COMMA jlong ptr, jint fontId) {
+ const LayoutWrapper* layout = reinterpret_cast<LayoutWrapper*>(ptr);
+ return layout->fonts[fontId];
+}
+
+// CriticalNative
+static jint TextShaper_Result_getFontId(CRITICAL_JNI_PARAMS_COMMA jlong ptr, jint glyphIdx) {
+ const LayoutWrapper* layout = reinterpret_cast<LayoutWrapper*>(ptr);
+ return layout->fontIds[glyphIdx];
+}
+
+// CriticalNative
static jlong TextShaper_Result_nReleaseFunc(CRITICAL_JNI_PARAMS) {
return reinterpret_cast<jlong>(releaseLayout);
}
@@ -250,6 +319,10 @@ static const JNINativeMethod gResultMethods[] = {
{"nGetWeightOverride", "(JI)F", (void*)TextShaper_Result_getWeightOverride},
{"nGetItalicOverride", "(JI)F", (void*)TextShaper_Result_getItalicOverride},
{"nReleaseFunc", "()J", (void*)TextShaper_Result_nReleaseFunc},
+
+ {"nGetFontCount", "(J)I", (void*)TextShaper_Result_getFontCount},
+ {"nGetFontRef", "(JI)J", (void*)TextShaper_Result_getFontRef},
+ {"nGetFontId", "(JI)I", (void*)TextShaper_Result_getFontId},
};
int register_android_graphics_text_TextShaper(JNIEnv* env) {
diff --git a/libs/hwui/utils/Color.cpp b/libs/hwui/utils/Color.cpp
index 9673c5f03642..23097f634464 100644
--- a/libs/hwui/utils/Color.cpp
+++ b/libs/hwui/utils/Color.cpp
@@ -17,6 +17,7 @@
#include "Color.h"
#include <Properties.h>
+#include <aidl/android/hardware/graphics/common/Dataspace.h>
#include <android/hardware_buffer.h>
#include <android/native_window.h>
#include <ui/ColorSpace.h>
@@ -25,6 +26,8 @@
#include <algorithm>
#include <cmath>
+#include "SkColorSpace.h"
+
namespace android {
namespace uirenderer {
@@ -215,9 +218,13 @@ android_dataspace ColorSpaceToADataSpace(SkColorSpace* colorSpace, SkColorType c
return HAL_DATASPACE_ADOBE_RGB;
}
- if (nearlyEqual(fn, SkNamedTransferFn::kRec2020) &&
- nearlyEqual(gamut, SkNamedGamut::kRec2020)) {
- return HAL_DATASPACE_BT2020;
+ if (nearlyEqual(gamut, SkNamedGamut::kRec2020)) {
+ if (nearlyEqual(fn, SkNamedTransferFn::kRec2020)) {
+ return HAL_DATASPACE_BT2020;
+ } else if (nearlyEqual(fn, SkNamedTransferFn::kSRGB)) {
+ return static_cast<android_dataspace>(
+ ::aidl::android::hardware::graphics::common::Dataspace::DISPLAY_BT2020);
+ }
}
if (nearlyEqual(fn, k2Dot6) && nearlyEqual(gamut, kDCIP3)) {
diff --git a/nfc/java/android/nfc/NfcAdapter.java b/nfc/java/android/nfc/NfcAdapter.java
index 951702ceef0b..d9fd42fd4f7a 100644
--- a/nfc/java/android/nfc/NfcAdapter.java
+++ b/nfc/java/android/nfc/NfcAdapter.java
@@ -1150,8 +1150,9 @@ public final class NfcAdapter {
}
/**
- * Pauses polling for a {@code timeoutInMs} millis. If polling must be resumed before timeout,
- * use {@link #resumePolling()}.
+ * Pauses NFC tag reader mode polling for a {@code timeoutInMs} millisecond.
+ * In case of {@code timeoutInMs} is zero or invalid polling will be stopped indefinitely
+ * use {@link #resumePolling() to resume the polling.
* @hide
*/
public void pausePolling(int timeoutInMs) {
@@ -1210,9 +1211,8 @@ public final class NfcAdapter {
}
/**
- * Resumes default polling for the current device state if polling is paused. Calling
- * this while polling is not paused is a no-op.
- *
+ * Resumes default NFC tag reader mode polling for the current device state if polling is
+ * paused. Calling this while already in polling is a no-op.
* @hide
*/
public void resumePolling() {
diff --git a/nfc/java/android/nfc/NfcOemExtension.java b/nfc/java/android/nfc/NfcOemExtension.java
index bc410c7b8ba5..905d6f68a8a0 100644
--- a/nfc/java/android/nfc/NfcOemExtension.java
+++ b/nfc/java/android/nfc/NfcOemExtension.java
@@ -569,8 +569,9 @@ public final class NfcOemExtension {
}
/**
- * Pauses NFC tag reader mode polling for a {@code timeoutInMs} millisecond. If polling must be
- * resumed before timeout, use {@link #resumePolling()}.
+ * Pauses NFC tag reader mode polling for a {@code timeoutInMs} millisecond.
+ * In case of {@code timeoutInMs} is zero or invalid polling will be stopped indefinitely
+ * use {@link #resumePolling() to resume the polling.
* @param timeoutInMs the pause polling duration in millisecond
*/
@FlaggedApi(Flags.FLAG_NFC_OEM_EXTENSION)
@@ -581,7 +582,7 @@ public final class NfcOemExtension {
/**
* Resumes default NFC tag reader mode polling for the current device state if polling is
- * paused. Calling this while polling is not paused is a no-op.
+ * paused. Calling this while already in polling is a no-op.
*/
@FlaggedApi(Flags.FLAG_NFC_OEM_EXTENSION)
@RequiresPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS)
diff --git a/nfc/java/android/nfc/cardemulation/ApduServiceInfo.java b/nfc/java/android/nfc/cardemulation/ApduServiceInfo.java
index 2983875561c4..d75318f53fe3 100644
--- a/nfc/java/android/nfc/cardemulation/ApduServiceInfo.java
+++ b/nfc/java/android/nfc/cardemulation/ApduServiceInfo.java
@@ -324,7 +324,7 @@ public final class ApduServiceInfo implements Parcelable {
mOffHostName = sa.getString(
com.android.internal.R.styleable.OffHostApduService_secureElementName);
mShouldDefaultToObserveMode = sa.getBoolean(
- R.styleable.HostApduService_shouldDefaultToObserveMode,
+ R.styleable.OffHostApduService_shouldDefaultToObserveMode,
false);
if (mOffHostName != null) {
if (mOffHostName.equals("eSE")) {
diff --git a/packages/CompanionDeviceManager/res/values-bn/strings.xml b/packages/CompanionDeviceManager/res/values-bn/strings.xml
index d2a0353c9c9b..032eedbf0614 100644
--- a/packages/CompanionDeviceManager/res/values-bn/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-bn/strings.xml
@@ -25,23 +25,17 @@
<string name="confirmation_title_glasses" msgid="8288346850537727333">"আপনি কি &lt;strong&gt;<xliff:g id="APP_NAME">%1$s</xliff:g>&lt;/strong&gt; ম্যানেজ করার জন্য &lt;strong&gt;<xliff:g id="DEVICE_NAME">%2$s</xliff:g>&lt;/strong&gt;-কে অনুমতি দেবেন?"</string>
<string name="profile_name_glasses" msgid="3506504967216601277">"ডিভাইস"</string>
<string name="summary_glasses" msgid="5469208629679579157">"<xliff:g id="DEVICE_TYPE">%1$s</xliff:g>-এ এইসব অনুমতি অ্যাক্সেস করার জন্য এই অ্যাপকে অনুমতি দেওয়া হবে"</string>
- <!-- no translation found for title_app_streaming (1047090167914857893) -->
- <skip />
- <!-- no translation found for summary_app_streaming (7990244299655610920) -->
- <skip />
- <!-- no translation found for helper_summary_app_streaming (1872657107404139828) -->
- <skip />
+ <string name="title_app_streaming" msgid="1047090167914857893">"আপনার <xliff:g id="DEVICE_TYPE">%2$s</xliff:g>-এর অ্যাপ ও সিস্টেমের ফিচার &lt;strong&gt;<xliff:g id="DEVICE_NAME">%3$s</xliff:g>&lt;/strong&gt;-এ স্ট্রিম করার জন্য &lt;strong&gt;<xliff:g id="APP_NAME">%1$s</xliff:g>&lt;/strong&gt;-কে অনুমতি দেবেন?"</string>
+ <string name="summary_app_streaming" msgid="7990244299655610920">"অডিও, ফটো, পেমেন্টের তথ্য, পাসওয়ার্ড ও মেসেজ সহ আপনার <xliff:g id="DEVICE_TYPE">%2$s</xliff:g>-এ দেখা ও চালানো যায় এমন সব কিছু <xliff:g id="APP_NAME_0">%1$s</xliff:g> অ্যাক্সেস করতে পারবে।&lt;br/&gt;&lt;br/&gt;আপনি এই অনুমতি না সরানো পর্যন্ত <xliff:g id="APP_NAME_1">%1$s</xliff:g>, <xliff:g id="DEVICE_NAME">%3$s</xliff:g>-এ অ্যাপের ফিচার স্ট্রিম করতে পারবে।"</string>
+ <string name="helper_summary_app_streaming" msgid="1872657107404139828">"আপনার <xliff:g id="DEVICE_TYPE">%3$s</xliff:g> থেকে অ্যাপ ও সিস্টেমের ফিচার স্ট্রিম করার জন্য <xliff:g id="DEVICE_NAME">%2$s</xliff:g>-এর হয়ে <xliff:g id="APP_NAME">%1$s</xliff:g> অনুমতি চাইছে"</string>
<string name="title_automotive_projection" msgid="3296005598978412847"></string>
<string name="summary_automotive_projection" msgid="8683801274662496164"></string>
<string name="title_computer" msgid="4782923323932440751">"আপনার <xliff:g id="DEVICE_TYPE">%2$s</xliff:g> থেকে এই তথ্য অ্যাক্সেস করার জন্য &lt;strong&gt;<xliff:g id="APP_NAME">%1$s</xliff:g>&lt;/strong&gt;-কে অনুমতি দিন"</string>
<string name="summary_computer" msgid="3798467601598297062"></string>
<string name="helper_summary_computer" msgid="2298803016482139668">"আপনার <xliff:g id="DEVICE_TYPE">%3$s</xliff:g>-এর ফটো, মিডিয়া ও বিজ্ঞপ্তি অ্যাক্সেস করার জন্য, আপনার <xliff:g id="DEVICE_NAME">%2$s</xliff:g>-এর হয়ে <xliff:g id="APP_NAME">%1$s</xliff:g> অনুমতি চাইছে"</string>
- <!-- no translation found for title_nearby_device_streaming (2727103756701741359) -->
- <skip />
- <!-- no translation found for summary_nearby_device_streaming (70434958004946884) -->
- <skip />
- <!-- no translation found for helper_summary_nearby_device_streaming (4712712177819370967) -->
- <skip />
+ <string name="title_nearby_device_streaming" msgid="2727103756701741359">"আপনার <xliff:g id="DEVICE_TYPE">%2$s</xliff:g>-এর অ্যাপ &lt;strong&gt;<xliff:g id="DEVICE_NAME">%3$s</xliff:g>&lt;/strong&gt;?-এ স্ট্রিম করার জন্য &lt;strong&gt;<xliff:g id="APP_NAME">%1$s</xliff:g>&lt;/strong&gt;-কে অনুমতি দেবেন?"</string>
+ <string name="summary_nearby_device_streaming" msgid="70434958004946884">"অডিও, ফটো, পাসওয়ার্ড ও মেসেজ সহ <xliff:g id="DEVICE_NAME_1">%3$s</xliff:g>-এ দেখা ও চালানো যায় এমন সব কিছু <xliff:g id="APP_NAME_0">%1$s</xliff:g> অ্যাক্সেস করতে পারবে।&lt;br/&gt;&lt;br/&gt;আপনি এই অনুমতি না সরানো পর্যন্ত <xliff:g id="APP_NAME_2">%1$s</xliff:g>, <xliff:g id="DEVICE_NAME_3">%3$s</xliff:g>-এ অ্যাপ স্ট্রিম করতে পারবে।"</string>
+ <string name="helper_summary_nearby_device_streaming" msgid="4712712177819370967">"আপনার <xliff:g id="DEVICE_TYPE">%3$s</xliff:g> থেকে অ্যাপ স্ট্রিম করার জন্য <xliff:g id="DEVICE_NAME">%2$s</xliff:g>-এর হয়ে <xliff:g id="APP_NAME">%1$s</xliff:g> অনুমতি চাইছে"</string>
<string name="profile_name_generic" msgid="6851028682723034988">"ডিভাইস"</string>
<string name="summary_generic" msgid="1761976003668044801">"এই অ্যাপ, আপনার ফোন এবং বেছে নেওয়া ডিভাইসের মধ্যে তথ্য সিঙ্ক করতে পারবে, যেমন কোনও কলারের নাম"</string>
<string name="consent_yes" msgid="8344487259618762872">"অনুমতি দিন"</string>
diff --git a/packages/CompanionDeviceManager/res/values-ca/strings.xml b/packages/CompanionDeviceManager/res/values-ca/strings.xml
index 9b321a8e305d..0dc7001fde70 100644
--- a/packages/CompanionDeviceManager/res/values-ca/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-ca/strings.xml
@@ -25,7 +25,7 @@
<string name="confirmation_title_glasses" msgid="8288346850537727333">"Permet que &lt;strong&gt;<xliff:g id="APP_NAME">%1$s</xliff:g>&lt;/strong&gt; gestioni &lt;strong&gt;<xliff:g id="DEVICE_NAME">%2$s</xliff:g>&lt;/strong&gt;"</string>
<string name="profile_name_glasses" msgid="3506504967216601277">"dispositiu"</string>
<string name="summary_glasses" msgid="5469208629679579157">"Aquesta aplicació podrà accedir a aquests permisos del <xliff:g id="DEVICE_TYPE">%1$s</xliff:g>"</string>
- <string name="title_app_streaming" msgid="1047090167914857893">"Vols permetre que &lt;strong&gt;<xliff:g id="APP_NAME">%1$s</xliff:g>&lt;/strong&gt; reprodueixi en continu les aplicacions i les funcions del sistema del dispositiu (<xliff:g id="DEVICE_TYPE">%2$s</xliff:g>) a <xliff:g id="DEVICE_NAME">%3$s</xliff:g>?"</string>
+ <string name="title_app_streaming" msgid="1047090167914857893">"Vols permetre que &lt;strong&gt;<xliff:g id="APP_NAME">%1$s</xliff:g>&lt;/strong&gt; reprodueixi en continu les aplicacions i les funcions del sistema del dispositiu (<xliff:g id="DEVICE_TYPE">%2$s</xliff:g>) a &lt;strong&gt;<xliff:g id="DEVICE_NAME">%3$s</xliff:g>&lt;/strong&gt;?"</string>
<string name="summary_app_streaming" msgid="7990244299655610920">"<xliff:g id="APP_NAME_0">%1$s</xliff:g> podrà accedir a qualsevol cosa que sigui visible o que es reprodueixi al teu dispositiu (<xliff:g id="DEVICE_TYPE">%2$s</xliff:g>), inclosos àudios, fotos, informació de pagament, contrasenyes i missatges.&lt;br/&gt;&lt;br/&gt;<xliff:g id="APP_NAME_1">%1$s</xliff:g> podrà reproduir en continu aplicacions al dispositiu <xliff:g id="DEVICE_NAME">%3$s</xliff:g> fins que suprimeixis l\'accés a aquest permís."</string>
<string name="helper_summary_app_streaming" msgid="1872657107404139828">"<xliff:g id="APP_NAME">%1$s</xliff:g> demana permís en nom del dispositiu <xliff:g id="DEVICE_NAME">%2$s</xliff:g> per reproduir en continu aplicacions i funcions del sistema del teu dispositiu (<xliff:g id="DEVICE_TYPE">%3$s</xliff:g>)"</string>
<string name="title_automotive_projection" msgid="3296005598978412847"></string>
@@ -33,7 +33,7 @@
<string name="title_computer" msgid="4782923323932440751">"Permet que &lt;strong&gt;<xliff:g id="APP_NAME">%1$s</xliff:g>&lt;/strong&gt; accedeixi a aquesta informació del <xliff:g id="DEVICE_TYPE">%2$s</xliff:g>"</string>
<string name="summary_computer" msgid="3798467601598297062"></string>
<string name="helper_summary_computer" msgid="2298803016482139668">"<xliff:g id="APP_NAME">%1$s</xliff:g> demana permís en nom del teu dispositiu <xliff:g id="DEVICE_NAME">%2$s</xliff:g> per accedir a les fotos, el contingut multimèdia i les notificacions del <xliff:g id="DEVICE_TYPE">%3$s</xliff:g>"</string>
- <string name="title_nearby_device_streaming" msgid="2727103756701741359">"Vols permetre que &lt;strong&gt;<xliff:g id="APP_NAME">%1$s</xliff:g>&lt;/strong&gt; reprodueixi en continu les aplicacions del dispositiu (<xliff:g id="DEVICE_TYPE">%2$s</xliff:g>) a &lt;strong&gt;<xliff:g id="DEVICE_NAME">%3$s</xliff:g>&lt;strong&gt;?"</string>
+ <string name="title_nearby_device_streaming" msgid="2727103756701741359">"Vols permetre que &lt;strong&gt;<xliff:g id="APP_NAME">%1$s</xliff:g>&lt;/strong&gt; reprodueixi en continu les aplicacions del dispositiu (<xliff:g id="DEVICE_TYPE">%2$s</xliff:g>) a &lt;strong&gt;<xliff:g id="DEVICE_NAME">%3$s</xliff:g>&lt;/strong&gt;?"</string>
<string name="summary_nearby_device_streaming" msgid="70434958004946884">"<xliff:g id="APP_NAME_0">%1$s</xliff:g> podrà accedir a qualsevol cosa que sigui visible o que es reprodueixi al dispositiu <xliff:g id="DEVICE_NAME_1">%3$s</xliff:g>, inclosos àudios, fotos, informació de pagament, contrasenyes i missatges.&lt;br/&gt;&lt;br/&gt;<xliff:g id="APP_NAME_2">%1$s</xliff:g> podrà reproduir en continu aplicacions al dispositiu <xliff:g id="DEVICE_NAME_3">%3$s</xliff:g> fins que suprimeixis l\'accés a aquest permís."</string>
<string name="helper_summary_nearby_device_streaming" msgid="4712712177819370967">"<xliff:g id="APP_NAME">%1$s</xliff:g> demana permís en nom del dispositiu <xliff:g id="DEVICE_NAME">%2$s</xliff:g> per reproduir en continu aplicacions del teu dispositiu (<xliff:g id="DEVICE_TYPE">%3$s</xliff:g>)"</string>
<string name="profile_name_generic" msgid="6851028682723034988">"dispositiu"</string>
diff --git a/packages/CompanionDeviceManager/res/values-de/strings.xml b/packages/CompanionDeviceManager/res/values-de/strings.xml
index 725a42d92b59..c39145e5f7fc 100644
--- a/packages/CompanionDeviceManager/res/values-de/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-de/strings.xml
@@ -25,23 +25,17 @@
<string name="confirmation_title_glasses" msgid="8288346850537727333">"Zulassen, dass &lt;strong&gt;<xliff:g id="APP_NAME">%1$s</xliff:g>&lt;/strong&gt; das Gerät &lt;strong&gt;<xliff:g id="DEVICE_NAME">%2$s</xliff:g>&lt;/strong&gt; verwalten darf?"</string>
<string name="profile_name_glasses" msgid="3506504967216601277">"Gerät"</string>
<string name="summary_glasses" msgid="5469208629679579157">"Diese App darf dann auf diese Berechtigungen auf deinem Gerät (<xliff:g id="DEVICE_TYPE">%1$s</xliff:g>) zugreifen:"</string>
- <!-- no translation found for title_app_streaming (1047090167914857893) -->
- <skip />
- <!-- no translation found for summary_app_streaming (7990244299655610920) -->
- <skip />
- <!-- no translation found for helper_summary_app_streaming (1872657107404139828) -->
- <skip />
+ <string name="title_app_streaming" msgid="1047090167914857893">"&lt;strong&gt;<xliff:g id="APP_NAME">%1$s</xliff:g>&lt;/strong&gt; erlauben, die Apps und Systemfunktionen auf deinem Gerät (<xliff:g id="DEVICE_TYPE">%2$s</xliff:g>) auf &lt;strong&gt;<xliff:g id="DEVICE_NAME">%3$s</xliff:g>&lt;/strong&gt; zu streamen?"</string>
+ <string name="summary_app_streaming" msgid="7990244299655610920">"<xliff:g id="APP_NAME_0">%1$s</xliff:g> hat dann Zugriff auf alle Inhalte, die auf deinem Gerät (<xliff:g id="DEVICE_TYPE">%2$s</xliff:g>) sichtbar sind oder abgespielt werden, einschließlich Audioinhalten, Fotos, Zahlungsinformationen, Passwörtern und Nachrichten.&lt;br/&gt;&lt;br/&gt;<xliff:g id="APP_NAME_1">%1$s</xliff:g> kann so lange Apps auf „<xliff:g id="DEVICE_NAME">%3$s</xliff:g>“ streamen, bis du diese Berechtigung entfernst."</string>
+ <string name="helper_summary_app_streaming" msgid="1872657107404139828">"<xliff:g id="APP_NAME">%1$s</xliff:g> bittet für dein Gerät <xliff:g id="DEVICE_NAME">%2$s</xliff:g> um die Berechtigung, Apps und Systemfunktionen von deinem Gerät (<xliff:g id="DEVICE_TYPE">%3$s</xliff:g>) zu streamen"</string>
<string name="title_automotive_projection" msgid="3296005598978412847"></string>
<string name="summary_automotive_projection" msgid="8683801274662496164"></string>
<string name="title_computer" msgid="4782923323932440751">"&lt;strong&gt;<xliff:g id="APP_NAME">%1$s</xliff:g>&lt;/strong&gt; Zugriff auf diese Informationen von deinem Gerät (<xliff:g id="DEVICE_TYPE">%2$s</xliff:g>) gewähren"</string>
<string name="summary_computer" msgid="3798467601598297062"></string>
<string name="helper_summary_computer" msgid="2298803016482139668">"<xliff:g id="APP_NAME">%1$s</xliff:g> bittet im Namen von „<xliff:g id="DEVICE_NAME">%2$s</xliff:g>“ um die Berechtigung, auf die Fotos, Medien und Benachrichtigungen auf deinem Gerät (<xliff:g id="DEVICE_TYPE">%3$s</xliff:g>) zuzugreifen"</string>
- <!-- no translation found for title_nearby_device_streaming (2727103756701741359) -->
- <skip />
- <!-- no translation found for summary_nearby_device_streaming (70434958004946884) -->
- <skip />
- <!-- no translation found for helper_summary_nearby_device_streaming (4712712177819370967) -->
- <skip />
+ <string name="title_nearby_device_streaming" msgid="2727103756701741359">"&lt;strong&gt;<xliff:g id="APP_NAME">%1$s</xliff:g>&lt;/strong&gt; erlauben, die Apps auf deinem Gerät (<xliff:g id="DEVICE_TYPE">%2$s</xliff:g>) auf &lt;strong&gt;<xliff:g id="DEVICE_NAME">%3$s</xliff:g>&lt;/strong&gt; zu streamen?"</string>
+ <string name="summary_nearby_device_streaming" msgid="70434958004946884">"<xliff:g id="APP_NAME_0">%1$s</xliff:g> hat dann Zugriff auf alle Inhalte, die auf deinem Gerät (<xliff:g id="DEVICE_NAME_1">%3$s</xliff:g>) sichtbar sind oder abgespielt werden, einschließlich Audioinhalten, Fotos, Zahlungsinformationen, Passwörtern und Nachrichten.&lt;br/&gt;&lt;br/&gt;<xliff:g id="APP_NAME_2">%1$s</xliff:g> kann so lange Apps auf „<xliff:g id="DEVICE_NAME_3">%3$s</xliff:g>“ streamen, bis du diese Berechtigung entfernst."</string>
+ <string name="helper_summary_nearby_device_streaming" msgid="4712712177819370967">"<xliff:g id="APP_NAME">%1$s</xliff:g> bittet für dein Gerät <xliff:g id="DEVICE_NAME">%2$s</xliff:g> um die Berechtigung, Apps von deinem Gerät (<xliff:g id="DEVICE_TYPE">%3$s</xliff:g>) zu streamen"</string>
<string name="profile_name_generic" msgid="6851028682723034988">"Gerät"</string>
<string name="summary_generic" msgid="1761976003668044801">"Diese App kann dann Daten wie den Namen eines Anrufers zwischen deinem Smartphone und dem ausgewählten Gerät synchronisieren"</string>
<string name="consent_yes" msgid="8344487259618762872">"Zulassen"</string>
diff --git a/packages/CompanionDeviceManager/res/values-es-rUS/strings.xml b/packages/CompanionDeviceManager/res/values-es-rUS/strings.xml
index 9f6219274258..a7a408628690 100644
--- a/packages/CompanionDeviceManager/res/values-es-rUS/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-es-rUS/strings.xml
@@ -25,23 +25,17 @@
<string name="confirmation_title_glasses" msgid="8288346850537727333">"Permite que &lt;strong&gt;<xliff:g id="APP_NAME">%1$s</xliff:g>&lt;/strong&gt; administre &lt;strong&gt;<xliff:g id="DEVICE_NAME">%2$s</xliff:g>&lt;/strong&gt;?"</string>
<string name="profile_name_glasses" msgid="3506504967216601277">"dispositivo"</string>
<string name="summary_glasses" msgid="5469208629679579157">"Esta app podrá acceder a los siguientes permisos en tu <xliff:g id="DEVICE_TYPE">%1$s</xliff:g>"</string>
- <!-- no translation found for title_app_streaming (1047090167914857893) -->
- <skip />
- <!-- no translation found for summary_app_streaming (7990244299655610920) -->
- <skip />
- <!-- no translation found for helper_summary_app_streaming (1872657107404139828) -->
- <skip />
+ <string name="title_app_streaming" msgid="1047090167914857893">"¿Quieres permitir que &lt;strong&gt;<xliff:g id="APP_NAME">%1$s</xliff:g>&lt;/strong&gt; transmita las apps y las funciones del sistema de tu <xliff:g id="DEVICE_TYPE">%2$s</xliff:g> a &lt;strong&gt;<xliff:g id="DEVICE_NAME">%3$s</xliff:g>&lt;/strong&gt;?"</string>
+ <string name="summary_app_streaming" msgid="7990244299655610920">"<xliff:g id="APP_NAME_0">%1$s</xliff:g> tendrá acceso a todo el contenido visible o que se reproduzca en tu <xliff:g id="DEVICE_TYPE">%2$s</xliff:g>, lo que incluye audio, fotos, información de pago, contraseñas y mensajes.&lt;br/&gt;&lt;br/&gt;<xliff:g id="APP_NAME_1">%1$s</xliff:g> podrá transmitir apps a <xliff:g id="DEVICE_NAME">%3$s</xliff:g> hasta que se quite el acceso a este permiso."</string>
+ <string name="helper_summary_app_streaming" msgid="1872657107404139828">"<xliff:g id="APP_NAME">%1$s</xliff:g> solicita permiso en nombre de <xliff:g id="DEVICE_NAME">%2$s</xliff:g> para transmitir apps y funciones del sistema desde tu <xliff:g id="DEVICE_TYPE">%3$s</xliff:g>"</string>
<string name="title_automotive_projection" msgid="3296005598978412847"></string>
<string name="summary_automotive_projection" msgid="8683801274662496164"></string>
<string name="title_computer" msgid="4782923323932440751">"Permite que &lt;strong&gt;<xliff:g id="APP_NAME">%1$s</xliff:g>&lt;/strong&gt; acceda a esta información de tu <xliff:g id="DEVICE_TYPE">%2$s</xliff:g>"</string>
<string name="summary_computer" msgid="3798467601598297062"></string>
<string name="helper_summary_computer" msgid="2298803016482139668">"<xliff:g id="APP_NAME">%1$s</xliff:g> solicita tu permiso en nombre de <xliff:g id="DEVICE_NAME">%2$s</xliff:g> para acceder a las fotos, el contenido multimedia y las notificaciones de tu <xliff:g id="DEVICE_TYPE">%3$s</xliff:g>"</string>
- <!-- no translation found for title_nearby_device_streaming (2727103756701741359) -->
- <skip />
- <!-- no translation found for summary_nearby_device_streaming (70434958004946884) -->
- <skip />
- <!-- no translation found for helper_summary_nearby_device_streaming (4712712177819370967) -->
- <skip />
+ <string name="title_nearby_device_streaming" msgid="2727103756701741359">"¿Quieres permitir que &lt;strong&gt;<xliff:g id="APP_NAME">%1$s</xliff:g>&lt;/strong&gt; transmita las apps de tu <xliff:g id="DEVICE_TYPE">%2$s</xliff:g> a &lt;strong&gt;<xliff:g id="DEVICE_NAME">%3$s</xliff:g>&lt;/strong&gt;?"</string>
+ <string name="summary_nearby_device_streaming" msgid="70434958004946884">"<xliff:g id="APP_NAME_0">%1$s</xliff:g> tendrá acceso a todo el contenido visible o que se reproduzca en <xliff:g id="DEVICE_NAME_1">%3$s</xliff:g>, lo que incluye audio, fotos, información de pago, contraseñas y mensajes.&lt;br/&gt;&lt;br/&gt;<xliff:g id="APP_NAME_2">%1$s</xliff:g> podrá transmitir apps a <xliff:g id="DEVICE_NAME_3">%3$s</xliff:g> hasta que se quite el acceso a este permiso."</string>
+ <string name="helper_summary_nearby_device_streaming" msgid="4712712177819370967">"<xliff:g id="APP_NAME">%1$s</xliff:g> solicita permiso en nombre de <xliff:g id="DEVICE_NAME">%2$s</xliff:g> para transmitir apps desde tu <xliff:g id="DEVICE_TYPE">%3$s</xliff:g>"</string>
<string name="profile_name_generic" msgid="6851028682723034988">"dispositivo"</string>
<string name="summary_generic" msgid="1761976003668044801">"Esta app podrá sincronizar información, como el nombre de la persona que llama, entre el teléfono y el dispositivo elegido"</string>
<string name="consent_yes" msgid="8344487259618762872">"Permitir"</string>
diff --git a/packages/CompanionDeviceManager/res/values-es/strings.xml b/packages/CompanionDeviceManager/res/values-es/strings.xml
index 44474b96b44c..8816e6d48eaa 100644
--- a/packages/CompanionDeviceManager/res/values-es/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-es/strings.xml
@@ -25,23 +25,17 @@
<string name="confirmation_title_glasses" msgid="8288346850537727333">"¿Permitir que &lt;strong&gt;<xliff:g id="APP_NAME">%1$s</xliff:g>&lt;/strong&gt; gestione &lt;strong&gt;<xliff:g id="DEVICE_NAME">%2$s</xliff:g>&lt;/strong&gt;?"</string>
<string name="profile_name_glasses" msgid="3506504967216601277">"dispositivo"</string>
<string name="summary_glasses" msgid="5469208629679579157">"Esta aplicación podrá acceder a estos permisos de tu <xliff:g id="DEVICE_TYPE">%1$s</xliff:g>"</string>
- <!-- no translation found for title_app_streaming (1047090167914857893) -->
- <skip />
- <!-- no translation found for summary_app_streaming (7990244299655610920) -->
- <skip />
- <!-- no translation found for helper_summary_app_streaming (1872657107404139828) -->
- <skip />
+ <string name="title_app_streaming" msgid="1047090167914857893">"¿Permitir que &lt;strong&gt;<xliff:g id="APP_NAME">%1$s</xliff:g>&lt;/strong&gt; emita las aplicaciones y funciones del sistema de tu <xliff:g id="DEVICE_TYPE">%2$s</xliff:g> en &lt;strong&gt;<xliff:g id="DEVICE_NAME">%3$s</xliff:g>&lt;/strong&gt;?"</string>
+ <string name="summary_app_streaming" msgid="7990244299655610920">"<xliff:g id="APP_NAME_0">%1$s</xliff:g> tendrá acceso a todo lo que se vea o se reproduzca en tu <xliff:g id="DEVICE_TYPE">%2$s</xliff:g>, incluidos audio, fotos, información para pagos, contraseñas y mensajes.&lt;br/&gt;&lt;br/&gt;<xliff:g id="APP_NAME_1">%1$s</xliff:g> podrá emitir aplicaciones en <xliff:g id="DEVICE_NAME">%3$s</xliff:g> hasta que quites el acceso a este permiso."</string>
+ <string name="helper_summary_app_streaming" msgid="1872657107404139828">"<xliff:g id="APP_NAME">%1$s</xliff:g> está pidiendo permiso en nombre de <xliff:g id="DEVICE_NAME">%2$s</xliff:g> para emitir aplicaciones y funciones del sistema desde tu <xliff:g id="DEVICE_TYPE">%3$s</xliff:g>"</string>
<string name="title_automotive_projection" msgid="3296005598978412847"></string>
<string name="summary_automotive_projection" msgid="8683801274662496164"></string>
<string name="title_computer" msgid="4782923323932440751">"Permitir que &lt;strong&gt;<xliff:g id="APP_NAME">%1$s</xliff:g>&lt;/strong&gt; acceda a esta información de tu <xliff:g id="DEVICE_TYPE">%2$s</xliff:g>"</string>
<string name="summary_computer" msgid="3798467601598297062"></string>
<string name="helper_summary_computer" msgid="2298803016482139668">"<xliff:g id="APP_NAME">%1$s</xliff:g> está pidiendo permiso en nombre de tu <xliff:g id="DEVICE_NAME">%2$s</xliff:g> para acceder a las fotos, los archivos multimedia y las notificaciones de tu <xliff:g id="DEVICE_TYPE">%3$s</xliff:g>"</string>
- <!-- no translation found for title_nearby_device_streaming (2727103756701741359) -->
- <skip />
- <!-- no translation found for summary_nearby_device_streaming (70434958004946884) -->
- <skip />
- <!-- no translation found for helper_summary_nearby_device_streaming (4712712177819370967) -->
- <skip />
+ <string name="title_nearby_device_streaming" msgid="2727103756701741359">"¿Permitir que &lt;strong&gt;<xliff:g id="APP_NAME">%1$s</xliff:g>&lt;/strong&gt; emita las aplicaciones de tu <xliff:g id="DEVICE_TYPE">%2$s</xliff:g> en &lt;strong&gt;<xliff:g id="DEVICE_NAME">%3$s</xliff:g>&lt;/strong&gt;?"</string>
+ <string name="summary_nearby_device_streaming" msgid="70434958004946884">"<xliff:g id="APP_NAME_0">%1$s</xliff:g> tendrá acceso a todo lo que se vea o se reproduzca en <xliff:g id="DEVICE_NAME_1">%3$s</xliff:g>, incluidos audio, fotos, información para pagos, contraseñas y mensajes.&lt;br/&gt;&lt;br/&gt;<xliff:g id="APP_NAME_2">%1$s</xliff:g> podrá emitir aplicaciones en <xliff:g id="DEVICE_NAME_3">%3$s</xliff:g> hasta que quites el acceso a este permiso."</string>
+ <string name="helper_summary_nearby_device_streaming" msgid="4712712177819370967">"<xliff:g id="APP_NAME">%1$s</xliff:g> está pidiendo permiso en nombre de <xliff:g id="DEVICE_NAME">%2$s</xliff:g> para emitir aplicaciones desde tu <xliff:g id="DEVICE_TYPE">%3$s</xliff:g>"</string>
<string name="profile_name_generic" msgid="6851028682723034988">"dispositivo"</string>
<string name="summary_generic" msgid="1761976003668044801">"Esta aplicación podrá sincronizar información (por ejemplo, el nombre de la persona que te llama) entre tu teléfono y el dispositivo que elijas"</string>
<string name="consent_yes" msgid="8344487259618762872">"Permitir"</string>
diff --git a/packages/CompanionDeviceManager/res/values-fr-rCA/strings.xml b/packages/CompanionDeviceManager/res/values-fr-rCA/strings.xml
index b5de650d356b..c4a8447d2aed 100644
--- a/packages/CompanionDeviceManager/res/values-fr-rCA/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-fr-rCA/strings.xml
@@ -25,23 +25,17 @@
<string name="confirmation_title_glasses" msgid="8288346850537727333">"Autoriser &lt;strong&gt;<xliff:g id="APP_NAME">%1$s</xliff:g>&lt;/strong&gt; à gérer &lt;strong&gt;<xliff:g id="DEVICE_NAME">%2$s</xliff:g>&lt;/strong&gt;?"</string>
<string name="profile_name_glasses" msgid="3506504967216601277">"appareil"</string>
<string name="summary_glasses" msgid="5469208629679579157">"Cette appli pourra accéder à ces autorisations sur votre <xliff:g id="DEVICE_TYPE">%1$s</xliff:g>"</string>
- <!-- no translation found for title_app_streaming (1047090167914857893) -->
- <skip />
- <!-- no translation found for summary_app_streaming (7990244299655610920) -->
- <skip />
- <!-- no translation found for helper_summary_app_streaming (1872657107404139828) -->
- <skip />
+ <string name="title_app_streaming" msgid="1047090167914857893">"Autoriser &lt;strong&gt;<xliff:g id="APP_NAME">%1$s</xliff:g>&lt;/strong&gt; à diffuser les applis et les fonctionnalités du système de votre <xliff:g id="DEVICE_TYPE">%2$s</xliff:g> vers &lt;strong&gt;<xliff:g id="DEVICE_NAME">%3$s</xliff:g>&lt;/strong&gt;?"</string>
+ <string name="summary_app_streaming" msgid="7990244299655610920">"<xliff:g id="APP_NAME_0">%1$s</xliff:g> aura accès à tout ce qui est visible ou lu sur votre <xliff:g id="DEVICE_TYPE">%2$s</xliff:g>, y compris le contenu audio, les photos, les infos de paiement, les mots de passe et les messages.&lt;br/&gt;&lt;br/&gt;<xliff:g id="APP_NAME_1">%1$s</xliff:g> pourra diffuser des applis vers <xliff:g id="DEVICE_NAME">%3$s</xliff:g> jusqu\'à ce que vous retiriez l\'accès à cette autorisation."</string>
+ <string name="helper_summary_app_streaming" msgid="1872657107404139828">"<xliff:g id="APP_NAME">%1$s</xliff:g> demande l\'autorisation au nom de votre <xliff:g id="DEVICE_NAME">%2$s</xliff:g> de diffuser des applis et des fonctionnalités système à partir de votre <xliff:g id="DEVICE_TYPE">%3$s</xliff:g>"</string>
<string name="title_automotive_projection" msgid="3296005598978412847"></string>
<string name="summary_automotive_projection" msgid="8683801274662496164"></string>
<string name="title_computer" msgid="4782923323932440751">"Autoriser &lt;strong&gt;<xliff:g id="APP_NAME">%1$s</xliff:g>&lt;/strong&gt; à accéder à ces informations à partir de votre <xliff:g id="DEVICE_TYPE">%2$s</xliff:g>"</string>
<string name="summary_computer" msgid="3798467601598297062"></string>
<string name="helper_summary_computer" msgid="2298803016482139668">"<xliff:g id="APP_NAME">%1$s</xliff:g> demande l\'autorisation au nom de votre <xliff:g id="DEVICE_NAME">%2$s</xliff:g> pour accéder aux photos, aux fichiers multimédias et aux notifications de votre <xliff:g id="DEVICE_TYPE">%3$s</xliff:g>"</string>
- <!-- no translation found for title_nearby_device_streaming (2727103756701741359) -->
- <skip />
- <!-- no translation found for summary_nearby_device_streaming (70434958004946884) -->
- <skip />
- <!-- no translation found for helper_summary_nearby_device_streaming (4712712177819370967) -->
- <skip />
+ <string name="title_nearby_device_streaming" msgid="2727103756701741359">"Autoriser &lt;strong&gt;<xliff:g id="APP_NAME">%1$s</xliff:g>&lt;/strong&gt; à diffuser les applis de votre <xliff:g id="DEVICE_TYPE">%2$s</xliff:g> vers &lt;strong&gt;<xliff:g id="DEVICE_NAME">%3$s</xliff:g>&lt;/strong&gt;?"</string>
+ <string name="summary_nearby_device_streaming" msgid="70434958004946884">"<xliff:g id="APP_NAME_0">%1$s</xliff:g> aura accès à tout ce qui est visible ou lu sur votre <xliff:g id="DEVICE_NAME_1">%3$s</xliff:g>, y compris le contenu audio, les photos, les infos de paiement, les mots de passe et les messages.&lt;br/&gt;&lt;br/&gt;<xliff:g id="APP_NAME_2">%1$s</xliff:g> pourra diffuser des applis vers <xliff:g id="DEVICE_NAME_3">%3$s</xliff:g> jusqu\'à ce que vous retiriez l\'accès à cette autorisation."</string>
+ <string name="helper_summary_nearby_device_streaming" msgid="4712712177819370967">"<xliff:g id="APP_NAME">%1$s</xliff:g> demande l\'autorisation au nom de votre <xliff:g id="DEVICE_NAME">%2$s</xliff:g> de diffuser des applis à partir de votre <xliff:g id="DEVICE_TYPE">%3$s</xliff:g>"</string>
<string name="profile_name_generic" msgid="6851028682723034988">"appareil"</string>
<string name="summary_generic" msgid="1761976003668044801">"Cette appli pourra synchroniser des informations, comme le nom de l\'appelant, entre votre téléphone et l\'appareil sélectionné"</string>
<string name="consent_yes" msgid="8344487259618762872">"Autoriser"</string>
diff --git a/packages/CompanionDeviceManager/res/values-fr/strings.xml b/packages/CompanionDeviceManager/res/values-fr/strings.xml
index b4933ee2279f..88627e580e1e 100644
--- a/packages/CompanionDeviceManager/res/values-fr/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-fr/strings.xml
@@ -25,23 +25,17 @@
<string name="confirmation_title_glasses" msgid="8288346850537727333">"Autoriser &lt;strong&gt;<xliff:g id="APP_NAME">%1$s</xliff:g>&lt;/strong&gt; à gérer &lt;strong&gt;<xliff:g id="DEVICE_NAME">%2$s</xliff:g>&lt;/strong&gt; ?"</string>
<string name="profile_name_glasses" msgid="3506504967216601277">"appareil"</string>
<string name="summary_glasses" msgid="5469208629679579157">"Cette appli sera autorisée à accéder à ces autorisations sur votre <xliff:g id="DEVICE_TYPE">%1$s</xliff:g>"</string>
- <!-- no translation found for title_app_streaming (1047090167914857893) -->
- <skip />
- <!-- no translation found for summary_app_streaming (7990244299655610920) -->
- <skip />
- <!-- no translation found for helper_summary_app_streaming (1872657107404139828) -->
- <skip />
+ <string name="title_app_streaming" msgid="1047090167914857893">"Autoriser &lt;strong&gt;<xliff:g id="APP_NAME">%1$s</xliff:g>&lt;/strong&gt; à caster les applis et les fonctionnalités système de votre <xliff:g id="DEVICE_TYPE">%2$s</xliff:g> sur &lt;strong&gt;<xliff:g id="DEVICE_NAME">%3$s</xliff:g>&lt;/strong&gt; ?"</string>
+ <string name="summary_app_streaming" msgid="7990244299655610920">"<xliff:g id="APP_NAME_0">%1$s</xliff:g> aura accès à tout ce qui est visible ou lu sur votre <xliff:g id="DEVICE_TYPE">%2$s</xliff:g>, y compris les contenus audio, les photos, les infos de paiement, les mots de passe et les messages.&lt;br/&gt;&lt;br/&gt;<xliff:g id="APP_NAME_1">%1$s</xliff:g> pourra caster des applis sur <xliff:g id="DEVICE_NAME">%3$s</xliff:g> jusqu\'à ce que vous supprimiez l\'accès à cette autorisation."</string>
+ <string name="helper_summary_app_streaming" msgid="1872657107404139828">"<xliff:g id="APP_NAME">%1$s</xliff:g> demande, au nom de l\'appareil <xliff:g id="DEVICE_NAME">%2$s</xliff:g>, l\'autorisation de caster des applis et des fonctionnalités système depuis votre <xliff:g id="DEVICE_TYPE">%3$s</xliff:g>"</string>
<string name="title_automotive_projection" msgid="3296005598978412847"></string>
<string name="summary_automotive_projection" msgid="8683801274662496164"></string>
<string name="title_computer" msgid="4782923323932440751">"Autoriser &lt;strong&gt;<xliff:g id="APP_NAME">%1$s</xliff:g>&lt;/strong&gt; à accéder à ces informations depuis votre <xliff:g id="DEVICE_TYPE">%2$s</xliff:g>"</string>
<string name="summary_computer" msgid="3798467601598297062"></string>
<string name="helper_summary_computer" msgid="2298803016482139668">"<xliff:g id="APP_NAME">%1$s</xliff:g> demande l\'autorisation au nom de votre <xliff:g id="DEVICE_NAME">%2$s</xliff:g> pour accéder aux photos, multimédias et notifications de votre <xliff:g id="DEVICE_TYPE">%3$s</xliff:g>"</string>
- <!-- no translation found for title_nearby_device_streaming (2727103756701741359) -->
- <skip />
- <!-- no translation found for summary_nearby_device_streaming (70434958004946884) -->
- <skip />
- <!-- no translation found for helper_summary_nearby_device_streaming (4712712177819370967) -->
- <skip />
+ <string name="title_nearby_device_streaming" msgid="2727103756701741359">"Autoriser &lt;strong&gt;<xliff:g id="APP_NAME">%1$s</xliff:g>&lt;/strong&gt; à caster les applis de votre <xliff:g id="DEVICE_TYPE">%2$s</xliff:g> sur &lt;strong&gt;<xliff:g id="DEVICE_NAME">%3$s</xliff:g>&lt;/strong&gt; ?"</string>
+ <string name="summary_nearby_device_streaming" msgid="70434958004946884">"<xliff:g id="APP_NAME_0">%1$s</xliff:g> aura accès à tout ce qui est visible ou lu sur votre <xliff:g id="DEVICE_NAME_1">%3$s</xliff:g>, y compris les contenus audio, les photos, les infos de paiement, les mots de passe et les messages.&lt;br/&gt;&lt;br/&gt;<xliff:g id="APP_NAME_2">%1$s</xliff:g> pourra caster des applis sur <xliff:g id="DEVICE_NAME_3">%3$s</xliff:g> jusqu\'à ce que vous supprimiez l\'accès à cette autorisation."</string>
+ <string name="helper_summary_nearby_device_streaming" msgid="4712712177819370967">"<xliff:g id="APP_NAME">%1$s</xliff:g> demande, au nom de l\'appareil <xliff:g id="DEVICE_NAME">%2$s</xliff:g>, l\'autorisation de caster des applis depuis votre <xliff:g id="DEVICE_TYPE">%3$s</xliff:g>"</string>
<string name="profile_name_generic" msgid="6851028682723034988">"appareil"</string>
<string name="summary_generic" msgid="1761976003668044801">"Cette appli pourra synchroniser des infos, comme le nom de l\'appelant, entre votre téléphone et l\'appareil choisi"</string>
<string name="consent_yes" msgid="8344487259618762872">"Autoriser"</string>
diff --git a/packages/CompanionDeviceManager/res/values-hy/strings.xml b/packages/CompanionDeviceManager/res/values-hy/strings.xml
index a4238c0ef46c..744168b4e7d8 100644
--- a/packages/CompanionDeviceManager/res/values-hy/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-hy/strings.xml
@@ -25,23 +25,17 @@
<string name="confirmation_title_glasses" msgid="8288346850537727333">"Թույլատրե՞լ &lt;strong&gt;<xliff:g id="APP_NAME">%1$s</xliff:g>&lt;/strong&gt; հավելվածին կառավարել &lt;strong&gt;<xliff:g id="DEVICE_NAME">%2$s</xliff:g>&lt;/strong&gt; սարքը"</string>
<string name="profile_name_glasses" msgid="3506504967216601277">"սարք"</string>
<string name="summary_glasses" msgid="5469208629679579157">"Այս հավելվածը կստանա հետևյալ թույլտվությունները ձեր <xliff:g id="DEVICE_TYPE">%1$s</xliff:g>ում"</string>
- <!-- no translation found for title_app_streaming (1047090167914857893) -->
- <skip />
- <!-- no translation found for summary_app_streaming (7990244299655610920) -->
- <skip />
- <!-- no translation found for helper_summary_app_streaming (1872657107404139828) -->
- <skip />
+ <string name="title_app_streaming" msgid="1047090167914857893">"Թույլատրե՞լ &lt;strong&gt;<xliff:g id="APP_NAME">%1$s</xliff:g>&lt;/strong&gt; հավելվածին հեռարձակել ձեր <xliff:g id="DEVICE_TYPE">%2$s</xliff:g>ի հավելվածները և համակարգի գործառույթները &lt;strong&gt;<xliff:g id="DEVICE_NAME">%3$s</xliff:g>&lt;/strong&gt; սարքին։"</string>
+ <string name="summary_app_streaming" msgid="7990244299655610920">"<xliff:g id="APP_NAME_0">%1$s</xliff:g> հավելվածին հասանելի կլինի ձեր <xliff:g id="DEVICE_TYPE">%2$s</xliff:g>ում ցուցադրվող կամ նվագարկվող բովանդակությունը՝ ներառյալ աուդիոն, լուսանկարները, վճարային տեղեկությունները, գաղտնաբառերը և հաղորդագրությունները։&lt;br/&gt;&lt;br/&gt;<xliff:g id="APP_NAME_1">%1$s</xliff:g> հավելվածը կկարողանա հավելվածներ հեռարձակել <xliff:g id="DEVICE_NAME">%3$s</xliff:g> սարքին, քանի դեռ չեք չեղարկել այս թույլտվությունը։"</string>
+ <string name="helper_summary_app_streaming" msgid="1872657107404139828">"<xliff:g id="APP_NAME">%1$s</xliff:g> հավելվածը <xliff:g id="DEVICE_NAME">%2$s</xliff:g> սարքի անունից թույլտվություն է խնդրում՝ ձեր <xliff:g id="DEVICE_TYPE">%3$s</xliff:g>ից հավելվածներ և համակարգի գործառույթներ հեռարձակելու համար"</string>
<string name="title_automotive_projection" msgid="3296005598978412847"></string>
<string name="summary_automotive_projection" msgid="8683801274662496164"></string>
<string name="title_computer" msgid="4782923323932440751">"Թույլատրեք &lt;strong&gt;<xliff:g id="APP_NAME">%1$s</xliff:g>&lt;/strong&gt; հավելվածին օգտագործել այս տեղեկությունները ձեր <xliff:g id="DEVICE_TYPE">%2$s</xliff:g>ից"</string>
<string name="summary_computer" msgid="3798467601598297062"></string>
<string name="helper_summary_computer" msgid="2298803016482139668">"<xliff:g id="APP_NAME">%1$s</xliff:g> հավելվածը ձեր <xliff:g id="DEVICE_NAME">%2$s</xliff:g> սարքի անունից թույլտվություն է խնդրում՝ ձեր <xliff:g id="DEVICE_TYPE">%3$s</xliff:g>ի լուսանկարները, մեդիաֆայլերն ու ծանուցումները տեսնելու համար"</string>
- <!-- no translation found for title_nearby_device_streaming (2727103756701741359) -->
- <skip />
- <!-- no translation found for summary_nearby_device_streaming (70434958004946884) -->
- <skip />
- <!-- no translation found for helper_summary_nearby_device_streaming (4712712177819370967) -->
- <skip />
+ <string name="title_nearby_device_streaming" msgid="2727103756701741359">"Թույլատրե՞լ &lt;strong&gt;<xliff:g id="APP_NAME">%1$s</xliff:g>&lt;/strong&gt; հավելվածին հեռարձակել ձեր <xliff:g id="DEVICE_TYPE">%2$s</xliff:g>ի հավելվածները &lt;strong&gt;<xliff:g id="DEVICE_NAME">%3$s</xliff:g>&lt;/strong&gt; սարքին։"</string>
+ <string name="summary_nearby_device_streaming" msgid="70434958004946884">"<xliff:g id="APP_NAME_0">%1$s</xliff:g> հավելվածին հասանելի կլինի ձեր <xliff:g id="DEVICE_NAME_1">%3$s</xliff:g>-ում ցուցադրվող կամ նվագարկվող բովանդակությունը՝ ներառյալ աուդիոն, լուսանկարները, վճարային տեղեկությունները, գաղտնաբառերը և հաղորդագրությունները։&lt;br/&gt;&lt;br/&gt;<xliff:g id="APP_NAME_2">%1$s</xliff:g> հավելվածը կկարողանա հավելվածներ հեռարձակել <xliff:g id="DEVICE_NAME_3">%3$s</xliff:g> սարքին, քանի դեռ չեք չեղարկել այս թույլտվությունը։"</string>
+ <string name="helper_summary_nearby_device_streaming" msgid="4712712177819370967">"<xliff:g id="APP_NAME">%1$s</xliff:g> հավելվածը <xliff:g id="DEVICE_NAME">%2$s</xliff:g> սարքի անունից թույլտվություն է խնդրում՝ ձեր <xliff:g id="DEVICE_TYPE">%3$s</xliff:g>ից հավելվածներ հեռարձակելու համար"</string>
<string name="profile_name_generic" msgid="6851028682723034988">"սարք"</string>
<string name="summary_generic" msgid="1761976003668044801">"Այս հավելվածը կկարողանա համաժամացնել ձեր հեռախոսի և ընտրված սարքի տվյալները, օր․՝ զանգողի անունը"</string>
<string name="consent_yes" msgid="8344487259618762872">"Թույլատրել"</string>
diff --git a/packages/CompanionDeviceManager/res/values-it/strings.xml b/packages/CompanionDeviceManager/res/values-it/strings.xml
index 2fdcaf0d9852..fe4cc151e2a7 100644
--- a/packages/CompanionDeviceManager/res/values-it/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-it/strings.xml
@@ -25,23 +25,17 @@
<string name="confirmation_title_glasses" msgid="8288346850537727333">"Vuoi consentire all\'app &lt;strong&gt;<xliff:g id="APP_NAME">%1$s</xliff:g>&lt;/strong&gt; di gestire &lt;strong&gt;<xliff:g id="DEVICE_NAME">%2$s</xliff:g>&lt;/strong&gt;?"</string>
<string name="profile_name_glasses" msgid="3506504967216601277">"dispositivo"</string>
<string name="summary_glasses" msgid="5469208629679579157">"Questa app potrà accedere alle seguenti autorizzazioni <xliff:g id="DEVICE_TYPE">%1$s</xliff:g>:"</string>
- <!-- no translation found for title_app_streaming (1047090167914857893) -->
- <skip />
- <!-- no translation found for summary_app_streaming (7990244299655610920) -->
- <skip />
- <!-- no translation found for helper_summary_app_streaming (1872657107404139828) -->
- <skip />
+ <string name="title_app_streaming" msgid="1047090167914857893">"Consentire all\'app &lt;strong&gt;<xliff:g id="APP_NAME">%1$s</xliff:g>&lt;/strong&gt; di riprodurre in streaming le app e le funzionalità di sistema <xliff:g id="DEVICE_TYPE">%2$s</xliff:g> su &lt;strong&gt;<xliff:g id="DEVICE_NAME">%3$s</xliff:g>&lt;/strong&gt;?"</string>
+ <string name="summary_app_streaming" msgid="7990244299655610920">"<xliff:g id="APP_NAME_0">%1$s</xliff:g> avrà accesso a tutti i contenuti visibili o riprodotti dal tuo <xliff:g id="DEVICE_TYPE">%2$s</xliff:g>, inclusi audio, foto, dati di pagamento, password e messaggi.&lt;br/&gt;&lt;br/&gt;<xliff:g id="APP_NAME_1">%1$s</xliff:g> sarà in grado di riprodurre in streaming le app su <xliff:g id="DEVICE_NAME">%3$s</xliff:g> finché non rimuoverai l\'accesso a questa autorizzazione."</string>
+ <string name="helper_summary_app_streaming" msgid="1872657107404139828">"<xliff:g id="APP_NAME">%1$s</xliff:g> richiede l\'autorizzazione per conto di <xliff:g id="DEVICE_NAME">%2$s</xliff:g> per riprodurre in streaming app e funzionalità di sistema dal tuo <xliff:g id="DEVICE_TYPE">%3$s</xliff:g>"</string>
<string name="title_automotive_projection" msgid="3296005598978412847"></string>
<string name="summary_automotive_projection" msgid="8683801274662496164"></string>
<string name="title_computer" msgid="4782923323932440751">"Consenti all\'app &lt;strong&gt;<xliff:g id="APP_NAME">%1$s</xliff:g>&lt;/strong&gt; di accedere a queste informazioni <xliff:g id="DEVICE_TYPE">%2$s</xliff:g>"</string>
<string name="summary_computer" msgid="3798467601598297062"></string>
<string name="helper_summary_computer" msgid="2298803016482139668">"<xliff:g id="APP_NAME">%1$s</xliff:g> richiede per conto di <xliff:g id="DEVICE_NAME">%2$s</xliff:g> l\'autorizzazione ad accedere a foto, contenuti multimediali e notifiche <xliff:g id="DEVICE_TYPE">%3$s</xliff:g>"</string>
- <!-- no translation found for title_nearby_device_streaming (2727103756701741359) -->
- <skip />
- <!-- no translation found for summary_nearby_device_streaming (70434958004946884) -->
- <skip />
- <!-- no translation found for helper_summary_nearby_device_streaming (4712712177819370967) -->
- <skip />
+ <string name="title_nearby_device_streaming" msgid="2727103756701741359">"Consentire all\'app &lt;strong&gt;<xliff:g id="APP_NAME">%1$s</xliff:g>&lt;/strong&gt; di riprodurre in streaming le app <xliff:g id="DEVICE_TYPE">%2$s</xliff:g> su &lt;strong&gt;<xliff:g id="DEVICE_NAME">%3$s</xliff:g>&lt;/strong&gt;?"</string>
+ <string name="summary_nearby_device_streaming" msgid="70434958004946884">"<xliff:g id="APP_NAME_0">%1$s</xliff:g> avrà accesso a tutti i contenuti visibili o riprodotti dal tuo <xliff:g id="DEVICE_NAME_1">%3$s</xliff:g>, inclusi audio, foto, dati di pagamento, password e messaggi.&lt;br/&gt;&lt;br/&gt;<xliff:g id="APP_NAME_2">%1$s</xliff:g> sarà in grado di riprodurre in streaming le app su <xliff:g id="DEVICE_NAME_3">%3$s</xliff:g> finché non rimuoverai l\'accesso a questa autorizzazione."</string>
+ <string name="helper_summary_nearby_device_streaming" msgid="4712712177819370967">"<xliff:g id="APP_NAME">%1$s</xliff:g> richiede l\'autorizzazione per conto di <xliff:g id="DEVICE_NAME">%2$s</xliff:g> per riprodurre in streaming le app dal tuo <xliff:g id="DEVICE_TYPE">%3$s</xliff:g>"</string>
<string name="profile_name_generic" msgid="6851028682723034988">"dispositivo"</string>
<string name="summary_generic" msgid="1761976003668044801">"Questa app potrà sincronizzare informazioni, ad esempio il nome di un chiamante, tra il telefono e il dispositivo scelto"</string>
<string name="consent_yes" msgid="8344487259618762872">"Consenti"</string>
diff --git a/packages/CompanionDeviceManager/res/values-mk/strings.xml b/packages/CompanionDeviceManager/res/values-mk/strings.xml
index c0e48b32b1a5..a69a12e49b34 100644
--- a/packages/CompanionDeviceManager/res/values-mk/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-mk/strings.xml
@@ -25,23 +25,17 @@
<string name="confirmation_title_glasses" msgid="8288346850537727333">"Ќе дозволите &lt;strong&gt;<xliff:g id="APP_NAME">%1$s</xliff:g>&lt;/strong&gt; да управува со &lt;strong&gt;<xliff:g id="DEVICE_NAME">%2$s</xliff:g>&lt;/strong&gt;?"</string>
<string name="profile_name_glasses" msgid="3506504967216601277">"уред"</string>
<string name="summary_glasses" msgid="5469208629679579157">"Апликацијава ќе може да пристапува до овие дозволи на <xliff:g id="DEVICE_TYPE">%1$s</xliff:g>"</string>
- <!-- no translation found for title_app_streaming (1047090167914857893) -->
- <skip />
- <!-- no translation found for summary_app_streaming (7990244299655610920) -->
- <skip />
- <!-- no translation found for helper_summary_app_streaming (1872657107404139828) -->
- <skip />
+ <string name="title_app_streaming" msgid="1047090167914857893">"Да се дозволи &lt;strong&gt;<xliff:g id="APP_NAME">%1$s</xliff:g>&lt;/strong&gt; да ги стримува апликациите и системските функции од <xliff:g id="DEVICE_TYPE">%2$s</xliff:g> на &lt;strong&gt;<xliff:g id="DEVICE_NAME">%3$s</xliff:g>&lt;/strong&gt;?"</string>
+ <string name="summary_app_streaming" msgid="7990244299655610920">"<xliff:g id="APP_NAME_0">%1$s</xliff:g> ќе има пристап до сè што е видливо или репродуцирано на <xliff:g id="DEVICE_TYPE">%2$s</xliff:g>, вклучувајќи ги и аудиото, фотографиите, податоците за плаќање, лозинките и пораките.&lt;br/&gt;&lt;br/&gt;<xliff:g id="APP_NAME_1">%1$s</xliff:g> ќе може да стримува апликации на <xliff:g id="DEVICE_NAME">%3$s</xliff:g> сѐ додека не ја отстраните дозволава."</string>
+ <string name="helper_summary_app_streaming" msgid="1872657107404139828">"<xliff:g id="APP_NAME">%1$s</xliff:g> бара дозвола во име на <xliff:g id="DEVICE_NAME">%2$s</xliff:g> за да стримува апликации и системски функции од вашиот <xliff:g id="DEVICE_TYPE">%3$s</xliff:g>"</string>
<string name="title_automotive_projection" msgid="3296005598978412847"></string>
<string name="summary_automotive_projection" msgid="8683801274662496164"></string>
<string name="title_computer" msgid="4782923323932440751">"Дозволете &lt;strong&gt;<xliff:g id="APP_NAME">%1$s</xliff:g>&lt;/strong&gt; да пристапува до овие податоци на <xliff:g id="DEVICE_TYPE">%2$s</xliff:g>"</string>
<string name="summary_computer" msgid="3798467601598297062"></string>
<string name="helper_summary_computer" msgid="2298803016482139668">"<xliff:g id="APP_NAME">%1$s</xliff:g> бара дозвола во име на вашиот <xliff:g id="DEVICE_NAME">%2$s</xliff:g> за да пристапува до фотографиите, аудиовизуелните содржини и известувањата на <xliff:g id="DEVICE_TYPE">%3$s</xliff:g>"</string>
- <!-- no translation found for title_nearby_device_streaming (2727103756701741359) -->
- <skip />
- <!-- no translation found for summary_nearby_device_streaming (70434958004946884) -->
- <skip />
- <!-- no translation found for helper_summary_nearby_device_streaming (4712712177819370967) -->
- <skip />
+ <string name="title_nearby_device_streaming" msgid="2727103756701741359">"Да се дозволи &lt;strong&gt;<xliff:g id="APP_NAME">%1$s</xliff:g>&lt;/strong&gt; да ги стримува апликациите од <xliff:g id="DEVICE_TYPE">%2$s</xliff:g> на &lt;strong&gt;<xliff:g id="DEVICE_NAME">%3$s</xliff:g>&lt;/strong&gt;?"</string>
+ <string name="summary_nearby_device_streaming" msgid="70434958004946884">"<xliff:g id="APP_NAME_0">%1$s</xliff:g> ќе има пристап до сè што е видливо или репродуцирано на <xliff:g id="DEVICE_NAME_1">%3$s</xliff:g>, вклучувајќи ги и аудиото, фотографиите, податоците за плаќање, лозинките и пораките.&lt;br/&gt;&lt;br/&gt;<xliff:g id="APP_NAME_2">%1$s</xliff:g> ќе може да стримува апликации на <xliff:g id="DEVICE_NAME_3">%3$s</xliff:g> сѐ додека не ја отстраните дозволава."</string>
+ <string name="helper_summary_nearby_device_streaming" msgid="4712712177819370967">"<xliff:g id="APP_NAME">%1$s</xliff:g> бара дозвола во име на <xliff:g id="DEVICE_NAME">%2$s</xliff:g> за да стримува апликации од вашиот <xliff:g id="DEVICE_TYPE">%3$s</xliff:g>"</string>
<string name="profile_name_generic" msgid="6851028682723034988">"уред"</string>
<string name="summary_generic" msgid="1761976003668044801">"Оваа апликација ќе може да ги синхронизира податоците како што се имињата на јавувачите помеѓу вашиот телефон и избраниот уред"</string>
<string name="consent_yes" msgid="8344487259618762872">"Дозволи"</string>
diff --git a/packages/CompanionDeviceManager/res/values-mn/strings.xml b/packages/CompanionDeviceManager/res/values-mn/strings.xml
index 543bdfa03eed..96951ad9c2d7 100644
--- a/packages/CompanionDeviceManager/res/values-mn/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-mn/strings.xml
@@ -25,23 +25,17 @@
<string name="confirmation_title_glasses" msgid="8288346850537727333">"&lt;strong&gt;<xliff:g id="APP_NAME">%1$s</xliff:g>&lt;/strong&gt;-д &lt;strong&gt;<xliff:g id="DEVICE_NAME">%2$s</xliff:g>&lt;/strong&gt;-г удирдахыг зөвшөөрөх үү?"</string>
<string name="profile_name_glasses" msgid="3506504967216601277">"төхөөрөмж"</string>
<string name="summary_glasses" msgid="5469208629679579157">"Энэ аппад таны <xliff:g id="DEVICE_TYPE">%1$s</xliff:g> дээрх эдгээр зөвшөөрөлд хандахыг зөвшөөрнө"</string>
- <!-- no translation found for title_app_streaming (1047090167914857893) -->
- <skip />
- <!-- no translation found for summary_app_streaming (7990244299655610920) -->
- <skip />
- <!-- no translation found for helper_summary_app_streaming (1872657107404139828) -->
- <skip />
+ <string name="title_app_streaming" msgid="1047090167914857893">"&lt;strong&gt;<xliff:g id="APP_NAME">%1$s</xliff:g>&lt;/strong&gt;-д таны <xliff:g id="DEVICE_TYPE">%2$s</xliff:g>-н апп болон системийн онцлогийг &lt;strong&gt;<xliff:g id="DEVICE_NAME">%3$s</xliff:g>&lt;/strong&gt;-д дамжуулахыг зөвшөөрөх үү?"</string>
+ <string name="summary_app_streaming" msgid="7990244299655610920">"<xliff:g id="APP_NAME_0">%1$s</xliff:g> аудио, зураг, төлбөрийн мэдээлэл, нууц үг, мессеж зэрэг таны <xliff:g id="DEVICE_TYPE">%2$s</xliff:g> дээр харагдаж, тоглуулж буй аливаа зүйлд хандах эрхтэй байх болно.&lt;br/&gt;&lt;br/&gt;<xliff:g id="APP_NAME_1">%1$s</xliff:g> таныг энэ зөвшөөрөлд хандах эрхийг нь хасах хүртэл <xliff:g id="DEVICE_NAME">%3$s</xliff:g>-д апп дамжуулах боломжтой байх болно."</string>
+ <string name="helper_summary_app_streaming" msgid="1872657107404139828">"<xliff:g id="APP_NAME">%1$s</xliff:g> <xliff:g id="DEVICE_NAME">%2$s</xliff:g>-н өмнөөс таны <xliff:g id="DEVICE_TYPE">%3$s</xliff:g>-с апп болон системийн онцлог дамжуулах зөвшөөрлийг хүсэж байна"</string>
<string name="title_automotive_projection" msgid="3296005598978412847"></string>
<string name="summary_automotive_projection" msgid="8683801274662496164"></string>
<string name="title_computer" msgid="4782923323932440751">"&lt;strong&gt;<xliff:g id="APP_NAME">%1$s</xliff:g>&lt;/strong&gt;-д таны <xliff:g id="DEVICE_TYPE">%2$s</xliff:g>-н энэ мэдээлэлд хандахыг зөвшөөрнө үү"</string>
<string name="summary_computer" msgid="3798467601598297062"></string>
<string name="helper_summary_computer" msgid="2298803016482139668">"<xliff:g id="APP_NAME">%1$s</xliff:g> таны <xliff:g id="DEVICE_NAME">%2$s</xliff:g>-н өмнөөс <xliff:g id="DEVICE_TYPE">%3$s</xliff:g>-н зураг, медиа, мэдэгдэлд хандах зөвшөөрлийг хүсэж байна"</string>
- <!-- no translation found for title_nearby_device_streaming (2727103756701741359) -->
- <skip />
- <!-- no translation found for summary_nearby_device_streaming (70434958004946884) -->
- <skip />
- <!-- no translation found for helper_summary_nearby_device_streaming (4712712177819370967) -->
- <skip />
+ <string name="title_nearby_device_streaming" msgid="2727103756701741359">"&lt;strong&gt;<xliff:g id="APP_NAME">%1$s</xliff:g>&lt;/strong&gt;-д таны <xliff:g id="DEVICE_TYPE">%2$s</xliff:g>-н аппыг &lt;strong&gt;<xliff:g id="DEVICE_NAME">%3$s</xliff:g>&lt;/strong&gt;-д дамжуулахыг зөвшөөрөх үү?"</string>
+ <string name="summary_nearby_device_streaming" msgid="70434958004946884">"<xliff:g id="APP_NAME_0">%1$s</xliff:g> аудио, зураг, төлбөрийн мэдээлэл, нууц үг, мессеж зэрэг <xliff:g id="DEVICE_NAME_1">%3$s</xliff:g> дээр харагдаж, тоглуулж буй аливаа зүйлд хандах эрхтэй болно.&lt;br/&gt;&lt;br/&gt;<xliff:g id="APP_NAME_2">%1$s</xliff:g> таныг энэ зөвшөөрөлд хандах эрхийг нь хасах хүртэл <xliff:g id="DEVICE_NAME_3">%3$s</xliff:g>-д апп дамжуулах боломжтой байх болно."</string>
+ <string name="helper_summary_nearby_device_streaming" msgid="4712712177819370967">"<xliff:g id="APP_NAME">%1$s</xliff:g> <xliff:g id="DEVICE_NAME">%2$s</xliff:g>-н өмнөөс таны <xliff:g id="DEVICE_TYPE">%3$s</xliff:g>-с апп дамжуулах зөвшөөрлийг хүсэж байна"</string>
<string name="profile_name_generic" msgid="6851028682723034988">"төхөөрөмж"</string>
<string name="summary_generic" msgid="1761976003668044801">"Энэ апп залгаж буй хүний нэр зэрэг мэдээллийг таны утас болон сонгосон төхөөрөмжийн хооронд синк хийх боломжтой болно"</string>
<string name="consent_yes" msgid="8344487259618762872">"Зөвшөөрөх"</string>
diff --git a/packages/CompanionDeviceManager/res/values-ms/strings.xml b/packages/CompanionDeviceManager/res/values-ms/strings.xml
index 13916b7c84ab..b3c8bd0a4462 100644
--- a/packages/CompanionDeviceManager/res/values-ms/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-ms/strings.xml
@@ -26,7 +26,7 @@
<string name="profile_name_glasses" msgid="3506504967216601277">"peranti"</string>
<string name="summary_glasses" msgid="5469208629679579157">"Apl ini akan dibenarkan untuk mengakses kebenaran yang berikut pada <xliff:g id="DEVICE_TYPE">%1$s</xliff:g> anda"</string>
<string name="title_app_streaming" msgid="1047090167914857893">"Benarkan &lt;strong&gt;<xliff:g id="APP_NAME">%1$s</xliff:g>&lt;/strong&gt; untuk menstrim apl dan ciri sistem <xliff:g id="DEVICE_TYPE">%2$s</xliff:g> anda kepada &lt;strong&gt;<xliff:g id="DEVICE_NAME">%3$s</xliff:g>&lt;/strong&gt;?"</string>
- <string name="summary_app_streaming" msgid="7990244299655610920">"<xliff:g id="APP_NAME_0">%1$s</xliff:g> akan mendapat akses kepada semua perkara yang dipaparkan atau dimainkan pada <xliff:g id="DEVICE_TYPE">%2$s</xliff:g> anda, termasuk audio, foto, maklumat pembayaran, kata laluan dan mesej.&lt;br/&gt;&lt;br/&gt;<xliff:g id="APP_NAME_1">%1$s</xliff:g> akan dapat menstrim apl kepada <xliff:g id="DEVICE_NAME">%3$s</xliff:g> sehingga anda mengalih keluar akses kepada kebenaran ini."</string>
+ <string name="summary_app_streaming" msgid="7990244299655610920">"<xliff:g id="APP_NAME_0">%1$s</xliff:g> akan mendapat akses kepada semua kandungan yang dipaparkan atau dimainkan pada <xliff:g id="DEVICE_TYPE">%2$s</xliff:g> anda, termasuk audio, foto, maklumat pembayaran, kata laluan dan mesej.&lt;br/&gt;&lt;br/&gt;<xliff:g id="APP_NAME_1">%1$s</xliff:g> akan dapat menstrim apl kepada <xliff:g id="DEVICE_NAME">%3$s</xliff:g> sehingga anda mengalih keluar akses kepada kebenaran ini."</string>
<string name="helper_summary_app_streaming" msgid="1872657107404139828">"<xliff:g id="APP_NAME">%1$s</xliff:g> meminta kebenaran bagi pihak <xliff:g id="DEVICE_NAME">%2$s</xliff:g> untuk menstrim apl dan ciri sistem daripada <xliff:g id="DEVICE_TYPE">%3$s</xliff:g> anda"</string>
<string name="title_automotive_projection" msgid="3296005598978412847"></string>
<string name="summary_automotive_projection" msgid="8683801274662496164"></string>
@@ -34,7 +34,7 @@
<string name="summary_computer" msgid="3798467601598297062"></string>
<string name="helper_summary_computer" msgid="2298803016482139668">"<xliff:g id="APP_NAME">%1$s</xliff:g> sedang meminta kebenaran bagi pihak <xliff:g id="DEVICE_NAME">%2$s</xliff:g> anda untuk mengakses foto, media dan pemberitahuan <xliff:g id="DEVICE_TYPE">%3$s</xliff:g> anda"</string>
<string name="title_nearby_device_streaming" msgid="2727103756701741359">"Benarkan &lt;strong&gt;<xliff:g id="APP_NAME">%1$s</xliff:g>&lt;/strong&gt; untuk menstrim apl <xliff:g id="DEVICE_TYPE">%2$s</xliff:g> anda kepada &lt;strong&gt;<xliff:g id="DEVICE_NAME">%3$s</xliff:g>&lt;/strong&gt;?"</string>
- <string name="summary_nearby_device_streaming" msgid="70434958004946884">"<xliff:g id="APP_NAME_0">%1$s</xliff:g> akan mendapat akses kepada semua perkara yang dipaparkan atau dimainkan pada <xliff:g id="DEVICE_NAME_1">%3$s</xliff:g>, termasuk audio, foto, maklumat pembayaran, kata laluan dan mesej.&lt;br/&gt;&lt;br/&gt;<xliff:g id="APP_NAME_2">%1$s</xliff:g> akan dapat menstrim apl kepada <xliff:g id="DEVICE_NAME_3">%3$s</xliff:g> sehingga anda mengalih keluar akses kepada kebenaran ini."</string>
+ <string name="summary_nearby_device_streaming" msgid="70434958004946884">"<xliff:g id="APP_NAME_0">%1$s</xliff:g> akan mendapat akses kepada semua kandungan yang dipaparkan atau dimainkan pada <xliff:g id="DEVICE_NAME_1">%3$s</xliff:g>, termasuk audio, foto, maklumat pembayaran, kata laluan dan mesej.&lt;br/&gt;&lt;br/&gt;<xliff:g id="APP_NAME_2">%1$s</xliff:g> akan dapat menstrim apl kepada <xliff:g id="DEVICE_NAME_3">%3$s</xliff:g> sehingga anda mengalih keluar akses kepada kebenaran ini."</string>
<string name="helper_summary_nearby_device_streaming" msgid="4712712177819370967">"<xliff:g id="APP_NAME">%1$s</xliff:g> meminta kebenaran bagi pihak <xliff:g id="DEVICE_NAME">%2$s</xliff:g> untuk menstrim apl daripada <xliff:g id="DEVICE_TYPE">%3$s</xliff:g> anda"</string>
<string name="profile_name_generic" msgid="6851028682723034988">"peranti"</string>
<string name="summary_generic" msgid="1761976003668044801">"Apl ini akan dapat menyegerakkan maklumat seperti nama individu yang memanggil, antara telefon anda dengan peranti yang dipilih"</string>
diff --git a/packages/CompanionDeviceManager/res/values-sq/strings.xml b/packages/CompanionDeviceManager/res/values-sq/strings.xml
index 14acdf0d3158..33d243017248 100644
--- a/packages/CompanionDeviceManager/res/values-sq/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-sq/strings.xml
@@ -25,23 +25,17 @@
<string name="confirmation_title_glasses" msgid="8288346850537727333">"Të lejohet që &lt;strong&gt;<xliff:g id="APP_NAME">%1$s</xliff:g>&lt;/strong&gt; të menaxhojë &lt;strong&gt;<xliff:g id="DEVICE_NAME">%2$s</xliff:g>&lt;/strong&gt;?"</string>
<string name="profile_name_glasses" msgid="3506504967216601277">"pajisje"</string>
<string name="summary_glasses" msgid="5469208629679579157">"Këtij aplikacioni do t\'i lejohet qasja te këto leje te <xliff:g id="DEVICE_TYPE">%1$s</xliff:g>"</string>
- <!-- no translation found for title_app_streaming (1047090167914857893) -->
- <skip />
- <!-- no translation found for summary_app_streaming (7990244299655610920) -->
- <skip />
- <!-- no translation found for helper_summary_app_streaming (1872657107404139828) -->
- <skip />
+ <string name="title_app_streaming" msgid="1047090167914857893">"Të lejohet që &lt;strong&gt;<xliff:g id="APP_NAME">%1$s</xliff:g>&lt;/strong&gt; të transmetojë aplikacionet dhe veçoritë e sistemit nga <xliff:g id="DEVICE_TYPE">%2$s</xliff:g> te &lt;strong&gt;<xliff:g id="DEVICE_NAME">%3$s</xliff:g>&lt;/strong&gt;?"</string>
+ <string name="summary_app_streaming" msgid="7990244299655610920">"<xliff:g id="APP_NAME_0">%1$s</xliff:g> do të ketë qasje te çdo gjë që është e dukshme ose që luhet te <xliff:g id="DEVICE_TYPE">%2$s</xliff:g>, duke përfshirë audion, fotografitë, informacionet për pagesën, fjalëkalimet dhe mesazhet.&lt;br/&gt;&lt;br/&gt;<xliff:g id="APP_NAME_1">%1$s</xliff:g> do të mund t\'i transmetojë aplikacionet në <xliff:g id="DEVICE_NAME">%3$s</xliff:g> derisa ta heqësh qasjen për këtë leje."</string>
+ <string name="helper_summary_app_streaming" msgid="1872657107404139828">"<xliff:g id="APP_NAME">%1$s</xliff:g> po kërkon leje në emër të <xliff:g id="DEVICE_NAME">%2$s</xliff:g> për të transmetuar aplikacione dhe veçori të sistemit nga <xliff:g id="DEVICE_TYPE">%3$s</xliff:g>"</string>
<string name="title_automotive_projection" msgid="3296005598978412847"></string>
<string name="summary_automotive_projection" msgid="8683801274662496164"></string>
<string name="title_computer" msgid="4782923323932440751">"Lejo që &lt;strong&gt;<xliff:g id="APP_NAME">%1$s</xliff:g>&lt;/strong&gt; të ketë qasje në këto informacione te <xliff:g id="DEVICE_TYPE">%2$s</xliff:g>"</string>
<string name="summary_computer" msgid="3798467601598297062"></string>
<string name="helper_summary_computer" msgid="2298803016482139668">"<xliff:g id="APP_NAME">%1$s</xliff:g> po kërkon leje në emër të <xliff:g id="DEVICE_NAME">%2$s</xliff:g> për të marrë qasje te fotografitë, media dhe njoftimet te <xliff:g id="DEVICE_TYPE">%3$s</xliff:g>"</string>
- <!-- no translation found for title_nearby_device_streaming (2727103756701741359) -->
- <skip />
- <!-- no translation found for summary_nearby_device_streaming (70434958004946884) -->
- <skip />
- <!-- no translation found for helper_summary_nearby_device_streaming (4712712177819370967) -->
- <skip />
+ <string name="title_nearby_device_streaming" msgid="2727103756701741359">"Të lejohet që &lt;strong&gt;<xliff:g id="APP_NAME">%1$s</xliff:g>&lt;/strong&gt; të transmetojë aplikacionet nga <xliff:g id="DEVICE_TYPE">%2$s</xliff:g> te &lt;strong&gt;<xliff:g id="DEVICE_NAME">%3$s</xliff:g>&lt;/strong&gt;?"</string>
+ <string name="summary_nearby_device_streaming" msgid="70434958004946884">"<xliff:g id="APP_NAME_0">%1$s</xliff:g> do të ketë qasje te çdo gjë që është e dukshme ose që luhet te <xliff:g id="DEVICE_NAME_1">%3$s</xliff:g>, duke përfshirë audion, fotografitë, informacionet për pagesën, fjalëkalimet dhe mesazhet.&lt;br/&gt;&lt;br/&gt;<xliff:g id="APP_NAME_2">%1$s</xliff:g> do të mund t\'i transmetojë aplikacionet në <xliff:g id="DEVICE_NAME_3">%3$s</xliff:g> derisa ta heqësh qasjen për këtë leje."</string>
+ <string name="helper_summary_nearby_device_streaming" msgid="4712712177819370967">"<xliff:g id="APP_NAME">%1$s</xliff:g> po kërkon leje në emër të <xliff:g id="DEVICE_NAME">%2$s</xliff:g> për të transmetuar aplikacione nga <xliff:g id="DEVICE_TYPE">%3$s</xliff:g>"</string>
<string name="profile_name_generic" msgid="6851028682723034988">"pajisja"</string>
<string name="summary_generic" msgid="1761976003668044801">"Ky aplikacion do të mund të sinkronizojë informacione, si p.sh emrin e dikujt që po telefonon, mes telefonit tënd dhe pajisjes së zgjedhur."</string>
<string name="consent_yes" msgid="8344487259618762872">"Lejo"</string>
diff --git a/packages/CompanionDeviceManager/res/values-ta/strings.xml b/packages/CompanionDeviceManager/res/values-ta/strings.xml
index 76e6410e8d32..202ec79c64e1 100644
--- a/packages/CompanionDeviceManager/res/values-ta/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-ta/strings.xml
@@ -25,23 +25,17 @@
<string name="confirmation_title_glasses" msgid="8288346850537727333">"&lt;strong&gt;<xliff:g id="DEVICE_NAME">%2$s</xliff:g>&lt;/strong&amp;gt சாதனத்தை நிர்வகிக்க &lt;strong&gt;<xliff:g id="APP_NAME">%1$s</xliff:g>&lt;/strong&gt; ஆப்ஸை அனுமதிக்கவா?"</string>
<string name="profile_name_glasses" msgid="3506504967216601277">"சாதனம்"</string>
<string name="summary_glasses" msgid="5469208629679579157">"உங்கள் <xliff:g id="DEVICE_TYPE">%1$s</xliff:g> சாதனத்தில் இந்த அனுமதிகளை அணுக இந்த ஆப்ஸ் அனுமதிக்கப்படும்"</string>
- <!-- no translation found for title_app_streaming (1047090167914857893) -->
- <skip />
- <!-- no translation found for summary_app_streaming (7990244299655610920) -->
- <skip />
- <!-- no translation found for helper_summary_app_streaming (1872657107404139828) -->
- <skip />
+ <string name="title_app_streaming" msgid="1047090167914857893">"உங்கள் <xliff:g id="DEVICE_TYPE">%2$s</xliff:g> சாதனத்தின் ஆப்ஸையும் சிஸ்டம் அம்சங்களையும் &lt;strong&gt;<xliff:g id="DEVICE_NAME">%3$s</xliff:g>&lt;/strong&gt; சாதனத்தில் ஸ்ட்ரீம் செய்ய &lt;strong&gt;<xliff:g id="APP_NAME">%1$s</xliff:g>&lt;/strong&gt; ஆப்ஸை அனுமதிக்கவா?"</string>
+ <string name="summary_app_streaming" msgid="7990244299655610920">"ஆடியோ, படங்கள், பேமெண்ட் தகவல்கள், கடவுச்சொற்கள், மெசேஜ்கள் உட்பட <xliff:g id="DEVICE_TYPE">%2$s</xliff:g> சாதனத்தில் காட்டப்படுகின்ற/பிளே செய்யப்படுகின்ற அனைத்தையும் <xliff:g id="APP_NAME_0">%1$s</xliff:g> அணுகும்.&lt;br/&gt;&lt;br/&gt;இந்த அனுமதிக்கான அணுகலை நீங்கள் அகற்றும் வரை <xliff:g id="DEVICE_NAME">%3$s</xliff:g> சாதனத்தில் ஆப்ஸை <xliff:g id="APP_NAME_1">%1$s</xliff:g> ஸ்ட்ரீம் செய்ய முடியும்."</string>
+ <string name="helper_summary_app_streaming" msgid="1872657107404139828">"உங்கள் <xliff:g id="DEVICE_TYPE">%3$s</xliff:g> சாதனத்தில் இருந்து ஆப்ஸையும் சிஸ்டம் அம்சங்களையும் ஸ்ட்ரீம் செய்ய உங்கள் <xliff:g id="DEVICE_NAME">%2$s</xliff:g> சார்பாக <xliff:g id="APP_NAME">%1$s</xliff:g> அனுமதி கேட்கிறது"</string>
<string name="title_automotive_projection" msgid="3296005598978412847"></string>
<string name="summary_automotive_projection" msgid="8683801274662496164"></string>
<string name="title_computer" msgid="4782923323932440751">"உங்கள் <xliff:g id="DEVICE_TYPE">%2$s</xliff:g> சாதனத்தில் உள்ள இந்தத் தகவல்களை அணுக, &lt;strong&gt;<xliff:g id="APP_NAME">%1$s</xliff:g>&lt;/strong&gt; ஆப்ஸை அனுமதிக்கவும்"</string>
<string name="summary_computer" msgid="3798467601598297062"></string>
<string name="helper_summary_computer" msgid="2298803016482139668">"உங்கள் <xliff:g id="DEVICE_TYPE">%3$s</xliff:g> சாதனத்தில் உள்ள படங்கள், மீடியா, அறிவிப்புகள் ஆகியவற்றை அணுக உங்கள் <xliff:g id="DEVICE_NAME">%2$s</xliff:g> சார்பாக <xliff:g id="APP_NAME">%1$s</xliff:g> அனுமதி கேட்கிறது"</string>
- <!-- no translation found for title_nearby_device_streaming (2727103756701741359) -->
- <skip />
- <!-- no translation found for summary_nearby_device_streaming (70434958004946884) -->
- <skip />
- <!-- no translation found for helper_summary_nearby_device_streaming (4712712177819370967) -->
- <skip />
+ <string name="title_nearby_device_streaming" msgid="2727103756701741359">"உங்கள் <xliff:g id="DEVICE_TYPE">%2$s</xliff:g> சாதனத்தின் ஆப்ஸை &lt;strong&gt;<xliff:g id="DEVICE_NAME">%3$s</xliff:g>&lt;/strong&gt; சாதனத்தில் ஸ்ட்ரீம் செய்ய &lt;strong&gt;<xliff:g id="APP_NAME">%1$s</xliff:g>&lt;/strong&gt; ஆப்ஸை அனுமதிக்கவா?"</string>
+ <string name="summary_nearby_device_streaming" msgid="70434958004946884">"ஆடியோ, படங்கள், பேமெண்ட் தகவல்கள், கடவுச்சொற்கள், மெசேஜ்கள் உட்பட <xliff:g id="DEVICE_NAME_1">%3$s</xliff:g> சாதனத்தில் காட்டப்படுகின்ற/பிளே செய்யப்படுகின்ற அனைத்தையும் <xliff:g id="APP_NAME_0">%1$s</xliff:g> அணுகும்.&lt;br/&gt;&lt;br/&gt;இந்த அனுமதிக்கான அணுகலை நீங்கள் அகற்றும் வரை <xliff:g id="DEVICE_NAME_3">%3$s</xliff:g> சாதனத்தில் ஆப்ஸை <xliff:g id="APP_NAME_2">%1$s</xliff:g> ஸ்ட்ரீம் செய்ய முடியும்."</string>
+ <string name="helper_summary_nearby_device_streaming" msgid="4712712177819370967">"உங்கள் <xliff:g id="DEVICE_TYPE">%3$s</xliff:g> சாதனத்தில் இருந்து ஆப்ஸை ஸ்ட்ரீம் செய்ய உங்கள் <xliff:g id="DEVICE_NAME">%2$s</xliff:g> சார்பாக <xliff:g id="APP_NAME">%1$s</xliff:g> அனுமதி கேட்கிறது"</string>
<string name="profile_name_generic" msgid="6851028682723034988">"சாதனம்"</string>
<string name="summary_generic" msgid="1761976003668044801">"அழைப்பவரின் பெயர் போன்ற தகவலை உங்கள் மொபைல் மற்றும் தேர்வுசெய்த சாதனத்திற்கு இடையில் இந்த ஆப்ஸால் ஒத்திசைக்க முடியும்"</string>
<string name="consent_yes" msgid="8344487259618762872">"அனுமதி"</string>
diff --git a/packages/CompanionDeviceManager/res/values-tr/strings.xml b/packages/CompanionDeviceManager/res/values-tr/strings.xml
index 44d6bf7da32c..7acad6475875 100644
--- a/packages/CompanionDeviceManager/res/values-tr/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-tr/strings.xml
@@ -25,23 +25,17 @@
<string name="confirmation_title_glasses" msgid="8288346850537727333">"&lt;strong&gt;<xliff:g id="APP_NAME">%1$s</xliff:g>&lt;/strong&gt; uygulamasına &lt;strong&gt;<xliff:g id="DEVICE_NAME">%2$s</xliff:g>&lt;/strong&gt; cihazını yönetmesi için izin verilsin mi?"</string>
<string name="profile_name_glasses" msgid="3506504967216601277">"Cihaz"</string>
<string name="summary_glasses" msgid="5469208629679579157">"Bu uygulamanın <xliff:g id="DEVICE_TYPE">%1$s</xliff:g> cihazınızda şu izinlere erişmesine izin verilecek:"</string>
- <!-- no translation found for title_app_streaming (1047090167914857893) -->
- <skip />
- <!-- no translation found for summary_app_streaming (7990244299655610920) -->
- <skip />
- <!-- no translation found for helper_summary_app_streaming (1872657107404139828) -->
- <skip />
+ <string name="title_app_streaming" msgid="1047090167914857893">"&lt;strong&gt;<xliff:g id="APP_NAME">%1$s</xliff:g>&lt;/strong&gt; adlı uygulamanın <xliff:g id="DEVICE_TYPE">%2$s</xliff:g> cihazınızdaki uygulamaları ve sistem özelliklerini &lt;strong&gt;<xliff:g id="DEVICE_NAME">%3$s</xliff:g>&lt;/strong&gt; cihazına aktarmasına izin verilsin mi?"</string>
+ <string name="summary_app_streaming" msgid="7990244299655610920">"<xliff:g id="APP_NAME_0">%1$s</xliff:g>; ses, fotoğraflar, ödeme bilgileri, şifreler ve mesajlar da dahil olmak üzere <xliff:g id="DEVICE_TYPE">%2$s</xliff:g> cihazınızda görünen veya oynatılan her şeye erişebilecek.&lt;br/&gt;&lt;br/&gt;<xliff:g id="APP_NAME_1">%1$s</xliff:g> siz bu iznin erişimini kaldırana kadar uygulamaları <xliff:g id="DEVICE_NAME">%3$s</xliff:g> cihazına aktarabilecek."</string>
+ <string name="helper_summary_app_streaming" msgid="1872657107404139828">"<xliff:g id="APP_NAME">%1$s</xliff:g>, <xliff:g id="DEVICE_NAME">%2$s</xliff:g> adına uygulamaları ve sistem özelliklerini <xliff:g id="DEVICE_TYPE">%3$s</xliff:g> cihazınızdan aktarmak için izin istiyor"</string>
<string name="title_automotive_projection" msgid="3296005598978412847"></string>
<string name="summary_automotive_projection" msgid="8683801274662496164"></string>
<string name="title_computer" msgid="4782923323932440751">"&lt;strong&gt;<xliff:g id="APP_NAME">%1$s</xliff:g>&lt;/strong&gt; uygulamasının, <xliff:g id="DEVICE_TYPE">%2$s</xliff:g> cihazınızdaki bu bilgilere erişmesine izin verin"</string>
<string name="summary_computer" msgid="3798467601598297062"></string>
<string name="helper_summary_computer" msgid="2298803016482139668">"<xliff:g id="APP_NAME">%1$s</xliff:g>, <xliff:g id="DEVICE_TYPE">%3$s</xliff:g> içindeki fotoğraf, medya ve bildirimlere erişmek için <xliff:g id="DEVICE_NAME">%2$s</xliff:g> cihazınız adına izin istiyor"</string>
- <!-- no translation found for title_nearby_device_streaming (2727103756701741359) -->
- <skip />
- <!-- no translation found for summary_nearby_device_streaming (70434958004946884) -->
- <skip />
- <!-- no translation found for helper_summary_nearby_device_streaming (4712712177819370967) -->
- <skip />
+ <string name="title_nearby_device_streaming" msgid="2727103756701741359">"&lt;strong&gt;<xliff:g id="APP_NAME">%1$s</xliff:g>&lt;/strong&gt; adlı uygulamanın <xliff:g id="DEVICE_TYPE">%2$s</xliff:g> cihazınızdaki uygulamaları &lt;strong&gt;<xliff:g id="DEVICE_NAME">%3$s</xliff:g>&lt;/strong&gt; cihazına aktarmasına izin verilsin mi?"</string>
+ <string name="summary_nearby_device_streaming" msgid="70434958004946884">"<xliff:g id="APP_NAME_0">%1$s</xliff:g>; ses, fotoğraflar, ödeme bilgileri, şifreler ve mesajlar da dahil olmak üzere <xliff:g id="DEVICE_NAME_1">%3$s</xliff:g> cihazında görünen veya oynatılan her şeye erişebilecek.&lt;br/&gt;&lt;br/&gt;<xliff:g id="APP_NAME_2">%1$s</xliff:g> siz bu iznin erişimini kaldırana kadar uygulamaları <xliff:g id="DEVICE_NAME_3">%3$s</xliff:g> cihazına aktarabilecek."</string>
+ <string name="helper_summary_nearby_device_streaming" msgid="4712712177819370967">"<xliff:g id="APP_NAME">%1$s</xliff:g>, <xliff:g id="DEVICE_NAME">%2$s</xliff:g> adına uygulamaları <xliff:g id="DEVICE_TYPE">%3$s</xliff:g> cihazınızdan aktarmak için izin istiyor"</string>
<string name="profile_name_generic" msgid="6851028682723034988">"cihaz"</string>
<string name="summary_generic" msgid="1761976003668044801">"Bu uygulama, arayan kişinin adı gibi bilgileri telefonunuz ve seçili cihaz arasında senkronize edebilir"</string>
<string name="consent_yes" msgid="8344487259618762872">"İzin ver"</string>
diff --git a/packages/CompanionDeviceManager/res/values-uk/strings.xml b/packages/CompanionDeviceManager/res/values-uk/strings.xml
index 1d248b6570fc..50f93d53a660 100644
--- a/packages/CompanionDeviceManager/res/values-uk/strings.xml
+++ b/packages/CompanionDeviceManager/res/values-uk/strings.xml
@@ -25,23 +25,17 @@
<string name="confirmation_title_glasses" msgid="8288346850537727333">"Дозволити додатку &lt;strong&gt;<xliff:g id="APP_NAME">%1$s</xliff:g>&lt;/strong&gt; керувати пристроєм &lt;strong&gt;<xliff:g id="DEVICE_NAME">%2$s</xliff:g>&lt;/strong&gt;?"</string>
<string name="profile_name_glasses" msgid="3506504967216601277">"пристрій"</string>
<string name="summary_glasses" msgid="5469208629679579157">"Цей додаток матиме доступ до перелічених нижче дозволів на вашому <xliff:g id="DEVICE_TYPE">%1$s</xliff:g>"</string>
- <!-- no translation found for title_app_streaming (1047090167914857893) -->
- <skip />
- <!-- no translation found for summary_app_streaming (7990244299655610920) -->
- <skip />
- <!-- no translation found for helper_summary_app_streaming (1872657107404139828) -->
- <skip />
+ <string name="title_app_streaming" msgid="1047090167914857893">"Дозволити пристрою &lt;strong&gt;<xliff:g id="APP_NAME">%1$s</xliff:g>&lt;/strong&gt; транслювати додатки й системні функції на <xliff:g id="DEVICE_TYPE">%2$s</xliff:g> на пристрій &lt;strong&gt;<xliff:g id="DEVICE_NAME">%3$s</xliff:g>&lt;/strong&gt;?"</string>
+ <string name="summary_app_streaming" msgid="7990244299655610920">"Додаток <xliff:g id="APP_NAME_0">%1$s</xliff:g> матиме доступ до контенту, що відображається чи відтворюється на вашому <xliff:g id="DEVICE_TYPE">%2$s</xliff:g>, зокрема до аудіо, фото, платіжної інформації, паролів і повідомлень.&lt;br/&gt;&lt;br/&gt;Додаток <xliff:g id="APP_NAME_1">%1$s</xliff:g> зможе транслювати додатки на пристрій \"<xliff:g id="DEVICE_NAME">%3$s</xliff:g>\", поки ви не скасуєте цей дозвіл."</string>
+ <string name="helper_summary_app_streaming" msgid="1872657107404139828">"Додаток <xliff:g id="APP_NAME">%1$s</xliff:g> від імені пристрою \"<xliff:g id="DEVICE_NAME">%2$s</xliff:g>\" запитує дозвіл на трансляцію додатків і системних функцій на вашому <xliff:g id="DEVICE_TYPE">%3$s</xliff:g>"</string>
<string name="title_automotive_projection" msgid="3296005598978412847"></string>
<string name="summary_automotive_projection" msgid="8683801274662496164"></string>
<string name="title_computer" msgid="4782923323932440751">"Дозвольте додатку &lt;strong&gt;<xliff:g id="APP_NAME">%1$s</xliff:g>&lt;/strong&gt; доступ до цієї інформації на вашому <xliff:g id="DEVICE_TYPE">%2$s</xliff:g>"</string>
<string name="summary_computer" msgid="3798467601598297062"></string>
<string name="helper_summary_computer" msgid="2298803016482139668">"Додаток <xliff:g id="APP_NAME">%1$s</xliff:g> від імені вашого пристрою \"<xliff:g id="DEVICE_NAME">%2$s</xliff:g>\" запитує дозвіл на доступ до фотографій, медіафайлів і сповіщень на вашому <xliff:g id="DEVICE_TYPE">%3$s</xliff:g>"</string>
- <!-- no translation found for title_nearby_device_streaming (2727103756701741359) -->
- <skip />
- <!-- no translation found for summary_nearby_device_streaming (70434958004946884) -->
- <skip />
- <!-- no translation found for helper_summary_nearby_device_streaming (4712712177819370967) -->
- <skip />
+ <string name="title_nearby_device_streaming" msgid="2727103756701741359">"Дозволити додатку &lt;strong&gt;<xliff:g id="APP_NAME">%1$s</xliff:g>&lt;/strong&gt; транслювати додатки на вашому <xliff:g id="DEVICE_TYPE">%2$s</xliff:g> на пристрій &lt;strong&gt;<xliff:g id="DEVICE_NAME">%3$s</xliff:g>&lt;/strong&gt;?"</string>
+ <string name="summary_nearby_device_streaming" msgid="70434958004946884">"Додаток <xliff:g id="APP_NAME_0">%1$s</xliff:g> матиме доступ до контенту, що відображається чи відтворюється на пристрої \"<xliff:g id="DEVICE_NAME_1">%3$s</xliff:g>\", зокрема до аудіо, фото, платіжної інформації, паролів і повідомлень.&lt;br/&gt;&lt;br/&gt;Додаток <xliff:g id="APP_NAME_2">%1$s</xliff:g> зможе транслювати додатки на пристрій \"<xliff:g id="DEVICE_NAME_3">%3$s</xliff:g>\", поки ви не скасуєте цей дозвіл."</string>
+ <string name="helper_summary_nearby_device_streaming" msgid="4712712177819370967">"Додаток <xliff:g id="APP_NAME">%1$s</xliff:g> від імені пристрою \"<xliff:g id="DEVICE_NAME">%2$s</xliff:g>\" запитує дозвіл на трансляцію додатків на вашому <xliff:g id="DEVICE_TYPE">%3$s</xliff:g>"</string>
<string name="profile_name_generic" msgid="6851028682723034988">"пристрій"</string>
<string name="summary_generic" msgid="1761976003668044801">"Цей додаток зможе синхронізувати інформацію (наприклад, ім’я абонента, який викликає) між телефоном і вибраним пристроєм"</string>
<string name="consent_yes" msgid="8344487259618762872">"Дозволити"</string>
diff --git a/packages/CredentialManager/src/com/android/credentialmanager/common/ui/SnackBar.kt b/packages/CredentialManager/src/com/android/credentialmanager/common/ui/SnackBar.kt
index 244b604a87f9..41b4e9bf318d 100644
--- a/packages/CredentialManager/src/com/android/credentialmanager/common/ui/SnackBar.kt
+++ b/packages/CredentialManager/src/com/android/credentialmanager/common/ui/SnackBar.kt
@@ -19,7 +19,10 @@ package com.android.credentialmanager.common.ui
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.BoxWithConstraints
import androidx.compose.foundation.layout.Row
+import androidx.compose.foundation.layout.WindowInsets
+import androidx.compose.foundation.layout.asPaddingValues
import androidx.compose.foundation.layout.fillMaxSize
+import androidx.compose.foundation.layout.navigationBars
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.wrapContentSize
import androidx.compose.material.icons.Icons
@@ -61,8 +64,15 @@ fun Snackbar(
)
}
Box(
- modifier = Modifier
- .align(Alignment.BottomCenter).wrapContentSize().padding(bottom = 18.dp)
+ modifier =
+ Modifier.align(Alignment.BottomCenter)
+ .wrapContentSize()
+ .padding(
+ bottom =
+ WindowInsets.navigationBars.asPaddingValues().calculateBottomPadding() + 24.dp,
+ start = 24.dp,
+ end = 24.dp,
+ )
) {
Card(
shape = Shapes.medium,
diff --git a/packages/PrintSpooler/res/values-kn/strings.xml b/packages/PrintSpooler/res/values-kn/strings.xml
index 27279a7e8fc9..93de16f9fa0a 100644
--- a/packages/PrintSpooler/res/values-kn/strings.xml
+++ b/packages/PrintSpooler/res/values-kn/strings.xml
@@ -33,7 +33,7 @@
<string name="pages_range_example" msgid="8558694453556945172">"ಉದಾ. 1—5,8,11—13"</string>
<string name="print_preview" msgid="8010217796057763343">"ಮುದ್ರಣ ಪೂರ್ವವೀಕ್ಷಣೆ"</string>
<string name="install_for_print_preview" msgid="6366303997385509332">"ಪೂರ್ವವೀಕ್ಷಣೆಗಾಗಿ PDF ವೀಕ್ಷಕವನ್ನು ಸ್ಥಾಪಿಸಿ"</string>
- <string name="printing_app_crashed" msgid="854477616686566398">"ಮುದ್ರಣದ ಅಪ್ಲಿಕೇಶನ್ ಕ್ರ್ಯಾಶ್ ಆಗಿದೆ"</string>
+ <string name="printing_app_crashed" msgid="854477616686566398">"ಮುದ್ರಣದ ಆ್ಯಪ್‌ ಕ್ರ್ಯಾಶ್ ಆಗಿದೆ"</string>
<string name="generating_print_job" msgid="3119608742651698916">"ಮುದ್ರಣ ಕಾರ್ಯ ರಚಿಸಲಾಗುತ್ತಿದೆ"</string>
<string name="save_as_pdf" msgid="5718454119847596853">"PDF ರೂಪದಲ್ಲಿ ಸೇವ್ ಮಾಡಿ"</string>
<string name="all_printers" msgid="5018829726861876202">"ಎಲ್ಲಾ ಪ್ರಿಂಟರ್‌ಗಳು…"</string>
diff --git a/packages/SettingsLib/DataStore/src/com/android/settingslib/datastore/SettingsGlobalStore.kt b/packages/SettingsLib/DataStore/src/com/android/settingslib/datastore/SettingsGlobalStore.kt
index fb935591d9f0..53507fe46d1f 100644
--- a/packages/SettingsLib/DataStore/src/com/android/settingslib/datastore/SettingsGlobalStore.kt
+++ b/packages/SettingsLib/DataStore/src/com/android/settingslib/datastore/SettingsGlobalStore.kt
@@ -18,6 +18,7 @@ package com.android.settingslib.datastore
import android.content.ContentResolver
import android.content.Context
+import android.net.Uri
import android.provider.Settings.Global
import android.provider.Settings.SettingNotFoundException
@@ -29,6 +30,9 @@ import android.provider.Settings.SettingNotFoundException
class SettingsGlobalStore private constructor(contentResolver: ContentResolver) :
SettingsStore(contentResolver) {
+ override val uri: Uri
+ get() = Global.getUriFor("")
+
override val tag: String
get() = "SettingsGlobalStore"
diff --git a/packages/SettingsLib/DataStore/src/com/android/settingslib/datastore/SettingsSecureStore.kt b/packages/SettingsLib/DataStore/src/com/android/settingslib/datastore/SettingsSecureStore.kt
index bc375712e597..ca7fd7bb5f1e 100644
--- a/packages/SettingsLib/DataStore/src/com/android/settingslib/datastore/SettingsSecureStore.kt
+++ b/packages/SettingsLib/DataStore/src/com/android/settingslib/datastore/SettingsSecureStore.kt
@@ -18,6 +18,7 @@ package com.android.settingslib.datastore
import android.content.ContentResolver
import android.content.Context
+import android.net.Uri
import android.provider.Settings.Secure
import android.provider.Settings.SettingNotFoundException
@@ -29,6 +30,9 @@ import android.provider.Settings.SettingNotFoundException
class SettingsSecureStore private constructor(contentResolver: ContentResolver) :
SettingsStore(contentResolver) {
+ override val uri: Uri
+ get() = Secure.getUriFor("")
+
override val tag: String
get() = "SettingsSecureStore"
diff --git a/packages/SettingsLib/DataStore/src/com/android/settingslib/datastore/SettingsStore.kt b/packages/SettingsLib/DataStore/src/com/android/settingslib/datastore/SettingsStore.kt
index fdefa39dbd2e..62d3fc364d28 100644
--- a/packages/SettingsLib/DataStore/src/com/android/settingslib/datastore/SettingsStore.kt
+++ b/packages/SettingsLib/DataStore/src/com/android/settingslib/datastore/SettingsStore.kt
@@ -21,7 +21,6 @@ import android.database.ContentObserver
import android.net.Uri
import android.os.Handler
import android.os.Looper
-import android.provider.Settings
import android.util.Log
import java.util.concurrent.Executor
import java.util.concurrent.atomic.AtomicInteger
@@ -70,13 +69,12 @@ abstract class SettingsStore(protected val contentResolver: ContentResolver) :
private fun onObserverAdded() {
if (counter.getAndIncrement() != 0) return
Log.i(tag, "registerContentObserver")
- contentResolver.registerContentObserver(
- Settings.Global.getUriFor(""),
- true,
- contentObserver,
- )
+ contentResolver.registerContentObserver(uri, true, contentObserver)
}
+ /** The URI to watch for any key change. */
+ protected abstract val uri: Uri
+
override fun removeObserver(observer: KeyedObserver<String?>) =
if (super.removeObserver(observer)) {
onObserverRemoved()
@@ -99,6 +97,37 @@ abstract class SettingsStore(protected val contentResolver: ContentResolver) :
contentResolver.unregisterContentObserver(contentObserver)
}
+ /** Gets the boolean value of given key. */
+ fun getBoolean(key: String): Boolean? = getValue(key, Boolean::class.javaObjectType)
+
+ /** Sets boolean value for given key, null value means delete the key from data store. */
+ fun setBoolean(key: String, value: Boolean?) =
+ setValue(key, Boolean::class.javaObjectType, value)
+
+ /** Gets the float value of given key. */
+ fun getFloat(key: String): Float? = getValue(key, Float::class.javaObjectType)
+
+ /** Sets float value for given key, null value means delete the key from data store. */
+ fun setFloat(key: String, value: Float?) = setValue(key, Float::class.javaObjectType, value)
+
+ /** Gets the int value of given key. */
+ fun getInt(key: String): Int? = getValue(key, Int::class.javaObjectType)
+
+ /** Sets int value for given key, null value means delete the key from data store. */
+ fun setInt(key: String, value: Int?) = setValue(key, Int::class.javaObjectType, value)
+
+ /** Gets the long value of given key. */
+ fun getLong(key: String): Long? = getValue(key, Long::class.javaObjectType)
+
+ /** Sets long value for given key, null value means delete the key from data store. */
+ fun setLong(key: String, value: Long?) = setValue(key, Long::class.javaObjectType, value)
+
+ /** Gets the string value of given key. */
+ fun getString(key: String): String? = getValue(key, String::class.javaObjectType)
+
+ /** Sets string value for given key, null value means delete the key from data store. */
+ fun setString(key: String, value: String?) = setValue(key, String::class.javaObjectType, value)
+
/** Tag for logging. */
abstract val tag: String
}
diff --git a/packages/SettingsLib/DataStore/src/com/android/settingslib/datastore/SettingsSystemStore.kt b/packages/SettingsLib/DataStore/src/com/android/settingslib/datastore/SettingsSystemStore.kt
index 1c75c7cac0c3..20a74d3b4a81 100644
--- a/packages/SettingsLib/DataStore/src/com/android/settingslib/datastore/SettingsSystemStore.kt
+++ b/packages/SettingsLib/DataStore/src/com/android/settingslib/datastore/SettingsSystemStore.kt
@@ -18,6 +18,7 @@ package com.android.settingslib.datastore
import android.content.ContentResolver
import android.content.Context
+import android.net.Uri
import android.provider.Settings.SettingNotFoundException
import android.provider.Settings.System
@@ -29,6 +30,9 @@ import android.provider.Settings.System
class SettingsSystemStore private constructor(contentResolver: ContentResolver) :
SettingsStore(contentResolver) {
+ override val uri: Uri
+ get() = System.getUriFor("")
+
override val tag: String
get() = "SettingsSystemStore"
diff --git a/packages/SettingsLib/DeviceStateRotationLock/src/com.android.settingslib.devicestate/DeviceStateRotationLockSettingsManager.java b/packages/SettingsLib/DeviceStateRotationLock/src/com.android.settingslib.devicestate/DeviceStateRotationLockSettingsManager.java
index ea4ac2c928ce..635f6905e4f0 100644
--- a/packages/SettingsLib/DeviceStateRotationLock/src/com.android.settingslib.devicestate/DeviceStateRotationLockSettingsManager.java
+++ b/packages/SettingsLib/DeviceStateRotationLock/src/com.android.settingslib.devicestate/DeviceStateRotationLockSettingsManager.java
@@ -20,10 +20,13 @@ import static android.provider.Settings.Secure.DEVICE_STATE_ROTATION_LOCK_IGNORE
import static android.provider.Settings.Secure.DEVICE_STATE_ROTATION_LOCK_LOCKED;
import static android.provider.Settings.Secure.DEVICE_STATE_ROTATION_LOCK_UNLOCKED;
+import android.annotation.Nullable;
import android.content.ContentResolver;
import android.content.Context;
import android.content.res.Resources;
import android.database.ContentObserver;
+import android.hardware.devicestate.DeviceStateManager;
+import android.os.Build;
import android.os.Handler;
import android.os.Looper;
import android.os.UserHandle;
@@ -67,7 +70,8 @@ public final class DeviceStateRotationLockSettingsManager {
@VisibleForTesting
DeviceStateRotationLockSettingsManager(Context context, SecureSettings secureSettings) {
mSecureSettings = secureSettings;
- mPosturesHelper = new PosturesHelper(context);
+
+ mPosturesHelper = new PosturesHelper(context, getDeviceStateManager(context));
mPostureRotationLockDefaults =
context.getResources()
.getStringArray(R.array.config_perDeviceStateRotationLockDefaults);
@@ -76,6 +80,14 @@ public final class DeviceStateRotationLockSettingsManager {
listenForSettingsChange();
}
+ @Nullable
+ private DeviceStateManager getDeviceStateManager(Context context) {
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
+ return context.getSystemService(DeviceStateManager.class);
+ }
+ return null;
+ }
+
/** Returns a singleton instance of this class */
public static synchronized DeviceStateRotationLockSettingsManager getInstance(Context context) {
if (sSingleton == null) {
diff --git a/packages/SettingsLib/DeviceStateRotationLock/src/com.android.settingslib.devicestate/PosturesHelper.kt b/packages/SettingsLib/DeviceStateRotationLock/src/com.android.settingslib.devicestate/PosturesHelper.kt
index 6a13eb8c3907..14d59f2e416c 100644
--- a/packages/SettingsLib/DeviceStateRotationLock/src/com.android.settingslib.devicestate/PosturesHelper.kt
+++ b/packages/SettingsLib/DeviceStateRotationLock/src/com.android.settingslib.devicestate/PosturesHelper.kt
@@ -17,6 +17,12 @@
package com.android.settingslib.devicestate
import android.content.Context
+import android.hardware.devicestate.DeviceState
+import android.hardware.devicestate.DeviceState.PROPERTY_FEATURE_REAR_DISPLAY
+import android.hardware.devicestate.DeviceState.PROPERTY_FOLDABLE_DISPLAY_CONFIGURATION_INNER_PRIMARY
+import android.hardware.devicestate.DeviceState.PROPERTY_FOLDABLE_DISPLAY_CONFIGURATION_OUTER_PRIMARY
+import android.hardware.devicestate.DeviceState.PROPERTY_FOLDABLE_HARDWARE_CONFIGURATION_FOLD_IN_HALF_OPEN
+import android.hardware.devicestate.DeviceStateManager
import android.provider.Settings.Secure.DEVICE_STATE_ROTATION_KEY_FOLDED
import android.provider.Settings.Secure.DEVICE_STATE_ROTATION_KEY_HALF_FOLDED
import android.provider.Settings.Secure.DEVICE_STATE_ROTATION_KEY_REAR_DISPLAY
@@ -24,37 +30,68 @@ import android.provider.Settings.Secure.DEVICE_STATE_ROTATION_KEY_UNFOLDED
import android.provider.Settings.Secure.DEVICE_STATE_ROTATION_KEY_UNKNOWN
import android.provider.Settings.Secure.DeviceStateRotationLockKey
import com.android.internal.R
+import android.hardware.devicestate.feature.flags.Flags as DeviceStateManagerFlags
/** Helps to convert between device state and posture. */
-class PosturesHelper(context: Context) {
+class PosturesHelper(context: Context, deviceStateManager: DeviceStateManager?) {
- private val foldedDeviceStates =
- context.resources.getIntArray(R.array.config_foldedDeviceStates)
- private val halfFoldedDeviceStates =
- context.resources.getIntArray(R.array.config_halfFoldedDeviceStates)
- private val unfoldedDeviceStates =
- context.resources.getIntArray(R.array.config_openDeviceStates)
- private val rearDisplayDeviceStates =
- context.resources.getIntArray(R.array.config_rearDisplayDeviceStates)
+ private val postures: Map<Int, List<Int>>
+
+ init {
+ if (deviceStateManager != null && DeviceStateManagerFlags.deviceStatePropertyMigration()) {
+ postures =
+ deviceStateManager.supportedDeviceStates.groupBy { it.toPosture() }
+ .filterKeys { it != DEVICE_STATE_ROTATION_KEY_UNKNOWN }
+ .mapValues { it.value.map { it.identifier }}
+ } else {
+ val foldedDeviceStates =
+ context.resources.getIntArray(R.array.config_foldedDeviceStates).toList()
+ val halfFoldedDeviceStates =
+ context.resources.getIntArray(R.array.config_halfFoldedDeviceStates).toList()
+ val unfoldedDeviceStates =
+ context.resources.getIntArray(R.array.config_openDeviceStates).toList()
+ val rearDisplayDeviceStates =
+ context.resources.getIntArray(R.array.config_rearDisplayDeviceStates).toList()
+
+ postures =
+ mapOf(
+ DEVICE_STATE_ROTATION_KEY_FOLDED to foldedDeviceStates,
+ DEVICE_STATE_ROTATION_KEY_HALF_FOLDED to halfFoldedDeviceStates,
+ DEVICE_STATE_ROTATION_KEY_UNFOLDED to unfoldedDeviceStates,
+ DEVICE_STATE_ROTATION_KEY_REAR_DISPLAY to rearDisplayDeviceStates
+ )
+ }
+ }
@DeviceStateRotationLockKey
fun deviceStateToPosture(deviceState: Int): Int {
- return when (deviceState) {
- in foldedDeviceStates -> DEVICE_STATE_ROTATION_KEY_FOLDED
- in halfFoldedDeviceStates -> DEVICE_STATE_ROTATION_KEY_HALF_FOLDED
- in unfoldedDeviceStates -> DEVICE_STATE_ROTATION_KEY_UNFOLDED
- in rearDisplayDeviceStates -> DEVICE_STATE_ROTATION_KEY_REAR_DISPLAY
- else -> DEVICE_STATE_ROTATION_KEY_UNKNOWN
- }
+ return postures.filterValues { it.contains(deviceState) }.keys.firstOrNull()
+ ?: DEVICE_STATE_ROTATION_KEY_UNKNOWN
}
fun postureToDeviceState(@DeviceStateRotationLockKey posture: Int): Int? {
- return when (posture) {
- DEVICE_STATE_ROTATION_KEY_FOLDED -> foldedDeviceStates.firstOrNull()
- DEVICE_STATE_ROTATION_KEY_HALF_FOLDED -> halfFoldedDeviceStates.firstOrNull()
- DEVICE_STATE_ROTATION_KEY_UNFOLDED -> unfoldedDeviceStates.firstOrNull()
- DEVICE_STATE_ROTATION_KEY_REAR_DISPLAY -> rearDisplayDeviceStates.firstOrNull()
- else -> null
+ return postures[posture]?.firstOrNull()
+ }
+
+ /**
+ * Maps a [DeviceState] to the corresponding [DeviceStateRotationLockKey] value based on the
+ * properties of the state.
+ */
+ @DeviceStateRotationLockKey
+ private fun DeviceState.toPosture(): Int {
+ return if (hasProperty(PROPERTY_FEATURE_REAR_DISPLAY)) {
+ DEVICE_STATE_ROTATION_KEY_REAR_DISPLAY
+ } else if (hasProperty(PROPERTY_FOLDABLE_DISPLAY_CONFIGURATION_OUTER_PRIMARY)) {
+ DEVICE_STATE_ROTATION_KEY_FOLDED
+ } else if (hasProperties(
+ PROPERTY_FOLDABLE_DISPLAY_CONFIGURATION_INNER_PRIMARY,
+ PROPERTY_FOLDABLE_HARDWARE_CONFIGURATION_FOLD_IN_HALF_OPEN
+ )) {
+ DEVICE_STATE_ROTATION_KEY_HALF_FOLDED
+ } else if (hasProperty(PROPERTY_FOLDABLE_DISPLAY_CONFIGURATION_INNER_PRIMARY)) {
+ DEVICE_STATE_ROTATION_KEY_UNFOLDED
+ } else {
+ DEVICE_STATE_ROTATION_KEY_UNKNOWN
}
}
}
diff --git a/packages/SettingsLib/Preference/src/com/android/settingslib/preference/PreferenceScreenBindingHelper.kt b/packages/SettingsLib/Preference/src/com/android/settingslib/preference/PreferenceScreenBindingHelper.kt
index 95b921b8e8c8..efa1faf6c485 100644
--- a/packages/SettingsLib/Preference/src/com/android/settingslib/preference/PreferenceScreenBindingHelper.kt
+++ b/packages/SettingsLib/Preference/src/com/android/settingslib/preference/PreferenceScreenBindingHelper.kt
@@ -20,8 +20,10 @@ import android.content.Context
import android.os.Handler
import android.os.Looper
import androidx.preference.Preference
+import androidx.preference.PreferenceDataStore
import androidx.preference.PreferenceGroup
import androidx.preference.PreferenceScreen
+import com.android.settingslib.datastore.KeyValueStore
import com.android.settingslib.datastore.KeyedDataObservable
import com.android.settingslib.datastore.KeyedObservable
import com.android.settingslib.datastore.KeyedObserver
@@ -181,15 +183,22 @@ class PreferenceScreenBindingHelper(
private fun PreferenceGroup.bindRecursively(
preferenceBindingFactory: PreferenceBindingFactory,
preferences: Map<String, PreferenceMetadata>,
+ storages: MutableMap<KeyValueStore, PreferenceDataStore> = mutableMapOf(),
) {
preferenceBindingFactory.bind(this, preferences[key])
val count = preferenceCount
for (index in 0 until count) {
val preference = getPreference(index)
if (preference is PreferenceGroup) {
- preference.bindRecursively(preferenceBindingFactory, preferences)
+ preference.bindRecursively(preferenceBindingFactory, preferences, storages)
} else {
- preferenceBindingFactory.bind(preference, preferences[preference.key])
+ preferences[preference.key]?.let {
+ preferenceBindingFactory.getPreferenceBinding(it)?.bind(preference, it)
+ (it as? PersistentPreference<*>)?.storage(context)?.let { storage ->
+ preference.preferenceDataStore =
+ storages.getOrPut(storage) { PreferenceDataStoreAdapter(storage) }
+ }
+ }
}
}
}
diff --git a/packages/SettingsLib/Preference/testutils/com/android/settingslib/preference/CatalystScreenTestCase.kt b/packages/SettingsLib/Preference/testutils/com/android/settingslib/preference/CatalystScreenTestCase.kt
index 1412c84c137b..06214eb6e743 100644
--- a/packages/SettingsLib/Preference/testutils/com/android/settingslib/preference/CatalystScreenTestCase.kt
+++ b/packages/SettingsLib/Preference/testutils/com/android/settingslib/preference/CatalystScreenTestCase.kt
@@ -37,7 +37,7 @@ import org.junit.runner.RunWith
abstract class CatalystScreenTestCase {
@get:Rule val setFlagsRule = SetFlagsRule()
- protected val context: Context = ApplicationProvider.getApplicationContext()
+ protected val appContext: Context = ApplicationProvider.getApplicationContext()
/** Catalyst screen. */
protected abstract val preferenceScreenCreator: PreferenceScreenCreator
@@ -52,12 +52,12 @@ abstract class CatalystScreenTestCase {
@Test
open fun migration() {
enableCatalystScreen()
- assertThat(preferenceScreenCreator.isFlagEnabled(context)).isTrue()
+ assertThat(preferenceScreenCreator.isFlagEnabled(appContext)).isTrue()
val catalystScreen = dumpPreferenceScreen()
Log.i(TAG, catalystScreen)
disableCatalystScreen()
- assertThat(preferenceScreenCreator.isFlagEnabled(context)).isFalse()
+ assertThat(preferenceScreenCreator.isFlagEnabled(appContext)).isFalse()
val legacyScreen = dumpPreferenceScreen()
assertThat(catalystScreen).isEqualTo(legacyScreen)
@@ -99,7 +99,7 @@ abstract class CatalystScreenTestCase {
@Suppress("UNCHECKED_CAST")
val clazz = preferenceScreenCreator.fragmentClass() as Class<PreferenceFragmentCompat>
val builder = StringBuilder()
- FragmentScenario.launch(clazz).use {
+ launchFragmentScenario(clazz).use {
it.onFragment { fragment ->
taskFinished.set(true)
fragment.preferenceScreen.toString(builder)
@@ -108,6 +108,9 @@ abstract class CatalystScreenTestCase {
return builder.toString()
}
+ protected open fun launchFragmentScenario(fragmentClass: Class<PreferenceFragmentCompat>) =
+ FragmentScenario.launch(fragmentClass)
+
private fun Preference.toString(builder: StringBuilder, indent: String = "") {
val clazz = javaClass
builder.append(indent).append(clazz).append(" {\n")
diff --git a/packages/SettingsLib/Spa/gallery/src/com/android/settingslib/spa/gallery/GallerySpaEnvironment.kt b/packages/SettingsLib/Spa/gallery/src/com/android/settingslib/spa/gallery/GallerySpaEnvironment.kt
index dfd296fe006f..8636524ed23c 100644
--- a/packages/SettingsLib/Spa/gallery/src/com/android/settingslib/spa/gallery/GallerySpaEnvironment.kt
+++ b/packages/SettingsLib/Spa/gallery/src/com/android/settingslib/spa/gallery/GallerySpaEnvironment.kt
@@ -23,6 +23,7 @@ import com.android.settingslib.spa.framework.common.SpaEnvironment
import com.android.settingslib.spa.framework.common.createSettingsPage
import com.android.settingslib.spa.gallery.button.ActionButtonPageProvider
import com.android.settingslib.spa.gallery.banner.BannerPageProvider
+import com.android.settingslib.spa.gallery.card.CardPageProvider
import com.android.settingslib.spa.gallery.chart.ChartPageProvider
import com.android.settingslib.spa.gallery.dialog.DialogMainPageProvider
import com.android.settingslib.spa.gallery.dialog.NavDialogProvider
@@ -109,6 +110,7 @@ class GallerySpaEnvironment(context: Context) : SpaEnvironment(context) {
TopIntroPreferencePageProvider,
CheckBoxPreferencePageProvider,
TwoTargetButtonPreferencePageProvider,
+ CardPageProvider,
),
rootPages = listOf(
HomePageProvider.createSettingsPage(),
diff --git a/packages/SettingsLib/Spa/gallery/src/com/android/settingslib/spa/gallery/card/CardPageProvider.kt b/packages/SettingsLib/Spa/gallery/src/com/android/settingslib/spa/gallery/card/CardPageProvider.kt
new file mode 100644
index 000000000000..5659e2f33156
--- /dev/null
+++ b/packages/SettingsLib/Spa/gallery/src/com/android/settingslib/spa/gallery/card/CardPageProvider.kt
@@ -0,0 +1,104 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.settingslib.spa.gallery.card
+
+import android.os.Bundle
+import androidx.compose.material.icons.Icons
+import androidx.compose.material.icons.filled.Stars
+import androidx.compose.runtime.Composable
+import androidx.compose.runtime.getValue
+import androidx.compose.runtime.mutableStateOf
+import androidx.compose.runtime.saveable.rememberSaveable
+import androidx.compose.runtime.setValue
+import androidx.compose.ui.tooling.preview.Preview
+import com.android.settingslib.spa.framework.common.SettingsPageProvider
+import com.android.settingslib.spa.framework.compose.navigator
+import com.android.settingslib.spa.framework.theme.SettingsTheme
+import com.android.settingslib.spa.widget.card.SuggestionCard
+import com.android.settingslib.spa.widget.card.SuggestionCardModel
+import com.android.settingslib.spa.widget.preference.Preference
+import com.android.settingslib.spa.widget.preference.PreferenceModel
+import com.android.settingslib.spa.widget.scaffold.RegularScaffold
+
+object CardPageProvider : SettingsPageProvider {
+ override val name = "Card"
+
+ override fun getTitle(arguments: Bundle?) = TITLE
+
+ @Composable
+ override fun Page(arguments: Bundle?) {
+ RegularScaffold(title = TITLE) {
+ SuggestionCard()
+ SuggestionCardWithLongTitle()
+ SuggestionCardDismissible()
+ }
+ }
+
+ @Composable
+ private fun SuggestionCard() {
+ SuggestionCard(
+ SuggestionCardModel(
+ title = "Suggestion card",
+ description = "Suggestion card description",
+ imageVector = Icons.Filled.Stars,
+ )
+ )
+ }
+
+ @Composable
+ private fun SuggestionCardWithLongTitle() {
+ SuggestionCard(
+ SuggestionCardModel(
+ title = "Top level suggestion card with a really, really long title",
+ imageVector = Icons.Filled.Stars,
+ onClick = {},
+ )
+ )
+ }
+
+ @Composable
+ private fun SuggestionCardDismissible() {
+ var isVisible by rememberSaveable { mutableStateOf(true) }
+ SuggestionCard(
+ SuggestionCardModel(
+ title = "Suggestion card",
+ description = "Suggestion card description",
+ imageVector = Icons.Filled.Stars,
+ onDismiss = { isVisible = false },
+ isVisible = isVisible,
+ )
+ )
+ }
+
+ @Composable
+ fun Entry() {
+ Preference(
+ object : PreferenceModel {
+ override val title = TITLE
+ override val onClick = navigator(name)
+ }
+ )
+ }
+
+ private const val TITLE = "Sample Card"
+}
+
+@Preview
+@Composable
+private fun CardPagePreview() {
+ SettingsTheme { CardPageProvider.Page(null) }
+}
diff --git a/packages/SettingsLib/Spa/gallery/src/com/android/settingslib/spa/gallery/home/HomePageProvider.kt b/packages/SettingsLib/Spa/gallery/src/com/android/settingslib/spa/gallery/home/HomePageProvider.kt
index 4d77ea173a85..ebfc0c536868 100644
--- a/packages/SettingsLib/Spa/gallery/src/com/android/settingslib/spa/gallery/home/HomePageProvider.kt
+++ b/packages/SettingsLib/Spa/gallery/src/com/android/settingslib/spa/gallery/home/HomePageProvider.kt
@@ -27,6 +27,7 @@ import com.android.settingslib.spa.gallery.R
import com.android.settingslib.spa.gallery.SettingsPageProviderEnum
import com.android.settingslib.spa.gallery.banner.BannerPageProvider
import com.android.settingslib.spa.gallery.button.ActionButtonPageProvider
+import com.android.settingslib.spa.gallery.card.CardPageProvider
import com.android.settingslib.spa.gallery.chart.ChartPageProvider
import com.android.settingslib.spa.gallery.dialog.DialogMainPageProvider
import com.android.settingslib.spa.gallery.editor.EditorMainPageProvider
@@ -80,6 +81,7 @@ object HomePageProvider : SettingsPageProvider {
DialogMainPageProvider.Entry()
EditorMainPageProvider.Entry()
BannerPageProvider.Entry()
+ CardPageProvider.Entry()
CopyablePageProvider.Entry()
}
}
diff --git a/packages/SettingsLib/Spa/spa/src/com/android/settingslib/spa/framework/theme/SettingsDimension.kt b/packages/SettingsLib/Spa/spa/src/com/android/settingslib/spa/framework/theme/SettingsDimension.kt
index 395748384b85..08bedf99519d 100644
--- a/packages/SettingsLib/Spa/spa/src/com/android/settingslib/spa/framework/theme/SettingsDimension.kt
+++ b/packages/SettingsLib/Spa/spa/src/com/android/settingslib/spa/framework/theme/SettingsDimension.kt
@@ -28,6 +28,7 @@ object SettingsDimension {
val paddingExtraSmall6 = 12.dp
val paddingLarge = 16.dp
val paddingExtraLarge = 24.dp
+ val paddingExtraLarge1 = 28.dp
val spinnerHorizontalPadding = paddingExtraLarge
val spinnerVerticalPadding = paddingLarge
@@ -37,6 +38,7 @@ object SettingsDimension {
val actionIconPadding = 4.dp
val itemIconSize = 24.dp
+ val itemIconContainerSizeSmall = 40.dp
val itemIconContainerSize = 72.dp
val itemPaddingStart = if (isSpaExpressiveEnabled) paddingLarge else paddingExtraLarge
val itemPaddingEnd = paddingLarge
@@ -47,6 +49,12 @@ object SettingsDimension {
end = itemPaddingEnd,
bottom = itemPaddingVertical,
)
+ val footerItemPadding = PaddingValues(
+ start = paddingExtraLarge1,
+ top = itemPaddingVertical,
+ end = itemPaddingEnd,
+ bottom = itemPaddingVertical,
+ )
val textFieldPadding = PaddingValues(
start = itemPaddingStart,
end = itemPaddingEnd,
diff --git a/packages/SettingsLib/Spa/spa/src/com/android/settingslib/spa/framework/theme/SettingsShape.kt b/packages/SettingsLib/Spa/spa/src/com/android/settingslib/spa/framework/theme/SettingsShape.kt
index 86ba6864574c..61607bc8ae8a 100644
--- a/packages/SettingsLib/Spa/spa/src/com/android/settingslib/spa/framework/theme/SettingsShape.kt
+++ b/packages/SettingsLib/Spa/spa/src/com/android/settingslib/spa/framework/theme/SettingsShape.kt
@@ -29,4 +29,6 @@ object SettingsShape {
val CornerLarge = RoundedCornerShape(24.dp)
val CornerExtraLarge = RoundedCornerShape(28.dp)
+
+ val CornerExtraLarge1 = RoundedCornerShape(40.dp)
}
diff --git a/packages/SettingsLib/Spa/spa/src/com/android/settingslib/spa/widget/card/SuggestionCard.kt b/packages/SettingsLib/Spa/spa/src/com/android/settingslib/spa/widget/card/SuggestionCard.kt
new file mode 100644
index 000000000000..2126634ebd4d
--- /dev/null
+++ b/packages/SettingsLib/Spa/spa/src/com/android/settingslib/spa/widget/card/SuggestionCard.kt
@@ -0,0 +1,166 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.settingslib.spa.widget.card
+
+import androidx.compose.animation.AnimatedVisibility
+import androidx.compose.foundation.background
+import androidx.compose.foundation.clickable
+import androidx.compose.foundation.layout.Box
+import androidx.compose.foundation.layout.Column
+import androidx.compose.foundation.layout.Row
+import androidx.compose.foundation.layout.Spacer
+import androidx.compose.foundation.layout.fillMaxWidth
+import androidx.compose.foundation.layout.heightIn
+import androidx.compose.foundation.layout.padding
+import androidx.compose.foundation.layout.size
+import androidx.compose.foundation.shape.CircleShape
+import androidx.compose.material.icons.Icons
+import androidx.compose.material.icons.filled.Close
+import androidx.compose.material.icons.filled.Stars
+import androidx.compose.material.icons.outlined.Stars
+import androidx.compose.material3.ExperimentalMaterial3ExpressiveApi
+import androidx.compose.material3.Icon
+import androidx.compose.material3.IconButton
+import androidx.compose.material3.MaterialTheme
+import androidx.compose.material3.Text
+import androidx.compose.runtime.Composable
+import androidx.compose.ui.Alignment
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.draw.clip
+import androidx.compose.ui.graphics.vector.ImageVector
+import androidx.compose.ui.res.stringResource
+import androidx.compose.ui.semantics.semantics
+import androidx.compose.ui.tooling.preview.Preview
+import com.android.settingslib.spa.framework.theme.SettingsDimension
+import com.android.settingslib.spa.framework.theme.SettingsShape
+import com.android.settingslib.spa.framework.theme.SettingsTheme
+import com.android.settingslib.spa.framework.theme.toSemiBoldWeight
+
+data class SuggestionCardModel(
+ val title: String,
+ val description: String? = null,
+ val imageVector: ImageVector,
+
+ /**
+ * A dismiss button will be displayed if this is not null.
+ *
+ * And this callback will be called when user clicks the button.
+ */
+ val onDismiss: (() -> Unit)? = null,
+ val isVisible: Boolean = true,
+ val onClick: (() -> Unit)? = null,
+)
+
+@Composable
+fun SuggestionCard(model: SuggestionCardModel) {
+ AnimatedVisibility(visible = model.isVisible) {
+ Row(
+ verticalAlignment = Alignment.CenterVertically,
+ modifier =
+ Modifier.padding(
+ horizontal = SettingsDimension.paddingLarge,
+ vertical = SettingsDimension.paddingSmall,
+ )
+ .fillMaxWidth()
+ .heightIn(min = SettingsDimension.preferenceMinHeight)
+ .clip(SettingsShape.CornerExtraLarge1)
+ .background(MaterialTheme.colorScheme.secondaryContainer)
+ .then(model.onClick?.let { Modifier.clickable(onClick = it) } ?: Modifier)
+ .padding(SettingsDimension.paddingExtraSmall6),
+ ) {
+ SuggestionCardIcon(model.imageVector)
+ Spacer(Modifier.padding(SettingsDimension.paddingSmall))
+ Column(modifier = Modifier.weight(1f).semantics(mergeDescendants = true) {}) {
+ SuggestionCardTitle(model.title)
+ if (model.description != null) SuggestionCardDescription(model.description)
+ }
+ if (model.onDismiss != null) {
+ Spacer(Modifier.padding(SettingsDimension.paddingSmall))
+ SuggestionCardDismissButton(model.onDismiss)
+ }
+ }
+ }
+}
+
+@Composable
+private fun SuggestionCardIcon(imageVector: ImageVector) {
+ Box(
+ modifier =
+ Modifier.padding(SettingsDimension.paddingSmall)
+ .size(SettingsDimension.itemIconContainerSizeSmall)
+ .clip(CircleShape)
+ .background(MaterialTheme.colorScheme.secondary),
+ contentAlignment = Alignment.Center,
+ ) {
+ Icon(
+ imageVector = imageVector,
+ contentDescription = null,
+ modifier = Modifier.size(SettingsDimension.itemIconSize),
+ tint = MaterialTheme.colorScheme.onSecondary,
+ )
+ }
+}
+
+@Composable
+private fun SuggestionCardTitle(title: String) {
+ Text(
+ text = title,
+ style = MaterialTheme.typography.titleMedium.toSemiBoldWeight(),
+ modifier = Modifier.padding(vertical = SettingsDimension.paddingTiny),
+ color = MaterialTheme.colorScheme.onSecondaryContainer,
+ )
+}
+
+@OptIn(ExperimentalMaterial3ExpressiveApi::class)
+@Composable
+private fun SuggestionCardDescription(description: String) {
+ Text(
+ text = description,
+ style = MaterialTheme.typography.bodySmallEmphasized,
+ modifier = Modifier.padding(vertical = SettingsDimension.paddingTiny),
+ color = MaterialTheme.colorScheme.onSecondaryContainer,
+ )
+}
+
+@Composable
+private fun SuggestionCardDismissButton(onDismiss: () -> Unit) {
+ IconButton(shape = CircleShape, onClick = onDismiss) {
+ Icon(
+ imageVector = Icons.Filled.Close,
+ contentDescription =
+ stringResource(androidx.compose.material3.R.string.m3c_snackbar_dismiss),
+ modifier = Modifier.size(SettingsDimension.itemIconSize),
+ tint = MaterialTheme.colorScheme.onSecondaryContainer,
+ )
+ }
+}
+
+@Preview
+@Composable
+private fun SuggestionCardPreview() {
+ SettingsTheme {
+ SuggestionCard(
+ SuggestionCardModel(
+ title = "Suggestion card",
+ description = "Suggestion card description",
+ imageVector = Icons.Outlined.Stars,
+ onDismiss = {},
+ onClick = {},
+ )
+ )
+ }
+}
diff --git a/packages/SettingsLib/Spa/spa/src/com/android/settingslib/spa/widget/ui/Category.kt b/packages/SettingsLib/Spa/spa/src/com/android/settingslib/spa/widget/ui/Category.kt
index acbdec0b30aa..66680fa547b1 100644
--- a/packages/SettingsLib/Spa/spa/src/com/android/settingslib/spa/widget/ui/Category.kt
+++ b/packages/SettingsLib/Spa/spa/src/com/android/settingslib/spa/widget/ui/Category.kt
@@ -49,7 +49,9 @@ fun CategoryTitle(title: String) {
text = title,
modifier =
Modifier.padding(
- start = SettingsDimension.itemPaddingStart,
+ start =
+ if (isSpaExpressiveEnabled) SettingsDimension.paddingSmall
+ else SettingsDimension.itemPaddingStart,
top = 20.dp,
end =
if (isSpaExpressiveEnabled) SettingsDimension.paddingSmall
@@ -67,16 +69,16 @@ fun CategoryTitle(title: String) {
*/
@Composable
fun Category(title: String? = null, content: @Composable ColumnScope.() -> Unit) {
+ var displayTitle by remember { mutableStateOf(false) }
Column(
modifier =
- if (isSpaExpressiveEnabled)
+ if (isSpaExpressiveEnabled && displayTitle)
Modifier.padding(
horizontal = SettingsDimension.paddingLarge,
vertical = SettingsDimension.paddingSmall,
)
else Modifier
) {
- var displayTitle by remember { mutableStateOf(false) }
if (title != null && displayTitle) CategoryTitle(title = title)
Column(
modifier =
diff --git a/packages/SettingsLib/Spa/spa/src/com/android/settingslib/spa/widget/ui/Spinner.kt b/packages/SettingsLib/Spa/spa/src/com/android/settingslib/spa/widget/ui/Spinner.kt
index a9d2ef6dc3f6..6e4fd78a039b 100644
--- a/packages/SettingsLib/Spa/spa/src/com/android/settingslib/spa/widget/ui/Spinner.kt
+++ b/packages/SettingsLib/Spa/spa/src/com/android/settingslib/spa/widget/ui/Spinner.kt
@@ -101,8 +101,8 @@ fun Spinner(options: List<SpinnerOption>, selectedId: Int?, setId: (id: Int) ->
Modifier.background(MaterialTheme.colorScheme.surfaceContainerLow)
.padding(horizontal = SettingsDimension.paddingSmall),
) {
- for ((index, option) in options.withIndex()) {
- val selected = index + 1 == selectedId
+ for (option in options) {
+ val selected = option.id == selectedId
DropdownMenuItem(
text = { SpinnerOptionText(option = option, selected) },
onClick = {
diff --git a/packages/SettingsLib/Spa/tests/src/com/android/settingslib/spa/widget/card/SettingsBannerTest.kt b/packages/SettingsLib/Spa/tests/src/com/android/settingslib/spa/widget/banner/SettingsBannerTest.kt
index a8479b01a861..a8479b01a861 100644
--- a/packages/SettingsLib/Spa/tests/src/com/android/settingslib/spa/widget/card/SettingsBannerTest.kt
+++ b/packages/SettingsLib/Spa/tests/src/com/android/settingslib/spa/widget/banner/SettingsBannerTest.kt
diff --git a/packages/SettingsLib/Spa/tests/src/com/android/settingslib/spa/widget/card/SettingsCollapsibleBannerTest.kt b/packages/SettingsLib/Spa/tests/src/com/android/settingslib/spa/widget/banner/SettingsCollapsibleBannerTest.kt
index 1080fdea9455..1080fdea9455 100644
--- a/packages/SettingsLib/Spa/tests/src/com/android/settingslib/spa/widget/card/SettingsCollapsibleBannerTest.kt
+++ b/packages/SettingsLib/Spa/tests/src/com/android/settingslib/spa/widget/banner/SettingsCollapsibleBannerTest.kt
diff --git a/packages/SettingsLib/Spa/tests/src/com/android/settingslib/spa/widget/card/SuggestionCardTest.kt b/packages/SettingsLib/Spa/tests/src/com/android/settingslib/spa/widget/card/SuggestionCardTest.kt
new file mode 100644
index 000000000000..96bfb3d71642
--- /dev/null
+++ b/packages/SettingsLib/Spa/tests/src/com/android/settingslib/spa/widget/card/SuggestionCardTest.kt
@@ -0,0 +1,84 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.settingslib.spa.widget.card
+
+import android.content.Context
+import androidx.compose.material.icons.Icons
+import androidx.compose.material.icons.outlined.Star
+import androidx.compose.runtime.getValue
+import androidx.compose.runtime.mutableStateOf
+import androidx.compose.runtime.saveable.rememberSaveable
+import androidx.compose.runtime.setValue
+import androidx.compose.ui.test.assertIsDisplayed
+import androidx.compose.ui.test.isNotDisplayed
+import androidx.compose.ui.test.junit4.createComposeRule
+import androidx.compose.ui.test.onNodeWithContentDescription
+import androidx.compose.ui.test.onNodeWithText
+import androidx.compose.ui.test.performClick
+import androidx.test.core.app.ApplicationProvider
+import androidx.test.ext.junit.runners.AndroidJUnit4
+import org.junit.Rule
+import org.junit.Test
+import org.junit.runner.RunWith
+
+@RunWith(AndroidJUnit4::class)
+class SuggestionCardTest {
+ @get:Rule val composeTestRule = createComposeRule()
+
+ private val context: Context = ApplicationProvider.getApplicationContext()
+
+ @Test
+ fun suggestionCard_contentDisplayed() {
+ setContent()
+
+ composeTestRule.onNodeWithText(TITLE).assertIsDisplayed()
+ composeTestRule.onNodeWithText(DESCRIPTION).assertIsDisplayed()
+ }
+
+ @Test
+ fun suggestionCard_dismiss() {
+ setContent()
+ composeTestRule
+ .onNodeWithContentDescription(
+ context.getString(androidx.compose.material3.R.string.m3c_snackbar_dismiss)
+ )
+ .performClick()
+
+ composeTestRule.onNodeWithText(TITLE).isNotDisplayed()
+ composeTestRule.onNodeWithText(DESCRIPTION).isNotDisplayed()
+ }
+
+ private fun setContent() {
+ composeTestRule.setContent {
+ var isVisible by rememberSaveable { mutableStateOf(true) }
+ SuggestionCard(
+ SuggestionCardModel(
+ title = TITLE,
+ description = DESCRIPTION,
+ imageVector = Icons.Outlined.Star,
+ isVisible = isVisible,
+ onDismiss = { isVisible = false },
+ )
+ )
+ }
+ }
+
+ private companion object {
+ const val TITLE = "Title"
+ const val DESCRIPTION = "Description"
+ }
+}
diff --git a/packages/SettingsLib/SpaPrivileged/src/com/android/settingslib/spaprivileged/template/app/AppInfo.kt b/packages/SettingsLib/SpaPrivileged/src/com/android/settingslib/spaprivileged/template/app/AppInfo.kt
index f306918ec72f..d89d3977cac3 100644
--- a/packages/SettingsLib/SpaPrivileged/src/com/android/settingslib/spaprivileged/template/app/AppInfo.kt
+++ b/packages/SettingsLib/SpaPrivileged/src/com/android/settingslib/spaprivileged/template/app/AppInfo.kt
@@ -39,6 +39,8 @@ import androidx.compose.ui.unit.Dp
import com.android.settingslib.development.DevelopmentSettingsEnabler
import com.android.settingslib.spa.framework.compose.rememberDrawablePainter
import com.android.settingslib.spa.framework.theme.SettingsDimension
+import com.android.settingslib.spa.framework.theme.isSpaExpressiveEnabled
+import com.android.settingslib.spa.widget.preference.IntroAppPreference
import com.android.settingslib.spa.widget.ui.CopyableBody
import com.android.settingslib.spa.widget.ui.SettingsBody
import com.android.settingslib.spa.widget.ui.SettingsTitle
@@ -48,23 +50,53 @@ import com.android.settingslib.spaprivileged.model.app.rememberAppRepository
class AppInfoProvider(private val packageInfo: PackageInfo) {
@Composable
fun AppInfo(displayVersion: Boolean = false, isClonedAppPage: Boolean = false) {
- Column(
- modifier = Modifier
- .fillMaxWidth()
- .padding(
- horizontal = SettingsDimension.itemPaddingStart,
- vertical = SettingsDimension.itemPaddingVertical,
- )
- .semantics(mergeDescendants = true) {},
- horizontalAlignment = Alignment.CenterHorizontally,
- ) {
+ if (isSpaExpressiveEnabled) {
+ val appRepository = rememberAppRepository()
val app = checkNotNull(packageInfo.applicationInfo)
- Box(modifier = Modifier.padding(SettingsDimension.itemPaddingAround)) {
- AppIcon(app = app, size = SettingsDimension.appIconInfoSize)
+ val title = appRepository.produceLabel(app, isClonedAppPage).value
+
+ val descriptions = mutableListOf<String>()
+ if (app.isInstantApp) {
+ descriptions.add(
+ stringResource(
+ com.android.settingslib.widget.preference.app.R.string.install_type_instant
+ )
+ )
+ }
+ if (displayVersion) {
+ val versionName = packageInfo.versionNameBidiWrapped
+ if (versionName != null) descriptions.add(versionName)
+ }
+
+ IntroAppPreference(
+ title = title,
+ descriptions = descriptions,
+ appIcon = {
+ Image(
+ painter = rememberDrawablePainter(appRepository.produceIcon(app).value),
+ contentDescription = appRepository.produceIconContentDescription(app).value,
+ )
+ },
+ )
+ } else {
+ Column(
+ modifier =
+ Modifier.fillMaxWidth()
+ .padding(
+ horizontal = SettingsDimension.itemPaddingStart,
+ vertical = SettingsDimension.itemPaddingVertical,
+ )
+ .semantics(mergeDescendants = true) {},
+ horizontalAlignment = Alignment.CenterHorizontally,
+ ) {
+ val app = checkNotNull(packageInfo.applicationInfo)
+ Box(modifier = Modifier.padding(SettingsDimension.itemPaddingAround)) {
+ AppIcon(app = app, size = SettingsDimension.appIconInfoSize)
+ }
+ AppLabel(app, isClonedAppPage)
+ InstallType(app)
+ if (displayVersion) AppVersion()
}
- AppLabel(app, isClonedAppPage)
- InstallType(app)
- if (displayVersion) AppVersion()
}
}
@@ -89,19 +121,24 @@ class AppInfoProvider(private val packageInfo: PackageInfo) {
@Composable
fun FooterAppVersion(showPackageName: Boolean = rememberIsDevelopmentSettingsEnabled()) {
val context = LocalContext.current
- val footer = remember(packageInfo, showPackageName) {
- val list = mutableListOf<String>()
- packageInfo.versionNameBidiWrapped?.let {
- list += context.getString(R.string.version_text, it)
+ val footer =
+ remember(packageInfo, showPackageName) {
+ val list = mutableListOf<String>()
+ packageInfo.versionNameBidiWrapped?.let {
+ list += context.getString(R.string.version_text, it)
+ }
+ if (showPackageName) {
+ list += packageInfo.packageName
+ }
+ list.joinToString(separator = System.lineSeparator())
}
- if (showPackageName) {
- list += packageInfo.packageName
- }
- list.joinToString(separator = System.lineSeparator())
- }
if (footer.isBlank()) return
HorizontalDivider()
- Column(modifier = Modifier.padding(SettingsDimension.itemPadding)) {
+ Column(
+ modifier =
+ if (isSpaExpressiveEnabled) Modifier.padding(SettingsDimension.footerItemPadding)
+ else Modifier.padding(SettingsDimension.itemPadding)
+ ) {
CopyableBody(footer)
}
}
@@ -109,9 +146,7 @@ class AppInfoProvider(private val packageInfo: PackageInfo) {
@Composable
private fun rememberIsDevelopmentSettingsEnabled(): Boolean {
val context = LocalContext.current
- return remember {
- DevelopmentSettingsEnabler.isDevelopmentSettingsEnabled(context)
- }
+ return remember { DevelopmentSettingsEnabler.isDevelopmentSettingsEnabled(context) }
}
private companion object {
diff --git a/packages/SettingsLib/res/values-af/strings.xml b/packages/SettingsLib/res/values-af/strings.xml
index 6ee3bd16148e..2f158c88305a 100644
--- a/packages/SettingsLib/res/values-af/strings.xml
+++ b/packages/SettingsLib/res/values-af/strings.xml
@@ -686,9 +686,11 @@
<string name="cached_apps_freezer_enabled" msgid="8866703500183051546">"Geaktiveer"</string>
<string name="cached_apps_freezer_reboot_dialog_text" msgid="695330563489230096">"Jou toestel moet herselflaai om hierdie verandering toe te pas. Herselflaai nou of kanselleer."</string>
<string name="media_transfer_wired_headphone_name" msgid="8698668536022665254">"Bedrade oorfoon"</string>
- <string name="media_transfer_headphone_name" msgid="1131962659136578852">"Oorfoon"</string>
+ <!-- no translation found for media_transfer_headphone_name (1157798825650178478) -->
+ <skip />
<string name="media_transfer_usb_audio_name" msgid="1789292056757821355">"USB-oudio"</string>
- <string name="media_transfer_wired_device_mic_name" msgid="7417067197803840965">"Mikrofoonsok"</string>
+ <!-- no translation found for media_transfer_wired_device_mic_name (7115192790725088698) -->
+ <skip />
<string name="media_transfer_usb_device_mic_name" msgid="7171789543226269822">"USB-mikrofoon"</string>
<string name="media_transfer_bt_device_mic_name" msgid="1870669402238687618">"BT-mikrofoon"</string>
<string name="wifi_hotspot_switch_on_text" msgid="9212273118217786155">"Aan"</string>
diff --git a/packages/SettingsLib/res/values-am/strings.xml b/packages/SettingsLib/res/values-am/strings.xml
index 40c428895c68..1040f377c6cd 100644
--- a/packages/SettingsLib/res/values-am/strings.xml
+++ b/packages/SettingsLib/res/values-am/strings.xml
@@ -686,9 +686,11 @@
<string name="cached_apps_freezer_enabled" msgid="8866703500183051546">"ነቅቷል"</string>
<string name="cached_apps_freezer_reboot_dialog_text" msgid="695330563489230096">"የእርስዎን መሣሪያ ይህ ለው ለማመልከት እንደገና መነሣት አለበት። አሁን እንደገና ያስነሡ ወይም ይተዉት።"</string>
<string name="media_transfer_wired_headphone_name" msgid="8698668536022665254">"ባለገመድ የራስ ላይ ማዳመጫ"</string>
- <string name="media_transfer_headphone_name" msgid="1131962659136578852">"የጆሮ ማዳመጫ"</string>
+ <!-- no translation found for media_transfer_headphone_name (1157798825650178478) -->
+ <skip />
<string name="media_transfer_usb_audio_name" msgid="1789292056757821355">"USB ኦዲዮ"</string>
- <string name="media_transfer_wired_device_mic_name" msgid="7417067197803840965">"የማይክሮፎን መሰኪያ"</string>
+ <!-- no translation found for media_transfer_wired_device_mic_name (7115192790725088698) -->
+ <skip />
<string name="media_transfer_usb_device_mic_name" msgid="7171789543226269822">"USB ማይክሮፎን"</string>
<string name="media_transfer_bt_device_mic_name" msgid="1870669402238687618">"ብሉቱዝ ማይክሮፎን"</string>
<string name="wifi_hotspot_switch_on_text" msgid="9212273118217786155">"አብራ"</string>
diff --git a/packages/SettingsLib/res/values-ar/strings.xml b/packages/SettingsLib/res/values-ar/strings.xml
index b54b52198c3a..9e1db5fbf36d 100644
--- a/packages/SettingsLib/res/values-ar/strings.xml
+++ b/packages/SettingsLib/res/values-ar/strings.xml
@@ -686,9 +686,11 @@
<string name="cached_apps_freezer_enabled" msgid="8866703500183051546">"مفعّل"</string>
<string name="cached_apps_freezer_reboot_dialog_text" msgid="695330563489230096">"يجب إعادة تشغيل جهازك ليتم تطبيق هذا التغيير. يمكنك إعادة التشغيل الآن أو إلغاء التغيير."</string>
<string name="media_transfer_wired_headphone_name" msgid="8698668536022665254">"سماعات رأس سلكية"</string>
- <string name="media_transfer_headphone_name" msgid="1131962659136578852">"سماعات رأس"</string>
+ <!-- no translation found for media_transfer_headphone_name (1157798825650178478) -->
+ <skip />
<string name="media_transfer_usb_audio_name" msgid="1789292056757821355">"‏مكبر صوت USB"</string>
- <string name="media_transfer_wired_device_mic_name" msgid="7417067197803840965">"مقبس الميكروفون"</string>
+ <!-- no translation found for media_transfer_wired_device_mic_name (7115192790725088698) -->
+ <skip />
<string name="media_transfer_usb_device_mic_name" msgid="7171789543226269822">"‏ميكروفون USB"</string>
<string name="media_transfer_bt_device_mic_name" msgid="1870669402238687618">"ميكروفون يعمل بالبلوتوث"</string>
<string name="wifi_hotspot_switch_on_text" msgid="9212273118217786155">"مفعّلة"</string>
diff --git a/packages/SettingsLib/res/values-as/strings.xml b/packages/SettingsLib/res/values-as/strings.xml
index a72c5f61d28e..76a39368f7fd 100644
--- a/packages/SettingsLib/res/values-as/strings.xml
+++ b/packages/SettingsLib/res/values-as/strings.xml
@@ -686,9 +686,11 @@
<string name="cached_apps_freezer_enabled" msgid="8866703500183051546">"সক্ষম কৰা আছে"</string>
<string name="cached_apps_freezer_reboot_dialog_text" msgid="695330563489230096">"এই সলনিটো কার্যকৰী হ’বলৈ আপোনাৰ ডিভাইচটো ৰিবুট কৰিবই লাগিব। এতিয়াই ৰিবুট কৰক অথবা বাতিল কৰক।"</string>
<string name="media_transfer_wired_headphone_name" msgid="8698668536022665254">"তাঁৰযুক্ত হেডফ’ন"</string>
- <string name="media_transfer_headphone_name" msgid="1131962659136578852">"হেডফ’ন"</string>
+ <!-- no translation found for media_transfer_headphone_name (1157798825650178478) -->
+ <skip />
<string name="media_transfer_usb_audio_name" msgid="1789292056757821355">"ইউএছবি অডিঅ\'"</string>
- <string name="media_transfer_wired_device_mic_name" msgid="7417067197803840965">"মাইকৰ জেক"</string>
+ <!-- no translation found for media_transfer_wired_device_mic_name (7115192790725088698) -->
+ <skip />
<string name="media_transfer_usb_device_mic_name" msgid="7171789543226269822">"ইউএছবি মাইক্ৰ’ফ’ন"</string>
<string name="media_transfer_bt_device_mic_name" msgid="1870669402238687618">"ব্লুটুথ মাইক্ৰ’ফ’ন"</string>
<string name="wifi_hotspot_switch_on_text" msgid="9212273118217786155">"অন"</string>
diff --git a/packages/SettingsLib/res/values-az/strings.xml b/packages/SettingsLib/res/values-az/strings.xml
index 4cb9ef8ce0ed..2d9e1d9fb726 100644
--- a/packages/SettingsLib/res/values-az/strings.xml
+++ b/packages/SettingsLib/res/values-az/strings.xml
@@ -686,9 +686,11 @@
<string name="cached_apps_freezer_enabled" msgid="8866703500183051546">"Aktiv"</string>
<string name="cached_apps_freezer_reboot_dialog_text" msgid="695330563489230096">"Bu dəyişikliyin tətbiq edilməsi üçün cihaz yenidən başladılmalıdır. İndi yenidən başladın və ya ləğv edin."</string>
<string name="media_transfer_wired_headphone_name" msgid="8698668536022665254">"Naqilli qulaqlıq"</string>
- <string name="media_transfer_headphone_name" msgid="1131962659136578852">"Qulaqlıq"</string>
+ <!-- no translation found for media_transfer_headphone_name (1157798825650178478) -->
+ <skip />
<string name="media_transfer_usb_audio_name" msgid="1789292056757821355">"USB audio"</string>
- <string name="media_transfer_wired_device_mic_name" msgid="7417067197803840965">"Mikrofon yuvası"</string>
+ <!-- no translation found for media_transfer_wired_device_mic_name (7115192790725088698) -->
+ <skip />
<string name="media_transfer_usb_device_mic_name" msgid="7171789543226269822">"USB mikrofon"</string>
<string name="media_transfer_bt_device_mic_name" msgid="1870669402238687618">"Bluetooth mikrofonu"</string>
<string name="wifi_hotspot_switch_on_text" msgid="9212273118217786155">"Aktiv"</string>
diff --git a/packages/SettingsLib/res/values-b+sr+Latn/strings.xml b/packages/SettingsLib/res/values-b+sr+Latn/strings.xml
index 43281924b93c..01f0ff26eddc 100644
--- a/packages/SettingsLib/res/values-b+sr+Latn/strings.xml
+++ b/packages/SettingsLib/res/values-b+sr+Latn/strings.xml
@@ -686,9 +686,11 @@
<string name="cached_apps_freezer_enabled" msgid="8866703500183051546">"Omogućeno"</string>
<string name="cached_apps_freezer_reboot_dialog_text" msgid="695330563489230096">"Morate da restartujete uređaj da bi se ova promena primenila. Restartujte ga odmah ili otkažite."</string>
<string name="media_transfer_wired_headphone_name" msgid="8698668536022665254">"Žičane slušalice"</string>
- <string name="media_transfer_headphone_name" msgid="1131962659136578852">"Slušalice"</string>
+ <!-- no translation found for media_transfer_headphone_name (1157798825650178478) -->
+ <skip />
<string name="media_transfer_usb_audio_name" msgid="1789292056757821355">"USB audio"</string>
- <string name="media_transfer_wired_device_mic_name" msgid="7417067197803840965">"Utikač za mikrofon"</string>
+ <!-- no translation found for media_transfer_wired_device_mic_name (7115192790725088698) -->
+ <skip />
<string name="media_transfer_usb_device_mic_name" msgid="7171789543226269822">"USB mikrofon"</string>
<string name="media_transfer_bt_device_mic_name" msgid="1870669402238687618">"Bluetooth mikrofon"</string>
<string name="wifi_hotspot_switch_on_text" msgid="9212273118217786155">"Uključeno"</string>
diff --git a/packages/SettingsLib/res/values-be/strings.xml b/packages/SettingsLib/res/values-be/strings.xml
index 40be0a0f0392..f710b1d76028 100644
--- a/packages/SettingsLib/res/values-be/strings.xml
+++ b/packages/SettingsLib/res/values-be/strings.xml
@@ -686,9 +686,11 @@
<string name="cached_apps_freezer_enabled" msgid="8866703500183051546">"Уключана"</string>
<string name="cached_apps_freezer_reboot_dialog_text" msgid="695330563489230096">"Перазагрузіце прыладу, каб прымяніць гэта змяненне. Перазагрузіце ці скасуйце."</string>
<string name="media_transfer_wired_headphone_name" msgid="8698668536022665254">"Правадныя навушнікі"</string>
- <string name="media_transfer_headphone_name" msgid="1131962659136578852">"Навушнікі"</string>
+ <!-- no translation found for media_transfer_headphone_name (1157798825650178478) -->
+ <skip />
<string name="media_transfer_usb_audio_name" msgid="1789292056757821355">"Аўдыяпрылада USB"</string>
- <string name="media_transfer_wired_device_mic_name" msgid="7417067197803840965">"Раздым для мікрафона"</string>
+ <!-- no translation found for media_transfer_wired_device_mic_name (7115192790725088698) -->
+ <skip />
<string name="media_transfer_usb_device_mic_name" msgid="7171789543226269822">"Мікрафон USB"</string>
<string name="media_transfer_bt_device_mic_name" msgid="1870669402238687618">"Мікрафон з Bluetooth"</string>
<string name="wifi_hotspot_switch_on_text" msgid="9212273118217786155">"Уключана"</string>
diff --git a/packages/SettingsLib/res/values-bg/strings.xml b/packages/SettingsLib/res/values-bg/strings.xml
index f43758d5b5f5..c5c4c914a919 100644
--- a/packages/SettingsLib/res/values-bg/strings.xml
+++ b/packages/SettingsLib/res/values-bg/strings.xml
@@ -686,9 +686,11 @@
<string name="cached_apps_freezer_enabled" msgid="8866703500183051546">"Активирано"</string>
<string name="cached_apps_freezer_reboot_dialog_text" msgid="695330563489230096">"За да бъде приложена тази промяна, устройството ви трябва да бъде рестартирано. Рестартирайте сега или анулирайте."</string>
<string name="media_transfer_wired_headphone_name" msgid="8698668536022665254">"Слушалки с кабел"</string>
- <string name="media_transfer_headphone_name" msgid="1131962659136578852">"Слушалки"</string>
+ <!-- no translation found for media_transfer_headphone_name (1157798825650178478) -->
+ <skip />
<string name="media_transfer_usb_audio_name" msgid="1789292056757821355">"Аудиоустройство с USB"</string>
- <string name="media_transfer_wired_device_mic_name" msgid="7417067197803840965">"Жак за микрофон"</string>
+ <!-- no translation found for media_transfer_wired_device_mic_name (7115192790725088698) -->
+ <skip />
<string name="media_transfer_usb_device_mic_name" msgid="7171789543226269822">"Микрофон с USB"</string>
<string name="media_transfer_bt_device_mic_name" msgid="1870669402238687618">"Микрофон с Bluetooth"</string>
<string name="wifi_hotspot_switch_on_text" msgid="9212273118217786155">"Включване"</string>
diff --git a/packages/SettingsLib/res/values-bn/strings.xml b/packages/SettingsLib/res/values-bn/strings.xml
index acc8a2db415c..be6b9be9887c 100644
--- a/packages/SettingsLib/res/values-bn/strings.xml
+++ b/packages/SettingsLib/res/values-bn/strings.xml
@@ -686,9 +686,11 @@
<string name="cached_apps_freezer_enabled" msgid="8866703500183051546">"চালু করা আছে"</string>
<string name="cached_apps_freezer_reboot_dialog_text" msgid="695330563489230096">"এই পরিবর্তনটি প্রয়োগ করার জন্য আপনার ডিভাইসটি অবশ্যই রিবুট করতে হবে। এখনই রিবুট করুন বা বাতিল করুন।"</string>
<string name="media_transfer_wired_headphone_name" msgid="8698668536022665254">"তারযুক্ত হেডফোন"</string>
- <string name="media_transfer_headphone_name" msgid="1131962659136578852">"হেডফোন"</string>
+ <!-- no translation found for media_transfer_headphone_name (1157798825650178478) -->
+ <skip />
<string name="media_transfer_usb_audio_name" msgid="1789292056757821355">"USB অডিও"</string>
- <string name="media_transfer_wired_device_mic_name" msgid="7417067197803840965">"মাইকের জ্যাক"</string>
+ <!-- no translation found for media_transfer_wired_device_mic_name (7115192790725088698) -->
+ <skip />
<string name="media_transfer_usb_device_mic_name" msgid="7171789543226269822">"USB মাইক্রোফোন"</string>
<string name="media_transfer_bt_device_mic_name" msgid="1870669402238687618">"BT মাইক্রোফোন"</string>
<string name="wifi_hotspot_switch_on_text" msgid="9212273118217786155">"চালু আছে"</string>
diff --git a/packages/SettingsLib/res/values-bs/strings.xml b/packages/SettingsLib/res/values-bs/strings.xml
index 99c0c9ecb02a..f34343050579 100644
--- a/packages/SettingsLib/res/values-bs/strings.xml
+++ b/packages/SettingsLib/res/values-bs/strings.xml
@@ -686,9 +686,11 @@
<string name="cached_apps_freezer_enabled" msgid="8866703500183051546">"Omogućeno"</string>
<string name="cached_apps_freezer_reboot_dialog_text" msgid="695330563489230096">"Morate ponovo pokrenuti uređaj da se ova promjena primijeni. Ponovo pokrenite odmah ili otkažite."</string>
<string name="media_transfer_wired_headphone_name" msgid="8698668536022665254">"Žičane slušalice"</string>
- <string name="media_transfer_headphone_name" msgid="1131962659136578852">"Slušalice"</string>
+ <!-- no translation found for media_transfer_headphone_name (1157798825650178478) -->
+ <skip />
<string name="media_transfer_usb_audio_name" msgid="1789292056757821355">"USB audio"</string>
- <string name="media_transfer_wired_device_mic_name" msgid="7417067197803840965">"Priključak za mikrofon"</string>
+ <!-- no translation found for media_transfer_wired_device_mic_name (7115192790725088698) -->
+ <skip />
<string name="media_transfer_usb_device_mic_name" msgid="7171789543226269822">"USB mikrofon"</string>
<string name="media_transfer_bt_device_mic_name" msgid="1870669402238687618">"BT mikrofon"</string>
<string name="wifi_hotspot_switch_on_text" msgid="9212273118217786155">"Uključi"</string>
diff --git a/packages/SettingsLib/res/values-ca/strings.xml b/packages/SettingsLib/res/values-ca/strings.xml
index c9a14117b44e..3557b10c764b 100644
--- a/packages/SettingsLib/res/values-ca/strings.xml
+++ b/packages/SettingsLib/res/values-ca/strings.xml
@@ -686,9 +686,11 @@
<string name="cached_apps_freezer_enabled" msgid="8866703500183051546">"Activat"</string>
<string name="cached_apps_freezer_reboot_dialog_text" msgid="695330563489230096">"Has de reiniciar el teu dispositiu perquè s\'apliquin els canvis. Reinicia\'l ara o cancel·la."</string>
<string name="media_transfer_wired_headphone_name" msgid="8698668536022665254">"Auriculars amb cable"</string>
- <string name="media_transfer_headphone_name" msgid="1131962659136578852">"Auriculars"</string>
+ <!-- no translation found for media_transfer_headphone_name (1157798825650178478) -->
+ <skip />
<string name="media_transfer_usb_audio_name" msgid="1789292056757821355">"Àudio USB"</string>
- <string name="media_transfer_wired_device_mic_name" msgid="7417067197803840965">"Connector per al micròfon"</string>
+ <!-- no translation found for media_transfer_wired_device_mic_name (7115192790725088698) -->
+ <skip />
<string name="media_transfer_usb_device_mic_name" msgid="7171789543226269822">"Micròfon USB"</string>
<string name="media_transfer_bt_device_mic_name" msgid="1870669402238687618">"Micròfon Bluetooth"</string>
<string name="wifi_hotspot_switch_on_text" msgid="9212273118217786155">"Activa"</string>
diff --git a/packages/SettingsLib/res/values-cs/strings.xml b/packages/SettingsLib/res/values-cs/strings.xml
index ee5fd5ce8059..ae47c4677da1 100644
--- a/packages/SettingsLib/res/values-cs/strings.xml
+++ b/packages/SettingsLib/res/values-cs/strings.xml
@@ -686,9 +686,11 @@
<string name="cached_apps_freezer_enabled" msgid="8866703500183051546">"Zapnuto"</string>
<string name="cached_apps_freezer_reboot_dialog_text" msgid="695330563489230096">"Aby se tato změna projevila, je třeba zařízení restartovat. Restartujte zařízení nebo zrušte akci."</string>
<string name="media_transfer_wired_headphone_name" msgid="8698668536022665254">"Kabelová sluchátka"</string>
- <string name="media_transfer_headphone_name" msgid="1131962659136578852">"Sluchátka"</string>
+ <!-- no translation found for media_transfer_headphone_name (1157798825650178478) -->
+ <skip />
<string name="media_transfer_usb_audio_name" msgid="1789292056757821355">"Zvuk USB"</string>
- <string name="media_transfer_wired_device_mic_name" msgid="7417067197803840965">"Konektor mikrofonu"</string>
+ <!-- no translation found for media_transfer_wired_device_mic_name (7115192790725088698) -->
+ <skip />
<string name="media_transfer_usb_device_mic_name" msgid="7171789543226269822">"Mikrofon USB"</string>
<string name="media_transfer_bt_device_mic_name" msgid="1870669402238687618">"Mikrofon Bluetooth"</string>
<string name="wifi_hotspot_switch_on_text" msgid="9212273118217786155">"Zapnout"</string>
diff --git a/packages/SettingsLib/res/values-da/strings.xml b/packages/SettingsLib/res/values-da/strings.xml
index a7308f1c09c0..82d702124a5a 100644
--- a/packages/SettingsLib/res/values-da/strings.xml
+++ b/packages/SettingsLib/res/values-da/strings.xml
@@ -686,9 +686,11 @@
<string name="cached_apps_freezer_enabled" msgid="8866703500183051546">"Aktiveret"</string>
<string name="cached_apps_freezer_reboot_dialog_text" msgid="695330563489230096">"Din enhed skal genstartes for at anvende denne ændring. Genstart nu, eller annuller."</string>
<string name="media_transfer_wired_headphone_name" msgid="8698668536022665254">"Høretelefoner med ledning"</string>
- <string name="media_transfer_headphone_name" msgid="1131962659136578852">"Høretelefoner"</string>
+ <!-- no translation found for media_transfer_headphone_name (1157798825650178478) -->
+ <skip />
<string name="media_transfer_usb_audio_name" msgid="1789292056757821355">"USB-lydenhed"</string>
- <string name="media_transfer_wired_device_mic_name" msgid="7417067197803840965">"Stik til mikrofon"</string>
+ <!-- no translation found for media_transfer_wired_device_mic_name (7115192790725088698) -->
+ <skip />
<string name="media_transfer_usb_device_mic_name" msgid="7171789543226269822">"USB-mikrofon"</string>
<string name="media_transfer_bt_device_mic_name" msgid="1870669402238687618">"BT-mikrofon"</string>
<string name="wifi_hotspot_switch_on_text" msgid="9212273118217786155">"Til"</string>
diff --git a/packages/SettingsLib/res/values-de/strings.xml b/packages/SettingsLib/res/values-de/strings.xml
index 972bb1fea866..00ae7e48fd72 100644
--- a/packages/SettingsLib/res/values-de/strings.xml
+++ b/packages/SettingsLib/res/values-de/strings.xml
@@ -686,12 +686,13 @@
<string name="cached_apps_freezer_enabled" msgid="8866703500183051546">"Aktiviert"</string>
<string name="cached_apps_freezer_reboot_dialog_text" msgid="695330563489230096">"Damit diese Änderung übernommen wird, musst du dein Gerät neu starten. Du kannst es jetzt neu starten oder den Vorgang abbrechen."</string>
<string name="media_transfer_wired_headphone_name" msgid="8698668536022665254">"Kabelgebundene Kopfhörer"</string>
- <string name="media_transfer_headphone_name" msgid="1131962659136578852">"Kopfhörer"</string>
+ <!-- no translation found for media_transfer_headphone_name (1157798825650178478) -->
+ <skip />
<string name="media_transfer_usb_audio_name" msgid="1789292056757821355">"USB-Audio"</string>
- <string name="media_transfer_wired_device_mic_name" msgid="7417067197803840965">"Mikrofonanschluss"</string>
- <string name="media_transfer_usb_device_mic_name" msgid="7171789543226269822">"USB-Mikrofon"</string>
- <!-- no translation found for media_transfer_bt_device_mic_name (1870669402238687618) -->
+ <!-- no translation found for media_transfer_wired_device_mic_name (7115192790725088698) -->
<skip />
+ <string name="media_transfer_usb_device_mic_name" msgid="7171789543226269822">"USB-Mikrofon"</string>
+ <string name="media_transfer_bt_device_mic_name" msgid="1870669402238687618">"Bluetooth-Mikrofon"</string>
<string name="wifi_hotspot_switch_on_text" msgid="9212273118217786155">"An"</string>
<string name="wifi_hotspot_switch_off_text" msgid="7245567251496959764">"Aus"</string>
<string name="carrier_network_change_mode" msgid="4257621815706644026">"Mobilfunknetzwerk wird gewechselt"</string>
diff --git a/packages/SettingsLib/res/values-el/strings.xml b/packages/SettingsLib/res/values-el/strings.xml
index 2d0f37b41efb..7dbe27485491 100644
--- a/packages/SettingsLib/res/values-el/strings.xml
+++ b/packages/SettingsLib/res/values-el/strings.xml
@@ -686,9 +686,11 @@
<string name="cached_apps_freezer_enabled" msgid="8866703500183051546">"Ενεργή"</string>
<string name="cached_apps_freezer_reboot_dialog_text" msgid="695330563489230096">"Για να εφαρμοστεί αυτή η αλλαγή, θα πρέπει να επανεκκινήσετε τη συσκευή σας. Επανεκκίνηση τώρα ή ακύρωση."</string>
<string name="media_transfer_wired_headphone_name" msgid="8698668536022665254">"Ενσύρματα ακουστικά"</string>
- <string name="media_transfer_headphone_name" msgid="1131962659136578852">"Ακουστικά"</string>
+ <!-- no translation found for media_transfer_headphone_name (1157798825650178478) -->
+ <skip />
<string name="media_transfer_usb_audio_name" msgid="1789292056757821355">"Ήχος USB"</string>
- <string name="media_transfer_wired_device_mic_name" msgid="7417067197803840965">"Υποδοχή μικροφώνου"</string>
+ <!-- no translation found for media_transfer_wired_device_mic_name (7115192790725088698) -->
+ <skip />
<string name="media_transfer_usb_device_mic_name" msgid="7171789543226269822">"Μικρόφωνο USB"</string>
<string name="media_transfer_bt_device_mic_name" msgid="1870669402238687618">"Μικρόφωνο BT"</string>
<string name="wifi_hotspot_switch_on_text" msgid="9212273118217786155">"Ενεργό"</string>
diff --git a/packages/SettingsLib/res/values-en-rAU/strings.xml b/packages/SettingsLib/res/values-en-rAU/strings.xml
index 96c844d95438..f29a02bc21e4 100644
--- a/packages/SettingsLib/res/values-en-rAU/strings.xml
+++ b/packages/SettingsLib/res/values-en-rAU/strings.xml
@@ -686,9 +686,11 @@
<string name="cached_apps_freezer_enabled" msgid="8866703500183051546">"Enabled"</string>
<string name="cached_apps_freezer_reboot_dialog_text" msgid="695330563489230096">"Your device must be rebooted for this change to apply. Reboot now or cancel."</string>
<string name="media_transfer_wired_headphone_name" msgid="8698668536022665254">"Wired headphones"</string>
- <string name="media_transfer_headphone_name" msgid="1131962659136578852">"Headphone"</string>
+ <!-- no translation found for media_transfer_headphone_name (1157798825650178478) -->
+ <skip />
<string name="media_transfer_usb_audio_name" msgid="1789292056757821355">"USB audio"</string>
- <string name="media_transfer_wired_device_mic_name" msgid="7417067197803840965">"Mic jack"</string>
+ <!-- no translation found for media_transfer_wired_device_mic_name (7115192790725088698) -->
+ <skip />
<string name="media_transfer_usb_device_mic_name" msgid="7171789543226269822">"USB microphone"</string>
<string name="media_transfer_bt_device_mic_name" msgid="1870669402238687618">"BT microphone"</string>
<string name="wifi_hotspot_switch_on_text" msgid="9212273118217786155">"On"</string>
diff --git a/packages/SettingsLib/res/values-en-rCA/strings.xml b/packages/SettingsLib/res/values-en-rCA/strings.xml
index c07bd342e25b..81489fe4cd65 100644
--- a/packages/SettingsLib/res/values-en-rCA/strings.xml
+++ b/packages/SettingsLib/res/values-en-rCA/strings.xml
@@ -686,9 +686,9 @@
<string name="cached_apps_freezer_enabled" msgid="8866703500183051546">"Enabled"</string>
<string name="cached_apps_freezer_reboot_dialog_text" msgid="695330563489230096">"Your device must be rebooted for this change to apply. Reboot now or cancel."</string>
<string name="media_transfer_wired_headphone_name" msgid="8698668536022665254">"Wired headphone"</string>
- <string name="media_transfer_headphone_name" msgid="1131962659136578852">"Headphone"</string>
+ <string name="media_transfer_headphone_name" msgid="1157798825650178478">"Wired audio"</string>
<string name="media_transfer_usb_audio_name" msgid="1789292056757821355">"USB audio"</string>
- <string name="media_transfer_wired_device_mic_name" msgid="7417067197803840965">"Mic jack"</string>
+ <string name="media_transfer_wired_device_mic_name" msgid="7115192790725088698">"Wired microphone"</string>
<string name="media_transfer_usb_device_mic_name" msgid="7171789543226269822">"USB microphone"</string>
<string name="media_transfer_bt_device_mic_name" msgid="1870669402238687618">"BT microphone"</string>
<string name="wifi_hotspot_switch_on_text" msgid="9212273118217786155">"On"</string>
diff --git a/packages/SettingsLib/res/values-en-rGB/strings.xml b/packages/SettingsLib/res/values-en-rGB/strings.xml
index 96c844d95438..f29a02bc21e4 100644
--- a/packages/SettingsLib/res/values-en-rGB/strings.xml
+++ b/packages/SettingsLib/res/values-en-rGB/strings.xml
@@ -686,9 +686,11 @@
<string name="cached_apps_freezer_enabled" msgid="8866703500183051546">"Enabled"</string>
<string name="cached_apps_freezer_reboot_dialog_text" msgid="695330563489230096">"Your device must be rebooted for this change to apply. Reboot now or cancel."</string>
<string name="media_transfer_wired_headphone_name" msgid="8698668536022665254">"Wired headphones"</string>
- <string name="media_transfer_headphone_name" msgid="1131962659136578852">"Headphone"</string>
+ <!-- no translation found for media_transfer_headphone_name (1157798825650178478) -->
+ <skip />
<string name="media_transfer_usb_audio_name" msgid="1789292056757821355">"USB audio"</string>
- <string name="media_transfer_wired_device_mic_name" msgid="7417067197803840965">"Mic jack"</string>
+ <!-- no translation found for media_transfer_wired_device_mic_name (7115192790725088698) -->
+ <skip />
<string name="media_transfer_usb_device_mic_name" msgid="7171789543226269822">"USB microphone"</string>
<string name="media_transfer_bt_device_mic_name" msgid="1870669402238687618">"BT microphone"</string>
<string name="wifi_hotspot_switch_on_text" msgid="9212273118217786155">"On"</string>
diff --git a/packages/SettingsLib/res/values-en-rIN/strings.xml b/packages/SettingsLib/res/values-en-rIN/strings.xml
index 96c844d95438..f29a02bc21e4 100644
--- a/packages/SettingsLib/res/values-en-rIN/strings.xml
+++ b/packages/SettingsLib/res/values-en-rIN/strings.xml
@@ -686,9 +686,11 @@
<string name="cached_apps_freezer_enabled" msgid="8866703500183051546">"Enabled"</string>
<string name="cached_apps_freezer_reboot_dialog_text" msgid="695330563489230096">"Your device must be rebooted for this change to apply. Reboot now or cancel."</string>
<string name="media_transfer_wired_headphone_name" msgid="8698668536022665254">"Wired headphones"</string>
- <string name="media_transfer_headphone_name" msgid="1131962659136578852">"Headphone"</string>
+ <!-- no translation found for media_transfer_headphone_name (1157798825650178478) -->
+ <skip />
<string name="media_transfer_usb_audio_name" msgid="1789292056757821355">"USB audio"</string>
- <string name="media_transfer_wired_device_mic_name" msgid="7417067197803840965">"Mic jack"</string>
+ <!-- no translation found for media_transfer_wired_device_mic_name (7115192790725088698) -->
+ <skip />
<string name="media_transfer_usb_device_mic_name" msgid="7171789543226269822">"USB microphone"</string>
<string name="media_transfer_bt_device_mic_name" msgid="1870669402238687618">"BT microphone"</string>
<string name="wifi_hotspot_switch_on_text" msgid="9212273118217786155">"On"</string>
diff --git a/packages/SettingsLib/res/values-es-rUS/strings.xml b/packages/SettingsLib/res/values-es-rUS/strings.xml
index ec88743d32d9..07b8d88a95d5 100644
--- a/packages/SettingsLib/res/values-es-rUS/strings.xml
+++ b/packages/SettingsLib/res/values-es-rUS/strings.xml
@@ -686,9 +686,11 @@
<string name="cached_apps_freezer_enabled" msgid="8866703500183051546">"Habilitado"</string>
<string name="cached_apps_freezer_reboot_dialog_text" msgid="695330563489230096">"Debes reiniciar el dispositivo para que se aplique el cambio. Reinícialo ahora o cancela la acción."</string>
<string name="media_transfer_wired_headphone_name" msgid="8698668536022665254">"Auriculares con cable"</string>
- <string name="media_transfer_headphone_name" msgid="1131962659136578852">"Auriculares"</string>
+ <!-- no translation found for media_transfer_headphone_name (1157798825650178478) -->
+ <skip />
<string name="media_transfer_usb_audio_name" msgid="1789292056757821355">"Audio USB"</string>
- <string name="media_transfer_wired_device_mic_name" msgid="7417067197803840965">"Conector para micrófono"</string>
+ <!-- no translation found for media_transfer_wired_device_mic_name (7115192790725088698) -->
+ <skip />
<string name="media_transfer_usb_device_mic_name" msgid="7171789543226269822">"Micrófono USB"</string>
<string name="media_transfer_bt_device_mic_name" msgid="1870669402238687618">"Micrófono Bluetooth"</string>
<string name="wifi_hotspot_switch_on_text" msgid="9212273118217786155">"Activar"</string>
diff --git a/packages/SettingsLib/res/values-es/strings.xml b/packages/SettingsLib/res/values-es/strings.xml
index 6215e7729f7a..56355b1059ce 100644
--- a/packages/SettingsLib/res/values-es/strings.xml
+++ b/packages/SettingsLib/res/values-es/strings.xml
@@ -686,12 +686,13 @@
<string name="cached_apps_freezer_enabled" msgid="8866703500183051546">"Habilitado"</string>
<string name="cached_apps_freezer_reboot_dialog_text" msgid="695330563489230096">"Es necesario reiniciar tu dispositivo para que se apliquen los cambios. Reinicia ahora o cancela la acción."</string>
<string name="media_transfer_wired_headphone_name" msgid="8698668536022665254">"Auriculares con cable"</string>
- <string name="media_transfer_headphone_name" msgid="1131962659136578852">"Auriculares"</string>
+ <!-- no translation found for media_transfer_headphone_name (1157798825650178478) -->
+ <skip />
<string name="media_transfer_usb_audio_name" msgid="1789292056757821355">"Audio USB"</string>
- <string name="media_transfer_wired_device_mic_name" msgid="7417067197803840965">"Conector jack para micrófono"</string>
- <string name="media_transfer_usb_device_mic_name" msgid="7171789543226269822">"Micrófono USB"</string>
- <!-- no translation found for media_transfer_bt_device_mic_name (1870669402238687618) -->
+ <!-- no translation found for media_transfer_wired_device_mic_name (7115192790725088698) -->
<skip />
+ <string name="media_transfer_usb_device_mic_name" msgid="7171789543226269822">"Micrófono USB"</string>
+ <string name="media_transfer_bt_device_mic_name" msgid="1870669402238687618">"Micrófono Bluetooth"</string>
<string name="wifi_hotspot_switch_on_text" msgid="9212273118217786155">"Activado"</string>
<string name="wifi_hotspot_switch_off_text" msgid="7245567251496959764">"Desactivado"</string>
<string name="carrier_network_change_mode" msgid="4257621815706644026">"Cambiando la red del operador"</string>
diff --git a/packages/SettingsLib/res/values-et/strings.xml b/packages/SettingsLib/res/values-et/strings.xml
index 77a0799ca1ac..6582864e2e32 100644
--- a/packages/SettingsLib/res/values-et/strings.xml
+++ b/packages/SettingsLib/res/values-et/strings.xml
@@ -686,9 +686,11 @@
<string name="cached_apps_freezer_enabled" msgid="8866703500183051546">"Lubatud"</string>
<string name="cached_apps_freezer_reboot_dialog_text" msgid="695330563489230096">"Selle muudatuse rakendamiseks tuleb seade taaskäivitada. Taaskäivitage kohe või tühistage."</string>
<string name="media_transfer_wired_headphone_name" msgid="8698668536022665254">"Juhtmega kõrvaklapid"</string>
- <string name="media_transfer_headphone_name" msgid="1131962659136578852">"Kõrvaklapid"</string>
+ <!-- no translation found for media_transfer_headphone_name (1157798825650178478) -->
+ <skip />
<string name="media_transfer_usb_audio_name" msgid="1789292056757821355">"USB-heli"</string>
- <string name="media_transfer_wired_device_mic_name" msgid="7417067197803840965">"Mikrofoni pistikupesa"</string>
+ <!-- no translation found for media_transfer_wired_device_mic_name (7115192790725088698) -->
+ <skip />
<string name="media_transfer_usb_device_mic_name" msgid="7171789543226269822">"USB-mikrofon"</string>
<string name="media_transfer_bt_device_mic_name" msgid="1870669402238687618">"BT mikrofon"</string>
<string name="wifi_hotspot_switch_on_text" msgid="9212273118217786155">"Sees"</string>
diff --git a/packages/SettingsLib/res/values-eu/strings.xml b/packages/SettingsLib/res/values-eu/strings.xml
index a490b7b6a515..f9ec6f715448 100644
--- a/packages/SettingsLib/res/values-eu/strings.xml
+++ b/packages/SettingsLib/res/values-eu/strings.xml
@@ -686,9 +686,11 @@
<string name="cached_apps_freezer_enabled" msgid="8866703500183051546">"Gaituta"</string>
<string name="cached_apps_freezer_reboot_dialog_text" msgid="695330563489230096">"Aldaketa aplikatzeko, berrabiarazi egin behar da gailua. Berrabiaraz ezazu orain, edo utzi bertan behera."</string>
<string name="media_transfer_wired_headphone_name" msgid="8698668536022665254">"Entzungailu kableduna"</string>
- <string name="media_transfer_headphone_name" msgid="1131962659136578852">"Entzungailua"</string>
+ <!-- no translation found for media_transfer_headphone_name (1157798825650178478) -->
+ <skip />
<string name="media_transfer_usb_audio_name" msgid="1789292056757821355">"USB bidezko audioa"</string>
- <string name="media_transfer_wired_device_mic_name" msgid="7417067197803840965">"Mikrofonoaren konektorea"</string>
+ <!-- no translation found for media_transfer_wired_device_mic_name (7115192790725088698) -->
+ <skip />
<string name="media_transfer_usb_device_mic_name" msgid="7171789543226269822">"USB bidezko mikrofonoa"</string>
<string name="media_transfer_bt_device_mic_name" msgid="1870669402238687618">"Bluetooth bidezko mikrofonoa"</string>
<string name="wifi_hotspot_switch_on_text" msgid="9212273118217786155">"Aktibatu"</string>
diff --git a/packages/SettingsLib/res/values-fa/strings.xml b/packages/SettingsLib/res/values-fa/strings.xml
index 305fcbeeef43..9c704c5b89eb 100644
--- a/packages/SettingsLib/res/values-fa/strings.xml
+++ b/packages/SettingsLib/res/values-fa/strings.xml
@@ -686,9 +686,11 @@
<string name="cached_apps_freezer_enabled" msgid="8866703500183051546">"فعال"</string>
<string name="cached_apps_freezer_reboot_dialog_text" msgid="695330563489230096">"برای اعمال این تغییر، دستگاه باید بازراه‌اندازی شود. یا اکنون بازراه‌اندازی کنید یا لغو کنید."</string>
<string name="media_transfer_wired_headphone_name" msgid="8698668536022665254">"هدفون سیمی"</string>
- <string name="media_transfer_headphone_name" msgid="1131962659136578852">"هدفون"</string>
+ <!-- no translation found for media_transfer_headphone_name (1157798825650178478) -->
+ <skip />
<string name="media_transfer_usb_audio_name" msgid="1789292056757821355">"‏بلندگوی USB"</string>
- <string name="media_transfer_wired_device_mic_name" msgid="7417067197803840965">"فیش میکروفون"</string>
+ <!-- no translation found for media_transfer_wired_device_mic_name (7115192790725088698) -->
+ <skip />
<string name="media_transfer_usb_device_mic_name" msgid="7171789543226269822">"‏میکروفون USB"</string>
<string name="media_transfer_bt_device_mic_name" msgid="1870669402238687618">"میکروفون بلوتوث"</string>
<string name="wifi_hotspot_switch_on_text" msgid="9212273118217786155">"روشن"</string>
diff --git a/packages/SettingsLib/res/values-fi/strings.xml b/packages/SettingsLib/res/values-fi/strings.xml
index fc6d5da1250c..193ec7065086 100644
--- a/packages/SettingsLib/res/values-fi/strings.xml
+++ b/packages/SettingsLib/res/values-fi/strings.xml
@@ -686,9 +686,11 @@
<string name="cached_apps_freezer_enabled" msgid="8866703500183051546">"Käytössä"</string>
<string name="cached_apps_freezer_reboot_dialog_text" msgid="695330563489230096">"Laitteesi on käynnistettävä uudelleen, jotta muutos tulee voimaan. Käynnistä uudelleen nyt tai peru."</string>
<string name="media_transfer_wired_headphone_name" msgid="8698668536022665254">"Langalliset kuulokkeet"</string>
- <string name="media_transfer_headphone_name" msgid="1131962659136578852">"Kuulokkeet"</string>
+ <!-- no translation found for media_transfer_headphone_name (1157798825650178478) -->
+ <skip />
<string name="media_transfer_usb_audio_name" msgid="1789292056757821355">"USB-audio"</string>
- <string name="media_transfer_wired_device_mic_name" msgid="7417067197803840965">"Mikrofoniliitäntä"</string>
+ <!-- no translation found for media_transfer_wired_device_mic_name (7115192790725088698) -->
+ <skip />
<string name="media_transfer_usb_device_mic_name" msgid="7171789543226269822">"USB-mikrofoni"</string>
<string name="media_transfer_bt_device_mic_name" msgid="1870669402238687618">"BT-mikrofoni"</string>
<string name="wifi_hotspot_switch_on_text" msgid="9212273118217786155">"Päällä"</string>
diff --git a/packages/SettingsLib/res/values-fr-rCA/strings.xml b/packages/SettingsLib/res/values-fr-rCA/strings.xml
index 05157b71d17a..b527990c5221 100644
--- a/packages/SettingsLib/res/values-fr-rCA/strings.xml
+++ b/packages/SettingsLib/res/values-fr-rCA/strings.xml
@@ -393,7 +393,7 @@
<string name="disable_overlays_summary" msgid="1954852414363338166">"Toujours utiliser le GPU pour la composition écran"</string>
<string name="simulate_color_space" msgid="1206503300335835151">"Simuler espace colorimétrique"</string>
<string name="enable_opengl_traces_title" msgid="4638773318659125196">"Enable OpenGL traces"</string>
- <string name="usb_audio_disable_routing" msgid="3367656923544254975">"Désact. routage audio USB"</string>
+ <string name="usb_audio_disable_routing" msgid="3367656923544254975">"Désactiver le routage audio USB"</string>
<string name="usb_audio_disable_routing_summary" msgid="8768242894849534699">"Désactiver routage automatique appareils audio USB"</string>
<string name="debug_layout" msgid="1659216803043339741">"Afficher les contours"</string>
<string name="debug_layout_summary" msgid="8825829038287321978">"Afficher les limites, les marges de clip, etc."</string>
@@ -686,12 +686,13 @@
<string name="cached_apps_freezer_enabled" msgid="8866703500183051546">"Activé"</string>
<string name="cached_apps_freezer_reboot_dialog_text" msgid="695330563489230096">"Votre appareil doit être redémarré pour que ce changement prenne effet. Redémarrez-le maintenant ou annulez la modification."</string>
<string name="media_transfer_wired_headphone_name" msgid="8698668536022665254">"Écouteurs filaires"</string>
- <string name="media_transfer_headphone_name" msgid="1131962659136578852">"Écouteurs"</string>
+ <!-- no translation found for media_transfer_headphone_name (1157798825650178478) -->
+ <skip />
<string name="media_transfer_usb_audio_name" msgid="1789292056757821355">"Audio par USB"</string>
- <string name="media_transfer_wired_device_mic_name" msgid="7417067197803840965">"Prise du microphone"</string>
- <string name="media_transfer_usb_device_mic_name" msgid="7171789543226269822">"Microphone USB"</string>
- <!-- no translation found for media_transfer_bt_device_mic_name (1870669402238687618) -->
+ <!-- no translation found for media_transfer_wired_device_mic_name (7115192790725088698) -->
<skip />
+ <string name="media_transfer_usb_device_mic_name" msgid="7171789543226269822">"Microphone USB"</string>
+ <string name="media_transfer_bt_device_mic_name" msgid="1870669402238687618">"Microphone BT"</string>
<string name="wifi_hotspot_switch_on_text" msgid="9212273118217786155">"Activé"</string>
<string name="wifi_hotspot_switch_off_text" msgid="7245567251496959764">"Désactivé"</string>
<string name="carrier_network_change_mode" msgid="4257621815706644026">"Changer de réseau de fournisseur de services"</string>
diff --git a/packages/SettingsLib/res/values-fr/strings.xml b/packages/SettingsLib/res/values-fr/strings.xml
index 31616a79f79b..fb2bcf322edb 100644
--- a/packages/SettingsLib/res/values-fr/strings.xml
+++ b/packages/SettingsLib/res/values-fr/strings.xml
@@ -686,12 +686,13 @@
<string name="cached_apps_freezer_enabled" msgid="8866703500183051546">"Activé"</string>
<string name="cached_apps_freezer_reboot_dialog_text" msgid="695330563489230096">"Vous devez redémarrer l\'appareil pour que cette modification soit appliquée. Redémarrez maintenant ou annulez l\'opération."</string>
<string name="media_transfer_wired_headphone_name" msgid="8698668536022665254">"Casque filaire"</string>
- <string name="media_transfer_headphone_name" msgid="1131962659136578852">"Casque audio"</string>
+ <!-- no translation found for media_transfer_headphone_name (1157798825650178478) -->
+ <skip />
<string name="media_transfer_usb_audio_name" msgid="1789292056757821355">"Audio USB"</string>
- <string name="media_transfer_wired_device_mic_name" msgid="7417067197803840965">"Connecteur micro"</string>
- <string name="media_transfer_usb_device_mic_name" msgid="7171789543226269822">"Micro USB"</string>
- <!-- no translation found for media_transfer_bt_device_mic_name (1870669402238687618) -->
+ <!-- no translation found for media_transfer_wired_device_mic_name (7115192790725088698) -->
<skip />
+ <string name="media_transfer_usb_device_mic_name" msgid="7171789543226269822">"Micro USB"</string>
+ <string name="media_transfer_bt_device_mic_name" msgid="1870669402238687618">"Micro Bluetooth"</string>
<string name="wifi_hotspot_switch_on_text" msgid="9212273118217786155">"Allumé"</string>
<string name="wifi_hotspot_switch_off_text" msgid="7245567251496959764">"Éteint"</string>
<string name="carrier_network_change_mode" msgid="4257621815706644026">"Modification du réseau de l\'opérateur"</string>
diff --git a/packages/SettingsLib/res/values-gl/strings.xml b/packages/SettingsLib/res/values-gl/strings.xml
index 25d4eb8ca8ec..d6e9f3fb4210 100644
--- a/packages/SettingsLib/res/values-gl/strings.xml
+++ b/packages/SettingsLib/res/values-gl/strings.xml
@@ -686,9 +686,11 @@
<string name="cached_apps_freezer_enabled" msgid="8866703500183051546">"Activado"</string>
<string name="cached_apps_freezer_reboot_dialog_text" msgid="695330563489230096">"É necesario reiniciar o teu dispositivo para aplicar este cambio. Reiníciao agora ou cancela o cambio."</string>
<string name="media_transfer_wired_headphone_name" msgid="8698668536022665254">"Auriculares con cable"</string>
- <string name="media_transfer_headphone_name" msgid="1131962659136578852">"Auriculares"</string>
+ <!-- no translation found for media_transfer_headphone_name (1157798825650178478) -->
+ <skip />
<string name="media_transfer_usb_audio_name" msgid="1789292056757821355">"Audio USB"</string>
- <string name="media_transfer_wired_device_mic_name" msgid="7417067197803840965">"Conector do micrófono"</string>
+ <!-- no translation found for media_transfer_wired_device_mic_name (7115192790725088698) -->
+ <skip />
<string name="media_transfer_usb_device_mic_name" msgid="7171789543226269822">"Micrófono USB"</string>
<string name="media_transfer_bt_device_mic_name" msgid="1870669402238687618">"Micrófono Bluetooth"</string>
<string name="wifi_hotspot_switch_on_text" msgid="9212273118217786155">"Activada"</string>
diff --git a/packages/SettingsLib/res/values-gu/strings.xml b/packages/SettingsLib/res/values-gu/strings.xml
index dad0ce543d88..b804dd4ef8cb 100644
--- a/packages/SettingsLib/res/values-gu/strings.xml
+++ b/packages/SettingsLib/res/values-gu/strings.xml
@@ -686,9 +686,11 @@
<string name="cached_apps_freezer_enabled" msgid="8866703500183051546">"ચાલુ છે"</string>
<string name="cached_apps_freezer_reboot_dialog_text" msgid="695330563489230096">"આ ફેરફારને લાગુ કરવા માટે તમારા ડિવાઇસને રીબૂટ કરવાની જરૂર છે. હમણાં જ રીબૂટ કરો કે રદ કરો."</string>
<string name="media_transfer_wired_headphone_name" msgid="8698668536022665254">"વાયરવાળો હૅડફોન"</string>
- <string name="media_transfer_headphone_name" msgid="1131962659136578852">"હૅડફોન"</string>
+ <!-- no translation found for media_transfer_headphone_name (1157798825650178478) -->
+ <skip />
<string name="media_transfer_usb_audio_name" msgid="1789292056757821355">"USB ઑડિયો"</string>
- <string name="media_transfer_wired_device_mic_name" msgid="7417067197803840965">"માઇક જૅક"</string>
+ <!-- no translation found for media_transfer_wired_device_mic_name (7115192790725088698) -->
+ <skip />
<string name="media_transfer_usb_device_mic_name" msgid="7171789543226269822">"USB માઇક્રોફોન"</string>
<string name="media_transfer_bt_device_mic_name" msgid="1870669402238687618">"BT માઇક્રોફોન"</string>
<string name="wifi_hotspot_switch_on_text" msgid="9212273118217786155">"ચાલુ"</string>
diff --git a/packages/SettingsLib/res/values-hi/arrays.xml b/packages/SettingsLib/res/values-hi/arrays.xml
index d023dc7ce9a4..7a22465f80e5 100644
--- a/packages/SettingsLib/res/values-hi/arrays.xml
+++ b/packages/SettingsLib/res/values-hi/arrays.xml
@@ -207,7 +207,7 @@
<string-array name="window_animation_scale_entries">
<item msgid="2675263395797191850">"एनिमेशन बंद"</item>
<item msgid="5790132543372767872">"एनिमेशन स्‍केल .5x"</item>
- <item msgid="2529692189302148746">"एनिमेशन स्‍केल 1x"</item>
+ <item msgid="2529692189302148746">"ऐनिमेशन स्‍केल 1 गुना"</item>
<item msgid="8072785072237082286">"एनिमेशन स्‍केल 1.5x"</item>
<item msgid="3531560925718232560">"एनिमेशन स्‍केल 2x"</item>
<item msgid="4542853094898215187">"एनिमेशन स्‍केल 5x"</item>
@@ -225,7 +225,7 @@
<string-array name="animator_duration_scale_entries">
<item msgid="6416998593844817378">"एनिमेशन बंद"</item>
<item msgid="875345630014338616">"एनिमेशन स्‍केल .5x"</item>
- <item msgid="2753729231187104962">"एनिमेशन स्‍केल 1x"</item>
+ <item msgid="2753729231187104962">"ऐनिमेशन स्‍केल 1 गुना"</item>
<item msgid="1368370459723665338">"एनिमेशन स्‍केल 1.5x"</item>
<item msgid="5768005350534383389">"एनिमेशन स्‍केल 2x"</item>
<item msgid="3728265127284005444">"एनिमेशन स्‍केल 5x"</item>
diff --git a/packages/SettingsLib/res/values-hi/strings.xml b/packages/SettingsLib/res/values-hi/strings.xml
index fcfe9a34815e..7c5e66ccaf03 100644
--- a/packages/SettingsLib/res/values-hi/strings.xml
+++ b/packages/SettingsLib/res/values-hi/strings.xml
@@ -288,7 +288,7 @@
<string name="confirm_enable_oem_unlock_title" msgid="8249318129774367535">"OEM अनलॉक करने की अनुमति दें?"</string>
<string name="confirm_enable_oem_unlock_text" msgid="854131050791011970">"चेतावनी: इस सेटिंग के चालू रहने पर डिवाइस सुरक्षा सुविधाएं इस डिवाइस पर काम नहीं करेंगी."</string>
<string name="mock_location_app" msgid="6269380172542248304">"मॉक लोकेशन के लिए ऐप्लिकेशन चुनें"</string>
- <string name="mock_location_app_not_set" msgid="6972032787262831155">"मॉक लोकेशन के लिए ऐप्लिकेशन सेट नहीं है"</string>
+ <string name="mock_location_app_not_set" msgid="6972032787262831155">"मॉक लोकेशन के लिए कोई ऐप्लिकेशन सेट नहीं है"</string>
<string name="mock_location_app_set" msgid="4706722469342913843">"मॉक लोकेशन के लिए ऐप्लिकेशन: <xliff:g id="APP_NAME">%1$s</xliff:g>"</string>
<string name="debug_networking_category" msgid="6829757985772659599">"नेटवर्किंग"</string>
<string name="wifi_display_certification" msgid="1805579519992520381">"वायरलेस डिसप्ले सर्टिफ़िकेशन"</string>
@@ -686,9 +686,11 @@
<string name="cached_apps_freezer_enabled" msgid="8866703500183051546">"चालू है"</string>
<string name="cached_apps_freezer_reboot_dialog_text" msgid="695330563489230096">"बदली गई सेटिंग को लागू करने के लिए, डिवाइस को रीस्टार्ट करना होगा. अपने डिवाइस को रीस्टार्ट करें या रद्द करें."</string>
<string name="media_transfer_wired_headphone_name" msgid="8698668536022665254">"तार वाला हेडफ़ोन"</string>
- <string name="media_transfer_headphone_name" msgid="1131962659136578852">"हेडफ़ोन"</string>
+ <!-- no translation found for media_transfer_headphone_name (1157798825650178478) -->
+ <skip />
<string name="media_transfer_usb_audio_name" msgid="1789292056757821355">"यूएसबी ऑडियो"</string>
- <string name="media_transfer_wired_device_mic_name" msgid="7417067197803840965">"माइक्रोफ़ोन जैक"</string>
+ <!-- no translation found for media_transfer_wired_device_mic_name (7115192790725088698) -->
+ <skip />
<string name="media_transfer_usb_device_mic_name" msgid="7171789543226269822">"यूएसबी माइक्रोफ़ोन"</string>
<string name="media_transfer_bt_device_mic_name" msgid="1870669402238687618">"ब्लूटूथ माइक्रोफ़ोन"</string>
<string name="wifi_hotspot_switch_on_text" msgid="9212273118217786155">"चालू है"</string>
diff --git a/packages/SettingsLib/res/values-hr/strings.xml b/packages/SettingsLib/res/values-hr/strings.xml
index 5db8507a6c72..fc474dd2957e 100644
--- a/packages/SettingsLib/res/values-hr/strings.xml
+++ b/packages/SettingsLib/res/values-hr/strings.xml
@@ -287,7 +287,7 @@
<string name="oem_unlock_enable_summary" msgid="5857388174390953829">"Neka kôd za pokretanje sustava bude otključan"</string>
<string name="confirm_enable_oem_unlock_title" msgid="8249318129774367535">"Želite li dopustiti OEM otključavanje?"</string>
<string name="confirm_enable_oem_unlock_text" msgid="854131050791011970">"UPOZORENJE: značajke za zaštitu uređaja neće funkcionirati na ovom uređaju dok je ta postavka uključena."</string>
- <string name="mock_location_app" msgid="6269380172542248304">"Odabir aplikacije za lažnu lokaciju"</string>
+ <string name="mock_location_app" msgid="6269380172542248304">"Odaberi aplikaciju za lažnu lokaciju"</string>
<string name="mock_location_app_not_set" msgid="6972032787262831155">"Aplikacija za lažnu lokaciju nije postavljena"</string>
<string name="mock_location_app_set" msgid="4706722469342913843">"Aplikacija za lažnu lokaciju: <xliff:g id="APP_NAME">%1$s</xliff:g>"</string>
<string name="debug_networking_category" msgid="6829757985772659599">"Umrežavanje"</string>
@@ -686,9 +686,11 @@
<string name="cached_apps_freezer_enabled" msgid="8866703500183051546">"Omogućeno"</string>
<string name="cached_apps_freezer_reboot_dialog_text" msgid="695330563489230096">"Uređaj se mora ponovno pokrenuti da bi se ta promjena primijenila. Ponovo pokrenite uređaj odmah ili odustanite."</string>
<string name="media_transfer_wired_headphone_name" msgid="8698668536022665254">"Žičane slušalice"</string>
- <string name="media_transfer_headphone_name" msgid="1131962659136578852">"Slušalice"</string>
+ <!-- no translation found for media_transfer_headphone_name (1157798825650178478) -->
+ <skip />
<string name="media_transfer_usb_audio_name" msgid="1789292056757821355">"USB zvučnik"</string>
- <string name="media_transfer_wired_device_mic_name" msgid="7417067197803840965">"Utičnica za mikrofon"</string>
+ <!-- no translation found for media_transfer_wired_device_mic_name (7115192790725088698) -->
+ <skip />
<string name="media_transfer_usb_device_mic_name" msgid="7171789543226269822">"USB mikrofon"</string>
<string name="media_transfer_bt_device_mic_name" msgid="1870669402238687618">"BT mikrofon"</string>
<string name="wifi_hotspot_switch_on_text" msgid="9212273118217786155">"Uključeno"</string>
diff --git a/packages/SettingsLib/res/values-hu/strings.xml b/packages/SettingsLib/res/values-hu/strings.xml
index bd700108c92e..95b28928ab01 100644
--- a/packages/SettingsLib/res/values-hu/strings.xml
+++ b/packages/SettingsLib/res/values-hu/strings.xml
@@ -686,9 +686,11 @@
<string name="cached_apps_freezer_enabled" msgid="8866703500183051546">"Engedélyezve"</string>
<string name="cached_apps_freezer_reboot_dialog_text" msgid="695330563489230096">"Az eszközt újra kell indítani, hogy a módosítás megtörténjen. Indítsa újra most, vagy vesse el a módosítást."</string>
<string name="media_transfer_wired_headphone_name" msgid="8698668536022665254">"Vezetékes fejhallgató"</string>
- <string name="media_transfer_headphone_name" msgid="1131962659136578852">"Fejhallgató"</string>
+ <!-- no translation found for media_transfer_headphone_name (1157798825650178478) -->
+ <skip />
<string name="media_transfer_usb_audio_name" msgid="1789292056757821355">"USB-hangeszköz"</string>
- <string name="media_transfer_wired_device_mic_name" msgid="7417067197803840965">"Mikrofon jack csatlakozója"</string>
+ <!-- no translation found for media_transfer_wired_device_mic_name (7115192790725088698) -->
+ <skip />
<string name="media_transfer_usb_device_mic_name" msgid="7171789543226269822">"USB-mikrofon"</string>
<string name="media_transfer_bt_device_mic_name" msgid="1870669402238687618">"BT-mikrofon"</string>
<string name="wifi_hotspot_switch_on_text" msgid="9212273118217786155">"Be"</string>
diff --git a/packages/SettingsLib/res/values-hy/strings.xml b/packages/SettingsLib/res/values-hy/strings.xml
index 6549de0d1464..51190f3a2599 100644
--- a/packages/SettingsLib/res/values-hy/strings.xml
+++ b/packages/SettingsLib/res/values-hy/strings.xml
@@ -686,9 +686,11 @@
<string name="cached_apps_freezer_enabled" msgid="8866703500183051546">"Միացված է"</string>
<string name="cached_apps_freezer_reboot_dialog_text" msgid="695330563489230096">"Սարքն անհրաժեշտ է վերագործարկել, որպեսզի փոփոխությունը կիրառվի։ Վերագործարկեք հիմա կամ չեղարկեք փոփոխությունը։"</string>
<string name="media_transfer_wired_headphone_name" msgid="8698668536022665254">"Լարով ականջակալ"</string>
- <string name="media_transfer_headphone_name" msgid="1131962659136578852">"Ականջակալ"</string>
+ <!-- no translation found for media_transfer_headphone_name (1157798825650178478) -->
+ <skip />
<string name="media_transfer_usb_audio_name" msgid="1789292056757821355">"USB աուդիո"</string>
- <string name="media_transfer_wired_device_mic_name" msgid="7417067197803840965">"Խոսափողի հարակցիչ"</string>
+ <!-- no translation found for media_transfer_wired_device_mic_name (7115192790725088698) -->
+ <skip />
<string name="media_transfer_usb_device_mic_name" msgid="7171789543226269822">"USB խոսափող"</string>
<string name="media_transfer_bt_device_mic_name" msgid="1870669402238687618">"Bluetooth խոսափող"</string>
<string name="wifi_hotspot_switch_on_text" msgid="9212273118217786155">"Միացնել"</string>
diff --git a/packages/SettingsLib/res/values-in/strings.xml b/packages/SettingsLib/res/values-in/strings.xml
index 2555e9b3b918..84280cf8a0de 100644
--- a/packages/SettingsLib/res/values-in/strings.xml
+++ b/packages/SettingsLib/res/values-in/strings.xml
@@ -287,7 +287,7 @@
<string name="oem_unlock_enable_summary" msgid="5857388174390953829">"Izinkan bootloader dibuka kuncinya"</string>
<string name="confirm_enable_oem_unlock_title" msgid="8249318129774367535">"Izinkan buka kunci OEM?"</string>
<string name="confirm_enable_oem_unlock_text" msgid="854131050791011970">"PERINGATAN: Fitur perlindungan perangkat tidak akan berfungsi di perangkat ini saat setelan diaktifkan."</string>
- <string name="mock_location_app" msgid="6269380172542248304">"Pilih aplikasi lokasi palsu"</string>
+ <string name="mock_location_app" msgid="6269380172542248304">"Pilih aplikasi lokasi simulasi"</string>
<string name="mock_location_app_not_set" msgid="6972032787262831155">"Tidak ada aplikasi lokasi simulasi yang disetel"</string>
<string name="mock_location_app_set" msgid="4706722469342913843">"Aplikasi lokasi palsu: <xliff:g id="APP_NAME">%1$s</xliff:g>"</string>
<string name="debug_networking_category" msgid="6829757985772659599">"Jaringan"</string>
@@ -686,9 +686,11 @@
<string name="cached_apps_freezer_enabled" msgid="8866703500183051546">"Aktif"</string>
<string name="cached_apps_freezer_reboot_dialog_text" msgid="695330563489230096">"Perangkat Anda harus di-reboot agar perubahan ini diterapkan. Reboot sekarang atau batalkan."</string>
<string name="media_transfer_wired_headphone_name" msgid="8698668536022665254">"Headphone berkabel"</string>
- <string name="media_transfer_headphone_name" msgid="1131962659136578852">"Headphone"</string>
+ <!-- no translation found for media_transfer_headphone_name (1157798825650178478) -->
+ <skip />
<string name="media_transfer_usb_audio_name" msgid="1789292056757821355">"Audio USB"</string>
- <string name="media_transfer_wired_device_mic_name" msgid="7417067197803840965">"Colokan mikrofon"</string>
+ <!-- no translation found for media_transfer_wired_device_mic_name (7115192790725088698) -->
+ <skip />
<string name="media_transfer_usb_device_mic_name" msgid="7171789543226269822">"Mikrofon USB"</string>
<string name="media_transfer_bt_device_mic_name" msgid="1870669402238687618">"Mikrofon BT"</string>
<string name="wifi_hotspot_switch_on_text" msgid="9212273118217786155">"Aktif"</string>
diff --git a/packages/SettingsLib/res/values-is/strings.xml b/packages/SettingsLib/res/values-is/strings.xml
index eba432f30088..daadae6010dd 100644
--- a/packages/SettingsLib/res/values-is/strings.xml
+++ b/packages/SettingsLib/res/values-is/strings.xml
@@ -686,9 +686,11 @@
<string name="cached_apps_freezer_enabled" msgid="8866703500183051546">"Virkt"</string>
<string name="cached_apps_freezer_reboot_dialog_text" msgid="695330563489230096">"Endurræsa þarf tækið til að þessi breyting taki gildi. Endurræstu núna eða hættu við."</string>
<string name="media_transfer_wired_headphone_name" msgid="8698668536022665254">"Heyrnartól með snúru"</string>
- <string name="media_transfer_headphone_name" msgid="1131962659136578852">"Heyrnartól"</string>
+ <!-- no translation found for media_transfer_headphone_name (1157798825650178478) -->
+ <skip />
<string name="media_transfer_usb_audio_name" msgid="1789292056757821355">"USB-hljóð"</string>
- <string name="media_transfer_wired_device_mic_name" msgid="7417067197803840965">"Hljóðnematengi"</string>
+ <!-- no translation found for media_transfer_wired_device_mic_name (7115192790725088698) -->
+ <skip />
<string name="media_transfer_usb_device_mic_name" msgid="7171789543226269822">"USB-hljóðnemi"</string>
<string name="media_transfer_bt_device_mic_name" msgid="1870669402238687618">"BT-hljóðnemi"</string>
<string name="wifi_hotspot_switch_on_text" msgid="9212273118217786155">"Kveikt"</string>
diff --git a/packages/SettingsLib/res/values-it/strings.xml b/packages/SettingsLib/res/values-it/strings.xml
index c0f1557a3aff..36aa2b334cbe 100644
--- a/packages/SettingsLib/res/values-it/strings.xml
+++ b/packages/SettingsLib/res/values-it/strings.xml
@@ -686,12 +686,13 @@
<string name="cached_apps_freezer_enabled" msgid="8866703500183051546">"Attivo"</string>
<string name="cached_apps_freezer_reboot_dialog_text" msgid="695330563489230096">"Per applicare questa modifica, devi riavviare il dispositivo. Riavvia ora o annulla."</string>
<string name="media_transfer_wired_headphone_name" msgid="8698668536022665254">"Cuffie con cavo"</string>
- <string name="media_transfer_headphone_name" msgid="1131962659136578852">"Cuffie"</string>
+ <!-- no translation found for media_transfer_headphone_name (1157798825650178478) -->
+ <skip />
<string name="media_transfer_usb_audio_name" msgid="1789292056757821355">"Audio USB"</string>
- <string name="media_transfer_wired_device_mic_name" msgid="7417067197803840965">"Jack per microfono"</string>
- <string name="media_transfer_usb_device_mic_name" msgid="7171789543226269822">"Microfono USB"</string>
- <!-- no translation found for media_transfer_bt_device_mic_name (1870669402238687618) -->
+ <!-- no translation found for media_transfer_wired_device_mic_name (7115192790725088698) -->
<skip />
+ <string name="media_transfer_usb_device_mic_name" msgid="7171789543226269822">"Microfono USB"</string>
+ <string name="media_transfer_bt_device_mic_name" msgid="1870669402238687618">"Microfono BT"</string>
<string name="wifi_hotspot_switch_on_text" msgid="9212273118217786155">"On"</string>
<string name="wifi_hotspot_switch_off_text" msgid="7245567251496959764">"Off"</string>
<string name="carrier_network_change_mode" msgid="4257621815706644026">"Cambio della rete dell\'operatore"</string>
diff --git a/packages/SettingsLib/res/values-iw/strings.xml b/packages/SettingsLib/res/values-iw/strings.xml
index b6f863e16b1d..942b99b68897 100644
--- a/packages/SettingsLib/res/values-iw/strings.xml
+++ b/packages/SettingsLib/res/values-iw/strings.xml
@@ -686,9 +686,11 @@
<string name="cached_apps_freezer_enabled" msgid="8866703500183051546">"מופעל"</string>
<string name="cached_apps_freezer_reboot_dialog_text" msgid="695330563489230096">"צריך להפעיל מחדש את המכשיר כדי להחיל את השינוי. יש להפעיל מחדש עכשיו או לבטל."</string>
<string name="media_transfer_wired_headphone_name" msgid="8698668536022665254">"אוזניות חוטיות"</string>
- <string name="media_transfer_headphone_name" msgid="1131962659136578852">"אוזניות"</string>
+ <!-- no translation found for media_transfer_headphone_name (1157798825650178478) -->
+ <skip />
<string name="media_transfer_usb_audio_name" msgid="1789292056757821355">"‏אודיו ב-USB"</string>
- <string name="media_transfer_wired_device_mic_name" msgid="7417067197803840965">"שקע למיקרופון"</string>
+ <!-- no translation found for media_transfer_wired_device_mic_name (7115192790725088698) -->
+ <skip />
<string name="media_transfer_usb_device_mic_name" msgid="7171789543226269822">"‏מיקרופון ב-USB"</string>
<string name="media_transfer_bt_device_mic_name" msgid="1870669402238687618">"‏מיקרופון BT"</string>
<string name="wifi_hotspot_switch_on_text" msgid="9212273118217786155">"פועלת"</string>
diff --git a/packages/SettingsLib/res/values-ja/strings.xml b/packages/SettingsLib/res/values-ja/strings.xml
index ff3870ac5343..5924ab2a42ca 100644
--- a/packages/SettingsLib/res/values-ja/strings.xml
+++ b/packages/SettingsLib/res/values-ja/strings.xml
@@ -686,9 +686,11 @@
<string name="cached_apps_freezer_enabled" msgid="8866703500183051546">"有効"</string>
<string name="cached_apps_freezer_reboot_dialog_text" msgid="695330563489230096">"この変更を適用するには、デバイスの再起動が必要です。今すぐ再起動するか、キャンセルしてください。"</string>
<string name="media_transfer_wired_headphone_name" msgid="8698668536022665254">"有線ヘッドフォン"</string>
- <string name="media_transfer_headphone_name" msgid="1131962659136578852">"ヘッドフォン"</string>
+ <!-- no translation found for media_transfer_headphone_name (1157798825650178478) -->
+ <skip />
<string name="media_transfer_usb_audio_name" msgid="1789292056757821355">"USB オーディオ"</string>
- <string name="media_transfer_wired_device_mic_name" msgid="7417067197803840965">"マイク差込口"</string>
+ <!-- no translation found for media_transfer_wired_device_mic_name (7115192790725088698) -->
+ <skip />
<string name="media_transfer_usb_device_mic_name" msgid="7171789543226269822">"USB マイク"</string>
<string name="media_transfer_bt_device_mic_name" msgid="1870669402238687618">"BT マイク"</string>
<string name="wifi_hotspot_switch_on_text" msgid="9212273118217786155">"ON"</string>
diff --git a/packages/SettingsLib/res/values-ka/strings.xml b/packages/SettingsLib/res/values-ka/strings.xml
index 0ec064832255..5f3d54f2dc70 100644
--- a/packages/SettingsLib/res/values-ka/strings.xml
+++ b/packages/SettingsLib/res/values-ka/strings.xml
@@ -686,9 +686,11 @@
<string name="cached_apps_freezer_enabled" msgid="8866703500183051546">"ჩართული"</string>
<string name="cached_apps_freezer_reboot_dialog_text" msgid="695330563489230096">"ამ ცვლილების ასამოქმედებლად თქვენი მოწყობილობა უნდა გადაიტვირთოს. გადატვირთეთ ახლავე ან გააუქმეთ."</string>
<string name="media_transfer_wired_headphone_name" msgid="8698668536022665254">"სადენიანი ყურსასმენი"</string>
- <string name="media_transfer_headphone_name" msgid="1131962659136578852">"ყურსასმენი"</string>
+ <!-- no translation found for media_transfer_headphone_name (1157798825650178478) -->
+ <skip />
<string name="media_transfer_usb_audio_name" msgid="1789292056757821355">"USB აუდიო"</string>
- <string name="media_transfer_wired_device_mic_name" msgid="7417067197803840965">"მიკროფონის ჯეკი"</string>
+ <!-- no translation found for media_transfer_wired_device_mic_name (7115192790725088698) -->
+ <skip />
<string name="media_transfer_usb_device_mic_name" msgid="7171789543226269822">"USB მიკროფონი"</string>
<string name="media_transfer_bt_device_mic_name" msgid="1870669402238687618">"BT მიკროფონი"</string>
<string name="wifi_hotspot_switch_on_text" msgid="9212273118217786155">"ჩართვა"</string>
diff --git a/packages/SettingsLib/res/values-kk/strings.xml b/packages/SettingsLib/res/values-kk/strings.xml
index f7547170b846..bb6e353ae321 100644
--- a/packages/SettingsLib/res/values-kk/strings.xml
+++ b/packages/SettingsLib/res/values-kk/strings.xml
@@ -686,9 +686,11 @@
<string name="cached_apps_freezer_enabled" msgid="8866703500183051546">"Қосулы"</string>
<string name="cached_apps_freezer_reboot_dialog_text" msgid="695330563489230096">"Бұл өзгеріс күшіне енуі үшін, құрылғыны қайта жүктеу керек. Қазір қайта жүктеңіз не бас тартыңыз."</string>
<string name="media_transfer_wired_headphone_name" msgid="8698668536022665254">"Сымды құлақаспап"</string>
- <string name="media_transfer_headphone_name" msgid="1131962659136578852">"Құлақаспап"</string>
+ <!-- no translation found for media_transfer_headphone_name (1157798825650178478) -->
+ <skip />
<string name="media_transfer_usb_audio_name" msgid="1789292056757821355">"USB аудио"</string>
- <string name="media_transfer_wired_device_mic_name" msgid="7417067197803840965">"Микрофон ұяшығы"</string>
+ <!-- no translation found for media_transfer_wired_device_mic_name (7115192790725088698) -->
+ <skip />
<string name="media_transfer_usb_device_mic_name" msgid="7171789543226269822">"USB микрофон"</string>
<string name="media_transfer_bt_device_mic_name" msgid="1870669402238687618">"Bluetooth микрофоны"</string>
<string name="wifi_hotspot_switch_on_text" msgid="9212273118217786155">"Қосу"</string>
diff --git a/packages/SettingsLib/res/values-km/strings.xml b/packages/SettingsLib/res/values-km/strings.xml
index cac7c55685c4..20ed723f4bc2 100644
--- a/packages/SettingsLib/res/values-km/strings.xml
+++ b/packages/SettingsLib/res/values-km/strings.xml
@@ -686,9 +686,11 @@
<string name="cached_apps_freezer_enabled" msgid="8866703500183051546">"បានបើក"</string>
<string name="cached_apps_freezer_reboot_dialog_text" msgid="695330563489230096">"ត្រូវតែ​ចាប់ផ្ដើម​ឧបករណ៍​របស់អ្នក​ឡើងវិញ ដើម្បីឱ្យ​ការផ្លាស់ប្ដូរ​នេះ​មានប្រសិទ្ធភាព។ ចាប់ផ្ដើមឡើងវិញ​ឥឡូវនេះ ឬ​បោះបង់​។"</string>
<string name="media_transfer_wired_headphone_name" msgid="8698668536022665254">"កាស​មានខ្សែ"</string>
- <string name="media_transfer_headphone_name" msgid="1131962659136578852">"កាស"</string>
+ <!-- no translation found for media_transfer_headphone_name (1157798825650178478) -->
+ <skip />
<string name="media_transfer_usb_audio_name" msgid="1789292056757821355">"ឧបករណ៍បំពងសំឡេង USB"</string>
- <string name="media_transfer_wired_device_mic_name" msgid="7417067197803840965">"ឌុយ​មីក្រូហ្វូន"</string>
+ <!-- no translation found for media_transfer_wired_device_mic_name (7115192790725088698) -->
+ <skip />
<string name="media_transfer_usb_device_mic_name" msgid="7171789543226269822">"មីក្រូហ្វូន USB"</string>
<string name="media_transfer_bt_device_mic_name" msgid="1870669402238687618">"មីក្រូហ្វូន BT"</string>
<string name="wifi_hotspot_switch_on_text" msgid="9212273118217786155">"បើក"</string>
diff --git a/packages/SettingsLib/res/values-kn/strings.xml b/packages/SettingsLib/res/values-kn/strings.xml
index 92534ae56b6f..50a1234ca348 100644
--- a/packages/SettingsLib/res/values-kn/strings.xml
+++ b/packages/SettingsLib/res/values-kn/strings.xml
@@ -686,9 +686,11 @@
<string name="cached_apps_freezer_enabled" msgid="8866703500183051546">"ಸಕ್ರಿಯಗೊಳಿಸಲಾಗಿದೆ"</string>
<string name="cached_apps_freezer_reboot_dialog_text" msgid="695330563489230096">"ಈ ಬದಲಾವಣೆ ಅನ್ವಯವಾಗಲು ನಿಮ್ಮ ಸಾಧನವನ್ನು ರೀಬೂಟ್ ಮಾಡಬೇಕು. ಇದೀಗ ರೀಬೂಟ್ ಮಾಡಿ ಅಥವಾ ರದ್ದುಗೊಳಿಸಿ."</string>
<string name="media_transfer_wired_headphone_name" msgid="8698668536022665254">"ವೈಯರ್ ಹೊಂದಿರುವ ಹೆಡ್‌ಫೋನ್"</string>
- <string name="media_transfer_headphone_name" msgid="1131962659136578852">"ಹೆಡ್‌ಫೋನ್"</string>
+ <!-- no translation found for media_transfer_headphone_name (1157798825650178478) -->
+ <skip />
<string name="media_transfer_usb_audio_name" msgid="1789292056757821355">"USB ಆಡಿಯೋ"</string>
- <string name="media_transfer_wired_device_mic_name" msgid="7417067197803840965">"ಮೈಕ್‌ ಜ್ಯಾಕ್‌"</string>
+ <!-- no translation found for media_transfer_wired_device_mic_name (7115192790725088698) -->
+ <skip />
<string name="media_transfer_usb_device_mic_name" msgid="7171789543226269822">"USB ಮೈಕ್ರೊಫೋನ್‌"</string>
<string name="media_transfer_bt_device_mic_name" msgid="1870669402238687618">"BT ಮೈಕ್ರೊಫೋನ್"</string>
<string name="wifi_hotspot_switch_on_text" msgid="9212273118217786155">"ಆನ್ ಆಗಿದೆ"</string>
diff --git a/packages/SettingsLib/res/values-ko/strings.xml b/packages/SettingsLib/res/values-ko/strings.xml
index 1bfe19ce2e2e..f9949ce97a4c 100644
--- a/packages/SettingsLib/res/values-ko/strings.xml
+++ b/packages/SettingsLib/res/values-ko/strings.xml
@@ -686,9 +686,11 @@
<string name="cached_apps_freezer_enabled" msgid="8866703500183051546">"사용 설정됨"</string>
<string name="cached_apps_freezer_reboot_dialog_text" msgid="695330563489230096">"변경사항을 적용하려면 기기를 재부팅해야 합니다. 지금 재부팅하거나 취소하세요."</string>
<string name="media_transfer_wired_headphone_name" msgid="8698668536022665254">"유선 헤드폰"</string>
- <string name="media_transfer_headphone_name" msgid="1131962659136578852">"헤드폰"</string>
+ <!-- no translation found for media_transfer_headphone_name (1157798825650178478) -->
+ <skip />
<string name="media_transfer_usb_audio_name" msgid="1789292056757821355">"USB 오디오"</string>
- <string name="media_transfer_wired_device_mic_name" msgid="7417067197803840965">"마이크 잭"</string>
+ <!-- no translation found for media_transfer_wired_device_mic_name (7115192790725088698) -->
+ <skip />
<string name="media_transfer_usb_device_mic_name" msgid="7171789543226269822">"USB 마이크"</string>
<string name="media_transfer_bt_device_mic_name" msgid="1870669402238687618">"블루투스 마이크"</string>
<string name="wifi_hotspot_switch_on_text" msgid="9212273118217786155">"사용"</string>
diff --git a/packages/SettingsLib/res/values-ky/strings.xml b/packages/SettingsLib/res/values-ky/strings.xml
index 1884b0326ed2..40bbb35bdec3 100644
--- a/packages/SettingsLib/res/values-ky/strings.xml
+++ b/packages/SettingsLib/res/values-ky/strings.xml
@@ -686,9 +686,11 @@
<string name="cached_apps_freezer_enabled" msgid="8866703500183051546">"Күйүк"</string>
<string name="cached_apps_freezer_reboot_dialog_text" msgid="695330563489230096">"Бул өзгөрүү күчүнө кириши үчүн, түзмөктү өчүрүп күйгүзүңүз. Азыр же кийинчерээк өчүрүп күйгүзсөңүз болот."</string>
<string name="media_transfer_wired_headphone_name" msgid="8698668536022665254">"Зымдуу гарнитура"</string>
- <string name="media_transfer_headphone_name" msgid="1131962659136578852">"Гарнитура"</string>
+ <!-- no translation found for media_transfer_headphone_name (1157798825650178478) -->
+ <skip />
<string name="media_transfer_usb_audio_name" msgid="1789292056757821355">"USB аудио"</string>
- <string name="media_transfer_wired_device_mic_name" msgid="7417067197803840965">"Микрофондун оюкчасы"</string>
+ <!-- no translation found for media_transfer_wired_device_mic_name (7115192790725088698) -->
+ <skip />
<string name="media_transfer_usb_device_mic_name" msgid="7171789543226269822">"USB микрофон"</string>
<string name="media_transfer_bt_device_mic_name" msgid="1870669402238687618">"Bluetooth микрофону"</string>
<string name="wifi_hotspot_switch_on_text" msgid="9212273118217786155">"Күйгүзүү"</string>
diff --git a/packages/SettingsLib/res/values-lo/strings.xml b/packages/SettingsLib/res/values-lo/strings.xml
index 0f83134aeefa..b5f89225eec0 100644
--- a/packages/SettingsLib/res/values-lo/strings.xml
+++ b/packages/SettingsLib/res/values-lo/strings.xml
@@ -686,9 +686,11 @@
<string name="cached_apps_freezer_enabled" msgid="8866703500183051546">"ເປີດການນຳໃຊ້ແລ້ວ"</string>
<string name="cached_apps_freezer_reboot_dialog_text" msgid="695330563489230096">"ທ່ານຕ້ອງປິດເປີດອຸປະກອນຄືນໃໝ່ເພື່ອນຳໃຊ້ການປ່ຽນແປງນີ້. ປິດເປີດໃໝ່ດຽວນີ້ ຫຼື ຍົກເລີກ."</string>
<string name="media_transfer_wired_headphone_name" msgid="8698668536022665254">"ຫູຟັງແບບມີສາຍ"</string>
- <string name="media_transfer_headphone_name" msgid="1131962659136578852">"ຫູຟັງ"</string>
+ <!-- no translation found for media_transfer_headphone_name (1157798825650178478) -->
+ <skip />
<string name="media_transfer_usb_audio_name" msgid="1789292056757821355">"ສຽງ USB"</string>
- <string name="media_transfer_wired_device_mic_name" msgid="7417067197803840965">"ຊ່ອງສຽງໄມ"</string>
+ <!-- no translation found for media_transfer_wired_device_mic_name (7115192790725088698) -->
+ <skip />
<string name="media_transfer_usb_device_mic_name" msgid="7171789543226269822">"ໄມໂຄຣໂຟນ USB"</string>
<string name="media_transfer_bt_device_mic_name" msgid="1870669402238687618">"ໄມໂຄຣໂຟນ BT"</string>
<string name="wifi_hotspot_switch_on_text" msgid="9212273118217786155">"ເປີດ"</string>
diff --git a/packages/SettingsLib/res/values-lt/strings.xml b/packages/SettingsLib/res/values-lt/strings.xml
index 3a81c917eaa6..fd23ecefecfa 100644
--- a/packages/SettingsLib/res/values-lt/strings.xml
+++ b/packages/SettingsLib/res/values-lt/strings.xml
@@ -686,9 +686,11 @@
<string name="cached_apps_freezer_enabled" msgid="8866703500183051546">"Įgalinta"</string>
<string name="cached_apps_freezer_reboot_dialog_text" msgid="695330563489230096">"Kad pakeitimas būtų pritaikytas, įrenginį reikia paleisti iš naujo. Dabar paleiskite iš naujo arba atšaukite."</string>
<string name="media_transfer_wired_headphone_name" msgid="8698668536022665254">"Laidinės ausinės"</string>
- <string name="media_transfer_headphone_name" msgid="1131962659136578852">"Ausinės"</string>
+ <!-- no translation found for media_transfer_headphone_name (1157798825650178478) -->
+ <skip />
<string name="media_transfer_usb_audio_name" msgid="1789292056757821355">"USB garsas"</string>
- <string name="media_transfer_wired_device_mic_name" msgid="7417067197803840965">"Mikrofono jungtis"</string>
+ <!-- no translation found for media_transfer_wired_device_mic_name (7115192790725088698) -->
+ <skip />
<string name="media_transfer_usb_device_mic_name" msgid="7171789543226269822">"USB mikrofonas"</string>
<string name="media_transfer_bt_device_mic_name" msgid="1870669402238687618">"„Bluetooth“ mikrofonas"</string>
<string name="wifi_hotspot_switch_on_text" msgid="9212273118217786155">"Įjungta"</string>
diff --git a/packages/SettingsLib/res/values-lv/strings.xml b/packages/SettingsLib/res/values-lv/strings.xml
index 8e1f20e32ded..4fbbbe9ec028 100644
--- a/packages/SettingsLib/res/values-lv/strings.xml
+++ b/packages/SettingsLib/res/values-lv/strings.xml
@@ -686,9 +686,11 @@
<string name="cached_apps_freezer_enabled" msgid="8866703500183051546">"Iespējots"</string>
<string name="cached_apps_freezer_reboot_dialog_text" msgid="695330563489230096">"Lai šīs izmaiņas tiktu piemērotas, nepieciešama ierīces atkārtota palaišana. Atkārtoti palaidiet to tūlīt vai atceliet izmaiņas."</string>
<string name="media_transfer_wired_headphone_name" msgid="8698668536022665254">"Vadu austiņas"</string>
- <string name="media_transfer_headphone_name" msgid="1131962659136578852">"Austiņas"</string>
+ <!-- no translation found for media_transfer_headphone_name (1157798825650178478) -->
+ <skip />
<string name="media_transfer_usb_audio_name" msgid="1789292056757821355">"USB audio"</string>
- <string name="media_transfer_wired_device_mic_name" msgid="7417067197803840965">"Mikrofona ligzda"</string>
+ <!-- no translation found for media_transfer_wired_device_mic_name (7115192790725088698) -->
+ <skip />
<string name="media_transfer_usb_device_mic_name" msgid="7171789543226269822">"USB mikrofons"</string>
<string name="media_transfer_bt_device_mic_name" msgid="1870669402238687618">"Bluetooth mikrofons"</string>
<string name="wifi_hotspot_switch_on_text" msgid="9212273118217786155">"Ieslēgts"</string>
diff --git a/packages/SettingsLib/res/values-mk/strings.xml b/packages/SettingsLib/res/values-mk/strings.xml
index 66de28295292..ea53b93dab15 100644
--- a/packages/SettingsLib/res/values-mk/strings.xml
+++ b/packages/SettingsLib/res/values-mk/strings.xml
@@ -686,9 +686,11 @@
<string name="cached_apps_freezer_enabled" msgid="8866703500183051546">"Овозможено"</string>
<string name="cached_apps_freezer_reboot_dialog_text" msgid="695330563489230096">"За да се примени променава, уредот мора да се рестартира. Рестартирајте сега или откажете."</string>
<string name="media_transfer_wired_headphone_name" msgid="8698668536022665254">"Жичени слушалки"</string>
- <string name="media_transfer_headphone_name" msgid="1131962659136578852">"Слушалка"</string>
+ <!-- no translation found for media_transfer_headphone_name (1157798825650178478) -->
+ <skip />
<string name="media_transfer_usb_audio_name" msgid="1789292056757821355">"USB-аудио"</string>
- <string name="media_transfer_wired_device_mic_name" msgid="7417067197803840965">"Приклучок за микрофон"</string>
+ <!-- no translation found for media_transfer_wired_device_mic_name (7115192790725088698) -->
+ <skip />
<string name="media_transfer_usb_device_mic_name" msgid="7171789543226269822">"USB-микрофон"</string>
<string name="media_transfer_bt_device_mic_name" msgid="1870669402238687618">"Микрофон со Bluetooth"</string>
<string name="wifi_hotspot_switch_on_text" msgid="9212273118217786155">"Вклучено"</string>
diff --git a/packages/SettingsLib/res/values-ml/strings.xml b/packages/SettingsLib/res/values-ml/strings.xml
index fe2a996c151f..43ac8622a159 100644
--- a/packages/SettingsLib/res/values-ml/strings.xml
+++ b/packages/SettingsLib/res/values-ml/strings.xml
@@ -686,9 +686,11 @@
<string name="cached_apps_freezer_enabled" msgid="8866703500183051546">"പ്രവർത്തനക്ഷമമാക്കി"</string>
<string name="cached_apps_freezer_reboot_dialog_text" msgid="695330563489230096">"ഈ മാറ്റം ബാധകമാകുന്നതിന് നിങ്ങളുടെ ഉപകരണം റീബൂട്ട് ചെയ്യേണ്ടതുണ്ട്. ഇപ്പോൾ റീബൂട്ട് ചെയ്യുകയോ റദ്ദാക്കുകയോ ചെയ്യുക."</string>
<string name="media_transfer_wired_headphone_name" msgid="8698668536022665254">"വയേർഡ് ഹെഡ്ഫോൺ"</string>
- <string name="media_transfer_headphone_name" msgid="1131962659136578852">"ഹെഡ്ഫോൺ"</string>
+ <!-- no translation found for media_transfer_headphone_name (1157798825650178478) -->
+ <skip />
<string name="media_transfer_usb_audio_name" msgid="1789292056757821355">"USB ഓഡിയോ"</string>
- <string name="media_transfer_wired_device_mic_name" msgid="7417067197803840965">"മൈക്ക് ജാക്ക്"</string>
+ <!-- no translation found for media_transfer_wired_device_mic_name (7115192790725088698) -->
+ <skip />
<string name="media_transfer_usb_device_mic_name" msgid="7171789543226269822">"USB മൈക്രോഫോൺ"</string>
<string name="media_transfer_bt_device_mic_name" msgid="1870669402238687618">"BT മൈക്രോഫോൺ"</string>
<string name="wifi_hotspot_switch_on_text" msgid="9212273118217786155">"ഓണാണ്"</string>
diff --git a/packages/SettingsLib/res/values-mn/arrays.xml b/packages/SettingsLib/res/values-mn/arrays.xml
index 2ebbb1318c54..84c707f0eee8 100644
--- a/packages/SettingsLib/res/values-mn/arrays.xml
+++ b/packages/SettingsLib/res/values-mn/arrays.xml
@@ -225,7 +225,7 @@
<string-array name="animator_duration_scale_entries">
<item msgid="6416998593844817378">"Дүрс амилуулалт идэвхгүй"</item>
<item msgid="875345630014338616">"Дүрс амилуулах далайц .5x"</item>
- <item msgid="2753729231187104962">"Дүрс амилуулах далайц 1x"</item>
+ <item msgid="2753729231187104962">"Анимацийн масштаб 1x"</item>
<item msgid="1368370459723665338">"Дүрс амилуулах далайц 1.5x"</item>
<item msgid="5768005350534383389">"Дүрс амилуулалтын далайц 2x"</item>
<item msgid="3728265127284005444">"Дүрс амилуулалтын далайц 5x"</item>
diff --git a/packages/SettingsLib/res/values-mn/strings.xml b/packages/SettingsLib/res/values-mn/strings.xml
index c9668f169f0d..d3b67c752e7c 100644
--- a/packages/SettingsLib/res/values-mn/strings.xml
+++ b/packages/SettingsLib/res/values-mn/strings.xml
@@ -686,9 +686,11 @@
<string name="cached_apps_freezer_enabled" msgid="8866703500183051546">"Идэвхжүүлсэн"</string>
<string name="cached_apps_freezer_reboot_dialog_text" msgid="695330563489230096">"Энэ өөрчлөлтийг хэрэгжүүлэхийн тулд таны төхөөрөмжийг дахин асаах ёстой. Одоо дахин асаах эсвэл цуцлана уу."</string>
<string name="media_transfer_wired_headphone_name" msgid="8698668536022665254">"Утастай чихэвч"</string>
- <string name="media_transfer_headphone_name" msgid="1131962659136578852">"Чихэвч"</string>
+ <!-- no translation found for media_transfer_headphone_name (1157798825650178478) -->
+ <skip />
<string name="media_transfer_usb_audio_name" msgid="1789292056757821355">"USB аудио"</string>
- <string name="media_transfer_wired_device_mic_name" msgid="7417067197803840965">"Микрофоны чихэвчний оролт"</string>
+ <!-- no translation found for media_transfer_wired_device_mic_name (7115192790725088698) -->
+ <skip />
<string name="media_transfer_usb_device_mic_name" msgid="7171789543226269822">"USB микрофон"</string>
<string name="media_transfer_bt_device_mic_name" msgid="1870669402238687618">"BT микрофон"</string>
<string name="wifi_hotspot_switch_on_text" msgid="9212273118217786155">"Асаах"</string>
diff --git a/packages/SettingsLib/res/values-mr/strings.xml b/packages/SettingsLib/res/values-mr/strings.xml
index 600779d1a915..9d22c0060f9e 100644
--- a/packages/SettingsLib/res/values-mr/strings.xml
+++ b/packages/SettingsLib/res/values-mr/strings.xml
@@ -686,9 +686,11 @@
<string name="cached_apps_freezer_enabled" msgid="8866703500183051546">"सुरू केले आहे"</string>
<string name="cached_apps_freezer_reboot_dialog_text" msgid="695330563489230096">"हा बदल लागू करण्यासाठी तुमचे डिव्हाइस रीबूट करणे आवश्यक आहे. आता रीबूट करा किंवा रद्द करा."</string>
<string name="media_transfer_wired_headphone_name" msgid="8698668536022665254">"वायर्ड हेडफोन"</string>
- <string name="media_transfer_headphone_name" msgid="1131962659136578852">"हेडफोन"</string>
+ <!-- no translation found for media_transfer_headphone_name (1157798825650178478) -->
+ <skip />
<string name="media_transfer_usb_audio_name" msgid="1789292056757821355">"USB ऑडिओ"</string>
- <string name="media_transfer_wired_device_mic_name" msgid="7417067197803840965">"माइक जॅक"</string>
+ <!-- no translation found for media_transfer_wired_device_mic_name (7115192790725088698) -->
+ <skip />
<string name="media_transfer_usb_device_mic_name" msgid="7171789543226269822">"USB मायक्रोफोन"</string>
<string name="media_transfer_bt_device_mic_name" msgid="1870669402238687618">"BT मायक्रोफोन"</string>
<string name="wifi_hotspot_switch_on_text" msgid="9212273118217786155">"सुरू करा"</string>
diff --git a/packages/SettingsLib/res/values-ms/strings.xml b/packages/SettingsLib/res/values-ms/strings.xml
index d4eb1baabeab..22ff9dd5d41a 100644
--- a/packages/SettingsLib/res/values-ms/strings.xml
+++ b/packages/SettingsLib/res/values-ms/strings.xml
@@ -686,9 +686,11 @@
<string name="cached_apps_freezer_enabled" msgid="8866703500183051546">"Didayakan"</string>
<string name="cached_apps_freezer_reboot_dialog_text" msgid="695330563489230096">"Peranti anda mesti dibut semula supaya perubahan ini berlaku. But semula sekarang atau batalkan."</string>
<string name="media_transfer_wired_headphone_name" msgid="8698668536022665254">"Fon kepala berwayar"</string>
- <string name="media_transfer_headphone_name" msgid="1131962659136578852">"Fon kepala"</string>
+ <!-- no translation found for media_transfer_headphone_name (1157798825650178478) -->
+ <skip />
<string name="media_transfer_usb_audio_name" msgid="1789292056757821355">"Audio USB"</string>
- <string name="media_transfer_wired_device_mic_name" msgid="7417067197803840965">"Bicu mikrofon"</string>
+ <!-- no translation found for media_transfer_wired_device_mic_name (7115192790725088698) -->
+ <skip />
<string name="media_transfer_usb_device_mic_name" msgid="7171789543226269822">"Mikrofon USB"</string>
<string name="media_transfer_bt_device_mic_name" msgid="1870669402238687618">"Mikrofon BT"</string>
<string name="wifi_hotspot_switch_on_text" msgid="9212273118217786155">"Hidup"</string>
diff --git a/packages/SettingsLib/res/values-my/strings.xml b/packages/SettingsLib/res/values-my/strings.xml
index 92f9cbbb4c2b..9a337128786d 100644
--- a/packages/SettingsLib/res/values-my/strings.xml
+++ b/packages/SettingsLib/res/values-my/strings.xml
@@ -686,9 +686,11 @@
<string name="cached_apps_freezer_enabled" msgid="8866703500183051546">"ဖွင့်ထားသည်"</string>
<string name="cached_apps_freezer_reboot_dialog_text" msgid="695330563489230096">"ဤအပြောင်းအလဲ ထည့်သွင်းရန် သင့်စက်ကို ပြန်လည်စတင်ရမည်။ ယခု ပြန်လည်စတင်ပါ သို့မဟုတ် ပယ်ဖျက်ပါ။"</string>
<string name="media_transfer_wired_headphone_name" msgid="8698668536022665254">"ကြိုးတပ်နားကြပ်"</string>
- <string name="media_transfer_headphone_name" msgid="1131962659136578852">"နားကြပ်"</string>
+ <!-- no translation found for media_transfer_headphone_name (1157798825650178478) -->
+ <skip />
<string name="media_transfer_usb_audio_name" msgid="1789292056757821355">"USB အသံ"</string>
- <string name="media_transfer_wired_device_mic_name" msgid="7417067197803840965">"မိုက်ဂျက်ပင်"</string>
+ <!-- no translation found for media_transfer_wired_device_mic_name (7115192790725088698) -->
+ <skip />
<string name="media_transfer_usb_device_mic_name" msgid="7171789543226269822">"USB မိုက်ခရိုဖုန်း"</string>
<string name="media_transfer_bt_device_mic_name" msgid="1870669402238687618">"BT မိုက်ခရိုဖုန်း"</string>
<string name="wifi_hotspot_switch_on_text" msgid="9212273118217786155">"ဖွင့်"</string>
diff --git a/packages/SettingsLib/res/values-nb/strings.xml b/packages/SettingsLib/res/values-nb/strings.xml
index 83f40afbc9b3..3b03d739673a 100644
--- a/packages/SettingsLib/res/values-nb/strings.xml
+++ b/packages/SettingsLib/res/values-nb/strings.xml
@@ -686,9 +686,11 @@
<string name="cached_apps_freezer_enabled" msgid="8866703500183051546">"Slått på"</string>
<string name="cached_apps_freezer_reboot_dialog_text" msgid="695330563489230096">"Enheten din må startes på nytt for at denne endringen skal tre i kraft. Start på nytt nå eller avbryt."</string>
<string name="media_transfer_wired_headphone_name" msgid="8698668536022665254">"Hodetelefoner med kabel"</string>
- <string name="media_transfer_headphone_name" msgid="1131962659136578852">"Hodetelefoner"</string>
+ <!-- no translation found for media_transfer_headphone_name (1157798825650178478) -->
+ <skip />
<string name="media_transfer_usb_audio_name" msgid="1789292056757821355">"USB-lyd"</string>
- <string name="media_transfer_wired_device_mic_name" msgid="7417067197803840965">"Mikrofonkontakt"</string>
+ <!-- no translation found for media_transfer_wired_device_mic_name (7115192790725088698) -->
+ <skip />
<string name="media_transfer_usb_device_mic_name" msgid="7171789543226269822">"USB-mikrofon"</string>
<string name="media_transfer_bt_device_mic_name" msgid="1870669402238687618">"BT-mikrofon"</string>
<string name="wifi_hotspot_switch_on_text" msgid="9212273118217786155">"På"</string>
diff --git a/packages/SettingsLib/res/values-ne/strings.xml b/packages/SettingsLib/res/values-ne/strings.xml
index d9d12db7369f..84c8466abfaa 100644
--- a/packages/SettingsLib/res/values-ne/strings.xml
+++ b/packages/SettingsLib/res/values-ne/strings.xml
@@ -686,9 +686,11 @@
<string name="cached_apps_freezer_enabled" msgid="8866703500183051546">"सक्षम पारिएको छ"</string>
<string name="cached_apps_freezer_reboot_dialog_text" msgid="695330563489230096">"यो परिवर्तन लागू गर्न तपाईंको यन्त्र अनिवार्य रूपमा रिबुट गर्नु पर्छ। अहिले रिबुट गर्नुहोस् वा रद्द गर्नुहोस्।"</string>
<string name="media_transfer_wired_headphone_name" msgid="8698668536022665254">"तारयुक्त हेडफोन"</string>
- <string name="media_transfer_headphone_name" msgid="1131962659136578852">"हेडफोन"</string>
+ <!-- no translation found for media_transfer_headphone_name (1157798825650178478) -->
+ <skip />
<string name="media_transfer_usb_audio_name" msgid="1789292056757821355">"USB अडियो"</string>
- <string name="media_transfer_wired_device_mic_name" msgid="7417067197803840965">"माइकको ज्याक"</string>
+ <!-- no translation found for media_transfer_wired_device_mic_name (7115192790725088698) -->
+ <skip />
<string name="media_transfer_usb_device_mic_name" msgid="7171789543226269822">"USB माइक्रोफोन"</string>
<string name="media_transfer_bt_device_mic_name" msgid="1870669402238687618">"BT माइक्रोफोन"</string>
<string name="wifi_hotspot_switch_on_text" msgid="9212273118217786155">"अन छ"</string>
diff --git a/packages/SettingsLib/res/values-nl/strings.xml b/packages/SettingsLib/res/values-nl/strings.xml
index f5b54093e659..83df29acd836 100644
--- a/packages/SettingsLib/res/values-nl/strings.xml
+++ b/packages/SettingsLib/res/values-nl/strings.xml
@@ -686,9 +686,11 @@
<string name="cached_apps_freezer_enabled" msgid="8866703500183051546">"Aan"</string>
<string name="cached_apps_freezer_reboot_dialog_text" msgid="695330563489230096">"Je apparaat moet opnieuw worden opgestart om deze wijziging toe te passen. Start nu opnieuw op of annuleer de wijziging."</string>
<string name="media_transfer_wired_headphone_name" msgid="8698668536022665254">"Bedrade koptelefoon"</string>
- <string name="media_transfer_headphone_name" msgid="1131962659136578852">"Koptelefoon"</string>
+ <!-- no translation found for media_transfer_headphone_name (1157798825650178478) -->
+ <skip />
<string name="media_transfer_usb_audio_name" msgid="1789292056757821355">"USB-audio"</string>
- <string name="media_transfer_wired_device_mic_name" msgid="7417067197803840965">"Microfoonaansluiting"</string>
+ <!-- no translation found for media_transfer_wired_device_mic_name (7115192790725088698) -->
+ <skip />
<string name="media_transfer_usb_device_mic_name" msgid="7171789543226269822">"USB-microfoon"</string>
<string name="media_transfer_bt_device_mic_name" msgid="1870669402238687618">"BT-microfoon"</string>
<string name="wifi_hotspot_switch_on_text" msgid="9212273118217786155">"Aan"</string>
diff --git a/packages/SettingsLib/res/values-or/strings.xml b/packages/SettingsLib/res/values-or/strings.xml
index 508d2fcd3564..d03c8f30502e 100644
--- a/packages/SettingsLib/res/values-or/strings.xml
+++ b/packages/SettingsLib/res/values-or/strings.xml
@@ -686,9 +686,11 @@
<string name="cached_apps_freezer_enabled" msgid="8866703500183051546">"ସକ୍ଷମ କରାଯାଇଛି"</string>
<string name="cached_apps_freezer_reboot_dialog_text" msgid="695330563489230096">"ଏହି ପରିବର୍ତ୍ତନ ଲାଗୁ କରିବା ପାଇଁ ଆପଣଙ୍କ ଡିଭାଇସକୁ ନିଶ୍ଚିତ ରୂପେ ରିବୁଟ୍ କରାଯିବା ଆବଶ୍ୟକ। ବର୍ତ୍ତମାନ ରିବୁଟ୍ କରନ୍ତୁ କିମ୍ବା ବାତିଲ କରନ୍ତୁ।"</string>
<string name="media_transfer_wired_headphone_name" msgid="8698668536022665254">"ତାରଯୁକ୍ତ ହେଡଫୋନ"</string>
- <string name="media_transfer_headphone_name" msgid="1131962659136578852">"ହେଡଫୋନ"</string>
+ <!-- no translation found for media_transfer_headphone_name (1157798825650178478) -->
+ <skip />
<string name="media_transfer_usb_audio_name" msgid="1789292056757821355">"USB ଅଡିଓ"</string>
- <string name="media_transfer_wired_device_mic_name" msgid="7417067197803840965">"ମାଇକ ଜେକ"</string>
+ <!-- no translation found for media_transfer_wired_device_mic_name (7115192790725088698) -->
+ <skip />
<string name="media_transfer_usb_device_mic_name" msgid="7171789543226269822">"USB ମାଇକ୍ରୋଫୋନ"</string>
<string name="media_transfer_bt_device_mic_name" msgid="1870669402238687618">"BT ମାଇକ୍ରୋଫୋନ"</string>
<string name="wifi_hotspot_switch_on_text" msgid="9212273118217786155">"ଚାଲୁ ଅଛି"</string>
diff --git a/packages/SettingsLib/res/values-pa/strings.xml b/packages/SettingsLib/res/values-pa/strings.xml
index ebff08d9ec79..1d482076ca59 100644
--- a/packages/SettingsLib/res/values-pa/strings.xml
+++ b/packages/SettingsLib/res/values-pa/strings.xml
@@ -686,9 +686,11 @@
<string name="cached_apps_freezer_enabled" msgid="8866703500183051546">"ਚਾਲੂ ਕੀਤਾ ਗਿਆ"</string>
<string name="cached_apps_freezer_reboot_dialog_text" msgid="695330563489230096">"ਇਸ ਤਬਦੀਲੀ ਨੂੰ ਲਾਗੂ ਕਰਨ ਲਈ ਤੁਹਾਡੇ ਡੀਵਾਈਸ ਨੂੰ ਰੀਬੂਟ ਕਰਨਾ ਲਾਜ਼ਮੀ ਹੈ। ਹੁਣੇ ਰੀਬੂਟ ਕਰੋ ਜਾਂ ਰੱਦ ਕਰੋ।"</string>
<string name="media_transfer_wired_headphone_name" msgid="8698668536022665254">"ਤਾਰ ਵਾਲੇ ਹੈੱਡਫ਼ੋਨ"</string>
- <string name="media_transfer_headphone_name" msgid="1131962659136578852">"ਹੈੱਡਫ਼ੋਨ"</string>
+ <!-- no translation found for media_transfer_headphone_name (1157798825650178478) -->
+ <skip />
<string name="media_transfer_usb_audio_name" msgid="1789292056757821355">"USB ਆਡੀਓ"</string>
- <string name="media_transfer_wired_device_mic_name" msgid="7417067197803840965">"ਮਾਈਕ ਜੈਕ"</string>
+ <!-- no translation found for media_transfer_wired_device_mic_name (7115192790725088698) -->
+ <skip />
<string name="media_transfer_usb_device_mic_name" msgid="7171789543226269822">"USB ਮਾਈਕ੍ਰੋਫ਼ੋਨ"</string>
<string name="media_transfer_bt_device_mic_name" msgid="1870669402238687618">"BT ਮਾਈਕ੍ਰੋਫ਼ੋਨ"</string>
<string name="wifi_hotspot_switch_on_text" msgid="9212273118217786155">"ਚਾਲੂ"</string>
diff --git a/packages/SettingsLib/res/values-pl/strings.xml b/packages/SettingsLib/res/values-pl/strings.xml
index e5cd6f0bbdb6..e8492d33e39f 100644
--- a/packages/SettingsLib/res/values-pl/strings.xml
+++ b/packages/SettingsLib/res/values-pl/strings.xml
@@ -686,9 +686,9 @@
<string name="cached_apps_freezer_enabled" msgid="8866703500183051546">"Włączono"</string>
<string name="cached_apps_freezer_reboot_dialog_text" msgid="695330563489230096">"Wprowadzenie zmiany wymaga ponownego uruchomienia urządzenia. Uruchom ponownie teraz lub anuluj."</string>
<string name="media_transfer_wired_headphone_name" msgid="8698668536022665254">"Słuchawki przewodowe"</string>
- <string name="media_transfer_headphone_name" msgid="1131962659136578852">"Słuchawki"</string>
+ <string name="media_transfer_headphone_name" msgid="1157798825650178478">"Przewodowe urządzenie audio"</string>
<string name="media_transfer_usb_audio_name" msgid="1789292056757821355">"Dźwięk przez USB"</string>
- <string name="media_transfer_wired_device_mic_name" msgid="7417067197803840965">"Gniazdo mikrofonu"</string>
+ <string name="media_transfer_wired_device_mic_name" msgid="7115192790725088698">"Mikrofon przewodowy"</string>
<string name="media_transfer_usb_device_mic_name" msgid="7171789543226269822">"Mikrofon USB"</string>
<string name="media_transfer_bt_device_mic_name" msgid="1870669402238687618">"Mikrofon Bluetooth"</string>
<string name="wifi_hotspot_switch_on_text" msgid="9212273118217786155">"Włączono"</string>
diff --git a/packages/SettingsLib/res/values-pt-rBR/arrays.xml b/packages/SettingsLib/res/values-pt-rBR/arrays.xml
index 96f0c1a5b2ce..bb18c4719c72 100644
--- a/packages/SettingsLib/res/values-pt-rBR/arrays.xml
+++ b/packages/SettingsLib/res/values-pt-rBR/arrays.xml
@@ -206,19 +206,19 @@
</string-array>
<string-array name="window_animation_scale_entries">
<item msgid="2675263395797191850">"Animação desligada"</item>
- <item msgid="5790132543372767872">"Escala da animação 0,5 x"</item>
- <item msgid="2529692189302148746">"Escala da animação 1x"</item>
+ <item msgid="5790132543372767872">"Escala de animação 0,5 x"</item>
+ <item msgid="2529692189302148746">"Escala de animação 1x"</item>
<item msgid="8072785072237082286">"Escala de animação 1,5 x"</item>
- <item msgid="3531560925718232560">"Escala da animação 2x"</item>
+ <item msgid="3531560925718232560">"Escala de animação 2x"</item>
<item msgid="4542853094898215187">"Escala de animação 5 x"</item>
<item msgid="5643881346223901195">"Escala de animação 10 x"</item>
</string-array>
<string-array name="transition_animation_scale_entries">
<item msgid="3376676813923486384">"Animação desligada"</item>
- <item msgid="753422683600269114">"Escala da animação 0,5 x"</item>
- <item msgid="3695427132155563489">"Escala da animação 1x"</item>
+ <item msgid="753422683600269114">"Escala de animação 0,5 x"</item>
+ <item msgid="3695427132155563489">"Escala de animação 1x"</item>
<item msgid="9032615844198098981">"Escala de animação 1,5 x"</item>
- <item msgid="8473868962499332073">"Escala da animação 2x"</item>
+ <item msgid="8473868962499332073">"Escala de animação 2x"</item>
<item msgid="4403482320438668316">"Escala de animação 5 x"</item>
<item msgid="169579387974966641">"Escala de animação 10 x"</item>
</string-array>
diff --git a/packages/SettingsLib/res/values-pt-rBR/strings.xml b/packages/SettingsLib/res/values-pt-rBR/strings.xml
index 7bc0db9fef8d..20bd69a2e15e 100644
--- a/packages/SettingsLib/res/values-pt-rBR/strings.xml
+++ b/packages/SettingsLib/res/values-pt-rBR/strings.xml
@@ -417,8 +417,8 @@
<string name="verbose_vendor_logging_preference_summary_will_disable" msgid="6175431593394522553">"É desativado depois de 1 dia"</string>
<string name="verbose_vendor_logging_preference_summary_on" msgid="9017757242481762036">"Ativado indefinidamente"</string>
<string name="window_animation_scale_title" msgid="5236381298376812508">"Escala de animação da janela"</string>
- <string name="transition_animation_scale_title" msgid="1278477690695439337">"Escala de animação de transição"</string>
- <string name="animator_duration_scale_title" msgid="7082913931326085176">"Escala de duração do Animator"</string>
+ <string name="transition_animation_scale_title" msgid="1278477690695439337">"Escala anim. de transição"</string>
+ <string name="animator_duration_scale_title" msgid="7082913931326085176">"Escala duração Animator"</string>
<string name="overlay_display_devices_title" msgid="5411894622334469607">"Simular telas secundárias"</string>
<string name="debug_applications_category" msgid="5394089406638954196">"Apps"</string>
<string name="immediately_destroy_activities" msgid="1826287490705167403">"Não manter atividades"</string>
@@ -686,9 +686,11 @@
<string name="cached_apps_freezer_enabled" msgid="8866703500183051546">"Ativado"</string>
<string name="cached_apps_freezer_reboot_dialog_text" msgid="695330563489230096">"É necessário reinicializar o dispositivo para que a mudança seja aplicada. Faça isso agora ou cancele."</string>
<string name="media_transfer_wired_headphone_name" msgid="8698668536022665254">"Fones de ouvido com fio"</string>
- <string name="media_transfer_headphone_name" msgid="1131962659136578852">"Fone de ouvido"</string>
+ <!-- no translation found for media_transfer_headphone_name (1157798825650178478) -->
+ <skip />
<string name="media_transfer_usb_audio_name" msgid="1789292056757821355">"Áudio USB"</string>
- <string name="media_transfer_wired_device_mic_name" msgid="7417067197803840965">"Entrada para microfone"</string>
+ <!-- no translation found for media_transfer_wired_device_mic_name (7115192790725088698) -->
+ <skip />
<string name="media_transfer_usb_device_mic_name" msgid="7171789543226269822">"Microfone USB"</string>
<string name="media_transfer_bt_device_mic_name" msgid="1870669402238687618">"Microfone Bluetooth"</string>
<string name="wifi_hotspot_switch_on_text" msgid="9212273118217786155">"Ativado"</string>
diff --git a/packages/SettingsLib/res/values-pt-rPT/strings.xml b/packages/SettingsLib/res/values-pt-rPT/strings.xml
index 94a21c8bc36d..488dd5aa5652 100644
--- a/packages/SettingsLib/res/values-pt-rPT/strings.xml
+++ b/packages/SettingsLib/res/values-pt-rPT/strings.xml
@@ -686,9 +686,11 @@
<string name="cached_apps_freezer_enabled" msgid="8866703500183051546">"Ativada"</string>
<string name="cached_apps_freezer_reboot_dialog_text" msgid="695330563489230096">"É necessário reiniciar o dispositivo para aplicar esta alteração. Reinicie agora ou cancele."</string>
<string name="media_transfer_wired_headphone_name" msgid="8698668536022665254">"Auscultadores com fios"</string>
- <string name="media_transfer_headphone_name" msgid="1131962659136578852">"Auscultadores"</string>
+ <!-- no translation found for media_transfer_headphone_name (1157798825650178478) -->
+ <skip />
<string name="media_transfer_usb_audio_name" msgid="1789292056757821355">"Áudio USB"</string>
- <string name="media_transfer_wired_device_mic_name" msgid="7417067197803840965">"Entrada para microfone"</string>
+ <!-- no translation found for media_transfer_wired_device_mic_name (7115192790725088698) -->
+ <skip />
<string name="media_transfer_usb_device_mic_name" msgid="7171789543226269822">"Microfone USB"</string>
<string name="media_transfer_bt_device_mic_name" msgid="1870669402238687618">"Microfone BT"</string>
<string name="wifi_hotspot_switch_on_text" msgid="9212273118217786155">"Ligado"</string>
diff --git a/packages/SettingsLib/res/values-pt/arrays.xml b/packages/SettingsLib/res/values-pt/arrays.xml
index 96f0c1a5b2ce..bb18c4719c72 100644
--- a/packages/SettingsLib/res/values-pt/arrays.xml
+++ b/packages/SettingsLib/res/values-pt/arrays.xml
@@ -206,19 +206,19 @@
</string-array>
<string-array name="window_animation_scale_entries">
<item msgid="2675263395797191850">"Animação desligada"</item>
- <item msgid="5790132543372767872">"Escala da animação 0,5 x"</item>
- <item msgid="2529692189302148746">"Escala da animação 1x"</item>
+ <item msgid="5790132543372767872">"Escala de animação 0,5 x"</item>
+ <item msgid="2529692189302148746">"Escala de animação 1x"</item>
<item msgid="8072785072237082286">"Escala de animação 1,5 x"</item>
- <item msgid="3531560925718232560">"Escala da animação 2x"</item>
+ <item msgid="3531560925718232560">"Escala de animação 2x"</item>
<item msgid="4542853094898215187">"Escala de animação 5 x"</item>
<item msgid="5643881346223901195">"Escala de animação 10 x"</item>
</string-array>
<string-array name="transition_animation_scale_entries">
<item msgid="3376676813923486384">"Animação desligada"</item>
- <item msgid="753422683600269114">"Escala da animação 0,5 x"</item>
- <item msgid="3695427132155563489">"Escala da animação 1x"</item>
+ <item msgid="753422683600269114">"Escala de animação 0,5 x"</item>
+ <item msgid="3695427132155563489">"Escala de animação 1x"</item>
<item msgid="9032615844198098981">"Escala de animação 1,5 x"</item>
- <item msgid="8473868962499332073">"Escala da animação 2x"</item>
+ <item msgid="8473868962499332073">"Escala de animação 2x"</item>
<item msgid="4403482320438668316">"Escala de animação 5 x"</item>
<item msgid="169579387974966641">"Escala de animação 10 x"</item>
</string-array>
diff --git a/packages/SettingsLib/res/values-pt/strings.xml b/packages/SettingsLib/res/values-pt/strings.xml
index 7bc0db9fef8d..20bd69a2e15e 100644
--- a/packages/SettingsLib/res/values-pt/strings.xml
+++ b/packages/SettingsLib/res/values-pt/strings.xml
@@ -417,8 +417,8 @@
<string name="verbose_vendor_logging_preference_summary_will_disable" msgid="6175431593394522553">"É desativado depois de 1 dia"</string>
<string name="verbose_vendor_logging_preference_summary_on" msgid="9017757242481762036">"Ativado indefinidamente"</string>
<string name="window_animation_scale_title" msgid="5236381298376812508">"Escala de animação da janela"</string>
- <string name="transition_animation_scale_title" msgid="1278477690695439337">"Escala de animação de transição"</string>
- <string name="animator_duration_scale_title" msgid="7082913931326085176">"Escala de duração do Animator"</string>
+ <string name="transition_animation_scale_title" msgid="1278477690695439337">"Escala anim. de transição"</string>
+ <string name="animator_duration_scale_title" msgid="7082913931326085176">"Escala duração Animator"</string>
<string name="overlay_display_devices_title" msgid="5411894622334469607">"Simular telas secundárias"</string>
<string name="debug_applications_category" msgid="5394089406638954196">"Apps"</string>
<string name="immediately_destroy_activities" msgid="1826287490705167403">"Não manter atividades"</string>
@@ -686,9 +686,11 @@
<string name="cached_apps_freezer_enabled" msgid="8866703500183051546">"Ativado"</string>
<string name="cached_apps_freezer_reboot_dialog_text" msgid="695330563489230096">"É necessário reinicializar o dispositivo para que a mudança seja aplicada. Faça isso agora ou cancele."</string>
<string name="media_transfer_wired_headphone_name" msgid="8698668536022665254">"Fones de ouvido com fio"</string>
- <string name="media_transfer_headphone_name" msgid="1131962659136578852">"Fone de ouvido"</string>
+ <!-- no translation found for media_transfer_headphone_name (1157798825650178478) -->
+ <skip />
<string name="media_transfer_usb_audio_name" msgid="1789292056757821355">"Áudio USB"</string>
- <string name="media_transfer_wired_device_mic_name" msgid="7417067197803840965">"Entrada para microfone"</string>
+ <!-- no translation found for media_transfer_wired_device_mic_name (7115192790725088698) -->
+ <skip />
<string name="media_transfer_usb_device_mic_name" msgid="7171789543226269822">"Microfone USB"</string>
<string name="media_transfer_bt_device_mic_name" msgid="1870669402238687618">"Microfone Bluetooth"</string>
<string name="wifi_hotspot_switch_on_text" msgid="9212273118217786155">"Ativado"</string>
diff --git a/packages/SettingsLib/res/values-ro/strings.xml b/packages/SettingsLib/res/values-ro/strings.xml
index 47ae7efe2652..edd03560c176 100644
--- a/packages/SettingsLib/res/values-ro/strings.xml
+++ b/packages/SettingsLib/res/values-ro/strings.xml
@@ -686,9 +686,11 @@
<string name="cached_apps_freezer_enabled" msgid="8866703500183051546">"Activat"</string>
<string name="cached_apps_freezer_reboot_dialog_text" msgid="695330563489230096">"Pentru ca modificarea să se aplice, trebuie să repornești dispozitivul. Repornește-l acum sau anulează."</string>
<string name="media_transfer_wired_headphone_name" msgid="8698668536022665254">"Căști cu fir"</string>
- <string name="media_transfer_headphone_name" msgid="1131962659136578852">"Căști"</string>
+ <!-- no translation found for media_transfer_headphone_name (1157798825650178478) -->
+ <skip />
<string name="media_transfer_usb_audio_name" msgid="1789292056757821355">"Audio USB"</string>
- <string name="media_transfer_wired_device_mic_name" msgid="7417067197803840965">"Mufă pentru microfon"</string>
+ <!-- no translation found for media_transfer_wired_device_mic_name (7115192790725088698) -->
+ <skip />
<string name="media_transfer_usb_device_mic_name" msgid="7171789543226269822">"Microfon USB"</string>
<string name="media_transfer_bt_device_mic_name" msgid="1870669402238687618">"Microfon BT"</string>
<string name="wifi_hotspot_switch_on_text" msgid="9212273118217786155">"Activat"</string>
diff --git a/packages/SettingsLib/res/values-ru/strings.xml b/packages/SettingsLib/res/values-ru/strings.xml
index 1342321d6dbf..55fbfa5711ba 100644
--- a/packages/SettingsLib/res/values-ru/strings.xml
+++ b/packages/SettingsLib/res/values-ru/strings.xml
@@ -686,9 +686,11 @@
<string name="cached_apps_freezer_enabled" msgid="8866703500183051546">"Включено"</string>
<string name="cached_apps_freezer_reboot_dialog_text" msgid="695330563489230096">"Чтобы изменение вступило в силу, необходимо перезапустить устройство. Вы можете сделать это сейчас или позже."</string>
<string name="media_transfer_wired_headphone_name" msgid="8698668536022665254">"Проводные наушники"</string>
- <string name="media_transfer_headphone_name" msgid="1131962659136578852">"Наушники"</string>
+ <!-- no translation found for media_transfer_headphone_name (1157798825650178478) -->
+ <skip />
<string name="media_transfer_usb_audio_name" msgid="1789292056757821355">"USB-аудиоустройство"</string>
- <string name="media_transfer_wired_device_mic_name" msgid="7417067197803840965">"Микрофонный разъем"</string>
+ <!-- no translation found for media_transfer_wired_device_mic_name (7115192790725088698) -->
+ <skip />
<string name="media_transfer_usb_device_mic_name" msgid="7171789543226269822">"USB-микрофон"</string>
<string name="media_transfer_bt_device_mic_name" msgid="1870669402238687618">"Bluetooth-микрофон"</string>
<string name="wifi_hotspot_switch_on_text" msgid="9212273118217786155">"Вкл."</string>
diff --git a/packages/SettingsLib/res/values-si/strings.xml b/packages/SettingsLib/res/values-si/strings.xml
index be0356ad2cb9..d48824a744b4 100644
--- a/packages/SettingsLib/res/values-si/strings.xml
+++ b/packages/SettingsLib/res/values-si/strings.xml
@@ -686,9 +686,11 @@
<string name="cached_apps_freezer_enabled" msgid="8866703500183051546">"සබලයි"</string>
<string name="cached_apps_freezer_reboot_dialog_text" msgid="695330563489230096">"මෙම වෙනස යෙදීමට ඔබේ උපාංගය නැවත පණ ගැන්විය යුතුය. දැන් නැවත පණ ගන්වන්න හෝ අවලංගු කරන්න."</string>
<string name="media_transfer_wired_headphone_name" msgid="8698668536022665254">"රැහැන්ගත හෙඩ්ෆෝන්"</string>
- <string name="media_transfer_headphone_name" msgid="1131962659136578852">"හෙඩ්ෆෝන්"</string>
+ <!-- no translation found for media_transfer_headphone_name (1157798825650178478) -->
+ <skip />
<string name="media_transfer_usb_audio_name" msgid="1789292056757821355">"USB ශ්‍රව්‍ය"</string>
- <string name="media_transfer_wired_device_mic_name" msgid="7417067197803840965">"මයික් ජැක්කුව"</string>
+ <!-- no translation found for media_transfer_wired_device_mic_name (7115192790725088698) -->
+ <skip />
<string name="media_transfer_usb_device_mic_name" msgid="7171789543226269822">"USB මයික්‍රෆෝනය"</string>
<string name="media_transfer_bt_device_mic_name" msgid="1870669402238687618">"BT මයික්‍රෆෝනය"</string>
<string name="wifi_hotspot_switch_on_text" msgid="9212273118217786155">"ක්‍රියාත්මකයි"</string>
diff --git a/packages/SettingsLib/res/values-sk/strings.xml b/packages/SettingsLib/res/values-sk/strings.xml
index e3a8a8cc2507..b80748296ad0 100644
--- a/packages/SettingsLib/res/values-sk/strings.xml
+++ b/packages/SettingsLib/res/values-sk/strings.xml
@@ -686,9 +686,11 @@
<string name="cached_apps_freezer_enabled" msgid="8866703500183051546">"Zapnuté"</string>
<string name="cached_apps_freezer_reboot_dialog_text" msgid="695330563489230096">"Zmena sa prejaví až po reštarte zariadenia. Môžete ho teraz reštartovať alebo akciu zrušiť."</string>
<string name="media_transfer_wired_headphone_name" msgid="8698668536022665254">"Slúchadlá s káblom"</string>
- <string name="media_transfer_headphone_name" msgid="1131962659136578852">"Slúchadlá"</string>
+ <!-- no translation found for media_transfer_headphone_name (1157798825650178478) -->
+ <skip />
<string name="media_transfer_usb_audio_name" msgid="1789292056757821355">"Zvuk cez USB"</string>
- <string name="media_transfer_wired_device_mic_name" msgid="7417067197803840965">"Konektor mikrofónu"</string>
+ <!-- no translation found for media_transfer_wired_device_mic_name (7115192790725088698) -->
+ <skip />
<string name="media_transfer_usb_device_mic_name" msgid="7171789543226269822">"Mikrofón s rozhraním USB"</string>
<string name="media_transfer_bt_device_mic_name" msgid="1870669402238687618">"Mikrofón Bluetooth"</string>
<string name="wifi_hotspot_switch_on_text" msgid="9212273118217786155">"Zapnúť"</string>
diff --git a/packages/SettingsLib/res/values-sl/strings.xml b/packages/SettingsLib/res/values-sl/strings.xml
index 717e7baf3634..a4c0622f368c 100644
--- a/packages/SettingsLib/res/values-sl/strings.xml
+++ b/packages/SettingsLib/res/values-sl/strings.xml
@@ -686,9 +686,11 @@
<string name="cached_apps_freezer_enabled" msgid="8866703500183051546">"Omogočeno"</string>
<string name="cached_apps_freezer_reboot_dialog_text" msgid="695330563489230096">"Napravo je treba znova zagnati, da bo ta sprememba uveljavljena. Znova zaženite zdaj ali prekličite."</string>
<string name="media_transfer_wired_headphone_name" msgid="8698668536022665254">"Žične slušalke"</string>
- <string name="media_transfer_headphone_name" msgid="1131962659136578852">"Slušalke"</string>
+ <!-- no translation found for media_transfer_headphone_name (1157798825650178478) -->
+ <skip />
<string name="media_transfer_usb_audio_name" msgid="1789292056757821355">"Zvok USB"</string>
- <string name="media_transfer_wired_device_mic_name" msgid="7417067197803840965">"Vtič za mikrofon"</string>
+ <!-- no translation found for media_transfer_wired_device_mic_name (7115192790725088698) -->
+ <skip />
<string name="media_transfer_usb_device_mic_name" msgid="7171789543226269822">"Mikrofon USB"</string>
<string name="media_transfer_bt_device_mic_name" msgid="1870669402238687618">"Mikrofon Bluetooth"</string>
<string name="wifi_hotspot_switch_on_text" msgid="9212273118217786155">"Vklop"</string>
diff --git a/packages/SettingsLib/res/values-sq/strings.xml b/packages/SettingsLib/res/values-sq/strings.xml
index 97e6c7d62a59..19c42119d26e 100644
--- a/packages/SettingsLib/res/values-sq/strings.xml
+++ b/packages/SettingsLib/res/values-sq/strings.xml
@@ -686,9 +686,11 @@
<string name="cached_apps_freezer_enabled" msgid="8866703500183051546">"Aktiv"</string>
<string name="cached_apps_freezer_reboot_dialog_text" msgid="695330563489230096">"Pajisja jote duhet të riniset që ky ndryshim të zbatohet. Rinise tani ose anuloje."</string>
<string name="media_transfer_wired_headphone_name" msgid="8698668536022665254">"Kufje me tela"</string>
- <string name="media_transfer_headphone_name" msgid="1131962659136578852">"Kufje"</string>
+ <!-- no translation found for media_transfer_headphone_name (1157798825650178478) -->
+ <skip />
<string name="media_transfer_usb_audio_name" msgid="1789292056757821355">"Pajisja audio me USB"</string>
- <string name="media_transfer_wired_device_mic_name" msgid="7417067197803840965">"Fisha e mikrofonit"</string>
+ <!-- no translation found for media_transfer_wired_device_mic_name (7115192790725088698) -->
+ <skip />
<string name="media_transfer_usb_device_mic_name" msgid="7171789543226269822">"Mikrofoni me USB"</string>
<string name="media_transfer_bt_device_mic_name" msgid="1870669402238687618">"Mikrofoni me Bluetooth"</string>
<string name="wifi_hotspot_switch_on_text" msgid="9212273118217786155">"Aktive"</string>
diff --git a/packages/SettingsLib/res/values-sr/strings.xml b/packages/SettingsLib/res/values-sr/strings.xml
index 3cf73a75c703..1862910ff94a 100644
--- a/packages/SettingsLib/res/values-sr/strings.xml
+++ b/packages/SettingsLib/res/values-sr/strings.xml
@@ -686,9 +686,11 @@
<string name="cached_apps_freezer_enabled" msgid="8866703500183051546">"Омогућено"</string>
<string name="cached_apps_freezer_reboot_dialog_text" msgid="695330563489230096">"Морате да рестартујете уређај да би се ова промена применила. Рестартујте га одмах или откажите."</string>
<string name="media_transfer_wired_headphone_name" msgid="8698668536022665254">"Жичане слушалице"</string>
- <string name="media_transfer_headphone_name" msgid="1131962659136578852">"Слушалице"</string>
+ <!-- no translation found for media_transfer_headphone_name (1157798825650178478) -->
+ <skip />
<string name="media_transfer_usb_audio_name" msgid="1789292056757821355">"USB аудио"</string>
- <string name="media_transfer_wired_device_mic_name" msgid="7417067197803840965">"Утикач за микрофон"</string>
+ <!-- no translation found for media_transfer_wired_device_mic_name (7115192790725088698) -->
+ <skip />
<string name="media_transfer_usb_device_mic_name" msgid="7171789543226269822">"USB микрофон"</string>
<string name="media_transfer_bt_device_mic_name" msgid="1870669402238687618">"Bluetooth микрофон"</string>
<string name="wifi_hotspot_switch_on_text" msgid="9212273118217786155">"Укључено"</string>
diff --git a/packages/SettingsLib/res/values-sv/strings.xml b/packages/SettingsLib/res/values-sv/strings.xml
index 9586a0c86b67..1ee80c5fb822 100644
--- a/packages/SettingsLib/res/values-sv/strings.xml
+++ b/packages/SettingsLib/res/values-sv/strings.xml
@@ -686,9 +686,11 @@
<string name="cached_apps_freezer_enabled" msgid="8866703500183051546">"Aktiverat"</string>
<string name="cached_apps_freezer_reboot_dialog_text" msgid="695330563489230096">"Enheten måste startas om för att ändringen ska börja gälla. Starta om nu eller avbryt."</string>
<string name="media_transfer_wired_headphone_name" msgid="8698668536022665254">"Hörlur med kabel"</string>
- <string name="media_transfer_headphone_name" msgid="1131962659136578852">"Hörlur"</string>
+ <!-- no translation found for media_transfer_headphone_name (1157798825650178478) -->
+ <skip />
<string name="media_transfer_usb_audio_name" msgid="1789292056757821355">"USB-ljud"</string>
- <string name="media_transfer_wired_device_mic_name" msgid="7417067197803840965">"Mikrofonuttag"</string>
+ <!-- no translation found for media_transfer_wired_device_mic_name (7115192790725088698) -->
+ <skip />
<string name="media_transfer_usb_device_mic_name" msgid="7171789543226269822">"USB-mikrofon"</string>
<string name="media_transfer_bt_device_mic_name" msgid="1870669402238687618">"BT-mikrofon"</string>
<string name="wifi_hotspot_switch_on_text" msgid="9212273118217786155">"På"</string>
diff --git a/packages/SettingsLib/res/values-sw/strings.xml b/packages/SettingsLib/res/values-sw/strings.xml
index 8f0b246b1a8c..d33eafe24b69 100644
--- a/packages/SettingsLib/res/values-sw/strings.xml
+++ b/packages/SettingsLib/res/values-sw/strings.xml
@@ -686,9 +686,11 @@
<string name="cached_apps_freezer_enabled" msgid="8866703500183051546">"Imewashwa"</string>
<string name="cached_apps_freezer_reboot_dialog_text" msgid="695330563489230096">"Ni lazima uwashe tena kifaa chako ili mabadiliko haya yatekelezwe. Washa tena sasa au ughairi."</string>
<string name="media_transfer_wired_headphone_name" msgid="8698668536022665254">"Kipokea sauti cha kichwani chenye waya"</string>
- <string name="media_transfer_headphone_name" msgid="1131962659136578852">"Kipokea sauti cha kichwani"</string>
+ <!-- no translation found for media_transfer_headphone_name (1157798825650178478) -->
+ <skip />
<string name="media_transfer_usb_audio_name" msgid="1789292056757821355">"Sauti ya USB"</string>
- <string name="media_transfer_wired_device_mic_name" msgid="7417067197803840965">"Pini ya maikrofoni"</string>
+ <!-- no translation found for media_transfer_wired_device_mic_name (7115192790725088698) -->
+ <skip />
<string name="media_transfer_usb_device_mic_name" msgid="7171789543226269822">"Maikrofoni ya USB"</string>
<string name="media_transfer_bt_device_mic_name" msgid="1870669402238687618">"Maikrofoni ya Bluetooth"</string>
<string name="wifi_hotspot_switch_on_text" msgid="9212273118217786155">"Umewashwa"</string>
diff --git a/packages/SettingsLib/res/values-ta/strings.xml b/packages/SettingsLib/res/values-ta/strings.xml
index e1a697cdf1bd..2c0781d6837c 100644
--- a/packages/SettingsLib/res/values-ta/strings.xml
+++ b/packages/SettingsLib/res/values-ta/strings.xml
@@ -686,9 +686,11 @@
<string name="cached_apps_freezer_enabled" msgid="8866703500183051546">"இயக்கப்பட்டது"</string>
<string name="cached_apps_freezer_reboot_dialog_text" msgid="695330563489230096">"இந்த மாற்றங்கள் செயல்படுத்தப்பட உங்கள் சாதனத்தை மறுபடி தொடங்க வேண்டும். இப்போதே மறுபடி தொடங்கவும் அல்லது ரத்துசெய்யவும்."</string>
<string name="media_transfer_wired_headphone_name" msgid="8698668536022665254">"வயர்டு ஹெட்ஃபோன்"</string>
- <string name="media_transfer_headphone_name" msgid="1131962659136578852">"ஹெட்ஃபோன்"</string>
+ <!-- no translation found for media_transfer_headphone_name (1157798825650178478) -->
+ <skip />
<string name="media_transfer_usb_audio_name" msgid="1789292056757821355">"USB ஆடியோ"</string>
- <string name="media_transfer_wired_device_mic_name" msgid="7417067197803840965">"மைக் ஜாக்"</string>
+ <!-- no translation found for media_transfer_wired_device_mic_name (7115192790725088698) -->
+ <skip />
<string name="media_transfer_usb_device_mic_name" msgid="7171789543226269822">"USB மைக்ரோஃபோன்"</string>
<string name="media_transfer_bt_device_mic_name" msgid="1870669402238687618">"BT மைக்ரோஃபோன்"</string>
<string name="wifi_hotspot_switch_on_text" msgid="9212273118217786155">"ஆன்"</string>
diff --git a/packages/SettingsLib/res/values-te/strings.xml b/packages/SettingsLib/res/values-te/strings.xml
index 22e539ba7da0..145af84985b5 100644
--- a/packages/SettingsLib/res/values-te/strings.xml
+++ b/packages/SettingsLib/res/values-te/strings.xml
@@ -686,9 +686,11 @@
<string name="cached_apps_freezer_enabled" msgid="8866703500183051546">"ఎనేబుల్ చేయబడింది"</string>
<string name="cached_apps_freezer_reboot_dialog_text" msgid="695330563489230096">"ఈ మార్పును వర్తింపజేయాలంటే మీరు మీ పరికరాన్ని తప్పనిసరిగా రీబూట్ చేయాలి. ఇప్పుడే రీబూట్ చేయండి లేదా రద్దు చేయండి."</string>
<string name="media_transfer_wired_headphone_name" msgid="8698668536022665254">"వైర్ ఉన్న హెడ్‌ఫోన్"</string>
- <string name="media_transfer_headphone_name" msgid="1131962659136578852">"హెడ్‌ఫోన్"</string>
+ <!-- no translation found for media_transfer_headphone_name (1157798825650178478) -->
+ <skip />
<string name="media_transfer_usb_audio_name" msgid="1789292056757821355">"USB ఆడియో"</string>
- <string name="media_transfer_wired_device_mic_name" msgid="7417067197803840965">"మైక్ జాక్"</string>
+ <!-- no translation found for media_transfer_wired_device_mic_name (7115192790725088698) -->
+ <skip />
<string name="media_transfer_usb_device_mic_name" msgid="7171789543226269822">"USB మైక్రోఫోన్"</string>
<string name="media_transfer_bt_device_mic_name" msgid="1870669402238687618">"BT మైక్రోఫోన్"</string>
<string name="wifi_hotspot_switch_on_text" msgid="9212273118217786155">"ఆన్‌లో ఉంది"</string>
diff --git a/packages/SettingsLib/res/values-th/strings.xml b/packages/SettingsLib/res/values-th/strings.xml
index c9d9309a3ba6..ae6585c51081 100644
--- a/packages/SettingsLib/res/values-th/strings.xml
+++ b/packages/SettingsLib/res/values-th/strings.xml
@@ -686,9 +686,11 @@
<string name="cached_apps_freezer_enabled" msgid="8866703500183051546">"เปิดใช้"</string>
<string name="cached_apps_freezer_reboot_dialog_text" msgid="695330563489230096">"คุณต้องรีบูตอุปกรณ์เพื่อให้การเปลี่ยนแปลงนี้มีผล รีบูตเลยหรือยกเลิก"</string>
<string name="media_transfer_wired_headphone_name" msgid="8698668536022665254">"หูฟังแบบใช้สาย"</string>
- <string name="media_transfer_headphone_name" msgid="1131962659136578852">"หูฟัง"</string>
+ <!-- no translation found for media_transfer_headphone_name (1157798825650178478) -->
+ <skip />
<string name="media_transfer_usb_audio_name" msgid="1789292056757821355">"เสียง USB"</string>
- <string name="media_transfer_wired_device_mic_name" msgid="7417067197803840965">"ช่องเสียบไมค์"</string>
+ <!-- no translation found for media_transfer_wired_device_mic_name (7115192790725088698) -->
+ <skip />
<string name="media_transfer_usb_device_mic_name" msgid="7171789543226269822">"ไมโครโฟน USB"</string>
<string name="media_transfer_bt_device_mic_name" msgid="1870669402238687618">"ไมโครโฟน BT"</string>
<string name="wifi_hotspot_switch_on_text" msgid="9212273118217786155">"เปิด"</string>
diff --git a/packages/SettingsLib/res/values-tl/strings.xml b/packages/SettingsLib/res/values-tl/strings.xml
index 5d7ed8720a00..6e60e2b65932 100644
--- a/packages/SettingsLib/res/values-tl/strings.xml
+++ b/packages/SettingsLib/res/values-tl/strings.xml
@@ -686,9 +686,11 @@
<string name="cached_apps_freezer_enabled" msgid="8866703500183051546">"Na-enable"</string>
<string name="cached_apps_freezer_reboot_dialog_text" msgid="695330563489230096">"Dapat i-reboot ang iyong device para mailapat ang pagbabagong ito. Mag-reboot ngayon o kanselahin."</string>
<string name="media_transfer_wired_headphone_name" msgid="8698668536022665254">"Wired na headphone"</string>
- <string name="media_transfer_headphone_name" msgid="1131962659136578852">"Headphone"</string>
+ <!-- no translation found for media_transfer_headphone_name (1157798825650178478) -->
+ <skip />
<string name="media_transfer_usb_audio_name" msgid="1789292056757821355">"USB audio"</string>
- <string name="media_transfer_wired_device_mic_name" msgid="7417067197803840965">"Jack ng mikropono"</string>
+ <!-- no translation found for media_transfer_wired_device_mic_name (7115192790725088698) -->
+ <skip />
<string name="media_transfer_usb_device_mic_name" msgid="7171789543226269822">"USB na mikropono"</string>
<string name="media_transfer_bt_device_mic_name" msgid="1870669402238687618">"BT na mikropono"</string>
<string name="wifi_hotspot_switch_on_text" msgid="9212273118217786155">"Naka-on"</string>
diff --git a/packages/SettingsLib/res/values-tr/strings.xml b/packages/SettingsLib/res/values-tr/strings.xml
index 9e4b6f2d22f8..8d709b9f3916 100644
--- a/packages/SettingsLib/res/values-tr/strings.xml
+++ b/packages/SettingsLib/res/values-tr/strings.xml
@@ -686,9 +686,11 @@
<string name="cached_apps_freezer_enabled" msgid="8866703500183051546">"Etkin"</string>
<string name="cached_apps_freezer_reboot_dialog_text" msgid="695330563489230096">"Bu değişikliğin geçerli olması için cihazınızın yeniden başlatılması gerekir. Şimdi yeniden başlatın veya iptal edin."</string>
<string name="media_transfer_wired_headphone_name" msgid="8698668536022665254">"Kablolu kulaklık"</string>
- <string name="media_transfer_headphone_name" msgid="1131962659136578852">"Kulaklık"</string>
+ <!-- no translation found for media_transfer_headphone_name (1157798825650178478) -->
+ <skip />
<string name="media_transfer_usb_audio_name" msgid="1789292056757821355">"USB ses cihazı"</string>
- <string name="media_transfer_wired_device_mic_name" msgid="7417067197803840965">"Mikrofon jakı"</string>
+ <!-- no translation found for media_transfer_wired_device_mic_name (7115192790725088698) -->
+ <skip />
<string name="media_transfer_usb_device_mic_name" msgid="7171789543226269822">"USB mikrofon"</string>
<string name="media_transfer_bt_device_mic_name" msgid="1870669402238687618">"BT mikrofonu"</string>
<string name="wifi_hotspot_switch_on_text" msgid="9212273118217786155">"Açık"</string>
diff --git a/packages/SettingsLib/res/values-uk/strings.xml b/packages/SettingsLib/res/values-uk/strings.xml
index 75c6b54dde1d..7b1086ca303f 100644
--- a/packages/SettingsLib/res/values-uk/strings.xml
+++ b/packages/SettingsLib/res/values-uk/strings.xml
@@ -686,9 +686,11 @@
<string name="cached_apps_freezer_enabled" msgid="8866703500183051546">"Увімкнено"</string>
<string name="cached_apps_freezer_reboot_dialog_text" msgid="695330563489230096">"Щоб застосувати ці зміни, потрібний перезапуск. Перезапустіть пристрій або скасуйте зміни."</string>
<string name="media_transfer_wired_headphone_name" msgid="8698668536022665254">"Дротові навушники"</string>
- <string name="media_transfer_headphone_name" msgid="1131962659136578852">"Навушники"</string>
+ <!-- no translation found for media_transfer_headphone_name (1157798825650178478) -->
+ <skip />
<string name="media_transfer_usb_audio_name" msgid="1789292056757821355">"USB-аудіо"</string>
- <string name="media_transfer_wired_device_mic_name" msgid="7417067197803840965">"Гніздо для мікрофона"</string>
+ <!-- no translation found for media_transfer_wired_device_mic_name (7115192790725088698) -->
+ <skip />
<string name="media_transfer_usb_device_mic_name" msgid="7171789543226269822">"USB-мікрофон"</string>
<string name="media_transfer_bt_device_mic_name" msgid="1870669402238687618">"Bluetooth-мікрофон"</string>
<string name="wifi_hotspot_switch_on_text" msgid="9212273118217786155">"Увімкнено"</string>
diff --git a/packages/SettingsLib/res/values-ur/strings.xml b/packages/SettingsLib/res/values-ur/strings.xml
index ebd2845d4799..db00474f0750 100644
--- a/packages/SettingsLib/res/values-ur/strings.xml
+++ b/packages/SettingsLib/res/values-ur/strings.xml
@@ -94,7 +94,7 @@
<string name="bluetooth_connected_no_headset_battery_level" msgid="2661863370509206428">"منسلک ہے (فون کے علاوہ)، بیٹری <xliff:g id="BATTERY_LEVEL_AS_PERCENTAGE">%1$s</xliff:g><xliff:g id="ACTIVE_DEVICE">%2$s</xliff:g>"</string>
<string name="bluetooth_connected_no_a2dp_battery_level" msgid="6499078454894324287">"منسلک ہے (میڈیا کے علاوہ)، بیٹری <xliff:g id="BATTERY_LEVEL_AS_PERCENTAGE">%1$s</xliff:g><xliff:g id="ACTIVE_DEVICE">%2$s</xliff:g>"</string>
<string name="bluetooth_connected_no_headset_no_a2dp_battery_level" msgid="8477440576953067242">"منسلک ہے (فون یا میڈیا کے علاوہ)، بیٹری <xliff:g id="BATTERY_LEVEL_AS_PERCENTAGE">%1$s</xliff:g><xliff:g id="ACTIVE_DEVICE">%2$s</xliff:g>"</string>
- <string name="bluetooth_active_battery_level" msgid="2685517576209066008">"فعال۔ <xliff:g id="BATTERY_LEVEL_AS_PERCENTAGE">%1$s</xliff:g> بیٹری۔"</string>
+ <string name="bluetooth_active_battery_level" msgid="2685517576209066008">"‏فعال۔ ‎<xliff:g id="BATTERY_LEVEL_AS_PERCENTAGE">%1$s</xliff:g> بیٹری۔"</string>
<string name="bluetooth_active_battery_level_untethered" msgid="4961338936672922617">"‏فعال۔ L: <xliff:g id="BATTERY_LEVEL_AS_PERCENTAGE_0">%1$s</xliff:g>، ‏R: <xliff:g id="BATTERY_LEVEL_AS_PERCENTAGE_1">%2$s</xliff:g> بیٹری۔"</string>
<string name="bluetooth_active_battery_level_untethered_left" msgid="2895644748625343977">"فعال ہے۔ بایاں: <xliff:g id="BATTERY_LEVEL_AS_PERCENTAGE">%1$s</xliff:g> بیٹری۔"</string>
<string name="bluetooth_active_battery_level_untethered_right" msgid="7407517998880370179">"فعال ہے۔ دایاں: <xliff:g id="BATTERY_LEVEL_AS_PERCENTAGE">%1$s</xliff:g> بیٹری۔"</string>
@@ -112,7 +112,7 @@
<string name="bluetooth_hearing_aid_left_and_right_active" msgid="4294571497939983181">"فعال ہے (بایاں اور دایاں)"</string>
<string name="bluetooth_active_media_only_battery_level" msgid="7772517511061834073">"فعال (صرف میڈیا)۔ <xliff:g id="BATTERY_LEVEL_AS_PERCENTAGE">%1$s</xliff:g> بیٹری۔"</string>
<string name="bluetooth_active_media_only_battery_level_untethered" msgid="7444753133664620926">"‏فعال (صرف میڈیا)۔ L: <xliff:g id="BATTERY_LEVEL_AS_PERCENTAGE_0">%1$s</xliff:g>، ‏R: <xliff:g id="BATTERY_LEVEL_AS_PERCENTAGE_1">%2$s</xliff:g> بیٹری۔"</string>
- <string name="bluetooth_battery_level_lea_support" msgid="5968584103507988820">"منسلک ہے (آڈیو کے اشتراک کو سپورٹ کرتا ہے)۔ <xliff:g id="BATTERY_LEVEL_AS_PERCENTAGE">%1$s</xliff:g> بیٹری۔"</string>
+ <string name="bluetooth_battery_level_lea_support" msgid="5968584103507988820">"‏منسلک ہے (آڈیو کے اشتراک کو سپورٹ کرتا ہے)۔ ‎<xliff:g id="BATTERY_LEVEL_AS_PERCENTAGE">%1$s</xliff:g> بیٹری۔"</string>
<string name="bluetooth_battery_level_untethered_lea_support" msgid="803110681688633362">"‏منسلک ہے (آڈیو کے اشتراک کو سپورٹ کرتا ہے)۔ L: <xliff:g id="BATTERY_LEVEL_AS_PERCENTAGE_0">%1$s</xliff:g>، ‏R: <xliff:g id="BATTERY_LEVEL_AS_PERCENTAGE_1">%2$s</xliff:g> بیٹری۔"</string>
<string name="bluetooth_battery_level_untethered_left_lea_support" msgid="7707464334346454950">"منسلک ہے (آڈیو کے اشتراک کو سپورٹ کرتا ہے)۔ بائيں: <xliff:g id="BATTERY_LEVEL_AS_PERCENTAGE">%1$s</xliff:g> بیٹری۔"</string>
<string name="bluetooth_battery_level_untethered_right_lea_support" msgid="8941549024377771038">"منسلک ہے (آڈیو کے اشتراک کو سپورٹ کرتا ہے)۔ دائيں: <xliff:g id="BATTERY_LEVEL_AS_PERCENTAGE">%1$s</xliff:g> بیٹری۔"</string>
@@ -686,9 +686,11 @@
<string name="cached_apps_freezer_enabled" msgid="8866703500183051546">"فعال"</string>
<string name="cached_apps_freezer_reboot_dialog_text" msgid="695330563489230096">"اس تبدیلی کو لاگو کرنے کے ليے آپ کے آلہ کو ریبوٹ کرنا ضروری ہے۔ ابھی ریبوٹ کریں یا منسوخ کریں۔"</string>
<string name="media_transfer_wired_headphone_name" msgid="8698668536022665254">"تار والا ہیڈ فون"</string>
- <string name="media_transfer_headphone_name" msgid="1131962659136578852">"ہیڈ فون"</string>
+ <!-- no translation found for media_transfer_headphone_name (1157798825650178478) -->
+ <skip />
<string name="media_transfer_usb_audio_name" msgid="1789292056757821355">"‏‫USB آڈیو"</string>
- <string name="media_transfer_wired_device_mic_name" msgid="7417067197803840965">"مائیک جیک"</string>
+ <!-- no translation found for media_transfer_wired_device_mic_name (7115192790725088698) -->
+ <skip />
<string name="media_transfer_usb_device_mic_name" msgid="7171789543226269822">"‏‫USB مائیکروفون"</string>
<string name="media_transfer_bt_device_mic_name" msgid="1870669402238687618">"‏‫BT مائیکروفون"</string>
<string name="wifi_hotspot_switch_on_text" msgid="9212273118217786155">"آن"</string>
diff --git a/packages/SettingsLib/res/values-uz/strings.xml b/packages/SettingsLib/res/values-uz/strings.xml
index 60fdf932f95f..833863e2eee7 100644
--- a/packages/SettingsLib/res/values-uz/strings.xml
+++ b/packages/SettingsLib/res/values-uz/strings.xml
@@ -686,9 +686,11 @@
<string name="cached_apps_freezer_enabled" msgid="8866703500183051546">"Yoniq"</string>
<string name="cached_apps_freezer_reboot_dialog_text" msgid="695330563489230096">"Oʻzgarishlar kuchga kirishi uchun qurilmani oʻchirib yoqing. Buni hozir yoki keyinroq bajarishingiz mumkin."</string>
<string name="media_transfer_wired_headphone_name" msgid="8698668536022665254">"Simli quloqlik"</string>
- <string name="media_transfer_headphone_name" msgid="1131962659136578852">"Quloqlik"</string>
+ <!-- no translation found for media_transfer_headphone_name (1157798825650178478) -->
+ <skip />
<string name="media_transfer_usb_audio_name" msgid="1789292056757821355">"USB audio"</string>
- <string name="media_transfer_wired_device_mic_name" msgid="7417067197803840965">"Mikrofon ulagichi"</string>
+ <!-- no translation found for media_transfer_wired_device_mic_name (7115192790725088698) -->
+ <skip />
<string name="media_transfer_usb_device_mic_name" msgid="7171789543226269822">"USB mikrofon"</string>
<string name="media_transfer_bt_device_mic_name" msgid="1870669402238687618">"Bluetooth mikrofon"</string>
<string name="wifi_hotspot_switch_on_text" msgid="9212273118217786155">"Yoniq"</string>
diff --git a/packages/SettingsLib/res/values-vi/strings.xml b/packages/SettingsLib/res/values-vi/strings.xml
index dbd270fb2e57..fba3a13864b5 100644
--- a/packages/SettingsLib/res/values-vi/strings.xml
+++ b/packages/SettingsLib/res/values-vi/strings.xml
@@ -686,9 +686,11 @@
<string name="cached_apps_freezer_enabled" msgid="8866703500183051546">"Đã bật"</string>
<string name="cached_apps_freezer_reboot_dialog_text" msgid="695330563489230096">"Bạn phải khởi động lại thiết bị để áp dụng sự thay đổi này. Hãy khởi động lại ngay hoặc hủy."</string>
<string name="media_transfer_wired_headphone_name" msgid="8698668536022665254">"Tai nghe có dây"</string>
- <string name="media_transfer_headphone_name" msgid="1131962659136578852">"Tai nghe"</string>
+ <!-- no translation found for media_transfer_headphone_name (1157798825650178478) -->
+ <skip />
<string name="media_transfer_usb_audio_name" msgid="1789292056757821355">"Âm thanh qua cổng USB"</string>
- <string name="media_transfer_wired_device_mic_name" msgid="7417067197803840965">"Giắc cắm micrô"</string>
+ <!-- no translation found for media_transfer_wired_device_mic_name (7115192790725088698) -->
+ <skip />
<string name="media_transfer_usb_device_mic_name" msgid="7171789543226269822">"Micrô USB"</string>
<string name="media_transfer_bt_device_mic_name" msgid="1870669402238687618">"Micrô BT"</string>
<string name="wifi_hotspot_switch_on_text" msgid="9212273118217786155">"Đang bật"</string>
diff --git a/packages/SettingsLib/res/values-zh-rCN/strings.xml b/packages/SettingsLib/res/values-zh-rCN/strings.xml
index 5c50e7faf398..29a4590878cf 100644
--- a/packages/SettingsLib/res/values-zh-rCN/strings.xml
+++ b/packages/SettingsLib/res/values-zh-rCN/strings.xml
@@ -686,9 +686,11 @@
<string name="cached_apps_freezer_enabled" msgid="8866703500183051546">"已启用"</string>
<string name="cached_apps_freezer_reboot_dialog_text" msgid="695330563489230096">"设备必须重新启动才能应用此更改。您可以立即重新启动或取消。"</string>
<string name="media_transfer_wired_headphone_name" msgid="8698668536022665254">"有线耳机"</string>
- <string name="media_transfer_headphone_name" msgid="1131962659136578852">"头戴式耳机"</string>
+ <!-- no translation found for media_transfer_headphone_name (1157798825650178478) -->
+ <skip />
<string name="media_transfer_usb_audio_name" msgid="1789292056757821355">"USB 音频"</string>
- <string name="media_transfer_wired_device_mic_name" msgid="7417067197803840965">"麦克风插孔"</string>
+ <!-- no translation found for media_transfer_wired_device_mic_name (7115192790725088698) -->
+ <skip />
<string name="media_transfer_usb_device_mic_name" msgid="7171789543226269822">"USB 麦克风"</string>
<string name="media_transfer_bt_device_mic_name" msgid="1870669402238687618">"蓝牙麦克风"</string>
<string name="wifi_hotspot_switch_on_text" msgid="9212273118217786155">"开启"</string>
diff --git a/packages/SettingsLib/res/values-zh-rHK/strings.xml b/packages/SettingsLib/res/values-zh-rHK/strings.xml
index 877fa7b10d9b..71fd6eec762b 100644
--- a/packages/SettingsLib/res/values-zh-rHK/strings.xml
+++ b/packages/SettingsLib/res/values-zh-rHK/strings.xml
@@ -686,9 +686,11 @@
<string name="cached_apps_freezer_enabled" msgid="8866703500183051546">"已啟用"</string>
<string name="cached_apps_freezer_reboot_dialog_text" msgid="695330563489230096">"你的裝置必須重新開機,才能套用此變更。請立即重新開機或取消。"</string>
<string name="media_transfer_wired_headphone_name" msgid="8698668536022665254">"有線耳機"</string>
- <string name="media_transfer_headphone_name" msgid="1131962659136578852">"耳機"</string>
+ <!-- no translation found for media_transfer_headphone_name (1157798825650178478) -->
+ <skip />
<string name="media_transfer_usb_audio_name" msgid="1789292056757821355">"USB 音訊"</string>
- <string name="media_transfer_wired_device_mic_name" msgid="7417067197803840965">"麥克風插孔"</string>
+ <!-- no translation found for media_transfer_wired_device_mic_name (7115192790725088698) -->
+ <skip />
<string name="media_transfer_usb_device_mic_name" msgid="7171789543226269822">"USB 麥克風"</string>
<string name="media_transfer_bt_device_mic_name" msgid="1870669402238687618">"藍牙麥克風"</string>
<string name="wifi_hotspot_switch_on_text" msgid="9212273118217786155">"開啟"</string>
diff --git a/packages/SettingsLib/res/values-zh-rTW/strings.xml b/packages/SettingsLib/res/values-zh-rTW/strings.xml
index fa016ba028e7..b5700bcb31ea 100644
--- a/packages/SettingsLib/res/values-zh-rTW/strings.xml
+++ b/packages/SettingsLib/res/values-zh-rTW/strings.xml
@@ -686,9 +686,11 @@
<string name="cached_apps_freezer_enabled" msgid="8866703500183051546">"已啟用"</string>
<string name="cached_apps_freezer_reboot_dialog_text" msgid="695330563489230096">"裝置必須重新啟動才能套用這項變更。請立即重新啟動或取消變更。"</string>
<string name="media_transfer_wired_headphone_name" msgid="8698668536022665254">"有線耳機"</string>
- <string name="media_transfer_headphone_name" msgid="1131962659136578852">"耳機"</string>
+ <!-- no translation found for media_transfer_headphone_name (1157798825650178478) -->
+ <skip />
<string name="media_transfer_usb_audio_name" msgid="1789292056757821355">"USB 音訊"</string>
- <string name="media_transfer_wired_device_mic_name" msgid="7417067197803840965">"麥克風插孔"</string>
+ <!-- no translation found for media_transfer_wired_device_mic_name (7115192790725088698) -->
+ <skip />
<string name="media_transfer_usb_device_mic_name" msgid="7171789543226269822">"USB 麥克風"</string>
<string name="media_transfer_bt_device_mic_name" msgid="1870669402238687618">"藍牙麥克風"</string>
<string name="wifi_hotspot_switch_on_text" msgid="9212273118217786155">"開啟"</string>
diff --git a/packages/SettingsLib/res/values-zu/strings.xml b/packages/SettingsLib/res/values-zu/strings.xml
index 063b6e7937ea..2f822b35a704 100644
--- a/packages/SettingsLib/res/values-zu/strings.xml
+++ b/packages/SettingsLib/res/values-zu/strings.xml
@@ -686,9 +686,11 @@
<string name="cached_apps_freezer_enabled" msgid="8866703500183051546">"Inikwe amandla"</string>
<string name="cached_apps_freezer_reboot_dialog_text" msgid="695330563489230096">"Kufanele idivayisi yakho iqaliswe ukuze lolu shintsho lusebenze. Qalisa manje noma khansela."</string>
<string name="media_transfer_wired_headphone_name" msgid="8698668536022665254">"Amahedifoni anentambo"</string>
- <string name="media_transfer_headphone_name" msgid="1131962659136578852">"Amahedifoni"</string>
+ <!-- no translation found for media_transfer_headphone_name (1157798825650178478) -->
+ <skip />
<string name="media_transfer_usb_audio_name" msgid="1789292056757821355">"Umsindo we-USB"</string>
- <string name="media_transfer_wired_device_mic_name" msgid="7417067197803840965">"Umgodi we-earphone ye-mic"</string>
+ <!-- no translation found for media_transfer_wired_device_mic_name (7115192790725088698) -->
+ <skip />
<string name="media_transfer_usb_device_mic_name" msgid="7171789543226269822">"Imakrofoni ye-USB"</string>
<string name="media_transfer_bt_device_mic_name" msgid="1870669402238687618">"Imakrofoni ye-BT"</string>
<string name="wifi_hotspot_switch_on_text" msgid="9212273118217786155">"Vuliwe"</string>
diff --git a/packages/SettingsLib/src/com/android/settingslib/display/DisplayDensityUtils.java b/packages/SettingsLib/src/com/android/settingslib/display/DisplayDensityUtils.java
index d4d2b48fcc04..d91c6bd8e639 100644
--- a/packages/SettingsLib/src/com/android/settingslib/display/DisplayDensityUtils.java
+++ b/packages/SettingsLib/src/com/android/settingslib/display/DisplayDensityUtils.java
@@ -30,11 +30,12 @@ import android.view.DisplayInfo;
import android.view.IWindowManager;
import android.view.WindowManagerGlobal;
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+
import com.android.settingslib.R;
import java.util.Arrays;
-import java.util.HashMap;
-import java.util.Map;
import java.util.function.Predicate;
/**
@@ -82,38 +83,55 @@ public class DisplayDensityUtils {
private final DisplayManager mDisplayManager;
/**
- * The text description of the density values of the default display.
- */
- private String[] mDefaultDisplayDensityEntries;
-
- /**
- * The density values of the default display.
+ * The text description of the density values.
*/
- private int[] mDefaultDisplayDensityValues;
+ @Nullable
+ private final String[] mEntries;
/**
- * The density values, indexed by display unique ID.
+ * The density values.
*/
- private final Map<String, int[]> mValuesPerDisplay = new HashMap();
+ @Nullable
+ private final int[] mValues;
- private int mDefaultDensityForDefaultDisplay;
- private int mCurrentIndex = -1;
+ private final int mDefaultDensity;
+ private final int mCurrentIndex;
- public DisplayDensityUtils(Context context) {
+ public DisplayDensityUtils(@NonNull Context context) {
this(context, INTERNAL_ONLY);
}
/**
- * Creates an instance that stores the density values for the displays that satisfy
- * the predicate.
+ * Creates an instance that stores the density values for the smallest display that satisfies
+ * the predicate. It is enough to store the values for one display because the same density
+ * should be set to all the displays that satisfy the predicate.
* @param context The context
* @param predicate Determines what displays the density should be set for. The default display
* must satisfy this predicate.
*/
- public DisplayDensityUtils(Context context, Predicate predicate) {
+ public DisplayDensityUtils(@NonNull Context context,
+ @NonNull Predicate<DisplayInfo> predicate) {
mPredicate = predicate;
mDisplayManager = context.getSystemService(DisplayManager.class);
+ Display defaultDisplay = mDisplayManager.getDisplay(Display.DEFAULT_DISPLAY);
+ DisplayInfo defaultDisplayInfo = new DisplayInfo();
+ if (!defaultDisplay.getDisplayInfo(defaultDisplayInfo)) {
+ Log.w(LOG_TAG, "Cannot fetch display info for the default display");
+ mEntries = null;
+ mValues = null;
+ mDefaultDensity = 0;
+ mCurrentIndex = -1;
+ return;
+ }
+ if (!mPredicate.test(defaultDisplayInfo)) {
+ throw new IllegalArgumentException(
+ "Predicate must not filter out the default display.");
+ }
+
+ int idOfSmallestDisplay = Display.DEFAULT_DISPLAY;
+ int minDimensionPx = Math.min(defaultDisplayInfo.logicalWidth,
+ defaultDisplayInfo.logicalHeight);
for (Display display : mDisplayManager.getDisplays(
DisplayManager.DISPLAY_CATEGORY_ALL_INCLUDING_DISABLED)) {
DisplayInfo info = new DisplayInfo();
@@ -122,121 +140,123 @@ public class DisplayDensityUtils {
continue;
}
if (!mPredicate.test(info)) {
- if (display.getDisplayId() == Display.DEFAULT_DISPLAY) {
- throw new IllegalArgumentException("Predicate must not filter out the default "
- + "display.");
- }
continue;
}
-
- final int defaultDensity = DisplayDensityUtils.getDefaultDensityForDisplay(
- display.getDisplayId());
- if (defaultDensity <= 0) {
- Log.w(LOG_TAG, "Cannot fetch default density for display "
- + display.getDisplayId());
- continue;
+ int minDimension = Math.min(info.logicalWidth, info.logicalHeight);
+ if (minDimension < minDimensionPx) {
+ minDimensionPx = minDimension;
+ idOfSmallestDisplay = display.getDisplayId();
}
+ }
- final Resources res = context.getResources();
-
- final int currentDensity = info.logicalDensityDpi;
- int currentDensityIndex = -1;
-
- // Compute number of "larger" and "smaller" scales for this display.
- final int minDimensionPx = Math.min(info.logicalWidth, info.logicalHeight);
- final int maxDensity =
- DisplayMetrics.DENSITY_MEDIUM * minDimensionPx / MIN_DIMENSION_DP;
- final float maxScaleDimen = context.getResources().getFraction(
- R.fraction.display_density_max_scale, 1, 1);
- final float maxScale = Math.min(maxScaleDimen, maxDensity / (float) defaultDensity);
- final float minScale = context.getResources().getFraction(
- R.fraction.display_density_min_scale, 1, 1);
- final float minScaleInterval = context.getResources().getFraction(
- R.fraction.display_density_min_scale_interval, 1, 1);
- final int numLarger = (int) MathUtils.constrain((maxScale - 1) / minScaleInterval,
- 0, SUMMARIES_LARGER.length);
- final int numSmaller = (int) MathUtils.constrain((1 - minScale) / minScaleInterval,
- 0, SUMMARIES_SMALLER.length);
-
- String[] entries = new String[1 + numSmaller + numLarger];
- int[] values = new int[entries.length];
- int curIndex = 0;
-
- if (numSmaller > 0) {
- final float interval = (1 - minScale) / numSmaller;
- for (int i = numSmaller - 1; i >= 0; i--) {
- // Round down to a multiple of 2 by truncating the low bit.
- final int density = ((int) (defaultDensity * (1 - (i + 1) * interval))) & ~1;
- if (currentDensity == density) {
- currentDensityIndex = curIndex;
- }
- entries[curIndex] = res.getString(SUMMARIES_SMALLER[i]);
- values[curIndex] = density;
- curIndex++;
+ final int defaultDensity =
+ DisplayDensityUtils.getDefaultDensityForDisplay(idOfSmallestDisplay);
+ if (defaultDensity <= 0) {
+ Log.w(LOG_TAG, "Cannot fetch default density for display " + idOfSmallestDisplay);
+ mEntries = null;
+ mValues = null;
+ mDefaultDensity = 0;
+ mCurrentIndex = -1;
+ return;
+ }
+
+ final Resources res = context.getResources();
+
+ final int currentDensity = defaultDisplayInfo.logicalDensityDpi;
+ int currentDensityIndex = -1;
+
+ // Compute number of "larger" and "smaller" scales for this display.
+ final int maxDensity =
+ DisplayMetrics.DENSITY_MEDIUM * minDimensionPx / MIN_DIMENSION_DP;
+ final float maxScaleDimen = context.getResources().getFraction(
+ R.fraction.display_density_max_scale, 1, 1);
+ final float maxScale = Math.min(maxScaleDimen, maxDensity / (float) defaultDensity);
+ final float minScale = context.getResources().getFraction(
+ R.fraction.display_density_min_scale, 1, 1);
+ final float minScaleInterval = context.getResources().getFraction(
+ R.fraction.display_density_min_scale_interval, 1, 1);
+ final int numLarger = (int) MathUtils.constrain((maxScale - 1) / minScaleInterval,
+ 0, SUMMARIES_LARGER.length);
+ final int numSmaller = (int) MathUtils.constrain((1 - minScale) / minScaleInterval,
+ 0, SUMMARIES_SMALLER.length);
+
+ String[] entries = new String[1 + numSmaller + numLarger];
+ int[] values = new int[entries.length];
+ int curIndex = 0;
+
+ if (numSmaller > 0) {
+ final float interval = (1 - minScale) / numSmaller;
+ for (int i = numSmaller - 1; i >= 0; i--) {
+ // Round down to a multiple of 2 by truncating the low bit.
+ final int density = ((int) (defaultDensity * (1 - (i + 1) * interval))) & ~1;
+ if (currentDensity == density) {
+ currentDensityIndex = curIndex;
}
+ entries[curIndex] = res.getString(SUMMARIES_SMALLER[i]);
+ values[curIndex] = density;
+ curIndex++;
}
+ }
- if (currentDensity == defaultDensity) {
- currentDensityIndex = curIndex;
- }
- values[curIndex] = defaultDensity;
- entries[curIndex] = res.getString(SUMMARY_DEFAULT);
- curIndex++;
-
- if (numLarger > 0) {
- final float interval = (maxScale - 1) / numLarger;
- for (int i = 0; i < numLarger; i++) {
- // Round down to a multiple of 2 by truncating the low bit.
- final int density = ((int) (defaultDensity * (1 + (i + 1) * interval))) & ~1;
- if (currentDensity == density) {
- currentDensityIndex = curIndex;
- }
- values[curIndex] = density;
- entries[curIndex] = res.getString(SUMMARIES_LARGER[i]);
- curIndex++;
+ if (currentDensity == defaultDensity) {
+ currentDensityIndex = curIndex;
+ }
+ values[curIndex] = defaultDensity;
+ entries[curIndex] = res.getString(SUMMARY_DEFAULT);
+ curIndex++;
+
+ if (numLarger > 0) {
+ final float interval = (maxScale - 1) / numLarger;
+ for (int i = 0; i < numLarger; i++) {
+ // Round down to a multiple of 2 by truncating the low bit.
+ final int density = ((int) (defaultDensity * (1 + (i + 1) * interval))) & ~1;
+ if (currentDensity == density) {
+ currentDensityIndex = curIndex;
}
+ values[curIndex] = density;
+ entries[curIndex] = res.getString(SUMMARIES_LARGER[i]);
+ curIndex++;
}
+ }
- final int displayIndex;
- if (currentDensityIndex >= 0) {
- displayIndex = currentDensityIndex;
- } else {
- // We don't understand the current density. Must have been set by
- // someone else. Make room for another entry...
- int newLength = values.length + 1;
- values = Arrays.copyOf(values, newLength);
- values[curIndex] = currentDensity;
+ final int displayIndex;
+ if (currentDensityIndex >= 0) {
+ displayIndex = currentDensityIndex;
+ } else {
+ // We don't understand the current density. Must have been set by
+ // someone else. Make room for another entry...
+ int newLength = values.length + 1;
+ values = Arrays.copyOf(values, newLength);
+ values[curIndex] = currentDensity;
- entries = Arrays.copyOf(entries, newLength);
- entries[curIndex] = res.getString(SUMMARY_CUSTOM, currentDensity);
+ entries = Arrays.copyOf(entries, newLength);
+ entries[curIndex] = res.getString(SUMMARY_CUSTOM, currentDensity);
- displayIndex = curIndex;
- }
-
- if (display.getDisplayId() == Display.DEFAULT_DISPLAY) {
- mDefaultDensityForDefaultDisplay = defaultDensity;
- mCurrentIndex = displayIndex;
- mDefaultDisplayDensityEntries = entries;
- mDefaultDisplayDensityValues = values;
- }
- mValuesPerDisplay.put(info.uniqueId, values);
+ displayIndex = curIndex;
}
+
+ mDefaultDensity = defaultDensity;
+ mCurrentIndex = displayIndex;
+ mEntries = entries;
+ mValues = values;
}
- public String[] getDefaultDisplayDensityEntries() {
- return mDefaultDisplayDensityEntries;
+ @Nullable
+ public String[] getEntries() {
+ return mEntries;
}
- public int[] getDefaultDisplayDensityValues() {
- return mDefaultDisplayDensityValues;
+ @Nullable
+ public int[] getValues() {
+ return mValues;
}
- public int getCurrentIndexForDefaultDisplay() {
+ public int getCurrentIndex() {
return mCurrentIndex;
}
- public int getDefaultDensityForDefaultDisplay() {
- return mDefaultDensityForDefaultDisplay;
+ public int getDefaultDensity() {
+ return mDefaultDensity;
}
/**
@@ -311,15 +331,9 @@ public class DisplayDensityUtils {
if (!mPredicate.test(info)) {
continue;
}
- if (!mValuesPerDisplay.containsKey(info.uniqueId)) {
- Log.w(LOG_TAG, "Unable to save forced display density setting "
- + "for display " + info.uniqueId);
- continue;
- }
final IWindowManager wm = WindowManagerGlobal.getWindowManagerService();
- wm.setForcedDisplayDensityForUser(displayId,
- mValuesPerDisplay.get(info.uniqueId)[index], userId);
+ wm.setForcedDisplayDensityForUser(displayId, mValues[index], userId);
}
} catch (RemoteException exc) {
Log.w(LOG_TAG, "Unable to save forced display density setting");
diff --git a/packages/SettingsLib/tests/integ/src/com/android/settingslib/devicestate/DeviceStateRotationLockSettingsManagerTest.java b/packages/SettingsLib/tests/integ/src/com/android/settingslib/devicestate/DeviceStateRotationLockSettingsManagerTest.java
index 52c2a87cc961..9f9aaf5ff83a 100644
--- a/packages/SettingsLib/tests/integ/src/com/android/settingslib/devicestate/DeviceStateRotationLockSettingsManagerTest.java
+++ b/packages/SettingsLib/tests/integ/src/com/android/settingslib/devicestate/DeviceStateRotationLockSettingsManagerTest.java
@@ -16,13 +16,22 @@
package com.android.settingslib.devicestate;
+import static android.hardware.devicestate.DeviceState.PROPERTY_FOLDABLE_DISPLAY_CONFIGURATION_INNER_PRIMARY;
+import static android.hardware.devicestate.DeviceState.PROPERTY_FOLDABLE_DISPLAY_CONFIGURATION_OUTER_PRIMARY;
+import static android.hardware.devicestate.DeviceState.PROPERTY_FOLDABLE_HARDWARE_CONFIGURATION_FOLD_IN_CLOSED;
+import static android.hardware.devicestate.DeviceState.PROPERTY_FOLDABLE_HARDWARE_CONFIGURATION_FOLD_IN_HALF_OPEN;
+import static android.hardware.devicestate.DeviceState.PROPERTY_FOLDABLE_HARDWARE_CONFIGURATION_FOLD_IN_OPEN;
+
import static com.google.common.truth.Truth.assertThat;
import static org.mockito.Mockito.when;
+import android.annotation.NonNull;
import android.content.Context;
import android.content.res.Resources;
import android.database.ContentObserver;
+import android.hardware.devicestate.DeviceState;
+import android.hardware.devicestate.DeviceStateManager;
import android.os.UserHandle;
import android.provider.Settings;
@@ -42,7 +51,10 @@ import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
+import java.util.ArrayList;
+import java.util.HashSet;
import java.util.List;
+import java.util.Set;
@SmallTest
@RunWith(AndroidJUnit4.class)
@@ -53,6 +65,8 @@ public class DeviceStateRotationLockSettingsManagerTest {
@Mock private Context mMockContext;
@Mock private Resources mMockResources;
+ @Mock private DeviceStateManager mDeviceStateManager;
+
private DeviceStateRotationLockSettingsManager mManager;
private int mNumSettingsChanges = 0;
private final ContentObserver mContentObserver = new ContentObserver(null) {
@@ -70,6 +84,9 @@ public class DeviceStateRotationLockSettingsManagerTest {
when(mMockContext.getApplicationContext()).thenReturn(mMockContext);
when(mMockContext.getResources()).thenReturn(mMockResources);
when(mMockContext.getContentResolver()).thenReturn(context.getContentResolver());
+ when(mMockContext.getSystemService(DeviceStateManager.class)).thenReturn(
+ mDeviceStateManager);
+ when(mDeviceStateManager.getSupportedDeviceStates()).thenReturn(createDeviceStateList());
when(mMockResources.getStringArray(R.array.config_perDeviceStateRotationLockDefaults))
.thenReturn(new String[]{"0:1", "1:0:2", "2:2"});
when(mMockResources.getIntArray(R.array.config_foldedDeviceStates))
@@ -180,4 +197,29 @@ public class DeviceStateRotationLockSettingsManagerTest {
value,
UserHandle.USER_CURRENT);
}
+
+ private List<DeviceState> createDeviceStateList() {
+ List<DeviceState> deviceStates = new ArrayList<>();
+ deviceStates.add(createDeviceState(0 /* identifier */, "folded",
+ new HashSet<>(List.of(PROPERTY_FOLDABLE_DISPLAY_CONFIGURATION_OUTER_PRIMARY)),
+ new HashSet<>(List.of(PROPERTY_FOLDABLE_HARDWARE_CONFIGURATION_FOLD_IN_CLOSED))));
+ deviceStates.add(createDeviceState(1 /* identifier */, "half_folded",
+ new HashSet<>(List.of(PROPERTY_FOLDABLE_DISPLAY_CONFIGURATION_INNER_PRIMARY)),
+ new HashSet<>(
+ List.of(PROPERTY_FOLDABLE_HARDWARE_CONFIGURATION_FOLD_IN_HALF_OPEN))));
+ deviceStates.add(createDeviceState(2, "unfolded",
+ new HashSet<>(List.of(PROPERTY_FOLDABLE_DISPLAY_CONFIGURATION_INNER_PRIMARY)),
+ new HashSet<>(List.of(PROPERTY_FOLDABLE_HARDWARE_CONFIGURATION_FOLD_IN_OPEN))));
+
+ return deviceStates;
+ }
+
+ private DeviceState createDeviceState(int identifier, @NonNull String name,
+ @NonNull Set<@DeviceState.SystemDeviceStateProperties Integer> systemProperties,
+ @NonNull Set<@DeviceState.PhysicalDeviceStateProperties Integer> physicalProperties) {
+ DeviceState.Configuration deviceStateConfiguration = new DeviceState.Configuration.Builder(
+ identifier, name).setPhysicalProperties(systemProperties).setPhysicalProperties(
+ physicalProperties).build();
+ return new DeviceState(deviceStateConfiguration);
+ }
}
diff --git a/packages/SettingsLib/tests/integ/src/com/android/settingslib/devicestate/PosturesHelperTest.kt b/packages/SettingsLib/tests/integ/src/com/android/settingslib/devicestate/PosturesHelperTest.kt
index d91c2fa66ca8..7a905cba491d 100644
--- a/packages/SettingsLib/tests/integ/src/com/android/settingslib/devicestate/PosturesHelperTest.kt
+++ b/packages/SettingsLib/tests/integ/src/com/android/settingslib/devicestate/PosturesHelperTest.kt
@@ -18,6 +18,16 @@ package com.android.settingslib.devicestate
import android.content.Context
import android.content.res.Resources
+import android.hardware.devicestate.DeviceState
+import android.hardware.devicestate.DeviceState.PROPERTY_FEATURE_REAR_DISPLAY
+import android.hardware.devicestate.DeviceState.PROPERTY_FOLDABLE_DISPLAY_CONFIGURATION_INNER_PRIMARY
+import android.hardware.devicestate.DeviceState.PROPERTY_FOLDABLE_DISPLAY_CONFIGURATION_OUTER_PRIMARY
+import android.hardware.devicestate.DeviceState.PROPERTY_FOLDABLE_HARDWARE_CONFIGURATION_FOLD_IN_CLOSED
+import android.hardware.devicestate.DeviceState.PROPERTY_FOLDABLE_HARDWARE_CONFIGURATION_FOLD_IN_HALF_OPEN
+import android.hardware.devicestate.DeviceState.PROPERTY_FOLDABLE_HARDWARE_CONFIGURATION_FOLD_IN_OPEN
+import android.hardware.devicestate.DeviceStateManager
+import android.platform.test.annotations.RequiresFlagsDisabled
+import android.platform.test.annotations.RequiresFlagsEnabled
import android.provider.Settings.Secure.DEVICE_STATE_ROTATION_KEY_FOLDED
import android.provider.Settings.Secure.DEVICE_STATE_ROTATION_KEY_HALF_FOLDED
import android.provider.Settings.Secure.DEVICE_STATE_ROTATION_KEY_REAR_DISPLAY
@@ -32,14 +42,40 @@ import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith
import org.mockito.Mock
-import org.mockito.Mockito.`when` as whenever
import org.mockito.MockitoAnnotations
+import android.hardware.devicestate.feature.flags.Flags as DeviceStateManagerFlags
+import org.mockito.Mockito.`when` as whenever
private const val DEVICE_STATE_UNKNOWN = 0
-private const val DEVICE_STATE_CLOSED = 1
-private const val DEVICE_STATE_HALF_FOLDED = 2
-private const val DEVICE_STATE_OPEN = 3
-private const val DEVICE_STATE_REAR_DISPLAY = 4
+private val DEVICE_STATE_CLOSED = DeviceState(
+ DeviceState.Configuration.Builder(/* identifier= */ 1, "CLOSED")
+ .setSystemProperties(setOf(PROPERTY_FOLDABLE_DISPLAY_CONFIGURATION_OUTER_PRIMARY))
+ .setPhysicalProperties(setOf(PROPERTY_FOLDABLE_HARDWARE_CONFIGURATION_FOLD_IN_CLOSED))
+ .build()
+)
+private val DEVICE_STATE_HALF_FOLDED = DeviceState(
+ DeviceState.Configuration.Builder(/* identifier= */ 2, "HALF_FOLDED")
+ .setSystemProperties(setOf(PROPERTY_FOLDABLE_DISPLAY_CONFIGURATION_INNER_PRIMARY))
+ .setPhysicalProperties(setOf(PROPERTY_FOLDABLE_HARDWARE_CONFIGURATION_FOLD_IN_HALF_OPEN))
+ .build()
+)
+private val DEVICE_STATE_OPEN = DeviceState(
+ DeviceState.Configuration.Builder(/* identifier= */ 3, "OPEN")
+ .setSystemProperties(setOf(PROPERTY_FOLDABLE_DISPLAY_CONFIGURATION_INNER_PRIMARY))
+ .setPhysicalProperties(setOf(PROPERTY_FOLDABLE_HARDWARE_CONFIGURATION_FOLD_IN_OPEN))
+ .build()
+)
+private val DEVICE_STATE_REAR_DISPLAY = DeviceState(
+ DeviceState.Configuration.Builder(/* identifier= */ 4, "REAR_DISPLAY")
+ .setSystemProperties(
+ setOf(
+ PROPERTY_FOLDABLE_DISPLAY_CONFIGURATION_OUTER_PRIMARY,
+ PROPERTY_FEATURE_REAR_DISPLAY
+ )
+ )
+ .setPhysicalProperties(setOf(PROPERTY_FOLDABLE_HARDWARE_CONFIGURATION_FOLD_IN_CLOSED))
+ .build()
+)
@SmallTest
@RunWith(AndroidJUnit4::class)
@@ -51,6 +87,8 @@ class PosturesHelperTest {
@Mock private lateinit var resources: Resources
+ @Mock private lateinit var deviceStateManager: DeviceStateManager
+
private lateinit var posturesHelper: PosturesHelper
@Before
@@ -59,30 +97,39 @@ class PosturesHelperTest {
whenever(context.resources).thenReturn(resources)
whenever(resources.getIntArray(R.array.config_foldedDeviceStates))
- .thenReturn(intArrayOf(DEVICE_STATE_CLOSED))
+ .thenReturn(intArrayOf(DEVICE_STATE_CLOSED.identifier))
whenever(resources.getIntArray(R.array.config_halfFoldedDeviceStates))
- .thenReturn(intArrayOf(DEVICE_STATE_HALF_FOLDED))
+ .thenReturn(intArrayOf(DEVICE_STATE_HALF_FOLDED.identifier))
whenever(resources.getIntArray(R.array.config_openDeviceStates))
- .thenReturn(intArrayOf(DEVICE_STATE_OPEN))
+ .thenReturn(intArrayOf(DEVICE_STATE_OPEN.identifier))
whenever(resources.getIntArray(R.array.config_rearDisplayDeviceStates))
- .thenReturn(intArrayOf(DEVICE_STATE_REAR_DISPLAY))
+ .thenReturn(intArrayOf(DEVICE_STATE_REAR_DISPLAY.identifier))
+ whenever(deviceStateManager.supportedDeviceStates).thenReturn(
+ listOf(
+ DEVICE_STATE_CLOSED,
+ DEVICE_STATE_HALF_FOLDED,
+ DEVICE_STATE_OPEN,
+ DEVICE_STATE_REAR_DISPLAY
+ )
+ )
- posturesHelper = PosturesHelper(context)
+ posturesHelper = PosturesHelper(context, deviceStateManager)
}
@Test
- fun deviceStateToPosture_mapsCorrectly() {
+ @RequiresFlagsDisabled(DeviceStateManagerFlags.FLAG_DEVICE_STATE_PROPERTY_MIGRATION)
+ fun deviceStateToPosture_mapsCorrectly_overlayConfigurationValues() {
expect
- .that(posturesHelper.deviceStateToPosture(DEVICE_STATE_CLOSED))
+ .that(posturesHelper.deviceStateToPosture(DEVICE_STATE_CLOSED.identifier))
.isEqualTo(DEVICE_STATE_ROTATION_KEY_FOLDED)
expect
- .that(posturesHelper.deviceStateToPosture(DEVICE_STATE_HALF_FOLDED))
+ .that(posturesHelper.deviceStateToPosture(DEVICE_STATE_HALF_FOLDED.identifier))
.isEqualTo(DEVICE_STATE_ROTATION_KEY_HALF_FOLDED)
expect
- .that(posturesHelper.deviceStateToPosture(DEVICE_STATE_OPEN))
+ .that(posturesHelper.deviceStateToPosture(DEVICE_STATE_OPEN.identifier))
.isEqualTo(DEVICE_STATE_ROTATION_KEY_UNFOLDED)
expect
- .that(posturesHelper.deviceStateToPosture(DEVICE_STATE_REAR_DISPLAY))
+ .that(posturesHelper.deviceStateToPosture(DEVICE_STATE_REAR_DISPLAY.identifier))
.isEqualTo(DEVICE_STATE_ROTATION_KEY_REAR_DISPLAY)
expect
.that(posturesHelper.deviceStateToPosture(DEVICE_STATE_UNKNOWN))
@@ -90,19 +137,58 @@ class PosturesHelperTest {
}
@Test
- fun postureToDeviceState_mapsCorrectly() {
+ @RequiresFlagsEnabled(DeviceStateManagerFlags.FLAG_DEVICE_STATE_PROPERTY_MIGRATION)
+ fun deviceStateToPosture_mapsCorrectly_deviceStateManager() {
+ expect
+ .that(posturesHelper.deviceStateToPosture(DEVICE_STATE_CLOSED.identifier))
+ .isEqualTo(DEVICE_STATE_ROTATION_KEY_FOLDED)
+ expect
+ .that(posturesHelper.deviceStateToPosture(DEVICE_STATE_HALF_FOLDED.identifier))
+ .isEqualTo(DEVICE_STATE_ROTATION_KEY_HALF_FOLDED)
+ expect
+ .that(posturesHelper.deviceStateToPosture(DEVICE_STATE_OPEN.identifier))
+ .isEqualTo(DEVICE_STATE_ROTATION_KEY_UNFOLDED)
+ expect
+ .that(posturesHelper.deviceStateToPosture(DEVICE_STATE_REAR_DISPLAY.identifier))
+ .isEqualTo(DEVICE_STATE_ROTATION_KEY_REAR_DISPLAY)
+ expect
+ .that(posturesHelper.deviceStateToPosture(DEVICE_STATE_UNKNOWN))
+ .isEqualTo(DEVICE_STATE_ROTATION_KEY_UNKNOWN)
+ }
+
+ @Test
+ @RequiresFlagsDisabled(DeviceStateManagerFlags.FLAG_DEVICE_STATE_PROPERTY_MIGRATION)
+ fun postureToDeviceState_mapsCorrectly_overlayConfigurationValues() {
+ expect
+ .that(posturesHelper.postureToDeviceState(DEVICE_STATE_ROTATION_KEY_FOLDED))
+ .isEqualTo(DEVICE_STATE_CLOSED.identifier)
+ expect
+ .that(posturesHelper.postureToDeviceState(DEVICE_STATE_ROTATION_KEY_HALF_FOLDED))
+ .isEqualTo(DEVICE_STATE_HALF_FOLDED.identifier)
+ expect
+ .that(posturesHelper.postureToDeviceState(DEVICE_STATE_ROTATION_KEY_UNFOLDED))
+ .isEqualTo(DEVICE_STATE_OPEN.identifier)
+ expect
+ .that(posturesHelper.postureToDeviceState(DEVICE_STATE_ROTATION_KEY_REAR_DISPLAY))
+ .isEqualTo(DEVICE_STATE_REAR_DISPLAY.identifier)
+ expect.that(posturesHelper.postureToDeviceState(DEVICE_STATE_ROTATION_KEY_UNKNOWN)).isNull()
+ }
+
+ @Test
+ @RequiresFlagsEnabled(DeviceStateManagerFlags.FLAG_DEVICE_STATE_PROPERTY_MIGRATION)
+ fun postureToDeviceState_mapsCorrectly_deviceStateManager() {
expect
.that(posturesHelper.postureToDeviceState(DEVICE_STATE_ROTATION_KEY_FOLDED))
- .isEqualTo(DEVICE_STATE_CLOSED)
+ .isEqualTo(DEVICE_STATE_CLOSED.identifier)
expect
.that(posturesHelper.postureToDeviceState(DEVICE_STATE_ROTATION_KEY_HALF_FOLDED))
- .isEqualTo(DEVICE_STATE_HALF_FOLDED)
+ .isEqualTo(DEVICE_STATE_HALF_FOLDED.identifier)
expect
.that(posturesHelper.postureToDeviceState(DEVICE_STATE_ROTATION_KEY_UNFOLDED))
- .isEqualTo(DEVICE_STATE_OPEN)
+ .isEqualTo(DEVICE_STATE_OPEN.identifier)
expect
.that(posturesHelper.postureToDeviceState(DEVICE_STATE_ROTATION_KEY_REAR_DISPLAY))
- .isEqualTo(DEVICE_STATE_REAR_DISPLAY)
+ .isEqualTo(DEVICE_STATE_REAR_DISPLAY.identifier)
expect.that(posturesHelper.postureToDeviceState(DEVICE_STATE_ROTATION_KEY_UNKNOWN)).isNull()
}
}
diff --git a/packages/SettingsProvider/src/android/provider/settings/backup/SecureSettings.java b/packages/SettingsProvider/src/android/provider/settings/backup/SecureSettings.java
index 4dc84246afc0..d3ee40083c91 100644
--- a/packages/SettingsProvider/src/android/provider/settings/backup/SecureSettings.java
+++ b/packages/SettingsProvider/src/android/provider/settings/backup/SecureSettings.java
@@ -282,5 +282,6 @@ public class SecureSettings {
Settings.Secure.ON_DEVICE_INTELLIGENCE_IDLE_TIMEOUT_MS,
Settings.Secure.MANDATORY_BIOMETRICS,
Settings.Secure.MANDATORY_BIOMETRICS_REQUIREMENTS_SATISFIED,
+ Settings.Secure.ADVANCED_PROTECTION_MODE,
};
}
diff --git a/packages/SettingsProvider/src/android/provider/settings/validators/SecureSettingsValidators.java b/packages/SettingsProvider/src/android/provider/settings/validators/SecureSettingsValidators.java
index 688676dc4072..d34ccc5a2173 100644
--- a/packages/SettingsProvider/src/android/provider/settings/validators/SecureSettingsValidators.java
+++ b/packages/SettingsProvider/src/android/provider/settings/validators/SecureSettingsValidators.java
@@ -442,5 +442,6 @@ public class SecureSettingsValidators {
VALIDATORS.put(Secure.MANDATORY_BIOMETRICS, new InclusiveIntegerRangeValidator(0, 1));
VALIDATORS.put(Secure.MANDATORY_BIOMETRICS_REQUIREMENTS_SATISFIED,
new InclusiveIntegerRangeValidator(0, 1));
+ VALIDATORS.put(Secure.ADVANCED_PROTECTION_MODE, BOOLEAN_VALIDATOR);
}
}
diff --git a/packages/Shell/Android.bp b/packages/Shell/Android.bp
index 253145468e47..3350efc33ad8 100644
--- a/packages/Shell/Android.bp
+++ b/packages/Shell/Android.bp
@@ -8,7 +8,10 @@ package {
}
// used both for the android_app and android_library
-shell_srcs = ["src/**/*.java",":dumpstate_aidl"]
+shell_srcs = [
+ "src/**/*.java",
+ ":dumpstate_aidl",
+]
shell_static_libs = ["androidx.legacy_legacy-support-v4"]
android_app {
@@ -22,6 +25,9 @@ android_app {
libs: [
"device_policy_aconfig_flags_lib",
],
+ flags_packages: [
+ "android.security.flags-aconfig",
+ ],
platform_apis: true,
certificate: "platform",
privileged: true,
@@ -43,4 +49,7 @@ android_library {
static_libs: shell_static_libs,
platform_apis: true,
manifest: "AndroidManifest.xml",
+ flags_packages: [
+ "android.security.flags-aconfig",
+ ],
}
diff --git a/packages/Shell/AndroidManifest.xml b/packages/Shell/AndroidManifest.xml
index 408ed1e861c3..05c5e5d9f82d 100644
--- a/packages/Shell/AndroidManifest.xml
+++ b/packages/Shell/AndroidManifest.xml
@@ -924,6 +924,7 @@
<!-- Permission required for CTS test - CtsPackageManagerTestCases-->
<uses-permission android:name="android.permission.DOMAIN_VERIFICATION_AGENT" />
+ <uses-permission android:name="android.permission.VERIFICATION_AGENT" />
<!-- Permission required for Cts test - CtsInputTestCases -->
<uses-permission
@@ -941,6 +942,11 @@
<!-- Permission required for CTS test - CtsNfcTestCases -->
<uses-permission android:name="android.permission.NFC_SET_CONTROLLER_ALWAYS_ON" />
+ <!-- Permission required for CTS test - AdvancedProtectionManagerTest -->
+ <uses-permission android:name="android.permission.SET_ADVANCED_PROTECTION_MODE"
+ android:featureFlag="android.security.aapm_api"/>
+ <uses-permission android:name="android.permission.QUERY_ADVANCED_PROTECTION_MODE"
+ android:featureFlag="android.security.aapm_api"/>
<!-- Permission required for CTS test - CtsAppTestCases -->
<uses-permission android:name="android.permission.KILL_UID" />
diff --git a/packages/SystemUI/AndroidManifest.xml b/packages/SystemUI/AndroidManifest.xml
index 9726ecf74e06..510c9b742e74 100644
--- a/packages/SystemUI/AndroidManifest.xml
+++ b/packages/SystemUI/AndroidManifest.xml
@@ -1139,11 +1139,5 @@
android:name="android.service.dream"
android:resource="@xml/home_controls_dream_metadata" />
</service>
-
- <activity android:name="com.android.systemui.keyboard.shortcut.ui.view.ShortcutHelperActivity"
- android:exported="false"
- android:showForAllUsers="true"
- android:theme="@style/ShortcutHelperTheme"
- android:excludeFromRecents="true" />
</application>
</manifest>
diff --git a/packages/SystemUI/aconfig/systemui.aconfig b/packages/SystemUI/aconfig/systemui.aconfig
index 651244a9e52a..426b24dfe070 100644
--- a/packages/SystemUI/aconfig/systemui.aconfig
+++ b/packages/SystemUI/aconfig/systemui.aconfig
@@ -298,6 +298,22 @@ flag {
}
flag {
+ name: "status_bar_ui_thread"
+ namespace: "systemui"
+ description: "Move the StatusBar window to a new UI thread, which is separate from the main "
+ "thread."
+ bug: "374159193"
+}
+
+flag {
+ name: "notification_shade_ui_thread"
+ namespace: "systemui"
+ description: "Move the NotificationShade window to a new UI thread, which is separate from "
+ "the main thread."
+ bug: "374159657"
+}
+
+flag {
name: "new_aod_transition"
namespace: "systemui"
description: "New LOCKSCREEN <=> AOD transition"
@@ -644,6 +660,13 @@ flag {
}
flag {
+ name: "screenshot_context_url"
+ namespace: "systemui"
+ description: "Include optional app-provided context URL when sharing a screenshot."
+ bug: "242791070"
+}
+
+flag {
name: "run_fingerprint_detect_on_dismissible_keyguard"
namespace: "systemui"
description: "Run fingerprint detect instead of authenticate if the keyguard is dismissible."
@@ -1489,6 +1512,16 @@ flag {
}
flag {
+ name: "ignore_touches_next_to_notification_shelf"
+ namespace: "systemui"
+ description: "The shelf can vertically overlap the unlock icon. Ignore touches if so."
+ bug: "358424256"
+ metadata {
+ purpose: PURPOSE_BUGFIX
+ }
+}
+
+flag {
name: "media_projection_request_attribution_fix"
namespace: "systemui"
description: "Ensure MediaProjection consent requests are properly attributed"
@@ -1507,3 +1540,20 @@ flag {
purpose: PURPOSE_BUGFIX
}
}
+
+flag {
+ name: "only_show_media_stream_slider_in_single_volume_mode"
+ namespace: "systemui"
+ description: "When the device is in single volume mode, only show media stream slider and hide all other stream (e.g. call, notification, alarm, etc) sliders in volume panel"
+ bug: "373729625"
+ metadata {
+ purpose: PURPOSE_BUGFIX
+ }
+}
+
+flag {
+ name: "qs_tile_detailed_view"
+ namespace: "systemui"
+ description: "Enables the tile detailed view UI."
+ bug: "374173773"
+}
diff --git a/packages/SystemUI/animation/src/com/android/systemui/surfaceeffects/turbulencenoise/TurbulenceNoiseShader.kt b/packages/SystemUI/animation/src/com/android/systemui/surfaceeffects/turbulencenoise/TurbulenceNoiseShader.kt
index 025c8b9dce04..f426aa597a84 100644
--- a/packages/SystemUI/animation/src/com/android/systemui/surfaceeffects/turbulencenoise/TurbulenceNoiseShader.kt
+++ b/packages/SystemUI/animation/src/com/android/systemui/surfaceeffects/turbulencenoise/TurbulenceNoiseShader.kt
@@ -70,6 +70,19 @@ class TurbulenceNoiseShader(val baseType: Type = Type.SIMPLEX_NOISE) :
}
"""
+ private const val SIMPLEX_SIMPLE_SHADER =
+ """
+ vec4 main(vec2 p) {
+ vec2 uv = p / in_size.xy;
+ uv.x *= in_aspectRatio;
+
+ // Compute turbulence effect with the uv distorted with simplex noise.
+ vec3 noisePos = vec3(uv + in_noiseMove.xy, in_noiseMove.z) * in_gridNum;
+ float mixFactor = simplex3d(noisePos) * 0.5 + 0.5;
+ return mix(in_color, in_screenColor, mixFactor);
+ }
+ """
+
private const val FRACTAL_SHADER =
"""
vec4 main(vec2 p) {
@@ -155,6 +168,8 @@ class TurbulenceNoiseShader(val baseType: Type = Type.SIMPLEX_NOISE) :
return sparkleLayer;
}
"""
+ private const val SIMPLEX_NOISE_SIMPLE_SHADER =
+ ShaderUtilLibrary.SHADER_LIB + UNIFORMS + SIMPLEX_SIMPLE_SHADER
private const val SIMPLEX_NOISE_SHADER =
ShaderUtilLibrary.SHADER_LIB + UNIFORMS + COMMON_FUNCTIONS + SIMPLEX_SHADER
private const val FRACTAL_NOISE_SHADER =
@@ -163,17 +178,20 @@ class TurbulenceNoiseShader(val baseType: Type = Type.SIMPLEX_NOISE) :
ShaderUtilLibrary.SHADER_LIB + UNIFORMS + COMMON_FUNCTIONS + SIMPLEX_SPARKLE_SHADER
enum class Type {
- /** Effect with a simple color noise turbulence. */
+ /** Effect with a color noise turbulence with luma matte. */
SIMPLEX_NOISE,
+ /** Effect with a noise interpolating between foreground and background colors. */
+ SIMPLEX_NOISE_SIMPLE,
/** Effect with a simple color noise turbulence, with fractal. */
SIMPLEX_NOISE_FRACTAL,
/** Effect with color & sparkle turbulence with screen color layer. */
- SIMPLEX_NOISE_SPARKLE
+ SIMPLEX_NOISE_SPARKLE,
}
fun getShader(type: Type): String {
return when (type) {
Type.SIMPLEX_NOISE -> SIMPLEX_NOISE_SHADER
+ Type.SIMPLEX_NOISE_SIMPLE -> SIMPLEX_NOISE_SIMPLE_SHADER
Type.SIMPLEX_NOISE_FRACTAL -> FRACTAL_NOISE_SHADER
Type.SIMPLEX_NOISE_SPARKLE -> SPARKLE_NOISE_SHADER
}
@@ -206,15 +224,15 @@ class TurbulenceNoiseShader(val baseType: Type = Type.SIMPLEX_NOISE) :
setFloatUniform("in_pixelDensity", pixelDensity)
}
- /** Sets the noise color of the effect. Alpha is ignored. */
+ /**
+ * Sets the noise color of the effect. Alpha is ignored for all types except
+ * [Type.SIMPLEX_NOISE_SIMPLE].
+ */
fun setColor(color: Int) {
setColorUniform("in_color", color)
}
- /**
- * Sets the color that is used for blending on top of the background color/image. Only relevant
- * to [Type.SIMPLEX_NOISE_SPARKLE].
- */
+ /** Sets the color that is used for blending on top of the background color/image. */
fun setScreenColor(color: Int) {
setColorUniform("in_screenColor", color)
}
@@ -259,7 +277,7 @@ class TurbulenceNoiseShader(val baseType: Type = Type.SIMPLEX_NOISE) :
*/
fun setLumaMatteFactors(
lumaMatteBlendFactor: Float = 1f,
- lumaMatteOverallBrightness: Float = 0f
+ lumaMatteOverallBrightness: Float = 0f,
) {
setFloatUniform("in_lumaMatteBlendFactor", lumaMatteBlendFactor)
setFloatUniform("in_lumaMatteOverallBrightness", lumaMatteOverallBrightness)
@@ -279,8 +297,10 @@ class TurbulenceNoiseShader(val baseType: Type = Type.SIMPLEX_NOISE) :
/** Current noise movements in x, y, and z axes. */
var noiseOffsetX: Float = 0f
private set
+
var noiseOffsetY: Float = 0f
private set
+
var noiseOffsetZ: Float = 0f
private set
diff --git a/packages/SystemUI/compose/features/src/com/android/systemui/bouncer/ui/composable/BouncerContent.kt b/packages/SystemUI/compose/features/src/com/android/systemui/bouncer/ui/composable/BouncerContent.kt
index 7dc2901273b2..d08df26ea8da 100644
--- a/packages/SystemUI/compose/features/src/com/android/systemui/bouncer/ui/composable/BouncerContent.kt
+++ b/packages/SystemUI/compose/features/src/com/android/systemui/bouncer/ui/composable/BouncerContent.kt
@@ -28,6 +28,7 @@ import androidx.compose.animation.core.snap
import androidx.compose.animation.core.tween
import androidx.compose.foundation.ExperimentalFoundationApi
import androidx.compose.foundation.Image
+import androidx.compose.foundation.background
import androidx.compose.foundation.combinedClickable
import androidx.compose.foundation.gestures.detectTapGestures
import androidx.compose.foundation.layout.Arrangement
@@ -46,7 +47,6 @@ import androidx.compose.foundation.layout.width
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.KeyboardArrowDown
-import androidx.compose.material3.Button
import androidx.compose.material3.ButtonDefaults
import androidx.compose.material3.DropdownMenu
import androidx.compose.material3.DropdownMenuItem
@@ -64,6 +64,7 @@ import androidx.compose.runtime.saveable.rememberSaveable
import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
+import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.asImageBitmap
import androidx.compose.ui.graphics.graphicsLayer
import androidx.compose.ui.input.key.onKeyEvent
@@ -72,6 +73,9 @@ import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.LocalDensity
import androidx.compose.ui.platform.LocalLayoutDirection
import androidx.compose.ui.platform.testTag
+import androidx.compose.ui.semantics.Role
+import androidx.compose.ui.semantics.role
+import androidx.compose.ui.semantics.semantics
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.DpOffset
@@ -88,7 +92,6 @@ import com.android.compose.animation.scene.SceneKey
import com.android.compose.animation.scene.SceneScope
import com.android.compose.animation.scene.SceneTransitionLayout
import com.android.compose.animation.scene.transitions
-import com.android.compose.modifiers.thenIf
import com.android.compose.windowsizeclass.LocalWindowSizeClass
import com.android.systemui.bouncer.shared.model.BouncerActionButtonModel
import com.android.systemui.bouncer.ui.BouncerDialogFactory
@@ -131,7 +134,7 @@ fun BouncerContent(
layout: BouncerSceneLayout,
viewModel: BouncerSceneContentViewModel,
dialogFactory: BouncerDialogFactory,
- modifier: Modifier
+ modifier: Modifier,
) {
Box(
// Allows the content within each of the layouts to react to the appearance and
@@ -140,31 +143,17 @@ fun BouncerContent(
// Despite the keyboard only being part of the password bouncer, adding it at this level is
// both necessary to properly handle the keyboard in all layouts and harmless in cases when
// the keyboard isn't used (like the PIN or pattern auth methods).
- modifier = modifier.imePadding().onKeyEvent(viewModel::onKeyEvent),
+ modifier = modifier.imePadding().onKeyEvent(viewModel::onKeyEvent)
) {
when (layout) {
- BouncerSceneLayout.STANDARD_BOUNCER ->
- StandardLayout(
- viewModel = viewModel,
- )
+ BouncerSceneLayout.STANDARD_BOUNCER -> StandardLayout(viewModel = viewModel)
BouncerSceneLayout.BESIDE_USER_SWITCHER ->
- BesideUserSwitcherLayout(
- viewModel = viewModel,
- )
- BouncerSceneLayout.BELOW_USER_SWITCHER ->
- BelowUserSwitcherLayout(
- viewModel = viewModel,
- )
- BouncerSceneLayout.SPLIT_BOUNCER ->
- SplitLayout(
- viewModel = viewModel,
- )
+ BesideUserSwitcherLayout(viewModel = viewModel)
+ BouncerSceneLayout.BELOW_USER_SWITCHER -> BelowUserSwitcherLayout(viewModel = viewModel)
+ BouncerSceneLayout.SPLIT_BOUNCER -> SplitLayout(viewModel = viewModel)
}
- Dialog(
- bouncerViewModel = viewModel,
- dialogFactory = dialogFactory,
- )
+ Dialog(bouncerViewModel = viewModel, dialogFactory = dialogFactory)
}
}
@@ -173,31 +162,19 @@ fun BouncerContent(
* authentication attempt, including all messaging UI (directives, reasoning, errors, etc.).
*/
@Composable
-private fun StandardLayout(
- viewModel: BouncerSceneContentViewModel,
- modifier: Modifier = Modifier,
-) {
+private fun StandardLayout(viewModel: BouncerSceneContentViewModel, modifier: Modifier = Modifier) {
val isHeightExpanded =
LocalWindowSizeClass.current.heightSizeClass == WindowHeightSizeClass.Expanded
FoldAware(
- modifier =
- modifier.padding(
- start = 32.dp,
- top = 92.dp,
- end = 32.dp,
- bottom = 48.dp,
- ),
+ modifier = modifier.padding(start = 32.dp, top = 92.dp, end = 32.dp, bottom = 48.dp),
viewModel = viewModel,
aboveFold = {
Column(
horizontalAlignment = Alignment.CenterHorizontally,
modifier = Modifier.fillMaxWidth(),
) {
- StatusMessage(
- viewModel = viewModel.message,
- modifier = Modifier,
- )
+ StatusMessage(viewModel = viewModel.message, modifier = Modifier)
OutputArea(
viewModel = viewModel,
@@ -210,9 +187,7 @@ private fun StandardLayout(
horizontalAlignment = Alignment.CenterHorizontally,
modifier = Modifier.fillMaxWidth(),
) {
- Box(
- modifier = Modifier.weight(1f),
- ) {
+ Box(modifier = Modifier.weight(1f)) {
InputArea(
viewModel = viewModel,
pinButtonRowVerticalSpacing = 12.dp,
@@ -221,10 +196,7 @@ private fun StandardLayout(
)
}
- ActionArea(
- viewModel = viewModel,
- modifier = Modifier.padding(top = 48.dp),
- )
+ ActionArea(viewModel = viewModel, modifier = Modifier.padding(top = 48.dp))
}
},
)
@@ -235,10 +207,7 @@ private fun StandardLayout(
* by double-tapping on the side.
*/
@Composable
-private fun SplitLayout(
- viewModel: BouncerSceneContentViewModel,
- modifier: Modifier = Modifier,
-) {
+private fun SplitLayout(viewModel: BouncerSceneContentViewModel, modifier: Modifier = Modifier) {
val authMethod by viewModel.authMethodViewModel.collectAsStateWithLifecycle()
Row(
@@ -248,12 +217,10 @@ private fun SplitLayout(
.padding(
horizontal = 24.dp,
vertical = if (authMethod is PasswordBouncerViewModel) 24.dp else 48.dp,
- ),
+ )
) {
// Left side (in left-to-right locales).
- Box(
- modifier = Modifier.fillMaxHeight().weight(1f),
- ) {
+ Box(modifier = Modifier.fillMaxHeight().weight(1f)) {
when (authMethod) {
is PinBouncerViewModel -> {
StatusMessage(
@@ -263,7 +230,7 @@ private fun SplitLayout(
OutputArea(
viewModel = viewModel,
modifier =
- Modifier.align(Alignment.Center).sysuiResTag("bouncer_text_entry")
+ Modifier.align(Alignment.Center).sysuiResTag("bouncer_text_entry"),
)
ActionArea(
@@ -293,9 +260,7 @@ private fun SplitLayout(
}
// Right side (in right-to-left locales).
- Box(
- modifier = Modifier.fillMaxHeight().weight(1f),
- ) {
+ Box(modifier = Modifier.fillMaxHeight().weight(1f)) {
when (authMethod) {
is PinBouncerViewModel,
is PatternBouncerViewModel -> {
@@ -311,13 +276,11 @@ private fun SplitLayout(
horizontalAlignment = Alignment.CenterHorizontally,
modifier = Modifier.fillMaxWidth().align(Alignment.Center),
) {
- StatusMessage(
- viewModel = viewModel.message,
- )
+ StatusMessage(viewModel = viewModel.message)
OutputArea(
viewModel = viewModel,
modifier =
- Modifier.padding(top = 24.dp).sysuiResTag("bouncer_text_entry")
+ Modifier.padding(top = 24.dp).sysuiResTag("bouncer_text_entry"),
)
}
}
@@ -365,7 +328,7 @@ private fun BesideUserSwitcherLayout(
.padding(
top = if (isHeightExpanded) 128.dp else 96.dp,
bottom = if (isHeightExpanded) 128.dp else 48.dp,
- ),
+ )
) {
LaunchedEffect(isSwapped) { swapAnimationEnd = false }
val animatedOffset by
@@ -408,10 +371,7 @@ private fun BesideUserSwitcherLayout(
.motionTestValues { animatedAlpha(animatedOffset) exportAs MotionTestValues.alpha }
}
- UserSwitcher(
- viewModel = viewModel,
- modifier = Modifier.weight(1f).swappable().testTag("UserSwitcher"),
- )
+ UserSwitcher(viewModel = viewModel, modifier = Modifier.weight(1f).swappable())
FoldAware(
modifier = Modifier.weight(1f).swappable(inversed = true).testTag("FoldAware"),
@@ -419,14 +379,12 @@ private fun BesideUserSwitcherLayout(
aboveFold = {
Column(
horizontalAlignment = Alignment.CenterHorizontally,
- modifier = Modifier.fillMaxWidth()
+ modifier = Modifier.fillMaxWidth(),
) {
- StatusMessage(
- viewModel = viewModel.message,
- )
+ StatusMessage(viewModel = viewModel.message)
OutputArea(
viewModel = viewModel,
- modifier = Modifier.padding(top = 24.dp).sysuiResTag("bouncer_text_entry")
+ modifier = Modifier.padding(top = 24.dp).sysuiResTag("bouncer_text_entry"),
)
}
},
@@ -444,7 +402,7 @@ private fun BesideUserSwitcherLayout(
Box(
modifier =
Modifier.weight(1f)
- .padding(top = (if (addSpacingBetweenOutputAndInput) 24 else 0).dp),
+ .padding(top = (if (addSpacingBetweenOutputAndInput) 24 else 0).dp)
) {
InputArea(
viewModel = viewModel,
@@ -470,16 +428,8 @@ private fun BelowUserSwitcherLayout(
viewModel: BouncerSceneContentViewModel,
modifier: Modifier = Modifier,
) {
- Column(
- modifier =
- modifier.padding(
- vertical = 128.dp,
- )
- ) {
- UserSwitcher(
- viewModel = viewModel,
- modifier = Modifier.fillMaxWidth(),
- )
+ Column(modifier = modifier.padding(vertical = 128.dp)) {
+ UserSwitcher(viewModel = viewModel, modifier = Modifier.fillMaxWidth())
Spacer(Modifier.weight(1f))
@@ -488,9 +438,7 @@ private fun BelowUserSwitcherLayout(
horizontalAlignment = Alignment.CenterHorizontally,
modifier = Modifier.fillMaxWidth(),
) {
- StatusMessage(
- viewModel = viewModel.message,
- )
+ StatusMessage(viewModel = viewModel.message)
OutputArea(viewModel = viewModel, modifier = Modifier.padding(top = 24.dp))
InputArea(
@@ -500,10 +448,7 @@ private fun BelowUserSwitcherLayout(
modifier = Modifier.padding(top = 128.dp),
)
- ActionArea(
- viewModel = viewModel,
- modifier = Modifier.padding(top = 48.dp),
- )
+ ActionArea(viewModel = viewModel, modifier = Modifier.padding(top = 48.dp))
}
}
}
@@ -533,19 +478,11 @@ private fun FoldAware(
SceneTransitionLayout(state, modifier = modifier) {
scene(SceneKeys.ContiguousSceneKey) {
- FoldableScene(
- aboveFold = aboveFold,
- belowFold = belowFold,
- isSplit = false,
- )
+ FoldableScene(aboveFold = aboveFold, belowFold = belowFold, isSplit = false)
}
scene(SceneKeys.SplitSceneKey) {
- FoldableScene(
- aboveFold = aboveFold,
- belowFold = belowFold,
- isSplit = true,
- )
+ FoldableScene(aboveFold = aboveFold, belowFold = belowFold, isSplit = true)
}
}
}
@@ -562,9 +499,7 @@ private fun SceneScope.FoldableScene(
R.dimen.motion_layout_half_fold_bouncer_height_ratio
)
- Column(
- modifier = modifier.fillMaxHeight(),
- ) {
+ Column(modifier = modifier.fillMaxHeight()) {
// Content above the fold, when split on a foldable device in a "table top" posture:
Box(
modifier =
@@ -575,7 +510,7 @@ private fun SceneScope.FoldableScene(
} else {
Modifier
}
- ),
+ )
) {
aboveFold()
}
@@ -590,7 +525,7 @@ private fun SceneScope.FoldableScene(
} else {
1f
}
- ),
+ )
) {
belowFold()
}
@@ -598,10 +533,7 @@ private fun SceneScope.FoldableScene(
}
@Composable
-private fun StatusMessage(
- viewModel: BouncerMessageViewModel,
- modifier: Modifier = Modifier,
-) {
+private fun StatusMessage(viewModel: BouncerMessageViewModel, modifier: Modifier = Modifier) {
val message: MessageViewModel? by viewModel.message.collectAsStateWithLifecycle()
DisposableEffect(Unit) {
@@ -634,7 +566,7 @@ private fun StatusMessage(
fontSize = 14.sp,
lineHeight = 20.sp,
overflow = TextOverflow.Ellipsis,
- maxLines = 2
+ maxLines = 2,
)
}
}
@@ -647,22 +579,19 @@ private fun StatusMessage(
* For example, this can be the PIN shapes or password text field.
*/
@Composable
-private fun OutputArea(
- viewModel: BouncerSceneContentViewModel,
- modifier: Modifier = Modifier,
-) {
+private fun OutputArea(viewModel: BouncerSceneContentViewModel, modifier: Modifier = Modifier) {
val authMethodViewModel: AuthMethodBouncerViewModel? by
viewModel.authMethodViewModel.collectAsStateWithLifecycle()
when (val nonNullViewModel = authMethodViewModel) {
is PinBouncerViewModel ->
PinInputDisplay(
viewModel = nonNullViewModel,
- modifier = modifier.sysuiResTag("bouncer_text_entry")
+ modifier = modifier.sysuiResTag("bouncer_text_entry"),
)
is PasswordBouncerViewModel ->
PasswordBouncer(
viewModel = nonNullViewModel,
- modifier = modifier.sysuiResTag("bouncer_text_entry")
+ modifier = modifier.sysuiResTag("bouncer_text_entry"),
)
else -> Unit
}
@@ -703,10 +632,7 @@ private fun InputArea(
}
@Composable
-private fun ActionArea(
- viewModel: BouncerSceneContentViewModel,
- modifier: Modifier = Modifier,
-) {
+private fun ActionArea(viewModel: BouncerSceneContentViewModel, modifier: Modifier = Modifier) {
val actionButton: BouncerActionButtonModel? by
viewModel.actionButton.collectAsStateWithLifecycle()
val appearFadeInAnimatable = remember { Animatable(0f) }
@@ -722,7 +648,7 @@ private fun ActionArea(
durationMillis = 450,
delayMillis = 133,
easing = Easings.LegacyDecelerate,
- )
+ ),
)
}
LaunchedEffect(Unit) {
@@ -733,39 +659,35 @@ private fun ActionArea(
durationMillis = 450,
delayMillis = 133,
easing = Easings.StandardDecelerate,
- )
+ ),
)
}
Box(
modifier =
- modifier.graphicsLayer {
- // Translate the button up from an initially pushed-down position:
- translationY = (1 - appearMoveAnimatable.value) * appearAnimationInitialOffset
- // Fade the button in:
- alpha = appearFadeInAnimatable.value
- },
+ modifier
+ .graphicsLayer {
+ // Translate the button up from an initially pushed-down position:
+ translationY =
+ (1 - appearMoveAnimatable.value) * appearAnimationInitialOffset
+ // Fade the button in:
+ alpha = appearFadeInAnimatable.value
+ }
+ .height(56.dp)
+ .clip(ButtonDefaults.shape)
+ .background(color = MaterialTheme.colorScheme.tertiaryContainer)
+ .semantics { role = Role.Button }
+ .combinedClickable(
+ onClick = { actionButtonViewModel.onClick() },
+ onLongClick = actionButtonViewModel.onLongClick?.let { { it.invoke() } },
+ )
) {
- Button(
- onClick = actionButtonViewModel.onClick,
- modifier =
- Modifier.height(56.dp).thenIf(actionButtonViewModel.onLongClick != null) {
- Modifier.combinedClickable(
- onClick = actionButtonViewModel.onClick,
- onLongClick = actionButtonViewModel.onLongClick,
- )
- },
- colors =
- ButtonDefaults.buttonColors(
- containerColor = MaterialTheme.colorScheme.tertiaryContainer,
- contentColor = MaterialTheme.colorScheme.onTertiaryContainer,
- ),
- ) {
- Text(
- text = actionButtonViewModel.label,
- style = MaterialTheme.typography.bodyMedium,
- )
- }
+ Text(
+ text = actionButtonViewModel.label,
+ style = MaterialTheme.typography.bodyMedium,
+ color = MaterialTheme.colorScheme.onTertiaryContainer,
+ modifier = Modifier.align(Alignment.Center).padding(ButtonDefaults.ContentPadding),
+ )
}
}
}
@@ -800,15 +722,10 @@ private fun Dialog(
/** Renders the UI of the user switcher that's displayed on large screens next to the bouncer UI. */
@Composable
-private fun UserSwitcher(
- viewModel: BouncerSceneContentViewModel,
- modifier: Modifier = Modifier,
-) {
+private fun UserSwitcher(viewModel: BouncerSceneContentViewModel, modifier: Modifier = Modifier) {
if (!viewModel.isUserSwitcherVisible) {
// Take up the same space as the user switcher normally would, but with nothing inside it.
- Box(
- modifier = modifier,
- )
+ Box(modifier = modifier)
return
}
@@ -818,7 +735,7 @@ private fun UserSwitcher(
Column(
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.Center,
- modifier = modifier,
+ modifier = modifier.sysuiResTag("UserSwitcher"),
) {
selectedUserImage?.let {
Image(
@@ -861,7 +778,7 @@ private fun UserSwitcher(
Icon(
imageVector = Icons.Default.KeyboardArrowDown,
contentDescription = null,
- modifier = Modifier.size(32.dp),
+ modifier = Modifier.size(32.dp).sysuiResTag("user_switcher_anchor"),
)
}
@@ -891,7 +808,7 @@ private fun UserSwitcherDropdownMenu(
MaterialTheme(
colorScheme =
MaterialTheme.colorScheme.copy(
- surface = MaterialTheme.colorScheme.surfaceContainerHighest,
+ surface = MaterialTheme.colorScheme.surfaceContainerHighest
),
shapes = MaterialTheme.shapes.copy(extraSmall = RoundedCornerShape(28.dp)),
) {
@@ -899,11 +816,11 @@ private fun UserSwitcherDropdownMenu(
expanded = isExpanded,
onDismissRequest = onDismissed,
offset = DpOffset(x = 0.dp, y = -UserSwitcherDropdownHeight),
- modifier =
- Modifier.width(UserSwitcherDropdownWidth).sysuiResTag("user_switcher_dropdown"),
+ modifier = Modifier.width(UserSwitcherDropdownWidth).sysuiResTag("user_list_dropdown"),
) {
items.forEach { userSwitcherDropdownItem ->
DropdownMenuItem(
+ modifier = Modifier.sysuiResTag("user_switcher_item"),
leadingIcon = {
Icon(
icon = userSwitcherDropdownItem.icon,
@@ -932,9 +849,7 @@ private fun UserSwitcherDropdownMenu(
* Calculates an alpha for the user switcher and bouncer such that it's at `1` when the offset of
* the two reaches a stopping point but `0` in the middle of the transition.
*/
-private fun animatedAlpha(
- offset: Float,
-): Float {
+private fun animatedAlpha(offset: Float): Float {
// Describes a curve that is made of two parabolic U-shaped curves mirrored horizontally around
// the y-axis. The U on the left runs between x = -1 and x = 0 while the U on the right runs
// between x = 0 and x = 1.
diff --git a/packages/SystemUI/compose/features/src/com/android/systemui/communal/ui/compose/CommunalHub.kt b/packages/SystemUI/compose/features/src/com/android/systemui/communal/ui/compose/CommunalHub.kt
index 4ab526188ffe..8b0daf6e75b2 100644
--- a/packages/SystemUI/compose/features/src/com/android/systemui/communal/ui/compose/CommunalHub.kt
+++ b/packages/SystemUI/compose/features/src/com/android/systemui/communal/ui/compose/CommunalHub.kt
@@ -16,6 +16,7 @@
package com.android.systemui.communal.ui.compose
+import android.appwidget.AppWidgetProviderInfo
import android.content.Context
import android.content.res.Configuration
import android.graphics.drawable.Icon
@@ -24,7 +25,6 @@ import android.util.SizeF
import android.view.MotionEvent
import android.widget.FrameLayout
import android.widget.RemoteViews
-import androidx.annotation.VisibleForTesting
import androidx.compose.animation.AnimatedVisibility
import androidx.compose.animation.core.LinearEasing
import androidx.compose.animation.core.Spring
@@ -149,9 +149,11 @@ import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.Density
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.DpSize
+import androidx.compose.ui.unit.IntRect
import androidx.compose.ui.unit.IntSize
import androidx.compose.ui.unit.LayoutDirection
import androidx.compose.ui.unit.dp
+import androidx.compose.ui.unit.round
import androidx.compose.ui.unit.sp
import androidx.compose.ui.unit.times
import androidx.compose.ui.util.fastAll
@@ -183,6 +185,9 @@ import com.android.systemui.communal.widgets.SmartspaceAppWidgetHostView
import com.android.systemui.communal.widgets.WidgetConfigurator
import com.android.systemui.res.R
import com.android.systemui.statusbar.phone.SystemUIDialogFactory
+import kotlin.math.max
+import kotlin.math.min
+import kotlin.math.roundToInt
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
@@ -386,13 +391,19 @@ fun CommunalHub(
contentOffset = contentOffset,
screenWidth = screenWidth,
setGridCoordinates = { gridCoordinates = it },
- updateDragPositionForRemove = { offset ->
- isPointerWithinEnabledRemoveButton(
- removeEnabled = removeButtonEnabled,
- offset =
- gridCoordinates?.let { it.positionInWindow() + offset },
- containerToCheck = removeButtonCoordinates,
- )
+ updateDragPositionForRemove = { boundingBox ->
+ val gridOffset = gridCoordinates?.positionInWindow()
+ val removeButtonCenter =
+ removeButtonCoordinates?.boundsInWindow()?.center
+ removeButtonEnabled &&
+ gridOffset != null &&
+ removeButtonCenter != null &&
+ boundingBox
+ // The bounding box is relative to the grid, so we need to
+ // normalize it by adding the grid offset and the content
+ // offset.
+ .translate((gridOffset + contentOffset).round())
+ .contains(removeButtonCenter.round())
},
gridState = gridState,
contentListState = contentListState,
@@ -644,11 +655,13 @@ private fun ObserveNewWidgetAddedEffect(
@Composable
private fun ResizableItemFrameWrapper(
key: String,
+ currentSpan: GridItemSpan,
gridState: LazyGridState,
- minItemSpan: Int,
gridContentPadding: PaddingValues,
verticalArrangement: Arrangement.Vertical,
enabled: Boolean,
+ minHeightPx: Int,
+ maxHeightPx: Int,
modifier: Modifier = Modifier,
alpha: () -> Float = { 1f },
onResize: (info: ResizeInfo) -> Unit = {},
@@ -659,20 +672,48 @@ private fun ResizableItemFrameWrapper(
} else {
ResizableItemFrame(
key = key,
+ currentSpan = currentSpan,
gridState = gridState,
- minItemSpan = minItemSpan,
gridContentPadding = gridContentPadding,
verticalArrangement = verticalArrangement,
enabled = enabled,
alpha = alpha,
modifier = modifier,
onResize = onResize,
+ minHeightPx = minHeightPx,
+ maxHeightPx = maxHeightPx,
+ resizeMultiple = CommunalContentSize.HALF.span,
) {
content(Modifier)
}
}
}
+@Composable
+fun calculateWidgetSize(item: CommunalContentModel, isResizable: Boolean): WidgetSizeInfo {
+ val density = LocalDensity.current
+
+ return if (isResizable && item is CommunalContentModel.WidgetContent.Widget) {
+ with(density) {
+ val minHeightPx =
+ (min(item.providerInfo.minResizeHeight, item.providerInfo.minHeight)
+ .coerceAtLeast(CommunalContentSize.HALF.dp().toPx().roundToInt()))
+
+ val maxHeightPx =
+ (if (item.providerInfo.maxResizeHeight > 0) {
+ max(item.providerInfo.maxResizeHeight, item.providerInfo.minHeight)
+ } else {
+ Int.MAX_VALUE
+ })
+ .coerceIn(minHeightPx, CommunalContentSize.FULL.dp().toPx().roundToInt())
+
+ WidgetSizeInfo(minHeightPx, maxHeightPx)
+ }
+ } else {
+ WidgetSizeInfo(0, Int.MAX_VALUE)
+ }
+}
+
@OptIn(ExperimentalFoundationApi::class)
@Composable
private fun BoxScope.CommunalHubLazyGrid(
@@ -685,7 +726,7 @@ private fun BoxScope.CommunalHubLazyGrid(
gridState: LazyGridState,
contentListState: ContentListState,
setGridCoordinates: (coordinates: LayoutCoordinates) -> Unit,
- updateDragPositionForRemove: (offset: Offset) -> Boolean,
+ updateDragPositionForRemove: (boundingBox: IntRect) -> Boolean,
widgetConfigurator: WidgetConfigurator?,
interactionHandler: RemoteViews.InteractionHandler?,
widgetSection: CommunalAppWidgetSection,
@@ -747,6 +788,12 @@ private fun BoxScope.CommunalHubLazyGrid(
val size = SizeF(Dimensions.CardWidth.value, item.size.dp().value)
val selected = item.key == selectedKey.value
val dpSize = DpSize(size.width.dp, size.height.dp)
+ val isResizable =
+ if (item is CommunalContentModel.WidgetContent.Widget) {
+ item.providerInfo.resizeMode and AppWidgetProviderInfo.RESIZE_VERTICAL != 0
+ } else {
+ false
+ }
if (viewModel.isEditMode && dragDropState != null) {
val outlineAlpha by
@@ -755,10 +802,11 @@ private fun BoxScope.CommunalHubLazyGrid(
animationSpec = spring(stiffness = Spring.StiffnessMediumLow),
label = "Widget resizing outline alpha",
)
+ val widgetSizeInfo = calculateWidgetSize(item, isResizable)
ResizableItemFrameWrapper(
key = item.key,
+ currentSpan = GridItemSpan(item.size.span),
gridState = gridState,
- minItemSpan = CommunalContentSize.HALF.span,
gridContentPadding = contentPadding,
verticalArrangement = itemArrangement,
enabled = selected,
@@ -772,6 +820,8 @@ private fun BoxScope.CommunalHubLazyGrid(
)
},
onResize = { resizeInfo -> contentListState.resize(index, resizeInfo) },
+ minHeightPx = widgetSizeInfo.minHeightPx,
+ maxHeightPx = widgetSizeInfo.maxHeightPx,
) { modifier ->
DraggableItem(
modifier = modifier,
@@ -781,7 +831,7 @@ private fun BoxScope.CommunalHubLazyGrid(
key = item.key,
) { isDragging ->
CommunalContent(
- modifier = Modifier.fillMaxSize(),
+ modifier = Modifier.requiredSize(dpSize),
model = item,
viewModel = viewModel,
size = size,
@@ -1556,23 +1606,6 @@ private fun beforeContentPadding(paddingValues: PaddingValues): ContentPaddingIn
}
}
-/**
- * Check whether the pointer position that the item is being dragged at is within the coordinates of
- * the remove button in the toolbar. Returns true if the item is removable.
- */
-@VisibleForTesting
-fun isPointerWithinEnabledRemoveButton(
- removeEnabled: Boolean,
- offset: Offset?,
- containerToCheck: LayoutCoordinates?,
-): Boolean {
- if (!removeEnabled || offset == null || containerToCheck == null) {
- return false
- }
- val container = containerToCheck.boundsInWindow()
- return container.contains(offset)
-}
-
private fun CommunalContentSize.dp(): Dp {
return when (this) {
CommunalContentSize.FULL -> Dimensions.CardHeightFull
@@ -1656,6 +1689,8 @@ class Dimensions(val context: Context, val config: Configuration) {
}
}
+data class WidgetSizeInfo(val minHeightPx: Int, val maxHeightPx: Int)
+
private object Colors {
val DisabledColorFilter by lazy { disabledColorMatrix() }
diff --git a/packages/SystemUI/compose/features/src/com/android/systemui/communal/ui/compose/GridDragDropState.kt b/packages/SystemUI/compose/features/src/com/android/systemui/communal/ui/compose/GridDragDropState.kt
index 0718bc331d41..5feb63df0bca 100644
--- a/packages/SystemUI/compose/features/src/com/android/systemui/communal/ui/compose/GridDragDropState.kt
+++ b/packages/SystemUI/compose/features/src/com/android/systemui/communal/ui/compose/GridDragDropState.kt
@@ -58,11 +58,11 @@ private fun Float.directional(origin: LayoutDirection, current: LayoutDirection)
fun rememberGridDragDropState(
gridState: LazyGridState,
contentListState: ContentListState,
- updateDragPositionForRemove: (offset: Offset) -> Boolean,
+ updateDragPositionForRemove: (boundingBox: IntRect) -> Boolean,
): GridDragDropState {
val scope = rememberCoroutineScope()
val state =
- remember(gridState, contentListState) {
+ remember(gridState, contentListState, updateDragPositionForRemove) {
GridDragDropState(
state = gridState,
contentListState = contentListState,
@@ -92,7 +92,7 @@ internal constructor(
private val state: LazyGridState,
private val contentListState: ContentListState,
private val scope: CoroutineScope,
- private val updateDragPositionForRemove: (offset: Offset) -> Boolean,
+ private val updateDragPositionForRemove: (draggingBoundingBox: IntRect) -> Boolean,
) {
var draggingItemKey by mutableStateOf<Any?>(null)
private set
@@ -104,7 +104,6 @@ internal constructor(
private var draggingItemDraggedDelta by mutableStateOf(Offset.Zero)
private var draggingItemInitialOffset by mutableStateOf(Offset.Zero)
- private var dragStartPointerOffset by mutableStateOf(Offset.Zero)
private var previousTargetItemKey: Any? = null
@@ -139,7 +138,6 @@ internal constructor(
// before content padding from the initial pointer position
.firstItemAtOffset(normalizedOffset - contentOffset)
?.apply {
- dragStartPointerOffset = normalizedOffset - this.offset.toOffset()
draggingItemKey = key
draggingItemInitialOffset = this.offset.toOffset()
return true
@@ -155,7 +153,7 @@ internal constructor(
contentListState.list.indexOfFirst { it.key == draggingItemKey }
)
isDraggingToRemove = false
- updateDragPositionForRemove(Offset.Zero)
+ updateDragPositionForRemove(IntRect.Zero)
}
// persist list editing changes on dragging ends
contentListState.onSaveList()
@@ -164,7 +162,6 @@ internal constructor(
previousTargetItemKey = null
draggingItemDraggedDelta = Offset.Zero
draggingItemInitialOffset = Offset.Zero
- dragStartPointerOffset = Offset.Zero
}
internal fun onDrag(offset: Offset, layoutDirection: LayoutDirection) {
@@ -230,7 +227,7 @@ internal constructor(
if (overscroll != 0f) {
scrollChannel.trySend(overscroll)
}
- isDraggingToRemove = checkForRemove(startOffset)
+ isDraggingToRemove = checkForRemove(draggingBoundingBox)
previousTargetItemKey = null
}
}
@@ -247,10 +244,12 @@ internal constructor(
}
/** Calls the callback with the updated drag position and returns whether to remove the item. */
- private fun checkForRemove(startOffset: Offset): Boolean {
- return if (draggingItemDraggedDelta.y < 0)
- updateDragPositionForRemove(startOffset + dragStartPointerOffset)
- else false
+ private fun checkForRemove(draggingItemBoundingBox: IntRect): Boolean {
+ return if (draggingItemDraggedDelta.y < 0) {
+ updateDragPositionForRemove(draggingItemBoundingBox)
+ } else {
+ false
+ }
}
}
diff --git a/packages/SystemUI/compose/features/src/com/android/systemui/communal/ui/compose/ResizeableItemFrame.kt b/packages/SystemUI/compose/features/src/com/android/systemui/communal/ui/compose/ResizeableItemFrame.kt
index 97ad4f127c98..521330f60fa8 100644
--- a/packages/SystemUI/compose/features/src/com/android/systemui/communal/ui/compose/ResizeableItemFrame.kt
+++ b/packages/SystemUI/compose/features/src/com/android/systemui/communal/ui/compose/ResizeableItemFrame.kt
@@ -27,11 +27,14 @@ import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
+import androidx.compose.foundation.lazy.grid.GridItemSpan
import androidx.compose.foundation.lazy.grid.LazyGridState
import androidx.compose.material3.MaterialTheme
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
+import androidx.compose.runtime.derivedStateOf
import androidx.compose.runtime.getValue
+import androidx.compose.runtime.remember
import androidx.compose.runtime.rememberUpdatedState
import androidx.compose.runtime.snapshotFlow
import androidx.compose.ui.Alignment
@@ -48,6 +51,8 @@ import androidx.compose.ui.platform.LocalDensity
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import androidx.compose.ui.util.fastIsFinite
+import androidx.compose.ui.zIndex
+import com.android.compose.modifiers.thenIf
import com.android.systemui.communal.ui.viewmodel.DragHandle
import com.android.systemui.communal.ui.viewmodel.ResizeInfo
import com.android.systemui.communal.ui.viewmodel.ResizeableItemFrameViewModel
@@ -60,9 +65,12 @@ private fun UpdateGridLayoutInfo(
viewModel: ResizeableItemFrameViewModel,
key: String,
gridState: LazyGridState,
- minItemSpan: Int,
gridContentPadding: PaddingValues,
verticalArrangement: Arrangement.Vertical,
+ minHeightPx: Int,
+ maxHeightPx: Int,
+ resizeMultiple: Int,
+ currentSpan: GridItemSpan,
) {
val density = LocalDensity.current
LaunchedEffect(
@@ -70,9 +78,12 @@ private fun UpdateGridLayoutInfo(
viewModel,
key,
gridState,
- minItemSpan,
gridContentPadding,
verticalArrangement,
+ minHeightPx,
+ maxHeightPx,
+ resizeMultiple,
+ currentSpan,
) {
val verticalItemSpacingPx = with(density) { verticalArrangement.spacing.toPx() }
val verticalContentPaddingPx =
@@ -92,13 +103,15 @@ private fun UpdateGridLayoutInfo(
)
.collectLatest { (maxItemSpan, viewportHeightPx, itemInfo) ->
viewModel.setGridLayoutInfo(
- verticalItemSpacingPx,
- verticalContentPaddingPx,
- viewportHeightPx,
- maxItemSpan,
- minItemSpan,
- itemInfo?.row,
- itemInfo?.span,
+ verticalItemSpacingPx = verticalItemSpacingPx,
+ currentRow = itemInfo?.row,
+ maxHeightPx = maxHeightPx,
+ minHeightPx = minHeightPx,
+ currentSpan = currentSpan.currentLineSpan,
+ resizeMultiple = resizeMultiple,
+ totalSpans = maxItemSpan,
+ viewportHeightPx = viewportHeightPx,
+ verticalContentPaddingPx = verticalContentPaddingPx,
)
}
}
@@ -141,10 +154,9 @@ private fun BoxScope.DragHandle(
/**
* Draws a frame around the content with drag handles on the top and bottom of the content.
*
- * @param index The index of this item in the [LazyGridState].
+ * @param key The unique key of this element, must be the same key used in the [LazyGridState].
+ * @param currentSpan The current span size of this item in the grid.
* @param gridState The [LazyGridState] for the grid containing this item.
- * @param minItemSpan The minimum span that an item may occupy. Items are resized in multiples of
- * this span.
* @param gridContentPadding The content padding used for the grid, needed for determining offsets.
* @param verticalArrangement The vertical arrangement of the grid items.
* @param modifier Optional modifier to apply to the frame.
@@ -153,6 +165,10 @@ private fun BoxScope.DragHandle(
* @param outlineColor Optional color to make the outline around the content.
* @param cornerRadius Optional radius to give to the outline around the content.
* @param strokeWidth Optional stroke width to draw the outline with.
+ * @param minHeightPx Optional minimum height in pixels that this widget can be resized to.
+ * @param maxHeightPx Optional maximum height in pixels that this widget can be resized to.
+ * @param resizeMultiple Optional number of spans that we allow resizing by. For example, if set to
+ * 3, then we only allow resizing in multiples of 3 spans.
* @param alpha Optional function to provide an alpha value for the outline. Can be used to fade the
* outline in and out. This is wrapped in a function for performance, as the value is only
* accessed during the draw phase.
@@ -162,8 +178,8 @@ private fun BoxScope.DragHandle(
@Composable
fun ResizableItemFrame(
key: String,
+ currentSpan: GridItemSpan,
gridState: LazyGridState,
- minItemSpan: Int,
gridContentPadding: PaddingValues,
verticalArrangement: Arrangement.Vertical,
modifier: Modifier = Modifier,
@@ -172,6 +188,9 @@ fun ResizableItemFrame(
outlineColor: Color = MaterialTheme.colorScheme.primary,
cornerRadius: Dp = 37.dp,
strokeWidth: Dp = 3.dp,
+ minHeightPx: Int = 0,
+ maxHeightPx: Int = Int.MAX_VALUE,
+ resizeMultiple: Int = 1,
alpha: () -> Float = { 1f },
onResize: (info: ResizeInfo) -> Unit = {},
content: @Composable () -> Unit,
@@ -179,15 +198,24 @@ fun ResizableItemFrame(
val brush = SolidColor(outlineColor)
val onResizeUpdated by rememberUpdatedState(onResize)
val viewModel =
- rememberViewModel(traceName = "ResizeableItemFrame.viewModel") {
+ rememberViewModel(key = currentSpan, traceName = "ResizeableItemFrame.viewModel") {
ResizeableItemFrameViewModel()
}
val dragHandleHeight = verticalArrangement.spacing - outlinePadding * 2
+ val isDragging by
+ remember(viewModel) {
+ derivedStateOf {
+ val topOffset = viewModel.topDragState.offset.takeIf { it.fastIsFinite() } ?: 0f
+ val bottomOffset =
+ viewModel.bottomDragState.offset.takeIf { it.fastIsFinite() } ?: 0f
+ topOffset > 0 || bottomOffset > 0
+ }
+ }
// Draw content surrounded by drag handles at top and bottom. Allow drag handles
// to overlap content.
- Box(modifier) {
+ Box(modifier.thenIf(isDragging) { Modifier.zIndex(1f) }) {
content()
if (enabled) {
@@ -230,12 +258,15 @@ fun ResizableItemFrame(
}
UpdateGridLayoutInfo(
- viewModel,
- key,
- gridState,
- minItemSpan,
- gridContentPadding,
- verticalArrangement,
+ viewModel = viewModel,
+ key = key,
+ gridState = gridState,
+ currentSpan = currentSpan,
+ gridContentPadding = gridContentPadding,
+ verticalArrangement = verticalArrangement,
+ minHeightPx = minHeightPx,
+ maxHeightPx = maxHeightPx,
+ resizeMultiple = resizeMultiple,
)
LaunchedEffect(viewModel) {
viewModel.resizeInfo.collectLatest { info -> onResizeUpdated(info) }
diff --git a/packages/SystemUI/compose/features/src/com/android/systemui/notifications/ui/composable/Notifications.kt b/packages/SystemUI/compose/features/src/com/android/systemui/notifications/ui/composable/Notifications.kt
index 4c6834cf6bea..834a7f5220ab 100644
--- a/packages/SystemUI/compose/features/src/com/android/systemui/notifications/ui/composable/Notifications.kt
+++ b/packages/SystemUI/compose/features/src/com/android/systemui/notifications/ui/composable/Notifications.kt
@@ -50,9 +50,11 @@ import androidx.compose.material3.MaterialTheme
import androidx.compose.runtime.Composable
import androidx.compose.runtime.DisposableEffect
import androidx.compose.runtime.LaunchedEffect
+import androidx.compose.runtime.derivedStateOf
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableFloatStateOf
import androidx.compose.runtime.mutableIntStateOf
+import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.runtime.setValue
@@ -60,6 +62,7 @@ import androidx.compose.runtime.snapshotFlow
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.drawBehind
+import androidx.compose.ui.geometry.Rect
import androidx.compose.ui.graphics.BlendMode
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.graphicsLayer
@@ -95,13 +98,17 @@ import com.android.systemui.scene.shared.model.Overlays
import com.android.systemui.scene.shared.model.Scenes
import com.android.systemui.shade.shared.flag.DualShade
import com.android.systemui.shade.ui.composable.ShadeHeader
+import com.android.systemui.statusbar.notification.stack.shared.model.AccessibilityScrollEvent
import com.android.systemui.statusbar.notification.stack.shared.model.ShadeScrimBounds
import com.android.systemui.statusbar.notification.stack.shared.model.ShadeScrimRounding
+import com.android.systemui.statusbar.notification.stack.shared.model.ShadeScrollState
import com.android.systemui.statusbar.notification.stack.ui.view.NotificationScrollView
import com.android.systemui.statusbar.notification.stack.ui.viewmodel.NotificationTransitionThresholds.EXPANSION_FOR_MAX_CORNER_RADIUS
import com.android.systemui.statusbar.notification.stack.ui.viewmodel.NotificationTransitionThresholds.EXPANSION_FOR_MAX_SCRIM_ALPHA
import com.android.systemui.statusbar.notification.stack.ui.viewmodel.NotificationsPlaceholderViewModel
+import kotlin.math.max
import kotlin.math.roundToInt
+import kotlinx.coroutines.awaitCancellation
import kotlinx.coroutines.coroutineScope
import kotlinx.coroutines.launch
@@ -315,6 +322,12 @@ fun SceneScope.NotificationScrollingStack(
*/
val stackHeight = remember { mutableIntStateOf(0) }
+ /**
+ * Space available for the notification stack on the screen. These bounds don't scroll off the
+ * screen, and respect the scrim paddings, scrim clipping.
+ */
+ val stackBoundsOnScreen = remember { mutableStateOf(Rect.Zero) }
+
val scrimRounding =
viewModel.shadeScrimRounding.collectAsStateWithLifecycle(ShadeScrimRounding())
@@ -348,12 +361,19 @@ fun SceneScope.NotificationScrollingStack(
// The top y bound of the IME.
val imeTop = remember { mutableFloatStateOf(0f) }
- // we are not scrolled to the top unless the scrim is at its maximum offset.
- LaunchedEffect(viewModel, scrimOffset) {
- snapshotFlow { scrimOffset.value >= 0f }
- .collect { isScrolledToTop -> viewModel.setScrolledToTop(isScrolledToTop) }
+ val shadeScrollState by remember {
+ derivedStateOf {
+ ShadeScrollState(
+ // we are not scrolled to the top unless the scrim is at its maximum offset.
+ isScrolledToTop = scrimOffset.value >= 0f,
+ scrollPosition = scrollState.value,
+ maxScrollPosition = scrollState.maxValue,
+ )
+ }
}
+ LaunchedEffect(shadeScrollState) { viewModel.setScrollState(shadeScrollState) }
+
// if contentHeight drops below minimum visible scrim height while scrim is
// expanded, reset scrim offset.
LaunchedEffect(stackHeight, scrimOffset) {
@@ -395,6 +415,38 @@ fun SceneScope.NotificationScrollingStack(
}
}
+ // TalkBack sends a scroll event, when it wants to navigate to an item that is not displayed in
+ // the current viewport.
+ LaunchedEffect(viewModel) {
+ viewModel.setAccessibilityScrollEventConsumer { event ->
+ // scroll up, or down by the height of the visible portion of the notification stack
+ val direction =
+ when (event) {
+ AccessibilityScrollEvent.SCROLL_UP -> -1
+ AccessibilityScrollEvent.SCROLL_DOWN -> 1
+ }
+ val viewPortHeight = stackBoundsOnScreen.value.height
+ val scrollStep = max(0f, viewPortHeight - stackScrollView.stackBottomInset)
+ val scrollPosition = scrollState.value.toFloat()
+ val scrollRange = scrollState.maxValue.toFloat()
+ val targetScroll = (scrollPosition + direction * scrollStep).coerceIn(0f, scrollRange)
+ coroutineScope.launch {
+ scrollNotificationStack(
+ delta = targetScroll - scrollPosition,
+ animate = false,
+ scrimOffset = scrimOffset,
+ minScrimOffset = minScrimOffset,
+ scrollState = scrollState,
+ )
+ }
+ }
+ try {
+ awaitCancellation()
+ } finally {
+ viewModel.setAccessibilityScrollEventConsumer(null)
+ }
+ }
+
val scrimNestedScrollConnection =
shadeSession.rememberSession(
scrimOffset,
@@ -520,6 +572,9 @@ fun SceneScope.NotificationScrollingStack(
.verticalScroll(scrollState)
.padding(top = topPadding)
.fillMaxWidth()
+ .onGloballyPositioned { coordinates ->
+ stackBoundsOnScreen.value = coordinates.boundsInWindow()
+ }
) {
NotificationPlaceholder(
stackScrollView = stackScrollView,
diff --git a/packages/SystemUI/compose/features/src/com/android/systemui/qs/ui/composable/QuickSettingsScene.kt b/packages/SystemUI/compose/features/src/com/android/systemui/qs/ui/composable/QuickSettingsScene.kt
index d75a776a2515..0e7165c7f3ec 100644
--- a/packages/SystemUI/compose/features/src/com/android/systemui/qs/ui/composable/QuickSettingsScene.kt
+++ b/packages/SystemUI/compose/features/src/com/android/systemui/qs/ui/composable/QuickSettingsScene.kt
@@ -198,15 +198,17 @@ private fun SceneScope.QuickSettingsScene(
val shadeHorizontalPadding =
dimensionResource(id = R.dimen.notification_panel_margin_horizontal)
- BrightnessMirror(
- viewModel = brightnessMirrorViewModel,
- qsSceneAdapter = viewModel.qsSceneAdapter,
- modifier =
- Modifier.thenIf(cutoutLocation != CutoutLocation.CENTER) {
- Modifier.displayCutoutPadding()
- }
- .padding(horizontal = shadeHorizontalPadding),
- )
+ Box(modifier = Modifier.fillMaxSize()) {
+ BrightnessMirror(
+ viewModel = brightnessMirrorViewModel,
+ qsSceneAdapter = viewModel.qsSceneAdapter,
+ modifier =
+ Modifier.thenIf(cutoutLocation != CutoutLocation.CENTER) {
+ Modifier.displayCutoutPadding()
+ }
+ .align(Alignment.TopCenter),
+ )
+ }
val shouldPunchHoleBehindScrim =
layoutState.isTransitioningBetween(Scenes.Gone, Scenes.QuickSettings) ||
diff --git a/packages/SystemUI/compose/features/src/com/android/systemui/statusbar/phone/SystemUIDialogFactoryExt.kt b/packages/SystemUI/compose/features/src/com/android/systemui/statusbar/phone/SystemUIDialogFactoryExt.kt
index fe97405fab15..e9b7335197b0 100644
--- a/packages/SystemUI/compose/features/src/com/android/systemui/statusbar/phone/SystemUIDialogFactoryExt.kt
+++ b/packages/SystemUI/compose/features/src/com/android/systemui/statusbar/phone/SystemUIDialogFactoryExt.kt
@@ -16,34 +16,58 @@
package com.android.systemui.statusbar.phone
+import android.app.Dialog
import android.content.Context
import android.content.res.Configuration
import android.os.Bundle
import androidx.annotation.GravityInt
+import androidx.compose.foundation.clickable
+import androidx.compose.foundation.gestures.AnchoredDraggableDefaults
+import androidx.compose.foundation.gestures.AnchoredDraggableState
+import androidx.compose.foundation.gestures.DraggableAnchors
+import androidx.compose.foundation.gestures.Orientation
+import androidx.compose.foundation.gestures.anchoredDraggable
import androidx.compose.foundation.gestures.detectTapGestures
+import androidx.compose.foundation.interaction.MutableInteractionSource
+import androidx.compose.foundation.interaction.collectIsDraggedAsState
import androidx.compose.foundation.layout.Box
+import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.WindowInsets
+import androidx.compose.foundation.layout.offset
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.safeDrawing
+import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.widthIn
+import androidx.compose.foundation.layout.wrapContentWidth
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.LocalContentColor
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Surface
import androidx.compose.runtime.Composable
import androidx.compose.runtime.CompositionLocalProvider
+import androidx.compose.runtime.LaunchedEffect
+import androidx.compose.runtime.getValue
+import androidx.compose.runtime.remember
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.input.pointer.pointerInput
+import androidx.compose.ui.layout.onSizeChanged
import androidx.compose.ui.platform.ComposeView
import androidx.compose.ui.platform.LocalConfiguration
import androidx.compose.ui.platform.LocalDensity
import androidx.compose.ui.platform.LocalLayoutDirection
import androidx.compose.ui.res.dimensionResource
+import androidx.compose.ui.res.stringResource
+import androidx.compose.ui.semantics.contentDescription
+import androidx.compose.ui.semantics.semantics
import androidx.compose.ui.unit.Dp
+import androidx.compose.ui.unit.IntOffset
import androidx.compose.ui.unit.dp
+import androidx.compose.ui.unit.isSpecified
import com.android.compose.theme.PlatformTheme
+import com.android.systemui.keyboard.shortcut.ui.composable.hasCompactWindowSize
import com.android.systemui.res.R
+import kotlin.math.roundToInt
/**
* Create a [SystemUIDialog] with the given [content].
@@ -97,6 +121,9 @@ fun SystemUIDialogFactory.createBottomSheet(
theme: Int = R.style.Theme_SystemUI_BottomSheet,
dismissOnDeviceLock: Boolean = SystemUIDialog.DEFAULT_DISMISS_ON_DEVICE_LOCK,
content: @Composable (SystemUIDialog) -> Unit,
+ isDraggable: Boolean = true,
+ // TODO(b/337205027): remove maxWidth parameter when aligned to M3 spec
+ maxWidth: Dp = Dp.Unspecified,
): ComponentSystemUIDialog {
return create(
context = context,
@@ -104,9 +131,49 @@ fun SystemUIDialogFactory.createBottomSheet(
dismissOnDeviceLock = dismissOnDeviceLock,
delegate = EdgeToEdgeDialogDelegate(),
content = { dialog ->
+ val dragState =
+ if (isDraggable)
+ remember { AnchoredDraggableState(initialValue = DragAnchors.Start) }
+ else null
+ val interactionSource =
+ if (isDraggable) remember { MutableInteractionSource() } else null
+ if (dragState != null) {
+ val isDragged by interactionSource!!.collectIsDraggedAsState()
+ LaunchedEffect(dragState.currentValue, isDragged) {
+ if (!isDragged && dragState.currentValue == DragAnchors.End) dialog.dismiss()
+ }
+ }
Box(
- modifier = Modifier.bottomSheetClickable { dialog.dismiss() },
- contentAlignment = Alignment.BottomCenter
+ modifier =
+ Modifier.bottomSheetClickable { dialog.dismiss() }
+ .then(
+ if (isDraggable)
+ Modifier.anchoredDraggable(
+ state = dragState!!,
+ interactionSource = interactionSource,
+ orientation = Orientation.Vertical,
+ flingBehavior =
+ AnchoredDraggableDefaults.flingBehavior(
+ state = dragState
+ ),
+ )
+ .offset {
+ IntOffset(x = 0, y = dragState.requireOffset().roundToInt())
+ }
+ .onSizeChanged { layoutSize ->
+ val dragEndPoint = layoutSize.height - dialog.height
+ dragState.updateAnchors(
+ DraggableAnchors {
+ DragAnchors.entries.forEach { anchor ->
+ anchor at dragEndPoint * anchor.fraction
+ }
+ }
+ )
+ }
+ .padding(top = draggableTopPadding())
+ else Modifier // No-Op
+ ),
+ contentAlignment = Alignment.BottomCenter,
) {
val radius = dimensionResource(R.dimen.bottom_sheet_corner_radius)
Surface(
@@ -114,8 +181,11 @@ fun SystemUIDialogFactory.createBottomSheet(
Modifier.bottomSheetPaddings()
// consume input so it doesn't get to the parent Composable
.bottomSheetClickable {}
- // TODO(b/337205027) change width
- .widthIn(max = 800.dp),
+ .widthIn(
+ max =
+ if (maxWidth.isSpecified) maxWidth
+ else DraggableBottomSheet.MaxWidth
+ ),
shape = RoundedCornerShape(topStart = radius, topEnd = radius),
color = MaterialTheme.colorScheme.surfaceContainer,
) {
@@ -127,7 +197,17 @@ fun SystemUIDialogFactory.createBottomSheet(
}
)
) {
- content(dialog)
+ if (isDraggable) {
+ Column(
+ Modifier.wrapContentWidth(Alignment.CenterHorizontally),
+ horizontalAlignment = Alignment.CenterHorizontally,
+ ) {
+ DragHandle(dialog)
+ content(dialog)
+ }
+ } else {
+ content(dialog)
+ }
}
}
}
@@ -135,6 +215,11 @@ fun SystemUIDialogFactory.createBottomSheet(
)
}
+private enum class DragAnchors(val fraction: Float) {
+ Start(0f),
+ End(1f),
+}
+
private fun SystemUIDialogFactory.create(
context: Context,
theme: Int,
@@ -177,7 +262,7 @@ private fun Modifier.bottomSheetPaddings(): Modifier {
padding(
start = insets.getLeft(this, LocalLayoutDirection.current).toDp() + horizontalPadding,
top = insets.getTop(this).toDp(),
- end = insets.getRight(this, LocalLayoutDirection.current).toDp() + horizontalPadding
+ end = insets.getRight(this, LocalLayoutDirection.current).toDp() + horizontalPadding,
)
}
}
@@ -191,3 +276,32 @@ private fun Modifier.bottomSheetPaddings(): Modifier {
@Composable
private fun Modifier.bottomSheetClickable(onClick: () -> Unit) =
pointerInput(onClick) { detectTapGestures { onClick() } }
+
+@Composable
+private fun DragHandle(dialog: Dialog) {
+ // TODO(b/373340318): Rename drag handle string resource.
+ val dragHandleContentDescription =
+ stringResource(id = R.string.shortcut_helper_content_description_drag_handle)
+ Surface(
+ modifier =
+ Modifier.padding(top = 16.dp, bottom = 6.dp)
+ .semantics { contentDescription = dragHandleContentDescription }
+ .clickable { dialog.dismiss() },
+ color = MaterialTheme.colorScheme.outlineVariant,
+ shape = MaterialTheme.shapes.extraLarge,
+ ) {
+ Box(Modifier.size(width = 32.dp, height = 4.dp))
+ }
+}
+
+@Composable
+private fun draggableTopPadding(): Dp {
+ return if (hasCompactWindowSize()) DraggableBottomSheet.DefaultTopPadding
+ else DraggableBottomSheet.LargeScreenTopPadding
+}
+
+private object DraggableBottomSheet {
+ val DefaultTopPadding = 64.dp
+ val LargeScreenTopPadding = 72.dp
+ val MaxWidth = 640.dp
+}
diff --git a/packages/SystemUI/compose/features/src/com/android/systemui/volume/panel/ui/composable/VolumePanelRoot.kt b/packages/SystemUI/compose/features/src/com/android/systemui/volume/panel/ui/composable/VolumePanelRoot.kt
index 1cc0fb2aad9b..cf74785b6d4a 100644
--- a/packages/SystemUI/compose/features/src/com/android/systemui/volume/panel/ui/composable/VolumePanelRoot.kt
+++ b/packages/SystemUI/compose/features/src/com/android/systemui/volume/panel/ui/composable/VolumePanelRoot.kt
@@ -31,7 +31,6 @@ import androidx.compose.ui.semantics.paneTitle
import androidx.compose.ui.semantics.semantics
import androidx.compose.ui.unit.dp
import androidx.lifecycle.compose.collectAsStateWithLifecycle
-import com.android.compose.theme.PlatformTheme
import com.android.systemui.compose.modifiers.sysuiResTag
import com.android.systemui.res.R
import com.android.systemui.volume.panel.ui.layout.ComponentsLayout
@@ -43,30 +42,20 @@ private const val VolumePanelTestTag = "VolumePanel"
private val padding = 24.dp
@Composable
-fun VolumePanelRoot(
- viewModel: VolumePanelViewModel,
- modifier: Modifier = Modifier,
-) {
+fun VolumePanelRoot(viewModel: VolumePanelViewModel, modifier: Modifier = Modifier) {
val accessibilityTitle = stringResource(R.string.accessibility_volume_settings)
val state: VolumePanelState by viewModel.volumePanelState.collectAsStateWithLifecycle()
val components by viewModel.componentsLayout.collectAsStateWithLifecycle()
with(VolumePanelComposeScope(state)) {
components?.let { componentsState ->
- PlatformTheme {
- Components(
- componentsState,
- modifier
- .sysuiResTag(VolumePanelTestTag)
- .semantics { paneTitle = accessibilityTitle }
- .padding(
- start = padding,
- top = padding,
- end = padding,
- bottom = 20.dp,
- )
- )
- }
+ Components(
+ componentsState,
+ modifier
+ .sysuiResTag(VolumePanelTestTag)
+ .semantics { paneTitle = accessibilityTitle }
+ .padding(start = padding, top = padding, end = padding, bottom = 20.dp),
+ )
}
}
}
@@ -74,7 +63,7 @@ fun VolumePanelRoot(
@Composable
private fun VolumePanelComposeScope.Components(
layout: ComponentsLayout,
- modifier: Modifier = Modifier
+ modifier: Modifier = Modifier,
) {
val arrangement: Arrangement.Vertical =
if (isLargeScreen) {
@@ -82,14 +71,11 @@ private fun VolumePanelComposeScope.Components(
} else {
if (isPortrait) Arrangement.spacedBy(padding) else Arrangement.spacedBy(4.dp)
}
- Column(
- modifier = modifier,
- verticalArrangement = arrangement,
- ) {
+ Column(modifier = modifier, verticalArrangement = arrangement) {
if (isPortrait || isLargeScreen) {
VerticalVolumePanelContent(
modifier = Modifier.weight(weight = 1f, fill = false),
- layout = layout
+ layout = layout,
)
} else {
HorizontalVolumePanelContent(
@@ -97,23 +83,17 @@ private fun VolumePanelComposeScope.Components(
layout = layout,
)
}
- BottomBar(
- modifier = Modifier,
- layout = layout,
- )
+ BottomBar(modifier = Modifier, layout = layout)
}
}
@Composable
private fun VolumePanelComposeScope.BottomBar(
layout: ComponentsLayout,
- modifier: Modifier = Modifier
+ modifier: Modifier = Modifier,
) {
if (layout.bottomBarComponent.isVisible) {
- Box(
- modifier = modifier.fillMaxWidth(),
- contentAlignment = Alignment.Center,
- ) {
+ Box(modifier = modifier.fillMaxWidth(), contentAlignment = Alignment.Center) {
with(layout.bottomBarComponent.component as ComposeVolumePanelUiComponent) {
Content(Modifier)
}
diff --git a/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/ElementMatcher.kt b/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/ElementMatcher.kt
index ca68c256fd73..772872719ebe 100644
--- a/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/ElementMatcher.kt
+++ b/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/ElementMatcher.kt
@@ -22,19 +22,52 @@ interface ElementMatcher {
fun matches(key: ElementKey, content: ContentKey): Boolean
}
+/** Returns an [ElementMatcher] that matches any element in [content]. */
+fun inContent(content: ContentKey): ElementMatcher {
+ val matcherContent = content
+ return object : ElementMatcher {
+ override fun matches(key: ElementKey, content: ContentKey): Boolean {
+ return content == matcherContent
+ }
+ }
+}
+
+/** Returns an [ElementMatcher] that matches all elements not matching [this] matcher. */
+operator fun ElementMatcher.not(): ElementMatcher {
+ val delegate = this
+ return object : ElementMatcher {
+ override fun matches(key: ElementKey, content: ContentKey): Boolean {
+ return !delegate.matches(key, content)
+ }
+ }
+}
+
+/**
+ * Returns an [ElementMatcher] that matches all elements matching both [this] matcher and [other].
+ */
+infix fun ElementMatcher.and(other: ElementMatcher): ElementMatcher {
+ val delegate = this
+ return object : ElementMatcher {
+ override fun matches(key: ElementKey, content: ContentKey): Boolean {
+ return delegate.matches(key, content) && other.matches(key, content)
+ }
+ }
+}
+
/**
- * Returns an [ElementMatcher] that matches elements in [content] also matching [this]
- * [ElementMatcher].
+ * Returns an [ElementMatcher] that matches all elements either [this] matcher, or [other], or both.
*/
-fun ElementMatcher.inContent(content: ContentKey): ElementMatcher {
+infix fun ElementMatcher.or(other: ElementMatcher): ElementMatcher {
val delegate = this
- val matcherScene = content
return object : ElementMatcher {
override fun matches(key: ElementKey, content: ContentKey): Boolean {
- return content == matcherScene && delegate.matches(key, content)
+ return delegate.matches(key, content) || other.matches(key, content)
}
}
}
-@Deprecated("Use inContent() instead", replaceWith = ReplaceWith("inContent(scene)"))
-fun ElementMatcher.inScene(scene: SceneKey) = inContent(scene)
+@Deprecated(
+ "Use `this and inContent()` instead",
+ replaceWith = ReplaceWith("this and inContent(scene)"),
+)
+fun ElementMatcher.inScene(scene: SceneKey) = this and inContent(scene)
diff --git a/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/SceneTransitionLayoutState.kt b/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/SceneTransitionLayoutState.kt
index 3c3c612c028b..a9a8668bd304 100644
--- a/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/SceneTransitionLayoutState.kt
+++ b/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/SceneTransitionLayoutState.kt
@@ -387,11 +387,11 @@ internal class MutableSceneTransitionLayoutStateImpl(
transition.transformationSpec =
transitions
.transitionSpec(fromContent, toContent, key = transition.key)
- .transformationSpec()
+ .transformationSpec(transition)
transition.previewTransformationSpec =
transitions
.transitionSpec(fromContent, toContent, key = transition.key)
- .previewTransformationSpec()
+ .previewTransformationSpec(transition)
if (orientation != null) {
transition.updateOverscrollSpecs(
fromSpec = transitions.overscrollSpec(fromContent, orientation),
diff --git a/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/SceneTransitions.kt b/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/SceneTransitions.kt
index 879dc542552c..8866fbfbf194 100644
--- a/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/SceneTransitions.kt
+++ b/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/SceneTransitions.kt
@@ -25,6 +25,7 @@ import androidx.compose.foundation.gestures.Orientation
import androidx.compose.ui.geometry.Offset
import androidx.compose.ui.unit.IntSize
import androidx.compose.ui.util.fastForEach
+import com.android.compose.animation.scene.content.state.TransitionState
import com.android.compose.animation.scene.transformation.AnchoredSize
import com.android.compose.animation.scene.transformation.AnchoredTranslate
import com.android.compose.animation.scene.transformation.DrawScale
@@ -191,20 +192,21 @@ interface TransitionSpec {
fun reversed(): TransitionSpec
/**
- * The [TransformationSpec] associated to this [TransitionSpec].
+ * The [TransformationSpec] associated to this [TransitionSpec] for the given [transition].
*
* Note that this is called once whenever a transition associated to this [TransitionSpec] is
* started.
*/
- fun transformationSpec(): TransformationSpec
+ fun transformationSpec(transition: TransitionState.Transition): TransformationSpec
/**
- * The preview [TransformationSpec] associated to this [TransitionSpec].
+ * The preview [TransformationSpec] associated to this [TransitionSpec] for the given
+ * [transition].
*
* Note that this is called once whenever a transition associated to this [TransitionSpec] is
* started.
*/
- fun previewTransformationSpec(): TransformationSpec?
+ fun previewTransformationSpec(transition: TransitionState.Transition): TransformationSpec?
}
interface TransformationSpec {
@@ -241,7 +243,7 @@ interface TransformationSpec {
distance = null,
transformations = emptyList(),
)
- internal val EmptyProvider = { Empty }
+ internal val EmptyProvider = { _: TransitionState.Transition -> Empty }
}
}
@@ -249,9 +251,13 @@ internal class TransitionSpecImpl(
override val key: TransitionKey?,
override val from: ContentKey?,
override val to: ContentKey?,
- private val previewTransformationSpec: (() -> TransformationSpecImpl)? = null,
- private val reversePreviewTransformationSpec: (() -> TransformationSpecImpl)? = null,
- private val transformationSpec: () -> TransformationSpecImpl,
+ private val previewTransformationSpec:
+ ((TransitionState.Transition) -> TransformationSpecImpl)? =
+ null,
+ private val reversePreviewTransformationSpec:
+ ((TransitionState.Transition) -> TransformationSpecImpl)? =
+ null,
+ private val transformationSpec: (TransitionState.Transition) -> TransformationSpecImpl,
) : TransitionSpec {
override fun reversed(): TransitionSpecImpl {
return TransitionSpecImpl(
@@ -260,8 +266,8 @@ internal class TransitionSpecImpl(
to = from,
previewTransformationSpec = reversePreviewTransformationSpec,
reversePreviewTransformationSpec = previewTransformationSpec,
- transformationSpec = {
- val reverse = transformationSpec.invoke()
+ transformationSpec = { transition ->
+ val reverse = transformationSpec.invoke(transition)
TransformationSpecImpl(
progressSpec = reverse.progressSpec,
swipeSpec = reverse.swipeSpec,
@@ -272,10 +278,13 @@ internal class TransitionSpecImpl(
)
}
- override fun transformationSpec(): TransformationSpecImpl = this.transformationSpec.invoke()
+ override fun transformationSpec(
+ transition: TransitionState.Transition
+ ): TransformationSpecImpl = transformationSpec.invoke(transition)
- override fun previewTransformationSpec(): TransformationSpecImpl? =
- previewTransformationSpec?.invoke()
+ override fun previewTransformationSpec(
+ transition: TransitionState.Transition
+ ): TransformationSpecImpl? = previewTransformationSpec?.invoke(transition)
}
/** The definition of the overscroll behavior of the [content]. */
diff --git a/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/TransitionDsl.kt b/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/TransitionDsl.kt
index 763dc6bf49e0..e825c6e271ed 100644
--- a/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/TransitionDsl.kt
+++ b/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/TransitionDsl.kt
@@ -156,6 +156,9 @@ interface BaseTransitionBuilder : PropertyTransformationBuilder {
@TransitionDsl
interface TransitionBuilder : BaseTransitionBuilder {
+ /** The [TransitionState.Transition] for which we currently compute the transformations. */
+ val transition: TransitionState.Transition
+
/**
* The [AnimationSpec] used to animate the associated transition progress from `0` to `1` when
* the transition is triggered (i.e. it is not gesture-based).
diff --git a/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/TransitionDslImpl.kt b/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/TransitionDslImpl.kt
index 7ec5e4f4f149..a5ad999f7a64 100644
--- a/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/TransitionDslImpl.kt
+++ b/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/TransitionDslImpl.kt
@@ -27,6 +27,7 @@ import androidx.compose.animation.core.spring
import androidx.compose.foundation.gestures.Orientation
import androidx.compose.ui.geometry.Offset
import androidx.compose.ui.unit.Dp
+import com.android.compose.animation.scene.content.state.TransitionState
import com.android.compose.animation.scene.transformation.AnchoredSize
import com.android.compose.animation.scene.transformation.AnchoredTranslate
import com.android.compose.animation.scene.transformation.DrawScale
@@ -128,8 +129,11 @@ private class SceneTransitionsBuilderImpl : SceneTransitionsBuilder {
reversePreview: (TransitionBuilder.() -> Unit)?,
builder: TransitionBuilder.() -> Unit,
): TransitionSpec {
- fun transformationSpec(builder: TransitionBuilder.() -> Unit): TransformationSpecImpl {
- val impl = TransitionBuilderImpl().apply(builder)
+ fun transformationSpec(
+ transition: TransitionState.Transition,
+ builder: TransitionBuilder.() -> Unit,
+ ): TransformationSpecImpl {
+ val impl = TransitionBuilderImpl(transition).apply(builder)
return TransformationSpecImpl(
progressSpec = impl.spec,
swipeSpec = impl.swipeSpec,
@@ -138,17 +142,15 @@ private class SceneTransitionsBuilderImpl : SceneTransitionsBuilder {
)
}
- val previewTransformationSpec = preview?.let { { transformationSpec(it) } }
- val reversePreviewTransformationSpec = reversePreview?.let { { transformationSpec(it) } }
- val transformationSpec = { transformationSpec(builder) }
val spec =
TransitionSpecImpl(
key,
from,
to,
- previewTransformationSpec,
- reversePreviewTransformationSpec,
- transformationSpec,
+ previewTransformationSpec = preview?.let { { t -> transformationSpec(t, it) } },
+ reversePreviewTransformationSpec =
+ reversePreview?.let { { t -> transformationSpec(t, it) } },
+ transformationSpec = { t -> transformationSpec(t, builder) },
)
transitionSpecs.add(spec)
return spec
@@ -227,7 +229,8 @@ internal abstract class BaseTransitionBuilderImpl : BaseTransitionBuilder {
}
}
-internal class TransitionBuilderImpl : BaseTransitionBuilderImpl(), TransitionBuilder {
+internal class TransitionBuilderImpl(override val transition: TransitionState.Transition) :
+ BaseTransitionBuilderImpl(), TransitionBuilder {
override var spec: AnimationSpec<Float> = spring(stiffness = Spring.StiffnessLow)
override var swipeSpec: SpringSpec<Float>? = null
override var distance: UserActionDistance? = null
diff --git a/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/ElementMatcherTest.kt b/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/ElementMatcherTest.kt
new file mode 100644
index 000000000000..af0962361fb2
--- /dev/null
+++ b/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/ElementMatcherTest.kt
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.compose.animation.scene
+
+import androidx.test.ext.junit.runners.AndroidJUnit4
+import com.android.compose.animation.scene.TestElements.Bar
+import com.android.compose.animation.scene.TestElements.Foo
+import com.android.compose.animation.scene.TestScenes.SceneA
+import com.android.compose.animation.scene.TestScenes.SceneB
+import com.google.common.truth.Truth.assertThat
+import org.junit.Test
+import org.junit.runner.RunWith
+
+@RunWith(AndroidJUnit4::class)
+class ElementMatcherTest {
+ @Test
+ fun and() {
+ val matcher = Foo and inContent(SceneA)
+ assertThat(matcher.matches(Foo, SceneA)).isTrue()
+ assertThat(matcher.matches(Foo, SceneB)).isFalse()
+ assertThat(matcher.matches(Bar, SceneA)).isFalse()
+ assertThat(matcher.matches(Bar, SceneB)).isFalse()
+ }
+
+ @Test
+ fun or() {
+ val matcher = Foo or inContent(SceneA)
+ assertThat(matcher.matches(Foo, SceneA)).isTrue()
+ assertThat(matcher.matches(Foo, SceneB)).isTrue()
+ assertThat(matcher.matches(Bar, SceneA)).isTrue()
+ assertThat(matcher.matches(Bar, SceneB)).isFalse()
+ }
+
+ @Test
+ fun not() {
+ val matcher = !Foo
+ assertThat(matcher.matches(Foo, SceneA)).isFalse()
+ assertThat(matcher.matches(Foo, SceneB)).isFalse()
+ assertThat(matcher.matches(Bar, SceneA)).isTrue()
+ assertThat(matcher.matches(Bar, SceneB)).isTrue()
+ }
+}
diff --git a/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/ElementTest.kt b/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/ElementTest.kt
index 39d46990dc4b..ee807e6a7ede 100644
--- a/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/ElementTest.kt
+++ b/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/ElementTest.kt
@@ -2221,8 +2221,8 @@ class ElementTest {
// In A => B, Foo is not shared and first fades out from A then fades in
// B.
sharedElement(TestElements.Foo, enabled = false)
- fractionRange(end = 0.5f) { fade(TestElements.Foo.inContent(SceneA)) }
- fractionRange(start = 0.5f) { fade(TestElements.Foo.inContent(SceneB)) }
+ fractionRange(end = 0.5f) { fade(TestElements.Foo.inScene(SceneA)) }
+ fractionRange(start = 0.5f) { fade(TestElements.Foo.inScene(SceneB)) }
}
from(SceneB, to = SceneA) {
diff --git a/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/OverlayTest.kt b/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/OverlayTest.kt
index cae6617cb11b..7ea414d6b8cd 100644
--- a/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/OverlayTest.kt
+++ b/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/OverlayTest.kt
@@ -35,6 +35,7 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.geometry.Offset
import androidx.compose.ui.platform.testTag
+import androidx.compose.ui.test.SemanticsMatcher
import androidx.compose.ui.test.assertIsDisplayed
import androidx.compose.ui.test.assertIsNotDisplayed
import androidx.compose.ui.test.assertPositionInRootIsEqualTo
@@ -205,7 +206,8 @@ class OverlayTest {
val key = MovableElementKey("MovableBar", contents = setOf(SceneA, OverlayA, OverlayB))
val elementChildTag = "elementChildTag"
- fun elementChild(content: ContentKey) = hasTestTag(elementChildTag) and inContent(content)
+ fun elementChild(content: ContentKey) =
+ hasTestTag(elementChildTag) and SemanticsMatcher.inContent(content)
@Composable
fun ContentScope.MovableBar() {
@@ -773,7 +775,7 @@ class OverlayTest {
// Overscroll on Overlay A.
scope.launch { state.startTransition(transition(SceneA, OverlayA, progress = { 1.5f })) }
rule
- .onNode(hasTestTag(movableElementChildTag) and inContent(SceneA))
+ .onNode(hasTestTag(movableElementChildTag) and SemanticsMatcher.inContent(SceneA))
.assertPositionInRootIsEqualTo(0.dp, 0.dp)
.assertSizeIsEqualTo(100.dp)
.assertIsDisplayed()
diff --git a/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/TransitionDslTest.kt b/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/TransitionDslTest.kt
index 223af8039fed..d66d6b3ab219 100644
--- a/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/TransitionDslTest.kt
+++ b/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/TransitionDslTest.kt
@@ -23,11 +23,17 @@ import androidx.compose.animation.core.spring
import androidx.compose.animation.core.tween
import androidx.compose.foundation.gestures.Orientation
import androidx.test.ext.junit.runners.AndroidJUnit4
+import com.android.compose.animation.scene.TestScenes.SceneA
+import com.android.compose.animation.scene.TestScenes.SceneB
+import com.android.compose.animation.scene.TestScenes.SceneC
+import com.android.compose.animation.scene.content.state.TransitionState
import com.android.compose.animation.scene.transformation.OverscrollTranslate
import com.android.compose.animation.scene.transformation.Transformation
import com.android.compose.animation.scene.transformation.TransformationRange
+import com.android.compose.test.transition
import com.google.common.truth.Correspondence
import com.google.common.truth.Truth.assertThat
+import kotlinx.coroutines.test.runTest
import org.junit.Assert.assertThrows
import org.junit.Test
import org.junit.runner.RunWith
@@ -43,9 +49,9 @@ class TransitionDslTest {
@Test
fun manyTransitions() {
val transitions = transitions {
- from(TestScenes.SceneA, to = TestScenes.SceneB)
- from(TestScenes.SceneB, to = TestScenes.SceneC)
- from(TestScenes.SceneC, to = TestScenes.SceneA)
+ from(SceneA, to = SceneB)
+ from(SceneB, to = SceneC)
+ from(SceneC, to = SceneA)
}
assertThat(transitions.transitionSpecs).hasSize(3)
}
@@ -53,9 +59,9 @@ class TransitionDslTest {
@Test
fun toFromBuilders() {
val transitions = transitions {
- from(TestScenes.SceneA, to = TestScenes.SceneB)
- from(TestScenes.SceneB)
- to(TestScenes.SceneC)
+ from(SceneA, to = SceneB)
+ from(SceneB)
+ to(SceneC)
}
assertThat(transitions.transitionSpecs)
@@ -65,38 +71,34 @@ class TransitionDslTest {
"has (from, to) equal to",
)
)
- .containsExactly(
- TestScenes.SceneA to TestScenes.SceneB,
- TestScenes.SceneB to null,
- null to TestScenes.SceneC,
- )
+ .containsExactly(SceneA to SceneB, SceneB to null, null to SceneC)
}
+ private fun aToB() = transition(SceneA, SceneB)
+
@Test
fun defaultTransitionSpec() {
- val transitions = transitions { from(TestScenes.SceneA, to = TestScenes.SceneB) }
- val transformationSpec = transitions.transitionSpecs.single().transformationSpec()
+ val transitions = transitions { from(SceneA, to = SceneB) }
+ val transformationSpec = transitions.transitionSpecs.single().transformationSpec(aToB())
assertThat(transformationSpec.progressSpec).isInstanceOf(SpringSpec::class.java)
}
@Test
fun customTransitionSpec() {
val transitions = transitions {
- from(TestScenes.SceneA, to = TestScenes.SceneB) { spec = tween(durationMillis = 42) }
+ from(SceneA, to = SceneB) { spec = tween(durationMillis = 42) }
}
- val transformationSpec = transitions.transitionSpecs.single().transformationSpec()
+ val transformationSpec = transitions.transitionSpecs.single().transformationSpec(aToB())
assertThat(transformationSpec.progressSpec).isInstanceOf(TweenSpec::class.java)
assertThat((transformationSpec.progressSpec as TweenSpec).durationMillis).isEqualTo(42)
}
@Test
fun defaultRange() {
- val transitions = transitions {
- from(TestScenes.SceneA, to = TestScenes.SceneB) { fade(TestElements.Foo) }
- }
+ val transitions = transitions { from(SceneA, to = SceneB) { fade(TestElements.Foo) } }
val transformations =
- transitions.transitionSpecs.single().transformationSpec().transformations
+ transitions.transitionSpecs.single().transformationSpec(aToB()).transformations
assertThat(transformations.size).isEqualTo(1)
assertThat(transformations.single().range).isEqualTo(null)
}
@@ -104,7 +106,7 @@ class TransitionDslTest {
@Test
fun fractionRange() {
val transitions = transitions {
- from(TestScenes.SceneA, to = TestScenes.SceneB) {
+ from(SceneA, to = SceneB) {
fractionRange(start = 0.1f, end = 0.8f) { fade(TestElements.Foo) }
fractionRange(start = 0.2f) { fade(TestElements.Foo) }
fractionRange(end = 0.9f) { fade(TestElements.Foo) }
@@ -119,7 +121,7 @@ class TransitionDslTest {
}
val transformations =
- transitions.transitionSpecs.single().transformationSpec().transformations
+ transitions.transitionSpecs.single().transformationSpec(aToB()).transformations
assertThat(transformations)
.comparingElementsUsing(TRANSFORMATION_RANGE)
.containsExactly(
@@ -133,7 +135,7 @@ class TransitionDslTest {
@Test
fun timestampRange() {
val transitions = transitions {
- from(TestScenes.SceneA, to = TestScenes.SceneB) {
+ from(SceneA, to = SceneB) {
spec = tween(500)
timestampRange(startMillis = 100, endMillis = 300) { fade(TestElements.Foo) }
@@ -150,7 +152,7 @@ class TransitionDslTest {
}
val transformations =
- transitions.transitionSpecs.single().transformationSpec().transformations
+ transitions.transitionSpecs.single().transformationSpec(aToB()).transformations
assertThat(transformations)
.comparingElementsUsing(TRANSFORMATION_RANGE)
.containsExactly(
@@ -168,7 +170,7 @@ class TransitionDslTest {
@Test
fun reversed() {
val transitions = transitions {
- from(TestScenes.SceneA, to = TestScenes.SceneB) {
+ from(SceneA, to = SceneB) {
spec = tween(500)
reversed {
fractionRange(start = 0.1f, end = 0.8f) { fade(TestElements.Foo) }
@@ -178,7 +180,7 @@ class TransitionDslTest {
}
val transformations =
- transitions.transitionSpecs.single().transformationSpec().transformations
+ transitions.transitionSpecs.single().transformationSpec(aToB()).transformations
assertThat(transformations)
.comparingElementsUsing(TRANSFORMATION_RANGE)
.containsExactly(
@@ -191,8 +193,8 @@ class TransitionDslTest {
fun defaultReversed() {
val transitions = transitions {
from(
- TestScenes.SceneA,
- to = TestScenes.SceneB,
+ SceneA,
+ to = SceneB,
preview = { fractionRange(start = 0.1f, end = 0.8f) { fade(TestElements.Foo) } },
reversePreview = {
fractionRange(start = 0.5f, end = 0.6f) { fade(TestElements.Foo) }
@@ -206,10 +208,9 @@ class TransitionDslTest {
// Fetch the transition from B to A, which will automatically reverse the transition from A
// to B we defined.
- val transitionSpec =
- transitions.transitionSpec(from = TestScenes.SceneB, to = TestScenes.SceneA, key = null)
+ val transitionSpec = transitions.transitionSpec(from = SceneB, to = SceneA, key = null)
- val transformations = transitionSpec.transformationSpec().transformations
+ val transformations = transitionSpec.transformationSpec(aToB()).transformations
assertThat(transformations)
.comparingElementsUsing(TRANSFORMATION_RANGE)
@@ -218,7 +219,8 @@ class TransitionDslTest {
TransformationRange(start = 1f - 300 / 500f, end = 1f - 100 / 500f),
)
- val previewTransformations = transitionSpec.previewTransformationSpec()?.transformations
+ val previewTransformations =
+ transitionSpec.previewTransformationSpec(aToB())?.transformations
assertThat(previewTransformations)
.comparingElementsUsing(TRANSFORMATION_RANGE)
@@ -229,8 +231,8 @@ class TransitionDslTest {
fun defaultPredictiveBack() {
val transitions = transitions {
from(
- TestScenes.SceneA,
- to = TestScenes.SceneB,
+ SceneA,
+ to = SceneB,
preview = { fractionRange(start = 0.1f, end = 0.8f) { fade(TestElements.Foo) } },
) {
spec = tween(500)
@@ -243,12 +245,12 @@ class TransitionDslTest {
// transition despite it not having the PredictiveBack key set.
val transitionSpec =
transitions.transitionSpec(
- from = TestScenes.SceneA,
- to = TestScenes.SceneB,
+ from = SceneA,
+ to = SceneB,
key = TransitionKey.PredictiveBack,
)
- val transformations = transitionSpec.transformationSpec().transformations
+ val transformations = transitionSpec.transformationSpec(aToB()).transformations
assertThat(transformations)
.comparingElementsUsing(TRANSFORMATION_RANGE)
@@ -257,7 +259,8 @@ class TransitionDslTest {
TransformationRange(start = 100 / 500f, end = 300 / 500f),
)
- val previewTransformations = transitionSpec.previewTransformationSpec()?.transformations
+ val previewTransformations =
+ transitionSpec.previewTransformationSpec(aToB())?.transformations
assertThat(previewTransformations)
.comparingElementsUsing(TRANSFORMATION_RANGE)
@@ -271,10 +274,10 @@ class TransitionDslTest {
val transitions = transitions {
defaultSwipeSpec = defaultSpec
- from(TestScenes.SceneA, to = TestScenes.SceneB) {
+ from(SceneA, to = SceneB) {
// Default swipe spec.
}
- from(TestScenes.SceneA, to = TestScenes.SceneC) { swipeSpec = specFromAToC }
+ from(SceneA, to = SceneC) { swipeSpec = specFromAToC }
}
assertThat(transitions.defaultSwipeSpec).isSameInstanceAs(defaultSpec)
@@ -282,8 +285,8 @@ class TransitionDslTest {
// A => B does not have a custom spec.
assertThat(
transitions
- .transitionSpec(from = TestScenes.SceneA, to = TestScenes.SceneB, key = null)
- .transformationSpec()
+ .transitionSpec(from = SceneA, to = SceneB, key = null)
+ .transformationSpec(aToB())
.swipeSpec
)
.isNull()
@@ -291,8 +294,8 @@ class TransitionDslTest {
// A => C has a custom swipe spec.
assertThat(
transitions
- .transitionSpec(from = TestScenes.SceneA, to = TestScenes.SceneC, key = null)
- .transformationSpec()
+ .transitionSpec(from = SceneA, to = SceneC, key = null)
+ .transformationSpec(transition(from = SceneA, to = SceneC))
.swipeSpec
)
.isSameInstanceAs(specFromAToC)
@@ -301,7 +304,7 @@ class TransitionDslTest {
@Test
fun overscrollSpec() {
val transitions = transitions {
- overscroll(TestScenes.SceneA, Orientation.Vertical) {
+ overscroll(SceneA, Orientation.Vertical) {
translate(TestElements.Bar, x = { 1f }, y = { 2f })
}
}
@@ -313,9 +316,7 @@ class TransitionDslTest {
@Test
fun overscrollSpec_for_overscrollDisabled() {
- val transitions = transitions {
- overscrollDisabled(TestScenes.SceneA, Orientation.Vertical)
- }
+ val transitions = transitions { overscrollDisabled(SceneA, Orientation.Vertical) }
val overscrollSpec = transitions.overscrollSpecs.single()
assertThat(overscrollSpec.transformationSpec.transformations).isEmpty()
}
@@ -323,10 +324,24 @@ class TransitionDslTest {
@Test
fun overscrollSpec_throwIfTransformationsIsEmpty() {
assertThrows(IllegalStateException::class.java) {
- transitions { overscroll(TestScenes.SceneA, Orientation.Vertical) {} }
+ transitions { overscroll(SceneA, Orientation.Vertical) {} }
}
}
+ @Test
+ fun transitionIsPassedToBuilder() = runTest {
+ var transitionPassedToBuilder: TransitionState.Transition? = null
+ val state =
+ MutableSceneTransitionLayoutState(
+ SceneA,
+ transitions { from(SceneA, to = SceneB) { transitionPassedToBuilder = transition } },
+ )
+
+ val transition = aToB()
+ state.startTransitionImmediately(animationScope = backgroundScope, transition)
+ assertThat(transitionPassedToBuilder).isSameInstanceAs(transition)
+ }
+
companion object {
private val TRANSFORMATION_RANGE =
Correspondence.transforming<Transformation, TransformationRange?>(
diff --git a/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/transformation/SharedElementTest.kt b/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/transformation/SharedElementTest.kt
index 4877cd610875..2e3a934c2701 100644
--- a/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/transformation/SharedElementTest.kt
+++ b/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/transformation/SharedElementTest.kt
@@ -31,7 +31,7 @@ import androidx.test.ext.junit.runners.AndroidJUnit4
import com.android.compose.animation.scene.Edge
import com.android.compose.animation.scene.TestElements
import com.android.compose.animation.scene.TestScenes
-import com.android.compose.animation.scene.inContent
+import com.android.compose.animation.scene.inScene
import com.android.compose.animation.scene.testTransition
import com.android.compose.test.assertSizeIsEqualTo
import org.junit.Rule
@@ -125,10 +125,10 @@ class SharedElementTest {
sharedElement(TestElements.Foo, enabled = false)
// In SceneA, Foo leaves to the left edge.
- translate(TestElements.Foo.inContent(TestScenes.SceneA), Edge.Left)
+ translate(TestElements.Foo.inScene(TestScenes.SceneA), Edge.Left)
// In SceneB, Foo comes from the bottom edge.
- translate(TestElements.Foo.inContent(TestScenes.SceneB), Edge.Bottom)
+ translate(TestElements.Foo.inScene(TestScenes.SceneB), Edge.Bottom)
},
) {
before { onElement(TestElements.Foo).assertPositionInRootIsEqualTo(10.dp, 50.dp) }
diff --git a/packages/SystemUI/compose/scene/tests/utils/src/com/android/compose/animation/scene/TestMatchers.kt b/packages/SystemUI/compose/scene/tests/utils/src/com/android/compose/animation/scene/TestMatchers.kt
index 22450d32ea62..b3201d0daffe 100644
--- a/packages/SystemUI/compose/scene/tests/utils/src/com/android/compose/animation/scene/TestMatchers.kt
+++ b/packages/SystemUI/compose/scene/tests/utils/src/com/android/compose/animation/scene/TestMatchers.kt
@@ -25,11 +25,11 @@ fun isElement(element: ElementKey, content: ContentKey? = null): SemanticsMatche
return if (content == null) {
hasTestTag(element.testTag)
} else {
- hasTestTag(element.testTag) and inContent(content)
+ hasTestTag(element.testTag) and SemanticsMatcher.inContent(content)
}
}
/** A [SemanticsMatcher] that matches anything inside [content]. */
-fun inContent(content: ContentKey): SemanticsMatcher {
+fun SemanticsMatcher.Companion.inContent(content: ContentKey): SemanticsMatcher {
return hasAnyAncestor(hasTestTag(content.testTag))
}
diff --git a/packages/SystemUI/customization/src/com/android/systemui/shared/clocks/AssetLoader.kt b/packages/SystemUI/customization/src/com/android/systemui/shared/clocks/AssetLoader.kt
index d001ef966c13..031fbabb239f 100644
--- a/packages/SystemUI/customization/src/com/android/systemui/shared/clocks/AssetLoader.kt
+++ b/packages/SystemUI/customization/src/com/android/systemui/shared/clocks/AssetLoader.kt
@@ -68,7 +68,10 @@ private constructor(
seedColor = null,
overrideChroma = null,
typefaceCache =
- TypefaceCache(messageBuffer) { Typeface.createFromAsset(pluginCtx.assets, it) },
+ TypefaceCache(messageBuffer) {
+ // TODO(b/364680873): Move constant to config_clockFontFamily when shipping
+ return@TypefaceCache Typeface.create("google-sans-flex-clock", Typeface.NORMAL)
+ },
getThemeSeedColor = getThemeSeedColor ?: Companion::getThemeSeedColor,
messageBuffer = messageBuffer,
)
diff --git a/packages/SystemUI/customization/src/com/android/systemui/shared/clocks/DefaultClockProvider.kt b/packages/SystemUI/customization/src/com/android/systemui/shared/clocks/DefaultClockProvider.kt
index 3903dbaf64c6..900971bc3927 100644
--- a/packages/SystemUI/customization/src/com/android/systemui/shared/clocks/DefaultClockProvider.kt
+++ b/packages/SystemUI/customization/src/com/android/systemui/shared/clocks/DefaultClockProvider.kt
@@ -17,6 +17,8 @@ import android.content.Context
import android.content.res.Resources
import android.view.LayoutInflater
import com.android.systemui.customization.R
+import com.android.systemui.log.core.LogLevel
+import com.android.systemui.log.core.LogcatOnlyMessageBuffer
import com.android.systemui.plugins.clocks.ClockController
import com.android.systemui.plugins.clocks.ClockId
import com.android.systemui.plugins.clocks.ClockMessageBuffers
@@ -53,7 +55,9 @@ class DefaultClockProvider(
}
return if (clockReactiveVariants) {
- val assets = AssetLoader(ctx, ctx, "clocks/", messageBuffers!!.infraMessageBuffer)
+ val buffer =
+ messageBuffers?.infraMessageBuffer ?: LogcatOnlyMessageBuffer(LogLevel.INFO)
+ val assets = AssetLoader(ctx, ctx, "clocks/", buffer)
FlexClockController(ctx, resources, assets, FLEX_DESIGN, messageBuffers)
} else {
DefaultClockController(
diff --git a/packages/SystemUI/customization/src/com/android/systemui/shared/clocks/FlexClockFaceController.kt b/packages/SystemUI/customization/src/com/android/systemui/shared/clocks/FlexClockFaceController.kt
index ef24d2ad3071..9067fb094634 100644
--- a/packages/SystemUI/customization/src/com/android/systemui/shared/clocks/FlexClockFaceController.kt
+++ b/packages/SystemUI/customization/src/com/android/systemui/shared/clocks/FlexClockFaceController.kt
@@ -71,7 +71,7 @@ class FlexClockFaceController(
val layer = face.layers[0]
layerController =
- if (isLargeClock)
+ if (isLargeClock) {
ComposedDigitalLayerController(
ctx,
resources,
@@ -79,7 +79,7 @@ class FlexClockFaceController(
layer as ComposedDigitalHandLayer,
messageBuffer,
)
- else {
+ } else {
val childView = SimpleDigitalClockTextView(ctx, messageBuffer)
SimpleDigitalHandLayerController(
ctx,
diff --git a/packages/SystemUI/multivalentTests/src/com/android/keyguard/KeyguardClockSwitchControllerBaseTest.java b/packages/SystemUI/multivalentTests/src/com/android/keyguard/KeyguardClockSwitchControllerBaseTest.java
index 00c5577b8017..ce57fe256798 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/keyguard/KeyguardClockSwitchControllerBaseTest.java
+++ b/packages/SystemUI/multivalentTests/src/com/android/keyguard/KeyguardClockSwitchControllerBaseTest.java
@@ -18,8 +18,6 @@ package com.android.keyguard;
import static android.view.View.INVISIBLE;
-import static com.android.systemui.flags.Flags.LOCKSCREEN_WALLPAPER_DREAM_ENABLED;
-
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.atLeast;
import static org.mockito.Mockito.mock;
@@ -171,7 +169,6 @@ public class KeyguardClockSwitchControllerBaseTest extends SysuiTestCase {
when(mSmartspaceController.buildAndConnectView(any())).thenReturn(mFakeSmartspaceView);
mExecutor = new FakeExecutor(new FakeSystemClock());
mFakeFeatureFlags = new FakeFeatureFlags();
- mFakeFeatureFlags.set(LOCKSCREEN_WALLPAPER_DREAM_ENABLED, false);
mController = new KeyguardClockSwitchController(
mView,
mStatusBarStateController,
@@ -188,7 +185,6 @@ public class KeyguardClockSwitchControllerBaseTest extends SysuiTestCase {
mLogBuffer,
KeyguardInteractorFactory.create(mFakeFeatureFlags).getKeyguardInteractor(),
mKeyguardClockInteractor,
- mFakeFeatureFlags,
mock(InWindowLauncherUnlockAnimationManager.class)
);
diff --git a/packages/SystemUI/multivalentTests/src/com/android/keyguard/KeyguardClockSwitchControllerWithCoroutinesTest.kt b/packages/SystemUI/multivalentTests/src/com/android/keyguard/KeyguardClockSwitchControllerWithCoroutinesTest.kt
deleted file mode 100644
index c2c0f5713d9b..000000000000
--- a/packages/SystemUI/multivalentTests/src/com/android/keyguard/KeyguardClockSwitchControllerWithCoroutinesTest.kt
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Copyright (C) 2023 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.keyguard
-
-import android.view.View
-import androidx.test.ext.junit.runners.AndroidJUnit4
-import androidx.test.filters.SmallTest
-import com.android.systemui.flags.Flags.LOCKSCREEN_WALLPAPER_DREAM_ENABLED
-import kotlinx.coroutines.Dispatchers
-import kotlinx.coroutines.runBlocking
-import org.junit.Assert.assertEquals
-import org.junit.Test
-import org.junit.runner.RunWith
-
-@RunWith(AndroidJUnit4::class)
-@SmallTest
-class KeyguardClockSwitchControllerWithCoroutinesTest : KeyguardClockSwitchControllerBaseTest() {
-
- @Test
- fun testStatusAreaVisibility_onLockscreenHostedDreamStateChanged() =
- runBlocking(IMMEDIATE) {
- // GIVEN starting state for the keyguard clock and wallpaper dream enabled
- mFakeFeatureFlags.set(LOCKSCREEN_WALLPAPER_DREAM_ENABLED, true)
- init()
-
- // WHEN dreaming starts
- mController.mIsActiveDreamLockscreenHostedCallback.accept(
- true /* isActiveDreamLockscreenHosted */
- )
-
- // THEN the status area is hidden
- mExecutor.runAllReady()
- assertEquals(View.INVISIBLE, mStatusArea.visibility)
-
- // WHEN dreaming stops
- mController.mIsActiveDreamLockscreenHostedCallback.accept(
- false /* isActiveDreamLockscreenHosted */
- )
- mExecutor.runAllReady()
-
- // THEN status area view is visible
- assertEquals(View.VISIBLE, mStatusArea.visibility)
- }
-
- companion object {
- private val IMMEDIATE = Dispatchers.Main.immediate
- }
-}
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/accessibility/hearingaid/HearingDevicesDialogDelegateTest.java b/packages/SystemUI/multivalentTests/src/com/android/systemui/accessibility/hearingaid/HearingDevicesDialogDelegateTest.java
index 662815ee7cbe..fcb433b5db4e 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/accessibility/hearingaid/HearingDevicesDialogDelegateTest.java
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/accessibility/hearingaid/HearingDevicesDialogDelegateTest.java
@@ -46,7 +46,9 @@ import android.platform.test.annotations.EnableFlags;
import android.provider.Settings;
import android.testing.TestableLooper;
import android.view.View;
+import android.view.ViewGroup;
import android.widget.LinearLayout;
+import android.widget.Space;
import android.widget.Spinner;
import androidx.test.ext.junit.runners.AndroidJUnit4;
@@ -226,7 +228,7 @@ public class HearingDevicesDialogDelegateTest extends SysuiTestCase {
mDialog.show();
LinearLayout relatedToolsView = (LinearLayout) getRelatedToolsView(mDialog);
- assertThat(relatedToolsView.getChildCount()).isEqualTo(1);
+ assertThat(countChildWithoutSpace(relatedToolsView)).isEqualTo(1);
}
@Test
@@ -244,12 +246,13 @@ public class HearingDevicesDialogDelegateTest extends SysuiTestCase {
when(mActivityInfo.loadLabel(mPackageManager)).thenReturn(TEST_LABEL);
when(mActivityInfo.loadIcon(mPackageManager)).thenReturn(mDrawable);
when(mActivityInfo.getComponentName()).thenReturn(TEST_COMPONENT);
+ when(mDrawable.mutate()).thenReturn(mDrawable);
setUpPairNewDeviceDialog();
mDialog.show();
LinearLayout relatedToolsView = (LinearLayout) getRelatedToolsView(mDialog);
- assertThat(relatedToolsView.getChildCount()).isEqualTo(2);
+ assertThat(countChildWithoutSpace(relatedToolsView)).isEqualTo(2);
}
@Test
@@ -364,6 +367,16 @@ public class HearingDevicesDialogDelegateTest extends SysuiTestCase {
return dialog.requireViewById(R.id.preset_spinner);
}
+ private int countChildWithoutSpace(ViewGroup viewGroup) {
+ int spaceCount = 0;
+ for (int i = 0; i < viewGroup.getChildCount(); i++) {
+ if (viewGroup.getChildAt(i) instanceof Space) {
+ spaceCount++;
+ }
+ }
+ return viewGroup.getChildCount() - spaceCount;
+ }
+
@After
public void reset() {
if (mDialogDelegate != null) {
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/accessibility/hearingaid/HearingDevicesToolItemParserTest.java b/packages/SystemUI/multivalentTests/src/com/android/systemui/accessibility/hearingaid/HearingDevicesToolItemParserTest.java
index 17ce1ddee87a..77369f7ec881 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/accessibility/hearingaid/HearingDevicesToolItemParserTest.java
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/accessibility/hearingaid/HearingDevicesToolItemParserTest.java
@@ -85,7 +85,7 @@ public class HearingDevicesToolItemParserTest extends SysuiTestCase {
}
@Test
- public void parseStringArray_noString_emptyResult() {
+ public void parseStringArray_noToolName_emptyResult() {
assertThat(HearingDevicesToolItemParser.parseStringArray(mContext, new String[]{},
new String[]{})).isEqualTo(emptyList());
}
@@ -103,14 +103,14 @@ public class HearingDevicesToolItemParserTest extends SysuiTestCase {
}
@Test
- public void parseStringArray_fourToolName_maxThreeToolItem() {
+ public void parseStringArray_threeToolNames_maxTwoToolItems() {
String componentNameString = TEST_PKG + "/" + TEST_CLS;
- String[] fourToolName =
- new String[]{componentNameString, componentNameString, componentNameString,
- componentNameString};
+ String[] threeToolNames =
+ new String[]{componentNameString, componentNameString, componentNameString};
List<ToolItem> toolItemList = HearingDevicesToolItemParser.parseStringArray(mContext,
- fourToolName, new String[]{});
+ threeToolNames, new String[]{});
+
assertThat(toolItemList.size()).isEqualTo(HearingDevicesToolItemParser.MAX_NUM);
}
@@ -120,6 +120,7 @@ public class HearingDevicesToolItemParserTest extends SysuiTestCase {
List<ToolItem> toolItemList = HearingDevicesToolItemParser.parseStringArray(mContext,
wrongFormatToolName, new String[]{});
+
assertThat(toolItemList.size()).isEqualTo(0);
}
@@ -129,6 +130,7 @@ public class HearingDevicesToolItemParserTest extends SysuiTestCase {
List<ToolItem> toolItemList = HearingDevicesToolItemParser.parseStringArray(mContext,
notExistToolName, new String[]{});
+
assertThat(toolItemList.size()).isEqualTo(0);
}
}
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/communal/ui/compose/CommunalHubUtilsTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/communal/ui/compose/CommunalHubUtilsTest.kt
deleted file mode 100644
index 643063e738da..000000000000
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/communal/ui/compose/CommunalHubUtilsTest.kt
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright (C) 2024 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.systemui.communal.ui.compose
-
-import android.testing.TestableLooper
-import androidx.compose.ui.geometry.Offset
-import androidx.compose.ui.layout.LayoutCoordinates
-import androidx.test.ext.junit.runners.AndroidJUnit4
-import androidx.test.filters.SmallTest
-import com.android.systemui.SysuiTestCase
-import com.google.common.truth.Truth.assertThat
-import org.junit.Test
-import org.junit.runner.RunWith
-import org.mockito.kotlin.mock
-
-@RunWith(AndroidJUnit4::class)
-@TestableLooper.RunWithLooper(setAsMainLooper = true)
-@SmallTest
-class CommunalHubUtilsTest : SysuiTestCase() {
- @Test
- fun isPointerWithinEnabledRemoveButton_ensureDisabledStatePriority() {
- assertThat(
- isPointerWithinEnabledRemoveButton(false, mock<Offset>(), mock<LayoutCoordinates>())
- )
- .isFalse()
- }
-}
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/communal/ui/viewmodel/ResizeableItemFrameViewModelTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/communal/ui/viewmodel/ResizeableItemFrameViewModelTest.kt
index f0d88ab41ad4..22b114c632cd 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/communal/ui/viewmodel/ResizeableItemFrameViewModelTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/communal/ui/viewmodel/ResizeableItemFrameViewModelTest.kt
@@ -26,7 +26,6 @@ import com.android.systemui.kosmos.testScope
import com.android.systemui.lifecycle.activateIn
import com.android.systemui.testKosmos
import com.google.common.truth.Truth.assertThat
-import kotlin.time.Duration
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.test.TestScope
import kotlinx.coroutines.test.runCurrent
@@ -53,10 +52,12 @@ class ResizeableItemFrameViewModelTest : SysuiTestCase() {
verticalItemSpacingPx = 10f,
verticalContentPaddingPx = verticalContentPaddingPx,
viewportHeightPx = viewportHeightPx,
- maxItemSpan = 1,
- minItemSpan = 1,
- currentSpan = 1,
currentRow = 0,
+ currentSpan = 1,
+ maxHeightPx = Int.MAX_VALUE,
+ minHeightPx = 0,
+ resizeMultiple = 1,
+ totalSpans = 1,
)
@Before
@@ -79,7 +80,7 @@ class ResizeableItemFrameViewModelTest : SysuiTestCase() {
@Test
fun testSingleSpanGrid() =
- testScope.runTest(timeout = Duration.INFINITE) {
+ testScope.runTest {
updateGridLayout(singleSpanGrid)
val topState = underTest.topDragState
@@ -98,8 +99,7 @@ class ResizeableItemFrameViewModelTest : SysuiTestCase() {
@Test
fun testTwoSpanGrid_elementInFirstRow_sizeSingleSpan() =
testScope.runTest {
- updateGridLayout(singleSpanGrid.copy(maxItemSpan = 2))
-
+ updateGridLayout(singleSpanGrid.copy(currentRow = 0, totalSpans = 2))
val topState = underTest.topDragState
assertThat(topState.currentValue).isEqualTo(0)
assertThat(topState.anchors.toList()).containsExactly(0 to 0f)
@@ -116,8 +116,7 @@ class ResizeableItemFrameViewModelTest : SysuiTestCase() {
@Test
fun testTwoSpanGrid_elementInSecondRow_sizeSingleSpan() =
testScope.runTest {
- updateGridLayout(singleSpanGrid.copy(maxItemSpan = 2, currentRow = 1))
-
+ updateGridLayout(singleSpanGrid.copy(currentRow = 1, totalSpans = 2))
val topState = underTest.topDragState
assertThat(topState.currentValue).isEqualTo(0)
assertThat(topState.anchors.toList()).containsExactly(0 to 0f, -1 to -45f)
@@ -134,15 +133,17 @@ class ResizeableItemFrameViewModelTest : SysuiTestCase() {
@Test
fun testTwoSpanGrid_elementInFirstRow_sizeTwoSpan() =
testScope.runTest {
- updateGridLayout(singleSpanGrid.copy(maxItemSpan = 2, currentSpan = 2))
+ val adjustedGridLayout = singleSpanGrid.copy(currentSpan = 2, totalSpans = 2)
+
+ updateGridLayout(adjustedGridLayout)
val topState = underTest.topDragState
- assertThat(topState.currentValue).isEqualTo(0)
assertThat(topState.anchors.toList()).containsExactly(0 to 0f)
+ assertThat(topState.currentValue).isEqualTo(0)
val bottomState = underTest.bottomDragState
+ assertThat(bottomState.anchors.toList()).containsExactly(-1 to -45f, 0 to 0f)
assertThat(bottomState.currentValue).isEqualTo(0)
- assertThat(bottomState.anchors.toList()).containsExactly(0 to 0f, -1 to -45f)
}
/**
@@ -151,7 +152,10 @@ class ResizeableItemFrameViewModelTest : SysuiTestCase() {
@Test
fun testThreeSpanGrid_elementInMiddleRow_sizeOneSpan() =
testScope.runTest {
- updateGridLayout(singleSpanGrid.copy(maxItemSpan = 3, currentRow = 1))
+ val adjustedGridLayout =
+ singleSpanGrid.copy(currentRow = 1, currentSpan = 1, totalSpans = 3)
+
+ updateGridLayout(adjustedGridLayout)
val topState = underTest.topDragState
assertThat(topState.currentValue).isEqualTo(0)
@@ -165,7 +169,10 @@ class ResizeableItemFrameViewModelTest : SysuiTestCase() {
@Test
fun testThreeSpanGrid_elementInTopRow_sizeOneSpan() =
testScope.runTest {
- updateGridLayout(singleSpanGrid.copy(maxItemSpan = 3))
+ val adjustedGridLayout =
+ singleSpanGrid.copy(currentRow = 0, currentSpan = 1, totalSpans = 3)
+
+ updateGridLayout(adjustedGridLayout)
val topState = underTest.topDragState
assertThat(topState.currentValue).isEqualTo(0)
@@ -177,16 +184,17 @@ class ResizeableItemFrameViewModelTest : SysuiTestCase() {
}
@Test
- fun testSixSpanGrid_minSpanThree_itemInThirdRow_sizeThreeSpans() =
+ fun testSixSpanGrid_minSpanThree_itemInFourthRow_sizeThreeSpans() =
testScope.runTest {
- updateGridLayout(
+ val adjustedGridLayout =
singleSpanGrid.copy(
- maxItemSpan = 6,
currentRow = 3,
currentSpan = 3,
- minItemSpan = 3,
+ resizeMultiple = 3,
+ totalSpans = 6,
)
- )
+
+ updateGridLayout(adjustedGridLayout)
val topState = underTest.topDragState
assertThat(topState.currentValue).isEqualTo(0)
@@ -200,7 +208,14 @@ class ResizeableItemFrameViewModelTest : SysuiTestCase() {
@Test
fun testTwoSpanGrid_elementMovesFromFirstRowToSecondRow() =
testScope.runTest {
- updateGridLayout(singleSpanGrid.copy(maxItemSpan = 2))
+ val firstRowLayout =
+ singleSpanGrid.copy(
+ currentRow = 0,
+ currentSpan = 1,
+ resizeMultiple = 1,
+ totalSpans = 2,
+ )
+ updateGridLayout(firstRowLayout)
val topState = underTest.topDragState
val bottomState = underTest.bottomDragState
@@ -208,7 +223,8 @@ class ResizeableItemFrameViewModelTest : SysuiTestCase() {
assertThat(topState.anchors.toList()).containsExactly(0 to 0f)
assertThat(bottomState.anchors.toList()).containsExactly(0 to 0f, 1 to 45f)
- updateGridLayout(singleSpanGrid.copy(maxItemSpan = 2, currentRow = 1))
+ val secondRowLayout = firstRowLayout.copy(currentRow = 1)
+ updateGridLayout(secondRowLayout)
assertThat(topState.anchors.toList()).containsExactly(0 to 0f, -1 to -45f)
assertThat(bottomState.anchors.toList()).containsExactly(0 to 0f)
@@ -217,19 +233,21 @@ class ResizeableItemFrameViewModelTest : SysuiTestCase() {
@Test
fun testTwoSpanGrid_expandElementFromBottom() = runTestWithSnapshots {
val resizeInfo by collectLastValue(underTest.resizeInfo)
- updateGridLayout(singleSpanGrid.copy(maxItemSpan = 2))
- assertThat(resizeInfo).isNull()
+ val adjustedGridLayout = singleSpanGrid.copy(resizeMultiple = 1, totalSpans = 2)
+
+ updateGridLayout(adjustedGridLayout)
+
underTest.bottomDragState.anchoredDrag { dragTo(45f) }
+
assertThat(resizeInfo).isEqualTo(ResizeInfo(1, DragHandle.BOTTOM))
}
@Test
fun testThreeSpanGrid_expandMiddleElementUpwards() = runTestWithSnapshots {
val resizeInfo by collectLastValue(underTest.resizeInfo)
- updateGridLayout(singleSpanGrid.copy(maxItemSpan = 3, currentRow = 1))
+ updateGridLayout(singleSpanGrid.copy(currentRow = 1, totalSpans = 3))
- assertThat(resizeInfo).isNull()
underTest.topDragState.anchoredDrag { dragTo(-30f) }
assertThat(resizeInfo).isEqualTo(ResizeInfo(1, DragHandle.TOP))
}
@@ -237,7 +255,7 @@ class ResizeableItemFrameViewModelTest : SysuiTestCase() {
@Test
fun testThreeSpanGrid_expandTopElementDownBy2Spans() = runTestWithSnapshots {
val resizeInfo by collectLastValue(underTest.resizeInfo)
- updateGridLayout(singleSpanGrid.copy(maxItemSpan = 3))
+ updateGridLayout(singleSpanGrid.copy(totalSpans = 3))
assertThat(resizeInfo).isNull()
underTest.bottomDragState.anchoredDrag { dragTo(60f) }
@@ -247,7 +265,7 @@ class ResizeableItemFrameViewModelTest : SysuiTestCase() {
@Test
fun testTwoSpanGrid_shrinkElementFromBottom() = runTestWithSnapshots {
val resizeInfo by collectLastValue(underTest.resizeInfo)
- updateGridLayout(singleSpanGrid.copy(maxItemSpan = 2, currentSpan = 2))
+ updateGridLayout(singleSpanGrid.copy(totalSpans = 2, currentSpan = 2))
assertThat(resizeInfo).isNull()
underTest.bottomDragState.anchoredDrag { dragTo(-45f) }
@@ -257,7 +275,7 @@ class ResizeableItemFrameViewModelTest : SysuiTestCase() {
@Test
fun testRowInfoBecomesNull_revertsBackToDefault() =
testScope.runTest {
- val gridLayout = singleSpanGrid.copy(maxItemSpan = 3, currentRow = 1)
+ val gridLayout = singleSpanGrid.copy(currentRow = 1, resizeMultiple = 1, totalSpans = 3)
updateGridLayout(gridLayout)
val topState = underTest.topDragState
@@ -266,44 +284,113 @@ class ResizeableItemFrameViewModelTest : SysuiTestCase() {
val bottomState = underTest.bottomDragState
assertThat(bottomState.anchors.toList()).containsExactly(0 to 0f, 1 to 30f)
+ // Set currentRow to null to simulate the row info becoming null
updateGridLayout(gridLayout.copy(currentRow = null))
assertThat(topState.anchors.toList()).containsExactly(0 to 0f)
assertThat(bottomState.anchors.toList()).containsExactly(0 to 0f)
}
- @Test(expected = IllegalArgumentException::class)
- fun testIllegalState_maxSpanSmallerThanMinSpan() =
+ @Test
+ fun testEqualMaxAndMinHeight_cannotResize() =
testScope.runTest {
- updateGridLayout(singleSpanGrid.copy(maxItemSpan = 2, minItemSpan = 3))
+ val heightPx = 20
+ updateGridLayout(
+ singleSpanGrid.copy(maxHeightPx = heightPx, minHeightPx = heightPx, totalSpans = 2)
+ )
+
+ val topState = underTest.topDragState
+ val bottomState = underTest.bottomDragState
+
+ assertThat(topState.anchors.toList()).containsExactly(0 to 0f)
+ assertThat(bottomState.anchors.toList()).containsExactly(0 to 0f)
}
- @Test(expected = IllegalArgumentException::class)
- fun testIllegalState_minSpanOfZero() =
+ @Test
+ fun testMinHeightTwoRows_canExpandButNotShrink() =
testScope.runTest {
- updateGridLayout(singleSpanGrid.copy(maxItemSpan = 2, minItemSpan = 0))
+ val threeRowGrid =
+ singleSpanGrid.copy(
+ maxHeightPx = 80,
+ minHeightPx = 50,
+ totalSpans = 3,
+ currentSpan = 2,
+ currentRow = 0,
+ )
+
+ updateGridLayout(threeRowGrid)
+
+ val topState = underTest.topDragState
+ val bottomState = underTest.bottomDragState
+ assertThat(topState.anchors.toList()).containsExactly(0 to 0f)
+ assertThat(bottomState.anchors.toList()).containsAtLeast(0 to 0f, 1 to 30f)
}
- @Test(expected = IllegalArgumentException::class)
- fun testIllegalState_maxSpanOfZero() =
+ @Test
+ fun testMaxHeightTwoRows_canShrinkButNotExpand() =
testScope.runTest {
- updateGridLayout(singleSpanGrid.copy(maxItemSpan = 0, minItemSpan = 0))
+ val threeRowGrid =
+ singleSpanGrid.copy(
+ maxHeightPx = 50,
+ minHeightPx = 20,
+ totalSpans = 3,
+ currentSpan = 2,
+ currentRow = 0,
+ )
+
+ updateGridLayout(threeRowGrid)
+
+ val topState = underTest.topDragState
+ val bottomState = underTest.bottomDragState
+
+ assertThat(bottomState.anchors.toList()).containsExactly(0 to 0f, -1 to -30f)
+
+ assertThat(topState.anchors.toList()).containsExactly(0 to 0f)
+ }
+
+ @Test
+ fun testMinHeightEqualToAvailableSpan_cannotResize() =
+ testScope.runTest {
+ val twoRowGrid =
+ singleSpanGrid.copy(
+ minHeightPx = (viewportHeightPx - verticalContentPaddingPx.toInt()),
+ totalSpans = 2,
+ currentSpan = 2,
+ )
+
+ updateGridLayout(twoRowGrid)
+
+ val topState = underTest.topDragState
+ val bottomState = underTest.bottomDragState
+
+ assertThat(topState.anchors.toList()).containsExactly(0 to 0f)
+ assertThat(bottomState.anchors.toList()).containsExactly(0 to 0f)
}
@Test(expected = IllegalArgumentException::class)
- fun testIllegalState_currentRowNotMultipleOfMinSpan() =
+ fun testIllegalState_maxHeightLessThanMinHeight() =
testScope.runTest {
- updateGridLayout(singleSpanGrid.copy(maxItemSpan = 6, minItemSpan = 3, currentSpan = 2))
+ updateGridLayout(singleSpanGrid.copy(maxHeightPx = 50, minHeightPx = 100))
}
+ @Test(expected = IllegalArgumentException::class)
+ fun testIllegalState_currentSpanExceedsTotalSpans() =
+ testScope.runTest { updateGridLayout(singleSpanGrid.copy(currentSpan = 3, totalSpans = 2)) }
+
+ @Test(expected = IllegalArgumentException::class)
+ fun testIllegalState_resizeMultipleZeroOrNegative() =
+ testScope.runTest { updateGridLayout(singleSpanGrid.copy(resizeMultiple = 0)) }
+
private fun TestScope.updateGridLayout(gridLayout: GridLayout) {
underTest.setGridLayoutInfo(
- gridLayout.verticalItemSpacingPx,
- gridLayout.verticalContentPaddingPx,
- gridLayout.viewportHeightPx,
- gridLayout.maxItemSpan,
- gridLayout.minItemSpan,
- gridLayout.currentRow,
- gridLayout.currentSpan,
+ verticalItemSpacingPx = gridLayout.verticalItemSpacingPx,
+ currentRow = gridLayout.currentRow,
+ maxHeightPx = gridLayout.maxHeightPx,
+ minHeightPx = gridLayout.minHeightPx,
+ currentSpan = gridLayout.currentSpan,
+ resizeMultiple = gridLayout.resizeMultiple,
+ totalSpans = gridLayout.totalSpans,
+ viewportHeightPx = gridLayout.viewportHeightPx,
+ verticalContentPaddingPx = gridLayout.verticalContentPaddingPx,
)
runCurrent()
}
@@ -332,9 +419,11 @@ class ResizeableItemFrameViewModelTest : SysuiTestCase() {
val verticalItemSpacingPx: Float,
val verticalContentPaddingPx: Float,
val viewportHeightPx: Int,
- val maxItemSpan: Int,
- val minItemSpan: Int,
val currentRow: Int?,
- val currentSpan: Int?,
+ val currentSpan: Int,
+ val maxHeightPx: Int,
+ val minHeightPx: Int,
+ val resizeMultiple: Int,
+ val totalSpans: Int,
)
}
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/display/data/repository/DeviceStateRepositoryTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/display/data/repository/DeviceStateRepositoryTest.kt
index 3f5b9a35d3a5..bec8a30320e7 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/display/data/repository/DeviceStateRepositoryTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/display/data/repository/DeviceStateRepositoryTest.kt
@@ -16,6 +16,14 @@
package com.android.systemui.display.data.repository
+import android.hardware.devicestate.DeviceState.PROPERTY_EMULATED_ONLY
+import android.hardware.devicestate.DeviceState.PROPERTY_FEATURE_DUAL_DISPLAY_INTERNAL_DEFAULT
+import android.hardware.devicestate.DeviceState.PROPERTY_FEATURE_REAR_DISPLAY
+import android.hardware.devicestate.DeviceState.PROPERTY_FOLDABLE_DISPLAY_CONFIGURATION_INNER_PRIMARY
+import android.hardware.devicestate.DeviceState.PROPERTY_FOLDABLE_DISPLAY_CONFIGURATION_OUTER_PRIMARY
+import android.hardware.devicestate.DeviceState.PROPERTY_FOLDABLE_HARDWARE_CONFIGURATION_FOLD_IN_CLOSED
+import android.hardware.devicestate.DeviceState.PROPERTY_FOLDABLE_HARDWARE_CONFIGURATION_FOLD_IN_HALF_OPEN
+import android.hardware.devicestate.DeviceState.PROPERTY_FOLDABLE_HARDWARE_CONFIGURATION_FOLD_IN_OPEN
import android.hardware.devicestate.DeviceStateManager
import android.testing.TestableLooper
import androidx.test.ext.junit.runners.AndroidJUnit4
@@ -40,6 +48,8 @@ import org.junit.Before
import org.junit.runner.RunWith
import org.mockito.Mockito.never
import org.mockito.Mockito.verify
+import org.mockito.kotlin.whenever
+import android.hardware.devicestate.DeviceState as PlatformDeviceState
@RunWith(AndroidJUnit4::class)
@TestableLooper.RunWithLooper
@@ -59,15 +69,33 @@ class DeviceStateRepositoryTest : SysuiTestCase() {
@Before
fun setup() {
mContext.orCreateTestableResources.apply {
- addOverride(R.array.config_foldedDeviceStates, listOf(TEST_FOLDED).toIntArray())
- addOverride(R.array.config_halfFoldedDeviceStates, TEST_HALF_FOLDED.toIntArray())
- addOverride(R.array.config_openDeviceStates, TEST_UNFOLDED.toIntArray())
- addOverride(R.array.config_rearDisplayDeviceStates, TEST_REAR_DISPLAY.toIntArray())
+ addOverride(
+ R.array.config_foldedDeviceStates,
+ listOf(TEST_FOLDED.identifier).toIntArray()
+ )
+ addOverride(
+ R.array.config_halfFoldedDeviceStates,
+ TEST_HALF_FOLDED.identifier.toIntArray()
+ )
+ addOverride(R.array.config_openDeviceStates, TEST_UNFOLDED.identifier.toIntArray())
+ addOverride(
+ R.array.config_rearDisplayDeviceStates,
+ TEST_REAR_DISPLAY.identifier.toIntArray()
+ )
addOverride(
R.array.config_concurrentDisplayDeviceStates,
- TEST_CONCURRENT_DISPLAY.toIntArray()
+ TEST_CONCURRENT_DISPLAY.identifier.toIntArray()
)
}
+ whenever(deviceStateManager.supportedDeviceStates).thenReturn(
+ listOf(
+ TEST_FOLDED,
+ TEST_HALF_FOLDED,
+ TEST_UNFOLDED,
+ TEST_REAR_DISPLAY,
+ TEST_CONCURRENT_DISPLAY
+ )
+ )
deviceStateRepository =
DeviceStateRepositoryImpl(
mContext,
@@ -85,9 +113,7 @@ class DeviceStateRepositoryTest : SysuiTestCase() {
testScope.runTest {
val state = displayState()
- deviceStateManagerListener.value.onDeviceStateChanged(
- getDeviceStateForIdentifier(TEST_FOLDED)
- )
+ deviceStateManagerListener.value.onDeviceStateChanged(TEST_FOLDED)
assertThat(state()).isEqualTo(DeviceState.FOLDED)
}
@@ -97,9 +123,7 @@ class DeviceStateRepositoryTest : SysuiTestCase() {
testScope.runTest {
val state = displayState()
- deviceStateManagerListener.value.onDeviceStateChanged(
- getDeviceStateForIdentifier(TEST_HALF_FOLDED)
- )
+ deviceStateManagerListener.value.onDeviceStateChanged(TEST_HALF_FOLDED)
assertThat(state()).isEqualTo(DeviceState.HALF_FOLDED)
}
@@ -109,9 +133,7 @@ class DeviceStateRepositoryTest : SysuiTestCase() {
testScope.runTest {
val state = displayState()
- deviceStateManagerListener.value.onDeviceStateChanged(
- getDeviceStateForIdentifier(TEST_UNFOLDED)
- )
+ deviceStateManagerListener.value.onDeviceStateChanged(TEST_UNFOLDED)
assertThat(state()).isEqualTo(DeviceState.UNFOLDED)
}
@@ -121,9 +143,7 @@ class DeviceStateRepositoryTest : SysuiTestCase() {
testScope.runTest {
val state = displayState()
- deviceStateManagerListener.value.onDeviceStateChanged(
- getDeviceStateForIdentifier(TEST_REAR_DISPLAY)
- )
+ deviceStateManagerListener.value.onDeviceStateChanged(TEST_REAR_DISPLAY)
assertThat(state()).isEqualTo(DeviceState.REAR_DISPLAY)
}
@@ -133,9 +153,7 @@ class DeviceStateRepositoryTest : SysuiTestCase() {
testScope.runTest {
val state = displayState()
- deviceStateManagerListener.value.onDeviceStateChanged(
- getDeviceStateForIdentifier(TEST_CONCURRENT_DISPLAY)
- )
+ deviceStateManagerListener.value.onDeviceStateChanged(TEST_CONCURRENT_DISPLAY)
assertThat(state()).isEqualTo(DeviceState.CONCURRENT_DISPLAY)
}
@@ -164,9 +182,9 @@ class DeviceStateRepositoryTest : SysuiTestCase() {
private fun Int.toIntArray() = listOf(this).toIntArray()
- private fun getDeviceStateForIdentifier(id: Int): android.hardware.devicestate.DeviceState {
- return android.hardware.devicestate.DeviceState(
- android.hardware.devicestate.DeviceState.Configuration.Builder(id, /* name= */ "")
+ private fun getDeviceStateForIdentifier(id: Int): PlatformDeviceState {
+ return PlatformDeviceState(
+ PlatformDeviceState.Configuration.Builder(id, /* name= */ "")
.build()
)
}
@@ -174,10 +192,68 @@ class DeviceStateRepositoryTest : SysuiTestCase() {
private companion object {
// Used to fake the ids in the test. Note that there is no guarantees different devices will
// have the same ids (that's why the ones in this test start from 41)
- const val TEST_FOLDED = 41
- const val TEST_HALF_FOLDED = 42
- const val TEST_UNFOLDED = 43
- const val TEST_REAR_DISPLAY = 44
- const val TEST_CONCURRENT_DISPLAY = 45
+ val TEST_FOLDED =
+ PlatformDeviceState(
+ PlatformDeviceState.Configuration.Builder(41, "FOLDED")
+ .setSystemProperties(
+ setOf(PROPERTY_FOLDABLE_DISPLAY_CONFIGURATION_OUTER_PRIMARY)
+ )
+ .setPhysicalProperties(
+ setOf(PROPERTY_FOLDABLE_HARDWARE_CONFIGURATION_FOLD_IN_CLOSED)
+ )
+ .build()
+ )
+ val TEST_HALF_FOLDED =
+ PlatformDeviceState(
+ PlatformDeviceState.Configuration.Builder(42, "HALF_FOLDED")
+ .setSystemProperties(
+ setOf(PROPERTY_FOLDABLE_DISPLAY_CONFIGURATION_INNER_PRIMARY)
+ )
+ .setPhysicalProperties(
+ setOf(PROPERTY_FOLDABLE_HARDWARE_CONFIGURATION_FOLD_IN_HALF_OPEN)
+ )
+ .build()
+ )
+ val TEST_UNFOLDED =
+ PlatformDeviceState(
+ PlatformDeviceState.Configuration.Builder(43, "UNFOLDED")
+ .setSystemProperties(
+ setOf(PROPERTY_FOLDABLE_DISPLAY_CONFIGURATION_INNER_PRIMARY)
+ )
+ .setPhysicalProperties(
+ setOf(PROPERTY_FOLDABLE_HARDWARE_CONFIGURATION_FOLD_IN_OPEN)
+ )
+ .build()
+ )
+ val TEST_REAR_DISPLAY =
+ PlatformDeviceState(
+ PlatformDeviceState.Configuration.Builder(44, "REAR_DISPLAY")
+ .setSystemProperties(
+ setOf(
+ PROPERTY_FOLDABLE_DISPLAY_CONFIGURATION_OUTER_PRIMARY,
+ PROPERTY_FEATURE_REAR_DISPLAY,
+ PROPERTY_EMULATED_ONLY
+ )
+ )
+ .setPhysicalProperties(
+ setOf(PROPERTY_FOLDABLE_HARDWARE_CONFIGURATION_FOLD_IN_OPEN)
+ )
+ .build()
+ )
+ val TEST_CONCURRENT_DISPLAY =
+ PlatformDeviceState(
+ PlatformDeviceState.Configuration.Builder(45, "CONCURRENT_DISPLAY")
+ .setSystemProperties(
+ setOf(
+ PROPERTY_FOLDABLE_DISPLAY_CONFIGURATION_INNER_PRIMARY,
+ PROPERTY_FEATURE_DUAL_DISPLAY_INTERNAL_DEFAULT,
+ PROPERTY_EMULATED_ONLY
+ )
+ )
+ .setPhysicalProperties(
+ setOf(PROPERTY_FOLDABLE_HARDWARE_CONFIGURATION_FOLD_IN_OPEN)
+ )
+ .build()
+ )
}
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/window/MultiDisplayStatusBarWindowControllerStoreTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/display/data/repository/PerDisplayStoreImplTest.kt
index faaa4c415d28..1dd8ca9221a4 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/window/MultiDisplayStatusBarWindowControllerStoreTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/display/data/repository/PerDisplayStoreImplTest.kt
@@ -14,23 +14,15 @@
* limitations under the License.
*/
-package com.android.systemui.statusbar.window
+package com.android.systemui.display.data.repository
-import android.platform.test.annotations.EnableFlags
import android.view.Display
-import android.view.WindowManager
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
-import com.android.app.viewcapture.ViewCaptureAwareWindowManager
-import com.android.app.viewcapture.mockViewCaptureAwareWindowManager
import com.android.systemui.SysuiTestCase
-import com.android.systemui.display.data.repository.displayRepository
-import com.android.systemui.display.data.repository.fakeDisplayWindowPropertiesRepository
-import com.android.systemui.kosmos.applicationCoroutineScope
import com.android.systemui.kosmos.testDispatcher
import com.android.systemui.kosmos.testScope
import com.android.systemui.kosmos.unconfinedTestDispatcher
-import com.android.systemui.statusbar.core.StatusBarConnectedDisplays
import com.android.systemui.testKosmos
import com.google.common.truth.Truth.assertThat
import kotlinx.coroutines.runBlocking
@@ -43,28 +35,13 @@ import org.mockito.kotlin.mock
@RunWith(AndroidJUnit4::class)
@SmallTest
-@EnableFlags(StatusBarConnectedDisplays.FLAG_NAME)
-class MultiDisplayStatusBarWindowControllerStoreTest : SysuiTestCase() {
+class PerDisplayStoreImplTest : SysuiTestCase() {
private val kosmos = testKosmos().also { it.testDispatcher = it.unconfinedTestDispatcher }
private val testScope = kosmos.testScope
private val fakeDisplayRepository = kosmos.displayRepository
- private val store =
- MultiDisplayStatusBarWindowControllerStore(
- backgroundApplicationScope = kosmos.applicationCoroutineScope,
- controllerFactory = kosmos.fakeStatusBarWindowControllerFactory,
- displayWindowPropertiesRepository = kosmos.fakeDisplayWindowPropertiesRepository,
- viewCaptureAwareWindowManagerFactory =
- object : ViewCaptureAwareWindowManager.Factory {
- override fun create(
- windowManager: WindowManager
- ): ViewCaptureAwareWindowManager {
- return kosmos.mockViewCaptureAwareWindowManager
- }
- },
- displayRepository = fakeDisplayRepository,
- )
+ private val store = kosmos.fakePerDisplayStore
@Before
fun start() {
@@ -80,34 +57,52 @@ class MultiDisplayStatusBarWindowControllerStoreTest : SysuiTestCase() {
@Test
fun forDisplay_defaultDisplay_multipleCalls_returnsSameInstance() =
testScope.runTest {
- val controller = store.defaultDisplay
+ val instance = store.defaultDisplay
- assertThat(store.defaultDisplay).isSameInstanceAs(controller)
+ assertThat(store.defaultDisplay).isSameInstanceAs(instance)
}
@Test
fun forDisplay_nonDefaultDisplay_multipleCalls_returnsSameInstance() =
testScope.runTest {
- val controller = store.forDisplay(NON_DEFAULT_DISPLAY_ID)
+ val instance = store.forDisplay(NON_DEFAULT_DISPLAY_ID)
- assertThat(store.forDisplay(NON_DEFAULT_DISPLAY_ID)).isSameInstanceAs(controller)
+ assertThat(store.forDisplay(NON_DEFAULT_DISPLAY_ID)).isSameInstanceAs(instance)
}
@Test
fun forDisplay_nonDefaultDisplay_afterDisplayRemoved_returnsNewInstance() =
testScope.runTest {
- val controller = store.forDisplay(NON_DEFAULT_DISPLAY_ID)
+ val instance = store.forDisplay(NON_DEFAULT_DISPLAY_ID)
fakeDisplayRepository.removeDisplay(NON_DEFAULT_DISPLAY_ID)
fakeDisplayRepository.addDisplay(createDisplay(NON_DEFAULT_DISPLAY_ID))
- assertThat(store.forDisplay(NON_DEFAULT_DISPLAY_ID)).isNotSameInstanceAs(controller)
+ assertThat(store.forDisplay(NON_DEFAULT_DISPLAY_ID)).isNotSameInstanceAs(instance)
}
@Test(expected = IllegalArgumentException::class)
fun forDisplay_nonExistingDisplayId_throws() =
testScope.runTest { store.forDisplay(NON_EXISTING_DISPLAY_ID) }
+ @Test
+ fun forDisplay_afterDisplayRemoved_onDisplayRemovalActionInvoked() =
+ testScope.runTest {
+ val instance = store.forDisplay(NON_DEFAULT_DISPLAY_ID)
+
+ fakeDisplayRepository.removeDisplay(NON_DEFAULT_DISPLAY_ID)
+
+ assertThat(store.removalActions).containsExactly(instance)
+ }
+
+ @Test
+ fun forDisplay_withoutDisplayRemoval_onDisplayRemovalActionIsNotInvoked() =
+ testScope.runTest {
+ store.forDisplay(NON_DEFAULT_DISPLAY_ID)
+
+ assertThat(store.removalActions).isEmpty()
+ }
+
private fun createDisplay(displayId: Int): Display = mock {
on { getDisplayId() } doReturn displayId
}
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/education/domain/interactor/KeyboardTouchpadEduInteractorTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/education/domain/interactor/KeyboardTouchpadEduInteractorTest.kt
index 8201bbe4dc47..e7d2ef10b4ee 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/education/domain/interactor/KeyboardTouchpadEduInteractorTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/education/domain/interactor/KeyboardTouchpadEduInteractorTest.kt
@@ -30,8 +30,11 @@ import com.android.systemui.education.data.model.GestureEduModel
import com.android.systemui.education.data.repository.contextualEducationRepository
import com.android.systemui.education.data.repository.fakeEduClock
import com.android.systemui.education.shared.model.EducationUiType
+import com.android.systemui.inputdevice.tutorial.data.repository.DeviceType
+import com.android.systemui.inputdevice.tutorial.tutorialSchedulerRepository
import com.android.systemui.keyboard.data.repository.keyboardRepository
import com.android.systemui.kosmos.testScope
+import com.android.systemui.recents.OverviewProxyService.OverviewProxyListener
import com.android.systemui.testKosmos
import com.android.systemui.touchpad.data.repository.touchpadRepository
import com.android.systemui.user.data.repository.fakeUserRepository
@@ -42,10 +45,13 @@ import kotlinx.coroutines.launch
import kotlinx.coroutines.test.TestScope
import kotlinx.coroutines.test.runCurrent
import kotlinx.coroutines.test.runTest
+import org.junit.After
import org.junit.Assume.assumeTrue
import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
+import org.mockito.kotlin.argumentCaptor
+import org.mockito.kotlin.verify
import platform.test.runner.parameterized.ParameterizedAndroidJunit4
import platform.test.runner.parameterized.Parameters
@@ -56,14 +62,19 @@ class KeyboardTouchpadEduInteractorTest(private val gestureType: GestureType) :
private val kosmos = testKosmos()
private val testScope = kosmos.testScope
private val contextualEduInteractor = kosmos.contextualEducationInteractor
+ private val repository = kosmos.contextualEducationRepository
private val touchpadRepository = kosmos.touchpadRepository
private val keyboardRepository = kosmos.keyboardRepository
+ private val tutorialSchedulerRepository = kosmos.tutorialSchedulerRepository
private val userRepository = kosmos.fakeUserRepository
+ private val overviewProxyService = kosmos.mockOverviewProxyService
private val underTest: KeyboardTouchpadEduInteractor = kosmos.keyboardTouchpadEduInteractor
private val eduClock = kosmos.fakeEduClock
private val minDurationForNextEdu =
KeyboardTouchpadEduInteractor.minIntervalBetweenEdu + 1.seconds
+ private val initialDelayElapsedDuration =
+ KeyboardTouchpadEduInteractor.initialDelayDuration + 1.seconds
@Before
fun setup() {
@@ -271,6 +282,131 @@ class KeyboardTouchpadEduInteractorTest(private val gestureType: GestureType) :
assertThat(model?.lastShortcutTriggeredTime).isEqualTo(eduClock.instant())
}
+ @Test
+ fun dataUpdatedOnIncrementSignalCountWhenTouchpadConnected() =
+ testScope.runTest {
+ assumeTrue(gestureType != ALL_APPS)
+ setUpForInitialDelayElapse()
+ touchpadRepository.setIsAnyTouchpadConnected(true)
+
+ val model by collectLastValue(repository.readGestureEduModelFlow(gestureType))
+ val originalValue = model!!.signalCount
+ val listener = getOverviewProxyListener()
+ listener.updateContextualEduStats(/* isTrackpadGesture= */ false, gestureType)
+
+ assertThat(model?.signalCount).isEqualTo(originalValue + 1)
+ }
+
+ @Test
+ fun dataUnchangedOnIncrementSignalCountWhenTouchpadDisconnected() =
+ testScope.runTest {
+ setUpForInitialDelayElapse()
+ touchpadRepository.setIsAnyTouchpadConnected(false)
+
+ val model by collectLastValue(repository.readGestureEduModelFlow(gestureType))
+ val originalValue = model!!.signalCount
+ val listener = getOverviewProxyListener()
+ listener.updateContextualEduStats(/* isTrackpadGesture= */ false, gestureType)
+
+ assertThat(model?.signalCount).isEqualTo(originalValue)
+ }
+
+ @Test
+ fun dataUpdatedOnIncrementSignalCountWhenKeyboardConnected() =
+ testScope.runTest {
+ assumeTrue(gestureType == ALL_APPS)
+ setUpForInitialDelayElapse()
+ keyboardRepository.setIsAnyKeyboardConnected(true)
+
+ val model by collectLastValue(repository.readGestureEduModelFlow(gestureType))
+ val originalValue = model!!.signalCount
+ val listener = getOverviewProxyListener()
+ listener.updateContextualEduStats(/* isTrackpadGesture= */ false, gestureType)
+
+ assertThat(model?.signalCount).isEqualTo(originalValue + 1)
+ }
+
+ @Test
+ fun dataUnchangedOnIncrementSignalCountWhenKeyboardDisconnected() =
+ testScope.runTest {
+ setUpForInitialDelayElapse()
+ keyboardRepository.setIsAnyKeyboardConnected(false)
+
+ val model by collectLastValue(repository.readGestureEduModelFlow(gestureType))
+ val originalValue = model!!.signalCount
+ val listener = getOverviewProxyListener()
+ listener.updateContextualEduStats(/* isTrackpadGesture= */ false, gestureType)
+
+ assertThat(model?.signalCount).isEqualTo(originalValue)
+ }
+
+ @Test
+ fun dataAddedOnUpdateShortcutTriggerTime() =
+ testScope.runTest {
+ val model by collectLastValue(repository.readGestureEduModelFlow(gestureType))
+ assertThat(model?.lastShortcutTriggeredTime).isNull()
+
+ val listener = getOverviewProxyListener()
+ listener.updateContextualEduStats(/* isTrackpadGesture= */ true, gestureType)
+
+ assertThat(model?.lastShortcutTriggeredTime).isEqualTo(kosmos.fakeEduClock.instant())
+ }
+
+ @Test
+ fun dataUpdatedOnIncrementSignalCountAfterInitialDelay() =
+ testScope.runTest {
+ setUpForDeviceConnection()
+ tutorialSchedulerRepository.updateLaunchTime(DeviceType.TOUCHPAD, eduClock.instant())
+
+ val model by collectLastValue(repository.readGestureEduModelFlow(gestureType))
+ val originalValue = model!!.signalCount
+ eduClock.offset(initialDelayElapsedDuration)
+ val listener = getOverviewProxyListener()
+ listener.updateContextualEduStats(/* isTrackpadGesture= */ false, gestureType)
+
+ assertThat(model?.signalCount).isEqualTo(originalValue + 1)
+ }
+
+ @Test
+ fun dataUnchangedOnIncrementSignalCountBeforeInitialDelay() =
+ testScope.runTest {
+ setUpForDeviceConnection()
+ tutorialSchedulerRepository.updateLaunchTime(DeviceType.TOUCHPAD, eduClock.instant())
+
+ val model by collectLastValue(repository.readGestureEduModelFlow(gestureType))
+ val originalValue = model!!.signalCount
+ // No offset to the clock to simulate update before initial delay
+ val listener = getOverviewProxyListener()
+ listener.updateContextualEduStats(/* isTrackpadGesture= */ false, gestureType)
+
+ assertThat(model?.signalCount).isEqualTo(originalValue)
+ }
+
+ @Test
+ fun dataUnchangedOnIncrementSignalCountWithoutOobeLaunchTime() =
+ testScope.runTest {
+ // No update to OOBE launch time to simulate no OOBE is launched yet
+ setUpForDeviceConnection()
+
+ val model by collectLastValue(repository.readGestureEduModelFlow(gestureType))
+ val originalValue = model!!.signalCount
+ val listener = getOverviewProxyListener()
+ listener.updateContextualEduStats(/* isTrackpadGesture= */ false, gestureType)
+
+ assertThat(model?.signalCount).isEqualTo(originalValue)
+ }
+
+ private suspend fun setUpForInitialDelayElapse() {
+ tutorialSchedulerRepository.updateLaunchTime(DeviceType.TOUCHPAD, eduClock.instant())
+ tutorialSchedulerRepository.updateLaunchTime(DeviceType.KEYBOARD, eduClock.instant())
+ eduClock.offset(initialDelayElapsedDuration)
+ }
+
+ @After
+ fun clear() {
+ testScope.launch { tutorialSchedulerRepository.clearDataStore() }
+ }
+
private suspend fun triggerMaxEducationSignals(gestureType: GestureType) {
// Increment max number of signal to try triggering education
for (i in 1..KeyboardTouchpadEduInteractor.MAX_SIGNAL_COUNT) {
@@ -288,9 +424,15 @@ class KeyboardTouchpadEduInteractorTest(private val gestureType: GestureType) :
runCurrent()
}
- private suspend fun setUpForDeviceConnection() {
- contextualEduInteractor.updateKeyboardFirstConnectionTime()
- contextualEduInteractor.updateTouchpadFirstConnectionTime()
+ private fun setUpForDeviceConnection() {
+ touchpadRepository.setIsAnyTouchpadConnected(true)
+ keyboardRepository.setIsAnyKeyboardConnected(true)
+ }
+
+ private fun getOverviewProxyListener(): OverviewProxyListener {
+ val listenerCaptor = argumentCaptor<OverviewProxyListener>()
+ verify(overviewProxyService).addCallback(listenerCaptor.capture())
+ return listenerCaptor.firstValue
}
companion object {
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/education/domain/interactor/KeyboardTouchpadStatsInteractorTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/education/domain/interactor/KeyboardTouchpadStatsInteractorTest.kt
deleted file mode 100644
index 98e09474d5f2..000000000000
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/education/domain/interactor/KeyboardTouchpadStatsInteractorTest.kt
+++ /dev/null
@@ -1,172 +0,0 @@
-/*
- * Copyright 2024 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.systemui.education.domain.interactor
-
-import androidx.test.ext.junit.runners.AndroidJUnit4
-import androidx.test.filters.SmallTest
-import com.android.systemui.SysuiTestCase
-import com.android.systemui.contextualeducation.GestureType.ALL_APPS
-import com.android.systemui.contextualeducation.GestureType.BACK
-import com.android.systemui.coroutines.collectLastValue
-import com.android.systemui.education.data.repository.contextualEducationRepository
-import com.android.systemui.education.data.repository.fakeEduClock
-import com.android.systemui.inputdevice.tutorial.data.repository.DeviceType
-import com.android.systemui.inputdevice.tutorial.tutorialSchedulerRepository
-import com.android.systemui.keyboard.data.repository.keyboardRepository
-import com.android.systemui.kosmos.testScope
-import com.android.systemui.testKosmos
-import com.android.systemui.touchpad.data.repository.touchpadRepository
-import com.google.common.truth.Truth.assertThat
-import kotlin.time.Duration.Companion.seconds
-import kotlinx.coroutines.launch
-import kotlinx.coroutines.test.runTest
-import org.junit.After
-import org.junit.Test
-import org.junit.runner.RunWith
-
-@SmallTest
-@RunWith(AndroidJUnit4::class)
-class KeyboardTouchpadStatsInteractorTest : SysuiTestCase() {
- private val kosmos = testKosmos()
- private val testScope = kosmos.testScope
- private val underTest = kosmos.keyboardTouchpadEduStatsInteractor
- private val keyboardRepository = kosmos.keyboardRepository
- private val touchpadRepository = kosmos.touchpadRepository
- private val repository = kosmos.contextualEducationRepository
- private val fakeClock = kosmos.fakeEduClock
- private val tutorialSchedulerRepository = kosmos.tutorialSchedulerRepository
- private val initialDelayElapsedDuration =
- KeyboardTouchpadEduStatsInteractorImpl.initialDelayDuration + 1.seconds
-
- @Test
- fun dataUpdatedOnIncrementSignalCountWhenTouchpadConnected() =
- testScope.runTest {
- setUpForInitialDelayElapse()
- touchpadRepository.setIsAnyTouchpadConnected(true)
-
- val model by collectLastValue(repository.readGestureEduModelFlow(BACK))
- val originalValue = model!!.signalCount
- underTest.incrementSignalCount(BACK)
-
- assertThat(model?.signalCount).isEqualTo(originalValue + 1)
- }
-
- @Test
- fun dataUnchangedOnIncrementSignalCountWhenTouchpadDisconnected() =
- testScope.runTest {
- setUpForInitialDelayElapse()
- touchpadRepository.setIsAnyTouchpadConnected(false)
-
- val model by collectLastValue(repository.readGestureEduModelFlow(BACK))
- val originalValue = model!!.signalCount
- underTest.incrementSignalCount(BACK)
-
- assertThat(model?.signalCount).isEqualTo(originalValue)
- }
-
- @Test
- fun dataUpdatedOnIncrementSignalCountWhenKeyboardConnected() =
- testScope.runTest {
- setUpForInitialDelayElapse()
- keyboardRepository.setIsAnyKeyboardConnected(true)
-
- val model by collectLastValue(repository.readGestureEduModelFlow(ALL_APPS))
- val originalValue = model!!.signalCount
- underTest.incrementSignalCount(ALL_APPS)
-
- assertThat(model?.signalCount).isEqualTo(originalValue + 1)
- }
-
- @Test
- fun dataUnchangedOnIncrementSignalCountWhenKeyboardDisconnected() =
- testScope.runTest {
- setUpForInitialDelayElapse()
- keyboardRepository.setIsAnyKeyboardConnected(false)
-
- val model by collectLastValue(repository.readGestureEduModelFlow(ALL_APPS))
- val originalValue = model!!.signalCount
- underTest.incrementSignalCount(ALL_APPS)
-
- assertThat(model?.signalCount).isEqualTo(originalValue)
- }
-
- @Test
- fun dataAddedOnUpdateShortcutTriggerTime() =
- testScope.runTest {
- val model by collectLastValue(repository.readGestureEduModelFlow(BACK))
- assertThat(model?.lastShortcutTriggeredTime).isNull()
- underTest.updateShortcutTriggerTime(BACK)
- assertThat(model?.lastShortcutTriggeredTime).isEqualTo(kosmos.fakeEduClock.instant())
- }
-
- @Test
- fun dataUpdatedOnIncrementSignalCountAfterInitialDelay() =
- testScope.runTest {
- setUpForDeviceConnection()
- tutorialSchedulerRepository.updateLaunchTime(DeviceType.TOUCHPAD, fakeClock.instant())
-
- fakeClock.offset(initialDelayElapsedDuration)
- val model by collectLastValue(repository.readGestureEduModelFlow(BACK))
- val originalValue = model!!.signalCount
- underTest.incrementSignalCount(BACK)
-
- assertThat(model?.signalCount).isEqualTo(originalValue + 1)
- }
-
- @Test
- fun dataUnchangedOnIncrementSignalCountBeforeInitialDelay() =
- testScope.runTest {
- setUpForDeviceConnection()
- tutorialSchedulerRepository.updateLaunchTime(DeviceType.TOUCHPAD, fakeClock.instant())
-
- // No offset to the clock to simulate update before initial delay
- val model by collectLastValue(repository.readGestureEduModelFlow(BACK))
- val originalValue = model!!.signalCount
- underTest.incrementSignalCount(BACK)
-
- assertThat(model?.signalCount).isEqualTo(originalValue)
- }
-
- @Test
- fun dataUnchangedOnIncrementSignalCountWithoutOobeLaunchTime() =
- testScope.runTest {
- // No update to OOBE launch time to simulate no OOBE is launched yet
- setUpForDeviceConnection()
-
- val model by collectLastValue(repository.readGestureEduModelFlow(BACK))
- val originalValue = model!!.signalCount
- underTest.incrementSignalCount(BACK)
-
- assertThat(model?.signalCount).isEqualTo(originalValue)
- }
-
- private suspend fun setUpForInitialDelayElapse() {
- tutorialSchedulerRepository.updateLaunchTime(DeviceType.TOUCHPAD, fakeClock.instant())
- tutorialSchedulerRepository.updateLaunchTime(DeviceType.KEYBOARD, fakeClock.instant())
- fakeClock.offset(initialDelayElapsedDuration)
- }
-
- private fun setUpForDeviceConnection() {
- touchpadRepository.setIsAnyTouchpadConnected(true)
- keyboardRepository.setIsAnyKeyboardConnected(true)
- }
-
- @After
- fun clear() {
- testScope.launch { tutorialSchedulerRepository.clearDataStore() }
- }
-}
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/education/domain/ui/view/ContextualEduDialogTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/education/domain/ui/view/ContextualEduDialogTest.kt
new file mode 100644
index 000000000000..90727b240caf
--- /dev/null
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/education/domain/ui/view/ContextualEduDialogTest.kt
@@ -0,0 +1,72 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.systemui.education.domain.ui.view
+
+import android.testing.TestableLooper
+import android.view.accessibility.AccessibilityEvent
+import android.view.accessibility.AccessibilityManager
+import androidx.test.ext.junit.rules.ActivityScenarioRule
+import androidx.test.ext.junit.runners.AndroidJUnit4
+import androidx.test.filters.SmallTest
+import com.android.systemui.SysuiTestCase
+import com.android.systemui.activity.EmptyTestActivity
+import com.android.systemui.education.ui.view.ContextualEduDialog
+import com.android.systemui.education.ui.viewmodel.ContextualEduToastViewModel
+import kotlin.test.assertEquals
+import org.junit.Before
+import org.junit.Rule
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.mockito.ArgumentCaptor
+import org.mockito.Mock
+import org.mockito.junit.MockitoJUnit
+import org.mockito.kotlin.firstValue
+import org.mockito.kotlin.verify
+import org.mockito.kotlin.whenever
+
+@SmallTest
+@RunWith(AndroidJUnit4::class)
+@TestableLooper.RunWithLooper
+class ContextualEduDialogTest : SysuiTestCase() {
+ @Rule
+ @JvmField
+ val activityRule: ActivityScenarioRule<EmptyTestActivity> =
+ ActivityScenarioRule(EmptyTestActivity::class.java)
+ @get:Rule val mockitoRule = MockitoJUnit.rule()
+
+ @Mock private lateinit var accessibilityManager: AccessibilityManager
+ private lateinit var underTest: ContextualEduDialog
+
+ @Before
+ fun setUp() {
+ whenever(accessibilityManager.isEnabled).thenReturn(true)
+ }
+
+ @Test
+ fun sendAccessibilityInfo() {
+ val message = "Testing message"
+ val viewModel = ContextualEduToastViewModel(message, icon = 0, userId = 0)
+ activityRule.scenario.onActivity {
+ underTest = ContextualEduDialog(context, viewModel, accessibilityManager)
+ underTest.show()
+ }
+
+ val eventCaptor = ArgumentCaptor.forClass(AccessibilityEvent::class.java)
+ verify(accessibilityManager).sendAccessibilityEvent(eventCaptor.capture())
+ assertEquals(message, eventCaptor.firstValue.text[0])
+ }
+}
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/keyboard/shortcut/ui b/packages/SystemUI/multivalentTests/src/com/android/systemui/keyboard/shortcut/ui/ShortcutHelperDialogStarterTest.kt
index f8e2f47f939a..d1431eecfc68 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/keyboard/shortcut/ui
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/keyboard/shortcut/ui/ShortcutHelperDialogStarterTest.kt
@@ -16,25 +16,26 @@
package com.android.systemui.keyboard.shortcut.ui
-import android.content.Intent
+import androidx.test.annotation.UiThreadTest
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.systemui.SysuiTestCase
import com.android.systemui.keyboard.shortcut.data.source.FakeKeyboardShortcutGroupsSource
import com.android.systemui.keyboard.shortcut.data.source.TestShortcuts
-import com.android.systemui.keyboard.shortcut.fakeShortcutHelperStartActivity
-import com.android.systemui.keyboard.shortcut.shortcutHelperActivityStarter
import com.android.systemui.keyboard.shortcut.shortcutHelperAppCategoriesShortcutsSource
import com.android.systemui.keyboard.shortcut.shortcutHelperCurrentAppShortcutsSource
import com.android.systemui.keyboard.shortcut.shortcutHelperInputShortcutsSource
import com.android.systemui.keyboard.shortcut.shortcutHelperMultiTaskingShortcutsSource
import com.android.systemui.keyboard.shortcut.shortcutHelperSystemShortcutsSource
import com.android.systemui.keyboard.shortcut.shortcutHelperTestHelper
-import com.android.systemui.keyboard.shortcut.ui.view.ShortcutHelperActivity
+import com.android.systemui.keyboard.shortcut.shortcutHelperViewModel
import com.android.systemui.kosmos.Kosmos
+import com.android.systemui.kosmos.applicationCoroutineScope
import com.android.systemui.kosmos.testCase
import com.android.systemui.kosmos.testDispatcher
import com.android.systemui.kosmos.testScope
+import com.android.systemui.plugins.activityStarter
+import com.android.systemui.statusbar.phone.systemUIDialogFactory
import com.google.common.truth.Truth.assertThat
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.test.UnconfinedTestDispatcher
@@ -46,7 +47,7 @@ import org.junit.runner.RunWith
@OptIn(ExperimentalCoroutinesApi::class)
@SmallTest
@RunWith(AndroidJUnit4::class)
-class ShortcutHelperActivityStarterTest : SysuiTestCase() {
+class ShortcutHelperDialogStarterTest : SysuiTestCase() {
private val fakeSystemSource = FakeKeyboardShortcutGroupsSource()
private val fakeMultiTaskingSource = FakeKeyboardShortcutGroupsSource()
@@ -64,8 +65,14 @@ class ShortcutHelperActivityStarterTest : SysuiTestCase() {
private val testScope = kosmos.testScope
private val testHelper = kosmos.shortcutHelperTestHelper
- private val fakeStartActivity = kosmos.fakeShortcutHelperStartActivity
- private val starter = kosmos.shortcutHelperActivityStarter
+ private val dialogFactory = kosmos.systemUIDialogFactory
+ private val coroutineScope = kosmos.applicationCoroutineScope
+ private val viewModel = kosmos.shortcutHelperViewModel
+
+ private val starter: ShortcutHelperDialogStarter =
+ with(kosmos) {
+ ShortcutHelperDialogStarter(coroutineScope, viewModel, dialogFactory, activityStarter)
+ }
@Before
fun setUp() {
@@ -74,21 +81,22 @@ class ShortcutHelperActivityStarterTest : SysuiTestCase() {
}
@Test
- fun start_doesNotStartByDefault() =
+ fun start_doesNotShowDialogByDefault() =
testScope.runTest {
starter.start()
- assertThat(fakeStartActivity.startIntents).isEmpty()
+ assertThat(starter.dialog).isNull()
}
@Test
- fun start_onToggle_startsActivity() =
+ @UiThreadTest
+ fun start_onToggle_showsDialog() =
testScope.runTest {
starter.start()
testHelper.toggle(deviceId = 456)
- verifyShortcutHelperActivityStarted()
+ assertThat(starter.dialog?.isShowing).isTrue()
}
@Test
@@ -101,34 +109,18 @@ class ShortcutHelperActivityStarterTest : SysuiTestCase() {
testHelper.toggle(deviceId = 456)
- assertThat(fakeStartActivity.startIntents).isEmpty()
- }
-
- @Test
- fun start_onToggle_multipleTimesStartsActivityOnlyWhenNotStarted() =
- testScope.runTest {
- starter.start()
-
- // Starts
- testHelper.toggle(deviceId = 456)
- // Stops
- testHelper.toggle(deviceId = 456)
- // Starts again
- testHelper.toggle(deviceId = 456)
- // Stops
- testHelper.toggle(deviceId = 456)
-
- verifyShortcutHelperActivityStarted(numTimes = 2)
+ assertThat(starter.dialog).isNull()
}
@Test
+ @UiThreadTest
fun start_onRequestShowShortcuts_startsActivity() =
testScope.runTest {
starter.start()
testHelper.showFromActivity()
- verifyShortcutHelperActivityStarted()
+ assertThat(starter.dialog?.isShowing).isTrue()
}
@Test
@@ -140,10 +132,11 @@ class ShortcutHelperActivityStarterTest : SysuiTestCase() {
testHelper.showFromActivity()
- assertThat(fakeStartActivity.startIntents).isEmpty()
+ assertThat(starter.dialog).isNull()
}
@Test
+ @UiThreadTest
fun start_onRequestShowShortcuts_multipleTimes_startsActivityOnlyOnce() =
testScope.runTest {
starter.start()
@@ -152,40 +145,40 @@ class ShortcutHelperActivityStarterTest : SysuiTestCase() {
testHelper.showFromActivity()
testHelper.showFromActivity()
- verifyShortcutHelperActivityStarted(numTimes = 1)
+ assertThat(starter.dialog?.isShowing).isTrue()
}
@Test
+ @UiThreadTest
fun start_onRequestShowShortcuts_multipleTimes_startsActivityOnlyWhenNotStarted() =
testScope.runTest {
starter.start()
+ assertThat(starter.dialog).isNull()
// No-op. Already hidden.
testHelper.hideFromActivity()
+ assertThat(starter.dialog).isNull()
// No-op. Already hidden.
testHelper.hideForSystem()
+ assertThat(starter.dialog).isNull()
// Show 1st time.
testHelper.toggle(deviceId = 987)
+ assertThat(starter.dialog).isNotNull()
+ assertThat(starter.dialog?.isShowing).isTrue()
// No-op. Already shown.
testHelper.showFromActivity()
+ assertThat(starter.dialog?.isShowing).isTrue()
// Hidden.
testHelper.hideFromActivity()
+ assertThat(starter.dialog?.isShowing).isFalse()
// No-op. Already hidden.
testHelper.hideForSystem()
+ assertThat(starter.dialog?.isShowing).isFalse()
// Show 2nd time.
testHelper.toggle(deviceId = 456)
+ assertThat(starter.dialog?.isShowing).isTrue()
// No-op. Already shown.
testHelper.showFromActivity()
-
- verifyShortcutHelperActivityStarted(numTimes = 2)
- }
-
- private fun verifyShortcutHelperActivityStarted(numTimes: Int = 1) {
- assertThat(fakeStartActivity.startIntents).hasSize(numTimes)
- fakeStartActivity.startIntents.forEach { intent ->
- assertThat(intent.flags).isEqualTo(Intent.FLAG_ACTIVITY_NEW_TASK)
- assertThat(intent.filterEquals(Intent(context, ShortcutHelperActivity::class.java)))
- .isTrue()
+ assertThat(starter.dialog?.isShowing).isTrue()
}
- }
}
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/KeyguardUnlockAnimationControllerTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/KeyguardUnlockAnimationControllerTest.kt
index e251ab50e3c7..baf3b5b4430f 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/KeyguardUnlockAnimationControllerTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/KeyguardUnlockAnimationControllerTest.kt
@@ -20,7 +20,10 @@ import androidx.test.filters.SmallTest
import com.android.keyguard.KeyguardViewController
import com.android.systemui.Flags
import com.android.systemui.SysuiTestCase
+import com.android.systemui.defaultDeviceState
+import com.android.systemui.deviceStateManager
import com.android.systemui.flags.FeatureFlags
+import com.android.systemui.kosmos.Kosmos
import com.android.systemui.shared.system.smartspace.ILauncherUnlockAnimationController
import com.android.systemui.statusbar.NotificationShadeWindowController
import com.android.systemui.statusbar.SysuiStatusBarStateController
@@ -28,7 +31,6 @@ import com.android.systemui.statusbar.phone.BiometricUnlockController
import com.android.systemui.statusbar.policy.KeyguardStateController
import com.android.systemui.util.mockito.any
import com.android.systemui.util.mockito.argThat
-import com.android.systemui.util.mockito.whenever
import java.util.function.Predicate
import junit.framework.Assert.assertEquals
import junit.framework.Assert.assertFalse
@@ -47,6 +49,7 @@ import org.mockito.Mockito.verify
import org.mockito.Mockito.verifyNoMoreInteractions
import org.mockito.MockitoAnnotations
import org.mockito.kotlin.clearInvocations
+import org.mockito.kotlin.whenever
@RunWith(AndroidJUnit4::class)
@RunWithLooper
@@ -65,6 +68,8 @@ class KeyguardUnlockAnimationControllerTest : SysuiTestCase() {
@Mock private lateinit var notificationShadeWindowController: NotificationShadeWindowController
@Mock private lateinit var powerManager: PowerManager
@Mock private lateinit var wallpaperManager: WallpaperManager
+ private val kosmos = Kosmos()
+ private val deviceStateManager = kosmos.deviceStateManager
@Mock
private lateinit var launcherUnlockAnimationController: ILauncherUnlockAnimationController.Stub
@@ -173,7 +178,8 @@ class KeyguardUnlockAnimationControllerTest : SysuiTestCase() {
statusBarStateController,
notificationShadeWindowController,
powerManager,
- wallpaperManager
+ wallpaperManager,
+ deviceStateManager
) {
override fun shouldPerformSmartspaceTransition(): Boolean =
shouldPerformSmartspaceTransition
@@ -185,6 +191,8 @@ class KeyguardUnlockAnimationControllerTest : SysuiTestCase() {
whenever(keyguardViewController.viewRootImpl).thenReturn(mock(ViewRootImpl::class.java))
whenever(powerManager.isInteractive).thenReturn(true)
+ whenever(deviceStateManager.supportedDeviceStates)
+ .thenReturn(listOf(kosmos.defaultDeviceState))
// All of these fields are final, so we can't mock them, but are needed so that the surface
// appear amount setter doesn't short circuit.
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/domain/interactor/KeyguardInteractorTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/domain/interactor/KeyguardInteractorTest.kt
index 3fb3eead6469..b3417b9de36d 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/domain/interactor/KeyguardInteractorTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/domain/interactor/KeyguardInteractorTest.kt
@@ -150,6 +150,53 @@ class KeyguardInteractorTest : SysuiTestCase() {
assertThat(secureCameraActive()).isFalse()
}
+ /** Regression test for b/373700726. */
+ @Test
+ @DisableFlags(FLAG_KEYGUARD_WM_STATE_REFACTOR)
+ fun testSecureCameraStillFalseAfterDeviceUnlocked() =
+ testScope.runTest {
+ val secureCameraActive = collectLastValue(underTest.isSecureCameraActive)
+ runCurrent()
+
+ // Launch camera
+ underTest.onCameraLaunchDetected(StatusBarManager.CAMERA_LAUNCH_SOURCE_POWER_DOUBLE_TAP)
+ assertThat(secureCameraActive()).isTrue()
+
+ // Go back to keyguard
+ repository.setKeyguardShowing(true)
+ repository.setKeyguardOccluded(false)
+ assertThat(secureCameraActive()).isFalse()
+
+ // WHEN device is unlocked (and therefore keyguard is no longer showing)
+ repository.setKeyguardShowing(false)
+
+ // THEN we still show secure camera as *not* active
+ assertThat(secureCameraActive()).isFalse()
+ }
+
+ /** Regression test for b/373700726. */
+ @Test
+ @DisableFlags(FLAG_KEYGUARD_WM_STATE_REFACTOR)
+ fun testSecureCameraStillFalseAfterBouncerDismissed() =
+ testScope.runTest {
+ val secureCameraActive = collectLastValue(underTest.isSecureCameraActive)
+ runCurrent()
+
+ // Launch camera
+ underTest.onCameraLaunchDetected(StatusBarManager.CAMERA_LAUNCH_SOURCE_POWER_DOUBLE_TAP)
+ assertThat(secureCameraActive()).isTrue()
+
+ // Show bouncer
+ bouncerRepository.setPrimaryShow(true)
+ assertThat(secureCameraActive()).isFalse()
+
+ // WHEN device is unlocked (and therefore the bouncer is no longer showing)
+ bouncerRepository.setPrimaryShow(false)
+
+ // THEN we still show secure camera as *not* active
+ assertThat(secureCameraActive()).isFalse()
+ }
+
@Test
@DisableFlags(FLAG_KEYGUARD_WM_STATE_REFACTOR)
fun keyguardVisibilityIsDefinedAsKeyguardShowingButNotOccluded() = runTest {
@@ -182,11 +229,7 @@ class KeyguardInteractorTest : SysuiTestCase() {
val dismissAlpha by collectLastValue(underTest.dismissAlpha)
assertThat(dismissAlpha).isEqualTo(1f)
- keyguardTransitionRepository.sendTransitionSteps(
- from = AOD,
- to = LOCKSCREEN,
- testScope,
- )
+ keyguardTransitionRepository.sendTransitionSteps(from = AOD, to = LOCKSCREEN, testScope)
repository.setStatusBarState(StatusBarState.KEYGUARD)
// User begins to swipe up
@@ -208,11 +251,7 @@ class KeyguardInteractorTest : SysuiTestCase() {
assertThat(dismissAlpha[0]).isEqualTo(1f)
assertThat(dismissAlpha.size).isEqualTo(1)
- keyguardTransitionRepository.sendTransitionSteps(
- from = AOD,
- to = LOCKSCREEN,
- testScope,
- )
+ keyguardTransitionRepository.sendTransitionSteps(from = AOD, to = LOCKSCREEN, testScope)
// User begins to swipe up
repository.setStatusBarState(StatusBarState.KEYGUARD)
@@ -328,11 +367,7 @@ class KeyguardInteractorTest : SysuiTestCase() {
shadeRepository.setLegacyShadeExpansion(0f)
- keyguardTransitionRepository.sendTransitionSteps(
- from = AOD,
- to = LOCKSCREEN,
- testScope,
- )
+ keyguardTransitionRepository.sendTransitionSteps(from = AOD, to = LOCKSCREEN, testScope)
assertThat(keyguardTranslationY).isEqualTo(0f)
}
@@ -350,11 +385,7 @@ class KeyguardInteractorTest : SysuiTestCase() {
shadeRepository.setLegacyShadeExpansion(1f)
- keyguardTransitionRepository.sendTransitionSteps(
- from = AOD,
- to = LOCKSCREEN,
- testScope,
- )
+ keyguardTransitionRepository.sendTransitionSteps(from = AOD, to = LOCKSCREEN, testScope)
assertThat(keyguardTranslationY).isEqualTo(0f)
}
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/domain/interactor/KeyguardTransitionScenariosTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/domain/interactor/KeyguardTransitionScenariosTest.kt
index 8f3d54961483..f4d2ea018a44 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/domain/interactor/KeyguardTransitionScenariosTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/domain/interactor/KeyguardTransitionScenariosTest.kt
@@ -118,9 +118,6 @@ class KeyguardTransitionScenariosTest(flags: FlagsParameterization?) : SysuiTest
private val fromPrimaryBouncerTransitionInteractor by lazy {
kosmos.fromPrimaryBouncerTransitionInteractor
}
- private val fromDreamingLockscreenHostedTransitionInteractor by lazy {
- kosmos.fromDreamingLockscreenHostedTransitionInteractor
- }
private val fromGlanceableHubTransitionInteractor by lazy {
kosmos.fromGlanceableHubTransitionInteractor
}
@@ -161,7 +158,6 @@ class KeyguardTransitionScenariosTest(flags: FlagsParameterization?) : SysuiTest
fromLockscreenTransitionInteractor.start()
fromPrimaryBouncerTransitionInteractor.start()
fromDreamingTransitionInteractor.start()
- fromDreamingLockscreenHostedTransitionInteractor.start()
fromAodTransitionInteractor.start()
fromGoneTransitionInteractor.start()
fromDozingTransitionInteractor.start()
@@ -275,36 +271,6 @@ class KeyguardTransitionScenariosTest(flags: FlagsParameterization?) : SysuiTest
}
@Test
- @BrokenWithSceneContainer(339465026)
- fun lockscreenToDreamingLockscreenHosted() =
- testScope.runTest {
- // GIVEN a device that is not dreaming or dozing
- keyguardRepository.setDreamingWithOverlay(false)
- keyguardRepository.setDozeTransitionModel(
- DozeTransitionModel(from = DozeStateModel.DOZE, to = DozeStateModel.FINISH)
- )
- advanceTimeBy(600L)
-
- // GIVEN a prior transition has run to LOCKSCREEN
- runTransitionAndSetWakefulness(KeyguardState.GONE, KeyguardState.LOCKSCREEN)
-
- // WHEN the device begins to dream and the dream is lockscreen hosted
- keyguardRepository.setDreamingWithOverlay(true)
- keyguardRepository.setIsActiveDreamLockscreenHosted(true)
- advanceTimeBy(100L)
-
- assertThat(transitionRepository)
- .startedTransition(
- to = KeyguardState.DREAMING_LOCKSCREEN_HOSTED,
- from = KeyguardState.LOCKSCREEN,
- ownerName = "FromLockscreenTransitionInteractor",
- animatorAssertion = { it.isNotNull() },
- )
-
- coroutineContext.cancelChildren()
- }
-
- @Test
fun lockscreenToDozing() =
testScope.runTest {
// GIVEN a device with AOD not available
@@ -355,157 +321,6 @@ class KeyguardTransitionScenariosTest(flags: FlagsParameterization?) : SysuiTest
}
@Test
- @DisableSceneContainer
- fun dreamingLockscreenHostedToLockscreen() =
- testScope.runTest {
- // GIVEN a device dreaming with the lockscreen hosted dream and not dozing
- keyguardRepository.setIsActiveDreamLockscreenHosted(true)
- keyguardRepository.setDozeTransitionModel(
- DozeTransitionModel(from = DozeStateModel.DOZE, to = DozeStateModel.FINISH)
- )
- runCurrent()
-
- // GIVEN a prior transition has run to DREAMING_LOCKSCREEN_HOSTED
- runTransitionAndSetWakefulness(
- KeyguardState.GONE,
- KeyguardState.DREAMING_LOCKSCREEN_HOSTED,
- )
-
- // WHEN the lockscreen hosted dream stops
- keyguardRepository.setIsActiveDreamLockscreenHosted(false)
- advanceTimeBy(100L)
-
- assertThat(transitionRepository)
- .startedTransition(
- to = KeyguardState.LOCKSCREEN,
- from = KeyguardState.DREAMING_LOCKSCREEN_HOSTED,
- ownerName = "FromDreamingLockscreenHostedTransitionInteractor",
- animatorAssertion = { it.isNotNull() },
- )
-
- coroutineContext.cancelChildren()
- }
-
- @Test
- @DisableSceneContainer
- fun dreamingLockscreenHostedToGone() =
- testScope.runTest {
- // GIVEN a prior transition has run to DREAMING_LOCKSCREEN_HOSTED
- runTransitionAndSetWakefulness(
- KeyguardState.GONE,
- KeyguardState.DREAMING_LOCKSCREEN_HOSTED,
- )
-
- // WHEN biometrics succeeds with wake and unlock from dream mode
- keyguardRepository.setBiometricUnlockState(
- BiometricUnlockMode.WAKE_AND_UNLOCK_FROM_DREAM
- )
- runCurrent()
-
- assertThat(transitionRepository)
- .startedTransition(
- to = KeyguardState.GONE,
- from = KeyguardState.DREAMING_LOCKSCREEN_HOSTED,
- ownerName = "FromDreamingLockscreenHostedTransitionInteractor",
- animatorAssertion = { it.isNotNull() },
- )
-
- coroutineContext.cancelChildren()
- }
-
- @Test
- @DisableSceneContainer
- fun dreamingLockscreenHostedToPrimaryBouncer() =
- testScope.runTest {
- // GIVEN a device dreaming with lockscreen hosted dream and not dozing
- keyguardRepository.setIsActiveDreamLockscreenHosted(true)
- runCurrent()
-
- // GIVEN a prior transition has run to DREAMING_LOCKSCREEN_HOSTED
- runTransitionAndSetWakefulness(
- KeyguardState.GONE,
- KeyguardState.DREAMING_LOCKSCREEN_HOSTED,
- )
-
- // WHEN the primary bouncer is set to show
- bouncerRepository.setPrimaryShow(true)
- runCurrent()
-
- assertThat(transitionRepository)
- .startedTransition(
- to = KeyguardState.PRIMARY_BOUNCER,
- from = KeyguardState.DREAMING_LOCKSCREEN_HOSTED,
- ownerName = "FromDreamingLockscreenHostedTransitionInteractor",
- animatorAssertion = { it.isNotNull() },
- )
-
- coroutineContext.cancelChildren()
- }
-
- @Test
- @DisableSceneContainer
- fun dreamingLockscreenHostedToDozing() =
- testScope.runTest {
- // GIVEN a device is dreaming with lockscreen hosted dream
- keyguardRepository.setIsActiveDreamLockscreenHosted(true)
- runCurrent()
-
- // GIVEN a prior transition has run to DREAMING_LOCKSCREEN_HOSTED
- runTransitionAndSetWakefulness(
- KeyguardState.GONE,
- KeyguardState.DREAMING_LOCKSCREEN_HOSTED,
- )
-
- // WHEN the device begins to sleep
- keyguardRepository.setIsActiveDreamLockscreenHosted(false)
- keyguardRepository.setDozeTransitionModel(
- DozeTransitionModel(from = DozeStateModel.INITIALIZED, to = DozeStateModel.DOZE)
- )
- runCurrent()
-
- assertThat(transitionRepository)
- .startedTransition(
- to = KeyguardState.DOZING,
- from = KeyguardState.DREAMING_LOCKSCREEN_HOSTED,
- ownerName = "FromDreamingLockscreenHostedTransitionInteractor",
- animatorAssertion = { it.isNotNull() },
- )
-
- coroutineContext.cancelChildren()
- }
-
- @Test
- @DisableSceneContainer
- fun dreamingLockscreenHostedToOccluded() =
- testScope.runTest {
- // GIVEN device is dreaming with lockscreen hosted dream and not occluded
- keyguardRepository.setIsActiveDreamLockscreenHosted(true)
- keyguardRepository.setKeyguardOccluded(false)
- runCurrent()
-
- // GIVEN a prior transition has run to DREAMING_LOCKSCREEN_HOSTED
- runTransitionAndSetWakefulness(
- KeyguardState.GONE,
- KeyguardState.DREAMING_LOCKSCREEN_HOSTED,
- )
-
- // WHEN the keyguard is occluded and the lockscreen hosted dream stops
- keyguardRepository.setIsActiveDreamLockscreenHosted(false)
- keyguardRepository.setKeyguardOccluded(true)
- runCurrent()
-
- assertThat(transitionRepository)
- .startedTransition(
- to = KeyguardState.OCCLUDED,
- from = KeyguardState.DREAMING_LOCKSCREEN_HOSTED,
- ownerName = "FromDreamingLockscreenHostedTransitionInteractor",
- animatorAssertion = { it.isNotNull() },
- )
-
- coroutineContext.cancelChildren()
- }
-
- @Test
fun dozingToLockscreen() =
testScope.runTest {
// GIVEN a prior transition has run to DOZING
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/domain/interactor/LightRevealScrimInteractorTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/domain/interactor/LightRevealScrimInteractorTest.kt
index b6ec6a67b212..e24bb0432ed5 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/domain/interactor/LightRevealScrimInteractorTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/domain/interactor/LightRevealScrimInteractorTest.kt
@@ -19,6 +19,7 @@ package com.android.systemui.keyguard.domain.interactor
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.systemui.SysuiTestCase
+import com.android.systemui.coroutines.collectLastValue
import com.android.systemui.coroutines.collectValues
import com.android.systemui.keyguard.data.fakeLightRevealScrimRepository
import com.android.systemui.keyguard.data.repository.DEFAULT_REVEAL_DURATION
@@ -31,7 +32,6 @@ import com.android.systemui.keyguard.shared.model.TransitionState
import com.android.systemui.keyguard.shared.model.TransitionStep
import com.android.systemui.kosmos.testScope
import com.android.systemui.power.data.repository.fakePowerRepository
-import com.android.systemui.power.domain.interactor.powerInteractor
import com.android.systemui.power.shared.model.WakeSleepReason
import com.android.systemui.power.shared.model.WakefulnessState
import com.android.systemui.statusbar.LightRevealEffect
@@ -98,7 +98,7 @@ class LightRevealScrimInteractorTest : SysuiTestCase() {
fakeKeyguardTransitionRepository.sendTransitionStep(
TransitionStep(
to = KeyguardState.LOCKSCREEN,
- transitionState = TransitionState.RUNNING
+ transitionState = TransitionState.RUNNING,
)
)
runCurrent()
@@ -110,7 +110,7 @@ class LightRevealScrimInteractorTest : SysuiTestCase() {
fakeKeyguardTransitionRepository.sendTransitionStep(
TransitionStep(
to = KeyguardState.LOCKSCREEN,
- transitionState = TransitionState.STARTED
+ transitionState = TransitionState.STARTED,
)
)
runCurrent()
@@ -147,19 +147,29 @@ class LightRevealScrimInteractorTest : SysuiTestCase() {
assertThat(fakeLightRevealScrimRepository.revealAnimatorRequests.last())
.isEqualTo(
- RevealAnimatorRequest(
- reveal = false,
- duration = DEFAULT_REVEAL_DURATION
- )
+ RevealAnimatorRequest(reveal = false, duration = DEFAULT_REVEAL_DURATION)
)
}
+ @Test
+ fun supportsAmbientMode() =
+ kosmos.testScope.runTest {
+ val maxAlpha by collectLastValue(underTest.maxAlpha)
+ assertThat(maxAlpha).isEqualTo(1f)
+
+ underTest.setWallpaperSupportsAmbientMode(true)
+ assertThat(maxAlpha).isLessThan(1f)
+
+ underTest.setWallpaperSupportsAmbientMode(false)
+ assertThat(maxAlpha).isEqualTo(1f)
+ }
+
private fun updateWakefulness(goToSleepReason: WakeSleepReason) {
fakePowerRepository.updateWakefulness(
rawState = WakefulnessState.STARTING_TO_SLEEP,
lastWakeReason = WakeSleepReason.POWER_BUTTON,
lastSleepReason = goToSleepReason,
- powerButtonLaunchGestureTriggered = false
+ powerButtonLaunchGestureTriggered = false,
)
}
}
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/composefragment/viewmodel/AbstractQSFragmentComposeViewModelTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/composefragment/viewmodel/AbstractQSFragmentComposeViewModelTest.kt
index 4bbdfa44e087..d96e6643962d 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/composefragment/viewmodel/AbstractQSFragmentComposeViewModelTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/composefragment/viewmodel/AbstractQSFragmentComposeViewModelTest.kt
@@ -21,10 +21,11 @@ import androidx.lifecycle.lifecycleScope
import androidx.lifecycle.testing.TestLifecycleOwner
import com.android.systemui.SysuiTestCase
import com.android.systemui.kosmos.testDispatcher
+import com.android.systemui.kosmos.testScope
+import com.android.systemui.lifecycle.activateIn
import com.android.systemui.testKosmos
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.ExperimentalCoroutinesApi
-import kotlinx.coroutines.launch
import kotlinx.coroutines.test.TestResult
import kotlinx.coroutines.test.TestScope
import kotlinx.coroutines.test.resetMain
@@ -62,7 +63,7 @@ abstract class AbstractQSFragmentComposeViewModelTest : SysuiTestCase() {
): TestResult {
return runTest {
lifecycleOwner.setCurrentState(Lifecycle.State.RESUMED)
- lifecycleOwner.lifecycleScope.launch { underTest.activate() }
+ underTest.activateIn(kosmos.testScope)
block().also { lifecycleOwner.setCurrentState(Lifecycle.State.DESTROYED) }
}
}
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/composefragment/viewmodel/QSFragmentComposeViewModelForceQSTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/composefragment/viewmodel/QSFragmentComposeViewModelForceQSTest.kt
index da166408b926..d16da1c359fb 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/composefragment/viewmodel/QSFragmentComposeViewModelForceQSTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/composefragment/viewmodel/QSFragmentComposeViewModelForceQSTest.kt
@@ -18,12 +18,13 @@ package com.android.systemui.qs.composefragment.viewmodel
import android.testing.TestableLooper.RunWithLooper
import androidx.test.filters.SmallTest
-import com.android.systemui.coroutines.collectLastValue
import com.android.systemui.deviceentry.data.repository.fakeDeviceEntryRepository
import com.android.systemui.kosmos.testScope
import com.android.systemui.statusbar.StatusBarState
import com.android.systemui.statusbar.sysuiStatusBarStateController
import com.google.common.truth.Truth.assertThat
+import kotlinx.coroutines.ExperimentalCoroutinesApi
+import kotlinx.coroutines.test.runCurrent
import org.junit.Test
import org.junit.runner.RunWith
import platform.test.runner.parameterized.ParameterizedAndroidJunit4
@@ -32,6 +33,7 @@ import platform.test.runner.parameterized.Parameters
@SmallTest
@RunWith(ParameterizedAndroidJunit4::class)
@RunWithLooper
+@OptIn(ExperimentalCoroutinesApi::class)
class QSFragmentComposeViewModelForceQSTest(private val testData: TestData) :
AbstractQSFragmentComposeViewModelTest() {
@@ -39,18 +41,18 @@ class QSFragmentComposeViewModelForceQSTest(private val testData: TestData) :
fun forceQs_orRealExpansion() =
with(kosmos) {
testScope.testWithinLifecycle {
- val expansionState by collectLastValue(underTest.expansionState)
-
with(testData) {
sysuiStatusBarStateController.setState(statusBarState)
- underTest.isQSExpanded = expanded
+ underTest.isQsExpanded = expanded
underTest.isStackScrollerOverscrolling = stackScrollerOverScrolling
fakeDeviceEntryRepository.setBypassEnabled(bypassEnabled)
underTest.isTransitioningToFullShade = transitioningToFullShade
underTest.isInSplitShade = inSplitShade
- underTest.qsExpansionValue = EXPANSION
- assertThat(expansionState!!.progress)
+ underTest.setQsExpansionValue(EXPANSION)
+
+ runCurrent()
+ assertThat(underTest.expansionState.progress)
.isEqualTo(if (expectedForceQS) 1f else EXPANSION)
}
}
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/composefragment/viewmodel/QSFragmentComposeViewModelTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/composefragment/viewmodel/QSFragmentComposeViewModelTest.kt
index c19e4b834c7c..3b00f86c8f6a 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/composefragment/viewmodel/QSFragmentComposeViewModelTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/composefragment/viewmodel/QSFragmentComposeViewModelTest.kt
@@ -19,6 +19,7 @@ package com.android.systemui.qs.composefragment.viewmodel
import android.app.StatusBarManager
import android.content.testableContext
import android.testing.TestableLooper.RunWithLooper
+import androidx.compose.runtime.snapshots.Snapshot
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.systemui.common.ui.data.repository.fakeConfigurationRepository
@@ -33,6 +34,7 @@ import com.android.systemui.statusbar.disableflags.data.model.DisableFlagsModel
import com.android.systemui.statusbar.disableflags.data.repository.fakeDisableFlagsRepository
import com.android.systemui.statusbar.sysuiStatusBarStateController
import com.google.common.truth.Truth.assertThat
+import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.test.runCurrent
import org.junit.Test
import org.junit.runner.RunWith
@@ -40,22 +42,21 @@ import org.junit.runner.RunWith
@SmallTest
@RunWith(AndroidJUnit4::class)
@RunWithLooper
+@OptIn(ExperimentalCoroutinesApi::class)
class QSFragmentComposeViewModelTest : AbstractQSFragmentComposeViewModelTest() {
@Test
fun qsExpansionValueChanges_correctExpansionState() =
with(kosmos) {
testScope.testWithinLifecycle {
- val expansionState by collectLastValue(underTest.expansionState)
+ underTest.setQsExpansionValue(0f)
+ assertThat(underTest.expansionState.progress).isEqualTo(0f)
- underTest.qsExpansionValue = 0f
- assertThat(expansionState!!.progress).isEqualTo(0f)
+ underTest.setQsExpansionValue(0.3f)
+ assertThat(underTest.expansionState.progress).isEqualTo(0.3f)
- underTest.qsExpansionValue = 0.3f
- assertThat(expansionState!!.progress).isEqualTo(0.3f)
-
- underTest.qsExpansionValue = 1f
- assertThat(expansionState!!.progress).isEqualTo(1f)
+ underTest.setQsExpansionValue(1f)
+ assertThat(underTest.expansionState.progress).isEqualTo(1f)
}
}
@@ -63,13 +64,11 @@ class QSFragmentComposeViewModelTest : AbstractQSFragmentComposeViewModelTest()
fun qsExpansionValueChanges_clamped() =
with(kosmos) {
testScope.testWithinLifecycle {
- val expansionState by collectLastValue(underTest.expansionState)
-
- underTest.qsExpansionValue = -1f
- assertThat(expansionState!!.progress).isEqualTo(0f)
+ underTest.setQsExpansionValue(-1f)
+ assertThat(underTest.expansionState.progress).isEqualTo(0f)
- underTest.qsExpansionValue = 2f
- assertThat(expansionState!!.progress).isEqualTo(1f)
+ underTest.setQsExpansionValue(2f)
+ assertThat(underTest.expansionState.progress).isEqualTo(1f)
}
}
@@ -77,15 +76,13 @@ class QSFragmentComposeViewModelTest : AbstractQSFragmentComposeViewModelTest()
fun qqsHeaderHeight_largeScreenHeader_0() =
with(kosmos) {
testScope.testWithinLifecycle {
- val qqsHeaderHeight by collectLastValue(underTest.qqsHeaderHeight)
-
testableContext.orCreateTestableResources.addOverride(
R.bool.config_use_large_screen_shade_header,
true,
)
fakeConfigurationRepository.onConfigurationChange()
- assertThat(qqsHeaderHeight).isEqualTo(0)
+ assertThat(underTest.qqsHeaderHeight).isEqualTo(0)
}
}
@@ -93,15 +90,13 @@ class QSFragmentComposeViewModelTest : AbstractQSFragmentComposeViewModelTest()
fun qqsHeaderHeight_noLargeScreenHeader_providedByHelper() =
with(kosmos) {
testScope.testWithinLifecycle {
- val qqsHeaderHeight by collectLastValue(underTest.qqsHeaderHeight)
-
testableContext.orCreateTestableResources.addOverride(
R.bool.config_use_large_screen_shade_header,
false,
)
fakeConfigurationRepository.onConfigurationChange()
- assertThat(qqsHeaderHeight)
+ assertThat(underTest.qqsHeaderHeight)
.isEqualTo(largeScreenHeaderHelper.getLargeScreenHeaderHeight())
}
}
@@ -120,17 +115,17 @@ class QSFragmentComposeViewModelTest : AbstractQSFragmentComposeViewModelTest()
fun statusBarState_followsController() =
with(kosmos) {
testScope.testWithinLifecycle {
- val statusBarState by collectLastValue(underTest.statusBarState)
- runCurrent()
-
sysuiStatusBarStateController.setState(StatusBarState.SHADE)
- assertThat(statusBarState).isEqualTo(StatusBarState.SHADE)
+ runCurrent()
+ assertThat(underTest.statusBarState).isEqualTo(StatusBarState.SHADE)
sysuiStatusBarStateController.setState(StatusBarState.KEYGUARD)
- assertThat(statusBarState).isEqualTo(StatusBarState.KEYGUARD)
+ runCurrent()
+ assertThat(underTest.statusBarState).isEqualTo(StatusBarState.KEYGUARD)
sysuiStatusBarStateController.setState(StatusBarState.SHADE_LOCKED)
- assertThat(statusBarState).isEqualTo(StatusBarState.SHADE_LOCKED)
+ runCurrent()
+ assertThat(underTest.statusBarState).isEqualTo(StatusBarState.SHADE_LOCKED)
}
}
@@ -138,17 +133,18 @@ class QSFragmentComposeViewModelTest : AbstractQSFragmentComposeViewModelTest()
fun statusBarState_changesEarlyIfUpcomingStateIsKeyguard() =
with(kosmos) {
testScope.testWithinLifecycle {
- val statusBarState by collectLastValue(underTest.statusBarState)
-
sysuiStatusBarStateController.setState(StatusBarState.SHADE)
sysuiStatusBarStateController.setUpcomingState(StatusBarState.SHADE_LOCKED)
- assertThat(statusBarState).isEqualTo(StatusBarState.SHADE)
+ runCurrent()
+ assertThat(underTest.statusBarState).isEqualTo(StatusBarState.SHADE)
sysuiStatusBarStateController.setUpcomingState(StatusBarState.KEYGUARD)
- assertThat(statusBarState).isEqualTo(StatusBarState.KEYGUARD)
+ runCurrent()
+ assertThat(underTest.statusBarState).isEqualTo(StatusBarState.KEYGUARD)
sysuiStatusBarStateController.setUpcomingState(StatusBarState.SHADE)
- assertThat(statusBarState).isEqualTo(StatusBarState.KEYGUARD)
+ runCurrent()
+ assertThat(underTest.statusBarState).isEqualTo(StatusBarState.KEYGUARD)
}
}
@@ -156,16 +152,16 @@ class QSFragmentComposeViewModelTest : AbstractQSFragmentComposeViewModelTest()
fun qsEnabled_followsRepository() =
with(kosmos) {
testScope.testWithinLifecycle {
- val qsEnabled by collectLastValue(underTest.qsEnabled)
-
fakeDisableFlagsRepository.disableFlags.value =
DisableFlagsModel(disable2 = QS_DISABLE_FLAG)
+ runCurrent()
- assertThat(qsEnabled).isFalse()
+ assertThat(underTest.isQsEnabled).isFalse()
fakeDisableFlagsRepository.disableFlags.value = DisableFlagsModel()
+ runCurrent()
- assertThat(qsEnabled).isTrue()
+ assertThat(underTest.isQsEnabled).isTrue()
}
}
@@ -175,13 +171,16 @@ class QSFragmentComposeViewModelTest : AbstractQSFragmentComposeViewModelTest()
testScope.testWithinLifecycle {
val squishiness by collectLastValue(tileSquishinessInteractor.squishiness)
- underTest.squishinessFractionValue = 0.3f
+ underTest.squishinessFraction = 0.3f
+ Snapshot.sendApplyNotifications()
assertThat(squishiness).isWithin(epsilon).of(0.3f.constrainSquishiness())
- underTest.squishinessFractionValue = 0f
+ underTest.squishinessFraction = 0f
+ Snapshot.sendApplyNotifications()
assertThat(squishiness).isWithin(epsilon).of(0f.constrainSquishiness())
- underTest.squishinessFractionValue = 1f
+ underTest.squishinessFraction = 1f
+ Snapshot.sendApplyNotifications()
assertThat(squishiness).isWithin(epsilon).of(1f.constrainSquishiness())
}
}
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/panels/data/repository/QSColumnsRepositoryTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/panels/data/repository/QSColumnsRepositoryTest.kt
index fd1f52b9d8c8..ec0773f79328 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/panels/data/repository/QSColumnsRepositoryTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/panels/data/repository/QSColumnsRepositoryTest.kt
@@ -16,7 +16,6 @@
package com.android.systemui.qs.panels.data.repository
-import android.platform.test.annotations.EnableFlags
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.systemui.SysuiTestCase
@@ -25,7 +24,7 @@ import com.android.systemui.coroutines.collectLastValue
import com.android.systemui.kosmos.testCase
import com.android.systemui.kosmos.testScope
import com.android.systemui.res.R
-import com.android.systemui.shade.shared.flag.DualShade
+import com.android.systemui.shade.data.repository.fakeShadeRepository
import com.android.systemui.testKosmos
import com.google.common.truth.Truth.assertThat
import kotlinx.coroutines.test.runTest
@@ -59,15 +58,22 @@ class QSColumnsRepositoryTest : SysuiTestCase() {
}
@Test
- @EnableFlags(DualShade.FLAG_NAME)
fun withDualShade_returnsCorrectValue() =
with(kosmos) {
testScope.runTest {
- val latest by collectLastValue(underTest.columns)
+ val latest by collectLastValue(underTest.dualShadeColumns)
+
assertThat(latest).isEqualTo(4)
+ }
+ }
+
+ @Test
+ fun withSplitShade_returnsCorrectValue() =
+ with(kosmos) {
+ testScope.runTest {
+ val latest by collectLastValue(underTest.splitShadeColumns)
+ fakeShadeRepository.setShadeLayoutWide(true)
- setColumnsInConfig(8, id = R.integer.quick_settings_dual_shade_num_columns)
- // Asserts config changes are ignored
assertThat(latest).isEqualTo(4)
}
}
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/panels/domain/interactor/QSColumnsInteractorTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/panels/domain/interactor/QSColumnsInteractorTest.kt
new file mode 100644
index 000000000000..35f7504ead50
--- /dev/null
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/panels/domain/interactor/QSColumnsInteractorTest.kt
@@ -0,0 +1,101 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.systemui.qs.panels.domain.interactor
+
+import android.content.res.mainResources
+import android.platform.test.annotations.DisableFlags
+import android.platform.test.annotations.EnableFlags
+import androidx.test.ext.junit.runners.AndroidJUnit4
+import androidx.test.filters.SmallTest
+import com.android.systemui.SysuiTestCase
+import com.android.systemui.common.ui.data.repository.configurationRepository
+import com.android.systemui.coroutines.collectLastValue
+import com.android.systemui.kosmos.testCase
+import com.android.systemui.kosmos.testScope
+import com.android.systemui.qs.panels.data.repository.QSColumnsRepository
+import com.android.systemui.qs.panels.data.repository.qsColumnsRepository
+import com.android.systemui.res.R
+import com.android.systemui.shade.data.repository.fakeShadeRepository
+import com.android.systemui.shade.shared.flag.DualShade
+import com.android.systemui.testKosmos
+import com.google.common.truth.Truth.assertThat
+import kotlinx.coroutines.test.runTest
+import org.junit.Before
+import org.junit.Test
+import org.junit.runner.RunWith
+
+@SmallTest
+@RunWith(AndroidJUnit4::class)
+class QSColumnsInteractorTest : SysuiTestCase() {
+ private val kosmos =
+ testKosmos().apply {
+ testCase.context.orCreateTestableResources.addOverride(
+ R.integer.quick_settings_infinite_grid_num_columns,
+ 1,
+ )
+ testCase.context.orCreateTestableResources.addOverride(
+ R.integer.quick_settings_dual_shade_num_columns,
+ 2,
+ )
+ testCase.context.orCreateTestableResources.addOverride(
+ R.integer.quick_settings_split_shade_num_columns,
+ 3,
+ )
+ qsColumnsRepository = QSColumnsRepository(mainResources, configurationRepository)
+ }
+ private lateinit var underTest: QSColumnsInteractor
+
+ @Before
+ fun setUp() {
+ underTest = with(kosmos) { qsColumnsInteractor }
+ }
+
+ @Test
+ @DisableFlags(DualShade.FLAG_NAME)
+ fun withSingleShade_returnsCorrectValue() =
+ with(kosmos) {
+ testScope.runTest {
+ val latest by collectLastValue(underTest.columns)
+
+ assertThat(latest).isEqualTo(1)
+ }
+ }
+
+ @Test
+ @EnableFlags(DualShade.FLAG_NAME)
+ fun withDualShade_returnsCorrectValue() =
+ with(kosmos) {
+ testScope.runTest {
+ val latest by collectLastValue(underTest.columns)
+
+ assertThat(latest).isEqualTo(2)
+ }
+ }
+
+ @Test
+ @DisableFlags(DualShade.FLAG_NAME)
+ fun withSplitShade_returnsCorrectValue() =
+ with(kosmos) {
+ testScope.runTest {
+ val latest by collectLastValue(underTest.columns)
+
+ fakeShadeRepository.setShadeLayoutWide(true)
+
+ assertThat(latest).isEqualTo(3)
+ }
+ }
+}
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/modes/domain/interactor/ModesTileDataInteractorTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/modes/domain/interactor/ModesTileDataInteractorTest.kt
index 1d80826d0b45..de3dc5730421 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/modes/domain/interactor/ModesTileDataInteractorTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/modes/domain/interactor/ModesTileDataInteractorTest.kt
@@ -28,7 +28,6 @@ import com.android.internal.R
import com.android.settingslib.notification.modes.TestModeBuilder
import com.android.systemui.SysuiTestCase
import com.android.systemui.SysuiTestableContext
-import com.android.systemui.common.shared.model.Icon
import com.android.systemui.common.shared.model.asIcon
import com.android.systemui.coroutines.collectLastValue
import com.android.systemui.coroutines.collectValues
@@ -145,13 +144,13 @@ class ModesTileDataInteractorTest : SysuiTestCase() {
// Tile starts with the generic Modes icon.
runCurrent()
- assertThat(tileData?.icon).isEqualTo(MODES_RESOURCE_ICON)
+ assertThat(tileData?.icon).isEqualTo(MODES_ICON)
assertThat(tileData?.iconResId).isEqualTo(MODES_DRAWABLE_ID)
// Add an inactive mode -> Still modes icon
zenModeRepository.addMode(id = "Mode", active = false)
runCurrent()
- assertThat(tileData?.icon).isEqualTo(MODES_RESOURCE_ICON)
+ assertThat(tileData?.icon).isEqualTo(MODES_ICON)
assertThat(tileData?.iconResId).isEqualTo(MODES_DRAWABLE_ID)
// Add an active mode with a default icon: icon should be the mode icon, and the
@@ -159,7 +158,7 @@ class ModesTileDataInteractorTest : SysuiTestCase() {
zenModeRepository.addMode(
id = "Bedtime with default icon",
type = AutomaticZenRule.TYPE_BEDTIME,
- active = true,
+ active = true
)
runCurrent()
assertThat(tileData?.icon).isEqualTo(BEDTIME_ICON)
@@ -190,7 +189,7 @@ class ModesTileDataInteractorTest : SysuiTestCase() {
// Deactivate remaining mode: back to the default modes icon
zenModeRepository.deactivateMode("Driving with custom icon")
runCurrent()
- assertThat(tileData?.icon).isEqualTo(MODES_RESOURCE_ICON)
+ assertThat(tileData?.icon).isEqualTo(MODES_ICON)
assertThat(tileData?.iconResId).isEqualTo(MODES_DRAWABLE_ID)
}
@@ -205,18 +204,18 @@ class ModesTileDataInteractorTest : SysuiTestCase() {
)
runCurrent()
- assertThat(tileData?.icon).isEqualTo(MODES_RESOURCE_ICON)
+ assertThat(tileData?.icon).isEqualTo(MODES_ICON)
assertThat(tileData?.iconResId).isEqualTo(MODES_DRAWABLE_ID)
// Activate a Mode -> Icon doesn't change.
zenModeRepository.addMode(id = "Mode", active = true)
runCurrent()
- assertThat(tileData?.icon).isEqualTo(MODES_RESOURCE_ICON)
+ assertThat(tileData?.icon).isEqualTo(MODES_ICON)
assertThat(tileData?.iconResId).isEqualTo(MODES_DRAWABLE_ID)
zenModeRepository.deactivateMode(id = "Mode")
runCurrent()
- assertThat(tileData?.icon).isEqualTo(MODES_RESOURCE_ICON)
+ assertThat(tileData?.icon).isEqualTo(MODES_ICON)
assertThat(tileData?.iconResId).isEqualTo(MODES_DRAWABLE_ID)
}
@@ -264,7 +263,7 @@ class ModesTileDataInteractorTest : SysuiTestCase() {
val BEDTIME_DRAWABLE = TestStubDrawable("bedtime")
val CUSTOM_DRAWABLE = TestStubDrawable("custom")
- val MODES_RESOURCE_ICON = Icon.Resource(MODES_DRAWABLE_ID, null)
+ val MODES_ICON = MODES_DRAWABLE.asIcon()
val BEDTIME_ICON = BEDTIME_DRAWABLE.asIcon()
val CUSTOM_ICON = CUSTOM_DRAWABLE.asIcon()
}
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/modes/ui/ModesTileMapperTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/modes/ui/ModesTileMapperTest.kt
index a58cb9ce25b3..c3d45dbbd09a 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/modes/ui/ModesTileMapperTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/modes/ui/ModesTileMapperTest.kt
@@ -22,9 +22,7 @@ import android.platform.test.annotations.EnableFlags
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.systemui.SysuiTestCase
-import com.android.systemui.common.shared.model.Icon
import com.android.systemui.common.shared.model.asIcon
-import com.android.systemui.qs.tiles.ModesTile
import com.android.systemui.qs.tiles.impl.modes.domain.model.ModesTileModel
import com.android.systemui.qs.tiles.viewmodel.QSTileConfigTestBuilder
import com.android.systemui.qs.tiles.viewmodel.QSTileState
@@ -53,11 +51,6 @@ class ModesTileMapperTest : SysuiTestCase() {
.apply {
addOverride(R.drawable.qs_dnd_icon_on, TestStubDrawable())
addOverride(R.drawable.qs_dnd_icon_off, TestStubDrawable())
- addOverride(
- ModesTile.ICON_RES_ID,
- TestStubDrawable(ModesTile.ICON_RES_ID.toString()),
- )
- addOverride(123, TestStubDrawable("123"))
}
.resources,
context.theme,
@@ -66,7 +59,12 @@ class ModesTileMapperTest : SysuiTestCase() {
@Test
fun inactiveState() {
val icon = TestStubDrawable("res123").asIcon()
- val model = ModesTileModel(isActivated = false, activeModes = emptyList(), icon = icon)
+ val model =
+ ModesTileModel(
+ isActivated = false,
+ activeModes = emptyList(),
+ icon = icon,
+ )
val state = underTest.map(config, model)
@@ -78,7 +76,12 @@ class ModesTileMapperTest : SysuiTestCase() {
@Test
fun activeState_oneMode() {
val icon = TestStubDrawable("res123").asIcon()
- val model = ModesTileModel(isActivated = true, activeModes = listOf("DND"), icon = icon)
+ val model =
+ ModesTileModel(
+ isActivated = true,
+ activeModes = listOf("DND"),
+ icon = icon,
+ )
val state = underTest.map(config, model)
@@ -105,36 +108,19 @@ class ModesTileMapperTest : SysuiTestCase() {
}
@Test
- fun resourceIconModel_whenResIdsIdentical_mapsToLoadedIconWithInputResId() {
- val icon = Icon.Resource(123, null)
- val model =
- ModesTileModel(
- isActivated = false,
- activeModes = emptyList(),
- icon = icon,
- iconResId = 123,
- )
-
- val state = underTest.map(config, model)
-
- assertThat(state.icon()).isEqualTo(TestStubDrawable("123").asIcon())
- assertThat(state.iconRes).isEqualTo(123)
- }
-
- @Test
- fun resourceIconModel_whenResIdsNonIdentical_mapsToLoadedIconWithIconResourceId() {
- val icon = Icon.Resource(123, null)
+ fun state_modelHasIconResId_includesIconResId() {
+ val icon = TestStubDrawable("res123").asIcon()
val model =
ModesTileModel(
isActivated = false,
activeModes = emptyList(),
icon = icon,
- iconResId = 321, // Note: NOT 123. This will be ignored.
+ iconResId = 123
)
val state = underTest.map(config, model)
- assertThat(state.icon()).isEqualTo(TestStubDrawable("123").asIcon())
+ assertThat(state.icon()).isEqualTo(icon)
assertThat(state.iconRes).isEqualTo(123)
}
}
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/rotation/ui/mapper/RotationLockTileMapperTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/rotation/ui/mapper/RotationLockTileMapperTest.kt
index 04ca38fa4343..3e40c5ca797c 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/rotation/ui/mapper/RotationLockTileMapperTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/impl/rotation/ui/mapper/RotationLockTileMapperTest.kt
@@ -22,6 +22,9 @@ import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.systemui.SysuiTestCase
import com.android.systemui.common.shared.model.Icon
+import com.android.systemui.defaultDeviceState
+import com.android.systemui.deviceStateManager
+import com.android.systemui.foldedDeviceStateList
import com.android.systemui.kosmos.Kosmos
import com.android.systemui.qs.tiles.impl.custom.QSTileStateSubject
import com.android.systemui.qs.tiles.impl.rotation.domain.model.RotationLockTileModel
@@ -30,11 +33,11 @@ import com.android.systemui.qs.tiles.viewmodel.QSTileState
import com.android.systemui.res.R
import com.android.systemui.statusbar.policy.DevicePostureController
import com.android.systemui.statusbar.policy.devicePostureController
-import com.android.systemui.util.mockito.whenever
import com.google.common.truth.Truth.assertThat
import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
+import org.mockito.kotlin.whenever
@SmallTest
@RunWith(AndroidJUnit4::class)
@@ -42,13 +45,17 @@ class RotationLockTileMapperTest : SysuiTestCase() {
private val kosmos = Kosmos()
private val rotationLockTileConfig = kosmos.qsRotationLockTileConfig
private val devicePostureController = kosmos.devicePostureController
+ private val deviceStateManager = kosmos.deviceStateManager
private lateinit var mapper: RotationLockTileMapper
@Before
fun setup() {
+ deviceStateManager
whenever(devicePostureController.devicePosture)
.thenReturn(DevicePostureController.DEVICE_POSTURE_CLOSED)
+ whenever(deviceStateManager.supportedDeviceStates)
+ .thenReturn(listOf(kosmos.defaultDeviceState))
mapper =
RotationLockTileMapper(
@@ -64,7 +71,8 @@ class RotationLockTileMapperTest : SysuiTestCase() {
}
.resources,
context.theme,
- devicePostureController
+ devicePostureController,
+ deviceStateManager
)
}
@@ -162,6 +170,7 @@ class RotationLockTileMapperTest : SysuiTestCase() {
intArrayOf(1, 2, 3)
)
}
+ whenever(deviceStateManager.supportedDeviceStates).thenReturn(kosmos.foldedDeviceStateList)
}
private fun createRotationLockTileState(
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/screenshot/data/model/DisplayContentScenarios.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/screenshot/data/model/DisplayContentScenarios.kt
index 254f1e1efe13..4d71dc45001d 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/screenshot/data/model/DisplayContentScenarios.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/screenshot/data/model/DisplayContentScenarios.kt
@@ -21,8 +21,8 @@ import android.graphics.Rect
import com.android.systemui.screenshot.data.model.DisplayContentScenarios.Bounds.FREE_FORM
import com.android.systemui.screenshot.data.model.DisplayContentScenarios.Bounds.FULL_SCREEN
import com.android.systemui.screenshot.data.model.DisplayContentScenarios.Bounds.PIP
-import com.android.systemui.screenshot.data.model.DisplayContentScenarios.Bounds.SPLIT_BOTTOM
-import com.android.systemui.screenshot.data.model.DisplayContentScenarios.Bounds.SPLIT_TOP
+import com.android.systemui.screenshot.data.model.DisplayContentScenarios.Orientation.HORIZONTAL
+import com.android.systemui.screenshot.data.model.DisplayContentScenarios.Orientation.VERTICAL
import com.android.systemui.screenshot.data.model.DisplayContentScenarios.RootTasks.emptyRootSplit
import com.android.systemui.screenshot.data.model.DisplayContentScenarios.RootTasks.freeForm
import com.android.systemui.screenshot.data.model.DisplayContentScenarios.RootTasks.fullScreen
@@ -39,16 +39,14 @@ object DisplayContentScenarios {
data class TaskSpec(val taskId: Int, val userId: Int, val name: String)
+ val emptyDisplayContent = DisplayContentModel(0, SystemUiState(shadeExpanded = false), listOf())
+
/** Home screen, with only the launcher visible */
fun launcherOnly(shadeExpanded: Boolean = false) =
DisplayContentModel(
displayId = 0,
systemUiState = SystemUiState(shadeExpanded = shadeExpanded),
- rootTasks =
- listOf(
- launcher(visible = true),
- emptyRootSplit,
- )
+ rootTasks = listOf(launcher(visible = true), emptyRootSplit),
)
/** A Full screen activity for the personal (primary) user, with launcher behind it */
@@ -57,48 +55,72 @@ object DisplayContentScenarios {
displayId = 0,
systemUiState = SystemUiState(shadeExpanded = shadeExpanded),
rootTasks =
- listOf(
- fullScreen(spec, visible = true),
- launcher(visible = false),
- emptyRootSplit,
- )
+ listOf(fullScreen(spec, visible = true), launcher(visible = false), emptyRootSplit),
)
+ enum class Orientation {
+ HORIZONTAL,
+ VERTICAL,
+ }
+
+ internal fun Rect.splitLeft(margin: Int = 0) = Rect(left, top, centerX() - margin, bottom)
+
+ internal fun Rect.splitRight(margin: Int = 0) = Rect(centerX() + margin, top, right, bottom)
+
+ internal fun Rect.splitTop(margin: Int = 0) = Rect(left, top, right, centerY() - margin)
+
+ internal fun Rect.splitBottom(margin: Int = 0) = Rect(left, centerY() + margin, right, bottom)
+
fun splitScreenApps(
- top: TaskSpec,
- bottom: TaskSpec,
+ displayId: Int = 0,
+ parentBounds: Rect = FULL_SCREEN,
+ taskMargin: Int = 0,
+ orientation: Orientation = VERTICAL,
+ first: TaskSpec,
+ second: TaskSpec,
focusedTaskId: Int,
+ parentTaskId: Int = 2,
shadeExpanded: Boolean = false,
): DisplayContentModel {
- val topBounds = SPLIT_TOP
- val bottomBounds = SPLIT_BOTTOM
+
+ val firstBounds =
+ when (orientation) {
+ VERTICAL -> parentBounds.splitTop(taskMargin)
+ HORIZONTAL -> parentBounds.splitLeft(taskMargin)
+ }
+ val secondBounds =
+ when (orientation) {
+ VERTICAL -> parentBounds.splitBottom(taskMargin)
+ HORIZONTAL -> parentBounds.splitRight(taskMargin)
+ }
+
return DisplayContentModel(
- displayId = 0,
+ displayId = displayId,
systemUiState = SystemUiState(shadeExpanded = shadeExpanded),
rootTasks =
listOf(
newRootTaskInfo(
- taskId = 2,
+ taskId = parentTaskId,
userId = TestUserIds.PERSONAL,
- bounds = FULL_SCREEN,
+ bounds = parentBounds,
topActivity =
ComponentName.unflattenFromString(
- if (top.taskId == focusedTaskId) top.name else bottom.name
+ if (first.taskId == focusedTaskId) first.name else second.name
),
) {
listOf(
newChildTask(
- taskId = top.taskId,
- bounds = topBounds,
- userId = top.userId,
- name = top.name
+ taskId = first.taskId,
+ bounds = firstBounds,
+ userId = first.userId,
+ name = first.name,
),
newChildTask(
- taskId = bottom.taskId,
- bounds = bottomBounds,
- userId = bottom.userId,
- name = bottom.name
- )
+ taskId = second.taskId,
+ bounds = secondBounds,
+ userId = second.userId,
+ name = second.name,
+ ),
)
// Child tasks are ordered bottom-up in RootTaskInfo.
// Sort 'focusedTaskId' last.
@@ -106,7 +128,7 @@ object DisplayContentScenarios {
.sortedBy { it.id == focusedTaskId }
},
launcher(visible = false),
- )
+ ),
)
}
@@ -124,7 +146,7 @@ object DisplayContentScenarios {
fullScreen?.also { add(fullScreen(it, visible = true)) }
add(launcher(visible = (fullScreen == null)))
add(emptyRootSplit)
- }
+ },
)
}
@@ -142,7 +164,7 @@ object DisplayContentScenarios {
return DisplayContentModel(
displayId = 0,
systemUiState = SystemUiState(shadeExpanded = shadeExpanded),
- rootTasks = freeFormTasks + launcher(visible = true) + emptyRootSplit
+ rootTasks = freeFormTasks + launcher(visible = true) + emptyRootSplit,
)
}
@@ -153,11 +175,18 @@ object DisplayContentScenarios {
* somewhat sensible in terms of logical position (Re: PIP, SPLIT, etc).
*/
object Bounds {
+ // "Phone" size
val FULL_SCREEN = Rect(0, 0, 1080, 2400)
val PIP = Rect(440, 1458, 1038, 1794)
val SPLIT_TOP = Rect(0, 0, 1080, 1187)
val SPLIT_BOTTOM = Rect(0, 1213, 1080, 2400)
val FREE_FORM = Rect(119, 332, 1000, 1367)
+
+ // "Tablet" size
+ val FREEFORM_FULL_SCREEN = Rect(0, 0, 2560, 1600)
+ val FREEFORM_MAXIMIZED = Rect(0, 48, 2560, 1480)
+ val FREEFORM_SPLIT_LEFT = Rect(0, 0, 1270, 1600)
+ val FREEFORM_SPLIT_RIGHT = Rect(1290, 0, 2560, 1600)
}
/** A collection of task names used in test scenarios */
@@ -177,6 +206,8 @@ object DisplayContentScenarios {
"com.google.android.youtube/" +
"com.google.android.apps.youtube.app.watchwhile.WatchWhileActivity"
+ const val MESSAGES = "com.google.android.apps.messaging/.ui.ConversationListActivity"
+
/** The NexusLauncher activity */
const val LAUNCHER =
"com.google.android.apps.nexuslauncher/" +
@@ -220,7 +251,7 @@ object DisplayContentScenarios {
}
/** NexusLauncher on the default display. Usually below all other visible tasks */
- fun launcher(visible: Boolean) =
+ fun launcher(visible: Boolean, bounds: Rect = FULL_SCREEN) =
newRootTaskInfo(
taskId = 1,
activityType = ActivityType.Home,
@@ -229,43 +260,63 @@ object DisplayContentScenarios {
topActivity = ComponentName.unflattenFromString(ActivityNames.LAUNCHER),
topActivityType = ActivityType.Home,
) {
- listOf(newChildTask(taskId = 1002, name = ActivityNames.LAUNCHER))
+ listOf(newChildTask(taskId = 1002, name = ActivityNames.LAUNCHER, bounds = bounds))
}
/** A full screen Activity */
- fun fullScreen(task: TaskSpec, visible: Boolean) =
+ fun fullScreen(task: TaskSpec, visible: Boolean, bounds: Rect = FULL_SCREEN) =
newRootTaskInfo(
taskId = task.taskId,
userId = task.userId,
visible = visible,
- bounds = FULL_SCREEN,
+ bounds = bounds,
topActivity = ComponentName.unflattenFromString(task.name),
) {
- listOf(newChildTask(taskId = task.taskId, userId = task.userId, name = task.name))
+ listOf(
+ newChildTask(
+ taskId = task.taskId,
+ userId = task.userId,
+ name = task.name,
+ bounds = bounds,
+ )
+ )
}
/** An activity in Picture-in-Picture mode */
- fun pictureInPicture(task: TaskSpec) =
+ fun pictureInPicture(task: TaskSpec, bounds: Rect = PIP) =
newRootTaskInfo(
taskId = task.taskId,
userId = task.userId,
- bounds = PIP,
windowingMode = WindowingMode.PictureInPicture,
topActivity = ComponentName.unflattenFromString(task.name),
) {
- listOf(newChildTask(taskId = task.taskId, userId = userId, name = task.name))
+ listOf(
+ newChildTask(
+ taskId = task.taskId,
+ userId = userId,
+ name = task.name,
+ bounds = bounds,
+ )
+ )
}
/** An activity in FreeForm mode */
- fun freeForm(task: TaskSpec) =
+ fun freeForm(task: TaskSpec, bounds: Rect = FREE_FORM) =
newRootTaskInfo(
taskId = task.taskId,
userId = task.userId,
- bounds = FREE_FORM,
+ bounds = bounds,
windowingMode = WindowingMode.Freeform,
topActivity = ComponentName.unflattenFromString(task.name),
) {
- listOf(newChildTask(taskId = task.taskId, userId = userId, name = task.name))
+ listOf(
+ newChildTask(
+ taskId = task.taskId,
+ userId = userId,
+ name = task.name,
+ bounds = bounds,
+ )
+ )
}
}
}
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/screenshot/policy/NewRootTaskInfo.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/screenshot/policy/NewRootTaskInfo.kt
index 6c35b233ffec..cedf0c8a2c06 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/screenshot/policy/NewRootTaskInfo.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/screenshot/policy/NewRootTaskInfo.kt
@@ -69,7 +69,7 @@ fun RootTaskInfo.newChildTask(
taskId: Int,
name: String,
bounds: Rect? = null,
- userId: Int? = null
+ userId: Int? = null,
): ChildTaskModel {
return ChildTaskModel(taskId, name, bounds ?: this.bounds, userId ?: this.userId)
}
@@ -83,7 +83,7 @@ fun newRootTaskInfo(
running: Boolean = true,
activityType: ActivityType = Standard,
windowingMode: WindowingMode = FullScreen,
- bounds: Rect? = null,
+ bounds: Rect = Rect(),
topActivity: ComponentName? = null,
topActivityType: ActivityType = Standard,
numActivities: Int? = null,
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/screenshot/policy/PrivateProfilePolicyTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/screenshot/policy/PrivateProfilePolicyTest.kt
index 6e57761aafa6..b7f565df4a3c 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/screenshot/policy/PrivateProfilePolicyTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/screenshot/policy/PrivateProfilePolicyTest.kt
@@ -17,8 +17,8 @@
package com.android.systemui.screenshot.policy
import android.content.ComponentName
-import androidx.test.ext.junit.runners.AndroidJUnit4
import android.os.UserHandle
+import androidx.test.ext.junit.runners.AndroidJUnit4
import com.android.systemui.kosmos.Kosmos
import com.android.systemui.screenshot.data.model.DisplayContentModel
import com.android.systemui.screenshot.data.model.DisplayContentScenarios.ActivityNames.FILES
@@ -59,7 +59,7 @@ class PrivateProfilePolicyTest {
policy.check(
singleFullScreen(
spec = TaskSpec(taskId = 1002, name = YOUTUBE, userId = PRIVATE),
- shadeExpanded = true
+ shadeExpanded = true,
)
)
@@ -93,8 +93,8 @@ class PrivateProfilePolicyTest {
CaptureParameters(
type = FullScreen(displayId = 0),
component = ComponentName.unflattenFromString(YOUTUBE),
- owner = UserHandle.of(PRIVATE)
- )
+ owner = UserHandle.of(PRIVATE),
+ ),
)
)
}
@@ -110,25 +110,20 @@ class PrivateProfilePolicyTest {
listOf(
fullScreen(
TaskSpec(taskId = 1002, name = FILES, userId = PERSONAL),
- visible = true
+ visible = true,
),
fullScreen(
TaskSpec(taskId = 1003, name = YOUTUBE, userId = PRIVATE),
- visible = false
+ visible = false,
),
launcher(visible = false),
emptyRootSplit,
- )
+ ),
)
)
assertThat(result)
- .isEqualTo(
- NotMatched(
- PrivateProfilePolicy.NAME,
- PrivateProfilePolicy.NO_VISIBLE_TASKS,
- )
- )
+ .isEqualTo(NotMatched(PrivateProfilePolicy.NAME, PrivateProfilePolicy.NO_VISIBLE_TASKS))
}
@Test
@@ -136,9 +131,9 @@ class PrivateProfilePolicyTest {
val result =
policy.check(
splitScreenApps(
- top = TaskSpec(taskId = 1002, name = FILES, userId = PERSONAL),
- bottom = TaskSpec(taskId = 1003, name = YOUTUBE, userId = PRIVATE),
- focusedTaskId = 1003
+ first = TaskSpec(taskId = 1002, name = FILES, userId = PERSONAL),
+ second = TaskSpec(taskId = 1003, name = YOUTUBE, userId = PRIVATE),
+ focusedTaskId = 1003,
)
)
@@ -150,8 +145,8 @@ class PrivateProfilePolicyTest {
CaptureParameters(
type = FullScreen(displayId = 0),
component = ComponentName.unflattenFromString(YOUTUBE),
- owner = UserHandle.of(PRIVATE)
- )
+ owner = UserHandle.of(PRIVATE),
+ ),
)
)
}
@@ -161,9 +156,9 @@ class PrivateProfilePolicyTest {
val result =
policy.check(
splitScreenApps(
- top = TaskSpec(taskId = 1002, name = FILES, userId = PERSONAL),
- bottom = TaskSpec(taskId = 1003, name = YOUTUBE, userId = PRIVATE),
- focusedTaskId = 1002
+ first = TaskSpec(taskId = 1002, name = FILES, userId = PERSONAL),
+ second = TaskSpec(taskId = 1003, name = YOUTUBE, userId = PRIVATE),
+ focusedTaskId = 1002,
)
)
@@ -175,8 +170,8 @@ class PrivateProfilePolicyTest {
CaptureParameters(
type = FullScreen(displayId = 0),
component = ComponentName.unflattenFromString(FILES),
- owner = UserHandle.of(PRIVATE)
- )
+ owner = UserHandle.of(PRIVATE),
+ ),
)
)
}
@@ -196,8 +191,8 @@ class PrivateProfilePolicyTest {
CaptureParameters(
type = FullScreen(displayId = 0),
component = ComponentName.unflattenFromString(YOUTUBE_PIP),
- owner = UserHandle.of(PRIVATE)
- )
+ owner = UserHandle.of(PRIVATE),
+ ),
)
)
}
@@ -220,8 +215,8 @@ class PrivateProfilePolicyTest {
CaptureParameters(
type = FullScreen(displayId = 0),
component = ComponentName.unflattenFromString(YOUTUBE_PIP),
- owner = UserHandle.of(PRIVATE)
- )
+ owner = UserHandle.of(PRIVATE),
+ ),
)
)
}
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/screenshot/policy/ScreenshotPolicyTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/screenshot/policy/ScreenshotPolicyTest.kt
new file mode 100644
index 000000000000..28eb9fc1364b
--- /dev/null
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/screenshot/policy/ScreenshotPolicyTest.kt
@@ -0,0 +1,351 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.systemui.screenshot.policy
+
+import android.content.ComponentName
+import android.os.UserHandle
+import androidx.test.ext.junit.runners.AndroidJUnit4
+import com.android.systemui.kosmos.Kosmos
+import com.android.systemui.screenshot.data.model.DisplayContentScenarios.ActivityNames.FILES
+import com.android.systemui.screenshot.data.model.DisplayContentScenarios.ActivityNames.LAUNCHER
+import com.android.systemui.screenshot.data.model.DisplayContentScenarios.ActivityNames.MESSAGES
+import com.android.systemui.screenshot.data.model.DisplayContentScenarios.ActivityNames.YOUTUBE
+import com.android.systemui.screenshot.data.model.DisplayContentScenarios.Bounds.FREEFORM_FULL_SCREEN
+import com.android.systemui.screenshot.data.model.DisplayContentScenarios.Bounds.FULL_SCREEN
+import com.android.systemui.screenshot.data.model.DisplayContentScenarios.Orientation.VERTICAL
+import com.android.systemui.screenshot.data.model.DisplayContentScenarios.TaskSpec
+import com.android.systemui.screenshot.data.model.DisplayContentScenarios.freeFormApps
+import com.android.systemui.screenshot.data.model.DisplayContentScenarios.pictureInPictureApp
+import com.android.systemui.screenshot.data.model.DisplayContentScenarios.singleFullScreen
+import com.android.systemui.screenshot.data.model.DisplayContentScenarios.splitScreenApps
+import com.android.systemui.screenshot.data.repository.profileTypeRepository
+import com.android.systemui.screenshot.policy.CaptureType.FullScreen
+import com.android.systemui.screenshot.policy.CaptureType.IsolatedTask
+import com.android.systemui.screenshot.policy.CaptureType.RootTask
+import com.android.systemui.screenshot.policy.TestUserIds.PERSONAL
+import com.android.systemui.screenshot.policy.TestUserIds.PRIVATE
+import com.android.systemui.screenshot.policy.TestUserIds.WORK
+import com.google.common.truth.Truth.assertThat
+import kotlinx.coroutines.test.runTest
+import org.junit.Test
+import org.junit.runner.RunWith
+
+@RunWith(AndroidJUnit4::class)
+class ScreenshotPolicyTest {
+ private val kosmos = Kosmos()
+
+ private val defaultComponent = ComponentName("default", "default")
+ private val defaultOwner = UserHandle.SYSTEM
+
+ @Test
+ fun fullScreen_work() = runTest {
+ val policy = ScreenshotPolicy(kosmos.profileTypeRepository)
+
+ val result =
+ policy.apply(
+ singleFullScreen(TaskSpec(taskId = 1002, name = FILES, userId = WORK)),
+ defaultComponent,
+ defaultOwner,
+ )
+
+ assertThat(result)
+ .isEqualTo(
+ CaptureParameters(
+ type = IsolatedTask(taskId = 1002, taskBounds = FULL_SCREEN),
+ component = ComponentName.unflattenFromString(FILES),
+ owner = UserHandle.of(WORK),
+ )
+ )
+ }
+
+ @Test
+ fun fullScreen_private() = runTest {
+ val policy = ScreenshotPolicy(kosmos.profileTypeRepository)
+
+ val result =
+ policy.apply(
+ singleFullScreen(TaskSpec(taskId = 1002, name = YOUTUBE, userId = PRIVATE)),
+ defaultComponent,
+ defaultOwner,
+ )
+
+ assertThat(result)
+ .isEqualTo(
+ CaptureParameters(
+ type = FullScreen(displayId = 0),
+ component = ComponentName.unflattenFromString(YOUTUBE),
+ owner = UserHandle.of(PRIVATE),
+ )
+ )
+ }
+
+ @Test
+ fun splitScreen_workAndPersonal() = runTest {
+ val policy = ScreenshotPolicy(kosmos.profileTypeRepository)
+
+ val result =
+ policy.apply(
+ splitScreenApps(
+ first = TaskSpec(taskId = 1002, name = FILES, userId = WORK),
+ second = TaskSpec(taskId = 1003, name = YOUTUBE, userId = PERSONAL),
+ focusedTaskId = 1002,
+ ),
+ defaultComponent,
+ defaultOwner,
+ )
+
+ assertThat(result)
+ .isEqualTo(
+ CaptureParameters(
+ type = FullScreen(displayId = 0),
+ component = ComponentName.unflattenFromString(YOUTUBE),
+ owner = UserHandle.of(PERSONAL),
+ )
+ )
+ }
+
+ @Test
+ fun splitScreen_personalAndPrivate() = runTest {
+ val policy = ScreenshotPolicy(kosmos.profileTypeRepository)
+
+ val result =
+ policy.apply(
+ splitScreenApps(
+ first = TaskSpec(taskId = 1002, name = FILES, userId = PERSONAL),
+ second = TaskSpec(taskId = 1003, name = YOUTUBE, userId = PRIVATE),
+ focusedTaskId = 1002,
+ ),
+ defaultComponent,
+ defaultOwner,
+ )
+
+ assertThat(result)
+ .isEqualTo(
+ CaptureParameters(
+ type = FullScreen(displayId = 0),
+ component = ComponentName.unflattenFromString(YOUTUBE),
+ owner = UserHandle.of(PRIVATE),
+ )
+ )
+ }
+
+ @Test
+ fun splitScreen_workAndPrivate() = runTest {
+ val policy = ScreenshotPolicy(kosmos.profileTypeRepository)
+
+ val result =
+ policy.apply(
+ splitScreenApps(
+ first = TaskSpec(taskId = 1002, name = FILES, userId = WORK),
+ second = TaskSpec(taskId = 1003, name = YOUTUBE, userId = PRIVATE),
+ focusedTaskId = 1002,
+ ),
+ defaultComponent,
+ defaultOwner,
+ )
+
+ assertThat(result)
+ .isEqualTo(
+ CaptureParameters(
+ type = FullScreen(displayId = 0),
+ component = ComponentName.unflattenFromString(YOUTUBE),
+ owner = UserHandle.of(PRIVATE),
+ )
+ )
+ }
+
+ @Test
+ fun splitScreen_twoWorkTasks() = runTest {
+ val policy = ScreenshotPolicy(kosmos.profileTypeRepository)
+
+ val result =
+ policy.apply(
+ splitScreenApps(
+ parentTaskId = 1,
+ parentBounds = FREEFORM_FULL_SCREEN,
+ orientation = VERTICAL,
+ first = TaskSpec(taskId = 1002, name = FILES, userId = WORK),
+ second = TaskSpec(taskId = 1003, name = YOUTUBE, userId = WORK),
+ focusedTaskId = 1002,
+ ),
+ defaultComponent,
+ defaultOwner,
+ )
+
+ assertThat(result)
+ .isEqualTo(
+ CaptureParameters(
+ type =
+ RootTask(
+ parentTaskId = 1,
+ taskBounds = FREEFORM_FULL_SCREEN,
+ childTaskIds = listOf(1002, 1003),
+ ),
+ component = ComponentName.unflattenFromString(FILES),
+ owner = UserHandle.of(WORK),
+ )
+ )
+ }
+
+ @Test
+ fun freeform_floatingWindows() = runTest {
+ val policy = ScreenshotPolicy(kosmos.profileTypeRepository)
+
+ val result =
+ policy.apply(
+ freeFormApps(
+ TaskSpec(taskId = 1002, name = FILES, userId = WORK),
+ TaskSpec(taskId = 1003, name = YOUTUBE, userId = PERSONAL),
+ focusedTaskId = 1003,
+ ),
+ defaultComponent,
+ defaultOwner,
+ )
+
+ assertThat(result)
+ .isEqualTo(
+ CaptureParameters(
+ type = FullScreen(displayId = 0),
+ component = ComponentName.unflattenFromString(YOUTUBE),
+ owner = UserHandle.of(PERSONAL),
+ )
+ )
+ }
+
+ @Test
+ fun freeform_floatingWindows_maximized() = runTest {
+ val policy = ScreenshotPolicy(kosmos.profileTypeRepository)
+
+ val result =
+ policy.apply(
+ freeFormApps(
+ TaskSpec(taskId = 1002, name = FILES, userId = WORK),
+ TaskSpec(taskId = 1003, name = YOUTUBE, userId = PERSONAL),
+ focusedTaskId = 1003,
+ ),
+ defaultComponent,
+ defaultOwner,
+ )
+
+ assertThat(result)
+ .isEqualTo(
+ CaptureParameters(
+ type = FullScreen(displayId = 0),
+ component = ComponentName.unflattenFromString(YOUTUBE),
+ owner = UserHandle.of(PERSONAL),
+ )
+ )
+ }
+
+ @Test
+ fun freeform_floatingWindows_withPrivate() = runTest {
+ val policy = ScreenshotPolicy(kosmos.profileTypeRepository)
+
+ val result =
+ policy.apply(
+ freeFormApps(
+ TaskSpec(taskId = 1002, name = FILES, userId = WORK),
+ TaskSpec(taskId = 1003, name = YOUTUBE, userId = PRIVATE),
+ TaskSpec(taskId = 1004, name = MESSAGES, userId = PERSONAL),
+ focusedTaskId = 1004,
+ ),
+ defaultComponent,
+ defaultOwner,
+ )
+
+ assertThat(result)
+ .isEqualTo(
+ CaptureParameters(
+ type = FullScreen(displayId = 0),
+ component = ComponentName.unflattenFromString(YOUTUBE),
+ owner = UserHandle.of(PRIVATE),
+ )
+ )
+ }
+
+ @Test
+ fun freeform_floating_workOnly() = runTest {
+ val policy = ScreenshotPolicy(kosmos.profileTypeRepository)
+
+ val result =
+ policy.apply(
+ freeFormApps(
+ TaskSpec(taskId = 1002, name = FILES, userId = WORK),
+ focusedTaskId = 1002,
+ ),
+ defaultComponent,
+ defaultOwner,
+ )
+
+ assertThat(result)
+ .isEqualTo(
+ CaptureParameters(
+ type = FullScreen(displayId = 0),
+ component = ComponentName.unflattenFromString(LAUNCHER),
+ owner = defaultOwner,
+ )
+ )
+ }
+
+ @Test
+ fun fullScreen_shadeExpanded() = runTest {
+ val policy = ScreenshotPolicy(kosmos.profileTypeRepository)
+
+ val result =
+ policy.apply(
+ singleFullScreen(
+ TaskSpec(taskId = 1002, name = FILES, userId = WORK),
+ shadeExpanded = true,
+ ),
+ defaultComponent,
+ defaultOwner,
+ )
+
+ assertThat(result)
+ .isEqualTo(
+ CaptureParameters(
+ type = FullScreen(displayId = 0),
+ component = defaultComponent,
+ owner = defaultOwner,
+ )
+ )
+ }
+
+ @Test
+ fun fullScreen_with_PictureInPicture() = runTest {
+ val policy = ScreenshotPolicy(kosmos.profileTypeRepository)
+
+ val result =
+ policy.apply(
+ pictureInPictureApp(
+ pip = TaskSpec(taskId = 1002, name = YOUTUBE, userId = PERSONAL),
+ fullScreen = TaskSpec(taskId = 1003, name = FILES, userId = WORK),
+ ),
+ defaultComponent,
+ defaultOwner,
+ )
+
+ assertThat(result)
+ .isEqualTo(
+ CaptureParameters(
+ type = IsolatedTask(taskId = 1003, taskBounds = FULL_SCREEN),
+ component = ComponentName.unflattenFromString(FILES),
+ owner = UserHandle.of(WORK),
+ )
+ )
+ }
+}
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/screenshot/policy/WorkProfilePolicyTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/screenshot/policy/WorkProfilePolicyTest.kt
index be9fcc2be3a3..30a786c291cb 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/screenshot/policy/WorkProfilePolicyTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/screenshot/policy/WorkProfilePolicyTest.kt
@@ -31,13 +31,13 @@ import com.android.systemui.screenshot.data.model.DisplayContentScenarios.Activi
import com.android.systemui.screenshot.data.model.DisplayContentScenarios.ActivityNames.YOUTUBE
import com.android.systemui.screenshot.data.model.DisplayContentScenarios.Bounds.FREE_FORM
import com.android.systemui.screenshot.data.model.DisplayContentScenarios.Bounds.FULL_SCREEN
-import com.android.systemui.screenshot.data.model.DisplayContentScenarios.Bounds.SPLIT_TOP
import com.android.systemui.screenshot.data.model.DisplayContentScenarios.RootTasks
import com.android.systemui.screenshot.data.model.DisplayContentScenarios.TaskSpec
import com.android.systemui.screenshot.data.model.DisplayContentScenarios.freeFormApps
import com.android.systemui.screenshot.data.model.DisplayContentScenarios.pictureInPictureApp
import com.android.systemui.screenshot.data.model.DisplayContentScenarios.singleFullScreen
import com.android.systemui.screenshot.data.model.DisplayContentScenarios.splitScreenApps
+import com.android.systemui.screenshot.data.model.DisplayContentScenarios.splitTop
import com.android.systemui.screenshot.data.model.SystemUiState
import com.android.systemui.screenshot.data.repository.profileTypeRepository
import com.android.systemui.screenshot.policy.CapturePolicy.PolicyResult
@@ -69,6 +69,7 @@ class WorkProfilePolicyTest {
@JvmField @Rule(order = 2) val mockitoRule: MockitoRule = MockitoJUnit.rule()
@Mock lateinit var mContext: Context
+
@Mock lateinit var mResources: Resources
private val kosmos = Kosmos()
@@ -94,17 +95,11 @@ class WorkProfilePolicyTest {
DisplayContentModel(
displayId = 0,
systemUiState = SystemUiState(shadeExpanded = false),
- rootTasks = listOf(RootTasks.emptyWithNoChildTasks)
+ rootTasks = listOf(RootTasks.emptyWithNoChildTasks),
)
)
- assertThat(result)
- .isEqualTo(
- NotMatched(
- WorkProfilePolicy.NAME,
- WORK_TASK_NOT_TOP,
- )
- )
+ assertThat(result).isEqualTo(NotMatched(WorkProfilePolicy.NAME, WORK_TASK_NOT_TOP))
}
@Test
@@ -114,13 +109,7 @@ class WorkProfilePolicyTest {
singleFullScreen(TaskSpec(taskId = 1002, name = YOUTUBE, userId = PERSONAL))
)
- assertThat(result)
- .isEqualTo(
- NotMatched(
- WorkProfilePolicy.NAME,
- WORK_TASK_NOT_TOP,
- )
- )
+ assertThat(result).isEqualTo(NotMatched(WorkProfilePolicy.NAME, WORK_TASK_NOT_TOP))
}
@Test
@@ -129,17 +118,11 @@ class WorkProfilePolicyTest {
policy.check(
singleFullScreen(
TaskSpec(taskId = 1002, name = FILES, userId = WORK),
- shadeExpanded = true
+ shadeExpanded = true,
)
)
- assertThat(result)
- .isEqualTo(
- NotMatched(
- WorkProfilePolicy.NAME,
- SHADE_EXPANDED,
- )
- )
+ assertThat(result).isEqualTo(NotMatched(WorkProfilePolicy.NAME, SHADE_EXPANDED))
}
@Test
@@ -156,7 +139,7 @@ class WorkProfilePolicyTest {
type = IsolatedTask(taskId = 1002, taskBounds = FULL_SCREEN),
component = ComponentName.unflattenFromString(FILES),
owner = UserHandle.of(WORK),
- )
+ ),
)
)
}
@@ -166,9 +149,11 @@ class WorkProfilePolicyTest {
val result =
policy.check(
splitScreenApps(
- top = TaskSpec(taskId = 1002, name = FILES, userId = WORK),
- bottom = TaskSpec(taskId = 1003, name = YOUTUBE, userId = PERSONAL),
- focusedTaskId = 1002
+ parentBounds = FULL_SCREEN,
+ taskMargin = 20,
+ first = TaskSpec(taskId = 1002, name = FILES, userId = WORK),
+ second = TaskSpec(taskId = 1003, name = YOUTUBE, userId = PERSONAL),
+ focusedTaskId = 1002,
)
)
@@ -178,10 +163,10 @@ class WorkProfilePolicyTest {
policy = WorkProfilePolicy.NAME,
reason = WORK_TASK_IS_TOP,
CaptureParameters(
- type = IsolatedTask(taskId = 1002, taskBounds = SPLIT_TOP),
+ type = IsolatedTask(taskId = 1002, taskBounds = FULL_SCREEN.splitTop(20)),
component = ComponentName.unflattenFromString(FILES),
owner = UserHandle.of(WORK),
- )
+ ),
)
)
}
@@ -191,19 +176,13 @@ class WorkProfilePolicyTest {
val result =
policy.check(
splitScreenApps(
- top = TaskSpec(taskId = 1002, name = FILES, userId = WORK),
- bottom = TaskSpec(taskId = 1003, name = YOUTUBE, userId = PERSONAL),
- focusedTaskId = 1003
+ first = TaskSpec(taskId = 1002, name = FILES, userId = WORK),
+ second = TaskSpec(taskId = 1003, name = YOUTUBE, userId = PERSONAL),
+ focusedTaskId = 1003,
)
)
- assertThat(result)
- .isEqualTo(
- NotMatched(
- WorkProfilePolicy.NAME,
- WORK_TASK_NOT_TOP,
- )
- )
+ assertThat(result).isEqualTo(NotMatched(WorkProfilePolicy.NAME, WORK_TASK_NOT_TOP))
}
@Test
@@ -225,7 +204,7 @@ class WorkProfilePolicyTest {
type = IsolatedTask(taskId = 1003, taskBounds = FULL_SCREEN),
component = ComponentName.unflattenFromString(FILES),
owner = UserHandle.of(WORK),
- )
+ ),
)
)
}
@@ -238,7 +217,7 @@ class WorkProfilePolicyTest {
freeFormApps(
TaskSpec(taskId = 1002, name = YOUTUBE, userId = PERSONAL),
TaskSpec(taskId = 1003, name = FILES, userId = WORK),
- focusedTaskId = 1003
+ focusedTaskId = 1003,
)
)
@@ -251,7 +230,7 @@ class WorkProfilePolicyTest {
type = IsolatedTask(taskId = 1003, taskBounds = FREE_FORM),
component = ComponentName.unflattenFromString(FILES),
owner = UserHandle.of(WORK),
- )
+ ),
)
)
}
@@ -264,16 +243,10 @@ class WorkProfilePolicyTest {
freeFormApps(
TaskSpec(taskId = 1002, name = YOUTUBE, userId = PERSONAL),
TaskSpec(taskId = 1003, name = FILES, userId = WORK),
- focusedTaskId = 1003
+ focusedTaskId = 1003,
)
)
- assertThat(result)
- .isEqualTo(
- NotMatched(
- WorkProfilePolicy.NAME,
- DESKTOP_MODE_ENABLED,
- )
- )
+ assertThat(result).isEqualTo(NotMatched(WorkProfilePolicy.NAME, DESKTOP_MODE_ENABLED))
}
}
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/shade/NotificationPanelViewControllerBaseTest.java b/packages/SystemUI/multivalentTests/src/com/android/systemui/shade/NotificationPanelViewControllerBaseTest.java
index 06d19d7f9822..d1d3b9b31a08 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/shade/NotificationPanelViewControllerBaseTest.java
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/shade/NotificationPanelViewControllerBaseTest.java
@@ -108,7 +108,6 @@ import com.android.systemui.keyguard.domain.interactor.KeyguardTransitionInterac
import com.android.systemui.keyguard.domain.interactor.NaturalScrollingSettingObserver;
import com.android.systemui.keyguard.ui.view.KeyguardRootView;
import com.android.systemui.keyguard.ui.viewmodel.DreamingToLockscreenTransitionViewModel;
-import com.android.systemui.keyguard.ui.viewmodel.GoneToDreamingLockscreenHostedTransitionViewModel;
import com.android.systemui.keyguard.ui.viewmodel.GoneToDreamingTransitionViewModel;
import com.android.systemui.keyguard.ui.viewmodel.KeyguardBottomAreaViewModel;
import com.android.systemui.keyguard.ui.viewmodel.KeyguardTouchHandlingViewModel;
@@ -328,8 +327,6 @@ public class NotificationPanelViewControllerBaseTest extends SysuiTestCase {
@Mock protected LockscreenToOccludedTransitionViewModel
mLockscreenToOccludedTransitionViewModel;
@Mock protected GoneToDreamingTransitionViewModel mGoneToDreamingTransitionViewModel;
- @Mock protected GoneToDreamingLockscreenHostedTransitionViewModel
- mGoneToDreamingLockscreenHostedTransitionViewModel;
@Mock protected PrimaryBouncerToGoneTransitionViewModel
mPrimaryBouncerToGoneTransitionViewModel;
@Mock protected KeyguardTransitionInteractor mKeyguardTransitionInteractor;
@@ -587,10 +584,6 @@ public class NotificationPanelViewControllerBaseTest extends SysuiTestCase {
when(mGoneToDreamingTransitionViewModel.lockscreenTranslationY(anyInt()))
.thenReturn(emptyFlow());
- // Gone->Dreaming lockscreen hosted
- when(mGoneToDreamingLockscreenHostedTransitionViewModel.getLockscreenAlpha())
- .thenReturn(emptyFlow());
-
// Lockscreen->Occluded
when(mLockscreenToOccludedTransitionViewModel.getLockscreenAlpha())
.thenReturn(emptyFlow());
@@ -752,7 +745,6 @@ public class NotificationPanelViewControllerBaseTest extends SysuiTestCase {
mOccludedToLockscreenTransitionViewModel,
mLockscreenToDreamingTransitionViewModel,
mGoneToDreamingTransitionViewModel,
- mGoneToDreamingLockscreenHostedTransitionViewModel,
mLockscreenToOccludedTransitionViewModel,
mPrimaryBouncerToGoneTransitionViewModel,
mMainDispatcher,
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/shade/NotificationShadeWindowViewControllerTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/shade/NotificationShadeWindowViewControllerTest.kt
index 9fe52991c3a0..adc336d18245 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/shade/NotificationShadeWindowViewControllerTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/shade/NotificationShadeWindowViewControllerTest.kt
@@ -42,7 +42,6 @@ import com.android.systemui.dock.DockManager
import com.android.systemui.dump.DumpManager
import com.android.systemui.flags.DisableSceneContainer
import com.android.systemui.flags.FakeFeatureFlagsClassic
-import com.android.systemui.flags.Flags.LOCKSCREEN_WALLPAPER_DREAM_ENABLED
import com.android.systemui.flags.Flags.SPLIT_SHADE_SUBPIXEL_OPTIMIZATION
import com.android.systemui.flags.andSceneContainer
import com.android.systemui.keyevent.domain.interactor.SysUIKeyEventHandler
@@ -128,8 +127,6 @@ class NotificationShadeWindowViewControllerTest(flags: FlagsParameterization) :
private lateinit var lockscreenShadeTransitionController: LockscreenShadeTransitionController
@Mock private lateinit var phoneStatusBarViewController: PhoneStatusBarViewController
@Mock private lateinit var pulsingGestureListener: PulsingGestureListener
- @Mock
- private lateinit var mLockscreenHostedDreamGestureListener: LockscreenHostedDreamGestureListener
@Mock private lateinit var notificationInsetsController: NotificationInsetsController
@Mock private lateinit var mGlanceableHubContainerController: GlanceableHubContainerController
@Mock(answer = Answers.RETURNS_DEEP_STUBS)
@@ -181,7 +178,6 @@ class NotificationShadeWindowViewControllerTest(flags: FlagsParameterization) :
featureFlagsClassic = FakeFeatureFlagsClassic()
featureFlagsClassic.set(SPLIT_SHADE_SUBPIXEL_OPTIMIZATION, true)
- featureFlagsClassic.set(LOCKSCREEN_WALLPAPER_DREAM_ENABLED, false)
mSetFlagsRule.enableFlags(Flags.FLAG_REVAMPED_BOUNCER_MESSAGES)
testScope = TestScope()
@@ -213,7 +209,6 @@ class NotificationShadeWindowViewControllerTest(flags: FlagsParameterization) :
shadeLogger,
dumpManager,
pulsingGestureListener,
- mLockscreenHostedDreamGestureListener,
keyguardTransitionInteractor,
mGlanceableHubContainerController,
notificationLaunchAnimationInteractor,
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/shade/NotificationShadeWindowViewTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/shade/NotificationShadeWindowViewTest.kt
index 9093b2bcbbf8..d61320e22e14 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/shade/NotificationShadeWindowViewTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/shade/NotificationShadeWindowViewTest.kt
@@ -111,8 +111,6 @@ class NotificationShadeWindowViewTest : SysuiTestCase() {
@Mock private lateinit var dumpManager: DumpManager
@Mock private lateinit var pulsingGestureListener: PulsingGestureListener
@Mock private lateinit var sysUiUnfoldComponent: SysUIUnfoldComponent
- @Mock
- private lateinit var mLockscreenHostedDreamGestureListener: LockscreenHostedDreamGestureListener
@Mock private lateinit var keyguardBouncerComponentFactory: KeyguardBouncerComponent.Factory
@Mock private lateinit var keyguardBouncerComponent: KeyguardBouncerComponent
@Mock
@@ -156,7 +154,6 @@ class NotificationShadeWindowViewTest : SysuiTestCase() {
val featureFlags = FakeFeatureFlags()
featureFlags.set(Flags.SPLIT_SHADE_SUBPIXEL_OPTIMIZATION, true)
- featureFlags.set(Flags.LOCKSCREEN_WALLPAPER_DREAM_ENABLED, false)
mSetFlagsRule.enableFlags(AConfigFlags.FLAG_REVAMPED_BOUNCER_MESSAGES)
testScope = TestScope()
controller =
@@ -184,7 +181,6 @@ class NotificationShadeWindowViewTest : SysuiTestCase() {
shadeLogger,
dumpManager,
pulsingGestureListener,
- mLockscreenHostedDreamGestureListener,
keyguardTransitionInteractor,
mGlanceableHubContainerController,
NotificationLaunchAnimationInteractor(NotificationLaunchAnimationRepository()),
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/KeyguardIndicationControllerBaseTest.java b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/KeyguardIndicationControllerBaseTest.java
index 59678a2f8c90..44782529e5c3 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/KeyguardIndicationControllerBaseTest.java
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/KeyguardIndicationControllerBaseTest.java
@@ -19,7 +19,6 @@ package com.android.systemui.statusbar;
import static android.app.admin.DevicePolicyManager.DEVICE_OWNER_TYPE_DEFAULT;
import static com.android.systemui.flags.Flags.KEYGUARD_TALKBACK_FIX;
-import static com.android.systemui.flags.Flags.LOCKSCREEN_WALLPAPER_DREAM_ENABLED;
import static com.android.systemui.keyguard.KeyguardIndicationRotateTextViewController.INDICATION_TYPE_TRANSIENT;
import static com.android.systemui.keyguard.ScreenLifecycle.SCREEN_ON;
@@ -273,7 +272,6 @@ public class KeyguardIndicationControllerBaseTest extends SysuiTestCase {
mFlags = new FakeFeatureFlags();
mFlags.set(KEYGUARD_TALKBACK_FIX, true);
- mFlags.set(LOCKSCREEN_WALLPAPER_DREAM_ENABLED, false);
mController = new KeyguardIndicationController(
mContext,
mTestableLooper.getLooper(),
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/core/StatusBarInitializerTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/core/StatusBarInitializerTest.kt
index c737bf7a8bec..e312d00f3dc2 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/core/StatusBarInitializerTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/core/StatusBarInitializerTest.kt
@@ -20,12 +20,15 @@ import android.app.FragmentManager
import android.app.FragmentTransaction
import android.platform.test.annotations.DisableFlags
import android.platform.test.annotations.EnableFlags
+import android.view.ViewGroup
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.systemui.Flags
import com.android.systemui.SysuiTestCase
import com.android.systemui.fragments.FragmentHostManager
import com.android.systemui.statusbar.phone.fragment.CollapsedStatusBarFragment
+import com.android.systemui.statusbar.phone.fragment.dagger.HomeStatusBarComponent
+import com.android.systemui.statusbar.pipeline.shared.ui.composable.StatusBarRootFactory
import com.android.systemui.statusbar.window.StatusBarWindowController
import com.android.systemui.statusbar.window.StatusBarWindowControllerStore
import com.google.common.truth.Truth.assertThat
@@ -35,6 +38,8 @@ import org.junit.Before
import org.junit.runner.RunWith
import org.mockito.Mockito.mock
import org.mockito.kotlin.any
+import org.mockito.kotlin.never
+import org.mockito.kotlin.verify
import org.mockito.kotlin.whenever
@SmallTest
@@ -42,27 +47,31 @@ import org.mockito.kotlin.whenever
class StatusBarInitializerTest : SysuiTestCase() {
private val windowController = mock(StatusBarWindowController::class.java)
private val windowControllerStore = mock(StatusBarWindowControllerStore::class.java)
+ private val transaction = mock(FragmentTransaction::class.java)
+ private val fragmentManager = mock(FragmentManager::class.java)
+ private val fragmentHostManager = mock(FragmentHostManager::class.java)
+ private val backgroundView = mock(ViewGroup::class.java)
@Before
fun setup() {
// TODO(b/364360986) this will go away once the fragment is deprecated. Hence, there is no
// need right now for moving this to kosmos
- val transaction = mock(FragmentTransaction::class.java)
- val fragmentManager = mock(FragmentManager::class.java)
- val fragmentHostManager = mock(FragmentHostManager::class.java)
whenever(fragmentHostManager.addTagListener(any(), any())).thenReturn(fragmentHostManager)
whenever(fragmentHostManager.fragmentManager).thenReturn(fragmentManager)
whenever(fragmentManager.beginTransaction()).thenReturn(transaction)
whenever(transaction.replace(any(), any(), any())).thenReturn(transaction)
whenever(windowControllerStore.defaultDisplay).thenReturn(windowController)
whenever(windowController.fragmentHostManager).thenReturn(fragmentHostManager)
+ whenever(windowController.backgroundView).thenReturn(backgroundView)
}
val underTest =
StatusBarInitializerImpl(
+ statusBarWindowController = windowController,
collapsedStatusBarFragmentProvider = { mock(CollapsedStatusBarFragment::class.java) },
+ statusBarRootFactory = mock(StatusBarRootFactory::class.java),
+ componentFactory = mock(HomeStatusBarComponent.Factory::class.java),
creationListeners = setOf(),
- statusBarWindowController = windowController,
)
@Test
@@ -79,6 +88,15 @@ class StatusBarInitializerTest : SysuiTestCase() {
}
@Test
+ @EnableFlags(Flags.FLAG_STATUS_BAR_SIMPLE_FRAGMENT)
+ fun simpleFragment_flagEnabled_doesNotCreateFragment() {
+ underTest.start()
+
+ verify(fragmentManager, never()).beginTransaction()
+ verify(transaction, never()).replace(any(), any(), any())
+ }
+
+ @Test
@DisableFlags(Flags.FLAG_STATUS_BAR_SIMPLE_FRAGMENT)
fun flagOff_doesNotInitializeViaCoreStartable() {
underTest.start()
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/data/repository/StatusBarModeRepositoryImplTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/data/repository/StatusBarModeRepositoryImplTest.kt
index 48ae7a2aa260..feda0c65bd7f 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/data/repository/StatusBarModeRepositoryImplTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/data/repository/StatusBarModeRepositoryImplTest.kt
@@ -36,7 +36,7 @@ import com.android.systemui.statusbar.phone.BoundsPair
import com.android.systemui.statusbar.phone.LetterboxAppearance
import com.android.systemui.statusbar.phone.LetterboxAppearanceCalculator
import com.android.systemui.statusbar.phone.StatusBarBoundsProvider
-import com.android.systemui.statusbar.phone.fragment.dagger.StatusBarFragmentComponent
+import com.android.systemui.statusbar.phone.fragment.dagger.HomeStatusBarComponent
import com.android.systemui.statusbar.phone.ongoingcall.data.repository.ongoingCallRepository
import com.android.systemui.statusbar.phone.ongoingcall.shared.model.OngoingCallModel
import com.android.systemui.statusbar.phone.ongoingcall.shared.model.inCallModel
@@ -62,8 +62,8 @@ class StatusBarModeRepositoryImplTest : SysuiTestCase() {
private val commandQueue = mock<CommandQueue>()
private val letterboxAppearanceCalculator = mock<LetterboxAppearanceCalculator>()
private val statusBarBoundsProvider = mock<StatusBarBoundsProvider>()
- private val statusBarFragmentComponent =
- mock<StatusBarFragmentComponent>().also {
+ private val homeStatusBarComponent =
+ mock<HomeStatusBarComponent>().also {
whenever(it.boundsProvider).thenReturn(statusBarBoundsProvider)
}
private val ongoingCallRepository = kosmos.ongoingCallRepository
@@ -78,7 +78,7 @@ class StatusBarModeRepositoryImplTest : SysuiTestCase() {
)
.apply {
this.start()
- this.onStatusBarViewInitialized(statusBarFragmentComponent)
+ this.onStatusBarViewInitialized(homeStatusBarComponent)
}
private val commandQueueCallback: CommandQueue.Callbacks
@@ -235,9 +235,7 @@ class StatusBarModeRepositoryImplTest : SysuiTestCase() {
testScope.runTest {
val latest by collectLastValue(underTest.isInFullscreenMode)
- onSystemBarAttributesChanged(
- requestedVisibleTypes = WindowInsets.Type.statusBars(),
- )
+ onSystemBarAttributesChanged(requestedVisibleTypes = WindowInsets.Type.statusBars())
assertThat(latest).isFalse()
}
@@ -247,9 +245,7 @@ class StatusBarModeRepositoryImplTest : SysuiTestCase() {
testScope.runTest {
val latest by collectLastValue(underTest.isInFullscreenMode)
- onSystemBarAttributesChanged(
- requestedVisibleTypes = WindowInsets.Type.navigationBars(),
- )
+ onSystemBarAttributesChanged(requestedVisibleTypes = WindowInsets.Type.navigationBars())
assertThat(latest).isTrue()
}
@@ -259,9 +255,7 @@ class StatusBarModeRepositoryImplTest : SysuiTestCase() {
testScope.runTest {
val latest by collectLastValue(underTest.isInFullscreenMode)
- onSystemBarAttributesChanged(
- requestedVisibleTypes = WindowInsets.Type.navigationBars(),
- )
+ onSystemBarAttributesChanged(requestedVisibleTypes = WindowInsets.Type.navigationBars())
assertThat(latest).isTrue()
onSystemBarAttributesChanged(
@@ -347,7 +341,7 @@ class StatusBarModeRepositoryImplTest : SysuiTestCase() {
val startingLetterboxAppearance =
LetterboxAppearance(
APPEARANCE_LIGHT_STATUS_BARS,
- listOf(AppearanceRegion(APPEARANCE_LIGHT_STATUS_BARS, Rect(0, 0, 1, 1)))
+ listOf(AppearanceRegion(APPEARANCE_LIGHT_STATUS_BARS, Rect(0, 0, 1, 1))),
)
whenever(
letterboxAppearanceCalculator.getLetterboxAppearance(
@@ -371,7 +365,7 @@ class StatusBarModeRepositoryImplTest : SysuiTestCase() {
val newLetterboxAppearance =
LetterboxAppearance(
APPEARANCE_LOW_PROFILE_BARS,
- listOf(AppearanceRegion(APPEARANCE_LOW_PROFILE_BARS, Rect(10, 20, 30, 40)))
+ listOf(AppearanceRegion(APPEARANCE_LOW_PROFILE_BARS, Rect(10, 20, 30, 40))),
)
whenever(
letterboxAppearanceCalculator.getLetterboxAppearance(
@@ -398,9 +392,7 @@ class StatusBarModeRepositoryImplTest : SysuiTestCase() {
val latest by collectLastValue(underTest.statusBarAppearance)
ongoingCallRepository.setOngoingCallState(inCallModel(startTimeMs = 34))
- onSystemBarAttributesChanged(
- requestedVisibleTypes = WindowInsets.Type.navigationBars(),
- )
+ onSystemBarAttributesChanged(requestedVisibleTypes = WindowInsets.Type.navigationBars())
assertThat(latest!!.mode).isEqualTo(StatusBarMode.SEMI_TRANSPARENT)
}
@@ -438,9 +430,7 @@ class StatusBarModeRepositoryImplTest : SysuiTestCase() {
fun statusBarMode_transientShown_semiTransparent() =
testScope.runTest {
val latest by collectLastValue(underTest.statusBarAppearance)
- onSystemBarAttributesChanged(
- appearance = APPEARANCE_OPAQUE_STATUS_BARS,
- )
+ onSystemBarAttributesChanged(appearance = APPEARANCE_OPAQUE_STATUS_BARS)
underTest.showTransient()
@@ -453,7 +443,7 @@ class StatusBarModeRepositoryImplTest : SysuiTestCase() {
val latest by collectLastValue(underTest.statusBarAppearance)
onSystemBarAttributesChanged(
- appearance = APPEARANCE_LOW_PROFILE_BARS or APPEARANCE_OPAQUE_STATUS_BARS,
+ appearance = APPEARANCE_LOW_PROFILE_BARS or APPEARANCE_OPAQUE_STATUS_BARS
)
assertThat(latest!!.mode).isEqualTo(StatusBarMode.LIGHTS_OUT)
@@ -464,9 +454,7 @@ class StatusBarModeRepositoryImplTest : SysuiTestCase() {
testScope.runTest {
val latest by collectLastValue(underTest.statusBarAppearance)
- onSystemBarAttributesChanged(
- appearance = APPEARANCE_LOW_PROFILE_BARS,
- )
+ onSystemBarAttributesChanged(appearance = APPEARANCE_LOW_PROFILE_BARS)
assertThat(latest!!.mode).isEqualTo(StatusBarMode.LIGHTS_OUT_TRANSPARENT)
}
@@ -476,9 +464,7 @@ class StatusBarModeRepositoryImplTest : SysuiTestCase() {
testScope.runTest {
val latest by collectLastValue(underTest.statusBarAppearance)
- onSystemBarAttributesChanged(
- appearance = APPEARANCE_OPAQUE_STATUS_BARS,
- )
+ onSystemBarAttributesChanged(appearance = APPEARANCE_OPAQUE_STATUS_BARS)
assertThat(latest!!.mode).isEqualTo(StatusBarMode.OPAQUE)
}
@@ -488,9 +474,7 @@ class StatusBarModeRepositoryImplTest : SysuiTestCase() {
testScope.runTest {
val latest by collectLastValue(underTest.statusBarAppearance)
- onSystemBarAttributesChanged(
- appearance = APPEARANCE_SEMI_TRANSPARENT_STATUS_BARS,
- )
+ onSystemBarAttributesChanged(appearance = APPEARANCE_SEMI_TRANSPARENT_STATUS_BARS)
assertThat(latest!!.mode).isEqualTo(StatusBarMode.SEMI_TRANSPARENT)
}
@@ -500,9 +484,7 @@ class StatusBarModeRepositoryImplTest : SysuiTestCase() {
testScope.runTest {
val latest by collectLastValue(underTest.statusBarAppearance)
- onSystemBarAttributesChanged(
- appearance = 0,
- )
+ onSystemBarAttributesChanged(appearance = 0)
assertThat(latest!!.mode).isEqualTo(StatusBarMode.TRANSPARENT)
}
@@ -540,7 +522,7 @@ class StatusBarModeRepositoryImplTest : SysuiTestCase() {
LetterboxDetails(
/* letterboxInnerBounds= */ Rect(0, 0, 10, 10),
/* letterboxFullBounds= */ Rect(0, 0, 20, 20),
- /* appAppearance= */ 0
+ /* appAppearance= */ 0,
)
)
private val REGIONS_FROM_LETTERBOX_CALCULATOR =
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/events/SystemEventChipAnimationControllerTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/events/SystemEventChipAnimationControllerTest.kt
index a629b2447921..5f3668af6e45 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/events/SystemEventChipAnimationControllerTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/events/SystemEventChipAnimationControllerTest.kt
@@ -30,7 +30,6 @@ import com.android.systemui.animation.AnimatorTestRule
import com.android.systemui.statusbar.phone.StatusBarContentInsetsChangedListener
import com.android.systemui.statusbar.phone.StatusBarContentInsetsProvider
import com.android.systemui.statusbar.window.StatusBarWindowController
-import com.android.systemui.statusbar.window.StatusBarWindowControllerStore
import com.android.systemui.util.mockito.any
import com.android.systemui.util.mockito.argumentCaptor
import com.android.systemui.util.mockito.capture
@@ -50,11 +49,10 @@ import org.mockito.MockitoAnnotations
@RunWith(AndroidJUnit4::class)
@TestableLooper.RunWithLooper
class SystemEventChipAnimationControllerTest : SysuiTestCase() {
- private lateinit var controller: SystemEventChipAnimationController
+ private lateinit var controller: SystemEventChipAnimationControllerImpl
@get:Rule val animatorTestRule = AnimatorTestRule(this)
@Mock private lateinit var sbWindowController: StatusBarWindowController
- @Mock private lateinit var sbWindowControllerStore: StatusBarWindowControllerStore
@Mock private lateinit var insetsProvider: StatusBarContentInsetsProvider
private var testView = TestView(mContext)
@@ -63,7 +61,6 @@ class SystemEventChipAnimationControllerTest : SysuiTestCase() {
@Before
fun setup() {
MockitoAnnotations.initMocks(this)
- whenever(sbWindowControllerStore.defaultDisplay).thenReturn(sbWindowController)
// StatusBarWindowController is mocked. The addViewToWindow function needs to be mocked to
// ensure that the chip view is added to a parent view
whenever(sbWindowController.addViewToWindow(any(), any())).then {
@@ -76,7 +73,7 @@ class SystemEventChipAnimationControllerTest : SysuiTestCase() {
)
statusbarFake.addView(
it.arguments[0] as View,
- it.arguments[1] as FrameLayout.LayoutParams
+ it.arguments[1] as FrameLayout.LayoutParams,
)
}
@@ -86,16 +83,16 @@ class SystemEventChipAnimationControllerTest : SysuiTestCase() {
/* left= */ insets,
/* top= */ insets,
/* right= */ insets,
- /* bottom= */ 0
+ /* bottom= */ 0,
)
)
whenever(insetsProvider.getStatusBarContentAreaForCurrentRotation())
.thenReturn(portraitArea)
controller =
- SystemEventChipAnimationController(
+ SystemEventChipAnimationControllerImpl(
context = mContext,
- statusBarWindowControllerStore = sbWindowControllerStore,
+ statusBarWindowController = sbWindowController,
contentInsetsProvider = insetsProvider,
)
}
@@ -156,10 +153,7 @@ class SystemEventChipAnimationControllerTest : SysuiTestCase() {
val lp = it.arguments[1] as FrameLayout.LayoutParams
assertThat(lp.gravity and Gravity.VERTICAL_GRAVITY_MASK).isEqualTo(Gravity.TOP)
- statusbarFake.addView(
- it.arguments[0] as View,
- lp,
- )
+ statusbarFake.addView(it.arguments[0] as View, lp)
}
// GIVEN insets provider gives the correct content area
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/collection/coordinator/DreamCoordinatorTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/collection/coordinator/DreamCoordinatorTest.kt
deleted file mode 100644
index 4d5ea92aa0e6..000000000000
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/collection/coordinator/DreamCoordinatorTest.kt
+++ /dev/null
@@ -1,166 +0,0 @@
-/*
- * Copyright (C) 2023 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-@file:OptIn(ExperimentalCoroutinesApi::class)
-
-package com.android.systemui.statusbar.notification.collection.coordinator
-
-import androidx.test.ext.junit.runners.AndroidJUnit4
-import androidx.test.filters.SmallTest
-import com.android.systemui.SysuiTestCase
-import com.android.systemui.keyguard.data.repository.FakeKeyguardRepository
-import com.android.systemui.plugins.statusbar.StatusBarStateController
-import com.android.systemui.statusbar.StatusBarState
-import com.android.systemui.statusbar.SysuiStatusBarStateController
-import com.android.systemui.statusbar.notification.collection.NotifPipeline
-import com.android.systemui.statusbar.notification.collection.NotificationEntry
-import com.android.systemui.statusbar.notification.collection.NotificationEntryBuilder
-import com.android.systemui.statusbar.notification.collection.listbuilder.pluggable.NotifFilter
-import com.android.systemui.statusbar.notification.collection.listbuilder.pluggable.Pluggable
-import com.android.systemui.util.mockito.any
-import com.android.systemui.util.mockito.eq
-import com.android.systemui.util.mockito.withArgCaptor
-import com.google.common.truth.Truth.assertThat
-import kotlinx.coroutines.ExperimentalCoroutinesApi
-import kotlinx.coroutines.test.TestScope
-import kotlinx.coroutines.test.UnconfinedTestDispatcher
-import kotlinx.coroutines.test.runCurrent
-import kotlinx.coroutines.test.runTest
-import org.junit.Before
-import org.junit.Test
-import org.junit.runner.RunWith
-import org.mockito.Mock
-import org.mockito.Mockito.clearInvocations
-import org.mockito.Mockito.never
-import org.mockito.Mockito.verify
-import org.mockito.Mockito.`when` as whenever
-import org.mockito.MockitoAnnotations
-
-@SmallTest
-@RunWith(AndroidJUnit4::class)
-class DreamCoordinatorTest : SysuiTestCase() {
- @Mock private lateinit var statusBarStateController: SysuiStatusBarStateController
- @Mock private lateinit var notifPipeline: NotifPipeline
- @Mock private lateinit var filterListener: Pluggable.PluggableListener<NotifFilter>
-
- private val keyguardRepository = FakeKeyguardRepository()
- private var fakeEntry: NotificationEntry = NotificationEntryBuilder().build()
- val testDispatcher = UnconfinedTestDispatcher()
- val testScope = TestScope(testDispatcher)
-
- private lateinit var filter: NotifFilter
- private lateinit var statusBarListener: StatusBarStateController.StateListener
- private lateinit var dreamCoordinator: DreamCoordinator
-
- @Before
- fun setUp() {
- MockitoAnnotations.initMocks(this)
- whenever(statusBarStateController.state).thenReturn(StatusBarState.KEYGUARD)
-
- // Build the coordinator
- dreamCoordinator =
- DreamCoordinator(
- statusBarStateController,
- testScope.backgroundScope,
- keyguardRepository
- )
-
- // Attach the pipeline and capture the listeners/filters that it registers
- dreamCoordinator.attach(notifPipeline)
-
- filter = withArgCaptor { verify(notifPipeline).addPreGroupFilter(capture()) }
- filter.setInvalidationListener(filterListener)
-
- statusBarListener = withArgCaptor {
- verify(statusBarStateController).addCallback(capture())
- }
- }
-
- @Test
- fun hideNotifications_whenDreamingAndOnKeyguard() =
- testScope.runTest {
- // GIVEN we are on keyguard and not dreaming
- keyguardRepository.setKeyguardShowing(true)
- keyguardRepository.setIsActiveDreamLockscreenHosted(false)
- runCurrent()
-
- // THEN notifications are not filtered out
- verifyPipelinesNotInvalidated()
- assertThat(filter.shouldFilterOut(fakeEntry, 0L)).isFalse()
-
- // WHEN dreaming starts and the active dream is hosted in lockscreen
- keyguardRepository.setIsActiveDreamLockscreenHosted(true)
- runCurrent()
-
- // THEN pipeline is notified and notifications should all be filtered out
- verifyPipelinesInvalidated()
- assertThat(filter.shouldFilterOut(fakeEntry, 0L)).isTrue()
- }
-
- @Test
- fun showNotifications_whenDreamingAndNotOnKeyguard() =
- testScope.runTest {
- // GIVEN we are on the keyguard and active dream is hosted in lockscreen
- keyguardRepository.setKeyguardShowing(true)
- keyguardRepository.setIsActiveDreamLockscreenHosted(true)
- runCurrent()
-
- // THEN pipeline is notified and notifications are all filtered out
- verifyPipelinesInvalidated()
- clearPipelineInvocations()
- assertThat(filter.shouldFilterOut(fakeEntry, 0L)).isTrue()
-
- // WHEN we are no longer on the keyguard
- statusBarListener.onStateChanged(StatusBarState.SHADE)
-
- // THEN pipeline is notified and notifications are not filtered out
- verifyPipelinesInvalidated()
- assertThat(filter.shouldFilterOut(fakeEntry, 0L)).isFalse()
- }
-
- @Test
- fun showNotifications_whenOnKeyguardAndNotDreaming() =
- testScope.runTest {
- // GIVEN we are on the keyguard and active dream is hosted in lockscreen
- keyguardRepository.setKeyguardShowing(true)
- keyguardRepository.setIsActiveDreamLockscreenHosted(true)
- runCurrent()
-
- // THEN pipeline is notified and notifications are all filtered out
- verifyPipelinesInvalidated()
- clearPipelineInvocations()
- assertThat(filter.shouldFilterOut(fakeEntry, 0L)).isTrue()
-
- // WHEN the lockscreen hosted dream stops
- keyguardRepository.setIsActiveDreamLockscreenHosted(false)
- runCurrent()
-
- // THEN pipeline is notified and notifications are not filtered out
- verifyPipelinesInvalidated()
- assertThat(filter.shouldFilterOut(fakeEntry, 0L)).isFalse()
- }
-
- private fun verifyPipelinesInvalidated() {
- verify(filterListener).onPluggableInvalidated(eq(filter), any())
- }
-
- private fun verifyPipelinesNotInvalidated() {
- verify(filterListener, never()).onPluggableInvalidated(eq(filter), any())
- }
-
- private fun clearPipelineInvocations() {
- clearInvocations(filterListener)
- }
-}
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/stack/NotificationSwipeHelperTest.java b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/stack/NotificationSwipeHelperTest.java
index 95db95cd288b..789701f5e4b0 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/stack/NotificationSwipeHelperTest.java
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/stack/NotificationSwipeHelperTest.java
@@ -13,6 +13,8 @@
package com.android.systemui.statusbar.notification.stack;
+import static com.android.systemui.Flags.FLAG_IGNORE_TOUCHES_NEXT_TO_NOTIFICATION_SHELF;
+
import static junit.framework.Assert.assertEquals;
import static junit.framework.Assert.assertFalse;
import static junit.framework.Assert.assertTrue;
@@ -36,6 +38,7 @@ import static org.mockito.Mockito.when;
import android.animation.Animator;
import android.animation.ValueAnimator.AnimatorUpdateListener;
import android.os.Handler;
+import android.platform.test.annotations.DisableFlags;
import android.platform.test.annotations.EnableFlags;
import android.service.notification.StatusBarNotification;
import android.testing.TestableLooper;
@@ -52,6 +55,7 @@ import com.android.systemui.flags.FakeFeatureFlags;
import com.android.systemui.flags.FeatureFlags;
import com.android.systemui.plugins.statusbar.NotificationMenuRowPlugin;
import com.android.systemui.plugins.statusbar.NotificationSwipeActionHelper.SnoozeOption;
+import com.android.systemui.statusbar.NotificationShelf;
import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow;
import com.android.systemui.statusbar.notification.shared.NotificationContentAlphaOptimization;
@@ -85,6 +89,7 @@ public class NotificationSwipeHelperTest extends SysuiTestCase {
private NotificationMenuRowPlugin mMenuRow;
private Handler mHandler;
private ExpandableNotificationRow mNotificationRow;
+ private NotificationShelf mShelf;
private Runnable mFalsingCheck;
private final FeatureFlags mFeatureFlags = new FakeFeatureFlags();
@@ -111,6 +116,7 @@ public class NotificationSwipeHelperTest extends SysuiTestCase {
mEvent = mock(MotionEvent.class);
mMenuRow = mock(NotificationMenuRowPlugin.class);
mNotificationRow = mock(ExpandableNotificationRow.class);
+ mShelf = mock(NotificationShelf.class);
mHandler = mock(Handler.class);
mFalsingCheck = mock(Runnable.class);
}
@@ -665,6 +671,54 @@ public class NotificationSwipeHelperTest extends SysuiTestCase {
}
@Test
+ @EnableFlags(FLAG_IGNORE_TOUCHES_NEXT_TO_NOTIFICATION_SHELF)
+ public void testIsTouchInView_notificationShelf_flagEnabled() {
+ doReturn(500).when(mShelf).getWidth();
+ doReturn(FAKE_ROW_WIDTH).when(mShelf).getActualWidth();
+ doReturn(FAKE_ROW_HEIGHT).when(mShelf).getHeight();
+ doReturn(FAKE_ROW_HEIGHT).when(mShelf).getActualHeight();
+
+ Answer answer = (Answer) invocation -> {
+ int[] arr = invocation.getArgument(0);
+ arr[0] = 0;
+ arr[1] = 0;
+ return null;
+ };
+
+ doReturn(5f).when(mEvent).getRawX();
+ doReturn(10f).when(mEvent).getRawY();
+ doAnswer(answer).when(mShelf).getLocationOnScreen(any());
+ assertTrue("Touch is within the view", mSwipeHelper.isTouchInView(mEvent, mShelf));
+
+ doReturn(50f).when(mEvent).getRawX();
+ assertFalse("Touch is not within the view", mSwipeHelper.isTouchInView(mEvent, mShelf));
+ }
+
+ @Test
+ @DisableFlags(FLAG_IGNORE_TOUCHES_NEXT_TO_NOTIFICATION_SHELF)
+ public void testIsTouchInView_notificationShelf_flagDisabled() {
+ doReturn(500).when(mShelf).getWidth();
+ doReturn(FAKE_ROW_WIDTH).when(mShelf).getActualWidth();
+ doReturn(FAKE_ROW_HEIGHT).when(mShelf).getHeight();
+ doReturn(FAKE_ROW_HEIGHT).when(mShelf).getActualHeight();
+
+ Answer answer = (Answer) invocation -> {
+ int[] arr = invocation.getArgument(0);
+ arr[0] = 0;
+ arr[1] = 0;
+ return null;
+ };
+
+ doReturn(5f).when(mEvent).getRawX();
+ doReturn(10f).when(mEvent).getRawY();
+ doAnswer(answer).when(mShelf).getLocationOnScreen(any());
+ assertTrue("Touch is within the view", mSwipeHelper.isTouchInView(mEvent, mShelf));
+
+ doReturn(50f).when(mEvent).getRawX();
+ assertTrue("Touch is within the view", mSwipeHelper.isTouchInView(mEvent, mShelf));
+ }
+
+ @Test
public void testContentAlphaRemainsUnchangedWhenNotificationIsNotDismissible() {
doReturn(FAKE_ROW_WIDTH).when(mNotificationRow).getMeasuredWidth();
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/phone/StatusBarContentInsetsProviderTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/phone/StatusBarContentInsetsProviderTest.kt
index c804fc6990ae..ba5fb7f8df00 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/phone/StatusBarContentInsetsProviderTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/phone/StatusBarContentInsetsProviderTest.kt
@@ -98,7 +98,7 @@ class StatusBarContentInsetsProviderTest : SysuiTestCase() {
isRtl,
dotWidth,
BOTTOM_ALIGNED_MARGIN_NONE,
- statusBarContentHeight
+ statusBarContentHeight,
)
var chipBounds = getPrivacyChipBoundingRectForInsets(bounds, dotWidth, chipWidth, isRtl)
@@ -135,7 +135,7 @@ class StatusBarContentInsetsProviderTest : SysuiTestCase() {
isRtl,
dotWidth,
BOTTOM_ALIGNED_MARGIN_NONE,
- statusBarContentHeight
+ statusBarContentHeight,
)
chipBounds = getPrivacyChipBoundingRectForInsets(bounds, dotWidth, chipWidth, isRtl)
@@ -164,8 +164,7 @@ class StatusBarContentInsetsProviderTest : SysuiTestCase() {
val chipWidth = 30
val dotWidth = 10
val isRtl = false
- val contentRect =
- Rect(/* left = */ 0, /* top = */ 10, /* right = */ 1000, /* bottom = */ 100)
+ val contentRect = Rect(/* left= */ 0, /* top= */ 10, /* right= */ 1000, /* bottom= */ 100)
val chipBounds =
getPrivacyChipBoundingRectForInsets(contentRect, dotWidth, chipWidth, isRtl)
@@ -207,7 +206,7 @@ class StatusBarContentInsetsProviderTest : SysuiTestCase() {
isRtl,
dotWidth,
BOTTOM_ALIGNED_MARGIN_NONE,
- statusBarContentHeight
+ statusBarContentHeight,
)
assertRects(expectedBounds, bounds, currentRotation, targetRotation)
@@ -228,7 +227,7 @@ class StatusBarContentInsetsProviderTest : SysuiTestCase() {
isRtl,
dotWidth,
BOTTOM_ALIGNED_MARGIN_NONE,
- statusBarContentHeight
+ statusBarContentHeight,
)
assertRects(expectedBounds, bounds, currentRotation, targetRotation)
@@ -251,7 +250,7 @@ class StatusBarContentInsetsProviderTest : SysuiTestCase() {
isRtl,
dotWidth,
BOTTOM_ALIGNED_MARGIN_NONE,
- statusBarContentHeight
+ statusBarContentHeight,
)
assertRects(expectedBounds, bounds, currentRotation, targetRotation)
@@ -263,7 +262,7 @@ class StatusBarContentInsetsProviderTest : SysuiTestCase() {
minLeftPadding,
0,
screenBounds.height() - dcBounds.height() - dotWidth,
- sbHeightLandscape
+ sbHeightLandscape,
)
bounds =
@@ -278,7 +277,7 @@ class StatusBarContentInsetsProviderTest : SysuiTestCase() {
isRtl,
dotWidth,
BOTTOM_ALIGNED_MARGIN_NONE,
- statusBarContentHeight
+ statusBarContentHeight,
)
assertRects(expectedBounds, bounds, currentRotation, targetRotation)
@@ -320,7 +319,7 @@ class StatusBarContentInsetsProviderTest : SysuiTestCase() {
isRtl,
dotWidth,
BOTTOM_ALIGNED_MARGIN_NONE,
- statusBarContentHeight
+ statusBarContentHeight,
)
assertRects(expectedBounds, bounds, currentRotation, targetRotation)
@@ -331,7 +330,7 @@ class StatusBarContentInsetsProviderTest : SysuiTestCase() {
protectionBounds.bottom,
0,
screenBounds.height() - minRightPadding,
- sbHeightLandscape
+ sbHeightLandscape,
)
bounds =
@@ -346,7 +345,7 @@ class StatusBarContentInsetsProviderTest : SysuiTestCase() {
isRtl,
dotWidth,
BOTTOM_ALIGNED_MARGIN_NONE,
- statusBarContentHeight
+ statusBarContentHeight,
)
assertRects(expectedBounds, bounds, currentRotation, targetRotation)
@@ -369,7 +368,7 @@ class StatusBarContentInsetsProviderTest : SysuiTestCase() {
isRtl,
dotWidth,
BOTTOM_ALIGNED_MARGIN_NONE,
- statusBarContentHeight
+ statusBarContentHeight,
)
assertRects(expectedBounds, bounds, currentRotation, targetRotation)
@@ -381,7 +380,7 @@ class StatusBarContentInsetsProviderTest : SysuiTestCase() {
minLeftPadding,
0,
screenBounds.height() - protectionBounds.bottom - dotWidth,
- sbHeightLandscape
+ sbHeightLandscape,
)
bounds =
@@ -396,7 +395,7 @@ class StatusBarContentInsetsProviderTest : SysuiTestCase() {
isRtl,
dotWidth,
BOTTOM_ALIGNED_MARGIN_NONE,
- statusBarContentHeight
+ statusBarContentHeight,
)
assertRects(expectedBounds, bounds, currentRotation, targetRotation)
@@ -415,7 +414,7 @@ class StatusBarContentInsetsProviderTest : SysuiTestCase() {
left = screenBounds.right - dcWidth,
top = 0,
right = screenBounds.right,
- bottom = dcHeight
+ bottom = dcHeight,
)
val dcBoundsLandscape = Rect(left = 0, top = 0, right = dcHeight, bottom = dcWidth)
val dcBoundsSeascape =
@@ -423,14 +422,14 @@ class StatusBarContentInsetsProviderTest : SysuiTestCase() {
left = screenBounds.right - dcHeight,
top = screenBounds.bottom - dcWidth,
right = screenBounds.right - dcHeight,
- bottom = screenBounds.bottom - dcWidth
+ bottom = screenBounds.bottom - dcWidth,
)
val dcBoundsUpsideDown =
Rect(
left = 0,
top = screenBounds.bottom - dcHeight,
right = dcWidth,
- bottom = screenBounds.bottom - dcHeight
+ bottom = screenBounds.bottom - dcHeight,
)
val minLeftPadding = 20
val minRightPadding = 20
@@ -448,7 +447,7 @@ class StatusBarContentInsetsProviderTest : SysuiTestCase() {
left = minLeftPadding,
top = 0,
right = dcBoundsPortrait.left - dotWidth,
- bottom = sbHeightPortrait
+ bottom = sbHeightPortrait,
)
var bounds =
@@ -463,7 +462,7 @@ class StatusBarContentInsetsProviderTest : SysuiTestCase() {
isRtl,
dotWidth,
BOTTOM_ALIGNED_MARGIN_NONE,
- statusBarContentHeight
+ statusBarContentHeight,
)
assertRects(expectedBounds, bounds, currentRotation, targetRotation)
@@ -475,7 +474,7 @@ class StatusBarContentInsetsProviderTest : SysuiTestCase() {
left = dcBoundsLandscape.height(),
top = 0,
right = screenBounds.height() - minRightPadding,
- bottom = sbHeightLandscape
+ bottom = sbHeightLandscape,
)
bounds =
@@ -490,7 +489,7 @@ class StatusBarContentInsetsProviderTest : SysuiTestCase() {
isRtl,
dotWidth,
BOTTOM_ALIGNED_MARGIN_NONE,
- statusBarContentHeight
+ statusBarContentHeight,
)
assertRects(expectedBounds, bounds, currentRotation, targetRotation)
@@ -502,7 +501,7 @@ class StatusBarContentInsetsProviderTest : SysuiTestCase() {
left = minLeftPadding,
top = 0,
right = screenBounds.width() - minRightPadding,
- bottom = sbHeightPortrait
+ bottom = sbHeightPortrait,
)
bounds =
@@ -517,7 +516,7 @@ class StatusBarContentInsetsProviderTest : SysuiTestCase() {
isRtl,
dotWidth,
BOTTOM_ALIGNED_MARGIN_NONE,
- statusBarContentHeight
+ statusBarContentHeight,
)
assertRects(expectedBounds, bounds, currentRotation, targetRotation)
@@ -529,7 +528,7 @@ class StatusBarContentInsetsProviderTest : SysuiTestCase() {
left = minLeftPadding,
top = 0,
right = screenBounds.height() - minRightPadding,
- bottom = sbHeightLandscape
+ bottom = sbHeightLandscape,
)
bounds =
@@ -544,7 +543,7 @@ class StatusBarContentInsetsProviderTest : SysuiTestCase() {
isRtl,
dotWidth,
BOTTOM_ALIGNED_MARGIN_NONE,
- statusBarContentHeight
+ statusBarContentHeight,
)
assertRects(expectedBounds, bounds, currentRotation, targetRotation)
@@ -584,7 +583,7 @@ class StatusBarContentInsetsProviderTest : SysuiTestCase() {
isRtl,
dotWidth,
BOTTOM_ALIGNED_MARGIN_NONE,
- statusBarContentHeight
+ statusBarContentHeight,
)
assertRects(expectedBounds, bounds, currentRotation, targetRotation)
@@ -595,7 +594,7 @@ class StatusBarContentInsetsProviderTest : SysuiTestCase() {
protectionBounds.bottom,
0,
screenBounds.height() - minRightPadding,
- sbHeightLandscape
+ sbHeightLandscape,
)
bounds =
@@ -610,7 +609,7 @@ class StatusBarContentInsetsProviderTest : SysuiTestCase() {
isRtl,
dotWidth,
BOTTOM_ALIGNED_MARGIN_NONE,
- statusBarContentHeight
+ statusBarContentHeight,
)
assertRects(expectedBounds, bounds, currentRotation, targetRotation)
@@ -633,7 +632,7 @@ class StatusBarContentInsetsProviderTest : SysuiTestCase() {
isRtl,
dotWidth,
BOTTOM_ALIGNED_MARGIN_NONE,
- statusBarContentHeight
+ statusBarContentHeight,
)
assertRects(expectedBounds, bounds, currentRotation, targetRotation)
@@ -645,7 +644,7 @@ class StatusBarContentInsetsProviderTest : SysuiTestCase() {
minLeftPadding,
0,
screenBounds.height() - protectionBounds.bottom - dotWidth,
- sbHeightLandscape
+ sbHeightLandscape,
)
bounds =
@@ -660,7 +659,7 @@ class StatusBarContentInsetsProviderTest : SysuiTestCase() {
isRtl,
dotWidth,
BOTTOM_ALIGNED_MARGIN_NONE,
- statusBarContentHeight
+ statusBarContentHeight,
)
assertRects(expectedBounds, bounds, currentRotation, targetRotation)
@@ -682,7 +681,7 @@ class StatusBarContentInsetsProviderTest : SysuiTestCase() {
isRtl = false,
dotWidth = 10,
bottomAlignedMargin = BOTTOM_ALIGNED_MARGIN_NONE,
- statusBarContentHeight = 15
+ statusBarContentHeight = 15,
)
assertThat(bounds.top).isEqualTo(0)
@@ -704,7 +703,7 @@ class StatusBarContentInsetsProviderTest : SysuiTestCase() {
isRtl = false,
dotWidth = 10,
bottomAlignedMargin = 5,
- statusBarContentHeight = 15
+ statusBarContentHeight = 15,
)
// Content in the status bar is centered vertically. To achieve the bottom margin we want,
@@ -756,7 +755,7 @@ class StatusBarContentInsetsProviderTest : SysuiTestCase() {
isRtl,
dotWidth,
BOTTOM_ALIGNED_MARGIN_NONE,
- statusBarContentHeight
+ statusBarContentHeight,
)
assertRects(expectedBounds, bounds, currentRotation, targetRotation)
@@ -777,7 +776,7 @@ class StatusBarContentInsetsProviderTest : SysuiTestCase() {
isRtl,
dotWidth,
BOTTOM_ALIGNED_MARGIN_NONE,
- statusBarContentHeight
+ statusBarContentHeight,
)
assertRects(expectedBounds, bounds, currentRotation, targetRotation)
@@ -798,7 +797,7 @@ class StatusBarContentInsetsProviderTest : SysuiTestCase() {
isRtl,
dotWidth,
BOTTOM_ALIGNED_MARGIN_NONE,
- statusBarContentHeight
+ statusBarContentHeight,
)
assertRects(expectedBounds, bounds, currentRotation, targetRotation)
@@ -809,7 +808,7 @@ class StatusBarContentInsetsProviderTest : SysuiTestCase() {
minLeftPadding,
0,
screenBounds.height() - dcBounds.height() - dotWidth,
- sbHeightLandscape
+ sbHeightLandscape,
)
bounds =
@@ -824,7 +823,7 @@ class StatusBarContentInsetsProviderTest : SysuiTestCase() {
isRtl,
dotWidth,
BOTTOM_ALIGNED_MARGIN_NONE,
- statusBarContentHeight
+ statusBarContentHeight,
)
assertRects(expectedBounds, bounds, currentRotation, targetRotation)
@@ -860,7 +859,7 @@ class StatusBarContentInsetsProviderTest : SysuiTestCase() {
isRtl,
dotWidth,
BOTTOM_ALIGNED_MARGIN_NONE,
- statusBarContentHeight
+ statusBarContentHeight,
)
assertRects(expectedBounds, bounds, currentRotation, targetRotation)
@@ -880,7 +879,7 @@ class StatusBarContentInsetsProviderTest : SysuiTestCase() {
isRtl,
dotWidth,
BOTTOM_ALIGNED_MARGIN_NONE,
- statusBarContentHeight
+ statusBarContentHeight,
)
assertRects(expectedBounds, bounds, currentRotation, targetRotation)
@@ -900,7 +899,7 @@ class StatusBarContentInsetsProviderTest : SysuiTestCase() {
isRtl,
dotWidth,
BOTTOM_ALIGNED_MARGIN_NONE,
- statusBarContentHeight
+ statusBarContentHeight,
)
assertRects(expectedBounds, bounds, currentRotation, targetRotation)
@@ -920,7 +919,7 @@ class StatusBarContentInsetsProviderTest : SysuiTestCase() {
isRtl,
dotWidth,
BOTTOM_ALIGNED_MARGIN_NONE,
- statusBarContentHeight
+ statusBarContentHeight,
)
assertRects(expectedBounds, bounds, currentRotation, targetRotation)
}
@@ -958,7 +957,7 @@ class StatusBarContentInsetsProviderTest : SysuiTestCase() {
isRtl,
dotWidth,
BOTTOM_ALIGNED_MARGIN_NONE,
- statusBarContentHeight
+ statusBarContentHeight,
)
assertRects(expectedBounds, bounds, currentRotation, targetRotation)
@@ -968,12 +967,12 @@ class StatusBarContentInsetsProviderTest : SysuiTestCase() {
fun testDisplayChanged_returnsUpdatedInsets() {
// GIVEN: get insets on the first display and switch to the second display
val provider =
- StatusBarContentInsetsProvider(
+ StatusBarContentInsetsProviderImpl(
contextMock,
configurationController,
mock<DumpManager>(),
mock<CommandRegistry>(),
- mock<SysUICutoutProvider>()
+ mock<SysUICutoutProvider>(),
)
configuration.windowConfiguration.setMaxBounds(Rect(0, 0, 1080, 2160))
@@ -993,12 +992,12 @@ class StatusBarContentInsetsProviderTest : SysuiTestCase() {
// GIVEN: get insets on the first display, switch to the second display,
// get insets and switch back
val provider =
- StatusBarContentInsetsProvider(
+ StatusBarContentInsetsProviderImpl(
contextMock,
configurationController,
mock<DumpManager>(),
mock<CommandRegistry>(),
- mock<SysUICutoutProvider>()
+ mock<SysUICutoutProvider>(),
)
configuration.windowConfiguration.setMaxBounds(Rect(0, 0, 1080, 2160))
@@ -1024,12 +1023,12 @@ class StatusBarContentInsetsProviderTest : SysuiTestCase() {
configuration.windowConfiguration.setMaxBounds(0, 0, 100, 100)
configurationController.onConfigurationChanged(configuration)
val provider =
- StatusBarContentInsetsProvider(
+ StatusBarContentInsetsProviderImpl(
contextMock,
configurationController,
mock<DumpManager>(),
mock<CommandRegistry>(),
- mock<SysUICutoutProvider>()
+ mock<SysUICutoutProvider>(),
)
val listener =
object : StatusBarContentInsetsChangedListener {
@@ -1053,12 +1052,12 @@ class StatusBarContentInsetsProviderTest : SysuiTestCase() {
fun onDensityOrFontScaleChanged_listenerNotified() {
configuration.densityDpi = 12
val provider =
- StatusBarContentInsetsProvider(
+ StatusBarContentInsetsProviderImpl(
contextMock,
configurationController,
mock<DumpManager>(),
mock<CommandRegistry>(),
- mock<SysUICutoutProvider>()
+ mock<SysUICutoutProvider>(),
)
val listener =
object : StatusBarContentInsetsChangedListener {
@@ -1081,12 +1080,12 @@ class StatusBarContentInsetsProviderTest : SysuiTestCase() {
@Test
fun onThemeChanged_listenerNotified() {
val provider =
- StatusBarContentInsetsProvider(
+ StatusBarContentInsetsProviderImpl(
contextMock,
configurationController,
mock<DumpManager>(),
mock<CommandRegistry>(),
- mock<SysUICutoutProvider>()
+ mock<SysUICutoutProvider>(),
)
val listener =
object : StatusBarContentInsetsChangedListener {
@@ -1108,13 +1107,13 @@ class StatusBarContentInsetsProviderTest : SysuiTestCase() {
expected: Rect,
actual: Rect,
@Rotation currentRotation: Int,
- @Rotation targetRotation: Int
+ @Rotation targetRotation: Int,
) {
assertTrue(
"Rects must match. currentRotation=${RotationUtils.toString(currentRotation)}" +
" targetRotation=${RotationUtils.toString(targetRotation)}" +
" expected=$expected actual=$actual",
- expected.equals(actual)
+ expected.equals(actual),
)
}
@@ -1126,7 +1125,7 @@ class StatusBarContentInsetsProviderTest : SysuiTestCase() {
left: Rect = Rect(),
top: Rect = Rect(),
right: Rect = Rect(),
- bottom: Rect = Rect()
+ bottom: Rect = Rect(),
) {
whenever(dc.boundingRects)
.thenReturn(listOf(left, top, right, bottom).filter { !it.isEmpty })
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/pipeline/shared/ui/viewmodel/FakeCollapsedStatusBarViewBinder.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/pipeline/shared/ui/viewmodel/FakeHomeStatusBarViewBinder.kt
index 2ee928fa6d17..cdc7aa2dea2a 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/pipeline/shared/ui/viewmodel/FakeCollapsedStatusBarViewBinder.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/pipeline/shared/ui/viewmodel/FakeHomeStatusBarViewBinder.kt
@@ -17,21 +17,21 @@
package com.android.systemui.statusbar.pipeline.shared.ui.viewmodel
import android.view.View
-import com.android.systemui.statusbar.pipeline.shared.ui.binder.CollapsedStatusBarViewBinder
+import com.android.systemui.statusbar.pipeline.shared.ui.binder.HomeStatusBarViewBinder
import com.android.systemui.statusbar.pipeline.shared.ui.binder.StatusBarVisibilityChangeListener
/**
* A fake view binder that can be used from Java tests.
*
* Since Java tests can't run tests within test scopes, we need to bypass the flows from
- * [CollapsedStatusBarViewModel] and just trigger the listener directly.
+ * [HomeStatusBarViewModel] and just trigger the listener directly.
*/
-class FakeCollapsedStatusBarViewBinder : CollapsedStatusBarViewBinder {
+class FakeHomeStatusBarViewBinder : HomeStatusBarViewBinder {
var listener: StatusBarVisibilityChangeListener? = null
override fun bind(
view: View,
- viewModel: CollapsedStatusBarViewModel,
+ viewModel: HomeStatusBarViewModel,
listener: StatusBarVisibilityChangeListener,
) {
this.listener = listener
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/pipeline/shared/ui/viewmodel/FakeCollapsedStatusBarViewModel.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/pipeline/shared/ui/viewmodel/FakeHomeStatusBarViewModel.kt
index cc90c1167ef1..02c1540d3d8b 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/pipeline/shared/ui/viewmodel/FakeCollapsedStatusBarViewModel.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/pipeline/shared/ui/viewmodel/FakeHomeStatusBarViewModel.kt
@@ -23,7 +23,7 @@ import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.MutableSharedFlow
import kotlinx.coroutines.flow.MutableStateFlow
-class FakeCollapsedStatusBarViewModel : CollapsedStatusBarViewModel {
+class FakeHomeStatusBarViewModel : HomeStatusBarViewModel {
private val areNotificationLightsOut = MutableStateFlow(false)
override val isTransitioningFromLockscreenToOccluded = MutableStateFlow(false)
@@ -39,7 +39,7 @@ class FakeCollapsedStatusBarViewModel : CollapsedStatusBarViewModel {
override val isClockVisible =
MutableStateFlow(
- CollapsedStatusBarViewModel.VisibilityModel(
+ HomeStatusBarViewModel.VisibilityModel(
visibility = View.GONE,
shouldAnimateChange = false,
)
@@ -47,7 +47,7 @@ class FakeCollapsedStatusBarViewModel : CollapsedStatusBarViewModel {
override val isNotificationIconContainerVisible =
MutableStateFlow(
- CollapsedStatusBarViewModel.VisibilityModel(
+ HomeStatusBarViewModel.VisibilityModel(
visibility = View.GONE,
shouldAnimateChange = false,
)
@@ -55,7 +55,7 @@ class FakeCollapsedStatusBarViewModel : CollapsedStatusBarViewModel {
override val isSystemInfoVisible =
MutableStateFlow(
- CollapsedStatusBarViewModel.VisibilityModel(
+ HomeStatusBarViewModel.VisibilityModel(
visibility = View.GONE,
shouldAnimateChange = false,
)
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/pipeline/shared/ui/viewmodel/CollapsedStatusBarViewModelImplTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/pipeline/shared/ui/viewmodel/HomeStatusBarViewModelImplTest.kt
index bd857807851c..b3a73d82122f 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/pipeline/shared/ui/viewmodel/CollapsedStatusBarViewModelImplTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/pipeline/shared/ui/viewmodel/HomeStatusBarViewModelImplTest.kt
@@ -16,6 +16,7 @@
package com.android.systemui.statusbar.pipeline.shared.ui.viewmodel
+import android.app.StatusBarManager.CAMERA_LAUNCH_SOURCE_POWER_DOUBLE_TAP
import android.app.StatusBarManager.DISABLE2_NONE
import android.app.StatusBarManager.DISABLE_CLOCK
import android.app.StatusBarManager.DISABLE_NONE
@@ -33,6 +34,7 @@ import com.android.systemui.flags.DisableSceneContainer
import com.android.systemui.flags.EnableSceneContainer
import com.android.systemui.keyguard.data.repository.fakeKeyguardTransitionRepository
import com.android.systemui.keyguard.data.repository.keyguardOcclusionRepository
+import com.android.systemui.keyguard.domain.interactor.keyguardInteractor
import com.android.systemui.keyguard.shared.model.KeyguardState
import com.android.systemui.keyguard.shared.model.TransitionState
import com.android.systemui.keyguard.shared.model.TransitionStep
@@ -75,7 +77,7 @@ import org.junit.runner.RunWith
@SmallTest
@OptIn(ExperimentalCoroutinesApi::class)
@RunWith(AndroidJUnit4::class)
-class CollapsedStatusBarViewModelImplTest : SysuiTestCase() {
+class HomeStatusBarViewModelImplTest : SysuiTestCase() {
private val kosmos =
Kosmos().also {
it.testCase = this
@@ -89,13 +91,13 @@ class CollapsedStatusBarViewModelImplTest : SysuiTestCase() {
private val keyguardTransitionRepository = kosmos.fakeKeyguardTransitionRepository
private val disableFlagsRepository = kosmos.fakeDisableFlagsRepository
- private lateinit var underTest: CollapsedStatusBarViewModel
+ private lateinit var underTest: HomeStatusBarViewModel
@Before
fun setUp() {
setUpPackageManagerForMediaProjection(kosmos)
// Initialize here because some flags are checked when this class is constructed
- underTest = kosmos.collapsedStatusBarViewModel
+ underTest = kosmos.homeStatusBarViewModel
}
@Test
@@ -746,6 +748,45 @@ class CollapsedStatusBarViewModelImplTest : SysuiTestCase() {
assertThat(systemInfoVisible!!.visibility).isEqualTo(View.GONE)
}
+ @Test
+ @DisableSceneContainer
+ fun secureCameraActive_sceneFlagOff_noStatusBarViewsShown() =
+ testScope.runTest {
+ val clockVisible by collectLastValue(underTest.isClockVisible)
+ val notifIconsVisible by collectLastValue(underTest.isNotificationIconContainerVisible)
+ val systemInfoVisible by collectLastValue(underTest.isSystemInfoVisible)
+
+ // Secure camera is an occluding activity
+ keyguardTransitionRepository.sendTransitionSteps(
+ from = KeyguardState.LOCKSCREEN,
+ to = KeyguardState.OCCLUDED,
+ testScope = this,
+ )
+ kosmos.keyguardInteractor.onCameraLaunchDetected(CAMERA_LAUNCH_SOURCE_POWER_DOUBLE_TAP)
+
+ assertThat(clockVisible!!.visibility).isEqualTo(View.GONE)
+ assertThat(notifIconsVisible!!.visibility).isEqualTo(View.GONE)
+ assertThat(systemInfoVisible!!.visibility).isEqualTo(View.GONE)
+ }
+
+ @Test
+ @EnableSceneContainer
+ fun secureCameraActive_sceneFlagOn_noStatusBarViewsShown() =
+ testScope.runTest {
+ val clockVisible by collectLastValue(underTest.isClockVisible)
+ val notifIconsVisible by collectLastValue(underTest.isNotificationIconContainerVisible)
+ val systemInfoVisible by collectLastValue(underTest.isSystemInfoVisible)
+
+ kosmos.sceneContainerRepository.snapToScene(Scenes.Lockscreen)
+ // Secure camera is an occluding activity
+ kosmos.keyguardOcclusionRepository.setShowWhenLockedActivityInfo(true, taskInfo = null)
+ kosmos.keyguardInteractor.onCameraLaunchDetected(CAMERA_LAUNCH_SOURCE_POWER_DOUBLE_TAP)
+
+ assertThat(clockVisible!!.visibility).isEqualTo(View.GONE)
+ assertThat(notifIconsVisible!!.visibility).isEqualTo(View.GONE)
+ assertThat(systemInfoVisible!!.visibility).isEqualTo(View.GONE)
+ }
+
private fun activeNotificationsStore(notifications: List<ActiveNotificationModel>) =
ActiveNotificationsStore.Builder()
.apply { notifications.forEach(::addIndividualNotif) }
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/policy/ZenModesCleanupStartableTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/policy/ZenModesCleanupStartableTest.kt
index 4a53a7a74bad..fd8958166a6c 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/policy/ZenModesCleanupStartableTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/policy/ZenModesCleanupStartableTest.kt
@@ -19,6 +19,7 @@ package com.android.systemui.statusbar.policy
import android.app.AutomaticZenRule
import android.app.NotificationManager
import android.net.Uri
+import android.platform.test.annotations.EnableFlags
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.systemui.SysuiTestCase
@@ -42,6 +43,7 @@ import org.mockito.kotlin.whenever
@OptIn(ExperimentalCoroutinesApi::class)
@RunWith(AndroidJUnit4::class)
@SmallTest
+@EnableFlags(android.app.Flags.FLAG_MODES_UI)
class ZenModesCleanupStartableTest : SysuiTestCase() {
private val kosmos = testKosmos()
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/window/StatusBarWindowControllerImplTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/window/StatusBarWindowControllerImplTest.kt
new file mode 100644
index 000000000000..6e66287c1683
--- /dev/null
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/window/StatusBarWindowControllerImplTest.kt
@@ -0,0 +1,62 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.android.systemui.statusbar.window
+
+import android.platform.test.annotations.DisableFlags
+import android.platform.test.annotations.EnableFlags
+import androidx.test.ext.junit.runners.AndroidJUnit4
+import androidx.test.filters.SmallTest
+import com.android.systemui.SysuiTestCase
+import com.android.systemui.statusbar.core.StatusBarConnectedDisplays
+import com.android.systemui.statusbar.policy.statusBarConfigurationController
+import com.android.systemui.testKosmos
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.mockito.kotlin.any
+import org.mockito.kotlin.never
+import org.mockito.kotlin.verify
+
+@SmallTest
+@RunWith(AndroidJUnit4::class)
+class StatusBarWindowControllerImplTest : SysuiTestCase() {
+
+ private val kosmos =
+ testKosmos().also { it.statusBarWindowViewInflater = it.fakeStatusBarWindowViewInflater }
+
+ private val underTest = kosmos.statusBarWindowControllerImpl
+ private val fakeStatusBarWindowViewInflater = kosmos.fakeStatusBarWindowViewInflater
+ private val statusBarConfigurationController = kosmos.statusBarConfigurationController
+
+ @Test
+ @EnableFlags(StatusBarConnectedDisplays.FLAG_NAME)
+ fun attach_connectedDisplaysFlagEnabled_setsConfigControllerOnWindowView() {
+ val windowView = fakeStatusBarWindowViewInflater.inflatedMockViews.first()
+
+ underTest.attach()
+
+ verify(windowView).setStatusBarConfigurationController(statusBarConfigurationController)
+ }
+
+ @Test
+ @DisableFlags(StatusBarConnectedDisplays.FLAG_NAME)
+ fun attach_connectedDisplaysFlagDisabled_doesNotSetConfigControllerOnWindowView() {
+ val mockWindowView = fakeStatusBarWindowViewInflater.inflatedMockViews.first()
+
+ underTest.attach()
+
+ verify(mockWindowView, never()).setStatusBarConfigurationController(any())
+ }
+}
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/window/StatusBarWindowViewTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/window/StatusBarWindowViewTest.kt
new file mode 100644
index 000000000000..9917f9996532
--- /dev/null
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/window/StatusBarWindowViewTest.kt
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.systemui.statusbar.window
+
+import android.content.res.Configuration
+import android.view.LayoutInflater
+import androidx.test.ext.junit.runners.AndroidJUnit4
+import androidx.test.filters.SmallTest
+import com.android.systemui.SysuiTestCase
+import com.android.systemui.res.R
+import com.android.systemui.statusbar.data.repository.StatusBarConfigurationController
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.mockito.kotlin.mock
+import org.mockito.kotlin.verify
+
+@SmallTest
+@RunWith(AndroidJUnit4::class)
+class StatusBarWindowViewTest : SysuiTestCase() {
+
+ private val underTest =
+ LayoutInflater.from(context).inflate(R.layout.super_status_bar, /* root= */ null)
+ as StatusBarWindowView
+
+ @Test
+ fun onConfigurationChanged_configurationControllerSet_forwardsCall() {
+ val configuration = Configuration()
+ val configurationController = mock<StatusBarConfigurationController>()
+ underTest.setStatusBarConfigurationController(configurationController)
+
+ underTest.onConfigurationChanged(configuration)
+
+ verify(configurationController).onConfigurationChanged(configuration)
+ }
+
+ @Test
+ fun onConfigurationChanged_configurationControllerNotSet_doesNotCrash() {
+ val configuration = Configuration()
+
+ underTest.onConfigurationChanged(configuration)
+ }
+}
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/surfaceeffects/turbulencenoise/TurbulenceNoiseShaderTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/surfaceeffects/turbulencenoise/TurbulenceNoiseShaderTest.kt
index 286f01736497..dbe90a5b85a9 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/surfaceeffects/turbulencenoise/TurbulenceNoiseShaderTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/surfaceeffects/turbulencenoise/TurbulenceNoiseShaderTest.kt
@@ -20,6 +20,7 @@ import androidx.test.filters.SmallTest
import com.android.systemui.SysuiTestCase
import com.android.systemui.surfaceeffects.turbulencenoise.TurbulenceNoiseShader.Companion.Type.SIMPLEX_NOISE
import com.android.systemui.surfaceeffects.turbulencenoise.TurbulenceNoiseShader.Companion.Type.SIMPLEX_NOISE_FRACTAL
+import com.android.systemui.surfaceeffects.turbulencenoise.TurbulenceNoiseShader.Companion.Type.SIMPLEX_NOISE_SIMPLE
import com.android.systemui.surfaceeffects.turbulencenoise.TurbulenceNoiseShader.Companion.Type.SIMPLEX_NOISE_SPARKLE
import org.junit.Test
import org.junit.runner.RunWith
@@ -28,20 +29,23 @@ import org.junit.runner.RunWith
@RunWith(AndroidJUnit4::class)
class TurbulenceNoiseShaderTest : SysuiTestCase() {
- private lateinit var turbulenceNoiseShader: TurbulenceNoiseShader
-
@Test
fun compilesSimplexNoise() {
- turbulenceNoiseShader = TurbulenceNoiseShader(baseType = SIMPLEX_NOISE)
+ TurbulenceNoiseShader(baseType = SIMPLEX_NOISE)
+ }
+
+ @Test
+ fun compilesSimplexSimpleNoise() {
+ TurbulenceNoiseShader(baseType = SIMPLEX_NOISE_SIMPLE)
}
@Test
fun compilesFractalNoise() {
- turbulenceNoiseShader = TurbulenceNoiseShader(baseType = SIMPLEX_NOISE_FRACTAL)
+ TurbulenceNoiseShader(baseType = SIMPLEX_NOISE_FRACTAL)
}
@Test
fun compilesSparkleNoise() {
- turbulenceNoiseShader = TurbulenceNoiseShader(baseType = SIMPLEX_NOISE_SPARKLE)
+ TurbulenceNoiseShader(baseType = SIMPLEX_NOISE_SPARKLE)
}
}
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/unfold/DisplaySwitchLatencyTrackerTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/unfold/DisplaySwitchLatencyTrackerTest.kt
index 5d850d82d806..f1015394d7b1 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/unfold/DisplaySwitchLatencyTrackerTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/unfold/DisplaySwitchLatencyTrackerTest.kt
@@ -18,15 +18,20 @@ package com.android.systemui.unfold
import android.content.Context
import android.content.res.Resources
+import android.hardware.devicestate.DeviceStateManager
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.internal.R
import com.android.systemui.SysuiTestCase
import com.android.systemui.common.ui.data.repository.ConfigurationRepositoryImpl
import com.android.systemui.common.ui.domain.interactor.ConfigurationInteractor
+import com.android.systemui.defaultDeviceState
+import com.android.systemui.deviceStateManager
import com.android.systemui.display.data.repository.DeviceStateRepository
import com.android.systemui.display.data.repository.DeviceStateRepository.DeviceState
+import com.android.systemui.foldedDeviceStateList
import com.android.systemui.keyguard.domain.interactor.KeyguardInteractor
+import com.android.systemui.kosmos.Kosmos
import com.android.systemui.power.domain.interactor.PowerInteractor
import com.android.systemui.power.shared.model.ScreenPowerState
import com.android.systemui.power.shared.model.WakeSleepReason
@@ -39,10 +44,10 @@ import com.android.systemui.unfold.DisplaySwitchLatencyTracker.Companion.FOLDABL
import com.android.systemui.unfold.DisplaySwitchLatencyTracker.DisplaySwitchLatencyEvent
import com.android.systemui.unfold.data.repository.UnfoldTransitionRepositoryImpl
import com.android.systemui.unfold.domain.interactor.UnfoldTransitionInteractor
+import com.android.systemui.unfoldedDeviceState
import com.android.systemui.util.animation.data.repository.AnimationStatusRepository
import com.android.systemui.util.mockito.any
import com.android.systemui.util.mockito.capture
-import com.android.systemui.util.mockito.mock
import com.android.systemui.util.time.FakeSystemClock
import com.google.common.truth.Truth.assertThat
import java.util.Optional
@@ -63,6 +68,7 @@ import org.mockito.Mockito.never
import org.mockito.Mockito.verify
import org.mockito.Mockito.`when` as whenever
import org.mockito.MockitoAnnotations
+import org.mockito.kotlin.mock
@OptIn(ExperimentalCoroutinesApi::class)
@RunWith(AndroidJUnit4::class)
@@ -78,8 +84,14 @@ class DisplaySwitchLatencyTrackerTest : SysuiTestCase() {
private val animationStatusRepository = mock<AnimationStatusRepository>()
private val keyguardInteractor = mock<KeyguardInteractor>()
private val displaySwitchLatencyLogger = mock<DisplaySwitchLatencyLogger>()
+ private val kosmos = Kosmos()
+ private val deviceStateManager = kosmos.deviceStateManager
+ private val closedDeviceState = kosmos.foldedDeviceStateList.first()
+ private val openDeviceState = kosmos.unfoldedDeviceState
+ private val defaultDeviceState = kosmos.defaultDeviceState
+ private val nonEmptyClosedDeviceStatesArray: IntArray =
+ IntArray(2) { closedDeviceState.identifier }
- private val nonEmptyClosedDeviceStatesArray: IntArray = IntArray(2) { 0 }
private val testDispatcher: TestDispatcher = StandardTestDispatcher()
private val testScope: TestScope = TestScope(testDispatcher)
private val isAsleep = MutableStateFlow(false)
@@ -108,6 +120,10 @@ class DisplaySwitchLatencyTrackerTest : SysuiTestCase() {
fun setup() {
MockitoAnnotations.initMocks(this)
whenever(mockContext.resources).thenReturn(resources)
+ whenever(mockContext.getSystemService(DeviceStateManager::class.java))
+ .thenReturn(deviceStateManager)
+ whenever(deviceStateManager.supportedDeviceStates)
+ .thenReturn(listOf(closedDeviceState, openDeviceState))
whenever(resources.getIntArray(R.array.config_foldedDeviceStates))
.thenReturn(nonEmptyClosedDeviceStatesArray)
whenever(foldStateRepository.state).thenReturn(deviceState)
@@ -128,7 +144,8 @@ class DisplaySwitchLatencyTrackerTest : SysuiTestCase() {
testDispatcher.asExecutor(),
testScope.backgroundScope,
displaySwitchLatencyLogger,
- systemClock
+ systemClock,
+ deviceStateManager
)
}
@@ -182,7 +199,8 @@ class DisplaySwitchLatencyTrackerTest : SysuiTestCase() {
testDispatcher.asExecutor(),
testScope.backgroundScope,
displaySwitchLatencyLogger,
- systemClock
+ systemClock,
+ deviceStateManager
)
areAnimationEnabled.emit(true)
@@ -321,6 +339,8 @@ class DisplaySwitchLatencyTrackerTest : SysuiTestCase() {
deviceState.emit(DeviceState.UNFOLDED)
whenever(resources.getIntArray(R.array.config_foldedDeviceStates))
.thenReturn(IntArray(0))
+ whenever(deviceStateManager.supportedDeviceStates)
+ .thenReturn(listOf(defaultDeviceState))
displaySwitchLatencyTracker.start()
deviceState.emit(DeviceState.HALF_FOLDED)
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/unfold/UnfoldLatencyTrackerTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/unfold/UnfoldLatencyTrackerTest.kt
index 1e5929daf9c0..a1122c3cbcd2 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/unfold/UnfoldLatencyTrackerTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/unfold/UnfoldLatencyTrackerTest.kt
@@ -23,9 +23,13 @@ import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.internal.util.LatencyTracker
import com.android.systemui.SysuiTestCase
+import com.android.systemui.foldedDeviceStateList
+import com.android.systemui.halfFoldedDeviceState
import com.android.systemui.keyguard.ScreenLifecycle
+import com.android.systemui.kosmos.Kosmos
import com.android.systemui.unfold.util.FoldableDeviceStates
import com.android.systemui.unfold.util.FoldableTestUtils
+import com.android.systemui.unfoldedDeviceState
import com.android.systemui.util.mockito.any
import java.util.Optional
import org.junit.Before
@@ -38,6 +42,7 @@ import org.mockito.Mockito.never
import org.mockito.Mockito.verify
import org.mockito.Mockito.verifyNoMoreInteractions
import org.mockito.MockitoAnnotations
+import org.mockito.kotlin.whenever
@RunWith(AndroidJUnit4::class)
@SmallTest
@@ -62,6 +67,13 @@ class UnfoldLatencyTrackerTest : SysuiTestCase() {
@Before
fun setUp() {
MockitoAnnotations.initMocks(this)
+ whenever(deviceStateManager.supportedDeviceStates).thenReturn(
+ listOf(
+ Kosmos().foldedDeviceStateList[0],
+ Kosmos().unfoldedDeviceState
+ )
+ )
+
unfoldLatencyTracker =
UnfoldLatencyTracker(
latencyTracker,
@@ -73,6 +85,7 @@ class UnfoldLatencyTrackerTest : SysuiTestCase() {
screenLifecycle
)
.apply { init() }
+
deviceStates = FoldableTestUtils.findDeviceStates(context)
verify(deviceStateManager).registerCallback(any(), foldStateListenerCaptor.capture())
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/unfold/util/FoldableTestUtils.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/unfold/util/FoldableTestUtils.kt
index e4a1c2680658..9a9ec137a075 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/unfold/util/FoldableTestUtils.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/unfold/util/FoldableTestUtils.kt
@@ -18,34 +18,53 @@ package com.android.systemui.unfold.util
import android.content.Context
import android.hardware.devicestate.DeviceState
+import android.hardware.devicestate.DeviceState.PROPERTY_FOLDABLE_DISPLAY_CONFIGURATION_INNER_PRIMARY
+import android.hardware.devicestate.DeviceState.PROPERTY_FOLDABLE_DISPLAY_CONFIGURATION_OUTER_PRIMARY
+import android.hardware.devicestate.DeviceStateManager
+import android.hardware.devicestate.feature.flags.Flags as DeviceStateManagerFlags
import org.junit.Assume.assumeTrue
object FoldableTestUtils {
-
/** Finds device state for folded and unfolded. */
fun findDeviceStates(context: Context): FoldableDeviceStates {
- // TODO(b/325474477): Migrate clients to updated DeviceStateManager API's
- val foldedDeviceStates: IntArray = context.resources.getIntArray(
- com.android.internal.R.array.config_foldedDeviceStates)
- assumeTrue("Test should be launched on a foldable device",
- foldedDeviceStates.isNotEmpty())
-
- val folded = getDeviceState(
- identifier = foldedDeviceStates.maxOrNull()!!
- )
- val unfolded = getDeviceState(
- identifier = folded.identifier + 1
- )
- return FoldableDeviceStates(folded = folded, unfolded = unfolded)
+ if (DeviceStateManagerFlags.deviceStatePropertyMigration()) {
+ val deviceStateManager = context.getSystemService(DeviceStateManager::class.java)
+ val deviceStateList = deviceStateManager.supportedDeviceStates
+
+ val folded =
+ deviceStateList.firstOrNull { state ->
+ state.hasProperty(PROPERTY_FOLDABLE_DISPLAY_CONFIGURATION_OUTER_PRIMARY)
+ }
+ val unfolded =
+ deviceStateList.firstOrNull { state ->
+ state.hasProperty(PROPERTY_FOLDABLE_DISPLAY_CONFIGURATION_INNER_PRIMARY)
+ }
+
+ assumeTrue(
+ "Test should only be ran on a foldable device",
+ (folded != null) && (unfolded != null)
+ )
+
+ return FoldableDeviceStates(folded = folded!!, unfolded = unfolded!!)
+ } else {
+ val foldedDeviceStates: IntArray =
+ context.resources.getIntArray(
+ com.android.internal.R.array.config_foldedDeviceStates
+ )
+ assumeTrue(
+ "Test should be launched on a foldable device",
+ foldedDeviceStates.isNotEmpty()
+ )
+
+ val folded = getDeviceState(identifier = foldedDeviceStates.maxOrNull()!!)
+ val unfolded = getDeviceState(identifier = folded.identifier + 1)
+ return FoldableDeviceStates(folded = folded, unfolded = unfolded)
+ }
}
private fun getDeviceState(identifier: Int): DeviceState {
- return DeviceState(
- DeviceState.Configuration.Builder(
- identifier, "" /* name */
- ).build()
- )
+ return DeviceState(DeviceState.Configuration.Builder(identifier, "" /* name */).build())
}
}
-data class FoldableDeviceStates(val folded: DeviceState, val unfolded: DeviceState) \ No newline at end of file
+data class FoldableDeviceStates(val folded: DeviceState, val unfolded: DeviceState)
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/util/UtilsTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/util/UtilsTest.kt
new file mode 100644
index 000000000000..b4ba41a5c524
--- /dev/null
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/util/UtilsTest.kt
@@ -0,0 +1,123 @@
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the
+ * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package com.android.systemui.util
+
+import android.hardware.devicestate.DeviceState
+import android.hardware.devicestate.DeviceState.PROPERTY_FOLDABLE_DISPLAY_CONFIGURATION_INNER_PRIMARY
+import android.hardware.devicestate.DeviceState.PROPERTY_FOLDABLE_DISPLAY_CONFIGURATION_OUTER_PRIMARY
+import android.hardware.devicestate.DeviceState.PROPERTY_FOLDABLE_HARDWARE_CONFIGURATION_FOLD_IN_CLOSED
+import android.hardware.devicestate.DeviceState.PROPERTY_FOLDABLE_HARDWARE_CONFIGURATION_FOLD_IN_OPEN
+import android.hardware.devicestate.feature.flags.Flags
+import android.platform.test.annotations.RequiresFlagsDisabled
+import android.platform.test.annotations.RequiresFlagsEnabled
+import android.testing.TestableResources
+import androidx.test.ext.junit.runners.AndroidJUnit4
+import androidx.test.filters.SmallTest
+import com.android.systemui.SysuiTestCase
+import com.android.systemui.deviceStateManager
+import com.android.systemui.kosmos.Kosmos
+import junit.framework.Assert.assertFalse
+import junit.framework.Assert.assertTrue
+import org.junit.Before
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.mockito.kotlin.whenever
+
+@SmallTest
+@RunWith(AndroidJUnit4::class)
+class UtilsTest : SysuiTestCase() {
+
+ private val kosmos = Kosmos()
+ private val deviceStateManager = kosmos.deviceStateManager
+ private lateinit var testableResources: TestableResources
+
+ @Before
+ fun setUp() {
+ testableResources = context.orCreateTestableResources
+ }
+
+ @Test
+ @RequiresFlagsDisabled(Flags.FLAG_DEVICE_STATE_PROPERTY_MIGRATION)
+ fun isFoldableReturnsFalse_overlayConfigurationValues() {
+ testableResources.addOverride(
+ com.android.internal.R.array.config_foldedDeviceStates,
+ intArrayOf() // empty array <=> device is not foldable
+ )
+ whenever(deviceStateManager.supportedDeviceStates).thenReturn(listOf(DEFAULT_DEVICE_STATE))
+ assertFalse(Utils.isDeviceFoldable(testableResources.resources, deviceStateManager))
+ }
+
+ @Test
+ @RequiresFlagsEnabled(Flags.FLAG_DEVICE_STATE_PROPERTY_MIGRATION)
+ fun isFoldableReturnsFalse_deviceStateManager() {
+ testableResources.addOverride(
+ com.android.internal.R.array.config_foldedDeviceStates,
+ intArrayOf() // empty array <=> device is not foldable
+ )
+ whenever(deviceStateManager.supportedDeviceStates).thenReturn(listOf(DEFAULT_DEVICE_STATE))
+ assertFalse(Utils.isDeviceFoldable(testableResources.resources, deviceStateManager))
+ }
+
+ @Test
+ @RequiresFlagsDisabled(Flags.FLAG_DEVICE_STATE_PROPERTY_MIGRATION)
+ fun isFoldableReturnsTrue_overlayConfigurationValues() {
+ testableResources.addOverride(
+ com.android.internal.R.array.config_foldedDeviceStates,
+ intArrayOf(FOLDED_DEVICE_STATE.identifier)
+ )
+ whenever(deviceStateManager.supportedDeviceStates)
+ .thenReturn(listOf(FOLDED_DEVICE_STATE, UNFOLDED_DEVICE_STATE))
+ assertTrue(Utils.isDeviceFoldable(testableResources.resources, deviceStateManager))
+ }
+
+ @Test
+ @RequiresFlagsEnabled(Flags.FLAG_DEVICE_STATE_PROPERTY_MIGRATION)
+ fun isFoldableReturnsTrue_deviceStateManager() {
+ testableResources.addOverride(
+ com.android.internal.R.array.config_foldedDeviceStates,
+ intArrayOf(FOLDED_DEVICE_STATE.identifier)
+ )
+ whenever(deviceStateManager.supportedDeviceStates)
+ .thenReturn(listOf(FOLDED_DEVICE_STATE, UNFOLDED_DEVICE_STATE))
+ assertTrue(Utils.isDeviceFoldable(testableResources.resources, deviceStateManager))
+ }
+
+ companion object {
+ private val DEFAULT_DEVICE_STATE =
+ DeviceState(DeviceState.Configuration.Builder(0 /* identifier */, "DEFAULT").build())
+ private val FOLDED_DEVICE_STATE =
+ DeviceState(
+ DeviceState.Configuration.Builder(1 /* identifier */, "FOLDED")
+ .setSystemProperties(
+ setOf(PROPERTY_FOLDABLE_DISPLAY_CONFIGURATION_OUTER_PRIMARY)
+ )
+ .setPhysicalProperties(
+ setOf(PROPERTY_FOLDABLE_HARDWARE_CONFIGURATION_FOLD_IN_CLOSED)
+ )
+ .build()
+ )
+ private val UNFOLDED_DEVICE_STATE =
+ DeviceState(
+ DeviceState.Configuration.Builder(2 /* identifier */, "UNFOLDED")
+ .setSystemProperties(
+ setOf(PROPERTY_FOLDABLE_DISPLAY_CONFIGURATION_INNER_PRIMARY)
+ )
+ .setPhysicalProperties(
+ setOf(PROPERTY_FOLDABLE_HARDWARE_CONFIGURATION_FOLD_IN_OPEN)
+ )
+ .build()
+ )
+ }
+}
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/volume/panel/component/volume/domain/interactor/AudioSlidersInteractorTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/volume/panel/component/volume/domain/interactor/AudioSlidersInteractorTest.kt
index 7361de7d21b0..76a1269a1fe9 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/volume/panel/component/volume/domain/interactor/AudioSlidersInteractorTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/volume/panel/component/volume/domain/interactor/AudioSlidersInteractorTest.kt
@@ -17,16 +17,19 @@
package com.android.systemui.volume.panel.component.volume.domain.interactor
import android.media.AudioManager
+import android.platform.test.annotations.EnableFlags
import android.testing.TestableLooper
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.settingslib.volume.shared.model.AudioStream
+import com.android.systemui.Flags
import com.android.systemui.SysuiTestCase
import com.android.systemui.coroutines.collectLastValue
import com.android.systemui.kosmos.Kosmos
import com.android.systemui.kosmos.testScope
import com.android.systemui.testKosmos
import com.android.systemui.volume.data.repository.audioRepository
+import com.android.systemui.volume.data.repository.audioSystemRepository
import com.android.systemui.volume.panel.component.volume.domain.model.SliderType
import com.google.common.truth.Truth.assertThat
import kotlinx.coroutines.ExperimentalCoroutinesApi
@@ -91,4 +94,20 @@ class AudioSlidersInteractorTest : SysuiTestCase() {
).map { SliderType.Stream(AudioStream(it)) })
}
}
+
+
+ @Test
+ @EnableFlags(Flags.FLAG_ONLY_SHOW_MEDIA_STREAM_SLIDER_IN_SINGLE_VOLUME_MODE)
+ fun shouldAddMusicStreamOnly_singleVolumeMode() =
+ with(kosmos) {
+ testScope.runTest {
+ audioSystemRepository.setIsSingleVolume(true)
+
+ val sliders by collectLastValue(underTest.volumePanelSliders)
+ runCurrent()
+
+ assertThat(sliders).isEqualTo(
+ mutableListOf(SliderType.Stream(AudioStream(AudioManager.STREAM_MUSIC))))
+ }
+ }
}
diff --git a/packages/SystemUI/res/anim/shortcut_helper_close_anim.xml b/packages/SystemUI/res/anim/shortcut_helper_close_anim.xml
deleted file mode 100644
index 47fd78a4d368..000000000000
--- a/packages/SystemUI/res/anim/shortcut_helper_close_anim.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- ~ Copyright (C) 2024 The Android Open Source Project
- ~
- ~ Licensed under the Apache License, Version 2.0 (the "License");
- ~ you may not use this file except in compliance with the License.
- ~ You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing, software
- ~ distributed under the License is distributed on an "AS IS" BASIS,
- ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ~ See the License for the specific language governing permissions and
- ~ limitations under the License.
- -->
-
-<set xmlns:android="http://schemas.android.com/apk/res/android"
- android:interpolator="@android:anim/accelerate_interpolator"
- android:zAdjustment="top">
-
- <translate
- android:fromYDelta="0"
- android:toYDelta="100%"
- android:duration="@android:integer/config_shortAnimTime" />
-</set>
diff --git a/packages/SystemUI/res/anim/shortcut_helper_launch_anim.xml b/packages/SystemUI/res/anim/shortcut_helper_launch_anim.xml
deleted file mode 100644
index 77edf588bd2e..000000000000
--- a/packages/SystemUI/res/anim/shortcut_helper_launch_anim.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- ~ Copyright (C) 2024 The Android Open Source Project
- ~
- ~ Licensed under the Apache License, Version 2.0 (the "License");
- ~ you may not use this file except in compliance with the License.
- ~ You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing, software
- ~ distributed under the License is distributed on an "AS IS" BASIS,
- ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ~ See the License for the specific language governing permissions and
- ~ limitations under the License.
- -->
-
-<!-- Animation for when a dock window at the bottom of the screen is entering. -->
-<set xmlns:android="http://schemas.android.com/apk/res/android"
- android:interpolator="@android:anim/accelerate_decelerate_interpolator"
- android:zAdjustment="top">
-
- <translate android:fromYDelta="100%"
- android:toYDelta="0"
- android:startOffset="@android:integer/config_shortAnimTime"
- android:duration="@android:integer/config_mediumAnimTime"/>
-</set>
diff --git a/packages/SystemUI/res/drawable/qs_hearing_devices_related_tools_background.xml b/packages/SystemUI/res/drawable/qs_hearing_devices_related_tools_background.xml
index 627b92b8a779..3c1668405909 100644
--- a/packages/SystemUI/res/drawable/qs_hearing_devices_related_tools_background.xml
+++ b/packages/SystemUI/res/drawable/qs_hearing_devices_related_tools_background.xml
@@ -21,11 +21,8 @@
android:color="?android:attr/colorControlHighlight">
<item>
<shape android:shape="rectangle">
- <solid android:color="@android:color/transparent"/>
+ <solid android:color="?androidprv:attr/materialColorPrimaryContainer"/>
<corners android:radius="@dimen/hearing_devices_preset_spinner_background_radius"/>
- <stroke
- android:width="1dp"
- android:color="?androidprv:attr/textColorTertiary" />
</shape>
</item>
</ripple>
diff --git a/packages/SystemUI/res/layout/hearing_devices_tile_dialog.xml b/packages/SystemUI/res/layout/hearing_devices_tile_dialog.xml
index 4a7bef9f48b9..80692f9481b7 100644
--- a/packages/SystemUI/res/layout/hearing_devices_tile_dialog.xml
+++ b/packages/SystemUI/res/layout/hearing_devices_tile_dialog.xml
@@ -72,7 +72,6 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/device_function_barrier"
- app:layout_constraintBottom_toTopOf="@id/related_tools_scroll"
android:drawableStart="@drawable/ic_add"
android:drawablePadding="20dp"
android:drawableTint="?android:attr/textColorPrimary"
@@ -92,24 +91,16 @@
app:barrierDirection="bottom"
app:constraint_referenced_ids="device_function_barrier, pair_new_device_button" />
- <HorizontalScrollView
- android:id="@+id/related_tools_scroll"
+ <LinearLayout
+ android:id="@+id/related_tools_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/bluetooth_dialog_layout_margin"
android:layout_marginEnd="@dimen/bluetooth_dialog_layout_margin"
android:layout_marginTop="@dimen/hearing_devices_layout_margin"
- android:scrollbars="none"
- android:fillViewport="true"
+ android:orientation="horizontal"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
- app:layout_constraintTop_toBottomOf="@id/preset_spinner">
- <LinearLayout
- android:id="@+id/related_tools_container"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:orientation="horizontal">
- </LinearLayout>
- </HorizontalScrollView>
+ app:layout_constraintTop_toBottomOf="@id/device_barrier" />
</androidx.constraintlayout.widget.ConstraintLayout> \ No newline at end of file
diff --git a/packages/SystemUI/res/layout/hearing_tool_item.xml b/packages/SystemUI/res/layout/hearing_tool_item.xml
index ff2fbe070e0f..f5baf2aaf6dc 100644
--- a/packages/SystemUI/res/layout/hearing_tool_item.xml
+++ b/packages/SystemUI/res/layout/hearing_tool_item.xml
@@ -17,8 +17,8 @@
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/tool_view"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
android:orientation="vertical"
android:gravity="top|center_horizontal"
android:focusable="true"
@@ -26,8 +26,10 @@
android:layout_weight="1">
<FrameLayout
android:id="@+id/icon_frame"
- android:layout_width="@dimen/hearing_devices_tool_icon_frame_width"
- android:layout_height="@dimen/hearing_devices_tool_icon_frame_height"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:paddingTop="20dp"
+ android:paddingBottom="20dp"
android:background="@drawable/qs_hearing_devices_related_tools_background"
android:focusable="false" >
<ImageView
diff --git a/packages/SystemUI/res/values-af/strings.xml b/packages/SystemUI/res/values-af/strings.xml
index 62bff957c61e..f00ba9dad6c4 100644
--- a/packages/SystemUI/res/values-af/strings.xml
+++ b/packages/SystemUI/res/values-af/strings.xml
@@ -312,6 +312,10 @@
<string name="quick_settings_bluetooth_audio_sharing_button" msgid="7545274861795853838">"Deel oudio"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_sharing" msgid="3069309588231072128">"Deel tans oudio"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_accessibility" msgid="7604615019302091708">"voer instellings vir oudiodeling in"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_message" msgid="4251807313264307426">"Hierdie toestel se musiek en video’s sal op albei stelle oorfone speel"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_title" msgid="4406818346036286793">"Deel jou oudio"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_subtitle" msgid="3014906864710059236">"<xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g> en <xliff:g id="ACTIVE_DEVICE_NAME">%2$s</xliff:g>"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_switch_to_button" msgid="7546825655978203773">"Skakel oor na <xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g>"</string>
<string name="quick_settings_bluetooth_secondary_label_battery_level" msgid="4182034939479344093">"<xliff:g id="BATTERY_LEVEL_AS_PERCENTAGE">%s</xliff:g> batterykrag"</string>
<string name="quick_settings_bluetooth_secondary_label_audio" msgid="780333390310051161">"Oudio"</string>
<string name="quick_settings_bluetooth_secondary_label_headset" msgid="2332093067553000852">"Kopstuk"</string>
@@ -672,10 +676,8 @@
<string name="stream_notification_unavailable" msgid="4313854556205836435">"Onbeskikbaar omdat luitoon gedemp is"</string>
<string name="stream_alarm_unavailable" msgid="4059817189292197839">"Onbeskikbaar want Moenie Steur Nie is aan"</string>
<string name="stream_media_unavailable" msgid="6823020894438959853">"Onbeskikbaar want Moenie Steur Nie is aan"</string>
- <!-- no translation found for stream_unavailable_by_modes (3674139029490353683) -->
- <skip />
- <!-- no translation found for stream_unavailable_by_unknown (6908434629318171588) -->
- <skip />
+ <string name="stream_unavailable_by_modes" msgid="3674139029490353683">"Onbeskikbaar omdat <xliff:g id="MODE">%s</xliff:g> aan is"</string>
+ <string name="stream_unavailable_by_unknown" msgid="6908434629318171588">"Onbeskikbaar"</string>
<string name="volume_stream_content_description_unmute" msgid="7729576371406792977">"%1$s. Tik om te ontdemp."</string>
<string name="volume_stream_content_description_vibrate" msgid="4858111994183089761">"%1$s. Tik om op vibreer te stel. Toeganklikheidsdienste kan dalk gedemp wees."</string>
<string name="volume_stream_content_description_mute" msgid="4079046784917920984">"%1$s. Tik om te demp. Toeganklikheidsdienste kan dalk gedemp wees."</string>
diff --git a/packages/SystemUI/res/values-am/strings.xml b/packages/SystemUI/res/values-am/strings.xml
index 74e072b3e0e0..9f759fb43a43 100644
--- a/packages/SystemUI/res/values-am/strings.xml
+++ b/packages/SystemUI/res/values-am/strings.xml
@@ -312,6 +312,10 @@
<string name="quick_settings_bluetooth_audio_sharing_button" msgid="7545274861795853838">"ኦዲዮ አጋራ"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_sharing" msgid="3069309588231072128">"ኦዲዮ በማጋራት ላይ"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_accessibility" msgid="7604615019302091708">"የድምፅ ማጋሪያ ቅንብሮች አስገባ"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_message" msgid="4251807313264307426">"የዚህ መሣሪያ ሙዚቃ እና ቪዲዮዎች በሁለቱም የራስ ላይ ማዳመጫዎች ላይ ይጫወታሉ"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_title" msgid="4406818346036286793">"ኦዲዮዎን ያጋሩ"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_subtitle" msgid="3014906864710059236">"<xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g> እና <xliff:g id="ACTIVE_DEVICE_NAME">%2$s</xliff:g>"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_switch_to_button" msgid="7546825655978203773">"ወደ <xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g> ቀይር"</string>
<string name="quick_settings_bluetooth_secondary_label_battery_level" msgid="4182034939479344093">"<xliff:g id="BATTERY_LEVEL_AS_PERCENTAGE">%s</xliff:g> ባትሪ"</string>
<string name="quick_settings_bluetooth_secondary_label_audio" msgid="780333390310051161">"ኦዲዮ"</string>
<string name="quick_settings_bluetooth_secondary_label_headset" msgid="2332093067553000852">"ማዳመጫ"</string>
@@ -672,10 +676,8 @@
<string name="stream_notification_unavailable" msgid="4313854556205836435">"የጥሪ ድምጽ ስለተዘጋ አይገኝም"</string>
<string name="stream_alarm_unavailable" msgid="4059817189292197839">"አትረብሽ ስለበራ አይገኝም"</string>
<string name="stream_media_unavailable" msgid="6823020894438959853">"አትረብሽ ስለበራ አይገኝም"</string>
- <!-- no translation found for stream_unavailable_by_modes (3674139029490353683) -->
- <skip />
- <!-- no translation found for stream_unavailable_by_unknown (6908434629318171588) -->
- <skip />
+ <string name="stream_unavailable_by_modes" msgid="3674139029490353683">"<xliff:g id="MODE">%s</xliff:g> ስለበራ አይገኝም"</string>
+ <string name="stream_unavailable_by_unknown" msgid="6908434629318171588">"አይገኝም"</string>
<string name="volume_stream_content_description_unmute" msgid="7729576371406792977">"%1$s። ድምጸ-ከል ለማድረግ መታ ያድርጉ"</string>
<string name="volume_stream_content_description_vibrate" msgid="4858111994183089761">"%1$s። ወደ ንዝረት ለማቀናበር መታ ያድርጉ። የተደራሽነት አገልግሎቶች ድምጸ-ከል ሊደረግባቸው ይችላል።"</string>
<string name="volume_stream_content_description_mute" msgid="4079046784917920984">"%1$s። ድምጸ-ከል ለማድረግ መታ ያድርጉ። የተደራሽነት አገልግሎቶች ድምጸ-ከል ሊደረግባቸው ይችላል።"</string>
diff --git a/packages/SystemUI/res/values-ar/strings.xml b/packages/SystemUI/res/values-ar/strings.xml
index 922caeaf558d..c2539a7ec689 100644
--- a/packages/SystemUI/res/values-ar/strings.xml
+++ b/packages/SystemUI/res/values-ar/strings.xml
@@ -312,6 +312,10 @@
<string name="quick_settings_bluetooth_audio_sharing_button" msgid="7545274861795853838">"مشاركة الصوت"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_sharing" msgid="3069309588231072128">"جارٍ مشاركة الصوت"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_accessibility" msgid="7604615019302091708">"أدخِل إعدادات ميزة \"مشاركة الصوت\""</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_message" msgid="4251807313264307426">"سيتمّ تشغيل الموسيقى والفيديوهات في هذا الجهاز على سماعات الرأس"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_title" msgid="4406818346036286793">"مشاركة صوت جهازك"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_subtitle" msgid="3014906864710059236">"‫\"<xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g>\" و\"<xliff:g id="ACTIVE_DEVICE_NAME">%2$s</xliff:g>\""</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_switch_to_button" msgid="7546825655978203773">"التبديل إلى \"<xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g>\""</string>
<string name="quick_settings_bluetooth_secondary_label_battery_level" msgid="4182034939479344093">"مستوى طاقة البطارية <xliff:g id="BATTERY_LEVEL_AS_PERCENTAGE">%s</xliff:g>"</string>
<string name="quick_settings_bluetooth_secondary_label_audio" msgid="780333390310051161">"صوت"</string>
<string name="quick_settings_bluetooth_secondary_label_headset" msgid="2332093067553000852">"سماعة الرأس"</string>
@@ -672,10 +676,8 @@
<string name="stream_notification_unavailable" msgid="4313854556205836435">"غير متاح بسبب كتم صوت الرنين"</string>
<string name="stream_alarm_unavailable" msgid="4059817189292197839">"مستوى الصوت غير متاح بسبب تفعيل وضع \"عدم الإزعاج\""</string>
<string name="stream_media_unavailable" msgid="6823020894438959853">"مستوى الصوت غير متاح لأنّ وضع \"عدم الإزعاج\" مفعّل"</string>
- <!-- no translation found for stream_unavailable_by_modes (3674139029490353683) -->
- <skip />
- <!-- no translation found for stream_unavailable_by_unknown (6908434629318171588) -->
- <skip />
+ <string name="stream_unavailable_by_modes" msgid="3674139029490353683">"غير متوفِّر لأنّ وضع \"<xliff:g id="MODE">%s</xliff:g>\" مفعَّل"</string>
+ <string name="stream_unavailable_by_unknown" msgid="6908434629318171588">"غير متوفِّر"</string>
<string name="volume_stream_content_description_unmute" msgid="7729576371406792977">"‏%1$s. انقر لإلغاء التجاهل."</string>
<string name="volume_stream_content_description_vibrate" msgid="4858111994183089761">"‏%1$s. انقر للتعيين على الاهتزاز. قد يتم تجاهل خدمات \"سهولة الاستخدام\"."</string>
<string name="volume_stream_content_description_mute" msgid="4079046784917920984">"‏%1$s. انقر للتجاهل. قد يتم تجاهل خدمات \"سهولة الاستخدام\"."</string>
diff --git a/packages/SystemUI/res/values-as/strings.xml b/packages/SystemUI/res/values-as/strings.xml
index f353428b2bb7..240d29eaaf28 100644
--- a/packages/SystemUI/res/values-as/strings.xml
+++ b/packages/SystemUI/res/values-as/strings.xml
@@ -312,6 +312,10 @@
<string name="quick_settings_bluetooth_audio_sharing_button" msgid="7545274861795853838">"অডিঅ’ শ্বেয়াৰ কৰক"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_sharing" msgid="3069309588231072128">"অডিঅ’ শ্বেয়াৰ কৰি থকা হৈছে"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_accessibility" msgid="7604615019302091708">"অডিঅ’ শ্বেয়াৰ কৰাৰ ছেটিঙলৈ যাওক"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_message" msgid="4251807313264307426">"এই ডিভাইচটোৰ সংগীত আৰু ভিডিঅ’সমূহ দুয়োটা হেডফ’নতে প্লে’ হ’ব"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_title" msgid="4406818346036286793">"আপোনাৰ অডিঅ’ শ্বেয়াৰ কৰক"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_subtitle" msgid="3014906864710059236">"<xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g> আৰু <xliff:g id="ACTIVE_DEVICE_NAME">%2$s</xliff:g>"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_switch_to_button" msgid="7546825655978203773">"<xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g>লৈ সলনি কৰক"</string>
<string name="quick_settings_bluetooth_secondary_label_battery_level" msgid="4182034939479344093">"বেটাৰী <xliff:g id="BATTERY_LEVEL_AS_PERCENTAGE">%s</xliff:g>"</string>
<string name="quick_settings_bluetooth_secondary_label_audio" msgid="780333390310051161">"অডিঅ’"</string>
<string name="quick_settings_bluetooth_secondary_label_headset" msgid="2332093067553000852">"হেডছেট"</string>
@@ -672,10 +676,8 @@
<string name="stream_notification_unavailable" msgid="4313854556205836435">"ৰিং মিউট কৰি থোৱাৰ বাবে উপলব্ধ নহয়"</string>
<string name="stream_alarm_unavailable" msgid="4059817189292197839">"অসুবিধা নিদিব অন থকাৰ কাৰণে উপলব্ধ নহয়"</string>
<string name="stream_media_unavailable" msgid="6823020894438959853">"অসুবিধা নিদিব অন থকাৰ কাৰণে উপলব্ধ নহয়"</string>
- <!-- no translation found for stream_unavailable_by_modes (3674139029490353683) -->
- <skip />
- <!-- no translation found for stream_unavailable_by_unknown (6908434629318171588) -->
- <skip />
+ <string name="stream_unavailable_by_modes" msgid="3674139029490353683">"<xliff:g id="MODE">%s</xliff:g> অন থকাৰ বাবে উপলব্ধ নহয়"</string>
+ <string name="stream_unavailable_by_unknown" msgid="6908434629318171588">"উপলব্ধ নহয়"</string>
<string name="volume_stream_content_description_unmute" msgid="7729576371406792977">"%1$s। আনমিউট কৰিবৰ বাবে টিপক।"</string>
<string name="volume_stream_content_description_vibrate" msgid="4858111994183089761">"%1$s। কম্পনৰ বাবে টিপক। দিব্য়াংগসকলৰ বাবে থকা সেৱা মিউট হৈ থাকিব পাৰে।"</string>
<string name="volume_stream_content_description_mute" msgid="4079046784917920984">"%1$s। মিউট কৰিবলৈ টিপক। দিব্য়াংগসকলৰ বাবে থকা সেৱা মিউট হৈ থাকিব পাৰে।"</string>
diff --git a/packages/SystemUI/res/values-az/strings.xml b/packages/SystemUI/res/values-az/strings.xml
index 6d2ec46ed831..d3ebd7d6f43c 100644
--- a/packages/SystemUI/res/values-az/strings.xml
+++ b/packages/SystemUI/res/values-az/strings.xml
@@ -312,6 +312,10 @@
<string name="quick_settings_bluetooth_audio_sharing_button" msgid="7545274861795853838">"Audio paylaşın"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_sharing" msgid="3069309588231072128">"Audio paylaşılır"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_accessibility" msgid="7604615019302091708">"audio paylaşma ayarlarına daxil olun"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_message" msgid="4251807313264307426">"Bu cihazın musiqi və videoları hər iki qulaqlıqda oxudulacaq"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_title" msgid="4406818346036286793">"Audio paylaşın"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_subtitle" msgid="3014906864710059236">"<xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g> və <xliff:g id="ACTIVE_DEVICE_NAME">%2$s</xliff:g>"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_switch_to_button" msgid="7546825655978203773">"<xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g> cihazına keçin"</string>
<string name="quick_settings_bluetooth_secondary_label_battery_level" msgid="4182034939479344093">"<xliff:g id="BATTERY_LEVEL_AS_PERCENTAGE">%s</xliff:g> batareya"</string>
<string name="quick_settings_bluetooth_secondary_label_audio" msgid="780333390310051161">"Audio"</string>
<string name="quick_settings_bluetooth_secondary_label_headset" msgid="2332093067553000852">"Qulaqlıq"</string>
@@ -672,10 +676,8 @@
<string name="stream_notification_unavailable" msgid="4313854556205836435">"Zəng səssiz edildiyi üçün əlçatan deyil"</string>
<string name="stream_alarm_unavailable" msgid="4059817189292197839">"Narahat Etməyin aktiv olduğu üçün əlçatan deyil"</string>
<string name="stream_media_unavailable" msgid="6823020894438959853">"Narahat Etməyin aktiv olduğu üçün əlçatan deyil"</string>
- <!-- no translation found for stream_unavailable_by_modes (3674139029490353683) -->
- <skip />
- <!-- no translation found for stream_unavailable_by_unknown (6908434629318171588) -->
- <skip />
+ <string name="stream_unavailable_by_modes" msgid="3674139029490353683">"<xliff:g id="MODE">%s</xliff:g> yanılı olduğu üçün əlçatan deyil"</string>
+ <string name="stream_unavailable_by_unknown" msgid="6908434629318171588">"Əlçatan deyil"</string>
<string name="volume_stream_content_description_unmute" msgid="7729576371406792977">"%1$s. Səsli etmək üçün tıklayın."</string>
<string name="volume_stream_content_description_vibrate" msgid="4858111994183089761">"%1$s. Vibrasiyanı ayarlamaq üçün tıklayın. Əlçatımlılıq xidmətləri səssiz edilmiş ola bilər."</string>
<string name="volume_stream_content_description_mute" msgid="4079046784917920984">"%1$s. Səssiz etmək üçün tıklayın. Əlçatımlılıq xidmətləri səssiz edilmiş ola bilər."</string>
diff --git a/packages/SystemUI/res/values-b+sr+Latn/strings.xml b/packages/SystemUI/res/values-b+sr+Latn/strings.xml
index b2a983ebc223..a1fc84637a90 100644
--- a/packages/SystemUI/res/values-b+sr+Latn/strings.xml
+++ b/packages/SystemUI/res/values-b+sr+Latn/strings.xml
@@ -312,6 +312,10 @@
<string name="quick_settings_bluetooth_audio_sharing_button" msgid="7545274861795853838">"Deli zvuk"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_sharing" msgid="3069309588231072128">"Deli se zvuk"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_accessibility" msgid="7604615019302091708">"uđite u podešavanja deljenja zvuka"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_message" msgid="4251807313264307426">"Muzika i videi sa ovog uređaja se reprodukuju na paru slušalica"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_title" msgid="4406818346036286793">"Delite zvuk"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_subtitle" msgid="3014906864710059236">"<xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g> i <xliff:g id="ACTIVE_DEVICE_NAME">%2$s</xliff:g>"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_switch_to_button" msgid="7546825655978203773">"Pređi na <xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g>"</string>
<string name="quick_settings_bluetooth_secondary_label_battery_level" msgid="4182034939479344093">"Nivo baterije je <xliff:g id="BATTERY_LEVEL_AS_PERCENTAGE">%s</xliff:g>"</string>
<string name="quick_settings_bluetooth_secondary_label_audio" msgid="780333390310051161">"Audio"</string>
<string name="quick_settings_bluetooth_secondary_label_headset" msgid="2332093067553000852">"Slušalice"</string>
@@ -672,10 +676,8 @@
<string name="stream_notification_unavailable" msgid="4313854556205836435">"Nedostupno jer je zvuk isključen"</string>
<string name="stream_alarm_unavailable" msgid="4059817189292197839">"Nedostupno jer je uključen režim Ne uznemiravaj"</string>
<string name="stream_media_unavailable" msgid="6823020894438959853">"Nedostupno jer je uključen režim Ne uznemiravaj"</string>
- <!-- no translation found for stream_unavailable_by_modes (3674139029490353683) -->
- <skip />
- <!-- no translation found for stream_unavailable_by_unknown (6908434629318171588) -->
- <skip />
+ <string name="stream_unavailable_by_modes" msgid="3674139029490353683">"Nije dostupno jer je uključeno: <xliff:g id="MODE">%s</xliff:g>"</string>
+ <string name="stream_unavailable_by_unknown" msgid="6908434629318171588">"Nedostupno"</string>
<string name="volume_stream_content_description_unmute" msgid="7729576371406792977">"%1$s. Dodirnite da biste uključili zvuk."</string>
<string name="volume_stream_content_description_vibrate" msgid="4858111994183089761">"%1$s. Dodirnite da biste podesili na vibraciju. Zvuk usluga pristupačnosti će možda biti isključen."</string>
<string name="volume_stream_content_description_mute" msgid="4079046784917920984">"%1$s. Dodirnite da biste isključili zvuk. Zvuk usluga pristupačnosti će možda biti isključen."</string>
diff --git a/packages/SystemUI/res/values-be/strings.xml b/packages/SystemUI/res/values-be/strings.xml
index a0e536b0881f..526a11e0cb8f 100644
--- a/packages/SystemUI/res/values-be/strings.xml
+++ b/packages/SystemUI/res/values-be/strings.xml
@@ -312,6 +312,10 @@
<string name="quick_settings_bluetooth_audio_sharing_button" msgid="7545274861795853838">"Абагуліць аўдыя"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_sharing" msgid="3069309588231072128">"Ідзе абагульванне аўдыя"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_accessibility" msgid="7604615019302091708">"адкрыць налады абагульвання аўдыя"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_message" msgid="4251807313264307426">"Музыка і відэа на гэтай прыладзе будуць прайгравацца праз абедзве пары навушнікаў"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_title" msgid="4406818346036286793">"Абагульвайце аўдыя"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_subtitle" msgid="3014906864710059236">"<xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g> і <xliff:g id="ACTIVE_DEVICE_NAME">%2$s</xliff:g>"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_switch_to_button" msgid="7546825655978203773">"Пераключыцца на прыладу \"<xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g>\""</string>
<string name="quick_settings_bluetooth_secondary_label_battery_level" msgid="4182034939479344093">"Узровень зараду: <xliff:g id="BATTERY_LEVEL_AS_PERCENTAGE">%s</xliff:g>"</string>
<string name="quick_settings_bluetooth_secondary_label_audio" msgid="780333390310051161">"Гук"</string>
<string name="quick_settings_bluetooth_secondary_label_headset" msgid="2332093067553000852">"Гарнітура"</string>
@@ -672,10 +676,8 @@
<string name="stream_notification_unavailable" msgid="4313854556205836435">"Недаступна, бо выключаны гук выклікаў"</string>
<string name="stream_alarm_unavailable" msgid="4059817189292197839">"Недаступна, бо ўключаны рэжым \"Не турбаваць\""</string>
<string name="stream_media_unavailable" msgid="6823020894438959853">"Недаступна, бо ўключаны рэжым \"Не турбаваць\""</string>
- <!-- no translation found for stream_unavailable_by_modes (3674139029490353683) -->
- <skip />
- <!-- no translation found for stream_unavailable_by_unknown (6908434629318171588) -->
- <skip />
+ <string name="stream_unavailable_by_modes" msgid="3674139029490353683">"Недаступна, бо ўключаны рэжым \"<xliff:g id="MODE">%s</xliff:g>\""</string>
+ <string name="stream_unavailable_by_unknown" msgid="6908434629318171588">"Недаступна"</string>
<string name="volume_stream_content_description_unmute" msgid="7729576371406792977">"%1$s. Дакраніцеся, каб уключыць гук."</string>
<string name="volume_stream_content_description_vibrate" msgid="4858111994183089761">"%1$s. Дакраніцеся, каб уключыць вібрацыю. Можа быць адключаны гук службаў спецыяльных магчымасцей."</string>
<string name="volume_stream_content_description_mute" msgid="4079046784917920984">"%1$s. Дакраніцеся, каб адключыць гук. Можа быць адключаны гук службаў спецыяльных магчымасцей."</string>
diff --git a/packages/SystemUI/res/values-bg/strings.xml b/packages/SystemUI/res/values-bg/strings.xml
index 1702b8374b99..b843068e85d7 100644
--- a/packages/SystemUI/res/values-bg/strings.xml
+++ b/packages/SystemUI/res/values-bg/strings.xml
@@ -312,6 +312,10 @@
<string name="quick_settings_bluetooth_audio_sharing_button" msgid="7545274861795853838">"Споделяне на звука"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_sharing" msgid="3069309588231072128">"Звукът се споделя"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_accessibility" msgid="7604615019302091708">"отваряне на настройките за споделяне на звука"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_message" msgid="4251807313264307426">"Музиката и видеоклиповете на това устройство ще се възпроизвеждат и на двата чифта слушалки"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_title" msgid="4406818346036286793">"Споделяне на звука ви"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_subtitle" msgid="3014906864710059236">"<xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g> и <xliff:g id="ACTIVE_DEVICE_NAME">%2$s</xliff:g>"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_switch_to_button" msgid="7546825655978203773">"Превключване към <xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g>"</string>
<string name="quick_settings_bluetooth_secondary_label_battery_level" msgid="4182034939479344093">"Батерия: <xliff:g id="BATTERY_LEVEL_AS_PERCENTAGE">%s</xliff:g>"</string>
<string name="quick_settings_bluetooth_secondary_label_audio" msgid="780333390310051161">"Аудио"</string>
<string name="quick_settings_bluetooth_secondary_label_headset" msgid="2332093067553000852">"Слушалки"</string>
@@ -672,10 +676,8 @@
<string name="stream_notification_unavailable" msgid="4313854556205836435">"Не е налице, защото звъненето е спряно"</string>
<string name="stream_alarm_unavailable" msgid="4059817189292197839">"Не е налице, защото режимът „Не безпокойте“ е вкл."</string>
<string name="stream_media_unavailable" msgid="6823020894438959853">"Не е налице, защото „Не безпокойте“ е вкл."</string>
- <!-- no translation found for stream_unavailable_by_modes (3674139029490353683) -->
- <skip />
- <!-- no translation found for stream_unavailable_by_unknown (6908434629318171588) -->
- <skip />
+ <string name="stream_unavailable_by_modes" msgid="3674139029490353683">"Не е налице, защото режимът „<xliff:g id="MODE">%s</xliff:g>“ е включен"</string>
+ <string name="stream_unavailable_by_unknown" msgid="6908434629318171588">"Не е налице"</string>
<string name="volume_stream_content_description_unmute" msgid="7729576371406792977">"%1$s. Докоснете, за да включите отново звука."</string>
<string name="volume_stream_content_description_vibrate" msgid="4858111994183089761">"%1$s. Докоснете, за да зададете вибриране. Възможно е звукът на услугите за достъпност да бъде заглушен."</string>
<string name="volume_stream_content_description_mute" msgid="4079046784917920984">"%1$s. Докоснете, за да заглушите звука. Възможно е звукът на услугите за достъпност да бъде заглушен."</string>
diff --git a/packages/SystemUI/res/values-bn/strings.xml b/packages/SystemUI/res/values-bn/strings.xml
index a36fe05c263c..0732387fe337 100644
--- a/packages/SystemUI/res/values-bn/strings.xml
+++ b/packages/SystemUI/res/values-bn/strings.xml
@@ -312,6 +312,10 @@
<string name="quick_settings_bluetooth_audio_sharing_button" msgid="7545274861795853838">"অডিও শেয়ার করুন"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_sharing" msgid="3069309588231072128">"অডিও শেয়ার করা হচ্ছে"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_accessibility" msgid="7604615019302091708">"অডিও শেয়ার করার সেটিংসে যান"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_message" msgid="4251807313264307426">"এই ডিভাইসের মিউজিক ও ভিডিও, হেডফোনের দুটি পেয়ারেই চলবে"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_title" msgid="4406818346036286793">"আপনার অডিও শেয়ার করুন"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_subtitle" msgid="3014906864710059236">"<xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g> ও <xliff:g id="ACTIVE_DEVICE_NAME">%2$s</xliff:g>"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_switch_to_button" msgid="7546825655978203773">"<xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g>-এ পাল্টান"</string>
<string name="quick_settings_bluetooth_secondary_label_battery_level" msgid="4182034939479344093">"চার্জ <xliff:g id="BATTERY_LEVEL_AS_PERCENTAGE">%s</xliff:g>"</string>
<string name="quick_settings_bluetooth_secondary_label_audio" msgid="780333390310051161">"অডিও"</string>
<string name="quick_settings_bluetooth_secondary_label_headset" msgid="2332093067553000852">"হেডসেট"</string>
@@ -440,8 +444,7 @@
<string name="zen_mode_on" msgid="9085304934016242591">"চালু আছে"</string>
<string name="zen_mode_on_with_details" msgid="7416143430557895497">"চালু আছে • <xliff:g id="TRIGGER_DESCRIPTION">%1$s</xliff:g>"</string>
<string name="zen_mode_off" msgid="1736604456618147306">"বন্ধ আছে"</string>
- <!-- no translation found for zen_mode_set_up (8231201163894922821) -->
- <skip />
+ <string name="zen_mode_set_up" msgid="8231201163894922821">"সেট করা নেই"</string>
<string name="zen_mode_no_manual_invocation" msgid="1769975741344633672">"সেটিংসে গিয়ে ম্যানেজ করুন"</string>
<string name="zen_mode_active_modes" msgid="1625850411578488856">"{count,plural, =0{কোনও মোড চালু নেই}=1{{mode} চালু আছে}one{# মোড চালু আছে}other{# মোড চালু আছে}}"</string>
<string name="zen_priority_introduction" msgid="3159291973383796646">"অ্যালার্ম, রিমাইন্ডার, ইভেন্ট, এবং আপনার নির্দিষ্ট করে দেওয়া ব্যক্তিদের কল ছাড়া অন্য কোনও আওয়াজ বা ভাইব্রেশন হবে না। তবে সঙ্গীত, ভিডিও, এবং গেম সহ আপনি যা কিছু চালাবেন তার আওয়াজ শুনতে পাবেন।"</string>
@@ -673,10 +676,8 @@
<string name="stream_notification_unavailable" msgid="4313854556205836435">"রিং মিউট করা হয়েছে বলে উপলভ্য নেই"</string>
<string name="stream_alarm_unavailable" msgid="4059817189292197839">"\'বিরক্ত করবে না\' মোড চালু থাকার জন্য উপলভ্য নেই"</string>
<string name="stream_media_unavailable" msgid="6823020894438959853">"\'বিরক্ত করবে না\' মোড চালু থাকার জন্য উপলভ্য নেই"</string>
- <!-- no translation found for stream_unavailable_by_modes (3674139029490353683) -->
- <skip />
- <!-- no translation found for stream_unavailable_by_unknown (6908434629318171588) -->
- <skip />
+ <string name="stream_unavailable_by_modes" msgid="3674139029490353683">"<xliff:g id="MODE">%s</xliff:g> চালু হওয়ার জন্য এই সুবিধা উপলভ্য নেই"</string>
+ <string name="stream_unavailable_by_unknown" msgid="6908434629318171588">"উপলভ্য নেই"</string>
<string name="volume_stream_content_description_unmute" msgid="7729576371406792977">"%1$s। সশব্দ করতে আলতো চাপুন।"</string>
<string name="volume_stream_content_description_vibrate" msgid="4858111994183089761">"%1$s। কম্পন এ সেট করতে আলতো চাপুন। অ্যাক্সেসযোগ্যতার পরিষেবাগুলিকে মিউট করা হতে পারে।"</string>
<string name="volume_stream_content_description_mute" msgid="4079046784917920984">"%1$s। মিউট করতে আলতো চাপুন। অ্যাক্সেসযোগ্যতার পরিষেবাগুলিকে মিউট করা হতে পারে।"</string>
@@ -1410,38 +1411,26 @@
<string name="launch_touchpad_tutorial_notification_content" msgid="7931085031240753226">"টাচপ্যাডের জেসচার সম্পর্কে জানুন"</string>
<string name="launch_keyboard_touchpad_tutorial_notification_title" msgid="1940023776496198762">"আপনার কীবোর্ড এবং টাচপ্যাড ব্যবহার করে নেভিগেট করুন"</string>
<string name="launch_keyboard_touchpad_tutorial_notification_content" msgid="1780725168171929365">"টাচপ্যাড জেসচার, কীবোর্ড শর্টকাট এবং আরও অনেক কিছু সম্পর্কে জানুন"</string>
- <!-- no translation found for touchpad_tutorial_back_gesture_button (3104716365403620315) -->
- <skip />
- <!-- no translation found for touchpad_tutorial_home_gesture_button (8023973153559885624) -->
- <skip />
+ <string name="touchpad_tutorial_back_gesture_button" msgid="3104716365403620315">"ফিরে যান"</string>
+ <string name="touchpad_tutorial_home_gesture_button" msgid="8023973153559885624">"হোমে যান"</string>
<string name="touchpad_tutorial_recent_apps_gesture_button" msgid="8919227647650347359">"সম্প্রতি ব্যবহার করা হয়েছে এমন অ্যাপ দেখুন"</string>
<string name="touchpad_tutorial_done_button" msgid="176168488821755503">"হয়ে গেছে"</string>
<string name="touchpad_back_gesture_action_title" msgid="7199067250654332735">"ফিরে যান"</string>
- <!-- no translation found for touchpad_back_gesture_guidance (5352221087725906542) -->
- <skip />
- <!-- no translation found for touchpad_back_gesture_success_title (7370719098633023496) -->
- <skip />
+ <string name="touchpad_back_gesture_guidance" msgid="5352221087725906542">"আপনার টাচপ্যাডে তিনটি আঙুল ব্যবহার করে বাঁদিকে বা ডানদিকে সোয়াইপ করুন"</string>
+ <string name="touchpad_back_gesture_success_title" msgid="7370719098633023496">"সাবাস!"</string>
<string name="touchpad_back_gesture_success_body" msgid="2324724953720741719">"জেসচার ব্যবহার করে কীভাবে ফিরে যাওয়া যায় সেই সম্পর্কে আপনি জেনেছেন।"</string>
<string name="touchpad_home_gesture_action_title" msgid="8885107349719257882">"হোমে যান"</string>
- <!-- no translation found for touchpad_home_gesture_guidance (4178219118381915899) -->
- <skip />
- <!-- no translation found for touchpad_home_gesture_success_title (3648264553645798470) -->
- <skip />
- <!-- no translation found for touchpad_home_gesture_success_body (2590690589194027059) -->
- <skip />
+ <string name="touchpad_home_gesture_guidance" msgid="4178219118381915899">"আপনার টাচপ্যাডে তিনটি আঙুলের সাহায্যে উপরের দিকে সোয়াইপ করুন"</string>
+ <string name="touchpad_home_gesture_success_title" msgid="3648264553645798470">"অসাধারণ!"</string>
+ <string name="touchpad_home_gesture_success_body" msgid="2590690589194027059">"জেসচার ব্যবহার করে কীভাবে হোমে ফিরে যাওয়া যায় সেই সম্পর্কে আপনি জেনেছেন"</string>
<string name="touchpad_recent_apps_gesture_action_title" msgid="934906836867137906">"সম্প্রতি ব্যবহার করা হয়েছে এমন অ্যাপ দেখুন"</string>
- <!-- no translation found for touchpad_recent_apps_gesture_guidance (6304446013842271822) -->
- <skip />
+ <string name="touchpad_recent_apps_gesture_guidance" msgid="6304446013842271822">"আপনার টাচপ্যাডে তিনটি আঙুল ব্যবহার করে উপরের দিকে সোয়াইপ করে ধরে রাখুন"</string>
<string name="touchpad_recent_apps_gesture_success_title" msgid="8481920554139332593">"অসাধারণ!"</string>
<string name="touchpad_recent_apps_gesture_success_body" msgid="4334263906697493273">"সম্প্রতি ব্যবহার করা হয়েছে এমন অ্যাপের জেসচার দেখা সম্পূর্ণ করেছেন।"</string>
- <!-- no translation found for tutorial_action_key_title (8172535792469008169) -->
- <skip />
- <!-- no translation found for tutorial_action_key_guidance (5040613427202799294) -->
- <skip />
- <!-- no translation found for tutorial_action_key_success_title (2371827347071979571) -->
- <skip />
- <!-- no translation found for tutorial_action_key_success_body (1688986269491357832) -->
- <skip />
+ <string name="tutorial_action_key_title" msgid="8172535792469008169">"সব অ্যাপ দেখুন"</string>
+ <string name="tutorial_action_key_guidance" msgid="5040613427202799294">"আপনার কীবোর্ডে অ্যাকশন কী প্রেস করুন"</string>
+ <string name="tutorial_action_key_success_title" msgid="2371827347071979571">"দারুণ!"</string>
+ <string name="tutorial_action_key_success_body" msgid="1688986269491357832">"আপনি \'সব অ্যাপের জেসচার দেখুন\' টিউটোরিয়াল সম্পূর্ণ করেছেন"</string>
<string name="keyboard_backlight_dialog_title" msgid="8273102932345564724">"কীবোর্ড ব্যাকলাইট"</string>
<string name="keyboard_backlight_value" msgid="7336398765584393538">"%2$d-এর মধ্যে %1$d লেভেল"</string>
<string name="home_controls_dream_label" msgid="6567105701292324257">"হোম কন্ট্রোল"</string>
diff --git a/packages/SystemUI/res/values-bs/strings.xml b/packages/SystemUI/res/values-bs/strings.xml
index 13a933e8964a..b1146f4c482c 100644
--- a/packages/SystemUI/res/values-bs/strings.xml
+++ b/packages/SystemUI/res/values-bs/strings.xml
@@ -312,6 +312,10 @@
<string name="quick_settings_bluetooth_audio_sharing_button" msgid="7545274861795853838">"Dijeli zvuk"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_sharing" msgid="3069309588231072128">"Dijeljenje zvuka"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_accessibility" msgid="7604615019302091708">"ulazak u postavke dijeljenja zvuka"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_message" msgid="4251807313264307426">"Muzika i videozapisi na uređaju će se reproducirati na oba para slušalica"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_title" msgid="4406818346036286793">"Dijelite zvuk"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_subtitle" msgid="3014906864710059236">"<xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g> i <xliff:g id="ACTIVE_DEVICE_NAME">%2$s</xliff:g>"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_switch_to_button" msgid="7546825655978203773">"Prebaci na <xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g>"</string>
<string name="quick_settings_bluetooth_secondary_label_battery_level" msgid="4182034939479344093">"<xliff:g id="BATTERY_LEVEL_AS_PERCENTAGE">%s</xliff:g> baterije"</string>
<string name="quick_settings_bluetooth_secondary_label_audio" msgid="780333390310051161">"Zvuk"</string>
<string name="quick_settings_bluetooth_secondary_label_headset" msgid="2332093067553000852">"Slušalice"</string>
@@ -672,10 +676,8 @@
<string name="stream_notification_unavailable" msgid="4313854556205836435">"Nedostupno zbog isključenog zvona"</string>
<string name="stream_alarm_unavailable" msgid="4059817189292197839">"Nedostupno jer je funkcija Ne ometaj uključena"</string>
<string name="stream_media_unavailable" msgid="6823020894438959853">"Nedostupno jer je funkcija Ne ometaj uključena"</string>
- <!-- no translation found for stream_unavailable_by_modes (3674139029490353683) -->
- <skip />
- <!-- no translation found for stream_unavailable_by_unknown (6908434629318171588) -->
- <skip />
+ <string name="stream_unavailable_by_modes" msgid="3674139029490353683">"Nije dostupno jer je način rada <xliff:g id="MODE">%s</xliff:g> uključen"</string>
+ <string name="stream_unavailable_by_unknown" msgid="6908434629318171588">"Nedostupno"</string>
<string name="volume_stream_content_description_unmute" msgid="7729576371406792977">"%1$s. Dodirnite da uključite zvukove."</string>
<string name="volume_stream_content_description_vibrate" msgid="4858111994183089761">"%1$s. Dodirnite za postavljanje vibracije. Zvukovi usluga pristupačnosti mogu biti isključeni."</string>
<string name="volume_stream_content_description_mute" msgid="4079046784917920984">"%1$s. Dodirnite da isključite zvuk. Zvukovi usluga pristupačnosti mogu biti isključeni."</string>
diff --git a/packages/SystemUI/res/values-ca/strings.xml b/packages/SystemUI/res/values-ca/strings.xml
index 0767849dd775..a836b97bfa79 100644
--- a/packages/SystemUI/res/values-ca/strings.xml
+++ b/packages/SystemUI/res/values-ca/strings.xml
@@ -312,6 +312,10 @@
<string name="quick_settings_bluetooth_audio_sharing_button" msgid="7545274861795853838">"Comparteix l\'àudio"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_sharing" msgid="3069309588231072128">"S\'està compartint l\'àudio"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_accessibility" msgid="7604615019302091708">"introduir la configuració de compartició d\'àudio"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_message" msgid="4251807313264307426">"La música i els vídeos d\'aquest dispositiu es reproduiran en tots dos parells d\'auriculars"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_title" msgid="4406818346036286793">"Comparteix l\'àudio"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_subtitle" msgid="3014906864710059236">"<xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g> i <xliff:g id="ACTIVE_DEVICE_NAME">%2$s</xliff:g>"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_switch_to_button" msgid="7546825655978203773">"Canvia a <xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g>"</string>
<string name="quick_settings_bluetooth_secondary_label_battery_level" msgid="4182034939479344093">"<xliff:g id="BATTERY_LEVEL_AS_PERCENTAGE">%s</xliff:g> de bateria"</string>
<string name="quick_settings_bluetooth_secondary_label_audio" msgid="780333390310051161">"Àudio"</string>
<string name="quick_settings_bluetooth_secondary_label_headset" msgid="2332093067553000852">"Auriculars"</string>
@@ -578,7 +582,7 @@
<string name="empty_shade_text" msgid="8935967157319717412">"No hi ha cap notificació"</string>
<string name="no_unseen_notif_text" msgid="395512586119868682">"No hi ha cap notificació nova"</string>
<string name="adaptive_notification_edu_hun_title" msgid="7790738150177329960">"La moderació de notificacions està activada"</string>
- <string name="adaptive_notification_edu_hun_text" msgid="7743367744129536610">"El volum i les alertes del dispositiu es redueixen automàticament durant 2 minuts quan reps massa notificacions alhora."</string>
+ <string name="adaptive_notification_edu_hun_text" msgid="7743367744129536610">"El volum i les alertes del dispositiu es redueixen automàticament durant 2 minuts com a màxim quan reps massa notificacions alhora."</string>
<string name="go_to_adaptive_notification_settings" msgid="2423690125178298479">"Desactiva"</string>
<string name="unlock_to_see_notif_text" msgid="7439033907167561227">"Desbloqueja per veure notif. anteriors"</string>
<string name="quick_settings_disclosure_parental_controls" msgid="2114102871438223600">"Els teus pares gestionen aquest dispositiu"</string>
@@ -672,10 +676,8 @@
<string name="stream_notification_unavailable" msgid="4313854556205836435">"No disponible perquè el so està silenciat"</string>
<string name="stream_alarm_unavailable" msgid="4059817189292197839">"No disponible perquè No molestis està activat"</string>
<string name="stream_media_unavailable" msgid="6823020894438959853">"No disponible perquè No molestis està activat"</string>
- <!-- no translation found for stream_unavailable_by_modes (3674139029490353683) -->
- <skip />
- <!-- no translation found for stream_unavailable_by_unknown (6908434629318171588) -->
- <skip />
+ <string name="stream_unavailable_by_modes" msgid="3674139029490353683">"No està disponible perquè <xliff:g id="MODE">%s</xliff:g> està activat"</string>
+ <string name="stream_unavailable_by_unknown" msgid="6908434629318171588">"No disponible"</string>
<string name="volume_stream_content_description_unmute" msgid="7729576371406792977">"%1$s. Toca per activar el so."</string>
<string name="volume_stream_content_description_vibrate" msgid="4858111994183089761">"%1$s. Toca per activar la vibració. Pot ser que els serveis d\'accessibilitat se silenciïn."</string>
<string name="volume_stream_content_description_mute" msgid="4079046784917920984">"%1$s. Toca per silenciar el so. Pot ser que els serveis d\'accessibilitat se silenciïn."</string>
diff --git a/packages/SystemUI/res/values-cs/strings.xml b/packages/SystemUI/res/values-cs/strings.xml
index c7ec42cea19e..70bdb6277343 100644
--- a/packages/SystemUI/res/values-cs/strings.xml
+++ b/packages/SystemUI/res/values-cs/strings.xml
@@ -312,6 +312,10 @@
<string name="quick_settings_bluetooth_audio_sharing_button" msgid="7545274861795853838">"Sdílet zvuk"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_sharing" msgid="3069309588231072128">"Zvuk se sdílí"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_accessibility" msgid="7604615019302091708">"přejdete do nastavení sdílení zvuku"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_message" msgid="4251807313264307426">"Hudba a videa z tohoto zařízení se budou přehrávat na obou párech sluchátek"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_title" msgid="4406818346036286793">"Sdílet zvuk"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_subtitle" msgid="3014906864710059236">"<xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g> a <xliff:g id="ACTIVE_DEVICE_NAME">%2$s</xliff:g>"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_switch_to_button" msgid="7546825655978203773">"Přepnout na <xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g>"</string>
<string name="quick_settings_bluetooth_secondary_label_battery_level" msgid="4182034939479344093">"Baterie: <xliff:g id="BATTERY_LEVEL_AS_PERCENTAGE">%s</xliff:g>"</string>
<string name="quick_settings_bluetooth_secondary_label_audio" msgid="780333390310051161">"Zvuk"</string>
<string name="quick_settings_bluetooth_secondary_label_headset" msgid="2332093067553000852">"Sluchátka"</string>
@@ -672,10 +676,8 @@
<string name="stream_notification_unavailable" msgid="4313854556205836435">"Nedostupné, protože vyzvánění je ztlumené"</string>
<string name="stream_alarm_unavailable" msgid="4059817189292197839">"Nedostupné, protože je zapnutý režim Nerušit"</string>
<string name="stream_media_unavailable" msgid="6823020894438959853">"Nedostupné – je zapnutý režim Nerušit"</string>
- <!-- no translation found for stream_unavailable_by_modes (3674139029490353683) -->
- <skip />
- <!-- no translation found for stream_unavailable_by_unknown (6908434629318171588) -->
- <skip />
+ <string name="stream_unavailable_by_modes" msgid="3674139029490353683">"Nedostupné, protože je zapnutý režim <xliff:g id="MODE">%s</xliff:g>"</string>
+ <string name="stream_unavailable_by_unknown" msgid="6908434629318171588">"Nedostupné"</string>
<string name="volume_stream_content_description_unmute" msgid="7729576371406792977">"%1$s. Klepnutím zapnete zvuk."</string>
<string name="volume_stream_content_description_vibrate" msgid="4858111994183089761">"%1$s. Klepnutím aktivujete režim vibrací. Služby přístupnosti mohou být ztlumeny."</string>
<string name="volume_stream_content_description_mute" msgid="4079046784917920984">"%1$s. Klepnutím vypnete zvuk. Služby přístupnosti mohou být ztlumeny."</string>
@@ -934,8 +936,8 @@
<string name="accessibility_qs_edit_tile_add_to_position" msgid="9029163095148274690">"Přidat dlaždici na pozici <xliff:g id="POSITION">%1$d</xliff:g>"</string>
<string name="accessibilit_qs_edit_tile_add_move_invalid_position" msgid="2858467994472624487">"Pozice není platná."</string>
<string name="accessibility_qs_edit_position" msgid="4509277359815711830">"Pozice <xliff:g id="POSITION">%1$d</xliff:g>"</string>
- <string name="accessibility_qs_edit_tile_added" msgid="9067146040380836334">"Karta byla přidána"</string>
- <string name="accessibility_qs_edit_tile_removed" msgid="1175925632436612036">"Karta byla odstraněna"</string>
+ <string name="accessibility_qs_edit_tile_added" msgid="9067146040380836334">"Dlaždice byla přidána"</string>
+ <string name="accessibility_qs_edit_tile_removed" msgid="1175925632436612036">"Dlaždice byla odstraněna"</string>
<string name="accessibility_desc_quick_settings_edit" msgid="741658939453595297">"Editor rychlého nastavení"</string>
<string name="accessibility_desc_notification_icon" msgid="7331265967584178674">"Oznámení aplikace <xliff:g id="ID_1">%1$s</xliff:g>: <xliff:g id="ID_2">%2$s</xliff:g>"</string>
<string name="accessibility_quick_settings_settings" msgid="7098489591715844713">"Otevřít nastavení."</string>
diff --git a/packages/SystemUI/res/values-da/strings.xml b/packages/SystemUI/res/values-da/strings.xml
index b5220d6f526f..eeece4c4395b 100644
--- a/packages/SystemUI/res/values-da/strings.xml
+++ b/packages/SystemUI/res/values-da/strings.xml
@@ -312,6 +312,10 @@
<string name="quick_settings_bluetooth_audio_sharing_button" msgid="7545274861795853838">"Del lyd"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_sharing" msgid="3069309588231072128">"Deler lyd"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_accessibility" msgid="7604615019302091708">"angive indstillinger for lyddeling"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_message" msgid="4251807313264307426">"Musik og videoer fra denne enhed afspilles på begge par høretelefoner"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_title" msgid="4406818346036286793">"Del din lyd"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_subtitle" msgid="3014906864710059236">"<xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g> og <xliff:g id="ACTIVE_DEVICE_NAME">%2$s</xliff:g>"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_switch_to_button" msgid="7546825655978203773">"Skift til <xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g>"</string>
<string name="quick_settings_bluetooth_secondary_label_battery_level" msgid="4182034939479344093">"<xliff:g id="BATTERY_LEVEL_AS_PERCENTAGE">%s</xliff:g> batteri"</string>
<string name="quick_settings_bluetooth_secondary_label_audio" msgid="780333390310051161">"Lyd"</string>
<string name="quick_settings_bluetooth_secondary_label_headset" msgid="2332093067553000852">"Headset"</string>
@@ -672,10 +676,8 @@
<string name="stream_notification_unavailable" msgid="4313854556205836435">"Ikke muligt, da ringetonen er slået fra"</string>
<string name="stream_alarm_unavailable" msgid="4059817189292197839">"Ikke tilgængelig, fordi Forstyr ikke er aktiveret"</string>
<string name="stream_media_unavailable" msgid="6823020894438959853">"Ikke tilgængelig, fordi Forstyr ikke er aktiveret"</string>
- <!-- no translation found for stream_unavailable_by_modes (3674139029490353683) -->
- <skip />
- <!-- no translation found for stream_unavailable_by_unknown (6908434629318171588) -->
- <skip />
+ <string name="stream_unavailable_by_modes" msgid="3674139029490353683">"Ikke tilgængelig, fordi <xliff:g id="MODE">%s</xliff:g> er aktiveret"</string>
+ <string name="stream_unavailable_by_unknown" msgid="6908434629318171588">"Ikke tilgængelig"</string>
<string name="volume_stream_content_description_unmute" msgid="7729576371406792977">"%1$s. Tryk for at slå lyden til."</string>
<string name="volume_stream_content_description_vibrate" msgid="4858111994183089761">"%1$s. Tryk for at konfigurere til at vibrere. Tilgængelighedstjenester kan blive deaktiveret."</string>
<string name="volume_stream_content_description_mute" msgid="4079046784917920984">"%1$s. Tryk for at slå lyden fra. Lyden i tilgængelighedstjenester kan blive slået fra."</string>
diff --git a/packages/SystemUI/res/values-de/strings.xml b/packages/SystemUI/res/values-de/strings.xml
index 9367d40fd67e..95703148499b 100644
--- a/packages/SystemUI/res/values-de/strings.xml
+++ b/packages/SystemUI/res/values-de/strings.xml
@@ -312,6 +312,10 @@
<string name="quick_settings_bluetooth_audio_sharing_button" msgid="7545274861795853838">"Audioinhalte freigeben"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_sharing" msgid="3069309588231072128">"Audioinhalte werden freigegeben"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_accessibility" msgid="7604615019302091708">"Einstellungen für die Audiofreigabe eingeben"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_message" msgid="4251807313264307426">"Musik und Videos auf diesem Gerät werden auf beiden Kopfhörerpaaren abgespielt"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_title" msgid="4406818346036286793">"Audioinhalte freigeben"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_subtitle" msgid="3014906864710059236">"<xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g> und <xliff:g id="ACTIVE_DEVICE_NAME">%2$s</xliff:g>"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_switch_to_button" msgid="7546825655978203773">"Zu <xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g> wechseln"</string>
<string name="quick_settings_bluetooth_secondary_label_battery_level" msgid="4182034939479344093">"Akkustand: <xliff:g id="BATTERY_LEVEL_AS_PERCENTAGE">%s</xliff:g>"</string>
<string name="quick_settings_bluetooth_secondary_label_audio" msgid="780333390310051161">"Audio"</string>
<string name="quick_settings_bluetooth_secondary_label_headset" msgid="2332093067553000852">"Headset"</string>
@@ -440,8 +444,7 @@
<string name="zen_mode_on" msgid="9085304934016242591">"An"</string>
<string name="zen_mode_on_with_details" msgid="7416143430557895497">"An • <xliff:g id="TRIGGER_DESCRIPTION">%1$s</xliff:g>"</string>
<string name="zen_mode_off" msgid="1736604456618147306">"Aus"</string>
- <!-- no translation found for zen_mode_set_up (8231201163894922821) -->
- <skip />
+ <string name="zen_mode_set_up" msgid="8231201163894922821">"Nicht festgelegt"</string>
<string name="zen_mode_no_manual_invocation" msgid="1769975741344633672">"In den Einstellungen verwalten"</string>
<string name="zen_mode_active_modes" msgid="1625850411578488856">"{count,plural, =0{Keine aktiven Modi}=1{{mode} aktiv}other{# aktiv}}"</string>
<string name="zen_priority_introduction" msgid="3159291973383796646">"Klingeltöne und die Vibration werden deaktiviert, außer für Weckrufe, Erinnerungen, Termine sowie Anrufe von zuvor von dir festgelegten Personen. Du hörst jedoch weiterhin Sound, wenn du dir Musik anhörst, Videos ansiehst oder Spiele spielst."</string>
@@ -673,10 +676,8 @@
<string name="stream_notification_unavailable" msgid="4313854556205836435">"Nicht verfügbar, da Klingelton stumm"</string>
<string name="stream_alarm_unavailable" msgid="4059817189292197839">"Nicht verfügbar, weil „Bitte nicht stören“ an ist"</string>
<string name="stream_media_unavailable" msgid="6823020894438959853">"Nicht verfügbar, weil „Bitte nicht stören“ an"</string>
- <!-- no translation found for stream_unavailable_by_modes (3674139029490353683) -->
- <skip />
- <!-- no translation found for stream_unavailable_by_unknown (6908434629318171588) -->
- <skip />
+ <string name="stream_unavailable_by_modes" msgid="3674139029490353683">"Nicht verfügbar, weil <xliff:g id="MODE">%s</xliff:g> aktiviert ist"</string>
+ <string name="stream_unavailable_by_unknown" msgid="6908434629318171588">"Nicht verfügbar"</string>
<string name="volume_stream_content_description_unmute" msgid="7729576371406792977">"%1$s. Zum Aufheben der Stummschaltung tippen."</string>
<string name="volume_stream_content_description_vibrate" msgid="4858111994183089761">"%1$s. Tippen, um Vibrieren festzulegen. Bedienungshilfen werden unter Umständen stummgeschaltet."</string>
<string name="volume_stream_content_description_mute" msgid="4079046784917920984">"%1$s. Zum Stummschalten tippen. Bedienungshilfen werden unter Umständen stummgeschaltet."</string>
@@ -1410,38 +1411,26 @@
<string name="launch_touchpad_tutorial_notification_content" msgid="7931085031240753226">"Informationen zu Touchpad-Gesten"</string>
<string name="launch_keyboard_touchpad_tutorial_notification_title" msgid="1940023776496198762">"Navigation mit Tastatur und Touchpad"</string>
<string name="launch_keyboard_touchpad_tutorial_notification_content" msgid="1780725168171929365">"Informationen zu Touchpad-Gesten, Tastenkombinationen und mehr"</string>
- <!-- no translation found for touchpad_tutorial_back_gesture_button (3104716365403620315) -->
- <skip />
- <!-- no translation found for touchpad_tutorial_home_gesture_button (8023973153559885624) -->
- <skip />
+ <string name="touchpad_tutorial_back_gesture_button" msgid="3104716365403620315">"Zurück"</string>
+ <string name="touchpad_tutorial_home_gesture_button" msgid="8023973153559885624">"Zur Startseite"</string>
<string name="touchpad_tutorial_recent_apps_gesture_button" msgid="8919227647650347359">"Letzte Apps aufrufen"</string>
<string name="touchpad_tutorial_done_button" msgid="176168488821755503">"Fertig"</string>
<string name="touchpad_back_gesture_action_title" msgid="7199067250654332735">"Zurück"</string>
- <!-- no translation found for touchpad_back_gesture_guidance (5352221087725906542) -->
- <skip />
- <!-- no translation found for touchpad_back_gesture_success_title (7370719098633023496) -->
- <skip />
+ <string name="touchpad_back_gesture_guidance" msgid="5352221087725906542">"Wische mit drei Fingern auf dem Touchpad nach links oder rechts"</string>
+ <string name="touchpad_back_gesture_success_title" msgid="7370719098633023496">"Sehr gut!"</string>
<string name="touchpad_back_gesture_success_body" msgid="2324724953720741719">"Du hast den Schritt für die „Zurück“-Geste abgeschlossen."</string>
<string name="touchpad_home_gesture_action_title" msgid="8885107349719257882">"Startbildschirm"</string>
- <!-- no translation found for touchpad_home_gesture_guidance (4178219118381915899) -->
- <skip />
- <!-- no translation found for touchpad_home_gesture_success_title (3648264553645798470) -->
- <skip />
- <!-- no translation found for touchpad_home_gesture_success_body (2590690589194027059) -->
- <skip />
+ <string name="touchpad_home_gesture_guidance" msgid="4178219118381915899">"Wische an einer beliebigen Stelle auf dem Touchpad mit drei Fingern nach oben"</string>
+ <string name="touchpad_home_gesture_success_title" msgid="3648264553645798470">"Gut gemacht!"</string>
+ <string name="touchpad_home_gesture_success_body" msgid="2590690589194027059">"Du hast den Schritt für die „Startbildschirm“-Touch-Geste abgeschlossen"</string>
<string name="touchpad_recent_apps_gesture_action_title" msgid="934906836867137906">"Letzte Apps aufrufen"</string>
- <!-- no translation found for touchpad_recent_apps_gesture_guidance (6304446013842271822) -->
- <skip />
+ <string name="touchpad_recent_apps_gesture_guidance" msgid="6304446013842271822">"Wische mit drei Fingern nach oben und halte das Touchpad gedrückt"</string>
<string name="touchpad_recent_apps_gesture_success_title" msgid="8481920554139332593">"Gut gemacht!"</string>
<string name="touchpad_recent_apps_gesture_success_body" msgid="4334263906697493273">"Du hast das Tutorial für die Touch-Geste zum Aufrufen der zuletzt verwendeten Apps abgeschlossen."</string>
- <!-- no translation found for tutorial_action_key_title (8172535792469008169) -->
- <skip />
- <!-- no translation found for tutorial_action_key_guidance (5040613427202799294) -->
- <skip />
- <!-- no translation found for tutorial_action_key_success_title (2371827347071979571) -->
- <skip />
- <!-- no translation found for tutorial_action_key_success_body (1688986269491357832) -->
- <skip />
+ <string name="tutorial_action_key_title" msgid="8172535792469008169">"Alle Apps anzeigen"</string>
+ <string name="tutorial_action_key_guidance" msgid="5040613427202799294">"Drücke die Aktionstaste auf deiner Tastatur"</string>
+ <string name="tutorial_action_key_success_title" msgid="2371827347071979571">"Perfekt!"</string>
+ <string name="tutorial_action_key_success_body" msgid="1688986269491357832">"Du hast das Tutorial für die Touch-Geste zum Aufrufen aller Apps abgeschlossen"</string>
<string name="keyboard_backlight_dialog_title" msgid="8273102932345564724">"Tastaturbeleuchtung"</string>
<string name="keyboard_backlight_value" msgid="7336398765584393538">"Level %1$d von %2$d"</string>
<string name="home_controls_dream_label" msgid="6567105701292324257">"Smart-Home-Steuerung"</string>
diff --git a/packages/SystemUI/res/values-el/strings.xml b/packages/SystemUI/res/values-el/strings.xml
index 18b99aae6723..5551740f67d7 100644
--- a/packages/SystemUI/res/values-el/strings.xml
+++ b/packages/SystemUI/res/values-el/strings.xml
@@ -312,6 +312,10 @@
<string name="quick_settings_bluetooth_audio_sharing_button" msgid="7545274861795853838">"Κοινή χρήση ήχου"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_sharing" msgid="3069309588231072128">"Κοινή χρήση ήχου σε εξέλιξη"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_accessibility" msgid="7604615019302091708">"είσοδο στις ρυθμίσεις κοινής χρήσης ήχου"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_message" msgid="4251807313264307426">"Η μουσική και τα βίντεο αυτής της συσκευής θα αναπαράγονται και στα δύο ζευγάρια ακουστικών"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_title" msgid="4406818346036286793">"Κοινή χρήση του ήχου σας"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_subtitle" msgid="3014906864710059236">"<xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g> και <xliff:g id="ACTIVE_DEVICE_NAME">%2$s</xliff:g>"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_switch_to_button" msgid="7546825655978203773">"Εναλλαγή σε <xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g>"</string>
<string name="quick_settings_bluetooth_secondary_label_battery_level" msgid="4182034939479344093">"Μπαταρία <xliff:g id="BATTERY_LEVEL_AS_PERCENTAGE">%s</xliff:g>"</string>
<string name="quick_settings_bluetooth_secondary_label_audio" msgid="780333390310051161">"Ήχος"</string>
<string name="quick_settings_bluetooth_secondary_label_headset" msgid="2332093067553000852">"Ακουστικά"</string>
@@ -672,10 +676,8 @@
<string name="stream_notification_unavailable" msgid="4313854556205836435">"Μη διαθέσιμο λόγω σίγασης ήχου κλήσης"</string>
<string name="stream_alarm_unavailable" msgid="4059817189292197839">"Μη διαθ. επειδή η λειτ. Μην ενοχλείτε είναι ενεργή"</string>
<string name="stream_media_unavailable" msgid="6823020894438959853">"Μη διαθ. επειδή η λειτ. Μην ενοχλείτε είναι ενεργή"</string>
- <!-- no translation found for stream_unavailable_by_modes (3674139029490353683) -->
- <skip />
- <!-- no translation found for stream_unavailable_by_unknown (6908434629318171588) -->
- <skip />
+ <string name="stream_unavailable_by_modes" msgid="3674139029490353683">"Δεν διατίθεται επειδή η λειτουργία <xliff:g id="MODE">%s</xliff:g> είναι ενεργή"</string>
+ <string name="stream_unavailable_by_unknown" msgid="6908434629318171588">"Δεν διατίθεται"</string>
<string name="volume_stream_content_description_unmute" msgid="7729576371406792977">"%1$s. Πατήστε για κατάργηση σίγασης."</string>
<string name="volume_stream_content_description_vibrate" msgid="4858111994183089761">"%1$s. Πατήστε για ενεργοποιήσετε τη δόνηση. Οι υπηρεσίες προσβασιμότητας ενδέχεται να τεθούν σε σίγαση."</string>
<string name="volume_stream_content_description_mute" msgid="4079046784917920984">"%1$s. Πατήστε για σίγαση. Οι υπηρεσίες προσβασιμότητας ενδέχεται να τεθούν σε σίγαση."</string>
diff --git a/packages/SystemUI/res/values-en-rAU/strings.xml b/packages/SystemUI/res/values-en-rAU/strings.xml
index ba945f229051..df9d2103b783 100644
--- a/packages/SystemUI/res/values-en-rAU/strings.xml
+++ b/packages/SystemUI/res/values-en-rAU/strings.xml
@@ -312,6 +312,10 @@
<string name="quick_settings_bluetooth_audio_sharing_button" msgid="7545274861795853838">"Share audio"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_sharing" msgid="3069309588231072128">"Sharing audio"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_accessibility" msgid="7604615019302091708">"enter audio sharing settings"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_message" msgid="4251807313264307426">"This device\'s music and videos will play on both pairs of headphones"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_title" msgid="4406818346036286793">"Share your audio"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_subtitle" msgid="3014906864710059236">"<xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g> and <xliff:g id="ACTIVE_DEVICE_NAME">%2$s</xliff:g>"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_switch_to_button" msgid="7546825655978203773">"Switch to <xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g>"</string>
<string name="quick_settings_bluetooth_secondary_label_battery_level" msgid="4182034939479344093">"<xliff:g id="BATTERY_LEVEL_AS_PERCENTAGE">%s</xliff:g> battery"</string>
<string name="quick_settings_bluetooth_secondary_label_audio" msgid="780333390310051161">"Audio"</string>
<string name="quick_settings_bluetooth_secondary_label_headset" msgid="2332093067553000852">"Headset"</string>
@@ -672,10 +676,8 @@
<string name="stream_notification_unavailable" msgid="4313854556205836435">"Unavailable because ring is muted"</string>
<string name="stream_alarm_unavailable" msgid="4059817189292197839">"Unavailable because Do Not Disturb is on"</string>
<string name="stream_media_unavailable" msgid="6823020894438959853">"Unavailable because Do Not Disturb is on"</string>
- <!-- no translation found for stream_unavailable_by_modes (3674139029490353683) -->
- <skip />
- <!-- no translation found for stream_unavailable_by_unknown (6908434629318171588) -->
- <skip />
+ <string name="stream_unavailable_by_modes" msgid="3674139029490353683">"Unavailable because <xliff:g id="MODE">%s</xliff:g> is on"</string>
+ <string name="stream_unavailable_by_unknown" msgid="6908434629318171588">"Unavailable"</string>
<string name="volume_stream_content_description_unmute" msgid="7729576371406792977">"%1$s. Tap to unmute."</string>
<string name="volume_stream_content_description_vibrate" msgid="4858111994183089761">"%1$s. Tap to set to vibrate. Accessibility services may be muted."</string>
<string name="volume_stream_content_description_mute" msgid="4079046784917920984">"%1$s. Tap to mute. Accessibility services may be muted."</string>
diff --git a/packages/SystemUI/res/values-en-rCA/strings.xml b/packages/SystemUI/res/values-en-rCA/strings.xml
index a26d1611f825..28cb9a311f5f 100644
--- a/packages/SystemUI/res/values-en-rCA/strings.xml
+++ b/packages/SystemUI/res/values-en-rCA/strings.xml
@@ -312,6 +312,10 @@
<string name="quick_settings_bluetooth_audio_sharing_button" msgid="7545274861795853838">"Share audio"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_sharing" msgid="3069309588231072128">"Sharing audio"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_accessibility" msgid="7604615019302091708">"enter audio sharing settings"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_message" msgid="4251807313264307426">"This device\'s music and videos will play on both pairs of headphones"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_title" msgid="4406818346036286793">"Share your audio"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_subtitle" msgid="3014906864710059236">"<xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g> and <xliff:g id="ACTIVE_DEVICE_NAME">%2$s</xliff:g>"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_switch_to_button" msgid="7546825655978203773">"Switch to <xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g>"</string>
<string name="quick_settings_bluetooth_secondary_label_battery_level" msgid="4182034939479344093">"<xliff:g id="BATTERY_LEVEL_AS_PERCENTAGE">%s</xliff:g> battery"</string>
<string name="quick_settings_bluetooth_secondary_label_audio" msgid="780333390310051161">"Audio"</string>
<string name="quick_settings_bluetooth_secondary_label_headset" msgid="2332093067553000852">"Headset"</string>
@@ -672,10 +676,8 @@
<string name="stream_notification_unavailable" msgid="4313854556205836435">"Unavailable because ring is muted"</string>
<string name="stream_alarm_unavailable" msgid="4059817189292197839">"Unavailable because Do Not Disturb is on"</string>
<string name="stream_media_unavailable" msgid="6823020894438959853">"Unavailable because Do Not Disturb is on"</string>
- <!-- no translation found for stream_unavailable_by_modes (3674139029490353683) -->
- <skip />
- <!-- no translation found for stream_unavailable_by_unknown (6908434629318171588) -->
- <skip />
+ <string name="stream_unavailable_by_modes" msgid="3674139029490353683">"Unavailable because <xliff:g id="MODE">%s</xliff:g> is on"</string>
+ <string name="stream_unavailable_by_unknown" msgid="6908434629318171588">"Unavailable"</string>
<string name="volume_stream_content_description_unmute" msgid="7729576371406792977">"%1$s. Tap to unmute."</string>
<string name="volume_stream_content_description_vibrate" msgid="4858111994183089761">"%1$s. Tap to set to vibrate. Accessibility services may be muted."</string>
<string name="volume_stream_content_description_mute" msgid="4079046784917920984">"%1$s. Tap to mute. Accessibility services may be muted."</string>
diff --git a/packages/SystemUI/res/values-en-rGB/strings.xml b/packages/SystemUI/res/values-en-rGB/strings.xml
index ba945f229051..df9d2103b783 100644
--- a/packages/SystemUI/res/values-en-rGB/strings.xml
+++ b/packages/SystemUI/res/values-en-rGB/strings.xml
@@ -312,6 +312,10 @@
<string name="quick_settings_bluetooth_audio_sharing_button" msgid="7545274861795853838">"Share audio"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_sharing" msgid="3069309588231072128">"Sharing audio"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_accessibility" msgid="7604615019302091708">"enter audio sharing settings"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_message" msgid="4251807313264307426">"This device\'s music and videos will play on both pairs of headphones"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_title" msgid="4406818346036286793">"Share your audio"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_subtitle" msgid="3014906864710059236">"<xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g> and <xliff:g id="ACTIVE_DEVICE_NAME">%2$s</xliff:g>"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_switch_to_button" msgid="7546825655978203773">"Switch to <xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g>"</string>
<string name="quick_settings_bluetooth_secondary_label_battery_level" msgid="4182034939479344093">"<xliff:g id="BATTERY_LEVEL_AS_PERCENTAGE">%s</xliff:g> battery"</string>
<string name="quick_settings_bluetooth_secondary_label_audio" msgid="780333390310051161">"Audio"</string>
<string name="quick_settings_bluetooth_secondary_label_headset" msgid="2332093067553000852">"Headset"</string>
@@ -672,10 +676,8 @@
<string name="stream_notification_unavailable" msgid="4313854556205836435">"Unavailable because ring is muted"</string>
<string name="stream_alarm_unavailable" msgid="4059817189292197839">"Unavailable because Do Not Disturb is on"</string>
<string name="stream_media_unavailable" msgid="6823020894438959853">"Unavailable because Do Not Disturb is on"</string>
- <!-- no translation found for stream_unavailable_by_modes (3674139029490353683) -->
- <skip />
- <!-- no translation found for stream_unavailable_by_unknown (6908434629318171588) -->
- <skip />
+ <string name="stream_unavailable_by_modes" msgid="3674139029490353683">"Unavailable because <xliff:g id="MODE">%s</xliff:g> is on"</string>
+ <string name="stream_unavailable_by_unknown" msgid="6908434629318171588">"Unavailable"</string>
<string name="volume_stream_content_description_unmute" msgid="7729576371406792977">"%1$s. Tap to unmute."</string>
<string name="volume_stream_content_description_vibrate" msgid="4858111994183089761">"%1$s. Tap to set to vibrate. Accessibility services may be muted."</string>
<string name="volume_stream_content_description_mute" msgid="4079046784917920984">"%1$s. Tap to mute. Accessibility services may be muted."</string>
diff --git a/packages/SystemUI/res/values-en-rIN/strings.xml b/packages/SystemUI/res/values-en-rIN/strings.xml
index ba945f229051..df9d2103b783 100644
--- a/packages/SystemUI/res/values-en-rIN/strings.xml
+++ b/packages/SystemUI/res/values-en-rIN/strings.xml
@@ -312,6 +312,10 @@
<string name="quick_settings_bluetooth_audio_sharing_button" msgid="7545274861795853838">"Share audio"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_sharing" msgid="3069309588231072128">"Sharing audio"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_accessibility" msgid="7604615019302091708">"enter audio sharing settings"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_message" msgid="4251807313264307426">"This device\'s music and videos will play on both pairs of headphones"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_title" msgid="4406818346036286793">"Share your audio"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_subtitle" msgid="3014906864710059236">"<xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g> and <xliff:g id="ACTIVE_DEVICE_NAME">%2$s</xliff:g>"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_switch_to_button" msgid="7546825655978203773">"Switch to <xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g>"</string>
<string name="quick_settings_bluetooth_secondary_label_battery_level" msgid="4182034939479344093">"<xliff:g id="BATTERY_LEVEL_AS_PERCENTAGE">%s</xliff:g> battery"</string>
<string name="quick_settings_bluetooth_secondary_label_audio" msgid="780333390310051161">"Audio"</string>
<string name="quick_settings_bluetooth_secondary_label_headset" msgid="2332093067553000852">"Headset"</string>
@@ -672,10 +676,8 @@
<string name="stream_notification_unavailable" msgid="4313854556205836435">"Unavailable because ring is muted"</string>
<string name="stream_alarm_unavailable" msgid="4059817189292197839">"Unavailable because Do Not Disturb is on"</string>
<string name="stream_media_unavailable" msgid="6823020894438959853">"Unavailable because Do Not Disturb is on"</string>
- <!-- no translation found for stream_unavailable_by_modes (3674139029490353683) -->
- <skip />
- <!-- no translation found for stream_unavailable_by_unknown (6908434629318171588) -->
- <skip />
+ <string name="stream_unavailable_by_modes" msgid="3674139029490353683">"Unavailable because <xliff:g id="MODE">%s</xliff:g> is on"</string>
+ <string name="stream_unavailable_by_unknown" msgid="6908434629318171588">"Unavailable"</string>
<string name="volume_stream_content_description_unmute" msgid="7729576371406792977">"%1$s. Tap to unmute."</string>
<string name="volume_stream_content_description_vibrate" msgid="4858111994183089761">"%1$s. Tap to set to vibrate. Accessibility services may be muted."</string>
<string name="volume_stream_content_description_mute" msgid="4079046784917920984">"%1$s. Tap to mute. Accessibility services may be muted."</string>
diff --git a/packages/SystemUI/res/values-es-rUS/strings.xml b/packages/SystemUI/res/values-es-rUS/strings.xml
index 0620cc3fa068..e39b2a48f9ee 100644
--- a/packages/SystemUI/res/values-es-rUS/strings.xml
+++ b/packages/SystemUI/res/values-es-rUS/strings.xml
@@ -312,6 +312,10 @@
<string name="quick_settings_bluetooth_audio_sharing_button" msgid="7545274861795853838">"Compartir audio"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_sharing" msgid="3069309588231072128">"Compartiendo audio"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_accessibility" msgid="7604615019302091708">"ingresar la configuración de uso compartido de audio"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_message" msgid="4251807313264307426">"La música y los videos de este dispositivo se reproducirán en ambos pares de auriculares"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_title" msgid="4406818346036286793">"Comparte tu audio"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_subtitle" msgid="3014906864710059236">"<xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g> y <xliff:g id="ACTIVE_DEVICE_NAME">%2$s</xliff:g>"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_switch_to_button" msgid="7546825655978203773">"Cambiar a <xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g>"</string>
<string name="quick_settings_bluetooth_secondary_label_battery_level" msgid="4182034939479344093">"<xliff:g id="BATTERY_LEVEL_AS_PERCENTAGE">%s</xliff:g> de batería"</string>
<string name="quick_settings_bluetooth_secondary_label_audio" msgid="780333390310051161">"Audio"</string>
<string name="quick_settings_bluetooth_secondary_label_headset" msgid="2332093067553000852">"Auriculares"</string>
@@ -440,8 +444,7 @@
<string name="zen_mode_on" msgid="9085304934016242591">"Activado"</string>
<string name="zen_mode_on_with_details" msgid="7416143430557895497">"Sí • <xliff:g id="TRIGGER_DESCRIPTION">%1$s</xliff:g>"</string>
<string name="zen_mode_off" msgid="1736604456618147306">"Desactivado"</string>
- <!-- no translation found for zen_mode_set_up (8231201163894922821) -->
- <skip />
+ <string name="zen_mode_set_up" msgid="8231201163894922821">"Sin establecer"</string>
<string name="zen_mode_no_manual_invocation" msgid="1769975741344633672">"Administrar en configuración"</string>
<string name="zen_mode_active_modes" msgid="1625850411578488856">"{count,plural, =0{No hay modos activos}=1{{mode} está activo}many{# de modos están activos}other{# modos están activos}}"</string>
<string name="zen_priority_introduction" msgid="3159291973383796646">"No te molestarán los sonidos ni las vibraciones, excepto las alarmas, los recordatorios, los eventos y las llamadas de los emisores que especifiques. Podrás escuchar el contenido que reproduzcas, como música, videos y juegos."</string>
@@ -673,10 +676,8 @@
<string name="stream_notification_unavailable" msgid="4313854556205836435">"No disponible por timbre silenciado"</string>
<string name="stream_alarm_unavailable" msgid="4059817189292197839">"No disponible si está activado No interrumpir"</string>
<string name="stream_media_unavailable" msgid="6823020894438959853">"No disponible si está activado No interrumpir"</string>
- <!-- no translation found for stream_unavailable_by_modes (3674139029490353683) -->
- <skip />
- <!-- no translation found for stream_unavailable_by_unknown (6908434629318171588) -->
- <skip />
+ <string name="stream_unavailable_by_modes" msgid="3674139029490353683">"No disponible porque se activó <xliff:g id="MODE">%s</xliff:g>"</string>
+ <string name="stream_unavailable_by_unknown" msgid="6908434629318171588">"No disponible"</string>
<string name="volume_stream_content_description_unmute" msgid="7729576371406792977">"%1$s. Presiona para dejar de silenciar."</string>
<string name="volume_stream_content_description_vibrate" msgid="4858111994183089761">"%1$s. Presiona para establecer el modo vibración. Es posible que los servicios de accesibilidad estén silenciados."</string>
<string name="volume_stream_content_description_mute" msgid="4079046784917920984">"%1$s. Presiona para silenciar. Es posible que los servicios de accesibilidad estén silenciados."</string>
@@ -1410,38 +1411,26 @@
<string name="launch_touchpad_tutorial_notification_content" msgid="7931085031240753226">"Aprende los gestos del panel táctil"</string>
<string name="launch_keyboard_touchpad_tutorial_notification_title" msgid="1940023776496198762">"Navega con el teclado y el panel táctil"</string>
<string name="launch_keyboard_touchpad_tutorial_notification_content" msgid="1780725168171929365">"Aprende sobre los gestos del panel táctil, las combinaciones de teclas y mucho más"</string>
- <!-- no translation found for touchpad_tutorial_back_gesture_button (3104716365403620315) -->
- <skip />
- <!-- no translation found for touchpad_tutorial_home_gesture_button (8023973153559885624) -->
- <skip />
+ <string name="touchpad_tutorial_back_gesture_button" msgid="3104716365403620315">"Atrás"</string>
+ <string name="touchpad_tutorial_home_gesture_button" msgid="8023973153559885624">"Ir a la página de inicio"</string>
<string name="touchpad_tutorial_recent_apps_gesture_button" msgid="8919227647650347359">"Ver apps recientes"</string>
<string name="touchpad_tutorial_done_button" msgid="176168488821755503">"Listo"</string>
<string name="touchpad_back_gesture_action_title" msgid="7199067250654332735">"Atrás"</string>
- <!-- no translation found for touchpad_back_gesture_guidance (5352221087725906542) -->
- <skip />
- <!-- no translation found for touchpad_back_gesture_success_title (7370719098633023496) -->
- <skip />
+ <string name="touchpad_back_gesture_guidance" msgid="5352221087725906542">"Desliza hacia la izquierda o la derecha con tres dedos en el panel táctil"</string>
+ <string name="touchpad_back_gesture_success_title" msgid="7370719098633023496">"¡Muy bien!"</string>
<string name="touchpad_back_gesture_success_body" msgid="2324724953720741719">"Completaste el gesto para ir atrás."</string>
<string name="touchpad_home_gesture_action_title" msgid="8885107349719257882">"Ir a la página principal"</string>
- <!-- no translation found for touchpad_home_gesture_guidance (4178219118381915899) -->
- <skip />
- <!-- no translation found for touchpad_home_gesture_success_title (3648264553645798470) -->
- <skip />
- <!-- no translation found for touchpad_home_gesture_success_body (2590690589194027059) -->
- <skip />
+ <string name="touchpad_home_gesture_guidance" msgid="4178219118381915899">"Desliza hacia arriba con tres dedos en el panel táctil"</string>
+ <string name="touchpad_home_gesture_success_title" msgid="3648264553645798470">"¡Bien hecho!"</string>
+ <string name="touchpad_home_gesture_success_body" msgid="2590690589194027059">"Completaste el gesto para ir a la página principal"</string>
<string name="touchpad_recent_apps_gesture_action_title" msgid="934906836867137906">"Ver apps recientes"</string>
- <!-- no translation found for touchpad_recent_apps_gesture_guidance (6304446013842271822) -->
- <skip />
+ <string name="touchpad_recent_apps_gesture_guidance" msgid="6304446013842271822">"Desliza hacia arriba con tres dedos en el panel táctil y mantenlos presionados."</string>
<string name="touchpad_recent_apps_gesture_success_title" msgid="8481920554139332593">"¡Bien hecho!"</string>
<string name="touchpad_recent_apps_gesture_success_body" msgid="4334263906697493273">"Completaste el gesto para ver las apps recientes."</string>
- <!-- no translation found for tutorial_action_key_title (8172535792469008169) -->
- <skip />
- <!-- no translation found for tutorial_action_key_guidance (5040613427202799294) -->
- <skip />
- <!-- no translation found for tutorial_action_key_success_title (2371827347071979571) -->
- <skip />
- <!-- no translation found for tutorial_action_key_success_body (1688986269491357832) -->
- <skip />
+ <string name="tutorial_action_key_title" msgid="8172535792469008169">"Ver todas las apps"</string>
+ <string name="tutorial_action_key_guidance" msgid="5040613427202799294">"Presiona la tecla de acción en el teclado"</string>
+ <string name="tutorial_action_key_success_title" msgid="2371827347071979571">"¡Bien hecho!"</string>
+ <string name="tutorial_action_key_success_body" msgid="1688986269491357832">"Completaste el gesto para ver todas las apps"</string>
<string name="keyboard_backlight_dialog_title" msgid="8273102932345564724">"Retroiluminación del teclado"</string>
<string name="keyboard_backlight_value" msgid="7336398765584393538">"Nivel %1$d de %2$d"</string>
<string name="home_controls_dream_label" msgid="6567105701292324257">"Controles de la casa"</string>
diff --git a/packages/SystemUI/res/values-es/strings.xml b/packages/SystemUI/res/values-es/strings.xml
index c10fc7ad17bf..6d77be4ff7cc 100644
--- a/packages/SystemUI/res/values-es/strings.xml
+++ b/packages/SystemUI/res/values-es/strings.xml
@@ -312,6 +312,10 @@
<string name="quick_settings_bluetooth_audio_sharing_button" msgid="7545274861795853838">"Compartir audio"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_sharing" msgid="3069309588231072128">"Compartiendo audio"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_accessibility" msgid="7604615019302091708">"acceder a las opciones para compartir audio"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_message" msgid="4251807313264307426">"Los vídeos y la música de este dispositivo se reproducirán en ambos auriculares"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_title" msgid="4406818346036286793">"Comparte tu audio"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_subtitle" msgid="3014906864710059236">"<xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g> y <xliff:g id="ACTIVE_DEVICE_NAME">%2$s</xliff:g>"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_switch_to_button" msgid="7546825655978203773">"Cambiar a <xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g>"</string>
<string name="quick_settings_bluetooth_secondary_label_battery_level" msgid="4182034939479344093">"<xliff:g id="BATTERY_LEVEL_AS_PERCENTAGE">%s</xliff:g> de batería"</string>
<string name="quick_settings_bluetooth_secondary_label_audio" msgid="780333390310051161">"Audio"</string>
<string name="quick_settings_bluetooth_secondary_label_headset" msgid="2332093067553000852">"Auriculares"</string>
@@ -440,8 +444,7 @@
<string name="zen_mode_on" msgid="9085304934016242591">"Activado"</string>
<string name="zen_mode_on_with_details" msgid="7416143430557895497">"Activado • <xliff:g id="TRIGGER_DESCRIPTION">%1$s</xliff:g>"</string>
<string name="zen_mode_off" msgid="1736604456618147306">"Desactivado"</string>
- <!-- no translation found for zen_mode_set_up (8231201163894922821) -->
- <skip />
+ <string name="zen_mode_set_up" msgid="8231201163894922821">"Sin definir"</string>
<string name="zen_mode_no_manual_invocation" msgid="1769975741344633672">"Gestionar en los ajustes"</string>
<string name="zen_mode_active_modes" msgid="1625850411578488856">"{count,plural, =0{No hay modos activos}=1{{mode} está activo}many{Hay # modos activos}other{Hay # modos activos}}"</string>
<string name="zen_priority_introduction" msgid="3159291973383796646">"No te molestarán los sonidos ni las vibraciones, excepto las alarmas, los recordatorios, los eventos y las llamadas que especifiques. Seguirás escuchando el contenido que quieras reproducir, como música, vídeos y juegos."</string>
@@ -673,10 +676,8 @@
<string name="stream_notification_unavailable" msgid="4313854556205836435">"No disponible (el tono está silenciado)"</string>
<string name="stream_alarm_unavailable" msgid="4059817189292197839">"No disponible porque No molestar está activado"</string>
<string name="stream_media_unavailable" msgid="6823020894438959853">"No disponible porque No molestar está activado"</string>
- <!-- no translation found for stream_unavailable_by_modes (3674139029490353683) -->
- <skip />
- <!-- no translation found for stream_unavailable_by_unknown (6908434629318171588) -->
- <skip />
+ <string name="stream_unavailable_by_modes" msgid="3674139029490353683">"No disponible porque <xliff:g id="MODE">%s</xliff:g> está activado"</string>
+ <string name="stream_unavailable_by_unknown" msgid="6908434629318171588">"No disponible"</string>
<string name="volume_stream_content_description_unmute" msgid="7729576371406792977">"%1$s. Toca para activar el sonido."</string>
<string name="volume_stream_content_description_vibrate" msgid="4858111994183089761">"%1$s. Toca para poner el dispositivo en vibración. Los servicios de accesibilidad pueden silenciarse."</string>
<string name="volume_stream_content_description_mute" msgid="4079046784917920984">"%1$s. Toca para silenciar. Los servicios de accesibilidad pueden silenciarse."</string>
@@ -1410,38 +1411,26 @@
<string name="launch_touchpad_tutorial_notification_content" msgid="7931085031240753226">"Aprende gestos del panel táctil"</string>
<string name="launch_keyboard_touchpad_tutorial_notification_title" msgid="1940023776496198762">"Desplázate con el teclado y el panel táctil"</string>
<string name="launch_keyboard_touchpad_tutorial_notification_content" msgid="1780725168171929365">"Aprende gestos del panel táctil, combinaciones de teclas y más"</string>
- <!-- no translation found for touchpad_tutorial_back_gesture_button (3104716365403620315) -->
- <skip />
- <!-- no translation found for touchpad_tutorial_home_gesture_button (8023973153559885624) -->
- <skip />
+ <string name="touchpad_tutorial_back_gesture_button" msgid="3104716365403620315">"Volver"</string>
+ <string name="touchpad_tutorial_home_gesture_button" msgid="8023973153559885624">"Ir a Inicio"</string>
<string name="touchpad_tutorial_recent_apps_gesture_button" msgid="8919227647650347359">"Ver aplicaciones recientes"</string>
<string name="touchpad_tutorial_done_button" msgid="176168488821755503">"Hecho"</string>
<string name="touchpad_back_gesture_action_title" msgid="7199067250654332735">"Atrás"</string>
- <!-- no translation found for touchpad_back_gesture_guidance (5352221087725906542) -->
- <skip />
- <!-- no translation found for touchpad_back_gesture_success_title (7370719098633023496) -->
- <skip />
+ <string name="touchpad_back_gesture_guidance" msgid="5352221087725906542">"Desliza hacia la izquierda o la derecha con tres dedos en el panel táctil"</string>
+ <string name="touchpad_back_gesture_success_title" msgid="7370719098633023496">"¡Genial!"</string>
<string name="touchpad_back_gesture_success_body" msgid="2324724953720741719">"Has completado el gesto para volver."</string>
<string name="touchpad_home_gesture_action_title" msgid="8885107349719257882">"Ir a Inicio"</string>
- <!-- no translation found for touchpad_home_gesture_guidance (4178219118381915899) -->
- <skip />
- <!-- no translation found for touchpad_home_gesture_success_title (3648264553645798470) -->
- <skip />
- <!-- no translation found for touchpad_home_gesture_success_body (2590690589194027059) -->
- <skip />
+ <string name="touchpad_home_gesture_guidance" msgid="4178219118381915899">"Desliza hacia arriba con tres dedos en el panel táctil"</string>
+ <string name="touchpad_home_gesture_success_title" msgid="3648264553645798470">"¡Bien hecho!"</string>
+ <string name="touchpad_home_gesture_success_body" msgid="2590690589194027059">"Has completado el gesto para ir a la pantalla de inicio"</string>
<string name="touchpad_recent_apps_gesture_action_title" msgid="934906836867137906">"Ver aplicaciones recientes"</string>
- <!-- no translation found for touchpad_recent_apps_gesture_guidance (6304446013842271822) -->
- <skip />
+ <string name="touchpad_recent_apps_gesture_guidance" msgid="6304446013842271822">"Desliza hacia arriba y mantén pulsado con tres dedos en el panel táctil"</string>
<string name="touchpad_recent_apps_gesture_success_title" msgid="8481920554139332593">"¡Bien hecho!"</string>
<string name="touchpad_recent_apps_gesture_success_body" msgid="4334263906697493273">"Has completado el gesto para ver las aplicaciones recientes."</string>
- <!-- no translation found for tutorial_action_key_title (8172535792469008169) -->
- <skip />
- <!-- no translation found for tutorial_action_key_guidance (5040613427202799294) -->
- <skip />
- <!-- no translation found for tutorial_action_key_success_title (2371827347071979571) -->
- <skip />
- <!-- no translation found for tutorial_action_key_success_body (1688986269491357832) -->
- <skip />
+ <string name="tutorial_action_key_title" msgid="8172535792469008169">"Ver todas las aplicaciones"</string>
+ <string name="tutorial_action_key_guidance" msgid="5040613427202799294">"Pulsa la tecla de acción de tu teclado"</string>
+ <string name="tutorial_action_key_success_title" msgid="2371827347071979571">"¡Muy bien!"</string>
+ <string name="tutorial_action_key_success_body" msgid="1688986269491357832">"Has completado el gesto para ver todas las aplicaciones"</string>
<string name="keyboard_backlight_dialog_title" msgid="8273102932345564724">"Retroiluminación del teclado"</string>
<string name="keyboard_backlight_value" msgid="7336398765584393538">"Nivel %1$d de %2$d"</string>
<string name="home_controls_dream_label" msgid="6567105701292324257">"Controles de la casa"</string>
diff --git a/packages/SystemUI/res/values-et/strings.xml b/packages/SystemUI/res/values-et/strings.xml
index 4b97b7be2263..ed1440996b31 100644
--- a/packages/SystemUI/res/values-et/strings.xml
+++ b/packages/SystemUI/res/values-et/strings.xml
@@ -312,6 +312,10 @@
<string name="quick_settings_bluetooth_audio_sharing_button" msgid="7545274861795853838">"Jaga heli"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_sharing" msgid="3069309588231072128">"Heli jagamine"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_accessibility" msgid="7604615019302091708">"heli jagamise seadete sisestamiseks"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_message" msgid="4251807313264307426">"Selle seadme muusikat ja videoid esitatakse mõlemas paaris kõrvaklappides"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_title" msgid="4406818346036286793">"Heli jagamine"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_subtitle" msgid="3014906864710059236">"<xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g> ja <xliff:g id="ACTIVE_DEVICE_NAME">%2$s</xliff:g>"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_switch_to_button" msgid="7546825655978203773">"Vaheta seadmele <xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g>"</string>
<string name="quick_settings_bluetooth_secondary_label_battery_level" msgid="4182034939479344093">"<xliff:g id="BATTERY_LEVEL_AS_PERCENTAGE">%s</xliff:g> akut"</string>
<string name="quick_settings_bluetooth_secondary_label_audio" msgid="780333390310051161">"Heli"</string>
<string name="quick_settings_bluetooth_secondary_label_headset" msgid="2332093067553000852">"Peakomplekt"</string>
@@ -672,10 +676,8 @@
<string name="stream_notification_unavailable" msgid="4313854556205836435">"Pole saadaval, kuna helin on vaigistatud"</string>
<string name="stream_alarm_unavailable" msgid="4059817189292197839">"Pole saadaval, kuna režiim Mitte segada on sees"</string>
<string name="stream_media_unavailable" msgid="6823020894438959853">"Pole saadaval, kuna režiim Mitte segada on sees"</string>
- <!-- no translation found for stream_unavailable_by_modes (3674139029490353683) -->
- <skip />
- <!-- no translation found for stream_unavailable_by_unknown (6908434629318171588) -->
- <skip />
+ <string name="stream_unavailable_by_modes" msgid="3674139029490353683">"Pole saadaval, kuna režiim <xliff:g id="MODE">%s</xliff:g> on sisse lülitatud"</string>
+ <string name="stream_unavailable_by_unknown" msgid="6908434629318171588">"Pole saadaval"</string>
<string name="volume_stream_content_description_unmute" msgid="7729576371406792977">"%1$s. Puudutage vaigistuse tühistamiseks."</string>
<string name="volume_stream_content_description_vibrate" msgid="4858111994183089761">"%1$s. Puudutage värinarežiimi määramiseks. Juurdepääsetavuse teenused võidakse vaigistada."</string>
<string name="volume_stream_content_description_mute" msgid="4079046784917920984">"%1$s. Puudutage vaigistamiseks. Juurdepääsetavuse teenused võidakse vaigistada."</string>
diff --git a/packages/SystemUI/res/values-eu/strings.xml b/packages/SystemUI/res/values-eu/strings.xml
index eff98ce47e66..2fb75d31c156 100644
--- a/packages/SystemUI/res/values-eu/strings.xml
+++ b/packages/SystemUI/res/values-eu/strings.xml
@@ -312,6 +312,10 @@
<string name="quick_settings_bluetooth_audio_sharing_button" msgid="7545274861795853838">"Partekatu audioa"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_sharing" msgid="3069309588231072128">"Audioa partekatzen"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_accessibility" msgid="7604615019302091708">"audioa partekatzeko ezarpenetan sartzeko"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_message" msgid="4251807313264307426">"Gailu honetako musika eta bideoak 2 entzungailu pareetan erreproduzituko dira"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_title" msgid="4406818346036286793">"Partekatu zure audioa"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_subtitle" msgid="3014906864710059236">"<xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g> eta <xliff:g id="ACTIVE_DEVICE_NAME">%2$s</xliff:g>"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_switch_to_button" msgid="7546825655978203773">"Erabili <xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g>"</string>
<string name="quick_settings_bluetooth_secondary_label_battery_level" msgid="4182034939479344093">"Bateria: <xliff:g id="BATTERY_LEVEL_AS_PERCENTAGE">%s</xliff:g>"</string>
<string name="quick_settings_bluetooth_secondary_label_audio" msgid="780333390310051161">"Audioa"</string>
<string name="quick_settings_bluetooth_secondary_label_headset" msgid="2332093067553000852">"Entzungailua"</string>
@@ -672,10 +676,8 @@
<string name="stream_notification_unavailable" msgid="4313854556205836435">"Ez dago erabilgarri, tonua desaktibatuta dagoelako"</string>
<string name="stream_alarm_unavailable" msgid="4059817189292197839">"Ez dago erabilgarri, ez molestatzeko modua aktibatuta baitago"</string>
<string name="stream_media_unavailable" msgid="6823020894438959853">"Ez dago erabilgarri, ez molestatzeko modua aktibatuta baitago"</string>
- <!-- no translation found for stream_unavailable_by_modes (3674139029490353683) -->
- <skip />
- <!-- no translation found for stream_unavailable_by_unknown (6908434629318171588) -->
- <skip />
+ <string name="stream_unavailable_by_modes" msgid="3674139029490353683">"Ez dago erabilgarri, <xliff:g id="MODE">%s</xliff:g> aktibatuta dagoelako"</string>
+ <string name="stream_unavailable_by_unknown" msgid="6908434629318171588">"Ez dago erabilgarri"</string>
<string name="volume_stream_content_description_unmute" msgid="7729576371406792977">"%1$s. Sakatu audioa aktibatzeko."</string>
<string name="volume_stream_content_description_vibrate" msgid="4858111994183089761">"%1$s. Sakatu dardara ezartzeko. Baliteke erabilerraztasun-eginbideen audioa desaktibatzea."</string>
<string name="volume_stream_content_description_mute" msgid="4079046784917920984">"%1$s. Sakatu audioa desaktibatzeko. Baliteke erabilerraztasun-eginbideen audioa desaktibatzea."</string>
diff --git a/packages/SystemUI/res/values-fa/strings.xml b/packages/SystemUI/res/values-fa/strings.xml
index 858670affe36..b18c84ad3507 100644
--- a/packages/SystemUI/res/values-fa/strings.xml
+++ b/packages/SystemUI/res/values-fa/strings.xml
@@ -312,6 +312,10 @@
<string name="quick_settings_bluetooth_audio_sharing_button" msgid="7545274861795853838">"هم‌رسانی صدا"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_sharing" msgid="3069309588231072128">"درحال هم‌رسانی صدا"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_accessibility" msgid="7604615019302091708">"وارد شدن به تنظیمات «اشتراک صدا»"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_message" msgid="4251807313264307426">"موسیقی و ویدیوهای این دستگاه در هر دو گوشی هدفون پخش خواهد شد"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_title" msgid="4406818346036286793">"هم‌رسانی کردن صدای دستگاه"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_subtitle" msgid="3014906864710059236">"‫<xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g> و <xliff:g id="ACTIVE_DEVICE_NAME">%2$s</xliff:g>"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_switch_to_button" msgid="7546825655978203773">"رفتن به <xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g>"</string>
<string name="quick_settings_bluetooth_secondary_label_battery_level" msgid="4182034939479344093">"شارژ باتری <xliff:g id="BATTERY_LEVEL_AS_PERCENTAGE">%s</xliff:g>"</string>
<string name="quick_settings_bluetooth_secondary_label_audio" msgid="780333390310051161">"صوت"</string>
<string name="quick_settings_bluetooth_secondary_label_headset" msgid="2332093067553000852">"هدست"</string>
@@ -672,10 +676,8 @@
<string name="stream_notification_unavailable" msgid="4313854556205836435">"دردسترس نیست، چون زنگ بی‌صدا شده است"</string>
<string name="stream_alarm_unavailable" msgid="4059817189292197839">"دردسترس نیست زیرا «مزاحم نشوید» روشن است"</string>
<string name="stream_media_unavailable" msgid="6823020894438959853">"دردسترس نیست زیرا «مزاحم نشوید» روشن است"</string>
- <!-- no translation found for stream_unavailable_by_modes (3674139029490353683) -->
- <skip />
- <!-- no translation found for stream_unavailable_by_unknown (6908434629318171588) -->
- <skip />
+ <string name="stream_unavailable_by_modes" msgid="3674139029490353683">"دردسترس نیست زیرا <xliff:g id="MODE">%s</xliff:g> روشن است"</string>
+ <string name="stream_unavailable_by_unknown" msgid="6908434629318171588">"دردسترس نیست"</string>
<string name="volume_stream_content_description_unmute" msgid="7729576371406792977">"‏%1$s. برای باصدا کردن تک‌ضرب بزنید."</string>
<string name="volume_stream_content_description_vibrate" msgid="4858111994183089761">"‏%1$s. برای تنظیم روی لرزش تک‌ضرب بزنید. ممکن است سرویس‌های دسترس‌پذیری بی‌صدا شوند."</string>
<string name="volume_stream_content_description_mute" msgid="4079046784917920984">"‏%1$s. برای صامت کردن تک‌ضرب بزنید. ممکن است سرویس‌های دسترس‌پذیری صامت شود."</string>
diff --git a/packages/SystemUI/res/values-fi/strings.xml b/packages/SystemUI/res/values-fi/strings.xml
index 96a701af9f42..46027419ec7f 100644
--- a/packages/SystemUI/res/values-fi/strings.xml
+++ b/packages/SystemUI/res/values-fi/strings.xml
@@ -312,6 +312,10 @@
<string name="quick_settings_bluetooth_audio_sharing_button" msgid="7545274861795853838">"Jaa audio"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_sharing" msgid="3069309588231072128">"Audiota jaetaan"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_accessibility" msgid="7604615019302091708">"lisätäksesi audion jakamisasetukset"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_message" msgid="4251807313264307426">"Laitteen musiikki ja videot toistetaan molemmilla kuulokepareilla"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_title" msgid="4406818346036286793">"Jaa audio"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_subtitle" msgid="3014906864710059236">"<xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g> ja <xliff:g id="ACTIVE_DEVICE_NAME">%2$s</xliff:g>"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_switch_to_button" msgid="7546825655978203773">"Vaihda: <xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g>"</string>
<string name="quick_settings_bluetooth_secondary_label_battery_level" msgid="4182034939479344093">"Akun taso <xliff:g id="BATTERY_LEVEL_AS_PERCENTAGE">%s</xliff:g>"</string>
<string name="quick_settings_bluetooth_secondary_label_audio" msgid="780333390310051161">"Ääni"</string>
<string name="quick_settings_bluetooth_secondary_label_headset" msgid="2332093067553000852">"Headset"</string>
@@ -672,10 +676,8 @@
<string name="stream_notification_unavailable" msgid="4313854556205836435">"Ei käytettävissä, soittoääni mykistetty"</string>
<string name="stream_alarm_unavailable" msgid="4059817189292197839">"Ei saatavilla, koska Älä häiritse on päällä"</string>
<string name="stream_media_unavailable" msgid="6823020894438959853">"Ei saatavilla, koska Älä häiritse on päällä"</string>
- <!-- no translation found for stream_unavailable_by_modes (3674139029490353683) -->
- <skip />
- <!-- no translation found for stream_unavailable_by_unknown (6908434629318171588) -->
- <skip />
+ <string name="stream_unavailable_by_modes" msgid="3674139029490353683">"Ei käytettävissä, koska <xliff:g id="MODE">%s</xliff:g> on päällä"</string>
+ <string name="stream_unavailable_by_unknown" msgid="6908434629318171588">"Ei saatavilla"</string>
<string name="volume_stream_content_description_unmute" msgid="7729576371406792977">"%1$s. Poista mykistys koskettamalla."</string>
<string name="volume_stream_content_description_vibrate" msgid="4858111994183089761">"%1$s. Siirry värinätilaan koskettamalla. Myös esteettömyyspalvelut saattavat mykistyä."</string>
<string name="volume_stream_content_description_mute" msgid="4079046784917920984">"%1$s. Mykistä koskettamalla. Myös esteettömyyspalvelut saattavat mykistyä."</string>
diff --git a/packages/SystemUI/res/values-fr-rCA/strings.xml b/packages/SystemUI/res/values-fr-rCA/strings.xml
index 6b718085398b..77434a5fd283 100644
--- a/packages/SystemUI/res/values-fr-rCA/strings.xml
+++ b/packages/SystemUI/res/values-fr-rCA/strings.xml
@@ -312,6 +312,10 @@
<string name="quick_settings_bluetooth_audio_sharing_button" msgid="7545274861795853838">"Partager l\'audio"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_sharing" msgid="3069309588231072128">"Partage de l\'audio en cours"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_accessibility" msgid="7604615019302091708">"entrer les paramètres de partage audio"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_message" msgid="4251807313264307426">"La musique et les vidéos de cet appareil peuvent être lues sur les deux paires d\'écouteurs"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_title" msgid="4406818346036286793">"Partager votre audio"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_subtitle" msgid="3014906864710059236">"<xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g> et <xliff:g id="ACTIVE_DEVICE_NAME">%2$s</xliff:g>"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_switch_to_button" msgid="7546825655978203773">"Passer à <xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g>"</string>
<string name="quick_settings_bluetooth_secondary_label_battery_level" msgid="4182034939479344093">"Pile : <xliff:g id="BATTERY_LEVEL_AS_PERCENTAGE">%s</xliff:g>"</string>
<string name="quick_settings_bluetooth_secondary_label_audio" msgid="780333390310051161">"Audio"</string>
<string name="quick_settings_bluetooth_secondary_label_headset" msgid="2332093067553000852">"Écouteurs"</string>
@@ -440,8 +444,7 @@
<string name="zen_mode_on" msgid="9085304934016242591">"Activé"</string>
<string name="zen_mode_on_with_details" msgid="7416143430557895497">"Activé • <xliff:g id="TRIGGER_DESCRIPTION">%1$s</xliff:g>"</string>
<string name="zen_mode_off" msgid="1736604456618147306">"Désactivé"</string>
- <!-- no translation found for zen_mode_set_up (8231201163894922821) -->
- <skip />
+ <string name="zen_mode_set_up" msgid="8231201163894922821">"Non défini"</string>
<string name="zen_mode_no_manual_invocation" msgid="1769975741344633672">"Gérer dans les paramètres"</string>
<string name="zen_mode_active_modes" msgid="1625850411578488856">"{count,plural, =0{Aucun mode actif}=1{Le mode {mode} est actif}one{# mode est actif}many{# de modes sont actifs}other{# modes sont actifs}}"</string>
<string name="zen_priority_introduction" msgid="3159291973383796646">"Vous ne serez pas dérangé par les sons et les vibrations, sauf pour les alarmes, les rappels, les événements et les appelants que vous sélectionnez. Vous entendrez tout ce que vous choisissez d\'écouter, y compris la musique, les vidéos et les jeux."</string>
@@ -673,10 +676,8 @@
<string name="stream_notification_unavailable" msgid="4313854556205836435">"Inaccessible : sonnerie en sourdine"</string>
<string name="stream_alarm_unavailable" msgid="4059817189292197839">"Inaccessible parce que Ne pas déranger est activée"</string>
<string name="stream_media_unavailable" msgid="6823020894438959853">"Inaccessible parce que Ne pas déranger est activée"</string>
- <!-- no translation found for stream_unavailable_by_modes (3674139029490353683) -->
- <skip />
- <!-- no translation found for stream_unavailable_by_unknown (6908434629318171588) -->
- <skip />
+ <string name="stream_unavailable_by_modes" msgid="3674139029490353683">"Non accessible, car le mode <xliff:g id="MODE">%s</xliff:g> est activé"</string>
+ <string name="stream_unavailable_by_unknown" msgid="6908434629318171588">"Non accessible"</string>
<string name="volume_stream_content_description_unmute" msgid="7729576371406792977">"%1$s. Touchez pour réactiver le son."</string>
<string name="volume_stream_content_description_vibrate" msgid="4858111994183089761">"%1$s. Touchez pour activer les vibrations. Il est possible de couper le son des services d\'accessibilité."</string>
<string name="volume_stream_content_description_mute" msgid="4079046784917920984">"%1$s. Touchez pour couper le son. Il est possible de couper le son des services d\'accessibilité."</string>
@@ -1410,38 +1411,26 @@
<string name="launch_touchpad_tutorial_notification_content" msgid="7931085031240753226">"Apprenez à utiliser les gestes du pavé tactile"</string>
<string name="launch_keyboard_touchpad_tutorial_notification_title" msgid="1940023776496198762">"Naviguer à l\'aide de votre clavier et de votre pavé tactile"</string>
<string name="launch_keyboard_touchpad_tutorial_notification_content" msgid="1780725168171929365">"Apprenez les gestes du pavé tactile, les raccourcis-clavier et bien plus encore"</string>
- <!-- no translation found for touchpad_tutorial_back_gesture_button (3104716365403620315) -->
- <skip />
- <!-- no translation found for touchpad_tutorial_home_gesture_button (8023973153559885624) -->
- <skip />
+ <string name="touchpad_tutorial_back_gesture_button" msgid="3104716365403620315">"Retour"</string>
+ <string name="touchpad_tutorial_home_gesture_button" msgid="8023973153559885624">"Retour à la page d\'accueil"</string>
<string name="touchpad_tutorial_recent_apps_gesture_button" msgid="8919227647650347359">"Afficher les applis récentes"</string>
<string name="touchpad_tutorial_done_button" msgid="176168488821755503">"OK"</string>
<string name="touchpad_back_gesture_action_title" msgid="7199067250654332735">"Retour"</string>
- <!-- no translation found for touchpad_back_gesture_guidance (5352221087725906542) -->
- <skip />
- <!-- no translation found for touchpad_back_gesture_success_title (7370719098633023496) -->
- <skip />
+ <string name="touchpad_back_gesture_guidance" msgid="5352221087725906542">"Balayez votre pavé tactile vers la gauche ou vers la droite avec trois doigts"</string>
+ <string name="touchpad_back_gesture_success_title" msgid="7370719098633023496">"Bien!"</string>
<string name="touchpad_back_gesture_success_body" msgid="2324724953720741719">"Vous avez appris le geste de retour en arrière."</string>
<string name="touchpad_home_gesture_action_title" msgid="8885107349719257882">"Retour à la page d\'accueil"</string>
- <!-- no translation found for touchpad_home_gesture_guidance (4178219118381915899) -->
- <skip />
- <!-- no translation found for touchpad_home_gesture_success_title (3648264553645798470) -->
- <skip />
- <!-- no translation found for touchpad_home_gesture_success_body (2590690589194027059) -->
- <skip />
+ <string name="touchpad_home_gesture_guidance" msgid="4178219118381915899">"Balayez votre pavé tactile vers le haut avec trois doigts"</string>
+ <string name="touchpad_home_gesture_success_title" msgid="3648264553645798470">"Bon travail!"</string>
+ <string name="touchpad_home_gesture_success_body" msgid="2590690589194027059">"Vous avez appris le geste pour revenir à l\'écran d\'accueil"</string>
<string name="touchpad_recent_apps_gesture_action_title" msgid="934906836867137906">"Afficher les applis récentes"</string>
- <!-- no translation found for touchpad_recent_apps_gesture_guidance (6304446013842271822) -->
- <skip />
+ <string name="touchpad_recent_apps_gesture_guidance" msgid="6304446013842271822">"Balayez votre pavé tactile vers le haut avec trois doigts, puis maintenez-les en place"</string>
<string name="touchpad_recent_apps_gesture_success_title" msgid="8481920554139332593">"Bon travail!"</string>
<string name="touchpad_recent_apps_gesture_success_body" msgid="4334263906697493273">"Vous avez effectué le geste pour afficher les applis récentes."</string>
- <!-- no translation found for tutorial_action_key_title (8172535792469008169) -->
- <skip />
- <!-- no translation found for tutorial_action_key_guidance (5040613427202799294) -->
- <skip />
- <!-- no translation found for tutorial_action_key_success_title (2371827347071979571) -->
- <skip />
- <!-- no translation found for tutorial_action_key_success_body (1688986269491357832) -->
- <skip />
+ <string name="tutorial_action_key_title" msgid="8172535792469008169">"Afficher toutes les applis"</string>
+ <string name="tutorial_action_key_guidance" msgid="5040613427202799294">"Appuyez sur la touche d\'action de votre clavier"</string>
+ <string name="tutorial_action_key_success_title" msgid="2371827347071979571">"Félicitations!"</string>
+ <string name="tutorial_action_key_success_body" msgid="1688986269491357832">"Vous avez appris le geste pour afficher toutes les applis"</string>
<string name="keyboard_backlight_dialog_title" msgid="8273102932345564724">"Rétroéclairage du clavier"</string>
<string name="keyboard_backlight_value" msgid="7336398765584393538">"Niveau %1$d de %2$d"</string>
<string name="home_controls_dream_label" msgid="6567105701292324257">"Domotique"</string>
diff --git a/packages/SystemUI/res/values-fr/strings.xml b/packages/SystemUI/res/values-fr/strings.xml
index dccb581d88bf..fa16862ac1d7 100644
--- a/packages/SystemUI/res/values-fr/strings.xml
+++ b/packages/SystemUI/res/values-fr/strings.xml
@@ -312,6 +312,10 @@
<string name="quick_settings_bluetooth_audio_sharing_button" msgid="7545274861795853838">"Partager le contenu audio"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_sharing" msgid="3069309588231072128">"Audio partagé"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_accessibility" msgid="7604615019302091708">"accéder aux paramètres de partage audio"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_message" msgid="4251807313264307426">"La musique et les vidéos de cet appareil peuvent être lues sur les deux casques"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_title" msgid="4406818346036286793">"Partager votre audio"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_subtitle" msgid="3014906864710059236">"<xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g> et <xliff:g id="ACTIVE_DEVICE_NAME">%2$s</xliff:g>"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_switch_to_button" msgid="7546825655978203773">"Passer à <xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g>"</string>
<string name="quick_settings_bluetooth_secondary_label_battery_level" msgid="4182034939479344093">"<xliff:g id="BATTERY_LEVEL_AS_PERCENTAGE">%s</xliff:g> de batterie"</string>
<string name="quick_settings_bluetooth_secondary_label_audio" msgid="780333390310051161">"Audio"</string>
<string name="quick_settings_bluetooth_secondary_label_headset" msgid="2332093067553000852">"Casque"</string>
@@ -440,8 +444,7 @@
<string name="zen_mode_on" msgid="9085304934016242591">"Activé"</string>
<string name="zen_mode_on_with_details" msgid="7416143430557895497">"Activé • <xliff:g id="TRIGGER_DESCRIPTION">%1$s</xliff:g>"</string>
<string name="zen_mode_off" msgid="1736604456618147306">"Désactivé"</string>
- <!-- no translation found for zen_mode_set_up (8231201163894922821) -->
- <skip />
+ <string name="zen_mode_set_up" msgid="8231201163894922821">"Non défini"</string>
<string name="zen_mode_no_manual_invocation" msgid="1769975741344633672">"Gérer dans les paramètres"</string>
<string name="zen_mode_active_modes" msgid="1625850411578488856">"{count,plural, =0{Aucun mode actif}=1{{mode} est actif}one{# mode est actif}many{# de modes sont actifs}other{# modes sont actifs}}"</string>
<string name="zen_priority_introduction" msgid="3159291973383796646">"Vous ne serez pas dérangé par des sons ou des vibrations, hormis ceux des alarmes, des rappels, des événements et des appelants de votre choix. Vous entendrez encore les sons que vous choisirez de jouer, notamment la musique, les vidéos et les jeux."</string>
@@ -673,10 +676,8 @@
<string name="stream_notification_unavailable" msgid="4313854556205836435">"Indisponible, car la sonnerie est coupée"</string>
<string name="stream_alarm_unavailable" msgid="4059817189292197839">"Indisponible car Ne pas déranger est activé"</string>
<string name="stream_media_unavailable" msgid="6823020894438959853">"Indisponible car Ne pas déranger est activé"</string>
- <!-- no translation found for stream_unavailable_by_modes (3674139029490353683) -->
- <skip />
- <!-- no translation found for stream_unavailable_by_unknown (6908434629318171588) -->
- <skip />
+ <string name="stream_unavailable_by_modes" msgid="3674139029490353683">"Indisponible, car le mode <xliff:g id="MODE">%s</xliff:g> est activé"</string>
+ <string name="stream_unavailable_by_unknown" msgid="6908434629318171588">"Indisponible"</string>
<string name="volume_stream_content_description_unmute" msgid="7729576371406792977">"%1$s. Appuyez pour ne plus ignorer."</string>
<string name="volume_stream_content_description_vibrate" msgid="4858111994183089761">"%1$s. Appuyez pour mettre en mode vibreur. Vous pouvez ignorer les services d\'accessibilité."</string>
<string name="volume_stream_content_description_mute" msgid="4079046784917920984">"%1$s. Appuyez pour ignorer. Vous pouvez ignorer les services d\'accessibilité."</string>
@@ -1410,38 +1411,26 @@
<string name="launch_touchpad_tutorial_notification_content" msgid="7931085031240753226">"Découvrir les gestes au pavé tactile"</string>
<string name="launch_keyboard_touchpad_tutorial_notification_title" msgid="1940023776496198762">"Naviguer à l\'aide de votre clavier et de votre pavé tactile"</string>
<string name="launch_keyboard_touchpad_tutorial_notification_content" msgid="1780725168171929365">"Découvrir les gestes au pavé tactile, les raccourcis clavier et plus encore"</string>
- <!-- no translation found for touchpad_tutorial_back_gesture_button (3104716365403620315) -->
- <skip />
- <!-- no translation found for touchpad_tutorial_home_gesture_button (8023973153559885624) -->
- <skip />
+ <string name="touchpad_tutorial_back_gesture_button" msgid="3104716365403620315">"Retour"</string>
+ <string name="touchpad_tutorial_home_gesture_button" msgid="8023973153559885624">"Retour à l\'accueil"</string>
<string name="touchpad_tutorial_recent_apps_gesture_button" msgid="8919227647650347359">"Afficher les applis récentes"</string>
<string name="touchpad_tutorial_done_button" msgid="176168488821755503">"OK"</string>
<string name="touchpad_back_gesture_action_title" msgid="7199067250654332735">"Retour"</string>
- <!-- no translation found for touchpad_back_gesture_guidance (5352221087725906542) -->
- <skip />
- <!-- no translation found for touchpad_back_gesture_success_title (7370719098633023496) -->
- <skip />
+ <string name="touchpad_back_gesture_guidance" msgid="5352221087725906542">"Balayez vers la gauche ou la droite avec trois doigts sur le pavé tactile"</string>
+ <string name="touchpad_back_gesture_success_title" msgid="7370719098633023496">"Bravo !"</string>
<string name="touchpad_back_gesture_success_body" msgid="2324724953720741719">"Vous avez appris le geste pour revenir en arrière."</string>
<string name="touchpad_home_gesture_action_title" msgid="8885107349719257882">"Retour à l\'accueil"</string>
- <!-- no translation found for touchpad_home_gesture_guidance (4178219118381915899) -->
- <skip />
- <!-- no translation found for touchpad_home_gesture_success_title (3648264553645798470) -->
- <skip />
- <!-- no translation found for touchpad_home_gesture_success_body (2590690589194027059) -->
- <skip />
+ <string name="touchpad_home_gesture_guidance" msgid="4178219118381915899">"Balayez vers le haut avec trois doigts sur le pavé tactile"</string>
+ <string name="touchpad_home_gesture_success_title" msgid="3648264553645798470">"Bravo !"</string>
+ <string name="touchpad_home_gesture_success_body" msgid="2590690589194027059">"Vous avez appris le geste pour revenir à l\'écran d\'accueil"</string>
<string name="touchpad_recent_apps_gesture_action_title" msgid="934906836867137906">"Afficher les applis récentes"</string>
- <!-- no translation found for touchpad_recent_apps_gesture_guidance (6304446013842271822) -->
- <skip />
+ <string name="touchpad_recent_apps_gesture_guidance" msgid="6304446013842271822">"Avec trois doigts, balayez le pavé tactile vers le haut et maintenez la position"</string>
<string name="touchpad_recent_apps_gesture_success_title" msgid="8481920554139332593">"Bravo !"</string>
<string name="touchpad_recent_apps_gesture_success_body" msgid="4334263906697493273">"Vous avez appris le geste pour afficher les applis récentes"</string>
- <!-- no translation found for tutorial_action_key_title (8172535792469008169) -->
- <skip />
- <!-- no translation found for tutorial_action_key_guidance (5040613427202799294) -->
- <skip />
- <!-- no translation found for tutorial_action_key_success_title (2371827347071979571) -->
- <skip />
- <!-- no translation found for tutorial_action_key_success_body (1688986269491357832) -->
- <skip />
+ <string name="tutorial_action_key_title" msgid="8172535792469008169">"Afficher toutes les applications"</string>
+ <string name="tutorial_action_key_guidance" msgid="5040613427202799294">"Appuyez sur la touche d\'action de votre clavier"</string>
+ <string name="tutorial_action_key_success_title" msgid="2371827347071979571">"Bravo !"</string>
+ <string name="tutorial_action_key_success_body" msgid="1688986269491357832">"Vous avez appris le geste pour afficher toutes les applis"</string>
<string name="keyboard_backlight_dialog_title" msgid="8273102932345564724">"Rétroéclairage du clavier"</string>
<string name="keyboard_backlight_value" msgid="7336398765584393538">"Niveau %1$d sur %2$d"</string>
<string name="home_controls_dream_label" msgid="6567105701292324257">"Contrôle de la maison"</string>
diff --git a/packages/SystemUI/res/values-gl/strings.xml b/packages/SystemUI/res/values-gl/strings.xml
index b0a432d9ee93..1d2c785a198e 100644
--- a/packages/SystemUI/res/values-gl/strings.xml
+++ b/packages/SystemUI/res/values-gl/strings.xml
@@ -312,6 +312,10 @@
<string name="quick_settings_bluetooth_audio_sharing_button" msgid="7545274861795853838">"Compartir audio"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_sharing" msgid="3069309588231072128">"Compartindo audio"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_accessibility" msgid="7604615019302091708">"configurar o uso compartido de audio"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_message" msgid="4251807313264307426">"A música e os vídeos deste dispositivo reproduciranse nos dous pares de auriculares"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_title" msgid="4406818346036286793">"Compartir o audio"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_subtitle" msgid="3014906864710059236">"<xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g> e <xliff:g id="ACTIVE_DEVICE_NAME">%2$s</xliff:g>"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_switch_to_button" msgid="7546825655978203773">"Cambiar a <xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g>"</string>
<string name="quick_settings_bluetooth_secondary_label_battery_level" msgid="4182034939479344093">"<xliff:g id="BATTERY_LEVEL_AS_PERCENTAGE">%s</xliff:g> de batería"</string>
<string name="quick_settings_bluetooth_secondary_label_audio" msgid="780333390310051161">"Audio"</string>
<string name="quick_settings_bluetooth_secondary_label_headset" msgid="2332093067553000852">"Auriculares"</string>
@@ -672,10 +676,8 @@
<string name="stream_notification_unavailable" msgid="4313854556205836435">"Non dispoñible: o son está silenciado"</string>
<string name="stream_alarm_unavailable" msgid="4059817189292197839">"Non dispoñible: Non molestar está activado"</string>
<string name="stream_media_unavailable" msgid="6823020894438959853">"Non dispoñible: Non molestar está activado"</string>
- <!-- no translation found for stream_unavailable_by_modes (3674139029490353683) -->
- <skip />
- <!-- no translation found for stream_unavailable_by_unknown (6908434629318171588) -->
- <skip />
+ <string name="stream_unavailable_by_modes" msgid="3674139029490353683">"Non está dispoñible porque se activou o modo <xliff:g id="MODE">%s</xliff:g>"</string>
+ <string name="stream_unavailable_by_unknown" msgid="6908434629318171588">"Non dispoñible"</string>
<string name="volume_stream_content_description_unmute" msgid="7729576371406792977">"%1$s. Toca para activar o son."</string>
<string name="volume_stream_content_description_vibrate" msgid="4858111994183089761">"%1$s. Toca para establecer a vibración. Pódense silenciar os servizos de accesibilidade."</string>
<string name="volume_stream_content_description_mute" msgid="4079046784917920984">"%1$s. Toca para silenciar. Pódense silenciar os servizos de accesibilidade."</string>
diff --git a/packages/SystemUI/res/values-gu/strings.xml b/packages/SystemUI/res/values-gu/strings.xml
index 5de229333397..c6014b18e4f6 100644
--- a/packages/SystemUI/res/values-gu/strings.xml
+++ b/packages/SystemUI/res/values-gu/strings.xml
@@ -312,6 +312,10 @@
<string name="quick_settings_bluetooth_audio_sharing_button" msgid="7545274861795853838">"ઑડિયો શેર કરો"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_sharing" msgid="3069309588231072128">"ઑડિયો શેર કરી રહ્યાં છીએ"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_accessibility" msgid="7604615019302091708">"ઑડિયો શેરિંગ સેટિંગ દાખલ કરો"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_message" msgid="4251807313264307426">"આ ડિવાઇસનું મ્યુઝિક અને વીડિયો હૅડફોનની બન્ને જોડીઓ પર ચાલશે"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_title" msgid="4406818346036286793">"તમારો ઑડિયો શેર કરો"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_subtitle" msgid="3014906864710059236">"<xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g> અને <xliff:g id="ACTIVE_DEVICE_NAME">%2$s</xliff:g>"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_switch_to_button" msgid="7546825655978203773">"<xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g> પર સ્વિચ કરો"</string>
<string name="quick_settings_bluetooth_secondary_label_battery_level" msgid="4182034939479344093">"<xliff:g id="BATTERY_LEVEL_AS_PERCENTAGE">%s</xliff:g> બૅટરી"</string>
<string name="quick_settings_bluetooth_secondary_label_audio" msgid="780333390310051161">"ઑડિયો"</string>
<string name="quick_settings_bluetooth_secondary_label_headset" msgid="2332093067553000852">"હૅડસેટ"</string>
@@ -672,10 +676,8 @@
<string name="stream_notification_unavailable" msgid="4313854556205836435">"રિંગ મ્યૂટ કરી હોવાના કારણે અનુપલબ્ધ છે"</string>
<string name="stream_alarm_unavailable" msgid="4059817189292197839">"ઉપલબ્ધ નથી, કારણ કે ખલેલ પાડશો નહીં મોડ ચાલુ છે"</string>
<string name="stream_media_unavailable" msgid="6823020894438959853">"ઉપલબ્ધ નથી, કારણ કે ખલેલ પાડશો નહીં મોડ ચાલુ છે"</string>
- <!-- no translation found for stream_unavailable_by_modes (3674139029490353683) -->
- <skip />
- <!-- no translation found for stream_unavailable_by_unknown (6908434629318171588) -->
- <skip />
+ <string name="stream_unavailable_by_modes" msgid="3674139029490353683">"<xliff:g id="MODE">%s</xliff:g> ચાલુ હોવાથી અનુપલબ્ધ છે"</string>
+ <string name="stream_unavailable_by_unknown" msgid="6908434629318171588">"અનુપલબ્ધ છે"</string>
<string name="volume_stream_content_description_unmute" msgid="7729576371406792977">"%1$s. અનમ્યૂટ કરવા માટે ટૅપ કરો."</string>
<string name="volume_stream_content_description_vibrate" msgid="4858111994183089761">"%1$s. વાઇબ્રેટ પર સેટ કરવા માટે ટૅપ કરો. ઍક્સેસિબિલિટી સેવાઓ મ્યૂટ કરવામાં આવી શકે છે."</string>
<string name="volume_stream_content_description_mute" msgid="4079046784917920984">"%1$s. મ્યૂટ કરવા માટે ટૅપ કરો. ઍક્સેસિબિલિટી સેવાઓ મ્યૂટ કરવામાં આવી શકે છે."</string>
diff --git a/packages/SystemUI/res/values-hi/strings.xml b/packages/SystemUI/res/values-hi/strings.xml
index 15b363962859..28a4f2bc05eb 100644
--- a/packages/SystemUI/res/values-hi/strings.xml
+++ b/packages/SystemUI/res/values-hi/strings.xml
@@ -312,6 +312,10 @@
<string name="quick_settings_bluetooth_audio_sharing_button" msgid="7545274861795853838">"ऑडियो शेयर करें"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_sharing" msgid="3069309588231072128">"ऑडियो शेयर किया जा रहा है"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_accessibility" msgid="7604615019302091708">"ऑडियो शेयर करने की सेटिंग जोड़ें"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_message" msgid="4251807313264307426">"इस डिवाइस के संगीत और वीडियो, दोनों हेडफ़ोन पर चलेंगे"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_title" msgid="4406818346036286793">"अपना ऑडियो शेयर करें"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_subtitle" msgid="3014906864710059236">"<xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g> और <xliff:g id="ACTIVE_DEVICE_NAME">%2$s</xliff:g>"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_switch_to_button" msgid="7546825655978203773">"<xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g> पर स्विच करें"</string>
<string name="quick_settings_bluetooth_secondary_label_battery_level" msgid="4182034939479344093">"<xliff:g id="BATTERY_LEVEL_AS_PERCENTAGE">%s</xliff:g> बैटरी"</string>
<string name="quick_settings_bluetooth_secondary_label_audio" msgid="780333390310051161">"ऑडियो"</string>
<string name="quick_settings_bluetooth_secondary_label_headset" msgid="2332093067553000852">"हेडसेट"</string>
@@ -672,10 +676,8 @@
<string name="stream_notification_unavailable" msgid="4313854556205836435">"आवाज़ नहीं आएगी, क्योंकि रिंग म्यूट है"</string>
<string name="stream_alarm_unavailable" msgid="4059817189292197839">"सुविधा बंद है, क्योंकि \'परेशान न करें\' मोड चालू है"</string>
<string name="stream_media_unavailable" msgid="6823020894438959853">"आवाज़ बंद है, क्योंकि \'परेशान न करें\' मोड चालू है"</string>
- <!-- no translation found for stream_unavailable_by_modes (3674139029490353683) -->
- <skip />
- <!-- no translation found for stream_unavailable_by_unknown (6908434629318171588) -->
- <skip />
+ <string name="stream_unavailable_by_modes" msgid="3674139029490353683">"<xliff:g id="MODE">%s</xliff:g> चालू होने की वजह से यह सुविधा उपलब्ध नहीं है"</string>
+ <string name="stream_unavailable_by_unknown" msgid="6908434629318171588">"उपलब्ध नहीं है"</string>
<string name="volume_stream_content_description_unmute" msgid="7729576371406792977">"%1$s. अनम्यूट करने के लिए टैप करें."</string>
<string name="volume_stream_content_description_vibrate" msgid="4858111994183089761">"%1$s. कंपन पर सेट करने के लिए टैप करें. सुलभता सेवाएं म्यूट हो सकती हैं."</string>
<string name="volume_stream_content_description_mute" msgid="4079046784917920984">"%1$s. म्यूट करने के लिए टैप करें. सुलभता सेवाएं म्यूट हो सकती हैं."</string>
diff --git a/packages/SystemUI/res/values-hr/strings.xml b/packages/SystemUI/res/values-hr/strings.xml
index f646ee613611..cc19bea1fee0 100644
--- a/packages/SystemUI/res/values-hr/strings.xml
+++ b/packages/SystemUI/res/values-hr/strings.xml
@@ -312,6 +312,10 @@
<string name="quick_settings_bluetooth_audio_sharing_button" msgid="7545274861795853838">"Dijeli zvuk"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_sharing" msgid="3069309588231072128">"Zajedničko slušanje"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_accessibility" msgid="7604615019302091708">"unesite postavke zajedničkog slušanja"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_message" msgid="4251807313264307426">"Glazba i videozapisi s ovog uređaja reproducirat će se na oba para slušalica"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_title" msgid="4406818346036286793">"Podijelite zvuk"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_subtitle" msgid="3014906864710059236">"<xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g> i <xliff:g id="ACTIVE_DEVICE_NAME">%2$s</xliff:g>"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_switch_to_button" msgid="7546825655978203773">"Prijeđi na <xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g>"</string>
<string name="quick_settings_bluetooth_secondary_label_battery_level" msgid="4182034939479344093">"<xliff:g id="BATTERY_LEVEL_AS_PERCENTAGE">%s</xliff:g> baterije"</string>
<string name="quick_settings_bluetooth_secondary_label_audio" msgid="780333390310051161">"Audio"</string>
<string name="quick_settings_bluetooth_secondary_label_headset" msgid="2332093067553000852">"Slušalice"</string>
@@ -672,10 +676,8 @@
<string name="stream_notification_unavailable" msgid="4313854556205836435">"Nedostupno jer je zvono utišano"</string>
<string name="stream_alarm_unavailable" msgid="4059817189292197839">"Nedostupno jer je uključen način Ne uznemiravaj"</string>
<string name="stream_media_unavailable" msgid="6823020894438959853">"Nedostupno jer je uključen način Ne uznemiravaj"</string>
- <!-- no translation found for stream_unavailable_by_modes (3674139029490353683) -->
- <skip />
- <!-- no translation found for stream_unavailable_by_unknown (6908434629318171588) -->
- <skip />
+ <string name="stream_unavailable_by_modes" msgid="3674139029490353683">"Nedostupno jer je uključen način <xliff:g id="MODE">%s</xliff:g>"</string>
+ <string name="stream_unavailable_by_unknown" msgid="6908434629318171588">"Nedostupno"</string>
<string name="volume_stream_content_description_unmute" msgid="7729576371406792977">"%1$s. Dodirnite da biste uključili zvuk."</string>
<string name="volume_stream_content_description_vibrate" msgid="4858111994183089761">"%1$s. Dodirnite da biste postavili na vibraciju. Usluge pristupačnosti možda neće imati zvuk."</string>
<string name="volume_stream_content_description_mute" msgid="4079046784917920984">"%1$s. Dodirnite da biste isključili zvuk. Usluge pristupačnosti možda neće imati zvuk."</string>
diff --git a/packages/SystemUI/res/values-hu/strings.xml b/packages/SystemUI/res/values-hu/strings.xml
index 1248f41aa8ae..9ee748bdc04c 100644
--- a/packages/SystemUI/res/values-hu/strings.xml
+++ b/packages/SystemUI/res/values-hu/strings.xml
@@ -312,6 +312,10 @@
<string name="quick_settings_bluetooth_audio_sharing_button" msgid="7545274861795853838">"Hang megosztása"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_sharing" msgid="3069309588231072128">"Hang megosztása…"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_accessibility" msgid="7604615019302091708">"a hangmegosztási beállítások megadásához"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_message" msgid="4251807313264307426">"Az eszközön lejátszott zene és videó a fejhallgatópárt alkotó mindkét eszközön hallható"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_title" msgid="4406818346036286793">"Hang megosztása"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_subtitle" msgid="3014906864710059236">"<xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g> és <xliff:g id="ACTIVE_DEVICE_NAME">%2$s</xliff:g>"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_switch_to_button" msgid="7546825655978203773">"Váltás erre: <xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g>"</string>
<string name="quick_settings_bluetooth_secondary_label_battery_level" msgid="4182034939479344093">"Akkumulátor: <xliff:g id="BATTERY_LEVEL_AS_PERCENTAGE">%s</xliff:g>"</string>
<string name="quick_settings_bluetooth_secondary_label_audio" msgid="780333390310051161">"Hang"</string>
<string name="quick_settings_bluetooth_secondary_label_headset" msgid="2332093067553000852">"Headset"</string>
@@ -672,10 +676,8 @@
<string name="stream_notification_unavailable" msgid="4313854556205836435">"Nem lehetséges, a csörgés le van némítva"</string>
<string name="stream_alarm_unavailable" msgid="4059817189292197839">"Nem működik, mert be van kapcsolva a Ne zavarjanak"</string>
<string name="stream_media_unavailable" msgid="6823020894438959853">"Nem működik, mert be van kapcsolva a Ne zavarjanak"</string>
- <!-- no translation found for stream_unavailable_by_modes (3674139029490353683) -->
- <skip />
- <!-- no translation found for stream_unavailable_by_unknown (6908434629318171588) -->
- <skip />
+ <string name="stream_unavailable_by_modes" msgid="3674139029490353683">"Nem áll rendelkezésre, mert a(z) <xliff:g id="MODE">%s</xliff:g> be van kapcsolva"</string>
+ <string name="stream_unavailable_by_unknown" msgid="6908434629318171588">"Nem áll rendelkezésre"</string>
<string name="volume_stream_content_description_unmute" msgid="7729576371406792977">"%1$s. Koppintson a némítás megszüntetéséhez."</string>
<string name="volume_stream_content_description_vibrate" msgid="4858111994183089761">"%1$s. Koppintson a rezgés beállításához. Előfordulhat, hogy a kisegítő lehetőségek szolgáltatásai le vannak némítva."</string>
<string name="volume_stream_content_description_mute" msgid="4079046784917920984">"%1$s. Koppintson a némításhoz. Előfordulhat, hogy a kisegítő lehetőségek szolgáltatásai le vannak némítva."</string>
diff --git a/packages/SystemUI/res/values-hy/strings.xml b/packages/SystemUI/res/values-hy/strings.xml
index db58b355f6d2..b07a78522437 100644
--- a/packages/SystemUI/res/values-hy/strings.xml
+++ b/packages/SystemUI/res/values-hy/strings.xml
@@ -312,6 +312,10 @@
<string name="quick_settings_bluetooth_audio_sharing_button" msgid="7545274861795853838">"Փոխանցել աուդիոն"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_sharing" msgid="3069309588231072128">"Աուդիոյի փոխանցում"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_accessibility" msgid="7604615019302091708">"անցնել աուդիոյի փոխանցման կարգավորումներ"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_message" msgid="4251807313264307426">"Այս սարքի երաժշտությունն ու տեսանյութերը երկու ականջակալներում էլ կնվագարկվեն"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_title" msgid="4406818346036286793">"Կիսվեք ձեր աուդիոյով"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_subtitle" msgid="3014906864710059236">"<xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g> և <xliff:g id="ACTIVE_DEVICE_NAME">%2$s</xliff:g>"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_switch_to_button" msgid="7546825655978203773">"Անցնել <xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g> սարքին"</string>
<string name="quick_settings_bluetooth_secondary_label_battery_level" msgid="4182034939479344093">"Մարտկոցի լիցքը՝ <xliff:g id="BATTERY_LEVEL_AS_PERCENTAGE">%s</xliff:g>"</string>
<string name="quick_settings_bluetooth_secondary_label_audio" msgid="780333390310051161">"Աուդիո"</string>
<string name="quick_settings_bluetooth_secondary_label_headset" msgid="2332093067553000852">"Ականջակալ"</string>
@@ -440,8 +444,7 @@
<string name="zen_mode_on" msgid="9085304934016242591">"Միացված է"</string>
<string name="zen_mode_on_with_details" msgid="7416143430557895497">"Միաց․ • <xliff:g id="TRIGGER_DESCRIPTION">%1$s</xliff:g>"</string>
<string name="zen_mode_off" msgid="1736604456618147306">"Անջատված է"</string>
- <!-- no translation found for zen_mode_set_up (8231201163894922821) -->
- <skip />
+ <string name="zen_mode_set_up" msgid="8231201163894922821">"Կարգավորված չէ"</string>
<string name="zen_mode_no_manual_invocation" msgid="1769975741344633672">"Կառավարել կարգավորումներում"</string>
<string name="zen_mode_active_modes" msgid="1625850411578488856">"{count,plural, =0{Ակտիվ ռեժիմներ չկան}=1{{mode} ռեժիմ ակտիվ է}one{# ռեժիմ ակտիվ է}other{# ռեժիմ ակտիվ է}}"</string>
<string name="zen_priority_introduction" msgid="3159291973383796646">"Ձայները և թրթռոցները չեն անհանգստացնի ձեզ, բացի ձեր կողմից նշված զարթուցիչները, հիշեցումները, միջոցառումների ծանուցումները և զանգերը։ Դուք կլսեք ձեր ընտրածի նվագարկումը, այդ թվում՝ երաժշտություն, տեսանյութեր և խաղեր:"</string>
@@ -673,10 +676,8 @@
<string name="stream_notification_unavailable" msgid="4313854556205836435">"Հասանելի չէ, երբ զանգի ձայնն անջատված է"</string>
<string name="stream_alarm_unavailable" msgid="4059817189292197839">"Հասանելի չէ․ «Չանհանգստացնել» ռեժիմը միացված է"</string>
<string name="stream_media_unavailable" msgid="6823020894438959853">"Հասանելի չէ․ «Չանհանգստացնել» ռեժիմը միացված է"</string>
- <!-- no translation found for stream_unavailable_by_modes (3674139029490353683) -->
- <skip />
- <!-- no translation found for stream_unavailable_by_unknown (6908434629318171588) -->
- <skip />
+ <string name="stream_unavailable_by_modes" msgid="3674139029490353683">"Հասանելի չէ, քանի որ «<xliff:g id="MODE">%s</xliff:g>» ռեժիմը միացված է"</string>
+ <string name="stream_unavailable_by_unknown" msgid="6908434629318171588">"Հասանելի չէ"</string>
<string name="volume_stream_content_description_unmute" msgid="7729576371406792977">"%1$s: Հպեք՝ ձայնը միացնելու համար:"</string>
<string name="volume_stream_content_description_vibrate" msgid="4858111994183089761">"%1$s: Հպեք՝ թրթռոցը միացնելու համար: Մատչելիության ծառայությունների ձայնը կարող է անջատվել:"</string>
<string name="volume_stream_content_description_mute" msgid="4079046784917920984">"%1$s: Հպեք՝ ձայնն անջատելու համար: Մատչելիության ծառայությունների ձայնը կարող է անջատվել:"</string>
@@ -1410,38 +1411,26 @@
<string name="launch_touchpad_tutorial_notification_content" msgid="7931085031240753226">"Սովորեք օգտագործել հպահարթակի ժեստերը"</string>
<string name="launch_keyboard_touchpad_tutorial_notification_title" msgid="1940023776496198762">"Կողմնորոշվեք ստեղնաշարի և հպահարթակի օգնությամբ"</string>
<string name="launch_keyboard_touchpad_tutorial_notification_content" msgid="1780725168171929365">"Սովորեք օգտագործել հպահարթակի ժեստերը, ստեղնային դյուրանցումները և ավելին"</string>
- <!-- no translation found for touchpad_tutorial_back_gesture_button (3104716365403620315) -->
- <skip />
- <!-- no translation found for touchpad_tutorial_home_gesture_button (8023973153559885624) -->
- <skip />
+ <string name="touchpad_tutorial_back_gesture_button" msgid="3104716365403620315">"Ինչպես հետ գնալ"</string>
+ <string name="touchpad_tutorial_home_gesture_button" msgid="8023973153559885624">"Ինչպես անցնել հիմնական էկրան"</string>
<string name="touchpad_tutorial_recent_apps_gesture_button" msgid="8919227647650347359">"Դիտել վերջին հավելվածները"</string>
<string name="touchpad_tutorial_done_button" msgid="176168488821755503">"Պատրաստ է"</string>
<string name="touchpad_back_gesture_action_title" msgid="7199067250654332735">"Հետ գնալ"</string>
- <!-- no translation found for touchpad_back_gesture_guidance (5352221087725906542) -->
- <skip />
- <!-- no translation found for touchpad_back_gesture_success_title (7370719098633023496) -->
- <skip />
+ <string name="touchpad_back_gesture_guidance" msgid="5352221087725906542">"Հպահարթակի վրա երեք մատով սահեցրեք ձախ կամ աջ"</string>
+ <string name="touchpad_back_gesture_success_title" msgid="7370719098633023496">"Գերազանց է"</string>
<string name="touchpad_back_gesture_success_body" msgid="2324724953720741719">"Դուք սովորեցիք հետ գնալու ժեստը։"</string>
<string name="touchpad_home_gesture_action_title" msgid="8885107349719257882">"Անցում հիմնական էկրան"</string>
- <!-- no translation found for touchpad_home_gesture_guidance (4178219118381915899) -->
- <skip />
- <!-- no translation found for touchpad_home_gesture_success_title (3648264553645798470) -->
- <skip />
- <!-- no translation found for touchpad_home_gesture_success_body (2590690589194027059) -->
- <skip />
+ <string name="touchpad_home_gesture_guidance" msgid="4178219118381915899">"Հպահարթակի վրա երեք մատով սահեցրեք վերև"</string>
+ <string name="touchpad_home_gesture_success_title" msgid="3648264553645798470">"Կեցցե՛ք"</string>
+ <string name="touchpad_home_gesture_success_body" msgid="2590690589194027059">"Դուք սովորեցիք հիմնական էկրան անցնելու ժեստը"</string>
<string name="touchpad_recent_apps_gesture_action_title" msgid="934906836867137906">"Դիտել վերջին հավելվածները"</string>
- <!-- no translation found for touchpad_recent_apps_gesture_guidance (6304446013842271822) -->
- <skip />
+ <string name="touchpad_recent_apps_gesture_guidance" msgid="6304446013842271822">"Երեք մատով սահեցրեք վերև և սեղմած պահեք հպահարթակին"</string>
<string name="touchpad_recent_apps_gesture_success_title" msgid="8481920554139332593">"Կեցցե՛ք։"</string>
<string name="touchpad_recent_apps_gesture_success_body" msgid="4334263906697493273">"Դուք կատարեցիք վերջին օգտագործված հավելվածների դիտման ժեստը։"</string>
- <!-- no translation found for tutorial_action_key_title (8172535792469008169) -->
- <skip />
- <!-- no translation found for tutorial_action_key_guidance (5040613427202799294) -->
- <skip />
- <!-- no translation found for tutorial_action_key_success_title (2371827347071979571) -->
- <skip />
- <!-- no translation found for tutorial_action_key_success_body (1688986269491357832) -->
- <skip />
+ <string name="tutorial_action_key_title" msgid="8172535792469008169">"Ինչպես դիտել բոլոր հավելվածները"</string>
+ <string name="tutorial_action_key_guidance" msgid="5040613427202799294">"Սեղմեք գործողության ստեղնը ստեղնաշարի վրա"</string>
+ <string name="tutorial_action_key_success_title" msgid="2371827347071979571">"Հիանալի՛ է"</string>
+ <string name="tutorial_action_key_success_body" msgid="1688986269491357832">"Դուք սովորեցիք բոլոր հավելվածները դիտելու ժեստը"</string>
<string name="keyboard_backlight_dialog_title" msgid="8273102932345564724">"Հետին լուսավորությամբ ստեղնաշար"</string>
<string name="keyboard_backlight_value" msgid="7336398765584393538">"%1$d՝ %2$d-ից"</string>
<string name="home_controls_dream_label" msgid="6567105701292324257">"Տան կառավարման տարրեր"</string>
diff --git a/packages/SystemUI/res/values-in/strings.xml b/packages/SystemUI/res/values-in/strings.xml
index 2c2927553ea0..84a45c6c8a08 100644
--- a/packages/SystemUI/res/values-in/strings.xml
+++ b/packages/SystemUI/res/values-in/strings.xml
@@ -312,6 +312,10 @@
<string name="quick_settings_bluetooth_audio_sharing_button" msgid="7545274861795853838">"Bagikan audio"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_sharing" msgid="3069309588231072128">"Berbagi audio"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_accessibility" msgid="7604615019302091708">"masuk ke setelan berbagi audio"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_message" msgid="4251807313264307426">"Musik dan video di perangkat ini akan diputar di kedua pasang headphone"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_title" msgid="4406818346036286793">"Bagikan audio Anda"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_subtitle" msgid="3014906864710059236">"<xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g> dan <xliff:g id="ACTIVE_DEVICE_NAME">%2$s</xliff:g>"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_switch_to_button" msgid="7546825655978203773">"Alihkan ke <xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g>"</string>
<string name="quick_settings_bluetooth_secondary_label_battery_level" msgid="4182034939479344093">"Baterai <xliff:g id="BATTERY_LEVEL_AS_PERCENTAGE">%s</xliff:g>"</string>
<string name="quick_settings_bluetooth_secondary_label_audio" msgid="780333390310051161">"Audio"</string>
<string name="quick_settings_bluetooth_secondary_label_headset" msgid="2332093067553000852">"Headset"</string>
@@ -672,10 +676,8 @@
<string name="stream_notification_unavailable" msgid="4313854556205836435">"Tidak tersedia - Volume dering dibisukan"</string>
<string name="stream_alarm_unavailable" msgid="4059817189292197839">"Tidak tersedia - Fitur Jangan Ganggu aktif"</string>
<string name="stream_media_unavailable" msgid="6823020894438959853">"Tidak tersedia - Fitur Jangan Ganggu aktif"</string>
- <!-- no translation found for stream_unavailable_by_modes (3674139029490353683) -->
- <skip />
- <!-- no translation found for stream_unavailable_by_unknown (6908434629318171588) -->
- <skip />
+ <string name="stream_unavailable_by_modes" msgid="3674139029490353683">"Tidak tersedia karena <xliff:g id="MODE">%s</xliff:g> aktif"</string>
+ <string name="stream_unavailable_by_unknown" msgid="6908434629318171588">"Tidak tersedia"</string>
<string name="volume_stream_content_description_unmute" msgid="7729576371406792977">"%1$s. Ketuk untuk menyuarakan."</string>
<string name="volume_stream_content_description_vibrate" msgid="4858111994183089761">"%1$s. Ketuk untuk menyetel agar bergetar. Layanan aksesibilitas mungkin dibisukan."</string>
<string name="volume_stream_content_description_mute" msgid="4079046784917920984">"%1$s. Ketuk untuk membisukan. Layanan aksesibilitas mungkin dibisukan."</string>
diff --git a/packages/SystemUI/res/values-is/strings.xml b/packages/SystemUI/res/values-is/strings.xml
index 1897ba414d57..f27790c05b1b 100644
--- a/packages/SystemUI/res/values-is/strings.xml
+++ b/packages/SystemUI/res/values-is/strings.xml
@@ -312,6 +312,10 @@
<string name="quick_settings_bluetooth_audio_sharing_button" msgid="7545274861795853838">"Deila hljóði"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_sharing" msgid="3069309588231072128">"Deilir hljóði"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_accessibility" msgid="7604615019302091708">"slá inn stillingar hljóðdeilingar"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_message" msgid="4251807313264307426">"Tónlist og vídeó í tækinu munu spilast í báðum heyrnartólum"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_title" msgid="4406818346036286793">"Deildu hljóðinu þínu"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_subtitle" msgid="3014906864710059236">"<xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g> og <xliff:g id="ACTIVE_DEVICE_NAME">%2$s</xliff:g>"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_switch_to_button" msgid="7546825655978203773">"Skipta yfir í <xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g>"</string>
<string name="quick_settings_bluetooth_secondary_label_battery_level" msgid="4182034939479344093">"<xliff:g id="BATTERY_LEVEL_AS_PERCENTAGE">%s</xliff:g> rafhlöðuhleðsla"</string>
<string name="quick_settings_bluetooth_secondary_label_audio" msgid="780333390310051161">"Hljóð"</string>
<string name="quick_settings_bluetooth_secondary_label_headset" msgid="2332093067553000852">"Höfuðtól"</string>
@@ -672,10 +676,8 @@
<string name="stream_notification_unavailable" msgid="4313854556205836435">"Ekki í boði þar sem hringing er þögguð"</string>
<string name="stream_alarm_unavailable" msgid="4059817189292197839">"Ekki í boði því að kveikt er á „Ónáðið ekki“"</string>
<string name="stream_media_unavailable" msgid="6823020894438959853">"Ekki í boði því að kveikt er á „Ónáðið ekki“"</string>
- <!-- no translation found for stream_unavailable_by_modes (3674139029490353683) -->
- <skip />
- <!-- no translation found for stream_unavailable_by_unknown (6908434629318171588) -->
- <skip />
+ <string name="stream_unavailable_by_modes" msgid="3674139029490353683">"Ekki í boði vegna þess að kveikt er á <xliff:g id="MODE">%s</xliff:g>"</string>
+ <string name="stream_unavailable_by_unknown" msgid="6908434629318171588">"Ekki í boði"</string>
<string name="volume_stream_content_description_unmute" msgid="7729576371406792977">"%1$s. Ýttu til að hætta að þagga."</string>
<string name="volume_stream_content_description_vibrate" msgid="4858111994183089761">"%1$s. Ýttu til að stilla á titring. Hugsanlega verður slökkt á hljóði aðgengisþjónustu."</string>
<string name="volume_stream_content_description_mute" msgid="4079046784917920984">"%1$s. Ýttu til að þagga. Hugsanlega verður slökkt á hljóði aðgengisþjónustu."</string>
diff --git a/packages/SystemUI/res/values-it/strings.xml b/packages/SystemUI/res/values-it/strings.xml
index 2931b96f0888..7ace302022b6 100644
--- a/packages/SystemUI/res/values-it/strings.xml
+++ b/packages/SystemUI/res/values-it/strings.xml
@@ -312,6 +312,10 @@
<string name="quick_settings_bluetooth_audio_sharing_button" msgid="7545274861795853838">"Condividi audio"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_sharing" msgid="3069309588231072128">"Condivisione audio in corso…"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_accessibility" msgid="7604615019302091708">"inserisci le impostazioni di condivisione audio"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_message" msgid="4251807313264307426">"La musica e i video di questo dispositivo verranno riprodotti su entrambe le coppie di cuffie"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_title" msgid="4406818346036286793">"Condividi l\'audio"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_subtitle" msgid="3014906864710059236">"<xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g> e <xliff:g id="ACTIVE_DEVICE_NAME">%2$s</xliff:g>"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_switch_to_button" msgid="7546825655978203773">"Passa a <xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g>"</string>
<string name="quick_settings_bluetooth_secondary_label_battery_level" msgid="4182034939479344093">"Batteria: <xliff:g id="BATTERY_LEVEL_AS_PERCENTAGE">%s</xliff:g>"</string>
<string name="quick_settings_bluetooth_secondary_label_audio" msgid="780333390310051161">"Audio"</string>
<string name="quick_settings_bluetooth_secondary_label_headset" msgid="2332093067553000852">"Auricolare"</string>
@@ -440,8 +444,7 @@
<string name="zen_mode_on" msgid="9085304934016242591">"On"</string>
<string name="zen_mode_on_with_details" msgid="7416143430557895497">"On • <xliff:g id="TRIGGER_DESCRIPTION">%1$s</xliff:g>"</string>
<string name="zen_mode_off" msgid="1736604456618147306">"Off"</string>
- <!-- no translation found for zen_mode_set_up (8231201163894922821) -->
- <skip />
+ <string name="zen_mode_set_up" msgid="8231201163894922821">"Non impostata"</string>
<string name="zen_mode_no_manual_invocation" msgid="1769975741344633672">"Gestisci nelle impostazioni"</string>
<string name="zen_mode_active_modes" msgid="1625850411578488856">"{count,plural, =0{Nessuna modalità attiva}=1{{mode} è attiva}many{# di modalità sono attive}other{# modalità sono attive}}"</string>
<string name="zen_priority_introduction" msgid="3159291973383796646">"Suoni e vibrazioni non ti disturberanno, ad eccezione di sveglie, promemoria, eventi, chiamate da contatti da te specificati ed elementi che hai scelto di continuare a riprodurre, inclusi video, musica e giochi."</string>
@@ -673,10 +676,8 @@
<string name="stream_notification_unavailable" msgid="4313854556205836435">"Non disponibile con l\'audio disattivato"</string>
<string name="stream_alarm_unavailable" msgid="4059817189292197839">"Non disponibile: modalità Non disturbare attiva"</string>
<string name="stream_media_unavailable" msgid="6823020894438959853">"Non disponibili con \"Non disturbare\" attiva"</string>
- <!-- no translation found for stream_unavailable_by_modes (3674139029490353683) -->
- <skip />
- <!-- no translation found for stream_unavailable_by_unknown (6908434629318171588) -->
- <skip />
+ <string name="stream_unavailable_by_modes" msgid="3674139029490353683">"Non disponibile perché la modalità <xliff:g id="MODE">%s</xliff:g> è attiva"</string>
+ <string name="stream_unavailable_by_unknown" msgid="6908434629318171588">"Non disponibile"</string>
<string name="volume_stream_content_description_unmute" msgid="7729576371406792977">"%1$s. Tocca per riattivare l\'audio."</string>
<string name="volume_stream_content_description_vibrate" msgid="4858111994183089761">"%1$s. Tocca per attivare la vibrazione. L\'audio dei servizi di accessibilità può essere disattivato."</string>
<string name="volume_stream_content_description_mute" msgid="4079046784917920984">"%1$s. Tocca per disattivare l\'audio. L\'audio dei servizi di accessibilità può essere disattivato."</string>
@@ -1410,38 +1411,26 @@
<string name="launch_touchpad_tutorial_notification_content" msgid="7931085031240753226">"Impara i gesti con il touchpad"</string>
<string name="launch_keyboard_touchpad_tutorial_notification_title" msgid="1940023776496198762">"Naviga usando la tastiera e il touchpad"</string>
<string name="launch_keyboard_touchpad_tutorial_notification_content" msgid="1780725168171929365">"Scopri gesti con il touchpad, scorciatoie da tastiera e altro ancora"</string>
- <!-- no translation found for touchpad_tutorial_back_gesture_button (3104716365403620315) -->
- <skip />
- <!-- no translation found for touchpad_tutorial_home_gesture_button (8023973153559885624) -->
- <skip />
+ <string name="touchpad_tutorial_back_gesture_button" msgid="3104716365403620315">"Indietro"</string>
+ <string name="touchpad_tutorial_home_gesture_button" msgid="8023973153559885624">"Vai alla schermata Home"</string>
<string name="touchpad_tutorial_recent_apps_gesture_button" msgid="8919227647650347359">"Visualizza app recenti"</string>
<string name="touchpad_tutorial_done_button" msgid="176168488821755503">"Fine"</string>
<string name="touchpad_back_gesture_action_title" msgid="7199067250654332735">"Indietro"</string>
- <!-- no translation found for touchpad_back_gesture_guidance (5352221087725906542) -->
- <skip />
- <!-- no translation found for touchpad_back_gesture_success_title (7370719098633023496) -->
- <skip />
+ <string name="touchpad_back_gesture_guidance" msgid="5352221087725906542">"Scorri verso sinistra o destra con tre dita sul touchpad"</string>
+ <string name="touchpad_back_gesture_success_title" msgid="7370719098633023496">"Bene!"</string>
<string name="touchpad_back_gesture_success_body" msgid="2324724953720741719">"Hai completato il gesto Indietro."</string>
<string name="touchpad_home_gesture_action_title" msgid="8885107349719257882">"Vai alla schermata Home"</string>
- <!-- no translation found for touchpad_home_gesture_guidance (4178219118381915899) -->
- <skip />
- <!-- no translation found for touchpad_home_gesture_success_title (3648264553645798470) -->
- <skip />
- <!-- no translation found for touchpad_home_gesture_success_body (2590690589194027059) -->
- <skip />
+ <string name="touchpad_home_gesture_guidance" msgid="4178219118381915899">"Scorri in alto con tre dita sul touchpad"</string>
+ <string name="touchpad_home_gesture_success_title" msgid="3648264553645798470">"Ottimo lavoro."</string>
+ <string name="touchpad_home_gesture_success_body" msgid="2590690589194027059">"Hai completato il gesto Vai alla schermata Home"</string>
<string name="touchpad_recent_apps_gesture_action_title" msgid="934906836867137906">"Visualizza app recenti"</string>
- <!-- no translation found for touchpad_recent_apps_gesture_guidance (6304446013842271822) -->
- <skip />
+ <string name="touchpad_recent_apps_gesture_guidance" msgid="6304446013842271822">"Scorri verso l\'alto e tieni premuto con tre dita sul touchpad"</string>
<string name="touchpad_recent_apps_gesture_success_title" msgid="8481920554139332593">"Ottimo lavoro."</string>
<string name="touchpad_recent_apps_gesture_success_body" msgid="4334263906697493273">"Hai completato il gesto Visualizza app recenti."</string>
- <!-- no translation found for tutorial_action_key_title (8172535792469008169) -->
- <skip />
- <!-- no translation found for tutorial_action_key_guidance (5040613427202799294) -->
- <skip />
- <!-- no translation found for tutorial_action_key_success_title (2371827347071979571) -->
- <skip />
- <!-- no translation found for tutorial_action_key_success_body (1688986269491357832) -->
- <skip />
+ <string name="tutorial_action_key_title" msgid="8172535792469008169">"Visualizza tutte le app"</string>
+ <string name="tutorial_action_key_guidance" msgid="5040613427202799294">"Premi il tasto azione sulla tastiera"</string>
+ <string name="tutorial_action_key_success_title" msgid="2371827347071979571">"Ben fatto!"</string>
+ <string name="tutorial_action_key_success_body" msgid="1688986269491357832">"Hai completato il gesto Visualizza tutte le app."</string>
<string name="keyboard_backlight_dialog_title" msgid="8273102932345564724">"Retroilluminazione della tastiera"</string>
<string name="keyboard_backlight_value" msgid="7336398765584393538">"Livello %1$d di %2$d"</string>
<string name="home_controls_dream_label" msgid="6567105701292324257">"Controlli della casa"</string>
diff --git a/packages/SystemUI/res/values-iw/strings.xml b/packages/SystemUI/res/values-iw/strings.xml
index 72fc195b056f..b5783cf56688 100644
--- a/packages/SystemUI/res/values-iw/strings.xml
+++ b/packages/SystemUI/res/values-iw/strings.xml
@@ -312,6 +312,10 @@
<string name="quick_settings_bluetooth_audio_sharing_button" msgid="7545274861795853838">"שיתוף האודיו"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_sharing" msgid="3069309588231072128">"מתבצע שיתוף של האודיו"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_accessibility" msgid="7604615019302091708">"להזנת הרשאות השיתוף של האודיו"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_message" msgid="4251807313264307426">"המוזיקה והסרטונים של המכשיר הזה יופעלו בשני זוגות האוזניות"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_title" msgid="4406818346036286793">"שיתוף האודיו שלך"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_subtitle" msgid="3014906864710059236">"<xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g> וגם <xliff:g id="ACTIVE_DEVICE_NAME">%2$s</xliff:g>"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_switch_to_button" msgid="7546825655978203773">"מעבר אל <xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g>"</string>
<string name="quick_settings_bluetooth_secondary_label_battery_level" msgid="4182034939479344093">"<xliff:g id="BATTERY_LEVEL_AS_PERCENTAGE">%s</xliff:g> סוללה"</string>
<string name="quick_settings_bluetooth_secondary_label_audio" msgid="780333390310051161">"אודיו"</string>
<string name="quick_settings_bluetooth_secondary_label_headset" msgid="2332093067553000852">"אוזניות"</string>
@@ -672,10 +676,8 @@
<string name="stream_notification_unavailable" msgid="4313854556205836435">"לא זמין כי הצלצול מושתק"</string>
<string name="stream_alarm_unavailable" msgid="4059817189292197839">"לא זמין כי התכונה \'נא לא להפריע\' מופעלת"</string>
<string name="stream_media_unavailable" msgid="6823020894438959853">"לא זמין כי התכונה \'נא לא להפריע\' מופעלת"</string>
- <!-- no translation found for stream_unavailable_by_modes (3674139029490353683) -->
- <skip />
- <!-- no translation found for stream_unavailable_by_unknown (6908434629318171588) -->
- <skip />
+ <string name="stream_unavailable_by_modes" msgid="3674139029490353683">"לא זמין כי המצב <xliff:g id="MODE">%s</xliff:g> מופעל"</string>
+ <string name="stream_unavailable_by_unknown" msgid="6908434629318171588">"לא זמין"</string>
<string name="volume_stream_content_description_unmute" msgid="7729576371406792977">"‏%1$s. יש להקיש כדי לבטל את ההשתקה."</string>
<string name="volume_stream_content_description_vibrate" msgid="4858111994183089761">"‏%1$s. צריך להקיש כדי להגדיר רטט. ייתכן ששירותי הנגישות מושתקים."</string>
<string name="volume_stream_content_description_mute" msgid="4079046784917920984">"‏%1$s. יש להקיש כדי להשתיק. ייתכן ששירותי הנגישות יושתקו."</string>
@@ -1425,7 +1427,7 @@
<string name="touchpad_recent_apps_gesture_guidance" msgid="6304446013842271822">"מחליקים למעלה ולוחצים לחיצה ארוכה עם שלוש אצבעות על לוח המגע"</string>
<string name="touchpad_recent_apps_gesture_success_title" msgid="8481920554139332593">"מעולה!"</string>
<string name="touchpad_recent_apps_gesture_success_body" msgid="4334263906697493273">"השלמת את התנועה להצגת האפליקציות האחרונות."</string>
- <string name="tutorial_action_key_title" msgid="8172535792469008169">"הצגת כל האפליקציות"</string>
+ <string name="tutorial_action_key_title" msgid="8172535792469008169">"צפייה בכל האפליקציות"</string>
<string name="tutorial_action_key_guidance" msgid="5040613427202799294">"צריך להקיש על מקש הפעולה במקלדת"</string>
<string name="tutorial_action_key_success_title" msgid="2371827347071979571">"כל הכבוד!"</string>
<string name="tutorial_action_key_success_body" msgid="1688986269491357832">"השלמת את התנועה להצגת כל האפליקציות"</string>
diff --git a/packages/SystemUI/res/values-ja/strings.xml b/packages/SystemUI/res/values-ja/strings.xml
index dcbfc8ce69be..8427f6709d31 100644
--- a/packages/SystemUI/res/values-ja/strings.xml
+++ b/packages/SystemUI/res/values-ja/strings.xml
@@ -312,6 +312,10 @@
<string name="quick_settings_bluetooth_audio_sharing_button" msgid="7545274861795853838">"音声を共有"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_sharing" msgid="3069309588231072128">"音声を共有中"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_accessibility" msgid="7604615019302091708">"音声の共有設定を開く"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_message" msgid="4251807313264307426">"このデバイスの音楽と動画は、両方のヘッドフォンで再生されます"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_title" msgid="4406818346036286793">"音声の共有"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_subtitle" msgid="3014906864710059236">"<xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g>、<xliff:g id="ACTIVE_DEVICE_NAME">%2$s</xliff:g>"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_switch_to_button" msgid="7546825655978203773">"<xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g> に切り替える"</string>
<string name="quick_settings_bluetooth_secondary_label_battery_level" msgid="4182034939479344093">"バッテリー <xliff:g id="BATTERY_LEVEL_AS_PERCENTAGE">%s</xliff:g>"</string>
<string name="quick_settings_bluetooth_secondary_label_audio" msgid="780333390310051161">"オーディオ"</string>
<string name="quick_settings_bluetooth_secondary_label_headset" msgid="2332093067553000852">"ヘッドセット"</string>
@@ -672,10 +676,8 @@
<string name="stream_notification_unavailable" msgid="4313854556205836435">"着信音がミュートされているため利用できません"</string>
<string name="stream_alarm_unavailable" msgid="4059817189292197839">"サイレント モードが ON のため利用できません"</string>
<string name="stream_media_unavailable" msgid="6823020894438959853">"サイレント モードが ON のため利用できません"</string>
- <!-- no translation found for stream_unavailable_by_modes (3674139029490353683) -->
- <skip />
- <!-- no translation found for stream_unavailable_by_unknown (6908434629318171588) -->
- <skip />
+ <string name="stream_unavailable_by_modes" msgid="3674139029490353683">"<xliff:g id="MODE">%s</xliff:g>が ON のため使用できません"</string>
+ <string name="stream_unavailable_by_unknown" msgid="6908434629318171588">"使用不可"</string>
<string name="volume_stream_content_description_unmute" msgid="7729576371406792977">"%1$s。タップしてミュートを解除します。"</string>
<string name="volume_stream_content_description_vibrate" msgid="4858111994183089761">"%1$s。タップしてバイブレーションに設定します。ユーザー補助機能サービスがミュートされる場合があります。"</string>
<string name="volume_stream_content_description_mute" msgid="4079046784917920984">"%1$s。タップしてミュートします。ユーザー補助機能サービスがミュートされる場合があります。"</string>
diff --git a/packages/SystemUI/res/values-ka/strings.xml b/packages/SystemUI/res/values-ka/strings.xml
index 65d85756c4d9..3b0732da57c4 100644
--- a/packages/SystemUI/res/values-ka/strings.xml
+++ b/packages/SystemUI/res/values-ka/strings.xml
@@ -312,6 +312,10 @@
<string name="quick_settings_bluetooth_audio_sharing_button" msgid="7545274861795853838">"აუდიოს გაზიარება"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_sharing" msgid="3069309588231072128">"მიმდინარებოს აუდიოს გაზიარება"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_accessibility" msgid="7604615019302091708">"აუდიო გაზიარების პარამეტრების შეყვანა"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_message" msgid="4251807313264307426">"ამ მოწყობილობის მუსიკა და ვიდეოები დაუკრავს ორივე ყურსასმენში"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_title" msgid="4406818346036286793">"თქვენი აუდიოს გაზიარება"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_subtitle" msgid="3014906864710059236">"<xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g> და <xliff:g id="ACTIVE_DEVICE_NAME">%2$s</xliff:g>"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_switch_to_button" msgid="7546825655978203773">"<xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g>-ზე გადართვა"</string>
<string name="quick_settings_bluetooth_secondary_label_battery_level" msgid="4182034939479344093">"<xliff:g id="BATTERY_LEVEL_AS_PERCENTAGE">%s</xliff:g> ბატარეა"</string>
<string name="quick_settings_bluetooth_secondary_label_audio" msgid="780333390310051161">"აუდიო"</string>
<string name="quick_settings_bluetooth_secondary_label_headset" msgid="2332093067553000852">"ყურსაცვამი"</string>
@@ -672,10 +676,8 @@
<string name="stream_notification_unavailable" msgid="4313854556205836435">"ზარის დადუმების გამო ხელმისაწვდომი არაა"</string>
<string name="stream_alarm_unavailable" msgid="4059817189292197839">"მიუწვდომელია, ჩართულია „არ შემაწუხოთ“ რეჟიმი"</string>
<string name="stream_media_unavailable" msgid="6823020894438959853">"მიუწვდომელია, ჩართულია „არ შემაწუხოთ“ რეჟიმი"</string>
- <!-- no translation found for stream_unavailable_by_modes (3674139029490353683) -->
- <skip />
- <!-- no translation found for stream_unavailable_by_unknown (6908434629318171588) -->
- <skip />
+ <string name="stream_unavailable_by_modes" msgid="3674139029490353683">"<xliff:g id="MODE">%s</xliff:g> რეჟიმის გამო მიუწვდომელია"</string>
+ <string name="stream_unavailable_by_unknown" msgid="6908434629318171588">"მიუწვდომელია"</string>
<string name="volume_stream_content_description_unmute" msgid="7729576371406792977">"%1$s. შეეხეთ დადუმების გასაუქმებლად."</string>
<string name="volume_stream_content_description_vibrate" msgid="4858111994183089761">"%1$s. შეეხეთ ვიბრაციაზე დასაყენებლად. შეიძლება დადუმდეს მარტივი წვდომის სერვისებიც."</string>
<string name="volume_stream_content_description_mute" msgid="4079046784917920984">"%1$s. შეეხეთ დასადუმებლად. შეიძლება დადუმდეს მარტივი წვდომის სერვისებიც."</string>
diff --git a/packages/SystemUI/res/values-kk/strings.xml b/packages/SystemUI/res/values-kk/strings.xml
index 7478e7631bb8..65115583f681 100644
--- a/packages/SystemUI/res/values-kk/strings.xml
+++ b/packages/SystemUI/res/values-kk/strings.xml
@@ -312,6 +312,10 @@
<string name="quick_settings_bluetooth_audio_sharing_button" msgid="7545274861795853838">"Аудионы бөлісу"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_sharing" msgid="3069309588231072128">"Аудио беріліп жатыр"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_accessibility" msgid="7604615019302091708">"аудио бөлісу параметрлерін енгізу"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_message" msgid="4251807313264307426">"Бұл құрылғыдағы музыка мен бейнелер қос құлақаспапта ойнатылады."</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_title" msgid="4406818346036286793">"Аудиоңызды бөлісіңіз"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_subtitle" msgid="3014906864710059236">"<xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g> және <xliff:g id="ACTIVE_DEVICE_NAME">%2$s</xliff:g>"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_switch_to_button" msgid="7546825655978203773">"<xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g> құрылғысына ауысу"</string>
<string name="quick_settings_bluetooth_secondary_label_battery_level" msgid="4182034939479344093">"Батарея деңгейі: <xliff:g id="BATTERY_LEVEL_AS_PERCENTAGE">%s</xliff:g>"</string>
<string name="quick_settings_bluetooth_secondary_label_audio" msgid="780333390310051161">"Aудио"</string>
<string name="quick_settings_bluetooth_secondary_label_headset" msgid="2332093067553000852">"Гарнитура"</string>
@@ -672,10 +676,8 @@
<string name="stream_notification_unavailable" msgid="4313854556205836435">"Қолжетімді емес, шылдырлату өшірулі."</string>
<string name="stream_alarm_unavailable" msgid="4059817189292197839">"Мазаламау режимі қосылғандықтан өзгерту мүмкін емес."</string>
<string name="stream_media_unavailable" msgid="6823020894438959853">"Мазаламау режимі қосылғандықтан өзгерту мүмкін емес."</string>
- <!-- no translation found for stream_unavailable_by_modes (3674139029490353683) -->
- <skip />
- <!-- no translation found for stream_unavailable_by_unknown (6908434629318171588) -->
- <skip />
+ <string name="stream_unavailable_by_modes" msgid="3674139029490353683">"Қолжетімді емес, себебі <xliff:g id="MODE">%s</xliff:g> режимі қосулы."</string>
+ <string name="stream_unavailable_by_unknown" msgid="6908434629318171588">"Қолжетімді емес"</string>
<string name="volume_stream_content_description_unmute" msgid="7729576371406792977">"%1$s. Дыбысын қосу үшін түртіңіз."</string>
<string name="volume_stream_content_description_vibrate" msgid="4858111994183089761">"%1$s. Діріл режимін орнату үшін түртіңіз. Арнайы мүмкіндік қызметтерінің дыбысы өшуі мүмкін."</string>
<string name="volume_stream_content_description_mute" msgid="4079046784917920984">"%1$s. Дыбысын өшіру үшін түртіңіз. Арнайы мүмкіндік қызметтерінің дыбысы өшуі мүмкін."</string>
diff --git a/packages/SystemUI/res/values-km/strings.xml b/packages/SystemUI/res/values-km/strings.xml
index d0f3f848fca9..7b7f912b3e1c 100644
--- a/packages/SystemUI/res/values-km/strings.xml
+++ b/packages/SystemUI/res/values-km/strings.xml
@@ -312,6 +312,10 @@
<string name="quick_settings_bluetooth_audio_sharing_button" msgid="7545274861795853838">"ស្ដាប់សំឡេងរួមគ្នា"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_sharing" msgid="3069309588231072128">"កំពុងស្ដាប់សំឡេងរួមគ្នា"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_accessibility" msgid="7604615019302091708">"បញ្ចូលការកំណត់ការស្ដាប់សំឡេងរួមគ្នា"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_message" msgid="4251807313264307426">"តន្ត្រី និងវីដេអូរបស់ឧបករណ៍នេះនឹងចាក់នៅលើកាសទាំងពីរគូ"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_title" msgid="4406818346036286793">"ស្ដាប់សំឡេង​របស់អ្នករួមគ្នា"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_subtitle" msgid="3014906864710059236">"<xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g> និង <xliff:g id="ACTIVE_DEVICE_NAME">%2$s</xliff:g>"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_switch_to_button" msgid="7546825655978203773">"ប្ដូរទៅ <xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g>"</string>
<string name="quick_settings_bluetooth_secondary_label_battery_level" msgid="4182034939479344093">"ថ្ម <xliff:g id="BATTERY_LEVEL_AS_PERCENTAGE">%s</xliff:g>"</string>
<string name="quick_settings_bluetooth_secondary_label_audio" msgid="780333390310051161">"សំឡេង"</string>
<string name="quick_settings_bluetooth_secondary_label_headset" msgid="2332093067553000852">"កាស"</string>
@@ -672,10 +676,8 @@
<string name="stream_notification_unavailable" msgid="4313854556205836435">"មិន​អាច​ប្រើ​បាន​ទេ​ ព្រោះ​សំឡេង​រោទ៍​ត្រូវ​បាន​បិទ"</string>
<string name="stream_alarm_unavailable" msgid="4059817189292197839">"មិនអាចប្រើបានទេ ដោយសារមុខងារកុំ​រំខានត្រូវបានបើក"</string>
<string name="stream_media_unavailable" msgid="6823020894438959853">"មិនអាចប្រើបានទេ ដោយសារមុខងារកុំ​រំខានត្រូវបានបើក"</string>
- <!-- no translation found for stream_unavailable_by_modes (3674139029490353683) -->
- <skip />
- <!-- no translation found for stream_unavailable_by_unknown (6908434629318171588) -->
- <skip />
+ <string name="stream_unavailable_by_modes" msgid="3674139029490353683">"មិនអាចប្រើបានទេ ដោយសារបើក <xliff:g id="MODE">%s</xliff:g>"</string>
+ <string name="stream_unavailable_by_unknown" msgid="6908434629318171588">"មិនមានទេ"</string>
<string name="volume_stream_content_description_unmute" msgid="7729576371406792977">"%1$s។ ប៉ះដើម្បីបើកសំឡេង។"</string>
<string name="volume_stream_content_description_vibrate" msgid="4858111994183089761">"%1$s។ ប៉ះដើម្បីកំណត់ឲ្យញ័រ។ សេវាកម្មលទ្ធភាពប្រើប្រាស់អាចនឹងត្រូវបានបិទសំឡេង។"</string>
<string name="volume_stream_content_description_mute" msgid="4079046784917920984">"%1$s។ ប៉ះដើម្បីបិទសំឡេង។ សេវាកម្មលទ្ធភាពប្រើប្រាស់អាចនឹងត្រូវបានបិទសំឡេង។"</string>
diff --git a/packages/SystemUI/res/values-kn/strings.xml b/packages/SystemUI/res/values-kn/strings.xml
index 57a8cdf2fa66..c4417b7990b0 100644
--- a/packages/SystemUI/res/values-kn/strings.xml
+++ b/packages/SystemUI/res/values-kn/strings.xml
@@ -312,6 +312,10 @@
<string name="quick_settings_bluetooth_audio_sharing_button" msgid="7545274861795853838">"ಆಡಿಯೋ ಹಂಚಿಕೊಳ್ಳಿ"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_sharing" msgid="3069309588231072128">"ಆಡಿಯೋವನ್ನು ಹಂಚಿಕೊಳ್ಳಲಾಗುತ್ತಿದೆ"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_accessibility" msgid="7604615019302091708">"ಆಡಿಯೋ ಹಂಚಿಕೊಳ್ಳುವಿಕೆ ಸೆಟ್ಟಿಂಗ್‌ಗಳನ್ನು ನಮೂದಿಸಿ"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_message" msgid="4251807313264307426">"ಈ ಸಾಧನದ ಸಂಗೀತ ಮತ್ತು ವೀಡಿಯೊಗಳು ಎರಡೂ ಜೋಡಿ ಹೆಡ್‌ಫೋನ್‌ಗಳಲ್ಲಿ ಪ್ಲೇ ಆಗುತ್ತವೆ"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_title" msgid="4406818346036286793">"ನಿಮ್ಮ ಆಡಿಯೋವನ್ನು ಹಂಚಿಕೊಳ್ಳಿ"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_subtitle" msgid="3014906864710059236">"<xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g> ಮತ್ತು <xliff:g id="ACTIVE_DEVICE_NAME">%2$s</xliff:g>"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_switch_to_button" msgid="7546825655978203773">"<xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g> ಗೆ ಬದಲಿಸಿ"</string>
<string name="quick_settings_bluetooth_secondary_label_battery_level" msgid="4182034939479344093">"<xliff:g id="BATTERY_LEVEL_AS_PERCENTAGE">%s</xliff:g> ಬ್ಯಾಟರಿ"</string>
<string name="quick_settings_bluetooth_secondary_label_audio" msgid="780333390310051161">"ಆಡಿಯೋ"</string>
<string name="quick_settings_bluetooth_secondary_label_headset" msgid="2332093067553000852">"ಹೆಡ್‌ಸೆಟ್"</string>
@@ -672,10 +676,8 @@
<string name="stream_notification_unavailable" msgid="4313854556205836435">"ರಿಂಗ್ ಮ್ಯೂಟ್ ಆಗಿರುವ ಕಾರಣ ಲಭ್ಯವಿಲ್ಲ"</string>
<string name="stream_alarm_unavailable" msgid="4059817189292197839">"ಅಡಚಣೆ ಮಾಡಬೇಡಿ ಫೀಚರ್ ಆನ್ ಆಗಿರುವುದರಿಂದ ಲಭ್ಯವಿಲ್ಲ"</string>
<string name="stream_media_unavailable" msgid="6823020894438959853">"ಅಡಚಣೆ ಮಾಡಬೇಡಿ ಫೀಚರ್ ಆನ್ ಆಗಿರುವುದರಿಂದ ಲಭ್ಯವಿಲ್ಲ"</string>
- <!-- no translation found for stream_unavailable_by_modes (3674139029490353683) -->
- <skip />
- <!-- no translation found for stream_unavailable_by_unknown (6908434629318171588) -->
- <skip />
+ <string name="stream_unavailable_by_modes" msgid="3674139029490353683">"<xliff:g id="MODE">%s</xliff:g> ಆನ್ ಆಗಿರುವ ಕಾರಣ ಲಭ್ಯವಿಲ್ಲ"</string>
+ <string name="stream_unavailable_by_unknown" msgid="6908434629318171588">"ಲಭ್ಯವಿಲ್ಲ"</string>
<string name="volume_stream_content_description_unmute" msgid="7729576371406792977">"%1$s. ಅನ್‌ಮ್ಯೂಟ್‌ ಮಾಡುವುದಕ್ಕಾಗಿ ಟ್ಯಾಪ್ ಮಾಡಿ."</string>
<string name="volume_stream_content_description_vibrate" msgid="4858111994183089761">"%1$s. ಕಂಪನಕ್ಕೆ ಹೊಂದಿಸಲು ಟ್ಯಾಪ್ ಮಾಡಿ. ಆ್ಯಕ್ಸೆಸಿಬಿಲಿಟಿ ಸೇವೆಗಳನ್ನು ಮ್ಯೂಟ್‌ ಮಾಡಬಹುದು."</string>
<string name="volume_stream_content_description_mute" msgid="4079046784917920984">"%1$s. ಮ್ಯೂಟ್ ಮಾಡಲು ಟ್ಯಾಪ್ ಮಾಡಿ. ಆ್ಯಕ್ಸೆಸಿಬಿಲಿಟಿ ಸೇವೆಗಳನ್ನು ಮ್ಯೂಟ್‌ ಮಾಡಬಹುದು."</string>
diff --git a/packages/SystemUI/res/values-ko/strings.xml b/packages/SystemUI/res/values-ko/strings.xml
index 9775ad5d9bf1..5602ee79eb37 100644
--- a/packages/SystemUI/res/values-ko/strings.xml
+++ b/packages/SystemUI/res/values-ko/strings.xml
@@ -312,6 +312,10 @@
<string name="quick_settings_bluetooth_audio_sharing_button" msgid="7545274861795853838">"오디오 공유"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_sharing" msgid="3069309588231072128">"오디오 공유 중"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_accessibility" msgid="7604615019302091708">"오디오 공유 설정으로 이동"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_message" msgid="4251807313264307426">"이 기기의 음악 및 동영상이 헤드폰 양쪽에서 재생됩니다."</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_title" msgid="4406818346036286793">"오디오 공유"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_subtitle" msgid="3014906864710059236">"<xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g> 및 <xliff:g id="ACTIVE_DEVICE_NAME">%2$s</xliff:g>"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_switch_to_button" msgid="7546825655978203773">"기기(<xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g>)로 전환"</string>
<string name="quick_settings_bluetooth_secondary_label_battery_level" msgid="4182034939479344093">"배터리 <xliff:g id="BATTERY_LEVEL_AS_PERCENTAGE">%s</xliff:g>"</string>
<string name="quick_settings_bluetooth_secondary_label_audio" msgid="780333390310051161">"오디오"</string>
<string name="quick_settings_bluetooth_secondary_label_headset" msgid="2332093067553000852">"헤드셋"</string>
@@ -672,10 +676,8 @@
<string name="stream_notification_unavailable" msgid="4313854556205836435">"벨소리가 음소거되어 있으므로 사용할 수 없음"</string>
<string name="stream_alarm_unavailable" msgid="4059817189292197839">"방해 금지 모드로 설정되어 있어 사용할 수 없음"</string>
<string name="stream_media_unavailable" msgid="6823020894438959853">"방해 금지 모드로 설정되어 있어 사용할 수 없음"</string>
- <!-- no translation found for stream_unavailable_by_modes (3674139029490353683) -->
- <skip />
- <!-- no translation found for stream_unavailable_by_unknown (6908434629318171588) -->
- <skip />
+ <string name="stream_unavailable_by_modes" msgid="3674139029490353683">"<xliff:g id="MODE">%s</xliff:g> 모드가 사용 설정되어 있어 사용할 수 없음"</string>
+ <string name="stream_unavailable_by_unknown" msgid="6908434629318171588">"사용할 수 없음"</string>
<string name="volume_stream_content_description_unmute" msgid="7729576371406792977">"%1$s. 탭하여 음소거를 해제하세요."</string>
<string name="volume_stream_content_description_vibrate" msgid="4858111994183089761">"%1$s. 탭하여 진동으로 설정하세요. 접근성 서비스가 음소거될 수 있습니다."</string>
<string name="volume_stream_content_description_mute" msgid="4079046784917920984">"%1$s. 탭하여 음소거로 설정하세요. 접근성 서비스가 음소거될 수 있습니다."</string>
diff --git a/packages/SystemUI/res/values-ky/strings.xml b/packages/SystemUI/res/values-ky/strings.xml
index 80b75b933cca..93777db15280 100644
--- a/packages/SystemUI/res/values-ky/strings.xml
+++ b/packages/SystemUI/res/values-ky/strings.xml
@@ -312,6 +312,10 @@
<string name="quick_settings_bluetooth_audio_sharing_button" msgid="7545274861795853838">"Чогуу угуу"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_sharing" msgid="3069309588231072128">"Чогуу угулууда"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_accessibility" msgid="7604615019302091708">"чогуу угуу параметрлерин киргизүү"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_message" msgid="4251807313264307426">"Бул түзмөктөгү музыка жана видеолор гарнитуранын эки кулагынан тең угулат"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_title" msgid="4406818346036286793">"Чогуу угуңуз"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_subtitle" msgid="3014906864710059236">"<xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g> жана <xliff:g id="ACTIVE_DEVICE_NAME">%2$s</xliff:g>"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_switch_to_button" msgid="7546825655978203773">"<xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g> түзмөгүнө которулуу"</string>
<string name="quick_settings_bluetooth_secondary_label_battery_level" msgid="4182034939479344093">"Батареянын деңгээли <xliff:g id="BATTERY_LEVEL_AS_PERCENTAGE">%s</xliff:g>"</string>
<string name="quick_settings_bluetooth_secondary_label_audio" msgid="780333390310051161">"Аудио"</string>
<string name="quick_settings_bluetooth_secondary_label_headset" msgid="2332093067553000852">"Гарнитура"</string>
@@ -672,10 +676,8 @@
<string name="stream_notification_unavailable" msgid="4313854556205836435">"Үнсүз режимде жеткиликсиз"</string>
<string name="stream_alarm_unavailable" msgid="4059817189292197839">"\"Тынчымды алба\" режими күйүк болгондуктан, жеткиликсиз"</string>
<string name="stream_media_unavailable" msgid="6823020894438959853">"\"Тынчымды алба\" режими күйүк болгондуктан, жеткиликсиз"</string>
- <!-- no translation found for stream_unavailable_by_modes (3674139029490353683) -->
- <skip />
- <!-- no translation found for stream_unavailable_by_unknown (6908434629318171588) -->
- <skip />
+ <string name="stream_unavailable_by_modes" msgid="3674139029490353683">"<xliff:g id="MODE">%s</xliff:g> күйүп тургандыктан жеткиликсиз"</string>
+ <string name="stream_unavailable_by_unknown" msgid="6908434629318171588">"Жеткиликсиз"</string>
<string name="volume_stream_content_description_unmute" msgid="7729576371406792977">"%1$s. Үнүн чыгаруу үчүн таптап коюңуз."</string>
<string name="volume_stream_content_description_vibrate" msgid="4858111994183089761">"%1$s. Дирилдөөгө коюу үчүн таптап коюңуз. Атайын мүмкүнчүлүктөр кызматынын үнүн өчүрүп койсо болот."</string>
<string name="volume_stream_content_description_mute" msgid="4079046784917920984">"%1$s. Үнүн өчүрүү үчүн таптап коюңуз. Атайын мүмкүнчүлүктөр кызматынын үнүн өчүрүп койсо болот."</string>
diff --git a/packages/SystemUI/res/values-lo/strings.xml b/packages/SystemUI/res/values-lo/strings.xml
index 3a09b2a25995..07f3853b3c8b 100644
--- a/packages/SystemUI/res/values-lo/strings.xml
+++ b/packages/SystemUI/res/values-lo/strings.xml
@@ -312,6 +312,10 @@
<string name="quick_settings_bluetooth_audio_sharing_button" msgid="7545274861795853838">"ແບ່ງປັນສຽງ"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_sharing" msgid="3069309588231072128">"ກຳລັງແບ່ງປັນສຽງ"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_accessibility" msgid="7604615019302091708">"ເຂົ້າສູ່ການຕັ້ງຄ່າການແບ່ງປັນສຽງ"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_message" msgid="4251807313264307426">"ເພງ ແລະ ວິດີໂອຂອງອຸປະກອນເຄື່ອງນີ້ຈະຫຼິ້ນຢູ່ຫູຟັງທັງສອງຄູ່"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_title" msgid="4406818346036286793">"ແບ່ງປັນສຽງຂອງທ່ານ"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_subtitle" msgid="3014906864710059236">"<xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g> ແລະ <xliff:g id="ACTIVE_DEVICE_NAME">%2$s</xliff:g>"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_switch_to_button" msgid="7546825655978203773">"ປ່ຽນເປັນ <xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g>"</string>
<string name="quick_settings_bluetooth_secondary_label_battery_level" msgid="4182034939479344093">"ແບັດເຕີຣີ <xliff:g id="BATTERY_LEVEL_AS_PERCENTAGE">%s</xliff:g>"</string>
<string name="quick_settings_bluetooth_secondary_label_audio" msgid="780333390310051161">"ສຽງ"</string>
<string name="quick_settings_bluetooth_secondary_label_headset" msgid="2332093067553000852">"ຊຸດຫູຟັງ"</string>
@@ -672,10 +676,8 @@
<string name="stream_notification_unavailable" msgid="4313854556205836435">"ບໍ່ມີໃຫ້ໃຊ້ເນື່ອງຈາກມີການປິດສຽງໂທເຂົ້າ"</string>
<string name="stream_alarm_unavailable" msgid="4059817189292197839">"ບໍ່ມີໃຫ້ຍ້ອນວ່າຫ້າມລົບກວນເປີດຢູ່"</string>
<string name="stream_media_unavailable" msgid="6823020894438959853">"ບໍ່ມີໃຫ້ຍ້ອນວ່າຫ້າມລົບກວນເປີດຢູ່"</string>
- <!-- no translation found for stream_unavailable_by_modes (3674139029490353683) -->
- <skip />
- <!-- no translation found for stream_unavailable_by_unknown (6908434629318171588) -->
- <skip />
+ <string name="stream_unavailable_by_modes" msgid="3674139029490353683">"ບໍ່ສາມາດໃຊ້ໄດ້ເນື່ອງຈາກ <xliff:g id="MODE">%s</xliff:g> ເປີດຢູ່"</string>
+ <string name="stream_unavailable_by_unknown" msgid="6908434629318171588">"ບໍ່ສາມາດໃຊ້ໄດ້"</string>
<string name="volume_stream_content_description_unmute" msgid="7729576371406792977">"%1$s. ແຕະເພື່ອເຊົາປິດສຽງ."</string>
<string name="volume_stream_content_description_vibrate" msgid="4858111994183089761">"%1$s. ແຕະເພື່ອຕັ້ງເປັນສັ່ນ. ບໍລິການຊ່ວຍເຂົ້າເຖິງອາດຖືກປິດສຽງໄວ້."</string>
<string name="volume_stream_content_description_mute" msgid="4079046784917920984">"%1$s. ແຕະເພື່ອປິດສຽງ. ບໍລິການຊ່ວຍເຂົ້າເຖິງອາດຖືກປິດສຽງໄວ້."</string>
diff --git a/packages/SystemUI/res/values-lt/strings.xml b/packages/SystemUI/res/values-lt/strings.xml
index f3f383e4d418..605b8dd2e303 100644
--- a/packages/SystemUI/res/values-lt/strings.xml
+++ b/packages/SystemUI/res/values-lt/strings.xml
@@ -312,6 +312,10 @@
<string name="quick_settings_bluetooth_audio_sharing_button" msgid="7545274861795853838">"Bendrinti garsą"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_sharing" msgid="3069309588231072128">"Bendrinamas garsas"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_accessibility" msgid="7604615019302091708">"įvesti garso įrašų bendrinimo nustatymus"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_message" msgid="4251807313264307426">"Šio įrenginio muzika ir vaizdo įrašai bus leidžiami abiejose ausinėse"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_title" msgid="4406818346036286793">"Garso įrašo bendrinimas"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_subtitle" msgid="3014906864710059236">"<xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g> ir <xliff:g id="ACTIVE_DEVICE_NAME">%2$s</xliff:g>"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_switch_to_button" msgid="7546825655978203773">"Perjungti į <xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g>"</string>
<string name="quick_settings_bluetooth_secondary_label_battery_level" msgid="4182034939479344093">"Akumuliatorius: <xliff:g id="BATTERY_LEVEL_AS_PERCENTAGE">%s</xliff:g>"</string>
<string name="quick_settings_bluetooth_secondary_label_audio" msgid="780333390310051161">"Garsas"</string>
<string name="quick_settings_bluetooth_secondary_label_headset" msgid="2332093067553000852">"Virtualiosios realybės įrenginys"</string>
@@ -672,10 +676,8 @@
<string name="stream_notification_unavailable" msgid="4313854556205836435">"Nepasiekiama, nes skambutis nutildytas"</string>
<string name="stream_alarm_unavailable" msgid="4059817189292197839">"Nepasiekiama, nes įjungtas netrukdymo režimas"</string>
<string name="stream_media_unavailable" msgid="6823020894438959853">"Nepasiekiama, nes įjungtas netrukdymo režimas"</string>
- <!-- no translation found for stream_unavailable_by_modes (3674139029490353683) -->
- <skip />
- <!-- no translation found for stream_unavailable_by_unknown (6908434629318171588) -->
- <skip />
+ <string name="stream_unavailable_by_modes" msgid="3674139029490353683">"Nepasiekiama, nes įjungtas režimas „<xliff:g id="MODE">%s</xliff:g>“"</string>
+ <string name="stream_unavailable_by_unknown" msgid="6908434629318171588">"Nepasiekiama"</string>
<string name="volume_stream_content_description_unmute" msgid="7729576371406792977">"%1$s. Palieskite, kad įjungtumėte garsą."</string>
<string name="volume_stream_content_description_vibrate" msgid="4858111994183089761">"%1$s. Palieskite, kad nustatytumėte vibravimą. Gali būti nutildytos pritaikymo neįgaliesiems paslaugos."</string>
<string name="volume_stream_content_description_mute" msgid="4079046784917920984">"%1$s. Palieskite, kad nutildytumėte. Gali būti nutildytos pritaikymo neįgaliesiems paslaugos."</string>
diff --git a/packages/SystemUI/res/values-lv/strings.xml b/packages/SystemUI/res/values-lv/strings.xml
index 9c22eed6bbd9..0393ad50a619 100644
--- a/packages/SystemUI/res/values-lv/strings.xml
+++ b/packages/SystemUI/res/values-lv/strings.xml
@@ -312,6 +312,10 @@
<string name="quick_settings_bluetooth_audio_sharing_button" msgid="7545274861795853838">"Kopīgot audio"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_sharing" msgid="3069309588231072128">"Notiek audio kopīgošana…"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_accessibility" msgid="7604615019302091708">"atvērt audio kopīgošanas iestatījumus"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_message" msgid="4251807313264307426">"Mūzika un videoklipi no šīs ierīces tiks atskaņoti abās austiņās"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_title" msgid="4406818346036286793">"Audio kopīgošana"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_subtitle" msgid="3014906864710059236">"<xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g> un <xliff:g id="ACTIVE_DEVICE_NAME">%2$s</xliff:g>"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_switch_to_button" msgid="7546825655978203773">"Pārslēgties uz šādu ierīci: <xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g>"</string>
<string name="quick_settings_bluetooth_secondary_label_battery_level" msgid="4182034939479344093">"Akumulators: <xliff:g id="BATTERY_LEVEL_AS_PERCENTAGE">%s</xliff:g>"</string>
<string name="quick_settings_bluetooth_secondary_label_audio" msgid="780333390310051161">"Audio"</string>
<string name="quick_settings_bluetooth_secondary_label_headset" msgid="2332093067553000852">"Austiņas"</string>
@@ -672,10 +676,8 @@
<string name="stream_notification_unavailable" msgid="4313854556205836435">"Nevar mainīt, jo izslēgts skaņas signāls"</string>
<string name="stream_alarm_unavailable" msgid="4059817189292197839">"Nav pieejams, jo ir ieslēgts režīms Netraucēt"</string>
<string name="stream_media_unavailable" msgid="6823020894438959853">"Nav pieejams, jo ir ieslēgts režīms Netraucēt"</string>
- <!-- no translation found for stream_unavailable_by_modes (3674139029490353683) -->
- <skip />
- <!-- no translation found for stream_unavailable_by_unknown (6908434629318171588) -->
- <skip />
+ <string name="stream_unavailable_by_modes" msgid="3674139029490353683">"Nav pieejams, jo ir ieslēgts režīms <xliff:g id="MODE">%s</xliff:g>"</string>
+ <string name="stream_unavailable_by_unknown" msgid="6908434629318171588">"Nav pieejams"</string>
<string name="volume_stream_content_description_unmute" msgid="7729576371406792977">"%1$s. Pieskarieties, lai ieslēgtu skaņu."</string>
<string name="volume_stream_content_description_vibrate" msgid="4858111994183089761">"%1$s. Pieskarieties, lai iestatītu uz vibrozvanu. Var tikt izslēgti pieejamības pakalpojumu signāli."</string>
<string name="volume_stream_content_description_mute" msgid="4079046784917920984">"%1$s. Pieskarieties, lai izslēgtu skaņu. Var tikt izslēgti pieejamības pakalpojumu signāli."</string>
diff --git a/packages/SystemUI/res/values-mk/strings.xml b/packages/SystemUI/res/values-mk/strings.xml
index 6e37907b6ffb..6b956ec6f532 100644
--- a/packages/SystemUI/res/values-mk/strings.xml
+++ b/packages/SystemUI/res/values-mk/strings.xml
@@ -312,6 +312,10 @@
<string name="quick_settings_bluetooth_audio_sharing_button" msgid="7545274861795853838">"Споделувај аудио"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_sharing" msgid="3069309588231072128">"Се споделува аудио"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_accessibility" msgid="7604615019302091708">"внесете ги поставките за „Споделување аудио“"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_message" msgid="4251807313264307426">"Музиката и видеата на уредов ќе се пуштаaт на двата пара слушалки"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_title" msgid="4406818346036286793">"Споделете го аудиото"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_subtitle" msgid="3014906864710059236">"<xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g> и <xliff:g id="ACTIVE_DEVICE_NAME">%2$s</xliff:g>"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_switch_to_button" msgid="7546825655978203773">"Префрли на <xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g>"</string>
<string name="quick_settings_bluetooth_secondary_label_battery_level" msgid="4182034939479344093">"Батерија: <xliff:g id="BATTERY_LEVEL_AS_PERCENTAGE">%s</xliff:g>"</string>
<string name="quick_settings_bluetooth_secondary_label_audio" msgid="780333390310051161">"Аудио"</string>
<string name="quick_settings_bluetooth_secondary_label_headset" msgid="2332093067553000852">"Слушалки"</string>
@@ -440,8 +444,7 @@
<string name="zen_mode_on" msgid="9085304934016242591">"Вклучено"</string>
<string name="zen_mode_on_with_details" msgid="7416143430557895497">"Вклучено: <xliff:g id="TRIGGER_DESCRIPTION">%1$s</xliff:g>"</string>
<string name="zen_mode_off" msgid="1736604456618147306">"Исклучено"</string>
- <!-- no translation found for zen_mode_set_up (8231201163894922821) -->
- <skip />
+ <string name="zen_mode_set_up" msgid="8231201163894922821">"Не е поставено"</string>
<string name="zen_mode_no_manual_invocation" msgid="1769975741344633672">"Управувајте во поставките"</string>
<string name="zen_mode_active_modes" msgid="1625850411578488856">"{count,plural, =0{Нема активни режими}=1{Активен е {mode}}one{Активни се # режим}other{Активни се # режими}}"</string>
<string name="zen_priority_introduction" msgid="3159291973383796646">"Нема да ве вознемируваат звуци и вибрации, освен од аларми, потсетници, настани и повикувачи што ќе ги наведете. Сѐ уште ќе слушате сѐ што ќе изберете да пуштите, како музика, видеа и игри."</string>
@@ -673,10 +676,8 @@
<string name="stream_notification_unavailable" msgid="4313854556205836435">"Недостапно бидејќи звукот е исклучен"</string>
<string name="stream_alarm_unavailable" msgid="4059817189292197839">"Недостапно бидејќи е вклучено „Не вознемирувај“"</string>
<string name="stream_media_unavailable" msgid="6823020894438959853">"Недостапно бидејќи е вклучено „Не вознемирувај“"</string>
- <!-- no translation found for stream_unavailable_by_modes (3674139029490353683) -->
- <skip />
- <!-- no translation found for stream_unavailable_by_unknown (6908434629318171588) -->
- <skip />
+ <string name="stream_unavailable_by_modes" msgid="3674139029490353683">"Недостапно бидејќи има вклучено <xliff:g id="MODE">%s</xliff:g>"</string>
+ <string name="stream_unavailable_by_unknown" msgid="6908434629318171588">"Недостапно"</string>
<string name="volume_stream_content_description_unmute" msgid="7729576371406792977">"%1$s. Допрете за да вклучите звук."</string>
<string name="volume_stream_content_description_vibrate" msgid="4858111994183089761">"%1$s. Допрете за да поставите на вибрации. Можеби ќе се исклучи звукот на услугите за достапност."</string>
<string name="volume_stream_content_description_mute" msgid="4079046784917920984">"%1$s. Допрете за да исклучите звук. Можеби ќе се исклучи звукот на услугите за достапност."</string>
@@ -1410,38 +1411,26 @@
<string name="launch_touchpad_tutorial_notification_content" msgid="7931085031240753226">"Научете движења за допирната подлога"</string>
<string name="launch_keyboard_touchpad_tutorial_notification_title" msgid="1940023776496198762">"Движете се со користење на тастатурата и допирната подлога"</string>
<string name="launch_keyboard_touchpad_tutorial_notification_content" msgid="1780725168171929365">"Научете движења за допирната подлога, кратенки од тастатурата и друго"</string>
- <!-- no translation found for touchpad_tutorial_back_gesture_button (3104716365403620315) -->
- <skip />
- <!-- no translation found for touchpad_tutorial_home_gesture_button (8023973153559885624) -->
- <skip />
+ <string name="touchpad_tutorial_back_gesture_button" msgid="3104716365403620315">"Врати се назад"</string>
+ <string name="touchpad_tutorial_home_gesture_button" msgid="8023973153559885624">"Оди на почетниот екран"</string>
<string name="touchpad_tutorial_recent_apps_gesture_button" msgid="8919227647650347359">"Прегледајте ги неодамнешните апликации"</string>
<string name="touchpad_tutorial_done_button" msgid="176168488821755503">"Готово"</string>
<string name="touchpad_back_gesture_action_title" msgid="7199067250654332735">"Назад"</string>
- <!-- no translation found for touchpad_back_gesture_guidance (5352221087725906542) -->
- <skip />
- <!-- no translation found for touchpad_back_gesture_success_title (7370719098633023496) -->
- <skip />
+ <string name="touchpad_back_gesture_guidance" msgid="5352221087725906542">"Повлечете налево или надесно со три прста на допирната подлога"</string>
+ <string name="touchpad_back_gesture_success_title" msgid="7370719098633023496">"Одлично!"</string>
<string name="touchpad_back_gesture_success_body" msgid="2324724953720741719">"Го научивте движењето за враќање назад."</string>
<string name="touchpad_home_gesture_action_title" msgid="8885107349719257882">"Одете на почетниот екран"</string>
- <!-- no translation found for touchpad_home_gesture_guidance (4178219118381915899) -->
- <skip />
- <!-- no translation found for touchpad_home_gesture_success_title (3648264553645798470) -->
- <skip />
- <!-- no translation found for touchpad_home_gesture_success_body (2590690589194027059) -->
- <skip />
+ <string name="touchpad_home_gesture_guidance" msgid="4178219118381915899">"Повлечете нагоре со три прсти на допирната подлога"</string>
+ <string name="touchpad_home_gesture_success_title" msgid="3648264553645798470">"Одлично!"</string>
+ <string name="touchpad_home_gesture_success_body" msgid="2590690589194027059">"Го завршивте движењето за враќање на почетниот екран"</string>
<string name="touchpad_recent_apps_gesture_action_title" msgid="934906836867137906">"Прегледајте ги неодамнешните апликации"</string>
- <!-- no translation found for touchpad_recent_apps_gesture_guidance (6304446013842271822) -->
- <skip />
+ <string name="touchpad_recent_apps_gesture_guidance" msgid="6304446013842271822">"Повлечете нагоре и задржете со три прста на допирната подлога"</string>
<string name="touchpad_recent_apps_gesture_success_title" msgid="8481920554139332593">"Одлично!"</string>
<string name="touchpad_recent_apps_gesture_success_body" msgid="4334263906697493273">"Го завршивте движењето за прегледување на неодамнешните апликации."</string>
- <!-- no translation found for tutorial_action_key_title (8172535792469008169) -->
- <skip />
- <!-- no translation found for tutorial_action_key_guidance (5040613427202799294) -->
- <skip />
- <!-- no translation found for tutorial_action_key_success_title (2371827347071979571) -->
- <skip />
- <!-- no translation found for tutorial_action_key_success_body (1688986269491357832) -->
- <skip />
+ <string name="tutorial_action_key_title" msgid="8172535792469008169">"Прегледајте ги сите апликации"</string>
+ <string name="tutorial_action_key_guidance" msgid="5040613427202799294">"Притиснете го копчето за дејство на тастатурата"</string>
+ <string name="tutorial_action_key_success_title" msgid="2371827347071979571">"Браво!"</string>
+ <string name="tutorial_action_key_success_body" msgid="1688986269491357832">"Го завршивте движењето за прегледување на сите апликации"</string>
<string name="keyboard_backlight_dialog_title" msgid="8273102932345564724">"Осветлување на тастатура"</string>
<string name="keyboard_backlight_value" msgid="7336398765584393538">"Ниво %1$d од %2$d"</string>
<string name="home_controls_dream_label" msgid="6567105701292324257">"Контроли за домот"</string>
diff --git a/packages/SystemUI/res/values-ml/strings.xml b/packages/SystemUI/res/values-ml/strings.xml
index bf446d988eb7..cd0a0442d3b0 100644
--- a/packages/SystemUI/res/values-ml/strings.xml
+++ b/packages/SystemUI/res/values-ml/strings.xml
@@ -312,6 +312,10 @@
<string name="quick_settings_bluetooth_audio_sharing_button" msgid="7545274861795853838">"ഓഡിയോ പങ്കിടുക"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_sharing" msgid="3069309588231072128">"ഓഡിയോ പങ്കിടുന്നു"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_accessibility" msgid="7604615019302091708">"ഓഡിയോ പങ്കിടൽ ക്രമീകരണം നൽകുക"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_message" msgid="4251807313264307426">"രണ്ട് ജോടി ഹെഡ്‌ഫോണുകളിലൂടെയും ഈ ഉപകരണത്തിലെ സംഗീതവും വീഡിയോകളും പ്ലേ ചെയ്യും"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_title" msgid="4406818346036286793">"നിങ്ങളുടെ ഓഡിയോ പങ്കിടുക"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_subtitle" msgid="3014906864710059236">"<xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g>, <xliff:g id="ACTIVE_DEVICE_NAME">%2$s</xliff:g>"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_switch_to_button" msgid="7546825655978203773">"<xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g> എന്നതിലേക്ക് മാറുക"</string>
<string name="quick_settings_bluetooth_secondary_label_battery_level" msgid="4182034939479344093">"<xliff:g id="BATTERY_LEVEL_AS_PERCENTAGE">%s</xliff:g> ബാറ്ററി"</string>
<string name="quick_settings_bluetooth_secondary_label_audio" msgid="780333390310051161">"ഓഡിയോ"</string>
<string name="quick_settings_bluetooth_secondary_label_headset" msgid="2332093067553000852">"ഹെഡ്‌സെറ്റ്"</string>
@@ -672,10 +676,8 @@
<string name="stream_notification_unavailable" msgid="4313854556205836435">"റിംഗ് മ്യൂട്ട് ചെയ്തതിനാൽ ലഭ്യമല്ല"</string>
<string name="stream_alarm_unavailable" msgid="4059817189292197839">"ശല്യപ്പെടുത്തരുത് ഓണായതിനാൽ ലഭ്യമല്ല"</string>
<string name="stream_media_unavailable" msgid="6823020894438959853">"ശല്യപ്പെടുത്തരുത് ഓണായതിനാൽ ലഭ്യമല്ല"</string>
- <!-- no translation found for stream_unavailable_by_modes (3674139029490353683) -->
- <skip />
- <!-- no translation found for stream_unavailable_by_unknown (6908434629318171588) -->
- <skip />
+ <string name="stream_unavailable_by_modes" msgid="3674139029490353683">"<xliff:g id="MODE">%s</xliff:g> ഓണായതിനാൽ ലഭ്യമല്ല"</string>
+ <string name="stream_unavailable_by_unknown" msgid="6908434629318171588">"ലഭ്യമല്ല"</string>
<string name="volume_stream_content_description_unmute" msgid="7729576371406792977">"%1$s. അൺമ്യൂട്ടുചെയ്യുന്നതിന് ടാപ്പുചെയ്യുക."</string>
<string name="volume_stream_content_description_vibrate" msgid="4858111994183089761">"%1$s. വൈബ്രേറ്റിലേക്ക് സജ്ജമാക്കുന്നതിന് ടാപ്പുചെയ്യുക. ഉപയോഗസഹായി സേവനങ്ങൾ മ്യൂട്ടുചെയ്യപ്പെട്ടേക്കാം."</string>
<string name="volume_stream_content_description_mute" msgid="4079046784917920984">"%1$s. മ്യൂട്ടുചെയ്യുന്നതിന് ടാപ്പുചെയ്യുക. ഉപയോഗസഹായി സേവനങ്ങൾ മ്യൂട്ടുചെയ്യപ്പെട്ടേക്കാം."</string>
diff --git a/packages/SystemUI/res/values-mn/strings.xml b/packages/SystemUI/res/values-mn/strings.xml
index 1bd6768e93de..e4f174641043 100644
--- a/packages/SystemUI/res/values-mn/strings.xml
+++ b/packages/SystemUI/res/values-mn/strings.xml
@@ -312,6 +312,10 @@
<string name="quick_settings_bluetooth_audio_sharing_button" msgid="7545274861795853838">"Аудио хуваалцах"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_sharing" msgid="3069309588231072128">"Аудио хуваалцаж байна"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_accessibility" msgid="7604615019302091708">"аудио хуваалцах тохиргоог оруулах"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_message" msgid="4251807313264307426">"Энэ төхөөрөмжийн хөгжим, видеонуудыг чихэвчийн хоёр талд тоглуулна"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_title" msgid="4406818346036286793">"Аудиогоо хуваалцах"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_subtitle" msgid="3014906864710059236">"<xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g>, <xliff:g id="ACTIVE_DEVICE_NAME">%2$s</xliff:g>"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_switch_to_button" msgid="7546825655978203773">"<xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g> руу сэлгэх"</string>
<string name="quick_settings_bluetooth_secondary_label_battery_level" msgid="4182034939479344093">"<xliff:g id="BATTERY_LEVEL_AS_PERCENTAGE">%s</xliff:g> батарей"</string>
<string name="quick_settings_bluetooth_secondary_label_audio" msgid="780333390310051161">"Аудио"</string>
<string name="quick_settings_bluetooth_secondary_label_headset" msgid="2332093067553000852">"Чихэвч"</string>
@@ -440,8 +444,7 @@
<string name="zen_mode_on" msgid="9085304934016242591">"Асаалттай"</string>
<string name="zen_mode_on_with_details" msgid="7416143430557895497">"Асаасан • <xliff:g id="TRIGGER_DESCRIPTION">%1$s</xliff:g>"</string>
<string name="zen_mode_off" msgid="1736604456618147306">"Унтраалттай"</string>
- <!-- no translation found for zen_mode_set_up (8231201163894922821) -->
- <skip />
+ <string name="zen_mode_set_up" msgid="8231201163894922821">"Тохируулаагүй"</string>
<string name="zen_mode_no_manual_invocation" msgid="1769975741344633672">"Тохиргоонд удирдах"</string>
<string name="zen_mode_active_modes" msgid="1625850411578488856">"{count,plural, =0{Ямар ч идэвхтэй горим байхгүй}=1{{mode} идэвхтэй байна}other{# горим идэвхтэй байна}}"</string>
<string name="zen_priority_introduction" msgid="3159291973383796646">"Танд сэрүүлэг, сануулга, арга хэмжээ, таны сонгосон дуудлага илгээгчээс бусад дуу, чичиргээ саад болохгүй. Та хөгжим, видео, тоглоом зэрэг тоглуулахыг хүссэн бүх зүйлээ сонсох боломжтой хэвээр байна."</string>
@@ -673,10 +676,8 @@
<string name="stream_notification_unavailable" msgid="4313854556205836435">"Хонхны дууг хаасан тул боломжгүй"</string>
<string name="stream_alarm_unavailable" msgid="4059817189292197839">"Бүү саад бол асаалттай тул боломжгүй"</string>
<string name="stream_media_unavailable" msgid="6823020894438959853">"Бүү саад бол асаалттай тул боломжгүй"</string>
- <!-- no translation found for stream_unavailable_by_modes (3674139029490353683) -->
- <skip />
- <!-- no translation found for stream_unavailable_by_unknown (6908434629318171588) -->
- <skip />
+ <string name="stream_unavailable_by_modes" msgid="3674139029490353683">"<xliff:g id="MODE">%s</xliff:g> асаалттай тул боломжгүй"</string>
+ <string name="stream_unavailable_by_unknown" msgid="6908434629318171588">"Боломжгүй"</string>
<string name="volume_stream_content_description_unmute" msgid="7729576371406792977">"%1$s. Дууг нь нээхийн тулд товшино уу."</string>
<string name="volume_stream_content_description_vibrate" msgid="4858111994183089761">"%1$s. Чичиргээнд тохируулахын тулд товшино уу. Хүртээмжийн үйлчилгээний дууг хаасан."</string>
<string name="volume_stream_content_description_mute" msgid="4079046784917920984">"%1$s. Дууг нь хаахын тулд товшино уу. Хүртээмжийн үйлчилгээний дууг хаасан."</string>
@@ -1410,38 +1411,26 @@
<string name="launch_touchpad_tutorial_notification_content" msgid="7931085031240753226">"Мэдрэгч самбарын зангааг мэдэж аваарай"</string>
<string name="launch_keyboard_touchpad_tutorial_notification_title" msgid="1940023776496198762">"Гар эсвэл мэдрэгч самбараа ашиглан шилжээрэй"</string>
<string name="launch_keyboard_touchpad_tutorial_notification_content" msgid="1780725168171929365">"Мэдрэгч самбарын зангаа, товчлуурын шууд холбоос болон бусад зүйлийг мэдэж аваарай"</string>
- <!-- no translation found for touchpad_tutorial_back_gesture_button (3104716365403620315) -->
- <skip />
- <!-- no translation found for touchpad_tutorial_home_gesture_button (8023973153559885624) -->
- <skip />
+ <string name="touchpad_tutorial_back_gesture_button" msgid="3104716365403620315">"Буцах"</string>
+ <string name="touchpad_tutorial_home_gesture_button" msgid="8023973153559885624">"Нүүр хуудас руу очих"</string>
<string name="touchpad_tutorial_recent_apps_gesture_button" msgid="8919227647650347359">"Саяхны аппуудыг харах"</string>
<string name="touchpad_tutorial_done_button" msgid="176168488821755503">"Болсон"</string>
<string name="touchpad_back_gesture_action_title" msgid="7199067250654332735">"Буцах"</string>
- <!-- no translation found for touchpad_back_gesture_guidance (5352221087725906542) -->
- <skip />
- <!-- no translation found for touchpad_back_gesture_success_title (7370719098633023496) -->
- <skip />
+ <string name="touchpad_back_gesture_guidance" msgid="5352221087725906542">"Мэдрэгч самбар дээрээ гурван хуруугаа ашиглан зүүн эсвэл баруун тийш шударна уу"</string>
+ <string name="touchpad_back_gesture_success_title" msgid="7370719098633023496">"Янзтай!"</string>
<string name="touchpad_back_gesture_success_body" msgid="2324724953720741719">"Та буцах зангааг гүйцэтгэлээ."</string>
<string name="touchpad_home_gesture_action_title" msgid="8885107349719257882">"Үндсэн нүүр лүү очих"</string>
- <!-- no translation found for touchpad_home_gesture_guidance (4178219118381915899) -->
- <skip />
- <!-- no translation found for touchpad_home_gesture_success_title (3648264553645798470) -->
- <skip />
- <!-- no translation found for touchpad_home_gesture_success_body (2590690589194027059) -->
- <skip />
+ <string name="touchpad_home_gesture_guidance" msgid="4178219118381915899">"Мэдрэгч самбар дээрээ гурван хуруугаараа дээш шударна уу"</string>
+ <string name="touchpad_home_gesture_success_title" msgid="3648264553645798470">"Үнэхээр сайн ажиллалаа!"</string>
+ <string name="touchpad_home_gesture_success_body" msgid="2590690589194027059">"Та үндсэн нүүр лүү очих зангааг гүйцэтгэлээ"</string>
<string name="touchpad_recent_apps_gesture_action_title" msgid="934906836867137906">"Саяхны аппуудыг харах"</string>
- <!-- no translation found for touchpad_recent_apps_gesture_guidance (6304446013842271822) -->
- <skip />
+ <string name="touchpad_recent_apps_gesture_guidance" msgid="6304446013842271822">"Мэдрэгч самбар дээрээ гурван хуруугаа ашиглан дээш шудраад, удаан дарна уу"</string>
<string name="touchpad_recent_apps_gesture_success_title" msgid="8481920554139332593">"Сайн байна!"</string>
<string name="touchpad_recent_apps_gesture_success_body" msgid="4334263906697493273">"Та саяхны аппуудыг харах зангааг гүйцэтгэсэн."</string>
- <!-- no translation found for tutorial_action_key_title (8172535792469008169) -->
- <skip />
- <!-- no translation found for tutorial_action_key_guidance (5040613427202799294) -->
- <skip />
- <!-- no translation found for tutorial_action_key_success_title (2371827347071979571) -->
- <skip />
- <!-- no translation found for tutorial_action_key_success_body (1688986269491357832) -->
- <skip />
+ <string name="tutorial_action_key_title" msgid="8172535792469008169">"Бүх аппыг харах"</string>
+ <string name="tutorial_action_key_guidance" msgid="5040613427202799294">"Гар дээр тань байх тусгай товчийг дарна уу"</string>
+ <string name="tutorial_action_key_success_title" msgid="2371827347071979571">"Сайн байна!"</string>
+ <string name="tutorial_action_key_success_body" msgid="1688986269491357832">"Та бүх аппыг харах зангааг гүйцэтгэлээ"</string>
<string name="keyboard_backlight_dialog_title" msgid="8273102932345564724">"Гарын арын гэрэл"</string>
<string name="keyboard_backlight_value" msgid="7336398765584393538">"%2$d-с %1$d-р түвшин"</string>
<string name="home_controls_dream_label" msgid="6567105701292324257">"Гэрийн удирдлага"</string>
diff --git a/packages/SystemUI/res/values-mr/strings.xml b/packages/SystemUI/res/values-mr/strings.xml
index 60718b9e4172..458fe2cb3c84 100644
--- a/packages/SystemUI/res/values-mr/strings.xml
+++ b/packages/SystemUI/res/values-mr/strings.xml
@@ -312,6 +312,10 @@
<string name="quick_settings_bluetooth_audio_sharing_button" msgid="7545274861795853838">"ऑडिओ शेअर करा"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_sharing" msgid="3069309588231072128">"ऑडिओ शेअर करत आहे"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_accessibility" msgid="7604615019302091708">"ऑडिओ शेअरिंग सेटिंग्ज एंटर करा"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_message" msgid="4251807313264307426">"या डिव्हाइसचे संगीत आणि व्हिडिओ हेडफोनच्या दोन्ही पेअरवर प्ले होतील"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_title" msgid="4406818346036286793">"तुमचा ऑडिओ शेअर करा"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_subtitle" msgid="3014906864710059236">"<xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g> आणि <xliff:g id="ACTIVE_DEVICE_NAME">%2$s</xliff:g>"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_switch_to_button" msgid="7546825655978203773">"<xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g> वर स्विच करा"</string>
<string name="quick_settings_bluetooth_secondary_label_battery_level" msgid="4182034939479344093">"<xliff:g id="BATTERY_LEVEL_AS_PERCENTAGE">%s</xliff:g> बॅटरी"</string>
<string name="quick_settings_bluetooth_secondary_label_audio" msgid="780333390310051161">"ऑडिओ"</string>
<string name="quick_settings_bluetooth_secondary_label_headset" msgid="2332093067553000852">"हेडसेट"</string>
@@ -672,10 +676,8 @@
<string name="stream_notification_unavailable" msgid="4313854556205836435">"रिंग म्यूट केल्यामुळे उपलब्ध नाही"</string>
<string name="stream_alarm_unavailable" msgid="4059817189292197839">"व्यत्यय आणू नका हे सुरू असल्यामुळे उपलब्ध नाही"</string>
<string name="stream_media_unavailable" msgid="6823020894438959853">"व्यत्यय आणू नका हे सुरू असल्यामुळे उपलब्ध नाही"</string>
- <!-- no translation found for stream_unavailable_by_modes (3674139029490353683) -->
- <skip />
- <!-- no translation found for stream_unavailable_by_unknown (6908434629318171588) -->
- <skip />
+ <string name="stream_unavailable_by_modes" msgid="3674139029490353683">"<xliff:g id="MODE">%s</xliff:g> सुरू असल्यामुळे उपलब्ध नाही"</string>
+ <string name="stream_unavailable_by_unknown" msgid="6908434629318171588">"उपलब्ध नाही"</string>
<string name="volume_stream_content_description_unmute" msgid="7729576371406792977">"%1$s. अनम्यूट करण्यासाठी टॅप करा."</string>
<string name="volume_stream_content_description_vibrate" msgid="4858111994183089761">"%1$s. व्हायब्रेट सेट करण्यासाठी टॅप करा. प्रवेशयोग्यता सेवा म्यूट केल्या जाऊ शकतात."</string>
<string name="volume_stream_content_description_mute" msgid="4079046784917920984">"%1$s. म्यूट करण्यासाठी टॅप करा. प्रवेशक्षमता सेवा म्यूट केल्या जाऊ शकतात."</string>
diff --git a/packages/SystemUI/res/values-ms/strings.xml b/packages/SystemUI/res/values-ms/strings.xml
index 1160a1af486e..8912366fbed4 100644
--- a/packages/SystemUI/res/values-ms/strings.xml
+++ b/packages/SystemUI/res/values-ms/strings.xml
@@ -312,6 +312,10 @@
<string name="quick_settings_bluetooth_audio_sharing_button" msgid="7545274861795853838">"Kongsi audio"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_sharing" msgid="3069309588231072128">"Perkongsian audio"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_accessibility" msgid="7604615019302091708">"masukkan tetapan perkongsian audio"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_message" msgid="4251807313264307426">"Muzik dan video peranti ini akan dimainkan pada kedua-dua pasang fon kepala"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_title" msgid="4406818346036286793">"Kongsi audio anda"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_subtitle" msgid="3014906864710059236">"<xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g> dan <xliff:g id="ACTIVE_DEVICE_NAME">%2$s</xliff:g>"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_switch_to_button" msgid="7546825655978203773">"Beralih kepada <xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g>"</string>
<string name="quick_settings_bluetooth_secondary_label_battery_level" msgid="4182034939479344093">"<xliff:g id="BATTERY_LEVEL_AS_PERCENTAGE">%s</xliff:g> bateri"</string>
<string name="quick_settings_bluetooth_secondary_label_audio" msgid="780333390310051161">"Audio"</string>
<string name="quick_settings_bluetooth_secondary_label_headset" msgid="2332093067553000852">"Set Kepala"</string>
@@ -672,10 +676,8 @@
<string name="stream_notification_unavailable" msgid="4313854556205836435">"Tidak tersedia kerana deringan diredam"</string>
<string name="stream_alarm_unavailable" msgid="4059817189292197839">"Tidak tersedia kerana Jangan Ganggu dihidupkan"</string>
<string name="stream_media_unavailable" msgid="6823020894438959853">"Tidak tersedia kerana Jangan Ganggu dihidupkan"</string>
- <!-- no translation found for stream_unavailable_by_modes (3674139029490353683) -->
- <skip />
- <!-- no translation found for stream_unavailable_by_unknown (6908434629318171588) -->
- <skip />
+ <string name="stream_unavailable_by_modes" msgid="3674139029490353683">"Tidak tersedia kerana <xliff:g id="MODE">%s</xliff:g> dihidupkan"</string>
+ <string name="stream_unavailable_by_unknown" msgid="6908434629318171588">"Tidak tersedia"</string>
<string name="volume_stream_content_description_unmute" msgid="7729576371406792977">"%1$s. Ketik untuk menyahredam."</string>
<string name="volume_stream_content_description_vibrate" msgid="4858111994183089761">"%1$s. Ketik untuk menetapkan pada getar. Perkhidmatan kebolehaksesan mungkin diredamkan."</string>
<string name="volume_stream_content_description_mute" msgid="4079046784917920984">"%1$s. Ketik untuk meredam. Perkhidmatan kebolehaksesan mungkin diredamkan."</string>
@@ -1414,7 +1416,7 @@
<string name="touchpad_tutorial_recent_apps_gesture_button" msgid="8919227647650347359">"Lihat apl terbaharu"</string>
<string name="touchpad_tutorial_done_button" msgid="176168488821755503">"Selesai"</string>
<string name="touchpad_back_gesture_action_title" msgid="7199067250654332735">"Kembali"</string>
- <string name="touchpad_back_gesture_guidance" msgid="5352221087725906542">"Leret ke kiri atau kanan menggunakan tiga jari pada pad sentuh anda"</string>
+ <string name="touchpad_back_gesture_guidance" msgid="5352221087725906542">"Leret ke kiri atau ke kanan menggunakan tiga jari pada pad sentuh anda"</string>
<string name="touchpad_back_gesture_success_title" msgid="7370719098633023496">"Bagus!"</string>
<string name="touchpad_back_gesture_success_body" msgid="2324724953720741719">"Anda telah melengkapkan gerak isyarat undur."</string>
<string name="touchpad_home_gesture_action_title" msgid="8885107349719257882">"Akses laman utama"</string>
diff --git a/packages/SystemUI/res/values-my/strings.xml b/packages/SystemUI/res/values-my/strings.xml
index 224247eab689..e3880017fde4 100644
--- a/packages/SystemUI/res/values-my/strings.xml
+++ b/packages/SystemUI/res/values-my/strings.xml
@@ -312,6 +312,10 @@
<string name="quick_settings_bluetooth_audio_sharing_button" msgid="7545274861795853838">"အသံမျှဝေရန်"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_sharing" msgid="3069309588231072128">"အသံမျှဝေနေသည်"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_accessibility" msgid="7604615019302091708">"အော်ဒီယို မျှဝေခြင်း ဆက်တင်များ ထည့်ရန်"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_message" msgid="4251807313264307426">"ဤစက်၏ သီချင်းနှင့် ဗီဒီယိုများကို နားကြပ်နှစ်ဖက်စလုံးတွင် ဖွင့်မည်"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_title" msgid="4406818346036286793">"သင့်အသံ မျှဝေရန်"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_subtitle" msgid="3014906864710059236">"<xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g> နှင့် <xliff:g id="ACTIVE_DEVICE_NAME">%2$s</xliff:g>"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_switch_to_button" msgid="7546825655978203773">"<xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g> သို့ ပြောင်းရန်"</string>
<string name="quick_settings_bluetooth_secondary_label_battery_level" msgid="4182034939479344093">"<xliff:g id="BATTERY_LEVEL_AS_PERCENTAGE">%s</xliff:g> ဘက်ထရီ"</string>
<string name="quick_settings_bluetooth_secondary_label_audio" msgid="780333390310051161">"အသံ"</string>
<string name="quick_settings_bluetooth_secondary_label_headset" msgid="2332093067553000852">"မိုက်ခွက်ပါနားကြပ်"</string>
@@ -672,10 +676,8 @@
<string name="stream_notification_unavailable" msgid="4313854556205836435">"ဖုန်းမြည်သံပိတ်ထားသဖြင့် မရနိုင်ပါ"</string>
<string name="stream_alarm_unavailable" msgid="4059817189292197839">"‘မနှောင့်ယှက်ရ’ ဖွင့်ထားသောကြောင့် မရနိုင်ပါ"</string>
<string name="stream_media_unavailable" msgid="6823020894438959853">"‘မနှောင့်ယှက်ရ’ ဖွင့်ထားသောကြောင့် မရနိုင်ပါ"</string>
- <!-- no translation found for stream_unavailable_by_modes (3674139029490353683) -->
- <skip />
- <!-- no translation found for stream_unavailable_by_unknown (6908434629318171588) -->
- <skip />
+ <string name="stream_unavailable_by_modes" msgid="3674139029490353683">"<xliff:g id="MODE">%s</xliff:g> ကို ဖွင့်ထားသဖြင့် မရနိုင်ပါ"</string>
+ <string name="stream_unavailable_by_unknown" msgid="6908434629318171588">"မရနိုင်ပါ"</string>
<string name="volume_stream_content_description_unmute" msgid="7729576371406792977">"%1$s။ အသံပြန်ဖွင့်ရန် တို့ပါ။"</string>
<string name="volume_stream_content_description_vibrate" msgid="4858111994183089761">"%1$s။ တုန်ခါမှုကို သတ်မှတ်ရန် တို့ပါ။ အများသုံးနိုင်မှု ဝန်ဆောင်မှုများကို အသံပိတ်ထားနိုင်ပါသည်။"</string>
<string name="volume_stream_content_description_mute" msgid="4079046784917920984">"%1$s။ အသံပိတ်ရန် တို့ပါ။ အများသုံးနိုင်မှု ဝန်ဆောင်မှုများကို အသံပိတ်ထားနိုင်ပါသည်။"</string>
diff --git a/packages/SystemUI/res/values-nb/strings.xml b/packages/SystemUI/res/values-nb/strings.xml
index 6d65c6c1640d..49c004b362e7 100644
--- a/packages/SystemUI/res/values-nb/strings.xml
+++ b/packages/SystemUI/res/values-nb/strings.xml
@@ -312,6 +312,10 @@
<string name="quick_settings_bluetooth_audio_sharing_button" msgid="7545274861795853838">"Del lyd"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_sharing" msgid="3069309588231072128">"Deler lyd"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_accessibility" msgid="7604615019302091708">"åpne innstillingene for lyddeling"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_message" msgid="4251807313264307426">"Musikk og videoer fra denne enheten spilles av via begge hodetelefonparene"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_title" msgid="4406818346036286793">"Del lyd"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_subtitle" msgid="3014906864710059236">"<xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g> og <xliff:g id="ACTIVE_DEVICE_NAME">%2$s</xliff:g>"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_switch_to_button" msgid="7546825655978203773">"Bytt til <xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g>"</string>
<string name="quick_settings_bluetooth_secondary_label_battery_level" msgid="4182034939479344093">"<xliff:g id="BATTERY_LEVEL_AS_PERCENTAGE">%s</xliff:g> batteri"</string>
<string name="quick_settings_bluetooth_secondary_label_audio" msgid="780333390310051161">"Lyd"</string>
<string name="quick_settings_bluetooth_secondary_label_headset" msgid="2332093067553000852">"Hodetelefoner"</string>
@@ -672,10 +676,8 @@
<string name="stream_notification_unavailable" msgid="4313854556205836435">"Utilgjengelig fordi ringelyden er kuttet"</string>
<string name="stream_alarm_unavailable" msgid="4059817189292197839">"Utilgjengelig fordi «Ikke forstyrr» er på"</string>
<string name="stream_media_unavailable" msgid="6823020894438959853">"Utilgjengelig fordi «Ikke forstyrr» er på"</string>
- <!-- no translation found for stream_unavailable_by_modes (3674139029490353683) -->
- <skip />
- <!-- no translation found for stream_unavailable_by_unknown (6908434629318171588) -->
- <skip />
+ <string name="stream_unavailable_by_modes" msgid="3674139029490353683">"Utilgjengelig fordi <xliff:g id="MODE">%s</xliff:g> er på"</string>
+ <string name="stream_unavailable_by_unknown" msgid="6908434629318171588">"Utilgjengelig"</string>
<string name="volume_stream_content_description_unmute" msgid="7729576371406792977">"%1$s. Trykk for å slå på lyden."</string>
<string name="volume_stream_content_description_vibrate" msgid="4858111994183089761">"%1$s. Trykk for å angi vibrasjon. Lyden kan bli slått av for tilgjengelighetstjenestene."</string>
<string name="volume_stream_content_description_mute" msgid="4079046784917920984">"%1$s. Trykk for å slå av lyden. Lyden kan bli slått av for tilgjengelighetstjenestene."</string>
diff --git a/packages/SystemUI/res/values-ne/strings.xml b/packages/SystemUI/res/values-ne/strings.xml
index a55c53a74042..e364e9ec3edf 100644
--- a/packages/SystemUI/res/values-ne/strings.xml
+++ b/packages/SystemUI/res/values-ne/strings.xml
@@ -312,6 +312,10 @@
<string name="quick_settings_bluetooth_audio_sharing_button" msgid="7545274861795853838">"अडियो सेयर गर्नुहोस्"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_sharing" msgid="3069309588231072128">"अडियो सेयर गरिँदै छ"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_accessibility" msgid="7604615019302091708">"अडियो सेयर गर्ने सुविधासम्बन्धी सेटिङ हाल्न"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_message" msgid="4251807313264307426">"यो डिभाइसका सङ्गीत र भिडियोहरू दुवै जोडी हेडफोनमा प्ले हुने छन्"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_title" msgid="4406818346036286793">"आफ्नो अडियो सेयर गर्नुहोस्"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_subtitle" msgid="3014906864710059236">"<xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g> र <xliff:g id="ACTIVE_DEVICE_NAME">%2$s</xliff:g>"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_switch_to_button" msgid="7546825655978203773">"<xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g> चलाउनुहोस्"</string>
<string name="quick_settings_bluetooth_secondary_label_battery_level" msgid="4182034939479344093">"<xliff:g id="BATTERY_LEVEL_AS_PERCENTAGE">%s</xliff:g> ब्याट्री"</string>
<string name="quick_settings_bluetooth_secondary_label_audio" msgid="780333390310051161">"अडियो"</string>
<string name="quick_settings_bluetooth_secondary_label_headset" msgid="2332093067553000852">"हेडसेट"</string>
@@ -672,10 +676,8 @@
<string name="stream_notification_unavailable" msgid="4313854556205836435">"डिभाइस म्युट गरिएकाले यो सुविधा उपलब्ध छैन"</string>
<string name="stream_alarm_unavailable" msgid="4059817189292197839">"Do Not Disturb अन भएकाले भोल्युम बढाउन मिल्दैन"</string>
<string name="stream_media_unavailable" msgid="6823020894438959853">"Do Not Disturb अन भएकाले भोल्युम बढाउन मिल्दैन"</string>
- <!-- no translation found for stream_unavailable_by_modes (3674139029490353683) -->
- <skip />
- <!-- no translation found for stream_unavailable_by_unknown (6908434629318171588) -->
- <skip />
+ <string name="stream_unavailable_by_modes" msgid="3674139029490353683">"<xliff:g id="MODE">%s</xliff:g> अन भएकाले यो सुविधा उपलब्ध छैन"</string>
+ <string name="stream_unavailable_by_unknown" msgid="6908434629318171588">"उपलब्ध छैन"</string>
<string name="volume_stream_content_description_unmute" msgid="7729576371406792977">"%1$s। अनम्यूट गर्नाका लागि ट्याप गर्नुहोस्।"</string>
<string name="volume_stream_content_description_vibrate" msgid="4858111994183089761">"%1$s। कम्पनमा सेट गर्नाका लागि ट्याप गर्नुहोस्। पहुँच सम्बन्धी सेवाहरू म्यूट हुन सक्छन्।"</string>
<string name="volume_stream_content_description_mute" msgid="4079046784917920984">"%1$s। म्यूट गर्नाका लागि ट्याप गर्नुहोस्। पहुँच सम्बन्धी सेवाहरू म्यूट हुन सक्छन्।"</string>
diff --git a/packages/SystemUI/res/values-night/styles.xml b/packages/SystemUI/res/values-night/styles.xml
index 17ba2e5c10c4..d5d52e333caf 100644
--- a/packages/SystemUI/res/values-night/styles.xml
+++ b/packages/SystemUI/res/values-night/styles.xml
@@ -59,8 +59,4 @@
-->
<item name="android:windowOptOutEdgeToEdgeEnforcement">true</item>
</style>
-
- <style name="ShortcutHelperTheme" parent="@style/ShortcutHelperThemeCommon">
- <item name="android:windowLightNavigationBar">false</item>
- </style>
</resources>
diff --git a/packages/SystemUI/res/values-nl/strings.xml b/packages/SystemUI/res/values-nl/strings.xml
index e5bc5be40235..0f8eb1146251 100644
--- a/packages/SystemUI/res/values-nl/strings.xml
+++ b/packages/SystemUI/res/values-nl/strings.xml
@@ -312,6 +312,10 @@
<string name="quick_settings_bluetooth_audio_sharing_button" msgid="7545274861795853838">"Audio delen"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_sharing" msgid="3069309588231072128">"Audio delen"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_accessibility" msgid="7604615019302091708">"instellingen voor audio delen openen"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_message" msgid="4251807313264307426">"De muziek en video\'s van dit apparaat worden op beide koptelefoons afgespeeld"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_title" msgid="4406818346036286793">"Je audio delen"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_subtitle" msgid="3014906864710059236">"<xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g> en <xliff:g id="ACTIVE_DEVICE_NAME">%2$s</xliff:g>"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_switch_to_button" msgid="7546825655978203773">"Overschakelen naar <xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g>"</string>
<string name="quick_settings_bluetooth_secondary_label_battery_level" msgid="4182034939479344093">"<xliff:g id="BATTERY_LEVEL_AS_PERCENTAGE">%s</xliff:g> batterijniveau"</string>
<string name="quick_settings_bluetooth_secondary_label_audio" msgid="780333390310051161">"Audio"</string>
<string name="quick_settings_bluetooth_secondary_label_headset" msgid="2332093067553000852">"Headset"</string>
@@ -672,10 +676,8 @@
<string name="stream_notification_unavailable" msgid="4313854556205836435">"Niet beschikbaar, belgeluid staat uit"</string>
<string name="stream_alarm_unavailable" msgid="4059817189292197839">"Niet beschikbaar omdat Niet storen aanstaat"</string>
<string name="stream_media_unavailable" msgid="6823020894438959853">"Niet beschikbaar omdat Niet storen aanstaat"</string>
- <!-- no translation found for stream_unavailable_by_modes (3674139029490353683) -->
- <skip />
- <!-- no translation found for stream_unavailable_by_unknown (6908434629318171588) -->
- <skip />
+ <string name="stream_unavailable_by_modes" msgid="3674139029490353683">"Niet beschikbaar omdat <xliff:g id="MODE">%s</xliff:g> aanstaat"</string>
+ <string name="stream_unavailable_by_unknown" msgid="6908434629318171588">"Niet beschikbaar"</string>
<string name="volume_stream_content_description_unmute" msgid="7729576371406792977">"%1$s. Tik om dempen op te heffen."</string>
<string name="volume_stream_content_description_vibrate" msgid="4858111994183089761">"%1$s. Tik om in te stellen op trillen. Het geluid van toegankelijkheidsservices kan hierdoor uitgaan."</string>
<string name="volume_stream_content_description_mute" msgid="4079046784917920984">"%1$s. Tik om te dempen. Het geluid van toegankelijkheidsservices kan hierdoor uitgaan."</string>
diff --git a/packages/SystemUI/res/values-or/strings.xml b/packages/SystemUI/res/values-or/strings.xml
index cf7a58d763c9..16127eb93ade 100644
--- a/packages/SystemUI/res/values-or/strings.xml
+++ b/packages/SystemUI/res/values-or/strings.xml
@@ -312,6 +312,10 @@
<string name="quick_settings_bluetooth_audio_sharing_button" msgid="7545274861795853838">"ଅଡିଓ ସେୟାର କରନ୍ତୁ"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_sharing" msgid="3069309588231072128">"ଅଡିଓ ସେୟାର କରାଯାଉଛି"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_accessibility" msgid="7604615019302091708">"ଅଡିଓ ସେୟାରିଂ ସେଟିଂସରେ ପ୍ରବେଶ କରନ୍ତୁ"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_message" msgid="4251807313264307426">"ଏହି ଡିଭାଇସର ମ୍ୟୁଜିକ ଏବଂ ଭିଡିଓଗୁଡ଼ିକ ଉଭୟ ପେୟାର ହେଡଫୋନରେ ପ୍ଲେ ହେବ"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_title" msgid="4406818346036286793">"ଆପଣଙ୍କ ଅଡିଓ ସେୟାର କରନ୍ତୁ"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_subtitle" msgid="3014906864710059236">"<xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g> ଏବଂ <xliff:g id="ACTIVE_DEVICE_NAME">%2$s</xliff:g>"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_switch_to_button" msgid="7546825655978203773">"<xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g>କୁ ସୁଇଚ କରନ୍ତୁ"</string>
<string name="quick_settings_bluetooth_secondary_label_battery_level" msgid="4182034939479344093">"<xliff:g id="BATTERY_LEVEL_AS_PERCENTAGE">%s</xliff:g> ବ୍ୟାଟେରୀ"</string>
<string name="quick_settings_bluetooth_secondary_label_audio" msgid="780333390310051161">"ଅଡିଓ"</string>
<string name="quick_settings_bluetooth_secondary_label_headset" msgid="2332093067553000852">"ହେଡସେଟ୍‍"</string>
@@ -672,10 +676,8 @@
<string name="stream_notification_unavailable" msgid="4313854556205836435">"ରିଂକୁ ମ୍ୟୁଟ କରାଯାଇଥିବା ଯୋଗୁଁ ଉପଲବ୍ଧ ନାହିଁ"</string>
<string name="stream_alarm_unavailable" msgid="4059817189292197839">"\'ବିରକ୍ତ କରନ୍ତୁ ନାହିଁ\' ଚାଲୁ ଥିବା ଯୋଗୁଁ ଉପଲବ୍ଧ ନାହିଁ"</string>
<string name="stream_media_unavailable" msgid="6823020894438959853">"\'ବିରକ୍ତ କରନ୍ତୁ ନାହିଁ\' ଚାଲୁ ଥିବା ଯୋଗୁଁ ଉପଲବ୍ଧ ନାହିଁ"</string>
- <!-- no translation found for stream_unavailable_by_modes (3674139029490353683) -->
- <skip />
- <!-- no translation found for stream_unavailable_by_unknown (6908434629318171588) -->
- <skip />
+ <string name="stream_unavailable_by_modes" msgid="3674139029490353683">"<xliff:g id="MODE">%s</xliff:g> ଚାଲୁ ଥିବା ଯୋଗୁଁ ଉପଲବ୍ଧ ନାହିଁ"</string>
+ <string name="stream_unavailable_by_unknown" msgid="6908434629318171588">"ଉପଲବ୍ଧ ନାହିଁ"</string>
<string name="volume_stream_content_description_unmute" msgid="7729576371406792977">"%1$s। ଅନମ୍ୟୁଟ୍‍ କରିବା ପାଇଁ ଟାପ୍‍ କରନ୍ତୁ।"</string>
<string name="volume_stream_content_description_vibrate" msgid="4858111994183089761">"%1$s। ଭାଇବ୍ରେଟ୍‍ ସେଟ୍‍ କରିବାକୁ ଟାପ୍‍ କରନ୍ତୁ। ଆକ୍ସେସିବିଲିଟୀ ସର୍ଭିସ୍‌ ମ୍ୟୁଟ୍‍ କରାଯାଇପାରେ।"</string>
<string name="volume_stream_content_description_mute" msgid="4079046784917920984">"%1$s। ମ୍ୟୁଟ୍‍ କରିବାକୁ ଟାପ୍‍ କରନ୍ତୁ। ଆକ୍ସେସିବିଲିଟୀ ସର୍ଭିସ୍‌ ମ୍ୟୁଟ୍‍ କରାଯାଇପାରେ।"</string>
diff --git a/packages/SystemUI/res/values-pa/strings.xml b/packages/SystemUI/res/values-pa/strings.xml
index 43691a4bef1b..63de1a6bda61 100644
--- a/packages/SystemUI/res/values-pa/strings.xml
+++ b/packages/SystemUI/res/values-pa/strings.xml
@@ -312,6 +312,10 @@
<string name="quick_settings_bluetooth_audio_sharing_button" msgid="7545274861795853838">"ਆਡੀਓ ਨੂੰ ਸਾਂਝਾ ਕਰੋ"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_sharing" msgid="3069309588231072128">"ਆਡੀਓ ਨੂੰ ਸਾਂਝਾ ਕੀਤਾ ਜਾ ਰਿਹਾ ਹੈ"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_accessibility" msgid="7604615019302091708">"ਆਡੀਓ ਸਾਂਝਾਕਰਨ ਸੈਟਿੰਗਾਂ ਦਾਖਲ ਕਰੋ"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_message" msgid="4251807313264307426">"ਇਸ ਡੀਵਾਈਸ ਦਾ ਸੰਗੀਤ ਅਤੇ ਵੀਡੀਓ ਹੈੱਡਫ਼ੋਨਾਂ ਦੇ ਦੋਵਾਂ ਜੋੜਿਆਂ \'ਤੇ ਚੱਲਣਗੇ"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_title" msgid="4406818346036286793">"ਆਪਣਾ ਆਡੀਓ ਸਾਂਝਾ ਕਰੋ"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_subtitle" msgid="3014906864710059236">"<xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g> ਅਤੇ <xliff:g id="ACTIVE_DEVICE_NAME">%2$s</xliff:g>"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_switch_to_button" msgid="7546825655978203773">"<xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g> \'ਤੇ ਸਵਿੱਚ ਕਰੋ"</string>
<string name="quick_settings_bluetooth_secondary_label_battery_level" msgid="4182034939479344093">"<xliff:g id="BATTERY_LEVEL_AS_PERCENTAGE">%s</xliff:g> ਬੈਟਰੀ"</string>
<string name="quick_settings_bluetooth_secondary_label_audio" msgid="780333390310051161">"ਆਡੀਓ"</string>
<string name="quick_settings_bluetooth_secondary_label_headset" msgid="2332093067553000852">"ਹੈੱਡਸੈੱਟ"</string>
@@ -672,10 +676,8 @@
<string name="stream_notification_unavailable" msgid="4313854556205836435">"ਉਪਲਬਧ ਨਹੀਂ ਹੈ ਕਿਉਂਕਿ ਘੰਟੀ ਮਿਊਟ ਕੀਤੀ ਹੋਈ ਹੈ"</string>
<string name="stream_alarm_unavailable" msgid="4059817189292197839">"ਉਪਲਬਧ ਨਹੀਂ ਹੈ ਕਿਉਂਕਿ ਪਰੇਸ਼ਾਨ ਨਾ ਕਰੋ ਵਿਸ਼ੇਸ਼ਤਾ ਚਾਲੂ ਹੈ"</string>
<string name="stream_media_unavailable" msgid="6823020894438959853">"ਉਪਲਬਧ ਨਹੀਂ ਹੈ ਕਿਉਂਕਿ ਪਰੇਸ਼ਾਨ ਨਾ ਕਰੋ ਵਿਸ਼ੇਸ਼ਤਾ ਚਾਲੂ ਹੈ"</string>
- <!-- no translation found for stream_unavailable_by_modes (3674139029490353683) -->
- <skip />
- <!-- no translation found for stream_unavailable_by_unknown (6908434629318171588) -->
- <skip />
+ <string name="stream_unavailable_by_modes" msgid="3674139029490353683">"<xliff:g id="MODE">%s</xliff:g> ਚਾਲੂ ਹੋਣ ਕਾਰਨ ਇਹ ਸੁਵਿਧਾ ਉਪਲਬਧ ਨਹੀਂ ਹੈ"</string>
+ <string name="stream_unavailable_by_unknown" msgid="6908434629318171588">"ਉਪਲਬਧ ਨਹੀਂ"</string>
<string name="volume_stream_content_description_unmute" msgid="7729576371406792977">"%1$s। ਅਣਮਿਊਟ ਕਰਨ ਲਈ ਟੈਪ ਕਰੋ।"</string>
<string name="volume_stream_content_description_vibrate" msgid="4858111994183089761">"%1$s। ਥਰਥਰਾਹਟ ਸੈੱਟ ਕਰਨ ਲਈ ਟੈਪ ਕਰੋ। ਪਹੁੰਚਯੋਗਤਾ ਸੇਵਾਵਾਂ ਮਿਊਟ ਹੋ ਸਕਦੀਆਂ ਹਨ।"</string>
<string name="volume_stream_content_description_mute" msgid="4079046784917920984">"%1$s। ਮਿਊਟ ਕਰਨ ਲਈ ਟੈਪ ਕਰੋ। ਪਹੁੰਚਯੋਗਤਾ ਸੇਵਾਵਾਂ ਮਿਊਟ ਹੋ ਸਕਦੀਆਂ ਹਨ।"</string>
diff --git a/packages/SystemUI/res/values-pl/strings.xml b/packages/SystemUI/res/values-pl/strings.xml
index 3e1e2d13f9b7..a5dbc06e2530 100644
--- a/packages/SystemUI/res/values-pl/strings.xml
+++ b/packages/SystemUI/res/values-pl/strings.xml
@@ -312,6 +312,10 @@
<string name="quick_settings_bluetooth_audio_sharing_button" msgid="7545274861795853838">"Udostępnij dźwięk"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_sharing" msgid="3069309588231072128">"Udostępnia dźwięk"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_accessibility" msgid="7604615019302091708">"aby otworzyć ustawienia udostępniania dźwięku"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_message" msgid="4251807313264307426">"Muzyka i filmy z tego urządzenia będą odtwarzane przez obie pary słuchawek"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_title" msgid="4406818346036286793">"Udostępnij dźwięk"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_subtitle" msgid="3014906864710059236">"<xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g> i <xliff:g id="ACTIVE_DEVICE_NAME">%2$s</xliff:g>"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_switch_to_button" msgid="7546825655978203773">"Przełącz na: <xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g>"</string>
<string name="quick_settings_bluetooth_secondary_label_battery_level" msgid="4182034939479344093">"<xliff:g id="BATTERY_LEVEL_AS_PERCENTAGE">%s</xliff:g> naładowania baterii"</string>
<string name="quick_settings_bluetooth_secondary_label_audio" msgid="780333390310051161">"Dźwięk"</string>
<string name="quick_settings_bluetooth_secondary_label_headset" msgid="2332093067553000852">"Zestaw słuchawkowy"</string>
@@ -672,10 +676,8 @@
<string name="stream_notification_unavailable" msgid="4313854556205836435">"Niedostępne, bo dzwonek jest wyciszony"</string>
<string name="stream_alarm_unavailable" msgid="4059817189292197839">"Niedostępne, włączone jest „Nie przeszkadzać”"</string>
<string name="stream_media_unavailable" msgid="6823020894438959853">"Niedostępne, włączone jest „Nie przeszkadzać”"</string>
- <!-- no translation found for stream_unavailable_by_modes (3674139029490353683) -->
- <skip />
- <!-- no translation found for stream_unavailable_by_unknown (6908434629318171588) -->
- <skip />
+ <string name="stream_unavailable_by_modes" msgid="3674139029490353683">"Niedostępne, bo włączony jest tryb <xliff:g id="MODE">%s</xliff:g>"</string>
+ <string name="stream_unavailable_by_unknown" msgid="6908434629318171588">"Niedostępne"</string>
<string name="volume_stream_content_description_unmute" msgid="7729576371406792977">"%1$s. Kliknij, by wyłączyć wyciszenie."</string>
<string name="volume_stream_content_description_vibrate" msgid="4858111994183089761">"%1$s. Kliknij, by włączyć wibracje. Ułatwienia dostępu mogą być wyciszone."</string>
<string name="volume_stream_content_description_mute" msgid="4079046784917920984">"%1$s. Kliknij, by wyciszyć. Ułatwienia dostępu mogą być wyciszone."</string>
diff --git a/packages/SystemUI/res/values-pt-rBR/strings.xml b/packages/SystemUI/res/values-pt-rBR/strings.xml
index c34f2f72a53d..da192e334e31 100644
--- a/packages/SystemUI/res/values-pt-rBR/strings.xml
+++ b/packages/SystemUI/res/values-pt-rBR/strings.xml
@@ -312,6 +312,10 @@
<string name="quick_settings_bluetooth_audio_sharing_button" msgid="7545274861795853838">"Compartilhar áudio"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_sharing" msgid="3069309588231072128">"Compartilhando áudio"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_accessibility" msgid="7604615019302091708">"acessar configurações de compartilhamento de áudio"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_message" msgid="4251807313264307426">"As músicas e os vídeos deste dispositivo serão reproduzidos nos dois pares de fones de ouvido"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_title" msgid="4406818346036286793">"Compartilhamento de áudio"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_subtitle" msgid="3014906864710059236">"<xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g> e <xliff:g id="ACTIVE_DEVICE_NAME">%2$s</xliff:g>"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_switch_to_button" msgid="7546825655978203773">"Mudar para <xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g>"</string>
<string name="quick_settings_bluetooth_secondary_label_battery_level" msgid="4182034939479344093">"Bateria: <xliff:g id="BATTERY_LEVEL_AS_PERCENTAGE">%s</xliff:g>"</string>
<string name="quick_settings_bluetooth_secondary_label_audio" msgid="780333390310051161">"Áudio"</string>
<string name="quick_settings_bluetooth_secondary_label_headset" msgid="2332093067553000852">"Fone de ouvido"</string>
@@ -672,10 +676,8 @@
<string name="stream_notification_unavailable" msgid="4313854556205836435">"Indisponível com o toque silenciado"</string>
<string name="stream_alarm_unavailable" msgid="4059817189292197839">"Indisponível com o Não perturbe ativado"</string>
<string name="stream_media_unavailable" msgid="6823020894438959853">"Indisponível com o Não perturbe ativado"</string>
- <!-- no translation found for stream_unavailable_by_modes (3674139029490353683) -->
- <skip />
- <!-- no translation found for stream_unavailable_by_unknown (6908434629318171588) -->
- <skip />
+ <string name="stream_unavailable_by_modes" msgid="3674139029490353683">"Indisponível porque o modo <xliff:g id="MODE">%s</xliff:g> está ativado"</string>
+ <string name="stream_unavailable_by_unknown" msgid="6908434629318171588">"Indisponível"</string>
<string name="volume_stream_content_description_unmute" msgid="7729576371406792977">"%1$s. Toque para ativar o som."</string>
<string name="volume_stream_content_description_vibrate" msgid="4858111994183089761">"%1$s. Toque para configurar para vibrar. É possível que os serviços de acessibilidade sejam silenciados."</string>
<string name="volume_stream_content_description_mute" msgid="4079046784917920984">"%1$s. Toque para silenciar. É possível que os serviços de acessibilidade sejam silenciados."</string>
diff --git a/packages/SystemUI/res/values-pt-rPT/strings.xml b/packages/SystemUI/res/values-pt-rPT/strings.xml
index 04d3ec5c984b..127a97ea6ebc 100644
--- a/packages/SystemUI/res/values-pt-rPT/strings.xml
+++ b/packages/SystemUI/res/values-pt-rPT/strings.xml
@@ -312,6 +312,10 @@
<string name="quick_settings_bluetooth_audio_sharing_button" msgid="7545274861795853838">"Partilhar áudio"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_sharing" msgid="3069309588231072128">"A partilhar áudio"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_accessibility" msgid="7604615019302091708">"aceder às definições de partilha de áudio"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_message" msgid="4251807313264307426">"Os vídeos e as músicas deste dispositivo vão tocar em ambos os pares de auscultadores"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_title" msgid="4406818346036286793">"Partilhe o áudio"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_subtitle" msgid="3014906864710059236">"<xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g> e <xliff:g id="ACTIVE_DEVICE_NAME">%2$s</xliff:g>"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_switch_to_button" msgid="7546825655978203773">"Mudar para <xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g>"</string>
<string name="quick_settings_bluetooth_secondary_label_battery_level" msgid="4182034939479344093">"<xliff:g id="BATTERY_LEVEL_AS_PERCENTAGE">%s</xliff:g> de bateria"</string>
<string name="quick_settings_bluetooth_secondary_label_audio" msgid="780333390310051161">"Áudio"</string>
<string name="quick_settings_bluetooth_secondary_label_headset" msgid="2332093067553000852">"Ausc. c/ mic. integ."</string>
@@ -672,10 +676,8 @@
<string name="stream_notification_unavailable" msgid="4313854556205836435">"Indisponível com toque desativado"</string>
<string name="stream_alarm_unavailable" msgid="4059817189292197839">"Indisponível porque Não incomodar está ativado"</string>
<string name="stream_media_unavailable" msgid="6823020894438959853">"Indisponível com Não incomodar ativado"</string>
- <!-- no translation found for stream_unavailable_by_modes (3674139029490353683) -->
- <skip />
- <!-- no translation found for stream_unavailable_by_unknown (6908434629318171588) -->
- <skip />
+ <string name="stream_unavailable_by_modes" msgid="3674139029490353683">"Indisponível porque o modo <xliff:g id="MODE">%s</xliff:g> está ativado"</string>
+ <string name="stream_unavailable_by_unknown" msgid="6908434629318171588">"Indisponível"</string>
<string name="volume_stream_content_description_unmute" msgid="7729576371406792977">"%1$s. Toque para reativar o som."</string>
<string name="volume_stream_content_description_vibrate" msgid="4858111994183089761">"%1$s. Toque para ativar a vibração. Os serviços de acessibilidade podem ser silenciados."</string>
<string name="volume_stream_content_description_mute" msgid="4079046784917920984">"%1$s. Toque para desativar o som. Os serviços de acessibilidade podem ser silenciados."</string>
diff --git a/packages/SystemUI/res/values-pt/strings.xml b/packages/SystemUI/res/values-pt/strings.xml
index c34f2f72a53d..da192e334e31 100644
--- a/packages/SystemUI/res/values-pt/strings.xml
+++ b/packages/SystemUI/res/values-pt/strings.xml
@@ -312,6 +312,10 @@
<string name="quick_settings_bluetooth_audio_sharing_button" msgid="7545274861795853838">"Compartilhar áudio"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_sharing" msgid="3069309588231072128">"Compartilhando áudio"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_accessibility" msgid="7604615019302091708">"acessar configurações de compartilhamento de áudio"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_message" msgid="4251807313264307426">"As músicas e os vídeos deste dispositivo serão reproduzidos nos dois pares de fones de ouvido"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_title" msgid="4406818346036286793">"Compartilhamento de áudio"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_subtitle" msgid="3014906864710059236">"<xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g> e <xliff:g id="ACTIVE_DEVICE_NAME">%2$s</xliff:g>"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_switch_to_button" msgid="7546825655978203773">"Mudar para <xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g>"</string>
<string name="quick_settings_bluetooth_secondary_label_battery_level" msgid="4182034939479344093">"Bateria: <xliff:g id="BATTERY_LEVEL_AS_PERCENTAGE">%s</xliff:g>"</string>
<string name="quick_settings_bluetooth_secondary_label_audio" msgid="780333390310051161">"Áudio"</string>
<string name="quick_settings_bluetooth_secondary_label_headset" msgid="2332093067553000852">"Fone de ouvido"</string>
@@ -672,10 +676,8 @@
<string name="stream_notification_unavailable" msgid="4313854556205836435">"Indisponível com o toque silenciado"</string>
<string name="stream_alarm_unavailable" msgid="4059817189292197839">"Indisponível com o Não perturbe ativado"</string>
<string name="stream_media_unavailable" msgid="6823020894438959853">"Indisponível com o Não perturbe ativado"</string>
- <!-- no translation found for stream_unavailable_by_modes (3674139029490353683) -->
- <skip />
- <!-- no translation found for stream_unavailable_by_unknown (6908434629318171588) -->
- <skip />
+ <string name="stream_unavailable_by_modes" msgid="3674139029490353683">"Indisponível porque o modo <xliff:g id="MODE">%s</xliff:g> está ativado"</string>
+ <string name="stream_unavailable_by_unknown" msgid="6908434629318171588">"Indisponível"</string>
<string name="volume_stream_content_description_unmute" msgid="7729576371406792977">"%1$s. Toque para ativar o som."</string>
<string name="volume_stream_content_description_vibrate" msgid="4858111994183089761">"%1$s. Toque para configurar para vibrar. É possível que os serviços de acessibilidade sejam silenciados."</string>
<string name="volume_stream_content_description_mute" msgid="4079046784917920984">"%1$s. Toque para silenciar. É possível que os serviços de acessibilidade sejam silenciados."</string>
diff --git a/packages/SystemUI/res/values-ro/strings.xml b/packages/SystemUI/res/values-ro/strings.xml
index ba2802601df5..5c97ab579183 100644
--- a/packages/SystemUI/res/values-ro/strings.xml
+++ b/packages/SystemUI/res/values-ro/strings.xml
@@ -312,6 +312,10 @@
<string name="quick_settings_bluetooth_audio_sharing_button" msgid="7545274861795853838">"Trimite audio"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_sharing" msgid="3069309588231072128">"Se permite accesul la conținutul audio"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_accessibility" msgid="7604615019302091708">"accesa setările de permitere a accesului la audio"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_message" msgid="4251807313264307426">"Muzica și videoclipurile de pe acest dispozitiv se vor reda pe ambele perechi de căști"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_title" msgid="4406818346036286793">"Permite accesul la conținutul tău audio"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_subtitle" msgid="3014906864710059236">"<xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g> și <xliff:g id="ACTIVE_DEVICE_NAME">%2$s</xliff:g>"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_switch_to_button" msgid="7546825655978203773">"Comută la <xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g>"</string>
<string name="quick_settings_bluetooth_secondary_label_battery_level" msgid="4182034939479344093">"Nivelul bateriei: <xliff:g id="BATTERY_LEVEL_AS_PERCENTAGE">%s</xliff:g>"</string>
<string name="quick_settings_bluetooth_secondary_label_audio" msgid="780333390310051161">"Audio"</string>
<string name="quick_settings_bluetooth_secondary_label_headset" msgid="2332093067553000852">"Căști"</string>
@@ -672,10 +676,8 @@
<string name="stream_notification_unavailable" msgid="4313854556205836435">"Indisponibil; soneria este dezactivată"</string>
<string name="stream_alarm_unavailable" msgid="4059817189292197839">"Indisponibil; funcția Nu deranja e activată"</string>
<string name="stream_media_unavailable" msgid="6823020894438959853">"Indisponibil; funcția Nu deranja e activată"</string>
- <!-- no translation found for stream_unavailable_by_modes (3674139029490353683) -->
- <skip />
- <!-- no translation found for stream_unavailable_by_unknown (6908434629318171588) -->
- <skip />
+ <string name="stream_unavailable_by_modes" msgid="3674139029490353683">"Indisponibil, deoarece <xliff:g id="MODE">%s</xliff:g> este activat"</string>
+ <string name="stream_unavailable_by_unknown" msgid="6908434629318171588">"Indisponibil"</string>
<string name="volume_stream_content_description_unmute" msgid="7729576371406792977">"%1$s. Atinge pentru a activa sunetul."</string>
<string name="volume_stream_content_description_vibrate" msgid="4858111994183089761">"%1$s. Atinge pentru a seta vibrarea. Sunetul se poate dezactiva pentru serviciile de accesibilitate."</string>
<string name="volume_stream_content_description_mute" msgid="4079046784917920984">"%1$s. Atinge pentru a dezactiva sunetul. Sunetul se poate dezactiva pentru serviciile de accesibilitate."</string>
diff --git a/packages/SystemUI/res/values-ru/strings.xml b/packages/SystemUI/res/values-ru/strings.xml
index bd5a5a15726a..5ae021def63e 100644
--- a/packages/SystemUI/res/values-ru/strings.xml
+++ b/packages/SystemUI/res/values-ru/strings.xml
@@ -312,6 +312,10 @@
<string name="quick_settings_bluetooth_audio_sharing_button" msgid="7545274861795853838">"Отправить аудио"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_sharing" msgid="3069309588231072128">"Отправка аудио"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_accessibility" msgid="7604615019302091708">"перейти в настройки передачи аудио"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_message" msgid="4251807313264307426">"Музыка и звук видео на этом устройстве будут воспроизводиться через обе пары наушников."</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_title" msgid="4406818346036286793">"Передача аудио"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_subtitle" msgid="3014906864710059236">"<xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g> и <xliff:g id="ACTIVE_DEVICE_NAME">%2$s</xliff:g>"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_switch_to_button" msgid="7546825655978203773">"Переключиться на <xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g>"</string>
<string name="quick_settings_bluetooth_secondary_label_battery_level" msgid="4182034939479344093">"Заряд: <xliff:g id="BATTERY_LEVEL_AS_PERCENTAGE">%s</xliff:g>"</string>
<string name="quick_settings_bluetooth_secondary_label_audio" msgid="780333390310051161">"Аудиоустройство"</string>
<string name="quick_settings_bluetooth_secondary_label_headset" msgid="2332093067553000852">"Гарнитура"</string>
@@ -672,10 +676,8 @@
<string name="stream_notification_unavailable" msgid="4313854556205836435">"Недоступно в беззвучном режиме"</string>
<string name="stream_alarm_unavailable" msgid="4059817189292197839">"Недоступно при включенном режиме \"Не беспокоить\"."</string>
<string name="stream_media_unavailable" msgid="6823020894438959853">"Недоступно при включенном режиме \"Не беспокоить\"."</string>
- <!-- no translation found for stream_unavailable_by_modes (3674139029490353683) -->
- <skip />
- <!-- no translation found for stream_unavailable_by_unknown (6908434629318171588) -->
- <skip />
+ <string name="stream_unavailable_by_modes" msgid="3674139029490353683">"Недоступно, так как включен режим \"<xliff:g id="MODE">%s</xliff:g>\""</string>
+ <string name="stream_unavailable_by_unknown" msgid="6908434629318171588">"Недоступно"</string>
<string name="volume_stream_content_description_unmute" msgid="7729576371406792977">"%1$s. Нажмите, чтобы включить звук."</string>
<string name="volume_stream_content_description_vibrate" msgid="4858111994183089761">"%1$s. Нажмите, чтобы включить вибрацию. Специальные возможности могут прекратить работу."</string>
<string name="volume_stream_content_description_mute" msgid="4079046784917920984">"%1$s. Нажмите, чтобы выключить звук. Специальные возможности могут прекратить работу."</string>
diff --git a/packages/SystemUI/res/values-si/strings.xml b/packages/SystemUI/res/values-si/strings.xml
index 6d2b0be529d2..03c2ba4379ce 100644
--- a/packages/SystemUI/res/values-si/strings.xml
+++ b/packages/SystemUI/res/values-si/strings.xml
@@ -312,6 +312,10 @@
<string name="quick_settings_bluetooth_audio_sharing_button" msgid="7545274861795853838">"ශ්‍රව්‍ය බෙදා ගන්න"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_sharing" msgid="3069309588231072128">"ශ්‍රව්‍ය බෙදා ගැනීම"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_accessibility" msgid="7604615019302091708">"ශ්‍රව්‍ය බෙදා ගැනීමේ සැකසීම් ඇතුළු කරන්න"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_message" msgid="4251807313264307426">"මෙම උපාංගයේ සංගීතය සහ වීඩියෝ හෙඩ්ෆෝන් යුගල දෙකෙහිම වාදනය වනු ඇත"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_title" msgid="4406818346036286793">"ඔබේ ශ්‍රව්‍ය බෙදා ගන්න"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_subtitle" msgid="3014906864710059236">"<xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g> සහ <xliff:g id="ACTIVE_DEVICE_NAME">%2$s</xliff:g>"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_switch_to_button" msgid="7546825655978203773">"<xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g> වෙත මාරු වන්න"</string>
<string name="quick_settings_bluetooth_secondary_label_battery_level" msgid="4182034939479344093">"බැටරිය <xliff:g id="BATTERY_LEVEL_AS_PERCENTAGE">%s</xliff:g>"</string>
<string name="quick_settings_bluetooth_secondary_label_audio" msgid="780333390310051161">"ශ්‍රව්‍ය"</string>
<string name="quick_settings_bluetooth_secondary_label_headset" msgid="2332093067553000852">"හෙඩ්සෙටය"</string>
@@ -672,10 +676,8 @@
<string name="stream_notification_unavailable" msgid="4313854556205836435">"නාදය නිහඬ කර ඇති නිසා නොලැබේ"</string>
<string name="stream_alarm_unavailable" msgid="4059817189292197839">"බාධා නොකරන්න ක්‍රියාත්මකව ඇති බැවින් ලද නොහැක"</string>
<string name="stream_media_unavailable" msgid="6823020894438959853">"බාධා නොකරන්න ක්‍රියාත්මකව ඇති බැවින් ලද නොහැක"</string>
- <!-- no translation found for stream_unavailable_by_modes (3674139029490353683) -->
- <skip />
- <!-- no translation found for stream_unavailable_by_unknown (6908434629318171588) -->
- <skip />
+ <string name="stream_unavailable_by_modes" msgid="3674139029490353683">"<xliff:g id="MODE">%s</xliff:g> ක්‍රියාත්මක නිසා ලබා ගත නොහැක"</string>
+ <string name="stream_unavailable_by_unknown" msgid="6908434629318171588">"නොමැත"</string>
<string name="volume_stream_content_description_unmute" msgid="7729576371406792977">"%1$s. නිහඬ කිරීම ඉවත් කිරීමට තට්ටු කරන්න."</string>
<string name="volume_stream_content_description_vibrate" msgid="4858111994183089761">"%1$s. කම්පනය කිරීමට තට්ටු කරන්න. ප්‍රවේශ්‍යතා සේවා නිහඬ කළ හැකිය."</string>
<string name="volume_stream_content_description_mute" msgid="4079046784917920984">"%1$s. නිහඬ කිරීමට තට්ටු කරන්න. ප්‍රවේශ්‍යතා සේවා නිහඬ කළ හැකිය."</string>
diff --git a/packages/SystemUI/res/values-sk/strings.xml b/packages/SystemUI/res/values-sk/strings.xml
index 223070c5846b..ac80ae27c2d7 100644
--- a/packages/SystemUI/res/values-sk/strings.xml
+++ b/packages/SystemUI/res/values-sk/strings.xml
@@ -312,6 +312,10 @@
<string name="quick_settings_bluetooth_audio_sharing_button" msgid="7545274861795853838">"Zdieľať zvuk"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_sharing" msgid="3069309588231072128">"Zdieľa sa zvuk"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_accessibility" msgid="7604615019302091708">"prejsť do nastavení zdieľania zvuku"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_message" msgid="4251807313264307426">"Hudba a videá z tohto zariadenia sa budú prehrávať v oboch pároch slúchadiel"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_title" msgid="4406818346036286793">"Zdieľanie zvuku"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_subtitle" msgid="3014906864710059236">"<xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g> a <xliff:g id="ACTIVE_DEVICE_NAME">%2$s</xliff:g>"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_switch_to_button" msgid="7546825655978203773">"Prepnúť na <xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g>"</string>
<string name="quick_settings_bluetooth_secondary_label_battery_level" msgid="4182034939479344093">"Batéria: <xliff:g id="BATTERY_LEVEL_AS_PERCENTAGE">%s</xliff:g>"</string>
<string name="quick_settings_bluetooth_secondary_label_audio" msgid="780333390310051161">"Zvuk"</string>
<string name="quick_settings_bluetooth_secondary_label_headset" msgid="2332093067553000852">"Náhlavná súprava"</string>
@@ -672,10 +676,8 @@
<string name="stream_notification_unavailable" msgid="4313854556205836435">"Nedostupné, pretože je vypnuté zvonenie"</string>
<string name="stream_alarm_unavailable" msgid="4059817189292197839">"Nedostupné, pretože je zapnutý režim bez vyrušení"</string>
<string name="stream_media_unavailable" msgid="6823020894438959853">"Nedostupné, zapnutý režim bez vyrušení"</string>
- <!-- no translation found for stream_unavailable_by_modes (3674139029490353683) -->
- <skip />
- <!-- no translation found for stream_unavailable_by_unknown (6908434629318171588) -->
- <skip />
+ <string name="stream_unavailable_by_modes" msgid="3674139029490353683">"Nedostupné, pretože je zapnutý režim <xliff:g id="MODE">%s</xliff:g>"</string>
+ <string name="stream_unavailable_by_unknown" msgid="6908434629318171588">"Nedostupné"</string>
<string name="volume_stream_content_description_unmute" msgid="7729576371406792977">"%1$s. Klepnutím zapnite zvuk."</string>
<string name="volume_stream_content_description_vibrate" msgid="4858111994183089761">"%1$s. Klepnutím aktivujte režim vibrovania. Služby dostupnosti je možné stlmiť."</string>
<string name="volume_stream_content_description_mute" msgid="4079046784917920984">"%1$s. Klepnutím vypnite zvuk. Služby dostupnosti je možné stlmiť."</string>
diff --git a/packages/SystemUI/res/values-sl/strings.xml b/packages/SystemUI/res/values-sl/strings.xml
index d44e70ccbf2e..f953a94dd5a5 100644
--- a/packages/SystemUI/res/values-sl/strings.xml
+++ b/packages/SystemUI/res/values-sl/strings.xml
@@ -312,6 +312,10 @@
<string name="quick_settings_bluetooth_audio_sharing_button" msgid="7545274861795853838">"Deli zvok"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_sharing" msgid="3069309588231072128">"Poteka deljenje zvoka"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_accessibility" msgid="7604615019302091708">"odpiranje nastavitev deljenja zvoka"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_message" msgid="4251807313264307426">"Glasba in videoposnetki v tej napravi bodo predvajani v obeh parih slušalk"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_title" msgid="4406818346036286793">"Deljenje zvoka"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_subtitle" msgid="3014906864710059236">"<xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g> in <xliff:g id="ACTIVE_DEVICE_NAME">%2$s</xliff:g>"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_switch_to_button" msgid="7546825655978203773">"Preklopi na <xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g>"</string>
<string name="quick_settings_bluetooth_secondary_label_battery_level" msgid="4182034939479344093">"Baterija na <xliff:g id="BATTERY_LEVEL_AS_PERCENTAGE">%s</xliff:g>"</string>
<string name="quick_settings_bluetooth_secondary_label_audio" msgid="780333390310051161">"Zvok"</string>
<string name="quick_settings_bluetooth_secondary_label_headset" msgid="2332093067553000852">"Slušalke z mikrofonom"</string>
@@ -672,10 +676,8 @@
<string name="stream_notification_unavailable" msgid="4313854556205836435">"Ni na voljo, ker je zvonjenje izklopljeno"</string>
<string name="stream_alarm_unavailable" msgid="4059817189292197839">"Ni na voljo, ker je vklopljen način »Ne moti«"</string>
<string name="stream_media_unavailable" msgid="6823020894438959853">"Ni na voljo, ker je vklopljen način »Ne moti«"</string>
- <!-- no translation found for stream_unavailable_by_modes (3674139029490353683) -->
- <skip />
- <!-- no translation found for stream_unavailable_by_unknown (6908434629318171588) -->
- <skip />
+ <string name="stream_unavailable_by_modes" msgid="3674139029490353683">"Ni na voljo, ker je vklopljen način <xliff:g id="MODE">%s</xliff:g>"</string>
+ <string name="stream_unavailable_by_unknown" msgid="6908434629318171588">"Ni na voljo"</string>
<string name="volume_stream_content_description_unmute" msgid="7729576371406792977">"%1$s. Dotaknite se, če želite vklopiti zvok."</string>
<string name="volume_stream_content_description_vibrate" msgid="4858111994183089761">"%1$s. Dotaknite se, če želite nastaviti vibriranje. V storitvah za dostopnost bo morda izklopljen zvok."</string>
<string name="volume_stream_content_description_mute" msgid="4079046784917920984">"%1$s. Dotaknite se, če želite izklopiti zvok. V storitvah za dostopnost bo morda izklopljen zvok."</string>
diff --git a/packages/SystemUI/res/values-sq/strings.xml b/packages/SystemUI/res/values-sq/strings.xml
index 8787a60e1907..0166acce341b 100644
--- a/packages/SystemUI/res/values-sq/strings.xml
+++ b/packages/SystemUI/res/values-sq/strings.xml
@@ -312,6 +312,10 @@
<string name="quick_settings_bluetooth_audio_sharing_button" msgid="7545274861795853838">"Ndaj audion"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_sharing" msgid="3069309588231072128">"Audioja po ndahet"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_accessibility" msgid="7604615019302091708">"për të hyrë te cilësimet e ndarjes së audios"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_message" msgid="4251807313264307426">"Muzika dhe videot e kësaj pajisjeje do të luhen në të dyja palët e kufjeve"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_title" msgid="4406818346036286793">"Ndaj audion tënde"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_subtitle" msgid="3014906864710059236">"<xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g> dhe <xliff:g id="ACTIVE_DEVICE_NAME">%2$s</xliff:g>"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_switch_to_button" msgid="7546825655978203773">"Kalo te profili \"<xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g>\""</string>
<string name="quick_settings_bluetooth_secondary_label_battery_level" msgid="4182034939479344093">"<xliff:g id="BATTERY_LEVEL_AS_PERCENTAGE">%s</xliff:g> bateri"</string>
<string name="quick_settings_bluetooth_secondary_label_audio" msgid="780333390310051161">"Audio"</string>
<string name="quick_settings_bluetooth_secondary_label_headset" msgid="2332093067553000852">"Kufje me mikrofon"</string>
@@ -440,8 +444,7 @@
<string name="zen_mode_on" msgid="9085304934016242591">"Aktiv"</string>
<string name="zen_mode_on_with_details" msgid="7416143430557895497">"Aktiv • <xliff:g id="TRIGGER_DESCRIPTION">%1$s</xliff:g>"</string>
<string name="zen_mode_off" msgid="1736604456618147306">"Joaktiv"</string>
- <!-- no translation found for zen_mode_set_up (8231201163894922821) -->
- <skip />
+ <string name="zen_mode_set_up" msgid="8231201163894922821">"Nuk është caktuar"</string>
<string name="zen_mode_no_manual_invocation" msgid="1769975741344633672">"Menaxho te cilësimet"</string>
<string name="zen_mode_active_modes" msgid="1625850411578488856">"{count,plural, =0{Nuk ka modalitete aktive}=1{\"{mode}\" është aktiv}other{# modalitete janë aktive}}"</string>
<string name="zen_priority_introduction" msgid="3159291973383796646">"Nuk do të shqetësohesh nga tingujt dhe dridhjet, përveç alarmeve, alarmeve rikujtuese, ngjarjeve dhe telefonuesve që specifikon. Do të vazhdosh të dëgjosh çdo gjë që zgjedh të luash duke përfshirë muzikën, videot dhe lojërat."</string>
@@ -673,10 +676,8 @@
<string name="stream_notification_unavailable" msgid="4313854556205836435">"Nuk ofrohet; ziles i është hequr zëri"</string>
<string name="stream_alarm_unavailable" msgid="4059817189292197839">"Nuk ofrohet; \"Mos shqetëso\" është aktiv"</string>
<string name="stream_media_unavailable" msgid="6823020894438959853">"Nuk ofrohet; \"Mos shqetëso\" është aktiv"</string>
- <!-- no translation found for stream_unavailable_by_modes (3674139029490353683) -->
- <skip />
- <!-- no translation found for stream_unavailable_by_unknown (6908434629318171588) -->
- <skip />
+ <string name="stream_unavailable_by_modes" msgid="3674139029490353683">"Nuk ofrohet sepse \"<xliff:g id="MODE">%s</xliff:g>\" është aktiv"</string>
+ <string name="stream_unavailable_by_unknown" msgid="6908434629318171588">"Nuk ofrohet"</string>
<string name="volume_stream_content_description_unmute" msgid="7729576371406792977">"%1$s. Trokit për të aktivizuar."</string>
<string name="volume_stream_content_description_vibrate" msgid="4858111994183089761">"%1$s. Trokit për ta caktuar te dridhja. Shërbimet e qasshmërisë mund të çaktivizohen."</string>
<string name="volume_stream_content_description_mute" msgid="4079046784917920984">"%1$s. Trokit për të çaktivizuar. Shërbimet e qasshmërisë mund të çaktivizohen."</string>
@@ -1410,38 +1411,26 @@
<string name="launch_touchpad_tutorial_notification_content" msgid="7931085031240753226">"Mëso gjestet e bllokut me prekje"</string>
<string name="launch_keyboard_touchpad_tutorial_notification_title" msgid="1940023776496198762">"Navigo duke përdorur tastierën dhe bllokun me prekje"</string>
<string name="launch_keyboard_touchpad_tutorial_notification_content" msgid="1780725168171929365">"Mëso gjestet e bllokut me prekje, shkurtoret e tastierës etj."</string>
- <!-- no translation found for touchpad_tutorial_back_gesture_button (3104716365403620315) -->
- <skip />
- <!-- no translation found for touchpad_tutorial_home_gesture_button (8023973153559885624) -->
- <skip />
+ <string name="touchpad_tutorial_back_gesture_button" msgid="3104716365403620315">"Kthehu prapa"</string>
+ <string name="touchpad_tutorial_home_gesture_button" msgid="8023973153559885624">"Shko tek ekrani bazë"</string>
<string name="touchpad_tutorial_recent_apps_gesture_button" msgid="8919227647650347359">"Shiko aplikacionet e fundit"</string>
<string name="touchpad_tutorial_done_button" msgid="176168488821755503">"U krye"</string>
<string name="touchpad_back_gesture_action_title" msgid="7199067250654332735">"Kthehu prapa"</string>
- <!-- no translation found for touchpad_back_gesture_guidance (5352221087725906542) -->
- <skip />
- <!-- no translation found for touchpad_back_gesture_success_title (7370719098633023496) -->
- <skip />
+ <string name="touchpad_back_gesture_guidance" msgid="5352221087725906542">"Rrëshqit shpejt majtas ose djathtas duke përdorur tre gishta në bllokun me prekje."</string>
+ <string name="touchpad_back_gesture_success_title" msgid="7370719098633023496">"Bukur!"</string>
<string name="touchpad_back_gesture_success_body" msgid="2324724953720741719">"E ke përfunduar gjestin e kthimit prapa."</string>
<string name="touchpad_home_gesture_action_title" msgid="8885107349719257882">"Shko tek ekrani bazë"</string>
- <!-- no translation found for touchpad_home_gesture_guidance (4178219118381915899) -->
- <skip />
- <!-- no translation found for touchpad_home_gesture_success_title (3648264553645798470) -->
- <skip />
- <!-- no translation found for touchpad_home_gesture_success_body (2590690589194027059) -->
- <skip />
+ <string name="touchpad_home_gesture_guidance" msgid="4178219118381915899">"Rrëshqit shpejt lart me tre gishta në bllokun me prekje"</string>
+ <string name="touchpad_home_gesture_success_title" msgid="3648264553645798470">"Punë e shkëlqyer!"</string>
+ <string name="touchpad_home_gesture_success_body" msgid="2590690589194027059">"E ke përfunduar gjestin e kalimit tek ekrani bazë"</string>
<string name="touchpad_recent_apps_gesture_action_title" msgid="934906836867137906">"Shiko aplikacionet e fundit"</string>
- <!-- no translation found for touchpad_recent_apps_gesture_guidance (6304446013842271822) -->
- <skip />
+ <string name="touchpad_recent_apps_gesture_guidance" msgid="6304446013842271822">"Rrëshqit shpejt lart dhe mbaj shtypur me tre gishta në bllokun me prekje"</string>
<string name="touchpad_recent_apps_gesture_success_title" msgid="8481920554139332593">"Punë e shkëlqyer!"</string>
<string name="touchpad_recent_apps_gesture_success_body" msgid="4334263906697493273">"Përfundove gjestin për shikimin e aplikacioneve të fundit."</string>
- <!-- no translation found for tutorial_action_key_title (8172535792469008169) -->
- <skip />
- <!-- no translation found for tutorial_action_key_guidance (5040613427202799294) -->
- <skip />
- <!-- no translation found for tutorial_action_key_success_title (2371827347071979571) -->
- <skip />
- <!-- no translation found for tutorial_action_key_success_body (1688986269491357832) -->
- <skip />
+ <string name="tutorial_action_key_title" msgid="8172535792469008169">"Shiko të gjitha aplikacionet"</string>
+ <string name="tutorial_action_key_guidance" msgid="5040613427202799294">"Shtyp tastin e veprimit në tastierë"</string>
+ <string name="tutorial_action_key_success_title" msgid="2371827347071979571">"Shumë mirë!"</string>
+ <string name="tutorial_action_key_success_body" msgid="1688986269491357832">"Përfundove gjestin për shikimin e të gjitha aplikacioneve"</string>
<string name="keyboard_backlight_dialog_title" msgid="8273102932345564724">"Drita e sfondit e tastierës"</string>
<string name="keyboard_backlight_value" msgid="7336398765584393538">"Niveli: %1$d nga %2$d"</string>
<string name="home_controls_dream_label" msgid="6567105701292324257">"Kontrollet e shtëpisë"</string>
diff --git a/packages/SystemUI/res/values-sr/strings.xml b/packages/SystemUI/res/values-sr/strings.xml
index 599d71a685ea..d7075adc9a66 100644
--- a/packages/SystemUI/res/values-sr/strings.xml
+++ b/packages/SystemUI/res/values-sr/strings.xml
@@ -312,6 +312,10 @@
<string name="quick_settings_bluetooth_audio_sharing_button" msgid="7545274861795853838">"Дели звук"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_sharing" msgid="3069309588231072128">"Дели се звук"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_accessibility" msgid="7604615019302091708">"уђите у подешавања дељења звука"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_message" msgid="4251807313264307426">"Музика и видеи са овог уређаја се репродукују на пару слушалица"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_title" msgid="4406818346036286793">"Делите звук"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_subtitle" msgid="3014906864710059236">"<xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g> и <xliff:g id="ACTIVE_DEVICE_NAME">%2$s</xliff:g>"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_switch_to_button" msgid="7546825655978203773">"Пређи на <xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g>"</string>
<string name="quick_settings_bluetooth_secondary_label_battery_level" msgid="4182034939479344093">"Ниво батерије је <xliff:g id="BATTERY_LEVEL_AS_PERCENTAGE">%s</xliff:g>"</string>
<string name="quick_settings_bluetooth_secondary_label_audio" msgid="780333390310051161">"Аудио"</string>
<string name="quick_settings_bluetooth_secondary_label_headset" msgid="2332093067553000852">"Слушалице"</string>
@@ -672,10 +676,8 @@
<string name="stream_notification_unavailable" msgid="4313854556205836435">"Недоступно јер је звук искључен"</string>
<string name="stream_alarm_unavailable" msgid="4059817189292197839">"Недоступно јер је укључен режим Не узнемиравај"</string>
<string name="stream_media_unavailable" msgid="6823020894438959853">"Недоступно јер је укључен режим Не узнемиравај"</string>
- <!-- no translation found for stream_unavailable_by_modes (3674139029490353683) -->
- <skip />
- <!-- no translation found for stream_unavailable_by_unknown (6908434629318171588) -->
- <skip />
+ <string name="stream_unavailable_by_modes" msgid="3674139029490353683">"Није доступно јер је укључено: <xliff:g id="MODE">%s</xliff:g>"</string>
+ <string name="stream_unavailable_by_unknown" msgid="6908434629318171588">"Недоступно"</string>
<string name="volume_stream_content_description_unmute" msgid="7729576371406792977">"%1$s. Додирните да бисте укључили звук."</string>
<string name="volume_stream_content_description_vibrate" msgid="4858111994183089761">"%1$s. Додирните да бисте подесили на вибрацију. Звук услуга приступачности ће можда бити искључен."</string>
<string name="volume_stream_content_description_mute" msgid="4079046784917920984">"%1$s. Додирните да бисте искључили звук. Звук услуга приступачности ће можда бити искључен."</string>
diff --git a/packages/SystemUI/res/values-sv/strings.xml b/packages/SystemUI/res/values-sv/strings.xml
index e1d13316b115..e03fc27b8cbf 100644
--- a/packages/SystemUI/res/values-sv/strings.xml
+++ b/packages/SystemUI/res/values-sv/strings.xml
@@ -312,6 +312,10 @@
<string name="quick_settings_bluetooth_audio_sharing_button" msgid="7545274861795853838">"Dela ljud"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_sharing" msgid="3069309588231072128">"Delar ljud"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_accessibility" msgid="7604615019302091708">"öppna inställningarna för ljuddelning"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_message" msgid="4251807313264307426">"Musik och videor från den här enheten spelas upp i båda paren hörlurar"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_title" msgid="4406818346036286793">"Dela ljudet"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_subtitle" msgid="3014906864710059236">"<xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g> och <xliff:g id="ACTIVE_DEVICE_NAME">%2$s</xliff:g>"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_switch_to_button" msgid="7546825655978203773">"Byt till <xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g>"</string>
<string name="quick_settings_bluetooth_secondary_label_battery_level" msgid="4182034939479344093">"<xliff:g id="BATTERY_LEVEL_AS_PERCENTAGE">%s</xliff:g> batteri"</string>
<string name="quick_settings_bluetooth_secondary_label_audio" msgid="780333390310051161">"Ljud"</string>
<string name="quick_settings_bluetooth_secondary_label_headset" msgid="2332093067553000852">"Headset"</string>
@@ -672,10 +676,8 @@
<string name="stream_notification_unavailable" msgid="4313854556205836435">"Otillgängligt eftersom ringljudet är av"</string>
<string name="stream_alarm_unavailable" msgid="4059817189292197839">"Inte tillgängligt eftersom Stör ej är aktiverat"</string>
<string name="stream_media_unavailable" msgid="6823020894438959853">"Inte tillgängligt eftersom Stör ej är aktiverat"</string>
- <!-- no translation found for stream_unavailable_by_modes (3674139029490353683) -->
- <skip />
- <!-- no translation found for stream_unavailable_by_unknown (6908434629318171588) -->
- <skip />
+ <string name="stream_unavailable_by_modes" msgid="3674139029490353683">"Inte tillgängligt eftersom <xliff:g id="MODE">%s</xliff:g> är på"</string>
+ <string name="stream_unavailable_by_unknown" msgid="6908434629318171588">"Inte tillgängligt"</string>
<string name="volume_stream_content_description_unmute" msgid="7729576371406792977">"%1$s. Tryck här om du vill slå på ljudet."</string>
<string name="volume_stream_content_description_vibrate" msgid="4858111994183089761">"%1$s. Tryck här om du vill sätta på vibrationen. Tillgänglighetstjänster kanske inaktiveras."</string>
<string name="volume_stream_content_description_mute" msgid="4079046784917920984">"%1$s. Tryck här om du vill stänga av ljudet. Tillgänglighetstjänsterna kanske inaktiveras."</string>
diff --git a/packages/SystemUI/res/values-sw/strings.xml b/packages/SystemUI/res/values-sw/strings.xml
index d7ffdd458f09..0ab6f7d5000a 100644
--- a/packages/SystemUI/res/values-sw/strings.xml
+++ b/packages/SystemUI/res/values-sw/strings.xml
@@ -312,6 +312,10 @@
<string name="quick_settings_bluetooth_audio_sharing_button" msgid="7545274861795853838">"Sikiliza pamoja na wengine"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_sharing" msgid="3069309588231072128">"Mnasikiliza pamoja"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_accessibility" msgid="7604615019302091708">"uweke mipangilio ya kusikiliza pamoja"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_message" msgid="4251807313264307426">"Faili za muziki na video katika kifaa hiki zitacheza kwenye jozi zote mbili za vipokea sauti vya kichwani"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_title" msgid="4406818346036286793">"Kusikiliza maudhui yako ya sauti pamoja na wengine"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_subtitle" msgid="3014906864710059236">"<xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g> na <xliff:g id="ACTIVE_DEVICE_NAME">%2$s</xliff:g>"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_switch_to_button" msgid="7546825655978203773">"Badilisha utumie <xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g>"</string>
<string name="quick_settings_bluetooth_secondary_label_battery_level" msgid="4182034939479344093">"Chaji ya betri ni <xliff:g id="BATTERY_LEVEL_AS_PERCENTAGE">%s</xliff:g>"</string>
<string name="quick_settings_bluetooth_secondary_label_audio" msgid="780333390310051161">"Sauti"</string>
<string name="quick_settings_bluetooth_secondary_label_headset" msgid="2332093067553000852">"Vifaa vya sauti"</string>
@@ -672,10 +676,8 @@
<string name="stream_notification_unavailable" msgid="4313854556205836435">"Halipatikani kwa sababu sauti imezimwa"</string>
<string name="stream_alarm_unavailable" msgid="4059817189292197839">"Imeshindwa kwa sababu Usinisumbue imewashwa"</string>
<string name="stream_media_unavailable" msgid="6823020894438959853">"Imeshindwa kwa sababu Usinisumbue imewashwa"</string>
- <!-- no translation found for stream_unavailable_by_modes (3674139029490353683) -->
- <skip />
- <!-- no translation found for stream_unavailable_by_unknown (6908434629318171588) -->
- <skip />
+ <string name="stream_unavailable_by_modes" msgid="3674139029490353683">"Haipatikani kwa sababu umewasha hali ya <xliff:g id="MODE">%s</xliff:g>"</string>
+ <string name="stream_unavailable_by_unknown" msgid="6908434629318171588">"Haipatikani"</string>
<string name="volume_stream_content_description_unmute" msgid="7729576371406792977">"%1$s. Gusa ili urejeshe."</string>
<string name="volume_stream_content_description_vibrate" msgid="4858111994183089761">"%1$s. Gusa ili uweke mtetemo. Huenda ikakomesha huduma za zana za walio na matatizo ya kuona au kusikia."</string>
<string name="volume_stream_content_description_mute" msgid="4079046784917920984">"%1$s. Gusa ili ukomeshe. Huenda ikakomesha huduma za zana za walio na matatizo ya kuona au kusikia."</string>
diff --git a/packages/SystemUI/res/values-ta/strings.xml b/packages/SystemUI/res/values-ta/strings.xml
index ba1b0ec52aec..f930d84dbfc8 100644
--- a/packages/SystemUI/res/values-ta/strings.xml
+++ b/packages/SystemUI/res/values-ta/strings.xml
@@ -312,6 +312,10 @@
<string name="quick_settings_bluetooth_audio_sharing_button" msgid="7545274861795853838">"ஆடியோவைப் பகிர்"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_sharing" msgid="3069309588231072128">"ஆடியோ பகிரப்படுகிறது"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_accessibility" msgid="7604615019302091708">"ஆடியோ பகிர்வு அமைப்புகளுக்குச் செல்லும்"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_message" msgid="4251807313264307426">"இந்தச் சாதனத்தின் இசையும் வீடியோக்களும் இரண்டு ஜோடி ஹெட்ஃபோன்களிலும் பிளே ஆகும்"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_title" msgid="4406818346036286793">"ஆடியோவைப் பகிர்தல்"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_subtitle" msgid="3014906864710059236">"<xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g>, <xliff:g id="ACTIVE_DEVICE_NAME">%2$s</xliff:g>"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_switch_to_button" msgid="7546825655978203773">"<xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g>க்கு மாற்று"</string>
<string name="quick_settings_bluetooth_secondary_label_battery_level" msgid="4182034939479344093">"<xliff:g id="BATTERY_LEVEL_AS_PERCENTAGE">%s</xliff:g> பேட்டரி"</string>
<string name="quick_settings_bluetooth_secondary_label_audio" msgid="780333390310051161">"ஆடியோ"</string>
<string name="quick_settings_bluetooth_secondary_label_headset" msgid="2332093067553000852">"ஹெட்செட்"</string>
@@ -440,8 +444,7 @@
<string name="zen_mode_on" msgid="9085304934016242591">"இயக்கப்பட்டுள்ளது"</string>
<string name="zen_mode_on_with_details" msgid="7416143430557895497">"ஆன் • <xliff:g id="TRIGGER_DESCRIPTION">%1$s</xliff:g>"</string>
<string name="zen_mode_off" msgid="1736604456618147306">"முடக்கப்பட்டுள்ளது"</string>
- <!-- no translation found for zen_mode_set_up (8231201163894922821) -->
- <skip />
+ <string name="zen_mode_set_up" msgid="8231201163894922821">"அமைக்கப்படவில்லை"</string>
<string name="zen_mode_no_manual_invocation" msgid="1769975741344633672">"அமைப்புகளில் நிர்வகியுங்கள்"</string>
<string name="zen_mode_active_modes" msgid="1625850411578488856">"{count,plural, =0{செயலிலுள்ள பயன்முறைகள் எதுவுமில்லை}=1{{mode} செயலில் உள்ளது}other{# பயன்முறைகள் செயலில் உள்ளன}}"</string>
<string name="zen_priority_introduction" msgid="3159291973383796646">"அலாரங்கள், நினைவூட்டல்கள், நிகழ்வுகள் மற்றும் குறிப்பிட்ட அழைப்பாளர்களைத் தவிர்த்து, பிற ஒலிகள் மற்றும் அதிர்வுகளின் தொந்தரவு இருக்காது. எனினும், நீங்கள் எதையேனும் (இசை, வீடியோக்கள், கேம்ஸ் போன்றவை) ஒலிக்கும்படி தேர்ந்தெடுத்திருந்தால், அவை வழக்கம் போல் ஒலிக்கும்."</string>
@@ -673,10 +676,8 @@
<string name="stream_notification_unavailable" msgid="4313854556205836435">"\'ரிங்\' மியூட்டில் உள்ளதால் கிடைக்கவில்லை"</string>
<string name="stream_alarm_unavailable" msgid="4059817189292197839">"\'தொந்தரவு செய்ய வேண்டாம்\' ஆனில் இருப்பதால் இல்லை"</string>
<string name="stream_media_unavailable" msgid="6823020894438959853">"\'தொந்தரவு செய்ய வேண்டாம்\' ஆனில் இருப்பதால் இல்லை"</string>
- <!-- no translation found for stream_unavailable_by_modes (3674139029490353683) -->
- <skip />
- <!-- no translation found for stream_unavailable_by_unknown (6908434629318171588) -->
- <skip />
+ <string name="stream_unavailable_by_modes" msgid="3674139029490353683">"<xliff:g id="MODE">%s</xliff:g> பயன்முறை இயக்கத்தில் இருப்பதால் கிடைக்கவில்லை"</string>
+ <string name="stream_unavailable_by_unknown" msgid="6908434629318171588">"கிடைக்கவில்லை"</string>
<string name="volume_stream_content_description_unmute" msgid="7729576371406792977">"%1$s. ஒலி இயக்க, தட்டவும்."</string>
<string name="volume_stream_content_description_vibrate" msgid="4858111994183089761">"%1$s. அதிர்விற்கு அமைக்க, தட்டவும். அணுகல்தன்மை சேவைகள் ஒலியடக்கப்படக்கூடும்."</string>
<string name="volume_stream_content_description_mute" msgid="4079046784917920984">"%1$s. ஒலியடக்க, தட்டவும். அணுகல்தன்மை சேவைகள் ஒலியடக்கப்படக்கூடும்."</string>
@@ -1410,38 +1411,26 @@
<string name="launch_touchpad_tutorial_notification_content" msgid="7931085031240753226">"டச்பேட் சைகைள் குறித்துத் தெரிந்துகொள்ளுங்கள்"</string>
<string name="launch_keyboard_touchpad_tutorial_notification_title" msgid="1940023776496198762">"உங்கள் டச்பேட் மற்றும் கீபோர்டைப் பயன்படுத்திச் செல்லுதல்"</string>
<string name="launch_keyboard_touchpad_tutorial_notification_content" msgid="1780725168171929365">"டச்பேட் சைகைகள், கீபோர்டு ஷார்ட்கட்கள் மற்றும் பலவற்றைத் தெரிந்துகொள்ளுங்கள்"</string>
- <!-- no translation found for touchpad_tutorial_back_gesture_button (3104716365403620315) -->
- <skip />
- <!-- no translation found for touchpad_tutorial_home_gesture_button (8023973153559885624) -->
- <skip />
+ <string name="touchpad_tutorial_back_gesture_button" msgid="3104716365403620315">"பின்செல்"</string>
+ <string name="touchpad_tutorial_home_gesture_button" msgid="8023973153559885624">"முகப்பிற்குச் செல்"</string>
<string name="touchpad_tutorial_recent_apps_gesture_button" msgid="8919227647650347359">"சமீபத்திய ஆப்ஸைக் காட்டுதல்"</string>
<string name="touchpad_tutorial_done_button" msgid="176168488821755503">"முடிந்தது"</string>
<string name="touchpad_back_gesture_action_title" msgid="7199067250654332735">"பின்செல்"</string>
- <!-- no translation found for touchpad_back_gesture_guidance (5352221087725906542) -->
- <skip />
- <!-- no translation found for touchpad_back_gesture_success_title (7370719098633023496) -->
- <skip />
+ <string name="touchpad_back_gesture_guidance" msgid="5352221087725906542">"உங்கள் டச்பேடில் மூன்று விரல்களால் இடது அல்லது வலதுபுறம் ஸ்வைப் செய்யவும்"</string>
+ <string name="touchpad_back_gesture_success_title" msgid="7370719098633023496">"அருமை!"</string>
<string name="touchpad_back_gesture_success_body" msgid="2324724953720741719">"பின்செல்வதற்கான சைகையை நிறைவுசெய்துவிட்டீர்கள்."</string>
<string name="touchpad_home_gesture_action_title" msgid="8885107349719257882">"முகப்பிற்குச் செல்"</string>
- <!-- no translation found for touchpad_home_gesture_guidance (4178219118381915899) -->
- <skip />
- <!-- no translation found for touchpad_home_gesture_success_title (3648264553645798470) -->
- <skip />
- <!-- no translation found for touchpad_home_gesture_success_body (2590690589194027059) -->
- <skip />
+ <string name="touchpad_home_gesture_guidance" msgid="4178219118381915899">"டச்பேடில் மூன்று விரல்களால் மேல்நோக்கி ஸ்வைப் செய்யவும்"</string>
+ <string name="touchpad_home_gesture_success_title" msgid="3648264553645798470">"அருமை!"</string>
+ <string name="touchpad_home_gesture_success_body" msgid="2590690589194027059">"முகப்புக்குச் செல்வதற்கான சைகைப் பயிற்சியை நிறைவுசெய்துவிட்டீர்கள்"</string>
<string name="touchpad_recent_apps_gesture_action_title" msgid="934906836867137906">"சமீபத்திய ஆப்ஸைக் காட்டுதல்"</string>
- <!-- no translation found for touchpad_recent_apps_gesture_guidance (6304446013842271822) -->
- <skip />
+ <string name="touchpad_recent_apps_gesture_guidance" msgid="6304446013842271822">"உங்கள் டச்பேடில் மூன்று விரல்களால் மேல்நோக்கி ஸ்வைப் செய்து பிடிக்கவும்"</string>
<string name="touchpad_recent_apps_gesture_success_title" msgid="8481920554139332593">"அருமை!"</string>
<string name="touchpad_recent_apps_gesture_success_body" msgid="4334263906697493273">"சமீபத்தில் பயன்படுத்திய ஆப்ஸுக்கான சைகை பயிற்சியை நிறைவுசெய்துவிட்டீர்கள்."</string>
- <!-- no translation found for tutorial_action_key_title (8172535792469008169) -->
- <skip />
- <!-- no translation found for tutorial_action_key_guidance (5040613427202799294) -->
- <skip />
- <!-- no translation found for tutorial_action_key_success_title (2371827347071979571) -->
- <skip />
- <!-- no translation found for tutorial_action_key_success_body (1688986269491357832) -->
- <skip />
+ <string name="tutorial_action_key_title" msgid="8172535792469008169">"அனைத்து ஆப்ஸையும் காட்டு"</string>
+ <string name="tutorial_action_key_guidance" msgid="5040613427202799294">"உங்கள் கீபோர்டில் ஆக்‌ஷன் பட்டனை அழுத்தவும்"</string>
+ <string name="tutorial_action_key_success_title" msgid="2371827347071979571">"அருமை!"</string>
+ <string name="tutorial_action_key_success_body" msgid="1688986269491357832">"அனைத்து ஆப்ஸுக்கான சைகை பயிற்சியையும் நிறைவுசெய்துவிட்டீர்கள்"</string>
<string name="keyboard_backlight_dialog_title" msgid="8273102932345564724">"கீபோர்டு பேக்லைட்"</string>
<string name="keyboard_backlight_value" msgid="7336398765584393538">"நிலை, %2$d இல் %1$d"</string>
<string name="home_controls_dream_label" msgid="6567105701292324257">"ஹோம் கன்ட்ரோல்கள்"</string>
diff --git a/packages/SystemUI/res/values-te/strings.xml b/packages/SystemUI/res/values-te/strings.xml
index 8eeb1490b3ce..85973dfc1d85 100644
--- a/packages/SystemUI/res/values-te/strings.xml
+++ b/packages/SystemUI/res/values-te/strings.xml
@@ -312,6 +312,10 @@
<string name="quick_settings_bluetooth_audio_sharing_button" msgid="7545274861795853838">"ఆడియోను షేర్ చేయండి"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_sharing" msgid="3069309588231072128">"ఆడియోను షేర్ చేస్తున్నారు"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_accessibility" msgid="7604615019302091708">"ఆడియో షేరింగ్ సెట్టింగ్‌లను ఎంటర్ చేయండి"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_message" msgid="4251807313264307426">"ఈ పరికరం మ్యూజిక్, వీడియోలు హెడ్‌ఫోన్స్‌కు సంబంధించిన పెయిర్‌ల రెండింటిలోనూ ప్లే అవుతాయి"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_title" msgid="4406818346036286793">"మీ ఆడియోను షేర్ చేయండి"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_subtitle" msgid="3014906864710059236">"<xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g>, <xliff:g id="ACTIVE_DEVICE_NAME">%2$s</xliff:g>"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_switch_to_button" msgid="7546825655978203773">"<xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g>‌కు మారండి"</string>
<string name="quick_settings_bluetooth_secondary_label_battery_level" msgid="4182034939479344093">"<xliff:g id="BATTERY_LEVEL_AS_PERCENTAGE">%s</xliff:g> బ్యాటరీ"</string>
<string name="quick_settings_bluetooth_secondary_label_audio" msgid="780333390310051161">"ఆడియో"</string>
<string name="quick_settings_bluetooth_secondary_label_headset" msgid="2332093067553000852">"హెడ్‌సెట్"</string>
@@ -672,10 +676,8 @@
<string name="stream_notification_unavailable" msgid="4313854556205836435">"వాల్యూమ్ మ్యూట్ అయినందున అందుబాటులో లేదు"</string>
<string name="stream_alarm_unavailable" msgid="4059817189292197839">"అంతరాయంకలిగించవద్దు ఆన్‌లో ఉన్నందున అందుబాటులోలేదు"</string>
<string name="stream_media_unavailable" msgid="6823020894438959853">"అంతరాయంకలిగించవద్దు ఆన్‌లో ఉన్నందున అందుబాటులోలేదు"</string>
- <!-- no translation found for stream_unavailable_by_modes (3674139029490353683) -->
- <skip />
- <!-- no translation found for stream_unavailable_by_unknown (6908434629318171588) -->
- <skip />
+ <string name="stream_unavailable_by_modes" msgid="3674139029490353683">"<xliff:g id="MODE">%s</xliff:g> ఆన్‌లో ఉన్నందున అందుబాటులో లేదు"</string>
+ <string name="stream_unavailable_by_unknown" msgid="6908434629318171588">"అందుబాటులో లేదు"</string>
<string name="volume_stream_content_description_unmute" msgid="7729576371406792977">"%1$s. అన్‌మ్యూట్ చేయడానికి నొక్కండి."</string>
<string name="volume_stream_content_description_vibrate" msgid="4858111994183089761">"%1$s. వైబ్రేషన్‌కు సెట్ చేయడానికి నొక్కండి. యాక్సెస్ సామర్థ్య సేవలు మ్యూట్ చేయబడవచ్చు."</string>
<string name="volume_stream_content_description_mute" msgid="4079046784917920984">"%1$s. మ్యూట్ చేయడానికి నొక్కండి. యాక్సెస్ సామర్థ్య సేవలు మ్యూట్ చేయబడవచ్చు."</string>
diff --git a/packages/SystemUI/res/values-th/strings.xml b/packages/SystemUI/res/values-th/strings.xml
index 44a33ecaeb0c..67006b6e6273 100644
--- a/packages/SystemUI/res/values-th/strings.xml
+++ b/packages/SystemUI/res/values-th/strings.xml
@@ -312,6 +312,10 @@
<string name="quick_settings_bluetooth_audio_sharing_button" msgid="7545274861795853838">"แชร์เสียง"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_sharing" msgid="3069309588231072128">"กำลังแชร์เสียง"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_accessibility" msgid="7604615019302091708">"เข้าสู่การตั้งค่าการแชร์เสียง"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_message" msgid="4251807313264307426">"เพลงและวิดีโอของอุปกรณ์เครื่องนี้จะเล่นในหูฟังทั้ง 2 คู่"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_title" msgid="4406818346036286793">"แชร์เสียงของคุณ"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_subtitle" msgid="3014906864710059236">"<xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g> และ <xliff:g id="ACTIVE_DEVICE_NAME">%2$s</xliff:g>"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_switch_to_button" msgid="7546825655978203773">"เปลี่ยนเป็น <xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g>"</string>
<string name="quick_settings_bluetooth_secondary_label_battery_level" msgid="4182034939479344093">"แบตเตอรี่ <xliff:g id="BATTERY_LEVEL_AS_PERCENTAGE">%s</xliff:g>"</string>
<string name="quick_settings_bluetooth_secondary_label_audio" msgid="780333390310051161">"เสียง"</string>
<string name="quick_settings_bluetooth_secondary_label_headset" msgid="2332093067553000852">"ชุดหูฟัง"</string>
@@ -672,10 +676,8 @@
<string name="stream_notification_unavailable" msgid="4313854556205836435">"เปลี่ยนไม่ได้เนื่องจากปิดเสียงเรียกเข้า"</string>
<string name="stream_alarm_unavailable" msgid="4059817189292197839">"ไม่พร้อมใช้งานเนื่องจากโหมดห้ามรบกวนเปิดอยู่"</string>
<string name="stream_media_unavailable" msgid="6823020894438959853">"ไม่พร้อมใช้งานเนื่องจากโหมดห้ามรบกวนเปิดอยู่"</string>
- <!-- no translation found for stream_unavailable_by_modes (3674139029490353683) -->
- <skip />
- <!-- no translation found for stream_unavailable_by_unknown (6908434629318171588) -->
- <skip />
+ <string name="stream_unavailable_by_modes" msgid="3674139029490353683">"ใช้งานไม่ได้เนื่องจากเปิด<xliff:g id="MODE">%s</xliff:g>อยู่"</string>
+ <string name="stream_unavailable_by_unknown" msgid="6908434629318171588">"ไม่พร้อมใช้งาน"</string>
<string name="volume_stream_content_description_unmute" msgid="7729576371406792977">"%1$s แตะเพื่อเปิดเสียง"</string>
<string name="volume_stream_content_description_vibrate" msgid="4858111994183089761">"%1$s แตะเพื่อตั้งค่าให้สั่น อาจมีการปิดเสียงบริการการเข้าถึง"</string>
<string name="volume_stream_content_description_mute" msgid="4079046784917920984">"%1$s แตะเพื่อปิดเสียง อาจมีการปิดเสียงบริการการเข้าถึง"</string>
diff --git a/packages/SystemUI/res/values-tl/strings.xml b/packages/SystemUI/res/values-tl/strings.xml
index c782dd412196..e41c53f2fa5c 100644
--- a/packages/SystemUI/res/values-tl/strings.xml
+++ b/packages/SystemUI/res/values-tl/strings.xml
@@ -312,6 +312,10 @@
<string name="quick_settings_bluetooth_audio_sharing_button" msgid="7545274861795853838">"Ibahagi ang audio"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_sharing" msgid="3069309588231072128">"Ibinabahagi ang audio"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_accessibility" msgid="7604615019302091708">"pumasok sa mga setting sa pag-share ng audio"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_message" msgid="4251807313264307426">"Magpe-play ang musika at mga video ng device na ito sa parehong pares ng headphones"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_title" msgid="4406818346036286793">"Ibahagi ang iyong audio"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_subtitle" msgid="3014906864710059236">"<xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g> at <xliff:g id="ACTIVE_DEVICE_NAME">%2$s</xliff:g>"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_switch_to_button" msgid="7546825655978203773">"Lumipat sa <xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g>"</string>
<string name="quick_settings_bluetooth_secondary_label_battery_level" msgid="4182034939479344093">"<xliff:g id="BATTERY_LEVEL_AS_PERCENTAGE">%s</xliff:g> na baterya"</string>
<string name="quick_settings_bluetooth_secondary_label_audio" msgid="780333390310051161">"Audio"</string>
<string name="quick_settings_bluetooth_secondary_label_headset" msgid="2332093067553000852">"Headset"</string>
@@ -672,10 +676,8 @@
<string name="stream_notification_unavailable" msgid="4313854556205836435">"Hindi available dahil naka-mute ang ring"</string>
<string name="stream_alarm_unavailable" msgid="4059817189292197839">"Hindi available dahil naka-on ang Huwag Istorbohin"</string>
<string name="stream_media_unavailable" msgid="6823020894438959853">"Hindi available dahil naka-on ang Huwag Istorbohin"</string>
- <!-- no translation found for stream_unavailable_by_modes (3674139029490353683) -->
- <skip />
- <!-- no translation found for stream_unavailable_by_unknown (6908434629318171588) -->
- <skip />
+ <string name="stream_unavailable_by_modes" msgid="3674139029490353683">"Hindi available dahil naka-on ang <xliff:g id="MODE">%s</xliff:g>"</string>
+ <string name="stream_unavailable_by_unknown" msgid="6908434629318171588">"Hindi available"</string>
<string name="volume_stream_content_description_unmute" msgid="7729576371406792977">"%1$s. I-tap upang i-unmute."</string>
<string name="volume_stream_content_description_vibrate" msgid="4858111994183089761">"%1$s. I-tap upang itakda na mag-vibrate. Maaaring i-mute ang mga serbisyo sa Accessibility."</string>
<string name="volume_stream_content_description_mute" msgid="4079046784917920984">"%1$s. I-tap upang i-mute. Maaaring i-mute ang mga serbisyo sa Accessibility."</string>
diff --git a/packages/SystemUI/res/values-tr/strings.xml b/packages/SystemUI/res/values-tr/strings.xml
index ad543cfc72ce..1dab64adc32a 100644
--- a/packages/SystemUI/res/values-tr/strings.xml
+++ b/packages/SystemUI/res/values-tr/strings.xml
@@ -312,6 +312,10 @@
<string name="quick_settings_bluetooth_audio_sharing_button" msgid="7545274861795853838">"Sesi paylaş"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_sharing" msgid="3069309588231072128">"Ses paylaşılıyor"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_accessibility" msgid="7604615019302091708">"Ses paylaşımı ayarlarına gitmek için"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_message" msgid="4251807313264307426">"Bu cihazdaki müzikler ve videolar iki kulaklıkta da oynatılacak"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_title" msgid="4406818346036286793">"Sesi paylaşın"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_subtitle" msgid="3014906864710059236">"<xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g> ve <xliff:g id="ACTIVE_DEVICE_NAME">%2$s</xliff:g>"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_switch_to_button" msgid="7546825655978203773">"<xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g> cihazına geç"</string>
<string name="quick_settings_bluetooth_secondary_label_battery_level" msgid="4182034939479344093">"Pil düzeyi <xliff:g id="BATTERY_LEVEL_AS_PERCENTAGE">%s</xliff:g>"</string>
<string name="quick_settings_bluetooth_secondary_label_audio" msgid="780333390310051161">"Ses"</string>
<string name="quick_settings_bluetooth_secondary_label_headset" msgid="2332093067553000852">"Mikrofonlu kulaklık"</string>
@@ -440,8 +444,7 @@
<string name="zen_mode_on" msgid="9085304934016242591">"Açık"</string>
<string name="zen_mode_on_with_details" msgid="7416143430557895497">"Açık • <xliff:g id="TRIGGER_DESCRIPTION">%1$s</xliff:g>"</string>
<string name="zen_mode_off" msgid="1736604456618147306">"Kapalı"</string>
- <!-- no translation found for zen_mode_set_up (8231201163894922821) -->
- <skip />
+ <string name="zen_mode_set_up" msgid="8231201163894922821">"Ayarlanmadı"</string>
<string name="zen_mode_no_manual_invocation" msgid="1769975741344633672">"Ayarlarda yönet"</string>
<string name="zen_mode_active_modes" msgid="1625850411578488856">"{count,plural, =0{Etkin mod yok}=1{{mode} etkin}other{# mod etkin}}"</string>
<string name="zen_priority_introduction" msgid="3159291973383796646">"Alarmlar, hatırlatıcılar, etkinlikler ve sizin seçtiğiniz kişilerden gelen çağrılar dışında hiçbir ses ve titreşimle rahatsız edilmeyeceksiniz. O sırada çaldığınız müzik, seyrettiğiniz video ya da oynadığınız oyunların sesini duymaya devam edeceksiniz."</string>
@@ -673,10 +676,8 @@
<string name="stream_notification_unavailable" msgid="4313854556205836435">"Zil sesi kapatıldığı için kullanılamıyor"</string>
<string name="stream_alarm_unavailable" msgid="4059817189292197839">"Rahatsız Etmeyin açık olduğu için kullanılamıyor"</string>
<string name="stream_media_unavailable" msgid="6823020894438959853">"Rahatsız Etmeyin açık olduğu için kullanılamıyor"</string>
- <!-- no translation found for stream_unavailable_by_modes (3674139029490353683) -->
- <skip />
- <!-- no translation found for stream_unavailable_by_unknown (6908434629318171588) -->
- <skip />
+ <string name="stream_unavailable_by_modes" msgid="3674139029490353683">"<xliff:g id="MODE">%s</xliff:g> açık olduğu için kullanılamıyor"</string>
+ <string name="stream_unavailable_by_unknown" msgid="6908434629318171588">"Yok"</string>
<string name="volume_stream_content_description_unmute" msgid="7729576371406792977">"%1$s. Sesi açmak için dokunun."</string>
<string name="volume_stream_content_description_vibrate" msgid="4858111994183089761">"%1$s. Titreşime ayarlamak için dokunun. Erişilebilirlik hizmetlerinin sesi kapatılabilir."</string>
<string name="volume_stream_content_description_mute" msgid="4079046784917920984">"%1$s. Sesi kapatmak için dokunun. Erişilebilirlik hizmetlerinin sesi kapatılabilir."</string>
@@ -1410,38 +1411,26 @@
<string name="launch_touchpad_tutorial_notification_content" msgid="7931085031240753226">"Dokunmatik alan hareketlerini öğrenin"</string>
<string name="launch_keyboard_touchpad_tutorial_notification_title" msgid="1940023776496198762">"Klavyenizi ve dokunmatik alanınızı kullanarak gezinin"</string>
<string name="launch_keyboard_touchpad_tutorial_notification_content" msgid="1780725168171929365">"Dokunmatik alan hareketlerini, klavye kısayollarını ve daha fazlasını öğrenin"</string>
- <!-- no translation found for touchpad_tutorial_back_gesture_button (3104716365403620315) -->
- <skip />
- <!-- no translation found for touchpad_tutorial_home_gesture_button (8023973153559885624) -->
- <skip />
+ <string name="touchpad_tutorial_back_gesture_button" msgid="3104716365403620315">"Geri dön"</string>
+ <string name="touchpad_tutorial_home_gesture_button" msgid="8023973153559885624">"Ana sayfaya git"</string>
<string name="touchpad_tutorial_recent_apps_gesture_button" msgid="8919227647650347359">"Son uygulamaları görüntüle"</string>
<string name="touchpad_tutorial_done_button" msgid="176168488821755503">"Bitti"</string>
<string name="touchpad_back_gesture_action_title" msgid="7199067250654332735">"Geri dön"</string>
- <!-- no translation found for touchpad_back_gesture_guidance (5352221087725906542) -->
- <skip />
- <!-- no translation found for touchpad_back_gesture_success_title (7370719098633023496) -->
- <skip />
+ <string name="touchpad_back_gesture_guidance" msgid="5352221087725906542">"Dokunmatik alanda üç parmağınızla sola veya sağa kaydırın"</string>
+ <string name="touchpad_back_gesture_success_title" msgid="7370719098633023496">"Güzel!"</string>
<string name="touchpad_back_gesture_success_body" msgid="2324724953720741719">"Geri dön hareketini tamamladınız."</string>
<string name="touchpad_home_gesture_action_title" msgid="8885107349719257882">"Ana sayfaya gidin"</string>
- <!-- no translation found for touchpad_home_gesture_guidance (4178219118381915899) -->
- <skip />
- <!-- no translation found for touchpad_home_gesture_success_title (3648264553645798470) -->
- <skip />
- <!-- no translation found for touchpad_home_gesture_success_body (2590690589194027059) -->
- <skip />
+ <string name="touchpad_home_gesture_guidance" msgid="4178219118381915899">"Dokunmatik alanda üç parmağınızla yukarı kaydırın"</string>
+ <string name="touchpad_home_gesture_success_title" msgid="3648264553645798470">"Tebrikler!"</string>
+ <string name="touchpad_home_gesture_success_body" msgid="2590690589194027059">"Ana ekrana git hareketini tamamladınız"</string>
<string name="touchpad_recent_apps_gesture_action_title" msgid="934906836867137906">"Son uygulamaları görüntüle"</string>
- <!-- no translation found for touchpad_recent_apps_gesture_guidance (6304446013842271822) -->
- <skip />
+ <string name="touchpad_recent_apps_gesture_guidance" msgid="6304446013842271822">"Dokunmatik alanda üç parmağınızla yukarı doğru kaydırıp basılı tutun"</string>
<string name="touchpad_recent_apps_gesture_success_title" msgid="8481920554139332593">"Tebrikler!"</string>
<string name="touchpad_recent_apps_gesture_success_body" msgid="4334263906697493273">"Son uygulamaları görüntüleme hareketini tamamladınız."</string>
- <!-- no translation found for tutorial_action_key_title (8172535792469008169) -->
- <skip />
- <!-- no translation found for tutorial_action_key_guidance (5040613427202799294) -->
- <skip />
- <!-- no translation found for tutorial_action_key_success_title (2371827347071979571) -->
- <skip />
- <!-- no translation found for tutorial_action_key_success_body (1688986269491357832) -->
- <skip />
+ <string name="tutorial_action_key_title" msgid="8172535792469008169">"Tüm uygulamaları göster"</string>
+ <string name="tutorial_action_key_guidance" msgid="5040613427202799294">"Klavyenizde eylem tuşuna basın"</string>
+ <string name="tutorial_action_key_success_title" msgid="2371827347071979571">"Tebrikler!"</string>
+ <string name="tutorial_action_key_success_body" msgid="1688986269491357832">"Tüm uygulamaları görüntüleme hareketini tamamladınız"</string>
<string name="keyboard_backlight_dialog_title" msgid="8273102932345564724">"Klavye aydınlatması"</string>
<string name="keyboard_backlight_value" msgid="7336398765584393538">"Seviye %1$d / %2$d"</string>
<string name="home_controls_dream_label" msgid="6567105701292324257">"Ev Kontrolleri"</string>
diff --git a/packages/SystemUI/res/values-uk/strings.xml b/packages/SystemUI/res/values-uk/strings.xml
index 0d664e3f16bb..fcdccdb7e77d 100644
--- a/packages/SystemUI/res/values-uk/strings.xml
+++ b/packages/SystemUI/res/values-uk/strings.xml
@@ -312,6 +312,10 @@
<string name="quick_settings_bluetooth_audio_sharing_button" msgid="7545274861795853838">"Поділитись аудіо"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_sharing" msgid="3069309588231072128">"Надсилання аудіо"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_accessibility" msgid="7604615019302091708">"відкрити налаштування надсилання аудіо"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_message" msgid="4251807313264307426">"Музика й відео із цього пристрою відтворюватимуться на обох парах навушників"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_title" msgid="4406818346036286793">"Поділитися аудіо"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_subtitle" msgid="3014906864710059236">"Пристрої \"<xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g>\" і \"<xliff:g id="ACTIVE_DEVICE_NAME">%2$s</xliff:g>\""</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_switch_to_button" msgid="7546825655978203773">"Перемкнути на \"<xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g>\""</string>
<string name="quick_settings_bluetooth_secondary_label_battery_level" msgid="4182034939479344093">"<xliff:g id="BATTERY_LEVEL_AS_PERCENTAGE">%s</xliff:g> заряду акумулятора"</string>
<string name="quick_settings_bluetooth_secondary_label_audio" msgid="780333390310051161">"Аудіопристрій"</string>
<string name="quick_settings_bluetooth_secondary_label_headset" msgid="2332093067553000852">"Гарнітура"</string>
@@ -440,8 +444,7 @@
<string name="zen_mode_on" msgid="9085304934016242591">"Увімкнено"</string>
<string name="zen_mode_on_with_details" msgid="7416143430557895497">"Увімк. • <xliff:g id="TRIGGER_DESCRIPTION">%1$s</xliff:g>"</string>
<string name="zen_mode_off" msgid="1736604456618147306">"Вимкнено"</string>
- <!-- no translation found for zen_mode_set_up (8231201163894922821) -->
- <skip />
+ <string name="zen_mode_set_up" msgid="8231201163894922821">"Не налаштовано"</string>
<string name="zen_mode_no_manual_invocation" msgid="1769975741344633672">"Керувати в налаштуваннях"</string>
<string name="zen_mode_active_modes" msgid="1625850411578488856">"{count,plural, =0{Немає активних режимів}=1{Активовано режим \"{mode}\"}one{Активовано # режим}few{Активовано # режими}many{Активовано # режимів}other{Активовано # режиму}}"</string>
<string name="zen_priority_introduction" msgid="3159291973383796646">"Ви отримуватиме звукові та вібросигнали лише для вибраних будильників, нагадувань, подій і абонентів. Однак ви чутимете все, що захочете відтворити, зокрема музику, відео й ігри."</string>
@@ -673,10 +676,8 @@
<string name="stream_notification_unavailable" msgid="4313854556205836435">"Недоступно: звук дзвінків вимкнено"</string>
<string name="stream_alarm_unavailable" msgid="4059817189292197839">"Недоступно: увімкнено режим \"Не турбувати\""</string>
<string name="stream_media_unavailable" msgid="6823020894438959853">"Недоступно: увімкнено режим \"Не турбувати\""</string>
- <!-- no translation found for stream_unavailable_by_modes (3674139029490353683) -->
- <skip />
- <!-- no translation found for stream_unavailable_by_unknown (6908434629318171588) -->
- <skip />
+ <string name="stream_unavailable_by_modes" msgid="3674139029490353683">"Недоступно, оскільки ввімкнено режим \"<xliff:g id="MODE">%s</xliff:g>\""</string>
+ <string name="stream_unavailable_by_unknown" msgid="6908434629318171588">"Недоступно"</string>
<string name="volume_stream_content_description_unmute" msgid="7729576371406792977">"%1$s. Торкніться, щоб увімкнути звук."</string>
<string name="volume_stream_content_description_vibrate" msgid="4858111994183089761">"%1$s. Торкніться, щоб налаштувати вібросигнал. Спеціальні можливості може бути вимкнено."</string>
<string name="volume_stream_content_description_mute" msgid="4079046784917920984">"%1$s. Торкніться, щоб вимкнути звук. Спеціальні можливості може бути вимкнено."</string>
@@ -1410,38 +1411,26 @@
<string name="launch_touchpad_tutorial_notification_content" msgid="7931085031240753226">"Жести для сенсорної панелі: докладніше"</string>
<string name="launch_keyboard_touchpad_tutorial_notification_title" msgid="1940023776496198762">"Навігація за допомогою клавіатури й сенсорної панелі"</string>
<string name="launch_keyboard_touchpad_tutorial_notification_content" msgid="1780725168171929365">"Жести для сенсорної панелі, комбінації клавіш тощо: докладніше"</string>
- <!-- no translation found for touchpad_tutorial_back_gesture_button (3104716365403620315) -->
- <skip />
- <!-- no translation found for touchpad_tutorial_home_gesture_button (8023973153559885624) -->
- <skip />
+ <string name="touchpad_tutorial_back_gesture_button" msgid="3104716365403620315">"Назад"</string>
+ <string name="touchpad_tutorial_home_gesture_button" msgid="8023973153559885624">"Перейти на головний екран"</string>
<string name="touchpad_tutorial_recent_apps_gesture_button" msgid="8919227647650347359">"Переглянути нещодавні додатки"</string>
<string name="touchpad_tutorial_done_button" msgid="176168488821755503">"Готово"</string>
<string name="touchpad_back_gesture_action_title" msgid="7199067250654332735">"Назад"</string>
- <!-- no translation found for touchpad_back_gesture_guidance (5352221087725906542) -->
- <skip />
- <!-- no translation found for touchpad_back_gesture_success_title (7370719098633023496) -->
- <skip />
+ <string name="touchpad_back_gesture_guidance" msgid="5352221087725906542">"Проведіть трьома пальцями вліво чи вправо по сенсорній панелі"</string>
+ <string name="touchpad_back_gesture_success_title" msgid="7370719098633023496">"Чудово!"</string>
<string name="touchpad_back_gesture_success_body" msgid="2324724953720741719">"Ви виконали жест \"Назад\"."</string>
<string name="touchpad_home_gesture_action_title" msgid="8885107349719257882">"Перейти на головний екран"</string>
- <!-- no translation found for touchpad_home_gesture_guidance (4178219118381915899) -->
- <skip />
- <!-- no translation found for touchpad_home_gesture_success_title (3648264553645798470) -->
- <skip />
- <!-- no translation found for touchpad_home_gesture_success_body (2590690589194027059) -->
- <skip />
+ <string name="touchpad_home_gesture_guidance" msgid="4178219118381915899">"Проведіть трьома пальцями вгору на сенсорній панелі"</string>
+ <string name="touchpad_home_gesture_success_title" msgid="3648264553645798470">"Чудово!"</string>
+ <string name="touchpad_home_gesture_success_body" msgid="2590690589194027059">"Ви виконали жест переходу на головний екран"</string>
<string name="touchpad_recent_apps_gesture_action_title" msgid="934906836867137906">"Переглянути нещодавні додатки"</string>
- <!-- no translation found for touchpad_recent_apps_gesture_guidance (6304446013842271822) -->
- <skip />
+ <string name="touchpad_recent_apps_gesture_guidance" msgid="6304446013842271822">"Проведіть трьома пальцями вгору й утримуйте їх на сенсорній панелі"</string>
<string name="touchpad_recent_apps_gesture_success_title" msgid="8481920554139332593">"Чудово!"</string>
<string name="touchpad_recent_apps_gesture_success_body" msgid="4334263906697493273">"Ви виконали жест для перегляду нещодавно відкритих додатків."</string>
- <!-- no translation found for tutorial_action_key_title (8172535792469008169) -->
- <skip />
- <!-- no translation found for tutorial_action_key_guidance (5040613427202799294) -->
- <skip />
- <!-- no translation found for tutorial_action_key_success_title (2371827347071979571) -->
- <skip />
- <!-- no translation found for tutorial_action_key_success_body (1688986269491357832) -->
- <skip />
+ <string name="tutorial_action_key_title" msgid="8172535792469008169">"Переглянути всі додатки"</string>
+ <string name="tutorial_action_key_guidance" msgid="5040613427202799294">"Натисніть клавішу дії на клавіатурі"</string>
+ <string name="tutorial_action_key_success_title" msgid="2371827347071979571">"Чудово!"</string>
+ <string name="tutorial_action_key_success_body" msgid="1688986269491357832">"Ви виконали жест для перегляду всіх додатків"</string>
<string name="keyboard_backlight_dialog_title" msgid="8273102932345564724">"Підсвічування клавіатури"</string>
<string name="keyboard_backlight_value" msgid="7336398765584393538">"Рівень %1$d з %2$d"</string>
<string name="home_controls_dream_label" msgid="6567105701292324257">"Автоматизація дому"</string>
diff --git a/packages/SystemUI/res/values-ur/strings.xml b/packages/SystemUI/res/values-ur/strings.xml
index b1ddfc98d308..a091d305b924 100644
--- a/packages/SystemUI/res/values-ur/strings.xml
+++ b/packages/SystemUI/res/values-ur/strings.xml
@@ -312,6 +312,10 @@
<string name="quick_settings_bluetooth_audio_sharing_button" msgid="7545274861795853838">"آڈیو کا اشتراک کریں"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_sharing" msgid="3069309588231072128">"آڈیو کا اشتراک ہو رہا ہے"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_accessibility" msgid="7604615019302091708">"آڈیو کے اشتراک کی ترتیبات درج کریں"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_message" msgid="4251807313264307426">"اس آلہ کی موسیقی اور ویڈیوز ہیڈ فونز کے دونوں جوڑے پر چلیں گی"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_title" msgid="4406818346036286793">"اپنی آڈیو کا اشتراک کریں"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_subtitle" msgid="3014906864710059236">"<xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g> اور <xliff:g id="ACTIVE_DEVICE_NAME">%2$s</xliff:g>"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_switch_to_button" msgid="7546825655978203773">"<xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g> پر سوئچ کریں"</string>
<string name="quick_settings_bluetooth_secondary_label_battery_level" msgid="4182034939479344093">"<xliff:g id="BATTERY_LEVEL_AS_PERCENTAGE">%s</xliff:g> بیٹری"</string>
<string name="quick_settings_bluetooth_secondary_label_audio" msgid="780333390310051161">"آڈیو"</string>
<string name="quick_settings_bluetooth_secondary_label_headset" msgid="2332093067553000852">"ہیڈ سیٹ"</string>
@@ -672,10 +676,8 @@
<string name="stream_notification_unavailable" msgid="4313854556205836435">"دستیاب نہیں ہے کیونکہ رنگ خاموش ہے"</string>
<string name="stream_alarm_unavailable" msgid="4059817189292197839">"غیر دستیاب ہے کیونکہ ڈسٹرب نہ کریں آن ہے"</string>
<string name="stream_media_unavailable" msgid="6823020894438959853">"غیر دستیاب ہے کیونکہ ڈسٹرب نہ کریں آن ہے"</string>
- <!-- no translation found for stream_unavailable_by_modes (3674139029490353683) -->
- <skip />
- <!-- no translation found for stream_unavailable_by_unknown (6908434629318171588) -->
- <skip />
+ <string name="stream_unavailable_by_modes" msgid="3674139029490353683">"<xliff:g id="MODE">%s</xliff:g> کے آن ہونے کی وجہ سے غیر دستیاب ہے"</string>
+ <string name="stream_unavailable_by_unknown" msgid="6908434629318171588">"غیر دستیاب ہے"</string>
<string name="volume_stream_content_description_unmute" msgid="7729576371406792977">"‏‎%1$s۔ آواز چالو کرنے کیلئے تھپتھپائیں۔"</string>
<string name="volume_stream_content_description_vibrate" msgid="4858111994183089761">"‏‎%1$s۔ ارتعاش پر سیٹ کرنے کیلئے تھپتھپائیں۔ ایکسیسبیلٹی سروسز شاید خاموش ہوں۔"</string>
<string name="volume_stream_content_description_mute" msgid="4079046784917920984">"‏‎%1$s۔ خاموش کرنے کیلئے تھپتھپائیں۔ ایکسیسبیلٹی سروسز شاید خاموش ہوں۔"</string>
diff --git a/packages/SystemUI/res/values-uz/strings.xml b/packages/SystemUI/res/values-uz/strings.xml
index 6d597bd99609..51dcb29d3128 100644
--- a/packages/SystemUI/res/values-uz/strings.xml
+++ b/packages/SystemUI/res/values-uz/strings.xml
@@ -312,6 +312,10 @@
<string name="quick_settings_bluetooth_audio_sharing_button" msgid="7545274861795853838">"Audioni ulashish"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_sharing" msgid="3069309588231072128">"Audio ulashuvi yoniq"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_accessibility" msgid="7604615019302091708">"audio ulashuv sozlamalarini kiritish"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_message" msgid="4251807313264307426">"Bu qurilmadagi musiqa va videolar quloqliklarning ikkala tomonida ijro etiladi"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_title" msgid="4406818346036286793">"Audioni ulashish"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_subtitle" msgid="3014906864710059236">"<xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g> va <xliff:g id="ACTIVE_DEVICE_NAME">%2$s</xliff:g>"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_switch_to_button" msgid="7546825655978203773">"Bunga almashish: <xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g>"</string>
<string name="quick_settings_bluetooth_secondary_label_battery_level" msgid="4182034939479344093">"Batareya quvvati: <xliff:g id="BATTERY_LEVEL_AS_PERCENTAGE">%s</xliff:g>"</string>
<string name="quick_settings_bluetooth_secondary_label_audio" msgid="780333390310051161">"Audio"</string>
<string name="quick_settings_bluetooth_secondary_label_headset" msgid="2332093067553000852">"Garnitura"</string>
@@ -672,10 +676,8 @@
<string name="stream_notification_unavailable" msgid="4313854556205836435">"Jiringlash ovozsizligi uchun ishlamaydi"</string>
<string name="stream_alarm_unavailable" msgid="4059817189292197839">"Bezovta qilinmasin yoniqligi sababli ishlamaydi"</string>
<string name="stream_media_unavailable" msgid="6823020894438959853">"Bezovta qilinmasin yoniqligi sababli ishlamaydi"</string>
- <!-- no translation found for stream_unavailable_by_modes (3674139029490353683) -->
- <skip />
- <!-- no translation found for stream_unavailable_by_unknown (6908434629318171588) -->
- <skip />
+ <string name="stream_unavailable_by_modes" msgid="3674139029490353683">"<xliff:g id="MODE">%s</xliff:g> yoniqligi uchun ishlamaydi"</string>
+ <string name="stream_unavailable_by_unknown" msgid="6908434629318171588">"Ishlamaydi"</string>
<string name="volume_stream_content_description_unmute" msgid="7729576371406792977">"%1$s. Ovozini yoqish uchun ustiga bosing."</string>
<string name="volume_stream_content_description_vibrate" msgid="4858111994183089761">"%1$s. Tebranishni yoqish uchun ustiga bosing. Qulayliklar ishlamasligi mumkin."</string>
<string name="volume_stream_content_description_mute" msgid="4079046784917920984">"%1$s. Ovozini o‘chirish uchun ustiga bosing. Qulayliklar ishlamasligi mumkin."</string>
diff --git a/packages/SystemUI/res/values-vi/strings.xml b/packages/SystemUI/res/values-vi/strings.xml
index 7e1f6e7780b6..98fc4679178a 100644
--- a/packages/SystemUI/res/values-vi/strings.xml
+++ b/packages/SystemUI/res/values-vi/strings.xml
@@ -312,6 +312,10 @@
<string name="quick_settings_bluetooth_audio_sharing_button" msgid="7545274861795853838">"Chia sẻ âm thanh"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_sharing" msgid="3069309588231072128">"Đang chia sẻ âm thanh"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_accessibility" msgid="7604615019302091708">"mở chế độ cài đặt chia sẻ âm thanh"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_message" msgid="4251807313264307426">"Nhạc và video trên thiết bị này sẽ phát trên cả hai bộ tai nghe"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_title" msgid="4406818346036286793">"Chia sẻ âm thanh của bạn"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_subtitle" msgid="3014906864710059236">"<xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g> và <xliff:g id="ACTIVE_DEVICE_NAME">%2$s</xliff:g>"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_switch_to_button" msgid="7546825655978203773">"Chuyển sang <xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g>"</string>
<string name="quick_settings_bluetooth_secondary_label_battery_level" msgid="4182034939479344093">"<xliff:g id="BATTERY_LEVEL_AS_PERCENTAGE">%s</xliff:g> pin"</string>
<string name="quick_settings_bluetooth_secondary_label_audio" msgid="780333390310051161">"Âm thanh"</string>
<string name="quick_settings_bluetooth_secondary_label_headset" msgid="2332093067553000852">"Tai nghe"</string>
@@ -672,10 +676,8 @@
<string name="stream_notification_unavailable" msgid="4313854556205836435">"Không hoạt động vì chuông bị tắt"</string>
<string name="stream_alarm_unavailable" msgid="4059817189292197839">"Bị tắt vì đang bật chế độ Không làm phiền"</string>
<string name="stream_media_unavailable" msgid="6823020894438959853">"Bị tắt vì đang bật chế độ Không làm phiền"</string>
- <!-- no translation found for stream_unavailable_by_modes (3674139029490353683) -->
- <skip />
- <!-- no translation found for stream_unavailable_by_unknown (6908434629318171588) -->
- <skip />
+ <string name="stream_unavailable_by_modes" msgid="3674139029490353683">"Không dùng được vì <xliff:g id="MODE">%s</xliff:g> đang bật"</string>
+ <string name="stream_unavailable_by_unknown" msgid="6908434629318171588">"Không dùng được"</string>
<string name="volume_stream_content_description_unmute" msgid="7729576371406792977">"%1$s. Nhấn để bật tiếng."</string>
<string name="volume_stream_content_description_vibrate" msgid="4858111994183089761">"%1$s. Nhấn để đặt chế độ rung. Bạn có thể tắt tiếng dịch vụ trợ năng."</string>
<string name="volume_stream_content_description_mute" msgid="4079046784917920984">"%1$s. Nhấn để tắt tiếng. Bạn có thể tắt tiếng dịch vụ trợ năng."</string>
diff --git a/packages/SystemUI/res/values-zh-rCN/strings.xml b/packages/SystemUI/res/values-zh-rCN/strings.xml
index 0aa679821511..cf80402a89d8 100644
--- a/packages/SystemUI/res/values-zh-rCN/strings.xml
+++ b/packages/SystemUI/res/values-zh-rCN/strings.xml
@@ -312,6 +312,10 @@
<string name="quick_settings_bluetooth_audio_sharing_button" msgid="7545274861795853838">"分享音频"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_sharing" msgid="3069309588231072128">"正在分享音频"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_accessibility" msgid="7604615019302091708">"进入音频分享设置"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_message" msgid="4251807313264307426">"此设备上的音乐和视频会同时通过两副耳机播放"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_title" msgid="4406818346036286793">"分享您的音频"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_subtitle" msgid="3014906864710059236">"“<xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g>”和“<xliff:g id="ACTIVE_DEVICE_NAME">%2$s</xliff:g>”"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_switch_to_button" msgid="7546825655978203773">"切换到“<xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g>”"</string>
<string name="quick_settings_bluetooth_secondary_label_battery_level" msgid="4182034939479344093">"<xliff:g id="BATTERY_LEVEL_AS_PERCENTAGE">%s</xliff:g> 的电量"</string>
<string name="quick_settings_bluetooth_secondary_label_audio" msgid="780333390310051161">"音频"</string>
<string name="quick_settings_bluetooth_secondary_label_headset" msgid="2332093067553000852">"耳机"</string>
@@ -672,10 +676,8 @@
<string name="stream_notification_unavailable" msgid="4313854556205836435">"该功能无法使用,因为铃声被静音"</string>
<string name="stream_alarm_unavailable" msgid="4059817189292197839">"“勿扰”模式已开启,因此无法调整音量"</string>
<string name="stream_media_unavailable" msgid="6823020894438959853">"“勿扰”模式已开启,因此无法调整音量"</string>
- <!-- no translation found for stream_unavailable_by_modes (3674139029490353683) -->
- <skip />
- <!-- no translation found for stream_unavailable_by_unknown (6908434629318171588) -->
- <skip />
+ <string name="stream_unavailable_by_modes" msgid="3674139029490353683">"不可用,因为已开启<xliff:g id="MODE">%s</xliff:g>"</string>
+ <string name="stream_unavailable_by_unknown" msgid="6908434629318171588">"不可用"</string>
<string name="volume_stream_content_description_unmute" msgid="7729576371406792977">"%1$s。点按即可取消静音。"</string>
<string name="volume_stream_content_description_vibrate" msgid="4858111994183089761">"%1$s。点按即可设为振动,但可能会同时将无障碍服务设为静音。"</string>
<string name="volume_stream_content_description_mute" msgid="4079046784917920984">"%1$s。点按即可设为静音,但可能会同时将无障碍服务设为静音。"</string>
diff --git a/packages/SystemUI/res/values-zh-rHK/strings.xml b/packages/SystemUI/res/values-zh-rHK/strings.xml
index 4ff574e27ef2..39cf982dd36e 100644
--- a/packages/SystemUI/res/values-zh-rHK/strings.xml
+++ b/packages/SystemUI/res/values-zh-rHK/strings.xml
@@ -312,6 +312,10 @@
<string name="quick_settings_bluetooth_audio_sharing_button" msgid="7545274861795853838">"分享音訊"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_sharing" msgid="3069309588231072128">"正在分享音訊"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_accessibility" msgid="7604615019302091708">"輸入音訊分享功能設定"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_message" msgid="4251807313264307426">"兩對耳機都會播放此裝置的音樂和影片"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_title" msgid="4406818346036286793">"分享音訊"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_subtitle" msgid="3014906864710059236">"「<xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g>」和「<xliff:g id="ACTIVE_DEVICE_NAME">%2$s</xliff:g>」"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_switch_to_button" msgid="7546825655978203773">"切換至「<xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g>」"</string>
<string name="quick_settings_bluetooth_secondary_label_battery_level" msgid="4182034939479344093">"電量:<xliff:g id="BATTERY_LEVEL_AS_PERCENTAGE">%s</xliff:g>"</string>
<string name="quick_settings_bluetooth_secondary_label_audio" msgid="780333390310051161">"音訊"</string>
<string name="quick_settings_bluetooth_secondary_label_headset" msgid="2332093067553000852">"耳機"</string>
@@ -672,10 +676,8 @@
<string name="stream_notification_unavailable" msgid="4313854556205836435">"鈴聲已設定為靜音,因此無法使用"</string>
<string name="stream_alarm_unavailable" msgid="4059817189292197839">"「請勿騷擾」已開啟,因此無法使用"</string>
<string name="stream_media_unavailable" msgid="6823020894438959853">"「請勿騷擾」已開啟,因此無法使用"</string>
- <!-- no translation found for stream_unavailable_by_modes (3674139029490353683) -->
- <skip />
- <!-- no translation found for stream_unavailable_by_unknown (6908434629318171588) -->
- <skip />
+ <string name="stream_unavailable_by_modes" msgid="3674139029490353683">"<xliff:g id="MODE">%s</xliff:g>已開啟,因此無法使用"</string>
+ <string name="stream_unavailable_by_unknown" msgid="6908434629318171588">"未有提供"</string>
<string name="volume_stream_content_description_unmute" msgid="7729576371406792977">"%1$s。輕按即可取消靜音。"</string>
<string name="volume_stream_content_description_vibrate" msgid="4858111994183089761">"%1$s。輕按即可設為震動。無障礙功能服務可能已經設為靜音。"</string>
<string name="volume_stream_content_description_mute" msgid="4079046784917920984">"%1$s。輕按即可設為靜音。無障礙功能服務可能已經設為靜音。"</string>
diff --git a/packages/SystemUI/res/values-zh-rTW/strings.xml b/packages/SystemUI/res/values-zh-rTW/strings.xml
index 9fea9bc5b9f1..cbde8c3d3e8d 100644
--- a/packages/SystemUI/res/values-zh-rTW/strings.xml
+++ b/packages/SystemUI/res/values-zh-rTW/strings.xml
@@ -312,6 +312,10 @@
<string name="quick_settings_bluetooth_audio_sharing_button" msgid="7545274861795853838">"分享音訊"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_sharing" msgid="3069309588231072128">"正在分享音訊"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_accessibility" msgid="7604615019302091708">"進入音訊分享設定"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_message" msgid="4251807313264307426">"這部裝置會同時在兩對耳機上播放音樂和影片"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_title" msgid="4406818346036286793">"分享音訊"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_subtitle" msgid="3014906864710059236">"「<xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g>」和「<xliff:g id="ACTIVE_DEVICE_NAME">%2$s</xliff:g>」"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_switch_to_button" msgid="7546825655978203773">"切換至「<xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g>」"</string>
<string name="quick_settings_bluetooth_secondary_label_battery_level" msgid="4182034939479344093">"電量:<xliff:g id="BATTERY_LEVEL_AS_PERCENTAGE">%s</xliff:g>"</string>
<string name="quick_settings_bluetooth_secondary_label_audio" msgid="780333390310051161">"音訊"</string>
<string name="quick_settings_bluetooth_secondary_label_headset" msgid="2332093067553000852">"耳機"</string>
@@ -672,10 +676,8 @@
<string name="stream_notification_unavailable" msgid="4313854556205836435">"鈴聲已設為靜音,因此無法使用"</string>
<string name="stream_alarm_unavailable" msgid="4059817189292197839">"「零打擾」模式已開啟,因此無法調整音量"</string>
<string name="stream_media_unavailable" msgid="6823020894438959853">"「零打擾」模式已開啟,因此無法調整音量"</string>
- <!-- no translation found for stream_unavailable_by_modes (3674139029490353683) -->
- <skip />
- <!-- no translation found for stream_unavailable_by_unknown (6908434629318171588) -->
- <skip />
+ <string name="stream_unavailable_by_modes" msgid="3674139029490353683">"「<xliff:g id="MODE">%s</xliff:g>」功能已開啟,因此無法調整音量"</string>
+ <string name="stream_unavailable_by_unknown" msgid="6908434629318171588">"無法使用"</string>
<string name="volume_stream_content_description_unmute" msgid="7729576371406792977">"%1$s。輕觸即可取消靜音。"</string>
<string name="volume_stream_content_description_vibrate" msgid="4858111994183089761">"%1$s。輕觸即可設為震動,但系統可能會將無障礙服務一併設為靜音。"</string>
<string name="volume_stream_content_description_mute" msgid="4079046784917920984">"%1$s。輕觸即可設為靜音,但系統可能會將無障礙服務一併設為靜音。"</string>
diff --git a/packages/SystemUI/res/values-zu/strings.xml b/packages/SystemUI/res/values-zu/strings.xml
index 9ff3e5dee7c6..2e668c5f732a 100644
--- a/packages/SystemUI/res/values-zu/strings.xml
+++ b/packages/SystemUI/res/values-zu/strings.xml
@@ -312,6 +312,10 @@
<string name="quick_settings_bluetooth_audio_sharing_button" msgid="7545274861795853838">"Yabelana ngomsindo"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_sharing" msgid="3069309588231072128">"Yabelana ngomsindo"</string>
<string name="quick_settings_bluetooth_audio_sharing_button_accessibility" msgid="7604615019302091708">"faka amasethingi okwabelana ngokuqoshiwe"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_message" msgid="4251807313264307426">"Umculo namavidiyo ale divayisi azodlala kukho kokubili ukubhangqwa kwamaheadphone"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_title" msgid="4406818346036286793">"Yabelana ngomsindo wakho"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_subtitle" msgid="3014906864710059236">"I-<xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g> ne-<xliff:g id="ACTIVE_DEVICE_NAME">%2$s</xliff:g>"</string>
+ <string name="quick_settings_bluetooth_audio_sharing_dialog_switch_to_button" msgid="7546825655978203773">"Shintshela ku-<xliff:g id="AVAILABLE_DEVICE_NAME">%1$s</xliff:g>"</string>
<string name="quick_settings_bluetooth_secondary_label_battery_level" msgid="4182034939479344093">"<xliff:g id="BATTERY_LEVEL_AS_PERCENTAGE">%s</xliff:g> ibhethri"</string>
<string name="quick_settings_bluetooth_secondary_label_audio" msgid="780333390310051161">"Umsindo"</string>
<string name="quick_settings_bluetooth_secondary_label_headset" msgid="2332093067553000852">"Ihedisethi"</string>
@@ -672,10 +676,8 @@
<string name="stream_notification_unavailable" msgid="4313854556205836435">"Ayitholakali ngoba ukukhala kuthulisiwe"</string>
<string name="stream_alarm_unavailable" msgid="4059817189292197839">"Ayitholakali ngoba okuthi Ungaphazamisi kuvuliwe"</string>
<string name="stream_media_unavailable" msgid="6823020894438959853">"Ayitholakali ngoba okuthi Ungaphazamisi kuvuliwe"</string>
- <!-- no translation found for stream_unavailable_by_modes (3674139029490353683) -->
- <skip />
- <!-- no translation found for stream_unavailable_by_unknown (6908434629318171588) -->
- <skip />
+ <string name="stream_unavailable_by_modes" msgid="3674139029490353683">"Ayitholakali ngoba i-<xliff:g id="MODE">%s</xliff:g> ivuliwe"</string>
+ <string name="stream_unavailable_by_unknown" msgid="6908434629318171588">"Ayitholakali"</string>
<string name="volume_stream_content_description_unmute" msgid="7729576371406792977">"%1$s. Thepha ukuze ususe ukuthula."</string>
<string name="volume_stream_content_description_vibrate" msgid="4858111994183089761">"%1$s. Thepha ukuze usethe ukudlidliza. Amasevisi okufinyelela angathuliswa."</string>
<string name="volume_stream_content_description_mute" msgid="4079046784917920984">"%1$s. Thepha ukuze uthulise. Amasevisi okufinyelela angathuliswa."</string>
diff --git a/packages/SystemUI/res/values/config.xml b/packages/SystemUI/res/values/config.xml
index 16a8bc5b034f..f96a0b95945d 100644
--- a/packages/SystemUI/res/values/config.xml
+++ b/packages/SystemUI/res/values/config.xml
@@ -82,6 +82,9 @@
<!-- The number of columns in the Dual Shade QuickSettings -->
<integer name="quick_settings_dual_shade_num_columns">4</integer>
+ <!-- The number of columns in the Split Shade QuickSettings -->
+ <integer name="quick_settings_split_shade_num_columns">4</integer>
+
<!-- Override column number for quick settings.
For now, this value has effect only when flag lockscreen.enable_landscape is enabled.
TODO (b/293252410) - change this comment/resource when flag is enabled -->
@@ -134,17 +137,19 @@
<!-- Use collapsed layout for media player in landscape QQS -->
<bool name="config_quickSettingsMediaLandscapeCollapsed">true</bool>
- <!-- For hearing devices related tool list. Need to be in ComponentName format (package/class).
- Should be activity to be launched.
- Already contains tool that holds intent: "com.android.settings.action.live_caption".
- Maximum number is 3. -->
+ <!-- Hearing devices related tool list. Each entry must be in ComponentName format
+ (package/class), indicating the specific application component to launch.
+ Already contains tool that handles intent: "com.android.settings.action.live_caption" by
+ default. You can add up to 2 additional related tools. -->
<string-array name="config_quickSettingsHearingDevicesRelatedToolName" translatable="false">
</string-array>
- <!-- The drawable resource names. If provided, it will replace the corresponding icons in
- config_quickSettingsHearingDevicesRelatedToolName. Can be empty to use original icons.
- Already contains tool that holds intent: "com.android.settings.action.live_caption".
- Maximum number is 3. -->
+ <!-- Hearing devices related tool icon list. Provide drawable resource names in the same order
+ as the component names in config_quickSettingsHearingDevicesRelatedToolName. The icons
+ should be monochrome and will be tinted according to the system's material color. Ensure
+ the number of icon resources matches the number of components specified in
+ config_quickSettingsHearingDevicesRelatedToolName. If this array is empty or the sizes
+ don't match, the original application icons will be used. -->
<string-array name="config_quickSettingsHearingDevicesRelatedToolIcon" translatable="false">
</string-array>
diff --git a/packages/SystemUI/res/values/dimens.xml b/packages/SystemUI/res/values/dimens.xml
index 6c8a7403953e..209a971814f4 100644
--- a/packages/SystemUI/res/values/dimens.xml
+++ b/packages/SystemUI/res/values/dimens.xml
@@ -1798,8 +1798,6 @@
<dimen name="hearing_devices_preset_spinner_text_padding_vertical">15dp</dimen>
<dimen name="hearing_devices_preset_spinner_arrow_size">24dp</dimen>
<dimen name="hearing_devices_preset_spinner_background_radius">28dp</dimen>
- <dimen name="hearing_devices_tool_icon_frame_width">94dp</dimen>
- <dimen name="hearing_devices_tool_icon_frame_height">64dp</dimen>
<dimen name="hearing_devices_tool_icon_size">28dp</dimen>
<!-- Height percentage of the parent container occupied by the communal view -->
diff --git a/packages/SystemUI/res/values/styles.xml b/packages/SystemUI/res/values/styles.xml
index 7cebac2feaba..bda34530e6eb 100644
--- a/packages/SystemUI/res/values/styles.xml
+++ b/packages/SystemUI/res/values/styles.xml
@@ -1709,32 +1709,4 @@
<style name="Theme.SystemUI.Dialog.StickyKeys" parent="@style/Theme.SystemUI.Dialog">
<item name="android:colorBackground">@color/transparent</item>
</style>
-
- <style name="ShortcutHelperBottomSheet" parent="@style/Widget.Material3.BottomSheet">
- <item name="backgroundTint">?colorSurfaceContainer</item>
- </style>
-
- <style name="ShortcutHelperAnimation" parent="@android:style/Animation.Activity">
- <item name="android:activityOpenEnterAnimation">@anim/shortcut_helper_launch_anim</item>
- <item name="android:taskOpenEnterAnimation">@anim/shortcut_helper_launch_anim</item>
- <item name="android:activityOpenExitAnimation">@anim/shortcut_helper_close_anim</item>
- <item name="android:taskOpenExitAnimation">@anim/shortcut_helper_close_anim</item>
- </style>
-
- <style name="ShortcutHelperThemeCommon" parent="@style/Theme.Material3.DynamicColors.DayNight">
- <item name="android:windowAnimationStyle">@style/ShortcutHelperAnimation</item>
- <item name="android:windowIsTranslucent">true</item>
- <item name="android:windowNoTitle">true</item>
- <item name="android:windowBackground">@android:color/transparent</item>
- <item name="android:backgroundDimEnabled">true</item>
- <item name="android:statusBarColor">@android:color/transparent</item>
- <item name="android:windowContentOverlay">@null</item>
- <item name="android:navigationBarColor">@android:color/transparent</item>
- <item name="android:windowLayoutInDisplayCutoutMode">always</item>
- <item name="enableEdgeToEdge">true</item>
- </style>
-
- <style name="ShortcutHelperTheme" parent="@style/ShortcutHelperThemeCommon">
- <item name="android:windowLightNavigationBar">true</item>
- </style>
</resources>
diff --git a/packages/SystemUI/shared/src/com/android/systemui/shared/plugins/PluginManagerImpl.java b/packages/SystemUI/shared/src/com/android/systemui/shared/plugins/PluginManagerImpl.java
index 1e668b84cdc6..9a264c6ca414 100644
--- a/packages/SystemUI/shared/src/com/android/systemui/shared/plugins/PluginManagerImpl.java
+++ b/packages/SystemUI/shared/src/com/android/systemui/shared/plugins/PluginManagerImpl.java
@@ -28,6 +28,8 @@ import android.util.ArraySet;
import android.util.Log;
import android.widget.Toast;
+import androidx.annotation.Nullable;
+
import com.android.internal.messages.nano.SystemMessageProto.SystemMessage;
import com.android.systemui.plugins.Plugin;
import com.android.systemui.plugins.PluginListener;
@@ -62,7 +64,7 @@ public class PluginManagerImpl extends BroadcastReceiver implements PluginManage
public PluginManagerImpl(Context context,
PluginActionManager.Factory actionManagerFactory,
boolean debuggable,
- UncaughtExceptionPreHandlerManager preHandlerManager,
+ @Nullable UncaughtExceptionPreHandlerManager preHandlerManager,
PluginEnabler pluginEnabler,
PluginPrefs pluginPrefs,
List<String> privilegedPlugins) {
@@ -73,7 +75,9 @@ public class PluginManagerImpl extends BroadcastReceiver implements PluginManage
mPluginPrefs = pluginPrefs;
mPluginEnabler = pluginEnabler;
- preHandlerManager.registerHandler(new PluginExceptionHandler());
+ if (preHandlerManager != null) {
+ preHandlerManager.registerHandler(new PluginExceptionHandler());
+ }
}
public boolean isDebuggable() {
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java b/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java
index 7cba845460ca..ec0f582dcb47 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardClockSwitchController.java
@@ -22,8 +22,6 @@ import static android.view.ViewGroup.LayoutParams.WRAP_CONTENT;
import static com.android.keyguard.KeyguardClockSwitch.LARGE;
import static com.android.keyguard.KeyguardClockSwitch.SMALL;
import static com.android.systemui.Flags.smartspaceRelocateToBottom;
-import static com.android.systemui.flags.Flags.LOCKSCREEN_WALLPAPER_DREAM_ENABLED;
-import static com.android.systemui.util.kotlin.JavaAdapterKt.collectFlow;
import android.annotation.Nullable;
import android.database.ContentObserver;
@@ -36,13 +34,11 @@ import android.widget.FrameLayout;
import android.widget.LinearLayout;
import androidx.annotation.NonNull;
-import androidx.annotation.VisibleForTesting;
import com.android.systemui.Dumpable;
import com.android.systemui.dagger.qualifiers.Background;
import com.android.systemui.dagger.qualifiers.Main;
import com.android.systemui.dump.DumpManager;
-import com.android.systemui.flags.FeatureFlagsClassic;
import com.android.systemui.keyguard.KeyguardUnlockAnimationController;
import com.android.systemui.keyguard.MigrateClocksToBlueprint;
import com.android.systemui.keyguard.domain.interactor.KeyguardClockInteractor;
@@ -71,7 +67,6 @@ import kotlinx.coroutines.DisposableHandle;
import java.io.PrintWriter;
import java.util.Locale;
import java.util.concurrent.Executor;
-import java.util.function.Consumer;
import javax.inject.Inject;
@@ -114,8 +109,6 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS
private boolean mShownOnSecondaryDisplay = false;
private boolean mOnlyClock = false;
- private boolean mIsActiveDreamLockscreenHosted = false;
- private final FeatureFlagsClassic mFeatureFlags;
private KeyguardInteractor mKeyguardInteractor;
private KeyguardClockInteractor mKeyguardClockInteractor;
private final DelayableExecutor mUiExecutor;
@@ -124,15 +117,6 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS
private DisposableHandle mAodIconsBindHandle;
@Nullable private NotificationIconContainer mAodIconContainer;
- @VisibleForTesting
- final Consumer<Boolean> mIsActiveDreamLockscreenHostedCallback =
- (Boolean isLockscreenHosted) -> {
- if (mIsActiveDreamLockscreenHosted == isLockscreenHosted) {
- return;
- }
- mIsActiveDreamLockscreenHosted = isLockscreenHosted;
- updateKeyguardStatusAreaVisibility();
- };
private final ContentObserver mDoubleLineClockObserver = new ContentObserver(null) {
@Override
public void onChange(boolean change) {
@@ -173,7 +157,6 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS
@KeyguardClockLog LogBuffer logBuffer,
KeyguardInteractor keyguardInteractor,
KeyguardClockInteractor keyguardClockInteractor,
- FeatureFlagsClassic featureFlags,
InWindowLauncherUnlockAnimationManager inWindowLauncherUnlockAnimationManager) {
super(keyguardClockSwitch);
mStatusBarStateController = statusBarStateController;
@@ -189,7 +172,6 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS
mClockEventController = clockEventController;
mLogBuffer = logBuffer;
mView.setLogBuffer(mLogBuffer);
- mFeatureFlags = featureFlags;
mKeyguardInteractor = keyguardInteractor;
mKeyguardClockInteractor = keyguardClockInteractor;
mInWindowLauncherUnlockAnimationManager = inWindowLauncherUnlockAnimationManager;
@@ -251,12 +233,6 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS
mDumpManager.unregisterDumpable(getClass().getSimpleName()); // unregister previous
mDumpManager.registerDumpable(getClass().getSimpleName(), this);
}
-
- if (mFeatureFlags.isEnabled(LOCKSCREEN_WALLPAPER_DREAM_ENABLED)) {
- mStatusArea = mView.findViewById(R.id.keyguard_status_area);
- collectFlow(mStatusArea, mKeyguardInteractor.isActiveDreamLockscreenHosted(),
- mIsActiveDreamLockscreenHostedCallback);
- }
}
public KeyguardClockSwitch getView() {
@@ -668,15 +644,6 @@ public class KeyguardClockSwitchController extends ViewController<KeyguardClockS
}
}
- private void updateKeyguardStatusAreaVisibility() {
- if (mStatusArea != null) {
- mUiExecutor.execute(() -> {
- mStatusArea.setVisibility(
- mIsActiveDreamLockscreenHosted ? View.INVISIBLE : View.VISIBLE);
- });
- }
- }
-
/**
* Sets the clipChildren property on relevant views, to allow the smartspace to draw out of
* bounds during the unlock transition.
diff --git a/packages/SystemUI/src/com/android/systemui/CameraProtectionLoader.kt b/packages/SystemUI/src/com/android/systemui/CameraProtectionLoader.kt
index 6cee28be78f1..0c29466d8dc5 100644
--- a/packages/SystemUI/src/com/android/systemui/CameraProtectionLoader.kt
+++ b/packages/SystemUI/src/com/android/systemui/CameraProtectionLoader.kt
@@ -22,15 +22,18 @@ import android.graphics.Rect
import android.graphics.RectF
import android.util.PathParser
import com.android.systemui.res.R
-import javax.inject.Inject
+import dagger.assisted.Assisted
+import dagger.assisted.AssistedFactory
+import dagger.assisted.AssistedInject
import kotlin.math.roundToInt
interface CameraProtectionLoader {
fun loadCameraProtectionInfoList(): List<CameraProtectionInfo>
}
-class CameraProtectionLoaderImpl @Inject constructor(private val context: Context) :
- CameraProtectionLoader {
+class CameraProtectionLoaderImpl
+@AssistedInject
+constructor(@Assisted private val context: Context) : CameraProtectionLoader {
override fun loadCameraProtectionInfoList(): List<CameraProtectionInfo> {
val list = mutableListOf<CameraProtectionInfo>()
@@ -76,7 +79,7 @@ class CameraProtectionLoaderImpl @Inject constructor(private val context: Contex
computed.left.roundToInt(),
computed.top.roundToInt(),
computed.right.roundToInt(),
- computed.bottom.roundToInt()
+ computed.bottom.roundToInt(),
)
val displayUniqueId = context.getString(displayUniqueIdRes)
return CameraProtectionInfo(
@@ -84,7 +87,7 @@ class CameraProtectionLoaderImpl @Inject constructor(private val context: Contex
physicalCameraId,
protectionPath,
protectionBounds,
- displayUniqueId
+ displayUniqueId,
)
}
@@ -95,4 +98,9 @@ class CameraProtectionLoaderImpl @Inject constructor(private val context: Contex
throw IllegalArgumentException("Invalid protection path", e)
}
}
+
+ @AssistedFactory
+ interface Factory {
+ fun create(context: Context): CameraProtectionLoaderImpl
+ }
}
diff --git a/packages/SystemUI/src/com/android/systemui/CameraProtectionModule.kt b/packages/SystemUI/src/com/android/systemui/CameraProtectionModule.kt
index 58680a88d670..442a1e4d60a7 100644
--- a/packages/SystemUI/src/com/android/systemui/CameraProtectionModule.kt
+++ b/packages/SystemUI/src/com/android/systemui/CameraProtectionModule.kt
@@ -16,11 +16,20 @@
package com.android.systemui
-import dagger.Binds
+import android.content.Context
+import com.android.systemui.dagger.SysUISingleton
import dagger.Module
+import dagger.Provides
@Module
-interface CameraProtectionModule {
+object CameraProtectionModule {
- @Binds fun cameraProtectionLoaderImpl(impl: CameraProtectionLoaderImpl): CameraProtectionLoader
+ @Provides
+ @SysUISingleton
+ fun cameraProtectionLoader(
+ factory: CameraProtectionLoaderImpl.Factory,
+ context: Context,
+ ): CameraProtectionLoader {
+ return factory.create(context)
+ }
}
diff --git a/packages/SystemUI/src/com/android/systemui/ScreenDecorationsModule.kt b/packages/SystemUI/src/com/android/systemui/ScreenDecorationsModule.kt
index 044312bcfe14..6fc50fb1f460 100644
--- a/packages/SystemUI/src/com/android/systemui/ScreenDecorationsModule.kt
+++ b/packages/SystemUI/src/com/android/systemui/ScreenDecorationsModule.kt
@@ -16,9 +16,14 @@
package com.android.systemui
+import android.content.Context
+import com.android.systemui.dagger.SysUISingleton
+import com.android.systemui.decor.FaceScanningProviderFactory
+import com.android.systemui.decor.FaceScanningProviderFactoryImpl
import com.android.systemui.statusbar.policy.ConfigurationController.ConfigurationListener
import dagger.Binds
import dagger.Module
+import dagger.Provides
import dagger.multibindings.ClassKey
import dagger.multibindings.IntoMap
import dagger.multibindings.IntoSet
@@ -35,4 +40,15 @@ interface ScreenDecorationsModule {
@Binds
@IntoSet
fun bindScreenDecorationsConfigListener(impl: ScreenDecorations): ConfigurationListener
+
+ companion object {
+ @Provides
+ @SysUISingleton
+ fun faceScanningProviderFactory(
+ creator: FaceScanningProviderFactoryImpl.Creator,
+ context: Context,
+ ): FaceScanningProviderFactory {
+ return creator.create(context)
+ }
+ }
}
diff --git a/packages/SystemUI/src/com/android/systemui/SysUICutoutProvider.kt b/packages/SystemUI/src/com/android/systemui/SysUICutoutProvider.kt
index 7309599d9c04..b4cb1033ab82 100644
--- a/packages/SystemUI/src/com/android/systemui/SysUICutoutProvider.kt
+++ b/packages/SystemUI/src/com/android/systemui/SysUICutoutProvider.kt
@@ -21,21 +21,12 @@ import android.graphics.Rect
import android.util.RotationUtils
import android.view.Display
import android.view.DisplayCutout
-import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.display.naturalBounds
-import javax.inject.Inject
+import dagger.assisted.Assisted
+import dagger.assisted.AssistedFactory
+import dagger.assisted.AssistedInject
-@SysUISingleton
-class SysUICutoutProvider
-@Inject
-constructor(
- private val context: Context,
- private val cameraProtectionLoader: CameraProtectionLoader,
-) {
-
- private val cameraProtectionList by lazy {
- cameraProtectionLoader.loadCameraProtectionInfoList()
- }
+interface SysUICutoutProvider {
/**
* Returns the [SysUICutoutInformation] for the current display and the current rotation.
@@ -43,7 +34,21 @@ constructor(
* This means that the bounds of the display cutout and the camera protection will be
* adjusted/rotated for the current rotation.
*/
- fun cutoutInfoForCurrentDisplayAndRotation(): SysUICutoutInformation? {
+ fun cutoutInfoForCurrentDisplayAndRotation(): SysUICutoutInformation?
+}
+
+class SysUICutoutProviderImpl
+@AssistedInject
+constructor(
+ @Assisted private val context: Context,
+ @Assisted private val cameraProtectionLoader: CameraProtectionLoader,
+) : SysUICutoutProvider {
+
+ private val cameraProtectionList by lazy {
+ cameraProtectionLoader.loadCameraProtectionInfoList()
+ }
+
+ override fun cutoutInfoForCurrentDisplayAndRotation(): SysUICutoutInformation? {
val display = context.display
val displayCutout: DisplayCutout = display.cutout ?: return null
return SysUICutoutInformation(displayCutout, getCameraProtectionForDisplay(display))
@@ -72,8 +77,16 @@ constructor(
/* inOutBounds = */ rotatedBoundsOut,
/* parentWidth = */ displayNaturalBounds.width(),
/* parentHeight = */ displayNaturalBounds.height(),
- /* rotation = */ display.rotation
+ /* rotation = */ display.rotation,
)
return rotatedBoundsOut
}
+
+ @AssistedFactory
+ interface Factory {
+ fun create(
+ context: Context,
+ cameraProtectionLoader: CameraProtectionLoader,
+ ): SysUICutoutProviderImpl
+ }
}
diff --git a/packages/SystemUI/src/com/android/systemui/accessibility/hearingaid/HearingDevicesDialogDelegate.java b/packages/SystemUI/src/com/android/systemui/accessibility/hearingaid/HearingDevicesDialogDelegate.java
index 158623fa80af..1978bb89b5b2 100644
--- a/packages/SystemUI/src/com/android/systemui/accessibility/hearingaid/HearingDevicesDialogDelegate.java
+++ b/packages/SystemUI/src/com/android/systemui/accessibility/hearingaid/HearingDevicesDialogDelegate.java
@@ -42,6 +42,7 @@ import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.LinearLayout;
+import android.widget.Space;
import android.widget.Spinner;
import android.widget.TextView;
import android.widget.Toast;
@@ -52,6 +53,7 @@ import androidx.annotation.VisibleForTesting;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
+import com.android.settingslib.Utils;
import com.android.settingslib.bluetooth.BluetoothCallback;
import com.android.settingslib.bluetooth.CachedBluetoothDevice;
import com.android.settingslib.bluetooth.HapClientProfile;
@@ -428,10 +430,16 @@ public class HearingDevicesDialogDelegate implements SystemUIDialog.Delegate,
} catch (Resources.NotFoundException e) {
Log.i(TAG, "No hearing devices related tool config resource");
}
- final int listSize = toolItemList.size();
- for (int i = 0; i < listSize; i++) {
+ for (int i = 0; i < toolItemList.size(); i++) {
View view = createHearingToolView(context, toolItemList.get(i));
mRelatedToolsContainer.addView(view);
+ if (i != toolItemList.size() - 1) {
+ final int spaceSize = context.getResources().getDimensionPixelSize(
+ R.dimen.hearing_devices_layout_margin);
+ Space space = new Space(context);
+ space.setLayoutParams(new LinearLayout.LayoutParams(spaceSize, 0));
+ mRelatedToolsContainer.addView(space);
+ }
}
}
@@ -492,6 +500,10 @@ public class HearingDevicesDialogDelegate implements SystemUIDialog.Delegate,
TextView text = view.requireViewById(R.id.tool_name);
view.setContentDescription(item.getToolName());
icon.setImageDrawable(item.getToolIcon());
+ if (item.isCustomIcon()) {
+ icon.getDrawable().mutate().setTint(Utils.getColorAttr(context,
+ com.android.internal.R.attr.materialColorOnPrimaryContainer).getDefaultColor());
+ }
text.setText(item.getToolName());
Intent intent = item.getToolIntent();
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
@@ -517,7 +529,8 @@ public class HearingDevicesDialogDelegate implements SystemUIDialog.Delegate,
return new ToolItem(
context.getString(R.string.quick_settings_hearing_devices_live_caption_title),
context.getDrawable(R.drawable.ic_volume_odi_captions),
- LIVE_CAPTION_INTENT);
+ LIVE_CAPTION_INTENT,
+ /* isCustomIcon= */ true);
}
return null;
diff --git a/packages/SystemUI/src/com/android/systemui/accessibility/hearingaid/HearingDevicesToolItemParser.java b/packages/SystemUI/src/com/android/systemui/accessibility/hearingaid/HearingDevicesToolItemParser.java
index 2006726e6847..7e4c1e5e7b6e 100644
--- a/packages/SystemUI/src/com/android/systemui/accessibility/hearingaid/HearingDevicesToolItemParser.java
+++ b/packages/SystemUI/src/com/android/systemui/accessibility/hearingaid/HearingDevicesToolItemParser.java
@@ -41,7 +41,7 @@ public class HearingDevicesToolItemParser {
private static final String SPLIT_DELIMITER = "/";
private static final String RES_TYPE = "drawable";
@VisibleForTesting
- static final int MAX_NUM = 3;
+ static final int MAX_NUM = 2;
/**
* Parses the string arrays to create a list of {@link ToolItem}.
@@ -82,7 +82,8 @@ public class HearingDevicesToolItemParser {
useCustomIcons ? iconList.get(i)
: activityInfoList.get(i).loadIcon(packageManager),
new Intent(Intent.ACTION_MAIN).setComponent(
- activityInfoList.get(i).getComponentName())
+ activityInfoList.get(i).getComponentName()),
+ useCustomIcons
));
}
diff --git a/packages/SystemUI/src/com/android/systemui/accessibility/hearingaid/ToolItem.kt b/packages/SystemUI/src/com/android/systemui/accessibility/hearingaid/ToolItem.kt
index 66bb2b5e2328..ef03f0cdef79 100644
--- a/packages/SystemUI/src/com/android/systemui/accessibility/hearingaid/ToolItem.kt
+++ b/packages/SystemUI/src/com/android/systemui/accessibility/hearingaid/ToolItem.kt
@@ -23,4 +23,5 @@ data class ToolItem(
var toolName: String = "",
var toolIcon: Drawable,
var toolIntent: Intent,
+ var isCustomIcon: Boolean,
)
diff --git a/packages/SystemUI/src/com/android/systemui/bouncer/domain/interactor/BouncerActionButtonInteractor.kt b/packages/SystemUI/src/com/android/systemui/bouncer/domain/interactor/BouncerActionButtonInteractor.kt
index 7337e5af51a1..da01c583db0a 100644
--- a/packages/SystemUI/src/com/android/systemui/bouncer/domain/interactor/BouncerActionButtonInteractor.kt
+++ b/packages/SystemUI/src/com/android/systemui/bouncer/domain/interactor/BouncerActionButtonInteractor.kt
@@ -123,8 +123,6 @@ constructor(
onLongClick = {
if (emergencyAffordanceManager.needsEmergencyAffordance()) {
prepareToPerformAction()
-
- // TODO(b/369767936): Check that !longPressWasDragged before invoking.
emergencyAffordanceManager.performEmergencyCall()
}
},
diff --git a/packages/SystemUI/src/com/android/systemui/bouncer/ui/binder/BouncerViewBinder.kt b/packages/SystemUI/src/com/android/systemui/bouncer/ui/binder/BouncerViewBinder.kt
index 49dadcefb276..12f06bbd4f5e 100644
--- a/packages/SystemUI/src/com/android/systemui/bouncer/ui/binder/BouncerViewBinder.kt
+++ b/packages/SystemUI/src/com/android/systemui/bouncer/ui/binder/BouncerViewBinder.kt
@@ -4,17 +4,21 @@ import android.view.ViewGroup
import com.android.keyguard.KeyguardMessageAreaController
import com.android.keyguard.dagger.KeyguardBouncerComponent
import com.android.systemui.bouncer.domain.interactor.BouncerMessageInteractor
+import com.android.systemui.bouncer.domain.interactor.PrimaryBouncerInteractor
import com.android.systemui.bouncer.shared.flag.ComposeBouncerFlags
import com.android.systemui.bouncer.ui.BouncerDialogFactory
import com.android.systemui.bouncer.ui.viewmodel.BouncerContainerViewModel
import com.android.systemui.bouncer.ui.viewmodel.BouncerSceneContentViewModel
import com.android.systemui.bouncer.ui.viewmodel.KeyguardBouncerViewModel
import com.android.systemui.dagger.SysUISingleton
+import com.android.systemui.dagger.qualifiers.Application
+import com.android.systemui.keyguard.domain.interactor.KeyguardInteractor
import com.android.systemui.keyguard.ui.viewmodel.PrimaryBouncerToGoneTransitionViewModel
import com.android.systemui.log.BouncerLogger
import com.android.systemui.user.domain.interactor.SelectedUserInteractor
import dagger.Lazy
import javax.inject.Inject
+import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.ExperimentalCoroutinesApi
/** Helper data class that allows to lazy load all the dependencies of the legacy bouncer. */
@@ -37,6 +41,10 @@ constructor(
data class ComposeBouncerDependencies
@Inject
constructor(
+ @Application val applicationScope: CoroutineScope,
+ val keyguardInteractor: KeyguardInteractor,
+ val selectedUserInteractor: SelectedUserInteractor,
+ val legacyInteractor: PrimaryBouncerInteractor,
val viewModelFactory: BouncerSceneContentViewModel.Factory,
val dialogFactory: BouncerDialogFactory,
val bouncerContainerViewModelFactory: BouncerContainerViewModel.Factory,
@@ -58,6 +66,10 @@ constructor(
val deps = composeBouncerDependencies.get()
ComposeBouncerViewBinder.bind(
view,
+ deps.applicationScope,
+ deps.legacyInteractor,
+ deps.keyguardInteractor,
+ deps.selectedUserInteractor,
deps.viewModelFactory,
deps.dialogFactory,
deps.bouncerContainerViewModelFactory,
diff --git a/packages/SystemUI/src/com/android/systemui/bouncer/ui/binder/ComposeBouncerViewBinder.kt b/packages/SystemUI/src/com/android/systemui/bouncer/ui/binder/ComposeBouncerViewBinder.kt
index fdbc18dc9ae1..80c4291d2873 100644
--- a/packages/SystemUI/src/com/android/systemui/bouncer/ui/binder/ComposeBouncerViewBinder.kt
+++ b/packages/SystemUI/src/com/android/systemui/bouncer/ui/binder/ComposeBouncerViewBinder.kt
@@ -6,23 +6,59 @@ import androidx.activity.OnBackPressedDispatcherOwner
import androidx.activity.setViewTreeOnBackPressedDispatcherOwner
import androidx.compose.ui.platform.ComposeView
import androidx.lifecycle.Lifecycle
+import com.android.systemui.bouncer.domain.interactor.PrimaryBouncerInteractor
import com.android.systemui.bouncer.ui.BouncerDialogFactory
import com.android.systemui.bouncer.ui.composable.BouncerContainer
import com.android.systemui.bouncer.ui.viewmodel.BouncerContainerViewModel
import com.android.systemui.bouncer.ui.viewmodel.BouncerSceneContentViewModel
+import com.android.systemui.keyguard.domain.interactor.KeyguardInteractor
import com.android.systemui.lifecycle.WindowLifecycleState
import com.android.systemui.lifecycle.repeatWhenAttached
import com.android.systemui.lifecycle.viewModel
+import com.android.systemui.user.domain.interactor.SelectedUserInteractor
+import com.android.systemui.util.kotlin.sample
+import kotlinx.coroutines.CoroutineScope
+import kotlinx.coroutines.Job
import kotlinx.coroutines.awaitCancellation
+import kotlinx.coroutines.launch
/** View binder responsible for binding the compose version of the bouncer. */
object ComposeBouncerViewBinder {
+ private var persistentBouncerJob: Job? = null
+
fun bind(
view: ViewGroup,
+ scope: CoroutineScope,
+ legacyInteractor: PrimaryBouncerInteractor,
+ keyguardInteractor: KeyguardInteractor,
+ selectedUserInteractor: SelectedUserInteractor,
viewModelFactory: BouncerSceneContentViewModel.Factory,
dialogFactory: BouncerDialogFactory,
bouncerContainerViewModelFactory: BouncerContainerViewModel.Factory,
) {
+ persistentBouncerJob?.cancel()
+ persistentBouncerJob =
+ scope.launch {
+ launch {
+ legacyInteractor.isShowing
+ .sample(keyguardInteractor.isKeyguardDismissible, ::Pair)
+ .collect { (isShowing, dismissible) ->
+ if (isShowing && dismissible) {
+ legacyInteractor.notifyUserRequestedBouncerWhenAlreadyAuthenticated(
+ selectedUserInteractor.getSelectedUserId()
+ )
+ }
+ }
+ }
+
+ launch {
+ legacyInteractor.startingDisappearAnimation.collect {
+ it.run()
+ legacyInteractor.hide()
+ }
+ }
+ }
+
view.repeatWhenAttached {
view.viewModel(
minWindowLifecycleState = WindowLifecycleState.ATTACHED,
diff --git a/packages/SystemUI/src/com/android/systemui/bouncer/ui/viewmodel/BouncerContainerViewModel.kt b/packages/SystemUI/src/com/android/systemui/bouncer/ui/viewmodel/BouncerContainerViewModel.kt
index 5a4f8eb36673..615cb5bb51c8 100644
--- a/packages/SystemUI/src/com/android/systemui/bouncer/ui/viewmodel/BouncerContainerViewModel.kt
+++ b/packages/SystemUI/src/com/android/systemui/bouncer/ui/viewmodel/BouncerContainerViewModel.kt
@@ -18,10 +18,8 @@ package com.android.systemui.bouncer.ui.viewmodel
import com.android.systemui.authentication.domain.interactor.AuthenticationInteractor
import com.android.systemui.bouncer.domain.interactor.PrimaryBouncerInteractor
-import com.android.systemui.deviceentry.domain.interactor.DeviceUnlockedInteractor
import com.android.systemui.lifecycle.ExclusiveActivatable
import com.android.systemui.user.domain.interactor.SelectedUserInteractor
-import com.android.systemui.util.kotlin.sample
import dagger.assisted.AssistedFactory
import dagger.assisted.AssistedInject
import kotlinx.coroutines.awaitCancellation
@@ -34,24 +32,11 @@ constructor(
private val legacyInteractor: PrimaryBouncerInteractor,
private val authenticationInteractor: AuthenticationInteractor,
private val selectedUserInteractor: SelectedUserInteractor,
- private val deviceUnlockedInteractor: DeviceUnlockedInteractor,
) : ExclusiveActivatable() {
override suspend fun onActivated(): Nothing {
coroutineScope {
launch {
- legacyInteractor.isShowing
- .sample(deviceUnlockedInteractor.deviceUnlockStatus, ::Pair)
- .collect { (isShowing, unlockStatus) ->
- if (isShowing && unlockStatus.isUnlocked) {
- legacyInteractor.notifyUserRequestedBouncerWhenAlreadyAuthenticated(
- selectedUserInteractor.getSelectedUserId()
- )
- }
- }
- }
-
- launch {
authenticationInteractor.onAuthenticationResult.collect { authenticationSucceeded ->
if (authenticationSucceeded) {
legacyInteractor.notifyKeyguardAuthenticatedPrimaryAuth(
@@ -60,13 +45,6 @@ constructor(
}
}
}
-
- launch {
- legacyInteractor.startingDisappearAnimation.collect {
- it.run()
- legacyInteractor.hide()
- }
- }
awaitCancellation()
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/bouncer/ui/viewmodel/BouncerSceneContentViewModel.kt b/packages/SystemUI/src/com/android/systemui/bouncer/ui/viewmodel/BouncerSceneContentViewModel.kt
index 0bcb58dee934..5f973917440c 100644
--- a/packages/SystemUI/src/com/android/systemui/bouncer/ui/viewmodel/BouncerSceneContentViewModel.kt
+++ b/packages/SystemUI/src/com/android/systemui/bouncer/ui/viewmodel/BouncerSceneContentViewModel.kt
@@ -175,8 +175,10 @@ constructor(
actions.map { action ->
UserSwitcherDropdownItemViewModel(
icon =
- Icon.Resource(
- action.iconResourceId,
+ Icon.Loaded(
+ applicationContext.resources.getDrawable(
+ action.iconResourceId
+ ),
contentDescription = null,
),
text = Text.Resource(action.textResourceId),
diff --git a/packages/SystemUI/src/com/android/systemui/classifier/FalsingModule.java b/packages/SystemUI/src/com/android/systemui/classifier/FalsingModule.java
index 613280c3ba5d..7716ecedb772 100644
--- a/packages/SystemUI/src/com/android/systemui/classifier/FalsingModule.java
+++ b/packages/SystemUI/src/com/android/systemui/classifier/FalsingModule.java
@@ -17,6 +17,7 @@
package com.android.systemui.classifier;
import android.content.res.Resources;
+import android.hardware.devicestate.DeviceStateManager;
import android.view.ViewConfiguration;
import com.android.systemui.dagger.SysUISingleton;
@@ -24,6 +25,7 @@ import com.android.systemui.dagger.qualifiers.Main;
import com.android.systemui.res.R;
import com.android.systemui.scene.shared.flag.SceneContainerFlag;
import com.android.systemui.statusbar.phone.NotificationTapHelper;
+import com.android.systemui.util.Utils;
import dagger.Binds;
import dagger.Module;
@@ -104,12 +106,8 @@ public interface FalsingModule {
/** */
@Provides
@Named(IS_FOLDABLE_DEVICE)
- static boolean providesIsFoldableDevice(@Main Resources resources) {
- try {
- return resources.getIntArray(
- com.android.internal.R.array.config_foldedDeviceStates).length != 0;
- } catch (Resources.NotFoundException e) {
- return false;
- }
+ static boolean providesIsFoldableDevice(@Main Resources resources,
+ DeviceStateManager deviceStateManager) {
+ return Utils.isDeviceFoldable(resources, deviceStateManager);
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/communal/ui/viewmodel/ResizeableItemFrameViewModel.kt b/packages/SystemUI/src/com/android/systemui/communal/ui/viewmodel/ResizeableItemFrameViewModel.kt
index a519649a8f1c..db4bee781a58 100644
--- a/packages/SystemUI/src/com/android/systemui/communal/ui/viewmodel/ResizeableItemFrameViewModel.kt
+++ b/packages/SystemUI/src/com/android/systemui/communal/ui/viewmodel/ResizeableItemFrameViewModel.kt
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package com.android.systemui.communal.ui.viewmodel
import androidx.compose.foundation.gestures.AnchoredDraggableState
@@ -21,6 +20,10 @@ import androidx.compose.foundation.gestures.DraggableAnchors
import androidx.compose.runtime.snapshotFlow
import com.android.app.tracing.coroutines.coroutineScopeTraced as coroutineScope
import com.android.systemui.lifecycle.ExclusiveActivatable
+import kotlin.math.abs
+import kotlin.math.ceil
+import kotlin.math.floor
+import kotlin.math.sign
import kotlinx.coroutines.awaitCancellation
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.MutableStateFlow
@@ -50,14 +53,33 @@ data class ResizeInfo(
}
class ResizeableItemFrameViewModel : ExclusiveActivatable() {
- private data class GridLayoutInfo(
- val minSpan: Int,
- val maxSpan: Int,
- val heightPerSpanPx: Float,
- val verticalItemSpacingPx: Float,
+ data class GridLayoutInfo(
val currentRow: Int,
val currentSpan: Int,
- )
+ val maxHeightPx: Int,
+ val minHeightPx: Int,
+ val resizeMultiple: Int,
+ val totalSpans: Int,
+ private val heightPerSpanPx: Float,
+ private val verticalItemSpacingPx: Float,
+ ) {
+ fun getPxOffsetForResize(spans: Int): Int =
+ (spans * (heightPerSpanPx + verticalItemSpacingPx)).toInt()
+
+ private fun getSpansForPx(height: Int): Int =
+ ceil((height + verticalItemSpacingPx) / (heightPerSpanPx + verticalItemSpacingPx))
+ .toInt()
+ .coerceIn(resizeMultiple, totalSpans)
+
+ private fun roundDownToMultiple(spans: Int): Int =
+ floor(spans.toDouble() / resizeMultiple).toInt() * resizeMultiple
+
+ val maxSpans: Int
+ get() = roundDownToMultiple(getSpansForPx(maxHeightPx))
+
+ val minSpans: Int
+ get() = roundDownToMultiple(getSpansForPx(minHeightPx))
+ }
/**
* The layout information necessary in order to calculate the pixel offsets of the drag anchor
@@ -84,37 +106,44 @@ class ResizeableItemFrameViewModel : ExclusiveActivatable() {
*/
fun setGridLayoutInfo(
verticalItemSpacingPx: Float,
- verticalContentPaddingPx: Float,
- viewportHeightPx: Int,
- maxItemSpan: Int,
- minItemSpan: Int,
currentRow: Int?,
- currentSpan: Int?,
+ maxHeightPx: Int,
+ minHeightPx: Int,
+ currentSpan: Int,
+ resizeMultiple: Int,
+ totalSpans: Int,
+ viewportHeightPx: Int,
+ verticalContentPaddingPx: Float,
) {
- if (currentSpan == null || currentRow == null) {
+ if (currentRow == null) {
gridLayoutInfo.value = null
return
}
- require(maxItemSpan >= minItemSpan) {
- "Maximum item span of $maxItemSpan cannot be less than the minimum span of $minItemSpan"
+ require(maxHeightPx >= minHeightPx) {
+ "Maximum item span of $maxHeightPx cannot be less than the minimum span of $minHeightPx"
}
- require(minItemSpan in 1..maxItemSpan) {
- "Minimum span must be between 1 and $maxItemSpan, but was $minItemSpan"
+
+ require(currentSpan <= totalSpans) {
+ "Current span ($currentSpan) cannot exceed the total number of spans ($totalSpans)"
}
- require(currentSpan % minItemSpan == 0) {
- "Current span of $currentSpan is not a multiple of the minimum span of $minItemSpan"
+
+ require(resizeMultiple > 0) {
+ "Resize multiple ($resizeMultiple) must be a positive integer"
}
val availableHeight = viewportHeightPx - verticalContentPaddingPx
- val totalSpacing = verticalItemSpacingPx * ((maxItemSpan / minItemSpan) - 1)
- val heightPerSpanPx = (availableHeight - totalSpacing) / maxItemSpan
+ val heightPerSpanPx =
+ (availableHeight - (totalSpans - 1) * verticalItemSpacingPx) / totalSpans
+
gridLayoutInfo.value =
GridLayoutInfo(
- minSpan = minItemSpan,
- maxSpan = maxItemSpan,
heightPerSpanPx = heightPerSpanPx,
verticalItemSpacingPx = verticalItemSpacingPx,
currentRow = currentRow,
currentSpan = currentSpan,
+ maxHeightPx = maxHeightPx.coerceAtMost(availableHeight.toInt()),
+ minHeightPx = minHeightPx,
+ resizeMultiple = resizeMultiple,
+ totalSpans = totalSpans,
)
}
@@ -123,50 +152,46 @@ class ResizeableItemFrameViewModel : ExclusiveActivatable() {
layoutInfo: GridLayoutInfo?,
): DraggableAnchors<Int> {
- if (layoutInfo == null || !isDragAllowed(handle, layoutInfo)) {
+ if (layoutInfo == null || (!isDragAllowed(handle, layoutInfo))) {
return DraggableAnchors { 0 at 0f }
}
-
- val (
- minItemSpan,
- maxItemSpan,
- heightPerSpanPx,
- verticalSpacingPx,
- currentRow,
- currentSpan,
- ) = layoutInfo
+ val currentRow = layoutInfo.currentRow
+ val currentSpan = layoutInfo.currentSpan
+ val minItemSpan = layoutInfo.minSpans
+ val maxItemSpan = layoutInfo.maxSpans
+ val totalSpans = layoutInfo.totalSpans
// The maximum row this handle can be dragged to.
val maxRow =
if (handle == DragHandle.TOP) {
(currentRow + currentSpan - minItemSpan).coerceAtLeast(0)
} else {
- maxItemSpan
+ (currentRow + maxItemSpan).coerceAtMost(totalSpans)
}
// The minimum row this handle can be dragged to.
val minRow =
if (handle == DragHandle.TOP) {
- 0
+ (currentRow + currentSpan - maxItemSpan).coerceAtLeast(0)
} else {
- (currentRow + minItemSpan).coerceAtMost(maxItemSpan)
+ (currentRow + minItemSpan).coerceAtMost(totalSpans)
}
// The current row position of this handle
val currentPosition = if (handle == DragHandle.TOP) currentRow else currentRow + currentSpan
return DraggableAnchors {
- for (targetRow in minRow..maxRow step minItemSpan) {
+ for (targetRow in minRow..maxRow step layoutInfo.resizeMultiple) {
val diff = targetRow - currentPosition
- val spacing = diff / minItemSpan * verticalSpacingPx
- diff at diff * heightPerSpanPx + spacing
+ val pixelOffset = (layoutInfo.getPxOffsetForResize(abs(diff)) * diff.sign).toFloat()
+ diff at pixelOffset
}
}
}
private fun isDragAllowed(handle: DragHandle, layoutInfo: GridLayoutInfo): Boolean {
- val minItemSpan = layoutInfo.minSpan
- val maxItemSpan = layoutInfo.maxSpan
+ val minItemSpan = layoutInfo.minSpans
+ val maxItemSpan = layoutInfo.maxSpans
val currentRow = layoutInfo.currentRow
val currentSpan = layoutInfo.currentSpan
val atMinSize = currentSpan == minItemSpan
diff --git a/packages/SystemUI/src/com/android/systemui/dagger/ReferenceSystemUIModule.java b/packages/SystemUI/src/com/android/systemui/dagger/ReferenceSystemUIModule.java
index a5b22775f3d5..c6be0dd76a06 100644
--- a/packages/SystemUI/src/com/android/systemui/dagger/ReferenceSystemUIModule.java
+++ b/packages/SystemUI/src/com/android/systemui/dagger/ReferenceSystemUIModule.java
@@ -34,6 +34,7 @@ import com.android.systemui.display.ui.viewmodel.ConnectingDisplayViewModel;
import com.android.systemui.dock.DockManager;
import com.android.systemui.dock.DockManagerImpl;
import com.android.systemui.doze.DozeHost;
+import com.android.systemui.education.dagger.ContextualEducationModule;
import com.android.systemui.inputdevice.tutorial.KeyboardTouchpadTutorialModule;
import com.android.systemui.keyboard.shortcut.ShortcutHelperModule;
import com.android.systemui.keyguard.ui.composable.blueprint.DefaultBlueprintModule;
@@ -153,6 +154,7 @@ import javax.inject.Named;
VolumeModule.class,
WallpaperModule.class,
ShortcutHelperModule.class,
+ ContextualEducationModule.class,
})
public abstract class ReferenceSystemUIModule {
diff --git a/packages/SystemUI/src/com/android/systemui/dagger/SystemUICoreStartableModule.kt b/packages/SystemUI/src/com/android/systemui/dagger/SystemUICoreStartableModule.kt
index 8da4d460b7a5..0de919deb943 100644
--- a/packages/SystemUI/src/com/android/systemui/dagger/SystemUICoreStartableModule.kt
+++ b/packages/SystemUI/src/com/android/systemui/dagger/SystemUICoreStartableModule.kt
@@ -50,7 +50,6 @@ import com.android.systemui.shortcut.ShortcutKeyDispatcher
import com.android.systemui.statusbar.ImmersiveModeConfirmation
import com.android.systemui.statusbar.gesture.GesturePointerEventListener
import com.android.systemui.statusbar.notification.InstantAppNotifier
-import com.android.systemui.statusbar.phone.ScrimController
import com.android.systemui.statusbar.phone.StatusBarHeadsUpChangeListener
import com.android.systemui.statusbar.policy.BatteryControllerStartable
import com.android.systemui.stylus.StylusUsiPowerStartable
@@ -288,11 +287,6 @@ abstract class SystemUICoreStartableModule {
@Binds
@IntoMap
- @ClassKey(ScrimController::class)
- abstract fun bindScrimController(impl: ScrimController): CoreStartable
-
- @Binds
- @IntoMap
@ClassKey(StatusBarHeadsUpChangeListener::class)
abstract fun bindStatusBarHeadsUpChangeListener(
impl: StatusBarHeadsUpChangeListener
diff --git a/packages/SystemUI/src/com/android/systemui/dagger/SystemUIModule.java b/packages/SystemUI/src/com/android/systemui/dagger/SystemUIModule.java
index b55108d6ab1d..450863fb53c9 100644
--- a/packages/SystemUI/src/com/android/systemui/dagger/SystemUIModule.java
+++ b/packages/SystemUI/src/com/android/systemui/dagger/SystemUIModule.java
@@ -63,7 +63,6 @@ import com.android.systemui.display.DisplayModule;
import com.android.systemui.doze.dagger.DozeComponent;
import com.android.systemui.dreams.dagger.DreamModule;
import com.android.systemui.dump.DumpManager;
-import com.android.systemui.education.dagger.ContextualEducationModule;
import com.android.systemui.flags.FeatureFlags;
import com.android.systemui.flags.FlagDependenciesModule;
import com.android.systemui.flags.FlagsModule;
@@ -272,8 +271,7 @@ import javax.inject.Named;
UserModule.class,
UtilModule.class,
NoteTaskModule.class,
- WalletModule.class,
- ContextualEducationModule.class
+ WalletModule.class
},
subcomponents = {
ComplicationComponent.class,
diff --git a/packages/SystemUI/src/com/android/systemui/decor/CutoutDecorProviderFactory.kt b/packages/SystemUI/src/com/android/systemui/decor/CutoutDecorProviderFactory.kt
index cbed21cf65d6..bfd6b5bd6ddd 100644
--- a/packages/SystemUI/src/com/android/systemui/decor/CutoutDecorProviderFactory.kt
+++ b/packages/SystemUI/src/com/android/systemui/decor/CutoutDecorProviderFactory.kt
@@ -22,18 +22,15 @@ import android.view.Display
import android.view.DisplayCutout
import android.view.DisplayInfo
-class CutoutDecorProviderFactory constructor(
- private val res: Resources,
- private val display: Display?,
-) : DecorProviderFactory() {
+class CutoutDecorProviderFactory(private val res: Resources, private val display: Display?) :
+ DecorProviderFactory {
val displayInfo = DisplayInfo()
override val hasProviders: Boolean
get() {
- display?.getDisplayInfo(displayInfo) ?: run {
- Log.w(TAG, "display is null, can't update displayInfo")
- }
+ display?.getDisplayInfo(displayInfo)
+ ?: run { Log.w(TAG, "display is null, can't update displayInfo") }
return DisplayCutout.getFillBuiltInDisplayCutout(res, displayInfo.uniqueId)
}
diff --git a/packages/SystemUI/src/com/android/systemui/decor/DecorProviderFactory.kt b/packages/SystemUI/src/com/android/systemui/decor/DecorProviderFactory.kt
index c60cad8419d2..16e73f5ba8e2 100644
--- a/packages/SystemUI/src/com/android/systemui/decor/DecorProviderFactory.kt
+++ b/packages/SystemUI/src/com/android/systemui/decor/DecorProviderFactory.kt
@@ -16,7 +16,7 @@
package com.android.systemui.decor
-abstract class DecorProviderFactory {
- abstract val providers: List<DecorProvider>
- abstract val hasProviders: Boolean
-} \ No newline at end of file
+interface DecorProviderFactory {
+ val providers: List<DecorProvider>
+ val hasProviders: Boolean
+}
diff --git a/packages/SystemUI/src/com/android/systemui/decor/FaceScanningProviderFactory.kt b/packages/SystemUI/src/com/android/systemui/decor/FaceScanningProviderFactory.kt
index 3bc4f342c566..88580cf02f15 100644
--- a/packages/SystemUI/src/com/android/systemui/decor/FaceScanningProviderFactory.kt
+++ b/packages/SystemUI/src/com/android/systemui/decor/FaceScanningProviderFactory.kt
@@ -33,23 +33,32 @@ import com.android.keyguard.KeyguardUpdateMonitor
import com.android.systemui.FaceScanningOverlay
import com.android.systemui.biometrics.AuthController
import com.android.systemui.biometrics.data.repository.FacePropertyRepository
-import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.dagger.qualifiers.Main
import com.android.systemui.log.ScreenDecorationsLogger
import com.android.systemui.plugins.statusbar.StatusBarStateController
+import dagger.assisted.Assisted
+import dagger.assisted.AssistedFactory
+import dagger.assisted.AssistedInject
import java.util.concurrent.Executor
-import javax.inject.Inject
-
-@SysUISingleton
-class FaceScanningProviderFactory @Inject constructor(
- private val authController: AuthController,
- private val context: Context,
- private val statusBarStateController: StatusBarStateController,
- private val keyguardUpdateMonitor: KeyguardUpdateMonitor,
- @Main private val mainExecutor: Executor,
- private val logger: ScreenDecorationsLogger,
- private val facePropertyRepository: FacePropertyRepository,
-) : DecorProviderFactory() {
+
+interface FaceScanningProviderFactory : DecorProviderFactory {
+
+ fun canShowFaceScanningAnim(): Boolean
+
+ fun shouldShowFaceScanningAnim(): Boolean
+}
+
+class FaceScanningProviderFactoryImpl
+@AssistedInject
+constructor(
+ private val authController: AuthController,
+ @Assisted private val context: Context,
+ private val statusBarStateController: StatusBarStateController,
+ private val keyguardUpdateMonitor: KeyguardUpdateMonitor,
+ @Main private val mainExecutor: Executor,
+ private val logger: ScreenDecorationsLogger,
+ private val facePropertyRepository: FacePropertyRepository,
+) : FaceScanningProviderFactory {
private val display = context.display
private val displayInfo = DisplayInfo()
@@ -60,11 +69,12 @@ class FaceScanningProviderFactory @Inject constructor(
}
// update display info
- display?.getDisplayInfo(displayInfo) ?: run {
- Log.w(TAG, "display is null, can't update displayInfo")
- }
+ display?.getDisplayInfo(displayInfo)
+ ?: run { Log.w(TAG, "display is null, can't update displayInfo") }
return DisplayCutout.getFillBuiltInDisplayCutout(
- context.resources, displayInfo.uniqueId)
+ context.resources,
+ displayInfo.uniqueId,
+ )
}
override val providers: List<DecorProvider>
@@ -81,39 +91,45 @@ class FaceScanningProviderFactory @Inject constructor(
// Cutout drawing is updated in ScreenDecorations#updateCutout
for (bound in bounds) {
list.add(
- FaceScanningOverlayProviderImpl(
- bound.baseOnRotation0(displayInfo.rotation),
- authController,
- statusBarStateController,
- keyguardUpdateMonitor,
- mainExecutor,
- logger,
- facePropertyRepository,
- )
+ FaceScanningOverlayProviderImpl(
+ bound.baseOnRotation0(displayInfo.rotation),
+ authController,
+ statusBarStateController,
+ keyguardUpdateMonitor,
+ mainExecutor,
+ logger,
+ facePropertyRepository,
+ )
)
}
}
}
}
- fun canShowFaceScanningAnim(): Boolean {
+ override fun canShowFaceScanningAnim(): Boolean {
return hasProviders && keyguardUpdateMonitor.isFaceEnabledAndEnrolled
}
- fun shouldShowFaceScanningAnim(): Boolean {
+ override fun shouldShowFaceScanningAnim(): Boolean {
return canShowFaceScanningAnim() &&
- (keyguardUpdateMonitor.isFaceDetectionRunning || authController.isShowing)
+ (keyguardUpdateMonitor.isFaceDetectionRunning || authController.isShowing)
+ }
+
+ // Using the name "Creator" so that it doesn't become "...FactoryFactory".
+ @AssistedFactory
+ interface Creator {
+ fun create(context: Context): FaceScanningProviderFactoryImpl
}
}
class FaceScanningOverlayProviderImpl(
- override val alignedBound: Int,
- private val authController: AuthController,
- private val statusBarStateController: StatusBarStateController,
- private val keyguardUpdateMonitor: KeyguardUpdateMonitor,
- private val mainExecutor: Executor,
- private val logger: ScreenDecorationsLogger,
- private val facePropertyRepository: FacePropertyRepository,
+ override val alignedBound: Int,
+ private val authController: AuthController,
+ private val statusBarStateController: StatusBarStateController,
+ private val keyguardUpdateMonitor: KeyguardUpdateMonitor,
+ private val mainExecutor: Executor,
+ private val logger: ScreenDecorationsLogger,
+ private val facePropertyRepository: FacePropertyRepository,
) : BoundDecorProvider() {
override val viewId: Int = com.android.systemui.res.R.id.face_scanning_anim
@@ -122,7 +138,7 @@ class FaceScanningOverlayProviderImpl(
reloadToken: Int,
@Surface.Rotation rotation: Int,
tintColor: Int,
- displayUniqueId: String?
+ displayUniqueId: String?,
) {
(view.layoutParams as FrameLayout.LayoutParams).let {
updateLayoutParams(it, rotation)
@@ -138,9 +154,10 @@ class FaceScanningOverlayProviderImpl(
context: Context,
parent: ViewGroup,
@Surface.Rotation rotation: Int,
- tintColor: Int
+ tintColor: Int,
): View {
- val view = FaceScanningOverlay(
+ val view =
+ FaceScanningOverlay(
context,
alignedBound,
statusBarStateController,
@@ -148,43 +165,46 @@ class FaceScanningOverlayProviderImpl(
mainExecutor,
logger,
authController,
- )
+ )
view.id = viewId
view.setColor(tintColor)
- FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
- ViewGroup.LayoutParams.MATCH_PARENT).let {
- updateLayoutParams(it, rotation)
- parent.addView(view, it)
- }
+ FrameLayout.LayoutParams(
+ ViewGroup.LayoutParams.MATCH_PARENT,
+ ViewGroup.LayoutParams.MATCH_PARENT,
+ )
+ .let {
+ updateLayoutParams(it, rotation)
+ parent.addView(view, it)
+ }
return view
}
private fun updateLayoutParams(
layoutParams: FrameLayout.LayoutParams,
- @Surface.Rotation rotation: Int
+ @Surface.Rotation rotation: Int,
) {
layoutParams.let { lp ->
lp.width = ViewGroup.LayoutParams.MATCH_PARENT
lp.height = ViewGroup.LayoutParams.MATCH_PARENT
logger.faceSensorLocation(facePropertyRepository.sensorLocation.value)
- facePropertyRepository.sensorLocation.value?.y?.let {
- faceAuthSensorHeight ->
+ facePropertyRepository.sensorLocation.value?.y?.let { faceAuthSensorHeight ->
val faceScanningHeight = (faceAuthSensorHeight * 2)
when (rotation) {
- Surface.ROTATION_0, Surface.ROTATION_180 ->
- lp.height = faceScanningHeight
- Surface.ROTATION_90, Surface.ROTATION_270 ->
- lp.width = faceScanningHeight
+ Surface.ROTATION_0,
+ Surface.ROTATION_180 -> lp.height = faceScanningHeight
+ Surface.ROTATION_90,
+ Surface.ROTATION_270 -> lp.width = faceScanningHeight
}
}
- lp.gravity = when (rotation) {
- Surface.ROTATION_0 -> Gravity.TOP or Gravity.START
- Surface.ROTATION_90 -> Gravity.LEFT or Gravity.START
- Surface.ROTATION_180 -> Gravity.BOTTOM or Gravity.END
- Surface.ROTATION_270 -> Gravity.RIGHT or Gravity.END
- else -> -1 /* invalid rotation */
- }
+ lp.gravity =
+ when (rotation) {
+ Surface.ROTATION_0 -> Gravity.TOP or Gravity.START
+ Surface.ROTATION_90 -> Gravity.LEFT or Gravity.START
+ Surface.ROTATION_180 -> Gravity.BOTTOM or Gravity.END
+ Surface.ROTATION_270 -> Gravity.RIGHT or Gravity.END
+ else -> -1 /* invalid rotation */
+ }
}
}
}
@@ -209,24 +229,27 @@ fun DisplayCutout.getBoundBaseOnCurrentRotation(): List<Int> {
fun Int.baseOnRotation0(@DisplayCutout.BoundsPosition currentRotation: Int): Int {
return when (currentRotation) {
Surface.ROTATION_0 -> this
- Surface.ROTATION_90 -> when (this) {
- BOUNDS_POSITION_LEFT -> BOUNDS_POSITION_TOP
- BOUNDS_POSITION_TOP -> BOUNDS_POSITION_RIGHT
- BOUNDS_POSITION_RIGHT -> BOUNDS_POSITION_BOTTOM
- else /* BOUNDS_POSITION_BOTTOM */ -> BOUNDS_POSITION_LEFT
- }
- Surface.ROTATION_270 -> when (this) {
- BOUNDS_POSITION_LEFT -> BOUNDS_POSITION_BOTTOM
- BOUNDS_POSITION_TOP -> BOUNDS_POSITION_LEFT
- BOUNDS_POSITION_RIGHT -> BOUNDS_POSITION_TOP
- else /* BOUNDS_POSITION_BOTTOM */ -> BOUNDS_POSITION_RIGHT
- }
- else /* Surface.ROTATION_180 */ -> when (this) {
- BOUNDS_POSITION_LEFT -> BOUNDS_POSITION_RIGHT
- BOUNDS_POSITION_TOP -> BOUNDS_POSITION_BOTTOM
- BOUNDS_POSITION_RIGHT -> BOUNDS_POSITION_LEFT
- else /* BOUNDS_POSITION_BOTTOM */ -> BOUNDS_POSITION_TOP
- }
+ Surface.ROTATION_90 ->
+ when (this) {
+ BOUNDS_POSITION_LEFT -> BOUNDS_POSITION_TOP
+ BOUNDS_POSITION_TOP -> BOUNDS_POSITION_RIGHT
+ BOUNDS_POSITION_RIGHT -> BOUNDS_POSITION_BOTTOM
+ else /* BOUNDS_POSITION_BOTTOM */ -> BOUNDS_POSITION_LEFT
+ }
+ Surface.ROTATION_270 ->
+ when (this) {
+ BOUNDS_POSITION_LEFT -> BOUNDS_POSITION_BOTTOM
+ BOUNDS_POSITION_TOP -> BOUNDS_POSITION_LEFT
+ BOUNDS_POSITION_RIGHT -> BOUNDS_POSITION_TOP
+ else /* BOUNDS_POSITION_BOTTOM */ -> BOUNDS_POSITION_RIGHT
+ }
+ else /* Surface.ROTATION_180 */ ->
+ when (this) {
+ BOUNDS_POSITION_LEFT -> BOUNDS_POSITION_RIGHT
+ BOUNDS_POSITION_TOP -> BOUNDS_POSITION_BOTTOM
+ BOUNDS_POSITION_RIGHT -> BOUNDS_POSITION_LEFT
+ else /* BOUNDS_POSITION_BOTTOM */ -> BOUNDS_POSITION_TOP
+ }
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/decor/PrivacyDotDecorProviderFactory.kt b/packages/SystemUI/src/com/android/systemui/decor/PrivacyDotDecorProviderFactory.kt
index 14ecc66f555e..9aa7fd100068 100644
--- a/packages/SystemUI/src/com/android/systemui/decor/PrivacyDotDecorProviderFactory.kt
+++ b/packages/SystemUI/src/com/android/systemui/decor/PrivacyDotDecorProviderFactory.kt
@@ -23,19 +23,18 @@ import android.view.LayoutInflater
import android.view.Surface
import android.view.View
import android.view.ViewGroup
-import com.android.systemui.res.R
import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.dagger.qualifiers.Main
+import com.android.systemui.res.R
import javax.inject.Inject
/**
- * Provides privacy dot views for each orientation. The PrivacyDot orientation and visibility
- * of the privacy dot views are controlled by the PrivacyDotViewController.
+ * Provides privacy dot views for each orientation. The PrivacyDot orientation and visibility of the
+ * privacy dot views are controlled by the PrivacyDotViewController.
*/
@SysUISingleton
-open class PrivacyDotDecorProviderFactory @Inject constructor(
- @Main private val res: Resources
-) : DecorProviderFactory() {
+open class PrivacyDotDecorProviderFactory @Inject constructor(@Main private val res: Resources) :
+ DecorProviderFactory {
private val isPrivacyDotEnabled: Boolean
get() = res.getBoolean(R.bool.config_enablePrivacyDot)
@@ -51,22 +50,26 @@ open class PrivacyDotDecorProviderFactory @Inject constructor(
viewId = R.id.privacy_dot_top_left_container,
alignedBound1 = DisplayCutout.BOUNDS_POSITION_TOP,
alignedBound2 = DisplayCutout.BOUNDS_POSITION_LEFT,
- layoutId = R.layout.privacy_dot_top_left),
+ layoutId = R.layout.privacy_dot_top_left,
+ ),
PrivacyDotCornerDecorProviderImpl(
viewId = R.id.privacy_dot_top_right_container,
alignedBound1 = DisplayCutout.BOUNDS_POSITION_TOP,
alignedBound2 = DisplayCutout.BOUNDS_POSITION_RIGHT,
- layoutId = R.layout.privacy_dot_top_right),
+ layoutId = R.layout.privacy_dot_top_right,
+ ),
PrivacyDotCornerDecorProviderImpl(
viewId = R.id.privacy_dot_bottom_left_container,
alignedBound1 = DisplayCutout.BOUNDS_POSITION_BOTTOM,
alignedBound2 = DisplayCutout.BOUNDS_POSITION_LEFT,
- layoutId = R.layout.privacy_dot_bottom_left),
+ layoutId = R.layout.privacy_dot_bottom_left,
+ ),
PrivacyDotCornerDecorProviderImpl(
viewId = R.id.privacy_dot_bottom_right_container,
alignedBound1 = DisplayCutout.BOUNDS_POSITION_BOTTOM,
alignedBound2 = DisplayCutout.BOUNDS_POSITION_RIGHT,
- layoutId = R.layout.privacy_dot_bottom_right)
+ layoutId = R.layout.privacy_dot_bottom_right,
+ ),
)
} else {
emptyList()
@@ -78,7 +81,7 @@ class PrivacyDotCornerDecorProviderImpl(
override val viewId: Int,
@DisplayCutout.BoundsPosition override val alignedBound1: Int,
@DisplayCutout.BoundsPosition override val alignedBound2: Int,
- private val layoutId: Int
+ private val layoutId: Int,
) : CornerDecorProvider() {
override fun onReloadResAndMeasure(
@@ -86,7 +89,7 @@ class PrivacyDotCornerDecorProviderImpl(
reloadToken: Int,
rotation: Int,
tintColor: Int,
- displayUniqueId: String?
+ displayUniqueId: String?,
) {
// Do nothing here because it is handled inside PrivacyDotViewController
}
@@ -95,7 +98,7 @@ class PrivacyDotCornerDecorProviderImpl(
context: Context,
parent: ViewGroup,
@Surface.Rotation rotation: Int,
- tintColor: Int
+ tintColor: Int,
): View {
LayoutInflater.from(context).inflate(layoutId, parent, true)
return parent.getChildAt(parent.childCount - 1 /* latest new added child */)
diff --git a/packages/SystemUI/src/com/android/systemui/decor/RoundedCornerDecorProviderFactory.kt b/packages/SystemUI/src/com/android/systemui/decor/RoundedCornerDecorProviderFactory.kt
index 2f2c952fb778..39fd551e15d3 100644
--- a/packages/SystemUI/src/com/android/systemui/decor/RoundedCornerDecorProviderFactory.kt
+++ b/packages/SystemUI/src/com/android/systemui/decor/RoundedCornerDecorProviderFactory.kt
@@ -21,65 +21,74 @@ import com.android.systemui.res.R
class RoundedCornerDecorProviderFactory(
private val roundedCornerResDelegate: RoundedCornerResDelegate
-) : DecorProviderFactory() {
+) : DecorProviderFactory {
override val hasProviders: Boolean
- get() = roundedCornerResDelegate.run {
- hasTop || hasBottom
- }
+ get() = roundedCornerResDelegate.run { hasTop || hasBottom }
override val providers: List<DecorProvider>
- get() {
- val hasTop = roundedCornerResDelegate.hasTop
- val hasBottom = roundedCornerResDelegate.hasBottom
- return when {
- hasTop && hasBottom -> listOf(
- RoundedCornerDecorProviderImpl(
- viewId = R.id.rounded_corner_top_left,
- alignedBound1 = DisplayCutout.BOUNDS_POSITION_TOP,
- alignedBound2 = DisplayCutout.BOUNDS_POSITION_LEFT,
- roundedCornerResDelegate = roundedCornerResDelegate),
- RoundedCornerDecorProviderImpl(
- viewId = R.id.rounded_corner_top_right,
- alignedBound1 = DisplayCutout.BOUNDS_POSITION_TOP,
- alignedBound2 = DisplayCutout.BOUNDS_POSITION_RIGHT,
- roundedCornerResDelegate = roundedCornerResDelegate),
- RoundedCornerDecorProviderImpl(
- viewId = R.id.rounded_corner_bottom_left,
- alignedBound1 = DisplayCutout.BOUNDS_POSITION_BOTTOM,
- alignedBound2 = DisplayCutout.BOUNDS_POSITION_LEFT,
- roundedCornerResDelegate = roundedCornerResDelegate),
- RoundedCornerDecorProviderImpl(
- viewId = R.id.rounded_corner_bottom_right,
- alignedBound1 = DisplayCutout.BOUNDS_POSITION_BOTTOM,
- alignedBound2 = DisplayCutout.BOUNDS_POSITION_RIGHT,
- roundedCornerResDelegate = roundedCornerResDelegate)
- )
- hasTop -> listOf(
- RoundedCornerDecorProviderImpl(
- viewId = R.id.rounded_corner_top_left,
- alignedBound1 = DisplayCutout.BOUNDS_POSITION_TOP,
- alignedBound2 = DisplayCutout.BOUNDS_POSITION_LEFT,
- roundedCornerResDelegate = roundedCornerResDelegate),
- RoundedCornerDecorProviderImpl(
- viewId = R.id.rounded_corner_top_right,
- alignedBound1 = DisplayCutout.BOUNDS_POSITION_TOP,
- alignedBound2 = DisplayCutout.BOUNDS_POSITION_RIGHT,
- roundedCornerResDelegate = roundedCornerResDelegate)
- )
- hasBottom -> listOf(
- RoundedCornerDecorProviderImpl(
- viewId = R.id.rounded_corner_bottom_left,
- alignedBound1 = DisplayCutout.BOUNDS_POSITION_BOTTOM,
- alignedBound2 = DisplayCutout.BOUNDS_POSITION_LEFT,
- roundedCornerResDelegate = roundedCornerResDelegate),
- RoundedCornerDecorProviderImpl(
- viewId = R.id.rounded_corner_bottom_right,
- alignedBound1 = DisplayCutout.BOUNDS_POSITION_BOTTOM,
- alignedBound2 = DisplayCutout.BOUNDS_POSITION_RIGHT,
- roundedCornerResDelegate = roundedCornerResDelegate)
- )
- else -> emptyList()
+ get() {
+ val hasTop = roundedCornerResDelegate.hasTop
+ val hasBottom = roundedCornerResDelegate.hasBottom
+ return when {
+ hasTop && hasBottom ->
+ listOf(
+ RoundedCornerDecorProviderImpl(
+ viewId = R.id.rounded_corner_top_left,
+ alignedBound1 = DisplayCutout.BOUNDS_POSITION_TOP,
+ alignedBound2 = DisplayCutout.BOUNDS_POSITION_LEFT,
+ roundedCornerResDelegate = roundedCornerResDelegate,
+ ),
+ RoundedCornerDecorProviderImpl(
+ viewId = R.id.rounded_corner_top_right,
+ alignedBound1 = DisplayCutout.BOUNDS_POSITION_TOP,
+ alignedBound2 = DisplayCutout.BOUNDS_POSITION_RIGHT,
+ roundedCornerResDelegate = roundedCornerResDelegate,
+ ),
+ RoundedCornerDecorProviderImpl(
+ viewId = R.id.rounded_corner_bottom_left,
+ alignedBound1 = DisplayCutout.BOUNDS_POSITION_BOTTOM,
+ alignedBound2 = DisplayCutout.BOUNDS_POSITION_LEFT,
+ roundedCornerResDelegate = roundedCornerResDelegate,
+ ),
+ RoundedCornerDecorProviderImpl(
+ viewId = R.id.rounded_corner_bottom_right,
+ alignedBound1 = DisplayCutout.BOUNDS_POSITION_BOTTOM,
+ alignedBound2 = DisplayCutout.BOUNDS_POSITION_RIGHT,
+ roundedCornerResDelegate = roundedCornerResDelegate,
+ ),
+ )
+ hasTop ->
+ listOf(
+ RoundedCornerDecorProviderImpl(
+ viewId = R.id.rounded_corner_top_left,
+ alignedBound1 = DisplayCutout.BOUNDS_POSITION_TOP,
+ alignedBound2 = DisplayCutout.BOUNDS_POSITION_LEFT,
+ roundedCornerResDelegate = roundedCornerResDelegate,
+ ),
+ RoundedCornerDecorProviderImpl(
+ viewId = R.id.rounded_corner_top_right,
+ alignedBound1 = DisplayCutout.BOUNDS_POSITION_TOP,
+ alignedBound2 = DisplayCutout.BOUNDS_POSITION_RIGHT,
+ roundedCornerResDelegate = roundedCornerResDelegate,
+ ),
+ )
+ hasBottom ->
+ listOf(
+ RoundedCornerDecorProviderImpl(
+ viewId = R.id.rounded_corner_bottom_left,
+ alignedBound1 = DisplayCutout.BOUNDS_POSITION_BOTTOM,
+ alignedBound2 = DisplayCutout.BOUNDS_POSITION_LEFT,
+ roundedCornerResDelegate = roundedCornerResDelegate,
+ ),
+ RoundedCornerDecorProviderImpl(
+ viewId = R.id.rounded_corner_bottom_right,
+ alignedBound1 = DisplayCutout.BOUNDS_POSITION_BOTTOM,
+ alignedBound2 = DisplayCutout.BOUNDS_POSITION_RIGHT,
+ roundedCornerResDelegate = roundedCornerResDelegate,
+ ),
+ )
+ else -> emptyList()
+ }
}
- }
-} \ No newline at end of file
+}
diff --git a/packages/SystemUI/src/com/android/systemui/display/data/repository/DeviceStateRepository.kt b/packages/SystemUI/src/com/android/systemui/display/data/repository/DeviceStateRepository.kt
index fa7603ff777c..1da5351ac2a3 100644
--- a/packages/SystemUI/src/com/android/systemui/display/data/repository/DeviceStateRepository.kt
+++ b/packages/SystemUI/src/com/android/systemui/display/data/repository/DeviceStateRepository.kt
@@ -17,7 +17,14 @@
package com.android.systemui.display.data.repository
import android.content.Context
+import android.hardware.devicestate.DeviceState as PlatformDeviceState
+import android.hardware.devicestate.DeviceState.PROPERTY_FEATURE_DUAL_DISPLAY_INTERNAL_DEFAULT
+import android.hardware.devicestate.DeviceState.PROPERTY_FEATURE_REAR_DISPLAY
+import android.hardware.devicestate.DeviceState.PROPERTY_FOLDABLE_DISPLAY_CONFIGURATION_INNER_PRIMARY
+import android.hardware.devicestate.DeviceState.PROPERTY_FOLDABLE_DISPLAY_CONFIGURATION_OUTER_PRIMARY
+import android.hardware.devicestate.DeviceState.PROPERTY_FOLDABLE_HARDWARE_CONFIGURATION_FOLD_IN_HALF_OPEN
import android.hardware.devicestate.DeviceStateManager
+import android.hardware.devicestate.feature.flags.Flags as DeviceStateManagerFlags
import com.android.internal.R
import com.android.systemui.common.coroutine.ConflatedCallbackFlow.conflatedCallbackFlow
import com.android.systemui.dagger.qualifiers.Background
@@ -34,15 +41,15 @@ interface DeviceStateRepository {
val state: StateFlow<DeviceState>
enum class DeviceState {
- /** Device state in [R.array.config_foldedDeviceStates] */
+ /** Device state that corresponds to the device being folded */
FOLDED,
- /** Device state in [R.array.config_halfFoldedDeviceStates] */
+ /** Device state that corresponds to the device being half-folded */
HALF_FOLDED,
- /** Device state in [R.array.config_openDeviceStates] */
+ /** Device state in that corresponds to the device being unfolded */
UNFOLDED,
- /** Device state in [R.array.config_rearDisplayDeviceStates] */
+ /** Device state that corresponds to the device being in rear display mode */
REAR_DISPLAY,
- /** Device state in [R.array.config_concurrentDisplayDeviceStates] */
+ /** Device state in that corresponds to the device being in concurrent display mode */
CONCURRENT_DISPLAY,
/** Device state in none of the other arrays. */
UNKNOWN,
@@ -52,8 +59,8 @@ interface DeviceStateRepository {
class DeviceStateRepositoryImpl
@Inject
constructor(
- context: Context,
- deviceStateManager: DeviceStateManager,
+ val context: Context,
+ val deviceStateManager: DeviceStateManager,
@Background bgScope: CoroutineScope,
@Background executor: Executor
) : DeviceStateRepository {
@@ -70,11 +77,17 @@ constructor(
.stateIn(bgScope, started = SharingStarted.WhileSubscribed(), DeviceState.UNKNOWN)
private fun deviceStateToPosture(deviceStateId: Int): DeviceState {
- return deviceStateMap.firstOrNull { (ids, _) -> deviceStateId in ids }?.deviceState
- ?: DeviceState.UNKNOWN
+ return if (DeviceStateManagerFlags.deviceStatePropertyMigration()) {
+ deviceStateManager.supportedDeviceStates
+ .firstOrNull { it.identifier == deviceStateId }
+ ?.toDeviceStateEnum() ?: DeviceState.UNKNOWN
+ } else {
+ deviceStateMap.firstOrNull { (ids, _) -> deviceStateId in ids }?.deviceState
+ ?: DeviceState.UNKNOWN
+ }
}
- private val deviceStateMap =
+ private val deviceStateMap: List<IdsPerDeviceState> =
listOf(
R.array.config_foldedDeviceStates to DeviceState.FOLDED,
R.array.config_halfFoldedDeviceStates to DeviceState.HALF_FOLDED,
@@ -85,4 +98,26 @@ constructor(
.map { IdsPerDeviceState(context.resources.getIntArray(it.first).toSet(), it.second) }
private data class IdsPerDeviceState(val ids: Set<Int>, val deviceState: DeviceState)
+
+ /**
+ * Maps a [PlatformDeviceState] to the corresponding [DeviceState] value based on the properties
+ * of the state.
+ */
+ private fun PlatformDeviceState.toDeviceStateEnum(): DeviceState {
+ return when {
+ hasProperty(PROPERTY_FEATURE_REAR_DISPLAY) -> DeviceState.REAR_DISPLAY
+ hasProperty(PROPERTY_FEATURE_DUAL_DISPLAY_INTERNAL_DEFAULT) -> {
+ DeviceState.CONCURRENT_DISPLAY
+ }
+ hasProperty(PROPERTY_FOLDABLE_DISPLAY_CONFIGURATION_OUTER_PRIMARY) -> DeviceState.FOLDED
+ hasProperties(
+ PROPERTY_FOLDABLE_DISPLAY_CONFIGURATION_INNER_PRIMARY,
+ PROPERTY_FOLDABLE_HARDWARE_CONFIGURATION_FOLD_IN_HALF_OPEN
+ ) -> DeviceState.HALF_FOLDED
+ hasProperty(PROPERTY_FOLDABLE_DISPLAY_CONFIGURATION_INNER_PRIMARY) -> {
+ DeviceState.UNFOLDED
+ }
+ else -> DeviceState.UNKNOWN
+ }
+ }
}
diff --git a/packages/SystemUI/src/com/android/systemui/display/data/repository/PerDisplayStore.kt b/packages/SystemUI/src/com/android/systemui/display/data/repository/PerDisplayStore.kt
new file mode 100644
index 000000000000..2ce3e43389fa
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/display/data/repository/PerDisplayStore.kt
@@ -0,0 +1,108 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.systemui.display.data.repository
+
+import android.view.Display
+import com.android.systemui.CoreStartable
+import com.android.systemui.dagger.qualifiers.Background
+import java.io.PrintWriter
+import java.util.concurrent.ConcurrentHashMap
+import kotlinx.coroutines.CoroutineName
+import kotlinx.coroutines.CoroutineScope
+import kotlinx.coroutines.launch
+
+/** Provides per display instances of [T]. */
+interface PerDisplayStore<T> {
+
+ /**
+ * The instance for the default/main display of the device. For example, on a phone or a tablet,
+ * the default display is the internal/built-in display of the device.
+ *
+ * Note that the id of the default display is [Display.DEFAULT_DISPLAY].
+ */
+ val defaultDisplay: T
+
+ /**
+ * Returns an instance for a specific display id.
+ *
+ * @throws IllegalArgumentException if [displayId] doesn't match the id of any existing
+ * displays.
+ */
+ fun forDisplay(displayId: Int): T
+}
+
+abstract class PerDisplayStoreImpl<T>(
+ @Background private val backgroundApplicationScope: CoroutineScope,
+ private val displayRepository: DisplayRepository,
+) : PerDisplayStore<T>, CoreStartable {
+
+ private val perDisplayInstances = ConcurrentHashMap<Int, T>()
+
+ /**
+ * The instance for the default/main display of the device. For example, on a phone or a tablet,
+ * the default display is the internal/built-in display of the device.
+ *
+ * Note that the id of the default display is [Display.DEFAULT_DISPLAY].
+ */
+ override val defaultDisplay: T
+ get() = forDisplay(Display.DEFAULT_DISPLAY)
+
+ /**
+ * Returns an instance for a specific display id.
+ *
+ * @throws IllegalArgumentException if [displayId] doesn't match the id of any existing
+ * displays.
+ */
+ override fun forDisplay(displayId: Int): T {
+ if (displayRepository.getDisplay(displayId) == null) {
+ throw IllegalArgumentException("Display with id $displayId doesn't exist.")
+ }
+ return perDisplayInstances.computeIfAbsent(displayId) {
+ createInstanceForDisplay(displayId)
+ }
+ }
+
+ abstract fun createInstanceForDisplay(displayId: Int): T
+
+ override fun start() {
+ val instanceType = instanceClass.simpleName
+ backgroundApplicationScope.launch(CoroutineName("PerDisplayStore#<$instanceType>start")) {
+ displayRepository.displayRemovalEvent.collect { removedDisplayId ->
+ val removedInstance = perDisplayInstances.remove(removedDisplayId)
+ removedInstance?.let { onDisplayRemovalAction(it) }
+ }
+ }
+ }
+
+ abstract val instanceClass: Class<T>
+
+ /**
+ * Will be called when the display associated with [instance] was removed. It allows to perform
+ * any clean up if needed.
+ */
+ open suspend fun onDisplayRemovalAction(instance: T) {}
+
+ override fun dump(pw: PrintWriter, args: Array<out String>) {
+ pw.println(perDisplayInstances)
+ }
+}
+
+class SingleDisplayStore<T>(defaultInstance: T) : PerDisplayStore<T> {
+ override val defaultDisplay: T = defaultInstance
+
+ override fun forDisplay(displayId: Int): T = defaultDisplay
+}
diff --git a/packages/SystemUI/src/com/android/systemui/education/dagger/ContextualEducationModule.kt b/packages/SystemUI/src/com/android/systemui/education/dagger/ContextualEducationModule.kt
index 7fa7da192ad0..abe0289baec8 100644
--- a/packages/SystemUI/src/com/android/systemui/education/dagger/ContextualEducationModule.kt
+++ b/packages/SystemUI/src/com/android/systemui/education/dagger/ContextualEducationModule.kt
@@ -18,15 +18,12 @@ package com.android.systemui.education.dagger
import com.android.systemui.CoreStartable
import com.android.systemui.Flags
-import com.android.systemui.contextualeducation.GestureType
import com.android.systemui.coroutines.newTracingContext
import com.android.systemui.dagger.qualifiers.Background
import com.android.systemui.education.data.repository.ContextualEducationRepository
import com.android.systemui.education.data.repository.UserContextualEducationRepository
import com.android.systemui.education.domain.interactor.ContextualEducationInteractor
import com.android.systemui.education.domain.interactor.KeyboardTouchpadEduInteractor
-import com.android.systemui.education.domain.interactor.KeyboardTouchpadEduStatsInteractor
-import com.android.systemui.education.domain.interactor.KeyboardTouchpadEduStatsInteractorImpl
import com.android.systemui.education.ui.view.ContextualEduUiCoordinator
import dagger.Binds
import dagger.Lazy
@@ -83,18 +80,6 @@ interface ContextualEducationModule {
}
@Provides
- fun provideKeyboardTouchpadEduStatsInteractor(
- implLazy: Lazy<KeyboardTouchpadEduStatsInteractorImpl>
- ): KeyboardTouchpadEduStatsInteractor {
- return if (Flags.keyboardTouchpadContextualEducation()) {
- implLazy.get()
- } else {
- // No-op implementation when the flag is disabled.
- return NoOpKeyboardTouchpadEduStatsInteractor
- }
- }
-
- @Provides
@IntoMap
@ClassKey(KeyboardTouchpadEduInteractor::class)
fun provideKeyboardTouchpadEduInteractor(
@@ -124,12 +109,6 @@ interface ContextualEducationModule {
}
}
-private object NoOpKeyboardTouchpadEduStatsInteractor : KeyboardTouchpadEduStatsInteractor {
- override fun incrementSignalCount(gestureType: GestureType) {}
-
- override fun updateShortcutTriggerTime(gestureType: GestureType) {}
-}
-
private object NoOpCoreStartable : CoreStartable {
override fun start() {}
}
diff --git a/packages/SystemUI/src/com/android/systemui/education/domain/interactor/KeyboardTouchpadEduInteractor.kt b/packages/SystemUI/src/com/android/systemui/education/domain/interactor/KeyboardTouchpadEduInteractor.kt
index faee32694964..c17f3fb6dfe4 100644
--- a/packages/SystemUI/src/com/android/systemui/education/domain/interactor/KeyboardTouchpadEduInteractor.kt
+++ b/packages/SystemUI/src/com/android/systemui/education/domain/interactor/KeyboardTouchpadEduInteractor.kt
@@ -18,6 +18,9 @@ package com.android.systemui.education.domain.interactor
import android.os.SystemProperties
import com.android.systemui.CoreStartable
+import com.android.systemui.common.coroutine.ChannelExt.trySendWithFailureLogging
+import com.android.systemui.contextualeducation.GestureType
+import com.android.systemui.contextualeducation.GestureType.ALL_APPS
import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.dagger.qualifiers.Background
import com.android.systemui.education.dagger.ContextualEducationModule.EduClock
@@ -25,6 +28,13 @@ import com.android.systemui.education.data.model.GestureEduModel
import com.android.systemui.education.shared.model.EducationInfo
import com.android.systemui.education.shared.model.EducationUiType
import com.android.systemui.inputdevice.data.repository.UserInputDeviceRepository
+import com.android.systemui.inputdevice.tutorial.data.repository.DeviceType
+import com.android.systemui.inputdevice.tutorial.data.repository.DeviceType.KEYBOARD
+import com.android.systemui.inputdevice.tutorial.data.repository.DeviceType.TOUCHPAD
+import com.android.systemui.inputdevice.tutorial.data.repository.TutorialSchedulerRepository
+import com.android.systemui.recents.OverviewProxyService
+import com.android.systemui.recents.OverviewProxyService.OverviewProxyListener
+import com.android.systemui.utils.coroutines.flow.conflatedCallbackFlow
import java.time.Clock
import javax.inject.Inject
import kotlin.time.Duration
@@ -33,9 +43,11 @@ import kotlin.time.DurationUnit
import kotlin.time.toDuration
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.ExperimentalCoroutinesApi
+import kotlinx.coroutines.channels.awaitClose
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.asStateFlow
+import kotlinx.coroutines.flow.first
import kotlinx.coroutines.flow.flatMapLatest
import kotlinx.coroutines.flow.merge
import kotlinx.coroutines.launch
@@ -48,6 +60,8 @@ constructor(
@Background private val backgroundScope: CoroutineScope,
private val contextualEducationInteractor: ContextualEducationInteractor,
private val userInputDeviceRepository: UserInputDeviceRepository,
+ private val tutorialRepository: TutorialSchedulerRepository,
+ private val overviewProxyService: OverviewProxyService,
@EduClock private val clock: Clock,
) : CoreStartable {
@@ -59,14 +73,16 @@ constructor(
getDurationForConfig("persist.contextual_edu.usage_session_sec", 3.days)
val minIntervalBetweenEdu =
getDurationForConfig("persist.contextual_edu.edu_interval_sec", 7.days)
+ val initialDelayDuration =
+ getDurationForConfig("persist.contextual_edu.initial_delay_sec", 7.days)
private fun getDurationForConfig(
systemPropertyKey: String,
- defaultDuration: Duration
+ defaultDuration: Duration,
): Duration =
SystemProperties.getLong(
systemPropertyKey,
- /* defaultValue= */ defaultDuration.inWholeSeconds
+ /* defaultValue= */ defaultDuration.inWholeSeconds,
)
.toDuration(DurationUnit.SECONDS)
}
@@ -74,6 +90,24 @@ constructor(
private val _educationTriggered = MutableStateFlow<EducationInfo?>(null)
val educationTriggered = _educationTriggered.asStateFlow()
+ private val statsUpdateRequests: Flow<StatsUpdateRequest> = conflatedCallbackFlow {
+ val listener: OverviewProxyListener =
+ object : OverviewProxyListener {
+ override fun updateContextualEduStats(
+ isTrackpadGesture: Boolean,
+ gestureType: GestureType,
+ ) {
+ trySendWithFailureLogging(
+ StatsUpdateRequest(isTrackpadGesture, gestureType),
+ TAG,
+ )
+ }
+ }
+
+ overviewProxyService.addCallback(listener)
+ awaitClose { overviewProxyService.removeCallback(listener) }
+ }
+
@OptIn(ExperimentalCoroutinesApi::class)
override fun start() {
backgroundScope.launch {
@@ -133,6 +167,16 @@ constructor(
contextualEducationInteractor.updateShortcutTriggerTime(it)
}
}
+
+ backgroundScope.launch {
+ statsUpdateRequests.collect {
+ if (it.isTrackpadGesture) {
+ contextualEducationInteractor.updateShortcutTriggerTime(it.gestureType)
+ } else {
+ incrementSignalCount(it.gestureType)
+ }
+ }
+ }
}
private fun isEducationNeeded(model: GestureEduModel): Boolean {
@@ -160,4 +204,41 @@ constructor(
private fun getEduType(model: GestureEduModel) =
if (model.educationShownCount > 0) EducationUiType.Notification else EducationUiType.Toast
+
+ private suspend fun incrementSignalCount(gestureType: GestureType) {
+ val targetDevice = getTargetDevice(gestureType)
+ if (isTargetDeviceConnected(targetDevice) && hasInitialDelayElapsed(targetDevice)) {
+ contextualEducationInteractor.incrementSignalCount(gestureType)
+ }
+ }
+
+ private suspend fun isTargetDeviceConnected(deviceType: DeviceType): Boolean {
+ return when (deviceType) {
+ KEYBOARD -> userInputDeviceRepository.isAnyKeyboardConnectedForUser.first().isConnected
+ TOUCHPAD -> userInputDeviceRepository.isAnyTouchpadConnectedForUser.first().isConnected
+ }
+ }
+
+ /**
+ * Keyboard shortcut education would be provided for All Apps. Touchpad gesture education would
+ * be provided for the rest of the gesture types (i.e. Home, Overview, Back). This method maps
+ * gesture to its target education device.
+ */
+ private fun getTargetDevice(gestureType: GestureType) =
+ when (gestureType) {
+ ALL_APPS -> KEYBOARD
+ else -> TOUCHPAD
+ }
+
+ private suspend fun hasInitialDelayElapsed(deviceType: DeviceType): Boolean {
+ val oobeLaunchTime = tutorialRepository.launchTime(deviceType) ?: return false
+ return clock
+ .instant()
+ .isAfter(oobeLaunchTime.plusSeconds(initialDelayDuration.inWholeSeconds))
+ }
+
+ private data class StatsUpdateRequest(
+ val isTrackpadGesture: Boolean,
+ val gestureType: GestureType,
+ )
}
diff --git a/packages/SystemUI/src/com/android/systemui/education/domain/interactor/KeyboardTouchpadEduStatsInteractor.kt b/packages/SystemUI/src/com/android/systemui/education/domain/interactor/KeyboardTouchpadEduStatsInteractor.kt
deleted file mode 100644
index 43e39cf08e01..000000000000
--- a/packages/SystemUI/src/com/android/systemui/education/domain/interactor/KeyboardTouchpadEduStatsInteractor.kt
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * Copyright 2024 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.systemui.education.domain.interactor
-
-import android.os.SystemProperties
-import com.android.systemui.contextualeducation.GestureType
-import com.android.systemui.contextualeducation.GestureType.ALL_APPS
-import com.android.systemui.dagger.SysUISingleton
-import com.android.systemui.dagger.qualifiers.Background
-import com.android.systemui.education.dagger.ContextualEducationModule.EduClock
-import com.android.systemui.inputdevice.data.repository.UserInputDeviceRepository
-import com.android.systemui.inputdevice.tutorial.data.repository.DeviceType
-import com.android.systemui.inputdevice.tutorial.data.repository.DeviceType.KEYBOARD
-import com.android.systemui.inputdevice.tutorial.data.repository.DeviceType.TOUCHPAD
-import com.android.systemui.inputdevice.tutorial.data.repository.TutorialSchedulerRepository
-import java.time.Clock
-import javax.inject.Inject
-import kotlin.time.Duration
-import kotlin.time.Duration.Companion.days
-import kotlin.time.DurationUnit
-import kotlin.time.toDuration
-import kotlinx.coroutines.CoroutineScope
-import kotlinx.coroutines.flow.first
-import kotlinx.coroutines.launch
-
-/**
- * Encapsulates the update functions of KeyboardTouchpadEduStatsInteractor. This encapsulation is
- * for having a different implementation of interactor when the feature flag is off.
- */
-interface KeyboardTouchpadEduStatsInteractor {
- fun incrementSignalCount(gestureType: GestureType)
-
- fun updateShortcutTriggerTime(gestureType: GestureType)
-}
-
-/** Allow update to education data related to keyboard/touchpad. */
-@SysUISingleton
-class KeyboardTouchpadEduStatsInteractorImpl
-@Inject
-constructor(
- @Background private val backgroundScope: CoroutineScope,
- private val contextualEducationInteractor: ContextualEducationInteractor,
- private val inputDeviceRepository: UserInputDeviceRepository,
- private val tutorialRepository: TutorialSchedulerRepository,
- @EduClock private val clock: Clock,
-) : KeyboardTouchpadEduStatsInteractor {
-
- companion object {
- val initialDelayDuration: Duration
- get() =
- SystemProperties.getLong(
- "persist.contextual_edu.initial_delay_sec",
- /* defaultValue= */ 7.days.inWholeSeconds,
- )
- .toDuration(DurationUnit.SECONDS)
- }
-
- override fun incrementSignalCount(gestureType: GestureType) {
- backgroundScope.launch {
- val targetDevice = getTargetDevice(gestureType)
- if (isTargetDeviceConnected(targetDevice) && hasInitialDelayElapsed(targetDevice)) {
- contextualEducationInteractor.incrementSignalCount(gestureType)
- }
- }
- }
-
- override fun updateShortcutTriggerTime(gestureType: GestureType) {
- backgroundScope.launch {
- contextualEducationInteractor.updateShortcutTriggerTime(gestureType)
- }
- }
-
- private suspend fun isTargetDeviceConnected(deviceType: DeviceType): Boolean {
- return when (deviceType) {
- KEYBOARD -> inputDeviceRepository.isAnyKeyboardConnectedForUser.first().isConnected
- TOUCHPAD -> inputDeviceRepository.isAnyTouchpadConnectedForUser.first().isConnected
- }
- }
-
- /**
- * Keyboard shortcut education would be provided for All Apps. Touchpad gesture education would
- * be provided for the rest of the gesture types (i.e. Home, Overview, Back). This method maps
- * gesture to its target education device.
- */
- private fun getTargetDevice(gestureType: GestureType) =
- when (gestureType) {
- ALL_APPS -> KEYBOARD
- else -> TOUCHPAD
- }
-
- private suspend fun hasInitialDelayElapsed(deviceType: DeviceType): Boolean {
- val oobeLaunchTime = tutorialRepository.launchTime(deviceType) ?: return false
- return clock
- .instant()
- .isAfter(oobeLaunchTime.plusSeconds(initialDelayDuration.inWholeSeconds))
- }
-}
diff --git a/packages/SystemUI/src/com/android/systemui/education/ui/view/ContextualEduDialog.kt b/packages/SystemUI/src/com/android/systemui/education/ui/view/ContextualEduDialog.kt
index ca92953dca4a..1439ecde3bfd 100644
--- a/packages/SystemUI/src/com/android/systemui/education/ui/view/ContextualEduDialog.kt
+++ b/packages/SystemUI/src/com/android/systemui/education/ui/view/ContextualEduDialog.kt
@@ -22,13 +22,18 @@ import android.os.Bundle
import android.view.Gravity
import android.view.Window
import android.view.WindowManager
+import android.view.accessibility.AccessibilityEvent
+import android.view.accessibility.AccessibilityManager
import android.widget.ImageView
import android.widget.TextView
import com.android.systemui.education.ui.viewmodel.ContextualEduToastViewModel
import com.android.systemui.res.R
-class ContextualEduDialog(context: Context, private val model: ContextualEduToastViewModel) :
- Dialog(context) {
+class ContextualEduDialog(
+ context: Context,
+ private val model: ContextualEduToastViewModel,
+ private val accessibilityManager: AccessibilityManager,
+) : Dialog(context) {
override fun onCreate(savedInstanceState: Bundle?) {
setUpWindowProperties()
setWindowPosition()
@@ -36,6 +41,7 @@ class ContextualEduDialog(context: Context, private val model: ContextualEduToas
window?.setTitle(context.getString(R.string.contextual_education_dialog_title))
setContentView(R.layout.contextual_edu_dialog)
setContent()
+ sendAccessibilityEvent()
super.onCreate(savedInstanceState)
}
@@ -44,10 +50,30 @@ class ContextualEduDialog(context: Context, private val model: ContextualEduToas
findViewById<ImageView>(R.id.edu_icon)?.let { it.setImageResource(model.icon) }
}
+ private fun sendAccessibilityEvent() {
+ if (!accessibilityManager.isEnabled) {
+ return
+ }
+
+ // It is a toast-like dialog which is unobtrusive and not focusable. So it needs to call
+ // accessibilityManager.sendAccessibilityEvent explicitly to announce the message.
+ accessibilityManager.sendAccessibilityEvent(
+ AccessibilityEvent(AccessibilityEvent.TYPE_ANNOUNCEMENT).apply {
+ text.add(model.message)
+ }
+ )
+ }
+
private fun setUpWindowProperties() {
window?.apply {
requestFeature(Window.FEATURE_NO_TITLE)
setType(WindowManager.LayoutParams.TYPE_SYSTEM_DIALOG)
+ // NOT_TOUCH_MODAL allows users to interact with background elements and NOT_FOCUSABLE
+ // avoids changing the existing focus when dialog is shown.
+ addFlags(
+ WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL or
+ WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE
+ )
clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND)
setBackgroundDrawableResource(android.R.color.transparent)
}
diff --git a/packages/SystemUI/src/com/android/systemui/education/ui/view/ContextualEduUiCoordinator.kt b/packages/SystemUI/src/com/android/systemui/education/ui/view/ContextualEduUiCoordinator.kt
index 913ecdd4aadc..1996efa14d7c 100644
--- a/packages/SystemUI/src/com/android/systemui/education/ui/view/ContextualEduUiCoordinator.kt
+++ b/packages/SystemUI/src/com/android/systemui/education/ui/view/ContextualEduUiCoordinator.kt
@@ -25,6 +25,7 @@ import android.content.Context
import android.content.Intent
import android.os.Bundle
import android.os.UserHandle
+import android.view.accessibility.AccessibilityManager
import androidx.core.app.NotificationCompat
import com.android.systemui.CoreStartable
import com.android.systemui.dagger.SysUISingleton
@@ -64,12 +65,13 @@ constructor(
context: Context,
viewModel: ContextualEduViewModel,
notificationManager: NotificationManager,
+ accessibilityManager: AccessibilityManager,
) : this(
applicationScope,
viewModel,
context,
notificationManager,
- createDialog = { model -> ContextualEduDialog(context, model) },
+ createDialog = { model -> ContextualEduDialog(context, model, accessibilityManager) },
)
var dialog: Dialog? = null
diff --git a/packages/SystemUI/src/com/android/systemui/inputdevice/tutorial/ui/composable/ActionTutorialContent.kt b/packages/SystemUI/src/com/android/systemui/inputdevice/tutorial/ui/composable/ActionTutorialContent.kt
index 73975a088d90..8e01e3765c32 100644
--- a/packages/SystemUI/src/com/android/systemui/inputdevice/tutorial/ui/composable/ActionTutorialContent.kt
+++ b/packages/SystemUI/src/com/android/systemui/inputdevice/tutorial/ui/composable/ActionTutorialContent.kt
@@ -16,24 +16,11 @@
package com.android.systemui.inputdevice.tutorial.ui.composable
-import android.graphics.ColorFilter
-import android.graphics.PorterDuff
-import android.graphics.PorterDuffColorFilter
-import androidx.annotation.RawRes
import androidx.annotation.StringRes
-import androidx.compose.animation.AnimatedContent
import androidx.compose.animation.AnimatedVisibility
-import androidx.compose.animation.EnterTransition
-import androidx.compose.animation.ExitTransition
-import androidx.compose.animation.core.LinearEasing
-import androidx.compose.animation.core.snap
-import androidx.compose.animation.core.tween
import androidx.compose.animation.fadeIn
-import androidx.compose.animation.fadeOut
-import androidx.compose.animation.togetherWith
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Arrangement
-import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
@@ -46,29 +33,20 @@ import androidx.compose.foundation.layout.width
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
-import androidx.compose.runtime.getValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
-import androidx.compose.ui.graphics.toArgb
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
-import com.airbnb.lottie.LottieProperty
-import com.airbnb.lottie.compose.LottieAnimation
-import com.airbnb.lottie.compose.LottieCompositionSpec
-import com.airbnb.lottie.compose.LottieConstants
-import com.airbnb.lottie.compose.LottieDynamicProperties
-import com.airbnb.lottie.compose.LottieDynamicProperty
-import com.airbnb.lottie.compose.animateLottieCompositionAsState
-import com.airbnb.lottie.compose.rememberLottieComposition
-import com.airbnb.lottie.compose.rememberLottieDynamicProperty
import com.android.systemui.inputdevice.tutorial.ui.composable.TutorialActionState.Finished
-import com.android.systemui.inputdevice.tutorial.ui.composable.TutorialActionState.InProgress
-import com.android.systemui.inputdevice.tutorial.ui.composable.TutorialActionState.NotStarted
sealed interface TutorialActionState {
data object NotStarted : TutorialActionState
- data class InProgress(val progress: Float = 0f) : TutorialActionState
+ data class InProgress(
+ val progress: Float = 0f,
+ val startMarker: String? = null,
+ val endMarker: String? = null,
+ ) : TutorialActionState
data object Finished : TutorialActionState
}
@@ -132,104 +110,3 @@ fun TutorialDescription(
)
}
}
-
-@Composable
-fun TutorialAnimation(
- actionState: TutorialActionState,
- config: TutorialScreenConfig,
- modifier: Modifier = Modifier,
-) {
- Box(modifier = modifier.fillMaxWidth()) {
- AnimatedContent(
- targetState = actionState,
- transitionSpec = {
- if (initialState == NotStarted) {
- val transitionDurationMillis = 150
- fadeIn(animationSpec = tween(transitionDurationMillis, easing = LinearEasing))
- .togetherWith(
- fadeOut(animationSpec = snap(delayMillis = transitionDurationMillis))
- )
- // we explicitly don't want size transform because when targetState
- // animation is loaded for the first time, AnimatedContent thinks target
- // size is smaller and tries to shrink initial state animation
- .using(sizeTransform = null)
- } else {
- // empty transition works because all remaining transitions are from IN_PROGRESS
- // state which shares initial animation frame with both FINISHED and NOT_STARTED
- EnterTransition.None togetherWith ExitTransition.None
- }
- },
- ) { state ->
- when (state) {
- NotStarted ->
- EducationAnimation(
- config.animations.educationResId,
- config.colors.animationColors,
- )
- is InProgress ->
- FrozenSuccessAnimation(
- config.animations.successResId,
- config.colors.animationColors,
- )
- Finished ->
- SuccessAnimation(config.animations.successResId, config.colors.animationColors)
- }
- }
- }
-}
-
-@Composable
-private fun FrozenSuccessAnimation(
- @RawRes successAnimationId: Int,
- animationProperties: LottieDynamicProperties,
-) {
- val composition by rememberLottieComposition(LottieCompositionSpec.RawRes(successAnimationId))
- LottieAnimation(
- composition = composition,
- progress = { 0f }, // animation should freeze on 1st frame
- dynamicProperties = animationProperties,
- )
-}
-
-@Composable
-private fun EducationAnimation(
- @RawRes educationAnimationId: Int,
- animationProperties: LottieDynamicProperties,
-) {
- val composition by rememberLottieComposition(LottieCompositionSpec.RawRes(educationAnimationId))
- val progress by
- animateLottieCompositionAsState(composition, iterations = LottieConstants.IterateForever)
- LottieAnimation(
- composition = composition,
- progress = { progress },
- dynamicProperties = animationProperties,
- )
-}
-
-@Composable
-private fun SuccessAnimation(
- @RawRes successAnimationId: Int,
- animationProperties: LottieDynamicProperties,
-) {
- val composition by rememberLottieComposition(LottieCompositionSpec.RawRes(successAnimationId))
- val progress by animateLottieCompositionAsState(composition, iterations = 1)
- LottieAnimation(
- composition = composition,
- progress = { progress },
- dynamicProperties = animationProperties,
- )
-}
-
-@Composable
-fun rememberColorFilterProperty(
- layerName: String,
- color: Color,
-): LottieDynamicProperty<ColorFilter> {
- return rememberLottieDynamicProperty(
- LottieProperty.COLOR_FILTER,
- value = PorterDuffColorFilter(color.toArgb(), PorterDuff.Mode.SRC_ATOP),
- // "**" below means match zero or more layers, so ** layerName ** means find layer with that
- // name at any depth
- keyPath = arrayOf("**", layerName, "**"),
- )
-}
diff --git a/packages/SystemUI/src/com/android/systemui/inputdevice/tutorial/ui/composable/LottieHelpers.kt b/packages/SystemUI/src/com/android/systemui/inputdevice/tutorial/ui/composable/LottieHelpers.kt
new file mode 100644
index 000000000000..94b3d9f577e2
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/inputdevice/tutorial/ui/composable/LottieHelpers.kt
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.systemui.inputdevice.tutorial.ui.composable
+
+import android.graphics.ColorFilter
+import android.graphics.PorterDuff
+import android.graphics.PorterDuffColorFilter
+import androidx.compose.runtime.Composable
+import androidx.compose.ui.graphics.Color
+import androidx.compose.ui.graphics.toArgb
+import com.airbnb.lottie.LottieProperty
+import com.airbnb.lottie.compose.LottieDynamicProperty
+import com.airbnb.lottie.compose.rememberLottieDynamicProperty
+
+@Composable
+fun rememberColorFilterProperty(
+ layerName: String,
+ color: Color,
+): LottieDynamicProperty<ColorFilter> {
+ return rememberLottieDynamicProperty(
+ LottieProperty.COLOR_FILTER,
+ value = PorterDuffColorFilter(color.toArgb(), PorterDuff.Mode.SRC_ATOP),
+ // "**" below means match zero or more layers, so ** layerName ** means find layer with that
+ // name at any depth
+ keyPath = arrayOf("**", layerName, "**"),
+ )
+}
diff --git a/packages/SystemUI/src/com/android/systemui/inputdevice/tutorial/ui/composable/TutorialAnimation.kt b/packages/SystemUI/src/com/android/systemui/inputdevice/tutorial/ui/composable/TutorialAnimation.kt
new file mode 100644
index 000000000000..ef375a868cef
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/inputdevice/tutorial/ui/composable/TutorialAnimation.kt
@@ -0,0 +1,149 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.systemui.inputdevice.tutorial.ui.composable
+
+import androidx.annotation.RawRes
+import androidx.compose.animation.AnimatedContent
+import androidx.compose.animation.EnterTransition
+import androidx.compose.animation.core.LinearEasing
+import androidx.compose.animation.core.tween
+import androidx.compose.animation.fadeOut
+import androidx.compose.animation.togetherWith
+import androidx.compose.foundation.layout.Box
+import androidx.compose.foundation.layout.fillMaxWidth
+import androidx.compose.runtime.Composable
+import androidx.compose.runtime.getValue
+import androidx.compose.runtime.remember
+import androidx.compose.runtime.saveable.rememberSaveable
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.node.Ref
+import androidx.compose.ui.util.lerp
+import com.airbnb.lottie.LottieComposition
+import com.airbnb.lottie.compose.LottieAnimation
+import com.airbnb.lottie.compose.LottieCompositionSpec
+import com.airbnb.lottie.compose.LottieConstants
+import com.airbnb.lottie.compose.LottieDynamicProperties
+import com.airbnb.lottie.compose.animateLottieCompositionAsState
+import com.airbnb.lottie.compose.rememberLottieComposition
+import com.android.systemui.inputdevice.tutorial.ui.composable.TutorialActionState.Finished
+import com.android.systemui.inputdevice.tutorial.ui.composable.TutorialActionState.InProgress
+import com.android.systemui.inputdevice.tutorial.ui.composable.TutorialActionState.NotStarted
+
+@Composable
+fun TutorialAnimation(
+ actionState: TutorialActionState,
+ config: TutorialScreenConfig,
+ modifier: Modifier = Modifier,
+) {
+ Box(modifier = modifier.fillMaxWidth()) {
+ AnimatedContent(
+ targetState = actionState::class,
+ transitionSpec = {
+ EnterTransition.None.togetherWith(
+ fadeOut(animationSpec = tween(durationMillis = 10, easing = LinearEasing))
+ )
+ // we don't want size transform because when targetState animation is loaded for
+ // the first time, AnimatedContent thinks target size is smaller and tries to
+ // shrink initial state
+ .using(sizeTransform = null)
+ },
+ ) { state ->
+ when (state) {
+ NotStarted::class ->
+ EducationAnimation(
+ config.animations.educationResId,
+ config.colors.animationColors,
+ )
+ InProgress::class ->
+ InProgressAnimation(
+ // actionState can be already of different class while this composable is
+ // transitioning to another one
+ actionState as? InProgress,
+ config.animations.educationResId,
+ config.colors.animationColors,
+ )
+ Finished::class ->
+ SuccessAnimation(config.animations.successResId, config.colors.animationColors)
+ }
+ }
+ }
+}
+
+@Composable
+private fun EducationAnimation(
+ @RawRes educationAnimationId: Int,
+ animationProperties: LottieDynamicProperties,
+) {
+ val composition by rememberLottieComposition(LottieCompositionSpec.RawRes(educationAnimationId))
+ val progress by
+ animateLottieCompositionAsState(composition, iterations = LottieConstants.IterateForever)
+ LottieAnimation(
+ composition = composition,
+ progress = { progress },
+ dynamicProperties = animationProperties,
+ )
+}
+
+@Composable
+private fun SuccessAnimation(
+ @RawRes successAnimationId: Int,
+ animationProperties: LottieDynamicProperties,
+) {
+ val composition by rememberLottieComposition(LottieCompositionSpec.RawRes(successAnimationId))
+ val progress by animateLottieCompositionAsState(composition, iterations = 1)
+ LottieAnimation(
+ composition = composition,
+ progress = { progress },
+ dynamicProperties = animationProperties,
+ )
+}
+
+@Composable
+private fun InProgressAnimation(
+ state: InProgress?,
+ @RawRes inProgressAnimationId: Int,
+ animationProperties: LottieDynamicProperties,
+) {
+ // Caching latest progress for when we're animating this view away and state is null.
+ // Without this there's jumpcut in the animation while it's animating away.
+ // state should never be null when composable appears, only when disappearing
+ val cached = remember { Ref<InProgress>() }
+ cached.value = state ?: cached.value
+ val progress = cached.value?.progress ?: 0f
+
+ val composition by
+ rememberLottieComposition(LottieCompositionSpec.RawRes(inProgressAnimationId))
+ val startProgress =
+ rememberSaveable(composition, cached.value?.startMarker) {
+ composition.progressForMarker(cached.value?.startMarker)
+ }
+ val endProgress =
+ rememberSaveable(composition, cached.value?.endMarker) {
+ composition.progressForMarker(cached.value?.endMarker)
+ }
+ LottieAnimation(
+ composition = composition,
+ progress = { lerp(start = startProgress, stop = endProgress, fraction = progress) },
+ dynamicProperties = animationProperties,
+ )
+}
+
+private fun LottieComposition?.progressForMarker(marker: String?): Float {
+ if (marker == null) return 0f
+ val startFrame = this?.getMarker(marker)?.startFrame ?: 0f
+ return this?.getProgressForFrame(startFrame) ?: 0f
+}
diff --git a/packages/SystemUI/src/com/android/systemui/keyboard/shortcut/ShortcutHelperModule.kt b/packages/SystemUI/src/com/android/systemui/keyboard/shortcut/ShortcutHelperModule.kt
index 906f600e3826..7b3380a6a608 100644
--- a/packages/SystemUI/src/com/android/systemui/keyboard/shortcut/ShortcutHelperModule.kt
+++ b/packages/SystemUI/src/com/android/systemui/keyboard/shortcut/ShortcutHelperModule.kt
@@ -16,7 +16,6 @@
package com.android.systemui.keyboard.shortcut
-import android.app.Activity
import com.android.systemui.CoreStartable
import com.android.systemui.Flags.keyboardShortcutHelperRewrite
import com.android.systemui.keyboard.shortcut.data.repository.ShortcutHelperStateRepository
@@ -31,8 +30,7 @@ import com.android.systemui.keyboard.shortcut.qualifiers.CurrentAppShortcuts
import com.android.systemui.keyboard.shortcut.qualifiers.InputShortcuts
import com.android.systemui.keyboard.shortcut.qualifiers.MultitaskingShortcuts
import com.android.systemui.keyboard.shortcut.qualifiers.SystemShortcuts
-import com.android.systemui.keyboard.shortcut.ui.ShortcutHelperActivityStarter
-import com.android.systemui.keyboard.shortcut.ui.view.ShortcutHelperActivity
+import com.android.systemui.keyboard.shortcut.ui.ShortcutHelperDialogStarter
import dagger.Binds
import dagger.Lazy
import dagger.Module
@@ -44,11 +42,6 @@ import dagger.multibindings.IntoMap
interface ShortcutHelperModule {
@Binds
- @IntoMap
- @ClassKey(ShortcutHelperActivity::class)
- fun activity(impl: ShortcutHelperActivity): Activity
-
- @Binds
@SystemShortcuts
fun systemShortcutsSource(impl: SystemShortcutsSource): KeyboardShortcutGroupsSource
@@ -73,8 +66,8 @@ interface ShortcutHelperModule {
companion object {
@Provides
@IntoMap
- @ClassKey(ShortcutHelperActivityStarter::class)
- fun starter(implLazy: Lazy<ShortcutHelperActivityStarter>): CoreStartable {
+ @ClassKey(ShortcutHelperDialogStarter::class)
+ fun starter(implLazy: Lazy<ShortcutHelperDialogStarter>): CoreStartable {
return if (keyboardShortcutHelperRewrite()) {
implLazy.get()
} else {
diff --git a/packages/SystemUI/src/com/android/systemui/keyboard/shortcut/ui/ShortcutHelperActivityStarter.kt b/packages/SystemUI/src/com/android/systemui/keyboard/shortcut/ui/ShortcutHelperActivityStarter.kt
deleted file mode 100644
index fbf52e773599..000000000000
--- a/packages/SystemUI/src/com/android/systemui/keyboard/shortcut/ui/ShortcutHelperActivityStarter.kt
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Copyright (C) 2024 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.systemui.keyboard.shortcut.ui
-
-import android.content.Context
-import android.content.Intent
-import com.android.systemui.CoreStartable
-import com.android.systemui.dagger.SysUISingleton
-import com.android.systemui.dagger.qualifiers.Application
-import com.android.systemui.keyboard.shortcut.ui.view.ShortcutHelperActivity
-import com.android.systemui.keyboard.shortcut.ui.viewmodel.ShortcutHelperViewModel
-import javax.inject.Inject
-import kotlinx.coroutines.CoroutineScope
-import kotlinx.coroutines.launch
-
-@SysUISingleton
-class ShortcutHelperActivityStarter(
- private val context: Context,
- @Application private val applicationScope: CoroutineScope,
- private val viewModel: ShortcutHelperViewModel,
- private val startActivity: (Intent) -> Unit,
-) : CoreStartable {
-
- @Inject
- constructor(
- context: Context,
- @Application applicationScope: CoroutineScope,
- viewModel: ShortcutHelperViewModel,
- ) : this(
- context,
- applicationScope,
- viewModel,
- startActivity = { intent -> context.startActivity(intent) }
- )
-
- override fun start() {
- applicationScope.launch {
- viewModel.shouldShow.collect { shouldShow ->
- if (shouldShow) {
- startShortcutHelperActivity()
- }
- }
- }
- }
-
- private fun startShortcutHelperActivity() {
- startActivity(
- Intent(context, ShortcutHelperActivity::class.java)
- .setFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
- )
- }
-}
diff --git a/packages/SystemUI/src/com/android/systemui/keyboard/shortcut/ui/ShortcutHelperDialogStarter.kt b/packages/SystemUI/src/com/android/systemui/keyboard/shortcut/ui/ShortcutHelperDialogStarter.kt
new file mode 100644
index 000000000000..d33ab2acc8fb
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/keyboard/shortcut/ui/ShortcutHelperDialogStarter.kt
@@ -0,0 +1,102 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.systemui.keyboard.shortcut.ui
+
+import android.app.Dialog
+import android.content.ActivityNotFoundException
+import android.content.Intent
+import android.content.Intent.FLAG_ACTIVITY_NEW_TASK
+import android.os.UserHandle
+import android.provider.Settings
+import androidx.annotation.VisibleForTesting
+import androidx.compose.foundation.layout.width
+import androidx.compose.runtime.getValue
+import androidx.compose.ui.Modifier
+import androidx.lifecycle.compose.collectAsStateWithLifecycle
+import com.android.systemui.CoreStartable
+import com.android.systemui.dagger.SysUISingleton
+import com.android.systemui.dagger.qualifiers.Application
+import com.android.systemui.keyboard.shortcut.ui.composable.ShortcutHelper
+import com.android.systemui.keyboard.shortcut.ui.composable.ShortcutHelperBottomSheet
+import com.android.systemui.keyboard.shortcut.ui.composable.getWidth
+import com.android.systemui.keyboard.shortcut.ui.viewmodel.ShortcutHelperViewModel
+import com.android.systemui.plugins.ActivityStarter
+import com.android.systemui.statusbar.phone.SystemUIDialogFactory
+import com.android.systemui.statusbar.phone.createBottomSheet
+import javax.inject.Inject
+import kotlinx.coroutines.CoroutineScope
+import kotlinx.coroutines.flow.launchIn
+import kotlinx.coroutines.flow.map
+
+@SysUISingleton
+class ShortcutHelperDialogStarter
+@Inject
+constructor(
+ @Application private val applicationScope: CoroutineScope,
+ private val viewModel: ShortcutHelperViewModel,
+ private val dialogFactory: SystemUIDialogFactory,
+ private val activityStarter: ActivityStarter,
+) : CoreStartable {
+
+ @VisibleForTesting var dialog: Dialog? = null
+
+ override fun start() {
+ viewModel.shouldShow
+ .map { shouldShow ->
+ if (shouldShow) {
+ dialog = createShortcutHelperDialog().also { it.show() }
+ } else {
+ dialog?.dismiss()
+ }
+ }
+ .launchIn(applicationScope)
+ }
+
+ private fun createShortcutHelperDialog(): Dialog {
+ return dialogFactory.createBottomSheet(
+ content = { dialog ->
+ val shortcutsUiState by viewModel.shortcutsUiState.collectAsStateWithLifecycle()
+ ShortcutHelper(
+ modifier = Modifier.width(getWidth()),
+ shortcutsUiState = shortcutsUiState,
+ onKeyboardSettingsClicked = { onKeyboardSettingsClicked(dialog) },
+ onSearchQueryChanged = { viewModel.onSearchQueryChanged(it) },
+ )
+ dialog.setOnDismissListener { viewModel.onViewClosed() }
+ },
+ maxWidth = ShortcutHelperBottomSheet.LargeScreenWidthLandscape
+ )
+ }
+
+ private fun onKeyboardSettingsClicked(dialog: Dialog) {
+ try {
+ activityStarter.startActivity(
+ Intent(Settings.ACTION_HARD_KEYBOARD_SETTINGS).addFlags(FLAG_ACTIVITY_NEW_TASK),
+ /* dismissShade= */ true,
+ /* animationController = */ null,
+ /* showOverLockscreenWhenLocked = */ false,
+ UserHandle.CURRENT,
+ )
+ } catch (e: ActivityNotFoundException) {
+ // From the Settings docs: In some cases, a matching Activity may not exist, so ensure
+ // you safeguard against this.
+ e.printStackTrace()
+ return
+ }
+ dialog.dismiss()
+ }
+}
diff --git a/packages/SystemUI/src/com/android/systemui/keyboard/shortcut/ui/composable/ShortcutHelperUtils.kt b/packages/SystemUI/src/com/android/systemui/keyboard/shortcut/ui/composable/ShortcutHelperUtils.kt
index 1f0d696eebd6..e295564a740f 100644
--- a/packages/SystemUI/src/com/android/systemui/keyboard/shortcut/ui/composable/ShortcutHelperUtils.kt
+++ b/packages/SystemUI/src/com/android/systemui/keyboard/shortcut/ui/composable/ShortcutHelperUtils.kt
@@ -16,9 +16,13 @@
package com.android.systemui.keyboard.shortcut.ui.composable
+import android.content.res.Configuration
import androidx.compose.material3.windowsizeclass.WindowHeightSizeClass
import androidx.compose.material3.windowsizeclass.WindowWidthSizeClass
import androidx.compose.runtime.Composable
+import androidx.compose.ui.platform.LocalConfiguration
+import androidx.compose.ui.unit.Dp
+import androidx.compose.ui.unit.dp
import com.android.compose.windowsizeclass.LocalWindowSizeClass
/**
@@ -29,3 +33,21 @@ import com.android.compose.windowsizeclass.LocalWindowSizeClass
fun hasCompactWindowSize() =
LocalWindowSizeClass.current.widthSizeClass == WindowWidthSizeClass.Compact ||
LocalWindowSizeClass.current.heightSizeClass == WindowHeightSizeClass.Compact
+
+@Composable
+fun getWidth(): Dp {
+ return if (hasCompactWindowSize()) {
+ ShortcutHelperBottomSheet.DefaultWidth
+ } else
+ when (LocalConfiguration.current.orientation) {
+ Configuration.ORIENTATION_LANDSCAPE ->
+ ShortcutHelperBottomSheet.LargeScreenWidthLandscape
+ else -> ShortcutHelperBottomSheet.LargeScreenWidthPortrait
+ }
+}
+
+object ShortcutHelperBottomSheet {
+ val DefaultWidth = 412.dp
+ val LargeScreenWidthPortrait = 704.dp
+ val LargeScreenWidthLandscape = 864.dp
+}
diff --git a/packages/SystemUI/src/com/android/systemui/keyboard/shortcut/ui/view/ShortcutHelperActivity.kt b/packages/SystemUI/src/com/android/systemui/keyboard/shortcut/ui/view/ShortcutHelperActivity.kt
deleted file mode 100644
index 52263ce64a85..000000000000
--- a/packages/SystemUI/src/com/android/systemui/keyboard/shortcut/ui/view/ShortcutHelperActivity.kt
+++ /dev/null
@@ -1,184 +0,0 @@
-/*
- * Copyright (C) 2024 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.systemui.keyboard.shortcut.ui.view
-
-import android.content.ActivityNotFoundException
-import android.content.Intent
-import android.content.Intent.FLAG_ACTIVITY_NEW_TASK
-import android.content.res.Configuration
-import android.os.Bundle
-import android.provider.Settings
-import androidx.activity.ComponentActivity
-import androidx.activity.compose.setContent
-import androidx.compose.foundation.layout.Box
-import androidx.compose.foundation.layout.padding
-import androidx.compose.foundation.layout.size
-import androidx.compose.foundation.layout.width
-import androidx.compose.material3.ExperimentalMaterial3Api
-import androidx.compose.material3.MaterialTheme
-import androidx.compose.material3.ModalBottomSheet
-import androidx.compose.material3.Surface
-import androidx.compose.material3.rememberModalBottomSheetState
-import androidx.compose.runtime.Composable
-import androidx.compose.runtime.CompositionLocalProvider
-import androidx.compose.runtime.getValue
-import androidx.compose.ui.Modifier
-import androidx.compose.ui.input.key.Key
-import androidx.compose.ui.input.key.key
-import androidx.compose.ui.input.key.onKeyEvent
-import androidx.compose.ui.platform.LocalConfiguration
-import androidx.compose.ui.platform.LocalContext
-import androidx.compose.ui.res.stringResource
-import androidx.compose.ui.semantics.contentDescription
-import androidx.compose.ui.semantics.semantics
-import androidx.compose.ui.unit.Dp
-import androidx.compose.ui.unit.dp
-import androidx.lifecycle.compose.collectAsStateWithLifecycle
-import androidx.lifecycle.flowWithLifecycle
-import androidx.lifecycle.lifecycleScope
-import com.android.compose.theme.PlatformTheme
-import com.android.systemui.keyboard.shortcut.ui.composable.ShortcutHelper
-import com.android.systemui.keyboard.shortcut.ui.composable.hasCompactWindowSize
-import com.android.systemui.keyboard.shortcut.ui.viewmodel.ShortcutHelperViewModel
-import com.android.systemui.res.R
-import com.android.systemui.settings.UserTracker
-import javax.inject.Inject
-import kotlinx.coroutines.launch
-
-/**
- * Activity that hosts the new version of the keyboard shortcut helper. It will be used both for
- * small and large screen devices.
- */
-class ShortcutHelperActivity
-@Inject
-constructor(private val userTracker: UserTracker, private val viewModel: ShortcutHelperViewModel) :
- ComponentActivity() {
-
- override fun onCreate(savedInstanceState: Bundle?) {
- setupEdgeToEdge()
- super.onCreate(savedInstanceState)
- setContent { Content() }
- observeFinishRequired()
- viewModel.onViewOpened()
- }
-
- @Composable
- private fun Content() {
- CompositionLocalProvider(LocalContext provides userTracker.userContext) {
- PlatformTheme { BottomSheet { finish() } }
- }
- }
-
- @OptIn(ExperimentalMaterial3Api::class)
- @Composable
- private fun BottomSheet(onDismiss: () -> Unit) {
- ModalBottomSheet(
- onDismissRequest = { onDismiss() },
- modifier =
- Modifier.width(getWidth()).padding(top = getTopPadding()).onKeyEvent {
- if (it.key == Key.Escape) {
- onDismiss()
- true
- } else false
- },
- sheetState = rememberModalBottomSheetState(skipPartiallyExpanded = true),
- dragHandle = { DragHandle() },
- ) {
- val shortcutsUiState by viewModel.shortcutsUiState.collectAsStateWithLifecycle()
- ShortcutHelper(
- shortcutsUiState = shortcutsUiState,
- onKeyboardSettingsClicked = ::onKeyboardSettingsClicked,
- onSearchQueryChanged = { viewModel.onSearchQueryChanged(it) },
- )
- }
- }
-
- @Composable
- fun DragHandle() {
- val dragHandleContentDescription =
- stringResource(id = R.string.shortcut_helper_content_description_drag_handle)
- Surface(
- modifier =
- Modifier.padding(top = 16.dp, bottom = 6.dp).semantics {
- contentDescription = dragHandleContentDescription
- },
- color = MaterialTheme.colorScheme.outlineVariant,
- shape = MaterialTheme.shapes.extraLarge,
- ) {
- Box(Modifier.size(width = 32.dp, height = 4.dp))
- }
- }
-
- private fun onKeyboardSettingsClicked() {
- try {
- startActivityAsUser(
- Intent(Settings.ACTION_HARD_KEYBOARD_SETTINGS).addFlags(FLAG_ACTIVITY_NEW_TASK),
- userTracker.userHandle,
- )
- } catch (e: ActivityNotFoundException) {
- // From the Settings docs: In some cases, a matching Activity may not exist, so ensure
- // you safeguard against this.
- e.printStackTrace()
- }
- }
-
- override fun onDestroy() {
- super.onDestroy()
- if (isFinishing) {
- viewModel.onViewClosed()
- }
- }
-
- private fun observeFinishRequired() {
- lifecycleScope.launch {
- viewModel.shouldShow.flowWithLifecycle(lifecycle).collect { shouldShow ->
- if (!shouldShow) {
- finish()
- }
- }
- }
- }
-
- private fun setupEdgeToEdge() {
- // Draw behind system bars
- window.setDecorFitsSystemWindows(false)
- }
-
- @Composable
- private fun getTopPadding(): Dp {
- return if (hasCompactWindowSize()) DefaultTopPadding else LargeScreenTopPadding
- }
-
- @Composable
- private fun getWidth(): Dp {
- return if (hasCompactWindowSize()) {
- DefaultWidth
- } else
- when (LocalConfiguration.current.orientation) {
- Configuration.ORIENTATION_LANDSCAPE -> LargeScreenWidthLandscape
- else -> LargeScreenWidthPortrait
- }
- }
-
- companion object {
- private val DefaultTopPadding = 64.dp
- private val LargeScreenTopPadding = 72.dp
- private val DefaultWidth = 412.dp
- private val LargeScreenWidthPortrait = 704.dp
- private val LargeScreenWidthLandscape = 864.dp
- }
-}
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardUnlockAnimationController.kt b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardUnlockAnimationController.kt
index 2f41c0b2c1ea..f549e64ca853 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardUnlockAnimationController.kt
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardUnlockAnimationController.kt
@@ -23,6 +23,7 @@ import android.app.WallpaperManager
import android.content.res.Resources
import android.graphics.Matrix
import android.graphics.Rect
+import android.hardware.devicestate.DeviceStateManager
import android.os.DeadObjectException
import android.os.Handler
import android.os.PowerManager
@@ -56,6 +57,7 @@ import com.android.systemui.statusbar.SysuiStatusBarStateController
import com.android.systemui.statusbar.phone.BiometricUnlockController
import com.android.systemui.statusbar.phone.BiometricUnlockController.MODE_WAKE_AND_UNLOCK_FROM_DREAM
import com.android.systemui.statusbar.policy.KeyguardStateController
+import com.android.systemui.util.Utils.isDeviceFoldable
import dagger.Lazy
import javax.inject.Inject
@@ -169,6 +171,7 @@ constructor(
private val notificationShadeWindowController: NotificationShadeWindowController,
private val powerManager: PowerManager,
private val wallpaperManager: WallpaperManager,
+ private val deviceStateManager: DeviceStateManager
) : KeyguardStateController.Callback, ISysuiUnlockAnimationController.Stub() {
interface KeyguardUnlockAnimationListener {
@@ -489,7 +492,7 @@ constructor(
"${!notificationShadeWindowController.isLaunchingActivity}"
)
Log.wtf(TAG, " launcherUnlockController != null: ${launcherUnlockController != null}")
- Log.wtf(TAG, " !isFoldable(context): ${!isFoldable(resources)}")
+ Log.wtf(TAG, " !isFoldable(context): ${!isDeviceFoldable(resources, deviceStateManager)}")
}
/**
@@ -1310,11 +1313,4 @@ constructor(
return if (fasterUnlockTransition()) UNLOCK_ANIMATION_SURFACE_BEHIND_START_DELAY_MS
else LEGACY_UNLOCK_ANIMATION_SURFACE_BEHIND_START_DELAY_MS
}
-
- companion object {
-
- fun isFoldable(resources: Resources): Boolean {
- return resources.getIntArray(R.array.config_foldedDeviceStates).isNotEmpty()
- }
- }
}
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewConfigurator.kt b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewConfigurator.kt
index 3230285fcd71..e79f5902575f 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewConfigurator.kt
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewConfigurator.kt
@@ -32,6 +32,7 @@ import com.android.keyguard.KeyguardStatusView
import com.android.keyguard.KeyguardStatusViewController
import com.android.keyguard.dagger.KeyguardStatusViewComponent
import com.android.systemui.CoreStartable
+import com.android.systemui.Flags.lightRevealMigration
import com.android.systemui.biometrics.ui.binder.DeviceEntryUnlockTrackerViewBinder
import com.android.systemui.common.ui.ConfigurationState
import com.android.systemui.dagger.SysUISingleton
@@ -42,6 +43,7 @@ import com.android.systemui.keyguard.shared.model.LockscreenSceneBlueprint
import com.android.systemui.keyguard.ui.binder.KeyguardBlueprintViewBinder
import com.android.systemui.keyguard.ui.binder.KeyguardIndicationAreaBinder
import com.android.systemui.keyguard.ui.binder.KeyguardRootViewBinder
+import com.android.systemui.keyguard.ui.binder.LightRevealScrimViewBinder
import com.android.systemui.keyguard.ui.composable.LockscreenContent
import com.android.systemui.keyguard.ui.composable.blueprint.ComposableLockscreenSceneBlueprint
import com.android.systemui.keyguard.ui.view.KeyguardIndicationArea
@@ -51,6 +53,7 @@ import com.android.systemui.keyguard.ui.viewmodel.KeyguardClockViewModel
import com.android.systemui.keyguard.ui.viewmodel.KeyguardIndicationAreaViewModel
import com.android.systemui.keyguard.ui.viewmodel.KeyguardRootViewModel
import com.android.systemui.keyguard.ui.viewmodel.KeyguardSmartspaceViewModel
+import com.android.systemui.keyguard.ui.viewmodel.LightRevealScrimViewModel
import com.android.systemui.keyguard.ui.viewmodel.LockscreenContentViewModel
import com.android.systemui.keyguard.ui.viewmodel.OccludingAppDeviceEntryMessageViewModel
import com.android.systemui.plugins.FalsingManager
@@ -59,11 +62,13 @@ import com.android.systemui.scene.shared.flag.SceneContainerFlag
import com.android.systemui.shade.NotificationShadeWindowView
import com.android.systemui.shade.domain.interactor.ShadeInteractor
import com.android.systemui.statusbar.KeyguardIndicationController
+import com.android.systemui.statusbar.LightRevealScrim
import com.android.systemui.statusbar.VibratorHelper
import com.android.systemui.statusbar.notification.stack.ui.viewmodel.NotificationLockscreenScrimViewModel
import com.android.systemui.statusbar.phone.ScreenOffAnimationController
import com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager
import com.android.systemui.temporarydisplay.chipbar.ChipbarCoordinator
+import com.android.systemui.wallpapers.ui.viewmodel.WallpaperViewModel
import com.google.android.msdl.domain.MSDLPlayer
import dagger.Lazy
import java.util.Optional
@@ -105,6 +110,9 @@ constructor(
private val keyguardViewMediator: KeyguardViewMediator,
private val deviceEntryUnlockTrackerViewBinder: Optional<DeviceEntryUnlockTrackerViewBinder>,
private val statusBarKeyguardViewManager: StatusBarKeyguardViewManager,
+ private val lightRevealScrimViewModel: LightRevealScrimViewModel,
+ private val lightRevealScrim: LightRevealScrim,
+ private val wallpaperViewModel: WallpaperViewModel,
@Main private val mainDispatcher: CoroutineDispatcher,
private val msdlPlayer: MSDLPlayer,
) : CoreStartable {
@@ -133,6 +141,14 @@ constructor(
bindKeyguardRootView()
initializeViews()
+ if (lightRevealMigration()) {
+ LightRevealScrimViewBinder.bind(
+ lightRevealScrim,
+ lightRevealScrimViewModel,
+ wallpaperViewModel,
+ )
+ }
+
if (!SceneContainerFlag.isEnabled) {
KeyguardBlueprintViewBinder.bind(
keyguardRootView,
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/data/repository/LightRevealScrimRepository.kt b/packages/SystemUI/src/com/android/systemui/keyguard/data/repository/LightRevealScrimRepository.kt
index 0a15bbf18249..4c9c282514cd 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/data/repository/LightRevealScrimRepository.kt
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/data/repository/LightRevealScrimRepository.kt
@@ -39,6 +39,7 @@ import kotlin.math.max
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.channels.awaitClose
import kotlinx.coroutines.flow.Flow
+import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.callbackFlow
import kotlinx.coroutines.flow.distinctUntilChanged
import kotlinx.coroutines.flow.flatMapLatest
@@ -65,6 +66,9 @@ interface LightRevealScrimRepository {
val isAnimating: Boolean
+ /** Limit the max alpha for the scrim to allow for some transparency */
+ val maxAlpha: MutableStateFlow<Float>
+
fun startRevealAmountAnimator(reveal: Boolean, duration: Long = DEFAULT_REVEAL_DURATION)
}
@@ -79,6 +83,7 @@ constructor(
) : LightRevealScrimRepository {
companion object {
val TAG = LightRevealScrimRepository::class.simpleName!!
+ val DEFAULT_MAX_ALPHA = 1f
}
/** The reveal effect used if the device was locked/unlocked via the power button. */
@@ -127,6 +132,8 @@ constructor(
private val revealAmountAnimator = ValueAnimator.ofFloat(0f, 1f)
+ override val maxAlpha: MutableStateFlow<Float> = MutableStateFlow(DEFAULT_MAX_ALPHA)
+
override val revealAmount: Flow<Float> = callbackFlow {
val updateListener =
Animator.AnimatorUpdateListener {
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/FromDreamingLockscreenHostedTransitionInteractor.kt b/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/FromDreamingLockscreenHostedTransitionInteractor.kt
deleted file mode 100644
index f3bd0e9496b1..000000000000
--- a/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/FromDreamingLockscreenHostedTransitionInteractor.kt
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- * Copyright (C) 2023 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License
- */
-
-package com.android.systemui.keyguard.domain.interactor
-
-import android.animation.ValueAnimator
-import com.android.app.animation.Interpolators
-import com.android.systemui.dagger.SysUISingleton
-import com.android.systemui.dagger.qualifiers.Background
-import com.android.systemui.dagger.qualifiers.Main
-import com.android.systemui.keyguard.data.repository.KeyguardTransitionRepository
-import com.android.systemui.keyguard.shared.model.BiometricUnlockMode
-import com.android.systemui.keyguard.shared.model.DozeStateModel
-import com.android.systemui.keyguard.shared.model.KeyguardState
-import com.android.systemui.power.domain.interactor.PowerInteractor
-import com.android.systemui.scene.shared.flag.SceneContainerFlag
-import com.android.systemui.util.kotlin.sample
-import javax.inject.Inject
-import kotlin.time.Duration.Companion.milliseconds
-import kotlinx.coroutines.CoroutineDispatcher
-import kotlinx.coroutines.CoroutineScope
-import kotlinx.coroutines.delay
-import kotlinx.coroutines.flow.onEach
-import kotlinx.coroutines.launch
-
-@SysUISingleton
-class FromDreamingLockscreenHostedTransitionInteractor
-@Inject
-constructor(
- override val transitionRepository: KeyguardTransitionRepository,
- override val internalTransitionInteractor: InternalKeyguardTransitionInteractor,
- transitionInteractor: KeyguardTransitionInteractor,
- @Background private val scope: CoroutineScope,
- @Background bgDispatcher: CoroutineDispatcher,
- @Main mainDispatcher: CoroutineDispatcher,
- keyguardInteractor: KeyguardInteractor,
- powerInteractor: PowerInteractor,
- keyguardOcclusionInteractor: KeyguardOcclusionInteractor,
-) :
- TransitionInteractor(
- fromState = KeyguardState.DREAMING_LOCKSCREEN_HOSTED,
- transitionInteractor = transitionInteractor,
- mainDispatcher = mainDispatcher,
- bgDispatcher = bgDispatcher,
- powerInteractor = powerInteractor,
- keyguardOcclusionInteractor = keyguardOcclusionInteractor,
- keyguardInteractor = keyguardInteractor,
- ) {
-
- override fun start() {
- if (SceneContainerFlag.isEnabled) return
- listenForDreamingLockscreenHostedToLockscreen()
- listenForDreamingLockscreenHostedToGone()
- listenForDreamingLockscreenHostedToDozing()
- listenForDreamingLockscreenHostedToOccluded()
- listenForDreamingLockscreenHostedToPrimaryBouncer()
- }
-
- private fun listenForDreamingLockscreenHostedToLockscreen() {
- scope.launch {
- keyguardInteractor.isActiveDreamLockscreenHosted
- // Add a slight delay to prevent transitioning to lockscreen from happening too soon
- // as dozing can arrive in a slight gap after the lockscreen hosted dream stops.
- .onEach { delay(50) }
- .sample(keyguardInteractor.dozeTransitionModel, ::Pair)
- .filterRelevantKeyguardStateAnd {
- (isActiveDreamLockscreenHosted, dozeTransitionModel) ->
- !isActiveDreamLockscreenHosted &&
- DozeStateModel.isDozeOff(dozeTransitionModel.to)
- }
- .collect { startTransitionTo(KeyguardState.LOCKSCREEN) }
- }
- }
-
- private fun listenForDreamingLockscreenHostedToOccluded() {
- scope.launch {
- keyguardInteractor.isActiveDreamLockscreenHosted
- .sample(keyguardInteractor.isKeyguardOccluded, ::Pair)
- .filterRelevantKeyguardStateAnd { (isActiveDreamLockscreenHosted, isOccluded) ->
- isOccluded && !isActiveDreamLockscreenHosted
- }
- .collect { startTransitionTo(KeyguardState.OCCLUDED) }
- }
- }
-
- private fun listenForDreamingLockscreenHostedToPrimaryBouncer() {
- scope.launch {
- keyguardInteractor.primaryBouncerShowing
- .filterRelevantKeyguardStateAnd { isBouncerShowing -> isBouncerShowing }
- .collect { startTransitionTo(KeyguardState.PRIMARY_BOUNCER) }
- }
- }
-
- private fun listenForDreamingLockscreenHostedToGone() {
- scope.launch {
- keyguardInteractor.biometricUnlockState
- .filterRelevantKeyguardStateAnd { biometricUnlockState ->
- biometricUnlockState.mode == BiometricUnlockMode.WAKE_AND_UNLOCK_FROM_DREAM
- }
- .collect { startTransitionTo(KeyguardState.GONE) }
- }
- }
-
- private fun listenForDreamingLockscreenHostedToDozing() {
- scope.launch {
- keyguardInteractor.dozeTransitionModel
- .filterRelevantKeyguardStateAnd { it.to == DozeStateModel.DOZE }
- .collect { startTransitionTo(KeyguardState.DOZING) }
- }
- }
-
- override fun getDefaultAnimatorForTransitionsToState(toState: KeyguardState): ValueAnimator {
- return ValueAnimator().apply {
- interpolator = Interpolators.LINEAR
- duration =
- if (toState == KeyguardState.LOCKSCREEN) TO_LOCKSCREEN_DURATION.inWholeMilliseconds
- else DEFAULT_DURATION.inWholeMilliseconds
- }
- }
-
- companion object {
- private val DEFAULT_DURATION = 500.milliseconds
- val TO_LOCKSCREEN_DURATION = 1167.milliseconds
- }
-}
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/FromGoneTransitionInteractor.kt b/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/FromGoneTransitionInteractor.kt
index 606a7a988970..a4a215f6eeef 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/FromGoneTransitionInteractor.kt
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/FromGoneTransitionInteractor.kt
@@ -75,7 +75,6 @@ constructor(
listenForGoneToDreaming()
listenForGoneToLockscreenOrHubOrOccluded()
listenForGoneToOccluded()
- listenForGoneToDreamingLockscreenHosted()
}
fun showKeyguard() {
@@ -93,7 +92,7 @@ constructor(
if (keyguardInteractor.isKeyguardOccluded.value) {
startTransitionTo(
KeyguardState.OCCLUDED,
- ownerReason = "Dismissible keyguard with occlusion"
+ ownerReason = "Dismissible keyguard with occlusion",
)
}
}
@@ -129,7 +128,7 @@ constructor(
KeyguardState.LOCKSCREEN,
ownerReason =
"Keyguard was re-enabled, and we weren't GONE when it " +
- "was originally disabled"
+ "was originally disabled",
)
}
}
@@ -153,23 +152,10 @@ constructor(
}
}
- private fun listenForGoneToDreamingLockscreenHosted() {
- scope.launch("$TAG#listenForGoneToDreamingLockscreenHosted") {
- keyguardInteractor.isActiveDreamLockscreenHosted
- .filterRelevantKeyguardStateAnd { isActiveDreamLockscreenHosted ->
- isActiveDreamLockscreenHosted
- }
- .collect { startTransitionTo(KeyguardState.DREAMING_LOCKSCREEN_HOSTED) }
- }
- }
-
private fun listenForGoneToDreaming() {
scope.launch("$TAG#listenForGoneToDreaming") {
keyguardInteractor.isAbleToDream
- .sample(keyguardInteractor.isActiveDreamLockscreenHosted, ::Pair)
- .filterRelevantKeyguardStateAnd { (isAbleToDream, isActiveDreamLockscreenHosted) ->
- isAbleToDream && !isActiveDreamLockscreenHosted
- }
+ .filterRelevantKeyguardStateAnd { isAbleToDream -> isAbleToDream }
.collect { startTransitionTo(KeyguardState.DREAMING) }
}
}
@@ -177,7 +163,7 @@ constructor(
private fun listenForGoneToAodOrDozing() {
scope.launch("$TAG#listenForGoneToAodOrDozing") {
listenForSleepTransition(
- modeOnCanceledFromStartedStep = { TransitionModeOnCanceled.RESET },
+ modeOnCanceledFromStartedStep = { TransitionModeOnCanceled.RESET }
)
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/FromLockscreenTransitionInteractor.kt b/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/FromLockscreenTransitionInteractor.kt
index 4d3727657f3e..e84db062a5f5 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/FromLockscreenTransitionInteractor.kt
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/FromLockscreenTransitionInteractor.kt
@@ -135,20 +135,13 @@ constructor(
.sampleCombine(
internalTransitionInteractor.currentTransitionInfoInternal,
transitionInteractor.isFinishedIn(KeyguardState.LOCKSCREEN),
- keyguardInteractor.isActiveDreamLockscreenHosted,
)
- .collect {
- (isAbleToDream, transitionInfo, isOnLockscreen, isActiveDreamLockscreenHosted)
- ->
+ .collect { (isAbleToDream, transitionInfo, isOnLockscreen) ->
val isTransitionInterruptible =
transitionInfo.to == KeyguardState.LOCKSCREEN &&
!invalidFromStates.contains(transitionInfo.from)
if (isAbleToDream && (isOnLockscreen || isTransitionInterruptible)) {
- if (isActiveDreamLockscreenHosted) {
- startTransitionTo(KeyguardState.DREAMING_LOCKSCREEN_HOSTED)
- } else {
- startTransitionTo(KeyguardState.DREAMING)
- }
+ startTransitionTo(KeyguardState.DREAMING)
}
}
}
@@ -390,7 +383,6 @@ constructor(
TO_AOD_DURATION
}
KeyguardState.DOZING -> TO_DOZING_DURATION
- KeyguardState.DREAMING_LOCKSCREEN_HOSTED -> TO_DREAMING_HOSTED_DURATION
KeyguardState.GLANCEABLE_HUB -> TO_GLANCEABLE_HUB_DURATION
else -> DEFAULT_DURATION
}.inWholeMilliseconds
@@ -402,7 +394,6 @@ constructor(
private val DEFAULT_DURATION = 400.milliseconds
val TO_DOZING_DURATION = 500.milliseconds
val TO_DREAMING_DURATION = 933.milliseconds
- val TO_DREAMING_HOSTED_DURATION = 933.milliseconds
val TO_OCCLUDED_DURATION = 550.milliseconds
val TO_AOD_DURATION = 500.milliseconds
val TO_AOD_FOLD_DURATION = 1100.milliseconds
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/FromPrimaryBouncerTransitionInteractor.kt b/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/FromPrimaryBouncerTransitionInteractor.kt
index 30babe6d47c7..0ecf7816e9b7 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/FromPrimaryBouncerTransitionInteractor.kt
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/FromPrimaryBouncerTransitionInteractor.kt
@@ -78,7 +78,6 @@ constructor(
listenForPrimaryBouncerToGone()
listenForPrimaryBouncerToAsleep()
listenForPrimaryBouncerNotShowing()
- listenForPrimaryBouncerToDreamingLockscreenHosted()
listenForTransitionToCamera(scope, keyguardInteractor)
}
@@ -108,23 +107,19 @@ constructor(
if (KeyguardWmStateRefactor.isEnabled) {
scope.launch {
keyguardInteractor.primaryBouncerShowing
- .sample(
- powerInteractor.isAwake,
- keyguardInteractor.isActiveDreamLockscreenHosted,
- communalSceneInteractor.isIdleOnCommunal,
- )
- .filterRelevantKeyguardStateAnd { (isBouncerShowing, _, _, _) ->
+ .sample(powerInteractor.isAwake, communalSceneInteractor.isIdleOnCommunal)
+ .filterRelevantKeyguardStateAnd { (isBouncerShowing, _, _) ->
// TODO(b/307976454) - See if we need to listen for SHOW_WHEN_LOCKED
// activities showing up over the bouncer. Camera launch can't show up over
// bouncer since the first power press hides bouncer. Do occluding
// activities auto hide bouncer? Not sure.
!isBouncerShowing
}
- .collect { (_, isAwake, isActiveDreamLockscreenHosted, isIdleOnCommunal) ->
+ .collect { (_, isAwake, isIdleOnCommunal) ->
if (
!maybeStartTransitionToOccludedOrInsecureCamera { state, reason ->
startTransitionTo(state, ownerReason = reason)
- } && isAwake && !isActiveDreamLockscreenHosted
+ } && isAwake
) {
val toState =
if (isIdleOnCommunal) {
@@ -195,19 +190,6 @@ constructor(
scope.launch { listenForSleepTransition() }
}
- private fun listenForPrimaryBouncerToDreamingLockscreenHosted() {
- if (SceneContainerFlag.isEnabled) return
- scope.launch {
- keyguardInteractor.primaryBouncerShowing
- .sample(keyguardInteractor.isActiveDreamLockscreenHosted, ::Pair)
- .filterRelevantKeyguardStateAnd { (isBouncerShowing, isActiveDreamLockscreenHosted)
- ->
- !isBouncerShowing && isActiveDreamLockscreenHosted
- }
- .collect { startTransitionTo(KeyguardState.DREAMING_LOCKSCREEN_HOSTED) }
- }
- }
-
private fun listenForPrimaryBouncerToGone() {
if (SceneContainerFlag.isEnabled) return
if (KeyguardWmStateRefactor.isEnabled) {
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/KeyguardInteractor.kt b/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/KeyguardInteractor.kt
index d7f96b55c4a3..6ecbc6175e40 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/KeyguardInteractor.kt
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/KeyguardInteractor.kt
@@ -297,20 +297,39 @@ constructor(
val isKeyguardVisible: Flow<Boolean> =
combine(isKeyguardShowing, isKeyguardOccluded) { showing, occluded -> showing && !occluded }
+ /**
+ * Event types that affect whether secure camera is active. Only used by [isSecureCameraActive].
+ */
+ private enum class SecureCameraRelatedEventType {
+ KeyguardBecameVisible,
+ PrimaryBouncerBecameVisible,
+ SecureCameraLaunched,
+ }
+
/** Whether camera is launched over keyguard. */
- val isSecureCameraActive: Flow<Boolean> by lazy {
- combine(isKeyguardVisible, primaryBouncerShowing, onCameraLaunchDetected) {
- isKeyguardVisible,
- isPrimaryBouncerShowing,
- cameraLaunchEvent ->
- when {
- isKeyguardVisible -> false
- isPrimaryBouncerShowing -> false
- else -> cameraLaunchEvent.type == CameraLaunchType.POWER_DOUBLE_TAP
+ val isSecureCameraActive: Flow<Boolean> =
+ merge(
+ onCameraLaunchDetected
+ .filter { it.type == CameraLaunchType.POWER_DOUBLE_TAP }
+ .map { SecureCameraRelatedEventType.SecureCameraLaunched },
+ isKeyguardVisible
+ .filter { it }
+ .map { SecureCameraRelatedEventType.KeyguardBecameVisible },
+ primaryBouncerShowing
+ .filter { it }
+ .map { SecureCameraRelatedEventType.PrimaryBouncerBecameVisible },
+ )
+ .map {
+ when (it) {
+ SecureCameraRelatedEventType.SecureCameraLaunched -> true
+ // When secure camera is closed, either the keyguard or the primary bouncer will
+ // have to show, so those events tell us that secure camera is no longer active.
+ SecureCameraRelatedEventType.KeyguardBecameVisible -> false
+ SecureCameraRelatedEventType.PrimaryBouncerBecameVisible -> false
}
}
.onStart { emit(false) }
- }
+ .distinctUntilChanged()
/** The approximate location on the screen of the fingerprint sensor, if one is available. */
val fingerprintSensorLocation: Flow<Point?> = repository.fingerprintSensorLocation
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/KeyguardTransitionCoreStartable.kt b/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/KeyguardTransitionCoreStartable.kt
index b71533389e2d..2b4582a2a096 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/KeyguardTransitionCoreStartable.kt
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/KeyguardTransitionCoreStartable.kt
@@ -48,7 +48,6 @@ constructor(
is FromOccludedTransitionInteractor -> Log.d(TAG, "Started $it")
is FromDozingTransitionInteractor -> Log.d(TAG, "Started $it")
is FromAlternateBouncerTransitionInteractor -> Log.d(TAG, "Started $it")
- is FromDreamingLockscreenHostedTransitionInteractor -> Log.d(TAG, "Started $it")
}
it.start()
}
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/LightRevealScrimInteractor.kt b/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/LightRevealScrimInteractor.kt
index 1497026b5750..cf747c81769a 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/LightRevealScrimInteractor.kt
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/LightRevealScrimInteractor.kt
@@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+@file:OptIn(ExperimentalCoroutinesApi::class)
package com.android.systemui.keyguard.domain.interactor
@@ -21,17 +22,22 @@ import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.dagger.qualifiers.Application
import com.android.systemui.keyguard.data.repository.DEFAULT_REVEAL_DURATION
import com.android.systemui.keyguard.data.repository.LightRevealScrimRepository
+import com.android.systemui.keyguard.shared.model.Edge
import com.android.systemui.keyguard.shared.model.KeyguardState
import com.android.systemui.power.domain.interactor.PowerInteractor
import com.android.systemui.power.shared.model.ScreenPowerState
import com.android.systemui.power.shared.model.WakeSleepReason
+import com.android.systemui.scene.shared.model.Scenes
import com.android.systemui.statusbar.LightRevealEffect
import com.android.systemui.util.kotlin.sample
import dagger.Lazy
import javax.inject.Inject
import kotlinx.coroutines.CoroutineScope
+import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.filter
+import kotlinx.coroutines.flow.flatMapLatest
+import kotlinx.coroutines.flow.flowOf
import kotlinx.coroutines.launch
@SysUISingleton
@@ -39,7 +45,7 @@ class LightRevealScrimInteractor
@Inject
constructor(
private val transitionInteractor: KeyguardTransitionInteractor,
- private val lightRevealScrimRepository: LightRevealScrimRepository,
+ private val repository: LightRevealScrimRepository,
@Application private val scope: CoroutineScope,
private val scrimLogger: ScrimLogger,
private val powerInteractor: Lazy<PowerInteractor>,
@@ -63,17 +69,17 @@ constructor(
DEFAULT_REVEAL_DURATION
}
- lightRevealScrimRepository.startRevealAmountAnimator(
+ repository.startRevealAmountAnimator(
willBeRevealedInState(it.to),
- duration = animationDuration
+ duration = animationDuration,
)
}
}
}
private val isLastSleepDueToFold: Boolean
- get() = powerInteractor.get().detailedWakefulness.value
- .lastSleepReason == WakeSleepReason.FOLD
+ get() =
+ powerInteractor.get().detailedWakefulness.value.lastSleepReason == WakeSleepReason.FOLD
/**
* Whenever a keyguard transition starts, sample the latest reveal effect from the repository
@@ -86,12 +92,29 @@ constructor(
* LiftReveal.
*/
val lightRevealEffect: Flow<LightRevealEffect> =
- transitionInteractor.startedKeyguardTransitionStep.sample(
- lightRevealScrimRepository.revealEffect
- )
+ transitionInteractor.startedKeyguardTransitionStep.sample(repository.revealEffect)
+
+ /** Limit the max alpha for the scrim to allow for some transparency */
+ val maxAlpha: Flow<Float> =
+ transitionInteractor
+ .isInTransition(
+ edge = Edge.create(Scenes.Gone, KeyguardState.AOD),
+ edgeWithoutSceneContainer = Edge.create(KeyguardState.GONE, KeyguardState.AOD),
+ )
+ .flatMapLatest { isInTransition ->
+ // During GONE->AOD transitions, the home screen and wallpaper are still visible
+ // until
+ // WM is told to hide them, which occurs at the end of the animation. Use an opaque
+ // scrim until this transition is complete
+ if (isInTransition) {
+ flowOf(1f)
+ } else {
+ repository.maxAlpha
+ }
+ }
val revealAmount =
- lightRevealScrimRepository.revealAmount.filter {
+ repository.revealAmount.filter {
// When the screen is off we do not want to keep producing frames as this is causing
// (invisible) jank. However, we need to still pass through 1f and 0f to ensure that the
// correct end states are respected even if the screen turned off (or was still off)
@@ -104,7 +127,17 @@ constructor(
powerInteractor.get().screenPowerState.value != ScreenPowerState.SCREEN_TURNING_ON
val isAnimating: Boolean
- get() = lightRevealScrimRepository.isAnimating
+ get() = repository.isAnimating
+
+ /** If the wallpaper supports ambient mode, allow partial transparency */
+ fun setWallpaperSupportsAmbientMode(supportsAmbientMode: Boolean) {
+ repository.maxAlpha.value =
+ if (supportsAmbientMode) {
+ 0.7f
+ } else {
+ 1f
+ }
+ }
/**
* Whether the light reveal scrim will be fully revealed (revealAmount = 1.0f) in the given
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/StartKeyguardTransitionModule.kt b/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/StartKeyguardTransitionModule.kt
index 3c661861efd2..f976800fe1d0 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/StartKeyguardTransitionModule.kt
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/StartKeyguardTransitionModule.kt
@@ -58,12 +58,6 @@ abstract class StartKeyguardTransitionModule {
@Binds
@IntoSet
- abstract fun fromDreamingLockscreenHosted(
- impl: FromDreamingLockscreenHostedTransitionInteractor
- ): TransitionInteractor
-
- @Binds
- @IntoSet
abstract fun fromOccluded(impl: FromOccludedTransitionInteractor): TransitionInteractor
@Binds
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/LightRevealScrimViewBinder.kt b/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/LightRevealScrimViewBinder.kt
index 2df17c39d90d..32757ce82c69 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/LightRevealScrimViewBinder.kt
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/LightRevealScrimViewBinder.kt
@@ -16,21 +16,49 @@
package com.android.systemui.keyguard.ui.binder
+import android.animation.ValueAnimator
import androidx.lifecycle.Lifecycle
import androidx.lifecycle.repeatOnLifecycle
import com.android.app.tracing.coroutines.launchTraced as launch
import com.android.systemui.keyguard.ui.viewmodel.LightRevealScrimViewModel
import com.android.systemui.lifecycle.repeatWhenAttached
+import com.android.systemui.shared.Flags.ambientAod
import com.android.systemui.statusbar.LightRevealScrim
+import com.android.systemui.wallpapers.ui.viewmodel.WallpaperViewModel
import kotlinx.coroutines.launch
object LightRevealScrimViewBinder {
@JvmStatic
- fun bind(revealScrim: LightRevealScrim, viewModel: LightRevealScrimViewModel) {
+ fun bind(
+ revealScrim: LightRevealScrim,
+ viewModel: LightRevealScrimViewModel,
+ wallpaperViewModel: WallpaperViewModel,
+ ) {
revealScrim.repeatWhenAttached {
repeatOnLifecycle(Lifecycle.State.CREATED) {
+ if (ambientAod()) {
+ launch("$TAG#wallpaperViewModel.wallpaperSupportsAmbientMode") {
+ wallpaperViewModel.wallpaperSupportsAmbientMode.collect {
+ viewModel.setWallpaperSupportsAmbientMode(it)
+ }
+ }
+ launch("$TAG#viewModel.maxAlpha") {
+ viewModel.maxAlpha.collect { alpha ->
+ if (alpha != revealScrim.alpha) {
+ ValueAnimator.ofFloat(revealScrim.alpha, alpha).apply {
+ duration = 400
+ addUpdateListener { animation ->
+ revealScrim.alpha = animation.getAnimatedValue() as Float
+ }
+ start()
+ }
+ }
+ }
+ }
+ }
+
launch("$TAG#viewModel.revealAmount") {
- viewModel.revealAmount.collect { amount -> revealScrim.revealAmount = amount }
+ viewModel.revealAmount.collect { revealScrim.revealAmount = it }
}
launch("$TAG#viewModel.lightRevealEffect") {
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/DreamingHostedToLockscreenTransitionViewModel.kt b/packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/DreamingHostedToLockscreenTransitionViewModel.kt
deleted file mode 100644
index 57ed455e7b13..000000000000
--- a/packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/DreamingHostedToLockscreenTransitionViewModel.kt
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright (C) 2023 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.systemui.keyguard.ui.viewmodel
-
-import com.android.systemui.dagger.SysUISingleton
-import com.android.systemui.keyguard.domain.interactor.FromDreamingLockscreenHostedTransitionInteractor.Companion.TO_LOCKSCREEN_DURATION
-import com.android.systemui.keyguard.shared.model.Edge
-import com.android.systemui.keyguard.shared.model.KeyguardState.DREAMING_LOCKSCREEN_HOSTED
-import com.android.systemui.keyguard.shared.model.KeyguardState.LOCKSCREEN
-import com.android.systemui.keyguard.ui.KeyguardTransitionAnimationFlow
-import javax.inject.Inject
-import kotlin.time.Duration.Companion.milliseconds
-import kotlinx.coroutines.flow.Flow
-
-@SysUISingleton
-class DreamingHostedToLockscreenTransitionViewModel
-@Inject
-constructor(
- animationFlow: KeyguardTransitionAnimationFlow,
-) {
-
- private val transitionAnimation =
- animationFlow.setup(
- duration = TO_LOCKSCREEN_DURATION,
- edge = Edge.create(from = DREAMING_LOCKSCREEN_HOSTED, to = LOCKSCREEN),
- )
-
- val shortcutsAlpha: Flow<Float> =
- transitionAnimation.sharedFlow(
- duration = 250.milliseconds,
- onStep = { it },
- onCancel = { 0f },
- )
-}
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/GoneToDreamingLockscreenHostedTransitionViewModel.kt b/packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/GoneToDreamingLockscreenHostedTransitionViewModel.kt
deleted file mode 100644
index 627f0de696d7..000000000000
--- a/packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/GoneToDreamingLockscreenHostedTransitionViewModel.kt
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (C) 2023 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.systemui.keyguard.ui.viewmodel
-
-import com.android.systemui.dagger.SysUISingleton
-import com.android.systemui.keyguard.domain.interactor.FromGoneTransitionInteractor.Companion.TO_DREAMING_DURATION
-import com.android.systemui.keyguard.shared.model.Edge
-import com.android.systemui.keyguard.shared.model.KeyguardState.DREAMING_LOCKSCREEN_HOSTED
-import com.android.systemui.keyguard.shared.model.KeyguardState.GONE
-import com.android.systemui.keyguard.ui.KeyguardTransitionAnimationFlow
-import com.android.systemui.scene.shared.model.Scenes
-import javax.inject.Inject
-import kotlin.time.Duration.Companion.milliseconds
-import kotlinx.coroutines.flow.Flow
-
-/**
- * Breaks down GONE->DREAMING_LOCKSCREEN_HOSTED transition into discrete steps for corresponding
- * views to consume.
- */
-@SysUISingleton
-class GoneToDreamingLockscreenHostedTransitionViewModel
-@Inject
-constructor(
- animationFlow: KeyguardTransitionAnimationFlow,
-) {
-
- private val transitionAnimation =
- animationFlow
- .setup(
- duration = TO_DREAMING_DURATION,
- edge = Edge.create(from = Scenes.Gone, to = DREAMING_LOCKSCREEN_HOSTED),
- )
- .setupWithoutSceneContainer(
- edge = Edge.create(from = GONE, to = DREAMING_LOCKSCREEN_HOSTED),
- )
-
- /** Lockscreen views alpha - hide immediately */
- val lockscreenAlpha: Flow<Float> =
- transitionAnimation.sharedFlow(
- duration = 1.milliseconds,
- onStep = { 0f },
- )
-}
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/KeyguardQuickAffordancesCombinedViewModel.kt b/packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/KeyguardQuickAffordancesCombinedViewModel.kt
index f765e60c1c70..df3c78232b94 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/KeyguardQuickAffordancesCombinedViewModel.kt
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/KeyguardQuickAffordancesCombinedViewModel.kt
@@ -55,7 +55,6 @@ constructor(
shadeInteractor: ShadeInteractor,
aodToLockscreenTransitionViewModel: AodToLockscreenTransitionViewModel,
dozingToLockscreenTransitionViewModel: DozingToLockscreenTransitionViewModel,
- dreamingHostedToLockscreenTransitionViewModel: DreamingHostedToLockscreenTransitionViewModel,
dreamingToLockscreenTransitionViewModel: DreamingToLockscreenTransitionViewModel,
goneToLockscreenTransitionViewModel: GoneToLockscreenTransitionViewModel,
occludedToLockscreenTransitionViewModel: OccludedToLockscreenTransitionViewModel,
@@ -64,7 +63,6 @@ constructor(
glanceableHubToLockscreenTransitionViewModel: GlanceableHubToLockscreenTransitionViewModel,
lockscreenToAodTransitionViewModel: LockscreenToAodTransitionViewModel,
lockscreenToDozingTransitionViewModel: LockscreenToDozingTransitionViewModel,
- lockscreenToDreamingHostedTransitionViewModel: LockscreenToDreamingHostedTransitionViewModel,
lockscreenToDreamingTransitionViewModel: LockscreenToDreamingTransitionViewModel,
lockscreenToGoneTransitionViewModel: LockscreenToGoneTransitionViewModel,
lockscreenToOccludedTransitionViewModel: LockscreenToOccludedTransitionViewModel,
@@ -90,10 +88,7 @@ constructor(
/** The only time the expansion is important is while lockscreen is actively displayed */
private val shadeExpansionAlpha =
- combine(
- showingLockscreen,
- shadeInteractor.anyExpansion,
- ) { showingLockscreen, expansion ->
+ combine(showingLockscreen, shadeInteractor.anyExpansion) { showingLockscreen, expansion ->
if (showingLockscreen) {
1 - expansion
} else {
@@ -113,7 +108,6 @@ constructor(
merge(
aodToLockscreenTransitionViewModel.shortcutsAlpha,
dozingToLockscreenTransitionViewModel.shortcutsAlpha,
- dreamingHostedToLockscreenTransitionViewModel.shortcutsAlpha,
dreamingToLockscreenTransitionViewModel.shortcutsAlpha,
goneToLockscreenTransitionViewModel.shortcutsAlpha,
occludedToLockscreenTransitionViewModel.shortcutsAlpha,
@@ -127,7 +121,6 @@ constructor(
merge(
lockscreenToAodTransitionViewModel.shortcutsAlpha,
lockscreenToDozingTransitionViewModel.shortcutsAlpha,
- lockscreenToDreamingHostedTransitionViewModel.shortcutsAlpha,
lockscreenToDreamingTransitionViewModel.shortcutsAlpha,
lockscreenToGoneTransitionViewModel.shortcutsAlpha,
lockscreenToOccludedTransitionViewModel.shortcutsAlpha,
@@ -138,10 +131,7 @@ constructor(
/** The source of truth of alpha for all of the quick affordances on lockscreen */
val transitionAlpha: Flow<Float> =
- merge(
- fadeInAlpha,
- fadeOutAlpha,
- )
+ merge(fadeInAlpha, fadeOutAlpha)
.flowName("transitionAlpha")
.stateIn(
scope = applicationScope,
@@ -325,9 +315,7 @@ constructor(
slotId = slotId,
)
is KeyguardQuickAffordanceModel.Hidden ->
- KeyguardQuickAffordanceViewModel(
- slotId = slotId,
- )
+ KeyguardQuickAffordanceViewModel(slotId = slotId)
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/LightRevealScrimViewModel.kt b/packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/LightRevealScrimViewModel.kt
index 82f40bf3a16a..af6cd166479a 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/LightRevealScrimViewModel.kt
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/LightRevealScrimViewModel.kt
@@ -27,7 +27,14 @@ import kotlinx.coroutines.flow.Flow
* draw a gradient that reveals/hides the contents of the screen.
*/
@OptIn(ExperimentalCoroutinesApi::class)
-class LightRevealScrimViewModel @Inject constructor(interactor: LightRevealScrimInteractor) {
+class LightRevealScrimViewModel
+@Inject
+constructor(private val interactor: LightRevealScrimInteractor) {
val lightRevealEffect: Flow<LightRevealEffect> = interactor.lightRevealEffect
val revealAmount: Flow<Float> = interactor.revealAmount
+ val maxAlpha: Flow<Float> = interactor.maxAlpha
+
+ fun setWallpaperSupportsAmbientMode(supportsAmbientMode: Boolean) {
+ interactor.setWallpaperSupportsAmbientMode(supportsAmbientMode)
+ }
}
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/LockscreenToDreamingHostedTransitionViewModel.kt b/packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/LockscreenToDreamingHostedTransitionViewModel.kt
deleted file mode 100644
index 778dbed90ec1..000000000000
--- a/packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/LockscreenToDreamingHostedTransitionViewModel.kt
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright (C) 2023 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.systemui.keyguard.ui.viewmodel
-
-import com.android.systemui.dagger.SysUISingleton
-import com.android.systemui.keyguard.domain.interactor.FromLockscreenTransitionInteractor.Companion.TO_DREAMING_HOSTED_DURATION
-import com.android.systemui.keyguard.shared.model.Edge
-import com.android.systemui.keyguard.shared.model.KeyguardState.DREAMING_LOCKSCREEN_HOSTED
-import com.android.systemui.keyguard.shared.model.KeyguardState.LOCKSCREEN
-import com.android.systemui.keyguard.ui.KeyguardTransitionAnimationFlow
-import javax.inject.Inject
-import kotlin.time.Duration.Companion.milliseconds
-import kotlinx.coroutines.flow.Flow
-
-@SysUISingleton
-class LockscreenToDreamingHostedTransitionViewModel
-@Inject
-constructor(
- animationFlow: KeyguardTransitionAnimationFlow,
-) {
-
- private val transitionAnimation =
- animationFlow.setup(
- duration = TO_DREAMING_HOSTED_DURATION,
- edge = Edge.create(from = LOCKSCREEN, to = DREAMING_LOCKSCREEN_HOSTED),
- )
-
- val shortcutsAlpha: Flow<Float> =
- transitionAnimation.sharedFlow(
- duration = 250.milliseconds,
- onStep = { 1 - it },
- onFinish = { 0f },
- onCancel = { 1f },
- )
-}
diff --git a/packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputAdapter.java b/packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputAdapter.java
index 2961d05b2e51..742f43533e6f 100644
--- a/packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputAdapter.java
+++ b/packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputAdapter.java
@@ -170,12 +170,11 @@ public class MediaOutputAdapter extends MediaOutputBaseAdapter {
// Set different layout for each device
if (device.isMutingExpectedDevice()
&& !mController.isCurrentConnectedDeviceRemote()) {
- updateTitleIcon(R.drawable.media_output_icon_volume,
- mController.getColorItemContent());
+ updateUnmutedVolumeIcon(device);
mCurrentActivePosition = position;
updateFullItemClickListener(v -> onItemClick(v, device));
setSingleLineLayout(getItemTitle(device));
- initFakeActiveDevice();
+ initFakeActiveDevice(device);
} else if (device.hasSubtext()) {
boolean isActiveWithOngoingSession =
(device.hasOngoingSession() && (currentlyConnected || isDeviceIncluded(
@@ -184,8 +183,7 @@ public class MediaOutputAdapter extends MediaOutputBaseAdapter {
&& isActiveWithOngoingSession;
if (isActiveWithOngoingSession) {
mCurrentActivePosition = position;
- updateTitleIcon(R.drawable.media_output_icon_volume,
- mController.getColorItemContent());
+ updateUnmutedVolumeIcon(device);
mSubTitleText.setText(device.getSubtextString());
updateTwoLineLayoutContentAlpha(DEVICE_CONNECTED_ALPHA);
updateEndClickAreaAsSessionEditing(device,
@@ -199,9 +197,7 @@ public class MediaOutputAdapter extends MediaOutputBaseAdapter {
} else {
if (currentlyConnected) {
mCurrentActivePosition = position;
- updateTitleIcon(R.drawable.media_output_icon_volume,
- mController.getColorItemContent());
- initSeekbar(device, isCurrentSeekbarInvisible);
+ updateUnmutedVolumeIcon(device);
} else {
setUpDeviceIcon(device);
}
@@ -243,8 +239,7 @@ public class MediaOutputAdapter extends MediaOutputBaseAdapter {
// selected device in group
boolean isDeviceDeselectable = isDeviceIncluded(
mController.getDeselectableMediaDevice(), device);
- updateTitleIcon(R.drawable.media_output_icon_volume,
- mController.getColorItemContent());
+ updateUnmutedVolumeIcon(device);
updateGroupableCheckBox(true, isDeviceDeselectable, device);
updateEndClickArea(device, isDeviceDeselectable);
disableFocusPropertyForView(mContainerLayout);
@@ -264,8 +259,7 @@ public class MediaOutputAdapter extends MediaOutputBaseAdapter {
setSingleLineLayout(getItemTitle(device));
} else if (device.hasOngoingSession()) {
mCurrentActivePosition = position;
- updateTitleIcon(R.drawable.media_output_icon_volume,
- mController.getColorItemContent());
+ updateUnmutedVolumeIcon(device);
updateEndClickAreaAsSessionEditing(device, device.isHostForOngoingSession()
? R.drawable.media_output_status_edit_session
: R.drawable.ic_sound_bars_anim);
@@ -278,8 +272,7 @@ public class MediaOutputAdapter extends MediaOutputBaseAdapter {
&& !mController.getSelectableMediaDevice().isEmpty()) {
//If device is connected and there's other selectable devices, layout as
// one of selected devices.
- updateTitleIcon(R.drawable.media_output_icon_volume,
- mController.getColorItemContent());
+ updateUnmutedVolumeIcon(device);
boolean isDeviceDeselectable = isDeviceIncluded(
mController.getDeselectableMediaDevice(), device);
updateGroupableCheckBox(true, isDeviceDeselectable, device);
@@ -291,8 +284,7 @@ public class MediaOutputAdapter extends MediaOutputBaseAdapter {
true /* showEndTouchArea */);
initSeekbar(device, isCurrentSeekbarInvisible);
} else {
- updateTitleIcon(R.drawable.media_output_icon_volume,
- mController.getColorItemContent());
+ updateUnmutedVolumeIcon(device);
disableFocusPropertyForView(mContainerLayout);
setUpContentDescriptionForView(mSeekBar, device);
mCurrentActivePosition = position;
diff --git a/packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputBaseAdapter.java b/packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputBaseAdapter.java
index 63a7e013022a..574ccee28faa 100644
--- a/packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputBaseAdapter.java
+++ b/packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputBaseAdapter.java
@@ -47,6 +47,7 @@ import androidx.annotation.NonNull;
import androidx.annotation.VisibleForTesting;
import androidx.recyclerview.widget.RecyclerView;
+import com.android.settingslib.media.InputMediaDevice;
import com.android.settingslib.media.MediaDevice;
import com.android.settingslib.utils.ThreadUtils;
import com.android.systemui.res.R;
@@ -321,18 +322,20 @@ public abstract class MediaOutputBaseAdapter extends
// Check if response volume match with the latest request, to ignore obsolete
// response
if (isCurrentSeekbarInvisible && !mIsInitVolumeFirstTime) {
- updateTitleIcon(currentVolume == 0 ? R.drawable.media_output_icon_volume_off
- : R.drawable.media_output_icon_volume,
- mController.getColorItemContent());
+ if (currentVolume == 0) {
+ updateMutedVolumeIcon(device);
+ } else {
+ updateUnmutedVolumeIcon(device);
+ }
} else {
if (!mVolumeAnimator.isStarted()) {
int percentage =
(int) ((double) currentVolume * VOLUME_PERCENTAGE_SCALE_SIZE
/ (double) mSeekBar.getMax());
if (percentage == 0) {
- updateMutedVolumeIcon();
+ updateMutedVolumeIcon(device);
} else {
- updateUnmutedVolumeIcon();
+ updateUnmutedVolumeIcon(device);
}
mSeekBar.setVolume(currentVolume);
mLatestUpdateVolume = -1;
@@ -340,7 +343,7 @@ public abstract class MediaOutputBaseAdapter extends
}
} else if (currentVolume == 0) {
mSeekBar.resetVolume();
- updateMutedVolumeIcon();
+ updateMutedVolumeIcon(device);
}
if (currentVolume == mLatestUpdateVolume) {
mLatestUpdateVolume = -1;
@@ -365,7 +368,7 @@ public abstract class MediaOutputBaseAdapter extends
R.string.media_output_dialog_volume_percentage, percentage));
mVolumeValueText.setVisibility(View.VISIBLE);
if (mStartFromMute) {
- updateUnmutedVolumeIcon();
+ updateUnmutedVolumeIcon(device);
mStartFromMute = false;
}
if (progressToVolume != deviceVolume) {
@@ -390,9 +393,9 @@ public abstract class MediaOutputBaseAdapter extends
seekBar.getProgress());
if (currentVolume == 0) {
seekBar.setProgress(0);
- updateMutedVolumeIcon();
+ updateMutedVolumeIcon(device);
} else {
- updateUnmutedVolumeIcon();
+ updateUnmutedVolumeIcon(device);
}
mTitleIcon.setVisibility(View.VISIBLE);
mVolumeValueText.setVisibility(View.GONE);
@@ -402,36 +405,48 @@ public abstract class MediaOutputBaseAdapter extends
});
}
- void updateMutedVolumeIcon() {
+ void updateMutedVolumeIcon(MediaDevice device) {
mIconAreaLayout.setBackground(
mContext.getDrawable(R.drawable.media_output_item_background_active));
- updateTitleIcon(R.drawable.media_output_icon_volume_off,
- mController.getColorItemContent());
+ updateTitleIcon(device, true /* isMutedVolumeIcon */);
}
- void updateUnmutedVolumeIcon() {
+ void updateUnmutedVolumeIcon(MediaDevice device) {
mIconAreaLayout.setBackground(
mContext.getDrawable(R.drawable.media_output_title_icon_area)
);
- updateTitleIcon(R.drawable.media_output_icon_volume,
- mController.getColorItemContent());
+ updateTitleIcon(device, false /* isMutedVolumeIcon */);
}
- void updateTitleIcon(@DrawableRes int id, int color) {
+ void updateTitleIcon(MediaDevice device, boolean isMutedVolumeIcon) {
+ boolean isInputMediaDevice = device instanceof InputMediaDevice;
+ int id = getDrawableId(isInputMediaDevice, isMutedVolumeIcon);
mTitleIcon.setImageDrawable(mContext.getDrawable(id));
- mTitleIcon.setImageTintList(ColorStateList.valueOf(color));
+ mTitleIcon.setImageTintList(ColorStateList.valueOf(mController.getColorItemContent()));
mIconAreaLayout.setBackgroundTintList(
ColorStateList.valueOf(mController.getColorSeekbarProgress()));
}
+ @VisibleForTesting
+ int getDrawableId(boolean isInputDevice, boolean isMutedVolumeIcon) {
+ // Returns the microphone icon when the flag is enabled and the device is an input
+ // device.
+ if (com.android.media.flags.Flags.enableAudioInputDeviceRoutingAndVolumeControl()
+ && isInputDevice) {
+ return isMutedVolumeIcon ? R.drawable.ic_mic_off : R.drawable.ic_mic_26dp;
+ }
+ return isMutedVolumeIcon
+ ? R.drawable.media_output_icon_volume_off
+ : R.drawable.media_output_icon_volume;
+ }
+
void updateIconAreaClickListener(View.OnClickListener listener) {
mIconAreaLayout.setOnClickListener(listener);
}
- void initFakeActiveDevice() {
+ void initFakeActiveDevice(MediaDevice device) {
disableSeekBar();
- updateTitleIcon(R.drawable.media_output_icon_volume,
- mController.getColorItemContent());
+ updateTitleIcon(device, false /* isMutedIcon */);
final Drawable backgroundDrawable = mContext.getDrawable(
R.drawable.media_output_item_background_active)
.mutate();
@@ -518,13 +533,13 @@ public abstract class MediaOutputBaseAdapter extends
mController.logInteractionUnmuteDevice(device);
mSeekBar.setVolume(UNMUTE_DEFAULT_VOLUME);
mController.adjustVolume(device, UNMUTE_DEFAULT_VOLUME);
- updateUnmutedVolumeIcon();
+ updateUnmutedVolumeIcon(device);
mIconAreaLayout.setOnTouchListener(((iconV, event) -> false));
} else {
mController.logInteractionMuteDevice(device);
mSeekBar.resetVolume();
mController.adjustVolume(device, 0);
- updateMutedVolumeIcon();
+ updateMutedVolumeIcon(device);
mIconAreaLayout.setOnTouchListener(((iconV, event) -> {
mSeekBar.dispatchTouchEvent(event);
return false;
diff --git a/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBarControllerImpl.java b/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBarControllerImpl.java
index 5e8c2c9844ee..b019c136b6ca 100644
--- a/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBarControllerImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBarControllerImpl.java
@@ -24,6 +24,7 @@ import static com.android.wm.shell.Flags.enableTaskbarOnPhones;
import android.content.Context;
import android.content.pm.ActivityInfo;
import android.content.res.Configuration;
+import android.hardware.devicestate.DeviceStateManager;
import android.hardware.display.DisplayManager;
import android.os.Bundle;
import android.os.RemoteException;
@@ -58,6 +59,7 @@ import com.android.systemui.statusbar.CommandQueue;
import com.android.systemui.statusbar.phone.AutoHideController;
import com.android.systemui.statusbar.phone.LightBarController;
import com.android.systemui.statusbar.policy.ConfigurationController;
+import com.android.systemui.util.Utils;
import com.android.systemui.util.settings.SecureSettings;
import com.android.wm.shell.back.BackAnimation;
import com.android.wm.shell.pip.Pip;
@@ -128,7 +130,8 @@ public class NavigationBarControllerImpl implements
Optional<Pip> pipOptional,
Optional<BackAnimation> backAnimation,
SecureSettings secureSettings,
- DisplayTracker displayTracker) {
+ DisplayTracker displayTracker,
+ DeviceStateManager deviceStateManager) {
mContext = context;
mExecutor = mainExecutor;
mNavigationBarComponentFactory = navigationBarComponentFactory;
@@ -146,11 +149,19 @@ public class NavigationBarControllerImpl implements
dumpManager, autoHideController, lightBarController, pipOptional,
backAnimation.orElse(null), taskStackChangeListeners);
mIsLargeScreen = isLargeScreen(mContext);
- mIsPhone =
- mContext.getResources().getIntArray(R.array.config_foldedDeviceStates).length == 0;
+ mIsPhone = determineIfPhone(mContext, deviceStateManager);
dumpManager.registerDumpable(this);
}
+ private boolean determineIfPhone(Context context, DeviceStateManager deviceStateManager) {
+ if (android.hardware.devicestate.feature.flags.Flags.deviceStatePropertyMigration()) {
+ return !Utils.isDeviceFoldable(context.getResources(), deviceStateManager);
+ } else {
+ return context.getResources().getIntArray(R.array.config_foldedDeviceStates).length
+ == 0;
+ }
+ }
+
@Override
public void onConfigChanged(Configuration newConfig) {
boolean isOldConfigLargeScreen = mIsLargeScreen;
diff --git a/packages/SystemUI/src/com/android/systemui/qs/QSTileIcon.kt b/packages/SystemUI/src/com/android/systemui/qs/QSTileIcon.kt
index 62694ceffda8..ef7e7eb59898 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/QSTileIcon.kt
+++ b/packages/SystemUI/src/com/android/systemui/qs/QSTileIcon.kt
@@ -22,18 +22,13 @@ import com.android.systemui.qs.tileimpl.QSTileImpl
/**
* Creates a [QSTile.Icon] from an [Icon].
- * * [Icon.Loaded] && [resId] null -> [QSTileImpl.DrawableIcon]
- * * [Icon.Loaded] && [resId] available -> [QSTileImpl.DrawableIconWithRes]
+ * * [Icon.Loaded] -> [QSTileImpl.DrawableIcon]
* * [Icon.Resource] -> [QSTileImpl.ResourceIcon]
*/
-fun Icon.asQSTileIcon(resId: Int?): QSTile.Icon {
+fun Icon.asQSTileIcon(): QSTile.Icon {
return when (this) {
is Icon.Loaded -> {
- if (resId != null) {
- QSTileImpl.DrawableIconWithRes(this.drawable, resId)
- } else {
- QSTileImpl.DrawableIcon(this.drawable)
- }
+ QSTileImpl.DrawableIcon(this.drawable)
}
is Icon.Resource -> {
QSTileImpl.ResourceIcon.get(this.res)
diff --git a/packages/SystemUI/src/com/android/systemui/qs/composefragment/QSFragmentCompose.kt b/packages/SystemUI/src/com/android/systemui/qs/composefragment/QSFragmentCompose.kt
index 49b44cb95e46..6db91ac073ba 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/composefragment/QSFragmentCompose.kt
+++ b/packages/SystemUI/src/com/android/systemui/qs/composefragment/QSFragmentCompose.kt
@@ -45,6 +45,7 @@ import androidx.compose.foundation.layout.WindowInsets
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.navigationBars
+import androidx.compose.foundation.layout.offset
import androidx.compose.foundation.layout.windowInsetsPadding
import androidx.compose.foundation.verticalScroll
import androidx.compose.runtime.Composable
@@ -55,9 +56,12 @@ import androidx.compose.runtime.mutableFloatStateOf
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
+import androidx.compose.runtime.snapshotFlow
import androidx.compose.ui.Modifier
+import androidx.compose.ui.graphics.graphicsLayer
import androidx.compose.ui.layout.approachLayout
import androidx.compose.ui.layout.onPlaced
+import androidx.compose.ui.layout.onSizeChanged
import androidx.compose.ui.layout.positionInRoot
import androidx.compose.ui.platform.ComposeView
import androidx.compose.ui.res.dimensionResource
@@ -65,7 +69,9 @@ import androidx.compose.ui.res.stringResource
import androidx.compose.ui.semantics.CustomAccessibilityAction
import androidx.compose.ui.semantics.customActions
import androidx.compose.ui.semantics.semantics
+import androidx.compose.ui.unit.IntOffset
import androidx.compose.ui.unit.round
+import androidx.compose.ui.util.fastRoundToInt
import androidx.lifecycle.Lifecycle
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import androidx.lifecycle.lifecycleScope
@@ -143,9 +149,6 @@ constructor(
private lateinit var viewModel: QSFragmentComposeViewModel
- // Starting with a non-zero value makes it so that it has a non-zero height on first expansion
- // This is important for `QuickSettingsControllerImpl.mMinExpansionHeight` to detect a "change".
- private val qqsHeight = MutableStateFlow(1)
private val qsHeight = MutableStateFlow(0)
private val qqsVisible = MutableStateFlow(false)
private val qqsPositionOnRoot = Rect()
@@ -218,7 +221,7 @@ constructor(
{ notificationScrimClippingParams.params.top },
// Only allow scrolling when we are fully expanded. That way, we don't intercept
// swipes in lockscreen (when somehow QS is receiving touches).
- { scrollState.canScrollForward && viewModel.expansionState.value.progress >= 1f },
+ { scrollState.canScrollForward && viewModel.isQsFullyExpanded },
)
frame.addView(
composeView,
@@ -231,16 +234,20 @@ constructor(
@Composable
private fun Content() {
PlatformTheme {
- val visible by viewModel.qsVisible.collectAsStateWithLifecycle()
-
AnimatedVisibility(
- visible = visible,
+ visible = viewModel.isQsVisible,
modifier =
- Modifier.windowInsetsPadding(WindowInsets.navigationBars).thenIf(
- notificationScrimClippingParams.isEnabled
- ) {
- Modifier.notificationScrimClip { notificationScrimClippingParams.params }
- },
+ Modifier.graphicsLayer { alpha = viewModel.viewAlpha }
+ .windowInsetsPadding(WindowInsets.navigationBars)
+ // Clipping before translation to match QSContainerImpl.onDraw
+ .offset {
+ IntOffset(x = 0, y = viewModel.viewTranslationY.fastRoundToInt())
+ }
+ .thenIf(notificationScrimClippingParams.isEnabled) {
+ Modifier.notificationScrimClip {
+ notificationScrimClippingParams.params
+ }
+ },
) {
val isEditing by
viewModel.containerViewModel.editModeViewModel.isEditing
@@ -254,7 +261,7 @@ constructor(
label = "EditModeAnimatedContent",
) { editing ->
if (editing) {
- val qqsPadding by viewModel.qqsHeaderHeight.collectAsStateWithLifecycle()
+ val qqsPadding = viewModel.qqsHeaderHeight
EditMode(
viewModel = viewModel.containerViewModel.editModeViewModel,
modifier =
@@ -283,7 +290,7 @@ constructor(
private fun CollapsableQuickSettingsSTL() {
val sceneState = remember {
MutableSceneTransitionLayoutState(
- viewModel.expansionState.value.toIdleSceneKey(),
+ viewModel.expansionState.toIdleSceneKey(),
transitions =
transitions {
from(QuickQuickSettings, QuickSettings) {
@@ -294,7 +301,10 @@ constructor(
}
LaunchedEffect(Unit) {
- synchronizeQsState(sceneState, viewModel.expansionState.map { it.progress })
+ synchronizeQsState(
+ sceneState,
+ snapshotFlow { viewModel.expansionState }.map { it.progress },
+ )
}
SceneTransitionLayout(state = sceneState, modifier = Modifier.fillMaxSize()) {
@@ -315,7 +325,7 @@ constructor(
override fun getQsMinExpansionHeight(): Int {
// TODO (b/353253277) implement split screen
- return qqsHeight.value
+ return viewModel.qqsHeight
}
override fun getDesiredHeight(): Int {
@@ -329,7 +339,7 @@ constructor(
}
override fun setHeightOverride(desiredHeight: Int) {
- viewModel.heightOverrideValue = desiredHeight
+ viewModel.heightOverride = desiredHeight
}
override fun setHeaderClickable(qsExpansionEnabled: Boolean) {
@@ -349,7 +359,7 @@ constructor(
}
override fun setExpanded(qsExpanded: Boolean) {
- viewModel.isQSExpanded = qsExpanded
+ viewModel.isQsExpanded = qsExpanded
}
override fun setListening(listening: Boolean) {
@@ -357,7 +367,7 @@ constructor(
}
override fun setQsVisible(qsVisible: Boolean) {
- viewModel.isQSVisible = qsVisible
+ viewModel.isQsVisible = qsVisible
}
override fun isShowingDetail(): Boolean {
@@ -378,11 +388,10 @@ constructor(
headerTranslation: Float,
squishinessFraction: Float,
) {
- viewModel.qsExpansionValue = qsExpansionFraction
- viewModel.panelExpansionFractionValue = panelExpansionFraction
- viewModel.squishinessFractionValue = squishinessFraction
-
- // TODO(b/353254353) Handle header translation
+ viewModel.setQsExpansionValue(qsExpansionFraction)
+ viewModel.panelExpansionFraction = panelExpansionFraction
+ viewModel.squishinessFraction = squishinessFraction
+ viewModel.proposedTranslation = headerTranslation
}
override fun setHeaderListening(listening: Boolean) {
@@ -402,7 +411,7 @@ constructor(
}
override fun getHeightDiff(): Int {
- return 0 // For now TODO(b/353254353)
+ return viewModel.heightDiff
}
override fun getHeader(): View? {
@@ -415,8 +424,8 @@ constructor(
// TODO (b/353253280)
}
- override fun setInSplitShade(shouldTranslate: Boolean) {
- // TODO (b/356435605)
+ override fun setInSplitShade(isInSplitShade: Boolean) {
+ viewModel.isInSplitShade = isInSplitShade
}
override fun setTransitionToFullShadeProgress(
@@ -425,9 +434,9 @@ constructor(
qsSquishinessFraction: Float,
) {
viewModel.isTransitioningToFullShade = isTransitioningToFullShade
- viewModel.lockscreenToShadeProgressValue = qsTransitionFraction
+ viewModel.lockscreenToShadeProgress = qsTransitionFraction
if (isTransitioningToFullShade) {
- viewModel.squishinessFractionValue = qsSquishinessFraction
+ viewModel.squishinessFraction = qsSquishinessFraction
}
}
@@ -452,7 +461,7 @@ constructor(
}
override fun isFullyCollapsed(): Boolean {
- return viewModel.qsExpansionValue <= 0f
+ return viewModel.isQsFullyCollapsed
}
override fun setCollapsedMediaVisibilityChangedListener(listener: Consumer<Boolean>?) {
@@ -464,11 +473,11 @@ constructor(
}
override fun setOverScrollAmount(overScrollAmount: Int) {
- super.setOverScrollAmount(overScrollAmount)
+ viewModel.overScrollAmount = overScrollAmount
}
override fun setIsNotificationPanelFullWidth(isFullWidth: Boolean) {
- viewModel.isSmallScreenValue = isFullWidth
+ viewModel.isSmallScreen = isFullWidth
}
override fun getHeaderTop(): Int {
@@ -522,8 +531,8 @@ constructor(
@Composable
private fun SceneScope.QuickQuickSettingsElement() {
- val qqsPadding by viewModel.qqsHeaderHeight.collectAsStateWithLifecycle()
- val bottomPadding = dimensionResource(id = R.dimen.qqs_layout_padding_bottom)
+ val qqsPadding = viewModel.qqsHeaderHeight
+ val bottomPadding = viewModel.qqsBottomPadding
DisposableEffect(Unit) {
qqsVisible.value = true
@@ -553,14 +562,13 @@ constructor(
.approachLayout(isMeasurementApproachInProgress = { squishiness < 1f }) {
measurable,
constraints ->
- qqsHeight.value = lookaheadSize.height
+ viewModel.qqsHeight = lookaheadSize.height
val placeable = measurable.measure(constraints)
layout(placeable.width, placeable.height) { placeable.place(0, 0) }
}
- .padding(top = { qqsPadding }, bottom = { bottomPadding.roundToPx() })
+ .padding(top = { qqsPadding }, bottom = { bottomPadding })
) {
- val qsEnabled by viewModel.qsEnabled.collectAsStateWithLifecycle()
- if (qsEnabled) {
+ if (viewModel.isQsEnabled) {
QuickQuickSettings(
viewModel = viewModel.containerViewModel.quickQuickSettingsViewModel,
modifier =
@@ -583,7 +591,7 @@ constructor(
@Composable
private fun SceneScope.QuickSettingsElement() {
- val qqsPadding by viewModel.qqsHeaderHeight.collectAsStateWithLifecycle()
+ val qqsPadding = viewModel.qqsHeaderHeight
val qsExtraPadding = dimensionResource(R.dimen.qs_panel_padding_top)
Column(
modifier =
@@ -591,8 +599,7 @@ constructor(
stringResource(id = R.string.accessibility_quick_settings_collapse)
)
) {
- val qsEnabled by viewModel.qsEnabled.collectAsStateWithLifecycle()
- if (qsEnabled) {
+ if (viewModel.isQsEnabled) {
Box(
modifier =
Modifier.element(ElementKeys.QuickSettingsContent).fillMaxSize().weight(1f)
@@ -602,7 +609,17 @@ constructor(
onDispose { lifecycleScope.launch { scrollState.scrollTo(0) } }
}
- Column(modifier = Modifier.verticalScroll(scrollState)) {
+ Column(
+ modifier =
+ Modifier.offset {
+ IntOffset(
+ x = 0,
+ y = viewModel.qsScrollTranslationY.fastRoundToInt(),
+ )
+ }
+ .onSizeChanged { viewModel.qsScrollHeight = it.height }
+ .verticalScroll(scrollState)
+ ) {
Spacer(
modifier = Modifier.height { qqsPadding + qsExtraPadding.roundToPx() }
)
diff --git a/packages/SystemUI/src/com/android/systemui/qs/composefragment/viewmodel/QSFragmentComposeViewModel.kt b/packages/SystemUI/src/com/android/systemui/qs/composefragment/viewmodel/QSFragmentComposeViewModel.kt
index 7a8b2c2eb685..e21485b3e85a 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/composefragment/viewmodel/QSFragmentComposeViewModel.kt
+++ b/packages/SystemUI/src/com/android/systemui/qs/composefragment/viewmodel/QSFragmentComposeViewModel.kt
@@ -20,19 +20,31 @@ import android.content.res.Resources
import android.graphics.Rect
import androidx.annotation.FloatRange
import androidx.annotation.VisibleForTesting
+import androidx.compose.runtime.derivedStateOf
+import androidx.compose.runtime.getValue
+import androidx.compose.runtime.mutableStateOf
+import androidx.compose.runtime.setValue
+import androidx.compose.runtime.snapshotFlow
import androidx.lifecycle.LifecycleCoroutineScope
+import com.android.keyguard.BouncerPanelExpansionCalculator
import com.android.systemui.Dumpable
+import com.android.systemui.animation.ShadeInterpolation
import com.android.systemui.common.ui.domain.interactor.ConfigurationInteractor
import com.android.systemui.dagger.qualifiers.Main
import com.android.systemui.deviceentry.domain.interactor.DeviceEntryInteractor
+import com.android.systemui.keyguard.domain.interactor.KeyguardTransitionInteractor
+import com.android.systemui.keyguard.shared.model.Edge
+import com.android.systemui.keyguard.shared.model.KeyguardState
import com.android.systemui.lifecycle.ExclusiveActivatable
+import com.android.systemui.lifecycle.Hydrator
import com.android.systemui.plugins.statusbar.StatusBarStateController
import com.android.systemui.qs.FooterActionsController
-import com.android.systemui.qs.composefragment.viewmodel.QSFragmentComposeViewModel.QSExpansionState
import com.android.systemui.qs.footer.ui.viewmodel.FooterActionsViewModel
import com.android.systemui.qs.panels.domain.interactor.TileSquishinessInteractor
import com.android.systemui.qs.panels.ui.viewmodel.PaginatedGridViewModel
import com.android.systemui.qs.ui.viewmodel.QuickSettingsContainerViewModel
+import com.android.systemui.res.R
+import com.android.systemui.scene.shared.model.Scenes
import com.android.systemui.shade.LargeScreenHeaderHelper
import com.android.systemui.shade.transition.LargeScreenShadeInterpolator
import com.android.systemui.statusbar.StatusBarState
@@ -47,290 +59,313 @@ import dagger.assisted.Assisted
import dagger.assisted.AssistedFactory
import dagger.assisted.AssistedInject
import java.io.PrintWriter
+import kotlinx.coroutines.ExperimentalCoroutinesApi
+import kotlinx.coroutines.awaitCancellation
import kotlinx.coroutines.channels.awaitClose
-import kotlinx.coroutines.flow.MutableStateFlow
-import kotlinx.coroutines.flow.SharingStarted
-import kotlinx.coroutines.flow.StateFlow
-import kotlinx.coroutines.flow.asStateFlow
-import kotlinx.coroutines.flow.combine
+import kotlinx.coroutines.coroutineScope
import kotlinx.coroutines.flow.map
import kotlinx.coroutines.flow.onStart
-import kotlinx.coroutines.flow.stateIn
import kotlinx.coroutines.launch
+@OptIn(ExperimentalCoroutinesApi::class)
class QSFragmentComposeViewModel
@AssistedInject
constructor(
val containerViewModel: QuickSettingsContainerViewModel,
@Main private val resources: Resources,
- private val footerActionsViewModelFactory: FooterActionsViewModel.Factory,
+ footerActionsViewModelFactory: FooterActionsViewModel.Factory,
private val footerActionsController: FooterActionsController,
private val sysuiStatusBarStateController: SysuiStatusBarStateController,
- private val deviceEntryInteractor: DeviceEntryInteractor,
- private val disableFlagsRepository: DisableFlagsRepository,
+ deviceEntryInteractor: DeviceEntryInteractor,
+ disableFlagsRepository: DisableFlagsRepository,
+ keyguardTransitionInteractor: KeyguardTransitionInteractor,
private val largeScreenShadeInterpolator: LargeScreenShadeInterpolator,
- private val configurationInteractor: ConfigurationInteractor,
+ configurationInteractor: ConfigurationInteractor,
private val largeScreenHeaderHelper: LargeScreenHeaderHelper,
private val squishinessInteractor: TileSquishinessInteractor,
private val paginatedGridViewModel: PaginatedGridViewModel,
@Assisted private val lifecycleScope: LifecycleCoroutineScope,
) : Dumpable, ExclusiveActivatable() {
+
+ private val hydrator = Hydrator("QSFragmentComposeViewModel.hydrator")
+
val footerActionsViewModel =
footerActionsViewModelFactory.create(lifecycleScope).also {
lifecycleScope.launch { footerActionsController.init() }
}
- private val _qsBounds = MutableStateFlow(Rect())
-
- private val _qsExpanded = MutableStateFlow(false)
- var isQSExpanded: Boolean
- get() = _qsExpanded.value
- set(value) {
- _qsExpanded.value = value
- }
+ var isQsExpanded by mutableStateOf(false)
- private val _qsVisible = MutableStateFlow(false)
- val qsVisible = _qsVisible.asStateFlow()
- var isQSVisible: Boolean
- get() = qsVisible.value
- set(value) {
- _qsVisible.value = value
- }
+ var isQsVisible by mutableStateOf(false)
// This can only be negative if undefined (in which case it will be -1f), else it will be
// in [0, 1]. In some cases, it could be set back to -1f internally to indicate that it's
// different to every value in [0, 1].
- @FloatRange(from = -1.0, to = 1.0) private val _qsExpansion = MutableStateFlow(-1f)
- var qsExpansionValue: Float
- get() = _qsExpansion.value
- set(value) {
- if (value < 0f) {
- _qsExpansion.value = -1f
- }
- _qsExpansion.value = value.coerceIn(0f, 1f)
- }
+ private var qsExpansion by mutableStateOf(-1f)
- private val _panelFraction = MutableStateFlow(0f)
- var panelExpansionFractionValue: Float
- get() = _panelFraction.value
- set(value) {
- _panelFraction.value = value
+ fun setQsExpansionValue(value: Float) {
+ if (value < 0f) {
+ qsExpansion = -1f
+ } else {
+ qsExpansion = value.coerceIn(0f, 1f)
}
+ }
- private val _squishinessFraction = MutableStateFlow(1f)
- var squishinessFractionValue: Float
- get() = _squishinessFraction.value
- set(value) {
- _squishinessFraction.value = value
- }
+ val isQsFullyCollapsed by derivedStateOf { qsExpansion <= 0f }
- val qqsHeaderHeight =
- configurationInteractor.onAnyConfigurationChange
- .map {
- if (LargeScreenUtils.shouldUseLargeScreenShadeHeader(resources)) {
- 0
- } else {
- largeScreenHeaderHelper.getLargeScreenHeaderHeight()
- }
- }
- .stateIn(lifecycleScope, SharingStarted.WhileSubscribed(), 0)
+ var panelExpansionFraction by mutableStateOf(0f)
- private val _headerAnimating = MutableStateFlow(false)
+ var squishinessFraction by mutableStateOf(1f)
- private val _stackScrollerOverscrolling = MutableStateFlow(false)
- var isStackScrollerOverscrolling: Boolean
- get() = _stackScrollerOverscrolling.value
- set(value) {
- _stackScrollerOverscrolling.value = value
- }
+ val qqsHeaderHeight by
+ hydrator.hydratedStateOf(
+ traceName = "qqsHeaderHeight",
+ initialValue = 0,
+ source =
+ configurationInteractor.onAnyConfigurationChange.map {
+ if (LargeScreenUtils.shouldUseLargeScreenShadeHeader(resources)) {
+ 0
+ } else {
+ largeScreenHeaderHelper.getLargeScreenHeaderHeight()
+ }
+ },
+ )
+
+ val qqsBottomPadding by
+ hydrator.hydratedStateOf(
+ traceName = "qqsBottomPadding",
+ initialValue = resources.getDimensionPixelSize(R.dimen.qqs_layout_padding_bottom),
+ source = configurationInteractor.dimensionPixelSize(R.dimen.qqs_layout_padding_bottom),
+ )
+
+ // Starting with a non-zero value makes it so that it has a non-zero height on first expansion
+ // This is important for `QuickSettingsControllerImpl.mMinExpansionHeight` to detect a "change".
+ var qqsHeight by mutableStateOf(1)
+
+ var qsScrollHeight by mutableStateOf(0)
+
+ val heightDiff: Int
+ get() = qsScrollHeight - qqsHeight + qqsBottomPadding
+
+ var isStackScrollerOverscrolling by mutableStateOf(false)
+
+ var proposedTranslation by mutableStateOf(0f)
/**
* Whether QS is enabled by policy. This is normally true, except when it's disabled by some
* policy. See [DisableFlagsRepository].
*/
- val qsEnabled =
- disableFlagsRepository.disableFlags
- .map { it.isQuickSettingsEnabled() }
- .stateIn(
- lifecycleScope,
- SharingStarted.WhileSubscribed(),
- disableFlagsRepository.disableFlags.value.isQuickSettingsEnabled(),
- )
+ val isQsEnabled by
+ hydrator.hydratedStateOf(
+ traceName = "isQsEnabled",
+ initialValue = disableFlagsRepository.disableFlags.value.isQuickSettingsEnabled(),
+ source = disableFlagsRepository.disableFlags.map { it.isQuickSettingsEnabled() },
+ )
+
+ var isInSplitShade by mutableStateOf(false)
+
+ var isTransitioningToFullShade by mutableStateOf(false)
+
+ var lockscreenToShadeProgress by mutableStateOf(0f)
+
+ var isSmallScreen by mutableStateOf(false)
+
+ var heightOverride by mutableStateOf(-1)
+
+ val expansionState by derivedStateOf {
+ if (forceQs) {
+ QSExpansionState(1f)
+ } else {
+ QSExpansionState(qsExpansion.coerceIn(0f, 1f))
+ }
+ }
+
+ val isQsFullyExpanded by derivedStateOf { expansionState.progress >= 1f }
+
+ /**
+ * Accessibility action for collapsing/expanding QS. The provided runnable is responsible for
+ * determining the correct action based on the expansion state.
+ */
+ var collapseExpandAccessibilityAction: Runnable? = null
+
+ val inFirstPage: Boolean
+ get() = paginatedGridViewModel.inFirstPage
+
+ var overScrollAmount by mutableStateOf(0)
+
+ val viewTranslationY by derivedStateOf {
+ if (isOverscrolling) {
+ overScrollAmount.toFloat()
+ } else {
+ if (onKeyguardAndExpanded) {
+ translationScaleY * qqsHeight
+ } else {
+ headerTranslation
+ }
+ }
+ }
+
+ val qsScrollTranslationY by derivedStateOf {
+ val panelTranslationY = translationScaleY * heightDiff
+ if (onKeyguardAndExpanded) panelTranslationY else 0f
+ }
+
+ val viewAlpha by derivedStateOf {
+ when {
+ isInBouncerTransit ->
+ BouncerPanelExpansionCalculator.aboutToShowBouncerProgress(alphaProgress)
+ isKeyguardState -> alphaProgress
+ isSmallScreen -> ShadeInterpolation.getContentAlpha(alphaProgress)
+ else -> largeScreenShadeInterpolator.getQsAlpha(alphaProgress)
+ }
+ }
- private val _keyguardAndExpanded = MutableStateFlow(false)
+ private var qsBounds by mutableStateOf(Rect())
+
+ private val constrainedSquishinessFraction: Float
+ get() = squishinessFraction.constrainSquishiness()
+
+ private var _headerAnimating by mutableStateOf(false)
/**
* Tracks the current [StatusBarState]. It will switch early if the upcoming state is
* [StatusBarState.KEYGUARD]
*/
@get:VisibleForTesting
- val statusBarState =
- conflatedCallbackFlow {
- val callback =
- object : StatusBarStateController.StateListener {
- override fun onStateChanged(newState: Int) {
- trySend(newState)
- }
-
- override fun onUpcomingStateChanged(upcomingState: Int) {
- if (upcomingState == StatusBarState.KEYGUARD) {
- trySend(upcomingState)
+ val statusBarState by
+ hydrator.hydratedStateOf(
+ traceName = "statusBarState",
+ initialValue = sysuiStatusBarStateController.state,
+ source =
+ conflatedCallbackFlow {
+ val callback =
+ object : StatusBarStateController.StateListener {
+ override fun onStateChanged(newState: Int) {
+ trySend(newState)
+ }
+
+ override fun onUpcomingStateChanged(upcomingState: Int) {
+ if (upcomingState == StatusBarState.KEYGUARD) {
+ trySend(upcomingState)
+ }
+ }
}
- }
+ sysuiStatusBarStateController.addCallback(callback)
+
+ awaitClose { sysuiStatusBarStateController.removeCallback(callback) }
}
- sysuiStatusBarStateController.addCallback(callback)
+ .onStart { emit(sysuiStatusBarStateController.state) },
+ )
- awaitClose { sysuiStatusBarStateController.removeCallback(callback) }
- }
- .onStart { emit(sysuiStatusBarStateController.state) }
- .stateIn(
- lifecycleScope,
- SharingStarted.WhileSubscribed(),
- sysuiStatusBarStateController.state,
- )
-
- private val isKeyguardState =
- statusBarState
- .map { it == StatusBarState.KEYGUARD }
- .stateIn(
- lifecycleScope,
- SharingStarted.WhileSubscribed(),
- statusBarState.value == StatusBarState.KEYGUARD,
- )
-
- private val _viewHeight = MutableStateFlow(0)
-
- private val _headerTranslation = MutableStateFlow(0f)
-
- private val _inSplitShade = MutableStateFlow(false)
- var isInSplitShade: Boolean
- get() = _inSplitShade.value
- set(value) {
- _inSplitShade.value = value
- }
+ private val isKeyguardState: Boolean
+ get() = statusBarState == StatusBarState.KEYGUARD
- private val _transitioningToFullShade = MutableStateFlow(false)
- var isTransitioningToFullShade: Boolean
- get() = _transitioningToFullShade.value
- set(value) {
- _transitioningToFullShade.value = value
- }
+ private var viewHeight by mutableStateOf(0)
- private val isBypassEnabled = deviceEntryInteractor.isBypassEnabled
-
- private val showCollapsedOnKeyguard =
- combine(
- isBypassEnabled,
- _transitioningToFullShade,
- _inSplitShade,
- ::calculateShowCollapsedOnKeyguard,
- )
- .stateIn(
- lifecycleScope,
- SharingStarted.WhileSubscribed(),
- calculateShowCollapsedOnKeyguard(
- isBypassEnabled.value,
- isTransitioningToFullShade,
- isInSplitShade,
- ),
- )
+ private val isBypassEnabled by
+ hydrator.hydratedStateOf(
+ traceName = "isBypassEnabled",
+ source = deviceEntryInteractor.isBypassEnabled,
+ )
- private val _lockscreenToShadeProgress = MutableStateFlow(0.0f)
- var lockscreenToShadeProgressValue: Float
- get() = _lockscreenToShadeProgress.value
- set(value) {
- _lockscreenToShadeProgress.value = value
- }
+ private val showCollapsedOnKeyguard by derivedStateOf {
+ isBypassEnabled || (isTransitioningToFullShade && !isInSplitShade)
+ }
- private val _overscrolling = MutableStateFlow(false)
+ private val onKeyguardAndExpanded: Boolean
+ get() = isKeyguardState && !showCollapsedOnKeyguard
- private val _isSmallScreen = MutableStateFlow(false)
- var isSmallScreenValue: Boolean
- get() = _isSmallScreen.value
- set(value) {
- _isSmallScreen.value = value
- }
+ private val isOverscrolling: Boolean
+ get() = overScrollAmount != 0
- private val _shouldUpdateMediaSquishiness = MutableStateFlow(false)
+ private var shouldUpdateMediaSquishiness by mutableStateOf(false)
- private val _heightOverride = MutableStateFlow(-1)
- val heightOverride = _heightOverride.asStateFlow()
- var heightOverrideValue: Int
- get() = heightOverride.value
- set(value) {
- _heightOverride.value = value
- }
+ private val forceQs by derivedStateOf {
+ (isQsExpanded || isStackScrollerOverscrolling) &&
+ (isKeyguardState && !showCollapsedOnKeyguard)
+ }
- private val forceQS =
- combine(
- _qsExpanded,
- _stackScrollerOverscrolling,
- isKeyguardState,
- showCollapsedOnKeyguard,
- ::calculateForceQs,
- )
- .stateIn(
- lifecycleScope,
- SharingStarted.WhileSubscribed(),
- calculateForceQs(
- isQSExpanded,
- isStackScrollerOverscrolling,
- isKeyguardState.value,
- showCollapsedOnKeyguard.value,
- ),
- )
+ private val translationScaleY: Float
+ get() = ((qsExpansion - 1) * (if (isInSplitShade) 1f else SHORT_PARALLAX_AMOUNT))
- val expansionState: StateFlow<QSExpansionState> =
- combine(_qsExpansion, forceQS, ::calculateExpansionState)
- .stateIn(
- lifecycleScope,
- SharingStarted.WhileSubscribed(),
- calculateExpansionState(_qsExpansion.value, forceQS.value),
- )
+ private val headerTranslation by derivedStateOf {
+ if (isTransitioningToFullShade) 0f else proposedTranslation
+ }
- /**
- * Accessibility action for collapsing/expanding QS. The provided runnable is responsible for
- * determining the correct action based on the expansion state.
- */
- var collapseExpandAccessibilityAction: Runnable? = null
+ private val alphaProgress by derivedStateOf {
+ when {
+ isSmallScreen -> 1f
+ isInSplitShade ->
+ if (isTransitioningToFullShade || isKeyguardState) {
+ lockscreenToShadeProgress
+ } else {
+ panelExpansionFraction
+ }
+ isTransitioningToFullShade -> lockscreenToShadeProgress
+ else -> panelExpansionFraction
+ }
+ }
- val inFirstPage: Boolean
- get() = paginatedGridViewModel.inFirstPage
+ private val isInBouncerTransit by
+ hydrator.hydratedStateOf(
+ traceName = "isInBouncerTransit",
+ initialValue = false,
+ source =
+ keyguardTransitionInteractor.isInTransition(
+ Edge.create(to = Scenes.Bouncer),
+ Edge.create(to = KeyguardState.PRIMARY_BOUNCER),
+ ),
+ )
override suspend fun onActivated(): Nothing {
- hydrateSquishinessInteractor()
+ coroutineScope {
+ launch { hydrateSquishinessInteractor() }
+ launch { hydrator.activate() }
+ awaitCancellation()
+ }
}
- private suspend fun hydrateSquishinessInteractor(): Nothing {
- _squishinessFraction.collect {
- squishinessInteractor.setSquishinessValue(it.constrainSquishiness())
- }
+ private suspend fun hydrateSquishinessInteractor() {
+ snapshotFlow { constrainedSquishinessFraction }
+ .collect { squishinessInteractor.setSquishinessValue(it) }
}
override fun dump(pw: PrintWriter, args: Array<out String>) {
pw.asIndenting().run {
printSection("Quick Settings state") {
- println("isQSExpanded", isQSExpanded)
- println("isQSVisible", isQSVisible)
- println("isQSEnabled", qsEnabled.value)
+ println("isQSExpanded", isQsExpanded)
+ println("isQSVisible", isQsVisible)
+ println("isQSEnabled", isQsEnabled)
println("isCustomizing", containerViewModel.editModeViewModel.isEditing.value)
}
printSection("Expansion state") {
- println("qsExpansion", qsExpansionValue)
- println("panelExpansionFraction", panelExpansionFractionValue)
- println("squishinessFraction", squishinessFractionValue)
- println("expansionState", expansionState.value)
- println("forceQS", forceQS.value)
+ println("qsExpansion", qsExpansion)
+ println("panelExpansionFraction", panelExpansionFraction)
+ println("squishinessFraction", squishinessFraction)
+ println("proposedTranslation", proposedTranslation)
+ println("expansionState", expansionState)
+ println("forceQS", forceQs)
+ printSection("Derived values") {
+ println("headerTranslation", headerTranslation)
+ println("translationScaleY", translationScaleY)
+ println("viewTranslationY", viewTranslationY)
+ println("qsScrollTranslationY", qsScrollTranslationY)
+ println("viewAlpha", viewAlpha)
+ }
}
printSection("Shade state") {
println("stackOverscrolling", isStackScrollerOverscrolling)
- println("statusBarState", StatusBarState.toString(statusBarState.value))
- println("isKeyguardState", isKeyguardState.value)
- println("isSmallScreen", isSmallScreenValue)
- println("heightOverride", "${heightOverrideValue}px")
- println("qqsHeaderHeight", "${qqsHeaderHeight.value}px")
+ println("overscrollAmount", overScrollAmount)
+ println("statusBarState", StatusBarState.toString(statusBarState))
+ println("isKeyguardState", isKeyguardState)
+ println("isSmallScreen", isSmallScreen)
+ println("heightOverride", "${heightOverride}px")
+ println("qqsHeaderHeight", "${qqsHeaderHeight}px")
+ println("qqsBottomPadding", "${qqsBottomPadding}px")
println("isSplitShade", isInSplitShade)
- println("showCollapsedOnKeyguard", showCollapsedOnKeyguard.value)
+ println("showCollapsedOnKeyguard", showCollapsedOnKeyguard)
+ println("qqsHeight", "${qqsHeight}px")
+ println("qsScrollHeight", "${qsScrollHeight}px")
}
}
}
@@ -340,7 +375,7 @@ constructor(
fun create(lifecycleScope: LifecycleCoroutineScope): QSFragmentComposeViewModel
}
- // In the future, this will have other relevant elements like squishiness.
+ // In the future, this may have other relevant elements.
data class QSExpansionState(@FloatRange(0.0, 1.0) val progress: Float)
}
@@ -348,30 +383,4 @@ private fun Float.constrainSquishiness(): Float {
return (0.1f + this * 0.9f).coerceIn(0f, 1f)
}
-// Helper methods for combining flows.
-
-private fun calculateExpansionState(expansion: Float, forceQs: Boolean): QSExpansionState {
- return if (forceQs) {
- QSExpansionState(1f)
- } else {
- QSExpansionState(expansion.coerceIn(0f, 1f))
- }
-}
-
-private fun calculateForceQs(
- isQSExpanded: Boolean,
- isStackOverScrolling: Boolean,
- isKeyguardShowing: Boolean,
- shouldShowCollapsedOnKeyguard: Boolean,
-): Boolean {
- return (isQSExpanded || isStackOverScrolling) &&
- (isKeyguardShowing && !shouldShowCollapsedOnKeyguard)
-}
-
-private fun calculateShowCollapsedOnKeyguard(
- isBypassEnabled: Boolean,
- isTransitioningToFullShade: Boolean,
- isInSplitShade: Boolean,
-): Boolean {
- return isBypassEnabled || (isTransitioningToFullShade && !isInSplitShade)
-}
+private val SHORT_PARALLAX_AMOUNT = 0.1f
diff --git a/packages/SystemUI/src/com/android/systemui/qs/panels/data/repository/QSColumnsRepository.kt b/packages/SystemUI/src/com/android/systemui/qs/panels/data/repository/QSColumnsRepository.kt
index 082f622248a1..a9205c27216d 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/panels/data/repository/QSColumnsRepository.kt
+++ b/packages/SystemUI/src/com/android/systemui/qs/panels/data/repository/QSColumnsRepository.kt
@@ -19,40 +19,31 @@ package com.android.systemui.qs.panels.data.repository
import android.content.res.Resources
import com.android.systemui.common.ui.data.repository.ConfigurationRepository
import com.android.systemui.dagger.SysUISingleton
-import com.android.systemui.dagger.qualifiers.Application
import com.android.systemui.dagger.qualifiers.Main
import com.android.systemui.res.R
-import com.android.systemui.shade.shared.flag.DualShade
import com.android.systemui.util.kotlin.emitOnStart
import javax.inject.Inject
-import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.ExperimentalCoroutinesApi
-import kotlinx.coroutines.flow.SharingStarted
-import kotlinx.coroutines.flow.StateFlow
+import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.flowOf
import kotlinx.coroutines.flow.mapLatest
-import kotlinx.coroutines.flow.stateIn
@OptIn(ExperimentalCoroutinesApi::class)
@SysUISingleton
class QSColumnsRepository
@Inject
constructor(
- @Application scope: CoroutineScope,
@Main private val resources: Resources,
configurationRepository: ConfigurationRepository,
) {
- val columns: StateFlow<Int> =
- if (DualShade.isEnabled) {
- flowOf(resources.getInteger(R.integer.quick_settings_dual_shade_num_columns))
- } else {
- configurationRepository.onConfigurationChange.emitOnStart().mapLatest {
- resources.getInteger(R.integer.quick_settings_infinite_grid_num_columns)
- }
- }
- .stateIn(
- scope,
- SharingStarted.WhileSubscribed(),
- resources.getInteger(R.integer.quick_settings_infinite_grid_num_columns),
- )
+ val splitShadeColumns: Flow<Int> =
+ flowOf(resources.getInteger(R.integer.quick_settings_split_shade_num_columns))
+ val dualShadeColumns: Flow<Int> =
+ flowOf(resources.getInteger(R.integer.quick_settings_dual_shade_num_columns))
+ val columns: Flow<Int> =
+ configurationRepository.onConfigurationChange.emitOnStart().mapLatest {
+ resources.getInteger(R.integer.quick_settings_infinite_grid_num_columns)
+ }
+ val defaultColumns: Int =
+ resources.getInteger(R.integer.quick_settings_infinite_grid_num_columns)
}
diff --git a/packages/SystemUI/src/com/android/systemui/qs/panels/domain/interactor/QSColumnsInteractor.kt b/packages/SystemUI/src/com/android/systemui/qs/panels/domain/interactor/QSColumnsInteractor.kt
index 9b45c568dcad..11ea60e874b3 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/panels/domain/interactor/QSColumnsInteractor.kt
+++ b/packages/SystemUI/src/com/android/systemui/qs/panels/domain/interactor/QSColumnsInteractor.kt
@@ -17,11 +17,35 @@
package com.android.systemui.qs.panels.domain.interactor
import com.android.systemui.dagger.SysUISingleton
+import com.android.systemui.dagger.qualifiers.Application
import com.android.systemui.qs.panels.data.repository.QSColumnsRepository
+import com.android.systemui.shade.domain.interactor.ShadeInteractor
+import com.android.systemui.shade.shared.model.ShadeMode
import javax.inject.Inject
+import kotlinx.coroutines.CoroutineScope
+import kotlinx.coroutines.ExperimentalCoroutinesApi
+import kotlinx.coroutines.flow.SharingStarted
import kotlinx.coroutines.flow.StateFlow
+import kotlinx.coroutines.flow.flatMapLatest
+import kotlinx.coroutines.flow.stateIn
@SysUISingleton
-class QSColumnsInteractor @Inject constructor(repo: QSColumnsRepository) {
- val columns: StateFlow<Int> = repo.columns
+class QSColumnsInteractor
+@Inject
+constructor(
+ @Application scope: CoroutineScope,
+ repo: QSColumnsRepository,
+ shadeInteractor: ShadeInteractor,
+) {
+ @OptIn(ExperimentalCoroutinesApi::class)
+ val columns: StateFlow<Int> =
+ shadeInteractor.shadeMode
+ .flatMapLatest {
+ when (it) {
+ ShadeMode.Dual -> repo.dualShadeColumns
+ ShadeMode.Split -> repo.splitShadeColumns
+ ShadeMode.Single -> repo.columns
+ }
+ }
+ .stateIn(scope, SharingStarted.WhileSubscribed(), repo.defaultColumns)
}
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/ModesTile.kt b/packages/SystemUI/src/com/android/systemui/qs/tiles/ModesTile.kt
index 3bbe624595d9..cf2db6c66ce7 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/ModesTile.kt
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/ModesTile.kt
@@ -121,7 +121,7 @@ constructor(
state?.apply {
this.state = tileState.activationState.legacyState
val tileStateIcon = tileState.icon()
- icon = tileStateIcon?.asQSTileIcon(tileState.iconRes) ?: ResourceIcon.get(ICON_RES_ID)
+ icon = tileStateIcon?.asQSTileIcon() ?: ResourceIcon.get(ICON_RES_ID)
label = tileLabel
secondaryLabel = tileState.secondaryLabel
contentDescription = tileState.contentDescription
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/impl/modes/domain/interactor/ModesTileDataInteractor.kt b/packages/SystemUI/src/com/android/systemui/qs/tiles/impl/modes/domain/interactor/ModesTileDataInteractor.kt
index cc14e71986f5..3e44258229f9 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/impl/modes/domain/interactor/ModesTileDataInteractor.kt
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/impl/modes/domain/interactor/ModesTileDataInteractor.kt
@@ -78,14 +78,14 @@ constructor(
} else {
return ModesTileModel(
isActivated = activeModes.isAnyActive(),
- icon = Icon.Resource(ModesTile.ICON_RES_ID, null),
+ icon = context.getDrawable(ModesTile.ICON_RES_ID)!!.asIcon(),
iconResId = ModesTile.ICON_RES_ID,
activeModes = activeModes.modeNames,
)
}
}
- private data class TileIcon(val icon: Icon, val resId: Int?)
+ private data class TileIcon(val icon: Icon.Loaded, val resId: Int?)
private fun getTileIcon(activeMode: ZenModeInfo?): TileIcon {
return if (activeMode != null) {
@@ -96,7 +96,7 @@ constructor(
TileIcon(activeMode.icon.drawable.asIcon(), null)
}
} else {
- TileIcon(Icon.Resource(ModesTile.ICON_RES_ID, null), ModesTile.ICON_RES_ID)
+ TileIcon(context.getDrawable(ModesTile.ICON_RES_ID)!!.asIcon(), ModesTile.ICON_RES_ID)
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/impl/modes/domain/model/ModesTileModel.kt b/packages/SystemUI/src/com/android/systemui/qs/tiles/impl/modes/domain/model/ModesTileModel.kt
index 9c31e322dfd2..db4812342050 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/impl/modes/domain/model/ModesTileModel.kt
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/impl/modes/domain/model/ModesTileModel.kt
@@ -21,12 +21,12 @@ import com.android.systemui.common.shared.model.Icon
data class ModesTileModel(
val isActivated: Boolean,
val activeModes: List<String>,
- val icon: Icon,
+ val icon: Icon.Loaded,
/**
* Resource id corresponding to [icon]. Will only be present if it's know to correspond to a
* resource with a known id in SystemUI (such as resources from `android.R`,
* `com.android.internal.R`, or `com.android.systemui.res` itself).
*/
- val iconResId: Int? = null,
+ val iconResId: Int? = null
)
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/impl/modes/ui/ModesTileMapper.kt b/packages/SystemUI/src/com/android/systemui/qs/tiles/impl/modes/ui/ModesTileMapper.kt
index 537b56bccae8..69da3134314b 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/impl/modes/ui/ModesTileMapper.kt
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/impl/modes/ui/ModesTileMapper.kt
@@ -18,9 +18,7 @@ package com.android.systemui.qs.tiles.impl.modes.ui
import android.content.res.Resources
import android.icu.text.MessageFormat
-import android.util.Log
import android.widget.Button
-import com.android.systemui.common.shared.model.Icon
import com.android.systemui.dagger.qualifiers.Main
import com.android.systemui.qs.tiles.base.interactor.QSTileDataToStateMapper
import com.android.systemui.qs.tiles.impl.modes.domain.model.ModesTileModel
@@ -32,30 +30,14 @@ import javax.inject.Inject
class ModesTileMapper
@Inject
-constructor(@Main private val resources: Resources, val theme: Resources.Theme) :
- QSTileDataToStateMapper<ModesTileModel> {
+constructor(
+ @Main private val resources: Resources,
+ val theme: Resources.Theme,
+) : QSTileDataToStateMapper<ModesTileModel> {
override fun map(config: QSTileConfig, data: ModesTileModel): QSTileState =
QSTileState.build(resources, theme, config.uiConfig) {
- val loadedIcon: Icon.Loaded =
- when (val dataIcon = data.icon) {
- is Icon.Resource -> {
- if (data.iconResId != dataIcon.res) {
- Log.wtf(
- "ModesTileMapper",
- "Icon.Resource.res & iconResId are not identical",
- )
- }
- iconRes = dataIcon.res
- Icon.Loaded(resources.getDrawable(dataIcon.res, theme), null)
- }
- is Icon.Loaded -> {
- iconRes = data.iconResId
- dataIcon
- }
- }
-
- icon = { loadedIcon }
-
+ iconRes = data.iconResId
+ icon = { data.icon }
activationState =
if (data.isActivated) {
QSTileState.ActivationState.ACTIVE
@@ -65,7 +47,10 @@ constructor(@Main private val resources: Resources, val theme: Resources.Theme)
secondaryLabel = getModesStatus(data, resources)
contentDescription = "$label. $secondaryLabel"
supportedActions =
- setOf(QSTileState.UserAction.CLICK, QSTileState.UserAction.LONG_CLICK)
+ setOf(
+ QSTileState.UserAction.CLICK,
+ QSTileState.UserAction.LONG_CLICK,
+ )
sideViewIcon = QSTileState.SideViewIcon.Chevron
expandedAccessibilityClass = Button::class
}
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/impl/rotation/ui/mapper/RotationLockTileMapper.kt b/packages/SystemUI/src/com/android/systemui/qs/tiles/impl/rotation/ui/mapper/RotationLockTileMapper.kt
index 8e80fb0b4c3e..33dc6ed7a1e8 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/impl/rotation/ui/mapper/RotationLockTileMapper.kt
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/impl/rotation/ui/mapper/RotationLockTileMapper.kt
@@ -17,6 +17,7 @@
package com.android.systemui.qs.tiles.impl.rotation.ui.mapper
import android.content.res.Resources
+import android.hardware.devicestate.DeviceStateManager
import com.android.systemui.common.shared.model.Icon
import com.android.systemui.dagger.qualifiers.Main
import com.android.systemui.qs.tiles.base.interactor.QSTileDataToStateMapper
@@ -25,6 +26,7 @@ import com.android.systemui.qs.tiles.viewmodel.QSTileConfig
import com.android.systemui.qs.tiles.viewmodel.QSTileState
import com.android.systemui.res.R
import com.android.systemui.statusbar.policy.DevicePostureController
+import com.android.systemui.util.Utils.isDeviceFoldable
import javax.inject.Inject
/** Maps [RotationLockTileModel] to [QSTileState]. */
@@ -33,7 +35,8 @@ class RotationLockTileMapper
constructor(
@Main private val resources: Resources,
private val theme: Resources.Theme,
- private val devicePostureController: DevicePostureController
+ private val devicePostureController: DevicePostureController,
+ private val deviceStateManager: DeviceStateManager
) : QSTileDataToStateMapper<RotationLockTileModel> {
override fun map(config: QSTileConfig, data: RotationLockTileModel): QSTileState =
QSTileState.build(resources, theme, config.uiConfig) {
@@ -58,7 +61,7 @@ constructor(
this.icon = {
Icon.Loaded(resources.getDrawable(iconRes!!, theme), contentDescription = null)
}
- if (isDeviceFoldable()) {
+ if (isDeviceFoldable(resources, deviceStateManager)) {
this.secondaryLabel = getSecondaryLabelWithPosture(this.activationState)
}
this.stateDescription = this.secondaryLabel
@@ -67,11 +70,6 @@ constructor(
setOf(QSTileState.UserAction.CLICK, QSTileState.UserAction.LONG_CLICK)
}
- private fun isDeviceFoldable(): Boolean {
- val intArray = resources.getIntArray(com.android.internal.R.array.config_foldedDeviceStates)
- return intArray.isNotEmpty()
- }
-
private fun getSecondaryLabelWithPosture(activationState: QSTileState.ActivationState): String {
val stateNames = resources.getStringArray(R.array.tile_states_rotation)
val stateName =
diff --git a/packages/SystemUI/src/com/android/systemui/reardisplay/RearDisplayDialogController.java b/packages/SystemUI/src/com/android/systemui/reardisplay/RearDisplayDialogController.java
index f02b871b196d..a32bf1ec70ae 100644
--- a/packages/SystemUI/src/com/android/systemui/reardisplay/RearDisplayDialogController.java
+++ b/packages/SystemUI/src/com/android/systemui/reardisplay/RearDisplayDialogController.java
@@ -16,6 +16,8 @@
package com.android.systemui.reardisplay;
+import static android.hardware.devicestate.DeviceState.PROPERTY_FOLDABLE_DISPLAY_CONFIGURATION_OUTER_PRIMARY;
+
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.SuppressLint;
@@ -26,6 +28,7 @@ import android.content.res.Resources;
import android.hardware.devicestate.DeviceState;
import android.hardware.devicestate.DeviceStateManager;
import android.hardware.devicestate.DeviceStateManagerGlobal;
+import android.hardware.devicestate.feature.flags.Flags;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup.LayoutParams;
@@ -42,6 +45,8 @@ import com.android.systemui.statusbar.policy.ConfigurationController;
import com.airbnb.lottie.LottieAnimationView;
import com.airbnb.lottie.LottieDrawable;
+import java.util.ArrayList;
+import java.util.List;
import java.util.concurrent.Executor;
import javax.inject.Inject;
@@ -66,11 +71,12 @@ public class RearDisplayDialogController implements
ConfigurationController.ConfigurationListener,
CommandQueue.Callbacks {
- private int[] mFoldedStates;
+ private List<Integer> mFoldedStates;
private boolean mStartedFolded;
private boolean mServiceNotified = false;
private int mAnimationRepeatCount = LottieDrawable.INFINITE;
+ private final DeviceStateManager mDeviceStateManager;
private DeviceStateManagerGlobal mDeviceStateManagerGlobal;
private DeviceStateManager.DeviceStateCallback mDeviceStateManagerCallback =
new DeviceStateManagerCallback();
@@ -90,12 +96,14 @@ public class RearDisplayDialogController implements
@Main Executor executor,
@Main Resources resources,
LayoutInflater layoutInflater,
- SystemUIDialog.Factory systemUIDialogFactory) {
+ SystemUIDialog.Factory systemUIDialogFactory,
+ DeviceStateManager deviceStateManager) {
mCommandQueue = commandQueue;
mExecutor = executor;
mResources = resources;
mLayoutInflater = layoutInflater;
mSystemUIDialogFactory = systemUIDialogFactory;
+ mDeviceStateManager = deviceStateManager;
}
@Override
@@ -180,10 +188,23 @@ public class RearDisplayDialogController implements
*/
private void initializeValues(int startingBaseState) {
mRearDisplayEducationDialog = mSystemUIDialogFactory.create();
- // TODO(b/329170810): Refactor and remove with updated DeviceStateManager values.
- if (mFoldedStates == null) {
- mFoldedStates = mResources.getIntArray(
- com.android.internal.R.array.config_foldedDeviceStates);
+ if (Flags.deviceStatePropertyMigration()) {
+ if (mFoldedStates == null) {
+ mFoldedStates = new ArrayList<>();
+ List<DeviceState> deviceStates = mDeviceStateManager.getSupportedDeviceStates();
+ for (int i = 0; i < deviceStates.size(); i++) {
+ DeviceState state = deviceStates.get(i);
+ if (state.hasProperty(PROPERTY_FOLDABLE_DISPLAY_CONFIGURATION_OUTER_PRIMARY)) {
+ mFoldedStates.add(state.getIdentifier());
+ }
+ }
+ }
+ } else {
+ // TODO(b/329170810): Refactor and remove with updated DeviceStateManager values.
+ if (mFoldedStates == null) {
+ mFoldedStates = copyIntArrayToList(mResources.getIntArray(
+ com.android.internal.R.array.config_foldedDeviceStates));
+ }
}
mStartedFolded = isFoldedState(startingBaseState);
mDeviceStateManagerGlobal = DeviceStateManagerGlobal.getInstance();
@@ -191,9 +212,17 @@ public class RearDisplayDialogController implements
mExecutor);
}
+ private List<Integer> copyIntArrayToList(int[] intArray) {
+ List<Integer> integerList = new ArrayList<>(intArray.length);
+ for (int i = 0; i < intArray.length; i++) {
+ integerList.add(intArray[i]);
+ }
+ return integerList;
+ }
+
private boolean isFoldedState(int state) {
- for (int i = 0; i < mFoldedStates.length; i++) {
- if (mFoldedStates[i] == state) return true;
+ for (int i = 0; i < mFoldedStates.size(); i++) {
+ if (mFoldedStates.get(i) == state) return true;
}
return false;
}
@@ -213,7 +242,7 @@ public class RearDisplayDialogController implements
* TestAPI to allow us to set the folded states array, instead of reading from resources.
*/
@TestApi
- void setFoldedStates(int[] foldedStates) {
+ void setFoldedStates(List<Integer> foldedStates) {
mFoldedStates = foldedStates;
}
diff --git a/packages/SystemUI/src/com/android/systemui/recents/OverviewProxyService.java b/packages/SystemUI/src/com/android/systemui/recents/OverviewProxyService.java
index 559c2637ed4f..ce9c441654bf 100644
--- a/packages/SystemUI/src/com/android/systemui/recents/OverviewProxyService.java
+++ b/packages/SystemUI/src/com/android/systemui/recents/OverviewProxyService.java
@@ -87,7 +87,6 @@ import com.android.systemui.contextualeducation.GestureType;
import com.android.systemui.dagger.SysUISingleton;
import com.android.systemui.dagger.qualifiers.Main;
import com.android.systemui.dump.DumpManager;
-import com.android.systemui.education.domain.interactor.KeyboardTouchpadEduStatsInteractor;
import com.android.systemui.keyguard.KeyguardUnlockAnimationController;
import com.android.systemui.keyguard.KeyguardWmStateRefactor;
import com.android.systemui.keyguard.WakefulnessLifecycle;
@@ -160,8 +159,6 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis
private final Provider<SceneInteractor> mSceneInteractor;
private final Provider<ShadeInteractor> mShadeInteractor;
- private final KeyboardTouchpadEduStatsInteractor mKeyboardTouchpadEduStatsInteractor;
-
private final Runnable mConnectionRunnable = () ->
internalConnectToCurrentUser("runnable: startConnectionToCurrentUser");
private final ComponentName mRecentsComponentName;
@@ -660,8 +657,7 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis
AssistUtils assistUtils,
DumpManager dumpManager,
Optional<UnfoldTransitionProgressForwarder> unfoldTransitionProgressForwarder,
- BroadcastDispatcher broadcastDispatcher,
- KeyboardTouchpadEduStatsInteractor keyboardTouchpadEduStatsInteractor
+ BroadcastDispatcher broadcastDispatcher
) {
// b/241601880: This component should only be running for primary users or
// secondaryUsers when visibleBackgroundUsers are supported.
@@ -699,7 +695,6 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis
mDisplayTracker = displayTracker;
mUnfoldTransitionProgressForwarder = unfoldTransitionProgressForwarder;
mBroadcastDispatcher = broadcastDispatcher;
- mKeyboardTouchpadEduStatsInteractor = keyboardTouchpadEduStatsInteractor;
if (!KeyguardWmStateRefactor.isEnabled()) {
mSysuiUnlockAnimationController = sysuiUnlockAnimationController;
@@ -940,19 +935,6 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis
return isEnabled() && !QuickStepContract.isLegacyMode(mNavBarMode);
}
- /**
- * Updates contextual education stats when a gesture is triggered
- * @param isTrackpadGesture indicates if the gesture is triggered by trackpad
- * @param gestureType type of gesture triggered
- */
- public void updateContextualEduStats(boolean isTrackpadGesture, GestureType gestureType) {
- if (isTrackpadGesture) {
- mKeyboardTouchpadEduStatsInteractor.updateShortcutTriggerTime(gestureType);
- } else {
- mKeyboardTouchpadEduStatsInteractor.incrementSignalCount(gestureType);
- }
- }
-
public boolean isEnabled() {
return mIsEnabled;
}
@@ -978,6 +960,17 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis
}
}
+ /**
+ * Updates contextual education stats when a gesture is triggered
+ * @param isTrackpadGesture indicates if the gesture is triggered by trackpad
+ * @param gestureType type of gesture triggered
+ */
+ public void updateContextualEduStats(boolean isTrackpadGesture, GestureType gestureType) {
+ for (int i = mConnectionCallbacks.size() - 1; i >= 0; --i) {
+ mConnectionCallbacks.get(i).updateContextualEduStats(isTrackpadGesture, gestureType);
+ }
+ }
+
private void notifyHomeRotationEnabled(boolean enabled) {
for (int i = mConnectionCallbacks.size() - 1; i >= 0; --i) {
mConnectionCallbacks.get(i).onHomeRotationEnabled(enabled);
@@ -1207,6 +1200,9 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis
/** Set override of home button long press duration, touch slop multiplier, and haptic. */
default void setOverrideHomeButtonLongPress(
long override, float slopMultiplier, boolean haptic) {}
+ /** Updates contextual education stats when target gesture type is triggered. */
+ default void updateContextualEduStats(
+ boolean isTrackpadGesture, GestureType gestureType) {}
}
/**
diff --git a/packages/SystemUI/src/com/android/systemui/screenshot/ScreenshotActionsProvider.kt b/packages/SystemUI/src/com/android/systemui/screenshot/ScreenshotActionsProvider.kt
index c216f1da2dc1..1c232e9ddced 100644
--- a/packages/SystemUI/src/com/android/systemui/screenshot/ScreenshotActionsProvider.kt
+++ b/packages/SystemUI/src/com/android/systemui/screenshot/ScreenshotActionsProvider.kt
@@ -18,13 +18,16 @@ package com.android.systemui.screenshot
import android.app.assist.AssistContent
import android.content.Context
+import android.net.Uri
import android.util.Log
import androidx.appcompat.content.res.AppCompatResources
import com.android.internal.logging.UiEventLogger
+import com.android.systemui.Flags.screenshotContextUrl
import com.android.systemui.log.DebugLogger.debugLog
import com.android.systemui.res.R
import com.android.systemui.screenshot.ActionIntentCreator.createEdit
import com.android.systemui.screenshot.ActionIntentCreator.createShareWithSubject
+import com.android.systemui.screenshot.ActionIntentCreator.createShareWithText
import com.android.systemui.screenshot.ScreenshotEvent.SCREENSHOT_EDIT_TAPPED
import com.android.systemui.screenshot.ScreenshotEvent.SCREENSHOT_PREVIEW_TAPPED
import com.android.systemui.screenshot.ScreenshotEvent.SCREENSHOT_SHARE_TAPPED
@@ -76,6 +79,7 @@ constructor(
private var onScrollClick: Runnable? = null
private var pendingAction: ((ScreenshotSavedResult) -> Unit)? = null
private var result: ScreenshotSavedResult? = null
+ private var webUri: Uri? = null
init {
actionsCallback.providePreviewAction(
@@ -86,7 +90,7 @@ constructor(
actionExecutor.startSharedTransition(
createEdit(result.uri, context),
result.user,
- true
+ true,
)
}
}
@@ -103,11 +107,14 @@ constructor(
debugLog(LogConfig.DEBUG_ACTIONS) { "Share tapped" }
uiEventLogger.log(SCREENSHOT_SHARE_TAPPED, 0, request.packageNameString)
onDeferrableActionTapped { result ->
- actionExecutor.startSharedTransition(
- createShareWithSubject(result.uri, result.subject),
- result.user,
- false
- )
+ val uri = webUri
+ val shareIntent =
+ if (screenshotContextUrl() && uri != null) {
+ createShareWithText(result.uri, extraText = uri.toString())
+ } else {
+ createShareWithSubject(result.uri, result.subject)
+ }
+ actionExecutor.startSharedTransition(shareIntent, result.user, false)
}
}
@@ -125,7 +132,7 @@ constructor(
actionExecutor.startSharedTransition(
createEdit(result.uri, context),
result.user,
- true
+ true,
)
}
}
@@ -161,6 +168,10 @@ constructor(
pendingAction?.invoke(result)
}
+ override fun onAssistContent(assistContent: AssistContent?) {
+ webUri = assistContent?.webUri
+ }
+
private fun onDeferrableActionTapped(onResult: (ScreenshotSavedResult) -> Unit) {
result?.let { onResult.invoke(it) } ?: run { pendingAction = onResult }
}
diff --git a/packages/SystemUI/src/com/android/systemui/screenshot/policy/CaptureType.kt b/packages/SystemUI/src/com/android/systemui/screenshot/policy/CaptureType.kt
index 0ef5207cad37..945520126474 100644
--- a/packages/SystemUI/src/com/android/systemui/screenshot/policy/CaptureType.kt
+++ b/packages/SystemUI/src/com/android/systemui/screenshot/policy/CaptureType.kt
@@ -24,8 +24,8 @@ sealed interface CaptureType {
data class FullScreen(val displayId: Int) : CaptureType
/** Capture the contents of the task only. */
- data class IsolatedTask(
- val taskId: Int,
- val taskBounds: Rect?,
- ) : CaptureType
+ data class IsolatedTask(val taskId: Int, val taskBounds: Rect?) : CaptureType
+
+ data class RootTask(val parentTaskId: Int, val taskBounds: Rect?, val childTaskIds: List<Int>) :
+ CaptureType
}
diff --git a/packages/SystemUI/src/com/android/systemui/screenshot/policy/PolicyRequestProcessor.kt b/packages/SystemUI/src/com/android/systemui/screenshot/policy/PolicyRequestProcessor.kt
index 039143a1907d..e840668688a0 100644
--- a/packages/SystemUI/src/com/android/systemui/screenshot/policy/PolicyRequestProcessor.kt
+++ b/packages/SystemUI/src/com/android/systemui/screenshot/policy/PolicyRequestProcessor.kt
@@ -26,6 +26,7 @@ import android.os.UserHandle
import android.util.Log
import android.view.WindowManager.TAKE_SCREENSHOT_FULLSCREEN
import android.view.WindowManager.TAKE_SCREENSHOT_PROVIDED_IMAGE
+import com.android.systemui.Flags.screenshotPolicySplitAndDesktopMode
import com.android.systemui.dagger.qualifiers.Background
import com.android.systemui.screenshot.ImageCapture
import com.android.systemui.screenshot.ScreenshotData
@@ -47,14 +48,17 @@ class PolicyRequestProcessor(
private val capture: ImageCapture,
/** Provides information about the tasks on a given display */
private val displayTasks: DisplayContentRepository,
- /** The list of policies to apply, in order of priority */
+ /** The legacy list of policy implementations to apply, in order of priority */
private val policies: List<CapturePolicy>,
+ /** Implements the combined policy rules for all profile types. */
+ private val policy: ScreenshotPolicy,
/** The owner to assign for screenshot when a focused task isn't visible */
private val defaultOwner: UserHandle = myUserHandle(),
/** The assigned component when no application has focus, or not visible */
private val defaultComponent: ComponentName,
) : ScreenshotRequestProcessor {
override suspend fun process(original: ScreenshotData): ScreenshotData {
+
if (original.type == TAKE_SCREENSHOT_PROVIDED_IMAGE) {
// The request contains an already captured screenshot, accept it as is.
Log.i(TAG, "Screenshot bitmap provided. No modifications applied.")
@@ -62,6 +66,12 @@ class PolicyRequestProcessor(
}
val displayContent = displayTasks.getDisplayContent(original.displayId)
+ if (screenshotPolicySplitAndDesktopMode()) {
+ Log.i(TAG, "Applying screenshot policy....")
+ val type = policy.apply(displayContent, defaultComponent, defaultOwner)
+ return modify(original, type)
+ }
+
// If policies yield explicit modifications, apply them and return the result
Log.i(TAG, "Applying policy checks....")
policies.map { policy ->
@@ -79,10 +89,8 @@ class PolicyRequestProcessor(
}
/** Produce a new [ScreenshotData] using [CaptureParameters] */
- private suspend fun modify(
- original: ScreenshotData,
- updates: CaptureParameters,
- ): ScreenshotData {
+ suspend fun modify(original: ScreenshotData, updates: CaptureParameters): ScreenshotData {
+ Log.d(TAG, "[modify] CaptureParameters = $updates")
// Update and apply bitmap capture depending on the parameters.
val updated =
when (val type = updates.type) {
@@ -94,6 +102,14 @@ class PolicyRequestProcessor(
type.taskId,
type.taskBounds,
)
+ is CaptureType.RootTask ->
+ replaceWithTaskSnapshot(
+ original,
+ updates.component,
+ updates.owner,
+ type.parentTaskId,
+ type.taskBounds,
+ )
is FullScreen ->
replaceWithScreenshot(
original,
diff --git a/packages/SystemUI/src/com/android/systemui/screenshot/policy/RootTaskInfoExt.kt b/packages/SystemUI/src/com/android/systemui/screenshot/policy/RootTaskInfoExt.kt
index f768cfb2ceb5..dd39f92643ce 100644
--- a/packages/SystemUI/src/com/android/systemui/screenshot/policy/RootTaskInfoExt.kt
+++ b/packages/SystemUI/src/com/android/systemui/screenshot/policy/RootTaskInfoExt.kt
@@ -26,9 +26,11 @@ internal fun RootTaskInfo.childTasksTopDown(): Sequence<ChildTaskModel> {
childTaskIds[index],
childTaskNames[index],
childTaskBounds[index],
- childTaskUserIds[index]
+ childTaskUserIds[index],
)
}
}
internal fun RootTaskInfo.hasChildTasks() = childTaskUserIds.isNotEmpty()
+
+internal fun RootTaskInfo.childTaskCount() = childTaskIds.size
diff --git a/packages/SystemUI/src/com/android/systemui/screenshot/policy/ScreenshotPolicy.kt b/packages/SystemUI/src/com/android/systemui/screenshot/policy/ScreenshotPolicy.kt
new file mode 100644
index 000000000000..9967afffb6a0
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/screenshot/policy/ScreenshotPolicy.kt
@@ -0,0 +1,155 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.systemui.screenshot.policy
+
+import android.app.ActivityTaskManager.RootTaskInfo
+import android.app.WindowConfiguration
+import android.app.WindowConfiguration.WINDOWING_MODE_FREEFORM
+import android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN
+import android.app.WindowConfiguration.WINDOWING_MODE_PINNED
+import android.content.ComponentName
+import android.os.UserHandle
+import android.util.Log
+import com.android.systemui.screenshot.data.model.DisplayContentModel
+import com.android.systemui.screenshot.data.model.ProfileType
+import com.android.systemui.screenshot.data.model.ProfileType.PRIVATE
+import com.android.systemui.screenshot.data.model.ProfileType.WORK
+import com.android.systemui.screenshot.data.repository.ProfileTypeRepository
+import com.android.systemui.screenshot.policy.CaptureType.FullScreen
+import com.android.systemui.screenshot.policy.CaptureType.IsolatedTask
+import com.android.systemui.screenshot.policy.CaptureType.RootTask
+import javax.inject.Inject
+
+private const val TAG = "ScreenshotPolicy"
+
+/** Determines what to capture and which user owns the output. */
+class ScreenshotPolicy @Inject constructor(private val profileTypes: ProfileTypeRepository) {
+ /**
+ * Apply the policy to the content, resulting in [CaptureParameters].
+ *
+ * @param content the content of the display
+ * @param defaultComponent the component associated with the screenshot by default
+ * @param defaultOwner the user to own the screenshot by default
+ */
+ suspend fun apply(
+ content: DisplayContentModel,
+ defaultComponent: ComponentName,
+ defaultOwner: UserHandle,
+ ): CaptureParameters {
+ val defaultFullScreen by lazy {
+ CaptureParameters(
+ type = FullScreen(displayId = content.displayId),
+ component = defaultComponent,
+ owner = defaultOwner,
+ )
+ }
+
+ // When the systemUI notification shade is open, disregard tasks.
+ if (content.systemUiState.shadeExpanded) {
+ return defaultFullScreen
+ }
+
+ // find the first (top) RootTask which is visible and not Picture-in-Picture
+ val topRootTask =
+ content.rootTasks.firstOrNull {
+ it.isVisible && it.windowingMode != WindowConfiguration.WINDOWING_MODE_PINNED
+ } ?: return defaultFullScreen
+
+ Log.d(TAG, "topRootTask: $topRootTask")
+ val rootTaskOwners = topRootTask.childTaskUserIds.distinct()
+
+ // Special case: Only WORK in top root task which is full-screen or maximized freeform
+ if (
+ rootTaskOwners.size == 1 &&
+ profileTypes.getProfileType(rootTaskOwners.single()) == WORK &&
+ (topRootTask.isFullScreen() || topRootTask.isMaximizedFreeform())
+ ) {
+ val type =
+ if (topRootTask.childTaskCount() > 1) {
+ RootTask(
+ parentTaskId = topRootTask.taskId,
+ taskBounds = topRootTask.bounds,
+ childTaskIds = topRootTask.childTasksTopDown().map { it.id }.toList(),
+ )
+ } else {
+ IsolatedTask(
+ taskId = topRootTask.childTasksTopDown().first().id,
+ taskBounds = topRootTask.bounds,
+ )
+ }
+ // Capture the RootTask (and all children)
+ return CaptureParameters(
+ type = type,
+ component = topRootTask.topActivity,
+ owner = UserHandle.of(rootTaskOwners.single()),
+ )
+ }
+
+ // In every other case the output will be a full screen capture regardless of content.
+ // For this reason, consider all owners of all visible content on the display (in all
+ // root tasks). This includes all root tasks in free-form mode.
+ val visibleChildTasks =
+ content.rootTasks.filter { it.isVisible }.flatMap { it.childTasksTopDown() }
+
+ val allVisibleProfileTypes =
+ visibleChildTasks
+ .map { it.userId }
+ .distinct()
+ .associate { profileTypes.getProfileType(it) to UserHandle.of(it) }
+
+ // If any visible content belongs to the private profile user -> private profile
+ // otherwise the personal user (including partial screen work content).
+ val ownerHandle =
+ allVisibleProfileTypes[PRIVATE]
+ ?: allVisibleProfileTypes[ProfileType.NONE]
+ ?: defaultOwner
+
+ // Attribute to the component of top-most task owned by this user (or fallback to default)
+ val topComponent =
+ visibleChildTasks.firstOrNull { it.userId == ownerHandle.identifier }?.componentName
+
+ return CaptureParameters(
+ type = FullScreen(content.displayId),
+ component = topComponent ?: topRootTask.topActivity ?: defaultComponent,
+ owner = ownerHandle,
+ )
+ }
+
+ private fun RootTaskInfo.isFullScreen(): Boolean =
+ configuration.windowConfiguration.windowingMode == WINDOWING_MODE_FULLSCREEN
+
+ private fun RootTaskInfo.isMaximizedFreeform(): Boolean {
+ val bounds = configuration.windowConfiguration.bounds
+ val maxBounds = configuration.windowConfiguration.maxBounds
+
+ if (
+ windowingMode != WINDOWING_MODE_FREEFORM ||
+ childTaskCount() != 1 ||
+ childTaskBounds[0] != bounds
+ ) {
+ return false
+ }
+
+ // Maximized floating windows fill maxBounds width
+ if (bounds.width() != maxBounds.width()) {
+ return false
+ }
+
+ // Maximized floating windows fill nearly all the height
+ return (bounds.height().toFloat() / maxBounds.height()) >= 0.89f
+ }
+}
diff --git a/packages/SystemUI/src/com/android/systemui/screenshot/policy/ScreenshotPolicyModule.kt b/packages/SystemUI/src/com/android/systemui/screenshot/policy/ScreenshotPolicyModule.kt
index 2cb9fe7f1a9d..a9c6370bb776 100644
--- a/packages/SystemUI/src/com/android/systemui/screenshot/policy/ScreenshotPolicyModule.kt
+++ b/packages/SystemUI/src/com/android/systemui/screenshot/policy/ScreenshotPolicyModule.kt
@@ -37,7 +37,6 @@ import kotlinx.coroutines.CoroutineDispatcher
@Module
interface ScreenshotPolicyModule {
-
@Binds
@SysUISingleton
fun bindProfileTypeRepository(impl: ProfileTypeRepositoryImpl): ProfileTypeRepository
@@ -67,6 +66,7 @@ interface ScreenshotPolicyModule {
imageCapture: ImageCapture,
displayContentRepo: DisplayContentRepository,
policyListProvider: Provider<List<CapturePolicy>>,
+ standardPolicy: ScreenshotPolicy,
): ScreenshotRequestProcessor {
return PolicyRequestProcessor(
background = background,
@@ -75,7 +75,8 @@ interface ScreenshotPolicyModule {
policies = policyListProvider.get(),
defaultOwner = Process.myUserHandle(),
defaultComponent =
- ComponentName(context.packageName, SystemUIService::class.java.toString())
+ ComponentName(context.packageName, SystemUIService::class.java.toString()),
+ policy = standardPolicy,
)
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/screenshot/policy/WorkProfilePolicy.kt b/packages/SystemUI/src/com/android/systemui/screenshot/policy/WorkProfilePolicy.kt
index 29450a20b1d3..cf90c0a58e94 100644
--- a/packages/SystemUI/src/com/android/systemui/screenshot/policy/WorkProfilePolicy.kt
+++ b/packages/SystemUI/src/com/android/systemui/screenshot/policy/WorkProfilePolicy.kt
@@ -28,7 +28,6 @@ import com.android.systemui.screenshot.policy.CapturePolicy.PolicyResult.NotMatc
import com.android.systemui.screenshot.policy.CaptureType.IsolatedTask
import com.android.wm.shell.shared.desktopmode.DesktopModeStatus
import javax.inject.Inject
-import kotlinx.coroutines.flow.first
/**
* Condition: When the top visible task (excluding PIP mode) belongs to a work user.
@@ -37,10 +36,8 @@ import kotlinx.coroutines.flow.first
*/
class WorkProfilePolicy
@Inject
-constructor(
- private val profileTypes: ProfileTypeRepository,
- private val context: Context,
-) : CapturePolicy {
+constructor(private val profileTypes: ProfileTypeRepository, private val context: Context) :
+ CapturePolicy {
override suspend fun check(content: DisplayContentModel): PolicyResult {
// The systemUI notification shade isn't a work app, skip.
@@ -65,11 +62,7 @@ constructor(
.map { it to it.childTasksTopDown().first() }
.firstOrNull { (_, child) ->
profileTypes.getProfileType(child.userId) == ProfileType.WORK
- }
- ?: return NotMatched(
- policy = NAME,
- reason = WORK_TASK_NOT_TOP,
- )
+ } ?: return NotMatched(policy = NAME, reason = WORK_TASK_NOT_TOP)
// If matched, return parameters needed to modify the request.
return PolicyResult.Matched(
@@ -79,7 +72,7 @@ constructor(
type = IsolatedTask(taskId = childTask.id, taskBounds = childTask.bounds),
component = childTask.componentName ?: rootTask.topActivity,
owner = UserHandle.of(childTask.userId),
- )
+ ),
)
}
diff --git a/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java b/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java
index d652d5bec27b..750f5ad62bab 100644
--- a/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java
+++ b/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java
@@ -32,7 +32,6 @@ import static com.android.systemui.classifier.Classifier.QUICK_SETTINGS;
import static com.android.systemui.classifier.Classifier.UNLOCK;
import static com.android.systemui.keyguard.shared.model.KeyguardState.AOD;
import static com.android.systemui.keyguard.shared.model.KeyguardState.DREAMING;
-import static com.android.systemui.keyguard.shared.model.KeyguardState.DREAMING_LOCKSCREEN_HOSTED;
import static com.android.systemui.keyguard.shared.model.KeyguardState.GONE;
import static com.android.systemui.keyguard.shared.model.KeyguardState.LOCKSCREEN;
import static com.android.systemui.keyguard.shared.model.KeyguardState.OCCLUDED;
@@ -143,7 +142,6 @@ import com.android.systemui.keyguard.shared.model.TransitionState;
import com.android.systemui.keyguard.shared.model.TransitionStep;
import com.android.systemui.keyguard.ui.binder.KeyguardLongPressViewBinder;
import com.android.systemui.keyguard.ui.viewmodel.DreamingToLockscreenTransitionViewModel;
-import com.android.systemui.keyguard.ui.viewmodel.GoneToDreamingLockscreenHostedTransitionViewModel;
import com.android.systemui.keyguard.ui.viewmodel.GoneToDreamingTransitionViewModel;
import com.android.systemui.keyguard.ui.viewmodel.KeyguardBottomAreaViewModel;
import com.android.systemui.keyguard.ui.viewmodel.KeyguardTouchHandlingViewModel;
@@ -604,9 +602,6 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump
private final OccludedToLockscreenTransitionViewModel mOccludedToLockscreenTransitionViewModel;
private final LockscreenToDreamingTransitionViewModel mLockscreenToDreamingTransitionViewModel;
private final GoneToDreamingTransitionViewModel mGoneToDreamingTransitionViewModel;
- private final GoneToDreamingLockscreenHostedTransitionViewModel
- mGoneToDreamingLockscreenHostedTransitionViewModel;
-
private final LockscreenToOccludedTransitionViewModel mLockscreenToOccludedTransitionViewModel;
private final PrimaryBouncerToGoneTransitionViewModel mPrimaryBouncerToGoneTransitionViewModel;
private final SharedNotificationContainerInteractor mSharedNotificationContainerInteractor;
@@ -618,7 +613,6 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump
private final CoroutineDispatcher mMainDispatcher;
private boolean mIsAnyMultiShadeExpanded;
private boolean mIsOcclusionTransitionRunning = false;
- private boolean mIsGoneToDreamingLockscreenHostedTransitionRunning;
private int mDreamingToLockscreenTransitionTranslationY;
private int mLockscreenToDreamingTransitionTranslationY;
private int mGoneToDreamingTransitionTranslationY;
@@ -662,24 +656,6 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump
step.getTransitionState() == TransitionState.RUNNING;
};
- private final Consumer<TransitionStep> mGoneToDreamingLockscreenHostedTransition =
- (TransitionStep step) -> {
- mIsOcclusionTransitionRunning =
- step.getTransitionState() == TransitionState.RUNNING;
- mIsGoneToDreamingLockscreenHostedTransitionRunning = mIsOcclusionTransitionRunning;
- };
-
- private final Consumer<TransitionStep> mLockscreenToDreamingLockscreenHostedTransition =
- (TransitionStep step) -> {
- mIsOcclusionTransitionRunning =
- step.getTransitionState() == TransitionState.RUNNING;
- };
-
- private final Consumer<TransitionStep> mDreamingLockscreenHostedToLockscreenTransition =
- (TransitionStep step) -> {
- mIsOcclusionTransitionRunning =
- step.getTransitionState() == TransitionState.RUNNING;
- };
private final Consumer<TransitionStep> mLockscreenToOccludedTransition =
(TransitionStep step) -> {
@@ -764,8 +740,6 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump
OccludedToLockscreenTransitionViewModel occludedToLockscreenTransitionViewModel,
LockscreenToDreamingTransitionViewModel lockscreenToDreamingTransitionViewModel,
GoneToDreamingTransitionViewModel goneToDreamingTransitionViewModel,
- GoneToDreamingLockscreenHostedTransitionViewModel
- goneToDreamingLockscreenHostedTransitionViewModel,
LockscreenToOccludedTransitionViewModel lockscreenToOccludedTransitionViewModel,
PrimaryBouncerToGoneTransitionViewModel primaryBouncerToGoneTransitionViewModel,
@Main CoroutineDispatcher mainDispatcher,
@@ -804,8 +778,6 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump
mOccludedToLockscreenTransitionViewModel = occludedToLockscreenTransitionViewModel;
mLockscreenToDreamingTransitionViewModel = lockscreenToDreamingTransitionViewModel;
mGoneToDreamingTransitionViewModel = goneToDreamingTransitionViewModel;
- mGoneToDreamingLockscreenHostedTransitionViewModel =
- goneToDreamingLockscreenHostedTransitionViewModel;
mLockscreenToOccludedTransitionViewModel = lockscreenToOccludedTransitionViewModel;
mPrimaryBouncerToGoneTransitionViewModel = primaryBouncerToGoneTransitionViewModel;
mKeyguardTransitionInteractor = keyguardTransitionInteractor;
@@ -1133,25 +1105,6 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump
mDreamingToLockscreenTransitionTranslationY),
setTransitionY(mNotificationStackScrollLayoutController), mMainDispatcher);
- // Gone -> Dreaming hosted in lockscreen
- collectFlow(mView, mKeyguardTransitionInteractor
- .transition(Edge.Companion.create(Scenes.Gone, DREAMING_LOCKSCREEN_HOSTED),
- Edge.Companion.create(GONE, DREAMING_LOCKSCREEN_HOSTED)),
- mGoneToDreamingLockscreenHostedTransition, mMainDispatcher);
- collectFlow(mView, mGoneToDreamingLockscreenHostedTransitionViewModel.getLockscreenAlpha(),
- setTransitionAlpha(mNotificationStackScrollLayoutController),
- mMainDispatcher);
-
- // Lockscreen -> Dreaming hosted in lockscreen
- collectFlow(mView, mKeyguardTransitionInteractor
- .transition(Edge.Companion.create(LOCKSCREEN, DREAMING_LOCKSCREEN_HOSTED)),
- mLockscreenToDreamingLockscreenHostedTransition, mMainDispatcher);
-
- // Dreaming hosted in lockscreen -> Lockscreen
- collectFlow(mView, mKeyguardTransitionInteractor
- .transition(Edge.Companion.create(DREAMING_LOCKSCREEN_HOSTED, LOCKSCREEN)),
- mDreamingLockscreenHostedToLockscreenTransition, mMainDispatcher);
-
// Occluded->Lockscreen
collectFlow(mView, mKeyguardTransitionInteractor.transition(
Edge.Companion.create(OCCLUDED, LOCKSCREEN)),
@@ -1645,11 +1598,6 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump
mAnimateNextPositionUpdate = false;
}
- private boolean shouldAnimateKeyguardStatusViewAlignment() {
- // Do not animate when transitioning from Gone->DreamingLockscreenHosted
- return !mIsGoneToDreamingLockscreenHostedTransitionRunning;
- }
-
private void updateClockAppearance() {
int userSwitcherPreferredY = mStatusBarHeaderHeightKeyguard;
boolean bypassEnabled = mKeyguardBypassController.getBypassEnabled();
@@ -1660,7 +1608,7 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump
mKeyguardStatusViewController.displayClock(computeDesiredClockSize(),
shouldAnimateClockChange);
}
- updateKeyguardStatusViewAlignment(/* animate= */shouldAnimateKeyguardStatusViewAlignment());
+ updateKeyguardStatusViewAlignment(/* animate= */true);
int userSwitcherHeight = mKeyguardQsUserSwitchController != null
? mKeyguardQsUserSwitchController.getUserIconHeight() : 0;
if (mKeyguardUserSwitcherController != null) {
@@ -1807,10 +1755,6 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump
// overlap.
return true;
}
- if (isActiveDreamLockscreenHosted()) {
- // Dreaming hosted in lockscreen, no "visible" notifications. Safe to center the clock.
- return true;
- }
if (mNotificationListContainer.hasPulsingNotifications()) {
// Pulsing notification appears on the right. Move clock left to avoid overlap.
return false;
@@ -1840,10 +1784,6 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump
}
- private boolean isActiveDreamLockscreenHosted() {
- return mKeyguardInteractor.isActiveDreamLockscreenHosted().getValue();
- }
-
private boolean hasVisibleNotifications() {
if (FooterViewRefactor.isEnabled()) {
return mActiveNotificationsInteractor.getAreAnyNotificationsPresentValue()
diff --git a/packages/SystemUI/src/com/android/systemui/shade/NotificationShadeWindowViewController.java b/packages/SystemUI/src/com/android/systemui/shade/NotificationShadeWindowViewController.java
index 5699557c14e7..36449bee8bf6 100644
--- a/packages/SystemUI/src/com/android/systemui/shade/NotificationShadeWindowViewController.java
+++ b/packages/SystemUI/src/com/android/systemui/shade/NotificationShadeWindowViewController.java
@@ -16,7 +16,6 @@
package com.android.systemui.shade;
-import static com.android.systemui.flags.Flags.LOCKSCREEN_WALLPAPER_DREAM_ENABLED;
import static com.android.systemui.keyguard.shared.model.KeyguardState.DREAMING;
import static com.android.systemui.keyguard.shared.model.KeyguardState.LOCKSCREEN;
import static com.android.systemui.statusbar.StatusBarState.KEYGUARD;
@@ -103,7 +102,6 @@ public class NotificationShadeWindowViewController implements Dumpable {
private final KeyguardUnlockAnimationController mKeyguardUnlockAnimationController;
private final AmbientState mAmbientState;
private final PulsingGestureListener mPulsingGestureListener;
- private final LockscreenHostedDreamGestureListener mLockscreenHostedDreamGestureListener;
private final NotificationInsetsController mNotificationInsetsController;
private final FeatureFlagsClassic mFeatureFlagsClassic;
private final SysUIKeyEventHandler mSysUIKeyEventHandler;
@@ -114,7 +112,6 @@ public class NotificationShadeWindowViewController implements Dumpable {
private final GlanceableHubContainerController
mGlanceableHubContainerController;
private GestureDetector mPulsingWakeupGestureHandler;
- private GestureDetector mDreamingWakeupGestureHandler;
private View mBrightnessMirror;
private boolean mTouchActive;
private boolean mTouchCancelled;
@@ -182,7 +179,6 @@ public class NotificationShadeWindowViewController implements Dumpable {
ShadeLogger shadeLogger,
DumpManager dumpManager,
PulsingGestureListener pulsingGestureListener,
- LockscreenHostedDreamGestureListener lockscreenHostedDreamGestureListener,
KeyguardTransitionInteractor keyguardTransitionInteractor,
GlanceableHubContainerController glanceableHubContainerController,
NotificationLaunchAnimationInteractor notificationLaunchAnimationInteractor,
@@ -212,7 +208,6 @@ public class NotificationShadeWindowViewController implements Dumpable {
mKeyguardUnlockAnimationController = keyguardUnlockAnimationController;
mAmbientState = ambientState;
mPulsingGestureListener = pulsingGestureListener;
- mLockscreenHostedDreamGestureListener = lockscreenHostedDreamGestureListener;
mNotificationInsetsController = notificationInsetsController;
mKeyguardTransitionInteractor = keyguardTransitionInteractor;
mGlanceableHubContainerController = glanceableHubContainerController;
@@ -327,10 +322,6 @@ public class NotificationShadeWindowViewController implements Dumpable {
mStackScrollLayout = mView.findViewById(R.id.notification_stack_scroller);
mPulsingWakeupGestureHandler = new GestureDetector(mView.getContext(),
mPulsingGestureListener);
- if (mFeatureFlagsClassic.isEnabled(LOCKSCREEN_WALLPAPER_DREAM_ENABLED)) {
- mDreamingWakeupGestureHandler = new GestureDetector(mView.getContext(),
- mLockscreenHostedDreamGestureListener);
- }
mView.setLayoutInsetsController(mNotificationInsetsController);
mView.setInteractionEventHandler(new NotificationShadeWindowView.InteractionEventHandler() {
boolean mUseDragDownHelperForTouch = false;
@@ -402,10 +393,6 @@ public class NotificationShadeWindowViewController implements Dumpable {
// GlanceableHubContainerController is only used pre-flexiglass.
return logDownDispatch(ev, "dispatched to glanceable hub container", true);
}
- if (mDreamingWakeupGestureHandler != null
- && mDreamingWakeupGestureHandler.onTouchEvent(ev)) {
- return logDownDispatch(ev, "dream wakeup gesture handled", true);
- }
if (mBrightnessMirror != null
&& mBrightnessMirror.getVisibility() == View.VISIBLE) {
// Disallow new pointers while the brightness mirror is visible. This is so that
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java b/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java
index 769abafed69f..f99d8f140670 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java
@@ -32,7 +32,6 @@ import static com.android.keyguard.KeyguardUpdateMonitor.BIOMETRIC_HELP_FACE_NOT
import static com.android.keyguard.KeyguardUpdateMonitor.BIOMETRIC_HELP_FACE_NOT_RECOGNIZED;
import static com.android.keyguard.KeyguardUpdateMonitor.BIOMETRIC_HELP_FINGERPRINT_NOT_RECOGNIZED;
import static com.android.systemui.DejankUtils.whitelistIpcs;
-import static com.android.systemui.flags.Flags.LOCKSCREEN_WALLPAPER_DREAM_ENABLED;
import static com.android.systemui.keyguard.KeyguardIndicationRotateTextViewController.IMPORTANT_MSG_MIN_DURATION;
import static com.android.systemui.keyguard.KeyguardIndicationRotateTextViewController.INDICATION_IS_DISMISSIBLE;
import static com.android.systemui.keyguard.KeyguardIndicationRotateTextViewController.INDICATION_TYPE_ADAPTIVE_AUTH;
@@ -226,18 +225,8 @@ public class KeyguardIndicationController {
private KeyguardUpdateMonitorCallback mUpdateMonitorCallback;
private boolean mDozing;
- private boolean mIsActiveDreamLockscreenHosted;
private final ScreenLifecycle mScreenLifecycle;
@VisibleForTesting
- final Consumer<Boolean> mIsActiveDreamLockscreenHostedCallback =
- (Boolean isLockscreenHosted) -> {
- if (mIsActiveDreamLockscreenHosted == isLockscreenHosted) {
- return;
- }
- mIsActiveDreamLockscreenHosted = isLockscreenHosted;
- updateDeviceEntryIndication(false);
- };
- @VisibleForTesting
final Consumer<Set<Integer>> mCoExAcquisitionMsgIdsToShowCallback =
(Set<Integer> coExFaceAcquisitionMsgIdsToShow) -> mCoExFaceAcquisitionMsgIdsToShow =
coExFaceAcquisitionMsgIdsToShow;
@@ -423,10 +412,6 @@ public class KeyguardIndicationController {
intentFilter.addAction(Intent.ACTION_USER_REMOVED);
mBroadcastDispatcher.registerReceiver(mBroadcastReceiver, intentFilter);
}
- if (mFeatureFlags.isEnabled(LOCKSCREEN_WALLPAPER_DREAM_ENABLED)) {
- collectFlow(mIndicationArea, mKeyguardInteractor.isActiveDreamLockscreenHosted(),
- mIsActiveDreamLockscreenHostedCallback);
- }
collectFlow(mIndicationArea,
mBiometricMessageInteractor.getCoExFaceAcquisitionMsgIdsToShow(),
@@ -1032,12 +1017,6 @@ public class KeyguardIndicationController {
return;
}
- // Device is dreaming and the dream is hosted in lockscreen
- if (mIsActiveDreamLockscreenHosted) {
- mIndicationArea.setVisibility(GONE);
- return;
- }
-
// A few places might need to hide the indication, so always start by making it visible
mIndicationArea.setVisibility(VISIBLE);
@@ -1247,7 +1226,6 @@ public class KeyguardIndicationController {
pw.println(" mBiometricMessageFollowUp: " + mBiometricMessageFollowUp);
pw.println(" mBatteryLevel: " + mBatteryLevel);
pw.println(" mBatteryPresent: " + mBatteryPresent);
- pw.println(" mIsActiveDreamLockscreenHosted: " + mIsActiveDreamLockscreenHosted);
pw.println(" AOD text: " + (
mTopIndicationView == null ? null : mTopIndicationView.getText()));
pw.println(" computePowerIndication(): " + computePowerIndication());
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShadeDepthController.kt b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShadeDepthController.kt
index 5c45f3d1bbc8..1db7fb429629 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShadeDepthController.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShadeDepthController.kt
@@ -32,14 +32,15 @@ import androidx.annotation.VisibleForTesting
import androidx.dynamicanimation.animation.FloatPropertyCompat
import androidx.dynamicanimation.animation.SpringAnimation
import androidx.dynamicanimation.animation.SpringForce
-import com.android.systemui.Dumpable
import com.android.app.animation.Interpolators
+import com.android.systemui.Dumpable
import com.android.systemui.animation.ShadeInterpolation
import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.dump.DumpManager
import com.android.systemui.plugins.statusbar.StatusBarStateController
import com.android.systemui.shade.ShadeExpansionChangeEvent
import com.android.systemui.shade.ShadeExpansionListener
+import com.android.systemui.shared.Flags.ambientAod
import com.android.systemui.statusbar.phone.BiometricUnlockController
import com.android.systemui.statusbar.phone.BiometricUnlockController.MODE_WAKE_AND_UNLOCK
import com.android.systemui.statusbar.phone.DozeParameters
@@ -54,10 +55,13 @@ import kotlin.math.max
import kotlin.math.sign
/**
- * Controller responsible for statusbar window blur.
+ * Responsible for blurring the notification shade window, and applying a zoom effect to the
+ * wallpaper.
*/
@SysUISingleton
-class NotificationShadeDepthController @Inject constructor(
+class NotificationShadeDepthController
+@Inject
+constructor(
private val statusBarStateController: StatusBarStateController,
private val blurUtils: BlurUtils,
private val biometricUnlockController: BiometricUnlockController,
@@ -69,7 +73,7 @@ class NotificationShadeDepthController @Inject constructor(
private val context: Context,
private val splitShadeStateController: SplitShadeStateController,
dumpManager: DumpManager,
- configurationController: ConfigurationController
+ configurationController: ConfigurationController,
) : ShadeExpansionListener, Dumpable {
companion object {
private const val WAKE_UP_ANIMATION_ENABLED = true
@@ -85,8 +89,7 @@ class NotificationShadeDepthController @Inject constructor(
private var keyguardAnimator: Animator? = null
private var notificationAnimator: Animator? = null
private var updateScheduled: Boolean = false
- @VisibleForTesting
- var shadeExpansion = 0f
+ @VisibleForTesting var shadeExpansion = 0f
private var isClosed: Boolean = true
private var isOpen: Boolean = false
private var isBlurred: Boolean = false
@@ -106,13 +109,13 @@ class NotificationShadeDepthController @Inject constructor(
var shadeAnimation = DepthAnimation()
- @VisibleForTesting
- var brightnessMirrorSpring = DepthAnimation()
+ @VisibleForTesting var brightnessMirrorSpring = DepthAnimation()
var brightnessMirrorVisible: Boolean = false
set(value) {
field = value
- brightnessMirrorSpring.animateTo(if (value) blurUtils.blurRadiusOfRatio(1f).toInt()
- else 0)
+ brightnessMirrorSpring.animateTo(
+ if (value) blurUtils.blurRadiusOfRatio(1f).toInt() else 0
+ )
}
var qsPanelExpansion = 0f
@@ -126,9 +129,7 @@ class NotificationShadeDepthController @Inject constructor(
scheduleUpdate()
}
- /**
- * How much we're transitioning to the full shade
- */
+ /** How much we're transitioning to the full shade */
var transitionToFullShadeProgress = 0f
set(value) {
if (field == value) return
@@ -160,19 +161,15 @@ class NotificationShadeDepthController @Inject constructor(
shadeAnimation.finishIfRunning()
}
- /**
- * We're unlocking, and should not blur as the panel expansion changes.
- */
+ /** We're unlocking, and should not blur as the panel expansion changes. */
var blursDisabledForUnlock: Boolean = false
- set(value) {
- if (field == value) return
- field = value
- scheduleUpdate()
- }
+ set(value) {
+ if (field == value) return
+ field = value
+ scheduleUpdate()
+ }
- /**
- * Force stop blur effect when necessary.
- */
+ /** Force stop blur effect when necessary. */
private var scrimsVisible: Boolean = false
set(value) {
if (field == value) return
@@ -180,9 +177,7 @@ class NotificationShadeDepthController @Inject constructor(
scheduleUpdate()
}
- /**
- * Blur radius of the wake-up animation on this frame.
- */
+ /** Blur radius of the wake-up animation on this frame. */
private var wakeAndUnlockBlurRadius = 0f
set(value) {
if (field == value) return
@@ -191,15 +186,23 @@ class NotificationShadeDepthController @Inject constructor(
}
private fun computeBlurAndZoomOut(): Pair<Int, Float> {
- val animationRadius = MathUtils.constrain(shadeAnimation.radius,
- blurUtils.minBlurRadius.toFloat(), blurUtils.maxBlurRadius.toFloat())
- val expansionRadius = blurUtils.blurRadiusOfRatio(
+ val animationRadius =
+ MathUtils.constrain(
+ shadeAnimation.radius,
+ blurUtils.minBlurRadius.toFloat(),
+ blurUtils.maxBlurRadius.toFloat(),
+ )
+ val expansionRadius =
+ blurUtils.blurRadiusOfRatio(
ShadeInterpolation.getNotificationScrimAlpha(
- if (shouldApplyShadeBlur()) shadeExpansion else 0f))
- var combinedBlur = (expansionRadius * INTERACTION_BLUR_FRACTION +
+ if (shouldApplyShadeBlur()) shadeExpansion else 0f
+ )
+ )
+ var combinedBlur =
+ (expansionRadius * INTERACTION_BLUR_FRACTION +
animationRadius * ANIMATION_BLUR_FRACTION)
- val qsExpandedRatio = ShadeInterpolation.getNotificationScrimAlpha(qsPanelExpansion) *
- shadeExpansion
+ val qsExpandedRatio =
+ ShadeInterpolation.getNotificationScrimAlpha(qsPanelExpansion) * shadeExpansion
combinedBlur = max(combinedBlur, blurUtils.blurRadiusOfRatio(qsExpandedRatio))
combinedBlur = max(combinedBlur, blurUtils.blurRadiusOfRatio(transitionToFullShadeProgress))
var shadeRadius = max(combinedBlur, wakeAndUnlockBlurRadius)
@@ -231,83 +234,97 @@ class NotificationShadeDepthController @Inject constructor(
return Pair(blur, zoomOut)
}
- /**
- * Callback that updates the window blur value and is called only once per frame.
- */
+ /** Callback that updates the window blur value and is called only once per frame. */
@VisibleForTesting
- val updateBlurCallback = Choreographer.FrameCallback {
- updateScheduled = false
- val (blur, zoomOut) = computeBlurAndZoomOut()
- val opaque = scrimsVisible && !blursDisabledForAppLaunch
- Trace.traceCounter(Trace.TRACE_TAG_APP, "shade_blur_radius", blur)
- blurUtils.applyBlur(root.viewRootImpl, blur, opaque)
- lastAppliedBlur = blur
- wallpaperController.setNotificationShadeZoom(zoomOut)
- listeners.forEach {
- it.onWallpaperZoomOutChanged(zoomOut)
- it.onBlurRadiusChanged(blur)
- }
- notificationShadeWindowController.setBackgroundBlurRadius(blur)
- }
-
- /**
- * Animate blurs when unlocking.
- */
- private val keyguardStateCallback = object : KeyguardStateController.Callback {
- override fun onKeyguardFadingAwayChanged() {
- if (!keyguardStateController.isKeyguardFadingAway ||
- biometricUnlockController.mode != MODE_WAKE_AND_UNLOCK) {
- return
+ val updateBlurCallback =
+ Choreographer.FrameCallback {
+ updateScheduled = false
+ val (blur, zoomOut) = computeBlurAndZoomOut()
+ val opaque = scrimsVisible && !blursDisabledForAppLaunch
+ Trace.traceCounter(Trace.TRACE_TAG_APP, "shade_blur_radius", blur)
+ blurUtils.applyBlur(root.viewRootImpl, blur, opaque)
+ lastAppliedBlur = blur
+ wallpaperController.setNotificationShadeZoom(zoomOut)
+ listeners.forEach {
+ it.onWallpaperZoomOutChanged(zoomOut)
+ it.onBlurRadiusChanged(blur)
}
+ notificationShadeWindowController.setBackgroundBlurRadius(blur)
+ }
- keyguardAnimator?.cancel()
- keyguardAnimator = ValueAnimator.ofFloat(1f, 0f).apply {
- // keyguardStateController.keyguardFadingAwayDuration might be zero when unlock by
- // fingerprint due to there is no window container, see AppTransition#goodToGo.
- // We use DozeParameters.wallpaperFadeOutDuration as an alternative.
- duration = dozeParameters.wallpaperFadeOutDuration
- startDelay = keyguardStateController.keyguardFadingAwayDelay
- interpolator = Interpolators.FAST_OUT_SLOW_IN
- addUpdateListener { animation: ValueAnimator ->
- wakeAndUnlockBlurRadius =
- blurUtils.blurRadiusOfRatio(animation.animatedValue as Float)
+ /** Animate blurs when unlocking. */
+ private val keyguardStateCallback =
+ object : KeyguardStateController.Callback {
+ override fun onKeyguardFadingAwayChanged() {
+ if (
+ !keyguardStateController.isKeyguardFadingAway ||
+ biometricUnlockController.mode != MODE_WAKE_AND_UNLOCK
+ ) {
+ return
}
- addListener(object : AnimatorListenerAdapter() {
- override fun onAnimationEnd(animation: Animator) {
- keyguardAnimator = null
- wakeAndUnlockBlurRadius = 0f
+
+ keyguardAnimator?.cancel()
+ keyguardAnimator =
+ ValueAnimator.ofFloat(1f, 0f).apply {
+ // keyguardStateController.keyguardFadingAwayDuration might be zero when
+ // unlock by fingerprint due to there is no window container, see
+ // AppTransition#goodToGo. We use DozeParameters.wallpaperFadeOutDuration as
+ // an alternative.
+ duration = dozeParameters.wallpaperFadeOutDuration
+ startDelay = keyguardStateController.keyguardFadingAwayDelay
+ interpolator = Interpolators.FAST_OUT_SLOW_IN
+ addUpdateListener { animation: ValueAnimator ->
+ wakeAndUnlockBlurRadius =
+ blurUtils.blurRadiusOfRatio(animation.animatedValue as Float)
+ }
+ addListener(
+ object : AnimatorListenerAdapter() {
+ override fun onAnimationEnd(animation: Animator) {
+ keyguardAnimator = null
+ wakeAndUnlockBlurRadius = 0f
+ }
+ }
+ )
+ start()
}
- })
- start()
}
- }
- override fun onKeyguardShowingChanged() {
- if (keyguardStateController.isShowing) {
- keyguardAnimator?.cancel()
- notificationAnimator?.cancel()
+ override fun onKeyguardShowingChanged() {
+ if (keyguardStateController.isShowing) {
+ keyguardAnimator?.cancel()
+ notificationAnimator?.cancel()
+ }
}
}
- }
- private val statusBarStateCallback = object : StatusBarStateController.StateListener {
- override fun onStateChanged(newState: Int) {
- updateShadeAnimationBlur(
- shadeExpansion, prevTracking, prevShadeVelocity, prevShadeDirection)
- scheduleUpdate()
- }
+ private val statusBarStateCallback =
+ object : StatusBarStateController.StateListener {
+ override fun onStateChanged(newState: Int) {
+ updateShadeAnimationBlur(
+ shadeExpansion,
+ prevTracking,
+ prevShadeVelocity,
+ prevShadeDirection,
+ )
+ scheduleUpdate()
+ }
- override fun onDozingChanged(isDozing: Boolean) {
- if (isDozing) {
- shadeAnimation.finishIfRunning()
- brightnessMirrorSpring.finishIfRunning()
+ override fun onDozingChanged(isDozing: Boolean) {
+ if (isDozing) {
+ shadeAnimation.finishIfRunning()
+ brightnessMirrorSpring.finishIfRunning()
+ }
}
- }
- override fun onDozeAmountChanged(linear: Float, eased: Float) {
- wakeAndUnlockBlurRadius = blurUtils.blurRadiusOfRatio(eased)
+ override fun onDozeAmountChanged(linear: Float, eased: Float) {
+ wakeAndUnlockBlurRadius =
+ if (ambientAod()) {
+ 0f
+ } else {
+ blurUtils.blurRadiusOfRatio(eased)
+ }
+ }
}
- }
init {
dumpManager.registerCriticalDumpable(javaClass.name, this)
@@ -317,16 +334,19 @@ class NotificationShadeDepthController @Inject constructor(
statusBarStateController.addCallback(statusBarStateCallback)
notificationShadeWindowController.setScrimsVisibilityListener {
// Stop blur effect when scrims is opaque to avoid unnecessary GPU composition.
- visibility -> scrimsVisible = visibility == ScrimController.OPAQUE
+ visibility ->
+ scrimsVisible = visibility == ScrimController.OPAQUE
}
shadeAnimation.setStiffness(SpringForce.STIFFNESS_LOW)
shadeAnimation.setDampingRatio(SpringForce.DAMPING_RATIO_NO_BOUNCY)
updateResources()
- configurationController.addCallback(object : ConfigurationController.ConfigurationListener {
- override fun onConfigChanged(newConfig: Configuration?) {
- updateResources()
+ configurationController.addCallback(
+ object : ConfigurationController.ConfigurationListener {
+ override fun onConfigChanged(newConfig: Configuration?) {
+ updateResources()
+ }
}
- })
+ )
}
private fun updateResources() {
@@ -341,15 +361,15 @@ class NotificationShadeDepthController @Inject constructor(
listeners.remove(listener)
}
- /**
- * Update blurs when pulling down the shade
- */
+ /** Update blurs when pulling down the shade */
override fun onPanelExpansionChanged(event: ShadeExpansionChangeEvent) {
val rawFraction = event.fraction
val tracking = event.tracking
val timestamp = SystemClock.elapsedRealtimeNanos()
- val expansion = MathUtils.saturate(
- (rawFraction - panelPullDownMinFraction) / (1f - panelPullDownMinFraction))
+ val expansion =
+ MathUtils.saturate(
+ (rawFraction - panelPullDownMinFraction) / (1f - panelPullDownMinFraction)
+ )
if (shadeExpansion == expansion && prevTracking == tracking) {
prevTimestamp = timestamp
@@ -360,14 +380,14 @@ class NotificationShadeDepthController @Inject constructor(
if (prevTimestamp < 0) {
prevTimestamp = timestamp
} else {
- deltaTime = MathUtils.constrain(
- ((timestamp - prevTimestamp) / 1E9).toFloat(), 0.00001f, 1f)
+ deltaTime =
+ MathUtils.constrain(((timestamp - prevTimestamp) / 1E9).toFloat(), 0.00001f, 1f)
}
val diff = expansion - shadeExpansion
val shadeDirection = sign(diff).toInt()
- val shadeVelocity = MathUtils.constrain(
- VELOCITY_SCALE * diff / deltaTime, MIN_VELOCITY, MAX_VELOCITY)
+ val shadeVelocity =
+ MathUtils.constrain(VELOCITY_SCALE * diff / deltaTime, MIN_VELOCITY, MAX_VELOCITY)
updateShadeAnimationBlur(expansion, tracking, shadeVelocity, shadeDirection)
prevShadeDirection = shadeDirection
@@ -383,7 +403,7 @@ class NotificationShadeDepthController @Inject constructor(
expansion: Float,
tracking: Boolean,
velocity: Float,
- direction: Int
+ direction: Int,
) {
if (shouldApplyShadeBlur()) {
if (expansion > 0f) {
@@ -432,11 +452,12 @@ class NotificationShadeDepthController @Inject constructor(
private fun animateBlur(blur: Boolean, velocity: Float) {
isBlurred = blur
- val targetBlurNormalized = if (blur && shouldApplyShadeBlur()) {
- 1f
- } else {
- 0f
- }
+ val targetBlurNormalized =
+ if (blur && shouldApplyShadeBlur()) {
+ 1f
+ } else {
+ 0f
+ }
shadeAnimation.setStartVelocity(velocity)
shadeAnimation.animateTo(blurUtils.blurRadiusOfRatio(targetBlurNormalized).toInt())
@@ -453,13 +474,13 @@ class NotificationShadeDepthController @Inject constructor(
}
/**
- * Should blur be applied to the shade currently. This is mainly used to make sure that
- * on the lockscreen, the wallpaper isn't blurred.
+ * Should blur be applied to the shade currently. This is mainly used to make sure that on the
+ * lockscreen, the wallpaper isn't blurred.
*/
private fun shouldApplyShadeBlur(): Boolean {
val state = statusBarStateController.state
return (state == StatusBarState.SHADE || state == StatusBarState.SHADE_LOCKED) &&
- !keyguardStateController.isKeyguardFadingAway
+ !keyguardStateController.isKeyguardFadingAway
}
override fun dump(pw: PrintWriter, args: Array<out String>) {
@@ -483,33 +504,30 @@ class NotificationShadeDepthController @Inject constructor(
* invalidation.
*/
inner class DepthAnimation() {
- /**
- * Blur radius visible on the UI, in pixels.
- */
+ /** Blur radius visible on the UI, in pixels. */
var radius = 0f
- /**
- * Depth ratio of the current blur radius.
- */
+ /** Depth ratio of the current blur radius. */
val ratio
get() = blurUtils.ratioOfBlurRadius(radius)
- /**
- * Radius that we're animating to.
- */
+ /** Radius that we're animating to. */
private var pendingRadius = -1
- private var springAnimation = SpringAnimation(this, object :
- FloatPropertyCompat<DepthAnimation>("blurRadius") {
- override fun setValue(rect: DepthAnimation?, value: Float) {
- radius = value
- scheduleUpdate()
- }
+ private var springAnimation =
+ SpringAnimation(
+ this,
+ object : FloatPropertyCompat<DepthAnimation>("blurRadius") {
+ override fun setValue(rect: DepthAnimation?, value: Float) {
+ radius = value
+ scheduleUpdate()
+ }
- override fun getValue(rect: DepthAnimation?): Float {
- return radius
- }
- })
+ override fun getValue(rect: DepthAnimation?): Float {
+ return radius
+ }
+ },
+ )
init {
springAnimation.spring = SpringForce(0.0f)
@@ -545,13 +563,9 @@ class NotificationShadeDepthController @Inject constructor(
}
}
- /**
- * Invoked when changes are needed in z-space
- */
+ /** Invoked when changes are needed in z-space */
interface DepthListener {
- /**
- * Current wallpaper zoom out, where 0 is the closest, and 1 the farthest
- */
+ /** Current wallpaper zoom out, where 0 is the closest, and 1 the farthest */
fun onWallpaperZoomOutChanged(zoomOut: Float)
fun onBlurRadiusChanged(blurRadius: Int) {}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/core/StatusBarInitializer.kt b/packages/SystemUI/src/com/android/systemui/statusbar/core/StatusBarInitializer.kt
index 2c94632abcda..6201ca553398 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/core/StatusBarInitializer.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/core/StatusBarInitializer.kt
@@ -16,6 +16,7 @@
package com.android.systemui.statusbar.core
import android.app.Fragment
+import android.view.ViewGroup
import androidx.annotation.VisibleForTesting
import com.android.systemui.CoreStartable
import com.android.systemui.fragments.FragmentHostManager
@@ -23,9 +24,11 @@ import com.android.systemui.res.R
import com.android.systemui.statusbar.core.StatusBarInitializer.OnStatusBarViewInitializedListener
import com.android.systemui.statusbar.core.StatusBarInitializer.OnStatusBarViewUpdatedListener
import com.android.systemui.statusbar.phone.PhoneStatusBarTransitions
+import com.android.systemui.statusbar.phone.PhoneStatusBarView
import com.android.systemui.statusbar.phone.PhoneStatusBarViewController
import com.android.systemui.statusbar.phone.fragment.CollapsedStatusBarFragment
-import com.android.systemui.statusbar.phone.fragment.dagger.StatusBarFragmentComponent
+import com.android.systemui.statusbar.phone.fragment.dagger.HomeStatusBarComponent
+import com.android.systemui.statusbar.pipeline.shared.ui.composable.StatusBarRootFactory
import com.android.systemui.statusbar.window.StatusBarWindowController
import dagger.assisted.Assisted
import dagger.assisted.AssistedFactory
@@ -57,7 +60,7 @@ interface StatusBarInitializer : CoreStartable {
* Can be used to retrieve dependencies from that scope, including the status bar root
* view.
*/
- fun onStatusBarViewInitialized(component: StatusBarFragmentComponent)
+ fun onStatusBarViewInitialized(component: HomeStatusBarComponent)
}
interface OnStatusBarViewUpdatedListener {
@@ -77,9 +80,11 @@ class StatusBarInitializerImpl
constructor(
@Assisted private val statusBarWindowController: StatusBarWindowController,
private val collapsedStatusBarFragmentProvider: Provider<CollapsedStatusBarFragment>,
+ private val statusBarRootFactory: StatusBarRootFactory,
+ private val componentFactory: HomeStatusBarComponent.Factory,
private val creationListeners: Set<@JvmSuppressWildcards OnStatusBarViewInitializedListener>,
) : StatusBarInitializer {
- private var component: StatusBarFragmentComponent? = null
+ private var component: HomeStatusBarComponent? = null
@get:VisibleForTesting
var initialized = false
@@ -109,21 +114,57 @@ constructor(
}
private fun doStart() {
+ if (StatusBarSimpleFragment.isEnabled) doComposeStart() else doLegacyStart()
+ }
+
+ /**
+ * Stand up the [PhoneStatusBarView] in a compose root. There will be no
+ * [CollapsedStatusBarFragment] in this mode
+ */
+ private fun doComposeStart() {
+ initialized = true
+ val statusBarRoot =
+ statusBarRootFactory.create(statusBarWindowController.backgroundView as ViewGroup) { cv
+ ->
+ val phoneStatusBarView = cv.findViewById<PhoneStatusBarView>(R.id.status_bar)
+ component =
+ componentFactory.create(phoneStatusBarView).also { component ->
+ // CollapsedStatusBarFragment used to be responsible initializting
+ component.init()
+
+ statusBarViewUpdatedListener?.onStatusBarViewUpdated(
+ component.phoneStatusBarViewController,
+ component.phoneStatusBarTransitions,
+ )
+
+ creationListeners.forEach { listener ->
+ listener.onStatusBarViewInitialized(component)
+ }
+ }
+ }
+
+ // Add the new compose view to the hierarchy because we don't use fragment transactions
+ // anymore
+ val windowBackgroundView = statusBarWindowController.backgroundView as ViewGroup
+ windowBackgroundView.addView(statusBarRoot)
+ }
+
+ private fun doLegacyStart() {
initialized = true
statusBarWindowController.fragmentHostManager
.addTagListener(
CollapsedStatusBarFragment.TAG,
object : FragmentHostManager.FragmentListener {
override fun onFragmentViewCreated(tag: String, fragment: Fragment) {
- val statusBarFragmentComponent =
- (fragment as CollapsedStatusBarFragment).statusBarFragmentComponent
+ component =
+ (fragment as CollapsedStatusBarFragment).homeStatusBarComponent
?: throw IllegalStateException()
statusBarViewUpdatedListener?.onStatusBarViewUpdated(
- statusBarFragmentComponent.phoneStatusBarViewController,
- statusBarFragmentComponent.phoneStatusBarTransitions,
+ component!!.phoneStatusBarViewController,
+ component!!.phoneStatusBarTransitions,
)
creationListeners.forEach { listener ->
- listener.onStatusBarViewInitialized(statusBarFragmentComponent)
+ listener.onStatusBarViewInitialized(component!!)
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/core/StatusBarInitializerStore.kt b/packages/SystemUI/src/com/android/systemui/statusbar/core/StatusBarInitializerStore.kt
index 6c3802676f26..041f0b0fdf93 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/core/StatusBarInitializerStore.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/core/StatusBarInitializerStore.kt
@@ -16,88 +16,52 @@
package com.android.systemui.statusbar.core
-import android.view.Display
-import com.android.systemui.CoreStartable
import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.dagger.qualifiers.Background
import com.android.systemui.display.data.repository.DisplayRepository
+import com.android.systemui.display.data.repository.PerDisplayStore
+import com.android.systemui.display.data.repository.PerDisplayStoreImpl
+import com.android.systemui.display.data.repository.SingleDisplayStore
import com.android.systemui.statusbar.window.StatusBarWindowControllerStore
-import java.util.concurrent.ConcurrentHashMap
import javax.inject.Inject
-import kotlinx.coroutines.CoroutineName
import kotlinx.coroutines.CoroutineScope
-import kotlinx.coroutines.launch
/** Provides per display instances of [StatusBarInitializer]. */
-interface StatusBarInitializerStore {
- /**
- * The instance for the default/main display of the device. For example, on a phone or a tablet,
- * the default display is the internal/built-in display of the device.
- *
- * Note that the id of the default display is [Display.DEFAULT_DISPLAY].
- */
- val defaultDisplay: StatusBarInitializer
-
- /**
- * Returns an instance for a specific display id.
- *
- * @throws IllegalArgumentException if [displayId] doesn't match the id of any existing
- * displays.
- */
- fun forDisplay(displayId: Int): StatusBarInitializer
-}
+interface StatusBarInitializerStore : PerDisplayStore<StatusBarInitializer>
@SysUISingleton
class MultiDisplayStatusBarInitializerStore
@Inject
constructor(
- @Background private val backgroundApplicationScope: CoroutineScope,
+ @Background backgroundApplicationScope: CoroutineScope,
+ displayRepository: DisplayRepository,
private val factory: StatusBarInitializer.Factory,
- private val displayRepository: DisplayRepository,
private val statusBarWindowControllerStore: StatusBarWindowControllerStore,
-) : StatusBarInitializerStore, CoreStartable {
+) :
+ StatusBarInitializerStore,
+ PerDisplayStoreImpl<StatusBarInitializer>(backgroundApplicationScope, displayRepository) {
init {
StatusBarConnectedDisplays.assertInNewMode()
}
- private val perDisplayInitializers = ConcurrentHashMap<Int, StatusBarInitializer>()
-
- override val defaultDisplay: StatusBarInitializer
- get() = forDisplay(Display.DEFAULT_DISPLAY)
-
- override fun forDisplay(displayId: Int): StatusBarInitializer {
- if (displayRepository.getDisplay(displayId) == null) {
- throw IllegalArgumentException("Display with id $displayId doesn't exist.")
- }
- return perDisplayInitializers.computeIfAbsent(displayId) {
- factory.create(
- statusBarWindowController = statusBarWindowControllerStore.forDisplay(displayId)
- )
- }
+ override fun createInstanceForDisplay(displayId: Int): StatusBarInitializer {
+ return factory.create(
+ statusBarWindowController = statusBarWindowControllerStore.forDisplay(displayId)
+ )
}
- override fun start() {
- backgroundApplicationScope.launch(
- CoroutineName("MultiDisplayStatusBarInitializerStore#start")
- ) {
- displayRepository.displayRemovalEvent.collect { removedDisplayId ->
- perDisplayInitializers.remove(removedDisplayId)
- }
- }
- }
+ override val instanceClass = StatusBarInitializer::class.java
}
@SysUISingleton
class SingleDisplayStatusBarInitializerStore
@Inject
-constructor(private val defaultInstance: StatusBarInitializer) : StatusBarInitializerStore {
+constructor(defaultInitializer: StatusBarInitializer) :
+ StatusBarInitializerStore,
+ PerDisplayStore<StatusBarInitializer> by SingleDisplayStore(defaultInitializer) {
init {
StatusBarConnectedDisplays.assertInLegacyMode()
}
-
- override val defaultDisplay: StatusBarInitializer = defaultInstance
-
- override fun forDisplay(displayId: Int): StatusBarInitializer = defaultInstance
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/core/StatusBarOrchestrator.kt b/packages/SystemUI/src/com/android/systemui/statusbar/core/StatusBarOrchestrator.kt
index 47e6c57a5ca7..5e59745cad29 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/core/StatusBarOrchestrator.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/core/StatusBarOrchestrator.kt
@@ -169,11 +169,11 @@ constructor(
}
private fun createAndAddWindow() {
- initializeStatusBarFragment()
+ initializeStatusBarRootView()
statusBarWindowController.attach()
}
- private fun initializeStatusBarFragment() {
+ private fun initializeStatusBarRootView() {
statusBarInitializer.statusBarViewUpdatedListener =
object : StatusBarInitializer.OnStatusBarViewUpdatedListener {
override fun onStatusBarViewUpdated(
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/dagger/StatusBarModule.kt b/packages/SystemUI/src/com/android/systemui/statusbar/dagger/StatusBarModule.kt
index 5aad11fe1034..f65ae67efbf1 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/dagger/StatusBarModule.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/dagger/StatusBarModule.kt
@@ -17,17 +17,22 @@
package com.android.systemui.statusbar.dagger
import android.content.Context
-import com.android.app.viewcapture.ViewCaptureAwareWindowManager
+import com.android.systemui.CameraProtectionLoader
import com.android.systemui.CoreStartable
+import com.android.systemui.SysUICutoutProvider
+import com.android.systemui.SysUICutoutProviderImpl
import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.log.LogBuffer
import com.android.systemui.log.LogBufferFactory
import com.android.systemui.statusbar.core.StatusBarConnectedDisplays
import com.android.systemui.statusbar.data.StatusBarDataLayerModule
import com.android.systemui.statusbar.phone.LightBarController
+import com.android.systemui.statusbar.phone.StatusBarContentInsetsProvider
+import com.android.systemui.statusbar.phone.StatusBarContentInsetsProviderImpl
import com.android.systemui.statusbar.phone.StatusBarSignalPolicy
import com.android.systemui.statusbar.phone.ongoingcall.OngoingCallController
import com.android.systemui.statusbar.phone.ongoingcall.OngoingCallLog
+import com.android.systemui.statusbar.policy.ConfigurationController
import com.android.systemui.statusbar.ui.SystemBarUtilsProxyImpl
import com.android.systemui.statusbar.window.MultiDisplayStatusBarWindowControllerStore
import com.android.systemui.statusbar.window.SingleDisplayStatusBarWindowControllerStore
@@ -108,5 +113,26 @@ abstract class StatusBarModule {
fun provideOngoingCallLogBuffer(factory: LogBufferFactory): LogBuffer {
return factory.create("OngoingCall", 75)
}
+
+ @Provides
+ @SysUISingleton
+ fun sysUiCutoutProvider(
+ factory: SysUICutoutProviderImpl.Factory,
+ context: Context,
+ cameraProtectionLoader: CameraProtectionLoader,
+ ): SysUICutoutProvider {
+ return factory.create(context, cameraProtectionLoader)
+ }
+
+ @Provides
+ @SysUISingleton
+ fun contentInsetsProvider(
+ factory: StatusBarContentInsetsProviderImpl.Factory,
+ context: Context,
+ configurationController: ConfigurationController,
+ sysUICutoutProvider: SysUICutoutProvider,
+ ): StatusBarContentInsetsProvider {
+ return factory.create(context, configurationController, sysUICutoutProvider)
+ }
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/data/StatusBarDataLayerModule.kt b/packages/SystemUI/src/com/android/systemui/statusbar/data/StatusBarDataLayerModule.kt
index 9f878b241d73..e6270b8740a6 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/data/StatusBarDataLayerModule.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/data/StatusBarDataLayerModule.kt
@@ -17,6 +17,7 @@ package com.android.systemui.statusbar.data
import com.android.systemui.statusbar.data.repository.KeyguardStatusBarRepositoryModule
import com.android.systemui.statusbar.data.repository.RemoteInputRepositoryModule
+import com.android.systemui.statusbar.data.repository.StatusBarConfigurationControllerModule
import com.android.systemui.statusbar.data.repository.StatusBarModeRepositoryModule
import com.android.systemui.statusbar.phone.data.StatusBarPhoneDataLayerModule
import dagger.Module
@@ -26,8 +27,9 @@ import dagger.Module
[
KeyguardStatusBarRepositoryModule::class,
RemoteInputRepositoryModule::class,
+ StatusBarConfigurationControllerModule::class,
StatusBarModeRepositoryModule::class,
- StatusBarPhoneDataLayerModule::class
+ StatusBarPhoneDataLayerModule::class,
]
)
object StatusBarDataLayerModule
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/data/repository/StatusBarConfigurationControllerStore.kt b/packages/SystemUI/src/com/android/systemui/statusbar/data/repository/StatusBarConfigurationControllerStore.kt
new file mode 100644
index 000000000000..280d66bcb827
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/data/repository/StatusBarConfigurationControllerStore.kt
@@ -0,0 +1,117 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.systemui.statusbar.data.repository
+
+import android.view.WindowManager.LayoutParams.TYPE_STATUS_BAR
+import com.android.systemui.CoreStartable
+import com.android.systemui.common.ui.GlobalConfig
+import com.android.systemui.dagger.SysUISingleton
+import com.android.systemui.dagger.qualifiers.Background
+import com.android.systemui.display.data.repository.DisplayRepository
+import com.android.systemui.display.data.repository.DisplayWindowPropertiesRepository
+import com.android.systemui.display.data.repository.PerDisplayStore
+import com.android.systemui.display.data.repository.PerDisplayStoreImpl
+import com.android.systemui.display.data.repository.SingleDisplayStore
+import com.android.systemui.statusbar.core.StatusBarConnectedDisplays
+import com.android.systemui.statusbar.phone.ConfigurationControllerImpl
+import com.android.systemui.statusbar.policy.ConfigurationController
+import dagger.Lazy
+import dagger.Module
+import dagger.Provides
+import dagger.multibindings.ClassKey
+import dagger.multibindings.IntoMap
+import javax.inject.Inject
+import kotlinx.coroutines.CoroutineScope
+
+/** Status bar specific interface to disambiguate from the global [ConfigurationController]. */
+interface StatusBarConfigurationController : ConfigurationController
+
+/** Provides per display instances of [ConfigurationController], specifically for the Status Bar. */
+interface StatusBarConfigurationControllerStore : PerDisplayStore<StatusBarConfigurationController>
+
+@SysUISingleton
+class MultiDisplayStatusBarConfigurationControllerStore
+@Inject
+constructor(
+ @Background backgroundApplicationScope: CoroutineScope,
+ displayRepository: DisplayRepository,
+ private val displayWindowPropertiesRepository: DisplayWindowPropertiesRepository,
+ private val configurationControllerFactory: ConfigurationControllerImpl.Factory,
+) :
+ StatusBarConfigurationControllerStore,
+ PerDisplayStoreImpl<StatusBarConfigurationController>(
+ backgroundApplicationScope,
+ displayRepository,
+ ) {
+
+ init {
+ StatusBarConnectedDisplays.assertInNewMode()
+ }
+
+ override fun createInstanceForDisplay(displayId: Int): StatusBarConfigurationController {
+ val displayWindowProperties =
+ displayWindowPropertiesRepository.get(displayId, TYPE_STATUS_BAR)
+ return configurationControllerFactory.create(displayWindowProperties.context)
+ }
+
+ override val instanceClass = StatusBarConfigurationController::class.java
+}
+
+@SysUISingleton
+class SingleDisplayStatusBarConfigurationControllerStore
+@Inject
+constructor(@GlobalConfig globalConfigurationController: ConfigurationController) :
+ StatusBarConfigurationControllerStore,
+ PerDisplayStore<StatusBarConfigurationController> by SingleDisplayStore(
+ globalConfigurationController as StatusBarConfigurationController
+ ) {
+
+ init {
+ StatusBarConnectedDisplays.assertInLegacyMode()
+ }
+}
+
+@Module
+object StatusBarConfigurationControllerModule {
+
+ @Provides
+ @SysUISingleton
+ fun store(
+ singleDisplayLazy: Lazy<SingleDisplayStatusBarConfigurationControllerStore>,
+ multiDisplayLazy: Lazy<MultiDisplayStatusBarConfigurationControllerStore>,
+ ): StatusBarConfigurationControllerStore {
+ return if (StatusBarConnectedDisplays.isEnabled) {
+ multiDisplayLazy.get()
+ } else {
+ singleDisplayLazy.get()
+ }
+ }
+
+ @Provides
+ @SysUISingleton
+ @IntoMap
+ @ClassKey(StatusBarConfigurationControllerStore::class)
+ fun storeAsCoreStartable(
+ multiDisplayLazy: Lazy<MultiDisplayStatusBarConfigurationControllerStore>
+ ): CoreStartable {
+ return if (StatusBarConnectedDisplays.isEnabled) {
+ multiDisplayLazy.get()
+ } else {
+ CoreStartable.NOP
+ }
+ }
+}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/data/repository/StatusBarModePerDisplayRepository.kt b/packages/SystemUI/src/com/android/systemui/statusbar/data/repository/StatusBarModePerDisplayRepository.kt
index 088c86df8437..44bee1d784fc 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/data/repository/StatusBarModePerDisplayRepository.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/data/repository/StatusBarModePerDisplayRepository.kt
@@ -36,7 +36,7 @@ import com.android.systemui.statusbar.data.model.StatusBarMode
import com.android.systemui.statusbar.phone.BoundsPair
import com.android.systemui.statusbar.phone.LetterboxAppearanceCalculator
import com.android.systemui.statusbar.phone.StatusBarBoundsProvider
-import com.android.systemui.statusbar.phone.fragment.dagger.StatusBarFragmentComponent
+import com.android.systemui.statusbar.phone.fragment.dagger.HomeStatusBarComponent
import com.android.systemui.statusbar.phone.ongoingcall.data.repository.OngoingCallRepository
import com.android.systemui.statusbar.phone.ongoingcall.shared.model.OngoingCallModel
import dagger.assisted.Assisted
@@ -174,7 +174,7 @@ constructor(
private val _statusBarBounds = MutableStateFlow(BoundsPair(Rect(), Rect()))
- override fun onStatusBarViewInitialized(component: StatusBarFragmentComponent) {
+ override fun onStatusBarViewInitialized(component: HomeStatusBarComponent) {
val statusBarBoundsProvider = component.boundsProvider
val listener =
object : StatusBarBoundsProvider.BoundsChangeListener {
@@ -196,10 +196,9 @@ constructor(
/** Modifies the raw [StatusBarAttributes] if letterboxing is needed. */
private val modifiedStatusBarAttributes: StateFlow<ModifiedStatusBarAttributes?> =
- combine(
- _originalStatusBarAttributes,
- _statusBarBounds,
- ) { originalAttributes, statusBarBounds ->
+ combine(_originalStatusBarAttributes, _statusBarBounds) {
+ originalAttributes,
+ statusBarBounds ->
if (originalAttributes == null) {
null
} else {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/data/repository/StatusBarModeRepositoryStore.kt b/packages/SystemUI/src/com/android/systemui/statusbar/data/repository/StatusBarModeRepositoryStore.kt
index 154be1f96e8b..2c9fa25d8535 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/data/repository/StatusBarModeRepositoryStore.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/data/repository/StatusBarModeRepositoryStore.kt
@@ -20,7 +20,7 @@ import com.android.systemui.CoreStartable
import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.dagger.qualifiers.DisplayId
import com.android.systemui.statusbar.core.StatusBarInitializer
-import com.android.systemui.statusbar.phone.fragment.dagger.StatusBarFragmentComponent
+import com.android.systemui.statusbar.phone.fragment.dagger.HomeStatusBarComponent
import dagger.Binds
import dagger.Module
import dagger.multibindings.ClassKey
@@ -56,7 +56,7 @@ constructor(
defaultDisplay.start()
}
- override fun onStatusBarViewInitialized(component: StatusBarFragmentComponent) {
+ override fun onStatusBarViewInitialized(component: HomeStatusBarComponent) {
defaultDisplay.onStatusBarViewInitialized(component)
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/events/StatusBarEventsModule.kt b/packages/SystemUI/src/com/android/systemui/statusbar/events/StatusBarEventsModule.kt
index ed964821a5c1..415d99045000 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/events/StatusBarEventsModule.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/events/StatusBarEventsModule.kt
@@ -23,7 +23,7 @@ import dagger.Binds
import dagger.Module
import dagger.Provides
-@Module
+@Module(includes = [SystemEventChipAnimationControllerModule::class])
interface StatusBarEventsModule {
companion object {
@@ -41,4 +41,4 @@ interface StatusBarEventsModule {
fun bindSystemStatusAnimationScheduler(
systemStatusAnimationSchedulerImpl: SystemStatusAnimationSchedulerImpl
): SystemStatusAnimationScheduler
-} \ No newline at end of file
+}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/events/SystemEventChipAnimationController.kt b/packages/SystemUI/src/com/android/systemui/statusbar/events/SystemEventChipAnimationController.kt
index bf7e879bb72f..35816c25e976 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/events/SystemEventChipAnimationController.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/events/SystemEventChipAnimationController.kt
@@ -31,22 +31,46 @@ import androidx.core.animation.AnimatorListenerAdapter
import androidx.core.animation.AnimatorSet
import androidx.core.animation.ValueAnimator
import com.android.internal.annotations.VisibleForTesting
+import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.res.R
import com.android.systemui.statusbar.phone.StatusBarContentInsetsChangedListener
import com.android.systemui.statusbar.phone.StatusBarContentInsetsProvider
+import com.android.systemui.statusbar.window.StatusBarWindowController
import com.android.systemui.statusbar.window.StatusBarWindowControllerStore
import com.android.systemui.util.animation.AnimationUtil.Companion.frames
-import javax.inject.Inject
+import dagger.Module
+import dagger.Provides
+import dagger.assisted.Assisted
+import dagger.assisted.AssistedFactory
+import dagger.assisted.AssistedInject
import kotlin.math.roundToInt
-/**
- * Controls the view for system event animations.
- */
-class SystemEventChipAnimationController @Inject constructor(
- private val context: Context,
- private val statusBarWindowControllerStore: StatusBarWindowControllerStore,
- private val contentInsetsProvider: StatusBarContentInsetsProvider,
-) : SystemStatusAnimationCallback {
+/** Controls the view for system event animations. */
+interface SystemEventChipAnimationController : SystemStatusAnimationCallback {
+
+ /**
+ * Give the chip controller a chance to inflate and configure the chip view before we start
+ * animating
+ */
+ fun prepareChipAnimation(viewCreator: ViewCreator)
+
+ fun init()
+
+ /** Announces [contentDescriptions] for accessibility. */
+ fun announceForAccessibility(contentDescriptions: String)
+
+ override fun onSystemEventAnimationBegin(): Animator
+
+ override fun onSystemEventAnimationFinish(hasPersistentDot: Boolean): Animator
+}
+
+class SystemEventChipAnimationControllerImpl
+@AssistedInject
+constructor(
+ @Assisted private val context: Context,
+ @Assisted private val statusBarWindowController: StatusBarWindowController,
+ @Assisted private val contentInsetsProvider: StatusBarContentInsetsProvider,
+) : SystemEventChipAnimationController {
private lateinit var animationWindowView: FrameLayout
private lateinit var themedContext: ContextThemeWrapper
@@ -57,25 +81,27 @@ class SystemEventChipAnimationController @Inject constructor(
private var animationDirection = LEFT
@VisibleForTesting var chipBounds = Rect()
- private val chipWidth get() = chipBounds.width()
- private val chipRight get() = chipBounds.right
- private val chipLeft get() = chipBounds.left
- private var chipMinWidth = context.resources.getDimensionPixelSize(
- R.dimen.ongoing_appops_chip_min_animation_width)
-
- private val dotSize = context.resources.getDimensionPixelSize(
- R.dimen.ongoing_appops_dot_diameter)
+ private val chipWidth
+ get() = chipBounds.width()
+
+ private val chipRight
+ get() = chipBounds.right
+
+ private val chipLeft
+ get() = chipBounds.left
+
+ private var chipMinWidth =
+ context.resources.getDimensionPixelSize(R.dimen.ongoing_appops_chip_min_animation_width)
+
+ private val dotSize =
+ context.resources.getDimensionPixelSize(R.dimen.ongoing_appops_dot_diameter)
// Use during animation so that multiple animators can update the drawing rect
private var animRect = Rect()
// TODO: move to dagger
@VisibleForTesting var initialized = false
- /**
- * Give the chip controller a chance to inflate and configure the chip view before we start
- * animating
- */
- fun prepareChipAnimation(viewCreator: ViewCreator) {
+ override fun prepareChipAnimation(viewCreator: ViewCreator) {
if (!initialized) {
init()
}
@@ -83,47 +109,62 @@ class SystemEventChipAnimationController @Inject constructor(
// Initialize the animated view
val insets = contentInsetsProvider.getStatusBarContentInsetsForCurrentRotation()
- currentAnimatedView = viewCreator(themedContext).also {
- animationWindowView.addView(
+ currentAnimatedView =
+ viewCreator(themedContext).also {
+ animationWindowView.addView(
it.view,
layoutParamsDefault(
- if (animationWindowView.isLayoutRtl) insets.left
- else insets.right))
- it.view.alpha = 0f
- // For some reason, the window view's measured width is always 0 here, so use the
- // parent (status bar)
- it.view.measure(
+ if (animationWindowView.isLayoutRtl) insets.left else insets.right
+ ),
+ )
+ it.view.alpha = 0f
+ // For some reason, the window view's measured width is always 0 here, so use the
+ // parent (status bar)
+ it.view.measure(
View.MeasureSpec.makeMeasureSpec(
- (animationWindowView.parent as View).width, AT_MOST),
+ (animationWindowView.parent as View).width,
+ AT_MOST,
+ ),
View.MeasureSpec.makeMeasureSpec(
- (animationWindowView.parent as View).height, AT_MOST))
-
- updateChipBounds(it, contentInsetsProvider.getStatusBarContentAreaForCurrentRotation())
- }
+ (animationWindowView.parent as View).height,
+ AT_MOST,
+ ),
+ )
+
+ updateChipBounds(
+ it,
+ contentInsetsProvider.getStatusBarContentAreaForCurrentRotation(),
+ )
+ }
}
override fun onSystemEventAnimationBegin(): Animator {
initializeAnimRect()
- val alphaIn = ValueAnimator.ofFloat(0f, 1f).apply {
- startDelay = 7.frames
- duration = 5.frames
- interpolator = null
- addUpdateListener { currentAnimatedView?.view?.alpha = animatedValue as Float }
- }
+ val alphaIn =
+ ValueAnimator.ofFloat(0f, 1f).apply {
+ startDelay = 7.frames
+ duration = 5.frames
+ interpolator = null
+ addUpdateListener { currentAnimatedView?.view?.alpha = animatedValue as Float }
+ }
currentAnimatedView?.contentView?.alpha = 0f
- val contentAlphaIn = ValueAnimator.ofFloat(0f, 1f).apply {
- startDelay = 10.frames
- duration = 10.frames
- interpolator = null
- addUpdateListener { currentAnimatedView?.contentView?.alpha = animatedValue as Float }
- }
- val moveIn = ValueAnimator.ofInt(chipMinWidth, chipWidth).apply {
- startDelay = 7.frames
- duration = 23.frames
- interpolator = STATUS_BAR_X_MOVE_IN
- addUpdateListener { updateAnimatedViewBoundsWidth(animatedValue as Int) }
- }
+ val contentAlphaIn =
+ ValueAnimator.ofFloat(0f, 1f).apply {
+ startDelay = 10.frames
+ duration = 10.frames
+ interpolator = null
+ addUpdateListener {
+ currentAnimatedView?.contentView?.alpha = animatedValue as Float
+ }
+ }
+ val moveIn =
+ ValueAnimator.ofInt(chipMinWidth, chipWidth).apply {
+ startDelay = 7.frames
+ duration = 23.frames
+ interpolator = STATUS_BAR_X_MOVE_IN
+ addUpdateListener { updateAnimatedViewBoundsWidth(animatedValue as Int) }
+ }
val animSet = AnimatorSet()
animSet.playTogether(alphaIn, contentAlphaIn, moveIn)
return animSet
@@ -131,75 +172,80 @@ class SystemEventChipAnimationController @Inject constructor(
override fun onSystemEventAnimationFinish(hasPersistentDot: Boolean): Animator {
initializeAnimRect()
- val finish = if (hasPersistentDot) {
- createMoveOutAnimationForDot()
- } else {
- createMoveOutAnimationDefault()
- }
+ val finish =
+ if (hasPersistentDot) {
+ createMoveOutAnimationForDot()
+ } else {
+ createMoveOutAnimationDefault()
+ }
- finish.addListener(object : AnimatorListenerAdapter() {
- override fun onAnimationEnd(animation: Animator) {
- animationWindowView.removeView(currentAnimatedView!!.view)
+ finish.addListener(
+ object : AnimatorListenerAdapter() {
+ override fun onAnimationEnd(animation: Animator) {
+ animationWindowView.removeView(currentAnimatedView!!.view)
+ }
}
- })
+ )
return finish
}
private fun createMoveOutAnimationForDot(): Animator {
- val width1 = ValueAnimator.ofInt(chipWidth, chipMinWidth).apply {
- duration = 9.frames
- interpolator = STATUS_CHIP_WIDTH_TO_DOT_KEYFRAME_1
- addUpdateListener {
- updateAnimatedViewBoundsWidth(animatedValue as Int)
+ val width1 =
+ ValueAnimator.ofInt(chipWidth, chipMinWidth).apply {
+ duration = 9.frames
+ interpolator = STATUS_CHIP_WIDTH_TO_DOT_KEYFRAME_1
+ addUpdateListener { updateAnimatedViewBoundsWidth(animatedValue as Int) }
}
- }
- val width2 = ValueAnimator.ofInt(chipMinWidth, dotSize).apply {
- startDelay = 9.frames
- duration = 20.frames
- interpolator = STATUS_CHIP_WIDTH_TO_DOT_KEYFRAME_2
- addUpdateListener {
- updateAnimatedViewBoundsWidth(animatedValue as Int)
+ val width2 =
+ ValueAnimator.ofInt(chipMinWidth, dotSize).apply {
+ startDelay = 9.frames
+ duration = 20.frames
+ interpolator = STATUS_CHIP_WIDTH_TO_DOT_KEYFRAME_2
+ addUpdateListener { updateAnimatedViewBoundsWidth(animatedValue as Int) }
}
- }
val keyFrame1Height = dotSize * 2
val chipVerticalCenter = chipBounds.top + chipBounds.height() / 2
- val height1 = ValueAnimator.ofInt(chipBounds.height(), keyFrame1Height).apply {
- startDelay = 8.frames
- duration = 6.frames
- interpolator = STATUS_CHIP_HEIGHT_TO_DOT_KEYFRAME_1
- addUpdateListener {
- updateAnimatedViewBoundsHeight(animatedValue as Int, chipVerticalCenter)
+ val height1 =
+ ValueAnimator.ofInt(chipBounds.height(), keyFrame1Height).apply {
+ startDelay = 8.frames
+ duration = 6.frames
+ interpolator = STATUS_CHIP_HEIGHT_TO_DOT_KEYFRAME_1
+ addUpdateListener {
+ updateAnimatedViewBoundsHeight(animatedValue as Int, chipVerticalCenter)
+ }
}
- }
- val height2 = ValueAnimator.ofInt(keyFrame1Height, dotSize).apply {
- startDelay = 14.frames
- duration = 15.frames
- interpolator = STATUS_CHIP_HEIGHT_TO_DOT_KEYFRAME_2
- addUpdateListener {
- updateAnimatedViewBoundsHeight(animatedValue as Int, chipVerticalCenter)
+ val height2 =
+ ValueAnimator.ofInt(keyFrame1Height, dotSize).apply {
+ startDelay = 14.frames
+ duration = 15.frames
+ interpolator = STATUS_CHIP_HEIGHT_TO_DOT_KEYFRAME_2
+ addUpdateListener {
+ updateAnimatedViewBoundsHeight(animatedValue as Int, chipVerticalCenter)
+ }
}
- }
// Move the chip view to overlap exactly with the privacy dot. The chip displays by default
// exactly adjacent to the dot, so we can just move over by the diameter of the dot itself
- val moveOut = ValueAnimator.ofInt(0, dotSize).apply {
- startDelay = 3.frames
- duration = 11.frames
- interpolator = STATUS_CHIP_MOVE_TO_DOT
- addUpdateListener {
- // If RTL, we can just invert the move
- val amt = if (animationDirection == LEFT) {
- animatedValue as Int
- } else {
- -(animatedValue as Int)
+ val moveOut =
+ ValueAnimator.ofInt(0, dotSize).apply {
+ startDelay = 3.frames
+ duration = 11.frames
+ interpolator = STATUS_CHIP_MOVE_TO_DOT
+ addUpdateListener {
+ // If RTL, we can just invert the move
+ val amt =
+ if (animationDirection == LEFT) {
+ animatedValue as Int
+ } else {
+ -(animatedValue as Int)
+ }
+ updateAnimatedBoundsX(amt)
}
- updateAnimatedBoundsX(amt)
}
- }
val animSet = AnimatorSet()
animSet.playTogether(width1, width2, height1, height2, moveOut)
@@ -207,71 +253,80 @@ class SystemEventChipAnimationController @Inject constructor(
}
private fun createMoveOutAnimationDefault(): Animator {
- val alphaOut = ValueAnimator.ofFloat(1f, 0f).apply {
- startDelay = 6.frames
- duration = 6.frames
- interpolator = null
- addUpdateListener { currentAnimatedView?.view?.alpha = animatedValue as Float }
- }
+ val alphaOut =
+ ValueAnimator.ofFloat(1f, 0f).apply {
+ startDelay = 6.frames
+ duration = 6.frames
+ interpolator = null
+ addUpdateListener { currentAnimatedView?.view?.alpha = animatedValue as Float }
+ }
- val contentAlphaOut = ValueAnimator.ofFloat(1f, 0f).apply {
- duration = 5.frames
- interpolator = null
- addUpdateListener { currentAnimatedView?.contentView?.alpha = animatedValue as Float }
- }
+ val contentAlphaOut =
+ ValueAnimator.ofFloat(1f, 0f).apply {
+ duration = 5.frames
+ interpolator = null
+ addUpdateListener {
+ currentAnimatedView?.contentView?.alpha = animatedValue as Float
+ }
+ }
- val moveOut = ValueAnimator.ofInt(chipWidth, chipMinWidth).apply {
- duration = 23.frames
- interpolator = STATUS_BAR_X_MOVE_OUT
- addUpdateListener {
- currentAnimatedView?.apply {
- updateAnimatedViewBoundsWidth(animatedValue as Int)
+ val moveOut =
+ ValueAnimator.ofInt(chipWidth, chipMinWidth).apply {
+ duration = 23.frames
+ interpolator = STATUS_BAR_X_MOVE_OUT
+ addUpdateListener {
+ currentAnimatedView?.apply {
+ updateAnimatedViewBoundsWidth(animatedValue as Int)
+ }
}
}
- }
val animSet = AnimatorSet()
animSet.playTogether(alphaOut, contentAlphaOut, moveOut)
return animSet
}
- fun init() {
+ override fun init() {
initialized = true
themedContext = ContextThemeWrapper(context, R.style.Theme_SystemUI_QuickSettings)
- animationWindowView = LayoutInflater.from(themedContext)
- .inflate(R.layout.system_event_animation_window, null) as FrameLayout
+ animationWindowView =
+ LayoutInflater.from(themedContext).inflate(R.layout.system_event_animation_window, null)
+ as FrameLayout
// Matches status_bar.xml
val height = themedContext.resources.getDimensionPixelSize(R.dimen.status_bar_height)
val lp = FrameLayout.LayoutParams(MATCH_PARENT, height)
lp.gravity = Gravity.END or Gravity.TOP
- statusBarWindowControllerStore.defaultDisplay.addViewToWindow(animationWindowView, lp)
+ statusBarWindowController.addViewToWindow(animationWindowView, lp)
animationWindowView.clipToPadding = false
animationWindowView.clipChildren = false
// Use contentInsetsProvider rather than configuration controller, since we only care
// about status bar dimens
- contentInsetsProvider.addCallback(object : StatusBarContentInsetsChangedListener {
- override fun onStatusBarContentInsetsChanged() {
- val newContentArea = contentInsetsProvider
- .getStatusBarContentAreaForCurrentRotation()
- updateDimens(newContentArea)
-
- // If we are currently animating, we have to re-solve for the chip bounds. If we're
- // not animating then [prepareChipAnimation] will take care of it for us
- currentAnimatedView?.let {
- updateChipBounds(it, newContentArea)
- // Since updateCurrentAnimatedView can only be called during an animation, we
- // have to create a dummy animator here to apply the new chip bounds
- val animator = ValueAnimator.ofInt(0, 1).setDuration(0)
- animator.addUpdateListener { updateCurrentAnimatedView() }
- animator.start()
+ contentInsetsProvider.addCallback(
+ object : StatusBarContentInsetsChangedListener {
+ override fun onStatusBarContentInsetsChanged() {
+ val newContentArea =
+ contentInsetsProvider.getStatusBarContentAreaForCurrentRotation()
+ updateDimens(newContentArea)
+
+ // If we are currently animating, we have to re-solve for the chip bounds. If
+ // we're
+ // not animating then [prepareChipAnimation] will take care of it for us
+ currentAnimatedView?.let {
+ updateChipBounds(it, newContentArea)
+ // Since updateCurrentAnimatedView can only be called during an animation,
+ // we
+ // have to create a dummy animator here to apply the new chip bounds
+ val animator = ValueAnimator.ofInt(0, 1).setDuration(0)
+ animator.addUpdateListener { updateCurrentAnimatedView() }
+ animator.start()
+ }
}
}
- })
+ )
}
- /** Announces [contentDescriptions] for accessibility. */
- fun announceForAccessibility(contentDescriptions: String) {
+ override fun announceForAccessibility(contentDescriptions: String) {
currentAnimatedView?.view?.announceForAccessibility(contentDescriptions)
}
@@ -283,9 +338,9 @@ class SystemEventChipAnimationController @Inject constructor(
}
/**
- * Use the current status bar content area and the current chip's measured size to update
- * the animation rect and chipBounds. This method can be called at any time and will update
- * the current animation values properly during e.g. a rotation.
+ * Use the current status bar content area and the current chip's measured size to update the
+ * animation rect and chipBounds. This method can be called at any time and will update the
+ * current animation values properly during e.g. a rotation.
*/
private fun updateChipBounds(chip: BackgroundAnimatableView, contentArea: Rect) {
// decide which direction we're animating from, and then set some screen coordinates
@@ -309,14 +364,13 @@ class SystemEventChipAnimationController @Inject constructor(
}
private fun layoutParamsDefault(marginEnd: Int): FrameLayout.LayoutParams =
- FrameLayout.LayoutParams(WRAP_CONTENT, WRAP_CONTENT).also {
- it.gravity = Gravity.END or Gravity.CENTER_VERTICAL
- it.marginEnd = marginEnd
- }
+ FrameLayout.LayoutParams(WRAP_CONTENT, WRAP_CONTENT).also {
+ it.gravity = Gravity.END or Gravity.CENTER_VERTICAL
+ it.marginEnd = marginEnd
+ }
private fun initializeAnimRect() = animRect.set(chipBounds)
-
/**
* To be called during an animation, sets the width and updates the current animated chip view
*/
@@ -324,7 +378,8 @@ class SystemEventChipAnimationController @Inject constructor(
when (animationDirection) {
LEFT -> {
animRect.set((chipRight - width), animRect.top, chipRight, animRect.bottom)
- } else /* RIGHT */ -> {
+ }
+ else /* RIGHT */ -> {
animRect.set(chipLeft, animRect.top, (chipLeft + width), animRect.bottom)
}
}
@@ -337,44 +392,73 @@ class SystemEventChipAnimationController @Inject constructor(
*/
private fun updateAnimatedViewBoundsHeight(height: Int, verticalCenter: Int) {
animRect.set(
- animRect.left,
- verticalCenter - (height.toFloat() / 2).roundToInt(),
- animRect.right,
- verticalCenter + (height.toFloat() / 2).roundToInt())
+ animRect.left,
+ verticalCenter - (height.toFloat() / 2).roundToInt(),
+ animRect.right,
+ verticalCenter + (height.toFloat() / 2).roundToInt(),
+ )
updateCurrentAnimatedView()
}
- /**
- * To be called during an animation, updates the animation rect offset and updates the chip
- */
+ /** To be called during an animation, updates the animation rect offset and updates the chip */
private fun updateAnimatedBoundsX(translation: Int) {
currentAnimatedView?.view?.translationX = translation.toFloat()
}
- /**
- * To be called during an animation. Sets the chip rect to animRect
- */
+ /** To be called during an animation. Sets the chip rect to animRect */
private fun updateCurrentAnimatedView() {
currentAnimatedView?.setBoundsForAnimation(
- animRect.left, animRect.top, animRect.right, animRect.bottom
+ animRect.left,
+ animRect.top,
+ animRect.right,
+ animRect.bottom,
)
}
+
+ @AssistedFactory
+ interface Factory {
+ fun create(
+ context: Context,
+ statusBarWindowController: StatusBarWindowController,
+ contentInsetsProvider: StatusBarContentInsetsProvider,
+ ): SystemEventChipAnimationControllerImpl
+ }
}
-/**
- * Chips should provide a view that can be animated with something better than a fade-in
- */
+/** Chips should provide a view that can be animated with something better than a fade-in */
interface BackgroundAnimatableView {
val view: View // Since this can't extend View, add a view prop
get() = this as View
+
val contentView: View? // This will be alpha faded during appear and disappear animation
get() = null
+
val chipWidth: Int
get() = view.measuredWidth
+
fun setBoundsForAnimation(l: Int, t: Int, r: Int, b: Int)
}
// Animation directions
private const val LEFT = 1
private const val RIGHT = 2
+
+@Module
+object SystemEventChipAnimationControllerModule {
+
+ @Provides
+ @SysUISingleton
+ fun controller(
+ factory: SystemEventChipAnimationControllerImpl.Factory,
+ context: Context,
+ statusBarWindowControllerStore: StatusBarWindowControllerStore,
+ contentInsetsProvider: StatusBarContentInsetsProvider,
+ ): SystemEventChipAnimationController {
+ return factory.create(
+ context,
+ statusBarWindowControllerStore.defaultDisplay,
+ contentInsetsProvider,
+ )
+ }
+}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/coordinator/DreamCoordinator.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/coordinator/DreamCoordinator.kt
deleted file mode 100644
index d268e358690f..000000000000
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/coordinator/DreamCoordinator.kt
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Copyright (C) 2023 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.systemui.statusbar.notification.collection.coordinator
-
-import com.android.systemui.dagger.qualifiers.Application
-import com.android.systemui.keyguard.data.repository.KeyguardRepository
-import com.android.systemui.plugins.statusbar.StatusBarStateController
-import com.android.systemui.statusbar.StatusBarState
-import com.android.systemui.statusbar.SysuiStatusBarStateController
-import com.android.systemui.statusbar.notification.collection.NotifPipeline
-import com.android.systemui.statusbar.notification.collection.NotificationEntry
-import com.android.systemui.statusbar.notification.collection.coordinator.dagger.CoordinatorScope
-import com.android.systemui.statusbar.notification.collection.listbuilder.pluggable.NotifFilter
-import javax.inject.Inject
-import kotlinx.coroutines.CoroutineScope
-import kotlinx.coroutines.launch
-
-/**
- * Filter out notifications on the lockscreen if the lockscreen hosted dream is active. If the user
- * stops dreaming, pulls the shade down or unlocks the device, then the notifications are unhidden.
- */
-@CoordinatorScope
-class DreamCoordinator
-@Inject
-constructor(
- private val statusBarStateController: SysuiStatusBarStateController,
- @Application private val scope: CoroutineScope,
- private val keyguardRepository: KeyguardRepository,
-) : Coordinator {
- private var isOnKeyguard = false
- private var isLockscreenHostedDream = false
-
- override fun attach(pipeline: NotifPipeline) {
- pipeline.addPreGroupFilter(filter)
- statusBarStateController.addCallback(statusBarStateListener)
- scope.launch { attachFilterOnDreamingStateChange() }
- recordStatusBarState(statusBarStateController.state)
- }
-
- private val filter =
- object : NotifFilter("LockscreenHostedDreamFilter") {
- var isFiltering = false
- override fun shouldFilterOut(entry: NotificationEntry, now: Long): Boolean {
- return isFiltering
- }
- inline fun update(msg: () -> String) {
- val wasFiltering = isFiltering
- isFiltering = isLockscreenHostedDream && isOnKeyguard
- if (wasFiltering != isFiltering) {
- invalidateList(msg())
- }
- }
- }
-
- private val statusBarStateListener =
- object : StatusBarStateController.StateListener {
- override fun onStateChanged(newState: Int) {
- recordStatusBarState(newState)
- }
- }
-
- private suspend fun attachFilterOnDreamingStateChange() {
- keyguardRepository.isActiveDreamLockscreenHosted.collect { isDreaming ->
- recordDreamingState(isDreaming)
- }
- }
-
- private fun recordStatusBarState(newState: Int) {
- isOnKeyguard = newState == StatusBarState.KEYGUARD
- filter.update { "recordStatusBarState: " + StatusBarState.toString(newState) }
- }
-
- private fun recordDreamingState(isDreaming: Boolean) {
- isLockscreenHostedDream = isDreaming
- filter.update { "recordLockscreenHostedDreamState: $isDreaming" }
- }
-}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/coordinator/NotifCoordinators.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/coordinator/NotifCoordinators.kt
index 96c260bb0852..46d4560ff102 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/coordinator/NotifCoordinators.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/coordinator/NotifCoordinators.kt
@@ -15,8 +15,6 @@
*/
package com.android.systemui.statusbar.notification.collection.coordinator
-import com.android.systemui.flags.FeatureFlags
-import com.android.systemui.flags.Flags.LOCKSCREEN_WALLPAPER_DREAM_ENABLED
import com.android.systemui.statusbar.notification.collection.NotifPipeline
import com.android.systemui.statusbar.notification.collection.NotificationClassificationFlag
import com.android.systemui.statusbar.notification.collection.PipelineDumpable
@@ -41,7 +39,6 @@ class NotifCoordinatorsImpl
@Inject
constructor(
sectionStyleProvider: SectionStyleProvider,
- featureFlags: FeatureFlags,
dataStoreCoordinator: DataStoreCoordinator,
hideLocallyDismissedNotifsCoordinator: HideLocallyDismissedNotifsCoordinator,
hideNotifsForOtherUsersCoordinator: HideNotifsForOtherUsersCoordinator,
@@ -70,7 +67,6 @@ constructor(
visualStabilityCoordinator: VisualStabilityCoordinator,
sensitiveContentCoordinator: SensitiveContentCoordinator,
dismissibilityCoordinator: DismissibilityCoordinator,
- dreamCoordinator: DreamCoordinator,
statsLoggerCoordinator: NotificationStatsLoggerCoordinator,
bundleCoordinator: BundleCoordinator,
) : NotifCoordinators {
@@ -115,10 +111,6 @@ constructor(
mCoordinators.add(remoteInputCoordinator)
mCoordinators.add(dismissibilityCoordinator)
- if (featureFlags.isEnabled(LOCKSCREEN_WALLPAPER_DREAM_ENABLED)) {
- mCoordinators.add(dreamCoordinator)
- }
-
if (NotificationsLiveDataStoreRefactor.isEnabled) {
mCoordinators.add(statsLoggerCoordinator)
}
@@ -152,10 +144,7 @@ constructor(
sectionStyleProvider.setMinimizedSections(setOf(rankingCoordinator.minimizedSectioner))
if (SortBySectionTimeFlag.isEnabled) {
sectionStyleProvider.setSilentSections(
- listOf(
- rankingCoordinator.silentSectioner,
- rankingCoordinator.minimizedSectioner,
- )
+ listOf(rankingCoordinator.silentSectioner, rankingCoordinator.minimizedSectioner)
)
} else {
sectionStyleProvider.setSilentSections(
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java
index d828a6700ee6..ec1dc0a77118 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java
@@ -25,6 +25,8 @@ import static com.android.internal.jank.InteractionJankMonitor.CUJ_SHADE_CLEAR_A
import static com.android.systemui.Flags.notificationOverExpansionClippingFix;
import static com.android.systemui.statusbar.notification.stack.NotificationPriorityBucketKt.BUCKET_SILENT;
import static com.android.systemui.statusbar.notification.stack.StackStateAnimator.ANIMATION_DURATION_SWIPE;
+import static com.android.systemui.statusbar.notification.stack.shared.model.AccessibilityScrollEvent.SCROLL_DOWN;
+import static com.android.systemui.statusbar.notification.stack.shared.model.AccessibilityScrollEvent.SCROLL_UP;
import static com.android.systemui.util.DumpUtilsKt.println;
import static com.android.systemui.util.DumpUtilsKt.visibilityString;
@@ -118,8 +120,10 @@ import com.android.systemui.statusbar.notification.shared.NotificationHeadsUpCyc
import com.android.systemui.statusbar.notification.shared.NotificationThrottleHun;
import com.android.systemui.statusbar.notification.shared.NotificationsImprovedHunAnimation;
import com.android.systemui.statusbar.notification.shared.NotificationsLiveDataStoreRefactor;
+import com.android.systemui.statusbar.notification.stack.shared.model.AccessibilityScrollEvent;
import com.android.systemui.statusbar.notification.stack.shared.model.ShadeScrimBounds;
import com.android.systemui.statusbar.notification.stack.shared.model.ShadeScrimShape;
+import com.android.systemui.statusbar.notification.stack.shared.model.ShadeScrollState;
import com.android.systemui.statusbar.notification.stack.ui.view.NotificationScrollView;
import com.android.systemui.statusbar.phone.HeadsUpAppearanceController;
import com.android.systemui.statusbar.phone.ScreenOffAnimationController;
@@ -609,7 +613,7 @@ public class NotificationStackScrollLayout
@Override
public boolean isScrolledToTop() {
if (SceneContainerFlag.isEnabled()) {
- return mScrollViewFields.isScrolledToTop();
+ return mScrollViewFields.getScrollState().isScrolledToTop();
} else {
return mOwnScrollY == 0;
}
@@ -1247,9 +1251,25 @@ public class NotificationStackScrollLayout
}
@Override
- public void setScrolledToTop(boolean scrolledToTop) {
- if (SceneContainerFlag.isUnexpectedlyInLegacyMode()) return;
- mScrollViewFields.setScrolledToTop(scrolledToTop);
+ public void setScrollState(@NonNull ShadeScrollState scrollState) {
+ if (SceneContainerFlag.isUnexpectedlyInLegacyMode()) {
+ return;
+ }
+
+ boolean forwardScrollable =
+ scrollState.getScrollPosition() < scrollState.getMaxScrollPosition();
+ boolean backwardScrollable = scrollState.getScrollPosition() > 0;
+ mScrollable = forwardScrollable || backwardScrollable;
+ mForwardScrollable = forwardScrollable;
+ mBackwardScrollable = backwardScrollable;
+
+ boolean scrollPositionChanged = mScrollViewFields.getScrollState().getScrollPosition()
+ != scrollState.getScrollPosition();
+ mScrollViewFields.setScrollState(scrollState);
+
+ if (scrollPositionChanged) {
+ sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_SCROLLED);
+ }
}
@Override
@@ -1295,6 +1315,12 @@ public class NotificationStackScrollLayout
}
@Override
+ public void setAccessibilityScrollEventConsumer(
+ @Nullable Consumer<AccessibilityScrollEvent> consumer) {
+ mScrollViewFields.setAccessibilityScrollEventConsumer(consumer);
+ }
+
+ @Override
public void setCurrentGestureOverscrollConsumer(@Nullable Consumer<Boolean> consumer) {
if (SceneContainerFlag.isUnexpectedlyInLegacyMode()) return;
mScrollViewFields.setCurrentGestureOverscrollConsumer(consumer);
@@ -2645,6 +2671,11 @@ public class NotificationStackScrollLayout
return mHeadsUpInset;
}
+ @Override
+ public int getStackBottomInset() {
+ return mPaddingBetweenElements + mShelf.getIntrinsicHeight();
+ }
+
/**
* Calculate the gap height between two different views
*
@@ -4243,17 +4274,27 @@ public class NotificationStackScrollLayout
*/
@Override
public boolean performAccessibilityActionInternal(int action, Bundle arguments) {
- // Don't handle scroll accessibility events from the NSSL, when SceneContainer enabled.
- if (SceneContainerFlag.isEnabled()) {
- return super.performAccessibilityActionInternal(action, arguments);
- }
-
if (super.performAccessibilityActionInternal(action, arguments)) {
return true;
}
if (!isEnabled()) {
return false;
}
+
+ if (SceneContainerFlag.isEnabled()) {
+ switch (action) {
+ case AccessibilityNodeInfo.ACTION_SCROLL_FORWARD:
+ case android.R.id.accessibilityActionScrollDown:
+ mScrollViewFields.sendAccessibilityScrollEvent(SCROLL_DOWN);
+ return true;
+ case AccessibilityNodeInfo.ACTION_SCROLL_BACKWARD:
+ case android.R.id.accessibilityActionScrollUp:
+ mScrollViewFields.sendAccessibilityScrollEvent(SCROLL_UP);
+ return true;
+ }
+ return false;
+ }
+
int direction = -1;
switch (action) {
case AccessibilityNodeInfo.ACTION_SCROLL_FORWARD:
@@ -5029,25 +5070,21 @@ public class NotificationStackScrollLayout
@Override
public void onInitializeAccessibilityEventInternal(AccessibilityEvent event) {
super.onInitializeAccessibilityEventInternal(event);
- // Don't handle scroll accessibility events from the NSSL, when SceneContainer enabled.
- if (SceneContainerFlag.isEnabled()) {
- return;
- }
-
event.setScrollable(mScrollable);
event.setMaxScrollX(mScrollX);
- event.setScrollY(mOwnScrollY);
- event.setMaxScrollY(getScrollRange());
+
+ if (SceneContainerFlag.isEnabled()) {
+ event.setScrollY(mScrollViewFields.getScrollState().getScrollPosition());
+ event.setMaxScrollY(mScrollViewFields.getScrollState().getMaxScrollPosition());
+ } else {
+ event.setScrollY(mOwnScrollY);
+ event.setMaxScrollY(getScrollRange());
+ }
}
@Override
public void onInitializeAccessibilityNodeInfoInternal(AccessibilityNodeInfo info) {
super.onInitializeAccessibilityNodeInfoInternal(info);
- // Don't handle scroll accessibility events from the NSSL, when SceneContainer enabled.
- if (SceneContainerFlag.isEnabled()) {
- return;
- }
-
if (mScrollable) {
info.setScrollable(true);
if (mBackwardScrollable) {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutController.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutController.java
index 379a67ed3942..04974b4353f4 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutController.java
@@ -24,6 +24,7 @@ import static com.android.internal.jank.InteractionJankMonitor.CUJ_NOTIFICATION_
import static com.android.server.notification.Flags.screenshareNotificationHiding;
import static com.android.systemui.Dependency.ALLOW_NOTIFICATION_LONG_PRESS_NAME;
import static com.android.systemui.Flags.confineNotificationTouchToViewWidth;
+import static com.android.systemui.Flags.ignoreTouchesNextToNotificationShelf;
import static com.android.systemui.statusbar.StatusBarState.KEYGUARD;
import static com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayout.OnEmptySpaceClickListener;
import static com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayout.OnOverscrollTopChangedListener;
@@ -607,6 +608,16 @@ public class NotificationStackScrollLayoutController implements Dumpable {
true /* requireMinHeight */,
false /* ignoreDecors */,
!confineNotificationTouchToViewWidth() /* ignoreWidth */);
+
+ // Verify the MotionEvent x,y are actually inside the touch area of the shelf,
+ // since the shelf may be animated down to a collapsed size on keyguard.
+ if (ignoreTouchesNextToNotificationShelf()) {
+ if (child instanceof NotificationShelf shelf) {
+ if (!NotificationSwipeHelper.isTouchInView(ev, shelf)) {
+ return null;
+ }
+ }
+ }
if (child instanceof ExpandableNotificationRow row) {
ExpandableNotificationRow parent = row.getNotificationParent();
if (parent != null && parent.areChildrenExpanded()
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationSwipeHelper.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationSwipeHelper.java
index 7e327e66982c..0e94ca351835 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationSwipeHelper.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationSwipeHelper.java
@@ -18,6 +18,7 @@
package com.android.systemui.statusbar.notification.stack;
import static com.android.internal.jank.InteractionJankMonitor.CUJ_NOTIFICATION_SHADE_ROW_SWIPE;
+import static com.android.systemui.Flags.ignoreTouchesNextToNotificationShelf;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
@@ -39,6 +40,7 @@ import com.android.systemui.flags.FeatureFlags;
import com.android.systemui.plugins.FalsingManager;
import com.android.systemui.plugins.statusbar.NotificationMenuRowPlugin;
import com.android.systemui.plugins.statusbar.NotificationSwipeActionHelper;
+import com.android.systemui.statusbar.NotificationShelf;
import com.android.systemui.statusbar.notification.SourceType;
import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow;
import com.android.systemui.statusbar.notification.row.ExpandableView;
@@ -503,13 +505,21 @@ class NotificationSwipeHelper extends SwipeHelper implements NotificationSwipeAc
final int height = (view instanceof ExpandableView)
? ((ExpandableView) view).getActualHeight()
: view.getHeight();
+ final int width;
+ if (ignoreTouchesNextToNotificationShelf()) {
+ width = (view instanceof NotificationShelf)
+ ? ((NotificationShelf) view).getActualWidth()
+ : view.getWidth();
+ } else {
+ width = view.getWidth();
+ }
final int rx = (int) ev.getRawX();
final int ry = (int) ev.getRawY();
int[] temp = new int[2];
view.getLocationOnScreen(temp);
final int x = temp[0];
final int y = temp[1];
- Rect rect = new Rect(x, y, x + view.getWidth(), y + height);
+ Rect rect = new Rect(x, y, x + width, y + height);
boolean ret = rect.contains(rx, ry);
return ret;
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ScrollViewFields.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ScrollViewFields.kt
index f6e8b8f0166b..fa20e43d0534 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ScrollViewFields.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ScrollViewFields.kt
@@ -17,7 +17,9 @@
package com.android.systemui.statusbar.notification.stack
import android.util.IndentingPrintWriter
+import com.android.systemui.statusbar.notification.stack.shared.model.AccessibilityScrollEvent
import com.android.systemui.statusbar.notification.stack.shared.model.ShadeScrimShape
+import com.android.systemui.statusbar.notification.stack.shared.model.ShadeScrollState
import com.android.systemui.util.printSection
import com.android.systemui.util.println
import java.util.function.Consumer
@@ -32,8 +34,9 @@ import java.util.function.Consumer
class ScrollViewFields {
/** Used to produce the clipping path */
var scrimClippingShape: ShadeScrimShape? = null
- /** Whether the notifications are scrolled all the way to the top (i.e. when freshly opened) */
- var isScrolledToTop: Boolean = true
+
+ /** Scroll state of the notification shade. */
+ var scrollState: ShadeScrollState = ShadeScrollState()
/**
* Height in view pixels at which the Notification Stack would like to be laid out, including
@@ -47,6 +50,13 @@ class ScrollViewFields {
* placeholder
*/
var syntheticScrollConsumer: Consumer<Float>? = null
+
+ /**
+ * When the NSSL navigates through the notifications with TalkBack, it can send scroll events
+ * here, to be able to browse through the whole list of notifications in the shade.
+ */
+ var accessibilityScrollEventConsumer: Consumer<AccessibilityScrollEvent>? = null
+
/**
* When a gesture is consumed internally by NSSL but needs to be handled by other elements (such
* as the notif scrim) as overscroll, we can notify the placeholder through here.
@@ -64,12 +74,6 @@ class ScrollViewFields {
*/
var remoteInputRowBottomBoundConsumer: Consumer<Float?>? = null
- /**
- * Any time the heads up height is recalculated, it should be updated here to be used by the
- * placeholder
- */
- var headsUpHeightConsumer: Consumer<Float>? = null
-
/** send the [syntheticScroll] to the [syntheticScrollConsumer], if present. */
fun sendSyntheticScroll(syntheticScroll: Float) =
syntheticScrollConsumer?.accept(syntheticScroll)
@@ -86,10 +90,15 @@ class ScrollViewFields {
fun sendRemoteInputRowBottomBound(bottomY: Float?) =
remoteInputRowBottomBoundConsumer?.accept(bottomY)
+ /** send an [AccessibilityScrollEvent] to the [accessibilityScrollEventConsumer] if present */
+ fun sendAccessibilityScrollEvent(event: AccessibilityScrollEvent) {
+ accessibilityScrollEventConsumer?.accept(event)
+ }
+
fun dump(pw: IndentingPrintWriter) {
pw.printSection("StackViewStates") {
pw.println("scrimClippingShape", scrimClippingShape)
- pw.println("isScrolledToTop", isScrolledToTop)
+ pw.println("scrollState", scrollState)
}
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/data/repository/NotificationPlaceholderRepository.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/data/repository/NotificationPlaceholderRepository.kt
index c0f1a5619140..5ec4c8988697 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/data/repository/NotificationPlaceholderRepository.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/data/repository/NotificationPlaceholderRepository.kt
@@ -17,7 +17,10 @@
package com.android.systemui.statusbar.notification.stack.data.repository
import com.android.systemui.dagger.SysUISingleton
+import com.android.systemui.statusbar.notification.stack.shared.model.AccessibilityScrollEvent
import com.android.systemui.statusbar.notification.stack.shared.model.ShadeScrimBounds
+import com.android.systemui.statusbar.notification.stack.shared.model.ShadeScrollState
+import java.util.function.Consumer
import javax.inject.Inject
import kotlinx.coroutines.flow.MutableStateFlow
@@ -44,9 +47,9 @@ class NotificationPlaceholderRepository @Inject constructor() {
/** height made available to the notifications in the size-constrained mode of lock screen. */
val constrainedAvailableSpace = MutableStateFlow(0)
- /**
- * Whether the notification stack is scrolled to the top; i.e., it cannot be scrolled down any
- * further.
- */
- val scrolledToTop = MutableStateFlow(true)
+ /** Scroll state of the notification shade. */
+ val shadeScrollState = MutableStateFlow(ShadeScrollState())
+
+ /** A consumer of [AccessibilityScrollEvent]s. */
+ var accessibilityScrollEventConsumer: Consumer<AccessibilityScrollEvent>? = null
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/domain/interactor/NotificationStackAppearanceInteractor.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/domain/interactor/NotificationStackAppearanceInteractor.kt
index 32e092bcdf4d..d4dd1d4b9e0b 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/domain/interactor/NotificationStackAppearanceInteractor.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/domain/interactor/NotificationStackAppearanceInteractor.kt
@@ -23,8 +23,11 @@ import com.android.systemui.shade.domain.interactor.ShadeInteractor
import com.android.systemui.shade.shared.model.ShadeMode
import com.android.systemui.statusbar.notification.stack.data.repository.NotificationPlaceholderRepository
import com.android.systemui.statusbar.notification.stack.data.repository.NotificationViewHeightRepository
+import com.android.systemui.statusbar.notification.stack.shared.model.AccessibilityScrollEvent
import com.android.systemui.statusbar.notification.stack.shared.model.ShadeScrimBounds
import com.android.systemui.statusbar.notification.stack.shared.model.ShadeScrimRounding
+import com.android.systemui.statusbar.notification.stack.shared.model.ShadeScrollState
+import java.util.function.Consumer
import javax.inject.Inject
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.StateFlow
@@ -78,11 +81,9 @@ constructor(
val constrainedAvailableSpace: StateFlow<Int> =
placeholderRepository.constrainedAvailableSpace.asStateFlow()
- /**
- * Whether the notification stack is scrolled to the top; i.e., it cannot be scrolled down any
- * further.
- */
- val scrolledToTop: StateFlow<Boolean> = placeholderRepository.scrolledToTop.asStateFlow()
+ /** Scroll state of the notification shade. */
+ val shadeScrollState: StateFlow<ShadeScrollState> =
+ placeholderRepository.shadeScrollState.asStateFlow()
/**
* The amount in px that the notification stack should scroll due to internal expansion. This
@@ -123,9 +124,9 @@ constructor(
placeholderRepository.shadeScrimBounds.value = bounds
}
- /** Sets whether the notification stack is scrolled to the top. */
- fun setScrolledToTop(scrolledToTop: Boolean) {
- placeholderRepository.scrolledToTop.value = scrolledToTop
+ /** Updates the current scroll state of the notification shade. */
+ fun setScrollState(shadeScrollState: ShadeScrollState) {
+ placeholderRepository.shadeScrollState.value = shadeScrollState
}
/** Sets the amount (px) that the notification stack should scroll due to internal expansion. */
@@ -133,6 +134,16 @@ constructor(
viewHeightRepository.syntheticScroll.value = delta
}
+ /** Sends an [AccessibilityScrollEvent] to scroll the stack up or down. */
+ fun sendAccessibilityScrollEvent(accessibilityScrollEvent: AccessibilityScrollEvent) {
+ placeholderRepository.accessibilityScrollEventConsumer?.accept(accessibilityScrollEvent)
+ }
+
+ /** Set a consumer for the [AccessibilityScrollEvent]s to be handled by the placeholder. */
+ fun setAccessibilityScrollEventConsumer(consumer: Consumer<AccessibilityScrollEvent>?) {
+ placeholderRepository.accessibilityScrollEventConsumer = consumer
+ }
+
/** Sets whether the current touch gesture is overscroll. */
fun setCurrentGestureOverscroll(isOverscroll: Boolean) {
viewHeightRepository.isCurrentGestureOverscroll.value = isOverscroll
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/shared/model/AccessibilityScrollEvent.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/shared/model/AccessibilityScrollEvent.kt
new file mode 100644
index 000000000000..01341e1d056d
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/shared/model/AccessibilityScrollEvent.kt
@@ -0,0 +1,26 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.systemui.statusbar.notification.stack.shared.model
+
+/**
+ * An event to be sent by the NotificationStackScrollLayout to the NotificationsPlaceholder, when
+ * TalkBack runs out of visible notifications, and wants to scroll the shade to access more.
+ */
+enum class AccessibilityScrollEvent {
+ SCROLL_UP,
+ SCROLL_DOWN,
+}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/shared/model/ShadeScrollState.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/shared/model/ShadeScrollState.kt
new file mode 100644
index 000000000000..3963286094f8
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/shared/model/ShadeScrollState.kt
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.systemui.statusbar.notification.stack.shared.model
+
+data class ShadeScrollState(
+ /**
+ * Whether the notification stack is scrolled to the top (i.e. when freshly opened). It also
+ * returns true, when scrolling is not possible because all the content fits in the current
+ * viewport.
+ */
+ val isScrolledToTop: Boolean = true,
+
+ /**
+ * Current scroll position of the shade. 0 when scrolled to the top, [maxScrollPosition] when
+ * scrolled all the way to the bottom.
+ */
+ val scrollPosition: Int = 0,
+
+ /**
+ * Max scroll position of the shade. 0, when no scrolling is possible e.g. all the content fits
+ * in the current viewport.
+ */
+ val maxScrollPosition: Int = 0,
+)
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ui/view/NotificationScrollView.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ui/view/NotificationScrollView.kt
index 6ad9f01ca4ff..5249a6d304ec 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ui/view/NotificationScrollView.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ui/view/NotificationScrollView.kt
@@ -17,7 +17,9 @@
package com.android.systemui.statusbar.notification.stack.ui.view
import android.view.View
+import com.android.systemui.statusbar.notification.stack.shared.model.AccessibilityScrollEvent
import com.android.systemui.statusbar.notification.stack.shared.model.ShadeScrimShape
+import com.android.systemui.statusbar.notification.stack.shared.model.ShadeScrollState
import java.util.function.Consumer
/**
@@ -35,6 +37,9 @@ interface NotificationScrollView {
/** Height in pixels required to display the top HeadsUp Notification. */
val topHeadsUpHeight: Int
+ /** Bottom inset of the Notification Stack that us used to display the Shelf. */
+ val stackBottomInset: Int
+
/**
* Since this is an interface rather than a literal View, this provides cast-like access to the
* underlying view.
@@ -62,12 +67,15 @@ interface NotificationScrollView {
/** set the bottom-most y position in px, where we can draw HUNs in this view's coordinates */
fun setHeadsUpBottom(headsUpBottom: Float)
- /** set whether the view has been scrolled all the way to the top */
- fun setScrolledToTop(scrolledToTop: Boolean)
+ /** Updates the current scroll state of the notification shade. */
+ fun setScrollState(scrollState: ShadeScrollState)
/** Set a consumer for synthetic scroll events */
fun setSyntheticScrollConsumer(consumer: Consumer<Float>?)
+ /** Set a consumer for accessibility actions to be handled by the placeholder. */
+ fun setAccessibilityScrollEventConsumer(consumer: Consumer<AccessibilityScrollEvent>?)
+
/** Set a consumer for current gesture overscroll events */
fun setCurrentGestureOverscrollConsumer(consumer: Consumer<Boolean>?)
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ui/viewbinder/NotificationScrollViewBinder.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ui/viewbinder/NotificationScrollViewBinder.kt
index fb42ee7908b2..4a768714b84f 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ui/viewbinder/NotificationScrollViewBinder.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ui/viewbinder/NotificationScrollViewBinder.kt
@@ -83,9 +83,11 @@ constructor(
}
launch { viewModel.maxAlpha.collectTraced { view.setMaxAlpha(it) } }
- launch { viewModel.scrolledToTop.collectTraced { view.setScrolledToTop(it) } }
+ launch { viewModel.shadeScrollState.collect { view.setScrollState(it) } }
launch {
- viewModel.expandFraction.collectTraced { view.setExpandFraction(it.coerceIn(0f, 1f)) }
+ viewModel.expandFraction.collectTraced {
+ view.setExpandFraction(it.coerceIn(0f, 1f))
+ }
}
launch { viewModel.qsExpandFraction.collectTraced { view.setQsExpandFraction(it) } }
launch {
@@ -94,7 +96,9 @@ constructor(
}
}
launch {
- viewModel.alphaForLockscreenFadeIn.collectTraced { view.setAlphaForLockscreenFadeIn(it) }
+ viewModel.alphaForLockscreenFadeIn.collectTraced {
+ view.setAlphaForLockscreenFadeIn(it)
+ }
}
launch { viewModel.isScrollable.collectTraced { view.setScrollingEnabled(it) } }
launch { viewModel.isDozing.collectTraced { isDozing -> view.setDozing(isDozing) } }
@@ -109,9 +113,13 @@ constructor(
.collectTraced { view.setStackTop(-(view.getHeadsUpInset().toFloat())) }
}
launch {
- viewModel.shouldCloseGuts.filter { it }.collectTraced { view.closeGutsOnSceneTouch() }
+ viewModel.shouldCloseGuts
+ .filter { it }
+ .collectTraced { view.closeGutsOnSceneTouch() }
+ }
+ launch {
+ viewModel.suppressHeightUpdates.collectTraced { view.suppressHeightUpdates(it) }
}
- launch { viewModel.suppressHeightUpdates.collectTraced { view.suppressHeightUpdates(it) } }
launchAndDispose {
view.setSyntheticScrollConsumer(viewModel.syntheticScrollConsumer)
@@ -120,11 +128,13 @@ constructor(
view.setRemoteInputRowBottomBoundConsumer(
viewModel.remoteInputRowBottomBoundConsumer
)
+ view.setAccessibilityScrollEventConsumer(viewModel.accessibilityScrollEventConsumer)
DisposableHandle {
view.setSyntheticScrollConsumer(null)
view.setCurrentGestureOverscrollConsumer(null)
view.setCurrentGestureInGutsConsumer(null)
view.setRemoteInputRowBottomBoundConsumer(null)
+ view.setAccessibilityScrollEventConsumer(null)
}
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/NotificationScrollViewModel.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/NotificationScrollViewModel.kt
index aec81b0241a2..574ca3ffe5b6 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/NotificationScrollViewModel.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/NotificationScrollViewModel.kt
@@ -34,8 +34,10 @@ import com.android.systemui.shade.domain.interactor.ShadeInteractor
import com.android.systemui.shade.shared.model.ShadeMode
import com.android.systemui.statusbar.domain.interactor.RemoteInputInteractor
import com.android.systemui.statusbar.notification.stack.domain.interactor.NotificationStackAppearanceInteractor
+import com.android.systemui.statusbar.notification.stack.shared.model.AccessibilityScrollEvent
import com.android.systemui.statusbar.notification.stack.shared.model.ShadeScrimClipping
import com.android.systemui.statusbar.notification.stack.shared.model.ShadeScrimShape
+import com.android.systemui.statusbar.notification.stack.shared.model.ShadeScrollState
import com.android.systemui.statusbar.notification.stack.ui.viewmodel.NotificationTransitionThresholds.EXPANSION_FOR_DELAYED_STACK_FADE_IN
import com.android.systemui.statusbar.notification.stack.ui.viewmodel.NotificationTransitionThresholds.EXPANSION_FOR_MAX_SCRIM_ALPHA
import com.android.systemui.util.kotlin.ActivatableFlowDumper
@@ -255,16 +257,16 @@ constructor(
val maxAlpha: Flow<Float> =
stackAppearanceInteractor.alphaForBrightnessMirror.dumpValue("maxAlpha")
- /**
- * Whether the notification stack is scrolled to the top; i.e., it cannot be scrolled down any
- * further.
- */
- val scrolledToTop: Flow<Boolean> =
- stackAppearanceInteractor.scrolledToTop.dumpValue("scrolledToTop")
+ /** Scroll state of the notification shade. */
+ val shadeScrollState: Flow<ShadeScrollState> = stackAppearanceInteractor.shadeScrollState
/** Receives the amount (px) that the stack should scroll due to internal expansion. */
val syntheticScrollConsumer: (Float) -> Unit = stackAppearanceInteractor::setSyntheticScroll
+ /** Receives an event to scroll the stack up or down. */
+ val accessibilityScrollEventConsumer: (AccessibilityScrollEvent) -> Unit =
+ stackAppearanceInteractor::sendAccessibilityScrollEvent
+
/**
* Receives whether the current touch gesture is overscroll as it has already been consumed by
* the stack.
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/NotificationsPlaceholderViewModel.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/NotificationsPlaceholderViewModel.kt
index c8e83581e831..a8ce47cf2dd3 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/NotificationsPlaceholderViewModel.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/NotificationsPlaceholderViewModel.kt
@@ -27,12 +27,15 @@ import com.android.systemui.shade.domain.interactor.ShadeInteractor
import com.android.systemui.statusbar.domain.interactor.RemoteInputInteractor
import com.android.systemui.statusbar.notification.domain.interactor.HeadsUpNotificationInteractor
import com.android.systemui.statusbar.notification.stack.domain.interactor.NotificationStackAppearanceInteractor
+import com.android.systemui.statusbar.notification.stack.shared.model.AccessibilityScrollEvent
import com.android.systemui.statusbar.notification.stack.shared.model.ShadeScrimBounds
import com.android.systemui.statusbar.notification.stack.shared.model.ShadeScrimRounding
+import com.android.systemui.statusbar.notification.stack.shared.model.ShadeScrollState
import com.android.systemui.util.kotlin.ActivatableFlowDumper
import com.android.systemui.util.kotlin.ActivatableFlowDumperImpl
import dagger.assisted.AssistedFactory
import dagger.assisted.AssistedInject
+import java.util.function.Consumer
import kotlinx.coroutines.coroutineScope
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.filter
@@ -140,9 +143,9 @@ constructor(
/** The bottom bound of the currently focused remote input notification row. */
val remoteInputRowBottomBound = remoteInputInteractor.remoteInputRowBottomBound
- /** Sets whether the notification stack is scrolled to the top. */
- fun setScrolledToTop(scrolledToTop: Boolean) {
- interactor.setScrolledToTop(scrolledToTop)
+ /** Updates the current scroll state of the notification shade. */
+ fun setScrollState(scrollState: ShadeScrollState) {
+ interactor.setScrollState(scrollState)
}
/** Sets whether the heads up notification is animating away. */
@@ -155,6 +158,11 @@ constructor(
headsUpNotificationInteractor.snooze()
}
+ /** Set a consumer for accessibility events to be handled by the placeholder. */
+ fun setAccessibilityScrollEventConsumer(consumer: Consumer<AccessibilityScrollEvent>?) {
+ interactor.setAccessibilityScrollEventConsumer(consumer)
+ }
+
@AssistedFactory
interface Factory {
fun create(): NotificationsPlaceholderViewModel
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java
index 3d7cd9c9fbcd..afa5a7802559 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java
@@ -140,8 +140,6 @@ import com.android.systemui.keyguard.KeyguardViewMediator;
import com.android.systemui.keyguard.MigrateClocksToBlueprint;
import com.android.systemui.keyguard.ScreenLifecycle;
import com.android.systemui.keyguard.WakefulnessLifecycle;
-import com.android.systemui.keyguard.ui.binder.LightRevealScrimViewBinder;
-import com.android.systemui.keyguard.ui.viewmodel.LightRevealScrimViewModel;
import com.android.systemui.navigationbar.NavigationBarController;
import com.android.systemui.navigationbar.views.NavigationBarView;
import com.android.systemui.notetask.NoteTaskController;
@@ -425,7 +423,6 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces {
private final NotificationsController mNotificationsController;
private final StatusBarSignalPolicy mStatusBarSignalPolicy;
private final StatusBarHideIconsForBouncerManager mStatusBarHideIconsForBouncerManager;
- private final Lazy<LightRevealScrimViewModel> mLightRevealScrimViewModelLazy;
/** Controller for the Shade. */
private final ShadeSurface mShadeSurface;
@@ -698,7 +695,6 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces {
WiredChargingRippleController wiredChargingRippleController,
IDreamManager dreamManager,
Lazy<CameraLauncher> cameraLauncherLazy,
- Lazy<LightRevealScrimViewModel> lightRevealScrimViewModelLazy,
LightRevealScrim lightRevealScrim,
AlternateBouncerInteractor alternateBouncerInteractor,
UserTracker userTracker,
@@ -843,7 +839,6 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces {
mDeviceStateManager = deviceStateManager;
wiredChargingRippleController.registerCallbacks();
- mLightRevealScrimViewModelLazy = lightRevealScrimViewModelLazy;
mLightRevealScrim = lightRevealScrim;
mViewCaptureAwareWindowManager = viewCaptureAwareWindowManager;
@@ -1007,7 +1002,6 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces {
mStatusBarKeyguardViewManager,
getNotificationShadeWindowViewController(),
mAmbientIndicationContainer);
- updateLightRevealScrimVisibility();
mConfigurationController.addCallback(mConfigurationListener);
@@ -1279,11 +1273,6 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces {
});
mScrimController.attachViews(scrimBehind, notificationsScrim, scrimInFront);
- if (lightRevealMigration()) {
- LightRevealScrimViewBinder.bind(
- mLightRevealScrim, mLightRevealScrimViewModelLazy.get());
- }
-
mLightRevealScrim.setScrimOpaqueChangedListener((opaque) -> {
Runnable updateOpaqueness = () -> {
mNotificationShadeWindowController.setLightRevealScrimOpaque(
@@ -1301,7 +1290,6 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces {
});
mScreenOffAnimationController.initialize(this, mShadeSurface, mLightRevealScrim);
- updateLightRevealScrimVisibility();
if (!SceneContainerFlag.isEnabled()) {
mShadeSurface.initDependencies(
@@ -2876,7 +2864,6 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces {
} else {
mScrimController.legacyTransitionTo(ScrimState.UNLOCKED, mUnlockScrimCallback);
}
- updateLightRevealScrimVisibility();
Trace.endSection();
}
@@ -2998,17 +2985,6 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces {
return mStatusBarModeRepository.getDefaultDisplay().isTransientShown().getValue();
}
- private void updateLightRevealScrimVisibility() {
- if (mLightRevealScrim == null) {
- // status bar may not be inflated yet
- return;
- }
-
- if (!lightRevealMigration()) {
- mLightRevealScrim.setAlpha(mScrimController.getState().getMaxLightRevealScrimAlpha());
- }
- }
-
private final KeyguardUpdateMonitorCallback mUpdateCallback =
new KeyguardUpdateMonitorCallback() {
@Override
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ConfigurationControllerImpl.kt b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ConfigurationControllerImpl.kt
index bb5aa23fee28..a8c823c35213 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ConfigurationControllerImpl.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ConfigurationControllerImpl.kt
@@ -20,6 +20,7 @@ import android.content.res.Configuration
import android.graphics.Rect
import android.os.LocaleList
import android.view.View.LAYOUT_DIRECTION_RTL
+import com.android.systemui.statusbar.data.repository.StatusBarConfigurationController
import com.android.systemui.statusbar.policy.ConfigurationController
import com.android.systemui.statusbar.policy.ConfigurationController.ConfigurationListener
import dagger.assisted.Assisted
@@ -30,7 +31,7 @@ class ConfigurationControllerImpl
@AssistedInject
constructor(
@Assisted private val context: Context,
-) : ConfigurationController {
+) : ConfigurationController, StatusBarConfigurationController {
private val listeners: MutableList<ConfigurationListener> = ArrayList()
private val lastConfig = Configuration()
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/FoldStateListener.kt b/packages/SystemUI/src/com/android/systemui/statusbar/phone/FoldStateListener.kt
index db237e89a683..5273702cf5e4 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/FoldStateListener.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/FoldStateListener.kt
@@ -17,7 +17,10 @@ package com.android.systemui.statusbar.phone
import android.content.Context
import android.hardware.devicestate.DeviceState
+import android.hardware.devicestate.DeviceState.PROPERTY_FOLDABLE_DISPLAY_CONFIGURATION_OUTER_PRIMARY
+import android.hardware.devicestate.DeviceState.PROPERTY_POWER_CONFIGURATION_TRIGGER_SLEEP
import android.hardware.devicestate.DeviceStateManager.DeviceStateCallback
+import android.hardware.devicestate.feature.flags.Flags as DeviceStateManagerFlags
import com.android.internal.R
/**
@@ -47,12 +50,21 @@ internal class FoldStateListener(
private var wasFolded: Boolean? = null
override fun onDeviceStateChanged(state: DeviceState) {
- val isFolded = foldedDeviceStates.contains(state.identifier)
+ val isFolded: Boolean
+ val willGoToSleep: Boolean
+
+ if (DeviceStateManagerFlags.deviceStatePropertyMigration()) {
+ isFolded = state.hasProperty(PROPERTY_FOLDABLE_DISPLAY_CONFIGURATION_OUTER_PRIMARY)
+ willGoToSleep = state.hasProperty(PROPERTY_POWER_CONFIGURATION_TRIGGER_SLEEP)
+ } else {
+ isFolded = foldedDeviceStates.contains(state.identifier)
+ willGoToSleep = goToSleepDeviceStates.contains(state.identifier)
+ }
+
if (wasFolded == isFolded) {
return
}
wasFolded = isFolded
- val willGoToSleep = goToSleepDeviceStates.contains(state.identifier)
listener.onFoldStateChanged(isFolded, willGoToSleep)
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/HeadsUpAppearanceController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/HeadsUpAppearanceController.java
index 8f94c0656836..d0f4b6f4a4bb 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/HeadsUpAppearanceController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/HeadsUpAppearanceController.java
@@ -16,7 +16,7 @@
package com.android.systemui.statusbar.phone;
-import static com.android.systemui.statusbar.phone.fragment.dagger.StatusBarFragmentModule.OPERATOR_NAME_FRAME_VIEW;
+import static com.android.systemui.statusbar.phone.fragment.dagger.HomeStatusBarModule.OPERATOR_NAME_FRAME_VIEW;
import android.graphics.Rect;
import android.util.MathUtils;
@@ -44,7 +44,7 @@ import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow
import com.android.systemui.statusbar.notification.row.shared.AsyncGroupHeaderViewInflation;
import com.android.systemui.statusbar.notification.stack.NotificationRoundnessManager;
import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayoutController;
-import com.android.systemui.statusbar.phone.fragment.dagger.StatusBarFragmentScope;
+import com.android.systemui.statusbar.phone.fragment.dagger.HomeStatusBarScope;
import com.android.systemui.statusbar.policy.Clock;
import com.android.systemui.statusbar.policy.HeadsUpManager;
import com.android.systemui.statusbar.policy.KeyguardStateController;
@@ -63,7 +63,7 @@ import javax.inject.Named;
* Controls the appearance of heads up notifications in the icon area and the header itself.
* It also controls the roundness of the heads up notifications and the pulsing notifications.
*/
-@StatusBarFragmentScope
+@HomeStatusBarScope
public class HeadsUpAppearanceController extends ViewController<HeadsUpStatusBarView>
implements OnHeadsUpChangedListener,
DarkIconDispatcher.DarkReceiver,
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/LegacyLightsOutNotifController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/LegacyLightsOutNotifController.java
index 7c871e183740..5acc3a684515 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/LegacyLightsOutNotifController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/LegacyLightsOutNotifController.java
@@ -18,7 +18,7 @@ package com.android.systemui.statusbar.phone;
import static android.view.WindowInsetsController.APPEARANCE_LOW_PROFILE_BARS;
-import static com.android.systemui.statusbar.phone.fragment.dagger.StatusBarFragmentModule.LIGHTS_OUT_NOTIF_VIEW;
+import static com.android.systemui.statusbar.phone.fragment.dagger.HomeStatusBarModule.LIGHTS_OUT_NOTIF_VIEW;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
@@ -37,7 +37,7 @@ import com.android.internal.view.AppearanceRegion;
import com.android.systemui.statusbar.CommandQueue;
import com.android.systemui.statusbar.notification.collection.NotifLiveDataStore;
import com.android.systemui.statusbar.notification.shared.NotificationsLiveDataStoreRefactor;
-import com.android.systemui.statusbar.phone.fragment.dagger.StatusBarFragmentScope;
+import com.android.systemui.statusbar.phone.fragment.dagger.HomeStatusBarScope;
import com.android.systemui.util.ViewController;
import javax.inject.Inject;
@@ -51,7 +51,7 @@ import javax.inject.Named;
* This controller shows and hides the notification dot in the status bar to indicate
* whether there are notifications when the device is in {@link View#SYSTEM_UI_FLAG_LOW_PROFILE}.
*/
-@StatusBarFragmentScope
+@HomeStatusBarScope
public class LegacyLightsOutNotifController extends ViewController<View> {
private final CommandQueue mCommandQueue;
private final NotifLiveDataStore mNotifDataStore;
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java
index 40e52935daf1..dc4d66d1ef5a 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimController.java
@@ -29,7 +29,6 @@ import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.ValueAnimator;
import android.annotation.IntDef;
-import android.app.AlarmManager;
import android.graphics.Color;
import android.os.Handler;
import android.os.Trace;
@@ -53,8 +52,6 @@ import com.android.keyguard.BouncerPanelExpansionCalculator;
import com.android.keyguard.KeyguardUpdateMonitor;
import com.android.keyguard.KeyguardUpdateMonitorCallback;
import com.android.settingslib.Utils;
-import com.android.systemui.CoreStartable;
-import com.android.systemui.DejankUtils;
import com.android.systemui.Dumpable;
import com.android.systemui.animation.ShadeInterpolation;
import com.android.systemui.bouncer.shared.constants.KeyguardBouncerConstants;
@@ -81,11 +78,9 @@ import com.android.systemui.shade.transition.LargeScreenShadeInterpolator;
import com.android.systemui.statusbar.notification.stack.ViewState;
import com.android.systemui.statusbar.policy.ConfigurationController;
import com.android.systemui.statusbar.policy.KeyguardStateController;
-import com.android.systemui.util.AlarmTimeout;
import com.android.systemui.util.kotlin.JavaAdapter;
import com.android.systemui.util.wakelock.DelayedWakeLock;
import com.android.systemui.util.wakelock.WakeLock;
-import com.android.systemui.wallpapers.data.repository.WallpaperRepository;
import kotlinx.coroutines.CoroutineDispatcher;
import kotlinx.coroutines.ExperimentalCoroutinesApi;
@@ -104,8 +99,7 @@ import javax.inject.Inject;
*/
@SysUISingleton
@ExperimentalCoroutinesApi
-public class ScrimController implements ViewTreeObserver.OnPreDrawListener, Dumpable,
- CoreStartable {
+public class ScrimController implements ViewTreeObserver.OnPreDrawListener, Dumpable {
static final String TAG = "ScrimController";
private static final boolean DEBUG = Log.isLoggable(TAG, Log.DEBUG);
@@ -217,7 +211,6 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, Dump
private final KeyguardUpdateMonitor mKeyguardUpdateMonitor;
private final DozeParameters mDozeParameters;
private final DockManager mDockManager;
- private final AlarmTimeout mTimeTicker;
private final KeyguardVisibilityCallback mKeyguardVisibilityCallback;
private final Handler mHandler;
private final Executor mMainExecutor;
@@ -232,7 +225,6 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, Dump
private float mAdditionalScrimBehindAlphaKeyguard = 0f;
// Combined scrim behind keyguard alpha of default scrim + additional scrim
- // (if wallpaper dimming is applied).
private float mScrimBehindAlphaKeyguard = KEYGUARD_SCRIM_ALPHA;
private final float mDefaultScrimAlpha;
@@ -261,7 +253,6 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, Dump
private int mBehindTint;
private int mNotificationsTint;
- private boolean mWallpaperVisibilityTimedOut;
private int mScrimsVisibility;
private final TriConsumer<ScrimState, Float, GradientColors> mScrimStateListener;
private final LargeScreenShadeInterpolator mLargeScreenShadeInterpolator;
@@ -269,7 +260,6 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, Dump
private boolean mBlankScreen;
private boolean mScreenBlankingCallbackCalled;
private Callback mCallback;
- private boolean mWallpaperSupportsAmbientMode;
private boolean mScreenOn;
private boolean mTransparentScrimBackground;
@@ -282,7 +272,6 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, Dump
private boolean mKeyguardOccluded;
private KeyguardTransitionInteractor mKeyguardTransitionInteractor;
- private final WallpaperRepository mWallpaperRepository;
private CoroutineDispatcher mMainDispatcher;
private boolean mIsBouncerToGoneTransitionRunning = false;
private PrimaryBouncerToGoneTransitionViewModel mPrimaryBouncerToGoneTransitionViewModel;
@@ -332,7 +321,6 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, Dump
public ScrimController(
LightBarController lightBarController,
DozeParameters dozeParameters,
- AlarmManager alarmManager,
KeyguardStateController keyguardStateController,
DelayedWakeLock.Factory delayedWakeLockFactory,
Handler handler,
@@ -348,7 +336,6 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, Dump
AlternateBouncerToGoneTransitionViewModel alternateBouncerToGoneTransitionViewModel,
KeyguardTransitionInteractor keyguardTransitionInteractor,
KeyguardInteractor keyguardInteractor,
- WallpaperRepository wallpaperRepository,
@Main CoroutineDispatcher mainDispatcher,
LargeScreenShadeInterpolator largeScreenShadeInterpolator) {
mScrimStateListener = lightBarController::setScrimState;
@@ -363,8 +350,6 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, Dump
mMainExecutor = mainExecutor;
mJavaAdapter = javaAdapter;
mScreenOffAnimationController = screenOffAnimationController;
- mTimeTicker = new AlarmTimeout(alarmManager, this::onHideWallpaperTimeout,
- "hide_aod_wallpaper", mHandler);
mWakeLock = delayedWakeLockFactory.create("Scrims");
// Scrim alpha is initially set to the value on the resource but might be changed
// to make sure that text on top of it is legible.
@@ -395,17 +380,9 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, Dump
mAlternateBouncerToGoneTransitionViewModel = alternateBouncerToGoneTransitionViewModel;
mKeyguardTransitionInteractor = keyguardTransitionInteractor;
mKeyguardInteractor = keyguardInteractor;
- mWallpaperRepository = wallpaperRepository;
mMainDispatcher = mainDispatcher;
}
- @Override
- public void start() {
- mJavaAdapter.alwaysCollectFlow(
- mWallpaperRepository.getWallpaperSupportsAmbientMode(),
- this::setWallpaperSupportsAmbientMode);
- }
-
/**
* Attach the controller to the supplied views.
*/
@@ -627,18 +604,6 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, Dump
holdWakeLock();
}
- // AOD wallpapers should fade away after a while.
- // Docking pulses may take a long time, wallpapers should also fade away after a while.
- mWallpaperVisibilityTimedOut = false;
- if (shouldFadeAwayWallpaper()) {
- DejankUtils.postAfterTraversal(() -> {
- mTimeTicker.schedule(mDozeParameters.getWallpaperAodDuration(),
- AlarmTimeout.MODE_IGNORE_IF_SCHEDULED);
- });
- } else {
- DejankUtils.postAfterTraversal(mTimeTicker::cancel);
- }
-
if (mKeyguardUpdateMonitor.needsSlowUnlockTransition() && mState == ScrimState.UNLOCKED) {
mAnimationDelay = CentralSurfaces.FADE_KEYGUARD_START_DELAY;
scheduleUpdate();
@@ -657,19 +622,6 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, Dump
dispatchBackScrimState(mScrimBehind.getViewAlpha());
}
- private boolean shouldFadeAwayWallpaper() {
- if (!mWallpaperSupportsAmbientMode) {
- return false;
- }
-
- if (mState == ScrimState.AOD
- && (mDozeParameters.getAlwaysOn() || mDockManager.isDocked())) {
- return true;
- }
-
- return false;
- }
-
public ScrimState getState() {
return mState;
}
@@ -728,19 +680,6 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, Dump
}
}
- @VisibleForTesting
- protected void onHideWallpaperTimeout() {
- if (mState != ScrimState.AOD && mState != ScrimState.PULSING) {
- return;
- }
-
- holdWakeLock();
- mWallpaperVisibilityTimedOut = true;
- mAnimateChange = true;
- mAnimationDuration = mDozeParameters.getWallpaperFadeOutDuration();
- scheduleUpdate();
- }
-
private void holdWakeLock() {
if (!mWakeLockHeld) {
if (mWakeLock != null) {
@@ -1171,16 +1110,6 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, Dump
setOrAdaptCurrentAnimation(mNotificationsScrim);
setOrAdaptCurrentAnimation(mScrimInFront);
dispatchBackScrimState(mScrimBehind.getViewAlpha());
-
- // Reset wallpaper timeout if it's already timeout like expanding panel while PULSING
- // and docking.
- if (mWallpaperVisibilityTimedOut) {
- mWallpaperVisibilityTimedOut = false;
- DejankUtils.postAfterTraversal(() -> {
- mTimeTicker.schedule(mDozeParameters.getWallpaperAodDuration(),
- AlarmTimeout.MODE_IGNORE_IF_SCHEDULED);
- });
- }
}
/**
@@ -1259,15 +1188,11 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, Dump
dispatchBackScrimState(mScrimBehind.getViewAlpha());
}
- // We want to override the back scrim opacity for the AOD state
- // when it's time to fade the wallpaper away.
- boolean aodWallpaperTimeout = (mState == ScrimState.AOD || mState == ScrimState.PULSING)
- && mWallpaperVisibilityTimedOut;
// We also want to hide FLAG_SHOW_WHEN_LOCKED activities under the scrim.
boolean hideFlagShowWhenLockedActivities =
(mState == ScrimState.PULSING || mState == ScrimState.AOD)
&& mKeyguardOccluded;
- if (aodWallpaperTimeout || hideFlagShowWhenLockedActivities) {
+ if (hideFlagShowWhenLockedActivities) {
mBehindAlpha = 1;
}
// Prevent notification scrim flicker when transitioning away from keyguard.
@@ -1668,17 +1593,6 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, Dump
pw.println(mPanelExpansionFraction);
pw.print(" mExpansionAffectsAlpha=");
pw.println(mExpansionAffectsAlpha);
-
- pw.print(" mState.getMaxLightRevealScrimAlpha=");
- pw.println(mState.getMaxLightRevealScrimAlpha());
- }
-
- private void setWallpaperSupportsAmbientMode(boolean wallpaperSupportsAmbientMode) {
- mWallpaperSupportsAmbientMode = wallpaperSupportsAmbientMode;
- ScrimState[] states = ScrimState.values();
- for (int i = 0; i < states.length; i++) {
- states[i].setWallpaperSupportsAmbientMode(wallpaperSupportsAmbientMode);
- }
}
/**
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimState.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimState.java
index a0ab6120f372..198859a9013d 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimState.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ScrimState.java
@@ -209,11 +209,6 @@ public enum ScrimState {
}
@Override
- public float getMaxLightRevealScrimAlpha() {
- return mWallpaperSupportsAmbientMode ? 0f : 1f;
- }
-
- @Override
public boolean isLowPowerState() {
return true;
}
@@ -237,11 +232,6 @@ public enum ScrimState {
mAnimationDuration = mWakeLockScreenSensorActive
? ScrimController.ANIMATION_DURATION_LONG : ScrimController.ANIMATION_DURATION;
}
- @Override
- public float getMaxLightRevealScrimAlpha() {
- return mWakeLockScreenSensorActive ? ScrimController.WAKE_SENSOR_SCRIM_ALPHA
- : AOD.getMaxLightRevealScrimAlpha();
- }
},
/**
@@ -368,7 +358,6 @@ public enum ScrimState {
DozeParameters mDozeParameters;
DockManager mDockManager;
boolean mDisplayRequiresBlanking;
- boolean mWallpaperSupportsAmbientMode;
boolean mLaunchingAffordanceWithPreview;
boolean mOccludeAnimationPlaying;
boolean mWakeLockScreenSensorActive;
@@ -407,10 +396,6 @@ public enum ScrimState {
return mBehindAlpha;
}
- public float getMaxLightRevealScrimAlpha() {
- return 1f;
- }
-
public float getNotifAlpha() {
return mNotifAlpha;
}
@@ -472,10 +457,6 @@ public enum ScrimState {
mSurfaceColor = surfaceColor;
}
- public void setWallpaperSupportsAmbientMode(boolean wallpaperSupportsAmbientMode) {
- mWallpaperSupportsAmbientMode = wallpaperSupportsAmbientMode;
- }
-
public void setLaunchingAffordanceWithPreview(boolean launchingAffordanceWithPreview) {
mLaunchingAffordanceWithPreview = launchingAffordanceWithPreview;
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarBoundsProvider.kt b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarBoundsProvider.kt
index 00b08f097e97..3ac0bac95d68 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarBoundsProvider.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarBoundsProvider.kt
@@ -18,10 +18,10 @@ package com.android.systemui.statusbar.phone
import android.graphics.Rect
import android.view.View
-import com.android.systemui.statusbar.phone.fragment.dagger.StatusBarFragmentComponent
-import com.android.systemui.statusbar.phone.fragment.dagger.StatusBarFragmentModule.END_SIDE_CONTENT
-import com.android.systemui.statusbar.phone.fragment.dagger.StatusBarFragmentModule.START_SIDE_CONTENT
-import com.android.systemui.statusbar.phone.fragment.dagger.StatusBarFragmentScope
+import com.android.systemui.statusbar.phone.fragment.dagger.HomeStatusBarComponent
+import com.android.systemui.statusbar.phone.fragment.dagger.HomeStatusBarModule.END_SIDE_CONTENT
+import com.android.systemui.statusbar.phone.fragment.dagger.HomeStatusBarModule.START_SIDE_CONTENT
+import com.android.systemui.statusbar.phone.fragment.dagger.HomeStatusBarScope
import com.android.systemui.util.ListenerSet
import com.android.systemui.util.boundsOnScreen
import javax.inject.Inject
@@ -33,13 +33,13 @@ import javax.inject.Named
* This is distinct from [StatusBarContentInsetsProvider], which provides the bounds of full status
* bar after accounting for system insets.
*/
-@StatusBarFragmentScope
+@HomeStatusBarScope
class StatusBarBoundsProvider
@Inject
constructor(
@Named(START_SIDE_CONTENT) private val startSideContent: View,
@Named(END_SIDE_CONTENT) private val endSideContent: View,
-) : StatusBarFragmentComponent.Startable {
+) : HomeStatusBarComponent.Startable {
interface BoundsChangeListener {
fun onStatusBarBoundsChanged(bounds: BoundsPair)
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarContentInsetsProvider.kt b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarContentInsetsProvider.kt
index 613efaa148f5..c6f6bd90fce6 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarContentInsetsProvider.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarContentInsetsProvider.kt
@@ -34,10 +34,10 @@ import com.android.systemui.Dumpable
import com.android.systemui.StatusBarInsetsCommand
import com.android.systemui.SysUICutoutInformation
import com.android.systemui.SysUICutoutProvider
-import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.dump.DumpManager
import com.android.systemui.res.R
import com.android.systemui.statusbar.commandline.CommandRegistry
+import com.android.systemui.statusbar.phone.StatusBarContentInsetsProviderImpl.CacheKey
import com.android.systemui.statusbar.policy.CallbackController
import com.android.systemui.statusbar.policy.ConfigurationController
import com.android.systemui.util.leak.RotationUtils.ROTATION_LANDSCAPE
@@ -47,9 +47,11 @@ import com.android.systemui.util.leak.RotationUtils.ROTATION_UPSIDE_DOWN
import com.android.systemui.util.leak.RotationUtils.Rotation
import com.android.systemui.util.leak.RotationUtils.getExactRotation
import com.android.systemui.util.leak.RotationUtils.getResourcesForRotation
+import dagger.assisted.Assisted
+import dagger.assisted.AssistedFactory
+import dagger.assisted.AssistedInject
import java.io.PrintWriter
import java.lang.Math.max
-import javax.inject.Inject
/**
* Encapsulates logic that can solve for the left/right insets required for the status bar contents.
@@ -64,19 +66,87 @@ import javax.inject.Inject
*
* NOTE: This class is not threadsafe
*/
-@SysUISingleton
-class StatusBarContentInsetsProvider
-@Inject
+interface StatusBarContentInsetsProvider :
+ CallbackController<StatusBarContentInsetsChangedListener> {
+
+ /**
+ * Some views may need to care about whether or not the current top display cutout is located in
+ * the corner rather than somewhere in the center. In the case of a corner cutout, the status
+ * bar area is contiguous.
+ */
+ fun currentRotationHasCornerCutout(): Boolean
+
+ /**
+ * Calculates the maximum bounding rectangle for the privacy chip animation + ongoing privacy
+ * dot in the coordinates relative to the given rotation.
+ *
+ * @param rotation the rotation for which the bounds are required. This is an absolute value
+ * (i.e., ROTATION_NONE will always return the same bounds regardless of the context from
+ * which this method is called)
+ */
+ fun getBoundingRectForPrivacyChipForRotation(
+ @Rotation rotation: Int,
+ displayCutout: DisplayCutout?,
+ ): Rect
+
+ /**
+ * Calculate the distance from the left, right and top edges of the screen to the status bar
+ * content area. This differs from the content area rects in that these values can be used
+ * directly as padding.
+ *
+ * @param rotation the target rotation for which to calculate insets
+ */
+ fun getStatusBarContentInsetsForRotation(@Rotation rotation: Int): Insets
+
+ /**
+ * Calculate the insets for the status bar content in the device's current rotation
+ *
+ * @see getStatusBarContentAreaForRotation
+ */
+ fun getStatusBarContentInsetsForCurrentRotation(): Insets
+
+ /**
+ * Calculates the area of the status bar contents invariant of the current device rotation, in
+ * the target rotation's coordinates
+ *
+ * @param rotation the rotation for which the bounds are required. This is an absolute value
+ * (i.e., ROTATION_NONE will always return the same bounds regardless of the context from
+ * which this method is called)
+ */
+ fun getStatusBarContentAreaForRotation(@Rotation rotation: Int): Rect
+
+ /** Get the status bar content area for the given rotation, in absolute bounds */
+ fun getStatusBarContentAreaForCurrentRotation(): Rect
+
+ fun getStatusBarPaddingTop(@Rotation rotation: Int? = null): Int
+
+ interface Factory {
+ fun create(
+ context: Context,
+ configurationController: ConfigurationController,
+ sysUICutoutProvider: SysUICutoutProvider,
+ ): StatusBarContentInsetsProvider
+ }
+}
+
+class StatusBarContentInsetsProviderImpl
+@AssistedInject
constructor(
- val context: Context,
- val configurationController: ConfigurationController,
+ @Assisted val context: Context,
+ @Assisted val configurationController: ConfigurationController,
val dumpManager: DumpManager,
val commandRegistry: CommandRegistry,
- val sysUICutoutProvider: SysUICutoutProvider,
-) :
- CallbackController<StatusBarContentInsetsChangedListener>,
- ConfigurationController.ConfigurationListener,
- Dumpable {
+ @Assisted val sysUICutoutProvider: SysUICutoutProvider,
+) : StatusBarContentInsetsProvider, ConfigurationController.ConfigurationListener, Dumpable {
+
+ @AssistedFactory
+ interface Factory : StatusBarContentInsetsProvider.Factory {
+ override fun create(
+ context: Context,
+ configurationController: ConfigurationController,
+ sysUICutoutProvider: SysUICutoutProvider,
+ ): StatusBarContentInsetsProviderImpl
+ }
// Limit cache size as potentially we may connect large number of displays
// (e.g. network displays)
@@ -95,7 +165,7 @@ constructor(
object : StatusBarInsetsCommand.Callback {
override fun onExecute(
command: StatusBarInsetsCommand,
- printWriter: PrintWriter
+ printWriter: PrintWriter,
) {
executeCommand(command, printWriter)
}
@@ -133,12 +203,7 @@ constructor(
listeners.forEach { it.onStatusBarContentInsetsChanged() }
}
- /**
- * Some views may need to care about whether or not the current top display cutout is located in
- * the corner rather than somewhere in the center. In the case of a corner cutout, the status
- * bar area is contiguous.
- */
- fun currentRotationHasCornerCutout(): Boolean {
+ override fun currentRotationHasCornerCutout(): Boolean {
val cutout = checkNotNull(context.display).cutout ?: return false
val topBounds = cutout.boundingRectTop
@@ -148,17 +213,9 @@ constructor(
return topBounds.left <= 0 || topBounds.right >= point.x
}
- /**
- * Calculates the maximum bounding rectangle for the privacy chip animation + ongoing privacy
- * dot in the coordinates relative to the given rotation.
- *
- * @param rotation the rotation for which the bounds are required. This is an absolute value
- * (i.e., ROTATION_NONE will always return the same bounds regardless of the context from
- * which this method is called)
- */
- fun getBoundingRectForPrivacyChipForRotation(
+ override fun getBoundingRectForPrivacyChipForRotation(
@Rotation rotation: Int,
- displayCutout: DisplayCutout?
+ displayCutout: DisplayCutout?,
): Rect {
val key = getCacheKey(rotation, displayCutout)
var insets = insetsCache[key]
@@ -176,14 +233,7 @@ constructor(
return getPrivacyChipBoundingRectForInsets(insets, dotWidth, chipWidth, isRtl)
}
- /**
- * Calculate the distance from the left, right and top edges of the screen to the status bar
- * content area. This differs from the content area rects in that these values can be used
- * directly as padding.
- *
- * @param rotation the target rotation for which to calculate insets
- */
- fun getStatusBarContentInsetsForRotation(@Rotation rotation: Int): Insets =
+ override fun getStatusBarContentInsetsForRotation(@Rotation rotation: Int): Insets =
traceSection(tag = "StatusBarContentInsetsProvider.getStatusBarContentInsetsForRotation") {
val sysUICutout = sysUICutoutProvider.cutoutInfoForCurrentDisplayAndRotation()
val displayCutout = sysUICutout?.cutout
@@ -202,31 +252,17 @@ constructor(
rotation,
sysUICutout,
getResourcesForRotation(rotation, context),
- key
+ key,
)
Insets.of(area.left, area.top, /* right= */ width - area.right, /* bottom= */ 0)
}
- /**
- * Calculate the insets for the status bar content in the device's current rotation
- *
- * @see getStatusBarContentAreaForRotation
- */
- fun getStatusBarContentInsetsForCurrentRotation(): Insets {
+ override fun getStatusBarContentInsetsForCurrentRotation(): Insets {
return getStatusBarContentInsetsForRotation(getExactRotation(context))
}
- /**
- * Calculates the area of the status bar contents invariant of the current device rotation, in
- * the target rotation's coordinates
- *
- * @param rotation the rotation for which the bounds are required. This is an absolute value
- * (i.e., ROTATION_NONE will always return the same bounds regardless of the context from
- * which this method is called)
- */
- @JvmOverloads
- fun getStatusBarContentAreaForRotation(@Rotation rotation: Int): Rect {
+ override fun getStatusBarContentAreaForRotation(@Rotation rotation: Int): Rect {
val sysUICutout = sysUICutoutProvider.cutoutInfoForCurrentDisplayAndRotation()
val displayCutout = sysUICutout?.cutout
val key = getCacheKey(rotation, displayCutout)
@@ -235,12 +271,11 @@ constructor(
rotation,
sysUICutout,
getResourcesForRotation(rotation, context),
- key
+ key,
)
}
- /** Get the status bar content area for the given rotation, in absolute bounds */
- fun getStatusBarContentAreaForCurrentRotation(): Rect {
+ override fun getStatusBarContentAreaForCurrentRotation(): Rect {
val rotation = getExactRotation(context)
return getStatusBarContentAreaForRotation(rotation)
}
@@ -249,7 +284,7 @@ constructor(
@Rotation targetRotation: Int,
sysUICutout: SysUICutoutInformation?,
rotatedResources: Resources,
- key: CacheKey
+ key: CacheKey,
): Rect {
return getCalculatedAreaForRotation(sysUICutout, targetRotation, rotatedResources).also {
insetsCache.put(key, it)
@@ -259,7 +294,7 @@ constructor(
private fun getCalculatedAreaForRotation(
sysUICutout: SysUICutoutInformation?,
@Rotation targetRotation: Int,
- rotatedResources: Resources
+ rotatedResources: Resources,
): Rect {
val currentRotation = getExactRotation(context)
@@ -299,7 +334,7 @@ constructor(
configurationController.isLayoutRtl,
dotWidth,
bottomAlignedMargin,
- statusBarContentHeight
+ statusBarContentHeight,
)
}
@@ -349,7 +384,7 @@ constructor(
return resources.getDimensionPixelSize(dimenRes)
}
- fun getStatusBarPaddingTop(@Rotation rotation: Int? = null): Int {
+ override fun getStatusBarPaddingTop(@Rotation rotation: Int?): Int {
val res = rotation?.let { it -> getResourcesForRotation(it, context) } ?: context.resources
return res.getDimensionPixelSize(R.dimen.status_bar_padding_top)
}
@@ -364,13 +399,13 @@ constructor(
CacheKey(
rotation = rotation,
displaySize = Rect(context.resources.configuration.windowConfiguration.maxBounds),
- displayCutout = displayCutout
+ displayCutout = displayCutout,
)
private data class CacheKey(
@Rotation val rotation: Int,
val displaySize: Rect,
- val displayCutout: DisplayCutout?
+ val displayCutout: DisplayCutout?,
)
}
@@ -395,21 +430,21 @@ fun getPrivacyChipBoundingRectForInsets(
contentRect: Rect,
dotWidth: Int,
chipWidth: Int,
- isRtl: Boolean
+ isRtl: Boolean,
): Rect {
return if (isRtl) {
Rect(
contentRect.left - dotWidth,
contentRect.top,
contentRect.left + chipWidth,
- contentRect.bottom
+ contentRect.bottom,
)
} else {
Rect(
contentRect.right - chipWidth,
contentRect.top,
contentRect.right + dotWidth,
- contentRect.bottom
+ contentRect.bottom,
)
}
}
@@ -443,7 +478,7 @@ fun calculateInsetsForRotationWithRotatedResources(
isRtl: Boolean,
dotWidth: Int,
bottomAlignedMargin: Int,
- statusBarContentHeight: Int
+ statusBarContentHeight: Int,
): Rect {
/*
TODO: Check if this is ever used for devices with no rounded corners
@@ -467,7 +502,7 @@ fun calculateInsetsForRotationWithRotatedResources(
targetRotation,
currentRotation,
bottomAlignedMargin,
- statusBarContentHeight
+ statusBarContentHeight,
)
}
@@ -503,7 +538,7 @@ private fun getStatusBarContentBounds(
@Rotation targetRotation: Int,
@Rotation currentRotation: Int,
bottomAlignedMargin: Int,
- statusBarContentHeight: Int
+ statusBarContentHeight: Int,
): Rect {
val insetTop = getInsetTop(bottomAlignedMargin, statusBarContentHeight, sbHeight)
@@ -597,7 +632,7 @@ private val DisplayCutout.boundingRectsLeftRightTop
private fun getInsetTop(
bottomAlignedMargin: Int,
statusBarContentHeight: Int,
- statusBarHeight: Int
+ statusBarHeight: Int,
): Int {
val bottomAlignmentEnabled = bottomAlignedMargin >= 0
if (!bottomAlignmentEnabled) {
@@ -610,7 +645,7 @@ private fun getInsetTop(
private fun sbRect(
@Rotation relativeRotation: Int,
sbHeight: Int,
- displaySize: Pair<Int, Int>
+ displaySize: Pair<Int, Int>,
): Rect {
val w = displaySize.first
val h = displaySize.second
@@ -626,7 +661,7 @@ private fun shareShortEdge(
sbRect: Rect,
cutoutRect: Rect,
currentWidth: Int,
- currentHeight: Int
+ currentHeight: Int,
): Boolean {
if (currentWidth < currentHeight) {
// Check top/bottom edges by extending the width of the display cutout rect and checking
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarDemoMode.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarDemoMode.java
index 25b8bfe0da25..1afe416c43c2 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarDemoMode.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarDemoMode.java
@@ -21,7 +21,7 @@ import static com.android.systemui.shared.statusbar.phone.BarTransitions.MODE_SE
import static com.android.systemui.shared.statusbar.phone.BarTransitions.MODE_TRANSLUCENT;
import static com.android.systemui.shared.statusbar.phone.BarTransitions.MODE_TRANSPARENT;
import static com.android.systemui.shared.statusbar.phone.BarTransitions.MODE_WARNING;
-import static com.android.systemui.statusbar.phone.fragment.dagger.StatusBarFragmentModule.OPERATOR_NAME_VIEW;
+import static com.android.systemui.statusbar.phone.fragment.dagger.HomeStatusBarModule.OPERATOR_NAME_VIEW;
import android.annotation.NonNull;
import android.os.Bundle;
@@ -32,7 +32,7 @@ import com.android.systemui.demomode.DemoMode;
import com.android.systemui.demomode.DemoModeCommandReceiver;
import com.android.systemui.demomode.DemoModeController;
import com.android.systemui.navigationbar.NavigationBarController;
-import com.android.systemui.statusbar.phone.fragment.dagger.StatusBarFragmentScope;
+import com.android.systemui.statusbar.phone.fragment.dagger.HomeStatusBarScope;
import com.android.systemui.statusbar.policy.Clock;
import com.android.systemui.util.ViewController;
@@ -48,7 +48,7 @@ import javax.inject.Named;
* This class extends ViewController not because it controls a specific view, but because we want it
* to get torn down and re-created in line with the view's lifecycle.
*/
-@StatusBarFragmentScope
+@HomeStatusBarScope
public class StatusBarDemoMode extends ViewController<View> implements DemoMode {
private final Clock mClockView;
private final View mOperatorNameView;
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/fragment/CollapsedStatusBarFragment.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/fragment/CollapsedStatusBarFragment.java
index d868519ee9e2..37c8c637c804 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/fragment/CollapsedStatusBarFragment.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/fragment/CollapsedStatusBarFragment.java
@@ -66,15 +66,15 @@ import com.android.systemui.statusbar.phone.NotificationIconContainer;
import com.android.systemui.statusbar.phone.PhoneStatusBarView;
import com.android.systemui.statusbar.phone.StatusBarHideIconsForBouncerManager;
import com.android.systemui.statusbar.phone.StatusBarLocation;
-import com.android.systemui.statusbar.phone.fragment.dagger.StatusBarFragmentComponent;
-import com.android.systemui.statusbar.phone.fragment.dagger.StatusBarFragmentComponent.Startable;
+import com.android.systemui.statusbar.phone.fragment.dagger.HomeStatusBarComponent;
+import com.android.systemui.statusbar.phone.fragment.dagger.HomeStatusBarComponent.Startable;
import com.android.systemui.statusbar.phone.ongoingcall.OngoingCallController;
import com.android.systemui.statusbar.phone.ongoingcall.OngoingCallListener;
import com.android.systemui.statusbar.phone.ui.DarkIconManager;
import com.android.systemui.statusbar.phone.ui.StatusBarIconController;
-import com.android.systemui.statusbar.pipeline.shared.ui.binder.CollapsedStatusBarViewBinder;
+import com.android.systemui.statusbar.pipeline.shared.ui.binder.HomeStatusBarViewBinder;
import com.android.systemui.statusbar.pipeline.shared.ui.binder.StatusBarVisibilityChangeListener;
-import com.android.systemui.statusbar.pipeline.shared.ui.viewmodel.CollapsedStatusBarViewModel;
+import com.android.systemui.statusbar.pipeline.shared.ui.viewmodel.HomeStatusBarViewModel;
import com.android.systemui.statusbar.policy.KeyguardStateController;
import com.android.systemui.statusbar.window.StatusBarWindowStateController;
import com.android.systemui.statusbar.window.StatusBarWindowStateListener;
@@ -115,7 +115,7 @@ public class CollapsedStatusBarFragment extends Fragment implements CommandQueue
public static final int FADE_IN_DELAY = 50;
private static final int SOURCE_SYSTEM_EVENT_ANIMATOR = 1;
private static final int SOURCE_OTHER = 2;
- private StatusBarFragmentComponent mStatusBarFragmentComponent;
+ private HomeStatusBarComponent mHomeStatusBarComponent;
private PhoneStatusBarView mStatusBar;
private final StatusBarStateController mStatusBarStateController;
private final KeyguardStateController mKeyguardStateController;
@@ -134,7 +134,7 @@ public class CollapsedStatusBarFragment extends Fragment implements CommandQueue
private StatusBarVisibilityModel mLastModifiedVisibility =
StatusBarVisibilityModel.createDefaultModel();
private DarkIconManager mDarkIconManager;
- private final StatusBarFragmentComponent.Factory mStatusBarFragmentComponentFactory;
+ private final HomeStatusBarComponent.Factory mHomeStatusBarComponentFactory;
private final CommandQueue mCommandQueue;
private final CollapsedStatusBarFragmentLogger mCollapsedStatusBarFragmentLogger;
private final OperatorNameViewController.Factory mOperatorNameViewControllerFactory;
@@ -143,8 +143,8 @@ public class CollapsedStatusBarFragment extends Fragment implements CommandQueue
private final ShadeExpansionStateManager mShadeExpansionStateManager;
private final StatusBarIconController mStatusBarIconController;
private final CarrierConfigTracker mCarrierConfigTracker;
- private final CollapsedStatusBarViewModel mCollapsedStatusBarViewModel;
- private final CollapsedStatusBarViewBinder mCollapsedStatusBarViewBinder;
+ private final HomeStatusBarViewModel mHomeStatusBarViewModel;
+ private final HomeStatusBarViewBinder mHomeStatusBarViewBinder;
private final StatusBarHideIconsForBouncerManager mStatusBarHideIconsForBouncerManager;
private final DarkIconManager.Factory mDarkIconManagerFactory;
private final SecureSettings mSecureSettings;
@@ -239,14 +239,14 @@ public class CollapsedStatusBarFragment extends Fragment implements CommandQueue
@Inject
public CollapsedStatusBarFragment(
- StatusBarFragmentComponent.Factory statusBarFragmentComponentFactory,
+ HomeStatusBarComponent.Factory homeStatusBarComponentFactory,
OngoingCallController ongoingCallController,
SystemStatusAnimationScheduler animationScheduler,
ShadeExpansionStateManager shadeExpansionStateManager,
StatusBarIconController statusBarIconController,
DarkIconManager.Factory darkIconManagerFactory,
- CollapsedStatusBarViewModel collapsedStatusBarViewModel,
- CollapsedStatusBarViewBinder collapsedStatusBarViewBinder,
+ HomeStatusBarViewModel homeStatusBarViewModel,
+ HomeStatusBarViewBinder homeStatusBarViewBinder,
StatusBarHideIconsForBouncerManager statusBarHideIconsForBouncerManager,
KeyguardStateController keyguardStateController,
PanelExpansionInteractor panelExpansionInteractor,
@@ -262,13 +262,13 @@ public class CollapsedStatusBarFragment extends Fragment implements CommandQueue
StatusBarWindowStateController statusBarWindowStateController,
KeyguardUpdateMonitor keyguardUpdateMonitor,
DemoModeController demoModeController) {
- mStatusBarFragmentComponentFactory = statusBarFragmentComponentFactory;
+ mHomeStatusBarComponentFactory = homeStatusBarComponentFactory;
mOngoingCallController = ongoingCallController;
mAnimationScheduler = animationScheduler;
mShadeExpansionStateManager = shadeExpansionStateManager;
mStatusBarIconController = statusBarIconController;
- mCollapsedStatusBarViewModel = collapsedStatusBarViewModel;
- mCollapsedStatusBarViewBinder = collapsedStatusBarViewBinder;
+ mHomeStatusBarViewModel = homeStatusBarViewModel;
+ mHomeStatusBarViewBinder = homeStatusBarViewBinder;
mStatusBarHideIconsForBouncerManager = statusBarHideIconsForBouncerManager;
mDarkIconManagerFactory = darkIconManagerFactory;
mKeyguardStateController = keyguardStateController;
@@ -335,11 +335,11 @@ public class CollapsedStatusBarFragment extends Fragment implements CommandQueue
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
mDumpManager.registerDumpable(getDumpableName(), this);
- mStatusBarFragmentComponent = mStatusBarFragmentComponentFactory.create(
+ mHomeStatusBarComponent = mHomeStatusBarComponentFactory.create(
(PhoneStatusBarView) getView());
- mStatusBarFragmentComponent.init();
+ mHomeStatusBarComponent.init();
mStartableStates.clear();
- for (Startable startable : mStatusBarFragmentComponent.getStartables()) {
+ for (Startable startable : mHomeStatusBarComponent.getStartables()) {
mStartableStates.put(startable, Startable.State.STARTING);
startable.start();
mStartableStates.put(startable, Startable.State.STARTED);
@@ -371,8 +371,8 @@ public class CollapsedStatusBarFragment extends Fragment implements CommandQueue
mCarrierConfigTracker.addCallback(mCarrierConfigCallback);
mCarrierConfigTracker.addDefaultDataSubscriptionChangedListener(mDefaultDataListener);
- mCollapsedStatusBarViewBinder.bind(
- mStatusBar, mCollapsedStatusBarViewModel, mStatusBarVisibilityChangeListener);
+ mHomeStatusBarViewBinder.bind(
+ mStatusBar, mHomeStatusBarViewModel, mStatusBarVisibilityChangeListener);
}
private String getDumpableName() {
@@ -474,7 +474,7 @@ public class CollapsedStatusBarFragment extends Fragment implements CommandQueue
mCarrierConfigTracker.removeCallback(mCarrierConfigCallback);
mCarrierConfigTracker.removeDataSubscriptionChangedListener(mDefaultDataListener);
- for (Startable startable : mStatusBarFragmentComponent.getStartables()) {
+ for (Startable startable : mHomeStatusBarComponent.getStartables()) {
mStartableStates.put(startable, Startable.State.STOPPING);
startable.stop();
mStartableStates.put(startable, Startable.State.STOPPED);
@@ -515,8 +515,8 @@ public class CollapsedStatusBarFragment extends Fragment implements CommandQueue
* fragment functionality and we won't need to expose it here anymore.
*/
@Nullable
- public StatusBarFragmentComponent getStatusBarFragmentComponent() {
- return mStatusBarFragmentComponent;
+ public HomeStatusBarComponent getHomeStatusBarComponent() {
+ return mHomeStatusBarComponent;
}
private StatusBarVisibilityChangeListener mStatusBarVisibilityChangeListener =
@@ -622,7 +622,7 @@ public class CollapsedStatusBarFragment extends Fragment implements CommandQueue
// TODO(b/328393714) use HeadsUpNotificationInteractor.showHeadsUpStatusBar instead.
boolean headsUpVisible =
- mStatusBarFragmentComponent.getHeadsUpAppearanceController().shouldBeVisible();
+ mHomeStatusBarComponent.getHeadsUpAppearanceController().shouldBeVisible();
if (SceneContainerFlag.isEnabled()) {
// With the scene container, only use the value calculated by the view model to
@@ -757,7 +757,7 @@ public class CollapsedStatusBarFragment extends Fragment implements CommandQueue
// transition to occluding to finish before allowing us to potentially show the status bar
// again. (This status bar is always hidden on keyguard, so it's safe to continue hiding it
// during this transition.) See b/273314977.
- if (mCollapsedStatusBarViewModel.isTransitioningFromLockscreenToOccluded().getValue()) {
+ if (mHomeStatusBarViewModel.isTransitioningFromLockscreenToOccluded().getValue()) {
return true;
}
@@ -997,7 +997,7 @@ public class CollapsedStatusBarFragment extends Fragment implements CommandQueue
pw.println("mHasPrimaryOngoingActivity=" + mHasPrimaryOngoingActivity);
pw.println("mHasSecondaryOngoingActivity=" + mHasSecondaryOngoingActivity);
pw.println("mAnimationsEnabled=" + mAnimationsEnabled);
- StatusBarFragmentComponent component = mStatusBarFragmentComponent;
+ HomeStatusBarComponent component = mHomeStatusBarComponent;
if (component == null) {
pw.println("StatusBarFragmentComponent is null");
} else {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/fragment/CollapsedStatusBarFragmentStartable.kt b/packages/SystemUI/src/com/android/systemui/statusbar/phone/fragment/CollapsedStatusBarFragmentStartable.kt
index 55af0e3d65a3..94006f6cf1a9 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/fragment/CollapsedStatusBarFragmentStartable.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/fragment/CollapsedStatusBarFragmentStartable.kt
@@ -20,7 +20,7 @@ import com.android.systemui.CoreStartable
import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.fragments.FragmentService
import com.android.systemui.qs.QSFragmentStartable
-import com.android.systemui.statusbar.phone.fragment.dagger.StatusBarFragmentComponent
+import com.android.systemui.statusbar.phone.fragment.dagger.HomeStatusBarComponent
import dagger.Binds
import dagger.Module
import dagger.multibindings.ClassKey
@@ -37,7 +37,7 @@ class CollapsedStatusBarFragmentStartable
@Inject
constructor(
private val fragmentService: FragmentService,
- private val collapsedstatusBarFragmentProvider: Provider<CollapsedStatusBarFragment>
+ private val collapsedstatusBarFragmentProvider: Provider<CollapsedStatusBarFragment>,
) : CoreStartable {
override fun start() {
fragmentService.addFragmentInstantiationProvider(
@@ -47,7 +47,7 @@ constructor(
}
}
-@Module(subcomponents = [StatusBarFragmentComponent::class])
+@Module(subcomponents = [HomeStatusBarComponent::class])
interface CollapsedStatusBarFragmentStartableModule {
@Binds
@IntoMap
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/fragment/dagger/StatusBarFragmentComponent.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/fragment/dagger/HomeStatusBarComponent.java
index 96faa359d43e..d4cb625d3722 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/fragment/dagger/StatusBarFragmentComponent.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/fragment/dagger/HomeStatusBarComponent.java
@@ -42,27 +42,29 @@ import java.util.Set;
* fragment is recreated.
*
* Anything that depends on {@link CollapsedStatusBarFragment} or {@link PhoneStatusBarView}
- * should be included here or in {@link StatusBarFragmentModule}.
+ * should be included here or in {@link HomeStatusBarModule}.
*/
-
@Subcomponent(modules = {
- StatusBarFragmentModule.class,
+ HomeStatusBarModule.class,
StatusBarStartablesModule.class
})
-@StatusBarFragmentScope
-public interface StatusBarFragmentComponent {
+@HomeStatusBarScope
+public interface HomeStatusBarComponent {
/** Simple factory. */
@Subcomponent.Factory
interface Factory {
- StatusBarFragmentComponent create(
+ /** */
+ HomeStatusBarComponent create(
@BindsInstance @RootView PhoneStatusBarView phoneStatusBarView);
}
/**
- * Performs initialization logic after {@link StatusBarFragmentComponent} has been constructed.
+ * Performs initialization logic after {@link HomeStatusBarComponent} has been constructed.
*/
interface Startable {
+ /** */
void start();
+ /** */
void stop();
enum State {
@@ -86,32 +88,32 @@ public interface StatusBarFragmentComponent {
}
/** */
- @StatusBarFragmentScope
+ @HomeStatusBarScope
BatteryMeterViewController getBatteryMeterViewController();
/** */
- @StatusBarFragmentScope
+ @HomeStatusBarScope
@RootView
PhoneStatusBarView getPhoneStatusBarView();
/** */
- @StatusBarFragmentScope
+ @HomeStatusBarScope
PhoneStatusBarViewController getPhoneStatusBarViewController();
/** */
- @StatusBarFragmentScope
+ @HomeStatusBarScope
HeadsUpAppearanceController getHeadsUpAppearanceController();
/** */
- @StatusBarFragmentScope
+ @HomeStatusBarScope
LegacyLightsOutNotifController getLegacyLightsOutNotifController();
/** */
- @StatusBarFragmentScope
+ @HomeStatusBarScope
StatusBarDemoMode getStatusBarDemoMode();
/** */
- @StatusBarFragmentScope
+ @HomeStatusBarScope
PhoneStatusBarTransitions getPhoneStatusBarTransitions();
/** */
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/fragment/dagger/StatusBarFragmentModule.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/fragment/dagger/HomeStatusBarModule.java
index cf877a741d6b..f6f8adb851e9 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/fragment/dagger/StatusBarFragmentModule.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/fragment/dagger/HomeStatusBarModule.java
@@ -20,15 +20,17 @@ import android.view.View;
import android.view.ViewStub;
import com.android.systemui.battery.BatteryMeterView;
+import com.android.systemui.dagger.qualifiers.DisplaySpecific;
import com.android.systemui.dagger.qualifiers.RootView;
import com.android.systemui.res.R;
import com.android.systemui.statusbar.HeadsUpStatusBarView;
+import com.android.systemui.statusbar.data.repository.StatusBarConfigurationController;
+import com.android.systemui.statusbar.data.repository.StatusBarConfigurationControllerStore;
import com.android.systemui.statusbar.phone.PhoneStatusBarTransitions;
import com.android.systemui.statusbar.phone.PhoneStatusBarView;
import com.android.systemui.statusbar.phone.PhoneStatusBarViewController;
import com.android.systemui.statusbar.phone.StatusBarLocation;
import com.android.systemui.statusbar.policy.Clock;
-import com.android.systemui.statusbar.window.StatusBarWindowController;
import com.android.systemui.statusbar.window.StatusBarWindowControllerStore;
import dagger.Module;
@@ -38,9 +40,9 @@ import java.util.Optional;
import javax.inject.Named;
-/** Dagger module for {@link StatusBarFragmentComponent}. */
+/** Dagger module for {@link HomeStatusBarComponent}. */
@Module
-public interface StatusBarFragmentModule {
+public interface HomeStatusBarModule {
String LIGHTS_OUT_NOTIF_VIEW = "lights_out_notif_view";
String OPERATOR_NAME_VIEW = "operator_name_view";
@@ -50,21 +52,21 @@ public interface StatusBarFragmentModule {
/** */
@Provides
- @StatusBarFragmentScope
+ @HomeStatusBarScope
static BatteryMeterView provideBatteryMeterView(@RootView PhoneStatusBarView view) {
return view.findViewById(R.id.battery);
}
/** */
@Provides
- @StatusBarFragmentScope
+ @HomeStatusBarScope
static StatusBarLocation getStatusBarLocation() {
return StatusBarLocation.HOME;
}
/** */
@Provides
- @StatusBarFragmentScope
+ @HomeStatusBarScope
@Named(START_SIDE_CONTENT)
static View startSideContent(@RootView PhoneStatusBarView view) {
return view.findViewById(R.id.status_bar_start_side_content);
@@ -72,7 +74,7 @@ public interface StatusBarFragmentModule {
/** */
@Provides
- @StatusBarFragmentScope
+ @HomeStatusBarScope
@Named(END_SIDE_CONTENT)
static View endSideContent(@RootView PhoneStatusBarView view) {
return view.findViewById(R.id.status_bar_end_side_content);
@@ -80,7 +82,7 @@ public interface StatusBarFragmentModule {
/** */
@Provides
- @StatusBarFragmentScope
+ @HomeStatusBarScope
@Named(LIGHTS_OUT_NOTIF_VIEW)
static View provideLightsOutNotifView(@RootView PhoneStatusBarView view) {
return view.findViewById(R.id.notification_lights_out);
@@ -88,7 +90,7 @@ public interface StatusBarFragmentModule {
/** */
@Provides
- @StatusBarFragmentScope
+ @HomeStatusBarScope
@Named(OPERATOR_NAME_VIEW)
static View provideOperatorNameView(@RootView PhoneStatusBarView view) {
View operatorName = ((ViewStub) view.findViewById(R.id.operator_name_stub)).inflate();
@@ -98,7 +100,7 @@ public interface StatusBarFragmentModule {
/** */
@Provides
- @StatusBarFragmentScope
+ @HomeStatusBarScope
@Named(OPERATOR_NAME_FRAME_VIEW)
static Optional<View> provideOperatorFrameNameView(@RootView PhoneStatusBarView view) {
return Optional.ofNullable(view.findViewById(R.id.operator_name_frame));
@@ -106,14 +108,14 @@ public interface StatusBarFragmentModule {
/** */
@Provides
- @StatusBarFragmentScope
+ @HomeStatusBarScope
static Clock provideClock(@RootView PhoneStatusBarView view) {
return view.findViewById(R.id.clock);
}
/** */
@Provides
- @StatusBarFragmentScope
+ @HomeStatusBarScope
static PhoneStatusBarViewController providePhoneStatusBarViewController(
PhoneStatusBarViewController.Factory phoneStatusBarViewControllerFactory,
@RootView PhoneStatusBarView phoneStatusBarView) {
@@ -123,7 +125,7 @@ public interface StatusBarFragmentModule {
/** */
@Provides
- @StatusBarFragmentScope
+ @HomeStatusBarScope
static PhoneStatusBarTransitions providePhoneStatusBarTransitions(
@RootView PhoneStatusBarView view,
StatusBarWindowControllerStore statusBarWindowControllerStore) {
@@ -133,8 +135,25 @@ public interface StatusBarFragmentModule {
/** */
@Provides
- @StatusBarFragmentScope
+ @HomeStatusBarScope
static HeadsUpStatusBarView providesHeasdUpStatusBarView(@RootView PhoneStatusBarView view) {
return view.findViewById(R.id.heads_up_status_bar_view);
}
+
+ /** */
+ @Provides
+ @HomeStatusBarScope
+ @DisplaySpecific
+ static int displayId(@RootView PhoneStatusBarView view) {
+ return view.getContext().getDisplayId();
+ }
+
+ /** */
+ @Provides
+ @HomeStatusBarScope
+ static StatusBarConfigurationController configurationController(
+ @DisplaySpecific int displayId, StatusBarConfigurationControllerStore store) {
+ return store.forDisplay(displayId);
+ }
+
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/fragment/dagger/StatusBarFragmentScope.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/fragment/dagger/HomeStatusBarScope.java
index 96cff5960d68..2b1edddacd8d 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/fragment/dagger/StatusBarFragmentScope.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/fragment/dagger/HomeStatusBarScope.java
@@ -24,9 +24,9 @@ import java.lang.annotation.Retention;
import javax.inject.Scope;
/**
- * Scope annotation for singleton items within the {@link StatusBarFragmentComponent}.
+ * Scope annotation for singleton items within the {@link HomeStatusBarComponent}.
*/
@Documented
@Retention(RUNTIME)
@Scope
-public @interface StatusBarFragmentScope {}
+public @interface HomeStatusBarScope {}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/fragment/dagger/StatusBarStartablesModule.kt b/packages/SystemUI/src/com/android/systemui/statusbar/phone/fragment/dagger/StatusBarStartablesModule.kt
index 9003d13df0a0..ba9181436fb9 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/fragment/dagger/StatusBarStartablesModule.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/fragment/dagger/StatusBarStartablesModule.kt
@@ -28,5 +28,5 @@ internal interface StatusBarStartablesModule {
@IntoSet
fun statusBarBoundsCalculator(
statusBarBoundsProvider: StatusBarBoundsProvider
- ): StatusBarFragmentComponent.Startable
+ ): HomeStatusBarComponent.Startable
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/dagger/StatusBarPipelineModule.kt b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/dagger/StatusBarPipelineModule.kt
index 48500499f537..935b1012be31 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/dagger/StatusBarPipelineModule.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/dagger/StatusBarPipelineModule.kt
@@ -48,10 +48,10 @@ import com.android.systemui.statusbar.pipeline.satellite.ui.viewmodel.DeviceBase
import com.android.systemui.statusbar.pipeline.satellite.ui.viewmodel.DeviceBasedSatelliteViewModelImpl
import com.android.systemui.statusbar.pipeline.shared.data.repository.ConnectivityRepository
import com.android.systemui.statusbar.pipeline.shared.data.repository.ConnectivityRepositoryImpl
-import com.android.systemui.statusbar.pipeline.shared.ui.binder.CollapsedStatusBarViewBinder
-import com.android.systemui.statusbar.pipeline.shared.ui.binder.CollapsedStatusBarViewBinderImpl
-import com.android.systemui.statusbar.pipeline.shared.ui.viewmodel.CollapsedStatusBarViewModel
-import com.android.systemui.statusbar.pipeline.shared.ui.viewmodel.CollapsedStatusBarViewModelImpl
+import com.android.systemui.statusbar.pipeline.shared.ui.binder.HomeStatusBarViewBinder
+import com.android.systemui.statusbar.pipeline.shared.ui.binder.HomeStatusBarViewBinderImpl
+import com.android.systemui.statusbar.pipeline.shared.ui.viewmodel.HomeStatusBarViewModel
+import com.android.systemui.statusbar.pipeline.shared.ui.viewmodel.HomeStatusBarViewModelImpl
import com.android.systemui.statusbar.pipeline.wifi.data.repository.RealWifiRepository
import com.android.systemui.statusbar.pipeline.wifi.data.repository.WifiRepository
import com.android.systemui.statusbar.pipeline.wifi.data.repository.WifiRepositorySwitcher
@@ -131,14 +131,10 @@ abstract class StatusBarPipelineModule {
abstract fun bindCarrierConfigStartable(impl: CarrierConfigCoreStartable): CoreStartable
@Binds
- abstract fun collapsedStatusBarViewModel(
- impl: CollapsedStatusBarViewModelImpl
- ): CollapsedStatusBarViewModel
+ abstract fun homeStatusBarViewModel(impl: HomeStatusBarViewModelImpl): HomeStatusBarViewModel
@Binds
- abstract fun collapsedStatusBarViewBinder(
- impl: CollapsedStatusBarViewBinderImpl
- ): CollapsedStatusBarViewBinder
+ abstract fun homeStatusBarViewBinder(impl: HomeStatusBarViewBinderImpl): HomeStatusBarViewBinder
companion object {
@@ -162,7 +158,7 @@ abstract class StatusBarPipelineModule {
@SysUISingleton
@Named(FIRST_MOBILE_SUB_SHOWING_NETWORK_TYPE_ICON)
fun provideFirstMobileSubShowingNetworkTypeIconProvider(
- mobileIconsViewModel: MobileIconsViewModel,
+ mobileIconsViewModel: MobileIconsViewModel
): Supplier<Flow<Boolean>> {
return Supplier<Flow<Boolean>> {
mobileIconsViewModel.firstMobileSubShowingNetworkTypeIcon
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/shared/ui/binder/CollapsedStatusBarViewBinder.kt b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/shared/ui/binder/HomeStatusBarViewBinder.kt
index 3a07d9b6beaf..8d7b57db4125 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/shared/ui/binder/CollapsedStatusBarViewBinder.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/shared/ui/binder/HomeStatusBarViewBinder.kt
@@ -33,31 +33,32 @@ import com.android.systemui.statusbar.chips.ui.model.OngoingActivityChipModel
import com.android.systemui.statusbar.core.StatusBarSimpleFragment
import com.android.systemui.statusbar.notification.shared.NotificationsLiveDataStoreRefactor
import com.android.systemui.statusbar.phone.fragment.CollapsedStatusBarFragment
-import com.android.systemui.statusbar.pipeline.shared.ui.viewmodel.CollapsedStatusBarViewModel
+import com.android.systemui.statusbar.pipeline.shared.ui.viewmodel.HomeStatusBarViewModel
+import com.android.systemui.statusbar.pipeline.shared.ui.viewmodel.HomeStatusBarViewModel.VisibilityModel
import javax.inject.Inject
import kotlinx.coroutines.launch
/**
- * Interface to assist with binding the [CollapsedStatusBarFragment] to
- * [CollapsedStatusBarViewModel]. Used only to enable easy testing of [CollapsedStatusBarFragment].
+ * Interface to assist with binding the [CollapsedStatusBarFragment] to [HomeStatusBarViewModel].
+ * Used only to enable easy testing of [CollapsedStatusBarFragment].
*/
-interface CollapsedStatusBarViewBinder {
+interface HomeStatusBarViewBinder {
/**
* Binds the view to the view-model. [listener] will be notified whenever an event that may
* change the status bar visibility occurs.
*/
fun bind(
view: View,
- viewModel: CollapsedStatusBarViewModel,
+ viewModel: HomeStatusBarViewModel,
listener: StatusBarVisibilityChangeListener,
)
}
@SysUISingleton
-class CollapsedStatusBarViewBinderImpl @Inject constructor() : CollapsedStatusBarViewBinder {
+class HomeStatusBarViewBinderImpl @Inject constructor() : HomeStatusBarViewBinder {
override fun bind(
view: View,
- viewModel: CollapsedStatusBarViewModel,
+ viewModel: HomeStatusBarViewModel,
listener: StatusBarVisibilityChangeListener,
) {
view.repeatWhenAttached {
@@ -185,9 +186,8 @@ class CollapsedStatusBarViewBinderImpl @Inject constructor() : CollapsedStatusBa
}
}
- private fun OngoingActivityChipModel.toVisibilityModel():
- CollapsedStatusBarViewModel.VisibilityModel {
- return CollapsedStatusBarViewModel.VisibilityModel(
+ private fun OngoingActivityChipModel.toVisibilityModel(): VisibilityModel {
+ return VisibilityModel(
visibility = if (this is OngoingActivityChipModel.Shown) View.VISIBLE else View.GONE,
// TODO(b/364653005): Figure out the animation story here.
shouldAnimateChange = true,
@@ -224,7 +224,7 @@ class CollapsedStatusBarViewBinderImpl @Inject constructor() : CollapsedStatusBa
.start()
}
- private fun View.adjustVisibility(model: CollapsedStatusBarViewModel.VisibilityModel) {
+ private fun View.adjustVisibility(model: VisibilityModel) {
if (model.visibility == View.VISIBLE) {
this.show(model.shouldAnimateChange)
} else {
@@ -298,7 +298,7 @@ interface StatusBarVisibilityChangeListener {
/**
* Called when the scene state has changed such that the home status bar is newly allowed or no
- * longer allowed. See [CollapsedStatusBarViewModel.isHomeStatusBarAllowedByScene].
+ * longer allowed. See [HomeStatusBarViewModel.isHomeStatusBarAllowedByScene].
*/
fun onIsHomeStatusBarAllowedBySceneChanged(isHomeStatusBarAllowedByScene: Boolean)
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/shared/ui/composable/RetroText.kt b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/shared/ui/composable/RetroText.kt
new file mode 100644
index 000000000000..71bbdeaeb475
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/shared/ui/composable/RetroText.kt
@@ -0,0 +1,66 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.systemui.statusbar.pipeline.shared.ui.composable
+
+import androidx.compose.foundation.layout.offset
+import androidx.compose.material3.Text
+import androidx.compose.runtime.Composable
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.graphics.Color
+import androidx.compose.ui.text.TextStyle
+import androidx.compose.ui.text.font.FontStyle
+import androidx.compose.ui.text.font.FontWeight
+import androidx.compose.ui.text.style.TextAlign
+import androidx.compose.ui.unit.Dp
+import androidx.compose.ui.unit.dp
+import androidx.compose.ui.unit.sp
+
+private val retroColors =
+ listOf(
+ Color(0xFFEADFB4), // beige
+ Color(0xFF9BB0C1), // gray-blue
+ Color(0xFFF6995C), // orange
+ Color(0xFF51829B), // cyan
+ )
+
+/** Render a single string multiple times (with offsets) kinda like retro vintage text */
+@Composable
+fun RetroText(text: String = "") {
+ // Render the text for each retroColor, and then once for the foreground
+ for (i in retroColors.size downTo 1) {
+ val color = retroColors[i - 1]
+ RetroTextLayer(text = text, color = color, (-1.5 * i).dp, i.dp)
+ }
+
+ RetroTextLayer(text = text, color = Color.Black, ox = 0.dp, oy = 0.dp)
+}
+
+@Composable
+fun RetroTextLayer(text: String, color: Color, ox: Dp, oy: Dp) {
+ Text(
+ text = text,
+ modifier = Modifier.offset(ox, oy),
+ textAlign = TextAlign.Center,
+ style =
+ TextStyle(
+ fontSize = 18.sp,
+ fontWeight = FontWeight.Bold,
+ fontStyle = FontStyle.Italic,
+ color = color,
+ ),
+ )
+}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/shared/ui/composable/StatusBarRoot.kt b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/shared/ui/composable/StatusBarRoot.kt
new file mode 100644
index 000000000000..a21cc22ad03f
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/shared/ui/composable/StatusBarRoot.kt
@@ -0,0 +1,193 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.systemui.statusbar.pipeline.shared.ui.composable
+
+import android.view.LayoutInflater
+import android.view.View
+import android.view.ViewGroup
+import androidx.compose.foundation.layout.Box
+import androidx.compose.foundation.layout.Row
+import androidx.compose.foundation.layout.fillMaxSize
+import androidx.compose.runtime.Composable
+import androidx.compose.runtime.rememberCoroutineScope
+import androidx.compose.ui.Alignment
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.draw.alpha
+import androidx.compose.ui.platform.ComposeView
+import androidx.compose.ui.viewinterop.AndroidView
+import androidx.lifecycle.compose.collectAsStateWithLifecycle
+import com.android.systemui.res.R
+import com.android.systemui.statusbar.notification.icon.ui.viewbinder.NotificationIconContainerStatusBarViewBinder
+import com.android.systemui.statusbar.phone.NotificationIconContainer
+import com.android.systemui.statusbar.phone.PhoneStatusBarView
+import com.android.systemui.statusbar.phone.StatusBarLocation
+import com.android.systemui.statusbar.phone.StatusIconContainer
+import com.android.systemui.statusbar.phone.ongoingcall.OngoingCallController
+import com.android.systemui.statusbar.phone.ui.DarkIconManager
+import com.android.systemui.statusbar.phone.ui.StatusBarIconController
+import com.android.systemui.statusbar.pipeline.shared.ui.binder.HomeStatusBarViewBinder
+import com.android.systemui.statusbar.pipeline.shared.ui.binder.StatusBarVisibilityChangeListener
+import com.android.systemui.statusbar.pipeline.shared.ui.viewmodel.HomeStatusBarViewModel
+import javax.inject.Inject
+import kotlinx.coroutines.launch
+
+/** Factory to simplify the dependency management for [StatusBarRoot] */
+class StatusBarRootFactory
+@Inject
+constructor(
+ private val homeStatusBarViewModel: HomeStatusBarViewModel,
+ private val homeStatusBarViewBinder: HomeStatusBarViewBinder,
+ private val notificationIconsBinder: NotificationIconContainerStatusBarViewBinder,
+ private val darkIconManagerFactory: DarkIconManager.Factory,
+ private val iconController: StatusBarIconController,
+ private val ongoingCallController: OngoingCallController,
+) {
+ fun create(root: ViewGroup, andThen: (ViewGroup) -> Unit): ComposeView {
+ val composeView = ComposeView(root.context)
+ composeView.apply {
+ setContent {
+ StatusBarRoot(
+ parent = root,
+ statusBarViewModel = homeStatusBarViewModel,
+ statusBarViewBinder = homeStatusBarViewBinder,
+ notificationIconsBinder = notificationIconsBinder,
+ darkIconManagerFactory = darkIconManagerFactory,
+ iconController = iconController,
+ ongoingCallController = ongoingCallController,
+ onViewCreated = andThen,
+ )
+ }
+ }
+
+ return composeView
+ }
+}
+
+/**
+ * For now, this class exists only to replace the former CollapsedStatusBarFragment. We simply stand
+ * up the PhoneStatusBarView here (allowing the component to be initialized from the [init] block).
+ * This is the place, for now, where we can manually set up lingering dependencies that came from
+ * the fragment until we can move them to recommended-arch style repos.
+ *
+ * @param onViewCreated called immediately after the view is inflated, and takes as a parameter the
+ * newly-inflated PhoneStatusBarView. This lambda is useful for tying together old initialization
+ * logic until it can be replaced.
+ */
+@Composable
+fun StatusBarRoot(
+ parent: ViewGroup,
+ statusBarViewModel: HomeStatusBarViewModel,
+ statusBarViewBinder: HomeStatusBarViewBinder,
+ notificationIconsBinder: NotificationIconContainerStatusBarViewBinder,
+ darkIconManagerFactory: DarkIconManager.Factory,
+ iconController: StatusBarIconController,
+ ongoingCallController: OngoingCallController,
+ onViewCreated: (ViewGroup) -> Unit,
+) {
+ // None of these methods are used when [StatusBarSimpleFragment] is on.
+ // This can be deleted once the fragment is gone
+ val nopVisibilityChangeListener =
+ object : StatusBarVisibilityChangeListener {
+ override fun onStatusBarVisibilityMaybeChanged() {}
+
+ override fun onTransitionFromLockscreenToDreamStarted() {}
+
+ override fun onOngoingActivityStatusChanged(
+ hasPrimaryOngoingActivity: Boolean,
+ hasSecondaryOngoingActivity: Boolean,
+ shouldAnimate: Boolean,
+ ) {}
+
+ override fun onIsHomeStatusBarAllowedBySceneChanged(
+ isHomeStatusBarAllowedByScene: Boolean
+ ) {}
+ }
+
+ Box(Modifier.fillMaxSize()) {
+ // TODO(b/364360986): remove this before rolling the flag forward
+ Disambiguation(viewModel = statusBarViewModel)
+
+ Row(Modifier.fillMaxSize()) {
+ val scope = rememberCoroutineScope()
+ AndroidView(
+ factory = { context ->
+ val inflater = LayoutInflater.from(context)
+ val phoneStatusBarView =
+ inflater.inflate(R.layout.status_bar, parent, false) as PhoneStatusBarView
+
+ // For now, just set up the system icons the same way we used to
+ val statusIconContainer =
+ phoneStatusBarView.requireViewById<StatusIconContainer>(R.id.statusIcons)
+ // TODO(b/364360986): turn this into a repo/intr/viewmodel
+ val darkIconManager =
+ darkIconManagerFactory.create(statusIconContainer, StatusBarLocation.HOME)
+ iconController.addIconGroup(darkIconManager)
+
+ // TODO(b/372657935): This won't be needed once OngoingCallController is
+ // implemented in recommended architecture
+ ongoingCallController.setChipView(
+ phoneStatusBarView.requireViewById(R.id.ongoing_activity_chip_primary)
+ )
+
+ // For notifications, first inflate the [NotificationIconContainer]
+ val notificationIconArea =
+ phoneStatusBarView.requireViewById<ViewGroup>(R.id.notification_icon_area)
+ inflater.inflate(R.layout.notification_icon_area, notificationIconArea, true)
+ // Then bind it using the icons binder
+ val notificationIconContainer =
+ phoneStatusBarView.requireViewById<NotificationIconContainer>(
+ R.id.notificationIcons
+ )
+ scope.launch {
+ notificationIconsBinder.bindWhileAttached(notificationIconContainer)
+ }
+
+ // This binder handles everything else
+ scope.launch {
+ statusBarViewBinder.bind(
+ phoneStatusBarView,
+ statusBarViewModel,
+ nopVisibilityChangeListener,
+ )
+ }
+ onViewCreated(phoneStatusBarView)
+ phoneStatusBarView
+ }
+ )
+ }
+ }
+}
+
+/**
+ * This is our analog of the flexi "ribbon", which just shows some text so we know if the flag is on
+ */
+@Composable
+fun Disambiguation(viewModel: HomeStatusBarViewModel) {
+ val clockVisibilityModel =
+ viewModel.isClockVisible.collectAsStateWithLifecycle(
+ initialValue =
+ HomeStatusBarViewModel.VisibilityModel(
+ visibility = View.GONE,
+ shouldAnimateChange = false,
+ )
+ )
+ if (clockVisibilityModel.value.visibility == View.VISIBLE) {
+ Box(modifier = Modifier.fillMaxSize().alpha(0.5f), contentAlignment = Alignment.Center) {
+ RetroText(text = "COMPOSE->BAR")
+ }
+ }
+}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/shared/ui/viewmodel/CollapsedStatusBarViewModel.kt b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/shared/ui/viewmodel/HomeStatusBarViewModel.kt
index 366ea3516965..4277a8be64d3 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/shared/ui/viewmodel/CollapsedStatusBarViewModel.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/pipeline/shared/ui/viewmodel/HomeStatusBarViewModel.kt
@@ -19,6 +19,7 @@ package com.android.systemui.statusbar.pipeline.shared.ui.viewmodel
import android.view.View
import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.dagger.qualifiers.Application
+import com.android.systemui.keyguard.domain.interactor.KeyguardInteractor
import com.android.systemui.keyguard.domain.interactor.KeyguardTransitionInteractor
import com.android.systemui.keyguard.shared.model.Edge
import com.android.systemui.keyguard.shared.model.KeyguardState.DREAMING
@@ -38,7 +39,7 @@ import com.android.systemui.statusbar.notification.domain.interactor.ActiveNotif
import com.android.systemui.statusbar.notification.shared.NotificationsLiveDataStoreRefactor
import com.android.systemui.statusbar.phone.domain.interactor.LightsOutInteractor
import com.android.systemui.statusbar.pipeline.shared.domain.interactor.CollapsedStatusBarInteractor
-import com.android.systemui.statusbar.pipeline.shared.ui.viewmodel.CollapsedStatusBarViewModel.VisibilityModel
+import com.android.systemui.statusbar.pipeline.shared.ui.viewmodel.HomeStatusBarViewModel.VisibilityModel
import javax.inject.Inject
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.flow.Flow
@@ -61,7 +62,7 @@ import kotlinx.coroutines.flow.stateIn
* [StatusBarHideIconsForBouncerManager]. We should move those pieces of logic to this class instead
* so that it's all in one place and easily testable outside of the fragment.
*/
-interface CollapsedStatusBarViewModel {
+interface HomeStatusBarViewModel {
/**
* True if the device is currently transitioning from lockscreen to occluded and false
* otherwise.
@@ -116,19 +117,20 @@ interface CollapsedStatusBarViewModel {
}
@SysUISingleton
-class CollapsedStatusBarViewModelImpl
+class HomeStatusBarViewModelImpl
@Inject
constructor(
collapsedStatusBarInteractor: CollapsedStatusBarInteractor,
private val lightsOutInteractor: LightsOutInteractor,
private val notificationsInteractor: ActiveNotificationsInteractor,
keyguardTransitionInteractor: KeyguardTransitionInteractor,
+ keyguardInteractor: KeyguardInteractor,
sceneInteractor: SceneInteractor,
sceneContainerOcclusionInteractor: SceneContainerOcclusionInteractor,
shadeInteractor: ShadeInteractor,
ongoingActivityChipsViewModel: OngoingActivityChipsViewModel,
@Application coroutineScope: CoroutineScope,
-) : CollapsedStatusBarViewModel {
+) : HomeStatusBarViewModel {
override val isTransitioningFromLockscreenToOccluded: StateFlow<Boolean> =
keyguardTransitionInteractor
.isInTransition(Edge.create(from = LOCKSCREEN, to = OCCLUDED))
@@ -184,29 +186,43 @@ constructor(
// TODO(b/364360986): Add edge cases, like secure camera launch.
}
- private val isHomeScreenStatusBarAllowed: Flow<Boolean> =
+ private val isHomeStatusBarAllowed: Flow<Boolean> =
if (SceneContainerFlag.isEnabled) {
isHomeStatusBarAllowedByScene
} else {
isHomeScreenStatusBarAllowedLegacy
}
+ private val shouldHomeStatusBarBeVisible =
+ combine(isHomeStatusBarAllowed, keyguardInteractor.isSecureCameraActive) {
+ isHomeStatusBarAllowed,
+ isSecureCameraActive ->
+ // When launching the camera over the lockscreen, the status icons would typically
+ // become visible momentarily before animating out, since we're not yet aware that the
+ // launching camera activity is fullscreen. Even once the activity finishes launching,
+ // it takes a short time before WM decides that the top app wants to hide the icons and
+ // tells us to hide them.
+ // To ensure that this high-visibility animation is smooth, keep the icons hidden during
+ // a camera launch. See b/257292822.
+ isHomeStatusBarAllowed && !isSecureCameraActive
+ }
+
override val isClockVisible: Flow<VisibilityModel> =
combine(
- isHomeScreenStatusBarAllowed,
+ shouldHomeStatusBarBeVisible,
collapsedStatusBarInteractor.visibilityViaDisableFlags,
- ) { isStatusBarAllowed, visibilityViaDisableFlags ->
- val showClock = isStatusBarAllowed && visibilityViaDisableFlags.isClockAllowed
+ ) { shouldStatusBarBeVisible, visibilityViaDisableFlags ->
+ val showClock = shouldStatusBarBeVisible && visibilityViaDisableFlags.isClockAllowed
// TODO(b/364360986): Take CollapsedStatusBarFragment.clockHiddenMode into account.
VisibilityModel(showClock.toVisibilityInt(), visibilityViaDisableFlags.animate)
}
override val isNotificationIconContainerVisible: Flow<VisibilityModel> =
combine(
- isHomeScreenStatusBarAllowed,
+ shouldHomeStatusBarBeVisible,
collapsedStatusBarInteractor.visibilityViaDisableFlags,
- ) { isStatusBarAllowed, visibilityViaDisableFlags ->
+ ) { shouldStatusBarBeVisible, visibilityViaDisableFlags ->
val showNotificationIconContainer =
- isStatusBarAllowed && visibilityViaDisableFlags.areNotificationIconsAllowed
+ shouldStatusBarBeVisible && visibilityViaDisableFlags.areNotificationIconsAllowed
VisibilityModel(
showNotificationIconContainer.toVisibilityInt(),
visibilityViaDisableFlags.animate,
@@ -214,10 +230,11 @@ constructor(
}
override val isSystemInfoVisible: Flow<VisibilityModel> =
combine(
- isHomeScreenStatusBarAllowed,
+ shouldHomeStatusBarBeVisible,
collapsedStatusBarInteractor.visibilityViaDisableFlags,
- ) { isStatusBarAllowed, visibilityViaDisableFlags ->
- val showSystemInfo = isStatusBarAllowed && visibilityViaDisableFlags.isSystemInfoAllowed
+ ) { shouldStatusBarBeVisible, visibilityViaDisableFlags ->
+ val showSystemInfo =
+ shouldStatusBarBeVisible && visibilityViaDisableFlags.isSystemInfoAllowed
VisibilityModel(showSystemInfo.toVisibilityInt(), visibilityViaDisableFlags.animate)
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/window/StatusBarWindowController.kt b/packages/SystemUI/src/com/android/systemui/statusbar/window/StatusBarWindowController.kt
index e8dc93465685..ae0e76f01faa 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/window/StatusBarWindowController.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/window/StatusBarWindowController.kt
@@ -22,6 +22,7 @@ import android.view.ViewGroup
import com.android.app.viewcapture.ViewCaptureAwareWindowManager
import com.android.systemui.animation.ActivityTransitionAnimator
import com.android.systemui.fragments.FragmentHostManager
+import com.android.systemui.statusbar.data.repository.StatusBarConfigurationController
import java.util.Optional
/** Encapsulates all logic for the status bar window state management. */
@@ -80,6 +81,7 @@ interface StatusBarWindowController {
fun create(
context: Context,
viewCaptureAwareWindowManager: ViewCaptureAwareWindowManager,
+ statusBarConfigurationController: StatusBarConfigurationController,
): StatusBarWindowController
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/window/StatusBarWindowControllerImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/window/StatusBarWindowControllerImpl.java
index d709e5a0cd6c..e4c6737856f0 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/window/StatusBarWindowControllerImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/window/StatusBarWindowControllerImpl.java
@@ -54,6 +54,8 @@ import com.android.systemui.animation.DelegateTransitionAnimatorController;
import com.android.systemui.fragments.FragmentHostManager;
import com.android.systemui.fragments.FragmentService;
import com.android.systemui.res.R;
+import com.android.systemui.statusbar.core.StatusBarConnectedDisplays;
+import com.android.systemui.statusbar.data.repository.StatusBarConfigurationController;
import com.android.systemui.statusbar.phone.StatusBarContentInsetsProvider;
import com.android.systemui.statusbar.window.StatusBarWindowModule.InternalWindowViewInflater;
import com.android.systemui.unfold.UnfoldTransitionProgressProvider;
@@ -74,13 +76,14 @@ public class StatusBarWindowControllerImpl implements StatusBarWindowController
private final Context mContext;
private final ViewCaptureAwareWindowManager mWindowManager;
+ private final StatusBarConfigurationController mStatusBarConfigurationController;
private final IWindowManager mIWindowManager;
private final StatusBarContentInsetsProvider mContentInsetsProvider;
private int mBarHeight = -1;
private final State mCurrentState = new State();
private boolean mIsAttached;
- private final ViewGroup mStatusBarWindowView;
+ private final StatusBarWindowView mStatusBarWindowView;
private final FragmentService mFragmentService;
// The container in which we should run launch animations started from the status bar and
// expanding into the opening window.
@@ -94,12 +97,14 @@ public class StatusBarWindowControllerImpl implements StatusBarWindowController
@Assisted Context context,
@InternalWindowViewInflater StatusBarWindowViewInflater statusBarWindowViewInflater,
@Assisted ViewCaptureAwareWindowManager viewCaptureAwareWindowManager,
+ @Assisted StatusBarConfigurationController statusBarConfigurationController,
IWindowManager iWindowManager,
StatusBarContentInsetsProvider contentInsetsProvider,
FragmentService fragmentService,
Optional<UnfoldTransitionProgressProvider> unfoldTransitionProgressProvider) {
mContext = context;
mWindowManager = viewCaptureAwareWindowManager;
+ mStatusBarConfigurationController = statusBarConfigurationController;
mIWindowManager = iWindowManager;
mContentInsetsProvider = contentInsetsProvider;
mStatusBarWindowView = statusBarWindowViewInflater.inflate(context);
@@ -141,6 +146,10 @@ public class StatusBarWindowControllerImpl implements StatusBarWindowController
@Override
public void attach() {
+ if (StatusBarConnectedDisplays.isEnabled()) {
+ mStatusBarWindowView.setStatusBarConfigurationController(
+ mStatusBarConfigurationController);
+ }
// Now that the status bar window encompasses the sliding panel and its
// translucent backdrop, the entire thing is made TRANSLUCENT and is
// hardware-accelerated.
@@ -360,7 +369,8 @@ public class StatusBarWindowControllerImpl implements StatusBarWindowController
@Override
StatusBarWindowControllerImpl create(
@NonNull Context context,
- @NonNull ViewCaptureAwareWindowManager viewCaptureAwareWindowManager);
+ @NonNull ViewCaptureAwareWindowManager viewCaptureAwareWindowManager,
+ @NonNull StatusBarConfigurationController statusBarConfigurationController);
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/window/StatusBarWindowControllerStore.kt b/packages/SystemUI/src/com/android/systemui/statusbar/window/StatusBarWindowControllerStore.kt
index 7d0dadcf8c6e..d83a2371ec92 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/window/StatusBarWindowControllerStore.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/window/StatusBarWindowControllerStore.kt
@@ -17,78 +17,42 @@
package com.android.systemui.statusbar.window
import android.content.Context
-import android.view.Display
import android.view.WindowManager
import com.android.app.viewcapture.ViewCaptureAwareWindowManager
-import com.android.systemui.CoreStartable
import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.dagger.qualifiers.Background
import com.android.systemui.display.data.repository.DisplayRepository
import com.android.systemui.display.data.repository.DisplayWindowPropertiesRepository
+import com.android.systemui.display.data.repository.PerDisplayStore
+import com.android.systemui.display.data.repository.PerDisplayStoreImpl
+import com.android.systemui.display.data.repository.SingleDisplayStore
import com.android.systemui.statusbar.core.StatusBarConnectedDisplays
-import java.util.concurrent.ConcurrentHashMap
+import com.android.systemui.statusbar.data.repository.StatusBarConfigurationControllerStore
import javax.inject.Inject
-import kotlinx.coroutines.CoroutineName
import kotlinx.coroutines.CoroutineScope
-import kotlinx.coroutines.launch
/** Store that allows to retrieve per display instances of [StatusBarWindowController]. */
-interface StatusBarWindowControllerStore {
- /**
- * The instance for the default/main display of the device. For example, on a phone or a tablet,
- * the default display is the internal/built-in display of the device.
- *
- * Note that the id of the default display is [Display.DEFAULT_DISPLAY].
- */
- val defaultDisplay: StatusBarWindowController
-
- /**
- * Returns an instance for a specific display id.
- *
- * @throws IllegalArgumentException if [displayId] doesn't match the id of any existing
- * displays.
- */
- fun forDisplay(displayId: Int): StatusBarWindowController
-}
+interface StatusBarWindowControllerStore : PerDisplayStore<StatusBarWindowController>
@SysUISingleton
class MultiDisplayStatusBarWindowControllerStore
@Inject
constructor(
- @Background private val backgroundApplicationScope: CoroutineScope,
+ @Background backgroundApplicationScope: CoroutineScope,
private val controllerFactory: StatusBarWindowController.Factory,
private val displayWindowPropertiesRepository: DisplayWindowPropertiesRepository,
private val viewCaptureAwareWindowManagerFactory: ViewCaptureAwareWindowManager.Factory,
- private val displayRepository: DisplayRepository,
-) : StatusBarWindowControllerStore, CoreStartable {
+ private val statusBarConfigurationControllerStore: StatusBarConfigurationControllerStore,
+ displayRepository: DisplayRepository,
+) :
+ StatusBarWindowControllerStore,
+ PerDisplayStoreImpl<StatusBarWindowController>(backgroundApplicationScope, displayRepository) {
init {
StatusBarConnectedDisplays.assertInNewMode()
}
- private val perDisplayControllers = ConcurrentHashMap<Int, StatusBarWindowController>()
-
- override fun start() {
- backgroundApplicationScope.launch(CoroutineName("StatusBarWindowController#start")) {
- displayRepository.displayRemovalEvent.collect { displayId ->
- perDisplayControllers.remove(displayId)
- }
- }
- }
-
- override val defaultDisplay: StatusBarWindowController
- get() = forDisplay(Display.DEFAULT_DISPLAY)
-
- override fun forDisplay(displayId: Int): StatusBarWindowController {
- if (displayRepository.getDisplay(displayId) == null) {
- throw IllegalArgumentException("Display with id $displayId doesn't exist.")
- }
- return perDisplayControllers.computeIfAbsent(displayId) {
- createControllerForDisplay(displayId)
- }
- }
-
- private fun createControllerForDisplay(displayId: Int): StatusBarWindowController {
+ override fun createInstanceForDisplay(displayId: Int): StatusBarWindowController {
val statusBarDisplayContext =
displayWindowPropertiesRepository.get(
displayId = displayId,
@@ -99,8 +63,11 @@ constructor(
return controllerFactory.create(
statusBarDisplayContext.context,
viewCaptureAwareWindowManager,
+ statusBarConfigurationControllerStore.forDisplay(displayId),
)
}
+
+ override val instanceClass = StatusBarWindowController::class.java
}
@SysUISingleton
@@ -110,16 +77,18 @@ constructor(
context: Context,
viewCaptureAwareWindowManager: ViewCaptureAwareWindowManager,
factory: StatusBarWindowControllerImpl.Factory,
-) : StatusBarWindowControllerStore {
+ statusBarConfigurationControllerStore: StatusBarConfigurationControllerStore,
+) :
+ StatusBarWindowControllerStore,
+ PerDisplayStore<StatusBarWindowController> by SingleDisplayStore(
+ factory.create(
+ context,
+ viewCaptureAwareWindowManager,
+ statusBarConfigurationControllerStore.defaultDisplay,
+ )
+ ) {
init {
StatusBarConnectedDisplays.assertInLegacyMode()
}
-
- private val controller: StatusBarWindowController =
- factory.create(context, viewCaptureAwareWindowManager)
-
- override val defaultDisplay = controller
-
- override fun forDisplay(displayId: Int) = controller
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/window/StatusBarWindowView.java b/packages/SystemUI/src/com/android/systemui/statusbar/window/StatusBarWindowView.java
index d696979f1859..3f6ef16e2e5e 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/window/StatusBarWindowView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/window/StatusBarWindowView.java
@@ -22,6 +22,7 @@ import static android.view.MotionEvent.ACTION_UP;
import static android.view.WindowInsets.Type.systemBars;
import android.content.Context;
+import android.content.res.Configuration;
import android.graphics.Insets;
import android.util.AttributeSet;
import android.view.DisplayCutout;
@@ -30,8 +31,16 @@ import android.view.View;
import android.view.WindowInsets;
import android.widget.FrameLayout;
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+
+import com.android.systemui.compose.ComposeInitializer;
+import com.android.systemui.statusbar.core.StatusBarSimpleFragment;
+import com.android.systemui.statusbar.data.repository.StatusBarConfigurationController;
+
/**
* Status bar view.
+ * We now extend WindowRootView so that we can host Compose views
*/
public class StatusBarWindowView extends FrameLayout {
@@ -44,12 +53,49 @@ public class StatusBarWindowView extends FrameLayout {
private float mTouchDownY = 0;
+ @Nullable private StatusBarConfigurationController mConfigurationController;
+
public StatusBarWindowView(Context context, AttributeSet attrs) {
super(context, attrs);
setClipChildren(false);
}
@Override
+ public void onAttachedToWindow() {
+ super.onAttachedToWindow();
+
+ if (StatusBarSimpleFragment.isEnabled()) {
+ ComposeInitializer.INSTANCE.onAttachedToWindow(this);
+ }
+ }
+
+ @Override
+ public void onDetachedFromWindow() {
+ super.onDetachedFromWindow();
+
+ if (StatusBarSimpleFragment.isEnabled()) {
+ ComposeInitializer.INSTANCE.onDetachedFromWindow(this);
+ }
+ }
+
+ /**
+ * Sets the {@link StatusBarConfigurationController} that is associated with the display that
+ * this view is attached to.
+ */
+ public void setStatusBarConfigurationController(
+ @NonNull StatusBarConfigurationController configurationController) {
+ mConfigurationController = configurationController;
+ }
+
+ @Override
+ protected void onConfigurationChanged(Configuration newConfig) {
+ StatusBarConfigurationController configurationController = mConfigurationController;
+ if (configurationController != null) {
+ configurationController.onConfigurationChanged(newConfig);
+ }
+ }
+
+ @Override
public WindowInsets onApplyWindowInsets(WindowInsets windowInsets) {
final Insets insets = windowInsets.getInsetsIgnoringVisibility(systemBars());
mLeftInset = insets.left;
@@ -89,8 +135,8 @@ public class StatusBarWindowView extends FrameLayout {
final int count = getChildCount();
for (int i = 0; i < count; i++) {
View child = getChildAt(i);
- if (child.getLayoutParams() instanceof LayoutParams) {
- LayoutParams lp = (LayoutParams) child.getLayoutParams();
+ if (child.getLayoutParams() instanceof FrameLayout.LayoutParams) {
+ FrameLayout.LayoutParams lp = (FrameLayout.LayoutParams) child.getLayoutParams();
if (lp.rightMargin != mRightInset || lp.leftMargin != mLeftInset
|| lp.topMargin != mTopInset) {
lp.rightMargin = mRightInset;
diff --git a/packages/SystemUI/src/com/android/systemui/touchpad/tutorial/ui/composable/BackGestureTutorialScreen.kt b/packages/SystemUI/src/com/android/systemui/touchpad/tutorial/ui/composable/BackGestureTutorialScreen.kt
index d85cfcd87d87..e89a31f8fad3 100644
--- a/packages/SystemUI/src/com/android/systemui/touchpad/tutorial/ui/composable/BackGestureTutorialScreen.kt
+++ b/packages/SystemUI/src/com/android/systemui/touchpad/tutorial/ui/composable/BackGestureTutorialScreen.kt
@@ -16,15 +16,18 @@
package com.android.systemui.touchpad.tutorial.ui.composable
+import android.content.res.Resources
import androidx.compose.material3.MaterialTheme
import androidx.compose.runtime.Composable
import androidx.compose.runtime.remember
+import androidx.compose.ui.platform.LocalContext
import com.airbnb.lottie.compose.rememberLottieDynamicProperties
import com.android.compose.theme.LocalAndroidColorScheme
import com.android.systemui.inputdevice.tutorial.ui.composable.TutorialScreenConfig
import com.android.systemui.inputdevice.tutorial.ui.composable.rememberColorFilterProperty
import com.android.systemui.res.R
import com.android.systemui.touchpad.tutorial.ui.gesture.BackGestureRecognizer
+import com.android.systemui.touchpad.tutorial.ui.gesture.GestureRecognizer
@Composable
fun BackGestureTutorialScreen(onDoneButtonClicked: () -> Unit, onBack: () -> Unit) {
@@ -44,15 +47,17 @@ fun BackGestureTutorialScreen(onDoneButtonClicked: () -> Unit, onBack: () -> Uni
successResId = R.raw.trackpad_back_success,
),
)
- val gestureRecognizerProvider =
- DistanceBasedGestureRecognizerProvider(
- recognizerFactory = { distanceThresholdPx, gestureStateCallback ->
- BackGestureRecognizer(distanceThresholdPx).also {
- it.addGestureStateCallback(gestureStateCallback)
- }
- }
+ val recognizer = rememberBackGestureRecognizer(LocalContext.current.resources)
+ GestureTutorialScreen(screenConfig, recognizer, onDoneButtonClicked, onBack)
+}
+
+@Composable
+private fun rememberBackGestureRecognizer(resources: Resources): GestureRecognizer {
+ val distance =
+ resources.getDimensionPixelSize(
+ com.android.internal.R.dimen.system_gestures_distance_threshold
)
- GestureTutorialScreen(screenConfig, gestureRecognizerProvider, onDoneButtonClicked, onBack)
+ return remember(distance) { BackGestureRecognizer(distance) }
}
@Composable
diff --git a/packages/SystemUI/src/com/android/systemui/touchpad/tutorial/ui/composable/GestureTutorialScreen.kt b/packages/SystemUI/src/com/android/systemui/touchpad/tutorial/ui/composable/GestureTutorialScreen.kt
index 90c005139c56..7899f5b42a25 100644
--- a/packages/SystemUI/src/com/android/systemui/touchpad/tutorial/ui/composable/GestureTutorialScreen.kt
+++ b/packages/SystemUI/src/com/android/systemui/touchpad/tutorial/ui/composable/GestureTutorialScreen.kt
@@ -16,7 +16,6 @@
package com.android.systemui.touchpad.tutorial.ui.composable
-import android.content.res.Resources
import androidx.activity.compose.BackHandler
import androidx.compose.animation.core.Animatable
import androidx.compose.animation.core.tween
@@ -32,7 +31,6 @@ import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.graphicsLayer
import androidx.compose.ui.input.pointer.pointerInteropFilter
-import androidx.compose.ui.platform.LocalContext
import com.android.systemui.inputdevice.tutorial.ui.composable.ActionTutorialContent
import com.android.systemui.inputdevice.tutorial.ui.composable.TutorialActionState
import com.android.systemui.inputdevice.tutorial.ui.composable.TutorialScreenConfig
@@ -44,36 +42,6 @@ import com.android.systemui.touchpad.tutorial.ui.gesture.GestureState.InProgress
import com.android.systemui.touchpad.tutorial.ui.gesture.GestureState.NotStarted
import com.android.systemui.touchpad.tutorial.ui.gesture.TouchpadGestureHandler
-interface GestureRecognizerProvider {
-
- @Composable
- fun rememberGestureRecognizer(
- resources: Resources,
- gestureStateChangedCallback: (GestureState) -> Unit,
- ): GestureRecognizer
-}
-
-typealias gestureStateCallback = (GestureState) -> Unit
-
-class DistanceBasedGestureRecognizerProvider(
- val recognizerFactory: (Int, gestureStateCallback) -> GestureRecognizer
-) : GestureRecognizerProvider {
-
- @Composable
- override fun rememberGestureRecognizer(
- resources: Resources,
- gestureStateChangedCallback: (GestureState) -> Unit,
- ): GestureRecognizer {
- val distanceThresholdPx =
- resources.getDimensionPixelSize(
- com.android.internal.R.dimen.system_gestures_distance_threshold
- ) * 5
- return remember(distanceThresholdPx) {
- recognizerFactory(distanceThresholdPx, gestureStateChangedCallback)
- }
- }
-}
-
fun GestureState.toTutorialActionState(): TutorialActionState {
return when (this) {
NotStarted -> TutorialActionState.NotStarted
@@ -86,18 +54,16 @@ fun GestureState.toTutorialActionState(): TutorialActionState {
@Composable
fun GestureTutorialScreen(
screenConfig: TutorialScreenConfig,
- gestureRecognizerProvider: GestureRecognizerProvider,
+ gestureRecognizer: GestureRecognizer,
onDoneButtonClicked: () -> Unit,
onBack: () -> Unit,
) {
BackHandler(onBack = onBack)
var gestureState: GestureState by remember { mutableStateOf(NotStarted) }
var easterEggTriggered by remember { mutableStateOf(false) }
- val gestureRecognizer =
- gestureRecognizerProvider.rememberGestureRecognizer(
- resources = LocalContext.current.resources,
- gestureStateChangedCallback = { gestureState = it },
- )
+ LaunchedEffect(gestureRecognizer) {
+ gestureRecognizer.addGestureStateCallback { gestureState = it }
+ }
val easterEggMonitor = EasterEggGestureMonitor { easterEggTriggered = true }
val gestureHandler =
remember(gestureRecognizer) { TouchpadGestureHandler(gestureRecognizer, easterEggMonitor) }
diff --git a/packages/SystemUI/src/com/android/systemui/touchpad/tutorial/ui/composable/HomeGestureTutorialScreen.kt b/packages/SystemUI/src/com/android/systemui/touchpad/tutorial/ui/composable/HomeGestureTutorialScreen.kt
index 69ec59878b14..3ddf760b9704 100644
--- a/packages/SystemUI/src/com/android/systemui/touchpad/tutorial/ui/composable/HomeGestureTutorialScreen.kt
+++ b/packages/SystemUI/src/com/android/systemui/touchpad/tutorial/ui/composable/HomeGestureTutorialScreen.kt
@@ -16,13 +16,16 @@
package com.android.systemui.touchpad.tutorial.ui.composable
+import android.content.res.Resources
import androidx.compose.runtime.Composable
import androidx.compose.runtime.remember
+import androidx.compose.ui.platform.LocalContext
import com.airbnb.lottie.compose.rememberLottieDynamicProperties
import com.android.compose.theme.LocalAndroidColorScheme
import com.android.systemui.inputdevice.tutorial.ui.composable.TutorialScreenConfig
import com.android.systemui.inputdevice.tutorial.ui.composable.rememberColorFilterProperty
import com.android.systemui.res.R
+import com.android.systemui.touchpad.tutorial.ui.gesture.GestureRecognizer
import com.android.systemui.touchpad.tutorial.ui.gesture.HomeGestureRecognizer
@Composable
@@ -43,15 +46,17 @@ fun HomeGestureTutorialScreen(onDoneButtonClicked: () -> Unit, onBack: () -> Uni
successResId = R.raw.trackpad_home_success,
),
)
- val gestureRecognizerProvider =
- DistanceBasedGestureRecognizerProvider(
- recognizerFactory = { distanceThresholdPx, gestureStateCallback ->
- HomeGestureRecognizer(distanceThresholdPx).also {
- it.addGestureStateCallback(gestureStateCallback)
- }
- }
+ val recognizer = rememberHomeGestureRecognizer(LocalContext.current.resources)
+ GestureTutorialScreen(screenConfig, recognizer, onDoneButtonClicked, onBack)
+}
+
+@Composable
+private fun rememberHomeGestureRecognizer(resources: Resources): GestureRecognizer {
+ val distance =
+ resources.getDimensionPixelSize(
+ com.android.internal.R.dimen.system_gestures_distance_threshold
)
- GestureTutorialScreen(screenConfig, gestureRecognizerProvider, onDoneButtonClicked, onBack)
+ return remember(distance) { HomeGestureRecognizer(distance) }
}
@Composable
diff --git a/packages/SystemUI/src/com/android/systemui/touchpad/tutorial/ui/composable/RecentAppsGestureTutorialScreen.kt b/packages/SystemUI/src/com/android/systemui/touchpad/tutorial/ui/composable/RecentAppsGestureTutorialScreen.kt
index 3097a18b33d6..30a21bf3b632 100644
--- a/packages/SystemUI/src/com/android/systemui/touchpad/tutorial/ui/composable/RecentAppsGestureTutorialScreen.kt
+++ b/packages/SystemUI/src/com/android/systemui/touchpad/tutorial/ui/composable/RecentAppsGestureTutorialScreen.kt
@@ -19,13 +19,13 @@ package com.android.systemui.touchpad.tutorial.ui.composable
import android.content.res.Resources
import androidx.compose.runtime.Composable
import androidx.compose.runtime.remember
+import androidx.compose.ui.platform.LocalContext
import com.airbnb.lottie.compose.rememberLottieDynamicProperties
import com.android.compose.theme.LocalAndroidColorScheme
import com.android.systemui.inputdevice.tutorial.ui.composable.TutorialScreenConfig
import com.android.systemui.inputdevice.tutorial.ui.composable.rememberColorFilterProperty
import com.android.systemui.res.R
import com.android.systemui.touchpad.tutorial.ui.gesture.GestureRecognizer
-import com.android.systemui.touchpad.tutorial.ui.gesture.GestureState
import com.android.systemui.touchpad.tutorial.ui.gesture.RecentAppsGestureRecognizer
@Composable
@@ -46,26 +46,18 @@ fun RecentAppsGestureTutorialScreen(onDoneButtonClicked: () -> Unit, onBack: ()
successResId = R.raw.trackpad_recent_apps_success,
),
)
- val gestureRecognizerProvider =
- object : GestureRecognizerProvider {
- @Composable
- override fun rememberGestureRecognizer(
- resources: Resources,
- gestureStateChangedCallback: (GestureState) -> Unit,
- ): GestureRecognizer {
- val distanceThresholdPx =
- resources.getDimensionPixelSize(
- com.android.internal.R.dimen.system_gestures_distance_threshold
- )
- val velocityThresholdPxPerMs =
- resources.getDimension(R.dimen.touchpad_recent_apps_gesture_velocity_threshold)
- return remember(distanceThresholdPx, velocityThresholdPxPerMs) {
- RecentAppsGestureRecognizer(distanceThresholdPx, velocityThresholdPxPerMs)
- .also { it.addGestureStateCallback(gestureStateChangedCallback) }
- }
- }
- }
- GestureTutorialScreen(screenConfig, gestureRecognizerProvider, onDoneButtonClicked, onBack)
+ val recognizer = rememberRecentAppsGestureRecognizer(LocalContext.current.resources)
+ GestureTutorialScreen(screenConfig, recognizer, onDoneButtonClicked, onBack)
+}
+
+@Composable
+private fun rememberRecentAppsGestureRecognizer(resources: Resources): GestureRecognizer {
+ val distance =
+ resources.getDimensionPixelSize(
+ com.android.internal.R.dimen.system_gestures_distance_threshold
+ )
+ val velocity = resources.getDimension(R.dimen.touchpad_recent_apps_gesture_velocity_threshold)
+ return remember(distance, velocity) { RecentAppsGestureRecognizer(distance, velocity) }
}
@Composable
diff --git a/packages/SystemUI/src/com/android/systemui/touchpad/tutorial/ui/composable/TutorialSelectionScreen.kt b/packages/SystemUI/src/com/android/systemui/touchpad/tutorial/ui/composable/TutorialSelectionScreen.kt
index 3c31efa6265a..c2093114c98f 100644
--- a/packages/SystemUI/src/com/android/systemui/touchpad/tutorial/ui/composable/TutorialSelectionScreen.kt
+++ b/packages/SystemUI/src/com/android/systemui/touchpad/tutorial/ui/composable/TutorialSelectionScreen.kt
@@ -39,11 +39,14 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.vector.ImageVector
+import androidx.compose.ui.input.pointer.pointerInteropFilter
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.res.vectorResource
import androidx.compose.ui.unit.dp
import com.android.systemui.inputdevice.tutorial.ui.composable.DoneButton
import com.android.systemui.res.R
+import com.android.systemui.touchpad.tutorial.ui.gesture.isFourFingerTouchpadSwipe
+import com.android.systemui.touchpad.tutorial.ui.gesture.isThreeFingerTouchpadSwipe
@Composable
fun TutorialSelectionScreen(
@@ -55,7 +58,16 @@ fun TutorialSelectionScreen(
Column(
verticalArrangement = Arrangement.Center,
modifier =
- Modifier.background(color = MaterialTheme.colorScheme.surfaceContainer).fillMaxSize(),
+ Modifier.background(color = MaterialTheme.colorScheme.surfaceContainer)
+ .fillMaxSize()
+ .pointerInteropFilter(
+ onTouchEvent = { event ->
+ // Because of window flag we're intercepting 3 and 4-finger swipes.
+ // Although we don't handle them in this screen, we want to disable them so
+ // that user is not clicking button by mistake by performing these swipes.
+ isThreeFingerTouchpadSwipe(event) || isFourFingerTouchpadSwipe(event)
+ }
+ ),
) {
TutorialSelectionButtons(
onBackTutorialClicked = onBackTutorialClicked,
diff --git a/packages/SystemUI/src/com/android/systemui/unfold/DisplaySwitchLatencyTracker.kt b/packages/SystemUI/src/com/android/systemui/unfold/DisplaySwitchLatencyTracker.kt
index b3e60e35d89e..d4686e28ce5f 100644
--- a/packages/SystemUI/src/com/android/systemui/unfold/DisplaySwitchLatencyTracker.kt
+++ b/packages/SystemUI/src/com/android/systemui/unfold/DisplaySwitchLatencyTracker.kt
@@ -17,6 +17,7 @@
package com.android.systemui.unfold
import android.content.Context
+import android.hardware.devicestate.DeviceStateManager
import android.util.Log
import com.android.app.tracing.TraceUtils.traceAsync
import com.android.app.tracing.instantForTrack
@@ -72,7 +73,8 @@ constructor(
@UnfoldSingleThreadBg private val singleThreadBgExecutor: Executor,
@Application private val applicationScope: CoroutineScope,
private val displaySwitchLatencyLogger: DisplaySwitchLatencyLogger,
- private val systemClock: SystemClock
+ private val systemClock: SystemClock,
+ private val deviceStateManager: DeviceStateManager
) : CoreStartable {
private val backgroundDispatcher = singleThreadBgExecutor.asCoroutineDispatcher()
@@ -81,7 +83,7 @@ constructor(
@OptIn(ExperimentalCoroutinesApi::class)
override fun start() {
- if (!isDeviceFoldable(context)) {
+ if (!isDeviceFoldable(context.resources, deviceStateManager)) {
return
}
applicationScope.launch(backgroundDispatcher) {
diff --git a/packages/SystemUI/src/com/android/systemui/unfold/UnfoldLatencyTracker.kt b/packages/SystemUI/src/com/android/systemui/unfold/UnfoldLatencyTracker.kt
index 33fa9b8e0062..f806a5c52d5a 100644
--- a/packages/SystemUI/src/com/android/systemui/unfold/UnfoldLatencyTracker.kt
+++ b/packages/SystemUI/src/com/android/systemui/unfold/UnfoldLatencyTracker.kt
@@ -27,6 +27,7 @@ import com.android.systemui.keyguard.ScreenLifecycle
import com.android.systemui.unfold.UnfoldTransitionProgressProvider.TransitionProgressListener
import com.android.systemui.unfold.util.ScaleAwareTransitionProgressProvider.Companion.areAnimationsEnabled
import com.android.systemui.util.Compile
+import com.android.systemui.util.Utils.isDeviceFoldable
import java.util.Optional
import java.util.concurrent.Executor
import javax.inject.Inject
@@ -51,18 +52,14 @@ constructor(
@UiBackground private val uiBgExecutor: Executor,
private val context: Context,
private val contentResolver: ContentResolver,
- private val screenLifecycle: ScreenLifecycle
+ private val screenLifecycle: ScreenLifecycle,
) : ScreenLifecycle.Observer, TransitionProgressListener {
private var folded: Boolean? = null
private var isTransitionEnabled: Boolean? = null
private val foldStateListener = FoldStateListener(context)
private var unfoldInProgress = false
- private val isFoldable: Boolean
- get() =
- context.resources
- .getIntArray(com.android.internal.R.array.config_foldedDeviceStates)
- .isNotEmpty()
+ private val isFoldable: Boolean = isDeviceFoldable(context.resources, deviceStateManager)
/** Registers for relevant events only if the device is foldable. */
fun init() {
diff --git a/packages/SystemUI/src/com/android/systemui/unfold/UnfoldTraceLogger.kt b/packages/SystemUI/src/com/android/systemui/unfold/UnfoldTraceLogger.kt
index adf50a1e661b..a6224dcec13f 100644
--- a/packages/SystemUI/src/com/android/systemui/unfold/UnfoldTraceLogger.kt
+++ b/packages/SystemUI/src/com/android/systemui/unfold/UnfoldTraceLogger.kt
@@ -16,6 +16,7 @@
package com.android.systemui.unfold
import android.content.Context
+import android.hardware.devicestate.DeviceStateManager
import android.os.Trace
import com.android.app.tracing.TraceStateLogger
import com.android.systemui.CoreStartable
@@ -24,6 +25,7 @@ import com.android.systemui.dagger.qualifiers.Application
import com.android.systemui.dagger.qualifiers.Background
import com.android.systemui.unfold.data.repository.FoldStateRepository
import com.android.systemui.unfold.system.DeviceStateRepository
+import com.android.systemui.util.Utils.isDeviceFoldable
import javax.inject.Inject
import kotlin.coroutines.CoroutineContext
import kotlinx.coroutines.CoroutineScope
@@ -42,13 +44,10 @@ constructor(
private val foldStateRepository: FoldStateRepository,
@Application applicationScope: CoroutineScope,
@Background private val coroutineContext: CoroutineContext,
- private val deviceStateRepository: DeviceStateRepository
+ private val deviceStateRepository: DeviceStateRepository,
+ private val deviceStateManager: DeviceStateManager
) : CoreStartable {
- private val isFoldable: Boolean
- get() =
- context.resources
- .getIntArray(com.android.internal.R.array.config_foldedDeviceStates)
- .isNotEmpty()
+ private val isFoldable: Boolean = isDeviceFoldable(context.resources, deviceStateManager)
private val bgScope = applicationScope.plus(coroutineContext)
diff --git a/packages/SystemUI/src/com/android/systemui/util/Utils.java b/packages/SystemUI/src/com/android/systemui/util/Utils.java
index 3953188bb828..800d2894f192 100644
--- a/packages/SystemUI/src/com/android/systemui/util/Utils.java
+++ b/packages/SystemUI/src/com/android/systemui/util/Utils.java
@@ -14,11 +14,17 @@
package com.android.systemui.util;
+import static android.hardware.devicestate.DeviceState.PROPERTY_FOLDABLE_DISPLAY_CONFIGURATION_INNER_PRIMARY;
+import static android.hardware.devicestate.DeviceState.PROPERTY_FOLDABLE_DISPLAY_CONFIGURATION_OUTER_PRIMARY;
+
import android.Manifest;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.res.Resources;
+import android.hardware.devicestate.DeviceState;
+import android.hardware.devicestate.DeviceStateManager;
+import android.hardware.devicestate.feature.flags.Flags;
import android.provider.Settings;
import android.view.DisplayCutout;
@@ -84,9 +90,23 @@ public class Utils {
/**
* Returns {@code true} if the device is a foldable device
*/
- public static boolean isDeviceFoldable(Context context) {
- return context.getResources()
- .getIntArray(com.android.internal.R.array.config_foldedDeviceStates).length != 0;
+ public static boolean isDeviceFoldable(Resources resources,
+ DeviceStateManager deviceStateManager) {
+ if (Flags.deviceStatePropertyMigration()) {
+ List<DeviceState> deviceStates = deviceStateManager.getSupportedDeviceStates();
+ for (int i = 0; i < deviceStates.size(); i++) {
+ DeviceState state = deviceStates.get(i);
+ if (state.hasProperty(PROPERTY_FOLDABLE_DISPLAY_CONFIGURATION_OUTER_PRIMARY)
+ || state.hasProperty(
+ PROPERTY_FOLDABLE_DISPLAY_CONFIGURATION_INNER_PRIMARY)) {
+ return true;
+ }
+ }
+ return false;
+ } else {
+ return resources.getIntArray(
+ com.android.internal.R.array.config_foldedDeviceStates).length != 0;
+ }
}
/**
diff --git a/packages/SystemUI/src/com/android/systemui/volume/dagger/AudioModule.kt b/packages/SystemUI/src/com/android/systemui/volume/dagger/AudioModule.kt
index 20d598a9334b..617aaa71d2d3 100644
--- a/packages/SystemUI/src/com/android/systemui/volume/dagger/AudioModule.kt
+++ b/packages/SystemUI/src/com/android/systemui/volume/dagger/AudioModule.kt
@@ -27,6 +27,8 @@ import com.android.settingslib.volume.data.repository.AudioRepositoryImpl
import com.android.settingslib.volume.data.repository.AudioSharingRepository
import com.android.settingslib.volume.data.repository.AudioSharingRepositoryEmptyImpl
import com.android.settingslib.volume.data.repository.AudioSharingRepositoryImpl
+import com.android.settingslib.volume.data.repository.AudioSystemRepository
+import com.android.settingslib.volume.data.repository.AudioSystemRepositoryImpl
import com.android.settingslib.volume.domain.interactor.AudioModeInteractor
import com.android.settingslib.volume.domain.interactor.AudioVolumeInteractor
import com.android.settingslib.volume.shared.AudioManagerEventsReceiver
@@ -106,5 +108,11 @@ interface AudioModule {
notificationsSoundPolicyInteractor: NotificationsSoundPolicyInteractor,
): AudioVolumeInteractor =
AudioVolumeInteractor(audioRepository, notificationsSoundPolicyInteractor)
+
+ @Provides
+ @SysUISingleton
+ fun provideAudioSystemRepository(
+ @Application context: Context,
+ ): AudioSystemRepository = AudioSystemRepositoryImpl(context)
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/volume/panel/component/volume/domain/interactor/AudioSlidersInteractor.kt b/packages/SystemUI/src/com/android/systemui/volume/panel/component/volume/domain/interactor/AudioSlidersInteractor.kt
index 4be680ef66f1..1e4afc0ac5fe 100644
--- a/packages/SystemUI/src/com/android/systemui/volume/panel/component/volume/domain/interactor/AudioSlidersInteractor.kt
+++ b/packages/SystemUI/src/com/android/systemui/volume/panel/component/volume/domain/interactor/AudioSlidersInteractor.kt
@@ -17,8 +17,10 @@
package com.android.systemui.volume.panel.component.volume.domain.interactor
import android.media.AudioManager
+import com.android.settingslib.volume.data.repository.AudioSystemRepository
import com.android.settingslib.volume.domain.interactor.AudioModeInteractor
import com.android.settingslib.volume.shared.model.AudioStream
+import com.android.systemui.Flags
import com.android.systemui.volume.panel.component.mediaoutput.domain.interactor.MediaOutputInteractor
import com.android.systemui.volume.panel.component.mediaoutput.shared.model.MediaDeviceSession
import com.android.systemui.volume.panel.component.mediaoutput.shared.model.isTheSameSession
@@ -41,6 +43,7 @@ constructor(
@VolumePanelScope scope: CoroutineScope,
mediaOutputInteractor: MediaOutputInteractor,
audioModeInteractor: AudioModeInteractor,
+ private val audioSystemRepository: AudioSystemRepository,
) {
val volumePanelSliders: StateFlow<List<SliderType>> =
@@ -83,6 +86,16 @@ constructor(
}
private fun MutableList<SliderType>.addStream(stream: Int) {
+ // Hide other streams except STREAM_MUSIC if the isSingleVolume mode is on. This makes sure
+ // the volume slider in volume panel is consistent with the volume slider inside system
+ // settings app.
+ if (Flags.onlyShowMediaStreamSliderInSingleVolumeMode() &&
+ audioSystemRepository.isSingleVolume &&
+ stream != AudioManager.STREAM_MUSIC
+ ) {
+ return
+ }
+
add(SliderType.Stream(AudioStream(stream)))
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/volume/ui/navigation/VolumeNavigator.kt b/packages/SystemUI/src/com/android/systemui/volume/ui/navigation/VolumeNavigator.kt
index 3da725b9a51f..e590a7de09ad 100644
--- a/packages/SystemUI/src/com/android/systemui/volume/ui/navigation/VolumeNavigator.kt
+++ b/packages/SystemUI/src/com/android/systemui/volume/ui/navigation/VolumeNavigator.kt
@@ -22,6 +22,7 @@ import android.provider.Settings
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.remember
import androidx.compose.runtime.rememberCoroutineScope
+import androidx.compose.ui.unit.dp
import com.android.internal.logging.UiEventLogger
import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.dagger.qualifiers.Application
@@ -89,7 +90,7 @@ constructor(
VolumePanelRoute.SETTINGS_VOLUME_PANEL ->
activityStarter.startActivity(
/* intent= */ Intent(Settings.Panel.ACTION_VOLUME),
- /* dismissShade= */ true
+ /* dismissShade= */ true,
)
VolumePanelRoute.SYSTEM_UI_VOLUME_PANEL ->
volumePanelFactory.create(aboveStatusBar = true, view = null)
@@ -122,6 +123,9 @@ constructor(
remember(coroutineScope) { viewModelFactory.create(coroutineScope) }
)
},
+ isDraggable = false,
+ // TODO(b/337205027) change maxWidth
+ maxWidth = 800.dp,
)
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/wallpapers/data/repository/WallpaperRepository.kt b/packages/SystemUI/src/com/android/systemui/wallpapers/data/repository/WallpaperRepository.kt
index 203e1da2afcf..efdd98d5498a 100644
--- a/packages/SystemUI/src/com/android/systemui/wallpapers/data/repository/WallpaperRepository.kt
+++ b/packages/SystemUI/src/com/android/systemui/wallpapers/data/repository/WallpaperRepository.kt
@@ -31,6 +31,7 @@ import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.dagger.qualifiers.Background
import com.android.systemui.keyguard.data.repository.KeyguardClockRepository
import com.android.systemui.keyguard.data.repository.KeyguardRepository
+import com.android.systemui.shared.Flags.ambientAod
import com.android.systemui.user.data.model.SelectedUserModel
import com.android.systemui.user.data.model.SelectionStatus
import com.android.systemui.user.data.repository.UserRepository
@@ -144,14 +145,21 @@ constructor(
override val wallpaperSupportsAmbientMode: StateFlow<Boolean> =
wallpaperInfo
.map {
- // If WallpaperInfo is null, it's ImageWallpaper which never supports ambient mode.
- it?.supportsAmbientMode() == true
+ if (ambientAod()) {
+ // Force this mode for now, until ImageWallpaper supports it directly
+ // TODO(b/371236225)
+ true
+ } else {
+ // If WallpaperInfo is null, it's ImageWallpaper which never supports ambient
+ // mode.
+ it?.supportsAmbientMode() == true
+ }
}
.stateIn(
scope,
// Always be listening for wallpaper changes.
SharingStarted.Eagerly,
- initialValue = wallpaperInfo.value?.supportsAmbientMode() == true,
+ initialValue = if (ambientAod()) true else false,
)
override var rootView: View? = null
diff --git a/packages/SystemUI/src/com/android/systemui/wallpapers/domain/interactor/WallpaperInteractor.kt b/packages/SystemUI/src/com/android/systemui/wallpapers/domain/interactor/WallpaperInteractor.kt
index 79ebf0128d02..fe6977c367b5 100644
--- a/packages/SystemUI/src/com/android/systemui/wallpapers/domain/interactor/WallpaperInteractor.kt
+++ b/packages/SystemUI/src/com/android/systemui/wallpapers/domain/interactor/WallpaperInteractor.kt
@@ -18,9 +18,13 @@ package com.android.systemui.wallpapers.domain.interactor
import com.android.systemui.wallpapers.data.repository.WallpaperRepository
import javax.inject.Inject
+import kotlinx.coroutines.flow.StateFlow
class WallpaperInteractor @Inject constructor(val wallpaperRepository: WallpaperRepository) {
fun setNotificationStackAbsoluteBottom(bottom: Float) {
wallpaperRepository.setNotificationStackAbsoluteBottom(bottom)
}
+
+ val wallpaperSupportsAmbientMode: StateFlow<Boolean> =
+ wallpaperRepository.wallpaperSupportsAmbientMode
}
diff --git a/packages/SystemUI/src/com/android/systemui/wallpapers/ui/viewmodel/WallpaperViewModel.kt b/packages/SystemUI/src/com/android/systemui/wallpapers/ui/viewmodel/WallpaperViewModel.kt
new file mode 100644
index 000000000000..a51acf66432a
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/wallpapers/ui/viewmodel/WallpaperViewModel.kt
@@ -0,0 +1,25 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.systemui.wallpapers.ui.viewmodel
+
+import com.android.systemui.wallpapers.domain.interactor.WallpaperInteractor
+import javax.inject.Inject
+import kotlinx.coroutines.flow.StateFlow
+
+class WallpaperViewModel @Inject constructor(interactor: WallpaperInteractor) {
+ val wallpaperSupportsAmbientMode: StateFlow<Boolean> = interactor.wallpaperSupportsAmbientMode
+}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/CameraProtectionLoaderImplTest.kt b/packages/SystemUI/tests/src/com/android/systemui/CameraProtectionLoaderImplTest.kt
index d2a17c2ccbb4..ad58a0175a39 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/CameraProtectionLoaderImplTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/CameraProtectionLoaderImplTest.kt
@@ -37,14 +37,14 @@ class CameraProtectionLoaderImplTest : SysuiTestCase() {
overrideResource(R.string.config_protectedPhysicalCameraId, OUTER_CAMERA_PHYSICAL_ID)
overrideResource(
R.string.config_frontBuiltInDisplayCutoutProtection,
- OUTER_CAMERA_PROTECTION_PATH
+ OUTER_CAMERA_PROTECTION_PATH,
)
overrideResource(R.string.config_protectedScreenUniqueId, OUTER_SCREEN_UNIQUE_ID)
overrideResource(R.string.config_protectedInnerCameraId, INNER_CAMERA_LOGICAL_ID)
overrideResource(R.string.config_protectedInnerPhysicalCameraId, INNER_CAMERA_PHYSICAL_ID)
overrideResource(
R.string.config_innerBuiltInDisplayCutoutProtection,
- INNER_CAMERA_PROTECTION_PATH
+ INNER_CAMERA_PROTECTION_PATH,
)
overrideResource(R.string.config_protectedInnerScreenUniqueId, INNER_SCREEN_UNIQUE_ID)
}
@@ -107,7 +107,7 @@ class CameraProtectionLoaderImplTest : SysuiTestCase() {
private const val OUTER_CAMERA_PHYSICAL_ID = "11"
private const val OUTER_CAMERA_PROTECTION_PATH = "M 0,0 H 10,10 V 10,10 H 0,10 Z"
private val OUTER_CAMERA_PROTECTION_BOUNDS =
- Rect(/* left = */ 0, /* top = */ 0, /* right = */ 10, /* bottom = */ 10)
+ Rect(/* left= */ 0, /* top= */ 0, /* right= */ 10, /* bottom= */ 10)
private const val OUTER_SCREEN_UNIQUE_ID = "111"
private val OUTER_CAMERA_PROTECTION_INFO =
TestableProtectionInfo(
@@ -121,7 +121,7 @@ class CameraProtectionLoaderImplTest : SysuiTestCase() {
private const val INNER_CAMERA_PHYSICAL_ID = "22"
private const val INNER_CAMERA_PROTECTION_PATH = "M 0,0 H 20,20 V 20,20 H 0,20 Z"
private val INNER_CAMERA_PROTECTION_BOUNDS =
- Rect(/* left = */ 0, /* top = */ 0, /* right = */ 20, /* bottom = */ 20)
+ Rect(/* left= */ 0, /* top= */ 0, /* right= */ 20, /* bottom= */ 20)
private const val INNER_SCREEN_UNIQUE_ID = "222"
private val INNER_CAMERA_PROTECTION_INFO =
TestableProtectionInfo(
diff --git a/packages/SystemUI/tests/src/com/android/systemui/FaceScanningProviderFactoryTest.kt b/packages/SystemUI/tests/src/com/android/systemui/FaceScanningProviderFactoryTest.kt
index bc12aaaa52d2..a01fecaaaefe 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/FaceScanningProviderFactoryTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/FaceScanningProviderFactoryTest.kt
@@ -27,6 +27,7 @@ import com.android.keyguard.KeyguardUpdateMonitor
import com.android.systemui.biometrics.AuthController
import com.android.systemui.biometrics.data.repository.FakeFacePropertyRepository
import com.android.systemui.decor.FaceScanningProviderFactory
+import com.android.systemui.decor.FaceScanningProviderFactoryImpl
import com.android.systemui.log.ScreenDecorationsLogger
import com.android.systemui.log.logcatLogBuffer
import com.android.systemui.plugins.statusbar.StatusBarStateController
@@ -69,20 +70,20 @@ class FaceScanningProviderFactoryTest : SysuiTestCase() {
dmGlobal,
displayId,
displayInfo,
- DisplayAdjustments.DEFAULT_DISPLAY_ADJUSTMENTS
+ DisplayAdjustments.DEFAULT_DISPLAY_ADJUSTMENTS,
)
whenever(dmGlobal.getDisplayInfo(eq(displayId))).thenReturn(displayInfo)
val displayContext = context.createDisplayContext(display) as SysuiTestableContext
displayContext.orCreateTestableResources.addOverride(
R.array.config_displayUniqueIdArray,
- arrayOf(displayId)
+ arrayOf(displayId),
)
displayContext.orCreateTestableResources.addOverride(
R.bool.config_fillMainBuiltInDisplayCutout,
- true
+ true,
)
underTest =
- FaceScanningProviderFactory(
+ FaceScanningProviderFactoryImpl(
authController,
displayContext,
statusBarStateController,
diff --git a/packages/SystemUI/tests/src/com/android/systemui/SysUICutoutProviderTest.kt b/packages/SystemUI/tests/src/com/android/systemui/SysUICutoutProviderTest.kt
index 61c7e1d63e51..ef33210dd6b7 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/SysUICutoutProviderTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/SysUICutoutProviderTest.kt
@@ -42,7 +42,7 @@ class SysUICutoutProviderTest : SysuiTestCase() {
fun cutoutInfoForCurrentDisplay_noCutout_returnsNull() {
val noCutoutDisplay = createDisplay(cutout = null)
val noCutoutDisplayContext = context.createDisplayContext(noCutoutDisplay)
- val provider = SysUICutoutProvider(noCutoutDisplayContext, fakeProtectionLoader)
+ val provider = SysUICutoutProviderImpl(noCutoutDisplayContext, fakeProtectionLoader)
val sysUICutout = provider.cutoutInfoForCurrentDisplayAndRotation()
@@ -53,7 +53,7 @@ class SysUICutoutProviderTest : SysuiTestCase() {
fun cutoutInfoForCurrentDisplay_returnsCutout() {
val cutoutDisplay = createDisplay()
val cutoutDisplayContext = context.createDisplayContext(cutoutDisplay)
- val provider = SysUICutoutProvider(cutoutDisplayContext, fakeProtectionLoader)
+ val provider = SysUICutoutProviderImpl(cutoutDisplayContext, fakeProtectionLoader)
val sysUICutout = provider.cutoutInfoForCurrentDisplayAndRotation()!!
@@ -64,7 +64,7 @@ class SysUICutoutProviderTest : SysuiTestCase() {
fun cutoutInfoForCurrentDisplay_noAssociatedProtection_returnsNoProtection() {
val cutoutDisplay = createDisplay()
val cutoutDisplayContext = context.createDisplayContext(cutoutDisplay)
- val provider = SysUICutoutProvider(cutoutDisplayContext, fakeProtectionLoader)
+ val provider = SysUICutoutProviderImpl(cutoutDisplayContext, fakeProtectionLoader)
val sysUICutout = provider.cutoutInfoForCurrentDisplayAndRotation()!!
@@ -75,7 +75,7 @@ class SysUICutoutProviderTest : SysuiTestCase() {
fun cutoutInfoForCurrentDisplay_outerDisplay_protectionAssociated_returnsProtection() {
fakeProtectionLoader.addOuterCameraProtection(displayUniqueId = OUTER_DISPLAY_UNIQUE_ID)
val outerDisplayContext = context.createDisplayContext(OUTER_DISPLAY)
- val provider = SysUICutoutProvider(outerDisplayContext, fakeProtectionLoader)
+ val provider = SysUICutoutProviderImpl(outerDisplayContext, fakeProtectionLoader)
val sysUICutout = provider.cutoutInfoForCurrentDisplayAndRotation()!!
@@ -86,7 +86,7 @@ class SysUICutoutProviderTest : SysuiTestCase() {
fun cutoutInfoForCurrentDisplay_outerDisplay_protectionNotAvailable_returnsNullProtection() {
fakeProtectionLoader.clearProtectionInfoList()
val outerDisplayContext = context.createDisplayContext(OUTER_DISPLAY)
- val provider = SysUICutoutProvider(outerDisplayContext, fakeProtectionLoader)
+ val provider = SysUICutoutProviderImpl(outerDisplayContext, fakeProtectionLoader)
val sysUICutout = provider.cutoutInfoForCurrentDisplayAndRotation()!!
@@ -97,7 +97,7 @@ class SysUICutoutProviderTest : SysuiTestCase() {
fun cutoutInfoForCurrentDisplay_displayWithNullId_protectionsWithNoId_returnsNullProtection() {
fakeProtectionLoader.addOuterCameraProtection(displayUniqueId = "")
val displayContext = context.createDisplayContext(createDisplay(uniqueId = null))
- val provider = SysUICutoutProvider(displayContext, fakeProtectionLoader)
+ val provider = SysUICutoutProviderImpl(displayContext, fakeProtectionLoader)
val sysUICutout = provider.cutoutInfoForCurrentDisplayAndRotation()!!
@@ -108,7 +108,7 @@ class SysUICutoutProviderTest : SysuiTestCase() {
fun cutoutInfoForCurrentDisplay_displayWithEmptyId_protectionsWithNoId_returnsNullProtection() {
fakeProtectionLoader.addOuterCameraProtection(displayUniqueId = "")
val displayContext = context.createDisplayContext(createDisplay(uniqueId = ""))
- val provider = SysUICutoutProvider(displayContext, fakeProtectionLoader)
+ val provider = SysUICutoutProviderImpl(displayContext, fakeProtectionLoader)
val sysUICutout = provider.cutoutInfoForCurrentDisplayAndRotation()!!
@@ -123,15 +123,13 @@ class SysUICutoutProviderTest : SysuiTestCase() {
displayHeight = 1000,
rotation = Surface.ROTATION_0,
protectionBounds =
- Rect(/* left = */ 440, /* top = */ 10, /* right = */ 490, /* bottom = */ 110)
+ Rect(/* left= */ 440, /* top= */ 10, /* right= */ 490, /* bottom= */ 110),
)
val sysUICutout = provider.cutoutInfoForCurrentDisplayAndRotation()!!
assertThat(sysUICutout.cameraProtection!!.bounds)
- .isEqualTo(
- Rect(/* left = */ 440, /* top = */ 10, /* right = */ 490, /* bottom = */ 110)
- )
+ .isEqualTo(Rect(/* left= */ 440, /* top= */ 10, /* right= */ 490, /* bottom= */ 110))
}
@Test
@@ -142,13 +140,13 @@ class SysUICutoutProviderTest : SysuiTestCase() {
displayHeight = 1000,
rotation = Surface.ROTATION_90,
protectionBounds =
- Rect(/* left = */ 440, /* top = */ 10, /* right = */ 490, /* bottom = */ 110)
+ Rect(/* left= */ 440, /* top= */ 10, /* right= */ 490, /* bottom= */ 110),
)
val sysUICutout = provider.cutoutInfoForCurrentDisplayAndRotation()!!
assertThat(sysUICutout.cameraProtection!!.bounds)
- .isEqualTo(Rect(/* left = */ 10, /* top = */ 10, /* right = */ 110, /* bottom = */ 60))
+ .isEqualTo(Rect(/* left= */ 10, /* top= */ 10, /* right= */ 110, /* bottom= */ 60))
}
@Test
@@ -156,7 +154,7 @@ class SysUICutoutProviderTest : SysuiTestCase() {
val displayNaturalWidth = 500
val displayNaturalHeight = 1000
val originalProtectionBounds =
- Rect(/* left = */ 440, /* top = */ 10, /* right = */ 490, /* bottom = */ 110)
+ Rect(/* left= */ 440, /* top= */ 10, /* right= */ 490, /* bottom= */ 110)
// Safe copy as we don't know at which layer the mutation could happen
val originalProtectionBoundsCopy = Rect(originalProtectionBounds)
val display =
@@ -168,10 +166,10 @@ class SysUICutoutProviderTest : SysuiTestCase() {
)
fakeProtectionLoader.addOuterCameraProtection(
displayUniqueId = OUTER_DISPLAY_UNIQUE_ID,
- bounds = originalProtectionBounds
+ bounds = originalProtectionBounds,
)
val provider =
- SysUICutoutProvider(context.createDisplayContext(display), fakeProtectionLoader)
+ SysUICutoutProviderImpl(context.createDisplayContext(display), fakeProtectionLoader)
// Here we get the rotated bounds once
provider.cutoutInfoForCurrentDisplayAndRotation()
@@ -194,13 +192,13 @@ class SysUICutoutProviderTest : SysuiTestCase() {
displayHeight = 1000,
rotation = Surface.ROTATION_180,
protectionBounds =
- Rect(/* left = */ 440, /* top = */ 10, /* right = */ 490, /* bottom = */ 110)
+ Rect(/* left= */ 440, /* top= */ 10, /* right= */ 490, /* bottom= */ 110),
)
val sysUICutout = provider.cutoutInfoForCurrentDisplayAndRotation()!!
assertThat(sysUICutout.cameraProtection!!.bounds)
- .isEqualTo(Rect(/* left = */ 10, /* top = */ 890, /* right = */ 60, /* bottom = */ 990))
+ .isEqualTo(Rect(/* left= */ 10, /* top= */ 890, /* right= */ 60, /* bottom= */ 990))
}
@Test
@@ -211,15 +209,13 @@ class SysUICutoutProviderTest : SysuiTestCase() {
displayHeight = 1000,
rotation = Surface.ROTATION_270,
protectionBounds =
- Rect(/* left = */ 440, /* top = */ 10, /* right = */ 490, /* bottom = */ 110)
+ Rect(/* left= */ 440, /* top= */ 10, /* right= */ 490, /* bottom= */ 110),
)
val sysUICutout = provider.cutoutInfoForCurrentDisplayAndRotation()!!
assertThat(sysUICutout.cameraProtection!!.bounds)
- .isEqualTo(
- Rect(/* left = */ 890, /* top = */ 440, /* right = */ 990, /* bottom = */ 490)
- )
+ .isEqualTo(Rect(/* left= */ 890, /* top= */ 440, /* right= */ 990, /* bottom= */ 490))
}
private fun setUpProviderWithCameraProtection(
@@ -245,9 +241,9 @@ class SysUICutoutProviderTest : SysuiTestCase() {
)
fakeProtectionLoader.addOuterCameraProtection(
displayUniqueId = OUTER_DISPLAY_UNIQUE_ID,
- bounds = protectionBounds
+ bounds = protectionBounds,
)
- return SysUICutoutProvider(context.createDisplayContext(display), fakeProtectionLoader)
+ return SysUICutoutProviderImpl(context.createDisplayContext(display), fakeProtectionLoader)
}
companion object {
@@ -259,7 +255,7 @@ class SysUICutoutProviderTest : SysuiTestCase() {
height: Int = 1000,
@Rotation rotation: Int = Surface.ROTATION_0,
uniqueId: String? = "uniqueId",
- cutout: DisplayCutout? = mock<DisplayCutout>()
+ cutout: DisplayCutout? = mock<DisplayCutout>(),
) =
mock<Display> {
whenever(this.getDisplayInfo(any())).thenAnswer {
diff --git a/packages/SystemUI/tests/src/com/android/systemui/bouncer/ui/composable/BouncerContentTest.kt b/packages/SystemUI/tests/src/com/android/systemui/bouncer/ui/composable/BouncerContentTest.kt
index fd550b05fdc9..6e36d42bd99f 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/bouncer/ui/composable/BouncerContentTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/bouncer/ui/composable/BouncerContentTest.kt
@@ -88,7 +88,7 @@ class BouncerContentTest : SysuiTestCase() {
},
layout = BouncerSceneLayout.BESIDE_USER_SWITCHER,
modifier = Modifier.fillMaxSize().testTag("BouncerContent"),
- dialogFactory = bouncerDialogFactory
+ dialogFactory = bouncerDialogFactory,
)
}
}
@@ -110,11 +110,19 @@ class BouncerContentTest : SysuiTestCase() {
}
}
) {
- feature(hasTestTag("UserSwitcher"), positionInRoot, "userSwitcher_pos")
- feature(hasTestTag("UserSwitcher"), alpha, "userSwitcher_alpha")
+ feature(
+ hasTestTag("com.android.systemui:id/UserSwitcher"),
+ positionInRoot,
+ "userSwitcher_pos",
+ )
+ feature(
+ hasTestTag("com.android.systemui:id/UserSwitcher"),
+ alpha,
+ "userSwitcher_alpha",
+ )
feature(hasTestTag("FoldAware"), positionInRoot, "foldAware_pos")
feature(hasTestTag("FoldAware"), alpha, "foldAware_alpha")
- }
+ },
)
assertThat(motion).timeSeriesMatchesGolden()
diff --git a/packages/SystemUI/tests/src/com/android/systemui/keyguard/ui/viewmodel/KeyguardQuickAffordancesCombinedViewModelTest.kt b/packages/SystemUI/tests/src/com/android/systemui/keyguard/ui/viewmodel/KeyguardQuickAffordancesCombinedViewModelTest.kt
index 5b216620ec2b..cb2c8fc2c418 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/keyguard/ui/viewmodel/KeyguardQuickAffordancesCombinedViewModelTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/keyguard/ui/viewmodel/KeyguardQuickAffordancesCombinedViewModelTest.kt
@@ -114,9 +114,6 @@ class KeyguardQuickAffordancesCombinedViewModelTest : SysuiTestCase() {
private lateinit var dozingToLockscreenTransitionViewModel:
DozingToLockscreenTransitionViewModel
@Mock
- private lateinit var dreamingHostedToLockscreenTransitionViewModel:
- DreamingHostedToLockscreenTransitionViewModel
- @Mock
private lateinit var dreamingToLockscreenTransitionViewModel:
DreamingToLockscreenTransitionViewModel
@Mock
@@ -135,9 +132,6 @@ class KeyguardQuickAffordancesCombinedViewModelTest : SysuiTestCase() {
private lateinit var lockscreenToDozingTransitionViewModel:
LockscreenToDozingTransitionViewModel
@Mock
- private lateinit var lockscreenToDreamingHostedTransitionViewModel:
- LockscreenToDreamingHostedTransitionViewModel
- @Mock
private lateinit var lockscreenToDreamingTransitionViewModel:
LockscreenToDreamingTransitionViewModel
@Mock
@@ -182,8 +176,8 @@ class KeyguardQuickAffordancesCombinedViewModelTest : SysuiTestCase() {
BuiltInKeyguardQuickAffordanceKeys.HOME_CONTROLS,
KeyguardQuickAffordanceSlots.SLOT_ID_BOTTOM_END +
":" +
- BuiltInKeyguardQuickAffordanceKeys.QUICK_ACCESS_WALLET
- )
+ BuiltInKeyguardQuickAffordanceKeys.QUICK_ACCESS_WALLET,
+ ),
)
homeControlsQuickAffordanceConfig =
@@ -263,8 +257,6 @@ class KeyguardQuickAffordancesCombinedViewModelTest : SysuiTestCase() {
whenever(aodToLockscreenTransitionViewModel.shortcutsAlpha)
.thenReturn(intendedAlphaMutableStateFlow)
whenever(dozingToLockscreenTransitionViewModel.shortcutsAlpha).thenReturn(emptyFlow())
- whenever(dreamingHostedToLockscreenTransitionViewModel.shortcutsAlpha)
- .thenReturn(emptyFlow())
whenever(dreamingToLockscreenTransitionViewModel.shortcutsAlpha).thenReturn(emptyFlow())
whenever(goneToLockscreenTransitionViewModel.shortcutsAlpha).thenReturn(emptyFlow())
whenever(occludedToLockscreenTransitionViewModel.shortcutsAlpha).thenReturn(emptyFlow())
@@ -274,8 +266,6 @@ class KeyguardQuickAffordancesCombinedViewModelTest : SysuiTestCase() {
whenever(lockscreenToAodTransitionViewModel.shortcutsAlpha)
.thenReturn(intendedAlphaMutableStateFlow)
whenever(lockscreenToDozingTransitionViewModel.shortcutsAlpha).thenReturn(emptyFlow())
- whenever(lockscreenToDreamingHostedTransitionViewModel.shortcutsAlpha)
- .thenReturn(emptyFlow())
whenever(lockscreenToDreamingTransitionViewModel.shortcutsAlpha).thenReturn(emptyFlow())
whenever(lockscreenToGoneTransitionViewModel.shortcutsAlpha).thenReturn(emptyFlow())
whenever(lockscreenToOccludedTransitionViewModel.shortcutsAlpha).thenReturn(emptyFlow())
@@ -314,8 +304,6 @@ class KeyguardQuickAffordancesCombinedViewModelTest : SysuiTestCase() {
shadeInteractor = shadeInteractor,
aodToLockscreenTransitionViewModel = aodToLockscreenTransitionViewModel,
dozingToLockscreenTransitionViewModel = dozingToLockscreenTransitionViewModel,
- dreamingHostedToLockscreenTransitionViewModel =
- dreamingHostedToLockscreenTransitionViewModel,
dreamingToLockscreenTransitionViewModel = dreamingToLockscreenTransitionViewModel,
goneToLockscreenTransitionViewModel = goneToLockscreenTransitionViewModel,
occludedToLockscreenTransitionViewModel = occludedToLockscreenTransitionViewModel,
@@ -326,8 +314,6 @@ class KeyguardQuickAffordancesCombinedViewModelTest : SysuiTestCase() {
glanceableHubToLockscreenTransitionViewModel,
lockscreenToAodTransitionViewModel = lockscreenToAodTransitionViewModel,
lockscreenToDozingTransitionViewModel = lockscreenToDozingTransitionViewModel,
- lockscreenToDreamingHostedTransitionViewModel =
- lockscreenToDreamingHostedTransitionViewModel,
lockscreenToDreamingTransitionViewModel = lockscreenToDreamingTransitionViewModel,
lockscreenToGoneTransitionViewModel = lockscreenToGoneTransitionViewModel,
lockscreenToOccludedTransitionViewModel = lockscreenToOccludedTransitionViewModel,
@@ -683,8 +669,8 @@ class KeyguardQuickAffordancesCombinedViewModelTest : SysuiTestCase() {
min(
1f,
KeyguardQuickAffordancesCombinedViewModel
- .AFFORDANCE_FULLY_OPAQUE_ALPHA_THRESHOLD + 0.1f
- ),
+ .AFFORDANCE_FULLY_OPAQUE_ALPHA_THRESHOLD + 0.1f,
+ )
)
val testConfig =
@@ -779,7 +765,7 @@ class KeyguardQuickAffordancesCombinedViewModelTest : SysuiTestCase() {
testScope.runTest {
kosmos.setTransition(
sceneTransition = Idle(Scenes.Lockscreen),
- stateTransition = TransitionStep(from = AOD, to = LOCKSCREEN)
+ stateTransition = TransitionStep(from = AOD, to = LOCKSCREEN),
)
intendedShadeAlphaMutableStateFlow.value = 0.25f
val underTest = collectLastValue(underTest.transitionAlpha)
@@ -794,7 +780,7 @@ class KeyguardQuickAffordancesCombinedViewModelTest : SysuiTestCase() {
testScope.runTest {
kosmos.setTransition(
sceneTransition = Idle(Scenes.Gone),
- stateTransition = TransitionStep(from = AOD, to = GONE)
+ stateTransition = TransitionStep(from = AOD, to = GONE),
)
intendedShadeAlphaMutableStateFlow.value = 0.5f
val underTest = collectLastValue(underTest.transitionAlpha)
@@ -829,7 +815,7 @@ class KeyguardQuickAffordancesCombinedViewModelTest : SysuiTestCase() {
when (testConfig.isActivated) {
true -> ActivationState.Active
false -> ActivationState.Inactive
- }
+ },
)
} else {
KeyguardQuickAffordanceConfig.LockScreenState.Hidden
@@ -878,7 +864,7 @@ class KeyguardQuickAffordancesCombinedViewModelTest : SysuiTestCase() {
val intent: Intent? = null,
val isSelected: Boolean = false,
val isDimmed: Boolean = false,
- val slotId: String = ""
+ val slotId: String = "",
) {
init {
check(!isVisible || icon != null) { "Must supply non-null icon if visible!" }
diff --git a/packages/SystemUI/tests/src/com/android/systemui/media/dialog/MediaOutputAdapterTest.java b/packages/SystemUI/tests/src/com/android/systemui/media/dialog/MediaOutputAdapterTest.java
index 8731853e4939..63ec78fd9ee5 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/media/dialog/MediaOutputAdapterTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/media/dialog/MediaOutputAdapterTest.java
@@ -35,6 +35,8 @@ import static org.mockito.Mockito.when;
import android.app.WallpaperColors;
import android.graphics.Bitmap;
import android.graphics.drawable.Icon;
+import android.platform.test.annotations.DisableFlags;
+import android.platform.test.annotations.EnableFlags;
import android.testing.TestableLooper;
import android.view.View;
import android.widget.LinearLayout;
@@ -44,6 +46,7 @@ import androidx.core.graphics.drawable.IconCompat;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.SmallTest;
+import com.android.media.flags.Flags;
import com.android.settingslib.media.LocalMediaManager;
import com.android.settingslib.media.MediaDevice;
import com.android.systemui.SysuiTestCase;
@@ -738,4 +741,68 @@ public class MediaOutputAdapterTest extends SysuiTestCase {
assertThat(mMediaOutputAdapter.getItemCount()).isEqualTo(updatedList.size());
}
+
+ @DisableFlags(Flags.FLAG_ENABLE_AUDIO_INPUT_DEVICE_ROUTING_AND_VOLUME_CONTROL)
+ @Test
+ public void getDrawableId_FlagDisabled_InputDeviceMutedIcon() {
+ assertThat(
+ mViewHolder.getDrawableId(true /* isInputDevice */, true /* isMutedVolumeIcon */))
+ .isEqualTo(R.drawable.media_output_icon_volume_off);
+ }
+
+ @DisableFlags(Flags.FLAG_ENABLE_AUDIO_INPUT_DEVICE_ROUTING_AND_VOLUME_CONTROL)
+ @Test
+ public void getDrawableId_FlagDisabled_OutputDeviceMutedIcon() {
+ assertThat(
+ mViewHolder.getDrawableId(false /* isInputDevice */, true /* isMutedVolumeIcon */))
+ .isEqualTo(R.drawable.media_output_icon_volume_off);
+ }
+
+ @DisableFlags(Flags.FLAG_ENABLE_AUDIO_INPUT_DEVICE_ROUTING_AND_VOLUME_CONTROL)
+ @Test
+ public void getDrawableId_FlagDisabled_InputDeviceUnmutedIcon() {
+ assertThat(
+ mViewHolder.getDrawableId(true /* isInputDevice */, false /* isMutedVolumeIcon */))
+ .isEqualTo(R.drawable.media_output_icon_volume);
+ }
+
+ @DisableFlags(Flags.FLAG_ENABLE_AUDIO_INPUT_DEVICE_ROUTING_AND_VOLUME_CONTROL)
+ @Test
+ public void getDrawableId_FlagDisabled_OutputDeviceUnmutedIcon() {
+ assertThat(
+ mViewHolder.getDrawableId(false /* isInputDevice */, false /* isMutedVolumeIcon */))
+ .isEqualTo(R.drawable.media_output_icon_volume);
+ }
+
+ @EnableFlags(Flags.FLAG_ENABLE_AUDIO_INPUT_DEVICE_ROUTING_AND_VOLUME_CONTROL)
+ @Test
+ public void getDrawableId_FlagEnabled_InputDeviceMutedIcon() {
+ assertThat(
+ mViewHolder.getDrawableId(true /* isInputDevice */, true /* isMutedVolumeIcon */))
+ .isEqualTo(R.drawable.ic_mic_off);
+ }
+
+ @EnableFlags(Flags.FLAG_ENABLE_AUDIO_INPUT_DEVICE_ROUTING_AND_VOLUME_CONTROL)
+ @Test
+ public void getDrawableId_FlagEnabled_OutputDeviceMutedIcon() {
+ assertThat(
+ mViewHolder.getDrawableId(false /* isInputDevice */, true /* isMutedVolumeIcon */))
+ .isEqualTo(R.drawable.media_output_icon_volume_off);
+ }
+
+ @EnableFlags(Flags.FLAG_ENABLE_AUDIO_INPUT_DEVICE_ROUTING_AND_VOLUME_CONTROL)
+ @Test
+ public void getDrawableId_FlagEnabled_InputDeviceUnmutedIcon() {
+ assertThat(
+ mViewHolder.getDrawableId(true /* isInputDevice */, false /* isMutedVolumeIcon */))
+ .isEqualTo(R.drawable.ic_mic_26dp);
+ }
+
+ @EnableFlags(Flags.FLAG_ENABLE_AUDIO_INPUT_DEVICE_ROUTING_AND_VOLUME_CONTROL)
+ @Test
+ public void getDrawableId_FlagEnabled_OutputDeviceUnmutedIcon() {
+ assertThat(
+ mViewHolder.getDrawableId(false /* isInputDevice */, false /* isMutedVolumeIcon */))
+ .isEqualTo(R.drawable.media_output_icon_volume);
+ }
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/navigationbar/NavigationBarControllerImplTest.java b/packages/SystemUI/tests/src/com/android/systemui/navigationbar/NavigationBarControllerImplTest.java
index 413aa55f4554..bc3c0d96fa22 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/navigationbar/NavigationBarControllerImplTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/navigationbar/NavigationBarControllerImplTest.java
@@ -40,6 +40,7 @@ import static org.mockito.Mockito.never;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.verify;
+import android.hardware.devicestate.DeviceStateManager;
import android.util.SparseArray;
import androidx.test.ext.junit.runners.AndroidJUnit4;
@@ -94,6 +95,8 @@ public class NavigationBarControllerImplTest extends SysuiTestCase {
private NavigationBarComponent.Factory mNavigationBarFactory;
@Mock
TaskbarDelegate mTaskbarDelegate;
+ @Mock
+ private DeviceStateManager mDeviceStateManager;
@Before
public void setUp() {
@@ -116,7 +119,8 @@ public class NavigationBarControllerImplTest extends SysuiTestCase {
Optional.of(mock(Pip.class)),
Optional.of(mock(BackAnimation.class)),
mock(SecureSettings.class),
- mDisplayTracker));
+ mDisplayTracker,
+ mDeviceStateManager));
initializeNavigationBars();
mMockitoSession = mockitoSession().mockStatic(Utilities.class).startMocking();
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/reardisplay/RearDisplayDialogControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/reardisplay/RearDisplayDialogControllerTest.java
index 3aaaf95810a4..83ede465c885 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/reardisplay/RearDisplayDialogControllerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/reardisplay/RearDisplayDialogControllerTest.java
@@ -16,6 +16,11 @@
package com.android.systemui.reardisplay;
+import static android.hardware.devicestate.DeviceState.PROPERTY_FOLDABLE_DISPLAY_CONFIGURATION_INNER_PRIMARY;
+import static android.hardware.devicestate.DeviceState.PROPERTY_FOLDABLE_DISPLAY_CONFIGURATION_OUTER_PRIMARY;
+import static android.hardware.devicestate.DeviceState.PROPERTY_FOLDABLE_HARDWARE_CONFIGURATION_FOLD_IN_CLOSED;
+import static android.hardware.devicestate.DeviceState.PROPERTY_FOLDABLE_HARDWARE_CONFIGURATION_FOLD_IN_OPEN;
+
import static junit.framework.Assert.assertEquals;
import static junit.framework.Assert.assertNotSame;
@@ -53,6 +58,9 @@ import org.mockito.ArgumentCaptor;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
+import java.util.List;
+import java.util.Set;
+
@SmallTest
@RunWith(AndroidJUnit4.class)
@TestableLooper.RunWithLooper(setAsMainLooper = true)
@@ -69,13 +77,25 @@ public class RearDisplayDialogControllerTest extends SysuiTestCase {
private SysUiState mSysUiState;
@Mock
private Resources mResources;
+ @Mock
+ private DeviceStateManager mDeviceStateManager;
LayoutInflater mLayoutInflater = LayoutInflater.from(mContext);
private final FakeExecutor mFakeExecutor = new FakeExecutor(new FakeSystemClock());
- private static final int CLOSED_BASE_STATE = 0;
- private static final int OPEN_BASE_STATE = 1;
+ private static final DeviceState CLOSED_BASE_STATE = new DeviceState(
+ new DeviceState.Configuration.Builder(0, "CLOSED").setSystemProperties(
+ Set.of(PROPERTY_FOLDABLE_DISPLAY_CONFIGURATION_OUTER_PRIMARY))
+ .setPhysicalProperties(Set.of(
+ PROPERTY_FOLDABLE_HARDWARE_CONFIGURATION_FOLD_IN_CLOSED))
+ .build());
+ private static final DeviceState OPEN_BASE_STATE = new DeviceState(
+ new DeviceState.Configuration.Builder(1, "OPEN").setSystemProperties(
+ Set.of(PROPERTY_FOLDABLE_DISPLAY_CONFIGURATION_INNER_PRIMARY))
+ .setPhysicalProperties(Set.of(
+ PROPERTY_FOLDABLE_HARDWARE_CONFIGURATION_FOLD_IN_OPEN))
+ .build());
@Before
public void setup() {
@@ -92,12 +112,13 @@ public class RearDisplayDialogControllerTest extends SysuiTestCase {
mFakeExecutor,
mResources,
mLayoutInflater,
- mSystemUIDialogFactory);
+ mSystemUIDialogFactory,
+ mDeviceStateManager);
controller.setDeviceStateManagerCallback(new TestDeviceStateManagerCallback());
- controller.setFoldedStates(new int[]{0});
+ controller.setFoldedStates(List.of(0));
controller.setAnimationRepeatCount(0);
- controller.showRearDisplayDialog(CLOSED_BASE_STATE);
+ controller.showRearDisplayDialog(CLOSED_BASE_STATE.getIdentifier());
verify(mSystemUIDialog).show();
View container = getDialogViewContainer();
@@ -115,12 +136,13 @@ public class RearDisplayDialogControllerTest extends SysuiTestCase {
mFakeExecutor,
mResources,
mLayoutInflater,
- mSystemUIDialogFactory);
+ mSystemUIDialogFactory,
+ mDeviceStateManager);
controller.setDeviceStateManagerCallback(new TestDeviceStateManagerCallback());
- controller.setFoldedStates(new int[]{0});
+ controller.setFoldedStates(List.of(0));
controller.setAnimationRepeatCount(0);
- controller.showRearDisplayDialog(CLOSED_BASE_STATE);
+ controller.showRearDisplayDialog(CLOSED_BASE_STATE.getIdentifier());
verify(mSystemUIDialog).show();
View container = getDialogViewContainer();
TextView deviceClosedTitleTextView = container.findViewById(
@@ -144,12 +166,13 @@ public class RearDisplayDialogControllerTest extends SysuiTestCase {
mFakeExecutor,
mResources,
mLayoutInflater,
- mSystemUIDialogFactory);
+ mSystemUIDialogFactory,
+ mDeviceStateManager);
controller.setDeviceStateManagerCallback(new TestDeviceStateManagerCallback());
- controller.setFoldedStates(new int[]{0});
+ controller.setFoldedStates(List.of(0));
controller.setAnimationRepeatCount(0);
- controller.showRearDisplayDialog(OPEN_BASE_STATE);
+ controller.showRearDisplayDialog(OPEN_BASE_STATE.getIdentifier());
verify(mSystemUIDialog).show();
View container = getDialogViewContainer();
diff --git a/packages/SystemUI/tests/src/com/android/systemui/recents/OverviewProxyServiceTest.kt b/packages/SystemUI/tests/src/com/android/systemui/recents/OverviewProxyServiceTest.kt
index 4959224ead2d..3bfde68def50 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/recents/OverviewProxyServiceTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/recents/OverviewProxyServiceTest.kt
@@ -35,7 +35,6 @@ import com.android.systemui.SysuiTestCase
import com.android.systemui.broadcast.BroadcastDispatcher
import com.android.systemui.dagger.qualifiers.Main
import com.android.systemui.dump.DumpManager
-import com.android.systemui.education.domain.interactor.KeyboardTouchpadEduStatsInteractor
import com.android.systemui.keyguard.KeyguardUnlockAnimationController
import com.android.systemui.keyguard.WakefulnessLifecycle
import com.android.systemui.keyguard.ui.view.InWindowLauncherUnlockAnimationManager
@@ -122,9 +121,6 @@ class OverviewProxyServiceTest : SysuiTestCase() {
Optional<UnfoldTransitionProgressForwarder>
@Mock private lateinit var broadcastDispatcher: BroadcastDispatcher
- @Mock
- private lateinit var keyboardTouchpadEduStatsInteractor: KeyboardTouchpadEduStatsInteractor
-
@Before
fun setUp() {
MockitoAnnotations.initMocks(this)
@@ -293,7 +289,6 @@ class OverviewProxyServiceTest : SysuiTestCase() {
dumpManager,
unfoldTransitionProgressForwarder,
broadcastDispatcher,
- keyboardTouchpadEduStatsInteractor,
)
}
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/screenshot/DefaultScreenshotActionsProviderTest.kt b/packages/SystemUI/tests/src/com/android/systemui/screenshot/DefaultScreenshotActionsProviderTest.kt
index 52266eee24e8..ba6518f9bd2b 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/screenshot/DefaultScreenshotActionsProviderTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/screenshot/DefaultScreenshotActionsProviderTest.kt
@@ -16,31 +16,32 @@
package com.android.systemui.screenshot
+import android.app.assist.AssistContent
import android.content.Intent
import android.net.Uri
import android.os.Process
import android.os.UserHandle
-import android.testing.AndroidTestingRunner
-import androidx.test.filters.SmallTest
+import android.platform.test.annotations.EnableFlags
+import androidx.test.ext.junit.runners.AndroidJUnit4
import com.android.internal.logging.UiEventLogger
+import com.android.systemui.Flags
import com.android.systemui.SysuiTestCase
import com.android.systemui.screenshot.ui.viewmodel.PreviewAction
import com.google.common.truth.Truth.assertThat
import java.util.UUID
import kotlin.test.Test
-import kotlinx.coroutines.test.runTest
import org.junit.runner.RunWith
import org.mockito.Mockito.verifyNoMoreInteractions
import org.mockito.kotlin.any
import org.mockito.kotlin.argumentCaptor
+import org.mockito.kotlin.doReturn
import org.mockito.kotlin.eq
import org.mockito.kotlin.mock
import org.mockito.kotlin.never
import org.mockito.kotlin.times
import org.mockito.kotlin.verify
-@RunWith(AndroidTestingRunner::class)
-@SmallTest
+@RunWith(AndroidJUnit4::class)
class DefaultScreenshotActionsProviderTest : SysuiTestCase() {
private val actionExecutor = mock<ActionExecutor>()
private val uiEventLogger = mock<UiEventLogger>()
@@ -76,7 +77,7 @@ class DefaultScreenshotActionsProviderTest : SysuiTestCase() {
}
@Test
- fun actionAccessed_withResult_launchesIntent() = runTest {
+ fun actionAccessed_withResult_launchesIntent() {
actionsProvider = createActionsProvider()
actionsProvider.setCompletedScreenshot(validResult)
@@ -94,7 +95,32 @@ class DefaultScreenshotActionsProviderTest : SysuiTestCase() {
}
@Test
- fun actionAccessed_whilePending_launchesMostRecentAction() = runTest {
+ @EnableFlags(Flags.FLAG_SCREENSHOT_CONTEXT_URL)
+ fun shareAction_includesAssistContentUri() {
+ actionsProvider = createActionsProvider()
+
+ actionsProvider.setCompletedScreenshot(validResult)
+
+ val uri = Uri.parse("http://www.android.com")
+ val assistContent = mock<AssistContent>() { on { webUri } doReturn uri }
+
+ actionsProvider.onAssistContent(assistContent)
+
+ val actionButtonCaptor = argumentCaptor<() -> Unit>()
+ verify(actionsCallback, times(2))
+ .provideActionButton(any(), any(), actionButtonCaptor.capture())
+ actionButtonCaptor.firstValue.invoke()
+
+ val intentCaptor = argumentCaptor<Intent>()
+ verify(actionExecutor)
+ .startSharedTransition(intentCaptor.capture(), eq(Process.myUserHandle()), eq(false))
+ val innerIntent =
+ intentCaptor.lastValue.extras?.getParcelable(Intent.EXTRA_INTENT, Intent::class.java)
+ assertThat(innerIntent?.getStringExtra(Intent.EXTRA_TEXT)).isEqualTo(uri.toString())
+ }
+
+ @Test
+ fun actionAccessed_whilePending_launchesMostRecentAction() {
actionsProvider = createActionsProvider()
val previewActionCaptor = argumentCaptor<PreviewAction>()
@@ -116,7 +142,7 @@ class DefaultScreenshotActionsProviderTest : SysuiTestCase() {
}
@Test
- fun scrollChipClicked_callsOnClick() = runTest {
+ fun scrollChipClicked_callsOnClick() {
actionsProvider = createActionsProvider()
val onScrollClick = mock<Runnable>()
@@ -131,7 +157,7 @@ class DefaultScreenshotActionsProviderTest : SysuiTestCase() {
}
@Test
- fun scrollChipClicked_afterInvalidate_doesNothing() = runTest {
+ fun scrollChipClicked_afterInvalidate_doesNothing() {
actionsProvider = createActionsProvider()
val onScrollClick = mock<Runnable>()
@@ -147,7 +173,7 @@ class DefaultScreenshotActionsProviderTest : SysuiTestCase() {
}
@Test
- fun scrollChipClicked_afterUpdate_runsNewAction() = runTest {
+ fun scrollChipClicked_afterUpdate_runsNewAction() {
actionsProvider = createActionsProvider()
val onScrollClick = mock<Runnable>()
diff --git a/packages/SystemUI/tests/src/com/android/systemui/screenshot/policy/PolicyRequestProcessorTest.kt b/packages/SystemUI/tests/src/com/android/systemui/screenshot/policy/PolicyRequestProcessorTest.kt
index 0d4cb4c6751c..7709a65712a1 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/screenshot/policy/PolicyRequestProcessorTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/screenshot/policy/PolicyRequestProcessorTest.kt
@@ -20,30 +20,141 @@ import android.graphics.Bitmap
import android.graphics.Insets
import android.graphics.Rect
import android.os.UserHandle
+import android.platform.test.annotations.DisableFlags
+import android.platform.test.annotations.EnableFlags
+import android.platform.test.flag.junit.SetFlagsRule
import android.view.Display.DEFAULT_DISPLAY
import android.view.WindowManager.ScreenshotSource.SCREENSHOT_KEY_CHORD
import android.view.WindowManager.TAKE_SCREENSHOT_FULLSCREEN
import androidx.test.ext.junit.runners.AndroidJUnit4
+import com.android.systemui.Flags
+import com.android.systemui.kosmos.Kosmos
import com.android.systemui.screenshot.ImageCapture
import com.android.systemui.screenshot.ScreenshotData
import com.android.systemui.screenshot.data.model.DisplayContentScenarios.ActivityNames.FILES
+import com.android.systemui.screenshot.data.model.DisplayContentScenarios.Bounds.FULL_SCREEN
import com.android.systemui.screenshot.data.model.DisplayContentScenarios.TaskSpec
+import com.android.systemui.screenshot.data.model.DisplayContentScenarios.emptyDisplayContent
import com.android.systemui.screenshot.data.model.DisplayContentScenarios.launcherOnly
import com.android.systemui.screenshot.data.model.DisplayContentScenarios.singleFullScreen
import com.android.systemui.screenshot.data.repository.DisplayContentRepository
+import com.android.systemui.screenshot.data.repository.profileTypeRepository
+import com.android.systemui.screenshot.policy.CaptureType.FullScreen
+import com.android.systemui.screenshot.policy.CaptureType.IsolatedTask
import com.android.systemui.screenshot.policy.TestUserIds.PERSONAL
import com.android.systemui.screenshot.policy.TestUserIds.WORK
import com.google.common.truth.Truth.assertThat
import com.google.common.truth.Truth.assertWithMessage
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.runBlocking
+import kotlinx.coroutines.test.runTest
+import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith
@RunWith(AndroidJUnit4::class)
class PolicyRequestProcessorTest {
+ private val kosmos = Kosmos()
+
+ private val screenshotRequest =
+ ScreenshotData(
+ TAKE_SCREENSHOT_FULLSCREEN,
+ SCREENSHOT_KEY_CHORD,
+ UserHandle.CURRENT,
+ topComponent = null,
+ originalScreenBounds = FULL_SCREEN,
+ taskId = -1,
+ originalInsets = Insets.NONE,
+ bitmap = null,
+ displayId = DEFAULT_DISPLAY,
+ )
+
+ val defaultComponent = ComponentName("default", "Component")
+ val defaultOwner = UserHandle.of(PERSONAL)
+
+ @get:Rule val setFlagsRule: SetFlagsRule = SetFlagsRule()
+
+ /** Tests applying CaptureParameters with 'IsolatedTask' CaptureType */
+ @Test
+ @EnableFlags(Flags.FLAG_SCREENSHOT_POLICY_SPLIT_AND_DESKTOP_MODE)
+ fun testProcess_newPolicy_isolatedTask() = runTest {
+ val taskImage = Bitmap.createBitmap(1, 1, Bitmap.Config.ARGB_8888)
+
+ /* Create a policy request processor with no capture policies */
+ val requestProcessor =
+ PolicyRequestProcessor(
+ Dispatchers.Unconfined,
+ createImageCapture(task = taskImage),
+ policy = ScreenshotPolicy(kosmos.profileTypeRepository),
+ policies = emptyList(),
+ defaultOwner = defaultOwner,
+ defaultComponent = defaultComponent,
+ displayTasks = { emptyDisplayContent },
+ )
+
+ val result =
+ requestProcessor.modify(
+ screenshotRequest,
+ CaptureParameters(
+ IsolatedTask(taskId = TASK_ID, taskBounds = null),
+ ComponentName.unflattenFromString(FILES),
+ UserHandle.of(WORK),
+ ),
+ )
+
+ assertWithMessage("The screenshot bitmap").that(result.bitmap).isSameInstanceAs(taskImage)
+
+ assertWithMessage("The assigned owner of the screenshot")
+ .that(result.userHandle)
+ .isEqualTo(UserHandle.of(WORK))
+
+ assertWithMessage("The topComponent of the screenshot")
+ .that(result.topComponent)
+ .isEqualTo(ComponentName.unflattenFromString(FILES))
+
+ assertWithMessage("Task ID").that(result.taskId).isEqualTo(TASK_ID)
+ }
+
+ /** Tests applying CaptureParameters with 'FullScreen' CaptureType */
+ @Test
+ @EnableFlags(Flags.FLAG_SCREENSHOT_POLICY_SPLIT_AND_DESKTOP_MODE)
+ fun testProcess_newPolicy_fullScreen() = runTest {
+ val screenImage = Bitmap.createBitmap(1, 1, Bitmap.Config.ARGB_8888)
+
+ /* Create a policy request processor with no capture policies */
+ val requestProcessor =
+ PolicyRequestProcessor(
+ Dispatchers.Unconfined,
+ createImageCapture(display = screenImage),
+ policy = ScreenshotPolicy(kosmos.profileTypeRepository),
+ policies = emptyList(),
+ defaultOwner = defaultOwner,
+ defaultComponent = defaultComponent,
+ displayTasks = { emptyDisplayContent },
+ )
+
+ val result =
+ requestProcessor.modify(
+ screenshotRequest,
+ CaptureParameters(FullScreen(displayId = 0), defaultComponent, defaultOwner),
+ )
+
+ assertWithMessage("The result bitmap").that(result.bitmap).isSameInstanceAs(screenImage)
+
+ assertWithMessage("The assigned owner of the screenshot")
+ .that(result.userHandle)
+ .isEqualTo(defaultOwner)
+
+ assertWithMessage("The topComponent of the screenshot")
+ .that(result.topComponent)
+ .isEqualTo(defaultComponent)
+
+ assertWithMessage("Task ID").that(result.taskId).isEqualTo(-1)
+ }
+
/** Tests behavior when no policies are applied */
@Test
+ @DisableFlags(Flags.FLAG_SCREENSHOT_POLICY_SPLIT_AND_DESKTOP_MODE)
fun testProcess_defaultOwner_whenNoPolicyApplied() {
val fullScreenWork = DisplayContentRepository {
singleFullScreen(TaskSpec(taskId = TASK_ID, name = FILES, userId = WORK))
@@ -67,6 +178,7 @@ class PolicyRequestProcessorTest {
PolicyRequestProcessor(
Dispatchers.Unconfined,
createImageCapture(),
+ policy = ScreenshotPolicy(kosmos.profileTypeRepository),
policies = emptyList(),
defaultOwner = UserHandle.of(PERSONAL),
defaultComponent = ComponentName("default", "Component"),
@@ -95,6 +207,7 @@ class PolicyRequestProcessorTest {
PolicyRequestProcessor(
Dispatchers.Unconfined,
createImageCapture(display = null),
+ policy = ScreenshotPolicy(kosmos.profileTypeRepository),
policies = emptyList(),
defaultComponent = ComponentName("default", "Component"),
displayTasks = DisplayContentRepository { launcherOnly() },
@@ -118,7 +231,7 @@ class PolicyRequestProcessorTest {
reason = "",
parameters =
CaptureParameters(
- CaptureType.IsolatedTask(taskId = 0, taskBounds = null),
+ IsolatedTask(taskId = 0, taskBounds = null),
null,
UserHandle.CURRENT,
),
@@ -130,6 +243,7 @@ class PolicyRequestProcessorTest {
PolicyRequestProcessor(
Dispatchers.Unconfined,
createImageCapture(task = null),
+ policy = ScreenshotPolicy(kosmos.profileTypeRepository),
policies = listOf(captureTaskPolicy),
defaultComponent = ComponentName("default", "Component"),
displayTasks = fullScreenWork,
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/KeyguardIndicationControllerWithCoroutinesTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/KeyguardIndicationControllerWithCoroutinesTest.kt
index a68ba06637cc..e2f22cde96de 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/KeyguardIndicationControllerWithCoroutinesTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/KeyguardIndicationControllerWithCoroutinesTest.kt
@@ -17,20 +17,16 @@
package com.android.systemui.statusbar
import android.testing.TestableLooper
-import android.view.View
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
-import com.android.systemui.flags.Flags.LOCKSCREEN_WALLPAPER_DREAM_ENABLED
import com.android.systemui.keyguard.KeyguardIndicationRotateTextViewController.INDICATION_TYPE_BIOMETRIC_MESSAGE
import com.android.systemui.keyguard.KeyguardIndicationRotateTextViewController.INDICATION_TYPE_BIOMETRIC_MESSAGE_FOLLOW_UP
import com.android.systemui.keyguard.KeyguardIndicationRotateTextViewController.INDICATION_TYPE_TRUST
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.flow.MutableStateFlow
-import kotlinx.coroutines.runBlocking
import org.junit.Test
import org.junit.runner.RunWith
import org.mockito.Mockito.times
-import org.mockito.Mockito.verify
import org.mockito.kotlin.whenever
@RunWith(AndroidJUnit4::class)
@@ -38,36 +34,6 @@ import org.mockito.kotlin.whenever
@TestableLooper.RunWithLooper(setAsMainLooper = true)
class KeyguardIndicationControllerWithCoroutinesTest : KeyguardIndicationControllerBaseTest() {
@Test
- fun testIndicationAreaVisibility_onLockscreenHostedDreamStateChanged() =
- runBlocking(IMMEDIATE) {
- // GIVEN starting state for keyguard indication and wallpaper dream enabled
- createController()
- mFlags.set(LOCKSCREEN_WALLPAPER_DREAM_ENABLED, true)
- mController.setVisible(true)
-
- // THEN indication area is visible
- verify(mIndicationArea, times(2)).visibility = View.VISIBLE
-
- // WHEN the device is dreaming with lockscreen hosted dream
- mController.mIsActiveDreamLockscreenHostedCallback.accept(
- true /* isActiveDreamLockscreenHosted */
- )
- mExecutor.runAllReady()
-
- // THEN the indication area is hidden
- verify(mIndicationArea).visibility = View.GONE
-
- // WHEN the device stops dreaming with lockscreen hosted dream
- mController.mIsActiveDreamLockscreenHostedCallback.accept(
- false /* isActiveDreamLockscreenHosted */
- )
- mExecutor.runAllReady()
-
- // THEN indication area is set visible
- verify(mIndicationArea, times(3)).visibility = View.VISIBLE
- }
-
- @Test
fun onTrustAgentErrorMessageDelayed_fingerprintEngaged() {
createController()
mController.setVisible(true)
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/core/MultiDisplayStatusBarInitializerStoreTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/core/MultiDisplayStatusBarInitializerStoreTest.kt
deleted file mode 100644
index 0d1d37af7e5b..000000000000
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/core/MultiDisplayStatusBarInitializerStoreTest.kt
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * Copyright (C) 2024 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.systemui.statusbar.core
-
-import android.platform.test.annotations.EnableFlags
-import android.view.Display
-import androidx.test.ext.junit.runners.AndroidJUnit4
-import androidx.test.filters.SmallTest
-import com.android.systemui.SysuiTestCase
-import com.android.systemui.display.data.repository.displayRepository
-import com.android.systemui.kosmos.testDispatcher
-import com.android.systemui.kosmos.testScope
-import com.android.systemui.kosmos.unconfinedTestDispatcher
-import com.android.systemui.testKosmos
-import com.google.common.truth.Truth.assertThat
-import kotlinx.coroutines.runBlocking
-import kotlinx.coroutines.test.runTest
-import org.junit.Before
-import org.junit.Test
-import org.junit.runner.RunWith
-
-@RunWith(AndroidJUnit4::class)
-@SmallTest
-@EnableFlags(StatusBarConnectedDisplays.FLAG_NAME)
-class MultiDisplayStatusBarInitializerStoreTest : SysuiTestCase() {
-
- private val kosmos =
- testKosmos().also {
- // Using unconfinedTestDispatcher to avoid having to call `runCurrent` in the tests.
- it.testDispatcher = it.unconfinedTestDispatcher
- }
- private val testScope = kosmos.testScope
- private val fakeDisplayRepository = kosmos.displayRepository
- private val store = kosmos.multiDisplayStatusBarInitializerStore
-
- @Before
- fun start() {
- store.start()
- }
-
- @Before
- fun addDisplays() = runBlocking {
- fakeDisplayRepository.addDisplay(DEFAULT_DISPLAY_ID)
- fakeDisplayRepository.addDisplay(NON_DEFAULT_DISPLAY_ID)
- }
-
- @Test
- fun forDisplay_defaultDisplay_multipleCalls_returnsSameInstance() =
- testScope.runTest {
- val controller = store.defaultDisplay
-
- assertThat(store.defaultDisplay).isSameInstanceAs(controller)
- }
-
- @Test
- fun forDisplay_nonDefaultDisplay_multipleCalls_returnsSameInstance() =
- testScope.runTest {
- val controller = store.forDisplay(NON_DEFAULT_DISPLAY_ID)
-
- assertThat(store.forDisplay(NON_DEFAULT_DISPLAY_ID)).isSameInstanceAs(controller)
- }
-
- @Test
- fun forDisplay_nonDefaultDisplay_afterDisplayRemoved_returnsNewInstance() =
- testScope.runTest {
- val controller = store.forDisplay(NON_DEFAULT_DISPLAY_ID)
-
- fakeDisplayRepository.removeDisplay(NON_DEFAULT_DISPLAY_ID)
- fakeDisplayRepository.addDisplay(NON_DEFAULT_DISPLAY_ID)
-
- assertThat(store.forDisplay(NON_DEFAULT_DISPLAY_ID)).isNotSameInstanceAs(controller)
- }
-
- @Test(expected = IllegalArgumentException::class)
- fun forDisplay_nonExistingDisplayId_throws() =
- testScope.runTest { store.forDisplay(NON_EXISTING_DISPLAY_ID) }
-
- companion object {
- private const val DEFAULT_DISPLAY_ID = Display.DEFAULT_DISPLAY
- private const val NON_DEFAULT_DISPLAY_ID = Display.DEFAULT_DISPLAY + 1
- private const val NON_EXISTING_DISPLAY_ID = Display.DEFAULT_DISPLAY + 2
- }
-}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/events/SystemStatusAnimationSchedulerImplTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/events/SystemStatusAnimationSchedulerImplTest.kt
index 5d8a8fd03bc0..4e7de8101342 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/events/SystemStatusAnimationSchedulerImplTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/events/SystemStatusAnimationSchedulerImplTest.kt
@@ -88,30 +88,26 @@ class SystemStatusAnimationSchedulerImplTest : SysuiTestCase() {
.thenReturn(statusBarWindowController)
systemClock = FakeSystemClock()
chipAnimationController =
- SystemEventChipAnimationController(
+ SystemEventChipAnimationControllerImpl(
mContext,
- statusBarWindowControllerStore,
+ statusBarWindowController,
statusBarContentInsetProvider,
)
// StatusBarContentInsetProvider is mocked. Ensure that it returns some mocked values.
whenever(statusBarContentInsetProvider.getStatusBarContentInsetsForCurrentRotation())
- .thenReturn(
- Insets.of(/* left = */ 10, /* top = */ 10, /* right = */ 10, /* bottom = */ 0)
- )
+ .thenReturn(Insets.of(/* left= */ 10, /* top= */ 10, /* right= */ 10, /* bottom= */ 0))
whenever(statusBarContentInsetProvider.getStatusBarContentAreaForCurrentRotation())
- .thenReturn(
- Rect(/* left = */ 10, /* top = */ 10, /* right = */ 990, /* bottom = */ 100)
- )
+ .thenReturn(Rect(/* left= */ 10, /* top= */ 10, /* right= */ 990, /* bottom= */ 100))
// StatusBarWindowController is mocked. The addViewToWindow function needs to be mocked to
// ensure that the chip view is added to a parent view
whenever(statusBarWindowController.addViewToWindow(any(), any())).then {
val statusbarFake = FrameLayout(mContext)
- statusbarFake.layout(/* l = */ 0, /* t = */ 0, /* r = */ 1000, /* b = */ 100)
+ statusbarFake.layout(/* l= */ 0, /* t= */ 0, /* r= */ 1000, /* b= */ 100)
statusbarFake.addView(
it.arguments[0] as View,
- it.arguments[1] as FrameLayout.LayoutParams
+ it.arguments[1] as FrameLayout.LayoutParams,
)
}
}
@@ -386,7 +382,7 @@ class SystemStatusAnimationSchedulerImplTest : SysuiTestCase() {
scheduleFakeEventWithView(
accessibilityDesc,
mockAnimatableView,
- shouldAnnounceAccessibilityEvent = true
+ shouldAnnounceAccessibilityEvent = true,
)
fastForwardAnimationToState(ANIMATING_OUT)
@@ -405,7 +401,7 @@ class SystemStatusAnimationSchedulerImplTest : SysuiTestCase() {
scheduleFakeEventWithView(
accessibilityDesc,
mockAnimatableView,
- shouldAnnounceAccessibilityEvent = true
+ shouldAnnounceAccessibilityEvent = true,
)
fastForwardAnimationToState(ANIMATING_OUT)
@@ -424,7 +420,7 @@ class SystemStatusAnimationSchedulerImplTest : SysuiTestCase() {
scheduleFakeEventWithView(
accessibilityDesc,
mockAnimatableView,
- shouldAnnounceAccessibilityEvent = false
+ shouldAnnounceAccessibilityEvent = false,
)
fastForwardAnimationToState(ANIMATING_OUT)
@@ -637,13 +633,13 @@ class SystemStatusAnimationSchedulerImplTest : SysuiTestCase() {
private fun scheduleFakeEventWithView(
desc: String?,
view: BackgroundAnimatableView,
- shouldAnnounceAccessibilityEvent: Boolean
+ shouldAnnounceAccessibilityEvent: Boolean,
) {
val fakeEvent =
FakeStatusEvent(
viewCreator = { view },
contentDescription = desc,
- shouldAnnounceAccessibilityEvent = shouldAnnounceAccessibilityEvent
+ shouldAnnounceAccessibilityEvent = shouldAnnounceAccessibilityEvent,
)
systemStatusAnimationScheduler.onStatusEvent(fakeEvent)
}
@@ -668,7 +664,7 @@ class SystemStatusAnimationSchedulerImplTest : SysuiTestCase() {
dumpManager,
systemClock,
CoroutineScope(StandardTestDispatcher(testScope.testScheduler)),
- logger
+ logger,
)
// add a mock listener
systemStatusAnimationScheduler.addCallback(listener)
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/CentralSurfacesImplTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/CentralSurfacesImplTest.java
index 8f64287ebd0f..1e88215bf339 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/CentralSurfacesImplTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/CentralSurfacesImplTest.java
@@ -18,6 +18,12 @@ package com.android.systemui.statusbar.phone;
import static android.app.StatusBarManager.WINDOW_STATE_HIDDEN;
import static android.app.StatusBarManager.WINDOW_STATE_SHOWING;
+import static android.hardware.devicestate.DeviceState.PROPERTY_FOLDABLE_DISPLAY_CONFIGURATION_INNER_PRIMARY;
+import static android.hardware.devicestate.DeviceState.PROPERTY_FOLDABLE_DISPLAY_CONFIGURATION_OUTER_PRIMARY;
+import static android.hardware.devicestate.DeviceState.PROPERTY_FOLDABLE_HARDWARE_CONFIGURATION_FOLD_IN_CLOSED;
+import static android.hardware.devicestate.DeviceState.PROPERTY_FOLDABLE_HARDWARE_CONFIGURATION_FOLD_IN_OPEN;
+import static android.hardware.devicestate.DeviceState.PROPERTY_POWER_CONFIGURATION_TRIGGER_SLEEP;
+import static android.hardware.devicestate.DeviceState.PROPERTY_POWER_CONFIGURATION_TRIGGER_WAKE;
import static android.provider.Settings.Global.HEADS_UP_NOTIFICATIONS_ENABLED;
import static android.provider.Settings.Global.HEADS_UP_ON;
@@ -123,7 +129,6 @@ import com.android.systemui.keyguard.KeyguardUnlockAnimationController;
import com.android.systemui.keyguard.KeyguardViewMediator;
import com.android.systemui.keyguard.ScreenLifecycle;
import com.android.systemui.keyguard.WakefulnessLifecycle;
-import com.android.systemui.keyguard.ui.viewmodel.LightRevealScrimViewModel;
import com.android.systemui.kosmos.KosmosJavaAdapter;
import com.android.systemui.navigationbar.NavigationBarController;
import com.android.systemui.notetask.NoteTaskController;
@@ -186,6 +191,8 @@ import com.android.systemui.statusbar.notification.row.NotificationGutsManager;
import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayout;
import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayoutController;
import com.android.systemui.statusbar.phone.fragment.CollapsedStatusBarFragment;
+import com.android.systemui.statusbar.phone.fragment.dagger.HomeStatusBarComponent;
+import com.android.systemui.statusbar.pipeline.shared.ui.composable.StatusBarRootFactory;
import com.android.systemui.statusbar.policy.BatteryController;
import com.android.systemui.statusbar.policy.ConfigurationController;
import com.android.systemui.statusbar.policy.DeviceProvisionedController;
@@ -223,7 +230,9 @@ import org.mockito.MockitoAnnotations;
import java.io.ByteArrayOutputStream;
import java.io.PrintWriter;
+import java.util.List;
import java.util.Optional;
+import java.util.Set;
import javax.inject.Provider;
@@ -233,8 +242,22 @@ import javax.inject.Provider;
@EnableFlags(FLAG_LIGHT_REVEAL_MIGRATION)
public class CentralSurfacesImplTest extends SysuiTestCase {
- private static final int FOLD_STATE_FOLDED = 0;
- private static final int FOLD_STATE_UNFOLDED = 1;
+ private static final DeviceState FOLD_STATE_FOLDED = new DeviceState(
+ new DeviceState.Configuration.Builder(0 /* identifier */, "FOLDED" /* name */)
+ .setSystemProperties(
+ Set.of(PROPERTY_FOLDABLE_DISPLAY_CONFIGURATION_OUTER_PRIMARY,
+ PROPERTY_POWER_CONFIGURATION_TRIGGER_SLEEP))
+ .setPhysicalProperties(
+ Set.of(PROPERTY_FOLDABLE_HARDWARE_CONFIGURATION_FOLD_IN_CLOSED))
+ .build());
+ private static final DeviceState FOLD_STATE_UNFOLDED = new DeviceState(
+ new DeviceState.Configuration.Builder(1 /* identifier */, "UNFOLDED" /* name */)
+ .setSystemProperties(
+ Set.of(PROPERTY_FOLDABLE_DISPLAY_CONFIGURATION_INNER_PRIMARY,
+ PROPERTY_POWER_CONFIGURATION_TRIGGER_WAKE))
+ .setPhysicalProperties(
+ Set.of(PROPERTY_FOLDABLE_HARDWARE_CONFIGURATION_FOLD_IN_OPEN))
+ .build());
private final KosmosJavaAdapter mKosmos = new KosmosJavaAdapter(this);
@@ -259,7 +282,6 @@ public class CentralSurfacesImplTest extends SysuiTestCase {
@Mock private QuickSettingsController mQuickSettingsController;
@Mock private IStatusBarService mBarService;
@Mock private IDreamManager mDreamManager;
- @Mock private LightRevealScrimViewModel mLightRevealScrimViewModel;
@Mock private LightRevealScrim mLightRevealScrim;
@Mock private DozeScrimController mDozeScrimController;
@Mock private Lazy<BiometricUnlockController> mBiometricUnlockControllerLazy;
@@ -429,6 +451,8 @@ public class CentralSurfacesImplTest extends SysuiTestCase {
when(mStackScroller.generateLayoutParams(any())).thenReturn(new LayoutParams(0, 0));
when(mNotificationPanelView.getLayoutParams()).thenReturn(new LayoutParams(0, 0));
when(mPowerManagerService.isInteractive()).thenReturn(true);
+ when(mDeviceStateManager.getSupportedDeviceStates())
+ .thenReturn(List.of(FOLD_STATE_FOLDED, FOLD_STATE_UNFOLDED));
doAnswer(invocation -> {
OnDismissAction onDismissAction = (OnDismissAction) invocation.getArguments()[0];
@@ -514,8 +538,9 @@ public class CentralSurfacesImplTest extends SysuiTestCase {
new StatusBarInitializerImpl(
mStatusBarWindowController,
mCollapsedStatusBarFragmentProvider,
- emptySet()
- ),
+ mock(StatusBarRootFactory.class),
+ mock(HomeStatusBarComponent.Factory.class),
+ emptySet()),
mStatusBarWindowControllerStore,
mStatusBarWindowStateController,
new FakeStatusBarModeRepository(),
@@ -604,7 +629,6 @@ public class CentralSurfacesImplTest extends SysuiTestCase {
mWiredChargingRippleController,
mDreamManager,
mCameraLauncherLazy,
- () -> mLightRevealScrimViewModel,
mLightRevealScrim,
mAlternateBouncerInteractor,
mUserTracker,
@@ -996,8 +1020,8 @@ public class CentralSurfacesImplTest extends SysuiTestCase {
@Test
public void deviceStateChange_unfolded_shadeOpen_setsLeaveOpenOnKeyguardHide() {
- setFoldedStates(FOLD_STATE_FOLDED);
- setGoToSleepStates(FOLD_STATE_FOLDED);
+ setFoldedStates(FOLD_STATE_FOLDED.getIdentifier());
+ setGoToSleepStates(FOLD_STATE_FOLDED.getIdentifier());
mCentralSurfaces.setBarStateForTest(SHADE);
when(mNotificationPanelViewController.isShadeFullyExpanded()).thenReturn(true);
@@ -1008,8 +1032,8 @@ public class CentralSurfacesImplTest extends SysuiTestCase {
@Test
public void deviceStateChange_unfolded_shadeOpen_onKeyguard_doesNotSetLeaveOpenOnKeyguardHide() {
- setFoldedStates(FOLD_STATE_FOLDED);
- setGoToSleepStates(FOLD_STATE_FOLDED);
+ setFoldedStates(FOLD_STATE_FOLDED.getIdentifier());
+ setGoToSleepStates(FOLD_STATE_FOLDED.getIdentifier());
mCentralSurfaces.setBarStateForTest(KEYGUARD);
when(mNotificationPanelViewController.isShadeFullyExpanded()).thenReturn(true);
@@ -1021,8 +1045,8 @@ public class CentralSurfacesImplTest extends SysuiTestCase {
@Test
public void deviceStateChange_unfolded_shadeClose_doesNotSetLeaveOpenOnKeyguardHide() {
- setFoldedStates(FOLD_STATE_FOLDED);
- setGoToSleepStates(FOLD_STATE_FOLDED);
+ setFoldedStates(FOLD_STATE_FOLDED.getIdentifier());
+ setGoToSleepStates(FOLD_STATE_FOLDED.getIdentifier());
mCentralSurfaces.setBarStateForTest(SHADE);
when(mNotificationPanelViewController.isShadeFullyExpanded()).thenReturn(false);
@@ -1033,8 +1057,8 @@ public class CentralSurfacesImplTest extends SysuiTestCase {
@Test
public void deviceStateChange_unfolded_shadeExpanding_onKeyguard_closesQS() {
- setFoldedStates(FOLD_STATE_FOLDED);
- setGoToSleepStates(FOLD_STATE_FOLDED);
+ setFoldedStates(FOLD_STATE_FOLDED.getIdentifier());
+ setGoToSleepStates(FOLD_STATE_FOLDED.getIdentifier());
mCentralSurfaces.setBarStateForTest(KEYGUARD);
when(mNotificationPanelViewController.isExpandingOrCollapsing()).thenReturn(true);
@@ -1046,8 +1070,8 @@ public class CentralSurfacesImplTest extends SysuiTestCase {
@Test
public void deviceStateChange_unfolded_shadeExpanded_onKeyguard_closesQS() {
- setFoldedStates(FOLD_STATE_FOLDED);
- setGoToSleepStates(FOLD_STATE_FOLDED);
+ setFoldedStates(FOLD_STATE_FOLDED.getIdentifier());
+ setGoToSleepStates(FOLD_STATE_FOLDED.getIdentifier());
mCentralSurfaces.setBarStateForTest(KEYGUARD);
when(mNotificationPanelViewController.isShadeFullyExpanded()).thenReturn(true);
@@ -1364,9 +1388,7 @@ public class CentralSurfacesImplTest extends SysuiTestCase {
mCentralSurfaces.updateIsKeyguard(false /* forceStateChange */);
}
- private void setDeviceState(int state) {
- DeviceState deviceState = new DeviceState(
- new DeviceState.Configuration.Builder(state, "TEST").build());
+ private void setDeviceState(DeviceState deviceState) {
ArgumentCaptor<DeviceStateManager.DeviceStateCallback> callbackCaptor =
ArgumentCaptor.forClass(DeviceStateManager.DeviceStateCallback.class);
verify(mDeviceStateManager).registerCallback(any(), callbackCaptor.capture());
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/FoldStateListenerTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/FoldStateListenerTest.kt
index a3e2d1949a29..2e65478714af 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/FoldStateListenerTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/FoldStateListenerTest.kt
@@ -15,12 +15,15 @@
*/
package com.android.systemui.statusbar.phone
-import android.hardware.devicestate.DeviceState
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.internal.R
import com.android.systemui.SysuiTestCase
+import com.android.systemui.foldedDeviceStateList
+import com.android.systemui.halfFoldedDeviceState
+import com.android.systemui.kosmos.Kosmos
import com.android.systemui.statusbar.phone.FoldStateListener.OnFoldStateChangeListener
+import com.android.systemui.unfoldedDeviceState
import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
@@ -34,8 +37,7 @@ import org.mockito.MockitoAnnotations.initMocks
@SmallTest
class FoldStateListenerTest : SysuiTestCase() {
- @Mock
- private lateinit var listener: OnFoldStateChangeListener
+ @Mock private lateinit var listener: OnFoldStateChangeListener
private lateinit var sut: FoldStateListener
@Before
@@ -111,25 +113,13 @@ class FoldStateListenerTest : SysuiTestCase() {
}
private fun setFoldedStates(vararg states: Int) {
- mContext.orCreateTestableResources.addOverride(
- R.array.config_foldedDeviceStates,
- states
- )
+ mContext.orCreateTestableResources.addOverride(R.array.config_foldedDeviceStates, states)
}
companion object {
- private val DEVICE_STATE_FOLDED = DeviceState(
- DeviceState.Configuration.Builder(123 /* id */, "FOLDED" /* name */)
- .build()
- )
- private val DEVICE_STATE_HALF_FOLDED = DeviceState(
- DeviceState.Configuration.Builder(456 /* id */, "HALF_FOLDED" /* name */)
- .build()
- )
- private val DEVICE_STATE_UNFOLDED = DeviceState(
- DeviceState.Configuration.Builder(789 /* id */, "UNFOLDED" /* name */)
- .build()
- )
+ private val DEVICE_STATE_FOLDED = Kosmos().foldedDeviceStateList.first()
+ private val DEVICE_STATE_HALF_FOLDED = Kosmos().halfFoldedDeviceState
+ private val DEVICE_STATE_UNFOLDED = Kosmos().unfoldedDeviceState
private const val FOLDED = true
private const val NOT_FOLDED = false
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/ScrimControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/ScrimControllerTest.java
index eecf36e9343b..c639b3ab37bc 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/ScrimControllerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/ScrimControllerTest.java
@@ -44,7 +44,6 @@ import static org.mockito.Mockito.verifyNoMoreInteractions;
import static org.mockito.Mockito.when;
import android.animation.Animator;
-import android.app.AlarmManager;
import android.content.Context;
import android.content.res.ColorStateList;
import android.content.res.TypedArray;
@@ -90,7 +89,6 @@ import com.android.systemui.util.kotlin.JavaAdapter;
import com.android.systemui.util.time.FakeSystemClock;
import com.android.systemui.util.wakelock.DelayedWakeLock;
import com.android.systemui.utils.os.FakeHandler;
-import com.android.systemui.wallpapers.data.repository.FakeWallpaperRepository;
import com.google.common.truth.Expect;
@@ -139,7 +137,6 @@ public class ScrimControllerTest extends SysuiTestCase {
private boolean mAlwaysOnEnabled;
private TestableLooper mLooper;
private Context mContext;
- @Mock private AlarmManager mAlarmManager;
@Mock private DozeParameters mDozeParameters;
@Mock private LightBarController mLightBarController;
@Mock private DelayedWakeLock.Factory mDelayedWakeLockFactory;
@@ -157,7 +154,6 @@ public class ScrimControllerTest extends SysuiTestCase {
private final FakeKeyguardTransitionRepository mKeyguardTransitionRepository =
mKosmos.getKeyguardTransitionRepository();
@Mock private KeyguardInteractor mKeyguardInteractor;
- private final FakeWallpaperRepository mWallpaperRepository = new FakeWallpaperRepository();
@Mock private TypedArray mMockTypedArray;
// TODO(b/204991468): Use a real PanelExpansionStateManager object once this bug is fixed. (The
@@ -282,7 +278,6 @@ public class ScrimControllerTest extends SysuiTestCase {
mScrimController = new ScrimController(
mLightBarController,
mDozeParameters,
- mAlarmManager,
mKeyguardStateController,
mDelayedWakeLockFactory,
new FakeHandler(mLooper.getLooper()),
@@ -298,10 +293,8 @@ public class ScrimControllerTest extends SysuiTestCase {
mAlternateBouncerToGoneTransitionViewModel,
mKeyguardTransitionInteractor,
mKeyguardInteractor,
- mWallpaperRepository,
mKosmos.getTestDispatcher(),
mLinearLargeScreenShadeInterpolator);
- mScrimController.start();
mScrimController.setScrimVisibleListener(visible -> mScrimVisibility = visible);
mScrimController.attachViews(mScrimBehind, mNotificationsScrim, mScrimInFront);
mScrimController.setAnimatorListener(mAnimatorListener);
@@ -309,7 +302,6 @@ public class ScrimControllerTest extends SysuiTestCase {
// Attach behind scrim so flows that are collecting on it start running.
ViewUtils.attachView(mScrimBehind);
- mWallpaperRepository.getWallpaperSupportsAmbientMode().setValue(false);
mTestScope.getTestScheduler().runCurrent();
if (SceneContainerFlag.isEnabled()) {
@@ -436,8 +428,6 @@ public class ScrimControllerTest extends SysuiTestCase {
mScrimInFront, true,
mScrimBehind, true
));
-
- assertEquals(1f, mScrimController.getState().getMaxLightRevealScrimAlpha(), 0f);
}
@Test
@@ -449,8 +439,6 @@ public class ScrimControllerTest extends SysuiTestCase {
mScrimInFront, TRANSPARENT,
mScrimBehind, TRANSPARENT,
mNotificationsScrim, TRANSPARENT));
- assertEquals(1f, mScrimController.getState().getMaxLightRevealScrimAlpha(), 0f);
-
assertScrimTinted(Map.of(
mScrimInFront, true,
mScrimBehind, true
@@ -458,29 +446,6 @@ public class ScrimControllerTest extends SysuiTestCase {
}
@Test
- public void transitionToAod_withAodWallpaper() {
- mWallpaperRepository.getWallpaperSupportsAmbientMode().setValue(true);
- mTestScope.getTestScheduler().runCurrent();
-
- mScrimController.legacyTransitionTo(ScrimState.AOD);
- finishAnimationsImmediately();
-
- assertScrimAlpha(Map.of(
- mScrimInFront, TRANSPARENT,
- mScrimBehind, TRANSPARENT));
- assertEquals(0f, mScrimController.getState().getMaxLightRevealScrimAlpha(), 0f);
-
- // Pulsing notification should conserve AOD wallpaper.
- mScrimController.legacyTransitionTo(ScrimState.PULSING);
- finishAnimationsImmediately();
-
- assertScrimAlpha(Map.of(
- mScrimInFront, TRANSPARENT,
- mScrimBehind, TRANSPARENT));
- assertEquals(0f, mScrimController.getState().getMaxLightRevealScrimAlpha(), 0f);
- }
-
- @Test
public void transitionToAod_withFrontAlphaUpdates() {
// Assert that setting the AOD front scrim alpha doesn't take effect in a non-AOD state.
mScrimController.legacyTransitionTo(ScrimState.KEYGUARD);
@@ -497,14 +462,12 @@ public class ScrimControllerTest extends SysuiTestCase {
assertScrimAlpha(Map.of(
mScrimInFront, SEMI_TRANSPARENT,
mScrimBehind, TRANSPARENT));
- assertEquals(1f, mScrimController.getState().getMaxLightRevealScrimAlpha(), 0f);
// ... and that if we set it while we're in AOD, it does take immediate effect.
mScrimController.setAodFrontScrimAlpha(1f);
assertScrimAlpha(Map.of(
mScrimInFront, OPAQUE,
mScrimBehind, TRANSPARENT));
- assertEquals(1f, mScrimController.getState().getMaxLightRevealScrimAlpha(), 0f);
// ... and make sure we recall the previous front scrim alpha even if we transition away
// for a bit.
@@ -514,7 +477,6 @@ public class ScrimControllerTest extends SysuiTestCase {
assertScrimAlpha(Map.of(
mScrimInFront, OPAQUE,
mScrimBehind, TRANSPARENT));
- assertEquals(1f, mScrimController.getState().getMaxLightRevealScrimAlpha(), 0f);
// ... and alpha updates should be completely ignored if always_on is off.
// Passing it forward would mess up the wake-up transition.
@@ -545,7 +507,6 @@ public class ScrimControllerTest extends SysuiTestCase {
assertScrimAlpha(Map.of(
mScrimInFront, OPAQUE,
mScrimBehind, TRANSPARENT));
- assertEquals(1f, mScrimController.getState().getMaxLightRevealScrimAlpha(), 0f);
// ... but will take effect after docked
when(mDockManager.isDocked()).thenReturn(true);
@@ -557,7 +518,6 @@ public class ScrimControllerTest extends SysuiTestCase {
assertScrimAlpha(Map.of(
mScrimInFront, SEMI_TRANSPARENT,
mScrimBehind, TRANSPARENT));
- assertEquals(1f, mScrimController.getState().getMaxLightRevealScrimAlpha(), 0f);
// ... and that if we set it while we're in AOD, it does take immediate effect after docked.
mScrimController.setAodFrontScrimAlpha(1f);
@@ -565,7 +525,6 @@ public class ScrimControllerTest extends SysuiTestCase {
assertScrimAlpha(Map.of(
mScrimInFront, OPAQUE,
mScrimBehind, TRANSPARENT));
- assertEquals(1f, mScrimController.getState().getMaxLightRevealScrimAlpha(), 0f);
// Reset value since enums are static.
mScrimController.setAodFrontScrimAlpha(0f);
@@ -576,7 +535,6 @@ public class ScrimControllerTest extends SysuiTestCase {
// Pre-condition
// Need to go to AoD first because PULSING doesn't change
// the back scrim opacity - otherwise it would hide AoD wallpapers.
- mWallpaperRepository.getWallpaperSupportsAmbientMode().setValue(false);
mTestScope.getTestScheduler().runCurrent();
mScrimController.legacyTransitionTo(ScrimState.AOD);
@@ -584,7 +542,6 @@ public class ScrimControllerTest extends SysuiTestCase {
assertScrimAlpha(Map.of(
mScrimInFront, TRANSPARENT,
mScrimBehind, TRANSPARENT));
- assertEquals(1f, mScrimController.getState().getMaxLightRevealScrimAlpha(), 0f);
mScrimController.legacyTransitionTo(ScrimState.PULSING);
finishAnimationsImmediately();
@@ -594,7 +551,6 @@ public class ScrimControllerTest extends SysuiTestCase {
assertScrimAlpha(Map.of(
mScrimInFront, TRANSPARENT,
mScrimBehind, TRANSPARENT));
- assertEquals(1f, mScrimController.getState().getMaxLightRevealScrimAlpha(), 0f);
assertScrimTinted(Map.of(
mScrimInFront, true,
@@ -608,15 +564,12 @@ public class ScrimControllerTest extends SysuiTestCase {
assertScrimAlpha(Map.of(
mScrimInFront, SEMI_TRANSPARENT,
mScrimBehind, TRANSPARENT));
- assertEquals(1f, mScrimController.getState().getMaxLightRevealScrimAlpha(), 0f);
mScrimController.setWakeLockScreenSensorActive(true);
finishAnimationsImmediately();
assertScrimAlpha(Map.of(
mScrimInFront, SEMI_TRANSPARENT,
mScrimBehind, TRANSPARENT));
- assertEquals(ScrimController.WAKE_SENSOR_SCRIM_ALPHA,
- mScrimController.getState().getMaxLightRevealScrimAlpha(), 0f);
// Reset value since enums are static.
mScrimController.setAodFrontScrimAlpha(0f);
@@ -1290,7 +1243,6 @@ public class ScrimControllerTest extends SysuiTestCase {
mScrimController = new ScrimController(
mLightBarController,
mDozeParameters,
- mAlarmManager,
mKeyguardStateController,
mDelayedWakeLockFactory,
new FakeHandler(mLooper.getLooper()),
@@ -1306,14 +1258,11 @@ public class ScrimControllerTest extends SysuiTestCase {
mAlternateBouncerToGoneTransitionViewModel,
mKeyguardTransitionInteractor,
mKeyguardInteractor,
- mWallpaperRepository,
mKosmos.getTestDispatcher(),
mLinearLargeScreenShadeInterpolator);
- mScrimController.start();
mScrimController.setScrimVisibleListener(visible -> mScrimVisibility = visible);
mScrimController.attachViews(mScrimBehind, mNotificationsScrim, mScrimInFront);
mScrimController.setAnimatorListener(mAnimatorListener);
- mWallpaperRepository.getWallpaperSupportsAmbientMode().setValue(false);
mTestScope.getTestScheduler().runCurrent();
mScrimController.legacyTransitionTo(ScrimState.KEYGUARD);
finishAnimationsImmediately();
@@ -1410,57 +1359,6 @@ public class ScrimControllerTest extends SysuiTestCase {
}
@Test
- public void testHoldsAodWallpaperAnimationLock() {
- // Pre-conditions
- mScrimController.legacyTransitionTo(ScrimState.AOD);
- finishAnimationsImmediately();
- reset(mWakeLock);
-
- mScrimController.onHideWallpaperTimeout();
- verify(mWakeLock).acquire(anyString());
- verify(mWakeLock, never()).release(anyString());
- finishAnimationsImmediately();
- verify(mWakeLock).release(anyString());
- }
-
- @Test
- public void testHoldsPulsingWallpaperAnimationLock() {
- // Pre-conditions
- mScrimController.legacyTransitionTo(ScrimState.PULSING);
- finishAnimationsImmediately();
- reset(mWakeLock);
-
- mScrimController.onHideWallpaperTimeout();
- verify(mWakeLock).acquire(anyString());
- verify(mWakeLock, never()).release(anyString());
- finishAnimationsImmediately();
- verify(mWakeLock).release(anyString());
- }
-
- @Test
- public void testWillHideAodWallpaper() {
- mWallpaperRepository.getWallpaperSupportsAmbientMode().setValue(true);
- mTestScope.getTestScheduler().runCurrent();
-
- mScrimController.legacyTransitionTo(ScrimState.AOD);
- verify(mAlarmManager).setExact(anyInt(), anyLong(), any(), any(), any());
- mScrimController.legacyTransitionTo(ScrimState.KEYGUARD);
- verify(mAlarmManager).cancel(any(AlarmManager.OnAlarmListener.class));
- }
-
- @Test
- public void testWillHideDockedWallpaper() {
- mAlwaysOnEnabled = false;
- when(mDockManager.isDocked()).thenReturn(true);
- mWallpaperRepository.getWallpaperSupportsAmbientMode().setValue(true);
- mTestScope.getTestScheduler().runCurrent();
-
- mScrimController.legacyTransitionTo(ScrimState.AOD);
-
- verify(mAlarmManager).setExact(anyInt(), anyLong(), any(), any(), any());
- }
-
- @Test
public void testConservesExpansionOpacityAfterTransition() {
mScrimController.legacyTransitionTo(ScrimState.UNLOCKED);
mScrimController.setRawPanelExpansionFraction(0.5f);
@@ -1498,43 +1396,6 @@ public class ScrimControllerTest extends SysuiTestCase {
}
@Test
- public void testHidesShowWhenLockedActivity() {
- mWallpaperRepository.getWallpaperSupportsAmbientMode().setValue(true);
- mTestScope.getTestScheduler().runCurrent();
-
- mScrimController.setKeyguardOccluded(true);
- mScrimController.legacyTransitionTo(ScrimState.AOD);
- finishAnimationsImmediately();
- assertScrimAlpha(Map.of(
- mScrimInFront, TRANSPARENT,
- mScrimBehind, OPAQUE));
-
- mScrimController.legacyTransitionTo(ScrimState.PULSING);
- finishAnimationsImmediately();
- assertScrimAlpha(Map.of(
- mScrimInFront, TRANSPARENT,
- mScrimBehind, OPAQUE));
- }
-
- @Test
- public void testHidesShowWhenLockedActivity_whenAlreadyInAod() {
- mWallpaperRepository.getWallpaperSupportsAmbientMode().setValue(true);
- mTestScope.getTestScheduler().runCurrent();
-
- mScrimController.legacyTransitionTo(ScrimState.AOD);
- finishAnimationsImmediately();
- assertScrimAlpha(Map.of(
- mScrimInFront, TRANSPARENT,
- mScrimBehind, TRANSPARENT));
-
- mScrimController.setKeyguardOccluded(true);
- finishAnimationsImmediately();
- assertScrimAlpha(Map.of(
- mScrimInFront, TRANSPARENT,
- mScrimBehind, OPAQUE));
- }
-
- @Test
public void testEatsTouchEvent() {
HashSet<ScrimState> eatsTouches =
new HashSet<>(Collections.singletonList(ScrimState.AOD));
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/fragment/CollapsedStatusBarFragmentTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/fragment/CollapsedStatusBarFragmentTest.java
index 15ef917343ee..d01c1ca36c4e 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/fragment/CollapsedStatusBarFragmentTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/fragment/CollapsedStatusBarFragmentTest.java
@@ -66,12 +66,12 @@ import com.android.systemui.statusbar.events.SystemStatusAnimationScheduler;
import com.android.systemui.statusbar.notification.icon.ui.viewbinder.NotificationIconContainerStatusBarViewBinder;
import com.android.systemui.statusbar.phone.HeadsUpAppearanceController;
import com.android.systemui.statusbar.phone.StatusBarHideIconsForBouncerManager;
-import com.android.systemui.statusbar.phone.fragment.dagger.StatusBarFragmentComponent;
+import com.android.systemui.statusbar.phone.fragment.dagger.HomeStatusBarComponent;
import com.android.systemui.statusbar.phone.ongoingcall.OngoingCallController;
import com.android.systemui.statusbar.phone.ui.DarkIconManager;
import com.android.systemui.statusbar.phone.ui.StatusBarIconController;
-import com.android.systemui.statusbar.pipeline.shared.ui.viewmodel.FakeCollapsedStatusBarViewBinder;
-import com.android.systemui.statusbar.pipeline.shared.ui.viewmodel.FakeCollapsedStatusBarViewModel;
+import com.android.systemui.statusbar.pipeline.shared.ui.viewmodel.FakeHomeStatusBarViewBinder;
+import com.android.systemui.statusbar.pipeline.shared.ui.viewmodel.FakeHomeStatusBarViewModel;
import com.android.systemui.statusbar.policy.KeyguardStateController;
import com.android.systemui.statusbar.window.StatusBarWindowStateController;
import com.android.systemui.statusbar.window.StatusBarWindowStateListener;
@@ -109,9 +109,9 @@ public class CollapsedStatusBarFragmentTest extends SysuiBaseFragmentTest {
private final CarrierConfigTracker mCarrierConfigTracker = mock(CarrierConfigTracker.class);
@Mock
- private StatusBarFragmentComponent.Factory mStatusBarFragmentComponentFactory;
+ private HomeStatusBarComponent.Factory mStatusBarFragmentComponentFactory;
@Mock
- private StatusBarFragmentComponent mStatusBarFragmentComponent;
+ private HomeStatusBarComponent mHomeStatusBarComponent;
@Mock
private StatusBarStateController mStatusBarStateController;
@Mock
@@ -122,8 +122,8 @@ public class CollapsedStatusBarFragmentTest extends SysuiBaseFragmentTest {
private DarkIconManager.Factory mIconManagerFactory;
@Mock
private DarkIconManager mIconManager;
- private FakeCollapsedStatusBarViewModel mCollapsedStatusBarViewModel;
- private FakeCollapsedStatusBarViewBinder mCollapsedStatusBarViewBinder;
+ private FakeHomeStatusBarViewModel mCollapsedStatusBarViewModel;
+ private FakeHomeStatusBarViewBinder mCollapsedStatusBarViewBinder;
@Mock
private StatusBarHideIconsForBouncerManager mStatusBarHideIconsForBouncerManager;
@Mock
@@ -1060,7 +1060,7 @@ public class CollapsedStatusBarFragmentTest extends SysuiBaseFragmentTest {
public void setUp_fragmentCreatesDaggerComponent() {
CollapsedStatusBarFragment fragment = resumeAndGetFragment();
- assertEquals(mStatusBarFragmentComponent, fragment.getStatusBarFragmentComponent());
+ assertEquals(mHomeStatusBarComponent, fragment.getHomeStatusBarComponent());
}
@Test
@@ -1190,8 +1190,8 @@ public class CollapsedStatusBarFragmentTest extends SysuiBaseFragmentTest {
mSecureSettings = mock(SecureSettings.class);
mShadeExpansionStateManager = new ShadeExpansionStateManager();
- mCollapsedStatusBarViewModel = new FakeCollapsedStatusBarViewModel();
- mCollapsedStatusBarViewBinder = new FakeCollapsedStatusBarViewBinder();
+ mCollapsedStatusBarViewModel = new FakeHomeStatusBarViewModel();
+ mCollapsedStatusBarViewBinder = new FakeHomeStatusBarViewBinder();
return new CollapsedStatusBarFragment(
mStatusBarFragmentComponentFactory,
@@ -1224,8 +1224,8 @@ public class CollapsedStatusBarFragmentTest extends SysuiBaseFragmentTest {
private void setUpDaggerComponent() {
when(mStatusBarFragmentComponentFactory.create(any()))
- .thenReturn(mStatusBarFragmentComponent);
- when(mStatusBarFragmentComponent.getHeadsUpAppearanceController())
+ .thenReturn(mHomeStatusBarComponent);
+ when(mHomeStatusBarComponent.getHeadsUpAppearanceController())
.thenReturn(mHeadsUpAppearanceController);
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/DeviceStateRotationLockSettingControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/DeviceStateRotationLockSettingControllerTest.java
index f6e07d3d621e..3247a1ab6eb0 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/DeviceStateRotationLockSettingControllerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/DeviceStateRotationLockSettingControllerTest.java
@@ -16,6 +16,11 @@
package com.android.systemui.statusbar.policy;
+import static android.hardware.devicestate.DeviceState.PROPERTY_FOLDABLE_DISPLAY_CONFIGURATION_INNER_PRIMARY;
+import static android.hardware.devicestate.DeviceState.PROPERTY_FOLDABLE_DISPLAY_CONFIGURATION_OUTER_PRIMARY;
+import static android.hardware.devicestate.DeviceState.PROPERTY_FOLDABLE_HARDWARE_CONFIGURATION_FOLD_IN_CLOSED;
+import static android.hardware.devicestate.DeviceState.PROPERTY_FOLDABLE_HARDWARE_CONFIGURATION_FOLD_IN_HALF_OPEN;
+import static android.hardware.devicestate.DeviceState.PROPERTY_FOLDABLE_HARDWARE_CONFIGURATION_FOLD_IN_OPEN;
import static android.provider.Settings.Secure.DEVICE_STATE_ROTATION_LOCK_IGNORED;
import static android.provider.Settings.Secure.DEVICE_STATE_ROTATION_LOCK_LOCKED;
import static android.provider.Settings.Secure.DEVICE_STATE_ROTATION_LOCK_UNLOCKED;
@@ -24,7 +29,9 @@ import static com.google.common.truth.Truth.assertThat;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+import android.annotation.NonNull;
import android.hardware.devicestate.DeviceState;
import android.hardware.devicestate.DeviceStateManager;
import android.os.UserHandle;
@@ -51,14 +58,37 @@ import org.mockito.ArgumentCaptor;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
+import java.util.Collections;
+import java.util.List;
+import java.util.Set;
+
@RunWith(AndroidJUnit4.class)
@SmallTest
public class DeviceStateRotationLockSettingControllerTest extends SysuiTestCase {
+ private static final DeviceState DEFAULT_FOLDED_STATE = createDeviceState(0 /* identifier */,
+ "folded", Set.of(PROPERTY_FOLDABLE_DISPLAY_CONFIGURATION_OUTER_PRIMARY),
+ Set.of(PROPERTY_FOLDABLE_HARDWARE_CONFIGURATION_FOLD_IN_CLOSED));
+ private static final DeviceState DEFAULT_HALF_FOLDED_STATE = createDeviceState(
+ 2 /* identifier */, "half_folded",
+ Set.of(PROPERTY_FOLDABLE_DISPLAY_CONFIGURATION_INNER_PRIMARY),
+ Set.of(PROPERTY_FOLDABLE_HARDWARE_CONFIGURATION_FOLD_IN_HALF_OPEN));
+ private static final DeviceState DEFAULT_UNFOLDED_STATE = createDeviceState(1 /* identifier */,
+ "unfolded",
+ Set.of(PROPERTY_FOLDABLE_DISPLAY_CONFIGURATION_INNER_PRIMARY),
+ Set.of(PROPERTY_FOLDABLE_HARDWARE_CONFIGURATION_FOLD_IN_OPEN));
+ private static final DeviceState UNKNOWN_DEVICE_STATE = createDeviceState(8 /* identifier */,
+ "unknown", Collections.emptySet(), Collections.emptySet());
+ private static final List<DeviceState> DEVICE_STATE_LIST = List.of(DEFAULT_FOLDED_STATE,
+ DEFAULT_HALF_FOLDED_STATE, DEFAULT_UNFOLDED_STATE);
+
private static final String[] DEFAULT_SETTINGS = new String[]{"0:1", "2:0:1", "1:2"};
- private static final int[] DEFAULT_FOLDED_STATES = new int[]{0};
- private static final int[] DEFAULT_HALF_FOLDED_STATES = new int[]{2};
- private static final int[] DEFAULT_UNFOLDED_STATES = new int[]{1};
+ private static final int[] DEFAULT_FOLDED_STATE_IDENTIFIERS =
+ new int[]{DEFAULT_FOLDED_STATE.getIdentifier()};
+ private static final int[] DEFAULT_HALF_FOLDED_STATE_IDENTIFIERS =
+ new int[]{DEFAULT_HALF_FOLDED_STATE.getIdentifier()};
+ private static final int[] DEFAULT_UNFOLDED_STATE_IDENTIFIERS =
+ new int[]{DEFAULT_UNFOLDED_STATE.getIdentifier()};
@Mock private DeviceStateManager mDeviceStateManager;
@Mock private DeviceStateRotationLockSettingControllerLogger mLogger;
@@ -77,10 +107,12 @@ public class DeviceStateRotationLockSettingControllerTest extends SysuiTestCase
MockitoAnnotations.initMocks(/* testClass= */ this);
TestableResources resources = mContext.getOrCreateTestableResources();
resources.addOverride(R.array.config_perDeviceStateRotationLockDefaults, DEFAULT_SETTINGS);
- resources.addOverride(R.array.config_foldedDeviceStates, DEFAULT_FOLDED_STATES);
- resources.addOverride(R.array.config_halfFoldedDeviceStates, DEFAULT_HALF_FOLDED_STATES);
- resources.addOverride(R.array.config_openDeviceStates, DEFAULT_UNFOLDED_STATES);
-
+ resources.addOverride(R.array.config_foldedDeviceStates, DEFAULT_FOLDED_STATE_IDENTIFIERS);
+ resources.addOverride(R.array.config_halfFoldedDeviceStates,
+ DEFAULT_HALF_FOLDED_STATE_IDENTIFIERS);
+ resources.addOverride(R.array.config_openDeviceStates, DEFAULT_UNFOLDED_STATE_IDENTIFIERS);
+ when(mDeviceStateManager.getSupportedDeviceStates()).thenReturn(DEVICE_STATE_LIST);
+ mContext.addMockSystemService(DeviceStateManager.class, mDeviceStateManager);
ArgumentCaptor<DeviceStateManager.DeviceStateCallback> deviceStateCallbackArgumentCaptor =
ArgumentCaptor.forClass(DeviceStateManager.DeviceStateCallback.class);
@@ -120,11 +152,11 @@ public class DeviceStateRotationLockSettingControllerTest extends SysuiTestCase
0, DEVICE_STATE_ROTATION_LOCK_UNLOCKED, 1, DEVICE_STATE_ROTATION_LOCK_UNLOCKED);
mFakeRotationPolicy.setRotationLock(true);
- mDeviceStateCallback.onDeviceStateChanged(createDeviceStateForIdentifier(1));
+ mDeviceStateCallback.onDeviceStateChanged(DEFAULT_UNFOLDED_STATE);
assertThat(mFakeRotationPolicy.isRotationLocked()).isFalse();
// Settings only exist for state 0 and 1
- mDeviceStateCallback.onDeviceStateChanged(createDeviceStateForIdentifier(2));
+ mDeviceStateCallback.onDeviceStateChanged(DEFAULT_HALF_FOLDED_STATE);
assertThat(mFakeRotationPolicy.isRotationLocked()).isFalse();
}
@@ -135,10 +167,10 @@ public class DeviceStateRotationLockSettingControllerTest extends SysuiTestCase
0, DEVICE_STATE_ROTATION_LOCK_UNLOCKED, 1, DEVICE_STATE_ROTATION_LOCK_LOCKED);
mFakeRotationPolicy.setRotationLock(true);
- mDeviceStateCallback.onDeviceStateChanged(createDeviceStateForIdentifier(0));
+ mDeviceStateCallback.onDeviceStateChanged(DEFAULT_FOLDED_STATE);
assertThat(mFakeRotationPolicy.isRotationLocked()).isFalse();
- mDeviceStateCallback.onDeviceStateChanged(createDeviceStateForIdentifier(1));
+ mDeviceStateCallback.onDeviceStateChanged(DEFAULT_UNFOLDED_STATE);
assertThat(mFakeRotationPolicy.isRotationLocked()).isTrue();
}
@@ -148,7 +180,7 @@ public class DeviceStateRotationLockSettingControllerTest extends SysuiTestCase
mFakeRotationPolicy.setRotationLock(true);
// State 2 -> Ignored -> Fall back to state 1 which is unlocked
- mDeviceStateCallback.onDeviceStateChanged(createDeviceStateForIdentifier(2));
+ mDeviceStateCallback.onDeviceStateChanged(DEFAULT_HALF_FOLDED_STATE);
assertThat(mFakeRotationPolicy.isRotationLocked()).isFalse();
}
@@ -162,7 +194,7 @@ public class DeviceStateRotationLockSettingControllerTest extends SysuiTestCase
mFakeRotationPolicy.setRotationLock(false);
// State 2 -> Ignored -> Fall back to state 1 which is locked
- mDeviceStateCallback.onDeviceStateChanged(createDeviceStateForIdentifier(2));
+ mDeviceStateCallback.onDeviceStateChanged(DEFAULT_HALF_FOLDED_STATE);
assertThat(mFakeRotationPolicy.isRotationLocked()).isTrue();
}
@@ -174,7 +206,7 @@ public class DeviceStateRotationLockSettingControllerTest extends SysuiTestCase
mSettingsManager.onPersistedSettingsChanged();
mFakeRotationPolicy.setRotationLock(true);
- mDeviceStateCallback.onDeviceStateChanged(createDeviceStateForIdentifier(0));
+ mDeviceStateCallback.onDeviceStateChanged(DEFAULT_FOLDED_STATE);
assertThat(mFakeRotationPolicy.isRotationLocked()).isTrue();
mDeviceStateRotationLockSettingController.onRotationLockStateChanged(
@@ -190,10 +222,10 @@ public class DeviceStateRotationLockSettingControllerTest extends SysuiTestCase
@Test
public void whenDeviceStateSwitchedToIgnoredState_useFallbackSetting() {
- mDeviceStateCallback.onDeviceStateChanged(createDeviceStateForIdentifier(0));
+ mDeviceStateCallback.onDeviceStateChanged(DEFAULT_FOLDED_STATE);
assertThat(mFakeRotationPolicy.isRotationLocked()).isTrue();
- mDeviceStateCallback.onDeviceStateChanged(createDeviceStateForIdentifier(2));
+ mDeviceStateCallback.onDeviceStateChanged(DEFAULT_UNFOLDED_STATE);
assertThat(mFakeRotationPolicy.isRotationLocked()).isFalse();
}
@@ -203,10 +235,10 @@ public class DeviceStateRotationLockSettingControllerTest extends SysuiTestCase
8, DEVICE_STATE_ROTATION_LOCK_IGNORED, 1, DEVICE_STATE_ROTATION_LOCK_UNLOCKED);
mFakeRotationPolicy.setRotationLock(true);
- mDeviceStateCallback.onDeviceStateChanged(createDeviceStateForIdentifier(1));
+ mDeviceStateCallback.onDeviceStateChanged(DEFAULT_UNFOLDED_STATE);
assertThat(mFakeRotationPolicy.isRotationLocked()).isFalse();
- mDeviceStateCallback.onDeviceStateChanged(createDeviceStateForIdentifier(8));
+ mDeviceStateCallback.onDeviceStateChanged(UNKNOWN_DEVICE_STATE);
assertThat(mFakeRotationPolicy.isRotationLocked()).isFalse();
mDeviceStateRotationLockSettingController.onRotationLockStateChanged(
@@ -226,7 +258,7 @@ public class DeviceStateRotationLockSettingControllerTest extends SysuiTestCase
0, DEVICE_STATE_ROTATION_LOCK_UNLOCKED,
1, DEVICE_STATE_ROTATION_LOCK_UNLOCKED);
mFakeRotationPolicy.setRotationLock(false);
- mDeviceStateCallback.onDeviceStateChanged(createDeviceStateForIdentifier(0));
+ mDeviceStateCallback.onDeviceStateChanged(DEFAULT_FOLDED_STATE);
assertThat(mFakeRotationPolicy.isRotationLocked()).isFalse();
@@ -242,7 +274,7 @@ public class DeviceStateRotationLockSettingControllerTest extends SysuiTestCase
initializeSettingsWith(
0, DEVICE_STATE_ROTATION_LOCK_LOCKED,
1, DEVICE_STATE_ROTATION_LOCK_UNLOCKED);
- mDeviceStateCallback.onDeviceStateChanged(createDeviceStateForIdentifier(0));
+ mDeviceStateCallback.onDeviceStateChanged(DEFAULT_FOLDED_STATE);
mDeviceStateRotationLockSettingController.onRotationLockStateChanged(
/* rotationLocked= */ false,
@@ -263,7 +295,7 @@ public class DeviceStateRotationLockSettingControllerTest extends SysuiTestCase
0, DEVICE_STATE_ROTATION_LOCK_LOCKED,
1, DEVICE_STATE_ROTATION_LOCK_UNLOCKED,
2, DEVICE_STATE_ROTATION_LOCK_IGNORED);
- mDeviceStateCallback.onDeviceStateChanged(createDeviceStateForIdentifier(2));
+ mDeviceStateCallback.onDeviceStateChanged(DEFAULT_HALF_FOLDED_STATE);
mDeviceStateRotationLockSettingController.onRotationLockStateChanged(
/* rotationLocked= */ true,
@@ -284,8 +316,8 @@ public class DeviceStateRotationLockSettingControllerTest extends SysuiTestCase
0, DEVICE_STATE_ROTATION_LOCK_LOCKED,
1, DEVICE_STATE_ROTATION_LOCK_UNLOCKED,
8, DEVICE_STATE_ROTATION_LOCK_IGNORED);
- mDeviceStateCallback.onDeviceStateChanged(createDeviceStateForIdentifier(1));
- mDeviceStateCallback.onDeviceStateChanged(createDeviceStateForIdentifier(8));
+ mDeviceStateCallback.onDeviceStateChanged(DEFAULT_UNFOLDED_STATE);
+ mDeviceStateCallback.onDeviceStateChanged(UNKNOWN_DEVICE_STATE);
mDeviceStateRotationLockSettingController.onRotationLockStateChanged(
/* rotationLocked= */ true,
@@ -321,8 +353,13 @@ public class DeviceStateRotationLockSettingControllerTest extends SysuiTestCase
mSettingsManager.onPersistedSettingsChanged();
}
- private DeviceState createDeviceStateForIdentifier(int id) {
- return new DeviceState(new DeviceState.Configuration.Builder(id, "" /* name */).build());
+ private static DeviceState createDeviceState(int identifier, @NonNull String name,
+ @NonNull Set<@DeviceState.SystemDeviceStateProperties Integer> systemProperties,
+ @NonNull Set<@DeviceState.PhysicalDeviceStateProperties Integer> physicalProperties) {
+ DeviceState.Configuration deviceStateConfiguration = new DeviceState.Configuration.Builder(
+ identifier, name).setSystemProperties(systemProperties).setPhysicalProperties(
+ physicalProperties).build();
+ return new DeviceState(deviceStateConfiguration);
}
private static class FakeRotationPolicy implements RotationPolicyWrapper {
diff --git a/packages/SystemUI/tests/utils/src/com/android/systemui/DeviceStateManagerKosmos.kt b/packages/SystemUI/tests/utils/src/com/android/systemui/DeviceStateManagerKosmos.kt
new file mode 100644
index 000000000000..9c55820b797c
--- /dev/null
+++ b/packages/SystemUI/tests/utils/src/com/android/systemui/DeviceStateManagerKosmos.kt
@@ -0,0 +1,133 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.systemui
+
+import android.hardware.devicestate.DeviceState
+import android.hardware.devicestate.DeviceState.PROPERTY_FEATURE_REAR_DISPLAY
+import android.hardware.devicestate.DeviceState.PROPERTY_FOLDABLE_DISPLAY_CONFIGURATION_INNER_PRIMARY
+import android.hardware.devicestate.DeviceState.PROPERTY_FOLDABLE_DISPLAY_CONFIGURATION_OUTER_PRIMARY
+import android.hardware.devicestate.DeviceState.PROPERTY_FOLDABLE_HARDWARE_CONFIGURATION_FOLD_IN_CLOSED
+import android.hardware.devicestate.DeviceState.PROPERTY_FOLDABLE_HARDWARE_CONFIGURATION_FOLD_IN_HALF_OPEN
+import android.hardware.devicestate.DeviceState.PROPERTY_FOLDABLE_HARDWARE_CONFIGURATION_FOLD_IN_OPEN
+import android.hardware.devicestate.DeviceState.PROPERTY_POWER_CONFIGURATION_TRIGGER_SLEEP
+import android.hardware.devicestate.DeviceState.PROPERTY_POWER_CONFIGURATION_TRIGGER_WAKE
+import android.hardware.devicestate.DeviceStateManager
+import com.android.systemui.kosmos.Kosmos
+import org.mockito.kotlin.mock
+
+val Kosmos.deviceStateManager by Kosmos.Fixture { mock<DeviceStateManager>() }
+
+val Kosmos.defaultDeviceState by
+ Kosmos.Fixture {
+ DeviceState(DeviceState.Configuration.Builder(0 /* identifier */, "DEFAULT").build())
+ }
+
+val Kosmos.foldedDeviceStateList by
+ Kosmos.Fixture {
+ listOf(
+ DeviceState(
+ DeviceState.Configuration.Builder(0, "FOLDED_0")
+ .setSystemProperties(
+ setOf(
+ PROPERTY_FOLDABLE_DISPLAY_CONFIGURATION_OUTER_PRIMARY,
+ PROPERTY_POWER_CONFIGURATION_TRIGGER_SLEEP
+ )
+ )
+ .setPhysicalProperties(
+ setOf(PROPERTY_FOLDABLE_HARDWARE_CONFIGURATION_FOLD_IN_CLOSED)
+ )
+ .build()
+ ),
+ DeviceState(
+ DeviceState.Configuration.Builder(1, "FOLDED_1")
+ .setSystemProperties(
+ setOf(
+ PROPERTY_FOLDABLE_DISPLAY_CONFIGURATION_OUTER_PRIMARY,
+ PROPERTY_POWER_CONFIGURATION_TRIGGER_SLEEP
+ )
+ )
+ .setPhysicalProperties(
+ setOf(PROPERTY_FOLDABLE_HARDWARE_CONFIGURATION_FOLD_IN_CLOSED)
+ )
+ .build()
+ ),
+ DeviceState(
+ DeviceState.Configuration.Builder(2, "FOLDED_2")
+ .setSystemProperties(
+ setOf(
+ PROPERTY_FOLDABLE_DISPLAY_CONFIGURATION_OUTER_PRIMARY,
+ PROPERTY_POWER_CONFIGURATION_TRIGGER_SLEEP
+ )
+ )
+ .setPhysicalProperties(
+ setOf(PROPERTY_FOLDABLE_HARDWARE_CONFIGURATION_FOLD_IN_CLOSED)
+ )
+ .build()
+ )
+ )
+ }
+
+val Kosmos.halfFoldedDeviceState by
+ Kosmos.Fixture {
+ DeviceState(
+ DeviceState.Configuration.Builder(3 /* identifier */, "HALF_FOLDED")
+ .setSystemProperties(
+ setOf(
+ PROPERTY_FOLDABLE_DISPLAY_CONFIGURATION_INNER_PRIMARY,
+ PROPERTY_POWER_CONFIGURATION_TRIGGER_WAKE
+ )
+ )
+ .setPhysicalProperties(
+ setOf(PROPERTY_FOLDABLE_HARDWARE_CONFIGURATION_FOLD_IN_HALF_OPEN)
+ )
+ .build()
+ )
+ }
+
+val Kosmos.unfoldedDeviceState by
+ Kosmos.Fixture {
+ DeviceState(
+ DeviceState.Configuration.Builder(4 /* identifier */, "UNFOLDED")
+ .setSystemProperties(
+ setOf(
+ PROPERTY_FOLDABLE_DISPLAY_CONFIGURATION_INNER_PRIMARY,
+ PROPERTY_POWER_CONFIGURATION_TRIGGER_WAKE
+ )
+ )
+ .setPhysicalProperties(setOf(PROPERTY_FOLDABLE_HARDWARE_CONFIGURATION_FOLD_IN_OPEN))
+ .build()
+ )
+ }
+
+val Kosmos.rearDisplayDeviceState by
+ Kosmos.Fixture {
+ DeviceState(
+ DeviceState.Configuration.Builder(5 /* identifier */, "REAR_DISPLAY")
+ .setSystemProperties(
+ setOf(
+ PROPERTY_FOLDABLE_DISPLAY_CONFIGURATION_OUTER_PRIMARY,
+ PROPERTY_FEATURE_REAR_DISPLAY
+ )
+ )
+ .build()
+ )
+ }
+
+val Kosmos.unknownDeviceState by
+ Kosmos.Fixture {
+ DeviceState(DeviceState.Configuration.Builder(8 /* identifier */, "UNKNOWN").build())
+ }
diff --git a/packages/SystemUI/tests/utils/src/com/android/systemui/display/data/repository/PerDisplayStoreKosmos.kt b/packages/SystemUI/tests/utils/src/com/android/systemui/display/data/repository/PerDisplayStoreKosmos.kt
new file mode 100644
index 000000000000..e3797260ed6d
--- /dev/null
+++ b/packages/SystemUI/tests/utils/src/com/android/systemui/display/data/repository/PerDisplayStoreKosmos.kt
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.systemui.display.data.repository
+
+import com.android.systemui.kosmos.Kosmos
+import com.android.systemui.kosmos.applicationCoroutineScope
+import kotlinx.coroutines.CoroutineScope
+
+class FakePerDisplayStore(
+ backgroundApplicationScope: CoroutineScope,
+ displayRepository: DisplayRepository,
+) : PerDisplayStoreImpl<TestPerDisplayInstance>(backgroundApplicationScope, displayRepository) {
+
+ val removalActions = mutableListOf<TestPerDisplayInstance>()
+
+ override fun createInstanceForDisplay(displayId: Int): TestPerDisplayInstance {
+ return TestPerDisplayInstance(displayId)
+ }
+
+ override val instanceClass = TestPerDisplayInstance::class.java
+
+ override suspend fun onDisplayRemovalAction(instance: TestPerDisplayInstance) {
+ removalActions += instance
+ }
+}
+
+data class TestPerDisplayInstance(val displayId: Int)
+
+val Kosmos.fakePerDisplayStore by
+ Kosmos.Fixture {
+ FakePerDisplayStore(
+ backgroundApplicationScope = applicationCoroutineScope,
+ displayRepository = displayRepository,
+ )
+ }
diff --git a/packages/SystemUI/tests/utils/src/com/android/systemui/education/domain/interactor/KeyboardTouchpadEduInteractorKosmos.kt b/packages/SystemUI/tests/utils/src/com/android/systemui/education/domain/interactor/KeyboardTouchpadEduInteractorKosmos.kt
index 2d275f9e9691..3fd2503096b5 100644
--- a/packages/SystemUI/tests/utils/src/com/android/systemui/education/domain/interactor/KeyboardTouchpadEduInteractorKosmos.kt
+++ b/packages/SystemUI/tests/utils/src/com/android/systemui/education/domain/interactor/KeyboardTouchpadEduInteractorKosmos.kt
@@ -24,6 +24,7 @@ import com.android.systemui.keyboard.data.repository.keyboardRepository
import com.android.systemui.kosmos.Kosmos
import com.android.systemui.kosmos.testDispatcher
import com.android.systemui.kosmos.testScope
+import com.android.systemui.recents.OverviewProxyService
import com.android.systemui.touchpad.data.repository.touchpadRepository
import com.android.systemui.user.data.repository.userRepository
import org.mockito.kotlin.mock
@@ -38,27 +39,13 @@ var Kosmos.keyboardTouchpadEduInteractor by
testDispatcher,
keyboardRepository,
touchpadRepository,
- userRepository
+ userRepository,
),
- clock = fakeEduClock
+ tutorialSchedulerRepository,
+ mockOverviewProxyService,
+ clock = fakeEduClock,
)
}
+var Kosmos.mockOverviewProxyService by Kosmos.Fixture { mock<OverviewProxyService>() }
var Kosmos.mockEduInputManager by Kosmos.Fixture { mock<InputManager>() }
-
-var Kosmos.keyboardTouchpadEduStatsInteractor by
- Kosmos.Fixture {
- KeyboardTouchpadEduStatsInteractorImpl(
- backgroundScope = testScope.backgroundScope,
- contextualEducationInteractor = contextualEducationInteractor,
- inputDeviceRepository =
- UserInputDeviceRepository(
- testDispatcher,
- keyboardRepository,
- touchpadRepository,
- userRepository
- ),
- tutorialSchedulerRepository,
- fakeEduClock
- )
- }
diff --git a/packages/SystemUI/tests/utils/src/com/android/systemui/keyboard/shortcut/FakeShortcutHelperStartActivity.kt b/packages/SystemUI/tests/utils/src/com/android/systemui/fragments/FragmentServiceKosmos.kt
index 3190171b180d..c088685515fd 100644
--- a/packages/SystemUI/tests/utils/src/com/android/systemui/keyboard/shortcut/FakeShortcutHelperStartActivity.kt
+++ b/packages/SystemUI/tests/utils/src/com/android/systemui/fragments/FragmentServiceKosmos.kt
@@ -14,15 +14,11 @@
* limitations under the License.
*/
-package com.android.systemui.keyboard.shortcut
+package com.android.systemui.fragments
-import android.content.Intent
+import com.android.systemui.kosmos.Kosmos
+import org.mockito.kotlin.mock
-class FakeShortcutHelperStartActivity : (Intent) -> Unit {
+val Kosmos.mockFragmentService by Kosmos.Fixture { mock<FragmentService>() }
- val startIntents = mutableListOf<Intent>()
-
- override fun invoke(intent: Intent) {
- startIntents += intent
- }
-}
+var Kosmos.fragmentService by Kosmos.Fixture { mockFragmentService }
diff --git a/packages/SystemUI/tests/utils/src/com/android/systemui/keyboard/shortcut/KeyboardShortcutHelperKosmos.kt b/packages/SystemUI/tests/utils/src/com/android/systemui/keyboard/shortcut/KeyboardShortcutHelperKosmos.kt
index c2a03d46cd30..fbfaba60ebf0 100644
--- a/packages/SystemUI/tests/utils/src/com/android/systemui/keyboard/shortcut/KeyboardShortcutHelperKosmos.kt
+++ b/packages/SystemUI/tests/utils/src/com/android/systemui/keyboard/shortcut/KeyboardShortcutHelperKosmos.kt
@@ -33,7 +33,6 @@ import com.android.systemui.keyboard.shortcut.data.source.MultitaskingShortcutsS
import com.android.systemui.keyboard.shortcut.data.source.SystemShortcutsSource
import com.android.systemui.keyboard.shortcut.domain.interactor.ShortcutHelperCategoriesInteractor
import com.android.systemui.keyboard.shortcut.domain.interactor.ShortcutHelperStateInteractor
-import com.android.systemui.keyboard.shortcut.ui.ShortcutHelperActivityStarter
import com.android.systemui.keyboard.shortcut.ui.viewmodel.ShortcutHelperViewModel
import com.android.systemui.keyguard.data.repository.fakeCommandQueue
import com.android.systemui.kosmos.Kosmos
@@ -45,12 +44,7 @@ import com.android.systemui.settings.displayTracker
import com.android.systemui.settings.fakeUserTracker
var Kosmos.shortcutHelperAppCategoriesShortcutsSource: KeyboardShortcutGroupsSource by
- Kosmos.Fixture {
- AppCategoriesShortcutsSource(
- windowManager,
- testDispatcher,
- )
- }
+ Kosmos.Fixture { AppCategoriesShortcutsSource(windowManager, testDispatcher) }
var Kosmos.shortcutHelperSystemShortcutsSource: KeyboardShortcutGroupsSource by
Kosmos.Fixture { SystemShortcutsSource(mainResources) }
@@ -65,7 +59,7 @@ val Kosmos.shortcutHelperStateRepository by
broadcastDispatcher,
fakeInputManager.inputManager,
testScope,
- testDispatcher
+ testDispatcher,
)
}
@@ -109,7 +103,7 @@ val Kosmos.shortcutHelperStateInteractor by
displayTracker,
testScope,
sysUiState,
- shortcutHelperStateRepository
+ shortcutHelperStateRepository,
)
}
@@ -124,18 +118,6 @@ val Kosmos.shortcutHelperViewModel by
applicationCoroutineScope,
testDispatcher,
shortcutHelperStateInteractor,
- shortcutHelperCategoriesInteractor
- )
- }
-
-val Kosmos.fakeShortcutHelperStartActivity by Kosmos.Fixture { FakeShortcutHelperStartActivity() }
-
-val Kosmos.shortcutHelperActivityStarter by
- Kosmos.Fixture {
- ShortcutHelperActivityStarter(
- applicationContext,
- applicationCoroutineScope,
- shortcutHelperViewModel,
- fakeShortcutHelperStartActivity,
+ shortcutHelperCategoriesInteractor,
)
}
diff --git a/packages/SystemUI/tests/utils/src/com/android/systemui/keyguard/data/repository/FakeLightRevealScrimRepository.kt b/packages/SystemUI/tests/utils/src/com/android/systemui/keyguard/data/repository/FakeLightRevealScrimRepository.kt
index 805a710a2cf3..4181dc302049 100644
--- a/packages/SystemUI/tests/utils/src/com/android/systemui/keyguard/data/repository/FakeLightRevealScrimRepository.kt
+++ b/packages/SystemUI/tests/utils/src/com/android/systemui/keyguard/data/repository/FakeLightRevealScrimRepository.kt
@@ -40,6 +40,8 @@ class FakeLightRevealScrimRepository : LightRevealScrimRepository {
override val isAnimating: Boolean
get() = false
+ override val maxAlpha: MutableStateFlow<Float> = MutableStateFlow(1f)
+
override fun startRevealAmountAnimator(reveal: Boolean, duration: Long) {
if (reveal) {
_revealAmount.value = 1.0f
@@ -50,8 +52,5 @@ class FakeLightRevealScrimRepository : LightRevealScrimRepository {
revealAnimatorRequests.add(RevealAnimatorRequest(reveal, duration))
}
- data class RevealAnimatorRequest(
- val reveal: Boolean,
- val duration: Long
- )
+ data class RevealAnimatorRequest(val reveal: Boolean, val duration: Long)
}
diff --git a/packages/SystemUI/tests/utils/src/com/android/systemui/keyguard/domain/interactor/FromDreamingLockscreenHostedTransitionInteractorKosmos.kt b/packages/SystemUI/tests/utils/src/com/android/systemui/keyguard/domain/interactor/FromDreamingLockscreenHostedTransitionInteractorKosmos.kt
deleted file mode 100644
index 7ebef10b12c6..000000000000
--- a/packages/SystemUI/tests/utils/src/com/android/systemui/keyguard/domain/interactor/FromDreamingLockscreenHostedTransitionInteractorKosmos.kt
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright (C) 2024 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.systemui.keyguard.domain.interactor
-
-import com.android.systemui.keyguard.data.repository.keyguardTransitionRepository
-import com.android.systemui.kosmos.Kosmos
-import com.android.systemui.kosmos.applicationCoroutineScope
-import com.android.systemui.kosmos.testDispatcher
-import com.android.systemui.power.domain.interactor.powerInteractor
-import com.android.systemui.statusbar.domain.interactor.keyguardOcclusionInteractor
-
-var Kosmos.fromDreamingLockscreenHostedTransitionInteractor by
- Kosmos.Fixture {
- FromDreamingLockscreenHostedTransitionInteractor(
- transitionRepository = keyguardTransitionRepository,
- transitionInteractor = keyguardTransitionInteractor,
- internalTransitionInteractor = internalKeyguardTransitionInteractor,
- scope = applicationCoroutineScope,
- bgDispatcher = testDispatcher,
- mainDispatcher = testDispatcher,
- keyguardInteractor = keyguardInteractor,
- powerInteractor = powerInteractor,
- keyguardOcclusionInteractor = keyguardOcclusionInteractor,
- )
- }
diff --git a/packages/SystemUI/tests/utils/src/com/android/systemui/qs/composefragment/viewmodel/QSFragmentComposeViewModelKosmos.kt b/packages/SystemUI/tests/utils/src/com/android/systemui/qs/composefragment/viewmodel/QSFragmentComposeViewModelKosmos.kt
index c218ff6ba966..dff56257a93c 100644
--- a/packages/SystemUI/tests/utils/src/com/android/systemui/qs/composefragment/viewmodel/QSFragmentComposeViewModelKosmos.kt
+++ b/packages/SystemUI/tests/utils/src/com/android/systemui/qs/composefragment/viewmodel/QSFragmentComposeViewModelKosmos.kt
@@ -20,6 +20,7 @@ import android.content.res.mainResources
import androidx.lifecycle.LifecycleCoroutineScope
import com.android.systemui.common.ui.domain.interactor.configurationInteractor
import com.android.systemui.deviceentry.domain.interactor.deviceEntryInteractor
+import com.android.systemui.keyguard.domain.interactor.keyguardTransitionInteractor
import com.android.systemui.kosmos.Kosmos
import com.android.systemui.qs.footerActionsController
import com.android.systemui.qs.footerActionsViewModelFactory
@@ -30,7 +31,9 @@ import com.android.systemui.shade.largeScreenHeaderHelper
import com.android.systemui.shade.transition.largeScreenShadeInterpolator
import com.android.systemui.statusbar.disableflags.data.repository.disableFlagsRepository
import com.android.systemui.statusbar.sysuiStatusBarStateController
+import kotlinx.coroutines.ExperimentalCoroutinesApi
+@OptIn(ExperimentalCoroutinesApi::class)
val Kosmos.qsFragmentComposeViewModelFactory by
Kosmos.Fixture {
object : QSFragmentComposeViewModel.Factory {
@@ -45,6 +48,7 @@ val Kosmos.qsFragmentComposeViewModelFactory by
sysuiStatusBarStateController,
deviceEntryInteractor,
disableFlagsRepository,
+ keyguardTransitionInteractor,
largeScreenShadeInterpolator,
configurationInteractor,
largeScreenHeaderHelper,
diff --git a/packages/SystemUI/tests/utils/src/com/android/systemui/qs/panels/data/repository/QSColumnsRepositoryKosmos.kt b/packages/SystemUI/tests/utils/src/com/android/systemui/qs/panels/data/repository/QSColumnsRepositoryKosmos.kt
index 0ca025f53df4..742b79cc17d0 100644
--- a/packages/SystemUI/tests/utils/src/com/android/systemui/qs/panels/data/repository/QSColumnsRepositoryKosmos.kt
+++ b/packages/SystemUI/tests/utils/src/com/android/systemui/qs/panels/data/repository/QSColumnsRepositoryKosmos.kt
@@ -19,9 +19,6 @@ package com.android.systemui.qs.panels.data.repository
import android.content.res.mainResources
import com.android.systemui.common.ui.data.repository.configurationRepository
import com.android.systemui.kosmos.Kosmos
-import com.android.systemui.kosmos.applicationCoroutineScope
-val Kosmos.qsColumnsRepository by
- Kosmos.Fixture {
- QSColumnsRepository(applicationCoroutineScope, mainResources, configurationRepository)
- }
+var Kosmos.qsColumnsRepository by
+ Kosmos.Fixture { QSColumnsRepository(mainResources, configurationRepository) }
diff --git a/packages/SystemUI/tests/utils/src/com/android/systemui/qs/panels/domain/interactor/QSColumnsInteractorKosmos.kt b/packages/SystemUI/tests/utils/src/com/android/systemui/qs/panels/domain/interactor/QSColumnsInteractorKosmos.kt
index 02ed2648107b..47615f527d16 100644
--- a/packages/SystemUI/tests/utils/src/com/android/systemui/qs/panels/domain/interactor/QSColumnsInteractorKosmos.kt
+++ b/packages/SystemUI/tests/utils/src/com/android/systemui/qs/panels/domain/interactor/QSColumnsInteractorKosmos.kt
@@ -17,6 +17,11 @@
package com.android.systemui.qs.panels.domain.interactor
import com.android.systemui.kosmos.Kosmos
+import com.android.systemui.kosmos.applicationCoroutineScope
import com.android.systemui.qs.panels.data.repository.qsColumnsRepository
+import com.android.systemui.shade.domain.interactor.shadeInteractor
-val Kosmos.qsColumnsInteractor by Kosmos.Fixture { QSColumnsInteractor(qsColumnsRepository) }
+val Kosmos.qsColumnsInteractor by
+ Kosmos.Fixture {
+ QSColumnsInteractor(applicationCoroutineScope, qsColumnsRepository, shadeInteractor)
+ }
diff --git a/packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/core/StatusBarInitializerKosmos.kt b/packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/core/StatusBarInitializerKosmos.kt
index 8066b9138c99..303529b7f7b0 100644
--- a/packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/core/StatusBarInitializerKosmos.kt
+++ b/packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/core/StatusBarInitializerKosmos.kt
@@ -34,8 +34,8 @@ val Kosmos.multiDisplayStatusBarInitializerStore by
Kosmos.Fixture {
MultiDisplayStatusBarInitializerStore(
applicationCoroutineScope,
- fakeStatusBarInitializerFactory,
displayRepository,
+ fakeStatusBarInitializerFactory,
fakeStatusBarWindowControllerStore,
)
}
diff --git a/packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/phone/StatusBarContentInsetsProviderKosmos.kt b/packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/phone/StatusBarContentInsetsProviderKosmos.kt
new file mode 100644
index 000000000000..9c9673c3a924
--- /dev/null
+++ b/packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/phone/StatusBarContentInsetsProviderKosmos.kt
@@ -0,0 +1,25 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.systemui.statusbar.phone
+
+import com.android.systemui.kosmos.Kosmos
+import org.mockito.kotlin.mock
+
+val Kosmos.mockStatusBarContentInsetsProvider by
+ Kosmos.Fixture { mock<StatusBarContentInsetsProvider>() }
+
+var Kosmos.statusBarContentInsetsProvider by Kosmos.Fixture { mockStatusBarContentInsetsProvider }
diff --git a/packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/pipeline/shared/ui/viewmodel/CollapsedStatusBarViewModelKosmos.kt b/packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/pipeline/shared/ui/viewmodel/HomeStatusBarViewModelKosmos.kt
index 1c7fd4817498..3a7ada2e61b8 100644
--- a/packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/pipeline/shared/ui/viewmodel/CollapsedStatusBarViewModelKosmos.kt
+++ b/packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/pipeline/shared/ui/viewmodel/HomeStatusBarViewModelKosmos.kt
@@ -16,6 +16,7 @@
package com.android.systemui.statusbar.pipeline.shared.ui.viewmodel
+import com.android.systemui.keyguard.domain.interactor.keyguardInteractor
import com.android.systemui.keyguard.domain.interactor.keyguardTransitionInteractor
import com.android.systemui.kosmos.Kosmos
import com.android.systemui.kosmos.applicationCoroutineScope
@@ -27,13 +28,14 @@ import com.android.systemui.statusbar.notification.domain.interactor.activeNotif
import com.android.systemui.statusbar.phone.domain.interactor.lightsOutInteractor
import com.android.systemui.statusbar.pipeline.shared.domain.interactor.collapsedStatusBarInteractor
-val Kosmos.collapsedStatusBarViewModel: CollapsedStatusBarViewModel by
+val Kosmos.homeStatusBarViewModel: HomeStatusBarViewModel by
Kosmos.Fixture {
- CollapsedStatusBarViewModelImpl(
+ HomeStatusBarViewModelImpl(
collapsedStatusBarInteractor,
lightsOutInteractor,
activeNotificationsInteractor,
keyguardTransitionInteractor,
+ keyguardInteractor,
sceneInteractor,
sceneContainerOcclusionInteractor,
shadeInteractor,
diff --git a/packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/policy/ConfigurationControllerKosmos.kt b/packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/policy/ConfigurationControllerKosmos.kt
index d4e9bfbd1500..282f5947636c 100644
--- a/packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/policy/ConfigurationControllerKosmos.kt
+++ b/packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/policy/ConfigurationControllerKosmos.kt
@@ -17,8 +17,11 @@
package com.android.systemui.statusbar.policy
import com.android.systemui.kosmos.Kosmos
+import com.android.systemui.statusbar.data.repository.StatusBarConfigurationController
var Kosmos.configurationController: ConfigurationController by
Kosmos.Fixture { fakeConfigurationController }
val Kosmos.fakeConfigurationController: FakeConfigurationController by
Kosmos.Fixture { FakeConfigurationController() }
+val Kosmos.statusBarConfigurationController: StatusBarConfigurationController by
+ Kosmos.Fixture { fakeConfigurationController }
diff --git a/packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/policy/FakeConfigurationController.kt b/packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/policy/FakeConfigurationController.kt
index 46a10532ea52..6be13be407d8 100644
--- a/packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/policy/FakeConfigurationController.kt
+++ b/packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/policy/FakeConfigurationController.kt
@@ -2,13 +2,15 @@ package com.android.systemui.statusbar.policy
import android.content.res.Configuration
import com.android.systemui.dagger.SysUISingleton
+import com.android.systemui.statusbar.data.repository.StatusBarConfigurationController
import dagger.Binds
import dagger.Module
import javax.inject.Inject
/** Fake implementation of [ConfigurationController] for tests. */
@SysUISingleton
-class FakeConfigurationController @Inject constructor() : ConfigurationController {
+class FakeConfigurationController @Inject constructor() :
+ ConfigurationController, StatusBarConfigurationController {
private var listeners = mutableListOf<ConfigurationController.ConfigurationListener>()
private var isRtl = false
@@ -43,6 +45,7 @@ class FakeConfigurationController @Inject constructor() : ConfigurationControlle
}
override fun isLayoutRtl(): Boolean = isRtl
+
override fun getNightModeName(): String = "undefined"
}
diff --git a/packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/window/FakeStatusBarWindowControllerFactory.kt b/packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/window/FakeStatusBarWindowControllerFactory.kt
index 10f328be12d2..bca13c6f502d 100644
--- a/packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/window/FakeStatusBarWindowControllerFactory.kt
+++ b/packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/window/FakeStatusBarWindowControllerFactory.kt
@@ -18,10 +18,12 @@ package com.android.systemui.statusbar.window
import android.content.Context
import com.android.app.viewcapture.ViewCaptureAwareWindowManager
+import com.android.systemui.statusbar.data.repository.StatusBarConfigurationController
class FakeStatusBarWindowControllerFactory : StatusBarWindowController.Factory {
override fun create(
context: Context,
viewCaptureAwareWindowManager: ViewCaptureAwareWindowManager,
+ statusBarConfigurationController: StatusBarConfigurationController
) = FakeStatusBarWindowController()
}
diff --git a/packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/window/FakeStatusBarWindowViewInflater.kt b/packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/window/FakeStatusBarWindowViewInflater.kt
new file mode 100644
index 000000000000..138b4423d90f
--- /dev/null
+++ b/packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/window/FakeStatusBarWindowViewInflater.kt
@@ -0,0 +1,29 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.systemui.statusbar.window
+
+import android.content.Context
+import org.mockito.kotlin.mock
+
+class FakeStatusBarWindowViewInflater : StatusBarWindowViewInflater {
+
+ val inflatedMockViews = mutableListOf<StatusBarWindowView>()
+
+ override fun inflate(context: Context): StatusBarWindowView {
+ return mock<StatusBarWindowView>().also { inflatedMockViews += it }
+ }
+}
diff --git a/packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/window/StatusBarWindowControllerKosmos.kt b/packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/window/StatusBarWindowControllerKosmos.kt
index 78caf93d4618..173e909e3b3f 100644
--- a/packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/window/StatusBarWindowControllerKosmos.kt
+++ b/packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/window/StatusBarWindowControllerKosmos.kt
@@ -16,10 +16,31 @@
package com.android.systemui.statusbar.window
+import android.content.testableContext
+import android.view.windowManagerService
+import com.android.app.viewcapture.viewCaptureAwareWindowManager
+import com.android.systemui.fragments.fragmentService
import com.android.systemui.kosmos.Kosmos
+import com.android.systemui.statusbar.phone.statusBarContentInsetsProvider
+import com.android.systemui.statusbar.policy.statusBarConfigurationController
+import java.util.Optional
val Kosmos.fakeStatusBarWindowController by Kosmos.Fixture { FakeStatusBarWindowController() }
+val Kosmos.statusBarWindowControllerImpl by
+ Kosmos.Fixture {
+ StatusBarWindowControllerImpl(
+ testableContext,
+ statusBarWindowViewInflater,
+ viewCaptureAwareWindowManager,
+ statusBarConfigurationController,
+ windowManagerService,
+ statusBarContentInsetsProvider,
+ fragmentService,
+ Optional.empty(),
+ )
+ }
+
var Kosmos.statusBarWindowController: StatusBarWindowController by
Kosmos.Fixture { fakeStatusBarWindowController }
diff --git a/packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/window/StatusBarWindowViewKosmos.kt b/packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/window/StatusBarWindowViewKosmos.kt
new file mode 100644
index 000000000000..e7cf83f80243
--- /dev/null
+++ b/packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/window/StatusBarWindowViewKosmos.kt
@@ -0,0 +1,24 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.systemui.statusbar.window
+
+import com.android.systemui.kosmos.Kosmos
+
+val Kosmos.fakeStatusBarWindowViewInflater by Kosmos.Fixture { FakeStatusBarWindowViewInflater() }
+
+var Kosmos.statusBarWindowViewInflater: StatusBarWindowViewInflater by
+ Kosmos.Fixture { fakeStatusBarWindowViewInflater }
diff --git a/packages/SystemUI/tests/utils/src/com/android/systemui/volume/data/repository/AudioSystemRepositoryKosmos.kt b/packages/SystemUI/tests/utils/src/com/android/systemui/volume/data/repository/AudioSystemRepositoryKosmos.kt
new file mode 100644
index 000000000000..ec2bf24effbc
--- /dev/null
+++ b/packages/SystemUI/tests/utils/src/com/android/systemui/volume/data/repository/AudioSystemRepositoryKosmos.kt
@@ -0,0 +1,21 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.systemui.volume.data.repository
+
+import com.android.systemui.kosmos.Kosmos
+
+val Kosmos.audioSystemRepository by Kosmos.Fixture { FakeAudioSystemRepository() }
diff --git a/packages/SystemUI/tests/utils/src/com/android/systemui/volume/data/repository/FakeAudioSystemRepository.kt b/packages/SystemUI/tests/utils/src/com/android/systemui/volume/data/repository/FakeAudioSystemRepository.kt
new file mode 100644
index 000000000000..0ff4dec0e2ed
--- /dev/null
+++ b/packages/SystemUI/tests/utils/src/com/android/systemui/volume/data/repository/FakeAudioSystemRepository.kt
@@ -0,0 +1,28 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.systemui.volume.data.repository
+
+import com.android.settingslib.volume.data.repository.AudioSystemRepository
+
+class FakeAudioSystemRepository : AudioSystemRepository {
+
+ override var isSingleVolume = false
+
+ fun setIsSingleVolume(singleVolume: Boolean) {
+ isSingleVolume = singleVolume
+ }
+} \ No newline at end of file
diff --git a/packages/SystemUI/tests/utils/src/com/android/systemui/volume/panel/component/volume/domain/interactor/AudioSlidersInteractorKosmos.kt b/packages/SystemUI/tests/utils/src/com/android/systemui/volume/panel/component/volume/domain/interactor/AudioSlidersInteractorKosmos.kt
index dd5bbf37c0f1..3bc920edd948 100644
--- a/packages/SystemUI/tests/utils/src/com/android/systemui/volume/panel/component/volume/domain/interactor/AudioSlidersInteractorKosmos.kt
+++ b/packages/SystemUI/tests/utils/src/com/android/systemui/volume/panel/component/volume/domain/interactor/AudioSlidersInteractorKosmos.kt
@@ -18,6 +18,7 @@ package com.android.systemui.volume.panel.component.volume.domain.interactor
import com.android.systemui.kosmos.Kosmos
import com.android.systemui.kosmos.applicationCoroutineScope
+import com.android.systemui.volume.data.repository.audioSystemRepository
import com.android.systemui.volume.domain.interactor.audioModeInteractor
import com.android.systemui.volume.mediaOutputInteractor
@@ -27,5 +28,6 @@ val Kosmos.audioSlidersInteractor by
applicationCoroutineScope,
mediaOutputInteractor,
audioModeInteractor,
+ audioSystemRepository,
)
}
diff --git a/ravenwood/Android.bp b/ravenwood/Android.bp
index 8e884bc3484b..d9182010c1cb 100644
--- a/ravenwood/Android.bp
+++ b/ravenwood/Android.bp
@@ -124,6 +124,7 @@ java_library {
],
libs: [
"framework-minus-apex.ravenwood",
+ "framework-configinfrastructure.ravenwood",
"ravenwood-helper-libcore-runtime",
],
sdk_version: "core_current",
@@ -395,6 +396,9 @@ android_ravenwood_libgroup {
"icu4j-icudata-jarjar",
"icu4j-icutzdata-jarjar",
+ // DeviceConfig
+ "framework-configinfrastructure.ravenwood",
+
// Provide runtime versions of utils linked in below
"junit",
"truth",
diff --git a/ravenwood/Framework.bp b/ravenwood/Framework.bp
index 5cb1479514a3..1bea434f5b49 100644
--- a/ravenwood/Framework.bp
+++ b/ravenwood/Framework.bp
@@ -290,3 +290,57 @@ java_genrule {
"core-icu4j-for-host.ravenwood.jar",
],
}
+
+///////////////////////////////////
+// framework-configinfrastructure
+///////////////////////////////////
+
+java_genrule {
+ name: "framework-configinfrastructure.ravenwood-base",
+ tools: ["hoststubgen"],
+ cmd: "$(location hoststubgen) " +
+ "@$(location :ravenwood-standard-options) " +
+
+ "--debug-log $(location framework-configinfrastructure.log) " +
+ "--stats-file $(location framework-configinfrastructure_stats.csv) " +
+ "--supported-api-list-file $(location framework-configinfrastructure_apis.csv) " +
+ "--gen-keep-all-file $(location framework-configinfrastructure_keep_all.txt) " +
+ "--gen-input-dump-file $(location framework-configinfrastructure_dump.txt) " +
+
+ "--out-impl-jar $(location ravenwood.jar) " +
+ "--in-jar $(location :framework-configinfrastructure.impl{.jar}) " +
+
+ "--policy-override-file $(location :ravenwood-common-policies) " +
+ "--policy-override-file $(location :framework-configinfrastructure-ravenwood-policies) ",
+ srcs: [
+ ":framework-configinfrastructure.impl{.jar}",
+
+ ":ravenwood-common-policies",
+ ":framework-configinfrastructure-ravenwood-policies",
+ ":ravenwood-standard-options",
+ ],
+ out: [
+ "ravenwood.jar",
+
+ // Following files are created just as FYI.
+ "framework-configinfrastructure_keep_all.txt",
+ "framework-configinfrastructure_dump.txt",
+
+ "framework-configinfrastructure.log",
+ "framework-configinfrastructure_stats.csv",
+ "framework-configinfrastructure_apis.csv",
+ ],
+ visibility: ["//visibility:private"],
+}
+
+java_genrule {
+ name: "framework-configinfrastructure.ravenwood",
+ defaults: ["ravenwood-internal-only-visibility-genrule"],
+ cmd: "cp $(in) $(out)",
+ srcs: [
+ ":framework-configinfrastructure.ravenwood-base{ravenwood.jar}",
+ ],
+ out: [
+ "framework-configinfrastructure.ravenwood.jar",
+ ],
+}
diff --git a/ravenwood/junit-impl-src/android/platform/test/ravenwood/RavenwoodRuntimeEnvironmentController.java b/ravenwood/junit-impl-src/android/platform/test/ravenwood/RavenwoodRuntimeEnvironmentController.java
index afa7a6c51abb..9a145cb93811 100644
--- a/ravenwood/junit-impl-src/android/platform/test/ravenwood/RavenwoodRuntimeEnvironmentController.java
+++ b/ravenwood/junit-impl-src/android/platform/test/ravenwood/RavenwoodRuntimeEnvironmentController.java
@@ -40,6 +40,7 @@ import android.os.HandlerThread;
import android.os.Looper;
import android.os.ServiceManager;
import android.os.SystemProperties;
+import android.provider.DeviceConfig_host;
import android.system.ErrnoException;
import android.system.Os;
import android.util.Log;
@@ -136,9 +137,6 @@ public class RavenwoodRuntimeEnvironmentController {
private static RavenwoodConfig sConfig;
private static RavenwoodSystemProperties sProps;
- // TODO: use the real UiAutomation class instead of a mock
- private static UiAutomation sMockUiAutomation;
- private static Set<String> sAdoptedPermissions = Collections.emptySet();
private static boolean sInitialized = false;
/**
@@ -186,7 +184,6 @@ public class RavenwoodRuntimeEnvironmentController {
"androidx.test.internal.runner.junit4.AndroidJUnit4ClassRunner");
assertMockitoVersion();
- sMockUiAutomation = createMockUiAutomation();
}
/**
@@ -272,7 +269,7 @@ public class RavenwoodRuntimeEnvironmentController {
// Prepare other fields.
config.mInstrumentation = new Instrumentation();
- config.mInstrumentation.basicInit(instContext, targetContext, sMockUiAutomation);
+ config.mInstrumentation.basicInit(instContext, targetContext, createMockUiAutomation());
InstrumentationRegistry.registerInstance(config.mInstrumentation, Bundle.EMPTY);
RavenwoodSystemServer.init(config);
@@ -317,7 +314,6 @@ public class RavenwoodRuntimeEnvironmentController {
((RavenwoodContext) config.mTargetContext).cleanUp();
config.mTargetContext = null;
}
- sMockUiAutomation.dropShellPermissionIdentity();
Looper.getMainLooper().quit();
Looper.clearMainLooperForTest();
@@ -333,6 +329,8 @@ public class RavenwoodRuntimeEnvironmentController {
}
android.os.Process.reset$ravenwood();
+ DeviceConfig_host.reset();
+
try {
ResourcesManager.setInstance(null); // Better structure needed.
} catch (Exception e) {
@@ -418,28 +416,30 @@ public class RavenwoodRuntimeEnvironmentController {
() -> Class.forName("org.mockito.Matchers"));
}
+ // TODO: use the real UiAutomation class instead of a mock
private static UiAutomation createMockUiAutomation() {
+ final Set[] adoptedPermission = { Collections.emptySet() };
var mock = mock(UiAutomation.class, inv -> {
HostTestUtils.onThrowMethodCalled();
return null;
});
doAnswer(inv -> {
- sAdoptedPermissions = UiAutomation.ALL_PERMISSIONS;
+ adoptedPermission[0] = UiAutomation.ALL_PERMISSIONS;
return null;
}).when(mock).adoptShellPermissionIdentity();
doAnswer(inv -> {
if (inv.getArgument(0) == null) {
- sAdoptedPermissions = UiAutomation.ALL_PERMISSIONS;
+ adoptedPermission[0] = UiAutomation.ALL_PERMISSIONS;
} else {
- sAdoptedPermissions = (Set) Set.of(inv.getArguments());
+ adoptedPermission[0] = Set.of(inv.getArguments());
}
return null;
}).when(mock).adoptShellPermissionIdentity(any());
doAnswer(inv -> {
- sAdoptedPermissions = Collections.emptySet();
+ adoptedPermission[0] = Collections.emptySet();
return null;
}).when(mock).dropShellPermissionIdentity();
- doAnswer(inv -> sAdoptedPermissions).when(mock).getAdoptedShellPermissions();
+ doAnswer(inv -> adoptedPermission[0]).when(mock).getAdoptedShellPermissions();
return mock;
}
diff --git a/ravenwood/runtime-helper-src/framework/android/provider/DeviceConfig_host.java b/ravenwood/runtime-helper-src/framework/android/provider/DeviceConfig_host.java
new file mode 100644
index 000000000000..9c2188fd377a
--- /dev/null
+++ b/ravenwood/runtime-helper-src/framework/android/provider/DeviceConfig_host.java
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package android.provider;
+
+public class DeviceConfig_host {
+
+ /**
+ * Called by Ravenwood runtime to reset all local changes.
+ */
+ public static void reset() {
+ RavenwoodConfigDataStore.getInstance().clearAll();
+ }
+
+ /**
+ * Called by {@link DeviceConfig#newDataStore()}
+ */
+ public static DeviceConfigDataStore newDataStore() {
+ return RavenwoodConfigDataStore.getInstance();
+ }
+}
diff --git a/ravenwood/runtime-helper-src/framework/android/provider/RavenwoodConfigDataStore.java b/ravenwood/runtime-helper-src/framework/android/provider/RavenwoodConfigDataStore.java
new file mode 100644
index 000000000000..4bc3de79fe6b
--- /dev/null
+++ b/ravenwood/runtime-helper-src/framework/android/provider/RavenwoodConfigDataStore.java
@@ -0,0 +1,253 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package android.provider;
+
+import android.annotation.NonNull;
+import android.annotation.Nullable;
+import android.content.ContentResolver;
+import android.database.ContentObserver;
+import android.net.Uri;
+import android.os.Handler;
+import android.os.Looper;
+import android.provider.DeviceConfig.BadConfigException;
+import android.provider.DeviceConfig.MonitorCallback;
+import android.provider.DeviceConfig.Properties;
+
+import com.android.internal.annotations.GuardedBy;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.concurrent.Executor;
+
+/**
+ * {@link DeviceConfigDataStore} used only on Ravenwood.
+ *
+ * TODO(b/368591527) Support monitor callback related features
+ * TODO(b/368591527) Support "default" related features
+ */
+final class RavenwoodConfigDataStore implements DeviceConfigDataStore {
+ private static final RavenwoodConfigDataStore sInstance = new RavenwoodConfigDataStore();
+
+ private final Object mLock = new Object();
+
+ @GuardedBy("mLock")
+ private int mSyncDisabledMode = DeviceConfig.SYNC_DISABLED_MODE_NONE;
+
+ @GuardedBy("mLock")
+ private final HashMap<String, HashMap<String, String>> mStore = new HashMap<>();
+
+ private record ObserverInfo(String namespace, ContentObserver observer) {
+ }
+
+ @GuardedBy("mLock")
+ private final ArrayList<ObserverInfo> mObservers = new ArrayList<>();
+
+ static RavenwoodConfigDataStore getInstance() {
+ return sInstance;
+ }
+
+ private static void shouldNotBeCalled() {
+ throw new RuntimeException("shouldNotBeCalled");
+ }
+
+ void clearAll() {
+ synchronized (mLock) {
+ mSyncDisabledMode = DeviceConfig.SYNC_DISABLED_MODE_NONE;
+ mStore.clear();
+ }
+ }
+
+ @GuardedBy("mLock")
+ private HashMap<String, String> getNamespaceLocked(@NonNull String namespace) {
+ Objects.requireNonNull(namespace);
+ return mStore.computeIfAbsent(namespace, k -> new HashMap<>());
+ }
+
+ /** {@inheritDoc} */
+ @NonNull
+ @Override
+ public Map<String, String> getAllProperties() {
+ synchronized (mLock) {
+ var ret = new HashMap<String, String>();
+
+ for (var namespaceAndMap : mStore.entrySet()) {
+ for (var nameAndValue : namespaceAndMap.getValue().entrySet()) {
+ ret.put(namespaceAndMap.getKey() + "/" + nameAndValue.getKey(),
+ nameAndValue.getValue());
+ }
+ }
+ return ret;
+ }
+ }
+
+ /** {@inheritDoc} */
+ @NonNull
+ @Override
+ public Properties getProperties(@NonNull String namespace, @NonNull String... names) {
+ Objects.requireNonNull(namespace);
+
+ synchronized (mLock) {
+ var namespaceMap = getNamespaceLocked(namespace);
+
+ if (names.length == 0) {
+ return new Properties(namespace, Map.copyOf(namespaceMap));
+ } else {
+ var map = new HashMap<String, String>();
+ for (var name : names) {
+ Objects.requireNonNull(name);
+ map.put(name, namespaceMap.get(name));
+ }
+ return new Properties(namespace, map);
+ }
+ }
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public boolean setProperties(@NonNull Properties properties) throws BadConfigException {
+ Objects.requireNonNull(properties);
+
+ synchronized (mLock) {
+ var namespaceMap = getNamespaceLocked(properties.getNamespace());
+ for (var kv : properties.getPropertyValues().entrySet()) {
+ namespaceMap.put(
+ Objects.requireNonNull(kv.getKey()),
+ Objects.requireNonNull(kv.getValue())
+ );
+ }
+ notifyObserversLock(properties.getNamespace(),
+ properties.getKeyset().toArray(new String[0]));
+ }
+ return true;
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public boolean setProperty(@NonNull String namespace, @NonNull String name,
+ @Nullable String value, boolean makeDefault) {
+ Objects.requireNonNull(namespace);
+ Objects.requireNonNull(name);
+
+ synchronized (mLock) {
+ var namespaceMap = getNamespaceLocked(namespace);
+ namespaceMap.put(name, value);
+
+ // makeDefault not supported.
+ notifyObserversLock(namespace, new String[]{name});
+ }
+ return true;
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public boolean deleteProperty(@NonNull String namespace, @NonNull String name) {
+ Objects.requireNonNull(namespace);
+ Objects.requireNonNull(name);
+
+ synchronized (mLock) {
+ var namespaceMap = getNamespaceLocked(namespace);
+ if (namespaceMap.remove(name) != null) {
+ notifyObserversLock(namespace, new String[]{name});
+ }
+ }
+ return true;
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public void resetToDefaults(int resetMode, @Nullable String namespace) {
+ // not supported in DeviceConfig.java
+ shouldNotBeCalled();
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public void setSyncDisabledMode(int syncDisabledMode) {
+ synchronized (mLock) {
+ mSyncDisabledMode = syncDisabledMode;
+ }
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public int getSyncDisabledMode() {
+ synchronized (mLock) {
+ return mSyncDisabledMode;
+ }
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public void setMonitorCallback(@NonNull ContentResolver resolver, @NonNull Executor executor,
+ @NonNull MonitorCallback callback) {
+ // not supported in DeviceConfig.java
+ shouldNotBeCalled();
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public void clearMonitorCallback(@NonNull ContentResolver resolver) {
+ // not supported in DeviceConfig.java
+ shouldNotBeCalled();
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public void registerContentObserver(@NonNull String namespace, boolean notifyForescendants,
+ ContentObserver contentObserver) {
+ synchronized (mLock) {
+ mObservers.add(new ObserverInfo(
+ Objects.requireNonNull(namespace),
+ Objects.requireNonNull(contentObserver)
+ ));
+ }
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public void unregisterContentObserver(@NonNull ContentObserver contentObserver) {
+ synchronized (mLock) {
+ for (int i = mObservers.size() - 1; i >= 0; i--) {
+ if (mObservers.get(i).observer == contentObserver) {
+ mObservers.remove(i);
+ }
+ }
+ }
+ }
+
+ private static final Uri CONTENT_URI = Uri.parse("content://settings/config");
+
+ @GuardedBy("mLock")
+ private void notifyObserversLock(@NonNull String namespace, String[] keys) {
+ var urib = CONTENT_URI.buildUpon().appendPath(namespace);
+ for (var key : keys) {
+ urib.appendEncodedPath(key);
+ }
+ var uri = urib.build();
+
+ final var copy = List.copyOf(mObservers);
+ new Handler(Looper.getMainLooper()).post(() -> {
+ for (int i = copy.size() - 1; i >= 0; i--) {
+ if (copy.get(i).namespace.equals(namespace)) {
+ copy.get(i).observer.dispatchChange(false, uri);
+ }
+ }
+ });
+ }
+}
diff --git a/services/accessibility/OWNERS b/services/accessibility/OWNERS
index 0e35a409c82c..4e1175034b5b 100644
--- a/services/accessibility/OWNERS
+++ b/services/accessibility/OWNERS
@@ -2,10 +2,11 @@
# Android Accessibility Framework owners
danielnorman@google.com
-aarmaly@google.com
chunkulin@google.com
fuego@google.com
sallyyuen@google.com
+yingleiw@google.com
+caseyburkhardt@google.com
# Android Accessibility members who have OWNERS but should not be sent
# day-to-day changes for code review:
diff --git a/services/accessibility/accessibility.aconfig b/services/accessibility/accessibility.aconfig
index 7057cc361a1a..cb4e9949a8ff 100644
--- a/services/accessibility/accessibility.aconfig
+++ b/services/accessibility/accessibility.aconfig
@@ -192,6 +192,16 @@ flag {
}
flag {
+ name: "package_monitor_dedicated_thread"
+ namespace: "accessibility"
+ description: "Runs the A11yManagerService PackageMonitor on a dedicated thread"
+ bug: "348138695"
+ metadata {
+ purpose: PURPOSE_BUGFIX
+ }
+}
+
+flag {
name: "manager_package_monitor_logic_fix"
namespace: "accessibility"
description: "Corrects the return values of the HandleForceStop function"
diff --git a/services/accessibility/java/com/android/server/accessibility/AbstractAccessibilityServiceConnection.java b/services/accessibility/java/com/android/server/accessibility/AbstractAccessibilityServiceConnection.java
index 73b7b35ba9a7..3441d94facda 100644
--- a/services/accessibility/java/com/android/server/accessibility/AbstractAccessibilityServiceConnection.java
+++ b/services/accessibility/java/com/android/server/accessibility/AbstractAccessibilityServiceConnection.java
@@ -35,7 +35,6 @@ import static android.view.accessibility.AccessibilityNodeInfo.ACTION_CLICK;
import static android.view.accessibility.AccessibilityNodeInfo.ACTION_LONG_CLICK;
import static com.android.server.pm.UserManagerService.enforceCurrentUserIfVisibleBackgroundEnabled;
-import static com.android.window.flags.Flags.deleteCaptureDisplay;
import android.accessibilityservice.AccessibilityGestureEvent;
import android.accessibilityservice.AccessibilityService;
@@ -62,7 +61,6 @@ import android.graphics.ParcelableColorSpace;
import android.graphics.Region;
import android.hardware.HardwareBuffer;
import android.hardware.display.DisplayManager;
-import android.hardware.display.DisplayManagerInternal;
import android.hardware.usb.UsbDevice;
import android.os.Binder;
import android.os.Build;
@@ -104,7 +102,6 @@ import com.android.internal.inputmethod.IRemoteAccessibilityInputConnection;
import com.android.internal.os.SomeArgs;
import com.android.internal.util.DumpUtils;
import com.android.internal.util.function.pooled.PooledLambda;
-import com.android.server.LocalServices;
import com.android.server.accessibility.AccessibilityWindowManager.RemoteAccessibilityConnection;
import com.android.server.accessibility.magnification.MagnificationProcessor;
import com.android.server.wm.WindowManagerInternal;
@@ -1513,68 +1510,31 @@ abstract class AbstractAccessibilityServiceConnection extends IAccessibilityServ
return;
}
final long identity = Binder.clearCallingIdentity();
- if (deleteCaptureDisplay()) {
- try {
- ScreenCapture.ScreenCaptureListener screenCaptureListener = new
- ScreenCapture.ScreenCaptureListener(
- (screenshotBuffer, result) -> {
- if (screenshotBuffer != null && result == 0) {
- sendScreenshotSuccess(screenshotBuffer, callback);
- } else {
- sendScreenshotFailure(
- AccessibilityService.ERROR_TAKE_SCREENSHOT_INVALID_DISPLAY,
- callback);
- }
+ try {
+ ScreenCapture.ScreenCaptureListener screenCaptureListener = new
+ ScreenCapture.ScreenCaptureListener(
+ (screenshotBuffer, result) -> {
+ if (screenshotBuffer != null && result == 0) {
+ sendScreenshotSuccess(screenshotBuffer, callback);
+ } else {
+ sendScreenshotFailure(
+ AccessibilityService.ERROR_TAKE_SCREENSHOT_INVALID_DISPLAY,
+ callback);
}
- );
- mWindowManagerService.captureDisplay(displayId, null, screenCaptureListener);
- } catch (Exception e) {
- sendScreenshotFailure(AccessibilityService.ERROR_TAKE_SCREENSHOT_INVALID_DISPLAY,
- callback);
- } finally {
- Binder.restoreCallingIdentity(identity);
- }
- } else {
- try {
- mMainHandler.post(PooledLambda.obtainRunnable((nonArg) -> {
- final ScreenshotHardwareBuffer screenshotBuffer = LocalServices
- .getService(DisplayManagerInternal.class).userScreenshot(displayId);
- if (screenshotBuffer != null) {
- sendScreenshotSuccess(screenshotBuffer, callback);
- } else {
- sendScreenshotFailure(
- AccessibilityService.ERROR_TAKE_SCREENSHOT_INVALID_DISPLAY,
- callback);
}
- }, null).recycleOnUse());
- } finally {
- Binder.restoreCallingIdentity(identity);
- }
+ );
+ mWindowManagerService.captureDisplay(displayId, null, screenCaptureListener);
+ } catch (Exception e) {
+ sendScreenshotFailure(AccessibilityService.ERROR_TAKE_SCREENSHOT_INVALID_DISPLAY,
+ callback);
+ } finally {
+ Binder.restoreCallingIdentity(identity);
}
}
private void sendScreenshotSuccess(ScreenshotHardwareBuffer screenshotBuffer,
RemoteCallback callback) {
- if (deleteCaptureDisplay()) {
- mMainHandler.post(PooledLambda.obtainRunnable((nonArg) -> {
- final HardwareBuffer hardwareBuffer = screenshotBuffer.getHardwareBuffer();
- final ParcelableColorSpace colorSpace =
- new ParcelableColorSpace(screenshotBuffer.getColorSpace());
-
- final Bundle payload = new Bundle();
- payload.putInt(KEY_ACCESSIBILITY_SCREENSHOT_STATUS,
- AccessibilityService.TAKE_SCREENSHOT_SUCCESS);
- payload.putParcelable(KEY_ACCESSIBILITY_SCREENSHOT_HARDWAREBUFFER,
- hardwareBuffer);
- payload.putParcelable(KEY_ACCESSIBILITY_SCREENSHOT_COLORSPACE, colorSpace);
- payload.putLong(KEY_ACCESSIBILITY_SCREENSHOT_TIMESTAMP,
- SystemClock.uptimeMillis());
-
- // Send back the result.
- callback.sendResult(payload);
- hardwareBuffer.close();
- }, null).recycleOnUse());
- } else {
+ mMainHandler.post(PooledLambda.obtainRunnable((nonArg) -> {
final HardwareBuffer hardwareBuffer = screenshotBuffer.getHardwareBuffer();
final ParcelableColorSpace colorSpace =
new ParcelableColorSpace(screenshotBuffer.getColorSpace());
@@ -1591,7 +1551,7 @@ abstract class AbstractAccessibilityServiceConnection extends IAccessibilityServ
// Send back the result.
callback.sendResult(payload);
hardwareBuffer.close();
- }
+ }, null).recycleOnUse());
}
private void sendScreenshotFailure(@AccessibilityService.ScreenshotErrorCode int errorCode,
diff --git a/services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java b/services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java
index ec8908bc7c91..c6fe4971b9e5 100644
--- a/services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java
+++ b/services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java
@@ -116,6 +116,7 @@ import android.os.Binder;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
+import android.os.HandlerThread;
import android.os.IBinder;
import android.os.Looper;
import android.os.Message;
@@ -901,7 +902,19 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub
private void registerBroadcastReceivers() {
// package changes
mPackageMonitor = new ManagerPackageMonitor(this);
- mPackageMonitor.register(mContext, null, UserHandle.ALL, true);
+ final Looper packageMonitorLooper;
+ if (Flags.packageMonitorDedicatedThread()) {
+ // Use a dedicated thread because the default BackgroundThread used by PackageMonitor
+ // is shared by other components and can get busy, causing a delay and eventual ANR when
+ // responding to broadcasts sent to this PackageMonitor.
+ HandlerThread packageMonitorThread = new HandlerThread(LOG_TAG + " PackageMonitor",
+ Process.THREAD_PRIORITY_BACKGROUND);
+ packageMonitorThread.start();
+ packageMonitorLooper = packageMonitorThread.getLooper();
+ } else {
+ packageMonitorLooper = null;
+ }
+ mPackageMonitor.register(mContext, packageMonitorLooper, UserHandle.ALL, true);
// user change and unlock
IntentFilter intentFilter = new IntentFilter();
diff --git a/services/appfunctions/java/com/android/server/appfunctions/AppFunctionExecutors.java b/services/appfunctions/java/com/android/server/appfunctions/AppFunctionExecutors.java
index c3b7087a44c3..44ae1d1fbbbf 100644
--- a/services/appfunctions/java/com/android/server/appfunctions/AppFunctionExecutors.java
+++ b/services/appfunctions/java/com/android/server/appfunctions/AppFunctionExecutors.java
@@ -31,7 +31,8 @@ public final class AppFunctionExecutors {
/* maxConcurrency= */ Runtime.getRuntime().availableProcessors(),
/* keepAliveTime= */ 0L,
/* unit= */ TimeUnit.SECONDS,
- /* workQueue= */ new LinkedBlockingQueue<>());
+ /* workQueue= */ new LinkedBlockingQueue<>(),
+ new NamedThreadFactory("AppFunctionExecutors"));
private AppFunctionExecutors() {}
}
diff --git a/services/appfunctions/java/com/android/server/appfunctions/MetadataSyncAdapter.java b/services/appfunctions/java/com/android/server/appfunctions/MetadataSyncAdapter.java
index 96be76975e9d..cc73288cdbfa 100644
--- a/services/appfunctions/java/com/android/server/appfunctions/MetadataSyncAdapter.java
+++ b/services/appfunctions/java/com/android/server/appfunctions/MetadataSyncAdapter.java
@@ -84,7 +84,9 @@ public class MetadataSyncAdapter {
@NonNull PackageManager packageManager, @NonNull AppSearchManager appSearchManager) {
mPackageManager = Objects.requireNonNull(packageManager);
mAppSearchManager = Objects.requireNonNull(appSearchManager);
- mExecutor = Executors.newSingleThreadExecutor();
+ mExecutor =
+ Executors.newSingleThreadExecutor(
+ new NamedThreadFactory("AppFunctionSyncExecutors"));
}
/**
diff --git a/services/appfunctions/java/com/android/server/appfunctions/NamedThreadFactory.java b/services/appfunctions/java/com/android/server/appfunctions/NamedThreadFactory.java
new file mode 100644
index 000000000000..7adcc48a6a35
--- /dev/null
+++ b/services/appfunctions/java/com/android/server/appfunctions/NamedThreadFactory.java
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.server.appfunctions;
+
+import java.util.concurrent.Executors;
+import java.util.concurrent.ThreadFactory;
+import java.util.concurrent.atomic.AtomicInteger;
+
+/** A {@link ThreadFactory} that creates threads with a given base name. */
+public class NamedThreadFactory implements ThreadFactory {
+ private final ThreadFactory mDefaultThreadFactory;
+ private final String mBaseName;
+ private final AtomicInteger mCount = new AtomicInteger(0);
+
+ public NamedThreadFactory(final String baseName) {
+ mDefaultThreadFactory = Executors.defaultThreadFactory();
+ mBaseName = baseName;
+ }
+
+ @Override
+ public Thread newThread(Runnable runnable) {
+ final Thread thread = mDefaultThreadFactory.newThread(runnable);
+ thread.setName(mBaseName + "-" + mCount.getAndIncrement());
+ return thread;
+ }
+}
diff --git a/services/companion/java/com/android/server/companion/transport/CompanionTransportManager.java b/services/companion/java/com/android/server/companion/transport/CompanionTransportManager.java
index 91ba9b3749fd..74908a4613be 100644
--- a/services/companion/java/com/android/server/companion/transport/CompanionTransportManager.java
+++ b/services/companion/java/com/android/server/companion/transport/CompanionTransportManager.java
@@ -39,7 +39,9 @@ import java.io.IOException;
import java.io.PrintWriter;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
+import java.util.HashSet;
import java.util.List;
+import java.util.Set;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.Future;
@@ -59,9 +61,12 @@ public class CompanionTransportManager {
@GuardedBy("mTransportsListeners")
private final RemoteCallbackList<IOnTransportsChangedListener> mTransportsListeners =
new RemoteCallbackList<>();
+
/** Message type -> IOnMessageReceivedListener */
+ @GuardedBy("mMessageListeners")
@NonNull
- private final SparseArray<IOnMessageReceivedListener> mMessageListeners = new SparseArray<>();
+ private final SparseArray<Set<IOnMessageReceivedListener>> mMessageListeners =
+ new SparseArray<>();
public CompanionTransportManager(Context context, AssociationStore associationStore) {
mContext = context;
@@ -72,7 +77,12 @@ public class CompanionTransportManager {
* Add a listener to receive callbacks when a message is received for the message type
*/
public void addListener(int message, @NonNull IOnMessageReceivedListener listener) {
- mMessageListeners.put(message, listener);
+ synchronized (mMessageListeners) {
+ if (!mMessageListeners.contains(message)) {
+ mMessageListeners.put(message, new HashSet<IOnMessageReceivedListener>());
+ }
+ mMessageListeners.get(message).add(listener);
+ }
synchronized (mTransports) {
for (int i = 0; i < mTransports.size(); i++) {
mTransports.valueAt(i).addListener(message, listener);
@@ -113,7 +123,12 @@ public class CompanionTransportManager {
* Remove the listener to stop receiving calbacks when a message is received for the given type
*/
public void removeListener(int messageType, IOnMessageReceivedListener listener) {
- mMessageListeners.remove(messageType);
+ synchronized (mMessageListeners) {
+ if (!mMessageListeners.contains(messageType)) {
+ return;
+ }
+ mMessageListeners.get(messageType).remove(listener);
+ }
}
/**
@@ -315,8 +330,12 @@ public class CompanionTransportManager {
}
private void addMessageListenersToTransport(Transport transport) {
- for (int i = 0; i < mMessageListeners.size(); i++) {
- transport.addListener(mMessageListeners.keyAt(i), mMessageListeners.valueAt(i));
+ synchronized (mMessageListeners) {
+ for (int i = 0; i < mMessageListeners.size(); i++) {
+ for (IOnMessageReceivedListener listener : mMessageListeners.valueAt(i)) {
+ transport.addListener(mMessageListeners.keyAt(i), listener);
+ }
+ }
}
}
diff --git a/services/companion/java/com/android/server/companion/transport/Transport.java b/services/companion/java/com/android/server/companion/transport/Transport.java
index 8a5774e55ce2..986bd6c91e17 100644
--- a/services/companion/java/com/android/server/companion/transport/Transport.java
+++ b/services/companion/java/com/android/server/companion/transport/Transport.java
@@ -40,8 +40,8 @@ import libcore.util.EmptyArray;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
-import java.util.HashMap;
-import java.util.Map;
+import java.util.HashSet;
+import java.util.Set;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.Future;
import java.util.concurrent.atomic.AtomicInteger;
@@ -71,7 +71,8 @@ public abstract class Transport {
* the future to allow multiple listeners to receive callbacks for the same message type, the
* value of the map can be a list.
*/
- private final Map<Integer, IOnMessageReceivedListener> mListeners;
+ @GuardedBy("mListeners")
+ private final SparseArray<Set<IOnMessageReceivedListener>> mListeners = new SparseArray<>();
private OnTransportClosedListener mOnTransportClosed;
@@ -98,7 +99,6 @@ public abstract class Transport {
mRemoteIn = new ParcelFileDescriptor.AutoCloseInputStream(fd);
mRemoteOut = new ParcelFileDescriptor.AutoCloseOutputStream(fd);
mContext = context;
- mListeners = new HashMap<>();
}
/**
@@ -107,7 +107,12 @@ public abstract class Transport {
* @param listener Execute when a message with the type is received
*/
public void addListener(int message, IOnMessageReceivedListener listener) {
- mListeners.put(message, listener);
+ synchronized (mListeners) {
+ if (!mListeners.contains(message)) {
+ mListeners.put(message, new HashSet<IOnMessageReceivedListener>());
+ }
+ mListeners.get(message).add(listener);
+ }
}
public int getAssociationId() {
@@ -281,12 +286,19 @@ public abstract class Transport {
}
private void callback(int message, byte[] data) {
- if (mListeners.containsKey(message)) {
+ Set<IOnMessageReceivedListener> listenersToCall;
+ synchronized (mListeners) {
+ if (!mListeners.contains(message)) {
+ return;
+ }
+ listenersToCall = mListeners.get(message);
+ }
+ Slog.d(TAG, "Message 0x" + Integer.toHexString(message)
+ + " is received from associationId " + mAssociationId
+ + ", sending data length " + data.length + " to the listener(s).");
+ for (IOnMessageReceivedListener listener: listenersToCall) {
try {
- mListeners.get(message).onMessageReceived(getAssociationId(), data);
- Slog.d(TAG, "Message 0x" + Integer.toHexString(message)
- + " is received from associationId " + mAssociationId
- + ", sending data length " + data.length + " to the listener.");
+ listener.onMessageReceived(getAssociationId(), data);
} catch (RemoteException ignored) {
}
}
diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java
index 746c55f8fc9d..217ef205a3e8 100644
--- a/services/core/java/com/android/server/am/ActivityManagerService.java
+++ b/services/core/java/com/android/server/am/ActivityManagerService.java
@@ -134,7 +134,6 @@ import static android.security.Flags.preventIntentRedirect;
import static android.util.FeatureFlagUtils.SETTINGS_ENABLE_MONITOR_PHANTOM_PROCS;
import static android.view.Display.INVALID_DISPLAY;
-import static com.android.internal.protolog.WmProtoLogGroups.WM_DEBUG_CONFIGURATION;
import static com.android.internal.util.FrameworkStatsLog.UNSAFE_INTENT_EVENT_REPORTED__EVENT_TYPE__NEW_MUTABLE_IMPLICIT_PENDING_INTENT_RETRIEVED;
import static com.android.sdksandbox.flags.Flags.sdkSandboxInstrumentationInfo;
import static com.android.server.am.ActiveServices.FGS_SAW_RESTRICTIONS;
@@ -415,7 +414,6 @@ import com.android.internal.os.TransferPipe;
import com.android.internal.os.Zygote;
import com.android.internal.pm.pkg.parsing.ParsingPackageUtils;
import com.android.internal.policy.AttributeCache;
-import com.android.internal.protolog.ProtoLog;
import com.android.internal.util.DumpUtils;
import com.android.internal.util.FastPrintWriter;
import com.android.internal.util.FrameworkStatsLog;
@@ -2759,8 +2757,11 @@ public class ActivityManagerService extends IActivityManager.Stub
if (isolated) {
if (mIsolatedAppBindArgs == null) {
mIsolatedAppBindArgs = new ArrayMap<>(1);
+ // See b/79378449 about the following exemption.
addServiceToMap(mIsolatedAppBindArgs, "package");
- addServiceToMap(mIsolatedAppBindArgs, "permissionmgr");
+ if (!android.server.Flags.removeJavaServiceManagerCache()) {
+ addServiceToMap(mIsolatedAppBindArgs, "permissionmgr");
+ }
}
return mIsolatedAppBindArgs;
}
@@ -2771,27 +2772,33 @@ public class ActivityManagerService extends IActivityManager.Stub
// Add common services.
// IMPORTANT: Before adding services here, make sure ephemeral apps can access them too.
// Enable the check in ApplicationThread.bindApplication() to make sure.
+ if (!android.server.Flags.removeJavaServiceManagerCache()) {
+ addServiceToMap(mAppBindArgs, "permissionmgr");
+ addServiceToMap(mAppBindArgs, Context.ALARM_SERVICE);
+ addServiceToMap(mAppBindArgs, Context.DISPLAY_SERVICE);
+ addServiceToMap(mAppBindArgs, Context.NETWORKMANAGEMENT_SERVICE);
+ addServiceToMap(mAppBindArgs, Context.CONNECTIVITY_SERVICE);
+ addServiceToMap(mAppBindArgs, Context.ACCESSIBILITY_SERVICE);
+ addServiceToMap(mAppBindArgs, Context.INPUT_METHOD_SERVICE);
+ addServiceToMap(mAppBindArgs, Context.INPUT_SERVICE);
+ addServiceToMap(mAppBindArgs, "graphicsstats");
+ addServiceToMap(mAppBindArgs, Context.APP_OPS_SERVICE);
+ addServiceToMap(mAppBindArgs, "content");
+ addServiceToMap(mAppBindArgs, Context.JOB_SCHEDULER_SERVICE);
+ addServiceToMap(mAppBindArgs, Context.NOTIFICATION_SERVICE);
+ addServiceToMap(mAppBindArgs, Context.VIBRATOR_SERVICE);
+ addServiceToMap(mAppBindArgs, Context.ACCOUNT_SERVICE);
+ addServiceToMap(mAppBindArgs, Context.POWER_SERVICE);
+ addServiceToMap(mAppBindArgs, Context.USER_SERVICE);
+ addServiceToMap(mAppBindArgs, "mount");
+ addServiceToMap(mAppBindArgs, Context.PLATFORM_COMPAT_SERVICE);
+ }
+ // See b/79378449
+ // Getting the window service and package service binder from servicemanager
+ // is blocked for Apps. However they are necessary for apps.
+ // TODO: remove exception
addServiceToMap(mAppBindArgs, "package");
- addServiceToMap(mAppBindArgs, "permissionmgr");
addServiceToMap(mAppBindArgs, Context.WINDOW_SERVICE);
- addServiceToMap(mAppBindArgs, Context.ALARM_SERVICE);
- addServiceToMap(mAppBindArgs, Context.DISPLAY_SERVICE);
- addServiceToMap(mAppBindArgs, Context.NETWORKMANAGEMENT_SERVICE);
- addServiceToMap(mAppBindArgs, Context.CONNECTIVITY_SERVICE);
- addServiceToMap(mAppBindArgs, Context.ACCESSIBILITY_SERVICE);
- addServiceToMap(mAppBindArgs, Context.INPUT_METHOD_SERVICE);
- addServiceToMap(mAppBindArgs, Context.INPUT_SERVICE);
- addServiceToMap(mAppBindArgs, "graphicsstats");
- addServiceToMap(mAppBindArgs, Context.APP_OPS_SERVICE);
- addServiceToMap(mAppBindArgs, "content");
- addServiceToMap(mAppBindArgs, Context.JOB_SCHEDULER_SERVICE);
- addServiceToMap(mAppBindArgs, Context.NOTIFICATION_SERVICE);
- addServiceToMap(mAppBindArgs, Context.VIBRATOR_SERVICE);
- addServiceToMap(mAppBindArgs, Context.ACCOUNT_SERVICE);
- addServiceToMap(mAppBindArgs, Context.POWER_SERVICE);
- addServiceToMap(mAppBindArgs, Context.USER_SERVICE);
- addServiceToMap(mAppBindArgs, "mount");
- addServiceToMap(mAppBindArgs, Context.PLATFORM_COMPAT_SERVICE);
}
return mAppBindArgs;
}
@@ -4654,8 +4661,6 @@ public class ActivityManagerService extends IActivityManager.Stub
notifyPackageUse(instr.mClass.getPackageName(),
PackageManager.NOTIFY_PACKAGE_USE_INSTRUMENTATION);
}
- ProtoLog.v(WM_DEBUG_CONFIGURATION, "Binding proc %s with config %s",
- processName, app.getWindowProcessController().getConfiguration());
ApplicationInfo appInfo = instr != null ? instr.mTargetInfo : app.info;
ProfilerInfo profilerInfo = mAppProfiler.setupProfilerInfoLocked(thread, app, instr);
diff --git a/services/core/java/com/android/server/am/ActivityManagerShellCommand.java b/services/core/java/com/android/server/am/ActivityManagerShellCommand.java
index 210301ec4c5e..02e2c391bb27 100644
--- a/services/core/java/com/android/server/am/ActivityManagerShellCommand.java
+++ b/services/core/java/com/android/server/am/ActivityManagerShellCommand.java
@@ -110,6 +110,7 @@ import android.os.SystemClock;
import android.os.Trace;
import android.os.UserHandle;
import android.os.UserManager;
+import android.os.ZygoteProcess;
import android.text.TextUtils;
import android.util.ArrayMap;
import android.util.ArraySet;
@@ -442,6 +443,8 @@ final class ActivityManagerShellCommand extends ShellCommand {
return runSetForegroundServiceDelegate(pw);
case "capabilities":
return runCapabilities(pw);
+ case "set-app-zygote-preload-timeout":
+ return runSetAppZygotePreloadTimeout(pw);
default:
return handleDefaultCommands(cmd);
}
@@ -451,6 +454,15 @@ final class ActivityManagerShellCommand extends ShellCommand {
return -1;
}
+ int runSetAppZygotePreloadTimeout(PrintWriter pw) throws RemoteException {
+ final String timeout = getNextArgRequired();
+ final int timeoutMs = Integer.parseInt(timeout);
+
+ ZygoteProcess.setAppZygotePreloadTimeout(timeoutMs);
+
+ return 0;
+ }
+
int runCapabilities(PrintWriter pw) throws RemoteException {
final PrintWriter err = getErrPrintWriter();
boolean outputAsProtobuf = false;
@@ -4623,6 +4635,8 @@ final class ActivityManagerShellCommand extends ShellCommand {
pw.println(" capabilities [--protobuf]");
pw.println(" Output am supported features (text format). Options are:");
pw.println(" --protobuf: format output using protobuffer");
+ pw.println(" set-app-zygote-preload-timeout <TIMEOUT_IN_MS>");
+ pw.println(" Set the timeout for preloading code in the app-zygote");
Intent.printIntentArgsHelp(pw, "");
}
}
diff --git a/services/core/java/com/android/server/am/BatteryStatsService.java b/services/core/java/com/android/server/am/BatteryStatsService.java
index 592d89eca285..c47cad955202 100644
--- a/services/core/java/com/android/server/am/BatteryStatsService.java
+++ b/services/core/java/com/android/server/am/BatteryStatsService.java
@@ -196,6 +196,7 @@ public final class BatteryStatsService extends IBatteryStats.Stub
private final PowerAttributor mPowerAttributor;
private volatile boolean mMonitorEnabled = true;
+ private boolean mRailsStatsCollectionEnabled = true;
private native void getRailEnergyPowerStats(RailStats railStats);
private CharsetDecoder mDecoderStat = StandardCharsets.UTF_8
@@ -312,8 +313,17 @@ public final class BatteryStatsService extends IBatteryStats.Stub
}
}
+ public void setRailsStatsCollectionEnabled(boolean railsStatsCollectionEnabled) {
+ mRailsStatsCollectionEnabled = railsStatsCollectionEnabled;
+ }
+
@Override
public void fillRailDataStats(RailStats railStats) {
+ if (!mRailsStatsCollectionEnabled) {
+ railStats.setRailStatsAvailability(false);
+ return;
+ }
+
if (DBG) Slog.d(TAG, "begin getRailEnergyPowerStats");
try {
getRailEnergyPowerStats(railStats);
@@ -423,7 +433,7 @@ public final class BatteryStatsService extends IBatteryStats.Stub
mStats = new BatteryStatsImpl(mBatteryStatsConfig, Clock.SYSTEM_CLOCK, mMonotonicClock,
systemDir, mHandler, this, this, mUserManagerUserInfoProvider, mPowerProfile,
mCpuScalingPolicies, mPowerStatsUidResolver);
- mWorker = new BatteryExternalStatsWorker(context, mStats);
+ mWorker = new BatteryExternalStatsWorker(context, mStats, mHandler);
mStats.setExternalStatsSyncLocked(mWorker);
mStats.setRadioScanningTimeoutLocked(mContext.getResources().getInteger(
com.android.internal.R.integer.config_radioScanningTimeout) * 1000L);
@@ -436,9 +446,12 @@ public final class BatteryStatsService extends IBatteryStats.Stub
mCpuScalingPolicies, () -> mStats.getBatteryCapacity(),
mPowerStatsUidResolver);
mPowerStatsScheduler = createPowerStatsScheduler(mContext);
+
+ int accumulatedBatteryUsageStatsSpanSize = mContext.getResources().getInteger(
+ com.android.internal.R.integer.config_accumulatedBatteryUsageStatsSpanSize);
mBatteryUsageStatsProvider = new BatteryUsageStatsProvider(context,
mPowerAttributor, mPowerProfile, mCpuScalingPolicies,
- mPowerStatsStore, Clock.SYSTEM_CLOCK);
+ mPowerStatsStore, accumulatedBatteryUsageStatsSpanSize, Clock.SYSTEM_CLOCK);
mDumpHelper = new BatteryStatsDumpHelperImpl(mBatteryUsageStatsProvider);
mCpuWakeupStats = new CpuWakeupStats(context, R.xml.irq_device_map, mHandler);
mConfigFile = new AtomicFile(new File(systemDir, "battery_usage_stats_config"));
@@ -506,7 +519,7 @@ public final class BatteryStatsService extends IBatteryStats.Stub
public void systemServicesReady() {
mStats.saveBatteryUsageStatsOnReset(mBatteryUsageStatsProvider, mPowerStatsStore,
- Flags.accumulateBatteryUsageStats());
+ isBatteryUsageStatsAccumulationSupported());
MultiStatePowerAttributor attributor = (MultiStatePowerAttributor) mPowerAttributor;
mStats.setPowerStatsCollectorEnabled(BatteryConsumer.POWER_COMPONENT_CPU,
@@ -588,6 +601,12 @@ public final class BatteryStatsService extends IBatteryStats.Stub
BatteryConsumer.POWER_COMPONENT_CAMERA,
Flags.streamlinedMiscBatteryStats());
+ // Currently unimplemented.
+ mStats.setPowerStatsCollectorEnabled(BatteryConsumer.POWER_COMPONENT_MEMORY,
+ Flags.streamlinedMiscBatteryStats());
+ attributor.setPowerComponentSupported(BatteryConsumer.POWER_COMPONENT_MEMORY,
+ Flags.streamlinedMiscBatteryStats());
+
// By convention POWER_COMPONENT_ANY represents custom Energy Consumers
mStats.setPowerStatsCollectorEnabled(BatteryConsumer.POWER_COMPONENT_ANY,
Flags.streamlinedMiscBatteryStats());
@@ -631,6 +650,13 @@ public final class BatteryStatsService extends IBatteryStats.Stub
registerStatsCallbacks();
}
+ private static boolean isBatteryUsageStatsAccumulationSupported() {
+ return Flags.accumulateBatteryUsageStats()
+ && Flags.streamlinedBatteryStats()
+ && Flags.streamlinedConnectivityBatteryStats()
+ && Flags.streamlinedMiscBatteryStats();
+ }
+
/**
* Notifies BatteryStatsService that the system server is ready.
*/
@@ -776,7 +802,8 @@ public final class BatteryStatsService extends IBatteryStats.Stub
private void syncStats(String reason, int flags) {
mStats.collectPowerStatsSamples();
- awaitUninterruptibly(mWorker.scheduleSync(reason, flags));
+ mWorker.scheduleSync(reason, flags);
+ awaitCompletion();
}
private void awaitCompletion() {
@@ -1135,7 +1162,7 @@ public final class BatteryStatsService extends IBatteryStats.Stub
.includeVirtualUids()
.setMinConsumedPowerThreshold(minConsumedPowerThreshold);
- if (Flags.accumulateBatteryUsageStats()) {
+ if (isBatteryUsageStatsAccumulationSupported()) {
query.accumulated();
}
@@ -3054,7 +3081,7 @@ public final class BatteryStatsService extends IBatteryStats.Stub
if (Flags.streamlinedBatteryStats()) {
pw.println(" --sample: collect and dump a sample of stats for debugging purpose");
}
- if (Flags.accumulateBatteryUsageStats()) {
+ if (isBatteryUsageStatsAccumulationSupported()) {
pw.println(" --accumulated: continuously accumulated since setup or reset-all");
}
pw.println(" <package.name>: optional name of package to filter output by.");
@@ -3670,24 +3697,12 @@ public final class BatteryStatsService extends IBatteryStats.Stub
android.Manifest.permission.BATTERY_STATS, null);
}
- Future future;
if (shouldCollectExternalStats()) {
- future = mWorker.scheduleSync("get-health-stats-for-uids",
+ mWorker.scheduleSync("get-health-stats-for-uids",
BatteryExternalStatsWorker.UPDATE_ALL);
- } else {
- future = null;
}
mHandler.post(() -> {
- if (future != null) {
- try {
- // Worker uses a separate thread pool, so waiting here won't cause a deadlock
- future.get();
- } catch (InterruptedException | ExecutionException e) {
- Slog.e(TAG, "Sync failed", e);
- }
- }
-
final long ident = Binder.clearCallingIdentity();
int i = -1;
try {
diff --git a/services/core/java/com/android/server/am/BroadcastController.java b/services/core/java/com/android/server/am/BroadcastController.java
index 15f1085b7125..a00cac6aba4f 100644
--- a/services/core/java/com/android/server/am/BroadcastController.java
+++ b/services/core/java/com/android/server/am/BroadcastController.java
@@ -258,6 +258,7 @@ class BroadcastController {
final StringBuilder sb = new StringBuilder("registerReceiver: ");
sb.append(Binder.getCallingUid()); sb.append('/');
sb.append(receiverId == null ? "null" : receiverId); sb.append('/');
+ sb.append("p:"); sb.append(filter.getPriority()); sb.append('/');
final int actionsCount = filter.safeCountActions();
if (actionsCount > 0) {
for (int i = 0; i < actionsCount; ++i) {
diff --git a/services/core/java/com/android/server/am/ContentProviderConnection.java b/services/core/java/com/android/server/am/ContentProviderConnection.java
index ae5ae0133e1b..4f0ea51bac2a 100644
--- a/services/core/java/com/android/server/am/ContentProviderConnection.java
+++ b/services/core/java/com/android/server/am/ContentProviderConnection.java
@@ -40,7 +40,7 @@ public final class ContentProviderConnection extends Binder implements
public final String clientPackage;
public AssociationState.SourceState association;
public final long createTime;
- private Object mProcStatsLock; // Internal lock for accessing AssociationState
+ private volatile Object mProcStatsLock; // Internal lock for accessing AssociationState
/**
* Internal lock that guards access to the two counters.
@@ -118,19 +118,25 @@ public final class ContentProviderConnection extends Binder implements
* Track the given proc state change.
*/
public void trackProcState(int procState, int seq) {
- if (association != null) {
- synchronized (mProcStatsLock) {
+ if (association == null) {
+ return; // early exit to optimize on oomadj cycles
+ }
+ synchronized (mProcStatsLock) {
+ if (association != null) { // due to race-conditions, association may have become null
association.trackProcState(procState, seq, SystemClock.uptimeMillis());
}
}
}
public void stopAssociation() {
- if (association != null) {
- synchronized (mProcStatsLock) {
+ if (association == null) {
+ return; // early exit to optimize on oomadj cycles
+ }
+ synchronized (mProcStatsLock) {
+ if (association != null) { // due to race-conditions, association may have become null
association.stop();
+ association = null;
}
- association = null;
}
}
diff --git a/services/core/java/com/android/server/am/OomAdjuster.java b/services/core/java/com/android/server/am/OomAdjuster.java
index f60ee66cb236..70517145575a 100644
--- a/services/core/java/com/android/server/am/OomAdjuster.java
+++ b/services/core/java/com/android/server/am/OomAdjuster.java
@@ -1162,8 +1162,8 @@ public class OomAdjuster {
if (opt != null && opt.isFreezeExempt()) {
// BIND_WAIVE_PRIORITY and the like get oom_adj 900
targetAdj += 0;
- } else if (state.hasShownUi() && uiTargetAdj < 15) {
- // The most recent 5 apps that have shown UI get 910-914
+ } else if (state.hasShownUi() && uiTargetAdj < 20) {
+ // The most recent 10 apps that have shown UI get 910-919
targetAdj += uiTargetAdj++;
} else if ((state.getSetAdj() >= CACHED_APP_MIN_ADJ)
&& (state.getLastStateTime()
diff --git a/services/core/java/com/android/server/am/ProcessList.java b/services/core/java/com/android/server/am/ProcessList.java
index 7831c393844b..cdb01889c139 100644
--- a/services/core/java/com/android/server/am/ProcessList.java
+++ b/services/core/java/com/android/server/am/ProcessList.java
@@ -5187,6 +5187,7 @@ public final class ProcessList {
if (ai != null) {
if (ai.packageName.equals(app.info.packageName)) {
app.info = ai;
+ app.getWindowProcessController().updateApplicationInfo(ai);
PlatformCompatCache.getInstance()
.onApplicationInfoChanged(ai);
}
diff --git a/services/core/java/com/android/server/am/SettingsToPropertiesMapper.java b/services/core/java/com/android/server/am/SettingsToPropertiesMapper.java
index a815f72ca09e..2f4e8bbea1d7 100644
--- a/services/core/java/com/android/server/am/SettingsToPropertiesMapper.java
+++ b/services/core/java/com/android/server/am/SettingsToPropertiesMapper.java
@@ -150,6 +150,7 @@ public class SettingsToPropertiesMapper {
"art_mainline",
"art_performance",
"attack_tools",
+ "automotive_cast",
"avic",
"desktop_firmware",
"biometrics",
diff --git a/services/core/java/com/android/server/biometrics/sensors/AuthenticationClient.java b/services/core/java/com/android/server/biometrics/sensors/AuthenticationClient.java
index 09386ae2899d..8a9858548806 100644
--- a/services/core/java/com/android/server/biometrics/sensors/AuthenticationClient.java
+++ b/services/core/java/com/android/server/biometrics/sensors/AuthenticationClient.java
@@ -115,7 +115,7 @@ public abstract class AuthenticationClient<T, O extends AuthenticateOptions>
}
@LockoutTracker.LockoutMode
- public int handleFailedAttempt(int userId) {
+ private int handleFailedAttempt(int userId) {
if (mLockoutTracker != null) {
mLockoutTracker.addFailedAttemptForUser(getTargetUserId());
}
diff --git a/services/core/java/com/android/server/content/OWNERS b/services/core/java/com/android/server/content/OWNERS
index b6a9fe869ffa..5642382767dc 100644
--- a/services/core/java/com/android/server/content/OWNERS
+++ b/services/core/java/com/android/server/content/OWNERS
@@ -1 +1,3 @@
-include /services/core/java/com/android/server/am/OWNERS \ No newline at end of file
+include /services/core/java/com/android/server/am/OWNERS
+
+per-file Sync* = file:/apex/jobscheduler/JOB_OWNERS \ No newline at end of file
diff --git a/services/core/java/com/android/server/display/color/ColorDisplayService.java b/services/core/java/com/android/server/display/color/ColorDisplayService.java
index dc59e66d85f2..7892639fc8ed 100644
--- a/services/core/java/com/android/server/display/color/ColorDisplayService.java
+++ b/services/core/java/com/android/server/display/color/ColorDisplayService.java
@@ -78,6 +78,7 @@ import android.view.animation.AnimationUtils;
import com.android.internal.R;
import com.android.internal.annotations.VisibleForTesting;
+import com.android.internal.annotations.WeaklyReferencedCallback;
import com.android.internal.util.DumpUtils;
import com.android.server.DisplayThread;
import com.android.server.LocalServices;
@@ -1795,6 +1796,7 @@ public final class ColorDisplayService extends SystemService {
/**
* Interface for applying transforms to a given AppWindow.
*/
+ @WeaklyReferencedCallback
public interface ColorTransformController {
/**
diff --git a/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java b/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java
index 636854b85ee4..d1576c5cca4f 100644
--- a/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java
+++ b/services/core/java/com/android/server/integrity/AppIntegrityManagerServiceImpl.java
@@ -17,118 +17,63 @@
package com.android.server.integrity;
import static android.content.Intent.ACTION_PACKAGE_NEEDS_INTEGRITY_VERIFICATION;
-import static android.content.Intent.EXTRA_LONG_VERSION_CODE;
-import static android.content.Intent.EXTRA_ORIGINATING_UID;
-import static android.content.Intent.EXTRA_PACKAGE_NAME;
import static android.content.integrity.AppIntegrityManager.EXTRA_STATUS;
import static android.content.integrity.AppIntegrityManager.STATUS_FAILURE;
import static android.content.integrity.AppIntegrityManager.STATUS_SUCCESS;
-import static android.content.integrity.InstallerAllowedByManifestFormula.INSTALLER_CERTIFICATE_NOT_EVALUATED;
import static android.content.integrity.IntegrityUtils.getHexDigest;
import static android.content.pm.PackageManager.EXTRA_VERIFICATION_ID;
import android.annotation.BinderThread;
-import android.annotation.NonNull;
-import android.annotation.Nullable;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.IntentSender;
-import android.content.integrity.AppInstallMetadata;
import android.content.integrity.IAppIntegrityManager;
import android.content.integrity.Rule;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.PackageManagerInternal;
import android.content.pm.ParceledListSlice;
-import android.content.pm.Signature;
-import android.content.pm.SigningDetails;
-import android.content.pm.parsing.result.ParseResult;
-import android.content.pm.parsing.result.ParseTypeImpl;
import android.net.Uri;
import android.os.Binder;
-import android.os.Bundle;
import android.os.Handler;
import android.os.HandlerThread;
import android.provider.Settings;
import android.util.Pair;
import android.util.Slog;
-import android.util.apk.SourceStampVerificationResult;
-import android.util.apk.SourceStampVerifier;
import com.android.internal.R;
import com.android.internal.annotations.VisibleForTesting;
-import com.android.internal.pm.parsing.PackageParser2;
-import com.android.internal.pm.pkg.parsing.ParsingPackageUtils;
-import com.android.internal.util.ArrayUtils;
import com.android.server.LocalServices;
-import com.android.server.integrity.model.IntegrityCheckResult;
import com.android.server.integrity.model.RuleMetadata;
-import com.android.server.pm.PackageManagerServiceUtils;
-import com.android.server.pm.parsing.PackageParserUtils;
-import java.io.ByteArrayInputStream;
import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
-import java.nio.file.Path;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
-import java.security.cert.CertificateEncodingException;
-import java.security.cert.CertificateException;
-import java.security.cert.CertificateFactory;
-import java.security.cert.X509Certificate;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
-import java.util.function.Supplier;
-import java.util.stream.Collectors;
import java.util.stream.Stream;
/** Implementation of {@link AppIntegrityManagerService}. */
public class AppIntegrityManagerServiceImpl extends IAppIntegrityManager.Stub {
- /**
- * This string will be used as the "installer" for formula evaluation when the app's installer
- * cannot be determined.
- *
- * <p>This may happen for various reasons. e.g., the installing app's package name may not match
- * its UID.
- */
- private static final String UNKNOWN_INSTALLER = "";
- /**
- * This string will be used as the "installer" for formula evaluation when the app is being
- * installed via ADB.
- */
- public static final String ADB_INSTALLER = "adb";
private static final String TAG = "AppIntegrityManagerServiceImpl";
private static final String PACKAGE_MIME_TYPE = "application/vnd.android.package-archive";
- private static final String BASE_APK_FILE = "base.apk";
- private static final String ALLOWED_INSTALLERS_METADATA_NAME = "allowed-installers";
- private static final String ALLOWED_INSTALLER_DELIMITER = ",";
- private static final String INSTALLER_PACKAGE_CERT_DELIMITER = "\\|";
public static final boolean DEBUG_INTEGRITY_COMPONENT = false;
- private static final Set<String> PACKAGE_INSTALLER =
- new HashSet<>(
- Arrays.asList(
- "com.google.android.packageinstaller", "com.android.packageinstaller"));
-
// Access to files inside mRulesDir is protected by mRulesLock;
private final Context mContext;
private final Handler mHandler;
private final PackageManagerInternal mPackageManagerInternal;
- private final Supplier<PackageParser2> mParserSupplier;
private final IntegrityFileManager mIntegrityFileManager;
/** Create an instance of {@link AppIntegrityManagerServiceImpl}. */
@@ -139,7 +84,6 @@ public class AppIntegrityManagerServiceImpl extends IAppIntegrityManager.Stub {
return new AppIntegrityManagerServiceImpl(
context,
LocalServices.getService(PackageManagerInternal.class),
- PackageParserUtils::forParsingFileWithDefaults,
IntegrityFileManager.getInstance(),
handlerThread.getThreadHandler());
}
@@ -148,12 +92,10 @@ public class AppIntegrityManagerServiceImpl extends IAppIntegrityManager.Stub {
AppIntegrityManagerServiceImpl(
Context context,
PackageManagerInternal packageManagerInternal,
- Supplier<PackageParser2> parserSupplier,
IntegrityFileManager integrityFileManager,
Handler handler) {
mContext = context;
mPackageManagerInternal = packageManagerInternal;
- mParserSupplier = parserSupplier;
mIntegrityFileManager = integrityFileManager;
mHandler = handler;
@@ -263,148 +205,8 @@ public class AppIntegrityManagerServiceImpl extends IAppIntegrityManager.Stub {
private void handleIntegrityVerification(Intent intent) {
int verificationId = intent.getIntExtra(EXTRA_VERIFICATION_ID, -1);
-
- try {
- if (DEBUG_INTEGRITY_COMPONENT) {
- Slog.d(TAG, "Received integrity verification intent " + intent.toString());
- Slog.d(TAG, "Extras " + intent.getExtras());
- }
-
- String installerPackageName = getInstallerPackageName(intent);
-
- // Skip integrity verification if the verifier is doing the install.
- if (!integrityCheckIncludesRuleProvider() && isRuleProvider(installerPackageName)) {
- if (DEBUG_INTEGRITY_COMPONENT) {
- Slog.i(TAG, "Verifier doing the install. Skipping integrity check.");
- }
- mPackageManagerInternal.setIntegrityVerificationResult(
- verificationId, PackageManagerInternal.INTEGRITY_VERIFICATION_ALLOW);
- return;
- }
-
- String packageName = intent.getStringExtra(EXTRA_PACKAGE_NAME);
-
- Pair<SigningDetails, Bundle> packageSigningAndMetadata =
- getPackageSigningAndMetadata(intent.getData());
- if (packageSigningAndMetadata == null) {
- Slog.w(TAG, "Cannot parse package " + packageName);
- // We can't parse the package.
- mPackageManagerInternal.setIntegrityVerificationResult(
- verificationId, PackageManagerInternal.INTEGRITY_VERIFICATION_ALLOW);
- return;
- }
-
- var signingDetails = packageSigningAndMetadata.first;
- List<String> appCertificates = getCertificateFingerprint(packageName, signingDetails);
- List<String> appCertificateLineage = getCertificateLineage(packageName, signingDetails);
- List<String> installerCertificates =
- getInstallerCertificateFingerprint(installerPackageName);
-
- AppInstallMetadata.Builder builder = new AppInstallMetadata.Builder();
-
- builder.setPackageName(getPackageNameNormalized(packageName));
- builder.setAppCertificates(appCertificates);
- builder.setAppCertificateLineage(appCertificateLineage);
- builder.setVersionCode(intent.getLongExtra(EXTRA_LONG_VERSION_CODE, -1));
- builder.setInstallerName(getPackageNameNormalized(installerPackageName));
- builder.setInstallerCertificates(installerCertificates);
- builder.setIsPreInstalled(isSystemApp(packageName));
-
- Map<String, String> allowedInstallers =
- getAllowedInstallers(packageSigningAndMetadata.second);
- builder.setAllowedInstallersAndCert(allowedInstallers);
- extractSourceStamp(intent.getData(), builder);
-
- AppInstallMetadata appInstallMetadata = builder.build();
-
- if (DEBUG_INTEGRITY_COMPONENT) {
- Slog.i(
- TAG,
- "To be verified: "
- + appInstallMetadata
- + " installers "
- + allowedInstallers);
- }
- IntegrityCheckResult result = IntegrityCheckResult.allow();
- if (!result.getMatchedRules().isEmpty() || DEBUG_INTEGRITY_COMPONENT) {
- Slog.i(
- TAG,
- String.format(
- "Integrity check of %s result: %s due to %s",
- packageName, result.getEffect(), result.getMatchedRules()));
- }
-
- mPackageManagerInternal.setIntegrityVerificationResult(
- verificationId,
- result.getEffect() == IntegrityCheckResult.Effect.ALLOW
- ? PackageManagerInternal.INTEGRITY_VERIFICATION_ALLOW
- : PackageManagerInternal.INTEGRITY_VERIFICATION_REJECT);
- } catch (IllegalArgumentException e) {
- // This exception indicates something is wrong with the input passed by package manager.
- // e.g., someone trying to trick the system. We block installs in this case.
- Slog.e(TAG, "Invalid input to integrity verification", e);
- mPackageManagerInternal.setIntegrityVerificationResult(
- verificationId, PackageManagerInternal.INTEGRITY_VERIFICATION_REJECT);
- } catch (Exception e) {
- // Other exceptions indicate an error within the integrity component implementation and
- // we allow them.
- Slog.e(TAG, "Error handling integrity verification", e);
- mPackageManagerInternal.setIntegrityVerificationResult(
- verificationId, PackageManagerInternal.INTEGRITY_VERIFICATION_ALLOW);
- }
- }
-
- /**
- * Verify the UID and return the installer package name.
- *
- * @return the package name of the installer, or null if it cannot be determined or it is
- * installed via adb.
- */
- @Nullable
- private String getInstallerPackageName(Intent intent) {
- String installer =
- intent.getStringExtra(PackageManager.EXTRA_VERIFICATION_INSTALLER_PACKAGE);
- if (PackageManagerServiceUtils.isInstalledByAdb(installer)) {
- return ADB_INSTALLER;
- }
- int installerUid = intent.getIntExtra(PackageManager.EXTRA_VERIFICATION_INSTALLER_UID, -1);
- if (installerUid < 0) {
- Slog.e(
- TAG,
- "Installer cannot be determined: installer: "
- + installer
- + " installer UID: "
- + installerUid);
- return UNKNOWN_INSTALLER;
- }
-
- // Verify that the installer UID actually contains the package. Note that comparing UIDs
- // is not safe since context's uid can change in different settings; e.g. Android Auto.
- if (!getPackageListForUid(installerUid).contains(installer)) {
- return UNKNOWN_INSTALLER;
- }
-
- // At this time we can trust "installer".
-
- // A common way for apps to install packages is to send an intent to PackageInstaller. In
- // that case, the installer will always show up as PackageInstaller which is not what we
- // want.
- if (PACKAGE_INSTALLER.contains(installer)) {
- int originatingUid = intent.getIntExtra(EXTRA_ORIGINATING_UID, -1);
- if (originatingUid < 0) {
- Slog.e(TAG, "Installer is package installer but originating UID not found.");
- return UNKNOWN_INSTALLER;
- }
- List<String> installerPackages = getPackageListForUid(originatingUid);
- if (installerPackages.isEmpty()) {
- Slog.e(TAG, "No package found associated with originating UID " + originatingUid);
- return UNKNOWN_INSTALLER;
- }
- // In the case of multiple package sharing a UID, we just return the first one.
- return installerPackages.get(0);
- }
-
- return installer;
+ mPackageManagerInternal.setIntegrityVerificationResult(
+ verificationId, PackageManagerInternal.INTEGRITY_VERIFICATION_ALLOW);
}
/** We will use the SHA256 digest of a package name if it is more than 32 bytes long. */
@@ -422,264 +224,6 @@ public class AppIntegrityManagerServiceImpl extends IAppIntegrityManager.Stub {
}
}
- private List<String> getInstallerCertificateFingerprint(String installer) {
- if (installer.equals(ADB_INSTALLER) || installer.equals(UNKNOWN_INSTALLER)) {
- return Collections.emptyList();
- }
- var installerPkg = mPackageManagerInternal.getPackage(installer);
- if (installerPkg == null) {
- Slog.w(TAG, "Installer package " + installer + " not found.");
- return Collections.emptyList();
- }
- return getCertificateFingerprint(installerPkg.getPackageName(),
- installerPkg.getSigningDetails());
- }
-
- private List<String> getCertificateFingerprint(@NonNull String packageName,
- @NonNull SigningDetails signingDetails) {
- ArrayList<String> certificateFingerprints = new ArrayList();
- for (Signature signature : getSignatures(packageName, signingDetails)) {
- certificateFingerprints.add(getFingerprint(signature));
- }
- return certificateFingerprints;
- }
-
- private List<String> getCertificateLineage(@NonNull String packageName,
- @NonNull SigningDetails signingDetails) {
- ArrayList<String> certificateLineage = new ArrayList();
- for (Signature signature : getSignatureLineage(packageName, signingDetails)) {
- certificateLineage.add(getFingerprint(signature));
- }
- return certificateLineage;
- }
-
- /** Get the allowed installers and their associated certificate hashes from <meta-data> tag. */
- private Map<String, String> getAllowedInstallers(@Nullable Bundle metaData) {
- Map<String, String> packageCertMap = new HashMap<>();
- if (metaData != null) {
- String allowedInstallers = metaData.getString(ALLOWED_INSTALLERS_METADATA_NAME);
- if (allowedInstallers != null) {
- // parse the metadata for certs.
- String[] installerCertPairs = allowedInstallers.split(ALLOWED_INSTALLER_DELIMITER);
- for (String packageCertPair : installerCertPairs) {
- String[] packageAndCert =
- packageCertPair.split(INSTALLER_PACKAGE_CERT_DELIMITER);
- if (packageAndCert.length == 2) {
- String packageName = getPackageNameNormalized(packageAndCert[0]);
- String cert = packageAndCert[1];
- packageCertMap.put(packageName, cert);
- } else if (packageAndCert.length == 1) {
- packageCertMap.put(
- getPackageNameNormalized(packageAndCert[0]),
- INSTALLER_CERTIFICATE_NOT_EVALUATED);
- }
- }
- }
- }
-
- return packageCertMap;
- }
-
- /** Extract the source stamp embedded in the APK, if present. */
- private void extractSourceStamp(Uri dataUri, AppInstallMetadata.Builder appInstallMetadata) {
- File installationPath = getInstallationPath(dataUri);
- if (installationPath == null) {
- throw new IllegalArgumentException("Installation path is null, package not found");
- }
-
- SourceStampVerificationResult sourceStampVerificationResult;
- if (installationPath.isDirectory()) {
- try (Stream<Path> filesList = Files.list(installationPath.toPath())) {
- List<String> apkFiles =
- filesList
- .map(path -> path.toAbsolutePath().toString())
- .filter(str -> str.endsWith(".apk"))
- .collect(Collectors.toList());
- sourceStampVerificationResult = SourceStampVerifier.verify(apkFiles);
- } catch (IOException e) {
- throw new IllegalArgumentException("Could not read APK directory");
- }
- } else {
- sourceStampVerificationResult =
- SourceStampVerifier.verify(installationPath.getAbsolutePath());
- }
-
- appInstallMetadata.setIsStampPresent(sourceStampVerificationResult.isPresent());
- appInstallMetadata.setIsStampVerified(sourceStampVerificationResult.isVerified());
- // A verified stamp is set to be trusted.
- appInstallMetadata.setIsStampTrusted(sourceStampVerificationResult.isVerified());
- if (sourceStampVerificationResult.isVerified()) {
- X509Certificate sourceStampCertificate =
- (X509Certificate) sourceStampVerificationResult.getCertificate();
- // Sets source stamp certificate digest.
- try {
- MessageDigest digest = MessageDigest.getInstance("SHA-256");
- byte[] certificateDigest = digest.digest(sourceStampCertificate.getEncoded());
- appInstallMetadata.setStampCertificateHash(getHexDigest(certificateDigest));
- } catch (NoSuchAlgorithmException | CertificateEncodingException e) {
- throw new IllegalArgumentException(
- "Error computing source stamp certificate digest", e);
- }
- }
- }
-
- private static Signature[] getSignatures(@NonNull String packageName,
- @NonNull SigningDetails signingDetails) {
- Signature[] signatures = signingDetails.getSignatures();
- if (signatures == null || signatures.length < 1) {
- throw new IllegalArgumentException("Package signature not found in " + packageName);
- }
-
- // We are only interested in evaluating the active signatures.
- return signatures;
- }
-
- private static Signature[] getSignatureLineage(@NonNull String packageName,
- @NonNull SigningDetails signingDetails) {
- // Obtain the active signatures of the package.
- Signature[] signatureLineage = getSignatures(packageName, signingDetails);
-
- var pastSignatures = signingDetails.getPastSigningCertificates();
- // Obtain the past signatures of the package.
- if (signatureLineage.length == 1 && !ArrayUtils.isEmpty(pastSignatures)) {
- // Merge the signatures and return.
- Signature[] allSignatures =
- new Signature[signatureLineage.length + pastSignatures.length];
- int i;
- for (i = 0; i < signatureLineage.length; i++) {
- allSignatures[i] = signatureLineage[i];
- }
- for (int j = 0; j < pastSignatures.length; j++) {
- allSignatures[i] = pastSignatures[j];
- i++;
- }
- signatureLineage = allSignatures;
- }
-
- return signatureLineage;
- }
-
- private static String getFingerprint(Signature cert) {
- InputStream input = new ByteArrayInputStream(cert.toByteArray());
-
- CertificateFactory factory;
- try {
- factory = CertificateFactory.getInstance("X509");
- } catch (CertificateException e) {
- throw new RuntimeException("Error getting CertificateFactory", e);
- }
- X509Certificate certificate = null;
- try {
- if (factory != null) {
- certificate = (X509Certificate) factory.generateCertificate(input);
- }
- } catch (CertificateException e) {
- throw new RuntimeException("Error getting X509Certificate", e);
- }
-
- if (certificate == null) {
- throw new RuntimeException("X509 Certificate not found");
- }
-
- try {
- MessageDigest digest = MessageDigest.getInstance("SHA-256");
- byte[] publicKey = digest.digest(certificate.getEncoded());
- return getHexDigest(publicKey);
- } catch (NoSuchAlgorithmException | CertificateEncodingException e) {
- throw new IllegalArgumentException("Error error computing fingerprint", e);
- }
- }
-
- @Nullable
- private Pair<SigningDetails, Bundle> getPackageSigningAndMetadata(Uri dataUri) {
- File installationPath = getInstallationPath(dataUri);
- if (installationPath == null) {
- throw new IllegalArgumentException("Installation path is null, package not found");
- }
-
- try (PackageParser2 parser = mParserSupplier.get()) {
- var pkg = parser.parsePackage(installationPath, 0, false);
- // APK signatures is already verified elsewhere in PackageManager. We do not need to
- // verify it again since it could cause a timeout for large APKs.
- final ParseTypeImpl input = ParseTypeImpl.forDefaultParsing();
- final ParseResult<SigningDetails> result = ParsingPackageUtils.getSigningDetails(
- input, pkg, /* skipVerify= */ true);
- if (result.isError()) {
- Slog.w(TAG, result.getErrorMessage(), result.getException());
- return null;
- }
- return Pair.create(result.getResult(), pkg.getMetaData());
- } catch (Exception e) {
- Slog.w(TAG, "Exception reading " + dataUri, e);
- return null;
- }
- }
-
- private PackageInfo getMultiApkInfo(File multiApkDirectory) {
- // The base apk will normally be called base.apk
- File baseFile = new File(multiApkDirectory, BASE_APK_FILE);
- PackageInfo basePackageInfo =
- mContext.getPackageManager()
- .getPackageArchiveInfo(
- baseFile.getAbsolutePath(),
- PackageManager.GET_SIGNING_CERTIFICATES
- | PackageManager.GET_META_DATA);
-
- if (basePackageInfo == null) {
- for (File apkFile : multiApkDirectory.listFiles()) {
- if (apkFile.isDirectory()) {
- continue;
- }
-
- // If we didn't find a base.apk, then try to parse each apk until we find the one
- // that succeeds.
- try {
- basePackageInfo =
- mContext.getPackageManager()
- .getPackageArchiveInfo(
- apkFile.getAbsolutePath(),
- PackageManager.GET_SIGNING_CERTIFICATES
- | PackageManager.GET_META_DATA);
- } catch (Exception e) {
- // Some of the splits may not contain a valid android manifest. It is an
- // expected exception. We still log it nonetheless but we should keep looking.
- Slog.w(TAG, "Exception reading " + apkFile, e);
- }
- if (basePackageInfo != null) {
- Slog.i(TAG, "Found package info from " + apkFile);
- break;
- }
- }
- }
-
- if (basePackageInfo == null) {
- throw new IllegalArgumentException(
- "Base package info cannot be found from installation directory");
- }
-
- return basePackageInfo;
- }
-
- private File getInstallationPath(Uri dataUri) {
- if (dataUri == null) {
- throw new IllegalArgumentException("Null data uri");
- }
-
- String scheme = dataUri.getScheme();
- if (!"file".equalsIgnoreCase(scheme)) {
- throw new IllegalArgumentException("Unsupported scheme for " + dataUri);
- }
-
- File installationPath = new File(dataUri.getPath());
- if (!installationPath.exists()) {
- throw new IllegalArgumentException("Cannot find file for " + dataUri);
- }
- if (!installationPath.canRead()) {
- throw new IllegalArgumentException("Cannot read file for " + dataUri);
- }
- return installationPath;
- }
-
private String getCallerPackageNameOrThrow(int callingUid) {
String callerPackageName = getCallingRulePusherPackageName(callingUid);
if (callerPackageName == null) {
@@ -715,15 +259,6 @@ public class AppIntegrityManagerServiceImpl extends IAppIntegrityManager.Stub {
return allowedCallingPackages.isEmpty() ? null : allowedCallingPackages.get(0);
}
- private boolean isRuleProvider(String installerPackageName) {
- for (String ruleProvider : getAllowedRuleProviderSystemApps()) {
- if (ruleProvider.matches(installerPackageName)) {
- return true;
- }
- }
- return false;
- }
-
private List<String> getAllowedRuleProviderSystemApps() {
List<String> integrityRuleProviders =
Arrays.asList(
@@ -751,14 +286,6 @@ public class AppIntegrityManagerServiceImpl extends IAppIntegrityManager.Stub {
}
}
- private boolean integrityCheckIncludesRuleProvider() {
- return Settings.Global.getInt(
- mContext.getContentResolver(),
- Settings.Global.INTEGRITY_CHECK_INCLUDES_RULE_PROVIDER,
- 0)
- == 1;
- }
-
private List<String> getPackageListForUid(int uid) {
try {
return Arrays.asList(mContext.getPackageManager().getPackagesForUid(uid));
diff --git a/services/core/java/com/android/server/media/projection/MediaProjectionManagerService.java b/services/core/java/com/android/server/media/projection/MediaProjectionManagerService.java
index e7e519ede768..e0913ccbc7f7 100644
--- a/services/core/java/com/android/server/media/projection/MediaProjectionManagerService.java
+++ b/services/core/java/com/android/server/media/projection/MediaProjectionManagerService.java
@@ -28,6 +28,7 @@ import static android.media.projection.ReviewGrantedConsentResult.RECORD_CANCEL;
import static android.media.projection.ReviewGrantedConsentResult.RECORD_CONTENT_DISPLAY;
import static android.media.projection.ReviewGrantedConsentResult.RECORD_CONTENT_TASK;
import static android.media.projection.ReviewGrantedConsentResult.UNKNOWN;
+import static android.provider.Settings.Global.DISABLE_SCREEN_SHARE_PROTECTIONS_FOR_APPS_AND_NOTIFICATIONS;
import static android.view.Display.DEFAULT_DISPLAY;
import static android.view.Display.INVALID_DISPLAY;
@@ -73,6 +74,7 @@ import android.os.PermissionEnforcer;
import android.os.RemoteException;
import android.os.SystemClock;
import android.os.UserHandle;
+import android.provider.Settings;
import android.util.ArrayMap;
import android.util.Slog;
import android.view.ContentRecordingSession;
@@ -195,6 +197,15 @@ public final class MediaProjectionManagerService extends SystemService
if (mProjectionGrant == null || mProjectionGrant.packageName == null) {
return false;
}
+ boolean disableScreenShareProtections = Settings.Global.getInt(
+ getContext().getContentResolver(),
+ DISABLE_SCREEN_SHARE_PROTECTIONS_FOR_APPS_AND_NOTIFICATIONS, 0) != 0;
+ if (disableScreenShareProtections) {
+ Slog.v(TAG,
+ "Allowing keyguard capture as screenshare protections are disabled.");
+ return true;
+ }
+
if (mPackageManager.checkPermission(RECORD_SENSITIVE_CONTENT,
mProjectionGrant.packageName)
== PackageManager.PERMISSION_GRANTED) {
@@ -226,7 +237,8 @@ public final class MediaProjectionManagerService extends SystemService
void onKeyguardLockedStateChanged(boolean isKeyguardLocked) {
if (!isKeyguardLocked) return;
synchronized (mLock) {
- if (mProjectionGrant != null && !canCaptureKeyguard()) {
+ if (mProjectionGrant != null && !canCaptureKeyguard()
+ && mProjectionGrant.mVirtualDisplayId != INVALID_DISPLAY) {
Slog.d(TAG, "Content Recording: Stopped MediaProjection"
+ " due to keyguard lock");
mProjectionGrant.stop();
diff --git a/services/core/java/com/android/server/net/OWNERS b/services/core/java/com/android/server/net/OWNERS
index bbc7c013f170..4596a445ed30 100644
--- a/services/core/java/com/android/server/net/OWNERS
+++ b/services/core/java/com/android/server/net/OWNERS
@@ -2,7 +2,5 @@ set noparent
file:platform/packages/modules/Connectivity:main:/OWNERS_core_networking
per-file NetworkPolicyManagerService.java=jackyu@google.com, sarahchin@google.com
-jsharkey@android.com
sudheersai@google.com
-yamasani@google.com
suprabh@google.com
diff --git a/services/core/java/com/android/server/notification/GroupHelper.java b/services/core/java/com/android/server/notification/GroupHelper.java
index 9b9be4cd8f3f..6681e36e00ee 100644
--- a/services/core/java/com/android/server/notification/GroupHelper.java
+++ b/services/core/java/com/android/server/notification/GroupHelper.java
@@ -29,6 +29,7 @@ import static android.service.notification.Flags.notificationForceGrouping;
import android.annotation.FlaggedApi;
import android.annotation.NonNull;
import android.annotation.Nullable;
+import android.app.ActivityManager;
import android.app.Notification;
import android.app.NotificationChannel;
import android.app.NotificationManager;
@@ -88,6 +89,7 @@ public class GroupHelper {
private final int mAutogroupSparseGroupsAtCount;
private final Context mContext;
private final PackageManager mPackageManager;
+ private boolean mIsTestHarnessExempted;
// Only contains notifications that are not explicitly grouped by the app (aka no group or
// sort key).
@@ -174,6 +176,11 @@ public class GroupHelper {
NOTIFICATION_SHADE_SECTIONS = getNotificationShadeSections();
}
+ void setTestHarnessExempted(boolean isExempted) {
+ // Allow E2E tests to post ungrouped notifications
+ mIsTestHarnessExempted = ActivityManager.isRunningInUserTestHarness() && isExempted;
+ }
+
private String generatePackageKey(int userId, String pkg) {
return userId + "|" + pkg;
}
@@ -696,6 +703,10 @@ public class GroupHelper {
return;
}
+ if (mIsTestHarnessExempted) {
+ return;
+ }
+
final NotificationSectioner sectioner = getSection(record);
if (sectioner == null) {
if (DEBUG) {
diff --git a/services/core/java/com/android/server/notification/ManagedServices.java b/services/core/java/com/android/server/notification/ManagedServices.java
index 93482e769a2b..122836e19d58 100644
--- a/services/core/java/com/android/server/notification/ManagedServices.java
+++ b/services/core/java/com/android/server/notification/ManagedServices.java
@@ -21,6 +21,9 @@ import static android.content.Context.BIND_ALLOW_WHITELIST_MANAGEMENT;
import static android.content.Context.BIND_AUTO_CREATE;
import static android.content.Context.BIND_FOREGROUND_SERVICE;
import static android.content.Context.DEVICE_POLICY_SERVICE;
+import static android.content.pm.PackageManager.MATCH_DIRECT_BOOT_AWARE;
+import static android.content.pm.PackageManager.MATCH_DIRECT_BOOT_UNAWARE;
+import static android.content.pm.PackageManager.MATCH_INSTANT;
import static android.os.UserHandle.USER_ALL;
import static android.os.UserHandle.USER_SYSTEM;
import static android.service.notification.NotificationListenerService.META_DATA_DEFAULT_AUTOBIND;
@@ -106,7 +109,8 @@ abstract public class ManagedServices {
protected final String TAG = getClass().getSimpleName().replace('$', '.');
protected final boolean DEBUG = Log.isLoggable(TAG, Log.DEBUG);
- private static final int ON_BINDING_DIED_REBIND_DELAY_MS = 10000;
+ protected static final int ON_BINDING_DIED_REBIND_DELAY_MS = 10000;
+ protected static final int ON_BINDING_DIED_REBIND_MSG = 1234;
protected static final String ENABLED_SERVICES_SEPARATOR = ":";
private static final String DB_VERSION_1 = "1";
private static final String DB_VERSION_2 = "2";
@@ -875,7 +879,21 @@ abstract public class ManagedServices {
String approvedItem = getApprovedValue(pkgOrComponent);
if (approvedItem != null) {
+ final ComponentName component = ComponentName.unflattenFromString(approvedItem);
if (enabled) {
+ if (Flags.notificationNlsRebind()) {
+ if (component != null && !isValidService(component, userId)) {
+ // Only fail if package is available
+ // If not, it will be validated again in onPackagesChanged
+ final PackageManager pm = mContext.getPackageManager();
+ if (pm.isPackageAvailable(component.getPackageName())) {
+ Slog.w(TAG, "Skip allowing " + mConfig.caption
+ + " " + pkgOrComponent + " (userSet: " + userSet
+ + ") for invalid service");
+ return;
+ }
+ }
+ }
approved.add(approvedItem);
} else {
approved.remove(approvedItem);
@@ -973,7 +991,7 @@ abstract public class ManagedServices {
|| isPackageOrComponentAllowed(component.getPackageName(), userId))) {
return false;
}
- return componentHasBindPermission(component, userId);
+ return isValidService(component, userId);
}
private boolean componentHasBindPermission(ComponentName component, int userId) {
@@ -1220,12 +1238,21 @@ abstract public class ManagedServices {
if (!TextUtils.isEmpty(packageName)) {
queryIntent.setPackage(packageName);
}
+
+ if (Flags.notificationNlsRebind()) {
+ // Expand the package query
+ extraFlags |= MATCH_DIRECT_BOOT_AWARE | MATCH_DIRECT_BOOT_UNAWARE;
+ extraFlags |= MATCH_INSTANT;
+ }
+
List<ResolveInfo> installedServices = pm.queryIntentServicesAsUser(
queryIntent,
PackageManager.GET_SERVICES | PackageManager.GET_META_DATA | extraFlags,
userId);
- if (DEBUG)
- Slog.v(TAG, mConfig.serviceInterface + " services: " + installedServices);
+ if (DEBUG) {
+ Slog.v(TAG, mConfig.serviceInterface + " pkg: " + packageName + " services: "
+ + installedServices);
+ }
if (installedServices != null) {
for (int i = 0, count = installedServices.size(); i < count; i++) {
ResolveInfo resolveInfo = installedServices.get(i);
@@ -1325,11 +1352,12 @@ abstract public class ManagedServices {
if (TextUtils.equals(getPackageName(approvedPackageOrComponent), packageName)) {
final ComponentName component = ComponentName.unflattenFromString(
approvedPackageOrComponent);
- if (component != null && !componentHasBindPermission(component, userId)) {
+ if (component != null && !isValidService(component, userId)) {
approved.removeAt(j);
if (DEBUG) {
Slog.v(TAG, "Removing " + approvedPackageOrComponent
- + " from approved list; no bind permission found "
+ + " from approved list; no bind permission or "
+ + "service interface filter found "
+ mConfig.bindPermission);
}
}
@@ -1348,6 +1376,15 @@ abstract public class ManagedServices {
}
}
+ protected boolean isValidService(ComponentName component, int userId) {
+ if (Flags.notificationNlsRebind()) {
+ return componentHasBindPermission(component, userId) && queryPackageForServices(
+ component.getPackageName(), userId).contains(component);
+ } else {
+ return componentHasBindPermission(component, userId);
+ }
+ }
+
protected boolean isValidEntry(String packageOrComponent, int userId) {
return hasMatchingServices(packageOrComponent, userId);
}
@@ -1505,23 +1542,27 @@ abstract public class ManagedServices {
* Called when user switched to unbind all services from other users.
*/
@VisibleForTesting
- void unbindOtherUserServices(int currentUser) {
+ void unbindOtherUserServices(int switchedToUser) {
TimingsTraceAndSlog t = new TimingsTraceAndSlog();
- t.traceBegin("ManagedServices.unbindOtherUserServices_current" + currentUser);
- unbindServicesImpl(currentUser, true /* allExceptUser */);
+ t.traceBegin("ManagedServices.unbindOtherUserServices_current" + switchedToUser);
+ unbindServicesImpl(switchedToUser, true /* allExceptUser */);
t.traceEnd();
}
- void unbindUserServices(int user) {
+ void unbindUserServices(int removedUser) {
TimingsTraceAndSlog t = new TimingsTraceAndSlog();
- t.traceBegin("ManagedServices.unbindUserServices" + user);
- unbindServicesImpl(user, false /* allExceptUser */);
+ t.traceBegin("ManagedServices.unbindUserServices" + removedUser);
+ unbindServicesImpl(removedUser, false /* allExceptUser */);
t.traceEnd();
}
void unbindServicesImpl(int user, boolean allExceptUser) {
final SparseArray<Set<ComponentName>> componentsToUnbind = new SparseArray<>();
synchronized (mMutex) {
+ if (Flags.notificationNlsRebind()) {
+ // Remove enqueued rebinds to avoid rebinding services for a switched user
+ mHandler.removeMessages(ON_BINDING_DIED_REBIND_MSG);
+ }
final Set<ManagedServiceInfo> removableBoundServices = getRemovableConnectedServices();
for (ManagedServiceInfo info : removableBoundServices) {
if ((allExceptUser && (info.userid != user))
@@ -1716,6 +1757,7 @@ abstract public class ManagedServices {
mServicesRebinding.add(servicesBindingTag);
mHandler.postDelayed(() ->
reregisterService(name, userid),
+ ON_BINDING_DIED_REBIND_MSG,
ON_BINDING_DIED_REBIND_DELAY_MS);
} else {
Slog.v(TAG, getCaption() + " not rebinding in user " + userid
diff --git a/services/core/java/com/android/server/notification/NotificationManagerService.java b/services/core/java/com/android/server/notification/NotificationManagerService.java
index 62d762244617..e48c8ee718e3 100644
--- a/services/core/java/com/android/server/notification/NotificationManagerService.java
+++ b/services/core/java/com/android/server/notification/NotificationManagerService.java
@@ -2984,6 +2984,11 @@ public class NotificationManagerService extends SystemService {
});
}
+ //Enables tests running in TH mode to be exempted from forced grouping of notifications
+ void setTestHarnessExempted(boolean isExempted) {
+ mGroupHelper.setTestHarnessExempted(isExempted);
+ }
+
private void sendRegisteredOnlyBroadcast(String action) {
sendRegisteredOnlyBroadcast(new Intent(action));
}
diff --git a/services/core/java/com/android/server/notification/NotificationShellCmd.java b/services/core/java/com/android/server/notification/NotificationShellCmd.java
index 10169d544b73..c305d66c24c1 100644
--- a/services/core/java/com/android/server/notification/NotificationShellCmd.java
+++ b/services/core/java/com/android/server/notification/NotificationShellCmd.java
@@ -80,6 +80,7 @@ public class NotificationShellCmd extends ShellCommand {
+ " get <notification-key>\n"
+ " snooze --for <msec> <notification-key>\n"
+ " unsnooze <notification-key>\n"
+ + " set_exempt_th_force_grouping [true|false]\n"
;
private static final String NOTIFY_USAGE =
@@ -428,6 +429,13 @@ public class NotificationShellCmd extends ShellCommand {
}
break;
}
+ case "set_exempt_th_force_grouping": {
+ String arg = getNextArgRequired();
+ final boolean exemptTestHarnessFromForceGrouping =
+ "true".equals(arg) || "1".equals(arg);
+ mDirectService.setTestHarnessExempted(exemptTestHarnessFromForceGrouping);
+ break;
+ }
default:
return handleDefaultCommands(cmd);
}
diff --git a/services/core/java/com/android/server/notification/flags.aconfig b/services/core/java/com/android/server/notification/flags.aconfig
index f79d9ef174ea..c479acfd6228 100644
--- a/services/core/java/com/android/server/notification/flags.aconfig
+++ b/services/core/java/com/android/server/notification/flags.aconfig
@@ -194,3 +194,13 @@ flag {
description: "Enables sound uri with vibration source in notification channel"
bug: "351975435"
}
+
+flag {
+ name: "notification_nls_rebind"
+ namespace: "systemui"
+ description: "Check for NLS service intent filter when rebinding services"
+ bug: "347674739"
+ metadata {
+ purpose: PURPOSE_BUGFIX
+ }
+}
diff --git a/services/core/java/com/android/server/pm/BroadcastHelper.java b/services/core/java/com/android/server/pm/BroadcastHelper.java
index 369029adac59..84a5f2b0e8bc 100644
--- a/services/core/java/com/android/server/pm/BroadcastHelper.java
+++ b/services/core/java/com/android/server/pm/BroadcastHelper.java
@@ -80,11 +80,6 @@ import java.util.function.BiFunction;
*/
public final class BroadcastHelper {
private static final boolean DEBUG_BROADCASTS = false;
- /**
- * Permissions required in order to receive instant application lifecycle broadcasts.
- */
- private static final String[] INSTANT_APP_BROADCAST_PERMISSION =
- new String[]{android.Manifest.permission.ACCESS_INSTANT_APPS};
private final UserManagerInternal mUmInternal;
private final ActivityManagerInternal mAmInternal;
@@ -115,7 +110,7 @@ public final class BroadcastHelper {
SparseArray<int[]> broadcastAllowList = new SparseArray<>();
broadcastAllowList.put(userId, visibilityAllowList);
broadcastIntent(intent, finishedReceiver, isInstantApp, userId, broadcastAllowList,
- filterExtrasForReceiver, bOptions);
+ filterExtrasForReceiver, bOptions, null /* requiredPermissions */);
}
void sendPackageBroadcast(final String action, final String pkg, final Bundle extras,
@@ -123,7 +118,7 @@ public final class BroadcastHelper {
final int[] userIds, int[] instantUserIds,
@Nullable SparseArray<int[]> broadcastAllowList,
@Nullable BiFunction<Integer, Bundle, Bundle> filterExtrasForReceiver,
- @Nullable Bundle bOptions) {
+ @Nullable Bundle bOptions, @Nullable String[] requiredPermissions) {
try {
final IActivityManager am = ActivityManager.getService();
if (am == null) return;
@@ -137,12 +132,12 @@ public final class BroadcastHelper {
if (ArrayUtils.isEmpty(instantUserIds)) {
doSendBroadcast(action, pkg, extras, flags, targetPkg, finishedReceiver,
resolvedUserIds, false /* isInstantApp */, broadcastAllowList,
- filterExtrasForReceiver, bOptions);
+ filterExtrasForReceiver, bOptions, requiredPermissions);
} else {
// send restricted broadcasts for instant apps
doSendBroadcast(action, pkg, extras, flags, targetPkg, finishedReceiver,
- instantUserIds, true /* isInstantApp */, null,
- null /* filterExtrasForReceiver */, bOptions);
+ instantUserIds, true /* isInstantApp */, null /* broadcastAllowList */,
+ null /* filterExtrasForReceiver */, bOptions, requiredPermissions);
}
} catch (RemoteException ex) {
}
@@ -166,7 +161,8 @@ public final class BroadcastHelper {
boolean isInstantApp,
@Nullable SparseArray<int[]> broadcastAllowList,
@Nullable BiFunction<Integer, Bundle, Bundle> filterExtrasForReceiver,
- @Nullable Bundle bOptions) {
+ @Nullable Bundle bOptions,
+ @Nullable String[] requiredPermissions) {
for (int userId : userIds) {
final Intent intent = new Intent(action,
pkg != null ? Uri.fromParts(PACKAGE_SCHEME, pkg, null) : null);
@@ -189,17 +185,18 @@ public final class BroadcastHelper {
intent.putExtra(Intent.EXTRA_USER_HANDLE, userId);
intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT | flags);
broadcastIntent(intent, finishedReceiver, isInstantApp, userId, broadcastAllowList,
- filterExtrasForReceiver, bOptions);
+ filterExtrasForReceiver, bOptions, requiredPermissions);
}
}
-
private void broadcastIntent(Intent intent, IIntentReceiver finishedReceiver,
boolean isInstantApp, int userId, @Nullable SparseArray<int[]> broadcastAllowList,
@Nullable BiFunction<Integer, Bundle, Bundle> filterExtrasForReceiver,
- @Nullable Bundle bOptions) {
- final String[] requiredPermissions =
- isInstantApp ? INSTANT_APP_BROADCAST_PERMISSION : null;
+ @Nullable Bundle bOptions, @Nullable String[] requiredPermissions) {
+ if (isInstantApp) {
+ requiredPermissions = ArrayUtils.appendElement(String.class, requiredPermissions,
+ android.Manifest.permission.ACCESS_INSTANT_APPS);
+ }
if (DEBUG_BROADCASTS) {
RuntimeException here = new RuntimeException("here");
here.fillInStackTrace();
@@ -234,7 +231,7 @@ public final class BroadcastHelper {
null /* instantUserIds */, null /* broadcastAllowList */,
(callingUid, intentExtras) -> filterExtrasChangedPackageList(
snapshot, callingUid, intentExtras),
- null /* bOptions */);
+ null /* bOptions */, null /* requiredPermissions */);
}
/**
@@ -294,14 +291,29 @@ public final class BroadcastHelper {
return bOptions;
}
- private void sendPackageChangedBroadcast(@NonNull String packageName,
- boolean dontKillApp,
- @NonNull ArrayList<String> componentNames,
- int packageUid,
- @Nullable String reason,
- @Nullable int[] userIds,
- @Nullable int[] instantUserIds,
- @Nullable SparseArray<int[]> broadcastAllowList) {
+ private void sendPackageChangedBroadcastInternal(@NonNull String packageName,
+ boolean dontKillApp,
+ @NonNull ArrayList<String> componentNames,
+ int packageUid,
+ @Nullable String reason,
+ @Nullable int[] userIds,
+ @Nullable int[] instantUserIds,
+ @Nullable SparseArray<int[]> broadcastAllowList) {
+ sendPackageChangedBroadcastWithPermissions(packageName, dontKillApp, componentNames,
+ packageUid, reason, userIds, instantUserIds, broadcastAllowList,
+ null /* targetPackageName */, null /* requiredPermissions */);
+ }
+
+ private void sendPackageChangedBroadcastWithPermissions(@NonNull String packageName,
+ boolean dontKillApp,
+ @NonNull ArrayList<String> componentNames,
+ int packageUid,
+ @Nullable String reason,
+ @Nullable int[] userIds,
+ @Nullable int[] instantUserIds,
+ @Nullable SparseArray<int[]> broadcastAllowList,
+ @Nullable String targetPackageName,
+ @Nullable String[] requiredPermissions) {
if (DEBUG_INSTALL) {
Log.v(TAG, "Sending package changed: package=" + packageName + " components="
+ componentNames);
@@ -321,9 +333,10 @@ public final class BroadcastHelper {
// little component state change.
final int flags = !componentNames.contains(packageName)
? Intent.FLAG_RECEIVER_REGISTERED_ONLY : 0;
- sendPackageBroadcast(Intent.ACTION_PACKAGE_CHANGED, packageName, extras, flags, null, null,
- userIds, instantUserIds, broadcastAllowList, null /* filterExtrasForReceiver */,
- null /* bOptions */);
+ sendPackageBroadcast(Intent.ACTION_PACKAGE_CHANGED, packageName, extras, flags,
+ targetPackageName, null /* finishedReceiver */, userIds, instantUserIds,
+ broadcastAllowList, null /* filterExtrasForReceiver */, null /* bOptions */,
+ requiredPermissions);
}
static void sendDeviceCustomizationReadyBroadcast() {
@@ -680,7 +693,8 @@ public final class BroadcastHelper {
sendPackageBroadcast(Intent.ACTION_PACKAGE_ADDED,
packageName, extras, 0, null, null, userIds, instantUserIds,
- broadcastAllowlist, null /* filterExtrasForReceiver */, null);
+ broadcastAllowlist, null /* filterExtrasForReceiver */, null /* bOptions */,
+ null /* requiredPermissions */);
// Send to PermissionController for all new users, even if it may not be running for some
// users
if (isPrivacySafetyLabelChangeNotificationsEnabled(mContext)) {
@@ -688,7 +702,8 @@ public final class BroadcastHelper {
packageName, extras, 0,
mContext.getPackageManager().getPermissionControllerPackageName(),
null, userIds, instantUserIds,
- broadcastAllowlist, null /* filterExtrasForReceiver */, null);
+ broadcastAllowlist, null /* filterExtrasForReceiver */, null /* bOptions */,
+ null /* requiredPermissions */);
}
}
@@ -719,7 +734,8 @@ public final class BroadcastHelper {
int[] userIds, int[] instantUserIds) {
sendPackageBroadcast(Intent.ACTION_PACKAGE_FIRST_LAUNCH, pkgName, null, 0,
installerPkg, null, userIds, instantUserIds, null /* broadcastAllowList */,
- null /* filterExtrasForReceiver */, null);
+ null /* filterExtrasForReceiver */, null /* bOptions */,
+ null /* requiredPermissions */);
}
/**
@@ -824,7 +840,7 @@ public final class BroadcastHelper {
final int[] instantUserIds = isInstantApp ? new int[] { userId } : EMPTY_INT_ARRAY;
final SparseArray<int[]> broadcastAllowList =
isInstantApp ? null : snapshot.getVisibilityAllowLists(packageName, userIds);
- mHandler.post(() -> sendPackageChangedBroadcast(
+ mHandler.post(() -> sendPackageChangedBroadcastInternal(
packageName, dontKillApp, componentNames, packageUid, reason, userIds,
instantUserIds, broadcastAllowList));
mPackageMonitorCallbackHelper.notifyPackageChanged(packageName, dontKillApp, componentNames,
@@ -843,7 +859,7 @@ public final class BroadcastHelper {
@Nullable Bundle bOptions) {
mHandler.post(() -> sendPackageBroadcast(action, pkg, extras, flags,
targetPkg, finishedReceiver, userIds, instantUserIds, broadcastAllowList,
- null /* filterExtrasForReceiver */, bOptions));
+ null /* filterExtrasForReceiver */, bOptions, null /* requiredPermissions */));
if (targetPkg == null) {
// For some broadcast action, e.g. ACTION_PACKAGE_ADDED, this method will be called
// many times to different targets, e.g. installer app, permission controller, other
@@ -1014,7 +1030,7 @@ public final class BroadcastHelper {
extras, flags, null /* targetPkg */, null /* finishedReceiver */,
new int[]{userId}, null /* instantUserIds */, null /* broadcastAllowList */,
filterExtrasForReceiver,
- options));
+ options, null /* requiredPermissions */));
notifyPackageMonitor(intent, null /* pkg */, extras, new int[]{userId},
null /* instantUserIds */, null /* broadcastAllowList */, filterExtrasForReceiver);
}
@@ -1046,9 +1062,12 @@ public final class BroadcastHelper {
} else {
intentExtras = null;
}
- doSendBroadcast(action, null, intentExtras,
- Intent.FLAG_RECEIVER_INCLUDE_BACKGROUND, packageName, null,
- targetUserIds, false, null, null, null);
+ doSendBroadcast(action, null /* pkg */, intentExtras,
+ Intent.FLAG_RECEIVER_INCLUDE_BACKGROUND, packageName,
+ null /* finishedReceiver */,
+ targetUserIds, false /* isInstantApp */, null /* broadcastAllowList */,
+ null /* filterExtrasForReceiver */, null /* bOptions */,
+ null /* requiredPermissions */);
}
});
}
@@ -1077,7 +1096,7 @@ public final class BroadcastHelper {
null /* broadcastAllowList */,
(callingUid, intentExtras) -> filterExtrasChangedPackageList(
snapshot, callingUid, intentExtras),
- null /* bOptions */));
+ null /* bOptions */, null /* requiredPermissions */));
}
void sendResourcesChangedBroadcastAndNotify(@NonNull Computer snapshot,
diff --git a/services/core/java/com/android/server/pm/PackageInstallerService.java b/services/core/java/com/android/server/pm/PackageInstallerService.java
index 34d939b07187..f6a808b6c33e 100644
--- a/services/core/java/com/android/server/pm/PackageInstallerService.java
+++ b/services/core/java/com/android/server/pm/PackageInstallerService.java
@@ -25,12 +25,14 @@ import static android.content.pm.PackageInstaller.UNARCHIVAL_ERROR_NO_CONNECTIVI
import static android.content.pm.PackageInstaller.UNARCHIVAL_ERROR_USER_ACTION_NEEDED;
import static android.content.pm.PackageInstaller.UNARCHIVAL_GENERIC_ERROR;
import static android.content.pm.PackageInstaller.UNARCHIVAL_OK;
+import static android.content.pm.PackageInstaller.VERIFICATION_POLICY_BLOCK_FAIL_WARN;
import static android.content.pm.PackageManager.DELETE_ARCHIVE;
import static android.content.pm.PackageManager.INSTALL_UNARCHIVE_DRAFT;
import static android.os.Process.INVALID_UID;
import static android.os.Process.SYSTEM_UID;
import static com.android.server.pm.PackageArchiver.isArchivingEnabled;
+import static com.android.server.pm.PackageInstallerSession.isValidVerificationPolicy;
import static com.android.server.pm.PackageManagerService.SHELL_PACKAGE_NAME;
import static org.xmlpull.v1.XmlPullParser.END_DOCUMENT;
@@ -150,6 +152,7 @@ import java.util.Set;
import java.util.TreeMap;
import java.util.TreeSet;
import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.atomic.AtomicInteger;
import java.util.function.IntPredicate;
import java.util.function.Supplier;
@@ -275,6 +278,13 @@ public class PackageInstallerService extends IPackageInstaller.Stub implements
}
};
+ /**
+ * Default verification policy for incoming installation sessions.
+ * TODO(b/360129657): update the default policy.
+ */
+ private final AtomicInteger mVerificationPolicy = new AtomicInteger(
+ VERIFICATION_POLICY_BLOCK_FAIL_WARN);
+
private static final class Lifecycle extends SystemService {
private final PackageInstallerService mPackageInstallerService;
@@ -1042,7 +1052,7 @@ public class PackageInstallerService extends IPackageInstaller.Stub implements
userId, callingUid, installSource, params, createdMillis, 0L, stageDir, stageCid,
null, null, false, false, false, false, null, SessionInfo.INVALID_ID,
false, false, false, PackageManager.INSTALL_UNKNOWN, "", null,
- mVerifierController);
+ mVerifierController, mVerificationPolicy.get());
synchronized (mSessions) {
mSessions.put(sessionId, session);
@@ -1866,6 +1876,34 @@ public class PackageInstallerService extends IPackageInstaller.Stub implements
}
}
+ @Override
+ public @PackageInstaller.VerificationPolicy int getVerificationPolicy() {
+ if (mContext.checkCallingOrSelfPermission(Manifest.permission.VERIFICATION_AGENT)
+ != PackageManager.PERMISSION_GRANTED) {
+ throw new SecurityException("You need the "
+ + "com.android.permission.VERIFICATION_AGENT permission "
+ + "to get the verification policy");
+ }
+ return mVerificationPolicy.get();
+ }
+
+ @Override
+ public boolean setVerificationPolicy(@PackageInstaller.VerificationPolicy int policy) {
+ if (mContext.checkCallingOrSelfPermission(Manifest.permission.VERIFICATION_AGENT)
+ != PackageManager.PERMISSION_GRANTED) {
+ throw new SecurityException("You need the "
+ + "com.android.permission.VERIFICATION_AGENT permission "
+ + "to set the verification policy");
+ }
+ if (!isValidVerificationPolicy(policy)) {
+ return false;
+ }
+ if (policy != mVerificationPolicy.get()) {
+ mVerificationPolicy.set(policy);
+ }
+ return true;
+ }
+
private static int getSessionCount(SparseArray<PackageInstallerSession> sessions,
int installerUid) {
int count = 0;
diff --git a/services/core/java/com/android/server/pm/PackageInstallerSession.java b/services/core/java/com/android/server/pm/PackageInstallerSession.java
index 9e0ba8492ab9..9a9e434c32d3 100644
--- a/services/core/java/com/android/server/pm/PackageInstallerSession.java
+++ b/services/core/java/com/android/server/pm/PackageInstallerSession.java
@@ -21,9 +21,17 @@ import static android.app.admin.DevicePolicyResources.Strings.Core.PACKAGE_INSTA
import static android.app.admin.DevicePolicyResources.Strings.Core.PACKAGE_UPDATED_BY_DO;
import static android.content.pm.DataLoaderType.INCREMENTAL;
import static android.content.pm.DataLoaderType.STREAMING;
+import static android.content.pm.PackageInstaller.EXTRA_VERIFICATION_FAILURE_REASON;
import static android.content.pm.PackageInstaller.LOCATION_DATA_APP;
import static android.content.pm.PackageInstaller.UNARCHIVAL_OK;
import static android.content.pm.PackageInstaller.UNARCHIVAL_STATUS_UNSET;
+import static android.content.pm.PackageInstaller.VERIFICATION_FAILED_REASON_NETWORK_UNAVAILABLE;
+import static android.content.pm.PackageInstaller.VERIFICATION_FAILED_REASON_PACKAGE_BLOCKED;
+import static android.content.pm.PackageInstaller.VERIFICATION_FAILED_REASON_UNKNOWN;
+import static android.content.pm.PackageInstaller.VERIFICATION_POLICY_BLOCK_FAIL_CLOSED;
+import static android.content.pm.PackageInstaller.VERIFICATION_POLICY_BLOCK_FAIL_OPEN;
+import static android.content.pm.PackageInstaller.VERIFICATION_POLICY_BLOCK_FAIL_WARN;
+import static android.content.pm.PackageInstaller.VERIFICATION_POLICY_NONE;
import static android.content.pm.PackageItemInfo.MAX_SAFE_LABEL_LENGTH;
import static android.content.pm.PackageManager.INSTALL_FAILED_ABORTED;
import static android.content.pm.PackageManager.INSTALL_FAILED_BAD_SIGNATURE;
@@ -38,7 +46,7 @@ import static android.content.pm.PackageManager.INSTALL_FAILED_VERIFICATION_FAIL
import static android.content.pm.PackageManager.INSTALL_PARSE_FAILED_NO_CERTIFICATES;
import static android.content.pm.PackageManager.INSTALL_STAGED;
import static android.content.pm.PackageManager.INSTALL_SUCCEEDED;
-import static android.content.pm.verify.pkg.VerificationSession.VERIFICATION_INCOMPLETE_UNKNOWN;
+import static android.content.pm.verify.pkg.VerificationSession.VERIFICATION_INCOMPLETE_NETWORK_UNAVAILABLE;
import static android.os.Process.INVALID_UID;
import static android.provider.DeviceConfig.NAMESPACE_PACKAGE_MANAGER_SERVICE;
import static android.system.OsConstants.O_CREAT;
@@ -226,7 +234,6 @@ import java.util.concurrent.CompletableFuture;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.function.Predicate;
-import java.util.function.Supplier;
public class PackageInstallerSession extends IPackageInstallerSession.Stub {
private static final String TAG = "PackageInstallerSession";
@@ -313,6 +320,7 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub {
private static final String ATTR_APPLICATION_ENABLED_SETTING_PERSISTENT =
"applicationEnabledSettingPersistent";
private static final String ATTR_DOMAIN = "domain";
+ private static final String ATTR_VERIFICATION_POLICY = "verificationPolicy";
private static final String PROPERTY_NAME_INHERIT_NATIVE = "pi.inherit_native_on_dont_kill";
private static final int[] EMPTY_CHILD_SESSION_ARRAY = EmptyArray.INT;
@@ -410,6 +418,11 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub {
private final PackageSessionProvider mSessionProvider;
private final SilentUpdatePolicy mSilentUpdatePolicy;
/**
+ * The verification policy applied to this session, which might be different from the default
+ * verification policy used by the system.
+ */
+ private final AtomicInteger mVerificationPolicy;
+ /**
* Note all calls must be done outside {@link #mLock} to prevent lock inversion.
*/
private final StagingManager mStagingManager;
@@ -791,7 +804,8 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub {
if (errorMsg != null) {
Slog.e(TAG, "verifySession error: " + errorMsg);
setSessionFailed(INSTALL_FAILED_INTERNAL_ERROR, errorMsg);
- onSessionVerificationFailure(INSTALL_FAILED_INTERNAL_ERROR, errorMsg);
+ onSessionVerificationFailure(INSTALL_FAILED_INTERNAL_ERROR, errorMsg,
+ /* extras= */ null);
return false;
}
return true;
@@ -1167,7 +1181,8 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub {
@Nullable int[] childSessionIds, int parentSessionId, boolean isReady,
boolean isFailed, boolean isApplied, int sessionErrorCode,
String sessionErrorMessage, DomainSet preVerifiedDomains,
- @NonNull VerifierController verifierController) {
+ @NonNull VerifierController verifierController,
+ @PackageInstaller.VerificationPolicy int verificationPolicy) {
mCallback = callback;
mContext = context;
mPm = pm;
@@ -1177,6 +1192,7 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub {
mHandler = new Handler(looper, mHandlerCallback);
mStagingManager = stagingManager;
mVerifierController = verifierController;
+ mVerificationPolicy = new AtomicInteger(verificationPolicy);
this.sessionId = sessionId;
this.userId = userId;
@@ -1262,9 +1278,9 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub {
}
}
- if (Flags.verificationService()) {
+ if (shouldUseVerificationService()) {
// Start binding to the verification service, if not bound already.
- mVerifierController.bindToVerifierServiceIfNeeded(() -> pm.snapshotComputer(), userId);
+ mVerifierController.bindToVerifierServiceIfNeeded(mPm::snapshotComputer, userId);
if (!TextUtils.isEmpty(params.appPackageName)) {
mVerifierController.notifyPackageNameAvailable(params.appPackageName);
}
@@ -2580,10 +2596,10 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub {
dispatchSessionFinished(error, detailMessage, null);
}
- private void onSessionVerificationFailure(int error, String msg) {
+ private void onSessionVerificationFailure(int error, String msg, Bundle extras) {
Slog.e(TAG, "Failed to verify session " + sessionId);
// Dispatch message to remove session from PackageInstallerService.
- dispatchSessionFinished(error, msg, null);
+ dispatchSessionFinished(error, msg, extras);
maybeFinishChildSessions(error, msg);
}
@@ -2856,38 +2872,60 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub {
final String completeMsg = ExceptionUtils.getCompleteMessage(e);
final String errorMsg = PackageManager.installStatusToString(e.error, completeMsg);
setSessionFailed(e.error, errorMsg);
- onSessionVerificationFailure(e.error, errorMsg);
- }
- if (Flags.verificationService()) {
- final Supplier<Computer> snapshotSupplier = mPm::snapshotComputer;
- if (mVerifierController.isVerifierInstalled(snapshotSupplier, userId)) {
- final SigningInfo signingInfo;
- final List<SharedLibraryInfo> declaredLibraries;
- synchronized (mLock) {
- signingInfo = new SigningInfo(mSigningDetails);
- declaredLibraries =
- mPackageLite == null ? null : mPackageLite.getDeclaredLibraries();
- }
- // Send the request to the verifier and wait for its response before the rest of
- // the installation can proceed.
- if (!mVerifierController.startVerificationSession(snapshotSupplier, userId,
- sessionId, getPackageName(), Uri.fromFile(stageDir), signingInfo,
- declaredLibraries, /* extensionParams= */ null,
- new VerifierCallback(), /* retry= */ false)) {
- // A verifier is installed but cannot be connected. Installation disallowed.
- onSessionVerificationFailure(INSTALL_FAILED_INTERNAL_ERROR,
- "A verifier agent is available on device but cannot be connected.");
- }
- } else {
- // Verifier is not installed. Let the installation pass for now.
- resumeVerify();
+ onSessionVerificationFailure(e.error, errorMsg, /* extras= */ null);
+ }
+ if (shouldUseVerificationService()) {
+ final SigningInfo signingInfo;
+ final List<SharedLibraryInfo> declaredLibraries;
+ synchronized (mLock) {
+ signingInfo = new SigningInfo(mSigningDetails);
+ declaredLibraries =
+ mPackageLite == null ? null : mPackageLite.getDeclaredLibraries();
+ }
+ // Send the request to the verifier and wait for its response before the rest of
+ // the installation can proceed.
+ if (!mVerifierController.startVerificationSession(mPm::snapshotComputer, userId,
+ sessionId, getPackageName(), Uri.fromFile(stageDir), signingInfo,
+ declaredLibraries, mVerificationPolicy.get(), /* extensionParams= */ null,
+ new VerifierCallback(), /* retry= */ false)) {
+ // A verifier is installed but cannot be connected. Installation disallowed.
+ onSessionVerificationFailure(INSTALL_FAILED_INTERNAL_ERROR,
+ "A verifier agent is available on device but cannot be connected.",
+ /* extras= */ null);
}
} else {
- // New verification feature is not enabled. Proceed to the rest of the verification.
+ // No need to check with verifier. Proceed with the rest of the verification.
resumeVerify();
}
}
+ private boolean shouldUseVerificationService() {
+ if (!Flags.verificationService()) {
+ // Feature is not enabled.
+ return false;
+ }
+ if ((params.installFlags & PackageManager.INSTALL_FROM_ADB) != 0) {
+ // adb installs are exempted from verification unless explicitly requested
+ if (!params.forceVerification) {
+ return false;
+ }
+ }
+ final String verifierPackageName = mVerifierController.getVerifierPackageName(
+ mPm::snapshotComputer, userId);
+ if (verifierPackageName == null) {
+ // Feature is enabled but no verifier installed.
+ return false;
+ }
+ synchronized (mLock) {
+ if (verifierPackageName.equals(mPackageName)) {
+ // The verifier itself is being updated. Skip.
+ Slog.w(TAG, "Skipping verification service because the verifier is being updated");
+ return false;
+ }
+ }
+ return true;
+ }
+
private void resumeVerify() {
if (mVerificationInProgress) {
Slog.w(TAG, "Verification is already in progress for session " + sessionId);
@@ -2917,7 +2955,7 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub {
final String completeMsg = ExceptionUtils.getCompleteMessage(e);
final String errorMsg = PackageManager.installStatusToString(e.error, completeMsg);
setSessionFailed(e.error, errorMsg);
- onSessionVerificationFailure(e.error, errorMsg);
+ onSessionVerificationFailure(e.error, errorMsg, /* extras= */ null);
}
}
@@ -2926,24 +2964,57 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub {
*/
public class VerifierCallback {
/**
+ * Called by the VerifierController when the verifier requests to get the current
+ * verification policy for this session.
+ */
+ public @PackageInstaller.VerificationPolicy int getVerificationPolicy() {
+ return mVerificationPolicy.get();
+ }
+ /**
+ * Called by the VerifierController when the verifier requests to change the verification
+ * policy for this session.
+ */
+ public boolean setVerificationPolicy(@PackageInstaller.VerificationPolicy int policy) {
+ if (!isValidVerificationPolicy(policy)) {
+ return false;
+ }
+ mVerificationPolicy.set(policy);
+ return true;
+ }
+ /**
* Called by the VerifierController when the connection has failed.
*/
public void onConnectionFailed() {
- mHandler.post(() -> {
- onSessionVerificationFailure(INSTALL_FAILED_VERIFICATION_FAILURE,
- "A verifier agent is available on device but cannot be connected.");
- });
+ // TODO(b/360129657): prompt user on fail warning
+ handleNonPackageBlockedFailure(
+ /* onFailWarning= */ PackageInstallerSession.this::resumeVerify,
+ /* onFailClosed= */ () -> {
+ Bundle bundle = new Bundle();
+ bundle.putInt(EXTRA_VERIFICATION_FAILURE_REASON,
+ VERIFICATION_FAILED_REASON_UNKNOWN);
+ onSessionVerificationFailure(INSTALL_FAILED_VERIFICATION_FAILURE,
+ "A verifier agent is available on device but cannot be connected.",
+ bundle);
+
+ });
}
/**
* Called by the VerifierController when the verification request has timed out.
*/
public void onTimeout() {
- mHandler.post(() -> {
- mVerifierController.notifyVerificationTimeout(sessionId);
- onSessionVerificationFailure(INSTALL_FAILED_VERIFICATION_FAILURE,
- "Verification timed out; missing a response from the verifier within the"
- + " time limit");
- });
+ // Always notify the verifier, regardless of the policy.
+ mVerifierController.notifyVerificationTimeout(sessionId);
+ // TODO(b/360129657): prompt user on fail warning
+ handleNonPackageBlockedFailure(
+ /* onFailWarning= */ PackageInstallerSession.this::resumeVerify,
+ /* onFailClosed= */ () -> {
+ Bundle bundle = new Bundle();
+ bundle.putInt(EXTRA_VERIFICATION_FAILURE_REASON,
+ VERIFICATION_FAILED_REASON_UNKNOWN);
+ onSessionVerificationFailure(INSTALL_FAILED_VERIFICATION_FAILURE,
+ "Verification timed out; missing a response from the verifier"
+ + " within the time limit", bundle);
+ });
}
/**
* Called by the VerifierController when the verification request has received a complete
@@ -2953,17 +3024,22 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub {
@Nullable PersistableBundle extensionResponse) {
// TODO: handle extension response
mHandler.post(() -> {
- if (statusReceived.isVerified()) {
+ if (statusReceived.isVerified()
+ || mVerificationPolicy.get() == VERIFICATION_POLICY_NONE) {
// Continue with the rest of the verification and installation.
resumeVerify();
- } else {
- StringBuilder sb = new StringBuilder("Verifier rejected the installation");
- if (!TextUtils.isEmpty(statusReceived.getFailureMessage())) {
- sb.append(" with message: ").append(statusReceived.getFailureMessage());
- }
- onSessionVerificationFailure(INSTALL_FAILED_VERIFICATION_FAILURE,
- sb.toString());
+ return;
}
+ // Package is blocked.
+ StringBuilder sb = new StringBuilder("Verifier rejected the installation");
+ if (!TextUtils.isEmpty(statusReceived.getFailureMessage())) {
+ sb.append(" with message: ").append(statusReceived.getFailureMessage());
+ }
+ Bundle bundle = new Bundle();
+ bundle.putInt(EXTRA_VERIFICATION_FAILURE_REASON,
+ VERIFICATION_FAILED_REASON_PACKAGE_BLOCKED);
+ onSessionVerificationFailure(INSTALL_FAILED_VERIFICATION_FAILURE,
+ sb.toString(), bundle);
});
}
/**
@@ -2971,16 +3047,51 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub {
* response.
*/
public void onVerificationIncompleteReceived(int incompleteReason) {
- mHandler.post(() -> {
- if (incompleteReason == VERIFICATION_INCOMPLETE_UNKNOWN) {
- // TODO: change this to a user confirmation and handle other incomplete reasons
- onSessionVerificationFailure(INSTALL_FAILED_INTERNAL_ERROR,
- "Verification cannot be completed for unknown reasons.");
+ // TODO(b/360129657): prompt user on fail warning
+ handleNonPackageBlockedFailure(
+ /* onFailWarning= */ PackageInstallerSession.this::resumeVerify,
+ /* onFailClosed= */ () -> {
+ final int failureReason;
+ StringBuilder sb = new StringBuilder(
+ "Verification cannot be completed because of ");
+ if (incompleteReason == VERIFICATION_INCOMPLETE_NETWORK_UNAVAILABLE) {
+ failureReason = VERIFICATION_FAILED_REASON_NETWORK_UNAVAILABLE;
+ sb.append("unavailable network.");
+ } else {
+ failureReason = VERIFICATION_FAILED_REASON_UNKNOWN;
+ sb.append("unknown reasons.");
+ }
+ Bundle bundle = new Bundle();
+ bundle.putInt(EXTRA_VERIFICATION_FAILURE_REASON, failureReason);
+ onSessionVerificationFailure(INSTALL_FAILED_VERIFICATION_FAILURE,
+ sb.toString(), bundle);
+ });
+ }
+
+ private void handleNonPackageBlockedFailure(Runnable onFailWarning, Runnable onFailClosed) {
+ final Runnable r = switch (mVerificationPolicy.get()) {
+ case VERIFICATION_POLICY_NONE, VERIFICATION_POLICY_BLOCK_FAIL_OPEN ->
+ PackageInstallerSession.this::resumeVerify;
+ case VERIFICATION_POLICY_BLOCK_FAIL_WARN -> onFailWarning;
+ case VERIFICATION_POLICY_BLOCK_FAIL_CLOSED -> onFailClosed;
+ default -> {
+ Log.wtf(TAG, "Unknown verification policy: " + mVerificationPolicy.get());
+ yield onFailClosed;
}
- });
+ };
+ mHandler.post(r);
}
}
+ /**
+ * Returns whether a policy is a valid verification policy.
+ */
+ public static boolean isValidVerificationPolicy(
+ @PackageInstaller.VerificationPolicy int policy) {
+ return policy >= VERIFICATION_POLICY_NONE
+ && policy <= VERIFICATION_POLICY_BLOCK_FAIL_CLOSED;
+ }
+
private IntentSender getRemoteStatusReceiver() {
synchronized (mLock) {
return mRemoteStatusReceiver;
@@ -3156,7 +3267,7 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub {
if (error == INSTALL_SUCCEEDED) {
onVerificationComplete();
} else {
- onSessionVerificationFailure(error, msg);
+ onSessionVerificationFailure(error, msg, /* extras= */ null);
}
});
});
@@ -5328,6 +5439,14 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub {
}
}
+ /**
+ * @return the current policy for the verification request associated with this session.
+ */
+ @VisibleForTesting
+ public @PackageInstaller.VerificationPolicy int getVerificationPolicy() {
+ assertCallerIsOwnerOrRoot();
+ return mVerificationPolicy.get();
+ }
void setSessionReady() {
synchronized (mLock) {
@@ -5498,7 +5617,7 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub {
}
} catch (InstallerException ignored) {
}
- if (Flags.verificationService()
+ if (shouldUseVerificationService()
&& !TextUtils.isEmpty(params.appPackageName)
&& !isCommitted()) {
// Only notify for the cancellation if the verification request has not
@@ -5631,6 +5750,10 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub {
if (!ArrayUtils.isEmpty(warnings)) {
fillIn.putStringArrayListExtra(PackageInstaller.EXTRA_WARNINGS, warnings);
}
+ if (extras.containsKey(EXTRA_VERIFICATION_FAILURE_REASON)) {
+ fillIn.putExtra(EXTRA_VERIFICATION_FAILURE_REASON,
+ extras.getInt(EXTRA_VERIFICATION_FAILURE_REASON));
+ }
}
try {
final BroadcastOptions options = BroadcastOptions.makeBasic();
@@ -5786,6 +5909,7 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub {
out.attributeInt(null, ATTR_INSTALL_REASON, params.installReason);
writeBooleanAttribute(out, ATTR_APPLICATION_ENABLED_SETTING_PERSISTENT,
params.applicationEnabledSettingPersistent);
+ out.attributeInt(null, ATTR_VERIFICATION_POLICY, mVerificationPolicy.get());
final boolean isDataLoader = params.dataLoaderParams != null;
writeBooleanAttribute(out, ATTR_IS_DATALOADER, isDataLoader);
@@ -5936,6 +6060,8 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub {
final boolean sealed = in.getAttributeBoolean(null, ATTR_SEALED, false);
final int parentSessionId = in.getAttributeInt(null, ATTR_PARENT_SESSION_ID,
SessionInfo.INVALID_ID);
+ final int verificationPolicy = in.getAttributeInt(null, ATTR_VERIFICATION_POLICY,
+ VERIFICATION_POLICY_NONE);
final SessionParams params = new SessionParams(
SessionParams.MODE_INVALID);
@@ -6110,6 +6236,7 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub {
installerUid, installSource, params, createdMillis, committedMillis, stageDir,
stageCid, fileArray, checksumsMap, prepared, committed, destroyed, sealed,
childSessionIdsArray, parentSessionId, isReady, isFailed, isApplied,
- sessionErrorCode, sessionErrorMessage, preVerifiedDomains, verifierController);
+ sessionErrorCode, sessionErrorMessage, preVerifiedDomains, verifierController,
+ verificationPolicy);
}
}
diff --git a/services/core/java/com/android/server/pm/PackageManagerService.java b/services/core/java/com/android/server/pm/PackageManagerService.java
index 455776993c56..d78f12217271 100644
--- a/services/core/java/com/android/server/pm/PackageManagerService.java
+++ b/services/core/java/com/android/server/pm/PackageManagerService.java
@@ -4709,10 +4709,11 @@ public class PackageManagerService implements PackageSender, TestUtilityService
extras.putLong(Intent.EXTRA_TIME, SystemClock.elapsedRealtime());
mHandler.post(() -> {
mBroadcastHelper.sendPackageBroadcast(Intent.ACTION_PACKAGE_UNSTOPPED,
- packageName, extras,
- Intent.FLAG_RECEIVER_REGISTERED_ONLY, null, null,
- userIds, null, broadcastAllowList, null,
- null);
+ packageName, extras, Intent.FLAG_RECEIVER_REGISTERED_ONLY,
+ null /* targetPkg */, null /* finishedReceiver */, userIds,
+ null /* instantUserIds */, broadcastAllowList,
+ null /* filterExtrasForReceiver */, null /* bOptions */,
+ null /* requiredPermissions */);
});
mPackageMonitorCallbackHelper.notifyPackageMonitor(Intent.ACTION_PACKAGE_UNSTOPPED,
packageName, extras, userIds, null /* instantUserIds */,
@@ -7169,17 +7170,17 @@ public class PackageManagerService implements PackageSender, TestUtilityService
// Sent async using the PM handler, to maintain ordering with PACKAGE_UNSTOPPED
mHandler.post(() -> {
mBroadcastHelper.sendPackageBroadcast(Intent.ACTION_PACKAGE_RESTARTED,
- packageName, extras,
- flags, null, null,
- userIds, null, broadcastAllowList, null,
- null);
+ packageName, extras, flags, null /* targetPkg */,
+ null /* finishedReceiver */, userIds, null /* instantUserIds */,
+ broadcastAllowList, null /* filterExtrasForReceiver */,
+ null /* bOptions */, null /* requiredPermissions */);
});
} else {
mBroadcastHelper.sendPackageBroadcast(Intent.ACTION_PACKAGE_RESTARTED,
- packageName, extras,
- flags, null, null,
- userIds, null, broadcastAllowList, null,
- null);
+ packageName, extras, flags, null /* targetPkg */,
+ null /* finishedReceiver */, userIds, null /* instantUserIds */,
+ broadcastAllowList, null /* filterExtrasForReceiver */, null /* bOptions */,
+ null /* requiredPermissions */);
}
mPackageMonitorCallbackHelper.notifyPackageMonitor(Intent.ACTION_PACKAGE_RESTARTED,
packageName, extras, userIds, null /* instantUserIds */,
diff --git a/services/core/java/com/android/server/pm/PackageManagerShellCommand.java b/services/core/java/com/android/server/pm/PackageManagerShellCommand.java
index 7a53fe78c1bf..4652c3af1185 100644
--- a/services/core/java/com/android/server/pm/PackageManagerShellCommand.java
+++ b/services/core/java/com/android/server/pm/PackageManagerShellCommand.java
@@ -3599,6 +3599,9 @@ class PackageManagerShellCommand extends ShellCommand {
.setCompilerFilter(sessionParams.dexoptCompilerFilter)
.build();
break;
+ case "--force-verification":
+ sessionParams.setForceVerification();
+ break;
default:
throw new IllegalArgumentException("Unknown option " + opt);
}
@@ -4805,6 +4808,7 @@ class PackageManagerShellCommand extends ShellCommand {
pw.println(" https://source.android.com/docs/core/runtime/configure"
+ "#compiler_filters");
pw.println(" or 'skip'");
+ pw.println(" --force-verification: if set, enable the verification for this install");
pw.println("");
pw.println(" install-existing [--user USER_ID|all|current]");
pw.println(" [--instant] [--full] [--wait] [--restrict-permissions] PACKAGE");
diff --git a/services/core/java/com/android/server/pm/UserManagerService.java b/services/core/java/com/android/server/pm/UserManagerService.java
index daf413bb30b3..6ac8b221b21f 100644
--- a/services/core/java/com/android/server/pm/UserManagerService.java
+++ b/services/core/java/com/android/server/pm/UserManagerService.java
@@ -195,6 +195,7 @@ import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
import java.util.Objects;
+import java.util.Optional;
import java.util.Set;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.LinkedBlockingQueue;
@@ -6261,14 +6262,16 @@ public class UserManagerService extends IUserManager.Stub {
Slog.i(LOG_TAG, "removeUser u" + userId);
checkCreateUsersPermission("Only the system can remove users");
- final String restriction = getUserRemovalRestriction(userId);
- if (getUserRestrictions(UserHandle.getCallingUserId()).getBoolean(restriction, false)) {
- Slog.w(LOG_TAG, "Cannot remove user. " + restriction + " is enabled.");
+ final Optional<String> restrictionOptional = getUserRemovalRestrictionOptional(userId);
+ if (!restrictionOptional.isEmpty()
+ && getUserRestrictions(UserHandle.getCallingUserId())
+ .getBoolean(restrictionOptional.get(), false)) {
+ Slog.w(LOG_TAG, "Cannot remove user. " + restrictionOptional.get() + " is enabled.");
return false;
}
if (mCurrentBootPhase < SystemService.PHASE_ACTIVITY_MANAGER_READY) {
Slog.w(LOG_TAG, "Cannot remove user, removeUser is called too early during boot. "
- + "ActivityManager is not ready yet.");
+ + "ActivityManager is not ready yet.");
return false;
}
return removeUserWithProfilesUnchecked(userId);
@@ -6335,18 +6338,30 @@ public class UserManagerService extends IUserManager.Stub {
}
/**
- * Returns the string name of the restriction to check for user removal. The restriction name
- * varies depending on whether the user is a managed profile.
+ * Returns an optional string name of the restriction to check for user removal. The restriction
+ * name varies depending on whether the user is a managed profile.
+ *
+ * <p>If the flag android.multiuser.ignore_restrictions_when_deleting_private_profile is enabled
+ * and the user is a private profile (i.e. has no removal restrictions) the method will return
+ * {@code Optional.empty()}.
*/
- private String getUserRemovalRestriction(@UserIdInt int userId) {
+ private Optional<String> getUserRemovalRestrictionOptional(@UserIdInt int userId) {
+ final boolean isPrivateProfile;
final boolean isManagedProfile;
final UserInfo userInfo;
synchronized (mUsersLock) {
userInfo = getUserInfoLU(userId);
}
+ isPrivateProfile = userInfo != null && userInfo.isPrivateProfile();
isManagedProfile = userInfo != null && userInfo.isManagedProfile();
- return isManagedProfile
- ? UserManager.DISALLOW_REMOVE_MANAGED_PROFILE : UserManager.DISALLOW_REMOVE_USER;
+ if (android.multiuser.Flags.ignoreRestrictionsWhenDeletingPrivateProfile()
+ && isPrivateProfile) {
+ return Optional.empty();
+ }
+ return Optional.of(
+ isManagedProfile
+ ? UserManager.DISALLOW_REMOVE_MANAGED_PROFILE
+ : UserManager.DISALLOW_REMOVE_USER);
}
private boolean removeUserUnchecked(@UserIdInt int userId) {
@@ -6455,9 +6470,13 @@ public class UserManagerService extends IUserManager.Stub {
checkCreateUsersPermission("Only the system can remove users");
if (!overrideDevicePolicy) {
- final String restriction = getUserRemovalRestriction(userId);
- if (getUserRestrictions(UserHandle.getCallingUserId()).getBoolean(restriction, false)) {
- Slog.w(LOG_TAG, "Cannot remove user. " + restriction + " is enabled.");
+ final Optional<String> restrictionOptional = getUserRemovalRestrictionOptional(userId);
+ if (!restrictionOptional.isEmpty()
+ && getUserRestrictions(UserHandle.getCallingUserId())
+ .getBoolean(restrictionOptional.get(), false)) {
+ Slog.w(
+ LOG_TAG,
+ "Cannot remove user. " + restrictionOptional.get() + " is enabled.");
return UserManager.REMOVE_RESULT_ERROR_USER_RESTRICTION;
}
}
diff --git a/services/core/java/com/android/server/pm/verify/pkg/VerificationStatusTracker.java b/services/core/java/com/android/server/pm/verify/pkg/VerificationStatusTracker.java
index db747f9940a0..67ac2a7572d8 100644
--- a/services/core/java/com/android/server/pm/verify/pkg/VerificationStatusTracker.java
+++ b/services/core/java/com/android/server/pm/verify/pkg/VerificationStatusTracker.java
@@ -30,9 +30,6 @@ public final class VerificationStatusTracker {
private final @CurrentTimeMillisLong long mMaxTimeoutTime;
@NonNull
private final VerifierController.Injector mInjector;
- // Record the package name associated with the verification result
- @NonNull
- private final String mPackageName;
/**
* By default, the timeout time is the default timeout duration plus the current time (when
@@ -41,10 +38,8 @@ public final class VerificationStatusTracker {
* can be extended via {@link #extendTimeRemaining} to the maximum allowed.
*/
@VisibleForTesting(visibility = VisibleForTesting.Visibility.PROTECTED)
- public VerificationStatusTracker(@NonNull String packageName,
- long defaultTimeoutMillis, long maxExtendedTimeoutMillis,
+ public VerificationStatusTracker(long defaultTimeoutMillis, long maxExtendedTimeoutMillis,
@NonNull VerifierController.Injector injector) {
- mPackageName = packageName;
mStartTime = injector.getCurrentTimeMillis();
mTimeoutTime = mStartTime + defaultTimeoutMillis;
mMaxTimeoutTime = mStartTime + maxExtendedTimeoutMillis;
@@ -93,9 +88,4 @@ public final class VerificationStatusTracker {
public boolean isTimeout() {
return mInjector.getCurrentTimeMillis() >= mTimeoutTime;
}
-
- @NonNull
- public String getPackageName() {
- return mPackageName;
- }
}
diff --git a/services/core/java/com/android/server/pm/verify/pkg/VerifierController.java b/services/core/java/com/android/server/pm/verify/pkg/VerifierController.java
index 7eac940933c2..a35618b309bb 100644
--- a/services/core/java/com/android/server/pm/verify/pkg/VerifierController.java
+++ b/services/core/java/com/android/server/pm/verify/pkg/VerifierController.java
@@ -30,11 +30,11 @@ import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ApplicationInfo;
+import android.content.pm.PackageInstaller;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.content.pm.SharedLibraryInfo;
import android.content.pm.SigningInfo;
-import android.content.pm.verify.pkg.IVerificationSessionCallback;
import android.content.pm.verify.pkg.IVerificationSessionInterface;
import android.content.pm.verify.pkg.IVerifierService;
import android.content.pm.verify.pkg.VerificationSession;
@@ -44,7 +44,6 @@ import android.os.Build;
import android.os.Handler;
import android.os.PersistableBundle;
import android.os.Process;
-import android.os.RemoteException;
import android.os.UserHandle;
import android.provider.DeviceConfig;
import android.util.Pair;
@@ -94,9 +93,22 @@ public class VerifierController {
// Max duration allowed to wait for a verifier to respond to a verification request.
private static final long DEFAULT_MAX_VERIFICATION_REQUEST_EXTENDED_TIMEOUT_MILLIS =
TimeUnit.MINUTES.toMillis(10);
+ /**
+ * Configurable maximum amount of time in milliseconds for the system to wait from the moment
+ * when the installation session requires a verification, till when the request is delivered to
+ * the verifier, pending the connection to be established. If the request has not been delivered
+ * to the verifier within this amount of time, e.g., because the verifier has crashed or ANR'd,
+ * the controller then sends a failure status back to the installation session.
+ * Flag type: {@code long}
+ * Namespace: NAMESPACE_PACKAGE_MANAGER_SERVICE
+ */
+ private static final String PROPERTY_VERIFIER_CONNECTION_TIMEOUT_MILLIS =
+ "verifier_connection_timeout_millis";
// The maximum amount of time to wait from the moment when the session requires a verification,
// till when the request is delivered to the verifier, pending the connection to be established.
- private static final long CONNECTION_TIMEOUT_SECONDS = 10;
+ private static final long DEFAULT_VERIFIER_CONNECTION_TIMEOUT_MILLIS =
+ TimeUnit.SECONDS.toMillis(10);
+
// The maximum amount of time to wait before the system unbinds from the verifier.
private static final long UNBIND_TIMEOUT_MILLIS = TimeUnit.HOURS.toMillis(6);
@@ -127,15 +139,16 @@ public class VerifierController {
}
/**
- * Used by the installation session to check if a verifier is installed.
+ * Used by the installation session to get the package name of the installed verifier.
*/
- public boolean isVerifierInstalled(Supplier<Computer> snapshotSupplier, int userId) {
+ @Nullable
+ public String getVerifierPackageName(Supplier<Computer> snapshotSupplier, int userId) {
if (isVerifierConnected()) {
// Verifier is connected or is being connected, so it must be installed.
- return true;
+ return mRemoteServiceComponentName.getPackageName();
}
// Verifier has been disconnected, or it hasn't been connected. Check if it's installed.
- return mInjector.isVerifierInstalled(snapshotSupplier.get(), userId);
+ return mInjector.getVerifierPackageName(snapshotSupplier.get(), userId);
}
/**
@@ -271,6 +284,7 @@ public class VerifierController {
int installationSessionId, String packageName,
Uri stagedPackageUri, SigningInfo signingInfo,
List<SharedLibraryInfo> declaredLibraries,
+ @PackageInstaller.VerificationPolicy int verificationPolicy,
PersistableBundle extensionParams, PackageInstallerSession.VerifierCallback callback,
boolean retry) {
// Try connecting to the verifier if not already connected
@@ -292,8 +306,7 @@ public class VerifierController {
/* id= */ verificationId,
/* installSessionId= */ installationSessionId,
packageName, stagedPackageUri, signingInfo, declaredLibraries, extensionParams,
- new VerificationSessionInterface(),
- new VerificationSessionCallback(callback));
+ verificationPolicy, new VerificationSessionInterface(callback));
AndroidFuture<Void> unusedFuture = mRemoteService.post(service -> {
if (!retry) {
if (DEBUG) {
@@ -306,7 +319,8 @@ public class VerifierController {
}
service.onVerificationRetry(session);
}
- }).orTimeout(CONNECTION_TIMEOUT_SECONDS, TimeUnit.SECONDS).whenComplete((res, err) -> {
+ }).orTimeout(mInjector.getVerifierConnectionTimeoutMillis(), TimeUnit.MILLISECONDS)
+ .whenComplete((res, err) -> {
if (err != null) {
Slog.e(TAG, "Error notifying verification request for session " + verificationId,
err);
@@ -318,7 +332,7 @@ public class VerifierController {
final long defaultTimeoutMillis = mInjector.getVerificationRequestTimeoutMillis();
final long maxExtendedTimeoutMillis = mInjector.getMaxVerificationExtendedTimeoutMillis();
final VerificationStatusTracker tracker = new VerificationStatusTracker(
- packageName, defaultTimeoutMillis, maxExtendedTimeoutMillis, mInjector);
+ defaultTimeoutMillis, maxExtendedTimeoutMillis, mInjector);
synchronized (mVerificationStatus) {
mVerificationStatus.put(verificationId, tracker);
}
@@ -407,6 +421,12 @@ public class VerifierController {
// This class handles requests from the remote verifier
private class VerificationSessionInterface extends IVerificationSessionInterface.Stub {
+ private final PackageInstallerSession.VerifierCallback mCallback;
+
+ VerificationSessionInterface(PackageInstallerSession.VerifierCallback callback) {
+ mCallback = callback;
+ }
+
@Override
public long getTimeoutTime(int verificationId) {
checkCallerPermission();
@@ -432,17 +452,23 @@ public class VerifierController {
return tracker.extendTimeRemaining(additionalMs);
}
}
- }
- private class VerificationSessionCallback extends IVerificationSessionCallback.Stub {
- private final PackageInstallerSession.VerifierCallback mCallback;
-
- VerificationSessionCallback(PackageInstallerSession.VerifierCallback callback) {
- mCallback = callback;
+ @Override
+ public boolean setVerificationPolicy(int verificationId,
+ @PackageInstaller.VerificationPolicy int policy) {
+ checkCallerPermission();
+ synchronized (mVerificationStatus) {
+ final VerificationStatusTracker tracker = mVerificationStatus.get(verificationId);
+ if (tracker == null) {
+ throw new IllegalStateException("Verification session " + verificationId
+ + " doesn't exist or has finished");
+ }
+ }
+ return mCallback.setVerificationPolicy(policy);
}
@Override
- public void reportVerificationIncomplete(int id, int reason) throws RemoteException {
+ public void reportVerificationIncomplete(int id, int reason) {
checkCallerPermission();
final VerificationStatusTracker tracker;
synchronized (mVerificationStatus) {
@@ -451,23 +477,21 @@ public class VerifierController {
throw new IllegalStateException("Verification session " + id
+ " doesn't exist or has finished");
}
- mCallback.onVerificationIncompleteReceived(reason);
}
+ mCallback.onVerificationIncompleteReceived(reason);
// Remove status tracking and stop the timeout countdown
removeStatusTracker(id);
}
@Override
- public void reportVerificationComplete(int id, VerificationStatus verificationStatus)
- throws RemoteException {
+ public void reportVerificationComplete(int id, VerificationStatus verificationStatus) {
reportVerificationCompleteWithExtensionResponse(id, verificationStatus,
/* extensionResponse= */ null);
}
@Override
public void reportVerificationCompleteWithExtensionResponse(int id,
- VerificationStatus verificationStatus, PersistableBundle extensionResponse)
- throws RemoteException {
+ VerificationStatus verificationStatus, PersistableBundle extensionResponse) {
checkCallerPermission();
final VerificationStatusTracker tracker;
synchronized (mVerificationStatus) {
@@ -519,10 +543,15 @@ public class VerifierController {
}
/**
- * Check if a verifier is installed on this device.
+ * Return the package name of the verifier installed on this device.
*/
- public boolean isVerifierInstalled(Computer snapshot, int userId) {
- return resolveVerifierComponentName(snapshot, userId) != null;
+ @Nullable
+ public String getVerifierPackageName(Computer snapshot, int userId) {
+ final ComponentName componentName = resolveVerifierComponentName(snapshot, userId);
+ if (componentName == null) {
+ return null;
+ }
+ return componentName.getPackageName();
}
/**
@@ -630,6 +659,14 @@ public class VerifierController {
return getMaxVerificationExtendedTimeoutMillisFromDeviceConfig();
}
+ /**
+ * This is added so that we can mock the maximum connection timeout duration without
+ * calling into DeviceConfig.
+ */
+ public long getVerifierConnectionTimeoutMillis() {
+ return getVerifierConnectionTimeoutMillisFromDeviceConfig();
+ }
+
private static long getVerificationRequestTimeoutMillisFromDeviceConfig() {
return DeviceConfig.getLong(NAMESPACE_PACKAGE_MANAGER_SERVICE,
PROPERTY_VERIFICATION_REQUEST_TIMEOUT_MILLIS,
@@ -641,5 +678,11 @@ public class VerifierController {
PROPERTY_MAX_VERIFICATION_REQUEST_EXTENDED_TIMEOUT_MILLIS,
DEFAULT_MAX_VERIFICATION_REQUEST_EXTENDED_TIMEOUT_MILLIS);
}
+
+ private static long getVerifierConnectionTimeoutMillisFromDeviceConfig() {
+ return DeviceConfig.getLong(NAMESPACE_PACKAGE_MANAGER_SERVICE,
+ PROPERTY_VERIFIER_CONNECTION_TIMEOUT_MILLIS,
+ DEFAULT_VERIFIER_CONNECTION_TIMEOUT_MILLIS);
+ }
}
}
diff --git a/services/core/java/com/android/server/power/stats/BatteryExternalStatsWorker.java b/services/core/java/com/android/server/power/stats/BatteryExternalStatsWorker.java
index 8311034c0298..f90da644c0ce 100644
--- a/services/core/java/com/android/server/power/stats/BatteryExternalStatsWorker.java
+++ b/services/core/java/com/android/server/power/stats/BatteryExternalStatsWorker.java
@@ -27,12 +27,11 @@ import android.net.wifi.WifiManager;
import android.os.BatteryConsumer;
import android.os.BatteryStats;
import android.os.Bundle;
+import android.os.Handler;
import android.os.OutcomeReceiver;
import android.os.Parcelable;
-import android.os.Process;
import android.os.SynchronousResultReceiver;
import android.os.SystemClock;
-import android.os.ThreadLocalWorkSource;
import android.os.connectivity.WifiActivityEnergyInfo;
import android.power.PowerStatsInternal;
import android.telephony.ModemActivityInfo;
@@ -50,11 +49,7 @@ import com.android.server.LocalServices;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Executor;
-import java.util.concurrent.Executors;
import java.util.concurrent.Future;
-import java.util.concurrent.RejectedExecutionException;
-import java.util.concurrent.ScheduledExecutorService;
-import java.util.concurrent.ThreadFactory;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
@@ -85,29 +80,23 @@ public class BatteryExternalStatsWorker implements BatteryStatsImpl.ExternalStat
// stop running.
public static final int UID_FINAL_REMOVAL_AFTER_USER_REMOVAL_DELAY_MILLIS = 10_000;
- private final ScheduledExecutorService mExecutorService =
- Executors.newSingleThreadScheduledExecutor(
- (ThreadFactory) r -> {
- Thread t = new Thread(
- () -> {
- ThreadLocalWorkSource.setUid(Process.myUid());
- r.run();
- },
- "batterystats-worker");
- t.setPriority(Thread.NORM_PRIORITY);
- return t;
- });
+ // Various types of sync, passed to Handler
+ private static final int SYNC_UPDATE = 1;
+ private static final int SYNC_WAKELOCK_CHANGE = 2;
+ private static final int SYNC_BATTERY_LEVEL_CHANGE = 3;
+ private static final int SYNC_PROCESS_STATE_CHANGE = 4;
+ private static final int SYNC_USER_REMOVAL = 5;
+
+ private final Handler mHandler;
@GuardedBy("mStats")
private final BatteryStatsImpl mStats;
@GuardedBy("this")
+ @ExternalUpdateFlag
private int mUpdateFlags = 0;
@GuardedBy("this")
- private Future<?> mCurrentFuture = null;
-
- @GuardedBy("this")
private String mCurrentReason = null;
@GuardedBy("this")
@@ -125,15 +114,6 @@ public class BatteryExternalStatsWorker implements BatteryStatsImpl.ExternalStat
@GuardedBy("this")
private boolean mUseLatestStates = true;
- @GuardedBy("this")
- private Future<?> mWakelockChangesUpdate;
-
- @GuardedBy("this")
- private Future<?> mBatteryLevelSync;
-
- @GuardedBy("this")
- private Future<?> mProcessStateSync;
-
// If both mStats and mWorkerLock need to be synchronized, mWorkerLock must be acquired first.
private final Object mWorkerLock = new Object();
@@ -190,14 +170,15 @@ public class BatteryExternalStatsWorker implements BatteryStatsImpl.ExternalStat
}
}
- public BatteryExternalStatsWorker(Context context, BatteryStatsImpl stats) {
- this(new Injector(context), stats);
+ public BatteryExternalStatsWorker(Context context, BatteryStatsImpl stats, Handler handler) {
+ this(new Injector(context), stats, handler);
}
@VisibleForTesting
- BatteryExternalStatsWorker(Injector injector, BatteryStatsImpl stats) {
+ BatteryExternalStatsWorker(Injector injector, BatteryStatsImpl stats, Handler handler) {
mInjector = injector;
mStats = stats;
+ mHandler = handler;
}
public void systemServicesReady() {
@@ -249,20 +230,20 @@ public class BatteryExternalStatsWorker implements BatteryStatsImpl.ExternalStat
}
@Override
- public synchronized Future<?> scheduleSync(String reason, int flags) {
- return scheduleSyncLocked(reason, flags);
+ public synchronized void scheduleSync(String reason, @ExternalUpdateFlag int flags) {
+ scheduleSyncLocked(reason, flags);
}
@Override
- public synchronized Future<?> scheduleCpuSyncDueToRemovedUid(int uid) {
- return scheduleSyncLocked("remove-uid", UPDATE_CPU);
+ public synchronized void scheduleCpuSyncDueToRemovedUid(int uid) {
+ scheduleSyncLocked("remove-uid", UPDATE_CPU);
}
@Override
- public Future<?> scheduleSyncDueToScreenStateChange(int flags, boolean onBattery,
+ public void scheduleSyncDueToScreenStateChange(@ExternalUpdateFlag int flags, boolean onBattery,
boolean onBatteryScreenOff, int screenState, int[] perDisplayScreenStates) {
synchronized (BatteryExternalStatsWorker.this) {
- if (mCurrentFuture == null || (mUpdateFlags & UPDATE_CPU) == 0) {
+ if (!mHandler.hasMessages(SYNC_UPDATE) || (mUpdateFlags & UPDATE_CPU) == 0) {
mOnBattery = onBattery;
mOnBatteryScreenOff = onBatteryScreenOff;
mUseLatestStates = false;
@@ -270,91 +251,70 @@ public class BatteryExternalStatsWorker implements BatteryStatsImpl.ExternalStat
// always update screen state
mScreenState = screenState;
mPerDisplayScreenStates = perDisplayScreenStates;
- return scheduleSyncLocked("screen-state", flags);
+ scheduleSyncLocked("screen-state", flags);
}
}
@Override
- public Future<?> scheduleCpuSyncDueToWakelockChange(long delayMillis) {
+ public void scheduleCpuSyncDueToWakelockChange(long delayMillis) {
synchronized (BatteryExternalStatsWorker.this) {
- mWakelockChangesUpdate = scheduleDelayedSyncLocked(mWakelockChangesUpdate,
+ scheduleDelayedSyncLocked(SYNC_WAKELOCK_CHANGE,
() -> {
scheduleSync("wakelock-change", UPDATE_CPU);
scheduleRunnable(() -> mStats.postBatteryNeedsCpuUpdateMsg());
},
delayMillis);
- return mWakelockChangesUpdate;
}
}
@Override
public void cancelCpuSyncDueToWakelockChange() {
- synchronized (BatteryExternalStatsWorker.this) {
- if (mWakelockChangesUpdate != null) {
- mWakelockChangesUpdate.cancel(false);
- mWakelockChangesUpdate = null;
- }
- }
+ mHandler.removeMessages(SYNC_WAKELOCK_CHANGE);
}
@Override
- public Future<?> scheduleSyncDueToBatteryLevelChange(long delayMillis) {
+ public void scheduleSyncDueToBatteryLevelChange(long delayMillis) {
synchronized (BatteryExternalStatsWorker.this) {
- mBatteryLevelSync = scheduleDelayedSyncLocked(mBatteryLevelSync,
+ scheduleDelayedSyncLocked(SYNC_BATTERY_LEVEL_CHANGE,
() -> scheduleSync("battery-level", UPDATE_ALL),
delayMillis);
- return mBatteryLevelSync;
}
}
@GuardedBy("this")
private void cancelSyncDueToBatteryLevelChangeLocked() {
- if (mBatteryLevelSync != null) {
- mBatteryLevelSync.cancel(false);
- mBatteryLevelSync = null;
- }
+ mHandler.removeMessages(SYNC_BATTERY_LEVEL_CHANGE);
}
@Override
public void scheduleSyncDueToProcessStateChange(int flags, long delayMillis) {
synchronized (BatteryExternalStatsWorker.this) {
- mProcessStateSync = scheduleDelayedSyncLocked(mProcessStateSync,
+ scheduleDelayedSyncLocked(SYNC_PROCESS_STATE_CHANGE,
() -> scheduleSync("procstate-change", flags),
delayMillis);
}
}
public void cancelSyncDueToProcessStateChange() {
- synchronized (BatteryExternalStatsWorker.this) {
- if (mProcessStateSync != null) {
- mProcessStateSync.cancel(false);
- mProcessStateSync = null;
- }
- }
+ mHandler.removeMessages(SYNC_PROCESS_STATE_CHANGE);
}
@Override
- public Future<?> scheduleCleanupDueToRemovedUser(int userId) {
- synchronized (BatteryExternalStatsWorker.this) {
- try {
- // Initial quick clean-up after a user removal
- mExecutorService.schedule(() -> {
- synchronized (mStats) {
- mStats.clearRemovedUserUidsLocked(userId);
- }
- }, UID_QUICK_REMOVAL_AFTER_USER_REMOVAL_DELAY_MILLIS, TimeUnit.MILLISECONDS);
+ public void scheduleCleanupDueToRemovedUser(int userId) {
+ // Initial quick clean-up after a user removal
+ mHandler.postDelayed(() -> {
+ synchronized (mStats) {
+ mStats.clearRemovedUserUidsLocked(userId);
+ }
+ }, SYNC_USER_REMOVAL, UID_QUICK_REMOVAL_AFTER_USER_REMOVAL_DELAY_MILLIS);
- // Final clean-up after a user removal, to take care of UIDs that were running
- // longer than expected
- return mExecutorService.schedule(() -> {
- synchronized (mStats) {
- mStats.clearRemovedUserUidsLocked(userId);
- }
- }, UID_FINAL_REMOVAL_AFTER_USER_REMOVAL_DELAY_MILLIS, TimeUnit.MILLISECONDS);
- } catch (RejectedExecutionException e) {
- return CompletableFuture.failedFuture(e);
+ // Final clean-up after a user removal, to take care of UIDs that were running
+ // longer than expected
+ mHandler.postDelayed(() -> {
+ synchronized (mStats) {
+ mStats.clearRemovedUserUidsLocked(userId);
}
- }
+ }, SYNC_USER_REMOVAL, UID_FINAL_REMOVAL_AFTER_USER_REMOVAL_DELAY_MILLIS);
}
/**
@@ -368,42 +328,27 @@ public class BatteryExternalStatsWorker implements BatteryStatsImpl.ExternalStat
* cancel it if needed
*/
@GuardedBy("this")
- private Future<?> scheduleDelayedSyncLocked(Future<?> lastScheduledSync, Runnable syncRunnable,
+ private void scheduleDelayedSyncLocked(int what, Runnable syncRunnable,
long delayMillis) {
- if (mExecutorService.isShutdown()) {
- return CompletableFuture.failedFuture(new IllegalStateException("worker shutdown"));
- }
-
- if (lastScheduledSync != null) {
+ if (mHandler.hasMessages(what)) {
// If there's already a scheduled task, leave it as is if we're trying to
// re-schedule it again with a delay, otherwise cancel and re-schedule it.
if (delayMillis == 0) {
- lastScheduledSync.cancel(false);
+ mHandler.removeMessages(what);
} else {
- return lastScheduledSync;
+ return;
}
}
- try {
- return mExecutorService.schedule(syncRunnable, delayMillis, TimeUnit.MILLISECONDS);
- } catch (RejectedExecutionException e) {
- return CompletableFuture.failedFuture(e);
- }
+ mHandler.postDelayed(syncRunnable, what, delayMillis);
}
- public synchronized Future<?> scheduleWrite() {
- if (mExecutorService.isShutdown()) {
- return CompletableFuture.failedFuture(new IllegalStateException("worker shutdown"));
- }
-
+ /**
+ * Schedule and async writing of battery stats to disk
+ */
+ public synchronized void scheduleWrite() {
scheduleSyncLocked("write", UPDATE_ALL);
- // Since we use a single threaded executor, we can assume the next scheduled task's
- // Future finishes after the sync.
- try {
- return mExecutorService.submit(mWriteTask);
- } catch (RejectedExecutionException e) {
- return CompletableFuture.failedFuture(e);
- }
+ mHandler.post(mWriteTask);
}
/**
@@ -411,34 +356,25 @@ public class BatteryExternalStatsWorker implements BatteryStatsImpl.ExternalStat
* within the task, never wait on the resulting Future. This will result in a deadlock.
*/
public synchronized void scheduleRunnable(Runnable runnable) {
- try {
- mExecutorService.submit(runnable);
- } catch (RejectedExecutionException e) {
- Slog.e(TAG, "Couldn't schedule " + runnable, e);
- }
+ mHandler.post(runnable);
}
public void shutdown() {
- mExecutorService.shutdownNow();
+ mHandler.removeMessages(SYNC_UPDATE);
+ mHandler.removeMessages(SYNC_WAKELOCK_CHANGE);
+ mHandler.removeMessages(SYNC_BATTERY_LEVEL_CHANGE);
+ mHandler.removeMessages(SYNC_PROCESS_STATE_CHANGE);
+ mHandler.removeMessages(SYNC_USER_REMOVAL);
}
@GuardedBy("this")
- private Future<?> scheduleSyncLocked(String reason, int flags) {
- if (mExecutorService.isShutdown()) {
- return CompletableFuture.failedFuture(new IllegalStateException("worker shutdown"));
- }
-
- if (mCurrentFuture == null) {
+ private void scheduleSyncLocked(String reason, @ExternalUpdateFlag int flags) {
+ if (!mHandler.hasMessages(SYNC_UPDATE)) {
mUpdateFlags = flags;
mCurrentReason = reason;
- try {
- mCurrentFuture = mExecutorService.submit(mSyncTask);
- } catch (RejectedExecutionException e) {
- return CompletableFuture.failedFuture(e);
- }
+ mHandler.postDelayed(mSyncTask, SYNC_UPDATE, 0);
}
mUpdateFlags |= flags;
- return mCurrentFuture;
}
public long getLastCollectionTimeStamp() {
@@ -468,7 +404,6 @@ public class BatteryExternalStatsWorker implements BatteryStatsImpl.ExternalStat
useLatestStates = mUseLatestStates;
mUpdateFlags = 0;
mCurrentReason = null;
- mCurrentFuture = null;
mUseLatestStates = true;
if ((updateFlags & UPDATE_ALL) == UPDATE_ALL) {
cancelSyncDueToBatteryLevelChangeLocked();
diff --git a/services/core/java/com/android/server/power/stats/BatteryStatsImpl.java b/services/core/java/com/android/server/power/stats/BatteryStatsImpl.java
index 391071ff9fe8..c04158fe5243 100644
--- a/services/core/java/com/android/server/power/stats/BatteryStatsImpl.java
+++ b/services/core/java/com/android/server/power/stats/BatteryStatsImpl.java
@@ -176,7 +176,6 @@ import java.util.List;
import java.util.Map;
import java.util.Queue;
import java.util.concurrent.Executor;
-import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.locks.ReentrantLock;
@@ -949,19 +948,38 @@ public class BatteryStatsImpl extends BatteryStats {
public @interface ExternalUpdateFlag {
}
- Future<?> scheduleSync(String reason, int flags);
- Future<?> scheduleCpuSyncDueToRemovedUid(int uid);
+ /**
+ * Schedules a sync of kernel metrics in accordance with the specified flags.
+ */
+ void scheduleSync(String reason, @ExternalUpdateFlag int flags);
+
+ /**
+ * Schedules a CPU stats sync after a UID removal.
+ */
+ void scheduleCpuSyncDueToRemovedUid(int uid);
/**
* Schedule a sync because of a screen state change.
*/
- Future<?> scheduleSyncDueToScreenStateChange(int flags, boolean onBattery,
+ void scheduleSyncDueToScreenStateChange(@ExternalUpdateFlag int flags, boolean onBattery,
boolean onBatteryScreenOff, int screenState, int[] perDisplayScreenStates);
- Future<?> scheduleCpuSyncDueToWakelockChange(long delayMillis);
+
+ /**
+ * Schedules a sync after a wakelock state change
+ */
+ void scheduleCpuSyncDueToWakelockChange(long delayMillis);
+
+ /**
+ * Canceles any pending sync due to a wakelock state change
+ */
void cancelCpuSyncDueToWakelockChange();
- Future<?> scheduleSyncDueToBatteryLevelChange(long delayMillis);
+
+ /**
+ * Schedules a sync caused by the battery level change
+ */
+ void scheduleSyncDueToBatteryLevelChange(long delayMillis);
/** Schedule removal of UIDs corresponding to a removed user */
- Future<?> scheduleCleanupDueToRemovedUser(int userId);
+ void scheduleCleanupDueToRemovedUser(int userId);
/** Schedule a sync because of a process state change */
void scheduleSyncDueToProcessStateChange(int flags, long delayMillis);
}
@@ -12263,14 +12281,8 @@ public class BatteryStatsImpl extends BatteryStats {
// start time
long monotonicStartTime =
mMonotonicClock.monotonicTime() - batteryUsageStats.getStatsDuration();
- mHandler.post(() -> {
- mPowerStatsStore.storeBatteryUsageStats(monotonicStartTime, batteryUsageStats);
- try {
- batteryUsageStats.close();
- } catch (IOException e) {
- Log.e(TAG, "Cannot close BatteryUsageStats", e);
- }
- });
+ commitMonotonicClock();
+ mPowerStatsStore.storeBatteryUsageStatsAsync(monotonicStartTime, batteryUsageStats);
}
}
@@ -15391,6 +15403,10 @@ public class BatteryStatsImpl extends BatteryStats {
mMaxLearnedBatteryCapacityUah = Math.max(mMaxLearnedBatteryCapacityUah, chargeFullUah);
mBatteryTimeToFullSeconds = chargeTimeToFullSeconds;
+
+ if (mAccumulateBatteryUsageStats) {
+ mBatteryUsageStatsProvider.accumulateBatteryUsageStatsAsync(this, mHandler);
+ }
}
public static boolean isOnBattery(int plugType, int status) {
@@ -17699,6 +17715,13 @@ public class BatteryStatsImpl extends BatteryStats {
}
}
+ /**
+ * Persists the monotonic clock associated with battery stats.
+ */
+ public void commitMonotonicClock() {
+ mMonotonicClock.write();
+ }
+
@GuardedBy("this")
public void prepareForDumpLocked() {
// Need to retrieve current kernel wake lock stats before printing.
diff --git a/services/core/java/com/android/server/power/stats/BatteryUsageStatsProvider.java b/services/core/java/com/android/server/power/stats/BatteryUsageStatsProvider.java
index b466dd2d8721..265f1dfce90f 100644
--- a/services/core/java/com/android/server/power/stats/BatteryUsageStatsProvider.java
+++ b/services/core/java/com/android/server/power/stats/BatteryUsageStatsProvider.java
@@ -23,17 +23,16 @@ import android.os.BatteryConsumer;
import android.os.BatteryStats;
import android.os.BatteryUsageStats;
import android.os.BatteryUsageStatsQuery;
+import android.os.Handler;
import android.os.Process;
-import android.os.UidBatteryConsumer;
import android.util.Log;
-import android.util.Slog;
import android.util.SparseArray;
import com.android.internal.os.Clock;
import com.android.internal.os.CpuScalingPolicies;
+import com.android.internal.os.MonotonicClock;
import com.android.internal.os.PowerProfile;
-import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@@ -49,20 +48,31 @@ public class BatteryUsageStatsProvider {
private final PowerStatsStore mPowerStatsStore;
private final PowerProfile mPowerProfile;
private final CpuScalingPolicies mCpuScalingPolicies;
+ private final int mAccumulatedBatteryUsageStatsSpanSize;
private final Clock mClock;
private final Object mLock = new Object();
private List<PowerCalculator> mPowerCalculators;
private UserPowerCalculator mUserPowerCalculator;
+ private long mLastAccumulationMonotonicHistorySize;
+
+ private static class AccumulatedBatteryUsageStats {
+ public BatteryUsageStats.Builder builder;
+ public long startWallClockTime;
+ public long startMonotonicTime;
+ public long endMonotonicTime;
+ }
public BatteryUsageStatsProvider(@NonNull Context context,
@NonNull PowerAttributor powerAttributor,
@NonNull PowerProfile powerProfile, @NonNull CpuScalingPolicies cpuScalingPolicies,
- @NonNull PowerStatsStore powerStatsStore, @NonNull Clock clock) {
+ @NonNull PowerStatsStore powerStatsStore, int accumulatedBatteryUsageStatsSpanSize,
+ @NonNull Clock clock) {
mContext = context;
mPowerAttributor = powerAttributor;
mPowerStatsStore = powerStatsStore;
mPowerProfile = powerProfile;
mCpuScalingPolicies = cpuScalingPolicies;
+ mAccumulatedBatteryUsageStatsSpanSize = accumulatedBatteryUsageStatsSpanSize;
mClock = clock;
mUserPowerCalculator = new UserPowerCalculator();
@@ -85,7 +95,10 @@ public class BatteryUsageStatsProvider {
mPowerCalculators.add(
new CpuPowerCalculator(mCpuScalingPolicies, mPowerProfile));
}
- mPowerCalculators.add(new MemoryPowerCalculator(mPowerProfile));
+ if (!mPowerAttributor.isPowerComponentSupported(
+ BatteryConsumer.POWER_COMPONENT_MEMORY)) {
+ mPowerCalculators.add(new MemoryPowerCalculator(mPowerProfile));
+ }
if (!mPowerAttributor.isPowerComponentSupported(
BatteryConsumer.POWER_COMPONENT_WAKELOCK)) {
mPowerCalculators.add(new WakelockPowerCalculator(mPowerProfile));
@@ -141,7 +154,11 @@ public class BatteryUsageStatsProvider {
BatteryConsumer.POWER_COMPONENT_AMBIENT_DISPLAY)) {
mPowerCalculators.add(new AmbientDisplayPowerCalculator(mPowerProfile));
}
- mPowerCalculators.add(new IdlePowerCalculator(mPowerProfile));
+ // IDLE power attribution is covered by WakelockPowerStatsProcessor
+ if (!mPowerAttributor.isPowerComponentSupported(
+ BatteryConsumer.POWER_COMPONENT_WAKELOCK)) {
+ mPowerCalculators.add(new IdlePowerCalculator(mPowerProfile));
+ }
if (!mPowerAttributor.isPowerComponentSupported(
BatteryConsumer.POWER_COMPONENT_ANY)) {
mPowerCalculators.add(new CustomEnergyConsumerPowerCalculator(mPowerProfile));
@@ -159,53 +176,45 @@ public class BatteryUsageStatsProvider {
}
/**
- * Compute BatteryUsageStats for the period since the last accumulated stats were stored,
- * add them to the accumulated stats and save the result.
+ * Conditionally runs a battery usage stats accumulation on the supplied handler.
*/
- public void accumulateBatteryUsageStats(BatteryStatsImpl stats) {
- BatteryUsageStats.Builder accumulatedBatteryUsageStatsBuilder = null;
-
- PowerStatsSpan powerStatsSpan = mPowerStatsStore.loadPowerStatsSpan(
- AccumulatedBatteryUsageStatsSection.ID,
- AccumulatedBatteryUsageStatsSection.TYPE);
- if (powerStatsSpan != null) {
- List<PowerStatsSpan.Section> sections = powerStatsSpan.getSections();
- for (int i = sections.size() - 1; i >= 0; i--) {
- PowerStatsSpan.Section section = sections.get(i);
- if (AccumulatedBatteryUsageStatsSection.TYPE.equals(section.getType())) {
- accumulatedBatteryUsageStatsBuilder =
- ((AccumulatedBatteryUsageStatsSection) section)
- .getBatteryUsageStatsBuilder();
- break;
- }
+ public void accumulateBatteryUsageStatsAsync(BatteryStatsImpl stats, Handler handler) {
+ synchronized (this) {
+ long historySize = stats.getHistory().getMonotonicHistorySize();
+ if (historySize - mLastAccumulationMonotonicHistorySize
+ < mAccumulatedBatteryUsageStatsSpanSize) {
+ return;
}
+ mLastAccumulationMonotonicHistorySize = historySize;
}
- // TODO(b/366493365): add the current batteryusagestats directly into the "accumulated"
- // builder to avoid allocating a second CursorWindow
- BatteryUsageStats.Builder currentBatteryUsageStatsBuilder =
- getCurrentBatteryUsageStatsBuilder(stats,
- new BatteryUsageStatsQuery.Builder()
- .setMaxStatsAgeMs(0)
- .includeProcessStateData()
- .includePowerStateData()
- .includeScreenStateData()
- .build(),
- mClock.currentTimeMillis());
-
- if (accumulatedBatteryUsageStatsBuilder == null) {
- accumulatedBatteryUsageStatsBuilder = currentBatteryUsageStatsBuilder;
- } else {
- accumulatedBatteryUsageStatsBuilder.add(currentBatteryUsageStatsBuilder.build());
- currentBatteryUsageStatsBuilder.discard();
- }
+ handler.post(() -> accumulateBatteryUsageStats(stats));
+ }
- powerStatsSpan = new PowerStatsSpan(AccumulatedBatteryUsageStatsSection.ID);
- powerStatsSpan.addSection(
- new AccumulatedBatteryUsageStatsSection(accumulatedBatteryUsageStatsBuilder));
+ /**
+ * Computes BatteryUsageStats for the period since the last accumulated stats were stored,
+ * adds them to the accumulated stats and saves the result.
+ */
+ public void accumulateBatteryUsageStats(BatteryStatsImpl stats) {
+ AccumulatedBatteryUsageStats accumulatedStats = loadAccumulatedBatteryUsageStats();
+ final BatteryUsageStatsQuery query = new BatteryUsageStatsQuery.Builder()
+ .setMaxStatsAgeMs(0)
+ .includeProcessStateData()
+ .includePowerStateData()
+ .includeScreenStateData()
+ .build();
+ updateAccumulatedBatteryUsageStats(accumulatedStats, stats, query);
+
+ PowerStatsSpan powerStatsSpan = new PowerStatsSpan(AccumulatedBatteryUsageStatsSection.ID);
+ powerStatsSpan.addSection(
+ new AccumulatedBatteryUsageStatsSection(accumulatedStats.builder));
+ powerStatsSpan.addTimeFrame(accumulatedStats.startMonotonicTime,
+ accumulatedStats.startWallClockTime,
+ accumulatedStats.endMonotonicTime - accumulatedStats.startMonotonicTime);
+ stats.commitMonotonicClock();
mPowerStatsStore.storePowerStatsSpanAsync(powerStatsSpan,
- accumulatedBatteryUsageStatsBuilder::discard);
+ accumulatedStats.builder::discard);
}
/**
@@ -252,68 +261,73 @@ public class BatteryUsageStatsProvider {
BatteryUsageStatsQuery query, long currentTimeMs) {
if ((query.getFlags()
& BatteryUsageStatsQuery.FLAG_BATTERY_USAGE_STATS_ACCUMULATED) != 0) {
- return getAccumulatedBatteryUsageStats(stats, query);
- } else if (query.getToTimestamp() == 0) {
- return getCurrentBatteryUsageStats(stats, query, currentTimeMs);
+ return getAccumulatedBatteryUsageStats(stats, query, currentTimeMs);
+ } else if (query.getAggregatedToTimestamp() == 0) {
+ BatteryUsageStats.Builder builder = computeBatteryUsageStats(stats, query,
+ query.getMonotonicStartTime(),
+ query.getMonotonicEndTime(), currentTimeMs);
+ return builder.build();
} else {
return getAggregatedBatteryUsageStats(stats, query);
}
}
private BatteryUsageStats getAccumulatedBatteryUsageStats(BatteryStatsImpl stats,
- BatteryUsageStatsQuery query) {
+ BatteryUsageStatsQuery query, long currentTimeMs) {
+ AccumulatedBatteryUsageStats accumulatedStats = loadAccumulatedBatteryUsageStats();
+ updateAccumulatedBatteryUsageStats(accumulatedStats, stats, query);
+ return accumulatedStats.builder.build();
+ }
+
+ private AccumulatedBatteryUsageStats loadAccumulatedBatteryUsageStats() {
+ AccumulatedBatteryUsageStats stats = new AccumulatedBatteryUsageStats();
+ stats.startWallClockTime = 0;
+ stats.startMonotonicTime = MonotonicClock.UNDEFINED;
+ stats.endMonotonicTime = MonotonicClock.UNDEFINED;
PowerStatsSpan powerStatsSpan = mPowerStatsStore.loadPowerStatsSpan(
AccumulatedBatteryUsageStatsSection.ID,
AccumulatedBatteryUsageStatsSection.TYPE);
-
- BatteryUsageStats.Builder accumulatedBatteryUsageStatsBuilder = null;
if (powerStatsSpan != null) {
List<PowerStatsSpan.Section> sections = powerStatsSpan.getSections();
- if (sections.size() == 1) {
- accumulatedBatteryUsageStatsBuilder =
- ((AccumulatedBatteryUsageStatsSection) sections.get(0))
- .getBatteryUsageStatsBuilder();
- } else {
- Slog.wtf(TAG, "Unexpected number of sections for type "
- + AccumulatedBatteryUsageStatsSection.TYPE);
+ for (int i = sections.size() - 1; i >= 0; i--) {
+ PowerStatsSpan.Section section = sections.get(i);
+ if (AccumulatedBatteryUsageStatsSection.TYPE.equals(section.getType())) {
+ stats.builder = ((AccumulatedBatteryUsageStatsSection) section)
+ .getBatteryUsageStatsBuilder();
+ stats.startWallClockTime = powerStatsSpan.getMetadata().getStartTime();
+ stats.startMonotonicTime = powerStatsSpan.getMetadata().getStartMonotonicTime();
+ stats.endMonotonicTime = powerStatsSpan.getMetadata().getEndMonotonicTime();
+ break;
+ }
}
}
+ return stats;
+ }
- BatteryUsageStats currentBatteryUsageStats = getCurrentBatteryUsageStats(stats, query,
+ private void updateAccumulatedBatteryUsageStats(AccumulatedBatteryUsageStats accumulatedStats,
+ BatteryStatsImpl stats, BatteryUsageStatsQuery query) {
+ // TODO(b/366493365): add the current batteryusagestats directly into
+ // `accumulatedStats.builder` to avoid allocating a second CursorWindow
+ BatteryUsageStats.Builder remainingBatteryUsageStats = computeBatteryUsageStats(stats,
+ query, accumulatedStats.endMonotonicTime, query.getMonotonicEndTime(),
mClock.currentTimeMillis());
- BatteryUsageStats result;
- if (accumulatedBatteryUsageStatsBuilder == null) {
- result = currentBatteryUsageStats;
+ if (accumulatedStats.builder == null) {
+ accumulatedStats.builder = remainingBatteryUsageStats;
+ accumulatedStats.startWallClockTime = stats.getStartClockTime();
+ accumulatedStats.startMonotonicTime = stats.getMonotonicStartTime();
+ accumulatedStats.endMonotonicTime = accumulatedStats.startMonotonicTime
+ + accumulatedStats.builder.getStatsDuration();
} else {
- accumulatedBatteryUsageStatsBuilder.add(currentBatteryUsageStats);
- try {
- currentBatteryUsageStats.close();
- } catch (IOException ex) {
- Slog.e(TAG, "Closing BatteryUsageStats", ex);
- }
- result = accumulatedBatteryUsageStatsBuilder.build();
+ accumulatedStats.builder.add(remainingBatteryUsageStats.build());
+ accumulatedStats.endMonotonicTime += remainingBatteryUsageStats.getStatsDuration();
+ remainingBatteryUsageStats.discard();
}
-
- return result;
}
- private BatteryUsageStats getCurrentBatteryUsageStats(BatteryStatsImpl stats,
- BatteryUsageStatsQuery query, long currentTimeMs) {
- BatteryUsageStats.Builder builder = getCurrentBatteryUsageStatsBuilder(stats, query,
- currentTimeMs);
- BatteryUsageStats batteryUsageStats = builder.build();
- if (batteryUsageStats.isProcessStateDataIncluded()) {
- verify(batteryUsageStats);
- }
- return batteryUsageStats;
- }
-
- private BatteryUsageStats.Builder getCurrentBatteryUsageStatsBuilder(BatteryStatsImpl stats,
- BatteryUsageStatsQuery query, long currentTimeMs) {
- final long realtimeUs = mClock.elapsedRealtime() * 1000;
- final long uptimeUs = mClock.uptimeMillis() * 1000;
-
+ private BatteryUsageStats.Builder computeBatteryUsageStats(BatteryStatsImpl stats,
+ BatteryUsageStatsQuery query, long monotonicStartTime, long monotonicEndTime,
+ long currentTimeMs) {
final boolean includePowerModels = (query.getFlags()
& BatteryUsageStatsQuery.FLAG_BATTERY_USAGE_STATS_INCLUDE_POWER_MODELS) != 0;
final boolean includeProcessStateData = ((query.getFlags()
@@ -324,11 +338,8 @@ public class BatteryUsageStatsProvider {
final double minConsumedPowerThreshold = query.getMinConsumedPowerThreshold();
String[] customEnergyConsumerNames;
- long monotonicStartTime, monotonicEndTime;
synchronized (stats) {
customEnergyConsumerNames = stats.getCustomEnergyConsumerNames();
- monotonicStartTime = stats.getMonotonicStartTime();
- monotonicEndTime = stats.getMonotonicEndTime();
}
final BatteryUsageStats.Builder batteryUsageStatsBuilder = new BatteryUsageStats.Builder(
@@ -337,12 +348,31 @@ public class BatteryUsageStatsProvider {
query.isPowerStateDataNeeded(), minConsumedPowerThreshold);
synchronized (stats) {
- // TODO(b/188068523): use a monotonic clock to ensure resilience of order and duration
- // of batteryUsageStats sessions to wall-clock adjustments
- batteryUsageStatsBuilder.setStatsStartTimestamp(stats.getStartClockTime());
- batteryUsageStatsBuilder.setStatsEndTimestamp(currentTimeMs);
final List<PowerCalculator> powerCalculators = getPowerCalculators();
if (!powerCalculators.isEmpty()) {
+ if (monotonicStartTime != MonotonicClock.UNDEFINED
+ || monotonicEndTime != MonotonicClock.UNDEFINED) {
+ throw new IllegalStateException("BatteryUsageStatsQuery specifies a time "
+ + "range that is incompatible with PowerCalculators: "
+ + powerCalculators);
+ }
+ }
+
+ if (monotonicStartTime == MonotonicClock.UNDEFINED) {
+ monotonicStartTime = stats.getMonotonicStartTime();
+ }
+ batteryUsageStatsBuilder.setStatsStartTimestamp(stats.getStartClockTime()
+ + (monotonicStartTime - stats.getMonotonicStartTime()));
+ if (monotonicEndTime != MonotonicClock.UNDEFINED) {
+ batteryUsageStatsBuilder.setStatsEndTimestamp(stats.getStartClockTime()
+ + (monotonicEndTime - stats.getMonotonicStartTime()));
+ } else {
+ batteryUsageStatsBuilder.setStatsEndTimestamp(currentTimeMs);
+ }
+
+ if (!powerCalculators.isEmpty()) {
+ final long realtimeUs = mClock.elapsedRealtime() * 1000;
+ final long uptimeUs = mClock.uptimeMillis() * 1000;
final int[] powerComponents = query.getPowerComponents();
SparseArray<? extends BatteryStats.Uid> uidStats = stats.getUidStats();
for (int i = uidStats.size() - 1; i >= 0; i--) {
@@ -381,8 +411,7 @@ public class BatteryUsageStatsProvider {
monotonicStartTime, monotonicEndTime);
// Combine apps by the user if necessary
- mUserPowerCalculator.calculate(batteryUsageStatsBuilder, stats, realtimeUs, uptimeUs,
- query);
+ mUserPowerCalculator.calculate(batteryUsageStatsBuilder, stats, 0, 0, query);
populateGeneralInfo(batteryUsageStatsBuilder, stats);
return batteryUsageStatsBuilder;
@@ -402,48 +431,6 @@ public class BatteryUsageStatsProvider {
}
}
- // STOPSHIP(b/229906525): remove verification before shipping
- private static boolean sErrorReported;
-
- private void verify(BatteryUsageStats stats) {
- if (sErrorReported) {
- return;
- }
-
- final double precision = 2.0; // Allow rounding errors up to 2 mAh
- final int[] components =
- {BatteryConsumer.POWER_COMPONENT_CPU,
- BatteryConsumer.POWER_COMPONENT_MOBILE_RADIO,
- BatteryConsumer.POWER_COMPONENT_WIFI,
- BatteryConsumer.POWER_COMPONENT_BLUETOOTH};
- final int[] states =
- {BatteryConsumer.PROCESS_STATE_FOREGROUND,
- BatteryConsumer.PROCESS_STATE_BACKGROUND,
- BatteryConsumer.PROCESS_STATE_FOREGROUND_SERVICE,
- BatteryConsumer.PROCESS_STATE_CACHED};
- for (UidBatteryConsumer ubc : stats.getUidBatteryConsumers()) {
- for (int component : components) {
- double consumedPower = ubc.getConsumedPower(ubc.getKey(component));
- double sumStates = 0;
- for (int state : states) {
- sumStates += ubc.getConsumedPower(ubc.getKey(component, state));
- }
- if (sumStates > consumedPower + precision) {
- String error = "Sum of states exceeds total. UID = " + ubc.getUid() + " "
- + BatteryConsumer.powerComponentIdToString(component)
- + " total = " + consumedPower + " states = " + sumStates;
- if (!sErrorReported) {
- Slog.wtf(TAG, error);
- sErrorReported = true;
- } else {
- Slog.e(TAG, error);
- }
- return;
- }
- }
- }
- }
-
private BatteryUsageStats getAggregatedBatteryUsageStats(BatteryStatsImpl stats,
BatteryUsageStatsQuery query) {
final boolean includePowerModels = (query.getFlags()
@@ -489,8 +476,10 @@ public class BatteryUsageStatsProvider {
// Per BatteryUsageStatsQuery API, the "from" timestamp is *exclusive*,
// while the "to" timestamp is *inclusive*.
boolean isInRange =
- (query.getFromTimestamp() == 0 || minTime > query.getFromTimestamp())
- && (query.getToTimestamp() == 0 || maxTime <= query.getToTimestamp());
+ (query.getAggregatedFromTimestamp() == 0
+ || minTime > query.getAggregatedFromTimestamp())
+ && (query.getAggregatedToTimestamp() == 0
+ || maxTime <= query.getAggregatedToTimestamp());
if (!isInRange) {
continue;
}
diff --git a/services/core/java/com/android/server/power/stats/PowerStatsSpan.java b/services/core/java/com/android/server/power/stats/PowerStatsSpan.java
index fc0611f7fcff..5105272e6980 100644
--- a/services/core/java/com/android/server/power/stats/PowerStatsSpan.java
+++ b/services/core/java/com/android/server/power/stats/PowerStatsSpan.java
@@ -25,6 +25,7 @@ import android.util.Slog;
import android.util.TimeUtils;
import com.android.internal.annotations.VisibleForTesting;
+import com.android.internal.os.MonotonicClock;
import com.android.modules.utils.TypedXmlPullParser;
import com.android.modules.utils.TypedXmlSerializer;
@@ -147,6 +148,40 @@ public class PowerStatsSpan {
mTimeFrames.add(timeFrame);
}
+ long getStartTime() {
+ long startTime = Long.MAX_VALUE;
+ for (int i = 0; i < mTimeFrames.size(); i++) {
+ TimeFrame timeFrame = mTimeFrames.get(i);
+ if (timeFrame.startTime < startTime) {
+ startTime = timeFrame.startTime;
+ }
+ }
+ return startTime != Long.MAX_VALUE ? startTime : 0;
+ }
+
+ long getStartMonotonicTime() {
+ long startTime = Long.MAX_VALUE;
+ for (int i = 0; i < mTimeFrames.size(); i++) {
+ TimeFrame timeFrame = mTimeFrames.get(i);
+ if (timeFrame.startMonotonicTime < startTime) {
+ startTime = timeFrame.startMonotonicTime;
+ }
+ }
+ return startTime != Long.MAX_VALUE ? startTime : MonotonicClock.UNDEFINED;
+ }
+
+ long getEndMonotonicTime() {
+ long maxTime = Long.MIN_VALUE;
+ for (int i = 0; i < mTimeFrames.size(); i++) {
+ TimeFrame timeFrame = mTimeFrames.get(i);
+ long endTime = timeFrame.startMonotonicTime + timeFrame.duration;
+ if (endTime > maxTime) {
+ maxTime = endTime;
+ }
+ }
+ return maxTime != Long.MIN_VALUE ? maxTime : MonotonicClock.UNDEFINED;
+ }
+
void addSection(String sectionType) {
// The number of sections per span is small, so there is no need to use a Set
if (!mSections.contains(sectionType)) {
diff --git a/services/core/java/com/android/server/power/stats/PowerStatsStore.java b/services/core/java/com/android/server/power/stats/PowerStatsStore.java
index 5a6f973424d1..3673617f6104 100644
--- a/services/core/java/com/android/server/power/stats/PowerStatsStore.java
+++ b/services/core/java/com/android/server/power/stats/PowerStatsStore.java
@@ -149,7 +149,6 @@ public class PowerStatsStore {
* Saves the specified span in the store.
*/
public void storePowerStatsSpan(PowerStatsSpan span) {
- maybeClearLegacyStore();
lockStoreDirectory();
try {
if (!mStoreDir.exists()) {
@@ -203,13 +202,23 @@ public class PowerStatsStore {
* Stores a {@link PowerStatsSpan} containing a single section for the supplied
* battery usage stats.
*/
- public void storeBatteryUsageStats(long monotonicStartTime,
+ public void storeBatteryUsageStatsAsync(long monotonicStartTime,
BatteryUsageStats batteryUsageStats) {
- PowerStatsSpan span = new PowerStatsSpan(monotonicStartTime);
- span.addTimeFrame(monotonicStartTime, batteryUsageStats.getStatsStartTimestamp(),
- batteryUsageStats.getStatsDuration());
- span.addSection(new BatteryUsageStatsSection(batteryUsageStats));
- storePowerStatsSpan(span);
+ mHandler.post(() -> {
+ try {
+ PowerStatsSpan span = new PowerStatsSpan(monotonicStartTime);
+ span.addTimeFrame(monotonicStartTime, batteryUsageStats.getStatsStartTimestamp(),
+ batteryUsageStats.getStatsDuration());
+ span.addSection(new BatteryUsageStatsSection(batteryUsageStats));
+ storePowerStatsSpan(span);
+ } finally {
+ try {
+ batteryUsageStats.close();
+ } catch (IOException e) {
+ Slog.e(TAG, "Cannot close BatteryUsageStats", e);
+ }
+ }
+ });
}
/**
diff --git a/services/core/java/com/android/server/power/stats/WakelockStatsFrameworkEvents.java b/services/core/java/com/android/server/power/stats/WakelockStatsFrameworkEvents.java
index c9693bd20a08..f387feca05f2 100644
--- a/services/core/java/com/android/server/power/stats/WakelockStatsFrameworkEvents.java
+++ b/services/core/java/com/android/server/power/stats/WakelockStatsFrameworkEvents.java
@@ -150,26 +150,14 @@ public class WakelockStatsFrameworkEvents {
}
@VisibleForTesting
- public boolean inOverflow() {
- synchronized (mLock) {
- return inOverflowLocked();
- }
- }
-
@GuardedBy("mLock")
- private boolean inOverflowLocked() {
+ public boolean inOverflow() {
return mWakeLockStats.size() >= SUMMARY_THRESHOLD;
}
@VisibleForTesting
- public boolean inHardCap() {
- synchronized (mLock) {
- return inHardCapLocked();
- }
- }
-
@GuardedBy("mLock")
- private boolean inHardCapLocked() {
+ public boolean inHardCap() {
return mWakeLockStats.size() >= MAX_WAKELOCK_DIMENSIONS;
}
@@ -189,9 +177,9 @@ public class WakelockStatsFrameworkEvents {
long wakeLockDur = eventUptimeMillis - data.acquireUptimeMillis;
// Rewrite key if in an overflow state.
- if (inOverflowLocked() && !mWakeLockStats.containsKey(key)) {
+ if (inOverflow() && !mWakeLockStats.containsKey(key)) {
key.setOverflow();
- if (inHardCapLocked() && !mWakeLockStats.containsKey(key)) {
+ if (inHardCap() && !mWakeLockStats.containsKey(key)) {
key.setHardCap();
}
}
@@ -207,12 +195,41 @@ public class WakelockStatsFrameworkEvents {
}
}
- public List<StatsEvent> pullFrameworkWakelockInfoAtoms() {
- return pullFrameworkWakelockInfoAtoms(SystemClock.uptimeMillis());
+ // Shim interface for testing.
+ @VisibleForTesting
+ public interface EventLogger {
+ void logResult(
+ int uid, String tag, int wakeLockLevel, long uptimeMillis, long completedCount);
}
- public List<StatsEvent> pullFrameworkWakelockInfoAtoms(long nowMillis) {
+ public List<StatsEvent> pullFrameworkWakelockInfoAtoms() {
List<StatsEvent> result = new ArrayList<>();
+ EventLogger logger =
+ new EventLogger() {
+ public void logResult(
+ int uid,
+ String tag,
+ int wakeLockLevel,
+ long uptimeMillis,
+ long completedCount) {
+ StatsEvent event =
+ StatsEvent.newBuilder()
+ .setAtomId(FrameworkStatsLog.FRAMEWORK_WAKELOCK_INFO)
+ .writeInt(uid)
+ .writeString(tag)
+ .writeInt(wakeLockLevel)
+ .writeLong(uptimeMillis)
+ .writeLong(completedCount)
+ .build();
+ result.add(event);
+ }
+ };
+ pullFrameworkWakelockInfoAtoms(SystemClock.uptimeMillis(), logger);
+ return result;
+ }
+
+ @VisibleForTesting
+ public void pullFrameworkWakelockInfoAtoms(long nowMillis, EventLogger logger) {
HashSet<WakeLockKey> keys = new HashSet<>();
// Used to collect open WakeLocks when in an overflow state.
@@ -223,13 +240,13 @@ public class WakelockStatsFrameworkEvents {
// If we are in an overflow state, an open wakelock may have a new key
// that needs to be summarized.
- if (inOverflowLocked()) {
+ if (inOverflow()) {
for (WakeLockKey key : mOpenWakeLocks.keySet()) {
if (!mWakeLockStats.containsKey(key)) {
WakeLockData data = mOpenWakeLocks.get(key);
key.setOverflow();
- if (inHardCapLocked() && !mWakeLockStats.containsKey(key)) {
+ if (inHardCap() && !mWakeLockStats.containsKey(key)) {
key.setHardCap();
}
keys.add(key);
@@ -257,20 +274,14 @@ public class WakelockStatsFrameworkEvents {
stats.uptimeMillis += openWakeLockUptime + extraTime.uptimeMillis;
- StatsEvent event =
- StatsEvent.newBuilder()
- .setAtomId(FrameworkStatsLog.FRAMEWORK_WAKELOCK_INFO)
- .writeInt(key.getUid())
- .writeString(key.getTag())
- .writeInt(key.getPowerManagerWakeLockLevel())
- .writeLong(stats.uptimeMillis)
- .writeLong(stats.completedCount)
- .build();
- result.add(event);
+ logger.logResult(
+ key.getUid(),
+ key.getTag(),
+ key.getPowerManagerWakeLockLevel(),
+ stats.uptimeMillis,
+ stats.completedCount);
}
}
-
- return result;
}
private static final String TAG = "BatteryStatsPulledMetrics";
diff --git a/services/core/java/com/android/server/power/stats/format/BinaryStatePowerStatsLayout.java b/services/core/java/com/android/server/power/stats/format/BinaryStatePowerStatsLayout.java
index 4a26d83175fa..657701be60cc 100644
--- a/services/core/java/com/android/server/power/stats/format/BinaryStatePowerStatsLayout.java
+++ b/services/core/java/com/android/server/power/stats/format/BinaryStatePowerStatsLayout.java
@@ -21,7 +21,9 @@ import com.android.internal.os.PowerStats;
public class BinaryStatePowerStatsLayout extends EnergyConsumerPowerStatsLayout {
public BinaryStatePowerStatsLayout() {
addDeviceSectionUsageDuration();
+ addDeviceSectionPowerEstimate();
addUidSectionUsageDuration();
+ addUidSectionPowerEstimate();
}
public BinaryStatePowerStatsLayout(PowerStats.Descriptor descriptor) {
diff --git a/services/core/java/com/android/server/power/stats/processor/PowerStatsExporter.java b/services/core/java/com/android/server/power/stats/processor/PowerStatsExporter.java
index c7ad5641806c..c8170a1982bb 100644
--- a/services/core/java/com/android/server/power/stats/processor/PowerStatsExporter.java
+++ b/services/core/java/com/android/server/power/stats/processor/PowerStatsExporter.java
@@ -117,6 +117,7 @@ class PowerStatsExporter {
PowerStatsSpan.Section section = sections.get(k);
populateBatteryUsageStatsBuilder(batteryUsageStatsBuilder,
((AggregatedPowerStatsSection) section).getAggregatedPowerStats());
+ // TODO(b/371614748): close the builder
}
}
@@ -197,6 +198,7 @@ class PowerStatsExporter {
&& powerState == BatteryConsumer.POWER_STATE_BATTERY;
double[] totalPower = new double[1];
+ long[] durationMs = new long[1];
MultiStateStats.States.forEachTrackedStateCombination(
powerComponentStats.getConfig().getDeviceStateConfig(),
states -> {
@@ -209,6 +211,7 @@ class PowerStatsExporter {
}
totalPower[0] += layout.getDevicePowerEstimate(deviceStats);
+ durationMs[0] += layout.getUsageDuration(deviceStats);
if (hasBatteryLevelProperties) {
gatherBatteryLevelInfo(batteryLevelInfo, deviceStats);
@@ -223,9 +226,13 @@ class PowerStatsExporter {
if (key != null) {
deviceScope.addConsumedPower(key, totalPower[0],
BatteryConsumer.POWER_MODEL_UNDEFINED);
+ deviceScope.addUsageDurationMillis(key, durationMs[0]);
+ }
+ key = deviceScope.getKey(powerComponentId, BatteryConsumer.PROCESS_STATE_UNSPECIFIED);
+ if (key != null) {
+ deviceScope.addConsumedPower(key, totalPower[0], BatteryConsumer.POWER_MODEL_UNDEFINED);
+ deviceScope.addUsageDurationMillis(key, durationMs[0]);
}
- deviceScope.addConsumedPower(powerComponentId, totalPower[0],
- BatteryConsumer.POWER_MODEL_UNDEFINED);
}
private void gatherBatteryLevelInfo(BatteryLevelInfo batteryLevelInfo, long[] deviceStats) {
@@ -373,9 +380,15 @@ class PowerStatsExporter {
if (resultScreenState != BatteryConsumer.SCREEN_STATE_UNSPECIFIED
|| resultPowerState != BatteryConsumer.POWER_STATE_UNSPECIFIED) {
- builder.addConsumedPower(powerComponentId,
- powerByProcState[BatteryConsumer.PROCESS_STATE_UNSPECIFIED],
- BatteryConsumer.POWER_MODEL_UNDEFINED);
+ BatteryConsumer.Key key = builder.getKey(powerComponentId,
+ BatteryConsumer.PROCESS_STATE_UNSPECIFIED);
+ if (key != null) {
+ builder.addConsumedPower(key,
+ powerByProcState[BatteryConsumer.PROCESS_STATE_UNSPECIFIED],
+ BatteryConsumer.POWER_MODEL_UNDEFINED);
+ builder.addUsageDurationMillis(key,
+ durationByProcState[BatteryConsumer.PROCESS_STATE_UNSPECIFIED]);
+ }
}
powerAllApps += powerByProcState[BatteryConsumer.PROCESS_STATE_UNSPECIFIED];
}
diff --git a/services/core/java/com/android/server/security/advancedprotection/AdvancedProtectionService.java b/services/core/java/com/android/server/security/advancedprotection/AdvancedProtectionService.java
new file mode 100644
index 000000000000..9a63c823d2d7
--- /dev/null
+++ b/services/core/java/com/android/server/security/advancedprotection/AdvancedProtectionService.java
@@ -0,0 +1,247 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.server.security.advancedprotection;
+
+import static android.provider.Settings.Secure.ADVANCED_PROTECTION_MODE;
+
+import android.Manifest;
+import android.annotation.EnforcePermission;
+import android.annotation.NonNull;
+import android.content.Context;
+import android.os.Binder;
+import android.os.Handler;
+import android.os.IBinder;
+import android.os.Looper;
+import android.os.Message;
+import android.os.PermissionEnforcer;
+import android.os.RemoteException;
+import android.os.ResultReceiver;
+import android.os.ShellCallback;
+import android.provider.Settings;
+import android.security.advancedprotection.IAdvancedProtectionCallback;
+import android.security.advancedprotection.IAdvancedProtectionService;
+import android.util.ArrayMap;
+
+import com.android.internal.annotations.VisibleForTesting;
+import com.android.server.FgThread;
+import com.android.server.LocalServices;
+import com.android.server.SystemService;
+import com.android.server.pm.UserManagerInternal;
+
+import java.io.FileDescriptor;
+import java.util.ArrayList;
+
+/** @hide */
+public class AdvancedProtectionService extends IAdvancedProtectionService.Stub {
+ private static final int MODE_CHANGED = 0;
+ private static final int CALLBACK_ADDED = 1;
+
+ private final Handler mHandler;
+ private final AdvancedProtectionStore mStore;
+ private final ArrayMap<IBinder, IAdvancedProtectionCallback> mCallbacks = new ArrayMap<>();
+
+ private AdvancedProtectionService(@NonNull Context context) {
+ super(PermissionEnforcer.fromContext(context));
+ mHandler = new AdvancedProtectionHandler(FgThread.get().getLooper());
+ mStore = new AdvancedProtectionStore(context);
+ }
+
+ @VisibleForTesting
+ AdvancedProtectionService(@NonNull Context context, @NonNull AdvancedProtectionStore store,
+ @NonNull Looper looper, @NonNull PermissionEnforcer permissionEnforcer) {
+ super(permissionEnforcer);
+ mStore = store;
+ mHandler = new AdvancedProtectionHandler(looper);
+ }
+
+ @Override
+ @EnforcePermission(Manifest.permission.QUERY_ADVANCED_PROTECTION_MODE)
+ public boolean isAdvancedProtectionEnabled() {
+ isAdvancedProtectionEnabled_enforcePermission();
+ final long identity = Binder.clearCallingIdentity();
+ try {
+ return isAdvancedProtectionEnabledInternal();
+ } finally {
+ Binder.restoreCallingIdentity(identity);
+ }
+ }
+
+ // Without permission check
+ private boolean isAdvancedProtectionEnabledInternal() {
+ return mStore.retrieve();
+ }
+
+ @Override
+ @EnforcePermission(Manifest.permission.QUERY_ADVANCED_PROTECTION_MODE)
+ public void registerAdvancedProtectionCallback(@NonNull IAdvancedProtectionCallback callback)
+ throws RemoteException {
+ registerAdvancedProtectionCallback_enforcePermission();
+ IBinder b = callback.asBinder();
+ b.linkToDeath(new DeathRecipient(b), 0);
+ synchronized (mCallbacks) {
+ mCallbacks.put(b, callback);
+ sendCallbackAdded(isAdvancedProtectionEnabledInternal(), callback);
+ }
+ }
+
+ @Override
+ @EnforcePermission(Manifest.permission.QUERY_ADVANCED_PROTECTION_MODE)
+ public void unregisterAdvancedProtectionCallback(@NonNull IAdvancedProtectionCallback callback)
+ throws RemoteException {
+ unregisterAdvancedProtectionCallback_enforcePermission();
+ synchronized (mCallbacks) {
+ mCallbacks.remove(callback.asBinder());
+ }
+ }
+
+ @Override
+ @EnforcePermission(Manifest.permission.SET_ADVANCED_PROTECTION_MODE)
+ public void setAdvancedProtectionEnabled(boolean enabled) {
+ setAdvancedProtectionEnabled_enforcePermission();
+ final long identity = Binder.clearCallingIdentity();
+ try {
+ synchronized (mCallbacks) {
+ if (enabled != isAdvancedProtectionEnabledInternal()) {
+ mStore.store(enabled);
+ sendModeChanged(enabled);
+ }
+ }
+ } finally {
+ Binder.restoreCallingIdentity(identity);
+ }
+ }
+
+ @Override
+ public void onShellCommand(FileDescriptor in, FileDescriptor out,
+ FileDescriptor err, @NonNull String[] args, ShellCallback callback,
+ @NonNull ResultReceiver resultReceiver) {
+ (new AdvancedProtectionShellCommand(this))
+ .exec(this, in, out, err, args, callback, resultReceiver);
+ }
+
+ void sendModeChanged(boolean enabled) {
+ Message.obtain(mHandler, MODE_CHANGED, /*enabled*/ enabled ? 1 : 0, /*unused */ -1)
+ .sendToTarget();
+ }
+
+ void sendCallbackAdded(boolean enabled, IAdvancedProtectionCallback callback) {
+ Message.obtain(mHandler, MODE_CHANGED, /*enabled*/ enabled ? 1 : 0, /*unused*/ -1,
+ /*callback*/ callback)
+ .sendToTarget();
+ }
+
+ public static final class Lifecycle extends SystemService {
+ private final AdvancedProtectionService mService;
+
+ public Lifecycle(@NonNull Context context) {
+ super(context);
+ mService = new AdvancedProtectionService(context);
+ }
+
+ @Override
+ public void onStart() {
+ publishBinderService(Context.ADVANCED_PROTECTION_SERVICE, mService);
+ }
+ }
+
+ @VisibleForTesting
+ static class AdvancedProtectionStore {
+ private final Context mContext;
+ private static final int APM_ON = 1;
+ private static final int APM_OFF = 0;
+ private final UserManagerInternal mUserManager;
+
+ AdvancedProtectionStore(@NonNull Context context) {
+ mContext = context;
+ mUserManager = LocalServices.getService(UserManagerInternal.class);
+ }
+
+ void store(boolean enabled) {
+ Settings.Secure.putIntForUser(mContext.getContentResolver(),
+ ADVANCED_PROTECTION_MODE, enabled ? APM_ON : APM_OFF,
+ mUserManager.getMainUserId());
+ }
+
+ boolean retrieve() {
+ return Settings.Secure.getIntForUser(mContext.getContentResolver(),
+ ADVANCED_PROTECTION_MODE, APM_OFF, mUserManager.getMainUserId()) == APM_ON;
+ }
+ }
+
+ private class AdvancedProtectionHandler extends Handler {
+ private AdvancedProtectionHandler(@NonNull Looper looper) {
+ super(looper);
+ }
+
+ @Override
+ public void handleMessage(@NonNull Message msg) {
+ switch (msg.what) {
+ //arg1 == enabled
+ case MODE_CHANGED:
+ handleAllCallbacks(msg.arg1 == 1);
+ break;
+ //arg1 == enabled
+ //obj == callback
+ case CALLBACK_ADDED:
+ handleSingleCallback(msg.arg1 == 1, (IAdvancedProtectionCallback) msg.obj);
+ break;
+ }
+ }
+
+ private void handleAllCallbacks(boolean enabled) {
+ ArrayList<IAdvancedProtectionCallback> deadObjects = new ArrayList<>();
+
+ synchronized (mCallbacks) {
+ for (int i = 0; i < mCallbacks.size(); i++) {
+ IAdvancedProtectionCallback callback = mCallbacks.valueAt(i);
+ try {
+ callback.onAdvancedProtectionChanged(enabled);
+ } catch (RemoteException e) {
+ deadObjects.add(callback);
+ }
+ }
+
+ for (int i = 0; i < deadObjects.size(); i++) {
+ mCallbacks.remove(deadObjects.get(i).asBinder());
+ }
+ }
+ }
+
+ private void handleSingleCallback(boolean enabled, IAdvancedProtectionCallback callback) {
+ try {
+ callback.onAdvancedProtectionChanged(enabled);
+ } catch (RemoteException e) {
+ mCallbacks.remove(callback.asBinder());
+ }
+ }
+ }
+
+ private final class DeathRecipient implements IBinder.DeathRecipient {
+ private final IBinder mBinder;
+
+ DeathRecipient(IBinder binder) {
+ mBinder = binder;
+ }
+
+ @Override
+ public void binderDied() {
+ synchronized (mCallbacks) {
+ mCallbacks.remove(mBinder);
+ }
+ }
+ }
+}
diff --git a/services/core/java/com/android/server/security/advancedprotection/AdvancedProtectionShellCommand.java b/services/core/java/com/android/server/security/advancedprotection/AdvancedProtectionShellCommand.java
new file mode 100644
index 000000000000..42505ad2de3f
--- /dev/null
+++ b/services/core/java/com/android/server/security/advancedprotection/AdvancedProtectionShellCommand.java
@@ -0,0 +1,82 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.server.security.advancedprotection;
+
+import android.annotation.NonNull;
+import android.annotation.SuppressLint;
+import android.os.RemoteException;
+import android.os.ShellCommand;
+
+import java.io.PrintWriter;
+
+class AdvancedProtectionShellCommand extends ShellCommand {
+ private AdvancedProtectionService mService;
+
+ AdvancedProtectionShellCommand(@NonNull AdvancedProtectionService service) {
+ mService = service;
+ }
+
+ @Override
+ public int onCommand(String cmd) {
+ if (cmd == null) {
+ return handleDefaultCommands(cmd);
+ }
+ final PrintWriter pw = getOutPrintWriter();
+ try {
+ switch (cmd) {
+ case "help":
+ onHelp();
+ return 0;
+ case "set-protection-enabled":
+ return setProtectionEnabled();
+ case "is-protection-enabled":
+ return isProtectionEnabled(pw);
+ }
+ } catch (RemoteException e) {
+ pw.println("Remote exception: " + e);
+ }
+ return -1;
+ }
+
+ @Override
+ public void onHelp() {
+ PrintWriter pw = getOutPrintWriter();
+ dumpHelp(pw);
+ }
+
+ private void dumpHelp(@NonNull PrintWriter pw) {
+ pw.println("Advanced Protection Mode commands:");
+ pw.println(" help");
+ pw.println(" Print this help text.");
+ pw.println(" set-protection-enabled [true|false]");
+ pw.println(" is-protection-enabled");
+ }
+
+ @SuppressLint("AndroidFrameworkRequiresPermission")
+ private int setProtectionEnabled() throws RemoteException {
+ String protectionMode = getNextArgRequired();
+ mService.setAdvancedProtectionEnabled(Boolean.parseBoolean(protectionMode));
+ return 0;
+ }
+
+ @SuppressLint("AndroidFrameworkRequiresPermission")
+ private int isProtectionEnabled(@NonNull PrintWriter pw) throws RemoteException {
+ boolean protectionMode = mService.isAdvancedProtectionEnabled();
+ pw.println(protectionMode);
+ return 0;
+ }
+}
diff --git a/services/core/java/com/android/server/security/advancedprotection/OWNERS b/services/core/java/com/android/server/security/advancedprotection/OWNERS
new file mode 100644
index 000000000000..9bf5e58c01a9
--- /dev/null
+++ b/services/core/java/com/android/server/security/advancedprotection/OWNERS
@@ -0,0 +1 @@
+file:platform/frameworks/base:main:/core/java/android/security/advancedprotection/OWNERS
diff --git a/services/core/java/com/android/server/security/forensic/ForensicService.java b/services/core/java/com/android/server/security/forensic/ForensicService.java
new file mode 100644
index 000000000000..07639d1a3945
--- /dev/null
+++ b/services/core/java/com/android/server/security/forensic/ForensicService.java
@@ -0,0 +1,294 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.server.security.forensic;
+
+import android.annotation.NonNull;
+import android.content.Context;
+import android.os.Handler;
+import android.os.Looper;
+import android.os.Message;
+import android.os.RemoteException;
+import android.security.forensic.IForensicService;
+import android.security.forensic.IForensicServiceCommandCallback;
+import android.security.forensic.IForensicServiceStateCallback;
+import android.util.Slog;
+
+import com.android.internal.annotations.VisibleForTesting;
+import com.android.server.ServiceThread;
+import com.android.server.SystemService;
+
+import java.util.ArrayList;
+
+/**
+ * @hide
+ */
+public class ForensicService extends SystemService {
+ private static final String TAG = "ForensicService";
+
+ private static final int MSG_MONITOR_STATE = 0;
+ private static final int MSG_MAKE_VISIBLE = 1;
+ private static final int MSG_MAKE_INVISIBLE = 2;
+ private static final int MSG_ENABLE = 3;
+ private static final int MSG_DISABLE = 4;
+ private static final int MSG_BACKUP = 5;
+
+ private static final int STATE_UNKNOWN = IForensicServiceStateCallback.State.UNKNOWN;
+ private static final int STATE_INVISIBLE = IForensicServiceStateCallback.State.INVISIBLE;
+ private static final int STATE_VISIBLE = IForensicServiceStateCallback.State.VISIBLE;
+ private static final int STATE_ENABLED = IForensicServiceStateCallback.State.ENABLED;
+
+ private static final int ERROR_UNKNOWN = IForensicServiceCommandCallback.ErrorCode.UNKNOWN;
+ private static final int ERROR_PERMISSION_DENIED =
+ IForensicServiceCommandCallback.ErrorCode.PERMISSION_DENIED;
+ private static final int ERROR_INVALID_STATE_TRANSITION =
+ IForensicServiceCommandCallback.ErrorCode.INVALID_STATE_TRANSITION;
+ private static final int ERROR_BACKUP_TRANSPORT_UNAVAILABLE =
+ IForensicServiceCommandCallback.ErrorCode.BACKUP_TRANSPORT_UNAVAILABLE;
+ private static final int ERROR_DATA_SOURCE_UNAVAILABLE =
+ IForensicServiceCommandCallback.ErrorCode.DATA_SOURCE_UNAVAILABLE;
+
+ private final Context mContext;
+ private final Handler mHandler;
+ private final BinderService mBinderService;
+
+ private final ArrayList<IForensicServiceStateCallback> mStateMonitors = new ArrayList<>();
+ private volatile int mState = STATE_INVISIBLE;
+
+ public ForensicService(@NonNull Context context) {
+ this(new InjectorImpl(context));
+ }
+
+ @VisibleForTesting
+ ForensicService(@NonNull Injector injector) {
+ super(injector.getContext());
+ mContext = injector.getContext();
+ mHandler = new EventHandler(injector.getLooper(), this);
+ mBinderService = new BinderService(this);
+ }
+
+ @VisibleForTesting
+ protected void setState(int state) {
+ mState = state;
+ }
+
+ private static final class BinderService extends IForensicService.Stub {
+ final ForensicService mService;
+
+ BinderService(ForensicService service) {
+ mService = service;
+ }
+
+ @Override
+ public void monitorState(IForensicServiceStateCallback callback) {
+ mService.mHandler.obtainMessage(MSG_MONITOR_STATE, callback).sendToTarget();
+ }
+
+ @Override
+ public void makeVisible(IForensicServiceCommandCallback callback) {
+ mService.mHandler.obtainMessage(MSG_MAKE_VISIBLE, callback).sendToTarget();
+ }
+
+ @Override
+ public void makeInvisible(IForensicServiceCommandCallback callback) {
+ mService.mHandler.obtainMessage(MSG_MAKE_INVISIBLE, callback).sendToTarget();
+ }
+
+ @Override
+ public void enable(IForensicServiceCommandCallback callback) {
+ mService.mHandler.obtainMessage(MSG_ENABLE, callback).sendToTarget();
+ }
+
+ @Override
+ public void disable(IForensicServiceCommandCallback callback) {
+ mService.mHandler.obtainMessage(MSG_DISABLE, callback).sendToTarget();
+ }
+ }
+
+ private static class EventHandler extends Handler {
+ private final ForensicService mService;
+
+ EventHandler(Looper looper, ForensicService service) {
+ super(looper);
+ mService = service;
+ }
+
+ @Override
+ public void handleMessage(Message msg) {
+ switch (msg.what) {
+ case MSG_MONITOR_STATE:
+ try {
+ mService.monitorState(
+ (IForensicServiceStateCallback) msg.obj);
+ } catch (RemoteException e) {
+ Slog.e(TAG, "RemoteException", e);
+ }
+ break;
+ case MSG_MAKE_VISIBLE:
+ try {
+ mService.makeVisible((IForensicServiceCommandCallback) msg.obj);
+ } catch (RemoteException e) {
+ Slog.e(TAG, "RemoteException", e);
+ }
+ break;
+ case MSG_MAKE_INVISIBLE:
+ try {
+ mService.makeInvisible((IForensicServiceCommandCallback) msg.obj);
+ } catch (RemoteException e) {
+ Slog.e(TAG, "RemoteException", e);
+ }
+ break;
+ case MSG_ENABLE:
+ try {
+ mService.enable((IForensicServiceCommandCallback) msg.obj);
+ } catch (RemoteException e) {
+ Slog.e(TAG, "RemoteException", e);
+ }
+ break;
+ case MSG_DISABLE:
+ try {
+ mService.disable((IForensicServiceCommandCallback) msg.obj);
+ } catch (RemoteException e) {
+ Slog.e(TAG, "RemoteException", e);
+ }
+ break;
+ default:
+ Slog.w(TAG, "Unknown message: " + msg.what);
+ }
+ }
+ }
+
+ private void monitorState(IForensicServiceStateCallback callback) throws RemoteException {
+ for (int i = 0; i < mStateMonitors.size(); i++) {
+ if (mStateMonitors.get(i).asBinder() == callback.asBinder()) {
+ return;
+ }
+ }
+ mStateMonitors.add(callback);
+ callback.onStateChange(mState);
+ }
+
+ private void notifyStateMonitors() throws RemoteException {
+ for (int i = 0; i < mStateMonitors.size(); i++) {
+ mStateMonitors.get(i).onStateChange(mState);
+ }
+ }
+
+ private void makeVisible(IForensicServiceCommandCallback callback) throws RemoteException {
+ switch (mState) {
+ case STATE_INVISIBLE:
+ mState = STATE_VISIBLE;
+ notifyStateMonitors();
+ callback.onSuccess();
+ break;
+ case STATE_VISIBLE:
+ callback.onSuccess();
+ break;
+ default:
+ callback.onFailure(ERROR_INVALID_STATE_TRANSITION);
+ }
+ }
+
+ private void makeInvisible(IForensicServiceCommandCallback callback) throws RemoteException {
+ switch (mState) {
+ case STATE_VISIBLE:
+ case STATE_ENABLED:
+ mState = STATE_INVISIBLE;
+ notifyStateMonitors();
+ callback.onSuccess();
+ break;
+ case STATE_INVISIBLE:
+ callback.onSuccess();
+ break;
+ default:
+ callback.onFailure(ERROR_INVALID_STATE_TRANSITION);
+ }
+ }
+
+ private void enable(IForensicServiceCommandCallback callback) throws RemoteException {
+ switch (mState) {
+ case STATE_VISIBLE:
+ mState = STATE_ENABLED;
+ notifyStateMonitors();
+ callback.onSuccess();
+ break;
+ case STATE_ENABLED:
+ callback.onSuccess();
+ break;
+ default:
+ callback.onFailure(ERROR_INVALID_STATE_TRANSITION);
+ }
+ }
+
+ private void disable(IForensicServiceCommandCallback callback) throws RemoteException {
+ switch (mState) {
+ case STATE_ENABLED:
+ mState = STATE_VISIBLE;
+ notifyStateMonitors();
+ callback.onSuccess();
+ break;
+ case STATE_VISIBLE:
+ callback.onSuccess();
+ break;
+ default:
+ callback.onFailure(ERROR_INVALID_STATE_TRANSITION);
+ }
+ }
+
+ @Override
+ public void onStart() {
+ try {
+ publishBinderService(Context.FORENSIC_SERVICE, mBinderService);
+ } catch (Throwable t) {
+ Slog.e(TAG, "Could not start the ForensicService.", t);
+ }
+ }
+
+ @VisibleForTesting
+ IForensicService getBinderService() {
+ return mBinderService;
+ }
+
+ interface Injector {
+ Context getContext();
+
+ Looper getLooper();
+ }
+
+ private static final class InjectorImpl implements Injector {
+ private final Context mContext;
+
+ InjectorImpl(Context context) {
+ mContext = context;
+ }
+
+ @Override
+ public Context getContext() {
+ return mContext;
+ }
+
+
+ @Override
+ public Looper getLooper() {
+ ServiceThread serviceThread =
+ new ServiceThread(
+ TAG, android.os.Process.THREAD_PRIORITY_FOREGROUND, true /* allowIo */);
+ serviceThread.start();
+ return serviceThread.getLooper();
+ }
+ }
+}
+
diff --git a/services/core/java/com/android/server/stats/bootstrap/StatsBootstrapAtomService.java b/services/core/java/com/android/server/stats/bootstrap/StatsBootstrapAtomService.java
index dcb47a7b60b6..4c9cbc449656 100644
--- a/services/core/java/com/android/server/stats/bootstrap/StatsBootstrapAtomService.java
+++ b/services/core/java/com/android/server/stats/bootstrap/StatsBootstrapAtomService.java
@@ -42,27 +42,28 @@ public class StatsBootstrapAtomService extends IStatsBootstrapAtomService.Stub {
return;
}
StatsEvent.Builder builder = StatsEvent.newBuilder().setAtomId(atom.atomId);
- for (StatsBootstrapAtomValue value : atom.values) {
+ for (StatsBootstrapAtomValue atomValue : atom.values) {
+ StatsBootstrapAtomValue.Primitive value = atomValue.value;
switch (value.getTag()) {
- case StatsBootstrapAtomValue.boolValue:
+ case StatsBootstrapAtomValue.Primitive.boolValue:
builder.writeBoolean(value.getBoolValue());
break;
- case StatsBootstrapAtomValue.intValue:
+ case StatsBootstrapAtomValue.Primitive.intValue:
builder.writeInt(value.getIntValue());
break;
- case StatsBootstrapAtomValue.longValue:
+ case StatsBootstrapAtomValue.Primitive.longValue:
builder.writeLong(value.getLongValue());
break;
- case StatsBootstrapAtomValue.floatValue:
+ case StatsBootstrapAtomValue.Primitive.floatValue:
builder.writeFloat(value.getFloatValue());
break;
- case StatsBootstrapAtomValue.stringValue:
+ case StatsBootstrapAtomValue.Primitive.stringValue:
builder.writeString(value.getStringValue());
break;
- case StatsBootstrapAtomValue.bytesValue:
+ case StatsBootstrapAtomValue.Primitive.bytesValue:
builder.writeByteArray(value.getBytesValue());
break;
- case StatsBootstrapAtomValue.stringArrayValue:
+ case StatsBootstrapAtomValue.Primitive.stringArrayValue:
builder.writeStringArray(value.getStringArrayValue());
break;
default:
@@ -71,6 +72,25 @@ public class StatsBootstrapAtomService extends IStatsBootstrapAtomService.Stub {
return;
}
+ StatsBootstrapAtomValue.Annotation[] annotations = atomValue.annotations;
+ for (StatsBootstrapAtomValue.Annotation annotation : atomValue.annotations) {
+ if (annotation.id != StatsBootstrapAtomValue.Annotation.Id.IS_UID) {
+ Slog.e(TAG, "Unexpected annotation ID: " + annotation.id
+ + ", for atom " + atom.atomId + ": only UIDs are supported!");
+ return;
+ }
+
+ switch (annotation.value.getTag()) {
+ case StatsBootstrapAtomValue.Annotation.Primitive.boolValue:
+ builder.addBooleanAnnotation(
+ annotation.id, annotation.value.getBoolValue());
+ break;
+ default:
+ Slog.e(TAG, "Unexpected value type " + annotation.value.getTag()
+ + " when logging UID for atom " + atom.atomId);
+ return;
+ }
+ }
}
StatsLog.write(builder.usePooledBuffer().build());
}
diff --git a/services/core/java/com/android/server/vcn/VcnContext.java b/services/core/java/com/android/server/vcn/VcnContext.java
index 6a4c9c26d314..a492a72933d7 100644
--- a/services/core/java/com/android/server/vcn/VcnContext.java
+++ b/services/core/java/com/android/server/vcn/VcnContext.java
@@ -70,10 +70,6 @@ public class VcnContext {
return mIsInTestMode;
}
- public boolean isFlagNetworkMetricMonitorEnabled() {
- return mFeatureFlags.networkMetricMonitor();
- }
-
public boolean isFlagIpSecTransformStateEnabled() {
// TODO: b/328844044: Ideally this code should gate the behavior by checking the
// android.net.platform.flags.ipsec_transform_state flag but that flag is not accessible
diff --git a/services/core/java/com/android/server/vcn/VcnGatewayConnection.java b/services/core/java/com/android/server/vcn/VcnGatewayConnection.java
index b5747828349e..a81ad22ddf4a 100644
--- a/services/core/java/com/android/server/vcn/VcnGatewayConnection.java
+++ b/services/core/java/com/android/server/vcn/VcnGatewayConnection.java
@@ -1913,7 +1913,6 @@ public class VcnGatewayConnection extends StateMachine {
mIpSecManager.applyTunnelModeTransform(tunnelIface, direction, transform);
if (direction == IpSecManager.DIRECTION_IN
- && mVcnContext.isFlagNetworkMetricMonitorEnabled()
&& mVcnContext.isFlagIpSecTransformStateEnabled()) {
mUnderlyingNetworkController.updateInboundTransform(mUnderlying, transform);
}
diff --git a/services/core/java/com/android/server/vcn/routeselection/NetworkMetricMonitor.java b/services/core/java/com/android/server/vcn/routeselection/NetworkMetricMonitor.java
index b9b10606a188..0d4c3736775b 100644
--- a/services/core/java/com/android/server/vcn/routeselection/NetworkMetricMonitor.java
+++ b/services/core/java/com/android/server/vcn/routeselection/NetworkMetricMonitor.java
@@ -62,12 +62,6 @@ public abstract class NetworkMetricMonitor implements AutoCloseable {
@Nullable PersistableBundleWrapper carrierConfig,
@NonNull NetworkMetricMonitorCallback callback)
throws IllegalAccessException {
- if (!vcnContext.isFlagNetworkMetricMonitorEnabled()) {
- // Caller error
- logWtf("networkMetricMonitor flag disabled");
- throw new IllegalAccessException("networkMetricMonitor flag disabled");
- }
-
mVcnContext = Objects.requireNonNull(vcnContext, "Missing vcnContext");
mNetwork = Objects.requireNonNull(network, "Missing network");
mCallback = Objects.requireNonNull(callback, "Missing callback");
diff --git a/services/core/java/com/android/server/vcn/routeselection/UnderlyingNetworkController.java b/services/core/java/com/android/server/vcn/routeselection/UnderlyingNetworkController.java
index 2b0ca0802359..ad5bc7294f85 100644
--- a/services/core/java/com/android/server/vcn/routeselection/UnderlyingNetworkController.java
+++ b/services/core/java/com/android/server/vcn/routeselection/UnderlyingNetworkController.java
@@ -204,8 +204,7 @@ public class UnderlyingNetworkController {
List<NetworkCallback> oldCellCallbacks = new ArrayList<>(mCellBringupCallbacks);
mCellBringupCallbacks.clear();
- if (mVcnContext.isFlagNetworkMetricMonitorEnabled()
- && mVcnContext.isFlagIpSecTransformStateEnabled()) {
+ if (mVcnContext.isFlagIpSecTransformStateEnabled()) {
for (UnderlyingNetworkEvaluator evaluator : mUnderlyingNetworkRecords.values()) {
evaluator.close();
}
@@ -431,8 +430,7 @@ public class UnderlyingNetworkController {
.getAllSubIdsInGroup(mSubscriptionGroup)
.equals(newSnapshot.getAllSubIdsInGroup(mSubscriptionGroup))) {
- if (mVcnContext.isFlagNetworkMetricMonitorEnabled()
- && mVcnContext.isFlagIpSecTransformStateEnabled()) {
+ if (mVcnContext.isFlagIpSecTransformStateEnabled()) {
reevaluateNetworks();
}
return;
@@ -447,8 +445,7 @@ public class UnderlyingNetworkController {
*/
public void updateInboundTransform(
@NonNull UnderlyingNetworkRecord currentNetwork, @NonNull IpSecTransform transform) {
- if (!mVcnContext.isFlagNetworkMetricMonitorEnabled()
- || !mVcnContext.isFlagIpSecTransformStateEnabled()) {
+ if (!mVcnContext.isFlagIpSecTransformStateEnabled()) {
logWtf("#updateInboundTransform: unexpected call; flags missing");
return;
}
@@ -575,8 +572,7 @@ public class UnderlyingNetworkController {
@Override
public void onLost(@NonNull Network network) {
- if (mVcnContext.isFlagNetworkMetricMonitorEnabled()
- && mVcnContext.isFlagIpSecTransformStateEnabled()) {
+ if (mVcnContext.isFlagIpSecTransformStateEnabled()) {
mUnderlyingNetworkRecords.get(network).close();
}
@@ -652,8 +648,7 @@ public class UnderlyingNetworkController {
class NetworkEvaluatorCallbackImpl implements NetworkEvaluatorCallback {
@Override
public void onEvaluationResultChanged() {
- if (!mVcnContext.isFlagNetworkMetricMonitorEnabled()
- || !mVcnContext.isFlagIpSecTransformStateEnabled()) {
+ if (!mVcnContext.isFlagIpSecTransformStateEnabled()) {
logWtf("#onEvaluationResultChanged: unexpected call; flags missing");
return;
}
diff --git a/services/core/java/com/android/server/vcn/routeselection/UnderlyingNetworkEvaluator.java b/services/core/java/com/android/server/vcn/routeselection/UnderlyingNetworkEvaluator.java
index c852fb4e170f..53b0751d196e 100644
--- a/services/core/java/com/android/server/vcn/routeselection/UnderlyingNetworkEvaluator.java
+++ b/services/core/java/com/android/server/vcn/routeselection/UnderlyingNetworkEvaluator.java
@@ -193,8 +193,7 @@ public class UnderlyingNetworkEvaluator {
}
private static boolean isIpSecPacketLossDetectorEnabled(VcnContext vcnContext) {
- return vcnContext.isFlagIpSecTransformStateEnabled()
- && vcnContext.isFlagNetworkMetricMonitorEnabled();
+ return vcnContext.isFlagIpSecTransformStateEnabled();
}
/** Get the comparator for UnderlyingNetworkEvaluator */
diff --git a/services/core/java/com/android/server/wallpaper/WallpaperManagerService.java b/services/core/java/com/android/server/wallpaper/WallpaperManagerService.java
index 2d75f35d2a9c..da9a67640f77 100644
--- a/services/core/java/com/android/server/wallpaper/WallpaperManagerService.java
+++ b/services/core/java/com/android/server/wallpaper/WallpaperManagerService.java
@@ -537,7 +537,7 @@ public class WallpaperManagerService extends IWallpaperManager.Stub
* @return true unless the wallpaper changed during the color computation
*/
private boolean extractColors(WallpaperData wallpaper) {
- if (offloadColorExtraction()) return !mImageWallpaper.equals(wallpaper.getComponent());
+ if (offloadColorExtraction()) return true;
String cropFile = null;
boolean defaultImageWallpaper = false;
int wallpaperId;
diff --git a/services/core/java/com/android/server/wm/ActivityTaskManagerService.java b/services/core/java/com/android/server/wm/ActivityTaskManagerService.java
index 5339753624d8..111e74e9b590 100644
--- a/services/core/java/com/android/server/wm/ActivityTaskManagerService.java
+++ b/services/core/java/com/android/server/wm/ActivityTaskManagerService.java
@@ -6752,6 +6752,8 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub {
break;
}
}
+ ProtoLog.v(WM_DEBUG_CONFIGURATION, "Binding proc %s with config %s",
+ wpc.mName, wpc.getConfiguration());
// The "info" can be the target of instrumentation.
return new PreBindInfo(compatibilityInfoForPackageLocked(info),
new Configuration(wpc.getConfiguration()));
diff --git a/services/core/java/com/android/server/wm/BackNavigationController.java b/services/core/java/com/android/server/wm/BackNavigationController.java
index 94cd2e64b057..70f9ebb0e61e 100644
--- a/services/core/java/com/android/server/wm/BackNavigationController.java
+++ b/services/core/java/com/android/server/wm/BackNavigationController.java
@@ -34,6 +34,7 @@ import static com.android.server.wm.BackNavigationProto.LAST_BACK_TYPE;
import static com.android.server.wm.BackNavigationProto.MAIN_OPEN_ACTIVITY;
import static com.android.server.wm.BackNavigationProto.SHOW_WALLPAPER;
import static com.android.server.wm.SurfaceAnimator.ANIMATION_TYPE_PREDICT_BACK;
+import static com.android.server.wm.WindowContainer.SYNC_STATE_NONE;
import android.annotation.NonNull;
import android.annotation.Nullable;
@@ -1237,8 +1238,9 @@ class BackNavigationController {
}
allWindowDrawn &= next.mAppWindowDrawn;
}
- // Do not remove until transition ready.
- if (!activity.isVisible()) {
+ // Do not remove windowless surfaces if the transaction has not been applied.
+ if (activity.getSyncTransactionCommitCallbackDepth() > 0
+ || activity.mSyncState != SYNC_STATE_NONE) {
return;
}
if (allWindowDrawn) {
diff --git a/services/core/java/com/android/server/wm/InputManagerCallback.java b/services/core/java/com/android/server/wm/InputManagerCallback.java
index a4fe0647ea79..9d21183c6c03 100644
--- a/services/core/java/com/android/server/wm/InputManagerCallback.java
+++ b/services/core/java/com/android/server/wm/InputManagerCallback.java
@@ -131,7 +131,9 @@ final class InputManagerCallback implements InputManagerService.WindowManagerCal
final boolean changed = !com.android.window.flags.Flags.filterIrrelevantInputDeviceChange()
|| updateLastInputConfigurationSources();
- if (changed) {
+ // Even if the input devices are not changed, there could be other pending changes
+ // during booting. It's fine to apply earlier.
+ if (changed || !mService.mDisplayEnabled) {
synchronized (mService.mGlobalLock) {
Trace.traceBegin(TRACE_TAG_WINDOW_MANAGER, "inputDeviceConfigChanged");
mService.mRoot.forAllDisplays(DisplayContent::sendNewConfiguration);
diff --git a/services/core/java/com/android/server/wm/InsetsSourceProvider.java b/services/core/java/com/android/server/wm/InsetsSourceProvider.java
index 6067a9972bbe..1d4d6eb82c44 100644
--- a/services/core/java/com/android/server/wm/InsetsSourceProvider.java
+++ b/services/core/java/com/android/server/wm/InsetsSourceProvider.java
@@ -409,7 +409,7 @@ class InsetsSourceProvider {
}
final Point position = getWindowFrameSurfacePosition();
if (!mPosition.equals(position)) {
- mPosition.set(position.x, position.y);
+ mPosition.set(position);
if (windowState != null && windowState.getWindowFrames().didFrameSizeChange()
&& windowState.mWinAnimator.getShown() && mWindowContainer.okToDisplay()) {
mHasPendingPosition = true;
@@ -553,6 +553,7 @@ class InsetsSourceProvider {
}
boolean initiallyVisible = mClientVisible;
final Point surfacePosition = getWindowFrameSurfacePosition();
+ mPosition.set(surfacePosition);
mAdapter = new ControlAdapter(surfacePosition);
if (mSource.getType() == WindowInsets.Type.ime()) {
if (android.view.inputmethod.Flags.refactorInsetsController()) {
diff --git a/services/core/java/com/android/server/wm/ScreenRotationAnimation.java b/services/core/java/com/android/server/wm/ScreenRotationAnimation.java
index 0d3fa1b48b4c..4bd294be22b6 100644
--- a/services/core/java/com/android/server/wm/ScreenRotationAnimation.java
+++ b/services/core/java/com/android/server/wm/ScreenRotationAnimation.java
@@ -32,7 +32,6 @@ import static com.android.server.wm.SurfaceAnimator.ANIMATION_TYPE_SCREEN_ROTATI
import static com.android.server.wm.WindowManagerDebugConfig.TAG_WITH_CLASS_NAME;
import static com.android.server.wm.WindowManagerDebugConfig.TAG_WM;
import static com.android.server.wm.utils.CoordinateTransforms.computeRotationMatrix;
-import static com.android.window.flags.Flags.deleteCaptureDisplay;
import android.animation.ArgbEvaluator;
import android.content.Context;
@@ -41,11 +40,9 @@ import android.graphics.Matrix;
import android.graphics.Point;
import android.graphics.Rect;
import android.hardware.HardwareBuffer;
-import android.os.IBinder;
import android.os.Trace;
import android.util.Slog;
import android.util.proto.ProtoOutputStream;
-import android.view.DisplayAddress;
import android.view.DisplayInfo;
import android.view.Surface;
import android.view.Surface.OutOfResourcesException;
@@ -58,7 +55,6 @@ import android.window.ScreenCapture;
import com.android.internal.R;
import com.android.internal.policy.TransitionAnimation;
import com.android.internal.protolog.ProtoLog;
-import com.android.server.display.DisplayControl;
import com.android.server.wm.SurfaceAnimator.AnimationType;
import com.android.server.wm.SurfaceAnimator.OnAnimationFinishedCallback;
@@ -171,33 +167,7 @@ class ScreenRotationAnimation {
try {
final ScreenCapture.ScreenshotHardwareBuffer screenshotBuffer;
- if (isSizeChanged && !deleteCaptureDisplay()) {
- final DisplayAddress address = displayInfo.address;
- if (!(address instanceof DisplayAddress.Physical)) {
- Slog.e(TAG, "Display does not have a physical address: " + displayId);
- return;
- }
- final DisplayAddress.Physical physicalAddress =
- (DisplayAddress.Physical) address;
- final IBinder displayToken = DisplayControl.getPhysicalDisplayToken(
- physicalAddress.getPhysicalDisplayId());
- if (displayToken == null) {
- Slog.e(TAG, "Display token is null.");
- return;
- }
- // Temporarily not skip screenshot for the rounded corner overlays and screenshot
- // the whole display to include the rounded corner overlays.
- setSkipScreenshotForRoundedCornerOverlays(false, t);
- mRoundedCornerOverlay = displayContent.findRoundedCornerOverlays();
- final ScreenCapture.DisplayCaptureArgs captureArgs =
- new ScreenCapture.DisplayCaptureArgs.Builder(displayToken)
- .setSourceCrop(new Rect(0, 0, width, height))
- .setAllowProtected(true)
- .setCaptureSecureLayers(true)
- .setHintForSeamlessTransition(true)
- .build();
- screenshotBuffer = ScreenCapture.captureDisplay(captureArgs);
- } else if (isSizeChanged) {
+ if (isSizeChanged) {
// Temporarily not skip screenshot for the rounded corner overlays and screenshot
// the whole display to include the rounded corner overlays.
setSkipScreenshotForRoundedCornerOverlays(false, t);
diff --git a/services/core/java/com/android/server/wm/Task.java b/services/core/java/com/android/server/wm/Task.java
index a4e4deb9ed7d..4861341f830a 100644
--- a/services/core/java/com/android/server/wm/Task.java
+++ b/services/core/java/com/android/server/wm/Task.java
@@ -5742,9 +5742,9 @@ class Task extends TaskFragment {
}
private boolean canMoveTaskToBack(Task task) {
- // Checks whether a task is a child of this task because it can be reparetned when
+ // Checks whether a task is a child of this task because it can be reparented when
// transition is deferred.
- if (task != this && task.getParent() != this) {
+ if (task != this && !task.isDescendantOf(this)) {
return false;
}
diff --git a/services/core/java/com/android/server/wm/WindowProcessController.java b/services/core/java/com/android/server/wm/WindowProcessController.java
index 86adc1944371..1a107c24a16a 100644
--- a/services/core/java/com/android/server/wm/WindowProcessController.java
+++ b/services/core/java/com/android/server/wm/WindowProcessController.java
@@ -133,7 +133,7 @@ public class WindowProcessController extends ConfigurationContainer<Configuratio
private int mRapidActivityLaunchCount;
// all about the first app in the process
- final ApplicationInfo mInfo;
+ volatile ApplicationInfo mInfo;
final String mName;
final int mUid;
@@ -1805,12 +1805,17 @@ public class WindowProcessController extends ConfigurationContainer<Configuratio
Configuration overrideConfig = new Configuration(r.getRequestedOverrideConfiguration());
overrideConfig.assetsSeq = assetSeq;
r.onRequestedOverrideConfigurationChanged(overrideConfig);
+ r.updateApplicationInfo(mInfo);
if (r.isVisibleRequested()) {
r.ensureActivityConfiguration();
}
}
}
+ public void updateApplicationInfo(ApplicationInfo aInfo) {
+ mInfo = aInfo;
+ }
+
/**
* This is called for sending {@link android.app.servertransaction.LaunchActivityItem}.
* The caller must call {@link #setLastReportedConfiguration} if the delivered configuration
diff --git a/services/core/java/com/android/server/wm/WindowTracingPerfetto.java b/services/core/java/com/android/server/wm/WindowTracingPerfetto.java
index 6e8094ac21d7..1b42e13039be 100644
--- a/services/core/java/com/android/server/wm/WindowTracingPerfetto.java
+++ b/services/core/java/com/android/server/wm/WindowTracingPerfetto.java
@@ -159,22 +159,28 @@ class WindowTracingPerfetto extends WindowTracing {
void onStart(WindowTracingDataSource.Config config) {
if (config.mLogFrequency == WindowTracingLogFrequency.FRAME) {
+ Log.i(TAG, "Started session (frequency=FRAME, log level=" + config.mLogFrequency + ")");
mCountSessionsOnFrame.incrementAndGet();
} else if (config.mLogFrequency == WindowTracingLogFrequency.TRANSACTION) {
+ Log.i(TAG, "Started session (frequency=TRANSACTION, log level="
+ + config.mLogFrequency + ")");
mCountSessionsOnTransaction.incrementAndGet();
}
- Log.i(TAG, "Started with logLevel: " + config.mLogLevel
- + " logFrequency: " + config.mLogFrequency);
+ Log.i(TAG, getStatus());
+
log(WHERE_START_TRACING);
}
void onStop(WindowTracingDataSource.Config config) {
if (config.mLogFrequency == WindowTracingLogFrequency.FRAME) {
+ Log.i(TAG, "Stopped session (frequency=FRAME)");
mCountSessionsOnFrame.decrementAndGet();
+ Log.i(TAG, "Stopped session (frequency=TRANSACTION)");
} else if (config.mLogFrequency == WindowTracingLogFrequency.TRANSACTION) {
mCountSessionsOnTransaction.decrementAndGet();
}
- Log.i(TAG, "Stopped");
+
+ Log.i(TAG, getStatus());
}
}
diff --git a/services/java/com/android/server/SystemServer.java b/services/java/com/android/server/SystemServer.java
index b9727f9f3970..0b7ce75136bb 100644
--- a/services/java/com/android/server/SystemServer.java
+++ b/services/java/com/android/server/SystemServer.java
@@ -246,6 +246,7 @@ import com.android.server.security.AttestationVerificationManagerService;
import com.android.server.security.FileIntegrityService;
import com.android.server.security.KeyAttestationApplicationIdProviderService;
import com.android.server.security.KeyChainSystemService;
+import com.android.server.security.advancedprotection.AdvancedProtectionService;
import com.android.server.security.rkp.RemoteProvisioningService;
import com.android.server.selinux.SelinuxAuditLogsService;
import com.android.server.sensorprivacy.SensorPrivacyService;
@@ -327,8 +328,6 @@ public final class SystemServer implements Dumpable {
* Implementation class names for services in the {@code SYSTEMSERVERCLASSPATH}
* from {@code PRODUCT_SYSTEM_SERVER_JARS} that are *not* in {@code services.jar}.
*/
- private static final String ARC_NETWORK_SERVICE_CLASS =
- "com.android.server.arc.net.ArcNetworkService";
private static final String ARC_PERSISTENT_DATA_BLOCK_SERVICE_CLASS =
"com.android.server.arc.persistent_data_block.ArcPersistentDataBlockService";
private static final String ARC_SYSTEM_HEALTH_SERVICE =
@@ -1760,6 +1759,12 @@ public final class SystemServer implements Dumpable {
mSystemServiceManager.startService(AppFunctionManagerService.class);
t.traceEnd();
}
+
+ if (android.security.Flags.aapmApi()) {
+ t.traceBegin("StartAdvancedProtectionService");
+ mSystemServiceManager.startService(AdvancedProtectionService.Lifecycle.class);
+ t.traceEnd();
+ }
} catch (Throwable e) {
Slog.e("System", "******************************************");
Slog.e("System", "************ Failure starting core service");
@@ -2101,24 +2106,13 @@ public final class SystemServer implements Dumpable {
if (context.getPackageManager().hasSystemFeature(
PackageManager.FEATURE_WIFI)) {
// Wifi Service must be started first for wifi-related services.
- if (!isArc) {
- t.traceBegin("StartWifi");
- mSystemServiceManager.startServiceFromJar(
- WIFI_SERVICE_CLASS, WIFI_APEX_SERVICE_JAR_PATH);
- t.traceEnd();
- t.traceBegin("StartWifiScanning");
- mSystemServiceManager.startServiceFromJar(
- WIFI_SCANNING_SERVICE_CLASS, WIFI_APEX_SERVICE_JAR_PATH);
- t.traceEnd();
- }
- }
-
- // ARC - ArcNetworkService registers the ARC network stack and replaces the
- // stock WiFi service in both ARC++ container and ARCVM. Always starts the ARC network
- // stack regardless of whether FEATURE_WIFI is enabled/disabled (b/254755875).
- if (isArc) {
- t.traceBegin("StartArcNetworking");
- mSystemServiceManager.startService(ARC_NETWORK_SERVICE_CLASS);
+ t.traceBegin("StartWifi");
+ mSystemServiceManager.startServiceFromJar(
+ WIFI_SERVICE_CLASS, WIFI_APEX_SERVICE_JAR_PATH);
+ t.traceEnd();
+ t.traceBegin("StartWifiScanning");
+ mSystemServiceManager.startServiceFromJar(
+ WIFI_SCANNING_SERVICE_CLASS, WIFI_APEX_SERVICE_JAR_PATH);
t.traceEnd();
}
diff --git a/services/java/com/android/server/flags.aconfig b/services/java/com/android/server/flags.aconfig
index 09906912ef3f..e2ac22de29a4 100644
--- a/services/java/com/android/server/flags.aconfig
+++ b/services/java/com/android/server/flags.aconfig
@@ -10,6 +10,14 @@ flag {
}
flag {
+ name: "remove_java_service_manager_cache"
+ namespace: "system_performance"
+ description: "This flag turns off Java's Service Manager caching mechanism."
+ bug: "333854840"
+ is_fixed_read_only: true
+}
+
+flag {
name: "remove_text_service"
namespace: "wear_frameworks"
description: "Remove TextServiceManagerService on Wear"
diff --git a/services/tests/PackageManagerServiceTests/server/src/com/android/server/pm/PackageInstallerSessionTest.kt b/services/tests/PackageManagerServiceTests/server/src/com/android/server/pm/PackageInstallerSessionTest.kt
index cbca434a6bb6..1e8935960a3d 100644
--- a/services/tests/PackageManagerServiceTests/server/src/com/android/server/pm/PackageInstallerSessionTest.kt
+++ b/services/tests/PackageManagerServiceTests/server/src/com/android/server/pm/PackageInstallerSessionTest.kt
@@ -21,6 +21,7 @@ import android.content.pm.PackageInstaller.SessionParams
import android.content.pm.PackageInstaller.SessionParams.PERMISSION_STATE_DEFAULT
import android.content.pm.PackageInstaller.SessionParams.PERMISSION_STATE_DENIED
import android.content.pm.PackageInstaller.SessionParams.PERMISSION_STATE_GRANTED
+import android.content.pm.PackageInstaller.VERIFICATION_POLICY_BLOCK_FAIL_CLOSED
import android.content.pm.PackageManager
import android.content.pm.verify.domain.DomainSet
import android.os.Parcel
@@ -33,6 +34,11 @@ import com.android.internal.os.BackgroundThread
import com.android.server.pm.verify.pkg.VerifierController
import com.android.server.testutils.whenever
import com.google.common.truth.Truth.assertThat
+import java.io.File
+import java.io.FileInputStream
+import java.io.FileNotFoundException
+import java.io.FileOutputStream
+import java.io.IOException
import libcore.io.IoUtils
import org.junit.Before
import org.junit.Rule
@@ -46,11 +52,6 @@ import org.mockito.Mockito.mock
import org.mockito.MockitoAnnotations
import org.xmlpull.v1.XmlPullParser
import org.xmlpull.v1.XmlPullParserException
-import java.io.File
-import java.io.FileInputStream
-import java.io.FileNotFoundException
-import java.io.FileOutputStream
-import java.io.IOException
@Presubmit
class PackageInstallerSessionTest {
@@ -197,7 +198,8 @@ class PackageInstallerSessionTest {
/* stagedSessionErrorCode */ PackageManager.INSTALL_FAILED_VERIFICATION_FAILURE,
/* stagedSessionErrorMessage */ "some error",
/* preVerifiedDomains */ DomainSet(setOf("com.foo", "com.bar")),
- /* VerifierController */ mock(VerifierController::class.java)
+ /* VerifierController */ mock(VerifierController::class.java),
+ VERIFICATION_POLICY_BLOCK_FAIL_CLOSED
)
}
@@ -289,6 +291,7 @@ class PackageInstallerSessionTest {
assertThat(expected.installerPackageName).isEqualTo(actual.installerPackageName)
assertThat(expected.isMultiPackage).isEqualTo(actual.isMultiPackage)
assertThat(expected.isStaged).isEqualTo(actual.isStaged)
+ assertThat(expected.forceVerification).isEqualTo(actual.forceVerification)
}
private fun assertEquals(
@@ -339,6 +342,7 @@ class PackageInstallerSessionTest {
assertThat(expected.childSessionIds).asList()
.containsExactlyElementsIn(actual.childSessionIds.toList())
assertThat(expected.preVerifiedDomains).isEqualTo(actual.preVerifiedDomains)
+ assertThat(expected.verificationPolicy).isEqualTo(actual.verificationPolicy)
}
private fun assertInstallSourcesEquivalent(expected: InstallSource, actual: InstallSource) {
diff --git a/services/tests/PackageManagerServiceTests/server/src/com/android/server/pm/verify/pkg/VerificationStatusTrackerTest.java b/services/tests/PackageManagerServiceTests/server/src/com/android/server/pm/verify/pkg/VerificationStatusTrackerTest.java
index fa076db456ec..787fb5a4e524 100644
--- a/services/tests/PackageManagerServiceTests/server/src/com/android/server/pm/verify/pkg/VerificationStatusTrackerTest.java
+++ b/services/tests/PackageManagerServiceTests/server/src/com/android/server/pm/verify/pkg/VerificationStatusTrackerTest.java
@@ -62,7 +62,7 @@ public class VerificationStatusTrackerTest {
.thenReturn(TEST_REQUEST_START_TIME + TEST_TIMEOUT_DURATION_MILLIS)
.thenReturn(TEST_REQUEST_START_TIME + TEST_MAX_TIMEOUT_DURATION_MILLIS - 100)
.thenReturn(TEST_REQUEST_START_TIME + TEST_MAX_TIMEOUT_DURATION_MILLIS);
- mTracker = new VerificationStatusTracker(TEST_PACKAGE_NAME, TEST_TIMEOUT_DURATION_MILLIS,
+ mTracker = new VerificationStatusTracker(TEST_TIMEOUT_DURATION_MILLIS,
TEST_MAX_TIMEOUT_DURATION_MILLIS, mInjector);
}
diff --git a/services/tests/PackageManagerServiceTests/server/src/com/android/server/pm/verify/pkg/VerifierControllerTest.java b/services/tests/PackageManagerServiceTests/server/src/com/android/server/pm/verify/pkg/VerifierControllerTest.java
index be094b0152bc..24617984eaf7 100644
--- a/services/tests/PackageManagerServiceTests/server/src/com/android/server/pm/verify/pkg/VerifierControllerTest.java
+++ b/services/tests/PackageManagerServiceTests/server/src/com/android/server/pm/verify/pkg/VerifierControllerTest.java
@@ -16,6 +16,9 @@
package com.android.server.pm.verify.pkg;
+import static android.content.pm.PackageInstaller.VERIFICATION_POLICY_BLOCK_FAIL_CLOSED;
+import static android.content.pm.PackageInstaller.VERIFICATION_POLICY_BLOCK_FAIL_OPEN;
+
import static com.google.common.truth.Truth.assertThat;
import static org.mockito.ArgumentMatchers.any;
@@ -92,6 +95,9 @@ public class VerifierControllerTest {
private static final long TEST_TIMEOUT_DURATION_MILLIS = TimeUnit.MINUTES.toMillis(1);
private static final long TEST_MAX_TIMEOUT_DURATION_MILLIS =
TimeUnit.MINUTES.toMillis(10);
+ private static final long TEST_VERIFIER_CONNECTION_TIMEOUT_DURATION_MILLIS =
+ TimeUnit.SECONDS.toMillis(10);
+ private static final int TEST_POLICY = VERIFICATION_POLICY_BLOCK_FAIL_CLOSED;
private final ArrayList<SharedLibraryInfo> mTestDeclaredLibraries = new ArrayList<>();
private final PersistableBundle mTestExtensionParams = new PersistableBundle();
@@ -116,7 +122,8 @@ public class VerifierControllerTest {
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
- when(mInjector.isVerifierInstalled(any(Computer.class), anyInt())).thenReturn(true);
+ when(mInjector.getVerifierPackageName(any(Computer.class), anyInt())).thenReturn(
+ TEST_VERIFIER_COMPONENT_NAME.getPackageName());
when(mInjector.getRemoteService(
any(Computer.class), any(Context.class), anyInt(), any(Handler.class)
)).thenReturn(new Pair<>(mMockServiceConnector, TEST_VERIFIER_COMPONENT_NAME));
@@ -124,6 +131,9 @@ public class VerifierControllerTest {
TEST_TIMEOUT_DURATION_MILLIS);
when(mInjector.getMaxVerificationExtendedTimeoutMillis()).thenReturn(
TEST_MAX_TIMEOUT_DURATION_MILLIS);
+ when(mInjector.getVerifierConnectionTimeoutMillis()).thenReturn(
+ TEST_VERIFIER_CONNECTION_TIMEOUT_DURATION_MILLIS
+ );
// Mock time forward as the code continues to check for the current time
when(mInjector.getCurrentTimeMillis())
.thenReturn(TEST_REQUEST_START_TIME)
@@ -150,21 +160,21 @@ public class VerifierControllerTest {
@Test
public void testVerifierNotInstalled() {
- when(mInjector.isVerifierInstalled(any(Computer.class), anyInt())).thenReturn(false);
+ when(mInjector.getVerifierPackageName(any(Computer.class), anyInt())).thenReturn(null);
when(mInjector.getRemoteService(
any(Computer.class), any(Context.class), anyInt(), any(Handler.class)
)).thenReturn(null);
- assertThat(mVerifierController.isVerifierInstalled(mSnapshotSupplier, 0)).isFalse();
+ assertThat(mVerifierController.getVerifierPackageName(mSnapshotSupplier, 0)).isNull();
assertThat(mVerifierController.bindToVerifierServiceIfNeeded(mSnapshotSupplier, 0))
.isFalse();
assertThat(mVerifierController.startVerificationSession(
mSnapshotSupplier, 0, TEST_ID, TEST_PACKAGE_NAME, TEST_PACKAGE_URI,
- TEST_SIGNING_INFO, mTestDeclaredLibraries, mTestExtensionParams, mSessionCallback,
- /* retry= */ false)).isFalse();
+ TEST_SIGNING_INFO, mTestDeclaredLibraries, TEST_POLICY, mTestExtensionParams,
+ mSessionCallback, /* retry= */ false)).isFalse();
assertThat(mVerifierController.startVerificationSession(
mSnapshotSupplier, 0, TEST_ID, TEST_PACKAGE_NAME, TEST_PACKAGE_URI,
- TEST_SIGNING_INFO, mTestDeclaredLibraries, mTestExtensionParams, mSessionCallback,
- /* retry= */ true)).isFalse();
+ TEST_SIGNING_INFO, mTestDeclaredLibraries, TEST_POLICY, mTestExtensionParams,
+ mSessionCallback, /* retry= */ true)).isFalse();
verifyZeroInteractions(mSessionCallback);
}
@@ -176,7 +186,7 @@ public class VerifierControllerTest {
@Test
public void testVerifierAvailableButNotConnected() {
- assertThat(mVerifierController.isVerifierInstalled(mSnapshotSupplier, 0)).isTrue();
+ assertThat(mVerifierController.getVerifierPackageName(mSnapshotSupplier, 0)).isNotNull();
when(mInjector.getRemoteService(
any(Computer.class), any(Context.class), anyInt(), any(Handler.class)
)).thenReturn(null);
@@ -200,24 +210,24 @@ public class VerifierControllerTest {
ServiceConnector.ServiceLifecycleCallbacks<IVerifierService> callbacks = captor.getValue();
assertThat(mVerifierController.startVerificationSession(
mSnapshotSupplier, 0, TEST_ID, TEST_PACKAGE_NAME, TEST_PACKAGE_URI,
- TEST_SIGNING_INFO, mTestDeclaredLibraries, mTestExtensionParams, mSessionCallback,
- /* retry= */ false)).isTrue();
+ TEST_SIGNING_INFO, mTestDeclaredLibraries, TEST_POLICY, mTestExtensionParams,
+ mSessionCallback, /* retry= */ false)).isTrue();
verify(mMockService, times(1)).onVerificationRequired(any(VerificationSession.class));
callbacks.onBinderDied();
// Test that nothing crashes if the service connection is lost
- assertThat(mVerifierController.isVerifierInstalled(mSnapshotSupplier, 0)).isTrue();
+ assertThat(mVerifierController.getVerifierPackageName(mSnapshotSupplier, 0)).isNotNull();
mVerifierController.notifyPackageNameAvailable(TEST_PACKAGE_NAME);
mVerifierController.notifyVerificationCancelled(TEST_PACKAGE_NAME);
mVerifierController.notifyVerificationTimeout(TEST_ID);
verifyNoMoreInteractions(mMockService);
assertThat(mVerifierController.startVerificationSession(
mSnapshotSupplier, 0, TEST_ID, TEST_PACKAGE_NAME, TEST_PACKAGE_URI,
- TEST_SIGNING_INFO, mTestDeclaredLibraries, mTestExtensionParams, mSessionCallback,
- /* retry= */ false)).isTrue();
+ TEST_SIGNING_INFO, mTestDeclaredLibraries, TEST_POLICY, mTestExtensionParams,
+ mSessionCallback, /* retry= */ false)).isTrue();
assertThat(mVerifierController.startVerificationSession(
mSnapshotSupplier, 0, TEST_ID, TEST_PACKAGE_NAME, TEST_PACKAGE_URI,
- TEST_SIGNING_INFO, mTestDeclaredLibraries, mTestExtensionParams, mSessionCallback,
- /* retry= */ true)).isTrue();
+ TEST_SIGNING_INFO, mTestDeclaredLibraries, TEST_POLICY, mTestExtensionParams,
+ mSessionCallback, /* retry= */ true)).isTrue();
mVerifierController.notifyVerificationTimeout(TEST_ID);
verify(mMockService, times(1)).onVerificationTimeout(eq(TEST_ID));
}
@@ -226,8 +236,8 @@ public class VerifierControllerTest {
public void testNotifyPackageNameAvailable() throws Exception {
assertThat(mVerifierController.startVerificationSession(
mSnapshotSupplier, 0, TEST_ID, TEST_PACKAGE_NAME, TEST_PACKAGE_URI,
- TEST_SIGNING_INFO, mTestDeclaredLibraries, mTestExtensionParams, mSessionCallback,
- /* retry= */ false)).isTrue();
+ TEST_SIGNING_INFO, mTestDeclaredLibraries, TEST_POLICY, mTestExtensionParams,
+ mSessionCallback, /* retry= */ false)).isTrue();
mVerifierController.notifyPackageNameAvailable(TEST_PACKAGE_NAME);
verify(mMockService).onPackageNameAvailable(eq(TEST_PACKAGE_NAME));
}
@@ -236,8 +246,8 @@ public class VerifierControllerTest {
public void testNotifyVerificationCancelled() throws Exception {
assertThat(mVerifierController.startVerificationSession(
mSnapshotSupplier, 0, TEST_ID, TEST_PACKAGE_NAME, TEST_PACKAGE_URI,
- TEST_SIGNING_INFO, mTestDeclaredLibraries, mTestExtensionParams, mSessionCallback,
- /* retry= */ false)).isTrue();
+ TEST_SIGNING_INFO, mTestDeclaredLibraries, TEST_POLICY, mTestExtensionParams,
+ mSessionCallback, /* retry= */ false)).isTrue();
mVerifierController.notifyVerificationCancelled(TEST_PACKAGE_NAME);
verify(mMockService).onVerificationCancelled(eq(TEST_PACKAGE_NAME));
}
@@ -248,8 +258,8 @@ public class VerifierControllerTest {
ArgumentCaptor.forClass(VerificationSession.class);
assertThat(mVerifierController.startVerificationSession(
mSnapshotSupplier, 0, TEST_ID, TEST_PACKAGE_NAME, TEST_PACKAGE_URI,
- TEST_SIGNING_INFO, mTestDeclaredLibraries, mTestExtensionParams, mSessionCallback,
- /* retry= */ false)).isTrue();
+ TEST_SIGNING_INFO, mTestDeclaredLibraries, TEST_POLICY, mTestExtensionParams,
+ mSessionCallback, /* retry= */ false)).isTrue();
verify(mMockService).onVerificationRequired(captor.capture());
VerificationSession session = captor.getValue();
assertThat(session.getId()).isEqualTo(TEST_ID);
@@ -276,8 +286,8 @@ public class VerifierControllerTest {
ArgumentCaptor.forClass(VerificationSession.class);
assertThat(mVerifierController.startVerificationSession(
mSnapshotSupplier, 0, TEST_ID, TEST_PACKAGE_NAME, TEST_PACKAGE_URI,
- TEST_SIGNING_INFO, mTestDeclaredLibraries, mTestExtensionParams, mSessionCallback,
- /* retry= */ true)).isTrue();
+ TEST_SIGNING_INFO, mTestDeclaredLibraries, TEST_POLICY, mTestExtensionParams,
+ mSessionCallback, /* retry= */ true)).isTrue();
verify(mMockService).onVerificationRetry(captor.capture());
VerificationSession session = captor.getValue();
assertThat(session.getId()).isEqualTo(TEST_ID);
@@ -302,8 +312,8 @@ public class VerifierControllerTest {
public void testNotifyVerificationTimeout() throws Exception {
assertThat(mVerifierController.startVerificationSession(
mSnapshotSupplier, 0, TEST_ID, TEST_PACKAGE_NAME, TEST_PACKAGE_URI,
- TEST_SIGNING_INFO, mTestDeclaredLibraries, mTestExtensionParams, mSessionCallback,
- /* retry= */ true)).isTrue();
+ TEST_SIGNING_INFO, mTestDeclaredLibraries, TEST_POLICY, mTestExtensionParams,
+ mSessionCallback, /* retry= */ true)).isTrue();
mVerifierController.notifyVerificationTimeout(TEST_ID);
verify(mMockService).onVerificationTimeout(eq(TEST_ID));
}
@@ -320,8 +330,8 @@ public class VerifierControllerTest {
ArgumentCaptor<Message> messageCaptor = ArgumentCaptor.forClass(Message.class);
assertThat(mVerifierController.startVerificationSession(
mSnapshotSupplier, 0, TEST_ID, TEST_PACKAGE_NAME, TEST_PACKAGE_URI,
- TEST_SIGNING_INFO, mTestDeclaredLibraries, mTestExtensionParams, mSessionCallback,
- /* retry= */ false)).isTrue();
+ TEST_SIGNING_INFO, mTestDeclaredLibraries, TEST_POLICY, mTestExtensionParams,
+ mSessionCallback, /* retry= */ false)).isTrue();
verify(mHandler, times(1)).sendMessageAtTime(any(Message.class), anyLong());
verify(mSessionCallback, times(1)).onTimeout();
verify(mInjector, times(2)).getCurrentTimeMillis();
@@ -339,8 +349,8 @@ public class VerifierControllerTest {
.thenAnswer(i -> true);
assertThat(mVerifierController.startVerificationSession(
mSnapshotSupplier, 0, TEST_ID, TEST_PACKAGE_NAME, TEST_PACKAGE_URI,
- TEST_SIGNING_INFO, mTestDeclaredLibraries, mTestExtensionParams, mSessionCallback,
- /* retry= */ false)).isTrue();
+ TEST_SIGNING_INFO, mTestDeclaredLibraries, TEST_POLICY, mTestExtensionParams,
+ mSessionCallback, /* retry= */ false)).isTrue();
verify(mHandler, times(1)).sendMessageAtTime(any(Message.class), anyLong());
verify(mSessionCallback, times(1)).onTimeout();
verify(mInjector, times(2)).getCurrentTimeMillis();
@@ -350,8 +360,8 @@ public class VerifierControllerTest {
ArgumentCaptor.forClass(VerificationSession.class);
assertThat(mVerifierController.startVerificationSession(
mSnapshotSupplier, 0, TEST_ID, TEST_PACKAGE_NAME, TEST_PACKAGE_URI,
- TEST_SIGNING_INFO, mTestDeclaredLibraries, mTestExtensionParams, mSessionCallback,
- /* retry= */ true)).isTrue();
+ TEST_SIGNING_INFO, mTestDeclaredLibraries, TEST_POLICY, mTestExtensionParams,
+ mSessionCallback, /* retry= */ true)).isTrue();
verify(mMockService).onVerificationRetry(captor.capture());
VerificationSession session = captor.getValue();
VerificationStatus status = new VerificationStatus.Builder().setVerified(true).build();
@@ -367,8 +377,8 @@ public class VerifierControllerTest {
ArgumentCaptor.forClass(VerificationSession.class);
assertThat(mVerifierController.startVerificationSession(
mSnapshotSupplier, 0, TEST_ID, TEST_PACKAGE_NAME, TEST_PACKAGE_URI,
- TEST_SIGNING_INFO, mTestDeclaredLibraries, mTestExtensionParams, mSessionCallback,
- /* retry= */ false)).isTrue();
+ TEST_SIGNING_INFO, mTestDeclaredLibraries, TEST_POLICY, mTestExtensionParams,
+ mSessionCallback, /* retry= */ false)).isTrue();
verify(mMockService).onVerificationRequired(captor.capture());
VerificationSession session = captor.getValue();
session.reportVerificationIncomplete(VerificationSession.VERIFICATION_INCOMPLETE_UNKNOWN);
@@ -383,8 +393,8 @@ public class VerifierControllerTest {
ArgumentCaptor.forClass(VerificationSession.class);
assertThat(mVerifierController.startVerificationSession(
mSnapshotSupplier, 0, TEST_ID, TEST_PACKAGE_NAME, TEST_PACKAGE_URI,
- TEST_SIGNING_INFO, mTestDeclaredLibraries, mTestExtensionParams, mSessionCallback,
- /* retry= */ false)).isTrue();
+ TEST_SIGNING_INFO, mTestDeclaredLibraries, TEST_POLICY, mTestExtensionParams,
+ mSessionCallback, /* retry= */ false)).isTrue();
verify(mMockService).onVerificationRequired(captor.capture());
VerificationSession session = captor.getValue();
VerificationStatus status = new VerificationStatus.Builder().setVerified(true).build();
@@ -401,8 +411,8 @@ public class VerifierControllerTest {
ArgumentCaptor.forClass(VerificationSession.class);
assertThat(mVerifierController.startVerificationSession(
mSnapshotSupplier, 0, TEST_ID, TEST_PACKAGE_NAME, TEST_PACKAGE_URI,
- TEST_SIGNING_INFO, mTestDeclaredLibraries, mTestExtensionParams, mSessionCallback,
- /* retry= */ false)).isTrue();
+ TEST_SIGNING_INFO, mTestDeclaredLibraries, TEST_POLICY, mTestExtensionParams,
+ mSessionCallback, /* retry= */ false)).isTrue();
verify(mMockService).onVerificationRequired(captor.capture());
VerificationSession session = captor.getValue();
VerificationStatus status = new VerificationStatus.Builder()
@@ -421,8 +431,8 @@ public class VerifierControllerTest {
ArgumentCaptor.forClass(VerificationSession.class);
assertThat(mVerifierController.startVerificationSession(
mSnapshotSupplier, 0, TEST_ID, TEST_PACKAGE_NAME, TEST_PACKAGE_URI,
- TEST_SIGNING_INFO, mTestDeclaredLibraries, mTestExtensionParams, mSessionCallback,
- /* retry= */ false)).isTrue();
+ TEST_SIGNING_INFO, mTestDeclaredLibraries, TEST_POLICY, mTestExtensionParams,
+ mSessionCallback, /* retry= */ false)).isTrue();
verify(mMockService).onVerificationRequired(captor.capture());
VerificationSession session = captor.getValue();
VerificationStatus status = new VerificationStatus.Builder().setVerified(true).build();
@@ -439,8 +449,8 @@ public class VerifierControllerTest {
ArgumentCaptor.forClass(VerificationSession.class);
mVerifierController.startVerificationSession(
mSnapshotSupplier, 0, TEST_ID, TEST_PACKAGE_NAME, TEST_PACKAGE_URI,
- TEST_SIGNING_INFO, mTestDeclaredLibraries, mTestExtensionParams, mSessionCallback,
- /* retry= */ false);
+ TEST_SIGNING_INFO, mTestDeclaredLibraries, TEST_POLICY, mTestExtensionParams,
+ mSessionCallback, /* retry= */ false);
verify(mMockService).onVerificationRequired(captor.capture());
VerificationSession session = captor.getValue();
final long initialTimeoutTime = TEST_REQUEST_START_TIME + TEST_TIMEOUT_DURATION_MILLIS;
@@ -456,8 +466,8 @@ public class VerifierControllerTest {
ArgumentCaptor.forClass(VerificationSession.class);
mVerifierController.startVerificationSession(
mSnapshotSupplier, 0, TEST_ID, TEST_PACKAGE_NAME, TEST_PACKAGE_URI,
- TEST_SIGNING_INFO, mTestDeclaredLibraries, mTestExtensionParams, mSessionCallback,
- /* retry= */ false);
+ TEST_SIGNING_INFO, mTestDeclaredLibraries, TEST_POLICY, mTestExtensionParams,
+ mSessionCallback, /* retry= */ false);
verify(mMockService).onVerificationRequired(captor.capture());
VerificationSession session = captor.getValue();
final long initialTimeoutTime = TEST_REQUEST_START_TIME + TEST_TIMEOUT_DURATION_MILLIS;
@@ -493,10 +503,27 @@ public class VerifierControllerTest {
.thenReturn(TEST_REQUEST_START_TIME + TEST_TIMEOUT_DURATION_MILLIS + 1);
mVerifierController.startVerificationSession(
mSnapshotSupplier, 0, TEST_ID, TEST_PACKAGE_NAME, TEST_PACKAGE_URI,
- TEST_SIGNING_INFO, mTestDeclaredLibraries, mTestExtensionParams, mSessionCallback,
- /* retry= */ false);
+ TEST_SIGNING_INFO, mTestDeclaredLibraries, TEST_POLICY, mTestExtensionParams,
+ mSessionCallback, /* retry= */ false);
verify(mHandler, times(3)).sendMessageAtTime(any(Message.class), anyLong());
verify(mInjector, times(6)).getCurrentTimeMillis();
verify(mSessionCallback, times(1)).onTimeout();
}
+
+ @Test
+ public void testPolicyOverride() throws Exception {
+ ArgumentCaptor<VerificationSession> captor =
+ ArgumentCaptor.forClass(VerificationSession.class);
+ mVerifierController.startVerificationSession(
+ mSnapshotSupplier, 0, TEST_ID, TEST_PACKAGE_NAME, TEST_PACKAGE_URI,
+ TEST_SIGNING_INFO, mTestDeclaredLibraries, TEST_POLICY, mTestExtensionParams,
+ mSessionCallback, /* retry= */ false);
+ verify(mMockService).onVerificationRequired(captor.capture());
+ VerificationSession session = captor.getValue();
+ final int policy = VERIFICATION_POLICY_BLOCK_FAIL_OPEN;
+ when(mSessionCallback.setVerificationPolicy(eq(policy))).thenReturn(true);
+ assertThat(session.setVerificationPolicy(policy)).isTrue();
+ assertThat(session.getVerificationPolicy()).isEqualTo(policy);
+ verify(mSessionCallback, times(1)).setVerificationPolicy(eq(policy));
+ }
}
diff --git a/services/tests/mockingservicestests/src/com/android/server/alarm/OWNERS b/services/tests/mockingservicestests/src/com/android/server/alarm/OWNERS
index 6f207fb1a00e..6eb986b2b86b 100644
--- a/services/tests/mockingservicestests/src/com/android/server/alarm/OWNERS
+++ b/services/tests/mockingservicestests/src/com/android/server/alarm/OWNERS
@@ -1 +1 @@
-include /apex/jobscheduler/OWNERS
+include /apex/jobscheduler/ALARM_OWNERS
diff --git a/services/tests/mockingservicestests/src/com/android/server/am/MockingOomAdjusterTests.java b/services/tests/mockingservicestests/src/com/android/server/am/MockingOomAdjusterTests.java
index 7dbd0578df0d..250c2f93e70e 100644
--- a/services/tests/mockingservicestests/src/com/android/server/am/MockingOomAdjusterTests.java
+++ b/services/tests/mockingservicestests/src/com/android/server/am/MockingOomAdjusterTests.java
@@ -168,7 +168,7 @@ public class MockingOomAdjusterTests {
+ ProcessList.CACHED_APP_IMPORTANCE_LEVELS;
private static int sFirstUiCachedAdj = ProcessList.CACHED_APP_MIN_ADJ + 10;
private static int sFirstNonUiCachedAdj = ProcessList.CACHED_APP_MIN_ADJ + 20;
- private static int sUiTierSize = 5;
+ private static int sUiTierSize = 10;
private Context mContext;
private ProcessStateController mProcessStateController;
diff --git a/services/tests/mockingservicestests/src/com/android/server/job/OWNERS b/services/tests/mockingservicestests/src/com/android/server/job/OWNERS
index 6f207fb1a00e..c8345f71b39a 100644
--- a/services/tests/mockingservicestests/src/com/android/server/job/OWNERS
+++ b/services/tests/mockingservicestests/src/com/android/server/job/OWNERS
@@ -1 +1 @@
-include /apex/jobscheduler/OWNERS
+include /apex/jobscheduler/JOB_OWNERS
diff --git a/services/tests/mockingservicestests/src/com/android/server/pm/DistractingPackageHelperTest.kt b/services/tests/mockingservicestests/src/com/android/server/pm/DistractingPackageHelperTest.kt
index e131a98b52d0..de029e0d770f 100644
--- a/services/tests/mockingservicestests/src/com/android/server/pm/DistractingPackageHelperTest.kt
+++ b/services/tests/mockingservicestests/src/com/android/server/pm/DistractingPackageHelperTest.kt
@@ -185,7 +185,8 @@ class DistractingPackageHelperTest : PackageHelperTestBase() {
verify(pms, never()).scheduleWritePackageRestrictions(eq(TEST_USER_ID))
verify(broadcastHelper, never()).sendPackageBroadcast(eq(
Intent.ACTION_DISTRACTING_PACKAGES_CHANGED), nullable(), nullable(), anyInt(),
- nullable(), nullable(), any(), nullable(), nullable(), nullable(), nullable())
+ nullable(), nullable(), any(), nullable(), nullable(), nullable(), nullable(),
+ nullable())
distractingPackageHelper.removeDistractingPackageRestrictions(pms.snapshotComputer(),
arrayOfNulls(0), TEST_USER_ID)
diff --git a/services/tests/mockingservicestests/src/com/android/server/pm/StagingManagerTest.java b/services/tests/mockingservicestests/src/com/android/server/pm/StagingManagerTest.java
index 43a8aa957fa5..124c41ed449f 100644
--- a/services/tests/mockingservicestests/src/com/android/server/pm/StagingManagerTest.java
+++ b/services/tests/mockingservicestests/src/com/android/server/pm/StagingManagerTest.java
@@ -741,7 +741,8 @@ public class StagingManagerTest {
/* stagedSessionErrorCode */ PackageManager.INSTALL_UNKNOWN,
/* stagedSessionErrorMessage */ "no error",
/* preVerifiedDomains */ null,
- /* verifierController */ null);
+ /* verifierController */ null,
+ /* verificationPolicy */ PackageInstaller.VERIFICATION_POLICY_BLOCK_FAIL_CLOSED);
StagingManager.StagedSession stagedSession = spy(session.mStagedSession);
doReturn(packageName).when(stagedSession).getPackageName();
diff --git a/services/tests/powerstatstests/Android.bp b/services/tests/powerstatstests/Android.bp
index d9e071f43e1b..d6ca10a23fb9 100644
--- a/services/tests/powerstatstests/Android.bp
+++ b/services/tests/powerstatstests/Android.bp
@@ -27,9 +27,6 @@ android_test {
"servicestests-utils",
"platform-test-annotations",
"flag-junit",
- "statsdprotolite",
- "StatsdTestUtils",
- "platformprotoslite",
],
libs: [
@@ -77,10 +74,6 @@ android_ravenwood_test {
"src/com/android/server/power/stats/format/*.java",
"src/com/android/server/power/stats/processor/*.java",
],
- // TODO(b/372292543): Enable this test.
- exclude_srcs: [
- "src/com/android/server/power/stats/WakelockStatsFrameworkEventsTest.java",
- ],
java_resources: [
"res/xml/power_profile*.xml",
],
diff --git a/services/tests/powerstatstests/src/com/android/server/power/stats/BatteryExternalStatsWorkerTest.java b/services/tests/powerstatstests/src/com/android/server/power/stats/BatteryExternalStatsWorkerTest.java
index 7b635d4198c3..d7b60cffa623 100644
--- a/services/tests/powerstatstests/src/com/android/server/power/stats/BatteryExternalStatsWorkerTest.java
+++ b/services/tests/powerstatstests/src/com/android/server/power/stats/BatteryExternalStatsWorkerTest.java
@@ -39,7 +39,7 @@ import android.hardware.power.stats.StateResidencyResult;
import android.os.Handler;
import android.os.Looper;
import android.os.connectivity.WifiActivityEnergyInfo;
-import android.platform.test.ravenwood.RavenwoodRule;
+import android.platform.test.ravenwood.RavenwoodConfig;
import android.power.PowerStatsInternal;
import android.util.IntArray;
import android.util.SparseArray;
@@ -52,7 +52,6 @@ import com.android.internal.os.MonotonicClock;
import com.android.internal.os.PowerProfile;
import org.junit.Before;
-import org.junit.Rule;
import org.junit.Test;
import java.util.Arrays;
@@ -67,25 +66,27 @@ import java.util.concurrent.CompletableFuture;
@SuppressWarnings("GuardedBy")
@android.platform.test.annotations.DisabledOnRavenwood
public class BatteryExternalStatsWorkerTest {
- @Rule
- public final RavenwoodRule mRavenwood = new RavenwoodRule();
+ @RavenwoodConfig.Config
+ public final RavenwoodConfig mRavenwood = new RavenwoodConfig.Builder().build();
private BatteryExternalStatsWorker mBatteryExternalStatsWorker;
private TestPowerStatsInternal mPowerStatsInternal;
+ private Handler mHandler;
@Before
public void setUp() {
final Context context = InstrumentationRegistry.getContext();
+ mHandler = new Handler(Looper.getMainLooper());
BatteryStatsImpl batteryStats = new BatteryStatsImpl(
new BatteryStatsImpl.BatteryStatsConfig.Builder().build(), Clock.SYSTEM_CLOCK,
new MonotonicClock(0, Clock.SYSTEM_CLOCK), null,
- new Handler(Looper.getMainLooper()), null, null, null,
+ mHandler, null, null, null,
new PowerProfile(context, true /* forTest */), buildScalingPolicies(),
new PowerStatsUidResolver());
mPowerStatsInternal = new TestPowerStatsInternal();
mBatteryExternalStatsWorker =
- new BatteryExternalStatsWorker(new TestInjector(context), batteryStats);
+ new BatteryExternalStatsWorker(new TestInjector(context), batteryStats, mHandler);
}
@Test
diff --git a/services/tests/powerstatstests/src/com/android/server/power/stats/BatteryStatsHistoryIteratorTest.java b/services/tests/powerstatstests/src/com/android/server/power/stats/BatteryStatsHistoryIteratorTest.java
index d36b55345418..d6f50368df84 100644
--- a/services/tests/powerstatstests/src/com/android/server/power/stats/BatteryStatsHistoryIteratorTest.java
+++ b/services/tests/powerstatstests/src/com/android/server/power/stats/BatteryStatsHistoryIteratorTest.java
@@ -38,7 +38,6 @@ import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Random;
-import java.util.concurrent.Future;
@RunWith(AndroidJUnit4.class)
@SmallTest
@@ -324,9 +323,8 @@ public class BatteryStatsHistoryIteratorTest {
private boolean mSyncScheduled;
@Override
- public Future<?> scheduleCpuSyncDueToWakelockChange(long delayMillis) {
+ public void scheduleCpuSyncDueToWakelockChange(long delayMillis) {
mSyncScheduled = true;
- return null;
}
public boolean isSyncScheduled() {
diff --git a/services/tests/powerstatstests/src/com/android/server/power/stats/BatteryStatsHistoryTest.java b/services/tests/powerstatstests/src/com/android/server/power/stats/BatteryStatsHistoryTest.java
index e40a3e314e58..b67ec8b2c828 100644
--- a/services/tests/powerstatstests/src/com/android/server/power/stats/BatteryStatsHistoryTest.java
+++ b/services/tests/powerstatstests/src/com/android/server/power/stats/BatteryStatsHistoryTest.java
@@ -653,6 +653,44 @@ public class BatteryStatsHistoryTest {
}
@Test
+ public void getMonotonicHistorySize() {
+ long lastHistorySize = mHistory.getMonotonicHistorySize();
+ mHistory.forceRecordAllHistory();
+
+ mClock.realtime = 1000;
+ mClock.uptime = 1000;
+ mHistory.recordEvent(mClock.realtime, mClock.uptime,
+ BatteryStats.HistoryItem.EVENT_JOB_START, "job", 42);
+ long size = mHistory.getMonotonicHistorySize();
+ assertThat(size).isGreaterThan(lastHistorySize);
+ lastHistorySize = size;
+
+ mHistory.startNextFile(mClock.realtime);
+
+ size = mHistory.getMonotonicHistorySize();
+ assertThat(size).isEqualTo(lastHistorySize);
+
+ mClock.realtime = 2000;
+ mClock.uptime = 2000;
+ mHistory.recordEvent(mClock.realtime, mClock.uptime,
+ BatteryStats.HistoryItem.EVENT_JOB_FINISH, "job", 42);
+
+ size = mHistory.getMonotonicHistorySize();
+ assertThat(size).isGreaterThan(lastHistorySize);
+ lastHistorySize = size;
+
+ mHistory.startNextFile(mClock.realtime);
+
+ mClock.realtime = 3000;
+ mClock.uptime = 3000;
+ mHistory.recordEvent(mClock.realtime, mClock.uptime,
+ HistoryItem.EVENT_ALARM, "alarm", 42);
+
+ size = mHistory.getMonotonicHistorySize();
+ assertThat(size).isGreaterThan(lastHistorySize);
+ }
+
+ @Test
public void testVarintParceler() {
long[] values = {
0,
diff --git a/services/tests/powerstatstests/src/com/android/server/power/stats/BatteryStatsImplTest.java b/services/tests/powerstatstests/src/com/android/server/power/stats/BatteryStatsImplTest.java
index 2408cc1d0b3d..177f30a79ebc 100644
--- a/services/tests/powerstatstests/src/com/android/server/power/stats/BatteryStatsImplTest.java
+++ b/services/tests/powerstatstests/src/com/android/server/power/stats/BatteryStatsImplTest.java
@@ -159,7 +159,7 @@ public class BatteryStatsImplTest {
}
mPowerStatsStore = new PowerStatsStore(systemDir, mHandler);
mBatteryUsageStatsProvider = new BatteryUsageStatsProvider(context, mPowerAttributor,
- mPowerProfile, mBatteryStatsImpl.getCpuScalingPolicies(), mPowerStatsStore,
+ mPowerProfile, mBatteryStatsImpl.getCpuScalingPolicies(), mPowerStatsStore, 0,
mMockClock);
}
diff --git a/services/tests/powerstatstests/src/com/android/server/power/stats/BatteryStatsUserLifecycleTests.java b/services/tests/powerstatstests/src/com/android/server/power/stats/BatteryStatsUserLifecycleTests.java
index 3931201aaf03..5912a9959e02 100644
--- a/services/tests/powerstatstests/src/com/android/server/power/stats/BatteryStatsUserLifecycleTests.java
+++ b/services/tests/powerstatstests/src/com/android/server/power/stats/BatteryStatsUserLifecycleTests.java
@@ -134,7 +134,7 @@ public class BatteryStatsUserLifecycleTests {
private int getNumberOfUidsInBatteryStats() throws Exception {
ArraySet<Integer> uids = new ArraySet<>();
- final String dumpsys = executeShellCommand("dumpsys batterystats --checkin");
+ final String dumpsys = executeShellCommand("dumpsys batterystats -c");
for (String line : dumpsys.split("\n")) {
final String[] parts = line.trim().split(",");
if (parts.length < 5 ||
diff --git a/services/tests/powerstatstests/src/com/android/server/power/stats/BatteryUsageStatsProviderTest.java b/services/tests/powerstatstests/src/com/android/server/power/stats/BatteryUsageStatsProviderTest.java
index b30224b8327b..e9d95fcbccea 100644
--- a/services/tests/powerstatstests/src/com/android/server/power/stats/BatteryUsageStatsProviderTest.java
+++ b/services/tests/powerstatstests/src/com/android/server/power/stats/BatteryUsageStatsProviderTest.java
@@ -22,6 +22,7 @@ import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyLong;
import static org.mockito.Mockito.doAnswer;
import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
@@ -119,7 +120,7 @@ public class BatteryUsageStatsProviderTest {
.isWithin(PRECISION).of(0.4);
assertThat(batteryUsageStats.getStatsStartTimestamp()).isEqualTo(12345);
- assertThat(batteryUsageStats.getStatsEndTimestamp()).isEqualTo(54321);
+ assertThat(batteryUsageStats.getStatsEndTimestamp()).isEqualTo(180 * MINUTE_IN_MS);
}
@Test
@@ -142,7 +143,7 @@ public class BatteryUsageStatsProviderTest {
BatteryUsageStatsProvider provider = new BatteryUsageStatsProvider(mContext,
mock(PowerAttributor.class), mStatsRule.getPowerProfile(),
- mStatsRule.getCpuScalingPolicies(), mock(PowerStatsStore.class), mMockClock);
+ mStatsRule.getCpuScalingPolicies(), mock(PowerStatsStore.class), 0, mMockClock);
final BatteryUsageStats batteryUsageStats =
provider.getBatteryUsageStats(batteryStats,
@@ -249,7 +250,8 @@ public class BatteryUsageStatsProviderTest {
}
}
- mStatsRule.setCurrentTime(54321);
+ setTime(180 * MINUTE_IN_MS);
+
return batteryStats;
}
@@ -266,7 +268,7 @@ public class BatteryUsageStatsProviderTest {
BatteryUsageStatsProvider provider = new BatteryUsageStatsProvider(mContext,
powerAttributor, mStatsRule.getPowerProfile(),
- mStatsRule.getCpuScalingPolicies(), mock(PowerStatsStore.class), mMockClock);
+ mStatsRule.getCpuScalingPolicies(), mock(PowerStatsStore.class), 0, mMockClock);
return provider.getBatteryUsageStats(batteryStats, BatteryUsageStatsQuery.DEFAULT);
}
@@ -296,7 +298,7 @@ public class BatteryUsageStatsProviderTest {
BatteryUsageStatsProvider provider = new BatteryUsageStatsProvider(mContext,
mock(PowerAttributor.class), mStatsRule.getPowerProfile(),
- mStatsRule.getCpuScalingPolicies(), mock(PowerStatsStore.class), mMockClock);
+ mStatsRule.getCpuScalingPolicies(), mock(PowerStatsStore.class), 0, mMockClock);
final BatteryUsageStats batteryUsageStats =
provider.getBatteryUsageStats(batteryStats,
@@ -385,7 +387,7 @@ public class BatteryUsageStatsProviderTest {
BatteryUsageStatsProvider provider = new BatteryUsageStatsProvider(mContext,
mock(PowerAttributor.class), mStatsRule.getPowerProfile(),
- mStatsRule.getCpuScalingPolicies(), mock(PowerStatsStore.class), mMockClock);
+ mStatsRule.getCpuScalingPolicies(), mock(PowerStatsStore.class), 0, mMockClock);
final BatteryUsageStats batteryUsageStats =
provider.getBatteryUsageStats(batteryStats,
@@ -474,7 +476,7 @@ public class BatteryUsageStatsProviderTest {
BatteryUsageStatsProvider provider = new BatteryUsageStatsProvider(mContext,
mock(PowerAttributor.class), mStatsRule.getPowerProfile(),
- mStatsRule.getCpuScalingPolicies(), powerStatsStore, mMockClock);
+ mStatsRule.getCpuScalingPolicies(), powerStatsStore, 0, mMockClock);
batteryStats.saveBatteryUsageStatsOnReset(provider, powerStatsStore,
/* accumulateBatteryUsageStats */ false);
@@ -564,8 +566,19 @@ public class BatteryUsageStatsProviderTest {
}
@Test
- public void accumulateBatteryUsageStats() {
+ public void accumulateBatteryUsageStats() throws Throwable {
+ accumulateBatteryUsageStats(10000000, 1);
+ // Accumulate every 200 bytes of battery history
+ accumulateBatteryUsageStats(200, 2);
+ accumulateBatteryUsageStats(50, 5);
+ // Accumulate on every invocation of accumulateBatteryUsageStats
+ accumulateBatteryUsageStats(0, 7);
+ }
+
+ private void accumulateBatteryUsageStats(int accumulatedBatteryUsageStatsSpanSize,
+ int expectedNumberOfUpdates) throws Throwable {
BatteryStatsImpl batteryStats = mStatsRule.getBatteryStats();
+ batteryStats.forceRecordAllHistory();
setTime(5 * MINUTE_IN_MS);
@@ -574,69 +587,86 @@ public class BatteryUsageStatsProviderTest {
batteryStats.resetAllStatsAndHistoryLocked(BatteryStatsImpl.RESET_REASON_ADB_COMMAND);
}
- PowerStatsStore powerStatsStore = new PowerStatsStore(
+ PowerStatsStore powerStatsStore = spy(new PowerStatsStore(
new File(mStatsRule.getHistoryDir(), getClass().getSimpleName()),
- mStatsRule.getHandler());
+ mStatsRule.getHandler()));
powerStatsStore.reset();
+ int[] count = new int[1];
+ doAnswer(inv -> {
+ count[0]++;
+ return null;
+ }).when(powerStatsStore).storePowerStatsSpan(any(PowerStatsSpan.class));
+
+ MultiStatePowerAttributor powerAttributor = new MultiStatePowerAttributor(mContext,
+ powerStatsStore, mStatsRule.getPowerProfile(), mStatsRule.getCpuScalingPolicies(),
+ () -> 3500, new PowerStatsUidResolver());
+ for (int powerComponentId = 0; powerComponentId < BatteryConsumer.POWER_COMPONENT_COUNT;
+ powerComponentId++) {
+ powerAttributor.setPowerComponentSupported(powerComponentId, true);
+ }
+ powerAttributor.setPowerComponentSupported(BatteryConsumer.POWER_COMPONENT_ANY, true);
+
BatteryUsageStatsProvider provider = new BatteryUsageStatsProvider(mContext,
- mock(PowerAttributor.class), mStatsRule.getPowerProfile(),
- mStatsRule.getCpuScalingPolicies(), powerStatsStore, mMockClock);
+ powerAttributor, mStatsRule.getPowerProfile(),
+ mStatsRule.getCpuScalingPolicies(), powerStatsStore,
+ accumulatedBatteryUsageStatsSpanSize, mMockClock);
- batteryStats.saveBatteryUsageStatsOnReset(provider, powerStatsStore,
- /* accumulateBatteryUsageStats */ true);
+ provider.accumulateBatteryUsageStatsAsync(batteryStats, mStatsRule.getHandler());
synchronized (batteryStats) {
batteryStats.noteFlashlightOnLocked(APP_UID,
10 * MINUTE_IN_MS, 10 * MINUTE_IN_MS);
}
+
+ provider.accumulateBatteryUsageStatsAsync(batteryStats, mStatsRule.getHandler());
+
synchronized (batteryStats) {
batteryStats.noteFlashlightOffLocked(APP_UID,
20 * MINUTE_IN_MS, 20 * MINUTE_IN_MS);
}
- synchronized (batteryStats) {
- batteryStats.resetAllStatsAndHistoryLocked(BatteryStatsImpl.RESET_REASON_ADB_COMMAND);
- }
+ provider.accumulateBatteryUsageStatsAsync(batteryStats, mStatsRule.getHandler());
synchronized (batteryStats) {
batteryStats.noteFlashlightOnLocked(APP_UID,
30 * MINUTE_IN_MS, 30 * MINUTE_IN_MS);
}
+
+ provider.accumulateBatteryUsageStatsAsync(batteryStats, mStatsRule.getHandler());
+
synchronized (batteryStats) {
batteryStats.noteFlashlightOffLocked(APP_UID,
50 * MINUTE_IN_MS, 50 * MINUTE_IN_MS);
}
setTime(55 * MINUTE_IN_MS);
- synchronized (batteryStats) {
- batteryStats.resetAllStatsAndHistoryLocked(BatteryStatsImpl.RESET_REASON_ADB_COMMAND);
- }
+
+ provider.accumulateBatteryUsageStatsAsync(batteryStats, mStatsRule.getHandler());
// This section has not been saved yet, but should be added to the accumulated totals
synchronized (batteryStats) {
batteryStats.noteFlashlightOnLocked(APP_UID,
80 * MINUTE_IN_MS, 80 * MINUTE_IN_MS);
}
+
+ provider.accumulateBatteryUsageStatsAsync(batteryStats, mStatsRule.getHandler());
+
synchronized (batteryStats) {
batteryStats.noteFlashlightOffLocked(APP_UID,
110 * MINUTE_IN_MS, 110 * MINUTE_IN_MS);
}
setTime(115 * MINUTE_IN_MS);
- // Await completion
- ConditionVariable done = new ConditionVariable();
- mStatsRule.getHandler().post(done::open);
- done.block();
+ // Pick up the remainder of battery history that has not yet been accumulated
+ provider.accumulateBatteryUsageStats(batteryStats);
+
+ mStatsRule.waitForBackgroundThread();
BatteryUsageStats stats = provider.getBatteryUsageStats(batteryStats,
new BatteryUsageStatsQuery.Builder().accumulated().build());
-
assertThat(stats.getStatsStartTimestamp()).isEqualTo(5 * MINUTE_IN_MS);
assertThat(stats.getStatsEndTimestamp()).isEqualTo(115 * MINUTE_IN_MS);
- // Section 1 (saved): 20 - 10 = 10
- // Section 2 (saved): 50 - 30 = 20
- // Section 3 (fresh): 110 - 80 = 30
// Total: 10 + 20 + 30 = 60
assertThat(stats.getAggregateBatteryConsumer(
BatteryUsageStats.AGGREGATE_BATTERY_CONSUMER_SCOPE_DEVICE)
@@ -657,6 +687,8 @@ public class BatteryUsageStatsProviderTest {
assertThat(uidBatteryConsumer
.getUsageDurationMillis(BatteryConsumer.POWER_COMPONENT_FLASHLIGHT))
.isEqualTo(60 * MINUTE_IN_MS);
+
+ assertThat(count[0]).isEqualTo(expectedNumberOfUpdates);
}
private void setTime(long timeMs) {
@@ -682,7 +714,7 @@ public class BatteryUsageStatsProviderTest {
BatteryUsageStatsProvider provider = new BatteryUsageStatsProvider(mContext,
mock(PowerAttributor.class), mStatsRule.getPowerProfile(),
- mStatsRule.getCpuScalingPolicies(), mock(PowerStatsStore.class), mMockClock);
+ mStatsRule.getCpuScalingPolicies(), mock(PowerStatsStore.class), 0, mMockClock);
PowerStatsStore powerStatsStore = mock(PowerStatsStore.class);
doAnswer(invocation -> {
@@ -702,7 +734,7 @@ public class BatteryUsageStatsProviderTest {
assertThat(uid.getConsumedPower(componentId1))
.isWithin(PRECISION).of(8.33333);
return null;
- }).when(powerStatsStore).storeBatteryUsageStats(anyLong(), any());
+ }).when(powerStatsStore).storeBatteryUsageStatsAsync(anyLong(), any());
mStatsRule.getBatteryStats().saveBatteryUsageStatsOnReset(provider, powerStatsStore,
/* accumulateBatteryUsageStats */ false);
@@ -714,7 +746,7 @@ public class BatteryUsageStatsProviderTest {
mStatsRule.waitForBackgroundThread();
- verify(powerStatsStore).storeBatteryUsageStats(anyLong(), any());
+ verify(powerStatsStore).storeBatteryUsageStatsAsync(anyLong(), any());
}
@Test
@@ -746,7 +778,7 @@ public class BatteryUsageStatsProviderTest {
BatteryUsageStatsProvider provider = new BatteryUsageStatsProvider(mContext,
mock(PowerAttributor.class), mStatsRule.getPowerProfile(),
- mStatsRule.getCpuScalingPolicies(), powerStatsStore, mMockClock);
+ mStatsRule.getCpuScalingPolicies(), powerStatsStore, 0, mMockClock);
BatteryUsageStatsQuery query = new BatteryUsageStatsQuery.Builder()
.aggregateSnapshots(0, 3000)
diff --git a/services/tests/powerstatstests/src/com/android/server/power/stats/MockBatteryStatsImpl.java b/services/tests/powerstatstests/src/com/android/server/power/stats/MockBatteryStatsImpl.java
index 2c03f9d1a9aa..1e4454c9a3f0 100644
--- a/services/tests/powerstatstests/src/com/android/server/power/stats/MockBatteryStatsImpl.java
+++ b/services/tests/powerstatstests/src/com/android/server/power/stats/MockBatteryStatsImpl.java
@@ -43,7 +43,6 @@ import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Queue;
-import java.util.concurrent.Future;
/**
* Mocks a BatteryStatsImpl object.
@@ -288,30 +287,25 @@ public class MockBatteryStatsImpl extends BatteryStatsImpl {
public int flags = 0;
@Override
- public Future<?> scheduleSync(String reason, int flags) {
- return null;
+ public void scheduleSync(String reason, int flags) {
}
@Override
- public Future<?> scheduleCleanupDueToRemovedUser(int userId) {
- return null;
+ public void scheduleCleanupDueToRemovedUser(int userId) {
}
@Override
- public Future<?> scheduleCpuSyncDueToRemovedUid(int uid) {
- return null;
+ public void scheduleCpuSyncDueToRemovedUid(int uid) {
}
@Override
- public Future<?> scheduleSyncDueToScreenStateChange(int flag, boolean onBattery,
+ public void scheduleSyncDueToScreenStateChange(int flag, boolean onBattery,
boolean onBatteryScreenOff, int screenState, int[] perDisplayScreenStates) {
flags |= flag;
- return null;
}
@Override
- public Future<?> scheduleCpuSyncDueToWakelockChange(long delayMillis) {
- return null;
+ public void scheduleCpuSyncDueToWakelockChange(long delayMillis) {
}
@Override
@@ -319,8 +313,7 @@ public class MockBatteryStatsImpl extends BatteryStatsImpl {
}
@Override
- public Future<?> scheduleSyncDueToBatteryLevelChange(long delayMillis) {
- return null;
+ public void scheduleSyncDueToBatteryLevelChange(long delayMillis) {
}
@Override
diff --git a/services/tests/powerstatstests/src/com/android/server/power/stats/WakelockPowerStatsCollectorTest.java b/services/tests/powerstatstests/src/com/android/server/power/stats/WakelockPowerStatsCollectorTest.java
index cef3fddc6aba..0d5d277b00ef 100644
--- a/services/tests/powerstatstests/src/com/android/server/power/stats/WakelockPowerStatsCollectorTest.java
+++ b/services/tests/powerstatstests/src/com/android/server/power/stats/WakelockPowerStatsCollectorTest.java
@@ -25,7 +25,6 @@ import static org.mockito.Mockito.mock;
import android.content.Context;
import android.os.Process;
import android.platform.test.annotations.DisableFlags;
-import android.platform.test.annotations.DisabledOnRavenwood;
import android.platform.test.flag.junit.SetFlagsRule;
import android.platform.test.ravenwood.RavenwoodConfig;
import android.platform.test.ravenwood.RavenwoodConfig.Config;
@@ -66,24 +65,22 @@ public class WakelockPowerStatsCollectorTest {
private WakelockPowerStatsLayout mStatsLayout = new WakelockPowerStatsLayout();
@Before
- public void setup() {
- mBatteryStats = new MockBatteryStatsImpl(mClock);
+ public void setup() throws Throwable {
+ mBatteryStats = mStatsRule.getBatteryStats();
mBatteryStats.setPowerStatsCollectorEnabled(POWER_COMPONENT_WAKELOCK, true);
mBatteryStats.getPowerStatsCollector(POWER_COMPONENT_WAKELOCK)
.addConsumer(ps -> mPowerStats = ps);
mBatteryStats.onSystemReady(mock(Context.class));
+ // onSystemReady schedules the initial power stats collection. Wait for it to finish
+ mStatsRule.waitForBackgroundThread();
}
@Test
@DisableFlags(Flags.FLAG_FRAMEWORK_WAKELOCK_INFO)
- @DisabledOnRavenwood(reason = "b/372292543 temporary disable")
public void collectStats() {
PowerStatsCollector powerStatsCollector = mBatteryStats.getPowerStatsCollector(
POWER_COMPONENT_WAKELOCK);
- // Establish a baseline
- powerStatsCollector.collectAndDeliverStats();
-
mBatteryStats.forceRecordAllHistory();
mStatsRule.advanceSuspendedTime(1000);
diff --git a/services/tests/powerstatstests/src/com/android/server/power/stats/WakelockStatsFrameworkEventsTest.java b/services/tests/powerstatstests/src/com/android/server/power/stats/WakelockStatsFrameworkEventsTest.java
index cb644dbe8c96..1fe3f58a9dcb 100644
--- a/services/tests/powerstatstests/src/com/android/server/power/stats/WakelockStatsFrameworkEventsTest.java
+++ b/services/tests/powerstatstests/src/com/android/server/power/stats/WakelockStatsFrameworkEventsTest.java
@@ -19,41 +19,25 @@ import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
-import android.os.WakeLockLevelEnum;
-import android.util.StatsEvent;
-import android.util.StatsEventTestUtils;
+import android.os.nano.OsProtoEnums;
import androidx.test.filters.SmallTest;
import androidx.test.runner.AndroidJUnit4;
-import com.android.os.AtomsProto;
-import com.android.os.framework.FrameworkExtensionAtoms;
-import com.android.os.framework.FrameworkExtensionAtoms.FrameworkWakelockInfo;
-
-import com.google.protobuf.CodedInputStream;
-import com.google.protobuf.CodedOutputStream;
-import com.google.protobuf.ExtensionRegistryLite;
-
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
import java.util.ArrayList;
-import java.util.List;
@RunWith(AndroidJUnit4.class)
@SmallTest
public class WakelockStatsFrameworkEventsTest {
private WakelockStatsFrameworkEvents mEvents;
- private ExtensionRegistryLite mRegistry;
@Before
public void setup() {
mEvents = new WakelockStatsFrameworkEvents();
- mRegistry = ExtensionRegistryLite.newInstance();
- FrameworkExtensionAtoms.registerAllExtensions(mRegistry);
}
private static final int UID_1 = 1;
@@ -62,8 +46,8 @@ public class WakelockStatsFrameworkEventsTest {
private static final String TAG_1 = "TAG1";
private static final String TAG_2 = "TAG2";
- private static final WakeLockLevelEnum WAKELOCK_TYPE_1 = WakeLockLevelEnum.PARTIAL_WAKE_LOCK;
- private static final WakeLockLevelEnum WAKELOCK_TYPE_2 = WakeLockLevelEnum.DOZE_WAKE_LOCK;
+ private static final int WAKELOCK_TYPE_1 = OsProtoEnums.PARTIAL_WAKE_LOCK;
+ private static final int WAKELOCK_TYPE_2 = OsProtoEnums.DOZE_WAKE_LOCK;
private static final long TS_1 = 1000;
private static final long TS_2 = 2000;
@@ -71,19 +55,37 @@ public class WakelockStatsFrameworkEventsTest {
private static final long TS_4 = 4000;
private static final long TS_5 = 5000;
+ // Mirrors com.android.os.framework.FrameworkWakelockInfo proto.
+ private static class WakelockInfo {
+ public int uid;
+ public String tag;
+ public int type;
+ public long uptimeMillis;
+ public long completedCount;
+
+ WakelockInfo(int uid, String tag, int type, long uptimeMillis, long completedCount) {
+ this.uid = uid;
+ this.tag = tag;
+ this.type = type;
+ this.uptimeMillis = uptimeMillis;
+ this.completedCount = completedCount;
+ }
+ }
+
// Assumes that mEvents is empty.
+ @SuppressWarnings("GuardedBy")
private void makeMetricsAlmostOverflow() throws Exception {
for (int i = 0; i < mEvents.SUMMARY_THRESHOLD - 1; i++) {
String tag = "forceOverflow" + i;
- mEvents.noteStartWakeLock(UID_1, tag, WAKELOCK_TYPE_1.getNumber(), TS_1);
- mEvents.noteStopWakeLock(UID_1, tag, WAKELOCK_TYPE_1.getNumber(), TS_2);
+ mEvents.noteStartWakeLock(UID_1, tag, WAKELOCK_TYPE_1, TS_1);
+ mEvents.noteStopWakeLock(UID_1, tag, WAKELOCK_TYPE_1, TS_2);
}
assertFalse("not overflow", mEvents.inOverflow());
- ArrayList<FrameworkWakelockInfo> info = pullResults(TS_4);
- FrameworkWakelockInfo notOverflowInfo =
+ ArrayList<WakelockInfo> info = pullResults(TS_4);
+ WakelockInfo notOverflowInfo =
info.stream()
- .filter(i -> i.getAttributionTag().equals(mEvents.OVERFLOW_TAG))
+ .filter(i -> i.tag.equals(mEvents.OVERFLOW_TAG))
.findFirst()
.orElse(null);
@@ -91,38 +93,36 @@ public class WakelockStatsFrameworkEventsTest {
// Add one more to hit an overflow state.
String lastTag = "forceOverflowLast";
- mEvents.noteStartWakeLock(UID_1, lastTag, WAKELOCK_TYPE_2.getNumber(), TS_1);
- mEvents.noteStopWakeLock(UID_1, lastTag, WAKELOCK_TYPE_2.getNumber(), TS_2);
+ mEvents.noteStartWakeLock(UID_1, lastTag, WAKELOCK_TYPE_2, TS_1);
+ mEvents.noteStopWakeLock(UID_1, lastTag, WAKELOCK_TYPE_2, TS_2);
assertTrue("overflow", mEvents.inOverflow());
info = pullResults(TS_4);
- FrameworkWakelockInfo tag1Info =
- info.stream()
- .filter(i -> i.getAttributionTag().equals(lastTag))
- .findFirst()
- .orElse(null);
+ WakelockInfo tag1Info =
+ info.stream().filter(i -> i.tag.equals(lastTag)).findFirst().orElse(null);
assertTrue("lastTag found", tag1Info != null);
- assertEquals("uid", UID_1, tag1Info.getAttributionUid());
- assertEquals("tag", lastTag, tag1Info.getAttributionTag());
- assertEquals("type", WAKELOCK_TYPE_2, tag1Info.getType());
- assertEquals("duration", TS_2 - TS_1, tag1Info.getUptimeMillis());
- assertEquals("count", 1, tag1Info.getCompletedCount());
+ assertEquals("uid", UID_1, tag1Info.uid);
+ assertEquals("tag", lastTag, tag1Info.tag);
+ assertEquals("type", WAKELOCK_TYPE_2, tag1Info.type);
+ assertEquals("duration", TS_2 - TS_1, tag1Info.uptimeMillis);
+ assertEquals("count", 1, tag1Info.completedCount);
}
// Assumes that mEvents is empty.
+ @SuppressWarnings("GuardedBy")
private void makeMetricsAlmostHardCap() throws Exception {
for (int i = 0; i < mEvents.MAX_WAKELOCK_DIMENSIONS - 1; i++) {
- mEvents.noteStartWakeLock(i /* uid */, TAG_1, WAKELOCK_TYPE_1.getNumber(), TS_1);
- mEvents.noteStopWakeLock(i /* uid */, TAG_1, WAKELOCK_TYPE_1.getNumber(), TS_2);
+ mEvents.noteStartWakeLock(i /* uid */, TAG_1, WAKELOCK_TYPE_1, TS_1);
+ mEvents.noteStopWakeLock(i /* uid */, TAG_1, WAKELOCK_TYPE_1, TS_2);
}
assertFalse("not hard capped", mEvents.inHardCap());
- ArrayList<FrameworkWakelockInfo> info = pullResults(TS_4);
- FrameworkWakelockInfo notOverflowInfo =
+ ArrayList<WakelockInfo> info = pullResults(TS_4);
+ WakelockInfo notOverflowInfo =
info.stream()
- .filter(i -> i.getAttributionTag().equals(mEvents.HARD_CAP_TAG))
+ .filter(i -> i.tag.equals(mEvents.HARD_CAP_TAG))
.findFirst()
.orElse(null);
@@ -130,98 +130,86 @@ public class WakelockStatsFrameworkEventsTest {
// Add one more to hit an hardcap state.
int hardCapUid = mEvents.MAX_WAKELOCK_DIMENSIONS;
- mEvents.noteStartWakeLock(hardCapUid, TAG_2, WAKELOCK_TYPE_2.getNumber(), TS_1);
- mEvents.noteStopWakeLock(hardCapUid, TAG_2, WAKELOCK_TYPE_2.getNumber(), TS_2);
+ mEvents.noteStartWakeLock(hardCapUid, TAG_2, WAKELOCK_TYPE_2, TS_1);
+ mEvents.noteStopWakeLock(hardCapUid, TAG_2, WAKELOCK_TYPE_2, TS_2);
assertTrue("hard capped", mEvents.inHardCap());
info = pullResults(TS_4);
- FrameworkWakelockInfo tag2Info =
- info.stream()
- .filter(i -> i.getAttributionUid() == hardCapUid)
- .findFirst()
- .orElse(null);
+ WakelockInfo tag2Info =
+ info.stream().filter(i -> i.uid == hardCapUid).findFirst().orElse(null);
assertTrue("hardCapUid found", tag2Info != null);
- assertEquals("uid", hardCapUid, tag2Info.getAttributionUid());
- assertEquals("tag", mEvents.OVERFLOW_TAG, tag2Info.getAttributionTag());
- assertEquals(
- "type", WakeLockLevelEnum.forNumber(mEvents.OVERFLOW_LEVEL), tag2Info.getType());
- assertEquals("duration", TS_2 - TS_1, tag2Info.getUptimeMillis());
- assertEquals("count", 1, tag2Info.getCompletedCount());
+ assertEquals("uid", hardCapUid, tag2Info.uid);
+ assertEquals("tag", mEvents.OVERFLOW_TAG, tag2Info.tag);
+ assertEquals("type", mEvents.OVERFLOW_LEVEL, tag2Info.type);
+ assertEquals("duration", TS_2 - TS_1, tag2Info.uptimeMillis);
+ assertEquals("count", 1, tag2Info.completedCount);
}
- private ArrayList<FrameworkWakelockInfo> pullResults(long timestamp) throws Exception {
- ArrayList<FrameworkWakelockInfo> result = new ArrayList<>();
- List<StatsEvent> events = mEvents.pullFrameworkWakelockInfoAtoms(timestamp);
-
- for (StatsEvent e : events) {
- // The returned atom does not have external extensions registered.
- // So we serialize and then deserialize with extensions registered.
- AtomsProto.Atom atom = StatsEventTestUtils.convertToAtom(e);
-
- ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
- CodedOutputStream codedos = CodedOutputStream.newInstance(outputStream);
- atom.writeTo(codedos);
- codedos.flush();
-
- ByteArrayInputStream inputStream = new ByteArrayInputStream(outputStream.toByteArray());
- CodedInputStream codedis = CodedInputStream.newInstance(inputStream);
- AtomsProto.Atom atomWithExtensions = AtomsProto.Atom.parseFrom(codedis, mRegistry);
-
- assertTrue(
- atomWithExtensions.hasExtension(FrameworkExtensionAtoms.frameworkWakelockInfo));
- FrameworkWakelockInfo info =
- atomWithExtensions.getExtension(FrameworkExtensionAtoms.frameworkWakelockInfo);
- result.add(info);
- }
-
- return result;
+ private ArrayList<WakelockInfo> pullResults(long timestamp) {
+ ArrayList<WakelockInfo> results = new ArrayList<>();
+ WakelockStatsFrameworkEvents.EventLogger logger =
+ new WakelockStatsFrameworkEvents.EventLogger() {
+ public void logResult(
+ int uid,
+ String tag,
+ int wakeLockLevel,
+ long uptimeMillis,
+ long completedCount) {
+ WakelockInfo info =
+ new WakelockInfo(
+ uid, tag, wakeLockLevel, uptimeMillis, completedCount);
+ results.add(info);
+ }
+ };
+ mEvents.pullFrameworkWakelockInfoAtoms(timestamp, logger);
+ return results;
}
@Test
- public void singleWakelock() throws Exception {
- mEvents.noteStartWakeLock(UID_1, TAG_1, WAKELOCK_TYPE_1.getNumber(), TS_1);
- mEvents.noteStopWakeLock(UID_1, TAG_1, WAKELOCK_TYPE_1.getNumber(), TS_2);
+ public void singleWakelock() {
+ mEvents.noteStartWakeLock(UID_1, TAG_1, WAKELOCK_TYPE_1, TS_1);
+ mEvents.noteStopWakeLock(UID_1, TAG_1, WAKELOCK_TYPE_1, TS_2);
- ArrayList<FrameworkWakelockInfo> info = pullResults(TS_3);
+ ArrayList<WakelockInfo> info = pullResults(TS_3);
assertEquals("size", 1, info.size());
- assertEquals("uid", UID_1, info.get(0).getAttributionUid());
- assertEquals("tag", TAG_1, info.get(0).getAttributionTag());
- assertEquals("type", WAKELOCK_TYPE_1, info.get(0).getType());
- assertEquals("duration", TS_2 - TS_1, info.get(0).getUptimeMillis());
- assertEquals("count", 1, info.get(0).getCompletedCount());
+ assertEquals("uid", UID_1, info.get(0).uid);
+ assertEquals("tag", TAG_1, info.get(0).tag);
+ assertEquals("type", WAKELOCK_TYPE_1, info.get(0).type);
+ assertEquals("duration", TS_2 - TS_1, info.get(0).uptimeMillis);
+ assertEquals("count", 1, info.get(0).completedCount);
}
@Test
public void wakelockOpen() throws Exception {
- mEvents.noteStartWakeLock(UID_1, TAG_1, WAKELOCK_TYPE_1.getNumber(), TS_1);
+ mEvents.noteStartWakeLock(UID_1, TAG_1, WAKELOCK_TYPE_1, TS_1);
- ArrayList<FrameworkWakelockInfo> info = pullResults(TS_3);
+ ArrayList<WakelockInfo> info = pullResults(TS_3);
assertEquals("size", 1, info.size());
- assertEquals("uid", UID_1, info.get(0).getAttributionUid());
- assertEquals("tag", TAG_1, info.get(0).getAttributionTag());
- assertEquals("type", WAKELOCK_TYPE_1, info.get(0).getType());
- assertEquals("duration", TS_3 - TS_1, info.get(0).getUptimeMillis());
- assertEquals("count", 0, info.get(0).getCompletedCount());
+ assertEquals("uid", UID_1, info.get(0).uid);
+ assertEquals("tag", TAG_1, info.get(0).tag);
+ assertEquals("type", WAKELOCK_TYPE_1, info.get(0).type);
+ assertEquals("duration", TS_3 - TS_1, info.get(0).uptimeMillis);
+ assertEquals("count", 0, info.get(0).completedCount);
}
@Test
public void wakelockOpenOverlap() throws Exception {
- mEvents.noteStartWakeLock(UID_1, TAG_1, WAKELOCK_TYPE_1.getNumber(), TS_1);
- mEvents.noteStartWakeLock(UID_1, TAG_1, WAKELOCK_TYPE_1.getNumber(), TS_2);
- mEvents.noteStopWakeLock(UID_1, TAG_1, WAKELOCK_TYPE_1.getNumber(), TS_3);
+ mEvents.noteStartWakeLock(UID_1, TAG_1, WAKELOCK_TYPE_1, TS_1);
+ mEvents.noteStartWakeLock(UID_1, TAG_1, WAKELOCK_TYPE_1, TS_2);
+ mEvents.noteStopWakeLock(UID_1, TAG_1, WAKELOCK_TYPE_1, TS_3);
- ArrayList<FrameworkWakelockInfo> info = pullResults(TS_4);
+ ArrayList<WakelockInfo> info = pullResults(TS_4);
assertEquals("size", 1, info.size());
- assertEquals("uid", UID_1, info.get(0).getAttributionUid());
- assertEquals("tag", TAG_1, info.get(0).getAttributionTag());
- assertEquals("type", WAKELOCK_TYPE_1, info.get(0).getType());
- assertEquals("duration", TS_4 - TS_1, info.get(0).getUptimeMillis());
- assertEquals("count", 0, info.get(0).getCompletedCount());
+ assertEquals("uid", UID_1, info.get(0).uid);
+ assertEquals("tag", TAG_1, info.get(0).tag);
+ assertEquals("type", WAKELOCK_TYPE_1, info.get(0).type);
+ assertEquals("duration", TS_4 - TS_1, info.get(0).uptimeMillis);
+ assertEquals("count", 0, info.get(0).completedCount);
}
@Test
@@ -229,23 +217,20 @@ public class WakelockStatsFrameworkEventsTest {
makeMetricsAlmostOverflow();
// This one gets tagged as an overflow.
- mEvents.noteStartWakeLock(UID_1, TAG_2, WAKELOCK_TYPE_2.getNumber(), TS_1);
- mEvents.noteStopWakeLock(UID_1, TAG_2, WAKELOCK_TYPE_2.getNumber(), TS_2);
+ mEvents.noteStartWakeLock(UID_1, TAG_2, WAKELOCK_TYPE_2, TS_1);
+ mEvents.noteStopWakeLock(UID_1, TAG_2, WAKELOCK_TYPE_2, TS_2);
- ArrayList<FrameworkWakelockInfo> info = pullResults(TS_4);
- FrameworkWakelockInfo overflowInfo =
+ ArrayList<WakelockInfo> info = pullResults(TS_4);
+ WakelockInfo overflowInfo =
info.stream()
- .filter(i -> i.getAttributionTag().equals(mEvents.OVERFLOW_TAG))
+ .filter(i -> i.tag.equals(mEvents.OVERFLOW_TAG))
.findFirst()
.orElse(null);
- assertEquals("uid", UID_1, overflowInfo.getAttributionUid());
- assertEquals(
- "type",
- WakeLockLevelEnum.forNumber(mEvents.OVERFLOW_LEVEL),
- overflowInfo.getType());
- assertEquals("duration", TS_2 - TS_1, overflowInfo.getUptimeMillis());
- assertEquals("count", 1, overflowInfo.getCompletedCount());
+ assertEquals("uid", UID_1, overflowInfo.uid);
+ assertEquals("type", mEvents.OVERFLOW_LEVEL, overflowInfo.type);
+ assertEquals("duration", TS_2 - TS_1, overflowInfo.uptimeMillis);
+ assertEquals("count", 1, overflowInfo.completedCount);
}
@Test
@@ -253,22 +238,19 @@ public class WakelockStatsFrameworkEventsTest {
makeMetricsAlmostOverflow();
// This is the open wakelock that overflows.
- mEvents.noteStartWakeLock(UID_1, TAG_2, WAKELOCK_TYPE_2.getNumber(), TS_1);
+ mEvents.noteStartWakeLock(UID_1, TAG_2, WAKELOCK_TYPE_2, TS_1);
- ArrayList<FrameworkWakelockInfo> info = pullResults(TS_4);
- FrameworkWakelockInfo overflowInfo =
+ ArrayList<WakelockInfo> info = pullResults(TS_4);
+ WakelockInfo overflowInfo =
info.stream()
- .filter(i -> i.getAttributionTag().equals(mEvents.OVERFLOW_TAG))
+ .filter(i -> i.tag.equals(mEvents.OVERFLOW_TAG))
.findFirst()
.orElse(null);
- assertEquals("uid", UID_1, overflowInfo.getAttributionUid());
- assertEquals(
- "type",
- WakeLockLevelEnum.forNumber(mEvents.OVERFLOW_LEVEL),
- overflowInfo.getType());
- assertEquals("duration", (TS_4 - TS_1), overflowInfo.getUptimeMillis());
- assertEquals("count", 0, overflowInfo.getCompletedCount());
+ assertEquals("uid", UID_1, overflowInfo.uid);
+ assertEquals("type", mEvents.OVERFLOW_LEVEL, overflowInfo.type);
+ assertEquals("duration", (TS_4 - TS_1), overflowInfo.uptimeMillis);
+ assertEquals("count", 0, overflowInfo.completedCount);
}
@Test
@@ -276,23 +258,20 @@ public class WakelockStatsFrameworkEventsTest {
makeMetricsAlmostHardCap();
// This one gets tagged as a hard cap.
- mEvents.noteStartWakeLock(UID_1, TAG_2, WAKELOCK_TYPE_2.getNumber(), TS_1);
- mEvents.noteStopWakeLock(UID_1, TAG_2, WAKELOCK_TYPE_2.getNumber(), TS_2);
+ mEvents.noteStartWakeLock(UID_1, TAG_2, WAKELOCK_TYPE_2, TS_1);
+ mEvents.noteStopWakeLock(UID_1, TAG_2, WAKELOCK_TYPE_2, TS_2);
- ArrayList<FrameworkWakelockInfo> info = pullResults(TS_4);
- FrameworkWakelockInfo hardCapInfo =
+ ArrayList<WakelockInfo> info = pullResults(TS_4);
+ WakelockInfo hardCapInfo =
info.stream()
- .filter(i -> i.getAttributionTag().equals(mEvents.HARD_CAP_TAG))
+ .filter(i -> i.tag.equals(mEvents.HARD_CAP_TAG))
.findFirst()
.orElse(null);
- assertEquals("uid", mEvents.HARD_CAP_UID, hardCapInfo.getAttributionUid());
- assertEquals(
- "type",
- WakeLockLevelEnum.forNumber(mEvents.OVERFLOW_LEVEL),
- hardCapInfo.getType());
- assertEquals("duration", TS_2 - TS_1, hardCapInfo.getUptimeMillis());
- assertEquals("count", 1, hardCapInfo.getCompletedCount());
+ assertEquals("uid", mEvents.HARD_CAP_UID, hardCapInfo.uid);
+ assertEquals("type", mEvents.OVERFLOW_LEVEL, hardCapInfo.type);
+ assertEquals("duration", TS_2 - TS_1, hardCapInfo.uptimeMillis);
+ assertEquals("count", 1, hardCapInfo.completedCount);
}
@Test
@@ -300,134 +279,123 @@ public class WakelockStatsFrameworkEventsTest {
makeMetricsAlmostHardCap();
// This is the open wakelock that overflows.
- mEvents.noteStartWakeLock(UID_1, TAG_2, WAKELOCK_TYPE_2.getNumber(), TS_1);
+ mEvents.noteStartWakeLock(UID_1, TAG_2, WAKELOCK_TYPE_2, TS_1);
- ArrayList<FrameworkWakelockInfo> info = pullResults(TS_4);
- FrameworkWakelockInfo hardCapInfo =
+ ArrayList<WakelockInfo> info = pullResults(TS_4);
+ WakelockInfo hardCapInfo =
info.stream()
- .filter(i -> i.getAttributionTag().equals(mEvents.HARD_CAP_TAG))
+ .filter(i -> i.tag.equals(mEvents.HARD_CAP_TAG))
.findFirst()
.orElse(null);
- assertEquals("uid", mEvents.HARD_CAP_UID, hardCapInfo.getAttributionUid());
- assertEquals(
- "type",
- WakeLockLevelEnum.forNumber(mEvents.OVERFLOW_LEVEL),
- hardCapInfo.getType());
- assertEquals("duration", (TS_4 - TS_1), hardCapInfo.getUptimeMillis());
- assertEquals("count", 0, hardCapInfo.getCompletedCount());
+ assertEquals("uid", mEvents.HARD_CAP_UID, hardCapInfo.uid);
+ assertEquals("type", mEvents.OVERFLOW_LEVEL, hardCapInfo.type);
+ assertEquals("duration", (TS_4 - TS_1), hardCapInfo.uptimeMillis);
+ assertEquals("count", 0, hardCapInfo.completedCount);
}
@Test
public void overlappingWakelocks() throws Exception {
- mEvents.noteStartWakeLock(UID_1, TAG_1, WAKELOCK_TYPE_1.getNumber(), TS_1);
- mEvents.noteStartWakeLock(UID_1, TAG_1, WAKELOCK_TYPE_1.getNumber(), TS_2);
- mEvents.noteStopWakeLock(UID_1, TAG_1, WAKELOCK_TYPE_1.getNumber(), TS_3);
- mEvents.noteStopWakeLock(UID_1, TAG_1, WAKELOCK_TYPE_1.getNumber(), TS_4);
+ mEvents.noteStartWakeLock(UID_1, TAG_1, WAKELOCK_TYPE_1, TS_1);
+ mEvents.noteStartWakeLock(UID_1, TAG_1, WAKELOCK_TYPE_1, TS_2);
+ mEvents.noteStopWakeLock(UID_1, TAG_1, WAKELOCK_TYPE_1, TS_3);
+ mEvents.noteStopWakeLock(UID_1, TAG_1, WAKELOCK_TYPE_1, TS_4);
- ArrayList<FrameworkWakelockInfo> info = pullResults(TS_5);
+ ArrayList<WakelockInfo> info = pullResults(TS_5);
assertEquals("size", 1, info.size());
- assertEquals("uid", UID_1, info.get(0).getAttributionUid());
- assertEquals("tag", TAG_1, info.get(0).getAttributionTag());
- assertEquals("type", WAKELOCK_TYPE_1, info.get(0).getType());
- assertEquals("duration", TS_4 - TS_1, info.get(0).getUptimeMillis());
- assertEquals("count", 1, info.get(0).getCompletedCount());
+ assertEquals("uid", UID_1, info.get(0).uid);
+ assertEquals("tag", TAG_1, info.get(0).tag);
+ assertEquals("type", WAKELOCK_TYPE_1, info.get(0).type);
+ assertEquals("duration", TS_4 - TS_1, info.get(0).uptimeMillis);
+ assertEquals("count", 1, info.get(0).completedCount);
}
@Test
public void diffUid() throws Exception {
- mEvents.noteStartWakeLock(UID_1, TAG_1, WAKELOCK_TYPE_1.getNumber(), TS_1);
- mEvents.noteStartWakeLock(UID_2, TAG_1, WAKELOCK_TYPE_1.getNumber(), TS_2);
- mEvents.noteStopWakeLock(UID_2, TAG_1, WAKELOCK_TYPE_1.getNumber(), TS_3);
- mEvents.noteStopWakeLock(UID_1, TAG_1, WAKELOCK_TYPE_1.getNumber(), TS_4);
+ mEvents.noteStartWakeLock(UID_1, TAG_1, WAKELOCK_TYPE_1, TS_1);
+ mEvents.noteStartWakeLock(UID_2, TAG_1, WAKELOCK_TYPE_1, TS_2);
+ mEvents.noteStopWakeLock(UID_2, TAG_1, WAKELOCK_TYPE_1, TS_3);
+ mEvents.noteStopWakeLock(UID_1, TAG_1, WAKELOCK_TYPE_1, TS_4);
- ArrayList<FrameworkWakelockInfo> info = pullResults(TS_5);
+ ArrayList<WakelockInfo> info = pullResults(TS_5);
assertEquals("size", 2, info.size());
- FrameworkWakelockInfo uid1Info =
- info.stream().filter(i -> i.getAttributionUid() == UID_1).findFirst().orElse(null);
+ WakelockInfo uid1Info = info.stream().filter(i -> i.uid == UID_1).findFirst().orElse(null);
assertTrue("UID_1 found", uid1Info != null);
- assertEquals("uid", UID_1, uid1Info.getAttributionUid());
- assertEquals("tag", TAG_1, uid1Info.getAttributionTag());
- assertEquals("type", WAKELOCK_TYPE_1, uid1Info.getType());
- assertEquals("duration", TS_4 - TS_1, uid1Info.getUptimeMillis());
- assertEquals("count", 1, uid1Info.getCompletedCount());
-
- FrameworkWakelockInfo uid2Info =
- info.stream().filter(i -> i.getAttributionUid() == UID_2).findFirst().orElse(null);
+ assertEquals("uid", UID_1, uid1Info.uid);
+ assertEquals("tag", TAG_1, uid1Info.tag);
+ assertEquals("type", WAKELOCK_TYPE_1, uid1Info.type);
+ assertEquals("duration", TS_4 - TS_1, uid1Info.uptimeMillis);
+ assertEquals("count", 1, uid1Info.completedCount);
+
+ WakelockInfo uid2Info = info.stream().filter(i -> i.uid == UID_2).findFirst().orElse(null);
assertTrue("UID_2 found", uid2Info != null);
- assertEquals("uid", UID_2, uid2Info.getAttributionUid());
- assertEquals("tag", TAG_1, uid2Info.getAttributionTag());
- assertEquals("type", WAKELOCK_TYPE_1, uid2Info.getType());
- assertEquals("duration", TS_3 - TS_2, uid2Info.getUptimeMillis());
- assertEquals("count", 1, uid2Info.getCompletedCount());
+ assertEquals("uid", UID_2, uid2Info.uid);
+ assertEquals("tag", TAG_1, uid2Info.tag);
+ assertEquals("type", WAKELOCK_TYPE_1, uid2Info.type);
+ assertEquals("duration", TS_3 - TS_2, uid2Info.uptimeMillis);
+ assertEquals("count", 1, uid2Info.completedCount);
}
@Test
public void diffTag() throws Exception {
- mEvents.noteStartWakeLock(UID_1, TAG_1, WAKELOCK_TYPE_1.getNumber(), TS_1);
- mEvents.noteStartWakeLock(UID_1, TAG_2, WAKELOCK_TYPE_1.getNumber(), TS_2);
- mEvents.noteStopWakeLock(UID_1, TAG_2, WAKELOCK_TYPE_1.getNumber(), TS_3);
- mEvents.noteStopWakeLock(UID_1, TAG_1, WAKELOCK_TYPE_1.getNumber(), TS_4);
+ mEvents.noteStartWakeLock(UID_1, TAG_1, WAKELOCK_TYPE_1, TS_1);
+ mEvents.noteStartWakeLock(UID_1, TAG_2, WAKELOCK_TYPE_1, TS_2);
+ mEvents.noteStopWakeLock(UID_1, TAG_2, WAKELOCK_TYPE_1, TS_3);
+ mEvents.noteStopWakeLock(UID_1, TAG_1, WAKELOCK_TYPE_1, TS_4);
- ArrayList<FrameworkWakelockInfo> info = pullResults(TS_5);
+ ArrayList<WakelockInfo> info = pullResults(TS_5);
assertEquals("size", 2, info.size());
- FrameworkWakelockInfo uid1Info =
- info.stream()
- .filter(i -> i.getAttributionTag().equals(TAG_1))
- .findFirst()
- .orElse(null);
+ WakelockInfo uid1Info =
+ info.stream().filter(i -> i.tag.equals(TAG_1)).findFirst().orElse(null);
assertTrue("TAG_1 found", uid1Info != null);
- assertEquals("uid", UID_1, uid1Info.getAttributionUid());
- assertEquals("tag", TAG_1, uid1Info.getAttributionTag());
- assertEquals("type", WAKELOCK_TYPE_1, uid1Info.getType());
- assertEquals("duration", TS_4 - TS_1, uid1Info.getUptimeMillis());
- assertEquals("count", 1, uid1Info.getCompletedCount());
-
- FrameworkWakelockInfo uid2Info =
- info.stream()
- .filter(i -> i.getAttributionTag().equals(TAG_2))
- .findFirst()
- .orElse(null);
+ assertEquals("uid", UID_1, uid1Info.uid);
+ assertEquals("tag", TAG_1, uid1Info.tag);
+ assertEquals("type", WAKELOCK_TYPE_1, uid1Info.type);
+ assertEquals("duration", TS_4 - TS_1, uid1Info.uptimeMillis);
+ assertEquals("count", 1, uid1Info.completedCount);
+
+ WakelockInfo uid2Info =
+ info.stream().filter(i -> i.tag.equals(TAG_2)).findFirst().orElse(null);
assertTrue("TAG_2 found", uid2Info != null);
- assertEquals("uid", UID_1, uid2Info.getAttributionUid());
- assertEquals("tag", TAG_2, uid2Info.getAttributionTag());
- assertEquals("type", WAKELOCK_TYPE_1, uid2Info.getType());
- assertEquals("duration", TS_3 - TS_2, uid2Info.getUptimeMillis());
- assertEquals("count", 1, uid2Info.getCompletedCount());
+ assertEquals("uid", UID_1, uid2Info.uid);
+ assertEquals("tag", TAG_2, uid2Info.tag);
+ assertEquals("type", WAKELOCK_TYPE_1, uid2Info.type);
+ assertEquals("duration", TS_3 - TS_2, uid2Info.uptimeMillis);
+ assertEquals("count", 1, uid2Info.completedCount);
}
@Test
public void diffType() throws Exception {
- mEvents.noteStartWakeLock(UID_1, TAG_1, WAKELOCK_TYPE_1.getNumber(), TS_1);
- mEvents.noteStartWakeLock(UID_1, TAG_1, WAKELOCK_TYPE_2.getNumber(), TS_2);
- mEvents.noteStopWakeLock(UID_1, TAG_1, WAKELOCK_TYPE_2.getNumber(), TS_3);
- mEvents.noteStopWakeLock(UID_1, TAG_1, WAKELOCK_TYPE_1.getNumber(), TS_4);
+ mEvents.noteStartWakeLock(UID_1, TAG_1, WAKELOCK_TYPE_1, TS_1);
+ mEvents.noteStartWakeLock(UID_1, TAG_1, WAKELOCK_TYPE_2, TS_2);
+ mEvents.noteStopWakeLock(UID_1, TAG_1, WAKELOCK_TYPE_2, TS_3);
+ mEvents.noteStopWakeLock(UID_1, TAG_1, WAKELOCK_TYPE_1, TS_4);
- ArrayList<FrameworkWakelockInfo> info = pullResults(TS_5);
+ ArrayList<WakelockInfo> info = pullResults(TS_5);
assertEquals("size", 2, info.size());
- FrameworkWakelockInfo uid1Info =
- info.stream().filter(i -> i.getType() == WAKELOCK_TYPE_1).findFirst().orElse(null);
+ WakelockInfo uid1Info =
+ info.stream().filter(i -> i.type == WAKELOCK_TYPE_1).findFirst().orElse(null);
assertTrue("WAKELOCK_TYPE_1 found", uid1Info != null);
- assertEquals("uid", UID_1, uid1Info.getAttributionUid());
- assertEquals("tag", TAG_1, uid1Info.getAttributionTag());
- assertEquals("type", WAKELOCK_TYPE_1, uid1Info.getType());
- assertEquals("duration", TS_4 - TS_1, uid1Info.getUptimeMillis());
- assertEquals("count", 1, uid1Info.getCompletedCount());
-
- FrameworkWakelockInfo uid2Info =
- info.stream().filter(i -> i.getType() == WAKELOCK_TYPE_2).findFirst().orElse(null);
+ assertEquals("uid", UID_1, uid1Info.uid);
+ assertEquals("tag", TAG_1, uid1Info.tag);
+ assertEquals("type", WAKELOCK_TYPE_1, uid1Info.type);
+ assertEquals("duration", TS_4 - TS_1, uid1Info.uptimeMillis);
+ assertEquals("count", 1, uid1Info.completedCount);
+
+ WakelockInfo uid2Info =
+ info.stream().filter(i -> i.type == WAKELOCK_TYPE_2).findFirst().orElse(null);
assertTrue("WAKELOCK_TYPE_2 found", uid2Info != null);
- assertEquals("uid", UID_1, uid2Info.getAttributionUid());
- assertEquals("tag", TAG_1, uid2Info.getAttributionTag());
- assertEquals("type", WAKELOCK_TYPE_2, uid2Info.getType());
- assertEquals("duration", TS_3 - TS_2, uid2Info.getUptimeMillis());
- assertEquals("count", 1, uid2Info.getCompletedCount());
+ assertEquals("uid", UID_1, uid2Info.uid);
+ assertEquals("tag", TAG_1, uid2Info.tag);
+ assertEquals("type", WAKELOCK_TYPE_2, uid2Info.type);
+ assertEquals("duration", TS_3 - TS_2, uid2Info.uptimeMillis);
+ assertEquals("count", 1, uid2Info.completedCount);
}
}
diff --git a/services/tests/security/forensic/Android.bp b/services/tests/security/forensic/Android.bp
new file mode 100644
index 000000000000..adc49040a004
--- /dev/null
+++ b/services/tests/security/forensic/Android.bp
@@ -0,0 +1,41 @@
+package {
+ default_team: "trendy_team_platform_security",
+ // See: http://go/android-license-faq
+ // A large-scale-change added 'default_applicable_licenses' to import
+ // all of the 'license_kinds' from "frameworks_base_license"
+ // to get the below license kinds:
+ // SPDX-license-identifier-Apache-2.0
+ default_applicable_licenses: ["frameworks_base_license"],
+}
+
+android_test {
+ name: "ForensicServiceTests",
+ srcs: [
+ "src/**/*.java",
+ ],
+
+ static_libs: [
+ "androidx.test.core",
+ "androidx.test.rules",
+ "androidx.test.runner",
+ "compatibility-device-util-axt",
+ "frameworks-base-testutils",
+ "junit",
+ "platform-test-annotations",
+ "services.core",
+ "truth",
+ ],
+
+ platform_apis: true,
+
+ test_suites: [
+ "device-tests",
+ "automotive-tests",
+ ],
+
+ certificate: "platform",
+ dxflags: ["--multi-dex"],
+ optimize: {
+ enabled: false,
+ },
+}
diff --git a/core/java/android/service/wallpaper/AndroidManifest.xml b/services/tests/security/forensic/AndroidManifest.xml
index f1bdb76409fb..40feb19aecba 100644
--- a/core/java/android/service/wallpaper/AndroidManifest.xml
+++ b/services/tests/security/forensic/AndroidManifest.xml
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
-<!--
- Copyright (C) 2017 The Android Open Source Project
+<!-- Copyright (C) 2024 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -16,7 +15,13 @@
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="android.service.wallpaper">
+ package="com.android.server.security.forensic.tests">
- <uses-sdk android:minSdkVersion="29" />
+ <application android:testOnly="true">
+ <uses-library android:name="android.test.runner"/>
+ </application>
+
+ <instrumentation android:name="androidx.test.runner.AndroidJUnitRunner"
+ android:targetPackage="com.android.server.security.forensic.tests"
+ android:label="Frameworks Forensic Services Tests"/>
</manifest>
diff --git a/services/tests/security/forensic/AndroidTest.xml b/services/tests/security/forensic/AndroidTest.xml
new file mode 100644
index 000000000000..bbe2e9c303ce
--- /dev/null
+++ b/services/tests/security/forensic/AndroidTest.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2024 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<configuration description="Runs Frameworks Forensic Service tests.">
+ <option name="test-suite-tag" value="apct" />
+ <option name="test-suite-tag" value="apct-instrumentation" />
+
+ <target_preparer class="com.android.tradefed.targetprep.suite.SuiteApkInstaller">
+ <option name="cleanup-apks" value="true"/>
+ <option name="test-file-name" value="ForensicServiceTests.apk"/>
+ <option name="install-arg" value="-t" />
+ </target_preparer>
+
+ <option name="test-tag" value="ForensicServiceTests" />
+ <test class="com.android.tradefed.testtype.InstrumentationTest" >
+ <option name="package" value="com.android.server.security.forensic.tests" />
+ <option name="runner" value="androidx.test.runner.AndroidJUnitRunner" />
+ <option name="hidden-api-checks" value="false"/>
+ </test>
+</configuration>
diff --git a/services/tests/security/forensic/TEST_MAPPING b/services/tests/security/forensic/TEST_MAPPING
new file mode 100644
index 000000000000..bd8b2ab7c41f
--- /dev/null
+++ b/services/tests/security/forensic/TEST_MAPPING
@@ -0,0 +1,7 @@
+{
+ "postsubmit": [
+ {
+ "name": "ForensicServiceTests"
+ }
+ ]
+}
diff --git a/services/tests/security/forensic/src/com/android/server/security/forensic/ForensicServiceTest.java b/services/tests/security/forensic/src/com/android/server/security/forensic/ForensicServiceTest.java
new file mode 100644
index 000000000000..7aa2e0f609a7
--- /dev/null
+++ b/services/tests/security/forensic/src/com/android/server/security/forensic/ForensicServiceTest.java
@@ -0,0 +1,387 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.server.security.forensic;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+
+import android.annotation.SuppressLint;
+import android.content.Context;
+import android.os.Looper;
+import android.os.RemoteException;
+import android.os.test.TestLooper;
+import android.security.forensic.IForensicServiceCommandCallback;
+import android.security.forensic.IForensicServiceStateCallback;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+
+public class ForensicServiceTest {
+ private static final int STATE_UNKNOWN = IForensicServiceStateCallback.State.UNKNOWN;
+ private static final int STATE_INVISIBLE = IForensicServiceStateCallback.State.INVISIBLE;
+ private static final int STATE_VISIBLE = IForensicServiceStateCallback.State.VISIBLE;
+ private static final int STATE_ENABLED = IForensicServiceStateCallback.State.ENABLED;
+
+ private static final int ERROR_UNKNOWN = IForensicServiceCommandCallback.ErrorCode.UNKNOWN;
+ private static final int ERROR_PERMISSION_DENIED =
+ IForensicServiceCommandCallback.ErrorCode.PERMISSION_DENIED;
+ private static final int ERROR_INVALID_STATE_TRANSITION =
+ IForensicServiceCommandCallback.ErrorCode.INVALID_STATE_TRANSITION;
+ private static final int ERROR_BACKUP_TRANSPORT_UNAVAILABLE =
+ IForensicServiceCommandCallback.ErrorCode.BACKUP_TRANSPORT_UNAVAILABLE;
+ private static final int ERROR_DATA_SOURCE_UNAVAILABLE =
+ IForensicServiceCommandCallback.ErrorCode.DATA_SOURCE_UNAVAILABLE;
+
+ @Mock
+ private Context mContextSpy;
+
+ private ForensicService mForensicService;
+ private TestLooper mTestLooper;
+ private Looper mLooper;
+
+ @SuppressLint("VisibleForTests")
+ @Before
+ public void setUp() {
+ MockitoAnnotations.initMocks(this);
+
+ mTestLooper = new TestLooper();
+ mLooper = mTestLooper.getLooper();
+ mForensicService = new ForensicService(new MockInjector(mContextSpy));
+ mForensicService.onStart();
+ }
+
+ @Test
+ public void testMonitorState_Invisible() throws RemoteException {
+ StateCallback scb = new StateCallback();
+ assertEquals(STATE_UNKNOWN, scb.mState);
+ mForensicService.getBinderService().monitorState(scb);
+ mTestLooper.dispatchAll();
+ assertEquals(STATE_INVISIBLE, scb.mState);
+ }
+
+ @Test
+ public void testMonitorState_Invisible_TwoMonitors() throws RemoteException {
+ StateCallback scb1 = new StateCallback();
+ assertEquals(STATE_UNKNOWN, scb1.mState);
+ mForensicService.getBinderService().monitorState(scb1);
+ mTestLooper.dispatchAll();
+ assertEquals(STATE_INVISIBLE, scb1.mState);
+
+ StateCallback scb2 = new StateCallback();
+ assertEquals(STATE_UNKNOWN, scb2.mState);
+ mForensicService.getBinderService().monitorState(scb2);
+ mTestLooper.dispatchAll();
+ assertEquals(STATE_INVISIBLE, scb2.mState);
+ }
+
+ @Test
+ public void testMakeVisible_FromInvisible() throws RemoteException {
+ StateCallback scb = new StateCallback();
+ assertEquals(STATE_UNKNOWN, scb.mState);
+ mForensicService.getBinderService().monitorState(scb);
+ mTestLooper.dispatchAll();
+ assertEquals(STATE_INVISIBLE, scb.mState);
+
+ CommandCallback ccb = new CommandCallback();
+ mForensicService.getBinderService().makeVisible(ccb);
+ mTestLooper.dispatchAll();
+ assertEquals(STATE_VISIBLE, scb.mState);
+ assertNull(ccb.mErrorCode);
+ }
+
+ @Test
+ public void testMakeVisible_FromInvisible_TwoMonitors() throws RemoteException {
+ mForensicService.setState(STATE_INVISIBLE);
+ StateCallback scb1 = new StateCallback();
+ StateCallback scb2 = new StateCallback();
+ mForensicService.getBinderService().monitorState(scb1);
+ mForensicService.getBinderService().monitorState(scb2);
+ mTestLooper.dispatchAll();
+ assertEquals(STATE_INVISIBLE, scb1.mState);
+ assertEquals(STATE_INVISIBLE, scb2.mState);
+
+ CommandCallback ccb = new CommandCallback();
+ mForensicService.getBinderService().makeVisible(ccb);
+ mTestLooper.dispatchAll();
+ assertEquals(STATE_VISIBLE, scb1.mState);
+ assertEquals(STATE_VISIBLE, scb2.mState);
+ assertNull(ccb.mErrorCode);
+ }
+
+ @Test
+ public void testMakeVisible_FromVisible_TwoMonitors() throws RemoteException {
+ mForensicService.setState(STATE_VISIBLE);
+ StateCallback scb1 = new StateCallback();
+ StateCallback scb2 = new StateCallback();
+ mForensicService.getBinderService().monitorState(scb1);
+ mForensicService.getBinderService().monitorState(scb2);
+ mTestLooper.dispatchAll();
+ assertEquals(STATE_VISIBLE, scb1.mState);
+ assertEquals(STATE_VISIBLE, scb2.mState);
+
+ CommandCallback ccb = new CommandCallback();
+ mForensicService.getBinderService().makeVisible(ccb);
+ mTestLooper.dispatchAll();
+ assertEquals(STATE_VISIBLE, scb1.mState);
+ assertEquals(STATE_VISIBLE, scb2.mState);
+ assertNull(ccb.mErrorCode);
+ }
+
+ @Test
+ public void testMakeVisible_FromEnabled_TwoMonitors() throws RemoteException {
+ mForensicService.setState(STATE_ENABLED);
+ StateCallback scb1 = new StateCallback();
+ StateCallback scb2 = new StateCallback();
+ mForensicService.getBinderService().monitorState(scb1);
+ mForensicService.getBinderService().monitorState(scb2);
+ mTestLooper.dispatchAll();
+ assertEquals(STATE_ENABLED, scb1.mState);
+ assertEquals(STATE_ENABLED, scb2.mState);
+
+ CommandCallback ccb = new CommandCallback();
+ mForensicService.getBinderService().makeVisible(ccb);
+ mTestLooper.dispatchAll();
+ assertEquals(STATE_ENABLED, scb1.mState);
+ assertEquals(STATE_ENABLED, scb2.mState);
+ assertNotNull(ccb.mErrorCode);
+ assertEquals(ERROR_INVALID_STATE_TRANSITION, ccb.mErrorCode.intValue());
+ }
+
+ @Test
+ public void testMakeInvisible_FromInvisible_TwoMonitors() throws RemoteException {
+ mForensicService.setState(STATE_INVISIBLE);
+ StateCallback scb1 = new StateCallback();
+ StateCallback scb2 = new StateCallback();
+ mForensicService.getBinderService().monitorState(scb1);
+ mForensicService.getBinderService().monitorState(scb2);
+ mTestLooper.dispatchAll();
+ assertEquals(STATE_INVISIBLE, scb1.mState);
+ assertEquals(STATE_INVISIBLE, scb2.mState);
+
+ CommandCallback ccb = new CommandCallback();
+ mForensicService.getBinderService().makeInvisible(ccb);
+ mTestLooper.dispatchAll();
+ assertEquals(STATE_INVISIBLE, scb1.mState);
+ assertEquals(STATE_INVISIBLE, scb2.mState);
+ assertNull(ccb.mErrorCode);
+ }
+
+ @Test
+ public void testMakeInvisible_FromVisible_TwoMonitors() throws RemoteException {
+ mForensicService.setState(STATE_VISIBLE);
+ StateCallback scb1 = new StateCallback();
+ StateCallback scb2 = new StateCallback();
+ mForensicService.getBinderService().monitorState(scb1);
+ mForensicService.getBinderService().monitorState(scb2);
+ mTestLooper.dispatchAll();
+ assertEquals(STATE_VISIBLE, scb1.mState);
+ assertEquals(STATE_VISIBLE, scb2.mState);
+
+ CommandCallback ccb = new CommandCallback();
+ mForensicService.getBinderService().makeInvisible(ccb);
+ mTestLooper.dispatchAll();
+ assertEquals(STATE_INVISIBLE, scb1.mState);
+ assertEquals(STATE_INVISIBLE, scb2.mState);
+ assertNull(ccb.mErrorCode);
+ }
+
+ @Test
+ public void testMakeInvisible_FromEnabled_TwoMonitors() throws RemoteException {
+ mForensicService.setState(STATE_ENABLED);
+ StateCallback scb1 = new StateCallback();
+ StateCallback scb2 = new StateCallback();
+ mForensicService.getBinderService().monitorState(scb1);
+ mForensicService.getBinderService().monitorState(scb2);
+ mTestLooper.dispatchAll();
+ assertEquals(STATE_ENABLED, scb1.mState);
+ assertEquals(STATE_ENABLED, scb2.mState);
+
+ CommandCallback ccb = new CommandCallback();
+ mForensicService.getBinderService().makeInvisible(ccb);
+ mTestLooper.dispatchAll();
+ assertEquals(STATE_INVISIBLE, scb1.mState);
+ assertEquals(STATE_INVISIBLE, scb2.mState);
+ assertNull(ccb.mErrorCode);
+ }
+
+
+ @Test
+ public void testEnable_FromInvisible_TwoMonitors() throws RemoteException {
+ mForensicService.setState(STATE_INVISIBLE);
+ StateCallback scb1 = new StateCallback();
+ StateCallback scb2 = new StateCallback();
+ mForensicService.getBinderService().monitorState(scb1);
+ mForensicService.getBinderService().monitorState(scb2);
+ mTestLooper.dispatchAll();
+ assertEquals(STATE_INVISIBLE, scb1.mState);
+ assertEquals(STATE_INVISIBLE, scb2.mState);
+
+ CommandCallback ccb = new CommandCallback();
+ mForensicService.getBinderService().enable(ccb);
+ mTestLooper.dispatchAll();
+ assertEquals(STATE_INVISIBLE, scb1.mState);
+ assertEquals(STATE_INVISIBLE, scb2.mState);
+ assertNotNull(ccb.mErrorCode);
+ assertEquals(ERROR_INVALID_STATE_TRANSITION, ccb.mErrorCode.intValue());
+ }
+
+ @Test
+ public void testEnable_FromVisible_TwoMonitors() throws RemoteException {
+ mForensicService.setState(STATE_VISIBLE);
+ StateCallback scb1 = new StateCallback();
+ StateCallback scb2 = new StateCallback();
+ mForensicService.getBinderService().monitorState(scb1);
+ mForensicService.getBinderService().monitorState(scb2);
+ mTestLooper.dispatchAll();
+ assertEquals(STATE_VISIBLE, scb1.mState);
+ assertEquals(STATE_VISIBLE, scb2.mState);
+
+ CommandCallback ccb = new CommandCallback();
+ mForensicService.getBinderService().enable(ccb);
+ mTestLooper.dispatchAll();
+ assertEquals(STATE_ENABLED, scb1.mState);
+ assertEquals(STATE_ENABLED, scb2.mState);
+ assertNull(ccb.mErrorCode);
+ }
+
+ @Test
+ public void testEnable_FromEnabled_TwoMonitors() throws RemoteException {
+ mForensicService.setState(STATE_ENABLED);
+ StateCallback scb1 = new StateCallback();
+ StateCallback scb2 = new StateCallback();
+ mForensicService.getBinderService().monitorState(scb1);
+ mForensicService.getBinderService().monitorState(scb2);
+ mTestLooper.dispatchAll();
+ assertEquals(STATE_ENABLED, scb1.mState);
+ assertEquals(STATE_ENABLED, scb2.mState);
+
+ CommandCallback ccb = new CommandCallback();
+ mForensicService.getBinderService().enable(ccb);
+ mTestLooper.dispatchAll();
+ assertEquals(STATE_ENABLED, scb1.mState);
+ assertEquals(STATE_ENABLED, scb2.mState);
+ assertNull(ccb.mErrorCode);
+ }
+
+ @Test
+ public void testDisable_FromInvisible_TwoMonitors() throws RemoteException {
+ mForensicService.setState(STATE_INVISIBLE);
+ StateCallback scb1 = new StateCallback();
+ StateCallback scb2 = new StateCallback();
+ mForensicService.getBinderService().monitorState(scb1);
+ mForensicService.getBinderService().monitorState(scb2);
+ mTestLooper.dispatchAll();
+ assertEquals(STATE_INVISIBLE, scb1.mState);
+ assertEquals(STATE_INVISIBLE, scb2.mState);
+
+ CommandCallback ccb = new CommandCallback();
+ mForensicService.getBinderService().disable(ccb);
+ mTestLooper.dispatchAll();
+ assertEquals(STATE_INVISIBLE, scb1.mState);
+ assertEquals(STATE_INVISIBLE, scb2.mState);
+ assertNotNull(ccb.mErrorCode);
+ assertEquals(ERROR_INVALID_STATE_TRANSITION, ccb.mErrorCode.intValue());
+ }
+
+ @Test
+ public void testDisable_FromVisible_TwoMonitors() throws RemoteException {
+ mForensicService.setState(STATE_VISIBLE);
+ StateCallback scb1 = new StateCallback();
+ StateCallback scb2 = new StateCallback();
+ mForensicService.getBinderService().monitorState(scb1);
+ mForensicService.getBinderService().monitorState(scb2);
+ mTestLooper.dispatchAll();
+ assertEquals(STATE_VISIBLE, scb1.mState);
+ assertEquals(STATE_VISIBLE, scb2.mState);
+
+ CommandCallback ccb = new CommandCallback();
+ mForensicService.getBinderService().disable(ccb);
+ mTestLooper.dispatchAll();
+ assertEquals(STATE_VISIBLE, scb1.mState);
+ assertEquals(STATE_VISIBLE, scb2.mState);
+ assertNull(ccb.mErrorCode);
+ }
+
+ @Test
+ public void testDisable_FromEnabled_TwoMonitors() throws RemoteException {
+ mForensicService.setState(STATE_ENABLED);
+ StateCallback scb1 = new StateCallback();
+ StateCallback scb2 = new StateCallback();
+ mForensicService.getBinderService().monitorState(scb1);
+ mForensicService.getBinderService().monitorState(scb2);
+ mTestLooper.dispatchAll();
+ assertEquals(STATE_ENABLED, scb1.mState);
+ assertEquals(STATE_ENABLED, scb2.mState);
+
+ CommandCallback ccb = new CommandCallback();
+ mForensicService.getBinderService().disable(ccb);
+ mTestLooper.dispatchAll();
+ assertEquals(STATE_VISIBLE, scb1.mState);
+ assertEquals(STATE_VISIBLE, scb2.mState);
+ assertNull(ccb.mErrorCode);
+ }
+
+ private class MockInjector implements ForensicService.Injector {
+ private final Context mContext;
+
+ MockInjector(Context context) {
+ mContext = context;
+ }
+
+ @Override
+ public Context getContext() {
+ return mContext;
+ }
+
+
+ @Override
+ public Looper getLooper() {
+ return mLooper;
+ }
+
+ }
+
+ private static class StateCallback extends IForensicServiceStateCallback.Stub {
+ int mState = STATE_UNKNOWN;
+
+ @Override
+ public void onStateChange(int state) throws RemoteException {
+ mState = state;
+ }
+ }
+
+ private static class CommandCallback extends IForensicServiceCommandCallback.Stub {
+ Integer mErrorCode = null;
+
+ public void reset() {
+ mErrorCode = null;
+ }
+
+ @Override
+ public void onSuccess() throws RemoteException {
+
+ }
+
+ @Override
+ public void onFailure(int errorCode) throws RemoteException {
+ mErrorCode = errorCode;
+ }
+ }
+}
diff --git a/services/tests/servicestests/src/com/android/server/OWNERS b/services/tests/servicestests/src/com/android/server/OWNERS
index d49bc4326a5a..d8a9400d5180 100644
--- a/services/tests/servicestests/src/com/android/server/OWNERS
+++ b/services/tests/servicestests/src/com/android/server/OWNERS
@@ -1,4 +1,4 @@
-per-file *Alarm* = file:/apex/jobscheduler/OWNERS
+per-file *Alarm* = file:/apex/jobscheduler/ALARM_OWNERS
per-file *AppOp* = file:/core/java/android/permission/OWNERS
per-file *BinaryTransparency* = file:/core/java/android/transparency/OWNERS
per-file *Bluetooth* = file:platform/packages/modules/Bluetooth:master:/framework/OWNERS
diff --git a/services/tests/servicestests/src/com/android/server/am/BatteryStatsServiceTest.java b/services/tests/servicestests/src/com/android/server/am/BatteryStatsServiceTest.java
index 467c15dd2a75..ea70287466ff 100644
--- a/services/tests/servicestests/src/com/android/server/am/BatteryStatsServiceTest.java
+++ b/services/tests/servicestests/src/com/android/server/am/BatteryStatsServiceTest.java
@@ -55,6 +55,7 @@ public final class BatteryStatsServiceTest {
File systemDir = context.getCacheDir();
Handler handler = new Handler(mBgThread.getLooper());
mBatteryStatsService = new BatteryStatsService(context, systemDir);
+ mBatteryStatsService.setRailsStatsCollectionEnabled(false);
}
@After
diff --git a/services/tests/servicestests/src/com/android/server/integrity/AppIntegrityManagerServiceImplTest.java b/services/tests/servicestests/src/com/android/server/integrity/AppIntegrityManagerServiceImplTest.java
index d1f6c2f9f1f0..9c6412b81b34 100644
--- a/services/tests/servicestests/src/com/android/server/integrity/AppIntegrityManagerServiceImplTest.java
+++ b/services/tests/servicestests/src/com/android/server/integrity/AppIntegrityManagerServiceImplTest.java
@@ -67,10 +67,8 @@ import android.provider.Settings;
import androidx.test.InstrumentationRegistry;
import com.android.internal.R;
-import com.android.internal.pm.parsing.PackageParser2;
import com.android.server.compat.PlatformCompat;
import com.android.server.integrity.model.IntegrityCheckResult;
-import com.android.server.pm.parsing.TestPackageParser2;
import com.android.server.testutils.TestUtils;
import org.junit.After;
@@ -140,8 +138,6 @@ public class AppIntegrityManagerServiceImplTest {
@Mock IntegrityFileManager mIntegrityFileManager;
@Mock Handler mHandler;
- private Supplier<PackageParser2> mParserSupplier = TestPackageParser2::new;
-
private final Context mRealContext = InstrumentationRegistry.getTargetContext();
private PackageManager mSpyPackageManager;
@@ -173,7 +169,6 @@ public class AppIntegrityManagerServiceImplTest {
new AppIntegrityManagerServiceImpl(
mMockContext,
mPackageManagerInternal,
- mParserSupplier,
mIntegrityFileManager,
mHandler);
diff --git a/services/tests/servicestests/src/com/android/server/media/projection/MediaProjectionManagerServiceTest.java b/services/tests/servicestests/src/com/android/server/media/projection/MediaProjectionManagerServiceTest.java
index 7e22d74c64e1..b1d658cb1e86 100644
--- a/services/tests/servicestests/src/com/android/server/media/projection/MediaProjectionManagerServiceTest.java
+++ b/services/tests/servicestests/src/com/android/server/media/projection/MediaProjectionManagerServiceTest.java
@@ -25,6 +25,7 @@ import static android.media.projection.ReviewGrantedConsentResult.RECORD_CANCEL;
import static android.media.projection.ReviewGrantedConsentResult.RECORD_CONTENT_DISPLAY;
import static android.media.projection.ReviewGrantedConsentResult.RECORD_CONTENT_TASK;
import static android.media.projection.ReviewGrantedConsentResult.UNKNOWN;
+import static android.provider.Settings.Global.DISABLE_SCREEN_SHARE_PROTECTIONS_FOR_APPS_AND_NOTIFICATIONS;
import static android.view.ContentRecordingSession.TARGET_UID_FULL_SCREEN;
import static android.view.ContentRecordingSession.TARGET_UID_UNKNOWN;
import static android.view.ContentRecordingSession.createDisplaySession;
@@ -80,6 +81,7 @@ import android.os.test.TestLooper;
import android.platform.test.annotations.EnableFlags;
import android.platform.test.annotations.Presubmit;
import android.platform.test.flag.junit.SetFlagsRule;
+import android.provider.Settings;
import android.testing.TestableContext;
import android.view.ContentRecordingSession;
import android.view.ContentRecordingSession.RecordContent;
@@ -372,6 +374,50 @@ public class MediaProjectionManagerServiceTest {
});
}
+ @EnableFlags(android.companion.virtualdevice.flags
+ .Flags.FLAG_MEDIA_PROJECTION_KEYGUARD_RESTRICTIONS)
+ @Test
+ public void testCreateProjection_keyguardLocked_screenshareProtectionsDisabled()
+ throws NameNotFoundException {
+ MediaProjectionManagerService.MediaProjection projection = startProjectionPreconditions();
+ int value = Settings.Global.getInt(mContext.getContentResolver(),
+ DISABLE_SCREEN_SHARE_PROTECTIONS_FOR_APPS_AND_NOTIFICATIONS, 0);
+ try {
+ Settings.Global.putInt(mContext.getContentResolver(),
+ DISABLE_SCREEN_SHARE_PROTECTIONS_FOR_APPS_AND_NOTIFICATIONS, 1);
+ doReturn(true).when(mKeyguardManager).isKeyguardLocked();
+
+ doReturn(PackageManager.PERMISSION_DENIED).when(mPackageManager).checkPermission(
+ RECORD_SENSITIVE_CONTENT, projection.packageName);
+
+ projection.start(mIMediaProjectionCallback);
+ projection.notifyVirtualDisplayCreated(10);
+
+ // The projection was started because it was allowed to capture the keyguard.
+ assertThat(mService.getActiveProjectionInfo()).isNotNull();
+ } finally {
+ Settings.Global.putInt(mContext.getContentResolver(),
+ DISABLE_SCREEN_SHARE_PROTECTIONS_FOR_APPS_AND_NOTIFICATIONS, value);
+ }
+ }
+
+ @EnableFlags(android.companion.virtualdevice.flags
+ .Flags.FLAG_MEDIA_PROJECTION_KEYGUARD_RESTRICTIONS)
+ @Test
+ public void testCreateProjection_keyguardLocked_noDisplayCreated()
+ throws NameNotFoundException {
+ MediaProjectionManagerService.MediaProjection projection = startProjectionPreconditions();
+ doReturn(true).when(mKeyguardManager).isKeyguardLocked();
+
+ doReturn(PackageManager.PERMISSION_DENIED).when(mPackageManager).checkPermission(
+ RECORD_SENSITIVE_CONTENT, projection.packageName);
+
+ projection.start(mIMediaProjectionCallback);
+
+ // The projection was started because it was allowed to capture the keyguard.
+ assertThat(mService.getActiveProjectionInfo()).isNotNull();
+ }
+
@Test
public void testCreateProjection_attemptReuse_noPriorProjectionGrant()
throws NameNotFoundException {
@@ -485,6 +531,7 @@ public class MediaProjectionManagerServiceTest {
MediaProjectionManagerService.MediaProjection projection =
startProjectionPreconditions(service);
projection.start(mIMediaProjectionCallback);
+ projection.notifyVirtualDisplayCreated(10);
assertThat(service.getActiveProjectionInfo()).isNotNull();
@@ -507,6 +554,7 @@ public class MediaProjectionManagerServiceTest {
MediaProjectionManagerService.MediaProjection projection =
startProjectionPreconditions(service);
projection.start(mIMediaProjectionCallback);
+ projection.notifyVirtualDisplayCreated(10);
assertThat(service.getActiveProjectionInfo()).isNotNull();
diff --git a/services/tests/servicestests/src/com/android/server/pm/UserManagerTest.java b/services/tests/servicestests/src/com/android/server/pm/UserManagerTest.java
index e652df5cdf1a..f9946604ad5d 100644
--- a/services/tests/servicestests/src/com/android/server/pm/UserManagerTest.java
+++ b/services/tests/servicestests/src/com/android/server/pm/UserManagerTest.java
@@ -539,6 +539,79 @@ public final class UserManagerTest {
@MediumTest
@Test
+ public void testRemoveUser_shouldRemovePrivateUser() {
+ UserInfo privateProfileUser =
+ createProfileForUser(
+ "Private profile",
+ UserManager.USER_TYPE_PROFILE_PRIVATE,
+ mUserManager.getMainUser().getIdentifier());
+ assertThat(privateProfileUser).isNotNull();
+ assertThat(hasUser(privateProfileUser.id)).isTrue();
+
+ removeUser(privateProfileUser.id);
+
+ assertThat(hasUser(privateProfileUser.id)).isFalse();
+ }
+
+ @MediumTest
+ @Test
+ @RequiresFlagsEnabled(
+ android.multiuser.Flags.FLAG_IGNORE_RESTRICTIONS_WHEN_DELETING_PRIVATE_PROFILE)
+ public void testRemoveUser_shouldRemovePrivateUser_withDisallowRemoveUserRestriction() {
+ UserHandle mainUser = mUserManager.getMainUser();
+ mUserManager.setUserRestriction(
+ UserManager.DISALLOW_REMOVE_USER, /* value= */ true, mainUser);
+ try {
+ UserInfo privateProfileUser =
+ createProfileForUser(
+ "Private profile",
+ UserManager.USER_TYPE_PROFILE_PRIVATE,
+ mainUser.getIdentifier());
+ assertThat(privateProfileUser).isNotNull();
+ assertThat(hasUser(privateProfileUser.id)).isTrue();
+ removeUser(privateProfileUser.id);
+
+ assertThat(hasUser(privateProfileUser.id)).isFalse();
+ } finally {
+ mUserManager.setUserRestriction(
+ UserManager.DISALLOW_REMOVE_USER, /* value= */ false, mainUser);
+ }
+ }
+
+ @MediumTest
+ @Test
+ public void testRemoveUser_withDisallowRemoveUserRestrictionAndMultipleUsersPresent() {
+ UserInfo privateProfileUser =
+ createProfileForUser(
+ "Private profile",
+ UserManager.USER_TYPE_PROFILE_PRIVATE,
+ mUserManager.getMainUser().getIdentifier());
+ assertThat(privateProfileUser).isNotNull();
+ assertThat(hasUser(privateProfileUser.id)).isTrue();
+ UserInfo testUser = createUser("TestUser", /* flags= */ 0);
+ assertThat(testUser).isNotNull();
+ assertThat(hasUser(testUser.id)).isTrue();
+ UserHandle mainUser = mUserManager.getMainUser();
+ mUserManager.setUserRestriction(
+ UserManager.DISALLOW_REMOVE_USER, /* value= */ true, mainUser);
+ try {
+ assertThat(
+ mUserManager.removeUserWhenPossible(
+ testUser.getUserHandle(), /* overrideDevicePolicy= */ false))
+ .isEqualTo(UserManager.REMOVE_RESULT_ERROR_USER_RESTRICTION);
+
+ // Non private profile users should be prevented from being removed.
+ assertThat(mUserManager.removeUser(testUser.id)).isEqualTo(false);
+
+ assertThat(hasUser(testUser.id)).isTrue();
+ } finally {
+ mUserManager.setUserRestriction(
+ UserManager.DISALLOW_REMOVE_USER, /* value= */ false, mainUser);
+ }
+ }
+
+ @MediumTest
+ @Test
public void testRemoveUserShouldNotRemoveTargetUser_DuringUserSwitch() {
final int startUser = ActivityManager.getCurrentUser();
final UserInfo testUser = createUser("TestUser", /* flags= */ 0);
diff --git a/services/tests/servicestests/src/com/android/server/security/advancedprotection/AdvancedProtectionServiceTest.java b/services/tests/servicestests/src/com/android/server/security/advancedprotection/AdvancedProtectionServiceTest.java
new file mode 100644
index 000000000000..727b435aa743
--- /dev/null
+++ b/services/tests/servicestests/src/com/android/server/security/advancedprotection/AdvancedProtectionServiceTest.java
@@ -0,0 +1,93 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.server.security.advancedprotection;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertThrows;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.Mockito.mock;
+
+import android.Manifest;
+import android.annotation.SuppressLint;
+import android.content.Context;
+import android.os.RemoteException;
+import android.os.test.FakePermissionEnforcer;
+import android.os.test.TestLooper;
+import android.provider.Settings;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
+
+@RunWith(JUnit4.class)
+public class AdvancedProtectionServiceTest {
+ private AdvancedProtectionService mService;
+ private FakePermissionEnforcer mPermissionEnforcer;
+ private Context mContext;
+
+ @Before
+ @SuppressLint("VisibleForTests")
+ public void setup() throws Settings.SettingNotFoundException {
+ mContext = mock(Context.class);
+ mPermissionEnforcer = new FakePermissionEnforcer();
+ mPermissionEnforcer.grant(Manifest.permission.SET_ADVANCED_PROTECTION_MODE);
+ mPermissionEnforcer.grant(Manifest.permission.QUERY_ADVANCED_PROTECTION_MODE);
+
+ AdvancedProtectionService.AdvancedProtectionStore store =
+ new AdvancedProtectionService.AdvancedProtectionStore(mContext) {
+ private boolean mEnabled = false;
+
+ @Override
+ boolean retrieve() {
+ return mEnabled;
+ }
+
+ @Override
+ void store(boolean enabled) {
+ this.mEnabled = enabled;
+ }
+ };
+
+ mService = new AdvancedProtectionService(mContext, store, new TestLooper().getLooper(),
+ mPermissionEnforcer);
+ }
+
+ @Test
+ public void testEnableProtection() throws RemoteException {
+ mService.setAdvancedProtectionEnabled(true);
+ assertTrue(mService.isAdvancedProtectionEnabled());
+ }
+
+ @Test
+ public void testDisableProtection() throws RemoteException {
+ mService.setAdvancedProtectionEnabled(false);
+ assertFalse(mService.isAdvancedProtectionEnabled());
+ }
+
+ @Test
+ public void testSetProtection_withoutPermission() {
+ mPermissionEnforcer.revoke(Manifest.permission.SET_ADVANCED_PROTECTION_MODE);
+ assertThrows(SecurityException.class, () -> mService.setAdvancedProtectionEnabled(true));
+ }
+
+ @Test
+ public void testGetProtection_withoutPermission() {
+ mPermissionEnforcer.revoke(Manifest.permission.QUERY_ADVANCED_PROTECTION_MODE);
+ assertThrows(SecurityException.class, () -> mService.isAdvancedProtectionEnabled());
+ }
+}
diff --git a/services/tests/servicestests/src/com/android/server/usage/AppStandbyControllerTests.java b/services/tests/servicestests/src/com/android/server/usage/AppStandbyControllerTests.java
index 89056cc34795..9a7abd43aab6 100644
--- a/services/tests/servicestests/src/com/android/server/usage/AppStandbyControllerTests.java
+++ b/services/tests/servicestests/src/com/android/server/usage/AppStandbyControllerTests.java
@@ -93,7 +93,10 @@ import android.os.Handler;
import android.os.Looper;
import android.os.RemoteException;
import android.os.UserHandle;
+import android.platform.test.annotations.DisableFlags;
+import android.platform.test.annotations.EnableFlags;
import android.platform.test.annotations.Presubmit;
+import android.platform.test.flag.junit.SetFlagsRule;
import android.provider.DeviceConfig;
import android.util.ArraySet;
import android.util.Pair;
@@ -111,6 +114,7 @@ import com.android.server.usage.AppStandbyInternal.AppIdleStateChangeListener;
import org.junit.After;
import org.junit.Before;
import org.junit.Ignore;
+import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
@@ -185,6 +189,9 @@ public class AppStandbyControllerTests {
private static final Random sRandom = new Random();
+ @Rule
+ public final SetFlagsRule mSetFlagsRule = new SetFlagsRule();
+
private MyInjector mInjector;
private AppStandbyController mController;
@@ -894,7 +901,8 @@ public class AppStandbyControllerTests {
}
@Test
- public void testScreenTimeAndBuckets() throws Exception {
+ @DisableFlags(Flags.FLAG_SCREEN_TIME_BYPASS)
+ public void testScreenTimeAndBuckets_Legacy() throws Exception {
mInjector.setDisplayOn(false);
assertTimeout(mController, 0, STANDBY_BUCKET_NEVER);
@@ -917,6 +925,31 @@ public class AppStandbyControllerTests {
}
@Test
+ @EnableFlags(Flags.FLAG_SCREEN_TIME_BYPASS)
+ public void testScreenTimeAndBuckets_Bypass() throws Exception {
+ mInjector.setDisplayOn(false);
+
+ assertTimeout(mController, 0, STANDBY_BUCKET_NEVER);
+
+ reportEvent(mController, USER_INTERACTION, 0, PACKAGE_1);
+
+ // ACTIVE bucket
+ assertTimeout(mController, WORKING_SET_THRESHOLD - 1, STANDBY_BUCKET_ACTIVE);
+
+ // WORKING_SET bucket
+ assertTimeout(mController, WORKING_SET_THRESHOLD + 1, STANDBY_BUCKET_WORKING_SET);
+
+ // RARE bucket, should failed due to timeout hasn't reached yet.
+ mInjector.mElapsedRealtime = RARE_THRESHOLD - 1;
+ mController.checkIdleStates(USER_ID);
+ waitAndAssertNotBucket(STANDBY_BUCKET_RARE, PACKAGE_1);
+
+ mInjector.setDisplayOn(true);
+ // screen on time doesn't count.
+ assertTimeout(mController, RARE_THRESHOLD + 1, STANDBY_BUCKET_RARE);
+ }
+
+ @Test
public void testForcedIdle() throws Exception {
mController.forceIdleState(PACKAGE_1, USER_ID, true);
waitAndAssertBucket(STANDBY_BUCKET_RARE, PACKAGE_1);
diff --git a/services/tests/uiservicestests/src/com/android/server/notification/ManagedServicesTest.java b/services/tests/uiservicestests/src/com/android/server/notification/ManagedServicesTest.java
index 48bc9d7c51a1..b5724b5c0cc8 100644
--- a/services/tests/uiservicestests/src/com/android/server/notification/ManagedServicesTest.java
+++ b/services/tests/uiservicestests/src/com/android/server/notification/ManagedServicesTest.java
@@ -21,8 +21,10 @@ import static android.os.UserManager.USER_TYPE_FULL_SECONDARY;
import static android.os.UserManager.USER_TYPE_PROFILE_CLONE;
import static android.os.UserManager.USER_TYPE_PROFILE_MANAGED;
import static android.os.UserManager.USER_TYPE_PROFILE_PRIVATE;
+import static android.platform.test.flag.junit.SetFlagsRule.DefaultInitValueType.DEVICE_DEFAULT;
import static android.service.notification.NotificationListenerService.META_DATA_DEFAULT_AUTOBIND;
+import static com.android.server.notification.Flags.FLAG_NOTIFICATION_NLS_REBIND;
import static com.android.server.notification.ManagedServices.APPROVAL_BY_COMPONENT;
import static com.android.server.notification.ManagedServices.APPROVAL_BY_PACKAGE;
import static com.android.server.notification.NotificationManagerService.privateSpaceFlagsEnabled;
@@ -63,11 +65,14 @@ import android.os.Build;
import android.os.Bundle;
import android.os.IBinder;
import android.os.IInterface;
+import android.os.Looper;
import android.os.RemoteException;
import android.os.UserHandle;
import android.os.UserManager;
import android.platform.test.annotations.EnableFlags;
+import android.platform.test.flag.junit.SetFlagsRule;
import android.provider.Settings;
+import android.testing.TestableLooper;
import android.text.TextUtils;
import android.util.ArrayMap;
import android.util.ArraySet;
@@ -82,7 +87,9 @@ import com.android.server.UiServiceTestCase;
import com.google.android.collect.Lists;
+import org.junit.After;
import org.junit.Before;
+import org.junit.Rule;
import org.junit.Test;
import org.mockito.ArgumentCaptor;
import org.mockito.Mock;
@@ -103,7 +110,10 @@ import java.util.List;
import java.util.Set;
import java.util.concurrent.CountDownLatch;
+
public class ManagedServicesTest extends UiServiceTestCase {
+ @Rule
+ public final SetFlagsRule mSetFlagsRule = new SetFlagsRule(DEVICE_DEFAULT);
@Mock
private IPackageManager mIpm;
@@ -115,6 +125,7 @@ public class ManagedServicesTest extends UiServiceTestCase {
private ManagedServices.UserProfiles mUserProfiles;
@Mock private DevicePolicyManager mDpm;
Object mLock = new Object();
+ private TestableLooper mTestableLooper;
UserInfo mZero = new UserInfo(0, "zero", 0);
UserInfo mTen = new UserInfo(10, "ten", 0);
@@ -142,6 +153,7 @@ public class ManagedServicesTest extends UiServiceTestCase {
@Before
public void setUp() throws Exception {
MockitoAnnotations.initMocks(this);
+ mTestableLooper = new TestableLooper(Looper.getMainLooper());
mContext.setMockPackageManager(mPm);
mContext.addMockSystemService(Context.USER_SERVICE, mUm);
@@ -199,6 +211,11 @@ public class ManagedServicesTest extends UiServiceTestCase {
mIpm, APPROVAL_BY_COMPONENT);
}
+ @After
+ public void tearDown() throws Exception {
+ mTestableLooper.destroy();
+ }
+
@Test
public void testBackupAndRestore_migration() throws Exception {
for (int approvalLevel : new int[] {APPROVAL_BY_COMPONENT, APPROVAL_BY_PACKAGE}) {
@@ -888,7 +905,7 @@ public class ManagedServicesTest extends UiServiceTestCase {
return true;
});
- mockServiceInfoWithMetaData(List.of(cn), service, new ArrayMap<>());
+ mockServiceInfoWithMetaData(List.of(cn), service, pm, new ArrayMap<>());
service.addApprovedList("a", 0, true);
service.reregisterService(cn, 0);
@@ -919,7 +936,7 @@ public class ManagedServicesTest extends UiServiceTestCase {
return true;
});
- mockServiceInfoWithMetaData(List.of(cn), service, new ArrayMap<>());
+ mockServiceInfoWithMetaData(List.of(cn), service, pm, new ArrayMap<>());
service.addApprovedList("a", 0, false);
service.reregisterService(cn, 0);
@@ -950,7 +967,7 @@ public class ManagedServicesTest extends UiServiceTestCase {
return true;
});
- mockServiceInfoWithMetaData(List.of(cn), service, new ArrayMap<>());
+ mockServiceInfoWithMetaData(List.of(cn), service, pm, new ArrayMap<>());
service.addApprovedList("a/a", 0, true);
service.reregisterService(cn, 0);
@@ -981,7 +998,7 @@ public class ManagedServicesTest extends UiServiceTestCase {
return true;
});
- mockServiceInfoWithMetaData(List.of(cn), service, new ArrayMap<>());
+ mockServiceInfoWithMetaData(List.of(cn), service, pm, new ArrayMap<>());
service.addApprovedList("a/a", 0, false);
service.reregisterService(cn, 0);
@@ -1053,6 +1070,78 @@ public class ManagedServicesTest extends UiServiceTestCase {
}
@Test
+ @EnableFlags(FLAG_NOTIFICATION_NLS_REBIND)
+ public void registerService_bindingDied_rebindIsClearedOnUserSwitch() throws Exception {
+ Context context = mock(Context.class);
+ PackageManager pm = mock(PackageManager.class);
+ ApplicationInfo ai = new ApplicationInfo();
+ ai.targetSdkVersion = Build.VERSION_CODES.CUR_DEVELOPMENT;
+
+ when(context.getPackageName()).thenReturn(mPkg);
+ when(context.getUserId()).thenReturn(mUser.getIdentifier());
+ when(context.getPackageManager()).thenReturn(pm);
+ when(pm.getApplicationInfo(anyString(), anyInt())).thenReturn(ai);
+
+ ManagedServices service = new TestManagedServices(context, mLock, mUserProfiles, mIpm,
+ APPROVAL_BY_PACKAGE);
+ service = spy(service);
+ ComponentName cn = ComponentName.unflattenFromString("a/a");
+
+ // Trigger onBindingDied for component when registering
+ // => will schedule a rebind in 10 seconds
+ when(context.bindServiceAsUser(any(), any(), anyInt(), any())).thenAnswer(invocation -> {
+ Object[] args = invocation.getArguments();
+ ServiceConnection sc = (ServiceConnection) args[1];
+ sc.onBindingDied(cn);
+ return true;
+ });
+ service.registerService(cn, 0);
+ assertThat(service.isBound(cn, 0)).isFalse();
+
+ // Switch to user 10
+ service.onUserSwitched(10);
+
+ // Check that the scheduled rebind for user 0 was cleared
+ mTestableLooper.moveTimeForward(ManagedServices.ON_BINDING_DIED_REBIND_DELAY_MS);
+ mTestableLooper.processAllMessages();
+ verify(service, never()).reregisterService(any(), anyInt());
+ }
+
+ @Test
+ public void registerService_bindingDied_rebindIsExecutedAfterTimeout() throws Exception {
+ Context context = mock(Context.class);
+ PackageManager pm = mock(PackageManager.class);
+ ApplicationInfo ai = new ApplicationInfo();
+ ai.targetSdkVersion = Build.VERSION_CODES.CUR_DEVELOPMENT;
+
+ when(context.getPackageName()).thenReturn(mPkg);
+ when(context.getUserId()).thenReturn(mUser.getIdentifier());
+ when(context.getPackageManager()).thenReturn(pm);
+ when(pm.getApplicationInfo(anyString(), anyInt())).thenReturn(ai);
+
+ ManagedServices service = new TestManagedServices(context, mLock, mUserProfiles, mIpm,
+ APPROVAL_BY_PACKAGE);
+ service = spy(service);
+ ComponentName cn = ComponentName.unflattenFromString("a/a");
+
+ // Trigger onBindingDied for component when registering
+ // => will schedule a rebind in 10 seconds
+ when(context.bindServiceAsUser(any(), any(), anyInt(), any())).thenAnswer(invocation -> {
+ Object[] args = invocation.getArguments();
+ ServiceConnection sc = (ServiceConnection) args[1];
+ sc.onBindingDied(cn);
+ return true;
+ });
+ service.registerService(cn, 0);
+ assertThat(service.isBound(cn, 0)).isFalse();
+
+ // Check that the scheduled rebind is run
+ mTestableLooper.moveTimeForward(ManagedServices.ON_BINDING_DIED_REBIND_DELAY_MS);
+ mTestableLooper.processAllMessages();
+ verify(service, times(1)).reregisterService(eq(cn), eq(0));
+ }
+
+ @Test
public void testPackageUninstall_packageNoLongerInApprovedList() throws Exception {
for (int approvalLevel : new int[] {APPROVAL_BY_COMPONENT, APPROVAL_BY_PACKAGE}) {
ManagedServices service = new TestManagedServices(getContext(), mLock, mUserProfiles,
@@ -1211,6 +1300,65 @@ public class ManagedServicesTest extends UiServiceTestCase {
}
@Test
+ @EnableFlags(FLAG_NOTIFICATION_NLS_REBIND)
+ public void testUpgradeAppNoIntentFilterNoRebind() throws Exception {
+ Context context = spy(getContext());
+ doReturn(true).when(context).bindServiceAsUser(any(), any(), anyInt(), any());
+
+ ManagedServices service = new TestManagedServices(context, mLock, mUserProfiles,
+ mIpm, APPROVAL_BY_COMPONENT);
+
+ List<String> packages = new ArrayList<>();
+ packages.add("package");
+ addExpectedServices(service, packages, 0);
+
+ final ComponentName unapprovedComponent = ComponentName.unflattenFromString("package/C1");
+ final ComponentName approvedComponent = ComponentName.unflattenFromString("package/C2");
+
+ // Both components are approved initially
+ mExpectedPrimaryComponentNames.clear();
+ mExpectedPrimaryPackages.clear();
+ mExpectedPrimaryComponentNames.put(0, "package/C1:package/C2");
+ mExpectedSecondaryComponentNames.clear();
+ mExpectedSecondaryPackages.clear();
+
+ loadXml(service);
+
+ //Component package/C1 loses serviceInterface intent filter
+ ManagedServices.Config config = service.getConfig();
+ when(mPm.queryIntentServicesAsUser(any(), anyInt(), anyInt()))
+ .thenAnswer(new Answer<List<ResolveInfo>>() {
+ @Override
+ public List<ResolveInfo> answer(InvocationOnMock invocationOnMock)
+ throws Throwable {
+ Object[] args = invocationOnMock.getArguments();
+ Intent invocationIntent = (Intent) args[0];
+ if (invocationIntent != null) {
+ if (invocationIntent.getAction().equals(config.serviceInterface)
+ && packages.contains(invocationIntent.getPackage())) {
+ List<ResolveInfo> dummyServices = new ArrayList<>();
+ ResolveInfo resolveInfo = new ResolveInfo();
+ ServiceInfo serviceInfo = new ServiceInfo();
+ serviceInfo.packageName = invocationIntent.getPackage();
+ serviceInfo.name = approvedComponent.getClassName();
+ serviceInfo.permission = service.getConfig().bindPermission;
+ resolveInfo.serviceInfo = serviceInfo;
+ dummyServices.add(resolveInfo);
+ return dummyServices;
+ }
+ }
+ return new ArrayList<>();
+ }
+ });
+
+ // Trigger package update
+ service.onPackagesChanged(false, new String[]{"package"}, new int[]{0});
+
+ assertFalse(service.isComponentEnabledForCurrentProfiles(unapprovedComponent));
+ assertTrue(service.isComponentEnabledForCurrentProfiles(approvedComponent));
+ }
+
+ @Test
public void testSetPackageOrComponentEnabled() throws Exception {
for (int approvalLevel : new int[] {APPROVAL_BY_COMPONENT, APPROVAL_BY_PACKAGE}) {
ManagedServices service = new TestManagedServices(getContext(), mLock, mUserProfiles,
@@ -1223,6 +1371,21 @@ public class ManagedServicesTest extends UiServiceTestCase {
"user10package1/K", "user10.3/Component", "user10package2/L",
"user10.4/Component"}));
+ // mock permissions for services
+ PackageManager pm = mock(PackageManager.class);
+ when(getContext().getPackageManager()).thenReturn(pm);
+ List<ComponentName> enabledComponents = List.of(
+ ComponentName.unflattenFromString("package/Comp"),
+ ComponentName.unflattenFromString("package/C2"),
+ ComponentName.unflattenFromString("again/M4"),
+ ComponentName.unflattenFromString("user10package/B"),
+ ComponentName.unflattenFromString("user10/Component"),
+ ComponentName.unflattenFromString("user10package1/K"),
+ ComponentName.unflattenFromString("user10.3/Component"),
+ ComponentName.unflattenFromString("user10package2/L"),
+ ComponentName.unflattenFromString("user10.4/Component"));
+ mockServiceInfoWithMetaData(enabledComponents, service, pm, new ArrayMap<>());
+
for (int userId : expectedEnabled.keySet()) {
ArrayList<String> expectedForUser = expectedEnabled.get(userId);
for (int i = 0; i < expectedForUser.size(); i++) {
@@ -1284,6 +1447,90 @@ public class ManagedServicesTest extends UiServiceTestCase {
}
@Test
+ @EnableFlags(FLAG_NOTIFICATION_NLS_REBIND)
+ public void testSetPackageOrComponentEnabled_pkgInstalledAfterEnabling() throws Exception {
+ ManagedServices service = new TestManagedServices(getContext(), mLock, mUserProfiles,
+ mIpm, APPROVAL_BY_COMPONENT);
+
+ final int userId = 0;
+ final String validComponent = "again/M4";
+ ArrayList<String> expectedEnabled = Lists.newArrayList("package/Comp", "package/C2",
+ validComponent);
+
+ PackageManager pm = mock(PackageManager.class);
+ when(getContext().getPackageManager()).thenReturn(pm);
+ service = spy(service);
+
+ // Component again/M4 is a valid service and the package is available
+ doReturn(true).when(service)
+ .isValidService(ComponentName.unflattenFromString(validComponent), userId);
+ when(pm.isPackageAvailable("again")).thenReturn(true);
+
+ // "package" is not available and its services are not valid
+ doReturn(false).when(service)
+ .isValidService(ComponentName.unflattenFromString("package/Comp"), userId);
+ doReturn(false).when(service)
+ .isValidService(ComponentName.unflattenFromString("package/C2"), userId);
+ when(pm.isPackageAvailable("package")).thenReturn(false);
+
+ // Enable all components
+ for (String component: expectedEnabled) {
+ service.setPackageOrComponentEnabled(component, userId, true, true);
+ }
+
+ // Verify everything added is approved
+ for (String component: expectedEnabled) {
+ assertTrue("Not allowed: user: " + userId + " entry: " + component
+ + " for approval level " + APPROVAL_BY_COMPONENT,
+ service.isPackageOrComponentAllowed(component, userId));
+ }
+
+ // Add missing package "package"
+ service.onPackagesChanged(false, new String[]{"package"}, new int[]{0});
+
+ // Check that component of "package" are not enabled
+ assertFalse(service.isComponentEnabledForCurrentProfiles(
+ ComponentName.unflattenFromString("package/Comp")));
+ assertFalse(service.isPackageOrComponentAllowed("package/Comp", userId));
+
+ assertFalse(service.isComponentEnabledForCurrentProfiles(
+ ComponentName.unflattenFromString("package/C2")));
+ assertFalse(service.isPackageOrComponentAllowed("package/C2", userId));
+
+ // Check that the valid components are still enabled
+ assertTrue(service.isComponentEnabledForCurrentProfiles(
+ ComponentName.unflattenFromString(validComponent)));
+ assertTrue(service.isPackageOrComponentAllowed(validComponent, userId));
+ }
+
+ @Test
+ @EnableFlags(FLAG_NOTIFICATION_NLS_REBIND)
+ public void testSetPackageOrComponentEnabled_invalidComponent() throws Exception {
+ ManagedServices service = new TestManagedServices(getContext(), mLock, mUserProfiles,
+ mIpm, APPROVAL_BY_COMPONENT);
+
+ final int userId = 0;
+ final String invalidComponent = "package/Comp";
+
+ PackageManager pm = mock(PackageManager.class);
+ when(getContext().getPackageManager()).thenReturn(pm);
+ service = spy(service);
+
+ // Component is an invalid service and the package is available
+ doReturn(false).when(service)
+ .isValidService(ComponentName.unflattenFromString(invalidComponent), userId);
+ when(pm.isPackageAvailable("package")).thenReturn(true);
+ service.setPackageOrComponentEnabled(invalidComponent, userId, true, true);
+
+ // Verify that the component was not enabled
+ assertFalse("Not allowed: user: " + userId + " entry: " + invalidComponent
+ + " for approval level " + APPROVAL_BY_COMPONENT,
+ service.isPackageOrComponentAllowed(invalidComponent, userId));
+ assertFalse(service.isComponentEnabledForCurrentProfiles(
+ ComponentName.unflattenFromString(invalidComponent)));
+ }
+
+ @Test
public void testGetAllowedPackages_byUser() throws Exception {
for (int approvalLevel : new int[] {APPROVAL_BY_COMPONENT, APPROVAL_BY_PACKAGE}) {
ManagedServices service = new TestManagedServices(getContext(), mLock, mUserProfiles,
@@ -1944,7 +2191,7 @@ public class ManagedServicesTest extends UiServiceTestCase {
metaDataAutobindAllow.putBoolean(META_DATA_DEFAULT_AUTOBIND, true);
metaDatas.put(cn_allowed, metaDataAutobindAllow);
- mockServiceInfoWithMetaData(componentNames, service, metaDatas);
+ mockServiceInfoWithMetaData(componentNames, service, pm, metaDatas);
service.addApprovedList(cn_allowed.flattenToString(), 0, true);
service.addApprovedList(cn_disallowed.flattenToString(), 0, true);
@@ -1989,7 +2236,7 @@ public class ManagedServicesTest extends UiServiceTestCase {
metaDataAutobindDisallow.putBoolean(META_DATA_DEFAULT_AUTOBIND, false);
metaDatas.put(cn_disallowed, metaDataAutobindDisallow);
- mockServiceInfoWithMetaData(componentNames, service, metaDatas);
+ mockServiceInfoWithMetaData(componentNames, service, pm, metaDatas);
service.addApprovedList(cn_disallowed.flattenToString(), 0, true);
@@ -2028,7 +2275,7 @@ public class ManagedServicesTest extends UiServiceTestCase {
metaDataAutobindDisallow.putBoolean(META_DATA_DEFAULT_AUTOBIND, false);
metaDatas.put(cn_disallowed, metaDataAutobindDisallow);
- mockServiceInfoWithMetaData(componentNames, service, metaDatas);
+ mockServiceInfoWithMetaData(componentNames, service, pm, metaDatas);
service.addApprovedList(cn_disallowed.flattenToString(), 0, true);
@@ -2099,8 +2346,8 @@ public class ManagedServicesTest extends UiServiceTestCase {
}
private void mockServiceInfoWithMetaData(List<ComponentName> componentNames,
- ManagedServices service, ArrayMap<ComponentName, Bundle> metaDatas)
- throws RemoteException {
+ ManagedServices service, PackageManager packageManager,
+ ArrayMap<ComponentName, Bundle> metaDatas) throws RemoteException {
when(mIpm.getServiceInfo(any(), anyLong(), anyInt())).thenAnswer(
(Answer<ServiceInfo>) invocation -> {
ComponentName invocationCn = invocation.getArgument(0);
@@ -2115,6 +2362,39 @@ public class ManagedServicesTest extends UiServiceTestCase {
return null;
}
);
+
+ // add components to queryIntentServicesAsUser response
+ final List<String> packages = new ArrayList<>();
+ for (ComponentName cn: componentNames) {
+ packages.add(cn.getPackageName());
+ }
+ ManagedServices.Config config = service.getConfig();
+ when(packageManager.queryIntentServicesAsUser(any(), anyInt(), anyInt())).
+ thenAnswer(new Answer<List<ResolveInfo>>() {
+ @Override
+ public List<ResolveInfo> answer(InvocationOnMock invocationOnMock)
+ throws Throwable {
+ Object[] args = invocationOnMock.getArguments();
+ Intent invocationIntent = (Intent) args[0];
+ if (invocationIntent != null) {
+ if (invocationIntent.getAction().equals(config.serviceInterface)
+ && packages.contains(invocationIntent.getPackage())) {
+ List<ResolveInfo> dummyServices = new ArrayList<>();
+ for (ComponentName cn: componentNames) {
+ ResolveInfo resolveInfo = new ResolveInfo();
+ ServiceInfo serviceInfo = new ServiceInfo();
+ serviceInfo.packageName = invocationIntent.getPackage();
+ serviceInfo.name = cn.getClassName();
+ serviceInfo.permission = service.getConfig().bindPermission;
+ resolveInfo.serviceInfo = serviceInfo;
+ dummyServices.add(resolveInfo);
+ }
+ return dummyServices;
+ }
+ }
+ return new ArrayList<>();
+ }
+ });
}
private void resetComponentsAndPackages() {
diff --git a/services/tests/uiservicestests/src/com/android/server/notification/NotificationAssistantsTest.java b/services/tests/uiservicestests/src/com/android/server/notification/NotificationAssistantsTest.java
index 0f7de7d78ccf..2c645e0ca353 100644
--- a/services/tests/uiservicestests/src/com/android/server/notification/NotificationAssistantsTest.java
+++ b/services/tests/uiservicestests/src/com/android/server/notification/NotificationAssistantsTest.java
@@ -28,6 +28,7 @@ import static junit.framework.Assert.assertNotNull;
import static junit.framework.Assert.assertTrue;
import static org.junit.Assert.assertNull;
+
import static org.mockito.ArgumentMatchers.anyBoolean;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Matchers.any;
@@ -197,6 +198,8 @@ public class NotificationAssistantsTest extends UiServiceTestCase {
public void testWriteXml_userTurnedOffNAS() throws Exception {
int userId = ActivityManager.getCurrentUser();
+ doReturn(true).when(mAssistants).isValidService(eq(mCn), eq(userId));
+
mAssistants.loadDefaultsFromConfig(true);
mAssistants.setPackageOrComponentEnabled(mCn.flattenToString(), userId, true,
@@ -432,6 +435,10 @@ public class NotificationAssistantsTest extends UiServiceTestCase {
public void testSetPackageOrComponentEnabled_onlyOnePackage() throws Exception {
ComponentName component1 = ComponentName.unflattenFromString("package/Component1");
ComponentName component2 = ComponentName.unflattenFromString("package/Component2");
+
+ doReturn(true).when(mAssistants).isValidService(eq(component1), eq(mZero.id));
+ doReturn(true).when(mAssistants).isValidService(eq(component2), eq(mZero.id));
+
mAssistants.setPackageOrComponentEnabled(component1.flattenToString(), mZero.id, true,
true, true);
verify(mNm, never()).setNotificationAssistantAccessGrantedForUserInternal(
@@ -577,6 +584,7 @@ public class NotificationAssistantsTest extends UiServiceTestCase {
public void testSetAdjustmentTypeSupportedState() throws Exception {
int userId = ActivityManager.getCurrentUser();
+ doReturn(true).when(mAssistants).isValidService(eq(mCn), eq(userId));
mAssistants.loadDefaultsFromConfig(true);
mAssistants.setPackageOrComponentEnabled(mCn.flattenToString(), userId, true,
true, true);
@@ -600,6 +608,7 @@ public class NotificationAssistantsTest extends UiServiceTestCase {
public void testSetAdjustmentTypeSupportedState_readWriteXml_entries() throws Exception {
int userId = ActivityManager.getCurrentUser();
+ doReturn(true).when(mAssistants).isValidService(eq(mCn), eq(userId));
mAssistants.loadDefaultsFromConfig(true);
mAssistants.setPackageOrComponentEnabled(mCn.flattenToString(), userId, true,
true, true);
@@ -623,6 +632,7 @@ public class NotificationAssistantsTest extends UiServiceTestCase {
public void testSetAdjustmentTypeSupportedState_readWriteXml_empty() throws Exception {
int userId = ActivityManager.getCurrentUser();
+ doReturn(true).when(mAssistants).isValidService(eq(mCn), eq(userId));
mAssistants.loadDefaultsFromConfig(true);
mAssistants.setPackageOrComponentEnabled(mCn.flattenToString(), userId, true,
true, true);
diff --git a/services/tests/wmtests/src/com/android/server/wm/InsetsSourceProviderTest.java b/services/tests/wmtests/src/com/android/server/wm/InsetsSourceProviderTest.java
index 457058849fca..79967b861ea5 100644
--- a/services/tests/wmtests/src/com/android/server/wm/InsetsSourceProviderTest.java
+++ b/services/tests/wmtests/src/com/android/server/wm/InsetsSourceProviderTest.java
@@ -30,6 +30,7 @@ import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import android.graphics.Insets;
+import android.graphics.Point;
import android.graphics.Rect;
import android.platform.test.annotations.Presubmit;
import android.view.InsetsSource;
@@ -260,6 +261,27 @@ public class InsetsSourceProviderTest extends WindowTestsBase {
}
@Test
+ public void testUpdateInsetsControlPosition() {
+ final WindowState target = createWindow(null, TYPE_APPLICATION, "target");
+
+ final WindowState ime1 = createWindow(null, TYPE_INPUT_METHOD, "ime1");
+ ime1.getFrame().set(new Rect(0, 0, 0, 0));
+ mImeProvider.setWindowContainer(ime1, null, null);
+ mImeProvider.updateControlForTarget(target, false /* force */, null /* statsToken */);
+ ime1.getFrame().set(new Rect(0, 400, 500, 500));
+ mImeProvider.updateInsetsControlPosition(ime1);
+ assertEquals(new Point(0, 400), mImeProvider.getControl(target).getSurfacePosition());
+
+ final WindowState ime2 = createWindow(null, TYPE_INPUT_METHOD, "ime2");
+ ime2.getFrame().set(new Rect(0, 0, 0, 0));
+ mImeProvider.setWindowContainer(ime2, null, null);
+ mImeProvider.updateControlForTarget(target, false /* force */, null /* statsToken */);
+ ime2.getFrame().set(new Rect(0, 400, 500, 500));
+ mImeProvider.updateInsetsControlPosition(ime2);
+ assertEquals(new Point(0, 400), mImeProvider.getControl(target).getSurfacePosition());
+ }
+
+ @Test
public void testSetRequestedVisibleTypes() {
final WindowState statusBar = createWindow(null, TYPE_APPLICATION, "statusBar");
final WindowState target = createWindow(null, TYPE_APPLICATION, "target");
diff --git a/services/usage/OWNERS b/services/usage/OWNERS
index f825f559d30d..678c7acc7fec 100644
--- a/services/usage/OWNERS
+++ b/services/usage/OWNERS
@@ -3,7 +3,6 @@ set noparent
mwachens@google.com
varunshah@google.com
-yamasani@google.com
guanxin@google.com
per-file *StorageStats* = file:/core/java/android/os/storage/OWNERS
diff --git a/tests/BootImageProfileTest/Android.bp b/tests/BootImageProfileTest/Android.bp
index 9fb5aa21f985..dbdc4b4407b7 100644
--- a/tests/BootImageProfileTest/Android.bp
+++ b/tests/BootImageProfileTest/Android.bp
@@ -19,6 +19,7 @@ package {
// to get the below license kinds:
// SPDX-license-identifier-Apache-2.0
default_applicable_licenses: ["frameworks_base_license"],
+ default_team: "trendy_team_art_mainline",
}
java_test_host {
diff --git a/tests/FlickerTests/test-apps/app-helpers/src/com/android/server/wm/flicker/helpers/DesktopModeAppHelper.kt b/tests/FlickerTests/test-apps/app-helpers/src/com/android/server/wm/flicker/helpers/DesktopModeAppHelper.kt
index c77413b6a55a..c6855b4a97b4 100644
--- a/tests/FlickerTests/test-apps/app-helpers/src/com/android/server/wm/flicker/helpers/DesktopModeAppHelper.kt
+++ b/tests/FlickerTests/test-apps/app-helpers/src/com/android/server/wm/flicker/helpers/DesktopModeAppHelper.kt
@@ -59,6 +59,11 @@ open class DesktopModeAppHelper(private val innerHelper: IStandardAppHelper) :
BOTTOM
}
+ enum class AppProperty {
+ STANDARD,
+ NON_RESIZABLE
+ }
+
/** Wait for an app moved to desktop to finish its transition. */
private fun waitForAppToMoveToDesktop(wmHelper: WindowManagerStateHelper) {
wmHelper
diff --git a/tests/FlickerTests/test-apps/app-helpers/src/com/android/server/wm/flicker/helpers/LetterboxAppHelper.kt b/tests/FlickerTests/test-apps/app-helpers/src/com/android/server/wm/flicker/helpers/LetterboxAppHelper.kt
index 8d27c1d1dfd1..fd13d14074d4 100644
--- a/tests/FlickerTests/test-apps/app-helpers/src/com/android/server/wm/flicker/helpers/LetterboxAppHelper.kt
+++ b/tests/FlickerTests/test-apps/app-helpers/src/com/android/server/wm/flicker/helpers/LetterboxAppHelper.kt
@@ -128,6 +128,6 @@ constructor(
}
companion object {
- private const val BOUNDS_OFFSET: Int = 100
+ private const val BOUNDS_OFFSET: Int = 50
}
}
diff --git a/tests/JobSchedulerPerfTests/OWNERS b/tests/JobSchedulerPerfTests/OWNERS
index 6f207fb1a00e..c8345f71b39a 100644
--- a/tests/JobSchedulerPerfTests/OWNERS
+++ b/tests/JobSchedulerPerfTests/OWNERS
@@ -1 +1 @@
-include /apex/jobscheduler/OWNERS
+include /apex/jobscheduler/JOB_OWNERS
diff --git a/tests/JobSchedulerTestApp/OWNERS b/tests/JobSchedulerTestApp/OWNERS
index 6f207fb1a00e..c8345f71b39a 100644
--- a/tests/JobSchedulerTestApp/OWNERS
+++ b/tests/JobSchedulerTestApp/OWNERS
@@ -1 +1 @@
-include /apex/jobscheduler/OWNERS
+include /apex/jobscheduler/JOB_OWNERS
diff --git a/tests/Tracing/src/com/android/internal/protolog/ProtoLogViewerConfigReaderTest.java b/tests/Tracing/src/com/android/internal/protolog/ProtoLogViewerConfigReaderTest.java
index 28d7b42764c4..d78ced161eaf 100644
--- a/tests/Tracing/src/com/android/internal/protolog/ProtoLogViewerConfigReaderTest.java
+++ b/tests/Tracing/src/com/android/internal/protolog/ProtoLogViewerConfigReaderTest.java
@@ -121,4 +121,12 @@ public class ProtoLogViewerConfigReaderTest {
assertNull(mConfig.getViewerString(4));
assertNull(mConfig.getViewerString(5));
}
+
+ @Test
+ public void loadUnloadAndReloadViewerConfig() {
+ loadViewerConfig();
+ unloadViewerConfig();
+ loadViewerConfig();
+ unloadViewerConfig();
+ }
}
diff --git a/tests/vcn/java/com/android/server/vcn/VcnGatewayConnectionTestBase.java b/tests/vcn/java/com/android/server/vcn/VcnGatewayConnectionTestBase.java
index e29e4621d571..e045f100e549 100644
--- a/tests/vcn/java/com/android/server/vcn/VcnGatewayConnectionTestBase.java
+++ b/tests/vcn/java/com/android/server/vcn/VcnGatewayConnectionTestBase.java
@@ -224,7 +224,6 @@ public class VcnGatewayConnectionTestBase {
doReturn(mFeatureFlags).when(mVcnContext).getFeatureFlags();
doReturn(true).when(mVcnContext).isFlagSafeModeTimeoutConfigEnabled();
doReturn(true).when(mVcnContext).isFlagIpSecTransformStateEnabled();
- doReturn(true).when(mVcnContext).isFlagNetworkMetricMonitorEnabled();
doReturn(mUnderlyingNetworkController)
.when(mDeps)
diff --git a/tests/vcn/java/com/android/server/vcn/routeselection/NetworkEvaluationTestBase.java b/tests/vcn/java/com/android/server/vcn/routeselection/NetworkEvaluationTestBase.java
index 421e1ad20b78..bc7ff47d9a01 100644
--- a/tests/vcn/java/com/android/server/vcn/routeselection/NetworkEvaluationTestBase.java
+++ b/tests/vcn/java/com/android/server/vcn/routeselection/NetworkEvaluationTestBase.java
@@ -127,7 +127,6 @@ public abstract class NetworkEvaluationTestBase {
false /* isInTestMode */));
doNothing().when(mVcnContext).ensureRunningOnLooperThread();
- doReturn(true).when(mVcnContext).isFlagNetworkMetricMonitorEnabled();
doReturn(true).when(mVcnContext).isFlagIpSecTransformStateEnabled();
setupSystemService(
diff --git a/tests/vcn/java/com/android/server/vcn/routeselection/UnderlyingNetworkControllerTest.java b/tests/vcn/java/com/android/server/vcn/routeselection/UnderlyingNetworkControllerTest.java
index 588624b56221..6f31d8db070f 100644
--- a/tests/vcn/java/com/android/server/vcn/routeselection/UnderlyingNetworkControllerTest.java
+++ b/tests/vcn/java/com/android/server/vcn/routeselection/UnderlyingNetworkControllerTest.java
@@ -226,7 +226,6 @@ public class UnderlyingNetworkControllerTest {
private void resetVcnContext(VcnContext vcnContext) {
reset(vcnContext);
doNothing().when(vcnContext).ensureRunningOnLooperThread();
- doReturn(true).when(vcnContext).isFlagNetworkMetricMonitorEnabled();
doReturn(true).when(vcnContext).isFlagIpSecTransformStateEnabled();
}