summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Android.bp1
-rw-r--r--apex/jobscheduler/framework/java/android/app/job/JobInfo.java2
-rw-r--r--apex/jobscheduler/service/Android.bp1
-rw-r--r--apex/jobscheduler/service/aconfig/Android.bp13
-rw-r--r--apex/jobscheduler/service/aconfig/app_idle.aconfig14
-rw-r--r--apex/jobscheduler/service/java/com/android/server/usage/AppIdleHistory.java8
-rw-r--r--apex/jobscheduler/service/java/com/android/server/usage/AppStandbyController.java24
-rw-r--r--api/StubLibraries.bp12
-rw-r--r--core/api/current.txt13
-rw-r--r--core/java/android/accessibilityservice/AccessibilityService.java10
-rw-r--r--core/java/android/app/Activity.java7
-rw-r--r--core/java/android/app/ActivityManagerInternal.java11
-rw-r--r--core/java/android/app/ActivityThread.java6
-rw-r--r--core/java/android/app/AppOpsManager.java3
-rw-r--r--core/java/android/app/AutomaticZenRule.java9
-rw-r--r--core/java/android/app/ContextImpl.java23
-rw-r--r--core/java/android/app/Notification.java96
-rw-r--r--core/java/android/app/TEST_MAPPING16
-rw-r--r--core/java/android/app/activity_manager.aconfig11
-rw-r--r--core/java/android/app/admin/flags/flags.aconfig27
-rw-r--r--core/java/android/content/TEST_MAPPING8
-rw-r--r--core/java/android/content/pm/CrossProfileApps.java2
-rw-r--r--core/java/android/content/res/Configuration.java2
-rw-r--r--core/java/android/hardware/camera2/impl/CameraDeviceImpl.java13
-rw-r--r--core/java/android/hardware/input/IInputManager.aidl1
-rw-r--r--core/java/android/hardware/input/InputManager.java13
-rw-r--r--core/java/android/hardware/input/InputManagerGlobal.java12
-rw-r--r--core/java/android/os/BugreportManager.java4
-rw-r--r--core/java/android/os/UserManager.java15
-rw-r--r--core/java/android/os/VintfObject.java18
-rw-r--r--core/java/android/provider/CallLog.java2
-rw-r--r--core/java/android/provider/Settings.java22
-rw-r--r--core/java/android/service/dreams/DreamService.java3
-rw-r--r--core/java/android/service/ondeviceintelligence/OnDeviceIntelligenceService.java109
-rw-r--r--core/java/android/service/ondeviceintelligence/OnDeviceSandboxedInferenceService.java72
-rw-r--r--core/java/android/text/DynamicLayout.java1
-rw-r--r--core/java/android/text/StaticLayout.java1
-rw-r--r--core/java/android/text/flags/flags.aconfig10
-rw-r--r--core/java/android/view/Display.java13
-rw-r--r--core/java/android/view/IWindow.aidl3
-rw-r--r--core/java/android/view/ImeBackAnimationController.java5
-rw-r--r--core/java/android/view/InputDevice.java43
-rw-r--r--core/java/android/view/InsetsController.java14
-rw-r--r--core/java/android/view/InsetsSourceConsumer.java27
-rw-r--r--core/java/android/view/KeyEvent.java65
-rw-r--r--core/java/android/view/MotionEvent.java105
-rw-r--r--core/java/android/view/ViewRootImpl.java4
-rw-r--r--core/java/android/view/WindowManager.java12
-rw-r--r--core/java/android/view/WindowMetrics.java10
-rw-r--r--core/java/android/view/accessibility/flags/accessibility_flags.aconfig1
-rw-r--r--core/java/android/window/BackProgressAnimator.java25
-rw-r--r--core/java/android/window/RemoteTransition.java62
-rw-r--r--core/java/android/window/TaskFragmentTransaction.java27
-rw-r--r--core/java/android/window/TaskSnapshot.java5
-rw-r--r--core/java/android/window/TransitionInfo.java60
-rw-r--r--core/java/android/window/TransitionRequestInfo.java2
-rw-r--r--core/java/android/window/flags/lse_desktop_experience.aconfig14
-rw-r--r--core/java/android/window/flags/windowing_frontend.aconfig8
-rw-r--r--core/java/android/window/flags/windowing_sdk.aconfig25
-rw-r--r--core/java/com/android/internal/app/ResolverActivity.java4
-rw-r--r--core/java/com/android/internal/pm/pkg/component/AconfigFlags.java244
-rw-r--r--core/java/com/android/internal/pm/pkg/component/ComponentParseUtils.java3
-rw-r--r--core/java/com/android/internal/pm/pkg/component/InstallConstraintsTagParser.java4
-rw-r--r--core/java/com/android/internal/pm/pkg/component/ParsedActivityUtils.java3
-rw-r--r--core/java/com/android/internal/pm/pkg/component/ParsedIntentInfoUtils.java6
-rw-r--r--core/java/com/android/internal/pm/pkg/component/ParsedProviderUtils.java4
-rw-r--r--core/java/com/android/internal/pm/pkg/component/ParsedServiceUtils.java4
-rw-r--r--core/java/com/android/internal/pm/pkg/parsing/ParsingPackageUtils.java44
-rw-r--r--core/java/com/android/internal/ravenwood/RavenwoodEnvironment.java2
-rw-r--r--core/java/com/android/internal/view/BaseIWindow.java2
-rw-r--r--core/java/com/android/internal/widget/CompactMessagingLayout.java263
-rw-r--r--core/jni/Android.bp5
-rw-r--r--core/jni/android_hardware_UsbDeviceConnection.cpp16
-rw-r--r--core/jni/android_os_VintfObject.cpp90
-rw-r--r--core/jni/android_view_InputDevice.cpp5
-rw-r--r--core/jni/platform/host/HostRuntime.cpp3
-rw-r--r--core/res/res/layout/notification_template_material_messaging_compact_heads_up.xml12
-rw-r--r--core/res/res/values-af/strings.xml27
-rw-r--r--core/res/res/values-am/strings.xml27
-rw-r--r--core/res/res/values-ar/strings.xml31
-rw-r--r--core/res/res/values-as/strings.xml27
-rw-r--r--core/res/res/values-az/strings.xml27
-rw-r--r--core/res/res/values-b+sr+Latn/strings.xml35
-rw-r--r--core/res/res/values-be/strings.xml27
-rw-r--r--core/res/res/values-bg/strings.xml29
-rw-r--r--core/res/res/values-bn/strings.xml29
-rw-r--r--core/res/res/values-bs/strings.xml27
-rw-r--r--core/res/res/values-ca/strings.xml33
-rw-r--r--core/res/res/values-cs/strings.xml27
-rw-r--r--core/res/res/values-da/strings.xml27
-rw-r--r--core/res/res/values-de/strings.xml29
-rw-r--r--core/res/res/values-el/strings.xml29
-rw-r--r--core/res/res/values-en-rAU/strings.xml27
-rw-r--r--core/res/res/values-en-rCA/strings.xml7
-rw-r--r--core/res/res/values-en-rGB/strings.xml27
-rw-r--r--core/res/res/values-en-rIN/strings.xml27
-rw-r--r--core/res/res/values-en-rXC/strings.xml7
-rw-r--r--core/res/res/values-es-rUS/strings.xml27
-rw-r--r--core/res/res/values-es/strings.xml29
-rw-r--r--core/res/res/values-et/strings.xml27
-rw-r--r--core/res/res/values-eu/strings.xml27
-rw-r--r--core/res/res/values-fa/strings.xml29
-rw-r--r--core/res/res/values-fi/strings.xml27
-rw-r--r--core/res/res/values-fr-rCA/strings.xml27
-rw-r--r--core/res/res/values-fr/strings.xml27
-rw-r--r--core/res/res/values-gl/strings.xml27
-rw-r--r--core/res/res/values-gu/strings.xml27
-rw-r--r--core/res/res/values-hi/strings.xml31
-rw-r--r--core/res/res/values-hr/strings.xml27
-rw-r--r--core/res/res/values-hu/strings.xml29
-rw-r--r--core/res/res/values-hy/strings.xml29
-rw-r--r--core/res/res/values-in/strings.xml27
-rw-r--r--core/res/res/values-is/strings.xml27
-rw-r--r--core/res/res/values-it/strings.xml27
-rw-r--r--core/res/res/values-iw/strings.xml29
-rw-r--r--core/res/res/values-ja/strings.xml27
-rw-r--r--core/res/res/values-ka/strings.xml29
-rw-r--r--core/res/res/values-kk/strings.xml27
-rw-r--r--core/res/res/values-km/strings.xml27
-rw-r--r--core/res/res/values-kn/strings.xml27
-rw-r--r--core/res/res/values-ko/strings.xml29
-rw-r--r--core/res/res/values-ky/strings.xml27
-rw-r--r--core/res/res/values-lo/strings.xml29
-rw-r--r--core/res/res/values-lt/strings.xml27
-rw-r--r--core/res/res/values-lv/strings.xml27
-rw-r--r--core/res/res/values-mk/strings.xml33
-rw-r--r--core/res/res/values-ml/strings.xml33
-rw-r--r--core/res/res/values-mn/strings.xml29
-rw-r--r--core/res/res/values-mr/strings.xml27
-rw-r--r--core/res/res/values-ms/strings.xml27
-rw-r--r--core/res/res/values-my/strings.xml27
-rw-r--r--core/res/res/values-nb/strings.xml27
-rw-r--r--core/res/res/values-ne/strings.xml55
-rw-r--r--core/res/res/values-nl/strings.xml27
-rw-r--r--core/res/res/values-or/strings.xml29
-rw-r--r--core/res/res/values-pa/strings.xml27
-rw-r--r--core/res/res/values-pl/strings.xml27
-rw-r--r--core/res/res/values-pt-rBR/strings.xml29
-rw-r--r--core/res/res/values-pt-rPT/strings.xml29
-rw-r--r--core/res/res/values-pt/strings.xml29
-rw-r--r--core/res/res/values-ro/strings.xml27
-rw-r--r--core/res/res/values-ru/strings.xml31
-rw-r--r--core/res/res/values-si/strings.xml27
-rw-r--r--core/res/res/values-sk/strings.xml27
-rw-r--r--core/res/res/values-sl/strings.xml29
-rw-r--r--core/res/res/values-sq/strings.xml6
-rw-r--r--core/res/res/values-sr/strings.xml35
-rw-r--r--core/res/res/values-sv/strings.xml45
-rw-r--r--core/res/res/values-sw/strings.xml27
-rw-r--r--core/res/res/values-ta/strings.xml27
-rw-r--r--core/res/res/values-te/strings.xml27
-rw-r--r--core/res/res/values-th/strings.xml27
-rw-r--r--core/res/res/values-tl/strings.xml27
-rw-r--r--core/res/res/values-tr/strings.xml27
-rw-r--r--core/res/res/values-uk/strings.xml27
-rw-r--r--core/res/res/values-ur/strings.xml27
-rw-r--r--core/res/res/values-uz/strings.xml27
-rw-r--r--core/res/res/values-vi/strings.xml27
-rw-r--r--core/res/res/values-zh-rCN/strings.xml27
-rw-r--r--core/res/res/values-zh-rHK/strings.xml31
-rw-r--r--core/res/res/values-zh-rTW/strings.xml27
-rw-r--r--core/res/res/values-zu/strings.xml27
-rw-r--r--core/res/res/values/attrs.xml2
-rw-r--r--core/res/res/values/config.xml5
-rw-r--r--core/res/res/values/config_telephony.xml19
-rw-r--r--core/res/res/values/dimens.xml6
-rw-r--r--core/res/res/values/strings.xml4
-rw-r--r--core/res/res/values/symbols.xml7
-rw-r--r--core/res/res/xml/sms_short_codes.xml9
-rw-r--r--core/tests/coretests/src/android/os/VintfObjectTest.java39
-rw-r--r--core/tests/coretests/src/android/view/ImeBackAnimationControllerTest.java15
-rw-r--r--graphics/java/android/graphics/fonts/FontFamily.java2
-rw-r--r--graphics/java/android/graphics/text/LineBreakConfig.java2
-rw-r--r--graphics/java/android/graphics/text/LineBreaker.java69
-rw-r--r--libs/WindowManager/Jetpack/src/androidx/window/extensions/embedding/DividerPresenter.java223
-rw-r--r--libs/WindowManager/Jetpack/src/androidx/window/extensions/embedding/SplitController.java79
-rw-r--r--libs/WindowManager/Jetpack/src/androidx/window/extensions/embedding/TaskFragmentContainer.java31
-rw-r--r--libs/WindowManager/Jetpack/tests/unittest/src/androidx/window/extensions/embedding/DividerPresenterTest.java104
-rw-r--r--libs/WindowManager/Jetpack/tests/unittest/src/androidx/window/extensions/embedding/OverlayPresentationTest.java24
-rw-r--r--libs/WindowManager/Jetpack/tests/unittest/src/androidx/window/extensions/embedding/SplitControllerTest.java8
-rw-r--r--libs/WindowManager/Shell/aconfig/multitasking.aconfig7
-rw-r--r--libs/WindowManager/Shell/multivalentTests/src/com/android/wm/shell/bubbles/BubblePositionerTest.kt34
-rw-r--r--libs/WindowManager/Shell/multivalentTests/src/com/android/wm/shell/bubbles/bar/BubbleExpandedViewPinControllerTest.kt18
-rw-r--r--libs/WindowManager/Shell/res/values/dimen.xml10
-rw-r--r--libs/WindowManager/Shell/shared/src/com/android/wm/shell/shared/DesktopModeStatus.java18
-rw-r--r--libs/WindowManager/Shell/shared/src/com/android/wm/shell/shared/TransitionUtil.java2
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/back/CrossActivityBackAnimation.kt37
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/back/DefaultCrossActivityBackAnimation.kt4
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleController.java23
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubblePositioner.java16
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/IBubbles.aidl6
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/bar/BubbleBarAnimationHelper.java10
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/bar/BubbleBarHandleView.java38
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/common/SystemWindows.java2
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/common/split/DividerView.java2
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/common/split/SplitDecorManager.java66
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/common/split/SplitLayout.java11
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/common/split/SplitScreenUtils.java17
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/dagger/WMShellModule.java19
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/dagger/pip/Pip1Module.java4
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/dagger/pip/Pip2Module.java22
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/DesktopTasksController.kt30
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/draganddrop/DragAndDropPolicy.java11
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/draganddrop/DragLayout.java14
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipTransition.java7
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/pip2/phone/PipController.java24
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/pip2/phone/PipMotionHelper.java13
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/pip2/phone/PipResizeGestureHandler.java19
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/pip2/phone/PipTouchHandler.java5
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/pip2/phone/PipTransitionState.java39
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/SplitScreenTransitions.java9
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageCoordinator.java28
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageTaskListener.java4
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/CaptionWindowDecorViewModel.java8
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/CaptionWindowDecoration.java37
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecorViewModel.java14
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecoration.java93
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DragDetector.java4
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DragResizeWindowGeometry.java32
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/ResizeHandleSizeRepository.kt133
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/WindowDecoration.java19
-rw-r--r--libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/common/split/SplitLayoutTests.java5
-rw-r--r--libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/desktopmode/DesktopTasksControllerTest.kt72
-rw-r--r--libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/pip2/PipTransitionStateTest.java7
-rw-r--r--libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/splitscreen/StageCoordinatorTests.java20
-rw-r--r--libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecorViewModelTests.kt25
-rw-r--r--libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecorationTests.java58
-rw-r--r--libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/DragResizeWindowGeometryTests.java19
-rw-r--r--libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/ResizeHandleSizeRepositoryParameterizedTests.kt150
-rw-r--r--libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/ResizeHandleSizeRepositoryTests.kt77
-rw-r--r--libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/WindowDecorationTests.java22
-rw-r--r--libs/hwui/jni/BitmapFactory.cpp4
-rw-r--r--media/java/android/media/IMediaRouter2.aidl3
-rw-r--r--media/java/android/media/IMediaRouterService.aidl3
-rw-r--r--media/java/android/media/LoudnessCodecDispatcher.java15
-rw-r--r--media/java/android/media/MediaRouter2.java34
-rw-r--r--media/java/android/media/projection/MediaProjection.java2
-rw-r--r--media/java/android/media/session/MediaController.java9
-rw-r--r--native/android/performance_hint.cpp2
-rw-r--r--nfc/java/android/nfc/INfcAdapter.aidl2
-rw-r--r--nfc/java/android/nfc/NfcAdapter.java6
-rw-r--r--packages/CredentialManager/res/values-fr-rCA/strings.xml8
-rw-r--r--packages/CredentialManager/res/values-hy/strings.xml10
-rw-r--r--packages/CredentialManager/res/values-ka/strings.xml2
-rw-r--r--packages/CredentialManager/res/values-kk/strings.xml2
-rw-r--r--packages/CredentialManager/res/values-ne/strings.xml2
-rw-r--r--packages/CredentialManager/res/values-pt-rPT/strings.xml2
-rw-r--r--packages/CredentialManager/wear/src/com/android/credentialmanager/ui/mappers/CredentialSelectorUiStateGetMapper.kt3
-rw-r--r--packages/InputDevices/res/raw/keyboard_layout_french_ca.kcm4
-rw-r--r--packages/SettingsLib/SettingsTheme/res/layout-v35/settingslib_preference_category_no_title.xml (renamed from packages/SystemUI/monet/AndroidManifest.xml)13
-rw-r--r--packages/SettingsLib/SettingsTheme/res/values-v35/themes.xml2
-rw-r--r--packages/SettingsLib/SpaPrivileged/src/com/android/settingslib/spaprivileged/model/app/AppOpsController.kt35
-rw-r--r--packages/SettingsLib/SpaPrivileged/src/com/android/settingslib/spaprivileged/model/app/AppOpsPermissionController.kt62
-rw-r--r--packages/SettingsLib/SpaPrivileged/src/com/android/settingslib/spaprivileged/template/app/AppOpPermissionAppList.kt85
-rw-r--r--packages/SettingsLib/SpaPrivileged/tests/src/com/android/settingslib/spaprivileged/model/app/AppOpsControllerTest.kt80
-rw-r--r--packages/SettingsLib/SpaPrivileged/tests/src/com/android/settingslib/spaprivileged/model/app/AppOpsPermissionControllerTest.kt167
-rw-r--r--packages/SettingsLib/SpaPrivileged/tests/src/com/android/settingslib/spaprivileged/template/app/AppOpPermissionAppListTest.kt78
-rw-r--r--packages/SettingsLib/aconfig/settingslib.aconfig10
-rw-r--r--packages/SettingsLib/aconfig/settingslib_media_flag_declarations.aconfig11
-rw-r--r--packages/SettingsLib/res/values/strings.xml4
-rw-r--r--packages/SettingsLib/src/com/android/settingslib/bluetooth/BluetoothUtils.java23
-rw-r--r--packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java4
-rw-r--r--packages/SettingsLib/src/com/android/settingslib/media/InfoMediaManager.java83
-rw-r--r--packages/SettingsLib/src/com/android/settingslib/media/LocalMediaManager.java6
-rw-r--r--packages/SettingsLib/src/com/android/settingslib/media/ManagerInfoMediaManager.java6
-rw-r--r--packages/SettingsLib/src/com/android/settingslib/media/NoOpInfoMediaManager.java6
-rw-r--r--packages/SettingsLib/src/com/android/settingslib/media/RouterInfoMediaManager.java6
-rw-r--r--packages/SettingsLib/src/com/android/settingslib/volume/MediaSessions.java2
-rw-r--r--packages/SettingsLib/src/com/android/settingslib/volume/data/repository/AudioRepository.kt11
-rw-r--r--packages/SettingsLib/src/com/android/settingslib/volume/domain/interactor/AudioVolumeInteractor.kt15
-rw-r--r--packages/SettingsLib/src/com/android/settingslib/volume/shared/model/AudioStreamModel.kt1
-rw-r--r--packages/SettingsLib/tests/integ/src/com/android/settingslib/media/InfoMediaManagerIntegTest.java9
-rw-r--r--packages/SettingsLib/tests/integ/src/com/android/settingslib/volume/data/repository/AudioRepositoryTest.kt3
-rw-r--r--packages/SettingsLib/tests/robotests/src/com/android/settingslib/bluetooth/BluetoothUtilsTest.java39
-rw-r--r--packages/SettingsLib/tests/robotests/src/com/android/settingslib/bluetooth/CachedBluetoothDeviceTest.java27
-rw-r--r--packages/SettingsLib/tests/robotests/src/com/android/settingslib/media/InfoMediaManagerTest.java6
-rw-r--r--packages/SettingsLib/tests/robotests/src/com/android/settingslib/media/LocalMediaManagerTest.java13
-rw-r--r--packages/SettingsLib/tests/robotests/src/com/android/settingslib/media/NoOpInfoMediaManagerTest.java3
-rw-r--r--packages/SettingsProvider/src/android/provider/settings/backup/GlobalSettings.java2
-rw-r--r--packages/SettingsProvider/src/android/provider/settings/validators/GlobalSettingsValidators.java3
-rw-r--r--packages/Shell/tests/src/com/android/shell/BugreportReceiverTest.java6
-rw-r--r--packages/SystemUI/Android.bp52
-rw-r--r--packages/SystemUI/accessibility/accessibilitymenu/aconfig/accessibility.aconfig10
-rw-r--r--packages/SystemUI/accessibility/accessibilitymenu/src/com/android/systemui/accessibility/accessibilitymenu/view/A11yMenuOverlayLayout.java8
-rw-r--r--packages/SystemUI/aconfig/accessibility.aconfig16
-rw-r--r--packages/SystemUI/aconfig/cross_device_control.aconfig16
-rw-r--r--packages/SystemUI/aconfig/systemui.aconfig24
-rw-r--r--packages/SystemUI/compose/core/Android.bp1
-rw-r--r--packages/SystemUI/compose/facade/enabled/src/com/android/systemui/scene/LockscreenSceneModule.kt12
-rw-r--r--packages/SystemUI/compose/features/src/com/android/systemui/bouncer/ui/composable/BouncerContent.kt71
-rw-r--r--packages/SystemUI/compose/features/src/com/android/systemui/bouncer/ui/composable/PatternBouncer.kt88
-rw-r--r--packages/SystemUI/compose/features/src/com/android/systemui/keyguard/ui/composable/LockscreenContent.kt4
-rw-r--r--packages/SystemUI/compose/features/src/com/android/systemui/keyguard/ui/composable/section/StatusBarSection.kt19
-rw-r--r--packages/SystemUI/compose/features/src/com/android/systemui/notifications/ui/composable/NotificationsShadeScene.kt5
-rw-r--r--packages/SystemUI/compose/features/src/com/android/systemui/qs/ui/composable/QuickSettings.kt12
-rw-r--r--packages/SystemUI/compose/features/src/com/android/systemui/qs/ui/composable/QuickSettingsShadeScene.kt5
-rw-r--r--packages/SystemUI/compose/features/src/com/android/systemui/shade/ui/composable/OverlayShade.kt22
-rw-r--r--packages/SystemUI/compose/features/src/com/android/systemui/shade/ui/composable/ShadeScene.kt4
-rw-r--r--packages/SystemUI/compose/features/src/com/android/systemui/volume/panel/component/anc/ui/composable/AncPopup.kt6
-rw-r--r--packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/AnimateToScene.kt18
-rw-r--r--packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/DraggableHandler.kt12
-rw-r--r--packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/Element.kt204
-rw-r--r--packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/ObservableTransitionState.kt11
-rw-r--r--packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/SceneTransitionLayoutImpl.kt4
-rw-r--r--packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/SceneTransitionLayoutState.kt96
-rw-r--r--packages/SystemUI/compose/scene/tests/Android.bp6
-rw-r--r--packages/SystemUI/compose/scene/tests/AndroidManifest.xml1
-rw-r--r--packages/SystemUI/compose/scene/tests/goldens/testAnchoredHeightOnly.json41
-rw-r--r--packages/SystemUI/compose/scene/tests/goldens/testAnchoredSizeEnter.json41
-rw-r--r--packages/SystemUI/compose/scene/tests/goldens/testAnchoredSizeExit.json41
-rw-r--r--packages/SystemUI/compose/scene/tests/goldens/testAnchoredWidthOnly.json41
-rw-r--r--packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/ElementTest.kt304
-rw-r--r--packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/SceneTransitionLayoutTest.kt7
-rw-r--r--packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/SwipeToSceneTest.kt10
-rw-r--r--packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/transformation/AnchoredSizeTest.kt91
-rw-r--r--packages/SystemUI/compose/scene/tests/src/com/android/compose/test/SizeAssertions.kt6
-rw-r--r--packages/SystemUI/compose/scene/tests/utils/Android.bp1
-rw-r--r--packages/SystemUI/compose/scene/tests/utils/src/com/android/compose/animation/scene/TestTransition.kt72
-rw-r--r--packages/SystemUI/monet/Android.bp33
-rw-r--r--packages/SystemUI/monet/src/com/android/systemui/monet/ColorScheme.kt372
-rw-r--r--packages/SystemUI/monet/src/com/android/systemui/monet/SchemeClock.java55
-rw-r--r--packages/SystemUI/monet/src/com/android/systemui/monet/SchemeClockVibrant.java53
-rw-r--r--packages/SystemUI/monet/src/com/android/systemui/monet/Shades.java65
-rw-r--r--packages/SystemUI/multivalentTests/src/com/android/systemui/accessibility/data/repository/NightDisplayRepositoryTest.kt28
-rw-r--r--packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/data/repository/FingerprintPropertyRepositoryTest.kt103
-rw-r--r--packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/ui/viewmodel/DeviceEntryIconViewModelTest.kt (renamed from packages/SystemUI/tests/src/com/android/systemui/keyguard/ui/viewmodel/DeviceEntryIconViewModelTest.kt)153
-rw-r--r--packages/SystemUI/multivalentTests/src/com/android/systemui/media/controls/domain/interactor/MediaControlInteractorTest.kt1
-rw-r--r--packages/SystemUI/multivalentTests/src/com/android/systemui/qs/ui/adapter/QSSceneAdapterImplTest.kt2
-rw-r--r--packages/SystemUI/multivalentTests/src/com/android/systemui/qs/ui/adapter/QSSceneAdapterTest.kt6
-rw-r--r--packages/SystemUI/multivalentTests/src/com/android/systemui/scene/domain/interactor/SceneInteractorTest.kt25
-rw-r--r--packages/SystemUI/multivalentTests/src/com/android/systemui/scene/domain/startable/SceneContainerStartableTest.kt38
-rw-r--r--packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/domain/interactor/HeadsUpNotificationInteractorTest.kt130
-rw-r--r--packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/NotificationListViewModelTest.kt23
-rw-r--r--packages/SystemUI/multivalentTests/src/com/android/systemui/volume/domain/interactor/AudioVolumeInteractorTest.kt9
-rw-r--r--packages/SystemUI/multivalentTests/src/com/android/systemui/volume/panel/component/anc/data/repository/AncSliceRepositoryTest.kt73
-rw-r--r--packages/SystemUI/multivalentTests/src/com/android/systemui/volume/panel/component/anc/domain/AncAvailabilityCriteriaTest.kt10
-rw-r--r--packages/SystemUI/multivalentTests/src/com/android/systemui/volume/panel/component/anc/domain/interactor/AncSliceInteractorTest.kt39
-rw-r--r--packages/SystemUI/multivalentTests/src/com/android/systemui/volume/panel/component/spatial/SpatialAudioComponentKosmos.kt4
-rw-r--r--packages/SystemUI/multivalentTests/src/com/android/systemui/volume/panel/component/spatial/domain/interactor/SpatialAudioComponentInteractorTest.kt10
-rw-r--r--packages/SystemUI/res/drawable/qs_tile_background_flagged.xml30
-rw-r--r--packages/SystemUI/res/drawable/qs_tile_focused_background.xml18
-rw-r--r--packages/SystemUI/res/drawable/shelf_action_chip_container_background.xml16
-rw-r--r--packages/SystemUI/res/layout-sw600dp/biometric_prompt_constraint_layout.xml3
-rw-r--r--packages/SystemUI/res/layout/biometric_prompt_button_bar.xml11
-rw-r--r--packages/SystemUI/res/layout/biometric_prompt_constraint_layout.xml3
-rw-r--r--packages/SystemUI/res/layout/clipboard_overlay2.xml21
-rw-r--r--packages/SystemUI/res/layout/screenshot_shelf.xml60
-rw-r--r--packages/SystemUI/res/values/dimens.xml10
-rw-r--r--packages/SystemUI/res/values/strings.xml2
-rw-r--r--packages/SystemUI/res/values/styles.xml7
-rw-r--r--packages/SystemUI/src/com/android/systemui/accessibility/WindowMagnificationController.java12
-rw-r--r--packages/SystemUI/src/com/android/systemui/accessibility/WindowMagnificationFrameSizePrefs.java (renamed from packages/SystemUI/src/com/android/systemui/accessibility/WindowMagnificationSizePrefs.java)4
-rw-r--r--packages/SystemUI/src/com/android/systemui/accessibility/data/repository/NightDisplayRepository.kt18
-rw-r--r--packages/SystemUI/src/com/android/systemui/accessibility/floatingmenu/MenuAnimationController.java45
-rw-r--r--packages/SystemUI/src/com/android/systemui/accessibility/floatingmenu/MenuView.java16
-rw-r--r--packages/SystemUI/src/com/android/systemui/accessibility/floatingmenu/MenuViewLayer.java11
-rw-r--r--packages/SystemUI/src/com/android/systemui/biometrics/AuthContainerView.java7
-rw-r--r--packages/SystemUI/src/com/android/systemui/biometrics/data/repository/FingerprintPropertyRepository.kt25
-rw-r--r--packages/SystemUI/src/com/android/systemui/biometrics/data/repository/PromptRepository.kt29
-rw-r--r--packages/SystemUI/src/com/android/systemui/biometrics/domain/interactor/FingerprintPropertyInteractor.kt2
-rw-r--r--packages/SystemUI/src/com/android/systemui/biometrics/domain/interactor/PromptSelectorInteractor.kt10
-rw-r--r--packages/SystemUI/src/com/android/systemui/biometrics/ui/binder/BiometricViewSizeBinder.kt6
-rw-r--r--packages/SystemUI/src/com/android/systemui/bluetooth/BroadcastDialogDelegate.java3
-rw-r--r--packages/SystemUI/src/com/android/systemui/communal/ui/viewmodel/CommunalEditModeViewModel.kt11
-rw-r--r--packages/SystemUI/src/com/android/systemui/dagger/SystemUIModule.java4
-rw-r--r--packages/SystemUI/src/com/android/systemui/deviceentry/domain/interactor/DeviceEntryFaceAuthInteractor.kt3
-rw-r--r--packages/SystemUI/src/com/android/systemui/deviceentry/domain/interactor/DeviceEntryUdfpsInteractor.kt14
-rw-r--r--packages/SystemUI/src/com/android/systemui/deviceentry/domain/interactor/NoopDeviceEntryFaceAuthInteractor.kt2
-rw-r--r--packages/SystemUI/src/com/android/systemui/deviceentry/domain/interactor/SystemUIDeviceEntryFaceAuthInteractor.kt1
-rw-r--r--packages/SystemUI/src/com/android/systemui/keyguard/KeyguardIndication.java27
-rw-r--r--packages/SystemUI/src/com/android/systemui/keyguard/KeyguardService.java18
-rw-r--r--packages/SystemUI/src/com/android/systemui/keyguard/data/repository/KeyguardSmartspaceRepository.kt6
-rw-r--r--packages/SystemUI/src/com/android/systemui/keyguard/data/repository/KeyguardTransitionRepository.kt18
-rw-r--r--packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/KeyguardBlueprintInteractor.kt12
-rw-r--r--packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/KeyguardTransitionAuditLogger.kt6
-rw-r--r--packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/TransitionInteractor.kt1
-rw-r--r--packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/WindowManagerLockscreenVisibilityInteractor.kt26
-rw-r--r--packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/AlternateBouncerViewBinder.kt35
-rw-r--r--packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardClockViewBinder.kt26
-rw-r--r--packages/SystemUI/src/com/android/systemui/keyguard/ui/preview/KeyguardPreviewRenderer.kt2
-rw-r--r--packages/SystemUI/src/com/android/systemui/keyguard/ui/view/layout/sections/DefaultDeviceEntrySection.kt25
-rw-r--r--packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/DeviceEntryIconViewModel.kt32
-rw-r--r--packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/KeyguardRootViewModel.kt6
-rw-r--r--packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/LockscreenContentViewModel.kt3
-rw-r--r--packages/SystemUI/src/com/android/systemui/media/controls/domain/pipeline/MediaDeviceManager.kt9
-rw-r--r--packages/SystemUI/src/com/android/systemui/media/controls/domain/pipeline/interactor/MediaControlInteractor.kt9
-rw-r--r--packages/SystemUI/src/com/android/systemui/media/controls/ui/controller/MediaControlPanel.java6
-rw-r--r--packages/SystemUI/src/com/android/systemui/media/controls/ui/util/MediaArtworkHelper.kt2
-rw-r--r--packages/SystemUI/src/com/android/systemui/media/controls/ui/viewmodel/MediaControlViewModel.kt12
-rw-r--r--packages/SystemUI/src/com/android/systemui/media/controls/util/LocalMediaManagerFactory.kt11
-rw-r--r--packages/SystemUI/src/com/android/systemui/media/controls/util/MediaFlags.kt3
-rw-r--r--packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputBroadcastDialogManager.kt7
-rw-r--r--packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputController.java56
-rw-r--r--packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputDialogManager.kt10
-rw-r--r--packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputSwitcherDialogUI.java6
-rw-r--r--packages/SystemUI/src/com/android/systemui/model/SceneContainerPlugin.kt4
-rw-r--r--packages/SystemUI/src/com/android/systemui/qs/panels/dagger/PanelsModule.kt21
-rw-r--r--packages/SystemUI/src/com/android/systemui/qs/panels/data/repository/GridLayoutTypeRepository.kt5
-rw-r--r--packages/SystemUI/src/com/android/systemui/qs/panels/shared/model/GridLayoutType.kt3
-rw-r--r--packages/SystemUI/src/com/android/systemui/qs/panels/ui/compose/PartitionedGridLayout.kt252
-rw-r--r--packages/SystemUI/src/com/android/systemui/qs/panels/ui/compose/Tile.kt2
-rw-r--r--packages/SystemUI/src/com/android/systemui/qs/panels/ui/viewmodel/EditModeViewModel.kt4
-rw-r--r--packages/SystemUI/src/com/android/systemui/qs/panels/ui/viewmodel/TileGridViewModel.kt4
-rw-r--r--packages/SystemUI/src/com/android/systemui/qs/tileimpl/QSTileViewImpl.kt17
-rw-r--r--packages/SystemUI/src/com/android/systemui/qs/ui/adapter/QSSceneAdapter.kt12
-rw-r--r--packages/SystemUI/src/com/android/systemui/scene/domain/interactor/SceneInteractor.kt14
-rw-r--r--packages/SystemUI/src/com/android/systemui/scene/domain/startable/SceneContainerStartable.kt24
-rw-r--r--packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java2
-rw-r--r--packages/SystemUI/src/com/android/systemui/shade/ShadeViewController.kt5
-rw-r--r--packages/SystemUI/src/com/android/systemui/shade/domain/interactor/ShadeInteractor.kt3
-rw-r--r--packages/SystemUI/src/com/android/systemui/shade/domain/interactor/ShadeInteractorEmptyImpl.kt1
-rw-r--r--packages/SystemUI/src/com/android/systemui/shade/domain/interactor/ShadeInteractorImpl.kt3
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java1
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/lockscreen/LockscreenSmartspaceController.kt4
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationSectionsFeatureManager.kt14
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/domain/interactor/HeadsUpNotificationInteractor.kt47
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/interruption/CommonVisualInterruptionSuppressors.kt20
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/interruption/VisualInterruptionDecisionProviderImpl.kt27
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationCompactMessagingTemplateViewWrapper.kt20
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationSection.java247
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationSectionsManager.kt119
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java2
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutController.java3
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithm.java2
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/NotificationListViewModel.kt13
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/HeadsUpAppearanceController.java1
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardIndicationTextView.java9
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardStatusBarViewController.java6
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java14
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/fragment/CollapsedStatusBarFragment.java1
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/ui/viewmodel/KeyguardStatusBarViewModel.kt7
-rw-r--r--packages/SystemUI/src/com/android/systemui/theme/CustomDynamicColors.java322
-rw-r--r--packages/SystemUI/src/com/android/systemui/theme/DynamicColors.kt135
-rw-r--r--packages/SystemUI/src/com/android/systemui/theme/ThemeOverlayController.java5
-rw-r--r--packages/SystemUI/src/com/android/systemui/unfold/FullscreenLightRevealAnimation.kt3
-rw-r--r--packages/SystemUI/src/com/android/systemui/util/settings/SettingsProxy.java432
-rw-r--r--packages/SystemUI/src/com/android/systemui/util/settings/SettingsProxy.kt385
-rw-r--r--packages/SystemUI/src/com/android/systemui/util/settings/UserSettingsProxy.java283
-rw-r--r--packages/SystemUI/src/com/android/systemui/util/settings/UserSettingsProxy.kt269
-rw-r--r--packages/SystemUI/src/com/android/systemui/volume/panel/component/anc/data/repository/AncSliceRepository.kt42
-rw-r--r--packages/SystemUI/src/com/android/systemui/volume/panel/component/anc/domain/interactor/AncSliceInteractor.kt21
-rw-r--r--packages/SystemUI/src/com/android/systemui/volume/panel/component/mediaoutput/domain/interactor/MediaControllerInteractor.kt2
-rw-r--r--packages/SystemUI/src/com/android/systemui/volume/panel/component/mediaoutput/domain/interactor/MediaDeviceSessionInteractor.kt2
-rw-r--r--packages/SystemUI/src/com/android/systemui/volume/panel/component/mediaoutput/domain/model/MediaControllerChangeModel.kt2
-rw-r--r--packages/SystemUI/src/com/android/systemui/volume/panel/component/spatial/domain/interactor/SpatialAudioComponentInteractor.kt35
-rw-r--r--packages/SystemUI/src/com/android/systemui/volume/panel/component/volume/slider/ui/viewmodel/AudioStreamSliderViewModel.kt17
-rw-r--r--packages/SystemUI/tests/goldens/animateFailure.json612
-rw-r--r--packages/SystemUI/tests/goldens/doubleClick_swapSide.json195
-rw-r--r--packages/SystemUI/tests/goldens/entryAnimation.json823
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/accessibility/WindowMagnificationFrameSizePrefsTest.java (renamed from packages/SystemUI/tests/src/com/android/systemui/accessibility/WindowMagnificationSizePrefsTest.java)14
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/accessibility/floatingmenu/MenuAnimationControllerTest.java4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/biometrics/data/repository/FaceSettingsRepositoryImplTest.kt2
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/biometrics/data/repository/PromptRepositoryImplTest.kt32
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/biometrics/domain/interactor/PromptCredentialInteractorTest.kt13
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/biometrics/domain/interactor/PromptSelectorInteractorImplTest.kt22
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/biometrics/ui/viewmodel/CredentialViewModelTest.kt3
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/biometrics/ui/viewmodel/PromptViewModelTest.kt4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/bouncer/ui/composable/BouncerContentTest.kt116
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/bouncer/ui/composable/PatternBouncerTest.kt120
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/keyguard/data/repository/KeyguardTransitionRepositoryTest.kt42
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/keyguard/domain/interactor/KeyguardTransitionScenariosTest.kt4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/keyguard/domain/interactor/WindowManagerLockscreenVisibilityInteractorTest.kt53
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/media/controls/ui/controller/MediaCarouselControllerTest.kt2
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/media/dialog/MediaOutputBaseDialogTest.java1
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/media/dialog/MediaOutputBroadcastDialogTest.java1
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/media/dialog/MediaOutputControllerTest.java9
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/media/dialog/MediaOutputDialogReceiverTest.java18
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/media/dialog/MediaOutputDialogTest.java1
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/monet/ColorSchemeTest.kt266
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/motion/ComposeMotionTestRuleHelper.kt49
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/qs/panels/domain/interactor/GridConsistencyInteractorTest.kt12
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/shade/NotificationPanelViewControllerBaseTest.java18
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/shade/NotificationPanelViewControllerWithCoroutinesTest.kt7
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/DragDownHelperTest.kt4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/KeyguardIndicationControllerTest.java4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/KeyguardIndicationControllerWithCoroutinesTest.kt4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/LSShadeTransitionLoggerTest.kt6
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/LightRevealScrimTest.kt6
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/LockscreenShadeQsTransitionControllerTest.kt4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/LockscreenShadeTransitionControllerTest.kt4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationListenerTest.java4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationRemoteInputManagerTest.java4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationShadeDepthControllerTest.kt4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/PulseExpansionHandlerTest.kt4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/RemoteInputNotificationRebuilderTest.java4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/SingleShadeLockScreenOverScrollerTest.kt4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/SmartReplyControllerTest.java4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/SplitShadeLockScreenOverScrollerTest.kt4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/StatusBarStateEventTest.kt4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/VibratorHelperTest.kt6
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/connectivity/AccessPointControllerImplTest.kt6
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/connectivity/MobileStateTest.kt4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/connectivity/NetworkControllerDataTest.java4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/connectivity/NetworkControllerEthernetTest.java4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/connectivity/NetworkControllerSignalTest.java4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/connectivity/NetworkControllerWifiTest.java4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/connectivity/NetworkTypeResIdCacheTest.kt4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/events/SystemEventChipAnimationControllerTest.kt4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/events/SystemEventCoordinatorTest.kt4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/events/SystemStatusAnimationSchedulerImplTest.kt4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/gesture/GenericGestureDetectorTest.kt4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/AboveShelfObserverTest.java4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/AssistantFeedbackControllerTest.java4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/DynamicChildBindControllerTest.java4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/DynamicPrivacyControllerTest.java7
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/NotificationSectionsFeatureManagerTest.kt7
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/NotificationTransitionAnimatorControllerTest.kt4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/NotificationWakeUpCoordinatorLoggerTest.kt4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/NotificationWakeUpCoordinatorTest.kt4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/RoundableTest.kt4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/HighPriorityProviderTest.java4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/NotifLiveDataImplTest.kt6
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/NotifLiveDataStoreImplTest.kt6
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/NotifPipelineChoreographerTest.kt6
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/NotificationEntryTest.java4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/SectionStyleProviderTest.kt6
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/TargetSdkResolverTest.kt4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coalescer/GroupCoalescerTest.java4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/ColorizedFgsCoordinatorTest.java4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/DataStoreCoordinatorTest.kt4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/DismissibilityCoordinatorTest.kt4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/DreamCoordinatorTest.kt4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/GroupCountCoordinatorTest.kt4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/GroupWhenCoordinatorTest.kt4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/GutsCoordinatorTest.kt4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/HeadsUpCoordinatorTest.kt4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/HideNotifsForOtherUsersCoordinatorTest.java4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/KeyguardCoordinatorTest.kt4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/MediaCoordinatorTest.java4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/NotificationStatsLoggerCoordinatorTest.kt4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/PreparationCoordinatorTest.java4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/RankingCoordinatorTest.java4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/RemoteInputCoordinatorTest.kt4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/RowAlertTimeCoordinatorTest.kt4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/RowAppearanceCoordinatorTest.kt4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/ShadeEventCoordinatorTest.kt4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/StackCoordinatorTest.kt4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/ViewConfigCoordinatorTest.kt4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/inflation/NotifUiAdjustmentProviderTest.kt4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/listbuilder/SemiStableSortTest.kt4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/listbuilder/ShadeListBuilderHelperTest.kt4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/notifcollection/NotifCollectionInconsistencyTrackerTest.kt4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/notifcollection/SelfTrackingLifetimeExtenderTest.kt4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/provider/VisualStabilityProviderTest.kt6
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/render/ShadeViewDifferTest.kt4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/domain/interactor/SeenNotificationsInteractorTest.kt4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/icon/IconManagerTest.kt4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/icon/domain/interactor/NotificationIconsInteractorTest.kt8
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/interruption/HeadsUpViewBinderTest.java4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/interruption/KeyguardNotificationVisibilityProviderTest.java4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/interruption/NotificationInterruptStateProviderImplTest.java4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/interruption/NotificationInterruptStateProviderWrapperTest.kt4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/interruption/VisualInterruptionDecisionProviderImplTest.kt145
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/interruption/VisualInterruptionDecisionProviderTestBase.kt2
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/interruption/VisualInterruptionDecisionProviderTestUtil.kt8
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/logging/ExpansionStateLoggerTest.java4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/logging/NotificationLoggerTest.java4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/logging/NotificationMemoryLoggerTest.kt4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/logging/NotificationMemoryMeterTest.kt4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/logging/NotificationMemoryViewWalkerTest.kt4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/ActivatableNotificationViewTest.kt6
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/BigPictureIconManagerTest.kt4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/ChannelEditorDialogControllerTest.kt4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRowControllerTest.kt4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRowDragControllerTest.java4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRowTest.java4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/FeedbackInfoTest.java4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/HeadsUpStyleProviderImplTest.kt4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotifBindPipelineTest.java4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotifInflationErrorManagerTest.kt4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotifRemoteViewCacheImplTest.java4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationContentInflaterTest.java4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationContentViewTest.kt4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationConversationInfoTest.java4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationGutsManagerTest.java4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationGutsManagerWithScenesTest.kt4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationGutsTest.kt4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationInfoTest.java4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationMenuRowTest.java4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationSettingsControllerTest.kt4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationSnoozeTest.java4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/PartialConversationInfoTest.java4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/RowContentBindStageTest.java4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/SingleLineConversationViewBinderTest.kt4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/SingleLineViewBinderTest.kt4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/SingleLineViewInflaterTest.kt4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/TextPrecomputerTest.kt4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/ui/viewmodel/ActivatableNotificationViewModelTest.kt4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationBigPictureTemplateViewWrapperTest.java4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationConversationTemplateViewWrapperTest.kt4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationCustomViewWrapperTest.java4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationMessagingTemplateViewWrapperTest.kt4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationTemplateViewWrapperTest.kt4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationViewWrapperTest.java4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/shelf/domain/interactor/NotificationShelfInteractorTest.kt4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/shelf/ui/viewmodel/NotificationShelfViewModelTest.kt4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/AmbientStateTest.kt4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/MediaContainerViewTest.kt6
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationChildrenContainerTest.java4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationShelfTest.kt4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutControllerTest.java4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutTest.java4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackSizeCalculatorTest.kt4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationSwipeHelperTest.java4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationTargetsHelperTest.kt4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/StackStateAnimatorTest.kt4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/ViewStateTest.kt4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/domain/interactor/HideNotificationsInteractorTest.kt4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/AutoTileManagerTest.java4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/BiometricsUnlockControllerTest.java4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/CentralSurfacesCommandQueueCallbacksTest.java4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/CentralSurfacesImplTest.java9
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/ConfigurationControllerImplTest.kt4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/DozeScrimControllerTest.java4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/FoldStateListenerTest.kt4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/HeadsUpAppearanceControllerTest.java4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/KeyguardClockPositionAlgorithmTest.java4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/KeyguardDismissUtilTest.java4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/KeyguardIndicationTextViewTest.java4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/KeyguardStatusBarViewControllerTest.java5
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/KeyguardStatusBarViewTest.java4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/LegacyLightsOutNotifControllerTest.java4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/LegacyNotificationIconAreaControllerImplTest.java4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/LetterboxAppearanceCalculatorTest.kt4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/LetterboxBackgroundProviderTest.kt4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/LightBarControllerTest.java4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/LightBarTransitionsControllerTest.java4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationIconContainerTest.kt4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationTapHelperTest.java4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/PhoneStatusBarPolicyTest.kt4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/ScrimControllerTest.java4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarBoundsProviderTest.kt4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManagerTest.java4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarNotificationActivityStarterTest.java4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarNotificationPresenterTest.java4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarRemoteInputCallbackTest.java6
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusOverlayHoverListenerTest.kt4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/SystemUIBottomSheetDialogTest.kt4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/UnlockedScreenOffAnimationControllerTest.kt4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/MobileRepositorySwitcherTest.kt4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/prod/CarrierMergedConnectionRepositoryTest.kt4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/BaseUserSwitcherAdapterTest.kt4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/DeviceControlsControllerImplTest.kt4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/DeviceStateRotationLockSettingControllerTest.java4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/FlashlightControllerImplTest.kt4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/KeyguardUserSwitcherAdapterTest.kt4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/SafetyControllerTest.kt6
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/SensitiveNotificationProtectionControllerFlagDisabledTest.kt4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/WalletControllerImplTest.kt4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/ui/viewmodel/KeyguardStatusBarViewModelTest.kt30
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/theme/ThemeOverlayControllerTest.java3
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/unfold/updates/RotationChangeProviderTest.kt18
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/util/settings/SettingsProxyTest.kt236
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/util/settings/UserSettingsProxyTest.kt365
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/wmshell/BubblesTest.java18
-rw-r--r--packages/SystemUI/tests/utils/src/com/android/systemui/SysUITestModule.kt2
-rw-r--r--packages/SystemUI/tests/utils/src/com/android/systemui/biometrics/data/repository/FakePromptRepository.kt10
-rw-r--r--packages/SystemUI/tests/utils/src/com/android/systemui/keyguard/domain/interactor/WindowManagerLockscreenVisibilityInteractorKosmos.kt4
-rw-r--r--packages/SystemUI/tests/utils/src/com/android/systemui/kosmos/KosmosJavaAdapter.kt2
-rw-r--r--packages/SystemUI/tests/utils/src/com/android/systemui/qs/panels/domain/interactor/GridLayoutTypeInteractorKosmos.kt15
-rw-r--r--packages/SystemUI/tests/utils/src/com/android/systemui/qs/panels/domain/interactor/PartitionedGridLayoutKosmos.kt23
-rw-r--r--packages/SystemUI/tests/utils/src/com/android/systemui/qs/panels/ui/viewmodel/TileGridViewModelKosmos.kt4
-rw-r--r--packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/notification/data/repository/FakeHeadsUpRowRepository.kt6
-rw-r--r--packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/notification/stack/domain/interactor/HeadsUpNotificationInteractorKosmos.kt11
-rw-r--r--packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/NotificationListViewModelKosmos.kt2
-rw-r--r--packages/SystemUI/tests/utils/src/com/android/systemui/volume/data/repository/FakeAudioRepository.kt10
-rw-r--r--packages/SystemUI/tests/utils/src/com/android/systemui/volume/panel/component/anc/VolumePanelAncKosmos.kt5
-rw-r--r--packages/SystemUI/tests/utils/src/com/android/systemui/volume/panel/component/anc/data/repository/FakeAncSliceRepository.kt8
-rw-r--r--packages/SystemUI/tests/utils/src/com/android/systemui/volume/panel/component/mediaoutput/domain/interactor/TestMediaDevicesFactory.kt58
-rw-r--r--packages/SystemUI/unfold/src/com/android/systemui/unfold/UnfoldRemoteModule.kt4
-rw-r--r--packages/SystemUI/unfold/src/com/android/systemui/unfold/UnfoldSharedComponent.kt1
-rw-r--r--packages/SystemUI/unfold/src/com/android/systemui/unfold/UnfoldSharedModule.kt9
-rw-r--r--packages/SystemUI/unfold/src/com/android/systemui/unfold/UnfoldTransitionFactory.kt2
-rw-r--r--packages/SystemUI/unfold/src/com/android/systemui/unfold/updates/DeviceFoldStateProvider.kt2
-rw-r--r--packages/SystemUI/unfold/src/com/android/systemui/unfold/updates/RotationChangeProvider.kt22
-rw-r--r--ravenwood/OWNERS4
-rw-r--r--services/accessibility/accessibility.aconfig10
-rw-r--r--services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java307
-rw-r--r--services/accessibility/java/com/android/server/accessibility/gestures/TouchExplorer.java8
-rw-r--r--services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java39
-rw-r--r--services/core/java/com/android/server/BootReceiver.java28
-rw-r--r--services/core/java/com/android/server/PinnerService.java12
-rw-r--r--services/core/java/com/android/server/TEST_MAPPING21
-rw-r--r--services/core/java/com/android/server/am/ActivityManagerService.java73
-rw-r--r--services/core/java/com/android/server/am/BatteryStatsService.java18
-rw-r--r--services/core/java/com/android/server/am/OomAdjusterModernImpl.java211
-rw-r--r--services/core/java/com/android/server/am/ProcessList.java11
-rw-r--r--services/core/java/com/android/server/am/SettingsToPropertiesMapper.java132
-rw-r--r--services/core/java/com/android/server/am/flags.aconfig11
-rw-r--r--services/core/java/com/android/server/appop/AppOpsService.java18
-rw-r--r--services/core/java/com/android/server/audio/AudioDeviceBroker.java1
-rw-r--r--services/core/java/com/android/server/audio/AudioService.java2
-rw-r--r--services/core/java/com/android/server/audio/BtHelper.java73
-rw-r--r--services/core/java/com/android/server/biometrics/sensors/BiometricNotificationUtils.java9
-rw-r--r--services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/BiometricTestSessionImpl.java57
-rw-r--r--services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/FingerprintProvider.java8
-rw-r--r--services/core/java/com/android/server/display/DisplayControl.java28
-rw-r--r--services/core/java/com/android/server/display/OverlayDisplayAdapter.java4
-rw-r--r--services/core/java/com/android/server/display/VirtualDisplayAdapter.java5
-rw-r--r--services/core/java/com/android/server/display/WifiDisplayAdapter.java8
-rw-r--r--services/core/java/com/android/server/display/brightness/strategy/AutomaticBrightnessStrategy.java19
-rw-r--r--services/core/java/com/android/server/flags/pinner.aconfig7
-rw-r--r--services/core/java/com/android/server/input/InputManagerService.java6
-rw-r--r--services/core/java/com/android/server/input/NativeInputManagerService.java5
-rw-r--r--services/core/java/com/android/server/inputmethod/AutofillSuggestionsController.java60
-rw-r--r--services/core/java/com/android/server/inputmethod/InputMethodBindingController.java51
-rw-r--r--services/core/java/com/android/server/inputmethod/InputMethodManagerService.java382
-rw-r--r--services/core/java/com/android/server/location/contexthub/ContextHubService.java100
-rw-r--r--services/core/java/com/android/server/locksettings/LockSettingsService.java16
-rw-r--r--services/core/java/com/android/server/media/MediaRoute2ProviderServiceProxy.java3
-rw-r--r--services/core/java/com/android/server/media/MediaRoute2ProviderWatcher.java1
-rw-r--r--services/core/java/com/android/server/media/MediaRouter2ServiceImpl.java46
-rw-r--r--services/core/java/com/android/server/media/MediaRouterService.java13
-rw-r--r--services/core/java/com/android/server/media/MediaShellCommand.java3
-rw-r--r--services/core/java/com/android/server/notification/ZenModeHelper.java3
-rw-r--r--services/core/java/com/android/server/ondeviceintelligence/OnDeviceIntelligenceManagerService.java98
-rw-r--r--services/core/java/com/android/server/ondeviceintelligence/OnDeviceIntelligenceShellCommand.java21
-rw-r--r--services/core/java/com/android/server/os/BugreportManagerServiceImpl.java112
-rw-r--r--services/core/java/com/android/server/pm/InstallPackageHelper.java13
-rw-r--r--services/core/java/com/android/server/pm/InstallRequest.java9
-rw-r--r--services/core/java/com/android/server/pm/InstallingSession.java6
-rw-r--r--services/core/java/com/android/server/pm/PackageFreezer.java10
-rw-r--r--services/core/java/com/android/server/pm/PackageInstallerSession.java56
-rw-r--r--services/core/java/com/android/server/pm/PackageManagerService.java15
-rw-r--r--services/core/java/com/android/server/pm/PackageManagerServiceUtils.java2
-rw-r--r--services/core/java/com/android/server/power/Notifier.java62
-rw-r--r--services/core/java/com/android/server/power/PowerManagerService.java6
-rw-r--r--services/core/java/com/android/server/power/WakeLockLog.java16
-rw-r--r--services/core/java/com/android/server/power/feature/PowerManagerFlags.java13
-rw-r--r--services/core/java/com/android/server/power/feature/power_flags.aconfig8
-rw-r--r--services/core/java/com/android/server/power/stats/BatteryExternalStatsWorker.java59
-rw-r--r--services/core/java/com/android/server/power/stats/BatteryStatsImpl.java83
-rw-r--r--services/core/java/com/android/server/power/stats/BatteryUsageStatsProvider.java4
-rw-r--r--services/core/java/com/android/server/power/stats/BluetoothPowerStatsCollector.java332
-rw-r--r--services/core/java/com/android/server/power/stats/BluetoothPowerStatsLayout.java143
-rw-r--r--services/core/java/com/android/server/power/stats/BluetoothPowerStatsProcessor.java304
-rw-r--r--services/core/java/com/android/server/timedetector/ServiceConfigAccessorImpl.java2
-rw-r--r--services/core/java/com/android/server/wallpaper/WallpaperCropper.java28
-rw-r--r--services/core/java/com/android/server/wm/AccessibilityController.java50
-rw-r--r--services/core/java/com/android/server/wm/ActivityRecord.java99
-rw-r--r--services/core/java/com/android/server/wm/ActivityStarter.java7
-rw-r--r--services/core/java/com/android/server/wm/AsyncRotationController.java9
-rw-r--r--services/core/java/com/android/server/wm/LetterboxUiController.java11
-rw-r--r--services/core/java/com/android/server/wm/SnapshotPersistQueue.java7
-rw-r--r--services/core/java/com/android/server/wm/TaskFragment.java33
-rw-r--r--services/core/java/com/android/server/wm/TaskFragmentOrganizerController.java71
-rw-r--r--services/core/java/com/android/server/wm/TransitionController.java21
-rw-r--r--services/core/java/com/android/server/wm/WallpaperController.java2
-rw-r--r--services/core/java/com/android/server/wm/WindowState.java9
-rw-r--r--services/core/jni/com_android_server_display_DisplayControl.cpp24
-rw-r--r--services/core/jni/com_android_server_input_InputManagerService.cpp15
-rw-r--r--services/devicepolicy/java/com/android/server/devicepolicy/NonRequiredPackageDeleteObserver.java27
-rw-r--r--services/profcollect/src/com/android/server/profcollect/ProfcollectForwardingService.java83
-rw-r--r--services/tests/PackageManagerServiceTests/server/Android.bp1
-rw-r--r--services/tests/PackageManagerServiceTests/server/src/com/android/server/pm/PackageParserTest.java36
-rw-r--r--services/tests/displayservicetests/src/com/android/server/display/DisplayManagerServiceTest.java58
-rw-r--r--services/tests/displayservicetests/src/com/android/server/display/VirtualDisplayAdapterTest.java21
-rw-r--r--services/tests/displayservicetests/src/com/android/server/display/brightness/strategy/AutomaticBrightnessStrategyTest.java28
-rw-r--r--services/tests/dreamservicetests/src/com/android/server/dreams/DreamServiceTest.java12
-rw-r--r--services/tests/dreamservicetests/src/com/android/server/dreams/TestDreamEnvironment.java8
-rw-r--r--services/tests/mockingservicestests/src/com/android/server/alarm/AlarmManagerServiceTest.java11
-rw-r--r--services/tests/mockingservicestests/src/com/android/server/am/ApplicationStartInfoTest.java3
-rw-r--r--services/tests/mockingservicestests/src/com/android/server/am/OWNERS2
-rw-r--r--services/tests/mockingservicestests/src/com/android/server/am/SettingsToPropertiesMapperTest.java55
-rw-r--r--services/tests/mockingservicestests/src/com/android/server/wallpaper/WallpaperCropperTest.java46
-rw-r--r--services/tests/powerservicetests/src/com/android/server/power/NotifierTest.java45
-rw-r--r--services/tests/powerservicetests/src/com/android/server/power/PowerManagerServiceTest.java3
-rw-r--r--services/tests/powerservicetests/src/com/android/server/power/WakeLockLogTest.java122
-rw-r--r--services/tests/powerstatstests/src/com/android/server/power/stats/BluetoothPowerStatsCollectorTest.java315
-rw-r--r--services/tests/powerstatstests/src/com/android/server/power/stats/BluetoothPowerStatsProcessorTest.java540
-rw-r--r--services/tests/servicestests/src/com/android/server/accessibility/AccessibilityManagerServiceTest.java99
-rw-r--r--services/tests/servicestests/src/com/android/server/os/BugreportManagerServiceImplTest.java14
-rw-r--r--services/tests/servicestests/src/com/android/server/usage/AppIdleHistoryTests.java6
-rw-r--r--services/tests/servicestests/test-apps/PackageParserApp/Android.bp17
-rw-r--r--services/tests/servicestests/test-apps/PackageParserApp/AndroidManifestApp8.xml30
-rw-r--r--services/tests/wmtests/src/com/android/server/wm/LetterboxUiControllerTest.java18
-rw-r--r--services/tests/wmtests/src/com/android/server/wm/TaskFragmentTest.java17
-rw-r--r--services/tests/wmtests/src/com/android/server/wm/TestIWindow.java2
-rw-r--r--services/tests/wmtests/src/com/android/server/wm/WallpaperControllerTests.java12
-rw-r--r--telephony/java/com/android/internal/telephony/ITelephony.aidl9
-rw-r--r--tests/BinderLeakTest/Android.bp3
-rw-r--r--tests/FlickerTests/Rotation/Android.bp4
-rw-r--r--tests/Input/src/com/android/test/input/InputDeviceTest.java5
-rw-r--r--tools/hoststubgen/OWNERS4
-rw-r--r--tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/asm/AsmUtils.kt10
-rw-r--r--tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/visitors/BaseAdapter.kt11
-rw-r--r--tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/visitors/Helper.kt35
-rw-r--r--tools/hoststubgen/hoststubgen/test-tiny-framework/golden-output/01-hoststubgen-test-tiny-framework-orig-dump.txt4
-rw-r--r--tools/hoststubgen/hoststubgen/test-tiny-framework/tiny-framework/src/com/android/hoststubgen/test/tinyframework/TinyFrameworkClassAnnotations.java3
-rw-r--r--tools/hoststubgen/hoststubgen/test/com/android/hoststubgen/visitors/HelperTest.kt26
790 files changed, 15407 insertions, 7564 deletions
diff --git a/Android.bp b/Android.bp
index d6b303f62428..af312bf833e5 100644
--- a/Android.bp
+++ b/Android.bp
@@ -425,6 +425,7 @@ java_defaults {
"sounddose-aidl-java",
"modules-utils-expresslog",
"perfetto_trace_javastream_protos_jarjar",
+ "libaconfig_java_proto_nano",
],
}
diff --git a/apex/jobscheduler/framework/java/android/app/job/JobInfo.java b/apex/jobscheduler/framework/java/android/app/job/JobInfo.java
index c74c48ce6ba8..5f57c3973ab0 100644
--- a/apex/jobscheduler/framework/java/android/app/job/JobInfo.java
+++ b/apex/jobscheduler/framework/java/android/app/job/JobInfo.java
@@ -31,6 +31,7 @@ import android.annotation.IntDef;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.RequiresPermission;
+import android.annotation.SuppressLint;
import android.app.Notification;
import android.compat.Compatibility;
import android.compat.annotation.ChangeId;
@@ -1366,6 +1367,7 @@ public class JobInfo implements Parcelable {
* @return This object for method chaining
*/
@FlaggedApi(Flags.FLAG_JOB_DEBUG_INFO_APIS)
+ @SuppressLint("BuilderSetStyle")
@NonNull
public Builder removeDebugTag(@NonNull String tag) {
mDebugTags.remove(tag);
diff --git a/apex/jobscheduler/service/Android.bp b/apex/jobscheduler/service/Android.bp
index 06c7d64d1708..559490cec04f 100644
--- a/apex/jobscheduler/service/Android.bp
+++ b/apex/jobscheduler/service/Android.bp
@@ -33,6 +33,7 @@ java_library {
"modules-utils-fastxmlserializer",
"service-jobscheduler-alarm.flags-aconfig-java",
"service-jobscheduler-job.flags-aconfig-java",
+ "service-jobscheduler-appidle.flags-aconfig-java",
],
// Rename classes shared with the framework
diff --git a/apex/jobscheduler/service/aconfig/Android.bp b/apex/jobscheduler/service/aconfig/Android.bp
index 859c67ad8910..7b2525c67916 100644
--- a/apex/jobscheduler/service/aconfig/Android.bp
+++ b/apex/jobscheduler/service/aconfig/Android.bp
@@ -42,3 +42,16 @@ java_aconfig_library {
name: "service-jobscheduler-alarm.flags-aconfig-java",
aconfig_declarations: "alarm_flags",
}
+
+// App Idle
+aconfig_declarations {
+ name: "app_idle_flags",
+ package: "com.android.server.usage",
+ container: "system",
+ srcs: ["app_idle.aconfig"],
+}
+
+java_aconfig_library {
+ name: "service-jobscheduler-appidle.flags-aconfig-java",
+ aconfig_declarations: "app_idle_flags",
+}
diff --git a/apex/jobscheduler/service/aconfig/app_idle.aconfig b/apex/jobscheduler/service/aconfig/app_idle.aconfig
new file mode 100644
index 000000000000..c8976ca8361e
--- /dev/null
+++ b/apex/jobscheduler/service/aconfig/app_idle.aconfig
@@ -0,0 +1,14 @@
+package: "com.android.server.usage"
+container: "system"
+
+flag {
+ name: "avoid_idle_check"
+ namespace: "backstage_power"
+ description: "Postpone app idle check after boot completed"
+ is_fixed_read_only: true
+ bug: "337864590"
+ metadata {
+ purpose: PURPOSE_BUGFIX
+ }
+}
+
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 4d4e3407a3c3..6265d9bb815f 100644
--- a/apex/jobscheduler/service/java/com/android/server/usage/AppIdleHistory.java
+++ b/apex/jobscheduler/service/java/com/android/server/usage/AppIdleHistory.java
@@ -788,7 +788,13 @@ public class AppIdleHistory {
}
appUsageHistory.nextEstimatedLaunchTime = getLongValue(parser,
ATTR_NEXT_ESTIMATED_APP_LAUNCH_TIME, 0);
- appUsageHistory.lastInformedBucket = -1;
+ if (Flags.avoidIdleCheck()) {
+ // Set lastInformedBucket to the same value with the currentBucket
+ // it should have already been informed.
+ appUsageHistory.lastInformedBucket = appUsageHistory.currentBucket;
+ } else {
+ appUsageHistory.lastInformedBucket = -1;
+ }
userHistory.put(packageName, appUsageHistory);
if (version >= XML_VERSION_ADD_BUCKET_EXPIRY_TIMES) {
diff --git a/apex/jobscheduler/service/java/com/android/server/usage/AppStandbyController.java b/apex/jobscheduler/service/java/com/android/server/usage/AppStandbyController.java
index 410074e6ec85..c3fe0314636e 100644
--- a/apex/jobscheduler/service/java/com/android/server/usage/AppStandbyController.java
+++ b/apex/jobscheduler/service/java/com/android/server/usage/AppStandbyController.java
@@ -707,7 +707,7 @@ public class AppStandbyController
initializeDefaultsForSystemApps(UserHandle.USER_SYSTEM);
}
- if (mPendingOneTimeCheckIdleStates) {
+ if (!Flags.avoidIdleCheck() && mPendingOneTimeCheckIdleStates) {
postOneTimeCheckIdleStates();
}
@@ -1021,7 +1021,7 @@ public class AppStandbyController
== REASON_SUB_DEFAULT_APP_RESTORED)) {
newBucket = getBucketForLocked(packageName, userId, elapsedRealtime);
if (DEBUG) {
- Slog.d(TAG, "Evaluated AOSP newBucket = "
+ Slog.d(TAG, "Evaluated " + packageName + " newBucket = "
+ standbyBucketToString(newBucket));
}
reason = REASON_MAIN_TIMEOUT;
@@ -1990,7 +1990,9 @@ public class AppStandbyController
}
}
if (android.app.admin.flags.Flags.disallowUserControlBgUsageFix()) {
- postCheckIdleStates(userId);
+ if (!Flags.avoidIdleCheck()) {
+ postCheckIdleStates(userId);
+ }
}
}
@@ -2392,9 +2394,14 @@ public class AppStandbyController
final boolean isHeadLess = !systemLauncherActivities.contains(pkg);
if (updateHeadlessSystemAppCache(pkg, isHeadLess)) {
- mHandler.obtainMessage(MSG_CHECK_PACKAGE_IDLE_STATE,
- UserHandle.USER_SYSTEM, -1, pkg)
- .sendToTarget();
+ if (!Flags.avoidIdleCheck()) {
+ // Checking idle state for the each individual headless system app
+ // during the boot up is not necessary, a full idle check for all
+ // usres will be scheduled after boot completed.
+ mHandler.obtainMessage(MSG_CHECK_PACKAGE_IDLE_STATE,
+ UserHandle.USER_SYSTEM, -1, pkg)
+ .sendToTarget();
+ }
}
}
final long end = SystemClock.uptimeMillis();
@@ -2438,6 +2445,11 @@ public class AppStandbyController
@Override
public void dumpState(String[] args, PrintWriter pw) {
+ pw.println("Flags: ");
+ pw.println(" " + Flags.FLAG_AVOID_IDLE_CHECK
+ + ": " + Flags.avoidIdleCheck());
+ pw.println();
+
synchronized (mCarrierPrivilegedLock) {
pw.println("Carrier privileged apps (have=" + mHaveCarrierPrivilegedApps
+ "): " + mCarrierPrivilegedApps);
diff --git a/api/StubLibraries.bp b/api/StubLibraries.bp
index 13d6ae5be3e8..6cfd2e0ce833 100644
--- a/api/StubLibraries.bp
+++ b/api/StubLibraries.bp
@@ -44,8 +44,8 @@ non_updatable_exportable_droidstubs {
removed_api_file: ":non-updatable-removed.txt",
},
last_released: {
- api_file: ":android-non-updatable.api.public.latest",
- removed_api_file: ":android-non-updatable-removed.api.public.latest",
+ api_file: ":android-non-updatable.api.combined.public.latest",
+ removed_api_file: ":android-non-updatable-removed.api.combined.public.latest",
baseline_file: ":android-non-updatable-incompatibilities.api.public.latest",
},
api_lint: {
@@ -124,8 +124,8 @@ non_updatable_exportable_droidstubs {
removed_api_file: ":non-updatable-system-removed.txt",
},
last_released: {
- api_file: ":android-non-updatable.api.system.latest",
- removed_api_file: ":android-non-updatable-removed.api.system.latest",
+ api_file: ":android-non-updatable.api.combined.system.latest",
+ removed_api_file: ":android-non-updatable-removed.api.combined.system.latest",
baseline_file: ":android-non-updatable-incompatibilities.api.system.latest",
},
api_lint: {
@@ -263,8 +263,8 @@ non_updatable_exportable_droidstubs {
removed_api_file: ":non-updatable-module-lib-removed.txt",
},
last_released: {
- api_file: ":android-non-updatable.api.module-lib.latest",
- removed_api_file: ":android-non-updatable-removed.api.module-lib.latest",
+ api_file: ":android-non-updatable.api.combined.module-lib.latest",
+ removed_api_file: ":android-non-updatable-removed.api.combined.module-lib.latest",
baseline_file: ":android-non-updatable-incompatibilities.api.module-lib.latest",
},
api_lint: {
diff --git a/core/api/current.txt b/core/api/current.txt
index 13958d24096b..8a99e45af0ea 100644
--- a/core/api/current.txt
+++ b/core/api/current.txt
@@ -3344,9 +3344,9 @@ package android.accessibilityservice {
public abstract class AccessibilityService extends android.app.Service {
ctor public AccessibilityService();
method public void attachAccessibilityOverlayToDisplay(int, @NonNull android.view.SurfaceControl);
- method @FlaggedApi("android.view.accessibility.a11y_overlay_callbacks") public void attachAccessibilityOverlayToDisplay(int, @NonNull android.view.SurfaceControl, @NonNull java.util.concurrent.Executor, @NonNull java.util.function.IntConsumer);
+ method @FlaggedApi("android.view.accessibility.a11y_overlay_callbacks") public final void attachAccessibilityOverlayToDisplay(int, @NonNull android.view.SurfaceControl, @NonNull java.util.concurrent.Executor, @NonNull java.util.function.IntConsumer);
method public void attachAccessibilityOverlayToWindow(int, @NonNull android.view.SurfaceControl);
- method @FlaggedApi("android.view.accessibility.a11y_overlay_callbacks") public void attachAccessibilityOverlayToWindow(int, @NonNull android.view.SurfaceControl, @NonNull java.util.concurrent.Executor, @NonNull java.util.function.IntConsumer);
+ method @FlaggedApi("android.view.accessibility.a11y_overlay_callbacks") public final void attachAccessibilityOverlayToWindow(int, @NonNull android.view.SurfaceControl, @NonNull java.util.concurrent.Executor, @NonNull java.util.function.IntConsumer);
method public boolean clearCache();
method public boolean clearCachedSubtree(@NonNull android.view.accessibility.AccessibilityNodeInfo);
method public final void disableSelf();
@@ -3354,7 +3354,7 @@ package android.accessibilityservice {
method public android.view.accessibility.AccessibilityNodeInfo findFocus(int);
method @NonNull public final android.accessibilityservice.AccessibilityButtonController getAccessibilityButtonController();
method @NonNull public final android.accessibilityservice.AccessibilityButtonController getAccessibilityButtonController(int);
- method @FlaggedApi("android.view.accessibility.braille_display_hid") @NonNull public android.accessibilityservice.BrailleDisplayController getBrailleDisplayController();
+ method @FlaggedApi("android.view.accessibility.braille_display_hid") @NonNull public final android.accessibilityservice.BrailleDisplayController getBrailleDisplayController();
method @NonNull @RequiresPermission(android.Manifest.permission.USE_FINGERPRINT) public final android.accessibilityservice.FingerprintGestureController getFingerprintGestureController();
method @Nullable public final android.accessibilityservice.InputMethod getInputMethod();
method @NonNull public final android.accessibilityservice.AccessibilityService.MagnificationController getMagnificationController();
@@ -18087,6 +18087,11 @@ package android.graphics.text {
public class LineBreaker {
method @NonNull public android.graphics.text.LineBreaker.Result computeLineBreaks(@NonNull android.graphics.text.MeasuredText, @NonNull android.graphics.text.LineBreaker.ParagraphConstraints, @IntRange(from=0) int);
+ method @FlaggedApi("com.android.text.flags.missing_getter_apis") public int getBreakStrategy();
+ method @FlaggedApi("com.android.text.flags.missing_getter_apis") public int getHyphenationFrequency();
+ method @FlaggedApi("com.android.text.flags.missing_getter_apis") @Nullable public int[] getIndents();
+ method @FlaggedApi("com.android.text.flags.missing_getter_apis") public int getJustificationMode();
+ method @FlaggedApi("com.android.text.flags.missing_getter_apis") public boolean getUseBoundsForWidth();
field public static final int BREAK_STRATEGY_BALANCED = 2; // 0x2
field public static final int BREAK_STRATEGY_HIGH_QUALITY = 1; // 0x1
field public static final int BREAK_STRATEGY_SIMPLE = 0; // 0x0
@@ -26611,7 +26616,7 @@ package android.media.session {
public abstract static class MediaController.Callback {
ctor public MediaController.Callback();
- method public void onAudioInfoChanged(android.media.session.MediaController.PlaybackInfo);
+ method public void onAudioInfoChanged(@NonNull android.media.session.MediaController.PlaybackInfo);
method public void onExtrasChanged(@Nullable android.os.Bundle);
method public void onMetadataChanged(@Nullable android.media.MediaMetadata);
method public void onPlaybackStateChanged(@Nullable android.media.session.PlaybackState);
diff --git a/core/java/android/accessibilityservice/AccessibilityService.java b/core/java/android/accessibilityservice/AccessibilityService.java
index d70fa19a4468..fd9600c1f87f 100644
--- a/core/java/android/accessibilityservice/AccessibilityService.java
+++ b/core/java/android/accessibilityservice/AccessibilityService.java
@@ -3554,8 +3554,8 @@ public abstract class AccessibilityService extends Service {
* @see #OVERLAY_RESULT_INVALID
* @see #OVERLAY_RESULT_INTERNAL_ERROR
*/
- @FlaggedApi("android.view.accessibility.a11y_overlay_callbacks")
- public void attachAccessibilityOverlayToDisplay(
+ @FlaggedApi(android.view.accessibility.Flags.FLAG_A11Y_OVERLAY_CALLBACKS)
+ public final void attachAccessibilityOverlayToDisplay(
int displayId,
@NonNull SurfaceControl sc,
@NonNull @CallbackExecutor Executor executor,
@@ -3627,8 +3627,8 @@ public abstract class AccessibilityService extends Service {
* @see #OVERLAY_RESULT_INVALID
* @see #OVERLAY_RESULT_INTERNAL_ERROR
*/
- @FlaggedApi("android.view.accessibility.a11y_overlay_callbacks")
- public void attachAccessibilityOverlayToWindow(
+ @FlaggedApi(android.view.accessibility.Flags.FLAG_A11Y_OVERLAY_CALLBACKS)
+ public final void attachAccessibilityOverlayToWindow(
int accessibilityWindowId,
@NonNull SurfaceControl sc,
@NonNull @CallbackExecutor Executor executor,
@@ -3645,7 +3645,7 @@ public abstract class AccessibilityService extends Service {
*/
@FlaggedApi(android.view.accessibility.Flags.FLAG_BRAILLE_DISPLAY_HID)
@NonNull
- public BrailleDisplayController getBrailleDisplayController() {
+ public final BrailleDisplayController getBrailleDisplayController() {
BrailleDisplayController.checkApiFlagIsEnabled();
synchronized (mLock) {
if (mBrailleDisplayController == null) {
diff --git a/core/java/android/app/Activity.java b/core/java/android/app/Activity.java
index e1cb630f4d82..79e2bd437c3e 100644
--- a/core/java/android/app/Activity.java
+++ b/core/java/android/app/Activity.java
@@ -1183,6 +1183,7 @@ public class Activity extends ContextThemeWrapper
* @see #setIntent(Intent, ComponentCaller)
*/
@FlaggedApi(android.security.Flags.FLAG_CONTENT_URI_PERMISSION_APIS)
+ @SuppressLint("OnNameExpected")
public @Nullable ComponentCaller getCaller() {
return mCaller;
}
@@ -1203,6 +1204,7 @@ public class Activity extends ContextThemeWrapper
* @see #getCaller
*/
@FlaggedApi(android.security.Flags.FLAG_CONTENT_URI_PERMISSION_APIS)
+ @SuppressLint("OnNameExpected")
public void setIntent(@Nullable Intent newIntent, @Nullable ComponentCaller newCaller) {
internalSetIntent(newIntent, newCaller);
}
@@ -7161,6 +7163,7 @@ public class Activity extends ContextThemeWrapper
* @see ComponentCaller
*/
@FlaggedApi(android.security.Flags.FLAG_CONTENT_URI_PERMISSION_APIS)
+ @SuppressLint("OnNameExpected")
public @NonNull ComponentCaller getInitialCaller() {
return mInitialCaller;
}
@@ -7188,10 +7191,11 @@ public class Activity extends ContextThemeWrapper
* @see #getCaller
*/
@FlaggedApi(android.security.Flags.FLAG_CONTENT_URI_PERMISSION_APIS)
+ @SuppressLint("OnNameExpected")
public @NonNull ComponentCaller getCurrentCaller() {
if (mCurrentCaller == null) {
throw new IllegalStateException("The caller is null because #getCurrentCaller should be"
- + " called within #onNewIntent method");
+ + " called within #onNewIntent or #onActivityResult methods");
}
return mCurrentCaller;
}
@@ -9634,6 +9638,7 @@ public class Activity extends ContextThemeWrapper
* the default behaviour
*/
@FlaggedApi(android.security.Flags.FLAG_ASM_RESTRICTIONS_ENABLED)
+ @SuppressLint("OnNameExpected")
public void setAllowCrossUidActivitySwitchFromBelow(boolean allowed) {
ActivityClient.getInstance().setAllowCrossUidActivitySwitchFromBelow(mToken, allowed);
}
diff --git a/core/java/android/app/ActivityManagerInternal.java b/core/java/android/app/ActivityManagerInternal.java
index d8df447982a0..8e99e46be6ac 100644
--- a/core/java/android/app/ActivityManagerInternal.java
+++ b/core/java/android/app/ActivityManagerInternal.java
@@ -1282,4 +1282,15 @@ public abstract class ActivityManagerInternal {
*/
public abstract void addStartInfoTimestamp(int key, long timestampNs, int uid, int pid,
int userId);
+
+ /**
+ * It is similar {@link IActivityManager#killApplication(String, int, int, String, int)} but
+ * it immediately stop the package.
+ *
+ * <p>Note: Do not call this method from inside PMS's lock, otherwise it'll run into
+ * watchdog reset.
+ * @hide
+ */
+ public abstract void killApplicationSync(String pkgName, int appId, int userId,
+ String reason, int exitInfoReason);
}
diff --git a/core/java/android/app/ActivityThread.java b/core/java/android/app/ActivityThread.java
index d4812dd612c3..76c1ed619510 100644
--- a/core/java/android/app/ActivityThread.java
+++ b/core/java/android/app/ActivityThread.java
@@ -18,6 +18,7 @@ package android.app;
import static android.app.ActivityManager.PROCESS_STATE_UNKNOWN;
import static android.app.ConfigurationController.createNewConfigAndUpdateIfNotNull;
+import static android.app.Flags.skipBgMemTrimOnFgApp;
import static android.app.WindowConfiguration.WINDOWING_MODE_PINNED;
import static android.app.WindowConfiguration.WINDOWING_MODE_UNDEFINED;
import static android.app.servertransaction.ActivityLifecycleItem.ON_CREATE;
@@ -7078,6 +7079,11 @@ public final class ActivityThread extends ClientTransactionHandler
if (DEBUG_MEMORY_TRIM) Slog.v(TAG, "Trimming memory to level: " + level);
try {
+ if (skipBgMemTrimOnFgApp()
+ && mLastProcessState <= ActivityManager.PROCESS_STATE_IMPORTANT_FOREGROUND
+ && level >= ComponentCallbacks2.TRIM_MEMORY_BACKGROUND) {
+ return;
+ }
if (level >= ComponentCallbacks2.TRIM_MEMORY_COMPLETE) {
PropertyInvalidatedCache.onTrimMemory();
}
diff --git a/core/java/android/app/AppOpsManager.java b/core/java/android/app/AppOpsManager.java
index 54f69099e081..6865f9c5013b 100644
--- a/core/java/android/app/AppOpsManager.java
+++ b/core/java/android/app/AppOpsManager.java
@@ -3583,6 +3583,9 @@ public class AppOpsManager {
return mAttributionTag;
}
+ /**
+ * Persistent device Id of the proxy that noted the op
+ */
@FlaggedApi(Flags.FLAG_DEVICE_ID_IN_OP_PROXY_INFO_ENABLED)
public @Nullable String getDeviceId() { return mDeviceId; }
diff --git a/core/java/android/app/AutomaticZenRule.java b/core/java/android/app/AutomaticZenRule.java
index 76d6547c2b70..746ec2ec87ae 100644
--- a/core/java/android/app/AutomaticZenRule.java
+++ b/core/java/android/app/AutomaticZenRule.java
@@ -843,6 +843,15 @@ public final class AutomaticZenRule implements Parcelable {
return this;
}
+ /**
+ * Sets the package that owns this rule
+ * @hide
+ */
+ public @NonNull Builder setPackage(@NonNull String pkg) {
+ mPkg = pkg;
+ return this;
+ }
+
public @NonNull AutomaticZenRule build() {
AutomaticZenRule rule = new AutomaticZenRule(mName, mOwner, mConfigurationActivity,
mConditionId, mPolicy, mInterruptionFilter, mEnabled);
diff --git a/core/java/android/app/ContextImpl.java b/core/java/android/app/ContextImpl.java
index e3380e0bf12a..3b9a5d3b2cf2 100644
--- a/core/java/android/app/ContextImpl.java
+++ b/core/java/android/app/ContextImpl.java
@@ -19,6 +19,7 @@ package android.app;
import static android.content.pm.PackageManager.PERMISSION_DENIED;
import static android.content.pm.PackageManager.PERMISSION_GRANTED;
import static android.os.StrictMode.vmIncorrectContextUseEnabled;
+import static android.permission.flags.Flags.shouldRegisterAttributionSource;
import static android.view.WindowManager.LayoutParams.WindowType;
import android.Manifest;
@@ -3157,7 +3158,8 @@ class ContextImpl extends Context {
int deviceId = vdm.getDeviceIdForDisplayId(displayId);
if (deviceId != mDeviceId) {
mDeviceId = deviceId;
- mAttributionSource = mAttributionSource.withDeviceId(mDeviceId);
+ mAttributionSource =
+ createAttributionSourceWithDeviceId(mAttributionSource, mDeviceId);
notifyOnDeviceChangedListeners(mDeviceId);
}
}
@@ -3180,6 +3182,7 @@ class ContextImpl extends Context {
if (mDeviceId != updatedDeviceId) {
mDeviceId = updatedDeviceId;
+ mAttributionSource = createAttributionSourceWithDeviceId(mAttributionSource, mDeviceId);
notifyOnDeviceChangedListeners(updatedDeviceId);
}
}
@@ -3548,8 +3551,22 @@ class ContextImpl extends Context {
deviceId, nextAttributionSource);
// If we want to access protected data on behalf of another app we need to
// tell the OS that we opt in to participate in the attribution chain.
- if (nextAttributionSource != null || shouldRegister) {
- attributionSource = getSystemService(PermissionManager.class)
+ return registerAttributionSourceIfNeeded(attributionSource, shouldRegister);
+ }
+
+ private @NonNull AttributionSource createAttributionSourceWithDeviceId(
+ @NonNull AttributionSource oldSource, int deviceId) {
+ boolean shouldRegister = false;
+ if (shouldRegisterAttributionSource()) {
+ shouldRegister = mParams.shouldRegisterAttributionSource();
+ }
+ return registerAttributionSourceIfNeeded(oldSource.withDeviceId(deviceId), shouldRegister);
+ }
+
+ private @NonNull AttributionSource registerAttributionSourceIfNeeded(
+ @NonNull AttributionSource attributionSource, boolean shouldRegister) {
+ if (shouldRegister || attributionSource.getNext() != null) {
+ return getSystemService(PermissionManager.class)
.registerAttributionSource(attributionSource);
}
return attributionSource;
diff --git a/core/java/android/app/Notification.java b/core/java/android/app/Notification.java
index 0672064bd5ea..dfae48b82909 100644
--- a/core/java/android/app/Notification.java
+++ b/core/java/android/app/Notification.java
@@ -8725,6 +8725,12 @@ public class Notification implements Parcelable
* <p>The messages should be added in chronologic order, i.e. the oldest first,
* the newest last.
*
+ * <p>Multiple Messages in a row with the same timestamp and sender may be grouped as a
+ * single message. This means an app should represent a message that has both an image and
+ * text as two Message objects, one with the image (and fallback text), and the other with
+ * the message text. For consistency, a text message (if any) should be provided after Uri
+ * content.
+ *
* @param message The {@link Message} to be displayed
* @return this object for method chaining
*/
@@ -8892,6 +8898,62 @@ public class Notification implements Parcelable
}
}
+ private void fixTitleAndTextForCompactMessaging(StandardTemplateParams p) {
+ Message m = findLatestIncomingMessage();
+ final CharSequence text = (m == null) ? null : m.mText;
+ CharSequence sender = m == null ? null
+ : m.mSender == null || TextUtils.isEmpty(m.mSender.getName())
+ ? mUser.getName() : m.mSender.getName();
+
+ CharSequence conversationTitle = mIsGroupConversation ? mConversationTitle : null;
+
+ // we want to have colon for possible title for conversation.
+ final BidiFormatter bidi = BidiFormatter.getInstance();
+ if (sender != null) {
+ sender = mBuilder.mContext.getString(
+ com.android.internal.R.string.notification_messaging_title_template,
+ bidi.unicodeWrap(sender), "");
+ } else if (conversationTitle != null) {
+ conversationTitle = mBuilder.mContext.getString(
+ com.android.internal.R.string.notification_messaging_title_template,
+ bidi.unicodeWrap(conversationTitle), "");
+ }
+
+ if (Flags.cleanUpSpansAndNewLines()) {
+ conversationTitle = stripStyling(conversationTitle);
+ sender = stripStyling(sender);
+ }
+
+ final boolean showOnlySenderName = showOnlySenderName();
+
+ final CharSequence title;
+ boolean isConversationTitleAvailable = !showOnlySenderName && conversationTitle != null;
+ if (isConversationTitleAvailable) {
+ title = conversationTitle;
+ } else {
+ title = sender;
+ }
+
+ p.title(title);
+ // when the conversation title is available, use headerTextSecondary for sender and
+ // summaryText for text
+ if (isConversationTitleAvailable) {
+ p.headerTextSecondary(sender);
+ p.summaryText(text);
+ } else {
+ // when it is not, use headerTextSecondary for text and don't use summaryText
+ p.headerTextSecondary(text);
+ p.summaryText(null);
+ }
+ }
+
+ /** developer settings to always show sender name */
+ private boolean showOnlySenderName() {
+ return SystemProperties.getBoolean(
+ "persist.compact_heads_up_notification.show_only_sender_name",
+ false);
+ }
+
/**
* @hide
*/
@@ -9211,24 +9273,34 @@ public class Notification implements Parcelable
}
}
- // This method fills title and text
- fixTitleAndTextExtras(mBuilder.mN.extras);
final StandardTemplateParams p = mBuilder.mParams.reset()
.viewType(StandardTemplateParams.VIEW_TYPE_HEADS_UP)
.highlightExpander(isConversationLayout)
.fillTextsFrom(mBuilder)
- .hideTime(true)
- .summaryText("");
- p.headerTextSecondary(p.mText);
+ .hideTime(true);
+
+ fixTitleAndTextForCompactMessaging(p);
TemplateBindResult bindResult = new TemplateBindResult();
RemoteViews contentView = mBuilder.applyStandardTemplate(
mBuilder.getMessagingCompactHeadsUpLayoutResource(), p, bindResult);
+ contentView.setViewVisibility(R.id.header_text_secondary_divider, View.GONE);
+ contentView.setViewVisibility(R.id.header_text_divider, View.GONE);
if (conversationIcon != null) {
contentView.setViewVisibility(R.id.icon, View.GONE);
+ contentView.setViewVisibility(R.id.conversation_face_pile, View.GONE);
contentView.setViewVisibility(R.id.conversation_icon, View.VISIBLE);
contentView.setBoolean(R.id.conversation_icon, "setApplyCircularCrop", true);
contentView.setImageViewIcon(R.id.conversation_icon, conversationIcon);
+ } else if (mIsGroupConversation) {
+ contentView.setViewVisibility(R.id.icon, View.GONE);
+ contentView.setViewVisibility(R.id.conversation_icon, View.GONE);
+ contentView.setInt(R.id.status_bar_latest_event_content,
+ "setNotificationBackgroundColor", mBuilder.getBackgroundColor(p));
+ contentView.setInt(R.id.status_bar_latest_event_content, "setLayoutColor",
+ mBuilder.getSmallIconColor(p));
+ contentView.setBundle(R.id.status_bar_latest_event_content, "setGroupFacePile",
+ mBuilder.mN.extras);
}
if (remoteInputAction != null) {
@@ -9293,6 +9365,15 @@ public class Notification implements Parcelable
}
}
+ /*
+ * An object representing a simple message or piece of media within a mixed-media message.
+ *
+ * This object can only represent text or a single binary piece of media. For apps which
+ * support mixed-media messages (e.g. text + image), multiple Messages should be used, one
+ * to represent each piece of the message, and they should all be given the same timestamp.
+ * For consistency, a text message should be added last of all Messages with the same
+ * timestamp.
+ */
public static final class Message {
/** @hide */
public static final String KEY_TEXT = "text";
@@ -9381,8 +9462,9 @@ public class Notification implements Parcelable
/**
* Sets a binary blob of data and an associated MIME type for a message. In the case
- * where the platform doesn't support the MIME type, the original text provided in the
- * constructor will be used.
+ * where the platform or the UI state doesn't support the MIME type, the original text
+ * provided in the constructor will be used. When this data can be presented to the
+ * user, the original text will only be used as accessibility text.
* @param dataMimeType The MIME type of the content. See
* {@link android.graphics.ImageDecoder#isMimeTypeSupported(String)} for a list of
* supported image MIME types.
diff --git a/core/java/android/app/TEST_MAPPING b/core/java/android/app/TEST_MAPPING
index dc44764dc046..0deb842aff61 100644
--- a/core/java/android/app/TEST_MAPPING
+++ b/core/java/android/app/TEST_MAPPING
@@ -378,6 +378,14 @@
}
],
"file_patterns": ["(/|^)ContextImpl.java"]
+ },
+ {
+ "file_patterns": [
+ "(/|^)Activity.*.java",
+ "(/|^)PendingIntent.java",
+ "(/|^)ComtextImpl.java"
+ ],
+ "name": "CtsWindowManagerBackgroundActivityTestCases"
}
],
"postsubmit": [
@@ -392,14 +400,6 @@
{
"file_patterns": ["(/|^)AppOpsManager.java"],
"name": "CtsAppOpsTestCases"
- },
- {
- "file_patterns": [
- "(/|^)Activity.*.java",
- "(/|^)PendingIntent.java",
- "(/|^)ComtextImpl.java"
- ],
- "name": "CtsWindowManagerBackgroundActivityTestCases"
}
]
}
diff --git a/core/java/android/app/activity_manager.aconfig b/core/java/android/app/activity_manager.aconfig
index bb24fd19315e..fa646a76768c 100644
--- a/core/java/android/app/activity_manager.aconfig
+++ b/core/java/android/app/activity_manager.aconfig
@@ -70,3 +70,14 @@ flag {
purpose: PURPOSE_BUGFIX
}
}
+
+flag {
+ namespace: "backstage_power"
+ name: "skip_bg_mem_trim_on_fg_app"
+ description: "Skip background memory trim event on foreground processes."
+ is_fixed_read_only: true
+ bug: "308927629"
+ metadata {
+ purpose: PURPOSE_BUGFIX
+ }
+}
diff --git a/core/java/android/app/admin/flags/flags.aconfig b/core/java/android/app/admin/flags/flags.aconfig
index 4154e667360b..ad1ae9881a0c 100644
--- a/core/java/android/app/admin/flags/flags.aconfig
+++ b/core/java/android/app/admin/flags/flags.aconfig
@@ -115,6 +115,16 @@ flag {
}
flag {
+ name: "hsum_unlock_notification_fix"
+ namespace: "enterprise"
+ description: "Using the right userId when starting the work profile unlock flow "
+ bug: "327350831"
+ metadata {
+ purpose: PURPOSE_BUGFIX
+ }
+}
+
+flag {
name: "dumpsys_policy_engine_migration_enabled"
namespace: "enterprise"
description: "Update DumpSys to include information about migrated APIs in DPE"
@@ -318,6 +328,13 @@ flag {
}
flag {
+ name: "backup_connected_apps_settings"
+ namespace: "enterprise"
+ description: "backup and restore connected work and personal apps user settings across devices"
+ bug: "175067666"
+}
+
+flag {
name: "headless_single_user_compatibility_fix"
namespace: "enterprise"
description: "Fix for compatibility issue introduced from using single_user mode on pre-Android V builds"
@@ -336,3 +353,13 @@ flag {
purpose: PURPOSE_BUGFIX
}
}
+
+flag {
+ name: "onboarding_consentless_bugreports"
+ namespace: "enterprise"
+ description: "Allow subsequent bugreports to skip user consent within a time frame"
+ bug: "340439309"
+ metadata {
+ purpose: PURPOSE_BUGFIX
+ }
+}
diff --git a/core/java/android/content/TEST_MAPPING b/core/java/android/content/TEST_MAPPING
index f08395ae5e40..41a4288eae5c 100644
--- a/core/java/android/content/TEST_MAPPING
+++ b/core/java/android/content/TEST_MAPPING
@@ -56,6 +56,10 @@
}
],
"file_patterns": ["(/|^)Context.java", "(/|^)ContextWrapper.java"]
+ },
+ {
+ "name": "CtsWindowManagerBackgroundActivityTestCases",
+ "file_patterns": ["(/|^)IntentSender.java"]
}
],
"ravenwood-presubmit": [
@@ -65,9 +69,5 @@
}
],
"postsubmit": [
- {
- "name": "CtsWindowManagerBackgroundActivityTestCases",
- "file_patterns": ["(/|^)IntentSender.java"]
- }
]
}
diff --git a/core/java/android/content/pm/CrossProfileApps.java b/core/java/android/content/pm/CrossProfileApps.java
index 8220313a9197..57ee622de910 100644
--- a/core/java/android/content/pm/CrossProfileApps.java
+++ b/core/java/android/content/pm/CrossProfileApps.java
@@ -326,6 +326,7 @@ public class CrossProfileApps {
* @return whether the specified user is a profile.
*/
@FlaggedApi(FLAG_ALLOW_QUERYING_PROFILE_TYPE)
+ @SuppressWarnings("UserHandleName")
public boolean isProfile(@NonNull UserHandle userHandle) {
// Note that this is not a security check, but rather a check for correct use.
// The actual security check is performed by UserManager.
@@ -343,6 +344,7 @@ public class CrossProfileApps {
* @return whether the specified user is a managed profile.
*/
@FlaggedApi(FLAG_ALLOW_QUERYING_PROFILE_TYPE)
+ @SuppressWarnings("UserHandleName")
public boolean isManagedProfile(@NonNull UserHandle userHandle) {
// Note that this is not a security check, but rather a check for correct use.
// The actual security check is performed by UserManager.
diff --git a/core/java/android/content/res/Configuration.java b/core/java/android/content/res/Configuration.java
index 885f4c5e8ec4..982224b026bc 100644
--- a/core/java/android/content/res/Configuration.java
+++ b/core/java/android/content/res/Configuration.java
@@ -806,7 +806,7 @@ public final class Configuration implements Parcelable, Comparable<Configuration
*
* <aside class="note"><b>Note:</b> If the app targets
* {@link android.os.Build.VERSION_CODES#VANILLA_ICE_CREAM}
- * or after, The width measurement reflects the window size without excluding insets.
+ * or after, the width measurement reflects the window size without excluding insets.
* Otherwise, the measurement excludes window insets even when the app is displayed edge to edge
* using {@link android.view.Window#setDecorFitsSystemWindows(boolean)
* Window#setDecorFitsSystemWindows(boolean)}.</aside>
diff --git a/core/java/android/hardware/camera2/impl/CameraDeviceImpl.java b/core/java/android/hardware/camera2/impl/CameraDeviceImpl.java
index e2b409fe35f1..7f3c49dbb580 100644
--- a/core/java/android/hardware/camera2/impl/CameraDeviceImpl.java
+++ b/core/java/android/hardware/camera2/impl/CameraDeviceImpl.java
@@ -1571,8 +1571,7 @@ public class CameraDeviceImpl extends CameraDevice
}
// Allow RAW formats, even when not advertised.
- if (inputFormat == ImageFormat.RAW_PRIVATE || inputFormat == ImageFormat.RAW10
- || inputFormat == ImageFormat.RAW12 || inputFormat == ImageFormat.RAW_SENSOR) {
+ if (isRawFormat(inputFormat)) {
return true;
}
@@ -1642,6 +1641,11 @@ public class CameraDeviceImpl extends CameraDevice
}
}
+ // Allow RAW formats, even when not advertised.
+ if (Flags.multiResRawReprocessing() && isRawFormat(inputFormat)) {
+ return;
+ }
+
if (validFormat == false) {
throw new IllegalArgumentException("multi-resolution input format " +
inputFormat + " is not valid");
@@ -2584,6 +2588,11 @@ public class CameraDeviceImpl extends CameraDevice
return mCharacteristics;
}
+ private boolean isRawFormat(int format) {
+ return (format == ImageFormat.RAW_PRIVATE || format == ImageFormat.RAW10
+ || format == ImageFormat.RAW12 || format == ImageFormat.RAW_SENSOR);
+ }
+
/**
* Listener for binder death.
*
diff --git a/core/java/android/hardware/input/IInputManager.aidl b/core/java/android/hardware/input/IInputManager.aidl
index 45b316aa5498..40d4fb6df4bc 100644
--- a/core/java/android/hardware/input/IInputManager.aidl
+++ b/core/java/android/hardware/input/IInputManager.aidl
@@ -55,7 +55,6 @@ interface IInputManager {
int[] getInputDeviceIds();
// Enable/disable input device.
- boolean isInputDeviceEnabled(int deviceId);
void enableInputDevice(int deviceId);
void disableInputDevice(int deviceId);
diff --git a/core/java/android/hardware/input/InputManager.java b/core/java/android/hardware/input/InputManager.java
index 7527aa7197e9..9eabc8d53bb3 100644
--- a/core/java/android/hardware/input/InputManager.java
+++ b/core/java/android/hardware/input/InputManager.java
@@ -333,19 +333,6 @@ public final class InputManager {
}
/**
- * Returns true if an input device is enabled. Should return true for most
- * situations. Some system apps may disable an input device, for
- * example to prevent unwanted touch events.
- *
- * @param id The input device Id.
- *
- * @hide
- */
- public boolean isInputDeviceEnabled(int id) {
- return mGlobal.isInputDeviceEnabled(id);
- }
-
- /**
* Enables an InputDevice.
* <p>
* Requires {@link android.Manifest.permission#DISABLE_INPUT_DEVICE}.
diff --git a/core/java/android/hardware/input/InputManagerGlobal.java b/core/java/android/hardware/input/InputManagerGlobal.java
index fcd5a3ed06c0..7b471806cfc1 100644
--- a/core/java/android/hardware/input/InputManagerGlobal.java
+++ b/core/java/android/hardware/input/InputManagerGlobal.java
@@ -411,18 +411,6 @@ public final class InputManagerGlobal {
}
/**
- * @see InputManager#isInputDeviceEnabled(int)
- */
- public boolean isInputDeviceEnabled(int id) {
- try {
- return mIm.isInputDeviceEnabled(id);
- } catch (RemoteException ex) {
- Log.w(TAG, "Could not check enabled status of input device with id = " + id);
- throw ex.rethrowFromSystemServer();
- }
- }
-
- /**
* @see InputManager#enableInputDevice(int)
*/
public void enableInputDevice(int id) {
diff --git a/core/java/android/os/BugreportManager.java b/core/java/android/os/BugreportManager.java
index 960e84d671e7..a818df5f0a8e 100644
--- a/core/java/android/os/BugreportManager.java
+++ b/core/java/android/os/BugreportManager.java
@@ -252,7 +252,8 @@ public final class BugreportManager {
params.getMode(),
params.getFlags(),
dsListener,
- isScreenshotRequested);
+ isScreenshotRequested,
+ /* skipUserConsent = */ false);
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
} catch (FileNotFoundException e) {
@@ -313,6 +314,7 @@ public final class BugreportManager {
bugreportFd.getFileDescriptor(),
bugreportFile,
/* keepBugreportOnRetrieval = */ false,
+ /* skipUserConsent = */ false,
dsListener);
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
diff --git a/core/java/android/os/UserManager.java b/core/java/android/os/UserManager.java
index 2f0d63401e33..80d356614932 100644
--- a/core/java/android/os/UserManager.java
+++ b/core/java/android/os/UserManager.java
@@ -368,17 +368,18 @@ public class UserManager {
public static final String DISALLOW_WIFI_TETHERING = "no_wifi_tethering";
/**
- * Specifies if a user is disallowed from being granted admin privileges.
+ * Restricts a user's ability to possess or grant admin privileges.
*
- * <p>This restriction limits ability of other admin users to grant admin
- * privileges to selected user.
+ * <p>When set to <code>true</code>, this prevents the user from:
+ * <ul>
+ * <li>Becoming an admin</li>
+ * <li>Giving other users admin privileges</li>
+ * </ul>
*
- * <p>This restriction has no effect in a mode that does not allow multiple admins.
+ * <p>This restriction is only effective in environments where multiple admins are allowed.
*
- * <p>The default value is <code>false</code>.
+ * <p>Key for user restrictions. Type: Boolean. Default: <code>false</code>.
*
- * <p>Key for user restrictions.
- * <p>Type: Boolean
* @see DevicePolicyManager#addUserRestriction(ComponentName, String)
* @see DevicePolicyManager#clearUserRestriction(ComponentName, String)
* @see #getUserRestrictions()
diff --git a/core/java/android/os/VintfObject.java b/core/java/android/os/VintfObject.java
index 505655775239..bb89e0791053 100644
--- a/core/java/android/os/VintfObject.java
+++ b/core/java/android/os/VintfObject.java
@@ -17,8 +17,11 @@
package android.os;
import android.annotation.NonNull;
+import android.annotation.Nullable;
import android.annotation.TestApi;
+import android.app.ActivityThread;
+import java.io.IOException;
import java.util.Map;
/**
@@ -113,5 +116,20 @@ public class VintfObject {
@TestApi
public static native Long getTargetFrameworkCompatibilityMatrixVersion();
+ /**
+ * Executes a shell command using shell user identity, and return the standard output in string.
+ *
+ * @hide
+ */
+ private static @Nullable String runShellCommand(@NonNull String command) throws IOException {
+ var activityThread = ActivityThread.currentActivityThread();
+ var instrumentation = activityThread.getInstrumentation();
+ var automation = instrumentation.getUiAutomation();
+ var pfd = automation.executeShellCommand(command);
+ try (var is = new ParcelFileDescriptor.AutoCloseInputStream(pfd)) {
+ return new String(is.readAllBytes());
+ }
+ }
+
private VintfObject() {}
}
diff --git a/core/java/android/provider/CallLog.java b/core/java/android/provider/CallLog.java
index 120846ca593b..708c1966be8b 100644
--- a/core/java/android/provider/CallLog.java
+++ b/core/java/android/provider/CallLog.java
@@ -2017,7 +2017,7 @@ public class CallLog {
return false;
}
final UserInfo userInfo = userManager.getUserInfo(userId);
- return userInfo != null && !userInfo.isManagedProfile();
+ return userInfo != null && !userInfo.isProfile();
}
/**
diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java
index 4f5b67c34845..3738c266641b 100644
--- a/core/java/android/provider/Settings.java
+++ b/core/java/android/provider/Settings.java
@@ -17032,6 +17032,28 @@ public final class Settings {
*/
public static final String ENABLE_BACK_ANIMATION = "enable_back_animation";
+ /**
+ * An allow list of packages for which the user has granted the permission to communicate
+ * across profiles.
+ *
+ * @hide
+ */
+ @Readable
+ @FlaggedApi(android.app.admin.flags.Flags.FLAG_BACKUP_CONNECTED_APPS_SETTINGS)
+ public static final String CONNECTED_APPS_ALLOWED_PACKAGES =
+ "connected_apps_allowed_packages";
+
+ /**
+ * A block list of packages for which the user has denied the permission to communicate
+ * across profiles.
+ *
+ * @hide
+ */
+ @Readable
+ @FlaggedApi(android.app.admin.flags.Flags.FLAG_BACKUP_CONNECTED_APPS_SETTINGS)
+ public static final String CONNECTED_APPS_DISALLOWED_PACKAGES =
+ "connected_apps_disallowed_packages";
+
/** @hide */ public static String zenModeToString(int mode) {
if (mode == ZEN_MODE_IMPORTANT_INTERRUPTIONS) return "ZEN_MODE_IMPORTANT_INTERRUPTIONS";
if (mode == ZEN_MODE_ALARMS) return "ZEN_MODE_ALARMS";
diff --git a/core/java/android/service/dreams/DreamService.java b/core/java/android/service/dreams/DreamService.java
index 38ab590b3c46..71066ac7ac39 100644
--- a/core/java/android/service/dreams/DreamService.java
+++ b/core/java/android/service/dreams/DreamService.java
@@ -433,7 +433,8 @@ public class DreamService extends Service implements Window.Callback {
mTrackingConfirmKey = event.getKeyCode();
}
case KeyEvent.ACTION_UP -> {
- if (mTrackingConfirmKey != event.getKeyCode()) {
+ if (mTrackingConfirmKey == null
+ || mTrackingConfirmKey != event.getKeyCode()) {
return true;
}
diff --git a/core/java/android/service/ondeviceintelligence/OnDeviceIntelligenceService.java b/core/java/android/service/ondeviceintelligence/OnDeviceIntelligenceService.java
index 793e58ac5d3b..293015f86cee 100644
--- a/core/java/android/service/ondeviceintelligence/OnDeviceIntelligenceService.java
+++ b/core/java/android/service/ondeviceintelligence/OnDeviceIntelligenceService.java
@@ -18,6 +18,9 @@ package android.service.ondeviceintelligence;
import static android.app.ondeviceintelligence.flags.Flags.FLAG_ENABLE_ON_DEVICE_INTELLIGENCE;
+import static com.android.internal.util.function.pooled.PooledLambda.obtainMessage;
+
+import android.annotation.CallSuper;
import android.annotation.CallbackExecutor;
import android.annotation.FlaggedApi;
import android.annotation.NonNull;
@@ -40,13 +43,16 @@ import android.content.Intent;
import android.os.Binder;
import android.os.Bundle;
import android.os.CancellationSignal;
+import android.os.Handler;
import android.os.IBinder;
import android.os.ICancellationSignal;
+import android.os.Looper;
import android.os.OutcomeReceiver;
import android.os.ParcelFileDescriptor;
import android.os.PersistableBundle;
import android.os.RemoteCallback;
import android.os.RemoteException;
+import android.util.Log;
import android.util.Slog;
import com.android.internal.infra.AndroidFuture;
@@ -88,6 +94,14 @@ public abstract class OnDeviceIntelligenceService extends Service {
private static final String TAG = OnDeviceIntelligenceService.class.getSimpleName();
private volatile IRemoteProcessingService mRemoteProcessingService;
+ private Handler mHandler;
+
+ @CallSuper
+ @Override
+ public void onCreate() {
+ super.onCreate();
+ mHandler = new Handler(Looper.getMainLooper(), null /* callback */, true /* async */);
+ }
/**
* The {@link Intent} that must be declared as handled by the service. To be supported, the
@@ -107,38 +121,49 @@ public abstract class OnDeviceIntelligenceService extends Service {
@Override
public final IBinder onBind(@NonNull Intent intent) {
if (SERVICE_INTERFACE.equals(intent.getAction())) {
- // TODO(326052028) : Move the remote method calls to an app handler from the binder
- // thread.
return new IOnDeviceIntelligenceService.Stub() {
/** {@inheritDoc} */
@Override
public void ready() {
- OnDeviceIntelligenceService.this.onReady();
+ mHandler.executeOrSendMessage(
+ obtainMessage(OnDeviceIntelligenceService::onReady,
+ OnDeviceIntelligenceService.this));
}
@Override
public void getVersion(RemoteCallback remoteCallback) {
Objects.requireNonNull(remoteCallback);
- OnDeviceIntelligenceService.this.onGetVersion(l -> {
- Bundle b = new Bundle();
- b.putLong(OnDeviceIntelligenceManager.API_VERSION_BUNDLE_KEY, l);
- remoteCallback.sendResult(b);
- });
+ mHandler.executeOrSendMessage(
+ obtainMessage(
+ OnDeviceIntelligenceService::onGetVersion,
+ OnDeviceIntelligenceService.this, l -> {
+ Bundle b = new Bundle();
+ b.putLong(
+ OnDeviceIntelligenceManager.API_VERSION_BUNDLE_KEY,
+ l);
+ remoteCallback.sendResult(b);
+ }));
}
@Override
public void listFeatures(int callerUid,
IListFeaturesCallback listFeaturesCallback) {
Objects.requireNonNull(listFeaturesCallback);
- OnDeviceIntelligenceService.this.onListFeatures(callerUid,
- wrapListFeaturesCallback(listFeaturesCallback));
+ mHandler.executeOrSendMessage(
+ obtainMessage(
+ OnDeviceIntelligenceService::onListFeatures,
+ OnDeviceIntelligenceService.this, callerUid,
+ wrapListFeaturesCallback(listFeaturesCallback)));
}
@Override
public void getFeature(int callerUid, int id, IFeatureCallback featureCallback) {
Objects.requireNonNull(featureCallback);
- OnDeviceIntelligenceService.this.onGetFeature(callerUid,
- id, wrapFeatureCallback(featureCallback));
+ mHandler.executeOrSendMessage(
+ obtainMessage(
+ OnDeviceIntelligenceService::onGetFeature,
+ OnDeviceIntelligenceService.this, callerUid,
+ id, wrapFeatureCallback(featureCallback)));
}
@@ -147,9 +172,11 @@ public abstract class OnDeviceIntelligenceService extends Service {
IFeatureDetailsCallback featureDetailsCallback) {
Objects.requireNonNull(feature);
Objects.requireNonNull(featureDetailsCallback);
-
- OnDeviceIntelligenceService.this.onGetFeatureDetails(callerUid,
- feature, wrapFeatureDetailsCallback(featureDetailsCallback));
+ mHandler.executeOrSendMessage(
+ obtainMessage(
+ OnDeviceIntelligenceService::onGetFeatureDetails,
+ OnDeviceIntelligenceService.this, callerUid,
+ feature, wrapFeatureDetailsCallback(featureDetailsCallback)));
}
@Override
@@ -163,10 +190,13 @@ public abstract class OnDeviceIntelligenceService extends Service {
transport = CancellationSignal.createTransport();
cancellationSignalFuture.complete(transport);
}
- OnDeviceIntelligenceService.this.onDownloadFeature(callerUid,
- feature,
- CancellationSignal.fromTransport(transport),
- wrapDownloadCallback(downloadCallback));
+ mHandler.executeOrSendMessage(
+ obtainMessage(
+ OnDeviceIntelligenceService::onDownloadFeature,
+ OnDeviceIntelligenceService.this, callerUid,
+ feature,
+ CancellationSignal.fromTransport(transport),
+ wrapDownloadCallback(downloadCallback)));
}
@Override
@@ -174,9 +204,11 @@ public abstract class OnDeviceIntelligenceService extends Service {
AndroidFuture<ParcelFileDescriptor> future) {
Objects.requireNonNull(fileName);
Objects.requireNonNull(future);
-
- OnDeviceIntelligenceService.this.onGetReadOnlyFileDescriptor(fileName,
- future);
+ mHandler.executeOrSendMessage(
+ obtainMessage(
+ OnDeviceIntelligenceService::onGetReadOnlyFileDescriptor,
+ OnDeviceIntelligenceService.this, fileName,
+ future));
}
@Override
@@ -184,13 +216,15 @@ public abstract class OnDeviceIntelligenceService extends Service {
Feature feature, RemoteCallback remoteCallback) {
Objects.requireNonNull(feature);
Objects.requireNonNull(remoteCallback);
-
- OnDeviceIntelligenceService.this.onGetReadOnlyFeatureFileDescriptorMap(
- feature, parcelFileDescriptorMap -> {
- Bundle bundle = new Bundle();
- parcelFileDescriptorMap.forEach(bundle::putParcelable);
- remoteCallback.sendResult(bundle);
- });
+ mHandler.executeOrSendMessage(
+ obtainMessage(
+ OnDeviceIntelligenceService::onGetReadOnlyFeatureFileDescriptorMap,
+ OnDeviceIntelligenceService.this, feature,
+ parcelFileDescriptorMap -> {
+ Bundle bundle = new Bundle();
+ parcelFileDescriptorMap.forEach(bundle::putParcelable);
+ remoteCallback.sendResult(bundle);
+ }));
}
@Override
@@ -201,12 +235,18 @@ public abstract class OnDeviceIntelligenceService extends Service {
@Override
public void notifyInferenceServiceConnected() {
- OnDeviceIntelligenceService.this.onInferenceServiceConnected();
+ mHandler.executeOrSendMessage(
+ obtainMessage(
+ OnDeviceIntelligenceService::onInferenceServiceConnected,
+ OnDeviceIntelligenceService.this));
}
@Override
public void notifyInferenceServiceDisconnected() {
- OnDeviceIntelligenceService.this.onInferenceServiceDisconnected();
+ mHandler.executeOrSendMessage(
+ obtainMessage(
+ OnDeviceIntelligenceService::onInferenceServiceDisconnected,
+ OnDeviceIntelligenceService.this));
}
};
}
@@ -222,7 +262,8 @@ public abstract class OnDeviceIntelligenceService extends Service {
* @hide
*/
@TestApi
- public void onReady() {}
+ public void onReady() {
+ }
/**
@@ -410,12 +451,16 @@ public abstract class OnDeviceIntelligenceService extends Service {
Slog.v(TAG,
"onGetReadOnlyFileDescriptor: " + fileName + " under internal app storage.");
File f = new File(getBaseContext().getFilesDir(), fileName);
+ if (!f.exists()) {
+ f = new File(fileName);
+ }
ParcelFileDescriptor pfd = null;
try {
pfd = ParcelFileDescriptor.open(f, ParcelFileDescriptor.MODE_READ_ONLY);
Slog.d(TAG, "Successfully opened a file with ParcelFileDescriptor.");
} catch (FileNotFoundException e) {
Slog.e(TAG, "Cannot open file. No ParcelFileDescriptor returned.");
+ future.completeExceptionally(e);
} finally {
future.complete(pfd);
if (pfd != null) {
diff --git a/core/java/android/service/ondeviceintelligence/OnDeviceSandboxedInferenceService.java b/core/java/android/service/ondeviceintelligence/OnDeviceSandboxedInferenceService.java
index 8237b20260ea..d00485cb1ca5 100644
--- a/core/java/android/service/ondeviceintelligence/OnDeviceSandboxedInferenceService.java
+++ b/core/java/android/service/ondeviceintelligence/OnDeviceSandboxedInferenceService.java
@@ -19,7 +19,10 @@ package android.service.ondeviceintelligence;
import static android.app.ondeviceintelligence.OnDeviceIntelligenceManager.AUGMENT_REQUEST_CONTENT_BUNDLE_KEY;
import static android.app.ondeviceintelligence.flags.Flags.FLAG_ENABLE_ON_DEVICE_INTELLIGENCE;
+import static com.android.internal.util.function.pooled.PooledLambda.obtainMessage;
+
import android.annotation.CallbackExecutor;
+import android.annotation.CallSuper;
import android.annotation.FlaggedApi;
import android.annotation.NonNull;
import android.annotation.Nullable;
@@ -48,6 +51,7 @@ import android.os.Handler;
import android.os.HandlerExecutor;
import android.os.IBinder;
import android.os.ICancellationSignal;
+import android.os.Looper;
import android.os.OutcomeReceiver;
import android.os.ParcelFileDescriptor;
import android.os.PersistableBundle;
@@ -120,7 +124,20 @@ public abstract class OnDeviceSandboxedInferenceService extends Service {
*/
public static final String MODEL_UNLOADED_BUNDLE_KEY = "model_unloaded";
+ /**
+ * @hide
+ */
+ public static final String DEVICE_CONFIG_UPDATE_BUNDLE_KEY = "device_config_update";
+
private IRemoteStorageService mRemoteStorageService;
+ private Handler mHandler;
+
+ @CallSuper
+ @Override
+ public void onCreate() {
+ super.onCreate();
+ mHandler = new Handler(Looper.getMainLooper(), null /* callback */, true /* async */);
+ }
/**
* @hide
@@ -147,11 +164,15 @@ public abstract class OnDeviceSandboxedInferenceService extends Service {
transport = CancellationSignal.createTransport();
cancellationSignalFuture.complete(transport);
}
- OnDeviceSandboxedInferenceService.this.onTokenInfoRequest(callerUid,
- feature,
- request,
- CancellationSignal.fromTransport(transport),
- wrapTokenInfoCallback(tokenInfoCallback));
+
+ mHandler.executeOrSendMessage(
+ obtainMessage(
+ OnDeviceSandboxedInferenceService::onTokenInfoRequest,
+ OnDeviceSandboxedInferenceService.this,
+ callerUid, feature,
+ request,
+ CancellationSignal.fromTransport(transport),
+ wrapTokenInfoCallback(tokenInfoCallback)));
}
@Override
@@ -173,13 +194,18 @@ public abstract class OnDeviceSandboxedInferenceService extends Service {
processingSignalTransport = ProcessingSignal.createTransport();
processingSignalFuture.complete(processingSignalTransport);
}
- OnDeviceSandboxedInferenceService.this.onProcessRequestStreaming(callerUid,
- feature,
- request,
- requestType,
- CancellationSignal.fromTransport(transport),
- ProcessingSignal.fromTransport(processingSignalTransport),
- wrapStreamingResponseCallback(callback));
+
+
+ mHandler.executeOrSendMessage(
+ obtainMessage(
+ OnDeviceSandboxedInferenceService::onProcessRequestStreaming,
+ OnDeviceSandboxedInferenceService.this, callerUid,
+ feature,
+ request,
+ requestType,
+ CancellationSignal.fromTransport(transport),
+ ProcessingSignal.fromTransport(processingSignalTransport),
+ wrapStreamingResponseCallback(callback)));
}
@Override
@@ -200,11 +226,14 @@ public abstract class OnDeviceSandboxedInferenceService extends Service {
processingSignalTransport = ProcessingSignal.createTransport();
processingSignalFuture.complete(processingSignalTransport);
}
- OnDeviceSandboxedInferenceService.this.onProcessRequest(callerUid, feature,
- request, requestType,
- CancellationSignal.fromTransport(transport),
- ProcessingSignal.fromTransport(processingSignalTransport),
- wrapResponseCallback(callback));
+ mHandler.executeOrSendMessage(
+ obtainMessage(
+ OnDeviceSandboxedInferenceService::onProcessRequest,
+ OnDeviceSandboxedInferenceService.this, callerUid, feature,
+ request, requestType,
+ CancellationSignal.fromTransport(transport),
+ ProcessingSignal.fromTransport(processingSignalTransport),
+ wrapResponseCallback(callback)));
}
@Override
@@ -212,10 +241,11 @@ public abstract class OnDeviceSandboxedInferenceService extends Service {
IProcessingUpdateStatusCallback callback) {
Objects.requireNonNull(processingState);
Objects.requireNonNull(callback);
-
- OnDeviceSandboxedInferenceService.this.onUpdateProcessingState(processingState,
- wrapOutcomeReceiver(callback)
- );
+ mHandler.executeOrSendMessage(
+ obtainMessage(
+ OnDeviceSandboxedInferenceService::onUpdateProcessingState,
+ OnDeviceSandboxedInferenceService.this, processingState,
+ wrapOutcomeReceiver(callback)));
}
};
}
diff --git a/core/java/android/text/DynamicLayout.java b/core/java/android/text/DynamicLayout.java
index cce4f7bf7b1f..a78a417300ab 100644
--- a/core/java/android/text/DynamicLayout.java
+++ b/core/java/android/text/DynamicLayout.java
@@ -310,6 +310,7 @@ public class DynamicLayout extends Layout {
* @see Layout#getUseBoundsForWidth()
* @see Layout.Builder#setUseBoundsForWidth(boolean)
*/
+ @SuppressLint("MissingGetterMatchingBuilder") // The base class `Layout` has a getter.
@NonNull
@FlaggedApi(FLAG_USE_BOUNDS_FOR_WIDTH)
public Builder setUseBoundsForWidth(boolean useBoundsForWidth) {
diff --git a/core/java/android/text/StaticLayout.java b/core/java/android/text/StaticLayout.java
index 3dd3a9ea8baf..95460a3575eb 100644
--- a/core/java/android/text/StaticLayout.java
+++ b/core/java/android/text/StaticLayout.java
@@ -447,6 +447,7 @@ public class StaticLayout extends Layout {
* @see Layout#getUseBoundsForWidth()
* @see Layout.Builder#setUseBoundsForWidth(boolean)
*/
+ @SuppressLint("MissingGetterMatchingBuilder") // The base class `Layout` has a getter.
@NonNull
@FlaggedApi(FLAG_USE_BOUNDS_FOR_WIDTH)
public Builder setUseBoundsForWidth(boolean useBoundsForWidth) {
diff --git a/core/java/android/text/flags/flags.aconfig b/core/java/android/text/flags/flags.aconfig
index 56df32847d74..70dc300e59d0 100644
--- a/core/java/android/text/flags/flags.aconfig
+++ b/core/java/android/text/flags/flags.aconfig
@@ -181,3 +181,13 @@ flag {
purpose: PURPOSE_BUGFIX
}
}
+
+flag {
+ name: "missing_getter_apis"
+ namespace: "text"
+ description: "Fix the lint warning about missing getters."
+ bug: "340875345"
+ metadata {
+ purpose: PURPOSE_BUGFIX
+ }
+}
diff --git a/core/java/android/view/Display.java b/core/java/android/view/Display.java
index 4475418e1e57..6464239eb2fc 100644
--- a/core/java/android/view/Display.java
+++ b/core/java/android/view/Display.java
@@ -916,6 +916,12 @@ public final class Display {
* {@code getWindowManager()} or {@code getSystemService(Context.WINDOW_SERVICE)}), the
* size of the current app window is returned. As a result, in multi-window mode, the
* returned size can be smaller than the size of the device screen.
+ * The returned window size can vary depending on API level:
+ * <ul>
+ * <li>API level 35 and above, the window size will be returned.
+ * <li>API level 34 and below, the window size minus system decoration areas and
+ * display cutout is returned.
+ * </ul>
* <li>If size is requested from a non-activity context (for example, the application
* context, where the WindowManager is accessed by
* {@code getApplicationContext().getSystemService(Context.WINDOW_SERVICE)}), the
@@ -924,9 +930,10 @@ public final class Display {
* <li>API level 29 and below &mdash; The size of the entire display (based on
* current rotation) minus system decoration areas is returned.
* <li>API level 30 and above &mdash; The size of the top running activity in the
- * current process is returned. If the current process has no running
- * activities, the size of the device default display, including system
- * decoration areas, is returned.
+ * current process is returned, system decoration areas exclusion follows the
+ * behavior defined above, based on the caller's API level. If the current
+ * process has no running activities, the size of the device default display,
+ * including system decoration areas, is returned.
* </ul>
* </ul>
*
diff --git a/core/java/android/view/IWindow.aidl b/core/java/android/view/IWindow.aidl
index 374303501ffc..f628c2166d15 100644
--- a/core/java/android/view/IWindow.aidl
+++ b/core/java/android/view/IWindow.aidl
@@ -68,7 +68,8 @@ oneway interface IWindow {
/**
* Called when this window retrieved control over a specified set of insets sources.
*/
- void insetsControlChanged(in InsetsState insetsState, in InsetsSourceControl[] activeControls);
+ void insetsControlChanged(in InsetsState insetsState,
+ in InsetsSourceControl.Array activeControls);
/**
* Called when a set of insets source window should be shown by policy.
diff --git a/core/java/android/view/ImeBackAnimationController.java b/core/java/android/view/ImeBackAnimationController.java
index 8c14de6156a3..fc1852d739e2 100644
--- a/core/java/android/view/ImeBackAnimationController.java
+++ b/core/java/android/view/ImeBackAnimationController.java
@@ -255,10 +255,11 @@ public class ImeBackAnimationController implements OnBackAnimationCallback {
private boolean isBackAnimationAllowed() {
// back animation is allowed in all cases except when softInputMode is adjust_resize AND
- // there is no app-registered WindowInsetsAnimationCallback.
+ // there is no app-registered WindowInsetsAnimationCallback AND edge-to-edge is not enabled.
return (mViewRoot.mWindowAttributes.softInputMode & SOFT_INPUT_MASK_ADJUST)
!= SOFT_INPUT_ADJUST_RESIZE
- || (mViewRoot.mView != null && mViewRoot.mView.hasWindowInsetsAnimationCallback());
+ || (mViewRoot.mView != null && mViewRoot.mView.hasWindowInsetsAnimationCallback())
+ || mViewRoot.mAttachInfo.mContentOnApplyWindowInsetsListener == null;
}
private boolean isAdjustPan() {
diff --git a/core/java/android/view/InputDevice.java b/core/java/android/view/InputDevice.java
index d22d2a52c8cc..609ad5bb013c 100644
--- a/core/java/android/view/InputDevice.java
+++ b/core/java/android/view/InputDevice.java
@@ -78,6 +78,7 @@ public final class InputDevice implements Parcelable {
private final InputDeviceIdentifier mIdentifier;
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P)
private final boolean mIsExternal;
+ @Source
private final int mSources;
private final int mKeyboardType;
private final KeyCharacterMap mKeyCharacterMap;
@@ -92,6 +93,7 @@ public final class InputDevice implements Parcelable {
private final boolean mHasBattery;
private final HostUsiVersion mHostUsiVersion;
private final int mAssociatedDisplayId;
+ private final boolean mEnabled;
private final ArrayList<MotionRange> mMotionRanges = new ArrayList<MotionRange>();
private final ViewBehavior mViewBehavior = new ViewBehavior(this);
@@ -359,6 +361,28 @@ public final class InputDevice implements Parcelable {
*/
public static final int SOURCE_ANY = 0xffffff00;
+ /** @hide */
+ @IntDef(flag = true, prefix = { "SOURCE_" }, value = {
+ SOURCE_UNKNOWN,
+ SOURCE_KEYBOARD,
+ SOURCE_DPAD,
+ SOURCE_GAMEPAD,
+ SOURCE_TOUCHSCREEN,
+ SOURCE_MOUSE,
+ SOURCE_STYLUS,
+ SOURCE_BLUETOOTH_STYLUS,
+ SOURCE_TRACKBALL,
+ SOURCE_MOUSE_RELATIVE,
+ SOURCE_TOUCHPAD,
+ SOURCE_TOUCH_NAVIGATION,
+ SOURCE_ROTARY_ENCODER,
+ SOURCE_JOYSTICK,
+ SOURCE_HDMI,
+ SOURCE_SENSOR,
+ })
+ @Retention(RetentionPolicy.SOURCE)
+ @interface Source {}
+
/**
* Constant for retrieving the range of values for {@link MotionEvent#AXIS_X}.
*
@@ -479,7 +503,7 @@ public final class InputDevice implements Parcelable {
int keyboardType, KeyCharacterMap keyCharacterMap, @Nullable String keyboardLanguageTag,
@Nullable String keyboardLayoutType, boolean hasVibrator, boolean hasMicrophone,
boolean hasButtonUnderPad, boolean hasSensor, boolean hasBattery, int usiVersionMajor,
- int usiVersionMinor, int associatedDisplayId) {
+ int usiVersionMinor, int associatedDisplayId, boolean enabled) {
mId = id;
mGeneration = generation;
mControllerNumber = controllerNumber;
@@ -510,6 +534,7 @@ public final class InputDevice implements Parcelable {
mIdentifier = new InputDeviceIdentifier(descriptor, vendorId, productId);
mHostUsiVersion = new HostUsiVersion(usiVersionMajor, usiVersionMinor);
mAssociatedDisplayId = associatedDisplayId;
+ mEnabled = enabled;
}
private InputDevice(Parcel in) {
@@ -534,6 +559,7 @@ public final class InputDevice implements Parcelable {
mHasBattery = in.readInt() != 0;
mHostUsiVersion = HostUsiVersion.CREATOR.createFromParcel(in);
mAssociatedDisplayId = in.readInt();
+ mEnabled = in.readInt() != 0;
mIdentifier = new InputDeviceIdentifier(mDescriptor, mVendorId, mProductId);
int numRanges = in.readInt();
@@ -578,6 +604,8 @@ public final class InputDevice implements Parcelable {
private int mUsiVersionMajor = -1;
private int mUsiVersionMinor = -1;
private int mAssociatedDisplayId = Display.INVALID_DISPLAY;
+ // The default is true, the same as the native default state.
+ private boolean mEnabled = true;
private List<MotionRange> mMotionRanges = new ArrayList<>();
private boolean mShouldSmoothScroll;
@@ -708,6 +736,12 @@ public final class InputDevice implements Parcelable {
return this;
}
+ /** @see InputDevice#isEnabled() */
+ public Builder setEnabled(boolean enabled) {
+ mEnabled = enabled;
+ return this;
+ }
+
/** @see InputDevice#getMotionRanges() */
public Builder addMotionRange(int axis, int source,
float min, float max, float flat, float fuzz, float resolution) {
@@ -749,7 +783,8 @@ public final class InputDevice implements Parcelable {
mHasBattery,
mUsiVersionMajor,
mUsiVersionMinor,
- mAssociatedDisplayId);
+ mAssociatedDisplayId,
+ mEnabled);
final int numRanges = mMotionRanges.size();
for (int i = 0; i < numRanges; i++) {
@@ -1298,7 +1333,7 @@ public final class InputDevice implements Parcelable {
* @return Whether the input device is enabled.
*/
public boolean isEnabled() {
- return InputManagerGlobal.getInstance().isInputDeviceEnabled(mId);
+ return mEnabled;
}
/**
@@ -1588,6 +1623,7 @@ public final class InputDevice implements Parcelable {
out.writeInt(mHasBattery ? 1 : 0);
mHostUsiVersion.writeToParcel(out, flags);
out.writeInt(mAssociatedDisplayId);
+ out.writeInt(mEnabled ? 1 : 0);
int numRanges = mMotionRanges.size();
numRanges = numRanges > MAX_RANGES ? MAX_RANGES : numRanges;
@@ -1619,6 +1655,7 @@ public final class InputDevice implements Parcelable {
description.append(" Generation: ").append(mGeneration).append("\n");
description.append(" Location: ").append(mIsExternal ? "external" : "built-in").append(
"\n");
+ description.append(" Enabled: ").append(isEnabled()).append("\n");
description.append(" Keyboard Type: ");
switch (mKeyboardType) {
diff --git a/core/java/android/view/InsetsController.java b/core/java/android/view/InsetsController.java
index d7f2b01f46ea..1fc98cfa7eb4 100644
--- a/core/java/android/view/InsetsController.java
+++ b/core/java/android/view/InsetsController.java
@@ -303,7 +303,7 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation
}
/** Not running an animation. */
- @VisibleForTesting
+ @VisibleForTesting(visibility = PACKAGE)
public static final int ANIMATION_TYPE_NONE = -1;
/** Running animation will show insets */
@@ -317,7 +317,7 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation
public static final int ANIMATION_TYPE_USER = 2;
/** Running animation will resize insets */
- @VisibleForTesting
+ @VisibleForTesting(visibility = PACKAGE)
public static final int ANIMATION_TYPE_RESIZE = 3;
@Retention(RetentionPolicy.SOURCE)
@@ -1262,9 +1262,11 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation
mHost.getInputMethodManager(), null /* icProto */);
}
- final var statsToken = ImeTracker.forLogging().onStart(ImeTracker.TYPE_USER,
- ImeTracker.ORIGIN_CLIENT, SoftInputShowHideReason.CONTROL_WINDOW_INSETS_ANIMATION,
- mHost.isHandlingPointerEvent() /* fromUser */);
+ final var statsToken = (types & ime()) == 0 ? null
+ : ImeTracker.forLogging().onStart(ImeTracker.TYPE_USER,
+ ImeTracker.ORIGIN_CLIENT,
+ SoftInputShowHideReason.CONTROL_WINDOW_INSETS_ANIMATION,
+ mHost.isHandlingPointerEvent() /* fromUser */);
controlAnimationUnchecked(types, cancellationSignal, listener, mFrame, fromIme, durationMs,
interpolator, animationType,
getLayoutInsetsDuringAnimationMode(types, fromPredictiveBack),
@@ -1714,7 +1716,7 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation
mImeSourceConsumer.onWindowFocusLost();
}
- @VisibleForTesting
+ @VisibleForTesting(visibility = PACKAGE)
public @AnimationType int getAnimationType(@InsetsType int type) {
for (int i = mRunningAnimations.size() - 1; i >= 0; i--) {
InsetsAnimationControlRunner control = mRunningAnimations.get(i).runner;
diff --git a/core/java/android/view/InsetsSourceConsumer.java b/core/java/android/view/InsetsSourceConsumer.java
index fdb2a6ee1791..6c670f5d6934 100644
--- a/core/java/android/view/InsetsSourceConsumer.java
+++ b/core/java/android/view/InsetsSourceConsumer.java
@@ -17,6 +17,7 @@
package android.view;
import static android.view.InsetsController.ANIMATION_TYPE_NONE;
+import static android.view.InsetsController.ANIMATION_TYPE_RESIZE;
import static android.view.InsetsController.AnimationType;
import static android.view.InsetsController.DEBUG;
import static android.view.InsetsSourceConsumerProto.ANIMATION_STATE;
@@ -31,6 +32,7 @@ import static com.android.internal.annotations.VisibleForTesting.Visibility.PACK
import android.annotation.IntDef;
import android.annotation.Nullable;
+import android.graphics.Point;
import android.graphics.Rect;
import android.util.Log;
import android.util.proto.ProtoOutputStream;
@@ -179,10 +181,11 @@ public class InsetsSourceConsumer {
mController.notifyVisibilityChanged();
}
- // If we have a new leash, make sure visibility is up-to-date, even though we
- // didn't want to run an animation above.
- if (mController.getAnimationType(mType) == ANIMATION_TYPE_NONE) {
- applyRequestedVisibilityToControl();
+ // If there is no animation controlling the leash, make sure the visibility and the
+ // position is up-to-date.
+ final int animType = mController.getAnimationType(mType);
+ if (animType == ANIMATION_TYPE_NONE || animType == ANIMATION_TYPE_RESIZE) {
+ applyRequestedVisibilityAndPositionToControl();
}
// Remove the surface that owned by last control when it lost.
@@ -371,21 +374,27 @@ public class InsetsSourceConsumer {
if (DEBUG) Log.d(TAG, "updateSource: " + newSource);
}
- private void applyRequestedVisibilityToControl() {
- if (mSourceControl == null || mSourceControl.getLeash() == null) {
+ private void applyRequestedVisibilityAndPositionToControl() {
+ if (mSourceControl == null) {
+ return;
+ }
+ final SurfaceControl leash = mSourceControl.getLeash();
+ if (leash == null) {
return;
}
final boolean requestedVisible = (mController.getRequestedVisibleTypes() & mType) != 0;
+ final Point surfacePosition = mSourceControl.getSurfacePosition();
try (Transaction t = mTransactionSupplier.get()) {
if (DEBUG) Log.d(TAG, "applyRequestedVisibilityToControl: " + requestedVisible);
if (requestedVisible) {
- t.show(mSourceControl.getLeash());
+ t.show(leash);
} else {
- t.hide(mSourceControl.getLeash());
+ t.hide(leash);
}
// Ensure the alpha value is aligned with the actual requested visibility.
- t.setAlpha(mSourceControl.getLeash(), requestedVisible ? 1 : 0);
+ t.setAlpha(leash, requestedVisible ? 1 : 0);
+ t.setPosition(leash, surfacePosition.x, surfacePosition.y);
t.apply();
}
onPerceptible(requestedVisible);
diff --git a/core/java/android/view/KeyEvent.java b/core/java/android/view/KeyEvent.java
index 154f1fedbcfa..01015ea250e0 100644
--- a/core/java/android/view/KeyEvent.java
+++ b/core/java/android/view/KeyEvent.java
@@ -20,6 +20,7 @@ import static android.os.IInputConstants.INPUT_EVENT_FLAG_IS_ACCESSIBILITY_EVENT
import static android.view.Display.INVALID_DISPLAY;
import android.annotation.FlaggedApi;
+import android.annotation.IntDef;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.TestApi;
@@ -35,6 +36,8 @@ import android.view.KeyCharacterMap.KeyData;
import com.android.hardware.input.Flags;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
import java.util.concurrent.TimeUnit;
/**
@@ -944,7 +947,7 @@ public class KeyEvent extends InputEvent implements Parcelable {
@FlaggedApi(Flags.FLAG_EMOJI_AND_SCREENSHOT_KEYCODES_AVAILABLE)
public static final int KEYCODE_SCREENSHOT = 318;
- /**
+ /**
* Integer value of the last KEYCODE. Increases as new keycodes are added to KeyEvent.
* @hide
*/
@@ -1034,6 +1037,15 @@ public class KeyEvent extends InputEvent implements Parcelable {
@Deprecated
public static final int ACTION_MULTIPLE = 2;
+ /** @hide */
+ @IntDef(prefix = {"ACTION_"}, value = {
+ ACTION_DOWN,
+ ACTION_UP,
+ ACTION_MULTIPLE,
+ })
+ @Retention(RetentionPolicy.SOURCE)
+ @interface Action {}
+
/**
* SHIFT key locked in CAPS mode.
* Reserved for use by {@link MetaKeyKeyListener} for a published constant in its API.
@@ -1222,6 +1234,33 @@ public class KeyEvent extends InputEvent implements Parcelable {
*/
public static final int META_SCROLL_LOCK_ON = 0x400000;
+ /** @hide */
+ @IntDef(flag = true, prefix = {"META_"}, value = {
+ META_CAP_LOCKED,
+ META_ALT_LOCKED,
+ META_SYM_LOCKED,
+ META_SELECTING,
+ META_ALT_ON,
+ META_ALT_LEFT_ON,
+ META_ALT_RIGHT_ON,
+ META_SHIFT_ON,
+ META_SHIFT_LEFT_ON,
+ META_SHIFT_RIGHT_ON,
+ META_SYM_ON,
+ META_FUNCTION_ON,
+ META_CTRL_ON,
+ META_CTRL_LEFT_ON,
+ META_CTRL_RIGHT_ON,
+ META_META_ON,
+ META_META_LEFT_ON,
+ META_META_RIGHT_ON,
+ META_CAPS_LOCK_ON,
+ META_NUM_LOCK_ON,
+ META_SCROLL_LOCK_ON,
+ })
+ @Retention(RetentionPolicy.SOURCE)
+ @interface MetaState {}
+
/**
* This mask is a combination of {@link #META_SHIFT_ON}, {@link #META_SHIFT_LEFT_ON}
* and {@link #META_SHIFT_RIGHT_ON}.
@@ -1366,6 +1405,27 @@ public class KeyEvent extends InputEvent implements Parcelable {
*/
public static final int FLAG_TAINTED = IInputConstants.INPUT_EVENT_FLAG_TAINTED;
+ /** @hide */
+ @IntDef(flag = true, prefix = { "FLAG_" }, value = {
+ FLAG_WOKE_HERE,
+ FLAG_SOFT_KEYBOARD,
+ FLAG_KEEP_TOUCH_MODE,
+ FLAG_FROM_SYSTEM,
+ FLAG_EDITOR_ACTION,
+ FLAG_CANCELED,
+ FLAG_VIRTUAL_HARD_KEY,
+ FLAG_LONG_PRESS,
+ FLAG_CANCELED_LONG_PRESS,
+ FLAG_TRACKING,
+ FLAG_FALLBACK,
+ FLAG_IS_ACCESSIBILITY_EVENT,
+ FLAG_PREDISPATCH,
+ FLAG_START_TRACKING,
+ FLAG_TAINTED,
+ })
+ @Retention(RetentionPolicy.SOURCE)
+ @interface Flag {}
+
/**
* Returns the maximum keycode.
*/
@@ -1401,8 +1461,10 @@ public class KeyEvent extends InputEvent implements Parcelable {
// NOTE: mHmac is private and not used in this class, but it's used on native side / parcel.
private @Nullable byte[] mHmac;
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
+ @MetaState
private int mMetaState;
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
+ @Action
private int mAction;
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
private int mKeyCode;
@@ -1411,6 +1473,7 @@ public class KeyEvent extends InputEvent implements Parcelable {
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
private int mRepeatCount;
@UnsupportedAppUsage
+ @Flag
private int mFlags;
/**
* The time when the key initially was pressed, in nanoseconds. Only millisecond precision is
diff --git a/core/java/android/view/MotionEvent.java b/core/java/android/view/MotionEvent.java
index 38f9a91ae44f..6db40bf6e0b8 100644
--- a/core/java/android/view/MotionEvent.java
+++ b/core/java/android/view/MotionEvent.java
@@ -50,6 +50,7 @@ import dalvik.annotation.optimization.CriticalNative;
import dalvik.annotation.optimization.FastNative;
import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
import java.util.Objects;
/**
@@ -445,6 +446,25 @@ public final class MotionEvent extends InputEvent implements Parcelable {
@Deprecated
public static final int ACTION_POINTER_ID_SHIFT = 8;
+ /** @hide */
+ @IntDef(prefix = { "ACTION_" }, value = {
+ ACTION_DOWN,
+ ACTION_UP,
+ ACTION_MOVE,
+ ACTION_CANCEL,
+ ACTION_OUTSIDE,
+ ACTION_POINTER_DOWN,
+ ACTION_POINTER_UP,
+ ACTION_HOVER_MOVE,
+ ACTION_SCROLL,
+ ACTION_HOVER_ENTER,
+ ACTION_HOVER_EXIT,
+ ACTION_BUTTON_PRESS,
+ ACTION_BUTTON_RELEASE,
+ })
+ @Retention(RetentionPolicy.SOURCE)
+ @interface ActionMasked {}
+
/**
* This flag indicates that the window that received this motion event is partly
* or wholly obscured by another visible window above it and the event directly passed through
@@ -548,6 +568,21 @@ public final class MotionEvent extends InputEvent implements Parcelable {
public static final int FLAG_TARGET_ACCESSIBILITY_FOCUS =
MOTION_EVENT_FLAG_TARGET_ACCESSIBILITY_FOCUS;
+ /** @hide */
+ @IntDef(flag = true, prefix = { "FLAG_" }, value = {
+ FLAG_WINDOW_IS_OBSCURED,
+ FLAG_WINDOW_IS_PARTIALLY_OBSCURED,
+ FLAG_HOVER_EXIT_PENDING,
+ FLAG_IS_GENERATED_GESTURE,
+ FLAG_CANCELED,
+ FLAG_NO_FOCUS_CHANGE,
+ FLAG_IS_ACCESSIBILITY_EVENT,
+ FLAG_TAINTED,
+ FLAG_TARGET_ACCESSIBILITY_FOCUS,
+ })
+ @Retention(RetentionPolicy.SOURCE)
+ @interface Flag {}
+
/**
* Flag indicating the motion event intersected the top edge of the screen.
*/
@@ -1422,6 +1457,63 @@ public final class MotionEvent extends InputEvent implements Parcelable {
names.append(AXIS_GESTURE_SWIPE_FINGER_COUNT, "AXIS_GESTURE_SWIPE_FINGER_COUNT");
}
+ /** @hide */
+ @IntDef(prefix = { "AXIS_" }, value = {
+ AXIS_X,
+ AXIS_Y,
+ AXIS_PRESSURE,
+ AXIS_SIZE,
+ AXIS_TOUCH_MAJOR,
+ AXIS_TOUCH_MINOR,
+ AXIS_TOOL_MAJOR,
+ AXIS_TOOL_MINOR,
+ AXIS_ORIENTATION,
+ AXIS_VSCROLL,
+ AXIS_HSCROLL,
+ AXIS_Z,
+ AXIS_RX,
+ AXIS_RY,
+ AXIS_RZ,
+ AXIS_HAT_X,
+ AXIS_HAT_Y,
+ AXIS_LTRIGGER,
+ AXIS_RTRIGGER,
+ AXIS_THROTTLE,
+ AXIS_RUDDER,
+ AXIS_WHEEL,
+ AXIS_GAS,
+ AXIS_BRAKE,
+ AXIS_DISTANCE,
+ AXIS_TILT,
+ AXIS_SCROLL,
+ AXIS_RELATIVE_X,
+ AXIS_RELATIVE_Y,
+ AXIS_GENERIC_1,
+ AXIS_GENERIC_2,
+ AXIS_GENERIC_3,
+ AXIS_GENERIC_4,
+ AXIS_GENERIC_5,
+ AXIS_GENERIC_6,
+ AXIS_GENERIC_7,
+ AXIS_GENERIC_8,
+ AXIS_GENERIC_9,
+ AXIS_GENERIC_10,
+ AXIS_GENERIC_11,
+ AXIS_GENERIC_12,
+ AXIS_GENERIC_13,
+ AXIS_GENERIC_14,
+ AXIS_GENERIC_15,
+ AXIS_GENERIC_16,
+ AXIS_GESTURE_X_OFFSET,
+ AXIS_GESTURE_Y_OFFSET,
+ AXIS_GESTURE_SCROLL_X_DISTANCE,
+ AXIS_GESTURE_SCROLL_Y_DISTANCE,
+ AXIS_GESTURE_PINCH_SCALE_FACTOR,
+ AXIS_GESTURE_SWIPE_FINGER_COUNT,
+ })
+ @Retention(RetentionPolicy.SOURCE)
+ @interface Axis {}
+
/**
* Button constant: Primary button (left mouse button).
*
@@ -1522,6 +1614,19 @@ public final class MotionEvent extends InputEvent implements Parcelable {
"0x80000000",
};
+ /** @hide */
+ @IntDef(flag = true, prefix = { "BUTTON_" }, value = {
+ BUTTON_PRIMARY,
+ BUTTON_SECONDARY,
+ BUTTON_TERTIARY,
+ BUTTON_BACK,
+ BUTTON_FORWARD,
+ BUTTON_STYLUS_PRIMARY,
+ BUTTON_STYLUS_SECONDARY,
+ })
+ @Retention(RetentionPolicy.SOURCE)
+ @interface Button {}
+
/**
* Classification constant: None.
*
diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java
index 0715474f1c13..6a79f967b81e 100644
--- a/core/java/android/view/ViewRootImpl.java
+++ b/core/java/android/view/ViewRootImpl.java
@@ -11258,10 +11258,10 @@ public final class ViewRootImpl implements ViewParent,
@Override
public void insetsControlChanged(InsetsState insetsState,
- InsetsSourceControl[] activeControls) {
+ InsetsSourceControl.Array activeControls) {
final ViewRootImpl viewAncestor = mViewAncestor.get();
if (viewAncestor != null) {
- viewAncestor.dispatchInsetsControlChanged(insetsState, activeControls);
+ viewAncestor.dispatchInsetsControlChanged(insetsState, activeControls.get());
}
}
diff --git a/core/java/android/view/WindowManager.java b/core/java/android/view/WindowManager.java
index f22e8f583e1a..0f54940ba0e5 100644
--- a/core/java/android/view/WindowManager.java
+++ b/core/java/android/view/WindowManager.java
@@ -781,7 +781,7 @@ public interface WindowManager extends ViewManager {
* <p>
* The metrics describe the size of the area the window would occupy with
* {@link LayoutParams#MATCH_PARENT MATCH_PARENT} width and height, and the {@link WindowInsets}
- * such a window would have.
+ * such a window would have. The {@link WindowInsets} are not deducted from the bounds.
* <p>
* The value of this is based on the <b>current</b> windowing state of the system.
*
@@ -811,7 +811,7 @@ public interface WindowManager extends ViewManager {
* <p>
* The metrics describe the size of the largest potential area the window might occupy with
* {@link LayoutParams#MATCH_PARENT MATCH_PARENT} width and height, and the {@link WindowInsets}
- * such a window would have.
+ * such a window would have. The {@link WindowInsets} are not deducted from the bounds.
* <p>
* Note that this might still be smaller than the size of the physical display if certain areas
* of the display are not available to windows created in this {@link Context}.
@@ -4264,11 +4264,9 @@ public interface WindowManager extends ViewManager {
* no letterbox is applied."/>
*
* <p>
- * A cutout in the corner is considered to be on the short edge: <br/>
- * <img src="{@docRoot}reference/android/images/display_cutout/short_edge/fullscreen_corner_no_letterbox.png"
- * height="720"
- * alt="Screenshot of a fullscreen activity on a display with a cutout in the corner in
- * portrait, no letterbox is applied."/>
+ * A cutout in the corner can be considered to be on different edge in different device
+ * rotations. This behavior may vary from device to device. Use this flag is possible to
+ * letterbox your app if the display cutout is at corner.
*
* <p>
* On the other hand, should the cutout be on the long edge of the display, a letterbox will
diff --git a/core/java/android/view/WindowMetrics.java b/core/java/android/view/WindowMetrics.java
index 26298bc645ad..8bcc9de118e2 100644
--- a/core/java/android/view/WindowMetrics.java
+++ b/core/java/android/view/WindowMetrics.java
@@ -101,9 +101,13 @@ public final class WindowMetrics {
* Returns the bounds of the area associated with this window or {@code UiContext}.
* <p>
* <b>Note that the size of the reported bounds can have different size than
- * {@link Display#getSize(Point)}.</b> This method reports the window size including all system
- * bar areas, while {@link Display#getSize(Point)} reports the area excluding navigation bars
- * and display cutout areas. The value reported by {@link Display#getSize(Point)} can be
+ * {@link Display#getSize(Point)} based on your target API level and calling context.</b>
+ * This method reports the window size including all system
+ * bar areas, while {@link Display#getSize(Point)} can report the area excluding navigation bars
+ * and display cutout areas depending on the calling context and target SDK level. Please refer
+ * to {@link Display#getSize(Point)} for details.
+ * <p>
+ * The value reported by {@link Display#getSize(Point)} excluding system decoration areas can be
* obtained by using:
* <pre class="prettyprint">
* final WindowMetrics metrics = windowManager.getCurrentWindowMetrics();
diff --git a/core/java/android/view/accessibility/flags/accessibility_flags.aconfig b/core/java/android/view/accessibility/flags/accessibility_flags.aconfig
index da2bf9d7ab38..4de3a7b5ae4b 100644
--- a/core/java/android/view/accessibility/flags/accessibility_flags.aconfig
+++ b/core/java/android/view/accessibility/flags/accessibility_flags.aconfig
@@ -124,6 +124,7 @@ flag {
namespace: "accessibility"
name: "add_type_window_control"
is_exported: true
+ is_fixed_read_only: true
description: "adds new TYPE_WINDOW_CONTROL to AccessibilityWindowInfo for detecting Window Decorations"
bug: "320445550"
}
diff --git a/core/java/android/window/BackProgressAnimator.java b/core/java/android/window/BackProgressAnimator.java
index 163e43a009e7..94d7811677ae 100644
--- a/core/java/android/window/BackProgressAnimator.java
+++ b/core/java/android/window/BackProgressAnimator.java
@@ -33,7 +33,7 @@ import com.android.internal.dynamicanimation.animation.SpringForce;
*
* @hide
*/
-public class BackProgressAnimator {
+public class BackProgressAnimator implements DynamicAnimation.OnAnimationUpdateListener {
/**
* A factor to scale the input progress by, so that it works better with the spring.
* We divide the output progress by this value before sending it to apps, so that apps
@@ -43,6 +43,7 @@ public class BackProgressAnimator {
private final SpringAnimation mSpring;
private ProgressCallback mCallback;
private float mProgress = 0;
+ private float mVelocity = 0;
private BackMotionEvent mLastBackEvent;
private boolean mBackAnimationInProgress = false;
@Nullable
@@ -67,7 +68,6 @@ public class BackProgressAnimator {
@Override
public void setValue(BackProgressAnimator animator, float value) {
animator.setProgress(value);
- animator.updateProgressValue(value);
}
@Override
@@ -76,6 +76,11 @@ public class BackProgressAnimator {
}
};
+ @Override
+ public void onAnimationUpdate(DynamicAnimation animation, float value, float velocity) {
+ updateProgressValue(value, velocity);
+ }
+
/** A callback to be invoked when there's a progress value update from the animator. */
public interface ProgressCallback {
@@ -85,6 +90,7 @@ public class BackProgressAnimator {
public BackProgressAnimator() {
mSpring = new SpringAnimation(this, PROGRESS_PROP);
+ mSpring.addUpdateListener(this);
mSpring.setSpring(new SpringForce()
.setStiffness(SpringForce.STIFFNESS_MEDIUM)
.setDampingRatio(SpringForce.DAMPING_RATIO_NO_BOUNCY));
@@ -114,11 +120,10 @@ public class BackProgressAnimator {
* dispatches as the progress animation updates.
*/
public void onBackStarted(BackMotionEvent event, ProgressCallback callback) {
- reset();
mLastBackEvent = event;
mCallback = callback;
mBackAnimationInProgress = true;
- updateProgressValue(0);
+ updateProgressValue(0, 0);
}
/**
@@ -127,7 +132,7 @@ public class BackProgressAnimator {
public void reset() {
if (mBackCancelledFinishRunnable != null) {
// Ensure that last progress value that apps see is 0
- updateProgressValue(0);
+ updateProgressValue(0, 0);
invokeBackCancelledRunnable();
}
mSpring.animateToFinalPosition(0);
@@ -168,7 +173,15 @@ public class BackProgressAnimator {
return mBackAnimationInProgress;
}
- private void updateProgressValue(float progress) {
+ /**
+ * @return The last recorded velocity. Unit: change in progress per second
+ */
+ public float getVelocity() {
+ return mVelocity / SCALE_FACTOR;
+ }
+
+ private void updateProgressValue(float progress, float velocity) {
+ mVelocity = velocity;
if (mLastBackEvent == null || mCallback == null || !mBackAnimationInProgress) {
return;
}
diff --git a/core/java/android/window/RemoteTransition.java b/core/java/android/window/RemoteTransition.java
index 4cc7ec598dbf..15b3c4490f94 100644
--- a/core/java/android/window/RemoteTransition.java
+++ b/core/java/android/window/RemoteTransition.java
@@ -22,15 +22,12 @@ import android.app.IApplicationThread;
import android.os.IBinder;
import android.os.Parcelable;
-import com.android.internal.util.DataClass;
-
/**
* Represents a remote transition animation and information required to run it (eg. the app thread
* that needs to be boosted).
* @hide
*/
-@DataClass(genToString = true, genSetters = true, genAidl = true)
-public class RemoteTransition implements Parcelable {
+public final class RemoteTransition implements Parcelable {
/** The actual remote-transition interface used to run the transition animation. */
private @NonNull IRemoteTransition mRemoteTransition;
@@ -41,12 +38,18 @@ public class RemoteTransition implements Parcelable {
/** A name for this that can be used for debugging. */
private @Nullable String mDebugName;
- /** Constructs with no app thread (animation runs in shell). */
+ /**
+ * Constructs with no app thread (animation runs in shell).
+ * @hide
+ */
public RemoteTransition(@NonNull IRemoteTransition remoteTransition) {
this(remoteTransition, null /* appThread */, null /* debugName */);
}
- /** Constructs with no app thread (animation runs in shell). */
+ /**
+ * Constructs with no app thread (animation runs in shell).
+ * @hide
+ */
public RemoteTransition(@NonNull IRemoteTransition remoteTransition,
@Nullable String debugName) {
this(remoteTransition, null /* appThread */, debugName);
@@ -57,21 +60,6 @@ public class RemoteTransition implements Parcelable {
return mRemoteTransition.asBinder();
}
-
-
- // Code below generated by codegen v1.0.23.
- //
- // DO NOT MODIFY!
- // CHECKSTYLE:OFF Generated code
- //
- // To regenerate run:
- // $ codegen $ANDROID_BUILD_TOP/frameworks/base/core/java/android/window/RemoteTransition.java
- //
- // To exclude the generated code from IntelliJ auto-formatting enable (one-time):
- // Settings > Editor > Code Style > Formatter Control
- //@formatter:off
-
-
/**
* Creates a new RemoteTransition.
*
@@ -81,8 +69,8 @@ public class RemoteTransition implements Parcelable {
* The application thread that will be running the remote transition.
* @param debugName
* A name for this that can be used for debugging.
+ * @hide
*/
- @DataClass.Generated.Member
public RemoteTransition(
@NonNull IRemoteTransition remoteTransition,
@Nullable IApplicationThread appThread,
@@ -98,16 +86,16 @@ public class RemoteTransition implements Parcelable {
/**
* The actual remote-transition interface used to run the transition animation.
+ * @hide
*/
- @DataClass.Generated.Member
public @NonNull IRemoteTransition getRemoteTransition() {
return mRemoteTransition;
}
/**
* The application thread that will be running the remote transition.
+ * @hide
*/
- @DataClass.Generated.Member
public @Nullable IApplicationThread getAppThread() {
return mAppThread;
}
@@ -115,15 +103,14 @@ public class RemoteTransition implements Parcelable {
/**
* A name for this that can be used for debugging.
*/
- @DataClass.Generated.Member
public @Nullable String getDebugName() {
return mDebugName;
}
/**
* The actual remote-transition interface used to run the transition animation.
+ * @hide
*/
- @DataClass.Generated.Member
public @NonNull RemoteTransition setRemoteTransition(@NonNull IRemoteTransition value) {
mRemoteTransition = value;
com.android.internal.util.AnnotationValidations.validate(
@@ -133,8 +120,8 @@ public class RemoteTransition implements Parcelable {
/**
* The application thread that will be running the remote transition.
+ * @hide
*/
- @DataClass.Generated.Member
public @NonNull RemoteTransition setAppThread(@NonNull IApplicationThread value) {
mAppThread = value;
return this;
@@ -143,14 +130,12 @@ public class RemoteTransition implements Parcelable {
/**
* A name for this that can be used for debugging.
*/
- @DataClass.Generated.Member
public @NonNull RemoteTransition setDebugName(@NonNull String value) {
mDebugName = value;
return this;
}
@Override
- @DataClass.Generated.Member
public String toString() {
// You can override field toString logic by defining methods like:
// String fieldNameToString() { ... }
@@ -163,7 +148,6 @@ public class RemoteTransition implements Parcelable {
}
@Override
- @DataClass.Generated.Member
public void writeToParcel(@NonNull android.os.Parcel dest, int flags) {
// You can override field parcelling by defining methods like:
// void parcelFieldName(Parcel dest, int flags) { ... }
@@ -178,12 +162,10 @@ public class RemoteTransition implements Parcelable {
}
@Override
- @DataClass.Generated.Member
public int describeContents() { return 0; }
/** @hide */
@SuppressWarnings({"unchecked", "RedundantCast"})
- @DataClass.Generated.Member
protected RemoteTransition(@NonNull android.os.Parcel in) {
// You can override field unparcelling by defining methods like:
// static FieldType unparcelFieldName(Parcel in) { ... }
@@ -198,11 +180,8 @@ public class RemoteTransition implements Parcelable {
NonNull.class, null, mRemoteTransition);
this.mAppThread = appThread;
this.mDebugName = debugName;
-
- // onConstructed(); // You can define this method to get a callback
}
- @DataClass.Generated.Member
public static final @NonNull Parcelable.Creator<RemoteTransition> CREATOR
= new Parcelable.Creator<RemoteTransition>() {
@Override
@@ -215,17 +194,4 @@ public class RemoteTransition implements Parcelable {
return new RemoteTransition(in);
}
};
-
- @DataClass.Generated(
- time = 1678926409863L,
- codegenVersion = "1.0.23",
- sourceFile = "frameworks/base/core/java/android/window/RemoteTransition.java",
- inputSignatures = "private @android.annotation.NonNull android.window.IRemoteTransition mRemoteTransition\nprivate @android.annotation.Nullable android.app.IApplicationThread mAppThread\nprivate @android.annotation.Nullable java.lang.String mDebugName\npublic @android.annotation.Nullable android.os.IBinder asBinder()\nclass RemoteTransition extends java.lang.Object implements [android.os.Parcelable]\n@com.android.internal.util.DataClass(genToString=true, genSetters=true, genAidl=true)")
- @Deprecated
- private void __metadata() {}
-
-
- //@formatter:on
- // End of generated code
-
}
diff --git a/core/java/android/window/TaskFragmentTransaction.java b/core/java/android/window/TaskFragmentTransaction.java
index 32e3f5ad10ca..1e5b0971aad6 100644
--- a/core/java/android/window/TaskFragmentTransaction.java
+++ b/core/java/android/window/TaskFragmentTransaction.java
@@ -189,6 +189,10 @@ public final class TaskFragmentTransaction implements Parcelable {
@Nullable
private IBinder mActivityToken;
+ /** @see #setOtherActivityToken(IBinder) */
+ @Nullable
+ private IBinder mOtherActivityToken;
+
@Nullable
private TaskFragmentParentInfo mTaskFragmentParentInfo;
@@ -210,6 +214,7 @@ public final class TaskFragmentTransaction implements Parcelable {
mActivityToken = in.readStrongBinder();
mTaskFragmentParentInfo = in.readTypedObject(TaskFragmentParentInfo.CREATOR);
mSurfaceControl = in.readTypedObject(SurfaceControl.CREATOR);
+ mOtherActivityToken = in.readStrongBinder();
}
@Override
@@ -224,6 +229,7 @@ public final class TaskFragmentTransaction implements Parcelable {
dest.writeStrongBinder(mActivityToken);
dest.writeTypedObject(mTaskFragmentParentInfo, flags);
dest.writeTypedObject(mSurfaceControl, flags);
+ dest.writeStrongBinder(mOtherActivityToken);
}
/** The change is related to the TaskFragment created with this unique token. */
@@ -292,6 +298,21 @@ public final class TaskFragmentTransaction implements Parcelable {
}
/**
+ * Token of another activity.
+ * <p>For {@link #TYPE_ACTIVITY_REPARENTED_TO_TASK}, it is the next activity (behind the
+ * reparented one) that fills the Task and occludes other activities. It will be the
+ * actual activity token if the activity belongs to the same process as the organizer.
+ * Otherwise, it is {@code null}.
+ *
+ * @hide
+ */
+ @NonNull
+ public Change setOtherActivityToken(@NonNull IBinder activityToken) {
+ mOtherActivityToken = requireNonNull(activityToken);
+ return this;
+ }
+
+ /**
* Sets info of the parent Task of the embedded TaskFragment.
* @see TaskFragmentParentInfo
*
@@ -350,6 +371,12 @@ public final class TaskFragmentTransaction implements Parcelable {
return mActivityToken;
}
+ /** @hide */
+ @Nullable
+ public IBinder getOtherActivityToken() {
+ return mOtherActivityToken;
+ }
+
/**
* Obtains the {@link TaskFragmentParentInfo} for this transaction.
*/
diff --git a/core/java/android/window/TaskSnapshot.java b/core/java/android/window/TaskSnapshot.java
index a2e3d40e5c6b..f0144cbf0f4a 100644
--- a/core/java/android/window/TaskSnapshot.java
+++ b/core/java/android/window/TaskSnapshot.java
@@ -33,6 +33,8 @@ import android.os.SystemClock;
import android.view.Surface;
import android.view.WindowInsetsController;
+import com.android.window.flags.Flags;
+
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@@ -334,7 +336,8 @@ public class TaskSnapshot implements Parcelable {
*/
public synchronized void removeReference(@ReferenceFlags int usage) {
mInternalReferences &= ~usage;
- if (mInternalReferences == 0 && mSnapshot != null && !mSnapshot.isClosed()) {
+ if (Flags.releaseSnapshotAggressively() && mInternalReferences == 0 && mSnapshot != null
+ && !mSnapshot.isClosed()) {
mSnapshot.close();
}
}
diff --git a/core/java/android/window/TransitionInfo.java b/core/java/android/window/TransitionInfo.java
index bcae571201a8..4ffd88093531 100644
--- a/core/java/android/window/TransitionInfo.java
+++ b/core/java/android/window/TransitionInfo.java
@@ -54,6 +54,8 @@ import android.view.Surface;
import android.view.SurfaceControl;
import android.view.WindowManager;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
@@ -69,6 +71,7 @@ public final class TransitionInfo implements Parcelable {
* Modes are only a sub-set of all the transit-types since they are per-container
* @hide
*/
+ @Retention(RetentionPolicy.SOURCE)
@IntDef(prefix = { "TRANSIT_" }, value = {
TRANSIT_NONE,
TRANSIT_OPEN,
@@ -102,11 +105,11 @@ public final class TransitionInfo implements Parcelable {
/** The container is the display. */
public static final int FLAG_IS_DISPLAY = 1 << 5;
+ // TODO(b/194540864): Once we can include all windows in transition, then replace this with
+ // something like FLAG_IS_SYSTEM_ALERT instead. Then we can do mixed rotations.
/**
* Only for IS_DISPLAY containers. Is set if the display has system alert windows. This is
* used to prevent seamless rotation.
- * TODO(b/194540864): Once we can include all windows in transition, then replace this with
- * something like FLAG_IS_SYSTEM_ALERT instead. Then we can do mixed rotations.
*/
public static final int FLAG_DISPLAY_HAS_ALERT_WINDOWS = 1 << 7;
@@ -173,6 +176,7 @@ public final class TransitionInfo implements Parcelable {
public static final int FLAGS_IS_OCCLUDED_NO_ANIMATION = FLAG_IS_OCCLUDED | FLAG_NO_ANIMATION;
/** @hide */
+ @Retention(RetentionPolicy.SOURCE)
@IntDef(prefix = { "FLAG_" }, value = {
FLAG_NONE,
FLAG_SHOW_WALLPAPER,
@@ -267,11 +271,11 @@ public final class TransitionInfo implements Parcelable {
}
/** @see #getRoot */
- public void addRoot(Root other) {
+ public void addRoot(@NonNull Root other) {
mRoots.add(other);
}
- public void setAnimationOptions(AnimationOptions options) {
+ public void setAnimationOptions(@Nullable AnimationOptions options) {
mOptions = options;
}
@@ -336,6 +340,7 @@ public final class TransitionInfo implements Parcelable {
return mRoots.get(0).mLeash;
}
+ @Nullable
public AnimationOptions getAnimationOptions() {
return mOptions;
}
@@ -601,7 +606,7 @@ public final class TransitionInfo implements Parcelable {
* Updates the callsites of all the surfaces in this transition, which aids in the debugging of
* lingering surfaces.
*/
- public void setUnreleasedWarningCallSiteForAllSurfaces(String callsite) {
+ public void setUnreleasedWarningCallSiteForAllSurfaces(@Nullable String callsite) {
for (int i = mChanges.size() - 1; i >= 0; --i) {
mChanges.get(i).getLeash().setUnreleasedWarningCallSite(callsite);
}
@@ -613,6 +618,7 @@ public final class TransitionInfo implements Parcelable {
* the caller's references. Use this only if you need to "send" this to a local function which
* assumes it is being called from a remote caller.
*/
+ @NonNull
public TransitionInfo localRemoteCopy() {
final TransitionInfo out = new TransitionInfo(mType, mFlags);
out.mTrack = mTrack;
@@ -891,7 +897,7 @@ public final class TransitionInfo implements Parcelable {
return mTaskInfo;
}
- public boolean getAllowEnterPip() {
+ public boolean isAllowEnterPip() {
return mAllowEnterPip;
}
@@ -1042,6 +1048,7 @@ public final class TransitionInfo implements Parcelable {
}
/** Represents animation options during a transition */
+ @SuppressWarnings("UserHandleName")
public static final class AnimationOptions implements Parcelable {
private int mType;
@@ -1061,7 +1068,7 @@ public final class TransitionInfo implements Parcelable {
mType = type;
}
- public AnimationOptions(Parcel in) {
+ private AnimationOptions(Parcel in) {
mType = in.readInt();
mEnterResId = in.readInt();
mExitResId = in.readInt();
@@ -1076,14 +1083,17 @@ public final class TransitionInfo implements Parcelable {
}
/** Make basic customized animation for a package */
- public static AnimationOptions makeCommonAnimOptions(String packageName) {
+ @NonNull
+ public static AnimationOptions makeCommonAnimOptions(@NonNull String packageName) {
AnimationOptions options = new AnimationOptions(ANIM_FROM_STYLE);
options.mPackageName = packageName;
return options;
}
+ /** Make custom animation from the content of LayoutParams */
+ @NonNull
public static AnimationOptions makeAnimOptionsFromLayoutParameters(
- WindowManager.LayoutParams lp) {
+ @NonNull WindowManager.LayoutParams lp) {
AnimationOptions options = new AnimationOptions(ANIM_FROM_STYLE);
options.mPackageName = lp.packageName;
options.mAnimations = lp.windowAnimations;
@@ -1091,7 +1101,7 @@ public final class TransitionInfo implements Parcelable {
}
/** Add customized window animations */
- public void addOptionsFromLayoutParameters(WindowManager.LayoutParams lp) {
+ public void addOptionsFromLayoutParameters(@NonNull WindowManager.LayoutParams lp) {
mAnimations = lp.windowAnimations;
}
@@ -1111,8 +1121,11 @@ public final class TransitionInfo implements Parcelable {
customTransition.addCustomActivityTransition(enterResId, exitResId, backgroundColor);
}
- public static AnimationOptions makeCustomAnimOptions(String packageName, int enterResId,
- int exitResId, @ColorInt int backgroundColor, boolean overrideTaskTransition) {
+ /** Make options for a custom animation based on anim resources */
+ @NonNull
+ public static AnimationOptions makeCustomAnimOptions(@NonNull String packageName,
+ int enterResId, int exitResId, @ColorInt int backgroundColor,
+ boolean overrideTaskTransition) {
AnimationOptions options = new AnimationOptions(ANIM_CUSTOM);
options.mPackageName = packageName;
options.mEnterResId = enterResId;
@@ -1122,6 +1135,8 @@ public final class TransitionInfo implements Parcelable {
return options;
}
+ /** Make options for a clip-reveal animation. */
+ @NonNull
public static AnimationOptions makeClipRevealAnimOptions(int startX, int startY, int width,
int height) {
AnimationOptions options = new AnimationOptions(ANIM_CLIP_REVEAL);
@@ -1129,6 +1144,8 @@ public final class TransitionInfo implements Parcelable {
return options;
}
+ /** Make options for a scale-up animation. */
+ @NonNull
public static AnimationOptions makeScaleUpAnimOptions(int startX, int startY, int width,
int height) {
AnimationOptions options = new AnimationOptions(ANIM_SCALE_UP);
@@ -1136,7 +1153,9 @@ public final class TransitionInfo implements Parcelable {
return options;
}
- public static AnimationOptions makeThumbnailAnimOptions(HardwareBuffer srcThumb,
+ /** Make options for a thumbnail-scaling animation. */
+ @NonNull
+ public static AnimationOptions makeThumbnailAnimOptions(@NonNull HardwareBuffer srcThumb,
int startX, int startY, boolean scaleUp) {
AnimationOptions options = new AnimationOptions(
scaleUp ? ANIM_THUMBNAIL_SCALE_UP : ANIM_THUMBNAIL_SCALE_DOWN);
@@ -1145,11 +1164,15 @@ public final class TransitionInfo implements Parcelable {
return options;
}
+ /** Make options for an animation that spans activities of different profiles. */
+ @NonNull
public static AnimationOptions makeCrossProfileAnimOptions() {
AnimationOptions options = new AnimationOptions(ANIM_OPEN_CROSS_PROFILE_APPS);
return options;
}
+ /** Make options designating this as a scene-transition animation. */
+ @NonNull
public static AnimationOptions makeSceneTransitionAnimOptions() {
AnimationOptions options = new AnimationOptions(ANIM_SCENE_TRANSITION);
return options;
@@ -1175,14 +1198,17 @@ public final class TransitionInfo implements Parcelable {
return mOverrideTaskTransition;
}
+ @Nullable
public String getPackageName() {
return mPackageName;
}
+ @NonNull
public Rect getTransitionBounds() {
return mTransitionBounds;
}
+ @Nullable
public HardwareBuffer getThumbnail() {
return mThumbnail;
}
@@ -1192,12 +1218,13 @@ public final class TransitionInfo implements Parcelable {
}
/** Return customized activity transition if existed. */
+ @Nullable
public CustomActivityTransition getCustomActivityTransition(boolean open) {
return open ? mCustomActivityOpenTransition : mCustomActivityCloseTransition;
}
@Override
- public void writeToParcel(Parcel dest, int flags) {
+ public void writeToParcel(@NonNull Parcel dest, int flags) {
dest.writeInt(mType);
dest.writeInt(mEnterResId);
dest.writeInt(mExitResId);
@@ -1247,6 +1274,7 @@ public final class TransitionInfo implements Parcelable {
}
@Override
+ @NonNull
public String toString() {
final StringBuilder sb = new StringBuilder(32);
sb.append("{t=").append(typeToString(mType));
@@ -1261,7 +1289,7 @@ public final class TransitionInfo implements Parcelable {
}
/** Customized activity transition. */
- public static class CustomActivityTransition implements Parcelable {
+ public static final class CustomActivityTransition implements Parcelable {
private int mCustomEnterResId;
private int mCustomExitResId;
private int mCustomBackgroundColor;
@@ -1302,7 +1330,7 @@ public final class TransitionInfo implements Parcelable {
}
@Override
- public void writeToParcel(Parcel dest, int flags) {
+ public void writeToParcel(@NonNull Parcel dest, int flags) {
dest.writeInt(mCustomEnterResId);
dest.writeInt(mCustomExitResId);
dest.writeInt(mCustomBackgroundColor);
diff --git a/core/java/android/window/TransitionRequestInfo.java b/core/java/android/window/TransitionRequestInfo.java
index bd54e14bc996..cc225767bd49 100644
--- a/core/java/android/window/TransitionRequestInfo.java
+++ b/core/java/android/window/TransitionRequestInfo.java
@@ -113,7 +113,7 @@ public final class TransitionRequestInfo implements Parcelable {
/** Requested change to a display. */
@DataClass(genToString = true, genSetters = true, genBuilder = false, genConstructor = false)
- public static class DisplayChange implements Parcelable {
+ public static final class DisplayChange implements Parcelable {
private final int mDisplayId;
@Nullable private Rect mStartAbsBounds = null;
@Nullable private Rect mEndAbsBounds = null;
diff --git a/core/java/android/window/flags/lse_desktop_experience.aconfig b/core/java/android/window/flags/lse_desktop_experience.aconfig
index 760c9166959c..0590c407d7e4 100644
--- a/core/java/android/window/flags/lse_desktop_experience.aconfig
+++ b/core/java/android/window/flags/lse_desktop_experience.aconfig
@@ -78,3 +78,17 @@ flag {
description: "Allows for additional windows tied to WindowDecoration to be layered between status bar and notification shade."
bug: "316186265"
}
+
+flag {
+ name: "enable_app_header_with_task_density"
+ namespace: "lse_desktop_experience"
+ description: "Matches the App Header density to that of the app window, instead of SysUI's"
+ bug: "332414819"
+}
+
+flag {
+ name: "enable_themed_app_headers"
+ namespace: "lse_desktop_experience"
+ description: "Makes the App Header style adapt to the system's and app's light/dark theme"
+ bug: "328668781"
+}
diff --git a/core/java/android/window/flags/windowing_frontend.aconfig b/core/java/android/window/flags/windowing_frontend.aconfig
index ee3e34f2b9e2..f08f5b8fddbe 100644
--- a/core/java/android/window/flags/windowing_frontend.aconfig
+++ b/core/java/android/window/flags/windowing_frontend.aconfig
@@ -163,4 +163,12 @@ flag {
metadata {
purpose: PURPOSE_BUGFIX
}
+}
+
+flag {
+ name: "release_snapshot_aggressively"
+ namespace: "windowing_frontend"
+ description: "Actively release task snapshot memory"
+ bug: "238206323"
+ is_fixed_read_only: true
} \ No newline at end of file
diff --git a/core/java/android/window/flags/windowing_sdk.aconfig b/core/java/android/window/flags/windowing_sdk.aconfig
index 4d1b87a3d97a..5e0107e8dd33 100644
--- a/core/java/android/window/flags/windowing_sdk.aconfig
+++ b/core/java/android/window/flags/windowing_sdk.aconfig
@@ -124,7 +124,30 @@ flag {
flag {
namespace: "windowing_sdk"
- name: "pip_restore_to_overlay"
+ name: "fix_pip_restore_to_overlay"
description: "Restore exit-pip activity back to ActivityEmbedding overlay"
bug: "297887697"
+ metadata {
+ purpose: PURPOSE_BUGFIX
+ }
+}
+
+flag {
+ namespace: "windowing_sdk"
+ name: "activity_embedding_animation_customization_flag"
+ description: "Whether the animation customization feature for AE is enabled"
+ bug: "293658614"
+ metadata {
+ purpose: PURPOSE_FEATURE
+ }
+}
+
+flag {
+ namespace: "windowing_sdk"
+ name: "insets_control_changed_item"
+ description: "Pass insetsControlChanged through ClientTransaction to fix the racing"
+ bug: "339380439"
+ metadata {
+ purpose: PURPOSE_BUGFIX
+ }
} \ No newline at end of file
diff --git a/core/java/com/android/internal/app/ResolverActivity.java b/core/java/com/android/internal/app/ResolverActivity.java
index 84715aa80edb..17adee4cc49e 100644
--- a/core/java/com/android/internal/app/ResolverActivity.java
+++ b/core/java/com/android/internal/app/ResolverActivity.java
@@ -917,7 +917,7 @@ public class ResolverActivity extends Activity implements
mSystemWindowInsets = insets.getSystemWindowInsets();
mResolverDrawerLayout.setPadding(mSystemWindowInsets.left, mSystemWindowInsets.top,
- mSystemWindowInsets.right, 0);
+ mSystemWindowInsets.right, mSystemWindowInsets.bottom);
resetButtonBar();
@@ -946,7 +946,7 @@ public class ResolverActivity extends Activity implements
if (mSystemWindowInsets != null) {
mResolverDrawerLayout.setPadding(mSystemWindowInsets.left, mSystemWindowInsets.top,
- mSystemWindowInsets.right, 0);
+ mSystemWindowInsets.right, mSystemWindowInsets.bottom);
}
}
diff --git a/core/java/com/android/internal/pm/pkg/component/AconfigFlags.java b/core/java/com/android/internal/pm/pkg/component/AconfigFlags.java
new file mode 100644
index 000000000000..f306b0b02677
--- /dev/null
+++ b/core/java/com/android/internal/pm/pkg/component/AconfigFlags.java
@@ -0,0 +1,244 @@
+/*
+ * 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.internal.pm.pkg.component;
+
+import static com.android.internal.pm.pkg.parsing.ParsingUtils.ANDROID_RES_NAMESPACE;
+
+import android.aconfig.nano.Aconfig;
+import android.aconfig.nano.Aconfig.parsed_flag;
+import android.aconfig.nano.Aconfig.parsed_flags;
+import android.annotation.NonNull;
+import android.annotation.Nullable;
+import android.content.res.Flags;
+import android.content.res.XmlResourceParser;
+import android.os.Environment;
+import android.os.Process;
+import android.util.ArrayMap;
+import android.util.Slog;
+import android.util.Xml;
+
+import com.android.internal.annotations.VisibleForTesting;
+import com.android.modules.utils.TypedXmlPullParser;
+
+import org.xmlpull.v1.XmlPullParser;
+import org.xmlpull.v1.XmlPullParserException;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * A class that manages a cache of all device feature flags and their default + override values.
+ * This class performs a very similar job to the one in {@code SettingsProvider}, with an important
+ * difference: this is a part of system server and is available for the server startup. Package
+ * parsing happens at the startup when {@code SettingsProvider} isn't available yet, so we need an
+ * own copy of the code here.
+ * @hide
+ */
+public class AconfigFlags {
+ private static final String LOG_TAG = "AconfigFlags";
+
+ private static final List<String> sTextProtoFilesOnDevice = List.of(
+ "/system/etc/aconfig_flags.pb",
+ "/system_ext/etc/aconfig_flags.pb",
+ "/product/etc/aconfig_flags.pb",
+ "/vendor/etc/aconfig_flags.pb");
+
+ private final ArrayMap<String, Boolean> mFlagValues = new ArrayMap<>();
+
+ public AconfigFlags() {
+ if (!Flags.manifestFlagging()) {
+ Slog.v(LOG_TAG, "Feature disabled, skipped all loading");
+ return;
+ }
+ for (String fileName : sTextProtoFilesOnDevice) {
+ try (var inputStream = new FileInputStream(fileName)) {
+ loadAconfigDefaultValues(inputStream.readAllBytes());
+ } catch (IOException e) {
+ Slog.e(LOG_TAG, "Failed to read Aconfig values from " + fileName, e);
+ }
+ }
+ if (Process.myUid() == Process.SYSTEM_UID) {
+ // Server overrides are only accessible to the system, no need to even try loading them
+ // in user processes.
+ loadServerOverrides();
+ }
+ }
+
+ private void loadServerOverrides() {
+ // Reading the proto files is enough for READ_ONLY flags but if it's a READ_WRITE flag
+ // (which you can check with `flag.getPermission() == flag_permission.READ_WRITE`) then we
+ // also need to check if there is a value pushed from the server in the file
+ // `/data/system/users/0/settings_config.xml`. It will be in a <setting> node under the
+ // root <settings> node with "name" attribute == "flag_namespace/flag_package.flag_name".
+ // The "value" attribute will be true or false.
+ //
+ // The "name" attribute could also be "<namespace>/flag_namespace?flag_package.flag_name"
+ // (prefixed with "staged/" or "device_config_overrides/" and a different separator between
+ // namespace and name). This happens when a flag value is overridden either with a pushed
+ // one from the server, or from the local command.
+ // When the device reboots during package parsing, the staged value will still be there and
+ // only later it will become a regular/non-staged value after SettingsProvider is
+ // initialized.
+ //
+ // In all cases, when there is more than one value, the priority is:
+ // device_config_overrides > staged > default
+ //
+
+ final var settingsFile = new File(Environment.getUserSystemDirectory(0),
+ "settings_config.xml");
+ try (var inputStream = new FileInputStream(settingsFile)) {
+ TypedXmlPullParser parser = Xml.resolvePullParser(inputStream);
+ if (parser.next() != XmlPullParser.END_TAG && "settings".equals(parser.getName())) {
+ final var flagPriority = new ArrayMap<String, Integer>();
+ final int outerDepth = parser.getDepth();
+ int type;
+ while ((type = parser.next()) != XmlPullParser.END_DOCUMENT
+ && (type != XmlPullParser.END_TAG || parser.getDepth() > outerDepth)) {
+ if (type == XmlPullParser.END_TAG || type == XmlPullParser.TEXT) {
+ continue;
+ }
+ if (!"setting".equals(parser.getName())) {
+ continue;
+ }
+ String name = parser.getAttributeValue(null, "name");
+ final String value = parser.getAttributeValue(null, "value");
+ if (name == null || value == null) {
+ continue;
+ }
+ // A non-boolean setting is definitely not an Aconfig flag value.
+ if (!"false".equalsIgnoreCase(value) && !"true".equalsIgnoreCase(value)) {
+ continue;
+ }
+ final var overridePrefix = "device_config_overrides/";
+ final var stagedPrefix = "staged/";
+ String separator = "/";
+ String prefix = "default";
+ int priority = 0;
+ if (name.startsWith(overridePrefix)) {
+ prefix = overridePrefix;
+ name = name.substring(overridePrefix.length());
+ separator = ":";
+ priority = 20;
+ } else if (name.startsWith(stagedPrefix)) {
+ prefix = stagedPrefix;
+ name = name.substring(stagedPrefix.length());
+ separator = "*";
+ priority = 10;
+ }
+ final String flagPackageAndName = parseFlagPackageAndName(name, separator);
+ if (flagPackageAndName == null) {
+ continue;
+ }
+ // We ignore all settings that aren't for flags. We'll know they are for flags
+ // if they correspond to flags read from the proto files.
+ if (!mFlagValues.containsKey(flagPackageAndName)) {
+ continue;
+ }
+ Slog.d(LOG_TAG, "Found " + prefix
+ + " Aconfig flag value for " + flagPackageAndName + " = " + value);
+ final Integer currentPriority = flagPriority.get(flagPackageAndName);
+ if (currentPriority != null && currentPriority >= priority) {
+ Slog.i(LOG_TAG, "Skipping " + prefix + " flag " + flagPackageAndName
+ + " because of the existing one with priority " + currentPriority);
+ continue;
+ }
+ flagPriority.put(flagPackageAndName, priority);
+ mFlagValues.put(flagPackageAndName, Boolean.parseBoolean(value));
+ }
+ }
+ } catch (IOException | XmlPullParserException e) {
+ Slog.e(LOG_TAG, "Failed to read Aconfig values from settings_config.xml", e);
+ }
+ }
+
+ private static String parseFlagPackageAndName(String fullName, String separator) {
+ int index = fullName.indexOf(separator);
+ if (index < 0) {
+ return null;
+ }
+ return fullName.substring(index + 1);
+ }
+
+ private void loadAconfigDefaultValues(byte[] fileContents) throws IOException {
+ parsed_flags parsedFlags = parsed_flags.parseFrom(fileContents);
+ for (parsed_flag flag : parsedFlags.parsedFlag) {
+ String flagPackageAndName = flag.package_ + "." + flag.name;
+ boolean flagValue = (flag.state == Aconfig.ENABLED);
+ Slog.v(LOG_TAG, "Read Aconfig default flag value "
+ + flagPackageAndName + " = " + flagValue);
+ mFlagValues.put(flagPackageAndName, flagValue);
+ }
+ }
+
+ /**
+ * Get the flag value, or null if the flag doesn't exist.
+ * @param flagPackageAndName Full flag name formatted as 'package.flag'
+ * @return the current value of the given Aconfig flag, or null if there is no such flag
+ */
+ @Nullable
+ public Boolean getFlagValue(@NonNull String flagPackageAndName) {
+ Boolean value = mFlagValues.get(flagPackageAndName);
+ Slog.d(LOG_TAG, "Aconfig flag value for " + flagPackageAndName + " = " + value);
+ return value;
+ }
+
+ /**
+ * Check if the element in {@code parser} should be skipped because of the feature flag.
+ * @param parser XML parser object currently parsing an element
+ * @return true if the element is disabled because of its feature flag
+ */
+ public boolean skipCurrentElement(@NonNull XmlResourceParser parser) {
+ if (!Flags.manifestFlagging()) {
+ return false;
+ }
+ String featureFlag = parser.getAttributeValue(ANDROID_RES_NAMESPACE, "featureFlag");
+ if (featureFlag == null) {
+ return false;
+ }
+ featureFlag = featureFlag.strip();
+ boolean negated = false;
+ if (featureFlag.startsWith("!")) {
+ negated = true;
+ featureFlag = featureFlag.substring(1).strip();
+ }
+ final Boolean flagValue = getFlagValue(featureFlag);
+ if (flagValue == null) {
+ Slog.w(LOG_TAG, "Skipping element " + parser.getName()
+ + " due to unknown feature flag " + featureFlag);
+ return true;
+ }
+ // Skip if flag==false && attr=="flag" OR flag==true && attr=="!flag" (negated)
+ if (flagValue == negated) {
+ Slog.v(LOG_TAG, "Skipping element " + parser.getName()
+ + " behind feature flag " + featureFlag + " = " + flagValue);
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Add Aconfig flag values for testing flagging of manifest entries.
+ * @param flagValues A map of flag name -> value.
+ */
+ @VisibleForTesting
+ public void addFlagValuesForTesting(@NonNull Map<String, Boolean> flagValues) {
+ mFlagValues.putAll(flagValues);
+ }
+}
diff --git a/core/java/com/android/internal/pm/pkg/component/ComponentParseUtils.java b/core/java/com/android/internal/pm/pkg/component/ComponentParseUtils.java
index db08005c833e..8858f9492890 100644
--- a/core/java/com/android/internal/pm/pkg/component/ComponentParseUtils.java
+++ b/core/java/com/android/internal/pm/pkg/component/ComponentParseUtils.java
@@ -61,6 +61,9 @@ public class ComponentParseUtils {
if (type != XmlPullParser.START_TAG) {
continue;
}
+ if (ParsingPackageUtils.getAconfigFlags().skipCurrentElement(parser)) {
+ continue;
+ }
final ParseResult result;
if ("meta-data".equals(parser.getName())) {
diff --git a/core/java/com/android/internal/pm/pkg/component/InstallConstraintsTagParser.java b/core/java/com/android/internal/pm/pkg/component/InstallConstraintsTagParser.java
index 0b045919fb13..bb015812c225 100644
--- a/core/java/com/android/internal/pm/pkg/component/InstallConstraintsTagParser.java
+++ b/core/java/com/android/internal/pm/pkg/component/InstallConstraintsTagParser.java
@@ -27,6 +27,7 @@ import android.util.ArraySet;
import com.android.internal.R;
import com.android.internal.pm.pkg.parsing.ParsingPackage;
+import com.android.internal.pm.pkg.parsing.ParsingPackageUtils;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;
@@ -80,6 +81,9 @@ public class InstallConstraintsTagParser {
}
return input.success(prefixes);
} else if (type == XmlPullParser.START_TAG) {
+ if (ParsingPackageUtils.getAconfigFlags().skipCurrentElement(parser)) {
+ continue;
+ }
if (parser.getName().equals(TAG_FINGERPRINT_PREFIX)) {
ParseResult<String> parsedPrefix =
readFingerprintPrefixValue(input, res, parser);
diff --git a/core/java/com/android/internal/pm/pkg/component/ParsedActivityUtils.java b/core/java/com/android/internal/pm/pkg/component/ParsedActivityUtils.java
index 9f71d88c24bc..55baa532b434 100644
--- a/core/java/com/android/internal/pm/pkg/component/ParsedActivityUtils.java
+++ b/core/java/com/android/internal/pm/pkg/component/ParsedActivityUtils.java
@@ -393,6 +393,9 @@ public class ParsedActivityUtils {
if (type != XmlPullParser.START_TAG) {
continue;
}
+ if (ParsingPackageUtils.getAconfigFlags().skipCurrentElement(parser)) {
+ continue;
+ }
final ParseResult result;
if (parser.getName().equals("intent-filter")) {
diff --git a/core/java/com/android/internal/pm/pkg/component/ParsedIntentInfoUtils.java b/core/java/com/android/internal/pm/pkg/component/ParsedIntentInfoUtils.java
index 05728eee174f..da48b23a2b81 100644
--- a/core/java/com/android/internal/pm/pkg/component/ParsedIntentInfoUtils.java
+++ b/core/java/com/android/internal/pm/pkg/component/ParsedIntentInfoUtils.java
@@ -99,6 +99,9 @@ public class ParsedIntentInfoUtils {
if (type != XmlPullParser.START_TAG) {
continue;
}
+ if (ParsingPackageUtils.getAconfigFlags().skipCurrentElement(parser)) {
+ continue;
+ }
final ParseResult result;
String nodeName = parser.getName();
@@ -197,6 +200,9 @@ public class ParsedIntentInfoUtils {
if (type != XmlPullParser.START_TAG) {
continue;
}
+ if (ParsingPackageUtils.getAconfigFlags().skipCurrentElement(parser)) {
+ continue;
+ }
final ParseResult result;
String nodeName = parser.getName();
diff --git a/core/java/com/android/internal/pm/pkg/component/ParsedProviderUtils.java b/core/java/com/android/internal/pm/pkg/component/ParsedProviderUtils.java
index 12aff1c6669f..6af2a29822a2 100644
--- a/core/java/com/android/internal/pm/pkg/component/ParsedProviderUtils.java
+++ b/core/java/com/android/internal/pm/pkg/component/ParsedProviderUtils.java
@@ -36,6 +36,7 @@ import android.util.Slog;
import com.android.internal.R;
import com.android.internal.pm.pkg.parsing.ParsingPackage;
+import com.android.internal.pm.pkg.parsing.ParsingPackageUtils;
import com.android.internal.pm.pkg.parsing.ParsingUtils;
import org.xmlpull.v1.XmlPullParser;
@@ -173,6 +174,9 @@ public class ParsedProviderUtils {
if (type != XmlPullParser.START_TAG) {
continue;
}
+ if (ParsingPackageUtils.getAconfigFlags().skipCurrentElement(parser)) {
+ continue;
+ }
String name = parser.getName();
final ParseResult result;
diff --git a/core/java/com/android/internal/pm/pkg/component/ParsedServiceUtils.java b/core/java/com/android/internal/pm/pkg/component/ParsedServiceUtils.java
index 4ac542f84226..c68ea2dc8516 100644
--- a/core/java/com/android/internal/pm/pkg/component/ParsedServiceUtils.java
+++ b/core/java/com/android/internal/pm/pkg/component/ParsedServiceUtils.java
@@ -34,6 +34,7 @@ import android.os.Build;
import com.android.internal.R;
import com.android.internal.pm.pkg.parsing.ParsingPackage;
+import com.android.internal.pm.pkg.parsing.ParsingPackageUtils;
import com.android.internal.pm.pkg.parsing.ParsingUtils;
import org.xmlpull.v1.XmlPullParser;
@@ -137,6 +138,9 @@ public class ParsedServiceUtils {
if (type != XmlPullParser.START_TAG) {
continue;
}
+ if (ParsingPackageUtils.getAconfigFlags().skipCurrentElement(parser)) {
+ continue;
+ }
final ParseResult parseResult;
switch (parser.getName()) {
diff --git a/core/java/com/android/internal/pm/pkg/parsing/ParsingPackageUtils.java b/core/java/com/android/internal/pm/pkg/parsing/ParsingPackageUtils.java
index 97ce96ec30f6..44fedb11b043 100644
--- a/core/java/com/android/internal/pm/pkg/parsing/ParsingPackageUtils.java
+++ b/core/java/com/android/internal/pm/pkg/parsing/ParsingPackageUtils.java
@@ -90,6 +90,7 @@ import com.android.internal.R;
import com.android.internal.os.ClassLoaderFactory;
import com.android.internal.pm.parsing.pkg.ParsedPackage;
import com.android.internal.pm.permission.CompatibilityPermissionInfo;
+import com.android.internal.pm.pkg.component.AconfigFlags;
import com.android.internal.pm.pkg.component.ComponentMutateUtils;
import com.android.internal.pm.pkg.component.ComponentParseUtils;
import com.android.internal.pm.pkg.component.InstallConstraintsTagParser;
@@ -292,6 +293,7 @@ public class ParsingPackageUtils {
@NonNull
private final List<PermissionManager.SplitPermissionInfo> mSplitPermissionInfos;
private final Callback mCallback;
+ private static final AconfigFlags sAconfigFlags = new AconfigFlags();
public ParsingPackageUtils(String[] separateProcesses, DisplayMetrics displayMetrics,
@NonNull List<PermissionManager.SplitPermissionInfo> splitPermissions,
@@ -761,6 +763,9 @@ public class ParsingPackageUtils {
if (outerDepth + 1 < parser.getDepth() || type != XmlPullParser.START_TAG) {
continue;
}
+ if (sAconfigFlags.skipCurrentElement(parser)) {
+ continue;
+ }
final ParseResult result;
String tagName = parser.getName();
@@ -837,6 +842,9 @@ public class ParsingPackageUtils {
if (type != XmlPullParser.START_TAG) {
continue;
}
+ if (sAconfigFlags.skipCurrentElement(parser)) {
+ continue;
+ }
ParsedMainComponent mainComponent = null;
@@ -980,6 +988,9 @@ public class ParsingPackageUtils {
if (type != XmlPullParser.START_TAG) {
continue;
}
+ if (sAconfigFlags.skipCurrentElement(parser)) {
+ continue;
+ }
String tagName = parser.getName();
final ParseResult result;
@@ -1599,6 +1610,9 @@ public class ParsingPackageUtils {
if (type != XmlPullParser.START_TAG) {
continue;
}
+ if (sAconfigFlags.skipCurrentElement(parser)) {
+ continue;
+ }
final String innerTagName = parser.getName();
if (innerTagName.equals("uses-feature")) {
@@ -1839,6 +1853,9 @@ public class ParsingPackageUtils {
if (type != XmlPullParser.START_TAG) {
continue;
}
+ if (sAconfigFlags.skipCurrentElement(parser)) {
+ continue;
+ }
if (parser.getName().equals("intent")) {
ParseResult<ParsedIntentInfoImpl> result = ParsedIntentInfoUtils.parseIntentInfo(
null /*className*/, pkg, res, parser, true /*allowGlobs*/,
@@ -1908,12 +1925,16 @@ public class ParsingPackageUtils {
} else if (parser.getName().equals("package")) {
final TypedArray sa = res.obtainAttributes(parser,
R.styleable.AndroidManifestQueriesPackage);
- final String packageName = sa.getNonConfigurationString(
- R.styleable.AndroidManifestQueriesPackage_name, 0);
- if (TextUtils.isEmpty(packageName)) {
- return input.error("Package name is missing from package tag.");
+ try {
+ final String packageName = sa.getNonConfigurationString(
+ R.styleable.AndroidManifestQueriesPackage_name, 0);
+ if (TextUtils.isEmpty(packageName)) {
+ return input.error("Package name is missing from package tag.");
+ }
+ pkg.addQueriesPackage(packageName.intern());
+ } finally {
+ sa.recycle();
}
- pkg.addQueriesPackage(packageName.intern());
} else if (parser.getName().equals("provider")) {
final TypedArray sa = res.obtainAttributes(parser,
R.styleable.AndroidManifestQueriesProvider);
@@ -2181,6 +2202,9 @@ public class ParsingPackageUtils {
if (type != XmlPullParser.START_TAG) {
continue;
}
+ if (sAconfigFlags.skipCurrentElement(parser)) {
+ continue;
+ }
final ParseResult result;
String tagName = parser.getName();
@@ -2769,6 +2793,9 @@ public class ParsingPackageUtils {
if (type != XmlPullParser.START_TAG) {
continue;
}
+ if (sAconfigFlags.skipCurrentElement(parser)) {
+ continue;
+ }
final String nodeName = parser.getName();
if (nodeName.equals("additional-certificate")) {
@@ -3454,4 +3481,11 @@ public class ParsingPackageUtils {
@NonNull Set<String> getInstallConstraintsAllowlist();
}
+
+ /**
+ * Getter for the flags object
+ */
+ public static AconfigFlags getAconfigFlags() {
+ return sAconfigFlags;
+ }
}
diff --git a/core/java/com/android/internal/ravenwood/RavenwoodEnvironment.java b/core/java/com/android/internal/ravenwood/RavenwoodEnvironment.java
index 1340156321b2..4a3dfbe9c0d3 100644
--- a/core/java/com/android/internal/ravenwood/RavenwoodEnvironment.java
+++ b/core/java/com/android/internal/ravenwood/RavenwoodEnvironment.java
@@ -49,7 +49,7 @@ public class RavenwoodEnvironment {
return false;
}
- public boolean isRunningOnRavenwood$ravenwood() {
+ private boolean isRunningOnRavenwood$ravenwood() {
return true;
}
}
diff --git a/core/java/com/android/internal/view/BaseIWindow.java b/core/java/com/android/internal/view/BaseIWindow.java
index 3fc4fff21d2d..7f896fff5b24 100644
--- a/core/java/com/android/internal/view/BaseIWindow.java
+++ b/core/java/com/android/internal/view/BaseIWindow.java
@@ -64,7 +64,7 @@ public class BaseIWindow extends IWindow.Stub {
@Override
public void insetsControlChanged(InsetsState insetsState,
- InsetsSourceControl[] activeControls) {
+ InsetsSourceControl.Array activeControls) {
}
@Override
diff --git a/core/java/com/android/internal/widget/CompactMessagingLayout.java b/core/java/com/android/internal/widget/CompactMessagingLayout.java
new file mode 100644
index 000000000000..1e2c01ae4be9
--- /dev/null
+++ b/core/java/com/android/internal/widget/CompactMessagingLayout.java
@@ -0,0 +1,263 @@
+/*
+ * 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.internal.widget;
+
+import android.app.Notification;
+import android.app.Notification.MessagingStyle;
+import android.app.Person;
+import android.content.Context;
+import android.content.res.ColorStateList;
+import android.graphics.drawable.Drawable;
+import android.graphics.drawable.Icon;
+import android.os.Bundle;
+import android.os.Parcelable;
+import android.text.TextUtils;
+import android.util.AttributeSet;
+import android.view.RemotableViewMethod;
+import android.view.View;
+import android.view.ViewStub;
+import android.widget.FrameLayout;
+import android.widget.ImageView;
+import android.widget.RemoteViews;
+
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+
+import com.android.internal.R;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * A custom-built layout for the compact Heads Up of Notification.MessagingStyle .
+ */
+@RemoteViews.RemoteView
+public class CompactMessagingLayout extends FrameLayout {
+
+ private final PeopleHelper mPeopleHelper = new PeopleHelper();
+
+ private ViewStub mConversationFacePileViewStub;
+
+ private int mNotificationBackgroundColor;
+ private int mFacePileSize;
+ private int mFacePileAvatarSize;
+ private int mFacePileProtectionWidth;
+ private int mLayoutColor;
+
+ public CompactMessagingLayout(@NonNull Context context) {
+ super(context);
+ }
+
+ public CompactMessagingLayout(@NonNull Context context,
+ @Nullable AttributeSet attrs) {
+ super(context, attrs);
+ }
+
+ public CompactMessagingLayout(@NonNull Context context, @Nullable AttributeSet attrs,
+ int defStyleAttr) {
+ super(context, attrs, defStyleAttr);
+ }
+
+ public CompactMessagingLayout(@NonNull Context context, @Nullable AttributeSet attrs,
+ int defStyleAttr, int defStyleRes) {
+ super(context, attrs, defStyleAttr, defStyleRes);
+ }
+
+ @Override
+ protected void onFinishInflate() {
+ super.onFinishInflate();
+ mPeopleHelper.init(getContext());
+ mConversationFacePileViewStub = requireViewById(R.id.conversation_face_pile);
+ mFacePileSize = getResources()
+ .getDimensionPixelSize(R.dimen.conversation_compact_face_pile_size);
+ mFacePileAvatarSize = getResources()
+ .getDimensionPixelSize(R.dimen.conversation_compact_face_pile_avatar_size);
+ mFacePileProtectionWidth = getResources().getDimensionPixelSize(
+ R.dimen.conversation_compact_face_pile_protection_width);
+ }
+
+ /**
+ * Set conversation data
+ *
+ * @param extras Bundle contains conversation data
+ */
+ @RemotableViewMethod(asyncImpl = "setGroupFacePileAsync")
+ public void setGroupFacePile(Bundle extras) {
+ // NO-OP
+ }
+
+ /**
+ * async version of {@link ConversationLayout#setLayoutColor}
+ */
+ @RemotableViewMethod
+ public Runnable setLayoutColorAsync(int color) {
+ mLayoutColor = color;
+ return NotificationRunnables.NOOP;
+ }
+
+ @RemotableViewMethod(asyncImpl = "setLayoutColorAsync")
+ public void setLayoutColor(int color) {
+ mLayoutColor = color;
+ }
+
+ /**
+ * @param color the color of the notification background
+ */
+ @RemotableViewMethod
+ public void setNotificationBackgroundColor(int color) {
+ mNotificationBackgroundColor = color;
+ }
+
+ /**
+ * async version of {@link CompactMessagingLayout#setGroupFacePile}
+ * setGroupFacePile!
+ */
+ public Runnable setGroupFacePileAsync(Bundle extras) {
+ final Parcelable[] messages = extras.getParcelableArray(Notification.EXTRA_MESSAGES);
+ final List<Notification.MessagingStyle.Message> newMessages =
+ Notification.MessagingStyle.Message.getMessagesFromBundleArray(messages);
+ final Parcelable[] histMessages =
+ extras.getParcelableArray(Notification.EXTRA_HISTORIC_MESSAGES);
+ final List<Notification.MessagingStyle.Message> newHistoricMessages =
+ Notification.MessagingStyle.Message.getMessagesFromBundleArray(histMessages);
+ final Person user = extras.getParcelable(Notification.EXTRA_MESSAGING_PERSON, Person.class);
+
+ final List<List<MessagingStyle.Message>> groups = groupMessages(newMessages,
+ newHistoricMessages);
+ final PeopleHelper.NameToPrefixMap nameToPrefixMap =
+ mPeopleHelper.mapUniqueNamesToPrefixWithGroupList(groups);
+ final int layoutColor = mLayoutColor;
+ // Find last two person's icon to show them in the face pile.
+ Icon secondLastIcon = null;
+ Icon lastIcon = null;
+ CharSequence lastKey = null;
+ final CharSequence userKey = getPersonKey(user);
+ for (int i = groups.size() - 1; i >= 0; i--) {
+ final MessagingStyle.Message message = groups.get(i).get(0);
+ final Person sender =
+ message.getSenderPerson() != null ? message.getSenderPerson() : user;
+ final CharSequence senderKey = getPersonKey(sender);
+ final boolean notUser = senderKey != userKey;
+ final boolean notIncluded = senderKey != lastKey;
+
+ if ((notUser && notIncluded) || (i == 0 && lastKey == null)) {
+ final Icon icon = getSenderIcon(sender, nameToPrefixMap, layoutColor);
+ if (lastIcon == null) {
+ lastIcon = icon;
+ lastKey = senderKey;
+ } else {
+ secondLastIcon = icon;
+ break;
+ }
+ }
+ }
+
+ if (lastIcon == null) {
+ lastIcon = getSenderIcon(null, null, layoutColor);
+ }
+
+ if (secondLastIcon == null) {
+ secondLastIcon = getSenderIcon(null, null, layoutColor);
+ }
+ final Drawable secondLastIconDrawable = secondLastIcon.loadDrawable(getContext());
+ final Drawable lastIconDrawable = lastIcon.loadDrawable(getContext());
+ return () -> {
+ final View conversationFacePile = mConversationFacePileViewStub.inflate();
+ conversationFacePile.setVisibility(VISIBLE);
+
+ final ImageView facePileBottomBg = conversationFacePile.requireViewById(
+ com.android.internal.R.id.conversation_face_pile_bottom_background);
+ final ImageView facePileTop = conversationFacePile.requireViewById(
+ com.android.internal.R.id.conversation_face_pile_top);
+ final ImageView facePileBottom = conversationFacePile.requireViewById(
+ com.android.internal.R.id.conversation_face_pile_bottom);
+
+ facePileTop.setImageDrawable(secondLastIconDrawable);
+ facePileBottom.setImageDrawable(lastIconDrawable);
+ facePileBottomBg.setImageTintList(ColorStateList.valueOf(mNotificationBackgroundColor));
+ setSize(conversationFacePile, mFacePileSize);
+ setSize(facePileBottom, mFacePileAvatarSize);
+ setSize(facePileTop, mFacePileAvatarSize);
+ setSize(facePileBottomBg, mFacePileAvatarSize + 2 * mFacePileProtectionWidth);
+ };
+ }
+
+ @NonNull
+ private Icon getSenderIcon(@Nullable Person sender,
+ @Nullable PeopleHelper.NameToPrefixMap uniqueNames,
+ int layoutColor) {
+ if (sender == null) {
+ return mPeopleHelper.createAvatarSymbol(/* name = */ "", /* symbol = */ "",
+ layoutColor);
+ }
+
+ if (sender.getIcon() != null) {
+ return sender.getIcon();
+ }
+
+ final CharSequence senderName = sender.getName();
+ if (!TextUtils.isEmpty(senderName)) {
+ final String symbol = uniqueNames != null ? uniqueNames.getPrefix(senderName) : "";
+ return mPeopleHelper.createAvatarSymbol(senderName, symbol, layoutColor);
+ }
+
+ return mPeopleHelper.createAvatarSymbol(/* name = */ "", /* symbol = */ "", layoutColor);
+ }
+
+
+ /**
+ * Groups the given messages by their sender.
+ */
+ private static List<List<MessagingStyle.Message>> groupMessages(
+ List<MessagingStyle.Message> messages,
+ List<MessagingStyle.Message> historicMessages
+ ) {
+ if (messages.isEmpty() && historicMessages.isEmpty()) return List.of();
+
+ ArrayList<MessagingStyle.Message> currentGroup = null;
+ CharSequence currentSenderKey = null;
+ final ArrayList<List<MessagingStyle.Message>> groups = new ArrayList<>();
+ final int histSize = historicMessages.size();
+
+ for (int i = 0; i < histSize + messages.size(); i++) {
+ final MessagingStyle.Message message = i < histSize ? historicMessages.get(i)
+ : messages.get(i - histSize);
+ if (message == null) continue;
+
+ final CharSequence senderKey = getPersonKey(message.getSenderPerson());
+ final boolean isNewGroup = currentGroup == null || senderKey != currentSenderKey;
+ if (isNewGroup) {
+ currentGroup = new ArrayList<>();
+ groups.add(currentGroup);
+ currentSenderKey = senderKey;
+ }
+ currentGroup.add(message);
+ }
+ return groups;
+ }
+
+ private static CharSequence getPersonKey(@Nullable Person person) {
+ return person == null ? null : person.getKey() == null ? person.getName() : person.getKey();
+ }
+
+ private static void setSize(View view, int size) {
+ final FrameLayout.LayoutParams lp = (FrameLayout.LayoutParams) view.getLayoutParams();
+ lp.width = size;
+ lp.height = size;
+ view.setLayoutParams(lp);
+ }
+}
diff --git a/core/jni/Android.bp b/core/jni/Android.bp
index 80a75999c3d0..61eaa526116c 100644
--- a/core/jni/Android.bp
+++ b/core/jni/Android.bp
@@ -439,6 +439,7 @@ cc_library_shared_for_libandroid_runtime {
"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",
@@ -483,4 +484,8 @@ cc_library_shared {
"libnativehelper",
"libvintf",
],
+
+ required: [
+ "vintf",
+ ],
}
diff --git a/core/jni/android_hardware_UsbDeviceConnection.cpp b/core/jni/android_hardware_UsbDeviceConnection.cpp
index 7267eb8cb3dc..a0228428e90e 100644
--- a/core/jni/android_hardware_UsbDeviceConnection.cpp
+++ b/core/jni/android_hardware_UsbDeviceConnection.cpp
@@ -190,21 +190,17 @@ android_hardware_UsbDeviceConnection_bulk_request(JNIEnv *env, jobject thiz,
return -1;
}
- bool is_dir_in = (endpoint & USB_ENDPOINT_DIR_MASK) == USB_DIR_IN;
- jbyte *bufferBytes = (jbyte *)malloc(length);
-
- if (!is_dir_in && buffer) {
- env->GetByteArrayRegion(buffer, start, length, bufferBytes);
+ jbyte* bufferBytes = NULL;
+ if (buffer) {
+ bufferBytes = (jbyte*)env->GetPrimitiveArrayCritical(buffer, NULL);
}
- jint result = usb_device_bulk_transfer(device, endpoint, bufferBytes, length, timeout);
+ jint result = usb_device_bulk_transfer(device, endpoint, bufferBytes + start, length, timeout);
- if (is_dir_in && buffer) {
- env->SetByteArrayRegion(buffer, start, length, bufferBytes);
+ if (bufferBytes) {
+ env->ReleasePrimitiveArrayCritical(buffer, bufferBytes, 0);
}
- free(bufferBytes);
-
return result;
}
diff --git a/core/jni/android_os_VintfObject.cpp b/core/jni/android_os_VintfObject.cpp
index 8dc9d0aa578e..7a4854bbd260 100644
--- a/core/jni/android_os_VintfObject.cpp
+++ b/core/jni/android_os_VintfObject.cpp
@@ -32,6 +32,8 @@ static jmethodID gHashMapInit;
static jmethodID gHashMapPut;
static jclass gLongClazz;
static jmethodID gLongValueOf;
+static jclass gVintfObjectClazz;
+static jmethodID gRunCommand;
namespace android {
@@ -47,6 +49,56 @@ using vintf::VintfObject;
using vintf::Vndk;
using vintf::CheckFlags::ENABLE_ALL_CHECKS;
+// Instead of VintfObject::GetXxx(), we construct
+// HalManifest/CompatibilityMatrix objects by calling `vintf` through
+// UiAutomation.executeShellCommand() so that the commands are executed
+// using shell identity. Otherwise, we would need to allow "apps" to access
+// files like apex-info-list.xml which we don't want to open to apps.
+// This is okay because VintfObject is @TestApi and only used in CTS tests.
+
+static std::string runCmd(JNIEnv* env, const char* cmd) {
+ jstring jstr = (jstring)env->CallStaticObjectMethod(gVintfObjectClazz, gRunCommand,
+ env->NewStringUTF(cmd));
+ std::string output;
+ if (jstr) {
+ auto cstr = env->GetStringUTFChars(jstr, nullptr);
+ output = std::string(cstr);
+ env->ReleaseStringUTFChars(jstr, cstr);
+ } else {
+ LOG(WARNING) << "Failed to run " << cmd;
+ env->ExceptionDescribe();
+ env->ExceptionClear();
+ }
+ return output;
+}
+
+template <typename T>
+static std::shared_ptr<const T> fromXml(const std::string& content) {
+ std::shared_ptr<T> object = std::make_unique<T>();
+ std::string error;
+ if (fromXml(object.get(), content, &error)) {
+ return object;
+ }
+ LOG(WARNING) << "Unabled to parse: " << error;
+ return nullptr;
+}
+
+static std::shared_ptr<const HalManifest> getDeviceHalManifest(JNIEnv* env) {
+ return fromXml<HalManifest>(runCmd(env, "vintf dm"));
+}
+
+static std::shared_ptr<const HalManifest> getFrameworkHalManifest(JNIEnv* env) {
+ return fromXml<HalManifest>(runCmd(env, "vintf fm"));
+}
+
+static std::shared_ptr<const CompatibilityMatrix> getDeviceCompatibilityMatrix(JNIEnv* env) {
+ return fromXml<CompatibilityMatrix>(runCmd(env, "vintf dcm"));
+}
+
+static std::shared_ptr<const CompatibilityMatrix> getFrameworkCompatibilityMatrix(JNIEnv* env) {
+ return fromXml<CompatibilityMatrix>(runCmd(env, "vintf fcm"));
+}
+
template<typename V>
static inline jobjectArray toJavaStringArray(JNIEnv* env, const V& v) {
size_t i;
@@ -83,12 +135,10 @@ static jobjectArray android_os_VintfObject_report(JNIEnv* env, jclass)
{
std::vector<std::string> cStrings;
- tryAddSchema(VintfObject::GetDeviceHalManifest(), "device manifest", &cStrings);
- tryAddSchema(VintfObject::GetFrameworkHalManifest(), "framework manifest", &cStrings);
- tryAddSchema(VintfObject::GetDeviceCompatibilityMatrix(), "device compatibility matrix",
- &cStrings);
- tryAddSchema(VintfObject::GetFrameworkCompatibilityMatrix(), "framework compatibility matrix",
- &cStrings);
+ tryAddSchema(getDeviceHalManifest(env), "device manifest", &cStrings);
+ tryAddSchema(getFrameworkHalManifest(env), "framework manifest", &cStrings);
+ tryAddSchema(getDeviceCompatibilityMatrix(env), "device compatibility matrix", &cStrings);
+ tryAddSchema(getFrameworkCompatibilityMatrix(env), "framework compatibility matrix", &cStrings);
return toJavaStringArray(env, cStrings);
}
@@ -108,15 +158,13 @@ static jint android_os_VintfObject_verifyBuildAtBoot(JNIEnv*, jclass) {
static jobjectArray android_os_VintfObject_getHalNamesAndVersions(JNIEnv* env, jclass) {
std::set<std::string> halNames;
- tryAddHalNamesAndVersions(VintfObject::GetDeviceHalManifest(),
- "device manifest", &halNames);
- tryAddHalNamesAndVersions(VintfObject::GetFrameworkHalManifest(),
- "framework manifest", &halNames);
+ tryAddHalNamesAndVersions(getDeviceHalManifest(env), "device manifest", &halNames);
+ tryAddHalNamesAndVersions(getFrameworkHalManifest(env), "framework manifest", &halNames);
return toJavaStringArray(env, halNames);
}
static jstring android_os_VintfObject_getSepolicyVersion(JNIEnv* env, jclass) {
- std::shared_ptr<const HalManifest> manifest = VintfObject::GetDeviceHalManifest();
+ std::shared_ptr<const HalManifest> manifest = getDeviceHalManifest(env);
if (manifest == nullptr || manifest->type() != SchemaType::DEVICE) {
LOG(WARNING) << __FUNCTION__ << "Cannot get device manifest";
return nullptr;
@@ -126,8 +174,7 @@ static jstring android_os_VintfObject_getSepolicyVersion(JNIEnv* env, jclass) {
}
static jstring android_os_VintfObject_getPlatformSepolicyVersion(JNIEnv* env, jclass) {
- std::shared_ptr<const CompatibilityMatrix> matrix =
- VintfObject::GetFrameworkCompatibilityMatrix();
+ std::shared_ptr<const CompatibilityMatrix> matrix = getFrameworkCompatibilityMatrix(env);
if (matrix == nullptr || matrix->type() != SchemaType::FRAMEWORK) {
jniThrowRuntimeException(env, "Cannot get framework compatibility matrix");
return nullptr;
@@ -148,7 +195,7 @@ static jstring android_os_VintfObject_getPlatformSepolicyVersion(JNIEnv* env, jc
}
static jobject android_os_VintfObject_getVndkSnapshots(JNIEnv* env, jclass) {
- std::shared_ptr<const HalManifest> manifest = VintfObject::GetFrameworkHalManifest();
+ std::shared_ptr<const HalManifest> manifest = getFrameworkHalManifest(env);
if (manifest == nullptr || manifest->type() != SchemaType::FRAMEWORK) {
LOG(WARNING) << __FUNCTION__ << "Cannot get framework manifest";
return nullptr;
@@ -163,7 +210,7 @@ static jobject android_os_VintfObject_getVndkSnapshots(JNIEnv* env, jclass) {
}
static jobject android_os_VintfObject_getTargetFrameworkCompatibilityMatrixVersion(JNIEnv* env, jclass) {
- std::shared_ptr<const HalManifest> manifest = VintfObject::GetDeviceHalManifest();
+ std::shared_ptr<const HalManifest> manifest = getDeviceHalManifest(env);
if (manifest == nullptr || manifest->level() == Level::UNSPECIFIED) {
return nullptr;
}
@@ -188,19 +235,20 @@ static const JNINativeMethod gVintfObjectMethods[] = {
const char* const kVintfObjectPathName = "android/os/VintfObject";
-int register_android_os_VintfObject(JNIEnv* env)
-{
-
+int register_android_os_VintfObject(JNIEnv* env) {
gString = MakeGlobalRefOrDie(env, FindClassOrDie(env, "java/lang/String"));
gHashMapClazz = MakeGlobalRefOrDie(env, FindClassOrDie(env, "java/util/HashMap"));
gHashMapInit = GetMethodIDOrDie(env, gHashMapClazz, "<init>", "()V");
- gHashMapPut = GetMethodIDOrDie(env, gHashMapClazz,
- "put", "(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;");
+ gHashMapPut = GetMethodIDOrDie(env, gHashMapClazz, "put",
+ "(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;");
gLongClazz = MakeGlobalRefOrDie(env, FindClassOrDie(env, "java/lang/Long"));
gLongValueOf = GetStaticMethodIDOrDie(env, gLongClazz, "valueOf", "(J)Ljava/lang/Long;");
+ gVintfObjectClazz = MakeGlobalRefOrDie(env, FindClassOrDie(env, kVintfObjectPathName));
+ gRunCommand = GetStaticMethodIDOrDie(env, gVintfObjectClazz, "runShellCommand",
+ "(Ljava/lang/String;)Ljava/lang/String;");
return RegisterMethodsOrDie(env, kVintfObjectPathName, gVintfObjectMethods,
- NELEM(gVintfObjectMethods));
+ NELEM(gVintfObjectMethods));
}
extern int register_android_os_VintfRuntimeInfo(JNIEnv* env);
diff --git a/core/jni/android_view_InputDevice.cpp b/core/jni/android_view_InputDevice.cpp
index aae0da9006a2..f5992d906323 100644
--- a/core/jni/android_view_InputDevice.cpp
+++ b/core/jni/android_view_InputDevice.cpp
@@ -90,7 +90,8 @@ jobject android_view_InputDevice_create(JNIEnv* env, const InputDeviceInfo& devi
deviceInfo.hasButtonUnderPad(), deviceInfo.hasSensor(),
deviceInfo.hasBattery(), usiVersion.majorVersion,
usiVersion.minorVersion,
- deviceInfo.getAssociatedDisplayId()));
+ deviceInfo.getAssociatedDisplayId(),
+ deviceInfo.isEnabled()));
// Note: We do not populate the Bluetooth address into the InputDevice object to avoid leaking
// it to apps that do not have the Bluetooth permission.
@@ -126,7 +127,7 @@ int register_android_view_InputDevice(JNIEnv* env)
gInputDeviceClassInfo.ctor = GetMethodIDOrDie(env, gInputDeviceClassInfo.clazz, "<init>",
"(IIILjava/lang/String;IIILjava/lang/"
"String;ZIILandroid/view/KeyCharacterMap;Ljava/"
- "lang/String;Ljava/lang/String;ZZZZZIII)V");
+ "lang/String;Ljava/lang/String;ZZZZZIIIZ)V");
gInputDeviceClassInfo.addMotionRange =
GetMethodIDOrDie(env, gInputDeviceClassInfo.clazz, "addMotionRange", "(IIFFFFF)V");
diff --git a/core/jni/platform/host/HostRuntime.cpp b/core/jni/platform/host/HostRuntime.cpp
index acef609448ad..59d18b8535f5 100644
--- a/core/jni/platform/host/HostRuntime.cpp
+++ b/core/jni/platform/host/HostRuntime.cpp
@@ -89,6 +89,7 @@ extern int register_android_database_CursorWindow(JNIEnv* env);
extern int register_android_database_SQLiteConnection(JNIEnv* env);
extern int register_android_database_SQLiteGlobal(JNIEnv* env);
extern int register_android_database_SQLiteDebug(JNIEnv* env);
+extern int register_android_database_SQLiteRawStatement(JNIEnv* env);
extern int register_android_os_FileObserver(JNIEnv* env);
extern int register_android_os_MessageQueue(JNIEnv* env);
extern int register_android_os_Parcel(JNIEnv* env);
@@ -128,6 +129,8 @@ static const std::unordered_map<std::string, RegJNIRec> gRegJNIMap = {
REG_JNI(register_android_database_SQLiteConnection)},
{"android.database.sqlite.SQLiteGlobal", REG_JNI(register_android_database_SQLiteGlobal)},
{"android.database.sqlite.SQLiteDebug", REG_JNI(register_android_database_SQLiteDebug)},
+ {"android.database.sqlite.SQLiteRawStatement",
+ REG_JNI(register_android_database_SQLiteRawStatement)},
#endif
{"android.content.res.StringBlock", REG_JNI(register_android_content_StringBlock)},
{"android.content.res.XmlBlock", REG_JNI(register_android_content_XmlBlock)},
diff --git a/core/res/res/layout/notification_template_material_messaging_compact_heads_up.xml b/core/res/res/layout/notification_template_material_messaging_compact_heads_up.xml
index 3b288d7038e1..82920bad95cd 100644
--- a/core/res/res/layout/notification_template_material_messaging_compact_heads_up.xml
+++ b/core/res/res/layout/notification_template_material_messaging_compact_heads_up.xml
@@ -13,7 +13,7 @@
~ See the License for the specific language governing permissions and
~ limitations under the License
-->
-<FrameLayout
+<com.android.internal.widget.CompactMessagingLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/status_bar_latest_event_content"
android:layout_width="match_parent"
@@ -45,6 +45,14 @@
android:scaleType="centerCrop"
android:importantForAccessibility="no"
/>
+ <ViewStub
+ android:layout="@layout/conversation_face_pile_layout"
+ android:layout_gravity="center_vertical|start"
+ android:layout_width="@dimen/conversation_compact_face_pile_size"
+ android:layout_height="@dimen/conversation_compact_face_pile_size"
+ android:layout_marginStart="@dimen/notification_icon_circle_start"
+ android:id="@+id/conversation_face_pile"
+ />
<FrameLayout
android:id="@+id/alternate_expand_target"
android:layout_width="@dimen/notification_content_margin_start"
@@ -101,4 +109,4 @@
/>
</FrameLayout>
</LinearLayout>
-</FrameLayout>
+</com.android.internal.widget.CompactMessagingLayout>
diff --git a/core/res/res/values-af/strings.xml b/core/res/res/values-af/strings.xml
index 2a3c691dcd04..7fe8641cd889 100644
--- a/core/res/res/values-af/strings.xml
+++ b/core/res/res/values-af/strings.xml
@@ -283,6 +283,8 @@
<string name="global_action_voice_assist" msgid="6655788068555086695">"Stembystand"</string>
<string name="global_action_lockdown" msgid="2475471405907902963">"Snelsluit"</string>
<string name="status_bar_notification_info_overflow" msgid="3330152558746563475">"999+"</string>
+ <!-- no translation found for notification_compact_heads_up_reply (2425293958371284340) -->
+ <skip />
<string name="notification_hidden_text" msgid="2835519769868187223">"Nuwe kennisgewing"</string>
<string name="notification_channel_physical_keyboard" msgid="5417306456125988096">"Fisieke sleutelbord"</string>
<string name="notification_channel_security" msgid="8516754650348238057">"Sekuriteit"</string>
@@ -2413,22 +2415,15 @@
<string name="satellite_notification_open_message" msgid="4149234979688273729">"Maak Boodskappe oop"</string>
<string name="satellite_notification_how_it_works" msgid="3132069321977520519">"Hoe dit werk"</string>
<string name="unarchival_session_app_label" msgid="6811856981546348205">"Hangend …"</string>
- <!-- no translation found for fingerprint_dangling_notification_title (7362075195588639989) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_1 (6261149111900787302) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_2 (7688302770424064884) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_1 (2927018569542316055) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_2 (6897989352716156176) -->
- <skip />
- <!-- no translation found for face_dangling_notification_title (947852541060975473) -->
- <skip />
- <!-- no translation found for face_dangling_notification_msg (8806849376915541655) -->
- <skip />
- <!-- no translation found for biometric_dangling_notification_action_set_up (8246885009807817961) -->
+ <string name="fingerprint_dangling_notification_title" msgid="7362075195588639989">"Stel Vingerafdrukslot weer op"</string>
+ <!-- no translation found for fingerprint_dangling_notification_msg_1 (8517140433796229725) -->
<skip />
- <!-- no translation found for biometric_dangling_notification_action_not_now (8095249216864443491) -->
+ <!-- no translation found for fingerprint_dangling_notification_msg_2 (7578829498452127613) -->
<skip />
+ <string name="fingerprint_dangling_notification_msg_all_deleted_1" msgid="2927018569542316055">"<xliff:g id="FINGERPRINT">%s</xliff:g> het nie goed gewerk nie en is uitgevee. Stel dit weer op om jou foon met vingerafdruk te ontsluit."</string>
+ <string name="fingerprint_dangling_notification_msg_all_deleted_2" msgid="6897989352716156176">"<xliff:g id="FINGERPRINT_0">%1$s</xliff:g> en <xliff:g id="FINGERPRINT_1">%2$s</xliff:g> het nie goed gewerk nie en is uitgevee. Stel dit weer op om jou foon met jou vingerafdruk te ontsluit."</string>
+ <string name="face_dangling_notification_title" msgid="947852541060975473">"Stel Gesigslot weer op"</string>
+ <string name="face_dangling_notification_msg" msgid="8806849376915541655">"Jou gesigmodel het nie goed gewerk nie en is uitgevee. Stel dit weer op om jou foon met gesig te ontsluit."</string>
+ <string name="biometric_dangling_notification_action_set_up" msgid="8246885009807817961">"Stel op"</string>
+ <string name="biometric_dangling_notification_action_not_now" msgid="8095249216864443491">"Nie nou nie"</string>
</resources>
diff --git a/core/res/res/values-am/strings.xml b/core/res/res/values-am/strings.xml
index 08a290c454f3..1d1ded6ce468 100644
--- a/core/res/res/values-am/strings.xml
+++ b/core/res/res/values-am/strings.xml
@@ -283,6 +283,8 @@
<string name="global_action_voice_assist" msgid="6655788068555086695">"የድምጽ እርዳታ"</string>
<string name="global_action_lockdown" msgid="2475471405907902963">"መቆለፊያ"</string>
<string name="status_bar_notification_info_overflow" msgid="3330152558746563475">"999+"</string>
+ <!-- no translation found for notification_compact_heads_up_reply (2425293958371284340) -->
+ <skip />
<string name="notification_hidden_text" msgid="2835519769868187223">"አዲስ ማሳወቂያ"</string>
<string name="notification_channel_physical_keyboard" msgid="5417306456125988096">"አካላዊ ቁልፍ ሰሌዳ"</string>
<string name="notification_channel_security" msgid="8516754650348238057">"ደህንነት"</string>
@@ -2413,22 +2415,15 @@
<string name="satellite_notification_open_message" msgid="4149234979688273729">"መልዕክቶች ይክፈቱ"</string>
<string name="satellite_notification_how_it_works" msgid="3132069321977520519">"እንዴት እንደሚሠራ"</string>
<string name="unarchival_session_app_label" msgid="6811856981546348205">"በመጠባበቅ ላይ..."</string>
- <!-- no translation found for fingerprint_dangling_notification_title (7362075195588639989) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_1 (6261149111900787302) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_2 (7688302770424064884) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_1 (2927018569542316055) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_2 (6897989352716156176) -->
- <skip />
- <!-- no translation found for face_dangling_notification_title (947852541060975473) -->
- <skip />
- <!-- no translation found for face_dangling_notification_msg (8806849376915541655) -->
- <skip />
- <!-- no translation found for biometric_dangling_notification_action_set_up (8246885009807817961) -->
+ <string name="fingerprint_dangling_notification_title" msgid="7362075195588639989">"በጣት አሻራ መክፈቻን እንደገና ያዋቅሩ"</string>
+ <!-- no translation found for fingerprint_dangling_notification_msg_1 (8517140433796229725) -->
<skip />
- <!-- no translation found for biometric_dangling_notification_action_not_now (8095249216864443491) -->
+ <!-- no translation found for fingerprint_dangling_notification_msg_2 (7578829498452127613) -->
<skip />
+ <string name="fingerprint_dangling_notification_msg_all_deleted_1" msgid="2927018569542316055">"<xliff:g id="FINGERPRINT">%s</xliff:g> በደንብ እየሠራ አልነበረም እና ተሰርዟል። ስልክዎን በጣት አሻራ ለመክፈት እንደገና ያዋቅሩት።"</string>
+ <string name="fingerprint_dangling_notification_msg_all_deleted_2" msgid="6897989352716156176">"<xliff:g id="FINGERPRINT_0">%1$s</xliff:g> እና <xliff:g id="FINGERPRINT_1">%2$s</xliff:g> በደንብ እየሠሩ አልነበረም እና ተሰርዘዋል። ስልክዎን በጣት አሻራ ለመክፈት እንደገና ያዋቅሯቸው።"</string>
+ <string name="face_dangling_notification_title" msgid="947852541060975473">"በመልክ መክፈትን እንደገና ያዋቅሩ"</string>
+ <string name="face_dangling_notification_msg" msgid="8806849376915541655">"የእርስዎ የመልክ ሞዴል በደንብ እየሠራ አልነበረም እና ተሰርዟል። ስልክዎን በመልክ ለመክፈት እንደገና ያዋቅሩት።"</string>
+ <string name="biometric_dangling_notification_action_set_up" msgid="8246885009807817961">"ያዋቅሩ"</string>
+ <string name="biometric_dangling_notification_action_not_now" msgid="8095249216864443491">"አሁን አይደለም"</string>
</resources>
diff --git a/core/res/res/values-ar/strings.xml b/core/res/res/values-ar/strings.xml
index 20d491fd22d8..6ee9d5dab3a3 100644
--- a/core/res/res/values-ar/strings.xml
+++ b/core/res/res/values-ar/strings.xml
@@ -287,6 +287,8 @@
<string name="global_action_voice_assist" msgid="6655788068555086695">"المساعد الصوتي"</string>
<string name="global_action_lockdown" msgid="2475471405907902963">"إلغاء التأمين"</string>
<string name="status_bar_notification_info_overflow" msgid="3330152558746563475">"999+"</string>
+ <!-- no translation found for notification_compact_heads_up_reply (2425293958371284340) -->
+ <skip />
<string name="notification_hidden_text" msgid="2835519769868187223">"إشعار جديد"</string>
<string name="notification_channel_physical_keyboard" msgid="5417306456125988096">"لوحة المفاتيح الخارجية"</string>
<string name="notification_channel_security" msgid="8516754650348238057">"الأمان"</string>
@@ -2398,9 +2400,9 @@
<string name="keyboard_layout_notification_more_than_three_selected_message" msgid="1581834181578206937">"تم ضبط تنسيق لوحة المفاتيح على <xliff:g id="LAYOUT_1">%1$s</xliff:g> و<xliff:g id="LAYOUT_2">%2$s</xliff:g> و<xliff:g id="LAYOUT_3">%3$s</xliff:g>… انقر لتغييره."</string>
<string name="keyboard_layout_notification_multiple_selected_title" msgid="5242444914367024499">"تم إعداد لوحات المفاتيح الخارجية"</string>
<string name="keyboard_layout_notification_multiple_selected_message" msgid="6576533454124419202">"انقر لعرض لوحات المفاتيح."</string>
- <string name="profile_label_private" msgid="6463418670715290696">"ملف شخصي خاص"</string>
+ <string name="profile_label_private" msgid="6463418670715290696">"المساحة الخاصة"</string>
<string name="profile_label_clone" msgid="769106052210954285">"نسخة طبق الأصل"</string>
- <string name="profile_label_work" msgid="3495359133038584618">"ملف العمل"</string>
+ <string name="profile_label_work" msgid="3495359133038584618">"مساحة العمل"</string>
<string name="profile_label_work_2" msgid="4691533661598632135">"ملف العمل 2"</string>
<string name="profile_label_work_3" msgid="4834572253956798917">"ملف العمل 3"</string>
<string name="profile_label_test" msgid="9168641926186071947">"ملف شخصي تجريبي"</string>
@@ -2417,22 +2419,15 @@
<string name="satellite_notification_open_message" msgid="4149234979688273729">"فتح تطبيق \"الرسائل\""</string>
<string name="satellite_notification_how_it_works" msgid="3132069321977520519">"طريقة العمل"</string>
<string name="unarchival_session_app_label" msgid="6811856981546348205">"بانتظار الإزالة من الأرشيف…"</string>
- <!-- no translation found for fingerprint_dangling_notification_title (7362075195588639989) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_1 (6261149111900787302) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_2 (7688302770424064884) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_1 (2927018569542316055) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_2 (6897989352716156176) -->
- <skip />
- <!-- no translation found for face_dangling_notification_title (947852541060975473) -->
- <skip />
- <!-- no translation found for face_dangling_notification_msg (8806849376915541655) -->
- <skip />
- <!-- no translation found for biometric_dangling_notification_action_set_up (8246885009807817961) -->
+ <string name="fingerprint_dangling_notification_title" msgid="7362075195588639989">"إعادة إعداد ميزة \"فتح الجهاز ببصمة الإصبع\""</string>
+ <!-- no translation found for fingerprint_dangling_notification_msg_1 (8517140433796229725) -->
<skip />
- <!-- no translation found for biometric_dangling_notification_action_not_now (8095249216864443491) -->
+ <!-- no translation found for fingerprint_dangling_notification_msg_2 (7578829498452127613) -->
<skip />
+ <string name="fingerprint_dangling_notification_msg_all_deleted_1" msgid="2927018569542316055">"هناك مشكلة في <xliff:g id="FINGERPRINT">%s</xliff:g> وتم حذفها. يُرجى إعدادها مرة أخرى لفتح قفل هاتفك باستخدام بصمة الإصبع."</string>
+ <string name="fingerprint_dangling_notification_msg_all_deleted_2" msgid="6897989352716156176">"هناك مشكلة في <xliff:g id="FINGERPRINT_0">%1$s</xliff:g> و<xliff:g id="FINGERPRINT_1">%2$s</xliff:g> وتم حذفهما. يُرجى إعادة إعدادهما لفتح قفل هاتفك باستخدام بصمة الإصبع."</string>
+ <string name="face_dangling_notification_title" msgid="947852541060975473">"إعادة إعداد ميزة \"فتح الجهاز بالتعرّف على الوجه\""</string>
+ <string name="face_dangling_notification_msg" msgid="8806849376915541655">"هناك مشكلة في نموذج الوجه الخاص بك وتم حذفه. يُرجى إعداده مرة أخرى لفتح قفل هاتفك باستخدام وجهك."</string>
+ <string name="biometric_dangling_notification_action_set_up" msgid="8246885009807817961">"إعداد"</string>
+ <string name="biometric_dangling_notification_action_not_now" msgid="8095249216864443491">"لاحقًا"</string>
</resources>
diff --git a/core/res/res/values-as/strings.xml b/core/res/res/values-as/strings.xml
index 30ced90bd5e4..9064df1d5ae5 100644
--- a/core/res/res/values-as/strings.xml
+++ b/core/res/res/values-as/strings.xml
@@ -283,6 +283,8 @@
<string name="global_action_voice_assist" msgid="6655788068555086695">"কণ্ঠধ্বনিৰে সহায়"</string>
<string name="global_action_lockdown" msgid="2475471405907902963">"লকডাউন"</string>
<string name="status_bar_notification_info_overflow" msgid="3330152558746563475">"৯৯৯+"</string>
+ <!-- no translation found for notification_compact_heads_up_reply (2425293958371284340) -->
+ <skip />
<string name="notification_hidden_text" msgid="2835519769868187223">"নতুন জাননী"</string>
<string name="notification_channel_physical_keyboard" msgid="5417306456125988096">"কায়িক কীব’ৰ্ড"</string>
<string name="notification_channel_security" msgid="8516754650348238057">"সুৰক্ষা"</string>
@@ -2413,22 +2415,15 @@
<string name="satellite_notification_open_message" msgid="4149234979688273729">"Messages খোলক"</string>
<string name="satellite_notification_how_it_works" msgid="3132069321977520519">"ই কেনেকৈ কাম কৰে"</string>
<string name="unarchival_session_app_label" msgid="6811856981546348205">"বিবেচনাধীন হৈ আছে..."</string>
- <!-- no translation found for fingerprint_dangling_notification_title (7362075195588639989) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_1 (6261149111900787302) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_2 (7688302770424064884) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_1 (2927018569542316055) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_2 (6897989352716156176) -->
- <skip />
- <!-- no translation found for face_dangling_notification_title (947852541060975473) -->
- <skip />
- <!-- no translation found for face_dangling_notification_msg (8806849376915541655) -->
- <skip />
- <!-- no translation found for biometric_dangling_notification_action_set_up (8246885009807817961) -->
+ <string name="fingerprint_dangling_notification_title" msgid="7362075195588639989">"ফিংগাৰপ্ৰিণ্ট আনলক পুনৰ ছেট আপ কৰক"</string>
+ <!-- no translation found for fingerprint_dangling_notification_msg_1 (8517140433796229725) -->
<skip />
- <!-- no translation found for biometric_dangling_notification_action_not_now (8095249216864443491) -->
+ <!-- no translation found for fingerprint_dangling_notification_msg_2 (7578829498452127613) -->
<skip />
+ <string name="fingerprint_dangling_notification_msg_all_deleted_1" msgid="2927018569542316055">"<xliff:g id="FINGERPRINT">%s</xliff:g>এ ভালদৰে কাম কৰা নাছিল আৰু সেইটো মচি পেলোৱা হৈছে। ফিংগাৰপ্ৰিণ্টৰ জৰিয়তে আপোনাৰ ফ’নটো আনলক কৰিবলৈ এইটো পুনৰ ছেট আপ কৰক।"</string>
+ <string name="fingerprint_dangling_notification_msg_all_deleted_2" msgid="6897989352716156176">"<xliff:g id="FINGERPRINT_0">%1$s</xliff:g> আৰু <xliff:g id="FINGERPRINT_1">%2$s</xliff:g>এ ভালদৰে কাম কৰা নাছিল আৰু সেয়া মচি পেলোৱা হৈছে। ফিংগাৰপ্ৰিণ্টৰ জৰিয়তে আপোনাৰ ফ’নটো আনলক কৰিবলৈ সেয়া পুনৰ ছেট আপ কৰক।"</string>
+ <string name="face_dangling_notification_title" msgid="947852541060975473">"ফে’চ আনলক পুনৰ ছেট আপ কৰক"</string>
+ <string name="face_dangling_notification_msg" msgid="8806849376915541655">"আপোনাৰ মুখাৱয়বৰ মডেলটোৱে ভালদৰে কাম কৰা নাছিল আৰু সেইটো মচি পেলোৱা হৈছে। মুখাৱয়বৰ জৰিয়তে আপোনাৰ ফ’নটো আনলক কৰিবলৈ এইটো পুনৰ ছেট আপ কৰক।"</string>
+ <string name="biometric_dangling_notification_action_set_up" msgid="8246885009807817961">"ছেট আপ কৰক"</string>
+ <string name="biometric_dangling_notification_action_not_now" msgid="8095249216864443491">"এতিয়া নহয়"</string>
</resources>
diff --git a/core/res/res/values-az/strings.xml b/core/res/res/values-az/strings.xml
index 49073f11f897..23a96689c073 100644
--- a/core/res/res/values-az/strings.xml
+++ b/core/res/res/values-az/strings.xml
@@ -283,6 +283,8 @@
<string name="global_action_voice_assist" msgid="6655788068555086695">"Səs Yardımçısı"</string>
<string name="global_action_lockdown" msgid="2475471405907902963">"Kilidləyin"</string>
<string name="status_bar_notification_info_overflow" msgid="3330152558746563475">"999+"</string>
+ <!-- no translation found for notification_compact_heads_up_reply (2425293958371284340) -->
+ <skip />
<string name="notification_hidden_text" msgid="2835519769868187223">"Yeni bildiriş"</string>
<string name="notification_channel_physical_keyboard" msgid="5417306456125988096">"Fiziki klaviatura"</string>
<string name="notification_channel_security" msgid="8516754650348238057">"Güvənlik"</string>
@@ -2413,22 +2415,15 @@
<string name="satellite_notification_open_message" msgid="4149234979688273729">"Mesajı açın"</string>
<string name="satellite_notification_how_it_works" msgid="3132069321977520519">"Haqqında"</string>
<string name="unarchival_session_app_label" msgid="6811856981546348205">"Gözləmədə..."</string>
- <!-- no translation found for fingerprint_dangling_notification_title (7362075195588639989) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_1 (6261149111900787302) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_2 (7688302770424064884) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_1 (2927018569542316055) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_2 (6897989352716156176) -->
- <skip />
- <!-- no translation found for face_dangling_notification_title (947852541060975473) -->
- <skip />
- <!-- no translation found for face_dangling_notification_msg (8806849376915541655) -->
- <skip />
- <!-- no translation found for biometric_dangling_notification_action_set_up (8246885009807817961) -->
+ <string name="fingerprint_dangling_notification_title" msgid="7362075195588639989">"Barmaqla Kilidaçmanı yenidən ayarlayın"</string>
+ <!-- no translation found for fingerprint_dangling_notification_msg_1 (8517140433796229725) -->
<skip />
- <!-- no translation found for biometric_dangling_notification_action_not_now (8095249216864443491) -->
+ <!-- no translation found for fingerprint_dangling_notification_msg_2 (7578829498452127613) -->
<skip />
+ <string name="fingerprint_dangling_notification_msg_all_deleted_1" msgid="2927018569542316055">"<xliff:g id="FINGERPRINT">%s</xliff:g> yaxşı işləmirdi və silindi. Telefonu barmaq izi ilə kiliddən çıxarmaq üçün onu yenidən ayarlayın."</string>
+ <string name="fingerprint_dangling_notification_msg_all_deleted_2" msgid="6897989352716156176">"<xliff:g id="FINGERPRINT_0">%1$s</xliff:g> və <xliff:g id="FINGERPRINT_1">%2$s</xliff:g> yaxşı işləmirdi və silindi. Telefonu barmaq izi ilə kiliddən çıxarmaq üçün onları yenidən ayarlayın."</string>
+ <string name="face_dangling_notification_title" msgid="947852541060975473">"Üzlə Kilidaçmanı yenidən ayarlayın"</string>
+ <string name="face_dangling_notification_msg" msgid="8806849376915541655">"Üz modeliniz yaxşı işləmirdi və silindi. Telefonu üzlə kiliddən çıxarmaq üçün onu yenidən ayarlayın."</string>
+ <string name="biometric_dangling_notification_action_set_up" msgid="8246885009807817961">"Ayarlayın"</string>
+ <string name="biometric_dangling_notification_action_not_now" msgid="8095249216864443491">"İndi yox"</string>
</resources>
diff --git a/core/res/res/values-b+sr+Latn/strings.xml b/core/res/res/values-b+sr+Latn/strings.xml
index ca66ef4a018f..db9a93f7a63a 100644
--- a/core/res/res/values-b+sr+Latn/strings.xml
+++ b/core/res/res/values-b+sr+Latn/strings.xml
@@ -284,6 +284,8 @@
<string name="global_action_voice_assist" msgid="6655788068555086695">"Glasovna pomoć"</string>
<string name="global_action_lockdown" msgid="2475471405907902963">"Zaključavanje"</string>
<string name="status_bar_notification_info_overflow" msgid="3330152558746563475">"999+"</string>
+ <!-- no translation found for notification_compact_heads_up_reply (2425293958371284340) -->
+ <skip />
<string name="notification_hidden_text" msgid="2835519769868187223">"Novo obaveštenje"</string>
<string name="notification_channel_physical_keyboard" msgid="5417306456125988096">"Fizička tastatura"</string>
<string name="notification_channel_security" msgid="8516754650348238057">"Bezbednost"</string>
@@ -835,11 +837,11 @@
<string name="policylab_watchLogin" msgid="7599669460083719504">"Nadzor pokušaja otključavanja ekrana"</string>
<string name="policydesc_watchLogin" product="tablet" msgid="2388436408621909298">"Prati broj netačno unetih lozinki prilikom otključavanja ekrana i zaključava tablet ili briše podatke sa tableta ako je netačna lozinka uneta previše puta."</string>
<string name="policydesc_watchLogin" product="tv" msgid="2140588224468517507">"Nadgleda broj netačnih lozinki unetih pri otključavanju ekrana i zaključava Android TV uređaj ili briše sve podatke sa Android TV uređaja ako se unese previše netačnih lozinki."</string>
- <string name="policydesc_watchLogin" product="automotive" msgid="7011438994051251521">"Prati broj netačno unetih lozinki pri otključavanju ekrana i zaključava sistem za info-zabavu ili briše sve podatke sa sistema za info-zabavu ako je netačna lozinka uneta previše puta."</string>
+ <string name="policydesc_watchLogin" product="automotive" msgid="7011438994051251521">"Prati broj netačno unetih lozinki pri otključavanju ekrana i zaključava sistem za informacije i zabavu ili briše sve podatke sa sistema za informacije i zabavu ako je netačna lozinka uneta previše puta."</string>
<string name="policydesc_watchLogin" product="default" msgid="4885030206253600299">"Prati broj netačno unetih lozinki pri otključavanju ekrana i zaključava telefon ili briše sve podatke sa telefona ako je netačna lozinka uneta previše puta."</string>
<string name="policydesc_watchLogin_secondaryUser" product="tablet" msgid="2049038943004297474">"Nadgleda broj netačnih lozinki unetih pri otključavanju ekrana i zaključava tablet ili briše sve podatke ovog korisnika ako se unese previše netačnih lozinki."</string>
<string name="policydesc_watchLogin_secondaryUser" product="tv" msgid="8965224107449407052">"Nadgleda broj netačnih lozinki unetih pri otključavanju ekrana i zaključava Android TV uređaj ili briše sve podatke ovog korisnika ako se unese previše netačnih lozinki."</string>
- <string name="policydesc_watchLogin_secondaryUser" product="automotive" msgid="7180857406058327941">"Nadgleda broj netačnih lozinki unetih pri otključavanju ekrana i zaključava sistem za info-zabavu ili briše sve podatke ovog profila ako se unese previše netačnih lozinki."</string>
+ <string name="policydesc_watchLogin_secondaryUser" product="automotive" msgid="7180857406058327941">"Nadgleda broj netačnih lozinki unetih pri otključavanju ekrana i zaključava sistem za informacije i zabavu ili briše sve podatke ovog profila ako se unese previše netačnih lozinki."</string>
<string name="policydesc_watchLogin_secondaryUser" product="default" msgid="9177645136475155924">"Nadgleda broj netačnih lozinki unetih pri otključavanju ekrana i zaključava telefon ili briše sve podatke ovog korisnika ako se unese previše netačnih lozinki."</string>
<string name="policylab_resetPassword" msgid="214556238645096520">"Promena zaključavanja ekrana"</string>
<string name="policydesc_resetPassword" msgid="4626419138439341851">"Menja otključavanje ekrana."</string>
@@ -848,13 +850,13 @@
<string name="policylab_wipeData" msgid="1359485247727537311">"Brisanje svih podataka"</string>
<string name="policydesc_wipeData" product="tablet" msgid="7245372676261947507">"Brisanje podataka na tabletu bez upozorenja resetovanjem na fabrička podešavanja."</string>
<string name="policydesc_wipeData" product="tv" msgid="513862488950801261">"Briše podatke Android TV uređaja bez upozorenja pomoću resetovanja na fabrička podešavanja."</string>
- <string name="policydesc_wipeData" product="automotive" msgid="660804547737323300">"Briše podatke na sistemu za info-zabavu bez upozorenja resetovanjem na fabrička podešavanja."</string>
+ <string name="policydesc_wipeData" product="automotive" msgid="660804547737323300">"Briše podatke na sistemu za informacije i zabavu bez upozorenja resetovanjem na fabrička podešavanja."</string>
<string name="policydesc_wipeData" product="default" msgid="8036084184768379022">"Brisanje podataka na telefonu bez upozorenja resetovanjem na fabrička podešavanja."</string>
<string name="policylab_wipeData_secondaryUser" product="automotive" msgid="115034358520328373">"Brisanje podataka profila"</string>
<string name="policylab_wipeData_secondaryUser" product="default" msgid="413813645323433166">"Obriši podatke korisnika"</string>
<string name="policydesc_wipeData_secondaryUser" product="tablet" msgid="2336676480090926470">"Briše podatke ovog korisnika na ovom tabletu bez upozorenja."</string>
<string name="policydesc_wipeData_secondaryUser" product="tv" msgid="2293713284515865200">"Briše podatke ovog korisnika na ovom Android TV uređaju bez upozorenja."</string>
- <string name="policydesc_wipeData_secondaryUser" product="automotive" msgid="4658832487305780879">"Briše podatke ovog profila na ovom sistemu za info-zabavu bez upozorenja."</string>
+ <string name="policydesc_wipeData_secondaryUser" product="automotive" msgid="4658832487305780879">"Briše podatke ovog profila na ovom sistemu za informacije i zabavu bez upozorenja."</string>
<string name="policydesc_wipeData_secondaryUser" product="default" msgid="2788325512167208654">"Briše podatke ovog korisnika na ovom telefonu bez upozorenja."</string>
<string name="policylab_setGlobalProxy" msgid="215332221188670221">"Podesite globalni proksi server uređaja"</string>
<string name="policydesc_setGlobalProxy" msgid="7149665222705519604">"Podešava globalni proksi uređaja koji će se koristiti dok su smernice omogućene. Samo vlasnik uređaja može da podesi globalni proksi."</string>
@@ -2414,22 +2416,15 @@
<string name="satellite_notification_open_message" msgid="4149234979688273729">"Otvori Messages"</string>
<string name="satellite_notification_how_it_works" msgid="3132069321977520519">"Princip rada"</string>
<string name="unarchival_session_app_label" msgid="6811856981546348205">"Na čekanju..."</string>
- <!-- no translation found for fingerprint_dangling_notification_title (7362075195588639989) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_1 (6261149111900787302) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_2 (7688302770424064884) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_1 (2927018569542316055) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_2 (6897989352716156176) -->
- <skip />
- <!-- no translation found for face_dangling_notification_title (947852541060975473) -->
- <skip />
- <!-- no translation found for face_dangling_notification_msg (8806849376915541655) -->
- <skip />
- <!-- no translation found for biometric_dangling_notification_action_set_up (8246885009807817961) -->
+ <string name="fingerprint_dangling_notification_title" msgid="7362075195588639989">"Ponovo podesite otključavanje otiskom prsta"</string>
+ <!-- no translation found for fingerprint_dangling_notification_msg_1 (8517140433796229725) -->
<skip />
- <!-- no translation found for biometric_dangling_notification_action_not_now (8095249216864443491) -->
+ <!-- no translation found for fingerprint_dangling_notification_msg_2 (7578829498452127613) -->
<skip />
+ <string name="fingerprint_dangling_notification_msg_all_deleted_1" msgid="2927018569542316055">"<xliff:g id="FINGERPRINT">%s</xliff:g> nije funkcionisao i izbrisali smo ga. Ponovo ga podesite da biste telefon otključavali otiskom prsta."</string>
+ <string name="fingerprint_dangling_notification_msg_all_deleted_2" msgid="6897989352716156176">"<xliff:g id="FINGERPRINT_0">%1$s</xliff:g> i <xliff:g id="FINGERPRINT_1">%2$s</xliff:g> nisu funkcionisali i izbrisali smo ih. Ponovo ih podesite da biste telefon otključavali otiskom prsta."</string>
+ <string name="face_dangling_notification_title" msgid="947852541060975473">"Ponovo podesite otključavanje licem"</string>
+ <string name="face_dangling_notification_msg" msgid="8806849376915541655">"Vaš model lica nije funkcionisao i izbrisali smo ga. Ponovo ga podesite da biste telefon otključavali licem."</string>
+ <string name="biometric_dangling_notification_action_set_up" msgid="8246885009807817961">"Podesi"</string>
+ <string name="biometric_dangling_notification_action_not_now" msgid="8095249216864443491">"Ne sada"</string>
</resources>
diff --git a/core/res/res/values-be/strings.xml b/core/res/res/values-be/strings.xml
index 4cd150a6ebf6..ec19c2da015e 100644
--- a/core/res/res/values-be/strings.xml
+++ b/core/res/res/values-be/strings.xml
@@ -285,6 +285,8 @@
<string name="global_action_voice_assist" msgid="6655788068555086695">"Галас. дапамога"</string>
<string name="global_action_lockdown" msgid="2475471405907902963">"Блакіроўка"</string>
<string name="status_bar_notification_info_overflow" msgid="3330152558746563475">"999+"</string>
+ <!-- no translation found for notification_compact_heads_up_reply (2425293958371284340) -->
+ <skip />
<string name="notification_hidden_text" msgid="2835519769868187223">"Новае апавяшчэнне"</string>
<string name="notification_channel_physical_keyboard" msgid="5417306456125988096">"Фізічная клавіятура"</string>
<string name="notification_channel_security" msgid="8516754650348238057">"Бяспека"</string>
@@ -2415,22 +2417,15 @@
<string name="satellite_notification_open_message" msgid="4149234979688273729">"Адкрыць Паведамленні"</string>
<string name="satellite_notification_how_it_works" msgid="3132069321977520519">"Як гэта працуе"</string>
<string name="unarchival_session_app_label" msgid="6811856981546348205">"У чаканні..."</string>
- <!-- no translation found for fingerprint_dangling_notification_title (7362075195588639989) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_1 (6261149111900787302) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_2 (7688302770424064884) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_1 (2927018569542316055) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_2 (6897989352716156176) -->
- <skip />
- <!-- no translation found for face_dangling_notification_title (947852541060975473) -->
- <skip />
- <!-- no translation found for face_dangling_notification_msg (8806849376915541655) -->
- <skip />
- <!-- no translation found for biometric_dangling_notification_action_set_up (8246885009807817961) -->
+ <string name="fingerprint_dangling_notification_title" msgid="7362075195588639989">"Наладзіць разблакіроўку адбіткам пальца паўторна"</string>
+ <!-- no translation found for fingerprint_dangling_notification_msg_1 (8517140433796229725) -->
<skip />
- <!-- no translation found for biometric_dangling_notification_action_not_now (8095249216864443491) -->
+ <!-- no translation found for fingerprint_dangling_notification_msg_2 (7578829498452127613) -->
<skip />
+ <string name="fingerprint_dangling_notification_msg_all_deleted_1" msgid="2927018569542316055">"Адбітак пальца \"<xliff:g id="FINGERPRINT">%s</xliff:g>\" не працаваў належным чынам і быў выдалены. Каб мець магчымасць разблакіраваць тэлефон з дапамогай адбітка пальца, наладзьце яго яшчэ раз."</string>
+ <string name="fingerprint_dangling_notification_msg_all_deleted_2" msgid="6897989352716156176">"Адбіткі пальцаў \"<xliff:g id="FINGERPRINT_0">%1$s</xliff:g>\" і \"<xliff:g id="FINGERPRINT_1">%2$s</xliff:g>\" не працавалі належным чынам і былі выдалены. Каб мець магчымасць разблакіраваць тэлефон з дапамогай адбітка пальца, наладзьце іх яшчэ раз."</string>
+ <string name="face_dangling_notification_title" msgid="947852541060975473">"Паўторна наладзьце распазнаванне твару"</string>
+ <string name="face_dangling_notification_msg" msgid="8806849376915541655">"Мадэль твару не працавала належным чынам і была выдалена. Каб мець магчымасць разблакіраваць тэлефон з дапамогай распазнавання твару, наладзьце яго яшчэ раз."</string>
+ <string name="biometric_dangling_notification_action_set_up" msgid="8246885009807817961">"Наладзіць"</string>
+ <string name="biometric_dangling_notification_action_not_now" msgid="8095249216864443491">"Не зараз"</string>
</resources>
diff --git a/core/res/res/values-bg/strings.xml b/core/res/res/values-bg/strings.xml
index eb2e9207367f..1b73710c4548 100644
--- a/core/res/res/values-bg/strings.xml
+++ b/core/res/res/values-bg/strings.xml
@@ -283,6 +283,8 @@
<string name="global_action_voice_assist" msgid="6655788068555086695">"Гласова помощ"</string>
<string name="global_action_lockdown" msgid="2475471405907902963">"Заключване"</string>
<string name="status_bar_notification_info_overflow" msgid="3330152558746563475">"999+"</string>
+ <!-- no translation found for notification_compact_heads_up_reply (2425293958371284340) -->
+ <skip />
<string name="notification_hidden_text" msgid="2835519769868187223">"Ново известие"</string>
<string name="notification_channel_physical_keyboard" msgid="5417306456125988096">"Физическа клавиатура"</string>
<string name="notification_channel_security" msgid="8516754650348238057">"Сигурност"</string>
@@ -1726,7 +1728,7 @@
<string name="accessibility_shortcut_off" msgid="3651336255403648739">"Без включване"</string>
<string name="accessibility_shortcut_menu_item_status_on" msgid="6608392117189732543">"ВКЛ."</string>
<string name="accessibility_shortcut_menu_item_status_off" msgid="5531598275559472393">"ИЗКЛ."</string>
- <string name="accessibility_enable_service_title" msgid="3931558336268541484">"Искате ли да разрешите на <xliff:g id="SERVICE">%1$s</xliff:g> да има пълен контрол над устройството ви?"</string>
+ <string name="accessibility_enable_service_title" msgid="3931558336268541484">"Искате ли да разрешите на „<xliff:g id="SERVICE">%1$s</xliff:g>“ да има пълен контрол над устройството ви?"</string>
<string name="accessibility_service_warning_description" msgid="291674995220940133">"Пълният контрол е подходящ за приложенията, които помагат на потребителите със специални нужди, но не и за повечето приложения."</string>
<string name="accessibility_service_screen_control_title" msgid="190017412626919776">"Преглед и управление на екрана"</string>
<string name="accessibility_service_screen_control_description" msgid="6946315917771791525">"Услугата може да чете цялото съдържание на екрана и да показва такова върху други приложения."</string>
@@ -2413,22 +2415,15 @@
<string name="satellite_notification_open_message" msgid="4149234979688273729">"Отваряне на Messages"</string>
<string name="satellite_notification_how_it_works" msgid="3132069321977520519">"Начин на работа"</string>
<string name="unarchival_session_app_label" msgid="6811856981546348205">"Изчаква..."</string>
- <!-- no translation found for fingerprint_dangling_notification_title (7362075195588639989) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_1 (6261149111900787302) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_2 (7688302770424064884) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_1 (2927018569542316055) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_2 (6897989352716156176) -->
- <skip />
- <!-- no translation found for face_dangling_notification_title (947852541060975473) -->
- <skip />
- <!-- no translation found for face_dangling_notification_msg (8806849376915541655) -->
- <skip />
- <!-- no translation found for biometric_dangling_notification_action_set_up (8246885009807817961) -->
+ <string name="fingerprint_dangling_notification_title" msgid="7362075195588639989">"Повторно настройване на „Отключване с отпечатък“"</string>
+ <!-- no translation found for fingerprint_dangling_notification_msg_1 (8517140433796229725) -->
<skip />
- <!-- no translation found for biometric_dangling_notification_action_not_now (8095249216864443491) -->
+ <!-- no translation found for fingerprint_dangling_notification_msg_2 (7578829498452127613) -->
<skip />
+ <string name="fingerprint_dangling_notification_msg_all_deleted_1" msgid="2927018569542316055">"Отпечатъкът „<xliff:g id="FINGERPRINT">%s</xliff:g>“ бе изтрит, защото не работеше добре. Настройте го отново, за да отключвате телефона си с отпечатък."</string>
+ <string name="fingerprint_dangling_notification_msg_all_deleted_2" msgid="6897989352716156176">"Отпечатъците „<xliff:g id="FINGERPRINT_0">%1$s</xliff:g>“ и „<xliff:g id="FINGERPRINT_1">%2$s</xliff:g>“ бяха изтрити, защото не работеха добре. Настройте ги отново, за да отключвате телефона си с отпечатък."</string>
+ <string name="face_dangling_notification_title" msgid="947852541060975473">"Повторно настройване на „Отключване с лице“"</string>
+ <string name="face_dangling_notification_msg" msgid="8806849376915541655">"Моделът на лицето ви бе изтрит, защото не работеше добре. Настройте го отново, за да отключвате телефона си с лице."</string>
+ <string name="biometric_dangling_notification_action_set_up" msgid="8246885009807817961">"Настройване"</string>
+ <string name="biometric_dangling_notification_action_not_now" msgid="8095249216864443491">"Не сега"</string>
</resources>
diff --git a/core/res/res/values-bn/strings.xml b/core/res/res/values-bn/strings.xml
index 6618127ada43..0e32bbe64c86 100644
--- a/core/res/res/values-bn/strings.xml
+++ b/core/res/res/values-bn/strings.xml
@@ -283,6 +283,8 @@
<string name="global_action_voice_assist" msgid="6655788068555086695">"ভয়েস সহায়তা"</string>
<string name="global_action_lockdown" msgid="2475471405907902963">"লকডাউন"</string>
<string name="status_bar_notification_info_overflow" msgid="3330152558746563475">"৯৯৯+"</string>
+ <!-- no translation found for notification_compact_heads_up_reply (2425293958371284340) -->
+ <skip />
<string name="notification_hidden_text" msgid="2835519769868187223">"নতুন বিজ্ঞপ্তি"</string>
<string name="notification_channel_physical_keyboard" msgid="5417306456125988096">"ফিজিক্যাল কীবোর্ড"</string>
<string name="notification_channel_security" msgid="8516754650348238057">"নিরাপত্তা"</string>
@@ -644,7 +646,7 @@
<string name="biometric_or_screen_lock_dialog_default_subtitle" msgid="159539678371552009">"চালিয়ে যেতে আপনার বায়োমেট্রিক্স বা স্ক্রিন লক ব্যবহার করুন"</string>
<string name="biometric_error_hw_unavailable" msgid="2494077380540615216">"বায়োমেট্রিক হার্ডওয়্যার পাওয়া যাবে না"</string>
<string name="biometric_error_user_canceled" msgid="6732303949695293730">"যাচাইকরণ বাতিল হয়েছে"</string>
- <string name="biometric_not_recognized" msgid="5106687642694635888">"স্বীকৃত নয়"</string>
+ <string name="biometric_not_recognized" msgid="5106687642694635888">"শনাক্ত করা যায়নি"</string>
<string name="biometric_face_not_recognized" msgid="5535599455744525200">"ফেস চেনা যায়নি"</string>
<string name="biometric_error_canceled" msgid="8266582404844179778">"যাচাইকরণ বাতিল হয়েছে"</string>
<string name="biometric_error_device_not_secured" msgid="3129845065043995924">"পিন, প্যাটার্ন অথবা পাসওয়ার্ড সেট করা নেই"</string>
@@ -2413,22 +2415,15 @@
<string name="satellite_notification_open_message" msgid="4149234979688273729">"Messages খুলুন"</string>
<string name="satellite_notification_how_it_works" msgid="3132069321977520519">"এটি কীভাবে কাজ করে"</string>
<string name="unarchival_session_app_label" msgid="6811856981546348205">"বাকি আছে…"</string>
- <!-- no translation found for fingerprint_dangling_notification_title (7362075195588639989) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_1 (6261149111900787302) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_2 (7688302770424064884) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_1 (2927018569542316055) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_2 (6897989352716156176) -->
- <skip />
- <!-- no translation found for face_dangling_notification_title (947852541060975473) -->
- <skip />
- <!-- no translation found for face_dangling_notification_msg (8806849376915541655) -->
- <skip />
- <!-- no translation found for biometric_dangling_notification_action_set_up (8246885009807817961) -->
+ <string name="fingerprint_dangling_notification_title" msgid="7362075195588639989">"\'ফিঙ্গারপ্রিন্ট আনলক\' আবার সেট-আপ করুন"</string>
+ <!-- no translation found for fingerprint_dangling_notification_msg_1 (8517140433796229725) -->
<skip />
- <!-- no translation found for biometric_dangling_notification_action_not_now (8095249216864443491) -->
+ <!-- no translation found for fingerprint_dangling_notification_msg_2 (7578829498452127613) -->
<skip />
+ <string name="fingerprint_dangling_notification_msg_all_deleted_1" msgid="2927018569542316055">"<xliff:g id="FINGERPRINT">%s</xliff:g> ভালোভাবে কাজ করছিল না বলে সেটি মুছে ফেলা হয়েছে। ফিঙ্গারপ্রিন্ট ব্যবহার করে আপনার ফোন আনলক করতে হলে এটি আবার সেট-আপ করুন।"</string>
+ <string name="fingerprint_dangling_notification_msg_all_deleted_2" msgid="6897989352716156176">"<xliff:g id="FINGERPRINT_0">%1$s</xliff:g> ও <xliff:g id="FINGERPRINT_1">%2$s</xliff:g> ভালোভাবে কাজ করছিল না বলে মুছে ফেলা হয়েছে। ফিঙ্গারপ্রিন্ট ব্যবহার করে আপনার ফোন আনলক করতে হলে সেগুলি আবার সেট-আপ করুন।"</string>
+ <string name="face_dangling_notification_title" msgid="947852541060975473">"\'ফেস আনলক\' আবার সেট-আপ করুন"</string>
+ <string name="face_dangling_notification_msg" msgid="8806849376915541655">"আপনার ফেস মডেল ভালোভাবে কাজ করছিল না বলে সেটি মুছে ফেলা হয়েছে। ফেস ব্যবহার করে আপনার ফোন আনলক করতে হলে এটি আবার সেট-আপ করুন।"</string>
+ <string name="biometric_dangling_notification_action_set_up" msgid="8246885009807817961">"সেট-আপ করুন"</string>
+ <string name="biometric_dangling_notification_action_not_now" msgid="8095249216864443491">"এখন নয়"</string>
</resources>
diff --git a/core/res/res/values-bs/strings.xml b/core/res/res/values-bs/strings.xml
index 4f058bf74b41..ddc515325992 100644
--- a/core/res/res/values-bs/strings.xml
+++ b/core/res/res/values-bs/strings.xml
@@ -284,6 +284,8 @@
<string name="global_action_voice_assist" msgid="6655788068555086695">"Glasovna pomoć"</string>
<string name="global_action_lockdown" msgid="2475471405907902963">"Zaključaj"</string>
<string name="status_bar_notification_info_overflow" msgid="3330152558746563475">"999+"</string>
+ <!-- no translation found for notification_compact_heads_up_reply (2425293958371284340) -->
+ <skip />
<string name="notification_hidden_text" msgid="2835519769868187223">"Novo obavještenje"</string>
<string name="notification_channel_physical_keyboard" msgid="5417306456125988096">"Fizička tastatura"</string>
<string name="notification_channel_security" msgid="8516754650348238057">"Sigurnost"</string>
@@ -2414,22 +2416,15 @@
<string name="satellite_notification_open_message" msgid="4149234979688273729">"Otvorite Messages"</string>
<string name="satellite_notification_how_it_works" msgid="3132069321977520519">"Kako ovo funkcionira"</string>
<string name="unarchival_session_app_label" msgid="6811856981546348205">"Na čekanju…"</string>
- <!-- no translation found for fingerprint_dangling_notification_title (7362075195588639989) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_1 (6261149111900787302) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_2 (7688302770424064884) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_1 (2927018569542316055) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_2 (6897989352716156176) -->
- <skip />
- <!-- no translation found for face_dangling_notification_title (947852541060975473) -->
- <skip />
- <!-- no translation found for face_dangling_notification_msg (8806849376915541655) -->
- <skip />
- <!-- no translation found for biometric_dangling_notification_action_set_up (8246885009807817961) -->
+ <string name="fingerprint_dangling_notification_title" msgid="7362075195588639989">"Ponovo postavite otključavanje otiskom prsta"</string>
+ <!-- no translation found for fingerprint_dangling_notification_msg_1 (8517140433796229725) -->
<skip />
- <!-- no translation found for biometric_dangling_notification_action_not_now (8095249216864443491) -->
+ <!-- no translation found for fingerprint_dangling_notification_msg_2 (7578829498452127613) -->
<skip />
+ <string name="fingerprint_dangling_notification_msg_all_deleted_1" msgid="2927018569542316055">"Otisak prsta <xliff:g id="FINGERPRINT">%s</xliff:g> nije dobro funkcionirao, pa je izbrisan. Postavite ga ponovo da otključavate telefon otiskom prsta."</string>
+ <string name="fingerprint_dangling_notification_msg_all_deleted_2" msgid="6897989352716156176">"Otisci prstiju <xliff:g id="FINGERPRINT_0">%1$s</xliff:g> i <xliff:g id="FINGERPRINT_1">%2$s</xliff:g> nisu dobro funkcionirali, pa su izbrisani. Postavite ih ponovo da otključavate telefon otiskom prsta."</string>
+ <string name="face_dangling_notification_title" msgid="947852541060975473">"Ponovo postavite otključavanje licem"</string>
+ <string name="face_dangling_notification_msg" msgid="8806849376915541655">"Model lica nije dobro funkcionirao, pa je izbrisan. Postavite ga ponovo da otključavate telefon licem."</string>
+ <string name="biometric_dangling_notification_action_set_up" msgid="8246885009807817961">"Postavite"</string>
+ <string name="biometric_dangling_notification_action_not_now" msgid="8095249216864443491">"Ne sada"</string>
</resources>
diff --git a/core/res/res/values-ca/strings.xml b/core/res/res/values-ca/strings.xml
index 77fd6b833bb8..1fd814d3561a 100644
--- a/core/res/res/values-ca/strings.xml
+++ b/core/res/res/values-ca/strings.xml
@@ -85,7 +85,7 @@
<string name="NetworkPreferenceSwitchTitle" msgid="1008329951315753038">"No es pot accedir a la xarxa mòbil"</string>
<string name="NetworkPreferenceSwitchSummary" msgid="2086506181486324860">"Prova de canviar de xarxa preferent. Toca per canviar-la."</string>
<string name="EmergencyCallWarningTitle" msgid="1615688002899152860">"Les trucades d\'emergència no estan disponibles"</string>
- <string name="EmergencyCallWarningSummary" msgid="9102799172089265268">"Per poder fer trucades d\'emergència, cal tenir connexió a una xarxa mòbil"</string>
+ <string name="EmergencyCallWarningSummary" msgid="9102799172089265268">"Per poder fer trucades d\'emergència, cal tenir connexió de xarxa mòbil"</string>
<string name="notification_channel_network_alert" msgid="4788053066033851841">"Alertes"</string>
<string name="notification_channel_call_forward" msgid="8230490317314272406">"Desviació de trucades"</string>
<string name="notification_channel_emergency_callback" msgid="54074839059123159">"Mode de devolució de trucada d\'emergència"</string>
@@ -284,6 +284,8 @@
<string name="global_action_voice_assist" msgid="6655788068555086695">"Assist. per veu"</string>
<string name="global_action_lockdown" msgid="2475471405907902963">"Bloqueig de seguretat"</string>
<string name="status_bar_notification_info_overflow" msgid="3330152558746563475">"+999"</string>
+ <!-- no translation found for notification_compact_heads_up_reply (2425293958371284340) -->
+ <skip />
<string name="notification_hidden_text" msgid="2835519769868187223">"Notificació nova"</string>
<string name="notification_channel_physical_keyboard" msgid="5417306456125988096">"Teclat físic"</string>
<string name="notification_channel_security" msgid="8516754650348238057">"Seguretat"</string>
@@ -1905,8 +1907,8 @@
<string name="package_updated_device_owner" msgid="7560272363805506941">"Actualitzat per l\'administrador"</string>
<string name="package_deleted_device_owner" msgid="2292335928930293023">"Suprimit per l\'administrador"</string>
<string name="confirm_battery_saver" msgid="5247976246208245754">"D\'acord"</string>
- <string name="battery_saver_description_with_learn_more" msgid="5444908404021316250">"Estalvi de bateria activa el tema fosc i limita o desactiva l\'activitat en segon pla, alguns efectes visuals, determinades funcions i algunes connexions a la xarxa."</string>
- <string name="battery_saver_description" msgid="8518809702138617167">"Estalvi de bateria activa el tema fosc i limita o desactiva l\'activitat en segon pla, alguns efectes visuals, determinades funcions i algunes connexions a la xarxa."</string>
+ <string name="battery_saver_description_with_learn_more" msgid="5444908404021316250">"Estalvi de bateria activa el tema fosc i limita o desactiva l\'activitat en segon pla, alguns efectes visuals, determinades funcions i algunes connexions de xarxa."</string>
+ <string name="battery_saver_description" msgid="8518809702138617167">"Estalvi de bateria activa el tema fosc i limita o desactiva l\'activitat en segon pla, alguns efectes visuals, determinades funcions i algunes connexions de xarxa."</string>
<string name="data_saver_description" msgid="4995164271550590517">"Per reduir l\'ús de dades, la funció Estalvi de dades evita que determinades aplicacions enviïn o rebin dades en segon pla. L\'aplicació que estiguis fent servir podrà accedir a les dades, però menys sovint. Això vol dir, per exemple, que les imatges no es mostraran fins que no les toquis."</string>
<string name="data_saver_enable_title" msgid="7080620065745260137">"Vols activar l\'Estalvi de dades?"</string>
<string name="data_saver_enable_button" msgid="4399405762586419726">"Activa"</string>
@@ -2414,22 +2416,15 @@
<string name="satellite_notification_open_message" msgid="4149234979688273729">"Obre Missatges"</string>
<string name="satellite_notification_how_it_works" msgid="3132069321977520519">"Com funciona"</string>
<string name="unarchival_session_app_label" msgid="6811856981546348205">"Pendent..."</string>
- <!-- no translation found for fingerprint_dangling_notification_title (7362075195588639989) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_1 (6261149111900787302) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_2 (7688302770424064884) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_1 (2927018569542316055) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_2 (6897989352716156176) -->
- <skip />
- <!-- no translation found for face_dangling_notification_title (947852541060975473) -->
- <skip />
- <!-- no translation found for face_dangling_notification_msg (8806849376915541655) -->
- <skip />
- <!-- no translation found for biometric_dangling_notification_action_set_up (8246885009807817961) -->
+ <string name="fingerprint_dangling_notification_title" msgid="7362075195588639989">"Torna a configurar Desbloqueig amb empremta digital"</string>
+ <!-- no translation found for fingerprint_dangling_notification_msg_1 (8517140433796229725) -->
<skip />
- <!-- no translation found for biometric_dangling_notification_action_not_now (8095249216864443491) -->
+ <!-- no translation found for fingerprint_dangling_notification_msg_2 (7578829498452127613) -->
<skip />
+ <string name="fingerprint_dangling_notification_msg_all_deleted_1" msgid="2927018569542316055">"<xliff:g id="FINGERPRINT">%s</xliff:g> no funcionava correctament i s\'ha suprimit. Torna a configurar-la per desbloquejar el telèfon amb l\'empremta digital."</string>
+ <string name="fingerprint_dangling_notification_msg_all_deleted_2" msgid="6897989352716156176">"<xliff:g id="FINGERPRINT_0">%1$s</xliff:g> i <xliff:g id="FINGERPRINT_1">%2$s</xliff:g> no funcionaven correctament i s\'han suprimit. Torna a configurar-les per desbloquejar el telèfon amb l\'empremta digital."</string>
+ <string name="face_dangling_notification_title" msgid="947852541060975473">"Torna a configurar Desbloqueig facial"</string>
+ <string name="face_dangling_notification_msg" msgid="8806849376915541655">"El teu model facial no funcionava correctament i s\'ha suprimit. Torna a configurar-lo per desbloquejar el telèfon amb la cara."</string>
+ <string name="biometric_dangling_notification_action_set_up" msgid="8246885009807817961">"Configura"</string>
+ <string name="biometric_dangling_notification_action_not_now" msgid="8095249216864443491">"Ara no"</string>
</resources>
diff --git a/core/res/res/values-cs/strings.xml b/core/res/res/values-cs/strings.xml
index 5615f79d1013..ec7bb29a2ebe 100644
--- a/core/res/res/values-cs/strings.xml
+++ b/core/res/res/values-cs/strings.xml
@@ -285,6 +285,8 @@
<string name="global_action_voice_assist" msgid="6655788068555086695">"Hlas. asistence"</string>
<string name="global_action_lockdown" msgid="2475471405907902963">"Zamknout"</string>
<string name="status_bar_notification_info_overflow" msgid="3330152558746563475">"999+"</string>
+ <!-- no translation found for notification_compact_heads_up_reply (2425293958371284340) -->
+ <skip />
<string name="notification_hidden_text" msgid="2835519769868187223">"Nové oznámení"</string>
<string name="notification_channel_physical_keyboard" msgid="5417306456125988096">"Fyzická klávesnice"</string>
<string name="notification_channel_security" msgid="8516754650348238057">"Zabezpečení"</string>
@@ -2415,22 +2417,15 @@
<string name="satellite_notification_open_message" msgid="4149234979688273729">"Otevřít Zprávy"</string>
<string name="satellite_notification_how_it_works" msgid="3132069321977520519">"Jak to funguje"</string>
<string name="unarchival_session_app_label" msgid="6811856981546348205">"Čeká na vyřízení…"</string>
- <!-- no translation found for fingerprint_dangling_notification_title (7362075195588639989) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_1 (6261149111900787302) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_2 (7688302770424064884) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_1 (2927018569542316055) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_2 (6897989352716156176) -->
- <skip />
- <!-- no translation found for face_dangling_notification_title (947852541060975473) -->
- <skip />
- <!-- no translation found for face_dangling_notification_msg (8806849376915541655) -->
- <skip />
- <!-- no translation found for biometric_dangling_notification_action_set_up (8246885009807817961) -->
+ <string name="fingerprint_dangling_notification_title" msgid="7362075195588639989">"Opětovné nastavení odemknutí otiskem prstu"</string>
+ <!-- no translation found for fingerprint_dangling_notification_msg_1 (8517140433796229725) -->
<skip />
- <!-- no translation found for biometric_dangling_notification_action_not_now (8095249216864443491) -->
+ <!-- no translation found for fingerprint_dangling_notification_msg_2 (7578829498452127613) -->
<skip />
+ <string name="fingerprint_dangling_notification_msg_all_deleted_1" msgid="2927018569542316055">"<xliff:g id="FINGERPRINT">%s</xliff:g> nefungoval správně a byl vymazán. Pokud chcete telefon odemykat otiskem prstu, nastavte jej znovu."</string>
+ <string name="fingerprint_dangling_notification_msg_all_deleted_2" msgid="6897989352716156176">"<xliff:g id="FINGERPRINT_0">%1$s</xliff:g> a <xliff:g id="FINGERPRINT_1">%2$s</xliff:g> nefungovaly správně a byly vymazány. Pokud chcete telefon odemykat otiskem prstu, nastavte je znovu."</string>
+ <string name="face_dangling_notification_title" msgid="947852541060975473">"Nastavte odemknutí obličejem znovu"</string>
+ <string name="face_dangling_notification_msg" msgid="8806849376915541655">"Váš model obličeje nefungoval správně a byl vymazán. Pokud chcete telefon odemykat obličejem, nastavte jej znovu."</string>
+ <string name="biometric_dangling_notification_action_set_up" msgid="8246885009807817961">"Nastavit"</string>
+ <string name="biometric_dangling_notification_action_not_now" msgid="8095249216864443491">"Teď ne"</string>
</resources>
diff --git a/core/res/res/values-da/strings.xml b/core/res/res/values-da/strings.xml
index fd04e42c8e1f..ef4126283fa9 100644
--- a/core/res/res/values-da/strings.xml
+++ b/core/res/res/values-da/strings.xml
@@ -283,6 +283,8 @@
<string name="global_action_voice_assist" msgid="6655788068555086695">"Taleassistent"</string>
<string name="global_action_lockdown" msgid="2475471405907902963">"Låsning"</string>
<string name="status_bar_notification_info_overflow" msgid="3330152558746563475">"999+"</string>
+ <!-- no translation found for notification_compact_heads_up_reply (2425293958371284340) -->
+ <skip />
<string name="notification_hidden_text" msgid="2835519769868187223">"Ny notifikation"</string>
<string name="notification_channel_physical_keyboard" msgid="5417306456125988096">"Fysisk tastatur"</string>
<string name="notification_channel_security" msgid="8516754650348238057">"Sikkerhed"</string>
@@ -2413,22 +2415,15 @@
<string name="satellite_notification_open_message" msgid="4149234979688273729">"Åbn Beskeder"</string>
<string name="satellite_notification_how_it_works" msgid="3132069321977520519">"Sådan fungerer det"</string>
<string name="unarchival_session_app_label" msgid="6811856981546348205">"Afventer…"</string>
- <!-- no translation found for fingerprint_dangling_notification_title (7362075195588639989) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_1 (6261149111900787302) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_2 (7688302770424064884) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_1 (2927018569542316055) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_2 (6897989352716156176) -->
- <skip />
- <!-- no translation found for face_dangling_notification_title (947852541060975473) -->
- <skip />
- <!-- no translation found for face_dangling_notification_msg (8806849376915541655) -->
- <skip />
- <!-- no translation found for biometric_dangling_notification_action_set_up (8246885009807817961) -->
+ <string name="fingerprint_dangling_notification_title" msgid="7362075195588639989">"Konfigurer fingeroplåsning igen"</string>
+ <!-- no translation found for fingerprint_dangling_notification_msg_1 (8517140433796229725) -->
<skip />
- <!-- no translation found for biometric_dangling_notification_action_not_now (8095249216864443491) -->
+ <!-- no translation found for fingerprint_dangling_notification_msg_2 (7578829498452127613) -->
<skip />
+ <string name="fingerprint_dangling_notification_msg_all_deleted_1" msgid="2927018569542316055">"<xliff:g id="FINGERPRINT">%s</xliff:g> virkede ikke optimalt og er derfor slettet. Konfigurer den igen for at bruge fingeroplåsning på din telefon."</string>
+ <string name="fingerprint_dangling_notification_msg_all_deleted_2" msgid="6897989352716156176">"<xliff:g id="FINGERPRINT_0">%1$s</xliff:g> og <xliff:g id="FINGERPRINT_1">%2$s</xliff:g> virkede ikke optimalt og er derfor slettet. Konfigurer dem igen for at bruge dit fingeraftryk til at låse din telefon op."</string>
+ <string name="face_dangling_notification_title" msgid="947852541060975473">"Konfigurer ansigtsoplåsning igen"</string>
+ <string name="face_dangling_notification_msg" msgid="8806849376915541655">"Din ansigtsmodel virkede ikke optimalt og er derfor slettet. Konfigurer den igen for at bruge ansigtsoplåsning på din telefon."</string>
+ <string name="biometric_dangling_notification_action_set_up" msgid="8246885009807817961">"Konfigurer"</string>
+ <string name="biometric_dangling_notification_action_not_now" msgid="8095249216864443491">"Ikke nu"</string>
</resources>
diff --git a/core/res/res/values-de/strings.xml b/core/res/res/values-de/strings.xml
index 630ec7512784..1df8954ef78d 100644
--- a/core/res/res/values-de/strings.xml
+++ b/core/res/res/values-de/strings.xml
@@ -283,6 +283,8 @@
<string name="global_action_voice_assist" msgid="6655788068555086695">"Sprachassistent"</string>
<string name="global_action_lockdown" msgid="2475471405907902963">"Sperren"</string>
<string name="status_bar_notification_info_overflow" msgid="3330152558746563475">"999+"</string>
+ <!-- no translation found for notification_compact_heads_up_reply (2425293958371284340) -->
+ <skip />
<string name="notification_hidden_text" msgid="2835519769868187223">"Neue Benachrichtigung"</string>
<string name="notification_channel_physical_keyboard" msgid="5417306456125988096">"Physische Tastatur"</string>
<string name="notification_channel_security" msgid="8516754650348238057">"Sicherheit"</string>
@@ -1997,7 +1999,7 @@
<string name="work_mode_emergency_call_button" msgid="6818855962881612322">"Notruf"</string>
<string name="set_up_screen_lock_title" msgid="8346083801616474030">"Displaysperre einrichten"</string>
<string name="set_up_screen_lock_action_label" msgid="2687634803649209367">"Displaysperre einrichten"</string>
- <string name="private_space_set_up_screen_lock_message" msgid="1109956797005149814">"Richte zur Nutzung des privaten Bereichs auf dem Gerät die Displaysperre ein"</string>
+ <string name="private_space_set_up_screen_lock_message" msgid="1109956797005149814">"Richte zur Nutzung des vertraulichen Profils auf dem Gerät die Displaysperre ein"</string>
<string name="app_blocked_title" msgid="7353262160455028160">"App ist nicht verfügbar"</string>
<string name="app_blocked_message" msgid="542972921087873023">"<xliff:g id="APP_NAME">%1$s</xliff:g> ist derzeit nicht verfügbar."</string>
<string name="app_streaming_blocked_title" msgid="6090945835898766139">"<xliff:g id="ACTIVITY">%1$s</xliff:g> nicht verfügbar"</string>
@@ -2413,22 +2415,15 @@
<string name="satellite_notification_open_message" msgid="4149234979688273729">"Messages öffnen"</string>
<string name="satellite_notification_how_it_works" msgid="3132069321977520519">"So funktionierts"</string>
<string name="unarchival_session_app_label" msgid="6811856981546348205">"Ausstehend…"</string>
- <!-- no translation found for fingerprint_dangling_notification_title (7362075195588639989) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_1 (6261149111900787302) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_2 (7688302770424064884) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_1 (2927018569542316055) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_2 (6897989352716156176) -->
- <skip />
- <!-- no translation found for face_dangling_notification_title (947852541060975473) -->
- <skip />
- <!-- no translation found for face_dangling_notification_msg (8806849376915541655) -->
- <skip />
- <!-- no translation found for biometric_dangling_notification_action_set_up (8246885009807817961) -->
+ <string name="fingerprint_dangling_notification_title" msgid="7362075195588639989">"Entsperrung per Fingerabdruck neu einrichten"</string>
+ <!-- no translation found for fingerprint_dangling_notification_msg_1 (8517140433796229725) -->
<skip />
- <!-- no translation found for biometric_dangling_notification_action_not_now (8095249216864443491) -->
+ <!-- no translation found for fingerprint_dangling_notification_msg_2 (7578829498452127613) -->
<skip />
+ <string name="fingerprint_dangling_notification_msg_all_deleted_1" msgid="2927018569542316055">"<xliff:g id="FINGERPRINT">%s</xliff:g> hat nicht einwandfrei funktioniert und wurde gelöscht. Richte ihn noch einmal ein, um dein Smartphone per Fingerabdruck zu entsperren."</string>
+ <string name="fingerprint_dangling_notification_msg_all_deleted_2" msgid="6897989352716156176">"<xliff:g id="FINGERPRINT_0">%1$s</xliff:g> und <xliff:g id="FINGERPRINT_1">%2$s</xliff:g> haben nicht einwandfrei funktioniert und wurden gelöscht. Richte sie noch einmal ein, um dein Smartphone per Fingerabdruck zu entsperren."</string>
+ <string name="face_dangling_notification_title" msgid="947852541060975473">"Entsperrung per Gesichtserkennung neu einrichten"</string>
+ <string name="face_dangling_notification_msg" msgid="8806849376915541655">"Dein Gesichtsmodell hat nicht einwandfrei funktioniert und wurde gelöscht. Richte es noch einmal ein, um dein Smartphone per Gesichtserkennung zu entsperren."</string>
+ <string name="biometric_dangling_notification_action_set_up" msgid="8246885009807817961">"Einrichten"</string>
+ <string name="biometric_dangling_notification_action_not_now" msgid="8095249216864443491">"Nicht jetzt"</string>
</resources>
diff --git a/core/res/res/values-el/strings.xml b/core/res/res/values-el/strings.xml
index 54901313dad2..3c7d16714849 100644
--- a/core/res/res/values-el/strings.xml
+++ b/core/res/res/values-el/strings.xml
@@ -283,6 +283,8 @@
<string name="global_action_voice_assist" msgid="6655788068555086695">"Φων.υποβοηθ."</string>
<string name="global_action_lockdown" msgid="2475471405907902963">"Κλείδωμα"</string>
<string name="status_bar_notification_info_overflow" msgid="3330152558746563475">"999+"</string>
+ <!-- no translation found for notification_compact_heads_up_reply (2425293958371284340) -->
+ <skip />
<string name="notification_hidden_text" msgid="2835519769868187223">"Νέα ειδοποίηση"</string>
<string name="notification_channel_physical_keyboard" msgid="5417306456125988096">"Κανονικό πληκτρολόγιο"</string>
<string name="notification_channel_security" msgid="8516754650348238057">"Ασφάλεια"</string>
@@ -2402,7 +2404,7 @@
<string name="profile_label_test" msgid="9168641926186071947">"Δοκιμή"</string>
<string name="profile_label_communal" msgid="8743921499944800427">"Κοινόχρηστο"</string>
<string name="accessibility_label_managed_profile" msgid="3366526886209832641">"Προφίλ εργασίας"</string>
- <string name="accessibility_label_private_profile" msgid="1436459319135548969">"Απόρρητος χώρος"</string>
+ <string name="accessibility_label_private_profile" msgid="1436459319135548969">"Ιδιωτικός χώρος"</string>
<string name="accessibility_label_clone_profile" msgid="7579118375042398784">"Κλώνος"</string>
<string name="accessibility_label_communal_profile" msgid="1437173163111334791">"Κοινόχρηστο"</string>
<string name="redacted_notification_message" msgid="1520587845842228816">"Έγινε απόκρυψη της ειδοποίησης ευαίσθητου περιεχομένου"</string>
@@ -2413,22 +2415,15 @@
<string name="satellite_notification_open_message" msgid="4149234979688273729">"Άνοιγμα Messages"</string>
<string name="satellite_notification_how_it_works" msgid="3132069321977520519">"Πώς λειτουργεί"</string>
<string name="unarchival_session_app_label" msgid="6811856981546348205">"Σε εκκρεμότητα…"</string>
- <!-- no translation found for fingerprint_dangling_notification_title (7362075195588639989) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_1 (6261149111900787302) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_2 (7688302770424064884) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_1 (2927018569542316055) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_2 (6897989352716156176) -->
- <skip />
- <!-- no translation found for face_dangling_notification_title (947852541060975473) -->
- <skip />
- <!-- no translation found for face_dangling_notification_msg (8806849376915541655) -->
- <skip />
- <!-- no translation found for biometric_dangling_notification_action_set_up (8246885009807817961) -->
+ <string name="fingerprint_dangling_notification_title" msgid="7362075195588639989">"Επαναρρύθμιση λειτουργίας Ξεκλείδωμα με δακτυλικό αποτύπωμα"</string>
+ <!-- no translation found for fingerprint_dangling_notification_msg_1 (8517140433796229725) -->
<skip />
- <!-- no translation found for biometric_dangling_notification_action_not_now (8095249216864443491) -->
+ <!-- no translation found for fingerprint_dangling_notification_msg_2 (7578829498452127613) -->
<skip />
+ <string name="fingerprint_dangling_notification_msg_all_deleted_1" msgid="2927018569542316055">"Το δακτυλικό αποτύπωμα <xliff:g id="FINGERPRINT">%s</xliff:g> δεν λειτουργούσε καλά και διαγράφηκε. Ρυθμίστε το ξανά για να ξεκλειδώνετε το τηλέφωνο με το δακτυλικό αποτύπωμά σας."</string>
+ <string name="fingerprint_dangling_notification_msg_all_deleted_2" msgid="6897989352716156176">"Τα δακτυλικά αποτυπώματα <xliff:g id="FINGERPRINT_0">%1$s</xliff:g> και <xliff:g id="FINGERPRINT_1">%2$s</xliff:g> δεν λειτουργούσαν καλά και διαγράφηκαν. Ρυθμίστε τα ξανά για να ξεκλειδώνετε το τηλέφωνο με το δακτυλικό αποτύπωμά σας."</string>
+ <string name="face_dangling_notification_title" msgid="947852541060975473">"Επαναρρύθμιση λειτουργίας Ξεκλείδωμα με το πρόσωπο"</string>
+ <string name="face_dangling_notification_msg" msgid="8806849376915541655">"Το μοντέλο προσώπου δεν λειτουργούσε καλά και διαγράφηκε. Ρυθμίστε το ξανά για να ξεκλειδώνετε το τηλέφωνο με το πρόσωπό σας."</string>
+ <string name="biometric_dangling_notification_action_set_up" msgid="8246885009807817961">"Ρύθμιση"</string>
+ <string name="biometric_dangling_notification_action_not_now" msgid="8095249216864443491">"Όχι τώρα"</string>
</resources>
diff --git a/core/res/res/values-en-rAU/strings.xml b/core/res/res/values-en-rAU/strings.xml
index a32fcca8fc1f..5f7dd656d0ca 100644
--- a/core/res/res/values-en-rAU/strings.xml
+++ b/core/res/res/values-en-rAU/strings.xml
@@ -283,6 +283,8 @@
<string name="global_action_voice_assist" msgid="6655788068555086695">"Voice Assist"</string>
<string name="global_action_lockdown" msgid="2475471405907902963">"Lockdown"</string>
<string name="status_bar_notification_info_overflow" msgid="3330152558746563475">"999+"</string>
+ <!-- no translation found for notification_compact_heads_up_reply (2425293958371284340) -->
+ <skip />
<string name="notification_hidden_text" msgid="2835519769868187223">"New notification"</string>
<string name="notification_channel_physical_keyboard" msgid="5417306456125988096">"Physical keyboard"</string>
<string name="notification_channel_security" msgid="8516754650348238057">"Security"</string>
@@ -2413,22 +2415,15 @@
<string name="satellite_notification_open_message" msgid="4149234979688273729">"Open Messages"</string>
<string name="satellite_notification_how_it_works" msgid="3132069321977520519">"How it works"</string>
<string name="unarchival_session_app_label" msgid="6811856981546348205">"Pending…"</string>
- <!-- no translation found for fingerprint_dangling_notification_title (7362075195588639989) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_1 (6261149111900787302) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_2 (7688302770424064884) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_1 (2927018569542316055) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_2 (6897989352716156176) -->
- <skip />
- <!-- no translation found for face_dangling_notification_title (947852541060975473) -->
- <skip />
- <!-- no translation found for face_dangling_notification_msg (8806849376915541655) -->
- <skip />
- <!-- no translation found for biometric_dangling_notification_action_set_up (8246885009807817961) -->
+ <string name="fingerprint_dangling_notification_title" msgid="7362075195588639989">"Set up Fingerprint Unlock again"</string>
+ <!-- no translation found for fingerprint_dangling_notification_msg_1 (8517140433796229725) -->
<skip />
- <!-- no translation found for biometric_dangling_notification_action_not_now (8095249216864443491) -->
+ <!-- no translation found for fingerprint_dangling_notification_msg_2 (7578829498452127613) -->
<skip />
+ <string name="fingerprint_dangling_notification_msg_all_deleted_1" msgid="2927018569542316055">"<xliff:g id="FINGERPRINT">%s</xliff:g> wasn\'t working well and was deleted. Set it up again to unlock your phone with your fingerprint."</string>
+ <string name="fingerprint_dangling_notification_msg_all_deleted_2" msgid="6897989352716156176">"<xliff:g id="FINGERPRINT_0">%1$s</xliff:g> and <xliff:g id="FINGERPRINT_1">%2$s</xliff:g> weren\'t working well and were deleted. Set them up again to unlock your phone with your fingerprint."</string>
+ <string name="face_dangling_notification_title" msgid="947852541060975473">"Set up Face Unlock again"</string>
+ <string name="face_dangling_notification_msg" msgid="8806849376915541655">"Your face model wasn\'t working well and was deleted. Set it up again to unlock your phone with your face."</string>
+ <string name="biometric_dangling_notification_action_set_up" msgid="8246885009807817961">"Set up"</string>
+ <string name="biometric_dangling_notification_action_not_now" msgid="8095249216864443491">"Not now"</string>
</resources>
diff --git a/core/res/res/values-en-rCA/strings.xml b/core/res/res/values-en-rCA/strings.xml
index 9f06f71c147f..d1894b5e7106 100644
--- a/core/res/res/values-en-rCA/strings.xml
+++ b/core/res/res/values-en-rCA/strings.xml
@@ -283,6 +283,7 @@
<string name="global_action_voice_assist" msgid="6655788068555086695">"Voice Assist"</string>
<string name="global_action_lockdown" msgid="2475471405907902963">"Lockdown"</string>
<string name="status_bar_notification_info_overflow" msgid="3330152558746563475">"999+"</string>
+ <string name="notification_compact_heads_up_reply" msgid="2425293958371284340">"Reply"</string>
<string name="notification_hidden_text" msgid="2835519769868187223">"New notification"</string>
<string name="notification_channel_physical_keyboard" msgid="5417306456125988096">"Physical keyboard"</string>
<string name="notification_channel_security" msgid="8516754650348238057">"Security"</string>
@@ -2414,8 +2415,10 @@
<string name="satellite_notification_how_it_works" msgid="3132069321977520519">"How it works"</string>
<string name="unarchival_session_app_label" msgid="6811856981546348205">"Pending..."</string>
<string name="fingerprint_dangling_notification_title" msgid="7362075195588639989">"Set up Fingerprint Unlock again"</string>
- <string name="fingerprint_dangling_notification_msg_1" msgid="6261149111900787302">"<xliff:g id="FINGERPRINT">%s</xliff:g> wasn\'t working well and was deleted to improve performance"</string>
- <string name="fingerprint_dangling_notification_msg_2" msgid="7688302770424064884">"<xliff:g id="FINGERPRINT_0">%1$s</xliff:g> and <xliff:g id="FINGERPRINT_1">%2$s</xliff:g> weren\'t working well and were deleted to improve performance"</string>
+ <!-- no translation found for fingerprint_dangling_notification_msg_1 (8517140433796229725) -->
+ <skip />
+ <!-- no translation found for fingerprint_dangling_notification_msg_2 (7578829498452127613) -->
+ <skip />
<string name="fingerprint_dangling_notification_msg_all_deleted_1" msgid="2927018569542316055">"<xliff:g id="FINGERPRINT">%s</xliff:g> wasn\'t working well and was deleted. Set it up again to unlock your phone with fingerprint."</string>
<string name="fingerprint_dangling_notification_msg_all_deleted_2" msgid="6897989352716156176">"<xliff:g id="FINGERPRINT_0">%1$s</xliff:g> and <xliff:g id="FINGERPRINT_1">%2$s</xliff:g> weren\'t working well and were deleted. Set them up again to unlock your phone with your fingerprint."</string>
<string name="face_dangling_notification_title" msgid="947852541060975473">"Set up Face Unlock again"</string>
diff --git a/core/res/res/values-en-rGB/strings.xml b/core/res/res/values-en-rGB/strings.xml
index bfcc4be89814..12fd027cdf2d 100644
--- a/core/res/res/values-en-rGB/strings.xml
+++ b/core/res/res/values-en-rGB/strings.xml
@@ -283,6 +283,8 @@
<string name="global_action_voice_assist" msgid="6655788068555086695">"Voice Assist"</string>
<string name="global_action_lockdown" msgid="2475471405907902963">"Lockdown"</string>
<string name="status_bar_notification_info_overflow" msgid="3330152558746563475">"999+"</string>
+ <!-- no translation found for notification_compact_heads_up_reply (2425293958371284340) -->
+ <skip />
<string name="notification_hidden_text" msgid="2835519769868187223">"New notification"</string>
<string name="notification_channel_physical_keyboard" msgid="5417306456125988096">"Physical keyboard"</string>
<string name="notification_channel_security" msgid="8516754650348238057">"Security"</string>
@@ -2413,22 +2415,15 @@
<string name="satellite_notification_open_message" msgid="4149234979688273729">"Open Messages"</string>
<string name="satellite_notification_how_it_works" msgid="3132069321977520519">"How it works"</string>
<string name="unarchival_session_app_label" msgid="6811856981546348205">"Pending…"</string>
- <!-- no translation found for fingerprint_dangling_notification_title (7362075195588639989) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_1 (6261149111900787302) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_2 (7688302770424064884) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_1 (2927018569542316055) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_2 (6897989352716156176) -->
- <skip />
- <!-- no translation found for face_dangling_notification_title (947852541060975473) -->
- <skip />
- <!-- no translation found for face_dangling_notification_msg (8806849376915541655) -->
- <skip />
- <!-- no translation found for biometric_dangling_notification_action_set_up (8246885009807817961) -->
+ <string name="fingerprint_dangling_notification_title" msgid="7362075195588639989">"Set up Fingerprint Unlock again"</string>
+ <!-- no translation found for fingerprint_dangling_notification_msg_1 (8517140433796229725) -->
<skip />
- <!-- no translation found for biometric_dangling_notification_action_not_now (8095249216864443491) -->
+ <!-- no translation found for fingerprint_dangling_notification_msg_2 (7578829498452127613) -->
<skip />
+ <string name="fingerprint_dangling_notification_msg_all_deleted_1" msgid="2927018569542316055">"<xliff:g id="FINGERPRINT">%s</xliff:g> wasn\'t working well and was deleted. Set it up again to unlock your phone with your fingerprint."</string>
+ <string name="fingerprint_dangling_notification_msg_all_deleted_2" msgid="6897989352716156176">"<xliff:g id="FINGERPRINT_0">%1$s</xliff:g> and <xliff:g id="FINGERPRINT_1">%2$s</xliff:g> weren\'t working well and were deleted. Set them up again to unlock your phone with your fingerprint."</string>
+ <string name="face_dangling_notification_title" msgid="947852541060975473">"Set up Face Unlock again"</string>
+ <string name="face_dangling_notification_msg" msgid="8806849376915541655">"Your face model wasn\'t working well and was deleted. Set it up again to unlock your phone with your face."</string>
+ <string name="biometric_dangling_notification_action_set_up" msgid="8246885009807817961">"Set up"</string>
+ <string name="biometric_dangling_notification_action_not_now" msgid="8095249216864443491">"Not now"</string>
</resources>
diff --git a/core/res/res/values-en-rIN/strings.xml b/core/res/res/values-en-rIN/strings.xml
index 80007323188c..129310eec160 100644
--- a/core/res/res/values-en-rIN/strings.xml
+++ b/core/res/res/values-en-rIN/strings.xml
@@ -283,6 +283,8 @@
<string name="global_action_voice_assist" msgid="6655788068555086695">"Voice Assist"</string>
<string name="global_action_lockdown" msgid="2475471405907902963">"Lockdown"</string>
<string name="status_bar_notification_info_overflow" msgid="3330152558746563475">"999+"</string>
+ <!-- no translation found for notification_compact_heads_up_reply (2425293958371284340) -->
+ <skip />
<string name="notification_hidden_text" msgid="2835519769868187223">"New notification"</string>
<string name="notification_channel_physical_keyboard" msgid="5417306456125988096">"Physical keyboard"</string>
<string name="notification_channel_security" msgid="8516754650348238057">"Security"</string>
@@ -2413,22 +2415,15 @@
<string name="satellite_notification_open_message" msgid="4149234979688273729">"Open Messages"</string>
<string name="satellite_notification_how_it_works" msgid="3132069321977520519">"How it works"</string>
<string name="unarchival_session_app_label" msgid="6811856981546348205">"Pending…"</string>
- <!-- no translation found for fingerprint_dangling_notification_title (7362075195588639989) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_1 (6261149111900787302) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_2 (7688302770424064884) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_1 (2927018569542316055) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_2 (6897989352716156176) -->
- <skip />
- <!-- no translation found for face_dangling_notification_title (947852541060975473) -->
- <skip />
- <!-- no translation found for face_dangling_notification_msg (8806849376915541655) -->
- <skip />
- <!-- no translation found for biometric_dangling_notification_action_set_up (8246885009807817961) -->
+ <string name="fingerprint_dangling_notification_title" msgid="7362075195588639989">"Set up Fingerprint Unlock again"</string>
+ <!-- no translation found for fingerprint_dangling_notification_msg_1 (8517140433796229725) -->
<skip />
- <!-- no translation found for biometric_dangling_notification_action_not_now (8095249216864443491) -->
+ <!-- no translation found for fingerprint_dangling_notification_msg_2 (7578829498452127613) -->
<skip />
+ <string name="fingerprint_dangling_notification_msg_all_deleted_1" msgid="2927018569542316055">"<xliff:g id="FINGERPRINT">%s</xliff:g> wasn\'t working well and was deleted. Set it up again to unlock your phone with your fingerprint."</string>
+ <string name="fingerprint_dangling_notification_msg_all_deleted_2" msgid="6897989352716156176">"<xliff:g id="FINGERPRINT_0">%1$s</xliff:g> and <xliff:g id="FINGERPRINT_1">%2$s</xliff:g> weren\'t working well and were deleted. Set them up again to unlock your phone with your fingerprint."</string>
+ <string name="face_dangling_notification_title" msgid="947852541060975473">"Set up Face Unlock again"</string>
+ <string name="face_dangling_notification_msg" msgid="8806849376915541655">"Your face model wasn\'t working well and was deleted. Set it up again to unlock your phone with your face."</string>
+ <string name="biometric_dangling_notification_action_set_up" msgid="8246885009807817961">"Set up"</string>
+ <string name="biometric_dangling_notification_action_not_now" msgid="8095249216864443491">"Not now"</string>
</resources>
diff --git a/core/res/res/values-en-rXC/strings.xml b/core/res/res/values-en-rXC/strings.xml
index 0fe2cccd8d58..e08f93466a0e 100644
--- a/core/res/res/values-en-rXC/strings.xml
+++ b/core/res/res/values-en-rXC/strings.xml
@@ -283,6 +283,7 @@
<string name="global_action_voice_assist" msgid="6655788068555086695">"‎‏‎‎‎‎‎‏‎‏‏‏‎‎‎‎‎‎‏‎‎‏‎‎‎‎‏‏‏‏‏‏‏‏‎‏‏‏‎‎‎‏‎‏‏‏‏‎‎‎‎‏‏‎‏‏‏‏‏‏‏‏‎‎‎‎‎‎‎‏‏‎‏‎‎‎‎‎‏‎‎‏‎‏‏‎‏‏‎‏‏‎‎‏‏‏‎Voice Assist‎‏‎‎‏‎"</string>
<string name="global_action_lockdown" msgid="2475471405907902963">"‎‏‎‎‎‎‎‏‎‏‏‏‎‎‎‎‎‎‏‎‎‏‎‎‎‎‏‏‏‏‏‏‎‏‎‎‎‏‎‎‏‎‏‏‎‏‎‏‎‏‎‎‏‎‎‎‎‏‎‎‎‎‎‏‏‎‎‏‎‎‎‏‏‎‎‎‏‏‏‎‎‎‎‎‎‎‏‏‏‏‏‎‎‏‏‎Lockdown‎‏‎‎‏‎"</string>
<string name="status_bar_notification_info_overflow" msgid="3330152558746563475">"‎‏‎‎‎‎‎‏‎‏‏‏‎‎‎‎‎‎‏‎‎‏‎‎‎‎‏‏‏‏‏‏‎‏‎‏‏‏‎‎‎‏‏‎‏‏‏‎‎‎‏‎‏‎‎‎‎‎‏‏‎‏‏‏‎‏‏‎‏‏‏‏‏‏‏‎‎‏‎‎‏‏‏‎‎‏‏‏‎‎‏‎‎‏‏‎999+‎‏‎‎‏‎"</string>
+ <string name="notification_compact_heads_up_reply" msgid="2425293958371284340">"‎‏‎‎‎‎‎‏‎‏‏‏‎‎‎‎‎‎‏‎‎‏‎‎‎‎‏‏‏‏‏‏‎‏‎‎‎‎‏‏‎‏‎‏‎‎‎‎‏‏‎‎‎‎‎‎‎‎‎‎‎‎‏‎‏‏‎‎‎‎‎‏‎‎‏‏‏‏‏‎‎‎‏‎‏‎‏‎‏‏‏‎‏‎‎‎Reply‎‏‎‎‏‎"</string>
<string name="notification_hidden_text" msgid="2835519769868187223">"‎‏‎‎‎‎‎‏‎‏‏‏‎‎‎‎‎‎‏‎‎‏‎‎‎‎‏‏‏‏‏‏‎‏‎‎‏‏‏‎‏‎‏‏‎‎‏‏‏‎‎‏‎‏‎‎‎‏‏‎‏‎‏‎‎‎‏‏‏‎‎‏‎‎‏‎‏‏‏‎‎‏‏‎‏‏‎‎‏‎‏‎‏‏‏‎New notification‎‏‎‎‏‎"</string>
<string name="notification_channel_physical_keyboard" msgid="5417306456125988096">"‎‏‎‎‎‎‎‏‎‏‏‏‎‎‎‎‎‎‏‎‎‏‎‎‎‎‏‏‏‏‏‏‏‏‎‎‏‎‏‏‎‎‏‎‏‏‏‎‎‎‏‎‎‎‏‏‏‎‎‎‎‏‎‏‎‎‎‎‏‏‎‎‏‏‎‏‎‎‎‏‏‏‎‏‏‏‎‏‎‎‎‎‎‎‎‎‎Physical keyboard‎‏‎‎‏‎"</string>
<string name="notification_channel_security" msgid="8516754650348238057">"‎‏‎‎‎‎‎‏‎‏‏‏‎‎‎‎‎‎‏‎‎‏‎‎‎‎‏‏‏‏‏‏‏‏‏‏‎‏‏‎‎‎‏‏‎‎‎‏‏‎‎‏‎‏‏‏‎‎‏‏‏‎‏‏‎‎‎‏‎‏‎‏‎‎‏‎‏‎‎‏‏‎‏‏‎‏‎‎‏‏‏‎‏‎‎‏‎Security‎‏‎‎‏‎"</string>
@@ -2414,8 +2415,10 @@
<string name="satellite_notification_how_it_works" msgid="3132069321977520519">"‎‏‎‎‎‎‎‏‎‏‏‏‎‎‎‎‎‎‏‎‎‏‎‎‎‎‏‏‏‏‏‏‎‏‎‏‎‏‏‎‏‏‏‎‏‏‏‎‏‎‏‏‎‎‎‎‏‏‏‎‏‎‎‎‎‏‏‎‏‎‎‎‏‎‏‏‏‏‎‎‏‏‎‎‎‎‏‏‎‎‎‎‏‏‏‎How it works‎‏‎‎‏‎"</string>
<string name="unarchival_session_app_label" msgid="6811856981546348205">"‎‏‎‎‎‎‎‏‎‏‏‏‎‎‎‎‎‎‏‎‎‏‎‎‎‎‏‏‏‏‏‏‏‏‎‏‏‏‏‎‏‎‎‎‏‎‎‎‏‎‎‏‎‎‏‏‏‏‎‏‎‏‎‏‎‏‏‏‏‏‎‏‏‏‎‏‎‏‎‏‏‎‏‎‏‏‏‎‏‎‏‎‏‏‎‏‎Pending...‎‏‎‎‏‎"</string>
<string name="fingerprint_dangling_notification_title" msgid="7362075195588639989">"‎‏‎‎‎‎‎‏‎‏‏‏‎‎‎‎‎‎‏‎‎‏‎‎‎‎‏‏‏‏‏‏‏‏‏‎‎‏‏‎‎‎‏‎‏‎‏‏‎‏‎‏‏‎‎‎‎‏‏‎‎‎‏‎‎‏‏‎‏‎‏‎‏‏‎‎‎‏‏‎‎‏‏‏‏‏‎‎‏‏‏‏‎‏‎‏‎Set up Fingerprint Unlock again‎‏‎‎‏‎"</string>
- <string name="fingerprint_dangling_notification_msg_1" msgid="6261149111900787302">"‎‏‎‎‎‎‎‏‎‏‏‏‎‎‎‎‎‎‏‎‎‏‎‎‎‎‏‏‏‏‏‏‏‏‎‏‎‏‏‎‏‏‏‎‎‏‎‎‎‎‎‏‎‎‎‏‏‏‏‏‎‎‎‏‏‎‏‏‏‏‎‎‏‎‎‏‏‎‎‏‎‏‎‏‎‎‏‎‎‏‏‎‎‏‏‎‎‎‏‎‎‏‏‎<xliff:g id="FINGERPRINT">%s</xliff:g>‎‏‎‎‏‏‏‎ wasn\'t working well and was deleted to improve performance‎‏‎‎‏‎"</string>
- <string name="fingerprint_dangling_notification_msg_2" msgid="7688302770424064884">"‎‏‎‎‎‎‎‏‎‏‏‏‎‎‎‎‎‎‏‎‎‏‎‎‎‎‏‏‏‏‏‏‏‏‏‎‏‎‏‎‏‎‏‏‎‎‏‎‎‏‎‏‎‏‏‎‏‎‏‎‎‎‏‎‏‎‏‎‎‏‎‎‏‏‎‎‎‏‏‏‎‎‏‎‏‎‏‏‎‏‏‏‎‏‎‎‎‎‏‎‎‏‏‎<xliff:g id="FINGERPRINT_0">%1$s</xliff:g>‎‏‎‎‏‏‏‎ and ‎‏‎‎‏‏‎<xliff:g id="FINGERPRINT_1">%2$s</xliff:g>‎‏‎‎‏‏‏‎ weren\'t working well and were deleted to improve performance‎‏‎‎‏‎"</string>
+ <!-- no translation found for fingerprint_dangling_notification_msg_1 (8517140433796229725) -->
+ <skip />
+ <!-- no translation found for fingerprint_dangling_notification_msg_2 (7578829498452127613) -->
+ <skip />
<string name="fingerprint_dangling_notification_msg_all_deleted_1" msgid="2927018569542316055">"‎‏‎‎‎‎‎‏‎‏‏‏‎‎‎‎‎‎‏‎‎‏‎‎‎‎‏‏‏‏‏‏‎‏‎‏‎‎‎‏‎‎‏‏‏‏‎‏‏‎‏‏‎‏‏‏‏‏‎‎‎‎‏‏‎‎‎‏‎‎‎‏‎‎‎‏‎‏‎‏‎‏‏‎‎‎‎‎‎‎‏‎‏‏‏‎‎‏‎‎‏‏‎<xliff:g id="FINGERPRINT">%s</xliff:g>‎‏‎‎‏‏‏‎ wasn\'t working well and was deleted. Set it up again to unlock your phone with fingerprint.‎‏‎‎‏‎"</string>
<string name="fingerprint_dangling_notification_msg_all_deleted_2" msgid="6897989352716156176">"‎‏‎‎‎‎‎‏‎‏‏‏‎‎‎‎‎‎‏‎‎‏‎‎‎‎‏‏‏‏‏‏‏‏‎‏‏‏‏‏‏‎‏‏‏‎‏‎‏‎‎‏‎‏‎‎‏‏‎‎‎‏‎‎‏‏‏‎‏‎‎‏‎‎‎‏‎‎‏‎‏‎‏‏‏‏‎‏‎‎‎‏‎‎‎‎‎‎‏‎‎‏‏‎<xliff:g id="FINGERPRINT_0">%1$s</xliff:g>‎‏‎‎‏‏‏‎ and ‎‏‎‎‏‏‎<xliff:g id="FINGERPRINT_1">%2$s</xliff:g>‎‏‎‎‏‏‏‎ weren\'t working well and were deleted. Set them up again to unlock your phone with your fingerprint.‎‏‎‎‏‎"</string>
<string name="face_dangling_notification_title" msgid="947852541060975473">"‎‏‎‎‎‎‎‏‎‏‏‏‎‎‎‎‎‎‏‎‎‏‎‎‎‎‏‏‏‏‏‎‎‏‏‎‏‎‎‏‎‎‏‏‏‎‏‏‏‎‎‏‎‏‏‎‏‏‏‎‏‎‎‏‏‏‎‎‏‎‏‏‎‎‏‎‎‎‎‎‎‏‎‏‏‎‏‏‏‎‎‎‏‎Set up Face Unlock again‎‏‎‎‏‎"</string>
diff --git a/core/res/res/values-es-rUS/strings.xml b/core/res/res/values-es-rUS/strings.xml
index 8717640a6910..30a0457201b4 100644
--- a/core/res/res/values-es-rUS/strings.xml
+++ b/core/res/res/values-es-rUS/strings.xml
@@ -284,6 +284,8 @@
<string name="global_action_voice_assist" msgid="6655788068555086695">"Asistente voz"</string>
<string name="global_action_lockdown" msgid="2475471405907902963">"Bloqueo"</string>
<string name="status_bar_notification_info_overflow" msgid="3330152558746563475">"999+"</string>
+ <!-- no translation found for notification_compact_heads_up_reply (2425293958371284340) -->
+ <skip />
<string name="notification_hidden_text" msgid="2835519769868187223">"Notificación nueva"</string>
<string name="notification_channel_physical_keyboard" msgid="5417306456125988096">"Teclado físico"</string>
<string name="notification_channel_security" msgid="8516754650348238057">"Seguridad"</string>
@@ -2414,22 +2416,15 @@
<string name="satellite_notification_open_message" msgid="4149234979688273729">"Abrir Mensajes"</string>
<string name="satellite_notification_how_it_works" msgid="3132069321977520519">"Cómo funciona"</string>
<string name="unarchival_session_app_label" msgid="6811856981546348205">"Pendiente…"</string>
- <!-- no translation found for fingerprint_dangling_notification_title (7362075195588639989) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_1 (6261149111900787302) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_2 (7688302770424064884) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_1 (2927018569542316055) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_2 (6897989352716156176) -->
- <skip />
- <!-- no translation found for face_dangling_notification_title (947852541060975473) -->
- <skip />
- <!-- no translation found for face_dangling_notification_msg (8806849376915541655) -->
- <skip />
- <!-- no translation found for biometric_dangling_notification_action_set_up (8246885009807817961) -->
+ <string name="fingerprint_dangling_notification_title" msgid="7362075195588639989">"Vuelve a configurar el Desbloqueo con huellas dactilares"</string>
+ <!-- no translation found for fingerprint_dangling_notification_msg_1 (8517140433796229725) -->
<skip />
- <!-- no translation found for biometric_dangling_notification_action_not_now (8095249216864443491) -->
+ <!-- no translation found for fingerprint_dangling_notification_msg_2 (7578829498452127613) -->
<skip />
+ <string name="fingerprint_dangling_notification_msg_all_deleted_1" msgid="2927018569542316055">"Se borró <xliff:g id="FINGERPRINT">%s</xliff:g> porque no funcionaba correctamente. Vuelve a configurarla para desbloquear el teléfono con la huella dactilar."</string>
+ <string name="fingerprint_dangling_notification_msg_all_deleted_2" msgid="6897989352716156176">"Se borraron <xliff:g id="FINGERPRINT_0">%1$s</xliff:g> y <xliff:g id="FINGERPRINT_1">%2$s</xliff:g> porque no funcionaban correctamente. Vuelve a configurarlas para desbloquear el teléfono con la huella dactilar."</string>
+ <string name="face_dangling_notification_title" msgid="947852541060975473">"Vuelve a configurar el Desbloqueo facial"</string>
+ <string name="face_dangling_notification_msg" msgid="8806849376915541655">"Se borró tu modelo de rostro porque no funcionaba correctamente. Vuelve a configurarlo para desbloquear el teléfono con el rostro."</string>
+ <string name="biometric_dangling_notification_action_set_up" msgid="8246885009807817961">"Configurar"</string>
+ <string name="biometric_dangling_notification_action_not_now" msgid="8095249216864443491">"Ahora no"</string>
</resources>
diff --git a/core/res/res/values-es/strings.xml b/core/res/res/values-es/strings.xml
index 6549da21376f..5079fdf415f9 100644
--- a/core/res/res/values-es/strings.xml
+++ b/core/res/res/values-es/strings.xml
@@ -284,6 +284,8 @@
<string name="global_action_voice_assist" msgid="6655788068555086695">"Asistente voz"</string>
<string name="global_action_lockdown" msgid="2475471405907902963">"Bloqueo de seguridad"</string>
<string name="status_bar_notification_info_overflow" msgid="3330152558746563475">"&gt; 999"</string>
+ <!-- no translation found for notification_compact_heads_up_reply (2425293958371284340) -->
+ <skip />
<string name="notification_hidden_text" msgid="2835519769868187223">"Notificación nueva"</string>
<string name="notification_channel_physical_keyboard" msgid="5417306456125988096">"Teclado físico"</string>
<string name="notification_channel_security" msgid="8516754650348238057">"Seguridad"</string>
@@ -1402,7 +1404,7 @@
<string name="usb_unsupported_audio_accessory_title" msgid="2335775548086533065">"Se ha detectado un accesorio de audio analógico"</string>
<string name="usb_unsupported_audio_accessory_message" msgid="1300168007129796621">"El dispositivo adjunto no es compatible con este teléfono. Toca para obtener más información."</string>
<string name="adb_active_notification_title" msgid="408390247354560331">"Depuración por USB activa"</string>
- <string name="adb_active_notification_message" msgid="5617264033476778211">"Toca para desactivar la depuración USB"</string>
+ <string name="adb_active_notification_message" msgid="5617264033476778211">"Toca para desactivar la depuración por USB"</string>
<string name="adb_active_notification_message" product="tv" msgid="6624498401272780855">"Seleccionar para inhabilitar la depuración por USB"</string>
<string name="adbwifi_active_notification_title" msgid="6147343659168302473">"Depuración inalámbrica conectada"</string>
<string name="adbwifi_active_notification_message" msgid="930987922852867972">"Toca para desactivar la depuración inalámbrica"</string>
@@ -2414,22 +2416,15 @@
<string name="satellite_notification_open_message" msgid="4149234979688273729">"Abre Mensajes"</string>
<string name="satellite_notification_how_it_works" msgid="3132069321977520519">"Cómo funciona"</string>
<string name="unarchival_session_app_label" msgid="6811856981546348205">"Pendiente..."</string>
- <!-- no translation found for fingerprint_dangling_notification_title (7362075195588639989) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_1 (6261149111900787302) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_2 (7688302770424064884) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_1 (2927018569542316055) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_2 (6897989352716156176) -->
- <skip />
- <!-- no translation found for face_dangling_notification_title (947852541060975473) -->
- <skip />
- <!-- no translation found for face_dangling_notification_msg (8806849376915541655) -->
- <skip />
- <!-- no translation found for biometric_dangling_notification_action_set_up (8246885009807817961) -->
+ <string name="fingerprint_dangling_notification_title" msgid="7362075195588639989">"Configura Desbloqueo con huella digital de nuevo"</string>
+ <!-- no translation found for fingerprint_dangling_notification_msg_1 (8517140433796229725) -->
<skip />
- <!-- no translation found for biometric_dangling_notification_action_not_now (8095249216864443491) -->
+ <!-- no translation found for fingerprint_dangling_notification_msg_2 (7578829498452127613) -->
<skip />
+ <string name="fingerprint_dangling_notification_msg_all_deleted_1" msgid="2927018569542316055">"<xliff:g id="FINGERPRINT">%s</xliff:g> no funcionaba correctamente y se ha eliminado. Configúrala de nuevo para desbloquear el teléfono con la huella digital."</string>
+ <string name="fingerprint_dangling_notification_msg_all_deleted_2" msgid="6897989352716156176">"<xliff:g id="FINGERPRINT_0">%1$s</xliff:g> y <xliff:g id="FINGERPRINT_1">%2$s</xliff:g> no funcionaban correctamente y se han eliminado. Configúralas de nuevo para desbloquear el teléfono con la huella digital."</string>
+ <string name="face_dangling_notification_title" msgid="947852541060975473">"Configura Desbloqueo facial de nuevo"</string>
+ <string name="face_dangling_notification_msg" msgid="8806849376915541655">"Tu modelo facial no funcionaba correctamente y se ha eliminado. Configúralo de nuevo para desbloquear el teléfono con la cara."</string>
+ <string name="biometric_dangling_notification_action_set_up" msgid="8246885009807817961">"Configurar"</string>
+ <string name="biometric_dangling_notification_action_not_now" msgid="8095249216864443491">"Ahora no"</string>
</resources>
diff --git a/core/res/res/values-et/strings.xml b/core/res/res/values-et/strings.xml
index 92f89e3ccb99..16b0ea25b158 100644
--- a/core/res/res/values-et/strings.xml
+++ b/core/res/res/values-et/strings.xml
@@ -283,6 +283,8 @@
<string name="global_action_voice_assist" msgid="6655788068555086695">"Häälabi"</string>
<string name="global_action_lockdown" msgid="2475471405907902963">"Lukusta"</string>
<string name="status_bar_notification_info_overflow" msgid="3330152558746563475">"999+"</string>
+ <!-- no translation found for notification_compact_heads_up_reply (2425293958371284340) -->
+ <skip />
<string name="notification_hidden_text" msgid="2835519769868187223">"Uus märguanne"</string>
<string name="notification_channel_physical_keyboard" msgid="5417306456125988096">"Füüsiline klaviatuur"</string>
<string name="notification_channel_security" msgid="8516754650348238057">"Turvalisus"</string>
@@ -2413,22 +2415,15 @@
<string name="satellite_notification_open_message" msgid="4149234979688273729">"Ava rakendus Messages"</string>
<string name="satellite_notification_how_it_works" msgid="3132069321977520519">"Tööpõhimõtted"</string>
<string name="unarchival_session_app_label" msgid="6811856981546348205">"Ootel …"</string>
- <!-- no translation found for fingerprint_dangling_notification_title (7362075195588639989) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_1 (6261149111900787302) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_2 (7688302770424064884) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_1 (2927018569542316055) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_2 (6897989352716156176) -->
- <skip />
- <!-- no translation found for face_dangling_notification_title (947852541060975473) -->
- <skip />
- <!-- no translation found for face_dangling_notification_msg (8806849376915541655) -->
- <skip />
- <!-- no translation found for biometric_dangling_notification_action_set_up (8246885009807817961) -->
+ <string name="fingerprint_dangling_notification_title" msgid="7362075195588639989">"Seadistage sõrmejäljega avamine uuesti"</string>
+ <!-- no translation found for fingerprint_dangling_notification_msg_1 (8517140433796229725) -->
<skip />
- <!-- no translation found for biometric_dangling_notification_action_not_now (8095249216864443491) -->
+ <!-- no translation found for fingerprint_dangling_notification_msg_2 (7578829498452127613) -->
<skip />
+ <string name="fingerprint_dangling_notification_msg_all_deleted_1" msgid="2927018569542316055">"<xliff:g id="FINGERPRINT">%s</xliff:g> ei töötanud hästi ja kustutati. Telefoni sõrmejäljega avamiseks seadistage see uuesti."</string>
+ <string name="fingerprint_dangling_notification_msg_all_deleted_2" msgid="6897989352716156176">"<xliff:g id="FINGERPRINT_0">%1$s</xliff:g> ja <xliff:g id="FINGERPRINT_1">%2$s</xliff:g> ei töötanud hästi ning kustutati. Telefoni sõrmejäljega avamiseks seadistage need uuesti."</string>
+ <string name="face_dangling_notification_title" msgid="947852541060975473">"Seadistage näoga avamine uuesti"</string>
+ <string name="face_dangling_notification_msg" msgid="8806849376915541655">"Teie näomudel ei töötanud hästi ja kustutati. Telefoni näoga avamiseks seadistage see uuesti."</string>
+ <string name="biometric_dangling_notification_action_set_up" msgid="8246885009807817961">"Seadista"</string>
+ <string name="biometric_dangling_notification_action_not_now" msgid="8095249216864443491">"Mitte praegu"</string>
</resources>
diff --git a/core/res/res/values-eu/strings.xml b/core/res/res/values-eu/strings.xml
index 2d4130e23fc0..4fb4726dce87 100644
--- a/core/res/res/values-eu/strings.xml
+++ b/core/res/res/values-eu/strings.xml
@@ -283,6 +283,8 @@
<string name="global_action_voice_assist" msgid="6655788068555086695">"Ahots-laguntza"</string>
<string name="global_action_lockdown" msgid="2475471405907902963">"Blokeatu"</string>
<string name="status_bar_notification_info_overflow" msgid="3330152558746563475">"999+"</string>
+ <!-- no translation found for notification_compact_heads_up_reply (2425293958371284340) -->
+ <skip />
<string name="notification_hidden_text" msgid="2835519769868187223">"Jakinarazpen berria"</string>
<string name="notification_channel_physical_keyboard" msgid="5417306456125988096">"Teklatu fisikoa"</string>
<string name="notification_channel_security" msgid="8516754650348238057">"Segurtasuna"</string>
@@ -2413,22 +2415,15 @@
<string name="satellite_notification_open_message" msgid="4149234979688273729">"Ireki Mezuak"</string>
<string name="satellite_notification_how_it_works" msgid="3132069321977520519">"Nola funtzionatzen du?"</string>
<string name="unarchival_session_app_label" msgid="6811856981546348205">"Zain…"</string>
- <!-- no translation found for fingerprint_dangling_notification_title (7362075195588639989) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_1 (6261149111900787302) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_2 (7688302770424064884) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_1 (2927018569542316055) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_2 (6897989352716156176) -->
- <skip />
- <!-- no translation found for face_dangling_notification_title (947852541060975473) -->
- <skip />
- <!-- no translation found for face_dangling_notification_msg (8806849376915541655) -->
- <skip />
- <!-- no translation found for biometric_dangling_notification_action_set_up (8246885009807817961) -->
+ <string name="fingerprint_dangling_notification_title" msgid="7362075195588639989">"Konfiguratu berriro hatz-marka bidez desblokeatzeko eginbidea"</string>
+ <!-- no translation found for fingerprint_dangling_notification_msg_1 (8517140433796229725) -->
<skip />
- <!-- no translation found for biometric_dangling_notification_action_not_now (8095249216864443491) -->
+ <!-- no translation found for fingerprint_dangling_notification_msg_2 (7578829498452127613) -->
<skip />
+ <string name="fingerprint_dangling_notification_msg_all_deleted_1" msgid="2927018569542316055">"<xliff:g id="FINGERPRINT">%s</xliff:g> ezabatu egin da, ez zuelako ondo funtzionatzen. Telefonoa hatz-markarekin desblokeatzeko, konfigura ezazu berriro."</string>
+ <string name="fingerprint_dangling_notification_msg_all_deleted_2" msgid="6897989352716156176">"<xliff:g id="FINGERPRINT_0">%1$s</xliff:g> eta <xliff:g id="FINGERPRINT_1">%2$s</xliff:g> ezabatu egin dira, ez zutelako ondo funtzionatzen. Telefonoa hatz-markarekin desblokeatzeko, konfigura itzazu berriro."</string>
+ <string name="face_dangling_notification_title" msgid="947852541060975473">"Konfiguratu berriro aurpegi bidez desblokeatzeko eginbidea"</string>
+ <string name="face_dangling_notification_msg" msgid="8806849376915541655">"Aurpegi-eredua ezabatu egin da, ez zuelako ondo funtzionatzen. Telefonoa aurpegiarekin desblokeatzeko, konfigura ezazu berriro."</string>
+ <string name="biometric_dangling_notification_action_set_up" msgid="8246885009807817961">"Konfiguratu"</string>
+ <string name="biometric_dangling_notification_action_not_now" msgid="8095249216864443491">"Orain ez"</string>
</resources>
diff --git a/core/res/res/values-fa/strings.xml b/core/res/res/values-fa/strings.xml
index 07b267471157..7272bcfcf8f3 100644
--- a/core/res/res/values-fa/strings.xml
+++ b/core/res/res/values-fa/strings.xml
@@ -283,6 +283,8 @@
<string name="global_action_voice_assist" msgid="6655788068555086695">"دستیار صوتی"</string>
<string name="global_action_lockdown" msgid="2475471405907902963">"قفل همه"</string>
<string name="status_bar_notification_info_overflow" msgid="3330152558746563475">"۹۹۹+"</string>
+ <!-- no translation found for notification_compact_heads_up_reply (2425293958371284340) -->
+ <skip />
<string name="notification_hidden_text" msgid="2835519769868187223">"اعلان جدید"</string>
<string name="notification_channel_physical_keyboard" msgid="5417306456125988096">"صفحه‌کلید فیزیکی"</string>
<string name="notification_channel_security" msgid="8516754650348238057">"امنیت"</string>
@@ -666,7 +668,7 @@
</string-array>
<string name="fingerprint_error_not_match" msgid="4599441812893438961">"اثر انگشت تشخیص داده نشد"</string>
<string name="fingerprint_udfps_error_not_match" msgid="8236930793223158856">"اثر انگشت تشخیص داده نشد"</string>
- <string name="fingerprint_dialog_use_fingerprint_instead" msgid="5590293588784953188">"چهره شناسایی نشد. درعوض از اثر انگشت استفاده کنید."</string>
+ <string name="fingerprint_dialog_use_fingerprint_instead" msgid="5590293588784953188">"چهره شناسایی نشد، از اثر انگشت استفاده کنید."</string>
<string name="fingerprint_authenticated" msgid="2024862866860283100">"اثر انگشت اصالت‌سنجی شد"</string>
<string name="face_authenticated_no_confirmation_required" msgid="8867889115112348167">"چهره اصالت‌سنجی شد"</string>
<string name="face_authenticated_confirmation_required" msgid="6872632732508013755">"چهره اصالت‌سنجی شد، لطفاً تأیید را فشار دهید"</string>
@@ -2413,22 +2415,15 @@
<string name="satellite_notification_open_message" msgid="4149234979688273729">"باز کردن «پیام‌ها»"</string>
<string name="satellite_notification_how_it_works" msgid="3132069321977520519">"روش کار"</string>
<string name="unarchival_session_app_label" msgid="6811856981546348205">"درحال تعلیق…"</string>
- <!-- no translation found for fingerprint_dangling_notification_title (7362075195588639989) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_1 (6261149111900787302) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_2 (7688302770424064884) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_1 (2927018569542316055) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_2 (6897989352716156176) -->
- <skip />
- <!-- no translation found for face_dangling_notification_title (947852541060975473) -->
- <skip />
- <!-- no translation found for face_dangling_notification_msg (8806849376915541655) -->
- <skip />
- <!-- no translation found for biometric_dangling_notification_action_set_up (8246885009807817961) -->
+ <string name="fingerprint_dangling_notification_title" msgid="7362075195588639989">"راه‌اندازی مجدد «قفل‌گشایی با اثر انگشت»"</string>
+ <!-- no translation found for fingerprint_dangling_notification_msg_1 (8517140433796229725) -->
<skip />
- <!-- no translation found for biometric_dangling_notification_action_not_now (8095249216864443491) -->
+ <!-- no translation found for fingerprint_dangling_notification_msg_2 (7578829498452127613) -->
<skip />
+ <string name="fingerprint_dangling_notification_msg_all_deleted_1" msgid="2927018569542316055">"<xliff:g id="FINGERPRINT">%s</xliff:g> خوب کار نمی‌کرد و حذف شد. برای باز کردن قفل تلفن با اثر انگشت، آن را دوباره راه‌اندازی کنید."</string>
+ <string name="fingerprint_dangling_notification_msg_all_deleted_2" msgid="6897989352716156176">"‫<xliff:g id="FINGERPRINT_0">%1$s</xliff:g> و <xliff:g id="FINGERPRINT_1">%2$s</xliff:g> خوب کار نمی‌کرد و حذف شد. برای باز کردن قفل تلفن با اثر انگشت، آن‌ها را دوباره راه‌اندازی کنید."</string>
+ <string name="face_dangling_notification_title" msgid="947852541060975473">"راه‌اندازی مجدد «قفل‌گشایی با چهره»"</string>
+ <string name="face_dangling_notification_msg" msgid="8806849376915541655">"مدل چهره شما خوب کار نمی‌کرد و حذف شد. برای باز کردن قفل تلفن با چهره، دوباره آن را راه‌اندازی کنید."</string>
+ <string name="biometric_dangling_notification_action_set_up" msgid="8246885009807817961">"راه‌اندازی"</string>
+ <string name="biometric_dangling_notification_action_not_now" msgid="8095249216864443491">"حالا نه"</string>
</resources>
diff --git a/core/res/res/values-fi/strings.xml b/core/res/res/values-fi/strings.xml
index e802443e5acb..7062a8955acb 100644
--- a/core/res/res/values-fi/strings.xml
+++ b/core/res/res/values-fi/strings.xml
@@ -283,6 +283,8 @@
<string name="global_action_voice_assist" msgid="6655788068555086695">"Ääniapuri"</string>
<string name="global_action_lockdown" msgid="2475471405907902963">"Lukitse"</string>
<string name="status_bar_notification_info_overflow" msgid="3330152558746563475">"999+"</string>
+ <!-- no translation found for notification_compact_heads_up_reply (2425293958371284340) -->
+ <skip />
<string name="notification_hidden_text" msgid="2835519769868187223">"Uusi ilmoitus"</string>
<string name="notification_channel_physical_keyboard" msgid="5417306456125988096">"Fyysinen näppäimistö"</string>
<string name="notification_channel_security" msgid="8516754650348238057">"Turvallisuus"</string>
@@ -2413,22 +2415,15 @@
<string name="satellite_notification_open_message" msgid="4149234979688273729">"Avaa Messages"</string>
<string name="satellite_notification_how_it_works" msgid="3132069321977520519">"Näin se toimii"</string>
<string name="unarchival_session_app_label" msgid="6811856981546348205">"Odottaa…"</string>
- <!-- no translation found for fingerprint_dangling_notification_title (7362075195588639989) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_1 (6261149111900787302) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_2 (7688302770424064884) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_1 (2927018569542316055) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_2 (6897989352716156176) -->
- <skip />
- <!-- no translation found for face_dangling_notification_title (947852541060975473) -->
- <skip />
- <!-- no translation found for face_dangling_notification_msg (8806849376915541655) -->
- <skip />
- <!-- no translation found for biometric_dangling_notification_action_set_up (8246885009807817961) -->
+ <string name="fingerprint_dangling_notification_title" msgid="7362075195588639989">"Ota sormenjälkiavaus uudelleen käyttöön"</string>
+ <!-- no translation found for fingerprint_dangling_notification_msg_1 (8517140433796229725) -->
<skip />
- <!-- no translation found for biometric_dangling_notification_action_not_now (8095249216864443491) -->
+ <!-- no translation found for fingerprint_dangling_notification_msg_2 (7578829498452127613) -->
<skip />
+ <string name="fingerprint_dangling_notification_msg_all_deleted_1" msgid="2927018569542316055">"<xliff:g id="FINGERPRINT">%s</xliff:g> ei toiminut kunnolla, ja se poistettiin. Ota se uudelleen käyttöön, jotta voit avata puhelimen lukituksen sormenjäljellä."</string>
+ <string name="fingerprint_dangling_notification_msg_all_deleted_2" msgid="6897989352716156176">"<xliff:g id="FINGERPRINT_0">%1$s</xliff:g> ja <xliff:g id="FINGERPRINT_1">%2$s</xliff:g> eivät toimineet kunnolla, ja ne poistettiin. Ota ne uudelleen käyttöön, jotta voit avata puhelimen lukituksen sormenjäljellä."</string>
+ <string name="face_dangling_notification_title" msgid="947852541060975473">"Ota kasvojentunnistusavaus uudelleen käyttöön"</string>
+ <string name="face_dangling_notification_msg" msgid="8806849376915541655">"Kasvomallisi ei toiminut kunnolla, ja se poistettiin. Ota se uudelleen käyttöön, jotta voit avata puhelimen lukituksen kasvoilla."</string>
+ <string name="biometric_dangling_notification_action_set_up" msgid="8246885009807817961">"Ota käyttöön"</string>
+ <string name="biometric_dangling_notification_action_not_now" msgid="8095249216864443491">"Ei nyt"</string>
</resources>
diff --git a/core/res/res/values-fr-rCA/strings.xml b/core/res/res/values-fr-rCA/strings.xml
index bf70c3cd4e97..bc61dead4cdb 100644
--- a/core/res/res/values-fr-rCA/strings.xml
+++ b/core/res/res/values-fr-rCA/strings.xml
@@ -284,6 +284,8 @@
<string name="global_action_voice_assist" msgid="6655788068555086695">"Assist. vocale"</string>
<string name="global_action_lockdown" msgid="2475471405907902963">"Verrouillage"</string>
<string name="status_bar_notification_info_overflow" msgid="3330152558746563475">"&gt;999"</string>
+ <!-- no translation found for notification_compact_heads_up_reply (2425293958371284340) -->
+ <skip />
<string name="notification_hidden_text" msgid="2835519769868187223">"Nouvelle notification"</string>
<string name="notification_channel_physical_keyboard" msgid="5417306456125988096">"Clavier physique"</string>
<string name="notification_channel_security" msgid="8516754650348238057">"Sécurité"</string>
@@ -2414,22 +2416,15 @@
<string name="satellite_notification_open_message" msgid="4149234979688273729">"Ouvrir Messages"</string>
<string name="satellite_notification_how_it_works" msgid="3132069321977520519">"Fonctionnement"</string>
<string name="unarchival_session_app_label" msgid="6811856981546348205">"En attente…"</string>
- <!-- no translation found for fingerprint_dangling_notification_title (7362075195588639989) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_1 (6261149111900787302) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_2 (7688302770424064884) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_1 (2927018569542316055) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_2 (6897989352716156176) -->
- <skip />
- <!-- no translation found for face_dangling_notification_title (947852541060975473) -->
- <skip />
- <!-- no translation found for face_dangling_notification_msg (8806849376915541655) -->
- <skip />
- <!-- no translation found for biometric_dangling_notification_action_set_up (8246885009807817961) -->
+ <string name="fingerprint_dangling_notification_title" msgid="7362075195588639989">"Configurer le Déverrouillage par empreinte digitale à nouveau"</string>
+ <!-- no translation found for fingerprint_dangling_notification_msg_1 (8517140433796229725) -->
<skip />
- <!-- no translation found for biometric_dangling_notification_action_not_now (8095249216864443491) -->
+ <!-- no translation found for fingerprint_dangling_notification_msg_2 (7578829498452127613) -->
<skip />
+ <string name="fingerprint_dangling_notification_msg_all_deleted_1" msgid="2927018569542316055">"<xliff:g id="FINGERPRINT">%s</xliff:g> ne fonctionnait pas bien et a été supprimée. Configurez-le à nouveau pour déverrouiller votre téléphone avec l\'empreinte digitale."</string>
+ <string name="fingerprint_dangling_notification_msg_all_deleted_2" msgid="6897989352716156176">"<xliff:g id="FINGERPRINT_0">%1$s</xliff:g> et <xliff:g id="FINGERPRINT_1">%2$s</xliff:g> ne fonctionnaient pas bien et ont été supprimées. Configurez-les à nouveau pour déverrouiller votre téléphone avec votre empreinte digitale."</string>
+ <string name="face_dangling_notification_title" msgid="947852541060975473">"Configurer le Déverrouillage par reconnaissance faciale à nouveau"</string>
+ <string name="face_dangling_notification_msg" msgid="8806849376915541655">"Votre modèle facial ne fonctionnait pas bien et a été supprimé. Configurez-le à nouveau pour déverrouiller votre téléphone avec votre visage."</string>
+ <string name="biometric_dangling_notification_action_set_up" msgid="8246885009807817961">"Configurer"</string>
+ <string name="biometric_dangling_notification_action_not_now" msgid="8095249216864443491">"Plus tard"</string>
</resources>
diff --git a/core/res/res/values-fr/strings.xml b/core/res/res/values-fr/strings.xml
index 57272245224f..69d42194a95e 100644
--- a/core/res/res/values-fr/strings.xml
+++ b/core/res/res/values-fr/strings.xml
@@ -284,6 +284,8 @@
<string name="global_action_voice_assist" msgid="6655788068555086695">"Assistance vocale"</string>
<string name="global_action_lockdown" msgid="2475471405907902963">"Verrouiller"</string>
<string name="status_bar_notification_info_overflow" msgid="3330152558746563475">"&gt;999"</string>
+ <!-- no translation found for notification_compact_heads_up_reply (2425293958371284340) -->
+ <skip />
<string name="notification_hidden_text" msgid="2835519769868187223">"Nouvelle notification"</string>
<string name="notification_channel_physical_keyboard" msgid="5417306456125988096">"Clavier physique"</string>
<string name="notification_channel_security" msgid="8516754650348238057">"Sécurité"</string>
@@ -2414,22 +2416,15 @@
<string name="satellite_notification_open_message" msgid="4149234979688273729">"Ouvrir Messages"</string>
<string name="satellite_notification_how_it_works" msgid="3132069321977520519">"Fonctionnement"</string>
<string name="unarchival_session_app_label" msgid="6811856981546348205">"En attente…"</string>
- <!-- no translation found for fingerprint_dangling_notification_title (7362075195588639989) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_1 (6261149111900787302) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_2 (7688302770424064884) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_1 (2927018569542316055) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_2 (6897989352716156176) -->
- <skip />
- <!-- no translation found for face_dangling_notification_title (947852541060975473) -->
- <skip />
- <!-- no translation found for face_dangling_notification_msg (8806849376915541655) -->
- <skip />
- <!-- no translation found for biometric_dangling_notification_action_set_up (8246885009807817961) -->
+ <string name="fingerprint_dangling_notification_title" msgid="7362075195588639989">"Reconfigurer le déverrouillage par empreinte digitale"</string>
+ <!-- no translation found for fingerprint_dangling_notification_msg_1 (8517140433796229725) -->
<skip />
- <!-- no translation found for biometric_dangling_notification_action_not_now (8095249216864443491) -->
+ <!-- no translation found for fingerprint_dangling_notification_msg_2 (7578829498452127613) -->
<skip />
+ <string name="fingerprint_dangling_notification_msg_all_deleted_1" msgid="2927018569542316055">"<xliff:g id="FINGERPRINT">%s</xliff:g> ne fonctionnait pas correctement et a été supprimée. Configurez-la à nouveau pour déverrouiller votre téléphone à l\'aide votre empreinte digitale."</string>
+ <string name="fingerprint_dangling_notification_msg_all_deleted_2" msgid="6897989352716156176">"<xliff:g id="FINGERPRINT_0">%1$s</xliff:g> et <xliff:g id="FINGERPRINT_1">%2$s</xliff:g> ne fonctionnaient pas correctement et ont été supprimées. Configurez-les à nouveau pour déverrouiller votre téléphone à l\'aide de votre empreinte digitale."</string>
+ <string name="face_dangling_notification_title" msgid="947852541060975473">"Reconfigurer le déverrouillage par reconnaissance faciale"</string>
+ <string name="face_dangling_notification_msg" msgid="8806849376915541655">"Votre empreinte faciale ne fonctionnait pas correctement et a été supprimée. Configurez-la à nouveau pour déverrouiller votre téléphone à l\'aide votre visage."</string>
+ <string name="biometric_dangling_notification_action_set_up" msgid="8246885009807817961">"Configuration"</string>
+ <string name="biometric_dangling_notification_action_not_now" msgid="8095249216864443491">"Pas maintenant"</string>
</resources>
diff --git a/core/res/res/values-gl/strings.xml b/core/res/res/values-gl/strings.xml
index 663ef9ace52d..dfa4fe3d75b2 100644
--- a/core/res/res/values-gl/strings.xml
+++ b/core/res/res/values-gl/strings.xml
@@ -283,6 +283,8 @@
<string name="global_action_voice_assist" msgid="6655788068555086695">"Asistente voz"</string>
<string name="global_action_lockdown" msgid="2475471405907902963">"Bloquear"</string>
<string name="status_bar_notification_info_overflow" msgid="3330152558746563475">"&gt;999"</string>
+ <!-- no translation found for notification_compact_heads_up_reply (2425293958371284340) -->
+ <skip />
<string name="notification_hidden_text" msgid="2835519769868187223">"Notificación nova"</string>
<string name="notification_channel_physical_keyboard" msgid="5417306456125988096">"Teclado físico"</string>
<string name="notification_channel_security" msgid="8516754650348238057">"Seguranza"</string>
@@ -2413,22 +2415,15 @@
<string name="satellite_notification_open_message" msgid="4149234979688273729">"Abrir Mensaxes"</string>
<string name="satellite_notification_how_it_works" msgid="3132069321977520519">"Como funciona?"</string>
<string name="unarchival_session_app_label" msgid="6811856981546348205">"Pendente..."</string>
- <!-- no translation found for fingerprint_dangling_notification_title (7362075195588639989) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_1 (6261149111900787302) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_2 (7688302770424064884) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_1 (2927018569542316055) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_2 (6897989352716156176) -->
- <skip />
- <!-- no translation found for face_dangling_notification_title (947852541060975473) -->
- <skip />
- <!-- no translation found for face_dangling_notification_msg (8806849376915541655) -->
- <skip />
- <!-- no translation found for biometric_dangling_notification_action_set_up (8246885009807817961) -->
+ <string name="fingerprint_dangling_notification_title" msgid="7362075195588639989">"Configura de novo o desbloqueo dactilar"</string>
+ <!-- no translation found for fingerprint_dangling_notification_msg_1 (8517140433796229725) -->
<skip />
- <!-- no translation found for biometric_dangling_notification_action_not_now (8095249216864443491) -->
+ <!-- no translation found for fingerprint_dangling_notification_msg_2 (7578829498452127613) -->
<skip />
+ <string name="fingerprint_dangling_notification_msg_all_deleted_1" msgid="2927018569542316055">"A <xliff:g id="FINGERPRINT">%s</xliff:g> non funcionaba correctamente, polo que se eliminou. Configúraa de novo para desbloquear o teléfono usando a impresión dixital."</string>
+ <string name="fingerprint_dangling_notification_msg_all_deleted_2" msgid="6897989352716156176">"As impresións dixitais <xliff:g id="FINGERPRINT_0">%1$s</xliff:g> e <xliff:g id="FINGERPRINT_1">%2$s</xliff:g> non funcionaban correctamente, polo que se eliminaron. Configúraas de novo para desbloquear o teléfono usando a impresión dixital."</string>
+ <string name="face_dangling_notification_title" msgid="947852541060975473">"Configura de novo o desbloqueo facial"</string>
+ <string name="face_dangling_notification_msg" msgid="8806849376915541655">"O teu modelo facial non funcionaba correctamente, polo que se eliminou. Configúrao de novo para desbloquear o teléfono usando a cara."</string>
+ <string name="biometric_dangling_notification_action_set_up" msgid="8246885009807817961">"Configurar"</string>
+ <string name="biometric_dangling_notification_action_not_now" msgid="8095249216864443491">"Agora non"</string>
</resources>
diff --git a/core/res/res/values-gu/strings.xml b/core/res/res/values-gu/strings.xml
index dc4253750380..8a84d25ee961 100644
--- a/core/res/res/values-gu/strings.xml
+++ b/core/res/res/values-gu/strings.xml
@@ -283,6 +283,8 @@
<string name="global_action_voice_assist" msgid="6655788068555086695">"વૉઇસ સહાય"</string>
<string name="global_action_lockdown" msgid="2475471405907902963">"લૉકડાઉન"</string>
<string name="status_bar_notification_info_overflow" msgid="3330152558746563475">"999+"</string>
+ <!-- no translation found for notification_compact_heads_up_reply (2425293958371284340) -->
+ <skip />
<string name="notification_hidden_text" msgid="2835519769868187223">"નવું નોટિફિકેશન"</string>
<string name="notification_channel_physical_keyboard" msgid="5417306456125988096">"ભૌતિક કીબોર્ડ"</string>
<string name="notification_channel_security" msgid="8516754650348238057">"સુરક્ષા"</string>
@@ -2413,22 +2415,15 @@
<string name="satellite_notification_open_message" msgid="4149234979688273729">"Messages ખોલો"</string>
<string name="satellite_notification_how_it_works" msgid="3132069321977520519">"તેની કામ કરવાની રીત"</string>
<string name="unarchival_session_app_label" msgid="6811856981546348205">"બાકી..."</string>
- <!-- no translation found for fingerprint_dangling_notification_title (7362075195588639989) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_1 (6261149111900787302) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_2 (7688302770424064884) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_1 (2927018569542316055) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_2 (6897989352716156176) -->
- <skip />
- <!-- no translation found for face_dangling_notification_title (947852541060975473) -->
- <skip />
- <!-- no translation found for face_dangling_notification_msg (8806849376915541655) -->
- <skip />
- <!-- no translation found for biometric_dangling_notification_action_set_up (8246885009807817961) -->
+ <string name="fingerprint_dangling_notification_title" msgid="7362075195588639989">"ફિંગરપ્રિન્ટ અનલૉક સુવિધાનું ફરી સેટઅપ કરો"</string>
+ <!-- no translation found for fingerprint_dangling_notification_msg_1 (8517140433796229725) -->
<skip />
- <!-- no translation found for biometric_dangling_notification_action_not_now (8095249216864443491) -->
+ <!-- no translation found for fingerprint_dangling_notification_msg_2 (7578829498452127613) -->
<skip />
+ <string name="fingerprint_dangling_notification_msg_all_deleted_1" msgid="2927018569542316055">"<xliff:g id="FINGERPRINT">%s</xliff:g> બરાબર કામ કરતી ન હતી અને તેને ડિલીટ કરવામાં આવી હતી. તમારા ફોનને ફિંગરપ્રિન્ટ વડે અનલૉક કરવા માટે, તેનું ફરીથી સેટઅપ કરો."</string>
+ <string name="fingerprint_dangling_notification_msg_all_deleted_2" msgid="6897989352716156176">"<xliff:g id="FINGERPRINT_0">%1$s</xliff:g> અને <xliff:g id="FINGERPRINT_1">%2$s</xliff:g> બરાબર કામ કરતી ન હતી અને તેને ડિલીટ કરવામાં આવી હતી. તમારા ફોનને તમારી ફિંગરપ્રિન્ટ વડે અનલૉક કરવા માટે, તેનું ફરીથી સેટઅપ કરો."</string>
+ <string name="face_dangling_notification_title" msgid="947852541060975473">"ફેસ અનલૉક સુવિધાનું ફરી સેટઅપ કરો"</string>
+ <string name="face_dangling_notification_msg" msgid="8806849376915541655">"તમારા ચહેરાનું મૉડલ બરાબર કામ કરતું ન હતું અને તેને ડિલીટ કરવામાં આવ્યું હતું. તમારા ફોનને ચહેરા વડે અનલૉક કરવા માટે, તેનું ફરીથી સેટઅપ કરો."</string>
+ <string name="biometric_dangling_notification_action_set_up" msgid="8246885009807817961">"સેટઅપ કરો"</string>
+ <string name="biometric_dangling_notification_action_not_now" msgid="8095249216864443491">"હમણાં નહીં"</string>
</resources>
diff --git a/core/res/res/values-hi/strings.xml b/core/res/res/values-hi/strings.xml
index 25f6ca1cc6f6..e43491294ce2 100644
--- a/core/res/res/values-hi/strings.xml
+++ b/core/res/res/values-hi/strings.xml
@@ -283,6 +283,8 @@
<string name="global_action_voice_assist" msgid="6655788068555086695">"आवाज़ से डिवाइस का इस्तेमाल"</string>
<string name="global_action_lockdown" msgid="2475471405907902963">"लॉकडाउन"</string>
<string name="status_bar_notification_info_overflow" msgid="3330152558746563475">"999+"</string>
+ <!-- no translation found for notification_compact_heads_up_reply (2425293958371284340) -->
+ <skip />
<string name="notification_hidden_text" msgid="2835519769868187223">"नई सूचना"</string>
<string name="notification_channel_physical_keyboard" msgid="5417306456125988096">"सामान्य कीबोर्ड"</string>
<string name="notification_channel_security" msgid="8516754650348238057">"सुरक्षा"</string>
@@ -666,7 +668,7 @@
</string-array>
<string name="fingerprint_error_not_match" msgid="4599441812893438961">"फ़िंगरप्रिंट की पहचान नहीं हो पाई"</string>
<string name="fingerprint_udfps_error_not_match" msgid="8236930793223158856">"फ़िंगरप्रिंट की पहचान नहीं हो पाई"</string>
- <string name="fingerprint_dialog_use_fingerprint_instead" msgid="5590293588784953188">"चेहरा नहीं पहचाना गया. फ़िंगरप्रिंट इस्तेमाल करें."</string>
+ <string name="fingerprint_dialog_use_fingerprint_instead" msgid="5590293588784953188">"चेहरा की पहचान नहीं हो पाई. फ़िंगरप्रिंट का इस्तेमाल करें."</string>
<string name="fingerprint_authenticated" msgid="2024862866860283100">"फ़िंगरप्रिंट की पुष्टि हो गई"</string>
<string name="face_authenticated_no_confirmation_required" msgid="8867889115112348167">"चेहरे की पहचान की गई"</string>
<string name="face_authenticated_confirmation_required" msgid="6872632732508013755">"चेहरे की पहचान की गई, कृपया पुष्टि बटन दबाएं"</string>
@@ -2394,7 +2396,7 @@
<string name="keyboard_layout_notification_more_than_three_selected_message" msgid="1581834181578206937">"कीबोर्ड का लेआउट <xliff:g id="LAYOUT_1">%1$s</xliff:g>, <xliff:g id="LAYOUT_2">%2$s</xliff:g>, <xliff:g id="LAYOUT_3">%3$s</xliff:g>… पर सेट कर दिया गया है. इसे बदलने के लिए टैप करें."</string>
<string name="keyboard_layout_notification_multiple_selected_title" msgid="5242444914367024499">"फ़िज़िकल कीबोर्ड कॉन्फ़िगर किए गए"</string>
<string name="keyboard_layout_notification_multiple_selected_message" msgid="6576533454124419202">"कीबोर्ड देखने के लिए टैप करें"</string>
- <string name="profile_label_private" msgid="6463418670715290696">"निजी"</string>
+ <string name="profile_label_private" msgid="6463418670715290696">"प्राइवेट"</string>
<string name="profile_label_clone" msgid="769106052210954285">"क्लोन"</string>
<string name="profile_label_work" msgid="3495359133038584618">"ऑफ़िस"</string>
<string name="profile_label_work_2" msgid="4691533661598632135">"ऑफ़िस 2"</string>
@@ -2413,22 +2415,15 @@
<string name="satellite_notification_open_message" msgid="4149234979688273729">"Messages ऐप्लिकेशन खोलें"</string>
<string name="satellite_notification_how_it_works" msgid="3132069321977520519">"यह सेटिंग कैसे काम करती है"</string>
<string name="unarchival_session_app_label" msgid="6811856981546348205">"प्रोसेस जारी है..."</string>
- <!-- no translation found for fingerprint_dangling_notification_title (7362075195588639989) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_1 (6261149111900787302) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_2 (7688302770424064884) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_1 (2927018569542316055) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_2 (6897989352716156176) -->
- <skip />
- <!-- no translation found for face_dangling_notification_title (947852541060975473) -->
- <skip />
- <!-- no translation found for face_dangling_notification_msg (8806849376915541655) -->
- <skip />
- <!-- no translation found for biometric_dangling_notification_action_set_up (8246885009807817961) -->
+ <string name="fingerprint_dangling_notification_title" msgid="7362075195588639989">"फ़िंगरप्रिंट अनलॉक की सुविधा दोबारा सेट अप करें"</string>
+ <!-- no translation found for fingerprint_dangling_notification_msg_1 (8517140433796229725) -->
<skip />
- <!-- no translation found for biometric_dangling_notification_action_not_now (8095249216864443491) -->
+ <!-- no translation found for fingerprint_dangling_notification_msg_2 (7578829498452127613) -->
<skip />
+ <string name="fingerprint_dangling_notification_msg_all_deleted_1" msgid="2927018569542316055">"अच्छे से काम न करने की वजह से <xliff:g id="FINGERPRINT">%s</xliff:g> को मिटा दिया गया. फ़िंगरप्रिंट की मदद से फ़ोन अनलॉक करने के लिए, फ़िंगरप्रिंट अनलॉक की सुविधा को दोबारा सेट अप करें."</string>
+ <string name="fingerprint_dangling_notification_msg_all_deleted_2" msgid="6897989352716156176">"अच्छे से काम न करने की वजह से, <xliff:g id="FINGERPRINT_0">%1$s</xliff:g> और <xliff:g id="FINGERPRINT_1">%2$s</xliff:g> को मिटा दिया गया. फ़िंगरप्रिंट की मदद से फ़ोन अनलॉक करने के लिए, फ़िंगरप्रिंट अनलॉक की सुविधा दोबारा सेट अप करें."</string>
+ <string name="face_dangling_notification_title" msgid="947852541060975473">"फ़ेस अनलॉक की सुविधा को दोबारा सेट अप करें"</string>
+ <string name="face_dangling_notification_msg" msgid="8806849376915541655">"अच्छे से काम न करने की वजह से, चेहरे का मॉडल मिटा दिया गया. फ़ेस अनलॉक की सुविधा की मदद से फ़ोन अनलॉक करने के लिए, इस सुविधा को दोबारा सेट अप करें."</string>
+ <string name="biometric_dangling_notification_action_set_up" msgid="8246885009807817961">"सेट अप करें"</string>
+ <string name="biometric_dangling_notification_action_not_now" msgid="8095249216864443491">"अभी नहीं"</string>
</resources>
diff --git a/core/res/res/values-hr/strings.xml b/core/res/res/values-hr/strings.xml
index 117d4e5632c6..0bd8be3b4472 100644
--- a/core/res/res/values-hr/strings.xml
+++ b/core/res/res/values-hr/strings.xml
@@ -284,6 +284,8 @@
<string name="global_action_voice_assist" msgid="6655788068555086695">"Glasovna pomoć"</string>
<string name="global_action_lockdown" msgid="2475471405907902963">"Zaključaj"</string>
<string name="status_bar_notification_info_overflow" msgid="3330152558746563475">"999+"</string>
+ <!-- no translation found for notification_compact_heads_up_reply (2425293958371284340) -->
+ <skip />
<string name="notification_hidden_text" msgid="2835519769868187223">"Nova obavijest"</string>
<string name="notification_channel_physical_keyboard" msgid="5417306456125988096">"Fizička tipkovnica"</string>
<string name="notification_channel_security" msgid="8516754650348238057">"Sigurnost"</string>
@@ -2414,22 +2416,15 @@
<string name="satellite_notification_open_message" msgid="4149234979688273729">"Otvori Poruke"</string>
<string name="satellite_notification_how_it_works" msgid="3132069321977520519">"Kako to funkcionira"</string>
<string name="unarchival_session_app_label" msgid="6811856981546348205">"Na čekanju..."</string>
- <!-- no translation found for fingerprint_dangling_notification_title (7362075195588639989) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_1 (6261149111900787302) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_2 (7688302770424064884) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_1 (2927018569542316055) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_2 (6897989352716156176) -->
- <skip />
- <!-- no translation found for face_dangling_notification_title (947852541060975473) -->
- <skip />
- <!-- no translation found for face_dangling_notification_msg (8806849376915541655) -->
- <skip />
- <!-- no translation found for biometric_dangling_notification_action_set_up (8246885009807817961) -->
+ <string name="fingerprint_dangling_notification_title" msgid="7362075195588639989">"Ponovno postavite otključavanje otiskom prsta"</string>
+ <!-- no translation found for fingerprint_dangling_notification_msg_1 (8517140433796229725) -->
<skip />
- <!-- no translation found for biometric_dangling_notification_action_not_now (8095249216864443491) -->
+ <!-- no translation found for fingerprint_dangling_notification_msg_2 (7578829498452127613) -->
<skip />
+ <string name="fingerprint_dangling_notification_msg_all_deleted_1" msgid="2927018569542316055">"Otisak prsta <xliff:g id="FINGERPRINT">%s</xliff:g> nije dobro funkcionirao i izbrisan je. Ponovno ga postavite da biste otključali telefon otiskom prsta."</string>
+ <string name="fingerprint_dangling_notification_msg_all_deleted_2" msgid="6897989352716156176">"Otisci prstiju <xliff:g id="FINGERPRINT_0">%1$s</xliff:g> i <xliff:g id="FINGERPRINT_1">%2$s</xliff:g> nisu dobro funkcionirali i izbrisani su. Ponovno ih postavite da biste otključali telefon otiskom prsta."</string>
+ <string name="face_dangling_notification_title" msgid="947852541060975473">"Ponovno postavite otključavanje licem"</string>
+ <string name="face_dangling_notification_msg" msgid="8806849376915541655">"Model vašeg lica nije dobro funkcionirao i izbrisan je. Ponovno ga postavite da biste otključali telefon licem."</string>
+ <string name="biometric_dangling_notification_action_set_up" msgid="8246885009807817961">"Postavi"</string>
+ <string name="biometric_dangling_notification_action_not_now" msgid="8095249216864443491">"Ne sad"</string>
</resources>
diff --git a/core/res/res/values-hu/strings.xml b/core/res/res/values-hu/strings.xml
index de8fa848edd6..aeebbdc22aac 100644
--- a/core/res/res/values-hu/strings.xml
+++ b/core/res/res/values-hu/strings.xml
@@ -283,6 +283,8 @@
<string name="global_action_voice_assist" msgid="6655788068555086695">"Hangsegéd"</string>
<string name="global_action_lockdown" msgid="2475471405907902963">"Zárolás"</string>
<string name="status_bar_notification_info_overflow" msgid="3330152558746563475">"999+"</string>
+ <!-- no translation found for notification_compact_heads_up_reply (2425293958371284340) -->
+ <skip />
<string name="notification_hidden_text" msgid="2835519769868187223">"Új értesítés"</string>
<string name="notification_channel_physical_keyboard" msgid="5417306456125988096">"Fizikai billentyűzet"</string>
<string name="notification_channel_security" msgid="8516754650348238057">"Biztonság"</string>
@@ -1997,7 +1999,7 @@
<string name="work_mode_emergency_call_button" msgid="6818855962881612322">"Vészhelyzet"</string>
<string name="set_up_screen_lock_title" msgid="8346083801616474030">"Állítson be képernyőzárat"</string>
<string name="set_up_screen_lock_action_label" msgid="2687634803649209367">"Képernyőzár beállítása"</string>
- <string name="private_space_set_up_screen_lock_message" msgid="1109956797005149814">"A magánterület használatához állítson be képernyőzárat"</string>
+ <string name="private_space_set_up_screen_lock_message" msgid="1109956797005149814">"A privát terület használatához állítson be képernyőzárat"</string>
<string name="app_blocked_title" msgid="7353262160455028160">"Az alkalmazás nem hozzáférhető"</string>
<string name="app_blocked_message" msgid="542972921087873023">"A(z) <xliff:g id="APP_NAME">%1$s</xliff:g> jelenleg nem hozzáférhető."</string>
<string name="app_streaming_blocked_title" msgid="6090945835898766139">"A(z) <xliff:g id="ACTIVITY">%1$s</xliff:g> nem áll rendelkezése"</string>
@@ -2413,22 +2415,15 @@
<string name="satellite_notification_open_message" msgid="4149234979688273729">"A Messages megnyitása"</string>
<string name="satellite_notification_how_it_works" msgid="3132069321977520519">"Hogyan működik?"</string>
<string name="unarchival_session_app_label" msgid="6811856981546348205">"Függőben…"</string>
- <!-- no translation found for fingerprint_dangling_notification_title (7362075195588639989) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_1 (6261149111900787302) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_2 (7688302770424064884) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_1 (2927018569542316055) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_2 (6897989352716156176) -->
- <skip />
- <!-- no translation found for face_dangling_notification_title (947852541060975473) -->
- <skip />
- <!-- no translation found for face_dangling_notification_msg (8806849376915541655) -->
- <skip />
- <!-- no translation found for biometric_dangling_notification_action_set_up (8246885009807817961) -->
+ <string name="fingerprint_dangling_notification_title" msgid="7362075195588639989">"A Feloldás ujjlenyomattal funkció újbóli beállítása"</string>
+ <!-- no translation found for fingerprint_dangling_notification_msg_1 (8517140433796229725) -->
<skip />
- <!-- no translation found for biometric_dangling_notification_action_not_now (8095249216864443491) -->
+ <!-- no translation found for fingerprint_dangling_notification_msg_2 (7578829498452127613) -->
<skip />
+ <string name="fingerprint_dangling_notification_msg_all_deleted_1" msgid="2927018569542316055">"A(z) <xliff:g id="FINGERPRINT">%s</xliff:g> nem működött megfelelően, ezért törölve lett. Állítsa be újra, hogy feloldhassa a telefonját az ujjlenyomata segítségével."</string>
+ <string name="fingerprint_dangling_notification_msg_all_deleted_2" msgid="6897989352716156176">"A(z) <xliff:g id="FINGERPRINT_0">%1$s</xliff:g> és a(z) <xliff:g id="FINGERPRINT_1">%2$s</xliff:g> nem működtek megfelelően, ezért törölve lettek. Állítsa be őket újra, hogy feloldhassa a telefonját az ujjlenyomata segítségével."</string>
+ <string name="face_dangling_notification_title" msgid="947852541060975473">"Állítsa be újra az Arcalapú feloldást"</string>
+ <string name="face_dangling_notification_msg" msgid="8806849376915541655">"Az arcmodellje nem működött megfelelően, ezért törölve lett. Állítsa be újra, hogy feloldhassa a telefonját az arca segítségével."</string>
+ <string name="biometric_dangling_notification_action_set_up" msgid="8246885009807817961">"Beállítás"</string>
+ <string name="biometric_dangling_notification_action_not_now" msgid="8095249216864443491">"Most nem"</string>
</resources>
diff --git a/core/res/res/values-hy/strings.xml b/core/res/res/values-hy/strings.xml
index d37993442bcf..a0e0bd218a18 100644
--- a/core/res/res/values-hy/strings.xml
+++ b/core/res/res/values-hy/strings.xml
@@ -283,6 +283,8 @@
<string name="global_action_voice_assist" msgid="6655788068555086695">"Ձայնային օգնութ"</string>
<string name="global_action_lockdown" msgid="2475471405907902963">"Արգելափակում"</string>
<string name="status_bar_notification_info_overflow" msgid="3330152558746563475">"999+"</string>
+ <!-- no translation found for notification_compact_heads_up_reply (2425293958371284340) -->
+ <skip />
<string name="notification_hidden_text" msgid="2835519769868187223">"Նոր ծանուցում"</string>
<string name="notification_channel_physical_keyboard" msgid="5417306456125988096">"Ֆիզիկական ստեղնաշար"</string>
<string name="notification_channel_security" msgid="8516754650348238057">"Անվտանգություն"</string>
@@ -2394,7 +2396,7 @@
<string name="keyboard_layout_notification_more_than_three_selected_message" msgid="1581834181578206937">"Ստեղնաշարի համար կարգավորված են <xliff:g id="LAYOUT_1">%1$s</xliff:g>, <xliff:g id="LAYOUT_2">%2$s</xliff:g>, <xliff:g id="LAYOUT_3">%3$s</xliff:g> դասավորությունները։ Հպեք փոխելու համար։"</string>
<string name="keyboard_layout_notification_multiple_selected_title" msgid="5242444914367024499">"Ֆիզիկական ստեղնաշարերը կարգավորված են"</string>
<string name="keyboard_layout_notification_multiple_selected_message" msgid="6576533454124419202">"Հպեք՝ ստեղնաշարերը դիտելու համար"</string>
- <string name="profile_label_private" msgid="6463418670715290696">"Անձնական"</string>
+ <string name="profile_label_private" msgid="6463418670715290696">"Մասնավոր"</string>
<string name="profile_label_clone" msgid="769106052210954285">"Կլոն"</string>
<string name="profile_label_work" msgid="3495359133038584618">"Աշխատանքային"</string>
<string name="profile_label_work_2" msgid="4691533661598632135">"Աշխատանքային 2"</string>
@@ -2413,22 +2415,15 @@
<string name="satellite_notification_open_message" msgid="4149234979688273729">"Բացել Messages-ը"</string>
<string name="satellite_notification_how_it_works" msgid="3132069321977520519">"Ինչպես է դա աշխատում"</string>
<string name="unarchival_session_app_label" msgid="6811856981546348205">"Առկախ է…"</string>
- <!-- no translation found for fingerprint_dangling_notification_title (7362075195588639989) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_1 (6261149111900787302) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_2 (7688302770424064884) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_1 (2927018569542316055) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_2 (6897989352716156176) -->
- <skip />
- <!-- no translation found for face_dangling_notification_title (947852541060975473) -->
- <skip />
- <!-- no translation found for face_dangling_notification_msg (8806849376915541655) -->
- <skip />
- <!-- no translation found for biometric_dangling_notification_action_set_up (8246885009807817961) -->
+ <string name="fingerprint_dangling_notification_title" msgid="7362075195588639989">"Նորից կարգավորեք մատնահետքով ապակողպումը"</string>
+ <!-- no translation found for fingerprint_dangling_notification_msg_1 (8517140433796229725) -->
<skip />
- <!-- no translation found for biometric_dangling_notification_action_not_now (8095249216864443491) -->
+ <!-- no translation found for fingerprint_dangling_notification_msg_2 (7578829498452127613) -->
<skip />
+ <string name="fingerprint_dangling_notification_msg_all_deleted_1" msgid="2927018569542316055">"«<xliff:g id="FINGERPRINT">%s</xliff:g>» մատնահետքը հեռացվել է, քանի որ լավ չէր աշխատում։ Նորից կարգավորեք այն՝ ձեր հեռախոսը մատնահետքով ապակողպելու համար։"</string>
+ <string name="fingerprint_dangling_notification_msg_all_deleted_2" msgid="6897989352716156176">"«<xliff:g id="FINGERPRINT_0">%1$s</xliff:g>» և «<xliff:g id="FINGERPRINT_1">%2$s</xliff:g>» մատնահետքերը հեռացվել են, քանի որ լավ չէին աշխատում։ Նորից կարգավորեք դրանք՝ ձեր հեռախոսը մատնահետքով ապակողպելու համար։"</string>
+ <string name="face_dangling_notification_title" msgid="947852541060975473">"Նորից կարգավորեք դեմքով ապակողպումը"</string>
+ <string name="face_dangling_notification_msg" msgid="8806849376915541655">"Ձեր դեմքի նմուշը հեռացվել է, քանի որ լավ չէր աշխատում։ Նորից կարգավորեք այն՝ ձեր հեռախոսը դեմքով ապակողպելու համար։"</string>
+ <string name="biometric_dangling_notification_action_set_up" msgid="8246885009807817961">"Կարգավորել"</string>
+ <string name="biometric_dangling_notification_action_not_now" msgid="8095249216864443491">"Ոչ հիմա"</string>
</resources>
diff --git a/core/res/res/values-in/strings.xml b/core/res/res/values-in/strings.xml
index e6634d23fd62..fb6180b0d126 100644
--- a/core/res/res/values-in/strings.xml
+++ b/core/res/res/values-in/strings.xml
@@ -283,6 +283,8 @@
<string name="global_action_voice_assist" msgid="6655788068555086695">"Bantuan Suara"</string>
<string name="global_action_lockdown" msgid="2475471405907902963">"Kunci total"</string>
<string name="status_bar_notification_info_overflow" msgid="3330152558746563475">"999+"</string>
+ <!-- no translation found for notification_compact_heads_up_reply (2425293958371284340) -->
+ <skip />
<string name="notification_hidden_text" msgid="2835519769868187223">"Notifikasi baru"</string>
<string name="notification_channel_physical_keyboard" msgid="5417306456125988096">"Keyboard fisik"</string>
<string name="notification_channel_security" msgid="8516754650348238057">"Keamanan"</string>
@@ -2413,22 +2415,15 @@
<string name="satellite_notification_open_message" msgid="4149234979688273729">"Buka Message"</string>
<string name="satellite_notification_how_it_works" msgid="3132069321977520519">"Cara kerjanya"</string>
<string name="unarchival_session_app_label" msgid="6811856981546348205">"Tertunda..."</string>
- <!-- no translation found for fingerprint_dangling_notification_title (7362075195588639989) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_1 (6261149111900787302) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_2 (7688302770424064884) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_1 (2927018569542316055) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_2 (6897989352716156176) -->
- <skip />
- <!-- no translation found for face_dangling_notification_title (947852541060975473) -->
- <skip />
- <!-- no translation found for face_dangling_notification_msg (8806849376915541655) -->
- <skip />
- <!-- no translation found for biometric_dangling_notification_action_set_up (8246885009807817961) -->
+ <string name="fingerprint_dangling_notification_title" msgid="7362075195588639989">"Siapkan Buka dengan Sidik Jari lagi"</string>
+ <!-- no translation found for fingerprint_dangling_notification_msg_1 (8517140433796229725) -->
<skip />
- <!-- no translation found for biometric_dangling_notification_action_not_now (8095249216864443491) -->
+ <!-- no translation found for fingerprint_dangling_notification_msg_2 (7578829498452127613) -->
<skip />
+ <string name="fingerprint_dangling_notification_msg_all_deleted_1" msgid="2927018569542316055">"<xliff:g id="FINGERPRINT">%s</xliff:g> tidak berfungsi dengan baik dan telah dihapus. Siapkan lagi untuk membuka kunci ponsel Anda dengan sidik jari."</string>
+ <string name="fingerprint_dangling_notification_msg_all_deleted_2" msgid="6897989352716156176">"<xliff:g id="FINGERPRINT_0">%1$s</xliff:g> dan <xliff:g id="FINGERPRINT_1">%2$s</xliff:g> tidak berfungsi dengan baik dan telah dihapus. Siapkan lagi untuk membuka kunci ponsel Anda dengan sidik jari."</string>
+ <string name="face_dangling_notification_title" msgid="947852541060975473">"Siapkan Buka dengan Wajah lagi"</string>
+ <string name="face_dangling_notification_msg" msgid="8806849376915541655">"Model wajah Anda tidak berfungsi dengan baik dan telah dihapus. Siapkan lagi untuk membuka kunci ponsel Anda dengan wajah."</string>
+ <string name="biometric_dangling_notification_action_set_up" msgid="8246885009807817961">"Penyiapan"</string>
+ <string name="biometric_dangling_notification_action_not_now" msgid="8095249216864443491">"Lain kali"</string>
</resources>
diff --git a/core/res/res/values-is/strings.xml b/core/res/res/values-is/strings.xml
index f77a18a3911b..3f96dae37c8d 100644
--- a/core/res/res/values-is/strings.xml
+++ b/core/res/res/values-is/strings.xml
@@ -283,6 +283,8 @@
<string name="global_action_voice_assist" msgid="6655788068555086695">"Raddaðstoð"</string>
<string name="global_action_lockdown" msgid="2475471405907902963">"Læsing"</string>
<string name="status_bar_notification_info_overflow" msgid="3330152558746563475">"999+"</string>
+ <!-- no translation found for notification_compact_heads_up_reply (2425293958371284340) -->
+ <skip />
<string name="notification_hidden_text" msgid="2835519769868187223">"Ný tilkynning"</string>
<string name="notification_channel_physical_keyboard" msgid="5417306456125988096">"Vélbúnaðarlyklaborð"</string>
<string name="notification_channel_security" msgid="8516754650348238057">"Öryggi"</string>
@@ -2413,22 +2415,15 @@
<string name="satellite_notification_open_message" msgid="4149234979688273729">"Opna Messages"</string>
<string name="satellite_notification_how_it_works" msgid="3132069321977520519">"Svona virkar þetta"</string>
<string name="unarchival_session_app_label" msgid="6811856981546348205">"Í bið…"</string>
- <!-- no translation found for fingerprint_dangling_notification_title (7362075195588639989) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_1 (6261149111900787302) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_2 (7688302770424064884) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_1 (2927018569542316055) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_2 (6897989352716156176) -->
- <skip />
- <!-- no translation found for face_dangling_notification_title (947852541060975473) -->
- <skip />
- <!-- no translation found for face_dangling_notification_msg (8806849376915541655) -->
- <skip />
- <!-- no translation found for biometric_dangling_notification_action_set_up (8246885009807817961) -->
+ <string name="fingerprint_dangling_notification_title" msgid="7362075195588639989">"Setja upp fingrafarskenni aftur"</string>
+ <!-- no translation found for fingerprint_dangling_notification_msg_1 (8517140433796229725) -->
<skip />
- <!-- no translation found for biometric_dangling_notification_action_not_now (8095249216864443491) -->
+ <!-- no translation found for fingerprint_dangling_notification_msg_2 (7578829498452127613) -->
<skip />
+ <string name="fingerprint_dangling_notification_msg_all_deleted_1" msgid="2927018569542316055">"<xliff:g id="FINGERPRINT">%s</xliff:g> virkaði illa og var eytt. Settu það upp aftur til að taka símann úr lás með fingrafari."</string>
+ <string name="fingerprint_dangling_notification_msg_all_deleted_2" msgid="6897989352716156176">"<xliff:g id="FINGERPRINT_0">%1$s</xliff:g> og <xliff:g id="FINGERPRINT_1">%2$s</xliff:g> virkuðu illa og var eytt. Settu þau upp aftur til að taka símann úr lás með fingrafarinu þínu."</string>
+ <string name="face_dangling_notification_title" msgid="947852541060975473">"Setja upp andlitskenni aftur"</string>
+ <string name="face_dangling_notification_msg" msgid="8806849376915541655">"Andlitslíkanið þitt virkaði illa og var eytt. Settu það upp aftur til að taka símann úr lás með andlitinu."</string>
+ <string name="biometric_dangling_notification_action_set_up" msgid="8246885009807817961">"Setja upp"</string>
+ <string name="biometric_dangling_notification_action_not_now" msgid="8095249216864443491">"Ekki núna"</string>
</resources>
diff --git a/core/res/res/values-it/strings.xml b/core/res/res/values-it/strings.xml
index 95ccad54d63f..f22b6531c66e 100644
--- a/core/res/res/values-it/strings.xml
+++ b/core/res/res/values-it/strings.xml
@@ -284,6 +284,8 @@
<string name="global_action_voice_assist" msgid="6655788068555086695">"Voice Assist"</string>
<string name="global_action_lockdown" msgid="2475471405907902963">"Blocco"</string>
<string name="status_bar_notification_info_overflow" msgid="3330152558746563475">"999+"</string>
+ <!-- no translation found for notification_compact_heads_up_reply (2425293958371284340) -->
+ <skip />
<string name="notification_hidden_text" msgid="2835519769868187223">"Nuova notifica"</string>
<string name="notification_channel_physical_keyboard" msgid="5417306456125988096">"Tastiera fisica"</string>
<string name="notification_channel_security" msgid="8516754650348238057">"Sicurezza"</string>
@@ -2414,22 +2416,15 @@
<string name="satellite_notification_open_message" msgid="4149234979688273729">"Apri Messaggi"</string>
<string name="satellite_notification_how_it_works" msgid="3132069321977520519">"Come funziona"</string>
<string name="unarchival_session_app_label" msgid="6811856981546348205">"In attesa…"</string>
- <!-- no translation found for fingerprint_dangling_notification_title (7362075195588639989) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_1 (6261149111900787302) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_2 (7688302770424064884) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_1 (2927018569542316055) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_2 (6897989352716156176) -->
- <skip />
- <!-- no translation found for face_dangling_notification_title (947852541060975473) -->
- <skip />
- <!-- no translation found for face_dangling_notification_msg (8806849376915541655) -->
- <skip />
- <!-- no translation found for biometric_dangling_notification_action_set_up (8246885009807817961) -->
+ <string name="fingerprint_dangling_notification_title" msgid="7362075195588639989">"Riconfigura lo Sblocco con l\'Impronta"</string>
+ <!-- no translation found for fingerprint_dangling_notification_msg_1 (8517140433796229725) -->
<skip />
- <!-- no translation found for biometric_dangling_notification_action_not_now (8095249216864443491) -->
+ <!-- no translation found for fingerprint_dangling_notification_msg_2 (7578829498452127613) -->
<skip />
+ <string name="fingerprint_dangling_notification_msg_all_deleted_1" msgid="2927018569542316055">"<xliff:g id="FINGERPRINT">%s</xliff:g> non funzionava bene ed è stata eliminata. Riconfigurala per sbloccare lo smartphone con l\'impronta."</string>
+ <string name="fingerprint_dangling_notification_msg_all_deleted_2" msgid="6897989352716156176">"<xliff:g id="FINGERPRINT_0">%1$s</xliff:g> e <xliff:g id="FINGERPRINT_1">%2$s</xliff:g> non funzionavano bene e sono state eliminate. Riconfigurale per sbloccare lo smartphone con l\'impronta."</string>
+ <string name="face_dangling_notification_title" msgid="947852541060975473">"Riconfigura lo Sblocco con il Volto"</string>
+ <string name="face_dangling_notification_msg" msgid="8806849376915541655">"Il tuo modello del volto non funzionava bene ed è stato eliminato. Riconfiguralo per sbloccare lo smartphone con il volto."</string>
+ <string name="biometric_dangling_notification_action_set_up" msgid="8246885009807817961">"Configura"</string>
+ <string name="biometric_dangling_notification_action_not_now" msgid="8095249216864443491">"Non ora"</string>
</resources>
diff --git a/core/res/res/values-iw/strings.xml b/core/res/res/values-iw/strings.xml
index fee437af96cf..3a924e1916c0 100644
--- a/core/res/res/values-iw/strings.xml
+++ b/core/res/res/values-iw/strings.xml
@@ -284,6 +284,8 @@
<string name="global_action_voice_assist" msgid="6655788068555086695">"האסיסטנט"</string>
<string name="global_action_lockdown" msgid="2475471405907902963">"נעילה"</string>
<string name="status_bar_notification_info_overflow" msgid="3330152558746563475">"999+"</string>
+ <!-- no translation found for notification_compact_heads_up_reply (2425293958371284340) -->
+ <skip />
<string name="notification_hidden_text" msgid="2835519769868187223">"התראה חדשה"</string>
<string name="notification_channel_physical_keyboard" msgid="5417306456125988096">"מקלדת פיזית"</string>
<string name="notification_channel_security" msgid="8516754650348238057">"אבטחה"</string>
@@ -2395,7 +2397,7 @@
<string name="keyboard_layout_notification_more_than_three_selected_message" msgid="1581834181578206937">"פריסת המקלדת מוגדרת ל<xliff:g id="LAYOUT_1">%1$s</xliff:g>, <xliff:g id="LAYOUT_2">%2$s</xliff:g>, <xliff:g id="LAYOUT_3">%3$s</xliff:g>… אפשר להקיש כדי לשנות את ההגדרה הזו."</string>
<string name="keyboard_layout_notification_multiple_selected_title" msgid="5242444914367024499">"הוגדרו מקלדות פיזיות"</string>
<string name="keyboard_layout_notification_multiple_selected_message" msgid="6576533454124419202">"יש להקיש כדי להציג את המקלדות"</string>
- <string name="profile_label_private" msgid="6463418670715290696">"פרטי"</string>
+ <string name="profile_label_private" msgid="6463418670715290696">"פרופיל פרטי"</string>
<string name="profile_label_clone" msgid="769106052210954285">"שכפול"</string>
<string name="profile_label_work" msgid="3495359133038584618">"פרופיל עבודה"</string>
<string name="profile_label_work_2" msgid="4691533661598632135">"פרופיל עבודה 2"</string>
@@ -2414,22 +2416,15 @@
<string name="satellite_notification_open_message" msgid="4149234979688273729">"‏לפתיחת Messages"</string>
<string name="satellite_notification_how_it_works" msgid="3132069321977520519">"איך זה עובד"</string>
<string name="unarchival_session_app_label" msgid="6811856981546348205">"בהמתנה..."</string>
- <!-- no translation found for fingerprint_dangling_notification_title (7362075195588639989) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_1 (6261149111900787302) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_2 (7688302770424064884) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_1 (2927018569542316055) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_2 (6897989352716156176) -->
- <skip />
- <!-- no translation found for face_dangling_notification_title (947852541060975473) -->
- <skip />
- <!-- no translation found for face_dangling_notification_msg (8806849376915541655) -->
- <skip />
- <!-- no translation found for biometric_dangling_notification_action_set_up (8246885009807817961) -->
+ <string name="fingerprint_dangling_notification_title" msgid="7362075195588639989">"הגדרה חוזרת של \'ביטול הנעילה בטביעת אצבע\'"</string>
+ <!-- no translation found for fingerprint_dangling_notification_msg_1 (8517140433796229725) -->
<skip />
- <!-- no translation found for biometric_dangling_notification_action_not_now (8095249216864443491) -->
+ <!-- no translation found for fingerprint_dangling_notification_msg_2 (7578829498452127613) -->
<skip />
+ <string name="fingerprint_dangling_notification_msg_all_deleted_1" msgid="2927018569542316055">"‫<xliff:g id="FINGERPRINT">%s</xliff:g> לא פעלה היטב ולכן היא נמחקה. עליך להגדיר אותה שוב כדי שתהיה לך אפשרות לבטל את הנעילה של הטלפון באמצעות טביעת אצבע."</string>
+ <string name="fingerprint_dangling_notification_msg_all_deleted_2" msgid="6897989352716156176">"‫<xliff:g id="FINGERPRINT_0">%1$s</xliff:g> ו<xliff:g id="FINGERPRINT_1">%2$s</xliff:g> לא פעלו היטב ולכן הן נמחקו. עליך להגדיר אותן שוב כדי שתהיה לך אפשרות לבטל את הנעילה של הטלפון באמצעות טביעת אצבע."</string>
+ <string name="face_dangling_notification_title" msgid="947852541060975473">"הגדרה חוזרת של \'פתיחה ע\"י זיהוי הפנים\'"</string>
+ <string name="face_dangling_notification_msg" msgid="8806849376915541655">"התבנית לזיהוי הפנים לא פעלה היטב ולכן היא נמחקה. עליך להגדיר אותה שוב כדי שתהיה לך אפשרות לבטל את הנעילה של הטלפון באמצעות זיהוי הפנים."</string>
+ <string name="biometric_dangling_notification_action_set_up" msgid="8246885009807817961">"הגדרה"</string>
+ <string name="biometric_dangling_notification_action_not_now" msgid="8095249216864443491">"לא עכשיו"</string>
</resources>
diff --git a/core/res/res/values-ja/strings.xml b/core/res/res/values-ja/strings.xml
index 726db1c4ea89..e31d79574841 100644
--- a/core/res/res/values-ja/strings.xml
+++ b/core/res/res/values-ja/strings.xml
@@ -283,6 +283,8 @@
<string name="global_action_voice_assist" msgid="6655788068555086695">"音声アシスト"</string>
<string name="global_action_lockdown" msgid="2475471405907902963">"ロックダウン"</string>
<string name="status_bar_notification_info_overflow" msgid="3330152558746563475">"999+"</string>
+ <!-- no translation found for notification_compact_heads_up_reply (2425293958371284340) -->
+ <skip />
<string name="notification_hidden_text" msgid="2835519769868187223">"新しい通知"</string>
<string name="notification_channel_physical_keyboard" msgid="5417306456125988096">"物理キーボード"</string>
<string name="notification_channel_security" msgid="8516754650348238057">"セキュリティ"</string>
@@ -2413,22 +2415,15 @@
<string name="satellite_notification_open_message" msgid="4149234979688273729">"メッセージ アプリを開く"</string>
<string name="satellite_notification_how_it_works" msgid="3132069321977520519">"仕組み"</string>
<string name="unarchival_session_app_label" msgid="6811856981546348205">"保留中..."</string>
- <!-- no translation found for fingerprint_dangling_notification_title (7362075195588639989) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_1 (6261149111900787302) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_2 (7688302770424064884) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_1 (2927018569542316055) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_2 (6897989352716156176) -->
- <skip />
- <!-- no translation found for face_dangling_notification_title (947852541060975473) -->
- <skip />
- <!-- no translation found for face_dangling_notification_msg (8806849376915541655) -->
- <skip />
- <!-- no translation found for biometric_dangling_notification_action_set_up (8246885009807817961) -->
+ <string name="fingerprint_dangling_notification_title" msgid="7362075195588639989">"指紋認証をもう一度設定してください"</string>
+ <!-- no translation found for fingerprint_dangling_notification_msg_1 (8517140433796229725) -->
<skip />
- <!-- no translation found for biometric_dangling_notification_action_not_now (8095249216864443491) -->
+ <!-- no translation found for fingerprint_dangling_notification_msg_2 (7578829498452127613) -->
<skip />
+ <string name="fingerprint_dangling_notification_msg_all_deleted_1" msgid="2927018569542316055">"<xliff:g id="FINGERPRINT">%s</xliff:g> が正常に機能せず、削除されました。指紋認証でスマートフォンのロックを解除するには、設定し直してください。"</string>
+ <string name="fingerprint_dangling_notification_msg_all_deleted_2" msgid="6897989352716156176">"<xliff:g id="FINGERPRINT_0">%1$s</xliff:g> と <xliff:g id="FINGERPRINT_1">%2$s</xliff:g> が正常に機能せず、削除されました。指紋認証でスマートフォンのロックを解除するには、設定し直してください。"</string>
+ <string name="face_dangling_notification_title" msgid="947852541060975473">"顔認証をもう一度設定してください"</string>
+ <string name="face_dangling_notification_msg" msgid="8806849376915541655">"顔モデルが正常に機能せず、削除されました。顔認証でスマートフォンのロックを解除するには、設定し直してください。"</string>
+ <string name="biometric_dangling_notification_action_set_up" msgid="8246885009807817961">"設定"</string>
+ <string name="biometric_dangling_notification_action_not_now" msgid="8095249216864443491">"後で"</string>
</resources>
diff --git a/core/res/res/values-ka/strings.xml b/core/res/res/values-ka/strings.xml
index bdf6c489326b..a28471995d96 100644
--- a/core/res/res/values-ka/strings.xml
+++ b/core/res/res/values-ka/strings.xml
@@ -283,6 +283,8 @@
<string name="global_action_voice_assist" msgid="6655788068555086695">"ხმოვანი ასისტ."</string>
<string name="global_action_lockdown" msgid="2475471405907902963">"დაბლოკვა"</string>
<string name="status_bar_notification_info_overflow" msgid="3330152558746563475">"999+"</string>
+ <!-- no translation found for notification_compact_heads_up_reply (2425293958371284340) -->
+ <skip />
<string name="notification_hidden_text" msgid="2835519769868187223">"ახალი შეტყობინება"</string>
<string name="notification_channel_physical_keyboard" msgid="5417306456125988096">"ფიზიკური კლავიატურა"</string>
<string name="notification_channel_security" msgid="8516754650348238057">"უსაფრთხოება"</string>
@@ -2394,7 +2396,7 @@
<string name="keyboard_layout_notification_more_than_three_selected_message" msgid="1581834181578206937">"დაყენდა კლავიატურის განლაგება: <xliff:g id="LAYOUT_1">%1$s</xliff:g>, <xliff:g id="LAYOUT_2">%2$s</xliff:g>, <xliff:g id="LAYOUT_3">%3$s</xliff:g>… შეეხეთ შესაცვლელად."</string>
<string name="keyboard_layout_notification_multiple_selected_title" msgid="5242444914367024499">"ფიზიკური კლავიატურები კონფიგურირებულია"</string>
<string name="keyboard_layout_notification_multiple_selected_message" msgid="6576533454124419202">"შეეხეთ კლავიატურების სანახავად"</string>
- <string name="profile_label_private" msgid="6463418670715290696">"პირადი"</string>
+ <string name="profile_label_private" msgid="6463418670715290696">"კერძო"</string>
<string name="profile_label_clone" msgid="769106052210954285">"კლონი"</string>
<string name="profile_label_work" msgid="3495359133038584618">"სამსახური"</string>
<string name="profile_label_work_2" msgid="4691533661598632135">"სამსახური 2"</string>
@@ -2413,22 +2415,15 @@
<string name="satellite_notification_open_message" msgid="4149234979688273729">"Messages-ის გახსნა"</string>
<string name="satellite_notification_how_it_works" msgid="3132069321977520519">"მუშაობის პრინციპი"</string>
<string name="unarchival_session_app_label" msgid="6811856981546348205">"მომლოდინე..."</string>
- <!-- no translation found for fingerprint_dangling_notification_title (7362075195588639989) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_1 (6261149111900787302) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_2 (7688302770424064884) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_1 (2927018569542316055) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_2 (6897989352716156176) -->
- <skip />
- <!-- no translation found for face_dangling_notification_title (947852541060975473) -->
- <skip />
- <!-- no translation found for face_dangling_notification_msg (8806849376915541655) -->
- <skip />
- <!-- no translation found for biometric_dangling_notification_action_set_up (8246885009807817961) -->
+ <string name="fingerprint_dangling_notification_title" msgid="7362075195588639989">"ანაბეჭდით განბლოკვის ხელახლა დაყენება"</string>
+ <!-- no translation found for fingerprint_dangling_notification_msg_1 (8517140433796229725) -->
<skip />
- <!-- no translation found for biometric_dangling_notification_action_not_now (8095249216864443491) -->
+ <!-- no translation found for fingerprint_dangling_notification_msg_2 (7578829498452127613) -->
<skip />
+ <string name="fingerprint_dangling_notification_msg_all_deleted_1" msgid="2927018569542316055">"<xliff:g id="FINGERPRINT">%s</xliff:g> კარგად არ მუშაობდა და წაიშალა. თავიდან დააყენეთ, რათა თქვენი ტელეფონი თითის ანაბეჭდის საშუალებით განბლოკოთ."</string>
+ <string name="fingerprint_dangling_notification_msg_all_deleted_2" msgid="6897989352716156176">"<xliff:g id="FINGERPRINT_0">%1$s</xliff:g> და <xliff:g id="FINGERPRINT_1">%2$s</xliff:g> კარგად არ მუშაობდნენ და წაიშალა. თავიდან დააყენეთ, რათა თქვენი ტელეფონი თითის ანაბეჭდის საშუალებით განბლოკოთ."</string>
+ <string name="face_dangling_notification_title" msgid="947852541060975473">"დააყენეთ სახით განბლოკვა ხელახლა"</string>
+ <string name="face_dangling_notification_msg" msgid="8806849376915541655">"თქვენი სახის მოდელი კარგად არ მუშაობდა და წაიშალა. თავიდან დააყენეთ, რათა თქვენი ტელეფონი სახის საშუალებით განბლოკოთ."</string>
+ <string name="biometric_dangling_notification_action_set_up" msgid="8246885009807817961">"დაყენება"</string>
+ <string name="biometric_dangling_notification_action_not_now" msgid="8095249216864443491">"ახლა არა"</string>
</resources>
diff --git a/core/res/res/values-kk/strings.xml b/core/res/res/values-kk/strings.xml
index 55cf92bb3280..e407c09b5a4e 100644
--- a/core/res/res/values-kk/strings.xml
+++ b/core/res/res/values-kk/strings.xml
@@ -283,6 +283,8 @@
<string name="global_action_voice_assist" msgid="6655788068555086695">"Дауыс көмекшісі"</string>
<string name="global_action_lockdown" msgid="2475471405907902963">"Құлыптау"</string>
<string name="status_bar_notification_info_overflow" msgid="3330152558746563475">"999+"</string>
+ <!-- no translation found for notification_compact_heads_up_reply (2425293958371284340) -->
+ <skip />
<string name="notification_hidden_text" msgid="2835519769868187223">"Жаңа хабарландыру"</string>
<string name="notification_channel_physical_keyboard" msgid="5417306456125988096">"Физикалық пернетақта"</string>
<string name="notification_channel_security" msgid="8516754650348238057">"Қауіпсіздік"</string>
@@ -2413,22 +2415,15 @@
<string name="satellite_notification_open_message" msgid="4149234979688273729">"Messages қолданбасын ашу"</string>
<string name="satellite_notification_how_it_works" msgid="3132069321977520519">"Бұл қалай орындалады?"</string>
<string name="unarchival_session_app_label" msgid="6811856981546348205">"Дайын емес…"</string>
- <!-- no translation found for fingerprint_dangling_notification_title (7362075195588639989) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_1 (6261149111900787302) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_2 (7688302770424064884) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_1 (2927018569542316055) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_2 (6897989352716156176) -->
- <skip />
- <!-- no translation found for face_dangling_notification_title (947852541060975473) -->
- <skip />
- <!-- no translation found for face_dangling_notification_msg (8806849376915541655) -->
- <skip />
- <!-- no translation found for biometric_dangling_notification_action_set_up (8246885009807817961) -->
+ <string name="fingerprint_dangling_notification_title" msgid="7362075195588639989">"Саусақ ізімен ашу функциясын қайта реттеу"</string>
+ <!-- no translation found for fingerprint_dangling_notification_msg_1 (8517140433796229725) -->
<skip />
- <!-- no translation found for biometric_dangling_notification_action_not_now (8095249216864443491) -->
+ <!-- no translation found for fingerprint_dangling_notification_msg_2 (7578829498452127613) -->
<skip />
+ <string name="fingerprint_dangling_notification_msg_all_deleted_1" msgid="2927018569542316055">"<xliff:g id="FINGERPRINT">%s</xliff:g> саусақ ізі дұрыс істемегендіктен жойылды. Телефонды саусақ ізімен ашу үшін оны қайта реттеңіз."</string>
+ <string name="fingerprint_dangling_notification_msg_all_deleted_2" msgid="6897989352716156176">"Саусақ іздері (<xliff:g id="FINGERPRINT_0">%1$s</xliff:g> және <xliff:g id="FINGERPRINT_1">%2$s</xliff:g>) дұрыс істемегендіктен жойылды. Телефонды саусақ ізімен ашу үшін оларды қайта реттеңіз."</string>
+ <string name="face_dangling_notification_title" msgid="947852541060975473">"Бет тану функциясын қайта реттеу"</string>
+ <string name="face_dangling_notification_msg" msgid="8806849376915541655">"Бет үлгісі дұрыс істемегендіктен жойылды. Телефонды бетпен ашу үшін оны қайта реттеңіз."</string>
+ <string name="biometric_dangling_notification_action_set_up" msgid="8246885009807817961">"Реттеу"</string>
+ <string name="biometric_dangling_notification_action_not_now" msgid="8095249216864443491">"Қазір емес"</string>
</resources>
diff --git a/core/res/res/values-km/strings.xml b/core/res/res/values-km/strings.xml
index 6a826db47006..4fe436890a22 100644
--- a/core/res/res/values-km/strings.xml
+++ b/core/res/res/values-km/strings.xml
@@ -283,6 +283,8 @@
<string name="global_action_voice_assist" msgid="6655788068555086695">"ជំនួយសម្លេង"</string>
<string name="global_action_lockdown" msgid="2475471405907902963">"ការចាក់​សោ"</string>
<string name="status_bar_notification_info_overflow" msgid="3330152558746563475">"999+"</string>
+ <!-- no translation found for notification_compact_heads_up_reply (2425293958371284340) -->
+ <skip />
<string name="notification_hidden_text" msgid="2835519769868187223">"ការជូនដំណឹងថ្មី"</string>
<string name="notification_channel_physical_keyboard" msgid="5417306456125988096">"ក្ដារចុច​រូបវន្ត"</string>
<string name="notification_channel_security" msgid="8516754650348238057">"សុវត្ថិភាព"</string>
@@ -2413,22 +2415,15 @@
<string name="satellite_notification_open_message" msgid="4149234979688273729">"បើក​កម្មវិធី Messages"</string>
<string name="satellite_notification_how_it_works" msgid="3132069321977520519">"របៀបដែលវាដំណើរការ"</string>
<string name="unarchival_session_app_label" msgid="6811856981546348205">"កំពុងរង់ចាំ..."</string>
- <!-- no translation found for fingerprint_dangling_notification_title (7362075195588639989) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_1 (6261149111900787302) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_2 (7688302770424064884) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_1 (2927018569542316055) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_2 (6897989352716156176) -->
- <skip />
- <!-- no translation found for face_dangling_notification_title (947852541060975473) -->
- <skip />
- <!-- no translation found for face_dangling_notification_msg (8806849376915541655) -->
- <skip />
- <!-- no translation found for biometric_dangling_notification_action_set_up (8246885009807817961) -->
+ <string name="fingerprint_dangling_notification_title" msgid="7362075195588639989">"រៀបចំការដោះសោ​ដោយស្កេន​ស្នាមម្រាមដៃម្ដងទៀត"</string>
+ <!-- no translation found for fingerprint_dangling_notification_msg_1 (8517140433796229725) -->
<skip />
- <!-- no translation found for biometric_dangling_notification_action_not_now (8095249216864443491) -->
+ <!-- no translation found for fingerprint_dangling_notification_msg_2 (7578829498452127613) -->
<skip />
+ <string name="fingerprint_dangling_notification_msg_all_deleted_1" msgid="2927018569542316055">"<xliff:g id="FINGERPRINT">%s</xliff:g> មិនដំណើរការល្អទេ ហើយត្រូវបានលុបចេញហើយ។ រៀបចំវាម្ដងទៀត ដើម្បីដោះសោទូរសព្ទរបស់អ្នកដោយប្រើស្នាមម្រាមដៃ។"</string>
+ <string name="fingerprint_dangling_notification_msg_all_deleted_2" msgid="6897989352716156176">"<xliff:g id="FINGERPRINT_0">%1$s</xliff:g> និង <xliff:g id="FINGERPRINT_1">%2$s</xliff:g> មិនដំណើរការល្អទេ ហើយត្រូវបានលុបចេញហើយ។ រៀបចំវាម្ដងទៀត ដើម្បីដោះសោទូរសព្ទរបស់អ្នកដោយប្រើស្នាមម្រាមដៃ។"</string>
+ <string name="face_dangling_notification_title" msgid="947852541060975473">"រៀបចំ​ការដោះ​សោ​ដោយស្កេន​មុខម្ដងទៀត"</string>
+ <string name="face_dangling_notification_msg" msgid="8806849376915541655">"គំរូមុខរបស់អ្នកមិនដំណើរការល្អទេ ហើយត្រូវបានលុបចេញហើយ។ រៀបចំវាម្ដងទៀត ដើម្បីដោះសោទូរសព្ទរបស់អ្នកដោយប្រើមុខ។"</string>
+ <string name="biometric_dangling_notification_action_set_up" msgid="8246885009807817961">"រៀបចំ"</string>
+ <string name="biometric_dangling_notification_action_not_now" msgid="8095249216864443491">"កុំទាន់"</string>
</resources>
diff --git a/core/res/res/values-kn/strings.xml b/core/res/res/values-kn/strings.xml
index 40d513893dda..3223c4089d68 100644
--- a/core/res/res/values-kn/strings.xml
+++ b/core/res/res/values-kn/strings.xml
@@ -283,6 +283,8 @@
<string name="global_action_voice_assist" msgid="6655788068555086695">"ಧ್ವನಿ ಸಹಾಯಕ"</string>
<string name="global_action_lockdown" msgid="2475471405907902963">"ಲಾಕ್‌ಡೌನ್‌"</string>
<string name="status_bar_notification_info_overflow" msgid="3330152558746563475">"999+"</string>
+ <!-- no translation found for notification_compact_heads_up_reply (2425293958371284340) -->
+ <skip />
<string name="notification_hidden_text" msgid="2835519769868187223">"ಹೊಸ ನೋಟಿಫಿಕೇಶನ್‍"</string>
<string name="notification_channel_physical_keyboard" msgid="5417306456125988096">"ಭೌತಿಕ ಕೀಬೋರ್ಡ್‌"</string>
<string name="notification_channel_security" msgid="8516754650348238057">"ಭದ್ರತೆ"</string>
@@ -2413,22 +2415,15 @@
<string name="satellite_notification_open_message" msgid="4149234979688273729">"Messages ಅನ್ನು ತೆರೆಯಿರಿ"</string>
<string name="satellite_notification_how_it_works" msgid="3132069321977520519">"ಇದು ಹೇಗೆ ಕೆಲಸ ಮಾಡುತ್ತದೆ"</string>
<string name="unarchival_session_app_label" msgid="6811856981546348205">"ಬಾಕಿ ಉಳಿದಿದೆ..."</string>
- <!-- no translation found for fingerprint_dangling_notification_title (7362075195588639989) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_1 (6261149111900787302) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_2 (7688302770424064884) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_1 (2927018569542316055) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_2 (6897989352716156176) -->
- <skip />
- <!-- no translation found for face_dangling_notification_title (947852541060975473) -->
- <skip />
- <!-- no translation found for face_dangling_notification_msg (8806849376915541655) -->
- <skip />
- <!-- no translation found for biometric_dangling_notification_action_set_up (8246885009807817961) -->
+ <string name="fingerprint_dangling_notification_title" msgid="7362075195588639989">"ಫಿಂಗರ್‌ಪ್ರಿಂಟ್ ಅನ್‌ಲಾಕ್ ಅನ್ನು ಮತ್ತೊಮ್ಮೆ ಸೆಟಪ್ ಮಾಡಿ"</string>
+ <!-- no translation found for fingerprint_dangling_notification_msg_1 (8517140433796229725) -->
<skip />
- <!-- no translation found for biometric_dangling_notification_action_not_now (8095249216864443491) -->
+ <!-- no translation found for fingerprint_dangling_notification_msg_2 (7578829498452127613) -->
<skip />
+ <string name="fingerprint_dangling_notification_msg_all_deleted_1" msgid="2927018569542316055">"<xliff:g id="FINGERPRINT">%s</xliff:g> ಸರಿಯಾಗಿ ಕಾರ್ಯನಿರ್ವಹಿಸುತ್ತಿಲ್ಲ ಹಾಗೂ ಅದನ್ನು ಅಳಿಸಲಾಗಿದೆ. ಫಿಂಗರ್‌ ಪ್ರಿಂಟ್ ಮೂಲಕ ನಿಮ್ಮ ಫೋನ್ ಅನ್ನು ಅನ್‌ಲಾಕ್ ಮಾಡಲು ಅದನ್ನು ಪುನಃ ಸೆಟಪ್‌ ಮಾಡಿ."</string>
+ <string name="fingerprint_dangling_notification_msg_all_deleted_2" msgid="6897989352716156176">"<xliff:g id="FINGERPRINT_0">%1$s</xliff:g> ಮತ್ತು <xliff:g id="FINGERPRINT_1">%2$s</xliff:g> ಸರಿಯಾಗಿ ಕಾರ್ಯನಿರ್ವಹಿಸುತ್ತಿಲ್ಲ ಹಾಗೂ ಅವುಗಳನ್ನು ಅಳಿಸಲಾಗಿದೆ. ನಿಮ್ಮ ಫಿಂಗರ್‌ ಪ್ರಿಂಟ್ ಮೂಲಕ ನಿಮ್ಮ ಫೋನ್ ಅನ್‌ಲಾಕ್ ಮಾಡಲು ಅವುಗಳನ್ನು ಪುನಃ ಸೆಟಪ್‌ ಮಾಡಿ."</string>
+ <string name="face_dangling_notification_title" msgid="947852541060975473">"ಫೇಸ್ ಅನ್‌ಲಾಕ್ ಅನ್ನು ಮತ್ತೊಮ್ಮೆ ಸೆಟಪ್ ಮಾಡಿ"</string>
+ <string name="face_dangling_notification_msg" msgid="8806849376915541655">"ನಿಮ್ಮ ಫೇಸ್ ಮಾಡೆಲ್ ಸರಿಯಾಗಿ ಕಾರ್ಯನಿರ್ವಹಿಸುತ್ತಿಲ್ಲ ಹಾಗೂ ಅದನ್ನು ಅಳಿಸಲಾಗಿದೆ. ಫೇಸ್ ಮೂಲಕ ನಿಮ್ಮ ಫೋನ್ ಅನ್ನು ಅನ್‌ಲಾಕ್ ಮಾಡಲು ಅದನ್ನು ಪುನಃ ಸೆಟಪ್‌ ಮಾಡಿ."</string>
+ <string name="biometric_dangling_notification_action_set_up" msgid="8246885009807817961">"ಸೆಟಪ್ ಮಾಡಿ"</string>
+ <string name="biometric_dangling_notification_action_not_now" msgid="8095249216864443491">"ಈಗ ಬೇಡ"</string>
</resources>
diff --git a/core/res/res/values-ko/strings.xml b/core/res/res/values-ko/strings.xml
index dd476281eec9..7a8d324f0950 100644
--- a/core/res/res/values-ko/strings.xml
+++ b/core/res/res/values-ko/strings.xml
@@ -283,6 +283,8 @@
<string name="global_action_voice_assist" msgid="6655788068555086695">"음성 지원"</string>
<string name="global_action_lockdown" msgid="2475471405907902963">"잠금"</string>
<string name="status_bar_notification_info_overflow" msgid="3330152558746563475">"999+"</string>
+ <!-- no translation found for notification_compact_heads_up_reply (2425293958371284340) -->
+ <skip />
<string name="notification_hidden_text" msgid="2835519769868187223">"새 알림"</string>
<string name="notification_channel_physical_keyboard" msgid="5417306456125988096">"물리적 키보드"</string>
<string name="notification_channel_security" msgid="8516754650348238057">"보안"</string>
@@ -1388,7 +1390,7 @@
<string name="no_permissions" msgid="5729199278862516390">"권한 필요 없음"</string>
<string name="perm_costs_money" msgid="749054595022779685">"비용이 부과될 수 있습니다."</string>
<string name="dlg_ok" msgid="5103447663504839312">"확인"</string>
- <string name="usb_charging_notification_title" msgid="1674124518282666955">"이 기기를 USB로 충전 중."</string>
+ <string name="usb_charging_notification_title" msgid="1674124518282666955">"이 기기를 USB로 충전 중"</string>
<string name="usb_supplying_notification_title" msgid="5378546632408101811">"USB를 통해 연결된 기기 충전"</string>
<string name="usb_mtp_notification_title" msgid="1065989144124499810">"USB 파일 전송 사용 설정됨"</string>
<string name="usb_ptp_notification_title" msgid="5043437571863443281">"USB를 통해 PTP 사용 설정됨"</string>
@@ -2413,22 +2415,15 @@
<string name="satellite_notification_open_message" msgid="4149234979688273729">"메시지 열기"</string>
<string name="satellite_notification_how_it_works" msgid="3132069321977520519">"작동 방식"</string>
<string name="unarchival_session_app_label" msgid="6811856981546348205">"대기 중…"</string>
- <!-- no translation found for fingerprint_dangling_notification_title (7362075195588639989) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_1 (6261149111900787302) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_2 (7688302770424064884) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_1 (2927018569542316055) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_2 (6897989352716156176) -->
- <skip />
- <!-- no translation found for face_dangling_notification_title (947852541060975473) -->
- <skip />
- <!-- no translation found for face_dangling_notification_msg (8806849376915541655) -->
- <skip />
- <!-- no translation found for biometric_dangling_notification_action_set_up (8246885009807817961) -->
+ <string name="fingerprint_dangling_notification_title" msgid="7362075195588639989">"지문 잠금 해제 다시 설정"</string>
+ <!-- no translation found for fingerprint_dangling_notification_msg_1 (8517140433796229725) -->
<skip />
- <!-- no translation found for biometric_dangling_notification_action_not_now (8095249216864443491) -->
+ <!-- no translation found for fingerprint_dangling_notification_msg_2 (7578829498452127613) -->
<skip />
+ <string name="fingerprint_dangling_notification_msg_all_deleted_1" msgid="2927018569542316055">"<xliff:g id="FINGERPRINT">%s</xliff:g>이(가) 제대로 작동하지 않아 삭제되었습니다. 지문으로 휴대전화를 잠금 해제하려면 다시 설정하세요."</string>
+ <string name="fingerprint_dangling_notification_msg_all_deleted_2" msgid="6897989352716156176">"<xliff:g id="FINGERPRINT_0">%1$s</xliff:g> 및 <xliff:g id="FINGERPRINT_1">%2$s</xliff:g>이(가) 제대로 작동하지 않아 삭제되었습니다. 지문으로 휴대전화를 잠금 해제하려면 다시 설정하세요."</string>
+ <string name="face_dangling_notification_title" msgid="947852541060975473">"얼굴 인식 잠금 해제 다시 설정"</string>
+ <string name="face_dangling_notification_msg" msgid="8806849376915541655">"얼굴 모델이 제대로 작동하지 않아 삭제되었습니다. 얼굴로 휴대전화를 잠금 해제하려면 다시 설정하세요."</string>
+ <string name="biometric_dangling_notification_action_set_up" msgid="8246885009807817961">"설정"</string>
+ <string name="biometric_dangling_notification_action_not_now" msgid="8095249216864443491">"나중에"</string>
</resources>
diff --git a/core/res/res/values-ky/strings.xml b/core/res/res/values-ky/strings.xml
index bb29c36a0410..8a233a3108a4 100644
--- a/core/res/res/values-ky/strings.xml
+++ b/core/res/res/values-ky/strings.xml
@@ -283,6 +283,8 @@
<string name="global_action_voice_assist" msgid="6655788068555086695">"Үн жардамчысы"</string>
<string name="global_action_lockdown" msgid="2475471405907902963">"Бекем кулпулоо"</string>
<string name="status_bar_notification_info_overflow" msgid="3330152558746563475">"999+"</string>
+ <!-- no translation found for notification_compact_heads_up_reply (2425293958371284340) -->
+ <skip />
<string name="notification_hidden_text" msgid="2835519769868187223">"Жаңы эскертме"</string>
<string name="notification_channel_physical_keyboard" msgid="5417306456125988096">"Аппараттык баскычтоп"</string>
<string name="notification_channel_security" msgid="8516754650348238057">"Коопсуздук"</string>
@@ -2413,22 +2415,15 @@
<string name="satellite_notification_open_message" msgid="4149234979688273729">"Жазышуулар колдонмосун ачуу"</string>
<string name="satellite_notification_how_it_works" msgid="3132069321977520519">"Ал кантип иштейт"</string>
<string name="unarchival_session_app_label" msgid="6811856981546348205">"Кезекте турат..."</string>
- <!-- no translation found for fingerprint_dangling_notification_title (7362075195588639989) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_1 (6261149111900787302) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_2 (7688302770424064884) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_1 (2927018569542316055) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_2 (6897989352716156176) -->
- <skip />
- <!-- no translation found for face_dangling_notification_title (947852541060975473) -->
- <skip />
- <!-- no translation found for face_dangling_notification_msg (8806849376915541655) -->
- <skip />
- <!-- no translation found for biometric_dangling_notification_action_set_up (8246885009807817961) -->
+ <string name="fingerprint_dangling_notification_title" msgid="7362075195588639989">"Манжа изи менен ачуу функциясын кайра тууралаңыз"</string>
+ <!-- no translation found for fingerprint_dangling_notification_msg_1 (8517140433796229725) -->
<skip />
- <!-- no translation found for biometric_dangling_notification_action_not_now (8095249216864443491) -->
+ <!-- no translation found for fingerprint_dangling_notification_msg_2 (7578829498452127613) -->
<skip />
+ <string name="fingerprint_dangling_notification_msg_all_deleted_1" msgid="2927018569542316055">"<xliff:g id="FINGERPRINT">%s</xliff:g> ойдогудай иштебегендиктен, жок кылынды. Телефондо Манжа изи менен ачуу функциясын колдонуу үчүн аны кайра тууралаңыз."</string>
+ <string name="fingerprint_dangling_notification_msg_all_deleted_2" msgid="6897989352716156176">"<xliff:g id="FINGERPRINT_0">%1$s</xliff:g> жана <xliff:g id="FINGERPRINT_1">%2$s</xliff:g> ойдогудай иштебегендиктен, жок кылынды. Телефонду манжа изи менен ачуу үчүн аларды кайра тууралаңыз."</string>
+ <string name="face_dangling_notification_title" msgid="947852541060975473">"Жүзүнөн таанып ачуу функциясын кайрадан тууралаңыз"</string>
+ <string name="face_dangling_notification_msg" msgid="8806849376915541655">"Жүзүңүздүн үлгүсү ойдогудай иштебегендиктен, жок кылынды. Телефондо Жүзүнөн таанып ачуу функциясын колдонуу үчүн аны кайра тууралаңыз."</string>
+ <string name="biometric_dangling_notification_action_set_up" msgid="8246885009807817961">"Тууралоо"</string>
+ <string name="biometric_dangling_notification_action_not_now" msgid="8095249216864443491">"Азыр эмес"</string>
</resources>
diff --git a/core/res/res/values-lo/strings.xml b/core/res/res/values-lo/strings.xml
index 5fa0fc135612..3e06b3da8ddc 100644
--- a/core/res/res/values-lo/strings.xml
+++ b/core/res/res/values-lo/strings.xml
@@ -283,6 +283,8 @@
<string name="global_action_voice_assist" msgid="6655788068555086695">"ຊ່ວຍ​ເຫຼືອ​ທາງ​ສຽງ"</string>
<string name="global_action_lockdown" msgid="2475471405907902963">"ລັອກໄວ້"</string>
<string name="status_bar_notification_info_overflow" msgid="3330152558746563475">"999+"</string>
+ <!-- no translation found for notification_compact_heads_up_reply (2425293958371284340) -->
+ <skip />
<string name="notification_hidden_text" msgid="2835519769868187223">"ການແຈ້ງເຕືອນໃໝ່"</string>
<string name="notification_channel_physical_keyboard" msgid="5417306456125988096">"ແປ້ນພິມພາຍນອກ"</string>
<string name="notification_channel_security" msgid="8516754650348238057">"ຄວາມປອດໄພ"</string>
@@ -2394,7 +2396,7 @@
<string name="keyboard_layout_notification_more_than_three_selected_message" msgid="1581834181578206937">"ຕັ້ງໂຄງຮ່າງແປ້ນພິມເປັນ <xliff:g id="LAYOUT_1">%1$s</xliff:g>, <xliff:g id="LAYOUT_2">%2$s</xliff:g>, <xliff:g id="LAYOUT_3">%3$s</xliff:g>… ແຕະເພື່ອປ່ຽນແປງ."</string>
<string name="keyboard_layout_notification_multiple_selected_title" msgid="5242444914367024499">"ຕັ້ງຄ່າແປ້ນພິມແທ້ແລ້ວ"</string>
<string name="keyboard_layout_notification_multiple_selected_message" msgid="6576533454124419202">"ແຕະເພື່ອເບິ່ງແປ້ນພິມ"</string>
- <string name="profile_label_private" msgid="6463418670715290696">"ສ່ວນຕົວ"</string>
+ <string name="profile_label_private" msgid="6463418670715290696">"ສ່ວນບຸກຄົນ"</string>
<string name="profile_label_clone" msgid="769106052210954285">"ໂຄລນ"</string>
<string name="profile_label_work" msgid="3495359133038584618">"ວຽກ"</string>
<string name="profile_label_work_2" msgid="4691533661598632135">"ວຽກ 2"</string>
@@ -2413,22 +2415,15 @@
<string name="satellite_notification_open_message" msgid="4149234979688273729">"ເປີດ Messages"</string>
<string name="satellite_notification_how_it_works" msgid="3132069321977520519">"ມັນເຮັດວຽກແນວໃດ"</string>
<string name="unarchival_session_app_label" msgid="6811856981546348205">"ລໍຖ້າດຳເນີນການ..."</string>
- <!-- no translation found for fingerprint_dangling_notification_title (7362075195588639989) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_1 (6261149111900787302) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_2 (7688302770424064884) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_1 (2927018569542316055) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_2 (6897989352716156176) -->
- <skip />
- <!-- no translation found for face_dangling_notification_title (947852541060975473) -->
- <skip />
- <!-- no translation found for face_dangling_notification_msg (8806849376915541655) -->
- <skip />
- <!-- no translation found for biometric_dangling_notification_action_set_up (8246885009807817961) -->
+ <string name="fingerprint_dangling_notification_title" msgid="7362075195588639989">"ຕັ້ງຄ່າການປົດລັອກດ້ວຍລາຍນິ້ວມືຄືນໃໝ່"</string>
+ <!-- no translation found for fingerprint_dangling_notification_msg_1 (8517140433796229725) -->
<skip />
- <!-- no translation found for biometric_dangling_notification_action_not_now (8095249216864443491) -->
+ <!-- no translation found for fingerprint_dangling_notification_msg_2 (7578829498452127613) -->
<skip />
+ <string name="fingerprint_dangling_notification_msg_all_deleted_1" msgid="2927018569542316055">"<xliff:g id="FINGERPRINT">%s</xliff:g> ເຮັດວຽກໄດ້ບໍ່ດີ ແລະ ຖືກລຶບອອກແລ້ວ. ໃຫ້ຕັ້ງຄ່າມັນຄືນໃໝ່ເພື່ອປົດລັອກໂທລະສັບຂອງທ່ານດ້ວຍລາຍນິ້ວມື."</string>
+ <string name="fingerprint_dangling_notification_msg_all_deleted_2" msgid="6897989352716156176">"<xliff:g id="FINGERPRINT_0">%1$s</xliff:g> ແລະ <xliff:g id="FINGERPRINT_1">%2$s</xliff:g> ເຮັດວຽກໄດ້ບໍ່ດີ ແລະ ຖືກລຶບອອກແລ້ວ. ໃຫ້ຕັ້ງຄ່າພວກມັນຄືນໃໝ່ເພື່ອປົດລັອກໂທລະສັບຂອງທ່ານດ້ວຍລາຍນິ້ວມື."</string>
+ <string name="face_dangling_notification_title" msgid="947852541060975473">"ຕັ້ງຄ່າການປົດລັອກດ້ວຍໜ້າຄືນໃໝ່"</string>
+ <string name="face_dangling_notification_msg" msgid="8806849376915541655">"ຮູບແບບໃບໜ້າຂອງທ່ານເຮັດວຽກໄດ້ບໍ່ດີ ແລະ ຖືກລຶບອອກແລ້ວ. ໃຫ້ຕັ້ງຄ່າມັນຄືນໃໝ່ເພື່ອປົດລັອກໂທລະສັບຂອງທ່ານດ້ວຍໃບໜ້າ."</string>
+ <string name="biometric_dangling_notification_action_set_up" msgid="8246885009807817961">"ຕັ້ງຄ່າ"</string>
+ <string name="biometric_dangling_notification_action_not_now" msgid="8095249216864443491">"ບໍ່ຟ້າວເທື່ອ"</string>
</resources>
diff --git a/core/res/res/values-lt/strings.xml b/core/res/res/values-lt/strings.xml
index e06c2efe31b8..50572f80e723 100644
--- a/core/res/res/values-lt/strings.xml
+++ b/core/res/res/values-lt/strings.xml
@@ -285,6 +285,8 @@
<string name="global_action_voice_assist" msgid="6655788068555086695">"Voice Assist"</string>
<string name="global_action_lockdown" msgid="2475471405907902963">"Užrakinimas"</string>
<string name="status_bar_notification_info_overflow" msgid="3330152558746563475">"999+"</string>
+ <!-- no translation found for notification_compact_heads_up_reply (2425293958371284340) -->
+ <skip />
<string name="notification_hidden_text" msgid="2835519769868187223">"Naujas pranešimas"</string>
<string name="notification_channel_physical_keyboard" msgid="5417306456125988096">"Fizinė klaviatūra"</string>
<string name="notification_channel_security" msgid="8516754650348238057">"Sauga"</string>
@@ -2415,22 +2417,15 @@
<string name="satellite_notification_open_message" msgid="4149234979688273729">"Atidaryti programą „Messages“"</string>
<string name="satellite_notification_how_it_works" msgid="3132069321977520519">"Kaip tai veikia"</string>
<string name="unarchival_session_app_label" msgid="6811856981546348205">"Laukiama..."</string>
- <!-- no translation found for fingerprint_dangling_notification_title (7362075195588639989) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_1 (6261149111900787302) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_2 (7688302770424064884) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_1 (2927018569542316055) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_2 (6897989352716156176) -->
- <skip />
- <!-- no translation found for face_dangling_notification_title (947852541060975473) -->
- <skip />
- <!-- no translation found for face_dangling_notification_msg (8806849376915541655) -->
- <skip />
- <!-- no translation found for biometric_dangling_notification_action_set_up (8246885009807817961) -->
+ <string name="fingerprint_dangling_notification_title" msgid="7362075195588639989">"Atrakinimo piršto atspaudu nustatymas dar kartą"</string>
+ <!-- no translation found for fingerprint_dangling_notification_msg_1 (8517140433796229725) -->
<skip />
- <!-- no translation found for biometric_dangling_notification_action_not_now (8095249216864443491) -->
+ <!-- no translation found for fingerprint_dangling_notification_msg_2 (7578829498452127613) -->
<skip />
+ <string name="fingerprint_dangling_notification_msg_all_deleted_1" msgid="2927018569542316055">"<xliff:g id="FINGERPRINT">%s</xliff:g> neveikė tinkamai ir buvo ištrintas. Nustatykite jį dar kartą, kad atrakintumėte telefoną piršto atspaudu."</string>
+ <string name="fingerprint_dangling_notification_msg_all_deleted_2" msgid="6897989352716156176">"<xliff:g id="FINGERPRINT_0">%1$s</xliff:g> ir <xliff:g id="FINGERPRINT_1">%2$s</xliff:g> neveikė tinkamai ir buvo ištrinti. Nustatykite juos dar kartą, kad atrakintumėte telefoną piršto atspaudu."</string>
+ <string name="face_dangling_notification_title" msgid="947852541060975473">"Atrakinimo pagal veidą nustatymas iš naujo"</string>
+ <string name="face_dangling_notification_msg" msgid="8806849376915541655">"Jūsų veido modelis neveikė tinkamai ir buvo ištrintas. Nustatykite jį dar kartą, kad atrakintumėte telefoną pagal veidą."</string>
+ <string name="biometric_dangling_notification_action_set_up" msgid="8246885009807817961">"Nustatyti"</string>
+ <string name="biometric_dangling_notification_action_not_now" msgid="8095249216864443491">"Ne dabar"</string>
</resources>
diff --git a/core/res/res/values-lv/strings.xml b/core/res/res/values-lv/strings.xml
index d2a6cd9af5a6..8be327da1aeb 100644
--- a/core/res/res/values-lv/strings.xml
+++ b/core/res/res/values-lv/strings.xml
@@ -284,6 +284,8 @@
<string name="global_action_voice_assist" msgid="6655788068555086695">"Balss palīgs"</string>
<string name="global_action_lockdown" msgid="2475471405907902963">"Bloķēšana"</string>
<string name="status_bar_notification_info_overflow" msgid="3330152558746563475">"Pārsniedz"</string>
+ <!-- no translation found for notification_compact_heads_up_reply (2425293958371284340) -->
+ <skip />
<string name="notification_hidden_text" msgid="2835519769868187223">"Jauns paziņojums"</string>
<string name="notification_channel_physical_keyboard" msgid="5417306456125988096">"Fiziskā tastatūra"</string>
<string name="notification_channel_security" msgid="8516754650348238057">"Drošība"</string>
@@ -2414,22 +2416,15 @@
<string name="satellite_notification_open_message" msgid="4149234979688273729">"Atvērt lietotni Ziņojumi"</string>
<string name="satellite_notification_how_it_works" msgid="3132069321977520519">"Darbības principi"</string>
<string name="unarchival_session_app_label" msgid="6811856981546348205">"Gaida…"</string>
- <!-- no translation found for fingerprint_dangling_notification_title (7362075195588639989) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_1 (6261149111900787302) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_2 (7688302770424064884) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_1 (2927018569542316055) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_2 (6897989352716156176) -->
- <skip />
- <!-- no translation found for face_dangling_notification_title (947852541060975473) -->
- <skip />
- <!-- no translation found for face_dangling_notification_msg (8806849376915541655) -->
- <skip />
- <!-- no translation found for biometric_dangling_notification_action_set_up (8246885009807817961) -->
+ <string name="fingerprint_dangling_notification_title" msgid="7362075195588639989">"Vēlreiz iestatiet autorizāciju ar pirksta nospiedumu"</string>
+ <!-- no translation found for fingerprint_dangling_notification_msg_1 (8517140433796229725) -->
<skip />
- <!-- no translation found for biometric_dangling_notification_action_not_now (8095249216864443491) -->
+ <!-- no translation found for fingerprint_dangling_notification_msg_2 (7578829498452127613) -->
<skip />
+ <string name="fingerprint_dangling_notification_msg_all_deleted_1" msgid="2927018569542316055">"<xliff:g id="FINGERPRINT">%s</xliff:g> nedarbojās pareizi un tika izdzēsts. Iestatiet to atkal, lai varētu atbloķēt tālruni ar pirksta nospiedumu."</string>
+ <string name="fingerprint_dangling_notification_msg_all_deleted_2" msgid="6897989352716156176">"<xliff:g id="FINGERPRINT_0">%1$s</xliff:g> un <xliff:g id="FINGERPRINT_1">%2$s</xliff:g> nedarbojās pareizi un tika izdzēsti. Iestatiet tos atkal, lai varētu atbloķētu tālruni ar pirksta nospiedumu."</string>
+ <string name="face_dangling_notification_title" msgid="947852541060975473">"Vēlreiz iestatiet autorizāciju pēc sejas"</string>
+ <string name="face_dangling_notification_msg" msgid="8806849376915541655">"Jūsu sejas modelis nedarbojās pareizi un tika izdzēsts. Iestatiet to atkal, lai varētu atbloķēt tālruni ar seju."</string>
+ <string name="biometric_dangling_notification_action_set_up" msgid="8246885009807817961">"Iestatīt"</string>
+ <string name="biometric_dangling_notification_action_not_now" msgid="8095249216864443491">"Ne tagad"</string>
</resources>
diff --git a/core/res/res/values-mk/strings.xml b/core/res/res/values-mk/strings.xml
index 796f9efe1bbc..680ff0a4b1b1 100644
--- a/core/res/res/values-mk/strings.xml
+++ b/core/res/res/values-mk/strings.xml
@@ -153,7 +153,7 @@
<string name="cfTemplateForwardedTime" msgid="735042369233323609">"<xliff:g id="BEARER_SERVICE_CODE">{0}</xliff:g>: <xliff:g id="DIALING_NUMBER">{1}</xliff:g> по <xliff:g id="TIME_DELAY">{2}</xliff:g> секунди"</string>
<string name="cfTemplateRegistered" msgid="5619930473441550596">"<xliff:g id="BEARER_SERVICE_CODE">{0}</xliff:g>: не е препратено"</string>
<string name="cfTemplateRegisteredTime" msgid="5222794399642525045">"<xliff:g id="BEARER_SERVICE_CODE">{0}</xliff:g>: не е проследен"</string>
- <string name="scCellularNetworkSecurityTitle" msgid="7752521808690294384">"Безбедност на мобилна мрежа"</string>
+ <string name="scCellularNetworkSecurityTitle" msgid="7752521808690294384">"Безбедност на мобилната мрежа"</string>
<string name="scCellularNetworkSecuritySummary" msgid="7042036754550545005">"Шифрирање, известувања за нешифрирани мрежи"</string>
<string name="scIdentifierDisclosureIssueTitle" msgid="2898888825129970328">"Пристапено е до ID на уредот"</string>
<string name="scIdentifierDisclosureIssueSummaryNotification" msgid="3699930821270580416">"Во <xliff:g id="DISCLOSURE_TIME">%1$s</xliff:g>, мрежа во близина го сними уникатниот ID (IMSI или IMEI) на вашиот телефон со користење на вашата SIM-картичка на <xliff:g id="DISCLOSURE_NETWORK">%2$s</xliff:g>"</string>
@@ -283,6 +283,8 @@
<string name="global_action_voice_assist" msgid="6655788068555086695">"Гласовна помош"</string>
<string name="global_action_lockdown" msgid="2475471405907902963">"Заклучување"</string>
<string name="status_bar_notification_info_overflow" msgid="3330152558746563475">"999+"</string>
+ <!-- no translation found for notification_compact_heads_up_reply (2425293958371284340) -->
+ <skip />
<string name="notification_hidden_text" msgid="2835519769868187223">"Ново известување"</string>
<string name="notification_channel_physical_keyboard" msgid="5417306456125988096">"Физичка тастатура"</string>
<string name="notification_channel_security" msgid="8516754650348238057">"Безбедност"</string>
@@ -2394,9 +2396,9 @@
<string name="keyboard_layout_notification_more_than_three_selected_message" msgid="1581834181578206937">"Распоредот на тастатурата е поставен на <xliff:g id="LAYOUT_1">%1$s</xliff:g>, <xliff:g id="LAYOUT_2">%2$s</xliff:g>, <xliff:g id="LAYOUT_3">%3$s</xliff:g>… Допрете за да промените."</string>
<string name="keyboard_layout_notification_multiple_selected_title" msgid="5242444914367024499">"Физичките тастатури се конфигурирани"</string>
<string name="keyboard_layout_notification_multiple_selected_message" msgid="6576533454124419202">"Допрете за да ги видите тастатурите"</string>
- <string name="profile_label_private" msgid="6463418670715290696">"Приватен профил"</string>
+ <string name="profile_label_private" msgid="6463418670715290696">"Приватно"</string>
<string name="profile_label_clone" msgid="769106052210954285">"Клониран профил"</string>
- <string name="profile_label_work" msgid="3495359133038584618">"Работен профил"</string>
+ <string name="profile_label_work" msgid="3495359133038584618">"Работно"</string>
<string name="profile_label_work_2" msgid="4691533661598632135">"Работен профил 2"</string>
<string name="profile_label_work_3" msgid="4834572253956798917">"Работен профил 3"</string>
<string name="profile_label_test" msgid="9168641926186071947">"Профил за тестирање"</string>
@@ -2413,22 +2415,15 @@
<string name="satellite_notification_open_message" msgid="4149234979688273729">"Отворете ја Messages"</string>
<string name="satellite_notification_how_it_works" msgid="3132069321977520519">"Дознајте како функционира"</string>
<string name="unarchival_session_app_label" msgid="6811856981546348205">"Во фаза на чекање…"</string>
- <!-- no translation found for fingerprint_dangling_notification_title (7362075195588639989) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_1 (6261149111900787302) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_2 (7688302770424064884) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_1 (2927018569542316055) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_2 (6897989352716156176) -->
- <skip />
- <!-- no translation found for face_dangling_notification_title (947852541060975473) -->
- <skip />
- <!-- no translation found for face_dangling_notification_msg (8806849376915541655) -->
- <skip />
- <!-- no translation found for biometric_dangling_notification_action_set_up (8246885009807817961) -->
+ <string name="fingerprint_dangling_notification_title" msgid="7362075195588639989">"Поставете „Отклучување со отпечаток“ повторно"</string>
+ <!-- no translation found for fingerprint_dangling_notification_msg_1 (8517140433796229725) -->
<skip />
- <!-- no translation found for biometric_dangling_notification_action_not_now (8095249216864443491) -->
+ <!-- no translation found for fingerprint_dangling_notification_msg_2 (7578829498452127613) -->
<skip />
+ <string name="fingerprint_dangling_notification_msg_all_deleted_1" msgid="2927018569542316055">"<xliff:g id="FINGERPRINT">%s</xliff:g> не функционираше добро, па се избриша. Поставете го повторно за да го отклучувате телефонот со отпечаток."</string>
+ <string name="fingerprint_dangling_notification_msg_all_deleted_2" msgid="6897989352716156176">"<xliff:g id="FINGERPRINT_0">%1$s</xliff:g> и <xliff:g id="FINGERPRINT_1">%2$s</xliff:g> не функционираа добро, па се избришаа. Поставете ги повторно за да го отклучувате телефонот со отпечаток."</string>
+ <string name="face_dangling_notification_title" msgid="947852541060975473">"Поставете „Отклучување со лик“ повторно"</string>
+ <string name="face_dangling_notification_msg" msgid="8806849376915541655">"Вашиот модел на лик не функционираше добро, па се избриша. Поставете го повторно за да го отклучите телефонот со лик."</string>
+ <string name="biometric_dangling_notification_action_set_up" msgid="8246885009807817961">"Поставете"</string>
+ <string name="biometric_dangling_notification_action_not_now" msgid="8095249216864443491">"Не сега"</string>
</resources>
diff --git a/core/res/res/values-ml/strings.xml b/core/res/res/values-ml/strings.xml
index a0b4c8d80e96..eca7f28651e8 100644
--- a/core/res/res/values-ml/strings.xml
+++ b/core/res/res/values-ml/strings.xml
@@ -283,6 +283,8 @@
<string name="global_action_voice_assist" msgid="6655788068555086695">"വോയ്‌സ് സഹായം"</string>
<string name="global_action_lockdown" msgid="2475471405907902963">"ലോക്ക്‌ഡൗൺ"</string>
<string name="status_bar_notification_info_overflow" msgid="3330152558746563475">"999+"</string>
+ <!-- no translation found for notification_compact_heads_up_reply (2425293958371284340) -->
+ <skip />
<string name="notification_hidden_text" msgid="2835519769868187223">"പുതിയ അറിയിപ്പ്"</string>
<string name="notification_channel_physical_keyboard" msgid="5417306456125988096">"ഫിസിക്കൽ കീബോഡ്"</string>
<string name="notification_channel_security" msgid="8516754650348238057">"സുരക്ഷ"</string>
@@ -1904,8 +1906,8 @@
<string name="package_updated_device_owner" msgid="7560272363805506941">"നിങ്ങളുടെ അഡ്‌മിൻ അപ്‌ഡേറ്റ് ചെയ്യുന്നത്"</string>
<string name="package_deleted_device_owner" msgid="2292335928930293023">"നിങ്ങളുടെ അഡ്‌മിൻ ഇല്ലാതാക്കുന്നത്"</string>
<string name="confirm_battery_saver" msgid="5247976246208245754">"ശരി"</string>
- <string name="battery_saver_description_with_learn_more" msgid="5444908404021316250">"\'ബാറ്ററി ലാഭിക്കൽ\' ഡാർക്ക് തീം ഓണാക്കുന്നു, ഒപ്പം പശ്ചാത്തല ആക്‌റ്റിവിറ്റിയും ചില വിഷ്വൽ ഇഫക്റ്റുകളും ചില ഫീച്ചറുകളും ചില നെറ്റ്‌വർക്ക് കണക്ഷനുകളും പരിമിതപ്പെടുത്തുകയോ ഓഫാക്കുകയോ ചെയ്യുന്നു."</string>
- <string name="battery_saver_description" msgid="8518809702138617167">"ബാറ്ററി ലാഭിക്കൽ ഡാർക്ക് തീം ഓണാക്കുന്നു, പശ്ചാത്തല ആക്‌റ്റിവിറ്റിയും ചില വിഷ്വൽ ഇഫക്റ്റുകളും ചില ഫീച്ചറുകളും ചില നെറ്റ്‌വർക്ക് കണക്ഷനുകളും അത് പരിമിതപ്പെടുത്തുകയോ ഓഫാക്കുകയോ ചെയ്യുന്നു."</string>
+ <string name="battery_saver_description_with_learn_more" msgid="5444908404021316250">"\'ബാറ്ററി സേവർ\' ഡാർക്ക് തീം ഓണാക്കുന്നു, ഒപ്പം പശ്ചാത്തല ആക്‌റ്റിവിറ്റിയും ചില വിഷ്വൽ ഇഫക്റ്റുകളും ചില ഫീച്ചറുകളും ചില നെറ്റ്‌വർക്ക് കണക്ഷനുകളും പരിമിതപ്പെടുത്തുകയോ ഓഫാക്കുകയോ ചെയ്യുന്നു."</string>
+ <string name="battery_saver_description" msgid="8518809702138617167">"ബാറ്ററി സേവർ ഡാർക്ക് തീം ഓണാക്കുന്നു, പശ്ചാത്തല ആക്‌റ്റിവിറ്റിയും ചില വിഷ്വൽ ഇഫക്റ്റുകളും ചില ഫീച്ചറുകളും ചില നെറ്റ്‌വർക്ക് കണക്ഷനുകളും അത് പരിമിതപ്പെടുത്തുകയോ ഓഫാക്കുകയോ ചെയ്യുന്നു."</string>
<string name="data_saver_description" msgid="4995164271550590517">"ഡാറ്റാ ഉപയോഗം കുറയ്ക്കാൻ സഹായിക്കുന്നതിനായി പശ്ചാത്തലത്തിൽ ഡാറ്റ അയയ്ക്കുകയോ സ്വീകരിക്കുകയോ ചെയ്യുന്നതിൽ നിന്ന് ചില ആപ്പുകളെ ഡാറ്റാ സേവർ തടയുന്നു. നിങ്ങൾ നിലവിൽ ഉപയോഗിക്കുന്ന ഒരു ആപ്പിന് ഡാറ്റ ആക്‌സസ് ചെയ്യാനാകും, എന്നാൽ വല്ലപ്പോഴും മാത്രമെ സംഭവിക്കുന്നുള്ളു. ഇതിനർത്ഥം, ഉദാഹരണമായി നിങ്ങൾ ടാപ്പ് ചെയ്യുന്നത് വരെ ചിത്രങ്ങൾ പ്രദ‍‍‍ർശിപ്പിക്കുകയില്ല എന്നാണ്."</string>
<string name="data_saver_enable_title" msgid="7080620065745260137">"ഡാറ്റാ സേവർ ഓണാക്കണോ?"</string>
<string name="data_saver_enable_button" msgid="4399405762586419726">"ഓണാക്കുക"</string>
@@ -2384,7 +2386,7 @@
<string name="concurrent_display_notification_thermal_title" msgid="5921609404644739229">"ഉപകരണത്തിന് ചൂട് കൂടുതലാണ്"</string>
<string name="concurrent_display_notification_thermal_content" msgid="2075484836527609319">"നിങ്ങളുടെ ഫോൺ വളരെയധികം ചൂടാകുന്നതിനാൽ ഡ്യുവൽ സ്‌ക്രീൻ ലഭ്യമല്ല"</string>
<string name="concurrent_display_notification_power_save_title" msgid="1794569070730736281">"ഡ്യുവൽ സ്‌ക്രീൻ ലഭ്യമല്ല"</string>
- <string name="concurrent_display_notification_power_save_content" msgid="2198116070583851493">"ബാറ്ററി ലാഭിക്കൽ ഓണായതിനാൽ ഡ്യുവൽ സ്‌ക്രീൻ ലഭ്യമല്ല. നിങ്ങൾക്ക് ഇത് ക്രമീകരണത്തിൽ ഓഫാക്കാം."</string>
+ <string name="concurrent_display_notification_power_save_content" msgid="2198116070583851493">"ബാറ്ററി സേവർ ഓണായതിനാൽ ഡ്യുവൽ സ്‌ക്രീൻ ലഭ്യമല്ല. നിങ്ങൾക്ക് ഇത് ക്രമീകരണത്തിൽ ഓഫാക്കാം."</string>
<string name="device_state_notification_settings_button" msgid="691937505741872749">"ക്രമീകരണത്തിലേക്ക് പോകുക"</string>
<string name="device_state_notification_turn_off_button" msgid="6327161707661689232">"ഓഫാക്കുക"</string>
<string name="keyboard_layout_notification_selected_title" msgid="1202560174252421219">"<xliff:g id="DEVICE_NAME">%s</xliff:g> കോൺഫിഗർ ചെയ്‌തു"</string>
@@ -2413,22 +2415,15 @@
<string name="satellite_notification_open_message" msgid="4149234979688273729">"Messages തുറക്കുക"</string>
<string name="satellite_notification_how_it_works" msgid="3132069321977520519">"ഇത് പ്രവർത്തിക്കുന്നത് എങ്ങനെയാണ്"</string>
<string name="unarchival_session_app_label" msgid="6811856981546348205">"തീർപ്പാക്കിയിട്ടില്ല..."</string>
- <!-- no translation found for fingerprint_dangling_notification_title (7362075195588639989) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_1 (6261149111900787302) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_2 (7688302770424064884) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_1 (2927018569542316055) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_2 (6897989352716156176) -->
- <skip />
- <!-- no translation found for face_dangling_notification_title (947852541060975473) -->
- <skip />
- <!-- no translation found for face_dangling_notification_msg (8806849376915541655) -->
- <skip />
- <!-- no translation found for biometric_dangling_notification_action_set_up (8246885009807817961) -->
+ <string name="fingerprint_dangling_notification_title" msgid="7362075195588639989">"ഫിംഗർപ്രിന്റ് അൺലോക്ക് വീണ്ടും സജ്ജീകരിക്കുക"</string>
+ <!-- no translation found for fingerprint_dangling_notification_msg_1 (8517140433796229725) -->
<skip />
- <!-- no translation found for biometric_dangling_notification_action_not_now (8095249216864443491) -->
+ <!-- no translation found for fingerprint_dangling_notification_msg_2 (7578829498452127613) -->
<skip />
+ <string name="fingerprint_dangling_notification_msg_all_deleted_1" msgid="2927018569542316055">"<xliff:g id="FINGERPRINT">%s</xliff:g> ശരിയായി പ്രവർത്തിക്കാത്തതിനാൽ അത് ഇല്ലാതാക്കി. നിങ്ങളുടെ ഫിംഗർപ്രിന്റ് ഉപയോഗിച്ച് ഫോൺ അൺലോക്ക് ചെയ്യുന്നതിനായി വീണ്ടും സജ്ജീകരിക്കുക."</string>
+ <string name="fingerprint_dangling_notification_msg_all_deleted_2" msgid="6897989352716156176">"<xliff:g id="FINGERPRINT_0">%1$s</xliff:g>, <xliff:g id="FINGERPRINT_1">%2$s</xliff:g> എന്നിവ ശരിയായി പ്രവർത്തിക്കാത്തതിനാൽ അവ ഇല്ലാതാക്കി. നിങ്ങളുടെ ഫിംഗർപ്രിന്റ് ഉപയോഗിച്ച് ഫോൺ അൺലോക്ക് ചെയ്യുന്നതിനായി അവ വീണ്ടും സജ്ജീകരിക്കുക."</string>
+ <string name="face_dangling_notification_title" msgid="947852541060975473">"ഫെയ്‌സ് അൺലോക്ക് വീണ്ടും സജ്ജീകരിക്കുക"</string>
+ <string name="face_dangling_notification_msg" msgid="8806849376915541655">"നിങ്ങളുടെ മുഖ മോഡൽ ശരിയായി പ്രവർത്തിക്കാത്തതിനാൽ അത് ഇല്ലാതാക്കി. നിങ്ങളുടെ മുഖം ഉപയോഗിച്ച് ഫോൺ അൺലോക്ക് ചെയ്യുന്നതിനായി വീണ്ടും സജ്ജീകരിക്കുക."</string>
+ <string name="biometric_dangling_notification_action_set_up" msgid="8246885009807817961">"സജ്ജീകരിക്കുക"</string>
+ <string name="biometric_dangling_notification_action_not_now" msgid="8095249216864443491">"ഇപ്പോൾ വേണ്ട"</string>
</resources>
diff --git a/core/res/res/values-mn/strings.xml b/core/res/res/values-mn/strings.xml
index 5ba16fe87ffd..8d430eedc396 100644
--- a/core/res/res/values-mn/strings.xml
+++ b/core/res/res/values-mn/strings.xml
@@ -283,6 +283,8 @@
<string name="global_action_voice_assist" msgid="6655788068555086695">"Дуут туслах"</string>
<string name="global_action_lockdown" msgid="2475471405907902963">"Түгжих"</string>
<string name="status_bar_notification_info_overflow" msgid="3330152558746563475">"999+"</string>
+ <!-- no translation found for notification_compact_heads_up_reply (2425293958371284340) -->
+ <skip />
<string name="notification_hidden_text" msgid="2835519769868187223">"Шинэ мэдэгдэл"</string>
<string name="notification_channel_physical_keyboard" msgid="5417306456125988096">"Биет гар"</string>
<string name="notification_channel_security" msgid="8516754650348238057">"Аюулгүй байдал"</string>
@@ -2394,7 +2396,7 @@
<string name="keyboard_layout_notification_more_than_three_selected_message" msgid="1581834181578206937">"Гарын бүдүүвчийг <xliff:g id="LAYOUT_1">%1$s</xliff:g>, <xliff:g id="LAYOUT_2">%2$s</xliff:g>, <xliff:g id="LAYOUT_3">%3$s</xliff:g> болгож тохируулсан… Өөрчлөхийн тулд товшино уу."</string>
<string name="keyboard_layout_notification_multiple_selected_title" msgid="5242444914367024499">"Биет гарыг тохируулсан"</string>
<string name="keyboard_layout_notification_multiple_selected_message" msgid="6576533454124419202">"Гарыг харахын тулд товшино уу"</string>
- <string name="profile_label_private" msgid="6463418670715290696">"Хувийн"</string>
+ <string name="profile_label_private" msgid="6463418670715290696">"Хаалттай"</string>
<string name="profile_label_clone" msgid="769106052210954285">"Клон"</string>
<string name="profile_label_work" msgid="3495359133038584618">"Ажил"</string>
<string name="profile_label_work_2" msgid="4691533661598632135">"Ажил 2"</string>
@@ -2413,22 +2415,15 @@
<string name="satellite_notification_open_message" msgid="4149234979688273729">"Мессежийг нээх"</string>
<string name="satellite_notification_how_it_works" msgid="3132069321977520519">"Энэ хэрхэн ажилладаг вэ?"</string>
<string name="unarchival_session_app_label" msgid="6811856981546348205">"Хүлээгдэж буй..."</string>
- <!-- no translation found for fingerprint_dangling_notification_title (7362075195588639989) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_1 (6261149111900787302) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_2 (7688302770424064884) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_1 (2927018569542316055) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_2 (6897989352716156176) -->
- <skip />
- <!-- no translation found for face_dangling_notification_title (947852541060975473) -->
- <skip />
- <!-- no translation found for face_dangling_notification_msg (8806849376915541655) -->
- <skip />
- <!-- no translation found for biometric_dangling_notification_action_set_up (8246885009807817961) -->
+ <string name="fingerprint_dangling_notification_title" msgid="7362075195588639989">"Хурууны хээгээр түгжээ тайлахыг дахин тохируулна уу"</string>
+ <!-- no translation found for fingerprint_dangling_notification_msg_1 (8517140433796229725) -->
<skip />
- <!-- no translation found for biometric_dangling_notification_action_not_now (8095249216864443491) -->
+ <!-- no translation found for fingerprint_dangling_notification_msg_2 (7578829498452127613) -->
<skip />
+ <string name="fingerprint_dangling_notification_msg_all_deleted_1" msgid="2927018569542316055">"<xliff:g id="FINGERPRINT">%s</xliff:g> сайн ажиллахгүй байсан тул үүнийг устгасан. Утасныхаа түгжээг хурууны хээгээр тайлахын тулд хурууны хээг дахин тохируулна уу."</string>
+ <string name="fingerprint_dangling_notification_msg_all_deleted_2" msgid="6897989352716156176">"<xliff:g id="FINGERPRINT_0">%1$s</xliff:g>, <xliff:g id="FINGERPRINT_1">%2$s</xliff:g> сайн ажиллахгүй байсан тул эдгээрийг устгасан. Утасныхаа түгжээг хурууныхаа хээгээр тайлахын тулд хоёр хурууны хээг дахин тохируулна уу."</string>
+ <string name="face_dangling_notification_title" msgid="947852541060975473">"Царайгаар түгжээ тайлахыг дахин тохируулна уу"</string>
+ <string name="face_dangling_notification_msg" msgid="8806849376915541655">"Таны нүүрний загвар сайн ажиллахгүй байсан бөгөөд үүнийг устгасан. Утасныхаа түгжээг царайгаар тайлахын тулд нүүрний загварыг дахин тохируулна уу."</string>
+ <string name="biometric_dangling_notification_action_set_up" msgid="8246885009807817961">"Тохируулах"</string>
+ <string name="biometric_dangling_notification_action_not_now" msgid="8095249216864443491">"Одоо биш"</string>
</resources>
diff --git a/core/res/res/values-mr/strings.xml b/core/res/res/values-mr/strings.xml
index 6c19cc592880..d5f2bae87f0d 100644
--- a/core/res/res/values-mr/strings.xml
+++ b/core/res/res/values-mr/strings.xml
@@ -283,6 +283,8 @@
<string name="global_action_voice_assist" msgid="6655788068555086695">"व्हॉइस सहाय्य"</string>
<string name="global_action_lockdown" msgid="2475471405907902963">"लॉकडाउन"</string>
<string name="status_bar_notification_info_overflow" msgid="3330152558746563475">"999+"</string>
+ <!-- no translation found for notification_compact_heads_up_reply (2425293958371284340) -->
+ <skip />
<string name="notification_hidden_text" msgid="2835519769868187223">"नवीन सूचना"</string>
<string name="notification_channel_physical_keyboard" msgid="5417306456125988096">"वास्तविक कीबोर्ड"</string>
<string name="notification_channel_security" msgid="8516754650348238057">"सुरक्षा"</string>
@@ -2413,22 +2415,15 @@
<string name="satellite_notification_open_message" msgid="4149234979688273729">"Messages उघडा"</string>
<string name="satellite_notification_how_it_works" msgid="3132069321977520519">"ते कसे काम करते"</string>
<string name="unarchival_session_app_label" msgid="6811856981546348205">"प्रलंबित आहे..."</string>
- <!-- no translation found for fingerprint_dangling_notification_title (7362075195588639989) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_1 (6261149111900787302) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_2 (7688302770424064884) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_1 (2927018569542316055) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_2 (6897989352716156176) -->
- <skip />
- <!-- no translation found for face_dangling_notification_title (947852541060975473) -->
- <skip />
- <!-- no translation found for face_dangling_notification_msg (8806849376915541655) -->
- <skip />
- <!-- no translation found for biometric_dangling_notification_action_set_up (8246885009807817961) -->
+ <string name="fingerprint_dangling_notification_title" msgid="7362075195588639989">"फिंगरप्रिंट अनलॉक पुन्हा सेट करा"</string>
+ <!-- no translation found for fingerprint_dangling_notification_msg_1 (8517140433796229725) -->
<skip />
- <!-- no translation found for biometric_dangling_notification_action_not_now (8095249216864443491) -->
+ <!-- no translation found for fingerprint_dangling_notification_msg_2 (7578829498452127613) -->
<skip />
+ <string name="fingerprint_dangling_notification_msg_all_deleted_1" msgid="2927018569542316055">"योग्यरीत्या काम करत नसल्यामुळे <xliff:g id="FINGERPRINT">%s</xliff:g> हटवले गेले आहे. तुमचे फिंगरप्रिंट वापरून फोन अनलॉक करण्यासाठी ते पुन्हा सेट करा."</string>
+ <string name="fingerprint_dangling_notification_msg_all_deleted_2" msgid="6897989352716156176">"परफॉर्मन्समध्ये सुधारणा करण्यासाठी आणि योग्यरीत्या काम करत नसल्यामुळे <xliff:g id="FINGERPRINT_0">%1$s</xliff:g> व <xliff:g id="FINGERPRINT_1">%2$s</xliff:g> हटवली गेली आहेत. तुमचे फिंगरप्रिंट वापरून फोन अनलॉक करण्यासाठी ते पुन्हा सेट करा."</string>
+ <string name="face_dangling_notification_title" msgid="947852541060975473">"फेस अनलॉक पुन्हा सेट करा"</string>
+ <string name="face_dangling_notification_msg" msgid="8806849376915541655">"तुमचे फेस मॉडेल योग्यरीत्या काम करत नसल्यामुळे ते हटवले गेले आहे. तुमचा चेहरा वापरून फोन अनलॉक करण्यासाठी ते पुन्हा सेट करा."</string>
+ <string name="biometric_dangling_notification_action_set_up" msgid="8246885009807817961">"सेट करा"</string>
+ <string name="biometric_dangling_notification_action_not_now" msgid="8095249216864443491">"आताच नको"</string>
</resources>
diff --git a/core/res/res/values-ms/strings.xml b/core/res/res/values-ms/strings.xml
index 82c1a5974c62..8018cb36741f 100644
--- a/core/res/res/values-ms/strings.xml
+++ b/core/res/res/values-ms/strings.xml
@@ -283,6 +283,8 @@
<string name="global_action_voice_assist" msgid="6655788068555086695">"Bantuan Suara"</string>
<string name="global_action_lockdown" msgid="2475471405907902963">"Kunci semua"</string>
<string name="status_bar_notification_info_overflow" msgid="3330152558746563475">"999+"</string>
+ <!-- no translation found for notification_compact_heads_up_reply (2425293958371284340) -->
+ <skip />
<string name="notification_hidden_text" msgid="2835519769868187223">"Pemberitahuan baharu"</string>
<string name="notification_channel_physical_keyboard" msgid="5417306456125988096">"Papan kekunci fizikal"</string>
<string name="notification_channel_security" msgid="8516754650348238057">"Keselamatan"</string>
@@ -2413,22 +2415,15 @@
<string name="satellite_notification_open_message" msgid="4149234979688273729">"Buka Messages"</string>
<string name="satellite_notification_how_it_works" msgid="3132069321977520519">"Cara ciri ini berfungsi"</string>
<string name="unarchival_session_app_label" msgid="6811856981546348205">"Belum selesai..."</string>
- <!-- no translation found for fingerprint_dangling_notification_title (7362075195588639989) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_1 (6261149111900787302) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_2 (7688302770424064884) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_1 (2927018569542316055) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_2 (6897989352716156176) -->
- <skip />
- <!-- no translation found for face_dangling_notification_title (947852541060975473) -->
- <skip />
- <!-- no translation found for face_dangling_notification_msg (8806849376915541655) -->
- <skip />
- <!-- no translation found for biometric_dangling_notification_action_set_up (8246885009807817961) -->
+ <string name="fingerprint_dangling_notification_title" msgid="7362075195588639989">"Sediakan Buka Kunci Cap Jari sekali lagi"</string>
+ <!-- no translation found for fingerprint_dangling_notification_msg_1 (8517140433796229725) -->
<skip />
- <!-- no translation found for biometric_dangling_notification_action_not_now (8095249216864443491) -->
+ <!-- no translation found for fingerprint_dangling_notification_msg_2 (7578829498452127613) -->
<skip />
+ <string name="fingerprint_dangling_notification_msg_all_deleted_1" msgid="2927018569542316055">"<xliff:g id="FINGERPRINT">%s</xliff:g> tidak berfungsi dengan baik dan telah dipadamkan. Sediakan cap jari sekali lagi untuk membuka kunci telefon anda menggunakan cap jari."</string>
+ <string name="fingerprint_dangling_notification_msg_all_deleted_2" msgid="6897989352716156176">"<xliff:g id="FINGERPRINT_0">%1$s</xliff:g> dan <xliff:g id="FINGERPRINT_1">%2$s</xliff:g> tidak berfungsi dengan baik dan telah dipadamkan. Sediakan kedua-dua cap jari tersebut sekali lagi untuk membuka kunci telefon anda menggunakan cap jari anda."</string>
+ <string name="face_dangling_notification_title" msgid="947852541060975473">"Sediakan semula Buka Kunci Wajah"</string>
+ <string name="face_dangling_notification_msg" msgid="8806849376915541655">"Model wajah anda tidak berfungsi dengan baik dan telah dipadamkan. Sediakan model wajah sekali lagi untuk membuka kunci telefon anda menggunakan wajah."</string>
+ <string name="biometric_dangling_notification_action_set_up" msgid="8246885009807817961">"Sediakan"</string>
+ <string name="biometric_dangling_notification_action_not_now" msgid="8095249216864443491">"Bukan sekarang"</string>
</resources>
diff --git a/core/res/res/values-my/strings.xml b/core/res/res/values-my/strings.xml
index 43b7ffafd093..488bdb082f08 100644
--- a/core/res/res/values-my/strings.xml
+++ b/core/res/res/values-my/strings.xml
@@ -283,6 +283,8 @@
<string name="global_action_voice_assist" msgid="6655788068555086695">"အသံ အကူအညီ"</string>
<string name="global_action_lockdown" msgid="2475471405907902963">"လော့ခ်ဒေါင်း"</string>
<string name="status_bar_notification_info_overflow" msgid="3330152558746563475">"၉၉၉+"</string>
+ <!-- no translation found for notification_compact_heads_up_reply (2425293958371284340) -->
+ <skip />
<string name="notification_hidden_text" msgid="2835519769868187223">"အကြောင်းကြားချက်အသစ်"</string>
<string name="notification_channel_physical_keyboard" msgid="5417306456125988096">"စက်၏ ကီးဘုတ်"</string>
<string name="notification_channel_security" msgid="8516754650348238057">"လုံခြုံရေး"</string>
@@ -2413,22 +2415,15 @@
<string name="satellite_notification_open_message" msgid="4149234979688273729">"Messages ဖွင့်ရန်"</string>
<string name="satellite_notification_how_it_works" msgid="3132069321977520519">"အလုပ်လုပ်ပုံ"</string>
<string name="unarchival_session_app_label" msgid="6811856981546348205">"ဆိုင်းငံ့ထားသည်…"</string>
- <!-- no translation found for fingerprint_dangling_notification_title (7362075195588639989) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_1 (6261149111900787302) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_2 (7688302770424064884) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_1 (2927018569542316055) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_2 (6897989352716156176) -->
- <skip />
- <!-- no translation found for face_dangling_notification_title (947852541060975473) -->
- <skip />
- <!-- no translation found for face_dangling_notification_msg (8806849376915541655) -->
- <skip />
- <!-- no translation found for biometric_dangling_notification_action_set_up (8246885009807817961) -->
+ <string name="fingerprint_dangling_notification_title" msgid="7362075195588639989">"‘လက်ဗွေသုံး လော့ခ်ဖွင့်ခြင်း’ ကို စနစ်ထပ်မံထည့်သွင်းပါ"</string>
+ <!-- no translation found for fingerprint_dangling_notification_msg_1 (8517140433796229725) -->
<skip />
- <!-- no translation found for biometric_dangling_notification_action_not_now (8095249216864443491) -->
+ <!-- no translation found for fingerprint_dangling_notification_msg_2 (7578829498452127613) -->
<skip />
+ <string name="fingerprint_dangling_notification_msg_all_deleted_1" msgid="2927018569542316055">"<xliff:g id="FINGERPRINT">%s</xliff:g> သိပ်အဆင်မပြေသဖြင့် ဖျက်ထားသည်။ သင့်ဖုန်းကို လက်ဗွေဖြင့်လော့ခ်ဖွင့်ရန် ၎င်းကို စနစ်ထပ်မံထည့်သွင်းပါ။"</string>
+ <string name="fingerprint_dangling_notification_msg_all_deleted_2" msgid="6897989352716156176">"<xliff:g id="FINGERPRINT_0">%1$s</xliff:g> နှင့် <xliff:g id="FINGERPRINT_1">%2$s</xliff:g> တို့ သိပ်အဆင်မပြေသဖြင့် ဖျက်ထားသည်။ သင့်ဖုန်းကို လက်ဗွေဖြင့်လော့ခ်ဖွင့်ရန် ၎င်းတို့ကို စနစ်ထပ်မံထည့်သွင်းပါ။"</string>
+ <string name="face_dangling_notification_title" msgid="947852541060975473">"‘မျက်နှာပြ လော့ခ်ဖွင့်ခြင်း’ ကို စနစ်ထပ်မံထည့်သွင်းပါ"</string>
+ <string name="face_dangling_notification_msg" msgid="8806849376915541655">"သင့်မျက်နှာနမူနာ သိပ်အဆင်မပြေသဖြင့် ဖျက်ထားသည်။ သင့်ဖုန်းကို မျက်နှာဖြင့်လော့ခ်ဖွင့်ရန် ၎င်းကို စနစ်ထပ်မံထည့်သွင်းပါ။"</string>
+ <string name="biometric_dangling_notification_action_set_up" msgid="8246885009807817961">"စနစ်ထည့်သွင်းရန်"</string>
+ <string name="biometric_dangling_notification_action_not_now" msgid="8095249216864443491">"ယခုမလုပ်ပါ"</string>
</resources>
diff --git a/core/res/res/values-nb/strings.xml b/core/res/res/values-nb/strings.xml
index ad4ffc202466..3939f48b9265 100644
--- a/core/res/res/values-nb/strings.xml
+++ b/core/res/res/values-nb/strings.xml
@@ -283,6 +283,8 @@
<string name="global_action_voice_assist" msgid="6655788068555086695">"Talehjelp"</string>
<string name="global_action_lockdown" msgid="2475471405907902963">"Låsing"</string>
<string name="status_bar_notification_info_overflow" msgid="3330152558746563475">"999+"</string>
+ <!-- no translation found for notification_compact_heads_up_reply (2425293958371284340) -->
+ <skip />
<string name="notification_hidden_text" msgid="2835519769868187223">"Nytt varsel"</string>
<string name="notification_channel_physical_keyboard" msgid="5417306456125988096">"Fysisk tastatur"</string>
<string name="notification_channel_security" msgid="8516754650348238057">"Sikkerhet"</string>
@@ -2413,22 +2415,15 @@
<string name="satellite_notification_open_message" msgid="4149234979688273729">"Åpne Meldinger"</string>
<string name="satellite_notification_how_it_works" msgid="3132069321977520519">"Slik fungerer det"</string>
<string name="unarchival_session_app_label" msgid="6811856981546348205">"Venter …"</string>
- <!-- no translation found for fingerprint_dangling_notification_title (7362075195588639989) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_1 (6261149111900787302) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_2 (7688302770424064884) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_1 (2927018569542316055) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_2 (6897989352716156176) -->
- <skip />
- <!-- no translation found for face_dangling_notification_title (947852541060975473) -->
- <skip />
- <!-- no translation found for face_dangling_notification_msg (8806849376915541655) -->
- <skip />
- <!-- no translation found for biometric_dangling_notification_action_set_up (8246885009807817961) -->
+ <string name="fingerprint_dangling_notification_title" msgid="7362075195588639989">"Konfigurer opplåsingen med fingeravtrykk på nytt"</string>
+ <!-- no translation found for fingerprint_dangling_notification_msg_1 (8517140433796229725) -->
<skip />
- <!-- no translation found for biometric_dangling_notification_action_not_now (8095249216864443491) -->
+ <!-- no translation found for fingerprint_dangling_notification_msg_2 (7578829498452127613) -->
<skip />
+ <string name="fingerprint_dangling_notification_msg_all_deleted_1" msgid="2927018569542316055">"<xliff:g id="FINGERPRINT">%s</xliff:g> fungerte ikke skikkelig og ble slettet. Du kan konfigurere det på nytt for å låse opp telefonen med fingeravtrykket."</string>
+ <string name="fingerprint_dangling_notification_msg_all_deleted_2" msgid="6897989352716156176">"<xliff:g id="FINGERPRINT_0">%1$s</xliff:g> og <xliff:g id="FINGERPRINT_1">%2$s</xliff:g> fungerte ikke skikkelig og ble slettet. Du kan konfigurere dem på nytt for å låse opp telefonen med fingeravtrykket."</string>
+ <string name="face_dangling_notification_title" msgid="947852541060975473">"Konfigurer ansiktslåsen på nytt"</string>
+ <string name="face_dangling_notification_msg" msgid="8806849376915541655">"Ansiktsmodellen din fungerte ikke skikkelig og ble slettet. Du kan konfigurere den på nytt for å låse opp telefonen med ansiktet."</string>
+ <string name="biometric_dangling_notification_action_set_up" msgid="8246885009807817961">"Konfigurer"</string>
+ <string name="biometric_dangling_notification_action_not_now" msgid="8095249216864443491">"Ikke nå"</string>
</resources>
diff --git a/core/res/res/values-ne/strings.xml b/core/res/res/values-ne/strings.xml
index 1cde247403c3..c16a02cb1278 100644
--- a/core/res/res/values-ne/strings.xml
+++ b/core/res/res/values-ne/strings.xml
@@ -283,6 +283,8 @@
<string name="global_action_voice_assist" msgid="6655788068555086695">"आवाज सहायता"</string>
<string name="global_action_lockdown" msgid="2475471405907902963">"लकडाउन गर्नु…"</string>
<string name="status_bar_notification_info_overflow" msgid="3330152558746563475">"९९९+"</string>
+ <!-- no translation found for notification_compact_heads_up_reply (2425293958371284340) -->
+ <skip />
<string name="notification_hidden_text" msgid="2835519769868187223">"नयाँ सूचना"</string>
<string name="notification_channel_physical_keyboard" msgid="5417306456125988096">"फिजिकल किबोर्ड"</string>
<string name="notification_channel_security" msgid="8516754650348238057">"सुरक्षा"</string>
@@ -873,30 +875,30 @@
<item msgid="4537253139152229577">"घरको फ्याक्स"</item>
<item msgid="6751245029698664340">"पेजर"</item>
<item msgid="1692790665884224905">"अन्य"</item>
- <item msgid="6216981255272016212">"आफू अनुकूल"</item>
+ <item msgid="6216981255272016212">" कस्टम"</item>
</string-array>
<string-array name="emailAddressTypes">
<item msgid="7786349763648997741">"गृह"</item>
<item msgid="435564470865989199">"काम"</item>
<item msgid="4199433197875490373">"अन्य"</item>
- <item msgid="3233938986670468328">"आफू अनुकूल"</item>
+ <item msgid="3233938986670468328">" कस्टम"</item>
</string-array>
<string-array name="postalAddressTypes">
<item msgid="3861463339764243038">"गृह"</item>
<item msgid="5472578890164979109">"काम"</item>
<item msgid="5718921296646594739">"अन्य"</item>
- <item msgid="5523122236731783179">"आफू अनुकूल"</item>
+ <item msgid="5523122236731783179">" कस्टम"</item>
</string-array>
<string-array name="imAddressTypes">
<item msgid="588088543406993772">"गृह"</item>
<item msgid="5503060422020476757">"काम"</item>
<item msgid="2530391194653760297">"अन्य"</item>
- <item msgid="7640927178025203330">"आफू अनुकूल"</item>
+ <item msgid="7640927178025203330">" कस्टम"</item>
</string-array>
<string-array name="organizationTypes">
<item msgid="6144047813304847762">"काम गर्नुहोस्"</item>
<item msgid="7402720230065674193">"अन्य"</item>
- <item msgid="808230403067569648">"आफू अनुकूल"</item>
+ <item msgid="808230403067569648">" कस्टम"</item>
</string-array>
<string-array name="imProtocols">
<item msgid="7535761744432206400">"AIM"</item>
@@ -908,7 +910,7 @@
<item msgid="4717545739447438044">"ICQ"</item>
<item msgid="8293711853624033835">"Jabber"</item>
</string-array>
- <string name="phoneTypeCustom" msgid="5120365721260686814">"आफू अनुकूल"</string>
+ <string name="phoneTypeCustom" msgid="5120365721260686814">" कस्टम"</string>
<string name="phoneTypeHome" msgid="3880132427643623588">"गृह"</string>
<string name="phoneTypeMobile" msgid="1178852541462086735">"मोबाइल"</string>
<string name="phoneTypeWork" msgid="6604967163358864607">"काम"</string>
@@ -929,24 +931,24 @@
<string name="phoneTypeWorkPager" msgid="3748332310638505234">"कार्य पेजर"</string>
<string name="phoneTypeAssistant" msgid="757550783842231039">"सहायक"</string>
<string name="phoneTypeMms" msgid="1799747455131365989">"MMS"</string>
- <string name="eventTypeCustom" msgid="3257367158986466481">"आफू अनुकूल"</string>
+ <string name="eventTypeCustom" msgid="3257367158986466481">" कस्टम"</string>
<string name="eventTypeBirthday" msgid="7770026752793912283">"जन्मदिन"</string>
<string name="eventTypeAnniversary" msgid="4684702412407916888">"वार्षिक समारोह"</string>
<string name="eventTypeOther" msgid="530671238533887997">"अन्य"</string>
- <string name="emailTypeCustom" msgid="1809435350482181786">"आफू अनुकूल"</string>
+ <string name="emailTypeCustom" msgid="1809435350482181786">" कस्टम"</string>
<string name="emailTypeHome" msgid="1597116303154775999">"गृह"</string>
<string name="emailTypeWork" msgid="2020095414401882111">"काम"</string>
<string name="emailTypeOther" msgid="5131130857030897465">"अन्य"</string>
<string name="emailTypeMobile" msgid="787155077375364230">"मोबाइल"</string>
- <string name="postalTypeCustom" msgid="5645590470242939129">"आफू अनुकूल"</string>
+ <string name="postalTypeCustom" msgid="5645590470242939129">" कस्टम"</string>
<string name="postalTypeHome" msgid="7562272480949727912">"गृह"</string>
<string name="postalTypeWork" msgid="8553425424652012826">"काम"</string>
<string name="postalTypeOther" msgid="7094245413678857420">"अन्य"</string>
- <string name="imTypeCustom" msgid="5653384545085765570">"आफू अनुकूल"</string>
+ <string name="imTypeCustom" msgid="5653384545085765570">" कस्टम"</string>
<string name="imTypeHome" msgid="6996507981044278216">"गृह"</string>
<string name="imTypeWork" msgid="2099668940169903123">"काम"</string>
<string name="imTypeOther" msgid="8068447383276219810">"अन्य"</string>
- <string name="imProtocolCustom" msgid="4437878287653764692">"आफू अनुकूल"</string>
+ <string name="imProtocolCustom" msgid="4437878287653764692">" कस्टम"</string>
<string name="imProtocolAim" msgid="4050198236506604378">"AIM"</string>
<string name="imProtocolMsn" msgid="2257148557766499232">"Windows Live"</string>
<string name="imProtocolYahoo" msgid="5373338758093392231">"Yahoo"</string>
@@ -958,8 +960,8 @@
<string name="imProtocolNetMeeting" msgid="4985002408136148256">"NetMeeting"</string>
<string name="orgTypeWork" msgid="8684458700669564172">"काम"</string>
<string name="orgTypeOther" msgid="5450675258408005553">"अन्य"</string>
- <string name="orgTypeCustom" msgid="1126322047677329218">"आफू अनुकूल"</string>
- <string name="relationTypeCustom" msgid="282938315217441351">"आफू अनुकूल"</string>
+ <string name="orgTypeCustom" msgid="1126322047677329218">" कस्टम"</string>
+ <string name="relationTypeCustom" msgid="282938315217441351">" कस्टम"</string>
<string name="relationTypeAssistant" msgid="4057605157116589315">"सहायक"</string>
<string name="relationTypeBrother" msgid="7141662427379247820">"भाइ"</string>
<string name="relationTypeChild" msgid="9076258911292693601">"सन्तान"</string>
@@ -974,7 +976,7 @@
<string name="relationTypeRelative" msgid="3396498519818009134">"आफन्त"</string>
<string name="relationTypeSister" msgid="3721676005094140671">"बहिनी"</string>
<string name="relationTypeSpouse" msgid="6916682664436031703">"पति-पत्नी"</string>
- <string name="sipAddressTypeCustom" msgid="6283889809842649336">"आफू अनुकूल"</string>
+ <string name="sipAddressTypeCustom" msgid="6283889809842649336">" कस्टम"</string>
<string name="sipAddressTypeHome" msgid="5918441930656878367">"गृह"</string>
<string name="sipAddressTypeWork" msgid="7873967986701216770">"काम गर्नुहोस्"</string>
<string name="sipAddressTypeOther" msgid="6317012577345187275">"अन्य"</string>
@@ -2413,22 +2415,15 @@
<string name="satellite_notification_open_message" msgid="4149234979688273729">"Messages खोल्नुहोस्"</string>
<string name="satellite_notification_how_it_works" msgid="3132069321977520519">"यसले काम गर्ने तरिका"</string>
<string name="unarchival_session_app_label" msgid="6811856981546348205">"विचाराधीन..."</string>
- <!-- no translation found for fingerprint_dangling_notification_title (7362075195588639989) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_1 (6261149111900787302) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_2 (7688302770424064884) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_1 (2927018569542316055) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_2 (6897989352716156176) -->
- <skip />
- <!-- no translation found for face_dangling_notification_title (947852541060975473) -->
- <skip />
- <!-- no translation found for face_dangling_notification_msg (8806849376915541655) -->
- <skip />
- <!-- no translation found for biometric_dangling_notification_action_set_up (8246885009807817961) -->
+ <string name="fingerprint_dangling_notification_title" msgid="7362075195588639989">"फिंगरप्रिन्ट अनलक फेरि सेटअप गर्नुहोस्"</string>
+ <!-- no translation found for fingerprint_dangling_notification_msg_1 (8517140433796229725) -->
<skip />
- <!-- no translation found for biometric_dangling_notification_action_not_now (8095249216864443491) -->
+ <!-- no translation found for fingerprint_dangling_notification_msg_2 (7578829498452127613) -->
<skip />
+ <string name="fingerprint_dangling_notification_msg_all_deleted_1" msgid="2927018569542316055">"<xliff:g id="FINGERPRINT">%s</xliff:g> ले काम गरिरहेको थिएन र त्यसलाई मेटाइयो। फिंगरप्रिन्ट प्रयोग गरी आफ्नो फोन अनलक गर्न त्यसलाई फेरि सेट अप गर्नुहोस्।"</string>
+ <string name="fingerprint_dangling_notification_msg_all_deleted_2" msgid="6897989352716156176">"<xliff:g id="FINGERPRINT_0">%1$s</xliff:g> र <xliff:g id="FINGERPRINT_1">%2$s</xliff:g> ले राम्ररी काम गरिरहेका थिएनन् र तिनलाई मेटाइयो। फिंगरप्रिन्ट प्रयोग गरी आफ्नो फोन अनलक गर्न तिनलाई फेरि सेट अप गर्नुहोस्।"</string>
+ <string name="face_dangling_notification_title" msgid="947852541060975473">"फेस अनलक फेरि सेटअप गर्नुहोस्"</string>
+ <string name="face_dangling_notification_msg" msgid="8806849376915541655">"तपाईंको फेस मोडेलले राम्ररी काम गरिरहेको थिएन र त्यसलाई मेटाइयो। अनुहार प्रयोग गरी आफ्नो फोन अनलक गर्न फेस मोडेल फेरि सेट अप गर्नुहोस्।"</string>
+ <string name="biometric_dangling_notification_action_set_up" msgid="8246885009807817961">"सेटअप गर्नुहोस्"</string>
+ <string name="biometric_dangling_notification_action_not_now" msgid="8095249216864443491">"अहिले होइन"</string>
</resources>
diff --git a/core/res/res/values-nl/strings.xml b/core/res/res/values-nl/strings.xml
index 7bae96e6ab88..f8b0f9e12c36 100644
--- a/core/res/res/values-nl/strings.xml
+++ b/core/res/res/values-nl/strings.xml
@@ -283,6 +283,8 @@
<string name="global_action_voice_assist" msgid="6655788068555086695">"Spraakassistent"</string>
<string name="global_action_lockdown" msgid="2475471405907902963">"Lockdown"</string>
<string name="status_bar_notification_info_overflow" msgid="3330152558746563475">"999 +"</string>
+ <!-- no translation found for notification_compact_heads_up_reply (2425293958371284340) -->
+ <skip />
<string name="notification_hidden_text" msgid="2835519769868187223">"Nieuwe melding"</string>
<string name="notification_channel_physical_keyboard" msgid="5417306456125988096">"Fysiek toetsenbord"</string>
<string name="notification_channel_security" msgid="8516754650348238057">"Beveiliging"</string>
@@ -2413,22 +2415,15 @@
<string name="satellite_notification_open_message" msgid="4149234979688273729">"Berichten openen"</string>
<string name="satellite_notification_how_it_works" msgid="3132069321977520519">"Hoe het werkt"</string>
<string name="unarchival_session_app_label" msgid="6811856981546348205">"In behandeling…"</string>
- <!-- no translation found for fingerprint_dangling_notification_title (7362075195588639989) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_1 (6261149111900787302) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_2 (7688302770424064884) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_1 (2927018569542316055) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_2 (6897989352716156176) -->
- <skip />
- <!-- no translation found for face_dangling_notification_title (947852541060975473) -->
- <skip />
- <!-- no translation found for face_dangling_notification_msg (8806849376915541655) -->
- <skip />
- <!-- no translation found for biometric_dangling_notification_action_set_up (8246885009807817961) -->
+ <string name="fingerprint_dangling_notification_title" msgid="7362075195588639989">"Ontgrendelen met vingerafdruk weer instellen"</string>
+ <!-- no translation found for fingerprint_dangling_notification_msg_1 (8517140433796229725) -->
<skip />
- <!-- no translation found for biometric_dangling_notification_action_not_now (8095249216864443491) -->
+ <!-- no translation found for fingerprint_dangling_notification_msg_2 (7578829498452127613) -->
<skip />
+ <string name="fingerprint_dangling_notification_msg_all_deleted_1" msgid="2927018569542316055">"<xliff:g id="FINGERPRINT">%s</xliff:g> werkte niet goed en is verwijderd. Stel deze opnieuw in om de telefoon met je vingerafdruk te ontgrendelen."</string>
+ <string name="fingerprint_dangling_notification_msg_all_deleted_2" msgid="6897989352716156176">"<xliff:g id="FINGERPRINT_0">%1$s</xliff:g> en <xliff:g id="FINGERPRINT_1">%2$s</xliff:g> werkten niet goed en zijn verwijderd. Stel ze opnieuw in om de telefoon met je vingerafdruk te ontgrendelen."</string>
+ <string name="face_dangling_notification_title" msgid="947852541060975473">"Ontgrendelen via gezichtsherkenning weer instellen"</string>
+ <string name="face_dangling_notification_msg" msgid="8806849376915541655">"Je gezichtsmodel werkte niet goed en is verwijderd. Stel het opnieuw in om de telefoon met je gezicht te ontgrendelen."</string>
+ <string name="biometric_dangling_notification_action_set_up" msgid="8246885009807817961">"Instellen"</string>
+ <string name="biometric_dangling_notification_action_not_now" msgid="8095249216864443491">"Niet nu"</string>
</resources>
diff --git a/core/res/res/values-or/strings.xml b/core/res/res/values-or/strings.xml
index c00998acbe16..9abed2b264f4 100644
--- a/core/res/res/values-or/strings.xml
+++ b/core/res/res/values-or/strings.xml
@@ -283,6 +283,8 @@
<string name="global_action_voice_assist" msgid="6655788068555086695">"ଭଏସ୍‌ ସହାୟକ"</string>
<string name="global_action_lockdown" msgid="2475471405907902963">"ଲକ୍ କରନ୍ତୁ"</string>
<string name="status_bar_notification_info_overflow" msgid="3330152558746563475">"999+"</string>
+ <!-- no translation found for notification_compact_heads_up_reply (2425293958371284340) -->
+ <skip />
<string name="notification_hidden_text" msgid="2835519769868187223">"ନୂଆ ବିଜ୍ଞପ୍ତି"</string>
<string name="notification_channel_physical_keyboard" msgid="5417306456125988096">"ଫିଜିକଲ୍ କୀ’ବୋର୍ଡ"</string>
<string name="notification_channel_security" msgid="8516754650348238057">"ସୁରକ୍ଷା"</string>
@@ -2144,7 +2146,7 @@
<string name="dynamic_mode_notification_channel_name" msgid="2986926422100223328">"ନିୟମିତ ମୋଡ୍‍ ସୂଚନା ବିଜ୍ଞପ୍ତି"</string>
<string name="dynamic_mode_notification_title" msgid="1388718452788985481">"ବେଟେରୀ ସେଭର ଚାଲୁ କରାଯାଇଛି"</string>
<string name="dynamic_mode_notification_summary" msgid="1639031262484979689">"ବ୍ୟାଟେରୀ ଲାଇଫ ବଢ଼ାଇବା ପାଇଁ ବ୍ୟାଟେରୀ ବ୍ୟବହାର କମ୍ କରିବା"</string>
- <string name="dynamic_mode_notification_title_v2" msgid="5072385242078021152">"ବ୍ୟାଟେରୀ ସେଭର୍‌ ଚାଲୁ‌ ଅଛି"</string>
+ <string name="dynamic_mode_notification_title_v2" msgid="5072385242078021152">"ବେଟେରୀ ସେଭର ଚାଲୁ ଅଛି"</string>
<string name="dynamic_mode_notification_summary_v2" msgid="2142444344663147938">"ବେଟେରୀ ଲାଇଫକୁ ବଢ଼ାଇବା ପାଇଁ ବେଟେରୀ ସେଭରକୁ ଚାଲୁ କରାଯାଇଛି"</string>
<string name="battery_saver_notification_channel_name" msgid="3918243458067916913">"ବେଟେରୀ ସେଭର"</string>
<string name="battery_saver_off_notification_title" msgid="7637255960468032515">"ବ୍ୟାଟେରୀ ସେଭର୍ ବନ୍ଦ ଅଛି"</string>
@@ -2413,22 +2415,15 @@
<string name="satellite_notification_open_message" msgid="4149234979688273729">"Messages ଖୋଲନ୍ତୁ"</string>
<string name="satellite_notification_how_it_works" msgid="3132069321977520519">"ଏହା କିପରି କାମ କରେ"</string>
<string name="unarchival_session_app_label" msgid="6811856981546348205">"ବାକି ଅଛି…"</string>
- <!-- no translation found for fingerprint_dangling_notification_title (7362075195588639989) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_1 (6261149111900787302) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_2 (7688302770424064884) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_1 (2927018569542316055) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_2 (6897989352716156176) -->
- <skip />
- <!-- no translation found for face_dangling_notification_title (947852541060975473) -->
- <skip />
- <!-- no translation found for face_dangling_notification_msg (8806849376915541655) -->
- <skip />
- <!-- no translation found for biometric_dangling_notification_action_set_up (8246885009807817961) -->
+ <string name="fingerprint_dangling_notification_title" msgid="7362075195588639989">"ଫିଙ୍ଗରପ୍ରିଣ୍ଟ ଅନଲକ ପୁଣି ସେଟ ଅପ କରନ୍ତୁ"</string>
+ <!-- no translation found for fingerprint_dangling_notification_msg_1 (8517140433796229725) -->
<skip />
- <!-- no translation found for biometric_dangling_notification_action_not_now (8095249216864443491) -->
+ <!-- no translation found for fingerprint_dangling_notification_msg_2 (7578829498452127613) -->
<skip />
+ <string name="fingerprint_dangling_notification_msg_all_deleted_1" msgid="2927018569542316055">"<xliff:g id="FINGERPRINT">%s</xliff:g> ସଠିକ ଭାବେ କାମ କରୁନାହିଁ ଏବଂ ଏହାକୁ ଡିଲିଟ କରାଯାଇଛି। ଟିପଚିହ୍ନ ମାଧ୍ୟମରେ ଆପଣଙ୍କ ଫୋନକୁ ଅନଲକ କରିବାକୁ ଏହାକୁ ପୁଣି ସେଟ ଅପ କରନ୍ତୁ।"</string>
+ <string name="fingerprint_dangling_notification_msg_all_deleted_2" msgid="6897989352716156176">"<xliff:g id="FINGERPRINT_0">%1$s</xliff:g> ଏବଂ <xliff:g id="FINGERPRINT_1">%2$s</xliff:g> ସଠିକ ଭାବେ କାମ କରୁନାହିଁ ଏବଂ ଏଗୁଡ଼ିକୁ ଡିଲିଟ କରାଯାଇଛି। ଆପଣଙ୍କ ଟିପଚିହ୍ନ ମାଧ୍ୟମରେ ଆପଣଙ୍କ ଫୋନକୁ ଅନଲକ କରିବାକୁ ଏଗୁଡ଼ିକୁ ପୁଣି ସେଟ ଅପ କରନ୍ତୁ।"</string>
+ <string name="face_dangling_notification_title" msgid="947852541060975473">"ଫେସ୍ ଅନଲକ୍ ପୁଣି ସେଟ୍ ଅପ୍ କରନ୍ତୁ"</string>
+ <string name="face_dangling_notification_msg" msgid="8806849376915541655">"ଆପଣଙ୍କ ଫେସ ମଡେଲ ସଠିକ ଭାବେ କାମ କରୁନାହିଁ ଏବଂ ଏହାକୁ ଡିଲିଟ କରାଯାଇଛି। ଫେସ ମାଧ୍ୟମରେ ଆପଣଙ୍କ ଫୋନକୁ ଅନଲକ କରିବାକୁ ଏହାକୁ ପୁଣି ସେଟ ଅପ କରନ୍ତୁ।"</string>
+ <string name="biometric_dangling_notification_action_set_up" msgid="8246885009807817961">"ସେଟ ଅପ କରନ୍ତୁ"</string>
+ <string name="biometric_dangling_notification_action_not_now" msgid="8095249216864443491">"ବର୍ତ୍ତମାନ ନୁହେଁ"</string>
</resources>
diff --git a/core/res/res/values-pa/strings.xml b/core/res/res/values-pa/strings.xml
index 77020acff650..64b326c9f227 100644
--- a/core/res/res/values-pa/strings.xml
+++ b/core/res/res/values-pa/strings.xml
@@ -283,6 +283,8 @@
<string name="global_action_voice_assist" msgid="6655788068555086695">"ਅਵਾਜ਼ੀ ਸਹਾਇਕ"</string>
<string name="global_action_lockdown" msgid="2475471405907902963">"ਲਾਕਡਾਊਨ"</string>
<string name="status_bar_notification_info_overflow" msgid="3330152558746563475">"999+"</string>
+ <!-- no translation found for notification_compact_heads_up_reply (2425293958371284340) -->
+ <skip />
<string name="notification_hidden_text" msgid="2835519769868187223">"ਨਵੀਂ ਸੂਚਨਾ"</string>
<string name="notification_channel_physical_keyboard" msgid="5417306456125988096">"ਭੌਤਿਕ ਕੀ-ਬੋਰਡ"</string>
<string name="notification_channel_security" msgid="8516754650348238057">"ਸੁਰੱਖਿਆ"</string>
@@ -2413,22 +2415,15 @@
<string name="satellite_notification_open_message" msgid="4149234979688273729">"Messages ਐਪ ਖੋਲ੍ਹੋ"</string>
<string name="satellite_notification_how_it_works" msgid="3132069321977520519">"ਇਹ ਕਿਵੇਂ ਕੰਮ ਕਰਦਾ ਹੈ"</string>
<string name="unarchival_session_app_label" msgid="6811856981546348205">"ਵਿਚਾਰ-ਅਧੀਨ..."</string>
- <!-- no translation found for fingerprint_dangling_notification_title (7362075195588639989) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_1 (6261149111900787302) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_2 (7688302770424064884) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_1 (2927018569542316055) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_2 (6897989352716156176) -->
- <skip />
- <!-- no translation found for face_dangling_notification_title (947852541060975473) -->
- <skip />
- <!-- no translation found for face_dangling_notification_msg (8806849376915541655) -->
- <skip />
- <!-- no translation found for biometric_dangling_notification_action_set_up (8246885009807817961) -->
+ <string name="fingerprint_dangling_notification_title" msgid="7362075195588639989">"ਫਿੰਗਰਪ੍ਰਿੰਟ ਅਣਲਾਕ ਦਾ ਦੁਬਾਰਾ ਸੈੱਟਅੱਪ ਕਰੋ"</string>
+ <!-- no translation found for fingerprint_dangling_notification_msg_1 (8517140433796229725) -->
<skip />
- <!-- no translation found for biometric_dangling_notification_action_not_now (8095249216864443491) -->
+ <!-- no translation found for fingerprint_dangling_notification_msg_2 (7578829498452127613) -->
<skip />
+ <string name="fingerprint_dangling_notification_msg_all_deleted_1" msgid="2927018569542316055">"<xliff:g id="FINGERPRINT">%s</xliff:g> ਚੰਗੀ ਤਰ੍ਹਾਂ ਕੰਮ ਨਹੀਂ ਕਰ ਰਿਹਾ ਸੀ ਅਤੇ ਉਸਨੂੰ ਮਿਟਾਇਆ ਗਿਆ ਸੀ। ਆਪਣੇ ਫ਼ੋਨ ਨੂੰ ਫਿੰਗਰਪ੍ਰਿੰਟ ਨਾਲ ਅਣਲਾਕ ਕਰਨ ਲਈ ਇਸਦਾ ਦੁਬਾਰਾ ਸੈੱਟਅੱਪ ਕਰੋ।"</string>
+ <string name="fingerprint_dangling_notification_msg_all_deleted_2" msgid="6897989352716156176">"<xliff:g id="FINGERPRINT_0">%1$s</xliff:g> ਅਤੇ <xliff:g id="FINGERPRINT_1">%2$s</xliff:g> ਚੰਗੀ ਤਰ੍ਹਾਂ ਕੰਮ ਨਹੀਂ ਕਰ ਰਹੇ ਸੀ ਅਤੇ ਉਨ੍ਹਾਂ ਨੂੰ ਮਿਟਾਇਆ ਗਿਆ ਸੀ। ਆਪਣੇ ਫ਼ੋਨ ਨੂੰ ਆਪਣੇ ਫਿੰਗਰਪ੍ਰਿੰਟ ਨਾਲ ਅਣਲਾਕ ਕਰਨ ਲਈ ਇਨ੍ਹਾਂ ਦਾ ਦੁਬਾਰਾ ਸੈੱਟਅੱਪ ਕਰੋ।"</string>
+ <string name="face_dangling_notification_title" msgid="947852541060975473">"ਫ਼ੇਸ ਅਣਲਾਕ ਦਾ ਦੁਬਾਰਾ ਸੈੱਟਅੱਪ ਕਰੋ"</string>
+ <string name="face_dangling_notification_msg" msgid="8806849376915541655">"ਤੁਹਾਡਾ ਚਿਹਰੇ ਦਾ ਮਾਡਲ ਚੰਗੀ ਤਰ੍ਹਾਂ ਕੰਮ ਨਹੀਂ ਕਰ ਰਿਹਾ ਸੀ ਅਤੇ ਉਸਨੂੰ ਮਿਟਾਇਆ ਗਿਆ ਸੀ। ਆਪਣੇ ਫ਼ੋਨ ਨੂੰ ਚਿਹਰੇ ਨਾਲ ਅਣਲਾਕ ਕਰਨ ਲਈ ਇਸਦਾ ਦੁਬਾਰਾ ਸੈੱਟਅੱਪ ਕਰੋ।"</string>
+ <string name="biometric_dangling_notification_action_set_up" msgid="8246885009807817961">"ਸੈੱਟਅੱਪ ਕਰੋ"</string>
+ <string name="biometric_dangling_notification_action_not_now" msgid="8095249216864443491">"ਹੁਣੇ ਨਹੀਂ"</string>
</resources>
diff --git a/core/res/res/values-pl/strings.xml b/core/res/res/values-pl/strings.xml
index 0971ae40d500..9cc99166d98f 100644
--- a/core/res/res/values-pl/strings.xml
+++ b/core/res/res/values-pl/strings.xml
@@ -285,6 +285,8 @@
<string name="global_action_voice_assist" msgid="6655788068555086695">"Asystent głosowy"</string>
<string name="global_action_lockdown" msgid="2475471405907902963">"Blokada"</string>
<string name="status_bar_notification_info_overflow" msgid="3330152558746563475">"&gt;999"</string>
+ <!-- no translation found for notification_compact_heads_up_reply (2425293958371284340) -->
+ <skip />
<string name="notification_hidden_text" msgid="2835519769868187223">"Nowe powiadomienie"</string>
<string name="notification_channel_physical_keyboard" msgid="5417306456125988096">"Klawiatura fizyczna"</string>
<string name="notification_channel_security" msgid="8516754650348238057">"Bezpieczeństwo"</string>
@@ -2415,22 +2417,15 @@
<string name="satellite_notification_open_message" msgid="4149234979688273729">"Otwórz Wiadomości"</string>
<string name="satellite_notification_how_it_works" msgid="3132069321977520519">"Jak to działa"</string>
<string name="unarchival_session_app_label" msgid="6811856981546348205">"Oczekiwanie…"</string>
- <!-- no translation found for fingerprint_dangling_notification_title (7362075195588639989) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_1 (6261149111900787302) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_2 (7688302770424064884) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_1 (2927018569542316055) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_2 (6897989352716156176) -->
- <skip />
- <!-- no translation found for face_dangling_notification_title (947852541060975473) -->
- <skip />
- <!-- no translation found for face_dangling_notification_msg (8806849376915541655) -->
- <skip />
- <!-- no translation found for biometric_dangling_notification_action_set_up (8246885009807817961) -->
+ <string name="fingerprint_dangling_notification_title" msgid="7362075195588639989">"Skonfiguruj ponownie odblokowywanie odciskiem palca"</string>
+ <!-- no translation found for fingerprint_dangling_notification_msg_1 (8517140433796229725) -->
<skip />
- <!-- no translation found for biometric_dangling_notification_action_not_now (8095249216864443491) -->
+ <!-- no translation found for fingerprint_dangling_notification_msg_2 (7578829498452127613) -->
<skip />
+ <string name="fingerprint_dangling_notification_msg_all_deleted_1" msgid="2927018569542316055">"Odcisk palca <xliff:g id="FINGERPRINT">%s</xliff:g> nie sprawdzał się dobrze i został usunięty. Skonfiguruj go ponownie, aby odblokowywać telefon odciskiem palca."</string>
+ <string name="fingerprint_dangling_notification_msg_all_deleted_2" msgid="6897989352716156176">"Odciski palca <xliff:g id="FINGERPRINT_0">%1$s</xliff:g> i <xliff:g id="FINGERPRINT_1">%2$s</xliff:g> nie sprawdzały się dobrze i zostały usunięte. Skonfiguruj je ponownie, aby odblokowywać telefon odciskiem palca."</string>
+ <string name="face_dangling_notification_title" msgid="947852541060975473">"Skonfiguruj ponownie rozpoznawanie twarzy"</string>
+ <string name="face_dangling_notification_msg" msgid="8806849376915541655">"Twój model twarzy nie sprawdzał się dobrze i został usunięty. Skonfiguruj go ponownie, aby odblokowywać telefon za pomocą skanu twarzy."</string>
+ <string name="biometric_dangling_notification_action_set_up" msgid="8246885009807817961">"Skonfiguruj"</string>
+ <string name="biometric_dangling_notification_action_not_now" msgid="8095249216864443491">"Nie teraz"</string>
</resources>
diff --git a/core/res/res/values-pt-rBR/strings.xml b/core/res/res/values-pt-rBR/strings.xml
index b04cd4c6ed98..e3b49a0b399b 100644
--- a/core/res/res/values-pt-rBR/strings.xml
+++ b/core/res/res/values-pt-rBR/strings.xml
@@ -284,6 +284,8 @@
<string name="global_action_voice_assist" msgid="6655788068555086695">"Ajuda de voz"</string>
<string name="global_action_lockdown" msgid="2475471405907902963">"Bloqueio total"</string>
<string name="status_bar_notification_info_overflow" msgid="3330152558746563475">"&gt;999"</string>
+ <!-- no translation found for notification_compact_heads_up_reply (2425293958371284340) -->
+ <skip />
<string name="notification_hidden_text" msgid="2835519769868187223">"Nova notificação"</string>
<string name="notification_channel_physical_keyboard" msgid="5417306456125988096">"Teclado físico"</string>
<string name="notification_channel_security" msgid="8516754650348238057">"Segurança"</string>
@@ -2395,7 +2397,7 @@
<string name="keyboard_layout_notification_more_than_three_selected_message" msgid="1581834181578206937">"Layout do teclado definido como <xliff:g id="LAYOUT_1">%1$s</xliff:g>, <xliff:g id="LAYOUT_2">%2$s</xliff:g>, <xliff:g id="LAYOUT_3">%3$s</xliff:g>… Toque para mudar."</string>
<string name="keyboard_layout_notification_multiple_selected_title" msgid="5242444914367024499">"Teclados físicos configurados"</string>
<string name="keyboard_layout_notification_multiple_selected_message" msgid="6576533454124419202">"Toque para conferir os teclados"</string>
- <string name="profile_label_private" msgid="6463418670715290696">"Particular"</string>
+ <string name="profile_label_private" msgid="6463418670715290696">"Privado"</string>
<string name="profile_label_clone" msgid="769106052210954285">"Clone"</string>
<string name="profile_label_work" msgid="3495359133038584618">"Trabalho"</string>
<string name="profile_label_work_2" msgid="4691533661598632135">"Trabalho 2"</string>
@@ -2414,22 +2416,15 @@
<string name="satellite_notification_open_message" msgid="4149234979688273729">"Abrir o app Mensagens"</string>
<string name="satellite_notification_how_it_works" msgid="3132069321977520519">"Como funciona"</string>
<string name="unarchival_session_app_label" msgid="6811856981546348205">"Pendente…"</string>
- <!-- no translation found for fingerprint_dangling_notification_title (7362075195588639989) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_1 (6261149111900787302) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_2 (7688302770424064884) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_1 (2927018569542316055) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_2 (6897989352716156176) -->
- <skip />
- <!-- no translation found for face_dangling_notification_title (947852541060975473) -->
- <skip />
- <!-- no translation found for face_dangling_notification_msg (8806849376915541655) -->
- <skip />
- <!-- no translation found for biometric_dangling_notification_action_set_up (8246885009807817961) -->
+ <string name="fingerprint_dangling_notification_title" msgid="7362075195588639989">"Configurar o Desbloqueio por impressão digital de novo"</string>
+ <!-- no translation found for fingerprint_dangling_notification_msg_1 (8517140433796229725) -->
<skip />
- <!-- no translation found for biometric_dangling_notification_action_not_now (8095249216864443491) -->
+ <!-- no translation found for fingerprint_dangling_notification_msg_2 (7578829498452127613) -->
<skip />
+ <string name="fingerprint_dangling_notification_msg_all_deleted_1" msgid="2927018569542316055">"A impressão digital <xliff:g id="FINGERPRINT">%s</xliff:g> não estava funcionando bem e foi excluída. Configure de novo para desbloquear o smartphone com a impressão digital."</string>
+ <string name="fingerprint_dangling_notification_msg_all_deleted_2" msgid="6897989352716156176">"As impressões digitais <xliff:g id="FINGERPRINT_0">%1$s</xliff:g> e <xliff:g id="FINGERPRINT_1">%2$s</xliff:g> não estavam funcionando bem e foram excluídas. Configure de novo para desbloquear o smartphone com a impressão digital."</string>
+ <string name="face_dangling_notification_title" msgid="947852541060975473">"Configure o Desbloqueio facial de novo"</string>
+ <string name="face_dangling_notification_msg" msgid="8806849376915541655">"Seu modelo de rosto não estava funcionando bem e foi excluído. Configure de novo para desbloquear o smartphone com o rosto."</string>
+ <string name="biometric_dangling_notification_action_set_up" msgid="8246885009807817961">"Configuração"</string>
+ <string name="biometric_dangling_notification_action_not_now" msgid="8095249216864443491">"Agora não"</string>
</resources>
diff --git a/core/res/res/values-pt-rPT/strings.xml b/core/res/res/values-pt-rPT/strings.xml
index 90f9eda9c32e..d8c1f72fecb5 100644
--- a/core/res/res/values-pt-rPT/strings.xml
+++ b/core/res/res/values-pt-rPT/strings.xml
@@ -284,6 +284,8 @@
<string name="global_action_voice_assist" msgid="6655788068555086695">"Assist. de voz"</string>
<string name="global_action_lockdown" msgid="2475471405907902963">"Bloquear"</string>
<string name="status_bar_notification_info_overflow" msgid="3330152558746563475">"999+"</string>
+ <!-- no translation found for notification_compact_heads_up_reply (2425293958371284340) -->
+ <skip />
<string name="notification_hidden_text" msgid="2835519769868187223">"Nova notificação"</string>
<string name="notification_channel_physical_keyboard" msgid="5417306456125988096">"Teclado físico"</string>
<string name="notification_channel_security" msgid="8516754650348238057">"Segurança"</string>
@@ -327,7 +329,7 @@
<string name="permgroupdesc_storage" msgid="5378659041354582769">"aceder aos ficheiros no seu dispositivo"</string>
<string name="permgrouplab_readMediaAural" msgid="1858331312624942053">"Música e áudio"</string>
<string name="permgroupdesc_readMediaAural" msgid="7565467343667089595">"aceder a música e áudio no seu dispositivo"</string>
- <string name="permgrouplab_readMediaVisual" msgid="4724874717811908660">"fotos e vídeos"</string>
+ <string name="permgrouplab_readMediaVisual" msgid="4724874717811908660">"Fotos e vídeos"</string>
<string name="permgroupdesc_readMediaVisual" msgid="4080463241903508688">"aceder a fotos e vídeos no seu dispositivo"</string>
<string name="permgrouplab_microphone" msgid="2480597427667420076">"Microfone"</string>
<string name="permgroupdesc_microphone" msgid="1047786732792487722">"gravar áudio"</string>
@@ -2414,22 +2416,15 @@
<string name="satellite_notification_open_message" msgid="4149234979688273729">"Abre a app Mensagens"</string>
<string name="satellite_notification_how_it_works" msgid="3132069321977520519">"Como funciona"</string>
<string name="unarchival_session_app_label" msgid="6811856981546348205">"Pendente…"</string>
- <!-- no translation found for fingerprint_dangling_notification_title (7362075195588639989) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_1 (6261149111900787302) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_2 (7688302770424064884) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_1 (2927018569542316055) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_2 (6897989352716156176) -->
- <skip />
- <!-- no translation found for face_dangling_notification_title (947852541060975473) -->
- <skip />
- <!-- no translation found for face_dangling_notification_msg (8806849376915541655) -->
- <skip />
- <!-- no translation found for biometric_dangling_notification_action_set_up (8246885009807817961) -->
+ <string name="fingerprint_dangling_notification_title" msgid="7362075195588639989">"Configure o Desbloqueio por impressão digital novamente"</string>
+ <!-- no translation found for fingerprint_dangling_notification_msg_1 (8517140433796229725) -->
<skip />
- <!-- no translation found for biometric_dangling_notification_action_not_now (8095249216864443491) -->
+ <!-- no translation found for fingerprint_dangling_notification_msg_2 (7578829498452127613) -->
<skip />
+ <string name="fingerprint_dangling_notification_msg_all_deleted_1" msgid="2927018569542316055">"A <xliff:g id="FINGERPRINT">%s</xliff:g> não estava a funcionar bem e foi eliminada. Configure-a novamente para desbloquear o telemóvel com a impressão digital."</string>
+ <string name="fingerprint_dangling_notification_msg_all_deleted_2" msgid="6897989352716156176">"A <xliff:g id="FINGERPRINT_0">%1$s</xliff:g> e a <xliff:g id="FINGERPRINT_1">%2$s</xliff:g> não estavam a funcionar bem e foram eliminadas. Configure-as novamente para desbloquear o telemóvel com a sua impressão digital."</string>
+ <string name="face_dangling_notification_title" msgid="947852541060975473">"Configure o Desbloqueio facial novamente"</string>
+ <string name="face_dangling_notification_msg" msgid="8806849376915541655">"O seu modelo de rosto não estava a funcionar bem e foi eliminado. Configure-o novamente para desbloquear o telemóvel com o rosto."</string>
+ <string name="biometric_dangling_notification_action_set_up" msgid="8246885009807817961">"Configurar"</string>
+ <string name="biometric_dangling_notification_action_not_now" msgid="8095249216864443491">"Agora não"</string>
</resources>
diff --git a/core/res/res/values-pt/strings.xml b/core/res/res/values-pt/strings.xml
index b04cd4c6ed98..e3b49a0b399b 100644
--- a/core/res/res/values-pt/strings.xml
+++ b/core/res/res/values-pt/strings.xml
@@ -284,6 +284,8 @@
<string name="global_action_voice_assist" msgid="6655788068555086695">"Ajuda de voz"</string>
<string name="global_action_lockdown" msgid="2475471405907902963">"Bloqueio total"</string>
<string name="status_bar_notification_info_overflow" msgid="3330152558746563475">"&gt;999"</string>
+ <!-- no translation found for notification_compact_heads_up_reply (2425293958371284340) -->
+ <skip />
<string name="notification_hidden_text" msgid="2835519769868187223">"Nova notificação"</string>
<string name="notification_channel_physical_keyboard" msgid="5417306456125988096">"Teclado físico"</string>
<string name="notification_channel_security" msgid="8516754650348238057">"Segurança"</string>
@@ -2395,7 +2397,7 @@
<string name="keyboard_layout_notification_more_than_three_selected_message" msgid="1581834181578206937">"Layout do teclado definido como <xliff:g id="LAYOUT_1">%1$s</xliff:g>, <xliff:g id="LAYOUT_2">%2$s</xliff:g>, <xliff:g id="LAYOUT_3">%3$s</xliff:g>… Toque para mudar."</string>
<string name="keyboard_layout_notification_multiple_selected_title" msgid="5242444914367024499">"Teclados físicos configurados"</string>
<string name="keyboard_layout_notification_multiple_selected_message" msgid="6576533454124419202">"Toque para conferir os teclados"</string>
- <string name="profile_label_private" msgid="6463418670715290696">"Particular"</string>
+ <string name="profile_label_private" msgid="6463418670715290696">"Privado"</string>
<string name="profile_label_clone" msgid="769106052210954285">"Clone"</string>
<string name="profile_label_work" msgid="3495359133038584618">"Trabalho"</string>
<string name="profile_label_work_2" msgid="4691533661598632135">"Trabalho 2"</string>
@@ -2414,22 +2416,15 @@
<string name="satellite_notification_open_message" msgid="4149234979688273729">"Abrir o app Mensagens"</string>
<string name="satellite_notification_how_it_works" msgid="3132069321977520519">"Como funciona"</string>
<string name="unarchival_session_app_label" msgid="6811856981546348205">"Pendente…"</string>
- <!-- no translation found for fingerprint_dangling_notification_title (7362075195588639989) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_1 (6261149111900787302) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_2 (7688302770424064884) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_1 (2927018569542316055) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_2 (6897989352716156176) -->
- <skip />
- <!-- no translation found for face_dangling_notification_title (947852541060975473) -->
- <skip />
- <!-- no translation found for face_dangling_notification_msg (8806849376915541655) -->
- <skip />
- <!-- no translation found for biometric_dangling_notification_action_set_up (8246885009807817961) -->
+ <string name="fingerprint_dangling_notification_title" msgid="7362075195588639989">"Configurar o Desbloqueio por impressão digital de novo"</string>
+ <!-- no translation found for fingerprint_dangling_notification_msg_1 (8517140433796229725) -->
<skip />
- <!-- no translation found for biometric_dangling_notification_action_not_now (8095249216864443491) -->
+ <!-- no translation found for fingerprint_dangling_notification_msg_2 (7578829498452127613) -->
<skip />
+ <string name="fingerprint_dangling_notification_msg_all_deleted_1" msgid="2927018569542316055">"A impressão digital <xliff:g id="FINGERPRINT">%s</xliff:g> não estava funcionando bem e foi excluída. Configure de novo para desbloquear o smartphone com a impressão digital."</string>
+ <string name="fingerprint_dangling_notification_msg_all_deleted_2" msgid="6897989352716156176">"As impressões digitais <xliff:g id="FINGERPRINT_0">%1$s</xliff:g> e <xliff:g id="FINGERPRINT_1">%2$s</xliff:g> não estavam funcionando bem e foram excluídas. Configure de novo para desbloquear o smartphone com a impressão digital."</string>
+ <string name="face_dangling_notification_title" msgid="947852541060975473">"Configure o Desbloqueio facial de novo"</string>
+ <string name="face_dangling_notification_msg" msgid="8806849376915541655">"Seu modelo de rosto não estava funcionando bem e foi excluído. Configure de novo para desbloquear o smartphone com o rosto."</string>
+ <string name="biometric_dangling_notification_action_set_up" msgid="8246885009807817961">"Configuração"</string>
+ <string name="biometric_dangling_notification_action_not_now" msgid="8095249216864443491">"Agora não"</string>
</resources>
diff --git a/core/res/res/values-ro/strings.xml b/core/res/res/values-ro/strings.xml
index c43df4fa6e41..7de995219497 100644
--- a/core/res/res/values-ro/strings.xml
+++ b/core/res/res/values-ro/strings.xml
@@ -284,6 +284,8 @@
<string name="global_action_voice_assist" msgid="6655788068555086695">"Asistent vocal"</string>
<string name="global_action_lockdown" msgid="2475471405907902963">"Blocare strictă"</string>
<string name="status_bar_notification_info_overflow" msgid="3330152558746563475">"˃999"</string>
+ <!-- no translation found for notification_compact_heads_up_reply (2425293958371284340) -->
+ <skip />
<string name="notification_hidden_text" msgid="2835519769868187223">"Notificare nouă"</string>
<string name="notification_channel_physical_keyboard" msgid="5417306456125988096">"Tastatură fizică"</string>
<string name="notification_channel_security" msgid="8516754650348238057">"Securitate"</string>
@@ -2414,22 +2416,15 @@
<string name="satellite_notification_open_message" msgid="4149234979688273729">"Deschide Mesaje"</string>
<string name="satellite_notification_how_it_works" msgid="3132069321977520519">"Cum funcționează"</string>
<string name="unarchival_session_app_label" msgid="6811856981546348205">"În așteptare..."</string>
- <!-- no translation found for fingerprint_dangling_notification_title (7362075195588639989) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_1 (6261149111900787302) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_2 (7688302770424064884) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_1 (2927018569542316055) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_2 (6897989352716156176) -->
- <skip />
- <!-- no translation found for face_dangling_notification_title (947852541060975473) -->
- <skip />
- <!-- no translation found for face_dangling_notification_msg (8806849376915541655) -->
- <skip />
- <!-- no translation found for biometric_dangling_notification_action_set_up (8246885009807817961) -->
+ <string name="fingerprint_dangling_notification_title" msgid="7362075195588639989">"Configurează din nou Deblocarea cu amprenta"</string>
+ <!-- no translation found for fingerprint_dangling_notification_msg_1 (8517140433796229725) -->
<skip />
- <!-- no translation found for biometric_dangling_notification_action_not_now (8095249216864443491) -->
+ <!-- no translation found for fingerprint_dangling_notification_msg_2 (7578829498452127613) -->
<skip />
+ <string name="fingerprint_dangling_notification_msg_all_deleted_1" msgid="2927018569542316055">"<xliff:g id="FINGERPRINT">%s</xliff:g> nu funcționa bine și s-a șters. Configureaz-o din nou pentru a-ți debloca telefonul cu amprenta."</string>
+ <string name="fingerprint_dangling_notification_msg_all_deleted_2" msgid="6897989352716156176">"<xliff:g id="FINGERPRINT_0">%1$s</xliff:g> și <xliff:g id="FINGERPRINT_1">%2$s</xliff:g> nu funcționau bine și s-au șters. Configurează-le din nou pentru a-ți debloca telefonul cu amprenta."</string>
+ <string name="face_dangling_notification_title" msgid="947852541060975473">"Reconfigurează Deblocarea facială"</string>
+ <string name="face_dangling_notification_msg" msgid="8806849376915541655">"Modelul tău facial nu funcționa bine și s-a șters. Configurează-l din nou pentru a-ți debloca telefonul folosindu-ți chipul."</string>
+ <string name="biometric_dangling_notification_action_set_up" msgid="8246885009807817961">"Configurează"</string>
+ <string name="biometric_dangling_notification_action_not_now" msgid="8095249216864443491">"Nu acum"</string>
</resources>
diff --git a/core/res/res/values-ru/strings.xml b/core/res/res/values-ru/strings.xml
index 32a2338b284d..d999bf5b2050 100644
--- a/core/res/res/values-ru/strings.xml
+++ b/core/res/res/values-ru/strings.xml
@@ -285,6 +285,8 @@
<string name="global_action_voice_assist" msgid="6655788068555086695">"Аудиоподсказки"</string>
<string name="global_action_lockdown" msgid="2475471405907902963">"Блокировка входа"</string>
<string name="status_bar_notification_info_overflow" msgid="3330152558746563475">"&gt;999"</string>
+ <!-- no translation found for notification_compact_heads_up_reply (2425293958371284340) -->
+ <skip />
<string name="notification_hidden_text" msgid="2835519769868187223">"Новое уведомление"</string>
<string name="notification_channel_physical_keyboard" msgid="5417306456125988096">"Физическая клавиатура"</string>
<string name="notification_channel_security" msgid="8516754650348238057">"Безопасность"</string>
@@ -668,7 +670,7 @@
</string-array>
<string name="fingerprint_error_not_match" msgid="4599441812893438961">"Отпечаток не распознан."</string>
<string name="fingerprint_udfps_error_not_match" msgid="8236930793223158856">"Отпечаток не распознан."</string>
- <string name="fingerprint_dialog_use_fingerprint_instead" msgid="5590293588784953188">"Лицо не распознано. Используйте отпечаток."</string>
+ <string name="fingerprint_dialog_use_fingerprint_instead" msgid="5590293588784953188">"Лицо не распознано. Сканируйте отпечаток пальца."</string>
<string name="fingerprint_authenticated" msgid="2024862866860283100">"Отпечаток пальца проверен"</string>
<string name="face_authenticated_no_confirmation_required" msgid="8867889115112348167">"Лицо распознано"</string>
<string name="face_authenticated_confirmation_required" msgid="6872632732508013755">"Лицо распознано, нажмите кнопку \"Подтвердить\""</string>
@@ -2396,7 +2398,7 @@
<string name="keyboard_layout_notification_more_than_three_selected_message" msgid="1581834181578206937">"Настроены раскладки клавиатуры для яз.: <xliff:g id="LAYOUT_1">%1$s</xliff:g>, <xliff:g id="LAYOUT_2">%2$s</xliff:g>, <xliff:g id="LAYOUT_3">%3$s</xliff:g> и др. Нажмите, чтобы изменить."</string>
<string name="keyboard_layout_notification_multiple_selected_title" msgid="5242444914367024499">"Физические клавиатуры настроены"</string>
<string name="keyboard_layout_notification_multiple_selected_message" msgid="6576533454124419202">"Нажмите, чтобы посмотреть подключенные клавиатуры."</string>
- <string name="profile_label_private" msgid="6463418670715290696">"Личный"</string>
+ <string name="profile_label_private" msgid="6463418670715290696">"Частный"</string>
<string name="profile_label_clone" msgid="769106052210954285">"Клон"</string>
<string name="profile_label_work" msgid="3495359133038584618">"Рабочий"</string>
<string name="profile_label_work_2" msgid="4691533661598632135">"Рабочий 2"</string>
@@ -2415,22 +2417,15 @@
<string name="satellite_notification_open_message" msgid="4149234979688273729">"Открыть Сообщения"</string>
<string name="satellite_notification_how_it_works" msgid="3132069321977520519">"Узнать принцип работы"</string>
<string name="unarchival_session_app_label" msgid="6811856981546348205">"Обработка…"</string>
- <!-- no translation found for fingerprint_dangling_notification_title (7362075195588639989) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_1 (6261149111900787302) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_2 (7688302770424064884) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_1 (2927018569542316055) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_2 (6897989352716156176) -->
- <skip />
- <!-- no translation found for face_dangling_notification_title (947852541060975473) -->
- <skip />
- <!-- no translation found for face_dangling_notification_msg (8806849376915541655) -->
- <skip />
- <!-- no translation found for biometric_dangling_notification_action_set_up (8246885009807817961) -->
+ <string name="fingerprint_dangling_notification_title" msgid="7362075195588639989">"Настройте разблокировку по отпечатку пальца заново"</string>
+ <!-- no translation found for fingerprint_dangling_notification_msg_1 (8517140433796229725) -->
<skip />
- <!-- no translation found for biometric_dangling_notification_action_not_now (8095249216864443491) -->
+ <!-- no translation found for fingerprint_dangling_notification_msg_2 (7578829498452127613) -->
<skip />
+ <string name="fingerprint_dangling_notification_msg_all_deleted_1" msgid="2927018569542316055">"Отпечаток пальца \"<xliff:g id="FINGERPRINT">%s</xliff:g>\" оказался неудачным и был удален. Чтобы использовать разблокировку с помощью отпечатка пальца, настройте ее заново."</string>
+ <string name="fingerprint_dangling_notification_msg_all_deleted_2" msgid="6897989352716156176">"Отпечатки пальцев \"<xliff:g id="FINGERPRINT_0">%1$s</xliff:g>\" и \"<xliff:g id="FINGERPRINT_1">%2$s</xliff:g>\" оказались неудачными и были удалены. Чтобы использовать разблокировку с помощью отпечатка пальца, настройте ее заново."</string>
+ <string name="face_dangling_notification_title" msgid="947852541060975473">"Настройте фейсконтроль заново"</string>
+ <string name="face_dangling_notification_msg" msgid="8806849376915541655">"Модель лица оказалась неудачной и была удалена. Чтобы пользоваться фейсконтролем, настройте его заново."</string>
+ <string name="biometric_dangling_notification_action_set_up" msgid="8246885009807817961">"Настроить"</string>
+ <string name="biometric_dangling_notification_action_not_now" msgid="8095249216864443491">"Не сейчас"</string>
</resources>
diff --git a/core/res/res/values-si/strings.xml b/core/res/res/values-si/strings.xml
index 9539cef0f26c..a8eda4f65c7e 100644
--- a/core/res/res/values-si/strings.xml
+++ b/core/res/res/values-si/strings.xml
@@ -283,6 +283,8 @@
<string name="global_action_voice_assist" msgid="6655788068555086695">"හඬ සහායක"</string>
<string name="global_action_lockdown" msgid="2475471405907902963">"අගුලු දැමීම"</string>
<string name="status_bar_notification_info_overflow" msgid="3330152558746563475">"999+"</string>
+ <!-- no translation found for notification_compact_heads_up_reply (2425293958371284340) -->
+ <skip />
<string name="notification_hidden_text" msgid="2835519769868187223">"නව දැනුම්දීම"</string>
<string name="notification_channel_physical_keyboard" msgid="5417306456125988096">"භෞතික යතුරු පුවරුව"</string>
<string name="notification_channel_security" msgid="8516754650348238057">"ආරක්ෂාව"</string>
@@ -2413,22 +2415,15 @@
<string name="satellite_notification_open_message" msgid="4149234979688273729">"Messages විවෘත කරන්න"</string>
<string name="satellite_notification_how_it_works" msgid="3132069321977520519">"එය ක්‍රියා කරන ආකාරය"</string>
<string name="unarchival_session_app_label" msgid="6811856981546348205">"පොරොත්තුයි..."</string>
- <!-- no translation found for fingerprint_dangling_notification_title (7362075195588639989) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_1 (6261149111900787302) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_2 (7688302770424064884) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_1 (2927018569542316055) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_2 (6897989352716156176) -->
- <skip />
- <!-- no translation found for face_dangling_notification_title (947852541060975473) -->
- <skip />
- <!-- no translation found for face_dangling_notification_msg (8806849376915541655) -->
- <skip />
- <!-- no translation found for biometric_dangling_notification_action_set_up (8246885009807817961) -->
+ <string name="fingerprint_dangling_notification_title" msgid="7362075195588639989">"ඇඟිලි සලකුණු අගුලු හැරීම නැවත සකසන්න"</string>
+ <!-- no translation found for fingerprint_dangling_notification_msg_1 (8517140433796229725) -->
<skip />
- <!-- no translation found for biometric_dangling_notification_action_not_now (8095249216864443491) -->
+ <!-- no translation found for fingerprint_dangling_notification_msg_2 (7578829498452127613) -->
<skip />
+ <string name="fingerprint_dangling_notification_msg_all_deleted_1" msgid="2927018569542316055">"<xliff:g id="FINGERPRINT">%s</xliff:g> හොඳින් ක්‍රියා නොකළේය, එය මකන ලදි ඇඟිලි සලකුණ මගින් ඔබේ දුරකථනය අගුලු හැරීමට එය නැවත සකසන්න."</string>
+ <string name="fingerprint_dangling_notification_msg_all_deleted_2" msgid="6897989352716156176">"<xliff:g id="FINGERPRINT_0">%1$s</xliff:g> සහ <xliff:g id="FINGERPRINT_1">%2$s</xliff:g> හොඳින් ක්‍රියා නොකළේය, කාර්යසාධනය දියුණූ කිරීමට ඒවා මකන ලදි. ඔබේ ඇඟිලි සලකුණ මගින් ඔබේ දුරකථනය අගුලු හැරීමට ඒවා නැවත සකසන්න."</string>
+ <string name="face_dangling_notification_title" msgid="947852541060975473">"මුහුණෙන් අගුලු හැරීම නැවත සකසන්න"</string>
+ <string name="face_dangling_notification_msg" msgid="8806849376915541655">"ඔබේ මුහුණු මාදිලිය හොඳින් ක්‍රියා නොකරයි, එය මකන ලදි. මුහුණ මගින් ඔබේ දුරකථනය අගුලු හැරීමට එය නැවත සකසන්න."</string>
+ <string name="biometric_dangling_notification_action_set_up" msgid="8246885009807817961">"සකසන්න"</string>
+ <string name="biometric_dangling_notification_action_not_now" msgid="8095249216864443491">"දැන් නොවේ"</string>
</resources>
diff --git a/core/res/res/values-sk/strings.xml b/core/res/res/values-sk/strings.xml
index c72a426d0436..46897cbbf7cb 100644
--- a/core/res/res/values-sk/strings.xml
+++ b/core/res/res/values-sk/strings.xml
@@ -285,6 +285,8 @@
<string name="global_action_voice_assist" msgid="6655788068555086695">"Hlasový asistent"</string>
<string name="global_action_lockdown" msgid="2475471405907902963">"Uzamknúť"</string>
<string name="status_bar_notification_info_overflow" msgid="3330152558746563475">"999+"</string>
+ <!-- no translation found for notification_compact_heads_up_reply (2425293958371284340) -->
+ <skip />
<string name="notification_hidden_text" msgid="2835519769868187223">"Nové upozornenie"</string>
<string name="notification_channel_physical_keyboard" msgid="5417306456125988096">"Fyzická klávesnica"</string>
<string name="notification_channel_security" msgid="8516754650348238057">"Zabezpečenie"</string>
@@ -2415,22 +2417,15 @@
<string name="satellite_notification_open_message" msgid="4149234979688273729">"Otvoriť Správy"</string>
<string name="satellite_notification_how_it_works" msgid="3132069321977520519">"Ako to funguje"</string>
<string name="unarchival_session_app_label" msgid="6811856981546348205">"Nespracovaná…"</string>
- <!-- no translation found for fingerprint_dangling_notification_title (7362075195588639989) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_1 (6261149111900787302) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_2 (7688302770424064884) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_1 (2927018569542316055) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_2 (6897989352716156176) -->
- <skip />
- <!-- no translation found for face_dangling_notification_title (947852541060975473) -->
- <skip />
- <!-- no translation found for face_dangling_notification_msg (8806849376915541655) -->
- <skip />
- <!-- no translation found for biometric_dangling_notification_action_set_up (8246885009807817961) -->
+ <string name="fingerprint_dangling_notification_title" msgid="7362075195588639989">"Znova nastavte odomknutie odtlačkom prsta"</string>
+ <!-- no translation found for fingerprint_dangling_notification_msg_1 (8517140433796229725) -->
<skip />
- <!-- no translation found for biometric_dangling_notification_action_not_now (8095249216864443491) -->
+ <!-- no translation found for fingerprint_dangling_notification_msg_2 (7578829498452127613) -->
<skip />
+ <string name="fingerprint_dangling_notification_msg_all_deleted_1" msgid="2927018569542316055">"Odtlačok <xliff:g id="FINGERPRINT">%s</xliff:g> nefungoval správne a bol odstránený. Ak chcete odomykať telefón odtlačkom prsta, nastavte ho znova."</string>
+ <string name="fingerprint_dangling_notification_msg_all_deleted_2" msgid="6897989352716156176">"Odtlačky <xliff:g id="FINGERPRINT_0">%1$s</xliff:g> a <xliff:g id="FINGERPRINT_1">%2$s</xliff:g> nefungovali správne a boli odstránené. Ak chcete odomykať telefón odtlačkom prsta, nastavte ich znova."</string>
+ <string name="face_dangling_notification_title" msgid="947852541060975473">"Znova nastavte odomknutie tvárou"</string>
+ <string name="face_dangling_notification_msg" msgid="8806849376915541655">"Váš model tváre nefungoval správne a bol odstránený. Ak chcete odomykať telefón tvárou, nastavte ho znova."</string>
+ <string name="biometric_dangling_notification_action_set_up" msgid="8246885009807817961">"Nastaviť"</string>
+ <string name="biometric_dangling_notification_action_not_now" msgid="8095249216864443491">"Teraz nie"</string>
</resources>
diff --git a/core/res/res/values-sl/strings.xml b/core/res/res/values-sl/strings.xml
index e1be803cce1b..2f10d584fed9 100644
--- a/core/res/res/values-sl/strings.xml
+++ b/core/res/res/values-sl/strings.xml
@@ -285,6 +285,8 @@
<string name="global_action_voice_assist" msgid="6655788068555086695">"Glas. pomočnik"</string>
<string name="global_action_lockdown" msgid="2475471405907902963">"Zakleni"</string>
<string name="status_bar_notification_info_overflow" msgid="3330152558746563475">"999 +"</string>
+ <!-- no translation found for notification_compact_heads_up_reply (2425293958371284340) -->
+ <skip />
<string name="notification_hidden_text" msgid="2835519769868187223">"Novo obvestilo"</string>
<string name="notification_channel_physical_keyboard" msgid="5417306456125988096">"Fizična tipkovnica"</string>
<string name="notification_channel_security" msgid="8516754650348238057">"Varnost"</string>
@@ -1733,7 +1735,7 @@
<string name="accessibility_service_screen_control_title" msgid="190017412626919776">"Ogledovanje in upravljanje zaslona"</string>
<string name="accessibility_service_screen_control_description" msgid="6946315917771791525">"Bere lahko vso vsebino na zaslonu ter prikaže vsebino prek drugih aplikacij."</string>
<string name="accessibility_service_action_perform_title" msgid="779670378951658160">"Ogledovanje in izvajanje dejanj"</string>
- <string name="accessibility_service_action_perform_description" msgid="2718852014003170558">"Spremlja lahko vaše interakcije z aplikacijo ali tipalom strojne opreme ter komunicira z aplikacijami v vašem imenu."</string>
+ <string name="accessibility_service_action_perform_description" msgid="2718852014003170558">"Spremlja lahko vaše interakcije z aplikacijo ali tipalom ter komunicira z aplikacijami v vašem imenu."</string>
<string name="accessibility_dialog_button_allow" msgid="2092558122987144530">"Dovoli"</string>
<string name="accessibility_dialog_button_deny" msgid="4129575637812472671">"Zavrni"</string>
<string name="accessibility_dialog_button_uninstall" msgid="2952465517671708108">"Odmesti"</string>
@@ -2415,22 +2417,15 @@
<string name="satellite_notification_open_message" msgid="4149234979688273729">"Odpri Sporočila"</string>
<string name="satellite_notification_how_it_works" msgid="3132069321977520519">"Kako deluje"</string>
<string name="unarchival_session_app_label" msgid="6811856981546348205">"V teku …"</string>
- <!-- no translation found for fingerprint_dangling_notification_title (7362075195588639989) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_1 (6261149111900787302) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_2 (7688302770424064884) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_1 (2927018569542316055) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_2 (6897989352716156176) -->
- <skip />
- <!-- no translation found for face_dangling_notification_title (947852541060975473) -->
- <skip />
- <!-- no translation found for face_dangling_notification_msg (8806849376915541655) -->
- <skip />
- <!-- no translation found for biometric_dangling_notification_action_set_up (8246885009807817961) -->
+ <string name="fingerprint_dangling_notification_title" msgid="7362075195588639989">"Vnovična nastavitev odklepanja s prstnim odtisom"</string>
+ <!-- no translation found for fingerprint_dangling_notification_msg_1 (8517140433796229725) -->
<skip />
- <!-- no translation found for biometric_dangling_notification_action_not_now (8095249216864443491) -->
+ <!-- no translation found for fingerprint_dangling_notification_msg_2 (7578829498452127613) -->
<skip />
+ <string name="fingerprint_dangling_notification_msg_all_deleted_1" msgid="2927018569542316055">"<xliff:g id="FINGERPRINT">%s</xliff:g> ni deloval pravilno in je bil izbrisan. Znova ga nastavite, če želite telefon odklepati s prstnim odtisom."</string>
+ <string name="fingerprint_dangling_notification_msg_all_deleted_2" msgid="6897989352716156176">"<xliff:g id="FINGERPRINT_0">%1$s</xliff:g> in <xliff:g id="FINGERPRINT_1">%2$s</xliff:g> nista delovala pravilno in sta bila izbrisana. Znova ju nastavite, če želite telefon odklepati s prstnim odtisom."</string>
+ <string name="face_dangling_notification_title" msgid="947852541060975473">"Vnovična nastavitev odklepanja z obrazom"</string>
+ <string name="face_dangling_notification_msg" msgid="8806849376915541655">"Model obraza ni deloval pravilno in je bil izbrisan. Znova ga nastavite, če želite telefon odklepati z obrazom."</string>
+ <string name="biometric_dangling_notification_action_set_up" msgid="8246885009807817961">"Nastavi"</string>
+ <string name="biometric_dangling_notification_action_not_now" msgid="8095249216864443491">"Ne zdaj"</string>
</resources>
diff --git a/core/res/res/values-sq/strings.xml b/core/res/res/values-sq/strings.xml
index 4d79ce707787..70980b61e972 100644
--- a/core/res/res/values-sq/strings.xml
+++ b/core/res/res/values-sq/strings.xml
@@ -283,6 +283,8 @@
<string name="global_action_voice_assist" msgid="6655788068555086695">"Ndihma zanore"</string>
<string name="global_action_lockdown" msgid="2475471405907902963">"Blloko"</string>
<string name="status_bar_notification_info_overflow" msgid="3330152558746563475">"999+"</string>
+ <!-- no translation found for notification_compact_heads_up_reply (2425293958371284340) -->
+ <skip />
<string name="notification_hidden_text" msgid="2835519769868187223">"Njoftim i ri"</string>
<string name="notification_channel_physical_keyboard" msgid="5417306456125988096">"Tastiera fizike"</string>
<string name="notification_channel_security" msgid="8516754650348238057">"Siguria"</string>
@@ -2415,9 +2417,9 @@
<string name="unarchival_session_app_label" msgid="6811856981546348205">"Në pritje..."</string>
<!-- no translation found for fingerprint_dangling_notification_title (7362075195588639989) -->
<skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_1 (6261149111900787302) -->
+ <!-- no translation found for fingerprint_dangling_notification_msg_1 (8517140433796229725) -->
<skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_2 (7688302770424064884) -->
+ <!-- no translation found for fingerprint_dangling_notification_msg_2 (7578829498452127613) -->
<skip />
<!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_1 (2927018569542316055) -->
<skip />
diff --git a/core/res/res/values-sr/strings.xml b/core/res/res/values-sr/strings.xml
index 95ccead79ce2..86387c95f727 100644
--- a/core/res/res/values-sr/strings.xml
+++ b/core/res/res/values-sr/strings.xml
@@ -284,6 +284,8 @@
<string name="global_action_voice_assist" msgid="6655788068555086695">"Гласовна помоћ"</string>
<string name="global_action_lockdown" msgid="2475471405907902963">"Закључавање"</string>
<string name="status_bar_notification_info_overflow" msgid="3330152558746563475">"999+"</string>
+ <!-- no translation found for notification_compact_heads_up_reply (2425293958371284340) -->
+ <skip />
<string name="notification_hidden_text" msgid="2835519769868187223">"Ново обавештење"</string>
<string name="notification_channel_physical_keyboard" msgid="5417306456125988096">"Физичка тастатура"</string>
<string name="notification_channel_security" msgid="8516754650348238057">"Безбедност"</string>
@@ -835,11 +837,11 @@
<string name="policylab_watchLogin" msgid="7599669460083719504">"Надзор покушаја откључавања екрана"</string>
<string name="policydesc_watchLogin" product="tablet" msgid="2388436408621909298">"Прати број нетачно унетих лозинки приликом откључавања екрана и закључава таблет или брише податке са таблета ако је нетачна лозинка унета превише пута."</string>
<string name="policydesc_watchLogin" product="tv" msgid="2140588224468517507">"Надгледа број нетачних лозинки унетих при откључавању екрана и закључава Android TV уређај или брише све податке са Android TV уређаја ако се унесе превише нетачних лозинки."</string>
- <string name="policydesc_watchLogin" product="automotive" msgid="7011438994051251521">"Прати број нетачно унетих лозинки при откључавању екрана и закључава систем за инфо-забаву или брише све податке са система за инфо-забаву ако је нетачна лозинка унета превише пута."</string>
+ <string name="policydesc_watchLogin" product="automotive" msgid="7011438994051251521">"Прати број нетачно унетих лозинки при откључавању екрана и закључава систем за информације и забаву или брише све податке са система за информације и забаву ако је нетачна лозинка унета превише пута."</string>
<string name="policydesc_watchLogin" product="default" msgid="4885030206253600299">"Прати број нетачно унетих лозинки при откључавању екрана и закључава телефон или брише све податке са телефона ако је нетачна лозинка унета превише пута."</string>
<string name="policydesc_watchLogin_secondaryUser" product="tablet" msgid="2049038943004297474">"Надгледа број нетачних лозинки унетих при откључавању екрана и закључава таблет или брише све податке овог корисника ако се унесе превише нетачних лозинки."</string>
<string name="policydesc_watchLogin_secondaryUser" product="tv" msgid="8965224107449407052">"Надгледа број нетачних лозинки унетих при откључавању екрана и закључава Android TV уређај или брише све податке овог корисника ако се унесе превише нетачних лозинки."</string>
- <string name="policydesc_watchLogin_secondaryUser" product="automotive" msgid="7180857406058327941">"Надгледа број нетачних лозинки унетих при откључавању екрана и закључава систем за инфо-забаву или брише све податке овог профила ако се унесе превише нетачних лозинки."</string>
+ <string name="policydesc_watchLogin_secondaryUser" product="automotive" msgid="7180857406058327941">"Надгледа број нетачних лозинки унетих при откључавању екрана и закључава систем за информације и забаву или брише све податке овог профила ако се унесе превише нетачних лозинки."</string>
<string name="policydesc_watchLogin_secondaryUser" product="default" msgid="9177645136475155924">"Надгледа број нетачних лозинки унетих при откључавању екрана и закључава телефон или брише све податке овог корисника ако се унесе превише нетачних лозинки."</string>
<string name="policylab_resetPassword" msgid="214556238645096520">"Промена закључавања екрана"</string>
<string name="policydesc_resetPassword" msgid="4626419138439341851">"Мења откључавање екрана."</string>
@@ -848,13 +850,13 @@
<string name="policylab_wipeData" msgid="1359485247727537311">"Брисање свих података"</string>
<string name="policydesc_wipeData" product="tablet" msgid="7245372676261947507">"Брисање података на таблету без упозорења ресетовањем на фабричка подешавања."</string>
<string name="policydesc_wipeData" product="tv" msgid="513862488950801261">"Брише податке Android TV уређаја без упозорења помоћу ресетовања на фабричка подешавања."</string>
- <string name="policydesc_wipeData" product="automotive" msgid="660804547737323300">"Брише податке на систему за инфо-забаву без упозорења ресетовањем на фабричка подешавања."</string>
+ <string name="policydesc_wipeData" product="automotive" msgid="660804547737323300">"Брише податке на систему за информације и забаву без упозорења ресетовањем на фабричка подешавања."</string>
<string name="policydesc_wipeData" product="default" msgid="8036084184768379022">"Брисање података на телефону без упозорења ресетовањем на фабричка подешавања."</string>
<string name="policylab_wipeData_secondaryUser" product="automotive" msgid="115034358520328373">"Брисање података профила"</string>
<string name="policylab_wipeData_secondaryUser" product="default" msgid="413813645323433166">"Обриши податке корисника"</string>
<string name="policydesc_wipeData_secondaryUser" product="tablet" msgid="2336676480090926470">"Брише податке овог корисника на овом таблету без упозорења."</string>
<string name="policydesc_wipeData_secondaryUser" product="tv" msgid="2293713284515865200">"Брише податке овог корисника на овом Android TV уређају без упозорења."</string>
- <string name="policydesc_wipeData_secondaryUser" product="automotive" msgid="4658832487305780879">"Брише податке овог профила на овом систему за инфо-забаву без упозорења."</string>
+ <string name="policydesc_wipeData_secondaryUser" product="automotive" msgid="4658832487305780879">"Брише податке овог профила на овом систему за информације и забаву без упозорења."</string>
<string name="policydesc_wipeData_secondaryUser" product="default" msgid="2788325512167208654">"Брише податке овог корисника на овом телефону без упозорења."</string>
<string name="policylab_setGlobalProxy" msgid="215332221188670221">"Подесите глобални прокси сервер уређаја"</string>
<string name="policydesc_setGlobalProxy" msgid="7149665222705519604">"Подешава глобални прокси уређаја који ће се користити док су смернице омогућене. Само власник уређаја може да подеси глобални прокси."</string>
@@ -2414,22 +2416,15 @@
<string name="satellite_notification_open_message" msgid="4149234979688273729">"Отвори Messages"</string>
<string name="satellite_notification_how_it_works" msgid="3132069321977520519">"Принцип рада"</string>
<string name="unarchival_session_app_label" msgid="6811856981546348205">"На чекању..."</string>
- <!-- no translation found for fingerprint_dangling_notification_title (7362075195588639989) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_1 (6261149111900787302) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_2 (7688302770424064884) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_1 (2927018569542316055) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_2 (6897989352716156176) -->
- <skip />
- <!-- no translation found for face_dangling_notification_title (947852541060975473) -->
- <skip />
- <!-- no translation found for face_dangling_notification_msg (8806849376915541655) -->
- <skip />
- <!-- no translation found for biometric_dangling_notification_action_set_up (8246885009807817961) -->
+ <string name="fingerprint_dangling_notification_title" msgid="7362075195588639989">"Поново подесите откључавање отиском прста"</string>
+ <!-- no translation found for fingerprint_dangling_notification_msg_1 (8517140433796229725) -->
<skip />
- <!-- no translation found for biometric_dangling_notification_action_not_now (8095249216864443491) -->
+ <!-- no translation found for fingerprint_dangling_notification_msg_2 (7578829498452127613) -->
<skip />
+ <string name="fingerprint_dangling_notification_msg_all_deleted_1" msgid="2927018569542316055">"<xliff:g id="FINGERPRINT">%s</xliff:g> није функционисао и избрисали смо га. Поново га подесите да бисте телефон откључавали отиском прста."</string>
+ <string name="fingerprint_dangling_notification_msg_all_deleted_2" msgid="6897989352716156176">"<xliff:g id="FINGERPRINT_0">%1$s</xliff:g> и <xliff:g id="FINGERPRINT_1">%2$s</xliff:g> нису функционисали и избрисали смо их. Поново их подесите да бисте телефон откључавали отиском прста."</string>
+ <string name="face_dangling_notification_title" msgid="947852541060975473">"Поново подесите откључавање лицем"</string>
+ <string name="face_dangling_notification_msg" msgid="8806849376915541655">"Ваш модел лица није функционисао и избрисали смо га. Поново га подесите да бисте телефон откључавали лицем."</string>
+ <string name="biometric_dangling_notification_action_set_up" msgid="8246885009807817961">"Подеси"</string>
+ <string name="biometric_dangling_notification_action_not_now" msgid="8095249216864443491">"Не сада"</string>
</resources>
diff --git a/core/res/res/values-sv/strings.xml b/core/res/res/values-sv/strings.xml
index 0cbdda1a4c27..6c15ad8ff76f 100644
--- a/core/res/res/values-sv/strings.xml
+++ b/core/res/res/values-sv/strings.xml
@@ -283,6 +283,8 @@
<string name="global_action_voice_assist" msgid="6655788068555086695">"Voice Assist"</string>
<string name="global_action_lockdown" msgid="2475471405907902963">"Låsning"</string>
<string name="status_bar_notification_info_overflow" msgid="3330152558746563475">"999+"</string>
+ <!-- no translation found for notification_compact_heads_up_reply (2425293958371284340) -->
+ <skip />
<string name="notification_hidden_text" msgid="2835519769868187223">"Ny avisering"</string>
<string name="notification_channel_physical_keyboard" msgid="5417306456125988096">"Fysiskt tangentbord"</string>
<string name="notification_channel_security" msgid="8516754650348238057">"Säkerhet"</string>
@@ -623,12 +625,12 @@
<string name="permdesc_postNotification" msgid="5974977162462877075">"Tillåter att appen visar aviseringar"</string>
<string name="permlab_turnScreenOn" msgid="219344053664171492">"Slå på skärmen"</string>
<string name="permdesc_turnScreenOn" msgid="4394606875897601559">"Tillåter att appen slår på skärmen."</string>
- <string name="permlab_useBiometric" msgid="6314741124749633786">"använd biometrisk maskinvara"</string>
- <string name="permdesc_useBiometric" msgid="7502858732677143410">"Tillåter att appen använder biometrisk maskinvara vid autentisering"</string>
- <string name="permlab_manageFingerprint" msgid="7432667156322821178">"hantera maskinvara för fingeravtryck"</string>
+ <string name="permlab_useBiometric" msgid="6314741124749633786">"använd biometrisk hårdvara"</string>
+ <string name="permdesc_useBiometric" msgid="7502858732677143410">"Tillåter att appen använder biometrisk hårdvara vid autentisering"</string>
+ <string name="permlab_manageFingerprint" msgid="7432667156322821178">"hantera hårdvara för fingeravtryck"</string>
<string name="permdesc_manageFingerprint" msgid="2025616816437339865">"Tillåter att appen anropar metoder för att lägga till och radera fingeravtrycksmallar."</string>
- <string name="permlab_useFingerprint" msgid="1001421069766751922">"använda maskinvara för fingeravtryck"</string>
- <string name="permdesc_useFingerprint" msgid="412463055059323742">"Tillåter att appen använder maskinvara för fingeravtryck vid autentisering"</string>
+ <string name="permlab_useFingerprint" msgid="1001421069766751922">"använda hårdvara för fingeravtryck"</string>
+ <string name="permdesc_useFingerprint" msgid="412463055059323742">"Tillåter att appen använder hårdvara för fingeravtryck vid autentisering"</string>
<string name="permlab_audioWrite" msgid="8501705294265669405">"göra ändringar i din musiksamling"</string>
<string name="permdesc_audioWrite" msgid="8057399517013412431">"Tillåter att appen gör ändringar i din musiksamling."</string>
<string name="permlab_videoWrite" msgid="5940738769586451318">"göra ändringar i din videosamling"</string>
@@ -642,7 +644,7 @@
<string name="biometric_dialog_default_title" msgid="55026799173208210">"Verifiera din identitet"</string>
<string name="biometric_dialog_default_subtitle" msgid="8457232339298571992">"Fortsätt med hjälp av din biometriska data"</string>
<string name="biometric_or_screen_lock_dialog_default_subtitle" msgid="159539678371552009">"Fortsätt med hjälp av din biometriska data eller skärmlåset"</string>
- <string name="biometric_error_hw_unavailable" msgid="2494077380540615216">"Biometrisk maskinvara är inte tillgänglig"</string>
+ <string name="biometric_error_hw_unavailable" msgid="2494077380540615216">"Biometrisk hårdvara är inte tillgänglig"</string>
<string name="biometric_error_user_canceled" msgid="6732303949695293730">"Autentiseringen avbröts"</string>
<string name="biometric_not_recognized" msgid="5106687642694635888">"Identifierades inte"</string>
<string name="biometric_face_not_recognized" msgid="5535599455744525200">"Ansiktet känns inte igen"</string>
@@ -670,7 +672,7 @@
<string name="fingerprint_authenticated" msgid="2024862866860283100">"Fingeravtrycket har autentiserats"</string>
<string name="face_authenticated_no_confirmation_required" msgid="8867889115112348167">"Ansiktet har autentiserats"</string>
<string name="face_authenticated_confirmation_required" msgid="6872632732508013755">"Ansiktet har autentiserats. Tryck på Bekräfta"</string>
- <string name="fingerprint_error_hw_not_available" msgid="7755729484334001137">"Det finns ingen maskinvara för fingeravtryck"</string>
+ <string name="fingerprint_error_hw_not_available" msgid="7755729484334001137">"Det finns ingen hårdvara för fingeravtryck"</string>
<string name="fingerprint_error_no_space" msgid="7285481581905967580">"Det gick inte att konfigurera fingeravtryck"</string>
<string name="fingerprint_error_timeout" msgid="7361192266621252164">"Tiden för fingeravtrycksinställning gick ut. Försök igen."</string>
<string name="fingerprint_error_canceled" msgid="5541771463159727513">"Fingeravtrycksåtgärden avbröts"</string>
@@ -732,7 +734,7 @@
<string name="face_acquired_mouth_covering_detected_alt" msgid="1122294982850589766">"Något täcker ansiktet. Hela ansiktet måste synas."</string>
<string-array name="face_acquired_vendor">
</string-array>
- <string name="face_error_hw_not_available" msgid="5085202213036026288">"Ansiktsverifiering går ej. Otillgänglig maskinvara."</string>
+ <string name="face_error_hw_not_available" msgid="5085202213036026288">"Ansiktsverifiering går ej. Otillgänglig hårdvara."</string>
<string name="face_error_timeout" msgid="2598544068593889762">"Försök att använda ansiktslåset igen"</string>
<string name="face_error_no_space" msgid="5649264057026021723">"Kan inte lagra ny ansiktsdata. Radera först gammal data."</string>
<string name="face_error_canceled" msgid="2164434737103802131">"Ansiktsåtgärden har avbrutits."</string>
@@ -1731,7 +1733,7 @@
<string name="accessibility_service_screen_control_title" msgid="190017412626919776">"Visa och styra skärmen"</string>
<string name="accessibility_service_screen_control_description" msgid="6946315917771791525">"Den kan läsa allt innehåll på skärmen och visa innehåll över andra appar."</string>
<string name="accessibility_service_action_perform_title" msgid="779670378951658160">"Visa och vidta åtgärder"</string>
- <string name="accessibility_service_action_perform_description" msgid="2718852014003170558">"Den kan registrera din användning av en app eller maskinvarusensor och interagera med appar åt dig."</string>
+ <string name="accessibility_service_action_perform_description" msgid="2718852014003170558">"Den kan registrera din användning av en app eller hårdvarusensor och interagera med appar åt dig."</string>
<string name="accessibility_dialog_button_allow" msgid="2092558122987144530">"Tillåt"</string>
<string name="accessibility_dialog_button_deny" msgid="4129575637812472671">"Neka"</string>
<string name="accessibility_dialog_button_uninstall" msgid="2952465517671708108">"Avinstallera"</string>
@@ -2413,22 +2415,15 @@
<string name="satellite_notification_open_message" msgid="4149234979688273729">"Öppna Messages"</string>
<string name="satellite_notification_how_it_works" msgid="3132069321977520519">"Så fungerar det"</string>
<string name="unarchival_session_app_label" msgid="6811856981546348205">"Väntar …"</string>
- <!-- no translation found for fingerprint_dangling_notification_title (7362075195588639989) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_1 (6261149111900787302) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_2 (7688302770424064884) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_1 (2927018569542316055) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_2 (6897989352716156176) -->
- <skip />
- <!-- no translation found for face_dangling_notification_title (947852541060975473) -->
- <skip />
- <!-- no translation found for face_dangling_notification_msg (8806849376915541655) -->
- <skip />
- <!-- no translation found for biometric_dangling_notification_action_set_up (8246885009807817961) -->
+ <string name="fingerprint_dangling_notification_title" msgid="7362075195588639989">"Konfigurera fingeravtryckslås igen"</string>
+ <!-- no translation found for fingerprint_dangling_notification_msg_1 (8517140433796229725) -->
<skip />
- <!-- no translation found for biometric_dangling_notification_action_not_now (8095249216864443491) -->
+ <!-- no translation found for fingerprint_dangling_notification_msg_2 (7578829498452127613) -->
<skip />
+ <string name="fingerprint_dangling_notification_msg_all_deleted_1" msgid="2927018569542316055">"<xliff:g id="FINGERPRINT">%s</xliff:g> fungerade inte bra och har raderats. Konfigurera det igen för att låsa upp telefonen med fingeravtryck."</string>
+ <string name="fingerprint_dangling_notification_msg_all_deleted_2" msgid="6897989352716156176">"<xliff:g id="FINGERPRINT_0">%1$s</xliff:g> och <xliff:g id="FINGERPRINT_1">%2$s</xliff:g> fungerade inte bra och har raderats. Konfigurera dem igen för att låsa upp telefonen med fingeravtryck."</string>
+ <string name="face_dangling_notification_title" msgid="947852541060975473">"Konfigurera ansiktslås igen"</string>
+ <string name="face_dangling_notification_msg" msgid="8806849376915541655">"Ansiktsmodellen fungerade inte bra och har raderats. Konfigurera den igen för att låsa upp telefonen med ansiktet."</string>
+ <string name="biometric_dangling_notification_action_set_up" msgid="8246885009807817961">"Ställ in"</string>
+ <string name="biometric_dangling_notification_action_not_now" msgid="8095249216864443491">"Inte nu"</string>
</resources>
diff --git a/core/res/res/values-sw/strings.xml b/core/res/res/values-sw/strings.xml
index 10f55af3dc47..1437a3830d44 100644
--- a/core/res/res/values-sw/strings.xml
+++ b/core/res/res/values-sw/strings.xml
@@ -283,6 +283,8 @@
<string name="global_action_voice_assist" msgid="6655788068555086695">"Usaidizi wa Sauti"</string>
<string name="global_action_lockdown" msgid="2475471405907902963">"Funga"</string>
<string name="status_bar_notification_info_overflow" msgid="3330152558746563475">"999+"</string>
+ <!-- no translation found for notification_compact_heads_up_reply (2425293958371284340) -->
+ <skip />
<string name="notification_hidden_text" msgid="2835519769868187223">"Arifa mpya"</string>
<string name="notification_channel_physical_keyboard" msgid="5417306456125988096">"Kibodi halisi"</string>
<string name="notification_channel_security" msgid="8516754650348238057">"Usalama"</string>
@@ -2413,22 +2415,15 @@
<string name="satellite_notification_open_message" msgid="4149234979688273729">"Fungua Programu ya Messages"</string>
<string name="satellite_notification_how_it_works" msgid="3132069321977520519">"Utaratibu wake"</string>
<string name="unarchival_session_app_label" msgid="6811856981546348205">"Inashughulikiwa..."</string>
- <!-- no translation found for fingerprint_dangling_notification_title (7362075195588639989) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_1 (6261149111900787302) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_2 (7688302770424064884) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_1 (2927018569542316055) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_2 (6897989352716156176) -->
- <skip />
- <!-- no translation found for face_dangling_notification_title (947852541060975473) -->
- <skip />
- <!-- no translation found for face_dangling_notification_msg (8806849376915541655) -->
- <skip />
- <!-- no translation found for biometric_dangling_notification_action_set_up (8246885009807817961) -->
+ <string name="fingerprint_dangling_notification_title" msgid="7362075195588639989">"Weka tena mipangilio ya Kufungua kwa Alama ya Kidole"</string>
+ <!-- no translation found for fingerprint_dangling_notification_msg_1 (8517140433796229725) -->
<skip />
- <!-- no translation found for biometric_dangling_notification_action_not_now (8095249216864443491) -->
+ <!-- no translation found for fingerprint_dangling_notification_msg_2 (7578829498452127613) -->
<skip />
+ <string name="fingerprint_dangling_notification_msg_all_deleted_1" msgid="2927018569542316055">"Alama ya <xliff:g id="FINGERPRINT">%s</xliff:g> ilikuwa na hitilafu na imefutwa. Iweke tena ili ufungue simu yako kwa alama ya kidole."</string>
+ <string name="fingerprint_dangling_notification_msg_all_deleted_2" msgid="6897989352716156176">"Alama za <xliff:g id="FINGERPRINT_0">%1$s</xliff:g> na <xliff:g id="FINGERPRINT_1">%2$s</xliff:g> zilikuwa na hitilafu na zimefutwa. Ziweke tena ili ufungue simu yako kwa alama ya kidole."</string>
+ <string name="face_dangling_notification_title" msgid="947852541060975473">"Weka tena mipangilio ya Kufungua kwa Uso"</string>
+ <string name="face_dangling_notification_msg" msgid="8806849376915541655">"Muundo wako wa uso ulikuwa na hitilafu na umefutwa. Uweke tena ili ufungue simu yako kwa uso."</string>
+ <string name="biometric_dangling_notification_action_set_up" msgid="8246885009807817961">"Weka mipangilio"</string>
+ <string name="biometric_dangling_notification_action_not_now" msgid="8095249216864443491">"Si sasa"</string>
</resources>
diff --git a/core/res/res/values-ta/strings.xml b/core/res/res/values-ta/strings.xml
index 466e29a7e9b1..231b14c6a94d 100644
--- a/core/res/res/values-ta/strings.xml
+++ b/core/res/res/values-ta/strings.xml
@@ -283,6 +283,8 @@
<string name="global_action_voice_assist" msgid="6655788068555086695">"குரல் உதவி"</string>
<string name="global_action_lockdown" msgid="2475471405907902963">"பூட்டு"</string>
<string name="status_bar_notification_info_overflow" msgid="3330152558746563475">"999+"</string>
+ <!-- no translation found for notification_compact_heads_up_reply (2425293958371284340) -->
+ <skip />
<string name="notification_hidden_text" msgid="2835519769868187223">"புதிய அறிவிப்பு"</string>
<string name="notification_channel_physical_keyboard" msgid="5417306456125988096">"கைமுறை கீபோர்டு"</string>
<string name="notification_channel_security" msgid="8516754650348238057">"பாதுகாப்பு"</string>
@@ -2413,22 +2415,15 @@
<string name="satellite_notification_open_message" msgid="4149234979688273729">"Messages ஆப்ஸைத் திறக்கவும்"</string>
<string name="satellite_notification_how_it_works" msgid="3132069321977520519">"இது செயல்படும் விதம்"</string>
<string name="unarchival_session_app_label" msgid="6811856981546348205">"நிலுவையிலுள்ளது..."</string>
- <!-- no translation found for fingerprint_dangling_notification_title (7362075195588639989) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_1 (6261149111900787302) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_2 (7688302770424064884) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_1 (2927018569542316055) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_2 (6897989352716156176) -->
- <skip />
- <!-- no translation found for face_dangling_notification_title (947852541060975473) -->
- <skip />
- <!-- no translation found for face_dangling_notification_msg (8806849376915541655) -->
- <skip />
- <!-- no translation found for biometric_dangling_notification_action_set_up (8246885009807817961) -->
+ <string name="fingerprint_dangling_notification_title" msgid="7362075195588639989">"கைரேகை அன்லாக் அம்சத்தை மீண்டும் அமையுங்கள்"</string>
+ <!-- no translation found for fingerprint_dangling_notification_msg_1 (8517140433796229725) -->
<skip />
- <!-- no translation found for biometric_dangling_notification_action_not_now (8095249216864443491) -->
+ <!-- no translation found for fingerprint_dangling_notification_msg_2 (7578829498452127613) -->
<skip />
+ <string name="fingerprint_dangling_notification_msg_all_deleted_1" msgid="2927018569542316055">"<xliff:g id="FINGERPRINT">%s</xliff:g> சரியாகச் செயல்படவில்லை என்பதால் அது நீக்கபட்டது. கைரேகை மூலம் உங்கள் மொபைலை அன்லாக் செய்ய அதை மீண்டும் அமையுங்கள்."</string>
+ <string name="fingerprint_dangling_notification_msg_all_deleted_2" msgid="6897989352716156176">"<xliff:g id="FINGERPRINT_0">%1$s</xliff:g> மற்றும் <xliff:g id="FINGERPRINT_1">%2$s</xliff:g> சரியாகச் செயல்படவில்லை என்பதால் அவை நீக்கப்பட்டன. கைரேகை மூலம் உங்கள் மொபைலை அன்லாக் செய்ய அவற்றை மீண்டும் அமையுங்கள்."</string>
+ <string name="face_dangling_notification_title" msgid="947852541060975473">"\'முகம் காட்டித் திறத்தல்\' அம்சத்தை மீண்டும் அமையுங்கள்"</string>
+ <string name="face_dangling_notification_msg" msgid="8806849376915541655">"உங்கள் முகத் தோற்றப் பதிவு சரியாகச் செயல்படவில்லை என்பதால் அது நீக்கப்பட்டது. உங்கள் முகத்தைப் பயன்படுத்தி மொபைலை அன்லாக் செய்ய அதை மீண்டும் அமையுங்கள்."</string>
+ <string name="biometric_dangling_notification_action_set_up" msgid="8246885009807817961">"அமை"</string>
+ <string name="biometric_dangling_notification_action_not_now" msgid="8095249216864443491">"இப்போது வேண்டாம்"</string>
</resources>
diff --git a/core/res/res/values-te/strings.xml b/core/res/res/values-te/strings.xml
index db75aac8b027..cf4e19408909 100644
--- a/core/res/res/values-te/strings.xml
+++ b/core/res/res/values-te/strings.xml
@@ -283,6 +283,8 @@
<string name="global_action_voice_assist" msgid="6655788068555086695">"వాయిస్ అసిస్టెంట్"</string>
<string name="global_action_lockdown" msgid="2475471405907902963">"లాక్ చేయండి"</string>
<string name="status_bar_notification_info_overflow" msgid="3330152558746563475">"999+"</string>
+ <!-- no translation found for notification_compact_heads_up_reply (2425293958371284340) -->
+ <skip />
<string name="notification_hidden_text" msgid="2835519769868187223">"కొత్త నోటిఫికేషన్"</string>
<string name="notification_channel_physical_keyboard" msgid="5417306456125988096">"భౌతిక కీబోర్డ్"</string>
<string name="notification_channel_security" msgid="8516754650348238057">"సెక్యూరిటీ"</string>
@@ -2413,22 +2415,15 @@
<string name="satellite_notification_open_message" msgid="4149234979688273729">"Messagesను తెరవండి"</string>
<string name="satellite_notification_how_it_works" msgid="3132069321977520519">"ఇది ఎలా పని చేస్తుంది"</string>
<string name="unarchival_session_app_label" msgid="6811856981546348205">"పెండింగ్‌లో ఉంది..."</string>
- <!-- no translation found for fingerprint_dangling_notification_title (7362075195588639989) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_1 (6261149111900787302) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_2 (7688302770424064884) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_1 (2927018569542316055) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_2 (6897989352716156176) -->
- <skip />
- <!-- no translation found for face_dangling_notification_title (947852541060975473) -->
- <skip />
- <!-- no translation found for face_dangling_notification_msg (8806849376915541655) -->
- <skip />
- <!-- no translation found for biometric_dangling_notification_action_set_up (8246885009807817961) -->
+ <string name="fingerprint_dangling_notification_title" msgid="7362075195588639989">"వేలిముద్ర అన్‌లాక్‌ను మళ్లీ సెటప్ చేయండి"</string>
+ <!-- no translation found for fingerprint_dangling_notification_msg_1 (8517140433796229725) -->
<skip />
- <!-- no translation found for biometric_dangling_notification_action_not_now (8095249216864443491) -->
+ <!-- no translation found for fingerprint_dangling_notification_msg_2 (7578829498452127613) -->
<skip />
+ <string name="fingerprint_dangling_notification_msg_all_deleted_1" msgid="2927018569542316055">"<xliff:g id="FINGERPRINT">%s</xliff:g> సరిగ్గా పని చేయడం లేదు, తొలగించబడింది. వేలిముద్రతో మీ ఫోన్‌ను అన్‌లాక్ చేయడానికి దాన్ని మళ్లీ సెటప్ చేయండి."</string>
+ <string name="fingerprint_dangling_notification_msg_all_deleted_2" msgid="6897989352716156176">"<xliff:g id="FINGERPRINT_0">%1$s</xliff:g>, <xliff:g id="FINGERPRINT_1">%2$s</xliff:g> బాగా పని చేయడం లేదు, తొలగించబడ్డాయి. మీ వేలిముద్రతో మీ ఫోన్‌ను అన్‌లాక్ చేయడానికి వాటిని మళ్లీ సెటప్ చేయండి."</string>
+ <string name="face_dangling_notification_title" msgid="947852541060975473">"ఫేస్ అన్‌లాక్‌ను మళ్లీ సెటప్ చేయండి"</string>
+ <string name="face_dangling_notification_msg" msgid="8806849376915541655">"మీ ఫేస్ మోడల్ సరిగ్గా పని చేయడం లేదు, తొలగించబడింది. ఫేస్‌తో మీ ఫోన్‌ను అన్‌లాక్ చేయడానికి దాన్ని మళ్లీ సెటప్ చేయండి."</string>
+ <string name="biometric_dangling_notification_action_set_up" msgid="8246885009807817961">"సెటప్ చేయండి"</string>
+ <string name="biometric_dangling_notification_action_not_now" msgid="8095249216864443491">"ఇప్పుడు కాదు"</string>
</resources>
diff --git a/core/res/res/values-th/strings.xml b/core/res/res/values-th/strings.xml
index 284a5f273f22..59809c92ed96 100644
--- a/core/res/res/values-th/strings.xml
+++ b/core/res/res/values-th/strings.xml
@@ -283,6 +283,8 @@
<string name="global_action_voice_assist" msgid="6655788068555086695">"ตัวช่วยเสียง"</string>
<string name="global_action_lockdown" msgid="2475471405907902963">"ปิดล็อก"</string>
<string name="status_bar_notification_info_overflow" msgid="3330152558746563475">"999+"</string>
+ <!-- no translation found for notification_compact_heads_up_reply (2425293958371284340) -->
+ <skip />
<string name="notification_hidden_text" msgid="2835519769868187223">"การแจ้งเตือนใหม่"</string>
<string name="notification_channel_physical_keyboard" msgid="5417306456125988096">"แป้นพิมพ์จริง"</string>
<string name="notification_channel_security" msgid="8516754650348238057">"ความปลอดภัย"</string>
@@ -2413,22 +2415,15 @@
<string name="satellite_notification_open_message" msgid="4149234979688273729">"เปิด Messages"</string>
<string name="satellite_notification_how_it_works" msgid="3132069321977520519">"วิธีการทำงาน"</string>
<string name="unarchival_session_app_label" msgid="6811856981546348205">"รอดำเนินการ..."</string>
- <!-- no translation found for fingerprint_dangling_notification_title (7362075195588639989) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_1 (6261149111900787302) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_2 (7688302770424064884) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_1 (2927018569542316055) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_2 (6897989352716156176) -->
- <skip />
- <!-- no translation found for face_dangling_notification_title (947852541060975473) -->
- <skip />
- <!-- no translation found for face_dangling_notification_msg (8806849376915541655) -->
- <skip />
- <!-- no translation found for biometric_dangling_notification_action_set_up (8246885009807817961) -->
+ <string name="fingerprint_dangling_notification_title" msgid="7362075195588639989">"ตั้งค่าการปลดล็อกด้วยลายนิ้วมืออีกครั้ง"</string>
+ <!-- no translation found for fingerprint_dangling_notification_msg_1 (8517140433796229725) -->
<skip />
- <!-- no translation found for biometric_dangling_notification_action_not_now (8095249216864443491) -->
+ <!-- no translation found for fingerprint_dangling_notification_msg_2 (7578829498452127613) -->
<skip />
+ <string name="fingerprint_dangling_notification_msg_all_deleted_1" msgid="2927018569542316055">"<xliff:g id="FINGERPRINT">%s</xliff:g>ทำงานได้ไม่ดีและถูกลบออกไปแล้ว ตั้งค่าอีกครั้งเพื่อปลดล็อกโทรศัพท์ด้วยลายนิ้วมือ"</string>
+ <string name="fingerprint_dangling_notification_msg_all_deleted_2" msgid="6897989352716156176">"<xliff:g id="FINGERPRINT_0">%1$s</xliff:g> และ <xliff:g id="FINGERPRINT_1">%2$s</xliff:g> ทำงานได้ไม่ดีและถูกลบออกไปแล้ว ตั้งค่าอีกครั้งเพื่อปลดล็อกโทรศัพท์ด้วยลายนิ้วมือ"</string>
+ <string name="face_dangling_notification_title" msgid="947852541060975473">"ตั้งค่าการปลดล็อกด้วยใบหน้าอีกครั้ง"</string>
+ <string name="face_dangling_notification_msg" msgid="8806849376915541655">"รูปแบบใบหน้าของคุณทำงานได้ไม่ดีและถูกลบออกไปแล้ว ตั้งค่าอีกครั้งเพื่อปลดล็อกโทรศัพท์ด้วยใบหน้า"</string>
+ <string name="biometric_dangling_notification_action_set_up" msgid="8246885009807817961">"ตั้งค่า"</string>
+ <string name="biometric_dangling_notification_action_not_now" msgid="8095249216864443491">"ไว้ทีหลัง"</string>
</resources>
diff --git a/core/res/res/values-tl/strings.xml b/core/res/res/values-tl/strings.xml
index 4dd488681f5b..7ba81ad9b55e 100644
--- a/core/res/res/values-tl/strings.xml
+++ b/core/res/res/values-tl/strings.xml
@@ -283,6 +283,8 @@
<string name="global_action_voice_assist" msgid="6655788068555086695">"Voice Assist"</string>
<string name="global_action_lockdown" msgid="2475471405907902963">"I-lockdown"</string>
<string name="status_bar_notification_info_overflow" msgid="3330152558746563475">"999+"</string>
+ <!-- no translation found for notification_compact_heads_up_reply (2425293958371284340) -->
+ <skip />
<string name="notification_hidden_text" msgid="2835519769868187223">"Bagong notification"</string>
<string name="notification_channel_physical_keyboard" msgid="5417306456125988096">"Pisikal na keyboard"</string>
<string name="notification_channel_security" msgid="8516754650348238057">"Seguridad"</string>
@@ -2413,22 +2415,15 @@
<string name="satellite_notification_open_message" msgid="4149234979688273729">"Buksan ang Messages"</string>
<string name="satellite_notification_how_it_works" msgid="3132069321977520519">"Paano ito gumagana"</string>
<string name="unarchival_session_app_label" msgid="6811856981546348205">"Nakabinbin..."</string>
- <!-- no translation found for fingerprint_dangling_notification_title (7362075195588639989) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_1 (6261149111900787302) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_2 (7688302770424064884) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_1 (2927018569542316055) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_2 (6897989352716156176) -->
- <skip />
- <!-- no translation found for face_dangling_notification_title (947852541060975473) -->
- <skip />
- <!-- no translation found for face_dangling_notification_msg (8806849376915541655) -->
- <skip />
- <!-- no translation found for biometric_dangling_notification_action_set_up (8246885009807817961) -->
+ <string name="fingerprint_dangling_notification_title" msgid="7362075195588639989">"I-set up ulit ang Pag-unlock Gamit ang Fingerprint"</string>
+ <!-- no translation found for fingerprint_dangling_notification_msg_1 (8517140433796229725) -->
<skip />
- <!-- no translation found for biometric_dangling_notification_action_not_now (8095249216864443491) -->
+ <!-- no translation found for fingerprint_dangling_notification_msg_2 (7578829498452127613) -->
<skip />
+ <string name="fingerprint_dangling_notification_msg_all_deleted_1" msgid="2927018569542316055">"Hindi gumagana nang maayos ang <xliff:g id="FINGERPRINT">%s</xliff:g> at na-delete na ito. I-set up ulit ito para ma-unlock ang iyong telepono sa pamamagitan ng fingerprint."</string>
+ <string name="fingerprint_dangling_notification_msg_all_deleted_2" msgid="6897989352716156176">"Hindi gumagana nang maayos ang <xliff:g id="FINGERPRINT_0">%1$s</xliff:g> at <xliff:g id="FINGERPRINT_1">%2$s</xliff:g> at na-delete na ang mga ito. I-set up ulit ang mga ito para ma-unlock ang iyong telepono gamit ang fingerprint mo."</string>
+ <string name="face_dangling_notification_title" msgid="947852541060975473">"I-set up ulit ang Pag-unlock Gamit ang Mukha"</string>
+ <string name="face_dangling_notification_msg" msgid="8806849376915541655">"Hindi gumagana nang maayos ang iyong face model at na-delete na ito. I-set up ulit ito para ma-unlock ang iyong telepono sa pamamagitan ng mukha."</string>
+ <string name="biometric_dangling_notification_action_set_up" msgid="8246885009807817961">"I-set up"</string>
+ <string name="biometric_dangling_notification_action_not_now" msgid="8095249216864443491">"Huwag muna"</string>
</resources>
diff --git a/core/res/res/values-tr/strings.xml b/core/res/res/values-tr/strings.xml
index 2b616defdaa6..64498b524b24 100644
--- a/core/res/res/values-tr/strings.xml
+++ b/core/res/res/values-tr/strings.xml
@@ -283,6 +283,8 @@
<string name="global_action_voice_assist" msgid="6655788068555086695">"Sesli Yardım"</string>
<string name="global_action_lockdown" msgid="2475471405907902963">"Tam kilitleme"</string>
<string name="status_bar_notification_info_overflow" msgid="3330152558746563475">"999+"</string>
+ <!-- no translation found for notification_compact_heads_up_reply (2425293958371284340) -->
+ <skip />
<string name="notification_hidden_text" msgid="2835519769868187223">"Yeni bildirim"</string>
<string name="notification_channel_physical_keyboard" msgid="5417306456125988096">"Fiziksel klavye"</string>
<string name="notification_channel_security" msgid="8516754650348238057">"Güvenlik"</string>
@@ -2413,22 +2415,15 @@
<string name="satellite_notification_open_message" msgid="4149234979688273729">"Mesajlar\'ı aç"</string>
<string name="satellite_notification_how_it_works" msgid="3132069321977520519">"İşleyiş şekli"</string>
<string name="unarchival_session_app_label" msgid="6811856981546348205">"Bekliyor..."</string>
- <!-- no translation found for fingerprint_dangling_notification_title (7362075195588639989) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_1 (6261149111900787302) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_2 (7688302770424064884) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_1 (2927018569542316055) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_2 (6897989352716156176) -->
- <skip />
- <!-- no translation found for face_dangling_notification_title (947852541060975473) -->
- <skip />
- <!-- no translation found for face_dangling_notification_msg (8806849376915541655) -->
- <skip />
- <!-- no translation found for biometric_dangling_notification_action_set_up (8246885009807817961) -->
+ <string name="fingerprint_dangling_notification_title" msgid="7362075195588639989">"Parmak İzi Kilidi\'ni tekrar kurun"</string>
+ <!-- no translation found for fingerprint_dangling_notification_msg_1 (8517140433796229725) -->
<skip />
- <!-- no translation found for biometric_dangling_notification_action_not_now (8095249216864443491) -->
+ <!-- no translation found for fingerprint_dangling_notification_msg_2 (7578829498452127613) -->
<skip />
+ <string name="fingerprint_dangling_notification_msg_all_deleted_1" msgid="2927018569542316055">"<xliff:g id="FINGERPRINT">%s</xliff:g> iyi çalışmadığı için silindi. Telefonunuzun kilidini parmak iziyle açmak için tekrar kurun."</string>
+ <string name="fingerprint_dangling_notification_msg_all_deleted_2" msgid="6897989352716156176">"<xliff:g id="FINGERPRINT_0">%1$s</xliff:g> ve <xliff:g id="FINGERPRINT_1">%2$s</xliff:g> iyi çalışmadığı için silindi. Telefonunuzun kilidini parmak izinizle açmak için tekrar kurun."</string>
+ <string name="face_dangling_notification_title" msgid="947852541060975473">"Yüz Tanıma Kilidi\'ni tekrar kurun"</string>
+ <string name="face_dangling_notification_msg" msgid="8806849376915541655">"Yüz modeliniz iyi çalışmadığı için silindi. Telefonunuzun kilidini yüzünüzle açmak için tekrar kurun."</string>
+ <string name="biometric_dangling_notification_action_set_up" msgid="8246885009807817961">"Ayarla"</string>
+ <string name="biometric_dangling_notification_action_not_now" msgid="8095249216864443491">"Şimdi değil"</string>
</resources>
diff --git a/core/res/res/values-uk/strings.xml b/core/res/res/values-uk/strings.xml
index 850e21b15ef9..fcea7bb43e01 100644
--- a/core/res/res/values-uk/strings.xml
+++ b/core/res/res/values-uk/strings.xml
@@ -285,6 +285,8 @@
<string name="global_action_voice_assist" msgid="6655788068555086695">"Голос. підказки"</string>
<string name="global_action_lockdown" msgid="2475471405907902963">"Блокування"</string>
<string name="status_bar_notification_info_overflow" msgid="3330152558746563475">"999+"</string>
+ <!-- no translation found for notification_compact_heads_up_reply (2425293958371284340) -->
+ <skip />
<string name="notification_hidden_text" msgid="2835519769868187223">"Нове сповіщення"</string>
<string name="notification_channel_physical_keyboard" msgid="5417306456125988096">"Фізична клавіатура"</string>
<string name="notification_channel_security" msgid="8516754650348238057">"Безпека"</string>
@@ -2415,22 +2417,15 @@
<string name="satellite_notification_open_message" msgid="4149234979688273729">"Відкрийте Повідомлення"</string>
<string name="satellite_notification_how_it_works" msgid="3132069321977520519">"Як це працює"</string>
<string name="unarchival_session_app_label" msgid="6811856981546348205">"Обробка…"</string>
- <!-- no translation found for fingerprint_dangling_notification_title (7362075195588639989) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_1 (6261149111900787302) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_2 (7688302770424064884) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_1 (2927018569542316055) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_2 (6897989352716156176) -->
- <skip />
- <!-- no translation found for face_dangling_notification_title (947852541060975473) -->
- <skip />
- <!-- no translation found for face_dangling_notification_msg (8806849376915541655) -->
- <skip />
- <!-- no translation found for biometric_dangling_notification_action_set_up (8246885009807817961) -->
+ <string name="fingerprint_dangling_notification_title" msgid="7362075195588639989">"Налаштуйте розблокування відбитком пальця повторно"</string>
+ <!-- no translation found for fingerprint_dangling_notification_msg_1 (8517140433796229725) -->
<skip />
- <!-- no translation found for biometric_dangling_notification_action_not_now (8095249216864443491) -->
+ <!-- no translation found for fingerprint_dangling_notification_msg_2 (7578829498452127613) -->
<skip />
+ <string name="fingerprint_dangling_notification_msg_all_deleted_1" msgid="2927018569542316055">"Відбиток \"<xliff:g id="FINGERPRINT">%s</xliff:g>\" працював неналежним чином, і його видалено. Налаштуйте його ще раз, щоб розблоковувати телефон за допомогою відбитка пальця."</string>
+ <string name="fingerprint_dangling_notification_msg_all_deleted_2" msgid="6897989352716156176">"Відбитки \"<xliff:g id="FINGERPRINT_0">%1$s</xliff:g>\" і \"<xliff:g id="FINGERPRINT_1">%2$s</xliff:g>\" працювали неналежним чином, і їх видалено. Налаштуйте їх ще раз, щоб розблоковувати телефон за допомогою відбитка пальця."</string>
+ <string name="face_dangling_notification_title" msgid="947852541060975473">"Налаштуйте фейс-контроль повторно"</string>
+ <string name="face_dangling_notification_msg" msgid="8806849376915541655">"Модель обличчя працювала неналежним чином, і її видалено. Налаштуйте її ще раз, щоб розблоковувати телефон за допомогою фейс-контролю."</string>
+ <string name="biometric_dangling_notification_action_set_up" msgid="8246885009807817961">"Налаштувати"</string>
+ <string name="biometric_dangling_notification_action_not_now" msgid="8095249216864443491">"Не зараз"</string>
</resources>
diff --git a/core/res/res/values-ur/strings.xml b/core/res/res/values-ur/strings.xml
index d3fde3c4f455..fc23d99d03d8 100644
--- a/core/res/res/values-ur/strings.xml
+++ b/core/res/res/values-ur/strings.xml
@@ -283,6 +283,8 @@
<string name="global_action_voice_assist" msgid="6655788068555086695">"Voice Assist"</string>
<string name="global_action_lockdown" msgid="2475471405907902963">"مقفل"</string>
<string name="status_bar_notification_info_overflow" msgid="3330152558746563475">"‎999+‎"</string>
+ <!-- no translation found for notification_compact_heads_up_reply (2425293958371284340) -->
+ <skip />
<string name="notification_hidden_text" msgid="2835519769868187223">"نئی اطلاع"</string>
<string name="notification_channel_physical_keyboard" msgid="5417306456125988096">"فزیکل کی بورڈ"</string>
<string name="notification_channel_security" msgid="8516754650348238057">"سیکیورٹی"</string>
@@ -2413,22 +2415,15 @@
<string name="satellite_notification_open_message" msgid="4149234979688273729">"پیغامات ایپ کو کھولیں"</string>
<string name="satellite_notification_how_it_works" msgid="3132069321977520519">"اس کے کام کرنے کا طریقہ"</string>
<string name="unarchival_session_app_label" msgid="6811856981546348205">"زیر التواء..."</string>
- <!-- no translation found for fingerprint_dangling_notification_title (7362075195588639989) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_1 (6261149111900787302) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_2 (7688302770424064884) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_1 (2927018569542316055) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_2 (6897989352716156176) -->
- <skip />
- <!-- no translation found for face_dangling_notification_title (947852541060975473) -->
- <skip />
- <!-- no translation found for face_dangling_notification_msg (8806849376915541655) -->
- <skip />
- <!-- no translation found for biometric_dangling_notification_action_set_up (8246885009807817961) -->
+ <string name="fingerprint_dangling_notification_title" msgid="7362075195588639989">"فنگر پرنٹ اَن لاک کو دوبارہ سیٹ اپ کریں"</string>
+ <!-- no translation found for fingerprint_dangling_notification_msg_1 (8517140433796229725) -->
<skip />
- <!-- no translation found for biometric_dangling_notification_action_not_now (8095249216864443491) -->
+ <!-- no translation found for fingerprint_dangling_notification_msg_2 (7578829498452127613) -->
<skip />
+ <string name="fingerprint_dangling_notification_msg_all_deleted_1" msgid="2927018569542316055">"<xliff:g id="FINGERPRINT">%s</xliff:g> اچھی طرح کام نہیں کر رہا تھا اور حذف کر دیا گیا تھا۔ اپنے فون کو فنگر پرنٹ سے غیر مقفل کرنے کے لیے، اسے دوبارہ سیٹ اپ کریں۔"</string>
+ <string name="fingerprint_dangling_notification_msg_all_deleted_2" msgid="6897989352716156176">"<xliff:g id="FINGERPRINT_0">%1$s</xliff:g> اور <xliff:g id="FINGERPRINT_1">%2$s</xliff:g> اچھی طرح کام نہیں کر رہے تھے اور انہیں حذف کر دیا گیا تھا۔ اپنے فون کو اپنے فنگر پرنٹ سے غیر مقفل کرنے کے لیے انہیں دوبارہ سیٹ اپ کریں۔"</string>
+ <string name="face_dangling_notification_title" msgid="947852541060975473">"فیس اَن لاک کو دوبارہ سیٹ اپ کریں"</string>
+ <string name="face_dangling_notification_msg" msgid="8806849376915541655">"آپ کے چہرے کا ماڈل اچھی طرح کام نہیں کر رہا تھا اور حذف کر دیا گیا تھا۔ اپنے فون کو چہرے سے غیر مقفل کرنے کے لیے، اسے دوبارہ سیٹ اپ کریں۔"</string>
+ <string name="biometric_dangling_notification_action_set_up" msgid="8246885009807817961">"سیٹ اپ کریں"</string>
+ <string name="biometric_dangling_notification_action_not_now" msgid="8095249216864443491">"ابھی نہیں"</string>
</resources>
diff --git a/core/res/res/values-uz/strings.xml b/core/res/res/values-uz/strings.xml
index c143244db230..0ef4ddc4cc0b 100644
--- a/core/res/res/values-uz/strings.xml
+++ b/core/res/res/values-uz/strings.xml
@@ -283,6 +283,8 @@
<string name="global_action_voice_assist" msgid="6655788068555086695">"Ovozli yordam"</string>
<string name="global_action_lockdown" msgid="2475471405907902963">"Qulflash"</string>
<string name="status_bar_notification_info_overflow" msgid="3330152558746563475">"999+"</string>
+ <!-- no translation found for notification_compact_heads_up_reply (2425293958371284340) -->
+ <skip />
<string name="notification_hidden_text" msgid="2835519769868187223">"Yangi bildirishnoma"</string>
<string name="notification_channel_physical_keyboard" msgid="5417306456125988096">"Tashqi klaviatura"</string>
<string name="notification_channel_security" msgid="8516754650348238057">"Xavfsizlik"</string>
@@ -2413,22 +2415,15 @@
<string name="satellite_notification_open_message" msgid="4149234979688273729">"Xabarlar ilovasini ochish"</string>
<string name="satellite_notification_how_it_works" msgid="3132069321977520519">"Ishlash tartibi"</string>
<string name="unarchival_session_app_label" msgid="6811856981546348205">"Kutilmoqda..."</string>
- <!-- no translation found for fingerprint_dangling_notification_title (7362075195588639989) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_1 (6261149111900787302) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_2 (7688302770424064884) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_1 (2927018569542316055) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_2 (6897989352716156176) -->
- <skip />
- <!-- no translation found for face_dangling_notification_title (947852541060975473) -->
- <skip />
- <!-- no translation found for face_dangling_notification_msg (8806849376915541655) -->
- <skip />
- <!-- no translation found for biometric_dangling_notification_action_set_up (8246885009807817961) -->
+ <string name="fingerprint_dangling_notification_title" msgid="7362075195588639989">"Barmoq izi bilan ochish funksiyasini qayta sozlang"</string>
+ <!-- no translation found for fingerprint_dangling_notification_msg_1 (8517140433796229725) -->
<skip />
- <!-- no translation found for biometric_dangling_notification_action_not_now (8095249216864443491) -->
+ <!-- no translation found for fingerprint_dangling_notification_msg_2 (7578829498452127613) -->
<skip />
+ <string name="fingerprint_dangling_notification_msg_all_deleted_1" msgid="2927018569542316055">"<xliff:g id="FINGERPRINT">%s</xliff:g> yaxshi ishlamadi va oʻchirib tashlandi. Telefonni barmoq izi bilan ochish uchun uni qayta sozlang."</string>
+ <string name="fingerprint_dangling_notification_msg_all_deleted_2" msgid="6897989352716156176">"<xliff:g id="FINGERPRINT_0">%1$s</xliff:g> va <xliff:g id="FINGERPRINT_1">%2$s</xliff:g> yaxshi ishlamadi va oʻchirib tashlandi. Telefonni barmoq izi bilan ochish uchun ularni qayta sozlang."</string>
+ <string name="face_dangling_notification_title" msgid="947852541060975473">"Yuz bilan ochishni qayta sozlash"</string>
+ <string name="face_dangling_notification_msg" msgid="8806849376915541655">"Yuzingiz mobeli yaxshi ishlamadi va oʻchirib tashlandi. Telefonni yuz bilan ochish uchun uni qayta sozlang."</string>
+ <string name="biometric_dangling_notification_action_set_up" msgid="8246885009807817961">"Sozlash"</string>
+ <string name="biometric_dangling_notification_action_not_now" msgid="8095249216864443491">"Hozir emas"</string>
</resources>
diff --git a/core/res/res/values-vi/strings.xml b/core/res/res/values-vi/strings.xml
index a0775d400d5d..6ff6528878e3 100644
--- a/core/res/res/values-vi/strings.xml
+++ b/core/res/res/values-vi/strings.xml
@@ -283,6 +283,8 @@
<string name="global_action_voice_assist" msgid="6655788068555086695">"Trợ lý thoại"</string>
<string name="global_action_lockdown" msgid="2475471405907902963">"Khóa"</string>
<string name="status_bar_notification_info_overflow" msgid="3330152558746563475">"999+"</string>
+ <!-- no translation found for notification_compact_heads_up_reply (2425293958371284340) -->
+ <skip />
<string name="notification_hidden_text" msgid="2835519769868187223">"Thông báo mới"</string>
<string name="notification_channel_physical_keyboard" msgid="5417306456125988096">"Bàn phím vật lý"</string>
<string name="notification_channel_security" msgid="8516754650348238057">"Bảo mật"</string>
@@ -2413,22 +2415,15 @@
<string name="satellite_notification_open_message" msgid="4149234979688273729">"Mở ứng dụng Tin nhắn"</string>
<string name="satellite_notification_how_it_works" msgid="3132069321977520519">"Cách hoạt động"</string>
<string name="unarchival_session_app_label" msgid="6811856981546348205">"Đang chờ xử lý..."</string>
- <!-- no translation found for fingerprint_dangling_notification_title (7362075195588639989) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_1 (6261149111900787302) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_2 (7688302770424064884) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_1 (2927018569542316055) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_2 (6897989352716156176) -->
- <skip />
- <!-- no translation found for face_dangling_notification_title (947852541060975473) -->
- <skip />
- <!-- no translation found for face_dangling_notification_msg (8806849376915541655) -->
- <skip />
- <!-- no translation found for biometric_dangling_notification_action_set_up (8246885009807817961) -->
+ <string name="fingerprint_dangling_notification_title" msgid="7362075195588639989">"Thiết lập lại tính năng Mở khoá bằng vân tay"</string>
+ <!-- no translation found for fingerprint_dangling_notification_msg_1 (8517140433796229725) -->
<skip />
- <!-- no translation found for biometric_dangling_notification_action_not_now (8095249216864443491) -->
+ <!-- no translation found for fingerprint_dangling_notification_msg_2 (7578829498452127613) -->
<skip />
+ <string name="fingerprint_dangling_notification_msg_all_deleted_1" msgid="2927018569542316055">"<xliff:g id="FINGERPRINT">%s</xliff:g> không dùng được và đã bị xoá. Hãy thiết lập lại để mở khoá điện thoại bằng vân tay."</string>
+ <string name="fingerprint_dangling_notification_msg_all_deleted_2" msgid="6897989352716156176">"<xliff:g id="FINGERPRINT_0">%1$s</xliff:g> và <xliff:g id="FINGERPRINT_1">%2$s</xliff:g> không dùng được và đã bị xoá. Hãy thiết lập lại để mở khoá điện thoại bằng vân tay."</string>
+ <string name="face_dangling_notification_title" msgid="947852541060975473">"Thiết lập lại tính năng Mở khoá bằng khuôn mặt"</string>
+ <string name="face_dangling_notification_msg" msgid="8806849376915541655">"Mẫu khuôn mặt của bạn không dùng được và đã bị xoá. Hãy thiết lập lại để mở khoá điện thoại bằng khuôn mặt."</string>
+ <string name="biometric_dangling_notification_action_set_up" msgid="8246885009807817961">"Thiết lập"</string>
+ <string name="biometric_dangling_notification_action_not_now" msgid="8095249216864443491">"Để sau"</string>
</resources>
diff --git a/core/res/res/values-zh-rCN/strings.xml b/core/res/res/values-zh-rCN/strings.xml
index 00dd3db2b35a..10243220d600 100644
--- a/core/res/res/values-zh-rCN/strings.xml
+++ b/core/res/res/values-zh-rCN/strings.xml
@@ -283,6 +283,8 @@
<string name="global_action_voice_assist" msgid="6655788068555086695">"语音助理"</string>
<string name="global_action_lockdown" msgid="2475471405907902963">"锁定"</string>
<string name="status_bar_notification_info_overflow" msgid="3330152558746563475">"999+"</string>
+ <!-- no translation found for notification_compact_heads_up_reply (2425293958371284340) -->
+ <skip />
<string name="notification_hidden_text" msgid="2835519769868187223">"新通知"</string>
<string name="notification_channel_physical_keyboard" msgid="5417306456125988096">"实体键盘"</string>
<string name="notification_channel_security" msgid="8516754650348238057">"安全性"</string>
@@ -2413,22 +2415,15 @@
<string name="satellite_notification_open_message" msgid="4149234979688273729">"打开“信息”应用"</string>
<string name="satellite_notification_how_it_works" msgid="3132069321977520519">"运作方式"</string>
<string name="unarchival_session_app_label" msgid="6811856981546348205">"待归档…"</string>
- <!-- no translation found for fingerprint_dangling_notification_title (7362075195588639989) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_1 (6261149111900787302) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_2 (7688302770424064884) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_1 (2927018569542316055) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_2 (6897989352716156176) -->
- <skip />
- <!-- no translation found for face_dangling_notification_title (947852541060975473) -->
- <skip />
- <!-- no translation found for face_dangling_notification_msg (8806849376915541655) -->
- <skip />
- <!-- no translation found for biometric_dangling_notification_action_set_up (8246885009807817961) -->
+ <string name="fingerprint_dangling_notification_title" msgid="7362075195588639989">"重新设置指纹解锁功能"</string>
+ <!-- no translation found for fingerprint_dangling_notification_msg_1 (8517140433796229725) -->
<skip />
- <!-- no translation found for biometric_dangling_notification_action_not_now (8095249216864443491) -->
+ <!-- no translation found for fingerprint_dangling_notification_msg_2 (7578829498452127613) -->
<skip />
+ <string name="fingerprint_dangling_notification_msg_all_deleted_1" msgid="2927018569542316055">"“<xliff:g id="FINGERPRINT">%s</xliff:g>”无法正常使用,系统已将其删除。如要通过指纹解锁功能来解锁手机,请重新设置。"</string>
+ <string name="fingerprint_dangling_notification_msg_all_deleted_2" msgid="6897989352716156176">"“<xliff:g id="FINGERPRINT_0">%1$s</xliff:g>”和“<xliff:g id="FINGERPRINT_1">%2$s</xliff:g>”无法正常使用,系统已将它们删除。如要通过指纹解锁功能来解锁手机,请重新设置。"</string>
+ <string name="face_dangling_notification_title" msgid="947852541060975473">"重新设置“人脸解锁”功能"</string>
+ <string name="face_dangling_notification_msg" msgid="8806849376915541655">"您的脸部模型无法正常使用,系统已将其删除。如要通过人脸解锁功能来解锁手机,请重新设置。"</string>
+ <string name="biometric_dangling_notification_action_set_up" msgid="8246885009807817961">"设置"</string>
+ <string name="biometric_dangling_notification_action_not_now" msgid="8095249216864443491">"以后再说"</string>
</resources>
diff --git a/core/res/res/values-zh-rHK/strings.xml b/core/res/res/values-zh-rHK/strings.xml
index 142940a86ebb..b1157f7df6d5 100644
--- a/core/res/res/values-zh-rHK/strings.xml
+++ b/core/res/res/values-zh-rHK/strings.xml
@@ -283,6 +283,8 @@
<string name="global_action_voice_assist" msgid="6655788068555086695">"語音助手"</string>
<string name="global_action_lockdown" msgid="2475471405907902963">"鎖定"</string>
<string name="status_bar_notification_info_overflow" msgid="3330152558746563475">"999+"</string>
+ <!-- no translation found for notification_compact_heads_up_reply (2425293958371284340) -->
+ <skip />
<string name="notification_hidden_text" msgid="2835519769868187223">"新通知"</string>
<string name="notification_channel_physical_keyboard" msgid="5417306456125988096">"實體鍵盤"</string>
<string name="notification_channel_security" msgid="8516754650348238057">"安全性"</string>
@@ -651,11 +653,11 @@
<string name="biometric_error_generic" msgid="6784371929985434439">"驗證時發生錯誤"</string>
<string name="screen_lock_app_setting_name" msgid="6054944352976789228">"使用螢幕鎖定"</string>
<string name="screen_lock_dialog_default_subtitle" msgid="120359538048533695">"如要繼續操作,請輸入螢幕鎖定解鎖憑證"</string>
- <string name="fingerprint_acquired_partial" msgid="4323789264604479684">"請用力按住感應器"</string>
+ <string name="fingerprint_acquired_partial" msgid="4323789264604479684">"請按住感應器"</string>
<string name="fingerprint_acquired_insufficient" msgid="2410176550915730974">"無法辨識指紋,請再試一次。"</string>
<string name="fingerprint_acquired_imager_dirty" msgid="1770676120848224250">"請清潔指紋感應器,然後再試一次"</string>
<string name="fingerprint_acquired_imager_dirty_alt" msgid="9169582140486372897">"請清潔感應器,然後再試一次"</string>
- <string name="fingerprint_acquired_too_fast" msgid="1628459767349116104">"請用力按住感應器"</string>
+ <string name="fingerprint_acquired_too_fast" msgid="1628459767349116104">"請按住感應器"</string>
<string name="fingerprint_acquired_too_slow" msgid="6683510291554497580">"手指移動太慢,請重試。"</string>
<string name="fingerprint_acquired_already_enrolled" msgid="2285166003936206785">"改用其他指紋"</string>
<string name="fingerprint_acquired_too_bright" msgid="3863560181670915607">"太亮"</string>
@@ -2413,22 +2415,15 @@
<string name="satellite_notification_open_message" msgid="4149234979688273729">"開啟「訊息」"</string>
<string name="satellite_notification_how_it_works" msgid="3132069321977520519">"運作方式"</string>
<string name="unarchival_session_app_label" msgid="6811856981546348205">"待處理…"</string>
- <!-- no translation found for fingerprint_dangling_notification_title (7362075195588639989) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_1 (6261149111900787302) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_2 (7688302770424064884) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_1 (2927018569542316055) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_2 (6897989352716156176) -->
- <skip />
- <!-- no translation found for face_dangling_notification_title (947852541060975473) -->
- <skip />
- <!-- no translation found for face_dangling_notification_msg (8806849376915541655) -->
- <skip />
- <!-- no translation found for biometric_dangling_notification_action_set_up (8246885009807817961) -->
+ <string name="fingerprint_dangling_notification_title" msgid="7362075195588639989">"重新設定「指紋解鎖」功能"</string>
+ <!-- no translation found for fingerprint_dangling_notification_msg_1 (8517140433796229725) -->
<skip />
- <!-- no translation found for biometric_dangling_notification_action_not_now (8095249216864443491) -->
+ <!-- no translation found for fingerprint_dangling_notification_msg_2 (7578829498452127613) -->
<skip />
+ <string name="fingerprint_dangling_notification_msg_all_deleted_1" msgid="2927018569542316055">"由於「<xliff:g id="FINGERPRINT">%s</xliff:g>」無法正常運作,因此系統已將其刪除。請重新設定,才能使用指紋解鎖手機。"</string>
+ <string name="fingerprint_dangling_notification_msg_all_deleted_2" msgid="6897989352716156176">"由於「<xliff:g id="FINGERPRINT_0">%1$s</xliff:g>」和「<xliff:g id="FINGERPRINT_1">%2$s</xliff:g>」無法正常運作,因此系統已將其刪除。請重新設定,才能使用指紋解鎖手機。"</string>
+ <string name="face_dangling_notification_title" msgid="947852541060975473">"重新設定「面孔解鎖」功能"</string>
+ <string name="face_dangling_notification_msg" msgid="8806849376915541655">"由於面部模型無法正常運作,因此系統已將其刪除。請重新設定,才能使用面孔解鎖手機。"</string>
+ <string name="biometric_dangling_notification_action_set_up" msgid="8246885009807817961">"設定"</string>
+ <string name="biometric_dangling_notification_action_not_now" msgid="8095249216864443491">"暫時不要"</string>
</resources>
diff --git a/core/res/res/values-zh-rTW/strings.xml b/core/res/res/values-zh-rTW/strings.xml
index b7ee23c23f21..da43a12f8fe1 100644
--- a/core/res/res/values-zh-rTW/strings.xml
+++ b/core/res/res/values-zh-rTW/strings.xml
@@ -283,6 +283,8 @@
<string name="global_action_voice_assist" msgid="6655788068555086695">"語音小幫手"</string>
<string name="global_action_lockdown" msgid="2475471405907902963">"鎖定"</string>
<string name="status_bar_notification_info_overflow" msgid="3330152558746563475">"超過 999"</string>
+ <!-- no translation found for notification_compact_heads_up_reply (2425293958371284340) -->
+ <skip />
<string name="notification_hidden_text" msgid="2835519769868187223">"新通知"</string>
<string name="notification_channel_physical_keyboard" msgid="5417306456125988096">"實體鍵盤"</string>
<string name="notification_channel_security" msgid="8516754650348238057">"安全性"</string>
@@ -2413,22 +2415,15 @@
<string name="satellite_notification_open_message" msgid="4149234979688273729">"開啟「訊息」應用程式"</string>
<string name="satellite_notification_how_it_works" msgid="3132069321977520519">"運作方式"</string>
<string name="unarchival_session_app_label" msgid="6811856981546348205">"待處理…"</string>
- <!-- no translation found for fingerprint_dangling_notification_title (7362075195588639989) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_1 (6261149111900787302) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_2 (7688302770424064884) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_1 (2927018569542316055) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_2 (6897989352716156176) -->
- <skip />
- <!-- no translation found for face_dangling_notification_title (947852541060975473) -->
- <skip />
- <!-- no translation found for face_dangling_notification_msg (8806849376915541655) -->
- <skip />
- <!-- no translation found for biometric_dangling_notification_action_set_up (8246885009807817961) -->
+ <string name="fingerprint_dangling_notification_title" msgid="7362075195588639989">"重新設定指紋解鎖"</string>
+ <!-- no translation found for fingerprint_dangling_notification_msg_1 (8517140433796229725) -->
<skip />
- <!-- no translation found for biometric_dangling_notification_action_not_now (8095249216864443491) -->
+ <!-- no translation found for fingerprint_dangling_notification_msg_2 (7578829498452127613) -->
<skip />
+ <string name="fingerprint_dangling_notification_msg_all_deleted_1" msgid="2927018569542316055">"「<xliff:g id="FINGERPRINT">%s</xliff:g>」無法正常運作,因此系統已將其刪除。請重新設定,才能用指紋解鎖手機。"</string>
+ <string name="fingerprint_dangling_notification_msg_all_deleted_2" msgid="6897989352716156176">"「<xliff:g id="FINGERPRINT_0">%1$s</xliff:g>」和「<xliff:g id="FINGERPRINT_1">%2$s</xliff:g>」無法正常運作,因此系統已將其刪除。請重新設定,才能用指紋解鎖手機。"</string>
+ <string name="face_dangling_notification_title" msgid="947852541060975473">"重新設定人臉解鎖"</string>
+ <string name="face_dangling_notification_msg" msgid="8806849376915541655">"臉部模型無法正常運作,因此系統已將其刪除。請重新設定,才能用臉解鎖手機。"</string>
+ <string name="biometric_dangling_notification_action_set_up" msgid="8246885009807817961">"設定"</string>
+ <string name="biometric_dangling_notification_action_not_now" msgid="8095249216864443491">"暫時不要"</string>
</resources>
diff --git a/core/res/res/values-zu/strings.xml b/core/res/res/values-zu/strings.xml
index a967fb6f1ad1..7749b1b6f04c 100644
--- a/core/res/res/values-zu/strings.xml
+++ b/core/res/res/values-zu/strings.xml
@@ -283,6 +283,8 @@
<string name="global_action_voice_assist" msgid="6655788068555086695">"Isisekeli sezwi"</string>
<string name="global_action_lockdown" msgid="2475471405907902963">"Khiya"</string>
<string name="status_bar_notification_info_overflow" msgid="3330152558746563475">"999+"</string>
+ <!-- no translation found for notification_compact_heads_up_reply (2425293958371284340) -->
+ <skip />
<string name="notification_hidden_text" msgid="2835519769868187223">"Isaziso esisha"</string>
<string name="notification_channel_physical_keyboard" msgid="5417306456125988096">"Ikhibhodi ephathekayo"</string>
<string name="notification_channel_security" msgid="8516754650348238057">"Ukuphepha"</string>
@@ -2413,22 +2415,15 @@
<string name="satellite_notification_open_message" msgid="4149234979688273729">"Vula Imilayezo"</string>
<string name="satellite_notification_how_it_works" msgid="3132069321977520519">"Indlela esebenza ngayo"</string>
<string name="unarchival_session_app_label" msgid="6811856981546348205">"Ilindile..."</string>
- <!-- no translation found for fingerprint_dangling_notification_title (7362075195588639989) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_1 (6261149111900787302) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_2 (7688302770424064884) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_1 (2927018569542316055) -->
- <skip />
- <!-- no translation found for fingerprint_dangling_notification_msg_all_deleted_2 (6897989352716156176) -->
- <skip />
- <!-- no translation found for face_dangling_notification_title (947852541060975473) -->
- <skip />
- <!-- no translation found for face_dangling_notification_msg (8806849376915541655) -->
- <skip />
- <!-- no translation found for biometric_dangling_notification_action_set_up (8246885009807817961) -->
+ <string name="fingerprint_dangling_notification_title" msgid="7362075195588639989">"Setha Ukuvula ngesigxivizo somunwe futhi"</string>
+ <!-- no translation found for fingerprint_dangling_notification_msg_1 (8517140433796229725) -->
<skip />
- <!-- no translation found for biometric_dangling_notification_action_not_now (8095249216864443491) -->
+ <!-- no translation found for fingerprint_dangling_notification_msg_2 (7578829498452127613) -->
<skip />
+ <string name="fingerprint_dangling_notification_msg_all_deleted_1" msgid="2927018569542316055">"I-<xliff:g id="FINGERPRINT">%s</xliff:g> ibingasebenzi kahle futhi isuliwe. Phinde uyisethe ukuze uvule ifoni yakho ngesigxivizo somunwe."</string>
+ <string name="fingerprint_dangling_notification_msg_all_deleted_2" msgid="6897989352716156176">"I-<xliff:g id="FINGERPRINT_0">%1$s</xliff:g> kanye ne-<xliff:g id="FINGERPRINT_1">%2$s</xliff:g> ibingasebenzi kahle futhi isuliwe. Phinde uyisethe ukuze uvule ifoni yakho ngesigxivizo somunwe wakho"</string>
+ <string name="face_dangling_notification_title" msgid="947852541060975473">"Setha Ukuvula Ngobuso futhi"</string>
+ <string name="face_dangling_notification_msg" msgid="8806849376915541655">"Imodeli yobuso yakho ibingasebenzi kahle futhi isuliwe. Phinde uyisethe ukuze uvule ifoni yakho ngobuso."</string>
+ <string name="biometric_dangling_notification_action_set_up" msgid="8246885009807817961">"Setha"</string>
+ <string name="biometric_dangling_notification_action_not_now" msgid="8095249216864443491">"Hhayi manje"</string>
</resources>
diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml
index 5fa13bab7b0c..405324bf76af 100644
--- a/core/res/res/values/attrs.xml
+++ b/core/res/res/values/attrs.xml
@@ -2589,6 +2589,8 @@
<li>The framework will set {@link android.R.attr#statusBarColor},
{@link android.R.attr#navigationBarColor}, and
{@link android.R.attr#navigationBarDividerColor} to transparent.
+ <li>The frameworks will send Configuration no longer considering system insets.
+ The Configuration will be stable regardless of the system insets change.
</ul>
<p>If this is true, the edge-to-edge enforcement won't be applied. However, this
diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml
index 5bd20332f381..0676f721c469 100644
--- a/core/res/res/values/config.xml
+++ b/core/res/res/values/config.xml
@@ -4723,6 +4723,8 @@
<!-- The broadcast intent name for notifying when the on-device model has been unloaded -->
<string name="config_onDeviceIntelligenceModelUnloadedBroadcastKey" translatable="false"></string>
+ <!-- The DeviceConfig namespace for the default system on-device sandboxed inference service. -->
+ <string name="config_defaultOnDeviceIntelligenceDeviceConfigNamespace" translatable="false"></string>
<!-- Component name that accepts ACTION_SEND intents for requesting ambient context consent for
wearable sensing. -->
@@ -6951,9 +6953,6 @@
an app is not changed during subsequent reboots. -->
<bool name="config_stopSystemPackagesByDefault">true</bool>
- <!-- Whether to show weather on the lock screen by default. -->
- <bool name="config_lockscreenWeatherEnabledByDefault">false</bool>
-
<!-- Whether we should persist the brightness value in nits for the default display even if
the underlying display device changes. -->
<bool name="config_persistBrightnessNitsForDefaultDisplay">false</bool>
diff --git a/core/res/res/values/config_telephony.xml b/core/res/res/values/config_telephony.xml
index cc02a7e377c5..e420ffe68e4c 100644
--- a/core/res/res/values/config_telephony.xml
+++ b/core/res/res/values/config_telephony.xml
@@ -365,4 +365,23 @@
<item>xcap</item>
</string-array>
<java-symbol type="array" name="config_force_cellular_transport_capabilities" />
+
+ <!-- The time duration in millis after which DemoSimulator will move to CONNECTED state from
+ NOT_CONNECTED state if the device is aligned to satellite.
+ -->
+ <integer name="config_demo_pointing_aligned_duration_millis">15000</integer>
+ <java-symbol type="integer" name="config_demo_pointing_aligned_duration_millis" />
+
+ <!-- The time duration in millis after which DemoSimulator will move to NOT_CONNECTED state from
+ CONNECTED state if the device is not aligned to satellite.
+ -->
+ <integer name="config_demo_pointing_not_aligned_duration_millis">30000</integer>
+ <java-symbol type="integer" name="config_demo_pointing_not_aligned_duration_millis" />
+
+ <!-- Boolean indicating whether Telephony should wait for device alignment with satellite
+ before sending or receiving datagrams in demo mode.
+ -->
+ <bool name="config_wait_for_device_alignment_in_demo_datagram">false</bool>
+ <java-symbol type="bool" name="config_wait_for_device_alignment_in_demo_datagram" />
+
</resources>
diff --git a/core/res/res/values/dimens.xml b/core/res/res/values/dimens.xml
index 52ce9936787f..b885e03bc098 100644
--- a/core/res/res/values/dimens.xml
+++ b/core/res/res/values/dimens.xml
@@ -846,6 +846,12 @@
<dimen name="conversation_face_pile_protection_width">2dp</dimen>
<!-- The width of the protection of the face pile layout when expanded-->
<dimen name="conversation_face_pile_protection_width_expanded">@dimen/conversation_face_pile_protection_width</dimen>
+ <!-- size of the compact face pile -->
+ <dimen name="conversation_compact_face_pile_size">24dp</dimen>
+ <!-- size of the face pile avatar -->
+ <dimen name="conversation_compact_face_pile_avatar_size">17dp</dimen>
+ <!-- size of the face pile protection -->
+ <dimen name="conversation_compact_face_pile_protection_width">1dp</dimen>
<!-- The padding of the expanded message container-->
<dimen name="expanded_group_conversation_message_padding">32dp</dimen>
<!-- The stroke width of the ring used to visually mark a conversation as important -->
diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml
index 28678c1c5fb0..2da5e9a90dbb 100644
--- a/core/res/res/values/strings.xml
+++ b/core/res/res/values/strings.xml
@@ -6491,9 +6491,9 @@ ul.</string>
<!-- Fingerprint dangling notification title -->
<string name="fingerprint_dangling_notification_title">Set up Fingerprint Unlock again</string>
<!-- Fingerprint dangling notification content for only 1 fingerprint deleted -->
- <string name="fingerprint_dangling_notification_msg_1"><xliff:g id="fingerprint">%s</xliff:g> wasn\'t working well and was deleted to improve performance</string>
+ <string name="fingerprint_dangling_notification_msg_1"><xliff:g id="fingerprint">%s</xliff:g> wasn\'t working well and was deleted</string>
<!-- Fingerprint dangling notification content for more than 1 fingerprints deleted -->
- <string name="fingerprint_dangling_notification_msg_2"><xliff:g id="fingerprint">%1$s</xliff:g> and <xliff:g id="fingerprint">%2$s</xliff:g> weren\'t working well and were deleted to improve performance</string>
+ <string name="fingerprint_dangling_notification_msg_2"><xliff:g id="fingerprint">%1$s</xliff:g> and <xliff:g id="fingerprint">%2$s</xliff:g> weren\'t working well and were deleted</string>
<!-- Fingerprint dangling notification content for only 1 fingerprint deleted and no fingerprint left-->
<string name="fingerprint_dangling_notification_msg_all_deleted_1"><xliff:g id="fingerprint">%s</xliff:g> wasn\'t working well and was deleted. Set it up again to unlock your phone with fingerprint.</string>
<!-- Fingerprint dangling notification content for more than 1 fingerprints deleted and no fingerprint left -->
diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml
index acd3b372b3ae..5a3eaeb8327b 100644
--- a/core/res/res/values/symbols.xml
+++ b/core/res/res/values/symbols.xml
@@ -3947,6 +3947,7 @@
<java-symbol type="string" name="config_defaultOnDeviceSandboxedInferenceService" />
<java-symbol type="string" name="config_onDeviceIntelligenceModelLoadedBroadcastKey" />
<java-symbol type="string" name="config_onDeviceIntelligenceModelUnloadedBroadcastKey" />
+ <java-symbol type="string" name="config_defaultOnDeviceIntelligenceDeviceConfigNamespace" />
<java-symbol type="string" name="config_retailDemoPackage" />
<java-symbol type="string" name="config_retailDemoPackageSignature" />
@@ -4542,6 +4543,9 @@
<java-symbol type="dimen" name="conversation_avatar_size_group_expanded" />
<java-symbol type="dimen" name="conversation_face_pile_avatar_size" />
<java-symbol type="dimen" name="conversation_face_pile_avatar_size_group_expanded" />
+ <java-symbol type="dimen" name="conversation_compact_face_pile_size" />
+ <java-symbol type="dimen" name="conversation_compact_face_pile_avatar_size" />
+ <java-symbol type="dimen" name="conversation_compact_face_pile_protection_width" />
<java-symbol type="dimen" name="conversation_face_pile_protection_width" />
<java-symbol type="dimen" name="conversation_face_pile_protection_width_expanded" />
<java-symbol type="dimen" name="conversation_badge_protrusion_group_expanded" />
@@ -5224,9 +5228,6 @@
<java-symbol type="bool" name="config_hotspotNetworksEnabledForService"/>
<java-symbol type="bool" name="config_knownNetworksEnabledForService"/>
- <!-- Whether to show weather on the lockscreen by default. -->
- <java-symbol type="bool" name="config_lockscreenWeatherEnabledByDefault" />
-
<!-- For keyboard notification -->
<java-symbol type="string" name="keyboard_layout_notification_selected_title"/>
<java-symbol type="string" name="keyboard_layout_notification_one_selected_message"/>
diff --git a/core/res/res/xml/sms_short_codes.xml b/core/res/res/xml/sms_short_codes.xml
index 4d7c00991798..67cceb5d5343 100644
--- a/core/res/res/xml/sms_short_codes.xml
+++ b/core/res/res/xml/sms_short_codes.xml
@@ -60,6 +60,9 @@
<!-- Belgium: 4 digits, plus EU: http://www.mobileweb.be/en/mobileweb/sms-numberplan.asp -->
<shortcode country="be" premium="\\d{4}" free="8\\d{3}|116\\d{3}" />
+ <!-- Burkina Faso: 1-4 digits (standard system default, not country specific) -->
+ <shortcode country="bf" pattern="\\d{1,4}" free="3558" />
+
<!-- Bulgaria: 4-5 digits, plus EU -->
<shortcode country="bg" pattern="\\d{4,5}" premium="18(?:16|423)|19(?:1[56]|35)" free="116\\d{3}|1988|1490" />
@@ -175,8 +178,8 @@
<!-- Israel: 1-5 digits, known premium codes listed -->
<shortcode country="il" pattern="\\d{1,5}" premium="4422|4545" free="37477|6681" />
- <!-- Iran: 4-6 digits, known premium codes listed -->
- <shortcode country="ir" pattern="\\d{4,6}" free="700791|700792" />
+ <!-- Iran: 4-8 digits, known premium codes listed -->
+ <shortcode country="ir" pattern="\\d{4,8}" free="700791|700792|100016|30008360" />
<!-- Italy: 5 digits (premium=41xxx,42xxx), plus EU:
https://www.itu.int/dms_pub/itu-t/oth/02/02/T020200006B0001PDFE.pdf -->
@@ -352,7 +355,7 @@
<shortcode country="za" pattern="\\d{1,5}" free="44136|30791|36056|33009" />
<!-- Yemen -->
- <shortcode country="ye" pattern="\\d{1,4}" free="5081" />
+ <shortcode country="ye" pattern="\\d{1,4}" free="5079" />
<!-- Zimbabwe -->
<shortcode country="zw" pattern="\\d{1,5}" free="33679" />
diff --git a/core/tests/coretests/src/android/os/VintfObjectTest.java b/core/tests/coretests/src/android/os/VintfObjectTest.java
index f34b8fd358d9..f81b31d0bd5a 100644
--- a/core/tests/coretests/src/android/os/VintfObjectTest.java
+++ b/core/tests/coretests/src/android/os/VintfObjectTest.java
@@ -16,16 +16,25 @@
package android.os;
-import static org.junit.Assert.assertTrue;
+import static com.google.common.truth.Truth.assertThat;
+
+import static java.util.stream.Collectors.toList;
import android.platform.test.annotations.IgnoreUnderRavenwood;
import android.platform.test.ravenwood.RavenwoodRule;
+import android.util.Pair;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
+import org.xml.sax.InputSource;
+
+import java.io.StringReader;
+import java.util.stream.Stream;
+
+import javax.xml.parsers.DocumentBuilderFactory;
@RunWith(AndroidJUnit4.class)
@IgnoreUnderRavenwood(blockedBy = VintfObject.class)
@@ -39,12 +48,26 @@ public class VintfObjectTest {
@Test
public void testReport() {
String[] xmls = VintfObject.report();
- assertTrue(xmls.length > 0);
- // From /system/manifest.xml
- assertTrue(String.join("", xmls).contains(
- "<manifest version=\"1.0\" type=\"framework\">"));
- // From /system/compatibility-matrix.xml
- assertTrue(String.join("", xmls).contains(
- "<compatibility-matrix version=\"1.0\" type=\"framework\""));
+
+ assertThat(Stream.of(xmls).map(xml -> rootAndType(xml)).collect(toList()))
+ .containsExactly(
+ Pair.create("manifest", "framework"),
+ Pair.create("compatibility-matrix", "framework"),
+ Pair.create("manifest", "device"),
+ Pair.create("compatibility-matrix", "device")
+ );
+ }
+
+ private static Pair<String, String> rootAndType(String content) {
+ try {
+ var factory = DocumentBuilderFactory.newInstance();
+ var builder = factory.newDocumentBuilder();
+ var inputSource = new InputSource(new StringReader(content));
+ var document = builder.parse(inputSource);
+ var root = document.getDocumentElement();
+ return Pair.create(root.getTagName(), root.getAttribute("type"));
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
}
}
diff --git a/core/tests/coretests/src/android/view/ImeBackAnimationControllerTest.java b/core/tests/coretests/src/android/view/ImeBackAnimationControllerTest.java
index 5917cc181b47..58e5be2b823d 100644
--- a/core/tests/coretests/src/android/view/ImeBackAnimationControllerTest.java
+++ b/core/tests/coretests/src/android/view/ImeBackAnimationControllerTest.java
@@ -99,6 +99,8 @@ public class ImeBackAnimationControllerTest {
} catch (WindowManager.BadTokenException e) {
// activity isn't running, we will ignore BadTokenException.
}
+ mViewRoot.setOnContentApplyWindowInsetsListener(
+ mock(Window.OnContentApplyWindowInsetsListener.class));
mBackAnimationController = new ImeBackAnimationController(mViewRoot, mInsetsController);
when(mWindowInsetsAnimationController.getHiddenStateInsets()).thenReturn(Insets.NONE);
@@ -132,6 +134,19 @@ public class ImeBackAnimationControllerTest {
}
@Test
+ public void testAdjustResizeWithEdgeToEdgePlaysAnim() {
+ // set OnContentApplyWindowInsetsListener to null (to simulate edge-to-edge enabled) and
+ // softInputMode=adjustResize
+ mViewRoot.mWindowAttributes.softInputMode = SOFT_INPUT_ADJUST_RESIZE;
+ mViewRoot.setOnContentApplyWindowInsetsListener(null);
+ // start back gesture
+ mBackAnimationController.onBackStarted(new BackEvent(0f, 0f, 0f, EDGE_LEFT));
+ // verify that ImeBackAnimationController takes control over IME insets
+ verify(mInsetsController, times(1)).controlWindowInsetsAnimation(anyInt(), any(), any(),
+ anyBoolean(), anyLong(), any(), anyInt(), anyBoolean());
+ }
+
+ @Test
public void testAdjustResizeWithoutAppWindowInsetsListenerNotPlayingAnim() {
// setup ViewRoot with softInputMode=adjustResize
mViewRoot.mWindowAttributes.softInputMode = SOFT_INPUT_ADJUST_RESIZE;
diff --git a/graphics/java/android/graphics/fonts/FontFamily.java b/graphics/java/android/graphics/fonts/FontFamily.java
index bd1327657fb0..5a7b0bbca399 100644
--- a/graphics/java/android/graphics/fonts/FontFamily.java
+++ b/graphics/java/android/graphics/fonts/FontFamily.java
@@ -25,6 +25,7 @@ import android.annotation.IntDef;
import android.annotation.IntRange;
import android.annotation.NonNull;
import android.annotation.Nullable;
+import android.annotation.SuppressLint;
import android.text.FontConfig;
import android.util.SparseIntArray;
@@ -151,6 +152,7 @@ public final class FontFamily {
* @return A variable font family. null if a variable font cannot be built from the given
* fonts.
*/
+ @SuppressLint("BuilderSetStyle")
@FlaggedApi(FLAG_NEW_FONTS_FALLBACK_XML)
public @Nullable FontFamily buildVariableFamily() {
int variableFamilyType = analyzeAndResolveVariableType(mFonts);
diff --git a/graphics/java/android/graphics/text/LineBreakConfig.java b/graphics/java/android/graphics/text/LineBreakConfig.java
index 7d55928aa656..5a1086cef407 100644
--- a/graphics/java/android/graphics/text/LineBreakConfig.java
+++ b/graphics/java/android/graphics/text/LineBreakConfig.java
@@ -23,6 +23,7 @@ import android.annotation.FlaggedApi;
import android.annotation.IntDef;
import android.annotation.NonNull;
import android.annotation.Nullable;
+import android.annotation.SuppressLint;
import android.app.ActivityThread;
import android.os.Build;
import android.os.LocaleList;
@@ -314,6 +315,7 @@ public final class LineBreakConfig implements Parcelable {
* @param config an override line break config
* @return This {@code Builder}.
*/
+ @SuppressLint("BuilderSetStyle")
@FlaggedApi(FLAG_NO_BREAK_NO_HYPHENATION_SPAN)
public @NonNull Builder merge(@NonNull LineBreakConfig config) {
if (config.mLineBreakStyle != LINE_BREAK_STYLE_UNSPECIFIED) {
diff --git a/graphics/java/android/graphics/text/LineBreaker.java b/graphics/java/android/graphics/text/LineBreaker.java
index d8cf21e72441..94de066c9182 100644
--- a/graphics/java/android/graphics/text/LineBreaker.java
+++ b/graphics/java/android/graphics/text/LineBreaker.java
@@ -18,6 +18,8 @@ package android.graphics.text;
import static com.android.text.flags.Flags.FLAG_USE_BOUNDS_FOR_WIDTH;
import static com.android.text.flags.Flags.FLAG_LETTER_SPACING_JUSTIFICATION;
+import static com.android.text.flags.Flags.FLAG_MISSING_GETTER_APIS;
+
import android.annotation.FlaggedApi;
import android.annotation.FloatRange;
@@ -488,6 +490,12 @@ public class LineBreaker {
private final long mNativePtr;
+ private final @BreakStrategy int mBreakStrategy;
+ private final @HyphenationFrequency int mHyphenationFrequency;
+ private final @JustificationMode int mJustificationMode;
+ private final int[] mIndents;
+ private final boolean mUseBoundsForWidth;
+
/**
* Use Builder instead.
*/
@@ -497,6 +505,67 @@ public class LineBreaker {
mNativePtr = nInit(breakStrategy, hyphenationFrequency,
justify == JUSTIFICATION_MODE_INTER_WORD, indents, useBoundsForWidth);
NoImagePreloadHolder.sRegistry.registerNativeAllocation(this, mNativePtr);
+
+ mBreakStrategy = breakStrategy;
+ mHyphenationFrequency = hyphenationFrequency;
+ mJustificationMode = justify;
+ mIndents = indents;
+ mUseBoundsForWidth = useBoundsForWidth;
+ }
+
+ /**
+ * Returns the break strategy used for this line breaker.
+ *
+ * @return the break strategy used for this line breaker.
+ * @see Builder#setBreakStrategy(int)
+ */
+ @FlaggedApi(FLAG_MISSING_GETTER_APIS)
+ public @BreakStrategy int getBreakStrategy() {
+ return mBreakStrategy;
+ }
+
+ /**
+ * Returns the hyphenation frequency used for this line breaker.
+ *
+ * @return the hyphenation frequency used for this line breaker.
+ * @see Builder#setHyphenationFrequency(int)
+ */
+ @FlaggedApi(FLAG_MISSING_GETTER_APIS)
+ public @HyphenationFrequency int getHyphenationFrequency() {
+ return mHyphenationFrequency;
+ }
+
+ /**
+ * Returns the justification mode used for this line breaker.
+ *
+ * @return the justification mode used for this line breaker.
+ * @see Builder#setJustificationMode(int)
+ */
+ @FlaggedApi(FLAG_MISSING_GETTER_APIS)
+ public @JustificationMode int getJustificationMode() {
+ return mJustificationMode;
+ }
+
+ /**
+ * Returns the indents used for this line breaker.
+ *
+ * @return the indents used for this line breaker.
+ * @see Builder#setIndents(int[])
+ */
+ @FlaggedApi(FLAG_MISSING_GETTER_APIS)
+ public @Nullable int[] getIndents() {
+ return mIndents;
+ }
+
+ /**
+ * Returns true if this line breaker uses bounds as width for line breaking.
+ *
+ * @return true if this line breaker uses bounds as width for line breaking.
+ * @see Builder#setUseBoundsForWidth(boolean)
+ */
+ @FlaggedApi(FLAG_MISSING_GETTER_APIS)
+ public boolean getUseBoundsForWidth() {
+ return mUseBoundsForWidth;
}
/**
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 1fbaeeac8608..29936cc2cac3 100644
--- a/libs/WindowManager/Jetpack/src/androidx/window/extensions/embedding/DividerPresenter.java
+++ b/libs/WindowManager/Jetpack/src/androidx/window/extensions/embedding/DividerPresenter.java
@@ -33,7 +33,9 @@ import static androidx.window.extensions.embedding.SplitPresenter.CONTAINER_POSI
import static androidx.window.extensions.embedding.SplitPresenter.CONTAINER_POSITION_RIGHT;
import static androidx.window.extensions.embedding.SplitPresenter.CONTAINER_POSITION_TOP;
-import android.annotation.DimenRes;
+import android.animation.Animator;
+import android.animation.AnimatorListenerAdapter;
+import android.animation.ValueAnimator;
import android.annotation.Nullable;
import android.app.Activity;
import android.app.ActivityThread;
@@ -53,9 +55,11 @@ import android.view.Gravity;
import android.view.MotionEvent;
import android.view.SurfaceControl;
import android.view.SurfaceControlViewHost;
+import android.view.VelocityTracker;
import android.view.View;
import android.view.WindowManager;
import android.view.WindowlessWindowManager;
+import android.view.animation.PathInterpolator;
import android.widget.FrameLayout;
import android.widget.ImageButton;
import android.window.InputTransferToken;
@@ -97,6 +101,16 @@ class DividerPresenter implements View.OnTouchListener {
@VisibleForTesting
static final int DEFAULT_DIVIDER_WIDTH_DP = 24;
+ @VisibleForTesting
+ static final PathInterpolator FLING_ANIMATION_INTERPOLATOR =
+ new PathInterpolator(0.4f, 0f, 0.2f, 1f);
+ @VisibleForTesting
+ static final int FLING_ANIMATION_DURATION = 250;
+ @VisibleForTesting
+ static final int MIN_DISMISS_VELOCITY_DP_PER_SECOND = 600;
+ @VisibleForTesting
+ static final int MIN_FLING_VELOCITY_DP_PER_SECOND = 400;
+
private final int mTaskId;
@NonNull
@@ -109,6 +123,14 @@ class DividerPresenter implements View.OnTouchListener {
private final Executor mCallbackExecutor;
/**
+ * The VelocityTracker of the divider, used to track the dragging velocity. This field is
+ * {@code null} until dragging starts.
+ */
+ @GuardedBy("mLock")
+ @Nullable
+ VelocityTracker mVelocityTracker;
+
+ /**
* The {@link Properties} of the divider. This field is {@code null} when no divider should be
* drawn, e.g. when the split doesn't have {@link DividerAttributes} or when the decor surface
* is not available.
@@ -370,13 +392,11 @@ class DividerPresenter implements View.OnTouchListener {
applicationContext.getResources().getDisplayMetrics());
}
- private static int getDimensionDp(@DimenRes int resId) {
- final Context context = ActivityThread.currentActivityThread().getApplication();
- final int px = context.getResources().getDimensionPixelSize(resId);
- return (int) TypedValue.convertPixelsToDimension(
- COMPLEX_UNIT_DIP,
- px,
- context.getResources().getDisplayMetrics());
+ private static float getDisplayDensity() {
+ // TODO(b/329193115) support divider on secondary display
+ final Context applicationContext =
+ ActivityThread.currentActivityThread().getApplication();
+ return applicationContext.getResources().getDisplayMetrics().density;
}
/**
@@ -487,24 +507,27 @@ class DividerPresenter implements View.OnTouchListener {
@Override
public boolean onTouch(@NonNull View view, @NonNull MotionEvent event) {
synchronized (mLock) {
- final Rect taskBounds = mProperties.mConfiguration.windowConfiguration.getBounds();
- mDividerPosition = calculateDividerPosition(
- event, taskBounds, mRenderer.mDividerWidthPx, mProperties.mDividerAttributes,
- mProperties.mIsVerticalSplit, calculateMinPosition(), calculateMaxPosition());
- mRenderer.setDividerPosition(mDividerPosition);
- switch (event.getAction()) {
- case MotionEvent.ACTION_DOWN:
- onStartDragging();
- break;
- case MotionEvent.ACTION_UP:
- case MotionEvent.ACTION_CANCEL:
- onFinishDragging();
- break;
- case MotionEvent.ACTION_MOVE:
- onDrag();
- break;
- default:
- break;
+ if (mProperties != null && mRenderer != null) {
+ final Rect taskBounds = mProperties.mConfiguration.windowConfiguration.getBounds();
+ mDividerPosition = calculateDividerPosition(
+ event, taskBounds, mRenderer.mDividerWidthPx,
+ mProperties.mDividerAttributes, mProperties.mIsVerticalSplit,
+ calculateMinPosition(), calculateMaxPosition());
+ mRenderer.setDividerPosition(mDividerPosition);
+ switch (event.getAction()) {
+ case MotionEvent.ACTION_DOWN:
+ onStartDragging(event);
+ break;
+ case MotionEvent.ACTION_UP:
+ case MotionEvent.ACTION_CANCEL:
+ onFinishDragging(event);
+ break;
+ case MotionEvent.ACTION_MOVE:
+ onDrag(event);
+ break;
+ default:
+ break;
+ }
}
}
@@ -514,7 +537,10 @@ class DividerPresenter implements View.OnTouchListener {
}
@GuardedBy("mLock")
- private void onStartDragging() {
+ private void onStartDragging(@NonNull MotionEvent event) {
+ mVelocityTracker = VelocityTracker.obtain();
+ mVelocityTracker.addMovement(event);
+
mRenderer.mIsDragging = true;
mRenderer.mDragHandle.setPressed(mRenderer.mIsDragging);
mRenderer.updateSurface();
@@ -536,16 +562,81 @@ class DividerPresenter implements View.OnTouchListener {
}
@GuardedBy("mLock")
- private void onDrag() {
+ private void onDrag(@NonNull MotionEvent event) {
+ if (mVelocityTracker != null) {
+ mVelocityTracker.addMovement(event);
+ }
mRenderer.updateSurface();
}
@GuardedBy("mLock")
- private void onFinishDragging() {
- mDividerPosition = adjustDividerPositionForSnapPoints(mDividerPosition);
- mRenderer.setDividerPosition(mDividerPosition);
+ private void onFinishDragging(@NonNull MotionEvent event) {
+ float velocity = 0.0f;
+ if (mVelocityTracker != null) {
+ mVelocityTracker.addMovement(event);
+ mVelocityTracker.computeCurrentVelocity(1000 /* units */);
+ velocity = mProperties.mIsVerticalSplit
+ ? mVelocityTracker.getXVelocity()
+ : mVelocityTracker.getYVelocity();
+ mVelocityTracker.recycle();
+ }
+
+ final int prevDividerPosition = mDividerPosition;
+ mDividerPosition = dividerPositionForSnapPoints(mDividerPosition, velocity);
+ if (mDividerPosition != prevDividerPosition) {
+ ValueAnimator animator = getFlingAnimator(prevDividerPosition, mDividerPosition);
+ animator.start();
+ } else {
+ onDraggingEnd();
+ }
+ }
+
+ @GuardedBy("mLock")
+ @NonNull
+ @VisibleForTesting
+ ValueAnimator getFlingAnimator(int prevDividerPosition, int snappedDividerPosition) {
+ final ValueAnimator animator =
+ getValueAnimator(prevDividerPosition, snappedDividerPosition);
+ animator.addUpdateListener(animation -> {
+ synchronized (mLock) {
+ updateDividerPosition((int) animation.getAnimatedValue());
+ }
+ });
+ animator.addListener(new AnimatorListenerAdapter() {
+ @Override
+ public void onAnimationEnd(Animator animation) {
+ synchronized (mLock) {
+ onDraggingEnd();
+ }
+ }
+
+ @Override
+ public void onAnimationCancel(Animator animation) {
+ synchronized (mLock) {
+ onDraggingEnd();
+ }
+ }
+ });
+ return animator;
+ }
+
+ @VisibleForTesting
+ static ValueAnimator getValueAnimator(int prevDividerPosition, int snappedDividerPosition) {
+ ValueAnimator animator = ValueAnimator
+ .ofInt(prevDividerPosition, snappedDividerPosition)
+ .setDuration(FLING_ANIMATION_DURATION);
+ animator.setInterpolator(FLING_ANIMATION_INTERPOLATOR);
+ return animator;
+ }
+
+ @GuardedBy("mLock")
+ private void updateDividerPosition(int position) {
+ mRenderer.setDividerPosition(position);
mRenderer.updateSurface();
+ }
+ @GuardedBy("mLock")
+ private void onDraggingEnd() {
// Veil visibility change should be applied together with the surface boost transaction in
// the wct.
final SurfaceControl.Transaction t = new SurfaceControl.Transaction();
@@ -570,36 +661,76 @@ class DividerPresenter implements View.OnTouchListener {
/**
* Returns the divider position adjusted for the min max ratio and fullscreen expansion.
- *
- * If the dragging position is above the {@link DividerAttributes#getPrimaryMaxRatio()} or below
- * {@link DividerAttributes#getPrimaryMinRatio()} and
- * {@link DividerAttributes#isDraggingToFullscreenAllowed} is {@code true}, the system will
- * choose a snap algorithm to adjust the ending position to either fully expand one container or
- * move the divider back to the specified min/max ratio.
- *
- * TODO(b/327067596) implement snap algorithm
- *
* The adjusted divider position is in the range of [minPosition, maxPosition] for a split, 0
* for expanded right (bottom) container, or task width (height) minus the divider width for
* expanded left (top) container.
*/
@GuardedBy("mLock")
- private int adjustDividerPositionForSnapPoints(int dividerPosition) {
+ private int dividerPositionForSnapPoints(int dividerPosition, float velocity) {
final Rect taskBounds = mProperties.mConfiguration.windowConfiguration.getBounds();
final int minPosition = calculateMinPosition();
final int maxPosition = calculateMaxPosition();
final int fullyExpandedPosition = mProperties.mIsVerticalSplit
? taskBounds.right - mRenderer.mDividerWidthPx
: taskBounds.bottom - mRenderer.mDividerWidthPx;
+
if (isDraggingToFullscreenAllowed(mProperties.mDividerAttributes)) {
- if (dividerPosition < minPosition) {
- return 0;
+ final float displayDensity = getDisplayDensity();
+ return dividerPositionWithDraggingToFullscreenAllowed(
+ dividerPosition,
+ minPosition,
+ maxPosition,
+ fullyExpandedPosition,
+ velocity,
+ displayDensity);
+ }
+ return Math.clamp(dividerPosition, minPosition, maxPosition);
+ }
+
+ /**
+ * Returns the divider position given a set of position options. A snap algorithm is used to
+ * adjust the ending position to either fully expand one container or move the divider back to
+ * the specified min/max ratio depending on the dragging velocity.
+ */
+ @VisibleForTesting
+ static int dividerPositionWithDraggingToFullscreenAllowed(int dividerPosition, int minPosition,
+ int maxPosition, int fullyExpandedPosition, float velocity, float displayDensity) {
+ final float minDismissVelocityPxPerSecond =
+ MIN_DISMISS_VELOCITY_DP_PER_SECOND * displayDensity;
+ final float minFlingVelocityPxPerSecond =
+ MIN_FLING_VELOCITY_DP_PER_SECOND * displayDensity;
+ if (dividerPosition < minPosition && velocity < -minDismissVelocityPxPerSecond) {
+ return 0;
+ }
+ if (dividerPosition > maxPosition && velocity > minDismissVelocityPxPerSecond) {
+ return fullyExpandedPosition;
+ }
+ if (Math.abs(velocity) < minFlingVelocityPxPerSecond) {
+ if (dividerPosition >= minPosition && dividerPosition <= maxPosition) {
+ return dividerPosition;
}
- if (dividerPosition > maxPosition) {
- return fullyExpandedPosition;
+ int[] possiblePositions = {0, minPosition, maxPosition, fullyExpandedPosition};
+ return snap(dividerPosition, possiblePositions);
+ }
+ if (velocity < 0) {
+ return 0;
+ } else {
+ return fullyExpandedPosition;
+ }
+ }
+
+ /** Calculates the snapped divider position based on the possible positions and distance. */
+ private static int snap(int dividerPosition, int[] possiblePositions) {
+ int snappedPosition = dividerPosition;
+ float minDistance = Float.MAX_VALUE;
+ for (int position : possiblePositions) {
+ float distance = Math.abs(dividerPosition - position);
+ if (distance < minDistance) {
+ snappedPosition = position;
+ minDistance = distance;
}
}
- return Math.clamp(dividerPosition, minPosition, maxPosition);
+ return snappedPosition;
}
private static void setDecorSurfaceBoosted(
diff --git a/libs/WindowManager/Jetpack/src/androidx/window/extensions/embedding/SplitController.java b/libs/WindowManager/Jetpack/src/androidx/window/extensions/embedding/SplitController.java
index 13c2d1f73461..b764b6ee065f 100644
--- a/libs/WindowManager/Jetpack/src/androidx/window/extensions/embedding/SplitController.java
+++ b/libs/WindowManager/Jetpack/src/androidx/window/extensions/embedding/SplitController.java
@@ -50,6 +50,7 @@ import static androidx.window.extensions.embedding.SplitPresenter.getActivityInt
import static androidx.window.extensions.embedding.SplitPresenter.getMinDimensions;
import static androidx.window.extensions.embedding.SplitPresenter.sanitizeBounds;
import static androidx.window.extensions.embedding.SplitPresenter.shouldShowSplit;
+import static androidx.window.extensions.embedding.TaskFragmentContainer.OverlayContainerRestoreParams;
import android.annotation.CallbackExecutor;
import android.app.Activity;
@@ -133,6 +134,13 @@ public class SplitController implements JetpackTaskFragmentOrganizer.TaskFragmen
private final List<EmbeddingRule> mSplitRules = new ArrayList<>();
/**
+ * Stores the token of the associated Activity that maps to the
+ * {@link OverlayContainerRestoreParams} of the most recent created overlay container.
+ */
+ @GuardedBy("mLock")
+ final ArrayMap<IBinder, OverlayContainerRestoreParams> mOverlayRestoreParams = new ArrayMap<>();
+
+ /**
* A developer-defined {@link SplitAttributes} calculator to compute the current
* {@link SplitAttributes} with the current device and window states.
* It is registered via {@link #setSplitAttributesCalculator(Function)}
@@ -686,11 +694,20 @@ public class SplitController implements JetpackTaskFragmentOrganizer.TaskFragmen
exception);
break;
case TYPE_ACTIVITY_REPARENTED_TO_TASK:
+ final IBinder candidateAssociatedActToken, lastOverlayToken;
+ if (Flags.fixPipRestoreToOverlay()) {
+ candidateAssociatedActToken = change.getOtherActivityToken();
+ lastOverlayToken = change.getTaskFragmentToken();
+ } else {
+ candidateAssociatedActToken = lastOverlayToken = null;
+ }
onActivityReparentedToTask(
wct,
taskId,
change.getActivityIntent(),
- change.getActivityToken());
+ change.getActivityToken(),
+ candidateAssociatedActToken,
+ lastOverlayToken);
break;
default:
throw new IllegalArgumentException(
@@ -917,11 +934,28 @@ public class SplitController implements JetpackTaskFragmentOrganizer.TaskFragmen
* different process, the server will generate a temporary token that
* the organizer can use to reparent the activity through
* {@link WindowContainerTransaction} if needed.
+ * @param candidateAssociatedActToken The token of the candidate associated-activity.
+ * @param lastOverlayToken The last parent overlay container token.
*/
@VisibleForTesting
@GuardedBy("mLock")
void onActivityReparentedToTask(@NonNull WindowContainerTransaction wct,
- int taskId, @NonNull Intent activityIntent, @NonNull IBinder activityToken) {
+ int taskId, @NonNull Intent activityIntent, @NonNull IBinder activityToken,
+ @Nullable IBinder candidateAssociatedActToken, @Nullable IBinder lastOverlayToken) {
+ // Reparent the activity to an overlay container if needed.
+ final OverlayContainerRestoreParams params = getOverlayContainerRestoreParams(
+ candidateAssociatedActToken, lastOverlayToken);
+ if (params != null) {
+ final Activity associatedActivity = getActivity(candidateAssociatedActToken);
+ final TaskFragmentContainer targetContainer = createOrUpdateOverlayTaskFragmentIfNeeded(
+ wct, params.mOptions, params.mIntent, associatedActivity);
+ if (targetContainer != null) {
+ wct.reparentActivityToTaskFragment(targetContainer.getTaskFragmentToken(),
+ activityToken);
+ return;
+ }
+ }
+
// If the activity belongs to the current app process, we treat it as a new activity
// launch.
final Activity activity = getActivity(activityToken);
@@ -966,6 +1000,43 @@ public class SplitController implements JetpackTaskFragmentOrganizer.TaskFragmen
}
/**
+ * Returns the {@link OverlayContainerRestoreParams} that stored last time the {@code
+ * associatedActivityToken} associated with and only if data matches the {@code overlayToken}.
+ * Otherwise, return {@code null}.
+ */
+ @VisibleForTesting
+ @GuardedBy("mLock")
+ @Nullable
+ OverlayContainerRestoreParams getOverlayContainerRestoreParams(
+ @Nullable IBinder associatedActivityToken, @Nullable IBinder overlayToken) {
+ if (!Flags.fixPipRestoreToOverlay()) {
+ return null;
+ }
+
+ if (associatedActivityToken == null || overlayToken == null) {
+ return null;
+ }
+
+ final TaskFragmentContainer.OverlayContainerRestoreParams params =
+ mOverlayRestoreParams.get(associatedActivityToken);
+ if (params == null) {
+ return null;
+ }
+
+ if (params.mOverlayToken != overlayToken) {
+ // Not the same overlay container, no need to restore.
+ return null;
+ }
+
+ final Activity associatedActivity = getActivity(associatedActivityToken);
+ if (associatedActivity == null || associatedActivity.isFinishing()) {
+ return null;
+ }
+
+ return params;
+ }
+
+ /**
* Called when the {@link WindowContainerTransaction} created with
* {@link WindowContainerTransaction#setErrorCallbackToken(IBinder)} failed on the server side.
*
@@ -1433,6 +1504,8 @@ public class SplitController implements JetpackTaskFragmentOrganizer.TaskFragmen
for (int i = mTaskContainers.size() - 1; i >= 0; i--) {
mTaskContainers.valueAt(i).onFinishingActivityPaused(wct, activityToken);
}
+
+ mOverlayRestoreParams.remove(activity.getActivityToken());
updateCallbackIfNecessary();
}
@@ -1450,6 +1523,8 @@ public class SplitController implements JetpackTaskFragmentOrganizer.TaskFragmen
for (int i = mTaskContainers.size() - 1; i >= 0; i--) {
mTaskContainers.valueAt(i).onActivityDestroyed(wct, activityToken);
}
+
+ mOverlayRestoreParams.remove(activity.getActivityToken());
// We didn't trigger the callback if there were any pending appeared activities, so check
// again after the pending is removed.
updateCallbackIfNecessary();
diff --git a/libs/WindowManager/Jetpack/src/androidx/window/extensions/embedding/TaskFragmentContainer.java b/libs/WindowManager/Jetpack/src/androidx/window/extensions/embedding/TaskFragmentContainer.java
index 482554351b97..d0b6a01bb51e 100644
--- a/libs/WindowManager/Jetpack/src/androidx/window/extensions/embedding/TaskFragmentContainer.java
+++ b/libs/WindowManager/Jetpack/src/androidx/window/extensions/embedding/TaskFragmentContainer.java
@@ -36,6 +36,7 @@ import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.android.internal.annotations.VisibleForTesting;
+import com.android.window.flags.Flags;
import java.util.ArrayList;
import java.util.Collections;
@@ -274,6 +275,15 @@ class TaskFragmentContainer {
addPendingAppearedActivity(pendingAppearedActivity);
}
mPendingAppearedIntent = pendingAppearedIntent;
+
+ // Save the information necessary for restoring the overlay when needed.
+ if (Flags.fixPipRestoreToOverlay() && overlayTag != null && pendingAppearedIntent != null
+ && associatedActivity != null && !associatedActivity.isFinishing()) {
+ final IBinder associatedActivityToken = associatedActivity.getActivityToken();
+ final OverlayContainerRestoreParams params = new OverlayContainerRestoreParams(mToken,
+ launchOptions, pendingAppearedIntent);
+ mController.mOverlayRestoreParams.put(associatedActivityToken, params);
+ }
}
/**
@@ -1105,4 +1115,25 @@ class TaskFragmentContainer {
}
return sb.append("]").toString();
}
+
+ static class OverlayContainerRestoreParams {
+ /** The token of the overlay container */
+ @NonNull
+ final IBinder mOverlayToken;
+
+ /** The launch options to create this container. */
+ @NonNull
+ final Bundle mOptions;
+
+ /** The Intent that used to be started in the overlay container. */
+ @NonNull
+ final Intent mIntent;
+
+ OverlayContainerRestoreParams(@NonNull IBinder overlayToken, @NonNull Bundle options,
+ @NonNull Intent intent) {
+ mOverlayToken = overlayToken;
+ mOptions = options;
+ mIntent = intent;
+ }
+ }
}
diff --git a/libs/WindowManager/Jetpack/tests/unittest/src/androidx/window/extensions/embedding/DividerPresenterTest.java b/libs/WindowManager/Jetpack/tests/unittest/src/androidx/window/extensions/embedding/DividerPresenterTest.java
index b0a45e285896..746607c8094c 100644
--- a/libs/WindowManager/Jetpack/tests/unittest/src/androidx/window/extensions/embedding/DividerPresenterTest.java
+++ b/libs/WindowManager/Jetpack/tests/unittest/src/androidx/window/extensions/embedding/DividerPresenterTest.java
@@ -19,6 +19,10 @@ package androidx.window.extensions.embedding;
import static android.window.TaskFragmentOperation.OP_TYPE_CREATE_OR_MOVE_TASK_FRAGMENT_DECOR_SURFACE;
import static android.window.TaskFragmentOperation.OP_TYPE_REMOVE_TASK_FRAGMENT_DECOR_SURFACE;
+import static androidx.window.extensions.embedding.DividerPresenter.FLING_ANIMATION_DURATION;
+import static androidx.window.extensions.embedding.DividerPresenter.FLING_ANIMATION_INTERPOLATOR;
+import static androidx.window.extensions.embedding.DividerPresenter.MIN_DISMISS_VELOCITY_DP_PER_SECOND;
+import static androidx.window.extensions.embedding.DividerPresenter.MIN_FLING_VELOCITY_DP_PER_SECOND;
import static androidx.window.extensions.embedding.DividerPresenter.getBoundsOffsetForDivider;
import static androidx.window.extensions.embedding.DividerPresenter.getInitialDividerPosition;
import static androidx.window.extensions.embedding.SplitPresenter.CONTAINER_POSITION_BOTTOM;
@@ -35,6 +39,7 @@ import static org.mockito.Mockito.never;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
+import android.animation.ValueAnimator;
import android.app.Activity;
import android.content.res.Configuration;
import android.graphics.Color;
@@ -637,6 +642,105 @@ public class DividerPresenterTest {
DividerPresenter.getContainerBackgroundColor(container, defaultColor));
}
+ @Test
+ public void testGetValueAnimator() {
+ ValueAnimator animator =
+ DividerPresenter.getValueAnimator(
+ 375 /* prevDividerPosition */,
+ 500 /* snappedDividerPosition */);
+
+ assertEquals(animator.getDuration(), FLING_ANIMATION_DURATION);
+ assertEquals(animator.getInterpolator(), FLING_ANIMATION_INTERPOLATOR);
+ }
+
+ @Test
+ public void testDividerPositionWithDraggingToFullscreenAllowed() {
+ final float displayDensity = 600F;
+ final float dismissVelocity = MIN_DISMISS_VELOCITY_DP_PER_SECOND * displayDensity + 10f;
+ final float nonFlingVelocity = MIN_FLING_VELOCITY_DP_PER_SECOND * displayDensity - 10f;
+ final float flingVelocity = MIN_FLING_VELOCITY_DP_PER_SECOND * displayDensity + 10f;
+
+ // Divider position is less than minPosition and the velocity is enough to be dismissed
+ assertEquals(
+ 0, // Closed position
+ DividerPresenter.dividerPositionWithDraggingToFullscreenAllowed(
+ 10 /* dividerPosition */,
+ 30 /* minPosition */,
+ 900 /* maxPosition */,
+ 1200 /* fullyExpandedPosition */,
+ -dismissVelocity,
+ displayDensity));
+
+ // Divider position is greater than maxPosition and the velocity is enough to be dismissed
+ assertEquals(
+ 1200, // Fully expanded position
+ DividerPresenter.dividerPositionWithDraggingToFullscreenAllowed(
+ 1000 /* dividerPosition */,
+ 30 /* minPosition */,
+ 900 /* maxPosition */,
+ 1200 /* fullyExpandedPosition */,
+ dismissVelocity,
+ displayDensity));
+
+ // Divider position is returned when the velocity is not fast enough for fling and is in
+ // between minPosition and maxPosition
+ assertEquals(
+ 500, // dividerPosition is not snapped
+ DividerPresenter.dividerPositionWithDraggingToFullscreenAllowed(
+ 500 /* dividerPosition */,
+ 30 /* minPosition */,
+ 900 /* maxPosition */,
+ 1200 /* fullyExpandedPosition */,
+ nonFlingVelocity,
+ displayDensity));
+
+ // Divider position is snapped when the velocity is not fast enough for fling and larger
+ // than maxPosition
+ assertEquals(
+ 900, // Closest position is maxPosition
+ DividerPresenter.dividerPositionWithDraggingToFullscreenAllowed(
+ 950 /* dividerPosition */,
+ 30 /* minPosition */,
+ 900 /* maxPosition */,
+ 1200 /* fullyExpandedPosition */,
+ nonFlingVelocity,
+ displayDensity));
+
+ // Divider position is snapped when the velocity is not fast enough for fling and smaller
+ // than minPosition
+ assertEquals(
+ 30, // Closest position is minPosition
+ DividerPresenter.dividerPositionWithDraggingToFullscreenAllowed(
+ 20 /* dividerPosition */,
+ 30 /* minPosition */,
+ 900 /* maxPosition */,
+ 1200 /* fullyExpandedPosition */,
+ nonFlingVelocity,
+ displayDensity));
+
+ // Divider position is greater than minPosition and the velocity is enough for fling
+ assertEquals(
+ 0, // Closed position
+ DividerPresenter.dividerPositionWithDraggingToFullscreenAllowed(
+ 50 /* dividerPosition */,
+ 30 /* minPosition */,
+ 900 /* maxPosition */,
+ 1200 /* fullyExpandedPosition */,
+ -flingVelocity,
+ displayDensity));
+
+ // Divider position is less than maxPosition and the velocity is enough for fling
+ assertEquals(
+ 1200, // Fully expanded position
+ DividerPresenter.dividerPositionWithDraggingToFullscreenAllowed(
+ 800 /* dividerPosition */,
+ 30 /* minPosition */,
+ 900 /* maxPosition */,
+ 1200 /* fullyExpandedPosition */,
+ flingVelocity,
+ displayDensity));
+ }
+
private TaskFragmentContainer createMockTaskFragmentContainer(
@NonNull IBinder token, @NonNull Rect bounds) {
final TaskFragmentContainer container = mock(TaskFragmentContainer.class);
diff --git a/libs/WindowManager/Jetpack/tests/unittest/src/androidx/window/extensions/embedding/OverlayPresentationTest.java b/libs/WindowManager/Jetpack/tests/unittest/src/androidx/window/extensions/embedding/OverlayPresentationTest.java
index 9ebcb759115d..f3222572a3e2 100644
--- a/libs/WindowManager/Jetpack/tests/unittest/src/androidx/window/extensions/embedding/OverlayPresentationTest.java
+++ b/libs/WindowManager/Jetpack/tests/unittest/src/androidx/window/extensions/embedding/OverlayPresentationTest.java
@@ -836,6 +836,30 @@ public class OverlayPresentationTest {
any());
}
+ @Test
+ public void testOnActivityReparentedToTask_overlayRestoration() {
+ mSetFlagRule.enableFlags(Flags.FLAG_FIX_PIP_RESTORE_TO_OVERLAY);
+
+ // Prepares and mock the data necessary for the test.
+ final IBinder activityToken = mActivity.getActivityToken();
+ final Intent intent = new Intent();
+ final IBinder fillTaskActivityToken = new Binder();
+ final IBinder lastOverlayToken = new Binder();
+ final TaskFragmentContainer overlayContainer = mSplitController.newContainer(intent,
+ mActivity, TASK_ID);
+ final TaskFragmentContainer.OverlayContainerRestoreParams params = mock(
+ TaskFragmentContainer.OverlayContainerRestoreParams.class);
+ doReturn(params).when(mSplitController).getOverlayContainerRestoreParams(any(), any());
+ doReturn(overlayContainer).when(mSplitController).createOrUpdateOverlayTaskFragmentIfNeeded(
+ any(), any(), any(), any());
+
+ // Verify the activity should be reparented to the overlay container.
+ mSplitController.onActivityReparentedToTask(mTransaction, TASK_ID, intent, activityToken,
+ fillTaskActivityToken, lastOverlayToken);
+ verify(mTransaction).reparentActivityToTaskFragment(
+ eq(overlayContainer.getTaskFragmentToken()), eq(activityToken));
+ }
+
/**
* A simplified version of {@link SplitController#createOrUpdateOverlayTaskFragmentIfNeeded}
*/
diff --git a/libs/WindowManager/Jetpack/tests/unittest/src/androidx/window/extensions/embedding/SplitControllerTest.java b/libs/WindowManager/Jetpack/tests/unittest/src/androidx/window/extensions/embedding/SplitControllerTest.java
index 7d86ec2272af..35353dbe36be 100644
--- a/libs/WindowManager/Jetpack/tests/unittest/src/androidx/window/extensions/embedding/SplitControllerTest.java
+++ b/libs/WindowManager/Jetpack/tests/unittest/src/androidx/window/extensions/embedding/SplitControllerTest.java
@@ -397,7 +397,8 @@ public class SplitControllerTest {
@Test
public void testOnActivityReparentedToTask_sameProcess() {
mSplitController.onActivityReparentedToTask(mTransaction, TASK_ID, new Intent(),
- mActivity.getActivityToken());
+ mActivity.getActivityToken(), null /* fillTaskActivityToken */,
+ null /* lastOverlayToken */);
// Treated as on activity created, but allow to split as primary.
verify(mSplitController).resolveActivityToContainer(mTransaction,
@@ -413,7 +414,8 @@ public class SplitControllerTest {
final IBinder activityToken = new Binder();
final Intent intent = new Intent();
- mSplitController.onActivityReparentedToTask(mTransaction, TASK_ID, intent, activityToken);
+ mSplitController.onActivityReparentedToTask(mTransaction, TASK_ID, intent, activityToken,
+ null /* fillTaskActivityToken */, null /* lastOverlayToken */);
// Treated as starting new intent
verify(mSplitController, never()).resolveActivityToContainer(any(), any(), anyBoolean());
@@ -1210,7 +1212,7 @@ public class SplitControllerTest {
mSplitController.onTransactionReady(transaction);
verify(mSplitController).onActivityReparentedToTask(any(), eq(TASK_ID), eq(intent),
- eq(activityToken));
+ eq(activityToken), any(), any());
verify(mSplitPresenter).onTransactionHandled(eq(transaction.getTransactionToken()), any(),
anyInt(), anyBoolean());
}
diff --git a/libs/WindowManager/Shell/aconfig/multitasking.aconfig b/libs/WindowManager/Shell/aconfig/multitasking.aconfig
index 8977d5cad780..66d48799204c 100644
--- a/libs/WindowManager/Shell/aconfig/multitasking.aconfig
+++ b/libs/WindowManager/Shell/aconfig/multitasking.aconfig
@@ -78,3 +78,10 @@ flag {
description: "Allow opening bubbles overflow UI without bubbles being visible"
bug: "340337839"
}
+
+flag {
+ name: "enable_bubble_stashing"
+ namespace: "multitasking"
+ description: "Allow the floating bubble stack to stash on the edge of the screen"
+ bug: "341361249"
+}
diff --git a/libs/WindowManager/Shell/multivalentTests/src/com/android/wm/shell/bubbles/BubblePositionerTest.kt b/libs/WindowManager/Shell/multivalentTests/src/com/android/wm/shell/bubbles/BubblePositionerTest.kt
index 8487e3792993..9e1440d5716b 100644
--- a/libs/WindowManager/Shell/multivalentTests/src/com/android/wm/shell/bubbles/BubblePositionerTest.kt
+++ b/libs/WindowManager/Shell/multivalentTests/src/com/android/wm/shell/bubbles/BubblePositionerTest.kt
@@ -218,11 +218,10 @@ class BubblePositionerTest {
insets = Insets.of(10, 20, 5, 15),
windowBounds = Rect(0, 0, 1800, 2600)
)
- val bubbleBarBounds = Rect(1700, 2500, 1780, 2600)
positioner.setShowingInBubbleBar(true)
positioner.update(deviceConfig)
- positioner.bubbleBarBounds = bubbleBarBounds
+ positioner.bubbleBarTopOnScreen = 2500
val spaceBetweenTopInsetAndBubbleBarInLandscape = 1680
val expandedViewVerticalSpacing =
@@ -246,10 +245,9 @@ class BubblePositionerTest {
insets = Insets.of(10, 20, 5, 15),
windowBounds = Rect(0, 0, screenWidth, 2600)
)
- val bubbleBarBounds = Rect(100, 2500, 280, 2550)
positioner.setShowingInBubbleBar(true)
positioner.update(deviceConfig)
- positioner.bubbleBarBounds = bubbleBarBounds
+ positioner.bubbleBarTopOnScreen = 2500
val spaceBetweenTopInsetAndBubbleBarInLandscape = 180
val expandedViewSpacing =
@@ -597,16 +595,19 @@ class BubblePositionerTest {
private fun testGetBubbleBarExpandedViewBounds(onLeft: Boolean, isOverflow: Boolean) {
positioner.setShowingInBubbleBar(true)
+ val windowBounds = Rect(0, 0, 2000, 2600)
+ val insets = Insets.of(10, 20, 5, 15)
val deviceConfig =
defaultDeviceConfig.copy(
isLargeScreen = true,
isLandscape = true,
- insets = Insets.of(10, 20, 5, 15),
- windowBounds = Rect(0, 0, 2000, 2600)
+ insets = insets,
+ windowBounds = windowBounds
)
positioner.update(deviceConfig)
- positioner.bubbleBarBounds = getBubbleBarBounds(onLeft, deviceConfig)
+ val bubbleBarHeight = 100
+ positioner.bubbleBarTopOnScreen = windowBounds.bottom - insets.bottom - bubbleBarHeight
val expandedViewPadding =
context.resources.getDimensionPixelSize(R.dimen.bubble_expanded_view_padding)
@@ -624,7 +625,7 @@ class BubblePositionerTest {
left = right - positioner.getExpandedViewWidthForBubbleBar(isOverflow)
}
// Above the bubble bar
- val bottom = positioner.bubbleBarBounds.top - expandedViewPadding
+ val bottom = positioner.bubbleBarTopOnScreen - expandedViewPadding
// Calculate right and top based on size
val top = bottom - positioner.getExpandedViewHeightForBubbleBar(isOverflow)
val expectedBounds = Rect(left, top, right, bottom)
@@ -666,21 +667,4 @@ class BubblePositionerTest {
positioner.getAllowableStackPositionRegion(1 /* bubbleCount */)
return allowableStackRegion.top + allowableStackRegion.height() * offsetPercent
}
-
- private fun getBubbleBarBounds(onLeft: Boolean, deviceConfig: DeviceConfig): Rect {
- val width = 200
- val height = 100
- val bottom = deviceConfig.windowBounds.bottom - deviceConfig.insets.bottom
- val top = bottom - height
- val left: Int
- val right: Int
- if (onLeft) {
- left = deviceConfig.insets.left
- right = left + width
- } else {
- right = deviceConfig.windowBounds.right - deviceConfig.insets.right
- left = right - width
- }
- return Rect(left, top, right, bottom)
- }
}
diff --git a/libs/WindowManager/Shell/multivalentTests/src/com/android/wm/shell/bubbles/bar/BubbleExpandedViewPinControllerTest.kt b/libs/WindowManager/Shell/multivalentTests/src/com/android/wm/shell/bubbles/bar/BubbleExpandedViewPinControllerTest.kt
index 076414132e27..12d19279111a 100644
--- a/libs/WindowManager/Shell/multivalentTests/src/com/android/wm/shell/bubbles/bar/BubbleExpandedViewPinControllerTest.kt
+++ b/libs/WindowManager/Shell/multivalentTests/src/com/android/wm/shell/bubbles/bar/BubbleExpandedViewPinControllerTest.kt
@@ -53,7 +53,6 @@ class BubbleExpandedViewPinControllerTest {
const val SCREEN_WIDTH = 2000
const val SCREEN_HEIGHT = 1000
- const val BUBBLE_BAR_WIDTH = 100
const val BUBBLE_BAR_HEIGHT = 50
}
@@ -84,14 +83,8 @@ class BubbleExpandedViewPinControllerTest {
insets = Insets.of(10, 20, 30, 40)
)
positioner.update(deviceConfig)
- positioner.bubbleBarBounds =
- Rect(
- SCREEN_WIDTH - deviceConfig.insets.right - BUBBLE_BAR_WIDTH,
- SCREEN_HEIGHT - deviceConfig.insets.bottom - BUBBLE_BAR_HEIGHT,
- SCREEN_WIDTH - deviceConfig.insets.right,
- SCREEN_HEIGHT - deviceConfig.insets.bottom
- )
-
+ positioner.bubbleBarTopOnScreen =
+ SCREEN_HEIGHT - deviceConfig.insets.bottom - BUBBLE_BAR_HEIGHT
controller = BubbleExpandedViewPinController(context, container, positioner)
testListener = TestLocationChangeListener()
controller.setListener(testListener)
@@ -247,9 +240,10 @@ class BubbleExpandedViewPinControllerTest {
private val dropTargetView: View?
get() = container.findViewById(R.id.bubble_bar_drop_target)
- private fun getExpectedDropTargetBounds(onLeft: Boolean): Rect = Rect().also {
- positioner.getBubbleBarExpandedViewBounds(onLeft, false /* isOveflowExpanded */, it)
- }
+ private fun getExpectedDropTargetBounds(onLeft: Boolean): Rect =
+ Rect().also {
+ positioner.getBubbleBarExpandedViewBounds(onLeft, false /* isOveflowExpanded */, it)
+ }
private fun runOnMainSync(runnable: Runnable) {
InstrumentationRegistry.getInstrumentation().runOnMainSync(runnable)
diff --git a/libs/WindowManager/Shell/res/values/dimen.xml b/libs/WindowManager/Shell/res/values/dimen.xml
index 8d24c161e3e4..aa4fb4448ac7 100644
--- a/libs/WindowManager/Shell/res/values/dimen.xml
+++ b/libs/WindowManager/Shell/res/values/dimen.xml
@@ -247,13 +247,11 @@
<!-- Padding for the bubble popup view contents. -->
<dimen name="bubble_popup_padding">24dp</dimen>
<!-- The size of the caption bar inset at the top of bubble bar expanded view. -->
- <dimen name="bubble_bar_expanded_view_caption_height">32dp</dimen>
+ <dimen name="bubble_bar_expanded_view_caption_height">36dp</dimen>
<!-- The width of the caption bar at the top of bubble bar expanded view. -->
- <dimen name="bubble_bar_expanded_view_caption_width">128dp</dimen>
- <!-- The height of the dots shown for the caption menu in the bubble bar expanded view.. -->
- <dimen name="bubble_bar_expanded_view_caption_dot_size">4dp</dimen>
- <!-- The spacing between the dots for the caption menu in the bubble bar expanded view.. -->
- <dimen name="bubble_bar_expanded_view_caption_dot_spacing">4dp</dimen>
+ <dimen name="bubble_bar_expanded_view_caption_width">80dp</dimen>
+ <!-- The height of the handle shown for the caption menu in the bubble bar expanded view. -->
+ <dimen name="bubble_bar_expanded_view_handle_height">4dp</dimen>
<!-- Width of the expanded bubble bar view shown when the bubble is expanded. -->
<dimen name="bubble_bar_expanded_view_width">412dp</dimen>
<!-- Minimum width of the bubble bar manage menu. -->
diff --git a/libs/WindowManager/Shell/shared/src/com/android/wm/shell/shared/DesktopModeStatus.java b/libs/WindowManager/Shell/shared/src/com/android/wm/shell/shared/DesktopModeStatus.java
index bdd89c0e1ac9..8d8655addc65 100644
--- a/libs/WindowManager/Shell/shared/src/com/android/wm/shell/shared/DesktopModeStatus.java
+++ b/libs/WindowManager/Shell/shared/src/com/android/wm/shell/shared/DesktopModeStatus.java
@@ -67,6 +67,16 @@ public class DesktopModeStatus {
private static final boolean ENFORCE_DEVICE_RESTRICTIONS = SystemProperties.getBoolean(
"persist.wm.debug.desktop_mode_enforce_device_restrictions", true);
+ /** Override density for tasks when they're inside the desktop. */
+ public static final int DESKTOP_DENSITY_OVERRIDE =
+ SystemProperties.getInt("persist.wm.debug.desktop_mode_density", 284);
+
+ /** The minimum override density allowed for tasks inside the desktop. */
+ private static final int DESKTOP_DENSITY_MIN = 100;
+
+ /** The maximum override density allowed for tasks inside the desktop. */
+ private static final int DESKTOP_DENSITY_MAX = 1000;
+
/**
* Default value for {@code MAX_TASK_LIMIT}.
*/
@@ -145,4 +155,12 @@ public class DesktopModeStatus {
public static boolean canEnterDesktopMode(@NonNull Context context) {
return (!enforceDeviceRestrictions() || isDesktopModeSupported(context)) && isEnabled();
}
+
+ /**
+ * Return {@code true} if the override desktop density is set.
+ */
+ public static boolean isDesktopDensityOverrideSet() {
+ return DESKTOP_DENSITY_OVERRIDE >= DESKTOP_DENSITY_MIN
+ && DESKTOP_DENSITY_OVERRIDE <= DESKTOP_DENSITY_MAX;
+ }
}
diff --git a/libs/WindowManager/Shell/shared/src/com/android/wm/shell/shared/TransitionUtil.java b/libs/WindowManager/Shell/shared/src/com/android/wm/shell/shared/TransitionUtil.java
index 785e30d879d2..6ca6517abbb0 100644
--- a/libs/WindowManager/Shell/shared/src/com/android/wm/shell/shared/TransitionUtil.java
+++ b/libs/WindowManager/Shell/shared/src/com/android/wm/shell/shared/TransitionUtil.java
@@ -322,7 +322,7 @@ public class TransitionUtil {
null,
new Rect(change.getStartAbsBounds()),
taskInfo,
- change.getAllowEnterPip(),
+ change.isAllowEnterPip(),
INVALID_WINDOW_TYPE
);
target.setWillShowImeOnTarget(
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/back/CrossActivityBackAnimation.kt b/libs/WindowManager/Shell/src/com/android/wm/shell/back/CrossActivityBackAnimation.kt
index c988c2fb5103..71fc8c3a01ea 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/back/CrossActivityBackAnimation.kt
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/back/CrossActivityBackAnimation.kt
@@ -41,6 +41,9 @@ import android.window.BackMotionEvent
import android.window.BackNavigationInfo
import android.window.BackProgressAnimator
import android.window.IOnBackInvokedCallback
+import com.android.internal.dynamicanimation.animation.FloatValueHolder
+import com.android.internal.dynamicanimation.animation.SpringAnimation
+import com.android.internal.dynamicanimation.animation.SpringForce
import com.android.internal.jank.Cuj
import com.android.internal.policy.ScreenDecorationsUtils
import com.android.internal.protolog.common.ProtoLog
@@ -70,6 +73,7 @@ abstract class CrossActivityBackAnimation(
protected val backAnimRect = Rect()
private val cropRect = Rect()
+ private val tempRectF = RectF()
private var cornerRadius = ScreenDecorationsUtils.getWindowCornerRadius(context)
@@ -98,6 +102,12 @@ abstract class CrossActivityBackAnimation(
private var rightLetterboxLayer: SurfaceControl? = null
private var letterboxColor: Int = 0
+ private val postCommitFlingScale = FloatValueHolder(SPRING_SCALE)
+ private var lastPostCommitFlingScale = SPRING_SCALE
+ private val postCommitFlingSpring = SpringForce(SPRING_SCALE)
+ .setStiffness(SpringForce.STIFFNESS_LOW)
+ .setDampingRatio(SpringForce.DAMPING_RATIO_LOW_BOUNCY)
+
/** Background color to be used during the animation, also see [getBackgroundColor] */
protected var customizedBackgroundColor = 0
@@ -231,7 +241,7 @@ abstract class CrossActivityBackAnimation(
return deltaY
}
- protected open fun onGestureCommitted() {
+ protected open fun onGestureCommitted(velocity: Float) {
if (
closingTarget?.leash == null ||
enteringTarget?.leash == null ||
@@ -242,6 +252,14 @@ abstract class CrossActivityBackAnimation(
return
}
+ // kick off spring animation with the current velocity from the pre-commit phase, this
+ // affects the scaling of the closing activity during post-commit
+ val flingAnimation = SpringAnimation(postCommitFlingScale, SPRING_SCALE)
+ .setStartVelocity(min(0f, -velocity * SPRING_SCALE))
+ .setStartValue(SPRING_SCALE)
+ .setSpring(postCommitFlingSpring)
+ flingAnimation.start()
+
val valueAnimator = ValueAnimator.ofFloat(1f, 0f).setDuration(POST_COMMIT_DURATION)
valueAnimator.addUpdateListener { animation: ValueAnimator ->
val progress = animation.animatedFraction
@@ -291,6 +309,7 @@ abstract class CrossActivityBackAnimation(
removeLetterbox()
isLetterboxed = false
enteringHasSameLetterbox = false
+ lastPostCommitFlingScale = SPRING_SCALE
}
protected fun applyTransform(
@@ -300,7 +319,15 @@ abstract class CrossActivityBackAnimation(
baseTransformation: Transformation? = null
) {
if (leash == null || !leash.isValid) return
- val scale = rect.width() / backAnimRect.width()
+ tempRectF.set(rect)
+ if (leash == closingTarget?.leash) {
+ lastPostCommitFlingScale = (postCommitFlingScale.value / SPRING_SCALE).coerceIn(
+ minimumValue = MAX_FLING_SCALE, maximumValue = lastPostCommitFlingScale
+ )
+ // apply an additional scale to the closing target to account for fling velocity
+ tempRectF.scaleCentered(lastPostCommitFlingScale)
+ }
+ val scale = tempRectF.width() / backAnimRect.width()
val matrix = baseTransformation?.matrix ?: transformMatrix.apply { reset() }
val scalePivotX =
if (isLetterboxed && enteringHasSameLetterbox) {
@@ -309,7 +336,7 @@ abstract class CrossActivityBackAnimation(
0f
}
matrix.postScale(scale, scale, scalePivotX, 0f)
- matrix.postTranslate(rect.left, rect.top)
+ matrix.postTranslate(tempRectF.left, tempRectF.top)
transaction
.setAlpha(leash, keepMinimumAlpha(alpha))
.setMatrix(leash, matrix, tmpFloat9)
@@ -461,7 +488,7 @@ abstract class CrossActivityBackAnimation(
override fun onBackInvoked() {
progressAnimator.reset()
- onGestureCommitted()
+ onGestureCommitted(progressAnimator.velocity)
}
}
@@ -497,6 +524,8 @@ abstract class CrossActivityBackAnimation(
private const val MAX_SCRIM_ALPHA_DARK = 0.8f
private const val MAX_SCRIM_ALPHA_LIGHT = 0.2f
private const val POST_COMMIT_DURATION = 300L
+ private const val SPRING_SCALE = 100f
+ private const val MAX_FLING_SCALE = 0.6f
}
}
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/back/DefaultCrossActivityBackAnimation.kt b/libs/WindowManager/Shell/src/com/android/wm/shell/back/DefaultCrossActivityBackAnimation.kt
index f33c5b9bd183..d6c5349201b8 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/back/DefaultCrossActivityBackAnimation.kt
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/back/DefaultCrossActivityBackAnimation.kt
@@ -56,7 +56,7 @@ constructor(
targetEnteringRect.scaleCentered(MAX_SCALE)
}
- override fun onGestureCommitted() {
+ override fun onGestureCommitted(velocity: Float) {
// We enter phase 2 of the animation, the starting coordinates for phase 2 are the current
// coordinate of the gesture driven phase. Let's update the start and target rects and kick
// off the animator in the superclass
@@ -65,7 +65,7 @@ constructor(
targetEnteringRect.set(backAnimRect)
targetClosingRect.set(backAnimRect)
targetClosingRect.offset(currentClosingRect.left + enteringStartOffset, 0f)
- super.onGestureCommitted()
+ super.onGestureCommitted(velocity)
}
override fun onPostCommitProgress(linearProgress: Float) {
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleController.java b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleController.java
index 38c344322a30..42a4ab2e352d 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleController.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleController.java
@@ -1189,10 +1189,12 @@ public class BubbleController implements ConfigurationChangeListener,
* A bubble is no longer being dragged in Launcher. And was released in given location.
* Will be called only when bubble bar is expanded.
*
- * @param location location where bubble was released
+ * @param location location where bubble was released
+ * @param topOnScreen top coordinate of the bubble bar on the screen after release
*/
- public void stopBubbleDrag(BubbleBarLocation location) {
+ public void stopBubbleDrag(BubbleBarLocation location, int topOnScreen) {
mBubblePositioner.setBubbleBarLocation(location);
+ mBubblePositioner.setBubbleBarTopOnScreen(topOnScreen);
if (mBubbleData.getSelectedBubble() != null) {
mBubbleBarViewCallback.expansionChanged(/* isExpanded = */ true);
}
@@ -1248,8 +1250,8 @@ public class BubbleController implements ConfigurationChangeListener,
* <p>This is used by external callers (launcher).
*/
@VisibleForTesting
- public void expandStackAndSelectBubbleFromLauncher(String key, Rect bubbleBarBounds) {
- mBubblePositioner.setBubbleBarBounds(bubbleBarBounds);
+ public void expandStackAndSelectBubbleFromLauncher(String key, int topOnScreen) {
+ mBubblePositioner.setBubbleBarTopOnScreen(topOnScreen);
if (BubbleOverflow.KEY.equals(key)) {
mBubbleData.setSelectedBubbleFromLauncher(mBubbleData.getOverflow());
@@ -2364,10 +2366,9 @@ public class BubbleController implements ConfigurationChangeListener,
}
@Override
- public void showBubble(String key, Rect bubbleBarBounds) {
+ public void showBubble(String key, int topOnScreen) {
mMainExecutor.execute(
- () -> mController.expandStackAndSelectBubbleFromLauncher(
- key, bubbleBarBounds));
+ () -> mController.expandStackAndSelectBubbleFromLauncher(key, topOnScreen));
}
@Override
@@ -2386,8 +2387,8 @@ public class BubbleController implements ConfigurationChangeListener,
}
@Override
- public void stopBubbleDrag(BubbleBarLocation location) {
- mMainExecutor.execute(() -> mController.stopBubbleDrag(location));
+ public void stopBubbleDrag(BubbleBarLocation location, int topOnScreen) {
+ mMainExecutor.execute(() -> mController.stopBubbleDrag(location, topOnScreen));
}
@Override
@@ -2408,9 +2409,9 @@ public class BubbleController implements ConfigurationChangeListener,
}
@Override
- public void setBubbleBarBounds(Rect bubbleBarBounds) {
+ public void updateBubbleBarTopOnScreen(int topOnScreen) {
mMainExecutor.execute(() -> {
- mBubblePositioner.setBubbleBarBounds(bubbleBarBounds);
+ mBubblePositioner.setBubbleBarTopOnScreen(topOnScreen);
if (mLayerView != null) mLayerView.updateExpandedView();
});
}
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubblePositioner.java b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubblePositioner.java
index a35a004cdace..1e482cac0b46 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubblePositioner.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubblePositioner.java
@@ -98,7 +98,7 @@ public class BubblePositioner {
private boolean mShowingInBubbleBar;
private BubbleBarLocation mBubbleBarLocation = BubbleBarLocation.DEFAULT;
- private final Rect mBubbleBarBounds = new Rect();
+ private int mBubbleBarTopOnScreen;
public BubblePositioner(Context context, WindowManager windowManager) {
mContext = context;
@@ -846,17 +846,17 @@ public class BubblePositioner {
}
/**
- * Sets the position of the bubble bar in display coordinates.
+ * Set top coordinate of bubble bar on screen
*/
- public void setBubbleBarBounds(Rect bubbleBarBounds) {
- mBubbleBarBounds.set(bubbleBarBounds);
+ public void setBubbleBarTopOnScreen(int topOnScreen) {
+ mBubbleBarTopOnScreen = topOnScreen;
}
/**
- * Returns the display coordinates of the bubble bar.
+ * Returns the top coordinate of bubble bar on screen
*/
- public Rect getBubbleBarBounds() {
- return mBubbleBarBounds;
+ public int getBubbleBarTopOnScreen() {
+ return mBubbleBarTopOnScreen;
}
/**
@@ -908,7 +908,7 @@ public class BubblePositioner {
/** The bottom position of the expanded view when showing above the bubble bar. */
public int getExpandedViewBottomForBubbleBar() {
- return mBubbleBarBounds.top - mExpandedViewPadding;
+ return mBubbleBarTopOnScreen - mExpandedViewPadding;
}
/**
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/IBubbles.aidl b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/IBubbles.aidl
index 1eff149f2e91..1db556c04180 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/IBubbles.aidl
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/IBubbles.aidl
@@ -31,7 +31,7 @@ interface IBubbles {
oneway void unregisterBubbleListener(in IBubblesListener listener) = 2;
- oneway void showBubble(in String key, in Rect bubbleBarBounds) = 3;
+ oneway void showBubble(in String key, in int topOnScreen) = 3;
oneway void dragBubbleToDismiss(in String key) = 4;
@@ -45,7 +45,7 @@ interface IBubbles {
oneway void setBubbleBarLocation(in BubbleBarLocation location) = 9;
- oneway void setBubbleBarBounds(in Rect bubbleBarBounds) = 10;
+ oneway void updateBubbleBarTopOnScreen(in int topOnScreen) = 10;
- oneway void stopBubbleDrag(in BubbleBarLocation location) = 11;
+ oneway void stopBubbleDrag(in BubbleBarLocation location, in int topOnScreen) = 11;
} \ No newline at end of file
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/bar/BubbleBarAnimationHelper.java b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/bar/BubbleBarAnimationHelper.java
index 45ad6319bbf8..8e58db198b13 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/bar/BubbleBarAnimationHelper.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/bar/BubbleBarAnimationHelper.java
@@ -237,12 +237,10 @@ public class BubbleBarAnimationHelper {
private void setScaleFromBubbleBar(AnimatableScaleMatrix matrix, float scale) {
// Set the pivot point for the scale, so the view animates out from the bubble bar.
- Rect bubbleBarBounds = mPositioner.getBubbleBarBounds();
- matrix.setScale(
- scale,
- scale,
- bubbleBarBounds.centerX(),
- bubbleBarBounds.top);
+ Rect availableRect = mPositioner.getAvailableRect();
+ float pivotX = mPositioner.isBubbleBarOnLeft() ? availableRect.left : availableRect.right;
+ float pivotY = mPositioner.getBubbleBarTopOnScreen();
+ matrix.setScale(scale, scale, pivotX, pivotY);
}
/**
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/bar/BubbleBarHandleView.java b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/bar/BubbleBarHandleView.java
index 2b7a0706b4de..d54a6b002e43 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/bar/BubbleBarHandleView.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/bar/BubbleBarHandleView.java
@@ -37,15 +37,11 @@ import com.android.wm.shell.R;
*/
public class BubbleBarHandleView extends View {
private static final long COLOR_CHANGE_DURATION = 120;
-
- // The handle view is currently rendered as 3 evenly spaced dots.
- private int mDotSize;
- private int mDotSpacing;
// Path used to draw the dots
private final Path mPath = new Path();
- private @ColorInt int mHandleLightColor;
- private @ColorInt int mHandleDarkColor;
+ private final @ColorInt int mHandleLightColor;
+ private final @ColorInt int mHandleDarkColor;
private @Nullable ObjectAnimator mColorChangeAnim;
public BubbleBarHandleView(Context context) {
@@ -63,10 +59,8 @@ public class BubbleBarHandleView extends View {
public BubbleBarHandleView(Context context, AttributeSet attrs, int defStyleAttr,
int defStyleRes) {
super(context, attrs, defStyleAttr, defStyleRes);
- mDotSize = getResources().getDimensionPixelSize(
- R.dimen.bubble_bar_expanded_view_caption_dot_size);
- mDotSpacing = getResources().getDimensionPixelSize(
- R.dimen.bubble_bar_expanded_view_caption_dot_spacing);
+ final int handleHeight = getResources().getDimensionPixelSize(
+ R.dimen.bubble_bar_expanded_view_handle_height);
mHandleLightColor = ContextCompat.getColor(getContext(),
R.color.bubble_bar_expanded_view_handle_light);
mHandleDarkColor = ContextCompat.getColor(getContext(),
@@ -76,27 +70,13 @@ public class BubbleBarHandleView extends View {
setOutlineProvider(new ViewOutlineProvider() {
@Override
public void getOutline(View view, Outline outline) {
- final int handleCenterX = view.getWidth() / 2;
final int handleCenterY = view.getHeight() / 2;
- final int handleTotalWidth = mDotSize * 3 + mDotSpacing * 2;
- final int handleLeft = handleCenterX - handleTotalWidth / 2;
- final int handleTop = handleCenterY - mDotSize / 2;
- final int handleBottom = handleTop + mDotSize;
- RectF dot1 = new RectF(
- handleLeft, handleTop,
- handleLeft + mDotSize, handleBottom);
- RectF dot2 = new RectF(
- dot1.right + mDotSpacing, handleTop,
- dot1.right + mDotSpacing + mDotSize, handleBottom
- );
- RectF dot3 = new RectF(
- dot2.right + mDotSpacing, handleTop,
- dot2.right + mDotSpacing + mDotSize, handleBottom
- );
+ final int handleTop = handleCenterY - handleHeight / 2;
+ final int handleBottom = handleTop + handleHeight;
+ final int radius = handleHeight / 2;
+ RectF handle = new RectF(/* left = */ 0, handleTop, view.getWidth(), handleBottom);
mPath.reset();
- mPath.addOval(dot1, Path.Direction.CW);
- mPath.addOval(dot2, Path.Direction.CW);
- mPath.addOval(dot3, Path.Direction.CW);
+ mPath.addRoundRect(handle, radius, radius, Path.Direction.CW);
outline.setPath(mPath);
}
});
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/common/SystemWindows.java b/libs/WindowManager/Shell/src/com/android/wm/shell/common/SystemWindows.java
index da414cc9ae70..ef33b3830e45 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/common/SystemWindows.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/common/SystemWindows.java
@@ -353,7 +353,7 @@ public class SystemWindows {
@Override
public void insetsControlChanged(InsetsState insetsState,
- InsetsSourceControl[] activeControls) {}
+ InsetsSourceControl.Array activeControls) {}
@Override
public void showInsets(int types, boolean fromIme, @Nullable ImeTracker.Token statsToken) {}
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/common/split/DividerView.java b/libs/WindowManager/Shell/src/com/android/wm/shell/common/split/DividerView.java
index 607a3b5423d1..2234041b8c9d 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/common/split/DividerView.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/common/split/DividerView.java
@@ -347,7 +347,7 @@ public class DividerView extends FrameLayout implements View.OnTouchListener {
if (mMoving) {
final int position = mSplitLayout.getDividerPosition() + touchPos - mStartPos;
mLastDraggingPosition = position;
- mSplitLayout.updateDividerBounds(position);
+ mSplitLayout.updateDividerBounds(position, true /* shouldUseParallaxEffect */);
}
break;
case MotionEvent.ACTION_UP:
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/common/split/SplitDecorManager.java b/libs/WindowManager/Shell/src/com/android/wm/shell/common/split/SplitDecorManager.java
index 30eb8b5d2f05..de016d3ae400 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/common/split/SplitDecorManager.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/common/split/SplitDecorManager.java
@@ -31,7 +31,6 @@ import android.animation.ValueAnimator;
import android.app.ActivityManager;
import android.content.Context;
import android.content.res.Configuration;
-import android.graphics.Color;
import android.graphics.PixelFormat;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
@@ -57,7 +56,13 @@ import com.android.wm.shell.common.SurfaceUtils;
import java.util.function.Consumer;
/**
- * Handles split decor like showing resizing hint for a specific split.
+ * Handles additional layers over a running task in a split pair, for example showing a veil with an
+ * app icon when the task is being resized (usually to hide weird layouts while the app is being
+ * stretched). One SplitDecorManager is initialized on each window.
+ * <br>
+ * Currently, we show a veil when:
+ * a) Task is resizing down from a fullscreen window.
+ * b) Task is being stretched past its original bounds.
*/
public class SplitDecorManager extends WindowlessWindowManager {
private static final String TAG = SplitDecorManager.class.getSimpleName();
@@ -78,7 +83,11 @@ public class SplitDecorManager extends WindowlessWindowManager {
private boolean mShown;
private boolean mIsResizing;
- private final Rect mOldBounds = new Rect();
+ /** The original bounds of the main task, captured at the beginning of a resize transition. */
+ private final Rect mOldMainBounds = new Rect();
+ /** The original bounds of the side task, captured at the beginning of a resize transition. */
+ private final Rect mOldSideBounds = new Rect();
+ /** The current bounds of the main task, mid-resize. */
private final Rect mResizingBounds = new Rect();
private final Rect mTempRect = new Rect();
private ValueAnimator mFadeAnimator;
@@ -184,29 +193,38 @@ public class SplitDecorManager extends WindowlessWindowManager {
mResizingIconView = null;
mIsResizing = false;
mShown = false;
- mOldBounds.setEmpty();
+ mOldMainBounds.setEmpty();
+ mOldSideBounds.setEmpty();
mResizingBounds.setEmpty();
}
/** Showing resizing hint. */
public void onResizing(ActivityManager.RunningTaskInfo resizingTask, Rect newBounds,
Rect sideBounds, SurfaceControl.Transaction t, int offsetX, int offsetY,
- boolean immediately) {
+ boolean immediately, float[] veilColor) {
if (mResizingIconView == null) {
return;
}
if (!mIsResizing) {
mIsResizing = true;
- mOldBounds.set(newBounds);
+ mOldMainBounds.set(newBounds);
+ mOldSideBounds.set(sideBounds);
}
mResizingBounds.set(newBounds);
mOffsetX = offsetX;
mOffsetY = offsetY;
- final boolean show =
- newBounds.width() > mOldBounds.width() || newBounds.height() > mOldBounds.height();
- final boolean update = show != mShown;
+ // Show a veil when:
+ // a) Task is resizing down from a fullscreen window.
+ // b) Task is being stretched past its original bounds.
+ final boolean isResizingDownFromFullscreen =
+ mOldSideBounds.width() <= 1 || mOldSideBounds.height() <= 1;
+ final boolean isStretchingPastOriginalBounds =
+ newBounds.width() > mOldMainBounds.width()
+ || newBounds.height() > mOldMainBounds.height();
+ final boolean showVeil = isResizingDownFromFullscreen || isStretchingPastOriginalBounds;
+ final boolean update = showVeil != mShown;
if (update && mFadeAnimator != null && mFadeAnimator.isRunning()) {
// If we need to animate and animator still running, cancel it before we ensure both
// background and icon surfaces are non null for next animation.
@@ -216,18 +234,18 @@ public class SplitDecorManager extends WindowlessWindowManager {
if (mBackgroundLeash == null) {
mBackgroundLeash = SurfaceUtils.makeColorLayer(mHostLeash,
RESIZING_BACKGROUND_SURFACE_NAME, mSurfaceSession);
- t.setColor(mBackgroundLeash, getResizingBackgroundColor(resizingTask))
+ t.setColor(mBackgroundLeash, veilColor)
.setLayer(mBackgroundLeash, Integer.MAX_VALUE - 1);
}
if (mGapBackgroundLeash == null && !immediately) {
final boolean isLandscape = newBounds.height() == sideBounds.height();
- final int left = isLandscape ? mOldBounds.width() : 0;
- final int top = isLandscape ? 0 : mOldBounds.height();
+ final int left = isLandscape ? mOldMainBounds.width() : 0;
+ final int top = isLandscape ? 0 : mOldMainBounds.height();
mGapBackgroundLeash = SurfaceUtils.makeColorLayer(mHostLeash,
GAP_BACKGROUND_SURFACE_NAME, mSurfaceSession);
// Fill up another side bounds area.
- t.setColor(mGapBackgroundLeash, getResizingBackgroundColor(resizingTask))
+ t.setColor(mGapBackgroundLeash, veilColor)
.setLayer(mGapBackgroundLeash, Integer.MAX_VALUE - 2)
.setPosition(mGapBackgroundLeash, left, top)
.setWindowCrop(mGapBackgroundLeash, sideBounds.width(), sideBounds.height());
@@ -251,12 +269,12 @@ public class SplitDecorManager extends WindowlessWindowManager {
if (update) {
if (immediately) {
- t.setVisibility(mBackgroundLeash, show);
- t.setVisibility(mIconLeash, show);
+ t.setVisibility(mBackgroundLeash, showVeil);
+ t.setVisibility(mIconLeash, showVeil);
} else {
- startFadeAnimation(show, false, null);
+ startFadeAnimation(showVeil, false, null);
}
- mShown = show;
+ mShown = showVeil;
}
}
@@ -309,7 +327,8 @@ public class SplitDecorManager extends WindowlessWindowManager {
mIsResizing = false;
mOffsetX = 0;
mOffsetY = 0;
- mOldBounds.setEmpty();
+ mOldMainBounds.setEmpty();
+ mOldSideBounds.setEmpty();
mResizingBounds.setEmpty();
if (mFadeAnimator != null && mFadeAnimator.isRunning()) {
if (!mShown) {
@@ -346,14 +365,14 @@ public class SplitDecorManager extends WindowlessWindowManager {
/** Screenshot host leash and attach on it if meet some conditions */
public void screenshotIfNeeded(SurfaceControl.Transaction t) {
- if (!mShown && mIsResizing && !mOldBounds.equals(mResizingBounds)) {
+ if (!mShown && mIsResizing && !mOldMainBounds.equals(mResizingBounds)) {
if (mScreenshotAnimator != null && mScreenshotAnimator.isRunning()) {
mScreenshotAnimator.cancel();
} else if (mScreenshot != null) {
t.remove(mScreenshot);
}
- mTempRect.set(mOldBounds);
+ mTempRect.set(mOldMainBounds);
mTempRect.offsetTo(0, 0);
mScreenshot = ScreenshotUtils.takeScreenshot(t, mHostLeash, mTempRect,
Integer.MAX_VALUE - 1);
@@ -364,7 +383,7 @@ public class SplitDecorManager extends WindowlessWindowManager {
public void setScreenshotIfNeeded(SurfaceControl screenshot, SurfaceControl.Transaction t) {
if (screenshot == null || !screenshot.isValid()) return;
- if (!mShown && mIsResizing && !mOldBounds.equals(mResizingBounds)) {
+ if (!mShown && mIsResizing && !mOldMainBounds.equals(mResizingBounds)) {
if (mScreenshotAnimator != null && mScreenshotAnimator.isRunning()) {
mScreenshotAnimator.cancel();
} else if (mScreenshot != null) {
@@ -465,9 +484,4 @@ public class SplitDecorManager extends WindowlessWindowManager {
mIcon = null;
}
}
-
- private static float[] getResizingBackgroundColor(ActivityManager.RunningTaskInfo taskInfo) {
- final int taskBgColor = taskInfo.taskDescription.getBackgroundColor();
- return Color.valueOf(taskBgColor == -1 ? Color.WHITE : taskBgColor).getComponents();
- }
}
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/common/split/SplitLayout.java b/libs/WindowManager/Shell/src/com/android/wm/shell/common/split/SplitLayout.java
index 2ea32f44a78b..8331654839c9 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/common/split/SplitLayout.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/common/split/SplitLayout.java
@@ -496,10 +496,10 @@ public final class SplitLayout implements DisplayInsetsController.OnInsetsChange
* Updates bounds with the passing position. Usually used to update recording bounds while
* performing animation or dragging divider bar to resize the splits.
*/
- void updateDividerBounds(int position) {
+ void updateDividerBounds(int position, boolean shouldUseParallaxEffect) {
updateBounds(position);
mSplitLayoutHandler.onLayoutSizeChanging(this, mSurfaceEffectPolicy.mParallaxOffset.x,
- mSurfaceEffectPolicy.mParallaxOffset.y);
+ mSurfaceEffectPolicy.mParallaxOffset.y, shouldUseParallaxEffect);
}
void setDividerPosition(int position, boolean applyLayoutChange) {
@@ -647,7 +647,9 @@ public final class SplitLayout implements DisplayInsetsController.OnInsetsChange
.setDuration(duration);
mDividerFlingAnimator.setInterpolator(Interpolators.FAST_OUT_SLOW_IN);
mDividerFlingAnimator.addUpdateListener(
- animation -> updateDividerBounds((int) animation.getAnimatedValue()));
+ animation -> updateDividerBounds(
+ (int) animation.getAnimatedValue(), false /* shouldUseParallaxEffect */)
+ );
mDividerFlingAnimator.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
@@ -897,7 +899,8 @@ public final class SplitLayout implements DisplayInsetsController.OnInsetsChange
* @see #applySurfaceChanges(SurfaceControl.Transaction, SurfaceControl, SurfaceControl,
* SurfaceControl, SurfaceControl, boolean)
*/
- void onLayoutSizeChanging(SplitLayout layout, int offsetX, int offsetY);
+ void onLayoutSizeChanging(SplitLayout layout, int offsetX, int offsetY,
+ boolean shouldUseParallaxEffect);
/**
* Calls when finish resizing the split bounds.
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/common/split/SplitScreenUtils.java b/libs/WindowManager/Shell/src/com/android/wm/shell/common/split/SplitScreenUtils.java
index f9259e79472e..e8226051b672 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/common/split/SplitScreenUtils.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/common/split/SplitScreenUtils.java
@@ -16,8 +16,6 @@
package com.android.wm.shell.common.split;
-import static android.content.pm.LauncherApps.ShortcutQuery.FLAG_MATCH_ALL_KINDS_WITH_ALL_PINNED;
-
import static com.android.wm.shell.common.split.SplitScreenConstants.CONTROLLED_ACTIVITY_TYPES;
import static com.android.wm.shell.common.split.SplitScreenConstants.CONTROLLED_WINDOWING_MODES;
import static com.android.wm.shell.common.split.SplitScreenConstants.SPLIT_POSITION_BOTTOM_OR_RIGHT;
@@ -26,25 +24,18 @@ import static com.android.wm.shell.common.split.SplitScreenConstants.SPLIT_POSIT
import android.app.ActivityManager;
import android.app.PendingIntent;
-import android.content.ComponentName;
import android.content.Intent;
-import android.content.pm.LauncherApps;
-import android.content.pm.ShortcutInfo;
import android.content.res.Configuration;
import android.content.res.Resources;
+import android.graphics.Color;
import android.graphics.Rect;
-import android.os.UserHandle;
-import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.android.internal.util.ArrayUtils;
import com.android.wm.shell.Flags;
import com.android.wm.shell.ShellTaskOrganizer;
-import java.util.Arrays;
-import java.util.List;
-
/** Helper utility class for split screen components to use. */
public class SplitScreenUtils {
/** Reverse the split position. */
@@ -137,4 +128,10 @@ public class SplitScreenUtils {
return isLandscape;
}
}
+
+ /** Returns the specified background color that matches a RunningTaskInfo. */
+ public static Color getResizingBackgroundColor(ActivityManager.RunningTaskInfo taskInfo) {
+ final int taskBgColor = taskInfo.taskDescription.getBackgroundColor();
+ return Color.valueOf(taskBgColor == -1 ? Color.WHITE : taskBgColor);
+ }
}
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 fb0a1ab3062e..4e9e8f97620c 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
@@ -100,6 +100,7 @@ import com.android.wm.shell.unfold.qualifier.UnfoldShellTransition;
import com.android.wm.shell.unfold.qualifier.UnfoldTransition;
import com.android.wm.shell.windowdecor.CaptionWindowDecorViewModel;
import com.android.wm.shell.windowdecor.DesktopModeWindowDecorViewModel;
+import com.android.wm.shell.windowdecor.ResizeHandleSizeRepository;
import com.android.wm.shell.windowdecor.WindowDecorViewModel;
import dagger.Binds;
@@ -220,7 +221,8 @@ public abstract class WMShellModule {
SyncTransactionQueue syncQueue,
Transitions transitions,
Optional<DesktopTasksController> desktopTasksController,
- RootTaskDisplayAreaOrganizer rootTaskDisplayAreaOrganizer) {
+ RootTaskDisplayAreaOrganizer rootTaskDisplayAreaOrganizer,
+ ResizeHandleSizeRepository resizeHandleSizeRepository) {
if (DesktopModeStatus.canEnterDesktopMode(context)) {
return new DesktopModeWindowDecorViewModel(
context,
@@ -237,7 +239,8 @@ public abstract class WMShellModule {
syncQueue,
transitions,
desktopTasksController,
- rootTaskDisplayAreaOrganizer);
+ rootTaskDisplayAreaOrganizer,
+ resizeHandleSizeRepository);
}
return new CaptionWindowDecorViewModel(
context,
@@ -247,7 +250,8 @@ public abstract class WMShellModule {
displayController,
rootTaskDisplayAreaOrganizer,
syncQueue,
- transitions);
+ transitions,
+ resizeHandleSizeRepository);
}
//
@@ -529,7 +533,8 @@ public abstract class WMShellModule {
exitDesktopTransitionHandler, toggleResizeDesktopTaskTransitionHandler,
dragToDesktopTransitionHandler, desktopModeTaskRepository,
desktopModeLoggerTransitionObserver, launchAdjacentController,
- recentsTransitionHandler, multiInstanceHelper, mainExecutor, desktopTasksLimiter);
+ recentsTransitionHandler, multiInstanceHelper,
+ mainExecutor, desktopTasksLimiter);
}
@WMSingleton
@@ -622,6 +627,12 @@ public abstract class WMShellModule {
return new DesktopModeEventLogger();
}
+ @WMSingleton
+ @Provides
+ static ResizeHandleSizeRepository provideResizeHandleSizeRepository() {
+ return new ResizeHandleSizeRepository();
+ }
+
//
// Drag and drop
//
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/dagger/pip/Pip1Module.java b/libs/WindowManager/Shell/src/com/android/wm/shell/dagger/pip/Pip1Module.java
index d644006cde81..677fd5deffd3 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/dagger/pip/Pip1Module.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/dagger/pip/Pip1Module.java
@@ -60,6 +60,7 @@ import com.android.wm.shell.splitscreen.SplitScreenController;
import com.android.wm.shell.sysui.ShellCommandHandler;
import com.android.wm.shell.sysui.ShellController;
import com.android.wm.shell.sysui.ShellInit;
+import com.android.wm.shell.transition.HomeTransitionObserver;
import com.android.wm.shell.transition.Transitions;
import dagger.Module;
@@ -192,11 +193,12 @@ public abstract class Pip1Module {
PipBoundsState pipBoundsState, PipDisplayLayoutState pipDisplayLayoutState,
PipTransitionState pipTransitionState, PhonePipMenuController pipMenuController,
PipSurfaceTransactionHelper pipSurfaceTransactionHelper,
+ HomeTransitionObserver homeTransitionObserver,
Optional<SplitScreenController> splitScreenOptional) {
return new PipTransition(context, shellInit, shellTaskOrganizer, transitions,
pipBoundsState, pipDisplayLayoutState, pipTransitionState, pipMenuController,
pipBoundsAlgorithm, pipAnimationController, pipSurfaceTransactionHelper,
- splitScreenOptional);
+ homeTransitionObserver, splitScreenOptional);
}
@WMSingleton
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/dagger/pip/Pip2Module.java b/libs/WindowManager/Shell/src/com/android/wm/shell/dagger/pip/Pip2Module.java
index 01364d1de279..696831747865 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/dagger/pip/Pip2Module.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/dagger/pip/Pip2Module.java
@@ -46,6 +46,7 @@ import com.android.wm.shell.pip2.phone.PipTouchHandler;
import com.android.wm.shell.pip2.phone.PipTransition;
import com.android.wm.shell.pip2.phone.PipTransitionState;
import com.android.wm.shell.shared.annotations.ShellMainThread;
+import com.android.wm.shell.sysui.ShellCommandHandler;
import com.android.wm.shell.sysui.ShellController;
import com.android.wm.shell.sysui.ShellInit;
import com.android.wm.shell.transition.Transitions;
@@ -82,6 +83,7 @@ public abstract class Pip2Module {
@Provides
static Optional<PipController> providePipController(Context context,
ShellInit shellInit,
+ ShellCommandHandler shellCommandHandler,
ShellController shellController,
DisplayController displayController,
DisplayInsetsController displayInsetsController,
@@ -97,9 +99,10 @@ public abstract class Pip2Module {
return Optional.empty();
} else {
return Optional.ofNullable(PipController.create(
- context, shellInit, shellController, displayController, displayInsetsController,
- pipBoundsState, pipBoundsAlgorithm, pipDisplayLayoutState, pipScheduler,
- taskStackListener, shellTaskOrganizer, pipTransitionState, mainExecutor));
+ context, shellInit, shellCommandHandler, shellController, displayController,
+ displayInsetsController, pipBoundsState, pipBoundsAlgorithm,
+ pipDisplayLayoutState, pipScheduler, taskStackListener, shellTaskOrganizer,
+ pipTransitionState, mainExecutor));
}
}
@@ -129,6 +132,7 @@ public abstract class Pip2Module {
@Provides
static PipTouchHandler providePipTouchHandler(Context context,
ShellInit shellInit,
+ ShellCommandHandler shellCommandHandler,
PhonePipMenuController menuPhoneController,
PipBoundsAlgorithm pipBoundsAlgorithm,
@NonNull PipBoundsState pipBoundsState,
@@ -140,10 +144,10 @@ public abstract class Pip2Module {
PipUiEventLogger pipUiEventLogger,
@ShellMainThread ShellExecutor mainExecutor,
Optional<PipPerfHintController> pipPerfHintControllerOptional) {
- return new PipTouchHandler(context, shellInit, menuPhoneController, pipBoundsAlgorithm,
- pipBoundsState, pipTransitionState, pipScheduler, sizeSpecSource, pipMotionHelper,
- floatingContentCoordinator, pipUiEventLogger, mainExecutor,
- pipPerfHintControllerOptional);
+ return new PipTouchHandler(context, shellInit, shellCommandHandler, menuPhoneController,
+ pipBoundsAlgorithm, pipBoundsState, pipTransitionState, pipScheduler,
+ sizeSpecSource, pipMotionHelper, floatingContentCoordinator, pipUiEventLogger,
+ mainExecutor, pipPerfHintControllerOptional);
}
@WMSingleton
@@ -163,7 +167,7 @@ public abstract class Pip2Module {
@WMSingleton
@Provides
- static PipTransitionState providePipStackListenerController() {
- return new PipTransitionState();
+ static PipTransitionState providePipTransitionState(@ShellMainThread Handler handler) {
+ return new PipTransitionState(handler);
}
}
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 2dc4573b4921..e5bf53a4afdb 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
@@ -73,6 +73,8 @@ import com.android.wm.shell.protolog.ShellProtoLogGroup.WM_SHELL_DESKTOP_MODE
import com.android.wm.shell.recents.RecentsTransitionHandler
import com.android.wm.shell.recents.RecentsTransitionStateListener
import com.android.wm.shell.shared.DesktopModeStatus
+import com.android.wm.shell.shared.DesktopModeStatus.DESKTOP_DENSITY_OVERRIDE
+import com.android.wm.shell.shared.DesktopModeStatus.isDesktopDensityOverrideSet
import com.android.wm.shell.shared.annotations.ExternalThread
import com.android.wm.shell.shared.annotations.ShellMainThread
import com.android.wm.shell.splitscreen.SplitScreenController
@@ -906,18 +908,22 @@ class DesktopTasksController(
task.taskId
)
return WindowContainerTransaction().also { wct ->
- addMoveToFullscreenChanges(wct, task)
+ bringDesktopAppsToFrontBeforeShowingNewTask(task.displayId, wct, task.taskId)
+ wct.reorder(task.token, true)
}
}
+ val wct = WindowContainerTransaction()
+ if (isDesktopDensityOverrideSet()) {
+ wct.setDensityDpi(task.token, DESKTOP_DENSITY_OVERRIDE)
+ }
// Desktop Mode is showing and we're launching a new Task - we might need to minimize
// a Task.
- val wct = WindowContainerTransaction()
val taskToMinimize = addAndGetMinimizeChangesIfNeeded(task.displayId, wct, task)
if (taskToMinimize != null) {
addPendingMinimizeTransition(transition, taskToMinimize)
return wct
}
- return null
+ return if (wct.isEmpty) null else wct
}
private fun handleFullscreenTaskLaunch(
@@ -985,7 +991,7 @@ class DesktopTasksController(
wct.setWindowingMode(taskInfo.token, targetWindowingMode)
wct.reorder(taskInfo.token, true /* onTop */)
if (isDesktopDensityOverrideSet()) {
- wct.setDensityDpi(taskInfo.token, getDesktopDensityDpi())
+ wct.setDensityDpi(taskInfo.token, DESKTOP_DENSITY_OVERRIDE)
}
}
@@ -1089,10 +1095,6 @@ class DesktopTasksController(
return context.resources.displayMetrics.densityDpi
}
- private fun getDesktopDensityDpi(): Int {
- return DESKTOP_DENSITY_OVERRIDE
- }
-
/** Creates a new instance of the external interface to pass to another process. */
private fun createExternalInterface(): ExternalInterfaceBinder {
return IDesktopModeImpl(this)
@@ -1466,21 +1468,9 @@ class DesktopTasksController(
}
companion object {
- private val DESKTOP_DENSITY_OVERRIDE =
- SystemProperties.getInt("persist.wm.debug.desktop_mode_density", 284)
- private val DESKTOP_DENSITY_ALLOWED_RANGE = (100..1000)
-
@JvmField
val DESKTOP_MODE_INITIAL_BOUNDS_SCALE = SystemProperties
.getInt("persist.wm.debug.desktop_mode_initial_bounds_scale", 75) / 100f
-
- /**
- * Check if desktop density override is enabled
- */
- @JvmStatic
- fun isDesktopDensityOverrideSet(): Boolean {
- return DESKTOP_DENSITY_OVERRIDE in DESKTOP_DENSITY_ALLOWED_RANGE
- }
}
/** The positions on a screen that a task can snap to. */
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/draganddrop/DragAndDropPolicy.java b/libs/WindowManager/Shell/src/com/android/wm/shell/draganddrop/DragAndDropPolicy.java
index 6a7d297e83e5..a42ca1905ee7 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/draganddrop/DragAndDropPolicy.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/draganddrop/DragAndDropPolicy.java
@@ -16,10 +16,9 @@
package com.android.wm.shell.draganddrop;
+import static android.app.ActivityOptions.MODE_BACKGROUND_ACTIVITY_START_ALLOWED;
import static android.app.ActivityOptions.MODE_BACKGROUND_ACTIVITY_START_DENIED;
import static android.app.ActivityTaskManager.INVALID_TASK_ID;
-import static android.app.ComponentOptions.KEY_PENDING_INTENT_BACKGROUND_ACTIVITY_ALLOWED;
-import static android.app.ComponentOptions.KEY_PENDING_INTENT_BACKGROUND_ACTIVITY_ALLOWED_BY_PERMISSION;
import static android.app.WindowConfiguration.ACTIVITY_TYPE_STANDARD;
import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
import static android.content.ClipDescription.EXTRA_ACTIVITY_OPTIONS;
@@ -47,7 +46,6 @@ import android.app.ActivityOptions;
import android.app.ActivityTaskManager;
import android.app.PendingIntent;
import android.content.ActivityNotFoundException;
-import android.content.ClipData;
import android.content.ClipDescription;
import android.content.Context;
import android.content.Intent;
@@ -265,13 +263,14 @@ public class DragAndDropPolicy {
final boolean isShortcut = description.hasMimeType(MIMETYPE_APPLICATION_SHORTCUT);
final ActivityOptions baseActivityOpts = ActivityOptions.makeBasic();
baseActivityOpts.setDisallowEnterPictureInPictureWhileLaunching(true);
+ // Put BAL flags to avoid activity start aborted.
+ baseActivityOpts.setPendingIntentBackgroundActivityStartMode(
+ MODE_BACKGROUND_ACTIVITY_START_ALLOWED);
+ baseActivityOpts.setPendingIntentBackgroundActivityLaunchAllowedByPermission(true);
final Bundle opts = baseActivityOpts.toBundle();
if (session.appData.hasExtra(EXTRA_ACTIVITY_OPTIONS)) {
opts.putAll(session.appData.getBundleExtra(EXTRA_ACTIVITY_OPTIONS));
}
- // Put BAL flags to avoid activity start aborted.
- opts.putBoolean(KEY_PENDING_INTENT_BACKGROUND_ACTIVITY_ALLOWED, true);
- opts.putBoolean(KEY_PENDING_INTENT_BACKGROUND_ACTIVITY_ALLOWED_BY_PERMISSION, true);
final UserHandle user = session.appData.getParcelableExtra(EXTRA_USER);
if (isTask) {
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/draganddrop/DragLayout.java b/libs/WindowManager/Shell/src/com/android/wm/shell/draganddrop/DragLayout.java
index 59d696918448..4bb10dfdf8c6 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/draganddrop/DragLayout.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/draganddrop/DragLayout.java
@@ -22,11 +22,11 @@ import static android.content.pm.ActivityInfo.CONFIG_ASSETS_PATHS;
import static android.content.pm.ActivityInfo.CONFIG_UI_MODE;
import static android.content.res.Configuration.ORIENTATION_LANDSCAPE;
import static android.view.ViewGroup.LayoutParams.MATCH_PARENT;
-import static android.view.ViewTreeObserver.InternalInsetsInfo.TOUCHABLE_INSETS_FRAME;
import static android.view.ViewTreeObserver.InternalInsetsInfo.TOUCHABLE_INSETS_REGION;
import static com.android.wm.shell.common.split.SplitScreenConstants.SPLIT_POSITION_BOTTOM_OR_RIGHT;
import static com.android.wm.shell.common.split.SplitScreenConstants.SPLIT_POSITION_TOP_OR_LEFT;
+import static com.android.wm.shell.common.split.SplitScreenUtils.getResizingBackgroundColor;
import static com.android.wm.shell.draganddrop.DragAndDropPolicy.Target.TYPE_SPLIT_BOTTOM;
import static com.android.wm.shell.draganddrop.DragAndDropPolicy.Target.TYPE_SPLIT_LEFT;
import static com.android.wm.shell.draganddrop.DragAndDropPolicy.Target.TYPE_SPLIT_RIGHT;
@@ -41,7 +41,6 @@ import android.app.StatusBarManager;
import android.content.Context;
import android.content.res.Configuration;
import android.content.res.Resources;
-import android.graphics.Color;
import android.graphics.Insets;
import android.graphics.Rect;
import android.graphics.Region;
@@ -278,7 +277,7 @@ public class DragLayout extends LinearLayout
final int activityType = taskInfo1.getActivityType();
if (activityType == ACTIVITY_TYPE_STANDARD) {
Drawable icon1 = mIconProvider.getIcon(taskInfo1.topActivityInfo);
- int bgColor1 = getResizingBackgroundColor(taskInfo1);
+ int bgColor1 = getResizingBackgroundColor(taskInfo1).toArgb();
mDropZoneView1.setAppInfo(bgColor1, icon1);
mDropZoneView2.setAppInfo(bgColor1, icon1);
updateDropZoneSizes(null, null); // passing null splits the views evenly
@@ -298,10 +297,10 @@ public class DragLayout extends LinearLayout
mSplitScreenController.getTaskInfo(SPLIT_POSITION_BOTTOM_OR_RIGHT);
if (topOrLeftTask != null && bottomOrRightTask != null) {
Drawable topOrLeftIcon = mIconProvider.getIcon(topOrLeftTask.topActivityInfo);
- int topOrLeftColor = getResizingBackgroundColor(topOrLeftTask);
+ int topOrLeftColor = getResizingBackgroundColor(topOrLeftTask).toArgb();
Drawable bottomOrRightIcon = mIconProvider.getIcon(
bottomOrRightTask.topActivityInfo);
- int bottomOrRightColor = getResizingBackgroundColor(bottomOrRightTask);
+ int bottomOrRightColor = getResizingBackgroundColor(bottomOrRightTask).toArgb();
mDropZoneView1.setAppInfo(topOrLeftColor, topOrLeftIcon);
mDropZoneView2.setAppInfo(bottomOrRightColor, bottomOrRightIcon);
}
@@ -556,11 +555,6 @@ public class DragLayout extends LinearLayout
}
}
- private static int getResizingBackgroundColor(ActivityManager.RunningTaskInfo taskInfo) {
- final int taskBgColor = taskInfo.taskDescription.getBackgroundColor();
- return Color.valueOf(taskBgColor == -1 ? Color.WHITE : taskBgColor).toArgb();
- }
-
/**
* Dumps information about this drag layout.
*/
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 2082756feda7..3c7713d30714 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
@@ -75,6 +75,7 @@ import com.android.wm.shell.shared.TransitionUtil;
import com.android.wm.shell.splitscreen.SplitScreenController;
import com.android.wm.shell.sysui.ShellInit;
import com.android.wm.shell.transition.CounterRotatorHelper;
+import com.android.wm.shell.transition.HomeTransitionObserver;
import com.android.wm.shell.transition.Transitions;
import java.io.PrintWriter;
@@ -107,6 +108,7 @@ public class PipTransition extends PipTransitionController {
private final PipDisplayLayoutState mPipDisplayLayoutState;
private final int mEnterExitAnimationDuration;
private final PipSurfaceTransactionHelper mSurfaceTransactionHelper;
+ private final HomeTransitionObserver mHomeTransitionObserver;
private final Optional<SplitScreenController> mSplitScreenOptional;
private final PipAnimationController mPipAnimationController;
private @PipAnimationController.AnimationType int mEnterAnimationType = ANIM_TYPE_BOUNDS;
@@ -164,6 +166,7 @@ public class PipTransition extends PipTransitionController {
PipBoundsAlgorithm pipBoundsAlgorithm,
PipAnimationController pipAnimationController,
PipSurfaceTransactionHelper pipSurfaceTransactionHelper,
+ HomeTransitionObserver homeTransitionObserver,
Optional<SplitScreenController> splitScreenOptional) {
super(shellInit, shellTaskOrganizer, transitions, pipBoundsState, pipMenuController,
pipBoundsAlgorithm);
@@ -174,6 +177,7 @@ public class PipTransition extends PipTransitionController {
mEnterExitAnimationDuration = context.getResources()
.getInteger(R.integer.config_pipResizeAnimationDuration);
mSurfaceTransactionHelper = pipSurfaceTransactionHelper;
+ mHomeTransitionObserver = homeTransitionObserver;
mSplitScreenOptional = splitScreenOptional;
}
@@ -196,6 +200,9 @@ public class PipTransition extends PipTransitionController {
animator.cancel();
}
mExitTransition = mTransitions.startTransition(type, out, this);
+ if (mPipOrganizer.getOutPipWindowingMode() == WINDOWING_MODE_UNDEFINED) {
+ mHomeTransitionObserver.notifyHomeVisibilityChanged(false /* isVisible */);
+ }
}
@Override
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip2/phone/PipController.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip2/phone/PipController.java
index a12882f56eb7..f5afeea3eaef 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip2/phone/PipController.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip2/phone/PipController.java
@@ -58,9 +58,12 @@ import com.android.wm.shell.common.pip.PipDisplayLayoutState;
import com.android.wm.shell.common.pip.PipUtils;
import com.android.wm.shell.protolog.ShellProtoLogGroup;
import com.android.wm.shell.sysui.ConfigurationChangeListener;
+import com.android.wm.shell.sysui.ShellCommandHandler;
import com.android.wm.shell.sysui.ShellController;
import com.android.wm.shell.sysui.ShellInit;
+import java.io.PrintWriter;
+
/**
* Manages the picture-in-picture (PIP) UI and states for Phones.
*/
@@ -72,6 +75,7 @@ public class PipController implements ConfigurationChangeListener,
private static final String SWIPE_TO_PIP_OVERLAY = "swipe_to_pip_overlay";
private final Context mContext;
+ private final ShellCommandHandler mShellCommandHandler;
private final ShellController mShellController;
private final DisplayController mDisplayController;
private final DisplayInsetsController mDisplayInsetsController;
@@ -111,6 +115,7 @@ public class PipController implements ConfigurationChangeListener,
private PipController(Context context,
ShellInit shellInit,
+ ShellCommandHandler shellCommandHandler,
ShellController shellController,
DisplayController displayController,
DisplayInsetsController displayInsetsController,
@@ -123,6 +128,7 @@ public class PipController implements ConfigurationChangeListener,
PipTransitionState pipTransitionState,
ShellExecutor mainExecutor) {
mContext = context;
+ mShellCommandHandler = shellCommandHandler;
mShellController = shellController;
mDisplayController = displayController;
mDisplayInsetsController = displayInsetsController;
@@ -146,6 +152,7 @@ public class PipController implements ConfigurationChangeListener,
*/
public static PipController create(Context context,
ShellInit shellInit,
+ ShellCommandHandler shellCommandHandler,
ShellController shellController,
DisplayController displayController,
DisplayInsetsController displayInsetsController,
@@ -162,13 +169,14 @@ public class PipController implements ConfigurationChangeListener,
"%s: Device doesn't support Pip feature", TAG);
return null;
}
- return new PipController(context, shellInit, shellController, displayController,
- displayInsetsController, pipBoundsState, pipBoundsAlgorithm, pipDisplayLayoutState,
- pipScheduler, taskStackListener, shellTaskOrganizer, pipTransitionState,
- mainExecutor);
+ return new PipController(context, shellInit, shellCommandHandler, shellController,
+ displayController, displayInsetsController, pipBoundsState, pipBoundsAlgorithm,
+ pipDisplayLayoutState, pipScheduler, taskStackListener, shellTaskOrganizer,
+ pipTransitionState, mainExecutor);
}
private void onInit() {
+ mShellCommandHandler.addDumpCallback(this::dump, this);
// Ensure that we have the display info in case we get calls to update the bounds before the
// listener calls back
mPipDisplayLayoutState.setDisplayId(mContext.getDisplayId());
@@ -338,6 +346,14 @@ public class PipController implements ConfigurationChangeListener,
}
}
+ private void dump(PrintWriter pw, String prefix) {
+ final String innerPrefix = " ";
+ pw.println(TAG);
+ mPipBoundsAlgorithm.dump(pw, innerPrefix);
+ mPipBoundsState.dump(pw, innerPrefix);
+ mPipDisplayLayoutState.dump(pw, innerPrefix);
+ }
+
/**
* The interface for calls from outside the host process.
*/
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 be10151ca5aa..aed493f2bc8f 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
@@ -696,6 +696,19 @@ public class PipMotionHelper implements PipAppOpsListener.Callback,
case PipTransitionState.SCHEDULED_BOUNDS_CHANGE:
if (!extra.getBoolean(FLING_BOUNDS_CHANGE)) break;
+ if (mPipBoundsState.getBounds().equals(
+ mPipBoundsState.getMotionBoundsState().getBoundsInMotion())) {
+ // Avoid scheduling transitions for bounds that don't change, such transition is
+ // a no-op and would be aborted.
+ settlePipBoundsAfterPhysicsAnimation(false /* animatingAfter */);
+ cleanUpHighPerfSessionMaybe();
+ // SCHEDULED_BOUNDS_CHANGE can have multiple active listeners making
+ // actual changes (e.g. PipTouchHandler). So post state update onto handler,
+ // to run after synchronous dispatch is complete.
+ mPipTransitionState.postState(PipTransitionState.CHANGED_PIP_BOUNDS);
+ break;
+ }
+
// If touch is turned off and we are in a fling animation, schedule a transition.
mWaitingForBoundsChangeTransition = true;
mPipScheduler.scheduleAnimateResizePip(
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip2/phone/PipResizeGestureHandler.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip2/phone/PipResizeGestureHandler.java
index b55a41d8808f..7dffe543ec9c 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip2/phone/PipResizeGestureHandler.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip2/phone/PipResizeGestureHandler.java
@@ -514,6 +514,20 @@ public class PipResizeGestureHandler implements
switch (newState) {
case PipTransitionState.SCHEDULED_BOUNDS_CHANGE:
if (!extra.getBoolean(RESIZE_BOUNDS_CHANGE)) break;
+
+ if (mPipBoundsState.getBounds().equals(mLastResizeBounds)) {
+ // If the bounds are invariant move the destination bounds by a single pixel
+ // to top/bottom to avoid a no-op transition. This trick helps keep the
+ // animation a part of the transition.
+ float snapFraction = mPipBoundsAlgorithm.getSnapFraction(
+ mPipBoundsState.getBounds());
+
+ // Move to the top if closer to the bottom edge and vice versa.
+ boolean inTopHalf = snapFraction < 1.5 || snapFraction > 3.5;
+ int offsetY = inTopHalf ? 1 : -1;
+ mLastResizeBounds.offset(0 /* dx */, offsetY);
+ }
+
mWaitingForBoundsChangeTransition = true;
mPipScheduler.scheduleAnimateResizePip(mLastResizeBounds);
break;
@@ -527,17 +541,14 @@ public class PipResizeGestureHandler implements
PipTransition.PIP_START_TX, SurfaceControl.Transaction.class);
Rect destinationBounds = extra.getParcelable(
PipTransition.PIP_DESTINATION_BOUNDS, Rect.class);
- startTx.setPosition(mPipTransitionState.mPinnedTaskLeash,
- destinationBounds.left, destinationBounds.top);
startTx.apply();
// All motion operations have actually finished, so make bounds cache updates.
+ mUpdateResizeBoundsCallback.accept(destinationBounds);
cleanUpHighPerfSessionMaybe();
// Setting state to CHANGED_PIP_BOUNDS applies finishTx and notifies Core.
mPipTransitionState.setState(PipTransitionState.CHANGED_PIP_BOUNDS);
-
- mUpdateResizeBoundsCallback.accept(destinationBounds);
break;
}
}
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 319d1999a272..56a465a4889a 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
@@ -64,6 +64,7 @@ import com.android.wm.shell.common.pip.PipUtils;
import com.android.wm.shell.common.pip.SizeSpecSource;
import com.android.wm.shell.pip.PipAnimationController;
import com.android.wm.shell.pip.PipTransitionController;
+import com.android.wm.shell.sysui.ShellCommandHandler;
import com.android.wm.shell.sysui.ShellInit;
import java.io.PrintWriter;
@@ -81,6 +82,7 @@ public class PipTouchHandler implements PipTransitionState.PipTransitionStateCha
// Allow PIP to resize to a slightly bigger state upon touch
private boolean mEnableResize;
private final Context mContext;
+ private final ShellCommandHandler mShellCommandHandler;
private final PipBoundsAlgorithm mPipBoundsAlgorithm;
@NonNull private final PipBoundsState mPipBoundsState;
@NonNull private final PipTransitionState mPipTransitionState;
@@ -170,6 +172,7 @@ public class PipTouchHandler implements PipTransitionState.PipTransitionStateCha
@SuppressLint("InflateParams")
public PipTouchHandler(Context context,
ShellInit shellInit,
+ ShellCommandHandler shellCommandHandler,
PhonePipMenuController menuController,
PipBoundsAlgorithm pipBoundsAlgorithm,
@NonNull PipBoundsState pipBoundsState,
@@ -182,6 +185,7 @@ public class PipTouchHandler implements PipTransitionState.PipTransitionStateCha
ShellExecutor mainExecutor,
Optional<PipPerfHintController> pipPerfHintControllerOptional) {
mContext = context;
+ mShellCommandHandler = shellCommandHandler;
mMainExecutor = mainExecutor;
mPipPerfHintController = pipPerfHintControllerOptional.orElse(null);
mAccessibilityManager = context.getSystemService(AccessibilityManager.class);
@@ -235,6 +239,7 @@ public class PipTouchHandler implements PipTransitionState.PipTransitionStateCha
mEnableResize = res.getBoolean(R.bool.config_pipEnableResizeForMenu);
reloadResources();
+ mShellCommandHandler.addDumpCallback(this::dump, this);
mMotionHelper.init();
mPipResizeGestureHandler.init();
mPipDismissTargetHandler.init();
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip2/phone/PipTransitionState.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip2/phone/PipTransitionState.java
index 8204d41a9833..9d599caf13dd 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip2/phone/PipTransitionState.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip2/phone/PipTransitionState.java
@@ -19,6 +19,7 @@ package com.android.wm.shell.pip2.phone;
import android.annotation.IntDef;
import android.graphics.Rect;
import android.os.Bundle;
+import android.os.Handler;
import android.view.SurfaceControl;
import android.window.WindowContainerToken;
@@ -26,6 +27,7 @@ import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.android.internal.util.Preconditions;
+import com.android.wm.shell.shared.annotations.ShellMainThread;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@@ -109,6 +111,13 @@ public class PipTransitionState {
private int mState;
//
+ // Dependencies
+ //
+
+ @ShellMainThread
+ private final Handler mMainHandler;
+
+ //
// Swipe up to enter PiP related state
//
@@ -149,6 +158,10 @@ public class PipTransitionState {
private final List<PipTransitionStateChangedListener> mCallbacks = new ArrayList<>();
+ public PipTransitionState(@ShellMainThread Handler handler) {
+ mMainHandler = handler;
+ }
+
/**
* @return the state of PiP in the context of transitions.
*/
@@ -182,6 +195,32 @@ public class PipTransitionState {
}
}
+ /**
+ * Posts the state update for PiP in the context of transitions onto the main handler.
+ *
+ * <p>This is done to guarantee that any callback dispatches for the present state are
+ * complete. This is relevant for states that have multiple listeners, such as
+ * <code>SCHEDULED_BOUNDS_CHANGE</code> that helps turn off touch interactions along with
+ * the actual transition scheduling.</p>
+ */
+ public void postState(@TransitionState int state) {
+ postState(state, null /* extra */);
+ }
+
+ /**
+ * Posts the state update for PiP in the context of transitions onto the main handler.
+ *
+ * <p>This is done to guarantee that any callback dispatches for the present state are
+ * complete. This is relevant for states that have multiple listeners, such as
+ * <code>SCHEDULED_BOUNDS_CHANGE</code> that helps turn off touch interactions along with
+ * the actual transition scheduling.</p>
+ *
+ * @param extra a bundle passed to the subscribed listeners to resolve/cache extra info.
+ */
+ public void postState(@TransitionState int state, @Nullable Bundle extra) {
+ mMainHandler.post(() -> setState(state, extra));
+ }
+
private void dispatchPipTransitionStateChanged(@TransitionState int oldState,
@TransitionState int newState, @Nullable Bundle extra) {
mCallbacks.forEach(l -> l.onPipTransitionStateChanged(oldState, newState, extra));
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/SplitScreenTransitions.java b/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/SplitScreenTransitions.java
index 6e5b7673e206..0541a0287179 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/SplitScreenTransitions.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/SplitScreenTransitions.java
@@ -501,10 +501,11 @@ class SplitScreenTransitions {
mAnimatingTransition = null;
mOnFinish.run();
- if (mFinishCallback != null) {
- mFinishCallback.onTransitionFinished(wct /* wct */);
- mFinishCallback = null;
- }
+ if (mFinishCallback != null) {
+ Transitions.TransitionFinishCallback currentFinishCallback = mFinishCallback;
+ mFinishCallback = null;
+ currentFinishCallback.onTransitionFinished(wct /* wct */);
+ }
}
private void startFadeAnimation(@NonNull SurfaceControl leash, boolean show) {
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageCoordinator.java b/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageCoordinator.java
index 8e97068dce84..9f8cb625fe17 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageCoordinator.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageCoordinator.java
@@ -16,10 +16,8 @@
package com.android.wm.shell.splitscreen;
-import static android.app.ActivityOptions.KEY_LAUNCH_ROOT_TASK_TOKEN;
+import static android.app.ActivityOptions.MODE_BACKGROUND_ACTIVITY_START_ALLOWED;
import static android.app.ActivityTaskManager.INVALID_TASK_ID;
-import static android.app.ComponentOptions.KEY_PENDING_INTENT_BACKGROUND_ACTIVITY_ALLOWED;
-import static android.app.ComponentOptions.KEY_PENDING_INTENT_BACKGROUND_ACTIVITY_ALLOWED_BY_PERMISSION;
import static android.app.WindowConfiguration.ACTIVITY_TYPE_HOME;
import static android.app.WindowConfiguration.ACTIVITY_TYPE_RECENTS;
import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
@@ -43,11 +41,11 @@ import static com.android.wm.shell.common.split.SplitScreenConstants.SPLIT_POSIT
import static com.android.wm.shell.common.split.SplitScreenConstants.SPLIT_POSITION_TOP_OR_LEFT;
import static com.android.wm.shell.common.split.SplitScreenConstants.SPLIT_POSITION_UNDEFINED;
import static com.android.wm.shell.common.split.SplitScreenConstants.splitPositionToString;
+import static com.android.wm.shell.common.split.SplitScreenUtils.getResizingBackgroundColor;
import static com.android.wm.shell.common.split.SplitScreenUtils.reverseSplitPosition;
import static com.android.wm.shell.common.split.SplitScreenUtils.splitFailureMessage;
import static com.android.wm.shell.protolog.ShellProtoLogGroup.WM_SHELL_SPLIT_SCREEN;
import static com.android.wm.shell.shared.TransitionUtil.isClosingType;
-import static com.android.wm.shell.shared.TransitionUtil.isOpeningMode;
import static com.android.wm.shell.shared.TransitionUtil.isOpeningType;
import static com.android.wm.shell.splitscreen.SplitScreen.STAGE_TYPE_MAIN;
import static com.android.wm.shell.splitscreen.SplitScreen.STAGE_TYPE_SIDE;
@@ -1887,13 +1885,15 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler,
}
private void addActivityOptions(Bundle opts, @Nullable StageTaskListener launchTarget) {
+ ActivityOptions options = ActivityOptions.fromBundle(opts);
if (launchTarget != null) {
- opts.putParcelable(KEY_LAUNCH_ROOT_TASK_TOKEN, launchTarget.mRootTaskInfo.token);
+ options.setLaunchRootTask(launchTarget.mRootTaskInfo.token);
}
// Put BAL flags to avoid activity start aborted. Otherwise, flows like shortcut to split
// will be canceled.
- opts.putBoolean(KEY_PENDING_INTENT_BACKGROUND_ACTIVITY_ALLOWED, true);
- opts.putBoolean(KEY_PENDING_INTENT_BACKGROUND_ACTIVITY_ALLOWED_BY_PERMISSION, true);
+ options.setPendingIntentBackgroundActivityStartMode(MODE_BACKGROUND_ACTIVITY_START_ALLOWED);
+ options.setPendingIntentBackgroundActivityLaunchAllowedByPermission(true);
+ opts.putAll(options.toBundle());
}
void updateActivityOptions(Bundle opts, @SplitPosition int position) {
@@ -2388,14 +2388,20 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler,
}
@Override
- public void onLayoutSizeChanging(SplitLayout layout, int offsetX, int offsetY) {
+ public void onLayoutSizeChanging(SplitLayout layout, int offsetX, int offsetY,
+ boolean shouldUseParallaxEffect) {
final SurfaceControl.Transaction t = mTransactionPool.acquire();
t.setFrameTimelineVsync(Choreographer.getInstance().getVsyncId());
- updateSurfaceBounds(layout, t, true /* applyResizingOffset */);
+ updateSurfaceBounds(layout, t, shouldUseParallaxEffect);
getMainStageBounds(mTempRect1);
getSideStageBounds(mTempRect2);
- mMainStage.onResizing(mTempRect1, mTempRect2, t, offsetX, offsetY, mShowDecorImmediately);
- mSideStage.onResizing(mTempRect2, mTempRect1, t, offsetX, offsetY, mShowDecorImmediately);
+ // TODO (b/307490004): "commonColor" below is a temporary fix to ensure the colors on both
+ // sides match. When b/307490004 is fixed, this code can be reverted.
+ float[] commonColor = getResizingBackgroundColor(mSideStage.mRootTaskInfo).getComponents();
+ mMainStage.onResizing(
+ mTempRect1, mTempRect2, t, offsetX, offsetY, mShowDecorImmediately, commonColor);
+ mSideStage.onResizing(
+ mTempRect2, mTempRect1, t, offsetX, offsetY, mShowDecorImmediately, commonColor);
t.apply();
mTransactionPool.release(t);
}
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 f77c80d2ff3b..0f3d6cade95a 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
@@ -314,10 +314,10 @@ class StageTaskListener implements ShellTaskOrganizer.TaskListener {
}
void onResizing(Rect newBounds, Rect sideBounds, SurfaceControl.Transaction t, int offsetX,
- int offsetY, boolean immediately) {
+ int offsetY, boolean immediately, float[] veilColor) {
if (mSplitDecorManager != null && mRootTaskInfo != null) {
mSplitDecorManager.onResizing(mRootTaskInfo, newBounds, sideBounds, t, offsetX,
- offsetY, immediately);
+ offsetY, immediately, veilColor);
}
}
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/CaptionWindowDecorViewModel.java b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/CaptionWindowDecorViewModel.java
index e85cb6400000..bfa163cb2860 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/CaptionWindowDecorViewModel.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/CaptionWindowDecorViewModel.java
@@ -63,6 +63,7 @@ public class CaptionWindowDecorViewModel implements WindowDecorViewModel {
private final RootTaskDisplayAreaOrganizer mRootTaskDisplayAreaOrganizer;
private final SyncTransactionQueue mSyncQueue;
private final Transitions mTransitions;
+ private final ResizeHandleSizeRepository mResizeHandleSizeRepository;
private TaskOperations mTaskOperations;
private final SparseArray<CaptionWindowDecoration> mWindowDecorByTaskId = new SparseArray<>();
@@ -75,7 +76,8 @@ public class CaptionWindowDecorViewModel implements WindowDecorViewModel {
DisplayController displayController,
RootTaskDisplayAreaOrganizer rootTaskDisplayAreaOrganizer,
SyncTransactionQueue syncQueue,
- Transitions transitions) {
+ Transitions transitions,
+ ResizeHandleSizeRepository resizeHandleSizeRepository) {
mContext = context;
mMainHandler = mainHandler;
mMainChoreographer = mainChoreographer;
@@ -84,6 +86,7 @@ public class CaptionWindowDecorViewModel implements WindowDecorViewModel {
mRootTaskDisplayAreaOrganizer = rootTaskDisplayAreaOrganizer;
mSyncQueue = syncQueue;
mTransitions = transitions;
+ mResizeHandleSizeRepository = resizeHandleSizeRepository;
if (!Transitions.ENABLE_SHELL_TRANSITIONS) {
mTaskOperations = new TaskOperations(null, mContext, mSyncQueue);
}
@@ -231,7 +234,8 @@ public class CaptionWindowDecorViewModel implements WindowDecorViewModel {
taskSurface,
mMainHandler,
mMainChoreographer,
- mSyncQueue);
+ mSyncQueue,
+ mResizeHandleSizeRepository);
mWindowDecorByTaskId.put(taskInfo.taskId, windowDecoration);
final FluidResizeTaskPositioner taskPositioner =
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/CaptionWindowDecoration.java b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/CaptionWindowDecoration.java
index 6671391efdeb..8a49a73e0253 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/CaptionWindowDecoration.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/CaptionWindowDecoration.java
@@ -16,11 +16,11 @@
package com.android.wm.shell.windowdecor;
-import static com.android.wm.shell.windowdecor.DragResizeWindowGeometry.getFineResizeCornerSize;
-import static com.android.wm.shell.windowdecor.DragResizeWindowGeometry.getLargeResizeCornerSize;
-import static com.android.wm.shell.windowdecor.DragResizeWindowGeometry.getResizeEdgeHandleSize;
+import static com.android.wm.shell.windowdecor.ResizeHandleSizeRepository.getFineResizeCornerPixels;
+import static com.android.wm.shell.windowdecor.ResizeHandleSizeRepository.getLargeResizeCornerPixels;
import android.annotation.NonNull;
+import android.annotation.Nullable;
import android.app.ActivityManager.RunningTaskInfo;
import android.app.WindowConfiguration;
import android.app.WindowConfiguration.WindowingMode;
@@ -45,6 +45,8 @@ import com.android.wm.shell.common.DisplayController;
import com.android.wm.shell.common.DisplayLayout;
import com.android.wm.shell.common.SyncTransactionQueue;
+import java.util.function.Consumer;
+
/**
* Defines visuals and behaviors of a window decoration of a caption bar and shadows. It works with
* {@link CaptionWindowDecorViewModel}. The caption bar contains a back button, minimize button,
@@ -58,12 +60,28 @@ public class CaptionWindowDecoration extends WindowDecoration<WindowDecorLinearL
private View.OnClickListener mOnCaptionButtonClickListener;
private View.OnTouchListener mOnCaptionTouchListener;
private DragPositioningCallback mDragPositioningCallback;
+ // Listener for handling drag resize events. Will be null if the task cannot be resized.
+ @Nullable
private DragResizeInputListener mDragResizeListener;
private DragDetector mDragDetector;
private RelayoutParams mRelayoutParams = new RelayoutParams();
private final RelayoutResult<WindowDecorLinearLayout> mResult =
new RelayoutResult<>();
+ private final ResizeHandleSizeRepository mResizeHandleSizeRepository;
+ private final Consumer<ResizeHandleSizeRepository> mResizeHandleSizeChangedFunction =
+ (ResizeHandleSizeRepository sizeRepository) -> {
+ if (mDragResizeListener == null) {
+ return;
+ }
+ final Resources res = mResult.mRootView.getResources();
+ mDragResizeListener.setGeometry(
+ new DragResizeWindowGeometry(0 /* taskCornerRadius */,
+ new Size(mResult.mWidth, mResult.mHeight),
+ sizeRepository.getResizeEdgeHandlePixels(res),
+ getFineResizeCornerPixels(res), getLargeResizeCornerPixels(res)),
+ mDragDetector.getTouchSlop());
+ };
CaptionWindowDecoration(
Context context,
@@ -73,13 +91,15 @@ public class CaptionWindowDecoration extends WindowDecoration<WindowDecorLinearL
SurfaceControl taskSurface,
Handler handler,
Choreographer choreographer,
- SyncTransactionQueue syncQueue) {
- super(context, displayController, taskOrganizer, taskInfo, taskSurface,
- taskInfo.getConfiguration());
+ SyncTransactionQueue syncQueue,
+ ResizeHandleSizeRepository resizeHandleSizeRepository) {
+ super(context, displayController, taskOrganizer, taskInfo, taskSurface);
mHandler = handler;
mChoreographer = choreographer;
mSyncQueue = syncQueue;
+ mResizeHandleSizeRepository = resizeHandleSizeRepository;
+ mResizeHandleSizeRepository.registerSizeChangeFunction(mResizeHandleSizeChangedFunction);
}
void setCaptionListeners(
@@ -238,10 +258,7 @@ public class CaptionWindowDecoration extends WindowDecoration<WindowDecorLinearL
.getScaledTouchSlop();
mDragDetector.setTouchSlop(touchSlop);
- final Resources res = mResult.mRootView.getResources();
- mDragResizeListener.setGeometry(new DragResizeWindowGeometry(0 /* taskCornerRadius */,
- new Size(mResult.mWidth, mResult.mHeight), getResizeEdgeHandleSize(res),
- getFineResizeCornerSize(res), getLargeResizeCornerSize(res)), touchSlop);
+ mResizeHandleSizeChangedFunction.accept(mResizeHandleSizeRepository);
}
/**
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecorViewModel.java b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecorViewModel.java
index 9afb057ffbe5..10ab13a74042 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecorViewModel.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecorViewModel.java
@@ -149,6 +149,7 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel {
new DesktopModeKeyguardChangeListener();
private final RootTaskDisplayAreaOrganizer mRootTaskDisplayAreaOrganizer;
private final DisplayInsetsController mDisplayInsetsController;
+ private final ResizeHandleSizeRepository mResizeHandleSizeRepository;
private final Region mExclusionRegion = Region.obtain();
private boolean mInImmersiveMode;
@@ -181,7 +182,8 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel {
SyncTransactionQueue syncQueue,
Transitions transitions,
Optional<DesktopTasksController> desktopTasksController,
- RootTaskDisplayAreaOrganizer rootTaskDisplayAreaOrganizer
+ RootTaskDisplayAreaOrganizer rootTaskDisplayAreaOrganizer,
+ ResizeHandleSizeRepository resizeHandleSizeRepository
) {
this(
context,
@@ -202,7 +204,8 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel {
new InputMonitorFactory(),
SurfaceControl.Transaction::new,
rootTaskDisplayAreaOrganizer,
- new SparseArray<>());
+ new SparseArray<>(),
+ resizeHandleSizeRepository);
}
@VisibleForTesting
@@ -225,7 +228,8 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel {
InputMonitorFactory inputMonitorFactory,
Supplier<SurfaceControl.Transaction> transactionFactory,
RootTaskDisplayAreaOrganizer rootTaskDisplayAreaOrganizer,
- SparseArray<DesktopModeWindowDecoration> windowDecorByTaskId) {
+ SparseArray<DesktopModeWindowDecoration> windowDecorByTaskId,
+ ResizeHandleSizeRepository resizeHandleSizeRepository) {
mContext = context;
mMainExecutor = shellExecutor;
mMainHandler = mainHandler;
@@ -246,6 +250,7 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel {
mRootTaskDisplayAreaOrganizer = rootTaskDisplayAreaOrganizer;
mInputManager = mContext.getSystemService(InputManager.class);
mWindowDecorByTaskId = windowDecorByTaskId;
+ mResizeHandleSizeRepository = resizeHandleSizeRepository;
shellInit.addInitCallback(this::onInit, this);
}
@@ -1060,7 +1065,8 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel {
mMainHandler,
mMainChoreographer,
mSyncQueue,
- mRootTaskDisplayAreaOrganizer);
+ mRootTaskDisplayAreaOrganizer,
+ mResizeHandleSizeRepository);
mWindowDecorByTaskId.put(taskInfo.taskId, windowDecoration);
final DragPositioningCallback dragPositioningCallback;
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 4d4dc3c72420..9c92791f255f 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
@@ -24,11 +24,11 @@ import static android.view.MotionEvent.ACTION_DOWN;
import static android.view.MotionEvent.ACTION_UP;
import static com.android.launcher3.icons.BaseIconFactory.MODE_DEFAULT;
-import static com.android.wm.shell.windowdecor.DragResizeWindowGeometry.getFineResizeCornerSize;
-import static com.android.wm.shell.windowdecor.DragResizeWindowGeometry.getLargeResizeCornerSize;
-import static com.android.wm.shell.windowdecor.DragResizeWindowGeometry.getResizeEdgeHandleSize;
+import static com.android.wm.shell.windowdecor.ResizeHandleSizeRepository.getFineResizeCornerPixels;
+import static com.android.wm.shell.windowdecor.ResizeHandleSizeRepository.getLargeResizeCornerPixels;
import android.annotation.NonNull;
+import android.annotation.Nullable;
import android.app.ActivityManager;
import android.app.WindowConfiguration.WindowingMode;
import android.content.Context;
@@ -60,13 +60,13 @@ import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.policy.ScreenDecorationsUtils;
import com.android.launcher3.icons.BaseIconFactory;
import com.android.launcher3.icons.IconProvider;
+import com.android.window.flags.Flags;
import com.android.wm.shell.R;
import com.android.wm.shell.RootTaskDisplayAreaOrganizer;
import com.android.wm.shell.ShellTaskOrganizer;
import com.android.wm.shell.common.DisplayController;
import com.android.wm.shell.common.DisplayLayout;
import com.android.wm.shell.common.SyncTransactionQueue;
-import com.android.wm.shell.desktopmode.DesktopTasksController;
import com.android.wm.shell.shared.DesktopModeStatus;
import com.android.wm.shell.windowdecor.extension.TaskInfoKt;
import com.android.wm.shell.windowdecor.viewholder.DesktopModeAppControlsWindowDecorationViewHolder;
@@ -75,6 +75,7 @@ import com.android.wm.shell.windowdecor.viewholder.DesktopModeWindowDecorationVi
import kotlin.Unit;
+import java.util.function.Function;
import java.util.function.Supplier;
/**
@@ -96,6 +97,8 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin
private View.OnLongClickListener mOnCaptionLongClickListener;
private View.OnGenericMotionListener mOnCaptionGenericMotionListener;
private DragPositioningCallback mDragPositioningCallback;
+ // Listener for handling drag resize events. Will be null if the task cannot be resized.
+ @Nullable
private DragResizeInputListener mDragResizeListener;
private DragDetector mDragDetector;
@@ -118,22 +121,35 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin
private final RootTaskDisplayAreaOrganizer mRootTaskDisplayAreaOrganizer;
+ private final ResizeHandleSizeRepository mResizeHandleSizeRepository;
+ private final Function<ResizeHandleSizeRepository, Boolean> mResizeHandleSizeChangedFunction =
+ (ResizeHandleSizeRepository sizeRepository) -> {
+ final Resources res = mResult.mRootView.getResources();
+ return mDragResizeListener == null || mDragResizeListener.setGeometry(
+ new DragResizeWindowGeometry(mRelayoutParams.mCornerRadius,
+ new Size(mResult.mWidth, mResult.mHeight),
+ sizeRepository.getResizeEdgeHandlePixels(res),
+ getFineResizeCornerPixels(res),
+ getLargeResizeCornerPixels(res)),
+ mDragDetector.getTouchSlop());
+ };
+
DesktopModeWindowDecoration(
Context context,
DisplayController displayController,
ShellTaskOrganizer taskOrganizer,
ActivityManager.RunningTaskInfo taskInfo,
SurfaceControl taskSurface,
- Configuration windowDecorConfig,
Handler handler,
Choreographer choreographer,
SyncTransactionQueue syncQueue,
- RootTaskDisplayAreaOrganizer rootTaskDisplayAreaOrganizer) {
- this (context, displayController, taskOrganizer, taskInfo, taskSurface, windowDecorConfig,
+ RootTaskDisplayAreaOrganizer rootTaskDisplayAreaOrganizer,
+ ResizeHandleSizeRepository resizeHandleSizeRepository) {
+ this (context, displayController, taskOrganizer, taskInfo, taskSurface,
handler, choreographer, syncQueue, rootTaskDisplayAreaOrganizer,
- SurfaceControl.Builder::new, SurfaceControl.Transaction::new,
- WindowContainerTransaction::new, SurfaceControl::new,
- new SurfaceControlViewHostFactory() {});
+ resizeHandleSizeRepository, SurfaceControl.Builder::new,
+ SurfaceControl.Transaction::new, WindowContainerTransaction::new,
+ SurfaceControl::new, new SurfaceControlViewHostFactory() {});
}
DesktopModeWindowDecoration(
@@ -142,17 +158,17 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin
ShellTaskOrganizer taskOrganizer,
ActivityManager.RunningTaskInfo taskInfo,
SurfaceControl taskSurface,
- Configuration windowDecorConfig,
Handler handler,
Choreographer choreographer,
SyncTransactionQueue syncQueue,
RootTaskDisplayAreaOrganizer rootTaskDisplayAreaOrganizer,
+ ResizeHandleSizeRepository resizeHandleSizeRepository,
Supplier<SurfaceControl.Builder> surfaceControlBuilderSupplier,
Supplier<SurfaceControl.Transaction> surfaceControlTransactionSupplier,
Supplier<WindowContainerTransaction> windowContainerTransactionSupplier,
Supplier<SurfaceControl> surfaceControlSupplier,
SurfaceControlViewHostFactory surfaceControlViewHostFactory) {
- super(context, displayController, taskOrganizer, taskInfo, taskSurface, windowDecorConfig,
+ super(context, displayController, taskOrganizer, taskInfo, taskSurface,
surfaceControlBuilderSupplier, surfaceControlTransactionSupplier,
windowContainerTransactionSupplier, surfaceControlSupplier,
surfaceControlViewHostFactory);
@@ -160,6 +176,9 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin
mChoreographer = choreographer;
mSyncQueue = syncQueue;
mRootTaskDisplayAreaOrganizer = rootTaskDisplayAreaOrganizer;
+ mResizeHandleSizeRepository = resizeHandleSizeRepository;
+ mResizeHandleSizeRepository.registerSizeChangeFunction(
+ mResizeHandleSizeChangedFunction::apply);
}
void setCaptionListeners(
@@ -305,11 +324,7 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin
// If either task geometry or position have changed, update this task's
// exclusion region listener
- final Resources res = mResult.mRootView.getResources();
- if (mDragResizeListener.setGeometry(
- new DragResizeWindowGeometry(mRelayoutParams.mCornerRadius,
- new Size(mResult.mWidth, mResult.mHeight), getResizeEdgeHandleSize(res),
- getFineResizeCornerSize(res), getLargeResizeCornerSize(res)), touchSlop)
+ if (mResizeHandleSizeChangedFunction.apply(mResizeHandleSizeRepository)
|| !mTaskInfo.positionInParent.equals(mPositionInParent)) {
updateExclusionRegion();
}
@@ -332,13 +347,16 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin
boolean applyStartTransactionOnDraw,
boolean shouldSetTaskPositionAndCrop) {
final int captionLayoutId = getDesktopModeWindowDecorLayoutId(taskInfo.getWindowingMode());
+ final boolean isAppHeader =
+ captionLayoutId == R.layout.desktop_mode_app_controls_window_decor;
+ final boolean isAppHandle = captionLayoutId == R.layout.desktop_mode_focused_window_decor;
relayoutParams.reset();
relayoutParams.mRunningTaskInfo = taskInfo;
relayoutParams.mLayoutResId = captionLayoutId;
relayoutParams.mCaptionHeightId = getCaptionHeightIdStatic(taskInfo.getWindowingMode());
relayoutParams.mCaptionWidthId = getCaptionWidthId(relayoutParams.mLayoutResId);
- if (captionLayoutId == R.layout.desktop_mode_app_controls_window_decor) {
+ if (isAppHeader) {
if (TaskInfoKt.isTransparentCaptionBarAppearance(taskInfo)) {
// If the app is requesting to customize the caption bar, allow input to fall
// through to the windows below so that the app can respond to input events on
@@ -359,7 +377,7 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin
controlsElement.mWidthResId = R.dimen.desktop_mode_customizable_caption_margin_end;
controlsElement.mAlignment = RelayoutParams.OccludingCaptionElement.Alignment.END;
relayoutParams.mOccludingCaptionElements.add(controlsElement);
- } else if (captionLayoutId == R.layout.desktop_mode_focused_window_decor) {
+ } else if (isAppHandle) {
// The focused decor (fullscreen/split) does not need to handle input because input in
// the App Handle is handled by the InputMonitor in DesktopModeWindowDecorViewModel.
relayoutParams.mInputFeatures
@@ -372,19 +390,25 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin
}
relayoutParams.mApplyStartTransactionOnDraw = applyStartTransactionOnDraw;
relayoutParams.mSetTaskPositionAndCrop = shouldSetTaskPositionAndCrop;
- // The configuration used to lay out the window decoration. The system context's config is
- // used when the task density has been overridden to a custom density so that the resources
- // and views of the decoration aren't affected and match the rest of the System UI, if not
- // then just use the task's configuration. A copy is made instead of using the original
- // reference so that the configuration isn't mutated on config changes and diff checks can
- // be made in WindowDecoration#relayout using the pre/post-relayout configuration.
- // See b/301119301.
+
+ // The configuration used to layout the window decoration. A copy is made instead of using
+ // the original reference so that the configuration isn't mutated on config changes and
+ // diff checks can be made in WindowDecoration#relayout using the pre/post-relayout
+ // configuration. See b/301119301.
// TODO(b/301119301): consider moving the config data needed for diffs to relayout params
// instead of using a whole Configuration as a parameter.
final Configuration windowDecorConfig = new Configuration();
- windowDecorConfig.setTo(DesktopTasksController.isDesktopDensityOverrideSet()
- ? context.getResources().getConfiguration() // Use system context.
- : taskInfo.configuration); // Use task configuration.
+ if (Flags.enableAppHeaderWithTaskDensity() && isAppHeader) {
+ // Should match the density of the task. The task may have had its density overridden
+ // to be different that SysUI's.
+ windowDecorConfig.setTo(taskInfo.configuration);
+ } else if (DesktopModeStatus.isDesktopDensityOverrideSet()) {
+ // The task has had its density overridden, but keep using the system's density to
+ // layout the header.
+ windowDecorConfig.setTo(context.getResources().getConfiguration());
+ } else {
+ windowDecorConfig.setTo(taskInfo.configuration);
+ }
relayoutParams.mWindowDecorConfig = windowDecorConfig;
if (DesktopModeStatus.useRoundedCorners()) {
@@ -936,22 +960,19 @@ public class DesktopModeWindowDecoration extends WindowDecoration<WindowDecorLin
Handler handler,
Choreographer choreographer,
SyncTransactionQueue syncQueue,
- RootTaskDisplayAreaOrganizer rootTaskDisplayAreaOrganizer) {
- final Configuration windowDecorConfig =
- DesktopTasksController.isDesktopDensityOverrideSet()
- ? context.getResources().getConfiguration() // Use system context
- : taskInfo.configuration; // Use task configuration
+ RootTaskDisplayAreaOrganizer rootTaskDisplayAreaOrganizer,
+ ResizeHandleSizeRepository resizeHandleSizeRepository) {
return new DesktopModeWindowDecoration(
context,
displayController,
taskOrganizer,
taskInfo,
taskSurface,
- windowDecorConfig,
handler,
choreographer,
syncQueue,
- rootTaskDisplayAreaOrganizer);
+ rootTaskDisplayAreaOrganizer,
+ resizeHandleSizeRepository);
}
}
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DragDetector.java b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DragDetector.java
index da268988bac7..a3b0a7122752 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DragDetector.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DragDetector.java
@@ -119,6 +119,10 @@ class DragDetector {
mTouchSlop = touchSlop;
}
+ int getTouchSlop() {
+ return mTouchSlop;
+ }
+
private void resetState() {
mIsDragEvent = false;
mInputDownPoint.set(0, 0);
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DragResizeWindowGeometry.java b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DragResizeWindowGeometry.java
index 4f513f0a0fd8..80d60d4fbdd0 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DragResizeWindowGeometry.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DragResizeWindowGeometry.java
@@ -26,7 +26,6 @@ import static com.android.wm.shell.windowdecor.DragPositioningCallback.CTRL_TYPE
import static com.android.wm.shell.windowdecor.DragPositioningCallback.CTRL_TYPE_UNDEFINED;
import android.annotation.NonNull;
-import android.content.res.Resources;
import android.graphics.Point;
import android.graphics.Rect;
import android.graphics.Region;
@@ -36,8 +35,6 @@ import android.view.MotionEvent;
import androidx.annotation.Nullable;
import androidx.annotation.VisibleForTesting;
-import com.android.wm.shell.R;
-
import java.util.Objects;
/**
@@ -63,6 +60,10 @@ final class DragResizeWindowGeometry {
// Extra-large edge bounds for logging to help debug when an edge resize is ignored.
private final @Nullable TaskEdges mDebugTaskEdges;
+ /**
+ * Constructs an instance representing the drag resize touch input regions, where all sizes
+ * are represented in pixels.
+ */
DragResizeWindowGeometry(int taskCornerRadius, @NonNull Size taskSize,
int resizeHandleThickness, int fineCornerSize, int largeCornerSize) {
mTaskCornerRadius = taskCornerRadius;
@@ -82,31 +83,6 @@ final class DragResizeWindowGeometry {
}
/**
- * Returns the resource value to use for the resize handle on the edge of the window.
- */
- static int getResizeEdgeHandleSize(@NonNull Resources res) {
- return enableWindowingEdgeDragResize()
- ? res.getDimensionPixelSize(R.dimen.desktop_mode_edge_handle)
- : res.getDimensionPixelSize(R.dimen.freeform_resize_handle);
- }
-
- /**
- * Returns the resource value to use for course input, such as touch, that benefits from a large
- * square on each of the window's corners.
- */
- static int getLargeResizeCornerSize(@NonNull Resources res) {
- return res.getDimensionPixelSize(R.dimen.desktop_mode_corner_resize_large);
- }
-
- /**
- * Returns the resource value to use for fine input, such as stylus, that can use a smaller
- * square on each of the window's corners.
- */
- static int getFineResizeCornerSize(@NonNull Resources res) {
- return res.getDimensionPixelSize(R.dimen.freeform_resize_corner);
- }
-
- /**
* Returns the size of the task this geometry is calculated for.
*/
@NonNull Size getTaskSize() {
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/ResizeHandleSizeRepository.kt b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/ResizeHandleSizeRepository.kt
new file mode 100644
index 000000000000..be7a301ec4c3
--- /dev/null
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/ResizeHandleSizeRepository.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.wm.shell.windowdecor
+
+import android.content.res.Resources
+import com.android.window.flags.Flags.enableWindowingEdgeDragResize
+import com.android.wm.shell.R
+import com.android.wm.shell.protolog.ShellProtoLogGroup.WM_SHELL_DESKTOP_MODE
+import com.android.wm.shell.util.KtProtoLog
+import java.util.function.Consumer
+
+/** Repository for desktop mode drag resize handle sizes. */
+class ResizeHandleSizeRepository {
+ private val TAG = "ResizeHandleSizeRepository"
+ private var edgeResizeHandleSizePixels: Int? = null
+ private var sizeChangeFunctions: MutableList<Consumer<ResizeHandleSizeRepository>> =
+ mutableListOf()
+
+ /**
+ * Resets the window edge resize handle size if necessary.
+ */
+ fun resetResizeEdgeHandlePixels() {
+ if (enableWindowingEdgeDragResize() && edgeResizeHandleSizePixels != null) {
+ edgeResizeHandleSizePixels = null
+ applyToAll()
+ }
+ }
+
+ /**
+ * Sets the window edge resize handle to the given size in pixels.
+ */
+ fun setResizeEdgeHandlePixels(sizePixels: Int) {
+ if (enableWindowingEdgeDragResize()) {
+ KtProtoLog.d(WM_SHELL_DESKTOP_MODE, "$TAG: Set edge handle size to $sizePixels")
+ if (edgeResizeHandleSizePixels != null && edgeResizeHandleSizePixels == sizePixels) {
+ // Skip updating since override is the same size
+ return
+ }
+ edgeResizeHandleSizePixels = sizePixels
+ applyToAll()
+ } else {
+ KtProtoLog.d(
+ WM_SHELL_DESKTOP_MODE,
+ "$TAG: Can't set edge handle size to $sizePixels since " +
+ "enable_windowing_edge_drag_resize disabled"
+ )
+ }
+ }
+
+ /**
+ * Returns the resource value, in pixels, to use for the resize handle on the edge of the
+ * window.
+ */
+ fun getResizeEdgeHandlePixels(res: Resources): Int {
+ try {
+ return if (enableWindowingEdgeDragResize()) {
+ val resPixelSize = res.getDimensionPixelSize(R.dimen.desktop_mode_edge_handle)
+ val size = edgeResizeHandleSizePixels ?: resPixelSize
+ KtProtoLog.d(
+ WM_SHELL_DESKTOP_MODE,
+ "$TAG: Get edge handle size of $size from (vs base value $resPixelSize)"
+ )
+ size
+ } else {
+ KtProtoLog.d(
+ WM_SHELL_DESKTOP_MODE,
+ "$TAG: Get edge handle size from freeform since flag is disabled"
+ )
+ res.getDimensionPixelSize(R.dimen.freeform_resize_handle)
+ }
+ } catch (e: Resources.NotFoundException) {
+ KtProtoLog.e(WM_SHELL_DESKTOP_MODE, "$TAG: Unable to get edge handle size", e)
+ return 0
+ }
+ }
+
+ /** Register function to run when the resize handle size changes. */
+ fun registerSizeChangeFunction(function: Consumer<ResizeHandleSizeRepository>) {
+ sizeChangeFunctions.add(function)
+ }
+
+ private fun applyToAll() {
+ for (f in sizeChangeFunctions) {
+ f.accept(this)
+ }
+ }
+
+ companion object {
+ private val TAG = "ResizeHandleSizeRepositoryCompanion"
+
+ /**
+ * Returns the resource value in pixels to use for course input, such as touch, that
+ * benefits from a large square on each of the window's corners.
+ */
+ @JvmStatic
+ fun getLargeResizeCornerPixels(res: Resources): Int {
+ return try {
+ res.getDimensionPixelSize(R.dimen.desktop_mode_corner_resize_large)
+ } catch (e: Resources.NotFoundException) {
+ KtProtoLog.e(WM_SHELL_DESKTOP_MODE, "$TAG: Unable to get large corner size", e)
+ 0
+ }
+ }
+
+ /**
+ * Returns the resource value, in pixels, to use for fine input, such as stylus, that can
+ * use a smaller square on each of the window's corners.
+ */
+ @JvmStatic
+ fun getFineResizeCornerPixels(res: Resources): Int {
+ return try {
+ res.getDimensionPixelSize(R.dimen.freeform_resize_corner)
+ } catch (e: Resources.NotFoundException) {
+ KtProtoLog.e(WM_SHELL_DESKTOP_MODE, "$TAG: Unable to get fine corner size", e)
+ 0
+ }
+ }
+ }
+}
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 541825437c86..2cbe47212c63 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
@@ -18,6 +18,7 @@ package com.android.wm.shell.windowdecor;
import static android.app.WindowConfiguration.WINDOWING_MODE_FREEFORM;
import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
+import static android.content.res.Configuration.DENSITY_DPI_UNDEFINED;
import static android.view.WindowInsets.Type.captionBar;
import static android.view.WindowInsets.Type.mandatorySystemGestures;
import static android.view.WindowInsets.Type.statusBars;
@@ -145,9 +146,8 @@ public abstract class WindowDecoration<T extends View & TaskFocusStateConsumer>
DisplayController displayController,
ShellTaskOrganizer taskOrganizer,
RunningTaskInfo taskInfo,
- SurfaceControl taskSurface,
- Configuration windowDecorConfig) {
- this(context, displayController, taskOrganizer, taskInfo, taskSurface, windowDecorConfig,
+ SurfaceControl taskSurface) {
+ this(context, displayController, taskOrganizer, taskInfo, taskSurface,
SurfaceControl.Builder::new, SurfaceControl.Transaction::new,
WindowContainerTransaction::new, SurfaceControl::new,
new SurfaceControlViewHostFactory() {});
@@ -159,7 +159,6 @@ public abstract class WindowDecoration<T extends View & TaskFocusStateConsumer>
ShellTaskOrganizer taskOrganizer,
RunningTaskInfo taskInfo,
@NonNull SurfaceControl taskSurface,
- Configuration windowDecorConfig,
Supplier<SurfaceControl.Builder> surfaceControlBuilderSupplier,
Supplier<SurfaceControl.Transaction> surfaceControlTransactionSupplier,
Supplier<WindowContainerTransaction> windowContainerTransactionSupplier,
@@ -176,8 +175,6 @@ public abstract class WindowDecoration<T extends View & TaskFocusStateConsumer>
mSurfaceControlViewHostFactory = surfaceControlViewHostFactory;
mDisplay = mDisplayController.getDisplay(mTaskInfo.displayId);
- mWindowDecorConfig = windowDecorConfig;
- mDecorWindowContext = mContext.createConfigurationContext(mWindowDecorConfig);
}
/**
@@ -220,8 +217,11 @@ public abstract class WindowDecoration<T extends View & TaskFocusStateConsumer>
outResult.mRootView = rootView;
rootView = null; // Clear it just in case we use it accidentally
- final int oldDensityDpi = mWindowDecorConfig.densityDpi;
- final int oldNightMode = mWindowDecorConfig.uiMode & Configuration.UI_MODE_NIGHT_MASK;
+ final int oldDensityDpi = mWindowDecorConfig != null
+ ? mWindowDecorConfig.densityDpi : DENSITY_DPI_UNDEFINED;
+ final int oldNightMode = mWindowDecorConfig != null
+ ? (mWindowDecorConfig.uiMode & Configuration.UI_MODE_NIGHT_MASK)
+ : Configuration.UI_MODE_NIGHT_UNDEFINED;
mWindowDecorConfig = params.mWindowDecorConfig != null ? params.mWindowDecorConfig
: mTaskInfo.getConfiguration();
final int newDensityDpi = mWindowDecorConfig.densityDpi;
@@ -230,7 +230,8 @@ public abstract class WindowDecoration<T extends View & TaskFocusStateConsumer>
|| mDisplay == null
|| mDisplay.getDisplayId() != mTaskInfo.displayId
|| oldLayoutResId != mLayoutResId
- || oldNightMode != newNightMode) {
+ || oldNightMode != newNightMode
+ || mDecorWindowContext == null) {
releaseViews(wct);
if (!obtainDisplayOrRegisterListener()) {
diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/common/split/SplitLayoutTests.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/common/split/SplitLayoutTests.java
index 8de60b7acc91..cfe8e07aa6e5 100644
--- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/common/split/SplitLayoutTests.java
+++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/common/split/SplitLayoutTests.java
@@ -26,6 +26,7 @@ import static com.android.wm.shell.common.split.SplitScreenConstants.SNAP_TO_STA
import static com.google.common.truth.Truth.assertThat;
import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyBoolean;
import static org.mockito.ArgumentMatchers.anyInt;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.never;
@@ -115,9 +116,9 @@ public class SplitLayoutTests extends ShellTestCase {
@Test
public void testUpdateDivideBounds() {
- mSplitLayout.updateDividerBounds(anyInt());
+ mSplitLayout.updateDividerBounds(anyInt(), anyBoolean());
verify(mSplitLayoutHandler).onLayoutSizeChanging(any(SplitLayout.class), anyInt(),
- anyInt());
+ anyInt(), anyBoolean());
}
@Test
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 f67da5573b7d..d8d534bec6ea 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
@@ -25,6 +25,7 @@ import android.app.WindowConfiguration.WINDOWING_MODE_MULTI_WINDOW
import android.app.WindowConfiguration.WINDOWING_MODE_UNDEFINED
import android.content.Intent
import android.content.pm.ActivityInfo
+import android.content.pm.ActivityInfo.CONFIG_DENSITY
import android.content.pm.ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE
import android.content.pm.ActivityInfo.SCREEN_ORIENTATION_PORTRAIT
import android.content.pm.ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED
@@ -115,6 +116,8 @@ import org.mockito.kotlin.atLeastOnce
import org.mockito.kotlin.capture
import org.mockito.quality.Strictness
import java.util.Optional
+import junit.framework.Assert.assertFalse
+import junit.framework.Assert.assertTrue
import org.mockito.Mockito.`when` as whenever
/**
@@ -1045,17 +1048,6 @@ class DesktopTasksControllerTest : ShellTestCase() {
}
@Test
- fun handleRequest_freeformTask_freeformVisible_returnNull() {
- assumeTrue(ENABLE_SHELL_TRANSITIONS)
-
- val freeformTask1 = setUpFreeformTask()
- markTaskVisible(freeformTask1)
-
- val freeformTask2 = createFreeformTask()
- assertThat(controller.handleRequest(Binder(), createTransition(freeformTask2))).isNull()
- }
-
- @Test
fun handleRequest_freeformTask_freeformVisible_aboveTaskLimit_minimize() {
assumeTrue(ENABLE_SHELL_TRANSITIONS)
@@ -1072,7 +1064,7 @@ class DesktopTasksControllerTest : ShellTestCase() {
}
@Test
- fun handleRequest_freeformTask_freeformNotVisible_returnSwitchToFullscreenWCT() {
+ fun handleRequest_freeformTask_freeformNotVisible_reorderedToTop() {
assumeTrue(ENABLE_SHELL_TRANSITIONS)
val freeformTask1 = setUpFreeformTask()
@@ -1084,30 +1076,60 @@ class DesktopTasksControllerTest : ShellTestCase() {
Binder(),
createTransition(freeformTask2, type = TRANSIT_TO_FRONT)
)
- assertThat(result?.changes?.get(freeformTask2.token.asBinder())?.windowingMode)
- .isEqualTo(WINDOWING_MODE_UNDEFINED) // inherited FULLSCREEN
+
+ assertThat(result?.hierarchyOps?.size).isEqualTo(2)
+ result!!.assertReorderAt(1, freeformTask2, toTop = true)
}
@Test
- fun handleRequest_freeformTask_noOtherTasks_returnSwitchToFullscreenWCT() {
+ fun handleRequest_freeformTask_noOtherTasks_reorderedToTop() {
assumeTrue(ENABLE_SHELL_TRANSITIONS)
val task = createFreeformTask()
val result = controller.handleRequest(Binder(), createTransition(task))
- assertThat(result?.changes?.get(task.token.asBinder())?.windowingMode)
- .isEqualTo(WINDOWING_MODE_UNDEFINED) // inherited FULLSCREEN
+
+ assertThat(result?.hierarchyOps?.size).isEqualTo(1)
+ result!!.assertReorderAt(0, task, toTop = true)
}
@Test
- fun handleRequest_freeformTask_freeformOnOtherDisplayOnly_returnSwitchToFullscreenWCT() {
+ fun handleRequest_freeformTask_freeformOnOtherDisplayOnly_reorderedToTop() {
assumeTrue(ENABLE_SHELL_TRANSITIONS)
val taskDefaultDisplay = createFreeformTask(displayId = DEFAULT_DISPLAY)
- createFreeformTask(displayId = SECOND_DISPLAY)
+ val taskSecondDisplay = createFreeformTask(displayId = SECOND_DISPLAY)
val result = controller.handleRequest(Binder(), createTransition(taskDefaultDisplay))
- assertThat(result?.changes?.get(taskDefaultDisplay.token.asBinder())?.windowingMode)
- .isEqualTo(WINDOWING_MODE_UNDEFINED) // inherited FULLSCREEN
+ assertThat(result?.hierarchyOps?.size).isEqualTo(1)
+ result!!.assertReorderAt(0, taskDefaultDisplay, toTop = true)
+ }
+
+ @Test
+ fun handleRequest_freeformTask_alreadyInDesktop_noOverrideDensity_noConfigDensityChange() {
+ assumeTrue(ENABLE_SHELL_TRANSITIONS)
+ whenever(DesktopModeStatus.isDesktopDensityOverrideSet()).thenReturn(false)
+
+ val freeformTask1 = setUpFreeformTask()
+ markTaskVisible(freeformTask1)
+
+ val freeformTask2 = createFreeformTask()
+ val result = controller.handleRequest(freeformTask2.token.asBinder(),
+ createTransition(freeformTask2))
+ assertFalse(result.anyDensityConfigChange(freeformTask2.token))
+ }
+
+ @Test
+ fun handleRequest_freeformTask_alreadyInDesktop_overrideDensity_hasConfigDensityChange() {
+ assumeTrue(ENABLE_SHELL_TRANSITIONS)
+ whenever(DesktopModeStatus.isDesktopDensityOverrideSet()).thenReturn(true)
+
+ val freeformTask1 = setUpFreeformTask()
+ markTaskVisible(freeformTask1)
+
+ val freeformTask2 = createFreeformTask()
+ val result = controller.handleRequest(freeformTask2.token.asBinder(),
+ createTransition(freeformTask2))
+ assertTrue(result.anyDensityConfigChange(freeformTask2.token))
}
@Test
@@ -1811,3 +1833,11 @@ private fun WindowContainerTransaction.assertPendingIntentAt(index: Int, intent:
assertThat(op.type).isEqualTo(HIERARCHY_OP_TYPE_PENDING_INTENT)
assertThat(op.pendingIntent?.intent?.component).isEqualTo(intent.component)
}
+
+private fun WindowContainerTransaction?.anyDensityConfigChange(
+ token: WindowContainerToken
+): Boolean {
+ return this?.changes?.any { change ->
+ change.key == token.asBinder() && ((change.value.configSetMask and CONFIG_DENSITY) != 0)
+ } ?: false
+}
diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/pip2/PipTransitionStateTest.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/pip2/PipTransitionStateTest.java
index bd8ac379b86f..f3f3c37b645d 100644
--- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/pip2/PipTransitionStateTest.java
+++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/pip2/PipTransitionStateTest.java
@@ -17,6 +17,7 @@
package com.android.wm.shell.pip2;
import android.os.Bundle;
+import android.os.Handler;
import android.os.Parcelable;
import android.testing.AndroidTestingRunner;
@@ -29,6 +30,7 @@ import junit.framework.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
+import org.mockito.Mock;
/**
* Unit test against {@link PhoneSizeSpecSource}.
@@ -42,9 +44,12 @@ public class PipTransitionStateTest extends ShellTestCase {
private PipTransitionState.PipTransitionStateChangedListener mStateChangedListener;
private Parcelable mEmptyParcelable;
+ @Mock
+ private Handler mMainHandler;
+
@Before
public void setUp() {
- mPipTransitionState = new PipTransitionState();
+ mPipTransitionState = new PipTransitionState(mMainHandler);
mPipTransitionState.setState(PipTransitionState.UNDEFINED);
mEmptyParcelable = new Bundle();
}
diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/splitscreen/StageCoordinatorTests.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/splitscreen/StageCoordinatorTests.java
index d7c383523a6f..d18fec2f24ad 100644
--- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/splitscreen/StageCoordinatorTests.java
+++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/splitscreen/StageCoordinatorTests.java
@@ -16,10 +16,7 @@
package com.android.wm.shell.splitscreen;
-import static android.app.ActivityOptions.KEY_LAUNCH_ROOT_TASK_TOKEN;
import static android.app.ActivityTaskManager.INVALID_TASK_ID;
-import static android.app.ComponentOptions.KEY_PENDING_INTENT_BACKGROUND_ACTIVITY_ALLOWED;
-import static android.app.ComponentOptions.KEY_PENDING_INTENT_BACKGROUND_ACTIVITY_ALLOWED_BY_PERMISSION;
import static android.view.Display.DEFAULT_DISPLAY;
import static com.android.wm.shell.common.split.SplitScreenConstants.SPLIT_POSITION_BOTTOM_OR_RIGHT;
@@ -31,8 +28,9 @@ import static com.android.wm.shell.splitscreen.SplitScreen.STAGE_TYPE_UNDEFINED;
import static com.android.wm.shell.splitscreen.SplitScreenController.EXIT_REASON_RETURN_HOME;
import static com.android.wm.shell.transition.Transitions.TRANSIT_SPLIT_DISMISS;
+import static com.google.common.truth.Truth.assertThat;
+
import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.ArgumentMatchers.notNull;
@@ -45,6 +43,7 @@ import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import android.app.ActivityManager;
+import android.app.ActivityOptions;
import android.app.PendingIntent;
import android.content.res.Configuration;
import android.graphics.Rect;
@@ -54,7 +53,6 @@ import android.os.Looper;
import android.view.SurfaceControl;
import android.view.SurfaceSession;
import android.window.RemoteTransition;
-import android.window.WindowContainerToken;
import android.window.WindowContainerTransaction;
import androidx.test.annotation.UiThreadTest;
@@ -343,14 +341,14 @@ public class StageCoordinatorTests extends ShellTestCase {
@Test
public void testAddActivityOptions_addsBackgroundActivitiesFlags() {
- Bundle options = mStageCoordinator.resolveStartStage(STAGE_TYPE_MAIN,
+ Bundle bundle = mStageCoordinator.resolveStartStage(STAGE_TYPE_MAIN,
SPLIT_POSITION_UNDEFINED, null /* options */, null /* wct */);
+ ActivityOptions options = ActivityOptions.fromBundle(bundle);
- assertEquals(options.getParcelable(KEY_LAUNCH_ROOT_TASK_TOKEN, WindowContainerToken.class),
- mMainStage.mRootTaskInfo.token);
- assertTrue(options.getBoolean(KEY_PENDING_INTENT_BACKGROUND_ACTIVITY_ALLOWED));
- assertTrue(options.getBoolean(
- KEY_PENDING_INTENT_BACKGROUND_ACTIVITY_ALLOWED_BY_PERMISSION));
+ assertThat(options.getLaunchRootTask()).isEqualTo(mMainStage.mRootTaskInfo.token);
+ assertThat(options.getPendingIntentBackgroundActivityStartMode())
+ .isEqualTo(ActivityOptions.MODE_BACKGROUND_ACTIVITY_START_ALLOWED);
+ assertThat(options.isPendingIntentBackgroundActivityLaunchAllowedByPermission()).isTrue();
}
@Test
diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecorViewModelTests.kt b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecorViewModelTests.kt
index aa2cee79fcfc..282495de0fc1 100644
--- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecorViewModelTests.kt
+++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/DesktopModeWindowDecorViewModelTests.kt
@@ -121,6 +121,7 @@ class DesktopModeWindowDecorViewModelTests : ShellTestCase() {
@Mock private lateinit var mockShellController: ShellController
@Mock private lateinit var mockShellExecutor: ShellExecutor
@Mock private lateinit var mockRootTaskDisplayAreaOrganizer: RootTaskDisplayAreaOrganizer
+ @Mock private lateinit var mockResizeHandleSizeRepository: ResizeHandleSizeRepository
@Mock private lateinit var mockShellCommandHandler: ShellCommandHandler
@Mock private lateinit var mockWindowManager: IWindowManager
@@ -156,7 +157,8 @@ class DesktopModeWindowDecorViewModelTests : ShellTestCase() {
mockInputMonitorFactory,
transactionFactory,
mockRootTaskDisplayAreaOrganizer,
- windowDecorByTaskIdSpy
+ windowDecorByTaskIdSpy,
+ mockResizeHandleSizeRepository
)
whenever(mockDisplayController.getDisplayLayout(any())).thenReturn(mockDisplayLayout)
@@ -197,7 +199,8 @@ class DesktopModeWindowDecorViewModelTests : ShellTestCase() {
mockMainHandler,
mockMainChoreographer,
mockSyncQueue,
- mockRootTaskDisplayAreaOrganizer
+ mockRootTaskDisplayAreaOrganizer,
+ mockResizeHandleSizeRepository
)
verify(decoration).close()
}
@@ -221,7 +224,8 @@ class DesktopModeWindowDecorViewModelTests : ShellTestCase() {
mockMainHandler,
mockMainChoreographer,
mockSyncQueue,
- mockRootTaskDisplayAreaOrganizer
+ mockRootTaskDisplayAreaOrganizer,
+ mockResizeHandleSizeRepository
)
task.setWindowingMode(WINDOWING_MODE_FREEFORM)
@@ -236,7 +240,8 @@ class DesktopModeWindowDecorViewModelTests : ShellTestCase() {
mockMainHandler,
mockMainChoreographer,
mockSyncQueue,
- mockRootTaskDisplayAreaOrganizer
+ mockRootTaskDisplayAreaOrganizer,
+ mockResizeHandleSizeRepository
)
}
@@ -296,7 +301,7 @@ class DesktopModeWindowDecorViewModelTests : ShellTestCase() {
onTaskChanging(task)
verify(mockDesktopModeWindowDecorFactory, never())
- .create(any(), any(), any(), eq(task), any(), any(), any(), any(), any())
+ .create(any(), any(), any(), eq(task), any(), any(), any(), any(), any(), any())
}
@Test
@@ -309,7 +314,7 @@ class DesktopModeWindowDecorViewModelTests : ShellTestCase() {
onTaskOpening(task)
verify(mockDesktopModeWindowDecorFactory, never())
- .create(any(), any(), any(), eq(task), any(), any(), any(), any(), any())
+ .create(any(), any(), any(), eq(task), any(), any(), any(), any(), any(), any())
}
@Test
@@ -406,7 +411,7 @@ class DesktopModeWindowDecorViewModelTests : ShellTestCase() {
onTaskOpening(task)
verify(mockDesktopModeWindowDecorFactory, never())
- .create(any(), any(), any(), eq(task), any(), any(), any(), any(), any())
+ .create(any(), any(), any(), eq(task), any(), any(), any(), any(), any(), any())
} finally {
mockitoSession.finishMocking()
}
@@ -430,7 +435,7 @@ class DesktopModeWindowDecorViewModelTests : ShellTestCase() {
onTaskOpening(task)
verify(mockDesktopModeWindowDecorFactory)
- .create(any(), any(), any(), eq(task), any(), any(), any(), any(), any())
+ .create(any(), any(), any(), eq(task), any(), any(), any(), any(), any(), any())
} finally {
mockitoSession.finishMocking()
}
@@ -453,7 +458,7 @@ class DesktopModeWindowDecorViewModelTests : ShellTestCase() {
onTaskOpening(task)
verify(mockDesktopModeWindowDecorFactory)
- .create(any(), any(), any(), eq(task), any(), any(), any(), any(), any())
+ .create(any(), any(), any(), eq(task), any(), any(), any(), any(), any(), any())
} finally {
mockitoSession.finishMocking()
}
@@ -497,7 +502,7 @@ class DesktopModeWindowDecorViewModelTests : ShellTestCase() {
val decoration = mock(DesktopModeWindowDecoration::class.java)
whenever(
mockDesktopModeWindowDecorFactory.create(
- any(), any(), any(), eq(task), any(), any(), any(), any(), any())
+ any(), any(), any(), eq(task), any(), any(), any(), any(), any(), any())
).thenReturn(decoration)
decoration.mTaskInfo = task
whenever(decoration.isFocused).thenReturn(task.isFocused)
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 608f74b95280..e737861873d2 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
@@ -19,6 +19,7 @@ package com.android.wm.shell.windowdecor;
import static android.app.WindowConfiguration.WINDOWING_MODE_FREEFORM;
import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
import static android.app.WindowConfiguration.WINDOWING_MODE_MULTI_WINDOW;
+import static android.platform.test.flag.junit.SetFlagsRule.DefaultInitValueType.DEVICE_DEFAULT;
import static android.view.WindowInsetsController.APPEARANCE_TRANSPARENT_CAPTION_BAR_BACKGROUND;
import static com.google.common.truth.Truth.assertThat;
@@ -39,6 +40,9 @@ import android.content.res.Resources;
import android.content.res.TypedArray;
import android.os.Handler;
import android.os.SystemProperties;
+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.testing.TestableContext;
import android.view.Choreographer;
@@ -51,6 +55,7 @@ import android.window.WindowContainerTransaction;
import androidx.test.filters.SmallTest;
import com.android.internal.R;
+import com.android.window.flags.Flags;
import com.android.wm.shell.RootTaskDisplayAreaOrganizer;
import com.android.wm.shell.ShellTaskOrganizer;
import com.android.wm.shell.ShellTestCase;
@@ -61,6 +66,7 @@ import com.android.wm.shell.windowdecor.WindowDecoration.RelayoutParams;
import org.junit.Before;
import org.junit.BeforeClass;
+import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
@@ -83,6 +89,8 @@ public class DesktopModeWindowDecorationTests extends ShellTestCase {
private static final String USE_ROUNDED_CORNERS_SYSPROP_KEY =
"persist.wm.debug.desktop_use_rounded_corners";
+ @Rule public final SetFlagsRule mSetFlagsRule = new SetFlagsRule(DEVICE_DEFAULT);
+
@Mock
private DisplayController mMockDisplayController;
@Mock
@@ -107,6 +115,8 @@ public class DesktopModeWindowDecorationTests extends ShellTestCase {
private WindowDecoration.SurfaceControlViewHostFactory mMockSurfaceControlViewHostFactory;
@Mock
private TypedArray mMockRoundedCornersRadiusArray;
+ @Mock
+ private ResizeHandleSizeRepository mMockResizeHandleSizeRepository;
private final Configuration mConfiguration = new Configuration();
@@ -175,6 +185,48 @@ public class DesktopModeWindowDecorationTests extends ShellTestCase {
}
@Test
+ @EnableFlags(Flags.FLAG_ENABLE_APP_HEADER_WITH_TASK_DENSITY)
+ public void updateRelayoutParams_appHeader_usesTaskDensity() {
+ final int systemDensity = mTestableContext.getOrCreateTestableResources().getResources()
+ .getConfiguration().densityDpi;
+ final int customTaskDensity = systemDensity + 300;
+ final ActivityManager.RunningTaskInfo taskInfo = createTaskInfo(/* visible= */ true);
+ taskInfo.configuration.windowConfiguration.setWindowingMode(WINDOWING_MODE_FREEFORM);
+ taskInfo.configuration.densityDpi = customTaskDensity;
+ final RelayoutParams relayoutParams = new RelayoutParams();
+
+ DesktopModeWindowDecoration.updateRelayoutParams(
+ relayoutParams,
+ mTestableContext,
+ taskInfo,
+ /* applyStartTransactionOnDraw= */ true,
+ /* shouldSetTaskPositionAndCrop */ false);
+
+ assertThat(relayoutParams.mWindowDecorConfig.densityDpi).isEqualTo(customTaskDensity);
+ }
+
+ @Test
+ @DisableFlags(Flags.FLAG_ENABLE_APP_HEADER_WITH_TASK_DENSITY)
+ public void updateRelayoutParams_appHeader_usesSystemDensity() {
+ final int systemDensity = mTestableContext.getOrCreateTestableResources().getResources()
+ .getConfiguration().densityDpi;
+ final int customTaskDensity = systemDensity + 300;
+ final ActivityManager.RunningTaskInfo taskInfo = createTaskInfo(/* visible= */ true);
+ taskInfo.configuration.windowConfiguration.setWindowingMode(WINDOWING_MODE_FULLSCREEN);
+ taskInfo.configuration.densityDpi = customTaskDensity;
+ final RelayoutParams relayoutParams = new RelayoutParams();
+
+ DesktopModeWindowDecoration.updateRelayoutParams(
+ relayoutParams,
+ mTestableContext,
+ taskInfo,
+ /* applyStartTransactionOnDraw= */ true,
+ /* shouldSetTaskPositionAndCrop */ false);
+
+ assertThat(relayoutParams.mWindowDecorConfig.densityDpi).isEqualTo(systemDensity);
+ }
+
+ @Test
public void updateRelayoutParams_freeformAndTransparentAppearance_allowsInputFallthrough() {
final ActivityManager.RunningTaskInfo taskInfo = createTaskInfo(/* visible= */ true);
taskInfo.configuration.windowConfiguration.setWindowingMode(WINDOWING_MODE_FREEFORM);
@@ -294,10 +346,10 @@ public class DesktopModeWindowDecorationTests extends ShellTestCase {
private DesktopModeWindowDecoration createWindowDecoration(
ActivityManager.RunningTaskInfo taskInfo) {
return new DesktopModeWindowDecoration(mContext, mMockDisplayController,
- mMockShellTaskOrganizer, taskInfo, mMockSurfaceControl, mConfiguration,
+ mMockShellTaskOrganizer, taskInfo, mMockSurfaceControl,
mMockHandler, mMockChoreographer, mMockSyncQueue, mMockRootTaskDisplayAreaOrganizer,
- SurfaceControl.Builder::new, mMockTransactionSupplier,
- WindowContainerTransaction::new, SurfaceControl::new,
+ mMockResizeHandleSizeRepository, SurfaceControl.Builder::new,
+ mMockTransactionSupplier, WindowContainerTransaction::new, SurfaceControl::new,
mMockSurfaceControlViewHostFactory);
}
diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/DragResizeWindowGeometryTests.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/DragResizeWindowGeometryTests.java
index 54645083eca8..62fb1c441118 100644
--- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/DragResizeWindowGeometryTests.java
+++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/DragResizeWindowGeometryTests.java
@@ -27,10 +27,7 @@ import static com.google.common.truth.Truth.assertThat;
import android.annotation.NonNull;
import android.graphics.Point;
import android.graphics.Region;
-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.platform.test.flag.junit.SetFlagsRule;
import android.testing.AndroidTestingRunner;
import android.util.Size;
@@ -74,7 +71,7 @@ public class DragResizeWindowGeometryTests {
TASK_SIZE.getHeight() + EDGE_RESIZE_THICKNESS / 2);
@Rule
- public final CheckFlagsRule mCheckFlagsRule = DeviceFlagsValueProvider.createCheckFlagsRule();
+ public final SetFlagsRule mSetFlagsRule = new SetFlagsRule();
/**
* Check that both groups of objects satisfy equals/hashcode within each group, and that each
@@ -147,8 +144,8 @@ public class DragResizeWindowGeometryTests {
* capture all eligible input regardless of source (touch or cursor).
*/
@Test
- @RequiresFlagsEnabled(Flags.FLAG_ENABLE_WINDOWING_EDGE_DRAG_RESIZE)
public void testRegionUnion_edgeDragResizeEnabled_containsLargeCorners() {
+ mSetFlagsRule.enableFlags(Flags.FLAG_ENABLE_WINDOWING_EDGE_DRAG_RESIZE);
Region region = new Region();
GEOMETRY.union(region);
// Make sure we're choosing a point outside of any debug region buffer.
@@ -164,8 +161,8 @@ public class DragResizeWindowGeometryTests {
* size.
*/
@Test
- @RequiresFlagsDisabled(Flags.FLAG_ENABLE_WINDOWING_EDGE_DRAG_RESIZE)
public void testRegionUnion_edgeDragResizeDisabled_containsFineCorners() {
+ mSetFlagsRule.disableFlags(Flags.FLAG_ENABLE_WINDOWING_EDGE_DRAG_RESIZE);
Region region = new Region();
GEOMETRY.union(region);
final int cornerRadius = DragResizeWindowGeometry.DEBUG
@@ -176,16 +173,16 @@ public class DragResizeWindowGeometryTests {
}
@Test
- @RequiresFlagsEnabled(Flags.FLAG_ENABLE_WINDOWING_EDGE_DRAG_RESIZE)
public void testCalculateControlType_edgeDragResizeEnabled_edges() {
+ mSetFlagsRule.enableFlags(Flags.FLAG_ENABLE_WINDOWING_EDGE_DRAG_RESIZE);
// The input source (touch or cursor) shouldn't impact the edge resize size.
validateCtrlTypeForEdges(/* isTouch= */ false);
validateCtrlTypeForEdges(/* isTouch= */ true);
}
@Test
- @RequiresFlagsDisabled(Flags.FLAG_ENABLE_WINDOWING_EDGE_DRAG_RESIZE)
public void testCalculateControlType_edgeDragResizeDisabled_edges() {
+ mSetFlagsRule.disableFlags(Flags.FLAG_ENABLE_WINDOWING_EDGE_DRAG_RESIZE);
// Edge resizing is not supported when the flag is disabled.
validateCtrlTypeForEdges(/* isTouch= */ false);
validateCtrlTypeForEdges(/* isTouch= */ false);
@@ -203,8 +200,8 @@ public class DragResizeWindowGeometryTests {
}
@Test
- @RequiresFlagsEnabled(Flags.FLAG_ENABLE_WINDOWING_EDGE_DRAG_RESIZE)
public void testCalculateControlType_edgeDragResizeEnabled_corners() {
+ mSetFlagsRule.enableFlags(Flags.FLAG_ENABLE_WINDOWING_EDGE_DRAG_RESIZE);
final TestPoints fineTestPoints = new TestPoints(TASK_SIZE, FINE_CORNER_SIZE / 2);
final TestPoints largeCornerTestPoints = new TestPoints(TASK_SIZE, LARGE_CORNER_SIZE / 2);
@@ -226,8 +223,8 @@ public class DragResizeWindowGeometryTests {
}
@Test
- @RequiresFlagsDisabled(Flags.FLAG_ENABLE_WINDOWING_EDGE_DRAG_RESIZE)
public void testCalculateControlType_edgeDragResizeDisabled_corners() {
+ mSetFlagsRule.disableFlags(Flags.FLAG_ENABLE_WINDOWING_EDGE_DRAG_RESIZE);
final TestPoints fineTestPoints = new TestPoints(TASK_SIZE, FINE_CORNER_SIZE / 2);
final TestPoints largeCornerTestPoints = new TestPoints(TASK_SIZE, LARGE_CORNER_SIZE / 2);
diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/ResizeHandleSizeRepositoryParameterizedTests.kt b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/ResizeHandleSizeRepositoryParameterizedTests.kt
new file mode 100644
index 000000000000..a9fddc623b96
--- /dev/null
+++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/ResizeHandleSizeRepositoryParameterizedTests.kt
@@ -0,0 +1,150 @@
+/*
+ * 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.content.Context
+import android.platform.test.flag.junit.SetFlagsRule
+import androidx.test.core.app.ApplicationProvider
+import androidx.test.filters.SmallTest
+import com.android.window.flags.Flags
+import java.util.function.Consumer
+import org.junit.Before
+import org.junit.Rule
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.junit.runners.Parameterized
+import org.junit.runners.Parameterized.Parameter
+import org.junit.runners.Parameterized.Parameters
+import org.mockito.Mock
+import org.mockito.Mockito.mock
+import org.mockito.MockitoAnnotations
+import org.mockito.kotlin.any
+import org.mockito.kotlin.never
+import org.mockito.kotlin.verify
+
+/**
+ * Tests for {@link ResizeHandleSizeRepository}.
+ *
+ * Build/Install/Run: atest WMShellUnitTests:ResizeHandleSizeRepositoryParameterizedTests
+ */
+@SmallTest
+@RunWith(Parameterized::class)
+class ResizeHandleSizeRepositoryParameterizedTests {
+ private val resources = ApplicationProvider.getApplicationContext<Context>().resources
+ private val resizeHandleSizeRepository = ResizeHandleSizeRepository()
+ @Mock private lateinit var mockSizeChangeFunctionOne: Consumer<ResizeHandleSizeRepository>
+ @Mock private lateinit var mockSizeChangeFunctionTwo: Consumer<ResizeHandleSizeRepository>
+
+ @JvmField @Rule val setFlagsRule = SetFlagsRule()
+
+ @Parameter(0) lateinit var name: String
+ // The current ResizeHandleSizeRepository API under test.
+
+ @Parameter(1) lateinit var operation: (ResizeHandleSizeRepository) -> Unit
+
+ @Before
+ fun setOverrideBeforeResetResizeHandle() {
+ MockitoAnnotations.initMocks(this)
+ if (name != "reset") return
+ val originalEdgeHandle =
+ resizeHandleSizeRepository.getResizeEdgeHandlePixels(resources)
+ resizeHandleSizeRepository.setResizeEdgeHandlePixels(originalEdgeHandle + 2)
+ }
+
+ companion object {
+ @Parameters(name = "{index}: {0}")
+ @JvmStatic
+ fun data(): Iterable<Array<Any>> {
+ return listOf(
+ arrayOf(
+ "reset",
+ { sizeRepository: ResizeHandleSizeRepository ->
+ sizeRepository.resetResizeEdgeHandlePixels()
+ }
+ ),
+ arrayOf(
+ "set",
+ { sizeRepository: ResizeHandleSizeRepository ->
+ sizeRepository.setResizeEdgeHandlePixels(99)
+ }
+ )
+ )
+ }
+ }
+
+ // =================
+ // Validate that listeners are notified correctly for reset resize handle API.
+ // =================
+
+ @Test
+ fun testUpdateResizeHandleSize_flagDisabled() {
+ setFlagsRule.disableFlags(Flags.FLAG_ENABLE_WINDOWING_EDGE_DRAG_RESIZE)
+ registerSizeChangeFunctions()
+ operation.invoke(resizeHandleSizeRepository)
+ // Nothing is notified since flag is disabled.
+ verify(mockSizeChangeFunctionOne, never()).accept(any())
+ verify(mockSizeChangeFunctionTwo, never()).accept(any())
+ }
+
+ @Test
+ fun testUpdateResizeHandleSize_flagEnabled_noListeners() {
+ setFlagsRule.enableFlags(Flags.FLAG_ENABLE_WINDOWING_EDGE_DRAG_RESIZE)
+ operation.invoke(resizeHandleSizeRepository)
+ // Nothing is notified since nothing was registered.
+ verify(mockSizeChangeFunctionOne, never()).accept(any())
+ verify(mockSizeChangeFunctionTwo, never()).accept(any())
+ }
+
+ @Test
+ fun testUpdateResizeHandleSize_flagEnabled_listenersNotified() {
+ setFlagsRule.enableFlags(Flags.FLAG_ENABLE_WINDOWING_EDGE_DRAG_RESIZE)
+ registerSizeChangeFunctions()
+ operation.invoke(resizeHandleSizeRepository)
+ // Functions notified when reset.
+ verify(mockSizeChangeFunctionOne).accept(any())
+ verify(mockSizeChangeFunctionTwo).accept(any())
+ }
+
+ @Test
+ fun testUpdateResizeHandleSize_flagEnabled_listenerFails() {
+ setFlagsRule.enableFlags(Flags.FLAG_ENABLE_WINDOWING_EDGE_DRAG_RESIZE)
+ registerSizeChangeFunctions()
+ operation.invoke(resizeHandleSizeRepository)
+ // Functions notified when reset.
+ verify(mockSizeChangeFunctionOne).accept(any())
+ verify(mockSizeChangeFunctionTwo).accept(any())
+ }
+
+ @Test
+ fun testUpdateResizeHandleSize_flagEnabled_ignoreSecondListener() {
+ setFlagsRule.enableFlags(Flags.FLAG_ENABLE_WINDOWING_EDGE_DRAG_RESIZE)
+ registerSizeChangeFunctions()
+ val extraConsumerMock = mock(Consumer::class.java) as Consumer<ResizeHandleSizeRepository>
+ resizeHandleSizeRepository.registerSizeChangeFunction(extraConsumerMock)
+ // First listener succeeds, second one that fails is ignored.
+ operation.invoke(resizeHandleSizeRepository)
+ // Functions notified when reset.
+ verify(mockSizeChangeFunctionOne).accept(any())
+ verify(mockSizeChangeFunctionTwo).accept(any())
+ verify(extraConsumerMock).accept(any())
+ }
+
+ private fun registerSizeChangeFunctions() {
+ resizeHandleSizeRepository.registerSizeChangeFunction(mockSizeChangeFunctionOne)
+ resizeHandleSizeRepository.registerSizeChangeFunction(mockSizeChangeFunctionTwo)
+ }
+}
diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/ResizeHandleSizeRepositoryTests.kt b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/ResizeHandleSizeRepositoryTests.kt
new file mode 100644
index 000000000000..59bbc72a733b
--- /dev/null
+++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/windowdecor/ResizeHandleSizeRepositoryTests.kt
@@ -0,0 +1,77 @@
+/*
+ * 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.content.Context
+import android.platform.test.flag.junit.SetFlagsRule
+import android.testing.AndroidTestingRunner
+import androidx.test.core.app.ApplicationProvider
+import androidx.test.filters.SmallTest
+import com.android.window.flags.Flags
+import com.google.common.truth.Truth.assertThat
+import org.junit.Rule
+import org.junit.Test
+import org.junit.runner.RunWith
+
+/**
+ * Tests for {@link ResizeHandleSizeRepository}. Validate that get/reset/set work correctly.
+ *
+ * Build/Install/Run: atest WMShellUnitTests:ResizeHandleSizeRepositoryTests
+ */
+@SmallTest
+@RunWith(AndroidTestingRunner::class)
+class ResizeHandleSizeRepositoryTests {
+ private val resources = ApplicationProvider.getApplicationContext<Context>().resources
+ private val resizeHandleSizeRepository = ResizeHandleSizeRepository()
+
+ @JvmField @Rule val setFlagsRule = SetFlagsRule()
+
+ @Test
+ fun testOverrideResizeEdgeHandlePixels_flagEnabled_resetSucceeds() {
+ setFlagsRule.enableFlags(Flags.FLAG_ENABLE_WINDOWING_EDGE_DRAG_RESIZE)
+ // Reset does nothing when no override is set.
+ val originalEdgeHandle =
+ resizeHandleSizeRepository.getResizeEdgeHandlePixels(resources)
+ resizeHandleSizeRepository.resetResizeEdgeHandlePixels()
+ assertThat(resizeHandleSizeRepository.getResizeEdgeHandlePixels(resources))
+ .isEqualTo(originalEdgeHandle)
+
+ // Now try to set the value; reset should succeed.
+ resizeHandleSizeRepository.setResizeEdgeHandlePixels(originalEdgeHandle + 2)
+ resizeHandleSizeRepository.resetResizeEdgeHandlePixels()
+ assertThat(resizeHandleSizeRepository.getResizeEdgeHandlePixels(resources))
+ .isEqualTo(originalEdgeHandle)
+ }
+
+ @Test
+ fun testOverrideResizeEdgeHandlePixels_flagDisabled_resetFails() {
+ setFlagsRule.disableFlags(Flags.FLAG_ENABLE_WINDOWING_EDGE_DRAG_RESIZE)
+ // Reset does nothing when no override is set.
+ val originalEdgeHandle =
+ resizeHandleSizeRepository.getResizeEdgeHandlePixels(resources)
+ resizeHandleSizeRepository.resetResizeEdgeHandlePixels()
+ assertThat(resizeHandleSizeRepository.getResizeEdgeHandlePixels(resources))
+ .isEqualTo(originalEdgeHandle)
+
+ // Now try to set the value; reset should do nothing.
+ val newEdgeHandle = originalEdgeHandle + 2
+ resizeHandleSizeRepository.setResizeEdgeHandlePixels(newEdgeHandle)
+ resizeHandleSizeRepository.resetResizeEdgeHandlePixels()
+ assertThat(resizeHandleSizeRepository.getResizeEdgeHandlePixels(resources))
+ .isEqualTo(originalEdgeHandle)
+ }
+}
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 8b8cd119effd..48310810e8c9 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
@@ -49,7 +49,6 @@ import static org.mockito.quality.Strictness.LENIENT;
import android.app.ActivityManager;
import android.content.Context;
-import android.content.res.Configuration;
import android.content.res.Resources;
import android.graphics.Color;
import android.graphics.Point;
@@ -134,7 +133,6 @@ public class WindowDecorationTests extends ShellTestCase {
private SurfaceControl.Transaction mMockSurfaceControlFinishT;
private SurfaceControl.Transaction mMockSurfaceControlAddWindowT;
private WindowDecoration.RelayoutParams mRelayoutParams = new WindowDecoration.RelayoutParams();
- private Configuration mWindowConfiguration = new Configuration();
private int mCaptionMenuWidthId;
@Before
@@ -303,7 +301,6 @@ public class WindowDecorationTests extends ShellTestCase {
taskInfo.isFocused = true;
// Density is 2. Shadow radius is 10px. Caption height is 64px.
taskInfo.configuration.densityDpi = DisplayMetrics.DENSITY_DEFAULT * 2;
- mWindowConfiguration.densityDpi = taskInfo.configuration.densityDpi;
final TestWindowDecoration windowDecor = createWindowDecoration(taskInfo);
@@ -314,14 +311,16 @@ public class WindowDecorationTests extends ShellTestCase {
verify(mMockWindowContainerTransaction, never())
.removeInsetsSource(eq(taskInfo.token), any(), anyInt(), anyInt());
+ final SurfaceControl.Transaction t2 = mock(SurfaceControl.Transaction.class);
+ mMockSurfaceControlTransactions.add(t2);
taskInfo.isVisible = false;
windowDecor.relayout(taskInfo);
- final InOrder releaseOrder = inOrder(t, mMockSurfaceControlViewHost);
+ final InOrder releaseOrder = inOrder(t2, mMockSurfaceControlViewHost);
releaseOrder.verify(mMockSurfaceControlViewHost).release();
- releaseOrder.verify(t).remove(captionContainerSurface);
- releaseOrder.verify(t).remove(decorContainerSurface);
- releaseOrder.verify(t).apply();
+ releaseOrder.verify(t2).remove(captionContainerSurface);
+ releaseOrder.verify(t2).remove(decorContainerSurface);
+ releaseOrder.verify(t2).apply();
// Expect to remove two insets sources, the caption insets and the mandatory gesture insets.
verify(mMockWindowContainerTransaction, Mockito.times(2))
.removeInsetsSource(eq(taskInfo.token), any(), anyInt(), anyInt());
@@ -836,7 +835,7 @@ public class WindowDecorationTests extends ShellTestCase {
private TestWindowDecoration createWindowDecoration(ActivityManager.RunningTaskInfo taskInfo) {
return new TestWindowDecoration(mContext, mMockDisplayController, mMockShellTaskOrganizer,
- taskInfo, mMockTaskSurface, mWindowConfiguration,
+ taskInfo, mMockTaskSurface,
new MockObjectSupplier<>(mMockSurfaceControlBuilders,
() -> createMockSurfaceControlBuilder(mock(SurfaceControl.class))),
new MockObjectSupplier<>(mMockSurfaceControlTransactions,
@@ -877,16 +876,15 @@ public class WindowDecorationTests extends ShellTestCase {
TestWindowDecoration(Context context, DisplayController displayController,
ShellTaskOrganizer taskOrganizer, ActivityManager.RunningTaskInfo taskInfo,
SurfaceControl taskSurface,
- Configuration windowConfiguration,
Supplier<SurfaceControl.Builder> surfaceControlBuilderSupplier,
Supplier<SurfaceControl.Transaction> surfaceControlTransactionSupplier,
Supplier<WindowContainerTransaction> windowContainerTransactionSupplier,
Supplier<SurfaceControl> surfaceControlSupplier,
SurfaceControlViewHostFactory surfaceControlViewHostFactory) {
super(context, displayController, taskOrganizer, taskInfo, taskSurface,
- windowConfiguration, surfaceControlBuilderSupplier,
- surfaceControlTransactionSupplier, windowContainerTransactionSupplier,
- surfaceControlSupplier, surfaceControlViewHostFactory);
+ surfaceControlBuilderSupplier, surfaceControlTransactionSupplier,
+ windowContainerTransactionSupplier, surfaceControlSupplier,
+ surfaceControlViewHostFactory);
}
@Override
diff --git a/libs/hwui/jni/BitmapFactory.cpp b/libs/hwui/jni/BitmapFactory.cpp
index 3d0a53440bfb..785aef312072 100644
--- a/libs/hwui/jni/BitmapFactory.cpp
+++ b/libs/hwui/jni/BitmapFactory.cpp
@@ -688,8 +688,8 @@ static jobject nativeDecodeStream(JNIEnv* env, jobject clazz, jobject is, jbyteA
static jobject nativeDecodeFileDescriptor(JNIEnv* env, jobject clazz, jobject fileDescriptor,
jobject padding, jobject bitmapFactoryOptions, jlong inBitmapHandle, jlong colorSpaceHandle) {
-#ifndef __ANDROID__ // LayoutLib for Windows does not support F_DUPFD_CLOEXEC
- return nullObjectReturn("Not supported on Windows");
+#ifdef _WIN32 // LayoutLib for Windows does not support F_DUPFD_CLOEXEC
+ return nullObjectReturn("Not supported on Windows");
#else
NPE_CHECK_RETURN_ZERO(env, fileDescriptor);
diff --git a/media/java/android/media/IMediaRouter2.aidl b/media/java/android/media/IMediaRouter2.aidl
index e2dddad274e1..85bc8efe2750 100644
--- a/media/java/android/media/IMediaRouter2.aidl
+++ b/media/java/android/media/IMediaRouter2.aidl
@@ -36,6 +36,5 @@ oneway interface IMediaRouter2 {
* Call MediaRouterService#requestCreateSessionWithRouter2 to pass the result.
*/
void requestCreateSessionByManager(long uniqueRequestId, in RoutingSessionInfo oldSession,
- in MediaRoute2Info route, in UserHandle transferInitiatorUserHandle,
- in String transferInitiatorPackageName);
+ in MediaRoute2Info route);
}
diff --git a/media/java/android/media/IMediaRouterService.aidl b/media/java/android/media/IMediaRouterService.aidl
index 63cb94516739..efbf8da6d17c 100644
--- a/media/java/android/media/IMediaRouterService.aidl
+++ b/media/java/android/media/IMediaRouterService.aidl
@@ -64,8 +64,7 @@ interface IMediaRouterService {
void requestCreateSessionWithRouter2(IMediaRouter2 router, int requestId, long managerRequestId,
in RoutingSessionInfo oldSession, in MediaRoute2Info route,
- in @nullable Bundle sessionHints, in UserHandle transferInitiatorUserHandle,
- in String transferInitiatorPackageName);
+ in @nullable Bundle sessionHints);
void selectRouteWithRouter2(IMediaRouter2 router, String sessionId, in MediaRoute2Info route);
void deselectRouteWithRouter2(IMediaRouter2 router, String sessionId, in MediaRoute2Info route);
void transferToRouteWithRouter2(IMediaRouter2 router, String sessionId,
diff --git a/media/java/android/media/LoudnessCodecDispatcher.java b/media/java/android/media/LoudnessCodecDispatcher.java
index fa08658a214f..bdd3c7396a5a 100644
--- a/media/java/android/media/LoudnessCodecDispatcher.java
+++ b/media/java/android/media/LoudnessCodecDispatcher.java
@@ -16,6 +16,9 @@
package android.media;
+import static android.media.MediaFormat.KEY_AAC_DRC_ALBUM_MODE;
+import static android.media.MediaFormat.KEY_AAC_DRC_ATTENUATION_FACTOR;
+import static android.media.MediaFormat.KEY_AAC_DRC_BOOST_FACTOR;
import static android.media.MediaFormat.KEY_AAC_DRC_EFFECT_TYPE;
import static android.media.MediaFormat.KEY_AAC_DRC_HEAVY_COMPRESSION;
import static android.media.MediaFormat.KEY_AAC_DRC_TARGET_REFERENCE_LEVEL;
@@ -142,6 +145,18 @@ public class LoudnessCodecDispatcher implements CallbackUtil.DispatcherStub {
filteredBundle.putInt(KEY_AAC_DRC_EFFECT_TYPE,
bundle.getInt(KEY_AAC_DRC_EFFECT_TYPE));
}
+ if (bundle.containsKey(KEY_AAC_DRC_BOOST_FACTOR)) {
+ filteredBundle.putInt(KEY_AAC_DRC_BOOST_FACTOR,
+ bundle.getInt(KEY_AAC_DRC_BOOST_FACTOR));
+ }
+ if (bundle.containsKey(KEY_AAC_DRC_ATTENUATION_FACTOR)) {
+ filteredBundle.putInt(KEY_AAC_DRC_ATTENUATION_FACTOR,
+ bundle.getInt(KEY_AAC_DRC_ATTENUATION_FACTOR));
+ }
+ if (bundle.containsKey(KEY_AAC_DRC_ALBUM_MODE)) {
+ filteredBundle.putInt(KEY_AAC_DRC_ALBUM_MODE,
+ bundle.getInt(KEY_AAC_DRC_ALBUM_MODE));
+ }
return filteredBundle;
}
diff --git a/media/java/android/media/MediaRouter2.java b/media/java/android/media/MediaRouter2.java
index 7ddf11e41a41..679e8a1b95e6 100644
--- a/media/java/android/media/MediaRouter2.java
+++ b/media/java/android/media/MediaRouter2.java
@@ -991,9 +991,7 @@ public final class MediaRouter2 {
void requestCreateController(
@NonNull RoutingController controller,
@NonNull MediaRoute2Info route,
- long managerRequestId,
- @NonNull UserHandle transferInitiatorUserHandle,
- @NonNull String transferInitiatorPackageName) {
+ long managerRequestId) {
final int requestId = mNextRequestId.getAndIncrement();
@@ -1022,9 +1020,7 @@ public final class MediaRouter2 {
managerRequestId,
controller.getRoutingSessionInfo(),
route,
- controllerHints,
- transferInitiatorUserHandle,
- transferInitiatorPackageName);
+ controllerHints);
} catch (RemoteException ex) {
Log.e(TAG, "createControllerForTransfer: "
+ "Failed to request for creating a controller.", ex);
@@ -1366,11 +1362,7 @@ public final class MediaRouter2 {
}
void onRequestCreateControllerByManagerOnHandler(
- RoutingSessionInfo oldSession,
- MediaRoute2Info route,
- long managerRequestId,
- @NonNull UserHandle transferInitiatorUserHandle,
- @NonNull String transferInitiatorPackageName) {
+ RoutingSessionInfo oldSession, MediaRoute2Info route, long managerRequestId) {
Log.i(
TAG,
TextUtils.formatSimple(
@@ -1387,8 +1379,7 @@ public final class MediaRouter2 {
if (controller == null) {
return;
}
- requestCreateController(controller, route, managerRequestId, transferInitiatorUserHandle,
- transferInitiatorPackageName);
+ requestCreateController(controller, route, managerRequestId);
}
private List<MediaRoute2Info> getSortedRoutes(
@@ -2423,20 +2414,14 @@ public final class MediaRouter2 {
@Override
public void requestCreateSessionByManager(
- long managerRequestId,
- RoutingSessionInfo oldSession,
- MediaRoute2Info route,
- UserHandle transferInitiatorUserHandle,
- String transferInitiatorPackageName) {
+ long managerRequestId, RoutingSessionInfo oldSession, MediaRoute2Info route) {
mHandler.sendMessage(
obtainMessage(
MediaRouter2::onRequestCreateControllerByManagerOnHandler,
MediaRouter2.this,
oldSession,
route,
- managerRequestId,
- transferInitiatorUserHandle,
- transferInitiatorPackageName));
+ managerRequestId));
}
}
@@ -3581,12 +3566,7 @@ public final class MediaRouter2 {
RoutingController controller = getCurrentController();
if (!controller.tryTransferWithinProvider(route)) {
- requestCreateController(
- controller,
- route,
- MANAGER_REQUEST_ID_NONE,
- Process.myUserHandle(),
- mContext.getPackageName());
+ requestCreateController(controller, route, MANAGER_REQUEST_ID_NONE);
}
}
diff --git a/media/java/android/media/projection/MediaProjection.java b/media/java/android/media/projection/MediaProjection.java
index 223b432c12af..40592915a3a8 100644
--- a/media/java/android/media/projection/MediaProjection.java
+++ b/media/java/android/media/projection/MediaProjection.java
@@ -109,7 +109,7 @@ public final class MediaProjection {
try {
final Callback c = Objects.requireNonNull(callback);
if (handler == null) {
- handler = new Handler();
+ handler = new Handler(mContext.getMainLooper());
}
mCallbacks.put(c, new CallbackRecord(c, handler));
} catch (NullPointerException e) {
diff --git a/media/java/android/media/session/MediaController.java b/media/java/android/media/session/MediaController.java
index a4887567b075..70462effaa54 100644
--- a/media/java/android/media/session/MediaController.java
+++ b/media/java/android/media/session/MediaController.java
@@ -614,12 +614,11 @@ public final class MediaController {
}
/**
- * Override to handle changes to the audio info.
+ * Signals a change in the session's {@link PlaybackInfo PlaybackInfo}.
*
- * @param info The current audio info for this session.
+ * @param playbackInfo The latest known state of the session's playback info.
*/
- public void onAudioInfoChanged(PlaybackInfo info) {
- }
+ public void onAudioInfoChanged(@NonNull PlaybackInfo playbackInfo) {}
}
/**
@@ -1182,7 +1181,7 @@ public final class MediaController {
}
@Override
- public void onVolumeInfoChanged(PlaybackInfo info) {
+ public void onVolumeInfoChanged(@NonNull PlaybackInfo info) {
MediaController controller = mController.get();
if (controller != null) {
controller.postMessage(MSG_UPDATE_VOLUME, info, null);
diff --git a/native/android/performance_hint.cpp b/native/android/performance_hint.cpp
index 83056b267365..02d72ad7d693 100644
--- a/native/android/performance_hint.cpp
+++ b/native/android/performance_hint.cpp
@@ -60,7 +60,7 @@ public:
APerformanceHintSession* createSession(const int32_t* threadIds, size_t size,
int64_t initialTargetWorkDurationNanos,
- hal::SessionTag tag = hal::SessionTag::OTHER);
+ hal::SessionTag tag = hal::SessionTag::APP);
int64_t getPreferredRateNanos() const;
private:
diff --git a/nfc/java/android/nfc/INfcAdapter.aidl b/nfc/java/android/nfc/INfcAdapter.aidl
index 7cd7e7ab49a9..7150b54cf7f1 100644
--- a/nfc/java/android/nfc/INfcAdapter.aidl
+++ b/nfc/java/android/nfc/INfcAdapter.aidl
@@ -91,7 +91,7 @@ interface INfcAdapter
boolean enableReaderOption(boolean enable);
boolean isObserveModeSupported();
boolean isObserveModeEnabled();
- boolean setObserveMode(boolean enabled);
+ boolean setObserveMode(boolean enabled, String pkg);
@JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS)")
boolean setWlcEnabled(boolean enable);
diff --git a/nfc/java/android/nfc/NfcAdapter.java b/nfc/java/android/nfc/NfcAdapter.java
index 06098deb8aff..698df28129be 100644
--- a/nfc/java/android/nfc/NfcAdapter.java
+++ b/nfc/java/android/nfc/NfcAdapter.java
@@ -1268,8 +1268,12 @@ public final class NfcAdapter {
@FlaggedApi(Flags.FLAG_NFC_OBSERVE_MODE)
public boolean setObserveModeEnabled(boolean enabled) {
+ if (mContext == null) {
+ throw new UnsupportedOperationException("You need a context on NfcAdapter to use the "
+ + " observe mode APIs");
+ }
try {
- return sService.setObserveMode(enabled);
+ return sService.setObserveMode(enabled, mContext.getPackageName());
} catch (RemoteException e) {
attemptDeadServiceRecovery(e);
return false;
diff --git a/packages/CredentialManager/res/values-fr-rCA/strings.xml b/packages/CredentialManager/res/values-fr-rCA/strings.xml
index 7b8093e416f0..d9715eefa955 100644
--- a/packages/CredentialManager/res/values-fr-rCA/strings.xml
+++ b/packages/CredentialManager/res/values-fr-rCA/strings.xml
@@ -48,7 +48,7 @@
<string name="passwords" msgid="5419394230391253816">"mots de passe"</string>
<string name="sign_ins" msgid="4710739369149469208">"connexions"</string>
<string name="sign_in_info" msgid="2627704710674232328">"renseignements de connexion"</string>
- <string name="save_credential_to_title" msgid="3172811692275634301">"Enregistrer la <xliff:g id="CREDENTIALTYPES">%1$s</xliff:g> dans"</string>
+ <string name="save_credential_to_title" msgid="3172811692275634301">"Enregistrer le <xliff:g id="CREDENTIALTYPES">%1$s</xliff:g> dans"</string>
<string name="create_passkey_in_other_device_title" msgid="2360053098931886245">"Créer une clé d\'accès sur un autre appareil?"</string>
<string name="save_password_on_other_device_title" msgid="5829084591948321207">"Enregistrer le mot de passe sur un autre appareil?"</string>
<string name="save_sign_in_on_other_device_title" msgid="2827990118560134692">"Enregistrer l\'authentifiant de connexion sur un autre appareil?"</string>
@@ -57,9 +57,9 @@
<string name="set_as_default" msgid="4415328591568654603">"Définir par défaut"</string>
<string name="settings" msgid="6536394145760913145">"Paramètres"</string>
<string name="use_once" msgid="9027366575315399714">"Utiliser une fois"</string>
- <string name="more_options_usage_passwords_passkeys" msgid="3470113942332934279">"<xliff:g id="PASSWORDSNUMBER">%1$s</xliff:g> mots de passe • <xliff:g id="PASSKEYSNUMBER">%2$s</xliff:g> clés d\'accès"</string>
- <string name="more_options_usage_passwords" msgid="1632047277723187813">"<xliff:g id="PASSWORDSNUMBER">%1$s</xliff:g> mots de passe"</string>
- <string name="more_options_usage_passkeys" msgid="5390320437243042237">"<xliff:g id="PASSKEYSNUMBER">%1$s</xliff:g> clés d\'accès"</string>
+ <string name="more_options_usage_passwords_passkeys" msgid="3470113942332934279">"<xliff:g id="PASSWORDSNUMBER">%1$s</xliff:g> mot(s) de passe • <xliff:g id="PASSKEYSNUMBER">%2$s</xliff:g> clé(s) d\'accès"</string>
+ <string name="more_options_usage_passwords" msgid="1632047277723187813">"<xliff:g id="PASSWORDSNUMBER">%1$s</xliff:g> mot(s) de passe"</string>
+ <string name="more_options_usage_passkeys" msgid="5390320437243042237">"<xliff:g id="PASSKEYSNUMBER">%1$s</xliff:g> clé(s) d\'accès"</string>
<string name="more_options_usage_credentials" msgid="1785697001787193984">"<xliff:g id="TOTALCREDENTIALSNUMBER">%1$s</xliff:g> authentifiants"</string>
<string name="passkey_before_subtitle" msgid="2448119456208647444">"Clé d\'accès"</string>
<string name="another_device" msgid="5147276802037801217">"Un autre appareil"</string>
diff --git a/packages/CredentialManager/res/values-hy/strings.xml b/packages/CredentialManager/res/values-hy/strings.xml
index 3ec7da3721e8..630a08a7e903 100644
--- a/packages/CredentialManager/res/values-hy/strings.xml
+++ b/packages/CredentialManager/res/values-hy/strings.xml
@@ -24,15 +24,15 @@
<string name="string_learn_more" msgid="4541600451688392447">"Իմանալ ավելին"</string>
<string name="content_description_show_password" msgid="3283502010388521607">"Ցուցադրել գաղտնաբառը"</string>
<string name="content_description_hide_password" msgid="6841375971631767996">"Թաքցնել գաղտնաբառը"</string>
- <string name="passkey_creation_intro_title" msgid="4251037543787718844">"Անցաբառերի հետ ավելի ապահով է"</string>
- <string name="passkey_creation_intro_body_password" msgid="8825872426579958200">"Անցաբառերի շնորհիվ դուք բարդ գաղտնաբառեր ստեղծելու կամ հիշելու անհրաժեշտություն չեք ունենա"</string>
- <string name="passkey_creation_intro_body_fingerprint" msgid="7331338631826254055">"Անցաբառերը գաղտնագրված թվային բանալիներ են, որոնք ստեղծվում են մատնահետքի, դեմքով ապակողպման կամ էկրանի կողպման օգտագործմամբ"</string>
+ <string name="passkey_creation_intro_title" msgid="4251037543787718844">"Մուտքի բանալիների հետ ավելի ապահով է"</string>
+ <string name="passkey_creation_intro_body_password" msgid="8825872426579958200">"Մուտքի բանալիների շնորհիվ դուք բարդ գաղտնաբառեր ստեղծելու կամ հիշելու անհրաժեշտություն չեք ունենա"</string>
+ <string name="passkey_creation_intro_body_fingerprint" msgid="7331338631826254055">"Մուտքի բանալիները գաղտնագրված թվային բանալիներ են, որոնք ստեղծվում են մատնահետքի, դեմքով ապակողպման կամ էկրանի կողպման օգտագործմամբ"</string>
<string name="passkey_creation_intro_body_device" msgid="1203796455762131631">"Դուք կարող եք մուտք գործել այլ սարքերում, քանի որ մուտքի բանալիները պահվում են գաղտնաբառերի կառավարիչում"</string>
<string name="more_about_passkeys_title" msgid="7797903098728837795">"Ավելին՝ մուտքի բանալիների մասին"</string>
<string name="passwordless_technology_title" msgid="2497513482056606668">"Գաղտնաբառեր չպահանջող տեխնոլոգիա"</string>
<string name="passwordless_technology_detail" msgid="6853928846532955882">"Մուտքի բանալիները ձեզ թույլ են տալիս մուտք գործել առանց գաղտնաբառերի։ Ձեզ պարզապես հարկավոր է օգտագործել ձեր մատնահետքը, դիմաճանաչումը, PIN կոդը կամ նախշը՝ ձեր ինքնությունը հաստատելու և մուտքի բանալի ստեղծելու համար։"</string>
<string name="public_key_cryptography_title" msgid="6751970819265298039">"Բաց բանալու կրիպտոգրաֆիա"</string>
- <string name="public_key_cryptography_detail" msgid="6937631710280562213">"Ըստ FIDO դաշինքի (որը ներառում է Google-ը, Apple-ը, Microsoft-ը և այլ ընկերություններ) և W3C ստանդարտների՝ անցաբառերն օգտագործում են կրիպտոգրաֆիկ բանալիների զույգ։ Օգտանվան և գաղտնաբառի փոխարեն հավելվածի կամ կայքի համար մենք ստեղծում ենք բաց-փակ բանալիների զույգ։ Փակ բանալին ապահով պահվում է ձեր սարքում կամ գաղտնաբառերի կառավարիչում և հաստատում է ձեր ինքնությունը։ Բաց բանալին փոխանցվում է հավելվածի կամ կայքի սերվերին։ Համապատասխան բանալիների միջոցով կարող եք ակնթարթորեն գրանցվել և մուտք գործել։"</string>
+ <string name="public_key_cryptography_detail" msgid="6937631710280562213">"Ըստ FIDO դաշինքի (որը ներառում է Google-ը, Apple-ը, Microsoft-ը և այլ ընկերություններ) և W3C ստանդարտների՝ մուտքի բանալիներն օգտագործում են կրիպտոգրաֆիկ բանալիների զույգ։ Օգտանվան և գաղտնաբառի փոխարեն հավելվածի կամ կայքի համար մենք ստեղծում ենք բաց-փակ բանալիների զույգ։ Փակ բանալին ապահով պահվում է ձեր սարքում կամ գաղտնաբառերի կառավարիչում և հաստատում է ձեր ինքնությունը։ Բաց բանալին փոխանցվում է հավելվածի կամ կայքի սերվերին։ Համապատասխան բանալիների միջոցով կարող եք ակնթարթորեն գրանցվել և մուտք գործել։"</string>
<string name="improved_account_security_title" msgid="1069841917893513424">"Հաշվի բարելավված անվտանգություն"</string>
<string name="improved_account_security_detail" msgid="9123750251551844860">"Յուրաքանչյուր բանալի բացառապես կապված է հավելվածի կամ կայքի հետ, որի համար այն ստեղծվել է, ուստի դուք երբեք չեք կարող սխալմամբ մուտք գործել կեղծ հավելված կամ կայք։ Բացի այդ՝ սերվերներում պահվում են միայն բաց բանալիներ, ինչը զգալիորեն դժվարացնում է կոտրումը։"</string>
<string name="seamless_transition_title" msgid="5335622196351371961">"Սահուն անցում"</string>
@@ -61,7 +61,7 @@
<string name="more_options_usage_passwords" msgid="1632047277723187813">"<xliff:g id="PASSWORDSNUMBER">%1$s</xliff:g> գաղտնաբառ"</string>
<string name="more_options_usage_passkeys" msgid="5390320437243042237">"<xliff:g id="PASSKEYSNUMBER">%1$s</xliff:g> մուտքի բանալի"</string>
<string name="more_options_usage_credentials" msgid="1785697001787193984">"Մուտքի տվյալներ (<xliff:g id="TOTALCREDENTIALSNUMBER">%1$s</xliff:g>)"</string>
- <string name="passkey_before_subtitle" msgid="2448119456208647444">"Անցաբառ"</string>
+ <string name="passkey_before_subtitle" msgid="2448119456208647444">"Մուտքի բանալի"</string>
<string name="another_device" msgid="5147276802037801217">"Այլ սարք"</string>
<string name="other_password_manager" msgid="565790221427004141">"Գաղտնաբառերի այլ կառավարիչներ"</string>
<string name="close_sheet" msgid="1393792015338908262">"Փակել թերթը"</string>
diff --git a/packages/CredentialManager/res/values-ka/strings.xml b/packages/CredentialManager/res/values-ka/strings.xml
index 4224da6e70a4..452565cb95a9 100644
--- a/packages/CredentialManager/res/values-ka/strings.xml
+++ b/packages/CredentialManager/res/values-ka/strings.xml
@@ -74,7 +74,7 @@
<string name="get_dialog_description_single_tap" msgid="2797059565126030879">"გამოიყენეთ თქვენი ეკრანის დაბლოკვის ფუნქცია <xliff:g id="APP_NAME">%1$s</xliff:g>-ში <xliff:g id="USERNAME">%2$s</xliff:g>-ით შესასვლელად"</string>
<string name="get_dialog_title_unlock_options_for" msgid="7096423827682163270">"შესვლის ვარიანტების განბლოკვა <xliff:g id="APP_NAME">%1$s</xliff:g>-ისთვის"</string>
<string name="get_dialog_title_choose_passkey_for" msgid="9175997688078538490">"აირჩიეთ შენახული წვდომის გასაღები <xliff:g id="APP_NAME">%1$s</xliff:g>-სთვის"</string>
- <string name="get_dialog_title_choose_password_for" msgid="1724435823820819221">"აირჩიეთ შენახული პაროლი <xliff:g id="APP_NAME">%1$s</xliff:g>-სთვის"</string>
+ <string name="get_dialog_title_choose_password_for" msgid="1724435823820819221">"აირჩიეთ შენახული პაროლი <xliff:g id="APP_NAME">%1$s</xliff:g>-ისთვის"</string>
<string name="get_dialog_title_choose_saved_sign_in_for" msgid="2420298653461652728">"აირჩიეთ სისტემაში შესვლის ინფორმაცია <xliff:g id="APP_NAME">%1$s</xliff:g>-სთვის"</string>
<string name="get_dialog_title_choose_sign_in_for" msgid="645728947702442421">"აირჩიეთ ანგარიში <xliff:g id="APP_NAME">%1$s</xliff:g>-ისთვის"</string>
<string name="get_dialog_title_choose_option_for" msgid="4976380044745029107">"გსურთ აირჩიოთ ვარიანტი <xliff:g id="APP_NAME">%1$s</xliff:g>-ისთვის?"</string>
diff --git a/packages/CredentialManager/res/values-kk/strings.xml b/packages/CredentialManager/res/values-kk/strings.xml
index 2fd31ee90cdd..c3bfc4f09c59 100644
--- a/packages/CredentialManager/res/values-kk/strings.xml
+++ b/packages/CredentialManager/res/values-kk/strings.xml
@@ -90,7 +90,7 @@
<string name="locked_credential_entry_label_subtext_no_sign_in" msgid="8131725029983174901">"Кіру ақпараты жоқ."</string>
<string name="no_sign_in_info_in" msgid="2641118151920288356">"<xliff:g id="SOURCE">%1$s</xliff:g> аккаунтында кіру туралы ешқандай ақпарат жоқ."</string>
<string name="get_dialog_heading_manage_sign_ins" msgid="3522556476480676782">"Кіру әрекеттерін басқару"</string>
- <string name="get_dialog_heading_from_another_device" msgid="1166697017046724072">"Басқа құрылғыдан жасау"</string>
+ <string name="get_dialog_heading_from_another_device" msgid="1166697017046724072">"Басқа құрылғыдан"</string>
<string name="get_dialog_option_headline_use_a_different_device" msgid="8201578814988047549">"Басқа құрылғыны пайдалану"</string>
<string name="request_cancelled_by" msgid="3735222326886267820">"<xliff:g id="APP_NAME">%1$s</xliff:g> қолданбасы сұрауды тоқтатты."</string>
<string name="dropdown_presentation_more_sign_in_options_text" msgid="1693727354272417902">"Кіру опциялары"</string>
diff --git a/packages/CredentialManager/res/values-ne/strings.xml b/packages/CredentialManager/res/values-ne/strings.xml
index 07775e007835..7ac1d1ac4d94 100644
--- a/packages/CredentialManager/res/values-ne/strings.xml
+++ b/packages/CredentialManager/res/values-ne/strings.xml
@@ -91,7 +91,7 @@
<string name="no_sign_in_info_in" msgid="2641118151920288356">"<xliff:g id="SOURCE">%1$s</xliff:g> मा साइन इन गर्नेसम्बन्धी कुनै पनि जानकारी छैन"</string>
<string name="get_dialog_heading_manage_sign_ins" msgid="3522556476480676782">"साइन इनसम्बन्धी विकल्पहरू व्यवस्थापन गर्नुहोस्"</string>
<string name="get_dialog_heading_from_another_device" msgid="1166697017046724072">"अर्को डिभाइसका लागि"</string>
- <string name="get_dialog_option_headline_use_a_different_device" msgid="8201578814988047549">"अर्कै डिभाइस प्रयोग गरी हेर्नुहोस्"</string>
+ <string name="get_dialog_option_headline_use_a_different_device" msgid="8201578814988047549">"अर्कै डिभाइस प्रयोग गर्नुहोस्"</string>
<string name="request_cancelled_by" msgid="3735222326886267820">"<xliff:g id="APP_NAME">%1$s</xliff:g> ले अनुरोध रद्द गरेको छ"</string>
<string name="dropdown_presentation_more_sign_in_options_text" msgid="1693727354272417902">"साइन इनसम्बन्धी विकल्पहरू"</string>
<string name="more_options_content_description" msgid="1323427365788198808">"थप"</string>
diff --git a/packages/CredentialManager/res/values-pt-rPT/strings.xml b/packages/CredentialManager/res/values-pt-rPT/strings.xml
index a3476d927da7..9186c59caaee 100644
--- a/packages/CredentialManager/res/values-pt-rPT/strings.xml
+++ b/packages/CredentialManager/res/values-pt-rPT/strings.xml
@@ -91,7 +91,7 @@
<string name="no_sign_in_info_in" msgid="2641118151920288356">"Sem informações de início de sessão em <xliff:g id="SOURCE">%1$s</xliff:g>"</string>
<string name="get_dialog_heading_manage_sign_ins" msgid="3522556476480676782">"Faça a gestão dos inícios de sessão"</string>
<string name="get_dialog_heading_from_another_device" msgid="1166697017046724072">"De outro dispositivo"</string>
- <string name="get_dialog_option_headline_use_a_different_device" msgid="8201578814988047549">"Use um dispositivo diferente"</string>
+ <string name="get_dialog_option_headline_use_a_different_device" msgid="8201578814988047549">"Use outro diferente"</string>
<string name="request_cancelled_by" msgid="3735222326886267820">"Pedido cancelado pela app <xliff:g id="APP_NAME">%1$s</xliff:g>"</string>
<string name="dropdown_presentation_more_sign_in_options_text" msgid="1693727354272417902">"Opções de início de sessão"</string>
<string name="more_options_content_description" msgid="1323427365788198808">"Mais"</string>
diff --git a/packages/CredentialManager/wear/src/com/android/credentialmanager/ui/mappers/CredentialSelectorUiStateGetMapper.kt b/packages/CredentialManager/wear/src/com/android/credentialmanager/ui/mappers/CredentialSelectorUiStateGetMapper.kt
index 04175335b9db..473094cc1308 100644
--- a/packages/CredentialManager/wear/src/com/android/credentialmanager/ui/mappers/CredentialSelectorUiStateGetMapper.kt
+++ b/packages/CredentialManager/wear/src/com/android/credentialmanager/ui/mappers/CredentialSelectorUiStateGetMapper.kt
@@ -22,6 +22,7 @@ import com.android.credentialmanager.CredentialSelectorUiState
import com.android.credentialmanager.CredentialSelectorUiState.Get.MultipleEntry.PerUserNameEntries
import com.android.credentialmanager.model.CredentialType
import com.android.credentialmanager.model.get.CredentialEntryInfo
+import java.time.Instant
fun Request.Get.toGet(isPrimary: Boolean): CredentialSelectorUiState.Get {
val accounts = providerInfos
@@ -67,4 +68,4 @@ fun Request.Get.toGet(isPrimary: Boolean): CredentialSelectorUiState.Get {
val comparator = compareBy<CredentialEntryInfo> { entryInfo ->
// Passkey type always go first
entryInfo.credentialType.let { if (it == CredentialType.PASSKEY) 0 else 1 }
-}.thenByDescending { it.lastUsedTimeMillis ?: 0 }
+}.thenByDescending { it.lastUsedTimeMillis ?: Instant.EPOCH }
diff --git a/packages/InputDevices/res/raw/keyboard_layout_french_ca.kcm b/packages/InputDevices/res/raw/keyboard_layout_french_ca.kcm
index 03b5c19f8184..723c187d818f 100644
--- a/packages/InputDevices/res/raw/keyboard_layout_french_ca.kcm
+++ b/packages/InputDevices/res/raw/keyboard_layout_french_ca.kcm
@@ -348,13 +348,13 @@ key COMMA {
label: ','
base: ','
shift: '\''
- ralt: '_'
+ ralt: '\u00af'
}
key PERIOD {
label: '.'
base: '.'
- ralt: '-'
+ ralt: '\u00ad'
}
key SLASH {
diff --git a/packages/SystemUI/monet/AndroidManifest.xml b/packages/SettingsLib/SettingsTheme/res/layout-v35/settingslib_preference_category_no_title.xml
index 1fab52877847..eda7daaf7072 100644
--- a/packages/SystemUI/monet/AndroidManifest.xml
+++ b/packages/SettingsLib/SettingsTheme/res/layout-v35/settingslib_preference_category_no_title.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
- Copyright (C) 2021 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.
@@ -14,7 +14,10 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="com.android.systemui.monet">
-</manifest>
+<LinearLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:baselineAligned="false"
+ android:layout_marginTop="16dp">
+</LinearLayout>
diff --git a/packages/SettingsLib/SettingsTheme/res/values-v35/themes.xml b/packages/SettingsLib/SettingsTheme/res/values-v35/themes.xml
index cdd5c2500693..6052be3b52e2 100644
--- a/packages/SettingsLib/SettingsTheme/res/values-v35/themes.xml
+++ b/packages/SettingsLib/SettingsTheme/res/values-v35/themes.xml
@@ -20,7 +20,7 @@
<item name="android:colorAccent">@color/settingslib_materialColorPrimary</item>
<item name="android:colorBackground">@color/settingslib_materialColorSurfaceContainer</item>
<item name="android:textColorPrimary">@color/settingslib_materialColorOnSurface</item>
- <item name="android:textColorSecondary">@color/settingslib_materialColorOnSurfaceVariant</item>
+ <item name="android:textColorSecondary">@color/settingslib_text_color_secondary</item>
<item name="android:textColorTertiary">@color/settingslib_materialColorOutline</item>
</style>
diff --git a/packages/SettingsLib/SpaPrivileged/src/com/android/settingslib/spaprivileged/model/app/AppOpsController.kt b/packages/SettingsLib/SpaPrivileged/src/com/android/settingslib/spaprivileged/model/app/AppOpsController.kt
index 6e9bde45e061..8276e18898c6 100644
--- a/packages/SettingsLib/SpaPrivileged/src/com/android/settingslib/spaprivileged/model/app/AppOpsController.kt
+++ b/packages/SettingsLib/SpaPrivileged/src/com/android/settingslib/spaprivileged/model/app/AppOpsController.kt
@@ -29,36 +29,46 @@ import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.map
interface IAppOpsController {
- val mode: Flow<Int>
+ val modeFlow: Flow<Int>
val isAllowed: Flow<Boolean>
- get() = mode.map { it == MODE_ALLOWED }
+ get() = modeFlow.map { it == MODE_ALLOWED }
fun setAllowed(allowed: Boolean)
@Mode fun getMode(): Int
}
+data class AppOps(
+ val op: Int,
+ val modeForNotAllowed: Int = MODE_ERRORED,
+
+ /**
+ * Use AppOpsManager#setUidMode() instead of AppOpsManager#setMode() when set allowed.
+ *
+ * Security or privacy related app-ops should be set with setUidMode() instead of setMode().
+ */
+ val setModeByUid: Boolean = false,
+)
+
class AppOpsController(
context: Context,
private val app: ApplicationInfo,
- private val op: Int,
- private val modeForNotAllowed: Int = MODE_ERRORED,
- private val setModeByUid: Boolean = false,
+ private val appOps: AppOps,
) : IAppOpsController {
private val appOpsManager = context.appOpsManager
private val packageManager = context.packageManager
- override val mode = appOpsManager.opModeFlow(op, app)
+ override val modeFlow = appOpsManager.opModeFlow(appOps.op, app)
override fun setAllowed(allowed: Boolean) {
- val mode = if (allowed) MODE_ALLOWED else modeForNotAllowed
+ val mode = if (allowed) MODE_ALLOWED else appOps.modeForNotAllowed
- if (setModeByUid) {
- appOpsManager.setUidMode(op, app.uid, mode)
+ if (appOps.setModeByUid) {
+ appOpsManager.setUidMode(appOps.op, app.uid, mode)
} else {
- appOpsManager.setMode(op, app.uid, app.packageName, mode)
+ appOpsManager.setMode(appOps.op, app.uid, app.packageName, mode)
}
- val permission = AppOpsManager.opToPermission(op)
+ val permission = AppOpsManager.opToPermission(appOps.op)
if (permission != null) {
packageManager.updatePermissionFlags(permission, app.packageName,
PackageManager.FLAG_PERMISSION_USER_SET,
@@ -67,5 +77,6 @@ class AppOpsController(
}
}
- @Mode override fun getMode(): Int = appOpsManager.getOpMode(op, app)
+ @Mode
+ override fun getMode(): Int = appOpsManager.getOpMode(appOps.op, app)
}
diff --git a/packages/SettingsLib/SpaPrivileged/src/com/android/settingslib/spaprivileged/model/app/AppOpsPermissionController.kt b/packages/SettingsLib/SpaPrivileged/src/com/android/settingslib/spaprivileged/model/app/AppOpsPermissionController.kt
new file mode 100644
index 000000000000..9350f98841a4
--- /dev/null
+++ b/packages/SettingsLib/SpaPrivileged/src/com/android/settingslib/spaprivileged/model/app/AppOpsPermissionController.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.settingslib.spaprivileged.model.app
+
+import android.app.AppOpsManager
+import android.content.Context
+import android.content.pm.ApplicationInfo
+import android.util.Log
+import kotlinx.coroutines.Dispatchers
+import kotlinx.coroutines.flow.Flow
+import kotlinx.coroutines.flow.conflate
+import kotlinx.coroutines.flow.flowOn
+import kotlinx.coroutines.flow.map
+import kotlinx.coroutines.flow.onEach
+
+interface IAppOpsPermissionController {
+ val isAllowedFlow: Flow<Boolean>
+ fun setAllowed(allowed: Boolean)
+}
+
+class AppOpsPermissionController(
+ context: Context,
+ private val app: ApplicationInfo,
+ appOps: AppOps,
+ private val permission: String,
+ private val packageManagers: IPackageManagers = PackageManagers,
+ private val appOpsController: IAppOpsController = AppOpsController(context, app, appOps),
+) : IAppOpsPermissionController {
+ override val isAllowedFlow: Flow<Boolean> = appOpsController.modeFlow.map { mode ->
+ when (mode) {
+ AppOpsManager.MODE_ALLOWED -> true
+
+ AppOpsManager.MODE_DEFAULT -> {
+ with(packageManagers) { app.hasGrantPermission(permission) }
+ }
+
+ else -> false
+ }
+ }.conflate().onEach { Log.d(TAG, "isAllowed: $it") }.flowOn(Dispatchers.Default)
+
+ override fun setAllowed(allowed: Boolean) {
+ appOpsController.setAllowed(allowed)
+ }
+
+ private companion object {
+ private const val TAG = "AppOpsPermissionControl"
+ }
+}
diff --git a/packages/SettingsLib/SpaPrivileged/src/com/android/settingslib/spaprivileged/template/app/AppOpPermissionAppList.kt b/packages/SettingsLib/SpaPrivileged/src/com/android/settingslib/spaprivileged/template/app/AppOpPermissionAppList.kt
index 5db5eae22745..120b75ecb666 100644
--- a/packages/SettingsLib/SpaPrivileged/src/com/android/settingslib/spaprivileged/template/app/AppOpPermissionAppList.kt
+++ b/packages/SettingsLib/SpaPrivileged/src/com/android/settingslib/spaprivileged/template/app/AppOpPermissionAppList.kt
@@ -20,12 +20,14 @@ import android.app.AppOpsManager
import android.content.Context
import android.content.pm.ApplicationInfo
import androidx.compose.runtime.Composable
+import androidx.compose.runtime.getValue
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import com.android.settingslib.spa.framework.util.asyncMapItem
import com.android.settingslib.spa.framework.util.filterItem
-import com.android.settingslib.spaprivileged.model.app.AppOpsController
+import com.android.settingslib.spaprivileged.model.app.AppOps
+import com.android.settingslib.spaprivileged.model.app.AppOpsPermissionController
import com.android.settingslib.spaprivileged.model.app.AppRecord
-import com.android.settingslib.spaprivileged.model.app.IAppOpsController
+import com.android.settingslib.spaprivileged.model.app.IAppOpsPermissionController
import com.android.settingslib.spaprivileged.model.app.IPackageManagers
import com.android.settingslib.spaprivileged.model.app.PackageManagers
import kotlinx.coroutines.flow.Flow
@@ -36,7 +38,7 @@ data class AppOpPermissionRecord(
override val app: ApplicationInfo,
val hasRequestBroaderPermission: Boolean,
val hasRequestPermission: Boolean,
- var appOpsController: IAppOpsController,
+ var appOpsPermissionController: IAppOpsPermissionController,
) : AppRecord
abstract class AppOpPermissionListModel(
@@ -44,11 +46,11 @@ abstract class AppOpPermissionListModel(
private val packageManagers: IPackageManagers = PackageManagers,
) : TogglePermissionAppListModel<AppOpPermissionRecord> {
- abstract val appOp: Int
+ abstract val appOps: AppOps
abstract val permission: String
override val enhancedConfirmationKey: String?
- get() = AppOpsManager.opToPublicName(appOp)
+ get() = AppOpsManager.opToPublicName(appOps.op)
/**
* When set, specifies the broader permission who trumps the [permission].
@@ -65,27 +67,12 @@ abstract class AppOpPermissionListModel(
*/
open val permissionHasAppOpFlag: Boolean = true
- open val modeForNotAllowed: Int = AppOpsManager.MODE_ERRORED
-
- /**
- * Use AppOpsManager#setUidMode() instead of AppOpsManager#setMode() when set allowed.
- *
- * Security or privacy related app-ops should be set with setUidMode() instead of setMode().
- */
- open val setModeByUid = false
-
/** These not changeable packages will also be hidden from app list. */
private val notChangeablePackages =
setOf("android", "com.android.systemui", context.packageName)
- private fun createAppOpsController(app: ApplicationInfo) =
- AppOpsController(
- context = context,
- app = app,
- op = appOp,
- setModeByUid = setModeByUid,
- modeForNotAllowed = modeForNotAllowed,
- )
+ private fun createAppOpsPermissionController(app: ApplicationInfo) =
+ AppOpsPermissionController(context, app, appOps, permission)
private fun createRecord(
app: ApplicationInfo,
@@ -98,7 +85,7 @@ abstract class AppOpPermissionListModel(
app.hasRequestPermission(it)
} ?: false,
hasRequestPermission = hasRequestPermission,
- appOpsController = createAppOpsController(app),
+ appOpsPermissionController = createAppOpsPermissionController(app),
)
}
@@ -131,14 +118,20 @@ abstract class AppOpPermissionListModel(
override fun filter(userIdFlow: Flow<Int>, recordListFlow: Flow<List<AppOpPermissionRecord>>) =
recordListFlow.filterItem(::isChangeable)
+ /**
+ * Defining the default behavior as permissible as long as the package requested this permission
+ * (This means pre-M gets approval during install time; M apps gets approval during runtime).
+ */
@Composable
- override fun isAllowed(record: AppOpPermissionRecord): () -> Boolean? =
- isAllowed(
- record = record,
- appOpsController = record.appOpsController,
- permission = permission,
- packageManagers = packageManagers,
- )
+ override fun isAllowed(record: AppOpPermissionRecord): () -> Boolean? {
+ if (record.hasRequestBroaderPermission) {
+ // Broader permission trumps the specific permission.
+ return { true }
+ }
+ val isAllowed by record.appOpsPermissionController.isAllowedFlow
+ .collectAsStateWithLifecycle(initialValue = null)
+ return { isAllowed }
+ }
override fun isChangeable(record: AppOpPermissionRecord) =
record.hasRequestPermission &&
@@ -146,36 +139,6 @@ abstract class AppOpPermissionListModel(
record.app.packageName !in notChangeablePackages
override fun setAllowed(record: AppOpPermissionRecord, newAllowed: Boolean) {
- record.appOpsController.setAllowed(newAllowed)
- }
-}
-
-/**
- * Defining the default behavior as permissible as long as the package requested this permission
- * (This means pre-M gets approval during install time; M apps gets approval during runtime).
- */
-@Composable
-internal fun isAllowed(
- record: AppOpPermissionRecord,
- appOpsController: IAppOpsController,
- permission: String,
- packageManagers: IPackageManagers = PackageManagers,
-): () -> Boolean? {
- if (record.hasRequestBroaderPermission) {
- // Broader permission trumps the specific permission.
- return { true }
- }
-
- val mode = appOpsController.mode.collectAsStateWithLifecycle(initialValue = null)
- return {
- when (mode.value) {
- null -> null
- AppOpsManager.MODE_ALLOWED -> true
- AppOpsManager.MODE_DEFAULT -> {
- with(packageManagers) { record.app.hasGrantPermission(permission) }
- }
-
- else -> false
- }
+ record.appOpsPermissionController.setAllowed(newAllowed)
}
}
diff --git a/packages/SettingsLib/SpaPrivileged/tests/src/com/android/settingslib/spaprivileged/model/app/AppOpsControllerTest.kt b/packages/SettingsLib/SpaPrivileged/tests/src/com/android/settingslib/spaprivileged/model/app/AppOpsControllerTest.kt
index 91bbd9f9a5c1..74a7c146b2ab 100644
--- a/packages/SettingsLib/SpaPrivileged/tests/src/com/android/settingslib/spaprivileged/model/app/AppOpsControllerTest.kt
+++ b/packages/SettingsLib/SpaPrivileged/tests/src/com/android/settingslib/spaprivileged/model/app/AppOpsControllerTest.kt
@@ -27,16 +27,14 @@ import androidx.test.core.app.ApplicationProvider
import androidx.test.ext.junit.runners.AndroidJUnit4
import com.android.settingslib.spaprivileged.framework.common.appOpsManager
import com.google.common.truth.Truth.assertThat
-import org.junit.Before
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith
-import org.mockito.Mock
-import org.mockito.Spy
import org.mockito.junit.MockitoJUnit
import org.mockito.junit.MockitoRule
-import org.mockito.kotlin.any
-import org.mockito.kotlin.doNothing
+import org.mockito.kotlin.doReturn
+import org.mockito.kotlin.mock
+import org.mockito.kotlin.spy
import org.mockito.kotlin.verify
import org.mockito.kotlin.whenever
@@ -44,28 +42,18 @@ import org.mockito.kotlin.whenever
class AppOpsControllerTest {
@get:Rule val mockito: MockitoRule = MockitoJUnit.rule()
- @Spy private val context: Context = ApplicationProvider.getApplicationContext()
+ private val appOpsManager = mock<AppOpsManager>()
- @Mock private lateinit var appOpsManager: AppOpsManager
+ private val packageManager = mock<PackageManager>()
- @Mock private lateinit var packageManager: PackageManager
-
- @Before
- fun setUp() {
- whenever(context.appOpsManager).thenReturn(appOpsManager)
- whenever(context.packageManager).thenReturn(packageManager)
- doNothing().whenever(packageManager)
- .updatePermissionFlags(any(), any(), any(), any(), any())
+ private val context: Context = spy(ApplicationProvider.getApplicationContext()) {
+ on { appOpsManager } doReturn appOpsManager
+ on { packageManager } doReturn packageManager
}
@Test
fun setAllowed_setToTrue() {
- val controller =
- AppOpsController(
- context = context,
- app = APP,
- op = OP,
- )
+ val controller = AppOpsController(context = context, app = APP, appOps = AppOps(OP))
controller.setAllowed(true)
@@ -74,12 +62,7 @@ class AppOpsControllerTest {
@Test
fun setAllowed_setToFalse() {
- val controller =
- AppOpsController(
- context = context,
- app = APP,
- op = OP,
- )
+ val controller = AppOpsController(context = context, app = APP, appOps = AppOps(OP))
controller.setAllowed(false)
@@ -88,13 +71,11 @@ class AppOpsControllerTest {
@Test
fun setAllowed_setToFalseWithModeForNotAllowed() {
- val controller =
- AppOpsController(
- context = context,
- app = APP,
- op = OP,
- modeForNotAllowed = MODE_IGNORED,
- )
+ val controller = AppOpsController(
+ context = context,
+ app = APP,
+ appOps = AppOps(op = OP, modeForNotAllowed = MODE_IGNORED),
+ )
controller.setAllowed(false)
@@ -103,13 +84,11 @@ class AppOpsControllerTest {
@Test
fun setAllowed_setToTrueByUid() {
- val controller =
- AppOpsController(
- context = context,
- app = APP,
- op = OP,
- setModeByUid = true,
- )
+ val controller = AppOpsController(
+ context = context,
+ app = APP,
+ appOps = AppOps(op = OP, setModeByUid = true),
+ )
controller.setAllowed(true)
@@ -118,13 +97,11 @@ class AppOpsControllerTest {
@Test
fun setAllowed_setToFalseByUid() {
- val controller =
- AppOpsController(
- context = context,
- app = APP,
- op = OP,
- setModeByUid = true,
- )
+ val controller = AppOpsController(
+ context = context,
+ app = APP,
+ appOps = AppOps(op = OP, setModeByUid = true),
+ )
controller.setAllowed(false)
@@ -135,12 +112,7 @@ class AppOpsControllerTest {
fun getMode() {
whenever(appOpsManager.checkOpNoThrow(OP, APP.uid, APP.packageName))
.thenReturn(MODE_ALLOWED)
- val controller =
- AppOpsController(
- context = context,
- app = APP,
- op = OP,
- )
+ val controller = AppOpsController(context = context, app = APP, appOps = AppOps(OP))
val mode = controller.getMode()
diff --git a/packages/SettingsLib/SpaPrivileged/tests/src/com/android/settingslib/spaprivileged/model/app/AppOpsPermissionControllerTest.kt b/packages/SettingsLib/SpaPrivileged/tests/src/com/android/settingslib/spaprivileged/model/app/AppOpsPermissionControllerTest.kt
new file mode 100644
index 000000000000..9f80b92548d2
--- /dev/null
+++ b/packages/SettingsLib/SpaPrivileged/tests/src/com/android/settingslib/spaprivileged/model/app/AppOpsPermissionControllerTest.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.settingslib.spaprivileged.model.app
+
+import android.app.AppOpsManager
+import android.content.Context
+import android.content.pm.ApplicationInfo
+import android.content.pm.PackageManager
+import androidx.test.core.app.ApplicationProvider
+import androidx.test.ext.junit.runners.AndroidJUnit4
+import com.android.settingslib.spa.testutils.firstWithTimeoutOrNull
+import com.android.settingslib.spaprivileged.framework.common.appOpsManager
+import com.google.common.truth.Truth.assertThat
+import kotlinx.coroutines.flow.flowOf
+import kotlinx.coroutines.runBlocking
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.mockito.kotlin.doReturn
+import org.mockito.kotlin.mock
+import org.mockito.kotlin.spy
+import org.mockito.kotlin.stub
+import org.mockito.kotlin.verify
+
+@RunWith(AndroidJUnit4::class)
+class AppOpsPermissionControllerTest {
+
+ private val appOpsManager = mock<AppOpsManager>()
+ private val packageManager = mock<PackageManager>()
+ private val packageManagers = mock<IPackageManagers>()
+ private val appOpsController = mock<IAppOpsController>()
+
+ private val context: Context = spy(ApplicationProvider.getApplicationContext()) {
+ on { appOpsManager } doReturn appOpsManager
+ on { packageManager } doReturn packageManager
+ }
+
+ @Test
+ fun isAllowedFlow_appOpsAllowed_returnTrue() = runBlocking {
+ appOpsController.stub {
+ on { modeFlow } doReturn flowOf(AppOpsManager.MODE_ALLOWED)
+ }
+ val controller = AppOpsPermissionController(
+ context = context,
+ app = APP,
+ appOps = AppOps(op = OP),
+ permission = PERMISSION,
+ appOpsController = appOpsController,
+ )
+
+ val isAllowed = controller.isAllowedFlow.firstWithTimeoutOrNull()
+
+ assertThat(isAllowed).isTrue()
+ }
+
+ @Test
+ fun isAllowedFlow_appOpsDefaultAndPermissionGranted_returnTrue() = runBlocking {
+ appOpsController.stub {
+ on { modeFlow } doReturn flowOf(AppOpsManager.MODE_DEFAULT)
+ }
+ packageManagers.stub {
+ on { APP.hasGrantPermission(PERMISSION) } doReturn true
+ }
+ val controller = AppOpsPermissionController(
+ context = context,
+ app = APP,
+ appOps = AppOps(op = OP),
+ permission = PERMISSION,
+ packageManagers = packageManagers,
+ appOpsController = appOpsController,
+ )
+
+ val isAllowed = controller.isAllowedFlow.firstWithTimeoutOrNull()
+
+ assertThat(isAllowed).isTrue()
+ }
+
+ @Test
+ fun isAllowedFlow_appOpsDefaultAndPermissionNotGranted_returnFalse() = runBlocking {
+ appOpsController.stub {
+ on { modeFlow } doReturn flowOf(AppOpsManager.MODE_DEFAULT)
+ }
+ packageManagers.stub {
+ on { APP.hasGrantPermission(PERMISSION) } doReturn false
+ }
+ val controller = AppOpsPermissionController(
+ context = context,
+ app = APP,
+ appOps = AppOps(op = OP),
+ permission = PERMISSION,
+ packageManagers = packageManagers,
+ appOpsController = appOpsController,
+ )
+
+ val isAllowed = controller.isAllowedFlow.firstWithTimeoutOrNull()
+
+ assertThat(isAllowed).isFalse()
+ }
+
+ @Test
+ fun isAllowedFlow_appOpsError_returnFalse() = runBlocking {
+ appOpsController.stub {
+ on { modeFlow } doReturn flowOf(AppOpsManager.MODE_ERRORED)
+ }
+ val controller = AppOpsPermissionController(
+ context = context,
+ app = APP,
+ appOps = AppOps(op = OP),
+ permission = PERMISSION,
+ appOpsController = appOpsController,
+ )
+
+ val isAllowed = controller.isAllowedFlow.firstWithTimeoutOrNull()
+
+ assertThat(isAllowed).isFalse()
+ }
+
+ @Test
+ fun setAllowed_notSetModeByUid() {
+ val controller = AppOpsPermissionController(
+ context = context,
+ app = APP,
+ appOps = AppOps(op = OP, setModeByUid = false),
+ permission = PERMISSION,
+ )
+
+ controller.setAllowed(true)
+
+ verify(appOpsManager).setMode(OP, APP.uid, APP.packageName, AppOpsManager.MODE_ALLOWED)
+ }
+
+ @Test
+ fun setAllowed_setModeByUid() {
+ val controller = AppOpsPermissionController(
+ context = context,
+ app = APP,
+ appOps = AppOps(op = OP, setModeByUid = true),
+ permission = PERMISSION,
+ )
+
+ controller.setAllowed(true)
+
+ verify(appOpsManager).setUidMode(OP, APP.uid, AppOpsManager.MODE_ALLOWED)
+ }
+
+ private companion object {
+ const val OP = 1
+ const val PERMISSION = "Permission"
+ val APP = ApplicationInfo().apply {
+ packageName = "package.name"
+ uid = 123
+ }
+ }
+}
diff --git a/packages/SettingsLib/SpaPrivileged/tests/src/com/android/settingslib/spaprivileged/template/app/AppOpPermissionAppListTest.kt b/packages/SettingsLib/SpaPrivileged/tests/src/com/android/settingslib/spaprivileged/template/app/AppOpPermissionAppListTest.kt
index bb25cf3b6d48..9d12fc7611cb 100644
--- a/packages/SettingsLib/SpaPrivileged/tests/src/com/android/settingslib/spaprivileged/template/app/AppOpPermissionAppListTest.kt
+++ b/packages/SettingsLib/SpaPrivileged/tests/src/com/android/settingslib/spaprivileged/template/app/AppOpPermissionAppListTest.kt
@@ -25,7 +25,8 @@ import androidx.test.core.app.ApplicationProvider
import androidx.test.ext.junit.runners.AndroidJUnit4
import com.android.settingslib.spa.testutils.firstWithTimeoutOrNull
import com.android.settingslib.spaprivileged.framework.common.appOpsManager
-import com.android.settingslib.spaprivileged.model.app.IAppOpsController
+import com.android.settingslib.spaprivileged.model.app.AppOps
+import com.android.settingslib.spaprivileged.model.app.IAppOpsPermissionController
import com.android.settingslib.spaprivileged.model.app.IPackageManagers
import com.android.settingslib.spaprivileged.test.R
import com.google.common.truth.Truth.assertThat
@@ -39,7 +40,6 @@ import org.mockito.kotlin.doNothing
import org.mockito.kotlin.doReturn
import org.mockito.kotlin.mock
import org.mockito.kotlin.spy
-import org.mockito.kotlin.verify
import org.mockito.kotlin.whenever
@RunWith(AndroidJUnit4::class)
@@ -119,7 +119,7 @@ class AppOpPermissionAppListTest {
app = APP,
hasRequestBroaderPermission = false,
hasRequestPermission = false,
- appOpsController = FakeAppOpsController(fakeMode = AppOpsManager.MODE_DEFAULT),
+ appOpsPermissionController = FakeAppOpsPermissionController(false),
)
val recordListFlow = listModel.filter(flowOf(USER_ID), flowOf(listOf(record)))
@@ -135,7 +135,7 @@ class AppOpPermissionAppListTest {
app = APP,
hasRequestBroaderPermission = false,
hasRequestPermission = true,
- appOpsController = FakeAppOpsController(fakeMode = AppOpsManager.MODE_ALLOWED),
+ appOpsPermissionController = FakeAppOpsPermissionController(true),
)
val isAllowed = getIsAllowed(record)
@@ -144,38 +144,6 @@ class AppOpPermissionAppListTest {
}
@Test
- fun isAllowed_defaultAndHasGrantPermission() {
- with(packageManagers) { whenever(APP.hasGrantPermission(PERMISSION)).thenReturn(true) }
- val record =
- AppOpPermissionRecord(
- app = APP,
- hasRequestBroaderPermission = false,
- hasRequestPermission = true,
- appOpsController = FakeAppOpsController(fakeMode = AppOpsManager.MODE_DEFAULT),
- )
-
- val isAllowed = getIsAllowed(record)
-
- assertThat(isAllowed).isTrue()
- }
-
- @Test
- fun isAllowed_defaultAndNotGrantPermission() {
- with(packageManagers) { whenever(APP.hasGrantPermission(PERMISSION)).thenReturn(false) }
- val record =
- AppOpPermissionRecord(
- app = APP,
- hasRequestBroaderPermission = false,
- hasRequestPermission = true,
- appOpsController = FakeAppOpsController(fakeMode = AppOpsManager.MODE_DEFAULT),
- )
-
- val isAllowed = getIsAllowed(record)
-
- assertThat(isAllowed).isFalse()
- }
-
- @Test
fun isAllowed_broaderPermissionTrumps() {
listModel.broaderPermission = BROADER_PERMISSION
with(packageManagers) {
@@ -187,7 +155,7 @@ class AppOpPermissionAppListTest {
app = APP,
hasRequestBroaderPermission = true,
hasRequestPermission = false,
- appOpsController = FakeAppOpsController(fakeMode = AppOpsManager.MODE_ERRORED),
+ appOpsPermissionController = FakeAppOpsPermissionController(false),
)
val isAllowed = getIsAllowed(record)
@@ -202,7 +170,7 @@ class AppOpPermissionAppListTest {
app = APP,
hasRequestBroaderPermission = false,
hasRequestPermission = true,
- appOpsController = FakeAppOpsController(fakeMode = AppOpsManager.MODE_ERRORED),
+ appOpsPermissionController = FakeAppOpsPermissionController(false),
)
val isAllowed = getIsAllowed(record)
@@ -217,7 +185,7 @@ class AppOpPermissionAppListTest {
app = APP,
hasRequestBroaderPermission = false,
hasRequestPermission = false,
- appOpsController = FakeAppOpsController(fakeMode = AppOpsManager.MODE_DEFAULT),
+ appOpsPermissionController = FakeAppOpsPermissionController(false),
)
val isChangeable = listModel.isChangeable(record)
@@ -232,7 +200,7 @@ class AppOpPermissionAppListTest {
app = NOT_CHANGEABLE_APP,
hasRequestBroaderPermission = false,
hasRequestPermission = true,
- appOpsController = FakeAppOpsController(fakeMode = AppOpsManager.MODE_DEFAULT),
+ appOpsPermissionController = FakeAppOpsPermissionController(false),
)
val isChangeable = listModel.isChangeable(record)
@@ -247,7 +215,7 @@ class AppOpPermissionAppListTest {
app = APP,
hasRequestBroaderPermission = false,
hasRequestPermission = true,
- appOpsController = FakeAppOpsController(fakeMode = AppOpsManager.MODE_DEFAULT),
+ appOpsPermissionController = FakeAppOpsPermissionController(false),
)
val isChangeable = listModel.isChangeable(record)
@@ -263,7 +231,7 @@ class AppOpPermissionAppListTest {
app = APP,
hasRequestBroaderPermission = true,
hasRequestPermission = true,
- appOpsController = FakeAppOpsController(fakeMode = AppOpsManager.MODE_DEFAULT),
+ appOpsPermissionController = FakeAppOpsPermissionController(false),
)
val isChangeable = listModel.isChangeable(record)
@@ -273,28 +241,18 @@ class AppOpPermissionAppListTest {
@Test
fun setAllowed() {
- val appOpsController = FakeAppOpsController(fakeMode = AppOpsManager.MODE_DEFAULT)
+ val appOpsPermissionController = FakeAppOpsPermissionController(false)
val record =
AppOpPermissionRecord(
app = APP,
hasRequestBroaderPermission = false,
hasRequestPermission = true,
- appOpsController = appOpsController,
+ appOpsPermissionController = appOpsPermissionController,
)
listModel.setAllowed(record = record, newAllowed = true)
- assertThat(appOpsController.setAllowedCalledWith).isTrue()
- }
-
- @Test
- fun setAllowed_setModeByUid() {
- listModel.setModeByUid = true
- val record = listModel.transformItem(APP)
-
- listModel.setAllowed(record = record, newAllowed = true)
-
- verify(appOpsManager).setUidMode(listModel.appOp, APP.uid, AppOpsManager.MODE_ALLOWED)
+ assertThat(appOpsPermissionController.setAllowedCalledWith).isTrue()
}
private fun getIsAllowed(record: AppOpPermissionRecord): Boolean? {
@@ -309,11 +267,9 @@ class AppOpPermissionAppListTest {
override val switchTitleResId = R.string.test_app_op_permission_switch_title
override val footerResId = R.string.test_app_op_permission_footer
- override val appOp = AppOpsManager.OP_MANAGE_MEDIA
+ override val appOps = AppOps(AppOpsManager.OP_MANAGE_MEDIA)
override val permission = PERMISSION
override var broaderPermission: String? = null
-
- override var setModeByUid = false
}
private companion object {
@@ -326,14 +282,12 @@ class AppOpPermissionAppListTest {
}
}
-private class FakeAppOpsController(private val fakeMode: Int) : IAppOpsController {
+private class FakeAppOpsPermissionController(allowed: Boolean) : IAppOpsPermissionController {
var setAllowedCalledWith: Boolean? = null
- override val mode = flowOf(fakeMode)
+ override val isAllowedFlow = flowOf(allowed)
override fun setAllowed(allowed: Boolean) {
setAllowedCalledWith = allowed
}
-
- override fun getMode() = fakeMode
}
diff --git a/packages/SettingsLib/aconfig/settingslib.aconfig b/packages/SettingsLib/aconfig/settingslib.aconfig
index 9c0d29df420f..32557b979bf5 100644
--- a/packages/SettingsLib/aconfig/settingslib.aconfig
+++ b/packages/SettingsLib/aconfig/settingslib.aconfig
@@ -69,3 +69,13 @@ flag {
description: "Allow all widgets on the lock screen by default."
bug: "328261690"
}
+
+flag {
+ name: "enable_determining_advanced_details_header_with_metadata"
+ namespace: "pixel_cross_device_control"
+ description: "Use metadata instead of device type to determine whether a bluetooth device should use advanced details header."
+ bug: "328556903"
+ metadata {
+ purpose: PURPOSE_BUGFIX
+ }
+}
diff --git a/packages/SettingsLib/aconfig/settingslib_media_flag_declarations.aconfig b/packages/SettingsLib/aconfig/settingslib_media_flag_declarations.aconfig
index 7aae1a6b4a59..6f614b372ea6 100644
--- a/packages/SettingsLib/aconfig/settingslib_media_flag_declarations.aconfig
+++ b/packages/SettingsLib/aconfig/settingslib_media_flag_declarations.aconfig
@@ -31,3 +31,14 @@ flag {
purpose: PURPOSE_BUGFIX
}
}
+
+flag {
+ name: "use_playback_info_for_routing_controls"
+ namespace: "media_solutions"
+ description: "Use app-provided playback info when providing media routing information."
+ bug: "333564788"
+ metadata {
+ purpose: PURPOSE_BUGFIX
+ }
+}
+
diff --git a/packages/SettingsLib/res/values/strings.xml b/packages/SettingsLib/res/values/strings.xml
index 4ea746007f76..363045ec1d83 100644
--- a/packages/SettingsLib/res/values/strings.xml
+++ b/packages/SettingsLib/res/values/strings.xml
@@ -214,6 +214,10 @@
<string name="bluetooth_battery_level_untethered_left">Left: <xliff:g id="battery_level_as_percentage" example="25%">%1$s</xliff:g> battery</string>
<!-- Connected devices settings. Message when Bluetooth is connected but not in use, showing remote device battery level for the right part of the untethered headset. [CHAR LIMIT=NONE] -->
<string name="bluetooth_battery_level_untethered_right">Right: <xliff:g id="battery_level_as_percentage" example="25%">%1$s</xliff:g> battery</string>
+ <!-- Connected devices settings. Message when Bluetooth is connected, showing remote device battery level for the left part of the untethered headset. [CHAR LIMIT=NONE] -->
+ <string name="tv_bluetooth_battery_level_untethered_left">Left <xliff:g id="battery_level_as_percentage" example="25%">%1$s</xliff:g></string>
+ <!-- Connected devices settings. Message when Bluetooth is connected, showing remote device battery level for the right part of the untethered headset. [CHAR LIMIT=NONE] -->
+ <string name="tv_bluetooth_battery_level_untethered_right">Right <xliff:g id="battery_level_as_percentage" example="25%">%1$s</xliff:g></string>
<!-- Connected devices settings. Message when Bluetooth is connected and active but no battery information, showing remote device status. [CHAR LIMIT=NONE] -->
<string name="bluetooth_active_no_battery_level">Active</string>
<!-- Connected devices settings. Message shown when bluetooth device is disconnected but is a known, previously connected device [CHAR LIMIT=NONE] -->
diff --git a/packages/SettingsLib/src/com/android/settingslib/bluetooth/BluetoothUtils.java b/packages/SettingsLib/src/com/android/settingslib/bluetooth/BluetoothUtils.java
index 89174125a296..721e7b93fd32 100644
--- a/packages/SettingsLib/src/com/android/settingslib/bluetooth/BluetoothUtils.java
+++ b/packages/SettingsLib/src/com/android/settingslib/bluetooth/BluetoothUtils.java
@@ -276,6 +276,14 @@ public class BluetoothUtils {
if (isUntetheredHeadset(bluetoothDevice)) {
return true;
}
+ if (Flags.enableDeterminingAdvancedDetailsHeaderWithMetadata()) {
+ // A FastPair device that use advanced details header must have METADATA_MAIN_ICON
+ if (getUriMetaData(bluetoothDevice, BluetoothDevice.METADATA_MAIN_ICON) != null) {
+ Log.d(TAG, "isAdvancedDetailsHeader is true with main icon uri");
+ return true;
+ }
+ return false;
+ }
// The metadata is for Android S
String deviceType =
getStringMetaData(bluetoothDevice, BluetoothDevice.METADATA_DEVICE_TYPE);
@@ -302,12 +310,15 @@ public class BluetoothUtils {
if (isUntetheredHeadset(bluetoothDevice)) {
return true;
}
- // The metadata is for Android S
- String deviceType =
- getStringMetaData(bluetoothDevice, BluetoothDevice.METADATA_DEVICE_TYPE);
- if (TextUtils.equals(deviceType, BluetoothDevice.DEVICE_TYPE_UNTETHERED_HEADSET)) {
- Log.d(TAG, "isAdvancedUntetheredDevice: is untethered device ");
- return true;
+ if (!Flags.enableDeterminingAdvancedDetailsHeaderWithMetadata()) {
+ // The METADATA_IS_UNTETHERED_HEADSET of an untethered FastPair headset is always true,
+ // so there's no need to check the device type.
+ String deviceType =
+ getStringMetaData(bluetoothDevice, BluetoothDevice.METADATA_DEVICE_TYPE);
+ if (TextUtils.equals(deviceType, BluetoothDevice.DEVICE_TYPE_UNTETHERED_HEADSET)) {
+ Log.d(TAG, "isAdvancedUntetheredDevice: is untethered device");
+ return true;
+ }
}
return false;
}
diff --git a/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java b/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java
index c2a83b1e772f..0fec61c5affe 100644
--- a/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java
+++ b/packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java
@@ -1532,7 +1532,7 @@ public class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice>
// the left.
if (leftBattery >= 0) {
String left = res.getString(
- R.string.bluetooth_battery_level_untethered_left,
+ R.string.tv_bluetooth_battery_level_untethered_left,
Utils.formatPercentage(leftBattery));
addBatterySpan(spannableBuilder, left, isBatteryLow(leftBattery,
BluetoothDevice.METADATA_UNTETHERED_LEFT_LOW_BATTERY_THRESHOLD),
@@ -1543,7 +1543,7 @@ public class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice>
spannableBuilder.append(" ");
}
String right = res.getString(
- R.string.bluetooth_battery_level_untethered_right,
+ R.string.tv_bluetooth_battery_level_untethered_right,
Utils.formatPercentage(rightBattery));
addBatterySpan(spannableBuilder, right, isBatteryLow(rightBattery,
BluetoothDevice.METADATA_UNTETHERED_RIGHT_LOW_BATTERY_THRESHOLD),
diff --git a/packages/SettingsLib/src/com/android/settingslib/media/InfoMediaManager.java b/packages/SettingsLib/src/com/android/settingslib/media/InfoMediaManager.java
index eae58adb5381..b7758de0e19c 100644
--- a/packages/SettingsLib/src/com/android/settingslib/media/InfoMediaManager.java
+++ b/packages/SettingsLib/src/com/android/settingslib/media/InfoMediaManager.java
@@ -40,6 +40,7 @@ import static android.media.MediaRoute2Info.TYPE_USB_DEVICE;
import static android.media.MediaRoute2Info.TYPE_USB_HEADSET;
import static android.media.MediaRoute2Info.TYPE_WIRED_HEADPHONES;
import static android.media.MediaRoute2Info.TYPE_WIRED_HEADSET;
+import static android.media.session.MediaController.PlaybackInfo;
import static com.android.settingslib.media.LocalMediaManager.MediaDeviceState.STATE_SELECTED;
@@ -51,6 +52,8 @@ import android.content.Context;
import android.media.MediaRoute2Info;
import android.media.RouteListingPreference;
import android.media.RoutingSessionInfo;
+import android.media.session.MediaController;
+import android.media.session.MediaSession;
import android.os.Build;
import android.os.UserHandle;
import android.text.TextUtils;
@@ -135,19 +138,28 @@ public abstract class InfoMediaManager {
@NonNull protected final UserHandle mUserHandle;
private final Collection<MediaDeviceCallback> mCallbacks = new CopyOnWriteArrayList<>();
private MediaDevice mCurrentConnectedDevice;
+ private MediaController mMediaController;
+ private PlaybackInfo mLastKnownPlaybackInfo;
private final LocalBluetoothManager mBluetoothManager;
private final Map<String, RouteListingPreference.Item> mPreferenceItemMap =
new ConcurrentHashMap<>();
+ private final MediaController.Callback mMediaControllerCallback = new MediaControllerCallback();
+
/* package */ InfoMediaManager(
@NonNull Context context,
@NonNull String packageName,
@NonNull UserHandle userHandle,
- @NonNull LocalBluetoothManager localBluetoothManager) {
+ @NonNull LocalBluetoothManager localBluetoothManager,
+ @Nullable MediaController mediaController) {
mContext = context;
mBluetoothManager = localBluetoothManager;
mPackageName = packageName;
mUserHandle = userHandle;
+ mMediaController = mediaController;
+ if (mediaController != null) {
+ mLastKnownPlaybackInfo = mediaController.getPlaybackInfo();
+ }
}
/**
@@ -159,12 +171,19 @@ public abstract class InfoMediaManager {
* speakers, as opposed to app-specific routing (for example, casting to another device).
* @param userHandle The {@link UserHandle} of the user on which the app to control is running,
* or null if the caller does not need app-specific routing (see {@code packageName}).
+ * @param token The token of the associated {@link MediaSession} for which to do media routing.
*/
public static InfoMediaManager createInstance(
Context context,
@Nullable String packageName,
@Nullable UserHandle userHandle,
- LocalBluetoothManager localBluetoothManager) {
+ LocalBluetoothManager localBluetoothManager,
+ @Nullable MediaSession.Token token) {
+ MediaController mediaController = null;
+
+ if (Flags.usePlaybackInfoForRoutingControls() && token != null) {
+ mediaController = new MediaController(context, token);
+ }
// The caller is only interested in system routes (headsets, built-in speakers, etc), and is
// not interested in a specific app's routing. The media routing APIs still require a
@@ -180,16 +199,16 @@ public abstract class InfoMediaManager {
if (Flags.useMediaRouter2ForInfoMediaManager()) {
try {
return new RouterInfoMediaManager(
- context, packageName, userHandle, localBluetoothManager);
+ context, packageName, userHandle, localBluetoothManager, mediaController);
} catch (PackageNotAvailableException ex) {
// TODO: b/293578081 - Propagate this exception to callers for proper handling.
Log.w(TAG, "Returning a no-op InfoMediaManager for package " + packageName);
return new NoOpInfoMediaManager(
- context, packageName, userHandle, localBluetoothManager);
+ context, packageName, userHandle, localBluetoothManager, mediaController);
}
} else {
return new ManagerInfoMediaManager(
- context, packageName, userHandle, localBluetoothManager);
+ context, packageName, userHandle, localBluetoothManager, mediaController);
}
}
@@ -310,6 +329,9 @@ public abstract class InfoMediaManager {
if (wasEmpty) {
mMediaDevices.clear();
registerRouter();
+ if (mMediaController != null) {
+ mMediaController.registerCallback(mMediaControllerCallback);
+ }
updateRouteListingPreference();
refreshDevices();
}
@@ -323,6 +345,9 @@ public abstract class InfoMediaManager {
*/
public final void unregisterCallback(@NonNull MediaDeviceCallback callback) {
if (mCallbacks.remove(callback) && mCallbacks.isEmpty()) {
+ if (mMediaController != null) {
+ mMediaController.unregisterCallback(mMediaControllerCallback);
+ }
unregisterRouter();
}
}
@@ -389,7 +414,34 @@ public abstract class InfoMediaManager {
private RoutingSessionInfo getActiveRoutingSession() {
// List is never empty.
final List<RoutingSessionInfo> sessions = getRoutingSessionsForPackage();
- return sessions.get(sessions.size() - 1);
+ RoutingSessionInfo activeSession = sessions.get(sessions.size() - 1);
+
+ // Logic from MediaRouter2Manager#getRoutingSessionForMediaController
+ if (!Flags.usePlaybackInfoForRoutingControls() || mMediaController == null) {
+ return activeSession;
+ }
+
+ PlaybackInfo playbackInfo = mMediaController.getPlaybackInfo();
+ if (playbackInfo.getPlaybackType() == PlaybackInfo.PLAYBACK_TYPE_LOCAL) {
+ // Return system session.
+ return sessions.get(0);
+ }
+
+ // For PLAYBACK_TYPE_REMOTE.
+ String volumeControlId = playbackInfo.getVolumeControlId();
+ for (RoutingSessionInfo session : sessions) {
+ if (TextUtils.equals(volumeControlId, session.getId())) {
+ return session;
+ }
+ // Workaround for provider not being able to know the unique session ID.
+ if (TextUtils.equals(volumeControlId, session.getOriginalId())
+ && TextUtils.equals(
+ mMediaController.getPackageName(), session.getOwnerPackageName())) {
+ return session;
+ }
+ }
+
+ return activeSession;
}
boolean isRoutingSessionAvailableForVolumeControl() {
@@ -808,4 +860,23 @@ public abstract class InfoMediaManager {
}
}
}
+
+ private final class MediaControllerCallback extends MediaController.Callback {
+ @Override
+ public void onSessionDestroyed() {
+ mMediaController = null;
+ refreshDevices();
+ }
+
+ @Override
+ public void onAudioInfoChanged(@NonNull PlaybackInfo info) {
+ if (info.getPlaybackType() != mLastKnownPlaybackInfo.getPlaybackType()
+ || !TextUtils.equals(
+ info.getVolumeControlId(),
+ mLastKnownPlaybackInfo.getVolumeControlId())) {
+ refreshDevices();
+ }
+ mLastKnownPlaybackInfo = info;
+ }
+ }
}
diff --git a/packages/SettingsLib/src/com/android/settingslib/media/LocalMediaManager.java b/packages/SettingsLib/src/com/android/settingslib/media/LocalMediaManager.java
index 473c62704b8b..cfa825bbb1c4 100644
--- a/packages/SettingsLib/src/com/android/settingslib/media/LocalMediaManager.java
+++ b/packages/SettingsLib/src/com/android/settingslib/media/LocalMediaManager.java
@@ -149,7 +149,11 @@ public class LocalMediaManager implements BluetoothCallback {
// TODO: b/321969740 - Take the userHandle as a parameter and pass it through. The
// package name is not sufficient to unambiguously identify an app.
InfoMediaManager.createInstance(
- context, packageName, /* userHandle */ null, mLocalBluetoothManager);
+ context,
+ packageName,
+ /* userHandle */ null,
+ mLocalBluetoothManager,
+ /* token */ null);
}
/**
diff --git a/packages/SettingsLib/src/com/android/settingslib/media/ManagerInfoMediaManager.java b/packages/SettingsLib/src/com/android/settingslib/media/ManagerInfoMediaManager.java
index d621751a2c29..82b197682459 100644
--- a/packages/SettingsLib/src/com/android/settingslib/media/ManagerInfoMediaManager.java
+++ b/packages/SettingsLib/src/com/android/settingslib/media/ManagerInfoMediaManager.java
@@ -21,6 +21,7 @@ import android.media.MediaRoute2Info;
import android.media.MediaRouter2Manager;
import android.media.RouteListingPreference;
import android.media.RoutingSessionInfo;
+import android.media.session.MediaController;
import android.os.UserHandle;
import android.text.TextUtils;
import android.util.Log;
@@ -55,8 +56,9 @@ public class ManagerInfoMediaManager extends InfoMediaManager {
Context context,
@NonNull String packageName,
@NonNull UserHandle userHandle,
- LocalBluetoothManager localBluetoothManager) {
- super(context, packageName, userHandle, localBluetoothManager);
+ LocalBluetoothManager localBluetoothManager,
+ @Nullable MediaController mediaController) {
+ super(context, packageName, userHandle, localBluetoothManager, mediaController);
mRouterManager = MediaRouter2Manager.getInstance(context);
}
diff --git a/packages/SettingsLib/src/com/android/settingslib/media/NoOpInfoMediaManager.java b/packages/SettingsLib/src/com/android/settingslib/media/NoOpInfoMediaManager.java
index d2b018cd2299..2c7ec9302117 100644
--- a/packages/SettingsLib/src/com/android/settingslib/media/NoOpInfoMediaManager.java
+++ b/packages/SettingsLib/src/com/android/settingslib/media/NoOpInfoMediaManager.java
@@ -20,6 +20,7 @@ import android.content.Context;
import android.media.MediaRoute2Info;
import android.media.RouteListingPreference;
import android.media.RoutingSessionInfo;
+import android.media.session.MediaController;
import android.os.UserHandle;
import androidx.annotation.NonNull;
@@ -60,8 +61,9 @@ import java.util.List;
Context context,
@NonNull String packageName,
@NonNull UserHandle userHandle,
- LocalBluetoothManager localBluetoothManager) {
- super(context, packageName, userHandle, localBluetoothManager);
+ LocalBluetoothManager localBluetoothManager,
+ @Nullable MediaController mediaController) {
+ super(context, packageName, userHandle, localBluetoothManager, mediaController);
}
@Override
diff --git a/packages/SettingsLib/src/com/android/settingslib/media/RouterInfoMediaManager.java b/packages/SettingsLib/src/com/android/settingslib/media/RouterInfoMediaManager.java
index 045c60dd1514..6571dd7ba398 100644
--- a/packages/SettingsLib/src/com/android/settingslib/media/RouterInfoMediaManager.java
+++ b/packages/SettingsLib/src/com/android/settingslib/media/RouterInfoMediaManager.java
@@ -25,6 +25,7 @@ import android.media.MediaRouter2Manager;
import android.media.RouteDiscoveryPreference;
import android.media.RouteListingPreference;
import android.media.RoutingSessionInfo;
+import android.media.session.MediaController;
import android.os.UserHandle;
import android.text.TextUtils;
@@ -71,9 +72,10 @@ public final class RouterInfoMediaManager extends InfoMediaManager {
Context context,
@NonNull String packageName,
@NonNull UserHandle userHandle,
- LocalBluetoothManager localBluetoothManager)
+ LocalBluetoothManager localBluetoothManager,
+ @Nullable MediaController mediaController)
throws PackageNotAvailableException {
- super(context, packageName, userHandle, localBluetoothManager);
+ super(context, packageName, userHandle, localBluetoothManager, mediaController);
MediaRouter2 router = null;
diff --git a/packages/SettingsLib/src/com/android/settingslib/volume/MediaSessions.java b/packages/SettingsLib/src/com/android/settingslib/volume/MediaSessions.java
index 23b2cc2df794..89f3cf5e9aab 100644
--- a/packages/SettingsLib/src/com/android/settingslib/volume/MediaSessions.java
+++ b/packages/SettingsLib/src/com/android/settingslib/volume/MediaSessions.java
@@ -278,7 +278,7 @@ public class MediaSessions {
}
@Override
- public void onAudioInfoChanged(PlaybackInfo info) {
+ public void onAudioInfoChanged(@NonNull PlaybackInfo info) {
if (D.BUG) {
Log.d(TAG, cb("onAudioInfoChanged") + Util.playbackInfoToString(info)
+ " sentRemote=" + sentRemote);
diff --git a/packages/SettingsLib/src/com/android/settingslib/volume/data/repository/AudioRepository.kt b/packages/SettingsLib/src/com/android/settingslib/volume/data/repository/AudioRepository.kt
index 36e396fb0c4f..3b8433316b5d 100644
--- a/packages/SettingsLib/src/com/android/settingslib/volume/data/repository/AudioRepository.kt
+++ b/packages/SettingsLib/src/com/android/settingslib/volume/data/repository/AudioRepository.kt
@@ -79,8 +79,6 @@ interface AudioRepository {
suspend fun setMuted(audioStream: AudioStream, isMuted: Boolean): Boolean
suspend fun setRingerMode(audioStream: AudioStream, mode: RingerMode)
-
- suspend fun isAffectedByMute(audioStream: AudioStream): Boolean
}
class AudioRepositoryImpl(
@@ -152,8 +150,9 @@ class AudioRepositoryImpl(
minVolume = getMinVolume(audioStream),
maxVolume = audioManager.getStreamMaxVolume(audioStream.value),
volume = audioManager.getStreamVolume(audioStream.value),
+ isAffectedByMute = audioManager.isStreamAffectedByMute(audioStream.value),
isAffectedByRingerMode = audioManager.isStreamAffectedByRingerMode(audioStream.value),
- isMuted = audioManager.isStreamMute(audioStream.value)
+ isMuted = audioManager.isStreamMute(audioStream.value),
)
}
@@ -187,12 +186,6 @@ class AudioRepositoryImpl(
withContext(backgroundCoroutineContext) { audioManager.ringerMode = mode.value }
}
- override suspend fun isAffectedByMute(audioStream: AudioStream): Boolean {
- return withContext(backgroundCoroutineContext) {
- audioManager.isStreamAffectedByMute(audioStream.value)
- }
- }
-
private fun getMinVolume(stream: AudioStream): Int =
try {
audioManager.getStreamMinVolume(stream.value)
diff --git a/packages/SettingsLib/src/com/android/settingslib/volume/domain/interactor/AudioVolumeInteractor.kt b/packages/SettingsLib/src/com/android/settingslib/volume/domain/interactor/AudioVolumeInteractor.kt
index 0e5ebdae96e4..202ff400782f 100644
--- a/packages/SettingsLib/src/com/android/settingslib/volume/domain/interactor/AudioVolumeInteractor.kt
+++ b/packages/SettingsLib/src/com/android/settingslib/volume/domain/interactor/AudioVolumeInteractor.kt
@@ -50,11 +50,13 @@ class AudioVolumeInteractor(
suspend fun setVolume(audioStream: AudioStream, volume: Int) {
val streamModel = getAudioStream(audioStream).first()
val oldVolume = streamModel.volume
- audioRepository.setVolume(audioStream, volume)
- when {
- volume == streamModel.minVolume -> setMuted(audioStream, true)
- oldVolume == streamModel.minVolume && volume > streamModel.minVolume ->
- setMuted(audioStream, false)
+ if (volume != oldVolume) {
+ audioRepository.setVolume(audioStream, volume)
+ when {
+ volume == streamModel.minVolume -> setMuted(audioStream, true)
+ oldVolume == streamModel.minVolume && volume > streamModel.minVolume ->
+ setMuted(audioStream, false)
+ }
}
}
@@ -90,9 +92,6 @@ class AudioVolumeInteractor(
}
}
- suspend fun isAffectedByMute(audioStream: AudioStream): Boolean =
- audioRepository.isAffectedByMute(audioStream)
-
private suspend fun processVolume(
audioStreamModel: AudioStreamModel,
ringerMode: RingerMode,
diff --git a/packages/SettingsLib/src/com/android/settingslib/volume/shared/model/AudioStreamModel.kt b/packages/SettingsLib/src/com/android/settingslib/volume/shared/model/AudioStreamModel.kt
index c1be1ee020f2..2c26af1050cf 100644
--- a/packages/SettingsLib/src/com/android/settingslib/volume/shared/model/AudioStreamModel.kt
+++ b/packages/SettingsLib/src/com/android/settingslib/volume/shared/model/AudioStreamModel.kt
@@ -22,6 +22,7 @@ data class AudioStreamModel(
val volume: Int,
val minVolume: Int,
val maxVolume: Int,
+ val isAffectedByMute: Boolean,
val isAffectedByRingerMode: Boolean,
val isMuted: Boolean,
)
diff --git a/packages/SettingsLib/tests/integ/src/com/android/settingslib/media/InfoMediaManagerIntegTest.java b/packages/SettingsLib/tests/integ/src/com/android/settingslib/media/InfoMediaManagerIntegTest.java
index 3bd37a2c59bf..a2ee2ec9185e 100644
--- a/packages/SettingsLib/tests/integ/src/com/android/settingslib/media/InfoMediaManagerIntegTest.java
+++ b/packages/SettingsLib/tests/integ/src/com/android/settingslib/media/InfoMediaManagerIntegTest.java
@@ -65,7 +65,7 @@ public class InfoMediaManagerIntegTest {
public void createInstance_withMR2FlagOn_returnsRouterInfoMediaManager() {
InfoMediaManager manager =
InfoMediaManager.createInstance(
- mContext, mContext.getPackageName(), mContext.getUser(), null);
+ mContext, mContext.getPackageName(), mContext.getUser(), null, null);
assertThat(manager).isInstanceOf(RouterInfoMediaManager.class);
}
@@ -73,14 +73,15 @@ public class InfoMediaManagerIntegTest {
@RequiresFlagsEnabled(FLAG_USE_MEDIA_ROUTER2_FOR_INFO_MEDIA_MANAGER)
public void createInstance_withMR2FlagOn_withFakePackage_returnsNoOpInfoMediaManager() {
InfoMediaManager manager =
- InfoMediaManager.createInstance(mContext, FAKE_PACKAGE, null, null);
+ InfoMediaManager.createInstance(mContext, FAKE_PACKAGE, null, null, null);
assertThat(manager).isInstanceOf(NoOpInfoMediaManager.class);
}
@Test
@RequiresFlagsEnabled(FLAG_USE_MEDIA_ROUTER2_FOR_INFO_MEDIA_MANAGER)
public void createInstance_withMR2FlagOn_withNullPackage_returnsRouterInfoMediaManager() {
- InfoMediaManager manager = InfoMediaManager.createInstance(mContext, null, null, null);
+ InfoMediaManager manager =
+ InfoMediaManager.createInstance(mContext, null, null, null, null);
assertThat(manager).isInstanceOf(RouterInfoMediaManager.class);
}
@@ -89,7 +90,7 @@ public class InfoMediaManagerIntegTest {
public void createInstance_withMR2FlagOff_returnsManagerInfoMediaManager() {
InfoMediaManager manager =
InfoMediaManager.createInstance(
- mContext, mContext.getPackageName(), mContext.getUser(), null);
+ mContext, mContext.getPackageName(), mContext.getUser(), null, null);
assertThat(manager).isInstanceOf(ManagerInfoMediaManager.class);
}
}
diff --git a/packages/SettingsLib/tests/integ/src/com/android/settingslib/volume/data/repository/AudioRepositoryTest.kt b/packages/SettingsLib/tests/integ/src/com/android/settingslib/volume/data/repository/AudioRepositoryTest.kt
index 9860cd827fe7..870068087058 100644
--- a/packages/SettingsLib/tests/integ/src/com/android/settingslib/volume/data/repository/AudioRepositoryTest.kt
+++ b/packages/SettingsLib/tests/integ/src/com/android/settingslib/volume/data/repository/AudioRepositoryTest.kt
@@ -173,6 +173,7 @@ class AudioRepositoryTest {
volume = 50,
minVolume = MIN_VOLUME,
maxVolume = MAX_VOLUME,
+ isAffectedByMute = false,
isAffectedByRingerMode = false,
isMuted = false,
)
@@ -201,6 +202,7 @@ class AudioRepositoryTest {
volume = 0,
minVolume = MIN_VOLUME,
maxVolume = MAX_VOLUME,
+ isAffectedByMute = false,
isAffectedByRingerMode = false,
isMuted = true,
)
@@ -230,6 +232,7 @@ class AudioRepositoryTest {
volume = 0,
minVolume = MIN_VOLUME,
maxVolume = MAX_VOLUME,
+ isAffectedByMute = false,
isAffectedByRingerMode = false,
isMuted = false,
)
diff --git a/packages/SettingsLib/tests/robotests/src/com/android/settingslib/bluetooth/BluetoothUtilsTest.java b/packages/SettingsLib/tests/robotests/src/com/android/settingslib/bluetooth/BluetoothUtilsTest.java
index 7a2818dbf299..a638df524740 100644
--- a/packages/SettingsLib/tests/robotests/src/com/android/settingslib/bluetooth/BluetoothUtilsTest.java
+++ b/packages/SettingsLib/tests/robotests/src/com/android/settingslib/bluetooth/BluetoothUtilsTest.java
@@ -15,6 +15,8 @@
*/
package com.android.settingslib.bluetooth;
+import static com.android.settingslib.flags.Flags.FLAG_ENABLE_DETERMINING_ADVANCED_DETAILS_HEADER_WITH_METADATA;
+
import static com.google.common.truth.Truth.assertThat;
import static org.mockito.ArgumentMatchers.any;
@@ -33,11 +35,13 @@ import android.content.pm.PackageManager;
import android.graphics.drawable.Drawable;
import android.media.AudioManager;
import android.net.Uri;
+import android.platform.test.flag.junit.SetFlagsRule;
import android.util.Pair;
import com.android.settingslib.widget.AdaptiveIcon;
import org.junit.Before;
+import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Answers;
@@ -83,11 +87,15 @@ public class BluetoothUtilsTest {
private static final String TEST_EXCLUSIVE_MANAGER_PACKAGE = "com.test.manager";
private static final String TEST_EXCLUSIVE_MANAGER_COMPONENT = "com.test.manager/.component";
+ @Rule
+ public final SetFlagsRule mSetFlagsRule = new SetFlagsRule();
+
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
mContext = spy(RuntimeEnvironment.application);
+ mSetFlagsRule.disableFlags(FLAG_ENABLE_DETERMINING_ADVANCED_DETAILS_HEADER_WITH_METADATA);
when(mLocalBluetoothManager.getProfileManager()).thenReturn(mProfileManager);
when(mProfileManager.getLeAudioBroadcastProfile()).thenReturn(mBroadcast);
when(mProfileManager.getLeAudioBroadcastAssistantProfile()).thenReturn(mAssistant);
@@ -253,6 +261,25 @@ public class BluetoothUtilsTest {
}
@Test
+ public void isAdvancedDetailsHeader_noMainIcon_returnFalse() {
+ mSetFlagsRule.enableFlags(FLAG_ENABLE_DETERMINING_ADVANCED_DETAILS_HEADER_WITH_METADATA);
+
+ when(mBluetoothDevice.getMetadata(BluetoothDevice.METADATA_MAIN_ICON)).thenReturn(null);
+
+ assertThat(BluetoothUtils.isAdvancedDetailsHeader(mBluetoothDevice)).isFalse();
+ }
+
+ @Test
+ public void isAdvancedDetailsHeader_hasMainIcon_returnTrue() {
+ mSetFlagsRule.enableFlags(FLAG_ENABLE_DETERMINING_ADVANCED_DETAILS_HEADER_WITH_METADATA);
+
+ when(mBluetoothDevice.getMetadata(BluetoothDevice.METADATA_MAIN_ICON))
+ .thenReturn(STRING_METADATA.getBytes());
+
+ assertThat(BluetoothUtils.isAdvancedDetailsHeader(mBluetoothDevice)).isTrue();
+ }
+
+ @Test
public void isAdvancedUntetheredDevice_untetheredHeadset_returnTrue() {
when(mBluetoothDevice.getMetadata(
BluetoothDevice.METADATA_IS_UNTETHERED_HEADSET)).thenReturn(
@@ -294,6 +321,18 @@ public class BluetoothUtilsTest {
}
@Test
+ public void isAdvancedUntetheredDevice_untetheredHeadsetMetadataIsFalse_returnFalse() {
+ mSetFlagsRule.enableFlags(FLAG_ENABLE_DETERMINING_ADVANCED_DETAILS_HEADER_WITH_METADATA);
+
+ when(mBluetoothDevice.getMetadata(BluetoothDevice.METADATA_IS_UNTETHERED_HEADSET))
+ .thenReturn("false".getBytes());
+ when(mBluetoothDevice.getMetadata(BluetoothDevice.METADATA_DEVICE_TYPE))
+ .thenReturn(BluetoothDevice.DEVICE_TYPE_UNTETHERED_HEADSET.getBytes());
+
+ assertThat(BluetoothUtils.isAdvancedUntetheredDevice(mBluetoothDevice)).isFalse();
+ }
+
+ @Test
public void isAvailableMediaBluetoothDevice_isConnectedLeAudioDevice_returnTrue() {
when(mCachedBluetoothDevice.isConnectedLeAudioDevice()).thenReturn(true);
when(mCachedBluetoothDevice.getDevice()).thenReturn(mBluetoothDevice);
diff --git a/packages/SettingsLib/tests/robotests/src/com/android/settingslib/bluetooth/CachedBluetoothDeviceTest.java b/packages/SettingsLib/tests/robotests/src/com/android/settingslib/bluetooth/CachedBluetoothDeviceTest.java
index b9bf9caddac7..0d814947527c 100644
--- a/packages/SettingsLib/tests/robotests/src/com/android/settingslib/bluetooth/CachedBluetoothDeviceTest.java
+++ b/packages/SettingsLib/tests/robotests/src/com/android/settingslib/bluetooth/CachedBluetoothDeviceTest.java
@@ -780,9 +780,8 @@ public class CachedBluetoothDeviceTest {
mBatteryLevel = 10;
// Act & Assert:
- // Get "Left: 10% battery" result with Battery Level 10.
- assertThat(mCachedDevice.getTvConnectionSummary().toString()).isEqualTo(
- "Left: 10% battery");
+ // Get "Left 10%" result with Battery Level 10.
+ assertThat(mCachedDevice.getTvConnectionSummary().toString()).isEqualTo("Left 10%");
}
@Test
@@ -815,9 +814,9 @@ public class CachedBluetoothDeviceTest {
mBatteryLevel = 10;
// Act & Assert:
- // Get "Left: 10% battery" result with Battery Level 10.
+ // Get "Left 10%" result with Battery Level 10.
assertThat(mCachedDevice.getTvConnectionSummary().toString()).isEqualTo(
- "Left: 10% battery");
+ "Left 10%");
}
@Test
@@ -925,9 +924,9 @@ public class CachedBluetoothDeviceTest {
mBatteryLevel = 10;
// Act & Assert:
- // Get "Left: 10% battery Right: 10% battery" result with Battery Level 10.
+ // Get "Left 10% Right 10%" result with Battery Level 10.
assertThat(mCachedDevice.getTvConnectionSummary().toString())
- .isEqualTo("Left: 10% battery Right: 10% battery");
+ .isEqualTo("Left 10% Right 10%");
}
@Test
@@ -1226,7 +1225,7 @@ public class CachedBluetoothDeviceTest {
TWS_BATTERY_RIGHT.getBytes());
assertThat(mCachedDevice.getTvConnectionSummary().toString()).isEqualTo(
- "Left: 15% battery Right: 25% battery");
+ "Left 15% Right 25%");
}
@Test
@@ -1262,11 +1261,7 @@ public class CachedBluetoothDeviceTest {
TWS_BATTERY_RIGHT.getBytes());
assertThat(mCachedDevice.getTvConnectionSummary().toString())
- .isEqualTo(
- mContext.getString(R.string.bluetooth_battery_level_untethered_left, "15%")
- + " "
- + mContext.getString(
- R.string.bluetooth_battery_level_untethered_right, "25%"));
+ .isEqualTo("Left 15% Right 25%");
}
@Test
@@ -1283,10 +1278,8 @@ public class CachedBluetoothDeviceTest {
.thenReturn(TWS_BATTERY_RIGHT.getBytes());
int lowBatteryColor = mContext.getColor(LOW_BATTERY_COLOR);
- String leftBattery =
- mContext.getString(R.string.bluetooth_battery_level_untethered_left, "15%");
- String rightBattery =
- mContext.getString(R.string.bluetooth_battery_level_untethered_right, "25%");
+ String leftBattery = "Left 15%";
+ String rightBattery = "Right 25%";
// Default low battery threshold, only left battery is low
CharSequence summary = mCachedDevice.getTvConnectionSummary(LOW_BATTERY_COLOR);
diff --git a/packages/SettingsLib/tests/robotests/src/com/android/settingslib/media/InfoMediaManagerTest.java b/packages/SettingsLib/tests/robotests/src/com/android/settingslib/media/InfoMediaManagerTest.java
index 69faddf48f19..ce07fe9fdf0a 100644
--- a/packages/SettingsLib/tests/robotests/src/com/android/settingslib/media/InfoMediaManagerTest.java
+++ b/packages/SettingsLib/tests/robotests/src/com/android/settingslib/media/InfoMediaManagerTest.java
@@ -146,7 +146,11 @@ public class InfoMediaManagerTest {
Context.MEDIA_SESSION_SERVICE);
mInfoMediaManager =
new ManagerInfoMediaManager(
- mContext, TEST_PACKAGE_NAME, mContext.getUser(), mLocalBluetoothManager);
+ mContext,
+ TEST_PACKAGE_NAME,
+ mContext.getUser(),
+ mLocalBluetoothManager,
+ /* mediaController */ null);
mShadowRouter2Manager = ShadowRouter2Manager.getShadow();
mInfoMediaManager.mRouterManager = MediaRouter2Manager.getInstance(mContext);
}
diff --git a/packages/SettingsLib/tests/robotests/src/com/android/settingslib/media/LocalMediaManagerTest.java b/packages/SettingsLib/tests/robotests/src/com/android/settingslib/media/LocalMediaManagerTest.java
index ddb5419509d7..12541bb51cc8 100644
--- a/packages/SettingsLib/tests/robotests/src/com/android/settingslib/media/LocalMediaManagerTest.java
+++ b/packages/SettingsLib/tests/robotests/src/com/android/settingslib/media/LocalMediaManagerTest.java
@@ -117,9 +117,16 @@ public class LocalMediaManagerTest {
when(mLocalProfileManager.getHearingAidProfile()).thenReturn(mHapProfile);
// Need to call constructor to initialize final fields.
- mInfoMediaManager = mock(
- InfoMediaManager.class,
- withSettings().useConstructor(mContext, TEST_PACKAGE_NAME, mLocalBluetoothManager));
+ mInfoMediaManager =
+ mock(
+ InfoMediaManager.class,
+ withSettings()
+ .useConstructor(
+ mContext,
+ TEST_PACKAGE_NAME,
+ android.os.Process.myUserHandle(),
+ mLocalBluetoothManager,
+ /* mediaController */ null));
doReturn(
List.of(
new RoutingSessionInfo.Builder(TEST_SESSION_ID, TEST_PACKAGE_NAME)
diff --git a/packages/SettingsLib/tests/robotests/src/com/android/settingslib/media/NoOpInfoMediaManagerTest.java b/packages/SettingsLib/tests/robotests/src/com/android/settingslib/media/NoOpInfoMediaManagerTest.java
index 908f50deea78..c566741d19fc 100644
--- a/packages/SettingsLib/tests/robotests/src/com/android/settingslib/media/NoOpInfoMediaManagerTest.java
+++ b/packages/SettingsLib/tests/robotests/src/com/android/settingslib/media/NoOpInfoMediaManagerTest.java
@@ -47,7 +47,8 @@ public class NoOpInfoMediaManagerTest {
mContext,
/* packageName */ "FAKE_PACKAGE_NAME",
mContext.getUser(),
- /* localBluetoothManager */ null);
+ /* localBluetoothManager */ null,
+ /* mediaController */ null);
}
@Test
diff --git a/packages/SettingsProvider/src/android/provider/settings/backup/GlobalSettings.java b/packages/SettingsProvider/src/android/provider/settings/backup/GlobalSettings.java
index 8f8445d7a40b..63e98de6826b 100644
--- a/packages/SettingsProvider/src/android/provider/settings/backup/GlobalSettings.java
+++ b/packages/SettingsProvider/src/android/provider/settings/backup/GlobalSettings.java
@@ -38,6 +38,8 @@ public class GlobalSettings {
* NOTE: All settings which are backed up should have a corresponding validator.
*/
public static final String[] SETTINGS_TO_BACKUP = {
+ Settings.Global.CONNECTED_APPS_ALLOWED_PACKAGES,
+ Settings.Global.CONNECTED_APPS_DISALLOWED_PACKAGES,
Settings.Global.APPLY_RAMPING_RINGER,
Settings.Global.BUGREPORT_IN_POWER_MENU, // moved to secure
Settings.Global.STAY_ON_WHILE_PLUGGED_IN,
diff --git a/packages/SettingsProvider/src/android/provider/settings/validators/GlobalSettingsValidators.java b/packages/SettingsProvider/src/android/provider/settings/validators/GlobalSettingsValidators.java
index c274534c8d36..bc0ee7fea6ef 100644
--- a/packages/SettingsProvider/src/android/provider/settings/validators/GlobalSettingsValidators.java
+++ b/packages/SettingsProvider/src/android/provider/settings/validators/GlobalSettingsValidators.java
@@ -51,6 +51,9 @@ public class GlobalSettingsValidators {
public static final Map<String, Validator> VALIDATORS = new ArrayMap<>();
static {
+ VALIDATORS.put(Global.CONNECTED_APPS_ALLOWED_PACKAGES, new PackageNameListValidator((",")));
+ VALIDATORS.put(Global.CONNECTED_APPS_DISALLOWED_PACKAGES,
+ new PackageNameListValidator((",")));
VALIDATORS.put(Global.APPLY_RAMPING_RINGER, BOOLEAN_VALIDATOR);
VALIDATORS.put(Global.BUGREPORT_IN_POWER_MENU, BOOLEAN_VALIDATOR);
VALIDATORS.put(
diff --git a/packages/Shell/tests/src/com/android/shell/BugreportReceiverTest.java b/packages/Shell/tests/src/com/android/shell/BugreportReceiverTest.java
index 4579168d2784..050a3704df1f 100644
--- a/packages/Shell/tests/src/com/android/shell/BugreportReceiverTest.java
+++ b/packages/Shell/tests/src/com/android/shell/BugreportReceiverTest.java
@@ -200,7 +200,7 @@ public class BugreportReceiverTest {
mBugreportFd = ParcelFileDescriptor.dup(invocation.getArgument(2));
return null;
}).when(mMockIDumpstate).startBugreport(anyInt(), any(), any(), any(), anyInt(), anyInt(),
- any(), anyBoolean());
+ any(), anyBoolean(), anyBoolean());
setWarningState(mContext, STATE_HIDE);
@@ -543,7 +543,7 @@ public class BugreportReceiverTest {
getInstrumentation().waitForIdleSync();
verify(mMockIDumpstate, times(1)).startBugreport(anyInt(), any(), any(), any(),
- anyInt(), anyInt(), any(), anyBoolean());
+ anyInt(), anyInt(), any(), anyBoolean(), anyBoolean());
sendBugreportFinished();
}
@@ -608,7 +608,7 @@ public class BugreportReceiverTest {
ArgumentCaptor<IDumpstateListener> listenerCap = ArgumentCaptor.forClass(
IDumpstateListener.class);
verify(mMockIDumpstate, timeout(TIMEOUT)).startBugreport(anyInt(), any(), any(), any(),
- anyInt(), anyInt(), listenerCap.capture(), anyBoolean());
+ anyInt(), anyInt(), listenerCap.capture(), anyBoolean(), anyBoolean());
mIDumpstateListener = listenerCap.getValue();
assertNotNull("Dumpstate listener should not be null", mIDumpstateListener);
mIDumpstateListener.onProgress(0);
diff --git a/packages/SystemUI/Android.bp b/packages/SystemUI/Android.bp
index d2ca11207084..ac680a97cf3a 100644
--- a/packages/SystemUI/Android.bp
+++ b/packages/SystemUI/Android.bp
@@ -87,6 +87,52 @@ filegroup {
"tests/src/**/systemui/util/sensors/AsyncManagerTest.java",
"tests/src/**/systemui/util/sensors/ThresholdSensorImplTest.java",
"tests/src/**/systemui/util/wakelock/KeepAwakeAnimationListenerTest.java",
+ "tests/src/**/systemui/statusbar/KeyboardShortcutListSearchTest.java",
+ "tests/src/**/systemui/statusbar/KeyboardShortcutsTest.java",
+ "tests/src/**/systemui/statusbar/KeyguardIndicationControllerWithCoroutinesTest.kt",
+ "tests/src/**/systemui/statusbar/notification/AssistantFeedbackControllerTest.java",
+ "tests/src/**/systemui/statusbar/notification/collection/NotifCollectionTest.java",
+ "tests/src/**/systemui/statusbar/notification/collection/NotificationEntryTest.java",
+ "tests/src/**/systemui/statusbar/notification/collection/render/GroupExpansionManagerTest.kt",
+ "tests/src/**/systemui/statusbar/notification/collection/ShadeListBuilderTest.java",
+ "tests/src/**/systemui/statusbar/notification/footer/ui/view/FooterViewTest.java",
+ "tests/src/**/systemui/statusbar/notification/interruption/NotificationInterruptStateProviderImplTest.java",
+ "tests/src/**/systemui/statusbar/notification/interruption/NotificationInterruptStateProviderWrapperTest.kt",
+ "tests/src/**/systemui/statusbar/notification/interruption/VisualInterruptionDecisionProviderImplTest.kt",
+ "tests/src/**/systemui/statusbar/NotificationLockscreenUserManagerTest.java",
+ "tests/src/**/systemui/statusbar/notification/logging/NotificationLoggerTest.java",
+ "tests/src/**/systemui/statusbar/notification/row/ExpandableNotificationRowTest.java",
+ "tests/src/**/systemui/statusbar/notification/row/NotificationContentInflaterTest.java",
+ "tests/src/**/systemui/statusbar/notification/row/NotificationContentViewTest.kt",
+ "tests/src/**/systemui/statusbar/notification/row/NotificationConversationInfoTest.java",
+ "tests/src/**/systemui/statusbar/notification/row/NotificationGutsManagerTest.java",
+ "tests/src/**/systemui/statusbar/notification/row/NotificationGutsManagerWithScenesTest.kt",
+ "tests/src/**/systemui/statusbar/notification/row/NotifLayoutInflaterFactoryTest.kt",
+ "tests/src/**/systemui/statusbar/notification/row/wrapper/NotificationTemplateViewWrapperTest.kt",
+ "tests/src/**/systemui/statusbar/notification/stack/NotificationSectionsManagerTest.java",
+ "tests/src/**/systemui/statusbar/notification/stack/NotificationStackScrollLayoutTest.java",
+ "tests/src/**/systemui/statusbar/notification/stack/ui/viewmodel/SharedNotificationContainerViewModelTest.kt",
+ "tests/src/**/systemui/statusbar/phone/AutoTileManagerTest.java",
+ "tests/src/**/systemui/statusbar/phone/CentralSurfacesImplTest.java",
+ "tests/src/**/systemui/statusbar/phone/fragment/CollapsedStatusBarFragmentTest.java",
+ "tests/src/**/systemui/statusbar/phone/PhoneStatusBarTransitionsTest.kt",
+ "tests/src/**/systemui/statusbar/phone/PhoneStatusBarViewControllerTest.kt",
+ "tests/src/**/systemui/statusbar/phone/PhoneStatusBarView.java",
+ "tests/src/**/systemui/statusbar/phone/PhoneStatusBarViewTest.kt",
+ "tests/src/**/systemui/statusbar/phone/StatusBarBoundsProviderTest.kt",
+ "tests/src/**/systemui/statusbar/phone/StatusBarMoveFromCenterAnimationControllerTest.kt",
+ "tests/src/**/systemui/statusbar/pipeline/airplane/ui/viewmodel/AirplaneModeViewModelImplTest.kt",
+ "tests/src/**/systemui/statusbar/pipeline/mobile/data/repository/prod/MobileConnectionsRepositoryTest.kt",
+ "tests/src/**/systemui/statusbar/pipeline/mobile/ui/view/ModernStatusBarMobileViewTest.kt",
+ "tests/src/**/systemui/statusbar/pipeline/wifi/data/repository/prod/WifiRepositoryImplTest.kt",
+ "tests/src/**/systemui/statusbar/pipeline/wifi/ui/view/ModernStatusBarWifiViewTest.kt",
+ "tests/src/**/systemui/statusbar/policy/CallbackControllerTest.java",
+ "tests/src/**/systemui/statusbar/policy/DeviceStateRotationLockSettingControllerTest.java",
+ "tests/src/**/systemui/statusbar/policy/InflatedSmartRepliesTest.java",
+ "tests/src/**/systemui/statusbar/policy/LocationControllerImplTest.java",
+ "tests/src/**/systemui/statusbar/policy/RemoteInputViewTest.java",
+ "tests/src/**/systemui/statusbar/policy/SmartReplyViewTest.java",
+ "tests/src/**/systemui/statusbar/StatusBarStateControllerImplTest.kt",
],
}
@@ -147,6 +193,9 @@ filegroup {
"tests/src/**/systemui/bluetooth/qsdialog/BluetoothTileDialogViewModelTest.kt",
"tests/src/**/systemui/bluetooth/qsdialog/DeviceItemFactoryTest.kt",
"tests/src/**/systemui/bluetooth/qsdialog/DeviceItemInteractorTest.kt",
+ // TODO(b/322324387): Fails to start due to missing ScreenshotActivity
+ "tests/src/**/systemui/bouncer/ui/composable/BouncerContentTest.kt",
+ "tests/src/**/systemui/bouncer/ui/composable/PatternBouncerTest.kt",
"tests/src/**/systemui/broadcast/UserBroadcastDispatcherTest.kt",
"tests/src/**/systemui/charging/WiredChargingRippleControllerTest.kt",
"tests/src/**/systemui/clipboardoverlay/ClipboardModelTest.kt",
@@ -487,6 +536,8 @@ android_library {
"SystemUI-res",
"WifiTrackerLib",
"PlatformAnimationLib",
+ "PlatformMotionTestingCompose",
+ "ScreenshotComposeUtilsLib",
"SystemUIPluginLib",
"SystemUISharedLib",
"SystemUICustomizationLib",
@@ -720,6 +771,7 @@ android_robolectric_test {
],
static_libs: [
"RoboTestLibraries",
+ "mockito-kotlin2",
],
libs: [
"android.test.runner",
diff --git a/packages/SystemUI/accessibility/accessibilitymenu/aconfig/accessibility.aconfig b/packages/SystemUI/accessibility/accessibilitymenu/aconfig/accessibility.aconfig
index d868d5c7c4c4..ba842877fc79 100644
--- a/packages/SystemUI/accessibility/accessibilitymenu/aconfig/accessibility.aconfig
+++ b/packages/SystemUI/accessibility/accessibilitymenu/aconfig/accessibility.aconfig
@@ -9,3 +9,13 @@ flag {
description: "Hides the AccessibilityMenuService UI before taking action instead of after."
bug: "292020123"
}
+
+flag {
+ name: "a11y_menu_snackbar_live_region"
+ namespace: "accessibility"
+ description: "configures live region on snackbar so its contents are announced when it appears."
+ bug: "338351484"
+ metadata {
+ purpose: PURPOSE_BUGFIX
+ }
+}
diff --git a/packages/SystemUI/accessibility/accessibilitymenu/src/com/android/systemui/accessibility/accessibilitymenu/view/A11yMenuOverlayLayout.java b/packages/SystemUI/accessibility/accessibilitymenu/src/com/android/systemui/accessibility/accessibilitymenu/view/A11yMenuOverlayLayout.java
index 1be04f854c9a..7b43b72ee757 100644
--- a/packages/SystemUI/accessibility/accessibilitymenu/src/com/android/systemui/accessibility/accessibilitymenu/view/A11yMenuOverlayLayout.java
+++ b/packages/SystemUI/accessibility/accessibilitymenu/src/com/android/systemui/accessibility/accessibilitymenu/view/A11yMenuOverlayLayout.java
@@ -17,6 +17,7 @@
package com.android.systemui.accessibility.accessibilitymenu.view;
import static android.view.Display.DEFAULT_DISPLAY;
+import static android.view.View.ACCESSIBILITY_LIVE_REGION_POLITE;
import static android.view.WindowManager.LayoutParams.TYPE_ACCESSIBILITY_OVERLAY;
import static java.lang.Math.max;
@@ -321,7 +322,14 @@ public class A11yMenuOverlayLayout {
AccessibilityManager.FLAG_CONTENT_TEXT);
final TextView snackbar = mLayout.findViewById(R.id.snackbar);
+ if (snackbar == null) {
+ return;
+ }
snackbar.setText(text);
+ if (com.android.systemui.accessibility.accessibilitymenu
+ .Flags.a11yMenuSnackbarLiveRegion()) {
+ snackbar.setAccessibilityLiveRegion(ACCESSIBILITY_LIVE_REGION_POLITE);
+ }
// Remove any existing fade-out animation before starting any new animations.
mHandler.removeCallbacksAndMessages(null);
diff --git a/packages/SystemUI/aconfig/accessibility.aconfig b/packages/SystemUI/aconfig/accessibility.aconfig
index 755fe2a4476a..55edff6d9518 100644
--- a/packages/SystemUI/aconfig/accessibility.aconfig
+++ b/packages/SystemUI/aconfig/accessibility.aconfig
@@ -4,6 +4,13 @@ container: "system"
# NOTE: Keep alphabetized to help limit merge conflicts from multiple simultaneous editors.
flag {
+ name: "create_windowless_window_magnifier"
+ namespace: "accessibility"
+ description: "Uses SurfaceControlViewHost to create the magnifier for window magnification."
+ bug: "280992417"
+}
+
+flag {
name: "delay_show_magnification_button"
namespace: "accessibility"
description: "Delays the showing of magnification mode switch button."
@@ -66,8 +73,11 @@ flag {
}
flag {
- name: "create_windowless_window_magnifier"
+ name: "save_and_restore_magnification_settings_buttons"
namespace: "accessibility"
- description: "Uses SurfaceControlViewHost to create the magnifier for window magnification."
- bug: "280992417"
+ description: "Saves the selected button status in magnification settings and restore the status when revisiting the same smallest screen DP."
+ bug: "325567876"
+ metadata {
+ purpose: PURPOSE_BUGFIX
+ }
}
diff --git a/packages/SystemUI/aconfig/cross_device_control.aconfig b/packages/SystemUI/aconfig/cross_device_control.aconfig
deleted file mode 100644
index 5f9a4f42b546..000000000000
--- a/packages/SystemUI/aconfig/cross_device_control.aconfig
+++ /dev/null
@@ -1,16 +0,0 @@
-package: "com.android.systemui"
-container: "system"
-
-flag {
- name: "legacy_le_audio_sharing"
- namespace: "pixel_cross_device_control"
- description: "Gates the legacy le audio sharing UI."
- bug: "322295262"
-}
-
-flag {
- name: "enable_personal_le_audio_sharing"
- namespace: "pixel_cross_device_control"
- description: "Gates the personal le audio sharing UI in UMO."
- bug: "322295480"
-}
diff --git a/packages/SystemUI/aconfig/systemui.aconfig b/packages/SystemUI/aconfig/systemui.aconfig
index f9e955bf0366..a2d7b2f95694 100644
--- a/packages/SystemUI/aconfig/systemui.aconfig
+++ b/packages/SystemUI/aconfig/systemui.aconfig
@@ -414,6 +414,13 @@ flag {
}
flag {
+ name: "confine_notification_touch_to_view_width"
+ namespace: "systemui"
+ description: "Use notification view width when detecting gestures."
+ bug: "335828150"
+}
+
+flag {
name: "fix_image_wallpaper_crash_surface_already_released"
namespace: "systemui"
description: "Make sure ImageWallpaper doesn't return from OnSurfaceDestroyed until any drawing is finished"
@@ -968,3 +975,20 @@ flag {
description: "Shows a vertical bar at the right edge to indicate the user can swipe to open the glanceable hub"
bug: "339667383"
}
+
+flag {
+ name: "new_touchpad_gestures_tutorial"
+ namespace: "systemui"
+ description: "Enables new interactive tutorial for learning touchpad gestures"
+ bug: "309928033"
+}
+
+flag {
+ name: "register_wallpaper_notifier_background"
+ namespace: "systemui"
+ description: "Decide whether to register wallpaper change broadcast receiver on background executor."
+ bug: "327315860"
+ metadata {
+ purpose: PURPOSE_BUGFIX
+ }
+}
diff --git a/packages/SystemUI/compose/core/Android.bp b/packages/SystemUI/compose/core/Android.bp
index 49ae821dd2fb..c63c2b48638c 100644
--- a/packages/SystemUI/compose/core/Android.bp
+++ b/packages/SystemUI/compose/core/Android.bp
@@ -32,6 +32,7 @@ android_library {
static_libs: [
"PlatformAnimationLib",
+ "PlatformMotionTestingComposeValues",
"androidx.compose.runtime_runtime",
"androidx.compose.material3_material3",
diff --git a/packages/SystemUI/compose/facade/enabled/src/com/android/systemui/scene/LockscreenSceneModule.kt b/packages/SystemUI/compose/facade/enabled/src/com/android/systemui/scene/LockscreenSceneModule.kt
index f5dc15485ee8..bd5b795a76c1 100644
--- a/packages/SystemUI/compose/facade/enabled/src/com/android/systemui/scene/LockscreenSceneModule.kt
+++ b/packages/SystemUI/compose/facade/enabled/src/com/android/systemui/scene/LockscreenSceneModule.kt
@@ -19,11 +19,14 @@ package com.android.systemui.scene
import android.view.View
import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.keyguard.KeyguardViewConfigurator
+import com.android.systemui.keyguard.domain.interactor.KeyguardClockInteractor
import com.android.systemui.keyguard.qualifiers.KeyguardRootView
import com.android.systemui.keyguard.shared.model.LockscreenSceneBlueprint
+import com.android.systemui.keyguard.ui.composable.LockscreenContent
import com.android.systemui.keyguard.ui.composable.LockscreenScene
import com.android.systemui.keyguard.ui.composable.LockscreenSceneBlueprintModule
import com.android.systemui.keyguard.ui.composable.blueprint.ComposableLockscreenSceneBlueprint
+import com.android.systemui.keyguard.ui.viewmodel.LockscreenContentViewModel
import com.android.systemui.scene.shared.model.Scene
import dagger.Binds
import dagger.Module
@@ -60,5 +63,14 @@ interface LockscreenSceneModule {
): Set<LockscreenSceneBlueprint> {
return blueprints
}
+
+ @Provides
+ fun providesLockscreenContent(
+ viewModel: LockscreenContentViewModel,
+ blueprints: Set<@JvmSuppressWildcards ComposableLockscreenSceneBlueprint>,
+ clockInteractor: KeyguardClockInteractor,
+ ): LockscreenContent {
+ return LockscreenContent(viewModel, blueprints, clockInteractor)
+ }
}
}
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 fa01a4bf46c5..c19c08e09349 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
@@ -20,6 +20,7 @@ package com.android.systemui.bouncer.ui.composable
import android.app.AlertDialog
import android.content.DialogInterface
+import androidx.annotation.VisibleForTesting
import androidx.compose.animation.Crossfade
import androidx.compose.animation.core.Animatable
import androidx.compose.animation.core.animateFloatAsState
@@ -69,6 +70,7 @@ import androidx.compose.ui.input.pointer.pointerInput
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.text.style.TextOverflow
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.DpOffset
@@ -104,6 +106,9 @@ import com.android.systemui.res.R
import kotlin.math.abs
import kotlin.math.max
import kotlin.math.pow
+import platform.test.motion.compose.values.MotionTestValueKey
+import platform.test.motion.compose.values.MotionTestValues
+import platform.test.motion.compose.values.motionTestValues
@Composable
fun BouncerContent(
@@ -114,6 +119,17 @@ fun BouncerContent(
val isSideBySideSupported by viewModel.isSideBySideSupported.collectAsStateWithLifecycle()
val layout = calculateLayout(isSideBySideSupported = isSideBySideSupported)
+ BouncerContent(layout, viewModel, dialogFactory, modifier)
+}
+
+@Composable
+@VisibleForTesting
+fun BouncerContent(
+ layout: BouncerSceneLayout,
+ viewModel: BouncerViewModel,
+ dialogFactory: BouncerDialogFactory,
+ modifier: Modifier
+) {
Box(
// Allows the content within each of the layouts to react to the appearance and
// disappearance of the IME, which is also known as the software keyboard.
@@ -318,6 +334,8 @@ private fun BesideUserSwitcherLayout(
LocalWindowSizeClass.current.heightSizeClass == WindowHeightSizeClass.Expanded
val authMethod by viewModel.authMethodViewModel.collectAsStateWithLifecycle()
+ var swapAnimationEnd by remember { mutableStateOf(false) }
+
Row(
modifier =
modifier
@@ -331,11 +349,16 @@ private fun BesideUserSwitcherLayout(
}
)
}
+ .testTag("BesideUserSwitcherLayout")
+ .motionTestValues {
+ swapAnimationEnd exportAs BouncerMotionTestKeys.swapAnimationEnd
+ }
.padding(
top = if (isHeightExpanded) 128.dp else 96.dp,
bottom = if (isHeightExpanded) 128.dp else 48.dp,
),
) {
+ LaunchedEffect(isSwapped) { swapAnimationEnd = false }
val animatedOffset by
animateFloatAsState(
targetValue =
@@ -354,31 +377,35 @@ private fun BesideUserSwitcherLayout(
-1f
},
label = "offset",
- )
+ ) {
+ swapAnimationEnd = true
+ }
fun Modifier.swappable(inversed: Boolean = false): Modifier {
return graphicsLayer {
- translationX =
- size.width *
- animatedOffset *
- if (inversed) {
- // A negative sign is used to make sure this is offset in the direction
- // that's opposite to the direction that the user switcher is pushed in.
- -1
- } else {
- 1
- }
- alpha = animatedAlpha(animatedOffset)
- }
+ translationX =
+ size.width *
+ animatedOffset *
+ if (inversed) {
+ // A negative sign is used to make sure this is offset in the
+ // direction that's opposite to the direction that the user
+ // switcher is pushed in.
+ -1
+ } else {
+ 1
+ }
+ alpha = animatedAlpha(animatedOffset)
+ }
+ .motionTestValues { animatedAlpha(animatedOffset) exportAs MotionTestValues.alpha }
}
UserSwitcher(
viewModel = viewModel,
- modifier = Modifier.weight(1f).swappable(),
+ modifier = Modifier.weight(1f).swappable().testTag("UserSwitcher"),
)
FoldAware(
- modifier = Modifier.weight(1f).swappable(inversed = true),
+ modifier = Modifier.weight(1f).swappable(inversed = true).testTag("FoldAware"),
viewModel = viewModel,
aboveFold = {
Column(
@@ -389,7 +416,10 @@ private fun BesideUserSwitcherLayout(
viewModel = viewModel.message,
)
- OutputArea(viewModel = viewModel, modifier = Modifier.padding(top = 24.dp))
+ OutputArea(
+ viewModel = viewModel,
+ modifier = Modifier.padding(top = 24.dp).testTag("OutputArea")
+ )
}
},
belowFold = {
@@ -412,13 +442,13 @@ private fun BesideUserSwitcherLayout(
viewModel = viewModel,
pinButtonRowVerticalSpacing = 12.dp,
centerPatternDotsVertically = true,
- modifier = Modifier.align(Alignment.BottomCenter),
+ modifier = Modifier.align(Alignment.BottomCenter).testTag("InputArea"),
)
}
ActionArea(
viewModel = viewModel,
- modifier = Modifier.padding(top = 48.dp),
+ modifier = Modifier.padding(top = 48.dp).testTag("ActionArea"),
)
}
},
@@ -938,3 +968,8 @@ private object SceneElements {
private val SceneTransitions = transitions {
from(SceneKeys.ContiguousSceneKey, to = SceneKeys.SplitSceneKey) { spec = tween() }
}
+
+@VisibleForTesting
+object BouncerMotionTestKeys {
+ val swapAnimationEnd = MotionTestValueKey<Boolean>("swapAnimationEnd")
+}
diff --git a/packages/SystemUI/compose/features/src/com/android/systemui/bouncer/ui/composable/PatternBouncer.kt b/packages/SystemUI/compose/features/src/com/android/systemui/bouncer/ui/composable/PatternBouncer.kt
index 9c2fd64052b4..069113b378da 100644
--- a/packages/SystemUI/compose/features/src/com/android/systemui/bouncer/ui/composable/PatternBouncer.kt
+++ b/packages/SystemUI/compose/features/src/com/android/systemui/bouncer/ui/composable/PatternBouncer.kt
@@ -17,6 +17,7 @@
package com.android.systemui.bouncer.ui.composable
import android.view.HapticFeedbackConstants
+import androidx.annotation.VisibleForTesting
import androidx.compose.animation.core.Animatable
import androidx.compose.animation.core.AnimationVector1D
import androidx.compose.animation.core.tween
@@ -50,6 +51,10 @@ import androidx.lifecycle.compose.collectAsStateWithLifecycle
import com.android.compose.animation.Easings
import com.android.compose.modifiers.thenIf
import com.android.internal.R
+import com.android.systemui.bouncer.ui.composable.MotionTestKeys.dotAppearFadeIn
+import com.android.systemui.bouncer.ui.composable.MotionTestKeys.dotAppearMoveUp
+import com.android.systemui.bouncer.ui.composable.MotionTestKeys.dotScaling
+import com.android.systemui.bouncer.ui.composable.MotionTestKeys.entryCompleted
import com.android.systemui.bouncer.ui.viewmodel.PatternBouncerViewModel
import com.android.systemui.bouncer.ui.viewmodel.PatternDotViewModel
import com.android.systemui.compose.modifiers.sysuiResTag
@@ -58,6 +63,8 @@ import kotlin.math.pow
import kotlin.math.sqrt
import kotlinx.coroutines.coroutineScope
import kotlinx.coroutines.launch
+import platform.test.motion.compose.values.MotionTestValueKey
+import platform.test.motion.compose.values.motionTestValues
/**
* UI for the input part of a pattern-requiring version of the bouncer.
@@ -68,7 +75,8 @@ import kotlinx.coroutines.launch
* `false`, the dots will be pushed towards the end/bottom of the axis.
*/
@Composable
-internal fun PatternBouncer(
+@VisibleForTesting
+fun PatternBouncer(
viewModel: PatternBouncerViewModel,
centerDotsVertically: Boolean,
modifier: Modifier = Modifier,
@@ -111,33 +119,11 @@ internal fun PatternBouncer(
remember(dots) {
dots.associateWith { dot -> with(density) { (80 + (20 * dot.y)).dp.toPx() } }
}
+
+ var entryAnimationCompleted by remember { mutableStateOf(false) }
LaunchedEffect(Unit) {
- dotAppearFadeInAnimatables.forEach { (dot, animatable) ->
- scope.launch {
- animatable.animateTo(
- targetValue = 1f,
- animationSpec =
- tween(
- delayMillis = 33 * dot.y,
- durationMillis = 450,
- easing = Easings.LegacyDecelerate,
- )
- )
- }
- }
- dotAppearMoveUpAnimatables.forEach { (dot, animatable) ->
- scope.launch {
- animatable.animateTo(
- targetValue = 1f,
- animationSpec =
- tween(
- delayMillis = 0,
- durationMillis = 450 + (33 * dot.y),
- easing = Easings.StandardDecelerate,
- )
- )
- }
- }
+ showEntryAnimation(dotAppearFadeInAnimatables, dotAppearMoveUpAnimatables)
+ entryAnimationCompleted = true
}
val view = LocalView.current
@@ -286,6 +272,12 @@ internal fun PatternBouncer(
}
}
}
+ .motionTestValues {
+ entryAnimationCompleted exportAs entryCompleted
+ dotAppearFadeInAnimatables.map { it.value.value } exportAs dotAppearFadeIn
+ dotAppearMoveUpAnimatables.map { it.value.value } exportAs dotAppearMoveUp
+ dotScalingAnimatables.map { it.value.value } exportAs dotScaling
+ }
) {
gridCoordinates?.let { nonNullCoordinates ->
val containerSize = nonNullCoordinates.size
@@ -381,6 +373,40 @@ internal fun PatternBouncer(
}
}
+private suspend fun showEntryAnimation(
+ dotAppearFadeInAnimatables: Map<PatternDotViewModel, Animatable<Float, AnimationVector1D>>,
+ dotAppearMoveUpAnimatables: Map<PatternDotViewModel, Animatable<Float, AnimationVector1D>>,
+) {
+ coroutineScope {
+ dotAppearFadeInAnimatables.forEach { (dot, animatable) ->
+ launch {
+ animatable.animateTo(
+ targetValue = 1f,
+ animationSpec =
+ tween(
+ delayMillis = 33 * dot.y,
+ durationMillis = 450,
+ easing = Easings.LegacyDecelerate,
+ )
+ )
+ }
+ }
+ dotAppearMoveUpAnimatables.forEach { (dot, animatable) ->
+ launch {
+ animatable.animateTo(
+ targetValue = 1f,
+ animationSpec =
+ tween(
+ delayMillis = 0,
+ durationMillis = 450 + (33 * dot.y),
+ easing = Easings.StandardDecelerate,
+ )
+ )
+ }
+ }
+ }
+}
+
/** Returns an [Offset] representation of the given [dot], in pixel coordinates. */
private fun pixelOffset(
dot: PatternDotViewModel,
@@ -490,3 +516,11 @@ private const val FAILURE_ANIMATION_DOT_DIAMETER_DP = (DOT_DIAMETER_DP * 0.81f).
private const val FAILURE_ANIMATION_DOT_SHRINK_ANIMATION_DURATION_MS = 50
private const val FAILURE_ANIMATION_DOT_SHRINK_STAGGER_DELAY_MS = 33
private const val FAILURE_ANIMATION_DOT_REVERT_ANIMATION_DURATION = 617
+
+@VisibleForTesting
+object MotionTestKeys {
+ val entryCompleted = MotionTestValueKey<Boolean>("PinBouncer::entryAnimationCompleted")
+ val dotAppearFadeIn = MotionTestValueKey<List<Float>>("PinBouncer::dotAppearFadeIn")
+ val dotAppearMoveUp = MotionTestValueKey<List<Float>>("PinBouncer::dotAppearMoveUp")
+ val dotScaling = MotionTestValueKey<List<Float>>("PinBouncer::dotScaling")
+}
diff --git a/packages/SystemUI/compose/features/src/com/android/systemui/keyguard/ui/composable/LockscreenContent.kt b/packages/SystemUI/compose/features/src/com/android/systemui/keyguard/ui/composable/LockscreenContent.kt
index ca4ff837daa6..99f7d0f902a6 100644
--- a/packages/SystemUI/compose/features/src/com/android/systemui/keyguard/ui/composable/LockscreenContent.kt
+++ b/packages/SystemUI/compose/features/src/com/android/systemui/keyguard/ui/composable/LockscreenContent.kt
@@ -36,9 +36,7 @@ import javax.inject.Inject
* This is separate from the [LockscreenScene] because it's meant to support usage of this UI from
* outside the scene container framework.
*/
-class LockscreenContent
-@Inject
-constructor(
+class LockscreenContent(
private val viewModel: LockscreenContentViewModel,
private val blueprints: Set<@JvmSuppressWildcards ComposableLockscreenSceneBlueprint>,
private val clockInteractor: KeyguardClockInteractor,
diff --git a/packages/SystemUI/compose/features/src/com/android/systemui/keyguard/ui/composable/section/StatusBarSection.kt b/packages/SystemUI/compose/features/src/com/android/systemui/keyguard/ui/composable/section/StatusBarSection.kt
index d996d25eff20..166aa70c1d4a 100644
--- a/packages/SystemUI/compose/features/src/com/android/systemui/keyguard/ui/composable/section/StatusBarSection.kt
+++ b/packages/SystemUI/compose/features/src/com/android/systemui/keyguard/ui/composable/section/StatusBarSection.kt
@@ -54,12 +54,19 @@ constructor(
@SuppressLint("InflateParams")
val view =
remember(context) {
- LayoutInflater.from(context)
- .inflate(
- R.layout.keyguard_status_bar,
- null,
- false,
- ) as KeyguardStatusBarView
+ (LayoutInflater.from(context)
+ .inflate(
+ R.layout.keyguard_status_bar,
+ null,
+ false,
+ ) as KeyguardStatusBarView)
+ .also {
+ it.layoutParams =
+ ViewGroup.LayoutParams(
+ ViewGroup.LayoutParams.MATCH_PARENT,
+ ViewGroup.LayoutParams.WRAP_CONTENT
+ )
+ }
}
val viewController =
remember(view) {
diff --git a/packages/SystemUI/compose/features/src/com/android/systemui/notifications/ui/composable/NotificationsShadeScene.kt b/packages/SystemUI/compose/features/src/com/android/systemui/notifications/ui/composable/NotificationsShadeScene.kt
index 1c675e339941..e17a1464a71a 100644
--- a/packages/SystemUI/compose/features/src/com/android/systemui/notifications/ui/composable/NotificationsShadeScene.kt
+++ b/packages/SystemUI/compose/features/src/com/android/systemui/notifications/ui/composable/NotificationsShadeScene.kt
@@ -26,11 +26,14 @@ import com.android.compose.animation.scene.SceneScope
import com.android.compose.animation.scene.UserAction
import com.android.compose.animation.scene.UserActionResult
import com.android.systemui.dagger.SysUISingleton
+import com.android.systemui.keyguard.ui.composable.LockscreenContent
import com.android.systemui.notifications.ui.viewmodel.NotificationsShadeSceneViewModel
import com.android.systemui.scene.shared.model.Scenes
import com.android.systemui.scene.ui.composable.ComposableScene
import com.android.systemui.shade.ui.composable.OverlayShade
import com.android.systemui.shade.ui.viewmodel.OverlayShadeViewModel
+import dagger.Lazy
+import java.util.Optional
import javax.inject.Inject
import kotlinx.coroutines.flow.StateFlow
@@ -40,6 +43,7 @@ class NotificationsShadeScene
constructor(
viewModel: NotificationsShadeSceneViewModel,
private val overlayShadeViewModel: OverlayShadeViewModel,
+ private val lockscreenContent: Lazy<Optional<LockscreenContent>>,
) : ComposableScene {
override val key = Scenes.NotificationsShade
@@ -55,6 +59,7 @@ constructor(
viewModel = overlayShadeViewModel,
modifier = modifier,
horizontalArrangement = Arrangement.Start,
+ lockscreenContent = lockscreenContent,
) {
Text(
text = "Notifications list",
diff --git a/packages/SystemUI/compose/features/src/com/android/systemui/qs/ui/composable/QuickSettings.kt b/packages/SystemUI/compose/features/src/com/android/systemui/qs/ui/composable/QuickSettings.kt
index d1099883c5e5..54a98ddaa01a 100644
--- a/packages/SystemUI/compose/features/src/com/android/systemui/qs/ui/composable/QuickSettings.kt
+++ b/packages/SystemUI/compose/features/src/com/android/systemui/qs/ui/composable/QuickSettings.kt
@@ -69,7 +69,7 @@ object QuickSettings {
private fun SceneScope.stateForQuickSettingsContent(
isSplitShade: Boolean,
- squishiness: Float = QuickSettings.SharedValues.SquishinessValues.Default
+ squishiness: () -> Float = { QuickSettings.SharedValues.SquishinessValues.Default }
): QSSceneAdapter.State {
return when (val transitionState = layoutState.transitionState) {
is TransitionState.Idle -> {
@@ -125,9 +125,9 @@ fun SceneScope.QuickSettings(
heightProvider: () -> Int,
isSplitShade: Boolean,
modifier: Modifier = Modifier,
- squishiness: Float = QuickSettings.SharedValues.SquishinessValues.Default,
+ squishiness: () -> Float = { QuickSettings.SharedValues.SquishinessValues.Default },
) {
- val contentState = stateForQuickSettingsContent(isSplitShade, squishiness)
+ val contentState = { stateForQuickSettingsContent(isSplitShade, squishiness) }
val transitionState = layoutState.transitionState
val isClosing =
transitionState is TransitionState.Transition &&
@@ -161,7 +161,7 @@ fun SceneScope.QuickSettings(
@Composable
private fun QuickSettingsContent(
qsSceneAdapter: QSSceneAdapter,
- state: QSSceneAdapter.State,
+ state: () -> QSSceneAdapter.State,
modifier: Modifier = Modifier,
) {
val qsView by qsSceneAdapter.qsView.collectAsStateWithLifecycle(null)
@@ -185,10 +185,10 @@ private fun QuickSettingsContent(
AndroidView(
modifier = Modifier.fillMaxWidth(),
factory = { _ ->
- qsSceneAdapter.setState(state)
+ qsSceneAdapter.setState(state())
view
},
- update = { qsSceneAdapter.setState(state) }
+ update = { qsSceneAdapter.setState(state()) }
)
}
}
diff --git a/packages/SystemUI/compose/features/src/com/android/systemui/qs/ui/composable/QuickSettingsShadeScene.kt b/packages/SystemUI/compose/features/src/com/android/systemui/qs/ui/composable/QuickSettingsShadeScene.kt
index 636c6c3b7d14..04f76f5d58ab 100644
--- a/packages/SystemUI/compose/features/src/com/android/systemui/qs/ui/composable/QuickSettingsShadeScene.kt
+++ b/packages/SystemUI/compose/features/src/com/android/systemui/qs/ui/composable/QuickSettingsShadeScene.kt
@@ -26,13 +26,16 @@ import com.android.compose.animation.scene.SceneScope
import com.android.compose.animation.scene.UserAction
import com.android.compose.animation.scene.UserActionResult
import com.android.systemui.dagger.SysUISingleton
+import com.android.systemui.keyguard.ui.composable.LockscreenContent
import com.android.systemui.qs.ui.viewmodel.QuickSettingsShadeSceneViewModel
import com.android.systemui.scene.shared.model.Scenes
import com.android.systemui.scene.ui.composable.ComposableScene
import com.android.systemui.shade.ui.composable.OverlayShade
import com.android.systemui.shade.ui.viewmodel.OverlayShadeViewModel
+import dagger.Lazy
import javax.inject.Inject
import kotlinx.coroutines.flow.StateFlow
+import java.util.Optional
@SysUISingleton
class QuickSettingsShadeScene
@@ -40,6 +43,7 @@ class QuickSettingsShadeScene
constructor(
viewModel: QuickSettingsShadeSceneViewModel,
private val overlayShadeViewModel: OverlayShadeViewModel,
+ private val lockscreenContent: Lazy<Optional<LockscreenContent>>,
) : ComposableScene {
override val key = Scenes.QuickSettingsShade
@@ -55,6 +59,7 @@ constructor(
viewModel = overlayShadeViewModel,
modifier = modifier,
horizontalArrangement = Arrangement.End,
+ lockscreenContent = lockscreenContent,
) {
Text(
text = "Quick settings grid",
diff --git a/packages/SystemUI/compose/features/src/com/android/systemui/shade/ui/composable/OverlayShade.kt b/packages/SystemUI/compose/features/src/com/android/systemui/shade/ui/composable/OverlayShade.kt
index 00ef11d3b745..736d805d9834 100644
--- a/packages/SystemUI/compose/features/src/com/android/systemui/shade/ui/composable/OverlayShade.kt
+++ b/packages/SystemUI/compose/features/src/com/android/systemui/shade/ui/composable/OverlayShade.kt
@@ -27,11 +27,9 @@ import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.MaterialTheme
-import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.ReadOnlyComposable
import androidx.compose.runtime.getValue
-import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.Color
@@ -40,14 +38,19 @@ import androidx.lifecycle.compose.collectAsStateWithLifecycle
import com.android.compose.animation.scene.ElementKey
import com.android.compose.animation.scene.LowestZIndexScenePicker
import com.android.compose.animation.scene.SceneScope
+import com.android.systemui.keyguard.ui.composable.LockscreenContent
import com.android.systemui.scene.shared.model.Scenes
import com.android.systemui.shade.ui.viewmodel.OverlayShadeViewModel
+import com.android.systemui.util.kotlin.getOrNull
+import dagger.Lazy
+import java.util.Optional
/** The overlay shade renders a lightweight shade UI container on top of a background scene. */
@Composable
fun SceneScope.OverlayShade(
viewModel: OverlayShadeViewModel,
horizontalArrangement: Arrangement.Horizontal,
+ lockscreenContent: Lazy<Optional<LockscreenContent>>,
modifier: Modifier = Modifier,
content: @Composable () -> Unit,
) {
@@ -55,7 +58,10 @@ fun SceneScope.OverlayShade(
Box(modifier) {
if (backgroundScene == Scenes.Lockscreen) {
- Lockscreen()
+ // Lockscreen content is optionally injected, because variants of System UI without a
+ // lockscreen cannot provide it.
+ val lockscreenContentOrNull = lockscreenContent.get().getOrNull()
+ lockscreenContentOrNull?.apply { Content(Modifier.fillMaxSize()) }
}
Scrim(onClicked = viewModel::onScrimClicked)
@@ -70,16 +76,6 @@ fun SceneScope.OverlayShade(
}
@Composable
-private fun Lockscreen(
- modifier: Modifier = Modifier,
-) {
- // TODO(b/338025605): This is a placeholder, replace with the actual lockscreen.
- Box(modifier = modifier.fillMaxSize().background(Color.LightGray)) {
- Text(text = "Lockscreen", modifier = Modifier.align(Alignment.Center))
- }
-}
-
-@Composable
private fun SceneScope.Scrim(
onClicked: () -> Unit,
modifier: Modifier = Modifier,
diff --git a/packages/SystemUI/compose/features/src/com/android/systemui/shade/ui/composable/ShadeScene.kt b/packages/SystemUI/compose/features/src/com/android/systemui/shade/ui/composable/ShadeScene.kt
index a0278a616857..9d689fc25b23 100644
--- a/packages/SystemUI/compose/features/src/com/android/systemui/shade/ui/composable/ShadeScene.kt
+++ b/packages/SystemUI/compose/features/src/com/android/systemui/shade/ui/composable/ShadeScene.kt
@@ -279,7 +279,7 @@ private fun SceneScope.SingleShade(
viewModel.qsSceneAdapter,
{ viewModel.qsSceneAdapter.qqsHeight },
isSplitShade = false,
- squishiness = tileSquishiness,
+ squishiness = { tileSquishiness },
)
}
@@ -468,7 +468,7 @@ private fun SceneScope.SplitShade(
heightProvider = { viewModel.qsSceneAdapter.qsHeight },
isSplitShade = true,
modifier = Modifier.fillMaxWidth(),
- squishiness = tileSquishiness,
+ squishiness = { tileSquishiness },
)
}
diff --git a/packages/SystemUI/compose/features/src/com/android/systemui/volume/panel/component/anc/ui/composable/AncPopup.kt b/packages/SystemUI/compose/features/src/com/android/systemui/volume/panel/component/anc/ui/composable/AncPopup.kt
index 15df1be02f56..76ffc8b379ae 100644
--- a/packages/SystemUI/compose/features/src/com/android/systemui/volume/panel/component/anc/ui/composable/AncPopup.kt
+++ b/packages/SystemUI/compose/features/src/com/android/systemui/volume/panel/component/anc/ui/composable/AncPopup.kt
@@ -68,13 +68,17 @@ constructor(
@Composable
private fun Content(dialog: SystemUIDialog) {
val isAvailable by viewModel.isAvailable.collectAsStateWithLifecycle(true)
-
if (!isAvailable) {
SideEffect { dialog.dismiss() }
return
}
val slice by viewModel.popupSlice.collectAsStateWithLifecycle()
+ if (!viewModel.isClickable(slice)) {
+ SideEffect { dialog.dismiss() }
+ return
+ }
+
SliceAndroidView(
modifier = Modifier.fillMaxWidth(),
slice = slice,
diff --git a/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/AnimateToScene.kt b/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/AnimateToScene.kt
index b5e93131f828..48a348b9d1c5 100644
--- a/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/AnimateToScene.kt
+++ b/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/AnimateToScene.kt
@@ -21,6 +21,7 @@ import androidx.compose.animation.core.AnimationVector1D
import androidx.compose.animation.core.SpringSpec
import kotlin.math.absoluteValue
import kotlinx.coroutines.CoroutineScope
+import kotlinx.coroutines.CoroutineStart
import kotlinx.coroutines.Job
import kotlinx.coroutines.launch
@@ -190,16 +191,17 @@ private fun CoroutineScope.animate(
}
// Animate the progress to its target value.
+ // Important: We start atomically to make sure that we start the coroutine even if it is
+ // cancelled right after it is launched, so that finishTransition() is correctly called.
+ // Otherwise, this transition will never be stopped and we will never settle to Idle.
transition.job =
- launch { animatable.animateTo(targetProgress, animationSpec, initialVelocity) }
- .apply {
- invokeOnCompletion {
- // Settle the state to Idle(target). Note that this will do nothing if this
- // transition was replaced/interrupted by another one, and this also runs if
- // this coroutine is cancelled, i.e. if [this] coroutine scope is cancelled.
- layoutState.finishTransition(transition, targetScene)
- }
+ launch(start = CoroutineStart.ATOMIC) {
+ try {
+ animatable.animateTo(targetProgress, animationSpec, initialVelocity)
+ } finally {
+ layoutState.finishTransition(transition, targetScene)
}
+ }
return transition
}
diff --git a/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/DraggableHandler.kt b/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/DraggableHandler.kt
index 67589909ac03..1f812453915a 100644
--- a/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/DraggableHandler.kt
+++ b/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/DraggableHandler.kt
@@ -33,6 +33,7 @@ import com.android.compose.animation.scene.TransitionState.HasOverscrollProperti
import com.android.compose.nestedscroll.PriorityNestedScrollConnection
import kotlin.math.absoluteValue
import kotlinx.coroutines.CoroutineScope
+import kotlinx.coroutines.CoroutineStart
import kotlinx.coroutines.Job
import kotlinx.coroutines.launch
@@ -684,7 +685,11 @@ private class SwipeTransition(
val isTargetGreater = targetOffset > animatable.value
val job =
coroutineScope
- .launch {
+ // Important: We start atomically to make sure that we start the coroutine even
+ // if it is cancelled right after it is launched, so that snapToScene() is
+ // correctly called. Otherwise, this transition will never be stopped and we
+ // will never settle to Idle.
+ .launch(start = CoroutineStart.ATOMIC) {
// TODO(b/327249191): Refactor the code so that we don't even launch a
// coroutine if we don't need to animate.
if (skipAnimation) {
@@ -726,18 +731,15 @@ private class SwipeTransition(
}
} finally {
bouncingScene = null
+ snapToScene(targetScene)
}
}
- // Make sure that we settle to target scene at the end of the animation or if
- // the animation is cancelled.
- .apply { invokeOnCompletion { snapToScene(targetScene) } }
OffsetAnimation(animatable, job)
}
}
fun snapToScene(scene: SceneKey) {
- if (layoutState.transitionState != this) return
cancelOffsetAnimation()
layoutState.finishTransition(this, idleScene = scene)
}
diff --git a/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/Element.kt b/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/Element.kt
index 20742ee77fff..ad3d4ad8bd4a 100644
--- a/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/Element.kt
+++ b/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/Element.kt
@@ -49,6 +49,7 @@ import androidx.compose.ui.util.lerp
import com.android.compose.animation.scene.transformation.PropertyTransformation
import com.android.compose.animation.scene.transformation.SharedElementTransformation
import com.android.compose.ui.util.lerp
+import kotlin.math.roundToInt
import kotlinx.coroutines.launch
/** An element on screen, that can be composed in one or more scenes. */
@@ -81,11 +82,13 @@ internal class Element(val key: ElementKey) {
/** The last state this element had in this scene. */
var lastOffset = Offset.Unspecified
+ var lastSize = SizeUnspecified
var lastScale = Scale.Unspecified
var lastAlpha = AlphaUnspecified
/** The state of this element in this scene right before the last interruption (if any). */
var offsetBeforeInterruption = Offset.Unspecified
+ var sizeBeforeInterruption = SizeUnspecified
var scaleBeforeInterruption = Scale.Unspecified
var alphaBeforeInterruption = AlphaUnspecified
@@ -96,6 +99,7 @@ internal class Element(val key: ElementKey) {
* they nicely animate from their values down to 0.
*/
var offsetInterruptionDelta = Offset.Zero
+ var sizeInterruptionDelta = IntSize.Zero
var scaleInterruptionDelta = Scale.Zero
var alphaInterruptionDelta = 0f
@@ -127,7 +131,14 @@ internal fun Modifier.element(
layoutImpl: SceneTransitionLayoutImpl,
scene: Scene,
key: ElementKey,
-): Modifier = this.then(ElementModifier(layoutImpl, scene, key)).testTag(key.testTag)
+): Modifier {
+ // Make sure that we read the current transitions during composition and not during
+ // layout/drawing.
+ // TODO(b/341072461): Revert this and read the current transitions in ElementNode directly once
+ // we can ensure that SceneTransitionLayoutImpl will compose new scenes first.
+ val currentTransitions = layoutImpl.state.currentTransitions
+ return then(ElementModifier(layoutImpl, currentTransitions, scene, key)).testTag(key.testTag)
+}
/**
* An element associated to [ElementNode]. Note that this element does not support updates as its
@@ -135,18 +146,20 @@ internal fun Modifier.element(
*/
private data class ElementModifier(
private val layoutImpl: SceneTransitionLayoutImpl,
+ private val currentTransitions: List<TransitionState.Transition>,
private val scene: Scene,
private val key: ElementKey,
) : ModifierNodeElement<ElementNode>() {
- override fun create(): ElementNode = ElementNode(layoutImpl, scene, key)
+ override fun create(): ElementNode = ElementNode(layoutImpl, currentTransitions, scene, key)
override fun update(node: ElementNode) {
- node.update(layoutImpl, scene, key)
+ node.update(layoutImpl, currentTransitions, scene, key)
}
}
internal class ElementNode(
private var layoutImpl: SceneTransitionLayoutImpl,
+ private var currentTransitions: List<TransitionState.Transition>,
private var scene: Scene,
private var key: ElementKey,
) : Modifier.Node(), DrawModifierNode, ApproachLayoutModifierNode {
@@ -202,10 +215,13 @@ internal class ElementNode(
fun update(
layoutImpl: SceneTransitionLayoutImpl,
+ currentTransitions: List<TransitionState.Transition>,
scene: Scene,
key: ElementKey,
) {
check(layoutImpl == this.layoutImpl && scene == this.scene)
+ this.currentTransitions = currentTransitions
+
removeNodeFromSceneState()
val prevElement = this.element
@@ -236,7 +252,7 @@ internal class ElementNode(
measurable: Measurable,
constraints: Constraints,
): MeasureResult {
- val transitions = layoutImpl.state.currentTransitions
+ val transitions = currentTransitions
val transition = elementTransition(element, transitions)
// If this element is not supposed to be laid out now, either because it is not part of any
@@ -251,11 +267,13 @@ internal class ElementNode(
sceneState.lastAlpha = Element.AlphaUnspecified
val placeable = measurable.measure(constraints)
+ sceneState.lastSize = placeable.size()
return layout(placeable.width, placeable.height) {}
}
val placeable =
measure(layoutImpl, scene, element, transition, sceneState, measurable, constraints)
+ sceneState.lastSize = placeable.size()
return layout(placeable.width, placeable.height) {
place(
layoutImpl,
@@ -270,7 +288,7 @@ internal class ElementNode(
}
override fun ContentDrawScope.draw() {
- val transition = elementTransition(element, layoutImpl.state.currentTransitions)
+ val transition = elementTransition(element, currentTransitions)
val drawScale = getDrawScale(layoutImpl, scene, element, transition, sceneState)
if (drawScale == Scale.Default) {
drawContent()
@@ -324,10 +342,8 @@ private fun elementTransition(
if (transition != previousTransition && transition != null && previousTransition != null) {
// The previous transition was interrupted by another transition.
- prepareInterruption(element)
- }
-
- if (transition == null && previousTransition != null) {
+ prepareInterruption(element, transition, previousTransition)
+ } else if (transition == null && previousTransition != null) {
// The transition was just finished.
element.sceneStates.values.forEach {
it.clearValuesBeforeInterruption()
@@ -338,48 +354,108 @@ private fun elementTransition(
return transition
}
-private fun prepareInterruption(element: Element) {
- // We look for the last unique state of this element so that we animate the delta with its
- // future state.
- val sceneStates = element.sceneStates.values
- var lastUniqueState: Element.SceneState? = null
- for (sceneState in sceneStates) {
- val offset = sceneState.lastOffset
-
- // If the element was placed in this scene...
- if (offset != Offset.Unspecified) {
- // ... and it is the first (and potentially the only) scene where the element was
- // placed, save the state for later.
- if (lastUniqueState == null) {
- lastUniqueState = sceneState
- } else {
- // The element was placed in multiple scenes: we abort the interruption for this
- // element.
- // TODO(b/290930950): Better support cases where a shared element animation is
- // disabled and the same element is drawn/placed in multiple scenes at the same
- // time.
- lastUniqueState = null
- break
- }
- }
+private fun prepareInterruption(
+ element: Element,
+ transition: TransitionState.Transition,
+ previousTransition: TransitionState.Transition,
+) {
+ val previousUniqueState = reconcileStates(element, previousTransition)
+ if (previousUniqueState == null) {
+ reconcileStates(element, transition)
+ return
}
- val lastOffset = lastUniqueState?.lastOffset ?: Offset.Unspecified
- val lastScale = lastUniqueState?.lastScale ?: Scale.Unspecified
- val lastAlpha = lastUniqueState?.lastAlpha ?: Element.AlphaUnspecified
+ val fromSceneState = element.sceneStates[transition.fromScene]
+ val toSceneState = element.sceneStates[transition.toScene]
+
+ if (
+ fromSceneState == null ||
+ toSceneState == null ||
+ sharedElementTransformation(element.key, transition)?.enabled != false
+ ) {
+ // If there is only one copy of the element or if the element is shared, animate deltas in
+ // both scenes.
+ fromSceneState?.updateValuesBeforeInterruption(previousUniqueState)
+ toSceneState?.updateValuesBeforeInterruption(previousUniqueState)
+ }
+}
+
+/**
+ * Reconcile the state of [element] in the fromScene and toScene of [transition] so that the values
+ * before interruption have their expected values, taking shared transitions into account.
+ *
+ * If the element had a unique state, i.e. it is shared in [transition] or it is only present in one
+ * of the scenes, return it.
+ */
+private fun reconcileStates(
+ element: Element,
+ transition: TransitionState.Transition,
+): Element.SceneState? {
+ val fromSceneState = element.sceneStates[transition.fromScene]
+ val toSceneState = element.sceneStates[transition.toScene]
+ when {
+ // Element is in both scenes.
+ fromSceneState != null && toSceneState != null -> {
+ val isSharedTransformationDisabled =
+ sharedElementTransformation(element.key, transition)?.enabled == false
+ when {
+ // Element shared transition is disabled so the element is placed in both scenes.
+ isSharedTransformationDisabled -> {
+ fromSceneState.updateValuesBeforeInterruption(fromSceneState)
+ toSceneState.updateValuesBeforeInterruption(toSceneState)
+ return null
+ }
+
+ // Element is shared and placed in fromScene only.
+ fromSceneState.lastOffset != Offset.Unspecified -> {
+ fromSceneState.updateValuesBeforeInterruption(fromSceneState)
+ toSceneState.updateValuesBeforeInterruption(fromSceneState)
+ return fromSceneState
+ }
+
+ // Element is shared and placed in toScene only.
+ toSceneState.lastOffset != Offset.Unspecified -> {
+ fromSceneState.updateValuesBeforeInterruption(toSceneState)
+ toSceneState.updateValuesBeforeInterruption(toSceneState)
+ return toSceneState
+ }
- // Store the state of the element before the interruption and reset the deltas.
- sceneStates.forEach { sceneState ->
- sceneState.offsetBeforeInterruption = lastOffset
- sceneState.scaleBeforeInterruption = lastScale
- sceneState.alphaBeforeInterruption = lastAlpha
+ // Element is in none of the scenes.
+ else -> {
+ fromSceneState.updateValuesBeforeInterruption(null)
+ toSceneState.updateValuesBeforeInterruption(null)
+ return null
+ }
+ }
+ }
- sceneState.clearInterruptionDeltas()
+ // Element is only in fromScene.
+ fromSceneState != null -> {
+ fromSceneState.updateValuesBeforeInterruption(fromSceneState)
+ return fromSceneState
+ }
+
+ // Element is only in toScene.
+ toSceneState != null -> {
+ toSceneState.updateValuesBeforeInterruption(toSceneState)
+ return toSceneState
+ }
+ else -> return null
}
}
+private fun Element.SceneState.updateValuesBeforeInterruption(lastState: Element.SceneState?) {
+ offsetBeforeInterruption = lastState?.lastOffset ?: Offset.Unspecified
+ sizeBeforeInterruption = lastState?.lastSize ?: Element.SizeUnspecified
+ scaleBeforeInterruption = lastState?.lastScale ?: Scale.Unspecified
+ alphaBeforeInterruption = lastState?.lastAlpha ?: Element.AlphaUnspecified
+
+ clearInterruptionDeltas()
+}
+
private fun Element.SceneState.clearInterruptionDeltas() {
offsetInterruptionDelta = Offset.Zero
+ sizeInterruptionDelta = IntSize.Zero
scaleInterruptionDelta = Scale.Zero
alphaInterruptionDelta = 0f
}
@@ -615,7 +691,6 @@ private fun interruptedAlpha(
)
}
-@OptIn(ExperimentalComposeUiApi::class)
private fun ApproachMeasureScope.measure(
layoutImpl: SceneTransitionLayoutImpl,
scene: Scene,
@@ -637,8 +712,6 @@ private fun ApproachMeasureScope.measure(
// once.
var maybePlaceable: Placeable? = null
- fun Placeable.size() = IntSize(width, height)
-
val targetSize =
computeValue(
layoutImpl,
@@ -653,15 +726,44 @@ private fun ApproachMeasureScope.measure(
::lerp,
)
- return maybePlaceable
- ?: measurable.measure(
- Constraints.fixed(
- targetSize.width.coerceAtLeast(0),
- targetSize.height.coerceAtLeast(0),
- )
+ // The measurable was already measured, so we can't take interruptions into account here given
+ // that we are not allowed to measure the same measurable twice.
+ maybePlaceable?.let { placeable ->
+ sceneState.sizeBeforeInterruption = Element.SizeUnspecified
+ sceneState.sizeInterruptionDelta = IntSize.Zero
+ return placeable
+ }
+
+ val interruptedSize =
+ computeInterruptedValue(
+ layoutImpl,
+ transition,
+ value = targetSize,
+ unspecifiedValue = Element.SizeUnspecified,
+ zeroValue = IntSize.Zero,
+ getValueBeforeInterruption = { sceneState.sizeBeforeInterruption },
+ setValueBeforeInterruption = { sceneState.sizeBeforeInterruption = it },
+ getInterruptionDelta = { sceneState.sizeInterruptionDelta },
+ setInterruptionDelta = { sceneState.sizeInterruptionDelta = it },
+ diff = { a, b -> IntSize(a.width - b.width, a.height - b.height) },
+ add = { a, b, bProgress ->
+ IntSize(
+ (a.width + b.width * bProgress).roundToInt(),
+ (a.height + b.height * bProgress).roundToInt(),
+ )
+ },
+ )
+
+ return measurable.measure(
+ Constraints.fixed(
+ interruptedSize.width.coerceAtLeast(0),
+ interruptedSize.height.coerceAtLeast(0),
)
+ )
}
+private fun Placeable.size(): IntSize = IntSize(width, height)
+
private fun ContentDrawScope.getDrawScale(
layoutImpl: SceneTransitionLayoutImpl,
scene: Scene,
diff --git a/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/ObservableTransitionState.kt b/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/ObservableTransitionState.kt
index 92d5c26148e4..f1b2249fc29e 100644
--- a/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/ObservableTransitionState.kt
+++ b/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/ObservableTransitionState.kt
@@ -73,7 +73,16 @@ sealed interface ObservableTransitionState {
* the transition completes/settles.
*/
val isUserInputOngoing: Flow<Boolean>,
- ) : ObservableTransitionState
+ ) : ObservableTransitionState {
+ override fun toString(): String =
+ """Transition
+ |(from=$fromScene,
+ | to=$toScene,
+ | isInitiatedByUserInput=$isInitiatedByUserInput,
+ | isUserInputOngoing=$isUserInputOngoing
+ |)"""
+ .trimMargin()
+ }
fun isIdle(scene: SceneKey?): Boolean {
return this is Idle && (scene == null || this.currentScene == scene)
diff --git a/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/SceneTransitionLayoutImpl.kt b/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/SceneTransitionLayoutImpl.kt
index d383cec324d3..7856498aa365 100644
--- a/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/SceneTransitionLayoutImpl.kt
+++ b/packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/SceneTransitionLayoutImpl.kt
@@ -126,6 +126,10 @@ internal class SceneTransitionLayoutImpl(
orientation = Orientation.Vertical,
coroutineScope = coroutineScope,
)
+
+ // Make sure that the state is created on the same thread (most probably the main thread)
+ // than this STLImpl.
+ state.checkThread()
}
internal fun draggableHandler(orientation: Orientation): DraggableHandlerImpl =
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 4e3a03293796..a5b6d2486168 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
@@ -26,8 +26,10 @@ import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.SideEffect
import androidx.compose.runtime.Stable
+import androidx.compose.runtime.getValue
+import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
-import androidx.compose.runtime.snapshots.SnapshotStateList
+import androidx.compose.runtime.setValue
import androidx.compose.ui.util.fastAll
import androidx.compose.ui.util.fastFilter
import androidx.compose.ui.util.fastForEach
@@ -374,14 +376,17 @@ internal abstract class BaseSceneTransitionLayoutState(
// TODO(b/290930950): Remove this flag.
internal var enableInterruptions: Boolean,
) : SceneTransitionLayoutState {
+ private val creationThread: Thread = Thread.currentThread()
+
/**
* The current [TransitionState]. This list will either be:
* 1. A list with a single [TransitionState.Idle] element, when we are idle.
* 2. A list with one or more [TransitionState.Transition], when we are transitioning.
*/
@VisibleForTesting
- internal val transitionStates: MutableList<TransitionState> =
- SnapshotStateList<TransitionState>().apply { add(TransitionState.Idle(initialScene)) }
+ internal var transitionStates: List<TransitionState> by
+ mutableStateOf(listOf(TransitionState.Idle(initialScene)))
+ private set
override val transitionState: TransitionState
get() = transitionStates.last()
@@ -417,6 +422,20 @@ internal abstract class BaseSceneTransitionLayoutState(
*/
internal abstract fun CoroutineScope.onChangeScene(scene: SceneKey)
+ internal fun checkThread() {
+ val current = Thread.currentThread()
+ if (current !== creationThread) {
+ error(
+ """
+ Only the original thread that created a SceneTransitionLayoutState can mutate it
+ Expected: ${creationThread.name}
+ Current: ${current.name}
+ """
+ .trimIndent()
+ )
+ }
+ }
+
override fun isTransitioning(from: SceneKey?, to: SceneKey?): Boolean {
val transition = currentTransition ?: return false
return transition.isTransitioning(from, to)
@@ -441,6 +460,8 @@ internal abstract class BaseSceneTransitionLayoutState(
transitionKey: TransitionKey?,
chain: Boolean = true,
) {
+ checkThread()
+
// Compute the [TransformationSpec] when the transition starts.
val fromScene = transition.fromScene
val toScene = transition.toScene
@@ -465,7 +486,7 @@ internal abstract class BaseSceneTransitionLayoutState(
if (!enableInterruptions) {
// Set the current transition.
check(transitionStates.size == 1)
- transitionStates[0] = transition
+ transitionStates = listOf(transition)
return
}
@@ -473,14 +494,12 @@ internal abstract class BaseSceneTransitionLayoutState(
is TransitionState.Idle -> {
// Replace [Idle] by [transition].
check(transitionStates.size == 1)
- transitionStates[0] = transition
+ transitionStates = listOf(transition)
}
is TransitionState.Transition -> {
- // Force the current transition to finish to currentScene.
- currentState.finish().invokeOnCompletion {
- // Make sure [finishTransition] is called at the end of the transition.
- finishTransition(currentState, currentState.currentScene)
- }
+ // Force the current transition to finish to currentScene. The transition will call
+ // [finishTransition] once it's finished.
+ currentState.finish()
val tooManyTransitions = transitionStates.size >= MAX_CONCURRENT_TRANSITIONS
val clearCurrentTransitions = !chain || tooManyTransitions
@@ -497,11 +516,11 @@ internal abstract class BaseSceneTransitionLayoutState(
// we end up only with the new transition after appending it.
check(transitionStates.size == 1)
check(transitionStates[0] is TransitionState.Idle)
- transitionStates.clear()
+ transitionStates = listOf(transition)
+ } else {
+ // Append the new transition.
+ transitionStates = transitionStates + transition
}
-
- // Append the new transition.
- transitionStates.add(transition)
}
}
}
@@ -561,6 +580,8 @@ internal abstract class BaseSceneTransitionLayoutState(
* nothing if [transition] was interrupted since it was started.
*/
internal fun finishTransition(transition: TransitionState.Transition, idleScene: SceneKey) {
+ checkThread()
+
val existingIdleScene = finishedTransitions[transition]
if (existingIdleScene != null) {
// This transition was already finished.
@@ -571,6 +592,7 @@ internal abstract class BaseSceneTransitionLayoutState(
return
}
+ val transitionStates = this.transitionStates
if (!transitionStates.contains(transition)) {
// This transition was already removed from transitionStates.
return
@@ -589,25 +611,42 @@ internal abstract class BaseSceneTransitionLayoutState(
var lastRemovedIdleScene: SceneKey? = null
// Remove all first n finished transitions.
- while (transitionStates.isNotEmpty()) {
- val firstTransition = transitionStates[0]
- if (!finishedTransitions.contains(firstTransition)) {
+ var i = 0
+ val nStates = transitionStates.size
+ while (i < nStates) {
+ val t = transitionStates[i]
+ if (!finishedTransitions.contains(t)) {
// Stop here.
break
}
- // Remove the transition from the list and from the set of finished transitions.
- transitionStates.removeAt(0)
- lastRemovedIdleScene = finishedTransitions.remove(firstTransition)
+ // Remove the transition from the set of finished transitions.
+ lastRemovedIdleScene = finishedTransitions.remove(t)
+ i++
}
// If all transitions are finished, we are idle.
- if (transitionStates.isEmpty()) {
+ if (i == nStates) {
check(finishedTransitions.isEmpty())
- transitionStates.add(TransitionState.Idle(checkNotNull(lastRemovedIdleScene)))
+ this.transitionStates = listOf(TransitionState.Idle(checkNotNull(lastRemovedIdleScene)))
+ } else if (i > 0) {
+ this.transitionStates = transitionStates.subList(fromIndex = i, toIndex = nStates)
}
}
+ fun snapToScene(scene: SceneKey) {
+ checkThread()
+
+ // Force finish all transitions.
+ while (currentTransitions.isNotEmpty()) {
+ val transition = transitionStates[0] as TransitionState.Transition
+ finishTransition(transition, transition.currentScene)
+ }
+
+ check(transitionStates.size == 1)
+ transitionStates = listOf(TransitionState.Idle(scene))
+ }
+
private fun finishActiveTransitionLinks(idleScene: SceneKey) {
val previousTransition = this.transitionState as? TransitionState.Transition ?: return
for ((link, linkedTransition) in activeTransitionLinks) {
@@ -736,6 +775,8 @@ internal class MutableSceneTransitionLayoutStateImpl(
coroutineScope: CoroutineScope,
transitionKey: TransitionKey?,
): TransitionState.Transition? {
+ checkThread()
+
return coroutineScope.animateToScene(
layoutState = this@MutableSceneTransitionLayoutStateImpl,
target = targetScene,
@@ -748,17 +789,6 @@ internal class MutableSceneTransitionLayoutStateImpl(
override fun CoroutineScope.onChangeScene(scene: SceneKey) {
setTargetScene(scene, coroutineScope = this)
}
-
- override fun snapToScene(scene: SceneKey) {
- // Force finish all transitions.
- while (currentTransitions.isNotEmpty()) {
- val transition = transitionStates[0] as TransitionState.Transition
- finishTransition(transition, transition.currentScene)
- }
-
- check(transitionStates.size == 1)
- transitionStates[0] = TransitionState.Idle(scene)
- }
}
private const val TAG = "SceneTransitionLayoutState"
diff --git a/packages/SystemUI/compose/scene/tests/Android.bp b/packages/SystemUI/compose/scene/tests/Android.bp
index af1389680bd2..3509504b6357 100644
--- a/packages/SystemUI/compose/scene/tests/Android.bp
+++ b/packages/SystemUI/compose/scene/tests/Android.bp
@@ -25,8 +25,8 @@ package {
android_test {
name: "PlatformComposeSceneTransitionLayoutTests",
manifest: "AndroidManifest.xml",
+ defaults: ["MotionTestDefaults"],
test_suites: ["device-tests"],
- certificate: "platform",
srcs: [
"src/**/*.kt",
@@ -38,7 +38,7 @@ android_test {
static_libs: [
"PlatformComposeSceneTransitionLayoutTestsUtils",
-
+ "PlatformMotionTestingCompose",
"androidx.test.runner",
"androidx.test.ext.junit",
@@ -48,7 +48,7 @@ android_test {
"truth",
],
-
+ asset_dirs: ["goldens"],
kotlincflags: ["-Xjvm-default=all"],
use_resource_processor: true,
}
diff --git a/packages/SystemUI/compose/scene/tests/AndroidManifest.xml b/packages/SystemUI/compose/scene/tests/AndroidManifest.xml
index 1a9172ee20e0..174ad30a8f1d 100644
--- a/packages/SystemUI/compose/scene/tests/AndroidManifest.xml
+++ b/packages/SystemUI/compose/scene/tests/AndroidManifest.xml
@@ -17,6 +17,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.android.compose.animation.scene.tests" >
+ <uses-permission android:name="android.permission.WRITE_SECURE_SETTINGS" />
<application>
<uses-library android:name="android.test.runner" />
</application>
diff --git a/packages/SystemUI/compose/scene/tests/goldens/testAnchoredHeightOnly.json b/packages/SystemUI/compose/scene/tests/goldens/testAnchoredHeightOnly.json
new file mode 100644
index 000000000000..0843663baed4
--- /dev/null
+++ b/packages/SystemUI/compose/scene/tests/goldens/testAnchoredHeightOnly.json
@@ -0,0 +1,41 @@
+{
+ "frame_ids": [
+ "before",
+ 0,
+ 16,
+ 32,
+ 48,
+ "after"
+ ],
+ "features": [
+ {
+ "name": "Bar_size",
+ "type": "dpSize",
+ "data_points": [
+ {
+ "type": "not_found"
+ },
+ {
+ "width": 200,
+ "height": 100
+ },
+ {
+ "width": 200,
+ "height": 90
+ },
+ {
+ "width": 200,
+ "height": 80
+ },
+ {
+ "width": 200,
+ "height": 70
+ },
+ {
+ "width": 200,
+ "height": 60
+ }
+ ]
+ }
+ ]
+} \ No newline at end of file
diff --git a/packages/SystemUI/compose/scene/tests/goldens/testAnchoredSizeEnter.json b/packages/SystemUI/compose/scene/tests/goldens/testAnchoredSizeEnter.json
new file mode 100644
index 000000000000..2df440912bfc
--- /dev/null
+++ b/packages/SystemUI/compose/scene/tests/goldens/testAnchoredSizeEnter.json
@@ -0,0 +1,41 @@
+{
+ "frame_ids": [
+ "before",
+ 0,
+ 16,
+ 32,
+ 48,
+ "after"
+ ],
+ "features": [
+ {
+ "name": "Bar_size",
+ "type": "dpSize",
+ "data_points": [
+ {
+ "type": "not_found"
+ },
+ {
+ "width": 100,
+ "height": 100
+ },
+ {
+ "width": 125.14286,
+ "height": 90
+ },
+ {
+ "width": 150,
+ "height": 80
+ },
+ {
+ "width": 175.14285,
+ "height": 70
+ },
+ {
+ "width": 200,
+ "height": 60
+ }
+ ]
+ }
+ ]
+} \ No newline at end of file
diff --git a/packages/SystemUI/compose/scene/tests/goldens/testAnchoredSizeExit.json b/packages/SystemUI/compose/scene/tests/goldens/testAnchoredSizeExit.json
new file mode 100644
index 000000000000..2b0a9541a394
--- /dev/null
+++ b/packages/SystemUI/compose/scene/tests/goldens/testAnchoredSizeExit.json
@@ -0,0 +1,41 @@
+{
+ "frame_ids": [
+ "before",
+ 0,
+ 16,
+ 32,
+ 48,
+ "after"
+ ],
+ "features": [
+ {
+ "name": "Bar_size",
+ "type": "dpSize",
+ "data_points": [
+ {
+ "width": 100,
+ "height": 100
+ },
+ {
+ "width": 100,
+ "height": 100
+ },
+ {
+ "width": 125.14286,
+ "height": 90
+ },
+ {
+ "width": 150,
+ "height": 80
+ },
+ {
+ "width": 175.14285,
+ "height": 70
+ },
+ {
+ "type": "not_found"
+ }
+ ]
+ }
+ ]
+} \ No newline at end of file
diff --git a/packages/SystemUI/compose/scene/tests/goldens/testAnchoredWidthOnly.json b/packages/SystemUI/compose/scene/tests/goldens/testAnchoredWidthOnly.json
new file mode 100644
index 000000000000..027df299d15e
--- /dev/null
+++ b/packages/SystemUI/compose/scene/tests/goldens/testAnchoredWidthOnly.json
@@ -0,0 +1,41 @@
+{
+ "frame_ids": [
+ "before",
+ 0,
+ 16,
+ 32,
+ 48,
+ "after"
+ ],
+ "features": [
+ {
+ "name": "Bar_size",
+ "type": "dpSize",
+ "data_points": [
+ {
+ "type": "not_found"
+ },
+ {
+ "width": 100,
+ "height": 60
+ },
+ {
+ "width": 125.14286,
+ "height": 60
+ },
+ {
+ "width": 150,
+ "height": 60
+ },
+ {
+ "width": 175.14285,
+ "height": 60
+ },
+ {
+ "width": 200,
+ "height": 60
+ }
+ ]
+ }
+ ]
+} \ No newline at end of file
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 e19dc965a394..3eef1f0c5db6 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
@@ -56,6 +56,7 @@ import androidx.compose.ui.test.performTouchInput
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.DpOffset
import androidx.compose.ui.unit.DpSize
+import androidx.compose.ui.unit.IntSize
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.lerp
import androidx.test.ext.junit.runners.AndroidJUnit4
@@ -63,11 +64,13 @@ 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.subjects.assertThat
+import com.android.compose.test.assertSizeIsEqualTo
import com.google.common.truth.Truth.assertThat
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.launch
import kotlinx.coroutines.test.runTest
import org.junit.Assert.assertThrows
+import org.junit.Ignore
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith
@@ -237,9 +240,9 @@ class ElementTest {
changeScene(SceneC)
}
- at(2 * frameDuration) { onElement(TestElements.Bar).assertIsNotDisplayed() }
+ at(3 * frameDuration) { onElement(TestElements.Bar).assertIsNotDisplayed() }
- at(3 * frameDuration) { onElement(TestElements.Bar).assertDoesNotExist() }
+ at(4 * frameDuration) { onElement(TestElements.Bar).assertDoesNotExist() }
}
}
@@ -578,6 +581,7 @@ class ElementTest {
}
@Test
+ @Ignore("b/341072461")
fun existingElementsDontRecomposeWhenTransitionStateChanges() {
var fooCompositions = 0
@@ -603,6 +607,43 @@ class ElementTest {
}
}
+ @Test
+ // TODO(b/341072461): Remove this test.
+ fun layoutGetsCurrentTransitionStateFromComposition() {
+ val state =
+ rule.runOnUiThread {
+ MutableSceneTransitionLayoutStateImpl(
+ SceneA,
+ transitions {
+ from(SceneA, to = SceneB) {
+ scaleSize(TestElements.Foo, width = 2f, height = 2f)
+ }
+ }
+ )
+ }
+
+ rule.setContent {
+ SceneTransitionLayout(state) {
+ scene(SceneA) { Box(Modifier.element(TestElements.Foo).size(20.dp)) }
+ scene(SceneB) {}
+ }
+ }
+
+ // Pause the clock to block recompositions.
+ rule.mainClock.autoAdvance = false
+
+ // Change the current transition.
+ rule.runOnUiThread {
+ state.startTransition(
+ transition(from = SceneA, to = SceneB, progress = { 0.5f }),
+ transitionKey = null,
+ )
+ }
+
+ // The size of Foo should still be 20dp given that the new state was not composed yet.
+ rule.onNode(isElement(TestElements.Foo)).assertSizeIsEqualTo(20.dp, 20.dp)
+ }
+
private fun setupOverscrollScenario(
layoutWidth: Dp,
layoutHeight: Dp,
@@ -616,11 +657,13 @@ class ElementTest {
var touchSlop = 0f
val state =
- MutableSceneTransitionLayoutState(
- initialScene = SceneA,
- transitions = transitions(sceneTransitions),
- )
- as MutableSceneTransitionLayoutStateImpl
+ rule.runOnUiThread {
+ MutableSceneTransitionLayoutState(
+ initialScene = SceneA,
+ transitions = transitions(sceneTransitions),
+ )
+ as MutableSceneTransitionLayoutStateImpl
+ }
rule.setContent {
touchSlop = LocalViewConfiguration.current.touchSlop
@@ -726,16 +769,18 @@ class ElementTest {
val layoutHeight = 400.dp
val state =
- MutableSceneTransitionLayoutState(
- initialScene = SceneB,
- transitions =
- transitions {
- overscroll(SceneB, Orientation.Vertical) {
- translate(TestElements.Foo, y = overscrollTranslateY)
+ rule.runOnUiThread {
+ MutableSceneTransitionLayoutState(
+ initialScene = SceneB,
+ transitions =
+ transitions {
+ overscroll(SceneB, Orientation.Vertical) {
+ translate(TestElements.Foo, y = overscrollTranslateY)
+ }
}
- }
- )
- as MutableSceneTransitionLayoutStateImpl
+ )
+ as MutableSceneTransitionLayoutStateImpl
+ }
rule.setContent {
touchSlop = LocalViewConfiguration.current.touchSlop
@@ -902,32 +947,36 @@ class ElementTest {
val duration = 4 * 16
val state =
- MutableSceneTransitionLayoutState(
- SceneA,
- transitions {
- // Foo is at the top left corner of scene A. We make it disappear during A => B
- // to the right edge so it translates to the right.
- from(SceneA, to = SceneB) {
- spec = tween(duration, easing = LinearEasing)
- translate(
- TestElements.Foo,
- edge = Edge.Right,
- startsOutsideLayoutBounds = false,
- )
- }
+ rule.runOnUiThread {
+ MutableSceneTransitionLayoutState(
+ SceneA,
+ transitions {
+ // Foo is at the top left corner of scene A. We make it disappear during A
+ // => B
+ // to the right edge so it translates to the right.
+ from(SceneA, to = SceneB) {
+ spec = tween(duration, easing = LinearEasing)
+ translate(
+ TestElements.Foo,
+ edge = Edge.Right,
+ startsOutsideLayoutBounds = false,
+ )
+ }
- // Bar is at the top right corner of scene C. We make it appear during B => C
- // from the left edge so it translates to the right at same time as Foo.
- from(SceneB, to = SceneC) {
- spec = tween(duration, easing = LinearEasing)
- translate(
- TestElements.Bar,
- edge = Edge.Left,
- startsOutsideLayoutBounds = false,
- )
+ // Bar is at the top right corner of scene C. We make it appear during B =>
+ // C
+ // from the left edge so it translates to the right at same time as Foo.
+ from(SceneB, to = SceneC) {
+ spec = tween(duration, easing = LinearEasing)
+ translate(
+ TestElements.Bar,
+ edge = Edge.Left,
+ startsOutsideLayoutBounds = false,
+ )
+ }
}
- }
- )
+ )
+ }
val layoutSize = 150.dp
val elemSize = 50.dp
@@ -1023,23 +1072,28 @@ class ElementTest {
val duration = 4 * 16
val state =
- MutableSceneTransitionLayoutStateImpl(
- SceneA,
- transitions {
- from(SceneA, to = SceneB) { spec = tween(duration, easing = LinearEasing) }
- from(SceneB, to = SceneC) { spec = tween(duration, easing = LinearEasing) }
- },
- enableInterruptions = false,
- )
+ rule.runOnUiThread {
+ MutableSceneTransitionLayoutStateImpl(
+ SceneA,
+ transitions {
+ from(SceneA, to = SceneB) { spec = tween(duration, easing = LinearEasing) }
+ from(SceneB, to = SceneC) { spec = tween(duration, easing = LinearEasing) }
+ },
+ )
+ }
val layoutSize = DpSize(200.dp, 100.dp)
- val fooSize = DpSize(20.dp, 10.dp)
@Composable
- fun SceneScope.Foo(modifier: Modifier = Modifier) {
- Box(modifier.element(TestElements.Foo).size(fooSize))
+ fun SceneScope.Foo(size: Dp, modifier: Modifier = Modifier) {
+ Box(modifier.element(TestElements.Foo).size(size))
}
+ // The size of Foo when idle in A, B or C.
+ val sizeInA = 10.dp
+ val sizeInB = 30.dp
+ val sizeInC = 50.dp
+
lateinit var layoutImpl: SceneTransitionLayoutImpl
rule.setContent {
SceneTransitionLayoutForTesting(
@@ -1049,33 +1103,35 @@ class ElementTest {
) {
// In scene A, Foo is aligned at the TopStart.
scene(SceneA) {
- Box(Modifier.fillMaxSize()) { Foo(Modifier.align(Alignment.TopStart)) }
+ Box(Modifier.fillMaxSize()) { Foo(sizeInA, Modifier.align(Alignment.TopStart)) }
}
// In scene C, Foo is aligned at the BottomEnd, so it moves vertically when coming
// from B. We put it before (below) scene B so that we can check that interruptions
// values and deltas are properly cleared once all transitions are done.
scene(SceneC) {
- Box(Modifier.fillMaxSize()) { Foo(Modifier.align(Alignment.BottomEnd)) }
+ Box(Modifier.fillMaxSize()) {
+ Foo(sizeInC, Modifier.align(Alignment.BottomEnd))
+ }
}
// In scene B, Foo is aligned at the TopEnd, so it moves horizontally when coming
// from A.
scene(SceneB) {
- Box(Modifier.fillMaxSize()) { Foo(Modifier.align(Alignment.TopEnd)) }
+ Box(Modifier.fillMaxSize()) { Foo(sizeInB, Modifier.align(Alignment.TopEnd)) }
}
}
}
// The offset of Foo when idle in A, B or C.
val offsetInA = DpOffset.Zero
- val offsetInB = DpOffset(layoutSize.width - fooSize.width, 0.dp)
- val offsetInC =
- DpOffset(layoutSize.width - fooSize.width, layoutSize.height - fooSize.height)
+ val offsetInB = DpOffset(layoutSize.width - sizeInB, 0.dp)
+ val offsetInC = DpOffset(layoutSize.width - sizeInC, layoutSize.height - sizeInC)
// Initial state (idle in A).
rule
.onNode(isElement(TestElements.Foo, SceneA))
+ .assertSizeIsEqualTo(sizeInA)
.assertPositionInRootIsEqualTo(offsetInA.x, offsetInA.y)
// Current transition is A => B at 50%.
@@ -1088,9 +1144,11 @@ class ElementTest {
onFinish = neverFinish(),
)
val offsetInAToB = lerp(offsetInA, offsetInB, aToBProgress)
+ val sizeInAToB = lerp(sizeInA, sizeInB, aToBProgress)
rule.runOnUiThread { state.startTransition(aToB, transitionKey = null) }
rule
.onNode(isElement(TestElements.Foo, SceneB))
+ .assertSizeIsEqualTo(sizeInAToB)
.assertPositionInRootIsEqualTo(offsetInAToB.x, offsetInAToB.y)
// Start B => C at 0%.
@@ -1105,26 +1163,30 @@ class ElementTest {
)
rule.runOnUiThread { state.startTransition(bToC, transitionKey = null) }
- // The offset interruption delta, which will be multiplied by the interruption progress then
- // added to the current transition offset.
- val interruptionDelta = offsetInAToB - offsetInB
+ // The interruption deltas, which will be multiplied by the interruption progress then added
+ // to the current transition offset and size.
+ val offsetInterruptionDelta = offsetInAToB - offsetInB
+ val sizeInterruptionDelta = sizeInAToB - sizeInB
// Interruption progress is at 100% and bToC is at 0%, so Foo should be at the same offset
- // as right before the interruption.
+ // and size as right before the interruption.
rule
.onNode(isElement(TestElements.Foo, SceneB))
.assertPositionInRootIsEqualTo(offsetInAToB.x, offsetInAToB.y)
+ .assertSizeIsEqualTo(sizeInAToB)
// Move the transition forward at 30% and set the interruption progress to 50%.
bToCProgress = 0.3f
interruptionProgress = 0.5f
val offsetInBToC = lerp(offsetInB, offsetInC, bToCProgress)
+ val sizeInBToC = lerp(sizeInB, sizeInC, bToCProgress)
val offsetInBToCWithInterruption =
offsetInBToC +
DpOffset(
- interruptionDelta.x * interruptionProgress,
- interruptionDelta.y * interruptionProgress,
+ offsetInterruptionDelta.x * interruptionProgress,
+ offsetInterruptionDelta.y * interruptionProgress,
)
+ val sizeInBToCWithInterruption = sizeInBToC + sizeInterruptionDelta * interruptionProgress
rule.waitForIdle()
rule
.onNode(isElement(TestElements.Foo, SceneB))
@@ -1132,6 +1194,7 @@ class ElementTest {
offsetInBToCWithInterruption.x,
offsetInBToCWithInterruption.y,
)
+ .assertSizeIsEqualTo(sizeInBToCWithInterruption)
// Finish the transition and interruption.
bToCProgress = 1f
@@ -1139,10 +1202,13 @@ class ElementTest {
rule
.onNode(isElement(TestElements.Foo, SceneB))
.assertPositionInRootIsEqualTo(offsetInC.x, offsetInC.y)
+ .assertSizeIsEqualTo(sizeInC)
// Manually finish the transition.
- state.finishTransition(aToB, SceneB)
- state.finishTransition(bToC, SceneC)
+ rule.runOnUiThread {
+ state.finishTransition(aToB, SceneB)
+ state.finishTransition(bToC, SceneC)
+ }
rule.waitForIdle()
assertThat(state.transitionState).isIdle()
@@ -1151,10 +1217,118 @@ class ElementTest {
assertThat(foo.sceneStates.keys).containsExactly(SceneC)
val stateInC = foo.sceneStates.getValue(SceneC)
assertThat(stateInC.offsetBeforeInterruption).isEqualTo(Offset.Unspecified)
+ assertThat(stateInC.sizeBeforeInterruption).isEqualTo(Element.SizeUnspecified)
assertThat(stateInC.scaleBeforeInterruption).isEqualTo(Scale.Unspecified)
assertThat(stateInC.alphaBeforeInterruption).isEqualTo(Element.AlphaUnspecified)
assertThat(stateInC.offsetInterruptionDelta).isEqualTo(Offset.Zero)
+ assertThat(stateInC.sizeInterruptionDelta).isEqualTo(IntSize.Zero)
assertThat(stateInC.scaleInterruptionDelta).isEqualTo(Scale.Zero)
assertThat(stateInC.alphaInterruptionDelta).isEqualTo(0f)
}
+
+ @Test
+ fun interruption_sharedTransitionDisabled() = runTest {
+ // 4 frames of animation.
+ val duration = 4 * 16
+ val layoutSize = DpSize(200.dp, 100.dp)
+ val fooSize = 100.dp
+ val state =
+ rule.runOnUiThread {
+ MutableSceneTransitionLayoutStateImpl(
+ SceneA,
+ transitions {
+ from(SceneA, to = SceneB) { spec = tween(duration, easing = LinearEasing) }
+
+ // Disable the shared transition during B => C.
+ from(SceneB, to = SceneC) {
+ spec = tween(duration, easing = LinearEasing)
+ sharedElement(TestElements.Foo, enabled = false)
+ }
+ },
+ )
+ }
+
+ @Composable
+ fun SceneScope.Foo(modifier: Modifier = Modifier) {
+ Box(modifier.element(TestElements.Foo).size(fooSize))
+ }
+
+ rule.setContent {
+ SceneTransitionLayout(state, Modifier.size(layoutSize)) {
+ scene(SceneA) {
+ Box(Modifier.fillMaxSize()) { Foo(Modifier.align(Alignment.TopStart)) }
+ }
+
+ scene(SceneB) {
+ Box(Modifier.fillMaxSize()) { Foo(Modifier.align(Alignment.TopEnd)) }
+ }
+
+ scene(SceneC) {
+ Box(Modifier.fillMaxSize()) { Foo(Modifier.align(Alignment.BottomEnd)) }
+ }
+ }
+ }
+
+ // The offset of Foo when idle in A, B or C.
+ val offsetInA = DpOffset.Zero
+ val offsetInB = DpOffset(layoutSize.width - fooSize, 0.dp)
+ val offsetInC = DpOffset(layoutSize.width - fooSize, layoutSize.height - fooSize)
+
+ // State is a transition A => B at 50% interrupted by B => C at 30%.
+ val aToB =
+ transition(from = SceneA, to = SceneB, progress = { 0.5f }, onFinish = neverFinish())
+ var bToCInterruptionProgress by mutableStateOf(1f)
+ val bToC =
+ transition(
+ from = SceneB,
+ to = SceneC,
+ progress = { 0.3f },
+ interruptionProgress = { bToCInterruptionProgress },
+ onFinish = neverFinish(),
+ )
+ rule.runOnUiThread { state.startTransition(aToB, transitionKey = null) }
+ rule.waitForIdle()
+ rule.runOnUiThread { state.startTransition(bToC, transitionKey = null) }
+
+ // Foo is placed in both B and C given that the shared transition is disabled. In B, its
+ // offset is impacted by the interruption but in C it is not.
+ val offsetInAToB = lerp(offsetInA, offsetInB, 0.5f)
+ val interruptionDelta = offsetInAToB - offsetInB
+ assertThat(interruptionDelta).isNotEqualTo(Offset.Zero)
+ rule
+ .onNode(isElement(TestElements.Foo, SceneB))
+ .assertPositionInRootIsEqualTo(
+ offsetInB.x + interruptionDelta.x,
+ offsetInB.y + interruptionDelta.y,
+ )
+
+ rule
+ .onNode(isElement(TestElements.Foo, SceneC))
+ .assertPositionInRootIsEqualTo(offsetInC.x, offsetInC.y)
+
+ // Manually finish A => B so only B => C is remaining.
+ bToCInterruptionProgress = 0f
+ rule.runOnUiThread { state.finishTransition(aToB, SceneB) }
+ rule
+ .onNode(isElement(TestElements.Foo, SceneB))
+ .assertPositionInRootIsEqualTo(offsetInB.x, offsetInB.y)
+ rule
+ .onNode(isElement(TestElements.Foo, SceneC))
+ .assertPositionInRootIsEqualTo(offsetInC.x, offsetInC.y)
+
+ // Interrupt B => C by B => A, starting directly at 70%
+ val bToA =
+ transition(
+ from = SceneB,
+ to = SceneA,
+ progress = { 0.7f },
+ interruptionProgress = { 1f },
+ )
+ rule.runOnUiThread { state.startTransition(bToA, transitionKey = null) }
+
+ // Foo should have the position it had in B right before the interruption.
+ rule
+ .onNode(isElement(TestElements.Foo, SceneB))
+ .assertPositionInRootIsEqualTo(offsetInB.x, offsetInB.y)
+ }
}
diff --git a/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/SceneTransitionLayoutTest.kt b/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/SceneTransitionLayoutTest.kt
index 692c18bb8ac5..3751a229b690 100644
--- a/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/SceneTransitionLayoutTest.kt
+++ b/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/SceneTransitionLayoutTest.kt
@@ -76,12 +76,13 @@ class SceneTransitionLayoutTest {
/** The content under test. */
@Composable
- private fun TestContent() {
+ private fun TestContent(enableInterruptions: Boolean = true) {
layoutState =
updateSceneTransitionLayoutState(
currentScene,
{ currentScene = it },
- EmptyTestTransitions
+ EmptyTestTransitions,
+ enableInterruptions = enableInterruptions,
)
SceneTransitionLayout(
@@ -219,7 +220,7 @@ class SceneTransitionLayoutTest {
@Test
fun testSharedElement() {
- rule.setContent { TestContent() }
+ rule.setContent { TestContent(enableInterruptions = false) }
// In scene A, the shared element SharedFoo() is at the top end of the layout and has a size
// of 50.dp.
diff --git a/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/SwipeToSceneTest.kt b/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/SwipeToSceneTest.kt
index 1dd9322b3ad5..3a806a44be64 100644
--- a/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/SwipeToSceneTest.kt
+++ b/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/SwipeToSceneTest.kt
@@ -70,7 +70,9 @@ class SwipeToSceneTest {
private fun layoutState(
initialScene: SceneKey = SceneA,
transitions: SceneTransitions = EmptyTestTransitions,
- ) = MutableSceneTransitionLayoutState(initialScene, transitions)
+ ): MutableSceneTransitionLayoutState {
+ return rule.runOnUiThread { MutableSceneTransitionLayoutState(initialScene, transitions) }
+ }
/** The content under test. */
@Composable
@@ -455,7 +457,7 @@ class SwipeToSceneTest {
@Test
fun swipeEnabledLater() {
- val layoutState = MutableSceneTransitionLayoutState(SceneA)
+ val layoutState = layoutState()
var swipesEnabled by mutableStateOf(false)
var touchSlop = 0f
rule.setContent {
@@ -489,7 +491,7 @@ class SwipeToSceneTest {
fun transitionKey() {
val transitionkey = TransitionKey(debugName = "foo")
val state =
- MutableSceneTransitionLayoutStateImpl(
+ layoutState(
SceneA,
transitions {
from(SceneA, to = SceneB) { fade(TestElements.Foo) }
@@ -553,7 +555,7 @@ class SwipeToSceneTest {
}
val state =
- MutableSceneTransitionLayoutState(
+ layoutState(
SceneA,
transitions { from(SceneA, to = SceneB) { distance = swipeDistance } }
)
diff --git a/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/transformation/AnchoredSizeTest.kt b/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/transformation/AnchoredSizeTest.kt
index e555a01d42fd..7b992124d836 100644
--- a/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/transformation/AnchoredSizeTest.kt
+++ b/packages/SystemUI/compose/scene/tests/src/com/android/compose/animation/scene/transformation/AnchoredSizeTest.kt
@@ -20,50 +20,48 @@ import androidx.compose.animation.core.LinearEasing
import androidx.compose.animation.core.tween
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.size
+import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
-import androidx.compose.ui.test.junit4.createComposeRule
import androidx.compose.ui.unit.dp
import androidx.test.ext.junit.runners.AndroidJUnit4
+import com.android.compose.animation.scene.SceneScope
import com.android.compose.animation.scene.TestElements
-import com.android.compose.animation.scene.testTransition
-import com.android.compose.test.assertSizeIsEqualTo
+import com.android.compose.animation.scene.TransitionBuilder
+import com.android.compose.animation.scene.TransitionRecordingSpec
+import com.android.compose.animation.scene.featureOfElement
+import com.android.compose.animation.scene.recordTransition
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith
+import platform.test.motion.compose.ComposeFeatureCaptures
+import platform.test.motion.compose.createComposeMotionTestRule
+import platform.test.motion.testing.createGoldenPathManager
@RunWith(AndroidJUnit4::class)
class AnchoredSizeTest {
- @get:Rule val rule = createComposeRule()
+ private val goldenPaths =
+ createGoldenPathManager("frameworks/base/packages/SystemUI/compose/scene/tests/goldens")
+
+ @get:Rule val motionRule = createComposeMotionTestRule(goldenPaths)
@Test
fun testAnchoredSizeEnter() {
- rule.testTransition(
+ assertBarSizeMatchesGolden(
fromSceneContent = { Box(Modifier.size(100.dp, 100.dp).element(TestElements.Foo)) },
toSceneContent = {
Box(Modifier.size(50.dp, 50.dp).element(TestElements.Foo))
Box(Modifier.size(200.dp, 60.dp).element(TestElements.Bar))
},
transition = {
- // Scale during 4 frames.
spec = tween(16 * 4, easing = LinearEasing)
anchoredSize(TestElements.Bar, TestElements.Foo)
- },
- ) {
- // Bar is entering. It starts at the same size as Foo in scene A in and scales to its
- // final size in scene B.
- before { onElement(TestElements.Bar).assertDoesNotExist() }
- at(0) { onElement(TestElements.Bar).assertSizeIsEqualTo(100.dp, 100.dp) }
- at(16) { onElement(TestElements.Bar).assertSizeIsEqualTo(125.dp, 90.dp) }
- at(32) { onElement(TestElements.Bar).assertSizeIsEqualTo(150.dp, 80.dp) }
- at(48) { onElement(TestElements.Bar).assertSizeIsEqualTo(175.dp, 70.dp) }
- at(64) { onElement(TestElements.Bar).assertSizeIsEqualTo(200.dp, 60.dp) }
- after { onElement(TestElements.Bar).assertSizeIsEqualTo(200.dp, 60.dp) }
- }
+ }
+ )
}
@Test
fun testAnchoredSizeExit() {
- rule.testTransition(
+ assertBarSizeMatchesGolden(
fromSceneContent = {
Box(Modifier.size(100.dp, 100.dp).element(TestElements.Foo))
Box(Modifier.size(100.dp, 100.dp).element(TestElements.Bar))
@@ -73,22 +71,13 @@ class AnchoredSizeTest {
// Scale during 4 frames.
spec = tween(16 * 4, easing = LinearEasing)
anchoredSize(TestElements.Bar, TestElements.Foo)
- },
- ) {
- // Bar is leaving. It starts at 100dp x 100dp in scene A and is scaled to 200dp x 60dp,
- // the size of Foo in scene B.
- before { onElement(TestElements.Bar).assertSizeIsEqualTo(100.dp, 100.dp) }
- at(0) { onElement(TestElements.Bar).assertSizeIsEqualTo(100.dp, 100.dp) }
- at(16) { onElement(TestElements.Bar).assertSizeIsEqualTo(125.dp, 90.dp) }
- at(32) { onElement(TestElements.Bar).assertSizeIsEqualTo(150.dp, 80.dp) }
- at(48) { onElement(TestElements.Bar).assertSizeIsEqualTo(175.dp, 70.dp) }
- after { onElement(TestElements.Bar).assertDoesNotExist() }
- }
+ }
+ )
}
@Test
fun testAnchoredWidthOnly() {
- rule.testTransition(
+ assertBarSizeMatchesGolden(
fromSceneContent = { Box(Modifier.size(100.dp, 100.dp).element(TestElements.Foo)) },
toSceneContent = {
Box(Modifier.size(50.dp, 50.dp).element(TestElements.Foo))
@@ -98,20 +87,12 @@ class AnchoredSizeTest {
spec = tween(16 * 4, easing = LinearEasing)
anchoredSize(TestElements.Bar, TestElements.Foo, anchorHeight = false)
},
- ) {
- before { onElement(TestElements.Bar).assertDoesNotExist() }
- at(0) { onElement(TestElements.Bar).assertSizeIsEqualTo(100.dp, 60.dp) }
- at(16) { onElement(TestElements.Bar).assertSizeIsEqualTo(125.dp, 60.dp) }
- at(32) { onElement(TestElements.Bar).assertSizeIsEqualTo(150.dp, 60.dp) }
- at(48) { onElement(TestElements.Bar).assertSizeIsEqualTo(175.dp, 60.dp) }
- at(64) { onElement(TestElements.Bar).assertSizeIsEqualTo(200.dp, 60.dp) }
- after { onElement(TestElements.Bar).assertSizeIsEqualTo(200.dp, 60.dp) }
- }
+ )
}
@Test
fun testAnchoredHeightOnly() {
- rule.testTransition(
+ assertBarSizeMatchesGolden(
fromSceneContent = { Box(Modifier.size(100.dp, 100.dp).element(TestElements.Foo)) },
toSceneContent = {
Box(Modifier.size(50.dp, 50.dp).element(TestElements.Foo))
@@ -120,15 +101,23 @@ class AnchoredSizeTest {
transition = {
spec = tween(16 * 4, easing = LinearEasing)
anchoredSize(TestElements.Bar, TestElements.Foo, anchorWidth = false)
- },
- ) {
- before { onElement(TestElements.Bar).assertDoesNotExist() }
- at(0) { onElement(TestElements.Bar).assertSizeIsEqualTo(200.dp, 100.dp) }
- at(16) { onElement(TestElements.Bar).assertSizeIsEqualTo(200.dp, 90.dp) }
- at(32) { onElement(TestElements.Bar).assertSizeIsEqualTo(200.dp, 80.dp) }
- at(48) { onElement(TestElements.Bar).assertSizeIsEqualTo(200.dp, 70.dp) }
- at(64) { onElement(TestElements.Bar).assertSizeIsEqualTo(200.dp, 60.dp) }
- after { onElement(TestElements.Bar).assertSizeIsEqualTo(200.dp, 60.dp) }
- }
+ }
+ )
+ }
+
+ private fun assertBarSizeMatchesGolden(
+ fromSceneContent: @Composable SceneScope.() -> Unit,
+ toSceneContent: @Composable SceneScope.() -> Unit,
+ transition: TransitionBuilder.() -> Unit,
+ ) {
+ val recordingSpec =
+ TransitionRecordingSpec(recordAfter = true) {
+ featureOfElement(TestElements.Bar, ComposeFeatureCaptures.dpSize)
+ }
+
+ val motion =
+ motionRule.recordTransition(fromSceneContent, toSceneContent, transition, recordingSpec)
+
+ motionRule.assertThat(motion).timeSeriesMatchesGolden()
}
}
diff --git a/packages/SystemUI/compose/scene/tests/src/com/android/compose/test/SizeAssertions.kt b/packages/SystemUI/compose/scene/tests/src/com/android/compose/test/SizeAssertions.kt
index fbd1b512c50a..bca710f52c3f 100644
--- a/packages/SystemUI/compose/scene/tests/src/com/android/compose/test/SizeAssertions.kt
+++ b/packages/SystemUI/compose/scene/tests/src/com/android/compose/test/SizeAssertions.kt
@@ -21,7 +21,11 @@ import androidx.compose.ui.test.assertHeightIsEqualTo
import androidx.compose.ui.test.assertWidthIsEqualTo
import androidx.compose.ui.unit.Dp
-fun SemanticsNodeInteraction.assertSizeIsEqualTo(expectedWidth: Dp, expectedHeight: Dp) {
+fun SemanticsNodeInteraction.assertSizeIsEqualTo(
+ expectedWidth: Dp,
+ expectedHeight: Dp = expectedWidth,
+): SemanticsNodeInteraction {
assertWidthIsEqualTo(expectedWidth)
assertHeightIsEqualTo(expectedHeight)
+ return this
}
diff --git a/packages/SystemUI/compose/scene/tests/utils/Android.bp b/packages/SystemUI/compose/scene/tests/utils/Android.bp
index 9089e6a4b4b6..292efa085364 100644
--- a/packages/SystemUI/compose/scene/tests/utils/Android.bp
+++ b/packages/SystemUI/compose/scene/tests/utils/Android.bp
@@ -32,6 +32,7 @@ android_library {
static_libs: [
"PlatformComposeSceneTransitionLayout",
+ "PlatformMotionTestingCompose",
"androidx.compose.runtime_runtime",
"androidx.compose.ui_ui-test-junit4",
],
diff --git a/packages/SystemUI/compose/scene/tests/utils/src/com/android/compose/animation/scene/TestTransition.kt b/packages/SystemUI/compose/scene/tests/utils/src/com/android/compose/animation/scene/TestTransition.kt
index 2d71a6e50ac2..6724851dbec5 100644
--- a/packages/SystemUI/compose/scene/tests/utils/src/com/android/compose/animation/scene/TestTransition.kt
+++ b/packages/SystemUI/compose/scene/tests/utils/src/com/android/compose/animation/scene/TestTransition.kt
@@ -17,12 +17,24 @@
package com.android.compose.animation.scene
import androidx.compose.runtime.Composable
+import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier
+import androidx.compose.ui.semantics.SemanticsNode
import androidx.compose.ui.test.SemanticsNodeInteraction
+import androidx.compose.ui.test.SemanticsNodeInteractionsProvider
import androidx.compose.ui.test.junit4.ComposeContentTestRule
+import platform.test.motion.MotionTestRule
+import platform.test.motion.RecordedMotion
+import platform.test.motion.compose.ComposeRecordingSpec
+import platform.test.motion.compose.ComposeToolkit
+import platform.test.motion.compose.MotionControl
+import platform.test.motion.compose.feature
+import platform.test.motion.compose.recordMotion
+import platform.test.motion.golden.FeatureCapture
+import platform.test.motion.golden.TimeSeriesCaptureScope
@DslMarker annotation class TransitionTestDsl
@@ -100,6 +112,66 @@ fun ComposeContentTestRule.testTransition(
)
}
+data class TransitionRecordingSpec(
+ val recordBefore: Boolean = true,
+ val recordAfter: Boolean = true,
+ val timeSeriesCapture: TimeSeriesCaptureScope<SemanticsNodeInteractionsProvider>.() -> Unit
+)
+
+/** Captures the feature using [capture] on the [element]. */
+fun TimeSeriesCaptureScope<SemanticsNodeInteractionsProvider>.featureOfElement(
+ element: ElementKey,
+ capture: FeatureCapture<SemanticsNode, *>,
+ name: String = "${element.debugName}_${capture.name}"
+) {
+ feature(isElement(element), capture, name)
+}
+
+/** Records the transition between two scenes of [transitionLayout][SceneTransitionLayout]. */
+fun MotionTestRule<ComposeToolkit>.recordTransition(
+ fromSceneContent: @Composable SceneScope.() -> Unit,
+ toSceneContent: @Composable SceneScope.() -> Unit,
+ transition: TransitionBuilder.() -> Unit,
+ recordingSpec: TransitionRecordingSpec,
+ layoutModifier: Modifier = Modifier,
+ fromScene: SceneKey = TestScenes.SceneA,
+ toScene: SceneKey = TestScenes.SceneB,
+): RecordedMotion {
+ val state =
+ toolkit.composeContentTestRule.runOnUiThread {
+ MutableSceneTransitionLayoutState(
+ fromScene,
+ transitions { from(fromScene, to = toScene, builder = transition) }
+ )
+ }
+
+ return recordMotion(
+ content = { play ->
+ LaunchedEffect(play) {
+ if (play) {
+ state.setTargetScene(toScene, coroutineScope = this)
+ }
+ }
+
+ SceneTransitionLayout(
+ state,
+ layoutModifier,
+ ) {
+ scene(fromScene, content = fromSceneContent)
+ scene(toScene, content = toSceneContent)
+ }
+ },
+ ComposeRecordingSpec(
+ MotionControl(delayRecording = { awaitCondition { state.isTransitioning() } }) {
+ awaitCondition { !state.isTransitioning() }
+ },
+ recordBefore = recordingSpec.recordBefore,
+ recordAfter = recordingSpec.recordAfter,
+ timeSeriesCapture = recordingSpec.timeSeriesCapture
+ )
+ )
+}
+
/**
* Test the transition between two scenes of [transitionLayout][SceneTransitionLayout] at different
* points in time.
diff --git a/packages/SystemUI/monet/Android.bp b/packages/SystemUI/monet/Android.bp
deleted file mode 100644
index c54fdab4e77f..000000000000
--- a/packages/SystemUI/monet/Android.bp
+++ /dev/null
@@ -1,33 +0,0 @@
-//
-// Copyright (C) 2021 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 {
- default_team: "trendy_team_system_ui_please_use_a_more_specific_subteam_if_possible_",
- default_applicable_licenses: ["Android-Apache-2.0"],
-}
-
-java_library {
- name: "monet",
- platform_apis: true,
- static_libs: [
- "androidx.annotation_annotation",
- "androidx.core_core",
- "libmonet",
- ],
- srcs: [
- "src/**/*.java",
- "src/**/*.kt",
- ],
-}
diff --git a/packages/SystemUI/monet/src/com/android/systemui/monet/ColorScheme.kt b/packages/SystemUI/monet/src/com/android/systemui/monet/ColorScheme.kt
deleted file mode 100644
index 624f18d53a70..000000000000
--- a/packages/SystemUI/monet/src/com/android/systemui/monet/ColorScheme.kt
+++ /dev/null
@@ -1,372 +0,0 @@
-/*
- * Copyright (C) 2021 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.monet
-
-import android.annotation.ColorInt
-import android.app.WallpaperColors
-import android.graphics.Color
-import com.android.internal.graphics.ColorUtils
-import com.google.ux.material.libmonet.hct.Hct
-import com.google.ux.material.libmonet.scheme.DynamicScheme
-import com.google.ux.material.libmonet.scheme.SchemeContent
-import com.google.ux.material.libmonet.scheme.SchemeExpressive
-import com.google.ux.material.libmonet.scheme.SchemeFruitSalad
-import com.google.ux.material.libmonet.scheme.SchemeMonochrome
-import com.google.ux.material.libmonet.scheme.SchemeNeutral
-import com.google.ux.material.libmonet.scheme.SchemeRainbow
-import com.google.ux.material.libmonet.scheme.SchemeTonalSpot
-import com.google.ux.material.libmonet.scheme.SchemeVibrant
-import kotlin.math.absoluteValue
-import kotlin.math.roundToInt
-
-const val TAG = "ColorScheme"
-
-const val ACCENT1_CHROMA = 48.0f
-const val GOOGLE_BLUE = 0xFF1b6ef3.toInt()
-const val MIN_CHROMA = 5
-
-enum class Style{
- SPRITZ,
- TONAL_SPOT,
- VIBRANT,
- EXPRESSIVE,
- RAINBOW,
- FRUIT_SALAD,
- CONTENT,
- MONOCHROMATIC,
- CLOCK,
- CLOCK_VIBRANT
-}
-
-class TonalPalette
-internal constructor(
- private val materialTonalPalette: com.google.ux.material.libmonet.palettes.TonalPalette
-) {
- @Deprecated("Do not use. For color system only")
- val allShades: List<Int>
- val allShadesMapped: Map<Int, Int>
-
- init{
- allShades = SHADE_KEYS.map {key -> getAtTone(key.toFloat()) }
- allShadesMapped = SHADE_KEYS.zip(allShades).toMap()
- }
-
- // Dynamically computed tones across the full range from 0 to 1000
- fun getAtTone(shade: Float): Int = materialTonalPalette.tone(((1000.0f - shade) / 10f).toInt())
-
- // Predefined & precomputed tones
- val s0: Int
- get() = this.allShades[0]
- val s10: Int
- get() = this.allShades[1]
- val s50: Int
- get() = this.allShades[2]
- val s100: Int
- get() = this.allShades[3]
- val s200: Int
- get() = this.allShades[4]
- val s300: Int
- get() = this.allShades[5]
- val s400: Int
- get() = this.allShades[6]
- val s500: Int
- get() = this.allShades[7]
- val s600: Int
- get() = this.allShades[8]
- val s700: Int
- get() = this.allShades[9]
- val s800: Int
- get() = this.allShades[10]
- val s900: Int
- get() = this.allShades[11]
- val s1000: Int
- get() = this.allShades[12]
-
- companion object {
- val SHADE_KEYS = listOf(0, 10, 50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 1000)
- }
-}
-
-@Deprecated("Please use com.google.ux.material.libmonet.dynamiccolor.MaterialDynamicColors " +
- "instead")
-class ColorScheme(
- @ColorInt val seed: Int,
- val isDark: Boolean,
- val style: Style,
- val contrastLevel: Double
-) {
- var materialScheme: DynamicScheme
-
- private val proposedSeedHct: Hct = Hct.fromInt(seed)
- private val seedHct: Hct = Hct.fromInt(if (seed == Color.TRANSPARENT) {
- GOOGLE_BLUE
- } else if (style != Style.CONTENT && proposedSeedHct.chroma < 5) {
- GOOGLE_BLUE
- } else {
- seed
- })
-
- val accent1: TonalPalette
- val accent2: TonalPalette
- val accent3: TonalPalette
- val neutral1: TonalPalette
- val neutral2: TonalPalette
-
- constructor(@ColorInt seed: Int, darkTheme: Boolean) : this(seed, darkTheme, Style.TONAL_SPOT)
-
- @JvmOverloads
- constructor(
- @ColorInt seed: Int,
- darkTheme: Boolean,
- style: Style
- ) : this(seed, darkTheme, style, 0.0)
-
- @JvmOverloads
- constructor(
- wallpaperColors: WallpaperColors,
- darkTheme: Boolean,
- style: Style = Style.TONAL_SPOT
- ) : this(getSeedColor(wallpaperColors, style != Style.CONTENT), darkTheme, style)
-
- val backgroundColor
- get() = ColorUtils.setAlphaComponent(if (isDark) neutral1.s700 else neutral1.s10, 0xFF)
-
- val accentColor
- get() = ColorUtils.setAlphaComponent(if (isDark) accent1.s100 else accent1.s500, 0xFF)
-
- init {
- materialScheme = when (style) {
- Style.SPRITZ -> SchemeNeutral(seedHct, isDark, contrastLevel)
- Style.TONAL_SPOT -> SchemeTonalSpot(seedHct, isDark, contrastLevel)
- Style.VIBRANT -> SchemeVibrant(seedHct, isDark, contrastLevel)
- Style.EXPRESSIVE -> SchemeExpressive(seedHct, isDark, contrastLevel)
- Style.RAINBOW -> SchemeRainbow(seedHct, isDark, contrastLevel)
- Style.FRUIT_SALAD -> SchemeFruitSalad(seedHct, isDark, contrastLevel)
- Style.CONTENT -> SchemeContent(seedHct, isDark, contrastLevel)
- Style.MONOCHROMATIC -> SchemeMonochrome(seedHct, isDark, contrastLevel)
-
- // SystemUI Schemes
- Style.CLOCK -> SchemeClock(seedHct, isDark, contrastLevel)
- Style.CLOCK_VIBRANT -> SchemeClockVibrant(seedHct, isDark, contrastLevel)
- }
-
- accent1 = TonalPalette(materialScheme.primaryPalette)
- accent2 = TonalPalette(materialScheme.secondaryPalette)
- accent3 = TonalPalette(materialScheme.tertiaryPalette)
- neutral1 = TonalPalette(materialScheme.neutralPalette)
- neutral2 = TonalPalette(materialScheme.neutralVariantPalette)
- }
-
- val seedTone: Float
- get() = 1000f - proposedSeedHct.tone.toFloat() * 10f
-
- override fun toString(): String {
- return "ColorScheme {\n" +
- " seed color: ${stringForColor(seed)}\n" +
- " style: $style\n" +
- " palettes: \n" +
- " ${humanReadable("PRIMARY", accent1.allShades)}\n" +
- " ${humanReadable("SECONDARY", accent2.allShades)}\n" +
- " ${humanReadable("TERTIARY", accent3.allShades)}\n" +
- " ${humanReadable("NEUTRAL", neutral1.allShades)}\n" +
- " ${humanReadable("NEUTRAL VARIANT", neutral2.allShades)}\n" +
- "}"
- }
-
- companion object {
- /**
- * Identifies a color to create a color scheme from.
- *
- * @param wallpaperColors Colors extracted from an image via quantization.
- * @param filter If false, allow colors that have low chroma, creating grayscale themes.
- * @return ARGB int representing the color
- */
- @JvmStatic
- @JvmOverloads
- @ColorInt
- fun getSeedColor(wallpaperColors: WallpaperColors, filter: Boolean = true): Int {
- return getSeedColors(wallpaperColors, filter).first()
- }
-
- /**
- * Filters and ranks colors from WallpaperColors.
- *
- * @param wallpaperColors Colors extracted from an image via quantization.
- * @param filter If false, allow colors that have low chroma, creating grayscale themes.
- * @return List of ARGB ints, ordered from highest scoring to lowest.
- */
- @JvmStatic
- @JvmOverloads
- fun getSeedColors(wallpaperColors: WallpaperColors, filter: Boolean = true): List<Int> {
- val totalPopulation =
- wallpaperColors.allColors.values.reduce { a, b -> a + b }.toDouble()
- val totalPopulationMeaningless = (totalPopulation == 0.0)
- if (totalPopulationMeaningless) {
- // WallpaperColors with a population of 0 indicate the colors didn't come from
- // quantization. Instead of scoring, trust the ordering of the provided primary
- // secondary/tertiary colors.
- //
- // In this case, the colors are usually from a Live Wallpaper.
- val distinctColors =
- wallpaperColors.mainColors
- .map { it.toArgb() }
- .distinct()
- .filter {
- if (!filter) {
- true
- } else {
- Hct.fromInt(it).chroma >= MIN_CHROMA
- }
- }
- .toList()
- if (distinctColors.isEmpty()) {
- return listOf(GOOGLE_BLUE)
- }
- return distinctColors
- }
-
- val intToProportion =
- wallpaperColors.allColors.mapValues { it.value.toDouble() / totalPopulation }
- val intToHct = wallpaperColors.allColors.mapValues { Hct.fromInt(it.key) }
-
- // Get an array with 360 slots. A slot contains the percentage of colors with that hue.
- val hueProportions = huePopulations(intToHct, intToProportion, filter)
- // Map each color to the percentage of the image with its hue.
- val intToHueProportion =
- wallpaperColors.allColors.mapValues {
- val hct = intToHct[it.key]!!
- val hue = hct.hue.roundToInt()
- var proportion = 0.0
- for (i in hue - 15..hue + 15) {
- proportion += hueProportions[wrapDegrees(i)]
- }
- proportion
- }
- // Remove any inappropriate seed colors. For example, low chroma colors look grayscale
- // raising their chroma will turn them to a much louder color that may not have been
- // in the image.
- val filteredIntToHct =
- if (!filter) intToHct
- else
- (intToHct.filter {
- val hct = it.value
- val proportion = intToHueProportion[it.key]!!
- hct.chroma >= MIN_CHROMA &&
- (totalPopulationMeaningless || proportion > 0.01)
- })
- // Sort the colors by score, from high to low.
- val intToScoreIntermediate =
- filteredIntToHct.mapValues { score(it.value, intToHueProportion[it.key]!!) }
- val intToScore = intToScoreIntermediate.entries.toMutableList()
- intToScore.sortByDescending { it.value }
-
- // Go through the colors, from high score to low score.
- // If the color is distinct in hue from colors picked so far, pick the color.
- // Iteratively decrease the amount of hue distinctness required, thus ensuring we
- // maximize difference between colors.
- val minimumHueDistance = 15
- val seeds = mutableListOf<Int>()
- maximizeHueDistance@ for (i in 90 downTo minimumHueDistance step 1) {
- seeds.clear()
- for (entry in intToScore) {
- val int = entry.key
- val existingSeedNearby =
- seeds.find {
- val hueA = intToHct[int]!!.hue
- val hueB = intToHct[it]!!.hue
- hueDiff(hueA, hueB) < i
- } != null
- if (existingSeedNearby) {
- continue
- }
- seeds.add(int)
- if (seeds.size >= 4) {
- break@maximizeHueDistance
- }
- }
- }
-
- if (seeds.isEmpty()) {
- // Use gBlue 500 if there are 0 colors
- seeds.add(GOOGLE_BLUE)
- }
-
- return seeds
- }
-
- private fun wrapDegrees(degrees: Int): Int {
- return when {
- degrees < 0 -> {
- (degrees % 360) + 360
- }
- degrees >= 360 -> {
- degrees % 360
- }
- else -> {
- degrees
- }
- }
- }
-
- private fun hueDiff(a: Double, b: Double): Double {
- return 180f - ((a - b).absoluteValue - 180f).absoluteValue
- }
-
- private fun stringForColor(color: Int): String {
- val width = 4
- val hct = Hct.fromInt(color)
- val h = "H${hct.hue.roundToInt().toString().padEnd(width)}"
- val c = "C${hct.chroma.roundToInt().toString().padEnd(width)}"
- val t = "T${hct.tone.roundToInt().toString().padEnd(width)}"
- val hex = Integer.toHexString(color and 0xffffff).padStart(6, '0').uppercase()
- return "$h$c$t = #$hex"
- }
-
- private fun humanReadable(paletteName: String, colors: List<Int>): String {
- return "$paletteName\n" +
- colors.map { stringForColor(it) }.joinToString(separator = "\n") { it }
- }
-
- private fun score(hct: Hct, proportion: Double): Double {
- val proportionScore = 0.7 * 100.0 * proportion
- val chromaScore =
- if (hct.chroma < ACCENT1_CHROMA) 0.1 * (hct.chroma - ACCENT1_CHROMA)
- else 0.3 * (hct.chroma - ACCENT1_CHROMA)
- return chromaScore + proportionScore
- }
-
- private fun huePopulations(
- hctByColor: Map<Int, Hct>,
- populationByColor: Map<Int, Double>,
- filter: Boolean = true
- ): List<Double> {
- val huePopulation = List(size = 360, init = { 0.0 }).toMutableList()
-
- for (entry in populationByColor.entries) {
- val population = populationByColor[entry.key]!!
- val hct = hctByColor[entry.key]!!
- val hue = hct.hue.roundToInt() % 360
- if (filter && hct.chroma <= MIN_CHROMA) {
- continue
- }
- huePopulation[hue] = huePopulation[hue] + population
- }
-
- return huePopulation
- }
- }
-}
diff --git a/packages/SystemUI/monet/src/com/android/systemui/monet/SchemeClock.java b/packages/SystemUI/monet/src/com/android/systemui/monet/SchemeClock.java
deleted file mode 100644
index 4747cc5dbf9c..000000000000
--- a/packages/SystemUI/monet/src/com/android/systemui/monet/SchemeClock.java
+++ /dev/null
@@ -1,55 +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.monet;
-
-import static com.google.ux.material.libmonet.utils.MathUtils.clampDouble;
-
-import static java.lang.Double.max;
-
-import com.google.ux.material.libmonet.hct.Hct;
-import com.google.ux.material.libmonet.palettes.TonalPalette;
-import com.google.ux.material.libmonet.scheme.DynamicScheme;
-import com.google.ux.material.libmonet.scheme.Variant;
-
-public class SchemeClock extends DynamicScheme {
- public SchemeClock(Hct sourceColorHct, boolean isDark, double contrastLevel) {
- super(
- sourceColorHct,
- Variant.MONOCHROME,
- isDark,
- contrastLevel,
- /*primary*/
- TonalPalette.fromHueAndChroma(
- /*hue*/ sourceColorHct.getHue(),
- /*chroma*/ max(sourceColorHct.getChroma(), 20)
- ),
- /*secondary*/
- TonalPalette.fromHueAndChroma(
- /*hue*/ sourceColorHct.getHue() + 10.0,
- /*chroma*/ clampDouble(17, 40, sourceColorHct.getChroma() * 0.85)
- ),
- /*tertiary*/
- TonalPalette.fromHueAndChroma(
- /*hue*/ sourceColorHct.getHue() + 20.0,
- /*chroma*/ max(sourceColorHct.getChroma() + 20, 50)
- ),
-
- //not used
- TonalPalette.fromHueAndChroma(sourceColorHct.getHue(), 0.0),
- TonalPalette.fromHueAndChroma(sourceColorHct.getHue(), 0.0));
- }
-}
diff --git a/packages/SystemUI/monet/src/com/android/systemui/monet/SchemeClockVibrant.java b/packages/SystemUI/monet/src/com/android/systemui/monet/SchemeClockVibrant.java
deleted file mode 100644
index fb5e972434af..000000000000
--- a/packages/SystemUI/monet/src/com/android/systemui/monet/SchemeClockVibrant.java
+++ /dev/null
@@ -1,53 +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.monet;
-
-import static java.lang.Double.max;
-
-import com.google.ux.material.libmonet.hct.Hct;
-import com.google.ux.material.libmonet.palettes.TonalPalette;
-import com.google.ux.material.libmonet.scheme.DynamicScheme;
-import com.google.ux.material.libmonet.scheme.Variant;
-
-public class SchemeClockVibrant extends DynamicScheme {
- public SchemeClockVibrant(Hct sourceColorHct, boolean isDark, double contrastLevel) {
- super(
- sourceColorHct,
- Variant.MONOCHROME,
- isDark,
- contrastLevel,
- /*primary*/
- TonalPalette.fromHueAndChroma(
- /*hue*/ sourceColorHct.getHue(),
- /*chroma*/ max(sourceColorHct.getChroma(), 70)
- ),
- /*secondary*/
- TonalPalette.fromHueAndChroma(
- /*hue*/ sourceColorHct.getHue() + 20.0,
- /*chroma*/ max(sourceColorHct.getChroma(), 70)
- ),
- /*tertiary*/
- TonalPalette.fromHueAndChroma(
- /*hue*/ sourceColorHct.getHue() + 60.0,
- /*chroma*/ max(sourceColorHct.getChroma(), 70)
- ),
-
- //not used
- TonalPalette.fromHueAndChroma(sourceColorHct.getHue(), 0.0),
- TonalPalette.fromHueAndChroma(sourceColorHct.getHue(), 0.0));
- }
-}
diff --git a/packages/SystemUI/monet/src/com/android/systemui/monet/Shades.java b/packages/SystemUI/monet/src/com/android/systemui/monet/Shades.java
deleted file mode 100644
index c8b9fe024e7d..000000000000
--- a/packages/SystemUI/monet/src/com/android/systemui/monet/Shades.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Copyright (C) 2021 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.monet;
-
-
-import androidx.annotation.ColorInt;
-
-import com.android.internal.annotations.VisibleForTesting;
-import com.android.internal.graphics.ColorUtils;
-
-/**
- * Generate sets of colors that are shades of the same color
- */
-@VisibleForTesting
-public class Shades {
- /**
- * Combining the ability to convert between relative luminance and perceptual luminance with
- * contrast leads to a design system that can be based on a linear value to determine contrast,
- * rather than a ratio.
- *
- * This codebase implements a design system that has that property, and as a result, we can
- * guarantee that any shades 5 steps from each other have a contrast ratio of at least 4.5.
- * 4.5 is the requirement for smaller text contrast in WCAG 2.1 and earlier.
- *
- * However, lstar 50 does _not_ have a contrast ratio >= 4.5 with lstar 100.
- * lstar 49.6 is the smallest lstar that will lead to a contrast ratio >= 4.5 with lstar 100,
- * and it also contrasts >= 4.5 with lstar 100.
- */
- public static final float MIDDLE_LSTAR = 49.6f;
-
- /**
- * Generate shades of a color. Ordered in lightness _descending_.
- * <p>
- * The first shade will be at 95% lightness, the next at 90, 80, etc. through 0.
- *
- * @param hue hue in CAM16 color space
- * @param chroma chroma in CAM16 color space
- * @return shades of a color, as argb integers. Ordered by lightness descending.
- */
- public static @ColorInt int[] of(float hue, float chroma) {
- int[] shades = new int[12];
- // At tone 90 and above, blue and yellow hues can reach a much higher chroma.
- // To preserve a consistent appearance across all hues, use a maximum chroma of 40.
- shades[0] = ColorUtils.CAMToColor(hue, Math.min(40f, chroma), 99);
- shades[1] = ColorUtils.CAMToColor(hue, Math.min(40f, chroma), 95);
- for (int i = 2; i < 12; i++) {
- float lStar = (i == 6) ? MIDDLE_LSTAR : 100 - 10 * (i - 1);
- shades[i] = ColorUtils.CAMToColor(hue, chroma, lStar);
- }
- return shades;
- }
-}
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/accessibility/data/repository/NightDisplayRepositoryTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/accessibility/data/repository/NightDisplayRepositoryTest.kt
index ca824cbdd53b..5757f67cc1dd 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/accessibility/data/repository/NightDisplayRepositoryTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/accessibility/data/repository/NightDisplayRepositoryTest.kt
@@ -42,7 +42,6 @@ import kotlinx.coroutines.test.StandardTestDispatcher
import kotlinx.coroutines.test.TestScope
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.ArgumentMatchers
@@ -90,11 +89,6 @@ class NightDisplayRepositoryTest : SysuiTestCase() {
locationController,
)
- @Before
- fun setup() {
- enrollInForcedNightDisplayAutoMode(INITIALLY_FORCE_AUTO_MODE, testUser)
- }
-
@Test
fun nightDisplayState_matchesAutoMode() =
scope.runTest {
@@ -126,6 +120,8 @@ class NightDisplayRepositoryTest : SysuiTestCase() {
@Test
fun nightDisplayState_matchesIsNightDisplayActivated() =
scope.runTest {
+ enrollInForcedNightDisplayAutoMode(INITIALLY_FORCE_AUTO_MODE, testUser)
+
val callbackCaptor = argumentCaptor<NightDisplayListener.Callback>()
val lastState by collectLastValue(underTest.nightDisplayState(testUser))
@@ -148,6 +144,7 @@ class NightDisplayRepositoryTest : SysuiTestCase() {
scope.runTest {
whenever(colorDisplayManager.nightDisplayAutoMode)
.thenReturn(ColorDisplayManager.AUTO_MODE_CUSTOM_TIME)
+ enrollInForcedNightDisplayAutoMode(INITIALLY_FORCE_AUTO_MODE, testUser)
val lastState by collectLastValue(underTest.nightDisplayState(testUser))
runCurrent()
@@ -160,6 +157,7 @@ class NightDisplayRepositoryTest : SysuiTestCase() {
scope.runTest {
whenever(colorDisplayManager.nightDisplayAutoMode)
.thenReturn(ColorDisplayManager.AUTO_MODE_TWILIGHT)
+ enrollInForcedNightDisplayAutoMode(INITIALLY_FORCE_AUTO_MODE, testUser)
val lastState by collectLastValue(underTest.nightDisplayState(testUser))
runCurrent()
@@ -167,6 +165,24 @@ class NightDisplayRepositoryTest : SysuiTestCase() {
assertThat(lastState!!.autoMode).isEqualTo(ColorDisplayManager.AUTO_MODE_TWILIGHT)
}
+ /**
+ * When the value of the raw auto mode is missing the call to nightDisplayState should not crash
+ */
+ @Test
+ fun nightDisplayState_whenAutoModeSettingIsNotInitialized_loadsDataWithoutException() =
+ scope.runTest {
+ // only auto mode_available is set, and the raw auto_mode has nothing set
+ globalSettings.putString(
+ Settings.Global.NIGHT_DISPLAY_FORCED_AUTO_MODE_AVAILABLE,
+ NIGHT_DISPLAY_FORCED_AUTO_MODE_AVAILABLE
+ )
+
+ val lastState by collectLastValue(underTest.nightDisplayState(testUser))
+ runCurrent()
+
+ assertThat(lastState!!.shouldForceAutoMode).isTrue()
+ }
+
@Test
fun nightDisplayState_matchesForceAutoMode() =
scope.runTest {
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/data/repository/FingerprintPropertyRepositoryTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/data/repository/FingerprintPropertyRepositoryTest.kt
deleted file mode 100644
index 1e7ed6316f7f..000000000000
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/data/repository/FingerprintPropertyRepositoryTest.kt
+++ /dev/null
@@ -1,103 +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.data.repository
-
-import android.hardware.fingerprint.FingerprintManager
-import android.hardware.fingerprint.IFingerprintAuthenticatorsRegisteredCallback
-import androidx.test.ext.junit.runners.AndroidJUnit4
-import androidx.test.filters.SmallTest
-import com.android.systemui.SysuiTestCase
-import com.android.systemui.biometrics.data.repository.FingerprintPropertyRepositoryImpl
-import com.android.systemui.coroutines.collectLastValue
-import com.google.common.truth.Truth.assertThat
-import kotlinx.coroutines.Dispatchers
-import kotlinx.coroutines.ExperimentalCoroutinesApi
-import kotlinx.coroutines.test.TestScope
-import kotlinx.coroutines.test.runCurrent
-import kotlinx.coroutines.test.runTest
-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.Mockito.verify
-import org.mockito.junit.MockitoJUnit
-import org.mockito.junit.MockitoRule
-
-@ExperimentalCoroutinesApi
-@RunWith(AndroidJUnit4::class)
-@SmallTest
-class FingerprintPropertyRepositoryTest : SysuiTestCase() {
- @JvmField @Rule val mockitoRule: MockitoRule = MockitoJUnit.rule()
- private val testScope = TestScope()
- private lateinit var underTest: FingerprintPropertyRepositoryImpl
- @Mock private lateinit var fingerprintManager: FingerprintManager
- @Captor
- private lateinit var fingerprintCallbackCaptor:
- ArgumentCaptor<IFingerprintAuthenticatorsRegisteredCallback>
-
- @Before
- fun setup() {
- underTest =
- FingerprintPropertyRepositoryImpl(
- testScope.backgroundScope,
- Dispatchers.Main.immediate,
- fingerprintManager,
- )
- }
-
- @Test
- fun propertiesInitialized_onStartFalse() =
- testScope.runTest {
- val propertiesInitialized by collectLastValue(underTest.propertiesInitialized)
- assertThat(propertiesInitialized).isFalse()
- }
-
- @Test
- fun propertiesInitialized_onStartTrue() =
- testScope.runTest {
- // // collect sensorType to update fingerprintCallback before
- // propertiesInitialized
- // // is listened for
- val sensorType by collectLastValue(underTest.sensorType)
- runCurrent()
- captureFingerprintCallback()
-
- fingerprintCallbackCaptor.value.onAllAuthenticatorsRegistered(emptyList())
- val propertiesInitialized by collectLastValue(underTest.propertiesInitialized)
- assertThat(propertiesInitialized).isTrue()
- }
-
- @Test
- fun propertiesInitialized_updatedToTrue() =
- testScope.runTest {
- val propertiesInitialized by collectLastValue(underTest.propertiesInitialized)
- assertThat(propertiesInitialized).isFalse()
-
- captureFingerprintCallback()
- fingerprintCallbackCaptor.value.onAllAuthenticatorsRegistered(emptyList())
- assertThat(propertiesInitialized).isTrue()
- }
-
- private fun captureFingerprintCallback() {
- verify(fingerprintManager)
- .addAuthenticatorsRegisteredCallback(fingerprintCallbackCaptor.capture())
- }
-}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/keyguard/ui/viewmodel/DeviceEntryIconViewModelTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/ui/viewmodel/DeviceEntryIconViewModelTest.kt
index f61ddeb47514..68fbd1c44ad7 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/keyguard/ui/viewmodel/DeviceEntryIconViewModelTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/keyguard/ui/viewmodel/DeviceEntryIconViewModelTest.kt
@@ -20,9 +20,15 @@ import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.systemui.SysuiTestCase
import com.android.systemui.accessibility.data.repository.fakeAccessibilityRepository
+import com.android.systemui.authentication.data.repository.FakeAuthenticationRepository
+import com.android.systemui.authentication.domain.interactor.AuthenticationResult
+import com.android.systemui.authentication.domain.interactor.authenticationInteractor
import com.android.systemui.biometrics.data.repository.FakeFingerprintPropertyRepository
import com.android.systemui.biometrics.data.repository.fingerprintPropertyRepository
import com.android.systemui.coroutines.collectLastValue
+import com.android.systemui.deviceentry.domain.interactor.deviceUnlockedInteractor
+import com.android.systemui.flags.DisableSceneContainer
+import com.android.systemui.flags.EnableSceneContainer
import com.android.systemui.keyguard.data.repository.FakeDeviceEntryFingerprintAuthRepository
import com.android.systemui.keyguard.data.repository.FakeKeyguardRepository
import com.android.systemui.keyguard.data.repository.fakeDeviceEntryFingerprintAuthRepository
@@ -30,14 +36,16 @@ import com.android.systemui.keyguard.data.repository.fakeKeyguardRepository
import com.android.systemui.keyguard.ui.view.DeviceEntryIconView
import com.android.systemui.keyguard.ui.viewmodel.DeviceEntryIconViewModel.Companion.UNLOCKED_DELAY_MS
import com.android.systemui.kosmos.testScope
+import com.android.systemui.scene.shared.flag.SceneContainerFlag
import com.android.systemui.testKosmos
import com.google.common.truth.Truth.assertThat
-import kotlin.test.Test
import kotlinx.coroutines.ExperimentalCoroutinesApi
+import kotlinx.coroutines.test.TestScope
import kotlinx.coroutines.test.advanceTimeBy
import kotlinx.coroutines.test.runCurrent
import kotlinx.coroutines.test.runTest
import org.junit.Before
+import org.junit.Test
import org.junit.runner.RunWith
@ExperimentalCoroutinesApi
@@ -65,9 +73,10 @@ class DeviceEntryIconViewModelTest : SysuiTestCase() {
fun isLongPressEnabled_udfpsRunning() =
testScope.runTest {
val isLongPressEnabled by collectLastValue(underTest.isLongPressEnabled)
- fingerprintPropertyRepository.supportsUdfps()
- fingerprintAuthRepository.setIsRunning(true)
- keyguardRepository.setKeyguardDismissible(false)
+ setUpState(
+ isUdfpsSupported = true,
+ isUdfpsRunning = true,
+ )
assertThat(isLongPressEnabled).isFalse()
}
@@ -75,10 +84,10 @@ class DeviceEntryIconViewModelTest : SysuiTestCase() {
fun isLongPressEnabled_unlocked() =
testScope.runTest {
val isLongPressEnabled by collectLastValue(underTest.isLongPressEnabled)
- fingerprintPropertyRepository.supportsUdfps()
- keyguardRepository.setKeyguardDismissible(true)
- advanceTimeBy(UNLOCKED_DELAY_MS * 2) // wait for unlocked delay
- runCurrent()
+ setUpState(
+ isUdfpsSupported = true,
+ isLockscreenDismissible = true,
+ )
assertThat(isLongPressEnabled).isTrue()
}
@@ -86,10 +95,9 @@ class DeviceEntryIconViewModelTest : SysuiTestCase() {
fun isLongPressEnabled_lock() =
testScope.runTest {
val isLongPressEnabled by collectLastValue(underTest.isLongPressEnabled)
- keyguardRepository.setKeyguardDismissible(false)
+ setUpState(isUdfpsSupported = true)
// udfps supported
- fingerprintPropertyRepository.supportsUdfps()
assertThat(isLongPressEnabled).isTrue()
// udfps isn't supported
@@ -112,42 +120,90 @@ class DeviceEntryIconViewModelTest : SysuiTestCase() {
}
@Test
+ @DisableSceneContainer
fun iconType_fingerprint() =
testScope.runTest {
val iconType by collectLastValue(underTest.iconType)
- keyguardRepository.setKeyguardDismissible(false)
- fingerprintPropertyRepository.supportsUdfps()
- fingerprintAuthRepository.setIsRunning(true)
+ setUpState(
+ isUdfpsSupported = true,
+ isUdfpsRunning = true,
+ )
assertThat(iconType).isEqualTo(DeviceEntryIconView.IconType.FINGERPRINT)
}
@Test
+ @DisableSceneContainer
fun iconType_locked() =
testScope.runTest {
val iconType by collectLastValue(underTest.iconType)
- keyguardRepository.setKeyguardDismissible(false)
- fingerprintAuthRepository.setIsRunning(false)
+ setUpState()
assertThat(iconType).isEqualTo(DeviceEntryIconView.IconType.LOCK)
}
@Test
+ @DisableSceneContainer
fun iconType_unlocked() =
testScope.runTest {
val iconType by collectLastValue(underTest.iconType)
- keyguardRepository.setKeyguardDismissible(true)
- advanceTimeBy(UNLOCKED_DELAY_MS * 2) // wait for unlocked delay
- fingerprintAuthRepository.setIsRunning(false)
+ setUpState(isLockscreenDismissible = true)
assertThat(iconType).isEqualTo(DeviceEntryIconView.IconType.UNLOCK)
}
@Test
+ @DisableSceneContainer
fun iconType_none() =
testScope.runTest {
val iconType by collectLastValue(underTest.iconType)
- keyguardRepository.setKeyguardDismissible(true)
- advanceTimeBy(UNLOCKED_DELAY_MS * 2) // wait for unlocked delay
- fingerprintPropertyRepository.supportsUdfps()
- fingerprintAuthRepository.setIsRunning(true)
+ setUpState(
+ isUdfpsSupported = true,
+ isUdfpsRunning = true,
+ isLockscreenDismissible = true,
+ )
+ assertThat(iconType).isEqualTo(DeviceEntryIconView.IconType.NONE)
+ }
+
+ @Test
+ @EnableSceneContainer
+ fun iconType_fingerprint_withSceneContainer() =
+ testScope.runTest {
+ val iconType by collectLastValue(underTest.iconType)
+ setUpState(
+ isUdfpsSupported = true,
+ isUdfpsRunning = true,
+ )
+ assertThat(iconType).isEqualTo(DeviceEntryIconView.IconType.FINGERPRINT)
+ }
+
+ @Test
+ @EnableSceneContainer
+ fun iconType_locked_withSceneContainer() =
+ testScope.runTest {
+ val iconType by collectLastValue(underTest.iconType)
+ setUpState()
+ assertThat(iconType).isEqualTo(DeviceEntryIconView.IconType.LOCK)
+ }
+
+ @Test
+ @EnableSceneContainer
+ fun iconType_unlocked_withSceneContainer() =
+ testScope.runTest {
+ val iconType by collectLastValue(underTest.iconType)
+ setUpState(
+ isLockscreenDismissible = true,
+ )
+ assertThat(iconType).isEqualTo(DeviceEntryIconView.IconType.UNLOCK)
+ }
+
+ @Test
+ @EnableSceneContainer
+ fun iconType_none_withSceneContainer() =
+ testScope.runTest {
+ val iconType by collectLastValue(underTest.iconType)
+ setUpState(
+ isUdfpsSupported = true,
+ isUdfpsRunning = true,
+ isLockscreenDismissible = true,
+ )
assertThat(iconType).isEqualTo(DeviceEntryIconView.IconType.NONE)
}
@@ -166,14 +222,12 @@ class DeviceEntryIconViewModelTest : SysuiTestCase() {
kosmos.fakeAccessibilityRepository.isEnabled.value = true
// interactive lock icon
- keyguardRepository.setKeyguardDismissible(false)
- fingerprintPropertyRepository.supportsUdfps()
+ setUpState(isUdfpsSupported = true)
assertThat(accessibilityDelegateHint)
.isEqualTo(DeviceEntryIconView.AccessibilityHintType.AUTHENTICATE)
// non-interactive lock icon
- keyguardRepository.setKeyguardDismissible(false)
fingerprintPropertyRepository.supportsRearFps()
assertThat(accessibilityDelegateHint)
@@ -187,10 +241,10 @@ class DeviceEntryIconViewModelTest : SysuiTestCase() {
kosmos.fakeAccessibilityRepository.isEnabled.value = true
// interactive unlock icon
- keyguardRepository.setKeyguardDismissible(true)
- fingerprintPropertyRepository.supportsUdfps()
- advanceTimeBy(UNLOCKED_DELAY_MS * 2) // wait for unlocked delay
- runCurrent()
+ setUpState(
+ isUdfpsSupported = true,
+ isLockscreenDismissible = true,
+ )
assertThat(accessibilityDelegateHint)
.isEqualTo(DeviceEntryIconView.AccessibilityHintType.ENTER)
@@ -199,4 +253,45 @@ class DeviceEntryIconViewModelTest : SysuiTestCase() {
private fun deviceEntryIconTransitionAlpha(alpha: Float) {
deviceEntryIconTransition.setDeviceEntryParentViewAlpha(alpha)
}
+
+ private suspend fun TestScope.setUpState(
+ isUdfpsSupported: Boolean = false,
+ isUdfpsRunning: Boolean = false,
+ isLockscreenDismissible: Boolean = false,
+ ) {
+ if (isUdfpsSupported) {
+ fingerprintPropertyRepository.supportsUdfps()
+ }
+ if (isUdfpsRunning) {
+ check(isUdfpsSupported) { "Cannot set UDFPS as running if it's not supported!" }
+ fingerprintAuthRepository.setIsRunning(true)
+ } else {
+ fingerprintAuthRepository.setIsRunning(false)
+ }
+ if (isLockscreenDismissible) {
+ setLockscreenDismissible()
+ } else {
+ if (!SceneContainerFlag.isEnabled) {
+ keyguardRepository.setKeyguardDismissible(false)
+ }
+ }
+ runCurrent()
+ }
+
+ private suspend fun TestScope.setLockscreenDismissible() {
+ if (SceneContainerFlag.isEnabled) {
+ // Need to set up a collection for the authentication to be propagated.
+ val unused by collectLastValue(kosmos.deviceUnlockedInteractor.deviceUnlockStatus)
+ runCurrent()
+ assertThat(
+ kosmos.authenticationInteractor.authenticate(
+ FakeAuthenticationRepository.DEFAULT_PIN
+ )
+ )
+ .isEqualTo(AuthenticationResult.SUCCEEDED)
+ } else {
+ keyguardRepository.setKeyguardDismissible(true)
+ }
+ advanceTimeBy(UNLOCKED_DELAY_MS * 2) // wait for unlocked delay
+ }
}
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/media/controls/domain/interactor/MediaControlInteractorTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/media/controls/domain/interactor/MediaControlInteractorTest.kt
index 365a7c3a296a..856c3fe19d73 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/media/controls/domain/interactor/MediaControlInteractorTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/media/controls/domain/interactor/MediaControlInteractorTest.kt
@@ -195,6 +195,7 @@ class MediaControlInteractorTest : SysuiTestCase() {
eq(PACKAGE_NAME),
eq(true),
eq(dialogTransitionController),
+ eq(null),
eq(null)
)
}
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/ui/adapter/QSSceneAdapterImplTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/ui/adapter/QSSceneAdapterImplTest.kt
index c660ff3a7297..afe7b8f8d50b 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/ui/adapter/QSSceneAdapterImplTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/ui/adapter/QSSceneAdapterImplTest.kt
@@ -257,7 +257,7 @@ class QSSceneAdapterImplTest : SysuiTestCase() {
runCurrent()
clearInvocations(qsImpl!!)
- underTest.setState(QSSceneAdapter.State.UnsquishingQQS(squishiness))
+ underTest.setState(QSSceneAdapter.State.UnsquishingQQS { squishiness })
with(qsImpl!!) {
verify(this).setQsVisible(true)
verify(this)
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/ui/adapter/QSSceneAdapterTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/ui/adapter/QSSceneAdapterTest.kt
index ebd65fdcd538..63ce67c5eb28 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/ui/adapter/QSSceneAdapterTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/qs/ui/adapter/QSSceneAdapterTest.kt
@@ -32,7 +32,7 @@ class QSSceneAdapterTest : SysuiTestCase() {
@Test
fun expanding_squishiness1() {
- assertThat(QSSceneAdapter.State.Expanding(0.3f).squishiness).isEqualTo(1f)
+ assertThat(QSSceneAdapter.State.Expanding(0.3f).squishiness()).isEqualTo(1f)
}
@Test
@@ -51,14 +51,14 @@ class QSSceneAdapterTest : SysuiTestCase() {
@Test
fun unsquishingQQS_expansionSameAsQQS() {
val squishiness = 0.6f
- assertThat(QSSceneAdapter.State.UnsquishingQQS(squishiness).expansion)
+ assertThat(QSSceneAdapter.State.UnsquishingQQS { squishiness }.expansion)
.isEqualTo(QSSceneAdapter.State.QQS.expansion)
}
@Test
fun unsquishingQS_expansionSameAsQS() {
val squishiness = 0.6f
- assertThat(QSSceneAdapter.State.UnsquishingQS(squishiness).expansion)
+ assertThat(QSSceneAdapter.State.UnsquishingQS { squishiness }.expansion)
.isEqualTo(QSSceneAdapter.State.QS.expansion)
}
}
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/scene/domain/interactor/SceneInteractorTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/scene/domain/interactor/SceneInteractorTest.kt
index 2fa94effdbd4..229a711d637d 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/scene/domain/interactor/SceneInteractorTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/scene/domain/interactor/SceneInteractorTest.kt
@@ -126,6 +126,31 @@ class SceneInteractorTest : SysuiTestCase() {
}
@Test
+ fun changeScene_toGoneWhenTransitionToLockedFromGone() =
+ testScope.runTest {
+ underTest = kosmos.sceneInteractor
+ val currentScene by collectLastValue(underTest.currentScene)
+ val transitionTo by collectLastValue(underTest.transitioningTo)
+ kosmos.sceneContainerRepository.setTransitionState(
+ flowOf(
+ ObservableTransitionState.Transition(
+ fromScene = Scenes.Gone,
+ toScene = Scenes.Lockscreen,
+ currentScene = flowOf(Scenes.Lockscreen),
+ progress = flowOf(.5f),
+ isInitiatedByUserInput = true,
+ isUserInputOngoing = flowOf(false),
+ )
+ )
+ )
+ assertThat(currentScene).isEqualTo(Scenes.Lockscreen)
+ assertThat(transitionTo).isEqualTo(Scenes.Lockscreen)
+
+ underTest.changeScene(Scenes.Gone, "simulate double tap power")
+ assertThat(currentScene).isEqualTo(Scenes.Gone)
+ }
+
+ @Test
fun snapToScene_toUnknownScene_doesNothing() =
testScope.runTest {
val sceneKeys =
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/scene/domain/startable/SceneContainerStartableTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/scene/domain/startable/SceneContainerStartableTest.kt
index 677477df8ea1..ac66e6657a75 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/scene/domain/startable/SceneContainerStartableTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/scene/domain/startable/SceneContainerStartableTest.kt
@@ -49,6 +49,7 @@ import com.android.systemui.power.data.repository.fakePowerRepository
import com.android.systemui.power.domain.interactor.PowerInteractor.Companion.setAsleepForTest
import com.android.systemui.power.domain.interactor.PowerInteractor.Companion.setAwakeForTest
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.scene.domain.interactor.sceneContainerStartable
import com.android.systemui.scene.domain.interactor.sceneInteractor
@@ -383,6 +384,43 @@ class SceneContainerStartableTest : SysuiTestCase() {
}
@Test
+ fun switchToGoneWhenDoubleTapPowerGestureIsTriggeredFromGone() =
+ testScope.runTest {
+ val currentSceneKey by collectLastValue(sceneInteractor.currentScene)
+ val transitionStateFlow =
+ prepareState(
+ authenticationMethod = AuthenticationMethodModel.Pin,
+ isDeviceUnlocked = true,
+ initialSceneKey = Scenes.Gone,
+ )
+ assertThat(currentSceneKey).isEqualTo(Scenes.Gone)
+ underTest.start()
+
+ kosmos.fakePowerRepository.updateWakefulness(
+ rawState = WakefulnessState.STARTING_TO_SLEEP,
+ lastSleepReason = WakeSleepReason.POWER_BUTTON,
+ powerButtonLaunchGestureTriggered = false,
+ )
+ transitionStateFlow.value =
+ ObservableTransitionState.Transition(
+ fromScene = Scenes.Gone,
+ toScene = Scenes.Lockscreen,
+ currentScene = flowOf(Scenes.Lockscreen),
+ progress = flowOf(0.5f),
+ isInitiatedByUserInput = true,
+ isUserInputOngoing = flowOf(false),
+ )
+ assertThat(currentSceneKey).isEqualTo(Scenes.Lockscreen)
+
+ kosmos.fakePowerRepository.updateWakefulness(
+ rawState = WakefulnessState.STARTING_TO_WAKE,
+ lastSleepReason = WakeSleepReason.POWER_BUTTON,
+ powerButtonLaunchGestureTriggered = true,
+ )
+ assertThat(currentSceneKey).isEqualTo(Scenes.Gone)
+ }
+
+ @Test
fun hydrateSystemUiState() =
testScope.runTest {
val transitionStateFlow = prepareState()
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/domain/interactor/HeadsUpNotificationInteractorTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/domain/interactor/HeadsUpNotificationInteractorTest.kt
index bba9991883f5..8b4265f552fe 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/domain/interactor/HeadsUpNotificationInteractorTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/domain/interactor/HeadsUpNotificationInteractorTest.kt
@@ -23,8 +23,14 @@ 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.keyguard.data.repository.FakeKeyguardTransitionRepository
+import com.android.systemui.keyguard.data.repository.fakeDeviceEntryFaceAuthRepository
+import com.android.systemui.keyguard.data.repository.fakeKeyguardTransitionRepository
+import com.android.systemui.keyguard.shared.model.KeyguardState
import com.android.systemui.kosmos.testScope
+import com.android.systemui.shade.shadeTestUtil
import com.android.systemui.statusbar.notification.data.repository.FakeHeadsUpRowRepository
+import com.android.systemui.statusbar.notification.data.repository.notificationsKeyguardViewStateRepository
import com.android.systemui.statusbar.notification.shared.NotificationsHeadsUpRefactor
import com.android.systemui.statusbar.notification.stack.data.repository.headsUpNotificationRepository
import com.android.systemui.statusbar.notification.stack.data.repository.setNotifications
@@ -41,9 +47,19 @@ import org.junit.runner.RunWith
@RunWith(AndroidJUnit4::class)
@EnableFlags(NotificationsHeadsUpRefactor.FLAG_NAME)
class HeadsUpNotificationInteractorTest : SysuiTestCase() {
- private val kosmos = testKosmos()
+ private val kosmos =
+ testKosmos().apply {
+ fakeKeyguardTransitionRepository =
+ FakeKeyguardTransitionRepository(initInLockscreen = false)
+ }
private val testScope = kosmos.testScope
- private val repository = kosmos.headsUpNotificationRepository
+ private val faceAuthRepository by lazy { kosmos.fakeDeviceEntryFaceAuthRepository }
+ private val headsUpRepository by lazy { kosmos.headsUpNotificationRepository }
+ private val keyguardTransitionRepository by lazy { kosmos.fakeKeyguardTransitionRepository }
+ private val keyguardViewStateRepository by lazy {
+ kosmos.notificationsKeyguardViewStateRepository
+ }
+ private val shadeTestUtil by lazy { kosmos.shadeTestUtil }
private val underTest = kosmos.headsUpNotificationInteractor
@@ -60,7 +76,7 @@ class HeadsUpNotificationInteractorTest : SysuiTestCase() {
testScope.runTest {
val hasPinnedRows by collectLastValue(underTest.hasPinnedRows)
// WHEN no pinned rows are set
- repository.setNotifications(
+ headsUpRepository.setNotifications(
fakeHeadsUpRowRepository("key 0"),
fakeHeadsUpRowRepository("key 1"),
fakeHeadsUpRowRepository("key 2"),
@@ -76,7 +92,7 @@ class HeadsUpNotificationInteractorTest : SysuiTestCase() {
testScope.runTest {
val hasPinnedRows by collectLastValue(underTest.hasPinnedRows)
// WHEN a pinned rows is set
- repository.setNotifications(
+ headsUpRepository.setNotifications(
fakeHeadsUpRowRepository("key 0", isPinned = true),
fakeHeadsUpRowRepository("key 1"),
fakeHeadsUpRowRepository("key 2"),
@@ -98,7 +114,7 @@ class HeadsUpNotificationInteractorTest : SysuiTestCase() {
fakeHeadsUpRowRepository("key 1"),
fakeHeadsUpRowRepository("key 2"),
)
- repository.setNotifications(rows)
+ headsUpRepository.setNotifications(rows)
runCurrent()
// WHEN a row gets pinned
@@ -120,7 +136,7 @@ class HeadsUpNotificationInteractorTest : SysuiTestCase() {
fakeHeadsUpRowRepository("key 1"),
fakeHeadsUpRowRepository("key 2"),
)
- repository.setNotifications(rows)
+ headsUpRepository.setNotifications(rows)
runCurrent()
// THEN that row gets unpinned
@@ -144,7 +160,7 @@ class HeadsUpNotificationInteractorTest : SysuiTestCase() {
testScope.runTest {
val pinnedHeadsUpRows by collectLastValue(underTest.pinnedHeadsUpRows)
// WHEN no rows are pinned
- repository.setNotifications(
+ headsUpRepository.setNotifications(
fakeHeadsUpRowRepository("key 0"),
fakeHeadsUpRowRepository("key 1"),
fakeHeadsUpRowRepository("key 2"),
@@ -166,7 +182,7 @@ class HeadsUpNotificationInteractorTest : SysuiTestCase() {
fakeHeadsUpRowRepository("key 1", isPinned = true),
fakeHeadsUpRowRepository("key 2"),
)
- repository.setNotifications(rows)
+ headsUpRepository.setNotifications(rows)
runCurrent()
// THEN the unpinned rows are filtered
@@ -184,7 +200,7 @@ class HeadsUpNotificationInteractorTest : SysuiTestCase() {
fakeHeadsUpRowRepository("key 1", isPinned = true),
fakeHeadsUpRowRepository("key 2"),
)
- repository.setNotifications(rows)
+ headsUpRepository.setNotifications(rows)
runCurrent()
// WHEN all rows gets pinned
@@ -206,7 +222,7 @@ class HeadsUpNotificationInteractorTest : SysuiTestCase() {
fakeHeadsUpRowRepository("key 1", isPinned = true),
fakeHeadsUpRowRepository("key 2", isPinned = true),
)
- repository.setNotifications(rows)
+ headsUpRepository.setNotifications(rows)
runCurrent()
// THEN no rows are filtered
@@ -224,7 +240,7 @@ class HeadsUpNotificationInteractorTest : SysuiTestCase() {
fakeHeadsUpRowRepository("key 1", isPinned = true),
fakeHeadsUpRowRepository("key 2", isPinned = true),
)
- repository.setNotifications(rows)
+ headsUpRepository.setNotifications(rows)
runCurrent()
// WHEN a row gets unpinned
@@ -246,7 +262,7 @@ class HeadsUpNotificationInteractorTest : SysuiTestCase() {
fakeHeadsUpRowRepository("key 1"),
fakeHeadsUpRowRepository("key 2"),
)
- repository.setNotifications(rows)
+ headsUpRepository.setNotifications(rows)
runCurrent()
rows[0].isPinned.value = true
@@ -262,6 +278,96 @@ class HeadsUpNotificationInteractorTest : SysuiTestCase() {
assertThat(pinnedHeadsUpRows).containsExactly(rows[0])
}
+ @Test
+ fun showHeadsUpStatusBar_true() =
+ testScope.runTest {
+ val showHeadsUpStatusBar by collectLastValue(underTest.showHeadsUpStatusBar)
+
+ // WHEN a row is pinned
+ headsUpRepository.setNotifications(fakeHeadsUpRowRepository("key 0", isPinned = true))
+
+ assertThat(showHeadsUpStatusBar).isTrue()
+ }
+
+ @Test
+ fun showHeadsUpStatusBar_withoutPinnedNotifications_false() =
+ testScope.runTest {
+ val showHeadsUpStatusBar by collectLastValue(underTest.showHeadsUpStatusBar)
+
+ // WHEN no row is pinned
+ headsUpRepository.setNotifications(fakeHeadsUpRowRepository("key 0", isPinned = false))
+
+ assertThat(showHeadsUpStatusBar).isFalse()
+ }
+
+ @Test
+ fun showHeadsUpStatusBar_whenShadeExpanded_false() =
+ testScope.runTest {
+ val showHeadsUpStatusBar by collectLastValue(underTest.showHeadsUpStatusBar)
+
+ // WHEN a row is pinned
+ headsUpRepository.setNotifications(fakeHeadsUpRowRepository("key 0", isPinned = true))
+ // AND the shade is expanded
+ shadeTestUtil.setShadeExpansion(1.0f)
+
+ assertThat(showHeadsUpStatusBar).isFalse()
+ }
+
+ @Test
+ fun showHeadsUpStatusBar_notificationsAreHidden_false() =
+ testScope.runTest {
+ val showHeadsUpStatusBar by collectLastValue(underTest.showHeadsUpStatusBar)
+
+ // WHEN a row is pinned
+ headsUpRepository.setNotifications(fakeHeadsUpRowRepository("key 0", isPinned = true))
+ // AND the notifications are hidden
+ keyguardViewStateRepository.areNotificationsFullyHidden.value = true
+
+ assertThat(showHeadsUpStatusBar).isFalse()
+ }
+
+ @Test
+ fun showHeadsUpStatusBar_onLockScreen_false() =
+ testScope.runTest {
+ val showHeadsUpStatusBar by collectLastValue(underTest.showHeadsUpStatusBar)
+
+ // WHEN a row is pinned
+ headsUpRepository.setNotifications(fakeHeadsUpRowRepository("key 0", isPinned = true))
+ // AND the lock screen is shown
+ keyguardTransitionRepository.emitInitialStepsFromOff(to = KeyguardState.LOCKSCREEN)
+
+ assertThat(showHeadsUpStatusBar).isFalse()
+ }
+
+ @Test
+ fun showHeadsUpStatusBar_onByPassLockScreen_true() =
+ testScope.runTest {
+ val showHeadsUpStatusBar by collectLastValue(underTest.showHeadsUpStatusBar)
+
+ // WHEN a row is pinned
+ headsUpRepository.setNotifications(fakeHeadsUpRowRepository("key 0", isPinned = true))
+ // AND the lock screen is shown
+ keyguardTransitionRepository.emitInitialStepsFromOff(to = KeyguardState.LOCKSCREEN)
+ // AND bypass is enabled
+ faceAuthRepository.isBypassEnabled.value = true
+
+ assertThat(showHeadsUpStatusBar).isTrue()
+ }
+
+ @Test
+ fun showHeadsUpStatusBar_onByPassLockScreen_withoutNotifications_false() =
+ testScope.runTest {
+ val showHeadsUpStatusBar by collectLastValue(underTest.showHeadsUpStatusBar)
+
+ // WHEN no pinned rows
+ // AND the lock screen is shown
+ keyguardTransitionRepository.emitInitialStepsFromOff(to = KeyguardState.LOCKSCREEN)
+ // AND bypass is enabled
+ faceAuthRepository.isBypassEnabled.value = true
+
+ assertThat(showHeadsUpStatusBar).isFalse()
+ }
+
private fun fakeHeadsUpRowRepository(key: String, isPinned: Boolean = false) =
FakeHeadsUpRowRepository(key = key, elementKey = Any()).apply {
this.isPinned.value = isPinned
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/NotificationListViewModelTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/NotificationListViewModelTest.kt
index cc5df74e5e6e..9fde116e968c 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/NotificationListViewModelTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/NotificationListViewModelTest.kt
@@ -524,9 +524,9 @@ class NotificationListViewModelTest(flags: FlagsParameterization) : SysuiTestCas
// WHEN there are no pinned rows
val rows =
arrayListOf(
- fakeHeadsUpRowRepository(key = "0"),
- fakeHeadsUpRowRepository(key = "1"),
- fakeHeadsUpRowRepository(key = "2"),
+ FakeHeadsUpRowRepository(key = "0"),
+ FakeHeadsUpRowRepository(key = "1"),
+ FakeHeadsUpRowRepository(key = "2"),
)
headsUpRepository.setNotifications(
rows,
@@ -565,8 +565,8 @@ class NotificationListViewModelTest(flags: FlagsParameterization) : SysuiTestCas
val hasPinnedHeadsUpRow by collectLastValue(underTest.hasPinnedHeadsUpRow)
headsUpRepository.setNotifications(
- fakeHeadsUpRowRepository(key = "0", isPinned = true),
- fakeHeadsUpRowRepository(key = "1")
+ FakeHeadsUpRowRepository(key = "0", isPinned = true),
+ FakeHeadsUpRowRepository(key = "1")
)
runCurrent()
@@ -580,8 +580,8 @@ class NotificationListViewModelTest(flags: FlagsParameterization) : SysuiTestCas
val hasPinnedHeadsUpRow by collectLastValue(underTest.hasPinnedHeadsUpRow)
headsUpRepository.setNotifications(
- fakeHeadsUpRowRepository(key = "0"),
- fakeHeadsUpRowRepository(key = "1"),
+ FakeHeadsUpRowRepository(key = "0"),
+ FakeHeadsUpRowRepository(key = "1"),
)
runCurrent()
@@ -607,7 +607,7 @@ class NotificationListViewModelTest(flags: FlagsParameterization) : SysuiTestCas
val animationsEnabled by collectLastValue(underTest.headsUpAnimationsEnabled)
shadeTestUtil.setQsExpansion(0.0f)
- fakeKeyguardRepository.setKeyguardShowing(false)
+ fakeKeyguardRepository.setStatusBarState(StatusBarState.SHADE)
runCurrent()
assertThat(animationsEnabled).isTrue()
@@ -620,14 +620,9 @@ class NotificationListViewModelTest(flags: FlagsParameterization) : SysuiTestCas
val animationsEnabled by collectLastValue(underTest.headsUpAnimationsEnabled)
shadeTestUtil.setQsExpansion(0.0f)
- fakeKeyguardRepository.setKeyguardShowing(true)
+ fakeKeyguardRepository.setStatusBarState(StatusBarState.KEYGUARD)
runCurrent()
assertThat(animationsEnabled).isFalse()
}
-
- private fun fakeHeadsUpRowRepository(key: String, isPinned: Boolean = false) =
- FakeHeadsUpRowRepository(key = key, elementKey = Any()).apply {
- this.isPinned.value = isPinned
- }
}
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/volume/domain/interactor/AudioVolumeInteractorTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/volume/domain/interactor/AudioVolumeInteractorTest.kt
index a163ca08691e..d620639b2219 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/volume/domain/interactor/AudioVolumeInteractorTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/volume/domain/interactor/AudioVolumeInteractorTest.kt
@@ -192,10 +192,12 @@ class AudioVolumeInteractorTest : SysuiTestCase() {
fun streamNotAffectedByMute_isNotMutable() {
with(kosmos) {
testScope.runTest {
- audioRepository.setIsAffectedByMute(audioStream, false)
- val isMutable = underTest.isAffectedByMute(audioStream)
+ val audioStreamModel by collectLastValue(underTest.getAudioStream(audioStream))
+ audioRepository.setAudioStreamModel(
+ audioStreamModel!!.copy(isAffectedByMute = false)
+ )
- assertThat(isMutable).isFalse()
+ assertThat(audioStreamModel!!.isAffectedByMute).isFalse()
}
}
}
@@ -230,6 +232,7 @@ class AudioVolumeInteractorTest : SysuiTestCase() {
testScope.runTest {
val audioStreamModel by
collectLastValue(audioRepository.getAudioStream(audioStream))
+ underTest.setVolume(audioStream, audioStreamModel!!.maxVolume)
runCurrent()
underTest.setVolume(audioStream, audioStreamModel!!.minVolume)
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/volume/panel/component/anc/data/repository/AncSliceRepositoryTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/volume/panel/component/anc/data/repository/AncSliceRepositoryTest.kt
index dddf582908c7..9a952742f735 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/volume/panel/component/anc/data/repository/AncSliceRepositoryTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/volume/panel/component/anc/data/repository/AncSliceRepositoryTest.kt
@@ -18,20 +18,13 @@ package com.android.systemui.volume.panel.component.anc.data.repository
import android.bluetooth.BluetoothDevice
import android.net.Uri
+import android.testing.TestableLooper
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
-import com.android.settingslib.bluetooth.CachedBluetoothDevice
-import com.android.settingslib.media.BluetoothMediaDevice
-import com.android.settingslib.media.MediaDevice
import com.android.systemui.SysuiTestCase
import com.android.systemui.coroutines.collectLastValue
import com.android.systemui.kosmos.testScope
import com.android.systemui.testKosmos
-import com.android.systemui.util.mockito.any
-import com.android.systemui.util.mockito.mock
-import com.android.systemui.util.mockito.whenever
-import com.android.systemui.volume.localMediaRepository
-import com.android.systemui.volume.localMediaRepositoryFactory
import com.android.systemui.volume.panel.component.anc.FakeSliceFactory
import com.android.systemui.volume.panel.component.anc.sliceViewManager
import com.google.common.truth.Truth.assertThat
@@ -41,10 +34,14 @@ import kotlinx.coroutines.test.runTest
import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
+import org.mockito.kotlin.any
+import org.mockito.kotlin.mock
+import org.mockito.kotlin.whenever
@OptIn(ExperimentalCoroutinesApi::class)
@SmallTest
@RunWith(AndroidJUnit4::class)
+@TestableLooper.RunWithLooper(setAsMainLooper = true)
class AncSliceRepositoryTest : SysuiTestCase() {
private val kosmos = testKosmos()
@@ -57,23 +54,23 @@ class AncSliceRepositoryTest : SysuiTestCase() {
val slice = FakeSliceFactory.createSlice(hasError = false, hasSliceItem = true)
whenever(sliceViewManager.bindSlice(any<Uri>())).thenReturn(slice)
- underTest =
- AncSliceRepositoryImpl(
- localMediaRepositoryFactory,
- testScope.testScheduler,
- testScope.testScheduler,
- sliceViewManager,
- )
+ underTest = AncSliceRepositoryImpl(testScope.testScheduler, sliceViewManager)
}
}
@Test
- fun noConnectedDevice_noSlice() {
+ fun connectedDevice_noUri_noSlice() {
with(kosmos) {
testScope.runTest {
- localMediaRepository.updateCurrentConnectedDevice(null)
-
- val slice by collectLastValue(underTest.ancSlice(1, false, false))
+ val slice by
+ collectLastValue(
+ underTest.ancSlice(
+ device = createMediaDevice(""),
+ width = 1,
+ isCollapsed = false,
+ hideLabel = false,
+ )
+ )
runCurrent()
assertThat(slice).isNull()
@@ -82,12 +79,18 @@ class AncSliceRepositoryTest : SysuiTestCase() {
}
@Test
- fun connectedDevice_sliceReturned() {
+ fun connectedDevice_hasUri_sliceReturned() {
with(kosmos) {
testScope.runTest {
- localMediaRepository.updateCurrentConnectedDevice(createMediaDevice())
-
- val slice by collectLastValue(underTest.ancSlice(1, false, false))
+ val slice by
+ collectLastValue(
+ underTest.ancSlice(
+ device = createMediaDevice("content://test.slice"),
+ width = 1,
+ isCollapsed = false,
+ hideLabel = false,
+ )
+ )
runCurrent()
assertThat(slice).isNotNull()
@@ -95,21 +98,13 @@ class AncSliceRepositoryTest : SysuiTestCase() {
}
}
- private fun createMediaDevice(sliceUri: String = "content://test.slice"): MediaDevice {
- val bluetoothDevice: BluetoothDevice = mock {
- whenever(getMetadata(any()))
- .thenReturn(
- ("<HEARABLE_CONTROL_SLICE_WITH_WIDTH>" +
- sliceUri +
- "</HEARABLE_CONTROL_SLICE_WITH_WIDTH>")
- .toByteArray()
- )
- }
- val cachedBluetoothDevice: CachedBluetoothDevice = mock {
- whenever(device).thenReturn(bluetoothDevice)
- }
- return mock<BluetoothMediaDevice> {
- whenever(cachedDevice).thenReturn(cachedBluetoothDevice)
- }
+ private fun createMediaDevice(sliceUri: String): BluetoothDevice = mock {
+ on { getMetadata(any()) }
+ .thenReturn(
+ ("<HEARABLE_CONTROL_SLICE_WITH_WIDTH>" +
+ sliceUri +
+ "</HEARABLE_CONTROL_SLICE_WITH_WIDTH>")
+ .toByteArray()
+ )
}
}
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/volume/panel/component/anc/domain/AncAvailabilityCriteriaTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/volume/panel/component/anc/domain/AncAvailabilityCriteriaTest.kt
index 553aed8cfb05..8d052fe12a5a 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/volume/panel/component/anc/domain/AncAvailabilityCriteriaTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/volume/panel/component/anc/domain/AncAvailabilityCriteriaTest.kt
@@ -16,7 +16,9 @@
package com.android.systemui.volume.panel.component.anc.domain
+import android.media.AudioManager
import android.net.Uri
+import android.testing.TestableLooper
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.systemui.SysuiTestCase
@@ -26,10 +28,13 @@ import com.android.systemui.testKosmos
import com.android.systemui.util.mockito.any
import com.android.systemui.util.mockito.mock
import com.android.systemui.util.mockito.whenever
+import com.android.systemui.volume.data.repository.audioRepository
+import com.android.systemui.volume.localMediaRepository
import com.android.systemui.volume.panel.component.anc.FakeSliceFactory
import com.android.systemui.volume.panel.component.anc.ancSliceInteractor
import com.android.systemui.volume.panel.component.anc.ancSliceRepository
import com.android.systemui.volume.panel.component.anc.sliceViewManager
+import com.android.systemui.volume.panel.component.mediaoutput.domain.interactor.TestMediaDevicesFactory
import com.google.common.truth.Truth.assertThat
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.test.runCurrent
@@ -41,6 +46,7 @@ import org.junit.runner.RunWith
@OptIn(ExperimentalCoroutinesApi::class)
@SmallTest
@RunWith(AndroidJUnit4::class)
+@TestableLooper.RunWithLooper(setAsMainLooper = true)
class AncAvailabilityCriteriaTest : SysuiTestCase() {
private val kosmos = testKosmos()
@@ -74,6 +80,10 @@ class AncAvailabilityCriteriaTest : SysuiTestCase() {
fun hasSlice_available() {
with(kosmos) {
testScope.runTest {
+ audioRepository.setMode(AudioManager.MODE_NORMAL)
+ localMediaRepository.updateCurrentConnectedDevice(
+ TestMediaDevicesFactory.bluetoothMediaDevice()
+ )
ancSliceRepository.putSlice(
1,
FakeSliceFactory.createSlice(hasError = false, hasSliceItem = true)
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/volume/panel/component/anc/domain/interactor/AncSliceInteractorTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/volume/panel/component/anc/domain/interactor/AncSliceInteractorTest.kt
index 81e6ac412404..741671e6a8a3 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/volume/panel/component/anc/domain/interactor/AncSliceInteractorTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/volume/panel/component/anc/domain/interactor/AncSliceInteractorTest.kt
@@ -16,15 +16,21 @@
package com.android.systemui.volume.panel.component.anc.domain.interactor
+import android.media.AudioManager
+import android.testing.TestableLooper
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.kosmos.testScope
import com.android.systemui.testKosmos
+import com.android.systemui.volume.data.repository.audioRepository
+import com.android.systemui.volume.localMediaRepository
import com.android.systemui.volume.panel.component.anc.FakeSliceFactory
+import com.android.systemui.volume.panel.component.anc.ancSliceInteractor
import com.android.systemui.volume.panel.component.anc.ancSliceRepository
import com.android.systemui.volume.panel.component.anc.domain.model.AncSlices
+import com.android.systemui.volume.panel.component.mediaoutput.domain.interactor.TestMediaDevicesFactory
import com.google.common.truth.Truth.assertThat
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.test.runCurrent
@@ -36,6 +42,7 @@ import org.junit.runner.RunWith
@OptIn(ExperimentalCoroutinesApi::class)
@SmallTest
@RunWith(AndroidJUnit4::class)
+@TestableLooper.RunWithLooper(setAsMainLooper = true)
class AncSliceInteractorTest : SysuiTestCase() {
private val kosmos = testKosmos()
@@ -43,14 +50,12 @@ class AncSliceInteractorTest : SysuiTestCase() {
private lateinit var underTest: AncSliceInteractor
@Before
- fun setup() {
- with(kosmos) {
- underTest = AncSliceInteractor(ancSliceRepository, testScope.backgroundScope)
- }
+ fun setUp() {
+ underTest = kosmos.ancSliceInteractor
}
@Test
- fun errorSlice_returnsNull() {
+ fun errorSlice_returnsUnavailable() {
with(kosmos) {
testScope.runTest {
ancSliceRepository.putSlice(
@@ -67,7 +72,7 @@ class AncSliceInteractorTest : SysuiTestCase() {
}
@Test
- fun noSliceItem_returnsNull() {
+ fun noSliceItem_returnsUnavailable() {
with(kosmos) {
testScope.runTest {
ancSliceRepository.putSlice(
@@ -84,9 +89,31 @@ class AncSliceInteractorTest : SysuiTestCase() {
}
@Test
+ fun sliceItem_noError_noDevice_returnsUnavailable() {
+ with(kosmos) {
+ testScope.runTest {
+ ancSliceRepository.putSlice(
+ 1,
+ FakeSliceFactory.createSlice(hasError = false, hasSliceItem = true)
+ )
+
+ val slice by collectLastValue(underTest.ancSlices)
+ runCurrent()
+
+ assertThat(slice).isInstanceOf(AncSlices.Unavailable::class.java)
+ }
+ }
+ }
+
+ @Test
fun sliceItem_noError_returnsSlice() {
with(kosmos) {
testScope.runTest {
+ audioRepository.setMode(AudioManager.MODE_NORMAL)
+ localMediaRepository.updateCurrentConnectedDevice(
+ TestMediaDevicesFactory.bluetoothMediaDevice()
+ )
+
ancSliceRepository.putSlice(
1,
FakeSliceFactory.createSlice(hasError = false, hasSliceItem = true)
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/volume/panel/component/spatial/SpatialAudioComponentKosmos.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/volume/panel/component/spatial/SpatialAudioComponentKosmos.kt
index 737b7f3e0af0..777240c57c2e 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/volume/panel/component/spatial/SpatialAudioComponentKosmos.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/volume/panel/component/spatial/SpatialAudioComponentKosmos.kt
@@ -19,13 +19,13 @@ package com.android.systemui.volume.panel.component.spatial
import com.android.systemui.kosmos.Kosmos
import com.android.systemui.kosmos.testScope
import com.android.systemui.media.spatializerInteractor
-import com.android.systemui.volume.mediaOutputInteractor
+import com.android.systemui.volume.domain.interactor.audioOutputInteractor
import com.android.systemui.volume.panel.component.spatial.domain.interactor.SpatialAudioComponentInteractor
val Kosmos.spatialAudioComponentInteractor by
Kosmos.Fixture {
SpatialAudioComponentInteractor(
- mediaOutputInteractor,
+ audioOutputInteractor,
spatializerInteractor,
testScope.backgroundScope
)
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/volume/panel/component/spatial/domain/interactor/SpatialAudioComponentInteractorTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/volume/panel/component/spatial/domain/interactor/SpatialAudioComponentInteractorTest.kt
index e36ae60ebe7d..c6c46faf97f7 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/volume/panel/component/spatial/domain/interactor/SpatialAudioComponentInteractorTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/volume/panel/component/spatial/domain/interactor/SpatialAudioComponentInteractorTest.kt
@@ -29,7 +29,6 @@ import com.android.systemui.SysuiTestCase
import com.android.systemui.coroutines.collectLastValue
import com.android.systemui.coroutines.collectValues
import com.android.systemui.kosmos.testScope
-import com.android.systemui.media.spatializerInteractor
import com.android.systemui.media.spatializerRepository
import com.android.systemui.testKosmos
import com.android.systemui.util.mockito.mock
@@ -37,9 +36,9 @@ import com.android.systemui.util.mockito.whenever
import com.android.systemui.volume.localMediaController
import com.android.systemui.volume.localMediaRepository
import com.android.systemui.volume.mediaControllerRepository
-import com.android.systemui.volume.mediaOutputInteractor
import com.android.systemui.volume.panel.component.spatial.domain.model.SpatialAudioAvailabilityModel
import com.android.systemui.volume.panel.component.spatial.domain.model.SpatialAudioEnabledModel
+import com.android.systemui.volume.panel.component.spatial.spatialAudioComponentInteractor
import com.google.common.truth.Truth.assertThat
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.test.runCurrent
@@ -76,12 +75,7 @@ class SpatialAudioComponentInteractorTest : SysuiTestCase() {
mediaControllerRepository.setActiveSessions(listOf(localMediaController))
- underTest =
- SpatialAudioComponentInteractor(
- mediaOutputInteractor,
- spatializerInteractor,
- testScope.backgroundScope,
- )
+ underTest = spatialAudioComponentInteractor
}
}
diff --git a/packages/SystemUI/res/drawable/qs_tile_background_flagged.xml b/packages/SystemUI/res/drawable/qs_tile_background_flagged.xml
index a30a12221105..c32acf2fdea2 100644
--- a/packages/SystemUI/res/drawable/qs_tile_background_flagged.xml
+++ b/packages/SystemUI/res/drawable/qs_tile_background_flagged.xml
@@ -15,16 +15,10 @@
-->
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
android:color="@color/qs_tile_ripple_color">
- <!-- We don't really use the ripple effect here, but changing it to LayerDrawable causes
- performance regression, see: b/339412453.
- Since this ripple has just one layer inside, we can try to remove that extra "background"
- layer. However this should only be done when the flag
- com.android.systemui.qs_tile_focus_state has completed all its stages and this drawable
- fully replaces the previous one to ensure consistency with code sections searching for
- specific ids in drawable hierarchy
- -->
<item
- android:id="@id/background">
+ android:id="@android:id/mask"
+ android:drawable="@drawable/qs_tile_background_shape" />
+ <item android:id="@id/background">
<layer-list>
<item
android:id="@+id/qs_tile_background_base"
@@ -32,22 +26,8 @@
<item android:id="@+id/qs_tile_background_overlay">
<selector>
<item
- android:state_hovered="true"
- android:drawable="@drawable/qs_tile_background_shape" />
- </selector>
- </item>
- <!-- In the layer below we have negative insets because we need the focus outline
- to draw outside the bounds, around the main background. We use 5dp because
- the outline stroke is 3dp and the required padding is 2dp.-->
- <item
- android:top="-5dp"
- android:right="-5dp"
- android:left="-5dp"
- android:bottom="-5dp">
- <selector>
- <item
- android:state_focused="true"
- android:drawable="@drawable/qs_tile_focused_background"/>
+ android:drawable="@drawable/qs_tile_background_shape"
+ android:state_hovered="true" />
</selector>
</item>
</layer-list>
diff --git a/packages/SystemUI/res/drawable/qs_tile_focused_background.xml b/packages/SystemUI/res/drawable/qs_tile_focused_background.xml
index fd456df2c9d8..33f0d02efb2a 100644
--- a/packages/SystemUI/res/drawable/qs_tile_focused_background.xml
+++ b/packages/SystemUI/res/drawable/qs_tile_focused_background.xml
@@ -13,10 +13,14 @@
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
-<shape
- xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"
- android:shape="rectangle">
- <corners android:radius="30dp"/>
- <stroke android:width="3dp" android:color="?androidprv:attr/materialColorSecondaryFixed"/>
-</shape> \ No newline at end of file
+
+<inset xmlns:android="http://schemas.android.com/apk/res/android"
+ android:inset="-5dp">
+ <shape xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"
+ android:shape="rectangle">
+ <corners android:radius="30dp" />
+ <stroke
+ android:width="3dp"
+ android:color="?androidprv:attr/materialColorSecondaryFixed" />
+ </shape>
+</inset> \ No newline at end of file
diff --git a/packages/SystemUI/res/drawable/shelf_action_chip_container_background.xml b/packages/SystemUI/res/drawable/shelf_action_chip_container_background.xml
index bb8cece9203b..ad6c154692ec 100644
--- a/packages/SystemUI/res/drawable/shelf_action_chip_container_background.xml
+++ b/packages/SystemUI/res/drawable/shelf_action_chip_container_background.xml
@@ -14,10 +14,14 @@
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
-<shape
+<inset
xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"
- android:shape="rectangle">
- <solid android:color="?androidprv:attr/materialColorSurfaceBright"/>
- <corners android:radius="10000dp"/> <!-- fully-rounded radius -->
-</shape>
+ android:insetLeft="@dimen/overlay_action_container_minimum_edge_spacing"
+ android:insetRight="@dimen/overlay_action_container_minimum_edge_spacing">
+ <shape
+ xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"
+ android:shape="rectangle">
+ <solid android:color="?androidprv:attr/materialColorSurfaceBright"/>
+ <corners android:radius="10000dp"/> <!-- fully-rounded radius -->
+ </shape>
+</inset> \ No newline at end of file
diff --git a/packages/SystemUI/res/layout-sw600dp/biometric_prompt_constraint_layout.xml b/packages/SystemUI/res/layout-sw600dp/biometric_prompt_constraint_layout.xml
index 05f6faea464e..8b9eabc5bd93 100644
--- a/packages/SystemUI/res/layout-sw600dp/biometric_prompt_constraint_layout.xml
+++ b/packages/SystemUI/res/layout-sw600dp/biometric_prompt_constraint_layout.xml
@@ -33,8 +33,7 @@
layout="@layout/biometric_prompt_button_bar"
android:layout_width="0dp"
android:layout_height="wrap_content"
- android:layout_marginBottom="40dp"
- app:layout_constraintBottom_toBottomOf="parent"
+ app:layout_constraintBottom_toBottomOf="@id/bottomGuideline"
app:layout_constraintEnd_toEndOf="@id/panel"
app:layout_constraintStart_toStartOf="@id/panel" />
diff --git a/packages/SystemUI/res/layout/biometric_prompt_button_bar.xml b/packages/SystemUI/res/layout/biometric_prompt_button_bar.xml
index 0bbe73c36fc7..9f4ad0ec8677 100644
--- a/packages/SystemUI/res/layout/biometric_prompt_button_bar.xml
+++ b/packages/SystemUI/res/layout/biometric_prompt_button_bar.xml
@@ -23,11 +23,12 @@
<!-- Negative Button, reserved for app -->
<Button
android:id="@+id/button_negative"
- style="@style/Widget.Dialog.Button.BorderButton"
+ style="@style/AuthCredentialNegativeButtonStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginStart="24dp"
+ android:layout_marginBottom="8dp"
android:ellipsize="end"
android:maxLines="2"
android:visibility="invisible"
@@ -37,11 +38,12 @@
<!-- Cancel Button, replaces negative button when biometric is accepted -->
<Button
android:id="@+id/button_cancel"
- style="@style/Widget.Dialog.Button.BorderButton"
+ style="@style/AuthCredentialNegativeButtonStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginStart="24dp"
+ android:layout_marginBottom="8dp"
android:text="@string/cancel"
android:visibility="invisible"
app:layout_constraintBottom_toBottomOf="parent"
@@ -50,11 +52,12 @@
<!-- "Use Credential" Button, replaces if device credential is allowed -->
<Button
android:id="@+id/button_use_credential"
- style="@style/Widget.Dialog.Button.BorderButton"
+ style="@style/AuthCredentialNegativeButtonStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginStart="24dp"
+ android:layout_marginBottom="8dp"
android:visibility="invisible"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent" />
@@ -67,6 +70,7 @@
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginEnd="24dp"
+ android:layout_marginBottom="8dp"
android:ellipsize="end"
android:maxLines="2"
android:text="@string/biometric_dialog_confirm"
@@ -82,6 +86,7 @@
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginEnd="24dp"
+ android:layout_marginBottom="8dp"
android:ellipsize="end"
android:maxLines="2"
android:text="@string/biometric_dialog_try_again"
diff --git a/packages/SystemUI/res/layout/biometric_prompt_constraint_layout.xml b/packages/SystemUI/res/layout/biometric_prompt_constraint_layout.xml
index fa4d9a868fd7..9b5b59fc116f 100644
--- a/packages/SystemUI/res/layout/biometric_prompt_constraint_layout.xml
+++ b/packages/SystemUI/res/layout/biometric_prompt_constraint_layout.xml
@@ -31,8 +31,7 @@
layout="@layout/biometric_prompt_button_bar"
android:layout_width="0dp"
android:layout_height="wrap_content"
- android:layout_marginBottom="40dp"
- app:layout_constraintBottom_toBottomOf="parent"
+ app:layout_constraintBottom_toBottomOf="@id/bottomGuideline"
app:layout_constraintEnd_toEndOf="@id/panel"
app:layout_constraintStart_toStartOf="@id/panel" />
diff --git a/packages/SystemUI/res/layout/clipboard_overlay2.xml b/packages/SystemUI/res/layout/clipboard_overlay2.xml
index 521369e56652..65005f840598 100644
--- a/packages/SystemUI/res/layout/clipboard_overlay2.xml
+++ b/packages/SystemUI/res/layout/clipboard_overlay2.xml
@@ -24,6 +24,16 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:contentDescription="@string/clipboard_overlay_window_name">
+ <!-- Min edge spacing guideline off of which the preview and actions can be anchored (without
+ this we'd need to express margins as the sum of two different dimens). -->
+ <androidx.constraintlayout.widget.Guideline
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:id="@+id/min_edge_guideline"
+ app:layout_constraintGuide_begin="@dimen/overlay_action_container_minimum_edge_spacing"
+ android:orientation="vertical"/>
+ <!-- Negative horizontal margin because this container background must render beyond the thing
+ it's constrained by (the actions themselves). -->
<FrameLayout
android:id="@+id/actions_container_background"
android:visibility="gone"
@@ -31,11 +41,12 @@
android:layout_width="0dp"
android:elevation="4dp"
android:background="@drawable/shelf_action_chip_container_background"
- android:layout_marginStart="@dimen/overlay_action_container_minimum_edge_spacing"
+ android:layout_marginStart="@dimen/negative_overlay_action_container_minimum_edge_spacing"
+ android:layout_marginEnd="@dimen/negative_overlay_action_container_minimum_edge_spacing"
android:layout_marginBottom="@dimen/overlay_action_container_margin_bottom"
- app:layout_constraintStart_toStartOf="parent"
- app:layout_constraintTop_toTopOf="@+id/actions_container"
- app:layout_constraintEnd_toEndOf="@+id/actions_container"
+ app:layout_constraintStart_toStartOf="@id/min_edge_guideline"
+ app:layout_constraintTop_toTopOf="@id/actions_container"
+ app:layout_constraintEnd_toEndOf="@id/actions_container"
app:layout_constraintBottom_toBottomOf="parent"/>
<HorizontalScrollView
android:id="@+id/actions_container"
@@ -76,7 +87,7 @@
android:layout_marginBottom="@dimen/overlay_preview_container_margin"
android:elevation="7dp"
android:background="@drawable/overlay_border"
- app:layout_constraintStart_toStartOf="@id/actions_container_background"
+ app:layout_constraintStart_toStartOf="@id/min_edge_guideline"
app:layout_constraintTop_toTopOf="@id/clipboard_preview"
app:layout_constraintEnd_toEndOf="@id/clipboard_preview"
app:layout_constraintBottom_toBottomOf="@id/actions_container_background"/>
diff --git a/packages/SystemUI/res/layout/screenshot_shelf.xml b/packages/SystemUI/res/layout/screenshot_shelf.xml
index 49d3a8ec8ad8..796def369708 100644
--- a/packages/SystemUI/res/layout/screenshot_shelf.xml
+++ b/packages/SystemUI/res/layout/screenshot_shelf.xml
@@ -26,36 +26,6 @@
android:layout_height="match_parent"
android:clipChildren="false"
android:clipToPadding="false">
- <FrameLayout
- android:id="@+id/actions_container_background"
- android:visibility="gone"
- android:layout_height="wrap_content"
- android:layout_width="wrap_content"
- android:elevation="4dp"
- android:background="@drawable/shelf_action_chip_container_background"
- android:layout_marginHorizontal="@dimen/overlay_action_container_minimum_edge_spacing"
- app:layout_constraintStart_toStartOf="parent"
- app:layout_constraintBottom_toTopOf="@id/guideline"
- >
- <HorizontalScrollView
- android:id="@+id/actions_container"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginVertical="@dimen/overlay_action_container_padding_vertical"
- android:layout_marginHorizontal="@dimen/overlay_action_chip_margin_start"
- android:background="@drawable/shelf_action_container_clipping_shape"
- android:clipToOutline="true"
- android:scrollbars="none">
- <LinearLayout
- android:id="@+id/screenshot_actions"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:showDividers="middle"
- android:divider="@drawable/shelf_action_chip_divider"
- android:animateLayoutChanges="true"
- />
- </HorizontalScrollView>
- </FrameLayout>
<View
android:id="@+id/screenshot_preview_border"
android:layout_width="0dp"
@@ -101,6 +71,36 @@
android:visibility="invisible"
app:layout_constraintStart_toStartOf="@id/screenshot_preview_border"
app:layout_constraintBottom_toBottomOf="@id/screenshot_preview_border"/>
+ <!-- Action bar should be drawn on top of the thumbnail -->
+ <FrameLayout
+ android:id="@+id/actions_container_background"
+ android:visibility="gone"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:elevation="4dp"
+ android:background="@drawable/shelf_action_chip_container_background"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintBottom_toTopOf="@id/guideline"
+ >
+ <HorizontalScrollView
+ android:id="@+id/actions_container"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginVertical="@dimen/overlay_action_container_padding_vertical"
+ android:layout_marginHorizontal="@dimen/overlay_action_chip_margin_start"
+ android:background="@drawable/shelf_action_container_clipping_shape"
+ android:clipToOutline="true"
+ android:scrollbars="none">
+ <LinearLayout
+ android:id="@+id/screenshot_actions"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:showDividers="middle"
+ android:divider="@drawable/shelf_action_chip_divider"
+ android:animateLayoutChanges="true"
+ android:orientation="horizontal" />
+ </HorizontalScrollView>
+ </FrameLayout>
<ImageView
android:id="@+id/screenshot_badge"
android:layout_width="56dp"
diff --git a/packages/SystemUI/res/values/dimens.xml b/packages/SystemUI/res/values/dimens.xml
index 9d0319c2471b..02b74ce14088 100644
--- a/packages/SystemUI/res/values/dimens.xml
+++ b/packages/SystemUI/res/values/dimens.xml
@@ -449,8 +449,12 @@
<dimen name="overlay_preview_container_margin">8dp</dimen>
<dimen name="overlay_action_container_margin_horizontal">8dp</dimen>
<dimen name="overlay_action_container_margin_bottom">6dp</dimen>
- <!-- minimum distance to the left, right or bottom edges. -->
+ <!--
+ minimum distance to the left, right or bottom edges. Keep in sync with
+ negative_overlay_action_container_minimum_edge_spacing. -->
<dimen name="overlay_action_container_minimum_edge_spacing">12dp</dimen>
+ <!-- Keep in sync with overlay_action_container_minimum_edge_spacing -->
+ <dimen name="negative_overlay_action_container_minimum_edge_spacing">-12dp</dimen>
<dimen name="overlay_bg_protection_height">242dp</dimen>
<dimen name="overlay_action_container_corner_radius">20dp</dimen>
<dimen name="overlay_action_container_padding_vertical">8dp</dimen>
@@ -913,10 +917,6 @@
obvious when corner radii differ.-->
<dimen name="communal_enforced_rounded_corner_max_radius">28dp</dimen>
- <!-- Width and height used to filter widgets displayed in the communal widget picker -->
- <dimen name="communal_widget_picker_desired_width">360dp</dimen>
- <dimen name="communal_widget_picker_desired_height">240dp</dimen>
-
<!-- The width/height of the unlock icon view on keyguard. -->
<dimen name="keyguard_lock_height">42dp</dimen>
<dimen name="keyguard_lock_padding">20dp</dimen>
diff --git a/packages/SystemUI/res/values/strings.xml b/packages/SystemUI/res/values/strings.xml
index 8da8316f624b..6df48a0d25fd 100644
--- a/packages/SystemUI/res/values/strings.xml
+++ b/packages/SystemUI/res/values/strings.xml
@@ -765,7 +765,7 @@
<!-- QuickSettings: Wifi secondary label shown when the wifi is being enabled [CHAR LIMIT=NONE] -->
<string name="quick_settings_wifi_secondary_label_transient">Turning on&#8230;</string>
<!-- QuickSettings: Cast title [CHAR LIMIT=NONE] -->
- <string name="quick_settings_cast_title">Screen Cast</string>
+ <string name="quick_settings_cast_title">Cast</string>
<!-- QuickSettings: Cast detail panel, status text when casting [CHAR LIMIT=NONE] -->
<string name="quick_settings_casting">Casting</string>
<!-- QuickSettings: Cast detail panel, default device name [CHAR LIMIT=NONE] -->
diff --git a/packages/SystemUI/res/values/styles.xml b/packages/SystemUI/res/values/styles.xml
index 393a1aaec74a..b8f71c10dc89 100644
--- a/packages/SystemUI/res/values/styles.xml
+++ b/packages/SystemUI/res/values/styles.xml
@@ -375,6 +375,12 @@
<item name="android:textColor">?androidprv:attr/materialColorPrimary</item>
</style>
+ <style name="AuthCredentialNegativeButtonStyle" parent="TextAppearance.Material3.LabelLarge">
+ <item name="android:fontFamily">@*android:string/config_bodyFontFamilyMedium</item>
+ <item name="android:background">@color/transparent</item>
+ <item name="android:textColor">?androidprv:attr/materialColorPrimary</item>
+ </style>
+
<style name="DeviceManagementDialogTitle">
<item name="android:gravity">center</item>
<item name="android:textAppearance">@style/TextAppearance.Dialog.Title</item>
@@ -1255,6 +1261,7 @@
<item name="android:lineHeight">32sp</item>
<item name="android:gravity">center</item>
<item name="android:textAlignment">center</item>
+ <item name="android:hyphenationFrequency">full</item>
</style>
<style name="TextAppearance.Dialog.Body" parent="@android:style/TextAppearance.DeviceDefault.Medium">
diff --git a/packages/SystemUI/src/com/android/systemui/accessibility/WindowMagnificationController.java b/packages/SystemUI/src/com/android/systemui/accessibility/WindowMagnificationController.java
index e66261c459c7..5458ab1196d7 100644
--- a/packages/SystemUI/src/com/android/systemui/accessibility/WindowMagnificationController.java
+++ b/packages/SystemUI/src/com/android/systemui/accessibility/WindowMagnificationController.java
@@ -240,7 +240,7 @@ class WindowMagnificationController implements View.OnTouchListener, SurfaceHold
private boolean mEditSizeEnable = false;
private boolean mSettingsPanelVisibility = false;
@VisibleForTesting
- WindowMagnificationSizePrefs mWindowMagnificationSizePrefs;
+ WindowMagnificationFrameSizePrefs mWindowMagnificationFrameSizePrefs;
@Nullable
private final MirrorWindowControl mMirrorWindowControl;
@@ -270,7 +270,7 @@ class WindowMagnificationController implements View.OnTouchListener, SurfaceHold
mSysUiState = sysUiState;
mScvhSupplier = scvhSupplier;
mConfiguration = new Configuration(context.getResources().getConfiguration());
- mWindowMagnificationSizePrefs = new WindowMagnificationSizePrefs(mContext);
+ mWindowMagnificationFrameSizePrefs = new WindowMagnificationFrameSizePrefs(mContext);
final Display display = mContext.getDisplay();
mDisplayId = mContext.getDisplayId();
@@ -457,7 +457,7 @@ class WindowMagnificationController implements View.OnTouchListener, SurfaceHold
if (!enable) {
// Keep the magnifier size when exiting edit mode
- mWindowMagnificationSizePrefs.saveSizeForCurrentDensity(
+ mWindowMagnificationFrameSizePrefs.saveSizeForCurrentDensity(
new Size(mMagnificationFrame.width(), mMagnificationFrame.height()));
}
}
@@ -944,7 +944,7 @@ class WindowMagnificationController implements View.OnTouchListener, SurfaceHold
}
private void setMagnificationFrame(int width, int height, int centerX, int centerY) {
- mWindowMagnificationSizePrefs.saveSizeForCurrentDensity(new Size(width, height));
+ mWindowMagnificationFrameSizePrefs.saveSizeForCurrentDensity(new Size(width, height));
// Sets the initial frame area for the mirror and place it to the given center on the
// display.
@@ -954,11 +954,11 @@ class WindowMagnificationController implements View.OnTouchListener, SurfaceHold
}
private Size restoreMagnificationWindowFrameSizeIfPossible() {
- if (!mWindowMagnificationSizePrefs.isPreferenceSavedForCurrentDensity()) {
+ if (!mWindowMagnificationFrameSizePrefs.isPreferenceSavedForCurrentDensity()) {
return getDefaultMagnificationWindowFrameSize();
}
- return mWindowMagnificationSizePrefs.getSizeForCurrentDensity();
+ return mWindowMagnificationFrameSizePrefs.getSizeForCurrentDensity();
}
private Size getDefaultMagnificationWindowFrameSize() {
diff --git a/packages/SystemUI/src/com/android/systemui/accessibility/WindowMagnificationSizePrefs.java b/packages/SystemUI/src/com/android/systemui/accessibility/WindowMagnificationFrameSizePrefs.java
index a401f2a980c1..e83e85e1af1a 100644
--- a/packages/SystemUI/src/com/android/systemui/accessibility/WindowMagnificationSizePrefs.java
+++ b/packages/SystemUI/src/com/android/systemui/accessibility/WindowMagnificationFrameSizePrefs.java
@@ -23,14 +23,14 @@ import android.util.Size;
/**
* Class to handle SharedPreference for window magnification size.
*/
-final class WindowMagnificationSizePrefs {
+final class WindowMagnificationFrameSizePrefs {
private static final String WINDOW_MAGNIFICATION_PREFERENCES =
"window_magnification_preferences";
Context mContext;
SharedPreferences mWindowMagnificationSizePreferences;
- public WindowMagnificationSizePrefs(Context context) {
+ WindowMagnificationFrameSizePrefs(Context context) {
mContext = context;
mWindowMagnificationSizePreferences = mContext
.getSharedPreferences(WINDOW_MAGNIFICATION_PREFERENCES, Context.MODE_PRIVATE);
diff --git a/packages/SystemUI/src/com/android/systemui/accessibility/data/repository/NightDisplayRepository.kt b/packages/SystemUI/src/com/android/systemui/accessibility/data/repository/NightDisplayRepository.kt
index bf44fabc31c4..b33746c7a25f 100644
--- a/packages/SystemUI/src/com/android/systemui/accessibility/data/repository/NightDisplayRepository.kt
+++ b/packages/SystemUI/src/com/android/systemui/accessibility/data/repository/NightDisplayRepository.kt
@@ -149,12 +149,7 @@ constructor(
secureSettings
.observerFlow(userHandle.identifier, DISPLAY_AUTO_MODE_RAW_SETTING_NAME)
.onStart { emit(Unit) }
- .map {
- secureSettings.getIntForUser(
- DISPLAY_AUTO_MODE_RAW_SETTING_NAME,
- userHandle.identifier
- ) == NIGHT_DISPLAY_AUTO_MODE_RAW_NOT_SET
- }
+ .map { isNightDisplayAutoModeRawSettingNotSet(userHandle.identifier) }
}
.distinctUntilChanged()
@@ -179,12 +174,19 @@ constructor(
colorDisplayManager.nightDisplayCustomEndTime,
globalSettings.getString(IS_FORCE_AUTO_MODE_AVAILABLE_SETTING_NAME) ==
NIGHT_DISPLAY_FORCED_AUTO_MODE_AVAILABLE &&
- secureSettings.getIntForUser(DISPLAY_AUTO_MODE_RAW_SETTING_NAME, user.identifier) ==
- NIGHT_DISPLAY_AUTO_MODE_RAW_NOT_SET,
+ isNightDisplayAutoModeRawSettingNotSet(user.identifier),
locationController.isLocationEnabled,
)
}
+ private fun isNightDisplayAutoModeRawSettingNotSet(userId: Int): Boolean {
+ return secureSettings.getIntForUser(
+ DISPLAY_AUTO_MODE_RAW_SETTING_NAME,
+ NIGHT_DISPLAY_AUTO_MODE_RAW_NOT_SET,
+ userId
+ ) == NIGHT_DISPLAY_AUTO_MODE_RAW_NOT_SET
+ }
+
private companion object {
const val NIGHT_DISPLAY_AUTO_MODE_RAW_NOT_SET = -1
const val NIGHT_DISPLAY_FORCED_AUTO_MODE_AVAILABLE = "1"
diff --git a/packages/SystemUI/src/com/android/systemui/accessibility/floatingmenu/MenuAnimationController.java b/packages/SystemUI/src/com/android/systemui/accessibility/floatingmenu/MenuAnimationController.java
index 1f0459978c3c..d5e911efe570 100644
--- a/packages/SystemUI/src/com/android/systemui/accessibility/floatingmenu/MenuAnimationController.java
+++ b/packages/SystemUI/src/com/android/systemui/accessibility/floatingmenu/MenuAnimationController.java
@@ -37,7 +37,6 @@ import androidx.dynamicanimation.animation.SpringForce;
import androidx.recyclerview.widget.RecyclerView;
import com.android.internal.annotations.VisibleForTesting;
-import com.android.systemui.Flags;
import java.util.HashMap;
@@ -339,15 +338,11 @@ class MenuAnimationController {
mMenuView.updateMenuMoveToTucked(/* isMoveToTucked= */ true);
final PointF position = mMenuView.getMenuPosition();
final PointF tuckedPosition = getTuckedMenuPosition();
- if (Flags.floatingMenuAnimatedTuck()) {
- flingThenSpringMenuWith(DynamicAnimation.TRANSLATION_X,
- Math.signum(tuckedPosition.x - position.x) * ESCAPE_VELOCITY,
- FLING_FRICTION_SCALAR,
- createDefaultSpringForce(),
- tuckedPosition.x);
- } else {
- moveToPosition(tuckedPosition);
- }
+ flingThenSpringMenuWith(DynamicAnimation.TRANSLATION_X,
+ Math.signum(tuckedPosition.x - position.x) * ESCAPE_VELOCITY,
+ FLING_FRICTION_SCALAR,
+ createDefaultSpringForce(),
+ tuckedPosition.x);
// Keep the touch region let users could click extra space to pop up the menu view
// from the screen edge
@@ -359,23 +354,19 @@ class MenuAnimationController {
void moveOutEdgeAndShow() {
mMenuView.updateMenuMoveToTucked(/* isMoveToTucked= */ false);
- if (Flags.floatingMenuAnimatedTuck()) {
- PointF position = mMenuView.getMenuPosition();
- springMenuWith(DynamicAnimation.TRANSLATION_X,
- createDefaultSpringForce(),
- 0,
- position.x,
- true
- );
- springMenuWith(DynamicAnimation.TRANSLATION_Y,
- createDefaultSpringForce(),
- 0,
- position.y,
- true
- );
- } else {
- mMenuView.onPositionChanged();
- }
+ PointF position = mMenuView.getMenuPosition();
+ springMenuWith(DynamicAnimation.TRANSLATION_X,
+ createDefaultSpringForce(),
+ 0,
+ position.x,
+ true
+ );
+ springMenuWith(DynamicAnimation.TRANSLATION_Y,
+ createDefaultSpringForce(),
+ 0,
+ position.y,
+ true
+ );
mMenuView.onEdgeChangedIfNeeded();
}
diff --git a/packages/SystemUI/src/com/android/systemui/accessibility/floatingmenu/MenuView.java b/packages/SystemUI/src/com/android/systemui/accessibility/floatingmenu/MenuView.java
index be75e1035ea6..9d9e7dfb7032 100644
--- a/packages/SystemUI/src/com/android/systemui/accessibility/floatingmenu/MenuView.java
+++ b/packages/SystemUI/src/com/android/systemui/accessibility/floatingmenu/MenuView.java
@@ -321,22 +321,6 @@ class MenuView extends FrameLayout implements
if (mMoveToTuckedListener != null) {
mMoveToTuckedListener.onMoveToTuckedChanged(isMoveToTucked);
}
-
- if (!Flags.floatingMenuAnimatedTuck()) {
- if (isMoveToTucked) {
- final float halfWidth = getMenuWidth() / 2.0f;
- final boolean isOnLeftSide = mMenuAnimationController.isOnLeftSide();
- final Rect clipBounds = new Rect(
- (int) (!isOnLeftSide ? 0 : halfWidth),
- 0,
- (int) (!isOnLeftSide ? halfWidth : getMenuWidth()),
- getMenuHeight()
- );
- setClipBounds(clipBounds);
- } else {
- setClipBounds(null);
- }
- }
}
diff --git a/packages/SystemUI/src/com/android/systemui/accessibility/floatingmenu/MenuViewLayer.java b/packages/SystemUI/src/com/android/systemui/accessibility/floatingmenu/MenuViewLayer.java
index 6dce1bb22921..0c67c5093faf 100644
--- a/packages/SystemUI/src/com/android/systemui/accessibility/floatingmenu/MenuViewLayer.java
+++ b/packages/SystemUI/src/com/android/systemui/accessibility/floatingmenu/MenuViewLayer.java
@@ -322,9 +322,8 @@ class MenuViewLayer extends FrameLayout implements
}
addView(mMessageView, LayerIndex.MESSAGE_VIEW);
- if (Flags.floatingMenuAnimatedTuck()) {
- setClipChildren(true);
- }
+ setClipChildren(true);
+
setClickable(false);
setFocusable(false);
setImportantForAccessibility(IMPORTANT_FOR_ACCESSIBILITY_NO);
@@ -476,10 +475,8 @@ class MenuViewLayer extends FrameLayout implements
mMenuAnimationController.startTuckedAnimationPreview();
}
- if (Flags.floatingMenuAnimatedTuck()) {
- if (!mMenuView.isMoveToTucked()) {
- setClipBounds(null);
- }
+ if (!mMenuView.isMoveToTucked()) {
+ setClipBounds(null);
}
mMenuView.onArrivalAtPosition(false);
}
diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/AuthContainerView.java b/packages/SystemUI/src/com/android/systemui/biometrics/AuthContainerView.java
index 298c0f782b79..b75b292be597 100644
--- a/packages/SystemUI/src/com/android/systemui/biometrics/AuthContainerView.java
+++ b/packages/SystemUI/src/com/android/systemui/biometrics/AuthContainerView.java
@@ -362,7 +362,7 @@ public class AuthContainerView extends LinearLayout
mPromptSelectorInteractorProvider = promptSelectorInteractorProvider;
mPromptSelectorInteractorProvider.get().setPrompt(mConfig.mPromptInfo, mEffectiveUserId,
- biometricModalities, mConfig.mOperationId, mConfig.mOpPackageName,
+ getRequestId(), biometricModalities, mConfig.mOperationId, mConfig.mOpPackageName,
false /*onSwitchToCredential*/);
final LayoutInflater layoutInflater = LayoutInflater.from(mContext);
@@ -436,7 +436,7 @@ public class AuthContainerView extends LinearLayout
addCredentialView(true, false);
}
} else {
- mPromptSelectorInteractorProvider.get().resetPrompt();
+ mPromptSelectorInteractorProvider.get().resetPrompt(getRequestId());
}
}
@@ -884,7 +884,8 @@ public class AuthContainerView extends LinearLayout
final Runnable endActionRunnable = () -> {
setVisibility(View.INVISIBLE);
if (Flags.customBiometricPrompt() && constraintBp()) {
- mPromptSelectorInteractorProvider.get().resetPrompt();
+ // TODO(b/288175645): resetPrompt calls should be lifecycle aware
+ mPromptSelectorInteractorProvider.get().resetPrompt(getRequestId());
}
removeWindowIfAttached();
};
diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/data/repository/FingerprintPropertyRepository.kt b/packages/SystemUI/src/com/android/systemui/biometrics/data/repository/FingerprintPropertyRepository.kt
index 6b61adce3c84..ba51d02fd288 100644
--- a/packages/SystemUI/src/com/android/systemui/biometrics/data/repository/FingerprintPropertyRepository.kt
+++ b/packages/SystemUI/src/com/android/systemui/biometrics/data/repository/FingerprintPropertyRepository.kt
@@ -30,10 +30,10 @@ import com.android.systemui.biometrics.shared.model.SensorStrength
import com.android.systemui.biometrics.shared.model.toSensorStrength
import com.android.systemui.biometrics.shared.model.toSensorType
import com.android.systemui.common.coroutine.ChannelExt.trySendWithFailureLogging
+import com.android.systemui.common.coroutine.ConflatedCallbackFlow.conflatedCallbackFlow
import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.dagger.qualifiers.Application
import com.android.systemui.dagger.qualifiers.Background
-import com.android.systemui.utils.coroutines.flow.conflatedCallbackFlow
import javax.inject.Inject
import kotlinx.coroutines.CoroutineDispatcher
import kotlinx.coroutines.CoroutineScope
@@ -41,6 +41,8 @@ import kotlinx.coroutines.channels.awaitClose
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.SharingStarted
import kotlinx.coroutines.flow.StateFlow
+import kotlinx.coroutines.flow.combine
+import kotlinx.coroutines.flow.distinctUntilChanged
import kotlinx.coroutines.flow.map
import kotlinx.coroutines.flow.onStart
import kotlinx.coroutines.flow.stateIn
@@ -111,9 +113,6 @@ constructor(
initialValue = UNINITIALIZED_PROPS,
)
- override val propertiesInitialized: Flow<Boolean> =
- props.map { it != UNINITIALIZED_PROPS }.onStart { emit(props.value != UNINITIALIZED_PROPS) }
-
override val sensorId: Flow<Int> = props.map { it.sensorId }
override val strength: Flow<SensorStrength> = props.map { it.sensorStrength.toSensorStrength() }
@@ -134,9 +133,25 @@ constructor(
}
}
+ override val propertiesInitialized: Flow<Boolean> =
+ combine(
+ props
+ .map { it != UNINITIALIZED_PROPS }
+ .onStart { emit(props.value != UNINITIALIZED_PROPS) },
+ sensorId.map {}.onStart { if (props.value != UNINITIALIZED_PROPS) emit(Unit) },
+ sensorLocations
+ .map {}
+ .onStart { if (props.value != UNINITIALIZED_PROPS) emit(Unit) },
+ sensorType.map {}.onStart { if (props.value != UNINITIALIZED_PROPS) emit(Unit) },
+ strength.map {}.onStart { if (props.value != UNINITIALIZED_PROPS) emit(Unit) },
+ ) { initialized, _, _, _, _ ->
+ initialized
+ }
+ .distinctUntilChanged()
+
companion object {
private const val TAG = "FingerprintPropertyRepositoryImpl"
- val UNINITIALIZED_PROPS =
+ private val UNINITIALIZED_PROPS =
FingerprintSensorPropertiesInternal(
-2 /* sensorId */,
SensorProperties.STRENGTH_CONVENIENCE,
diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/data/repository/PromptRepository.kt b/packages/SystemUI/src/com/android/systemui/biometrics/data/repository/PromptRepository.kt
index 58b238b820c3..230b30bc548e 100644
--- a/packages/SystemUI/src/com/android/systemui/biometrics/data/repository/PromptRepository.kt
+++ b/packages/SystemUI/src/com/android/systemui/biometrics/data/repository/PromptRepository.kt
@@ -17,6 +17,7 @@
package com.android.systemui.biometrics.data.repository
import android.hardware.biometrics.PromptInfo
+import android.util.Log
import com.android.systemui.biometrics.AuthController
import com.android.systemui.biometrics.shared.model.PromptKind
import com.android.systemui.common.coroutine.ChannelExt.trySendWithFailureLogging
@@ -49,6 +50,9 @@ interface PromptRepository {
/** The user that the prompt is for. */
val userId: StateFlow<Int?>
+ /** The request that the prompt is for. */
+ val requestId: StateFlow<Long?>
+
/** The gatekeeper challenge, if one is associated with this prompt. */
val challenge: StateFlow<Long?>
@@ -69,13 +73,14 @@ interface PromptRepository {
fun setPrompt(
promptInfo: PromptInfo,
userId: Int,
+ requestId: Long,
gatekeeperChallenge: Long?,
kind: PromptKind,
opPackageName: String,
)
/** Unset the prompt info. */
- fun unsetPrompt()
+ fun unsetPrompt(requestId: Long)
}
@SysUISingleton
@@ -109,6 +114,9 @@ constructor(
private val _userId: MutableStateFlow<Int?> = MutableStateFlow(null)
override val userId = _userId.asStateFlow()
+ private val _requestId: MutableStateFlow<Long?> = MutableStateFlow(null)
+ override val requestId = _requestId.asStateFlow()
+
private val _promptKind: MutableStateFlow<PromptKind> = MutableStateFlow(PromptKind.None)
override val promptKind = _promptKind.asStateFlow()
@@ -132,23 +140,30 @@ constructor(
override fun setPrompt(
promptInfo: PromptInfo,
userId: Int,
+ requestId: Long,
gatekeeperChallenge: Long?,
kind: PromptKind,
opPackageName: String,
) {
_promptKind.value = kind
_userId.value = userId
+ _requestId.value = requestId
_challenge.value = gatekeeperChallenge
_promptInfo.value = promptInfo
_opPackageName.value = opPackageName
}
- override fun unsetPrompt() {
- _promptInfo.value = null
- _userId.value = null
- _challenge.value = null
- _promptKind.value = PromptKind.None
- _opPackageName.value = null
+ override fun unsetPrompt(requestId: Long) {
+ if (requestId == _requestId.value) {
+ _promptInfo.value = null
+ _userId.value = null
+ _requestId.value = null
+ _challenge.value = null
+ _promptKind.value = PromptKind.None
+ _opPackageName.value = null
+ } else {
+ Log.w(TAG, "Ignoring unsetPrompt - requestId mismatch")
+ }
}
companion object {
diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/domain/interactor/FingerprintPropertyInteractor.kt b/packages/SystemUI/src/com/android/systemui/biometrics/domain/interactor/FingerprintPropertyInteractor.kt
index d5b450d1e2a8..a74b0b07299c 100644
--- a/packages/SystemUI/src/com/android/systemui/biometrics/domain/interactor/FingerprintPropertyInteractor.kt
+++ b/packages/SystemUI/src/com/android/systemui/biometrics/domain/interactor/FingerprintPropertyInteractor.kt
@@ -52,7 +52,7 @@ constructor(
.map { it.isUdfps() }
.stateIn(
scope = applicationScope,
- started = SharingStarted.WhileSubscribed(),
+ started = SharingStarted.Eagerly,
initialValue = repository.sensorType.value.isUdfps(),
)
diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/domain/interactor/PromptSelectorInteractor.kt b/packages/SystemUI/src/com/android/systemui/biometrics/domain/interactor/PromptSelectorInteractor.kt
index 4ba780fcec69..dc338d07f9e7 100644
--- a/packages/SystemUI/src/com/android/systemui/biometrics/domain/interactor/PromptSelectorInteractor.kt
+++ b/packages/SystemUI/src/com/android/systemui/biometrics/domain/interactor/PromptSelectorInteractor.kt
@@ -86,6 +86,7 @@ interface PromptSelectorInteractor {
fun setPrompt(
promptInfo: PromptInfo,
effectiveUserId: Int,
+ requestId: Long,
modalities: BiometricModalities,
challenge: Long,
opPackageName: String,
@@ -93,7 +94,7 @@ interface PromptSelectorInteractor {
)
/** Unset the current authentication request. */
- fun resetPrompt()
+ fun resetPrompt(requestId: Long)
}
@SysUISingleton
@@ -161,6 +162,7 @@ constructor(
setPrompt(
promptRepository.promptInfo.value!!,
promptRepository.userId.value!!,
+ promptRepository.requestId.value!!,
modalities,
promptRepository.challenge.value!!,
promptRepository.opPackageName.value!!,
@@ -171,6 +173,7 @@ constructor(
override fun setPrompt(
promptInfo: PromptInfo,
effectiveUserId: Int,
+ requestId: Long,
modalities: BiometricModalities,
challenge: Long,
opPackageName: String,
@@ -198,13 +201,14 @@ constructor(
promptRepository.setPrompt(
promptInfo = promptInfo,
userId = effectiveUserId,
+ requestId = requestId,
gatekeeperChallenge = challenge,
kind = kind,
opPackageName = opPackageName,
)
}
- override fun resetPrompt() {
- promptRepository.unsetPrompt()
+ override fun resetPrompt(requestId: Long) {
+ promptRepository.unsetPrompt(requestId)
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/ui/binder/BiometricViewSizeBinder.kt b/packages/SystemUI/src/com/android/systemui/biometrics/ui/binder/BiometricViewSizeBinder.kt
index 13ea3f56d911..47174c006735 100644
--- a/packages/SystemUI/src/com/android/systemui/biometrics/ui/binder/BiometricViewSizeBinder.kt
+++ b/packages/SystemUI/src/com/android/systemui/biometrics/ui/binder/BiometricViewSizeBinder.kt
@@ -321,6 +321,12 @@ object BiometricViewSizeBinder {
lifecycleScope.launch {
viewModel.guidelineBounds.collect { bounds ->
+ val bottomInset =
+ windowManager.maximumWindowMetrics.windowInsets
+ .getInsets(WindowInsets.Type.navigationBars())
+ .bottom
+ mediumConstraintSet.setGuidelineEnd(R.id.bottomGuideline, bottomInset)
+
if (bounds.left >= 0) {
mediumConstraintSet.setGuidelineBegin(leftGuideline.id, bounds.left)
smallConstraintSet.setGuidelineBegin(leftGuideline.id, bounds.left)
diff --git a/packages/SystemUI/src/com/android/systemui/bluetooth/BroadcastDialogDelegate.java b/packages/SystemUI/src/com/android/systemui/bluetooth/BroadcastDialogDelegate.java
index 207f7dbb5816..f320057c0763 100644
--- a/packages/SystemUI/src/com/android/systemui/bluetooth/BroadcastDialogDelegate.java
+++ b/packages/SystemUI/src/com/android/systemui/bluetooth/BroadcastDialogDelegate.java
@@ -221,7 +221,8 @@ public class BroadcastDialogDelegate implements SystemUIDialog.Delegate {
(view) -> {
// TODO: b/321969740 - Take the userHandle as a parameter and pass it through.
// The package name is not sufficient to unambiguously identify an app.
- mMediaOutputDialogManager.createAndShow(mOutputPackageName, true, null, null);
+ mMediaOutputDialogManager.createAndShow(
+ mOutputPackageName, true, null, null, null);
dialog.dismiss();
});
cancelBtn.setOnClickListener((view) -> {
diff --git a/packages/SystemUI/src/com/android/systemui/communal/ui/viewmodel/CommunalEditModeViewModel.kt b/packages/SystemUI/src/com/android/systemui/communal/ui/viewmodel/CommunalEditModeViewModel.kt
index c0dc313e14f7..650852ce5876 100644
--- a/packages/SystemUI/src/com/android/systemui/communal/ui/viewmodel/CommunalEditModeViewModel.kt
+++ b/packages/SystemUI/src/com/android/systemui/communal/ui/viewmodel/CommunalEditModeViewModel.kt
@@ -35,7 +35,6 @@ import com.android.systemui.log.core.Logger
import com.android.systemui.log.dagger.CommunalLog
import com.android.systemui.media.controls.ui.view.MediaHost
import com.android.systemui.media.dagger.MediaModule
-import com.android.systemui.res.R
import javax.inject.Inject
import javax.inject.Named
import kotlinx.coroutines.CoroutineDispatcher
@@ -138,14 +137,6 @@ constructor(
return Intent(Intent.ACTION_PICK).apply {
setPackage(packageName)
putExtra(
- EXTRA_DESIRED_WIDGET_WIDTH,
- resources.getDimensionPixelSize(R.dimen.communal_widget_picker_desired_width)
- )
- putExtra(
- EXTRA_DESIRED_WIDGET_HEIGHT,
- resources.getDimensionPixelSize(R.dimen.communal_widget_picker_desired_height)
- )
- putExtra(
AppWidgetManager.EXTRA_CATEGORY_FILTER,
communalSettingsInteractor.communalWidgetCategories.value
)
@@ -170,8 +161,6 @@ constructor(
companion object {
private const val TAG = "CommunalEditModeViewModel"
- private const val EXTRA_DESIRED_WIDGET_WIDTH = "desired_widget_width"
- private const val EXTRA_DESIRED_WIDGET_HEIGHT = "desired_widget_height"
private const val EXTRA_UI_SURFACE_KEY = "ui_surface"
private const val EXTRA_UI_SURFACE_VALUE = "widgets_hub"
const val EXTRA_ADDED_APP_WIDGETS_KEY = "added_app_widgets"
diff --git a/packages/SystemUI/src/com/android/systemui/dagger/SystemUIModule.java b/packages/SystemUI/src/com/android/systemui/dagger/SystemUIModule.java
index 3462164c421b..93f37937b7ce 100644
--- a/packages/SystemUI/src/com/android/systemui/dagger/SystemUIModule.java
+++ b/packages/SystemUI/src/com/android/systemui/dagger/SystemUIModule.java
@@ -69,6 +69,7 @@ import com.android.systemui.flags.FlagsModule;
import com.android.systemui.inputmethod.InputMethodModule;
import com.android.systemui.keyboard.KeyboardModule;
import com.android.systemui.keyevent.data.repository.KeyEventRepositoryModule;
+import com.android.systemui.keyguard.ui.composable.LockscreenContent;
import com.android.systemui.keyguard.ui.view.layout.blueprints.KeyguardBlueprintModule;
import com.android.systemui.keyguard.ui.view.layout.sections.KeyguardSectionsModule;
import com.android.systemui.log.dagger.LogModule;
@@ -364,6 +365,9 @@ public abstract class SystemUIModule {
@BindsOptionalOf
abstract FingerprintReEnrollNotification optionalFingerprintReEnrollNotification();
+ @BindsOptionalOf
+ abstract LockscreenContent optionalLockscreenContent();
+
@SysUISingleton
@Binds
abstract SystemClock bindSystemClock(SystemClockImpl systemClock);
diff --git a/packages/SystemUI/src/com/android/systemui/deviceentry/domain/interactor/DeviceEntryFaceAuthInteractor.kt b/packages/SystemUI/src/com/android/systemui/deviceentry/domain/interactor/DeviceEntryFaceAuthInteractor.kt
index a32b2aae817a..6ca8eb9449d0 100644
--- a/packages/SystemUI/src/com/android/systemui/deviceentry/domain/interactor/DeviceEntryFaceAuthInteractor.kt
+++ b/packages/SystemUI/src/com/android/systemui/deviceentry/domain/interactor/DeviceEntryFaceAuthInteractor.kt
@@ -36,6 +36,9 @@ interface DeviceEntryFaceAuthInteractor {
val authenticated: Flow<Boolean>
+ /** Whether bypass is enabled. If enabled, face unlock dismisses the lock screen. */
+ val isBypassEnabled: Flow<Boolean>
+
/** Can face auth be run right now */
fun canFaceAuthRun(): Boolean
diff --git a/packages/SystemUI/src/com/android/systemui/deviceentry/domain/interactor/DeviceEntryUdfpsInteractor.kt b/packages/SystemUI/src/com/android/systemui/deviceentry/domain/interactor/DeviceEntryUdfpsInteractor.kt
index 80b52ed0e055..6c6d730819f3 100644
--- a/packages/SystemUI/src/com/android/systemui/deviceentry/domain/interactor/DeviceEntryUdfpsInteractor.kt
+++ b/packages/SystemUI/src/com/android/systemui/deviceentry/domain/interactor/DeviceEntryUdfpsInteractor.kt
@@ -17,6 +17,7 @@
package com.android.systemui.deviceentry.domain.interactor
import com.android.systemui.biometrics.domain.interactor.FingerprintPropertyInteractor
+import com.android.systemui.biometrics.shared.model.SensorLocation
import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.keyguard.data.repository.BiometricSettingsRepository
import com.android.systemui.keyguard.data.repository.DeviceEntryFingerprintAuthRepository
@@ -58,4 +59,17 @@ constructor(
flowOf(false)
}
}
+
+ /**
+ * Location of the under-display fingerprint sensor on the display. Null if the device does not
+ * support UDFPS.
+ */
+ val udfpsLocation: Flow<SensorLocation?> =
+ isUdfpsSupported.flatMapLatest {
+ if (it) {
+ fingerprintPropertyInteractor.sensorLocation
+ } else {
+ flowOf(null)
+ }
+ }
}
diff --git a/packages/SystemUI/src/com/android/systemui/deviceentry/domain/interactor/NoopDeviceEntryFaceAuthInteractor.kt b/packages/SystemUI/src/com/android/systemui/deviceentry/domain/interactor/NoopDeviceEntryFaceAuthInteractor.kt
index 6629f6e2af31..9486798c4dc7 100644
--- a/packages/SystemUI/src/com/android/systemui/deviceentry/domain/interactor/NoopDeviceEntryFaceAuthInteractor.kt
+++ b/packages/SystemUI/src/com/android/systemui/deviceentry/domain/interactor/NoopDeviceEntryFaceAuthInteractor.kt
@@ -22,6 +22,7 @@ import com.android.systemui.deviceentry.shared.model.FaceDetectionStatus
import javax.inject.Inject
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.emptyFlow
+import kotlinx.coroutines.flow.flowOf
/**
* Implementation of the interactor that noops all face auth operations.
@@ -35,6 +36,7 @@ class NoopDeviceEntryFaceAuthInteractor @Inject constructor() : DeviceEntryFaceA
override val detectionStatus: Flow<FaceDetectionStatus> = emptyFlow()
override val lockedOut: Flow<Boolean> = emptyFlow()
override val authenticated: Flow<Boolean> = emptyFlow()
+ override val isBypassEnabled: Flow<Boolean> = flowOf(false)
override fun canFaceAuthRun(): Boolean = false
diff --git a/packages/SystemUI/src/com/android/systemui/deviceentry/domain/interactor/SystemUIDeviceEntryFaceAuthInteractor.kt b/packages/SystemUI/src/com/android/systemui/deviceentry/domain/interactor/SystemUIDeviceEntryFaceAuthInteractor.kt
index 669cd94c1f21..87f3f3cf3a24 100644
--- a/packages/SystemUI/src/com/android/systemui/deviceentry/domain/interactor/SystemUIDeviceEntryFaceAuthInteractor.kt
+++ b/packages/SystemUI/src/com/android/systemui/deviceentry/domain/interactor/SystemUIDeviceEntryFaceAuthInteractor.kt
@@ -286,6 +286,7 @@ constructor(
override val detectionStatus = repository.detectionStatus
override val lockedOut: Flow<Boolean> = repository.isLockedOut
override val authenticated: Flow<Boolean> = repository.isAuthenticated
+ override val isBypassEnabled: Flow<Boolean> = repository.isBypassEnabled
private fun runFaceAuth(uiEvent: FaceAuthUiEvent, fallbackToDetect: Boolean) {
if (repository.isLockedOut.value) {
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardIndication.java b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardIndication.java
index ee3706a3ba62..a0b25b930d15 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardIndication.java
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardIndication.java
@@ -32,6 +32,8 @@ import android.view.View;
public class KeyguardIndication {
@Nullable
private final CharSequence mMessage;
+ @Nullable
+ private final boolean mForceAccessibilityLiveRegionAssertive;
@NonNull
private final ColorStateList mTextColor;
@Nullable
@@ -49,13 +51,15 @@ public class KeyguardIndication {
Drawable icon,
View.OnClickListener onClickListener,
Drawable background,
- Long minVisibilityMillis) {
+ Long minVisibilityMillis,
+ Boolean foceAssertive) {
mMessage = message;
mTextColor = textColor;
mIcon = icon;
mOnClickListener = onClickListener;
mBackground = background;
mMinVisibilityMillis = minVisibilityMillis;
+ mForceAccessibilityLiveRegionAssertive = foceAssertive;
}
/**
@@ -101,6 +105,15 @@ public class KeyguardIndication {
return mMinVisibilityMillis;
}
+
+ /**
+ * Whether to force the accessibility live region to be assertive.
+ */
+ public boolean getForceAssertiveAccessibilityLiveRegion() {
+ return mForceAccessibilityLiveRegionAssertive;
+ }
+
+
@Override
public String toString() {
String str = "KeyguardIndication{";
@@ -109,6 +122,7 @@ public class KeyguardIndication {
if (mOnClickListener != null) str += " mOnClickListener=" + mOnClickListener;
if (mBackground != null) str += " mBackground=" + mBackground;
if (mMinVisibilityMillis != null) str += " mMinVisibilityMillis=" + mMinVisibilityMillis;
+ if (mForceAccessibilityLiveRegionAssertive) str += "mForceAccessibilityLiveRegionAssertive";
str += "}";
return str;
}
@@ -123,6 +137,7 @@ public class KeyguardIndication {
private ColorStateList mTextColor;
private Drawable mBackground;
private Long mMinVisibilityMillis;
+ private boolean mForceAccessibilityLiveRegionAssertive;
public Builder() { }
@@ -178,6 +193,14 @@ public class KeyguardIndication {
}
/**
+ * Optional. Can force the accessibility live region to be assertive for this message.
+ */
+ public Builder setForceAccessibilityLiveRegionAssertive() {
+ this.mForceAccessibilityLiveRegionAssertive = true;
+ return this;
+ }
+
+ /**
* Build the KeyguardIndication.
*/
public KeyguardIndication build() {
@@ -190,7 +213,7 @@ public class KeyguardIndication {
return new KeyguardIndication(
mMessage, mTextColor, mIcon, mOnClickListener, mBackground,
- mMinVisibilityMillis);
+ mMinVisibilityMillis, mForceAccessibilityLiveRegionAssertive);
}
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardService.java b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardService.java
index 674c128a580e..f9adc473b119 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardService.java
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardService.java
@@ -84,20 +84,25 @@ import com.android.systemui.keyguard.ui.viewmodel.KeyguardSurfaceBehindViewModel
import com.android.systemui.keyguard.ui.viewmodel.WindowManagerLockscreenVisibilityViewModel;
import com.android.systemui.power.domain.interactor.PowerInteractor;
import com.android.systemui.power.shared.model.ScreenPowerState;
+import com.android.systemui.scene.domain.interactor.SceneInteractor;
+import com.android.systemui.scene.shared.flag.SceneContainerFlag;
+import com.android.systemui.scene.shared.model.Scenes;
import com.android.systemui.settings.DisplayTracker;
import com.android.wm.shell.shared.CounterRotator;
import com.android.wm.shell.shared.ShellTransitions;
import com.android.wm.shell.shared.TransitionUtil;
import com.android.wm.shell.transition.Transitions;
+import dagger.Lazy;
+
+import kotlinx.coroutines.CoroutineScope;
+
import java.util.ArrayList;
import java.util.Map;
import java.util.WeakHashMap;
import javax.inject.Inject;
-import kotlinx.coroutines.CoroutineScope;
-
public class KeyguardService extends Service {
static final String TAG = "KeyguardService";
static final String PERMISSION = android.Manifest.permission.CONTROL_KEYGUARD;
@@ -109,6 +114,7 @@ public class KeyguardService extends Service {
private final ShellTransitions mShellTransitions;
private final DisplayTracker mDisplayTracker;
private final PowerInteractor mPowerInteractor;
+ private final Lazy<SceneInteractor> mSceneInteractorLazy;
private static RemoteAnimationTarget[] wrap(TransitionInfo info, boolean wallpapers,
SurfaceControl.Transaction t, ArrayMap<SurfaceControl, SurfaceControl> leashMap,
@@ -316,7 +322,8 @@ public class KeyguardService extends Service {
@Application CoroutineScope scope,
FeatureFlags featureFlags,
PowerInteractor powerInteractor,
- WindowManagerOcclusionManager windowManagerOcclusionManager) {
+ WindowManagerOcclusionManager windowManagerOcclusionManager,
+ Lazy<SceneInteractor> sceneInteractorLazy) {
super();
mKeyguardViewMediator = keyguardViewMediator;
mKeyguardLifecyclesDispatcher = keyguardLifecyclesDispatcher;
@@ -325,6 +332,7 @@ public class KeyguardService extends Service {
mDisplayTracker = displayTracker;
mFlags = featureFlags;
mPowerInteractor = powerInteractor;
+ mSceneInteractorLazy = sceneInteractorLazy;
if (KeyguardWmStateRefactor.isEnabled()) {
WindowManagerLockscreenVisibilityViewBinder.bind(
@@ -601,6 +609,10 @@ public class KeyguardService extends Service {
trace("showDismissibleKeyguard");
checkPermission();
mKeyguardViewMediator.showDismissibleKeyguard();
+ if (SceneContainerFlag.isEnabled()) {
+ mSceneInteractorLazy.get().changeScene(
+ Scenes.Lockscreen, "KeyguardService.showDismissibleKeyguard");
+ }
}
@Override // Binder interface
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/data/repository/KeyguardSmartspaceRepository.kt b/packages/SystemUI/src/com/android/systemui/keyguard/data/repository/KeyguardSmartspaceRepository.kt
index 956125ce372f..a1e4af5d5d20 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/data/repository/KeyguardSmartspaceRepository.kt
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/data/repository/KeyguardSmartspaceRepository.kt
@@ -51,10 +51,6 @@ constructor(
) : KeyguardSmartspaceRepository {
private val _bcSmartspaceVisibility: MutableStateFlow<Int> = MutableStateFlow(View.GONE)
override val bcSmartspaceVisibility: StateFlow<Int> = _bcSmartspaceVisibility.asStateFlow()
- val defaultValue =
- context.resources.getBoolean(
- com.android.internal.R.bool.config_lockscreenWeatherEnabledByDefault
- )
override val isWeatherEnabled: StateFlow<Boolean> =
secureSettings
.observerFlow(
@@ -76,7 +72,7 @@ constructor(
private fun getLockscreenWeatherEnabled(): Boolean {
return secureSettings.getIntForUser(
Settings.Secure.LOCK_SCREEN_WEATHER_ENABLED,
- if (defaultValue) 1 else 0,
+ 1,
userTracker.userId
) == 1
}
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/data/repository/KeyguardTransitionRepository.kt b/packages/SystemUI/src/com/android/systemui/keyguard/data/repository/KeyguardTransitionRepository.kt
index 7655d7a89dc3..f488d3b67fc7 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/data/repository/KeyguardTransitionRepository.kt
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/data/repository/KeyguardTransitionRepository.kt
@@ -34,6 +34,7 @@ import java.util.UUID
import javax.inject.Inject
import kotlinx.coroutines.CoroutineDispatcher
import kotlinx.coroutines.channels.BufferOverflow
+import kotlinx.coroutines.delay
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.MutableSharedFlow
import kotlinx.coroutines.flow.MutableStateFlow
@@ -42,6 +43,7 @@ import kotlinx.coroutines.flow.asSharedFlow
import kotlinx.coroutines.flow.asStateFlow
import kotlinx.coroutines.flow.distinctUntilChanged
import kotlinx.coroutines.flow.filter
+import kotlinx.coroutines.sync.Mutex
/**
* The source of truth for all keyguard transitions.
@@ -129,6 +131,7 @@ constructor(
private var lastStep: TransitionStep = TransitionStep()
private var lastAnimator: ValueAnimator? = null
+ private val _currentTransitionMutex = Mutex()
private val _currentTransitionInfo: MutableStateFlow<TransitionInfo> =
MutableStateFlow(
TransitionInfo(
@@ -146,6 +149,9 @@ constructor(
*/
private var updateTransitionId: UUID? = null
+ // Only used in a test environment
+ var forceDelayForRaceConditionTest = false
+
init {
// Start with a FINISHED transition in OFF. KeyguardBootInteractor will transition from OFF
// to either GONE or LOCKSCREEN once we're booted up and can determine which state we should
@@ -162,9 +168,21 @@ constructor(
override suspend fun startTransition(info: TransitionInfo): UUID? {
_currentTransitionInfo.value = info
+ Log.d(TAG, "(Internal) Setting current transition info: $info")
+
+ // There is no fairness guarantee with 'withContext', which means that transitions could
+ // be processed out of order. Use a Mutex to guarantee ordering.
+ _currentTransitionMutex.lock()
+
+ // Only used in a test environment
+ if (forceDelayForRaceConditionTest) {
+ delay(50L)
+ }
// Animators must be started on the main thread.
return withContext("$TAG#startTransition", mainDispatcher) {
+ _currentTransitionMutex.unlock()
+
if (lastStep.from == info.from && lastStep.to == info.to) {
Log.i(TAG, "Duplicate call to start the transition, rejecting: $info")
return@withContext null
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/KeyguardBlueprintInteractor.kt b/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/KeyguardBlueprintInteractor.kt
index b1ef76eba481..7cee258dc39f 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/KeyguardBlueprintInteractor.kt
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/KeyguardBlueprintInteractor.kt
@@ -20,7 +20,6 @@
package com.android.systemui.keyguard.domain.interactor
import android.content.Context
-import android.util.Log
import com.android.systemui.biometrics.domain.interactor.FingerprintPropertyInteractor
import com.android.systemui.common.ui.domain.interactor.ConfigurationInteractor
import com.android.systemui.dagger.SysUISingleton
@@ -43,7 +42,6 @@ import kotlinx.coroutines.flow.collect
import kotlinx.coroutines.flow.filter
import kotlinx.coroutines.flow.map
import kotlinx.coroutines.flow.merge
-import kotlinx.coroutines.flow.onEach
import kotlinx.coroutines.launch
@SysUISingleton
@@ -80,15 +78,7 @@ constructor(
private val refreshEvents: Flow<Unit> =
merge(
configurationInteractor.onAnyConfigurationChange,
- fingerprintPropertyInteractor.propertiesInitialized
- .filter { it }
- .map { Unit }
- .onEach {
- Log.d(
- "KeyguardBlueprintInteractor",
- "triggering refreshEvent from fpPropertiesInitialized"
- )
- },
+ fingerprintPropertyInteractor.propertiesInitialized.filter { it }.map {},
)
init {
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/KeyguardTransitionAuditLogger.kt b/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/KeyguardTransitionAuditLogger.kt
index 75c4d6f6fea6..cf6942e2f245 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/KeyguardTransitionAuditLogger.kt
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/KeyguardTransitionAuditLogger.kt
@@ -56,12 +56,6 @@ constructor(
}
scope.launch {
- sharedNotificationContainerViewModel
- .getMaxNotifications { height, useExtraShelfSpace -> height.toInt() }
- .collect { logger.log(TAG, VERBOSE, "Notif: max height in px", it) }
- }
-
- scope.launch {
sharedNotificationContainerViewModel.isOnLockscreen.collect {
logger.log(TAG, VERBOSE, "Notif: isOnLockscreen", it)
}
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/TransitionInteractor.kt b/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/TransitionInteractor.kt
index b2a24ca85b07..323ceef06a97 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/TransitionInteractor.kt
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/TransitionInteractor.kt
@@ -229,6 +229,7 @@ sealed class TransitionInteractor(
startTransitionTo(
toState = KeyguardState.OCCLUDED,
modeOnCanceled = TransitionModeOnCanceled.RESET,
+ ownerReason = "keyguardInteractor.onCameraLaunchDetected",
)
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/WindowManagerLockscreenVisibilityInteractor.kt b/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/WindowManagerLockscreenVisibilityInteractor.kt
index 1e2db7c36432..350527a85e18 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/WindowManagerLockscreenVisibilityInteractor.kt
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/WindowManagerLockscreenVisibilityInteractor.kt
@@ -14,20 +14,21 @@
* limitations under the License.
*/
+@file:OptIn(ExperimentalCoroutinesApi::class)
+
package com.android.systemui.keyguard.domain.interactor
-import com.android.compose.animation.scene.ObservableTransitionState
import com.android.systemui.dagger.SysUISingleton
+import com.android.systemui.deviceentry.domain.interactor.DeviceEntryInteractor
import com.android.systemui.keyguard.shared.model.BiometricUnlockMode
-import com.android.systemui.keyguard.shared.model.Edge
import com.android.systemui.keyguard.shared.model.KeyguardState
import com.android.systemui.keyguard.shared.model.TransitionState
import com.android.systemui.scene.domain.interactor.SceneInteractor
import com.android.systemui.scene.shared.flag.SceneContainerFlag
import com.android.systemui.scene.shared.model.Scenes
import com.android.systemui.statusbar.notification.domain.interactor.NotificationLaunchAnimationInteractor
-import com.android.systemui.util.kotlin.pairwise
import com.android.systemui.util.kotlin.sample
+import dagger.Lazy
import javax.inject.Inject
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.flow.Flow
@@ -48,7 +49,8 @@ constructor(
fromBouncerInteractor: FromPrimaryBouncerTransitionInteractor,
fromAlternateBouncerInteractor: FromAlternateBouncerTransitionInteractor,
notificationLaunchAnimationInteractor: NotificationLaunchAnimationInteractor,
- sceneInteractor: SceneInteractor,
+ sceneInteractor: Lazy<SceneInteractor>,
+ deviceEntryInteractor: Lazy<DeviceEntryInteractor>,
) {
private val defaultSurfaceBehindVisibility =
transitionInteractor.finishedKeyguardState.map(::isSurfaceVisible)
@@ -112,7 +114,7 @@ constructor(
val usingKeyguardGoingAwayAnimation: Flow<Boolean> =
if (SceneContainerFlag.isEnabled) {
combine(
- sceneInteractor.transitionState,
+ sceneInteractor.get().transitionState,
surfaceBehindInteractor.isAnimatingSurface,
notificationLaunchAnimationInteractor.isLaunchAnimationRunning,
) { transition, isAnimatingSurface, isLaunchAnimationRunning ->
@@ -156,19 +158,7 @@ constructor(
*/
val lockscreenVisibility: Flow<Boolean> =
if (SceneContainerFlag.isEnabled) {
- sceneInteractor.transitionState
- .pairwise(ObservableTransitionState.Idle(Scenes.Lockscreen))
- .map { (prevTransitionState, transitionState) ->
- val isReturningToGoneAfterCancellation =
- prevTransitionState.isTransitioning(from = Scenes.Gone) &&
- transitionState.isTransitioning(to = Scenes.Gone)
- val isNotOnGone =
- !transitionState.isTransitioning(from = Scenes.Gone) &&
- !transitionState.isIdle(Scenes.Gone)
-
- isNotOnGone && !isReturningToGoneAfterCancellation
- }
- .distinctUntilChanged()
+ deviceEntryInteractor.get().isDeviceEntered.map { !it }
} else {
transitionInteractor.currentKeyguardState
.sample(transitionInteractor.startedStepWithPrecedingStep, ::Pair)
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/AlternateBouncerViewBinder.kt b/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/AlternateBouncerViewBinder.kt
index 18022a98c69a..6550937d2db0 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/AlternateBouncerViewBinder.kt
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/AlternateBouncerViewBinder.kt
@@ -188,23 +188,30 @@ constructor(
view.repeatWhenAttached { alternateBouncerViewContainer ->
repeatOnLifecycle(Lifecycle.State.STARTED) {
launch("$TAG#viewModel.registerForDismissGestures") {
- viewModel.registerForDismissGestures.collect { registerForDismissGestures ->
- if (registerForDismissGestures) {
- swipeUpAnywhereGestureHandler.addOnGestureDetectedCallback(swipeTag) { _
- ->
- alternateBouncerDependencies.powerInteractor.onUserTouch()
- viewModel.showPrimaryBouncer()
- }
- tapGestureDetector.addOnGestureDetectedCallback(tapTag) { _ ->
- alternateBouncerDependencies.powerInteractor.onUserTouch()
- viewModel.showPrimaryBouncer()
+ viewModel.registerForDismissGestures.collect { registerForDismissGestures ->
+ if (registerForDismissGestures) {
+ swipeUpAnywhereGestureHandler.addOnGestureDetectedCallback(
+ swipeTag
+ ) { _ ->
+ alternateBouncerDependencies.powerInteractor.onUserTouch()
+ viewModel.showPrimaryBouncer()
+ }
+ tapGestureDetector.addOnGestureDetectedCallback(tapTag) { _ ->
+ alternateBouncerDependencies.powerInteractor.onUserTouch()
+ viewModel.showPrimaryBouncer()
+ }
+ } else {
+ swipeUpAnywhereGestureHandler.removeOnGestureDetectedCallback(
+ swipeTag
+ )
+ tapGestureDetector.removeOnGestureDetectedCallback(tapTag)
}
- } else {
- swipeUpAnywhereGestureHandler.removeOnGestureDetectedCallback(swipeTag)
- tapGestureDetector.removeOnGestureDetectedCallback(tapTag)
}
}
- }
+ .invokeOnCompletion {
+ swipeUpAnywhereGestureHandler.removeOnGestureDetectedCallback(swipeTag)
+ tapGestureDetector.removeOnGestureDetectedCallback(tapTag)
+ }
launch("$TAG#viewModel.scrimAlpha") {
viewModel.scrimAlpha.collect { scrim.viewAlpha = it }
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardClockViewBinder.kt b/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardClockViewBinder.kt
index c846cbe76770..f2821a0f49d2 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardClockViewBinder.kt
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardClockViewBinder.kt
@@ -37,7 +37,6 @@ import com.android.systemui.keyguard.ui.viewmodel.KeyguardRootViewModel
import com.android.systemui.lifecycle.repeatWhenAttached
import com.android.systemui.plugins.clocks.AodClockBurnInModel
import com.android.systemui.plugins.clocks.ClockController
-import kotlinx.coroutines.flow.combine
import kotlinx.coroutines.launch
object KeyguardClockViewBinder {
@@ -113,24 +112,17 @@ object KeyguardClockViewBinder {
launch {
if (!MigrateClocksToBlueprint.isEnabled) return@launch
- combine(
- rootViewModel.translationX,
- rootViewModel.translationY,
- rootViewModel.scale,
- ::Triple
- )
- .collect { (translationX, translationY, scale) ->
- viewModel.currentClock.value
- ?.largeClock
- ?.layout
- ?.applyAodBurnIn(
- AodClockBurnInModel(
- translationX = translationX.value!!,
- translationY = translationY,
- scale = scale.scale
- )
+ rootViewModel.burnInModel.collect { burnInModel ->
+ viewModel.currentClock.value?.let {
+ it.largeClock.layout.applyAodBurnIn(
+ AodClockBurnInModel(
+ translationX = burnInModel.translationX.toFloat(),
+ translationY = burnInModel.translationY.toFloat(),
+ scale = burnInModel.scale
)
+ )
}
+ }
}
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/ui/preview/KeyguardPreviewRenderer.kt b/packages/SystemUI/src/com/android/systemui/keyguard/ui/preview/KeyguardPreviewRenderer.kt
index bda5be4f6533..fb1853f13ce9 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/ui/preview/KeyguardPreviewRenderer.kt
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/ui/preview/KeyguardPreviewRenderer.kt
@@ -631,7 +631,7 @@ constructor(
// color will need to use wallpaper's extracted color and consider if the
// wallpaper's color is dark or light.
val style = themeStyle ?: fetchThemeStyleFromSetting().also { themeStyle = it }
- val wallpaperColorScheme = ColorScheme(colors, darkTheme = false, style)
+ val wallpaperColorScheme = ColorScheme(colors, false, style)
val lightClockColor = wallpaperColorScheme.accent1.s100
val darkClockColor = wallpaperColorScheme.accent2.s600
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/ui/view/layout/sections/DefaultDeviceEntrySection.kt b/packages/SystemUI/src/com/android/systemui/keyguard/ui/view/layout/sections/DefaultDeviceEntrySection.kt
index 29041d1665c3..0b8376af811c 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/ui/view/layout/sections/DefaultDeviceEntrySection.kt
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/ui/view/layout/sections/DefaultDeviceEntrySection.kt
@@ -21,6 +21,7 @@ import android.content.Context
import android.graphics.Point
import android.graphics.Rect
import android.util.DisplayMetrics
+import android.util.Log
import android.view.View
import android.view.WindowManager
import androidx.annotation.VisibleForTesting
@@ -116,6 +117,10 @@ constructor(
override fun applyConstraints(constraintSet: ConstraintSet) {
val isUdfpsSupported =
if (DeviceEntryUdfpsRefactor.isEnabled) {
+ Log.d(
+ "DefaultDeviceEntrySection",
+ "isUdfpsSupported=${deviceEntryIconViewModel.get().isUdfpsSupported.value}"
+ )
deviceEntryIconViewModel.get().isUdfpsSupported.value
} else {
authController.isUdfpsSupported
@@ -138,8 +143,24 @@ constructor(
val iconRadiusPx = (defaultDensity * 36).toInt()
if (isUdfpsSupported) {
- authController.udfpsLocation?.let { udfpsLocation ->
- centerIcon(udfpsLocation, authController.udfpsRadius, constraintSet)
+ if (DeviceEntryUdfpsRefactor.isEnabled) {
+ deviceEntryIconViewModel.get().udfpsLocation.value?.let { udfpsLocation ->
+ Log.d(
+ "DeviceEntrySection",
+ "udfpsLocation=$udfpsLocation" +
+ " unusedAuthController=${authController.udfpsLocation}"
+ )
+ centerIcon(
+ Point(udfpsLocation.centerX.toInt(), udfpsLocation.centerY.toInt()),
+ udfpsLocation.radius,
+ constraintSet
+ )
+ }
+ } else {
+ authController.udfpsLocation?.let { udfpsLocation ->
+ Log.d("DeviceEntrySection", "udfpsLocation=$udfpsLocation")
+ centerIcon(udfpsLocation, authController.udfpsRadius, constraintSet)
+ }
}
} else {
centerIcon(
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/DeviceEntryIconViewModel.kt b/packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/DeviceEntryIconViewModel.kt
index ae83c9e720a3..fa43ec2cbc06 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/DeviceEntryIconViewModel.kt
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/DeviceEntryIconViewModel.kt
@@ -20,6 +20,7 @@ import android.animation.FloatEvaluator
import android.animation.IntEvaluator
import com.android.keyguard.KeyguardViewController
import com.android.systemui.accessibility.domain.interactor.AccessibilityInteractor
+import com.android.systemui.biometrics.shared.model.SensorLocation
import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.dagger.qualifiers.Application
import com.android.systemui.deviceentry.domain.interactor.DeviceEntryInteractor
@@ -73,6 +74,12 @@ constructor(
@Application private val scope: CoroutineScope,
) {
val isUdfpsSupported: StateFlow<Boolean> = deviceEntryUdfpsInteractor.isUdfpsSupported
+ val udfpsLocation: StateFlow<SensorLocation?> =
+ deviceEntryUdfpsInteractor.udfpsLocation.stateIn(
+ scope = scope,
+ started = SharingStarted.Eagerly,
+ initialValue = null,
+ )
private val intEvaluator = IntEvaluator()
private val floatEvaluator = FloatEvaluator()
private val showingAlternateBouncer: Flow<Boolean> =
@@ -200,19 +207,24 @@ constructor(
.distinctUntilChanged()
private val isUnlocked: Flow<Boolean> =
- keyguardInteractor.isKeyguardDismissible.flatMapLatest { isUnlocked ->
- if (!isUnlocked) {
- flowOf(false)
+ if (SceneContainerFlag.isEnabled) {
+ deviceEntryInteractor.isUnlocked
} else {
- flow {
- // delay in case device ends up transitioning away from the lock screen;
- // we don't want to animate to the unlocked icon and just let the
- // icon fade with the transition to GONE
- delay(UNLOCKED_DELAY_MS)
- emit(true)
+ keyguardInteractor.isKeyguardDismissible
+ }
+ .flatMapLatest { isUnlocked ->
+ if (!isUnlocked) {
+ flowOf(false)
+ } else {
+ flow {
+ // delay in case device ends up transitioning away from the lock screen;
+ // we don't want to animate to the unlocked icon and just let the
+ // icon fade with the transition to GONE
+ delay(UNLOCKED_DELAY_MS)
+ emit(true)
+ }
}
}
- }
val iconType: Flow<DeviceEntryIconView.IconType> =
combine(
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/KeyguardRootViewModel.kt b/packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/KeyguardRootViewModel.kt
index f405b9d5a07c..f8a9310e091f 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/KeyguardRootViewModel.kt
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/KeyguardRootViewModel.kt
@@ -58,6 +58,7 @@ import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.Job
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.MutableStateFlow
+import kotlinx.coroutines.flow.asStateFlow
import kotlinx.coroutines.flow.combine
import kotlinx.coroutines.flow.combineTransform
import kotlinx.coroutines.flow.distinctUntilChanged
@@ -117,7 +118,8 @@ constructor(
private val shadeInteractor: ShadeInteractor,
) {
private var burnInJob: Job? = null
- internal val burnInModel = MutableStateFlow(BurnInModel())
+ private val _burnInModel = MutableStateFlow(BurnInModel())
+ val burnInModel = _burnInModel.asStateFlow()
val burnInLayerVisibility: Flow<Int> =
keyguardTransitionInteractor.startedKeyguardState
@@ -279,7 +281,7 @@ constructor(
burnInJob =
scope.launch("$TAG#aodBurnInViewModel") {
- aodBurnInViewModel.movement(params).collect { burnInModel.value = it }
+ aodBurnInViewModel.movement(params).collect { _burnInModel.value = it }
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/LockscreenContentViewModel.kt b/packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/LockscreenContentViewModel.kt
index c98f3b096578..b33eaa2c691b 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/LockscreenContentViewModel.kt
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/LockscreenContentViewModel.kt
@@ -18,7 +18,6 @@ package com.android.systemui.keyguard.ui.viewmodel
import android.content.res.Resources
import com.android.internal.annotations.VisibleForTesting
-import com.android.keyguard.KeyguardClockSwitch.SMALL
import com.android.systemui.biometrics.AuthController
import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.dagger.qualifiers.Application
@@ -48,7 +47,7 @@ constructor(
val longPress: KeyguardLongPressViewModel,
val shadeInteractor: ShadeInteractor,
@Application private val applicationScope: CoroutineScope,
- private val unfoldTransitionInteractor: UnfoldTransitionInteractor,
+ unfoldTransitionInteractor: UnfoldTransitionInteractor,
) {
@VisibleForTesting val clockSize = clockInteractor.clockSize
diff --git a/packages/SystemUI/src/com/android/systemui/media/controls/domain/pipeline/MediaDeviceManager.kt b/packages/SystemUI/src/com/android/systemui/media/controls/domain/pipeline/MediaDeviceManager.kt
index 043fbfaa8a23..486d4d46c767 100644
--- a/packages/SystemUI/src/com/android/systemui/media/controls/domain/pipeline/MediaDeviceManager.kt
+++ b/packages/SystemUI/src/com/android/systemui/media/controls/domain/pipeline/MediaDeviceManager.kt
@@ -102,7 +102,8 @@ constructor(
return
}
val controller = data.token?.let { controllerFactory.create(it) }
- val localMediaManager = localMediaManagerFactory.create(data.packageName)
+ val localMediaManager =
+ localMediaManagerFactory.create(data.packageName, controller?.sessionToken)
val muteAwaitConnectionManager =
muteAwaitConnectionManagerFactory.create(localMediaManager)
entry = Entry(key, oldKey, controller, localMediaManager, muteAwaitConnectionManager)
@@ -224,9 +225,9 @@ constructor(
}
@WorkerThread
- override fun onAudioInfoChanged(info: MediaController.PlaybackInfo?) {
- val newPlaybackType = info?.playbackType ?: PLAYBACK_TYPE_UNKNOWN
- val newPlaybackVolumeControlId = info?.volumeControlId
+ override fun onAudioInfoChanged(info: MediaController.PlaybackInfo) {
+ val newPlaybackType = info.playbackType
+ val newPlaybackVolumeControlId = info.volumeControlId
if (
newPlaybackType == playbackType &&
newPlaybackVolumeControlId == playbackVolumeControlId
diff --git a/packages/SystemUI/src/com/android/systemui/media/controls/domain/pipeline/interactor/MediaControlInteractor.kt b/packages/SystemUI/src/com/android/systemui/media/controls/domain/pipeline/interactor/MediaControlInteractor.kt
index 1a0f582fb100..3f75938a91ea 100644
--- a/packages/SystemUI/src/com/android/systemui/media/controls/domain/pipeline/interactor/MediaControlInteractor.kt
+++ b/packages/SystemUI/src/com/android/systemui/media/controls/domain/pipeline/interactor/MediaControlInteractor.kt
@@ -155,11 +155,16 @@ constructor(
return false
}
- fun startMediaOutputDialog(expandable: Expandable, packageName: String) {
+ fun startMediaOutputDialog(
+ expandable: Expandable,
+ packageName: String,
+ token: MediaSession.Token? = null
+ ) {
mediaOutputDialogManager.createAndShowWithController(
packageName,
true,
- expandable.dialogController()
+ expandable.dialogController(),
+ token = token,
)
}
diff --git a/packages/SystemUI/src/com/android/systemui/media/controls/ui/controller/MediaControlPanel.java b/packages/SystemUI/src/com/android/systemui/media/controls/ui/controller/MediaControlPanel.java
index 0bc3c43993dd..5ec4f88721ca 100644
--- a/packages/SystemUI/src/com/android/systemui/media/controls/ui/controller/MediaControlPanel.java
+++ b/packages/SystemUI/src/com/android/systemui/media/controls/ui/controller/MediaControlPanel.java
@@ -743,7 +743,8 @@ public class MediaControlPanel {
mPackageName,
/* aboveStatusBar */ true,
mMediaViewHolder.getSeamlessButton(),
- UserHandle.getUserHandleForUid(mUid));
+ UserHandle.getUserHandleForUid(mUid),
+ mToken);
}
} else {
mLogger.logOpenOutputSwitcher(mUid, mPackageName, mInstanceId);
@@ -775,7 +776,8 @@ public class MediaControlPanel {
mPackageName,
/* aboveStatusBar */ true,
mMediaViewHolder.getSeamlessButton(),
- UserHandle.getUserHandleForUid(mUid));
+ UserHandle.getUserHandleForUid(mUid),
+ mToken);
}
}
});
diff --git a/packages/SystemUI/src/com/android/systemui/media/controls/ui/util/MediaArtworkHelper.kt b/packages/SystemUI/src/com/android/systemui/media/controls/ui/util/MediaArtworkHelper.kt
index 3b09f4138658..c97221e7bd50 100644
--- a/packages/SystemUI/src/com/android/systemui/media/controls/ui/util/MediaArtworkHelper.kt
+++ b/packages/SystemUI/src/com/android/systemui/media/controls/ui/util/MediaArtworkHelper.kt
@@ -107,7 +107,7 @@ object MediaArtworkHelper {
return try {
// Set up media source app's logo.
val icon = applicationContext.packageManager.getApplicationIcon(packageName)
- ColorScheme(WallpaperColors.fromDrawable(icon), darkTheme = true, style)
+ ColorScheme(WallpaperColors.fromDrawable(icon), true, style)
} catch (e: PackageManager.NameNotFoundException) {
Log.w(tag, "Fail to get media app info", e)
null
diff --git a/packages/SystemUI/src/com/android/systemui/media/controls/ui/viewmodel/MediaControlViewModel.kt b/packages/SystemUI/src/com/android/systemui/media/controls/ui/viewmodel/MediaControlViewModel.kt
index 1944f072e7dd..099991d7c671 100644
--- a/packages/SystemUI/src/com/android/systemui/media/controls/ui/viewmodel/MediaControlViewModel.kt
+++ b/packages/SystemUI/src/com/android/systemui/media/controls/ui/viewmodel/MediaControlViewModel.kt
@@ -231,12 +231,20 @@ class MediaControlViewModel(
)
} else {
logger.logOpenOutputSwitcher(model.uid, model.packageName, model.instanceId)
- interactor.startMediaOutputDialog(expandable, model.packageName)
+ interactor.startMediaOutputDialog(
+ expandable,
+ model.packageName,
+ model.token
+ )
}
} else {
logger.logOpenOutputSwitcher(model.uid, model.packageName, model.instanceId)
device?.intent?.let { interactor.startDeviceIntent(it) }
- ?: interactor.startMediaOutputDialog(expandable, model.packageName)
+ ?: interactor.startMediaOutputDialog(
+ expandable,
+ model.packageName,
+ model.token
+ )
}
}
)
diff --git a/packages/SystemUI/src/com/android/systemui/media/controls/util/LocalMediaManagerFactory.kt b/packages/SystemUI/src/com/android/systemui/media/controls/util/LocalMediaManagerFactory.kt
index ff8e903b6637..0a717adc5162 100644
--- a/packages/SystemUI/src/com/android/systemui/media/controls/util/LocalMediaManagerFactory.kt
+++ b/packages/SystemUI/src/com/android/systemui/media/controls/util/LocalMediaManagerFactory.kt
@@ -17,6 +17,7 @@
package com.android.systemui.media.controls.util
import android.content.Context
+import android.media.session.MediaSession
import com.android.settingslib.bluetooth.LocalBluetoothManager
import com.android.settingslib.media.InfoMediaManager
import com.android.settingslib.media.LocalMediaManager
@@ -30,10 +31,16 @@ constructor(
private val localBluetoothManager: LocalBluetoothManager?
) {
/** Creates a [LocalMediaManager] for the given package. */
- fun create(packageName: String?): LocalMediaManager {
+ fun create(packageName: String?, token: MediaSession.Token? = null): LocalMediaManager {
// TODO: b/321969740 - Populate the userHandle parameter in InfoMediaManager. The user
// handle is necessary to disambiguate the same package running on different users.
- return InfoMediaManager.createInstance(context, packageName, null, localBluetoothManager)
+ return InfoMediaManager.createInstance(
+ context,
+ packageName,
+ null,
+ localBluetoothManager,
+ token
+ )
.run { LocalMediaManager(context, localBluetoothManager, this, packageName) }
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/media/controls/util/MediaFlags.kt b/packages/SystemUI/src/com/android/systemui/media/controls/util/MediaFlags.kt
index 6a6eba163a40..1e7bc0cacf1d 100644
--- a/packages/SystemUI/src/com/android/systemui/media/controls/util/MediaFlags.kt
+++ b/packages/SystemUI/src/com/android/systemui/media/controls/util/MediaFlags.kt
@@ -54,5 +54,6 @@ class MediaFlags @Inject constructor(private val featureFlags: FeatureFlagsClass
fun isSceneContainerEnabled() = SceneContainerFlag.isEnabled
/** Check whether to use media refactor code */
- fun isMediaControlsRefactorEnabled() = MediaControlsRefactorFlag.isEnabled
+ fun isMediaControlsRefactorEnabled() =
+ MediaControlsRefactorFlag.isEnabled && SceneContainerFlag.isEnabled
}
diff --git a/packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputBroadcastDialogManager.kt b/packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputBroadcastDialogManager.kt
index 06267e243456..6ef9ea36882b 100644
--- a/packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputBroadcastDialogManager.kt
+++ b/packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputBroadcastDialogManager.kt
@@ -40,7 +40,12 @@ constructor(
// TODO: b/321969740 - Populate the userHandle parameter. The user handle is necessary to
// disambiguate the same package running on different users.
- val controller = mediaOutputControllerFactory.create(packageName, /* userHandle= */ null)
+ val controller =
+ mediaOutputControllerFactory.create(
+ packageName,
+ /* userHandle= */ null,
+ /* token */ null,
+ )
val dialog =
MediaOutputBroadcastDialog(context, aboveStatusBar, broadcastSender, controller)
mediaOutputBroadcastDialog = dialog
diff --git a/packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputController.java b/packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputController.java
index d6ca32079b09..c2cfdbe410b8 100644
--- a/packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputController.java
+++ b/packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputController.java
@@ -78,6 +78,7 @@ import com.android.settingslib.bluetooth.LocalBluetoothManager;
import com.android.settingslib.media.InfoMediaManager;
import com.android.settingslib.media.LocalMediaManager;
import com.android.settingslib.media.MediaDevice;
+import com.android.settingslib.media.flags.Flags;
import com.android.settingslib.utils.ThreadUtils;
import com.android.systemui.animation.ActivityTransitionAnimator;
import com.android.systemui.animation.DialogTransitionAnimator;
@@ -141,6 +142,7 @@ public class MediaOutputController implements LocalMediaManager.DeviceCallback,
private final KeyguardManager mKeyGuardManager;
private final NearbyMediaDevicesManager mNearbyMediaDevicesManager;
private final Map<String, Integer> mNearbyDeviceInfoMap = new ConcurrentHashMap<>();
+ private final MediaSession.Token mToken;
@VisibleForTesting
boolean mIsRefreshing = false;
@@ -179,6 +181,7 @@ public class MediaOutputController implements LocalMediaManager.DeviceCallback,
Context context,
@Assisted String packageName,
@Assisted @Nullable UserHandle userHandle,
+ @Assisted @Nullable MediaSession.Token token,
MediaSessionManager mediaSessionManager,
@Nullable LocalBluetoothManager lbm,
ActivityStarter starter,
@@ -202,8 +205,9 @@ public class MediaOutputController implements LocalMediaManager.DeviceCallback,
mKeyGuardManager = keyGuardManager;
mFeatureFlags = featureFlags;
mUserTracker = userTracker;
+ mToken = token;
InfoMediaManager imm =
- InfoMediaManager.createInstance(mContext, packageName, userHandle, lbm);
+ InfoMediaManager.createInstance(mContext, packageName, userHandle, lbm, token);
mLocalMediaManager = new LocalMediaManager(mContext, lbm, imm, packageName);
mMetricLogger = new MediaOutputMetricLogger(mContext, mPackageName);
mDialogTransitionAnimator = dialogTransitionAnimator;
@@ -235,7 +239,8 @@ public class MediaOutputController implements LocalMediaManager.DeviceCallback,
@AssistedFactory
public interface Factory {
/** Construct a MediaOutputController */
- MediaOutputController create(String packageName, UserHandle userHandle);
+ MediaOutputController create(
+ String packageName, UserHandle userHandle, MediaSession.Token token);
}
protected void start(@NonNull Callback cb) {
@@ -297,23 +302,28 @@ public class MediaOutputController implements LocalMediaManager.DeviceCallback,
}
private MediaController getMediaController() {
- for (NotificationEntry entry : mNotifCollection.getAllNotifs()) {
- final Notification notification = entry.getSbn().getNotification();
- if (notification.isMediaNotification()
- && TextUtils.equals(entry.getSbn().getPackageName(), mPackageName)) {
- MediaSession.Token token = notification.extras.getParcelable(
- Notification.EXTRA_MEDIA_SESSION,
- MediaSession.Token.class);
- return new MediaController(mContext, token);
+ if (mToken != null && Flags.usePlaybackInfoForRoutingControls()) {
+ return new MediaController(mContext, mToken);
+ } else {
+ for (NotificationEntry entry : mNotifCollection.getAllNotifs()) {
+ final Notification notification = entry.getSbn().getNotification();
+ if (notification.isMediaNotification()
+ && TextUtils.equals(entry.getSbn().getPackageName(), mPackageName)) {
+ MediaSession.Token token =
+ notification.extras.getParcelable(
+ Notification.EXTRA_MEDIA_SESSION, MediaSession.Token.class);
+ return new MediaController(mContext, token);
+ }
}
- }
- for (MediaController controller : mMediaSessionManager.getActiveSessionsForUser(null,
- mUserTracker.getUserHandle())) {
- if (TextUtils.equals(controller.getPackageName(), mPackageName)) {
- return controller;
+ for (MediaController controller :
+ mMediaSessionManager.getActiveSessionsForUser(
+ null, mUserTracker.getUserHandle())) {
+ if (TextUtils.equals(controller.getPackageName(), mPackageName)) {
+ return controller;
+ }
}
+ return null;
}
- return null;
}
@Override
@@ -869,10 +879,6 @@ public class MediaOutputController implements LocalMediaManager.DeviceCallback,
mMetricLogger.logInteractionUnmute(device);
}
- String getPackageName() {
- return mPackageName;
- }
-
boolean hasAdjustVolumeUserRestriction() {
if (RestrictedLockUtilsInternal.checkIfRestrictionEnforced(
mContext, UserManager.DISALLOW_ADJUST_VOLUME, UserHandle.myUserId()) != null) {
@@ -955,6 +961,7 @@ public class MediaOutputController implements LocalMediaManager.DeviceCallback,
mContext,
mPackageName,
mUserHandle,
+ mToken,
mMediaSessionManager,
mLocalBluetoothManager,
mActivityStarter,
@@ -1060,7 +1067,7 @@ public class MediaOutputController implements LocalMediaManager.DeviceCallback,
boolean isBroadcastSupported() {
LocalBluetoothLeBroadcast broadcast =
mLocalBluetoothManager.getProfileManager().getLeAudioBroadcastProfile();
- return broadcast != null ? true : false;
+ return broadcast != null;
}
boolean isBluetoothLeBroadcastEnabled() {
@@ -1194,13 +1201,6 @@ public class MediaOutputController implements LocalMediaManager.DeviceCallback,
assistant.unregisterServiceCallBack(callback);
}
- private boolean isPlayBackInfoLocal() {
- return mMediaController != null
- && mMediaController.getPlaybackInfo() != null
- && mMediaController.getPlaybackInfo().getPlaybackType()
- == MediaController.PlaybackInfo.PLAYBACK_TYPE_LOCAL;
- }
-
boolean isPlaying() {
if (mMediaController == null) {
return false;
diff --git a/packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputDialogManager.kt b/packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputDialogManager.kt
index 04d1492ff656..ee8169423de2 100644
--- a/packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputDialogManager.kt
+++ b/packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputDialogManager.kt
@@ -17,6 +17,7 @@
package com.android.systemui.media.dialog
import android.content.Context
+import android.media.session.MediaSession
import android.os.UserHandle
import android.view.View
import com.android.internal.jank.InteractionJankMonitor
@@ -49,7 +50,8 @@ constructor(
packageName: String,
aboveStatusBar: Boolean,
view: View? = null,
- userHandle: UserHandle? = null
+ userHandle: UserHandle? = null,
+ token: MediaSession.Token? = null
) {
createAndShowWithController(
packageName,
@@ -65,6 +67,7 @@ constructor(
)
},
userHandle = userHandle,
+ token = token,
)
}
@@ -77,6 +80,7 @@ constructor(
aboveStatusBar: Boolean,
controller: DialogTransitionAnimator.Controller?,
userHandle: UserHandle? = null,
+ token: MediaSession.Token? = null,
) {
createAndShow(
packageName,
@@ -84,6 +88,7 @@ constructor(
dialogTransitionAnimatorController = controller,
includePlaybackAndAppMetadata = true,
userHandle = userHandle,
+ token = token,
)
}
@@ -108,11 +113,12 @@ constructor(
dialogTransitionAnimatorController: DialogTransitionAnimator.Controller?,
includePlaybackAndAppMetadata: Boolean = true,
userHandle: UserHandle? = null,
+ token: MediaSession.Token? = null,
) {
// Dismiss the previous dialog, if any.
mediaOutputDialog?.dismiss()
- val controller = mediaOutputControllerFactory.create(packageName, userHandle)
+ val controller = mediaOutputControllerFactory.create(packageName, userHandle, token)
val mediaOutputDialog =
MediaOutputDialog(
diff --git a/packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputSwitcherDialogUI.java b/packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputSwitcherDialogUI.java
index 9cc288899d45..846460edbe9e 100644
--- a/packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputSwitcherDialogUI.java
+++ b/packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputSwitcherDialogUI.java
@@ -56,7 +56,11 @@ public class MediaOutputSwitcherDialogUI implements CoreStartable, CommandQueue.
public void showMediaOutputSwitcher(String packageName, UserHandle userHandle) {
if (!TextUtils.isEmpty(packageName)) {
mMediaOutputDialogManager.createAndShow(
- packageName, /* aboveStatusBar= */ false, /* view= */ null, userHandle);
+ packageName,
+ /* aboveStatusBar= */ false,
+ /* view= */ null,
+ userHandle,
+ /* token */ null);
} else {
Log.e(TAG, "Unable to launch media output dialog. Package name is empty.");
}
diff --git a/packages/SystemUI/src/com/android/systemui/model/SceneContainerPlugin.kt b/packages/SystemUI/src/com/android/systemui/model/SceneContainerPlugin.kt
index a144dc2fc998..c8e896dacfb8 100644
--- a/packages/SystemUI/src/com/android/systemui/model/SceneContainerPlugin.kt
+++ b/packages/SystemUI/src/com/android/systemui/model/SceneContainerPlugin.kt
@@ -84,7 +84,9 @@ constructor(
SYSUI_STATE_NOTIFICATION_PANEL_VISIBLE to { it.scene != Scenes.Gone },
SYSUI_STATE_NOTIFICATION_PANEL_EXPANDED to
{
- it.scene == Scenes.NotificationsShade || it.scene == Scenes.Shade
+ it.scene == Scenes.Lockscreen ||
+ it.scene == Scenes.NotificationsShade ||
+ it.scene == Scenes.Shade
},
SYSUI_STATE_QUICK_SETTINGS_EXPANDED to
{
diff --git a/packages/SystemUI/src/com/android/systemui/qs/panels/dagger/PanelsModule.kt b/packages/SystemUI/src/com/android/systemui/qs/panels/dagger/PanelsModule.kt
index 2cc3985a88ad..d161c6b834c0 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/panels/dagger/PanelsModule.kt
+++ b/packages/SystemUI/src/com/android/systemui/qs/panels/dagger/PanelsModule.kt
@@ -29,14 +29,17 @@ import com.android.systemui.qs.panels.domain.interactor.NoopGridConsistencyInter
import com.android.systemui.qs.panels.shared.model.GridConsistencyLog
import com.android.systemui.qs.panels.shared.model.GridLayoutType
import com.android.systemui.qs.panels.shared.model.InfiniteGridLayoutType
+import com.android.systemui.qs.panels.shared.model.PartitionedGridLayoutType
import com.android.systemui.qs.panels.shared.model.StretchedGridLayoutType
import com.android.systemui.qs.panels.ui.compose.GridLayout
import com.android.systemui.qs.panels.ui.compose.InfiniteGridLayout
+import com.android.systemui.qs.panels.ui.compose.PartitionedGridLayout
import com.android.systemui.qs.panels.ui.compose.StretchedGridLayout
import dagger.Binds
import dagger.Module
import dagger.Provides
import dagger.multibindings.IntoSet
+import javax.inject.Named
@Module
interface PanelsModule {
@@ -50,6 +53,8 @@ interface PanelsModule {
impl: NoopGridConsistencyInteractor
): GridTypeConsistencyInteractor
+ @Binds @Named("Default") fun bindDefaultGridLayout(impl: PartitionedGridLayout): GridLayout
+
companion object {
@Provides
@SysUISingleton
@@ -73,6 +78,14 @@ interface PanelsModule {
}
@Provides
+ @IntoSet
+ fun providePartitionedGridLayout(
+ gridLayout: PartitionedGridLayout
+ ): Pair<GridLayoutType, GridLayout> {
+ return Pair(PartitionedGridLayoutType, gridLayout)
+ }
+
+ @Provides
fun provideGridLayoutMap(
entries: Set<@JvmSuppressWildcards Pair<GridLayoutType, GridLayout>>
): Map<GridLayoutType, GridLayout> {
@@ -103,6 +116,14 @@ interface PanelsModule {
}
@Provides
+ @IntoSet
+ fun providePartitionedGridConsistencyInteractor(
+ consistencyInteractor: NoopGridConsistencyInteractor
+ ): Pair<GridLayoutType, GridTypeConsistencyInteractor> {
+ return Pair(PartitionedGridLayoutType, consistencyInteractor)
+ }
+
+ @Provides
fun provideGridConsistencyInteractorMap(
entries: Set<@JvmSuppressWildcards Pair<GridLayoutType, GridTypeConsistencyInteractor>>
): Map<GridLayoutType, GridTypeConsistencyInteractor> {
diff --git a/packages/SystemUI/src/com/android/systemui/qs/panels/data/repository/GridLayoutTypeRepository.kt b/packages/SystemUI/src/com/android/systemui/qs/panels/data/repository/GridLayoutTypeRepository.kt
index 31795d59bb2b..44d8688f0c4d 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/panels/data/repository/GridLayoutTypeRepository.kt
+++ b/packages/SystemUI/src/com/android/systemui/qs/panels/data/repository/GridLayoutTypeRepository.kt
@@ -18,7 +18,7 @@ package com.android.systemui.qs.panels.data.repository
import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.qs.panels.shared.model.GridLayoutType
-import com.android.systemui.qs.panels.shared.model.InfiniteGridLayoutType
+import com.android.systemui.qs.panels.shared.model.PartitionedGridLayoutType
import javax.inject.Inject
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.StateFlow
@@ -31,7 +31,8 @@ interface GridLayoutTypeRepository {
@SysUISingleton
class GridLayoutTypeRepositoryImpl @Inject constructor() : GridLayoutTypeRepository {
- private val _layout: MutableStateFlow<GridLayoutType> = MutableStateFlow(InfiniteGridLayoutType)
+ private val _layout: MutableStateFlow<GridLayoutType> =
+ MutableStateFlow(PartitionedGridLayoutType)
override val layout = _layout.asStateFlow()
override fun setLayout(type: GridLayoutType) {
diff --git a/packages/SystemUI/src/com/android/systemui/qs/panels/shared/model/GridLayoutType.kt b/packages/SystemUI/src/com/android/systemui/qs/panels/shared/model/GridLayoutType.kt
index 501730a7c8a3..9550ddb30e78 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/panels/shared/model/GridLayoutType.kt
+++ b/packages/SystemUI/src/com/android/systemui/qs/panels/shared/model/GridLayoutType.kt
@@ -31,3 +31,6 @@ data object InfiniteGridLayoutType : GridLayoutType
* spaces.
*/
data object StretchedGridLayoutType : GridLayoutType
+
+/** Grid type grouping large tiles on top and icon tiles at the bottom. */
+data object PartitionedGridLayoutType : GridLayoutType
diff --git a/packages/SystemUI/src/com/android/systemui/qs/panels/ui/compose/PartitionedGridLayout.kt b/packages/SystemUI/src/com/android/systemui/qs/panels/ui/compose/PartitionedGridLayout.kt
new file mode 100644
index 000000000000..8d0b386bd817
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/qs/panels/ui/compose/PartitionedGridLayout.kt
@@ -0,0 +1,252 @@
+/*
+ * 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.ui.compose
+
+import androidx.compose.foundation.border
+import androidx.compose.foundation.layout.Arrangement
+import androidx.compose.foundation.layout.Box
+import androidx.compose.foundation.layout.Column
+import androidx.compose.foundation.layout.Spacer
+import androidx.compose.foundation.layout.fillMaxSize
+import androidx.compose.foundation.layout.fillMaxWidth
+import androidx.compose.foundation.layout.height
+import androidx.compose.foundation.layout.padding
+import androidx.compose.foundation.lazy.grid.GridCells
+import androidx.compose.foundation.lazy.grid.GridItemSpan
+import androidx.compose.foundation.lazy.grid.LazyGridScope
+import androidx.compose.foundation.rememberScrollState
+import androidx.compose.foundation.shape.RoundedCornerShape
+import androidx.compose.foundation.verticalScroll
+import androidx.compose.material3.MaterialTheme
+import androidx.compose.runtime.Composable
+import androidx.compose.runtime.DisposableEffect
+import androidx.compose.runtime.getValue
+import androidx.compose.runtime.remember
+import androidx.compose.runtime.rememberUpdatedState
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.res.dimensionResource
+import androidx.compose.ui.unit.Dp
+import androidx.compose.ui.unit.dp
+import androidx.lifecycle.compose.collectAsStateWithLifecycle
+import com.android.compose.modifiers.background
+import com.android.systemui.dagger.SysUISingleton
+import com.android.systemui.qs.panels.domain.interactor.IconTilesInteractor
+import com.android.systemui.qs.panels.domain.interactor.InfiniteGridSizeInteractor
+import com.android.systemui.qs.panels.ui.viewmodel.EditTileViewModel
+import com.android.systemui.qs.panels.ui.viewmodel.TileViewModel
+import com.android.systemui.qs.pipeline.domain.interactor.CurrentTilesInteractor
+import com.android.systemui.qs.pipeline.shared.TileSpec
+import com.android.systemui.res.R
+import javax.inject.Inject
+
+@SysUISingleton
+class PartitionedGridLayout
+@Inject
+constructor(
+ private val iconTilesInteractor: IconTilesInteractor,
+ private val gridSizeInteractor: InfiniteGridSizeInteractor,
+) : GridLayout {
+ @Composable
+ override fun TileGrid(tiles: List<TileViewModel>, modifier: Modifier) {
+ DisposableEffect(tiles) {
+ val token = Any()
+ tiles.forEach { it.startListening(token) }
+ onDispose { tiles.forEach { it.stopListening(token) } }
+ }
+ val iconTilesSpecs by iconTilesInteractor.iconTilesSpecs.collectAsStateWithLifecycle()
+ val columns by gridSizeInteractor.columns.collectAsStateWithLifecycle()
+ val tileHeight = dimensionResource(id = R.dimen.qs_tile_height)
+ val (smallTiles, largeTiles) = tiles.partition { iconTilesSpecs.contains(it.spec) }
+
+ TileLazyGrid(modifier = modifier, columns = GridCells.Fixed(columns)) {
+ // Large tiles
+ items(largeTiles.size, span = { GridItemSpan(2) }) { index ->
+ Tile(
+ tile = largeTiles[index],
+ iconOnly = false,
+ modifier = Modifier.height(tileHeight)
+ )
+ }
+ fillUpRow(nTiles = largeTiles.size, columns = columns / 2)
+
+ // Small tiles
+ items(smallTiles.size) { index ->
+ Tile(
+ tile = smallTiles[index],
+ iconOnly = true,
+ modifier = Modifier.height(tileHeight)
+ )
+ }
+ }
+ }
+
+ @Composable
+ override fun EditTileGrid(
+ tiles: List<EditTileViewModel>,
+ modifier: Modifier,
+ onAddTile: (TileSpec, Int) -> Unit,
+ onRemoveTile: (TileSpec) -> Unit
+ ) {
+ val iconOnlySpecs by iconTilesInteractor.iconTilesSpecs.collectAsStateWithLifecycle()
+ val columns by gridSizeInteractor.columns.collectAsStateWithLifecycle()
+
+ val (currentTiles, otherTiles) = tiles.partition { it.isCurrent }
+ val addTileToEnd: (TileSpec) -> Unit by rememberUpdatedState {
+ onAddTile(it, CurrentTilesInteractor.POSITION_AT_END)
+ }
+ val isIconOnly: (TileSpec) -> Boolean =
+ remember(iconOnlySpecs) { { tileSpec: TileSpec -> tileSpec in iconOnlySpecs } }
+ val tileHeight = dimensionResource(id = R.dimen.qs_tile_height)
+ val tilePadding = dimensionResource(R.dimen.qs_tile_margin_vertical)
+
+ Column(
+ verticalArrangement = Arrangement.spacedBy(tilePadding),
+ modifier = modifier.fillMaxSize().verticalScroll(rememberScrollState())
+ ) {
+ CurrentTiles(
+ tiles = currentTiles,
+ tileHeight = tileHeight,
+ tilePadding = tilePadding,
+ onRemoveTile = onRemoveTile,
+ isIconOnly = isIconOnly,
+ columns = columns,
+ )
+ AvailableTiles(
+ tiles = otherTiles,
+ tileHeight = tileHeight,
+ tilePadding = tilePadding,
+ addTileToEnd = addTileToEnd,
+ isIconOnly = isIconOnly,
+ columns = columns,
+ )
+ }
+ }
+
+ @Composable
+ private fun CurrentTiles(
+ tiles: List<EditTileViewModel>,
+ tileHeight: Dp,
+ tilePadding: Dp,
+ onRemoveTile: (TileSpec) -> Unit,
+ isIconOnly: (TileSpec) -> Boolean,
+ columns: Int,
+ ) {
+ val (smallTiles, largeTiles) = tiles.partition { isIconOnly(it.tileSpec) }
+
+ val largeGridHeight = gridHeight(largeTiles.size, tileHeight, columns / 2, tilePadding)
+ val smallGridHeight = gridHeight(smallTiles.size, tileHeight, columns, tilePadding)
+
+ CurrentTilesContainer {
+ TileLazyGrid(
+ columns = GridCells.Fixed(columns),
+ modifier = Modifier.height(largeGridHeight),
+ ) {
+ editTiles(largeTiles, ClickAction.REMOVE, onRemoveTile, { false }, true)
+ }
+ }
+ CurrentTilesContainer {
+ TileLazyGrid(
+ columns = GridCells.Fixed(columns),
+ modifier = Modifier.height(smallGridHeight),
+ ) {
+ editTiles(smallTiles, ClickAction.REMOVE, onRemoveTile, { true }, true)
+ }
+ }
+ }
+
+ @Composable
+ private fun AvailableTiles(
+ tiles: List<EditTileViewModel>,
+ tileHeight: Dp,
+ tilePadding: Dp,
+ addTileToEnd: (TileSpec) -> Unit,
+ isIconOnly: (TileSpec) -> Boolean,
+ columns: Int,
+ ) {
+ val (tilesStock, tilesCustom) = tiles.partition { it.appName == null }
+ val (smallTiles, largeTiles) = tilesStock.partition { isIconOnly(it.tileSpec) }
+
+ val largeGridHeight = gridHeight(largeTiles.size, tileHeight, columns / 2, tilePadding)
+ val smallGridHeight = gridHeight(smallTiles.size, tileHeight, columns, tilePadding)
+ val largeGridHeightCustom =
+ gridHeight(tilesCustom.size, tileHeight, columns / 2, tilePadding)
+
+ // Add up the height of all three grids and add padding in between
+ val gridHeight =
+ largeGridHeight + smallGridHeight + largeGridHeightCustom + (tilePadding * 2)
+
+ AvailableTilesContainer {
+ TileLazyGrid(
+ columns = GridCells.Fixed(columns),
+ modifier = Modifier.height(gridHeight),
+ ) {
+ // Large tiles
+ editTiles(largeTiles, ClickAction.ADD, addTileToEnd, isIconOnly)
+ fillUpRow(nTiles = largeTiles.size, columns = columns / 2)
+
+ // Small tiles
+ editTiles(smallTiles, ClickAction.ADD, addTileToEnd, isIconOnly)
+ fillUpRow(nTiles = smallTiles.size, columns = columns)
+
+ // Custom tiles, all large
+ editTiles(tilesCustom, ClickAction.ADD, addTileToEnd, isIconOnly)
+ }
+ }
+ }
+
+ @Composable
+ private fun CurrentTilesContainer(content: @Composable () -> Unit) {
+ Box(
+ Modifier.fillMaxWidth()
+ .border(
+ width = 1.dp,
+ color = MaterialTheme.colorScheme.onBackground,
+ shape = RoundedCornerShape(dimensionResource(R.dimen.qs_corner_radius))
+ )
+ .padding(dimensionResource(R.dimen.qs_tile_margin_vertical))
+ ) {
+ content()
+ }
+ }
+
+ @Composable
+ private fun AvailableTilesContainer(content: @Composable () -> Unit) {
+ Box(
+ Modifier.fillMaxWidth()
+ .background(
+ color = MaterialTheme.colorScheme.surfaceVariant,
+ alpha = { 1f },
+ shape = RoundedCornerShape(dimensionResource(R.dimen.qs_corner_radius))
+ )
+ .padding(dimensionResource(R.dimen.qs_tile_margin_vertical))
+ ) {
+ content()
+ }
+ }
+
+ private fun gridHeight(nTiles: Int, tileHeight: Dp, columns: Int, padding: Dp): Dp {
+ val rows = (nTiles + columns - 1) / columns
+ return ((tileHeight + padding) * rows) - padding
+ }
+
+ /** Fill up the rest of the row if it's not complete. */
+ private fun LazyGridScope.fillUpRow(nTiles: Int, columns: Int) {
+ if (nTiles % columns != 0) {
+ item(span = { GridItemSpan(maxCurrentLineSpan) }) { Spacer(Modifier) }
+ }
+ }
+}
diff --git a/packages/SystemUI/src/com/android/systemui/qs/panels/ui/compose/Tile.kt b/packages/SystemUI/src/com/android/systemui/qs/panels/ui/compose/Tile.kt
index eb45110533a4..e8c65a5ac78a 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/panels/ui/compose/Tile.kt
+++ b/packages/SystemUI/src/com/android/systemui/qs/panels/ui/compose/Tile.kt
@@ -208,7 +208,7 @@ fun DefaultEditTileGrid(
}
}
-private fun LazyGridScope.editTiles(
+fun LazyGridScope.editTiles(
tiles: List<EditTileViewModel>,
clickAction: ClickAction,
onClick: (TileSpec) -> Unit,
diff --git a/packages/SystemUI/src/com/android/systemui/qs/panels/ui/viewmodel/EditModeViewModel.kt b/packages/SystemUI/src/com/android/systemui/qs/panels/ui/viewmodel/EditModeViewModel.kt
index 69f50a7986d5..5b4186cb6f1d 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/panels/ui/viewmodel/EditModeViewModel.kt
+++ b/packages/SystemUI/src/com/android/systemui/qs/panels/ui/viewmodel/EditModeViewModel.kt
@@ -22,12 +22,12 @@ import com.android.systemui.qs.panels.domain.interactor.EditTilesListInteractor
import com.android.systemui.qs.panels.domain.interactor.GridLayoutTypeInteractor
import com.android.systemui.qs.panels.shared.model.GridLayoutType
import com.android.systemui.qs.panels.ui.compose.GridLayout
-import com.android.systemui.qs.panels.ui.compose.InfiniteGridLayout
import com.android.systemui.qs.pipeline.domain.interactor.CurrentTilesInteractor
import com.android.systemui.qs.pipeline.domain.interactor.CurrentTilesInteractor.Companion.POSITION_AT_END
import com.android.systemui.qs.pipeline.domain.interactor.MinimumTilesInteractor
import com.android.systemui.qs.pipeline.shared.TileSpec
import javax.inject.Inject
+import javax.inject.Named
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.flow.MutableStateFlow
@@ -47,7 +47,7 @@ constructor(
private val editTilesListInteractor: EditTilesListInteractor,
private val currentTilesInteractor: CurrentTilesInteractor,
private val minTilesInteractor: MinimumTilesInteractor,
- private val defaultGridLayout: InfiniteGridLayout,
+ @Named("Default") private val defaultGridLayout: GridLayout,
@Application private val applicationScope: CoroutineScope,
gridLayoutTypeInteractor: GridLayoutTypeInteractor,
gridLayoutMap: Map<GridLayoutType, @JvmSuppressWildcards GridLayout>,
diff --git a/packages/SystemUI/src/com/android/systemui/qs/panels/ui/viewmodel/TileGridViewModel.kt b/packages/SystemUI/src/com/android/systemui/qs/panels/ui/viewmodel/TileGridViewModel.kt
index 5eee691dcf79..127ecb2f3eba 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/panels/ui/viewmodel/TileGridViewModel.kt
+++ b/packages/SystemUI/src/com/android/systemui/qs/panels/ui/viewmodel/TileGridViewModel.kt
@@ -21,9 +21,9 @@ import com.android.systemui.dagger.qualifiers.Application
import com.android.systemui.qs.panels.domain.interactor.GridLayoutTypeInteractor
import com.android.systemui.qs.panels.shared.model.GridLayoutType
import com.android.systemui.qs.panels.ui.compose.GridLayout
-import com.android.systemui.qs.panels.ui.compose.InfiniteGridLayout
import com.android.systemui.qs.pipeline.domain.interactor.CurrentTilesInteractor
import javax.inject.Inject
+import javax.inject.Named
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.flow.Flow
@@ -41,7 +41,7 @@ constructor(
gridLayoutTypeInteractor: GridLayoutTypeInteractor,
gridLayoutMap: Map<GridLayoutType, @JvmSuppressWildcards GridLayout>,
tilesInteractor: CurrentTilesInteractor,
- defaultGridLayout: InfiniteGridLayout,
+ @Named("Default") defaultGridLayout: GridLayout,
@Application private val applicationScope: CoroutineScope
) {
val gridLayout: StateFlow<GridLayout> =
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tileimpl/QSTileViewImpl.kt b/packages/SystemUI/src/com/android/systemui/qs/tileimpl/QSTileViewImpl.kt
index 4fd0df4d3f8f..c6dfdd5c137b 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tileimpl/QSTileViewImpl.kt
+++ b/packages/SystemUI/src/com/android/systemui/qs/tileimpl/QSTileViewImpl.kt
@@ -148,7 +148,8 @@ open class QSTileViewImpl @JvmOverloads constructor(
*/
protected var showRippleEffect = true
- private lateinit var qsTileBackground: LayerDrawable
+ private lateinit var qsTileBackground: RippleDrawable
+ private lateinit var qsTileFocusBackground: Drawable
private lateinit var backgroundDrawable: LayerDrawable
private lateinit var backgroundBaseDrawable: Drawable
private lateinit var backgroundOverlayDrawable: Drawable
@@ -313,10 +314,11 @@ open class QSTileViewImpl @JvmOverloads constructor(
private fun createTileBackground(): Drawable {
qsTileBackground = if (Flags.qsTileFocusState()) {
- mContext.getDrawable(R.drawable.qs_tile_background_flagged) as LayerDrawable
+ mContext.getDrawable(R.drawable.qs_tile_background_flagged) as RippleDrawable
} else {
mContext.getDrawable(R.drawable.qs_tile_background) as RippleDrawable
}
+ qsTileFocusBackground = mContext.getDrawable(R.drawable.qs_tile_focused_background)!!
backgroundDrawable =
qsTileBackground.findDrawableByLayerId(R.id.background) as LayerDrawable
backgroundBaseDrawable =
@@ -332,6 +334,17 @@ open class QSTileViewImpl @JvmOverloads constructor(
updateHeight()
}
+ override fun onFocusChanged(gainFocus: Boolean, direction: Int, previouslyFocusedRect: Rect?) {
+ super.onFocusChanged(gainFocus, direction, previouslyFocusedRect)
+ if (Flags.qsTileFocusState()) {
+ if (gainFocus) {
+ qsTileFocusBackground.setBounds(0, 0, width, height)
+ overlay.add(qsTileFocusBackground)
+ } else {
+ overlay.clear()
+ }
+ }
+ }
private fun updateHeight() {
// TODO(b/332900989): Find a more robust way of resetting the tile if not reset by the
// launch animation.
diff --git a/packages/SystemUI/src/com/android/systemui/qs/ui/adapter/QSSceneAdapter.kt b/packages/SystemUI/src/com/android/systemui/qs/ui/adapter/QSSceneAdapter.kt
index 63acbb0d730d..fb872d538e6c 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/ui/adapter/QSSceneAdapter.kt
+++ b/packages/SystemUI/src/com/android/systemui/qs/ui/adapter/QSSceneAdapter.kt
@@ -127,28 +127,28 @@ interface QSSceneAdapter {
val isVisible: Boolean
val expansion: Float
- val squishiness: Float
+ val squishiness: () -> Float
data object CLOSED : State {
override val isVisible = false
override val expansion = 0f
- override val squishiness = 1f
+ override val squishiness = { 1f }
}
/** State for expanding between QQS and QS */
data class Expanding(override val expansion: Float) : State {
override val isVisible = true
- override val squishiness = 1f
+ override val squishiness = { 1f }
}
/** State for appearing QQS from Lockscreen or Gone */
- data class UnsquishingQQS(override val squishiness: Float) : State {
+ data class UnsquishingQQS(override val squishiness: () -> Float) : State {
override val isVisible = true
override val expansion = 0f
}
/** State for appearing QS from Lockscreen or Gone, used in Split shade */
- data class UnsquishingQS(override val squishiness: Float) : State {
+ data class UnsquishingQS(override val squishiness: () -> Float) : State {
override val isVisible = true
override val expansion = 1f
}
@@ -370,7 +370,7 @@ constructor(
setQsVisible(state.isVisible)
setExpanded(state.isVisible && state.expansion > 0f)
setListening(state.isVisible)
- setQsExpansion(state.expansion, 1f, 0f, state.squishiness)
+ setQsExpansion(state.expansion, 1f, 0f, state.squishiness())
}
override fun dump(pw: PrintWriter, args: Array<out String>) {
diff --git a/packages/SystemUI/src/com/android/systemui/scene/domain/interactor/SceneInteractor.kt b/packages/SystemUI/src/com/android/systemui/scene/domain/interactor/SceneInteractor.kt
index 0d0f6e069d2d..b1700e377725 100644
--- a/packages/SystemUI/src/com/android/systemui/scene/domain/interactor/SceneInteractor.kt
+++ b/packages/SystemUI/src/com/android/systemui/scene/domain/interactor/SceneInteractor.kt
@@ -315,9 +315,17 @@ constructor(
return false
}
- check(to != Scenes.Gone || deviceUnlockedInteractor.deviceUnlockStatus.value.isUnlocked) {
- "Cannot change to the Gone scene while the device is locked. Logging reason for scene" +
- " change was: $loggingReason"
+ val inMidTransitionFromGone =
+ (transitionState.value as? ObservableTransitionState.Transition)?.fromScene ==
+ Scenes.Gone
+ val isChangeAllowed =
+ to != Scenes.Gone ||
+ inMidTransitionFromGone ||
+ deviceUnlockedInteractor.deviceUnlockStatus.value.isUnlocked
+ check(isChangeAllowed) {
+ "Cannot change to the Gone scene while the device is locked and not currently" +
+ " transitioning from Gone. Current transition state is ${transitionState.value}." +
+ " Logging reason for scene change was: $loggingReason"
}
return from != to
diff --git a/packages/SystemUI/src/com/android/systemui/scene/domain/startable/SceneContainerStartable.kt b/packages/SystemUI/src/com/android/systemui/scene/domain/startable/SceneContainerStartable.kt
index 3ce12dddb08e..0304e730cb68 100644
--- a/packages/SystemUI/src/com/android/systemui/scene/domain/startable/SceneContainerStartable.kt
+++ b/packages/SystemUI/src/com/android/systemui/scene/domain/startable/SceneContainerStartable.kt
@@ -45,6 +45,7 @@ import com.android.systemui.model.updateFlags
import com.android.systemui.plugins.FalsingManager
import com.android.systemui.plugins.FalsingManager.FalsingBeliefListener
import com.android.systemui.power.domain.interactor.PowerInteractor
+import com.android.systemui.power.shared.model.WakeSleepReason
import com.android.systemui.scene.data.model.asIterable
import com.android.systemui.scene.domain.interactor.SceneBackInteractor
import com.android.systemui.scene.domain.interactor.SceneContainerOcclusionInteractor
@@ -365,6 +366,29 @@ constructor(
private fun handlePowerState() {
applicationScope.launch {
+ powerInteractor.detailedWakefulness.collect { wakefulness ->
+ // Detect a double-tap-power-button gesture that was started while the device was
+ // still awake.
+ if (wakefulness.isAsleep()) return@collect
+ if (!wakefulness.powerButtonLaunchGestureTriggered) return@collect
+ if (wakefulness.lastSleepReason != WakeSleepReason.POWER_BUTTON) return@collect
+
+ // If we're mid-transition from Gone to Lockscreen due to the first power button
+ // press, then return to Gone.
+ val transition: ObservableTransitionState.Transition =
+ sceneInteractor.transitionState.value as? ObservableTransitionState.Transition
+ ?: return@collect
+ if (
+ transition.fromScene == Scenes.Gone && transition.toScene == Scenes.Lockscreen
+ ) {
+ switchToScene(
+ targetSceneKey = Scenes.Gone,
+ loggingReason = "double-tap power gesture",
+ )
+ }
+ }
+ }
+ applicationScope.launch {
powerInteractor.isAsleep.collect { isAsleep ->
if (isAsleep) {
switchToScene(
diff --git a/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java b/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java
index 32e383a73821..3826b50ab024 100644
--- a/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java
+++ b/packages/SystemUI/src/com/android/systemui/shade/NotificationPanelViewController.java
@@ -4218,7 +4218,7 @@ public final class NotificationPanelViewController implements ShadeSurface, Dump
}
private void registerAnimatorForTest(Animator animator) {
- if (mTestSetOfAnimatorsUsed != null) {
+ if (mTestSetOfAnimatorsUsed != null && animator != null) {
mTestSetOfAnimatorsUsed.add(animator);
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/shade/ShadeViewController.kt b/packages/SystemUI/src/com/android/systemui/shade/ShadeViewController.kt
index 9dc19b147e4a..daea977c9d09 100644
--- a/packages/SystemUI/src/com/android/systemui/shade/ShadeViewController.kt
+++ b/packages/SystemUI/src/com/android/systemui/shade/ShadeViewController.kt
@@ -181,11 +181,8 @@ interface ShadeViewStateProvider {
/**
* Returns true if heads up should be visible.
- *
- * TODO(b/138786270): If HeadsUpAppearanceController was injectable, we could inject it into
- * [KeyguardStatusBarViewController] and remove this method.
*/
- @Deprecated("deprecated in Flexiglass.") fun shouldHeadsUpBeVisible(): Boolean
+ @Deprecated("deprecated by SceneContainerFlag.isEnabled.") fun shouldHeadsUpBeVisible(): Boolean
/** Return the fraction of the shade that's expanded, when in lockscreen. */
@Deprecated("deprecated by SceneContainerFlag.isEnabled") val lockscreenShadeDragProgress: Float
diff --git a/packages/SystemUI/src/com/android/systemui/shade/domain/interactor/ShadeInteractor.kt b/packages/SystemUI/src/com/android/systemui/shade/domain/interactor/ShadeInteractor.kt
index 0de3c10329e3..18407cc8e76f 100644
--- a/packages/SystemUI/src/com/android/systemui/shade/domain/interactor/ShadeInteractor.kt
+++ b/packages/SystemUI/src/com/android/systemui/shade/domain/interactor/ShadeInteractor.kt
@@ -38,6 +38,9 @@ interface ShadeInteractor : BaseShadeInteractor {
/** Whether the Shade is fully expanded. */
val isShadeFullyExpanded: Flow<Boolean>
+ /** Whether the Shade is fully collapsed. */
+ val isShadeFullyCollapsed: Flow<Boolean>
+
/**
* Whether the user is expanding or collapsing either the shade or quick settings with user
* input (i.e. dragging a pointer). This will be true even if the user's input gesture had ended
diff --git a/packages/SystemUI/src/com/android/systemui/shade/domain/interactor/ShadeInteractorEmptyImpl.kt b/packages/SystemUI/src/com/android/systemui/shade/domain/interactor/ShadeInteractorEmptyImpl.kt
index 883ef97a6aad..bb4baa34dd86 100644
--- a/packages/SystemUI/src/com/android/systemui/shade/domain/interactor/ShadeInteractorEmptyImpl.kt
+++ b/packages/SystemUI/src/com/android/systemui/shade/domain/interactor/ShadeInteractorEmptyImpl.kt
@@ -38,6 +38,7 @@ class ShadeInteractorEmptyImpl @Inject constructor() : ShadeInteractor {
override val anyExpansion: StateFlow<Float> = inactiveFlowFloat
override val isAnyFullyExpanded: StateFlow<Boolean> = inactiveFlowBoolean
override val isShadeFullyExpanded: Flow<Boolean> = inactiveFlowBoolean
+ override val isShadeFullyCollapsed: Flow<Boolean> = inactiveFlowBoolean
override val isAnyExpanded: StateFlow<Boolean> = inactiveFlowBoolean
override val isUserInteractingWithShade: Flow<Boolean> = inactiveFlowBoolean
override val isUserInteractingWithQs: Flow<Boolean> = inactiveFlowBoolean
diff --git a/packages/SystemUI/src/com/android/systemui/shade/domain/interactor/ShadeInteractorImpl.kt b/packages/SystemUI/src/com/android/systemui/shade/domain/interactor/ShadeInteractorImpl.kt
index 0b45c0834245..06a8d1874e5d 100644
--- a/packages/SystemUI/src/com/android/systemui/shade/domain/interactor/ShadeInteractorImpl.kt
+++ b/packages/SystemUI/src/com/android/systemui/shade/domain/interactor/ShadeInteractorImpl.kt
@@ -74,6 +74,9 @@ constructor(
override val isShadeFullyExpanded: Flow<Boolean> =
baseShadeInteractor.shadeExpansion.map { it >= 1f }.distinctUntilChanged()
+ override val isShadeFullyCollapsed: Flow<Boolean> =
+ baseShadeInteractor.shadeExpansion.map { it <= 0f }.distinctUntilChanged()
+
override val isUserInteracting: StateFlow<Boolean> =
combine(isUserInteractingWithShade, isUserInteractingWithQs) { shade, qs -> shade || qs }
.distinctUntilChanged()
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java b/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java
index 2446473c3b31..3d4b421fcc50 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java
@@ -633,6 +633,7 @@ public class KeyguardIndicationController {
INDICATION_TYPE_BIOMETRIC_MESSAGE,
new KeyguardIndication.Builder()
.setMessage(mBiometricMessage)
+ .setForceAccessibilityLiveRegionAssertive()
.setMinVisibilityMillis(IMPORTANT_MSG_MIN_DURATION)
.setTextColor(mInitialTextColorState)
.build(),
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/lockscreen/LockscreenSmartspaceController.kt b/packages/SystemUI/src/com/android/systemui/statusbar/lockscreen/LockscreenSmartspaceController.kt
index 446a0d746227..455c96441927 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/lockscreen/LockscreenSmartspaceController.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/lockscreen/LockscreenSmartspaceController.kt
@@ -310,11 +310,9 @@ constructor(
fun isWeatherEnabled(): Boolean {
execution.assertIsMainThread()
- val defaultValue = context.getResources().getBoolean(
- com.android.internal.R.bool.config_lockscreenWeatherEnabledByDefault)
val showWeather = secureSettings.getIntForUser(
LOCK_SCREEN_WEATHER_ENABLED,
- if (defaultValue) 1 else 0,
+ 1,
userTracker.userId) == 1
return showWeather
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationSectionsFeatureManager.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationSectionsFeatureManager.kt
index bd9383de3bab..2f293e072c84 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationSectionsFeatureManager.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationSectionsFeatureManager.kt
@@ -22,11 +22,13 @@ import android.provider.DeviceConfig
import com.android.internal.annotations.VisibleForTesting
import com.android.internal.config.sysui.SystemUiDeviceConfigFlags.NOTIFICATIONS_USE_PEOPLE_FILTERING
import com.android.systemui.dagger.SysUISingleton
+import com.android.systemui.statusbar.notification.shared.PriorityPeopleSection
import com.android.systemui.statusbar.notification.stack.BUCKET_ALERTING
import com.android.systemui.statusbar.notification.stack.BUCKET_FOREGROUND_SERVICE
import com.android.systemui.statusbar.notification.stack.BUCKET_HEADS_UP
import com.android.systemui.statusbar.notification.stack.BUCKET_MEDIA_CONTROLS
import com.android.systemui.statusbar.notification.stack.BUCKET_PEOPLE
+import com.android.systemui.statusbar.notification.stack.BUCKET_PRIORITY_PEOPLE
import com.android.systemui.statusbar.notification.stack.BUCKET_SILENT
import com.android.systemui.util.DeviceConfigProxy
import com.android.systemui.util.Utils
@@ -53,6 +55,18 @@ class NotificationSectionsFeatureManager @Inject constructor(
}
fun getNotificationBuckets(): IntArray {
+ if (PriorityPeopleSection.isEnabled) {
+ // We don't need this list to be adaptive, it can be the superset of all features.
+ return intArrayOf(
+ BUCKET_MEDIA_CONTROLS,
+ BUCKET_HEADS_UP,
+ BUCKET_FOREGROUND_SERVICE,
+ BUCKET_PRIORITY_PEOPLE,
+ BUCKET_PEOPLE,
+ BUCKET_ALERTING,
+ BUCKET_SILENT,
+ )
+ }
return when {
isFilteringEnabled() && isMediaControlsEnabled() ->
intArrayOf(BUCKET_HEADS_UP, BUCKET_FOREGROUND_SERVICE, BUCKET_MEDIA_CONTROLS,
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/domain/interactor/HeadsUpNotificationInteractor.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/domain/interactor/HeadsUpNotificationInteractor.kt
index 98b52edcf9cc..4a6553f724c2 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/domain/interactor/HeadsUpNotificationInteractor.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/domain/interactor/HeadsUpNotificationInteractor.kt
@@ -18,6 +18,10 @@
package com.android.systemui.statusbar.notification.domain.interactor
+import com.android.systemui.deviceentry.domain.interactor.DeviceEntryFaceAuthInteractor
+import com.android.systemui.keyguard.domain.interactor.KeyguardTransitionInteractor
+import com.android.systemui.keyguard.shared.model.KeyguardState
+import com.android.systemui.shade.domain.interactor.ShadeInteractor
import com.android.systemui.statusbar.notification.data.repository.HeadsUpRepository
import com.android.systemui.statusbar.notification.data.repository.HeadsUpRowRepository
import com.android.systemui.statusbar.notification.shared.HeadsUpRowKey
@@ -29,13 +33,21 @@ import kotlinx.coroutines.flow.flatMapLatest
import kotlinx.coroutines.flow.flowOf
import kotlinx.coroutines.flow.map
-class HeadsUpNotificationInteractor @Inject constructor(private val repository: HeadsUpRepository) {
+class HeadsUpNotificationInteractor
+@Inject
+constructor(
+ private val headsUpRepository: HeadsUpRepository,
+ private val faceAuthInteractor: DeviceEntryFaceAuthInteractor,
+ private val keyguardTransitionInteractor: KeyguardTransitionInteractor,
+ private val notificationsKeyguardInteractor: NotificationsKeyguardInteractor,
+ private val shadeInteractor: ShadeInteractor,
+) {
- val topHeadsUpRow: Flow<HeadsUpRowKey?> = repository.topHeadsUpRow
+ val topHeadsUpRow: Flow<HeadsUpRowKey?> = headsUpRepository.topHeadsUpRow
/** Set of currently pinned top-level heads up rows to be displayed. */
val pinnedHeadsUpRows: Flow<Set<HeadsUpRowKey>> =
- repository.activeHeadsUpRows.flatMapLatest { repositories ->
+ headsUpRepository.activeHeadsUpRows.flatMapLatest { repositories ->
if (repositories.isNotEmpty()) {
val toCombine: List<Flow<Pair<HeadsUpRowRepository, Boolean>>> =
repositories.map { repo -> repo.isPinned.map { isPinned -> repo to isPinned } }
@@ -50,7 +62,7 @@ class HeadsUpNotificationInteractor @Inject constructor(private val repository:
/** Are there any pinned heads up rows to display? */
val hasPinnedRows: Flow<Boolean> =
- repository.activeHeadsUpRows.flatMapLatest { rows ->
+ headsUpRepository.activeHeadsUpRows.flatMapLatest { rows ->
if (rows.isNotEmpty()) {
combine(rows.map { it.isPinned }) { pins -> pins.any { it } }
} else {
@@ -60,15 +72,38 @@ class HeadsUpNotificationInteractor @Inject constructor(private val repository:
}
val isHeadsUpOrAnimatingAway: Flow<Boolean> =
- combine(hasPinnedRows, repository.isHeadsUpAnimatingAway) { hasPinnedRows, animatingAway ->
+ combine(hasPinnedRows, headsUpRepository.isHeadsUpAnimatingAway) {
+ hasPinnedRows,
+ animatingAway ->
hasPinnedRows || animatingAway
}
+ private val canShowHeadsUp: Flow<Boolean> =
+ combine(
+ faceAuthInteractor.isBypassEnabled,
+ shadeInteractor.isShadeFullyCollapsed,
+ keyguardTransitionInteractor.currentKeyguardState,
+ notificationsKeyguardInteractor.areNotificationsFullyHidden,
+ ) { isBypassEnabled, isShadeCollapsed, keyguardState, areNotificationsHidden ->
+ val isOnLockScreen = keyguardState == KeyguardState.LOCKSCREEN
+ when {
+ areNotificationsHidden -> false // don't show when notification are hidden
+ !isShadeCollapsed -> false // don't show when the shade is expanded
+ isOnLockScreen -> isBypassEnabled // on the lock screen only show for bypass
+ else -> true // show otherwise
+ }
+ }
+
+ val showHeadsUpStatusBar: Flow<Boolean> =
+ combine(hasPinnedRows, canShowHeadsUp) { hasPinnedRows, canShowHeadsUp ->
+ hasPinnedRows && canShowHeadsUp
+ }
+
fun headsUpRow(key: HeadsUpRowKey): HeadsUpRowInteractor =
HeadsUpRowInteractor(key as HeadsUpRowRepository)
fun elementKeyFor(key: HeadsUpRowKey) = (key as HeadsUpRowRepository).elementKey
fun setHeadsUpAnimatingAway(animatingAway: Boolean) {
- repository.setHeadsUpAnimatingAway(animatingAway)
+ headsUpRepository.setHeadsUpAnimatingAway(animatingAway)
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/interruption/CommonVisualInterruptionSuppressors.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/interruption/CommonVisualInterruptionSuppressors.kt
index a901c5f8ae2a..87f11f131f32 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/interruption/CommonVisualInterruptionSuppressors.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/interruption/CommonVisualInterruptionSuppressors.kt
@@ -16,6 +16,7 @@
package com.android.systemui.statusbar.notification.interruption
+import android.Manifest.permission.RECEIVE_EMERGENCY_BROADCAST
import android.app.Notification
import android.app.Notification.BubbleMetadata
import android.app.Notification.CATEGORY_EVENT
@@ -23,6 +24,8 @@ import android.app.Notification.CATEGORY_REMINDER
import android.app.Notification.VISIBILITY_PRIVATE
import android.app.NotificationManager.IMPORTANCE_DEFAULT
import android.app.NotificationManager.IMPORTANCE_HIGH
+import android.content.pm.PackageManager
+import android.content.pm.PackageManager.PERMISSION_GRANTED
import android.database.ContentObserver
import android.hardware.display.AmbientDisplayConfiguration
import android.os.Handler
@@ -234,6 +237,7 @@ class AvalancheSuppressor(
private val avalancheProvider: AvalancheProvider,
private val systemClock: SystemClock,
private val systemSettings: SystemSettings,
+ private val packageManager: PackageManager,
) :
VisualInterruptionFilter(
types = setOf(PEEK, PULSE),
@@ -249,6 +253,7 @@ class AvalancheSuppressor(
ALLOW_CATEGORY_EVENT,
ALLOW_FSI_WITH_PERMISSION_ON,
ALLOW_COLORIZED,
+ ALLOW_EMERGENCY,
SUPPRESS
}
@@ -299,13 +304,20 @@ class AvalancheSuppressor(
if (entry.sbn.notification.isColorized) {
return State.ALLOW_COLORIZED
}
+ if (entry.sbn.notification.isColorized) {
+ return State.ALLOW_COLORIZED
+ }
+ if (
+ packageManager.checkPermission(RECEIVE_EMERGENCY_BROADCAST, entry.sbn.packageName) ==
+ PERMISSION_GRANTED
+ ) {
+ return State.ALLOW_EMERGENCY
+ }
return State.SUPPRESS
}
private fun isCooldownEnabled(): Boolean {
- return systemSettings.getInt(
- Settings.System.NOTIFICATION_COOLDOWN_ENABLED,
- /* def */ 1
- ) == 1
+ return systemSettings.getInt(Settings.System.NOTIFICATION_COOLDOWN_ENABLED, /* def */ 1) ==
+ 1
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/interruption/VisualInterruptionDecisionProviderImpl.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/interruption/VisualInterruptionDecisionProviderImpl.kt
index e6d97c211dc5..f68e194aace2 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/interruption/VisualInterruptionDecisionProviderImpl.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/interruption/VisualInterruptionDecisionProviderImpl.kt
@@ -15,6 +15,7 @@
*/
package com.android.systemui.statusbar.notification.interruption
+import android.content.pm.PackageManager
import android.hardware.display.AmbientDisplayConfiguration
import android.os.Handler
import android.os.PowerManager
@@ -63,7 +64,8 @@ constructor(
private val uiEventLogger: UiEventLogger,
private val userTracker: UserTracker,
private val avalancheProvider: AvalancheProvider,
- private val systemSettings: SystemSettings
+ private val systemSettings: SystemSettings,
+ private val packageManager: PackageManager
) : VisualInterruptionDecisionProvider {
init {
@@ -172,7 +174,9 @@ constructor(
addFilter(AlertKeyguardVisibilitySuppressor(keyguardNotificationVisibilityProvider))
if (NotificationAvalancheSuppression.isEnabled) {
- addFilter(AvalancheSuppressor(avalancheProvider, systemClock, systemSettings))
+ addFilter(
+ AvalancheSuppressor(avalancheProvider, systemClock, systemSettings, packageManager)
+ )
avalancheProvider.register()
}
started = true
@@ -232,14 +236,17 @@ constructor(
private fun makeLoggablePeekDecision(entry: NotificationEntry): LoggableDecision =
checkConditions(PEEK)
- ?: checkFilters(PEEK, entry) ?: checkSuppressInterruptions(entry)
- ?: checkSuppressAwakeInterruptions(entry) ?: checkSuppressAwakeHeadsUp(entry)
- ?: LoggableDecision.unsuppressed
+ ?: checkFilters(PEEK, entry)
+ ?: checkSuppressInterruptions(entry)
+ ?: checkSuppressAwakeInterruptions(entry)
+ ?: checkSuppressAwakeHeadsUp(entry)
+ ?: LoggableDecision.unsuppressed
private fun makeLoggablePulseDecision(entry: NotificationEntry): LoggableDecision =
checkConditions(PULSE)
- ?: checkFilters(PULSE, entry) ?: checkSuppressInterruptions(entry)
- ?: LoggableDecision.unsuppressed
+ ?: checkFilters(PULSE, entry)
+ ?: checkSuppressInterruptions(entry)
+ ?: LoggableDecision.unsuppressed
override fun makeAndLogBubbleDecision(entry: NotificationEntry): Decision =
traceSection("VisualInterruptionDecisionProviderImpl#makeAndLogBubbleDecision") {
@@ -252,8 +259,10 @@ constructor(
private fun makeLoggableBubbleDecision(entry: NotificationEntry): LoggableDecision =
checkConditions(BUBBLE)
- ?: checkFilters(BUBBLE, entry) ?: checkSuppressInterruptions(entry)
- ?: checkSuppressAwakeInterruptions(entry) ?: LoggableDecision.unsuppressed
+ ?: checkFilters(BUBBLE, entry)
+ ?: checkSuppressInterruptions(entry)
+ ?: checkSuppressAwakeInterruptions(entry)
+ ?: LoggableDecision.unsuppressed
private fun logDecision(
type: VisualInterruptionType,
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationCompactMessagingTemplateViewWrapper.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationCompactMessagingTemplateViewWrapper.kt
index bb40b5622159..20f04f950fb9 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationCompactMessagingTemplateViewWrapper.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationCompactMessagingTemplateViewWrapper.kt
@@ -32,6 +32,12 @@ constructor(ctx: Context, view: View, row: ExpandableNotificationRow) :
private var conversationIconView: CachingIconView? = null
private var expandBtn: View? = null
+ private var titleView: View? = null
+ private var headerTextSecondary: View? = null
+ private var subText: View? = null
+ private var facePileTop: View? = null
+ private var facePileBottom: View? = null
+ private var facePileBottomBg: View? = null
override fun onContentUpdated(row: ExpandableNotificationRow?) {
resolveViews()
super.onContentUpdated(row)
@@ -39,6 +45,14 @@ constructor(ctx: Context, view: View, row: ExpandableNotificationRow) :
private fun resolveViews() {
conversationIconView = compactMessagingView.requireViewById(R.id.conversation_icon)
+ titleView = compactMessagingView.findViewById(R.id.title)
+ headerTextSecondary = compactMessagingView.findViewById(R.id.header_text_secondary)
+ subText = compactMessagingView.findViewById(R.id.header_text)
+ facePileTop = compactMessagingView.findViewById(R.id.conversation_face_pile_top)
+ facePileBottom = compactMessagingView.findViewById(R.id.conversation_face_pile_bottom)
+ facePileBottomBg =
+ compactMessagingView.findViewById(R.id.conversation_face_pile_bottom_background)
+
expandBtn = compactMessagingView.requireViewById(R.id.expand_button)
}
@@ -47,6 +61,12 @@ constructor(ctx: Context, view: View, row: ExpandableNotificationRow) :
addViewsTransformingToSimilar(
conversationIconView,
+ titleView,
+ headerTextSecondary,
+ subText,
+ facePileTop,
+ facePileBottom,
+ facePileBottomBg,
expandBtn,
)
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationSection.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationSection.java
index 2d0395a2f606..5a433a1f1a04 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationSection.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationSection.java
@@ -16,17 +16,6 @@
package com.android.systemui.statusbar.notification.stack;
-import static com.android.systemui.statusbar.notification.stack.NotificationPriorityBucketKt.BUCKET_MEDIA_CONTROLS;
-
-import android.animation.Animator;
-import android.animation.AnimatorListenerAdapter;
-import android.animation.ObjectAnimator;
-import android.animation.PropertyValuesHolder;
-import android.graphics.Rect;
-import android.view.View;
-import android.view.animation.Interpolator;
-
-import com.android.app.animation.Interpolators;
import com.android.systemui.statusbar.notification.row.ExpandableView;
/**
@@ -35,165 +24,18 @@ import com.android.systemui.statusbar.notification.row.ExpandableView;
*/
public class NotificationSection {
private @PriorityBucket final int mBucket;
- private final View mOwningView;
- private final Rect mBounds = new Rect();
- private final Rect mCurrentBounds = new Rect(-1, -1, -1, -1);
- private final Rect mStartAnimationRect = new Rect();
- private final Rect mEndAnimationRect = new Rect();
- private ObjectAnimator mTopAnimator = null;
- private ObjectAnimator mBottomAnimator = null;
private ExpandableView mFirstVisibleChild;
private ExpandableView mLastVisibleChild;
- NotificationSection(View owningView, @PriorityBucket int bucket) {
- mOwningView = owningView;
+ NotificationSection(@PriorityBucket int bucket) {
mBucket = bucket;
}
- public void cancelAnimators() {
- if (mBottomAnimator != null) {
- mBottomAnimator.cancel();
- }
- if (mTopAnimator != null) {
- mTopAnimator.cancel();
- }
- }
-
- public Rect getCurrentBounds() {
- return mCurrentBounds;
- }
-
- public Rect getBounds() {
- return mBounds;
- }
-
- public boolean didBoundsChange() {
- return !mCurrentBounds.equals(mBounds);
- }
-
- public boolean areBoundsAnimating() {
- return mBottomAnimator != null || mTopAnimator != null;
- }
-
@PriorityBucket
public int getBucket() {
return mBucket;
}
- public void startBackgroundAnimation(boolean animateTop, boolean animateBottom) {
- // Left and right bounds are always applied immediately.
- mCurrentBounds.left = mBounds.left;
- mCurrentBounds.right = mBounds.right;
- startBottomAnimation(animateBottom);
- startTopAnimation(animateTop);
- }
-
-
- private void startTopAnimation(boolean animate) {
- int previousEndValue = mEndAnimationRect.top;
- int newEndValue = mBounds.top;
- ObjectAnimator previousAnimator = mTopAnimator;
- if (previousAnimator != null && previousEndValue == newEndValue) {
- return;
- }
- if (!animate) {
- // just a local update was performed
- if (previousAnimator != null) {
- // we need to increase all animation keyframes of the previous animator by the
- // relative change to the end value
- int previousStartValue = mStartAnimationRect.top;
- PropertyValuesHolder[] values = previousAnimator.getValues();
- values[0].setIntValues(previousStartValue, newEndValue);
- mStartAnimationRect.top = previousStartValue;
- mEndAnimationRect.top = newEndValue;
- previousAnimator.setCurrentPlayTime(previousAnimator.getCurrentPlayTime());
- return;
- } else {
- // no new animation needed, let's just apply the value
- setBackgroundTop(newEndValue);
- return;
- }
- }
- if (previousAnimator != null) {
- previousAnimator.cancel();
- }
- ObjectAnimator animator = ObjectAnimator.ofInt(this, "backgroundTop",
- mCurrentBounds.top, newEndValue);
- Interpolator interpolator = Interpolators.FAST_OUT_SLOW_IN;
- animator.setInterpolator(interpolator);
- animator.setDuration(StackStateAnimator.ANIMATION_DURATION_STANDARD);
- // remove the tag when the animation is finished
- animator.addListener(new AnimatorListenerAdapter() {
- @Override
- public void onAnimationEnd(Animator animation) {
- mStartAnimationRect.top = -1;
- mEndAnimationRect.top = -1;
- mTopAnimator = null;
- }
- });
- animator.start();
- mStartAnimationRect.top = mCurrentBounds.top;
- mEndAnimationRect.top = newEndValue;
- mTopAnimator = animator;
- }
-
- private void startBottomAnimation(boolean animate) {
- int previousStartValue = mStartAnimationRect.bottom;
- int previousEndValue = mEndAnimationRect.bottom;
- int newEndValue = mBounds.bottom;
- ObjectAnimator previousAnimator = mBottomAnimator;
- if (previousAnimator != null && previousEndValue == newEndValue) {
- return;
- }
- if (!animate) {
- // just a local update was performed
- if (previousAnimator != null) {
- // we need to increase all animation keyframes of the previous animator by the
- // relative change to the end value
- PropertyValuesHolder[] values = previousAnimator.getValues();
- values[0].setIntValues(previousStartValue, newEndValue);
- mStartAnimationRect.bottom = previousStartValue;
- mEndAnimationRect.bottom = newEndValue;
- previousAnimator.setCurrentPlayTime(previousAnimator.getCurrentPlayTime());
- return;
- } else {
- // no new animation needed, let's just apply the value
- setBackgroundBottom(newEndValue);
- return;
- }
- }
- if (previousAnimator != null) {
- previousAnimator.cancel();
- }
- ObjectAnimator animator = ObjectAnimator.ofInt(this, "backgroundBottom",
- mCurrentBounds.bottom, newEndValue);
- Interpolator interpolator = Interpolators.FAST_OUT_SLOW_IN;
- animator.setInterpolator(interpolator);
- animator.setDuration(StackStateAnimator.ANIMATION_DURATION_STANDARD);
- // remove the tag when the animation is finished
- animator.addListener(new AnimatorListenerAdapter() {
- @Override
- public void onAnimationEnd(Animator animation) {
- mStartAnimationRect.bottom = -1;
- mEndAnimationRect.bottom = -1;
- mBottomAnimator = null;
- }
- });
- animator.start();
- mStartAnimationRect.bottom = mCurrentBounds.bottom;
- mEndAnimationRect.bottom = newEndValue;
- mBottomAnimator = animator;
- }
-
- private void setBackgroundTop(int top) {
- mCurrentBounds.top = top;
- mOwningView.invalidate();
- }
-
- private void setBackgroundBottom(int bottom) {
- mCurrentBounds.bottom = bottom;
- mOwningView.invalidate();
- }
public ExpandableView getFirstVisibleChild() {
return mFirstVisibleChild;
@@ -215,91 +57,4 @@ public class NotificationSection {
return changed;
}
- public void resetCurrentBounds() {
- mCurrentBounds.set(mBounds);
- }
-
- /**
- * Returns true if {@code top} is equal to the top of this section (if not currently animating)
- * or where the top of this section will be when animation completes.
- */
- public boolean isTargetTop(int top) {
- return (mTopAnimator == null && mCurrentBounds.top == top)
- || (mTopAnimator != null && mEndAnimationRect.top == top);
- }
-
- /**
- * Returns true if {@code bottom} is equal to the bottom of this section (if not currently
- * animating) or where the bottom of this section will be when animation completes.
- */
- public boolean isTargetBottom(int bottom) {
- return (mBottomAnimator == null && mCurrentBounds.bottom == bottom)
- || (mBottomAnimator != null && mEndAnimationRect.bottom == bottom);
- }
-
- /**
- * Update the bounds of this section based on it's views
- *
- * @param minTopPosition the minimum position that the top needs to have
- * @param minBottomPosition the minimum position that the bottom needs to have
- * @return the position of the new bottom
- */
- public int updateBounds(int minTopPosition, int minBottomPosition,
- boolean shiftBackgroundWithFirst) {
- int top = minTopPosition;
- int bottom = minTopPosition;
- ExpandableView firstView = getFirstVisibleChild();
- if (firstView != null) {
- // Round Y up to avoid seeing the background during animation
- int finalTranslationY = (int) Math.ceil(ViewState.getFinalTranslationY(firstView));
- // TODO: look into the already animating part
- int newTop;
- if (isTargetTop(finalTranslationY)) {
- // we're ending up at the same location as we are now, let's just skip the
- // animation
- newTop = finalTranslationY;
- } else {
- newTop = (int) Math.ceil(firstView.getTranslationY());
- }
- top = Math.max(newTop, top);
- if (firstView.showingPulsing()) {
- // If we're pulsing, the notification can actually go below!
- bottom = Math.max(bottom, finalTranslationY
- + ExpandableViewState.getFinalActualHeight(firstView));
- if (shiftBackgroundWithFirst) {
- mBounds.left += Math.max(firstView.getTranslation(), 0);
- mBounds.right += Math.min(firstView.getTranslation(), 0);
- }
- }
- }
- ExpandableView lastView = getLastVisibleChild();
- if (lastView != null) {
- float finalTranslationY = ViewState.getFinalTranslationY(lastView);
- int finalHeight = ExpandableViewState.getFinalActualHeight(lastView);
- // Round Y down to avoid seeing the background during animation
- int finalBottom = (int) Math.floor(
- finalTranslationY + finalHeight - lastView.getClipBottomAmount());
- int newBottom;
- if (isTargetBottom(finalBottom)) {
- // we're ending up at the same location as we are now, lets just skip the animation
- newBottom = finalBottom;
- } else {
- newBottom = (int) (lastView.getTranslationY() + lastView.getActualHeight()
- - lastView.getClipBottomAmount());
- // The background can never be lower than the end of the last view
- minBottomPosition = (int) Math.min(
- lastView.getTranslationY() + lastView.getActualHeight(),
- minBottomPosition);
- }
- bottom = Math.max(bottom, Math.max(newBottom, minBottomPosition));
- }
- bottom = Math.max(top, bottom);
- mBounds.top = top;
- mBounds.bottom = bottom;
- return bottom;
- }
-
- public boolean needsBackground() {
- return mFirstVisibleChild != null && mBucket != BUCKET_MEDIA_CONTROLS;
- }
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationSectionsManager.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationSectionsManager.kt
index d269eda6795a..3400ad107133 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationSectionsManager.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationSectionsManager.kt
@@ -40,7 +40,9 @@ import javax.inject.Inject
*
* TODO: Move remaining sections logic from NSSL into this class.
*/
-class NotificationSectionsManager @Inject internal constructor(
+class NotificationSectionsManager
+@Inject
+internal constructor(
private val configurationController: ConfigurationController,
private val keyguardMediaController: KeyguardMediaController,
private val sectionsFeatureManager: NotificationSectionsFeatureManager,
@@ -52,11 +54,12 @@ class NotificationSectionsManager @Inject internal constructor(
@SilentHeader private val silentHeaderController: SectionHeaderController
) : SectionProvider {
- private val configurationListener = object : ConfigurationController.ConfigurationListener {
- override fun onLocaleListChanged() {
- reinflateViews()
+ private val configurationListener =
+ object : ConfigurationController.ConfigurationListener {
+ override fun onLocaleListChanged() {
+ reinflateViews()
+ }
}
- }
private lateinit var parent: NotificationStackScrollLayout
private var initialized = false
@@ -81,7 +84,7 @@ class NotificationSectionsManager @Inject internal constructor(
val mediaControlsView: MediaContainerView?
get() = mediaContainerController.mediaContainerView
- /** Must be called before use. */
+ /** Must be called before use. */
fun initialize(parent: NotificationStackScrollLayout) {
check(!initialized) { "NotificationSectionsManager already initialized" }
initialized = true
@@ -91,13 +94,12 @@ class NotificationSectionsManager @Inject internal constructor(
}
fun createSectionsForBuckets(): Array<NotificationSection> =
- sectionsFeatureManager.getNotificationBuckets()
- .map { NotificationSection(parent, it) }
- .toTypedArray()
+ sectionsFeatureManager
+ .getNotificationBuckets()
+ .map { NotificationSection(it) }
+ .toTypedArray()
- /**
- * Reinflates the entire notification header, including all decoration views.
- */
+ /** Reinflates the entire notification header, including all decoration views. */
fun reinflateViews() {
silentHeaderController.reinflateView(parent)
alertingHeaderController.reinflateView(parent)
@@ -108,44 +110,44 @@ class NotificationSectionsManager @Inject internal constructor(
}
override fun beginsSection(view: View, previous: View?): Boolean =
- view === silentHeaderView ||
+ view === silentHeaderView ||
view === mediaControlsView ||
view === peopleHeaderView ||
view === alertingHeaderView ||
view === incomingHeaderView ||
getBucket(view) != getBucket(previous)
- private fun getBucket(view: View?): Int? = when {
- view === silentHeaderView -> BUCKET_SILENT
- view === incomingHeaderView -> BUCKET_HEADS_UP
- view === mediaControlsView -> BUCKET_MEDIA_CONTROLS
- view === peopleHeaderView -> BUCKET_PEOPLE
- view === alertingHeaderView -> BUCKET_ALERTING
- view is ExpandableNotificationRow -> view.entry.bucket
- else -> null
- }
+ private fun getBucket(view: View?): Int? =
+ when {
+ view === silentHeaderView -> BUCKET_SILENT
+ view === incomingHeaderView -> BUCKET_HEADS_UP
+ view === mediaControlsView -> BUCKET_MEDIA_CONTROLS
+ view === peopleHeaderView -> BUCKET_PEOPLE
+ view === alertingHeaderView -> BUCKET_ALERTING
+ view is ExpandableNotificationRow -> view.entry.bucket
+ else -> null
+ }
private sealed class SectionBounds {
- data class Many(
- val first: ExpandableView,
- val last: ExpandableView
- ) : SectionBounds()
+ data class Many(val first: ExpandableView, val last: ExpandableView) : SectionBounds()
data class One(val lone: ExpandableView) : SectionBounds()
object None : SectionBounds()
- fun addNotif(notif: ExpandableView): SectionBounds = when (this) {
- is None -> One(notif)
- is One -> Many(lone, notif)
- is Many -> copy(last = notif)
- }
+ fun addNotif(notif: ExpandableView): SectionBounds =
+ when (this) {
+ is None -> One(notif)
+ is One -> Many(lone, notif)
+ is Many -> copy(last = notif)
+ }
- fun updateSection(section: NotificationSection): Boolean = when (this) {
- is None -> section.setFirstAndLastVisibleChildren(null, null)
- is One -> section.setFirstAndLastVisibleChildren(lone, lone)
- is Many -> section.setFirstAndLastVisibleChildren(first, last)
- }
+ fun updateSection(section: NotificationSection): Boolean =
+ when (this) {
+ is None -> section.setFirstAndLastVisibleChildren(null, null)
+ is One -> section.setFirstAndLastVisibleChildren(lone, lone)
+ is Many -> section.setFirstAndLastVisibleChildren(first, last)
+ }
private fun NotificationSection.setFirstAndLastVisibleChildren(
first: ExpandableView?,
@@ -167,17 +169,19 @@ class NotificationSectionsManager @Inject internal constructor(
children: List<ExpandableView>
): Boolean {
// Create mapping of bucket to section
- val sectionBounds = children.asSequence()
+ val sectionBounds =
+ children
+ .asSequence()
// Group children by bucket
.groupingBy {
getBucket(it)
- ?: throw IllegalArgumentException("Cannot find section bucket for view")
+ ?: throw IllegalArgumentException("Cannot find section bucket for view")
}
// Combine each bucket into a SectionBoundary
.foldToSparseArray(
- SectionBounds.None,
- size = sections.size,
- operation = SectionBounds::addNotif
+ SectionBounds.None,
+ size = sections.size,
+ operation = SectionBounds::addNotif
)
// Build a set of the old first/last Views of the sections
@@ -185,11 +189,12 @@ class NotificationSectionsManager @Inject internal constructor(
val oldLastChildren = sections.mapNotNull { it.lastVisibleChild }.toSet().toMutableSet()
// Update each section with the associated boundary, tracking if there was a change
- val changed = sections.fold(false) { changed, section ->
- val bounds = sectionBounds[section.bucket] ?: SectionBounds.None
- val isSectionChanged = bounds.updateSection(section)
- isSectionChanged || changed
- }
+ val changed =
+ sections.fold(false) { changed, section ->
+ val bounds = sectionBounds[section.bucket] ?: SectionBounds.None
+ val isSectionChanged = bounds.updateSection(section)
+ isSectionChanged || changed
+ }
val newFirstChildren = sections.mapNotNull { it.firstVisibleChild }
val newLastChildren = sections.mapNotNull { it.lastVisibleChild }
@@ -229,16 +234,18 @@ class NotificationSectionsManager @Inject internal constructor(
private fun logSections(sections: Array<NotificationSection>) {
for (i in sections.indices) {
val s = sections[i]
- val fs = when (val first = s.firstVisibleChild) {
- null -> "(null)"
- is ExpandableNotificationRow -> first.entry.key
- else -> Integer.toHexString(System.identityHashCode(first))
- }
- val ls = when (val last = s.lastVisibleChild) {
- null -> "(null)"
- is ExpandableNotificationRow -> last.entry.key
- else -> Integer.toHexString(System.identityHashCode(last))
- }
+ val fs =
+ when (val first = s.firstVisibleChild) {
+ null -> "(null)"
+ is ExpandableNotificationRow -> first.entry.key
+ else -> Integer.toHexString(System.identityHashCode(first))
+ }
+ val ls =
+ when (val last = s.lastVisibleChild) {
+ null -> "(null)"
+ is ExpandableNotificationRow -> last.entry.key
+ else -> Integer.toHexString(System.identityHashCode(last))
+ }
Log.d(TAG, "updateSections: f=$fs s=$i")
Log.d(TAG, "updateSections: l=$ls s=$i")
}
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 17b54c8f3970..a9d7cc003b79 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
@@ -2974,7 +2974,7 @@ public class NotificationStackScrollLayout
private void updateFirstAndLastBackgroundViews() {
ExpandableView lastChild = getLastChildWithBackground();
- boolean sectionViewsChanged = mSectionsManager.updateFirstAndLastViewsForAllSections(
+ mSectionsManager.updateFirstAndLastViewsForAllSections(
mSections, getChildrenWithBackground());
mAmbientState.setLastVisibleBackgroundChild(lastChild);
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 c1c63cdec448..6a3055f4b4cd 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
@@ -23,6 +23,7 @@ import static com.android.app.animation.Interpolators.STANDARD;
import static com.android.internal.jank.InteractionJankMonitor.CUJ_NOTIFICATION_SHADE_SCROLL_FLING;
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.statusbar.StatusBarState.KEYGUARD;
import static com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayout.OnEmptySpaceClickListener;
import static com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayout.OnOverscrollTopChangedListener;
@@ -597,7 +598,7 @@ public class NotificationStackScrollLayoutController implements Dumpable {
ev.getY(),
true /* requireMinHeight */,
false /* ignoreDecors */,
- true /* ignoreWidth */);
+ !confineNotificationTouchToViewWidth() /* ignoreWidth */);
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/StackScrollAlgorithm.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithm.java
index 0fcfc4b4b2c8..7bbaf8534ae2 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithm.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/StackScrollAlgorithm.java
@@ -400,6 +400,7 @@ public class StackScrollAlgorithm {
*/
public boolean isCyclingOut(ExpandableNotificationRow row, AmbientState ambientState) {
if (!NotificationHeadsUpCycling.isEnabled()) return false;
+ if (row.getEntry() == null) return false;
String cyclingOutKey = ambientState.getAvalanchePreviousHunKey();
return row.getEntry().getKey().equals(cyclingOutKey);
}
@@ -409,6 +410,7 @@ public class StackScrollAlgorithm {
*/
public boolean isCyclingIn(ExpandableNotificationRow row, AmbientState ambientState) {
if (!NotificationHeadsUpCycling.isEnabled()) return false;
+ if (row.getEntry() == null) return false;
String cyclingInKey = ambientState.getAvalancheShowingHunKey();
return row.getEntry().getKey().equals(cyclingInKey);
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/NotificationListViewModel.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/NotificationListViewModel.kt
index 3a89630ebe77..b54f9c4c6d32 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/NotificationListViewModel.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/NotificationListViewModel.kt
@@ -18,7 +18,6 @@ package com.android.systemui.statusbar.notification.stack.ui.viewmodel
import com.android.systemui.dagger.qualifiers.Background
import com.android.systemui.dump.DumpManager
-import com.android.systemui.keyguard.domain.interactor.KeyguardInteractor
import com.android.systemui.shade.domain.interactor.ShadeInteractor
import com.android.systemui.statusbar.domain.interactor.RemoteInputInteractor
import com.android.systemui.statusbar.notification.domain.interactor.ActiveNotificationsInteractor
@@ -59,7 +58,6 @@ constructor(
activeNotificationsInteractor: ActiveNotificationsInteractor,
notificationStackInteractor: NotificationStackInteractor,
private val headsUpNotificationInteractor: HeadsUpNotificationInteractor,
- keyguardInteractor: KeyguardInteractor,
remoteInputInteractor: RemoteInputInteractor,
seenNotificationsInteractor: SeenNotificationsInteractor,
shadeInteractor: ShadeInteractor,
@@ -277,11 +275,12 @@ constructor(
if (NotificationsHeadsUpRefactor.isUnexpectedlyInLegacyMode()) {
flowOf(false)
} else {
- combine(keyguardInteractor.isKeyguardShowing, shadeInteractor.isShadeFullyExpanded) {
- (isKeyguardShowing, isShadeFullyExpanded) ->
- // TODO(b/325936094) use isShadeFullyCollapsed instead
- !isKeyguardShowing && !isShadeFullyExpanded
- }
+ combine(
+ notificationStackInteractor.isShowingOnLockscreen,
+ shadeInteractor.isShadeFullyCollapsed
+ ) { (isKeyguardShowing, isShadeFullyCollapsed) ->
+ !isKeyguardShowing && isShadeFullyCollapsed
+ }
.dumpWhileCollecting("headsUpAnimationsEnabled")
}
}
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 4c3c7d56df50..11feb971db6d 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/HeadsUpAppearanceController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/HeadsUpAppearanceController.java
@@ -354,6 +354,7 @@ public class HeadsUpAppearanceController extends ViewController<HeadsUpStatusBar
* since the headsUp manager might not have notified us yet of the state change.
*
* @return if the heads up status bar view should be shown
+ * @deprecated use HeadsUpNotificationInteractor.showHeadsUpStatusBar instead.
*/
public boolean shouldBeVisible() {
boolean notificationsShown = !mWakeUpCoordinator.getNotificationsFullyHidden();
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardIndicationTextView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardIndicationTextView.java
index c4e0f31c9c74..16e9c717935c 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardIndicationTextView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardIndicationTextView.java
@@ -219,6 +219,7 @@ public class KeyguardIndicationTextView extends TextView {
}
private void setNextIndication() {
+ boolean forceAssertiveAccessibilityLiveRegion = false;
if (mKeyguardIndicationInfo != null) {
// First, update the style.
// If a background is set on the text, we don't want shadow on the text
@@ -239,8 +240,16 @@ public class KeyguardIndicationTextView extends TextView {
}
}
setCompoundDrawablesRelativeWithIntrinsicBounds(icon, null, null, null);
+ forceAssertiveAccessibilityLiveRegion =
+ mKeyguardIndicationInfo.getForceAssertiveAccessibilityLiveRegion();
+ }
+ if (!forceAssertiveAccessibilityLiveRegion) {
+ setAccessibilityLiveRegion(ACCESSIBILITY_LIVE_REGION_NONE);
}
setText(mMessage);
+ if (forceAssertiveAccessibilityLiveRegion) {
+ setAccessibilityLiveRegion(ACCESSIBILITY_LIVE_REGION_ASSERTIVE);
+ }
if (mAlwaysAnnounceText) {
announceForAccessibility(mMessage);
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardStatusBarViewController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardStatusBarViewController.java
index 2b26e3f12ef7..f767262dbd4e 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardStatusBarViewController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardStatusBarViewController.java
@@ -660,10 +660,14 @@ public class KeyguardStatusBarViewController extends ViewController<KeyguardStat
* whether heads up is visible.
*/
public void updateForHeadsUp() {
+ if (SceneContainerFlag.isUnexpectedlyInLegacyMode()) {
+ // [KeyguardStatusBarViewBinder] handles visibility changes due to heads up states.
+ return;
+ }
updateForHeadsUp(true);
}
- // TODO(b/328579846) bind the StatusBar visibility to heads up events
+ @VisibleForTesting
void updateForHeadsUp(boolean animate) {
boolean showingKeyguardHeadsUp =
isKeyguardShowing() && mShadeViewStateProvider.shouldHeadsUpBeVisible();
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
index fa88be5b638b..5bbc3bd92543 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java
@@ -655,13 +655,8 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb
* device state and touch handling. The bouncer MUST have been notified that it is about to
* show if any subsequent events are to be handled.
*/
- if (beginShowingBouncer(event)) {
- if (SceneContainerFlag.isEnabled()) {
- mSceneInteractorLazy.get().changeScene(
- Scenes.Bouncer, "StatusBarKeyguardViewManager.onPanelExpansionChanged");
- } else {
- mPrimaryBouncerInteractor.show(/* isScrimmed= */false);
- }
+ if (!SceneContainerFlag.isEnabled() && beginShowingBouncer(event)) {
+ mPrimaryBouncerInteractor.show(/* isScrimmed= */false);
}
if (!primaryBouncerIsOrWillBeShowing()) {
@@ -695,11 +690,6 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb
public void show(Bundle options) {
Trace.beginSection("StatusBarKeyguardViewManager#show");
mNotificationShadeWindowController.setKeyguardShowing(true);
- if (SceneContainerFlag.isEnabled()) {
- // TODO(b/336581871): add sceneState?
- mSceneInteractorLazy.get().changeScene(
- Scenes.Lockscreen, "StatusBarKeyguardViewManager.show");
- }
mKeyguardStateController.notifyKeyguardState(true, mKeyguardStateController.isOccluded());
reset(true /* hideBouncerWhenShowing */);
SysUiStatsLog.write(SysUiStatsLog.KEYGUARD_STATE_CHANGED,
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 a858fb079d72..e5c86c8bc7e9 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
@@ -548,6 +548,7 @@ public class CollapsedStatusBarFragment extends Fragment implements CommandQueue
private StatusBarVisibilityModel calculateInternalModel(
StatusBarVisibilityModel externalModel) {
+ // TODO(b/328393714) use HeadsUpNotificationInteractor.showHeadsUpStatusBar instead.
boolean headsUpVisible =
mStatusBarFragmentComponent.getHeadsUpAppearanceController().shouldBeVisible();
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/ui/viewmodel/KeyguardStatusBarViewModel.kt b/packages/SystemUI/src/com/android/systemui/statusbar/ui/viewmodel/KeyguardStatusBarViewModel.kt
index 5da01e23e268..3e0118007c3c 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/ui/viewmodel/KeyguardStatusBarViewModel.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/ui/viewmodel/KeyguardStatusBarViewModel.kt
@@ -22,6 +22,7 @@ import com.android.systemui.dagger.qualifiers.Application
import com.android.systemui.keyguard.domain.interactor.KeyguardInteractor
import com.android.systemui.keyguard.shared.model.StatusBarState
import com.android.systemui.statusbar.domain.interactor.KeyguardStatusBarInteractor
+import com.android.systemui.statusbar.notification.domain.interactor.HeadsUpNotificationInteractor
import com.android.systemui.statusbar.policy.BatteryController
import com.android.systemui.statusbar.policy.BatteryController.BatteryStateChangeCallback
import javax.inject.Inject
@@ -46,6 +47,7 @@ class KeyguardStatusBarViewModel
@Inject
constructor(
@Application scope: CoroutineScope,
+ headsUpNotificationInteractor: HeadsUpNotificationInteractor,
keyguardInteractor: KeyguardInteractor,
keyguardStatusBarInteractor: KeyguardStatusBarInteractor,
batteryController: BatteryController,
@@ -55,8 +57,9 @@ constructor(
combine(
keyguardInteractor.isDozing,
keyguardInteractor.statusBarState,
- ) { isDozing, statusBarState ->
- !isDozing && statusBarState == StatusBarState.KEYGUARD
+ headsUpNotificationInteractor.showHeadsUpStatusBar,
+ ) { isDozing, statusBarState, showHeadsUpStatusBar ->
+ !isDozing && statusBarState == StatusBarState.KEYGUARD && !showHeadsUpStatusBar
}
.stateIn(scope, SharingStarted.WhileSubscribed(), false)
diff --git a/packages/SystemUI/src/com/android/systemui/theme/CustomDynamicColors.java b/packages/SystemUI/src/com/android/systemui/theme/CustomDynamicColors.java
deleted file mode 100644
index efeb2f919b56..000000000000
--- a/packages/SystemUI/src/com/android/systemui/theme/CustomDynamicColors.java
+++ /dev/null
@@ -1,322 +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.theme;
-
-import com.google.ux.material.libmonet.dynamiccolor.ContrastCurve;
-import com.google.ux.material.libmonet.dynamiccolor.DynamicColor;
-import com.google.ux.material.libmonet.dynamiccolor.MaterialDynamicColors;
-import com.google.ux.material.libmonet.dynamiccolor.ToneDeltaPair;
-import com.google.ux.material.libmonet.dynamiccolor.TonePolarity;
-
-class CustomDynamicColors {
- private final MaterialDynamicColors mMdc;
-
- CustomDynamicColors(boolean isExtendedFidelity) {
- this.mMdc = new MaterialDynamicColors(isExtendedFidelity);
- }
-
- // CLOCK COLORS
-
- public DynamicColor widgetBackground() {
- return new DynamicColor(
- /* name= */ "widget_background",
- /* palette= */ (s) -> s.primaryPalette,
- /* tone= */ (s) -> s.isDark ? 20.0 : 95.0,
- /* isBackground= */ true,
- /* background= */ null,
- /* secondBackground= */ null,
- /* contrastCurve= */ null,
- /* toneDeltaPair= */ null);
- }
-
- public DynamicColor clockHour() {
- return new DynamicColor(
- /* name= */ "clock_hour",
- /* palette= */ (s) -> s.secondaryPalette,
- /* tone= */ (s) -> s.isDark ? 30.0 : 60.0,
- /* isBackground= */ false,
- /* background= */ (s) -> widgetBackground(),
- /* secondBackground= */ null,
- /* contrastCurve= */ new ContrastCurve(1.0, 4.0, 5.0, 15.0),
- /* toneDeltaPair= */
- (s) -> new ToneDeltaPair(clockHour(), clockMinute(), 10.0, TonePolarity.DARKER,
- false));
- }
-
- public DynamicColor clockMinute() {
- return new DynamicColor(
- /* name= */ "clock_minute",
- /* palette= */ (s) -> s.primaryPalette,
- /* tone= */ (s) -> s.isDark ? 40.0 : 90.0,
- /* isBackground= */ false,
- /* background= */ (s) -> widgetBackground(),
- /* secondBackground= */ null,
- /* contrastCurve= */ new ContrastCurve(1.0, 6.5, 10.0, 15.0),
- /* toneDeltaPair= */ null);
- }
-
- public DynamicColor clockSecond() {
- return new DynamicColor(
- /* name= */ "clock_second",
- /* palette= */ (s) -> s.tertiaryPalette,
- /* tone= */ (s) -> s.isDark ? 40.0 : 90.0,
- /* isBackground= */ false,
- /* background= */ (s) -> widgetBackground(),
- /* secondBackground= */ null,
- /* contrastCurve= */ new ContrastCurve(1.0, 5.0, 70.0, 11.0),
- /* toneDeltaPair= */ null);
- }
-
- public DynamicColor weatherTemp() {
- return new DynamicColor(
- /* name= */ "clock_second",
- /* palette= */ (s) -> s.primaryPalette,
- /* tone= */ (s) -> s.isDark ? 55.0 : 80.0,
- /* isBackground= */ false,
- /* background= */ (s) -> widgetBackground(),
- /* secondBackground= */ null,
- /* contrastCurve= */ new ContrastCurve(1.0, 5.0, 70.0, 11.0),
- /* toneDeltaPair= */ null);
- }
-
- // THEME APP ICONS
-
- public DynamicColor themeApp() {
- return new DynamicColor(
- /* name= */ "theme_app",
- /* palette= */ (s) -> s.primaryPalette,
- /* tone= */ (s) -> s.isDark ? 90.0 : 30.0, // Adjusted values
- /* isBackground= */ true,
- /* background= */ null,
- /* secondBackground= */ null,
- /* contrastCurve= */ null,
- /* toneDeltaPair= */ null);
- }
-
- public DynamicColor onThemeApp() {
- return new DynamicColor(
- /* name= */ "on_theme_app",
- /* palette= */ (s) -> s.primaryPalette,
- /* tone= */ (s) -> s.isDark ? 40.0 : 80.0, // Adjusted values
- /* isBackground= */ false,
- /* background= */ (s) -> themeApp(),
- /* secondBackground= */ null,
- /* contrastCurve= */ new ContrastCurve(1.0, 3.0, 7.0, 10.0),
- /* toneDeltaPair= */ null);
- }
-
- public DynamicColor themeAppRing() {
- return new DynamicColor(
- /* name= */ "theme_app_ring",
- /* palette= */ (s) -> s.primaryPalette,
- /* tone= */ (s) -> 70.0,
- /* isBackground= */ true,
- /* background= */ null,
- /* secondBackground= */ null,
- /* contrastCurve= */ new ContrastCurve(1.0, 1.0, 1.0, 1.0),
- /* toneDeltaPair= */ null);
- }
-
- public DynamicColor themeNotif() {
- return new DynamicColor(
- /* name= */ "theme_notif",
- /* palette= */ (s) -> s.tertiaryPalette,
- /* tone= */ (s) -> s.isDark ? 80.0 : 90.0,
- /* isBackground= */ false,
- /* background= */ (s) -> themeAppRing(),
- /* secondBackground= */ null,
- /* contrastCurve= */ new ContrastCurve(1.0, 1.0, 1.0, 1.0),
- /* toneDeltaPair= */
- (s) -> new ToneDeltaPair(themeNotif(), themeAppRing(), 10.0, TonePolarity.NEARER,
- false));
- }
-
- // SUPER G COLORS
-
- public DynamicColor brandA() {
- return new DynamicColor(
- /* name= */ "brand_a",
- /* palette= */ (s) -> s.primaryPalette,
- /* tone= */ (s) -> s.isDark ? 40.0 : 80.0,
- /* isBackground= */ true,
- /* background= */ (s) -> mMdc.surfaceContainerLow(),
- /* secondBackground= */ null,
- /* contrastCurve= */ new ContrastCurve(1.0, 3.0, 7.0, 17.0),
- /* toneDeltaPair= */
- (s) -> new ToneDeltaPair(brandA(), brandB(), 10.0, TonePolarity.NEARER, false));
- }
-
- public DynamicColor brandB() {
- return new DynamicColor(
- /* name= */ "brand_b",
- /* palette= */ (s) -> s.secondaryPalette,
- /* tone= */ (s) -> s.isDark ? 70.0 : 98.0,
- /* isBackground= */ true,
- /* background= */ (s) -> mMdc.surfaceContainerLow(),
- /* secondBackground= */ null,
- /* contrastCurve= */ new ContrastCurve(1.0, 3.0, 3.0, 6.0),
- /* toneDeltaPair= */
- (s) -> new ToneDeltaPair(brandB(), brandC(), 10.0, TonePolarity.NEARER, false));
- }
-
- public DynamicColor brandC() {
- return new DynamicColor(
- /* name= */ "brand_c",
- /* palette= */ (s) -> s.primaryPalette,
- /* tone= */ (s) -> s.isDark ? 50.0 : 60.0,
- /* isBackground= */ false,
- /* background= */ (s) -> mMdc.surfaceContainerLow(),
- /* secondBackground= */ null,
- /* contrastCurve= */ new ContrastCurve(1.0, 3.0, 4.0, 9.0),
- /* toneDeltaPair= */
- (s) -> new ToneDeltaPair(brandC(), brandD(), 10.0, TonePolarity.NEARER, false));
- }
-
- public DynamicColor brandD() {
- return new DynamicColor(
- /* name= */ "brand_d",
- /* palette= */ (s) -> s.tertiaryPalette,
- /* tone= */ (s) -> s.isDark ? 59.0 : 90.0,
- /* isBackground= */ false,
- /* background= */ (s) -> mMdc.surfaceContainerLow(),
- /* secondBackground= */ null,
- /* contrastCurve= */ new ContrastCurve(1.0, 3.0, 4.0, 13.0),
- /* toneDeltaPair= */
- (s) -> new ToneDeltaPair(brandD(), brandA(), 10.0, TonePolarity.NEARER, false));
- }
-
- // QUICK SETTING TIILES
-
- public DynamicColor underSurface() {
- return new DynamicColor(
- /* name= */ "under_surface",
- /* palette= */ (s) -> s.primaryPalette,
- /* tone= */ (s) -> 0.0,
- /* isBackground= */ true,
- /* background= */ null,
- /* secondBackground= */ null,
- /* contrastCurve= */ null,
- /* toneDeltaPair= */ null);
- }
-
- public DynamicColor shadeActive() {
- return new DynamicColor(
- /* name= */ "shade_active",
- /* palette= */ (s) -> s.primaryPalette,
- /* tone= */ (s) -> 90.0,
- /* isBackground= */ false,
- /* background= */ (s) -> underSurface(),
- /* secondBackground= */ null,
- /* contrastCurve= */ new ContrastCurve(1.0, 3.0, 4.5, 7.0),
- /* toneDeltaPair= */
- (s) -> new ToneDeltaPair(shadeActive(), shadeInactive(), 30.0, TonePolarity.LIGHTER,
- false));
- }
-
- public DynamicColor onShadeActive() {
- return new DynamicColor(
- /* name= */ "on_shade_active",
- /* palette= */ (s) -> s.primaryPalette,
- /* tone= */ (s) -> 10.0,
- /* isBackground= */ false,
- /* background= */ (s) -> shadeActive(),
- /* secondBackground= */ null,
- /* contrastCurve= */ new ContrastCurve(1.0, 4.5, 7.0, 11.0),
- /* toneDeltaPair= */
- (s) -> new ToneDeltaPair(onShadeActive(), onShadeActiveVariant(), 20.0,
- TonePolarity.NEARER, false));
- }
-
- public DynamicColor onShadeActiveVariant() {
- return new DynamicColor(
- /* name= */ "on_shade_active_variant",
- /* palette= */ (s) -> s.primaryPalette,
- /* tone= */ (s) -> 30.0,
- /* isBackground= */ false,
- /* background= */ (s) -> shadeActive(),
- /* secondBackground= */ null,
- /* contrastCurve= */ new ContrastCurve(1.0, 4.5, 7.0, 11.0),
- /* toneDeltaPair= */
- (s) -> new ToneDeltaPair(onShadeActiveVariant(), onShadeActive(), 20.0,
- TonePolarity.NEARER, false));
- }
-
- public DynamicColor shadeInactive() {
- return new DynamicColor(
- /* name= */ "shade_inactive",
- /* palette= */ (s) -> s.neutralPalette,
- /* tone= */ (s) -> 20.0,
- /* isBackground= */ true,
- /* background= */ (s) -> underSurface(),
- /* secondBackground= */ null,
- /* contrastCurve= */ new ContrastCurve(1.0, 1.0, 1.0, 1.0),
- /* toneDeltaPair= */(s) -> new ToneDeltaPair(shadeInactive(), shadeDisabled(), 15.0,
- TonePolarity.LIGHTER, false));
- }
-
- public DynamicColor onShadeInactive() {
- return new DynamicColor(
- /* name= */ "on_shade_inactive",
- /* palette= */ (s) -> s.neutralVariantPalette,
- /* tone= */ (s) -> 90.0,
- /* isBackground= */ true,
- /* background= */ (s) -> shadeInactive(),
- /* secondBackground= */ null,
- /* contrastCurve= */ new ContrastCurve(1.0, 4.5, 7.0, 11.0),
- /* toneDeltaPair= */
- (s) -> new ToneDeltaPair(onShadeInactive(), onShadeInactiveVariant(), 10.0,
- TonePolarity.NEARER, false));
- }
-
- public DynamicColor onShadeInactiveVariant() {
- return new DynamicColor(
- /* name= */ "on_shade_inactive_variant",
- /* palette= */ (s) -> s.neutralVariantPalette,
- /* tone= */ (s) -> 80.0,
- /* isBackground= */ false,
- /* background= */ (s) -> shadeInactive(),
- /* secondBackground= */ null,
- /* contrastCurve= */ new ContrastCurve(1.0, 4.5, 7.0, 11.0),
- /* toneDeltaPair= */
- (s) -> new ToneDeltaPair(onShadeInactiveVariant(), onShadeInactive(), 10.0,
- TonePolarity.NEARER, false));
- }
-
- public DynamicColor shadeDisabled() {
- return new DynamicColor(
- /* name= */ "shade_disabled",
- /* palette= */ (s) -> s.neutralPalette,
- /* tone= */ (s) -> 4.0,
- /* isBackground= */ false,
- /* background= */ (s) -> underSurface(),
- /* secondBackground= */ null,
- /* contrastCurve= */ new ContrastCurve(1.0, 1.0, 1.0, 1.0),
- /* toneDeltaPair= */ null);
- }
-
- public DynamicColor overviewBackground() {
- return new DynamicColor(
- /* name= */ "overview_background",
- /* palette= */ (s) -> s.neutralVariantPalette,
- /* tone= */ (s) -> s.isDark ? 80.0 : 35.0,
- /* isBackground= */ true,
- /* background= */ null,
- /* secondBackground= */ null,
- /* contrastCurve= */null,
- /* toneDeltaPair= */ null);
- }
-}
diff --git a/packages/SystemUI/src/com/android/systemui/theme/DynamicColors.kt b/packages/SystemUI/src/com/android/systemui/theme/DynamicColors.kt
deleted file mode 100644
index 35187597bd83..000000000000
--- a/packages/SystemUI/src/com/android/systemui/theme/DynamicColors.kt
+++ /dev/null
@@ -1,135 +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.theme
-
-import android.util.Pair
-import com.google.ux.material.libmonet.dynamiccolor.DynamicColor
-import com.google.ux.material.libmonet.dynamiccolor.MaterialDynamicColors
-
-class DynamicColors {
- companion object {
- @JvmStatic
- fun allDynamicColorsMapped(isExtendedFidelity: Boolean): List<Pair<String, DynamicColor>> {
- val mdc = MaterialDynamicColors(isExtendedFidelity)
- return arrayListOf(
- Pair.create("primary_container", mdc.primaryContainer()),
- Pair.create("on_primary_container", mdc.onPrimaryContainer()),
- Pair.create("primary", mdc.primary()),
- Pair.create("on_primary", mdc.onPrimary()),
- Pair.create("secondary_container", mdc.secondaryContainer()),
- Pair.create("on_secondary_container", mdc.onSecondaryContainer()),
- Pair.create("secondary", mdc.secondary()),
- Pair.create("on_secondary", mdc.onSecondary()),
- Pair.create("tertiary_container", mdc.tertiaryContainer()),
- Pair.create("on_tertiary_container", mdc.onTertiaryContainer()),
- Pair.create("tertiary", mdc.tertiary()),
- Pair.create("on_tertiary", mdc.onTertiary()),
- Pair.create("background", mdc.background()),
- Pair.create("on_background", mdc.onBackground()),
- Pair.create("surface", mdc.surface()),
- Pair.create("on_surface", mdc.onSurface()),
- Pair.create("surface_container_low", mdc.surfaceContainerLow()),
- Pair.create("surface_container_lowest", mdc.surfaceContainerLowest()),
- Pair.create("surface_container", mdc.surfaceContainer()),
- Pair.create("surface_container_high", mdc.surfaceContainerHigh()),
- Pair.create("surface_container_highest", mdc.surfaceContainerHighest()),
- Pair.create("surface_bright", mdc.surfaceBright()),
- Pair.create("surface_dim", mdc.surfaceDim()),
- Pair.create("surface_variant", mdc.surfaceVariant()),
- Pair.create("on_surface_variant", mdc.onSurfaceVariant()),
- Pair.create("outline", mdc.outline()),
- Pair.create("outline_variant", mdc.outlineVariant()),
- Pair.create("error", mdc.error()),
- Pair.create("on_error", mdc.onError()),
- Pair.create("error_container", mdc.errorContainer()),
- Pair.create("on_error_container", mdc.onErrorContainer()),
- Pair.create("control_activated", mdc.controlActivated()),
- Pair.create("control_normal", mdc.controlNormal()),
- Pair.create("control_highlight", mdc.controlHighlight()),
- Pair.create("text_primary_inverse", mdc.textPrimaryInverse()),
- Pair.create(
- "text_secondary_and_tertiary_inverse",
- mdc.textSecondaryAndTertiaryInverse()
- ),
- Pair.create(
- "text_primary_inverse_disable_only",
- mdc.textPrimaryInverseDisableOnly()
- ),
- Pair.create(
- "text_secondary_and_tertiary_inverse_disabled",
- mdc.textSecondaryAndTertiaryInverseDisabled()
- ),
- Pair.create("text_hint_inverse", mdc.textHintInverse()),
- Pair.create("palette_key_color_primary", mdc.primaryPaletteKeyColor()),
- Pair.create("palette_key_color_secondary", mdc.secondaryPaletteKeyColor()),
- Pair.create("palette_key_color_tertiary", mdc.tertiaryPaletteKeyColor()),
- Pair.create("palette_key_color_neutral", mdc.neutralPaletteKeyColor()),
- Pair.create(
- "palette_key_color_neutral_variant",
- mdc.neutralVariantPaletteKeyColor()
- ),
- )
- }
-
- @JvmStatic
- fun getFixedColorsMapped(isExtendedFidelity: Boolean): List<Pair<String, DynamicColor>> {
- val mdc = MaterialDynamicColors(isExtendedFidelity)
- return arrayListOf(
- Pair.create("primary_fixed", mdc.primaryFixed()),
- Pair.create("primary_fixed_dim", mdc.primaryFixedDim()),
- Pair.create("on_primary_fixed", mdc.onPrimaryFixed()),
- Pair.create("on_primary_fixed_variant", mdc.onPrimaryFixedVariant()),
- Pair.create("secondary_fixed", mdc.secondaryFixed()),
- Pair.create("secondary_fixed_dim", mdc.secondaryFixedDim()),
- Pair.create("on_secondary_fixed", mdc.onSecondaryFixed()),
- Pair.create("on_secondary_fixed_variant", mdc.onSecondaryFixedVariant()),
- Pair.create("tertiary_fixed", mdc.tertiaryFixed()),
- Pair.create("tertiary_fixed_dim", mdc.tertiaryFixedDim()),
- Pair.create("on_tertiary_fixed", mdc.onTertiaryFixed()),
- Pair.create("on_tertiary_fixed_variant", mdc.onTertiaryFixedVariant()),
- )
- }
-
- @JvmStatic
- fun getCustomColorsMapped(isExtendedFidelity: Boolean): List<Pair<String, DynamicColor>> {
- val customMdc = CustomDynamicColors(isExtendedFidelity)
- return arrayListOf(
- Pair.create("widget_background", customMdc.widgetBackground()),
- Pair.create("clock_hour", customMdc.clockHour()),
- Pair.create("clock_minute", customMdc.clockMinute()),
- Pair.create("clock_second", customMdc.weatherTemp()),
- Pair.create("theme_app", customMdc.themeApp()),
- Pair.create("on_theme_app", customMdc.onThemeApp()),
- Pair.create("theme_app_ring", customMdc.themeAppRing()),
- Pair.create("on_theme_app_ring", customMdc.themeNotif()),
- Pair.create("brand_a", customMdc.brandA()),
- Pair.create("brand_b", customMdc.brandB()),
- Pair.create("brand_c", customMdc.brandC()),
- Pair.create("brand_d", customMdc.brandD()),
- Pair.create("under_surface", customMdc.underSurface()),
- Pair.create("shade_active", customMdc.shadeActive()),
- Pair.create("on_shade_active", customMdc.onShadeActive()),
- Pair.create("on_shade_active_variant", customMdc.onShadeActiveVariant()),
- Pair.create("shade_inactive", customMdc.shadeInactive()),
- Pair.create("on_shade_inactive", customMdc.onShadeInactive()),
- Pair.create("on_shade_inactive_variant", customMdc.onShadeInactiveVariant()),
- Pair.create("shade_disabled", customMdc.shadeDisabled()),
- Pair.create("overview_background", customMdc.overviewBackground())
- )
- }
- }
-}
diff --git a/packages/SystemUI/src/com/android/systemui/theme/ThemeOverlayController.java b/packages/SystemUI/src/com/android/systemui/theme/ThemeOverlayController.java
index d256c4acd955..7494649294f5 100644
--- a/packages/SystemUI/src/com/android/systemui/theme/ThemeOverlayController.java
+++ b/packages/SystemUI/src/com/android/systemui/theme/ThemeOverlayController.java
@@ -77,6 +77,7 @@ import com.android.systemui.keyguard.WakefulnessLifecycle;
import com.android.systemui.keyguard.domain.interactor.KeyguardTransitionInteractor;
import com.android.systemui.keyguard.shared.model.KeyguardState;
import com.android.systemui.monet.ColorScheme;
+import com.android.systemui.monet.DynamicColors;
import com.android.systemui.monet.Style;
import com.android.systemui.monet.TonalPalette;
import com.android.systemui.settings.UserTracker;
@@ -623,7 +624,7 @@ public class ThemeOverlayController implements CoreStartable, Dumpable {
TonalPalette tonalPalette) {
String resourcePrefix = "android:color/system_" + name;
- tonalPalette.getAllShadesMapped().forEach((key, value) -> {
+ tonalPalette.allShadesMapped.forEach((key, value) -> {
String resourceName = resourcePrefix + "_" + key;
int colorValue = ColorUtils.setAlphaComponent(value, 0xFF);
overlay.setResourceValue(resourceName, TYPE_INT_COLOR_ARGB8, colorValue,
@@ -634,7 +635,7 @@ public class ThemeOverlayController implements CoreStartable, Dumpable {
protected FabricatedOverlay createDynamicOverlay() {
FabricatedOverlay overlay = newFabricatedOverlay("dynamic");
//Themed Colors
- assignColorsToOverlay(overlay, DynamicColors.allDynamicColorsMapped(mIsFidelityEnabled),
+ assignColorsToOverlay(overlay, DynamicColors.getAllDynamicColorsMapped(mIsFidelityEnabled),
false);
// Fixed Colors
assignColorsToOverlay(overlay, DynamicColors.getFixedColorsMapped(mIsFidelityEnabled),
diff --git a/packages/SystemUI/src/com/android/systemui/unfold/FullscreenLightRevealAnimation.kt b/packages/SystemUI/src/com/android/systemui/unfold/FullscreenLightRevealAnimation.kt
index ca5ea3bc1caa..135edfcb6a42 100644
--- a/packages/SystemUI/src/com/android/systemui/unfold/FullscreenLightRevealAnimation.kt
+++ b/packages/SystemUI/src/com/android/systemui/unfold/FullscreenLightRevealAnimation.kt
@@ -32,6 +32,7 @@ import android.view.SurfaceControlViewHost
import android.view.SurfaceSession
import android.view.WindowManager
import android.view.WindowlessWindowManager
+import androidx.annotation.WorkerThread
import com.android.app.tracing.traceSection
import com.android.systemui.dagger.qualifiers.Background
import com.android.systemui.dagger.qualifiers.Main
@@ -235,8 +236,10 @@ constructor(
}
private inner class RotationWatcher : RotationChangeProvider.RotationListener {
+ @WorkerThread
override fun onRotationChanged(newRotation: Int) {
traceSection("$TAG#onRotationChanged") {
+ ensureInBackground()
if (currentRotation != newRotation) {
currentRotation = newRotation
scrimView?.revealEffect = lightRevealEffectFactory(currentRotation)
diff --git a/packages/SystemUI/src/com/android/systemui/util/settings/SettingsProxy.java b/packages/SystemUI/src/com/android/systemui/util/settings/SettingsProxy.java
deleted file mode 100644
index aeed78ad4df4..000000000000
--- a/packages/SystemUI/src/com/android/systemui/util/settings/SettingsProxy.java
+++ /dev/null
@@ -1,432 +0,0 @@
-/*
- * Copyright (C) 2020 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.settings;
-
-import android.annotation.NonNull;
-import android.annotation.Nullable;
-import android.content.ContentResolver;
-import android.database.ContentObserver;
-import android.net.Uri;
-import android.provider.Settings;
-
-/**
- * Used to interact with mainly with Settings.Global, but can also be used for Settings.System
- * and Settings.Secure. To use the per-user System and Secure settings, {@link UserSettingsProxy}
- * must be used instead.
- * <p>
- * This interface can be implemented to give instance method (instead of static method) versions
- * of Settings.Global. It can be injected into class constructors and then faked or mocked as needed
- * in tests.
- * <p>
- * You can ask for {@link GlobalSettings} to be injected as needed.
- * <p>
- * This class also provides {@link #registerContentObserver(String, ContentObserver)} methods,
- * normally found on {@link ContentResolver} instances, unifying setting related actions in one
- * place.
- */
-public interface SettingsProxy {
-
- /**
- * Returns the {@link ContentResolver} this instance was constructed with.
- */
- ContentResolver getContentResolver();
-
- /**
- * Construct the content URI for a particular name/value pair,
- * useful for monitoring changes with a ContentObserver.
- * @param name to look up in the table
- * @return the corresponding content URI, or null if not present
- */
- Uri getUriFor(String name);
-
- /**
- * Convenience wrapper around
- * {@link ContentResolver#registerContentObserver(Uri, boolean, ContentObserver)}.'
- * <p>
- * Implicitly calls {@link #getUriFor(String)} on the passed in name.
- */
- default void registerContentObserver(String name, ContentObserver settingsObserver) {
- registerContentObserver(getUriFor(name), settingsObserver);
- }
-
- /**
- * Convenience wrapper around
- * {@link ContentResolver#registerContentObserver(Uri, boolean, ContentObserver)}.'
- */
- default void registerContentObserver(Uri uri, ContentObserver settingsObserver) {
- registerContentObserver(uri, false, settingsObserver);
- }
-
- /**
- * Convenience wrapper around
- * {@link ContentResolver#registerContentObserver(Uri, boolean, ContentObserver)}.'
- * <p>
- * Implicitly calls {@link #getUriFor(String)} on the passed in name.
- */
- default void registerContentObserver(String name, boolean notifyForDescendants,
- ContentObserver settingsObserver) {
- registerContentObserver(getUriFor(name), notifyForDescendants, settingsObserver);
- }
-
- /**
- * Convenience wrapper around
- * {@link ContentResolver#registerContentObserver(Uri, boolean, ContentObserver)}.'
- */
- default void registerContentObserver(Uri uri, boolean notifyForDescendants,
- ContentObserver settingsObserver) {
- getContentResolver().registerContentObserver(
- uri, notifyForDescendants, settingsObserver);
- }
-
- /** See {@link ContentResolver#unregisterContentObserver(ContentObserver)}. */
- default void unregisterContentObserver(ContentObserver settingsObserver) {
- getContentResolver().unregisterContentObserver(settingsObserver);
- }
-
- /**
- * Look up a name in the database.
- * @param name to look up in the table
- * @return the corresponding value, or null if not present
- */
- @Nullable
- String getString(String name);
-
- /**
- * Store a name/value pair into the database.
- * @param name to store
- * @param value to associate with the name
- * @return true if the value was set, false on database errors
- */
- boolean putString(String name, String value);
-
- /**
- * Store a name/value pair into the database.
- * <p>
- * The method takes an optional tag to associate with the setting
- * which can be used to clear only settings made by your package and
- * associated with this tag by passing the tag to {@link
- * #resetToDefaults(String)}. Anyone can override
- * the current tag. Also if another package changes the setting
- * then the tag will be set to the one specified in the set call
- * which can be null. Also any of the settings setters that do not
- * take a tag as an argument effectively clears the tag.
- * </p><p>
- * For example, if you set settings A and B with tags T1 and T2 and
- * another app changes setting A (potentially to the same value), it
- * can assign to it a tag T3 (note that now the package that changed
- * the setting is not yours). Now if you reset your changes for T1 and
- * T2 only setting B will be reset and A not (as it was changed by
- * another package) but since A did not change you are in the desired
- * initial state. Now if the other app changes the value of A (assuming
- * you registered an observer in the beginning) you would detect that
- * the setting was changed by another app and handle this appropriately
- * (ignore, set back to some value, etc).
- * </p><p>
- * Also the method takes an argument whether to make the value the
- * default for this setting. If the system already specified a default
- * value, then the one passed in here will <strong>not</strong>
- * be set as the default.
- * </p>
- *
- * @param name to store.
- * @param value to associate with the name.
- * @param tag to associate with the setting.
- * @param makeDefault whether to make the value the default one.
- * @return true if the value was set, false on database errors.
- *
- * @see #resetToDefaults(String)
- *
- */
- boolean putString(@NonNull String name, @Nullable String value, @Nullable String tag,
- boolean makeDefault);
-
- /**
- * Convenience function for retrieving a single secure settings value
- * as an integer. Note that internally setting values are always
- * stored as strings; this function converts the string to an integer
- * for you. The default value will be returned if the setting is
- * not defined or not an integer.
- *
- * @param name The name of the setting to retrieve.
- * @param def Value to return if the setting is not defined.
- *
- * @return The setting's current value, or 'def' if it is not defined
- * or not a valid integer.
- */
- default int getInt(String name, int def) {
- String v = getString(name);
- try {
- return v != null ? Integer.parseInt(v) : def;
- } catch (NumberFormatException e) {
- return def;
- }
- }
-
- /**
- * Convenience function for retrieving a single secure settings value
- * as an integer. Note that internally setting values are always
- * stored as strings; this function converts the string to an integer
- * for you.
- * <p>
- * This version does not take a default value. If the setting has not
- * been set, or the string value is not a number,
- * it throws {@link Settings.SettingNotFoundException}.
- *
- * @param name The name of the setting to retrieve.
- *
- * @throws Settings.SettingNotFoundException Thrown if a setting by the given
- * name can't be found or the setting value is not an integer.
- *
- * @return The setting's current value.
- */
- default int getInt(String name)
- throws Settings.SettingNotFoundException {
- String v = getString(name);
- try {
- return Integer.parseInt(v);
- } catch (NumberFormatException e) {
- throw new Settings.SettingNotFoundException(name);
- }
- }
-
- /**
- * Convenience function for updating a single settings value as an
- * integer. This will either create a new entry in the table if the
- * given name does not exist, or modify the value of the existing row
- * with that name. Note that internally setting values are always
- * stored as strings, so this function converts the given value to a
- * string before storing it.
- *
- * @param name The name of the setting to modify.
- * @param value The new value for the setting.
- * @return true if the value was set, false on database errors
- */
- default boolean putInt(String name, int value) {
- return putString(name, Integer.toString(value));
- }
-
- /**
- * Convenience function for retrieving a single secure settings value
- * as a boolean. Note that internally setting values are always
- * stored as strings; this function converts the string to a boolean
- * for you. The default value will be returned if the setting is
- * not defined or not a boolean.
- *
- * @param name The name of the setting to retrieve.
- * @param def Value to return if the setting is not defined.
- *
- * @return The setting's current value, or 'def' if it is not defined
- * or not a valid boolean.
- */
- default boolean getBool(String name, boolean def) {
- return getInt(name, def ? 1 : 0) != 0;
- }
-
- /**
- * Convenience function for retrieving a single secure settings value
- * as a boolean. Note that internally setting values are always
- * stored as strings; this function converts the string to a boolean
- * for you.
- * <p>
- * This version does not take a default value. If the setting has not
- * been set, or the string value is not a number,
- * it throws {@link Settings.SettingNotFoundException}.
- *
- * @param name The name of the setting to retrieve.
- *
- * @throws Settings.SettingNotFoundException Thrown if a setting by the given
- * name can't be found or the setting value is not a boolean.
- *
- * @return The setting's current value.
- */
- default boolean getBool(String name)
- throws Settings.SettingNotFoundException {
- return getInt(name) != 0;
- }
-
- /**
- * Convenience function for updating a single settings value as a
- * boolean. This will either create a new entry in the table if the
- * given name does not exist, or modify the value of the existing row
- * with that name. Note that internally setting values are always
- * stored as strings, so this function converts the given value to a
- * string before storing it.
- *
- * @param name The name of the setting to modify.
- * @param value The new value for the setting.
- * @return true if the value was set, false on database errors
- */
- default boolean putBool(String name, boolean value) {
- return putInt(name, value ? 1 : 0);
- }
-
- /**
- * Convenience function for retrieving a single secure settings value
- * as a {@code long}. Note that internally setting values are always
- * stored as strings; this function converts the string to a {@code long}
- * for you. The default value will be returned if the setting is
- * not defined or not a {@code long}.
- *
- * @param name The name of the setting to retrieve.
- * @param def Value to return if the setting is not defined.
- *
- * @return The setting's current value, or 'def' if it is not defined
- * or not a valid {@code long}.
- */
- default long getLong(String name, long def) {
- String valString = getString(name);
- return parseLongOrUseDefault(valString, def);
- }
-
- /** Convert a string to a long, or uses a default if the string is malformed or null */
- static long parseLongOrUseDefault(String valString, long def) {
- long value;
- try {
- value = valString != null ? Long.parseLong(valString) : def;
- } catch (NumberFormatException e) {
- value = def;
- }
- return value;
- }
-
- /**
- * Convenience function for retrieving a single secure settings value
- * as a {@code long}. Note that internally setting values are always
- * stored as strings; this function converts the string to a {@code long}
- * for you.
- * <p>
- * This version does not take a default value. If the setting has not
- * been set, or the string value is not a number,
- * it throws {@link Settings.SettingNotFoundException}.
- *
- * @param name The name of the setting to retrieve.
- *
- * @return The setting's current value.
- * @throws Settings.SettingNotFoundException Thrown if a setting by the given
- * name can't be found or the setting value is not an integer.
- */
- default long getLong(String name)
- throws Settings.SettingNotFoundException {
- String valString = getString(name);
- return parseLongOrThrow(name, valString);
- }
-
- /** Convert a string to a long, or throws an exception if the string is malformed or null */
- static long parseLongOrThrow(String name, String valString)
- throws Settings.SettingNotFoundException {
- try {
- return Long.parseLong(valString);
- } catch (NumberFormatException e) {
- throw new Settings.SettingNotFoundException(name);
- }
- }
-
- /**
- * Convenience function for updating a secure settings value as a long
- * integer. This will either create a new entry in the table if the
- * given name does not exist, or modify the value of the existing row
- * with that name. Note that internally setting values are always
- * stored as strings, so this function converts the given value to a
- * string before storing it.
- *
- * @param name The name of the setting to modify.
- * @param value The new value for the setting.
- * @return true if the value was set, false on database errors
- */
- default boolean putLong(String name, long value) {
- return putString(name, Long.toString(value));
- }
-
- /**
- * Convenience function for retrieving a single secure settings value
- * as a floating point number. Note that internally setting values are
- * always stored as strings; this function converts the string to an
- * float for you. The default value will be returned if the setting
- * is not defined or not a valid float.
- *
- * @param name The name of the setting to retrieve.
- * @param def Value to return if the setting is not defined.
- *
- * @return The setting's current value, or 'def' if it is not defined
- * or not a valid float.
- */
- default float getFloat(String name, float def) {
- String v = getString(name);
- return parseFloat(v, def);
- }
-
- /** Convert a string to a float, or uses a default if the string is malformed or null */
- static float parseFloat(String v, float def) {
- try {
- return v != null ? Float.parseFloat(v) : def;
- } catch (NumberFormatException e) {
- return def;
- }
- }
-
- /**
- * Convenience function for retrieving a single secure settings value
- * as a float. Note that internally setting values are always
- * stored as strings; this function converts the string to a float
- * for you.
- * <p>
- * This version does not take a default value. If the setting has not
- * been set, or the string value is not a number,
- * it throws {@link Settings.SettingNotFoundException}.
- *
- * @param name The name of the setting to retrieve.
- *
- * @throws Settings.SettingNotFoundException Thrown if a setting by the given
- * name can't be found or the setting value is not a float.
- *
- * @return The setting's current value.
- */
- default float getFloat(String name)
- throws Settings.SettingNotFoundException {
- String v = getString(name);
- return parseFloatOrThrow(name, v);
- }
-
- /** Convert a string to a float, or throws an exception if the string is malformed or null */
- static float parseFloatOrThrow(String name, String v)
- throws Settings.SettingNotFoundException {
- if (v == null) {
- throw new Settings.SettingNotFoundException(name);
- }
- try {
- return Float.parseFloat(v);
- } catch (NumberFormatException e) {
- throw new Settings.SettingNotFoundException(name);
- }
- }
-
- /**
- * Convenience function for updating a single settings value as a
- * floating point number. This will either create a new entry in the
- * table if the given name does not exist, or modify the value of the
- * existing row with that name. Note that internally setting values
- * are always stored as strings, so this function converts the given
- * value to a string before storing it.
- *
- * @param name The name of the setting to modify.
- * @param value The new value for the setting.
- * @return true if the value was set, false on database errors
- */
- default boolean putFloat(String name, float value) {
- return putString(name, Float.toString(value));
- }
-}
diff --git a/packages/SystemUI/src/com/android/systemui/util/settings/SettingsProxy.kt b/packages/SystemUI/src/com/android/systemui/util/settings/SettingsProxy.kt
new file mode 100644
index 000000000000..ec89610ce014
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/util/settings/SettingsProxy.kt
@@ -0,0 +1,385 @@
+/*
+ * Copyright (C) 2020 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.settings
+
+import android.content.ContentResolver
+import android.database.ContentObserver
+import android.net.Uri
+import android.provider.Settings.SettingNotFoundException
+
+/**
+ * Used to interact with mainly with Settings.Global, but can also be used for Settings.System and
+ * Settings.Secure. To use the per-user System and Secure settings, [UserSettingsProxy] must be used
+ * instead.
+ *
+ * This interface can be implemented to give instance method (instead of static method) versions of
+ * Settings.Global. It can be injected into class constructors and then faked or mocked as needed in
+ * tests.
+ *
+ * You can ask for [GlobalSettings] to be injected as needed.
+ *
+ * This class also provides [.registerContentObserver] methods, normally found on [ContentResolver]
+ * instances, unifying setting related actions in one place.
+ */
+interface SettingsProxy {
+ /** Returns the [ContentResolver] this instance was constructed with. */
+ fun getContentResolver(): ContentResolver
+
+ /**
+ * Construct the content URI for a particular name/value pair, useful for monitoring changes
+ * with a ContentObserver.
+ *
+ * @param name to look up in the table
+ * @return the corresponding content URI, or null if not present
+ */
+ fun getUriFor(name: String): Uri
+
+ /**
+ * Convenience wrapper around [ContentResolver.registerContentObserver].'
+ *
+ * Implicitly calls [getUriFor] on the passed in name.
+ */
+ fun registerContentObserver(name: String, settingsObserver: ContentObserver) {
+ registerContentObserver(getUriFor(name), settingsObserver)
+ }
+
+ /** Convenience wrapper around [ContentResolver.registerContentObserver].' */
+ fun registerContentObserver(uri: Uri, settingsObserver: ContentObserver) =
+ registerContentObserver(uri, false, settingsObserver)
+
+ /**
+ * Convenience wrapper around [ContentResolver.registerContentObserver].'
+ *
+ * Implicitly calls [getUriFor] on the passed in name.
+ */
+ fun registerContentObserver(
+ name: String,
+ notifyForDescendants: Boolean,
+ settingsObserver: ContentObserver
+ ) = registerContentObserver(getUriFor(name), notifyForDescendants, settingsObserver)
+
+ /** Convenience wrapper around [ContentResolver.registerContentObserver].' */
+ fun registerContentObserver(
+ uri: Uri,
+ notifyForDescendants: Boolean,
+ settingsObserver: ContentObserver
+ ) = getContentResolver().registerContentObserver(uri, notifyForDescendants, settingsObserver)
+
+ /** See [ContentResolver.unregisterContentObserver]. */
+ fun unregisterContentObserver(settingsObserver: ContentObserver) =
+ getContentResolver().unregisterContentObserver(settingsObserver)
+
+ /**
+ * Look up a name in the database.
+ *
+ * @param name to look up in the table
+ * @return the corresponding value, or null if not present
+ */
+ fun getString(name: String): String
+
+ /**
+ * Store a name/value pair into the database.
+ *
+ * @param name to store
+ * @param value to associate with the name
+ * @return true if the value was set, false on database errors
+ */
+ fun putString(name: String, value: String): Boolean
+
+ /**
+ * Store a name/value pair into the database.
+ *
+ * The method takes an optional tag to associate with the setting which can be used to clear
+ * only settings made by your package and associated with this tag by passing the tag to
+ * [ ][.resetToDefaults]. Anyone can override the current tag. Also if another package changes
+ * the setting then the tag will be set to the one specified in the set call which can be null.
+ * Also any of the settings setters that do not take a tag as an argument effectively clears the
+ * tag.
+ *
+ * For example, if you set settings A and B with tags T1 and T2 and another app changes setting
+ * A (potentially to the same value), it can assign to it a tag T3 (note that now the package
+ * that changed the setting is not yours). Now if you reset your changes for T1 and T2 only
+ * setting B will be reset and A not (as it was changed by another package) but since A did not
+ * change you are in the desired initial state. Now if the other app changes the value of A
+ * (assuming you registered an observer in the beginning) you would detect that the setting was
+ * changed by another app and handle this appropriately (ignore, set back to some value, etc).
+ *
+ * Also the method takes an argument whether to make the value the default for this setting. If
+ * the system already specified a default value, then the one passed in here will **not** be set
+ * as the default.
+ *
+ * @param name to store.
+ * @param value to associate with the name.
+ * @param tag to associate with the setting.
+ * @param makeDefault whether to make the value the default one.
+ * @return true if the value was set, false on database errors.
+ * @see .resetToDefaults
+ */
+ fun putString(name: String, value: String, tag: String, makeDefault: Boolean): Boolean
+
+ /**
+ * Convenience function for retrieving a single secure settings value as an integer. Note that
+ * internally setting values are always stored as strings; this function converts the string to
+ * an integer for you. The default value will be returned if the setting is not defined or not
+ * an integer.
+ *
+ * @param name The name of the setting to retrieve.
+ * @param def Value to return if the setting is not defined.
+ * @return The setting's current value, or 'def' if it is not defined or not a valid integer.
+ */
+ fun getInt(name: String, def: Int): Int {
+ val v = getString(name)
+ return try {
+ v.toInt()
+ } catch (e: NumberFormatException) {
+ def
+ }
+ }
+
+ /**
+ * Convenience function for retrieving a single secure settings value as an integer. Note that
+ * internally setting values are always stored as strings; this function converts the string to
+ * an integer for you.
+ *
+ * This version does not take a default value. If the setting has not been set, or the string
+ * value is not a number, it throws [Settings.SettingNotFoundException].
+ *
+ * @param name The name of the setting to retrieve.
+ * @return The setting's current value.
+ * @throws Settings.SettingNotFoundException Thrown if a setting by the given name can't be
+ * found or the setting value is not an integer.
+ */
+ @Throws(SettingNotFoundException::class)
+ fun getInt(name: String): Int {
+ val v = getString(name)
+ return try {
+ v.toInt()
+ } catch (e: NumberFormatException) {
+ throw SettingNotFoundException(name)
+ }
+ }
+
+ /**
+ * Convenience function for updating a single settings value as an integer. This will either
+ * create a new entry in the table if the given name does not exist, or modify the value of the
+ * existing row with that name. Note that internally setting values are always stored as
+ * strings, so this function converts the given value to a string before storing it.
+ *
+ * @param name The name of the setting to modify.
+ * @param value The new value for the setting.
+ * @return true if the value was set, false on database errors
+ */
+ fun putInt(name: String, value: Int): Boolean {
+ return putString(name, value.toString())
+ }
+
+ /**
+ * Convenience function for retrieving a single secure settings value as a boolean. Note that
+ * internally setting values are always stored as strings; this function converts the string to
+ * a boolean for you. The default value will be returned if the setting is not defined or not a
+ * boolean.
+ *
+ * @param name The name of the setting to retrieve.
+ * @param def Value to return if the setting is not defined.
+ * @return The setting's current value, or 'def' if it is not defined or not a valid boolean.
+ */
+ fun getBool(name: String, def: Boolean): Boolean {
+ return getInt(name, if (def) 1 else 0) != 0
+ }
+
+ /**
+ * Convenience function for retrieving a single secure settings value as a boolean. Note that
+ * internally setting values are always stored as strings; this function converts the string to
+ * a boolean for you.
+ *
+ * This version does not take a default value. If the setting has not been set, or the string
+ * value is not a number, it throws [Settings.SettingNotFoundException].
+ *
+ * @param name The name of the setting to retrieve.
+ * @return The setting's current value.
+ * @throws Settings.SettingNotFoundException Thrown if a setting by the given name can't be
+ * found or the setting value is not a boolean.
+ */
+ @Throws(SettingNotFoundException::class)
+ fun getBool(name: String): Boolean {
+ return getInt(name) != 0
+ }
+
+ /**
+ * Convenience function for updating a single settings value as a boolean. This will either
+ * create a new entry in the table if the given name does not exist, or modify the value of the
+ * existing row with that name. Note that internally setting values are always stored as
+ * strings, so this function converts the given value to a string before storing it.
+ *
+ * @param name The name of the setting to modify.
+ * @param value The new value for the setting.
+ * @return true if the value was set, false on database errors
+ */
+ fun putBool(name: String, value: Boolean): Boolean {
+ return putInt(name, if (value) 1 else 0)
+ }
+
+ /**
+ * Convenience function for retrieving a single secure settings value as a `long`. Note that
+ * internally setting values are always stored as strings; this function converts the string to
+ * a `long` for you. The default value will be returned if the setting is not defined or not a
+ * `long`.
+ *
+ * @param name The name of the setting to retrieve.
+ * @param def Value to return if the setting is not defined.
+ * @return The setting's current value, or 'def' if it is not defined or not a valid `long`.
+ */
+ fun getLong(name: String, def: Long): Long {
+ val valString = getString(name)
+ return parseLongOrUseDefault(valString, def)
+ }
+
+ /**
+ * Convenience function for retrieving a single secure settings value as a `long`. Note that
+ * internally setting values are always stored as strings; this function converts the string to
+ * a `long` for you.
+ *
+ * This version does not take a default value. If the setting has not been set, or the string
+ * value is not a number, it throws [Settings.SettingNotFoundException].
+ *
+ * @param name The name of the setting to retrieve.
+ * @return The setting's current value.
+ * @throws Settings.SettingNotFoundException Thrown if a setting by the given name can't be
+ * found or the setting value is not an integer.
+ */
+ @Throws(SettingNotFoundException::class)
+ fun getLong(name: String): Long {
+ val valString = getString(name)
+ return parseLongOrThrow(name, valString)
+ }
+
+ /**
+ * Convenience function for updating a secure settings value as a long integer. This will either
+ * create a new entry in the table if the given name does not exist, or modify the value of the
+ * existing row with that name. Note that internally setting values are always stored as
+ * strings, so this function converts the given value to a string before storing it.
+ *
+ * @param name The name of the setting to modify.
+ * @param value The new value for the setting.
+ * @return true if the value was set, false on database errors
+ */
+ fun putLong(name: String, value: Long): Boolean {
+ return putString(name, value.toString())
+ }
+
+ /**
+ * Convenience function for retrieving a single secure settings value as a floating point
+ * number. Note that internally setting values are always stored as strings; this function
+ * converts the string to an float for you. The default value will be returned if the setting is
+ * not defined or not a valid float.
+ *
+ * @param name The name of the setting to retrieve.
+ * @param def Value to return if the setting is not defined.
+ * @return The setting's current value, or 'def' if it is not defined or not a valid float.
+ */
+ fun getFloat(name: String, def: Float): Float {
+ val v = getString(name)
+ return parseFloat(v, def)
+ }
+
+ /**
+ * Convenience function for retrieving a single secure settings value as a float. Note that
+ * internally setting values are always stored as strings; this function converts the string to
+ * a float for you.
+ *
+ * This version does not take a default value. If the setting has not been set, or the string
+ * value is not a number, it throws [Settings.SettingNotFoundException].
+ *
+ * @param name The name of the setting to retrieve.
+ * @return The setting's current value.
+ * @throws Settings.SettingNotFoundException Thrown if a setting by the given name can't be
+ * found or the setting value is not a float.
+ */
+ @Throws(SettingNotFoundException::class)
+ fun getFloat(name: String): Float {
+ val v = getString(name)
+ return parseFloatOrThrow(name, v)
+ }
+
+ /**
+ * Convenience function for updating a single settings value as a floating point number. This
+ * will either create a new entry in the table if the given name does not exist, or modify the
+ * value of the existing row with that name. Note that internally setting values are always
+ * stored as strings, so this function converts the given value to a string before storing it.
+ *
+ * @param name The name of the setting to modify.
+ * @param value The new value for the setting.
+ * @return true if the value was set, false on database errors
+ */
+ fun putFloat(name: String, value: Float): Boolean {
+ return putString(name, value.toString())
+ }
+
+ companion object {
+ /** Convert a string to a long, or uses a default if the string is malformed or null */
+ @JvmStatic
+ fun parseLongOrUseDefault(valString: String, def: Long): Long {
+ val value: Long
+ value =
+ try {
+ valString.toLong()
+ } catch (e: NumberFormatException) {
+ def
+ }
+ return value
+ }
+
+ /** Convert a string to a long, or throws an exception if the string is malformed or null */
+ @JvmStatic
+ @Throws(SettingNotFoundException::class)
+ fun parseLongOrThrow(name: String, valString: String?): Long {
+ if (valString == null) {
+ throw SettingNotFoundException(name)
+ }
+ return try {
+ valString.toLong()
+ } catch (e: NumberFormatException) {
+ throw SettingNotFoundException(name)
+ }
+ }
+
+ /** Convert a string to a float, or uses a default if the string is malformed or null */
+ @JvmStatic
+ fun parseFloat(v: String?, def: Float): Float {
+ return try {
+ v?.toFloat() ?: def
+ } catch (e: NumberFormatException) {
+ def
+ }
+ }
+
+ /**
+ * Convert a string to a float, or throws an exception if the string is malformed or null
+ */
+ @JvmStatic
+ @Throws(SettingNotFoundException::class)
+ fun parseFloatOrThrow(name: String, v: String?): Float {
+ if (v == null) {
+ throw SettingNotFoundException(name)
+ }
+ return try {
+ v.toFloat()
+ } catch (e: NumberFormatException) {
+ throw SettingNotFoundException(name)
+ }
+ }
+ }
+}
diff --git a/packages/SystemUI/src/com/android/systemui/util/settings/UserSettingsProxy.java b/packages/SystemUI/src/com/android/systemui/util/settings/UserSettingsProxy.java
deleted file mode 100644
index 10cf08221fb3..000000000000
--- a/packages/SystemUI/src/com/android/systemui/util/settings/UserSettingsProxy.java
+++ /dev/null
@@ -1,283 +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.util.settings;
-
-import android.annotation.NonNull;
-import android.annotation.Nullable;
-import android.annotation.UserIdInt;
-import android.content.ContentResolver;
-import android.database.ContentObserver;
-import android.net.Uri;
-import android.os.UserHandle;
-import android.provider.Settings;
-
-import com.android.app.tracing.TraceUtils;
-import com.android.systemui.settings.UserTracker;
-
-import kotlin.Unit;
-
-/**
- * Used to interact with per-user Settings.Secure and Settings.System settings (but not
- * Settings.Global, since those do not vary per-user)
- * <p>
- * This interface can be implemented to give instance method (instead of static method) versions
- * of Settings.Secure and Settings.System. It can be injected into class constructors and then
- * faked or mocked as needed in tests.
- * <p>
- * You can ask for {@link SecureSettings} or {@link SystemSettings} to be injected as needed.
- * <p>
- * This class also provides {@link #registerContentObserver(String, ContentObserver)} methods,
- * normally found on {@link ContentResolver} instances, unifying setting related actions in one
- * place.
- */
-public interface UserSettingsProxy extends SettingsProxy {
-
- /**
- * Returns that {@link UserTracker} this instance was constructed with.
- */
- UserTracker getUserTracker();
-
- /**
- * Returns the user id for the associated {@link ContentResolver}.
- */
- default int getUserId() {
- return getContentResolver().getUserId();
- }
-
- /**
- * Returns the actual current user handle when querying with the current user. Otherwise,
- * returns the passed in user id.
- */
- default int getRealUserHandle(int userHandle) {
- if (userHandle != UserHandle.USER_CURRENT) {
- return userHandle;
- }
- return getUserTracker().getUserId();
- }
-
- @Override
- default void registerContentObserver(Uri uri, ContentObserver settingsObserver) {
- registerContentObserverForUser(uri, settingsObserver, getUserId());
- }
-
- /**
- * Convenience wrapper around
- * {@link ContentResolver#registerContentObserver(Uri, boolean, ContentObserver)}.'
- */
- @Override
- default void registerContentObserver(Uri uri, boolean notifyForDescendants,
- ContentObserver settingsObserver) {
- registerContentObserverForUser(uri, notifyForDescendants, settingsObserver, getUserId());
- }
-
- /**
- * Convenience wrapper around
- * {@link ContentResolver#registerContentObserver(Uri, boolean, ContentObserver, int)}
- *
- * Implicitly calls {@link #getUriFor(String)} on the passed in name.
- */
- default void registerContentObserverForUser(
- String name, ContentObserver settingsObserver, int userHandle) {
- registerContentObserverForUser(
- getUriFor(name), settingsObserver, userHandle);
- }
-
- /**
- * Convenience wrapper around
- * {@link ContentResolver#registerContentObserver(Uri, boolean, ContentObserver, int)}
- */
- default void registerContentObserverForUser(
- Uri uri, ContentObserver settingsObserver, int userHandle) {
- registerContentObserverForUser(
- uri, false, settingsObserver, userHandle);
- }
-
- /**
- * Convenience wrapper around
- * {@link ContentResolver#registerContentObserver(Uri, boolean, ContentObserver, int)}
- *
- * Implicitly calls {@link #getUriFor(String)} on the passed in name.
- */
- default void registerContentObserverForUser(
- String name, boolean notifyForDescendants, ContentObserver settingsObserver,
- int userHandle) {
- registerContentObserverForUser(
- getUriFor(name), notifyForDescendants, settingsObserver, userHandle);
- }
-
- /**
- * Convenience wrapper around
- * {@link ContentResolver#registerContentObserver(Uri, boolean, ContentObserver, int)}
- */
- default void registerContentObserverForUser(
- Uri uri, boolean notifyForDescendants, ContentObserver settingsObserver,
- int userHandle) {
- TraceUtils.trace(
- () -> {
- // The limit for trace tags length is 127 chars, which leaves us 90 for Uri.
- return "USP#registerObserver#[" + uri.toString() + "]";
- }, () -> {
- getContentResolver().registerContentObserver(
- uri, notifyForDescendants, settingsObserver,
- getRealUserHandle(userHandle));
- return Unit.INSTANCE;
- });
- }
-
- /**
- * Look up a name in the database.
- * @param name to look up in the table
- * @return the corresponding value, or null if not present
- */
- @Override
- default String getString(String name) {
- return getStringForUser(name, getUserId());
- }
-
- /**See {@link #getString(String)}. */
- String getStringForUser(String name, int userHandle);
-
- /**
- * Store a name/value pair into the database. Values written by this method will be
- * overridden if a restore happens in the future.
- *
- * @param name to store
- * @param value to associate with the name
- * @return true if the value was set, false on database errors
- */
- boolean putString(String name, String value, boolean overrideableByRestore);
-
- @Override
- default boolean putString(String name, String value) {
- return putStringForUser(name, value, getUserId());
- }
-
- /** See {@link #putString(String, String)}. */
- boolean putStringForUser(String name, String value, int userHandle);
-
- /** See {@link #putString(String, String)}. */
- boolean putStringForUser(@NonNull String name, @Nullable String value, @Nullable String tag,
- boolean makeDefault, @UserIdInt int userHandle, boolean overrideableByRestore);
-
- @Override
- default int getInt(String name, int def) {
- return getIntForUser(name, def, getUserId());
- }
-
- /** See {@link #getInt(String, int)}. */
- default int getIntForUser(String name, int def, int userHandle) {
- String v = getStringForUser(name, userHandle);
- try {
- return v != null ? Integer.parseInt(v) : def;
- } catch (NumberFormatException e) {
- return def;
- }
- }
-
- @Override
- default int getInt(String name) throws Settings.SettingNotFoundException {
- return getIntForUser(name, getUserId());
- }
-
- /** See {@link #getInt(String)}. */
- default int getIntForUser(String name, int userHandle)
- throws Settings.SettingNotFoundException {
- String v = getStringForUser(name, userHandle);
- try {
- return Integer.parseInt(v);
- } catch (NumberFormatException e) {
- throw new Settings.SettingNotFoundException(name);
- }
- }
-
- @Override
- default boolean putInt(String name, int value) {
- return putIntForUser(name, value, getUserId());
- }
-
- /** See {@link #putInt(String, int)}. */
- default boolean putIntForUser(String name, int value, int userHandle) {
- return putStringForUser(name, Integer.toString(value), userHandle);
- }
-
- @Override
- default boolean getBool(String name, boolean def) {
- return getBoolForUser(name, def, getUserId());
- }
-
- /** See {@link #getBool(String, boolean)}. */
- default boolean getBoolForUser(String name, boolean def, int userHandle) {
- return getIntForUser(name, def ? 1 : 0, userHandle) != 0;
- }
-
- @Override
- default boolean getBool(String name) throws Settings.SettingNotFoundException {
- return getBoolForUser(name, getUserId());
- }
-
- /** See {@link #getBool(String)}. */
- default boolean getBoolForUser(String name, int userHandle)
- throws Settings.SettingNotFoundException {
- return getIntForUser(name, userHandle) != 0;
- }
-
- @Override
- default boolean putBool(String name, boolean value) {
- return putBoolForUser(name, value, getUserId());
- }
-
- /** See {@link #putBool(String, boolean)}. */
- default boolean putBoolForUser(String name, boolean value, int userHandle) {
- return putIntForUser(name, value ? 1 : 0, userHandle);
- }
-
- /** See {@link #getLong(String, long)}. */
- default long getLongForUser(String name, long def, int userHandle) {
- String valString = getStringForUser(name, userHandle);
- return SettingsProxy.parseLongOrUseDefault(valString, def);
- }
-
- /** See {@link #getLong(String)}. */
- default long getLongForUser(String name, int userHandle)
- throws Settings.SettingNotFoundException {
- String valString = getStringForUser(name, userHandle);
- return SettingsProxy.parseLongOrThrow(name, valString);
- }
-
- /** See {@link #putLong(String, long)}. */
- default boolean putLongForUser(String name, long value, int userHandle) {
- return putStringForUser(name, Long.toString(value), userHandle);
- }
-
- /** See {@link #getFloat(String)}. */
- default float getFloatForUser(String name, float def, int userHandle) {
- String v = getStringForUser(name, userHandle);
- return SettingsProxy.parseFloat(v, def);
- }
-
- /** See {@link #getFloat(String, float)}. */
- default float getFloatForUser(String name, int userHandle)
- throws Settings.SettingNotFoundException {
- String v = getStringForUser(name, userHandle);
- return SettingsProxy.parseFloatOrThrow(name, v);
- }
-
- /** See {@link #putFloat(String, float)} */
- default boolean putFloatForUser(String name, float value, int userHandle) {
- return putStringForUser(name, Float.toString(value), userHandle);
- }
-}
diff --git a/packages/SystemUI/src/com/android/systemui/util/settings/UserSettingsProxy.kt b/packages/SystemUI/src/com/android/systemui/util/settings/UserSettingsProxy.kt
new file mode 100644
index 000000000000..2285270b0bc7
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/util/settings/UserSettingsProxy.kt
@@ -0,0 +1,269 @@
+/*
+ * 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.util.settings
+
+import android.annotation.UserIdInt
+import android.database.ContentObserver
+import android.net.Uri
+import android.os.UserHandle
+import android.provider.Settings.SettingNotFoundException
+import com.android.app.tracing.TraceUtils.trace
+import com.android.systemui.settings.UserTracker
+import com.android.systemui.util.settings.SettingsProxy.Companion.parseFloat
+import com.android.systemui.util.settings.SettingsProxy.Companion.parseFloatOrThrow
+import com.android.systemui.util.settings.SettingsProxy.Companion.parseLongOrThrow
+import com.android.systemui.util.settings.SettingsProxy.Companion.parseLongOrUseDefault
+
+/**
+ * Used to interact with per-user Settings.Secure and Settings.System settings (but not
+ * Settings.Global, since those do not vary per-user)
+ *
+ * This interface can be implemented to give instance method (instead of static method) versions of
+ * Settings.Secure and Settings.System. It can be injected into class constructors and then faked or
+ * mocked as needed in tests.
+ *
+ * You can ask for [SecureSettings] or [SystemSettings] to be injected as needed.
+ *
+ * This class also provides [.registerContentObserver] methods, normally found on [ContentResolver]
+ * instances, unifying setting related actions in one place.
+ */
+interface UserSettingsProxy : SettingsProxy {
+
+ /** Returns that [UserTracker] this instance was constructed with. */
+ val userTracker: UserTracker
+
+ /** Returns the user id for the associated [ContentResolver]. */
+ var userId: Int
+ get() = getContentResolver().userId
+ set(_) {
+ throw UnsupportedOperationException(
+ "userId cannot be set in interface, use setter from an implementation instead."
+ )
+ }
+
+ /**
+ * Returns the actual current user handle when querying with the current user. Otherwise,
+ * returns the passed in user id.
+ */
+ fun getRealUserHandle(userHandle: Int): Int {
+ return if (userHandle != UserHandle.USER_CURRENT) {
+ userHandle
+ } else userTracker.userId
+ }
+
+ override fun registerContentObserver(uri: Uri, settingsObserver: ContentObserver) {
+ registerContentObserverForUser(uri, settingsObserver, userId)
+ }
+
+ /** Convenience wrapper around [ContentResolver.registerContentObserver].' */
+ override fun registerContentObserver(
+ uri: Uri,
+ notifyForDescendants: Boolean,
+ settingsObserver: ContentObserver
+ ) {
+ registerContentObserverForUser(uri, notifyForDescendants, settingsObserver, userId)
+ }
+
+ /**
+ * Convenience wrapper around [ContentResolver.registerContentObserver]
+ *
+ * Implicitly calls [getUriFor] on the passed in name.
+ */
+ fun registerContentObserverForUser(
+ name: String,
+ settingsObserver: ContentObserver,
+ userHandle: Int
+ ) {
+ registerContentObserverForUser(getUriFor(name), settingsObserver, userHandle)
+ }
+
+ /** Convenience wrapper around [ContentResolver.registerContentObserver] */
+ fun registerContentObserverForUser(
+ uri: Uri,
+ settingsObserver: ContentObserver,
+ userHandle: Int
+ ) {
+ registerContentObserverForUser(uri, false, settingsObserver, userHandle)
+ }
+
+ /**
+ * Convenience wrapper around [ContentResolver.registerContentObserver]
+ *
+ * Implicitly calls [getUriFor] on the passed in name.
+ */
+ fun registerContentObserverForUser(
+ name: String,
+ notifyForDescendants: Boolean,
+ settingsObserver: ContentObserver,
+ userHandle: Int
+ ) {
+ registerContentObserverForUser(
+ getUriFor(name),
+ notifyForDescendants,
+ settingsObserver,
+ userHandle
+ )
+ }
+
+ /** Convenience wrapper around [ContentResolver.registerContentObserver] */
+ fun registerContentObserverForUser(
+ uri: Uri,
+ notifyForDescendants: Boolean,
+ settingsObserver: ContentObserver,
+ userHandle: Int
+ ) {
+ trace({ "USP#registerObserver#[$uri]" }) {
+ getContentResolver()
+ .registerContentObserver(
+ uri,
+ notifyForDescendants,
+ settingsObserver,
+ getRealUserHandle(userHandle)
+ )
+ Unit
+ }
+ }
+
+ /**
+ * Look up a name in the database.
+ *
+ * @param name to look up in the table
+ * @return the corresponding value, or null if not present
+ */
+ override fun getString(name: String): String {
+ return getStringForUser(name, userId)
+ }
+
+ /** See [getString]. */
+ fun getStringForUser(name: String, userHandle: Int): String
+
+ /**
+ * Store a name/value pair into the database. Values written by this method will be overridden
+ * if a restore happens in the future.
+ *
+ * @param name to store
+ * @param value to associate with the name
+ * @return true if the value was set, false on database errors
+ */
+ fun putString(name: String, value: String, overrideableByRestore: Boolean): Boolean
+ override fun putString(name: String, value: String): Boolean {
+ return putStringForUser(name, value, userId)
+ }
+
+ /** Similar implementation to [putString] for the specified [userHandle]. */
+ fun putStringForUser(name: String, value: String, userHandle: Int): Boolean
+
+ /** Similar implementation to [putString] for the specified [userHandle]. */
+ fun putStringForUser(
+ name: String,
+ value: String,
+ tag: String?,
+ makeDefault: Boolean,
+ @UserIdInt userHandle: Int,
+ overrideableByRestore: Boolean
+ ): Boolean
+
+ override fun getInt(name: String, def: Int): Int {
+ return getIntForUser(name, def, userId)
+ }
+
+ /** Similar implementation to [getInt] for the specified [userHandle]. */
+ fun getIntForUser(name: String, def: Int, userHandle: Int): Int {
+ val v = getStringForUser(name, userHandle)
+ return try {
+ v.toInt()
+ } catch (e: NumberFormatException) {
+ def
+ }
+ }
+
+ @Throws(SettingNotFoundException::class)
+ override fun getInt(name: String) = getIntForUser(name, userId)
+
+ /** Similar implementation to [getInt] for the specified [userHandle]. */
+ @Throws(SettingNotFoundException::class)
+ fun getIntForUser(name: String, userHandle: Int): Int {
+ val v = getStringForUser(name, userHandle)
+ return try {
+ v.toInt()
+ } catch (e: NumberFormatException) {
+ throw SettingNotFoundException(name)
+ }
+ }
+
+ override fun putInt(name: String, value: Int) = putIntForUser(name, value, userId)
+
+ /** Similar implementation to [getInt] for the specified [userHandle]. */
+ fun putIntForUser(name: String, value: Int, userHandle: Int) =
+ putStringForUser(name, value.toString(), userHandle)
+
+ override fun getBool(name: String, def: Boolean) = getBoolForUser(name, def, userId)
+
+ /** Similar implementation to [getBool] for the specified [userHandle]. */
+ fun getBoolForUser(name: String, def: Boolean, userHandle: Int) =
+ getIntForUser(name, if (def) 1 else 0, userHandle) != 0
+
+ @Throws(SettingNotFoundException::class)
+ override fun getBool(name: String) = getBoolForUser(name, userId)
+
+ /** Similar implementation to [getBool] for the specified [userHandle]. */
+ @Throws(SettingNotFoundException::class)
+ fun getBoolForUser(name: String, userHandle: Int): Boolean {
+ return getIntForUser(name, userHandle) != 0
+ }
+
+ override fun putBool(name: String, value: Boolean): Boolean {
+ return putBoolForUser(name, value, userId)
+ }
+
+ /** Similar implementation to [putBool] for the specified [userHandle]. */
+ fun putBoolForUser(name: String, value: Boolean, userHandle: Int) =
+ putIntForUser(name, if (value) 1 else 0, userHandle)
+
+ /** Similar implementation to [getLong] for the specified [userHandle]. */
+ fun getLongForUser(name: String, def: Long, userHandle: Int): Long {
+ val valString = getStringForUser(name, userHandle)
+ return parseLongOrUseDefault(valString, def)
+ }
+
+ /** Similar implementation to [getLong] for the specified [userHandle]. */
+ @Throws(SettingNotFoundException::class)
+ fun getLongForUser(name: String, userHandle: Int): Long {
+ val valString = getStringForUser(name, userHandle)
+ return parseLongOrThrow(name, valString)
+ }
+
+ /** Similar implementation to [putLong] for the specified [userHandle]. */
+ fun putLongForUser(name: String, value: Long, userHandle: Int) =
+ putStringForUser(name, value.toString(), userHandle)
+
+ /** Similar implementation to [getFloat] for the specified [userHandle]. */
+ fun getFloatForUser(name: String, def: Float, userHandle: Int): Float {
+ val v = getStringForUser(name, userHandle)
+ return parseFloat(v, def)
+ }
+
+ /** Similar implementation to [getFloat] for the specified [userHandle]. */
+ @Throws(SettingNotFoundException::class)
+ fun getFloatForUser(name: String, userHandle: Int): Float {
+ val v = getStringForUser(name, userHandle)
+ return parseFloatOrThrow(name, v)
+ }
+
+ /** Similar implementation to [putFloat] for the specified [userHandle]. */
+ fun putFloatForUser(name: String, value: Float, userHandle: Int) =
+ putStringForUser(name, value.toString(), userHandle)
+}
diff --git a/packages/SystemUI/src/com/android/systemui/volume/panel/component/anc/data/repository/AncSliceRepository.kt b/packages/SystemUI/src/com/android/systemui/volume/panel/component/anc/data/repository/AncSliceRepository.kt
index 3117abc44111..e1787e8b0a9e 100644
--- a/packages/SystemUI/src/com/android/systemui/volume/panel/component/anc/data/repository/AncSliceRepository.kt
+++ b/packages/SystemUI/src/com/android/systemui/volume/panel/component/anc/data/repository/AncSliceRepository.kt
@@ -21,22 +21,15 @@ import android.net.Uri
import androidx.slice.Slice
import androidx.slice.SliceViewManager
import com.android.settingslib.bluetooth.BluetoothUtils
-import com.android.settingslib.media.BluetoothMediaDevice
-import com.android.systemui.dagger.qualifiers.Background
import com.android.systemui.dagger.qualifiers.Main
import com.android.systemui.slice.sliceForUri
-import com.android.systemui.volume.panel.component.mediaoutput.data.repository.LocalMediaRepositoryFactory
import dagger.assisted.Assisted
import dagger.assisted.AssistedFactory
import dagger.assisted.AssistedInject
import kotlin.coroutines.CoroutineContext
-import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.flow.Flow
-import kotlinx.coroutines.flow.distinctUntilChanged
-import kotlinx.coroutines.flow.flatMapLatest
import kotlinx.coroutines.flow.flowOf
import kotlinx.coroutines.flow.flowOn
-import kotlinx.coroutines.flow.map
/** Provides ANC slice data */
interface AncSliceRepository {
@@ -49,35 +42,30 @@ interface AncSliceRepository {
* - there is no supported device connected;
* - there is no slice provider for the uri;
*/
- fun ancSlice(width: Int, isCollapsed: Boolean, hideLabel: Boolean): Flow<Slice?>
+ fun ancSlice(
+ device: BluetoothDevice,
+ width: Int,
+ isCollapsed: Boolean,
+ hideLabel: Boolean
+ ): Flow<Slice?>
}
-@OptIn(ExperimentalCoroutinesApi::class)
class AncSliceRepositoryImpl
@AssistedInject
constructor(
- mediaRepositoryFactory: LocalMediaRepositoryFactory,
- @Background private val backgroundCoroutineContext: CoroutineContext,
@Main private val mainCoroutineContext: CoroutineContext,
@Assisted private val sliceViewManager: SliceViewManager,
) : AncSliceRepository {
- private val localMediaRepository = mediaRepositoryFactory.create(null)
-
- override fun ancSlice(width: Int, isCollapsed: Boolean, hideLabel: Boolean): Flow<Slice?> {
- return localMediaRepository.currentConnectedDevice
- .map {
- (it as? BluetoothMediaDevice)
- ?.cachedDevice
- ?.device
- ?.getExtraControlUri(width, isCollapsed, hideLabel)
- }
- .distinctUntilChanged()
- .flatMapLatest { sliceUri ->
- sliceUri ?: return@flatMapLatest flowOf(null)
- sliceViewManager.sliceForUri(sliceUri).flowOn(mainCoroutineContext)
- }
- .flowOn(backgroundCoroutineContext)
+ override fun ancSlice(
+ device: BluetoothDevice,
+ width: Int,
+ isCollapsed: Boolean,
+ hideLabel: Boolean
+ ): Flow<Slice?> {
+ val sliceUri =
+ device.getExtraControlUri(width, isCollapsed, hideLabel) ?: return flowOf(null)
+ return sliceViewManager.sliceForUri(sliceUri).flowOn(mainCoroutineContext)
}
private fun BluetoothDevice.getExtraControlUri(
diff --git a/packages/SystemUI/src/com/android/systemui/volume/panel/component/anc/domain/interactor/AncSliceInteractor.kt b/packages/SystemUI/src/com/android/systemui/volume/panel/component/anc/domain/interactor/AncSliceInteractor.kt
index cefa26907710..cfff45736159 100644
--- a/packages/SystemUI/src/com/android/systemui/volume/panel/component/anc/domain/interactor/AncSliceInteractor.kt
+++ b/packages/SystemUI/src/com/android/systemui/volume/panel/component/anc/domain/interactor/AncSliceInteractor.kt
@@ -19,6 +19,8 @@ package com.android.systemui.volume.panel.component.anc.domain.interactor
import android.app.slice.Slice.HINT_ERROR
import android.app.slice.SliceItem.FORMAT_SLICE
import androidx.slice.Slice
+import com.android.systemui.volume.domain.interactor.AudioOutputInteractor
+import com.android.systemui.volume.domain.model.AudioOutputDevice
import com.android.systemui.volume.panel.component.anc.data.repository.AncSliceRepository
import com.android.systemui.volume.panel.component.anc.domain.model.AncSlices
import com.android.systemui.volume.panel.dagger.scope.VolumePanelScope
@@ -32,6 +34,7 @@ import kotlinx.coroutines.flow.StateFlow
import kotlinx.coroutines.flow.combine
import kotlinx.coroutines.flow.filter
import kotlinx.coroutines.flow.flatMapLatest
+import kotlinx.coroutines.flow.flowOf
import kotlinx.coroutines.flow.stateIn
/** Provides a valid slice from [AncSliceRepository]. */
@@ -40,6 +43,7 @@ import kotlinx.coroutines.flow.stateIn
class AncSliceInteractor
@Inject
constructor(
+ private val audioOutputInteractor: AudioOutputInteractor,
private val ancSliceRepository: AncSliceRepository,
scope: CoroutineScope,
) {
@@ -70,9 +74,20 @@ constructor(
* remove the labels from the [Slice].
*/
private fun ancSlice(width: Int, isCollapsed: Boolean, hideLabel: Boolean): Flow<Slice?> {
- return ancSliceRepository
- .ancSlice(width = width, isCollapsed = isCollapsed, hideLabel = hideLabel)
- .filter { it?.isValidSlice() != false }
+ return audioOutputInteractor.currentAudioDevice.flatMapLatest { outputDevice ->
+ if (outputDevice is AudioOutputDevice.Bluetooth) {
+ ancSliceRepository
+ .ancSlice(
+ device = outputDevice.cachedBluetoothDevice.device,
+ width = width,
+ isCollapsed = isCollapsed,
+ hideLabel = hideLabel,
+ )
+ .filter { it?.isValidSlice() != false }
+ } else {
+ flowOf(null)
+ }
+ }
}
private fun Slice.isValidSlice(): Boolean {
diff --git a/packages/SystemUI/src/com/android/systemui/volume/panel/component/mediaoutput/domain/interactor/MediaControllerInteractor.kt b/packages/SystemUI/src/com/android/systemui/volume/panel/component/mediaoutput/domain/interactor/MediaControllerInteractor.kt
index 4812765d4afe..a714f8078db7 100644
--- a/packages/SystemUI/src/com/android/systemui/volume/panel/component/mediaoutput/domain/interactor/MediaControllerInteractor.kt
+++ b/packages/SystemUI/src/com/android/systemui/volume/panel/component/mediaoutput/domain/interactor/MediaControllerInteractor.kt
@@ -86,7 +86,7 @@ private class MediaControllerCallbackProducer(
send(MediaControllerChangeModel.ExtrasChanged(extras))
}
- override fun onAudioInfoChanged(info: MediaController.PlaybackInfo?) {
+ override fun onAudioInfoChanged(info: MediaController.PlaybackInfo) {
send(MediaControllerChangeModel.AudioInfoChanged(info))
}
diff --git a/packages/SystemUI/src/com/android/systemui/volume/panel/component/mediaoutput/domain/interactor/MediaDeviceSessionInteractor.kt b/packages/SystemUI/src/com/android/systemui/volume/panel/component/mediaoutput/domain/interactor/MediaDeviceSessionInteractor.kt
index 599bd73abb69..6e1ebc820b08 100644
--- a/packages/SystemUI/src/com/android/systemui/volume/panel/component/mediaoutput/domain/interactor/MediaDeviceSessionInteractor.kt
+++ b/packages/SystemUI/src/com/android/systemui/volume/panel/component/mediaoutput/domain/interactor/MediaDeviceSessionInteractor.kt
@@ -57,7 +57,7 @@ constructor(
}
/** [MediaController.PlaybackInfo] changes for the [MediaDeviceSession]. */
- fun playbackInfo(session: MediaDeviceSession): Flow<MediaController.PlaybackInfo?> {
+ fun playbackInfo(session: MediaDeviceSession): Flow<MediaController.PlaybackInfo> {
return stateChanges(session) {
emit(MediaControllerChangeModel.AudioInfoChanged(it.playbackInfo))
}
diff --git a/packages/SystemUI/src/com/android/systemui/volume/panel/component/mediaoutput/domain/model/MediaControllerChangeModel.kt b/packages/SystemUI/src/com/android/systemui/volume/panel/component/mediaoutput/domain/model/MediaControllerChangeModel.kt
index ef5a44a7a2fd..8b5116a64365 100644
--- a/packages/SystemUI/src/com/android/systemui/volume/panel/component/mediaoutput/domain/model/MediaControllerChangeModel.kt
+++ b/packages/SystemUI/src/com/android/systemui/volume/panel/component/mediaoutput/domain/model/MediaControllerChangeModel.kt
@@ -40,6 +40,6 @@ sealed interface MediaControllerChangeModel {
data class ExtrasChanged(val extras: Bundle?) : MediaControllerChangeModel
- data class AudioInfoChanged(val info: MediaController.PlaybackInfo?) :
+ data class AudioInfoChanged(val info: MediaController.PlaybackInfo) :
MediaControllerChangeModel
}
diff --git a/packages/SystemUI/src/com/android/systemui/volume/panel/component/spatial/domain/interactor/SpatialAudioComponentInteractor.kt b/packages/SystemUI/src/com/android/systemui/volume/panel/component/spatial/domain/interactor/SpatialAudioComponentInteractor.kt
index 298ca67d92a8..9ca50d6f136b 100644
--- a/packages/SystemUI/src/com/android/systemui/volume/panel/component/spatial/domain/interactor/SpatialAudioComponentInteractor.kt
+++ b/packages/SystemUI/src/com/android/systemui/volume/panel/component/spatial/domain/interactor/SpatialAudioComponentInteractor.kt
@@ -18,11 +18,9 @@ package com.android.systemui.volume.panel.component.spatial.domain.interactor
import android.media.AudioDeviceAttributes
import android.media.AudioDeviceInfo
-import com.android.settingslib.media.BluetoothMediaDevice
-import com.android.settingslib.media.MediaDevice
-import com.android.settingslib.media.PhoneMediaDevice
import com.android.settingslib.media.domain.interactor.SpatializerInteractor
-import com.android.systemui.volume.panel.component.mediaoutput.domain.interactor.MediaOutputInteractor
+import com.android.systemui.volume.domain.interactor.AudioOutputInteractor
+import com.android.systemui.volume.domain.model.AudioOutputDevice
import com.android.systemui.volume.panel.component.spatial.domain.model.SpatialAudioAvailabilityModel
import com.android.systemui.volume.panel.component.spatial.domain.model.SpatialAudioEnabledModel
import com.android.systemui.volume.panel.dagger.scope.VolumePanelScope
@@ -46,16 +44,20 @@ import kotlinx.coroutines.flow.stateIn
class SpatialAudioComponentInteractor
@Inject
constructor(
- mediaOutputInteractor: MediaOutputInteractor,
+ audioOutputInteractor: AudioOutputInteractor,
private val spatializerInteractor: SpatializerInteractor,
@VolumePanelScope private val coroutineScope: CoroutineScope,
) {
private val changes = MutableSharedFlow<Unit>()
private val currentAudioDeviceAttributes: StateFlow<AudioDeviceAttributes?> =
- mediaOutputInteractor.currentConnectedDevice
- .map { mediaDevice ->
- if (mediaDevice == null) builtinSpeaker else mediaDevice.getAudioDeviceAttributes()
+ audioOutputInteractor.currentAudioDevice
+ .map { audioDevice ->
+ if (audioDevice is AudioOutputDevice.Unknown) {
+ builtinSpeaker
+ } else {
+ audioDevice.getAudioDeviceAttributes()
+ }
}
.stateIn(coroutineScope, SharingStarted.WhileSubscribed(), builtinSpeaker)
@@ -135,36 +137,35 @@ constructor(
changes.emit(Unit)
}
- private suspend fun MediaDevice.getAudioDeviceAttributes(): AudioDeviceAttributes? {
+ private suspend fun AudioOutputDevice.getAudioDeviceAttributes(): AudioDeviceAttributes? {
when (this) {
- is PhoneMediaDevice -> return builtinSpeaker
- is BluetoothMediaDevice -> {
- val device = cachedDevice ?: return null
+ is AudioOutputDevice.BuiltIn -> return builtinSpeaker
+ is AudioOutputDevice.Bluetooth -> {
return listOf(
AudioDeviceAttributes(
AudioDeviceAttributes.ROLE_OUTPUT,
AudioDeviceInfo.TYPE_BLE_HEADSET,
- device.address,
+ cachedBluetoothDevice.address,
),
AudioDeviceAttributes(
AudioDeviceAttributes.ROLE_OUTPUT,
AudioDeviceInfo.TYPE_BLE_SPEAKER,
- device.address,
+ cachedBluetoothDevice.address,
),
AudioDeviceAttributes(
AudioDeviceAttributes.ROLE_OUTPUT,
AudioDeviceInfo.TYPE_BLE_BROADCAST,
- device.address,
+ cachedBluetoothDevice.address,
),
AudioDeviceAttributes(
AudioDeviceAttributes.ROLE_OUTPUT,
AudioDeviceInfo.TYPE_BLUETOOTH_A2DP,
- device.address,
+ cachedBluetoothDevice.address,
),
AudioDeviceAttributes(
AudioDeviceAttributes.ROLE_OUTPUT,
AudioDeviceInfo.TYPE_HEARING_AID,
- device.address,
+ cachedBluetoothDevice.address,
)
)
.firstOrNull { spatializerInteractor.isSpatialAudioAvailable(it) }
diff --git a/packages/SystemUI/src/com/android/systemui/volume/panel/component/volume/slider/ui/viewmodel/AudioStreamSliderViewModel.kt b/packages/SystemUI/src/com/android/systemui/volume/panel/component/volume/slider/ui/viewmodel/AudioStreamSliderViewModel.kt
index c08cd64e4e8c..fd01b4864772 100644
--- a/packages/SystemUI/src/com/android/systemui/volume/panel/component/volume/slider/ui/viewmodel/AudioStreamSliderViewModel.kt
+++ b/packages/SystemUI/src/com/android/systemui/volume/panel/component/volume/slider/ui/viewmodel/AudioStreamSliderViewModel.kt
@@ -77,8 +77,6 @@ constructor(
mapOf(
AudioStream(AudioManager.STREAM_NOTIFICATION) to
R.string.stream_notification_unavailable,
- AudioStream(AudioManager.STREAM_ALARM) to R.string.stream_alarm_unavailable,
- AudioStream(AudioManager.STREAM_MUSIC) to R.string.stream_media_unavailable,
)
private val uiEventByStream =
mapOf(
@@ -126,7 +124,7 @@ constructor(
}
}
- private suspend fun AudioStreamModel.toState(
+ private fun AudioStreamModel.toState(
isEnabled: Boolean,
ringerMode: RingerMode,
): State {
@@ -138,7 +136,13 @@ constructor(
valueRange = volumeRange.first.toFloat()..volumeRange.last.toFloat(),
icon = getIcon(ringerMode),
label = label,
- disabledMessage = disabledTextByStream[audioStream]?.let(context::getString),
+ disabledMessage =
+ context.getString(
+ disabledTextByStream.getOrDefault(
+ audioStream,
+ R.string.stream_alarm_unavailable,
+ )
+ ),
isEnabled = isEnabled,
a11yStep = volumeRange.step,
a11yClickDescription =
@@ -167,14 +171,13 @@ constructor(
null
},
audioStreamModel = this,
- isMutable = audioVolumeInteractor.isAffectedByMute(audioStream),
+ isMutable = isAffectedByMute,
)
}
private fun AudioStreamModel.getIcon(ringerMode: RingerMode): Icon {
- val isMutedOrNoVolume = isMuted || volume == minVolume
val iconRes =
- if (isMutedOrNoVolume) {
+ if (isAffectedByMute && isMuted) {
if (audioStream.value in streamsAffectedByRing) {
if (ringerMode.value == AudioManager.RINGER_MODE_VIBRATE) {
R.drawable.ic_volume_ringer_vibrate
diff --git a/packages/SystemUI/tests/goldens/animateFailure.json b/packages/SystemUI/tests/goldens/animateFailure.json
new file mode 100644
index 000000000000..a008f922969b
--- /dev/null
+++ b/packages/SystemUI/tests/goldens/animateFailure.json
@@ -0,0 +1,612 @@
+{
+ "frame_ids": [
+ "before",
+ 0,
+ 16,
+ 32,
+ 48,
+ 64,
+ 80,
+ 96,
+ 112,
+ 128,
+ 144,
+ 160,
+ 176,
+ 192,
+ 208,
+ 224,
+ 240,
+ 256,
+ 272,
+ 288,
+ 304,
+ 320,
+ 336,
+ 352,
+ 368,
+ 384,
+ 400,
+ 416,
+ 432,
+ 448,
+ 464,
+ 480,
+ 496,
+ 512,
+ 528,
+ 544,
+ 560,
+ 576,
+ 592,
+ 608,
+ 624,
+ 640,
+ 656,
+ 672,
+ 688,
+ 704,
+ 720,
+ 736,
+ 752,
+ "after"
+ ],
+ "features": [
+ {
+ "name": "PinBouncer::dotScaling",
+ "type": "float[]",
+ "data_points": [
+ [
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1
+ ],
+ [
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1
+ ],
+ [
+ 0.93142855,
+ 1,
+ 1,
+ 0.93142855,
+ 1,
+ 1,
+ 0.93142855,
+ 1,
+ 1
+ ],
+ [
+ 0.86285716,
+ 1,
+ 1,
+ 0.86285716,
+ 1,
+ 1,
+ 0.86285716,
+ 1,
+ 1
+ ],
+ [
+ 0.7942857,
+ 0.93571424,
+ 1,
+ 0.7942857,
+ 0.93571424,
+ 1,
+ 0.7942857,
+ 0.93571424,
+ 1
+ ],
+ [
+ 0.78571427,
+ 0.86714286,
+ 1,
+ 0.78571427,
+ 0.86714286,
+ 1,
+ 0.78571427,
+ 0.86714286,
+ 1
+ ],
+ [
+ 0.78571427,
+ 0.7985714,
+ 0.94000006,
+ 0.78571427,
+ 0.7985714,
+ 0.94000006,
+ 0.78571427,
+ 0.7985714,
+ 0.94000006
+ ],
+ [
+ 0.7872844,
+ 0.78571427,
+ 0.87142855,
+ 0.7872844,
+ 0.78571427,
+ 0.87142855,
+ 0.7872844,
+ 0.78571427,
+ 0.87142855
+ ],
+ [
+ 0.7925441,
+ 0.78571427,
+ 0.8028571,
+ 0.7925441,
+ 0.78571427,
+ 0.8028571,
+ 0.7925441,
+ 0.78571427,
+ 0.8028571
+ ],
+ [
+ 0.8037901,
+ 0.7872844,
+ 0.78571427,
+ 0.8037901,
+ 0.7872844,
+ 0.78571427,
+ 0.8037901,
+ 0.7872844,
+ 0.78571427
+ ],
+ [
+ 0.8223549,
+ 0.7925441,
+ 0.78571427,
+ 0.8223549,
+ 0.7925441,
+ 0.78571427,
+ 0.8223549,
+ 0.7925441,
+ 0.78571427
+ ],
+ [
+ 0.84427696,
+ 0.8037901,
+ 0.7872844,
+ 0.84427696,
+ 0.8037901,
+ 0.7872844,
+ 0.84427696,
+ 0.8037901,
+ 0.7872844
+ ],
+ [
+ 0.864585,
+ 0.8223549,
+ 0.7925441,
+ 0.864585,
+ 0.8223549,
+ 0.7925441,
+ 0.864585,
+ 0.8223549,
+ 0.7925441
+ ],
+ [
+ 0.8817363,
+ 0.84427696,
+ 0.8037901,
+ 0.8817363,
+ 0.84427696,
+ 0.8037901,
+ 0.8817363,
+ 0.84427696,
+ 0.8037901
+ ],
+ [
+ 0.89635646,
+ 0.864585,
+ 0.8223549,
+ 0.89635646,
+ 0.864585,
+ 0.8223549,
+ 0.89635646,
+ 0.864585,
+ 0.8223549
+ ],
+ [
+ 0.908528,
+ 0.8817363,
+ 0.84427696,
+ 0.908528,
+ 0.8817363,
+ 0.84427696,
+ 0.908528,
+ 0.8817363,
+ 0.84427696
+ ],
+ [
+ 0.91881,
+ 0.89635646,
+ 0.864585,
+ 0.91881,
+ 0.89635646,
+ 0.864585,
+ 0.91881,
+ 0.89635646,
+ 0.864585
+ ],
+ [
+ 0.9280548,
+ 0.908528,
+ 0.8817363,
+ 0.9280548,
+ 0.908528,
+ 0.8817363,
+ 0.9280548,
+ 0.908528,
+ 0.8817363
+ ],
+ [
+ 0.9362979,
+ 0.91881,
+ 0.89635646,
+ 0.9362979,
+ 0.91881,
+ 0.89635646,
+ 0.9362979,
+ 0.91881,
+ 0.89635646
+ ],
+ [
+ 0.9433999,
+ 0.9280548,
+ 0.908528,
+ 0.9433999,
+ 0.9280548,
+ 0.908528,
+ 0.9433999,
+ 0.9280548,
+ 0.908528
+ ],
+ [
+ 0.9497632,
+ 0.9362979,
+ 0.91881,
+ 0.9497632,
+ 0.9362979,
+ 0.91881,
+ 0.9497632,
+ 0.9362979,
+ 0.91881
+ ],
+ [
+ 0.9552536,
+ 0.9433999,
+ 0.9280548,
+ 0.9552536,
+ 0.9433999,
+ 0.9280548,
+ 0.9552536,
+ 0.9433999,
+ 0.9280548
+ ],
+ [
+ 0.96035147,
+ 0.9497632,
+ 0.9362979,
+ 0.96035147,
+ 0.9497632,
+ 0.9362979,
+ 0.96035147,
+ 0.9497632,
+ 0.9362979
+ ],
+ [
+ 0.9649086,
+ 0.9552536,
+ 0.9433999,
+ 0.9649086,
+ 0.9552536,
+ 0.9433999,
+ 0.9649086,
+ 0.9552536,
+ 0.9433999
+ ],
+ [
+ 0.96897155,
+ 0.96035147,
+ 0.9497632,
+ 0.96897155,
+ 0.96035147,
+ 0.9497632,
+ 0.96897155,
+ 0.96035147,
+ 0.9497632
+ ],
+ [
+ 0.9727647,
+ 0.9649086,
+ 0.9552536,
+ 0.9727647,
+ 0.9649086,
+ 0.9552536,
+ 0.9727647,
+ 0.9649086,
+ 0.9552536
+ ],
+ [
+ 0.9760455,
+ 0.96897155,
+ 0.96035147,
+ 0.9760455,
+ 0.96897155,
+ 0.96035147,
+ 0.9760455,
+ 0.96897155,
+ 0.96035147
+ ],
+ [
+ 0.97915274,
+ 0.9727647,
+ 0.9649086,
+ 0.97915274,
+ 0.9727647,
+ 0.9649086,
+ 0.97915274,
+ 0.9727647,
+ 0.9649086
+ ],
+ [
+ 0.98185575,
+ 0.9760455,
+ 0.96897155,
+ 0.98185575,
+ 0.9760455,
+ 0.96897155,
+ 0.98185575,
+ 0.9760455,
+ 0.96897155
+ ],
+ [
+ 0.98434585,
+ 0.97915274,
+ 0.9727647,
+ 0.98434585,
+ 0.97915274,
+ 0.9727647,
+ 0.98434585,
+ 0.97915274,
+ 0.9727647
+ ],
+ [
+ 0.9866356,
+ 0.98185575,
+ 0.9760455,
+ 0.9866356,
+ 0.98185575,
+ 0.9760455,
+ 0.9866356,
+ 0.98185575,
+ 0.9760455
+ ],
+ [
+ 0.98856884,
+ 0.98434585,
+ 0.97915274,
+ 0.98856884,
+ 0.98434585,
+ 0.97915274,
+ 0.98856884,
+ 0.98434585,
+ 0.97915274
+ ],
+ [
+ 0.99050206,
+ 0.9866356,
+ 0.98185575,
+ 0.99050206,
+ 0.9866356,
+ 0.98185575,
+ 0.99050206,
+ 0.9866356,
+ 0.98185575
+ ],
+ [
+ 0.9920071,
+ 0.98856884,
+ 0.98434585,
+ 0.9920071,
+ 0.98856884,
+ 0.98434585,
+ 0.9920071,
+ 0.98856884,
+ 0.98434585
+ ],
+ [
+ 0.99343646,
+ 0.99050206,
+ 0.9866356,
+ 0.99343646,
+ 0.99050206,
+ 0.9866356,
+ 0.99343646,
+ 0.99050206,
+ 0.9866356
+ ],
+ [
+ 0.99481374,
+ 0.9920071,
+ 0.98856884,
+ 0.99481374,
+ 0.9920071,
+ 0.98856884,
+ 0.99481374,
+ 0.9920071,
+ 0.98856884
+ ],
+ [
+ 0.99578595,
+ 0.99343646,
+ 0.99050206,
+ 0.99578595,
+ 0.99343646,
+ 0.99050206,
+ 0.99578595,
+ 0.99343646,
+ 0.99050206
+ ],
+ [
+ 0.9967581,
+ 0.99481374,
+ 0.9920071,
+ 0.9967581,
+ 0.99481374,
+ 0.9920071,
+ 0.9967581,
+ 0.99481374,
+ 0.9920071
+ ],
+ [
+ 0.9976717,
+ 0.99578595,
+ 0.99343646,
+ 0.9976717,
+ 0.99578595,
+ 0.99343646,
+ 0.9976717,
+ 0.99578595,
+ 0.99343646
+ ],
+ [
+ 0.99822795,
+ 0.9967581,
+ 0.99481374,
+ 0.99822795,
+ 0.9967581,
+ 0.99481374,
+ 0.99822795,
+ 0.9967581,
+ 0.99481374
+ ],
+ [
+ 0.99878407,
+ 0.9976717,
+ 0.99578595,
+ 0.99878407,
+ 0.9976717,
+ 0.99578595,
+ 0.99878407,
+ 0.9976717,
+ 0.99578595
+ ],
+ [
+ 0.9993403,
+ 0.99822795,
+ 0.9967581,
+ 0.9993403,
+ 0.99822795,
+ 0.9967581,
+ 0.9993403,
+ 0.99822795,
+ 0.9967581
+ ],
+ [
+ 0.99954754,
+ 0.99878407,
+ 0.9976717,
+ 0.99954754,
+ 0.99878407,
+ 0.9976717,
+ 0.99954754,
+ 0.99878407,
+ 0.9976717
+ ],
+ [
+ 0.9997241,
+ 0.9993403,
+ 0.99822795,
+ 0.9997241,
+ 0.9993403,
+ 0.99822795,
+ 0.9997241,
+ 0.9993403,
+ 0.99822795
+ ],
+ [
+ 0.9999007,
+ 0.99954754,
+ 0.99878407,
+ 0.9999007,
+ 0.99954754,
+ 0.99878407,
+ 0.9999007,
+ 0.99954754,
+ 0.99878407
+ ],
+ [
+ 1,
+ 0.9997241,
+ 0.9993403,
+ 1,
+ 0.9997241,
+ 0.9993403,
+ 1,
+ 0.9997241,
+ 0.9993403
+ ],
+ [
+ 1,
+ 0.9999007,
+ 0.99954754,
+ 1,
+ 0.9999007,
+ 0.99954754,
+ 1,
+ 0.9999007,
+ 0.99954754
+ ],
+ [
+ 1,
+ 1,
+ 0.9997241,
+ 1,
+ 1,
+ 0.9997241,
+ 1,
+ 1,
+ 0.9997241
+ ],
+ [
+ 1,
+ 1,
+ 0.9999007,
+ 1,
+ 1,
+ 0.9999007,
+ 1,
+ 1,
+ 0.9999007
+ ],
+ [
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1
+ ]
+ ]
+ }
+ ]
+} \ No newline at end of file
diff --git a/packages/SystemUI/tests/goldens/doubleClick_swapSide.json b/packages/SystemUI/tests/goldens/doubleClick_swapSide.json
new file mode 100644
index 000000000000..044ddbc133b2
--- /dev/null
+++ b/packages/SystemUI/tests/goldens/doubleClick_swapSide.json
@@ -0,0 +1,195 @@
+{
+ "frame_ids": [
+ "before",
+ 0,
+ 16,
+ 32,
+ 48,
+ 64,
+ 80,
+ 96,
+ 112,
+ 128,
+ 144,
+ 160,
+ 176,
+ 192,
+ "after"
+ ],
+ "features": [
+ {
+ "name": "userSwitcher_pos",
+ "type": "dpOffset",
+ "data_points": [
+ {
+ "x": 0,
+ "y": 96
+ },
+ {
+ "x": 0,
+ "y": 96
+ },
+ {
+ "x": 0,
+ "y": 96
+ },
+ {
+ "x": 0,
+ "y": 96
+ },
+ {
+ "x": 45.008995,
+ "y": 96
+ },
+ {
+ "x": 123.20912,
+ "y": 96
+ },
+ {
+ "x": 194.33762,
+ "y": 96
+ },
+ {
+ "x": 248.24419,
+ "y": 96
+ },
+ {
+ "x": 285.66364,
+ "y": 96
+ },
+ {
+ "x": 310.326,
+ "y": 96
+ },
+ {
+ "x": 326.03296,
+ "y": 96
+ },
+ {
+ "x": 335.79584,
+ "y": 96
+ },
+ {
+ "x": 341.7547,
+ "y": 96
+ },
+ {
+ "x": 345.34082,
+ "y": 96
+ },
+ {
+ "x": 350.4762,
+ "y": 96
+ }
+ ]
+ },
+ {
+ "name": "userSwitcher_alpha",
+ "type": "float",
+ "data_points": [
+ 1,
+ 1,
+ 1,
+ 1,
+ 0.44034958,
+ 0,
+ 0,
+ 0,
+ 0.24635443,
+ 0.49282384,
+ 0.67560554,
+ 0.7993379,
+ 0.8786727,
+ 0.9278107,
+ 1
+ ]
+ },
+ {
+ "name": "foldAware_pos",
+ "type": "dpOffset",
+ "data_points": [
+ {
+ "x": 350.4762,
+ "y": 96
+ },
+ {
+ "x": 350.4762,
+ "y": 96
+ },
+ {
+ "x": 350.4762,
+ "y": 96
+ },
+ {
+ "x": 350.4762,
+ "y": 96
+ },
+ {
+ "x": 305.4672,
+ "y": 96
+ },
+ {
+ "x": 227.26706,
+ "y": 96
+ },
+ {
+ "x": 156.13857,
+ "y": 96
+ },
+ {
+ "x": 102.232,
+ "y": 96
+ },
+ {
+ "x": 64.81257,
+ "y": 96
+ },
+ {
+ "x": 40.150204,
+ "y": 96
+ },
+ {
+ "x": 24.443243,
+ "y": 96
+ },
+ {
+ "x": 14.680362,
+ "y": 96
+ },
+ {
+ "x": 8.721494,
+ "y": 96
+ },
+ {
+ "x": 5.1353703,
+ "y": 96
+ },
+ {
+ "x": 0,
+ "y": 96
+ }
+ ]
+ },
+ {
+ "name": "foldAware_alpha",
+ "type": "float",
+ "data_points": [
+ 1,
+ 1,
+ 1,
+ 1,
+ 0.44034958,
+ 0,
+ 0,
+ 0,
+ 0.24635443,
+ 0.49282384,
+ 0.67560554,
+ 0.7993379,
+ 0.8786727,
+ 0.9278107,
+ 1
+ ]
+ }
+ ]
+} \ No newline at end of file
diff --git a/packages/SystemUI/tests/goldens/entryAnimation.json b/packages/SystemUI/tests/goldens/entryAnimation.json
new file mode 100644
index 000000000000..11bf09f8bcd8
--- /dev/null
+++ b/packages/SystemUI/tests/goldens/entryAnimation.json
@@ -0,0 +1,823 @@
+{
+ "frame_ids": [
+ 0,
+ 16,
+ 32,
+ 48,
+ 64,
+ 80,
+ 96,
+ 112,
+ 128,
+ 144,
+ 160,
+ 176,
+ 192,
+ 208,
+ 224,
+ 240,
+ 256,
+ 272,
+ 288,
+ 304,
+ 320,
+ 336,
+ 352,
+ 368,
+ 384,
+ 400,
+ 416,
+ 432,
+ 448,
+ 464,
+ 480,
+ 496,
+ 512,
+ 528,
+ "after"
+ ],
+ "features": [
+ {
+ "name": "PinBouncer::dotAppearFadeIn",
+ "type": "float[]",
+ "data_points": [
+ [
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0
+ ],
+ [
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0
+ ],
+ [
+ 0.13006775,
+ 0,
+ 0,
+ 0.13006775,
+ 0,
+ 0,
+ 0.13006775,
+ 0,
+ 0
+ ],
+ [
+ 0.23268975,
+ 0,
+ 0,
+ 0.23268975,
+ 0,
+ 0,
+ 0.23268975,
+ 0,
+ 0
+ ],
+ [
+ 0.31893033,
+ 0.12296748,
+ 0,
+ 0.31893033,
+ 0.12296748,
+ 0,
+ 0.31893033,
+ 0.12296748,
+ 0
+ ],
+ [
+ 0.3938481,
+ 0.22658443,
+ 0,
+ 0.3938481,
+ 0.22658443,
+ 0,
+ 0.3938481,
+ 0.22658443,
+ 0
+ ],
+ [
+ 0.45988238,
+ 0.3139104,
+ 0.115867205,
+ 0.45988238,
+ 0.3139104,
+ 0.115867205,
+ 0.45988238,
+ 0.3139104,
+ 0.115867205
+ ],
+ [
+ 0.52037334,
+ 0.38916573,
+ 0.22036704,
+ 0.52037334,
+ 0.38916573,
+ 0.22036704,
+ 0.52037334,
+ 0.38916573,
+ 0.22036704
+ ],
+ [
+ 0.57470226,
+ 0.45587063,
+ 0.3084957,
+ 0.57470226,
+ 0.45587063,
+ 0.3084957,
+ 0.57470226,
+ 0.45587063,
+ 0.3084957
+ ],
+ [
+ 0.6230466,
+ 0.5169778,
+ 0.38448337,
+ 0.6230466,
+ 0.5169778,
+ 0.38448337,
+ 0.6230466,
+ 0.5169778,
+ 0.38448337
+ ],
+ [
+ 0.6682857,
+ 0.5713067,
+ 0.45185885,
+ 0.6682857,
+ 0.5713067,
+ 0.45185885,
+ 0.6682857,
+ 0.5713067,
+ 0.45185885
+ ],
+ [
+ 0.7079632,
+ 0.6202191,
+ 0.5135822,
+ 0.7079632,
+ 0.6202191,
+ 0.5135822,
+ 0.7079632,
+ 0.6202191,
+ 0.5135822
+ ],
+ [
+ 0.7447962,
+ 0.6654583,
+ 0.56791115,
+ 0.7447962,
+ 0.6654583,
+ 0.56791115,
+ 0.7447962,
+ 0.6654583,
+ 0.56791115
+ ],
+ [
+ 0.77875835,
+ 0.7056612,
+ 0.6173917,
+ 0.77875835,
+ 0.7056612,
+ 0.6173917,
+ 0.77875835,
+ 0.7056612,
+ 0.6173917
+ ],
+ [
+ 0.80779475,
+ 0.74249417,
+ 0.66263086,
+ 0.80779475,
+ 0.74249417,
+ 0.66263086,
+ 0.80779475,
+ 0.74249417,
+ 0.66263086
+ ],
+ [
+ 0.83683115,
+ 0.77694356,
+ 0.7033591,
+ 0.83683115,
+ 0.77694356,
+ 0.7033591,
+ 0.83683115,
+ 0.77694356,
+ 0.7033591
+ ],
+ [
+ 0.86171645,
+ 0.80597997,
+ 0.7401921,
+ 0.86171645,
+ 0.80597997,
+ 0.7401921,
+ 0.86171645,
+ 0.80597997,
+ 0.7401921
+ ],
+ [
+ 0.884127,
+ 0.83501637,
+ 0.7751288,
+ 0.884127,
+ 0.83501637,
+ 0.7751288,
+ 0.884127,
+ 0.83501637,
+ 0.7751288
+ ],
+ [
+ 0.9042124,
+ 0.86024225,
+ 0.8041652,
+ 0.9042124,
+ 0.86024225,
+ 0.8041652,
+ 0.9042124,
+ 0.86024225,
+ 0.8041652
+ ],
+ [
+ 0.9215058,
+ 0.8828717,
+ 0.8332016,
+ 0.9215058,
+ 0.8828717,
+ 0.8332016,
+ 0.9215058,
+ 0.8828717,
+ 0.8332016
+ ],
+ [
+ 0.9374617,
+ 0.9029571,
+ 0.8587681,
+ 0.9374617,
+ 0.9029571,
+ 0.8587681,
+ 0.9374617,
+ 0.9029571,
+ 0.8587681
+ ],
+ [
+ 0.95089734,
+ 0.92046183,
+ 0.88161635,
+ 0.95089734,
+ 0.92046183,
+ 0.88161635,
+ 0.95089734,
+ 0.92046183,
+ 0.88161635
+ ],
+ [
+ 0.9626156,
+ 0.93662196,
+ 0.90170175,
+ 0.9626156,
+ 0.93662196,
+ 0.90170175,
+ 0.9626156,
+ 0.93662196,
+ 0.90170175
+ ],
+ [
+ 0.97289115,
+ 0.95005757,
+ 0.91941786,
+ 0.97289115,
+ 0.95005757,
+ 0.91941786,
+ 0.97289115,
+ 0.95005757,
+ 0.91941786
+ ],
+ [
+ 0.98082036,
+ 0.96197337,
+ 0.9357822,
+ 0.98082036,
+ 0.96197337,
+ 0.9357822,
+ 0.98082036,
+ 0.96197337,
+ 0.9357822
+ ],
+ [
+ 0.98803866,
+ 0.9722489,
+ 0.94921786,
+ 0.98803866,
+ 0.9722489,
+ 0.94921786,
+ 0.98803866,
+ 0.9722489,
+ 0.94921786
+ ],
+ [
+ 0.99259704,
+ 0.98036927,
+ 0.9613311,
+ 0.99259704,
+ 0.98036927,
+ 0.9613311,
+ 0.99259704,
+ 0.98036927,
+ 0.9613311
+ ],
+ [
+ 0.99685574,
+ 0.9875875,
+ 0.97160673,
+ 0.99685574,
+ 0.9875875,
+ 0.97160673,
+ 0.99685574,
+ 0.9875875,
+ 0.97160673
+ ],
+ [
+ 0.9984336,
+ 0.99233085,
+ 0.9799181,
+ 0.9984336,
+ 0.99233085,
+ 0.9799181,
+ 0.9984336,
+ 0.99233085,
+ 0.9799181
+ ],
+ [
+ 0.99982595,
+ 0.99658954,
+ 0.98713636,
+ 0.99982595,
+ 0.99658954,
+ 0.98713636,
+ 0.99982595,
+ 0.99658954,
+ 0.98713636
+ ],
+ [
+ 1,
+ 0.99834657,
+ 0.99206465,
+ 1,
+ 0.99834657,
+ 0.99206465,
+ 1,
+ 0.99834657,
+ 0.99206465
+ ],
+ [
+ 1,
+ 0.99973893,
+ 0.9963234,
+ 1,
+ 0.99973893,
+ 0.9963234,
+ 1,
+ 0.99973893,
+ 0.9963234
+ ],
+ [
+ 1,
+ 1,
+ 0.99825954,
+ 1,
+ 1,
+ 0.99825954,
+ 1,
+ 1,
+ 0.99825954
+ ],
+ [
+ 1,
+ 1,
+ 0.9996519,
+ 1,
+ 1,
+ 0.9996519,
+ 1,
+ 1,
+ 0.9996519
+ ],
+ [
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1
+ ]
+ ]
+ },
+ {
+ "name": "PinBouncer::dotAppearMoveUp",
+ "type": "float[]",
+ "data_points": [
+ [
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0
+ ],
+ [
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0
+ ],
+ [
+ 0.25108898,
+ 0.24185245,
+ 0.23379733,
+ 0.25108898,
+ 0.24185245,
+ 0.23379733,
+ 0.25108898,
+ 0.24185245,
+ 0.23379733
+ ],
+ [
+ 0.36994478,
+ 0.35579002,
+ 0.34344575,
+ 0.36994478,
+ 0.35579002,
+ 0.34344575,
+ 0.36994478,
+ 0.35579002,
+ 0.34344575
+ ],
+ [
+ 0.45856017,
+ 0.44208717,
+ 0.4277212,
+ 0.45856017,
+ 0.44208717,
+ 0.4277212,
+ 0.45856017,
+ 0.44208717,
+ 0.4277212
+ ],
+ [
+ 0.5303175,
+ 0.5132119,
+ 0.49780974,
+ 0.5303175,
+ 0.5132119,
+ 0.49780974,
+ 0.5303175,
+ 0.5132119,
+ 0.49780974
+ ],
+ [
+ 0.5929084,
+ 0.57152635,
+ 0.5528793,
+ 0.5929084,
+ 0.57152635,
+ 0.5528793,
+ 0.5929084,
+ 0.57152635,
+ 0.5528793
+ ],
+ [
+ 0.6415321,
+ 0.6216319,
+ 0.6042771,
+ 0.6415321,
+ 0.6216319,
+ 0.6042771,
+ 0.6415321,
+ 0.6216319,
+ 0.6042771
+ ],
+ [
+ 0.6889181,
+ 0.6668597,
+ 0.64661235,
+ 0.6889181,
+ 0.6668597,
+ 0.64661235,
+ 0.6889181,
+ 0.6668597,
+ 0.64661235
+ ],
+ [
+ 0.72852343,
+ 0.70699567,
+ 0.6879909,
+ 0.72852343,
+ 0.70699567,
+ 0.6879909,
+ 0.72852343,
+ 0.70699567,
+ 0.6879909
+ ],
+ [
+ 0.763233,
+ 0.7418899,
+ 0.7227609,
+ 0.763233,
+ 0.7418899,
+ 0.7227609,
+ 0.763233,
+ 0.7418899,
+ 0.7227609
+ ],
+ [
+ 0.7938958,
+ 0.7733934,
+ 0.75354666,
+ 0.7938958,
+ 0.7733934,
+ 0.75354666,
+ 0.7938958,
+ 0.7733934,
+ 0.75354666
+ ],
+ [
+ 0.82150793,
+ 0.8013512,
+ 0.7816832,
+ 0.82150793,
+ 0.8013512,
+ 0.7816832,
+ 0.82150793,
+ 0.8013512,
+ 0.7816832
+ ],
+ [
+ 0.84668195,
+ 0.82613826,
+ 0.807758,
+ 0.84668195,
+ 0.82613826,
+ 0.807758,
+ 0.84668195,
+ 0.82613826,
+ 0.807758
+ ],
+ [
+ 0.86843777,
+ 0.84911424,
+ 0.83017635,
+ 0.86843777,
+ 0.84911424,
+ 0.83017635,
+ 0.86843777,
+ 0.84911424,
+ 0.83017635
+ ],
+ [
+ 0.88804924,
+ 0.86938363,
+ 0.85123545,
+ 0.88804924,
+ 0.86938363,
+ 0.85123545,
+ 0.88804924,
+ 0.86938363,
+ 0.85123545
+ ],
+ [
+ 0.90616417,
+ 0.8875992,
+ 0.87020856,
+ 0.90616417,
+ 0.8875992,
+ 0.87020856,
+ 0.90616417,
+ 0.8875992,
+ 0.87020856
+ ],
+ [
+ 0.92120105,
+ 0.90447646,
+ 0.8872067,
+ 0.92120105,
+ 0.90447646,
+ 0.8872067,
+ 0.92120105,
+ 0.90447646,
+ 0.8872067
+ ],
+ [
+ 0.93561906,
+ 0.91881925,
+ 0.9030046,
+ 0.93561906,
+ 0.91881925,
+ 0.9030046,
+ 0.93561906,
+ 0.91881925,
+ 0.9030046
+ ],
+ [
+ 0.9472463,
+ 0.9325603,
+ 0.91674215,
+ 0.9472463,
+ 0.9325603,
+ 0.91674215,
+ 0.9472463,
+ 0.9325603,
+ 0.91674215
+ ],
+ [
+ 0.95841366,
+ 0.9437798,
+ 0.9296044,
+ 0.95841366,
+ 0.9437798,
+ 0.9296044,
+ 0.95841366,
+ 0.9437798,
+ 0.9296044
+ ],
+ [
+ 0.9671384,
+ 0.9546126,
+ 0.9407567,
+ 0.9671384,
+ 0.9546126,
+ 0.9407567,
+ 0.9671384,
+ 0.9546126,
+ 0.9407567
+ ],
+ [
+ 0.97568256,
+ 0.96334505,
+ 0.95089674,
+ 0.97568256,
+ 0.96334505,
+ 0.95089674,
+ 0.97568256,
+ 0.96334505,
+ 0.95089674
+ ],
+ [
+ 0.98170155,
+ 0.9714737,
+ 0.9600369,
+ 0.98170155,
+ 0.9714737,
+ 0.9600369,
+ 0.98170155,
+ 0.9714737,
+ 0.9600369
+ ],
+ [
+ 0.9877205,
+ 0.9782621,
+ 0.96764565,
+ 0.9877205,
+ 0.9782621,
+ 0.96764565,
+ 0.9877205,
+ 0.9782621,
+ 0.96764565
+ ],
+ [
+ 0.9916518,
+ 0.98386985,
+ 0.9752545,
+ 0.9916518,
+ 0.98386985,
+ 0.9752545,
+ 0.9916518,
+ 0.98386985,
+ 0.9752545
+ ],
+ [
+ 0.99514234,
+ 0.98918015,
+ 0.9805117,
+ 0.99514234,
+ 0.98918015,
+ 0.9805117,
+ 0.99514234,
+ 0.98918015,
+ 0.9805117
+ ],
+ [
+ 0.9976143,
+ 0.99243224,
+ 0.98576087,
+ 0.9976143,
+ 0.99243224,
+ 0.98576087,
+ 0.9976143,
+ 0.99243224,
+ 0.98576087
+ ],
+ [
+ 0.998737,
+ 0.9956844,
+ 0.9900688,
+ 0.998737,
+ 0.9956844,
+ 0.9900688,
+ 0.998737,
+ 0.9956844,
+ 0.9900688
+ ],
+ [
+ 0.9998597,
+ 0.99771196,
+ 0.9931129,
+ 0.9998597,
+ 0.99771196,
+ 0.9931129,
+ 0.9998597,
+ 0.99771196,
+ 0.9931129
+ ],
+ [
+ 1,
+ 0.9987579,
+ 0.99615705,
+ 1,
+ 0.9987579,
+ 0.99615705,
+ 1,
+ 0.9987579,
+ 0.99615705
+ ],
+ [
+ 1,
+ 0.9998039,
+ 0.9977971,
+ 1,
+ 0.9998039,
+ 0.9977971,
+ 1,
+ 0.9998039,
+ 0.9977971
+ ],
+ [
+ 1,
+ 1,
+ 0.99877614,
+ 1,
+ 1,
+ 0.99877614,
+ 1,
+ 1,
+ 0.99877614
+ ],
+ [
+ 1,
+ 1,
+ 0.9997552,
+ 1,
+ 1,
+ 0.9997552,
+ 1,
+ 1,
+ 0.9997552
+ ],
+ [
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1,
+ 1
+ ]
+ ]
+ }
+ ]
+} \ No newline at end of file
diff --git a/packages/SystemUI/tests/src/com/android/systemui/accessibility/WindowMagnificationSizePrefsTest.java b/packages/SystemUI/tests/src/com/android/systemui/accessibility/WindowMagnificationFrameSizePrefsTest.java
index 516b6658d24a..93c0eeaac488 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/accessibility/WindowMagnificationSizePrefsTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/accessibility/WindowMagnificationFrameSizePrefsTest.java
@@ -39,9 +39,9 @@ import org.junit.runner.RunWith;
@SmallTest
@RunWith(AndroidTestingRunner.class)
@TestableLooper.RunWithLooper
-public class WindowMagnificationSizePrefsTest extends SysuiTestCase {
+public class WindowMagnificationFrameSizePrefsTest extends SysuiTestCase {
- WindowMagnificationSizePrefs mWindowMagnificationSizePrefs;
+ WindowMagnificationFrameSizePrefs mWindowMagnificationFrameSizePrefs;
FakeSharedPreferences mSharedPreferences;
@Before
@@ -51,24 +51,24 @@ public class WindowMagnificationSizePrefsTest extends SysuiTestCase {
when(mContext.getSharedPreferences(
eq("window_magnification_preferences"), anyInt()))
.thenReturn(mSharedPreferences);
- mWindowMagnificationSizePrefs = new WindowMagnificationSizePrefs(mContext);
+ mWindowMagnificationFrameSizePrefs = new WindowMagnificationFrameSizePrefs(mContext);
}
@Test
public void saveSizeForCurrentDensity_getExpectedSize() {
Size testSize = new Size(500, 500);
- mWindowMagnificationSizePrefs.saveSizeForCurrentDensity(testSize);
+ mWindowMagnificationFrameSizePrefs.saveSizeForCurrentDensity(testSize);
- assertThat(mWindowMagnificationSizePrefs.getSizeForCurrentDensity())
+ assertThat(mWindowMagnificationFrameSizePrefs.getSizeForCurrentDensity())
.isEqualTo(testSize);
}
@Test
public void saveSizeForCurrentDensity_containsPreferenceForCurrentDensity() {
Size testSize = new Size(500, 500);
- mWindowMagnificationSizePrefs.saveSizeForCurrentDensity(testSize);
+ mWindowMagnificationFrameSizePrefs.saveSizeForCurrentDensity(testSize);
- assertThat(mWindowMagnificationSizePrefs.isPreferenceSavedForCurrentDensity())
+ assertThat(mWindowMagnificationFrameSizePrefs.isPreferenceSavedForCurrentDensity())
.isTrue();
}
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/accessibility/floatingmenu/MenuAnimationControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/accessibility/floatingmenu/MenuAnimationControllerTest.java
index e0df1e0e5586..2d5e3a6788cc 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/accessibility/floatingmenu/MenuAnimationControllerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/accessibility/floatingmenu/MenuAnimationControllerTest.java
@@ -26,7 +26,6 @@ import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyZeroInteractions;
import android.graphics.PointF;
-import android.platform.test.annotations.EnableFlags;
import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper;
import android.view.View;
@@ -40,7 +39,6 @@ import androidx.dynamicanimation.animation.SpringAnimation;
import androidx.dynamicanimation.animation.SpringForce;
import androidx.test.filters.SmallTest;
-import com.android.systemui.Flags;
import com.android.systemui.Prefs;
import com.android.systemui.SysuiTestCase;
import com.android.systemui.accessibility.utils.TestUtils;
@@ -230,7 +228,6 @@ public class MenuAnimationControllerTest extends SysuiTestCase {
}
@Test
- @EnableFlags(Flags.FLAG_FLOATING_MENU_ANIMATED_TUCK)
public void tuck_animates() {
mMenuAnimationController.cancelAnimations();
mMenuAnimationController.moveToEdgeAndHide();
@@ -239,7 +236,6 @@ public class MenuAnimationControllerTest extends SysuiTestCase {
}
@Test
- @EnableFlags(Flags.FLAG_FLOATING_MENU_ANIMATED_TUCK)
public void untuck_animates() {
mMenuAnimationController.cancelAnimations();
mMenuAnimationController.moveOutEdgeAndShow();
diff --git a/packages/SystemUI/tests/src/com/android/systemui/biometrics/data/repository/FaceSettingsRepositoryImplTest.kt b/packages/SystemUI/tests/src/com/android/systemui/biometrics/data/repository/FaceSettingsRepositoryImplTest.kt
index 0df4fbf86d98..9ba56d27fdf3 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/biometrics/data/repository/FaceSettingsRepositoryImplTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/biometrics/data/repository/FaceSettingsRepositoryImplTest.kt
@@ -36,12 +36,12 @@ import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.runners.JUnit4
-import org.mockito.ArgumentMatchers.any
import org.mockito.ArgumentMatchers.anyBoolean
import org.mockito.ArgumentMatchers.anyInt
import org.mockito.Mock
import org.mockito.Mockito.verify
import org.mockito.junit.MockitoJUnit
+import org.mockito.kotlin.any
private const val USER_ID = 8
diff --git a/packages/SystemUI/tests/src/com/android/systemui/biometrics/data/repository/PromptRepositoryImplTest.kt b/packages/SystemUI/tests/src/com/android/systemui/biometrics/data/repository/PromptRepositoryImplTest.kt
index 5e4272f125d7..2682633f5dfd 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/biometrics/data/repository/PromptRepositoryImplTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/biometrics/data/repository/PromptRepositoryImplTest.kt
@@ -44,6 +44,8 @@ import org.mockito.Mockito.verify
import org.mockito.junit.MockitoJUnit
private const val USER_ID = 9
+private const val REQUEST_ID = 9L
+private const val WRONG_REQUEST_ID = 10L
private const val CHALLENGE = 90L
private const val OP_PACKAGE_NAME = "biometric.testapp"
@@ -105,6 +107,7 @@ class PromptRepositoryImplTest : SysuiTestCase() {
repository.setPrompt(
PromptInfo().apply { isConfirmationRequested = case },
USER_ID,
+ REQUEST_ID,
CHALLENGE,
PromptKind.Biometric(),
OP_PACKAGE_NAME
@@ -124,6 +127,7 @@ class PromptRepositoryImplTest : SysuiTestCase() {
repository.setPrompt(
PromptInfo().apply { isConfirmationRequested = case },
USER_ID,
+ REQUEST_ID,
CHALLENGE,
PromptKind.Biometric(),
OP_PACKAGE_NAME
@@ -134,12 +138,12 @@ class PromptRepositoryImplTest : SysuiTestCase() {
}
@Test
- fun setsAndUnsetsPrompt() =
+ fun setsAndUnsetsPrompt_whenRequestIdMatches() =
testScope.runTest {
val kind = PromptKind.Pin
val promptInfo = PromptInfo()
- repository.setPrompt(promptInfo, USER_ID, CHALLENGE, kind, OP_PACKAGE_NAME)
+ repository.setPrompt(promptInfo, USER_ID, REQUEST_ID, CHALLENGE, kind, OP_PACKAGE_NAME)
assertThat(repository.promptKind.value).isEqualTo(kind)
assertThat(repository.userId.value).isEqualTo(USER_ID)
@@ -147,11 +151,33 @@ class PromptRepositoryImplTest : SysuiTestCase() {
assertThat(repository.promptInfo.value).isSameInstanceAs(promptInfo)
assertThat(repository.opPackageName.value).isEqualTo(OP_PACKAGE_NAME)
- repository.unsetPrompt()
+ repository.unsetPrompt(REQUEST_ID)
assertThat(repository.promptInfo.value).isNull()
assertThat(repository.userId.value).isNull()
assertThat(repository.challenge.value).isNull()
assertThat(repository.opPackageName.value).isNull()
}
+
+ @Test
+ fun setsAndUnsetsPrompt_whenRequestIdDoesNotMatch() =
+ testScope.runTest {
+ val kind = PromptKind.Pin
+ val promptInfo = PromptInfo()
+
+ repository.setPrompt(promptInfo, USER_ID, REQUEST_ID, CHALLENGE, kind, OP_PACKAGE_NAME)
+
+ assertThat(repository.promptKind.value).isEqualTo(kind)
+ assertThat(repository.userId.value).isEqualTo(USER_ID)
+ assertThat(repository.challenge.value).isEqualTo(CHALLENGE)
+ assertThat(repository.promptInfo.value).isSameInstanceAs(promptInfo)
+ assertThat(repository.opPackageName.value).isEqualTo(OP_PACKAGE_NAME)
+
+ repository.unsetPrompt(WRONG_REQUEST_ID)
+
+ assertThat(repository.promptInfo.value).isNotNull()
+ assertThat(repository.userId.value).isNotNull()
+ assertThat(repository.challenge.value).isNotNull()
+ assertThat(repository.opPackageName.value).isNotNull()
+ }
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/biometrics/domain/interactor/PromptCredentialInteractorTest.kt b/packages/SystemUI/tests/src/com/android/systemui/biometrics/domain/interactor/PromptCredentialInteractorTest.kt
index 8695c01e89d4..c4d0d23ce9f3 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/biometrics/domain/interactor/PromptCredentialInteractorTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/biometrics/domain/interactor/PromptCredentialInteractorTest.kt
@@ -33,6 +33,7 @@ import org.junit.runners.JUnit4
import org.mockito.junit.MockitoJUnit
private const val USER_ID = 22
+private const val REQUEST_ID = 22L
private const val OPERATION_ID = 100L
private const val OP_PACKAGE_NAME = "biometric.testapp"
@@ -112,6 +113,7 @@ class PromptCredentialInteractorTest : SysuiTestCase() {
},
kind = PromptKind.Pin,
userId = USER_ID,
+ requestId = REQUEST_ID,
challenge = OPERATION_ID,
opPackageName = OP_PACKAGE_NAME
)
@@ -137,6 +139,7 @@ class PromptCredentialInteractorTest : SysuiTestCase() {
},
kind = PromptKind.Pin,
userId = USER_ID,
+ requestId = REQUEST_ID,
challenge = OPERATION_ID,
opPackageName = OP_PACKAGE_NAME
)
@@ -165,6 +168,7 @@ class PromptCredentialInteractorTest : SysuiTestCase() {
},
kind = PromptKind.Pin,
userId = USER_ID,
+ requestId = REQUEST_ID,
challenge = OPERATION_ID,
opPackageName = OP_PACKAGE_NAME
)
@@ -198,6 +202,7 @@ class PromptCredentialInteractorTest : SysuiTestCase() {
},
kind = kind,
userId = USER_ID,
+ requestId = REQUEST_ID,
challenge = OPERATION_ID,
opPackageName = OP_PACKAGE_NAME
)
@@ -223,7 +228,7 @@ class PromptCredentialInteractorTest : SysuiTestCase() {
assertThat(pattern.stealthMode).isEqualTo(isStealth)
}
- interactor.resetPrompt()
+ interactor.resetPrompt(REQUEST_ID)
assertThat(prompt).isNull()
}
@@ -346,12 +351,14 @@ class PromptCredentialInteractorTest : SysuiTestCase() {
promptInfo: PromptInfo,
kind: PromptKind,
userId: Int,
+ requestId: Long,
challenge: Long,
opPackageName: String,
) {
biometricPromptRepository.setPrompt(
promptInfo,
userId,
+ requestId,
challenge,
kind,
opPackageName,
@@ -359,8 +366,8 @@ class PromptCredentialInteractorTest : SysuiTestCase() {
}
/** Unset the current authentication request. */
- private fun PromptCredentialInteractor.resetPrompt() {
- biometricPromptRepository.unsetPrompt()
+ private fun PromptCredentialInteractor.resetPrompt(requestId: Long) {
+ biometricPromptRepository.unsetPrompt(requestId)
}
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/biometrics/domain/interactor/PromptSelectorInteractorImplTest.kt b/packages/SystemUI/tests/src/com/android/systemui/biometrics/domain/interactor/PromptSelectorInteractorImplTest.kt
index 4068404da29f..3102a84b852a 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/biometrics/domain/interactor/PromptSelectorInteractorImplTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/biometrics/domain/interactor/PromptSelectorInteractorImplTest.kt
@@ -59,6 +59,7 @@ class PromptSelectorInteractorImplTest : SysuiTestCase() {
private const val NEGATIVE_TEXT = "escape"
private const val USER_ID = 8
+ private const val REQUEST_ID = 8L
private const val CHALLENGE = 999L
private const val OP_PACKAGE_NAME = "biometric.testapp"
private val componentNameOverriddenForConfirmDeviceCredentialActivity =
@@ -150,6 +151,7 @@ class PromptSelectorInteractorImplTest : SysuiTestCase() {
interactor.setPrompt(
info,
USER_ID,
+ REQUEST_ID,
modalities,
CHALLENGE,
OP_PACKAGE_NAME,
@@ -179,7 +181,7 @@ class PromptSelectorInteractorImplTest : SysuiTestCase() {
}
assertThat(isConfirmationRequired).isEqualTo(confirmationRequired)
- interactor.resetPrompt()
+ interactor.resetPrompt(REQUEST_ID)
verifyUnset()
}
@@ -206,6 +208,7 @@ class PromptSelectorInteractorImplTest : SysuiTestCase() {
interactor.setPrompt(
info,
USER_ID,
+ REQUEST_ID,
modalities,
CHALLENGE,
OP_PACKAGE_NAME,
@@ -214,7 +217,7 @@ class PromptSelectorInteractorImplTest : SysuiTestCase() {
assertThat(promptKind?.isBiometric()).isTrue()
- interactor.resetPrompt()
+ interactor.resetPrompt(REQUEST_ID)
verifyUnset()
}
@@ -230,6 +233,7 @@ class PromptSelectorInteractorImplTest : SysuiTestCase() {
interactor.setPrompt(
info,
USER_ID,
+ REQUEST_ID,
modalities,
CHALLENGE,
OP_PACKAGE_NAME,
@@ -238,7 +242,7 @@ class PromptSelectorInteractorImplTest : SysuiTestCase() {
assertThat(promptKind).isEqualTo(PromptKind.Password)
- interactor.resetPrompt()
+ interactor.resetPrompt(REQUEST_ID)
verifyUnset()
}
@@ -258,6 +262,7 @@ class PromptSelectorInteractorImplTest : SysuiTestCase() {
interactor.setPrompt(
info,
USER_ID,
+ REQUEST_ID,
modalities,
CHALLENGE,
OP_PACKAGE_NAME,
@@ -266,7 +271,7 @@ class PromptSelectorInteractorImplTest : SysuiTestCase() {
assertThat(promptKind).isEqualTo(PromptKind.Password)
- interactor.resetPrompt()
+ interactor.resetPrompt(REQUEST_ID)
verifyUnset()
}
@@ -290,6 +295,7 @@ class PromptSelectorInteractorImplTest : SysuiTestCase() {
interactor.setPrompt(
info,
USER_ID,
+ REQUEST_ID,
modalities,
CHALLENGE,
OP_PACKAGE_NAME,
@@ -298,7 +304,7 @@ class PromptSelectorInteractorImplTest : SysuiTestCase() {
assertThat(promptKind).isEqualTo(PromptKind.Password)
- interactor.resetPrompt()
+ interactor.resetPrompt(REQUEST_ID)
verifyUnset()
}
@@ -319,6 +325,7 @@ class PromptSelectorInteractorImplTest : SysuiTestCase() {
interactor.setPrompt(
info,
USER_ID,
+ REQUEST_ID,
modalities,
CHALLENGE,
OP_PACKAGE_NAME,
@@ -327,7 +334,7 @@ class PromptSelectorInteractorImplTest : SysuiTestCase() {
assertThat(promptKind?.isBiometric()).isTrue()
- interactor.resetPrompt()
+ interactor.resetPrompt(REQUEST_ID)
verifyUnset()
}
@@ -355,6 +362,7 @@ class PromptSelectorInteractorImplTest : SysuiTestCase() {
interactor.setPrompt(
info,
USER_ID,
+ REQUEST_ID,
BiometricModalities(),
CHALLENGE,
OP_PACKAGE_NAME,
@@ -365,7 +373,7 @@ class PromptSelectorInteractorImplTest : SysuiTestCase() {
assertThat(currentPrompt).isNull()
assertThat(credentialKind).isEqualTo(PromptKind.None)
- interactor.resetPrompt()
+ interactor.resetPrompt(REQUEST_ID)
verifyUnset()
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/biometrics/ui/viewmodel/CredentialViewModelTest.kt b/packages/SystemUI/tests/src/com/android/systemui/biometrics/ui/viewmodel/CredentialViewModelTest.kt
index 3245020ec584..9e804c123520 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/biometrics/ui/viewmodel/CredentialViewModelTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/biometrics/ui/viewmodel/CredentialViewModelTest.kt
@@ -22,6 +22,7 @@ import org.junit.runner.RunWith
import org.junit.runners.JUnit4
private const val USER_ID = 9
+private const val REQUEST_ID = 9L
private const val OPERATION_ID = 10L
@OptIn(ExperimentalCoroutinesApi::class)
@@ -171,7 +172,7 @@ class CredentialViewModelTest : SysuiTestCase() {
) =
runTest(dispatcher) {
init()
- promptRepository.setPrompt(promptInfo(), USER_ID, OPERATION_ID, kind)
+ promptRepository.setPrompt(promptInfo(), USER_ID, REQUEST_ID, OPERATION_ID, kind)
block()
}
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/biometrics/ui/viewmodel/PromptViewModelTest.kt b/packages/SystemUI/tests/src/com/android/systemui/biometrics/ui/viewmodel/PromptViewModelTest.kt
index fa78f0c6ec1d..53ccb906c546 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/biometrics/ui/viewmodel/PromptViewModelTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/biometrics/ui/viewmodel/PromptViewModelTest.kt
@@ -96,6 +96,7 @@ import org.mockito.Mock
import org.mockito.junit.MockitoJUnit
private const val USER_ID = 4
+private const val REQUEST_ID = 4L
private const val CHALLENGE = 2L
private const val DELAY = 1000L
private const val OP_PACKAGE_NAME = "biometric.testapp"
@@ -1457,7 +1458,7 @@ internal class PromptViewModelTest(private val testCase: TestCase) : SysuiTestCa
whenever(activityTaskManager.getTasks(1)).thenReturn(listOf(runningTaskInfo))
selector =
PromptSelectorInteractorImpl(fingerprintRepository, promptRepository, lockPatternUtils)
- selector.resetPrompt()
+ selector.resetPrompt(REQUEST_ID)
viewModel =
PromptViewModel(
@@ -1688,6 +1689,7 @@ private fun PromptSelectorInteractor.initializePrompt(
setPrompt(
info,
USER_ID,
+ REQUEST_ID,
BiometricModalities(fingerprintProperties = fingerprint, faceProperties = face),
CHALLENGE,
packageName,
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
new file mode 100644
index 000000000000..9a3667819ec7
--- /dev/null
+++ b/packages/SystemUI/tests/src/com/android/systemui/bouncer/ui/composable/BouncerContentTest.kt
@@ -0,0 +1,116 @@
+/*
+ * 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.bouncer.ui.composable
+
+import android.app.AlertDialog
+import androidx.compose.foundation.layout.fillMaxSize
+import androidx.compose.runtime.Composable
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.platform.testTag
+import androidx.compose.ui.test.doubleClick
+import androidx.compose.ui.test.hasTestTag
+import androidx.compose.ui.test.performTouchInput
+import androidx.test.ext.junit.runners.AndroidJUnit4
+import androidx.test.filters.LargeTest
+import com.android.compose.theme.PlatformTheme
+import com.android.systemui.SysuiTestCase
+import com.android.systemui.authentication.data.repository.fakeAuthenticationRepository
+import com.android.systemui.authentication.shared.model.AuthenticationMethodModel
+import com.android.systemui.bouncer.ui.BouncerDialogFactory
+import com.android.systemui.bouncer.ui.helper.BouncerSceneLayout
+import com.android.systemui.bouncer.ui.viewmodel.bouncerViewModel
+import com.android.systemui.flags.Flags
+import com.android.systemui.flags.fakeFeatureFlagsClassic
+import com.android.systemui.motion.createSysUiComposeMotionTestRule
+import com.android.systemui.scene.domain.interactor.sceneContainerStartable
+import com.android.systemui.testKosmos
+import org.junit.Before
+import org.junit.Rule
+import org.junit.Test
+import org.junit.runner.RunWith
+import platform.test.motion.compose.ComposeFeatureCaptures.alpha
+import platform.test.motion.compose.ComposeFeatureCaptures.positionInRoot
+import platform.test.motion.compose.ComposeRecordingSpec
+import platform.test.motion.compose.MotionControl
+import platform.test.motion.compose.feature
+import platform.test.motion.compose.motionTestValueOfNode
+import platform.test.motion.compose.recordMotion
+import platform.test.motion.compose.runTest
+import platform.test.screenshot.DeviceEmulationSpec
+import platform.test.screenshot.Displays.FoldableInner
+
+@RunWith(AndroidJUnit4::class)
+@LargeTest
+class BouncerContentTest : SysuiTestCase() {
+ private val deviceSpec = DeviceEmulationSpec(FoldableInner)
+ private val kosmos = testKosmos()
+
+ @get:Rule val motionTestRule = createSysUiComposeMotionTestRule(kosmos, deviceSpec)
+
+ private val bouncerDialogFactory =
+ object : BouncerDialogFactory {
+ override fun invoke(): AlertDialog {
+ throw AssertionError()
+ }
+ }
+
+ @Before
+ fun setUp() {
+ kosmos.sceneContainerStartable.start()
+ kosmos.fakeFeatureFlagsClassic.set(Flags.FULL_SCREEN_USER_SWITCHER, true)
+ kosmos.fakeAuthenticationRepository.setAuthenticationMethod(AuthenticationMethodModel.Pin)
+ }
+
+ @Composable
+ private fun BouncerContentUnderTest() {
+ PlatformTheme {
+ BouncerContent(
+ viewModel = kosmos.bouncerViewModel,
+ layout = BouncerSceneLayout.BESIDE_USER_SWITCHER,
+ modifier = Modifier.fillMaxSize().testTag("BouncerContent"),
+ dialogFactory = bouncerDialogFactory
+ )
+ }
+ }
+
+ @Test
+ fun doubleClick_swapSide() =
+ motionTestRule.runTest {
+ val motion =
+ recordMotion(
+ content = { BouncerContentUnderTest() },
+ ComposeRecordingSpec(
+ MotionControl {
+ onNode(hasTestTag("BouncerContent")).performTouchInput {
+ doubleClick(position = centerLeft)
+ }
+
+ awaitCondition {
+ motionTestValueOfNode(BouncerMotionTestKeys.swapAnimationEnd)
+ }
+ }
+ ) {
+ feature(hasTestTag("UserSwitcher"), positionInRoot, "userSwitcher_pos")
+ feature(hasTestTag("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/bouncer/ui/composable/PatternBouncerTest.kt b/packages/SystemUI/tests/src/com/android/systemui/bouncer/ui/composable/PatternBouncerTest.kt
new file mode 100644
index 000000000000..4f6f98e8fdb0
--- /dev/null
+++ b/packages/SystemUI/tests/src/com/android/systemui/bouncer/ui/composable/PatternBouncerTest.kt
@@ -0,0 +1,120 @@
+/*
+ * 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.bouncer.ui.composable
+
+import androidx.compose.foundation.layout.size
+import androidx.compose.runtime.Composable
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.unit.dp
+import androidx.test.ext.junit.runners.AndroidJUnit4
+import androidx.test.filters.LargeTest
+import com.android.systemui.SysuiTestCase
+import com.android.systemui.bouncer.domain.interactor.bouncerInteractor
+import com.android.systemui.bouncer.ui.viewmodel.PatternBouncerViewModel
+import com.android.systemui.kosmos.testScope
+import com.android.systemui.motion.createSysUiComposeMotionTestRule
+import com.android.systemui.testKosmos
+import kotlinx.coroutines.flow.MutableStateFlow
+import kotlinx.coroutines.flow.asStateFlow
+import kotlinx.coroutines.flow.takeWhile
+import org.junit.Rule
+import org.junit.Test
+import org.junit.runner.RunWith
+import platform.test.motion.compose.ComposeRecordingSpec
+import platform.test.motion.compose.MotionControl
+import platform.test.motion.compose.feature
+import platform.test.motion.compose.motionTestValueOfNode
+import platform.test.motion.compose.recordMotion
+import platform.test.motion.compose.runTest
+import platform.test.motion.golden.DataPointTypes
+
+@RunWith(AndroidJUnit4::class)
+@LargeTest
+class PatternBouncerTest : SysuiTestCase() {
+ private val kosmos = testKosmos()
+
+ @get:Rule val motionTestRule = createSysUiComposeMotionTestRule(kosmos)
+
+ private val bouncerInteractor by lazy { kosmos.bouncerInteractor }
+ private val viewModel by lazy {
+ PatternBouncerViewModel(
+ applicationContext = context,
+ viewModelScope = kosmos.testScope.backgroundScope,
+ interactor = bouncerInteractor,
+ isInputEnabled = MutableStateFlow(true).asStateFlow(),
+ onIntentionalUserInput = {},
+ )
+ }
+
+ @Composable
+ private fun PatternBouncerUnderTest() {
+ PatternBouncer(viewModel, centerDotsVertically = true, modifier = Modifier.size(400.dp))
+ }
+
+ @Test
+ fun entryAnimation() =
+ motionTestRule.runTest {
+ val motion =
+ recordMotion(
+ content = { play -> if (play) PatternBouncerUnderTest() },
+ ComposeRecordingSpec.until(
+ recordBefore = false,
+ checkDone = { motionTestValueOfNode(MotionTestKeys.entryCompleted) }
+ ) {
+ feature(MotionTestKeys.dotAppearFadeIn, floatArray)
+ feature(MotionTestKeys.dotAppearMoveUp, floatArray)
+ }
+ )
+
+ assertThat(motion).timeSeriesMatchesGolden()
+ }
+
+ @Test
+ fun animateFailure() =
+ motionTestRule.runTest {
+ val failureAnimationMotionControl =
+ MotionControl(
+ delayReadyToPlay = {
+ // Skip entry animation.
+ awaitCondition { motionTestValueOfNode(MotionTestKeys.entryCompleted) }
+ },
+ delayRecording = {
+ // Trigger failure animation by calling onDragEnd without having recorded a
+ // pattern before.
+ viewModel.onDragEnd()
+ // Failure animation starts when animateFailure flips to true...
+ viewModel.animateFailure.takeWhile { !it }.collect {}
+ }
+ ) {
+ // ... and ends when the composable flips it back to false.
+ viewModel.animateFailure.takeWhile { it }.collect {}
+ }
+
+ val motion =
+ recordMotion(
+ content = { PatternBouncerUnderTest() },
+ ComposeRecordingSpec(failureAnimationMotionControl) {
+ feature(MotionTestKeys.dotScaling, floatArray)
+ }
+ )
+ assertThat(motion).timeSeriesMatchesGolden()
+ }
+
+ companion object {
+ val floatArray = DataPointTypes.listOf(DataPointTypes.float)
+ }
+}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/keyguard/data/repository/KeyguardTransitionRepositoryTest.kt b/packages/SystemUI/tests/src/com/android/systemui/keyguard/data/repository/KeyguardTransitionRepositoryTest.kt
index 53560d740575..48a5df91d47c 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/keyguard/data/repository/KeyguardTransitionRepositoryTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/keyguard/data/repository/KeyguardTransitionRepositoryTest.kt
@@ -25,16 +25,19 @@ import androidx.test.filters.FlakyTest
import androidx.test.filters.SmallTest
import com.android.app.animation.Interpolators
import com.android.systemui.SysuiTestCase
+import com.android.systemui.coroutines.collectValues
import com.android.systemui.keyguard.shared.model.KeyguardState
import com.android.systemui.keyguard.shared.model.KeyguardState.AOD
import com.android.systemui.keyguard.shared.model.KeyguardState.DREAMING
import com.android.systemui.keyguard.shared.model.KeyguardState.LOCKSCREEN
+import com.android.systemui.keyguard.shared.model.KeyguardState.OCCLUDED
import com.android.systemui.keyguard.shared.model.KeyguardState.OFF
import com.android.systemui.keyguard.shared.model.TransitionInfo
import com.android.systemui.keyguard.shared.model.TransitionModeOnCanceled
import com.android.systemui.keyguard.shared.model.TransitionState
import com.android.systemui.keyguard.shared.model.TransitionStep
import com.android.systemui.keyguard.util.KeyguardTransitionRunner
+import com.android.systemui.kosmos.testDispatcher
import com.android.systemui.kosmos.testScope
import com.android.systemui.testKosmos
import com.google.common.truth.Truth.assertThat
@@ -45,6 +48,8 @@ import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.flow.dropWhile
import kotlinx.coroutines.flow.launchIn
import kotlinx.coroutines.flow.onEach
+import kotlinx.coroutines.launch
+import kotlinx.coroutines.test.advanceTimeBy
import kotlinx.coroutines.test.runCurrent
import kotlinx.coroutines.test.runTest
import org.junit.After
@@ -372,6 +377,43 @@ class KeyguardTransitionRepositoryTest : SysuiTestCase() {
assertThat(wtfHandler.failed).isTrue()
}
+ @Test
+ fun simulateRaceConditionIsProcessedInOrder() =
+ testScope.runTest {
+ val ktr = KeyguardTransitionRepositoryImpl(kosmos.testDispatcher)
+ val steps by collectValues(ktr.transitions.dropWhile { step -> step.from == OFF })
+
+ // Add a delay to the first transition in order to attempt to have the second transition
+ // be processed first
+ val info1 = TransitionInfo(OWNER_NAME, AOD, LOCKSCREEN, animator = null)
+ launch {
+ ktr.forceDelayForRaceConditionTest = true
+ ktr.startTransition(info1)
+ }
+ val info2 = TransitionInfo(OWNER_NAME, LOCKSCREEN, OCCLUDED, animator = null)
+ launch {
+ ktr.forceDelayForRaceConditionTest = false
+ ktr.startTransition(info2)
+ }
+
+ runCurrent()
+ assertThat(steps.isEmpty()).isTrue()
+
+ advanceTimeBy(60L)
+ assertThat(steps[0])
+ .isEqualTo(
+ TransitionStep(info1.from, info1.to, 0f, TransitionState.STARTED, OWNER_NAME)
+ )
+ assertThat(steps[1])
+ .isEqualTo(
+ TransitionStep(info1.from, info1.to, 0f, TransitionState.CANCELED, OWNER_NAME)
+ )
+ assertThat(steps[2])
+ .isEqualTo(
+ TransitionStep(info2.from, info2.to, 0f, TransitionState.STARTED, OWNER_NAME)
+ )
+ }
+
private fun listWithStep(
step: BigDecimal,
start: BigDecimal = BigDecimal.ZERO,
diff --git a/packages/SystemUI/tests/src/com/android/systemui/keyguard/domain/interactor/KeyguardTransitionScenariosTest.kt b/packages/SystemUI/tests/src/com/android/systemui/keyguard/domain/interactor/KeyguardTransitionScenariosTest.kt
index 00f94a57a2d1..fa3fe5c80adb 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/keyguard/domain/interactor/KeyguardTransitionScenariosTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/keyguard/domain/interactor/KeyguardTransitionScenariosTest.kt
@@ -1669,7 +1669,9 @@ class KeyguardTransitionScenariosTest(flags: FlagsParameterization?) : SysuiTest
// THEN a transition from DOZING => OCCLUDED should occur
assertThat(transitionRepository)
.startedTransition(
- ownerName = "FromDozingTransitionInteractor",
+ ownerName =
+ "FromDozingTransitionInteractor" +
+ "(keyguardInteractor.onCameraLaunchDetected)",
from = KeyguardState.DOZING,
to = KeyguardState.OCCLUDED,
animatorAssertion = { it.isNotNull() },
diff --git a/packages/SystemUI/tests/src/com/android/systemui/keyguard/domain/interactor/WindowManagerLockscreenVisibilityInteractorTest.kt b/packages/SystemUI/tests/src/com/android/systemui/keyguard/domain/interactor/WindowManagerLockscreenVisibilityInteractorTest.kt
index a77169e74de5..2b8a644162c7 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/keyguard/domain/interactor/WindowManagerLockscreenVisibilityInteractorTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/keyguard/domain/interactor/WindowManagerLockscreenVisibilityInteractorTest.kt
@@ -20,8 +20,11 @@ import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.compose.animation.scene.ObservableTransitionState
import com.android.systemui.SysuiTestCase
+import com.android.systemui.authentication.data.repository.FakeAuthenticationRepository
+import com.android.systemui.authentication.domain.interactor.authenticationInteractor
import com.android.systemui.coroutines.collectLastValue
import com.android.systemui.coroutines.collectValues
+import com.android.systemui.deviceentry.domain.interactor.deviceUnlockedInteractor
import com.android.systemui.flags.DisableSceneContainer
import com.android.systemui.flags.EnableSceneContainer
import com.android.systemui.keyguard.data.repository.fakeKeyguardTransitionRepository
@@ -30,6 +33,7 @@ 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.scene.data.repository.sceneContainerRepository
+import com.android.systemui.scene.domain.interactor.sceneInteractor
import com.android.systemui.scene.shared.model.Scenes
import com.android.systemui.testKosmos
import com.android.systemui.util.mockito.mock
@@ -38,6 +42,7 @@ import com.google.common.truth.Truth.assertThat
import junit.framework.Assert.assertEquals
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.flowOf
+import kotlinx.coroutines.flow.map
import kotlinx.coroutines.test.runCurrent
import kotlinx.coroutines.test.runTest
import org.junit.Before
@@ -727,42 +732,48 @@ class WindowManagerLockscreenVisibilityInteractorTest : SysuiTestCase() {
@Test
@EnableSceneContainer
- fun sceneContainer_lockscreenVisibility_visibleWhenNotGone() =
+ fun lockscreenVisibility() =
testScope.runTest {
- val lockscreenVisibility by collectLastValue(underTest.value.lockscreenVisibility)
+ val isDeviceUnlocked by
+ collectLastValue(
+ kosmos.deviceUnlockedInteractor.deviceUnlockStatus.map { it.isUnlocked }
+ )
+ assertThat(isDeviceUnlocked).isFalse()
- sceneTransitions.value = lsToGone
- assertThat(lockscreenVisibility).isTrue()
+ val currentScene by collectLastValue(kosmos.sceneInteractor.currentScene)
+ assertThat(currentScene).isEqualTo(Scenes.Lockscreen)
- sceneTransitions.value = ObservableTransitionState.Idle(Scenes.Gone)
- assertThat(lockscreenVisibility).isFalse()
-
- sceneTransitions.value = goneToLs
- assertThat(lockscreenVisibility).isFalse()
+ val lockscreenVisibility by collectLastValue(underTest.value.lockscreenVisibility)
+ assertThat(lockscreenVisibility).isTrue()
- sceneTransitions.value = ObservableTransitionState.Idle(Scenes.Lockscreen)
+ kosmos.sceneInteractor.changeScene(Scenes.Bouncer, "")
+ assertThat(currentScene).isEqualTo(Scenes.Bouncer)
assertThat(lockscreenVisibility).isTrue()
- }
- @Test
- @EnableSceneContainer
- fun sceneContainer_lockscreenVisibility_notVisibleWhenReturningToGone() =
- testScope.runTest {
- val lockscreenVisibility by collectLastValue(underTest.value.lockscreenVisibility)
+ kosmos.authenticationInteractor.authenticate(FakeAuthenticationRepository.DEFAULT_PIN)
+ assertThat(isDeviceUnlocked).isTrue()
+ kosmos.sceneInteractor.changeScene(Scenes.Gone, "")
+ assertThat(currentScene).isEqualTo(Scenes.Gone)
+ assertThat(lockscreenVisibility).isFalse()
- sceneTransitions.value = goneToLs
+ kosmos.sceneInteractor.changeScene(Scenes.Shade, "")
+ assertThat(currentScene).isEqualTo(Scenes.Shade)
assertThat(lockscreenVisibility).isFalse()
- sceneTransitions.value = lsToGone
+ kosmos.sceneInteractor.changeScene(Scenes.QuickSettings, "")
+ assertThat(currentScene).isEqualTo(Scenes.QuickSettings)
assertThat(lockscreenVisibility).isFalse()
- sceneTransitions.value = ObservableTransitionState.Idle(Scenes.Gone)
+ kosmos.sceneInteractor.changeScene(Scenes.Shade, "")
+ assertThat(currentScene).isEqualTo(Scenes.Shade)
assertThat(lockscreenVisibility).isFalse()
- sceneTransitions.value = goneToLs
+ kosmos.sceneInteractor.changeScene(Scenes.Gone, "")
+ assertThat(currentScene).isEqualTo(Scenes.Gone)
assertThat(lockscreenVisibility).isFalse()
- sceneTransitions.value = ObservableTransitionState.Idle(Scenes.Lockscreen)
+ kosmos.sceneInteractor.changeScene(Scenes.Lockscreen, "")
+ assertThat(currentScene).isEqualTo(Scenes.Lockscreen)
assertThat(lockscreenVisibility).isTrue()
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/media/controls/ui/controller/MediaCarouselControllerTest.kt b/packages/SystemUI/tests/src/com/android/systemui/media/controls/ui/controller/MediaCarouselControllerTest.kt
index 7856f9bce5cc..a89139b18bed 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/media/controls/ui/controller/MediaCarouselControllerTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/media/controls/ui/controller/MediaCarouselControllerTest.kt
@@ -196,7 +196,7 @@ class MediaCarouselControllerTest : SysuiTestCase() {
verify(globalSettings)
.registerContentObserver(
eq(Settings.Global.getUriFor(Settings.Global.ANIMATOR_DURATION_SCALE)),
- settingsObserverCaptor.capture()
+ capture(settingsObserverCaptor)
)
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/media/dialog/MediaOutputBaseDialogTest.java b/packages/SystemUI/tests/src/com/android/systemui/media/dialog/MediaOutputBaseDialogTest.java
index 9bb21f020be8..9616f6106a04 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/media/dialog/MediaOutputBaseDialogTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/media/dialog/MediaOutputBaseDialogTest.java
@@ -128,6 +128,7 @@ public class MediaOutputBaseDialogTest extends SysuiTestCase {
mContext,
TEST_PACKAGE,
mContext.getUser(),
+ /* token */ null,
mMediaSessionManager,
mLocalBluetoothManager,
mStarter,
diff --git a/packages/SystemUI/tests/src/com/android/systemui/media/dialog/MediaOutputBroadcastDialogTest.java b/packages/SystemUI/tests/src/com/android/systemui/media/dialog/MediaOutputBroadcastDialogTest.java
index 2e6388ae3914..16b00c0b18b4 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/media/dialog/MediaOutputBroadcastDialogTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/media/dialog/MediaOutputBroadcastDialogTest.java
@@ -129,6 +129,7 @@ public class MediaOutputBroadcastDialogTest extends SysuiTestCase {
mContext,
TEST_PACKAGE,
mContext.getUser(),
+ /* token */ null,
mMediaSessionManager,
mLocalBluetoothManager,
mStarter,
diff --git a/packages/SystemUI/tests/src/com/android/systemui/media/dialog/MediaOutputControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/media/dialog/MediaOutputControllerTest.java
index 4eb00385f857..45ae50623612 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/media/dialog/MediaOutputControllerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/media/dialog/MediaOutputControllerTest.java
@@ -199,6 +199,7 @@ public class MediaOutputControllerTest extends SysuiTestCase {
mSpyContext,
mPackageName,
mContext.getUser(),
+ /* token */ null,
mMediaSessionManager,
mLocalBluetoothManager,
mStarter,
@@ -292,6 +293,7 @@ public class MediaOutputControllerTest extends SysuiTestCase {
mSpyContext,
null,
mContext.getUser(),
+ /* token */ null,
mMediaSessionManager,
mLocalBluetoothManager,
mStarter,
@@ -333,6 +335,7 @@ public class MediaOutputControllerTest extends SysuiTestCase {
mSpyContext,
null,
mSpyContext.getUser(),
+ /* token */ null,
mMediaSessionManager,
mLocalBluetoothManager,
mStarter,
@@ -588,6 +591,7 @@ public class MediaOutputControllerTest extends SysuiTestCase {
mSpyContext,
"",
mSpyContext.getUser(),
+ /* token */ null,
mMediaSessionManager,
mLocalBluetoothManager,
mStarter,
@@ -621,6 +625,7 @@ public class MediaOutputControllerTest extends SysuiTestCase {
mSpyContext,
"",
mSpyContext.getUser(),
+ /* token */ null,
mMediaSessionManager,
mLocalBluetoothManager,
mStarter,
@@ -667,6 +672,7 @@ public class MediaOutputControllerTest extends SysuiTestCase {
mSpyContext,
null,
mSpyContext.getUser(),
+ /* token */ null,
mMediaSessionManager,
mLocalBluetoothManager,
mStarter,
@@ -693,6 +699,7 @@ public class MediaOutputControllerTest extends SysuiTestCase {
mSpyContext,
null,
mSpyContext.getUser(),
+ /* token */ null,
mMediaSessionManager,
mLocalBluetoothManager,
mStarter,
@@ -972,6 +979,7 @@ public class MediaOutputControllerTest extends SysuiTestCase {
mSpyContext,
null,
mSpyContext.getUser(),
+ /* token */ null,
mMediaSessionManager,
mLocalBluetoothManager,
mStarter,
@@ -1174,6 +1182,7 @@ public class MediaOutputControllerTest extends SysuiTestCase {
mSpyContext,
null,
mSpyContext.getUser(),
+ /* token */ null,
mMediaSessionManager,
mLocalBluetoothManager,
mStarter,
diff --git a/packages/SystemUI/tests/src/com/android/systemui/media/dialog/MediaOutputDialogReceiverTest.java b/packages/SystemUI/tests/src/com/android/systemui/media/dialog/MediaOutputDialogReceiverTest.java
index 5dbfe475fedc..1e8fbeac05bd 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/media/dialog/MediaOutputDialogReceiverTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/media/dialog/MediaOutputDialogReceiverTest.java
@@ -64,7 +64,7 @@ public class MediaOutputDialogReceiverTest extends SysuiTestCase {
mMediaOutputDialogReceiver.onReceive(getContext(), intent);
verify(mMockMediaOutputDialogManager, times(1))
- .createAndShow(eq(getContext().getPackageName()), eq(false), any(), any());
+ .createAndShow(eq(getContext().getPackageName()), eq(false), any(), any(), any());
verify(mMockMediaOutputBroadcastDialogManager, never())
.createAndShow(any(), anyBoolean(), any());
}
@@ -76,7 +76,7 @@ public class MediaOutputDialogReceiverTest extends SysuiTestCase {
mMediaOutputDialogReceiver.onReceive(getContext(), intent);
verify(mMockMediaOutputDialogManager, never())
- .createAndShow(any(), anyBoolean(), any(), any());
+ .createAndShow(any(), anyBoolean(), any(), any(), any());
verify(mMockMediaOutputBroadcastDialogManager, never())
.createAndShow(any(), anyBoolean(), any());
}
@@ -87,7 +87,7 @@ public class MediaOutputDialogReceiverTest extends SysuiTestCase {
mMediaOutputDialogReceiver.onReceive(getContext(), intent);
verify(mMockMediaOutputDialogManager, never())
- .createAndShow(any(), anyBoolean(), any(), any());
+ .createAndShow(any(), anyBoolean(), any(), any(), any());
verify(mMockMediaOutputBroadcastDialogManager, never())
.createAndShow(any(), anyBoolean(), any());
}
@@ -101,7 +101,7 @@ public class MediaOutputDialogReceiverTest extends SysuiTestCase {
mMediaOutputDialogReceiver.onReceive(getContext(), intent);
verify(mMockMediaOutputDialogManager, never())
- .createAndShow(any(), anyBoolean(), any(), any());
+ .createAndShow(any(), anyBoolean(), any(), any(), any());
verify(mMockMediaOutputBroadcastDialogManager, never())
.createAndShow(any(), anyBoolean(), any());
}
@@ -115,7 +115,7 @@ public class MediaOutputDialogReceiverTest extends SysuiTestCase {
mMediaOutputDialogReceiver.onReceive(getContext(), intent);
verify(mMockMediaOutputDialogManager, never())
- .createAndShow(any(), anyBoolean(), any(), any());
+ .createAndShow(any(), anyBoolean(), any(), any(), any());
verify(mMockMediaOutputBroadcastDialogManager, times(1))
.createAndShow(eq(getContext().getPackageName()), eq(true), any());
}
@@ -129,7 +129,7 @@ public class MediaOutputDialogReceiverTest extends SysuiTestCase {
mMediaOutputDialogReceiver.onReceive(getContext(), intent);
verify(mMockMediaOutputDialogManager, never())
- .createAndShow(any(), anyBoolean(), any(), any());
+ .createAndShow(any(), anyBoolean(), any(), any(), any());
verify(mMockMediaOutputBroadcastDialogManager, never())
.createAndShow(any(), anyBoolean(), any());
}
@@ -142,7 +142,7 @@ public class MediaOutputDialogReceiverTest extends SysuiTestCase {
mMediaOutputDialogReceiver.onReceive(getContext(), intent);
verify(mMockMediaOutputDialogManager, never())
- .createAndShow(any(), anyBoolean(), any(), any());
+ .createAndShow(any(), anyBoolean(), any(), any(), any());
verify(mMockMediaOutputBroadcastDialogManager, never())
.createAndShow(any(), anyBoolean(), any());
}
@@ -155,7 +155,7 @@ public class MediaOutputDialogReceiverTest extends SysuiTestCase {
mMediaOutputDialogReceiver.onReceive(getContext(), intent);
verify(mMockMediaOutputDialogManager, never())
- .createAndShow(any(), anyBoolean(), any(), any());
+ .createAndShow(any(), anyBoolean(), any(), any(), any());
verify(mMockMediaOutputBroadcastDialogManager, never())
.createAndShow(any(), anyBoolean(), any());
}
@@ -166,7 +166,7 @@ public class MediaOutputDialogReceiverTest extends SysuiTestCase {
mMediaOutputDialogReceiver.onReceive(getContext(), intent);
verify(mMockMediaOutputDialogManager, never())
- .createAndShow(any(), anyBoolean(), any(), any());
+ .createAndShow(any(), anyBoolean(), any(), any(), any());
verify(mMockMediaOutputBroadcastDialogManager, never())
.createAndShow(any(), anyBoolean(), any());
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/media/dialog/MediaOutputDialogTest.java b/packages/SystemUI/tests/src/com/android/systemui/media/dialog/MediaOutputDialogTest.java
index cdef9644efa9..92d0a72e300c 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/media/dialog/MediaOutputDialogTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/media/dialog/MediaOutputDialogTest.java
@@ -142,6 +142,7 @@ public class MediaOutputDialogTest extends SysuiTestCase {
mContext,
TEST_PACKAGE,
mContext.getUser(),
+ /* token */ null,
mMediaSessionManager,
mLocalBluetoothManager,
mStarter,
diff --git a/packages/SystemUI/tests/src/com/android/systemui/monet/ColorSchemeTest.kt b/packages/SystemUI/tests/src/com/android/systemui/monet/ColorSchemeTest.kt
deleted file mode 100644
index 85cc88dd5283..000000000000
--- a/packages/SystemUI/tests/src/com/android/systemui/monet/ColorSchemeTest.kt
+++ /dev/null
@@ -1,266 +0,0 @@
-/*
- * Copyright (C) 2021 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.monet
-
-import android.testing.AndroidTestingRunner
-import android.util.Log
-import android.util.Pair
-import androidx.test.filters.SmallTest
-import com.android.systemui.SysuiTestCase
-import com.android.systemui.theme.DynamicColors
-import com.google.ux.material.libmonet.dynamiccolor.DynamicColor
-import com.google.ux.material.libmonet.hct.Hct
-import com.google.ux.material.libmonet.scheme.SchemeTonalSpot
-import java.io.File
-import java.io.FileWriter
-import java.io.StringWriter
-import javax.xml.parsers.DocumentBuilderFactory
-import javax.xml.transform.OutputKeys
-import javax.xml.transform.TransformerException
-import javax.xml.transform.TransformerFactory
-import javax.xml.transform.dom.DOMSource
-import javax.xml.transform.stream.StreamResult
-import kotlin.math.abs
-import org.junit.Test
-import org.junit.runner.RunWith
-import org.w3c.dom.Document
-import org.w3c.dom.Element
-import org.w3c.dom.Node
-
-private const val fileHeader =
- """
- ~ Copyright (C) 2022 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.
-"""
-
-private fun testName(name: String): String {
- return "Auto generated by: atest ColorSchemeTest#$name"
-}
-
-private const val commentRoles =
- "Colors used in Android system, from design system. These " +
- "values can be overlaid at runtime by OverlayManager RROs."
-
-private const val commentOverlay = "This value can be overlaid at runtime by OverlayManager RROs."
-
-private fun commentWhite(paletteName: String): String {
- return "Lightest shade of the $paletteName color used by the system. White. $commentOverlay"
-}
-
-private fun commentBlack(paletteName: String): String {
- return "Darkest shade of the $paletteName color used by the system. Black. $commentOverlay"
-}
-
-private fun commentShade(paletteName: String, tone: Int): String {
- return "Shade of the $paletteName system color at $tone% perceptual luminance (L* in L*a*b* " +
- "color space). $commentOverlay"
-}
-
-@SmallTest
-@RunWith(AndroidTestingRunner::class)
-class ColorSchemeTest : SysuiTestCase() {
- private val defaultContrast = 0.0
- private val defaultIsDark = false
- private val defaultIsFidelity = false
-
- @Test
- fun generateThemeStyles() {
- val document = buildDoc<Any>()
-
- val themes = document.createElement("themes")
- document.appendWithBreak(themes)
-
- var hue = 0.0
- while (hue < 360) {
- val sourceColor = Hct.from(hue, 50.0, 50.0)
- val sourceColorHex = sourceColor.toInt().toRGBHex()
-
- val theme = document.createElement("theme")
- theme.setAttribute("color", sourceColorHex)
- themes.appendChild(theme)
-
- for (styleValue in Style.entries) {
- if (
- styleValue == Style.CLOCK ||
- styleValue == Style.CLOCK_VIBRANT ||
- styleValue == Style.CONTENT
- ) {
- continue
- }
-
- val style = document.createElement(styleValue.name.lowercase())
- val colorScheme = ColorScheme(sourceColor.toInt(), defaultIsDark, styleValue)
-
- style.appendChild(
- document.createTextNode(
- listOf(
- colorScheme.accent1,
- colorScheme.accent2,
- colorScheme.accent3,
- colorScheme.neutral1,
- colorScheme.neutral2
- )
- .flatMap { a -> listOf(*a.allShades.toTypedArray()) }
- .joinToString(",", transform = Int::toRGBHex)
- )
- )
- theme.appendChild(style)
- }
-
- hue += 60
- }
-
- saveFile(document, "current_themes.xml")
- }
-
- @Test
- fun generateDefaultValues() {
- val document = buildDoc<Any>()
-
- val resources = document.createElement("resources")
- document.appendWithBreak(resources)
-
- // shade colors
- val colorScheme = ColorScheme(GOOGLE_BLUE, defaultIsDark)
- arrayOf(
- Triple("accent1", "Primary", colorScheme.accent1),
- Triple("accent2", "Secondary", colorScheme.accent2),
- Triple("accent3", "Tertiary", colorScheme.accent3),
- Triple("neutral1", "Neutral", colorScheme.neutral1),
- Triple("neutral2", "Secondary Neutral", colorScheme.neutral2)
- )
- .forEach {
- val (paletteName, readable, palette) = it
- palette.allShadesMapped.entries.forEachIndexed { index, (shade, colorValue) ->
- val comment =
- when (index) {
- 0 -> commentWhite(readable)
- palette.allShadesMapped.entries.size - 1 -> commentBlack(readable)
- else -> commentShade(readable, abs(shade / 10 - 100))
- }
- resources.createColorEntry("system_${paletteName}_$shade", colorValue, comment)
- }
- }
-
- resources.appendWithBreak(document.createComment(commentRoles), 2)
-
- fun generateDynamic(pairs: List<Pair<String, DynamicColor>>) {
- arrayOf(false, true).forEach { isDark ->
- val suffix = if (isDark) "_dark" else "_light"
- val dynamicScheme =
- SchemeTonalSpot(Hct.fromInt(GOOGLE_BLUE), isDark, defaultContrast)
- pairs.forEach {
- resources.createColorEntry(
- "system_${it.first}$suffix",
- it.second.getArgb(dynamicScheme)
- )
- }
- }
- }
-
- // dynamic colors
- generateDynamic(DynamicColors.allDynamicColorsMapped(defaultIsFidelity))
-
- // fixed colors
- val dynamicScheme =
- SchemeTonalSpot(Hct.fromInt(GOOGLE_BLUE), defaultIsDark, defaultContrast)
- DynamicColors.getFixedColorsMapped(defaultIsFidelity).forEach {
- resources.createColorEntry("system_${it.first}", it.second.getArgb(dynamicScheme))
- }
-
- resources.appendWithBreak(document.createComment(commentRoles), 2)
-
- // custom colors
- generateDynamic(DynamicColors.getCustomColorsMapped(defaultIsFidelity))
-
- saveFile(document, "role_values.xml")
- }
-
- // Helper Functions
-
- private inline fun <reified T> buildDoc(): Document {
- val functionName = T::class.simpleName + ""
- val factory = DocumentBuilderFactory.newInstance()
- val builder = factory.newDocumentBuilder()
- val document = builder.newDocument()
-
- document.appendWithBreak(document.createComment(fileHeader))
- document.appendWithBreak(document.createComment(testName(functionName)))
-
- return document
- }
-
- private fun documentToString(document: Document): String {
- try {
- val transformerFactory = TransformerFactory.newInstance()
- val transformer = transformerFactory.newTransformer()
- transformer.setOutputProperty(OutputKeys.MEDIA_TYPE, "application/xml")
- transformer.setOutputProperty(OutputKeys.METHOD, "xml")
- transformer.setOutputProperty(OutputKeys.INDENT, "yes")
- transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "4")
-
- val stringWriter = StringWriter()
- transformer.transform(DOMSource(document), StreamResult(stringWriter))
- return stringWriter.toString()
- } catch (e: TransformerException) {
- throw RuntimeException("Error transforming XML", e)
- }
- }
-
- private fun saveFile(document: Document, fileName: String) {
- val outPath = context.filesDir.path + "/" + fileName
- Log.d("ColorSchemeXml", "Artifact $fileName created")
- val writer = FileWriter(File(outPath))
- writer.write(documentToString(document))
- writer.close()
- }
-}
-
-private fun Element.createColorEntry(name: String, value: Int, comment: String? = null) {
- val doc = this.ownerDocument
-
- if (comment != null) {
- this.appendChild(doc.createComment(comment))
- }
-
- val color = doc.createElement("color")
- this.appendChild(color)
-
- color.setAttribute("name", name)
- color.appendChild(doc.createTextNode("#" + value.toRGBHex()))
-}
-
-private fun Node.appendWithBreak(child: Node, lineBreaks: Int = 1): Node {
- val doc = if (this is Document) this else this.ownerDocument
- val node = doc.createTextNode("\n".repeat(lineBreaks))
- this.appendChild(node)
- return this.appendChild(child)
-}
-
-private fun Int.toRGBHex(): String {
- return "%06X".format(0xFFFFFF and this)
-}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/motion/ComposeMotionTestRuleHelper.kt b/packages/SystemUI/tests/src/com/android/systemui/motion/ComposeMotionTestRuleHelper.kt
new file mode 100644
index 000000000000..e81e42b99442
--- /dev/null
+++ b/packages/SystemUI/tests/src/com/android/systemui/motion/ComposeMotionTestRuleHelper.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.motion
+
+import com.android.systemui.kosmos.Kosmos
+import com.android.systemui.kosmos.testScope
+import org.junit.rules.RuleChain
+import platform.test.motion.MotionTestRule
+import platform.test.motion.compose.ComposeToolkit
+import platform.test.motion.testing.createGoldenPathManager
+import platform.test.screenshot.DeviceEmulationSpec
+import platform.test.screenshot.Displays
+import platform.test.screenshot.PathConfig
+import platform.test.screenshot.utils.compose.ComposeScreenshotTestRule
+
+/** Create a [MotionTestRule] for motion tests of Compose-based System UI. */
+fun createSysUiComposeMotionTestRule(
+ kosmos: Kosmos,
+ deviceEmulationSpec: DeviceEmulationSpec = DeviceEmulationSpec(Displays.Phone),
+ pathConfig: PathConfig = PathConfig(),
+): MotionTestRule<ComposeToolkit> {
+ val goldenPathManager =
+ createGoldenPathManager("frameworks/base/packages/SystemUI/tests/goldens", pathConfig)
+ val testScope = kosmos.testScope
+
+ val composeScreenshotTestRule =
+ ComposeScreenshotTestRule(deviceEmulationSpec, goldenPathManager)
+
+ return MotionTestRule(
+ ComposeToolkit(composeScreenshotTestRule.composeRule, testScope),
+ goldenPathManager,
+ bitmapDiffer = composeScreenshotTestRule,
+ extraRules = RuleChain.outerRule(composeScreenshotTestRule)
+ )
+}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/qs/panels/domain/interactor/GridConsistencyInteractorTest.kt b/packages/SystemUI/tests/src/com/android/systemui/qs/panels/domain/interactor/GridConsistencyInteractorTest.kt
index d15cfbf537a2..2da4b7296c35 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/qs/panels/domain/interactor/GridConsistencyInteractorTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/qs/panels/domain/interactor/GridConsistencyInteractorTest.kt
@@ -23,8 +23,8 @@ import com.android.systemui.kosmos.testScope
import com.android.systemui.qs.panels.data.repository.IconTilesRepository
import com.android.systemui.qs.panels.data.repository.gridLayoutTypeRepository
import com.android.systemui.qs.panels.data.repository.iconTilesRepository
-import com.android.systemui.qs.panels.shared.model.GridLayoutType
import com.android.systemui.qs.panels.shared.model.InfiniteGridLayoutType
+import com.android.systemui.qs.panels.shared.model.PartitionedGridLayoutType
import com.android.systemui.qs.pipeline.data.repository.tileSpecRepository
import com.android.systemui.qs.pipeline.domain.interactor.currentTilesInteractor
import com.android.systemui.qs.pipeline.shared.TileSpec
@@ -45,8 +45,6 @@ import org.junit.runner.RunWith
@RunWith(AndroidTestingRunner::class)
class GridConsistencyInteractorTest : SysuiTestCase() {
- data object TestGridLayoutType : GridLayoutType
-
private val iconOnlyTiles =
MutableStateFlow(
setOf(
@@ -65,17 +63,13 @@ class GridConsistencyInteractorTest : SysuiTestCase() {
override val iconTilesSpecs: StateFlow<Set<TileSpec>>
get() = iconOnlyTiles.asStateFlow()
}
- gridConsistencyInteractorsMap =
- mapOf(
- Pair(InfiniteGridLayoutType, infiniteGridConsistencyInteractor),
- Pair(TestGridLayoutType, noopGridConsistencyInteractor)
- )
}
private val underTest = with(kosmos) { gridConsistencyInteractor }
@Before
fun setUp() {
+ // Mostly testing InfiniteGridConsistencyInteractor because it reorders tiles
with(kosmos) { gridLayoutTypeRepository.setLayout(InfiniteGridLayoutType) }
underTest.start()
}
@@ -86,7 +80,7 @@ class GridConsistencyInteractorTest : SysuiTestCase() {
with(kosmos) {
testScope.runTest {
// Using the no-op grid consistency interactor
- gridLayoutTypeRepository.setLayout(TestGridLayoutType)
+ gridLayoutTypeRepository.setLayout(PartitionedGridLayoutType)
// Setting an invalid layout with holes
// [ Large A ] [ sa ]
diff --git a/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationPanelViewControllerBaseTest.java b/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationPanelViewControllerBaseTest.java
index 4d32cc423ded..043dba13f616 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationPanelViewControllerBaseTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationPanelViewControllerBaseTest.java
@@ -24,6 +24,7 @@ import static com.android.systemui.log.LogBufferHelperKt.logcatLogBuffer;
import static com.google.common.truth.Truth.assertThat;
import static kotlinx.coroutines.flow.FlowKt.emptyFlow;
+import static kotlinx.coroutines.flow.SharedFlowKt.MutableSharedFlow;
import static kotlinx.coroutines.flow.StateFlowKt.MutableStateFlow;
import static org.mockito.ArgumentMatchers.any;
@@ -204,6 +205,7 @@ import com.android.wm.shell.animation.FlingAnimationUtils;
import dagger.Lazy;
import kotlinx.coroutines.CoroutineDispatcher;
+import kotlinx.coroutines.channels.BufferOverflow;
import kotlinx.coroutines.test.TestScope;
import org.junit.After;
@@ -351,7 +353,6 @@ public class NotificationPanelViewControllerBaseTest extends SysuiTestCase {
@Mock private KeyguardClockPositionAlgorithm mKeyguardClockPositionAlgorithm;
@Mock private NaturalScrollingSettingObserver mNaturalScrollingSettingObserver;
@Mock private LargeScreenHeaderHelper mLargeScreenHeaderHelper;
-
protected final int mMaxUdfpsBurnInOffsetY = 5;
protected FakeFeatureFlagsClassic mFeatureFlags = new FakeFeatureFlagsClassic();
protected KeyguardBottomAreaInteractor mKeyguardBottomAreaInteractor;
@@ -366,8 +367,11 @@ public class NotificationPanelViewControllerBaseTest extends SysuiTestCase {
protected PowerInteractor mPowerInteractor;
protected FakeHeadsUpNotificationRepository mFakeHeadsUpNotificationRepository =
new FakeHeadsUpNotificationRepository();
- protected HeadsUpNotificationInteractor mHeadsUpNotificationInteractor =
- new HeadsUpNotificationInteractor(mFakeHeadsUpNotificationRepository);
+ protected NotificationsKeyguardViewStateRepository mNotificationsKeyguardViewStateRepository =
+ new NotificationsKeyguardViewStateRepository();
+ protected NotificationsKeyguardInteractor mNotificationsKeyguardInteractor =
+ new NotificationsKeyguardInteractor(mNotificationsKeyguardViewStateRepository);
+ protected HeadsUpNotificationInteractor mHeadsUpNotificationInteractor;
protected NotificationPanelViewController.TouchHandler mTouchHandler;
protected ConfigurationController mConfigurationController;
protected SysuiStatusBarStateController mStatusBarStateController;
@@ -417,6 +421,9 @@ public class NotificationPanelViewControllerBaseTest extends SysuiTestCase {
mPowerInteractor = keyguardInteractorDeps.getPowerInteractor();
when(mKeyguardTransitionInteractor.isInTransitionToStateWhere(any())).thenReturn(
MutableStateFlow(false));
+ when(mKeyguardTransitionInteractor.getCurrentKeyguardState()).thenReturn(
+ MutableSharedFlow(0, 0, BufferOverflow.SUSPEND));
+ when(mDeviceEntryFaceAuthInteractor.isBypassEnabled()).thenReturn(MutableStateFlow(false));
DeviceEntryUdfpsInteractor deviceEntryUdfpsInteractor =
mock(DeviceEntryUdfpsInteractor.class);
when(deviceEntryUdfpsInteractor.isUdfpsSupported()).thenReturn(MutableStateFlow(false));
@@ -670,6 +677,11 @@ public class NotificationPanelViewControllerBaseTest extends SysuiTestCase {
when(mView.requireViewById(R.id.keyguard_long_press))
.thenReturn(mock(LongPressHandlingView.class));
+ mHeadsUpNotificationInteractor =
+ new HeadsUpNotificationInteractor(mFakeHeadsUpNotificationRepository,
+ mDeviceEntryFaceAuthInteractor, mKeyguardTransitionInteractor,
+ mNotificationsKeyguardInteractor, mShadeInteractor);
+
mNotificationPanelViewController = new NotificationPanelViewController(
mView,
mMainHandler,
diff --git a/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationPanelViewControllerWithCoroutinesTest.kt b/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationPanelViewControllerWithCoroutinesTest.kt
index 6631d29da719..e1ee3585abe3 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationPanelViewControllerWithCoroutinesTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/shade/NotificationPanelViewControllerWithCoroutinesTest.kt
@@ -251,7 +251,7 @@ class NotificationPanelViewControllerWithCoroutinesTest :
// WHEN a pinned heads up is present
mFakeHeadsUpNotificationRepository.setNotifications(
- fakeHeadsUpRowRepository("key", isPinned = true)
+ FakeHeadsUpRowRepository("key", isPinned = true)
)
}
advanceUntilIdle()
@@ -274,9 +274,4 @@ class NotificationPanelViewControllerWithCoroutinesTest :
// THEN the panel should be visible
assertThat(mNotificationPanelViewController.isExpanded).isTrue()
}
-
- private fun fakeHeadsUpRowRepository(key: String, isPinned: Boolean = false) =
- FakeHeadsUpRowRepository(key = key, elementKey = Any()).apply {
- this.isPinned.value = isPinned
- }
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/DragDownHelperTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/DragDownHelperTest.kt
index 9ec9b69d44c0..05d9495db091 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/DragDownHelperTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/DragDownHelperTest.kt
@@ -17,8 +17,8 @@
package com.android.systemui.statusbar
-import android.testing.AndroidTestingRunner
import android.testing.TestableLooper
+import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.systemui.ExpandHelper
import com.android.systemui.SysuiTestCase
@@ -39,7 +39,7 @@ import org.mockito.Mockito.`when` as whenever
@SmallTest
@TestableLooper.RunWithLooper
-@RunWith(AndroidTestingRunner::class)
+@RunWith(AndroidJUnit4::class)
class DragDownHelperTest : SysuiTestCase() {
private lateinit var dragDownHelper: DragDownHelper
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/KeyguardIndicationControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/KeyguardIndicationControllerTest.java
index 1504d4c1f033..995b5383c3c2 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/KeyguardIndicationControllerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/KeyguardIndicationControllerTest.java
@@ -65,9 +65,9 @@ import android.hardware.biometrics.BiometricFingerprintConstants;
import android.hardware.biometrics.BiometricSourceType;
import android.os.BatteryManager;
import android.os.RemoteException;
-import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.FlakyTest;
import androidx.test.filters.SmallTest;
@@ -88,7 +88,7 @@ import java.util.List;
import java.util.Set;
@SmallTest
-@RunWith(AndroidTestingRunner.class)
+@RunWith(AndroidJUnit4.class)
@TestableLooper.RunWithLooper
public class KeyguardIndicationControllerTest extends KeyguardIndicationControllerBaseTest {
@Test
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 cdc752098aa7..4a14f8853904 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/KeyguardIndicationControllerWithCoroutinesTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/KeyguardIndicationControllerWithCoroutinesTest.kt
@@ -16,9 +16,9 @@
package com.android.systemui.statusbar
-import android.testing.AndroidTestingRunner
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 kotlinx.coroutines.Dispatchers
@@ -28,7 +28,7 @@ import org.junit.runner.RunWith
import org.mockito.Mockito.times
import org.mockito.Mockito.verify
-@RunWith(AndroidTestingRunner::class)
+@RunWith(AndroidJUnit4::class)
@SmallTest
@TestableLooper.RunWithLooper(setAsMainLooper = true)
class KeyguardIndicationControllerWithCoroutinesTest : KeyguardIndicationControllerBaseTest() {
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/LSShadeTransitionLoggerTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/LSShadeTransitionLoggerTest.kt
index 8cb530c355bd..948a73208d10 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/LSShadeTransitionLoggerTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/LSShadeTransitionLoggerTest.kt
@@ -1,7 +1,7 @@
package com.android.systemui.statusbar
-import android.testing.AndroidTestingRunner
import android.util.DisplayMetrics
+import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.systemui.SysuiTestCase
import com.android.systemui.log.LogBuffer
@@ -16,7 +16,7 @@ import org.junit.runner.RunWith
import org.mockito.Mock
import org.mockito.junit.MockitoJUnit
-@RunWith(AndroidTestingRunner::class)
+@RunWith(AndroidJUnit4::class)
@SmallTest
class LSShadeTransitionLoggerTest : SysuiTestCase() {
lateinit var logger: LSShadeTransitionLogger
@@ -41,4 +41,4 @@ class LSShadeTransitionLoggerTest : SysuiTestCase() {
// log a non-null, non row, ensure no crash
logger.logDragDownStarted(view)
}
-} \ No newline at end of file
+}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/LightRevealScrimTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/LightRevealScrimTest.kt
index d3befb4ad4cd..fe2dd6d78a82 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/LightRevealScrimTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/LightRevealScrimTest.kt
@@ -16,8 +16,8 @@
package com.android.systemui.statusbar
-import android.testing.AndroidTestingRunner
import android.view.View
+import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.systemui.SysuiTestCase
import com.google.common.truth.Truth.assertThat
@@ -28,7 +28,7 @@ import org.junit.Test
import org.junit.runner.RunWith
import java.util.function.Consumer
-@RunWith(AndroidTestingRunner::class)
+@RunWith(AndroidJUnit4::class)
@SmallTest
class LightRevealScrimTest : SysuiTestCase() {
@@ -85,4 +85,4 @@ class LightRevealScrimTest : SysuiTestCase() {
private const val DEFAULT_WIDTH = 42
private const val DEFAULT_HEIGHT = 24
}
-} \ No newline at end of file
+}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/LockscreenShadeQsTransitionControllerTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/LockscreenShadeQsTransitionControllerTest.kt
index 402d9aab66bd..e48242a3e003 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/LockscreenShadeQsTransitionControllerTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/LockscreenShadeQsTransitionControllerTest.kt
@@ -16,7 +16,7 @@
package com.android.systemui.statusbar
-import android.testing.AndroidTestingRunner
+import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.systemui.SysuiTestCase
import com.android.systemui.dump.DumpManager
@@ -36,7 +36,7 @@ import org.mockito.Mockito.verify
import org.mockito.MockitoAnnotations
@SmallTest
-@RunWith(AndroidTestingRunner::class)
+@RunWith(AndroidJUnit4::class)
class LockscreenShadeQsTransitionControllerTest : SysuiTestCase() {
private val configurationController = FakeConfigurationController()
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/LockscreenShadeTransitionControllerTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/LockscreenShadeTransitionControllerTest.kt
index a92cf8c96339..69e8f4737a5a 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/LockscreenShadeTransitionControllerTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/LockscreenShadeTransitionControllerTest.kt
@@ -1,9 +1,9 @@
package com.android.systemui.statusbar
import android.app.StatusBarManager.DISABLE2_NOTIFICATION_SHADE
-import android.testing.AndroidTestingRunner
import android.testing.TestableLooper
import android.testing.TestableLooper.RunWithLooper
+import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.systemui.ExpandHelper
import com.android.systemui.SysUITestModule
@@ -74,7 +74,7 @@ private fun <T> anyObject(): T {
@SmallTest
@RunWithLooper(setAsMainLooper = true)
-@RunWith(AndroidTestingRunner::class)
+@RunWith(AndroidJUnit4::class)
@OptIn(ExperimentalCoroutinesApi::class)
class LockscreenShadeTransitionControllerTest : SysuiTestCase() {
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationListenerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationListenerTest.java
index d3febf55117b..ef1c927f22d7 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationListenerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationListenerTest.java
@@ -32,8 +32,8 @@ import android.os.UserHandle;
import android.service.notification.NotificationListenerService.Ranking;
import android.service.notification.NotificationListenerService.RankingMap;
import android.service.notification.StatusBarNotification;
-import android.testing.AndroidTestingRunner;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.SmallTest;
import com.android.systemui.SysuiTestCase;
@@ -52,7 +52,7 @@ import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
@SmallTest
-@RunWith(AndroidTestingRunner.class)
+@RunWith(AndroidJUnit4.class)
public class NotificationListenerTest extends SysuiTestCase {
private static final String TEST_PACKAGE_NAME = "test";
private static final int TEST_UID = 0;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationRemoteInputManagerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationRemoteInputManagerTest.java
index d3850be7c192..c9d910c530ea 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationRemoteInputManagerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationRemoteInputManagerTest.java
@@ -27,9 +27,9 @@ import android.app.Notification;
import android.content.Context;
import android.os.SystemClock;
import android.os.UserHandle;
-import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.SmallTest;
import com.android.systemui.SysuiTestCase;
@@ -52,7 +52,7 @@ import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
@SmallTest
-@RunWith(AndroidTestingRunner.class)
+@RunWith(AndroidJUnit4.class)
@TestableLooper.RunWithLooper
public class NotificationRemoteInputManagerTest extends SysuiTestCase {
private static final String TEST_PACKAGE_NAME = "test";
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationShadeDepthControllerTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationShadeDepthControllerTest.kt
index fc0c85e30d5a..9f94cff4ead4 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationShadeDepthControllerTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationShadeDepthControllerTest.kt
@@ -17,11 +17,11 @@
package com.android.systemui.statusbar
import android.os.IBinder
-import android.testing.AndroidTestingRunner
import android.testing.TestableLooper.RunWithLooper
import android.view.Choreographer
import android.view.View
import android.view.ViewRootImpl
+import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.systemui.SysuiTestCase
import com.android.systemui.animation.ShadeInterpolation
@@ -59,7 +59,7 @@ import org.mockito.Mockito.verify
import org.mockito.Mockito.`when`
import org.mockito.junit.MockitoJUnit
-@RunWith(AndroidTestingRunner::class)
+@RunWith(AndroidJUnit4::class)
@RunWithLooper
@SmallTest
class NotificationShadeDepthControllerTest : SysuiTestCase() {
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/PulseExpansionHandlerTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/PulseExpansionHandlerTest.kt
index 49e5c456e645..9907740672ed 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/PulseExpansionHandlerTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/PulseExpansionHandlerTest.kt
@@ -17,8 +17,8 @@
package com.android.systemui.statusbar
-import android.testing.AndroidTestingRunner
import android.testing.TestableLooper
+import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.systemui.SysuiTestCase
import com.android.systemui.dump.DumpManager
@@ -43,7 +43,7 @@ import org.mockito.Mockito.`when` as whenever
@SmallTest
@TestableLooper.RunWithLooper
-@RunWith(AndroidTestingRunner::class)
+@RunWith(AndroidJUnit4::class)
class PulseExpansionHandlerTest : SysuiTestCase() {
private lateinit var pulseExpansionHandler: PulseExpansionHandler
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/RemoteInputNotificationRebuilderTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/RemoteInputNotificationRebuilderTest.java
index ce11d6a62a8c..58943ea3b4ee 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/RemoteInputNotificationRebuilderTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/RemoteInputNotificationRebuilderTest.java
@@ -27,9 +27,9 @@ import android.app.RemoteInputHistoryItem;
import android.net.Uri;
import android.os.UserHandle;
import android.service.notification.StatusBarNotification;
-import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.SmallTest;
import com.android.systemui.SysuiTestCase;
@@ -44,7 +44,7 @@ import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
@SmallTest
-@RunWith(AndroidTestingRunner.class)
+@RunWith(AndroidJUnit4.class)
@TestableLooper.RunWithLooper
public class RemoteInputNotificationRebuilderTest extends SysuiTestCase {
private static final String TEST_PACKAGE_NAME = "test";
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/SingleShadeLockScreenOverScrollerTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/SingleShadeLockScreenOverScrollerTest.kt
index 2606be5fabad..6b9a19a92fc4 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/SingleShadeLockScreenOverScrollerTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/SingleShadeLockScreenOverScrollerTest.kt
@@ -1,7 +1,7 @@
package com.android.systemui.statusbar
import org.mockito.Mockito.`when` as whenever
-import android.testing.AndroidTestingRunner
+import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.systemui.SysuiTestCase
import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayoutController
@@ -14,7 +14,7 @@ import org.mockito.Mockito.intThat
import org.mockito.Mockito.verify
import org.mockito.MockitoAnnotations
-@RunWith(AndroidTestingRunner::class)
+@RunWith(AndroidJUnit4::class)
@SmallTest
class SingleShadeLockScreenOverScrollerTest : SysuiTestCase() {
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/SmartReplyControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/SmartReplyControllerTest.java
index 775dc3c95746..3346e19b4ce9 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/SmartReplyControllerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/SmartReplyControllerTest.java
@@ -29,9 +29,9 @@ import android.os.Handler;
import android.os.RemoteException;
import android.os.UserHandle;
import android.service.notification.StatusBarNotification;
-import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.SmallTest;
import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
@@ -52,7 +52,7 @@ import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
-@RunWith(AndroidTestingRunner.class)
+@RunWith(AndroidJUnit4.class)
@TestableLooper.RunWithLooper
@SmallTest
public class SmartReplyControllerTest extends SysuiTestCase {
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/SplitShadeLockScreenOverScrollerTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/SplitShadeLockScreenOverScrollerTest.kt
index 700fb1ec332c..58473c4e07a3 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/SplitShadeLockScreenOverScrollerTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/SplitShadeLockScreenOverScrollerTest.kt
@@ -1,7 +1,7 @@
package com.android.systemui.statusbar
-import android.testing.AndroidTestingRunner
import android.testing.TestableLooper
+import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.systemui.SysuiTestCase
import com.android.systemui.dump.DumpManager
@@ -23,7 +23,7 @@ import org.mockito.Mockito.verifyZeroInteractions
import org.mockito.Mockito.`when` as whenever
import org.mockito.MockitoAnnotations
-@RunWith(AndroidTestingRunner::class)
+@RunWith(AndroidJUnit4::class)
@SmallTest
@TestableLooper.RunWithLooper
class SplitShadeLockScreenOverScrollerTest : SysuiTestCase() {
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/StatusBarStateEventTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/StatusBarStateEventTest.kt
index 79a2008e7542..26692c908c5a 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/StatusBarStateEventTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/StatusBarStateEventTest.kt
@@ -16,7 +16,7 @@
package com.android.systemui.statusbar
-import android.testing.AndroidTestingRunner
+import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.systemui.SysuiTestCase
import org.junit.Assert.assertEquals
@@ -24,7 +24,7 @@ import org.junit.Test
import org.junit.runner.RunWith
@SmallTest
-@RunWith(AndroidTestingRunner::class)
+@RunWith(AndroidJUnit4::class)
class StatusBarStateEventTest : SysuiTestCase() {
@Test
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/VibratorHelperTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/VibratorHelperTest.kt
index b90582575970..78c1887f7c0d 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/VibratorHelperTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/VibratorHelperTest.kt
@@ -5,9 +5,9 @@ import android.os.UserHandle
import android.os.VibrationAttributes
import android.os.VibrationEffect
import android.os.Vibrator
-import android.testing.AndroidTestingRunner
import android.view.HapticFeedbackConstants
import android.view.View
+import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.systemui.SysuiTestCase
import com.android.systemui.util.mockito.eq
@@ -26,7 +26,7 @@ import org.mockito.Mockito.verify
import org.mockito.junit.MockitoJUnit
import java.util.concurrent.Executor
-@RunWith(AndroidTestingRunner::class)
+@RunWith(AndroidJUnit4::class)
@SmallTest
class VibratorHelperTest : SysuiTestCase() {
@@ -120,4 +120,4 @@ class VibratorHelperTest : SysuiTestCase() {
return verify(vibrator)
}
-} \ No newline at end of file
+}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/connectivity/AccessPointControllerImplTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/connectivity/AccessPointControllerImplTest.kt
index 7e88ae080178..643acdbb9277 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/connectivity/AccessPointControllerImplTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/connectivity/AccessPointControllerImplTest.kt
@@ -17,8 +17,8 @@
package com.android.systemui.statusbar.connectivity
import android.os.UserManager
+import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
-import android.testing.AndroidTestingRunner
import android.testing.TestableLooper.RunWithLooper
import androidx.lifecycle.Lifecycle
import com.android.systemui.SysuiTestCase
@@ -42,7 +42,7 @@ import org.mockito.MockitoAnnotations
import java.util.concurrent.Executor
@SmallTest
-@RunWith(AndroidTestingRunner::class)
+@RunWith(AndroidJUnit4::class)
@RunWithLooper(setAsMainLooper = true)
class AccessPointControllerImplTest : SysuiTestCase() {
@@ -244,4 +244,4 @@ class AccessPointControllerImplTest : SysuiTestCase() {
verify(wifiEntryOther).connect(any())
verify(callback, never()).onSettingsActivityTriggered(any())
}
-} \ No newline at end of file
+}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/connectivity/MobileStateTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/connectivity/MobileStateTest.kt
index 7aed4f7e250b..40f81e2bae5d 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/connectivity/MobileStateTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/connectivity/MobileStateTest.kt
@@ -15,7 +15,7 @@
*/
package com.android.systemui.statusbar.connectivity
-import android.testing.AndroidTestingRunner
+import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.settingslib.mobile.TelephonyIcons
import com.android.systemui.SysuiTestCase
@@ -26,7 +26,7 @@ import org.junit.Test
import org.junit.runner.RunWith
@SmallTest
-@RunWith(AndroidTestingRunner::class)
+@RunWith(AndroidJUnit4::class)
class MobileStateTest : SysuiTestCase() {
private val state = MobileState()
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/connectivity/NetworkControllerDataTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/connectivity/NetworkControllerDataTest.java
index 461d80412cb5..4241254e1fb9 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/connectivity/NetworkControllerDataTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/connectivity/NetworkControllerDataTest.java
@@ -39,10 +39,10 @@ import android.os.Looper;
import android.telephony.NetworkRegistrationInfo;
import android.telephony.ServiceState;
import android.telephony.TelephonyManager;
-import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper;
import android.testing.TestableLooper.RunWithLooper;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.SmallTest;
import com.android.settingslib.SignalIcon.MobileIconGroup;
@@ -60,7 +60,7 @@ import org.junit.runner.RunWith;
import java.util.HashMap;
@SmallTest
-@RunWith(AndroidTestingRunner.class)
+@RunWith(AndroidJUnit4.class)
@RunWithLooper
public class NetworkControllerDataTest extends NetworkControllerBaseTest {
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/connectivity/NetworkControllerEthernetTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/connectivity/NetworkControllerEthernetTest.java
index 3bbf06dbc69c..521cb4f4c42d 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/connectivity/NetworkControllerEthernetTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/connectivity/NetworkControllerEthernetTest.java
@@ -19,9 +19,9 @@ package com.android.systemui.statusbar.connectivity;
import static junit.framework.Assert.assertEquals;
import android.net.NetworkCapabilities;
-import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper.RunWithLooper;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.SmallTest;
import org.junit.Test;
@@ -30,7 +30,7 @@ import org.mockito.ArgumentCaptor;
import org.mockito.Mockito;
@SmallTest
-@RunWith(AndroidTestingRunner.class)
+@RunWith(AndroidJUnit4.class)
@RunWithLooper
public class NetworkControllerEthernetTest extends NetworkControllerBaseTest {
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/connectivity/NetworkControllerSignalTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/connectivity/NetworkControllerSignalTest.java
index 35609a5faf00..22f0e9d20c41 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/connectivity/NetworkControllerSignalTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/connectivity/NetworkControllerSignalTest.java
@@ -33,10 +33,10 @@ import android.telephony.SignalStrength;
import android.telephony.SubscriptionInfo;
import android.telephony.SubscriptionManager;
import android.telephony.TelephonyManager;
-import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper;
import android.testing.TestableLooper.RunWithLooper;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.SmallTest;
import com.android.settingslib.graph.SignalDrawable;
@@ -59,7 +59,7 @@ import java.util.Collections;
import java.util.List;
@SmallTest
-@RunWith(AndroidTestingRunner.class)
+@RunWith(AndroidJUnit4.class)
@RunWithLooper
public class NetworkControllerSignalTest extends NetworkControllerBaseTest {
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/connectivity/NetworkControllerWifiTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/connectivity/NetworkControllerWifiTest.java
index 44a1c50e5a58..6c80a97625a7 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/connectivity/NetworkControllerWifiTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/connectivity/NetworkControllerWifiTest.java
@@ -34,9 +34,9 @@ import android.net.NetworkInfo;
import android.net.vcn.VcnTransportInfo;
import android.net.wifi.WifiInfo;
import android.net.wifi.WifiManager;
-import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper.RunWithLooper;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.SmallTest;
import com.android.settingslib.mobile.TelephonyIcons;
@@ -50,7 +50,7 @@ import org.mockito.Mockito;
import java.util.Collections;
@SmallTest
-@RunWith(AndroidTestingRunner.class)
+@RunWith(AndroidJUnit4.class)
@RunWithLooper
public class NetworkControllerWifiTest extends NetworkControllerBaseTest {
// These match the constants in WifiManager and need to be kept up to date.
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/connectivity/NetworkTypeResIdCacheTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/connectivity/NetworkTypeResIdCacheTest.kt
index 5bf0a94935cf..3eeed73a539c 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/connectivity/NetworkTypeResIdCacheTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/connectivity/NetworkTypeResIdCacheTest.kt
@@ -16,7 +16,7 @@
package com.android.systemui.statusbar.connectivity
-import android.testing.AndroidTestingRunner
+import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.settingslib.SignalIcon.MobileIconGroup
import com.android.systemui.SysuiTestCase
@@ -26,7 +26,7 @@ import org.junit.Test
import org.junit.runner.RunWith
@SmallTest
-@RunWith(AndroidTestingRunner::class)
+@RunWith(AndroidJUnit4::class)
class NetworkTypeResIdCacheTest : SysuiTestCase() {
private lateinit var cache: NetworkTypeResIdCache
private var overrides = MobileIconCarrierIdOverridesFake()
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/events/SystemEventChipAnimationControllerTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/events/SystemEventChipAnimationControllerTest.kt
index 452302d4db8a..984bda1c0d21 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/events/SystemEventChipAnimationControllerTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/events/SystemEventChipAnimationControllerTest.kt
@@ -19,11 +19,11 @@ package com.android.systemui.statusbar.events
import android.content.Context
import android.graphics.Insets
import android.graphics.Rect
-import android.testing.AndroidTestingRunner
import android.testing.TestableLooper
import android.view.Gravity
import android.view.View
import android.widget.FrameLayout
+import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.systemui.SysuiTestCase
import com.android.systemui.animation.AnimatorTestRule
@@ -46,7 +46,7 @@ import org.mockito.Mockito.verify
import org.mockito.MockitoAnnotations
@SmallTest
-@RunWith(AndroidTestingRunner::class)
+@RunWith(AndroidJUnit4::class)
@TestableLooper.RunWithLooper
class SystemEventChipAnimationControllerTest : SysuiTestCase() {
private lateinit var controller: SystemEventChipAnimationController
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/events/SystemEventCoordinatorTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/events/SystemEventCoordinatorTest.kt
index ae84df55e113..742494b769de 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/events/SystemEventCoordinatorTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/events/SystemEventCoordinatorTest.kt
@@ -15,8 +15,8 @@
*/
package com.android.systemui.statusbar.events
-import android.testing.AndroidTestingRunner
import android.testing.TestableLooper
+import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.systemui.SysuiTestCase
import com.android.systemui.display.domain.interactor.ConnectedDisplayInteractor
@@ -40,7 +40,7 @@ import org.mockito.Mockito.verify
import org.mockito.Mockito.verifyNoMoreInteractions
import org.mockito.MockitoAnnotations
-@RunWith(AndroidTestingRunner::class)
+@RunWith(AndroidJUnit4::class)
@TestableLooper.RunWithLooper(setAsMainLooper = true)
@SmallTest
@OptIn(ExperimentalCoroutinesApi::class)
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 cacfa8dc0be4..376873d19624 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
@@ -19,10 +19,10 @@ package com.android.systemui.statusbar.events
import android.graphics.Insets
import android.graphics.Rect
import android.os.Process
-import android.testing.AndroidTestingRunner
import android.testing.TestableLooper.RunWithLooper
import android.view.View
import android.widget.FrameLayout
+import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.systemui.SysuiTestCase
import com.android.systemui.animation.AnimatorTestRule
@@ -54,7 +54,7 @@ import org.mockito.Mockito.times
import org.mockito.Mockito.verify
import org.mockito.MockitoAnnotations
-@RunWith(AndroidTestingRunner::class)
+@RunWith(AndroidJUnit4::class)
@RunWithLooper(setAsMainLooper = true)
@OptIn(ExperimentalCoroutinesApi::class)
@SmallTest
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/gesture/GenericGestureDetectorTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/gesture/GenericGestureDetectorTest.kt
index d3f5adeb05bb..0f58990d4310 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/gesture/GenericGestureDetectorTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/gesture/GenericGestureDetectorTest.kt
@@ -1,9 +1,9 @@
package com.android.systemui.statusbar.gesture
-import android.testing.AndroidTestingRunner
import android.testing.TestableLooper
import android.view.InputEvent
import android.view.MotionEvent
+import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.systemui.SysuiTestCase
import com.android.systemui.settings.FakeDisplayTracker
@@ -13,7 +13,7 @@ import org.junit.Test
import org.junit.runner.RunWith
@SmallTest
-@RunWith(AndroidTestingRunner::class)
+@RunWith(AndroidJUnit4::class)
@TestableLooper.RunWithLooper
class GenericGestureDetectorTest : SysuiTestCase() {
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/AboveShelfObserverTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/AboveShelfObserverTest.java
index 6b2ee76a75ac..01a0fd020bda 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/AboveShelfObserverTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/AboveShelfObserverTest.java
@@ -19,11 +19,11 @@ package com.android.systemui.statusbar.notification;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
-import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper;
import android.testing.TestableLooper.RunWithLooper;
import android.widget.FrameLayout;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.SmallTest;
import com.android.systemui.SysuiTestCase;
@@ -36,7 +36,7 @@ import org.junit.Test;
import org.junit.runner.RunWith;
@SmallTest
-@RunWith(AndroidTestingRunner.class)
+@RunWith(AndroidJUnit4.class)
@RunWithLooper
public class AboveShelfObserverTest extends SysuiTestCase {
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/AssistantFeedbackControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/AssistantFeedbackControllerTest.java
index fc4702c209e1..d66b010daefd 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/AssistantFeedbackControllerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/AssistantFeedbackControllerTest.java
@@ -42,9 +42,9 @@ import android.os.Handler;
import android.os.UserHandle;
import android.provider.DeviceConfig;
import android.service.notification.StatusBarNotification;
-import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.SmallTest;
import com.android.internal.config.sysui.SystemUiDeviceConfigFlags;
@@ -58,7 +58,7 @@ import org.junit.Test;
import org.junit.runner.RunWith;
@SmallTest
-@RunWith(AndroidTestingRunner.class)
+@RunWith(AndroidJUnit4.class)
@TestableLooper.RunWithLooper
public class AssistantFeedbackControllerTest extends SysuiTestCase {
private static final String TEST_PACKAGE_NAME = "test_package";
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/DynamicChildBindControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/DynamicChildBindControllerTest.java
index 0103564088e0..77fd06757595 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/DynamicChildBindControllerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/DynamicChildBindControllerTest.java
@@ -25,12 +25,12 @@ import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
-import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper;
import android.util.ArrayMap;
import android.view.LayoutInflater;
import android.view.View;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.SmallTest;
import com.android.systemui.SysuiTestCase;
@@ -56,7 +56,7 @@ import java.util.List;
import java.util.Map;
@SmallTest
-@RunWith(AndroidTestingRunner.class)
+@RunWith(AndroidJUnit4.class)
@TestableLooper.RunWithLooper
public class DynamicChildBindControllerTest extends SysuiTestCase {
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/DynamicPrivacyControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/DynamicPrivacyControllerTest.java
index 5b72ca07edbe..d879fcecffab 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/DynamicPrivacyControllerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/DynamicPrivacyControllerTest.java
@@ -25,9 +25,9 @@ import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyNoMoreInteractions;
import static org.mockito.Mockito.when;
-import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.SmallTest;
import com.android.systemui.SysuiTestCase;
@@ -38,9 +38,10 @@ import com.android.systemui.statusbar.policy.KeyguardStateController;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
+import org.junit.runner.RunWith;
@SmallTest
-@org.junit.runner.RunWith(AndroidTestingRunner.class)
+@RunWith(AndroidJUnit4.class)
@TestableLooper.RunWithLooper
public class DynamicPrivacyControllerTest extends SysuiTestCase {
@@ -127,4 +128,4 @@ public class DynamicPrivacyControllerTest extends SysuiTestCase {
mDynamicPrivacyController.onUnlockedChanged();
verifyNoMoreInteractions(mListener);
}
-} \ No newline at end of file
+}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/NotificationSectionsFeatureManagerTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/NotificationSectionsFeatureManagerTest.kt
index 1cce3b5b9e77..9e733be6665c 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/NotificationSectionsFeatureManagerTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/NotificationSectionsFeatureManagerTest.kt
@@ -16,15 +16,17 @@
package com.android.systemui.statusbar.notification
+import android.platform.test.annotations.DisableFlags
import android.provider.DeviceConfig
import android.provider.Settings
-import android.testing.AndroidTestingRunner
+import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.dx.mockito.inline.extended.ExtendedMockito
import com.android.internal.config.sysui.SystemUiDeviceConfigFlags.NOTIFICATIONS_USE_PEOPLE_FILTERING
import com.android.systemui.SysuiTestCase
+import com.android.systemui.statusbar.notification.shared.PriorityPeopleSection
import com.android.systemui.util.DeviceConfigProxyFake
import com.android.systemui.util.Utils
import com.android.systemui.util.mockito.any
@@ -39,8 +41,9 @@ import org.mockito.Mockito.`when`
import org.mockito.MockitoSession
import org.mockito.quality.Strictness
-@RunWith(AndroidTestingRunner::class)
+@RunWith(AndroidJUnit4::class)
@SmallTest
+@DisableFlags(PriorityPeopleSection.FLAG_NAME) // this class has no logic with the flag enabled
class NotificationSectionsFeatureManagerTest : SysuiTestCase() {
var manager: NotificationSectionsFeatureManager? = null
val proxyFake = DeviceConfigProxyFake()
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/NotificationTransitionAnimatorControllerTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/NotificationTransitionAnimatorControllerTest.kt
index 3b3f05d25c16..3abdf6212f22 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/NotificationTransitionAnimatorControllerTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/NotificationTransitionAnimatorControllerTest.kt
@@ -1,9 +1,9 @@
package com.android.systemui.statusbar.notification
import android.app.Notification.GROUP_ALERT_SUMMARY
-import android.testing.AndroidTestingRunner
import android.testing.TestableLooper
import android.testing.TestableLooper.RunWithLooper
+import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.systemui.SysuiTestCase
import com.android.systemui.coroutines.collectLastValue
@@ -35,7 +35,7 @@ import org.mockito.Mockito.`when`
import org.mockito.junit.MockitoJUnit
@SmallTest
-@RunWith(AndroidTestingRunner::class)
+@RunWith(AndroidJUnit4::class)
@RunWithLooper
class NotificationTransitionAnimatorControllerTest : SysuiTestCase() {
@Mock lateinit var notificationListContainer: NotificationListContainer
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/NotificationWakeUpCoordinatorLoggerTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/NotificationWakeUpCoordinatorLoggerTest.kt
index 1aac515f538b..a5206f52b6f2 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/NotificationWakeUpCoordinatorLoggerTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/NotificationWakeUpCoordinatorLoggerTest.kt
@@ -16,7 +16,7 @@
package com.android.systemui.statusbar.notification
-import android.testing.AndroidTestingRunner
+import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.systemui.SysuiTestCase
import com.android.systemui.log.LogBuffer
@@ -28,7 +28,7 @@ import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
-@RunWith(AndroidTestingRunner::class)
+@RunWith(AndroidJUnit4::class)
@SmallTest
class NotificationWakeUpCoordinatorLoggerTest : SysuiTestCase() {
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/NotificationWakeUpCoordinatorTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/NotificationWakeUpCoordinatorTest.kt
index 67b540cd762e..0906d8eadf44 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/NotificationWakeUpCoordinatorTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/NotificationWakeUpCoordinatorTest.kt
@@ -16,8 +16,8 @@
package com.android.systemui.statusbar.notification
-import android.testing.AndroidTestingRunner
import android.testing.TestableLooper
+import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.compose.animation.scene.ObservableTransitionState
import com.android.systemui.SysuiTestCase
@@ -60,7 +60,7 @@ import org.mockito.Mockito.verify
import org.mockito.Mockito.verifyNoMoreInteractions
@OptIn(ExperimentalCoroutinesApi::class)
-@RunWith(AndroidTestingRunner::class)
+@RunWith(AndroidJUnit4::class)
@SmallTest
@TestableLooper.RunWithLooper(setAsMainLooper = true)
class NotificationWakeUpCoordinatorTest : SysuiTestCase() {
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/RoundableTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/RoundableTest.kt
index 7d8cf3657ba1..382b307fb9de 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/RoundableTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/RoundableTest.kt
@@ -2,6 +2,7 @@ package com.android.systemui.statusbar.notification
import android.platform.test.annotations.EnableFlags
import android.view.View
+import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.systemui.SysuiTestCase
import com.android.systemui.statusbar.notification.shared.NotificationsImprovedHunAnimation
@@ -10,13 +11,12 @@ import com.android.systemui.util.mockito.whenever
import org.junit.Assert.assertEquals
import org.junit.Test
import org.junit.runner.RunWith
-import org.junit.runners.JUnit4
import org.mockito.Mockito.atLeastOnce
import org.mockito.Mockito.times
import org.mockito.Mockito.verify
@SmallTest
-@RunWith(JUnit4::class)
+@RunWith(AndroidJUnit4::class)
class RoundableTest : SysuiTestCase() {
private val targetView: View = mock()
private val roundable = FakeRoundable(targetView = targetView)
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/HighPriorityProviderTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/HighPriorityProviderTest.java
index 2d044fec1eb6..8e95ac599ce1 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/HighPriorityProviderTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/HighPriorityProviderTest.java
@@ -30,8 +30,8 @@ import static org.mockito.Mockito.when;
import android.app.Notification;
import android.app.NotificationChannel;
-import android.testing.AndroidTestingRunner;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.SmallTest;
import com.android.systemui.SysuiTestCase;
@@ -51,7 +51,7 @@ import java.util.Arrays;
import java.util.List;
@SmallTest
-@RunWith(AndroidTestingRunner.class)
+@RunWith(AndroidJUnit4.class)
public class HighPriorityProviderTest extends SysuiTestCase {
@Mock private PeopleNotificationIdentifier mPeopleNotificationIdentifier;
@Mock private GroupMembershipManager mGroupMembershipManager;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/NotifLiveDataImplTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/NotifLiveDataImplTest.kt
index 892575ab6c71..2a587511eaec 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/NotifLiveDataImplTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/NotifLiveDataImplTest.kt
@@ -16,9 +16,9 @@
package com.android.systemui.statusbar.notification.collection
-import android.testing.AndroidTestingRunner
import android.testing.TestableLooper.RunWithLooper
import androidx.lifecycle.Observer
+import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.systemui.SysuiTestCase
import com.android.systemui.util.concurrency.FakeExecutor
@@ -34,7 +34,7 @@ import org.mockito.Mockito.verify
import org.mockito.Mockito.verifyNoMoreInteractions
@SmallTest
-@RunWith(AndroidTestingRunner::class)
+@RunWith(AndroidJUnit4::class)
@RunWithLooper
class NotifLiveDataImplTest : SysuiTestCase() {
@@ -164,4 +164,4 @@ class NotifLiveDataImplTest : SysuiTestCase() {
assertThat(executor.runAllReady()).isEqualTo(2)
verifyNoMoreInteractions(syncObserver, asyncObserver)
}
-} \ No newline at end of file
+}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/NotifLiveDataStoreImplTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/NotifLiveDataStoreImplTest.kt
index 9c8ac5cded9e..d87f827de776 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/NotifLiveDataStoreImplTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/NotifLiveDataStoreImplTest.kt
@@ -16,8 +16,8 @@
package com.android.systemui.statusbar.notification.collection
-import android.testing.AndroidTestingRunner
import android.testing.TestableLooper.RunWithLooper
+import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.systemui.SysuiTestCase
import com.android.systemui.util.concurrency.FakeExecutor
@@ -30,7 +30,7 @@ import org.junit.runner.RunWith
import java.lang.UnsupportedOperationException
@SmallTest
-@RunWith(AndroidTestingRunner::class)
+@RunWith(AndroidJUnit4::class)
@RunWithLooper
class NotifLiveDataStoreImplTest : SysuiTestCase() {
@@ -102,4 +102,4 @@ class NotifLiveDataStoreImplTest : SysuiTestCase() {
liveDataStoreImpl.setActiveNotifList(mutableListOf(entry1, entry2))
executor.runAllReady()
}
-} \ No newline at end of file
+}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/NotifPipelineChoreographerTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/NotifPipelineChoreographerTest.kt
index 3b908b4175f9..f1da22f08e75 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/NotifPipelineChoreographerTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/NotifPipelineChoreographerTest.kt
@@ -16,8 +16,8 @@
package com.android.systemui.statusbar.notification.collection
-import android.testing.AndroidTestingRunner
import android.view.Choreographer
+import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.systemui.SysuiTestCase
import com.android.systemui.dagger.SysUISingleton
@@ -36,7 +36,7 @@ import org.mockito.Mockito.verify
import org.mockito.Mockito.`when` as whenever
@SmallTest
-@RunWith(AndroidTestingRunner::class)
+@RunWith(AndroidJUnit4::class)
class NotifPipelineChoreographerTest : SysuiTestCase() {
val viewChoreographer: Choreographer = mock()
@@ -118,4 +118,4 @@ interface NotifPipelineChoreographerTestComponent {
@BindsInstance @Main executor: DelayableExecutor
): NotifPipelineChoreographerTestComponent
}
-} \ No newline at end of file
+}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/NotificationEntryTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/NotificationEntryTest.java
index 8a48fe10d7fc..72d1db3affe8 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/NotificationEntryTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/NotificationEntryTest.java
@@ -46,8 +46,8 @@ import android.os.UserHandle;
import android.service.notification.NotificationListenerService.Ranking;
import android.service.notification.SnoozeCriterion;
import android.service.notification.StatusBarNotification;
-import android.testing.AndroidTestingRunner;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.SmallTest;
import com.android.systemui.SysuiTestCase;
@@ -64,7 +64,7 @@ import org.mockito.Mockito;
import java.util.ArrayList;
@SmallTest
-@RunWith(AndroidTestingRunner.class)
+@RunWith(AndroidJUnit4.class)
public class NotificationEntryTest extends SysuiTestCase {
private static final String TEST_PACKAGE_NAME = "test";
private static final int TEST_UID = 0;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/SectionStyleProviderTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/SectionStyleProviderTest.kt
index ab55a7d650c6..1fd6b042ad67 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/SectionStyleProviderTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/SectionStyleProviderTest.kt
@@ -20,7 +20,7 @@ import android.os.UserHandle
import android.platform.test.annotations.EnableFlags
import android.platform.test.flag.junit.SetFlagsRule
import android.service.notification.StatusBarNotification
-import android.testing.AndroidTestingRunner
+import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.systemui.SysuiTestCase
import com.android.systemui.statusbar.notification.collection.listbuilder.NotifSection
@@ -47,7 +47,7 @@ import org.mockito.MockitoAnnotations
import org.mockito.Mockito.`when` as whenever
@SmallTest
-@RunWith(AndroidTestingRunner::class)
+@RunWith(AndroidJUnit4::class)
class SectionStyleProviderTest : SysuiTestCase() {
@Rule @JvmField public val setFlagsRule = SetFlagsRule()
@@ -118,4 +118,4 @@ class SectionStyleProviderTest : SysuiTestCase() {
override fun getSection(): NotifSection? = NotifSection(inputSectioner, 1)
}
}
-} \ No newline at end of file
+}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/TargetSdkResolverTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/TargetSdkResolverTest.kt
index 4708350c1c0a..2ad3c9e1c21a 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/TargetSdkResolverTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/TargetSdkResolverTest.kt
@@ -25,7 +25,7 @@ import android.os.Bundle
import android.os.UserHandle
import android.service.notification.NotificationListenerService.Ranking
import android.service.notification.StatusBarNotification
-import android.testing.AndroidTestingRunner
+import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.systemui.SysuiTestCase
import com.android.systemui.statusbar.notification.collection.notifcollection.CommonNotifCollection
@@ -48,7 +48,7 @@ private const val PACKAGE = "pkg"
private const val USER_ID = -1
@SmallTest
-@RunWith(AndroidTestingRunner::class)
+@RunWith(AndroidJUnit4::class)
class TargetSdkResolverTest : SysuiTestCase() {
private val packageManager: PackageManager = mock()
private val applicationInfo = ApplicationInfo().apply { targetSdkVersion = SDK_VERSION }
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coalescer/GroupCoalescerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coalescer/GroupCoalescerTest.java
index b1180aebe9bd..f029a2ca6099 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coalescer/GroupCoalescerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coalescer/GroupCoalescerTest.java
@@ -30,8 +30,8 @@ import static java.util.Objects.requireNonNull;
import android.service.notification.NotificationListenerService.Ranking;
import android.service.notification.NotificationListenerService.RankingMap;
import android.service.notification.StatusBarNotification;
-import android.testing.AndroidTestingRunner;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.SmallTest;
import com.android.systemui.SysuiTestCase;
@@ -57,7 +57,7 @@ import java.util.Arrays;
import java.util.Collections;
@SmallTest
-@RunWith(AndroidTestingRunner.class)
+@RunWith(AndroidJUnit4.class)
public class GroupCoalescerTest extends SysuiTestCase {
private GroupCoalescer mCoalescer;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/ColorizedFgsCoordinatorTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/ColorizedFgsCoordinatorTest.java
index f2207afeda10..1f2925528077 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/ColorizedFgsCoordinatorTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/ColorizedFgsCoordinatorTest.java
@@ -30,9 +30,9 @@ import android.app.Person;
import android.content.Intent;
import android.graphics.Color;
import android.os.UserHandle;
-import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.SmallTest;
import com.android.systemui.SysuiTestCase;
@@ -47,7 +47,7 @@ import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
@SmallTest
-@RunWith(AndroidTestingRunner.class)
+@RunWith(AndroidJUnit4.class)
@TestableLooper.RunWithLooper
public class ColorizedFgsCoordinatorTest extends SysuiTestCase {
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/DataStoreCoordinatorTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/DataStoreCoordinatorTest.kt
index 59fc591e4d06..e72109d4d8e3 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/DataStoreCoordinatorTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/DataStoreCoordinatorTest.kt
@@ -15,8 +15,8 @@
*/
package com.android.systemui.statusbar.notification.collection.coordinator
-import android.testing.AndroidTestingRunner
import android.testing.TestableLooper.RunWithLooper
+import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.systemui.SysuiTestCase
import com.android.systemui.statusbar.notification.collection.GroupEntryBuilder
@@ -39,7 +39,7 @@ import org.mockito.Mockito.verifyNoMoreInteractions
import org.mockito.MockitoAnnotations.initMocks
@SmallTest
-@RunWith(AndroidTestingRunner::class)
+@RunWith(AndroidJUnit4::class)
@RunWithLooper
class DataStoreCoordinatorTest : SysuiTestCase() {
private lateinit var coordinator: DataStoreCoordinator
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/DismissibilityCoordinatorTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/DismissibilityCoordinatorTest.kt
index f91e5a8cf626..543f0c72a8ec 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/DismissibilityCoordinatorTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/DismissibilityCoordinatorTest.kt
@@ -17,7 +17,7 @@
package com.android.systemui.statusbar.notification.collection.coordinator
import android.app.Notification
-import android.testing.AndroidTestingRunner
+import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.systemui.SysuiTestCase
import com.android.systemui.dump.DumpManager
@@ -38,7 +38,7 @@ import org.mockito.Mockito
import org.mockito.Mockito.`when` as whenever
@SmallTest
-@RunWith(AndroidTestingRunner::class)
+@RunWith(AndroidJUnit4::class)
class DismissibilityCoordinatorTest : SysuiTestCase() {
private lateinit var coordinator: DismissibilityCoordinator
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/DreamCoordinatorTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/DreamCoordinatorTest.kt
index a544cad03b77..4d5ea92aa0e6 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/DreamCoordinatorTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/DreamCoordinatorTest.kt
@@ -17,7 +17,7 @@
package com.android.systemui.statusbar.notification.collection.coordinator
-import android.testing.AndroidTestingRunner
+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
@@ -49,7 +49,7 @@ import org.mockito.Mockito.`when` as whenever
import org.mockito.MockitoAnnotations
@SmallTest
-@RunWith(AndroidTestingRunner::class)
+@RunWith(AndroidJUnit4::class)
class DreamCoordinatorTest : SysuiTestCase() {
@Mock private lateinit var statusBarStateController: SysuiStatusBarStateController
@Mock private lateinit var notifPipeline: NotifPipeline
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/GroupCountCoordinatorTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/GroupCountCoordinatorTest.kt
index 929c3d4288d4..7b688d4f91fd 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/GroupCountCoordinatorTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/GroupCountCoordinatorTest.kt
@@ -15,8 +15,8 @@
*/
package com.android.systemui.statusbar.notification.collection.coordinator
-import android.testing.AndroidTestingRunner
import android.testing.TestableLooper.RunWithLooper
+import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.systemui.SysuiTestCase
import com.android.systemui.statusbar.notification.collection.GroupEntryBuilder
@@ -36,7 +36,7 @@ import org.mockito.Mockito.verify
import org.mockito.MockitoAnnotations.initMocks
@SmallTest
-@RunWith(AndroidTestingRunner::class)
+@RunWith(AndroidJUnit4::class)
@RunWithLooper
class GroupCountCoordinatorTest : SysuiTestCase() {
private lateinit var coordinator: GroupCountCoordinator
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/GroupWhenCoordinatorTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/GroupWhenCoordinatorTest.kt
index eac0e296c51f..3f140265e5f1 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/GroupWhenCoordinatorTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/GroupWhenCoordinatorTest.kt
@@ -16,8 +16,8 @@
package com.android.systemui.statusbar.notification.collection.coordinator
import android.app.Notification
-import android.testing.AndroidTestingRunner
import android.testing.TestableLooper
+import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.systemui.SysuiTestCase
import com.android.systemui.statusbar.SbnBuilder
@@ -45,7 +45,7 @@ import org.mockito.Mockito.verify
import org.mockito.MockitoAnnotations.initMocks
@SmallTest
-@RunWith(AndroidTestingRunner::class)
+@RunWith(AndroidJUnit4::class)
@TestableLooper.RunWithLooper
class GroupWhenCoordinatorTest : SysuiTestCase() {
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/GutsCoordinatorTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/GutsCoordinatorTest.kt
index a652ad64ea8d..7fe97d27f273 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/GutsCoordinatorTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/GutsCoordinatorTest.kt
@@ -15,8 +15,8 @@
*/
package com.android.systemui.statusbar.notification.collection.coordinator
-import android.testing.AndroidTestingRunner
import android.testing.TestableLooper.RunWithLooper
+import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.systemui.SysuiTestCase
import com.android.systemui.dump.DumpManager
@@ -42,7 +42,7 @@ import org.mockito.Mockito.`when` as whenever
import org.mockito.MockitoAnnotations.initMocks
@SmallTest
-@RunWith(AndroidTestingRunner::class)
+@RunWith(AndroidJUnit4::class)
@RunWithLooper
class GutsCoordinatorTest : SysuiTestCase() {
private lateinit var coordinator: GutsCoordinator
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/HeadsUpCoordinatorTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/HeadsUpCoordinatorTest.kt
index cd75e0811fff..8e9323fead92 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/HeadsUpCoordinatorTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/HeadsUpCoordinatorTest.kt
@@ -17,8 +17,8 @@ package com.android.systemui.statusbar.notification.collection.coordinator
import android.app.Notification.GROUP_ALERT_ALL
import android.app.Notification.GROUP_ALERT_SUMMARY
-import android.testing.AndroidTestingRunner
import android.testing.TestableLooper.RunWithLooper
+import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.systemui.SysuiTestCase
import com.android.systemui.log.logcatLogBuffer
@@ -70,7 +70,7 @@ import org.mockito.Mockito.`when` as whenever
import org.mockito.MockitoAnnotations
@SmallTest
-@RunWith(AndroidTestingRunner::class)
+@RunWith(AndroidJUnit4::class)
@RunWithLooper
class HeadsUpCoordinatorTest : SysuiTestCase() {
private lateinit var coordinator: HeadsUpCoordinator
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/HideNotifsForOtherUsersCoordinatorTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/HideNotifsForOtherUsersCoordinatorTest.java
index 27542a462d36..5dcad4bb9e62 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/HideNotifsForOtherUsersCoordinatorTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/HideNotifsForOtherUsersCoordinatorTest.java
@@ -24,9 +24,9 @@ import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
-import android.testing.AndroidTestingRunner;
import android.util.SparseArray;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.SmallTest;
import com.android.systemui.SysuiTestCase;
@@ -47,7 +47,7 @@ import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
@SmallTest
-@RunWith(AndroidTestingRunner.class)
+@RunWith(AndroidJUnit4.class)
public class HideNotifsForOtherUsersCoordinatorTest extends SysuiTestCase {
@Mock private NotificationLockscreenUserManager mLockscreenUserManager;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/KeyguardCoordinatorTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/KeyguardCoordinatorTest.kt
index 5ff73538b359..25533d82608b 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/KeyguardCoordinatorTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/KeyguardCoordinatorTest.kt
@@ -20,7 +20,7 @@ package com.android.systemui.statusbar.notification.collection.coordinator
import android.app.Notification
import android.os.UserHandle
import android.provider.Settings
-import android.testing.AndroidTestingRunner
+import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.systemui.SysuiTestCase
import com.android.systemui.dump.DumpManager
@@ -67,7 +67,7 @@ import kotlin.time.Duration.Companion.seconds
import org.mockito.Mockito.`when` as whenever
@SmallTest
-@RunWith(AndroidTestingRunner::class)
+@RunWith(AndroidJUnit4::class)
class KeyguardCoordinatorTest : SysuiTestCase() {
private val headsUpManager: HeadsUpManager = mock()
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/MediaCoordinatorTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/MediaCoordinatorTest.java
index e90a3ac8bfdc..07c29a024a6c 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/MediaCoordinatorTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/MediaCoordinatorTest.java
@@ -33,8 +33,8 @@ import android.media.session.MediaSession;
import android.platform.test.annotations.DisableFlags;
import android.platform.test.annotations.EnableFlags;
import android.service.notification.NotificationListenerService;
-import android.testing.AndroidTestingRunner;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.SmallTest;
import com.android.internal.statusbar.IStatusBarService;
@@ -58,7 +58,7 @@ import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
@SmallTest
-@RunWith(AndroidTestingRunner.class)
+@RunWith(AndroidJUnit4.class)
public final class MediaCoordinatorTest extends SysuiTestCase {
private MediaSession mMediaSession;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/NotificationStatsLoggerCoordinatorTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/NotificationStatsLoggerCoordinatorTest.kt
index c29ff416feb9..501bca248c76 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/NotificationStatsLoggerCoordinatorTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/NotificationStatsLoggerCoordinatorTest.kt
@@ -18,7 +18,7 @@ package com.android.systemui.statusbar.notification.collection.coordinator
import android.platform.test.annotations.EnableFlags
import android.service.notification.NotificationListenerService.REASON_CANCEL
-import android.testing.AndroidTestingRunner
+import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.systemui.SysuiTestCase
import com.android.systemui.statusbar.notification.collection.NotifPipeline
@@ -36,7 +36,7 @@ import org.junit.runner.RunWith
import org.mockito.Mockito.verify
@SmallTest
-@RunWith(AndroidTestingRunner::class)
+@RunWith(AndroidJUnit4::class)
@EnableFlags(NotificationsLiveDataStoreRefactor.FLAG_NAME)
class NotificationStatsLoggerCoordinatorTest : SysuiTestCase() {
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/PreparationCoordinatorTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/PreparationCoordinatorTest.java
index cceaaea672c4..80127682be02 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/PreparationCoordinatorTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/PreparationCoordinatorTest.java
@@ -39,10 +39,10 @@ import static java.util.Objects.requireNonNull;
import android.database.ContentObserver;
import android.os.Handler;
import android.os.RemoteException;
-import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper;
import androidx.annotation.NonNull;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.SmallTest;
import com.android.internal.statusbar.IStatusBarService;
@@ -88,7 +88,7 @@ import java.util.List;
import java.util.Map;
@SmallTest
-@RunWith(AndroidTestingRunner.class)
+@RunWith(AndroidJUnit4.class)
@TestableLooper.RunWithLooper
public class PreparationCoordinatorTest extends SysuiTestCase {
private NotifCollectionListener mCollectionListener;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/RankingCoordinatorTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/RankingCoordinatorTest.java
index 3d1253e2b05d..c05b13163d32 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/RankingCoordinatorTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/RankingCoordinatorTest.java
@@ -35,9 +35,9 @@ import static org.mockito.Mockito.when;
import android.app.Notification;
import android.app.NotificationChannel;
import android.app.NotificationManager;
-import android.testing.AndroidTestingRunner;
import androidx.annotation.Nullable;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.SmallTest;
import com.android.systemui.SysuiTestCase;
@@ -67,7 +67,7 @@ import java.util.ArrayList;
import java.util.Arrays;
@SmallTest
-@RunWith(AndroidTestingRunner.class)
+@RunWith(AndroidJUnit4.class)
public class RankingCoordinatorTest extends SysuiTestCase {
@Mock private StatusBarStateController mStatusBarStateController;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/RemoteInputCoordinatorTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/RemoteInputCoordinatorTest.kt
index d3df48e9ef02..deb3fc1224ce 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/RemoteInputCoordinatorTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/RemoteInputCoordinatorTest.kt
@@ -23,8 +23,8 @@ import android.os.Handler
import android.platform.test.annotations.DisableFlags
import android.platform.test.annotations.EnableFlags
import android.service.notification.StatusBarNotification
-import android.testing.AndroidTestingRunner
import android.testing.TestableLooper.RunWithLooper
+import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.systemui.SysuiTestCase
import com.android.systemui.dump.DumpManager
@@ -54,7 +54,7 @@ import org.mockito.Mockito.verify
import org.mockito.MockitoAnnotations.initMocks
@SmallTest
-@RunWith(AndroidTestingRunner::class)
+@RunWith(AndroidJUnit4::class)
@RunWithLooper
class RemoteInputCoordinatorTest : SysuiTestCase() {
private lateinit var coordinator: RemoteInputCoordinator
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/RowAlertTimeCoordinatorTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/RowAlertTimeCoordinatorTest.kt
index 7daadb07f89a..1b7ec5381713 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/RowAlertTimeCoordinatorTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/RowAlertTimeCoordinatorTest.kt
@@ -15,8 +15,8 @@
*/
package com.android.systemui.statusbar.notification.collection.coordinator
-import android.testing.AndroidTestingRunner
import android.testing.TestableLooper.RunWithLooper
+import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.systemui.SysuiTestCase
import com.android.systemui.statusbar.notification.collection.GroupEntryBuilder
@@ -37,7 +37,7 @@ import org.mockito.Mockito.verifyNoMoreInteractions
import org.mockito.MockitoAnnotations.initMocks
@SmallTest
-@RunWith(AndroidTestingRunner::class)
+@RunWith(AndroidJUnit4::class)
@RunWithLooper
class RowAlertTimeCoordinatorTest : SysuiTestCase() {
private lateinit var coordinator: RowAlertTimeCoordinator
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/RowAppearanceCoordinatorTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/RowAppearanceCoordinatorTest.kt
index a66f8ce1a92c..5b231e21e700 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/RowAppearanceCoordinatorTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/RowAppearanceCoordinatorTest.kt
@@ -15,8 +15,8 @@
*/
package com.android.systemui.statusbar.notification.collection.coordinator
-import android.testing.AndroidTestingRunner
import android.testing.TestableLooper.RunWithLooper
+import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.systemui.SysuiTestCase
import com.android.systemui.statusbar.notification.AssistantFeedbackController
@@ -41,7 +41,7 @@ import org.mockito.Mockito.`when` as whenever
import org.mockito.MockitoAnnotations.initMocks
@SmallTest
-@RunWith(AndroidTestingRunner::class)
+@RunWith(AndroidJUnit4::class)
@RunWithLooper
class RowAppearanceCoordinatorTest : SysuiTestCase() {
private lateinit var coordinator: RowAppearanceCoordinator
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/ShadeEventCoordinatorTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/ShadeEventCoordinatorTest.kt
index 56f16f32ec15..ccf7cdd70675 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/ShadeEventCoordinatorTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/ShadeEventCoordinatorTest.kt
@@ -17,8 +17,8 @@ package com.android.systemui.statusbar.notification.collection.coordinator
import android.service.notification.NotificationListenerService.REASON_APP_CANCEL
import android.service.notification.NotificationListenerService.REASON_CANCEL
-import android.testing.AndroidTestingRunner
import android.testing.TestableLooper.RunWithLooper
+import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.systemui.SysuiTestCase
import com.android.systemui.log.logcatLogBuffer
@@ -40,7 +40,7 @@ import java.util.concurrent.Executor
import org.mockito.Mockito.`when` as whenever
@SmallTest
-@RunWith(AndroidTestingRunner::class)
+@RunWith(AndroidJUnit4::class)
@RunWithLooper
class ShadeEventCoordinatorTest : SysuiTestCase() {
private lateinit var coordinator: ShadeEventCoordinator
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/StackCoordinatorTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/StackCoordinatorTest.kt
index ea4f692ef4f1..c7513de7a41a 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/StackCoordinatorTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/StackCoordinatorTest.kt
@@ -17,8 +17,8 @@ package com.android.systemui.statusbar.notification.collection.coordinator
import android.platform.test.annotations.DisableFlags
import android.platform.test.annotations.EnableFlags
-import android.testing.AndroidTestingRunner
import android.testing.TestableLooper.RunWithLooper
+import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.server.notification.Flags.FLAG_SCREENSHARE_NOTIFICATION_HIDING
import com.android.systemui.Flags.FLAG_SCREENSHARE_NOTIFICATION_HIDING_BUG_FIX
@@ -51,7 +51,7 @@ import org.mockito.MockitoAnnotations.initMocks
import org.mockito.Mockito.`when` as whenever
@SmallTest
-@RunWith(AndroidTestingRunner::class)
+@RunWith(AndroidJUnit4::class)
@RunWithLooper
class StackCoordinatorTest : SysuiTestCase() {
private lateinit var coordinator: StackCoordinator
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/ViewConfigCoordinatorTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/ViewConfigCoordinatorTest.kt
index b1d2ea21f7fc..c8fbe61fa799 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/ViewConfigCoordinatorTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/ViewConfigCoordinatorTest.kt
@@ -15,8 +15,8 @@
*/
package com.android.systemui.statusbar.notification.collection.coordinator
-import android.testing.AndroidTestingRunner
import android.testing.TestableLooper.RunWithLooper
+import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.keyguard.KeyguardUpdateMonitor
import com.android.keyguard.KeyguardUpdateMonitorCallback
@@ -40,7 +40,7 @@ import org.mockito.Mockito.verifyNoMoreInteractions
import org.mockito.Mockito.`when` as whenever
@SmallTest
-@RunWith(AndroidTestingRunner::class)
+@RunWith(AndroidJUnit4::class)
@RunWithLooper
class ViewConfigCoordinatorTest : SysuiTestCase() {
private lateinit var coordinator: ViewConfigCoordinator
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/inflation/NotifUiAdjustmentProviderTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/inflation/NotifUiAdjustmentProviderTest.kt
index 8e6ceccbc14e..7943872558c3 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/inflation/NotifUiAdjustmentProviderTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/inflation/NotifUiAdjustmentProviderTest.kt
@@ -20,8 +20,8 @@ import android.os.Handler
import android.platform.test.annotations.DisableFlags
import android.platform.test.annotations.EnableFlags
import android.provider.Settings.Secure.SHOW_NOTIFICATION_SNOOZE
-import android.testing.AndroidTestingRunner
import android.testing.TestableLooper.RunWithLooper
+import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.server.notification.Flags.FLAG_SCREENSHARE_NOTIFICATION_HIDING
import com.android.systemui.SysuiTestCase
@@ -54,7 +54,7 @@ import org.mockito.Mockito.verifyNoMoreInteractions
import org.mockito.Mockito.`when` as whenever
@SmallTest
-@RunWith(AndroidTestingRunner::class)
+@RunWith(AndroidJUnit4::class)
@RunWithLooper
class NotifUiAdjustmentProviderTest : SysuiTestCase() {
private val lockscreenUserManager: NotificationLockscreenUserManager = mock()
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/listbuilder/SemiStableSortTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/listbuilder/SemiStableSortTest.kt
index 1cdd023dd01c..d2057703d560 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/listbuilder/SemiStableSortTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/listbuilder/SemiStableSortTest.kt
@@ -15,9 +15,9 @@
*/
package com.android.systemui.statusbar.notification.collection.listbuilder
-import android.testing.AndroidTestingRunner
import android.testing.TestableLooper.RunWithLooper
import android.util.Log
+import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.systemui.SysuiTestCase
import org.junit.Assert.assertFalse
@@ -27,7 +27,7 @@ import org.junit.Test
import org.junit.runner.RunWith
@SmallTest
-@RunWith(AndroidTestingRunner::class)
+@RunWith(AndroidJUnit4::class)
@RunWithLooper
class SemiStableSortTest : SysuiTestCase() {
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/listbuilder/ShadeListBuilderHelperTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/listbuilder/ShadeListBuilderHelperTest.kt
index 20369546d68a..49f836fe9f81 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/listbuilder/ShadeListBuilderHelperTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/listbuilder/ShadeListBuilderHelperTest.kt
@@ -15,8 +15,8 @@
*/
package com.android.systemui.statusbar.notification.collection.listbuilder
-import android.testing.AndroidTestingRunner
import android.testing.TestableLooper.RunWithLooper
+import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.systemui.SysuiTestCase
import com.android.systemui.statusbar.notification.collection.listbuilder.ShadeListBuilderHelper.getContiguousSubLists
@@ -25,7 +25,7 @@ import org.junit.Test
import org.junit.runner.RunWith
@SmallTest
-@RunWith(AndroidTestingRunner::class)
+@RunWith(AndroidJUnit4::class)
@RunWithLooper
class ShadeListBuilderHelperTest : SysuiTestCase() {
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/notifcollection/NotifCollectionInconsistencyTrackerTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/notifcollection/NotifCollectionInconsistencyTrackerTest.kt
index 22f6bdc54b85..341a51e32a46 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/notifcollection/NotifCollectionInconsistencyTrackerTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/notifcollection/NotifCollectionInconsistencyTrackerTest.kt
@@ -17,8 +17,8 @@
package com.android.systemui.statusbar.notification.collection.notifcollection
import android.service.notification.NotificationListenerService.RankingMap
-import android.testing.AndroidTestingRunner
import android.testing.TestableLooper.RunWithLooper
+import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.systemui.SysuiTestCase
import com.android.systemui.log.logcatLogBuffer
@@ -34,7 +34,7 @@ import org.mockito.Mockito.verify
import org.mockito.Mockito.verifyNoMoreInteractions
@SmallTest
-@RunWith(AndroidTestingRunner::class)
+@RunWith(AndroidJUnit4::class)
@RunWithLooper
class NotifCollectionInconsistencyTrackerTest : SysuiTestCase() {
private val logger = spy(NotifCollectionLogger(logcatLogBuffer()))
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/notifcollection/SelfTrackingLifetimeExtenderTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/notifcollection/SelfTrackingLifetimeExtenderTest.kt
index a09f3a35c308..99e55a85344a 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/notifcollection/SelfTrackingLifetimeExtenderTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/notifcollection/SelfTrackingLifetimeExtenderTest.kt
@@ -16,8 +16,8 @@
package com.android.systemui.statusbar.notification.collection.notifcollection
import android.os.Handler
-import android.testing.AndroidTestingRunner
import android.testing.TestableLooper.RunWithLooper
+import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.systemui.SysuiTestCase
import com.android.systemui.statusbar.notification.collection.NotificationEntry
@@ -41,7 +41,7 @@ import java.util.function.Consumer
import java.util.function.Predicate
@SmallTest
-@RunWith(AndroidTestingRunner::class)
+@RunWith(AndroidJUnit4::class)
@RunWithLooper
class SelfTrackingLifetimeExtenderTest : SysuiTestCase() {
private lateinit var extender: TestableSelfTrackingLifetimeExtender
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/provider/VisualStabilityProviderTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/provider/VisualStabilityProviderTest.kt
index b56f8e9364c4..586b947d5299 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/provider/VisualStabilityProviderTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/provider/VisualStabilityProviderTest.kt
@@ -15,7 +15,7 @@
*/
package com.android.systemui.statusbar.notification.collection.provider
-import android.testing.AndroidTestingRunner
+import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.systemui.SysuiTestCase
import com.android.systemui.util.mockito.mock
@@ -29,7 +29,7 @@ import org.mockito.Mockito.verify
import org.mockito.Mockito.verifyNoMoreInteractions
@SmallTest
-@RunWith(AndroidTestingRunner::class)
+@RunWith(AndroidJUnit4::class)
class VisualStabilityProviderTest : SysuiTestCase() {
private val visualStabilityProvider = VisualStabilityProvider()
private val listener: OnReorderingAllowedListener = mock()
@@ -148,4 +148,4 @@ class VisualStabilityProviderTest : SysuiTestCase() {
visualStabilityProvider.isReorderingAllowed = true
verify(selfAddingListener, times(2)).onReorderingAllowed()
}
-} \ No newline at end of file
+}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/render/ShadeViewDifferTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/render/ShadeViewDifferTest.kt
index eeabc744987b..9d3e2e8dfcb4 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/render/ShadeViewDifferTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/render/ShadeViewDifferTest.kt
@@ -16,10 +16,10 @@
package com.android.systemui.statusbar.notification.collection.render
import android.content.Context
-import android.testing.AndroidTestingRunner
import android.view.View
import android.view.ViewGroup
import android.widget.FrameLayout
+import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.systemui.SysuiTestCase
import com.android.systemui.log.logcatLogBuffer
@@ -34,7 +34,7 @@ import org.mockito.Mockito.spy
import org.mockito.Mockito.verify
@SmallTest
-@RunWith(AndroidTestingRunner::class)
+@RunWith(AndroidJUnit4::class)
class ShadeViewDifferTest : SysuiTestCase() {
private lateinit var differ: ShadeViewDiffer
private val rootController = FakeController(mContext, "RootController")
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/domain/interactor/SeenNotificationsInteractorTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/domain/interactor/SeenNotificationsInteractorTest.kt
index 2a3c1a53559e..39085295fbac 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/domain/interactor/SeenNotificationsInteractorTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/domain/interactor/SeenNotificationsInteractorTest.kt
@@ -15,7 +15,7 @@
package com.android.systemui.statusbar.notification.domain.interactor
-import android.testing.AndroidTestingRunner
+import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.systemui.SysuiTestCase
import com.android.systemui.coroutines.collectLastValue
@@ -25,7 +25,7 @@ import kotlinx.coroutines.test.runTest
import org.junit.Test
import org.junit.runner.RunWith
-@RunWith(AndroidTestingRunner::class)
+@RunWith(AndroidJUnit4::class)
@SmallTest
class SeenNotificationsInteractorTest : SysuiTestCase() {
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/icon/IconManagerTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/icon/IconManagerTest.kt
index 4ac9dc2be161..bfa816e65eb2 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/icon/IconManagerTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/icon/IconManagerTest.kt
@@ -30,8 +30,8 @@ import android.graphics.drawable.Icon
import android.os.Bundle
import android.os.SystemClock
import android.os.UserHandle
-import android.testing.AndroidTestingRunner
import androidx.test.InstrumentationRegistry
+import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.systemui.SysuiTestCase
import com.android.systemui.controls.controller.AuxiliaryPersistenceWrapperTest.Companion.any
@@ -53,7 +53,7 @@ import org.mockito.Mockito.`when`
import org.mockito.MockitoAnnotations
@SmallTest
-@RunWith(AndroidTestingRunner::class)
+@RunWith(AndroidJUnit4::class)
class IconManagerTest : SysuiTestCase() {
companion object {
private const val TEST_PACKAGE_NAME = "test"
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/icon/domain/interactor/NotificationIconsInteractorTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/icon/domain/interactor/NotificationIconsInteractorTest.kt
index b410b33b97d9..c9f2addfd39b 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/icon/domain/interactor/NotificationIconsInteractorTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/icon/domain/interactor/NotificationIconsInteractorTest.kt
@@ -15,7 +15,7 @@
package com.android.systemui.statusbar.notification.icon.domain.interactor
-import android.testing.AndroidTestingRunner
+import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.systemui.SysUITestComponent
import com.android.systemui.SysUITestModule
@@ -52,7 +52,7 @@ import org.junit.Test
import org.junit.runner.RunWith
@SmallTest
-@RunWith(AndroidTestingRunner::class)
+@RunWith(AndroidJUnit4::class)
class NotificationIconsInteractorTest : SysuiTestCase() {
private val bubbles: Bubbles = mock()
@@ -151,7 +151,7 @@ class NotificationIconsInteractorTest : SysuiTestCase() {
}
@SmallTest
-@RunWith(AndroidTestingRunner::class)
+@RunWith(AndroidJUnit4::class)
class AlwaysOnDisplayNotificationIconsInteractorTest : SysuiTestCase() {
private val bubbles: Bubbles = mock()
@@ -256,7 +256,7 @@ class AlwaysOnDisplayNotificationIconsInteractorTest : SysuiTestCase() {
}
@SmallTest
-@RunWith(AndroidTestingRunner::class)
+@RunWith(AndroidJUnit4::class)
class StatusBarNotificationIconsInteractorTest : SysuiTestCase() {
private val bubbles: Bubbles = mock()
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/interruption/HeadsUpViewBinderTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/interruption/HeadsUpViewBinderTest.java
index 60eea9beb2e0..af2789b8401a 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/interruption/HeadsUpViewBinderTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/interruption/HeadsUpViewBinderTest.java
@@ -26,9 +26,9 @@ import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyNoMoreInteractions;
import static org.mockito.Mockito.when;
-import android.testing.AndroidTestingRunner;
import androidx.core.os.CancellationSignal;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.SmallTest;
import com.android.internal.util.NotificationMessagingUtil;
@@ -47,7 +47,7 @@ import org.mockito.MockitoAnnotations;
import java.util.concurrent.atomic.AtomicReference;
-@RunWith(AndroidTestingRunner.class)
+@RunWith(AndroidJUnit4.class)
@SmallTest
public class HeadsUpViewBinderTest extends SysuiTestCase {
private HeadsUpViewBinder mViewBinder;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/interruption/KeyguardNotificationVisibilityProviderTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/interruption/KeyguardNotificationVisibilityProviderTest.java
index 86620480fa7b..19214fb831eb 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/interruption/KeyguardNotificationVisibilityProviderTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/interruption/KeyguardNotificationVisibilityProviderTest.java
@@ -42,9 +42,9 @@ import android.content.Context;
import android.os.Handler;
import android.os.UserHandle;
import android.provider.Settings;
-import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.SmallTest;
import com.android.keyguard.KeyguardUpdateMonitor;
@@ -86,7 +86,7 @@ import java.util.Map;
import java.util.function.Consumer;
@SmallTest
-@RunWith(AndroidTestingRunner.class)
+@RunWith(AndroidJUnit4.class)
@TestableLooper.RunWithLooper
public class KeyguardNotificationVisibilityProviderTest extends SysuiTestCase {
private static final int NOTIF_USER_ID = 0;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/interruption/NotificationInterruptStateProviderImplTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/interruption/NotificationInterruptStateProviderImplTest.java
index 7ade053720e9..3e8461a225b2 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/interruption/NotificationInterruptStateProviderImplTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/interruption/NotificationInterruptStateProviderImplTest.java
@@ -60,8 +60,8 @@ import android.os.Handler;
import android.os.PowerManager;
import android.os.RemoteException;
import android.platform.test.annotations.DisableFlags;
-import android.testing.AndroidTestingRunner;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.SmallTest;
import com.android.internal.logging.testing.UiEventLoggerFake;
@@ -96,7 +96,7 @@ import java.util.Set;
* Tests for the interruption state provider which understands whether the system & notification
* is in a state allowing a particular notification to hun, pulse, or bubble.
*/
-@RunWith(AndroidTestingRunner.class)
+@RunWith(AndroidJUnit4.class)
@SmallTest
public class NotificationInterruptStateProviderImplTest extends SysuiTestCase {
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/interruption/NotificationInterruptStateProviderWrapperTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/interruption/NotificationInterruptStateProviderWrapperTest.kt
index 7ed33126a54f..a6177e8feb1b 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/interruption/NotificationInterruptStateProviderWrapperTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/interruption/NotificationInterruptStateProviderWrapperTest.kt
@@ -17,7 +17,7 @@
package com.android.systemui.statusbar.notification.interruption
import android.platform.test.annotations.DisableFlags
-import android.testing.AndroidTestingRunner
+import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.systemui.statusbar.notification.collection.NotificationEntryBuilder
import com.android.systemui.statusbar.notification.interruption.NotificationInterruptStateProvider.FullScreenIntentDecision
@@ -34,7 +34,7 @@ import org.junit.Test
import org.junit.runner.RunWith
@SmallTest
-@RunWith(AndroidTestingRunner::class)
+@RunWith(AndroidJUnit4::class)
@DisableFlags(VisualInterruptionRefactor.FLAG_NAME)
class NotificationInterruptStateProviderWrapperTest : VisualInterruptionDecisionProviderTestBase() {
override val provider by lazy {
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/interruption/VisualInterruptionDecisionProviderImplTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/interruption/VisualInterruptionDecisionProviderImplTest.kt
index edab9d9f7fdf..eeb51a684d42 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/interruption/VisualInterruptionDecisionProviderImplTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/interruption/VisualInterruptionDecisionProviderImplTest.kt
@@ -16,11 +16,13 @@
package com.android.systemui.statusbar.notification.interruption
+import android.Manifest.permission
import android.app.Notification.CATEGORY_EVENT
import android.app.Notification.CATEGORY_REMINDER
import android.app.NotificationManager
+import android.content.pm.PackageManager.PERMISSION_GRANTED
import android.platform.test.annotations.EnableFlags
-import android.testing.AndroidTestingRunner
+import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.systemui.statusbar.notification.collection.NotificationEntry
import com.android.systemui.statusbar.notification.interruption.VisualInterruptionType.BUBBLE
@@ -28,9 +30,11 @@ import com.android.systemui.statusbar.notification.interruption.VisualInterrupti
import com.android.systemui.statusbar.notification.interruption.VisualInterruptionType.PULSE
import org.junit.Test
import org.junit.runner.RunWith
+import org.mockito.Mockito.anyString
+import org.mockito.Mockito.`when`
@SmallTest
-@RunWith(AndroidTestingRunner::class)
+@RunWith(AndroidJUnit4::class)
@EnableFlags(VisualInterruptionRefactor.FLAG_NAME)
class VisualInterruptionDecisionProviderImplTest : VisualInterruptionDecisionProviderTestBase() {
override val provider by lazy {
@@ -51,7 +55,8 @@ class VisualInterruptionDecisionProviderImplTest : VisualInterruptionDecisionPro
uiEventLogger,
userTracker,
avalancheProvider,
- systemSettings
+ systemSettings,
+ packageManager
)
}
@@ -83,14 +88,18 @@ class VisualInterruptionDecisionProviderImplTest : VisualInterruptionDecisionPro
fun testAvalancheFilter_duringAvalanche_allowConversationFromAfterEvent() {
avalancheProvider.startTime = whenAgo(10)
- withFilter(AvalancheSuppressor(avalancheProvider, systemClock, systemSettings)) {
+ withFilter(
+ AvalancheSuppressor(avalancheProvider, systemClock, systemSettings, packageManager)
+ ) {
ensurePeekState()
- assertShouldHeadsUp(buildEntry {
- importance = NotificationManager.IMPORTANCE_HIGH
- isConversation = true
- isImportantConversation = false
- whenMs = whenAgo(5)
- })
+ assertShouldHeadsUp(
+ buildEntry {
+ importance = NotificationManager.IMPORTANCE_HIGH
+ isConversation = true
+ isImportantConversation = false
+ whenMs = whenAgo(5)
+ }
+ )
}
}
@@ -98,14 +107,18 @@ class VisualInterruptionDecisionProviderImplTest : VisualInterruptionDecisionPro
fun testAvalancheFilter_duringAvalanche_suppressConversationFromBeforeEvent() {
avalancheProvider.startTime = whenAgo(10)
- withFilter(AvalancheSuppressor(avalancheProvider, systemClock, systemSettings)) {
+ withFilter(
+ AvalancheSuppressor(avalancheProvider, systemClock, systemSettings, packageManager)
+ ) {
ensurePeekState()
- assertShouldNotHeadsUp(buildEntry {
- importance = NotificationManager.IMPORTANCE_DEFAULT
- isConversation = true
- isImportantConversation = false
- whenMs = whenAgo(15)
- })
+ assertShouldNotHeadsUp(
+ buildEntry {
+ importance = NotificationManager.IMPORTANCE_DEFAULT
+ isConversation = true
+ isImportantConversation = false
+ whenMs = whenAgo(15)
+ }
+ )
}
}
@@ -113,12 +126,16 @@ class VisualInterruptionDecisionProviderImplTest : VisualInterruptionDecisionPro
fun testAvalancheFilter_duringAvalanche_allowHighPriorityConversation() {
avalancheProvider.startTime = whenAgo(10)
- withFilter(AvalancheSuppressor(avalancheProvider, systemClock, systemSettings)) {
+ withFilter(
+ AvalancheSuppressor(avalancheProvider, systemClock, systemSettings, packageManager)
+ ) {
ensurePeekState()
- assertShouldHeadsUp(buildEntry {
- importance = NotificationManager.IMPORTANCE_HIGH
- isImportantConversation = true
- })
+ assertShouldHeadsUp(
+ buildEntry {
+ importance = NotificationManager.IMPORTANCE_HIGH
+ isImportantConversation = true
+ }
+ )
}
}
@@ -126,12 +143,16 @@ class VisualInterruptionDecisionProviderImplTest : VisualInterruptionDecisionPro
fun testAvalancheFilter_duringAvalanche_allowCall() {
avalancheProvider.startTime = whenAgo(10)
- withFilter(AvalancheSuppressor(avalancheProvider, systemClock, systemSettings)) {
+ withFilter(
+ AvalancheSuppressor(avalancheProvider, systemClock, systemSettings, packageManager)
+ ) {
ensurePeekState()
- assertShouldHeadsUp(buildEntry {
- importance = NotificationManager.IMPORTANCE_HIGH
- isCall = true
- })
+ assertShouldHeadsUp(
+ buildEntry {
+ importance = NotificationManager.IMPORTANCE_HIGH
+ isCall = true
+ }
+ )
}
}
@@ -139,12 +160,16 @@ class VisualInterruptionDecisionProviderImplTest : VisualInterruptionDecisionPro
fun testAvalancheFilter_duringAvalanche_allowCategoryReminder() {
avalancheProvider.startTime = whenAgo(10)
- withFilter(AvalancheSuppressor(avalancheProvider, systemClock, systemSettings)) {
+ withFilter(
+ AvalancheSuppressor(avalancheProvider, systemClock, systemSettings, packageManager)
+ ) {
ensurePeekState()
- assertShouldHeadsUp(buildEntry {
- importance = NotificationManager.IMPORTANCE_HIGH
- category = CATEGORY_REMINDER
- })
+ assertShouldHeadsUp(
+ buildEntry {
+ importance = NotificationManager.IMPORTANCE_HIGH
+ category = CATEGORY_REMINDER
+ }
+ )
}
}
@@ -152,12 +177,16 @@ class VisualInterruptionDecisionProviderImplTest : VisualInterruptionDecisionPro
fun testAvalancheFilter_duringAvalanche_allowCategoryEvent() {
avalancheProvider.startTime = whenAgo(10)
- withFilter(AvalancheSuppressor(avalancheProvider, systemClock, systemSettings)) {
+ withFilter(
+ AvalancheSuppressor(avalancheProvider, systemClock, systemSettings, packageManager)
+ ) {
ensurePeekState()
- assertShouldHeadsUp(buildEntry {
- importance = NotificationManager.IMPORTANCE_HIGH
- category = CATEGORY_EVENT
- })
+ assertShouldHeadsUp(
+ buildEntry {
+ importance = NotificationManager.IMPORTANCE_HIGH
+ category = CATEGORY_EVENT
+ }
+ )
}
}
@@ -165,7 +194,9 @@ class VisualInterruptionDecisionProviderImplTest : VisualInterruptionDecisionPro
fun testAvalancheFilter_duringAvalanche_allowFsi() {
avalancheProvider.startTime = whenAgo(10)
- withFilter(AvalancheSuppressor(avalancheProvider, systemClock, systemSettings)) {
+ withFilter(
+ AvalancheSuppressor(avalancheProvider, systemClock, systemSettings, packageManager)
+ ) {
assertFsiNotSuppressed()
}
}
@@ -174,16 +205,44 @@ class VisualInterruptionDecisionProviderImplTest : VisualInterruptionDecisionPro
fun testAvalancheFilter_duringAvalanche_allowColorized() {
avalancheProvider.startTime = whenAgo(10)
- withFilter(AvalancheSuppressor(avalancheProvider, systemClock, systemSettings)) {
+ withFilter(
+ AvalancheSuppressor(avalancheProvider, systemClock, systemSettings, packageManager)
+ ) {
ensurePeekState()
- assertShouldHeadsUp(buildEntry {
- importance = NotificationManager.IMPORTANCE_HIGH
- isColorized = true
- })
+ assertShouldHeadsUp(
+ buildEntry {
+ importance = NotificationManager.IMPORTANCE_HIGH
+ isColorized = true
+ }
+ )
}
}
@Test
+ fun testAvalancheFilter_duringAvalanche_allowEmergency() {
+ avalancheProvider.startTime = whenAgo(10)
+
+ `when`(
+ packageManager.checkPermission(
+ org.mockito.Mockito.eq(permission.RECEIVE_EMERGENCY_BROADCAST),
+ anyString()
+ )
+ ).thenReturn(PERMISSION_GRANTED)
+
+ withFilter(
+ AvalancheSuppressor(avalancheProvider, systemClock, systemSettings, packageManager)
+ ) {
+ ensurePeekState()
+ assertShouldHeadsUp(
+ buildEntry {
+ importance = NotificationManager.IMPORTANCE_HIGH
+ }
+ )
+ }
+ }
+
+
+ @Test
fun testPeekCondition_suppressesOnlyPeek() {
withCondition(TestCondition(types = setOf(PEEK)) { true }) {
assertPeekSuppressed()
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/interruption/VisualInterruptionDecisionProviderTestBase.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/interruption/VisualInterruptionDecisionProviderTestBase.kt
index 3b979a7c1386..71e7dc522e20 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/interruption/VisualInterruptionDecisionProviderTestBase.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/interruption/VisualInterruptionDecisionProviderTestBase.kt
@@ -42,6 +42,7 @@ import android.app.PendingIntent
import android.app.PendingIntent.FLAG_MUTABLE
import android.content.Context
import android.content.Intent
+import android.content.pm.PackageManager
import android.content.pm.UserInfo
import android.graphics.drawable.Icon
import android.hardware.display.FakeAmbientDisplayConfiguration
@@ -129,6 +130,7 @@ abstract class VisualInterruptionDecisionProviderTestBase : SysuiTestCase() {
protected val userTracker = FakeUserTracker()
protected val avalancheProvider: AvalancheProvider = mock()
lateinit var systemSettings: SystemSettings
+ protected val packageManager: PackageManager = mock()
protected abstract val provider: VisualInterruptionDecisionProvider
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/interruption/VisualInterruptionDecisionProviderTestUtil.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/interruption/VisualInterruptionDecisionProviderTestUtil.kt
index 60aaa646fced..61c008b55ad0 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/interruption/VisualInterruptionDecisionProviderTestUtil.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/interruption/VisualInterruptionDecisionProviderTestUtil.kt
@@ -15,11 +15,11 @@
*/
package com.android.systemui.statusbar.notification.interruption
+import android.content.pm.PackageManager
import android.hardware.display.AmbientDisplayConfiguration
import android.os.Handler
import android.os.PowerManager
import com.android.internal.logging.UiEventLogger
-import com.android.systemui.broadcast.BroadcastDispatcher
import com.android.systemui.dagger.qualifiers.Main
import com.android.systemui.plugins.statusbar.StatusBarStateController
import com.android.systemui.settings.UserTracker
@@ -53,7 +53,8 @@ object VisualInterruptionDecisionProviderTestUtil {
uiEventLogger: UiEventLogger,
userTracker: UserTracker,
avalancheProvider: AvalancheProvider,
- systemSettings: SystemSettings
+ systemSettings: SystemSettings,
+ packageManager: PackageManager,
): VisualInterruptionDecisionProvider {
return if (VisualInterruptionRefactor.isEnabled) {
VisualInterruptionDecisionProviderImpl(
@@ -73,7 +74,8 @@ object VisualInterruptionDecisionProviderTestUtil {
uiEventLogger,
userTracker,
avalancheProvider,
- systemSettings
+ systemSettings,
+ packageManager
)
} else {
NotificationInterruptStateProviderWrapper(
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/logging/ExpansionStateLoggerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/logging/ExpansionStateLoggerTest.java
index 2662c80dce1d..59741718476f 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/logging/ExpansionStateLoggerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/logging/ExpansionStateLoggerTest.java
@@ -22,9 +22,9 @@ import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import android.os.RemoteException;
-import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.SmallTest;
import com.android.internal.statusbar.IStatusBarService;
@@ -44,7 +44,7 @@ import org.mockito.MockitoAnnotations;
import java.util.Collections;
@SmallTest
-@RunWith(AndroidTestingRunner.class)
+@RunWith(AndroidJUnit4.class)
@TestableLooper.RunWithLooper
public class ExpansionStateLoggerTest extends SysuiTestCase {
private static final String NOTIFICATION_KEY = "notin_key";
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/logging/NotificationLoggerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/logging/NotificationLoggerTest.java
index 111309112f61..a8929a63a812 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/logging/NotificationLoggerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/logging/NotificationLoggerTest.java
@@ -35,9 +35,9 @@ import android.os.Handler;
import android.os.Looper;
import android.os.UserHandle;
import android.platform.test.annotations.DisableFlags;
-import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.SmallTest;
import com.android.internal.logging.InstanceId;
@@ -87,7 +87,7 @@ import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.concurrent.Executor;
@SmallTest
-@RunWith(AndroidTestingRunner.class)
+@RunWith(AndroidJUnit4.class)
@TestableLooper.RunWithLooper
@DisableFlags(NotificationsLiveDataStoreRefactor.FLAG_NAME)
public class NotificationLoggerTest extends SysuiTestCase {
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/logging/NotificationMemoryLoggerTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/logging/NotificationMemoryLoggerTest.kt
index 4b0b4b89fad4..3ea7732bdf15 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/logging/NotificationMemoryLoggerTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/logging/NotificationMemoryLoggerTest.kt
@@ -21,8 +21,8 @@ import android.app.StatsManager
import android.graphics.Bitmap
import android.graphics.drawable.Icon
import android.stats.sysui.NotificationEnums
-import android.testing.AndroidTestingRunner
import android.util.StatsEvent
+import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.systemui.SysuiTestCase
import com.android.systemui.log.assertLogsWtf
@@ -46,7 +46,7 @@ import org.mockito.Mockito.verify
import org.mockito.MockitoAnnotations
@SmallTest
-@RunWith(AndroidTestingRunner::class)
+@RunWith(AndroidJUnit4::class)
class NotificationMemoryLoggerTest : SysuiTestCase() {
@Rule @JvmField val expect = Expect.create()
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/logging/NotificationMemoryMeterTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/logging/NotificationMemoryMeterTest.kt
index 072a497f1a65..f10a52a73586 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/logging/NotificationMemoryMeterTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/logging/NotificationMemoryMeterTest.kt
@@ -24,8 +24,8 @@ import android.content.Intent
import android.graphics.Bitmap
import android.graphics.drawable.Icon
import android.stats.sysui.NotificationEnums
-import android.testing.AndroidTestingRunner
import android.widget.RemoteViews
+import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.systemui.SysuiTestCase
import com.android.systemui.statusbar.notification.NotificationUtils
@@ -36,7 +36,7 @@ import org.junit.Test
import org.junit.runner.RunWith
@SmallTest
-@RunWith(AndroidTestingRunner::class)
+@RunWith(AndroidJUnit4::class)
class NotificationMemoryMeterTest : SysuiTestCase() {
@Test
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/logging/NotificationMemoryViewWalkerTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/logging/NotificationMemoryViewWalkerTest.kt
index 4bb28ae46211..d7dde96baf32 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/logging/NotificationMemoryViewWalkerTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/logging/NotificationMemoryViewWalkerTest.kt
@@ -3,9 +3,9 @@ package com.android.systemui.statusbar.notification.logging
import android.app.Notification
import android.graphics.Bitmap
import android.graphics.drawable.Icon
-import android.testing.AndroidTestingRunner
import android.testing.TestableLooper
import android.widget.RemoteViews
+import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.systemui.SysuiTestCase
import com.android.systemui.statusbar.notification.row.NotificationRowContentBinder
@@ -17,7 +17,7 @@ import org.junit.Test
import org.junit.runner.RunWith
@SmallTest
-@RunWith(AndroidTestingRunner::class)
+@RunWith(AndroidJUnit4::class)
@TestableLooper.RunWithLooper
class NotificationMemoryViewWalkerTest : SysuiTestCase() {
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/ActivatableNotificationViewTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/ActivatableNotificationViewTest.kt
index 9b9cb8213c91..9f98fd4c8508 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/ActivatableNotificationViewTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/ActivatableNotificationViewTest.kt
@@ -17,9 +17,9 @@ package com.android.systemui.statusbar.notification.row
import android.annotation.ColorInt
import android.graphics.Color
-import android.testing.AndroidTestingRunner
import android.testing.TestableLooper.RunWithLooper
import android.view.View
+import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.settingslib.Utils
import com.android.systemui.res.R
@@ -34,7 +34,7 @@ import org.junit.Test
import org.junit.runner.RunWith
@SmallTest
-@RunWith(AndroidTestingRunner::class)
+@RunWith(AndroidJUnit4::class)
@RunWithLooper
class ActivatableNotificationViewTest : SysuiTestCase() {
private val mContentView: View = mock()
@@ -98,4 +98,4 @@ class ActivatableNotificationViewTest : SysuiTestCase() {
assertThat(mView.topRoundness).isEqualTo(1f)
assertThat(mView.roundableState.hashCode()).isEqualTo(roundableState.hashCode())
}
-} \ No newline at end of file
+}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/BigPictureIconManagerTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/BigPictureIconManagerTest.kt
index 0eae5fc209b4..fda5cd286074 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/BigPictureIconManagerTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/BigPictureIconManagerTest.kt
@@ -20,8 +20,8 @@ import android.graphics.drawable.BitmapDrawable
import android.graphics.drawable.Drawable
import android.graphics.drawable.Icon
import android.net.Uri
-import android.testing.AndroidTestingRunner
import android.testing.TestableLooper.RunWithLooper
+import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.internal.widget.NotificationDrawableConsumer
import com.android.systemui.SysuiTestCase
@@ -50,7 +50,7 @@ private const val MAX_IMAGE_SIZE = 512 // size of the test drawables in pixels
@OptIn(ExperimentalCoroutinesApi::class)
@SmallTest
@RunWithLooper
-@RunWith(AndroidTestingRunner::class)
+@RunWith(AndroidJUnit4::class)
class BigPictureIconManagerTest : SysuiTestCase() {
private val testDispatcher = StandardTestDispatcher()
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/ChannelEditorDialogControllerTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/ChannelEditorDialogControllerTest.kt
index 7dcbd8084594..c5b19ab5862c 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/ChannelEditorDialogControllerTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/ChannelEditorDialogControllerTest.kt
@@ -25,8 +25,8 @@ import android.content.pm.ParceledListSlice
import android.graphics.Color
import android.graphics.drawable.ColorDrawable
import android.print.PrintManager.PRINT_SPOOLER_PACKAGE_NAME
+import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
-import android.testing.AndroidTestingRunner
import android.testing.TestableLooper
import android.view.View
@@ -47,7 +47,7 @@ import org.mockito.Mockito.verify
import org.mockito.MockitoAnnotations
@SmallTest
-@RunWith(AndroidTestingRunner::class)
+@RunWith(AndroidJUnit4::class)
@TestableLooper.RunWithLooper
class ChannelEditorDialogControllerTest : SysuiTestCase() {
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRowControllerTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRowControllerTest.kt
index 210b1a7f22f4..e738b616d227 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRowControllerTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRowControllerTest.kt
@@ -21,8 +21,8 @@ import android.app.Notification
import android.net.Uri
import android.os.UserHandle
import android.os.UserHandle.USER_ALL
-import android.testing.AndroidTestingRunner
import android.testing.TestableLooper
+import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.internal.logging.MetricsLogger
import com.android.internal.statusbar.IStatusBarService
@@ -71,7 +71,7 @@ import org.mockito.Mockito.verify
import org.mockito.Mockito.`when` as whenever
@SmallTest
-@RunWith(AndroidTestingRunner::class)
+@RunWith(AndroidJUnit4::class)
@TestableLooper.RunWithLooper
class ExpandableNotificationRowControllerTest : SysuiTestCase() {
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRowDragControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRowDragControllerTest.java
index 9d2f32d77028..1c5f37cc60c3 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRowDragControllerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRowDragControllerTest.java
@@ -31,10 +31,10 @@ import static org.mockito.Mockito.when;
import android.app.Notification;
import android.app.PendingIntent;
import android.content.Context;
-import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper;
import android.testing.TestableLooper.RunWithLooper;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.SmallTest;
import com.android.systemui.SysuiTestCase;
@@ -48,7 +48,7 @@ import org.junit.Test;
import org.junit.runner.RunWith;
@SmallTest
-@RunWith(AndroidTestingRunner.class)
+@RunWith(AndroidJUnit4.class)
@RunWithLooper
public class ExpandableNotificationRowDragControllerTest extends SysuiTestCase {
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRowTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRowTest.java
index aa79c23bdf74..7304bd62293d 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRowTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRowTest.java
@@ -46,13 +46,13 @@ import android.graphics.drawable.AnimationDrawable;
import android.graphics.drawable.Drawable;
import android.os.UserHandle;
import android.platform.test.annotations.EnableFlags;
-import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper;
import android.testing.TestableLooper.RunWithLooper;
import android.util.DisplayMetrics;
import android.view.View;
import android.widget.ImageView;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.SmallTest;
import com.android.internal.R;
@@ -87,7 +87,7 @@ import java.util.List;
import java.util.function.Consumer;
@SmallTest
-@RunWith(AndroidTestingRunner.class)
+@RunWith(AndroidJUnit4.class)
@RunWithLooper
public class ExpandableNotificationRowTest extends SysuiTestCase {
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/FeedbackInfoTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/FeedbackInfoTest.java
index ffb8646942b5..d04d6fc5f593 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/FeedbackInfoTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/FeedbackInfoTest.java
@@ -45,13 +45,13 @@ import android.content.res.Configuration;
import android.graphics.drawable.Drawable;
import android.os.UserHandle;
import android.service.notification.StatusBarNotification;
-import android.testing.AndroidTestingRunner;
import android.testing.UiThreadTest;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.SmallTest;
import com.android.internal.statusbar.IStatusBarService;
@@ -72,7 +72,7 @@ import org.mockito.MockitoAnnotations;
import java.util.Locale;
@SmallTest
-@RunWith(AndroidTestingRunner.class)
+@RunWith(AndroidJUnit4.class)
@UiThreadTest
public class FeedbackInfoTest extends SysuiTestCase {
private static final String TEST_PACKAGE_NAME = "test_package";
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/HeadsUpStyleProviderImplTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/HeadsUpStyleProviderImplTest.kt
index 5e50af39203f..c325791b1f05 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/HeadsUpStyleProviderImplTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/HeadsUpStyleProviderImplTest.kt
@@ -20,7 +20,7 @@ import android.app.Flags.FLAG_COMPACT_HEADS_UP_NOTIFICATION
import android.platform.test.annotations.DisableFlags
import android.platform.test.annotations.EnableFlags
import android.platform.test.flag.junit.SetFlagsRule
-import android.testing.AndroidTestingRunner
+import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.systemui.SysuiTestCase
import com.android.systemui.statusbar.data.repository.FakeStatusBarModeRepository
@@ -31,7 +31,7 @@ import org.junit.Test
import org.junit.runner.RunWith
@SmallTest
-@RunWith(AndroidTestingRunner::class)
+@RunWith(AndroidJUnit4::class)
class HeadsUpStyleProviderImplTest : SysuiTestCase() {
@Rule @JvmField val setFlagsRule = SetFlagsRule()
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotifBindPipelineTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotifBindPipelineTest.java
index 25172deb67a7..18fd42da78ea 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotifBindPipelineTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotifBindPipelineTest.java
@@ -22,11 +22,11 @@ import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.verify;
-import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper;
import androidx.annotation.NonNull;
import androidx.core.os.CancellationSignal;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.SmallTest;
import com.android.systemui.SysuiTestCase;
@@ -48,7 +48,7 @@ import java.util.ArrayList;
import java.util.List;
@SmallTest
-@RunWith(AndroidTestingRunner.class)
+@RunWith(AndroidJUnit4.class)
@TestableLooper.RunWithLooper
public class NotifBindPipelineTest extends SysuiTestCase {
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotifInflationErrorManagerTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotifInflationErrorManagerTest.kt
index e38adeb0fcd9..29252b27f6d0 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotifInflationErrorManagerTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotifInflationErrorManagerTest.kt
@@ -16,8 +16,8 @@
package com.android.systemui.statusbar.notification.row
-import android.testing.AndroidTestingRunner
import android.testing.TestableLooper
+import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.systemui.SysuiTestCase
import com.android.systemui.statusbar.notification.collection.NotificationEntry
@@ -33,7 +33,7 @@ import org.mockito.Mockito.never
import org.mockito.Mockito.verify
@SmallTest
-@RunWith(AndroidTestingRunner::class)
+@RunWith(AndroidJUnit4::class)
@TestableLooper.RunWithLooper
class NotifInflationErrorManagerTest : SysuiTestCase() {
private lateinit var manager: NotifInflationErrorManager
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotifRemoteViewCacheImplTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotifRemoteViewCacheImplTest.java
index 20cc01accbc3..8b1c95babe38 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotifRemoteViewCacheImplTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotifRemoteViewCacheImplTest.java
@@ -26,9 +26,9 @@ import static junit.framework.Assert.assertTrue;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
-import android.testing.AndroidTestingRunner;
import android.widget.RemoteViews;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.SmallTest;
import com.android.systemui.SysuiTestCase;
@@ -45,7 +45,7 @@ import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
@SmallTest
-@RunWith(AndroidTestingRunner.class)
+@RunWith(AndroidJUnit4.class)
public class NotifRemoteViewCacheImplTest extends SysuiTestCase {
private NotifRemoteViewCacheImpl mNotifRemoteViewCache;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationContentInflaterTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationContentInflaterTest.java
index 03a84036b4b5..a355cd16ee15 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationContentInflaterTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationContentInflaterTest.java
@@ -40,7 +40,6 @@ import android.os.AsyncTask;
import android.os.CancellationSignal;
import android.os.Handler;
import android.os.Looper;
-import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper;
import android.testing.TestableLooper.RunWithLooper;
import android.util.TypedValue;
@@ -49,6 +48,7 @@ import android.view.ViewGroup;
import android.widget.RemoteViews;
import android.widget.TextView;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.SmallTest;
import androidx.test.filters.Suppress;
@@ -79,7 +79,7 @@ import java.util.concurrent.Executor;
import java.util.concurrent.TimeUnit;
@SmallTest
-@RunWith(AndroidTestingRunner.class)
+@RunWith(AndroidJUnit4.class)
@RunWithLooper(setAsMainLooper = true)
@Suppress
public class NotificationContentInflaterTest extends SysuiTestCase {
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationContentViewTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationContentViewTest.kt
index 7332bc34b030..2bb610ac4449 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationContentViewTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationContentViewTest.kt
@@ -20,7 +20,6 @@ import android.annotation.DimenRes
import android.content.res.Resources
import android.os.UserHandle
import android.service.notification.StatusBarNotification
-import android.testing.AndroidTestingRunner
import android.testing.TestableLooper
import android.testing.ViewUtils
import android.view.NotificationHeaderView
@@ -29,6 +28,7 @@ import android.view.ViewGroup
import android.widget.FrameLayout
import android.widget.ImageView
import android.widget.LinearLayout
+import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.internal.R
import com.android.internal.widget.NotificationActionListLayout
@@ -60,7 +60,7 @@ import org.mockito.Mockito.verify
import org.mockito.MockitoAnnotations.initMocks
@SmallTest
-@RunWith(AndroidTestingRunner::class)
+@RunWith(AndroidJUnit4::class)
@TestableLooper.RunWithLooper
class NotificationContentViewTest : SysuiTestCase() {
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationConversationInfoTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationConversationInfoTest.java
index 97cb11e2f107..be89ab8c5cf8 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationConversationInfoTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationConversationInfoTest.java
@@ -65,13 +65,13 @@ import android.os.Handler;
import android.os.UserHandle;
import android.os.UserManager;
import android.service.notification.StatusBarNotification;
-import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.SmallTest;
import com.android.internal.logging.MetricsLogger;
@@ -103,7 +103,7 @@ import java.util.Optional;
import java.util.concurrent.CountDownLatch;
@SmallTest
-@RunWith(AndroidTestingRunner.class)
+@RunWith(AndroidJUnit4.class)
@TestableLooper.RunWithLooper
public class NotificationConversationInfoTest extends SysuiTestCase {
private static final String TEST_PACKAGE_NAME = "test_package";
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationGutsManagerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationGutsManagerTest.java
index 907649b90956..625963f5ec7a 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationGutsManagerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationGutsManagerTest.java
@@ -57,12 +57,12 @@ import android.os.Handler;
import android.os.UserManager;
import android.provider.Settings;
import android.service.notification.StatusBarNotification;
-import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper;
import android.util.ArraySet;
import android.view.View;
import android.view.accessibility.AccessibilityManager;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.SmallTest;
import com.android.internal.logging.MetricsLogger;
@@ -115,7 +115,7 @@ import java.util.Optional;
* Tests for {@link NotificationGutsManager}.
*/
@SmallTest
-@RunWith(AndroidTestingRunner.class)
+@RunWith(AndroidJUnit4.class)
@TestableLooper.RunWithLooper
public class NotificationGutsManagerTest extends SysuiTestCase {
private static final String TEST_CHANNEL_ID = "NotificationManagerServiceTestChannelId";
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationGutsManagerWithScenesTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationGutsManagerWithScenesTest.kt
index 1b85dfa5a087..0b5f8d5e948c 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationGutsManagerWithScenesTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationGutsManagerWithScenesTest.kt
@@ -31,11 +31,11 @@ import android.os.fakeExecutorHandler
import android.os.userManager
import android.provider.Settings
import android.service.notification.NotificationListenerService.Ranking
-import android.testing.AndroidTestingRunner
import android.testing.TestableLooper.RunWithLooper
import android.util.ArraySet
import android.view.View
import android.view.accessibility.accessibilityManager
+import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.compose.animation.scene.ObservableTransitionState
import com.android.internal.logging.MetricsLogger
@@ -91,7 +91,7 @@ import org.mockito.invocation.InvocationOnMock
/** Tests for [NotificationGutsManager] with the scene container enabled. */
@SmallTest
-@RunWith(AndroidTestingRunner::class)
+@RunWith(AndroidJUnit4::class)
@RunWithLooper
@EnableSceneContainer
class NotificationGutsManagerWithScenesTest : SysuiTestCase() {
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationGutsTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationGutsTest.kt
index 7f9471e5271f..350f90dcbe91 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationGutsTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationGutsTest.kt
@@ -16,11 +16,11 @@
package com.android.systemui.statusbar.notification.row
-import android.testing.AndroidTestingRunner
import android.testing.TestableLooper.RunWithLooper
import android.testing.ViewUtils
import android.view.LayoutInflater
import android.view.View
+import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.systemui.res.R
import com.android.systemui.SysuiTestCase
@@ -34,7 +34,7 @@ import org.mockito.Mockito.`when` as whenever
import org.mockito.MockitoAnnotations
@SmallTest
-@RunWith(AndroidTestingRunner::class)
+@RunWith(AndroidJUnit4::class)
@RunWithLooper
class NotificationGutsTest : SysuiTestCase() {
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationInfoTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationInfoTest.java
index 13ced928175e..245a6a0b130c 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationInfoTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationInfoTest.java
@@ -55,13 +55,13 @@ import android.os.RemoteException;
import android.os.UserHandle;
import android.service.notification.StatusBarNotification;
import android.telecom.TelecomManager;
-import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.SmallTest;
import com.android.internal.logging.MetricsLogger;
@@ -85,7 +85,7 @@ import org.mockito.junit.MockitoRule;
import java.util.concurrent.CountDownLatch;
@SmallTest
-@RunWith(AndroidTestingRunner.class)
+@RunWith(AndroidJUnit4.class)
@TestableLooper.RunWithLooper
public class NotificationInfoTest extends SysuiTestCase {
private static final String TEST_PACKAGE_NAME = "test_package";
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationMenuRowTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationMenuRowTest.java
index e9290289f7f2..027e899e20df 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationMenuRowTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationMenuRowTest.java
@@ -29,13 +29,13 @@ import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import android.provider.Settings;
-import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper;
import android.testing.TestableLooper.RunWithLooper;
import android.testing.ViewUtils;
import android.view.View;
import android.view.ViewGroup;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.SmallTest;
import com.android.systemui.plugins.statusbar.NotificationMenuRowPlugin;
@@ -49,7 +49,7 @@ import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mockito;
-@RunWith(AndroidTestingRunner.class)
+@RunWith(AndroidJUnit4.class)
@RunWithLooper
@SmallTest
public class NotificationMenuRowTest extends LeakCheckedTest {
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationSettingsControllerTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationSettingsControllerTest.kt
index 8261c1c4b42e..352b79f50b90 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationSettingsControllerTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationSettingsControllerTest.kt
@@ -22,8 +22,8 @@ import android.database.ContentObserver
import android.net.Uri
import android.os.Handler
import android.provider.Settings.Secure
-import android.testing.AndroidTestingRunner
import android.testing.TestableLooper
+import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.systemui.SysuiTestCase
import com.android.systemui.dump.DumpManager
@@ -54,7 +54,7 @@ import org.mockito.Mockito.verifyZeroInteractions
import org.mockito.MockitoAnnotations
@SmallTest
-@RunWith(AndroidTestingRunner::class)
+@RunWith(AndroidJUnit4::class)
@TestableLooper.RunWithLooper
class NotificationSettingsControllerTest : SysuiTestCase() {
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationSnoozeTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationSnoozeTest.java
index 4a91cd239d87..22f1e4604bbd 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationSnoozeTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationSnoozeTest.java
@@ -23,11 +23,11 @@ import static junit.framework.Assert.assertTrue;
import static org.mockito.Mockito.mock;
import android.provider.Settings;
-import android.testing.AndroidTestingRunner;
import android.testing.TestableResources;
import android.testing.UiThreadTest;
import android.util.KeyValueListParser;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.SmallTest;
import com.android.systemui.SysuiTestCase;
@@ -41,7 +41,7 @@ import org.junit.runner.RunWith;
import java.util.ArrayList;
@SmallTest
-@RunWith(AndroidTestingRunner.class)
+@RunWith(AndroidJUnit4.class)
@UiThreadTest
public class NotificationSnoozeTest extends SysuiTestCase {
private static final int RES_DEFAULT = 2;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/PartialConversationInfoTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/PartialConversationInfoTest.java
index 51665d987888..57b0f3f8d8c5 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/PartialConversationInfoTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/PartialConversationInfoTest.java
@@ -41,7 +41,6 @@ import android.graphics.drawable.Drawable;
import android.graphics.drawable.Icon;
import android.os.UserHandle;
import android.service.notification.StatusBarNotification;
-import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper;
import android.text.SpannableString;
import android.view.LayoutInflater;
@@ -49,6 +48,7 @@ import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.SmallTest;
import com.android.internal.logging.MetricsLogger;
@@ -69,7 +69,7 @@ import org.mockito.junit.MockitoRule;
import java.util.concurrent.CountDownLatch;
@SmallTest
-@RunWith(AndroidTestingRunner.class)
+@RunWith(AndroidJUnit4.class)
@TestableLooper.RunWithLooper
public class PartialConversationInfoTest extends SysuiTestCase {
private static final String TEST_PACKAGE_NAME = "test_package";
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/RowContentBindStageTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/RowContentBindStageTest.java
index 1534c84fd99a..841cb4a3669b 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/RowContentBindStageTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/RowContentBindStageTest.java
@@ -34,10 +34,10 @@ import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
-import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper;
import android.util.Log;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.SmallTest;
import com.android.systemui.SysuiTestCase;
@@ -52,7 +52,7 @@ import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
@SmallTest
-@RunWith(AndroidTestingRunner.class)
+@RunWith(AndroidJUnit4.class)
@TestableLooper.RunWithLooper
public class RowContentBindStageTest extends SysuiTestCase {
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/SingleLineConversationViewBinderTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/SingleLineConversationViewBinderTest.kt
index 1c959af6ec3f..53a11989cca0 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/SingleLineConversationViewBinderTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/SingleLineConversationViewBinderTest.kt
@@ -18,8 +18,8 @@ package com.android.systemui.statusbar.notification.row
import android.app.Notification
import android.app.Person
import android.platform.test.annotations.EnableFlags
-import android.testing.AndroidTestingRunner
import android.testing.TestableLooper
+import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.internal.R
import com.android.systemui.SysuiTestCase
@@ -34,7 +34,7 @@ import org.junit.Test
import org.junit.runner.RunWith
@SmallTest
-@RunWith(AndroidTestingRunner::class)
+@RunWith(AndroidJUnit4::class)
@TestableLooper.RunWithLooper
class SingleLineConversationViewBinderTest : SysuiTestCase() {
private lateinit var notificationBuilder: Notification.Builder
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/SingleLineViewBinderTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/SingleLineViewBinderTest.kt
index f0fc349777b2..ee819c4df0ef 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/SingleLineViewBinderTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/SingleLineViewBinderTest.kt
@@ -17,8 +17,8 @@ package com.android.systemui.statusbar.notification.row
import android.app.Notification
import android.platform.test.annotations.EnableFlags
-import android.testing.AndroidTestingRunner
import android.testing.TestableLooper
+import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.internal.R
import com.android.systemui.SysuiTestCase
@@ -33,7 +33,7 @@ import org.junit.Test
import org.junit.runner.RunWith
@SmallTest
-@RunWith(AndroidTestingRunner::class)
+@RunWith(AndroidJUnit4::class)
@TestableLooper.RunWithLooper
class SingleLineViewBinderTest : SysuiTestCase() {
private lateinit var notificationBuilder: Notification.Builder
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/SingleLineViewInflaterTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/SingleLineViewInflaterTest.kt
index b67153a842ac..e025d3d36ab1 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/SingleLineViewInflaterTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/SingleLineViewInflaterTest.kt
@@ -27,9 +27,9 @@ import android.graphics.PorterDuffXfermode
import android.graphics.drawable.Drawable
import android.graphics.drawable.Icon
import android.platform.test.annotations.EnableFlags
-import android.testing.AndroidTestingRunner
import android.testing.TestableLooper
import androidx.core.graphics.drawable.toBitmap
+import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.systemui.SysuiTestCase
import com.android.systemui.res.R
@@ -48,7 +48,7 @@ import org.junit.Test
import org.junit.runner.RunWith
@SmallTest
-@RunWith(AndroidTestingRunner::class)
+@RunWith(AndroidJUnit4::class)
@TestableLooper.RunWithLooper
@EnableFlags(AsyncHybridViewInflation.FLAG_NAME)
class SingleLineViewInflaterTest : SysuiTestCase() {
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/TextPrecomputerTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/TextPrecomputerTest.kt
index d46763df8a75..f8533a532d32 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/TextPrecomputerTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/TextPrecomputerTest.kt
@@ -16,11 +16,11 @@
package com.android.systemui.statusbar.notification.row
-import android.testing.AndroidTestingRunner
import android.testing.TestableLooper.RunWithLooper
import android.text.PrecomputedText
import android.text.TextPaint
import android.widget.TextView
+import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.systemui.SysuiTestCase
import com.google.common.truth.Truth.assertThat
@@ -29,7 +29,7 @@ import org.junit.Test
import org.junit.runner.RunWith
@SmallTest
-@RunWith(AndroidTestingRunner::class)
+@RunWith(AndroidJUnit4::class)
@RunWithLooper
class TextPrecomputerTest : SysuiTestCase() {
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/ui/viewmodel/ActivatableNotificationViewModelTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/ui/viewmodel/ActivatableNotificationViewModelTest.kt
index c9602307216d..0dc871a523ee 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/ui/viewmodel/ActivatableNotificationViewModelTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/ui/viewmodel/ActivatableNotificationViewModelTest.kt
@@ -18,7 +18,7 @@
package com.android.systemui.statusbar.notification.row.ui.viewmodel
-import android.testing.AndroidTestingRunner
+import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.systemui.SysuiTestCase
import com.android.systemui.accessibility.data.repository.FakeAccessibilityRepository
@@ -31,7 +31,7 @@ import kotlinx.coroutines.test.runTest
import org.junit.Test
import org.junit.runner.RunWith
-@RunWith(AndroidTestingRunner::class)
+@RunWith(AndroidJUnit4::class)
@SmallTest
class ActivatableNotificationViewModelTest : SysuiTestCase() {
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationBigPictureTemplateViewWrapperTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationBigPictureTemplateViewWrapperTest.java
index a15b4cd37184..ec280a1d6d01 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationBigPictureTemplateViewWrapperTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationBigPictureTemplateViewWrapperTest.java
@@ -24,10 +24,10 @@ import android.app.Notification;
import android.graphics.drawable.AnimatedImageDrawable;
import android.graphics.drawable.Icon;
import android.os.Bundle;
-import android.testing.AndroidTestingRunner;
import android.view.LayoutInflater;
import android.view.View;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.SmallTest;
import com.android.internal.R;
@@ -40,7 +40,7 @@ import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-@RunWith(AndroidTestingRunner.class)
+@RunWith(AndroidJUnit4.class)
@SmallTest
public class NotificationBigPictureTemplateViewWrapperTest extends SysuiTestCase {
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationConversationTemplateViewWrapperTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationConversationTemplateViewWrapperTest.kt
index fe2971c46c32..9d990b1d7edf 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationConversationTemplateViewWrapperTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationConversationTemplateViewWrapperTest.kt
@@ -17,8 +17,8 @@
package com.android.systemui.statusbar.notification.row.wrapper
import android.graphics.drawable.AnimatedImageDrawable
-import android.testing.AndroidTestingRunner
import android.view.View
+import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.internal.R
import com.android.internal.widget.CachingIconView
@@ -38,7 +38,7 @@ import org.mockito.Mockito.verify
import org.mockito.Mockito.`when` as whenever
@SmallTest
-@RunWith(AndroidTestingRunner::class)
+@RunWith(AndroidJUnit4::class)
class NotificationConversationTemplateViewWrapperTest : SysuiTestCase() {
private lateinit var mRow: ExpandableNotificationRow
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationCustomViewWrapperTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationCustomViewWrapperTest.java
index 2d72c7e0b714..f9a9704334a0 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationCustomViewWrapperTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationCustomViewWrapperTest.java
@@ -16,10 +16,10 @@
package com.android.systemui.statusbar.notification.row.wrapper;
-import android.testing.AndroidTestingRunner;
import android.view.View;
import android.widget.RemoteViews;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.SmallTest;
import com.android.systemui.SysuiTestCase;
@@ -33,7 +33,7 @@ import org.junit.Test;
import org.junit.runner.RunWith;
@SmallTest
-@RunWith(AndroidTestingRunner.class)
+@RunWith(AndroidJUnit4.class)
public class NotificationCustomViewWrapperTest extends SysuiTestCase {
private ExpandableNotificationRow mRow;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationMessagingTemplateViewWrapperTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationMessagingTemplateViewWrapperTest.kt
index f26c18b1d197..fc829d53a6b4 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationMessagingTemplateViewWrapperTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationMessagingTemplateViewWrapperTest.kt
@@ -17,8 +17,8 @@
package com.android.systemui.statusbar.notification.row.wrapper
import android.graphics.drawable.AnimatedImageDrawable
-import android.testing.AndroidTestingRunner
import android.view.View
+import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.internal.widget.MessagingGroup
import com.android.internal.widget.MessagingImageMessage
@@ -36,7 +36,7 @@ import org.mockito.Mockito.verify
import org.mockito.Mockito.`when` as whenever
@SmallTest
-@RunWith(AndroidTestingRunner::class)
+@RunWith(AndroidJUnit4::class)
class NotificationMessagingTemplateViewWrapperTest : SysuiTestCase() {
private lateinit var mRow: ExpandableNotificationRow
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationTemplateViewWrapperTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationTemplateViewWrapperTest.kt
index 54eed26adaf3..1ce3bada4609 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationTemplateViewWrapperTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationTemplateViewWrapperTest.kt
@@ -19,7 +19,6 @@ package com.android.systemui.statusbar.notification.row.wrapper
import android.app.PendingIntent
import android.app.PendingIntent.CancelListener
import android.content.Intent
-import android.testing.AndroidTestingRunner
import android.testing.TestableLooper
import android.testing.TestableLooper.RunWithLooper
import android.testing.ViewUtils
@@ -27,6 +26,7 @@ import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.FrameLayout
+import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.internal.R
import com.android.systemui.SysuiTestCase
@@ -46,7 +46,7 @@ import org.mockito.Mockito.times
import org.mockito.Mockito.verify
@SmallTest
-@RunWith(AndroidTestingRunner::class)
+@RunWith(AndroidJUnit4::class)
@RunWithLooper
class NotificationTemplateViewWrapperTest : SysuiTestCase() {
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationViewWrapperTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationViewWrapperTest.java
index fad85f53a091..d17c8dbcf38d 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationViewWrapperTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationViewWrapperTest.java
@@ -20,11 +20,11 @@ import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import android.content.Context;
-import android.testing.AndroidTestingRunner;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.SmallTest;
import com.android.systemui.SysuiTestCase;
@@ -35,7 +35,7 @@ import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-@RunWith(AndroidTestingRunner.class)
+@RunWith(AndroidJUnit4.class)
@SmallTest
public class NotificationViewWrapperTest extends SysuiTestCase {
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/shelf/domain/interactor/NotificationShelfInteractorTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/shelf/domain/interactor/NotificationShelfInteractorTest.kt
index 59d98c233f99..4c6e25a530a5 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/shelf/domain/interactor/NotificationShelfInteractorTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/shelf/domain/interactor/NotificationShelfInteractorTest.kt
@@ -19,7 +19,7 @@
package com.android.systemui.statusbar.notification.shelf.domain.interactor
import android.os.PowerManager
-import android.testing.AndroidTestingRunner
+import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.systemui.SysuiTestCase
import com.android.systemui.coroutines.collectLastValue
@@ -41,7 +41,7 @@ import org.junit.runner.RunWith
import org.mockito.Mockito.isNull
import org.mockito.Mockito.verify
-@RunWith(AndroidTestingRunner::class)
+@RunWith(AndroidJUnit4::class)
@SmallTest
class NotificationShelfInteractorTest : SysuiTestCase() {
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/shelf/ui/viewmodel/NotificationShelfViewModelTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/shelf/ui/viewmodel/NotificationShelfViewModelTest.kt
index 917569ca787b..e2fb3ba11a02 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/shelf/ui/viewmodel/NotificationShelfViewModelTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/shelf/ui/viewmodel/NotificationShelfViewModelTest.kt
@@ -17,7 +17,7 @@
package com.android.systemui.statusbar.notification.shelf.ui.viewmodel
import android.os.PowerManager
-import android.testing.AndroidTestingRunner
+import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.systemui.SysUITestComponent
import com.android.systemui.SysUITestModule
@@ -44,7 +44,7 @@ import org.junit.runner.RunWith
import org.mockito.Mockito
import org.mockito.Mockito.verify
-@RunWith(AndroidTestingRunner::class)
+@RunWith(AndroidJUnit4::class)
@SmallTest
class NotificationShelfViewModelTest : SysuiTestCase() {
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/AmbientStateTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/AmbientStateTest.kt
index fb1594898f24..2349c252369c 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/AmbientStateTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/AmbientStateTest.kt
@@ -16,7 +16,7 @@
package com.android.systemui.statusbar.notification.stack
-import android.testing.AndroidTestingRunner
+import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.systemui.SysuiTestCase
import com.android.systemui.dump.DumpManager
@@ -33,7 +33,7 @@ import org.junit.runner.RunWith
private const val MAX_PULSE_HEIGHT = 100000f
-@RunWith(AndroidTestingRunner::class)
+@RunWith(AndroidJUnit4::class)
@SmallTest
class AmbientStateTest : SysuiTestCase() {
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/MediaContainerViewTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/MediaContainerViewTest.kt
index f4e236e5bbf9..3a77d822eb7e 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/MediaContainerViewTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/MediaContainerViewTest.kt
@@ -1,8 +1,8 @@
package com.android.systemui.statusbar.notification.stack
-import android.testing.AndroidTestingRunner
import android.testing.TestableLooper
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
@@ -15,7 +15,7 @@ import org.junit.runner.RunWith
* Tests for {@link MediaContainView}.
*/
@SmallTest
-@RunWith(AndroidTestingRunner::class)
+@RunWith(AndroidJUnit4::class)
@TestableLooper.RunWithLooper
class MediaContainerViewTest : SysuiTestCase() {
@@ -35,4 +35,4 @@ class MediaContainerViewTest : SysuiTestCase() {
mediaContainerView.updateClipping()
assertTrue(mediaContainerView.clipHeight == 10)
}
-} \ No newline at end of file
+}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationChildrenContainerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationChildrenContainerTest.java
index 3b16f1416935..14bbd38ece2c 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationChildrenContainerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationChildrenContainerTest.java
@@ -21,13 +21,13 @@ import static org.junit.Assert.assertNull;
import android.app.Notification;
import android.platform.test.annotations.DisableFlags;
import android.platform.test.annotations.EnableFlags;
-import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper;
import android.testing.TestableLooper.RunWithLooper;
import android.view.NotificationHeaderView;
import android.view.View;
import android.widget.RemoteViews;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.SmallTest;
import com.android.systemui.SysuiTestCase;
@@ -45,7 +45,7 @@ import org.junit.runner.RunWith;
import java.util.List;
@SmallTest
-@RunWith(AndroidTestingRunner.class)
+@RunWith(AndroidJUnit4.class)
@RunWithLooper
//@DisableFlags(AsyncGroupHeaderViewInflation.FLAG_NAME)
public class NotificationChildrenContainerTest extends SysuiTestCase {
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationShelfTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationShelfTest.kt
index 1eed4207541c..48e8f88a15c0 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationShelfTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationShelfTest.kt
@@ -2,10 +2,10 @@ package com.android.systemui.statusbar.notification.stack
import android.platform.test.annotations.DisableFlags
import android.service.notification.StatusBarNotification
-import android.testing.AndroidTestingRunner
import android.testing.TestableLooper.RunWithLooper
import android.view.LayoutInflater
import android.widget.FrameLayout
+import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.keyguard.BouncerPanelExpansionCalculator.aboutToShowBouncerProgress
import com.android.systemui.SysuiTestCase
@@ -35,7 +35,7 @@ import org.mockito.Mockito.`when` as whenever
/** Tests for {@link NotificationShelf}. */
@SmallTest
-@RunWith(AndroidTestingRunner::class)
+@RunWith(AndroidJUnit4::class)
@RunWithLooper
open class NotificationShelfTest : SysuiTestCase() {
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutControllerTest.java
index f262df1d875a..ce2491bb098e 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutControllerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutControllerTest.java
@@ -42,12 +42,12 @@ import static org.mockito.Mockito.when;
import android.metrics.LogMaker;
import android.platform.test.annotations.DisableFlags;
import android.platform.test.annotations.EnableFlags;
-import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewTreeObserver;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.SmallTest;
import com.android.internal.logging.MetricsLogger;
@@ -126,7 +126,7 @@ import javax.inject.Provider;
*/
@SmallTest
@TestableLooper.RunWithLooper(setAsMainLooper = true)
-@RunWith(AndroidTestingRunner.class)
+@RunWith(AndroidJUnit4.class)
public class NotificationStackScrollLayoutControllerTest extends SysuiTestCase {
protected KosmosJavaAdapter mKosmos = new KosmosJavaAdapter(this);
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutTest.java
index 0c0a2a59d9bc..f461e2f67d20 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutTest.java
@@ -54,7 +54,6 @@ import android.graphics.Rect;
import android.os.SystemClock;
import android.platform.test.annotations.DisableFlags;
import android.platform.test.annotations.EnableFlags;
-import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper;
import android.testing.TestableResources;
import android.util.MathUtils;
@@ -65,6 +64,7 @@ import android.view.WindowInsets;
import android.view.WindowInsetsAnimation;
import android.widget.TextView;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.SmallTest;
import com.android.keyguard.BouncerPanelExpansionCalculator;
@@ -114,7 +114,7 @@ import java.util.function.Consumer;
* Tests for {@link NotificationStackScrollLayout}.
*/
@SmallTest
-@RunWith(AndroidTestingRunner.class)
+@RunWith(AndroidJUnit4.class)
@TestableLooper.RunWithLooper
public class NotificationStackScrollLayoutTest extends SysuiTestCase {
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackSizeCalculatorTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackSizeCalculatorTest.kt
index 6fec9ad7bd66..dae5542123ed 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackSizeCalculatorTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationStackSizeCalculatorTest.kt
@@ -18,8 +18,8 @@ package com.android.systemui.statusbar.notification.stack
import android.annotation.DimenRes
import android.service.notification.StatusBarNotification
-import android.testing.AndroidTestingRunner
import android.view.View.VISIBLE
+import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.systemui.res.R
import com.android.systemui.SysuiTestCase
@@ -44,7 +44,7 @@ import org.mockito.Mockito.`when` as whenever
import org.mockito.MockitoAnnotations
@SmallTest
-@RunWith(AndroidTestingRunner::class)
+@RunWith(AndroidJUnit4::class)
class NotificationStackSizeCalculatorTest : SysuiTestCase() {
@Mock private lateinit var sysuiStatusBarStateController: SysuiStatusBarStateController
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationSwipeHelperTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationSwipeHelperTest.java
index 85a2bdd21073..2d119174efff 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationSwipeHelperTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationSwipeHelperTest.java
@@ -37,12 +37,12 @@ import android.animation.Animator;
import android.animation.ValueAnimator.AnimatorUpdateListener;
import android.os.Handler;
import android.service.notification.StatusBarNotification;
-import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewConfiguration;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.SmallTest;
import com.android.systemui.SysuiTestCase;
@@ -70,7 +70,7 @@ import java.util.stream.Collectors;
* Tests for {@link NotificationSwipeHelper}.
*/
@SmallTest
-@RunWith(AndroidTestingRunner.class)
+@RunWith(AndroidJUnit4.class)
@TestableLooper.RunWithLooper()
public class NotificationSwipeHelperTest extends SysuiTestCase {
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationTargetsHelperTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationTargetsHelperTest.kt
index e30947ce84bd..660eb308fdf3 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationTargetsHelperTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/NotificationTargetsHelperTest.kt
@@ -1,8 +1,8 @@
package com.android.systemui.statusbar.notification.stack
-import android.testing.AndroidTestingRunner
import android.testing.TestableLooper
import android.testing.TestableLooper.RunWithLooper
+import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.systemui.SysuiTestCase
import com.android.systemui.flags.FakeFeatureFlags
@@ -15,7 +15,7 @@ import org.junit.runner.RunWith
/** Tests for {@link NotificationTargetsHelper}. */
@SmallTest
-@RunWith(AndroidTestingRunner::class)
+@RunWith(AndroidJUnit4::class)
@RunWithLooper
class NotificationTargetsHelperTest : SysuiTestCase() {
private val featureFlags = FakeFeatureFlags()
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/StackStateAnimatorTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/StackStateAnimatorTest.kt
index 926c35f32967..798465e7b165 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/StackStateAnimatorTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/StackStateAnimatorTest.kt
@@ -17,8 +17,8 @@
package com.android.systemui.statusbar.notification.stack
import android.platform.test.annotations.EnableFlags
-import android.testing.AndroidTestingRunner
import android.testing.TestableLooper.RunWithLooper
+import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.systemui.SysuiTestCase
import com.android.systemui.animation.AnimatorTestRule
@@ -48,7 +48,7 @@ private const val FULL_SHADE_APPEAR_TRANSLATION = 300
private const val HEADS_UP_ABOVE_SCREEN = 80
@SmallTest
-@RunWith(AndroidTestingRunner::class)
+@RunWith(AndroidJUnit4::class)
@RunWithLooper
class StackStateAnimatorTest : SysuiTestCase() {
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/ViewStateTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/ViewStateTest.kt
index cd6bb5f4966a..e493420b64a1 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/ViewStateTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/ViewStateTest.kt
@@ -16,7 +16,7 @@
package com.android.systemui.statusbar.notification.stack
-import android.testing.AndroidTestingRunner
+import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.systemui.SysuiTestCase
import com.android.systemui.log.assertDoesNotLogWtf
@@ -27,7 +27,7 @@ import org.junit.Assert
import org.junit.Test
import org.junit.runner.RunWith
-@RunWith(AndroidTestingRunner::class)
+@RunWith(AndroidJUnit4::class)
@SmallTest
class ViewStateTest : SysuiTestCase() {
private val viewState = ViewState()
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/domain/interactor/HideNotificationsInteractorTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/domain/interactor/HideNotificationsInteractorTest.kt
index e2ac2038be32..e46906fb5192 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/domain/interactor/HideNotificationsInteractorTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/stack/domain/interactor/HideNotificationsInteractorTest.kt
@@ -17,10 +17,10 @@ package com.android.systemui.statusbar.notification.stack.domain.interactor
import android.content.res.Configuration
import android.graphics.Rect
-import android.testing.AndroidTestingRunner
import android.view.Surface
import android.view.Surface.ROTATION_0
import android.view.Surface.ROTATION_90
+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.ConfigurationRepositoryImpl
@@ -52,7 +52,7 @@ import org.mockito.MockitoAnnotations
@OptIn(ExperimentalCoroutinesApi::class)
@SmallTest
-@RunWith(AndroidTestingRunner::class)
+@RunWith(AndroidJUnit4::class)
open class HideNotificationsInteractorTest : SysuiTestCase() {
private val testScope = TestScope()
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/AutoTileManagerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/AutoTileManagerTest.java
index 84cd518cf85a..f0bc655a554d 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/AutoTileManagerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/AutoTileManagerTest.java
@@ -45,10 +45,10 @@ import android.hardware.display.ColorDisplayManager;
import android.hardware.display.NightDisplayListener;
import android.os.Handler;
import android.os.UserHandle;
-import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper;
import android.testing.TestableLooper.RunWithLooper;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.SmallTest;
import com.android.systemui.SysuiTestCase;
@@ -89,7 +89,7 @@ import java.util.List;
import javax.inject.Named;
-@RunWith(AndroidTestingRunner.class)
+@RunWith(AndroidJUnit4.class)
@RunWithLooper
@SmallTest
public class AutoTileManagerTest extends SysuiTestCase {
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/BiometricsUnlockControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/BiometricsUnlockControllerTest.java
index dc7525c8e256..285949a41fcd 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/BiometricsUnlockControllerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/BiometricsUnlockControllerTest.java
@@ -37,11 +37,11 @@ import android.hardware.biometrics.BiometricSourceType;
import android.os.Handler;
import android.os.PowerManager;
import android.os.UserHandle;
-import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper.RunWithLooper;
import android.testing.TestableResources;
import android.view.ViewRootImpl;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.SmallTest;
import com.android.internal.logging.MetricsLogger;
@@ -77,7 +77,7 @@ import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
@SmallTest
-@RunWith(AndroidTestingRunner.class)
+@RunWith(AndroidJUnit4.class)
@RunWithLooper
public class BiometricsUnlockControllerTest extends SysuiTestCase {
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/CentralSurfacesCommandQueueCallbacksTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/CentralSurfacesCommandQueueCallbacksTest.java
index fe6a88d00374..5675915506a5 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/CentralSurfacesCommandQueueCallbacksTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/CentralSurfacesCommandQueueCallbacksTest.java
@@ -30,9 +30,9 @@ import android.content.ComponentName;
import android.os.PowerManager;
import android.os.UserHandle;
import android.os.Vibrator;
-import android.testing.AndroidTestingRunner;
import android.view.HapticFeedbackConstants;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.SmallTest;
import com.android.internal.logging.MetricsLogger;
@@ -71,7 +71,7 @@ import org.mockito.stubbing.Answer;
import java.util.Optional;
@SmallTest
-@RunWith(AndroidTestingRunner.class)
+@RunWith(AndroidJUnit4.class)
public class CentralSurfacesCommandQueueCallbacksTest extends SysuiTestCase {
@Mock private CentralSurfaces mCentralSurfaces;
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 4488799cfd7a..cde241bbe918 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
@@ -57,6 +57,7 @@ import android.app.WallpaperManager;
import android.app.trust.TrustManager;
import android.content.BroadcastReceiver;
import android.content.IntentFilter;
+import android.content.pm.PackageManager;
import android.content.res.Configuration;
import android.graphics.Rect;
import android.hardware.devicestate.DeviceState;
@@ -75,7 +76,6 @@ import android.platform.test.annotations.DisableFlags;
import android.platform.test.annotations.EnableFlags;
import android.service.dreams.IDreamManager;
import android.support.test.metricshelper.MetricsAsserts;
-import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper;
import android.testing.TestableLooper.RunWithLooper;
import android.util.DisplayMetrics;
@@ -85,6 +85,7 @@ import android.view.ViewGroup.LayoutParams;
import android.view.WindowManager;
import android.view.WindowMetrics;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.SmallTest;
import com.android.compose.animation.scene.ObservableTransitionState;
@@ -223,7 +224,7 @@ import java.util.Optional;
import javax.inject.Provider;
@SmallTest
-@RunWith(AndroidTestingRunner.class)
+@RunWith(AndroidJUnit4.class)
@RunWithLooper(setAsMainLooper = true)
@EnableFlags(FLAG_LIGHT_REVEAL_MIGRATION)
public class CentralSurfacesImplTest extends SysuiTestCase {
@@ -339,6 +340,7 @@ public class CentralSurfacesImplTest extends SysuiTestCase {
@Mock private WindowRootViewVisibilityInteractor mWindowRootViewVisibilityInteractor;
@Mock private KeyboardShortcuts mKeyboardShortcuts;
@Mock private KeyboardShortcutListSearch mKeyboardShortcutListSearch;
+ @Mock private PackageManager mPackageManager;
private ShadeController mShadeController;
private final FakeSystemClock mFakeSystemClock = new FakeSystemClock();
@@ -392,7 +394,8 @@ public class CentralSurfacesImplTest extends SysuiTestCase {
mock(UiEventLogger.class),
mUserTracker,
mAvalancheProvider,
- mSystemSettings);
+ mSystemSettings,
+ mPackageManager);
mVisualInterruptionDecisionProvider.start();
mContext.addMockSystemService(TrustManager.class, mock(TrustManager.class));
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/ConfigurationControllerImplTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/ConfigurationControllerImplTest.kt
index 56d23978a5c7..942ea65ec49e 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/ConfigurationControllerImplTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/ConfigurationControllerImplTest.kt
@@ -21,7 +21,7 @@ import android.content.res.Configuration.UI_MODE_NIGHT_NO
import android.content.res.Configuration.UI_MODE_NIGHT_YES
import android.content.res.Configuration.UI_MODE_TYPE_CAR
import android.os.LocaleList
-import android.testing.AndroidTestingRunner
+import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.systemui.SysuiTestCase
import com.android.systemui.statusbar.policy.ConfigurationController.ConfigurationListener
@@ -36,7 +36,7 @@ import org.mockito.Mockito.never
import org.mockito.Mockito.verify
import java.util.Locale
-@RunWith(AndroidTestingRunner::class)
+@RunWith(AndroidJUnit4::class)
@SmallTest
class ConfigurationControllerImplTest : SysuiTestCase() {
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/DozeScrimControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/DozeScrimControllerTest.java
index 34c43ef52a00..3b3ec263145a 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/DozeScrimControllerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/DozeScrimControllerTest.java
@@ -20,9 +20,9 @@ import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.verify;
-import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.SmallTest;
import com.android.systemui.SysuiTestCase;
@@ -36,7 +36,7 @@ import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
-@RunWith(AndroidTestingRunner.class)
+@RunWith(AndroidJUnit4.class)
@TestableLooper.RunWithLooper
@SmallTest
public class DozeScrimControllerTest extends SysuiTestCase {
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 5d42d5167c27..a3e2d1949a29 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
@@ -16,7 +16,7 @@
package com.android.systemui.statusbar.phone
import android.hardware.devicestate.DeviceState
-import android.testing.AndroidTestingRunner
+import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.internal.R
import com.android.systemui.SysuiTestCase
@@ -30,7 +30,7 @@ import org.mockito.Mockito.times
import org.mockito.Mockito.verify
import org.mockito.MockitoAnnotations.initMocks
-@RunWith(AndroidTestingRunner::class)
+@RunWith(AndroidJUnit4::class)
@SmallTest
class FoldStateListenerTest : SysuiTestCase() {
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/HeadsUpAppearanceControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/HeadsUpAppearanceControllerTest.java
index 3e9006e5268c..0d06b6431e1c 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/HeadsUpAppearanceControllerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/HeadsUpAppearanceControllerTest.java
@@ -26,12 +26,12 @@ import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import android.platform.test.annotations.DisableFlags;
-import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper;
import android.testing.TestableLooper.RunWithLooper;
import android.view.View;
import android.widget.TextView;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.SmallTest;
import com.android.systemui.SysuiTestCase;
@@ -62,7 +62,7 @@ import org.junit.runner.RunWith;
import java.util.Optional;
@SmallTest
-@RunWith(AndroidTestingRunner.class)
+@RunWith(AndroidJUnit4.class)
@RunWithLooper
public class HeadsUpAppearanceControllerTest extends SysuiTestCase {
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/KeyguardClockPositionAlgorithmTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/KeyguardClockPositionAlgorithmTest.java
index e8346933f192..cf87afbbff34 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/KeyguardClockPositionAlgorithmTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/KeyguardClockPositionAlgorithmTest.java
@@ -28,8 +28,8 @@ import static org.mockito.Mockito.when;
import android.content.res.Resources;
import android.platform.test.annotations.DisableFlags;
import android.platform.test.annotations.EnableFlags;
-import android.testing.AndroidTestingRunner;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.SmallTest;
import com.android.systemui.Flags;
@@ -50,7 +50,7 @@ import org.mockito.MockitoSession;
import org.mockito.quality.Strictness;
@SmallTest
-@RunWith(AndroidTestingRunner.class)
+@RunWith(AndroidJUnit4.class)
public class KeyguardClockPositionAlgorithmTest extends SysuiTestCase {
private static final int SCREEN_HEIGHT = 2000;
private static final int EMPTY_HEIGHT = 0;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/KeyguardDismissUtilTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/KeyguardDismissUtilTest.java
index b0aa2d3934cc..d880becaa4bd 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/KeyguardDismissUtilTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/KeyguardDismissUtilTest.java
@@ -20,8 +20,8 @@ import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
-import android.testing.AndroidTestingRunner;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.SmallTest;
import com.android.systemui.SysuiTestCase;
@@ -35,7 +35,7 @@ import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
-@RunWith(AndroidTestingRunner.class)
+@RunWith(AndroidJUnit4.class)
@SmallTest
public class KeyguardDismissUtilTest extends SysuiTestCase {
@Mock
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/KeyguardIndicationTextViewTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/KeyguardIndicationTextViewTest.java
index 5cea931e2070..109cd948b5b3 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/KeyguardIndicationTextViewTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/KeyguardIndicationTextViewTest.java
@@ -21,10 +21,10 @@ import static android.view.View.ACCESSIBILITY_LIVE_REGION_POLITE;
import static com.google.common.truth.Truth.assertThat;
-import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper;
import android.view.View;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.SmallTest;
import com.android.systemui.SysuiTestCase;
@@ -35,7 +35,7 @@ import org.junit.Test;
import org.junit.runner.RunWith;
@SmallTest
-@RunWith(AndroidTestingRunner.class)
+@RunWith(AndroidJUnit4.class)
@TestableLooper.RunWithLooper
public class KeyguardIndicationTextViewTest extends SysuiTestCase {
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/KeyguardStatusBarViewControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/KeyguardStatusBarViewControllerTest.java
index 5b2526e22679..f3d640758cf3 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/KeyguardStatusBarViewControllerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/KeyguardStatusBarViewControllerTest.java
@@ -42,11 +42,11 @@ import android.os.UserManager;
import android.platform.test.annotations.DisableFlags;
import android.platform.test.annotations.EnableFlags;
import android.provider.Settings;
-import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper;
import android.view.LayoutInflater;
import android.view.View;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.SmallTest;
import com.android.keyguard.CarrierTextController;
@@ -99,7 +99,7 @@ import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
@SmallTest
-@RunWith(AndroidTestingRunner.class)
+@RunWith(AndroidJUnit4.class)
@TestableLooper.RunWithLooper
public class KeyguardStatusBarViewControllerTest extends SysuiTestCase {
@Mock
@@ -181,6 +181,7 @@ public class KeyguardStatusBarViewControllerTest extends SysuiTestCase {
mViewModel =
new KeyguardStatusBarViewModel(
mTestScope.getBackgroundScope(),
+ mKosmos.getHeadsUpNotificationInteractor(),
mKeyguardInteractor,
new KeyguardStatusBarInteractor(new FakeKeyguardStatusBarRepository()),
mBatteryController);
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/KeyguardStatusBarViewTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/KeyguardStatusBarViewTest.java
index c44f979fa971..0932a0c9307c 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/KeyguardStatusBarViewTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/KeyguardStatusBarViewTest.java
@@ -18,11 +18,11 @@ package com.android.systemui.statusbar.phone;
import static com.google.common.truth.Truth.assertThat;
-import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper;
import android.view.LayoutInflater;
import android.view.View;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.SmallTest;
import com.android.systemui.SysuiTestCase;
@@ -33,7 +33,7 @@ import org.junit.Test;
import org.junit.runner.RunWith;
@SmallTest
-@RunWith(AndroidTestingRunner.class)
+@RunWith(AndroidJUnit4.class)
@TestableLooper.RunWithLooper
public class KeyguardStatusBarViewTest extends SysuiTestCase {
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/LegacyLightsOutNotifControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/LegacyLightsOutNotifControllerTest.java
index f91064b49e95..782ca91bc8fb 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/LegacyLightsOutNotifControllerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/LegacyLightsOutNotifControllerTest.java
@@ -26,7 +26,6 @@ import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import android.platform.test.annotations.DisableFlags;
-import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper.RunWithLooper;
import android.view.Display;
import android.view.View;
@@ -35,6 +34,7 @@ import android.view.WindowInsets;
import android.view.WindowManager;
import androidx.lifecycle.Observer;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.SmallTest;
import com.android.systemui.SysuiTestCase;
@@ -54,7 +54,7 @@ import org.mockito.MockitoAnnotations;
import java.util.Objects;
@SmallTest
-@RunWith(AndroidTestingRunner.class)
+@RunWith(AndroidJUnit4.class)
@RunWithLooper
@DisableFlags(NotificationsLiveDataStoreRefactor.FLAG_NAME)
public class LegacyLightsOutNotifControllerTest extends SysuiTestCase {
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/LegacyNotificationIconAreaControllerImplTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/LegacyNotificationIconAreaControllerImplTest.java
index 9d53b9c66b33..fea0e72fe577 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/LegacyNotificationIconAreaControllerImplTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/LegacyNotificationIconAreaControllerImplTest.java
@@ -21,9 +21,9 @@ import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import android.platform.test.annotations.DisableFlags;
-import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.SmallTest;
import com.android.systemui.Flags;
@@ -49,7 +49,7 @@ import org.mockito.MockitoAnnotations;
import java.util.Optional;
@SmallTest
-@RunWith(AndroidTestingRunner.class)
+@RunWith(AndroidJUnit4.class)
@TestableLooper.RunWithLooper
@DisableFlags(NotificationIconContainerRefactor.FLAG_NAME)
public class LegacyNotificationIconAreaControllerImplTest extends SysuiTestCase {
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/LetterboxAppearanceCalculatorTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/LetterboxAppearanceCalculatorTest.kt
index e7b287c5bdc8..518b327036cb 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/LetterboxAppearanceCalculatorTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/LetterboxAppearanceCalculatorTest.kt
@@ -18,9 +18,9 @@ package com.android.systemui.statusbar.phone
import android.graphics.Color
import android.graphics.Rect
-import android.testing.AndroidTestingRunner
import android.view.WindowInsetsController
import android.view.WindowInsetsController.APPEARANCE_SEMI_TRANSPARENT_STATUS_BARS
+import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.internal.statusbar.LetterboxDetails
import com.android.internal.view.AppearanceRegion
@@ -36,7 +36,7 @@ import org.mockito.Mock
import org.mockito.Mockito.`when` as whenever
import org.mockito.MockitoAnnotations
-@RunWith(AndroidTestingRunner::class)
+@RunWith(AndroidJUnit4::class)
@SmallTest
class LetterboxAppearanceCalculatorTest : SysuiTestCase() {
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/LetterboxBackgroundProviderTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/LetterboxBackgroundProviderTest.kt
index 1cc0bd3cb36c..788c2cb2a485 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/LetterboxBackgroundProviderTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/LetterboxBackgroundProviderTest.kt
@@ -21,8 +21,8 @@ import android.app.WallpaperManager.OnColorsChangedListener
import android.graphics.Color
import android.os.Handler
import android.os.Looper
-import android.testing.AndroidTestingRunner
import android.view.IWindowManager
+import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.systemui.SysuiTestCase
import com.android.systemui.util.concurrency.FakeExecutor
@@ -40,7 +40,7 @@ import org.mockito.Mockito.doAnswer
import org.mockito.Mockito.`when` as whenever
import org.mockito.MockitoAnnotations
-@RunWith(AndroidTestingRunner::class)
+@RunWith(AndroidJUnit4::class)
@SmallTest
class LetterboxBackgroundProviderTest : SysuiTestCase() {
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/LightBarControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/LightBarControllerTest.java
index 7271a5efc377..a27073c77eb4 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/LightBarControllerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/LightBarControllerTest.java
@@ -35,10 +35,10 @@ import static org.mockito.Mockito.when;
import android.graphics.Color;
import android.graphics.Rect;
-import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper;
import androidx.annotation.ColorInt;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.SmallTest;
import com.android.internal.colorextraction.ColorExtractor.GradientColors;
@@ -67,7 +67,7 @@ import java.util.Arrays;
import java.util.List;
@SmallTest
-@RunWith(AndroidTestingRunner.class)
+@RunWith(AndroidJUnit4.class)
@TestableLooper.RunWithLooper
public class LightBarControllerTest extends SysuiTestCase {
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/LightBarTransitionsControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/LightBarTransitionsControllerTest.java
index f71114d92aa3..43c19b833646 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/LightBarTransitionsControllerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/LightBarTransitionsControllerTest.java
@@ -28,9 +28,9 @@ import static org.mockito.Mockito.reset;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
-import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.SmallTest;
import com.android.internal.policy.GestureNavigationSettingsObserver;
@@ -48,7 +48,7 @@ import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
@SmallTest
-@RunWith(AndroidTestingRunner.class)
+@RunWith(AndroidJUnit4.class)
@TestableLooper.RunWithLooper
public class LightBarTransitionsControllerTest extends SysuiTestCase {
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationIconContainerTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationIconContainerTest.kt
index 9f4e1dd8cc4d..9d97e5a5686e 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationIconContainerTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationIconContainerTest.kt
@@ -16,8 +16,8 @@
package com.android.systemui.statusbar.phone
import android.service.notification.StatusBarNotification
-import android.testing.AndroidTestingRunner
import android.testing.TestableLooper.RunWithLooper
+import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.systemui.SysuiTestCase
import com.android.systemui.statusbar.StatusBarIconView
@@ -34,7 +34,7 @@ import org.mockito.Mockito.`when` as whenever
/** Tests for {@link NotificationIconContainer}. */
@SmallTest
-@RunWith(AndroidTestingRunner::class)
+@RunWith(AndroidJUnit4::class)
@RunWithLooper
class NotificationIconContainerTest : SysuiTestCase() {
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationTapHelperTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationTapHelperTest.java
index ccd1a8c7a9b2..9522e1f65a4c 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationTapHelperTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationTapHelperTest.java
@@ -22,11 +22,11 @@ import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import android.content.res.Resources;
-import android.testing.AndroidTestingRunner;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewConfiguration;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.SmallTest;
import com.android.systemui.SysuiTestCase;
@@ -42,7 +42,7 @@ import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
@SmallTest
-@RunWith(AndroidTestingRunner.class)
+@RunWith(AndroidJUnit4.class)
public class NotificationTapHelperTest extends SysuiTestCase {
private NotificationTapHelper mNotificationTapHelper;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/PhoneStatusBarPolicyTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/PhoneStatusBarPolicyTest.kt
index 8d2c1588fb62..f2f336c45d7f 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/PhoneStatusBarPolicyTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/PhoneStatusBarPolicyTest.kt
@@ -22,9 +22,9 @@ import android.app.admin.DevicePolicyResourcesManager
import android.content.SharedPreferences
import android.os.UserManager
import android.telecom.TelecomManager
-import android.testing.AndroidTestingRunner
import android.testing.TestableLooper
import android.testing.TestableLooper.RunWithLooper
+import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.systemui.SysuiTestCase
import com.android.systemui.broadcast.BroadcastDispatcher
@@ -79,7 +79,7 @@ import org.mockito.Mockito.verify
import org.mockito.Mockito.`when` as whenever
import org.mockito.MockitoAnnotations
-@RunWith(AndroidTestingRunner::class)
+@RunWith(AndroidJUnit4::class)
@RunWithLooper
@OptIn(ExperimentalCoroutinesApi::class)
@SmallTest
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 1000329cb276..416a869bf2f0 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
@@ -49,12 +49,12 @@ import android.content.Context;
import android.content.res.ColorStateList;
import android.content.res.TypedArray;
import android.graphics.Color;
-import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper;
import android.testing.ViewUtils;
import android.util.MathUtils;
import android.view.View;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.SmallTest;
import com.android.internal.colorextraction.ColorExtractor.GradientColors;
@@ -107,7 +107,7 @@ import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
-@RunWith(AndroidTestingRunner.class)
+@RunWith(AndroidJUnit4.class)
@TestableLooper.RunWithLooper(setAsMainLooper = true)
@SmallTest
public class ScrimControllerTest extends SysuiTestCase {
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarBoundsProviderTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarBoundsProviderTest.kt
index 61da701ce971..b9cfe21dcad3 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarBoundsProviderTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarBoundsProviderTest.kt
@@ -17,10 +17,10 @@
package com.android.systemui.statusbar.phone
import android.graphics.Rect
-import android.testing.AndroidTestingRunner
import android.testing.TestableLooper.RunWithLooper
import android.view.View
import android.widget.FrameLayout
+import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.systemui.SysuiTestCase
import com.android.systemui.statusbar.phone.StatusBarBoundsProvider.BoundsChangeListener
@@ -37,7 +37,7 @@ import org.mockito.Mockito.spy
import org.mockito.Mockito.verify
import org.mockito.MockitoAnnotations
-@RunWith(AndroidTestingRunner::class)
+@RunWith(AndroidJUnit4::class)
@RunWithLooper(setAsMainLooper = true)
@SmallTest
class StatusBarBoundsProviderTest : SysuiTestCase() {
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManagerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManagerTest.java
index 6b3c0053e738..3ca4c594cede 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManagerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManagerTest.java
@@ -41,7 +41,6 @@ import android.platform.test.annotations.RequiresFlagsEnabled;
import android.platform.test.flag.junit.CheckFlagsRule;
import android.platform.test.flag.junit.DeviceFlagsValueProvider;
import android.service.trust.TrustAgentService;
-import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper;
import android.view.MotionEvent;
import android.view.View;
@@ -55,6 +54,7 @@ import android.window.OnBackInvokedCallback;
import android.window.OnBackInvokedDispatcher;
import android.window.WindowOnBackInvokedDispatcher;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.SmallTest;
import com.android.internal.util.LatencyTracker;
@@ -119,7 +119,7 @@ import org.mockito.MockitoAnnotations;
import java.util.Optional;
@SmallTest
-@RunWith(AndroidTestingRunner.class)
+@RunWith(AndroidJUnit4.class)
@TestableLooper.RunWithLooper
public class StatusBarKeyguardViewManagerTest extends SysuiTestCase {
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarNotificationActivityStarterTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarNotificationActivityStarterTest.java
index 269510e0b4b2..9fa392f3a337 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarNotificationActivityStarterTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarNotificationActivityStarterTest.java
@@ -51,9 +51,9 @@ import android.os.RemoteException;
import android.os.UserHandle;
import android.service.dreams.IDreamManager;
import android.service.notification.StatusBarNotification;
-import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.SmallTest;
import com.android.internal.jank.InteractionJankMonitor;
@@ -119,7 +119,7 @@ import java.util.List;
import java.util.Optional;
@SmallTest
-@RunWith(AndroidTestingRunner.class)
+@RunWith(AndroidJUnit4.class)
@TestableLooper.RunWithLooper(setAsMainLooper = true)
public class StatusBarNotificationActivityStarterTest extends SysuiTestCase {
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarNotificationPresenterTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarNotificationPresenterTest.java
index a8c5fc357c7c..95472cad4b90 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarNotificationPresenterTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarNotificationPresenterTest.java
@@ -34,10 +34,10 @@ import android.app.PendingIntent;
import android.app.StatusBarManager;
import android.platform.test.annotations.DisableFlags;
import android.platform.test.annotations.EnableFlags;
-import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper;
import android.testing.TestableLooper.RunWithLooper;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.SmallTest;
import com.android.systemui.InitController;
@@ -85,7 +85,7 @@ import java.util.List;
import java.util.Set;
@SmallTest
-@RunWith(AndroidTestingRunner.class)
+@RunWith(AndroidJUnit4.class)
@RunWithLooper()
public class StatusBarNotificationPresenterTest extends SysuiTestCase {
private StatusBarNotificationPresenter mStatusBarNotificationPresenter;
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarRemoteInputCallbackTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarRemoteInputCallbackTest.java
index 929099a8f1f7..35888a5fa734 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarRemoteInputCallbackTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarRemoteInputCallbackTest.java
@@ -24,10 +24,10 @@ import static org.mockito.Mockito.when;
import static org.mockito.internal.verification.VerificationModeFactory.times;
import android.content.Intent;
-import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper;
import android.view.View;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.SmallTest;
import com.android.systemui.SysuiTestCase;
@@ -52,7 +52,7 @@ import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
@SmallTest
-@RunWith(AndroidTestingRunner.class)
+@RunWith(AndroidJUnit4.class)
@TestableLooper.RunWithLooper
public class StatusBarRemoteInputCallbackTest extends SysuiTestCase {
@Mock private DeviceProvisionedController mDeviceProvisionedController;
@@ -103,4 +103,4 @@ public class StatusBarRemoteInputCallbackTest extends SysuiTestCase {
verify(mStatusBarKeyguardViewManager).showBouncer(true);
}
-} \ No newline at end of file
+}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusOverlayHoverListenerTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusOverlayHoverListenerTest.kt
index 1455693fc54b..11dd587a04ad 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusOverlayHoverListenerTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusOverlayHoverListenerTest.kt
@@ -21,7 +21,6 @@ import android.graphics.Color
import android.graphics.drawable.Drawable
import android.graphics.drawable.PaintDrawable
import android.os.SystemClock
-import android.testing.AndroidTestingRunner
import android.testing.TestableLooper
import android.testing.TestableLooper.RunWithLooper
import android.testing.ViewUtils
@@ -30,6 +29,7 @@ import android.view.View
import android.view.ViewGroupOverlay
import android.widget.LinearLayout
import androidx.annotation.ColorInt
+import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.systemui.res.R
import com.android.systemui.SysuiTestCase
@@ -45,7 +45,7 @@ import org.junit.Test
import org.junit.runner.RunWith
import org.mockito.Mockito.verify
-@RunWith(AndroidTestingRunner::class)
+@RunWith(AndroidJUnit4::class)
@RunWithLooper(setAsMainLooper = true)
@SmallTest
class StatusOverlayHoverListenerTest : SysuiTestCase() {
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/SystemUIBottomSheetDialogTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/SystemUIBottomSheetDialogTest.kt
index dedd0afb6127..b560c591af1e 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/SystemUIBottomSheetDialogTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/SystemUIBottomSheetDialogTest.kt
@@ -15,9 +15,9 @@ package com.android.systemui.statusbar.phone
import android.app.Dialog
import android.content.res.Configuration
-import android.testing.AndroidTestingRunner
import android.testing.TestableLooper.RunWithLooper
import android.view.WindowManager
+import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.systemui.SysuiTestCase
import com.android.systemui.kosmos.testScope
@@ -39,7 +39,7 @@ import org.mockito.Mockito.verify
@OptIn(ExperimentalCoroutinesApi::class)
@SmallTest
-@RunWith(AndroidTestingRunner::class)
+@RunWith(AndroidJUnit4::class)
@RunWithLooper(setAsMainLooper = true)
class SystemUIBottomSheetDialogTest : SysuiTestCase() {
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/UnlockedScreenOffAnimationControllerTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/UnlockedScreenOffAnimationControllerTest.kt
index c8ff20b31aae..624c070e95e0 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/UnlockedScreenOffAnimationControllerTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/UnlockedScreenOffAnimationControllerTest.kt
@@ -18,9 +18,9 @@ package com.android.systemui.statusbar.phone
import android.os.Handler
import android.os.PowerManager
-import android.testing.AndroidTestingRunner
import android.testing.TestableLooper.RunWithLooper
import android.view.Display
+import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.internal.jank.InteractionJankMonitor
import com.android.systemui.SysuiTestCase
@@ -51,7 +51,7 @@ import org.mockito.Mockito.`when`
import org.mockito.MockitoAnnotations
@SmallTest
-@RunWith(AndroidTestingRunner::class)
+@RunWith(AndroidJUnit4::class)
@RunWithLooper(setAsMainLooper = true)
class UnlockedScreenOffAnimationControllerTest : SysuiTestCase() {
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/MobileRepositorySwitcherTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/MobileRepositorySwitcherTest.kt
index 598b12ccdc38..eb2538ec032e 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/MobileRepositorySwitcherTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/MobileRepositorySwitcherTest.kt
@@ -20,6 +20,7 @@ import android.telephony.SubscriptionInfo
import android.telephony.SubscriptionManager
import android.telephony.SubscriptionManager.PROFILE_CLASS_UNSET
import android.telephony.TelephonyManager
+import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.systemui.SysuiTestCase
import com.android.systemui.demomode.DemoMode
@@ -60,7 +61,6 @@ import org.junit.After
import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
-import org.junit.runners.JUnit4
import org.mockito.Mock
import org.mockito.Mockito.verify
import org.mockito.MockitoAnnotations
@@ -73,7 +73,7 @@ import org.mockito.MockitoAnnotations
@Suppress("EXPERIMENTAL_IS_NOT_ENABLED")
@OptIn(ExperimentalCoroutinesApi::class)
@SmallTest
-@RunWith(JUnit4::class)
+@RunWith(AndroidJUnit4::class)
class MobileRepositorySwitcherTest : SysuiTestCase() {
private lateinit var underTest: MobileRepositorySwitcher
private lateinit var realRepo: MobileConnectionsRepositoryImpl
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/prod/CarrierMergedConnectionRepositoryTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/prod/CarrierMergedConnectionRepositoryTest.kt
index 265440154d77..237aabccfbd9 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/prod/CarrierMergedConnectionRepositoryTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/pipeline/mobile/data/repository/prod/CarrierMergedConnectionRepositoryTest.kt
@@ -17,7 +17,7 @@
package com.android.systemui.statusbar.pipeline.mobile.data.repository.prod
import android.telephony.TelephonyManager
-import android.testing.AndroidTestingRunner
+import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.systemui.SysuiTestCase
import com.android.systemui.coroutines.collectLastValue
@@ -44,7 +44,7 @@ import org.mockito.MockitoAnnotations
@SmallTest
@OptIn(ExperimentalCoroutinesApi::class)
-@RunWith(AndroidTestingRunner::class)
+@RunWith(AndroidJUnit4::class)
class CarrierMergedConnectionRepositoryTest : SysuiTestCase() {
private lateinit var underTest: CarrierMergedConnectionRepository
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/BaseUserSwitcherAdapterTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/BaseUserSwitcherAdapterTest.kt
index d1c38f6cbea7..0a5e63085b9b 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/BaseUserSwitcherAdapterTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/BaseUserSwitcherAdapterTest.kt
@@ -22,6 +22,7 @@ import android.graphics.Bitmap
import android.os.UserHandle
import android.view.View
import android.view.ViewGroup
+import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.systemui.SysuiTestCase
import com.android.systemui.qs.user.UserSwitchDialogController
@@ -33,14 +34,13 @@ import java.lang.ref.WeakReference
import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
-import org.junit.runners.JUnit4
import org.mockito.Mock
import org.mockito.Mockito.verify
import org.mockito.Mockito.`when` as whenever
import org.mockito.MockitoAnnotations
@SmallTest
-@RunWith(JUnit4::class)
+@RunWith(AndroidJUnit4::class)
class BaseUserSwitcherAdapterTest : SysuiTestCase() {
@Mock private lateinit var controller: UserSwitcherController
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/DeviceControlsControllerImplTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/DeviceControlsControllerImplTest.kt
index fb4ccb52929a..c22c62825d04 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/DeviceControlsControllerImplTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/DeviceControlsControllerImplTest.kt
@@ -20,8 +20,8 @@ import android.content.ComponentName
import android.content.Context
import android.content.pm.ServiceInfo
import android.provider.Settings
-import android.testing.AndroidTestingRunner
+import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.systemui.res.R
@@ -60,7 +60,7 @@ import org.mockito.ArgumentMatchers.anyInt
import org.mockito.ArgumentMatchers.anyObject
@SmallTest
-@RunWith(AndroidTestingRunner::class)
+@RunWith(AndroidJUnit4::class)
class DeviceControlsControllerImplTest : SysuiTestCase() {
@Mock
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 2955162f80c2..f6e07d3d621e 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
@@ -29,10 +29,10 @@ import android.hardware.devicestate.DeviceState;
import android.hardware.devicestate.DeviceStateManager;
import android.os.UserHandle;
import android.provider.Settings;
-import android.testing.AndroidTestingRunner;
import android.testing.TestableContentResolver;
import android.testing.TestableResources;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.SmallTest;
import com.android.internal.R;
@@ -51,7 +51,7 @@ import org.mockito.ArgumentCaptor;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
-@RunWith(AndroidTestingRunner.class)
+@RunWith(AndroidJUnit4.class)
@SmallTest
public class DeviceStateRotationLockSettingControllerTest extends SysuiTestCase {
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/FlashlightControllerImplTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/FlashlightControllerImplTest.kt
index 1c54263cb0ce..80cc6eca8405 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/FlashlightControllerImplTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/FlashlightControllerImplTest.kt
@@ -20,8 +20,8 @@ import android.content.pm.PackageManager
import android.hardware.camera2.CameraCharacteristics
import android.hardware.camera2.CameraManager
import android.hardware.camera2.impl.CameraMetadataNative
+import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
-import android.testing.AndroidTestingRunner
import com.android.systemui.SysuiTestCase
import com.android.systemui.broadcast.BroadcastSender
import com.android.systemui.dump.DumpManager
@@ -46,7 +46,7 @@ import org.mockito.Mockito.`when`
import org.mockito.MockitoAnnotations
@SmallTest
-@RunWith(AndroidTestingRunner::class)
+@RunWith(AndroidJUnit4::class)
class FlashlightControllerImplTest : SysuiTestCase() {
@Mock
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/KeyguardUserSwitcherAdapterTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/KeyguardUserSwitcherAdapterTest.kt
index 0bd6a685708b..9f74915b4d1b 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/KeyguardUserSwitcherAdapterTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/KeyguardUserSwitcherAdapterTest.kt
@@ -19,10 +19,10 @@ package com.android.systemui.statusbar.policy
import android.content.Context
import android.content.pm.UserInfo
import android.graphics.Bitmap
-import android.testing.AndroidTestingRunner
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
+import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.internal.util.UserIcons
import com.android.systemui.res.R
@@ -44,7 +44,7 @@ import org.mockito.Mockito.verify
import org.mockito.Mockito.`when`
import org.mockito.MockitoAnnotations
-@RunWith(AndroidTestingRunner::class)
+@RunWith(AndroidJUnit4::class)
@SmallTest
class KeyguardUserSwitcherAdapterTest : SysuiTestCase() {
@Mock
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/SafetyControllerTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/SafetyControllerTest.kt
index b03edaf8ebd5..4b14e642063a 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/SafetyControllerTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/SafetyControllerTest.kt
@@ -23,7 +23,7 @@ import android.content.pm.PackageManager
import android.net.Uri
import android.os.Handler
import android.safetycenter.SafetyCenterManager
-import android.testing.AndroidTestingRunner
+import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.systemui.SysuiTestCase
import com.android.systemui.util.mockito.any
@@ -44,7 +44,7 @@ import org.mockito.Mockito.verify
import org.mockito.Mockito.`when`
@SmallTest
-@RunWith(AndroidTestingRunner::class)
+@RunWith(AndroidJUnit4::class)
class SafetyControllerTest : SysuiTestCase() {
private val TEST_PC_PKG = "testPermissionControllerPackageName"
@@ -188,4 +188,4 @@ class SafetyControllerTest : SysuiTestCase() {
assertThat(called).isTrue()
}
-} \ No newline at end of file
+}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/SensitiveNotificationProtectionControllerFlagDisabledTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/SensitiveNotificationProtectionControllerFlagDisabledTest.kt
index 3e20f689569e..81f095041fbc 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/SensitiveNotificationProtectionControllerFlagDisabledTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/SensitiveNotificationProtectionControllerFlagDisabledTest.kt
@@ -22,7 +22,7 @@ import android.media.projection.MediaProjectionManager
import android.os.Handler
import android.platform.test.annotations.DisableFlags
import android.telephony.TelephonyManager
-import android.testing.AndroidTestingRunner
+import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.server.notification.Flags
import com.android.systemui.SysuiTestCase
@@ -38,7 +38,7 @@ import org.mockito.Mockito.verifyZeroInteractions
import org.mockito.MockitoAnnotations
@SmallTest
-@RunWith(AndroidTestingRunner::class)
+@RunWith(AndroidJUnit4::class)
@DisableFlags(Flags.FLAG_SCREENSHARE_NOTIFICATION_HIDING)
class SensitiveNotificationProtectionControllerFlagDisabledTest : SysuiTestCase() {
private val logger = SensitiveNotificationProtectionControllerLogger(logcatLogBuffer())
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/WalletControllerImplTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/WalletControllerImplTest.kt
index dbc2e3471c28..0249ab8fc9eb 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/WalletControllerImplTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/WalletControllerImplTest.kt
@@ -17,8 +17,8 @@
package com.android.systemui.statusbar.policy
import android.service.quickaccesswallet.QuickAccessWalletClient
-import android.testing.AndroidTestingRunner
+import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.SmallTest
import com.android.systemui.SysuiTestCase
@@ -35,7 +35,7 @@ import org.mockito.MockitoAnnotations
import org.mockito.Mockito.`when`
@SmallTest
-@RunWith(AndroidTestingRunner::class)
+@RunWith(AndroidJUnit4::class)
class WalletControllerImplTest : SysuiTestCase() {
@Mock
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/ui/viewmodel/KeyguardStatusBarViewModelTest.kt b/packages/SystemUI/tests/src/com/android/systemui/statusbar/ui/viewmodel/KeyguardStatusBarViewModelTest.kt
index ab10bc4a4acc..d88289d9132c 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/ui/viewmodel/KeyguardStatusBarViewModelTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/ui/viewmodel/KeyguardStatusBarViewModelTest.kt
@@ -21,12 +21,18 @@ import androidx.test.filters.SmallTest
import com.android.systemui.SysuiTestCase
import com.android.systemui.coroutines.collectLastValue
import com.android.systemui.flags.andSceneContainer
+import com.android.systemui.keyguard.data.repository.fakeDeviceEntryFaceAuthRepository
import com.android.systemui.keyguard.data.repository.fakeKeyguardRepository
-import com.android.systemui.keyguard.data.repository.keyguardRepository
+import com.android.systemui.keyguard.data.repository.fakeKeyguardTransitionRepository
import com.android.systemui.keyguard.domain.interactor.keyguardInteractor
+import com.android.systemui.keyguard.shared.model.KeyguardState
import com.android.systemui.keyguard.shared.model.StatusBarState
import com.android.systemui.kosmos.testScope
import com.android.systemui.statusbar.domain.interactor.keyguardStatusBarInteractor
+import com.android.systemui.statusbar.notification.data.repository.FakeHeadsUpRowRepository
+import com.android.systemui.statusbar.notification.stack.data.repository.headsUpNotificationRepository
+import com.android.systemui.statusbar.notification.stack.data.repository.setNotifications
+import com.android.systemui.statusbar.notification.stack.domain.interactor.headsUpNotificationInteractor
import com.android.systemui.statusbar.policy.BatteryController
import com.android.systemui.statusbar.policy.batteryController
import com.android.systemui.testKosmos
@@ -50,7 +56,11 @@ import platform.test.runner.parameterized.Parameters
class KeyguardStatusBarViewModelTest(flags: FlagsParameterization) : SysuiTestCase() {
private val kosmos = testKosmos()
private val testScope = kosmos.testScope
+ private val faceAuthRepository by lazy { kosmos.fakeDeviceEntryFaceAuthRepository }
+ private val headsUpRepository by lazy { kosmos.headsUpNotificationRepository }
+ private val headsUpNotificationInteractor by lazy { kosmos.headsUpNotificationInteractor }
private val keyguardRepository by lazy { kosmos.fakeKeyguardRepository }
+ private val keyguardTransitionRepository by lazy { kosmos.fakeKeyguardTransitionRepository }
private val keyguardInteractor by lazy { kosmos.keyguardInteractor }
private val keyguardStatusBarInteractor by lazy { kosmos.keyguardStatusBarInteractor }
private val batteryController = kosmos.batteryController
@@ -74,6 +84,7 @@ class KeyguardStatusBarViewModelTest(flags: FlagsParameterization) : SysuiTestCa
underTest =
KeyguardStatusBarViewModel(
testScope.backgroundScope,
+ headsUpNotificationInteractor,
keyguardInteractor,
keyguardStatusBarInteractor,
batteryController,
@@ -112,7 +123,22 @@ class KeyguardStatusBarViewModelTest(flags: FlagsParameterization) : SysuiTestCa
}
@Test
- fun isVisible_statusBarStateKeyguard_andNotDozing_true() =
+ fun isVisible_headsUpStatusBarShown_false() =
+ testScope.runTest {
+ val latest by collectLastValue(underTest.isVisible)
+
+ // WHEN HUN displayed on the bypass lock screen
+ headsUpRepository.setNotifications(FakeHeadsUpRowRepository("key 0", isPinned = true))
+ keyguardTransitionRepository.emitInitialStepsFromOff(KeyguardState.LOCKSCREEN)
+ keyguardRepository.setStatusBarState(StatusBarState.KEYGUARD)
+ faceAuthRepository.isBypassEnabled.value = true
+
+ // THEN KeyguardStatusBar is NOT visible to make space for HeadsUpStatusBar
+ assertThat(latest).isFalse()
+ }
+
+ @Test
+ fun isVisible_statusBarStateKeyguard_andNotDozing_andNotShowingHeadsUpStatusBar_true() =
testScope.runTest {
val latest by collectLastValue(underTest.isVisible)
diff --git a/packages/SystemUI/tests/src/com/android/systemui/theme/ThemeOverlayControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/theme/ThemeOverlayControllerTest.java
index a5e7a67b21a2..5ad88ad1f47c 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/theme/ThemeOverlayControllerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/theme/ThemeOverlayControllerTest.java
@@ -64,6 +64,7 @@ import com.android.systemui.flags.FeatureFlags;
import com.android.systemui.flags.Flags;
import com.android.systemui.keyguard.WakefulnessLifecycle;
import com.android.systemui.keyguard.domain.interactor.KeyguardTransitionInteractor;
+import com.android.systemui.monet.DynamicColors;
import com.android.systemui.monet.Style;
import com.android.systemui.settings.UserTracker;
import com.android.systemui.statusbar.policy.DeviceProvisionedController;
@@ -997,7 +998,7 @@ public class ThemeOverlayControllerTest extends SysuiTestCase {
// All fixed colors were added once
// All custom dynamic tokens added twice
verify(dynamic, times(
- DynamicColors.allDynamicColorsMapped(false).size() * 2
+ DynamicColors.getAllDynamicColorsMapped(false).size() * 2
+ DynamicColors.getFixedColorsMapped(false).size()
+ DynamicColors.getCustomColorsMapped(false).size() * 2)
).setResourceValue(any(String.class), eq(TYPE_INT_COLOR_ARGB8), anyInt(), eq(null));
diff --git a/packages/SystemUI/tests/src/com/android/systemui/unfold/updates/RotationChangeProviderTest.kt b/packages/SystemUI/tests/src/com/android/systemui/unfold/updates/RotationChangeProviderTest.kt
index fd368eb07b5b..eaef0073b6fb 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/unfold/updates/RotationChangeProviderTest.kt
+++ b/packages/SystemUI/tests/src/com/android/systemui/unfold/updates/RotationChangeProviderTest.kt
@@ -18,8 +18,11 @@ package com.android.systemui.unfold.updates
import android.content.Context
import android.hardware.display.DisplayManager
+import android.os.HandlerThread
import android.os.Looper
+import android.os.Process
import android.testing.AndroidTestingRunner
+import android.testing.TestableLooper.RunWithLooper
import android.view.Display
import androidx.test.filters.SmallTest
import com.android.systemui.SysuiTestCase
@@ -40,6 +43,7 @@ import org.mockito.MockitoAnnotations
@RunWith(AndroidTestingRunner::class)
@SmallTest
+@RunWithLooper
class RotationChangeProviderTest : SysuiTestCase() {
private lateinit var rotationChangeProvider: RotationChangeProvider
@@ -48,7 +52,10 @@ class RotationChangeProviderTest : SysuiTestCase() {
@Mock lateinit var listener: RotationListener
@Mock lateinit var display: Display
@Captor lateinit var displayListener: ArgumentCaptor<DisplayManager.DisplayListener>
- private val fakeHandler = FakeHandler(Looper.getMainLooper())
+ private val bgThread =
+ HandlerThread("UnfoldBgTest", Process.THREAD_PRIORITY_FOREGROUND).apply { start() }
+ private val bgHandler = FakeHandler(bgThread.looper)
+ private val callbackHandler = FakeHandler(Looper.getMainLooper())
private lateinit var spyContext: Context
@@ -57,9 +64,10 @@ class RotationChangeProviderTest : SysuiTestCase() {
MockitoAnnotations.initMocks(this)
spyContext = spy(context)
whenever(spyContext.display).thenReturn(display)
- rotationChangeProvider = RotationChangeProvider(displayManager, spyContext, fakeHandler)
+ rotationChangeProvider =
+ RotationChangeProvider(displayManager, spyContext, bgHandler, callbackHandler)
rotationChangeProvider.addCallback(listener)
- fakeHandler.dispatchQueuedMessages()
+ bgHandler.dispatchQueuedMessages()
verify(displayManager).registerDisplayListener(displayListener.capture(), any())
}
@@ -76,7 +84,7 @@ class RotationChangeProviderTest : SysuiTestCase() {
verify(listener).onRotationChanged(42)
rotationChangeProvider.removeCallback(listener)
- fakeHandler.dispatchQueuedMessages()
+ bgHandler.dispatchQueuedMessages()
sendRotationUpdate(43)
verify(displayManager).unregisterDisplayListener(any())
@@ -86,6 +94,6 @@ class RotationChangeProviderTest : SysuiTestCase() {
private fun sendRotationUpdate(newRotation: Int) {
whenever(display.rotation).thenReturn(newRotation)
displayListener.allValues.forEach { it.onDisplayChanged(display.displayId) }
- fakeHandler.dispatchQueuedMessages()
+ callbackHandler.dispatchQueuedMessages()
}
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/util/settings/SettingsProxyTest.kt b/packages/SystemUI/tests/src/com/android/systemui/util/settings/SettingsProxyTest.kt
new file mode 100644
index 000000000000..ab95707046d9
--- /dev/null
+++ b/packages/SystemUI/tests/src/com/android/systemui/util/settings/SettingsProxyTest.kt
@@ -0,0 +1,236 @@
+/*
+ * 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.util.settings
+
+import android.content.ContentResolver
+import android.database.ContentObserver
+import android.net.Uri
+import android.os.Handler
+import android.os.Looper
+import android.provider.Settings.SettingNotFoundException
+import android.testing.AndroidTestingRunner
+import android.testing.TestableLooper
+import androidx.test.filters.SmallTest
+import com.android.systemui.SysuiTestCase
+import com.google.common.truth.Truth.assertThat
+import org.junit.Assert.assertThrows
+import org.junit.Before
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.mockito.Mockito.mock
+import org.mockito.Mockito.verify
+import org.mockito.kotlin.eq
+
+/** Tests for [SettingsProxy]. */
+@RunWith(AndroidTestingRunner::class)
+@SmallTest
+@TestableLooper.RunWithLooper
+class SettingsProxyTest : SysuiTestCase() {
+
+ private lateinit var mSettings: SettingsProxy
+ private lateinit var mContentObserver: ContentObserver
+
+ @Before
+ fun setUp() {
+ mSettings = FakeSettingsProxy()
+ mContentObserver = object : ContentObserver(Handler(Looper.getMainLooper())) {}
+ }
+
+ @Test
+ fun registerContentObserver_inputString_success() {
+ mSettings.registerContentObserver(TEST_SETTING, mContentObserver)
+ verify(mSettings.getContentResolver())
+ .registerContentObserver(eq(TEST_SETTING_URI), eq(false), eq(mContentObserver))
+ }
+
+ @Test
+ fun registerContentObserver_inputString_notifyForDescendants_true() {
+ mSettings.registerContentObserver(
+ TEST_SETTING,
+ notifyForDescendants = true,
+ mContentObserver
+ )
+ verify(mSettings.getContentResolver())
+ .registerContentObserver(eq(TEST_SETTING_URI), eq(true), eq(mContentObserver))
+ }
+
+ @Test
+ fun registerContentObserver_inputUri_success() {
+ mSettings.registerContentObserver(TEST_SETTING_URI, mContentObserver)
+ verify(mSettings.getContentResolver())
+ .registerContentObserver(eq(TEST_SETTING_URI), eq(false), eq(mContentObserver))
+ }
+
+ @Test
+ fun registerContentObserver_inputUri_notifyForDescendants_true() {
+ mSettings.registerContentObserver(
+ TEST_SETTING_URI,
+ notifyForDescendants = true,
+ mContentObserver
+ )
+ verify(mSettings.getContentResolver())
+ .registerContentObserver(eq(TEST_SETTING_URI), eq(true), eq(mContentObserver))
+ }
+
+ @Test
+ fun unregisterContentObserver() {
+ mSettings.unregisterContentObserver(mContentObserver)
+ verify(mSettings.getContentResolver()).unregisterContentObserver(eq(mContentObserver))
+ }
+
+ @Test
+ fun getString_keyPresent_returnValidValue() {
+ mSettings.putString(TEST_SETTING, "test")
+ assertThat(mSettings.getString(TEST_SETTING)).isEqualTo("test")
+ }
+
+ @Test
+ fun getString_keyAbsent_returnEmptyValue() {
+ assertThat(mSettings.getString(TEST_SETTING)).isEmpty()
+ }
+
+ @Test
+ fun getInt_keyPresent_returnValidValue() {
+ mSettings.putInt(TEST_SETTING, 2)
+ assertThat(mSettings.getInt(TEST_SETTING)).isEqualTo(2)
+ }
+
+ @Test
+ fun getInt_keyPresent_nonIntegerValue_throwException() {
+ assertThrows(SettingNotFoundException::class.java) {
+ mSettings.putString(TEST_SETTING, "test")
+ mSettings.getInt(TEST_SETTING)
+ }
+ }
+
+ @Test
+ fun getInt_keyAbsent_throwException() {
+ assertThrows(SettingNotFoundException::class.java) { mSettings.getInt(TEST_SETTING) }
+ }
+
+ @Test
+ fun getInt_keyAbsent_returnDefaultValue() {
+ assertThat(mSettings.getInt(TEST_SETTING, 5)).isEqualTo(5)
+ }
+
+ @Test
+ fun getBool_keyPresent_returnValidValue() {
+ mSettings.putBool(TEST_SETTING, true)
+ assertThat(mSettings.getBool(TEST_SETTING)).isTrue()
+ }
+
+ @Test
+ fun getBool_keyPresent_nonBooleanValue_throwException() {
+ assertThrows(SettingNotFoundException::class.java) {
+ mSettings.putString(TEST_SETTING, "test")
+ mSettings.getBool(TEST_SETTING)
+ }
+ }
+
+ @Test
+ fun getBool_keyAbsent_throwException() {
+ assertThrows(SettingNotFoundException::class.java) { mSettings.getBool(TEST_SETTING) }
+ }
+
+ @Test
+ fun getBool_keyAbsent_returnDefaultValue() {
+ assertThat(mSettings.getBool(TEST_SETTING, false)).isEqualTo(false)
+ }
+
+ @Test
+ fun getLong_keyPresent_returnValidValue() {
+ mSettings.putLong(TEST_SETTING, 1L)
+ assertThat(mSettings.getLong(TEST_SETTING)).isEqualTo(1L)
+ }
+
+ @Test
+ fun getLong_keyPresent_nonLongValue_throwException() {
+ assertThrows(SettingNotFoundException::class.java) {
+ mSettings.putString(TEST_SETTING, "test")
+ mSettings.getLong(TEST_SETTING)
+ }
+ }
+
+ @Test
+ fun getLong_keyAbsent_throwException() {
+ assertThrows(SettingNotFoundException::class.java) { mSettings.getLong(TEST_SETTING) }
+ }
+
+ @Test
+ fun getLong_keyAbsent_returnDefaultValue() {
+ assertThat(mSettings.getLong(TEST_SETTING, 2L)).isEqualTo(2L)
+ }
+
+ @Test
+ fun getFloat_keyPresent_returnValidValue() {
+ mSettings.putFloat(TEST_SETTING, 2.5F)
+ assertThat(mSettings.getFloat(TEST_SETTING)).isEqualTo(2.5F)
+ }
+
+ @Test
+ fun getFloat_keyPresent_nonFloatValue_throwException() {
+ assertThrows(SettingNotFoundException::class.java) {
+ mSettings.putString(TEST_SETTING, "test")
+ mSettings.getFloat(TEST_SETTING)
+ }
+ }
+
+ @Test
+ fun getFloat_keyAbsent_throwException() {
+ assertThrows(SettingNotFoundException::class.java) { mSettings.getFloat(TEST_SETTING) }
+ }
+
+ @Test
+ fun getFloat_keyAbsent_returnDefaultValue() {
+ assertThat(mSettings.getFloat(TEST_SETTING, 2.5F)).isEqualTo(2.5F)
+ }
+
+ private class FakeSettingsProxy : SettingsProxy {
+
+ private val mContentResolver = mock(ContentResolver::class.java)
+ private val settingToValueMap: MutableMap<String, String> = mutableMapOf()
+
+ override fun getContentResolver() = mContentResolver
+
+ override fun getUriFor(name: String) =
+ Uri.parse(StringBuilder().append("content://settings/").append(name).toString())
+
+ override fun getString(name: String): String {
+ return settingToValueMap[name] ?: ""
+ }
+
+ override fun putString(name: String, value: String): Boolean {
+ settingToValueMap[name] = value
+ return true
+ }
+
+ override fun putString(
+ name: String,
+ value: String,
+ tag: String,
+ makeDefault: Boolean
+ ): Boolean {
+ settingToValueMap[name] = value
+ return true
+ }
+ }
+
+ companion object {
+ private const val TEST_SETTING = "test_setting"
+ private val TEST_SETTING_URI = Uri.parse("content://settings/test_setting")
+ }
+}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/util/settings/UserSettingsProxyTest.kt b/packages/SystemUI/tests/src/com/android/systemui/util/settings/UserSettingsProxyTest.kt
new file mode 100644
index 000000000000..56328b933602
--- /dev/null
+++ b/packages/SystemUI/tests/src/com/android/systemui/util/settings/UserSettingsProxyTest.kt
@@ -0,0 +1,365 @@
+/*
+ * 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.util.settings
+
+import android.content.ContentResolver
+import android.content.pm.UserInfo
+import android.database.ContentObserver
+import android.net.Uri
+import android.os.Handler
+import android.os.Looper
+import android.provider.Settings
+import android.testing.AndroidTestingRunner
+import android.testing.TestableLooper
+import androidx.test.filters.SmallTest
+import com.android.systemui.SysuiTestCase
+import com.android.systemui.settings.FakeUserTracker
+import com.android.systemui.settings.UserTracker
+import com.google.common.truth.Truth.assertThat
+import org.junit.Assert.assertThrows
+import org.junit.Before
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.mockito.Mockito.mock
+import org.mockito.Mockito.verify
+import org.mockito.kotlin.eq
+
+/** Tests for [UserSettingsProxy]. */
+@RunWith(AndroidTestingRunner::class)
+@SmallTest
+@TestableLooper.RunWithLooper
+class UserSettingsProxyTest : SysuiTestCase() {
+
+ private var mUserTracker = FakeUserTracker()
+ private var mSettings: UserSettingsProxy = FakeUserSettingsProxy(mUserTracker)
+ private var mContentObserver = object : ContentObserver(Handler(Looper.getMainLooper())) {}
+
+ @Before
+ fun setUp() {
+ mUserTracker.set(
+ listOf(UserInfo(MAIN_USER_ID, "main", UserInfo.FLAG_MAIN)),
+ selectedUserIndex = 0
+ )
+ }
+
+ @Test
+ fun registerContentObserverForUser_inputString_success() {
+ mSettings.registerContentObserverForUser(
+ TEST_SETTING,
+ mContentObserver,
+ mUserTracker.userId
+ )
+ verify(mSettings.getContentResolver())
+ .registerContentObserver(
+ eq(TEST_SETTING_URI),
+ eq(false),
+ eq(mContentObserver),
+ eq(MAIN_USER_ID)
+ )
+ }
+
+ @Test
+ fun registerContentObserverForUser_inputString_notifyForDescendants_true() {
+ mSettings.registerContentObserverForUser(
+ TEST_SETTING,
+ notifyForDescendants = true,
+ mContentObserver,
+ mUserTracker.userId
+ )
+ verify(mSettings.getContentResolver())
+ .registerContentObserver(
+ eq(TEST_SETTING_URI),
+ eq(true),
+ eq(mContentObserver),
+ eq(MAIN_USER_ID)
+ )
+ }
+
+ @Test
+ fun registerContentObserverForUser_inputUri_success() {
+ mSettings.registerContentObserverForUser(
+ TEST_SETTING_URI,
+ mContentObserver,
+ mUserTracker.userId
+ )
+ verify(mSettings.getContentResolver())
+ .registerContentObserver(
+ eq(TEST_SETTING_URI),
+ eq(false),
+ eq(mContentObserver),
+ eq(MAIN_USER_ID)
+ )
+ }
+
+ @Test
+ fun registerContentObserverForUser_inputUri_notifyForDescendants_true() {
+ mSettings.registerContentObserverForUser(
+ TEST_SETTING_URI,
+ notifyForDescendants = true,
+ mContentObserver,
+ mUserTracker.userId
+ )
+ verify(mSettings.getContentResolver())
+ .registerContentObserver(
+ eq(TEST_SETTING_URI),
+ eq(true),
+ eq(mContentObserver),
+ eq(MAIN_USER_ID)
+ )
+ }
+
+ @Test
+ fun registerContentObserver_inputUri_success() {
+ mSettings.registerContentObserver(TEST_SETTING_URI, mContentObserver)
+ verify(mSettings.getContentResolver())
+ .registerContentObserver(eq(TEST_SETTING_URI), eq(false), eq(mContentObserver), eq(0))
+ }
+
+ @Test
+ fun registerContentObserver_inputUri_notifyForDescendants_true() {
+ mSettings.registerContentObserver(
+ TEST_SETTING_URI,
+ notifyForDescendants = true,
+ mContentObserver
+ )
+ verify(mSettings.getContentResolver())
+ .registerContentObserver(eq(TEST_SETTING_URI), eq(true), eq(mContentObserver), eq(0))
+ }
+
+ @Test
+ fun getString_keyPresent_returnValidValue() {
+ mSettings.putString(TEST_SETTING, "test")
+ assertThat(mSettings.getString(TEST_SETTING)).isEqualTo("test")
+ }
+
+ @Test
+ fun getString_keyAbsent_returnEmptyValue() {
+ assertThat(mSettings.getString(TEST_SETTING)).isEmpty()
+ }
+
+ @Test
+ fun getStringForUser_multipleUsers_validResult() {
+ mSettings.putStringForUser(TEST_SETTING, "test", MAIN_USER_ID)
+ mSettings.putStringForUser(TEST_SETTING, "test1", SECONDARY_USER_ID)
+ assertThat(mSettings.getStringForUser(TEST_SETTING, MAIN_USER_ID)).isEqualTo("test")
+ assertThat(mSettings.getStringForUser(TEST_SETTING, SECONDARY_USER_ID)).isEqualTo("test1")
+ }
+
+ @Test
+ fun getInt_keyPresent_returnValidValue() {
+ mSettings.putInt(TEST_SETTING, 2)
+ assertThat(mSettings.getInt(TEST_SETTING)).isEqualTo(2)
+ }
+
+ @Test
+ fun getInt_keyPresent_nonIntegerValue_throwException() {
+ assertThrows(Settings.SettingNotFoundException::class.java) {
+ mSettings.putString(TEST_SETTING, "test")
+ mSettings.getInt(TEST_SETTING)
+ }
+ }
+
+ @Test
+ fun getInt_keyAbsent_throwException() {
+ assertThrows(Settings.SettingNotFoundException::class.java) {
+ mSettings.getInt(TEST_SETTING)
+ }
+ }
+
+ @Test
+ fun getInt_keyAbsent_returnDefaultValue() {
+ assertThat(mSettings.getInt(TEST_SETTING, 5)).isEqualTo(5)
+ }
+
+ @Test
+ fun getIntForUser_multipleUsers__validResult() {
+ mSettings.putIntForUser(TEST_SETTING, 1, MAIN_USER_ID)
+ mSettings.putIntForUser(TEST_SETTING, 2, SECONDARY_USER_ID)
+ assertThat(mSettings.getIntForUser(TEST_SETTING, MAIN_USER_ID)).isEqualTo(1)
+ assertThat(mSettings.getIntForUser(TEST_SETTING, SECONDARY_USER_ID)).isEqualTo(2)
+ }
+
+ @Test
+ fun getBool_keyPresent_returnValidValue() {
+ mSettings.putBool(TEST_SETTING, true)
+ assertThat(mSettings.getBool(TEST_SETTING)).isTrue()
+ }
+
+ @Test
+ fun getBool_keyPresent_nonBooleanValue_throwException() {
+ assertThrows(Settings.SettingNotFoundException::class.java) {
+ mSettings.putString(TEST_SETTING, "test")
+ mSettings.getBool(TEST_SETTING)
+ }
+ }
+
+ @Test
+ fun getBool_keyAbsent_throwException() {
+ assertThrows(Settings.SettingNotFoundException::class.java) {
+ mSettings.getBool(TEST_SETTING)
+ }
+ }
+
+ @Test
+ fun getBool_keyAbsent_returnDefaultValue() {
+ assertThat(mSettings.getBool(TEST_SETTING, false)).isEqualTo(false)
+ }
+
+ @Test
+ fun getBoolForUser_multipleUsers__validResult() {
+ mSettings.putBoolForUser(TEST_SETTING, true, MAIN_USER_ID)
+ mSettings.putBoolForUser(TEST_SETTING, false, SECONDARY_USER_ID)
+ assertThat(mSettings.getBoolForUser(TEST_SETTING, MAIN_USER_ID)).isEqualTo(true)
+ assertThat(mSettings.getBoolForUser(TEST_SETTING, SECONDARY_USER_ID)).isEqualTo(false)
+ }
+
+ @Test
+ fun getLong_keyPresent_returnValidValue() {
+ mSettings.putLong(TEST_SETTING, 1L)
+ assertThat(mSettings.getLong(TEST_SETTING)).isEqualTo(1L)
+ }
+
+ @Test
+ fun getLong_keyPresent_nonLongValue_throwException() {
+ assertThrows(Settings.SettingNotFoundException::class.java) {
+ mSettings.putString(TEST_SETTING, "test")
+ mSettings.getLong(TEST_SETTING)
+ }
+ }
+
+ @Test
+ fun getLong_keyAbsent_throwException() {
+ assertThrows(Settings.SettingNotFoundException::class.java) {
+ mSettings.getLong(TEST_SETTING)
+ }
+ }
+
+ @Test
+ fun getLong_keyAbsent_returnDefaultValue() {
+ assertThat(mSettings.getLong(TEST_SETTING, 2L)).isEqualTo(2L)
+ }
+
+ @Test
+ fun getLongForUser_multipleUsers__validResult() {
+ mSettings.putLongForUser(TEST_SETTING, 1L, MAIN_USER_ID)
+ mSettings.putLongForUser(TEST_SETTING, 2L, SECONDARY_USER_ID)
+ assertThat(mSettings.getLongForUser(TEST_SETTING, MAIN_USER_ID)).isEqualTo(1L)
+ assertThat(mSettings.getLongForUser(TEST_SETTING, SECONDARY_USER_ID)).isEqualTo(2L)
+ }
+
+ @Test
+ fun getFloat_keyPresent_returnValidValue() {
+ mSettings.putFloat(TEST_SETTING, 2.5F)
+ assertThat(mSettings.getFloat(TEST_SETTING)).isEqualTo(2.5F)
+ }
+
+ @Test
+ fun getFloat_keyPresent_nonFloatValue_throwException() {
+ assertThrows(Settings.SettingNotFoundException::class.java) {
+ mSettings.putString(TEST_SETTING, "test")
+ mSettings.getFloat(TEST_SETTING)
+ }
+ }
+
+ @Test
+ fun getFloat_keyAbsent_throwException() {
+ assertThrows(Settings.SettingNotFoundException::class.java) {
+ mSettings.getFloat(TEST_SETTING)
+ }
+ }
+
+ @Test
+ fun getFloat_keyAbsent_returnDefaultValue() {
+ assertThat(mSettings.getFloat(TEST_SETTING, 2.5F)).isEqualTo(2.5F)
+ }
+
+ @Test
+ fun getFloatForUser_multipleUsers__validResult() {
+ mSettings.putFloatForUser(TEST_SETTING, 1F, MAIN_USER_ID)
+ mSettings.putFloatForUser(TEST_SETTING, 2F, SECONDARY_USER_ID)
+ assertThat(mSettings.getFloatForUser(TEST_SETTING, MAIN_USER_ID)).isEqualTo(1F)
+ assertThat(mSettings.getFloatForUser(TEST_SETTING, SECONDARY_USER_ID)).isEqualTo(2F)
+ }
+
+ /**
+ * Fake implementation of [UserSettingsProxy].
+ *
+ * This class uses a mock of [ContentResolver] to test the [ContentObserver] registration APIs.
+ */
+ private class FakeUserSettingsProxy(override val userTracker: UserTracker) : UserSettingsProxy {
+
+ private val mContentResolver = mock(ContentResolver::class.java)
+ private val userIdToSettingsValueMap: MutableMap<Int, MutableMap<String, String>> =
+ mutableMapOf()
+
+ override fun getContentResolver() = mContentResolver
+
+ override fun getUriFor(name: String) =
+ Uri.parse(StringBuilder().append(URI_PREFIX).append(name).toString())
+
+ override fun getStringForUser(name: String, userHandle: Int) =
+ userIdToSettingsValueMap[userHandle]?.get(name) ?: ""
+
+ override fun putString(
+ name: String,
+ value: String,
+ overrideableByRestore: Boolean
+ ): Boolean {
+ userIdToSettingsValueMap[DEFAULT_USER_ID]?.put(name, value)
+ return true
+ }
+
+ override fun putString(
+ name: String,
+ value: String,
+ tag: String,
+ makeDefault: Boolean
+ ): Boolean {
+ putStringForUser(name, value, DEFAULT_USER_ID)
+ return true
+ }
+
+ override fun putStringForUser(name: String, value: String, userHandle: Int): Boolean {
+ userIdToSettingsValueMap[userHandle] = mutableMapOf(Pair(name, value))
+ return true
+ }
+
+ override fun putStringForUser(
+ name: String,
+ value: String,
+ tag: String?,
+ makeDefault: Boolean,
+ userHandle: Int,
+ overrideableByRestore: Boolean
+ ): Boolean {
+ userIdToSettingsValueMap[userHandle]?.set(name, value)
+ return true
+ }
+
+ private companion object {
+ const val DEFAULT_USER_ID = 0
+ const val URI_PREFIX = "content://settings/"
+ }
+ }
+
+ private companion object {
+ const val MAIN_USER_ID = 10
+ const val SECONDARY_USER_ID = 20
+ const val TEST_SETTING = "test_setting"
+ val TEST_SETTING_URI = Uri.parse("content://settings/test_setting")
+ }
+}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/wmshell/BubblesTest.java b/packages/SystemUI/tests/src/com/android/systemui/wmshell/BubblesTest.java
index df781108cf79..7b0a55608970 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/wmshell/BubblesTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/wmshell/BubblesTest.java
@@ -467,7 +467,8 @@ public class BubblesTest extends SysuiTestCase {
mock(UiEventLogger.class),
mock(UserTracker.class),
mock(AvalancheProvider.class),
- mock(SystemSettings.class)
+ mock(SystemSettings.class),
+ mock(PackageManager.class)
);
interruptionDecisionProvider.start();
@@ -2132,8 +2133,7 @@ public class BubblesTest extends SysuiTestCase {
FakeBubbleStateListener bubbleStateListener = new FakeBubbleStateListener();
mBubbleController.registerBubbleStateListener(bubbleStateListener);
- mBubbleController.expandStackAndSelectBubbleFromLauncher(mBubbleEntry.getKey(),
- new Rect(500, 1000, 600, 1100));
+ mBubbleController.expandStackAndSelectBubbleFromLauncher(mBubbleEntry.getKey(), 1000);
assertThat(mBubbleController.getLayerView().isExpanded()).isTrue();
@@ -2157,7 +2157,7 @@ public class BubblesTest extends SysuiTestCase {
mBubbleController.updateBubble(mBubbleEntry2);
// Select first bubble
- mBubbleController.expandStackAndSelectBubbleFromLauncher(mBubbleEntry.getKey(), new Rect());
+ mBubbleController.expandStackAndSelectBubbleFromLauncher(mBubbleEntry.getKey(), 0);
assertThat(mBubbleData.getSelectedBubbleKey()).isEqualTo(mBubbleEntry.getKey());
assertThat(mBubbleController.getLayerView().isExpanded()).isTrue();
@@ -2166,7 +2166,7 @@ public class BubblesTest extends SysuiTestCase {
assertThat(mBubbleController.getLayerView().isExpanded()).isFalse();
// Stop dragging, first bubble should be expanded
- mBubbleController.stopBubbleDrag(BubbleBarLocation.LEFT);
+ mBubbleController.stopBubbleDrag(BubbleBarLocation.LEFT, 0);
assertThat(mBubbleData.getSelectedBubbleKey()).isEqualTo(mBubbleEntry.getKey());
assertThat(mBubbleController.getLayerView().isExpanded()).isTrue();
}
@@ -2186,7 +2186,7 @@ public class BubblesTest extends SysuiTestCase {
mBubbleController.updateBubble(mBubbleEntry2);
// Select first bubble
- mBubbleController.expandStackAndSelectBubbleFromLauncher(mBubbleEntry.getKey(), new Rect());
+ mBubbleController.expandStackAndSelectBubbleFromLauncher(mBubbleEntry.getKey(), 0);
assertThat(mBubbleData.getSelectedBubbleKey()).isEqualTo(mBubbleEntry.getKey());
assertThat(mBubbleController.getLayerView().isExpanded()).isTrue();
@@ -2195,7 +2195,7 @@ public class BubblesTest extends SysuiTestCase {
assertThat(mBubbleController.getLayerView().isExpanded()).isFalse();
// Stop dragging, first bubble should be expanded
- mBubbleController.stopBubbleDrag(BubbleBarLocation.LEFT);
+ mBubbleController.stopBubbleDrag(BubbleBarLocation.LEFT, 0);
assertThat(mBubbleData.getSelectedBubbleKey()).isEqualTo(mBubbleEntry.getKey());
assertThat(mBubbleController.getLayerView().isExpanded()).isTrue();
}
@@ -2215,7 +2215,7 @@ public class BubblesTest extends SysuiTestCase {
mBubbleController.updateBubble(mBubbleEntry2);
// Select first bubble
- mBubbleController.expandStackAndSelectBubbleFromLauncher(mBubbleEntry.getKey(), new Rect());
+ mBubbleController.expandStackAndSelectBubbleFromLauncher(mBubbleEntry.getKey(), 0);
// Drag first bubble to dismiss
mBubbleController.startBubbleDrag(mBubbleEntry.getKey());
mBubbleController.dragBubbleToDismiss(mBubbleEntry.getKey());
@@ -2239,7 +2239,7 @@ public class BubblesTest extends SysuiTestCase {
mBubbleController.updateBubble(mBubbleEntry2);
// Select first bubble
- mBubbleController.expandStackAndSelectBubbleFromLauncher(mBubbleEntry.getKey(), new Rect());
+ mBubbleController.expandStackAndSelectBubbleFromLauncher(mBubbleEntry.getKey(), 0);
// Drag second bubble to dismiss
mBubbleController.startBubbleDrag(mBubbleEntry2.getKey());
mBubbleController.dragBubbleToDismiss(mBubbleEntry2.getKey());
diff --git a/packages/SystemUI/tests/utils/src/com/android/systemui/SysUITestModule.kt b/packages/SystemUI/tests/utils/src/com/android/systemui/SysUITestModule.kt
index 42b6e18d108b..020f7fa6256b 100644
--- a/packages/SystemUI/tests/utils/src/com/android/systemui/SysUITestModule.kt
+++ b/packages/SystemUI/tests/utils/src/com/android/systemui/SysUITestModule.kt
@@ -66,6 +66,7 @@ import kotlinx.coroutines.test.runTest
FaceWakeUpTriggersConfigModule::class,
]
)
+@Deprecated("Use Kosmos instead. See com.android.systemui.kosmos.Kosmos.")
interface SysUITestModule {
@Binds fun bindTestableContext(sysuiTestableContext: SysuiTestableContext): TestableContext
@@ -127,6 +128,7 @@ interface SysUITestModule {
}
}
+@Deprecated("Use Kosmos instead. See com.android.systemui.kosmos.Kosmos.")
interface SysUITestComponent<out T> {
val testScope: TestScope
val underTest: T
diff --git a/packages/SystemUI/tests/utils/src/com/android/systemui/biometrics/data/repository/FakePromptRepository.kt b/packages/SystemUI/tests/utils/src/com/android/systemui/biometrics/data/repository/FakePromptRepository.kt
index e37bdc15c0ac..280996719e02 100644
--- a/packages/SystemUI/tests/utils/src/com/android/systemui/biometrics/data/repository/FakePromptRepository.kt
+++ b/packages/SystemUI/tests/utils/src/com/android/systemui/biometrics/data/repository/FakePromptRepository.kt
@@ -17,6 +17,9 @@ class FakePromptRepository : PromptRepository {
private val _userId = MutableStateFlow<Int?>(null)
override val userId = _userId.asStateFlow()
+ private val _requestId = MutableStateFlow<Long?>(null)
+ override val requestId = _requestId.asStateFlow()
+
private var _challenge = MutableStateFlow<Long?>(null)
override val challenge = _challenge.asStateFlow()
@@ -32,6 +35,7 @@ class FakePromptRepository : PromptRepository {
override fun setPrompt(
promptInfo: PromptInfo,
userId: Int,
+ requestId: Long,
gatekeeperChallenge: Long?,
kind: PromptKind,
opPackageName: String,
@@ -39,6 +43,7 @@ class FakePromptRepository : PromptRepository {
setPrompt(
promptInfo,
userId,
+ requestId,
gatekeeperChallenge,
kind,
forceConfirmation = false,
@@ -48,6 +53,7 @@ class FakePromptRepository : PromptRepository {
fun setPrompt(
promptInfo: PromptInfo,
userId: Int,
+ requestId: Long,
gatekeeperChallenge: Long?,
kind: PromptKind,
forceConfirmation: Boolean = false,
@@ -55,15 +61,17 @@ class FakePromptRepository : PromptRepository {
) {
_promptInfo.value = promptInfo
_userId.value = userId
+ _requestId.value = requestId
_challenge.value = gatekeeperChallenge
_promptKind.value = kind
_isConfirmationRequired.value = promptInfo.isConfirmationRequested || forceConfirmation
_opPackageName.value = opPackageName
}
- override fun unsetPrompt() {
+ override fun unsetPrompt(requestId: Long) {
_promptInfo.value = null
_userId.value = null
+ _requestId.value = null
_challenge.value = null
_promptKind.value = PromptKind.None
_opPackageName.value = null
diff --git a/packages/SystemUI/tests/utils/src/com/android/systemui/keyguard/domain/interactor/WindowManagerLockscreenVisibilityInteractorKosmos.kt b/packages/SystemUI/tests/utils/src/com/android/systemui/keyguard/domain/interactor/WindowManagerLockscreenVisibilityInteractorKosmos.kt
index b38acc8a46dc..bd9c0be6b0b7 100644
--- a/packages/SystemUI/tests/utils/src/com/android/systemui/keyguard/domain/interactor/WindowManagerLockscreenVisibilityInteractorKosmos.kt
+++ b/packages/SystemUI/tests/utils/src/com/android/systemui/keyguard/domain/interactor/WindowManagerLockscreenVisibilityInteractorKosmos.kt
@@ -16,6 +16,7 @@
package com.android.systemui.keyguard.domain.interactor
+import com.android.systemui.deviceentry.domain.interactor.deviceEntryInteractor
import com.android.systemui.kosmos.Kosmos
import com.android.systemui.scene.domain.interactor.sceneInteractor
import com.android.systemui.statusbar.notification.domain.interactor.notificationLaunchAnimationInteractor
@@ -30,6 +31,7 @@ val Kosmos.windowManagerLockscreenVisibilityInteractor by
fromBouncerInteractor = fromPrimaryBouncerTransitionInteractor,
fromAlternateBouncerInteractor = fromAlternateBouncerTransitionInteractor,
notificationLaunchAnimationInteractor = notificationLaunchAnimationInteractor,
- sceneInteractor = sceneInteractor,
+ sceneInteractor = { sceneInteractor },
+ deviceEntryInteractor = { deviceEntryInteractor },
)
}
diff --git a/packages/SystemUI/tests/utils/src/com/android/systemui/kosmos/KosmosJavaAdapter.kt b/packages/SystemUI/tests/utils/src/com/android/systemui/kosmos/KosmosJavaAdapter.kt
index a81ac038b38a..0e95320bdf4c 100644
--- a/packages/SystemUI/tests/utils/src/com/android/systemui/kosmos/KosmosJavaAdapter.kt
+++ b/packages/SystemUI/tests/utils/src/com/android/systemui/kosmos/KosmosJavaAdapter.kt
@@ -55,6 +55,7 @@ import com.android.systemui.settings.brightness.domain.interactor.brightnessMirr
import com.android.systemui.shade.data.repository.shadeRepository
import com.android.systemui.shade.domain.interactor.shadeInteractor
import com.android.systemui.shade.shadeController
+import com.android.systemui.statusbar.notification.stack.domain.interactor.headsUpNotificationInteractor
import com.android.systemui.statusbar.notification.stack.domain.interactor.sharedNotificationContainerInteractor
import com.android.systemui.statusbar.pipeline.mobile.data.repository.fakeMobileConnectionsRepository
import com.android.systemui.statusbar.policy.data.repository.fakeDeviceProvisioningRepository
@@ -78,6 +79,7 @@ class KosmosJavaAdapter(
val configurationInteractor by lazy { kosmos.configurationInteractor }
val bouncerRepository by lazy { kosmos.bouncerRepository }
val communalRepository by lazy { kosmos.fakeCommunalRepository }
+ val headsUpNotificationInteractor by lazy { kosmos.headsUpNotificationInteractor }
val keyguardRepository by lazy { kosmos.fakeKeyguardRepository }
val keyguardBouncerRepository by lazy { kosmos.fakeKeyguardBouncerRepository }
val keyguardInteractor by lazy { kosmos.keyguardInteractor }
diff --git a/packages/SystemUI/tests/utils/src/com/android/systemui/qs/panels/domain/interactor/GridLayoutTypeInteractorKosmos.kt b/packages/SystemUI/tests/utils/src/com/android/systemui/qs/panels/domain/interactor/GridLayoutTypeInteractorKosmos.kt
index 34e99d3a9a3c..5568c6c3c310 100644
--- a/packages/SystemUI/tests/utils/src/com/android/systemui/qs/panels/domain/interactor/GridLayoutTypeInteractorKosmos.kt
+++ b/packages/SystemUI/tests/utils/src/com/android/systemui/qs/panels/domain/interactor/GridLayoutTypeInteractorKosmos.kt
@@ -20,13 +20,24 @@ import com.android.systemui.kosmos.Kosmos
import com.android.systemui.qs.panels.data.repository.gridLayoutTypeRepository
import com.android.systemui.qs.panels.shared.model.GridLayoutType
import com.android.systemui.qs.panels.shared.model.InfiniteGridLayoutType
+import com.android.systemui.qs.panels.shared.model.PartitionedGridLayoutType
import com.android.systemui.qs.panels.ui.compose.GridLayout
val Kosmos.gridLayoutTypeInteractor by
Kosmos.Fixture { GridLayoutTypeInteractor(gridLayoutTypeRepository) }
val Kosmos.gridLayoutMap: Map<GridLayoutType, GridLayout> by
- Kosmos.Fixture { mapOf(Pair(InfiniteGridLayoutType, infiniteGridLayout)) }
+ Kosmos.Fixture {
+ mapOf(
+ Pair(PartitionedGridLayoutType, partitionedGridLayout),
+ Pair(InfiniteGridLayoutType, infiniteGridLayout)
+ )
+ }
var Kosmos.gridConsistencyInteractorsMap: Map<GridLayoutType, GridTypeConsistencyInteractor> by
- Kosmos.Fixture { mapOf(Pair(InfiniteGridLayoutType, infiniteGridConsistencyInteractor)) }
+ Kosmos.Fixture {
+ mapOf(
+ Pair(PartitionedGridLayoutType, noopGridConsistencyInteractor),
+ Pair(InfiniteGridLayoutType, infiniteGridConsistencyInteractor)
+ )
+ }
diff --git a/packages/SystemUI/tests/utils/src/com/android/systemui/qs/panels/domain/interactor/PartitionedGridLayoutKosmos.kt b/packages/SystemUI/tests/utils/src/com/android/systemui/qs/panels/domain/interactor/PartitionedGridLayoutKosmos.kt
new file mode 100644
index 000000000000..4febfe9160ab
--- /dev/null
+++ b/packages/SystemUI/tests/utils/src/com/android/systemui/qs/panels/domain/interactor/PartitionedGridLayoutKosmos.kt
@@ -0,0 +1,23 @@
+/*
+ * 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 com.android.systemui.kosmos.Kosmos
+import com.android.systemui.qs.panels.ui.compose.PartitionedGridLayout
+
+val Kosmos.partitionedGridLayout by
+ Kosmos.Fixture { PartitionedGridLayout(iconTilesInteractor, infiniteGridSizeInteractor) }
diff --git a/packages/SystemUI/tests/utils/src/com/android/systemui/qs/panels/ui/viewmodel/TileGridViewModelKosmos.kt b/packages/SystemUI/tests/utils/src/com/android/systemui/qs/panels/ui/viewmodel/TileGridViewModelKosmos.kt
index 9481fcac97d6..6625bb54fa76 100644
--- a/packages/SystemUI/tests/utils/src/com/android/systemui/qs/panels/ui/viewmodel/TileGridViewModelKosmos.kt
+++ b/packages/SystemUI/tests/utils/src/com/android/systemui/qs/panels/ui/viewmodel/TileGridViewModelKosmos.kt
@@ -20,7 +20,7 @@ import com.android.systemui.kosmos.Kosmos
import com.android.systemui.kosmos.applicationCoroutineScope
import com.android.systemui.qs.panels.domain.interactor.gridLayoutMap
import com.android.systemui.qs.panels.domain.interactor.gridLayoutTypeInteractor
-import com.android.systemui.qs.panels.domain.interactor.infiniteGridLayout
+import com.android.systemui.qs.panels.domain.interactor.partitionedGridLayout
import com.android.systemui.qs.pipeline.domain.interactor.currentTilesInteractor
val Kosmos.tileGridViewModel by
@@ -29,7 +29,7 @@ val Kosmos.tileGridViewModel by
gridLayoutTypeInteractor,
gridLayoutMap,
currentTilesInteractor,
- infiniteGridLayout,
+ partitionedGridLayout,
applicationCoroutineScope,
)
}
diff --git a/packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/notification/data/repository/FakeHeadsUpRowRepository.kt b/packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/notification/data/repository/FakeHeadsUpRowRepository.kt
index 2e983a820240..980d65fde6de 100644
--- a/packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/notification/data/repository/FakeHeadsUpRowRepository.kt
+++ b/packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/notification/data/repository/FakeHeadsUpRowRepository.kt
@@ -18,7 +18,11 @@ package com.android.systemui.statusbar.notification.data.repository
import kotlinx.coroutines.flow.MutableStateFlow
-class FakeHeadsUpRowRepository(override val key: String, override val elementKey: Any) :
+class FakeHeadsUpRowRepository(override val key: String, override val elementKey: Any = Any()) :
HeadsUpRowRepository {
+ constructor(key: String, isPinned: Boolean) : this(key = key) {
+ this.isPinned.value = isPinned
+ }
+
override val isPinned: MutableStateFlow<Boolean> = MutableStateFlow(false)
}
diff --git a/packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/notification/stack/domain/interactor/HeadsUpNotificationInteractorKosmos.kt b/packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/notification/stack/domain/interactor/HeadsUpNotificationInteractorKosmos.kt
index d3451075c51b..c74aec1fc59c 100644
--- a/packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/notification/stack/domain/interactor/HeadsUpNotificationInteractorKosmos.kt
+++ b/packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/notification/stack/domain/interactor/HeadsUpNotificationInteractorKosmos.kt
@@ -16,11 +16,20 @@
package com.android.systemui.statusbar.notification.stack.domain.interactor
+import com.android.systemui.deviceentry.domain.interactor.deviceEntryFaceAuthInteractor
+import com.android.systemui.keyguard.domain.interactor.keyguardTransitionInteractor
import com.android.systemui.kosmos.Kosmos
import com.android.systemui.kosmos.Kosmos.Fixture
+import com.android.systemui.shade.domain.interactor.shadeInteractor
import com.android.systemui.statusbar.notification.domain.interactor.HeadsUpNotificationInteractor
import com.android.systemui.statusbar.notification.stack.data.repository.headsUpNotificationRepository
val Kosmos.headsUpNotificationInteractor by Fixture {
- HeadsUpNotificationInteractor(headsUpNotificationRepository)
+ HeadsUpNotificationInteractor(
+ headsUpNotificationRepository,
+ deviceEntryFaceAuthInteractor,
+ keyguardTransitionInteractor,
+ notificationsKeyguardInteractor,
+ shadeInteractor,
+ )
}
diff --git a/packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/NotificationListViewModelKosmos.kt b/packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/NotificationListViewModelKosmos.kt
index 94f6ecd36c7c..de8b3500a88a 100644
--- a/packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/NotificationListViewModelKosmos.kt
+++ b/packages/SystemUI/tests/utils/src/com/android/systemui/statusbar/notification/stack/ui/viewmodel/NotificationListViewModelKosmos.kt
@@ -17,7 +17,6 @@
package com.android.systemui.statusbar.notification.stack.ui.viewmodel
import com.android.systemui.dump.dumpManager
-import com.android.systemui.keyguard.domain.interactor.keyguardInteractor
import com.android.systemui.kosmos.Kosmos
import com.android.systemui.kosmos.Kosmos.Fixture
import com.android.systemui.kosmos.testDispatcher
@@ -42,7 +41,6 @@ val Kosmos.notificationListViewModel by Fixture {
activeNotificationsInteractor,
notificationStackInteractor,
headsUpNotificationInteractor,
- keyguardInteractor,
remoteInputInteractor,
seenNotificationsInteractor,
shadeInteractor,
diff --git a/packages/SystemUI/tests/utils/src/com/android/systemui/volume/data/repository/FakeAudioRepository.kt b/packages/SystemUI/tests/utils/src/com/android/systemui/volume/data/repository/FakeAudioRepository.kt
index 6b27079cb648..21d59f09711c 100644
--- a/packages/SystemUI/tests/utils/src/com/android/systemui/volume/data/repository/FakeAudioRepository.kt
+++ b/packages/SystemUI/tests/utils/src/com/android/systemui/volume/data/repository/FakeAudioRepository.kt
@@ -43,8 +43,6 @@ class FakeAudioRepository : AudioRepository {
private val models: MutableMap<AudioStream, MutableStateFlow<AudioStreamModel>> = mutableMapOf()
private val lastAudibleVolumes: MutableMap<AudioStream, Int> = mutableMapOf()
- private var isAffectedByMute: MutableMap<AudioStream, Boolean> = mutableMapOf()
-
private fun getAudioStreamModelState(
audioStream: AudioStream
): MutableStateFlow<AudioStreamModel> =
@@ -55,6 +53,7 @@ class FakeAudioRepository : AudioRepository {
volume = 0,
minVolume = 0,
maxVolume = 10,
+ isAffectedByMute = false,
isAffectedByRingerMode = false,
isMuted = false,
)
@@ -104,11 +103,4 @@ class FakeAudioRepository : AudioRepository {
override suspend fun setRingerMode(audioStream: AudioStream, mode: RingerMode) {
mutableRingerMode.value = mode
}
-
- override suspend fun isAffectedByMute(audioStream: AudioStream): Boolean =
- isAffectedByMute[audioStream] ?: true
-
- fun setIsAffectedByMute(audioStream: AudioStream, isAffected: Boolean) {
- isAffectedByMute[audioStream] = isAffected
- }
}
diff --git a/packages/SystemUI/tests/utils/src/com/android/systemui/volume/panel/component/anc/VolumePanelAncKosmos.kt b/packages/SystemUI/tests/utils/src/com/android/systemui/volume/panel/component/anc/VolumePanelAncKosmos.kt
index f9b7e69eea7d..2b5d1b9757bc 100644
--- a/packages/SystemUI/tests/utils/src/com/android/systemui/volume/panel/component/anc/VolumePanelAncKosmos.kt
+++ b/packages/SystemUI/tests/utils/src/com/android/systemui/volume/panel/component/anc/VolumePanelAncKosmos.kt
@@ -20,10 +20,13 @@ import androidx.slice.SliceViewManager
import com.android.systemui.kosmos.Kosmos
import com.android.systemui.kosmos.testScope
import com.android.systemui.util.mockito.mock
+import com.android.systemui.volume.domain.interactor.audioOutputInteractor
import com.android.systemui.volume.panel.component.anc.data.repository.FakeAncSliceRepository
import com.android.systemui.volume.panel.component.anc.domain.interactor.AncSliceInteractor
var Kosmos.sliceViewManager: SliceViewManager by Kosmos.Fixture { mock {} }
val Kosmos.ancSliceRepository by Kosmos.Fixture { FakeAncSliceRepository() }
val Kosmos.ancSliceInteractor by
- Kosmos.Fixture { AncSliceInteractor(ancSliceRepository, testScope.backgroundScope) }
+ Kosmos.Fixture {
+ AncSliceInteractor(audioOutputInteractor, ancSliceRepository, testScope.backgroundScope)
+ }
diff --git a/packages/SystemUI/tests/utils/src/com/android/systemui/volume/panel/component/anc/data/repository/FakeAncSliceRepository.kt b/packages/SystemUI/tests/utils/src/com/android/systemui/volume/panel/component/anc/data/repository/FakeAncSliceRepository.kt
index d4a72b437fd8..ebe68505e343 100644
--- a/packages/SystemUI/tests/utils/src/com/android/systemui/volume/panel/component/anc/data/repository/FakeAncSliceRepository.kt
+++ b/packages/SystemUI/tests/utils/src/com/android/systemui/volume/panel/component/anc/data/repository/FakeAncSliceRepository.kt
@@ -16,6 +16,7 @@
package com.android.systemui.volume.panel.component.anc.data.repository
+import android.bluetooth.BluetoothDevice
import androidx.slice.Slice
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.MutableStateFlow
@@ -24,7 +25,12 @@ class FakeAncSliceRepository : AncSliceRepository {
private val sliceByWidth = mutableMapOf<Int, MutableStateFlow<Slice?>>()
- override fun ancSlice(width: Int, isCollapsed: Boolean, hideLabel: Boolean): Flow<Slice?> {
+ override fun ancSlice(
+ device: BluetoothDevice,
+ width: Int,
+ isCollapsed: Boolean,
+ hideLabel: Boolean
+ ): Flow<Slice?> {
return sliceByWidth.getOrPut(width) { MutableStateFlow(null) }
}
diff --git a/packages/SystemUI/tests/utils/src/com/android/systemui/volume/panel/component/mediaoutput/domain/interactor/TestMediaDevicesFactory.kt b/packages/SystemUI/tests/utils/src/com/android/systemui/volume/panel/component/mediaoutput/domain/interactor/TestMediaDevicesFactory.kt
new file mode 100644
index 000000000000..40296099bfe0
--- /dev/null
+++ b/packages/SystemUI/tests/utils/src/com/android/systemui/volume/panel/component/mediaoutput/domain/interactor/TestMediaDevicesFactory.kt
@@ -0,0 +1,58 @@
+/*
+ * 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.panel.component.mediaoutput.domain.interactor
+
+import android.annotation.SuppressLint
+import android.bluetooth.BluetoothDevice
+import android.graphics.drawable.TestStubDrawable
+import com.android.settingslib.bluetooth.CachedBluetoothDevice
+import com.android.settingslib.media.BluetoothMediaDevice
+import com.android.settingslib.media.MediaDevice
+import com.android.settingslib.media.PhoneMediaDevice
+import com.android.systemui.util.mockito.mock
+import com.android.systemui.util.mockito.whenever
+
+@SuppressLint("StaticFieldLeak") // These are mocks
+object TestMediaDevicesFactory {
+
+ fun builtInMediaDevice(): MediaDevice = mock {
+ whenever(name).thenReturn("built_in_media")
+ whenever(icon).thenReturn(TestStubDrawable())
+ }
+
+ fun wiredMediaDevice(): MediaDevice =
+ mock<PhoneMediaDevice> {
+ whenever(deviceType)
+ .thenReturn(MediaDevice.MediaDeviceType.TYPE_3POINT5_MM_AUDIO_DEVICE)
+ whenever(name).thenReturn("wired_media")
+ whenever(icon).thenReturn(TestStubDrawable())
+ }
+
+ fun bluetoothMediaDevice(): MediaDevice {
+ val bluetoothDevice = mock<BluetoothDevice>()
+ val cachedBluetoothDevice: CachedBluetoothDevice = mock {
+ whenever(isHearingAidDevice).thenReturn(true)
+ whenever(address).thenReturn("bt_media_device")
+ whenever(device).thenReturn(bluetoothDevice)
+ }
+ return mock<BluetoothMediaDevice> {
+ whenever(name).thenReturn("bt_media")
+ whenever(icon).thenReturn(TestStubDrawable())
+ whenever(cachedDevice).thenReturn(cachedBluetoothDevice)
+ }
+ }
+}
diff --git a/packages/SystemUI/unfold/src/com/android/systemui/unfold/UnfoldRemoteModule.kt b/packages/SystemUI/unfold/src/com/android/systemui/unfold/UnfoldRemoteModule.kt
index 2bc2db3ba629..fe102448a6cb 100644
--- a/packages/SystemUI/unfold/src/com/android/systemui/unfold/UnfoldRemoteModule.kt
+++ b/packages/SystemUI/unfold/src/com/android/systemui/unfold/UnfoldRemoteModule.kt
@@ -53,8 +53,8 @@ class UnfoldRemoteModule {
@UnfoldMain
fun provideMainRotationChangeProvider(
rotationChangeProviderFactory: RotationChangeProvider.Factory,
- @UnfoldMain mainHandler: Handler,
+ @UnfoldMain callbackHandler: Handler,
): RotationChangeProvider {
- return rotationChangeProviderFactory.create(mainHandler)
+ return rotationChangeProviderFactory.create(callbackHandler)
}
}
diff --git a/packages/SystemUI/unfold/src/com/android/systemui/unfold/UnfoldSharedComponent.kt b/packages/SystemUI/unfold/src/com/android/systemui/unfold/UnfoldSharedComponent.kt
index 31b7ccca49ac..f382070f8fa7 100644
--- a/packages/SystemUI/unfold/src/com/android/systemui/unfold/UnfoldSharedComponent.kt
+++ b/packages/SystemUI/unfold/src/com/android/systemui/unfold/UnfoldSharedComponent.kt
@@ -87,6 +87,7 @@ interface RemoteUnfoldSharedComponent {
@BindsInstance @UnfoldMain executor: Executor,
@BindsInstance @UnfoldMain handler: Handler,
@BindsInstance @UnfoldSingleThreadBg singleThreadBgExecutor: Executor,
+ @BindsInstance @UnfoldBg bgHandler: Handler,
@BindsInstance displayManager: DisplayManager,
@BindsInstance @UnfoldTransitionATracePrefix tracingTagPrefix: String,
): RemoteUnfoldSharedComponent
diff --git a/packages/SystemUI/unfold/src/com/android/systemui/unfold/UnfoldSharedModule.kt b/packages/SystemUI/unfold/src/com/android/systemui/unfold/UnfoldSharedModule.kt
index 1b7e71a42c22..f83ea845809c 100644
--- a/packages/SystemUI/unfold/src/com/android/systemui/unfold/UnfoldSharedModule.kt
+++ b/packages/SystemUI/unfold/src/com/android/systemui/unfold/UnfoldSharedModule.kt
@@ -270,9 +270,9 @@ internal class UnfoldRotationProviderInternalModule {
@UnfoldMain
fun provideRotationChangeProvider(
rotationChangeProviderFactory: RotationChangeProvider.Factory,
- @UnfoldMain mainHandler: Handler,
+ @UnfoldMain callbackHandler: Handler,
): RotationChangeProvider {
- return rotationChangeProviderFactory.create(mainHandler)
+ return rotationChangeProviderFactory.create(callbackHandler)
}
@Provides
@@ -280,8 +280,9 @@ internal class UnfoldRotationProviderInternalModule {
@UnfoldBg
fun provideBgRotationChangeProvider(
rotationChangeProviderFactory: RotationChangeProvider.Factory,
- @UnfoldBg bgHandler: Handler,
+ @UnfoldBg callbackHandler: Handler,
): RotationChangeProvider {
- return rotationChangeProviderFactory.create(bgHandler)
+ // For UnfoldBg RotationChangeProvider we use bgHandler as callbackHandler
+ return rotationChangeProviderFactory.create(callbackHandler)
}
}
diff --git a/packages/SystemUI/unfold/src/com/android/systemui/unfold/UnfoldTransitionFactory.kt b/packages/SystemUI/unfold/src/com/android/systemui/unfold/UnfoldTransitionFactory.kt
index 1cbaf3135c4d..8a4f9857603a 100644
--- a/packages/SystemUI/unfold/src/com/android/systemui/unfold/UnfoldTransitionFactory.kt
+++ b/packages/SystemUI/unfold/src/com/android/systemui/unfold/UnfoldTransitionFactory.kt
@@ -77,6 +77,7 @@ fun createRemoteUnfoldSharedComponent(
mainExecutor: Executor,
mainHandler: Handler,
singleThreadBgExecutor: Executor,
+ bgHandler: Handler,
tracingTagPrefix: String,
displayManager: DisplayManager,
): RemoteUnfoldSharedComponent =
@@ -87,6 +88,7 @@ fun createRemoteUnfoldSharedComponent(
mainExecutor,
mainHandler,
singleThreadBgExecutor,
+ bgHandler,
displayManager,
tracingTagPrefix,
)
diff --git a/packages/SystemUI/unfold/src/com/android/systemui/unfold/updates/DeviceFoldStateProvider.kt b/packages/SystemUI/unfold/src/com/android/systemui/unfold/updates/DeviceFoldStateProvider.kt
index 77f637bb8ba1..a10097427ae5 100644
--- a/packages/SystemUI/unfold/src/com/android/systemui/unfold/updates/DeviceFoldStateProvider.kt
+++ b/packages/SystemUI/unfold/src/com/android/systemui/unfold/updates/DeviceFoldStateProvider.kt
@@ -20,6 +20,7 @@ import android.os.Handler
import android.util.Log
import androidx.annotation.FloatRange
import androidx.annotation.VisibleForTesting
+import androidx.annotation.WorkerThread
import androidx.core.util.Consumer
import com.android.systemui.unfold.compat.INNER_SCREEN_SMALLEST_SCREEN_WIDTH_THRESHOLD_DP
import com.android.systemui.unfold.config.UnfoldTransitionConfig
@@ -215,6 +216,7 @@ constructor(
}
private inner class FoldRotationListener : RotationChangeProvider.RotationListener {
+ @WorkerThread
override fun onRotationChanged(newRotation: Int) {
assertInProgressThread()
if (isTransitionInProgress) cancelAnimation()
diff --git a/packages/SystemUI/unfold/src/com/android/systemui/unfold/updates/RotationChangeProvider.kt b/packages/SystemUI/unfold/src/com/android/systemui/unfold/updates/RotationChangeProvider.kt
index bb91f9b8cf0b..4f3aee99c206 100644
--- a/packages/SystemUI/unfold/src/com/android/systemui/unfold/updates/RotationChangeProvider.kt
+++ b/packages/SystemUI/unfold/src/com/android/systemui/unfold/updates/RotationChangeProvider.kt
@@ -21,6 +21,8 @@ import android.hardware.display.DisplayManager
import android.os.Handler
import android.os.RemoteException
import android.os.Trace
+import androidx.annotation.AnyThread
+import com.android.systemui.unfold.dagger.UnfoldBg
import com.android.systemui.unfold.util.CallbackController
import dagger.assisted.Assisted
import dagger.assisted.AssistedFactory
@@ -35,7 +37,8 @@ class RotationChangeProvider
constructor(
private val displayManager: DisplayManager,
private val context: Context,
- @Assisted private val handler: Handler,
+ @UnfoldBg private val bgHandler: Handler,
+ @Assisted private val callbackHandler: Handler,
) : CallbackController<RotationChangeProvider.RotationListener> {
private val listeners = mutableListOf<RotationListener>()
@@ -44,7 +47,7 @@ constructor(
private var lastRotation: Int? = null
override fun addCallback(listener: RotationListener) {
- handler.post {
+ bgHandler.post {
if (listeners.isEmpty()) {
subscribeToRotation()
}
@@ -53,7 +56,7 @@ constructor(
}
override fun removeCallback(listener: RotationListener) {
- handler.post {
+ bgHandler.post {
listeners -= listener
if (listeners.isEmpty()) {
unsubscribeToRotation()
@@ -64,7 +67,7 @@ constructor(
private fun subscribeToRotation() {
try {
- displayManager.registerDisplayListener(displayListener, handler)
+ displayManager.registerDisplayListener(displayListener, callbackHandler)
} catch (e: RemoteException) {
throw e.rethrowFromSystemServer()
}
@@ -80,8 +83,11 @@ constructor(
/** Gets notified of rotation changes. */
fun interface RotationListener {
- /** Called once rotation changes. */
- fun onRotationChanged(newRotation: Int)
+ /**
+ * Called once rotation changes. This callback is called on the handler provided to
+ * [RotationChangeProvider.Factory.create].
+ */
+ @AnyThread fun onRotationChanged(newRotation: Int)
}
private inner class RotationDisplayListener : DisplayManager.DisplayListener {
@@ -110,7 +116,7 @@ constructor(
@AssistedFactory
interface Factory {
- /** Creates a new [RotationChangeProvider] that provides updated using [handler]. */
- fun create(handler: Handler): RotationChangeProvider
+ /** Creates a new [RotationChangeProvider] that provides updated using [callbackHandler]. */
+ fun create(callbackHandler: Handler): RotationChangeProvider
}
}
diff --git a/ravenwood/OWNERS b/ravenwood/OWNERS
index 41fd68e6c2d9..a90328c2e8c6 100644
--- a/ravenwood/OWNERS
+++ b/ravenwood/OWNERS
@@ -2,4 +2,6 @@ set noparent
jsharkey@google.com
omakoto@google.com
-jaggies@google.com
+
+per-file ravenwood-annotation-allowed-classes.txt = dplotnikov@google.com
+per-file texts/ravenwood-annotation-allowed-classes.txt = dplotnikov@google.com
diff --git a/services/accessibility/accessibility.aconfig b/services/accessibility/accessibility.aconfig
index 3f30b0a5b059..a50fb9a4c318 100644
--- a/services/accessibility/accessibility.aconfig
+++ b/services/accessibility/accessibility.aconfig
@@ -138,6 +138,16 @@ flag {
}
flag {
+ name: "manager_package_monitor_logic_fix"
+ namespace: "accessibility"
+ description: "Corrects the return values of the HandleForceStop function"
+ bug: "337392123"
+ metadata {
+ purpose: PURPOSE_BUGFIX
+ }
+}
+
+flag {
name: "pinch_zoom_zero_min_span"
namespace: "accessibility"
description: "Whether to set min span of ScaleGestureDetector to zero."
diff --git a/services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java b/services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java
index c70b6419e3b8..d7ed867c2ae5 100644
--- a/services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java
+++ b/services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java
@@ -697,7 +697,7 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub
/**
* Returns the lock object for any synchronized test blocks.
- * Should not be used outside of testing.
+ * External classes should only use for testing.
* @return lock object.
*/
@VisibleForTesting
@@ -801,7 +801,7 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub
*
* @param packages list of packages that have stopped.
* @param userState user state to be read & modified.
- * @return {@code true} if a service was enabled or a button target was removed,
+ * @return {@code true} if the lists of enabled services or buttons were changed,
* {@code false} otherwise.
*/
@VisibleForTesting
@@ -824,6 +824,7 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub
userState.getBindingServicesLocked().remove(comp);
userState.getCrashedServicesLocked().remove(comp);
enabledServicesChanged = true;
+ break;
}
}
}
@@ -851,132 +852,14 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub
return mPackageMonitor;
}
- private void registerBroadcastReceivers() {
- mPackageMonitor = new PackageMonitor(true) {
- @Override
- public void onSomePackagesChanged() {
- if (mTraceManager.isA11yTracingEnabledForTypes(FLAGS_PACKAGE_BROADCAST_RECEIVER)) {
- mTraceManager.logTrace(LOG_TAG + ".PM.onSomePackagesChanged",
- FLAGS_PACKAGE_BROADCAST_RECEIVER);
- }
-
- final int userId = getChangingUserId();
- List<AccessibilityServiceInfo> parsedAccessibilityServiceInfos = null;
- List<AccessibilityShortcutInfo> parsedAccessibilityShortcutInfos = null;
- parsedAccessibilityServiceInfos = parseAccessibilityServiceInfos(userId);
- parsedAccessibilityShortcutInfos = parseAccessibilityShortcutInfos(userId);
- synchronized (mLock) {
- // Only the profile parent can install accessibility services.
- // Therefore we ignore packages from linked profiles.
- if (userId != mCurrentUserId) {
- return;
- }
- onSomePackagesChangedLocked(parsedAccessibilityServiceInfos,
- parsedAccessibilityShortcutInfos);
- }
- }
-
- @Override
- public void onPackageUpdateFinished(String packageName, int uid) {
- // The package should already be removed from mBoundServices, and added into
- // mBindingServices in binderDied() during updating. Remove services from this
- // package from mBindingServices, and then update the user state to re-bind new
- // versions of them.
- if (mTraceManager.isA11yTracingEnabledForTypes(FLAGS_PACKAGE_BROADCAST_RECEIVER)) {
- mTraceManager.logTrace(LOG_TAG + ".PM.onPackageUpdateFinished",
- FLAGS_PACKAGE_BROADCAST_RECEIVER,
- "packageName=" + packageName + ";uid=" + uid);
- }
- final int userId = getChangingUserId();
- List<AccessibilityServiceInfo> parsedAccessibilityServiceInfos = null;
- List<AccessibilityShortcutInfo> parsedAccessibilityShortcutInfos = null;
- parsedAccessibilityServiceInfos = parseAccessibilityServiceInfos(userId);
- parsedAccessibilityShortcutInfos = parseAccessibilityShortcutInfos(userId);
- synchronized (mLock) {
- if (userId != mCurrentUserId) {
- return;
- }
- final AccessibilityUserState userState = getUserStateLocked(userId);
- final boolean reboundAService = userState.getBindingServicesLocked().removeIf(
- component -> component != null
- && component.getPackageName().equals(packageName))
- || userState.mCrashedServices.removeIf(component -> component != null
- && component.getPackageName().equals(packageName));
- // Reloads the installed services info to make sure the rebound service could
- // get a new one.
- userState.mInstalledServices.clear();
- final boolean configurationChanged;
- configurationChanged = readConfigurationForUserStateLocked(userState,
- parsedAccessibilityServiceInfos, parsedAccessibilityShortcutInfos);
- if (reboundAService || configurationChanged) {
- onUserStateChangedLocked(userState);
- }
- // Passing 0 for restoreFromSdkInt to have this migration check execute each
- // time. It can make sure a11y button settings are correctly if there's an a11y
- // service updated and modifies the a11y button configuration.
- migrateAccessibilityButtonSettingsIfNecessaryLocked(userState, packageName,
- /* restoreFromSdkInt = */0);
- }
- }
-
- @Override
- public void onPackageRemoved(String packageName, int uid) {
- if (mTraceManager.isA11yTracingEnabledForTypes(FLAGS_PACKAGE_BROADCAST_RECEIVER)) {
- mTraceManager.logTrace(LOG_TAG + ".PM.onPackageRemoved",
- FLAGS_PACKAGE_BROADCAST_RECEIVER,
- "packageName=" + packageName + ";uid=" + uid);
- }
-
- synchronized (mLock) {
- final int userId = getChangingUserId();
- // Only the profile parent can install accessibility services.
- // Therefore we ignore packages from linked profiles.
- if (userId != mCurrentUserId) {
- return;
- }
- onPackageRemovedLocked(packageName);
- }
- }
-
- /**
- * Handles instances in which a package or packages have forcibly stopped.
- *
- * @param intent intent containing package event information.
- * @param uid linux process user id (different from Android user id).
- * @param packages array of package names that have stopped.
- * @param doit whether to try and handle the stop or just log the trace.
- *
- * @return {@code true} if package should be restarted, {@code false} otherwise.
- */
- @Override
- public boolean onHandleForceStop(Intent intent, String[] packages,
- int uid, boolean doit) {
- if (mTraceManager.isA11yTracingEnabledForTypes(FLAGS_PACKAGE_BROADCAST_RECEIVER)) {
- mTraceManager.logTrace(LOG_TAG + ".PM.onHandleForceStop",
- FLAGS_PACKAGE_BROADCAST_RECEIVER,
- "intent=" + intent + ";packages=" + Arrays.toString(packages)
- + ";uid=" + uid + ";doit=" + doit);
- }
- synchronized (mLock) {
- final int userId = getChangingUserId();
- // Only the profile parent can install accessibility services.
- // Therefore we ignore packages from linked profiles.
- if (userId != mCurrentUserId) {
- return false;
- }
- final AccessibilityUserState userState = getUserStateLocked(userId);
-
- if (doit && onPackagesForceStoppedLocked(packages, userState)) {
- onUserStateChangedLocked(userState);
- return false;
- } else {
- return true;
- }
- }
- }
- };
+ @VisibleForTesting
+ void setPackageMonitor(PackageMonitor monitor) {
+ mPackageMonitor = monitor;
+ }
+ private void registerBroadcastReceivers() {
// package changes
+ mPackageMonitor = new ManagerPackageMonitor(this);
mPackageMonitor.register(mContext, null, UserHandle.ALL, true);
// user change and unlock
@@ -992,7 +875,9 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub
@Override
public void onReceive(Context context, Intent intent) {
if (mTraceManager.isA11yTracingEnabledForTypes(FLAGS_USER_BROADCAST_RECEIVER)) {
- mTraceManager.logTrace(LOG_TAG + ".BR.onReceive", FLAGS_USER_BROADCAST_RECEIVER,
+ mTraceManager.logTrace(
+ LOG_TAG + ".BR.onReceive",
+ FLAGS_USER_BROADCAST_RECEIVER,
"context=" + context + ";intent=" + intent);
}
@@ -1045,7 +930,8 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub
setNonA11yToolNotificationToMatchSafetyCenter();
}
};
- mContext.registerReceiverAsUser(receiver, UserHandle.ALL, filter, null, mMainHandler,
+ mContext.registerReceiverAsUser(
+ receiver, UserHandle.ALL, filter, null, mMainHandler,
Context.RECEIVER_EXPORTED);
if (!android.companion.virtual.flags.Flags.vdmPublicApis()) {
@@ -4371,7 +4257,7 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub
);
if (!targetWithNoTile.isEmpty()) {
- throw new IllegalArgumentException(
+ Slog.e(LOG_TAG,
"Unable to add/remove Tiles for a11y features: " + targetWithNoTile
+ "as the Tiles aren't provided");
}
@@ -6223,6 +6109,169 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub
}
}
+ @VisibleForTesting
+ public static class ManagerPackageMonitor extends PackageMonitor {
+ private final AccessibilityManagerService mManagerService;
+ public ManagerPackageMonitor(AccessibilityManagerService managerService) {
+ super(/* supportsPackageRestartQuery = */ true);
+ mManagerService = managerService;
+ }
+
+ @Override
+ public void onSomePackagesChanged() {
+ if (mManagerService.mTraceManager.isA11yTracingEnabledForTypes(
+ FLAGS_PACKAGE_BROADCAST_RECEIVER)) {
+ mManagerService.mTraceManager.logTrace(LOG_TAG + ".PM.onSomePackagesChanged",
+ FLAGS_PACKAGE_BROADCAST_RECEIVER);
+ }
+
+ final int userId = getChangingUserId();
+ List<AccessibilityServiceInfo> parsedAccessibilityServiceInfos = mManagerService
+ .parseAccessibilityServiceInfos(userId);
+ List<AccessibilityShortcutInfo> parsedAccessibilityShortcutInfos = mManagerService
+ .parseAccessibilityShortcutInfos(userId);
+ synchronized (mManagerService.getLock()) {
+ // Only the profile parent can install accessibility services.
+ // Therefore we ignore packages from linked profiles.
+ if (userId != mManagerService.getCurrentUserIdLocked()) {
+ return;
+ }
+ mManagerService.onSomePackagesChangedLocked(parsedAccessibilityServiceInfos,
+ parsedAccessibilityShortcutInfos);
+ }
+ }
+
+ @Override
+ public void onPackageUpdateFinished(String packageName, int uid) {
+ // The package should already be removed from mBoundServices, and added into
+ // mBindingServices in binderDied() during updating. Remove services from this
+ // package from mBindingServices, and then update the user state to re-bind new
+ // versions of them.
+ if (mManagerService.mTraceManager.isA11yTracingEnabledForTypes(
+ FLAGS_PACKAGE_BROADCAST_RECEIVER)) {
+ mManagerService.mTraceManager.logTrace(
+ LOG_TAG + ".PM.onPackageUpdateFinished",
+ FLAGS_PACKAGE_BROADCAST_RECEIVER,
+ "packageName=" + packageName + ";uid=" + uid);
+ }
+ final int userId = getChangingUserId();
+ List<AccessibilityServiceInfo> parsedAccessibilityServiceInfos = mManagerService
+ .parseAccessibilityServiceInfos(userId);
+ List<AccessibilityShortcutInfo> parsedAccessibilityShortcutInfos =
+ mManagerService.parseAccessibilityShortcutInfos(userId);
+ synchronized (mManagerService.getLock()) {
+ if (userId != mManagerService.getCurrentUserIdLocked()) {
+ return;
+ }
+ final AccessibilityUserState userState = mManagerService.getUserStateLocked(userId);
+ final boolean reboundAService = userState.getBindingServicesLocked().removeIf(
+ component -> component != null
+ && component.getPackageName().equals(packageName))
+ || userState.mCrashedServices.removeIf(component -> component != null
+ && component.getPackageName().equals(packageName));
+ // Reloads the installed services info to make sure the rebound service could
+ // get a new one.
+ userState.mInstalledServices.clear();
+ final boolean configurationChanged;
+ configurationChanged = mManagerService.readConfigurationForUserStateLocked(
+ userState, parsedAccessibilityServiceInfos,
+ parsedAccessibilityShortcutInfos);
+ if (reboundAService || configurationChanged) {
+ mManagerService.onUserStateChangedLocked(userState);
+ }
+ // Passing 0 for restoreFromSdkInt to have this migration check execute each
+ // time. It can make sure a11y button settings are correctly if there's an a11y
+ // service updated and modifies the a11y button configuration.
+ mManagerService.migrateAccessibilityButtonSettingsIfNecessaryLocked(
+ userState, packageName, /* restoreFromSdkInt = */0);
+ }
+ }
+
+ @Override
+ public void onPackageRemoved(String packageName, int uid) {
+ if (mManagerService.mTraceManager.isA11yTracingEnabledForTypes(
+ FLAGS_PACKAGE_BROADCAST_RECEIVER)) {
+ mManagerService.mTraceManager.logTrace(LOG_TAG + ".PM.onPackageRemoved",
+ FLAGS_PACKAGE_BROADCAST_RECEIVER,
+ "packageName=" + packageName + ";uid=" + uid);
+ }
+
+ synchronized (mManagerService.getLock()) {
+ final int userId = getChangingUserId();
+ // Only the profile parent can install accessibility services.
+ // Therefore we ignore packages from linked profiles.
+ if (userId != mManagerService.getCurrentUserIdLocked()) {
+ return;
+ }
+ mManagerService.onPackageRemovedLocked(packageName);
+ }
+ }
+
+ /**
+ * Handles instances in which a package or packages have forcibly stopped.
+ *
+ * @param intent intent containing package event information.
+ * @param uid linux process user id (different from Android user id).
+ * @param packages array of package names that have stopped.
+ * @param doit whether to try and handle the stop or just log the trace.
+ *
+ * @return {@code true} if doit == {@code false}
+ * and at least one of the provided packages is enabled.
+ * In any other case, returns {@code false}.
+ * This is to indicate whether further action is necessary.
+ */
+ @Override
+ public boolean onHandleForceStop(Intent intent, String[] packages,
+ int uid, boolean doit) {
+ if (mManagerService.mTraceManager.isA11yTracingEnabledForTypes(
+ FLAGS_PACKAGE_BROADCAST_RECEIVER)) {
+ mManagerService.mTraceManager.logTrace(LOG_TAG + ".PM.onHandleForceStop",
+ FLAGS_PACKAGE_BROADCAST_RECEIVER,
+ "intent=" + intent + ";packages=" + Arrays.toString(packages)
+ + ";uid=" + uid + ";doit=" + doit);
+ }
+ synchronized (mManagerService.getLock()) {
+ final int userId = getChangingUserId();
+ // Only the profile parent can install accessibility services.
+ // Therefore we ignore packages from linked profiles.
+ if (userId != mManagerService.getCurrentUserIdLocked()) {
+ return false;
+ }
+ final AccessibilityUserState userState = mManagerService.getUserStateLocked(userId);
+
+ if (Flags.managerPackageMonitorLogicFix()) {
+ if (!doit) {
+ // if we're not handling the stop here, then we only need to know
+ // if any of the force-stopped packages are currently enabled.
+ return userState.mEnabledServices.stream().anyMatch(
+ (comp) -> Arrays.stream(packages).anyMatch(
+ (pkg) -> pkg.equals(comp.getPackageName()))
+ );
+ } else if (mManagerService.onPackagesForceStoppedLocked(packages, userState)) {
+ mManagerService.onUserStateChangedLocked(userState);
+ }
+ return false;
+ } else {
+ // this old logic did not properly indicate when base packageMonitor's routine
+ // should handle stopping the package.
+ if (doit && mManagerService.onPackagesForceStoppedLocked(packages, userState)) {
+ mManagerService.onUserStateChangedLocked(userState);
+ return false;
+ } else {
+ return true;
+ }
+ }
+ }
+ }
+
+ @Override
+ public boolean onPackageChanged(String packageName, int uid, String[] components) {
+ // We care about all package changes, not just the whole package itself which is
+ // default behavior.
+ return true;
+ }
+ }
+
void sendPendingWindowStateChangedEventsForAvailableWindowLocked(int windowId) {
final int eventSize = mSendWindowStateChangedEventRunnables.size();
for (int i = eventSize - 1; i >= 0; i--) {
diff --git a/services/accessibility/java/com/android/server/accessibility/gestures/TouchExplorer.java b/services/accessibility/java/com/android/server/accessibility/gestures/TouchExplorer.java
index 2a7458fca249..04b42e49fad9 100644
--- a/services/accessibility/java/com/android/server/accessibility/gestures/TouchExplorer.java
+++ b/services/accessibility/java/com/android/server/accessibility/gestures/TouchExplorer.java
@@ -974,6 +974,10 @@ public class TouchExplorer extends BaseEventStreamTransformation
clear(event, policyFlags);
return;
case ACTION_POINTER_DOWN:
+ if (mDraggingPointerId != INVALID_POINTER_ID) {
+ mDispatcher.sendMotionEvent(
+ event, ACTION_UP, rawEvent, pointerIdBits, policyFlags);
+ }
if (mState.isServiceDetectingGestures()) {
mAms.sendMotionEventToListeningServices(rawEvent);
return;
@@ -981,10 +985,6 @@ public class TouchExplorer extends BaseEventStreamTransformation
// We are in dragging state so we have two pointers and another one
// goes down => delegate the three pointers to the view hierarchy
mState.startDelegating();
- if (mDraggingPointerId != INVALID_POINTER_ID) {
- mDispatcher.sendMotionEvent(
- event, ACTION_UP, rawEvent, pointerIdBits, policyFlags);
- }
mDispatcher.sendDownForAllNotInjectedPointers(event, policyFlags);
break;
case ACTION_MOVE:
diff --git a/services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java b/services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java
index 71b16c3a18b6..55677078f939 100644
--- a/services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java
+++ b/services/appwidget/java/com/android/server/appwidget/AppWidgetServiceImpl.java
@@ -521,9 +521,13 @@ class AppWidgetServiceImpl extends IAppWidgetService.Stub implements WidgetBacku
false);
final boolean packageRemovedPermanently =
(extras == null || !isReplacing || (isReplacing && isArchival));
-
if (packageRemovedPermanently) {
for (String pkgName : pkgList) {
+ if (DEBUG) {
+ Slog.i(TAG, "calling removeHostsAndProvidersForPackageLocked() "
+ + "because package removed permanently. extras=" + extras
+ + " isReplacing=" + isReplacing + " isArchival=" + isArchival);
+ }
componentsModified |= removeHostsAndProvidersForPackageLocked(
pkgName, userId);
}
@@ -2053,6 +2057,9 @@ class AppWidgetServiceImpl extends IAppWidgetService.Stub implements WidgetBacku
}
private void deleteHostLocked(Host host) {
+ if (DEBUG) {
+ Slog.i(TAG, "deleteHostLocked() " + host);
+ }
final int N = host.widgets.size();
for (int i = N - 1; i >= 0; i--) {
Widget widget = host.widgets.remove(i);
@@ -2065,6 +2072,9 @@ class AppWidgetServiceImpl extends IAppWidgetService.Stub implements WidgetBacku
}
private void deleteAppWidgetLocked(Widget widget) {
+ if (DEBUG) {
+ Slog.i(TAG, "deleteAppWidgetLocked() " + widget);
+ }
// We first unbind all services that are bound to this id
// Check if we need to destroy any services (if no other app widgets are
// referencing the same service)
@@ -2532,6 +2542,10 @@ class AppWidgetServiceImpl extends IAppWidgetService.Stub implements WidgetBacku
return widget;
}
}
+ if (DEBUG) {
+ Slog.i(TAG, "cannot find widget for appWidgetId=" + appWidgetId + " uid=" + uid
+ + " packageName=" + packageName);
+ }
return null;
}
@@ -2649,6 +2663,9 @@ class AppWidgetServiceImpl extends IAppWidgetService.Stub implements WidgetBacku
// Remove widgets for provider that are hosted in userId.
private void deleteWidgetsLocked(Provider provider, int userId) {
+ if (DEBUG) {
+ Slog.i(TAG, "deleteWidgetsLocked() provider=" + provider + " userId=" + userId);
+ }
final int N = provider.widgets.size();
for (int i = N - 1; i >= 0; i--) {
Widget widget = provider.widgets.get(i);
@@ -3326,6 +3343,9 @@ class AppWidgetServiceImpl extends IAppWidgetService.Stub implements WidgetBacku
* Adds the widget to mWidgets and tracks the package name in mWidgetPackages.
*/
void addWidgetLocked(Widget widget) {
+ if (DEBUG) {
+ Slog.i(TAG, "addWidgetLocked() " + widget);
+ }
mWidgets.add(widget);
onWidgetProviderAddedOrChangedLocked(widget);
@@ -3362,6 +3382,9 @@ class AppWidgetServiceImpl extends IAppWidgetService.Stub implements WidgetBacku
* removes the associated package from the cache.
*/
void removeWidgetLocked(Widget widget) {
+ if (DEBUG) {
+ Slog.i(TAG, "removeWidgetLocked() " + widget);
+ }
mWidgets.remove(widget);
onWidgetRemovedLocked(widget);
scheduleNotifyAppWidgetRemovedLocked(widget);
@@ -3396,6 +3419,9 @@ class AppWidgetServiceImpl extends IAppWidgetService.Stub implements WidgetBacku
* Clears all widgets and associated cache of packages with bound widgets.
*/
void clearWidgetsLocked() {
+ if (DEBUG) {
+ Slog.i(TAG, "clearWidgetsLocked()");
+ }
mWidgets.clear();
onWidgetsClearedLocked();
@@ -3757,6 +3783,9 @@ class AppWidgetServiceImpl extends IAppWidgetService.Stub implements WidgetBacku
}
void onUserStopped(int userId) {
+ if (DEBUG) {
+ Slog.i(TAG, "onUserStopped() " + userId);
+ }
synchronized (mLock) {
boolean crossProfileWidgetsChanged = false;
@@ -3994,6 +4023,10 @@ class AppWidgetServiceImpl extends IAppWidgetService.Stub implements WidgetBacku
}
private boolean removeHostsAndProvidersForPackageLocked(String pkgName, int userId) {
+ if (DEBUG) {
+ Slog.i(TAG, "removeHostsAndProvidersForPackageLocked() pkg=" + pkgName
+ + " userId=" + userId);
+ }
boolean removed = removeProvidersForPackageLocked(pkgName, userId);
// Delete the hosts for this package too
@@ -4552,6 +4585,10 @@ class AppWidgetServiceImpl extends IAppWidgetService.Stub implements WidgetBacku
// have the bind widget permission have access to the widget.
return true;
}
+ if (DEBUG) {
+ Slog.i(TAG, "canAccessAppWidget() failed. packageName=" + packageName
+ + " uid=" + uid + " userId=" + userId + " widget=" + widget);
+ }
return false;
}
diff --git a/services/core/java/com/android/server/BootReceiver.java b/services/core/java/com/android/server/BootReceiver.java
index 9f279b1ba3fe..f69a521130ab 100644
--- a/services/core/java/com/android/server/BootReceiver.java
+++ b/services/core/java/com/android/server/BootReceiver.java
@@ -34,6 +34,7 @@ import android.os.TombstoneWithHeadersProto;
import android.provider.Downloads;
import android.system.ErrnoException;
import android.system.Os;
+import android.system.OsConstants;
import android.text.TextUtils;
import android.util.AtomicFile;
import android.util.EventLog;
@@ -230,16 +231,23 @@ public class BootReceiver extends BroadcastReceiver {
}
private static String getCurrentBootHeaders() throws IOException {
- return new StringBuilder(512)
- .append("Build: ").append(Build.FINGERPRINT).append("\n")
- .append("Hardware: ").append(Build.BOARD).append("\n")
- .append("Revision: ")
- .append(SystemProperties.get("ro.revision", "")).append("\n")
- .append("Bootloader: ").append(Build.BOOTLOADER).append("\n")
- .append("Radio: ").append(Build.getRadioVersion()).append("\n")
- .append("Kernel: ")
- .append(FileUtils.readTextFile(new File("/proc/version"), 1024, "...\n"))
- .append("\n").toString();
+ StringBuilder builder = new StringBuilder(512)
+ .append("Build: ").append(Build.FINGERPRINT).append("\n")
+ .append("Hardware: ").append(Build.BOARD).append("\n")
+ .append("Revision: ")
+ .append(SystemProperties.get("ro.revision", "")).append("\n")
+ .append("Bootloader: ").append(Build.BOOTLOADER).append("\n")
+ .append("Radio: ").append(Build.getRadioVersion()).append("\n")
+ .append("Kernel: ")
+ .append(FileUtils.readTextFile(new File("/proc/version"), 1024, "...\n"));
+
+ // If device is not using 4KB pages, add the PageSize
+ long pageSize = Os.sysconf(OsConstants._SC_PAGESIZE);
+ if (pageSize != 4096) {
+ builder.append("PageSize: ").append(pageSize).append("\n");
+ }
+ builder.append("\n");
+ return builder.toString();
}
diff --git a/services/core/java/com/android/server/PinnerService.java b/services/core/java/com/android/server/PinnerService.java
index d9e6186639ce..ef03888d6620 100644
--- a/services/core/java/com/android/server/PinnerService.java
+++ b/services/core/java/com/android/server/PinnerService.java
@@ -21,6 +21,7 @@ import static android.app.ActivityManager.UID_OBSERVER_GONE;
import static android.os.Process.SYSTEM_UID;
import static com.android.server.flags.Flags.pinWebview;
+import static com.android.server.flags.Flags.skipHomeArtPins;
import android.annotation.EnforcePermission;
import android.annotation.IntDef;
@@ -851,6 +852,9 @@ public final class PinnerService extends SystemService {
}
int apkPinSizeLimit = pinSizeLimit;
+
+ boolean shouldSkipArtPins = key == KEY_HOME && skipHomeArtPins();
+
for (String apk: apks) {
if (apkPinSizeLimit <= 0) {
Slog.w(TAG, "Reached to the pin size limit. Skipping: " + apk);
@@ -874,8 +878,8 @@ public final class PinnerService extends SystemService {
}
apkPinSizeLimit -= pf.bytesPinned;
- if (apk.equals(appInfo.sourceDir)) {
- pinOptimizedDexDependencies(pf, apkPinSizeLimit, appInfo);
+ if (apk.equals(appInfo.sourceDir) && !shouldSkipArtPins) {
+ pinOptimizedDexDependencies(pf, Integer.MAX_VALUE, appInfo);
}
}
}
@@ -921,8 +925,8 @@ public final class PinnerService extends SystemService {
}
pf.groupName = groupName != null ? groupName : "";
- maxBytesToPin -= bytesPinned;
bytesPinned += pf.bytesPinned;
+ maxBytesToPin -= bytesPinned;
synchronized (this) {
mPinnedFiles.put(pf.fileName, pf);
@@ -970,7 +974,7 @@ public final class PinnerService extends SystemService {
// Unpin if it was already pinned prior to re-pinning.
unpinFile(file);
- PinnedFile df = mInjector.pinFileInternal(file, Integer.MAX_VALUE,
+ PinnedFile df = mInjector.pinFileInternal(file, maxBytesToPin,
/*attemptPinIntrospection=*/false);
if (df == null) {
Slog.i(TAG, "Failed to pin ART file = " + file);
diff --git a/services/core/java/com/android/server/TEST_MAPPING b/services/core/java/com/android/server/TEST_MAPPING
index 04e85c7f117a..a3b6d806c6ce 100644
--- a/services/core/java/com/android/server/TEST_MAPPING
+++ b/services/core/java/com/android/server/TEST_MAPPING
@@ -134,6 +134,13 @@
},
{
"name": "CtsSuspendAppsTestCases"
+ },
+ {
+ "name": "CtsWindowManagerBackgroundActivityTestCases",
+ "file_patterns": [
+ "Background.*\\.java",
+ "Activity.*\\.java"
+ ]
}
],
"presubmit-large": [
@@ -189,18 +196,16 @@
"name": "SelinuxFrameworksTests"
},
{
- "name": "CtsWindowManagerBackgroundActivityTestCases",
- "file_patterns": [
- "Background.*\\.java",
- "Activity.*\\.java"
- ]
- },
- {
"name": "WmTests",
"file_patterns": [
"Background.*\\.java",
"Activity.*\\.java"
+ ],
+ "options": [
+ {
+ "include-filter": "com.android.server.wm.BackgroundActivityStart*"
+ }
]
}
- ]
+ ]
}
diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java
index 00d8efa764ce..4c8f41608f46 100644
--- a/services/core/java/com/android/server/am/ActivityManagerService.java
+++ b/services/core/java/com/android/server/am/ActivityManagerService.java
@@ -372,6 +372,8 @@ import android.provider.DeviceConfig;
import android.provider.Settings;
import android.server.ServerProtoEnums;
import android.sysprop.InitProperties;
+import android.system.Os;
+import android.system.OsConstants;
import android.telephony.TelephonyManager;
import android.text.TextUtils;
import android.text.style.SuggestionSpan;
@@ -5588,32 +5590,30 @@ public class ActivityManagerService extends IActivityManager.Stub
// security checking for it above.
userId = UserHandle.USER_CURRENT;
}
- try {
- if (owningUid != 0 && owningUid != SYSTEM_UID) {
- final int uid = AppGlobals.getPackageManager().getPackageUid(packageName,
- MATCH_DEBUG_TRIAGED_MISSING, UserHandle.getUserId(owningUid));
- if (!UserHandle.isSameApp(owningUid, uid)) {
- String msg = "Permission Denial: getIntentSender() from pid="
- + Binder.getCallingPid()
- + ", uid=" + owningUid
- + ", (need uid=" + uid + ")"
- + " is not allowed to send as package " + packageName;
- Slog.w(TAG, msg);
- throw new SecurityException(msg);
- }
- }
- if (type == ActivityManager.INTENT_SENDER_ACTIVITY_RESULT) {
- return mAtmInternal.getIntentSender(type, packageName, featureId, owningUid,
- userId, token, resultWho, requestCode, intents, resolvedTypes, flags,
- bOptions);
+ if (owningUid != 0 && owningUid != SYSTEM_UID) {
+ if (!getPackageManagerInternal().isSameApp(
+ packageName,
+ MATCH_DEBUG_TRIAGED_MISSING,
+ owningUid,
+ UserHandle.getUserId(owningUid))) {
+ String msg = "Permission Denial: getIntentSender() from pid="
+ + Binder.getCallingPid()
+ + ", uid=" + owningUid
+ + " is not allowed to send as package " + packageName;
+ Slog.w(TAG, msg);
+ throw new SecurityException(msg);
}
- return mPendingIntentController.getIntentSender(type, packageName, featureId,
- owningUid, userId, token, resultWho, requestCode, intents, resolvedTypes,
- flags, bOptions);
- } catch (RemoteException e) {
- throw new SecurityException(e);
}
+
+ if (type == ActivityManager.INTENT_SENDER_ACTIVITY_RESULT) {
+ return mAtmInternal.getIntentSender(type, packageName, featureId, owningUid,
+ userId, token, resultWho, requestCode, intents, resolvedTypes, flags,
+ bOptions);
+ }
+ return mPendingIntentController.getIntentSender(type, packageName, featureId,
+ owningUid, userId, token, resultWho, requestCode, intents, resolvedTypes,
+ flags, bOptions);
}
@Override
@@ -9911,6 +9911,13 @@ public class ActivityManagerService extends IActivityManager.Stub
sb.append("ErrorId: ").append(errorId.toString()).append("\n");
}
sb.append("Build: ").append(Build.FINGERPRINT).append("\n");
+
+ // If device is not using 4KB pages, add the PageSize
+ long pageSize = Os.sysconf(OsConstants._SC_PAGESIZE);
+ if (pageSize != 4096) {
+ sb.append("PageSize: ").append(pageSize).append("\n");
+ }
+
if (Debug.isDebuggerConnected()) {
sb.append("Debugger: Connected\n");
}
@@ -19975,6 +19982,26 @@ public class ActivityManagerService extends IActivityManager.Stub
addStartInfoTimestampInternal(key, timestampNs, userId, uid);
}
+
+ @Override
+ public void killApplicationSync(String pkgName, int appId, int userId,
+ String reason, int exitInfoReason) {
+ if (pkgName == null) {
+ return;
+ }
+ // Make sure the uid is valid.
+ if (appId < 0) {
+ Slog.w(TAG, "Invalid appid specified for pkg : " + pkgName);
+ return;
+ }
+ synchronized (ActivityManagerService.this) {
+ ActivityManagerService.this.forceStopPackageLocked(pkgName, appId,
+ /* callerWillRestart= */ false, /*purgeCache= */ false,
+ /* doit= */ true, /* evenPersistent= */ false,
+ /* uninstalling= */ false, /* packageStateStopped= */ false,
+ userId, reason, exitInfoReason);
+ }
+ }
}
long inputDispatchingTimedOut(int pid, final boolean aboveSystem, TimeoutRecord timeoutRecord) {
diff --git a/services/core/java/com/android/server/am/BatteryStatsService.java b/services/core/java/com/android/server/am/BatteryStatsService.java
index 58732fd200d2..7c0325e7376a 100644
--- a/services/core/java/com/android/server/am/BatteryStatsService.java
+++ b/services/core/java/com/android/server/am/BatteryStatsService.java
@@ -124,6 +124,7 @@ import com.android.server.power.stats.BatteryExternalStatsWorker;
import com.android.server.power.stats.BatteryStatsDumpHelperImpl;
import com.android.server.power.stats.BatteryStatsImpl;
import com.android.server.power.stats.BatteryUsageStatsProvider;
+import com.android.server.power.stats.BluetoothPowerStatsProcessor;
import com.android.server.power.stats.CpuPowerStatsProcessor;
import com.android.server.power.stats.MobileRadioPowerStatsProcessor;
import com.android.server.power.stats.PhoneCallPowerStatsProcessor;
@@ -502,6 +503,17 @@ public final class BatteryStatsService extends IBatteryStats.Stub
AggregatedPowerStatsConfig.STATE_PROCESS_STATE)
.setProcessor(
new WifiPowerStatsProcessor(mPowerProfile));
+
+ config.trackPowerComponent(BatteryConsumer.POWER_COMPONENT_BLUETOOTH)
+ .trackDeviceStates(
+ AggregatedPowerStatsConfig.STATE_POWER,
+ AggregatedPowerStatsConfig.STATE_SCREEN)
+ .trackUidStates(
+ AggregatedPowerStatsConfig.STATE_POWER,
+ AggregatedPowerStatsConfig.STATE_SCREEN,
+ AggregatedPowerStatsConfig.STATE_PROCESS_STATE)
+ .setProcessor(
+ new BluetoothPowerStatsProcessor(mPowerProfile));
return config;
}
@@ -563,6 +575,12 @@ public final class BatteryStatsService extends IBatteryStats.Stub
BatteryConsumer.POWER_COMPONENT_WIFI,
Flags.streamlinedConnectivityBatteryStats());
+ mStats.setPowerStatsCollectorEnabled(BatteryConsumer.POWER_COMPONENT_BLUETOOTH,
+ Flags.streamlinedConnectivityBatteryStats());
+ mBatteryUsageStatsProvider.setPowerStatsExporterEnabled(
+ BatteryConsumer.POWER_COMPONENT_BLUETOOTH,
+ Flags.streamlinedConnectivityBatteryStats());
+
mWorker.systemServicesReady();
mStats.systemServicesReady(mContext);
mCpuWakeupStats.systemServicesReady();
diff --git a/services/core/java/com/android/server/am/OomAdjusterModernImpl.java b/services/core/java/com/android/server/am/OomAdjusterModernImpl.java
index 9600317faca1..a67af89ad39d 100644
--- a/services/core/java/com/android/server/am/OomAdjusterModernImpl.java
+++ b/services/core/java/com/android/server/am/OomAdjusterModernImpl.java
@@ -84,6 +84,7 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
+import java.util.function.ToIntFunction;
/**
* A modern implementation of the oom adjuster.
@@ -271,11 +272,31 @@ public class OomAdjusterModernImpl extends OomAdjuster {
// The last node besides the tail.
private final ProcessRecordNode[] mLastNode;
+ private final ToIntFunction<ProcessRecord> mSlotFunction;
+ // Cache of the most important slot with a node in it.
+ private int mFirstPopulatedSlot = 0;
+
ProcessRecordNodes(@ProcessRecordNode.NodeType int type, int size) {
mType = type;
+ final ToIntFunction<ProcessRecord> valueFunction;
+ switch (mType) {
+ case ProcessRecordNode.NODE_TYPE_PROC_STATE:
+ valueFunction = (proc) -> proc.mState.getCurProcState();
+ mSlotFunction = (proc) -> processStateToSlot(proc.mState.getCurProcState());
+ break;
+ case ProcessRecordNode.NODE_TYPE_ADJ:
+ valueFunction = (proc) -> proc.mState.getCurRawAdj();
+ mSlotFunction = (proc) -> adjToSlot(proc.mState.getCurRawAdj());
+ break;
+ default:
+ valueFunction = (proc) -> 0;
+ mSlotFunction = (proc) -> 0;
+ break;
+ }
+
mProcessRecordNodes = new LinkedProcessRecordList[size];
for (int i = 0; i < size; i++) {
- mProcessRecordNodes[i] = new LinkedProcessRecordList(type);
+ mProcessRecordNodes[i] = new LinkedProcessRecordList(valueFunction);
}
mLastNode = new ProcessRecordNode[size];
resetLastNodes();
@@ -294,6 +315,11 @@ public class OomAdjusterModernImpl extends OomAdjuster {
}
void resetLastNodes() {
+ if (Flags.simplifyProcessTraversal()) {
+ // Last nodes are no longer used. Just reset instead.
+ reset();
+ return;
+ }
for (int i = 0; i < mProcessRecordNodes.length; i++) {
mLastNode[i] = mProcessRecordNodes[i].getLastNodeBeforeTail();
}
@@ -308,6 +334,36 @@ public class OomAdjusterModernImpl extends OomAdjuster {
final ProcessRecordNode tail = mProcessRecordNodes[slot].TAIL;
while (node != tail) {
mTmpOomAdjusterArgs.mApp = node.mApp;
+ if (node.mApp == null) {
+ // TODO(b/336178916) - Temporary logging for root causing b/336178916.
+ StringBuilder sb = new StringBuilder();
+ sb.append("Iterating null process during OomAdjuster traversal!!!\n");
+ sb.append("Type:");
+ switch (mType) {
+ case ProcessRecordNode.NODE_TYPE_PROC_STATE -> sb.append(
+ "NODE_TYPE_PROC_STATE");
+ case ProcessRecordNode.NODE_TYPE_ADJ -> sb.append("NODE_TYPE_ADJ");
+ default -> sb.append("UNKNOWN");
+ }
+ sb.append(", Slot:");
+ sb.append(slot);
+ sb.append("\nLAST:");
+ ProcessRecordNode last = mLastNode[slot];
+ if (last.mApp == null) {
+ sb.append("null");
+ } else {
+ sb.append(last);
+ sb.append("\nSetProcState:");
+ sb.append(last.mApp.getSetProcState());
+ sb.append(", CurProcState:");
+ sb.append(last.mApp.mState.getCurProcState());
+ sb.append(", SetAdj:");
+ sb.append(last.mApp.getSetAdj());
+ sb.append(", CurRawAdj:");
+ sb.append(last.mApp.mState.getCurRawAdj());
+ }
+ Slog.wtfStack(TAG, sb.toString());
+ }
// Save the next before calling callback, since that may change the node.mNext.
final ProcessRecordNode next = node.mNext;
callback.accept(mTmpOomAdjusterArgs);
@@ -325,6 +381,33 @@ public class OomAdjusterModernImpl extends OomAdjuster {
}
}
+ ProcessRecord poll() {
+ ProcessRecordNode node = null;
+ final int size = mProcessRecordNodes.length;
+ // Find the next node.
+ while (node == null && mFirstPopulatedSlot < size) {
+ node = mProcessRecordNodes[mFirstPopulatedSlot].poll();
+ if (node == null) {
+ // This slot is now empty, move on to the next.
+ mFirstPopulatedSlot++;
+ }
+ }
+ if (node == null) return null;
+ return node.mApp;
+ }
+
+ void offer(ProcessRecord proc) {
+ ProcessRecordNode node = proc.mLinkedNodes[mType];
+ // Find which slot to add the node to.
+ final int newSlot = mSlotFunction.applyAsInt(proc);
+ if (newSlot < mFirstPopulatedSlot) {
+ // node is being added to a more important slot.
+ mFirstPopulatedSlot = newSlot;
+ }
+ node.unlink();
+ mProcessRecordNodes[newSlot].offer(node);
+ }
+
int getNumberOfSlots() {
return mProcessRecordNodes.length;
}
@@ -423,12 +506,35 @@ public class OomAdjusterModernImpl extends OomAdjuster {
// Sentinel head/tail, to make bookkeeping work easier.
final ProcessRecordNode HEAD = new ProcessRecordNode(null);
final ProcessRecordNode TAIL = new ProcessRecordNode(null);
- final @ProcessRecordNode.NodeType int mNodeType;
+ final ToIntFunction<ProcessRecord> mValueFunction;
- LinkedProcessRecordList(@ProcessRecordNode.NodeType int nodeType) {
+ LinkedProcessRecordList(ToIntFunction<ProcessRecord> valueFunction) {
HEAD.mNext = TAIL;
TAIL.mPrev = HEAD;
- mNodeType = nodeType;
+ mValueFunction = valueFunction;
+ }
+
+ ProcessRecordNode poll() {
+ final ProcessRecordNode next = HEAD.mNext;
+ if (next == TAIL) return null;
+ next.unlink();
+ return next;
+ }
+
+ void offer(@NonNull ProcessRecordNode node) {
+ final int newValue = mValueFunction.applyAsInt(node.mApp);
+
+ // Find the last node with less than or equal value to the new node.
+ ProcessRecordNode curNode = TAIL.mPrev;
+ while (curNode != HEAD && mValueFunction.applyAsInt(curNode.mApp) > newValue) {
+ curNode = curNode.mPrev;
+ }
+
+ // Insert the new node after the found node.
+ node.mPrev = curNode;
+ node.mNext = curNode.mNext;
+ curNode.mNext.mPrev = node;
+ curNode.mNext = node;
}
void append(@NonNull ProcessRecordNode node) {
@@ -727,34 +833,50 @@ public class OomAdjusterModernImpl extends OomAdjuster {
private void updateAdjSlotIfNecessary(ProcessRecord app, int prevRawAdj) {
if (app.mState.getCurRawAdj() != prevRawAdj) {
- final int slot = adjToSlot(app.mState.getCurRawAdj());
- final int prevSlot = adjToSlot(prevRawAdj);
- if (slot != prevSlot && slot != ADJ_SLOT_INVALID) {
- mProcessRecordAdjNodes.moveAppTo(app, prevSlot, slot);
+ if (Flags.simplifyProcessTraversal()) {
+ mProcessRecordAdjNodes.offer(app);
+ } else {
+ final int slot = adjToSlot(app.mState.getCurRawAdj());
+ final int prevSlot = adjToSlot(prevRawAdj);
+ if (slot != prevSlot && slot != ADJ_SLOT_INVALID) {
+ mProcessRecordAdjNodes.moveAppTo(app, prevSlot, slot);
+ }
}
}
}
private void updateAdjSlot(ProcessRecord app, int prevRawAdj) {
- final int slot = adjToSlot(app.mState.getCurRawAdj());
- final int prevSlot = adjToSlot(prevRawAdj);
- mProcessRecordAdjNodes.moveAppTo(app, prevSlot, slot);
+ if (Flags.simplifyProcessTraversal()) {
+ mProcessRecordAdjNodes.offer(app);
+ } else {
+ final int slot = adjToSlot(app.mState.getCurRawAdj());
+ final int prevSlot = adjToSlot(prevRawAdj);
+ mProcessRecordAdjNodes.moveAppTo(app, prevSlot, slot);
+ }
}
private void updateProcStateSlotIfNecessary(ProcessRecord app, int prevProcState) {
if (app.mState.getCurProcState() != prevProcState) {
- final int slot = processStateToSlot(app.mState.getCurProcState());
- final int prevSlot = processStateToSlot(prevProcState);
- if (slot != prevSlot) {
- mProcessRecordProcStateNodes.moveAppTo(app, prevSlot, slot);
+ if (Flags.simplifyProcessTraversal()) {
+ mProcessRecordProcStateNodes.offer(app);
+ } else {
+ final int slot = processStateToSlot(app.mState.getCurProcState());
+ final int prevSlot = processStateToSlot(prevProcState);
+ if (slot != prevSlot) {
+ mProcessRecordProcStateNodes.moveAppTo(app, prevSlot, slot);
+ }
}
}
}
private void updateProcStateSlot(ProcessRecord app, int prevProcState) {
- final int slot = processStateToSlot(app.mState.getCurProcState());
- final int prevSlot = processStateToSlot(prevProcState);
- mProcessRecordProcStateNodes.moveAppTo(app, prevSlot, slot);
+ if (Flags.simplifyProcessTraversal()) {
+ mProcessRecordProcStateNodes.offer(app);
+ } else {
+ final int slot = processStateToSlot(app.mState.getCurProcState());
+ final int prevSlot = processStateToSlot(prevProcState);
+ mProcessRecordProcStateNodes.moveAppTo(app, prevSlot, slot);
+ }
}
@Override
@@ -832,8 +954,15 @@ public class OomAdjusterModernImpl extends OomAdjuster {
// Compute initial values, the procState and adj priority queues will be populated here.
computeOomAdjLSP(app, UNKNOWN_ADJ, topApp, true, now, false, false, oomAdjReason,
false);
- updateProcStateSlot(app, prevProcState);
- updateAdjSlot(app, prevAdj);
+
+ if (Flags.simplifyProcessTraversal()) {
+ // Just add to the procState priority queue. The adj priority queue should be
+ // empty going into the traversal step.
+ mProcessRecordProcStateNodes.offer(app);
+ } else {
+ updateProcStateSlot(app, prevProcState);
+ updateAdjSlot(app, prevAdj);
+ }
}
// Set adj last nodes now, this way a process will only be reevaluated during the adj node
@@ -851,14 +980,32 @@ public class OomAdjusterModernImpl extends OomAdjuster {
*/
@GuardedBy({"mService", "mProcLock"})
private void computeConnectionsLSP() {
- // 1st pass, scan each slot in the procstate node list.
- for (int i = 0, end = mProcessRecordProcStateNodes.size() - 1; i < end; i++) {
- mProcessRecordProcStateNodes.forEachNewNode(i, mComputeConnectionsConsumer);
- }
+ if (Flags.simplifyProcessTraversal()) {
+ // 1st pass, iterate all nodes in order of procState importance.
+ ProcessRecord proc = mProcessRecordProcStateNodes.poll();
+ while (proc != null) {
+ mTmpOomAdjusterArgs.mApp = proc;
+ mComputeConnectionsConsumer.accept(mTmpOomAdjusterArgs);
+ proc = mProcessRecordProcStateNodes.poll();
+ }
+
+ // 2st pass, iterate all nodes in order of procState importance.
+ proc = mProcessRecordAdjNodes.poll();
+ while (proc != null) {
+ mTmpOomAdjusterArgs.mApp = proc;
+ mComputeConnectionsConsumer.accept(mTmpOomAdjusterArgs);
+ proc = mProcessRecordAdjNodes.poll();
+ }
+ } else {
+ // 1st pass, scan each slot in the procstate node list.
+ for (int i = 0, end = mProcessRecordProcStateNodes.size() - 1; i < end; i++) {
+ mProcessRecordProcStateNodes.forEachNewNode(i, mComputeConnectionsConsumer);
+ }
- // 2nd pass, scan each slot in the adj node list.
- for (int i = 0, end = mProcessRecordAdjNodes.size() - 1; i < end; i++) {
- mProcessRecordAdjNodes.forEachNewNode(i, mComputeConnectionsConsumer);
+ // 2nd pass, scan each slot in the adj node list.
+ for (int i = 0, end = mProcessRecordAdjNodes.size() - 1; i < end; i++) {
+ mProcessRecordAdjNodes.forEachNewNode(i, mComputeConnectionsConsumer);
+ }
}
}
@@ -987,8 +1134,14 @@ public class OomAdjusterModernImpl extends OomAdjuster {
args.mApp = reachable;
computeOomAdjIgnoringReachablesLSP(args);
- updateProcStateSlot(reachable, prevProcState);
- updateAdjSlot(reachable, prevAdj);
+ if (Flags.simplifyProcessTraversal()) {
+ // Just add to the procState priority queue. The adj priority queue should be
+ // empty going into the traversal step.
+ mProcessRecordProcStateNodes.offer(reachable);
+ } else {
+ updateProcStateSlot(reachable, prevProcState);
+ updateAdjSlot(reachable, prevAdj);
+ }
}
}
diff --git a/services/core/java/com/android/server/am/ProcessList.java b/services/core/java/com/android/server/am/ProcessList.java
index a5449a0f0431..6779f7a37f20 100644
--- a/services/core/java/com/android/server/am/ProcessList.java
+++ b/services/core/java/com/android/server/am/ProcessList.java
@@ -37,7 +37,6 @@ import static android.os.Process.startWebView;
import static android.system.OsConstants.EAGAIN;
import static com.android.sdksandbox.flags.Flags.selinuxSdkSandboxAudit;
-import static com.android.sdksandbox.flags.Flags.selinuxSdkSandboxInputSelector;
import static com.android.server.am.ActivityManagerDebugConfig.DEBUG_LRU;
import static com.android.server.am.ActivityManagerDebugConfig.DEBUG_NETWORK;
import static com.android.server.am.ActivityManagerDebugConfig.DEBUG_PROCESSES;
@@ -2066,15 +2065,11 @@ public final class ProcessList {
}
}
- if (selinuxSdkSandboxInputSelector()) {
- return app.info.seInfo + extraInfo + TextUtils.emptyIfNull(app.info.seInfoUser);
- } else {
- return app.info.seInfo
- + (TextUtils.isEmpty(app.info.seInfoUser) ? "" : app.info.seInfoUser)
- + extraInfo;
- }
+ return app.info.seInfo
+ + (TextUtils.isEmpty(app.info.seInfoUser) ? "" : app.info.seInfoUser) + extraInfo;
}
+
@GuardedBy("mService")
boolean startProcessLocked(HostingRecord hostingRecord, String entryPoint, ProcessRecord app,
int uid, int[] gids, int runtimeFlags, int zygotePolicyFlags, int mountExternal,
diff --git a/services/core/java/com/android/server/am/SettingsToPropertiesMapper.java b/services/core/java/com/android/server/am/SettingsToPropertiesMapper.java
index 5793758d7a6e..032093b91746 100644
--- a/services/core/java/com/android/server/am/SettingsToPropertiesMapper.java
+++ b/services/core/java/com/android/server/am/SettingsToPropertiesMapper.java
@@ -157,6 +157,7 @@ public class SettingsToPropertiesMapper {
"car_telemetry",
"codec_fwk",
"companion",
+ "com_android_adbd",
"content_protection",
"context_hub",
"core_experiments_team_internal",
@@ -341,33 +342,29 @@ public class SettingsToPropertiesMapper {
AsyncTask.THREAD_POOL_EXECUTOR,
(DeviceConfig.Properties properties) -> {
- HashMap<String, HashMap<String, String>> propsToStage =
- getStagedFlagsWithValueChange(properties);
+ for (String flagName : properties.getKeyset()) {
+ String flagValue = properties.getString(flagName, null);
+ if (flagName == null || flagValue == null) {
+ continue;
+ }
- // send prop stage request to sys prop
- for (HashMap.Entry<String, HashMap<String, String>> entry : propsToStage.entrySet()) {
- String actualNamespace = entry.getKey();
- HashMap<String, String> flagValuesToStage = entry.getValue();
+ int idx = flagName.indexOf(NAMESPACE_REBOOT_STAGING_DELIMITER);
+ if (idx == -1 || idx == flagName.length() - 1 || idx == 0) {
+ logErr("invalid staged flag: " + flagName);
+ continue;
+ }
- for (String flagName : flagValuesToStage.keySet()) {
- String stagedValue = flagValuesToStage.get(flagName);
+ String actualNamespace = flagName.substring(0, idx);
+ String actualFlagName = flagName.substring(idx+1);
String propertyName = "next_boot." + makeAconfigFlagPropertyName(
- actualNamespace, flagName);
+ actualNamespace, actualFlagName);
- if (!propertyName.matches(SYSTEM_PROPERTY_VALID_CHARACTERS_REGEX)
- || propertyName.contains(SYSTEM_PROPERTY_INVALID_SUBSTRING)) {
- logErr("unable to construct system property for " + actualNamespace
- + "/" + flagName);
- continue;
- }
-
- setProperty(propertyName, stagedValue);
- }
+ setProperty(propertyName, flagValue);
}
// send prop stage request to new storage
if (enableAconfigStorageDaemon()) {
- stageFlagsInNewStorage(propsToStage);
+ stageFlagsInNewStorage(properties);
}
});
@@ -606,25 +603,33 @@ public class SettingsToPropertiesMapper {
* @param propsToStage
*/
@VisibleForTesting
- static void stageFlagsInNewStorage(HashMap<String, HashMap<String, String>> propsToStage) {
+ static void stageFlagsInNewStorage(DeviceConfig.Properties props) {
// write aconfigd requests proto to proto output stream
int num_requests = 0;
ProtoOutputStream requests = new ProtoOutputStream();
- for (HashMap.Entry<String, HashMap<String, String>> entry : propsToStage.entrySet()) {
- String actualNamespace = entry.getKey();
- HashMap<String, String> flagValuesToStage = entry.getValue();
- for (String fullFlagName : flagValuesToStage.keySet()) {
- String stagedValue = flagValuesToStage.get(fullFlagName);
- int idx = fullFlagName.lastIndexOf(".");
- if (idx == -1) {
- logErr("invalid flag name: " + fullFlagName);
- continue;
- }
- String packageName = fullFlagName.substring(0, idx);
- String flagName = fullFlagName.substring(idx+1);
- writeFlagOverrideRequest(requests, packageName, flagName, stagedValue, false);
- ++num_requests;
+ for (String flagName : props.getKeyset()) {
+ String flagValue = props.getString(flagName, null);
+ if (flagName == null || flagValue == null) {
+ continue;
}
+
+ int idx = flagName.indexOf("*");
+ if (idx == -1 || idx == flagName.length() - 1 || idx == 0) {
+ logErr("invalid local flag override: " + flagName);
+ continue;
+ }
+ String actualNamespace = flagName.substring(0, idx);
+ String fullFlagName = flagName.substring(idx+1);
+
+ idx = fullFlagName.lastIndexOf(".");
+ if (idx == -1) {
+ logErr("invalid flag name: " + fullFlagName);
+ continue;
+ }
+ String packageName = fullFlagName.substring(0, idx);
+ String realFlagName = fullFlagName.substring(idx+1);
+ writeFlagOverrideRequest(requests, packageName, realFlagName, flagValue, false);
+ ++num_requests;
}
if (num_requests == 0) {
@@ -636,7 +641,7 @@ public class SettingsToPropertiesMapper {
// deserialize back using proto input stream
try {
- parseAndLogAconfigdReturn(returns);
+ parseAndLogAconfigdReturn(returns);
} catch (IOException ioe) {
logErr("failed to parse aconfigd return", ioe);
}
@@ -664,63 +669,6 @@ public class SettingsToPropertiesMapper {
return propertyName;
}
- /**
- * Get the flags that need to be staged in sys prop, only these with a real value
- * change needs to be staged in sys prop. Otherwise, the flag stage is useless and
- * create performance problem at sys prop side.
- * @param properties
- * @return a hash map of namespace name to actual flags to stage
- */
- @VisibleForTesting
- static HashMap<String, HashMap<String, String>> getStagedFlagsWithValueChange(
- DeviceConfig.Properties properties) {
-
- // sort flags by actual namespace of the flag
- HashMap<String, HashMap<String, String>> stagedProps = new HashMap<>();
- for (String flagName : properties.getKeyset()) {
- int idx = flagName.indexOf(NAMESPACE_REBOOT_STAGING_DELIMITER);
- if (idx == -1 || idx == flagName.length() - 1 || idx == 0) {
- logErr("invalid staged flag: " + flagName);
- continue;
- }
- String actualNamespace = flagName.substring(0, idx);
- String actualFlagName = flagName.substring(idx+1);
- HashMap<String, String> flagStagedValues = stagedProps.get(actualNamespace);
- if (flagStagedValues == null) {
- flagStagedValues = new HashMap<String, String>();
- stagedProps.put(actualNamespace, flagStagedValues);
- }
- flagStagedValues.put(actualFlagName, properties.getString(flagName, null));
- }
-
- // for each namespace, find flags with real flag value change
- HashMap<String, HashMap<String, String>> propsToStage = new HashMap<>();
- for (HashMap.Entry<String, HashMap<String, String>> entry : stagedProps.entrySet()) {
- String actualNamespace = entry.getKey();
- HashMap<String, String> flagStagedValues = entry.getValue();
- Map<String, String> flagCurrentValues = Settings.Config.getStrings(
- actualNamespace, new ArrayList<String>(flagStagedValues.keySet()));
-
- HashMap<String, String> flagsToStage = new HashMap<>();
- for (String flagName : flagStagedValues.keySet()) {
- String stagedValue = flagStagedValues.get(flagName);
- String currentValue = flagCurrentValues.get(flagName);
- if (stagedValue == null) {
- continue;
- }
- if (currentValue == null || !stagedValue.equalsIgnoreCase(currentValue)) {
- flagsToStage.put(flagName, stagedValue);
- }
- }
-
- if (!flagsToStage.isEmpty()) {
- propsToStage.put(actualNamespace, flagsToStage);
- }
- }
-
- return propsToStage;
- }
-
private void setProperty(String key, String value) {
// Check if need to clear the property
if (value == null) {
diff --git a/services/core/java/com/android/server/am/flags.aconfig b/services/core/java/com/android/server/am/flags.aconfig
index b7108dfcbac3..afde4f71a95f 100644
--- a/services/core/java/com/android/server/am/flags.aconfig
+++ b/services/core/java/com/android/server/am/flags.aconfig
@@ -123,3 +123,14 @@ flag {
description: "Avoid OomAdjuster calculations for connections that won't change importance"
bug: "323376416"
}
+
+flag {
+ name: "simplify_process_traversal"
+ namespace: "backstage_power"
+ description: "Simplify the OomAdjuster's process traversal mechanism."
+ bug: "336178916"
+ is_fixed_read_only: true
+ metadata {
+ purpose: PURPOSE_BUGFIX
+ }
+}
diff --git a/services/core/java/com/android/server/appop/AppOpsService.java b/services/core/java/com/android/server/appop/AppOpsService.java
index ad93f6fc8d9f..147c8d7853d4 100644
--- a/services/core/java/com/android/server/appop/AppOpsService.java
+++ b/services/core/java/com/android/server/appop/AppOpsService.java
@@ -1110,12 +1110,12 @@ public class AppOpsService extends IAppOpsService.Stub {
final String changedPkg = changedPkgs[i];
// We trust packagemanager to insert matching uid and packageNames in the
// extras
- Set<String> devices;
+ Set<String> devices = new ArraySet<>();
+ devices.add(PERSISTENT_DEVICE_ID_DEFAULT);
+
if (mVirtualDeviceManagerInternal != null) {
- devices = mVirtualDeviceManagerInternal.getAllPersistentDeviceIds();
- } else {
- devices = new ArraySet<>();
- devices.add(PERSISTENT_DEVICE_ID_DEFAULT);
+ devices.addAll(
+ mVirtualDeviceManagerInternal.getAllPersistentDeviceIds());
}
for (String device: devices) {
notifyOpChanged(onModeChangedListeners, code, changedUid, changedPkg,
@@ -2609,12 +2609,10 @@ public class AppOpsService extends IAppOpsService.Stub {
ArrayList<ChangeRec> reports = ent.getValue();
for (int i=0; i<reports.size(); i++) {
ChangeRec rep = reports.get(i);
- Set<String> devices;
+ Set<String> devices = new ArraySet<>();
+ devices.add(PERSISTENT_DEVICE_ID_DEFAULT);
if (mVirtualDeviceManagerInternal != null) {
- devices = mVirtualDeviceManagerInternal.getAllPersistentDeviceIds();
- } else {
- devices = new ArraySet<>();
- devices.add(PERSISTENT_DEVICE_ID_DEFAULT);
+ devices.addAll(mVirtualDeviceManagerInternal.getAllPersistentDeviceIds());
}
for (String device: devices) {
mHandler.sendMessage(PooledLambda.obtainMessage(
diff --git a/services/core/java/com/android/server/audio/AudioDeviceBroker.java b/services/core/java/com/android/server/audio/AudioDeviceBroker.java
index 475334c69313..1dc1846fbb96 100644
--- a/services/core/java/com/android/server/audio/AudioDeviceBroker.java
+++ b/services/core/java/com/android/server/audio/AudioDeviceBroker.java
@@ -1439,7 +1439,6 @@ public class AudioDeviceBroker {
sendMsgNoDelay(MSG_BROADCAST_AUDIO_BECOMING_NOISY, SENDMSG_REPLACE);
}
- @GuardedBy("mDeviceStateLock")
/*package*/ void postBluetoothActiveDevice(BtDeviceInfo info, int delay) {
sendLMsg(MSG_L_SET_BT_ACTIVE_DEVICE, SENDMSG_QUEUE, info, delay);
}
diff --git a/services/core/java/com/android/server/audio/AudioService.java b/services/core/java/com/android/server/audio/AudioService.java
index 15c5c1077803..7deef2ffb5dd 100644
--- a/services/core/java/com/android/server/audio/AudioService.java
+++ b/services/core/java/com/android/server/audio/AudioService.java
@@ -7897,7 +7897,7 @@ public class AudioService extends IAudioService.Stub
+ previousDevice + " -> " + newDevice + ". Got: " + profile);
}
- sDeviceLogger.enqueue(new EventLogger.StringEvent("BlutoothActiveDeviceChanged for "
+ sDeviceLogger.enqueue(new EventLogger.StringEvent("BluetoothActiveDeviceChanged for "
+ BluetoothProfile.getProfileName(profile) + ", device update " + previousDevice
+ " -> " + newDevice).printLog(TAG));
AudioDeviceBroker.BtDeviceChangedData data =
diff --git a/services/core/java/com/android/server/audio/BtHelper.java b/services/core/java/com/android/server/audio/BtHelper.java
index a649d34884a7..07daecdfc9f6 100644
--- a/services/core/java/com/android/server/audio/BtHelper.java
+++ b/services/core/java/com/android/server/audio/BtHelper.java
@@ -289,6 +289,7 @@ public class BtHelper {
Log.e(TAG, "Exception while getting status of " + device, e);
}
if (btCodecStatus == null) {
+ Log.e(TAG, "getCodec, null A2DP codec status for device: " + device);
mA2dpCodecConfig = null;
return new Pair<>(AudioSystem.AUDIO_FORMAT_DEFAULT, changed);
}
@@ -316,6 +317,7 @@ public class BtHelper {
Log.e(TAG, "Exception while getting status of " + device, e);
}
if (btLeCodecStatus == null) {
+ Log.e(TAG, "getCodec, null LE codec status for device: " + device);
mLeAudioCodecConfig = null;
return new Pair<>(AudioSystem.AUDIO_FORMAT_DEFAULT, changed);
}
@@ -363,6 +365,7 @@ public class BtHelper {
return new Pair<>(profile == BluetoothProfile.A2DP
? AudioSystem.AUDIO_FORMAT_SBC : AudioSystem.AUDIO_FORMAT_LC3, true);
}
+
return codecAndChanged;
}
@@ -653,7 +656,7 @@ public class BtHelper {
// Not a valid profile to connect
Log.e(TAG, "onBtProfileConnected: Not a valid profile to connect "
+ BluetoothProfile.getProfileName(profile));
- break;
+ return;
}
// this part is only for A2DP, LE Audio unicast and Hearing aid
@@ -664,17 +667,65 @@ public class BtHelper {
return;
}
List<BluetoothDevice> activeDevices = adapter.getActiveDevices(profile);
- BluetoothProfileConnectionInfo bpci = new BluetoothProfileConnectionInfo(profile);
- for (BluetoothDevice device : activeDevices) {
- if (device == null) {
- continue;
- }
- AudioDeviceBroker.BtDeviceChangedData data = new AudioDeviceBroker.BtDeviceChangedData(
- device, null, bpci, "mBluetoothProfileServiceListener");
- AudioDeviceBroker.BtDeviceInfo info = mDeviceBroker.createBtDeviceInfo(
- data, device, BluetoothProfile.STATE_CONNECTED);
- mDeviceBroker.postBluetoothActiveDevice(info, 0 /* delay */);
+ if (activeDevices.isEmpty() || activeDevices.get(0) == null) {
+ return;
}
+ BluetoothDevice device = activeDevices.get(0);
+ switch (profile) {
+ case BluetoothProfile.A2DP: {
+ BluetoothProfileConnectionInfo bpci =
+ BluetoothProfileConnectionInfo.createA2dpInfo(false, -1);
+ postBluetoothActiveDevice(device, bpci);
+ } break;
+ case BluetoothProfile.HEARING_AID: {
+ BluetoothProfileConnectionInfo bpci =
+ BluetoothProfileConnectionInfo.createHearingAidInfo(false);
+ postBluetoothActiveDevice(device, bpci);
+ } break;
+ case BluetoothProfile.LE_AUDIO: {
+ int groupId = mLeAudio.getGroupId(device);
+ BluetoothLeAudioCodecStatus btLeCodecStatus = null;
+ try {
+ btLeCodecStatus = mLeAudio.getCodecStatus(groupId);
+ } catch (Exception e) {
+ Log.e(TAG, "Exception while getting status of " + device, e);
+ }
+ if (btLeCodecStatus == null) {
+ Log.i(TAG, "onBtProfileConnected null LE codec status for groupId: "
+ + groupId + ", device: " + device);
+ break;
+ }
+ List<BluetoothLeAudioCodecConfig> outputCodecConfigs =
+ btLeCodecStatus.getOutputCodecSelectableCapabilities();
+ if (!outputCodecConfigs.isEmpty()) {
+ BluetoothProfileConnectionInfo bpci =
+ BluetoothProfileConnectionInfo.createLeAudioInfo(
+ false /*suppressNoisyIntent*/, true /*isLeOutput*/);
+ postBluetoothActiveDevice(device, bpci);
+ }
+ List<BluetoothLeAudioCodecConfig> inputCodecConfigs =
+ btLeCodecStatus.getInputCodecSelectableCapabilities();
+ if (!inputCodecConfigs.isEmpty()) {
+ BluetoothProfileConnectionInfo bpci =
+ BluetoothProfileConnectionInfo.createLeAudioInfo(
+ false /*suppressNoisyIntent*/, false /*isLeOutput*/);
+ postBluetoothActiveDevice(device, bpci);
+ }
+ } break;
+ default:
+ // Not a valid profile to connect
+ Log.wtf(TAG, "Invalid profile! onBtProfileConnected");
+ break;
+ }
+ }
+
+ private void postBluetoothActiveDevice(
+ BluetoothDevice device, BluetoothProfileConnectionInfo bpci) {
+ AudioDeviceBroker.BtDeviceChangedData data = new AudioDeviceBroker.BtDeviceChangedData(
+ device, null, bpci, "mBluetoothProfileServiceListener");
+ AudioDeviceBroker.BtDeviceInfo info = mDeviceBroker.createBtDeviceInfo(
+ data, device, BluetoothProfile.STATE_CONNECTED);
+ mDeviceBroker.postBluetoothActiveDevice(info, 0 /* delay */);
}
/*package*/ synchronized boolean isProfilePoxyConnected(int profile) {
diff --git a/services/core/java/com/android/server/biometrics/sensors/BiometricNotificationUtils.java b/services/core/java/com/android/server/biometrics/sensors/BiometricNotificationUtils.java
index eaa5e2a6befb..53e6bdb2ab5f 100644
--- a/services/core/java/com/android/server/biometrics/sensors/BiometricNotificationUtils.java
+++ b/services/core/java/com/android/server/biometrics/sensors/BiometricNotificationUtils.java
@@ -238,7 +238,7 @@ public class BiometricNotificationUtils {
showNotificationHelper(context, name, title, content, setupPendingIntent, setupAction,
notNowAction, Notification.CATEGORY_SYSTEM, channel, tag,
- Notification.VISIBILITY_SECRET, false);
+ Notification.VISIBILITY_SECRET, false, Notification.FLAG_NO_CLEAR);
}
private static String getFingerprintDanglingContentString(Context context,
@@ -296,13 +296,13 @@ public class BiometricNotificationUtils {
String notificationTag, int visibility, boolean listenToDismissEvent) {
showNotificationHelper(context, name, title, content, pendingIntent,
null /* positiveAction */, null /* negativeAction */, category, channelName,
- notificationTag, visibility, listenToDismissEvent);
+ notificationTag, visibility, listenToDismissEvent, 0);
}
private static void showNotificationHelper(Context context, String name, String title,
String content, PendingIntent pendingIntent, Notification.Action positiveAction,
Notification.Action negativeAction, String category, String channelName,
- String notificationTag, int visibility, boolean listenToDismissEvent) {
+ String notificationTag, int visibility, boolean listenToDismissEvent, int flags) {
Slog.v(TAG," listenToDismissEvent = " + listenToDismissEvent);
final PendingIntent dismissIntent = PendingIntent.getActivityAsUser(context,
0 /* requestCode */, DISMISS_FRR_INTENT, PendingIntent.FLAG_IMMUTABLE /* flags */,
@@ -324,6 +324,9 @@ public class BiometricNotificationUtils {
.setContentIntent(pendingIntent)
.setVisibility(visibility);
+ if (flags > 0) {
+ builder.setFlag(flags, true);
+ }
if (positiveAction != null) {
builder.addAction(positiveAction);
}
diff --git a/services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/BiometricTestSessionImpl.java b/services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/BiometricTestSessionImpl.java
index d64b6c29c840..8dc560b0e0b5 100644
--- a/services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/BiometricTestSessionImpl.java
+++ b/services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/BiometricTestSessionImpl.java
@@ -20,6 +20,9 @@ import android.annotation.NonNull;
import android.content.Context;
import android.hardware.biometrics.ITestSession;
import android.hardware.biometrics.ITestSessionCallback;
+import android.hardware.biometrics.fingerprint.AcquiredInfoAndVendorCode;
+import android.hardware.biometrics.fingerprint.EnrollmentProgressStep;
+import android.hardware.biometrics.fingerprint.NextEnrollment;
import android.hardware.fingerprint.Fingerprint;
import android.hardware.fingerprint.FingerprintEnrollOptions;
import android.hardware.fingerprint.FingerprintManager;
@@ -46,6 +49,7 @@ import java.util.Set;
class BiometricTestSessionImpl extends ITestSession.Stub {
private static final String TAG = "fp/aidl/BiometricTestSessionImpl";
+ private static final int VHAL_ENROLLMENT_ID = 9999;
@NonNull private final Context mContext;
private final int mSensorId;
@@ -140,8 +144,8 @@ class BiometricTestSessionImpl extends ITestSession.Stub {
super.setTestHalEnabled_enforcePermission();
- mProvider.setTestHalEnabled(enabled);
mSensor.setTestHalEnabled(enabled);
+ mProvider.setTestHalEnabled(enabled);
}
@android.annotation.EnforcePermission(android.Manifest.permission.TEST_BIOMETRIC)
@@ -157,10 +161,31 @@ class BiometricTestSessionImpl extends ITestSession.Stub {
@android.annotation.EnforcePermission(android.Manifest.permission.TEST_BIOMETRIC)
@Override
- public void finishEnroll(int userId) {
+ public void finishEnroll(int userId) throws RemoteException {
super.finishEnroll_enforcePermission();
+ Slog.i(TAG, "finishEnroll(): useVhalForTesting=" + mProvider.useVhalForTesting());
+ if (mProvider.useVhalForTesting()) {
+ final AcquiredInfoAndVendorCode[] acquiredInfoAndVendorCodes =
+ {new AcquiredInfoAndVendorCode()};
+ final EnrollmentProgressStep[] enrollmentProgressSteps =
+ {new EnrollmentProgressStep(), new EnrollmentProgressStep()};
+ enrollmentProgressSteps[0].durationMs = 100;
+ enrollmentProgressSteps[0].acquiredInfoAndVendorCodes = acquiredInfoAndVendorCodes;
+ enrollmentProgressSteps[1].durationMs = 200;
+ enrollmentProgressSteps[1].acquiredInfoAndVendorCodes = acquiredInfoAndVendorCodes;
+
+ final NextEnrollment nextEnrollment = new NextEnrollment();
+ nextEnrollment.id = VHAL_ENROLLMENT_ID;
+ nextEnrollment.progressSteps = enrollmentProgressSteps;
+ nextEnrollment.result = true;
+ mProvider.getVhal().setNextEnrollment(nextEnrollment);
+ mProvider.simulateVhalFingerDown(userId, mSensorId);
+ return;
+ }
+
+ //TODO (b341889971): delete the following lines when b/341889971 is resolved
int nextRandomId = mRandom.nextInt();
while (mEnrollmentIds.contains(nextRandomId)) {
nextRandomId = mRandom.nextInt();
@@ -173,11 +198,18 @@ class BiometricTestSessionImpl extends ITestSession.Stub {
@android.annotation.EnforcePermission(android.Manifest.permission.TEST_BIOMETRIC)
@Override
- public void acceptAuthentication(int userId) {
+ public void acceptAuthentication(int userId) throws RemoteException {
// Fake authentication with any of the existing fingers
super.acceptAuthentication_enforcePermission();
+ if (mProvider.useVhalForTesting()) {
+ mProvider.getVhal().setEnrollmentHit(VHAL_ENROLLMENT_ID);
+ mProvider.simulateVhalFingerDown(userId, mSensorId);
+ return;
+ }
+
+ //TODO (b341889971): delete the following lines when b/341889971 is resolved
List<Fingerprint> fingerprints = FingerprintUtils.getInstance(mSensorId)
.getBiometricsForUser(mContext, userId);
if (fingerprints.isEmpty()) {
@@ -191,10 +223,17 @@ class BiometricTestSessionImpl extends ITestSession.Stub {
@android.annotation.EnforcePermission(android.Manifest.permission.TEST_BIOMETRIC)
@Override
- public void rejectAuthentication(int userId) {
+ public void rejectAuthentication(int userId) throws RemoteException {
super.rejectAuthentication_enforcePermission();
+ if (mProvider.useVhalForTesting()) {
+ mProvider.getVhal().setEnrollmentHit(VHAL_ENROLLMENT_ID + 1);
+ mProvider.simulateVhalFingerDown(userId, mSensorId);
+ return;
+ }
+
+ //TODO (b341889971): delete the following lines when b/341889971 is resolved
mSensor.getSessionForUser(userId).getHalSessionCallback().onAuthenticationFailed();
}
@@ -220,11 +259,17 @@ class BiometricTestSessionImpl extends ITestSession.Stub {
@android.annotation.EnforcePermission(android.Manifest.permission.TEST_BIOMETRIC)
@Override
- public void cleanupInternalState(int userId) {
+ public void cleanupInternalState(int userId) throws RemoteException {
super.cleanupInternalState_enforcePermission();
Slog.d(TAG, "cleanupInternalState: " + userId);
+
+ if (mProvider.useVhalForTesting()) {
+ Slog.i(TAG, "cleanup virtualhal configurations");
+ mProvider.getVhal().resetConfigurations(); //setEnrollments(new int[]{});
+ }
+
mProvider.scheduleInternalCleanup(mSensorId, userId, new ClientMonitorCallback() {
@Override
public void onClientStarted(@NonNull BaseClientMonitor clientMonitor) {
@@ -248,4 +293,4 @@ class BiometricTestSessionImpl extends ITestSession.Stub {
}
});
}
-}
+} \ No newline at end of file
diff --git a/services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/FingerprintProvider.java b/services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/FingerprintProvider.java
index c0dcd4943260..1bddb83b1441 100644
--- a/services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/FingerprintProvider.java
+++ b/services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/FingerprintProvider.java
@@ -890,7 +890,13 @@ public class FingerprintProvider implements IBinder.DeathRecipient, ServiceProvi
}
void setTestHalEnabled(boolean enabled) {
+ final boolean changed = enabled != mTestHalEnabled;
mTestHalEnabled = enabled;
+ Slog.i(getTag(), "setTestHalEnabled(): useVhalForTesting=" + Flags.useVhalForTesting()
+ + "mTestHalEnabled=" + mTestHalEnabled + " changed=" + changed);
+ if (changed && useVhalForTesting()) {
+ getHalInstance();
+ }
}
public boolean getTestHalEnabled() {
@@ -982,7 +988,7 @@ public class FingerprintProvider implements IBinder.DeathRecipient, ServiceProvi
if (mVhal == null && useVhalForTesting()) {
mVhal = IVirtualHal.Stub.asInterface(mDaemon.asBinder().getExtension());
if (mVhal == null) {
- Slog.e(getTag(), "Unable to get virtual hal interface");
+ Slog.e(getTag(), "Unable to get fingerprint virtualhal interface");
}
}
diff --git a/services/core/java/com/android/server/display/DisplayControl.java b/services/core/java/com/android/server/display/DisplayControl.java
index fa8299bd45fd..38eb416ffdd8 100644
--- a/services/core/java/com/android/server/display/DisplayControl.java
+++ b/services/core/java/com/android/server/display/DisplayControl.java
@@ -28,9 +28,9 @@ import java.util.Objects;
* Calls into SurfaceFlinger for Display creation and deletion.
*/
public class DisplayControl {
- private static native IBinder nativeCreateDisplay(String name, boolean secure,
+ private static native IBinder nativeCreateVirtualDisplay(String name, boolean secure,
String uniqueId, float requestedRefreshRate);
- private static native void nativeDestroyDisplay(IBinder displayToken);
+ private static native void nativeDestroyVirtualDisplay(IBinder displayToken);
private static native void nativeOverrideHdrTypes(IBinder displayToken, int[] modes);
private static native long[] nativeGetPhysicalDisplayIds();
private static native IBinder nativeGetPhysicalDisplayToken(long physicalDisplayId);
@@ -41,21 +41,21 @@ public class DisplayControl {
private static native boolean nativeGetHdrOutputConversionSupport();
/**
- * Create a display in SurfaceFlinger.
+ * Create a virtual display in SurfaceFlinger.
*
- * @param name The name of the display.
+ * @param name The name of the virtual display.
* @param secure Whether this display is secure.
* @return The token reference for the display in SurfaceFlinger.
*/
- public static IBinder createDisplay(String name, boolean secure) {
+ public static IBinder createVirtualDisplay(String name, boolean secure) {
Objects.requireNonNull(name, "name must not be null");
- return nativeCreateDisplay(name, secure, "", 0.0f);
+ return nativeCreateVirtualDisplay(name, secure, "", 0.0f);
}
/**
- * Create a display in SurfaceFlinger.
+ * Create a virtual display in SurfaceFlinger.
*
- * @param name The name of the display.
+ * @param name The name of the virtual display.
* @param secure Whether this display is secure.
* @param uniqueId The unique ID for the display.
* @param requestedRefreshRate The requested refresh rate in frames per second.
@@ -65,23 +65,23 @@ public class DisplayControl {
* display is refreshed at the physical display refresh rate.
* @return The token reference for the display in SurfaceFlinger.
*/
- public static IBinder createDisplay(String name, boolean secure,
+ public static IBinder createVirtualDisplay(String name, boolean secure,
String uniqueId, float requestedRefreshRate) {
Objects.requireNonNull(name, "name must not be null");
Objects.requireNonNull(uniqueId, "uniqueId must not be null");
- return nativeCreateDisplay(name, secure, uniqueId, requestedRefreshRate);
+ return nativeCreateVirtualDisplay(name, secure, uniqueId, requestedRefreshRate);
}
/**
- * Destroy a display in SurfaceFlinger.
+ * Destroy a virtual display in SurfaceFlinger.
*
- * @param displayToken The display token for the display to be destroyed.
+ * @param displayToken The display token for the virtual display to be destroyed.
*/
- public static void destroyDisplay(IBinder displayToken) {
+ public static void destroyVirtualDisplay(IBinder displayToken) {
if (displayToken == null) {
throw new IllegalArgumentException("displayToken must not be null");
}
- nativeDestroyDisplay(displayToken);
+ nativeDestroyVirtualDisplay(displayToken);
}
/**
diff --git a/services/core/java/com/android/server/display/OverlayDisplayAdapter.java b/services/core/java/com/android/server/display/OverlayDisplayAdapter.java
index 22ff2d0eeffd..eb76dcba3b85 100644
--- a/services/core/java/com/android/server/display/OverlayDisplayAdapter.java
+++ b/services/core/java/com/android/server/display/OverlayDisplayAdapter.java
@@ -309,7 +309,7 @@ final class OverlayDisplayAdapter extends DisplayAdapter {
mSurface.release();
mSurface = null;
}
- DisplayControl.destroyDisplay(getDisplayTokenLocked());
+ DisplayControl.destroyVirtualDisplay(getDisplayTokenLocked());
}
@Override
@@ -467,7 +467,7 @@ final class OverlayDisplayAdapter extends DisplayAdapter {
public void onWindowCreated(SurfaceTexture surfaceTexture, float refreshRate,
long presentationDeadlineNanos, int state) {
synchronized (getSyncRoot()) {
- IBinder displayToken = DisplayControl.createDisplay(mName, mFlags.mSecure);
+ IBinder displayToken = DisplayControl.createVirtualDisplay(mName, mFlags.mSecure);
mDevice = new OverlayDisplayDevice(displayToken, mName, mModes, mActiveMode,
DEFAULT_MODE_INDEX, refreshRate, presentationDeadlineNanos,
mFlags, state, surfaceTexture, mNumber) {
diff --git a/services/core/java/com/android/server/display/VirtualDisplayAdapter.java b/services/core/java/com/android/server/display/VirtualDisplayAdapter.java
index a29e8523952d..1a5c79fada55 100644
--- a/services/core/java/com/android/server/display/VirtualDisplayAdapter.java
+++ b/services/core/java/com/android/server/display/VirtualDisplayAdapter.java
@@ -94,12 +94,13 @@ public class VirtualDisplayAdapter extends DisplayAdapter {
@Override
public IBinder createDisplay(String name, boolean secure, String uniqueId,
float requestedRefreshRate) {
- return DisplayControl.createDisplay(name, secure, uniqueId, requestedRefreshRate);
+ return DisplayControl.createVirtualDisplay(name, secure, uniqueId,
+ requestedRefreshRate);
}
@Override
public void destroyDisplay(IBinder displayToken) {
- DisplayControl.destroyDisplay(displayToken);
+ DisplayControl.destroyVirtualDisplay(displayToken);
}
}, featureFlags);
}
diff --git a/services/core/java/com/android/server/display/WifiDisplayAdapter.java b/services/core/java/com/android/server/display/WifiDisplayAdapter.java
index aa98cd85d38e..607c5d6a88bc 100644
--- a/services/core/java/com/android/server/display/WifiDisplayAdapter.java
+++ b/services/core/java/com/android/server/display/WifiDisplayAdapter.java
@@ -392,9 +392,9 @@ final class WifiDisplayAdapter extends DisplayAdapter {
float refreshRate = 60.0f; // TODO: get this for real
- String name = display.getFriendlyDisplayName();
- String address = display.getDeviceAddress();
- IBinder displayToken = DisplayControl.createDisplay(name, secure);
+ final String name = display.getFriendlyDisplayName();
+ final String address = display.getDeviceAddress();
+ IBinder displayToken = DisplayControl.createVirtualDisplay(name, secure);
mDisplayDevice = new WifiDisplayDevice(displayToken, name, width, height,
refreshRate, deviceFlags, address, surface);
sendDisplayDeviceEventLocked(mDisplayDevice, DISPLAY_DEVICE_EVENT_ADDED);
@@ -631,7 +631,7 @@ final class WifiDisplayAdapter extends DisplayAdapter {
mSurface.release();
mSurface = null;
}
- DisplayControl.destroyDisplay(getDisplayTokenLocked());
+ DisplayControl.destroyVirtualDisplay(getDisplayTokenLocked());
}
public void setNameLocked(String name) {
diff --git a/services/core/java/com/android/server/display/brightness/strategy/AutomaticBrightnessStrategy.java b/services/core/java/com/android/server/display/brightness/strategy/AutomaticBrightnessStrategy.java
index f809a49fd3d3..37b693190f7f 100644
--- a/services/core/java/com/android/server/display/brightness/strategy/AutomaticBrightnessStrategy.java
+++ b/services/core/java/com/android/server/display/brightness/strategy/AutomaticBrightnessStrategy.java
@@ -165,9 +165,8 @@ public class AutomaticBrightnessStrategy extends AutomaticBrightnessStrategy2
public boolean isAutoBrightnessValid() {
boolean isValid = false;
if (isAutoBrightnessEnabled()) {
- float brightness = (mAutomaticBrightnessController != null)
- ? mAutomaticBrightnessController.getAutomaticScreenBrightness(null)
- : PowerManager.BRIGHTNESS_INVALID_FLOAT;
+ float brightness = getAutomaticScreenBrightness(null,
+ /* isAutomaticBrightnessAdjusted = */ false);
if (BrightnessUtils.isValidBrightnessValue(brightness)
|| brightness == PowerManager.BRIGHTNESS_OFF_FLOAT) {
isValid = true;
@@ -274,7 +273,12 @@ public class AutomaticBrightnessStrategy extends AutomaticBrightnessStrategy2
BrightnessReason brightnessReason = new BrightnessReason();
brightnessReason.setReason(BrightnessReason.REASON_AUTOMATIC);
BrightnessEvent brightnessEvent = mInjector.getBrightnessEvent(mDisplayId);
- float brightness = getAutomaticScreenBrightness(brightnessEvent);
+
+ // AutoBrightness adjustments were already applied while checking the validity of this
+ // strategy. Reapplying them again will result in incorrect adjustment reason flags as we
+ // might end up assuming no adjustments are applied
+ float brightness = getAutomaticScreenBrightness(brightnessEvent,
+ /* isAutomaticBrightnessAdjusted = */ true);
return new DisplayBrightnessState.Builder()
.setBrightness(brightness)
.setSdrBrightness(brightness)
@@ -355,11 +359,14 @@ public class AutomaticBrightnessStrategy extends AutomaticBrightnessStrategy2
* @param brightnessEvent Event object to populate with details about why the specific
* brightness was chosen.
*/
- public float getAutomaticScreenBrightness(BrightnessEvent brightnessEvent) {
+ public float getAutomaticScreenBrightness(BrightnessEvent brightnessEvent,
+ boolean isAutomaticBrightnessAdjusted) {
float brightness = (mAutomaticBrightnessController != null)
? mAutomaticBrightnessController.getAutomaticScreenBrightness(brightnessEvent)
: PowerManager.BRIGHTNESS_INVALID_FLOAT;
- adjustAutomaticBrightnessStateIfValid(brightness);
+ if (!isAutomaticBrightnessAdjusted) {
+ adjustAutomaticBrightnessStateIfValid(brightness);
+ }
return brightness;
}
diff --git a/services/core/java/com/android/server/flags/pinner.aconfig b/services/core/java/com/android/server/flags/pinner.aconfig
index 16a45cd87fd7..2f817dbb9a7f 100644
--- a/services/core/java/com/android/server/flags/pinner.aconfig
+++ b/services/core/java/com/android/server/flags/pinner.aconfig
@@ -6,4 +6,11 @@ flag {
namespace: "system_performance"
description: "This flag controls if webview should be pinned in memory."
bug: "307594624"
+}
+
+flag {
+ name: "skip_home_art_pins"
+ namespace: "system_performance"
+ description: "Ablation study flag that controls if home app odex/vdex files should be pinned in memory."
+ bug: "340935152"
} \ No newline at end of file
diff --git a/services/core/java/com/android/server/input/InputManagerService.java b/services/core/java/com/android/server/input/InputManagerService.java
index 8e85b81d9bd2..48cccd5b5b39 100644
--- a/services/core/java/com/android/server/input/InputManagerService.java
+++ b/services/core/java/com/android/server/input/InputManagerService.java
@@ -960,12 +960,6 @@ public class InputManagerService extends IInputManager.Stub
// Binder call
@Override
- public boolean isInputDeviceEnabled(int deviceId) {
- return mNative.isInputDeviceEnabled(deviceId);
- }
-
- // Binder call
- @Override
public void enableInputDevice(int deviceId) {
if (!checkCallingPermission(android.Manifest.permission.DISABLE_INPUT_DEVICE,
"enableInputDevice()")) {
diff --git a/services/core/java/com/android/server/input/NativeInputManagerService.java b/services/core/java/com/android/server/input/NativeInputManagerService.java
index 0208a325a1d5..a9d40bb54f96 100644
--- a/services/core/java/com/android/server/input/NativeInputManagerService.java
+++ b/services/core/java/com/android/server/input/NativeInputManagerService.java
@@ -183,8 +183,6 @@ interface NativeInputManagerService {
void monitor();
- boolean isInputDeviceEnabled(int deviceId);
-
void enableInputDevice(int deviceId);
void disableInputDevice(int deviceId);
@@ -463,9 +461,6 @@ interface NativeInputManagerService {
public native void monitor();
@Override
- public native boolean isInputDeviceEnabled(int deviceId);
-
- @Override
public native void enableInputDevice(int deviceId);
@Override
diff --git a/services/core/java/com/android/server/inputmethod/AutofillSuggestionsController.java b/services/core/java/com/android/server/inputmethod/AutofillSuggestionsController.java
index ad98b4a8db13..0749edce97a1 100644
--- a/services/core/java/com/android/server/inputmethod/AutofillSuggestionsController.java
+++ b/services/core/java/com/android/server/inputmethod/AutofillSuggestionsController.java
@@ -18,7 +18,6 @@ package com.android.server.inputmethod;
import android.annotation.NonNull;
import android.annotation.Nullable;
-import android.annotation.UserIdInt;
import android.os.IBinder;
import android.os.RemoteException;
import android.util.Slog;
@@ -39,7 +38,7 @@ final class AutofillSuggestionsController {
private static final boolean DEBUG = false;
private static final String TAG = AutofillSuggestionsController.class.getSimpleName();
- @NonNull private final InputMethodManagerService mService;
+ @NonNull private final InputMethodBindingController mBindingController;
/**
* The host input token of the input method that is currently associated with this controller.
@@ -81,8 +80,8 @@ final class AutofillSuggestionsController {
@Nullable
private InlineSuggestionsRequestCallback mInlineSuggestionsRequestCallback;
- AutofillSuggestionsController(@NonNull InputMethodManagerService service) {
- mService = service;
+ AutofillSuggestionsController(@NonNull InputMethodBindingController bindingController) {
+ mBindingController = bindingController;
}
@GuardedBy("ImfLock.class")
@@ -97,31 +96,32 @@ final class AutofillSuggestionsController {
}
@GuardedBy("ImfLock.class")
- void onCreateInlineSuggestionsRequest(@UserIdInt int userId,
- InlineSuggestionsRequestInfo requestInfo, InlineSuggestionsRequestCallback callback,
- boolean touchExplorationEnabled) {
+ void onCreateInlineSuggestionsRequest(InlineSuggestionsRequestInfo requestInfo,
+ InlineSuggestionsRequestCallback callback, boolean touchExplorationEnabled) {
clearPendingInlineSuggestionsRequest();
mInlineSuggestionsRequestCallback = callback;
- final InputMethodInfo imi = mService.queryInputMethodForCurrentUserLocked(
- mService.getSelectedMethodIdLocked());
-
- if (userId == mService.getCurrentImeUserIdLocked()
- && imi != null && isInlineSuggestionsEnabled(imi, touchExplorationEnabled)) {
- mPendingInlineSuggestionsRequest = new CreateInlineSuggestionsRequest(
- requestInfo, callback, imi.getPackageName());
- if (mService.getCurMethodLocked() != null) {
- // In the normal case when the IME is connected, we can make the request here.
- performOnCreateInlineSuggestionsRequest();
- } else {
- // Otherwise, the next time the IME connection is established,
- // InputMethodBindingController.mMainConnection#onServiceConnected() will call
- // into #performOnCreateInlineSuggestionsRequestLocked() to make the request.
- if (DEBUG) {
- Slog.d(TAG, "IME not connected. Delaying inline suggestions request.");
- }
- }
- } else {
+
+ // Note that current user ID is guaranteed to be userId.
+ final var imeId = mBindingController.getSelectedMethodId();
+ final InputMethodInfo imi = InputMethodSettingsRepository.get(mBindingController.mUserId)
+ .getMethodMap().get(imeId);
+ if (imi == null || !isInlineSuggestionsEnabled(imi, touchExplorationEnabled)) {
callback.onInlineSuggestionsUnsupported();
+ return;
+ }
+
+ mPendingInlineSuggestionsRequest = new CreateInlineSuggestionsRequest(
+ requestInfo, callback, imi.getPackageName());
+ if (mBindingController.getCurMethod() != null) {
+ // In the normal case when the IME is connected, we can make the request here.
+ performOnCreateInlineSuggestionsRequest();
+ } else {
+ // Otherwise, the next time the IME connection is established,
+ // InputMethodBindingController.mMainConnection#onServiceConnected() will call
+ // into #performOnCreateInlineSuggestionsRequestLocked() to make the request.
+ if (DEBUG) {
+ Slog.d(TAG, "IME not connected. Delaying inline suggestions request.");
+ }
}
}
@@ -130,7 +130,7 @@ final class AutofillSuggestionsController {
if (mPendingInlineSuggestionsRequest == null) {
return;
}
- IInputMethodInvoker curMethod = mService.getCurMethodLocked();
+ IInputMethodInvoker curMethod = mBindingController.getCurMethod();
if (DEBUG) {
Slog.d(TAG, "Performing onCreateInlineSuggestionsRequest. mCurMethod = " + curMethod);
}
@@ -139,8 +139,8 @@ final class AutofillSuggestionsController {
new InlineSuggestionsRequestCallbackDecorator(
mPendingInlineSuggestionsRequest.mCallback,
mPendingInlineSuggestionsRequest.mPackageName,
- mService.getCurTokenDisplayIdLocked(),
- mService.getCurTokenLocked());
+ mBindingController.getCurTokenDisplayId(),
+ mBindingController.getCurToken());
curMethod.onCreateInlineSuggestionsRequest(
mPendingInlineSuggestionsRequest.mRequestInfo, callback);
} else {
@@ -205,7 +205,7 @@ final class AutofillSuggestionsController {
}
request.setHostDisplayId(mImeDisplayId);
synchronized (ImfLock.class) {
- final IBinder curImeToken = mService.getCurTokenLocked();
+ final IBinder curImeToken = mBindingController.getCurToken();
if (mImeToken == curImeToken) {
mCurHostInputToken = request.getHostInputToken();
}
diff --git a/services/core/java/com/android/server/inputmethod/InputMethodBindingController.java b/services/core/java/com/android/server/inputmethod/InputMethodBindingController.java
index e862c7e96200..8191ee14adff 100644
--- a/services/core/java/com/android/server/inputmethod/InputMethodBindingController.java
+++ b/services/core/java/com/android/server/inputmethod/InputMethodBindingController.java
@@ -39,6 +39,7 @@ import android.os.UserHandle;
import android.provider.Settings;
import android.util.EventLog;
import android.util.Slog;
+import android.view.Display;
import android.view.WindowManager;
import android.view.inputmethod.InputMethod;
import android.view.inputmethod.InputMethodInfo;
@@ -47,6 +48,8 @@ import android.view.inputmethod.InputMethodManager;
import com.android.internal.annotations.GuardedBy;
import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.inputmethod.IInputMethod;
+import com.android.internal.inputmethod.InlineSuggestionsRequestCallback;
+import com.android.internal.inputmethod.InlineSuggestionsRequestInfo;
import com.android.internal.inputmethod.InputBindResult;
import com.android.internal.inputmethod.UnbindReason;
import com.android.server.EventLogTags;
@@ -67,6 +70,7 @@ final class InputMethodBindingController {
@UserIdInt final int mUserId;
@NonNull private final InputMethodManagerService mService;
@NonNull private final Context mContext;
+ @NonNull private final AutofillSuggestionsController mAutofillController;
@NonNull private final PackageManagerInternal mPackageManagerInternal;
@NonNull private final WindowManagerInternal mWindowManagerInternal;
@@ -78,6 +82,7 @@ final class InputMethodBindingController {
@GuardedBy("ImfLock.class") @Nullable private IInputMethodInvoker mCurMethod;
@GuardedBy("ImfLock.class") private int mCurMethodUid = Process.INVALID_UID;
@GuardedBy("ImfLock.class") @Nullable private IBinder mCurToken;
+ @GuardedBy("ImfLock.class") private int mCurTokenDisplayId = Display.INVALID_DISPLAY;
@GuardedBy("ImfLock.class") private int mCurSeq;
@GuardedBy("ImfLock.class") private boolean mVisibleBound;
@GuardedBy("ImfLock.class") private boolean mSupportsStylusHw;
@@ -120,6 +125,7 @@ final class InputMethodBindingController {
mUserId = userId;
mService = service;
mContext = mService.mContext;
+ mAutofillController = new AutofillSuggestionsController(this);
mPackageManagerInternal = mService.mPackageManagerInternal;
mWindowManagerInternal = mService.mWindowManagerInternal;
mImeConnectionBindFlags = imeConnectionBindFlags;
@@ -193,6 +199,17 @@ final class InputMethodBindingController {
}
/**
+ * Returns the displayId associated with {@link #getCurToken()}.
+ *
+ * @return the displayId associated with {@link #getCurToken()}. {@link Display#INVALID_DISPLAY}
+ * while {@link #getCurToken()} returns {@code null}
+ */
+ @GuardedBy("ImfLock.class")
+ int getCurTokenDisplayId() {
+ return mCurTokenDisplayId;
+ }
+
+ /**
* The Intent used to connect to the current input method.
*/
@GuardedBy("ImfLock.class")
@@ -269,7 +286,7 @@ final class InputMethodBindingController {
private final ServiceConnection mVisibleConnection = new ServiceConnection() {
@Override public void onBindingDied(ComponentName name) {
synchronized (ImfLock.class) {
- mService.invalidateAutofillSessionLocked();
+ mAutofillController.invalidateAutofillSession();
if (isVisibleBound()) {
unbindVisibleConnection();
}
@@ -281,7 +298,7 @@ final class InputMethodBindingController {
@Override public void onServiceDisconnected(ComponentName name) {
synchronized (ImfLock.class) {
- mService.invalidateAutofillSessionLocked();
+ mAutofillController.invalidateAutofillSession();
}
}
};
@@ -326,7 +343,7 @@ final class InputMethodBindingController {
mService.initializeImeLocked(mCurMethod, mCurToken);
mService.scheduleNotifyImeUidToAudioService(mCurMethodUid);
mService.reRequestCurrentClientSessionLocked();
- mService.performOnCreateInlineSuggestionsRequestLocked();
+ mAutofillController.performOnCreateInlineSuggestionsRequest();
}
// reset Handwriting event receiver.
@@ -385,6 +402,24 @@ final class InputMethodBindingController {
};
@GuardedBy("ImfLock.class")
+ void invalidateAutofillSession() {
+ mAutofillController.invalidateAutofillSession();
+ }
+
+ @GuardedBy("ImfLock.class")
+ void onCreateInlineSuggestionsRequest(InlineSuggestionsRequestInfo requestInfo,
+ InlineSuggestionsRequestCallback callback, boolean touchExplorationEnabled) {
+ mAutofillController.onCreateInlineSuggestionsRequest(requestInfo, callback,
+ touchExplorationEnabled);
+ }
+
+ @GuardedBy("ImfLock.class")
+ @Nullable
+ IBinder getCurHostInputToken() {
+ return mAutofillController.getCurHostInputToken();
+ }
+
+ @GuardedBy("ImfLock.class")
void unbindCurrentMethod() {
if (isVisibleBound()) {
unbindVisibleConnection();
@@ -397,6 +432,7 @@ final class InputMethodBindingController {
if (getCurToken() != null) {
removeCurrentToken();
mService.resetSystemUiLocked();
+ mAutofillController.onResetSystemUi();
}
mCurId = null;
@@ -412,15 +448,14 @@ final class InputMethodBindingController {
@GuardedBy("ImfLock.class")
private void removeCurrentToken() {
- int curTokenDisplayId = mService.getCurTokenDisplayIdLocked();
-
if (DEBUG) {
Slog.v(TAG,
- "Removing window token: " + mCurToken + " for display: " + curTokenDisplayId);
+ "Removing window token: " + mCurToken + " for display: " + mCurTokenDisplayId);
}
mWindowManagerInternal.removeWindowToken(mCurToken, true /* removeWindows */,
- false /* animateExit */, curTokenDisplayId);
+ false /* animateExit */, mCurTokenDisplayId);
mCurToken = null;
+ mCurTokenDisplayId = Display.INVALID_DISPLAY;
}
@GuardedBy("ImfLock.class")
@@ -445,7 +480,7 @@ final class InputMethodBindingController {
final int displayIdToShowIme = mService.getDisplayIdToShowImeLocked();
mCurToken = new Binder();
- mService.setCurTokenDisplayIdLocked(displayIdToShowIme);
+ mCurTokenDisplayId = displayIdToShowIme;
if (DEBUG) {
Slog.v(TAG, "Adding window token: " + mCurToken + " for display: "
+ displayIdToShowIme);
diff --git a/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java b/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java
index f8dda6073b0b..88474deb203d 100644
--- a/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java
+++ b/services/core/java/com/android/server/inputmethod/InputMethodManagerService.java
@@ -332,9 +332,6 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
private final UserManagerInternal mUserManagerInternal;
@MultiUserUnawareField
private final InputMethodMenuController mMenuController;
- @MultiUserUnawareField
- @NonNull
- private final AutofillSuggestionsController mAutofillController;
@GuardedBy("ImfLock.class")
@MultiUserUnawareField
@@ -491,6 +488,12 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
*/
boolean mSystemReady;
+ @GuardedBy("ImfLock.class")
+ @NonNull
+ InputMethodBindingController getInputMethodBindingController(@UserIdInt int userId) {
+ return mUserDataRepository.getOrCreate(userId).mBindingController;
+ }
+
/**
* Id obtained with {@link InputMethodInfo#getId()} for the currently selected input method.
* This is to be synchronized with the secure settings keyed with
@@ -507,8 +510,7 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
@GuardedBy("ImfLock.class")
@Nullable
String getSelectedMethodIdLocked() {
- final var userData = mUserDataRepository.getOrCreate(mCurrentUserId);
- return userData.mBindingController.getSelectedMethodId();
+ return getInputMethodBindingController(mCurrentUserId).getSelectedMethodId();
}
@GuardedBy("ImfLock.class")
@@ -594,8 +596,7 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
@GuardedBy("ImfLock.class")
@Nullable
IBinder getCurTokenLocked() {
- final var userData = mUserDataRepository.getOrCreate(mCurrentUserId);
- return userData.mBindingController.getCurToken();
+ return getInputMethodBindingController(mCurrentUserId).getCurToken();
}
/**
@@ -603,18 +604,9 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
*/
@GuardedBy("ImfLock.class")
int getCurTokenDisplayIdLocked() {
- return mCurTokenDisplayId;
- }
-
- @GuardedBy("ImfLock.class")
- void setCurTokenDisplayIdLocked(int curTokenDisplayId) {
- mCurTokenDisplayId = curTokenDisplayId;
+ return getInputMethodBindingController(mCurrentUserId).getCurTokenDisplayId();
}
- @GuardedBy("ImfLock.class")
- @MultiUserUnawareField
- private int mCurTokenDisplayId = INVALID_DISPLAY;
-
/**
* The display ID of the input method indicates the fallback display which returned by
* {@link #computeImeDisplayIdForTarget}.
@@ -628,8 +620,7 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
@GuardedBy("ImfLock.class")
@Nullable
IInputMethodInvoker getCurMethodLocked() {
- final var userData = mUserDataRepository.getOrCreate(mCurrentUserId);
- return userData.mBindingController.getCurMethod();
+ return getInputMethodBindingController(mCurrentUserId).getCurMethod();
}
/**
@@ -862,37 +853,6 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
final class MyPackageMonitor extends PackageMonitor {
/**
- * Package names that are known to contain {@link InputMethodService}.
- *
- * <p>No need to include packages because of direct-boot unaware IMEs since we always rescan
- * all the packages when the user is unlocked, and direct-boot awareness will not be changed
- * dynamically unless the entire package is updated, which also always triggers package
- * rescanning.</p>
- */
- @GuardedBy("ImfLock.class")
- private final ArraySet<String> mKnownImePackageNames = new ArraySet<>();
-
- /**
- * Packages that are appeared, disappeared, or modified for whatever reason.
- *
- * <p>Note: For now we intentionally use {@link ArrayList} instead of {@link ArraySet}
- * because 1) the number of elements is almost always 1 or so, and 2) we do not care
- * duplicate elements for our use case.</p>
- *
- * <p>This object must be accessed only from callback methods in {@link PackageMonitor},
- * which should be bound to {@link #getRegisteredHandler()}.</p>
- */
- private final ArrayList<String> mChangedPackages = new ArrayList<>();
-
- /**
- * {@code true} if one or more packages that contain {@link InputMethodService} appeared.
- *
- * <p>This field must be accessed only from callback methods in {@link PackageMonitor},
- * which should be bound to {@link #getRegisteredHandler()}.</p>
- */
- private boolean mImePackageAppeared = false;
-
- /**
* Remembers package names passed to {@link #onPackageDataCleared(String, int)}.
*
* <p>This field must be accessed only from callback methods in {@link PackageMonitor},
@@ -905,16 +865,6 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
}
@GuardedBy("ImfLock.class")
- void clearKnownImePackageNamesLocked() {
- mKnownImePackageNames.clear();
- }
-
- @GuardedBy("ImfLock.class")
- void addKnownImePackageNameLocked(@NonNull String packageName) {
- mKnownImePackageNames.add(packageName);
- }
-
- @GuardedBy("ImfLock.class")
private boolean isChangingPackagesOfCurrentUserLocked() {
final int userId = getChangingUserId();
final boolean retval = userId == mCurrentUserId;
@@ -964,52 +914,7 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
}
@Override
- public void onPackageAppeared(String packageName, int reason) {
- if (!mImePackageAppeared) {
- final PackageManager pm = mContext.getPackageManager();
- final List<ResolveInfo> services = pm.queryIntentServicesAsUser(
- new Intent(InputMethod.SERVICE_INTERFACE).setPackage(packageName),
- PackageManager.MATCH_DISABLED_COMPONENTS, getChangingUserId());
- // No need to lock this because we access it only on getRegisteredHandler().
- if (!services.isEmpty()) {
- mImePackageAppeared = true;
- }
- }
- // No need to lock this because we access it only on getRegisteredHandler().
- mChangedPackages.add(packageName);
- }
-
- @Override
- public void onPackageDisappeared(String packageName, int reason) {
- // No need to lock this because we access it only on getRegisteredHandler().
- mChangedPackages.add(packageName);
- }
-
- @Override
- public void onPackageModified(String packageName) {
- // No need to lock this because we access it only on getRegisteredHandler().
- mChangedPackages.add(packageName);
- }
-
- @Override
- public void onPackagesSuspended(String[] packages) {
- // No need to lock this because we access it only on getRegisteredHandler().
- for (String packageName : packages) {
- mChangedPackages.add(packageName);
- }
- }
-
- @Override
- public void onPackagesUnsuspended(String[] packages) {
- // No need to lock this because we access it only on getRegisteredHandler().
- for (String packageName : packages) {
- mChangedPackages.add(packageName);
- }
- }
-
- @Override
public void onPackageDataCleared(String packageName, int uid) {
- mChangedPackages.add(packageName);
mDataClearedPackages.add(packageName);
}
@@ -1021,32 +926,7 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
private void clearPackageChangeState() {
// No need to lock them because we access these fields only on getRegisteredHandler().
- mChangedPackages.clear();
mDataClearedPackages.clear();
- mImePackageAppeared = false;
- }
-
- @GuardedBy("ImfLock.class")
- private boolean shouldRebuildInputMethodListLocked() {
- // This method is guaranteed to be called only by getRegisteredHandler().
-
- // If there is any new package that contains at least one IME, then rebuilt the list
- // of IMEs.
- if (mImePackageAppeared) {
- return true;
- }
-
- // Otherwise, check if mKnownImePackageNames and mChangedPackages have any intersection.
- // TODO: Consider to create a utility method to do the following test. List.retainAll()
- // is an option, but it may still do some extra operations that we do not need here.
- final int numPackages = mChangedPackages.size();
- for (int i = 0; i < numPackages; ++i) {
- final String packageName = mChangedPackages.get(i);
- if (mKnownImePackageNames.contains(packageName)) {
- return true;
- }
- }
- return false;
}
private void onFinishPackageChangesInternal() {
@@ -1107,12 +987,15 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
AdditionalSubtypeMapRepository.putAndSave(userId, newAdditionalSubtypeMap,
settings.getMethodMap());
}
- if (isCurrentUser
- && !(additionalSubtypeChanged || shouldRebuildInputMethodListLocked())) {
- return;
- }
+
final var newMethodMap = newMethodMapWithoutAdditionalSubtypes
.applyAdditionalSubtypes(newAdditionalSubtypeMap);
+
+ if (InputMethodMap.areSame(settings.getMethodMap(), newMethodMap)) {
+ // No update in the actual IME map.
+ return;
+ }
+
final InputMethodSettings newSettings =
InputMethodSettings.create(newMethodMap, userId);
InputMethodSettingsRepository.put(userId, newSettings);
@@ -1243,6 +1126,11 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
public void onUserSwitching(@Nullable TargetUser from, @NonNull TargetUser to) {
// Called on ActivityManager thread.
synchronized (ImfLock.class) {
+ if (mService.mExperimentalConcurrentMultiUserModeEnabled) {
+ // In concurrent multi-user mode, we in general do not rely on the concept of
+ // current user.
+ return;
+ }
mService.scheduleSwitchUserTaskLocked(to.getUserIdentifier(),
/* clientToBeReset= */ null);
}
@@ -1268,9 +1156,15 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
@Override
public void onUserStarting(TargetUser user) {
// Called on ActivityManager thread.
- SecureSettingsWrapper.onUserStarting(user.getUserIdentifier());
+ final int userId = user.getUserIdentifier();
+ SecureSettingsWrapper.onUserStarting(userId);
synchronized (ImfLock.class) {
- mService.mUserDataRepository.getOrCreate(user.getUserIdentifier());
+ mService.mUserDataRepository.getOrCreate(userId);
+ if (mService.mExperimentalConcurrentMultiUserModeEnabled) {
+ if (mService.mCurrentUserId != userId) {
+ mService.experimentalInitializeVisibleBackgroundUserLocked(userId);
+ }
+ }
}
}
@@ -1291,6 +1185,8 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
// We need to rebuild IMEs.
postInputMethodSettingUpdatedLocked(false /* resetDefaultEnabledIme */);
updateInputMethodsFromSettingsLocked(true /* enabledChanged */);
+ } else if (mExperimentalConcurrentMultiUserModeEnabled) {
+ experimentalInitializeVisibleBackgroundUserLocked(userId);
}
}
}
@@ -1397,7 +1293,6 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
new HardwareKeyboardShortcutController(settings.getMethodMap(),
settings.getUserId());
mMenuController = new InputMethodMenuController(this);
- mAutofillController = new AutofillSuggestionsController(this);
mVisibilityStateComputer = new ImeVisibilityStateComputer(this);
mVisibilityApplier = new DefaultImeVisibilityApplier(this);
@@ -1530,8 +1425,7 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
// Note that in b/197848765 we want to see if we can keep the binding alive for better
// profile switching.
- final var userData = mUserDataRepository.getOrCreate(mCurrentUserId);
- final var bindingController = userData.mBindingController;
+ final var bindingController = getInputMethodBindingController(mCurrentUserId);
bindingController.unbindCurrentMethod();
unbindCurrentClientLocked(UnbindReason.SWITCH_USER);
@@ -1751,8 +1645,7 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
// Check if selected IME of current user supports handwriting.
if (userId == mCurrentUserId) {
- final var userData = mUserDataRepository.getOrCreate(userId);
- final var bindingController = userData.mBindingController;
+ final var bindingController = getInputMethodBindingController(userId);
return bindingController.supportsStylusHandwriting()
&& (!connectionless
|| bindingController.supportsConnectionlessStylusHandwriting());
@@ -1808,11 +1701,6 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
return methodList;
}
- @GuardedBy("ImfLock.class")
- void performOnCreateInlineSuggestionsRequestLocked() {
- mAutofillController.performOnCreateInlineSuggestionsRequest();
- }
-
/**
* Gets enabled subtypes of the specified {@link InputMethodInfo}.
*
@@ -1952,8 +1840,7 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
// TODO(b/325515685): make binding controller user independent. Before this change, the
// following dependencies also need to be user independent: mCurClient, mBoundToMethod,
// getCurMethodLocked(), and mMenuController.
- final var userData = mUserDataRepository.getOrCreate(mCurrentUserId);
- final var bindingController = userData.mBindingController;
+ final var bindingController = getInputMethodBindingController(mCurrentUserId);
mCurClient.mClient.onUnbindMethod(bindingController.getSequenceNumber(),
unbindClientReason);
mCurClient.mSessionRequested = false;
@@ -2033,8 +1920,7 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
final boolean restarting = !initial;
final Binder startInputToken = new Binder();
- final var userData = mUserDataRepository.getOrCreate(mCurrentUserId);
- final var bindingController = userData.mBindingController;
+ final var bindingController = getInputMethodBindingController(mCurrentUserId);
final StartInputInfo info = new StartInputInfo(mCurrentUserId,
getCurTokenLocked(),
getCurTokenDisplayIdLocked(), bindingController.getCurId(), startInputReason,
@@ -2140,7 +2026,7 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
@StartInputReason int startInputReason,
int unverifiedTargetSdkVersion,
@NonNull ImeOnBackInvokedDispatcher imeDispatcher,
- @NonNull UserDataRepository.UserData userData) {
+ @NonNull InputMethodBindingController bindingController) {
// Compute the final shown display ID with validated cs.selfReportedDisplayId for this
// session & other conditions.
@@ -2154,8 +2040,9 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
// Potentially override the selected input method if the new display belongs to a virtual
// device with a custom IME.
- String selectedMethodId = getSelectedMethodIdLocked();
- final String deviceMethodId = computeCurrentDeviceMethodIdLocked(selectedMethodId);
+ String selectedMethodId = bindingController.getSelectedMethodId();
+ final String deviceMethodId = computeCurrentDeviceMethodIdLocked(bindingController.mUserId,
+ selectedMethodId);
if (deviceMethodId == null) {
mVisibilityStateComputer.getImePolicy().setImeHiddenByDisplayPolicy(true);
} else if (!Objects.equals(deviceMethodId, selectedMethodId)) {
@@ -2181,7 +2068,6 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
final boolean connectionWasActive = mCurInputConnection != null;
// Bump up the sequence for this client and attach it.
- final var bindingController = userData.mBindingController;
bindingController.advanceSequenceNumber();
mCurClient = cs;
@@ -2212,7 +2098,7 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
if (DEBUG) {
Slog.d(TAG, "Avoiding IME startup and unbinding current input method.");
}
- invalidateAutofillSessionLocked();
+ bindingController.invalidateAutofillSession();
bindingController.unbindCurrentMethod();
return InputBindResult.NO_EDITOR;
}
@@ -2241,7 +2127,7 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
(startInputFlags & StartInputFlags.INITIAL_CONNECTION) != 0);
}
- InputBindResult bindResult = tryReuseConnectionLocked(userData, cs);
+ InputBindResult bindResult = tryReuseConnectionLocked(bindingController, cs);
if (bindResult != null) {
return bindResult;
}
@@ -2262,7 +2148,8 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
* <p>4. Otherwise keep the current imeId.</p>
*/
@GuardedBy("ImfLock.class")
- private String computeCurrentDeviceMethodIdLocked(String currentMethodId) {
+ private String computeCurrentDeviceMethodIdLocked(@UserIdInt int userId,
+ String currentMethodId) {
if (mVdmInternal == null) {
mVdmInternal = LocalServices.getService(VirtualDeviceManagerInternal.class);
}
@@ -2270,7 +2157,7 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
return currentMethodId;
}
- final InputMethodSettings settings = InputMethodSettingsRepository.get(mCurrentUserId);
+ final InputMethodSettings settings = InputMethodSettingsRepository.get(userId);
final int oldDeviceId = mDeviceIdToShowIme;
mDeviceIdToShowIme = mVdmInternal.getDeviceIdForDisplayId(mDisplayIdToShowIme);
if (mDeviceIdToShowIme == DEVICE_ID_DEFAULT) {
@@ -2312,11 +2199,6 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
}
@GuardedBy("ImfLock.class")
- void invalidateAutofillSessionLocked() {
- mAutofillController.invalidateAutofillSession();
- }
-
- @GuardedBy("ImfLock.class")
private boolean shouldPreventImeStartupLocked(
@NonNull String selectedMethodId,
@StartInputFlags int startInputFlags,
@@ -2355,9 +2237,8 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
@GuardedBy("ImfLock.class")
@Nullable
- private InputBindResult tryReuseConnectionLocked(@NonNull UserDataRepository.UserData userData,
- @NonNull ClientState cs) {
- final var bindingController = userData.mBindingController;
+ private InputBindResult tryReuseConnectionLocked(
+ @NonNull InputMethodBindingController bindingController, @NonNull ClientState cs) {
if (bindingController.hasMainConnection()) {
if (getCurMethodLocked() != null) {
// Return to client, and we will get back with it when
@@ -2505,8 +2386,6 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
mImeWindowVis = 0;
mBackDisposition = InputMethodService.BACK_DISPOSITION_DEFAULT;
updateSystemUiLocked(mImeWindowVis, mBackDisposition);
- mCurTokenDisplayId = INVALID_DISPLAY;
- mAutofillController.onResetSystemUi();
}
@GuardedBy("ImfLock.class")
@@ -2740,8 +2619,9 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
// When the IME switcher dialog is shown, the IME switcher button should be hidden.
if (mMenuController.getSwitchingDialogLocked() != null) return false;
// When we are switching IMEs, the IME switcher button should be hidden.
- final var userData = mUserDataRepository.getOrCreate(mCurrentUserId);
- if (!Objects.equals(userData.mBindingController.getCurId(), getSelectedMethodIdLocked())) {
+ final var bindingController = getInputMethodBindingController(mCurrentUserId);
+ if (!Objects.equals(bindingController.getCurId(),
+ bindingController.getSelectedMethodId())) {
return false;
}
if (mWindowManagerInternal.isKeyguardShowingAndNotOccluded()
@@ -2903,8 +2783,7 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
} else {
vis &= ~InputMethodService.IME_VISIBLE_IMPERCEPTIBLE;
}
- final var userData = mUserDataRepository.getOrCreate(mCurrentUserId);
- final var curId = userData.mBindingController.getCurId();
+ final var curId = getInputMethodBindingController(mCurrentUserId).getCurId();
if (mMenuController.getSwitchingDialogLocked() != null
|| !Objects.equals(curId, getSelectedMethodIdLocked())) {
// When the IME switcher dialog is shown, or we are switching IMEs,
@@ -2927,6 +2806,48 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
mMenuController.updateKeyboardFromSettingsLocked();
}
+ /**
+ * This is an experimental implementation used when and only when
+ * {@link #mExperimentalConcurrentMultiUserModeEnabled}.
+ *
+ * <p>Never assume what this method is doing is officially supported. For the canonical and
+ * desired behaviors always refer to single-user code paths such as
+ * {@link #updateInputMethodsFromSettingsLocked(boolean)}.</p>
+ *
+ * <p>Here are examples of missing features.</p>
+ * <ul>
+ * <li>Subtypes are not supported at all!</li>
+ * <li>Profiles are not supported.</li>
+ * <li>
+ * {@link PackageManager#COMPONENT_ENABLED_STATE_DISABLED_UNTIL_USED} is not updated.
+ * </li>
+ * <li>{@link #mDeviceIdToShowIme} is ignored.</li>
+ * <li>{@link #mSwitchingController} is ignored.</li>
+ * <li>{@link #mHardwareKeyboardShortcutController} is ignored.</li>
+ * <li>{@link #mPreventImeStartupUnlessTextEditor} is ignored.</li>
+ * <li>and so on.</li>
+ * </ul>
+ */
+ @GuardedBy("ImfLock.class")
+ void experimentalInitializeVisibleBackgroundUserLocked(@UserIdInt int userId) {
+ if (!mUserManagerInternal.isUserVisible(userId)) {
+ return;
+ }
+ final var settings = InputMethodSettingsRepository.get(userId);
+ String id = settings.getSelectedInputMethod();
+ if (TextUtils.isEmpty(id)) {
+ final InputMethodInfo imi = InputMethodInfoUtils.getMostApplicableDefaultIME(
+ settings.getEnabledInputMethodList());
+ if (imi == null) {
+ return;
+ }
+ id = imi.getId();
+ settings.putSelectedInputMethod(id);
+ }
+ final var bindingController = getInputMethodBindingController(userId);
+ bindingController.setSelectedMethodId(id);
+ }
+
@GuardedBy("ImfLock.class")
void updateInputMethodsFromSettingsLocked(boolean enabledMayChange) {
final InputMethodSettings settings = InputMethodSettingsRepository.get(mCurrentUserId);
@@ -3099,8 +3020,7 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
// mCurMethodId should be updated after setSelectedInputMethodAndSubtypeLocked()
// because mCurMethodId is stored as a history in
// setSelectedInputMethodAndSubtypeLocked().
- final var userData = mUserDataRepository.getOrCreate(mCurrentUserId);
- userData.mBindingController.setSelectedMethodId(id);
+ getInputMethodBindingController(mCurrentUserId).setSelectedMethodId(id);
if (mActivityManagerInternal.isSystemReady()) {
Intent intent = new Intent(Intent.ACTION_INPUT_METHOD_CHANGED);
@@ -3155,8 +3075,8 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
@Nullable String delegatorPackageName,
@NonNull IConnectionlessHandwritingCallback callback) {
synchronized (ImfLock.class) {
- final var userData = mUserDataRepository.getOrCreate(userId);
- if (!userData.mBindingController.supportsConnectionlessStylusHandwriting()) {
+ final var bindingController = getInputMethodBindingController(userId);
+ if (!bindingController.supportsConnectionlessStylusHandwriting()) {
Slog.w(TAG, "Connectionless stylus handwriting mode unsupported by IME.");
try {
callback.onError(CONNECTIONLESS_HANDWRITING_ERROR_UNSUPPORTED);
@@ -3239,8 +3159,8 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
}
final long ident = Binder.clearCallingIdentity();
try {
- final var userData = mUserDataRepository.getOrCreate(mCurrentUserId);
- if (!userData.mBindingController.supportsStylusHandwriting()) {
+ final var bindingController = getInputMethodBindingController(mCurrentUserId);
+ if (!bindingController.supportsStylusHandwriting()) {
Slog.w(TAG,
"Stylus HW unsupported by IME. Ignoring startStylusHandwriting()");
return false;
@@ -3423,8 +3343,8 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
mVisibilityStateComputer.requestImeVisibility(windowToken, true);
// Ensure binding the connection when IME is going to show.
- final var userData = mUserDataRepository.getOrCreate(mCurrentUserId);
- userData.mBindingController.setCurrentMethodVisible();
+ final var bindingController = getInputMethodBindingController(mCurrentUserId);
+ bindingController.setCurrentMethodVisible();
final IInputMethodInvoker curMethod = getCurMethodLocked();
ImeTracker.forLogging().onCancelled(mCurStatsToken, ImeTracker.PHASE_SERVER_WAIT_IME);
final boolean readyToDispatchToIme;
@@ -3532,8 +3452,8 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
} else {
ImeTracker.forLogging().onCancelled(statsToken, ImeTracker.PHASE_SERVER_SHOULD_HIDE);
}
- final var userData = mUserDataRepository.getOrCreate(mCurrentUserId);
- userData.mBindingController.setCurrentMethodNotVisible();
+ final var bindingController = getInputMethodBindingController(mCurrentUserId);
+ bindingController.setCurrentMethodNotVisible();
mVisibilityStateComputer.clearImeShowFlags();
// Cancel existing statsToken for show IME as we got a hide request.
ImeTracker.forLogging().onCancelled(mCurStatsToken, ImeTracker.PHASE_SERVER_WAIT_IME);
@@ -3601,8 +3521,7 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
"InputMethodManagerService#startInputOrWindowGainedFocus", mDumper);
final InputBindResult result;
synchronized (ImfLock.class) {
- final var userData = mUserDataRepository.getOrCreate(userId);
- final var bindingController = userData.mBindingController;
+ final var bindingController = getInputMethodBindingController(userId);
// If the system is not yet ready, we shouldn't be running third party code.
if (!mSystemReady) {
return new InputBindResult(
@@ -3619,7 +3538,8 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
final long ident = Binder.clearCallingIdentity();
try {
// Verify if IMMS is in the process of switching user.
- if (mUserSwitchHandlerTask != null) {
+ if (!mExperimentalConcurrentMultiUserModeEnabled
+ && mUserSwitchHandlerTask != null) {
// There is already an on-going pending user switch task.
final int nextUserId = mUserSwitchHandlerTask.mToUserId;
if (userId == nextUserId) {
@@ -3673,7 +3593,7 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
}
// Verify if caller is a background user.
- if (userId != mCurrentUserId) {
+ if (!mExperimentalConcurrentMultiUserModeEnabled && userId != mCurrentUserId) {
if (ArrayUtils.contains(
mUserManagerInternal.getProfileIds(mCurrentUserId, false),
userId)) {
@@ -3701,7 +3621,7 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
result = startInputOrWindowGainedFocusInternalLocked(startInputReason,
client, windowToken, startInputFlags, softInputMode, windowFlags,
editorInfo, inputConnection, remoteAccessibilityInputConnection,
- unverifiedTargetSdkVersion, userData, imeDispatcher, cs);
+ unverifiedTargetSdkVersion, bindingController, imeDispatcher, cs);
} finally {
Binder.restoreCallingIdentity(ident);
}
@@ -3729,7 +3649,7 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
@SoftInputModeFlags int softInputMode, int windowFlags, EditorInfo editorInfo,
IRemoteInputConnection inputContext,
@Nullable IRemoteAccessibilityInputConnection remoteAccessibilityInputConnection,
- int unverifiedTargetSdkVersion, @NonNull UserDataRepository.UserData userData,
+ int unverifiedTargetSdkVersion, @NonNull InputMethodBindingController bindingController,
@NonNull ImeOnBackInvokedDispatcher imeDispatcher, @NonNull ClientState cs) {
if (DEBUG) {
Slog.v(TAG, "startInputOrWindowGainedFocusInternalLocked: reason="
@@ -3742,7 +3662,7 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
+ " softInputMode=" + InputMethodDebug.softInputModeToString(softInputMode)
+ " windowFlags=#" + Integer.toHexString(windowFlags)
+ " unverifiedTargetSdkVersion=" + unverifiedTargetSdkVersion
- + " userData=" + userData
+ + " bindingController=" + bindingController
+ " imeDispatcher=" + imeDispatcher
+ " cs=" + cs);
}
@@ -3771,15 +3691,16 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
if (editorInfo != null) {
return startInputUncheckedLocked(cs, inputContext,
remoteAccessibilityInputConnection, editorInfo, startInputFlags,
- startInputReason, unverifiedTargetSdkVersion, imeDispatcher, userData);
+ startInputReason, unverifiedTargetSdkVersion, imeDispatcher,
+ bindingController);
}
return new InputBindResult(
InputBindResult.ResultCode.SUCCESS_REPORT_WINDOW_FOCUS_ONLY,
null, null, null, null, -1, false);
}
- mImeBindingState = new ImeBindingState(userData.mUserId, windowToken, softInputMode, cs,
- editorInfo);
+ mImeBindingState = new ImeBindingState(bindingController.mUserId, windowToken,
+ softInputMode, cs, editorInfo);
mFocusedWindowPerceptible.put(windowToken, true);
// We want to start input before showing the IME, but after closing
@@ -3804,7 +3725,7 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
res = startInputUncheckedLocked(cs, inputContext,
remoteAccessibilityInputConnection, editorInfo, startInputFlags,
startInputReason, unverifiedTargetSdkVersion,
- imeDispatcher, userData);
+ imeDispatcher, bindingController);
didStart = true;
}
break;
@@ -3819,7 +3740,7 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
// Note that we can trust client's display ID as long as it matches
// to the display ID obtained from the window.
if (cs.mSelfReportedDisplayId != getCurTokenDisplayIdLocked()) {
- userData.mBindingController.unbindCurrentMethod();
+ bindingController.unbindCurrentMethod();
}
}
}
@@ -3828,7 +3749,7 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
res = startInputUncheckedLocked(cs, inputContext,
remoteAccessibilityInputConnection, editorInfo, startInputFlags,
startInputReason, unverifiedTargetSdkVersion,
- imeDispatcher, userData);
+ imeDispatcher, bindingController);
} else {
res = InputBindResult.NULL_EDITOR_INFO;
}
@@ -3869,8 +3790,7 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
if (mCurrentUserId != UserHandle.getUserId(uid)) {
return false;
}
- final var userData = mUserDataRepository.getOrCreate(mCurrentUserId);
- final var curIntent = userData.mBindingController.getCurIntent();
+ final var curIntent = getInputMethodBindingController(mCurrentUserId).getCurIntent();
if (curIntent != null && InputMethodUtils.checkIfPackageBelongsToUid(
mPackageManagerInternal, uid, curIntent.getComponent().getPackageName())) {
return true;
@@ -4279,8 +4199,7 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
mStylusIds.add(deviceId);
// a new Stylus is detected. If IME supports handwriting, and we don't have
// handwriting initialized, lets do it now.
- final var userData = mUserDataRepository.getOrCreate(mCurrentUserId);
- final var bindingController = userData.mBindingController;
+ final var bindingController = getInputMethodBindingController(mCurrentUserId);
if (!mHwController.getCurrentRequestId().isPresent()
&& bindingController.supportsStylusHandwriting()) {
scheduleResetStylusHandwriting();
@@ -4372,11 +4291,8 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
private static IntArray getStylusInputDeviceIds(InputManager im) {
IntArray stylusIds = new IntArray();
for (int id : im.getInputDeviceIds()) {
- if (!im.isInputDeviceEnabled(id)) {
- continue;
- }
InputDevice device = im.getInputDevice(id);
- if (device != null && isStylusDevice(device)) {
+ if (device != null && device.isEnabled() && isStylusDevice(device)) {
stylusIds.add(id);
}
}
@@ -4464,8 +4380,7 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
private void dumpDebug(ProtoOutputStream proto, long fieldId) {
synchronized (ImfLock.class) {
- final var userData = mUserDataRepository.getOrCreate(mCurrentUserId);
- final var bindingController = userData.mBindingController;
+ final var bindingController = getInputMethodBindingController(mCurrentUserId);
final long token = proto.start(fieldId);
proto.write(CUR_METHOD_ID, getSelectedMethodIdLocked());
proto.write(CUR_SEQ, bindingController.getSequenceNumber());
@@ -4855,8 +4770,7 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
case MSG_RESET_HANDWRITING: {
synchronized (ImfLock.class) {
- final var userData = mUserDataRepository.getOrCreate(mCurrentUserId);
- final var bindingController = userData.mBindingController;
+ final var bindingController = getInputMethodBindingController(mCurrentUserId);
if (bindingController.supportsStylusHandwriting()
&& getCurMethodLocked() != null && hasSupportedStylusLocked()) {
Slog.d(TAG, "Initializing Handwriting Spy");
@@ -4882,8 +4796,7 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
if (curMethod == null || mImeBindingState.mFocusedWindow == null) {
return true;
}
- final var userData = mUserDataRepository.getOrCreate(mCurrentUserId);
- final var bindingController = userData.mBindingController;
+ final var bindingController = getInputMethodBindingController(mCurrentUserId);
final HandwritingModeController.HandwritingSession session =
mHwController.startHandwritingSession(
msg.arg1 /*requestId*/,
@@ -4939,8 +4852,7 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
return;
}
// TODO(b/325515685): user data must be retrieved by a userId parameter
- final var userData = mUserDataRepository.getOrCreate(mCurrentUserId);
- final var bindingController = userData.mBindingController;
+ final var bindingController = getInputMethodBindingController(mCurrentUserId);
if (mImePlatformCompatUtils.shouldUseSetInteractiveProtocol(
bindingController.getCurMethodUid())) {
// Handle IME visibility when interactive changed before finishing the input to
@@ -5077,30 +4989,9 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
return;
}
mMethodMapUpdateCount++;
- mMyPackageMonitor.clearKnownImePackageNamesLocked();
final InputMethodSettings settings = InputMethodSettingsRepository.get(mCurrentUserId);
- // Construct the set of possible IME packages for onPackageChanged() to avoid false
- // negatives when the package state remains to be the same but only the component state is
- // changed.
- {
- // Here we intentionally use PackageManager.MATCH_DISABLED_COMPONENTS since the purpose
- // of this query is to avoid false negatives. PackageManager.MATCH_ALL could be more
- // conservative, but it seems we cannot use it for now (Issue 35176630).
- final List<ResolveInfo> allInputMethodServices =
- mContext.getPackageManager().queryIntentServicesAsUser(
- new Intent(InputMethod.SERVICE_INTERFACE),
- PackageManager.MATCH_DISABLED_COMPONENTS, settings.getUserId());
- final int numImes = allInputMethodServices.size();
- for (int i = 0; i < numImes; ++i) {
- final ServiceInfo si = allInputMethodServices.get(i).serviceInfo;
- if (android.Manifest.permission.BIND_INPUT_METHOD.equals(si.permission)) {
- mMyPackageMonitor.addKnownImePackageNameLocked(si.packageName);
- }
- }
- }
-
boolean reenableMinimumNonAuxSystemImes = false;
// TODO: The following code should find better place to live.
if (!resetDefaultEnabledIme) {
@@ -5186,8 +5077,7 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
@GuardedBy("ImfLock.class")
void sendOnNavButtonFlagsChangedLocked() {
- final var userData = mUserDataRepository.getOrCreate(mCurrentUserId);
- final var bindingController = userData.mBindingController;
+ final var bindingController = getInputMethodBindingController(mCurrentUserId);
final IInputMethodInvoker curMethod = bindingController.getCurMethod();
if (curMethod == null) {
// No need to send the data if the IME is not yet bound.
@@ -5557,8 +5447,8 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
.isTouchExplorationEnabled(userId);
synchronized (ImfLock.class) {
- mAutofillController.onCreateInlineSuggestionsRequest(userId, requestInfo, cb,
- touchExplorationEnabled);
+ getInputMethodBindingController(userId).onCreateInlineSuggestionsRequest(
+ requestInfo, cb, touchExplorationEnabled);
}
}
@@ -5626,7 +5516,7 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
if (displayId != getCurTokenDisplayIdLocked()) {
return false;
}
- curHostInputToken = mAutofillController.getCurHostInputToken();
+ curHostInputToken = getInputMethodBindingController(userId).getCurHostInputToken();
if (curHostInputToken == null) {
return false;
}
@@ -5674,8 +5564,7 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
public void onSessionForAccessibilityCreated(int accessibilityConnectionId,
IAccessibilityInputMethodSession session, @UserIdInt int userId) {
synchronized (ImfLock.class) {
- final var userData = mUserDataRepository.getOrCreate(mCurrentUserId);
- final var bindingController = userData.mBindingController;
+ final var bindingController = getInputMethodBindingController(mCurrentUserId);
// TODO(b/305829876): Implement user ID verification
if (mCurClient != null) {
clearClientSessionForAccessibilityLocked(mCurClient, accessibilityConnectionId);
@@ -5710,8 +5599,7 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
public void unbindAccessibilityFromCurrentClient(int accessibilityConnectionId,
@UserIdInt int userId) {
synchronized (ImfLock.class) {
- final var userData = mUserDataRepository.getOrCreate(mCurrentUserId);
- final var bindingController = userData.mBindingController;
+ final var bindingController = getInputMethodBindingController(mCurrentUserId);
// TODO(b/305829876): Implement user ID verification
if (mCurClient != null) {
if (DEBUG) {
@@ -5943,8 +5831,7 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
p.println(" pid=" + c.mPid);
};
mClientController.forAllClients(clientControllerDump);
- final var userData = mUserDataRepository.getOrCreate(mCurrentUserId);
- final var bindingController = userData.mBindingController;
+ final var bindingController = getInputMethodBindingController(mCurrentUserId);
p.println(" mCurrentUserId=" + mCurrentUserId);
p.println(" mCurMethodId=" + getSelectedMethodIdLocked());
client = mCurClient;
@@ -5971,7 +5858,7 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
p.println(" mCurToken=" + getCurTokenLocked());
p.println(" mCurTokenDisplayId=" + getCurTokenDisplayIdLocked());
- p.println(" mCurHostInputToken=" + mAutofillController.getCurHostInputToken());
+ p.println(" mCurHostInputToken=" + bindingController.getCurHostInputToken());
p.println(" mCurIntent=" + bindingController.getCurIntent());
method = getCurMethodLocked();
p.println(" mCurMethod=" + getCurMethodLocked());
@@ -6456,8 +6343,8 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
continue;
}
// Skip on headless user
- if (USER_TYPE_SYSTEM_HEADLESS.equals(
- mUserManagerInternal.getUserInfo(userId).userType)) {
+ final var userInfo = mUserManagerInternal.getUserInfo(userId);
+ if (userInfo != null && USER_TYPE_SYSTEM_HEADLESS.equals(userInfo.userType)) {
continue;
}
final String nextIme;
@@ -6466,8 +6353,7 @@ public final class InputMethodManagerService implements IInputMethodManagerImpl.
if (userId == mCurrentUserId) {
hideCurrentInputLocked(mImeBindingState.mFocusedWindow, 0 /* flags */,
SoftInputShowHideReason.HIDE_RESET_SHELL_COMMAND);
- final var userData = mUserDataRepository.getOrCreate(userId);
- final var bindingController = userData.mBindingController;
+ final var bindingController = getInputMethodBindingController(userId);
bindingController.unbindCurrentMethod();
// Enable default IMEs, disable others
diff --git a/services/core/java/com/android/server/location/contexthub/ContextHubService.java b/services/core/java/com/android/server/location/contexthub/ContextHubService.java
index 17f8abe14ea0..b3fb147a318b 100644
--- a/services/core/java/com/android/server/location/contexthub/ContextHubService.java
+++ b/services/core/java/com/android/server/location/contexthub/ContextHubService.java
@@ -317,9 +317,6 @@ public class ContextHubService extends IContextHubService.Stub {
*/
private static final int MAX_PROBABILITY_PERCENT = 100;
- /**
- * Random number generator.
- */
private Random mRandom = new Random();
/**
@@ -998,50 +995,75 @@ public class ContextHubService extends IContextHubService.Stub {
return;
}
- if (message.isReliable()) {
- byte errorCode = ErrorCode.OK;
- synchronized (mReliableMessageRecordQueue) {
- Optional<ReliableMessageRecord> record = Optional.empty();
- for (ReliableMessageRecord r: mReliableMessageRecordQueue) {
- if (r.getContextHubId() == contextHubId
- && r.getMessageSequenceNumber() == message.getMessageSequenceNumber()) {
- record = Optional.of(r);
- break;
- }
- }
+ if (!message.isReliable()) {
+ mClientManager.onMessageFromNanoApp(
+ contextHubId, hostEndpointId, message,
+ nanoappPermissions, messagePermissions);
+ cleanupReliableMessageRecordQueue();
+ return;
+ }
- if (record.isPresent()) {
- errorCode = record.get().getErrorCode();
- if (errorCode == ErrorCode.TRANSIENT_ERROR) {
- Log.w(TAG, "Found duplicate reliable message with message sequence number: "
- + record.get().getMessageSequenceNumber() + ": retrying");
- errorCode = mClientManager.onMessageFromNanoApp(
- contextHubId, hostEndpointId, message,
- nanoappPermissions, messagePermissions);
- record.get().setErrorCode(errorCode);
- } else {
- Log.w(TAG, "Found duplicate reliable message with message sequence number: "
- + record.get().getMessageSequenceNumber());
- }
- } else {
+ byte errorCode = ErrorCode.OK;
+ synchronized (mReliableMessageRecordQueue) {
+ Optional<ReliableMessageRecord> record =
+ findReliableMessageRecord(contextHubId,
+ message.getMessageSequenceNumber());
+
+ if (record.isPresent()) {
+ errorCode = record.get().getErrorCode();
+ if (errorCode == ErrorCode.TRANSIENT_ERROR) {
+ Log.w(TAG, "Found duplicate reliable message with message sequence number: "
+ + record.get().getMessageSequenceNumber() + ": retrying");
errorCode = mClientManager.onMessageFromNanoApp(
contextHubId, hostEndpointId, message,
nanoappPermissions, messagePermissions);
- mReliableMessageRecordQueue.add(
- new ReliableMessageRecord(contextHubId,
- SystemClock.elapsedRealtimeNanos(),
- message.getMessageSequenceNumber(),
- errorCode));
+ record.get().setErrorCode(errorCode);
+ } else {
+ Log.w(TAG, "Found duplicate reliable message with message sequence number: "
+ + record.get().getMessageSequenceNumber());
}
+ } else {
+ errorCode = mClientManager.onMessageFromNanoApp(
+ contextHubId, hostEndpointId, message,
+ nanoappPermissions, messagePermissions);
+ mReliableMessageRecordQueue.add(
+ new ReliableMessageRecord(contextHubId,
+ SystemClock.elapsedRealtimeNanos(),
+ message.getMessageSequenceNumber(),
+ errorCode));
+ }
+ }
+
+ sendMessageDeliveryStatusToContextHub(contextHubId,
+ message.getMessageSequenceNumber(), errorCode);
+ cleanupReliableMessageRecordQueue();
+ }
+
+ /**
+ * Finds a reliable message record in the queue that matches the given
+ * context hub ID and message sequence number. This function assumes
+ * the caller is synchronized on mReliableMessageRecordQueue.
+ *
+ * @param contextHubId the ID of the hub
+ * @param messageSequenceNumber the message sequence number
+ *
+ * @return the record if found, or empty if not found
+ */
+ private Optional<ReliableMessageRecord> findReliableMessageRecord(
+ int contextHubId, int messageSequenceNumber) {
+ for (ReliableMessageRecord record: mReliableMessageRecordQueue) {
+ if (record.getContextHubId() == contextHubId
+ && record.getMessageSequenceNumber() == messageSequenceNumber) {
+ return Optional.of(record);
}
- sendMessageDeliveryStatusToContextHub(contextHubId,
- message.getMessageSequenceNumber(), errorCode);
- } else {
- mClientManager.onMessageFromNanoApp(
- contextHubId, hostEndpointId, message,
- nanoappPermissions, messagePermissions);
}
+ return Optional.empty();
+ }
+ /**
+ * Removes old entries from the reliable message record queue.
+ */
+ private void cleanupReliableMessageRecordQueue() {
synchronized (mReliableMessageRecordQueue) {
while (mReliableMessageRecordQueue.peek() != null
&& mReliableMessageRecordQueue.peek().isExpired()) {
diff --git a/services/core/java/com/android/server/locksettings/LockSettingsService.java b/services/core/java/com/android/server/locksettings/LockSettingsService.java
index dbdb155eb2e3..b14702dc6647 100644
--- a/services/core/java/com/android/server/locksettings/LockSettingsService.java
+++ b/services/core/java/com/android/server/locksettings/LockSettingsService.java
@@ -737,12 +737,13 @@ public class LockSettingsService extends ILockSettings.Stub {
!mUserManager.isQuietModeEnabled(userHandle)) {
// Only show notifications for managed profiles once their parent
// user is unlocked.
- showEncryptionNotificationForProfile(userHandle, reason);
+ showEncryptionNotificationForProfile(userHandle, parent.getUserHandle(), reason);
}
}
}
- private void showEncryptionNotificationForProfile(UserHandle user, String reason) {
+ private void showEncryptionNotificationForProfile(UserHandle user, UserHandle parent,
+ String reason) {
CharSequence title = getEncryptionNotificationTitle();
CharSequence message = getEncryptionNotificationMessage();
CharSequence detail = getEncryptionNotificationDetail();
@@ -759,8 +760,15 @@ public class LockSettingsService extends ILockSettings.Stub {
unlockIntent.setFlags(
Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
- PendingIntent intent = PendingIntent.getActivity(mContext, 0, unlockIntent,
- PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_MUTABLE_UNAUDITED);
+ PendingIntent intent;
+ if (android.app.admin.flags.Flags.hsumUnlockNotificationFix()) {
+ intent = PendingIntent.getActivityAsUser(mContext, 0, unlockIntent,
+ PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_MUTABLE_UNAUDITED,
+ null, parent);
+ } else {
+ intent = PendingIntent.getActivity(mContext, 0, unlockIntent,
+ PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_MUTABLE_UNAUDITED);
+ }
Slogf.d(TAG, "Showing encryption notification for user %d; reason: %s",
user.getIdentifier(), reason);
diff --git a/services/core/java/com/android/server/media/MediaRoute2ProviderServiceProxy.java b/services/core/java/com/android/server/media/MediaRoute2ProviderServiceProxy.java
index a7fd750e4037..386657e99e36 100644
--- a/services/core/java/com/android/server/media/MediaRoute2ProviderServiceProxy.java
+++ b/services/core/java/com/android/server/media/MediaRoute2ProviderServiceProxy.java
@@ -81,6 +81,7 @@ final class MediaRoute2ProviderServiceProxy extends MediaRoute2Provider
MediaRoute2ProviderServiceProxy(
@NonNull Context context,
+ @NonNull Looper looper,
@NonNull ComponentName componentName,
boolean isSelfScanOnlyProvider,
int userId) {
@@ -88,7 +89,7 @@ final class MediaRoute2ProviderServiceProxy extends MediaRoute2Provider
mContext = Objects.requireNonNull(context, "Context must not be null.");
mIsSelfScanOnlyProvider = isSelfScanOnlyProvider;
mUserId = userId;
- mHandler = new Handler(Looper.myLooper());
+ mHandler = new Handler(looper);
}
public void setManagerScanning(boolean managerScanning) {
diff --git a/services/core/java/com/android/server/media/MediaRoute2ProviderWatcher.java b/services/core/java/com/android/server/media/MediaRoute2ProviderWatcher.java
index 178eb717f271..7c1a5e113a5e 100644
--- a/services/core/java/com/android/server/media/MediaRoute2ProviderWatcher.java
+++ b/services/core/java/com/android/server/media/MediaRoute2ProviderWatcher.java
@@ -142,6 +142,7 @@ final class MediaRoute2ProviderWatcher {
MediaRoute2ProviderServiceProxy proxy =
new MediaRoute2ProviderServiceProxy(
mContext,
+ mHandler.getLooper(),
new ComponentName(serviceInfo.packageName, serviceInfo.name),
isSelfScanOnlyProvider,
mUserId);
diff --git a/services/core/java/com/android/server/media/MediaRouter2ServiceImpl.java b/services/core/java/com/android/server/media/MediaRouter2ServiceImpl.java
index e1f893953d66..c03497e629f0 100644
--- a/services/core/java/com/android/server/media/MediaRouter2ServiceImpl.java
+++ b/services/core/java/com/android/server/media/MediaRouter2ServiceImpl.java
@@ -404,37 +404,17 @@ class MediaRouter2ServiceImpl {
long managerRequestId,
@NonNull RoutingSessionInfo oldSession,
@NonNull MediaRoute2Info route,
- Bundle sessionHints,
- @Nullable UserHandle transferInitiatorUserHandle,
- @Nullable String transferInitiatorPackageName) {
+ Bundle sessionHints) {
Objects.requireNonNull(router, "router must not be null");
Objects.requireNonNull(oldSession, "oldSession must not be null");
Objects.requireNonNull(route, "route must not be null");
- synchronized (mLock) {
- if (managerRequestId == MediaRoute2ProviderService.REQUEST_ID_NONE
- || transferInitiatorUserHandle == null
- || transferInitiatorPackageName == null) {
- final IBinder binder = router.asBinder();
- final RouterRecord routerRecord = mAllRouterRecords.get(binder);
-
- transferInitiatorUserHandle = Binder.getCallingUserHandle();
- if (routerRecord != null) {
- transferInitiatorPackageName = routerRecord.mPackageName;
- } else {
- transferInitiatorPackageName = mContext.getPackageName();
- }
- }
- }
-
final long token = Binder.clearCallingIdentity();
try {
synchronized (mLock) {
requestCreateSessionWithRouter2Locked(
requestId,
managerRequestId,
- transferInitiatorUserHandle,
- transferInitiatorPackageName,
router,
oldSession,
route,
@@ -1281,8 +1261,6 @@ class MediaRouter2ServiceImpl {
private void requestCreateSessionWithRouter2Locked(
int requestId,
long managerRequestId,
- @NonNull UserHandle transferInitiatorUserHandle,
- @NonNull String transferInitiatorPackageName,
@NonNull IMediaRouter2 router,
@NonNull RoutingSessionInfo oldSession,
@NonNull MediaRoute2Info route,
@@ -1355,8 +1333,6 @@ class MediaRouter2ServiceImpl {
userHandler,
uniqueRequestId,
managerRequestId,
- transferInitiatorUserHandle,
- transferInitiatorPackageName,
routerRecord,
oldSession,
route,
@@ -2695,11 +2671,7 @@ class MediaRouter2ServiceImpl {
route = mSystemProvider.getDefaultRoute();
}
routerRecord.mRouter.requestCreateSessionByManager(
- uniqueRequestId,
- oldSession,
- route,
- transferInitiatorUserHandle,
- transferInitiatorPackageName);
+ uniqueRequestId, oldSession, route);
} catch (RemoteException ex) {
Slog.w(TAG, "getSessionHintsForCreatingSessionOnHandler: "
+ "Failed to request. Router probably died.", ex);
@@ -2711,8 +2683,6 @@ class MediaRouter2ServiceImpl {
private void requestCreateSessionWithRouter2OnHandler(
long uniqueRequestId,
long managerRequestId,
- @NonNull UserHandle transferInitiatorUserHandle,
- @NonNull String transferInitiatorPackageName,
@NonNull RouterRecord routerRecord,
@NonNull RoutingSessionInfo oldSession,
@NonNull MediaRoute2Info route,
@@ -2732,10 +2702,10 @@ class MediaRouter2ServiceImpl {
managerRequestId, oldSession, route);
mSessionCreationRequests.add(request);
- int transferReason = RoutingSessionInfo.TRANSFER_REASON_APP;
- if (managerRequestId != MediaRoute2ProviderService.REQUEST_ID_NONE) {
- transferReason = RoutingSessionInfo.TRANSFER_REASON_SYSTEM_REQUEST;
- }
+ int transferReason =
+ managerRequestId != MediaRoute2ProviderService.REQUEST_ID_NONE
+ ? RoutingSessionInfo.TRANSFER_REASON_SYSTEM_REQUEST
+ : RoutingSessionInfo.TRANSFER_REASON_APP;
provider.requestCreateSession(
uniqueRequestId,
@@ -2743,8 +2713,8 @@ class MediaRouter2ServiceImpl {
route.getOriginalId(),
sessionHints,
transferReason,
- transferInitiatorUserHandle,
- transferInitiatorPackageName);
+ UserHandle.of(routerRecord.mUserRecord.mUserId),
+ routerRecord.mPackageName);
}
// routerRecord can be null if the session is system's or RCN.
diff --git a/services/core/java/com/android/server/media/MediaRouterService.java b/services/core/java/com/android/server/media/MediaRouterService.java
index 064443ce7d10..192ac6287884 100644
--- a/services/core/java/com/android/server/media/MediaRouterService.java
+++ b/services/core/java/com/android/server/media/MediaRouterService.java
@@ -495,18 +495,9 @@ public final class MediaRouterService extends IMediaRouterService.Stub
long managerRequestId,
RoutingSessionInfo oldSession,
MediaRoute2Info route,
- Bundle sessionHints,
- @Nullable UserHandle transferInitiatorUserHandle,
- @Nullable String transferInitiatorPackageName) {
+ Bundle sessionHints) {
mService2.requestCreateSessionWithRouter2(
- router,
- requestId,
- managerRequestId,
- oldSession,
- route,
- sessionHints,
- transferInitiatorUserHandle,
- transferInitiatorPackageName);
+ router, requestId, managerRequestId, oldSession, route, sessionHints);
}
// Binder call
diff --git a/services/core/java/com/android/server/media/MediaShellCommand.java b/services/core/java/com/android/server/media/MediaShellCommand.java
index a20de3198d2c..bea71dc5cedb 100644
--- a/services/core/java/com/android/server/media/MediaShellCommand.java
+++ b/services/core/java/com/android/server/media/MediaShellCommand.java
@@ -16,6 +16,7 @@
package com.android.server.media;
+import android.annotation.NonNull;
import android.app.ActivityThread;
import android.content.Context;
import android.media.MediaMetadata;
@@ -247,7 +248,7 @@ public class MediaShellCommand extends ShellCommand {
}
@Override
- public void onAudioInfoChanged(MediaController.PlaybackInfo info) {
+ public void onAudioInfoChanged(@NonNull MediaController.PlaybackInfo info) {
mWriter.println("onAudioInfoChanged " + info);
}
}
diff --git a/services/core/java/com/android/server/notification/ZenModeHelper.java b/services/core/java/com/android/server/notification/ZenModeHelper.java
index b589f4972155..2fce295a564f 100644
--- a/services/core/java/com/android/server/notification/ZenModeHelper.java
+++ b/services/core/java/com/android/server/notification/ZenModeHelper.java
@@ -1446,6 +1446,7 @@ public class ZenModeHelper {
if (Flags.modesApi()) {
azr = new AutomaticZenRule.Builder(rule.name, rule.conditionId)
.setManualInvocationAllowed(rule.allowManualInvocation)
+ .setPackage(rule.pkg)
.setCreationTime(rule.creationTime)
.setIconResId(drawableResNameToResId(rule.pkg, rule.iconResName))
.setType(rule.type)
@@ -1464,8 +1465,8 @@ public class ZenModeHelper {
rule.conditionId, rule.zenPolicy,
NotificationManager.zenModeToInterruptionFilter(rule.zenMode),
rule.enabled, rule.creationTime);
+ azr.setPackageName(rule.pkg);
}
- azr.setPackageName(rule.pkg);
return azr;
}
diff --git a/services/core/java/com/android/server/ondeviceintelligence/OnDeviceIntelligenceManagerService.java b/services/core/java/com/android/server/ondeviceintelligence/OnDeviceIntelligenceManagerService.java
index b2e861cf2876..dd7603714718 100644
--- a/services/core/java/com/android/server/ondeviceintelligence/OnDeviceIntelligenceManagerService.java
+++ b/services/core/java/com/android/server/ondeviceintelligence/OnDeviceIntelligenceManagerService.java
@@ -16,6 +16,7 @@
package com.android.server.ondeviceintelligence;
+import static android.service.ondeviceintelligence.OnDeviceSandboxedInferenceService.DEVICE_CONFIG_UPDATE_BUNDLE_KEY;
import static android.service.ondeviceintelligence.OnDeviceSandboxedInferenceService.MODEL_LOADED_BUNDLE_KEY;
import static android.service.ondeviceintelligence.OnDeviceSandboxedInferenceService.MODEL_UNLOADED_BUNDLE_KEY;
import static android.service.ondeviceintelligence.OnDeviceSandboxedInferenceService.REGISTER_MODEL_UPDATE_CALLBACK_BUNDLE_KEY;
@@ -115,9 +116,10 @@ public class OnDeviceIntelligenceManagerService extends SystemService {
/** Handler message to {@link #resetTemporaryServices()} */
private static final int MSG_RESET_TEMPORARY_SERVICE = 0;
-
/** Handler message to clean up temporary broadcast keys. */
private static final int MSG_RESET_BROADCAST_KEYS = 1;
+ /** Handler message to clean up temporary config namespace. */
+ private static final int MSG_RESET_CONFIG_NAMESPACE = 2;
/** Default value in absence of {@link DeviceConfig} override. */
private static final boolean DEFAULT_SERVICE_ENABLED = true;
@@ -129,6 +131,7 @@ public class OnDeviceIntelligenceManagerService extends SystemService {
private final Executor resourceClosingExecutor = Executors.newCachedThreadPool();
private final Executor callbackExecutor = Executors.newCachedThreadPool();
private final Executor broadcastExecutor = Executors.newCachedThreadPool();
+ private final Executor mConfigExecutor = Executors.newCachedThreadPool();
private final Context mContext;
@@ -145,6 +148,12 @@ public class OnDeviceIntelligenceManagerService extends SystemService {
private String[] mTemporaryBroadcastKeys;
@GuardedBy("mLock")
private String mBroadcastPackageName;
+ @GuardedBy("mLock")
+ private String mTemporaryConfigNamespace;
+
+ private final DeviceConfig.OnPropertiesChangedListener mOnPropertiesChangedListener =
+ this::sendUpdatedConfig;
+
/**
* Handler used to reset the temporary service names.
@@ -593,12 +602,14 @@ public class OnDeviceIntelligenceManagerService extends SystemService {
@NonNull IOnDeviceSandboxedInferenceService service) {
try {
ensureRemoteIntelligenceServiceInitialized();
+ service.registerRemoteStorageService(
+ getIRemoteStorageService());
mRemoteOnDeviceIntelligenceService.run(
IOnDeviceIntelligenceService::notifyInferenceServiceConnected);
broadcastExecutor.execute(
() -> registerModelLoadingBroadcasts(service));
- service.registerRemoteStorageService(
- getIRemoteStorageService());
+ mConfigExecutor.execute(
+ () -> registerDeviceConfigChangeListener());
} catch (RemoteException ex) {
Slog.w(TAG, "Failed to send connected event", ex);
}
@@ -658,6 +669,56 @@ public class OnDeviceIntelligenceManagerService extends SystemService {
}
}
+ private void registerDeviceConfigChangeListener() {
+ Log.d(TAG, "registerDeviceConfigChangeListener");
+ String configNamespace = getConfigNamespace();
+ if (configNamespace.isEmpty()) {
+ Slog.e(TAG, "config_defaultOnDeviceIntelligenceDeviceConfigNamespace is empty");
+ return;
+ }
+ DeviceConfig.addOnPropertiesChangedListener(
+ configNamespace,
+ mConfigExecutor,
+ mOnPropertiesChangedListener);
+ }
+
+ private String getConfigNamespace() {
+ synchronized (mLock) {
+ if (mTemporaryConfigNamespace != null) {
+ return mTemporaryConfigNamespace;
+ }
+
+ return mContext.getResources().getString(
+ R.string.config_defaultOnDeviceIntelligenceDeviceConfigNamespace);
+ }
+ }
+
+ private void sendUpdatedConfig(
+ DeviceConfig.Properties props) {
+ Log.d(TAG, "sendUpdatedConfig");
+
+ PersistableBundle persistableBundle = new PersistableBundle();
+ for (String key : props.getKeyset()) {
+ persistableBundle.putString(key, props.getString(key, ""));
+ }
+ Bundle bundle = new Bundle();
+ bundle.putParcelable(DEVICE_CONFIG_UPDATE_BUNDLE_KEY, persistableBundle);
+ ensureRemoteInferenceServiceInitialized();
+ mRemoteInferenceService.run(service -> service.updateProcessingState(bundle,
+ new IProcessingUpdateStatusCallback.Stub() {
+ @Override
+ public void onSuccess(PersistableBundle result) {
+ Slog.d(TAG, "Config update successful." + result);
+ }
+
+ @Override
+ public void onFailure(int errorCode, String errorMessage) {
+ Slog.e(TAG, "Config update failed with code ["
+ + String.valueOf(errorCode) + "] and message = " + errorMessage);
+ }
+ }));
+ }
+
@NonNull
private IRemoteStorageService.Stub getIRemoteStorageService() {
return new IRemoteStorageService.Stub() {
@@ -849,8 +910,23 @@ public class OnDeviceIntelligenceManagerService extends SystemService {
}
@RequiresPermission(Manifest.permission.USE_ON_DEVICE_INTELLIGENCE)
+ public void setTemporaryDeviceConfigNamespace(@NonNull String configNamespace,
+ int durationMs) {
+ Objects.requireNonNull(configNamespace);
+ enforceShellOnly(Binder.getCallingUid(), "setTemporaryDeviceConfigNamespace");
+ mContext.enforceCallingPermission(
+ Manifest.permission.USE_ON_DEVICE_INTELLIGENCE, TAG);
+ synchronized (mLock) {
+ mTemporaryConfigNamespace = configNamespace;
+ if (durationMs != -1) {
+ getTemporaryHandler().sendEmptyMessageDelayed(MSG_RESET_CONFIG_NAMESPACE,
+ durationMs);
+ }
+ }
+ }
+
+ @RequiresPermission(Manifest.permission.USE_ON_DEVICE_INTELLIGENCE)
public void resetTemporaryServices() {
- enforceShellOnly(Binder.getCallingUid(), "resetTemporaryServices");
mContext.enforceCallingPermission(
Manifest.permission.USE_ON_DEVICE_INTELLIGENCE, TAG);
synchronized (mLock) {
@@ -937,17 +1013,17 @@ public class OnDeviceIntelligenceManagerService extends SystemService {
mTemporaryHandler = new Handler(Looper.getMainLooper(), null, true) {
@Override
public void handleMessage(Message msg) {
- if (msg.what == MSG_RESET_TEMPORARY_SERVICE) {
- synchronized (mLock) {
+ synchronized (mLock) {
+ if (msg.what == MSG_RESET_TEMPORARY_SERVICE) {
resetTemporaryServices();
- }
- } else if (msg.what == MSG_RESET_BROADCAST_KEYS) {
- synchronized (mLock) {
+ } else if (msg.what == MSG_RESET_BROADCAST_KEYS) {
mTemporaryBroadcastKeys = null;
mBroadcastPackageName = SYSTEM_PACKAGE;
+ } else if (msg.what == MSG_RESET_CONFIG_NAMESPACE) {
+ mTemporaryConfigNamespace = null;
+ } else {
+ Slog.wtf(TAG, "invalid handler msg: " + msg);
}
- } else {
- Slog.wtf(TAG, "invalid handler msg: " + msg);
}
}
};
diff --git a/services/core/java/com/android/server/ondeviceintelligence/OnDeviceIntelligenceShellCommand.java b/services/core/java/com/android/server/ondeviceintelligence/OnDeviceIntelligenceShellCommand.java
index 5744b5c3c2c4..d2c84fa1b18a 100644
--- a/services/core/java/com/android/server/ondeviceintelligence/OnDeviceIntelligenceShellCommand.java
+++ b/services/core/java/com/android/server/ondeviceintelligence/OnDeviceIntelligenceShellCommand.java
@@ -17,6 +17,7 @@
package com.android.server.ondeviceintelligence;
import android.annotation.NonNull;
+import android.os.Binder;
import android.os.ShellCommand;
import java.io.PrintWriter;
@@ -45,6 +46,8 @@ final class OnDeviceIntelligenceShellCommand extends ShellCommand {
return getConfiguredServices();
case "set-model-broadcasts":
return setBroadcastKeys();
+ case "set-deviceconfig-namespace":
+ return setDeviceConfigNamespace();
default:
return handleDefaultCommands(cmd);
}
@@ -69,6 +72,10 @@ final class OnDeviceIntelligenceShellCommand extends ShellCommand {
+ "[ReceiverPackageName] "
+ "[DURATION] To set the names of broadcast intent keys that are to be "
+ "emitted for cts tests.");
+ pw.println(
+ " set-deviceconfig-namespace [DeviceConfigNamespace] "
+ + "[DURATION] To set the device config namespace "
+ + "to use for cts tests.");
}
private int setTemporaryServices() {
@@ -78,6 +85,8 @@ final class OnDeviceIntelligenceShellCommand extends ShellCommand {
if (getRemainingArgsCount() == 0 && intelligenceServiceName == null
&& inferenceServiceName == null) {
+ OnDeviceIntelligenceManagerService.enforceShellOnly(Binder.getCallingUid(),
+ "resetTemporaryServices");
mService.resetTemporaryServices();
out.println("OnDeviceIntelligenceManagerService temporary reset. ");
return 0;
@@ -120,4 +129,16 @@ final class OnDeviceIntelligenceShellCommand extends ShellCommand {
return 0;
}
+ private int setDeviceConfigNamespace() {
+ final PrintWriter out = getOutPrintWriter();
+ final String configNamespace = getNextArg();
+
+ final int duration = Integer.parseInt(getNextArgRequired());
+ mService.setTemporaryDeviceConfigNamespace(configNamespace, duration);
+ out.println("OnDeviceIntelligence DeviceConfig Namespace temporarily set to "
+ + configNamespace
+ + " for " + duration + "ms");
+ return 0;
+ }
+
} \ No newline at end of file
diff --git a/services/core/java/com/android/server/os/BugreportManagerServiceImpl.java b/services/core/java/com/android/server/os/BugreportManagerServiceImpl.java
index 71a7d0d2a638..f07b7106c0d4 100644
--- a/services/core/java/com/android/server/os/BugreportManagerServiceImpl.java
+++ b/services/core/java/com/android/server/os/BugreportManagerServiceImpl.java
@@ -17,6 +17,7 @@
package com.android.server.os;
import static android.app.admin.flags.Flags.onboardingBugreportV2Enabled;
+import static android.app.admin.flags.Flags.onboardingConsentlessBugreports;
import android.Manifest;
import android.annotation.NonNull;
@@ -31,6 +32,7 @@ import android.content.pm.UserInfo;
import android.os.Binder;
import android.os.BugreportManager.BugreportCallback;
import android.os.BugreportParams;
+import android.os.Build;
import android.os.Environment;
import android.os.IDumpstate;
import android.os.IDumpstateListener;
@@ -69,12 +71,14 @@ import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
+import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.OptionalInt;
import java.util.Set;
+import java.util.concurrent.TimeUnit;
/**
* Implementation of the service that provides a privileged API to capture and consume bugreports.
@@ -98,6 +102,9 @@ class BugreportManagerServiceImpl extends IDumpstate.Stub {
private static final String BUGREPORT_SERVICE = "bugreportd";
private static final long DEFAULT_BUGREPORT_SERVICE_TIMEOUT_MILLIS = 30 * 1000;
+ private static final long DEFAULT_BUGREPORT_CONSENTLESS_GRACE_PERIOD_MILLIS =
+ TimeUnit.MINUTES.toMillis(2);
+
private final Object mLock = new Object();
private final Injector mInjector;
private final Context mContext;
@@ -132,6 +139,10 @@ class BugreportManagerServiceImpl extends IDumpstate.Stub {
private ArrayMap<Pair<Integer, String>, ArraySet<String>> mBugreportFiles =
new ArrayMap<>();
+ // Map of <CallerPackage, Pair<TimestampOfLastConsent, skipConsentForFullReport>>
+ @GuardedBy("mLock")
+ private Map<String, Pair<Long, Boolean>> mConsentGranted = new HashMap<>();
+
@VisibleForTesting(visibility = VisibleForTesting.Visibility.PRIVATE)
@GuardedBy("mLock")
final Set<String> mBugreportFilesToPersist = new HashSet<>();
@@ -238,6 +249,64 @@ class BugreportManagerServiceImpl extends IDumpstate.Stub {
}
}
+ /**
+ * Logs an entry with a timestamp of a consent being granted by the user to the calling
+ * {@code packageName}.
+ */
+ void logConsentGrantedForCaller(
+ String packageName, boolean consentGranted, boolean isDeferredReport) {
+ if (!onboardingConsentlessBugreports() || !Build.IS_DEBUGGABLE) {
+ return;
+ }
+ synchronized (mLock) {
+ // Adds an entry with the timestamp of the consent being granted by the user, and
+ // whether the consent can be skipped for a full bugreport, because a single
+ // consent can be used for multiple deferred reports but only one full report.
+ if (consentGranted) {
+ mConsentGranted.put(packageName, new Pair<>(
+ System.currentTimeMillis(),
+ isDeferredReport));
+ } else if (!isDeferredReport) {
+ if (!mConsentGranted.containsKey(packageName)) {
+ Slog.e(TAG, "Previous consent from package: " + packageName + " should"
+ + "have been logged.");
+ return;
+ }
+ mConsentGranted.put(packageName, new Pair<>(
+ mConsentGranted.get(packageName).first,
+ /* second = */ false
+ ));
+ }
+ }
+ }
+
+ /**
+ * Returns {@code true} if user consent be skippeb because a previous consens has been
+ * granted to the caller within the allowed time period.
+ */
+ boolean canSkipConsentScreen(String packageName, boolean isFullReport) {
+ if (!onboardingConsentlessBugreports() || !Build.IS_DEBUGGABLE) {
+ return false;
+ }
+ synchronized (mLock) {
+ if (!mConsentGranted.containsKey(packageName)) {
+ return false;
+ }
+ long currentTime = System.currentTimeMillis();
+ long consentGrantedTime = mConsentGranted.get(packageName).first;
+ if (consentGrantedTime + DEFAULT_BUGREPORT_CONSENTLESS_GRACE_PERIOD_MILLIS
+ < currentTime) {
+ mConsentGranted.remove(packageName);
+ return false;
+ }
+ boolean skipConsentForFullReport = mConsentGranted.get(packageName).second;
+ if (isFullReport && !skipConsentForFullReport) {
+ return false;
+ }
+ return true;
+ }
+ }
+
private void addBugreportMapping(Pair<Integer, String> caller, String bugreportFile) {
synchronized (mLock) {
if (!mBugreportFiles.containsKey(caller)) {
@@ -418,7 +487,7 @@ class BugreportManagerServiceImpl extends IDumpstate.Stub {
public void startBugreport(int callingUidUnused, String callingPackage,
FileDescriptor bugreportFd, FileDescriptor screenshotFd,
int bugreportMode, int bugreportFlags, IDumpstateListener listener,
- boolean isScreenshotRequested) {
+ boolean isScreenshotRequested, boolean skipUserConsentUnused) {
Objects.requireNonNull(callingPackage);
Objects.requireNonNull(bugreportFd);
Objects.requireNonNull(listener);
@@ -509,7 +578,8 @@ class BugreportManagerServiceImpl extends IDumpstate.Stub {
@RequiresPermission(value = Manifest.permission.DUMP, conditional = true)
public void retrieveBugreport(int callingUidUnused, String callingPackage, int userId,
FileDescriptor bugreportFd, String bugreportFile,
- boolean keepBugreportOnRetrievalUnused, IDumpstateListener listener) {
+ boolean keepBugreportOnRetrievalUnused, boolean skipUserConsentUnused,
+ IDumpstateListener listener) {
int callingUid = Binder.getCallingUid();
enforcePermission(callingPackage, callingUid, false);
@@ -540,9 +610,13 @@ class BugreportManagerServiceImpl extends IDumpstate.Stub {
return;
}
+ boolean skipUserConsent = mBugreportFileManager.canSkipConsentScreen(
+ callingPackage, /* isFullReport = */ false);
+
// Wrap the listener so we can intercept binder events directly.
DumpstateListener myListener = new DumpstateListener(listener, ds,
- new Pair<>(callingUid, callingPackage), /* reportFinishedFile= */ true);
+ new Pair<>(callingUid, callingPackage), /* reportFinishedFile= */ true,
+ !skipUserConsent, /* isDeferredReport = */ true);
boolean keepBugreportOnRetrieval = false;
if (onboardingBugreportV2Enabled()) {
@@ -553,7 +627,7 @@ class BugreportManagerServiceImpl extends IDumpstate.Stub {
setCurrentDumpstateListenerLocked(myListener);
try {
ds.retrieveBugreport(callingUid, callingPackage, userId, bugreportFd,
- bugreportFile, keepBugreportOnRetrieval, myListener);
+ bugreportFile, keepBugreportOnRetrieval, skipUserConsent, myListener);
} catch (RemoteException e) {
Slog.e(TAG, "RemoteException in retrieveBugreport", e);
}
@@ -754,7 +828,7 @@ class BugreportManagerServiceImpl extends IDumpstate.Stub {
}
}
- boolean reportFinishedFile =
+ boolean isDeferredConsentReport =
(bugreportFlags & BugreportParams.BUGREPORT_FLAG_DEFER_CONSENT) != 0;
boolean keepBugreportOnRetrieval =
@@ -766,14 +840,17 @@ class BugreportManagerServiceImpl extends IDumpstate.Stub {
reportError(listener, IDumpstateListener.BUGREPORT_ERROR_RUNTIME_ERROR);
return;
}
-
+ boolean skipUserConsent = mBugreportFileManager.canSkipConsentScreen(
+ callingPackage, !isDeferredConsentReport);
DumpstateListener myListener = new DumpstateListener(listener, ds,
- new Pair<>(callingUid, callingPackage), reportFinishedFile,
- keepBugreportOnRetrieval);
+ new Pair<>(callingUid, callingPackage),
+ /* reportFinishedFile = */ isDeferredConsentReport, keepBugreportOnRetrieval,
+ !isDeferredConsentReport && !skipUserConsent,
+ isDeferredConsentReport);
setCurrentDumpstateListenerLocked(myListener);
try {
ds.startBugreport(callingUid, callingPackage, bugreportFd, screenshotFd, bugreportMode,
- bugreportFlags, myListener, isScreenshotRequested);
+ bugreportFlags, myListener, isScreenshotRequested, skipUserConsent);
} catch (RemoteException e) {
// dumpstate service is already started now. We need to kill it to manage the
// lifecycle correctly. If we don't subsequent callers will get
@@ -930,14 +1007,21 @@ class BugreportManagerServiceImpl extends IDumpstate.Stub {
private boolean mDone;
private boolean mKeepBugreportOnRetrieval;
+ private boolean mConsentGranted;
+
+ private boolean mIsDeferredReport;
+
DumpstateListener(IDumpstateListener listener, IDumpstate ds,
- Pair<Integer, String> caller, boolean reportFinishedFile) {
- this(listener, ds, caller, reportFinishedFile, /* keepBugreportOnRetrieval= */ false);
+ Pair<Integer, String> caller, boolean reportFinishedFile,
+ boolean consentGranted, boolean isDeferredReport) {
+ this(listener, ds, caller, reportFinishedFile, /* keepBugreportOnRetrieval= */ false,
+ consentGranted, isDeferredReport);
}
DumpstateListener(IDumpstateListener listener, IDumpstate ds,
Pair<Integer, String> caller, boolean reportFinishedFile,
- boolean keepBugreportOnRetrieval) {
+ boolean keepBugreportOnRetrieval, boolean consentGranted,
+ boolean isDeferredReport) {
if (DEBUG) {
Slogf.d(TAG, "Starting DumpstateListener(id=%d) for caller %s", mId, caller);
}
@@ -946,6 +1030,8 @@ class BugreportManagerServiceImpl extends IDumpstate.Stub {
mCaller = caller;
mReportFinishedFile = reportFinishedFile;
mKeepBugreportOnRetrieval = keepBugreportOnRetrieval;
+ mConsentGranted = consentGranted;
+ mIsDeferredReport = isDeferredReport;
try {
mDs.asBinder().linkToDeath(this, 0);
} catch (RemoteException e) {
@@ -985,6 +1071,8 @@ class BugreportManagerServiceImpl extends IDumpstate.Stub {
} else if (DEBUG) {
Slog.d(TAG, "Not reporting finished file");
}
+ mBugreportFileManager.logConsentGrantedForCaller(
+ mCaller.second, mConsentGranted, mIsDeferredReport);
mListener.onFinished(bugreportFile);
}
diff --git a/services/core/java/com/android/server/pm/InstallPackageHelper.java b/services/core/java/com/android/server/pm/InstallPackageHelper.java
index 472f228b689f..6cfa09f9adf1 100644
--- a/services/core/java/com/android/server/pm/InstallPackageHelper.java
+++ b/services/core/java/com/android/server/pm/InstallPackageHelper.java
@@ -511,14 +511,13 @@ final class InstallPackageHelper {
// metadata file on the system image. Do not reset the path and source if this is the
// case.
if (pkgSetting.getAppMetadataFilePath() == null) {
- File dir = new File(pkg.getPath());
+ String dir = pkg.getPath();
if (pkgSetting.isSystem()) {
- dir = new File(Environment.getDataDirectory(),
- "app-metadata/" + pkg.getPackageName());
+ dir = Environment.getDataDirectoryPath() + "/app-metadata/" + pkg.getPackageName();
}
- File appMetadataFile = new File(dir, APP_METADATA_FILE_NAME);
- if (appMetadataFile.exists()) {
- pkgSetting.setAppMetadataFilePath(appMetadataFile.getAbsolutePath());
+ String appMetadataFilePath = dir + "/" + APP_METADATA_FILE_NAME;
+ if (request.hasAppMetadataFile()) {
+ pkgSetting.setAppMetadataFilePath(appMetadataFilePath);
if (Flags.aslInApkAppMetadataSource()) {
pkgSetting.setAppMetadataSource(APP_METADATA_SOURCE_INSTALLER);
}
@@ -526,7 +525,7 @@ final class InstallPackageHelper {
Map<String, PackageManager.Property> properties = pkg.getProperties();
if (properties.containsKey(PROPERTY_ANDROID_SAFETY_LABEL)) {
// ASL file extraction is done in post-install
- pkgSetting.setAppMetadataFilePath(appMetadataFile.getAbsolutePath());
+ pkgSetting.setAppMetadataFilePath(appMetadataFilePath);
pkgSetting.setAppMetadataSource(APP_METADATA_SOURCE_APK);
}
}
diff --git a/services/core/java/com/android/server/pm/InstallRequest.java b/services/core/java/com/android/server/pm/InstallRequest.java
index 6d385174a8a1..8f51e3696108 100644
--- a/services/core/java/com/android/server/pm/InstallRequest.java
+++ b/services/core/java/com/android/server/pm/InstallRequest.java
@@ -167,6 +167,8 @@ final class InstallRequest {
private int mInstallerUidForInstallExisting = INVALID_UID;
+ private final boolean mHasAppMetadataFileFromInstaller;
+
// New install
InstallRequest(InstallingSession params) {
mUserId = params.getUser().getIdentifier();
@@ -185,6 +187,7 @@ final class InstallRequest {
mSessionId = params.mSessionId;
mRequireUserAction = params.mRequireUserAction;
mPreVerifiedDomains = params.mPreVerifiedDomains;
+ mHasAppMetadataFileFromInstaller = params.mHasAppMetadataFile;
}
// Install existing package as user
@@ -203,6 +206,7 @@ final class InstallRequest {
mAppId = appId;
mInstallerUidForInstallExisting = installerUid;
mSystem = isSystem;
+ mHasAppMetadataFileFromInstaller = false;
}
// addForInit
@@ -224,6 +228,7 @@ final class InstallRequest {
mSessionId = -1;
mRequireUserAction = USER_ACTION_UNSPECIFIED;
mDisabledPs = disabledPs;
+ mHasAppMetadataFileFromInstaller = false;
}
@Nullable
@@ -371,6 +376,10 @@ final class InstallRequest {
return PackageInstallerSession.isArchivedInstallation(getInstallFlags());
}
+ public boolean hasAppMetadataFile() {
+ return mHasAppMetadataFileFromInstaller;
+ }
+
@Nullable
public String getRemovedPackage() {
return mRemovedInfo != null ? mRemovedInfo.mRemovedPackage : null;
diff --git a/services/core/java/com/android/server/pm/InstallingSession.java b/services/core/java/com/android/server/pm/InstallingSession.java
index 4cbd3ad45dc7..b06c7cb4ac33 100644
--- a/services/core/java/com/android/server/pm/InstallingSession.java
+++ b/services/core/java/com/android/server/pm/InstallingSession.java
@@ -101,6 +101,7 @@ class InstallingSession {
final boolean mApplicationEnabledSettingPersistent;
@Nullable
final DomainSet mPreVerifiedDomains;
+ final boolean mHasAppMetadataFile;
// For move install
InstallingSession(OriginInfo originInfo, MoveInfo moveInfo, IPackageInstallObserver2 observer,
@@ -134,12 +135,14 @@ class InstallingSession {
mRequireUserAction = USER_ACTION_UNSPECIFIED;
mApplicationEnabledSettingPersistent = false;
mPreVerifiedDomains = null;
+ mHasAppMetadataFile = false;
}
InstallingSession(int sessionId, File stagedDir, IPackageInstallObserver2 observer,
PackageInstaller.SessionParams sessionParams, InstallSource installSource,
UserHandle user, SigningDetails signingDetails, int installerUid,
- PackageLite packageLite, DomainSet preVerifiedDomains, PackageManagerService pm) {
+ PackageLite packageLite, DomainSet preVerifiedDomains, PackageManagerService pm,
+ boolean hasAppMetadatafile) {
mPm = pm;
mUser = user;
mOriginInfo = OriginInfo.fromStagedFile(stagedDir);
@@ -168,6 +171,7 @@ class InstallingSession {
mRequireUserAction = sessionParams.requireUserAction;
mApplicationEnabledSettingPersistent = sessionParams.applicationEnabledSettingPersistent;
mPreVerifiedDomains = preVerifiedDomains;
+ mHasAppMetadataFile = hasAppMetadatafile;
}
@Override
diff --git a/services/core/java/com/android/server/pm/PackageFreezer.java b/services/core/java/com/android/server/pm/PackageFreezer.java
index 7c5615771607..0afda4598bcb 100644
--- a/services/core/java/com/android/server/pm/PackageFreezer.java
+++ b/services/core/java/com/android/server/pm/PackageFreezer.java
@@ -18,6 +18,7 @@ package com.android.server.pm;
import android.annotation.NonNull;
import android.annotation.Nullable;
+import android.content.pm.Flags;
import android.content.pm.PackageManager;
import dalvik.system.CloseGuard;
@@ -76,8 +77,13 @@ final class PackageFreezer implements AutoCloseable {
ps = mPm.mSettings.getPackageLPr(mPackageName);
}
if (ps != null) {
- mPm.killApplication(ps.getPackageName(), ps.getAppId(), userId, killReason,
- exitInfoReason);
+ if (Flags.waitApplicationKilled()) {
+ mPm.killApplicationSync(ps.getPackageName(), ps.getAppId(), userId, killReason,
+ exitInfoReason);
+ } else {
+ mPm.killApplication(ps.getPackageName(), ps.getAppId(), userId, killReason,
+ exitInfoReason);
+ }
}
mCloseGuard.open("close");
}
diff --git a/services/core/java/com/android/server/pm/PackageInstallerSession.java b/services/core/java/com/android/server/pm/PackageInstallerSession.java
index 80a5f3a4c579..57f6d2789dc5 100644
--- a/services/core/java/com/android/server/pm/PackageInstallerSession.java
+++ b/services/core/java/com/android/server/pm/PackageInstallerSession.java
@@ -601,6 +601,9 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub {
@GuardedBy("mLock")
private String mSessionErrorMessage;
+ @GuardedBy("mLock")
+ private boolean mHasAppMetadataFile = false;
+
@Nullable
final StagedSession mStagedSession;
@@ -1814,7 +1817,7 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub {
assertCallerIsOwnerOrRoot();
synchronized (mLock) {
assertPreparedAndNotCommittedOrDestroyedLocked("getAppMetadataFd");
- if (!getStagedAppMetadataFile().exists()) {
+ if (!mHasAppMetadataFile) {
return null;
}
try {
@@ -1827,9 +1830,11 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub {
@Override
public void removeAppMetadata() {
- File file = getStagedAppMetadataFile();
- if (file.exists()) {
- file.delete();
+ synchronized (mLock) {
+ if (mHasAppMetadataFile) {
+ getStagedAppMetadataFile().delete();
+ mHasAppMetadataFile = false;
+ }
}
}
@@ -1850,8 +1855,12 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub {
assertPreparedAndNotSealedLocked("openWriteAppMetadata");
}
try {
- return doWriteInternal(APP_METADATA_FILE_NAME, /* offsetBytes= */ 0,
+ ParcelFileDescriptor fd = doWriteInternal(APP_METADATA_FILE_NAME, /* offsetBytes= */ 0,
/* lengthBytes= */ -1, null);
+ synchronized (mLock) {
+ mHasAppMetadataFile = true;
+ }
+ return fd;
} catch (IOException e) {
throw ExceptionUtils.wrap(e);
}
@@ -2145,18 +2154,21 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub {
}
}
- File appMetadataFile = getStagedAppMetadataFile();
- if (appMetadataFile.exists()) {
- long sizeLimit = getAppMetadataSizeLimit();
- if (appMetadataFile.length() > sizeLimit) {
- appMetadataFile.delete();
- throw new IllegalArgumentException(
- "App metadata size exceeds the maximum allowed limit of " + sizeLimit);
- }
- if (isIncrementalInstallation()) {
- // Incremental requires stageDir to be empty so move the app metadata file to a
- // temporary location and move back after commit.
- appMetadataFile.renameTo(getTmpAppMetadataFile());
+ synchronized (mLock) {
+ if (mHasAppMetadataFile) {
+ File appMetadataFile = getStagedAppMetadataFile();
+ long sizeLimit = getAppMetadataSizeLimit();
+ if (appMetadataFile.length() > sizeLimit) {
+ appMetadataFile.delete();
+ mHasAppMetadataFile = false;
+ throw new IllegalArgumentException(
+ "App metadata size exceeds the maximum allowed limit of " + sizeLimit);
+ }
+ if (isIncrementalInstallation()) {
+ // Incremental requires stageDir to be empty so move the app metadata file to a
+ // temporary location and move back after commit.
+ appMetadataFile.renameTo(getTmpAppMetadataFile());
+ }
}
}
@@ -3207,7 +3219,8 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub {
synchronized (mLock) {
return new InstallingSession(sessionId, stageDir, localObserver, params, mInstallSource,
- user, mSigningDetails, mInstallerUid, mPackageLite, mPreVerifiedDomains, mPm);
+ user, mSigningDetails, mInstallerUid, mPackageLite, mPreVerifiedDomains, mPm,
+ mHasAppMetadataFile);
}
}
@@ -3445,9 +3458,14 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub {
}
}
+ if (mHasAppMetadataFile && !getStagedAppMetadataFile().exists()) {
+ throw new PackageManagerException(INSTALL_FAILED_VERIFICATION_FAILURE,
+ "App metadata file expected but not found in " + stageDir.getAbsolutePath());
+ }
+
final List<ApkLite> addedFiles = getAddedApkLitesLocked();
if (addedFiles.isEmpty()
- && (removeSplitList.size() == 0 || getStagedAppMetadataFile().exists())) {
+ && (removeSplitList.size() == 0 || mHasAppMetadataFile)) {
throw new PackageManagerException(INSTALL_FAILED_INVALID_APK,
TextUtils.formatSimple("Session: %d. No packages staged in %s", sessionId,
stageDir.getAbsolutePath()));
diff --git a/services/core/java/com/android/server/pm/PackageManagerService.java b/services/core/java/com/android/server/pm/PackageManagerService.java
index fda8535913d5..f8fceda0582c 100644
--- a/services/core/java/com/android/server/pm/PackageManagerService.java
+++ b/services/core/java/com/android/server/pm/PackageManagerService.java
@@ -53,6 +53,7 @@ import android.annotation.StringRes;
import android.annotation.UserIdInt;
import android.annotation.WorkerThread;
import android.app.ActivityManager;
+import android.app.ActivityManagerInternal;
import android.app.AppOpsManager;
import android.app.ApplicationExitInfo;
import android.app.ApplicationPackageManager;
@@ -3132,6 +3133,20 @@ public class PackageManagerService implements PackageSender, TestUtilityService
}
}
+ void killApplicationSync(String pkgName, @AppIdInt int appId,
+ @UserIdInt int userId, String reason, int exitInfoReason) {
+ ActivityManagerInternal mAmi = LocalServices.getService(ActivityManagerInternal.class);
+ if (mAmi != null) {
+ if (Thread.holdsLock(mLock)) {
+ // holds PM's lock, go back killApplication to avoid it run into watchdog reset.
+ Slog.e(TAG, "Holds PM's locker, unable kill application synchronized");
+ killApplication(pkgName, appId, userId, reason, exitInfoReason);
+ } else {
+ mAmi.killApplicationSync(pkgName, appId, userId, reason, exitInfoReason);
+ }
+ }
+ }
+
@Override
public void notifyPackageAdded(String packageName, int uid) {
mPackageObserverHelper.notifyAdded(packageName, uid);
diff --git a/services/core/java/com/android/server/pm/PackageManagerServiceUtils.java b/services/core/java/com/android/server/pm/PackageManagerServiceUtils.java
index 23ae98325cb9..6700f00a8856 100644
--- a/services/core/java/com/android/server/pm/PackageManagerServiceUtils.java
+++ b/services/core/java/com/android/server/pm/PackageManagerServiceUtils.java
@@ -1252,7 +1252,7 @@ public class PackageManagerServiceUtils {
}
final ParsedMainComponent comp = componentInfoToComponent(
resolveInfo.getComponentInfo(), resolver, isReceiver);
- if (!comp.getIntents().isEmpty() && intent.getAction() == null) {
+ if (comp != null && !comp.getIntents().isEmpty() && intent.getAction() == null) {
match = false;
}
} else if (c instanceof IntentFilter) {
diff --git a/services/core/java/com/android/server/power/Notifier.java b/services/core/java/com/android/server/power/Notifier.java
index 5fa8856f2940..11b9e776204c 100644
--- a/services/core/java/com/android/server/power/Notifier.java
+++ b/services/core/java/com/android/server/power/Notifier.java
@@ -64,6 +64,7 @@ import com.android.server.LocalServices;
import com.android.server.input.InputManagerInternal;
import com.android.server.inputmethod.InputMethodManagerInternal;
import com.android.server.policy.WindowManagerPolicy;
+import com.android.server.power.feature.PowerManagerFlags;
import com.android.server.statusbar.StatusBarManagerInternal;
import java.io.PrintWriter;
@@ -187,11 +188,16 @@ public class Notifier {
private final AtomicBoolean mIsPlayingChargingStartedFeedback = new AtomicBoolean(false);
+ private final Injector mInjector;
+
+ private final PowerManagerFlags mFlags;
+
public Notifier(Looper looper, Context context, IBatteryStats batteryStats,
SuspendBlocker suspendBlocker, WindowManagerPolicy policy,
FaceDownDetector faceDownDetector, ScreenUndimDetector screenUndimDetector,
- Executor backgroundExecutor) {
+ Executor backgroundExecutor, PowerManagerFlags powerManagerFlags, Injector injector) {
mContext = context;
+ mFlags = powerManagerFlags;
mBatteryStats = batteryStats;
mAppOps = mContext.getSystemService(AppOpsManager.class);
mSuspendBlocker = suspendBlocker;
@@ -224,8 +230,8 @@ public class Notifier {
mShowWirelessChargingAnimationConfig = context.getResources().getBoolean(
com.android.internal.R.bool.config_showBuiltinWirelessChargingAnim);
- mWakeLockLog = new WakeLockLog(context);
-
+ mInjector = (injector == null) ? new RealInjector() : injector;
+ mWakeLockLog = mInjector.getWakeLockLog(context);
// Initialize interactive state for battery stats.
try {
mBatteryStats.noteInteractive(true);
@@ -267,7 +273,7 @@ public class Notifier {
+ ", ownerUid=" + ownerUid + ", ownerPid=" + ownerPid
+ ", workSource=" + workSource);
}
- notifyWakeLockListener(callback, tag, true);
+ notifyWakeLockListener(callback, tag, true, ownerUid, flags);
final int monitorType = getBatteryStatsWakeLockMonitorType(flags);
if (monitorType >= 0) {
try {
@@ -287,8 +293,9 @@ public class Notifier {
}
}
- mWakeLockLog.onWakeLockAcquired(tag, ownerUid, flags);
-
+ if (!mFlags.improveWakelockLatency()) {
+ mWakeLockLog.onWakeLockAcquired(tag, ownerUid, flags, /*eventTime=*/ -1);
+ }
mWakefulnessSessionObserver.onWakeLockAcquired(flags);
}
@@ -406,7 +413,7 @@ public class Notifier {
+ ", ownerUid=" + ownerUid + ", ownerPid=" + ownerPid
+ ", workSource=" + workSource);
}
- notifyWakeLockListener(callback, tag, false);
+ notifyWakeLockListener(callback, tag, false, ownerUid, flags);
final int monitorType = getBatteryStatsWakeLockMonitorType(flags);
if (monitorType >= 0) {
try {
@@ -422,8 +429,9 @@ public class Notifier {
// Ignore
}
}
- mWakeLockLog.onWakeLockReleased(tag, ownerUid);
-
+ if (!mFlags.improveWakelockLatency()) {
+ mWakeLockLog.onWakeLockReleased(tag, ownerUid, /*eventTime=*/ -1);
+ }
mWakefulnessSessionObserver.onWakeLockReleased(flags, releaseReason);
}
@@ -1040,10 +1048,19 @@ public class Notifier {
return enabled && dndOff;
}
- private void notifyWakeLockListener(IWakeLockCallback callback, String tag, boolean isEnabled) {
+ private void notifyWakeLockListener(IWakeLockCallback callback, String tag, boolean isEnabled,
+ int ownerUid, int flags) {
if (callback != null) {
+ long currentTime = mInjector.currentTimeMillis();
mHandler.post(() -> {
try {
+ if (mFlags.improveWakelockLatency()) {
+ if (isEnabled) {
+ mWakeLockLog.onWakeLockAcquired(tag, ownerUid, flags, currentTime);
+ } else {
+ mWakeLockLog.onWakeLockReleased(tag, ownerUid, currentTime);
+ }
+ }
callback.onStateChanged(isEnabled);
} catch (RemoteException e) {
Slog.e(TAG, "Wakelock.mCallback [" + tag + "] is already dead.", e);
@@ -1057,6 +1074,7 @@ public class Notifier {
public NotifierHandler(Looper looper) {
super(looper, null, true /*async*/);
}
+
@Override
public void handleMessage(Message msg) {
switch (msg.what) {
@@ -1085,4 +1103,28 @@ public class Notifier {
}
}
}
+
+ public interface Injector {
+ /**
+ * Gets the current time in millis
+ */
+ long currentTimeMillis();
+
+ /**
+ * Gets the WakeLockLog object
+ */
+ WakeLockLog getWakeLockLog(Context context);
+ }
+
+ static class RealInjector implements Injector {
+ @Override
+ public long currentTimeMillis() {
+ return System.currentTimeMillis();
+ }
+
+ @Override
+ public WakeLockLog getWakeLockLog(Context context) {
+ return new WakeLockLog(context);
+ }
+ }
}
diff --git a/services/core/java/com/android/server/power/PowerManagerService.java b/services/core/java/com/android/server/power/PowerManagerService.java
index 76cedd8e5e60..ce0120c245d6 100644
--- a/services/core/java/com/android/server/power/PowerManagerService.java
+++ b/services/core/java/com/android/server/power/PowerManagerService.java
@@ -988,10 +988,10 @@ public final class PowerManagerService extends SystemService
Notifier createNotifier(Looper looper, Context context, IBatteryStats batteryStats,
SuspendBlocker suspendBlocker, WindowManagerPolicy policy,
FaceDownDetector faceDownDetector, ScreenUndimDetector screenUndimDetector,
- Executor backgroundExecutor) {
+ Executor backgroundExecutor, PowerManagerFlags powerManagerFlags) {
return new Notifier(
looper, context, batteryStats, suspendBlocker, policy, faceDownDetector,
- screenUndimDetector, backgroundExecutor);
+ screenUndimDetector, backgroundExecutor, powerManagerFlags, /*injector=*/ null);
}
SuspendBlocker createSuspendBlocker(PowerManagerService service, String name) {
@@ -1373,7 +1373,7 @@ public final class PowerManagerService extends SystemService
mNotifier = mInjector.createNotifier(Looper.getMainLooper(), mContext, mBatteryStats,
mInjector.createSuspendBlocker(this, "PowerManagerService.Broadcasts"),
mPolicy, mFaceDownDetector, mScreenUndimDetector,
- BackgroundThread.getExecutor());
+ BackgroundThread.getExecutor(), mFeatureFlags);
mPowerGroups.append(Display.DEFAULT_DISPLAY_GROUP,
new PowerGroup(WAKEFULNESS_AWAKE, mPowerGroupWakefulnessChangeListener,
diff --git a/services/core/java/com/android/server/power/WakeLockLog.java b/services/core/java/com/android/server/power/WakeLockLog.java
index b131311f76c7..968ff59ad8fc 100644
--- a/services/core/java/com/android/server/power/WakeLockLog.java
+++ b/services/core/java/com/android/server/power/WakeLockLog.java
@@ -154,9 +154,10 @@ final class WakeLockLog {
* @param tag The wake lock tag
* @param ownerUid The owner UID of the wake lock.
* @param flags Flags used for the wake lock.
+ * @param eventTime The time at which the event occurred
*/
- public void onWakeLockAcquired(String tag, int ownerUid, int flags) {
- onWakeLockEvent(TYPE_ACQUIRE, tag, ownerUid, flags);
+ public void onWakeLockAcquired(String tag, int ownerUid, int flags, long eventTime) {
+ onWakeLockEvent(TYPE_ACQUIRE, tag, ownerUid, flags, eventTime);
}
/**
@@ -164,9 +165,10 @@ final class WakeLockLog {
*
* @param tag The wake lock tag
* @param ownerUid The owner UID of the wake lock.
+ * @param eventTime The time at which the event occurred
*/
- public void onWakeLockReleased(String tag, int ownerUid) {
- onWakeLockEvent(TYPE_RELEASE, tag, ownerUid, 0 /* flags */);
+ public void onWakeLockReleased(String tag, int ownerUid, long eventTime) {
+ onWakeLockEvent(TYPE_RELEASE, tag, ownerUid, 0 /* flags */, eventTime);
}
/**
@@ -242,9 +244,10 @@ final class WakeLockLog {
* @param tag The wake lock's identifying tag.
* @param ownerUid The owner UID of the wake lock.
* @param flags The flags used with the wake lock.
+ * @param eventTime The time at which the event occurred
*/
private void onWakeLockEvent(int eventType, String tag, int ownerUid,
- int flags) {
+ int flags, long eventTime) {
if (tag == null) {
Slog.w(TAG, "Insufficient data to log wakelock [tag: " + tag
+ ", ownerUid: " + ownerUid
@@ -252,7 +255,8 @@ final class WakeLockLog {
return;
}
- final long time = mInjector.currentTimeMillis();
+ final long time = (eventTime == -1) ? mInjector.currentTimeMillis() : eventTime;
+
final int translatedFlags = eventType == TYPE_ACQUIRE
? translateFlagsFromPowerManager(flags)
: 0;
diff --git a/services/core/java/com/android/server/power/feature/PowerManagerFlags.java b/services/core/java/com/android/server/power/feature/PowerManagerFlags.java
index a5a7069b6ea1..ff1d2e402350 100644
--- a/services/core/java/com/android/server/power/feature/PowerManagerFlags.java
+++ b/services/core/java/com/android/server/power/feature/PowerManagerFlags.java
@@ -35,18 +35,31 @@ public class PowerManagerFlags {
Flags.FLAG_ENABLE_EARLY_SCREEN_TIMEOUT_DETECTOR,
Flags::enableEarlyScreenTimeoutDetector);
+ private final FlagState mImproveWakelockLatency = new FlagState(
+ Flags.FLAG_IMPROVE_WAKELOCK_LATENCY,
+ Flags::improveWakelockLatency
+ );
+
/** Returns whether early-screen-timeout-detector is enabled on not. */
public boolean isEarlyScreenTimeoutDetectorEnabled() {
return mEarlyScreenTimeoutDetectorFlagState.isEnabled();
}
/**
+ * @return Whether to improve the wakelock acquire/release latency or not
+ */
+ public boolean improveWakelockLatency() {
+ return mImproveWakelockLatency.isEnabled();
+ }
+
+ /**
* dumps all flagstates
* @param pw printWriter
*/
public void dump(PrintWriter pw) {
pw.println("PowerManagerFlags:");
pw.println(" " + mEarlyScreenTimeoutDetectorFlagState);
+ pw.println(" " + mImproveWakelockLatency);
}
private static class FlagState {
diff --git a/services/core/java/com/android/server/power/feature/power_flags.aconfig b/services/core/java/com/android/server/power/feature/power_flags.aconfig
index ca58153cf25b..3581b2fad1df 100644
--- a/services/core/java/com/android/server/power/feature/power_flags.aconfig
+++ b/services/core/java/com/android/server/power/feature/power_flags.aconfig
@@ -10,3 +10,11 @@ flag {
bug: "309861917"
is_fixed_read_only: true
}
+
+flag {
+ name: "improve_wakelock_latency"
+ namespace: "power"
+ description: "Feature flag for tracking the optimizations to improve the latency of acquiring and releasing a wakelock."
+ bug: "339590565"
+ is_fixed_read_only: true
+} \ No newline at end of file
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 cb10da9787df..2f1641980784 100644
--- a/services/core/java/com/android/server/power/stats/BatteryExternalStatsWorker.java
+++ b/services/core/java/com/android/server/power/stats/BatteryExternalStatsWorker.java
@@ -572,34 +572,41 @@ public class BatteryExternalStatsWorker implements BatteryStatsImpl.ExternalStat
}
if ((updateFlags & BatteryStatsImpl.ExternalStatsSync.UPDATE_BT) != 0) {
- // We were asked to fetch Bluetooth data.
- final BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter();
- if (adapter != null) {
- SynchronousResultReceiver resultReceiver =
- new SynchronousResultReceiver("bluetooth");
- adapter.requestControllerActivityEnergyInfo(
- Runnable::run,
- new BluetoothAdapter.OnBluetoothActivityEnergyInfoCallback() {
- @Override
- public void onBluetoothActivityEnergyInfoAvailable(
- BluetoothActivityEnergyInfo info) {
- Bundle bundle = new Bundle();
- bundle.putParcelable(
- BatteryStats.RESULT_RECEIVER_CONTROLLER_KEY, info);
- resultReceiver.send(0, bundle);
- }
+ @SuppressWarnings("GuardedBy")
+ PowerStatsCollector collector = mStats.getPowerStatsCollector(
+ BatteryConsumer.POWER_COMPONENT_BLUETOOTH);
+ if (collector.isEnabled()) {
+ collector.schedule();
+ } else {
+ // We were asked to fetch Bluetooth data.
+ final BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter();
+ if (adapter != null) {
+ SynchronousResultReceiver resultReceiver =
+ new SynchronousResultReceiver("bluetooth");
+ adapter.requestControllerActivityEnergyInfo(
+ Runnable::run,
+ new BluetoothAdapter.OnBluetoothActivityEnergyInfoCallback() {
+ @Override
+ public void onBluetoothActivityEnergyInfoAvailable(
+ BluetoothActivityEnergyInfo info) {
+ Bundle bundle = new Bundle();
+ bundle.putParcelable(
+ BatteryStats.RESULT_RECEIVER_CONTROLLER_KEY, info);
+ resultReceiver.send(0, bundle);
+ }
- @Override
- public void onBluetoothActivityEnergyInfoError(int errorCode) {
- Slog.w(TAG, "error reading Bluetooth stats: " + errorCode);
- Bundle bundle = new Bundle();
- bundle.putParcelable(
- BatteryStats.RESULT_RECEIVER_CONTROLLER_KEY, null);
- resultReceiver.send(0, bundle);
+ @Override
+ public void onBluetoothActivityEnergyInfoError(int errorCode) {
+ Slog.w(TAG, "error reading Bluetooth stats: " + errorCode);
+ Bundle bundle = new Bundle();
+ bundle.putParcelable(
+ BatteryStats.RESULT_RECEIVER_CONTROLLER_KEY, null);
+ resultReceiver.send(0, bundle);
+ }
}
- }
- );
- bluetoothReceiver = resultReceiver;
+ );
+ bluetoothReceiver = resultReceiver;
+ }
}
}
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 9a4155122402..1b6af7170756 100644
--- a/services/core/java/com/android/server/power/stats/BatteryStatsImpl.java
+++ b/services/core/java/com/android/server/power/stats/BatteryStatsImpl.java
@@ -32,6 +32,8 @@ import android.app.ActivityManager;
import android.app.AlarmManager;
import android.app.usage.NetworkStatsManager;
import android.bluetooth.BluetoothActivityEnergyInfo;
+import android.bluetooth.BluetoothAdapter;
+import android.bluetooth.BluetoothManager;
import android.bluetooth.UidTraffic;
import android.content.BroadcastReceiver;
import android.content.ContentResolver;
@@ -172,6 +174,7 @@ import java.util.LinkedList;
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;
@@ -294,6 +297,7 @@ public class BatteryStatsImpl extends BatteryStats {
private final CpuPowerStatsCollector mCpuPowerStatsCollector;
private final MobileRadioPowerStatsCollector mMobileRadioPowerStatsCollector;
private final WifiPowerStatsCollector mWifiPowerStatsCollector;
+ private final BluetoothPowerStatsCollector mBluetoothPowerStatsCollector;
private final SparseBooleanArray mPowerStatsCollectorEnabled = new SparseBooleanArray();
private final WifiPowerStatsCollector.WifiStatsRetriever mWifiStatsRetriever =
new WifiPowerStatsCollector.WifiStatsRetriever() {
@@ -313,6 +317,38 @@ public class BatteryStatsImpl extends BatteryStats {
}
};
+ private class BluetoothStatsRetrieverImpl implements
+ BluetoothPowerStatsCollector.BluetoothStatsRetriever {
+ private final BluetoothManager mBluetoothManager;
+
+ BluetoothStatsRetrieverImpl(BluetoothManager bluetoothManager) {
+ mBluetoothManager = bluetoothManager;
+ }
+
+ @Override
+ public void retrieveBluetoothScanTimes(Callback callback) {
+ synchronized (BatteryStatsImpl.this) {
+ retrieveBluetoothScanTimesLocked(callback);
+ }
+ }
+
+ @Override
+ public boolean requestControllerActivityEnergyInfo(Executor executor,
+ BluetoothAdapter.OnBluetoothActivityEnergyInfoCallback callback) {
+ if (mBluetoothManager == null) {
+ return false;
+ }
+
+ BluetoothAdapter adapter = mBluetoothManager.getAdapter();
+ if (adapter == null) {
+ return false;
+ }
+
+ adapter.requestControllerActivityEnergyInfo(executor, callback);
+ return true;
+ }
+ }
+
public LongSparseArray<SamplingTimer> getKernelMemoryStats() {
return mKernelMemoryStats;
}
@@ -1926,12 +1962,14 @@ public class BatteryStatsImpl extends BatteryStats {
}
private class PowerStatsCollectorInjector implements CpuPowerStatsCollector.Injector,
- MobileRadioPowerStatsCollector.Injector, WifiPowerStatsCollector.Injector {
+ MobileRadioPowerStatsCollector.Injector, WifiPowerStatsCollector.Injector,
+ BluetoothPowerStatsCollector.Injector {
private PackageManager mPackageManager;
private PowerStatsCollector.ConsumedEnergyRetriever mConsumedEnergyRetriever;
private NetworkStatsManager mNetworkStatsManager;
private TelephonyManager mTelephonyManager;
private WifiManager mWifiManager;
+ private BluetoothPowerStatsCollector.BluetoothStatsRetriever mBluetoothStatsRetriever;
void setContext(Context context) {
mPackageManager = context.getPackageManager();
@@ -1940,6 +1978,8 @@ public class BatteryStatsImpl extends BatteryStats {
mNetworkStatsManager = context.getSystemService(NetworkStatsManager.class);
mTelephonyManager = context.getSystemService(TelephonyManager.class);
mWifiManager = context.getSystemService(WifiManager.class);
+ mBluetoothStatsRetriever = new BluetoothStatsRetrieverImpl(
+ context.getSystemService(BluetoothManager.class));
}
@Override
@@ -2018,6 +2058,11 @@ public class BatteryStatsImpl extends BatteryStats {
}
@Override
+ public BluetoothPowerStatsCollector.BluetoothStatsRetriever getBluetoothStatsRetriever() {
+ return mBluetoothStatsRetriever;
+ }
+
+ @Override
public LongSupplier getCallDurationSupplier() {
return () -> mPhoneOnTimer.getTotalTimeLocked(mClock.elapsedRealtime() * 1000,
STATS_SINCE_CHARGED);
@@ -6774,6 +6819,24 @@ public class BatteryStatsImpl extends BatteryStats {
}
}
+ private void retrieveBluetoothScanTimesLocked(
+ BluetoothPowerStatsCollector.BluetoothStatsRetriever.Callback callback) {
+ long elapsedTimeUs = mClock.elapsedRealtime() * 1000;
+ for (int i = mUidStats.size() - 1; i >= 0; i--) {
+ Uid uidStats = mUidStats.valueAt(i);
+ if (uidStats.mBluetoothScanTimer == null) {
+ continue;
+ }
+
+ long scanTimeUs = mBluetoothScanTimer.getTotalTimeLocked(elapsedTimeUs,
+ STATS_SINCE_CHARGED);
+ if (scanTimeUs != 0) {
+ int uid = mUidStats.keyAt(i);
+ callback.onBluetoothScanTime(uid, (scanTimeUs + 500) / 1000);
+ }
+ }
+ }
+
@GuardedBy("this")
private void noteWifiRadioApWakeupLocked(final long elapsedRealtimeMillis,
final long uptimeMillis, int uid) {
@@ -11202,6 +11265,10 @@ public class BatteryStatsImpl extends BatteryStats {
mWifiPowerStatsCollector = new WifiPowerStatsCollector(mPowerStatsCollectorInjector);
mWifiPowerStatsCollector.addConsumer(this::recordPowerStats);
+ mBluetoothPowerStatsCollector = new BluetoothPowerStatsCollector(
+ mPowerStatsCollectorInjector);
+ mBluetoothPowerStatsCollector.addConsumer(this::recordPowerStats);
+
mStartCount++;
initTimersAndCounters();
mOnBattery = mOnBatteryInternal = false;
@@ -13146,6 +13213,10 @@ public class BatteryStatsImpl extends BatteryStats {
@GuardedBy("this")
public void updateBluetoothStateLocked(@Nullable final BluetoothActivityEnergyInfo info,
final long consumedChargeUC, long elapsedRealtimeMs, long uptimeMs) {
+ if (mBluetoothPowerStatsCollector.isEnabled()) {
+ return;
+ }
+
if (DEBUG_ENERGY) {
Slog.d(TAG, "Updating bluetooth stats: " + info);
}
@@ -13153,6 +13224,7 @@ public class BatteryStatsImpl extends BatteryStats {
if (info == null) {
return;
}
+
if (!mOnBatteryInternal || mIgnoreNextExternalStats) {
mLastBluetoothActivityInfo.set(info);
return;
@@ -13187,7 +13259,6 @@ public class BatteryStatsImpl extends BatteryStats {
(mGlobalEnergyConsumerStats != null
&& mBluetoothPowerCalculator != null && consumedChargeUC > 0) ?
new SparseDoubleArray() : null;
-
long totalScanTimeMs = 0;
final int uidCount = mUidStats.size();
@@ -14616,6 +14687,10 @@ public class BatteryStatsImpl extends BatteryStats {
mPowerStatsCollectorEnabled.get(BatteryConsumer.POWER_COMPONENT_WIFI));
mWifiPowerStatsCollector.schedule();
+ mBluetoothPowerStatsCollector.setEnabled(
+ mPowerStatsCollectorEnabled.get(BatteryConsumer.POWER_COMPONENT_BLUETOOTH));
+ mBluetoothPowerStatsCollector.schedule();
+
mSystemReady = true;
}
@@ -14632,6 +14707,8 @@ public class BatteryStatsImpl extends BatteryStats {
return mMobileRadioPowerStatsCollector;
case BatteryConsumer.POWER_COMPONENT_WIFI:
return mWifiPowerStatsCollector;
+ case BatteryConsumer.POWER_COMPONENT_BLUETOOTH:
+ return mBluetoothPowerStatsCollector;
}
return null;
}
@@ -16168,6 +16245,7 @@ public class BatteryStatsImpl extends BatteryStats {
mCpuPowerStatsCollector.forceSchedule();
mMobileRadioPowerStatsCollector.forceSchedule();
mWifiPowerStatsCollector.forceSchedule();
+ mBluetoothPowerStatsCollector.forceSchedule();
}
/**
@@ -16187,6 +16265,7 @@ public class BatteryStatsImpl extends BatteryStats {
mCpuPowerStatsCollector.collectAndDump(pw);
mMobileRadioPowerStatsCollector.collectAndDump(pw);
mWifiPowerStatsCollector.collectAndDump(pw);
+ mBluetoothPowerStatsCollector.collectAndDump(pw);
}
private final Runnable mWriteAsyncRunnable = () -> {
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 0d5eabc5ed47..b25239574071 100644
--- a/services/core/java/com/android/server/power/stats/BatteryUsageStatsProvider.java
+++ b/services/core/java/com/android/server/power/stats/BatteryUsageStatsProvider.java
@@ -90,7 +90,9 @@ public class BatteryUsageStatsProvider {
if (!mPowerStatsExporterEnabled.get(BatteryConsumer.POWER_COMPONENT_WIFI)) {
mPowerCalculators.add(new WifiPowerCalculator(mPowerProfile));
}
- mPowerCalculators.add(new BluetoothPowerCalculator(mPowerProfile));
+ if (!mPowerStatsExporterEnabled.get(BatteryConsumer.POWER_COMPONENT_BLUETOOTH)) {
+ mPowerCalculators.add(new BluetoothPowerCalculator(mPowerProfile));
+ }
mPowerCalculators.add(new SensorPowerCalculator(
mContext.getSystemService(SensorManager.class)));
mPowerCalculators.add(new GnssPowerCalculator(mPowerProfile));
diff --git a/services/core/java/com/android/server/power/stats/BluetoothPowerStatsCollector.java b/services/core/java/com/android/server/power/stats/BluetoothPowerStatsCollector.java
new file mode 100644
index 000000000000..8a5085b0b34b
--- /dev/null
+++ b/services/core/java/com/android/server/power/stats/BluetoothPowerStatsCollector.java
@@ -0,0 +1,332 @@
+/*
+ * 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.power.stats;
+
+import android.bluetooth.BluetoothActivityEnergyInfo;
+import android.bluetooth.BluetoothAdapter;
+import android.bluetooth.UidTraffic;
+import android.content.pm.PackageManager;
+import android.hardware.power.stats.EnergyConsumerType;
+import android.os.BatteryConsumer;
+import android.os.Handler;
+import android.os.PersistableBundle;
+import android.util.Slog;
+import android.util.SparseArray;
+
+import com.android.internal.os.Clock;
+import com.android.internal.os.PowerStats;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.Executor;
+import java.util.concurrent.TimeUnit;
+import java.util.function.IntSupplier;
+
+public class BluetoothPowerStatsCollector extends PowerStatsCollector {
+ private static final String TAG = "BluetoothPowerStatsCollector";
+
+ private static final long BLUETOOTH_ACTIVITY_REQUEST_TIMEOUT = 20000;
+
+ private static final long ENERGY_UNSPECIFIED = -1;
+
+ interface BluetoothStatsRetriever {
+ interface Callback {
+ void onBluetoothScanTime(int uid, long scanTimeMs);
+ }
+
+ void retrieveBluetoothScanTimes(Callback callback);
+
+ boolean requestControllerActivityEnergyInfo(Executor executor,
+ BluetoothAdapter.OnBluetoothActivityEnergyInfoCallback callback);
+ }
+
+ interface Injector {
+ Handler getHandler();
+ Clock getClock();
+ PowerStatsUidResolver getUidResolver();
+ long getPowerStatsCollectionThrottlePeriod(String powerComponentName);
+ PackageManager getPackageManager();
+ ConsumedEnergyRetriever getConsumedEnergyRetriever();
+ IntSupplier getVoltageSupplier();
+ BluetoothStatsRetriever getBluetoothStatsRetriever();
+ }
+
+ private final Injector mInjector;
+
+ private BluetoothPowerStatsLayout mLayout;
+ private boolean mIsInitialized;
+ private PowerStats mPowerStats;
+ private long[] mDeviceStats;
+ private BluetoothStatsRetriever mBluetoothStatsRetriever;
+ private ConsumedEnergyRetriever mConsumedEnergyRetriever;
+ private IntSupplier mVoltageSupplier;
+ private int[] mEnergyConsumerIds = new int[0];
+ private long[] mLastConsumedEnergyUws;
+ private int mLastVoltageMv;
+
+ private long mLastRxTime;
+ private long mLastTxTime;
+ private long mLastIdleTime;
+
+ private static class UidStats {
+ public long rxCount;
+ public long lastRxCount;
+ public long txCount;
+ public long lastTxCount;
+ public long scanTime;
+ public long lastScanTime;
+ }
+
+ private final SparseArray<UidStats> mUidStats = new SparseArray<>();
+
+ BluetoothPowerStatsCollector(Injector injector) {
+ super(injector.getHandler(), injector.getPowerStatsCollectionThrottlePeriod(
+ BatteryConsumer.powerComponentIdToString(
+ BatteryConsumer.POWER_COMPONENT_BLUETOOTH)),
+ injector.getUidResolver(),
+ injector.getClock());
+ mInjector = injector;
+ }
+
+ @Override
+ public void setEnabled(boolean enabled) {
+ if (enabled) {
+ PackageManager packageManager = mInjector.getPackageManager();
+ super.setEnabled(packageManager != null
+ && packageManager.hasSystemFeature(PackageManager.FEATURE_BLUETOOTH));
+ } else {
+ super.setEnabled(false);
+ }
+ }
+
+ private boolean ensureInitialized() {
+ if (mIsInitialized) {
+ return true;
+ }
+
+ if (!isEnabled()) {
+ return false;
+ }
+
+ mConsumedEnergyRetriever = mInjector.getConsumedEnergyRetriever();
+ mVoltageSupplier = mInjector.getVoltageSupplier();
+ mBluetoothStatsRetriever = mInjector.getBluetoothStatsRetriever();
+ mEnergyConsumerIds =
+ mConsumedEnergyRetriever.getEnergyConsumerIds(EnergyConsumerType.BLUETOOTH);
+ mLastConsumedEnergyUws = new long[mEnergyConsumerIds.length];
+ Arrays.fill(mLastConsumedEnergyUws, ENERGY_UNSPECIFIED);
+
+ mLayout = new BluetoothPowerStatsLayout();
+ mLayout.addDeviceBluetoothControllerActivity();
+ mLayout.addDeviceSectionEnergyConsumers(mEnergyConsumerIds.length);
+ mLayout.addDeviceSectionUsageDuration();
+ mLayout.addDeviceSectionPowerEstimate();
+ mLayout.addUidTrafficStats();
+ mLayout.addUidSectionPowerEstimate();
+
+ PersistableBundle extras = new PersistableBundle();
+ mLayout.toExtras(extras);
+ PowerStats.Descriptor powerStatsDescriptor = new PowerStats.Descriptor(
+ BatteryConsumer.POWER_COMPONENT_BLUETOOTH, mLayout.getDeviceStatsArrayLength(),
+ null, 0, mLayout.getUidStatsArrayLength(),
+ extras);
+ mPowerStats = new PowerStats(powerStatsDescriptor);
+ mDeviceStats = mPowerStats.stats;
+
+ mIsInitialized = true;
+ return true;
+ }
+
+ @Override
+ protected PowerStats collectStats() {
+ if (!ensureInitialized()) {
+ return null;
+ }
+
+ mPowerStats.uidStats.clear();
+
+ collectBluetoothActivityInfo();
+ collectBluetoothScanStats();
+
+ if (mEnergyConsumerIds.length != 0) {
+ collectEnergyConsumers();
+ }
+
+ return mPowerStats;
+ }
+
+ private void collectBluetoothActivityInfo() {
+ CompletableFuture<BluetoothActivityEnergyInfo> immediateFuture = new CompletableFuture<>();
+ boolean success = mBluetoothStatsRetriever.requestControllerActivityEnergyInfo(
+ Runnable::run,
+ new BluetoothAdapter.OnBluetoothActivityEnergyInfoCallback() {
+ @Override
+ public void onBluetoothActivityEnergyInfoAvailable(
+ BluetoothActivityEnergyInfo info) {
+ immediateFuture.complete(info);
+ }
+
+ @Override
+ public void onBluetoothActivityEnergyInfoError(int error) {
+ immediateFuture.completeExceptionally(
+ new RuntimeException("error: " + error));
+ }
+ });
+
+ if (!success) {
+ return;
+ }
+
+ BluetoothActivityEnergyInfo activityInfo;
+ try {
+ activityInfo = immediateFuture.get(BLUETOOTH_ACTIVITY_REQUEST_TIMEOUT,
+ TimeUnit.MILLISECONDS);
+ } catch (Exception e) {
+ Slog.e(TAG, "Cannot acquire BluetoothActivityEnergyInfo", e);
+ activityInfo = null;
+ }
+
+ if (activityInfo == null) {
+ return;
+ }
+
+ long rxTime = activityInfo.getControllerRxTimeMillis();
+ long rxTimeDelta = Math.max(0, rxTime - mLastRxTime);
+ mLayout.setDeviceRxTime(mDeviceStats, rxTimeDelta);
+ mLastRxTime = rxTime;
+
+ long txTime = activityInfo.getControllerTxTimeMillis();
+ long txTimeDelta = Math.max(0, txTime - mLastTxTime);
+ mLayout.setDeviceTxTime(mDeviceStats, txTimeDelta);
+ mLastTxTime = txTime;
+
+ long idleTime = activityInfo.getControllerIdleTimeMillis();
+ long idleTimeDelta = Math.max(0, idleTime - mLastIdleTime);
+ mLayout.setDeviceIdleTime(mDeviceStats, idleTimeDelta);
+ mLastIdleTime = idleTime;
+
+ mPowerStats.durationMs = rxTimeDelta + txTimeDelta + idleTimeDelta;
+
+ List<UidTraffic> uidTraffic = activityInfo.getUidTraffic();
+ for (int i = uidTraffic.size() - 1; i >= 0; i--) {
+ UidTraffic ut = uidTraffic.get(i);
+ int uid = mUidResolver.mapUid(ut.getUid());
+ UidStats counts = mUidStats.get(uid);
+ if (counts == null) {
+ counts = new UidStats();
+ mUidStats.put(uid, counts);
+ }
+ counts.rxCount += ut.getRxBytes();
+ counts.txCount += ut.getTxBytes();
+ }
+
+ for (int i = mUidStats.size() - 1; i >= 0; i--) {
+ UidStats counts = mUidStats.valueAt(i);
+ long rxDelta = Math.max(0, counts.rxCount - counts.lastRxCount);
+ counts.lastRxCount = counts.rxCount;
+ counts.rxCount = 0;
+
+ long txDelta = Math.max(0, counts.txCount - counts.lastTxCount);
+ counts.lastTxCount = counts.txCount;
+ counts.txCount = 0;
+
+ if (rxDelta != 0 || txDelta != 0) {
+ int uid = mUidStats.keyAt(i);
+ long[] stats = mPowerStats.uidStats.get(uid);
+ if (stats == null) {
+ stats = new long[mLayout.getUidStatsArrayLength()];
+ mPowerStats.uidStats.put(uid, stats);
+ }
+
+ mLayout.setUidRxBytes(stats, rxDelta);
+ mLayout.setUidTxBytes(stats, txDelta);
+ }
+ }
+ }
+
+ private void collectBluetoothScanStats() {
+ mBluetoothStatsRetriever.retrieveBluetoothScanTimes((uid, scanTimeMs) -> {
+ uid = mUidResolver.mapUid(uid);
+ UidStats uidStats = mUidStats.get(uid);
+ if (uidStats == null) {
+ uidStats = new UidStats();
+ mUidStats.put(uid, uidStats);
+ }
+ uidStats.scanTime += scanTimeMs;
+ });
+
+ long totalScanTime = 0;
+ for (int i = mUidStats.size() - 1; i >= 0; i--) {
+ UidStats counts = mUidStats.valueAt(i);
+ if (counts.scanTime == 0) {
+ continue;
+ }
+
+ long delta = Math.max(0, counts.scanTime - counts.lastScanTime);
+ counts.lastScanTime = counts.scanTime;
+ counts.scanTime = 0;
+
+ if (delta != 0) {
+ int uid = mUidStats.keyAt(i);
+ long[] stats = mPowerStats.uidStats.get(uid);
+ if (stats == null) {
+ stats = new long[mLayout.getUidStatsArrayLength()];
+ mPowerStats.uidStats.put(uid, stats);
+ }
+
+ mLayout.setUidScanTime(stats, delta);
+ totalScanTime += delta;
+ }
+ }
+
+ mLayout.setDeviceScanTime(mDeviceStats, totalScanTime);
+ }
+
+ private void collectEnergyConsumers() {
+ int voltageMv = mVoltageSupplier.getAsInt();
+ if (voltageMv <= 0) {
+ Slog.wtf(TAG, "Unexpected battery voltage (" + voltageMv
+ + " mV) when querying energy consumers");
+ return;
+ }
+
+ int averageVoltage = mLastVoltageMv != 0 ? (mLastVoltageMv + voltageMv) / 2 : voltageMv;
+ mLastVoltageMv = voltageMv;
+
+ long[] energyUws = mConsumedEnergyRetriever.getConsumedEnergyUws(mEnergyConsumerIds);
+ if (energyUws == null) {
+ return;
+ }
+
+ for (int i = energyUws.length - 1; i >= 0; i--) {
+ long energyDelta = mLastConsumedEnergyUws[i] != ENERGY_UNSPECIFIED
+ ? energyUws[i] - mLastConsumedEnergyUws[i] : 0;
+ if (energyDelta < 0) {
+ // Likely, restart of powerstats HAL
+ energyDelta = 0;
+ }
+ mLayout.setConsumedEnergy(mPowerStats.stats, i, uJtoUc(energyDelta, averageVoltage));
+ mLastConsumedEnergyUws[i] = energyUws[i];
+ }
+ }
+
+ @Override
+ protected void onUidRemoved(int uid) {
+ super.onUidRemoved(uid);
+ mUidStats.remove(uid);
+ }
+}
diff --git a/services/core/java/com/android/server/power/stats/BluetoothPowerStatsLayout.java b/services/core/java/com/android/server/power/stats/BluetoothPowerStatsLayout.java
new file mode 100644
index 000000000000..9358b5ef20a8
--- /dev/null
+++ b/services/core/java/com/android/server/power/stats/BluetoothPowerStatsLayout.java
@@ -0,0 +1,143 @@
+/*
+ * 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.power.stats;
+
+import android.annotation.NonNull;
+import android.os.PersistableBundle;
+
+import com.android.internal.os.PowerStats;
+
+public class BluetoothPowerStatsLayout extends PowerStatsLayout {
+ private static final String EXTRA_DEVICE_RX_TIME_POSITION = "dt-rx";
+ private static final String EXTRA_DEVICE_TX_TIME_POSITION = "dt-tx";
+ private static final String EXTRA_DEVICE_IDLE_TIME_POSITION = "dt-idle";
+ private static final String EXTRA_DEVICE_SCAN_TIME_POSITION = "dt-scan";
+ private static final String EXTRA_UID_RX_BYTES_POSITION = "ub-rx";
+ private static final String EXTRA_UID_TX_BYTES_POSITION = "ub-tx";
+ private static final String EXTRA_UID_SCAN_TIME_POSITION = "ut-scan";
+
+ private int mDeviceRxTimePosition;
+ private int mDeviceTxTimePosition;
+ private int mDeviceIdleTimePosition;
+ private int mDeviceScanTimePosition;
+ private int mUidRxBytesPosition;
+ private int mUidTxBytesPosition;
+ private int mUidScanTimePosition;
+
+ BluetoothPowerStatsLayout() {
+ }
+
+ BluetoothPowerStatsLayout(@NonNull PowerStats.Descriptor descriptor) {
+ super(descriptor);
+ }
+
+ void addDeviceBluetoothControllerActivity() {
+ mDeviceRxTimePosition = addDeviceSection(1, "rx");
+ mDeviceTxTimePosition = addDeviceSection(1, "tx");
+ mDeviceIdleTimePosition = addDeviceSection(1, "idle");
+ mDeviceScanTimePosition = addDeviceSection(1, "scan", FLAG_OPTIONAL);
+ }
+
+ void addUidTrafficStats() {
+ mUidRxBytesPosition = addUidSection(1, "rx-B");
+ mUidTxBytesPosition = addUidSection(1, "tx-B");
+ mUidScanTimePosition = addUidSection(1, "scan", FLAG_OPTIONAL);
+ }
+
+ public void setDeviceRxTime(long[] stats, long durationMillis) {
+ stats[mDeviceRxTimePosition] = durationMillis;
+ }
+
+ public long getDeviceRxTime(long[] stats) {
+ return stats[mDeviceRxTimePosition];
+ }
+
+ public void setDeviceTxTime(long[] stats, long durationMillis) {
+ stats[mDeviceTxTimePosition] = durationMillis;
+ }
+
+ public long getDeviceTxTime(long[] stats) {
+ return stats[mDeviceTxTimePosition];
+ }
+
+ public void setDeviceIdleTime(long[] stats, long durationMillis) {
+ stats[mDeviceIdleTimePosition] = durationMillis;
+ }
+
+ public long getDeviceIdleTime(long[] stats) {
+ return stats[mDeviceIdleTimePosition];
+ }
+
+ public void setDeviceScanTime(long[] stats, long durationMillis) {
+ stats[mDeviceScanTimePosition] = durationMillis;
+ }
+
+ public long getDeviceScanTime(long[] stats) {
+ return stats[mDeviceScanTimePosition];
+ }
+
+ public void setUidRxBytes(long[] stats, long count) {
+ stats[mUidRxBytesPosition] = count;
+ }
+
+ public long getUidRxBytes(long[] stats) {
+ return stats[mUidRxBytesPosition];
+ }
+
+ public void setUidTxBytes(long[] stats, long count) {
+ stats[mUidTxBytesPosition] = count;
+ }
+
+ public long getUidTxBytes(long[] stats) {
+ return stats[mUidTxBytesPosition];
+ }
+
+ public void setUidScanTime(long[] stats, long count) {
+ stats[mUidScanTimePosition] = count;
+ }
+
+ public long getUidScanTime(long[] stats) {
+ return stats[mUidScanTimePosition];
+ }
+
+ /**
+ * Copies the elements of the stats array layout into <code>extras</code>
+ */
+ public void toExtras(PersistableBundle extras) {
+ super.toExtras(extras);
+ extras.putInt(EXTRA_DEVICE_RX_TIME_POSITION, mDeviceRxTimePosition);
+ extras.putInt(EXTRA_DEVICE_TX_TIME_POSITION, mDeviceTxTimePosition);
+ extras.putInt(EXTRA_DEVICE_IDLE_TIME_POSITION, mDeviceIdleTimePosition);
+ extras.putInt(EXTRA_DEVICE_SCAN_TIME_POSITION, mDeviceScanTimePosition);
+ extras.putInt(EXTRA_UID_RX_BYTES_POSITION, mUidRxBytesPosition);
+ extras.putInt(EXTRA_UID_TX_BYTES_POSITION, mUidTxBytesPosition);
+ extras.putInt(EXTRA_UID_SCAN_TIME_POSITION, mUidScanTimePosition);
+ }
+
+ /**
+ * Retrieves elements of the stats array layout from <code>extras</code>
+ */
+ public void fromExtras(PersistableBundle extras) {
+ super.fromExtras(extras);
+ mDeviceRxTimePosition = extras.getInt(EXTRA_DEVICE_RX_TIME_POSITION);
+ mDeviceTxTimePosition = extras.getInt(EXTRA_DEVICE_TX_TIME_POSITION);
+ mDeviceIdleTimePosition = extras.getInt(EXTRA_DEVICE_IDLE_TIME_POSITION);
+ mDeviceScanTimePosition = extras.getInt(EXTRA_DEVICE_SCAN_TIME_POSITION);
+ mUidRxBytesPosition = extras.getInt(EXTRA_UID_RX_BYTES_POSITION);
+ mUidTxBytesPosition = extras.getInt(EXTRA_UID_TX_BYTES_POSITION);
+ mUidScanTimePosition = extras.getInt(EXTRA_UID_SCAN_TIME_POSITION);
+ }
+}
diff --git a/services/core/java/com/android/server/power/stats/BluetoothPowerStatsProcessor.java b/services/core/java/com/android/server/power/stats/BluetoothPowerStatsProcessor.java
new file mode 100644
index 000000000000..4d6db9703ce7
--- /dev/null
+++ b/services/core/java/com/android/server/power/stats/BluetoothPowerStatsProcessor.java
@@ -0,0 +1,304 @@
+/*
+ * 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.power.stats;
+
+import com.android.internal.os.PowerProfile;
+import com.android.internal.os.PowerStats;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class BluetoothPowerStatsProcessor extends PowerStatsProcessor {
+ private static final String TAG = "BluetoothPowerStatsProcessor";
+
+ private final UsageBasedPowerEstimator mRxPowerEstimator;
+ private final UsageBasedPowerEstimator mTxPowerEstimator;
+ private final UsageBasedPowerEstimator mIdlePowerEstimator;
+
+ private PowerStats.Descriptor mLastUsedDescriptor;
+ private BluetoothPowerStatsLayout mStatsLayout;
+ // Sequence of steps for power estimation and intermediate results.
+ private PowerEstimationPlan mPlan;
+
+ private long[] mTmpDeviceStatsArray;
+ private long[] mTmpUidStatsArray;
+
+ public BluetoothPowerStatsProcessor(PowerProfile powerProfile) {
+ mRxPowerEstimator = new UsageBasedPowerEstimator(
+ powerProfile.getAveragePower(PowerProfile.POWER_BLUETOOTH_CONTROLLER_RX));
+ mTxPowerEstimator = new UsageBasedPowerEstimator(
+ powerProfile.getAveragePower(PowerProfile.POWER_BLUETOOTH_CONTROLLER_TX));
+ mIdlePowerEstimator = new UsageBasedPowerEstimator(
+ powerProfile.getAveragePower(PowerProfile.POWER_BLUETOOTH_CONTROLLER_IDLE));
+ }
+
+ private static class Intermediates {
+ /**
+ * Number of received bytes
+ */
+ public long rxBytes;
+ /**
+ * Duration of receiving
+ */
+ public long rxTime;
+ /**
+ * Estimated power for the RX state.
+ */
+ public double rxPower;
+ /**
+ * Number of transmitted bytes
+ */
+ public long txBytes;
+ /**
+ * Duration of transmitting
+ */
+ public long txTime;
+ /**
+ * Estimated power for the TX state.
+ */
+ public double txPower;
+ /**
+ * Estimated power for IDLE, SCAN states.
+ */
+ public double idlePower;
+ /**
+ * Total scan time.
+ */
+ public long scanTime;
+ /**
+ * Measured consumed energy from power monitoring hardware (micro-coulombs)
+ */
+ public long consumedEnergy;
+ }
+
+ @Override
+ void finish(PowerComponentAggregatedPowerStats stats) {
+ if (stats.getPowerStatsDescriptor() == null) {
+ return;
+ }
+
+ unpackPowerStatsDescriptor(stats.getPowerStatsDescriptor());
+
+ if (mPlan == null) {
+ mPlan = new PowerEstimationPlan(stats.getConfig());
+ }
+
+ for (int i = mPlan.deviceStateEstimations.size() - 1; i >= 0; i--) {
+ DeviceStateEstimation estimation = mPlan.deviceStateEstimations.get(i);
+ Intermediates intermediates = new Intermediates();
+ estimation.intermediates = intermediates;
+ computeDevicePowerEstimates(stats, estimation.stateValues, intermediates);
+ }
+
+ double ratio = 1.0;
+ if (mStatsLayout.getEnergyConsumerCount() != 0) {
+ ratio = computeEstimateAdjustmentRatioUsingConsumedEnergy();
+ if (ratio != 1) {
+ for (int i = mPlan.deviceStateEstimations.size() - 1; i >= 0; i--) {
+ DeviceStateEstimation estimation = mPlan.deviceStateEstimations.get(i);
+ adjustDevicePowerEstimates(stats, estimation.stateValues,
+ (Intermediates) estimation.intermediates, ratio);
+ }
+ }
+ }
+
+ combineDeviceStateEstimates();
+
+ ArrayList<Integer> uids = new ArrayList<>();
+ stats.collectUids(uids);
+ if (!uids.isEmpty()) {
+ for (int uid : uids) {
+ for (int i = 0; i < mPlan.uidStateEstimates.size(); i++) {
+ computeUidActivityTotals(stats, uid, mPlan.uidStateEstimates.get(i));
+ }
+ }
+
+ for (int uid : uids) {
+ for (int i = 0; i < mPlan.uidStateEstimates.size(); i++) {
+ computeUidPowerEstimates(stats, uid, mPlan.uidStateEstimates.get(i));
+ }
+ }
+ }
+ mPlan.resetIntermediates();
+ }
+
+ private void unpackPowerStatsDescriptor(PowerStats.Descriptor descriptor) {
+ if (descriptor.equals(mLastUsedDescriptor)) {
+ return;
+ }
+
+ mLastUsedDescriptor = descriptor;
+ mStatsLayout = new BluetoothPowerStatsLayout(descriptor);
+ mTmpDeviceStatsArray = new long[descriptor.statsArrayLength];
+ mTmpUidStatsArray = new long[descriptor.uidStatsArrayLength];
+ }
+
+ /**
+ * Compute power estimates using the power profile.
+ */
+ private void computeDevicePowerEstimates(PowerComponentAggregatedPowerStats stats,
+ int[] deviceStates, Intermediates intermediates) {
+ if (!stats.getDeviceStats(mTmpDeviceStatsArray, deviceStates)) {
+ return;
+ }
+
+ for (int i = mStatsLayout.getEnergyConsumerCount() - 1; i >= 0; i--) {
+ intermediates.consumedEnergy += mStatsLayout.getConsumedEnergy(mTmpDeviceStatsArray, i);
+ }
+
+ intermediates.rxTime = mStatsLayout.getDeviceRxTime(mTmpDeviceStatsArray);
+ intermediates.txTime = mStatsLayout.getDeviceTxTime(mTmpDeviceStatsArray);
+ intermediates.scanTime = mStatsLayout.getDeviceScanTime(mTmpDeviceStatsArray);
+ long idleTime = mStatsLayout.getDeviceIdleTime(mTmpDeviceStatsArray);
+
+ intermediates.rxPower = mRxPowerEstimator.calculatePower(intermediates.rxTime);
+ intermediates.txPower = mTxPowerEstimator.calculatePower(intermediates.txTime);
+ intermediates.idlePower = mIdlePowerEstimator.calculatePower(idleTime);
+ mStatsLayout.setDevicePowerEstimate(mTmpDeviceStatsArray,
+ intermediates.rxPower + intermediates.txPower + intermediates.idlePower);
+ stats.setDeviceStats(deviceStates, mTmpDeviceStatsArray);
+ }
+
+ /**
+ * Compute an adjustment ratio using the total power estimated using the power profile
+ * and the total power measured by hardware.
+ */
+ private double computeEstimateAdjustmentRatioUsingConsumedEnergy() {
+ long totalConsumedEnergy = 0;
+ double totalPower = 0;
+
+ for (int i = mPlan.deviceStateEstimations.size() - 1; i >= 0; i--) {
+ Intermediates intermediates =
+ (Intermediates) mPlan.deviceStateEstimations.get(i).intermediates;
+ totalPower += intermediates.rxPower + intermediates.txPower + intermediates.idlePower;
+ totalConsumedEnergy += intermediates.consumedEnergy;
+ }
+
+ if (totalPower == 0) {
+ return 1;
+ }
+
+ return uCtoMah(totalConsumedEnergy) / totalPower;
+ }
+
+ /**
+ * Uniformly apply the same adjustment to all power estimates in order to ensure that the total
+ * estimated power matches the measured consumed power. We are not claiming that all
+ * averages captured in the power profile have to be off by the same percentage in reality.
+ */
+ private void adjustDevicePowerEstimates(PowerComponentAggregatedPowerStats stats,
+ int[] deviceStates, Intermediates intermediates, double ratio) {
+ double adjutedPower;
+ intermediates.rxPower *= ratio;
+ intermediates.txPower *= ratio;
+ intermediates.idlePower *= ratio;
+ adjutedPower = intermediates.rxPower + intermediates.txPower + intermediates.idlePower;
+
+ if (!stats.getDeviceStats(mTmpDeviceStatsArray, deviceStates)) {
+ return;
+ }
+
+ mStatsLayout.setDevicePowerEstimate(mTmpDeviceStatsArray, adjutedPower);
+ stats.setDeviceStats(deviceStates, mTmpDeviceStatsArray);
+ }
+
+ /**
+ * Combine power estimates before distributing them proportionally to UIDs.
+ */
+ private void combineDeviceStateEstimates() {
+ for (int i = mPlan.combinedDeviceStateEstimations.size() - 1; i >= 0; i--) {
+ CombinedDeviceStateEstimate cdse = mPlan.combinedDeviceStateEstimations.get(i);
+ Intermediates cdseIntermediates = new Intermediates();
+ cdse.intermediates = cdseIntermediates;
+ List<DeviceStateEstimation> deviceStateEstimations = cdse.deviceStateEstimations;
+ for (int j = deviceStateEstimations.size() - 1; j >= 0; j--) {
+ DeviceStateEstimation dse = deviceStateEstimations.get(j);
+ Intermediates intermediates = (Intermediates) dse.intermediates;
+ cdseIntermediates.rxTime += intermediates.rxTime;
+ cdseIntermediates.rxBytes += intermediates.rxBytes;
+ cdseIntermediates.rxPower += intermediates.rxPower;
+ cdseIntermediates.txTime += intermediates.txTime;
+ cdseIntermediates.txBytes += intermediates.txBytes;
+ cdseIntermediates.txPower += intermediates.txPower;
+ cdseIntermediates.idlePower += intermediates.idlePower;
+ cdseIntermediates.scanTime += intermediates.scanTime;
+ cdseIntermediates.consumedEnergy += intermediates.consumedEnergy;
+ }
+ }
+ }
+
+ private void computeUidActivityTotals(PowerComponentAggregatedPowerStats stats, int uid,
+ UidStateEstimate uidStateEstimate) {
+ Intermediates intermediates =
+ (Intermediates) uidStateEstimate.combinedDeviceStateEstimate.intermediates;
+ for (UidStateProportionalEstimate proportionalEstimate :
+ uidStateEstimate.proportionalEstimates) {
+ if (!stats.getUidStats(mTmpUidStatsArray, uid, proportionalEstimate.stateValues)) {
+ continue;
+ }
+
+ intermediates.rxBytes += mStatsLayout.getUidRxBytes(mTmpUidStatsArray);
+ intermediates.txBytes += mStatsLayout.getUidTxBytes(mTmpUidStatsArray);
+ }
+ }
+
+ private void computeUidPowerEstimates(PowerComponentAggregatedPowerStats stats, int uid,
+ UidStateEstimate uidStateEstimate) {
+ Intermediates intermediates =
+ (Intermediates) uidStateEstimate.combinedDeviceStateEstimate.intermediates;
+
+ // Scan is more expensive than data transfer, so in the presence of large
+ // of scanning duration, blame apps according to the time they spent scanning.
+ // This may disproportionately blame apps that do a lot of scanning, which is
+ // the tread-off we are making in the absence of more detailed metrics.
+ boolean normalizeRxByScanTime = intermediates.scanTime > intermediates.rxTime;
+ boolean normalizeTxByScanTime = intermediates.scanTime > intermediates.txTime;
+
+ for (UidStateProportionalEstimate proportionalEstimate :
+ uidStateEstimate.proportionalEstimates) {
+ if (!stats.getUidStats(mTmpUidStatsArray, uid, proportionalEstimate.stateValues)) {
+ continue;
+ }
+
+ double power = 0;
+ if (normalizeRxByScanTime) {
+ if (intermediates.scanTime != 0) {
+ power += intermediates.rxPower * mStatsLayout.getUidScanTime(mTmpUidStatsArray)
+ / intermediates.scanTime;
+ }
+ } else {
+ if (intermediates.rxBytes != 0) {
+ power += intermediates.rxPower * mStatsLayout.getUidRxBytes(mTmpUidStatsArray)
+ / intermediates.rxBytes;
+ }
+ }
+ if (normalizeTxByScanTime) {
+ if (intermediates.scanTime != 0) {
+ power += intermediates.txPower * mStatsLayout.getUidScanTime(mTmpUidStatsArray)
+ / intermediates.scanTime;
+ }
+ } else {
+ if (intermediates.txBytes != 0) {
+ power += intermediates.txPower * mStatsLayout.getUidTxBytes(mTmpUidStatsArray)
+ / intermediates.txBytes;
+ }
+ }
+ mStatsLayout.setUidPowerEstimate(mTmpUidStatsArray, power);
+ stats.setUidStats(uid, proportionalEstimate.stateValues, mTmpUidStatsArray);
+ }
+ }
+}
diff --git a/services/core/java/com/android/server/timedetector/ServiceConfigAccessorImpl.java b/services/core/java/com/android/server/timedetector/ServiceConfigAccessorImpl.java
index ad2c3e83b041..3579246b660f 100644
--- a/services/core/java/com/android/server/timedetector/ServiceConfigAccessorImpl.java
+++ b/services/core/java/com/android/server/timedetector/ServiceConfigAccessorImpl.java
@@ -225,7 +225,7 @@ final class ServiceConfigAccessorImpl implements ServiceConfigAccessor {
@NonNull TimeConfiguration requestedConfiguration, boolean bypassUserPolicyChecks) {
Objects.requireNonNull(requestedConfiguration);
- TimeCapabilitiesAndConfig capabilitiesAndConfig = getCurrentUserConfigurationInternal()
+ TimeCapabilitiesAndConfig capabilitiesAndConfig = getConfigurationInternal(userId)
.createCapabilitiesAndConfig(bypassUserPolicyChecks);
TimeCapabilities capabilities = capabilitiesAndConfig.getCapabilities();
TimeConfiguration oldConfiguration = capabilitiesAndConfig.getConfiguration();
diff --git a/services/core/java/com/android/server/wallpaper/WallpaperCropper.java b/services/core/java/com/android/server/wallpaper/WallpaperCropper.java
index dd3d512e471c..80f1125a4ecf 100644
--- a/services/core/java/com/android/server/wallpaper/WallpaperCropper.java
+++ b/services/core/java/com/android/server/wallpaper/WallpaperCropper.java
@@ -150,7 +150,7 @@ public class WallpaperCropper {
Rect landscapeCrop = getCrop(rotatedDisplaySize, bitmapSize, suggestedCrops, rtl);
landscapeCrop = noParallax(landscapeCrop, rotatedDisplaySize, bitmapSize, rtl);
// compute the crop on portrait at the center of the landscape crop
- crop = getAdjustedCrop(landscapeCrop, bitmapSize, displaySize, false, rtl, ADD);
+ crop = getAdjustedCrop(landscapeCrop, bitmapSize, displaySize, false, ADD);
// add some parallax (until the border of the landscape crop without parallax)
if (rtl) {
@@ -160,7 +160,7 @@ public class WallpaperCropper {
}
}
- return getAdjustedCrop(crop, bitmapSize, displaySize, true, rtl, ADD);
+ return getAdjustedCrop(crop, bitmapSize, displaySize, true, ADD);
}
// If any suggested crop is invalid, fallback to case 1
@@ -176,7 +176,7 @@ public class WallpaperCropper {
// Case 2: if the orientation exists in the suggested crops, adjust the suggested crop
Rect suggestedCrop = suggestedCrops.get(orientation);
if (suggestedCrop != null) {
- return getAdjustedCrop(suggestedCrop, bitmapSize, displaySize, true, rtl, ADD);
+ return getAdjustedCrop(suggestedCrop, bitmapSize, displaySize, true, ADD);
}
// Case 3: if we have the 90° rotated orientation in the suggested crops, reuse it and
@@ -188,7 +188,7 @@ public class WallpaperCropper {
if (suggestedCrop != null) {
// only keep the visible part (without parallax)
Rect adjustedCrop = noParallax(suggestedCrop, suggestedDisplaySize, bitmapSize, rtl);
- return getAdjustedCrop(adjustedCrop, bitmapSize, displaySize, false, rtl, BALANCE);
+ return getAdjustedCrop(adjustedCrop, bitmapSize, displaySize, false, BALANCE);
}
// Case 4: if the device is a foldable, if we're looking for a folded orientation and have
@@ -200,13 +200,13 @@ public class WallpaperCropper {
// compute the visible part (without parallax) of the unfolded screen
Rect adjustedCrop = noParallax(suggestedCrop, suggestedDisplaySize, bitmapSize, rtl);
// compute the folded crop, at the center of the crop of the unfolded screen
- Rect res = getAdjustedCrop(adjustedCrop, bitmapSize, displaySize, false, rtl, REMOVE);
+ Rect res = getAdjustedCrop(adjustedCrop, bitmapSize, displaySize, false, REMOVE);
// if we removed some width, add it back to add a parallax effect
if (res.width() < adjustedCrop.width()) {
if (rtl) res.left = Math.min(res.left, adjustedCrop.left);
else res.right = Math.max(res.right, adjustedCrop.right);
// use getAdjustedCrop(parallax=true) to make sure we don't exceed MAX_PARALLAX
- res = getAdjustedCrop(res, bitmapSize, displaySize, true, rtl, ADD);
+ res = getAdjustedCrop(res, bitmapSize, displaySize, true, ADD);
}
return res;
}
@@ -220,7 +220,7 @@ public class WallpaperCropper {
if (suggestedCrop != null) {
// only keep the visible part (without parallax)
Rect adjustedCrop = noParallax(suggestedCrop, suggestedDisplaySize, bitmapSize, rtl);
- return getAdjustedCrop(adjustedCrop, bitmapSize, displaySize, false, rtl, ADD);
+ return getAdjustedCrop(adjustedCrop, bitmapSize, displaySize, false, ADD);
}
// Case 6: for a foldable device, try to combine case 3 + case 4 or 5:
@@ -255,7 +255,7 @@ public class WallpaperCropper {
@VisibleForTesting
static Rect noParallax(Rect crop, Point displaySize, Point bitmapSize, boolean rtl) {
if (displaySize == null) return crop;
- Rect adjustedCrop = getAdjustedCrop(crop, bitmapSize, displaySize, true, rtl, ADD);
+ Rect adjustedCrop = getAdjustedCrop(crop, bitmapSize, displaySize, true, ADD);
// only keep the visible part (without parallax)
float suggestedDisplayRatio = 1f * displaySize.x / displaySize.y;
int widthToRemove = (int) (adjustedCrop.width()
@@ -272,7 +272,7 @@ public class WallpaperCropper {
* Adjust a given crop:
* <ul>
* <li>If parallax = true, make sure we have a parallax of at most {@link #MAX_PARALLAX},
- * by removing content from the right (or left if RTL layout) if necessary.
+ * by removing content from both sides if necessary.
* <li>If parallax = false, make sure we do not have additional width for parallax. If we
* have additional width for parallax, remove half of the additional width on both sides.
* <li>Make sure the crop fills the screen, i.e. that the width/height ratio of the crop
@@ -282,7 +282,7 @@ public class WallpaperCropper {
*/
@VisibleForTesting
static Rect getAdjustedCrop(Rect crop, Point bitmapSize, Point screenSize,
- boolean parallax, boolean rtl, int mode) {
+ boolean parallax, int mode) {
Rect adjustedCrop = new Rect(crop);
float cropRatio = ((float) crop.width()) / crop.height();
float screenRatio = ((float) screenSize.x) / screenSize.y;
@@ -297,8 +297,7 @@ public class WallpaperCropper {
Rect rotatedCrop = new Rect(newLeft, newTop, newRight, newBottom);
Point rotatedBitmap = new Point(bitmapSize.y, bitmapSize.x);
Point rotatedScreen = new Point(screenSize.y, screenSize.x);
- Rect rect = getAdjustedCrop(rotatedCrop, rotatedBitmap, rotatedScreen, false, rtl,
- mode);
+ Rect rect = getAdjustedCrop(rotatedCrop, rotatedBitmap, rotatedScreen, false, mode);
int resultLeft = rect.top;
int resultRight = resultLeft + rect.height();
int resultTop = rotatedBitmap.x - rect.right;
@@ -318,9 +317,8 @@ public class WallpaperCropper {
// total surface of W * H. In other words it is the width to add to get the desired
// aspect ratio R, while preserving the total number of pixels W * H.
int widthToAdd = mode == REMOVE ? 0
- : mode == ADD ? (int) (0.5 + crop.height() * screenRatio - crop.width())
- : (int) (0.5 - crop.width()
- + Math.sqrt(crop.width() * crop.height() * screenRatio));
+ : mode == ADD ? (int) (crop.height() * screenRatio - crop.width())
+ : (int) (-crop.width() + Math.sqrt(crop.width() * crop.height() * screenRatio));
int availableWidth = bitmapSize.x - crop.width();
if (availableWidth >= widthToAdd) {
int widthToAddLeft = widthToAdd / 2;
diff --git a/services/core/java/com/android/server/wm/AccessibilityController.java b/services/core/java/com/android/server/wm/AccessibilityController.java
index e280bdc7780b..5be5bc5e3952 100644
--- a/services/core/java/com/android/server/wm/AccessibilityController.java
+++ b/services/core/java/com/android/server/wm/AccessibilityController.java
@@ -984,36 +984,26 @@ final class AccessibilityController {
Region touchableRegion = mTempRegion3;
windowState.getTouchableRegion(touchableRegion);
Region windowBounds = mTempRegion2;
- if (Flags.useWindowOriginalTouchableRegionWhenMagnificationRecomputeBounds()) {
- // For b/323366243, if using the bounds from touchableRegion.getBounds, in
- // non-magnifiable windowBounds computation, part of the non-touchableRegion
- // may be included into nonMagnifiedBounds. This will make users lose
- // the magnification control on mis-included areas.
- // Therefore, to prevent the above issue, we change to use the window exact
- // touchableRegion in magnificationRegion computation.
- // Like the original approach, the touchableRegion is in non-magnified display
- // space, so first we need to offset the region by the windowFrames bounds, then
- // apply the transform matrix to the region to get the exact region in magnified
- // display space.
- // TODO: For a long-term plan, since touchable regions provided by WindowState
- // doesn't actually reflect the real touchable regions on display, we should
- // delete the WindowState dependency and migrate to use the touchableRegion
- // from WindowInfoListener data. (b/330653961)
- touchableRegion.translate(-windowState.getFrame().left,
- -windowState.getFrame().top);
- applyMatrixToRegion(matrix, touchableRegion);
- windowBounds.set(touchableRegion);
- } else {
- Rect touchableFrame = mTempRect1;
- touchableRegion.getBounds(touchableFrame);
- RectF windowFrame = mTempRectF;
- windowFrame.set(touchableFrame);
- windowFrame.offset(-windowState.getFrame().left,
- -windowState.getFrame().top);
- matrix.mapRect(windowFrame);
- windowBounds.set((int) windowFrame.left, (int) windowFrame.top,
- (int) windowFrame.right, (int) windowFrame.bottom);
- }
+
+ // For b/323366243, if using the bounds from touchableRegion.getBounds, in
+ // non-magnifiable windowBounds computation, part of the non-touchableRegion
+ // may be included into nonMagnifiedBounds. This will make users lose
+ // the magnification control on mis-included areas.
+ // Therefore, to prevent the above issue, we change to use the window exact
+ // touchableRegion in magnificationRegion computation.
+ // Like the original approach, the touchableRegion is in non-magnified display
+ // space, so first we need to offset the region by the windowFrames bounds, then
+ // apply the transform matrix to the region to get the exact region in magnified
+ // display space.
+ // TODO: For a long-term plan, since touchable regions provided by WindowState
+ // doesn't actually reflect the real touchable regions on display, we should
+ // delete the WindowState dependency and migrate to use the touchableRegion
+ // from WindowInfoListener data. (b/330653961)
+ touchableRegion.translate(-windowState.getFrame().left,
+ -windowState.getFrame().top);
+ applyMatrixToRegion(matrix, touchableRegion);
+ windowBounds.set(touchableRegion);
+
// Only update new regions
Region portionOfWindowAlreadyAccountedFor = mTempRegion3;
portionOfWindowAlreadyAccountedFor.set(mMagnificationRegion);
diff --git a/services/core/java/com/android/server/wm/ActivityRecord.java b/services/core/java/com/android/server/wm/ActivityRecord.java
index 76e7f535c60f..8253a957d231 100644
--- a/services/core/java/com/android/server/wm/ActivityRecord.java
+++ b/services/core/java/com/android/server/wm/ActivityRecord.java
@@ -77,7 +77,6 @@ import static android.content.pm.ActivityInfo.FLAG_NO_HISTORY;
import static android.content.pm.ActivityInfo.FLAG_SHOW_FOR_ALL_USERS;
import static android.content.pm.ActivityInfo.FLAG_STATE_NOT_NEEDED;
import static android.content.pm.ActivityInfo.FLAG_TURN_SCREEN_ON;
-import static android.content.pm.ActivityInfo.OVERRIDE_ENABLE_INSETS_DECOUPLED_CONFIGURATION;
import static android.content.pm.ActivityInfo.INSETS_DECOUPLED_CONFIGURATION_ENFORCED;
import static android.content.pm.ActivityInfo.LAUNCH_MULTIPLE;
import static android.content.pm.ActivityInfo.LAUNCH_SINGLE_INSTANCE;
@@ -87,6 +86,7 @@ import static android.content.pm.ActivityInfo.LOCK_TASK_LAUNCH_MODE_ALWAYS;
import static android.content.pm.ActivityInfo.LOCK_TASK_LAUNCH_MODE_DEFAULT;
import static android.content.pm.ActivityInfo.LOCK_TASK_LAUNCH_MODE_IF_ALLOWLISTED;
import static android.content.pm.ActivityInfo.LOCK_TASK_LAUNCH_MODE_NEVER;
+import static android.content.pm.ActivityInfo.OVERRIDE_ENABLE_INSETS_DECOUPLED_CONFIGURATION;
import static android.content.pm.ActivityInfo.OVERRIDE_MIN_ASPECT_RATIO_EXCLUDE_PORTRAIT_FULLSCREEN;
import static android.content.pm.ActivityInfo.OVERRIDE_MIN_ASPECT_RATIO_LARGE;
import static android.content.pm.ActivityInfo.OVERRIDE_MIN_ASPECT_RATIO_MEDIUM;
@@ -121,6 +121,7 @@ import static android.view.Display.INVALID_DISPLAY;
import static android.view.Surface.ROTATION_270;
import static android.view.Surface.ROTATION_90;
import static android.view.WindowManager.ACTIVITY_EMBEDDING_GUARD_WITH_ANDROID_15;
+import static android.view.WindowManager.ENABLE_ACTIVITY_EMBEDDING_FOR_ANDROID_15;
import static android.view.WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD;
import static android.view.WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED;
import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION;
@@ -128,7 +129,6 @@ import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION_STARTING;
import static android.view.WindowManager.LayoutParams.TYPE_BASE_APPLICATION;
import static android.view.WindowManager.PROPERTY_ACTIVITY_EMBEDDING_SPLITS_ENABLED;
import static android.view.WindowManager.PROPERTY_ALLOW_UNTRUSTED_ACTIVITY_EMBEDDING_STATE_SHARING;
-import static android.view.WindowManager.ENABLE_ACTIVITY_EMBEDDING_FOR_ANDROID_15;
import static android.view.WindowManager.TRANSIT_CLOSE;
import static android.view.WindowManager.TRANSIT_FLAG_OPEN_BEHIND;
import static android.view.WindowManager.TRANSIT_OLD_UNSET;
@@ -339,6 +339,7 @@ import android.service.contentcapture.ActivityEvent;
import android.service.dreams.DreamActivity;
import android.service.voice.IVoiceInteractionSession;
import android.util.ArraySet;
+import android.util.DisplayMetrics;
import android.util.EventLog;
import android.util.Log;
import android.util.MergedConfiguration;
@@ -660,6 +661,8 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
private final TaskFragment.ConfigOverrideHint mResolveConfigHint;
+ private final boolean mOptOutEdgeToEdge;
+
private static ConstrainDisplayApisConfig sConstrainDisplayApisConfig;
boolean pendingVoiceInteractionStart; // Waiting for activity-invoked voice session
@@ -682,6 +685,12 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
// it references to gets removed. This should also be cleared when we move out of pip.
private Task mLastParentBeforePip;
+ // The token of the previous TaskFragment parent of this embedded ActivityRecord when it is
+ // reparented to a new Task due to picture-in-picture.
+ // Note that the TaskFragment may be finished and no longer attached in WM hierarchy.
+ @Nullable
+ private IBinder mLastEmbeddedParentTfTokenBeforePip;
+
// Only set if this instance is a launch-into-pip Activity, points to the
// host Activity the launch-into-pip Activity is originated from.
private ActivityRecord mLaunchIntoPipHostActivity;
@@ -1806,6 +1815,11 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
mLastTaskFragmentOrganizerBeforePip = organizedTf != null
? organizedTf.getTaskFragmentOrganizer()
: null;
+ if (organizedTf != null
+ // Not necessary for content pip.
+ && launchIntoPipHostActivity == null) {
+ mLastEmbeddedParentTfTokenBeforePip = organizedTf.getFragmentToken();
+ }
}
void clearLastParentBeforePip() {
@@ -1815,12 +1829,17 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
}
mLaunchIntoPipHostActivity = null;
mLastTaskFragmentOrganizerBeforePip = null;
+ mLastEmbeddedParentTfTokenBeforePip = null;
}
@Nullable Task getLastParentBeforePip() {
return mLastParentBeforePip;
}
+ @Nullable IBinder getLastEmbeddedParentTfTokenBeforePip() {
+ return mLastEmbeddedParentTfTokenBeforePip;
+ }
+
@Nullable ActivityRecord getLaunchIntoPipHostActivity() {
return mLaunchIntoPipHostActivity;
}
@@ -2122,14 +2141,14 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
if (mWmService.mFlags.mInsetsDecoupledConfiguration) {
// When the stable configuration is the default behavior, override for the legacy apps
// without forward override flag.
- mResolveConfigHint.mUseOverrideInsetsForConfig =
+ mResolveConfigHint.mUseOverrideInsetsForStableBounds =
!info.isChangeEnabled(INSETS_DECOUPLED_CONFIGURATION_ENFORCED)
&& !info.isChangeEnabled(
OVERRIDE_ENABLE_INSETS_DECOUPLED_CONFIGURATION);
} else {
// When the stable configuration is not the default behavior, forward overriding the
// listed apps.
- mResolveConfigHint.mUseOverrideInsetsForConfig =
+ mResolveConfigHint.mUseOverrideInsetsForStableBounds =
info.isChangeEnabled(OVERRIDE_ENABLE_INSETS_DECOUPLED_CONFIGURATION);
}
@@ -2163,9 +2182,12 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
|| ent.array.getBoolean(R.styleable.Window_windowShowWallpaper, false);
mStyleFillsParent = mOccludesParent;
noDisplay = ent.array.getBoolean(R.styleable.Window_windowNoDisplay, false);
+ mOptOutEdgeToEdge = ent.array.getBoolean(
+ R.styleable.Window_windowOptOutEdgeToEdgeEnforcement, false);
} else {
mStyleFillsParent = mOccludesParent = true;
noDisplay = false;
+ mOptOutEdgeToEdge = false;
}
if (options != null) {
@@ -8491,7 +8513,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
mCompatDisplayInsets =
new CompatDisplayInsets(
mDisplayContent, this, letterboxedContainerBounds,
- mResolveConfigHint.mUseOverrideInsetsForConfig);
+ mResolveConfigHint.mUseOverrideInsetsForStableBounds);
}
private void clearSizeCompatModeAttributes() {
@@ -8571,6 +8593,8 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
final int parentWindowingMode =
newParentConfiguration.windowConfiguration.getWindowingMode();
+ applySizeOverrideIfNeeded(newParentConfiguration, parentWindowingMode, resolvedConfig);
+
// Bubble activities should always fill their parent and should not be letterboxed.
final boolean isFixedOrientationLetterboxAllowed = !getLaunchedFromBubble()
&& (parentWindowingMode == WINDOWING_MODE_MULTI_WINDOW
@@ -8670,8 +8694,6 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
resolvedConfig.windowConfiguration.setMaxBounds(mTmpBounds);
}
- applySizeOverrideIfNeeded(newParentConfiguration, parentWindowingMode, resolvedConfig);
-
logAppCompatState();
}
@@ -8690,13 +8712,14 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
if (mDisplayContent == null) {
return;
}
+ final Rect parentBounds = newParentConfiguration.windowConfiguration.getBounds();
int rotation = newParentConfiguration.windowConfiguration.getRotation();
if (rotation == ROTATION_UNDEFINED && !isFixedRotationTransforming()) {
rotation = mDisplayContent.getRotation();
}
- if (!mResolveConfigHint.mUseOverrideInsetsForConfig
- || getCompatDisplayInsets() != null || shouldCreateCompatDisplayInsets()
- || isFloating(parentWindowingMode) || rotation == ROTATION_UNDEFINED) {
+ if (!mOptOutEdgeToEdge && (!mResolveConfigHint.mUseOverrideInsetsForStableBounds
+ || getCompatDisplayInsets() != null || isFloating(parentWindowingMode)
+ || rotation == ROTATION_UNDEFINED)) {
// If the insets configuration decoupled logic is not enabled for the app, or the app
// already has a compat override, or the context doesn't contain enough info to
// calculate the override, skip the override.
@@ -8713,7 +8736,53 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
}
// Override starts here.
- computeConfigByResolveHint(inOutConfig, newParentConfiguration);
+ final boolean rotated = (rotation == ROTATION_90 || rotation == ROTATION_270);
+ final int dw = rotated ? mDisplayContent.mBaseDisplayHeight
+ : mDisplayContent.mBaseDisplayWidth;
+ final int dh = rotated ? mDisplayContent.mBaseDisplayWidth
+ : mDisplayContent.mBaseDisplayHeight;
+ final Rect nonDecorInsets = mDisplayContent.getDisplayPolicy()
+ .getDecorInsetsInfo(rotation, dw, dh).mOverrideNonDecorInsets;
+ // This should be the only place override the configuration for ActivityRecord. Override
+ // the value if not calculated yet.
+ Rect outAppBounds = inOutConfig.windowConfiguration.getAppBounds();
+ if (outAppBounds == null || outAppBounds.isEmpty()) {
+ inOutConfig.windowConfiguration.setAppBounds(parentBounds);
+ outAppBounds = inOutConfig.windowConfiguration.getAppBounds();
+ outAppBounds.inset(nonDecorInsets);
+ }
+ float density = inOutConfig.densityDpi;
+ if (density == Configuration.DENSITY_DPI_UNDEFINED) {
+ density = newParentConfiguration.densityDpi;
+ }
+ density *= DisplayMetrics.DENSITY_DEFAULT_SCALE;
+ if (inOutConfig.screenWidthDp == Configuration.SCREEN_WIDTH_DP_UNDEFINED) {
+ final int overrideScreenWidthDp = (int) (outAppBounds.width() / density + 0.5f);
+ inOutConfig.screenWidthDp = overrideScreenWidthDp;
+ }
+ if (inOutConfig.screenHeightDp == Configuration.SCREEN_HEIGHT_DP_UNDEFINED) {
+ final int overrideScreenHeightDp = (int) (outAppBounds.height() / density + 0.5f);
+ inOutConfig.screenHeightDp = overrideScreenHeightDp;
+ }
+ if (inOutConfig.smallestScreenWidthDp
+ == Configuration.SMALLEST_SCREEN_WIDTH_DP_UNDEFINED
+ && parentWindowingMode == WINDOWING_MODE_FULLSCREEN) {
+ // For the case of PIP transition and multi-window environment, the
+ // smallestScreenWidthDp is handled already. Override only if the app is in
+ // fullscreen.
+ final DisplayInfo info = new DisplayInfo(mDisplayContent.getDisplayInfo());
+ mDisplayContent.computeSizeRanges(info, rotated, dw, dh,
+ mDisplayContent.getDisplayMetrics().density,
+ inOutConfig, true /* overrideConfig */);
+ }
+
+ // It's possible that screen size will be considered in different orientation with or
+ // without considering the system bar insets. Override orientation as well.
+ if (inOutConfig.orientation == ORIENTATION_UNDEFINED) {
+ inOutConfig.orientation =
+ (inOutConfig.screenWidthDp <= inOutConfig.screenHeightDp)
+ ? ORIENTATION_PORTRAIT : ORIENTATION_LANDSCAPE;
+ }
}
private void computeConfigByResolveHint(@NonNull Configuration resolvedConfig,
@@ -8969,7 +9038,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
if (mDisplayContent == null) {
return true;
}
- if (!mResolveConfigHint.mUseOverrideInsetsForConfig) {
+ if (!mResolveConfigHint.mUseOverrideInsetsForStableBounds) {
// No insets should be considered any more.
return true;
}
@@ -8988,7 +9057,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
final Task task = getTask();
task.calculateInsetFrames(outNonDecorBounds /* outNonDecorBounds */,
outStableBounds /* outStableBounds */, parentBounds /* bounds */, di,
- mResolveConfigHint.mUseOverrideInsetsForConfig);
+ mResolveConfigHint.mUseOverrideInsetsForStableBounds);
final int orientationWithInsets = outStableBounds.height() >= outStableBounds.width()
? ORIENTATION_PORTRAIT : ORIENTATION_LANDSCAPE;
// If orientation does not match the orientation with insets applied, then a
@@ -9045,7 +9114,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
getResolvedOverrideConfiguration().windowConfiguration.getBounds();
final int stableBoundsOrientation = stableBounds.width() > stableBounds.height()
? ORIENTATION_LANDSCAPE : ORIENTATION_PORTRAIT;
- final int parentOrientation = mResolveConfigHint.mUseOverrideInsetsForConfig
+ final int parentOrientation = mResolveConfigHint.mUseOverrideInsetsForStableBounds
? stableBoundsOrientation : newParentConfig.orientation;
// If the activity requires a different orientation (either by override or activityInfo),
@@ -9070,7 +9139,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
return;
}
- final Rect parentAppBounds = mResolveConfigHint.mUseOverrideInsetsForConfig
+ final Rect parentAppBounds = mResolveConfigHint.mUseOverrideInsetsForStableBounds
? outNonDecorBounds : newParentConfig.windowConfiguration.getAppBounds();
// TODO(b/182268157): Explore using only one type of parentBoundsWithInsets, either app
// bounds or stable bounds to unify aspect ratio logic.
diff --git a/services/core/java/com/android/server/wm/ActivityStarter.java b/services/core/java/com/android/server/wm/ActivityStarter.java
index 08aeedebf77d..72b854be74bd 100644
--- a/services/core/java/com/android/server/wm/ActivityStarter.java
+++ b/services/core/java/com/android/server/wm/ActivityStarter.java
@@ -1768,7 +1768,6 @@ class ActivityStarter {
if (!avoidMoveToFront() && (mService.mHomeProcess == null
|| mService.mHomeProcess.mUid != realCallingUid)
&& (prevTopTask != null && prevTopTask.isActivityTypeHomeOrRecents())
- && !targetTask.isActivityTypeHomeOrRecents()
&& r.mTransitionController.isTransientHide(targetTask)) {
mCanMoveToFrontCode = MOVE_TO_FRONT_AVOID_LEGACY;
}
@@ -2167,7 +2166,7 @@ class ActivityStarter {
// We don't need to start a new activity, and the client said not to do anything
// if that is the case, so this is it! And for paranoia, make sure we have
// correctly resumed the top activity.
- if (!mMovedToFront && mDoResume && !avoidMoveToFront()) {
+ if (!mMovedToFront && mDoResume) {
ProtoLog.d(WM_DEBUG_TASKS, "Bring to front target: %s from %s", mTargetRootTask,
targetTaskTop);
mTargetRootTask.moveToFront("intentActivityFound");
@@ -2196,7 +2195,7 @@ class ActivityStarter {
if (mMovedToFront) {
// We moved the task to front, use starting window to hide initial drawn delay.
targetTaskTop.showStartingWindow(true /* taskSwitch */);
- } else if (mDoResume && !avoidMoveToFront()) {
+ } else if (mDoResume) {
// Make sure the root task and its belonging display are moved to topmost.
mTargetRootTask.moveToFront("intentActivityFound");
}
@@ -2733,7 +2732,7 @@ class ActivityStarter {
// If a target task is specified, try to reuse that one
if (mOptions != null && mOptions.getLaunchTaskId() != INVALID_TASK_ID) {
Task launchTask = mRootWindowContainer.anyTaskForId(mOptions.getLaunchTaskId());
- if (launchTask != null) {
+ if (launchTask != null && launchTask.isLeafTask()) {
return launchTask;
}
return null;
diff --git a/services/core/java/com/android/server/wm/AsyncRotationController.java b/services/core/java/com/android/server/wm/AsyncRotationController.java
index 24d4be83c82b..a9450c4e8587 100644
--- a/services/core/java/com/android/server/wm/AsyncRotationController.java
+++ b/services/core/java/com/android/server/wm/AsyncRotationController.java
@@ -290,7 +290,7 @@ class AsyncRotationController extends FadeAnimationController implements Consume
}
// The insets position may be frozen by shouldFreezeInsetsPosition(), so refresh the
// position to the latest state when it is ready to show in new rotation.
- if (mTransitionOp == OP_APP_SWITCH) {
+ if (isSeamlessTransition()) {
for (int i = windowToken.getChildCount() - 1; i >= 0; i--) {
final WindowState w = windowToken.getChildAt(i);
final InsetsSourceProvider insetsProvider = w.getControllableInsetProvider();
@@ -506,11 +506,16 @@ class AsyncRotationController extends FadeAnimationController implements Consume
boolean shouldFreezeInsetsPosition(WindowState w) {
// Non-change transition (OP_APP_SWITCH) and METHOD_BLAST don't use screenshot so the
// insets should keep original position before the start transaction is applied.
- return mTransitionOp != OP_LEGACY && (mTransitionOp == OP_APP_SWITCH
+ return mTransitionOp != OP_LEGACY && (isSeamlessTransition()
|| TransitionController.SYNC_METHOD == BLASTSyncEngine.METHOD_BLAST)
&& !mIsStartTransactionCommitted && canBeAsync(w.mToken) && isTargetToken(w.mToken);
}
+ /** Returns true if there won't be a screen rotation animation (screenshot-based). */
+ private boolean isSeamlessTransition() {
+ return mTransitionOp == OP_APP_SWITCH || mTransitionOp == OP_CHANGE_MAY_SEAMLESS;
+ }
+
/**
* Returns the transaction which will be applied after the window redraws in new rotation.
* This is used to update the position of insets animation leash synchronously.
diff --git a/services/core/java/com/android/server/wm/LetterboxUiController.java b/services/core/java/com/android/server/wm/LetterboxUiController.java
index 16d7b4fb6eed..6e11e082cc07 100644
--- a/services/core/java/com/android/server/wm/LetterboxUiController.java
+++ b/services/core/java/com/android/server/wm/LetterboxUiController.java
@@ -1149,6 +1149,17 @@ final class LetterboxUiController {
}
boolean shouldApplyUserFullscreenOverride() {
+ // Do not override orientation to fullscreen for camera activities.
+ // Fixed-orientation activities are rarely tested in other orientations, and it often
+ // results in sideways or stretched previews. As the camera compat treatment targets
+ // fixed-orientation activities, overriding the orientation disables the treatment.
+ final DisplayContent displayContent = mActivityRecord.mDisplayContent;
+ if (displayContent != null && displayContent.mDisplayRotationCompatPolicy != null
+ && displayContent.mDisplayRotationCompatPolicy
+ .isCameraActive(mActivityRecord, /* mustBeFullscreen= */ true)) {
+ return false;
+ }
+
if (isUserFullscreenOverrideEnabled()) {
mUserAspectRatio = getUserMinAspectRatioOverrideCode();
diff --git a/services/core/java/com/android/server/wm/SnapshotPersistQueue.java b/services/core/java/com/android/server/wm/SnapshotPersistQueue.java
index 42ca7b44287e..16fcb097ca5c 100644
--- a/services/core/java/com/android/server/wm/SnapshotPersistQueue.java
+++ b/services/core/java/com/android/server/wm/SnapshotPersistQueue.java
@@ -348,6 +348,9 @@ class SnapshotPersistQueue {
+ bitmap.isMutable() + ") to (config=ARGB_8888, isMutable=false) failed.");
return false;
}
+ final int width = bitmap.getWidth();
+ final int height = bitmap.getHeight();
+ bitmap.recycle();
final File file = mPersistInfoProvider.getHighResolutionBitmapFile(mId, mUserId);
try {
@@ -365,8 +368,8 @@ class SnapshotPersistQueue {
}
final Bitmap lowResBitmap = Bitmap.createScaledBitmap(swBitmap,
- (int) (bitmap.getWidth() * mPersistInfoProvider.lowResScaleFactor()),
- (int) (bitmap.getHeight() * mPersistInfoProvider.lowResScaleFactor()),
+ (int) (width * mPersistInfoProvider.lowResScaleFactor()),
+ (int) (height * mPersistInfoProvider.lowResScaleFactor()),
true /* filter */);
swBitmap.recycle();
diff --git a/services/core/java/com/android/server/wm/TaskFragment.java b/services/core/java/com/android/server/wm/TaskFragment.java
index 26e4eaaedfe2..e03458462a06 100644
--- a/services/core/java/com/android/server/wm/TaskFragment.java
+++ b/services/core/java/com/android/server/wm/TaskFragment.java
@@ -40,8 +40,6 @@ import static android.os.Process.INVALID_UID;
import static android.os.Process.SYSTEM_UID;
import static android.os.UserHandle.USER_NULL;
import static android.view.Display.INVALID_DISPLAY;
-import static android.view.Surface.ROTATION_270;
-import static android.view.Surface.ROTATION_90;
import static android.view.WindowManager.LayoutParams.FLAG_DIM_BEHIND;
import static android.view.WindowManager.TRANSIT_CLOSE;
import static android.view.WindowManager.TRANSIT_FLAG_OPEN_BEHIND;
@@ -1241,7 +1239,7 @@ class TaskFragment extends WindowContainer<WindowContainer> {
// have any running activities, not starting one and not home stack.
shouldBeVisible = hasRunningActivities
|| (starting != null && starting.isDescendantOf(this))
- || isActivityTypeHome();
+ || (isActivityTypeHome() && !isEmbedded());
break;
}
@@ -2224,7 +2222,7 @@ class TaskFragment extends WindowContainer<WindowContainer> {
static class ConfigOverrideHint {
@Nullable DisplayInfo mTmpOverrideDisplayInfo;
@Nullable ActivityRecord.CompatDisplayInsets mTmpCompatInsets;
- boolean mUseOverrideInsetsForConfig;
+ boolean mUseOverrideInsetsForStableBounds;
}
void computeConfigResourceOverrides(@NonNull Configuration inOutConfig,
@@ -2257,11 +2255,11 @@ class TaskFragment extends WindowContainer<WindowContainer> {
@NonNull Configuration parentConfig, @Nullable ConfigOverrideHint overrideHint) {
DisplayInfo overrideDisplayInfo = null;
ActivityRecord.CompatDisplayInsets compatInsets = null;
- boolean useOverrideInsetsForConfig = false;
+ boolean useOverrideInsetsForStableBounds = false;
if (overrideHint != null) {
overrideDisplayInfo = overrideHint.mTmpOverrideDisplayInfo;
compatInsets = overrideHint.mTmpCompatInsets;
- useOverrideInsetsForConfig = overrideHint.mUseOverrideInsetsForConfig;
+ useOverrideInsetsForStableBounds = overrideHint.mUseOverrideInsetsForStableBounds;
if (overrideDisplayInfo != null) {
// Make sure the screen related configs can be computed by the provided
// display info.
@@ -2325,7 +2323,6 @@ class TaskFragment extends WindowContainer<WindowContainer> {
}
}
- boolean insetsOverrideApplied = false;
if (inOutConfig.screenWidthDp == Configuration.SCREEN_WIDTH_DP_UNDEFINED
|| inOutConfig.screenHeightDp == Configuration.SCREEN_HEIGHT_DP_UNDEFINED) {
if (!customContainerPolicy && WindowConfiguration.isFloating(windowingMode)) {
@@ -2342,7 +2339,7 @@ class TaskFragment extends WindowContainer<WindowContainer> {
// The non decor inset are areas that could never be removed in Honeycomb. See
// {@link WindowManagerPolicy#getNonDecorInsetsLw}.
calculateInsetFrames(mTmpNonDecorBounds, mTmpStableBounds, mTmpFullBounds, di,
- useOverrideInsetsForConfig);
+ useOverrideInsetsForStableBounds);
} else {
// Apply the given non-decor and stable insets to calculate the corresponding bounds
// for screen size of configuration.
@@ -2359,21 +2356,8 @@ class TaskFragment extends WindowContainer<WindowContainer> {
intersectWithInsetsIfFits(mTmpStableBounds, mTmpBounds,
compatInsets.mStableInsets[rotation]);
outAppBounds.set(mTmpNonDecorBounds);
- } else if (useOverrideInsetsForConfig) {
- final boolean rotated = (rotation == ROTATION_90 || rotation == ROTATION_270);
- final int dw = rotated ? mDisplayContent.mBaseDisplayHeight
- : mDisplayContent.mBaseDisplayWidth;
- final int dh = rotated ? mDisplayContent.mBaseDisplayWidth
- : mDisplayContent.mBaseDisplayHeight;
- final DisplayPolicy.DecorInsets.Info decorInsets = mDisplayContent
- .getDisplayPolicy().getDecorInsetsInfo(rotation, dw, dh);
- mTmpStableBounds.set(outAppBounds);
- mTmpStableBounds.inset(decorInsets.mOverrideConfigInsets);
- outAppBounds.inset(decorInsets.mOverrideNonDecorInsets);
- mTmpNonDecorBounds.set(outAppBounds);
- // Record the override apply to avoid duplicated check.
- insetsOverrideApplied = true;
} else {
+ // Set to app bounds because it excludes decor insets.
mTmpNonDecorBounds.set(outAppBounds);
mTmpStableBounds.set(outAppBounds);
}
@@ -2415,11 +2399,6 @@ class TaskFragment extends WindowContainer<WindowContainer> {
// from the parent task would result in applications loaded wrong resource.
inOutConfig.smallestScreenWidthDp =
Math.min(inOutConfig.screenWidthDp, inOutConfig.screenHeightDp);
- } else if (insetsOverrideApplied) {
- // The smallest width should also consider insets. If the insets are overridden,
- // use the overridden value.
- inOutConfig.smallestScreenWidthDp =
- Math.min(inOutConfig.screenWidthDp, inOutConfig.screenHeightDp);
}
// otherwise, it will just inherit
}
diff --git a/services/core/java/com/android/server/wm/TaskFragmentOrganizerController.java b/services/core/java/com/android/server/wm/TaskFragmentOrganizerController.java
index 24b533a23af6..c4e932abecd3 100644
--- a/services/core/java/com/android/server/wm/TaskFragmentOrganizerController.java
+++ b/services/core/java/com/android/server/wm/TaskFragmentOrganizerController.java
@@ -365,7 +365,8 @@ public class TaskFragmentOrganizerController extends ITaskFragmentOrganizerContr
@Nullable
TaskFragmentTransaction.Change prepareActivityReparentedToTask(
- @NonNull ActivityRecord activity) {
+ @NonNull ActivityRecord activity, @Nullable ActivityRecord nextFillTaskActivity,
+ @Nullable IBinder lastParentTfToken) {
if (activity.finishing) {
Slog.d(TAG, "Reparent activity=" + activity.token + " is finishing");
return null;
@@ -408,10 +409,21 @@ public class TaskFragmentOrganizerController extends ITaskFragmentOrganizerContr
}
ProtoLog.v(WM_DEBUG_WINDOW_ORGANIZER, "Activity=%s reparent to taskId=%d",
activity.token, task.mTaskId);
- return new TaskFragmentTransaction.Change(TYPE_ACTIVITY_REPARENTED_TO_TASK)
- .setTaskId(task.mTaskId)
- .setActivityIntent(trimIntent(activity.intent))
- .setActivityToken(activityToken);
+
+ final TaskFragmentTransaction.Change change =
+ new TaskFragmentTransaction.Change(TYPE_ACTIVITY_REPARENTED_TO_TASK)
+ .setTaskId(task.mTaskId)
+ .setActivityIntent(trimIntent(activity.intent))
+ .setActivityToken(activityToken);
+ if (lastParentTfToken != null) {
+ change.setTaskFragmentToken(lastParentTfToken);
+ }
+ // Only pass the activity token to the client if it belongs to the same process.
+ if (Flags.fixPipRestoreToOverlay() && nextFillTaskActivity != null
+ && nextFillTaskActivity.getPid() == mOrganizerPid) {
+ change.setOtherActivityToken(nextFillTaskActivity.token);
+ }
+ return change;
}
void dispatchTransaction(@NonNull TaskFragmentTransaction transaction) {
@@ -733,13 +745,13 @@ public class TaskFragmentOrganizerController extends ITaskFragmentOrganizerContr
}
void onActivityReparentedToTask(@NonNull ActivityRecord activity) {
+ final Task task = activity.getTask();
final ITaskFragmentOrganizer organizer;
if (activity.mLastTaskFragmentOrganizerBeforePip != null) {
// If the activity is previously embedded in an organized TaskFragment.
organizer = activity.mLastTaskFragmentOrganizerBeforePip;
} else {
// Find the topmost TaskFragmentOrganizer.
- final Task task = activity.getTask();
final TaskFragment[] organizedTf = new TaskFragment[1];
task.forAllLeafTaskFragments(tf -> {
if (tf.isOrganizedTaskFragment()) {
@@ -757,10 +769,24 @@ public class TaskFragmentOrganizerController extends ITaskFragmentOrganizerContr
Slog.w(TAG, "The last TaskFragmentOrganizer no longer exists");
return;
}
- addPendingEvent(new PendingTaskFragmentEvent.Builder(
+
+ final IBinder parentTfTokenBeforePip = activity.getLastEmbeddedParentTfTokenBeforePip();
+ final PendingTaskFragmentEvent.Builder builder = new PendingTaskFragmentEvent.Builder(
PendingTaskFragmentEvent.EVENT_ACTIVITY_REPARENTED_TO_TASK, organizer)
.setActivity(activity)
- .build());
+ .setTaskFragmentToken(activity.getLastEmbeddedParentTfTokenBeforePip());
+
+ // Sets the next activity behinds the reparented Activity that's also not in the last
+ // embedded parent TF.
+ final ActivityRecord candidateAssociatedActivity = task.getActivity(
+ ar -> ar != activity && !ar.finishing
+ && ar.getTaskFragment().getFragmentToken() != parentTfTokenBeforePip);
+ if (candidateAssociatedActivity != null && (!candidateAssociatedActivity.isEmbedded()
+ || candidateAssociatedActivity.getTaskFragment().fillsParent())) {
+ builder.setOtherActivity(candidateAssociatedActivity);
+ }
+
+ addPendingEvent(builder.build());
}
void onTaskFragmentParentInfoChanged(@NonNull ITaskFragmentOrganizer organizer,
@@ -889,11 +915,16 @@ public class TaskFragmentOrganizerController extends ITaskFragmentOrganizerContr
@Nullable
private final TaskFragment mTaskFragment;
@Nullable
+ private final IBinder mTaskFragmentToken;
+ @Nullable
private final IBinder mErrorCallbackToken;
@Nullable
private final Throwable mException;
@Nullable
private final ActivityRecord mActivity;
+ // An additional Activity that's needed to send back to the client other than the mActivity.
+ @Nullable
+ private final ActivityRecord mOtherActivity;
@Nullable
private final Task mTask;
// Set when the event is deferred due to the host task is invisible. The defer time will
@@ -905,17 +936,21 @@ public class TaskFragmentOrganizerController extends ITaskFragmentOrganizerContr
private PendingTaskFragmentEvent(@EventType int eventType,
ITaskFragmentOrganizer taskFragmentOrg,
@Nullable TaskFragment taskFragment,
+ @Nullable IBinder taskFragmentToken,
@Nullable IBinder errorCallbackToken,
@Nullable Throwable exception,
@Nullable ActivityRecord activity,
+ @Nullable ActivityRecord otherActivity,
@Nullable Task task,
@TaskFragmentOperation.OperationType int opType) {
mEventType = eventType;
mTaskFragmentOrg = taskFragmentOrg;
mTaskFragment = taskFragment;
+ mTaskFragmentToken = taskFragmentToken;
mErrorCallbackToken = errorCallbackToken;
mException = exception;
mActivity = activity;
+ mOtherActivity = otherActivity;
mTask = task;
mOpType = opType;
}
@@ -943,12 +978,16 @@ public class TaskFragmentOrganizerController extends ITaskFragmentOrganizerContr
@Nullable
private TaskFragment mTaskFragment;
@Nullable
+ private IBinder mTaskFragmentToken;
+ @Nullable
private IBinder mErrorCallbackToken;
@Nullable
private Throwable mException;
@Nullable
private ActivityRecord mActivity;
@Nullable
+ private ActivityRecord mOtherActivity;
+ @Nullable
private Task mTask;
@TaskFragmentOperation.OperationType
private int mOpType;
@@ -963,6 +1002,11 @@ public class TaskFragmentOrganizerController extends ITaskFragmentOrganizerContr
return this;
}
+ Builder setTaskFragmentToken(@Nullable IBinder fragmentToken) {
+ mTaskFragmentToken = fragmentToken;
+ return this;
+ }
+
Builder setErrorCallbackToken(@Nullable IBinder errorCallbackToken) {
mErrorCallbackToken = errorCallbackToken;
return this;
@@ -978,6 +1022,11 @@ public class TaskFragmentOrganizerController extends ITaskFragmentOrganizerContr
return this;
}
+ Builder setOtherActivity(@NonNull ActivityRecord otherActivity) {
+ mOtherActivity = otherActivity;
+ return this;
+ }
+
Builder setTask(@NonNull Task task) {
mTask = requireNonNull(task);
return this;
@@ -990,7 +1039,8 @@ public class TaskFragmentOrganizerController extends ITaskFragmentOrganizerContr
PendingTaskFragmentEvent build() {
return new PendingTaskFragmentEvent(mEventType, mTaskFragmentOrg, mTaskFragment,
- mErrorCallbackToken, mException, mActivity, mTask, mOpType);
+ mTaskFragmentToken, mErrorCallbackToken, mException, mActivity,
+ mOtherActivity, mTask, mOpType);
}
}
}
@@ -1191,7 +1241,8 @@ public class TaskFragmentOrganizerController extends ITaskFragmentOrganizerContr
return state.prepareTaskFragmentError(event.mErrorCallbackToken, taskFragment,
event.mOpType, event.mException);
case PendingTaskFragmentEvent.EVENT_ACTIVITY_REPARENTED_TO_TASK:
- return state.prepareActivityReparentedToTask(event.mActivity);
+ return state.prepareActivityReparentedToTask(event.mActivity, event.mOtherActivity,
+ event.mTaskFragmentToken);
default:
throw new IllegalArgumentException("Unknown TaskFragmentEvent=" + event.mEventType);
}
diff --git a/services/core/java/com/android/server/wm/TransitionController.java b/services/core/java/com/android/server/wm/TransitionController.java
index ce53290da49c..2dc439da992d 100644
--- a/services/core/java/com/android/server/wm/TransitionController.java
+++ b/services/core/java/com/android/server/wm/TransitionController.java
@@ -492,6 +492,27 @@ class TransitionController {
return false;
}
+ /** Returns {@code true} if the display contains a transient-launch transition. */
+ boolean hasTransientLaunch(@NonNull DisplayContent dc) {
+ if (mCollectingTransition != null && mCollectingTransition.hasTransientLaunch()
+ && mCollectingTransition.isOnDisplay(dc)) {
+ return true;
+ }
+ for (int i = mWaitingTransitions.size() - 1; i >= 0; --i) {
+ final Transition transition = mWaitingTransitions.get(i);
+ if (transition.hasTransientLaunch() && transition.isOnDisplay(dc)) {
+ return true;
+ }
+ }
+ for (int i = mPlayingTransitions.size() - 1; i >= 0; --i) {
+ final Transition transition = mPlayingTransitions.get(i);
+ if (transition.hasTransientLaunch() && transition.isOnDisplay(dc)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
boolean isTransientHide(@NonNull Task task) {
if (mCollectingTransition != null && mCollectingTransition.isInTransientHide(task)) {
return true;
diff --git a/services/core/java/com/android/server/wm/WallpaperController.java b/services/core/java/com/android/server/wm/WallpaperController.java
index 65e17615f775..3e43f5a2da66 100644
--- a/services/core/java/com/android/server/wm/WallpaperController.java
+++ b/services/core/java/com/android/server/wm/WallpaperController.java
@@ -165,7 +165,7 @@ class WallpaperController {
|| (w.mActivityRecord != null && !w.mActivityRecord.fillsParent());
}
} else if (w.hasWallpaper() && mService.mPolicy.isKeyguardHostWindow(w.mAttrs)
- && w.mTransitionController.isTransitionOnDisplay(mDisplayContent)) {
+ && w.mTransitionController.hasTransientLaunch(mDisplayContent)) {
// If we have no candidates at all, notification shade is allowed to be the target
// of last resort even if it has not been made visible yet.
if (DEBUG_WALLPAPER) Slog.v(TAG, "Found keyguard as wallpaper target: " + w);
diff --git a/services/core/java/com/android/server/wm/WindowState.java b/services/core/java/com/android/server/wm/WindowState.java
index 8fb83fa0e88c..90c287c056e8 100644
--- a/services/core/java/com/android/server/wm/WindowState.java
+++ b/services/core/java/com/android/server/wm/WindowState.java
@@ -224,6 +224,7 @@ import android.view.IWindowId;
import android.view.InputChannel;
import android.view.InputWindowHandle;
import android.view.InsetsSource;
+import android.view.InsetsSourceControl;
import android.view.InsetsState;
import android.view.Surface;
import android.view.Surface.Rotation;
@@ -432,6 +433,10 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
/** @see #isLastConfigReportedToClient() */
private boolean mLastConfigReportedToClient;
+ // TODO(b/339380439): Ensure to use the same object for IWindowSession#relayout
+ private final InsetsSourceControl.Array mLastReportedActiveControls =
+ new InsetsSourceControl.Array();
+
private final Configuration mTempConfiguration = new Configuration();
/**
@@ -3813,9 +3818,9 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
}
final InsetsStateController stateController =
getDisplayContent().getInsetsStateController();
+ mLastReportedActiveControls.set(stateController.getControlsForDispatch(this));
try {
- mClient.insetsControlChanged(getCompatInsetsState(),
- stateController.getControlsForDispatch(this));
+ mClient.insetsControlChanged(getCompatInsetsState(), mLastReportedActiveControls);
} catch (RemoteException e) {
Slog.w(TAG, "Failed to deliver inset control state change to w=" + this, e);
}
diff --git a/services/core/jni/com_android_server_display_DisplayControl.cpp b/services/core/jni/com_android_server_display_DisplayControl.cpp
index 22c0f730ad7d..6613a250bd71 100644
--- a/services/core/jni/com_android_server_display_DisplayControl.cpp
+++ b/services/core/jni/com_android_server_display_DisplayControl.cpp
@@ -23,20 +23,22 @@
namespace android {
-static jobject nativeCreateDisplay(JNIEnv* env, jclass clazz, jstring nameObj, jboolean secure,
- jstring uniqueIdStr, jfloat requestedRefreshRate) {
+static jobject nativeCreateVirtualDisplay(JNIEnv* env, jclass clazz, jstring nameObj,
+ jboolean secure, jstring uniqueIdStr,
+ jfloat requestedRefreshRate) {
const ScopedUtfChars name(env, nameObj);
const ScopedUtfChars uniqueId(env, uniqueIdStr);
- sp<IBinder> token(SurfaceComposerClient::createDisplay(String8(name.c_str()), bool(secure),
- std::string(uniqueId.c_str()),
- requestedRefreshRate));
+ sp<IBinder> token(SurfaceComposerClient::createVirtualDisplay(std::string(name.c_str()),
+ bool(secure),
+ std::string(uniqueId.c_str()),
+ requestedRefreshRate));
return javaObjectForIBinder(env, token);
}
-static void nativeDestroyDisplay(JNIEnv* env, jclass clazz, jobject tokenObj) {
+static void nativeDestroyVirtualDisplay(JNIEnv* env, jclass clazz, jobject tokenObj) {
sp<IBinder> token(ibinderForJavaObject(env, tokenObj));
if (token == NULL) return;
- SurfaceComposerClient::destroyDisplay(token);
+ SurfaceComposerClient::destroyVirtualDisplay(token);
}
static void nativeOverrideHdrTypes(JNIEnv* env, jclass clazz, jobject tokenObject,
@@ -180,10 +182,10 @@ static jobject nativeGetPhysicalDisplayToken(JNIEnv* env, jclass clazz, jlong ph
static const JNINativeMethod sDisplayMethods[] = {
// clang-format off
- {"nativeCreateDisplay", "(Ljava/lang/String;ZLjava/lang/String;F)Landroid/os/IBinder;",
- (void*)nativeCreateDisplay },
- {"nativeDestroyDisplay", "(Landroid/os/IBinder;)V",
- (void*)nativeDestroyDisplay },
+ {"nativeCreateVirtualDisplay", "(Ljava/lang/String;ZLjava/lang/String;F)Landroid/os/IBinder;",
+ (void*)nativeCreateVirtualDisplay },
+ {"nativeDestroyVirtualDisplay", "(Landroid/os/IBinder;)V",
+ (void*)nativeDestroyVirtualDisplay },
{"nativeOverrideHdrTypes", "(Landroid/os/IBinder;[I)V",
(void*)nativeOverrideHdrTypes },
{"nativeGetPhysicalDisplayIds", "()[J",
diff --git a/services/core/jni/com_android_server_input_InputManagerService.cpp b/services/core/jni/com_android_server_input_InputManagerService.cpp
index 97f1e19e35b1..b19de189af5a 100644
--- a/services/core/jni/com_android_server_input_InputManagerService.cpp
+++ b/services/core/jni/com_android_server_input_InputManagerService.cpp
@@ -601,7 +601,7 @@ void NativeInputManager::getReaderConfiguration(InputReaderConfiguration* outCon
// Original data: [{'inputPort1': '1'}, {'inputPort2': '2'}]
// Received data: ['inputPort1', '1', 'inputPort2', '2']
// So we unpack accordingly here.
- outConfig->portAssociations.clear();
+ outConfig->inputPortToDisplayPortAssociations.clear();
jobjectArray portAssociations = jobjectArray(env->CallObjectMethod(mServiceObj,
gServiceClassInfo.getInputPortAssociations));
if (!checkAndClearExceptionFromCallback(env, "getInputPortAssociations") && portAssociations) {
@@ -618,16 +618,16 @@ void NativeInputManager::getReaderConfiguration(InputReaderConfiguration* outCon
displayPortStr.c_str());
continue;
}
- outConfig->portAssociations.insert({inputPort, displayPort});
+ outConfig->inputPortToDisplayPortAssociations.insert({inputPort, displayPort});
}
env->DeleteLocalRef(portAssociations);
}
- outConfig->uniqueIdAssociationsByPort = readMapFromInterleavedJavaArray<
+ outConfig->inputPortToDisplayUniqueIdAssociations = readMapFromInterleavedJavaArray<
std::string>(gServiceClassInfo.getInputUniqueIdAssociationsByPort,
"getInputUniqueIdAssociationsByPort");
- outConfig->uniqueIdAssociationsByDescriptor = readMapFromInterleavedJavaArray<
+ outConfig->inputDeviceDescriptorToDisplayUniqueIdAssociations = readMapFromInterleavedJavaArray<
std::string>(gServiceClassInfo.getInputUniqueIdAssociationsByDescriptor,
"getInputUniqueIdAssociationsByDescriptor");
@@ -2451,12 +2451,6 @@ static void nativeMonitor(JNIEnv* env, jobject nativeImplObj) {
im->getInputManager()->getDispatcher().monitor();
}
-static jboolean nativeIsInputDeviceEnabled(JNIEnv* env, jobject nativeImplObj, jint deviceId) {
- NativeInputManager* im = getNativeInputManager(env, nativeImplObj);
-
- return im->getInputManager()->getReader().isInputDeviceEnabled(deviceId);
-}
-
static void nativeEnableInputDevice(JNIEnv* env, jobject nativeImplObj, jint deviceId) {
NativeInputManager* im = getNativeInputManager(env, nativeImplObj);
@@ -2798,7 +2792,6 @@ static const JNINativeMethod gInputManagerMethods[] = {
{"sysfsNodeChanged", "(Ljava/lang/String;)V", (void*)nativeSysfsNodeChanged},
{"dump", "()Ljava/lang/String;", (void*)nativeDump},
{"monitor", "()V", (void*)nativeMonitor},
- {"isInputDeviceEnabled", "(I)Z", (void*)nativeIsInputDeviceEnabled},
{"enableInputDevice", "(I)V", (void*)nativeEnableInputDevice},
{"disableInputDevice", "(I)V", (void*)nativeDisableInputDevice},
{"reloadPointerIcons", "()V", (void*)nativeReloadPointerIcons},
diff --git a/services/devicepolicy/java/com/android/server/devicepolicy/NonRequiredPackageDeleteObserver.java b/services/devicepolicy/java/com/android/server/devicepolicy/NonRequiredPackageDeleteObserver.java
index 0e448cdb244c..a1bf0401d001 100644
--- a/services/devicepolicy/java/com/android/server/devicepolicy/NonRequiredPackageDeleteObserver.java
+++ b/services/devicepolicy/java/com/android/server/devicepolicy/NonRequiredPackageDeleteObserver.java
@@ -25,7 +25,6 @@ import android.util.Slog;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
-import java.util.concurrent.atomic.AtomicInteger;
/**
* Awaits the deletion of all the non-required apps.
@@ -33,38 +32,38 @@ import java.util.concurrent.atomic.AtomicInteger;
final class NonRequiredPackageDeleteObserver extends IPackageDeleteObserver.Stub {
private static final int PACKAGE_DELETE_TIMEOUT_SEC = 30;
- private final AtomicInteger mPackageCount = new AtomicInteger(/* initialValue= */ 0);
private final CountDownLatch mLatch;
- private boolean mSuccess;
+ private boolean mFailed = false;
NonRequiredPackageDeleteObserver(int packageCount) {
this.mLatch = new CountDownLatch(packageCount);
- this.mPackageCount.set(packageCount);
}
@Override
public void packageDeleted(String packageName, int returnCode) {
if (returnCode != PackageManager.DELETE_SUCCEEDED) {
Slog.e(LOG_TAG, "Failed to delete package: " + packageName);
- mLatch.notifyAll();
- return;
- }
- int currentPackageCount = mPackageCount.decrementAndGet();
- if (currentPackageCount == 0) {
- mSuccess = true;
- Slog.i(LOG_TAG, "All non-required system apps with launcher icon, "
- + "and all disallowed apps have been uninstalled.");
+ mFailed = true;
}
mLatch.countDown();
}
public boolean awaitPackagesDeletion() {
try {
- mLatch.await(PACKAGE_DELETE_TIMEOUT_SEC, TimeUnit.SECONDS);
+ if (mLatch.await(PACKAGE_DELETE_TIMEOUT_SEC, TimeUnit.SECONDS)) {
+ if (!mFailed) {
+ Slog.i(LOG_TAG, "All non-required system apps with launcher icon, "
+ + "and all disallowed apps have been uninstalled.");
+ }
+ return !mFailed;
+ } else {
+ Slog.i(LOG_TAG, "Waiting time elapsed before all package deletion finished");
+ return false;
+ }
} catch (InterruptedException e) {
Log.w(LOG_TAG, "Interrupted while waiting for package deletion", e);
Thread.currentThread().interrupt();
+ return false;
}
- return mSuccess;
}
}
diff --git a/services/profcollect/src/com/android/server/profcollect/ProfcollectForwardingService.java b/services/profcollect/src/com/android/server/profcollect/ProfcollectForwardingService.java
index 54d101a3c1cf..488fe57cf6f8 100644
--- a/services/profcollect/src/com/android/server/profcollect/ProfcollectForwardingService.java
+++ b/services/profcollect/src/com/android/server/profcollect/ProfcollectForwardingService.java
@@ -63,6 +63,9 @@ public final class ProfcollectForwardingService extends SystemService {
"com.android.server.profcollect.UPLOAD_PROFILES";
private static final long BG_PROCESS_INTERVAL = TimeUnit.HOURS.toMillis(4); // every 4 hours.
+ private int mUsageSetting;
+ private boolean mUploadEnabled;
+
private IProfCollectd mIProfcollect;
private static ProfcollectForwardingService sSelfService;
private final Handler mHandler = new ProfcollectdHandler(IoThread.getHandler().getLooper());
@@ -78,7 +81,7 @@ public final class ProfcollectForwardingService extends SystemService {
public void onReceive(Context context, Intent intent) {
if (INTENT_UPLOAD_PROFILES.equals(intent.getAction())) {
Log.d(LOG_TAG, "Received broadcast to pack and upload reports");
- packAndUploadReport();
+ createAndUploadReport(sSelfService);
}
}
};
@@ -91,6 +94,17 @@ public final class ProfcollectForwardingService extends SystemService {
}
sSelfService = this;
+ // Get "Usage & diagnostics" checkbox status. 1 is for enabled, 0 is for disabled.
+ try {
+ mUsageSetting = Settings.Global.getInt(context.getContentResolver(), "multi_cb");
+ } catch (SettingNotFoundException e) {
+ Log.e(LOG_TAG, "Usage setting not found: " + e.getMessage());
+ mUsageSetting = -1;
+ }
+
+ mUploadEnabled =
+ context.getResources().getBoolean(R.bool.config_profcollectReportUploaderEnabled);
+
final IntentFilter filter = new IntentFilter();
filter.addAction(INTENT_UPLOAD_PROFILES);
context.registerReceiver(mBroadcastReceiver, filter, Context.RECEIVER_NOT_EXPORTED);
@@ -221,7 +235,6 @@ public final class ProfcollectForwardingService extends SystemService {
*/
public static void schedule(Context context) {
JobScheduler js = context.getSystemService(JobScheduler.class);
-
js.schedule(new JobInfo.Builder(JOB_IDLE_PROCESS, JOB_SERVICE_NAME)
.setRequiresDeviceIdle(true)
.setRequiresCharging(true)
@@ -235,19 +248,7 @@ public final class ProfcollectForwardingService extends SystemService {
if (DEBUG) {
Log.d(LOG_TAG, "Starting background process job");
}
-
- BackgroundThread.get().getThreadHandler().post(
- () -> {
- try {
- if (sSelfService.mIProfcollect == null) {
- return;
- }
- sSelfService.mIProfcollect.process();
- } catch (RemoteException e) {
- Log.e(LOG_TAG, "Failed to process profiles in background: "
- + e.getMessage());
- }
- });
+ createAndUploadReport(sSelfService);
jobFinished(params, false);
return true;
}
@@ -357,7 +358,7 @@ public final class ProfcollectForwardingService extends SystemService {
}
if (status == UpdateEngine.UpdateStatusConstants.UPDATED_NEED_REBOOT) {
- packAndUploadReport();
+ createAndUploadReport(sSelfService);
}
}
@@ -368,41 +369,27 @@ public final class ProfcollectForwardingService extends SystemService {
});
}
- private void packAndUploadReport() {
- if (mIProfcollect == null) {
+ private static void createAndUploadReport(ProfcollectForwardingService pfs) {
+ String reportName;
+ try {
+ reportName = pfs.mIProfcollect.report(pfs.mUsageSetting) + ".zip";
+ } catch (RemoteException e) {
+ Log.e(LOG_TAG, "Failed to create report: " + e.getMessage());
+ return;
+ }
+ if (!pfs.mUploadEnabled) {
+ Log.i(LOG_TAG, "Upload is not enabled.");
return;
}
-
- Context context = getContext();
BackgroundThread.get().getThreadHandler().post(() -> {
- try {
- int usageSetting = -1;
- try {
- // Get "Usage & diagnostics" checkbox status. 1 is for enabled, 0 is for
- // disabled.
- usageSetting = Settings.Global.getInt(context.getContentResolver(), "multi_cb");
- } catch (SettingNotFoundException e) {
- Log.i(LOG_TAG, "Usage setting not found: " + e.getMessage());
- }
-
- // Prepare profile report
- String reportName = mIProfcollect.report(usageSetting) + ".zip";
-
- if (!context.getResources().getBoolean(
- R.bool.config_profcollectReportUploaderEnabled)) {
- Log.i(LOG_TAG, "Upload is not enabled.");
- return;
- }
-
- // Upload the report
- Intent intent = new Intent()
- .setPackage("com.android.shell")
- .setAction("com.android.shell.action.PROFCOLLECT_UPLOAD")
- .putExtra("filename", reportName);
- context.sendBroadcast(intent);
- } catch (RemoteException e) {
- Log.e(LOG_TAG, "Failed to upload report: " + e.getMessage());
- }
+ Intent intent = new Intent()
+ .setPackage("com.android.shell")
+ .setAction("com.android.shell.action.PROFCOLLECT_UPLOAD")
+ .putExtra("filename", reportName);
+ pfs.getContext().sendBroadcast(intent);
});
+ if (DEBUG) {
+ Log.d(LOG_TAG, "Sent report for upload.");
+ }
}
}
diff --git a/services/tests/PackageManagerServiceTests/server/Android.bp b/services/tests/PackageManagerServiceTests/server/Android.bp
index ea7bb8b4a1d1..a738acb299c1 100644
--- a/services/tests/PackageManagerServiceTests/server/Android.bp
+++ b/services/tests/PackageManagerServiceTests/server/Android.bp
@@ -105,6 +105,7 @@ android_test {
":PackageParserTestApp5",
":PackageParserTestApp6",
":PackageParserTestApp7",
+ ":PackageParserTestApp8",
],
resource_zips: [":PackageManagerServiceServerTests_apks_as_resources"],
diff --git a/services/tests/PackageManagerServiceTests/server/src/com/android/server/pm/PackageParserTest.java b/services/tests/PackageManagerServiceTests/server/src/com/android/server/pm/PackageParserTest.java
index a0e0e1ef36ee..5da202f109d4 100644
--- a/services/tests/PackageManagerServiceTests/server/src/com/android/server/pm/PackageParserTest.java
+++ b/services/tests/PackageManagerServiceTests/server/src/com/android/server/pm/PackageParserTest.java
@@ -101,6 +101,7 @@ import com.android.internal.pm.pkg.component.ParsedServiceImpl;
import com.android.internal.pm.pkg.component.ParsedUsesPermission;
import com.android.internal.pm.pkg.component.ParsedUsesPermissionImpl;
import com.android.internal.pm.pkg.parsing.ParsingPackage;
+import com.android.internal.pm.pkg.parsing.ParsingPackageUtils;
import com.android.internal.util.ArrayUtils;
import com.android.server.pm.parsing.PackageCacher;
import com.android.server.pm.parsing.PackageInfoUtils;
@@ -126,6 +127,7 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
+import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
@@ -154,6 +156,7 @@ public class PackageParserTest {
private static final String TEST_APP5_APK = "PackageParserTestApp5.apk";
private static final String TEST_APP6_APK = "PackageParserTestApp6.apk";
private static final String TEST_APP7_APK = "PackageParserTestApp7.apk";
+ private static final String TEST_APP8_APK = "PackageParserTestApp8.apk";
private static final String PACKAGE_NAME = "com.android.servicestests.apps.packageparserapp";
@Before
@@ -814,6 +817,39 @@ public class PackageParserTest {
}
}
+ @Test
+ @RequiresFlagsEnabled(android.content.res.Flags.FLAG_MANIFEST_FLAGGING)
+ public void testParseWithFeatureFlagAttributes() throws Exception {
+ final File testFile = extractFile(TEST_APP8_APK);
+ try (PackageParser2 parser = new TestPackageParser2()) {
+ Map<String, Boolean> flagValues = new HashMap<>();
+ flagValues.put("my.flag1", true);
+ flagValues.put("my.flag2", false);
+ flagValues.put("my.flag3", false);
+ flagValues.put("my.flag4", true);
+ ParsingPackageUtils.getAconfigFlags().addFlagValuesForTesting(flagValues);
+
+ // The manifest has:
+ // <permission android:name="PERM1" android:featureFlag="my.flag1 " />
+ // <permission android:name="PERM2" android:featureFlag=" !my.flag2" />
+ // <permission android:name="PERM3" android:featureFlag="my.flag3" />
+ // <permission android:name="PERM4" android:featureFlag="!my.flag4" />
+ // <permission android:name="PERM5" android:featureFlag="unknown.flag" />
+ // Therefore with the above flag values, only PERM1 and PERM2 should be present.
+
+ final ParsedPackage pkg = parser.parsePackage(testFile, 0, false);
+ List<String> permissionNames =
+ pkg.getPermissions().stream().map(ParsedComponent::getName).toList();
+ assertThat(permissionNames).contains(PACKAGE_NAME + ".PERM1");
+ assertThat(permissionNames).contains(PACKAGE_NAME + ".PERM2");
+ assertThat(permissionNames).doesNotContain(PACKAGE_NAME + ".PERM3");
+ assertThat(permissionNames).doesNotContain(PACKAGE_NAME + ".PERM4");
+ assertThat(permissionNames).doesNotContain(PACKAGE_NAME + ".PERM5");
+ } finally {
+ testFile.delete();
+ }
+ }
+
/**
* A subclass of package parser that adds a "cache_" prefix to the package name for the cached
* results. This is used by tests to tell if a ParsedPackage is generated from the cache or not.
diff --git a/services/tests/displayservicetests/src/com/android/server/display/DisplayManagerServiceTest.java b/services/tests/displayservicetests/src/com/android/server/display/DisplayManagerServiceTest.java
index 54b2d4dd1429..8844e6cc3a2c 100644
--- a/services/tests/displayservicetests/src/com/android/server/display/DisplayManagerServiceTest.java
+++ b/services/tests/displayservicetests/src/com/android/server/display/DisplayManagerServiceTest.java
@@ -709,6 +709,64 @@ public class DisplayManagerServiceTest {
assertTrue((ddi.flags & DisplayDeviceInfo.FLAG_OWN_FOCUS) == 0);
}
+ @Test
+ public void testCreateVirtualDisplayOwnFocus_checkDisplayDeviceInfo() throws RemoteException {
+ DisplayManagerService displayManager =
+ new DisplayManagerService(mContext, mBasicInjector);
+ registerDefaultDisplays(displayManager);
+
+ // This is effectively the DisplayManager service published to ServiceManager.
+ DisplayManagerService.BinderService bs = displayManager.new BinderService();
+
+ final String uniqueId = "uniqueId --- Own Focus Test -- checkDisplayDeviceInfo";
+ float refreshRate = 60.0f;
+ int width = 600;
+ int height = 800;
+ int dpi = 320;
+ int flags = DisplayManager.VIRTUAL_DISPLAY_FLAG_OWN_FOCUS;
+
+ when(mContext.checkCallingPermission(ADD_TRUSTED_DISPLAY)).thenReturn(
+ PackageManager.PERMISSION_GRANTED);
+ when(mMockAppToken.asBinder()).thenReturn(mMockAppToken);
+ final VirtualDisplayConfig.Builder builder = new VirtualDisplayConfig.Builder(
+ VIRTUAL_DISPLAY_NAME, width, height, dpi);
+ builder.setFlags(flags);
+ builder.setUniqueId(uniqueId);
+ builder.setRequestedRefreshRate(refreshRate);
+
+ // Create a virtual display in its own display group.
+ final VirtualDisplayConfig ownerDisplayConfig = builder.build();
+ int displayId = bs.createVirtualDisplay(ownerDisplayConfig, /* callback= */ mMockAppToken,
+ /* projection= */ null, PACKAGE_NAME);
+ verify(mMockProjectionService, never()).setContentRecordingSession(any(),
+ nullable(IMediaProjection.class));
+
+ DisplayInfo displayInfo = bs.getDisplayInfo(displayId);
+ assertNotNull(displayInfo);
+ assertTrue((displayInfo.flags & DisplayDeviceInfo.FLAG_OWN_FOCUS) == 0);
+ final String displayUniqueId = VirtualDisplayAdapter.generateDisplayUniqueId(
+ PACKAGE_NAME, Process.myUid(), ownerDisplayConfig);
+ assertEquals(displayInfo.uniqueId, displayUniqueId);
+ assertEquals(displayInfo.name, VIRTUAL_DISPLAY_NAME);
+ assertEquals(displayInfo.ownerPackageName, PACKAGE_NAME);
+ assertEquals(displayInfo.getRefreshRate(), refreshRate, 0.1f);
+
+ performTraversalInternal(displayManager);
+
+ // Flush the handler.
+ displayManager.getDisplayHandler().runWithScissors(() -> {}, /* now= */ 0);
+
+ DisplayDeviceInfo ddi = displayManager.getDisplayDeviceInfoInternal(displayId);
+ assertNotNull(ddi);
+ assertTrue((ddi.flags & DisplayDeviceInfo.FLAG_OWN_FOCUS) == 0);
+ assertEquals(ddi.width, width);
+ assertEquals(ddi.height, height);
+ assertEquals(ddi.name, displayInfo.name);
+ assertEquals(ddi.ownerPackageName, displayInfo.ownerPackageName);
+ assertEquals(ddi.uniqueId, displayInfo.uniqueId);
+ assertEquals(ddi.renderFrameRate, displayInfo.getRefreshRate(), 0.1f);
+ }
+
/**
* Tests that the virtual display is created along-side the default display.
*/
diff --git a/services/tests/displayservicetests/src/com/android/server/display/VirtualDisplayAdapterTest.java b/services/tests/displayservicetests/src/com/android/server/display/VirtualDisplayAdapterTest.java
index c01b15c17483..81e6cc3f546b 100644
--- a/services/tests/displayservicetests/src/com/android/server/display/VirtualDisplayAdapterTest.java
+++ b/services/tests/displayservicetests/src/com/android/server/display/VirtualDisplayAdapterTest.java
@@ -18,12 +18,14 @@ package com.android.server.display;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.when;
import android.content.Context;
import android.hardware.display.IVirtualDisplayCallback;
import android.hardware.display.VirtualDisplayConfig;
import android.os.IBinder;
+import android.os.Process;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.SmallTest;
@@ -88,6 +90,25 @@ public class VirtualDisplayAdapterTest {
}
@Test
+ public void testCreatesVirtualDisplay_checkGeneratedDisplayUniqueIdPrefix() {
+ VirtualDisplayConfig config = new VirtualDisplayConfig.Builder("test", /* width= */ 1,
+ /* height= */ 1, /* densityDpi= */ 1).build();
+
+ final String packageName = "testpackage";
+ final String displayUniqueId = VirtualDisplayAdapter.generateDisplayUniqueId(
+ packageName, Process.myUid(), config);
+
+ DisplayDevice result = mVirtualDisplayAdapter.createVirtualDisplayLocked(
+ mMockCallback, /* projection= */ null, /* ownerUid= */ 10,
+ packageName, displayUniqueId, /* surface= */ null, /* flags= */ 0, config);
+
+ assertNotNull(result);
+
+ final String uniqueId = result.getUniqueId();
+ assertTrue(uniqueId.startsWith(VirtualDisplayAdapter.UNIQUE_ID_PREFIX + packageName));
+ }
+
+ @Test
public void testDoesNotCreateVirtualDisplayForSameCallback() {
VirtualDisplayConfig config1 = new VirtualDisplayConfig.Builder("test", /* width= */ 1,
/* height= */ 1, /* densityDpi= */ 1).build();
diff --git a/services/tests/displayservicetests/src/com/android/server/display/brightness/strategy/AutomaticBrightnessStrategyTest.java b/services/tests/displayservicetests/src/com/android/server/display/brightness/strategy/AutomaticBrightnessStrategyTest.java
index 19bff56a4b29..d19f47951df1 100644
--- a/services/tests/displayservicetests/src/com/android/server/display/brightness/strategy/AutomaticBrightnessStrategyTest.java
+++ b/services/tests/displayservicetests/src/com/android/server/display/brightness/strategy/AutomaticBrightnessStrategyTest.java
@@ -395,7 +395,7 @@ public class AutomaticBrightnessStrategyTest {
automaticBrightnessController);
assertEquals(automaticScreenBrightness,
mAutomaticBrightnessStrategy.getAutomaticScreenBrightness(
- new BrightnessEvent(DISPLAY_ID)), 0.0f);
+ new BrightnessEvent(DISPLAY_ID), false), 0.0f);
assertEquals(automaticScreenBrightness,
mAutomaticBrightnessStrategy.getAutomaticScreenBrightnessBasedOnLastUsedLux(
new BrightnessEvent(DISPLAY_ID)), 0.0f);
@@ -461,8 +461,12 @@ public class AutomaticBrightnessStrategyTest {
}
@Test
- public void isAutoBrightnessValid_returnsTrueWhenBrightnessIsValid() {
+ public void isAutoBrightnessValid_returnsTrueWhenBrightnessIsValid_adjustsAutoBrightness()
+ throws Settings.SettingNotFoundException {
+ float adjustment = 0.1f;
mAutomaticBrightnessStrategy.setUseAutoBrightness(true);
+ when(mAutomaticBrightnessController.getAutomaticScreenBrightnessAdjustment())
+ .thenReturn(0.1f);
mAutomaticBrightnessStrategy.setAutoBrightnessState(Display.STATE_ON, true,
BrightnessReason.REASON_UNKNOWN,
DisplayManagerInternal.DisplayPowerRequest.POLICY_BRIGHT, 0.1f,
@@ -470,6 +474,11 @@ public class AutomaticBrightnessStrategyTest {
when(mAutomaticBrightnessController.getAutomaticScreenBrightness(null))
.thenReturn(0.2f);
assertTrue(mAutomaticBrightnessStrategy.isAutoBrightnessValid());
+ assertEquals(adjustment, mAutomaticBrightnessStrategy.getAutoBrightnessAdjustment(), 0.0f);
+ assertEquals(adjustment, Settings.System.getFloatForUser(
+ mContext.getContentResolver(),
+ Settings.System.SCREEN_AUTO_BRIGHTNESS_ADJ,
+ UserHandle.USER_CURRENT), 0.0f);
}
@Test
@@ -486,6 +495,15 @@ public class AutomaticBrightnessStrategyTest {
when(mAutomaticBrightnessController.getAutomaticScreenBrightness(brightnessEvent))
.thenReturn(brightness);
+
+ // We do this to apply the automatic brightness adjustments
+ when(mAutomaticBrightnessController.getAutomaticScreenBrightnessAdjustment()).thenReturn(
+ 0.25f);
+ when(mAutomaticBrightnessController.getAutomaticScreenBrightness(null))
+ .thenReturn(brightness);
+ assertEquals(brightness, mAutomaticBrightnessStrategy
+ .getAutomaticScreenBrightness(null, false), 0.0f);
+
DisplayManagerInternal.DisplayPowerRequest displayPowerRequest =
mock(DisplayManagerInternal.DisplayPowerRequest.class);
DisplayBrightnessState expectedDisplayBrightnessState = new DisplayBrightnessState.Builder()
@@ -529,6 +547,12 @@ public class AutomaticBrightnessStrategyTest {
when(mAutomaticBrightnessController.getAutomaticScreenBrightnessAdjustment()).thenReturn(
autoBrightnessAdjustment);
+ // We do this to apply the automatic brightness adjustments
+ when(mAutomaticBrightnessController.getAutomaticScreenBrightness(null))
+ .thenReturn(brightness);
+ assertEquals(brightness, mAutomaticBrightnessStrategy
+ .getAutomaticScreenBrightness(null, false), 0.0f);
+
DisplayBrightnessState expectedDisplayBrightnessState = new DisplayBrightnessState.Builder()
.setBrightness(brightness)
.setSdrBrightness(brightness)
diff --git a/services/tests/dreamservicetests/src/com/android/server/dreams/DreamServiceTest.java b/services/tests/dreamservicetests/src/com/android/server/dreams/DreamServiceTest.java
index 1322545c8d7e..b98af6bc7dd0 100644
--- a/services/tests/dreamservicetests/src/com/android/server/dreams/DreamServiceTest.java
+++ b/services/tests/dreamservicetests/src/com/android/server/dreams/DreamServiceTest.java
@@ -37,6 +37,7 @@ import android.service.dreams.DreamService;
import android.service.dreams.Flags;
import android.service.dreams.IDreamOverlayCallback;
import android.testing.TestableLooper;
+import android.view.KeyEvent;
import androidx.test.filters.SmallTest;
import androidx.test.platform.app.InstrumentationRegistry;
@@ -181,4 +182,15 @@ public class DreamServiceTest {
environment.advance(TestDreamEnvironment.DREAM_STATE_WOKEN);
verify(environment.getDreamOverlayClient()).onWakeRequested();
}
+
+ @Test
+ @EnableFlags(Flags.FLAG_DREAM_HANDLES_CONFIRM_KEYS)
+ public void testPartialKeyHandling() throws Exception {
+ TestDreamEnvironment environment = new TestDreamEnvironment.Builder(mTestableLooper)
+ .build();
+ environment.advance(TestDreamEnvironment.DREAM_STATE_STARTED);
+
+ // Ensure service does not crash from only receiving up event.
+ environment.dispatchKeyEvent(new KeyEvent(KeyEvent.ACTION_UP, KeyEvent.KEYCODE_SPACE));
+ }
}
diff --git a/services/tests/dreamservicetests/src/com/android/server/dreams/TestDreamEnvironment.java b/services/tests/dreamservicetests/src/com/android/server/dreams/TestDreamEnvironment.java
index ef85ba56769e..3d03bf218557 100644
--- a/services/tests/dreamservicetests/src/com/android/server/dreams/TestDreamEnvironment.java
+++ b/services/tests/dreamservicetests/src/com/android/server/dreams/TestDreamEnvironment.java
@@ -46,6 +46,7 @@ import android.service.dreams.IDreamOverlayCallback;
import android.service.dreams.IDreamOverlayClient;
import android.service.dreams.IDreamService;
import android.testing.TestableLooper;
+import android.view.KeyEvent;
import android.view.View;
import android.view.Window;
import android.view.WindowInsetsController;
@@ -390,6 +391,13 @@ public class TestDreamEnvironment {
}
}
+ /**
+ * Sends a key event to the dream.
+ */
+ public void dispatchKeyEvent(KeyEvent event) {
+ mService.dispatchKeyEvent(event);
+ }
+
private void wakeDream() throws RemoteException {
mService.wakeUp();
}
diff --git a/services/tests/mockingservicestests/src/com/android/server/alarm/AlarmManagerServiceTest.java b/services/tests/mockingservicestests/src/com/android/server/alarm/AlarmManagerServiceTest.java
index c359412b6ccd..cb15d6f84403 100644
--- a/services/tests/mockingservicestests/src/com/android/server/alarm/AlarmManagerServiceTest.java
+++ b/services/tests/mockingservicestests/src/com/android/server/alarm/AlarmManagerServiceTest.java
@@ -3094,13 +3094,14 @@ public final class AlarmManagerServiceTest {
ArgumentCaptor<Bundle> bundleCaptor = ArgumentCaptor.forClass(Bundle.class);
verify(alarmPi).send(eq(mMockContext), eq(0), any(Intent.class),
any(), any(Handler.class), isNull(), bundleCaptor.capture());
+ Bundle bundle = bundleCaptor.getValue();
if (idleOptions != null) {
- assertEquals(idleOptions, bundleCaptor.getValue());
+ assertEquals(idleOptions, bundle);
} else {
- assertFalse("BAL flag needs to be false in alarm manager",
- bundleCaptor.getValue().getBoolean(
- ActivityOptions.KEY_PENDING_INTENT_BACKGROUND_ACTIVITY_ALLOWED,
- true));
+ ActivityOptions options = ActivityOptions.fromBundle(bundle);
+ assertEquals("BAL should not be allowed in alarm manager",
+ ActivityOptions.MODE_BACKGROUND_ACTIVITY_START_DENIED,
+ options.getPendingIntentBackgroundActivityStartMode());
}
}
diff --git a/services/tests/mockingservicestests/src/com/android/server/am/ApplicationStartInfoTest.java b/services/tests/mockingservicestests/src/com/android/server/am/ApplicationStartInfoTest.java
index c1f4feee9c57..e88e28b37551 100644
--- a/services/tests/mockingservicestests/src/com/android/server/am/ApplicationStartInfoTest.java
+++ b/services/tests/mockingservicestests/src/com/android/server/am/ApplicationStartInfoTest.java
@@ -142,6 +142,7 @@ public class ApplicationStartInfoTest {
final String app1PackageName = "com.android.test.stub1";
final long appStartTimestampIntentStarted = 1000000;
final long appStartTimestampActivityLaunchFinished = 2000000;
+ final long appStartTimestampFirstFrameDrawn = 2500000;
final long appStartTimestampReportFullyDrawn = 3000000;
final long appStartTimestampService = 4000000;
final long appStartTimestampBroadcast = 5000000;
@@ -272,6 +273,8 @@ public class ApplicationStartInfoTest {
mAppStartInfoTracker.onActivityLaunchFinished(appStartTimestampIntentStarted, COMPONENT,
appStartTimestampActivityLaunchFinished, ApplicationStartInfo.LAUNCH_MODE_STANDARD);
+ mAppStartInfoTracker.addTimestampToStart(app1PackageName, app1Uid,
+ appStartTimestampFirstFrameDrawn, ApplicationStartInfo.START_TIMESTAMP_FIRST_FRAME);
list.clear();
mAppStartInfoTracker.getStartInfo(app1PackageName, app1Uid, app1Pid1, 0, list);
verifyInProgressRecordsSize(1);
diff --git a/services/tests/mockingservicestests/src/com/android/server/am/OWNERS b/services/tests/mockingservicestests/src/com/android/server/am/OWNERS
index 72c0a9e6e90c..2cbc226da780 100644
--- a/services/tests/mockingservicestests/src/com/android/server/am/OWNERS
+++ b/services/tests/mockingservicestests/src/com/android/server/am/OWNERS
@@ -1 +1,3 @@
include /services/core/java/com/android/server/am/OWNERS
+
+per-file ApplicationStartInfoTest.java = yforta@google.com, carmenjackson@google.com, jji@google.com
diff --git a/services/tests/mockingservicestests/src/com/android/server/am/SettingsToPropertiesMapperTest.java b/services/tests/mockingservicestests/src/com/android/server/am/SettingsToPropertiesMapperTest.java
index 8e1e3392eb1c..c77ab0f303d9 100644
--- a/services/tests/mockingservicestests/src/com/android/server/am/SettingsToPropertiesMapperTest.java
+++ b/services/tests/mockingservicestests/src/com/android/server/am/SettingsToPropertiesMapperTest.java
@@ -24,7 +24,6 @@ import static com.android.dx.mockito.inline.extended.ExtendedMockito.doReturn;
import android.content.ContentResolver;
import android.os.SystemProperties;
import android.provider.Settings;
-import android.provider.DeviceConfig.Properties;
import android.text.TextUtils;
import com.android.dx.mockito.inline.extended.ExtendedMockito;
@@ -43,7 +42,6 @@ import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
-import java.util.Map;
/**
* Test SettingsToPropertiesMapper.
@@ -63,7 +61,6 @@ public class SettingsToPropertiesMapperTest {
private HashMap<String, String> mSystemSettingsMap;
private HashMap<String, String> mGlobalSettingsMap;
- private HashMap<String, String> mConfigSettingsMap;
@Before
public void setUp() throws Exception {
@@ -74,11 +71,9 @@ public class SettingsToPropertiesMapperTest {
.spyStatic(SystemProperties.class)
.spyStatic(Settings.Global.class)
.spyStatic(SettingsToPropertiesMapper.class)
- .spyStatic(Settings.Config.class)
.startMocking();
mSystemSettingsMap = new HashMap<>();
mGlobalSettingsMap = new HashMap<>();
- mConfigSettingsMap = new HashMap<>();
// Mock SystemProperties setter and various getters
doAnswer((Answer<Void>) invocationOnMock -> {
@@ -106,21 +101,6 @@ public class SettingsToPropertiesMapperTest {
}
).when(() -> Settings.Global.getString(any(), anyString()));
- // Mock Settings.Config getstrings method
- doAnswer((Answer<Map<String, String>>) invocationOnMock -> {
- String namespace = invocationOnMock.getArgument(0);
- List<String> flags = invocationOnMock.getArgument(1);
- HashMap<String, String> values = new HashMap<>();
- for (String flag : flags) {
- String value = mConfigSettingsMap.get(namespace + "/" + flag);
- if (value != null) {
- values.put(flag, value);
- }
- }
- return values;
- }
- ).when(() -> Settings.Config.getStrings(anyString(), any()));
-
mTestMapper = new SettingsToPropertiesMapper(
mMockContentResolver, TEST_MAPPING, new String[] {}, new String[] {});
}
@@ -259,39 +239,4 @@ public class SettingsToPropertiesMapperTest {
Assert.assertTrue(categories.contains("category2"));
Assert.assertTrue(categories.contains("category3"));
}
-
- @Test
- public void testGetStagedFlagsWithValueChange() {
- // mock up what is in the setting already
- mConfigSettingsMap.put("namespace_1/flag_1", "true");
- mConfigSettingsMap.put("namespace_1/flag_2", "true");
-
- // mock up input
- String namespace = "staged";
- Map<String, String> keyValueMap = new HashMap<>();
- // case 1: existing prop, stage the same value
- keyValueMap.put("namespace_1*flag_1", "true");
- // case 2: existing prop, stage a different value
- keyValueMap.put("namespace_1*flag_2", "false");
- // case 3: new prop
- keyValueMap.put("namespace_2*flag_1", "true");
- Properties props = new Properties(namespace, keyValueMap);
-
- HashMap<String, HashMap<String, String>> toStageProps =
- SettingsToPropertiesMapper.getStagedFlagsWithValueChange(props);
-
- HashMap<String, String> namespace_1_to_stage = toStageProps.get("namespace_1");
- HashMap<String, String> namespace_2_to_stage = toStageProps.get("namespace_2");
- Assert.assertTrue(namespace_1_to_stage != null);
- Assert.assertTrue(namespace_2_to_stage != null);
-
- String namespace_1_flag_1 = namespace_1_to_stage.get("flag_1");
- String namespace_1_flag_2 = namespace_1_to_stage.get("flag_2");
- String namespace_2_flag_1 = namespace_2_to_stage.get("flag_1");
- Assert.assertTrue(namespace_1_flag_1 == null);
- Assert.assertTrue(namespace_1_flag_2 != null);
- Assert.assertTrue(namespace_2_flag_1 != null);
- Assert.assertTrue(namespace_1_flag_2.equals("false"));
- Assert.assertTrue(namespace_2_flag_1.equals("true"));
- }
}
diff --git a/services/tests/mockingservicestests/src/com/android/server/wallpaper/WallpaperCropperTest.java b/services/tests/mockingservicestests/src/com/android/server/wallpaper/WallpaperCropperTest.java
index 29f3720a1828..1b0a8d2222b9 100644
--- a/services/tests/mockingservicestests/src/com/android/server/wallpaper/WallpaperCropperTest.java
+++ b/services/tests/mockingservicestests/src/com/android/server/wallpaper/WallpaperCropperTest.java
@@ -210,12 +210,10 @@ public class WallpaperCropperTest {
new Rect(0, 0, bitmapSize.x, bitmapSize.y),
new Rect(100, 200, bitmapSize.x - 100, bitmapSize.y))) {
for (int mode: ALL_MODES) {
- for (boolean rtl: List.of(true, false)) {
- for (boolean parallax: List.of(true, false)) {
- assertThat(WallpaperCropper.getAdjustedCrop(
- crop, bitmapSize, displaySize, parallax, rtl, mode))
- .isEqualTo(crop);
- }
+ for (boolean parallax: List.of(true, false)) {
+ assertThat(WallpaperCropper.getAdjustedCrop(
+ crop, bitmapSize, displaySize, parallax, mode))
+ .isEqualTo(crop);
}
}
}
@@ -235,11 +233,9 @@ public class WallpaperCropperTest {
int expectedWidth = (int) (displaySize.x * (1 + WallpaperCropper.MAX_PARALLAX));
Point expectedCropSize = new Point(expectedWidth, 1000);
for (int mode: ALL_MODES) {
- for (boolean rtl: List.of(false, true)) {
- assertThat(WallpaperCropper.getAdjustedCrop(
- crop, bitmapSize, displaySize, true, rtl, mode))
- .isEqualTo(centerOf(crop, expectedCropSize));
- }
+ assertThat(WallpaperCropper.getAdjustedCrop(
+ crop, bitmapSize, displaySize, true, mode))
+ .isEqualTo(centerOf(crop, expectedCropSize));
}
}
@@ -258,11 +254,9 @@ public class WallpaperCropperTest {
Point bitmapSize = new Point(acceptableWidth, 1000);
Rect crop = new Rect(0, 0, bitmapSize.x, bitmapSize.y);
for (int mode : ALL_MODES) {
- for (boolean rtl : List.of(false, true)) {
- assertThat(WallpaperCropper.getAdjustedCrop(
- crop, bitmapSize, displaySize, true, rtl, mode))
- .isEqualTo(crop);
- }
+ assertThat(WallpaperCropper.getAdjustedCrop(
+ crop, bitmapSize, displaySize, true, mode))
+ .isEqualTo(crop);
}
}
}
@@ -292,11 +286,9 @@ public class WallpaperCropperTest {
for (int i = 0; i < crops.size(); i++) {
Rect crop = crops.get(i);
Rect expectedCrop = expectedAdjustedCrops.get(i);
- for (boolean rtl: List.of(false, true)) {
- assertThat(WallpaperCropper.getAdjustedCrop(
- crop, bitmapSize, displaySize, false, rtl, WallpaperCropper.ADD))
- .isEqualTo(expectedCrop);
- }
+ assertThat(WallpaperCropper.getAdjustedCrop(
+ crop, bitmapSize, displaySize, false, WallpaperCropper.ADD))
+ .isEqualTo(expectedCrop);
}
}
@@ -317,11 +309,9 @@ public class WallpaperCropperTest {
Point expectedCropSize = new Point(1000, 1000);
for (Rect crop: crops) {
- for (boolean rtl : List.of(false, true)) {
- assertThat(WallpaperCropper.getAdjustedCrop(
- crop, bitmapSize, displaySize, false, rtl, WallpaperCropper.REMOVE))
- .isEqualTo(centerOf(crop, expectedCropSize));
- }
+ assertThat(WallpaperCropper.getAdjustedCrop(
+ crop, bitmapSize, displaySize, false, WallpaperCropper.REMOVE))
+ .isEqualTo(centerOf(crop, expectedCropSize));
}
}
@@ -348,14 +338,14 @@ public class WallpaperCropperTest {
Rect crop = crops.get(i);
Rect expected = expectedAdjustedCrops.get(i);
assertThat(WallpaperCropper.getAdjustedCrop(
- crop, bitmapSize, displaySize, false, false, WallpaperCropper.BALANCE))
+ crop, bitmapSize, displaySize, false, WallpaperCropper.BALANCE))
.isEqualTo(expected);
Rect transposedCrop = new Rect(crop.top, crop.left, crop.bottom, crop.right);
Rect expectedTransposed = new Rect(
expected.top, expected.left, expected.bottom, expected.right);
assertThat(WallpaperCropper.getAdjustedCrop(transposedCrop, bitmapSize,
- transposedDisplaySize, false, false, WallpaperCropper.BALANCE))
+ transposedDisplaySize, false, WallpaperCropper.BALANCE))
.isEqualTo(expectedTransposed);
}
}
diff --git a/services/tests/powerservicetests/src/com/android/server/power/NotifierTest.java b/services/tests/powerservicetests/src/com/android/server/power/NotifierTest.java
index a9ff3a133f6e..4460c6af0691 100644
--- a/services/tests/powerservicetests/src/com/android/server/power/NotifierTest.java
+++ b/services/tests/powerservicetests/src/com/android/server/power/NotifierTest.java
@@ -22,10 +22,12 @@ import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyInt;
import static org.mockito.ArgumentMatchers.anyString;
import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.Mockito.clearInvocations;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.spy;
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;
@@ -52,6 +54,7 @@ import com.android.internal.app.IBatteryStats;
import com.android.server.LocalServices;
import com.android.server.policy.WindowManagerPolicy;
import com.android.server.power.batterysaver.BatterySaverStateMachine;
+import com.android.server.power.feature.PowerManagerFlags;
import com.android.server.statusbar.StatusBarManagerInternal;
import org.junit.Before;
@@ -77,6 +80,9 @@ public class NotifierTest {
@Mock private InattentiveSleepWarningController mInattentiveSleepWarningControllerMock;
@Mock private Vibrator mVibrator;
@Mock private StatusBarManagerInternal mStatusBarManagerInternal;
+ @Mock private WakeLockLog mWakeLockLog;
+
+ @Mock private PowerManagerFlags mPowerManagerFlags;
private PowerManagerService mService;
private Context mContextSpy;
@@ -222,6 +228,7 @@ public class NotifierTest {
@Test
public void testOnWakeLockListener_RemoteException_NoRethrow() {
+ when(mPowerManagerFlags.improveWakelockLatency()).thenReturn(true);
createNotifier();
IWakeLockCallback exceptingCallback = new IWakeLockCallback.Stub() {
@@ -235,6 +242,9 @@ public class NotifierTest {
mNotifier.onWakeLockReleased(PowerManager.PARTIAL_WAKE_LOCK, "wakelockTag",
"my.package.name", uid, pid, /* workSource= */ null, /* historyTag= */ null,
exceptingCallback);
+ verifyZeroInteractions(mWakeLockLog);
+ mTestLooper.dispatchAll();
+ verify(mWakeLockLog).onWakeLockReleased("wakelockTag", uid, 1);
mNotifier.onWakeLockAcquired(PowerManager.PARTIAL_WAKE_LOCK, "wakelockTag",
"my.package.name", uid, pid, /* workSource= */ null, /* historyTag= */ null,
exceptingCallback);
@@ -244,8 +254,27 @@ public class NotifierTest {
PowerManager.SCREEN_BRIGHT_WAKE_LOCK, "wakelockTag",
"my.package.name", uid, pid, /* newWorkSource= */ null, /* newHistoryTag= */ null,
exceptingCallback);
+ verifyNoMoreInteractions(mWakeLockLog);
mTestLooper.dispatchAll();
+ verify(mWakeLockLog).onWakeLockAcquired("wakelockTag", uid,
+ PowerManager.PARTIAL_WAKE_LOCK, 1);
// If we didn't throw, we're good!
+
+ // Test with improveWakelockLatency flag false, hence the wakelock log will run on the same
+ // thread
+ clearInvocations(mWakeLockLog);
+ when(mPowerManagerFlags.improveWakelockLatency()).thenReturn(false);
+
+ mNotifier.onWakeLockAcquired(PowerManager.PARTIAL_WAKE_LOCK, "wakelockTag",
+ "my.package.name", uid, pid, /* workSource= */ null, /* historyTag= */ null,
+ exceptingCallback);
+ verify(mWakeLockLog).onWakeLockAcquired("wakelockTag", uid,
+ PowerManager.PARTIAL_WAKE_LOCK, -1);
+
+ mNotifier.onWakeLockReleased(PowerManager.PARTIAL_WAKE_LOCK, "wakelockTag",
+ "my.package.name", uid, pid, /* workSource= */ null, /* historyTag= */ null,
+ exceptingCallback);
+ verify(mWakeLockLog).onWakeLockReleased("wakelockTag", uid, -1);
}
private final PowerManagerService.Injector mInjector = new PowerManagerService.Injector() {
@@ -253,7 +282,7 @@ public class NotifierTest {
Notifier createNotifier(Looper looper, Context context, IBatteryStats batteryStats,
SuspendBlocker suspendBlocker, WindowManagerPolicy policy,
FaceDownDetector faceDownDetector, ScreenUndimDetector screenUndimDetector,
- Executor backgroundExecutor) {
+ Executor backgroundExecutor, PowerManagerFlags powerManagerFlags) {
return mNotifierMock;
}
@@ -326,6 +355,18 @@ public class NotifierTest {
}
private void createNotifier() {
+ Notifier.Injector injector = new Notifier.Injector() {
+ @Override
+ public long currentTimeMillis() {
+ return 1;
+ }
+
+ @Override
+ public WakeLockLog getWakeLockLog(Context context) {
+ return mWakeLockLog;
+ }
+ };
+
mNotifier = new Notifier(
mTestLooper.getLooper(),
mContextSpy,
@@ -335,7 +376,7 @@ public class NotifierTest {
null,
null,
null,
- mTestExecutor);
+ mTestExecutor, mPowerManagerFlags, injector);
}
private static class FakeExecutor implements Executor {
diff --git a/services/tests/powerservicetests/src/com/android/server/power/PowerManagerServiceTest.java b/services/tests/powerservicetests/src/com/android/server/power/PowerManagerServiceTest.java
index 7f165e0e8885..b737e0f98317 100644
--- a/services/tests/powerservicetests/src/com/android/server/power/PowerManagerServiceTest.java
+++ b/services/tests/powerservicetests/src/com/android/server/power/PowerManagerServiceTest.java
@@ -114,6 +114,7 @@ import com.android.server.power.PowerManagerService.WakeLock;
import com.android.server.power.batterysaver.BatterySaverController;
import com.android.server.power.batterysaver.BatterySaverPolicy;
import com.android.server.power.batterysaver.BatterySaverStateMachine;
+import com.android.server.power.feature.PowerManagerFlags;
import com.android.server.testutils.OffsettableClock;
import com.google.testing.junit.testparameterinjector.TestParameter;
@@ -275,7 +276,7 @@ public class PowerManagerServiceTest {
Notifier createNotifier(Looper looper, Context context, IBatteryStats batteryStats,
SuspendBlocker suspendBlocker, WindowManagerPolicy policy,
FaceDownDetector faceDownDetector, ScreenUndimDetector screenUndimDetector,
- Executor executor) {
+ Executor executor, PowerManagerFlags powerManagerFlags) {
return mNotifierMock;
}
diff --git a/services/tests/powerservicetests/src/com/android/server/power/WakeLockLogTest.java b/services/tests/powerservicetests/src/com/android/server/power/WakeLockLogTest.java
index 0fad25d35515..1c4db6ad883b 100644
--- a/services/tests/powerservicetests/src/com/android/server/power/WakeLockLogTest.java
+++ b/services/tests/powerservicetests/src/com/android/server/power/WakeLockLogTest.java
@@ -57,19 +57,42 @@ public class WakeLockLogTest {
}
@Test
- public void testAddTwoItems() {
+ public void testAddTwoItems_withNoEventTimeSupplied() {
final int tagDatabaseSize = 128;
final int logSize = 20;
TestInjector injectorSpy = spy(new TestInjector(tagDatabaseSize, logSize));
WakeLockLog log = new WakeLockLog(injectorSpy, mContext);
-
when(injectorSpy.currentTimeMillis()).thenReturn(1000L);
log.onWakeLockAcquired("TagPartial", 101,
- PowerManager.PARTIAL_WAKE_LOCK | PowerManager.ON_AFTER_RELEASE);
+ PowerManager.PARTIAL_WAKE_LOCK | PowerManager.ON_AFTER_RELEASE, -1);
when(injectorSpy.currentTimeMillis()).thenReturn(1150L);
log.onWakeLockAcquired("TagFull", 102,
- PowerManager.FULL_WAKE_LOCK | PowerManager.ACQUIRE_CAUSES_WAKEUP);
+ PowerManager.FULL_WAKE_LOCK | PowerManager.ACQUIRE_CAUSES_WAKEUP, -1);
+
+ assertEquals("Wake Lock Log\n"
+ + " 01-01 00:00:01.000 - 101 (some.package1) - ACQ TagPartial "
+ + "(partial,on-after-release)\n"
+ + " 01-01 00:00:01.150 - 102 (some.package2) - ACQ TagFull "
+ + "(full,acq-causes-wake)\n"
+ + " -\n"
+ + " Events: 2, Time-Resets: 0\n"
+ + " Buffer, Bytes used: 6\n",
+ dumpLog(log, false));
+ }
+
+ @Test
+ public void testAddTwoItems() {
+ final int tagDatabaseSize = 128;
+ final int logSize = 20;
+ TestInjector injectorSpy = spy(new TestInjector(tagDatabaseSize, logSize));
+ WakeLockLog log = new WakeLockLog(injectorSpy, mContext);
+
+ log.onWakeLockAcquired("TagPartial", 101,
+ PowerManager.PARTIAL_WAKE_LOCK | PowerManager.ON_AFTER_RELEASE, 1000L);
+
+ log.onWakeLockAcquired("TagFull", 102,
+ PowerManager.FULL_WAKE_LOCK | PowerManager.ACQUIRE_CAUSES_WAKEUP, 1150L);
assertEquals("Wake Lock Log\n"
+ " 01-01 00:00:01.000 - 101 (some.package1) - ACQ TagPartial "
@@ -89,11 +112,9 @@ public class WakeLockLogTest {
TestInjector injectorSpy = spy(new TestInjector(tagDatabaseSize, logSize));
WakeLockLog log = new WakeLockLog(injectorSpy, mContext);
- when(injectorSpy.currentTimeMillis()).thenReturn(1000L);
- log.onWakeLockAcquired("TagPartial", 101, PowerManager.PARTIAL_WAKE_LOCK);
+ log.onWakeLockAcquired("TagPartial", 101, PowerManager.PARTIAL_WAKE_LOCK, 1000L);
- when(injectorSpy.currentTimeMillis()).thenReturn(1350L);
- log.onWakeLockAcquired("TagFull", 102, PowerManager.FULL_WAKE_LOCK);
+ log.onWakeLockAcquired("TagFull", 102, PowerManager.FULL_WAKE_LOCK, 1350L);
assertEquals("Wake Lock Log\n"
+ " 01-01 00:00:01.000 - 101 (some.package1) - ACQ TagPartial (partial)\n"
@@ -111,11 +132,9 @@ public class WakeLockLogTest {
TestInjector injectorSpy = spy(new TestInjector(tagDatabaseSize, logSize));
WakeLockLog log = new WakeLockLog(injectorSpy, mContext);
- when(injectorSpy.currentTimeMillis()).thenReturn(1000L);
- log.onWakeLockAcquired("TagPartial", 101, PowerManager.PARTIAL_WAKE_LOCK);
+ log.onWakeLockAcquired("TagPartial", 101, PowerManager.PARTIAL_WAKE_LOCK, 1000L);
- when(injectorSpy.currentTimeMillis()).thenReturn(1150L);
- log.onWakeLockAcquired("TagFull", 102, PowerManager.FULL_WAKE_LOCK);
+ log.onWakeLockAcquired("TagFull", 102, PowerManager.FULL_WAKE_LOCK, 1150L);
assertEquals("Wake Lock Log\n"
+ " 01-01 00:00:01.000 - --- - ACQ UNKNOWN (partial)\n"
@@ -134,41 +153,33 @@ public class WakeLockLogTest {
WakeLockLog log = new WakeLockLog(injectorSpy, mContext);
// Wake lock 1 acquired - log size = 3
- when(injectorSpy.currentTimeMillis()).thenReturn(1000L);
- log.onWakeLockAcquired("TagPartial", 101, PowerManager.PARTIAL_WAKE_LOCK);
+ log.onWakeLockAcquired("TagPartial", 101, PowerManager.PARTIAL_WAKE_LOCK, 1000L);
// Wake lock 2 acquired - log size = 3 + 3 = 6
- when(injectorSpy.currentTimeMillis()).thenReturn(1150L);
- log.onWakeLockAcquired("TagFull", 102, PowerManager.FULL_WAKE_LOCK);
+ log.onWakeLockAcquired("TagFull", 102, PowerManager.FULL_WAKE_LOCK, 1150L);
// Wake lock 3 acquired - log size = 6 + 3 = 9
- when(injectorSpy.currentTimeMillis()).thenReturn(1151L);
- log.onWakeLockAcquired("TagThree", 101, PowerManager.PARTIAL_WAKE_LOCK);
+ log.onWakeLockAcquired("TagThree", 101, PowerManager.PARTIAL_WAKE_LOCK, 1151L);
// We need more space - wake lock 1 acquisition is removed from the log and saved in the
// list. Log size = 9 - 3 + 2 = 8
- when(injectorSpy.currentTimeMillis()).thenReturn(1152L);
- log.onWakeLockReleased("TagThree", 101);
+ log.onWakeLockReleased("TagThree", 101, 1152L);
// We need more space - wake lock 2 acquisition is removed from the log and saved in the
// list. Log size = 8 - 3 + 2 = 7
- when(injectorSpy.currentTimeMillis()).thenReturn(1153L);
- log.onWakeLockReleased("TagPartial", 101);
+ log.onWakeLockReleased("TagPartial", 101, 1153L);
// We need more space - wake lock 3 acquisition is removed from the log and saved in the
// list. Log size = 7 - 3 + 3 = 7
- when(injectorSpy.currentTimeMillis()).thenReturn(1154L);
- log.onWakeLockAcquired("TagFour", 101, PowerManager.PARTIAL_WAKE_LOCK);
+ log.onWakeLockAcquired("TagFour", 101, PowerManager.PARTIAL_WAKE_LOCK, 1154L);
// We need more space - wake lock 3 release is removed from the log and wake lock 3
// acquisition is removed from the list. Log size = 7 - 2 + 3 = 8
- when(injectorSpy.currentTimeMillis()).thenReturn(1155L);
- log.onWakeLockAcquired("TagFive", 101, PowerManager.PARTIAL_WAKE_LOCK);
+ log.onWakeLockAcquired("TagFive", 101, PowerManager.PARTIAL_WAKE_LOCK, 1155L);
// We need more space - wake lock 1 release is removed from the log and wake lock 1
// acquisition is removed from the list. Log size = 8 - 2 + 2 = 8
- when(injectorSpy.currentTimeMillis()).thenReturn(1156L);
- log.onWakeLockReleased("TagFull", 102);
+ log.onWakeLockReleased("TagFull", 102, 1156L);
// Wake lock 2 acquisition is still printed because its release have not rolled off the log
// yet.
@@ -191,8 +202,8 @@ public class WakeLockLogTest {
WakeLockLog log = new WakeLockLog(injectorSpy, mContext);
// Bad tag means it wont get written
- when(injectorSpy.currentTimeMillis()).thenReturn(1000L);
- log.onWakeLockAcquired(null /* tag */, 0 /* ownerUid */, PowerManager.PARTIAL_WAKE_LOCK);
+ log.onWakeLockAcquired(
+ null /* tag */, 0 /* ownerUid */, PowerManager.PARTIAL_WAKE_LOCK, 1000L);
assertEquals("Wake Lock Log\n"
+ " -\n"
@@ -208,9 +219,8 @@ public class WakeLockLogTest {
TestInjector injectorSpy = spy(new TestInjector(tagDatabaseSize, logSize));
WakeLockLog log = new WakeLockLog(injectorSpy, mContext);
- when(injectorSpy.currentTimeMillis()).thenReturn(1000L);
log.onWakeLockAcquired("*job*/com.one.two.3hree/.one..Last", 101,
- PowerManager.PARTIAL_WAKE_LOCK);
+ PowerManager.PARTIAL_WAKE_LOCK, 1000L);
assertEquals("Wake Lock Log\n"
+ " 01-01 00:00:01.000 - 101 (some.package1) - ACQ "
@@ -228,10 +238,8 @@ public class WakeLockLogTest {
TestInjector injectorSpy = spy(new TestInjector(tagDatabaseSize, logSize));
WakeLockLog log = new WakeLockLog(injectorSpy, mContext);
- when(injectorSpy.currentTimeMillis()).thenReturn(1000L);
- log.onWakeLockAcquired("HowdyTag", 101, PowerManager.PARTIAL_WAKE_LOCK);
- when(injectorSpy.currentTimeMillis()).thenReturn(1001L);
- log.onWakeLockReleased("HowdyTag", 101);
+ log.onWakeLockAcquired("HowdyTag", 101, PowerManager.PARTIAL_WAKE_LOCK, 1000L);
+ log.onWakeLockReleased("HowdyTag", 101, 1001L);
assertEquals("Wake Lock Log\n"
+ " 01-01 00:00:01.000 - 101 (some.package1) - ACQ HowdyTag (partial)\n"
@@ -250,12 +258,10 @@ public class WakeLockLogTest {
TestInjector injectorSpy = spy(new TestInjector(tagDatabaseSize, logSize));
WakeLockLog log = new WakeLockLog(injectorSpy, mContext);
- when(injectorSpy.currentTimeMillis()).thenReturn(1100L);
- log.onWakeLockAcquired("HowdyTag", 101, PowerManager.PARTIAL_WAKE_LOCK);
+ log.onWakeLockAcquired("HowdyTag", 101, PowerManager.PARTIAL_WAKE_LOCK, 1100L);
// New element goes back in time...should not be written to log.
- when(injectorSpy.currentTimeMillis()).thenReturn(1000L);
- log.onWakeLockReleased("HowdyTag", 101);
+ log.onWakeLockReleased("HowdyTag", 101, 1000L);
assertEquals("Wake Lock Log\n"
+ " 01-01 00:00:01.100 - 101 (some.package1) - ACQ HowdyTag (partial)\n"
@@ -272,9 +278,8 @@ public class WakeLockLogTest {
TestInjector injectorSpy = spy(new TestInjector(tagDatabaseSize, logSize));
WakeLockLog log = new WakeLockLog(injectorSpy, mContext);
- when(injectorSpy.currentTimeMillis()).thenReturn(1000L);
log.onWakeLockAcquired("TagPartial", 101,
- PowerManager.PARTIAL_WAKE_LOCK | PowerManager.SYSTEM_WAKELOCK);
+ PowerManager.PARTIAL_WAKE_LOCK | PowerManager.SYSTEM_WAKELOCK, 1000L);
assertEquals("Wake Lock Log\n"
+ " 01-01 00:00:01.000 - 101 (some.package1) - ACQ TagPartial "
@@ -293,9 +298,8 @@ public class WakeLockLogTest {
WakeLockLog log = new WakeLockLog(injectorSpy, mContext);
when(mPackageManager.getPackagesForUid(101)).thenReturn(null);
- when(injectorSpy.currentTimeMillis()).thenReturn(1000L);
log.onWakeLockAcquired("TagPartial", 101,
- PowerManager.PARTIAL_WAKE_LOCK | PowerManager.ON_AFTER_RELEASE);
+ PowerManager.PARTIAL_WAKE_LOCK | PowerManager.ON_AFTER_RELEASE, 1000L);
assertEquals("Wake Lock Log\n"
+ " 01-01 00:00:01.000 - 101 - ACQ TagPartial "
@@ -316,9 +320,8 @@ public class WakeLockLogTest {
when(mPackageManager.getPackagesForUid(101)).thenReturn(
new String[]{ "some.package1", "some.package2", "some.package3" });
- when(injectorSpy.currentTimeMillis()).thenReturn(1000L);
log.onWakeLockAcquired("TagPartial", 101,
- PowerManager.PARTIAL_WAKE_LOCK | PowerManager.ON_AFTER_RELEASE);
+ PowerManager.PARTIAL_WAKE_LOCK | PowerManager.ON_AFTER_RELEASE, 1000L);
assertEquals("Wake Lock Log\n"
+ " 01-01 00:00:01.000 - 101 (some.package1,...) - ACQ TagPartial "
@@ -336,17 +339,14 @@ public class WakeLockLogTest {
TestInjector injectorSpy = spy(new TestInjector(tagDatabaseSize, logSize));
WakeLockLog log = new WakeLockLog(injectorSpy, mContext);
- when(injectorSpy.currentTimeMillis()).thenReturn(1000L);
log.onWakeLockAcquired("TagPartial", 101,
- PowerManager.PARTIAL_WAKE_LOCK | PowerManager.ON_AFTER_RELEASE);
+ PowerManager.PARTIAL_WAKE_LOCK | PowerManager.ON_AFTER_RELEASE, 1000L);
- when(injectorSpy.currentTimeMillis()).thenReturn(1150L);
log.onWakeLockAcquired("TagFull", 101,
- PowerManager.FULL_WAKE_LOCK | PowerManager.ACQUIRE_CAUSES_WAKEUP);
+ PowerManager.FULL_WAKE_LOCK | PowerManager.ACQUIRE_CAUSES_WAKEUP, 1150L);
- when(injectorSpy.currentTimeMillis()).thenReturn(1151L);
log.onWakeLockAcquired("TagFull2", 101,
- PowerManager.FULL_WAKE_LOCK | PowerManager.ACQUIRE_CAUSES_WAKEUP);
+ PowerManager.FULL_WAKE_LOCK | PowerManager.ACQUIRE_CAUSES_WAKEUP, 1151L);
assertEquals("Wake Lock Log\n"
+ " 01-01 00:00:01.000 - 101 (some.package1) - ACQ TagPartial "
@@ -370,29 +370,23 @@ public class WakeLockLogTest {
TestInjector injectorSpy = spy(new TestInjector(tagDatabaseSize, logSize));
WakeLockLog log = new WakeLockLog(injectorSpy, mContext);
- when(injectorSpy.currentTimeMillis()).thenReturn(1000L);
log.onWakeLockAcquired("TagPartial", 101,
- PowerManager.PARTIAL_WAKE_LOCK | PowerManager.ON_AFTER_RELEASE);
+ PowerManager.PARTIAL_WAKE_LOCK | PowerManager.ON_AFTER_RELEASE, 1000L);
- when(injectorSpy.currentTimeMillis()).thenReturn(1150L);
log.onWakeLockAcquired("TagFull", 101,
- PowerManager.FULL_WAKE_LOCK | PowerManager.ACQUIRE_CAUSES_WAKEUP);
+ PowerManager.FULL_WAKE_LOCK | PowerManager.ACQUIRE_CAUSES_WAKEUP, 1150L);
- when(injectorSpy.currentTimeMillis()).thenReturn(1151L);
log.onWakeLockAcquired("TagFull2", 101,
- PowerManager.FULL_WAKE_LOCK | PowerManager.ACQUIRE_CAUSES_WAKEUP);
+ PowerManager.FULL_WAKE_LOCK | PowerManager.ACQUIRE_CAUSES_WAKEUP, 1151L);
- when(injectorSpy.currentTimeMillis()).thenReturn(1152L);
log.onWakeLockAcquired("TagFull3", 101,
- PowerManager.FULL_WAKE_LOCK | PowerManager.ACQUIRE_CAUSES_WAKEUP);
+ PowerManager.FULL_WAKE_LOCK | PowerManager.ACQUIRE_CAUSES_WAKEUP, 1152L);
- when(injectorSpy.currentTimeMillis()).thenReturn(1153L);
log.onWakeLockAcquired("TagFull4", 101,
- PowerManager.FULL_WAKE_LOCK | PowerManager.ACQUIRE_CAUSES_WAKEUP);
+ PowerManager.FULL_WAKE_LOCK | PowerManager.ACQUIRE_CAUSES_WAKEUP, 1153L);
- when(injectorSpy.currentTimeMillis()).thenReturn(1154L);
log.onWakeLockAcquired("TagFull5", 101,
- PowerManager.FULL_WAKE_LOCK | PowerManager.ACQUIRE_CAUSES_WAKEUP);
+ PowerManager.FULL_WAKE_LOCK | PowerManager.ACQUIRE_CAUSES_WAKEUP, 1154L);
// The first 3 events have been removed from the log and they exist in the saved
// acquisitions list. They should also use the cache when fetching the package names.
diff --git a/services/tests/powerstatstests/src/com/android/server/power/stats/BluetoothPowerStatsCollectorTest.java b/services/tests/powerstatstests/src/com/android/server/power/stats/BluetoothPowerStatsCollectorTest.java
new file mode 100644
index 000000000000..02c7b745b24c
--- /dev/null
+++ b/services/tests/powerstatstests/src/com/android/server/power/stats/BluetoothPowerStatsCollectorTest.java
@@ -0,0 +1,315 @@
+/*
+ * 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.power.stats;
+
+import static com.google.common.truth.Truth.assertThat;
+
+import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
+import android.app.ActivityManager;
+import android.bluetooth.BluetoothActivityEnergyInfo;
+import android.bluetooth.BluetoothAdapter;
+import android.bluetooth.UidTraffic;
+import android.content.Context;
+import android.content.pm.PackageManager;
+import android.hardware.power.stats.EnergyConsumerType;
+import android.os.BatteryConsumer;
+import android.os.Handler;
+import android.os.Parcel;
+import android.platform.test.ravenwood.RavenwoodRule;
+import android.util.IndentingPrintWriter;
+import android.util.SparseLongArray;
+
+import com.android.internal.os.Clock;
+import com.android.internal.os.PowerStats;
+
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+
+import java.io.StringWriter;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.Executor;
+import java.util.function.IntSupplier;
+
+public class BluetoothPowerStatsCollectorTest {
+ private static final int APP_UID1 = 42;
+ private static final int APP_UID2 = 24;
+ private static final int ISOLATED_UID = 99123;
+
+ @Rule(order = 0)
+ public final RavenwoodRule mRavenwood = new RavenwoodRule.Builder()
+ .setProvideMainThread(true)
+ .build();
+
+ @Rule(order = 1)
+ public final BatteryUsageStatsRule mStatsRule = new BatteryUsageStatsRule()
+ .setPowerStatsThrottlePeriodMillis(BatteryConsumer.POWER_COMPONENT_BLUETOOTH, 1000);
+
+ private MockBatteryStatsImpl mBatteryStats;
+
+ private final MockClock mClock = mStatsRule.getMockClock();
+
+ @Mock
+ private Context mContext;
+ @Mock
+ private PackageManager mPackageManager;
+ @Mock
+ private PowerStatsCollector.ConsumedEnergyRetriever mConsumedEnergyRetriever;
+ private final PowerStatsUidResolver mPowerStatsUidResolver = new PowerStatsUidResolver();
+
+ private BluetoothActivityEnergyInfo mBluetoothActivityEnergyInfo;
+ private final SparseLongArray mUidScanTimes = new SparseLongArray();
+
+ private final BluetoothPowerStatsCollector.BluetoothStatsRetriever mBluetoothStatsRetriever =
+ new BluetoothPowerStatsCollector.BluetoothStatsRetriever() {
+ @Override
+ public void retrieveBluetoothScanTimes(Callback callback) {
+ for (int i = 0; i < mUidScanTimes.size(); i++) {
+ callback.onBluetoothScanTime(mUidScanTimes.keyAt(i),
+ mUidScanTimes.valueAt(i));
+ }
+ }
+
+ @Override
+ public boolean requestControllerActivityEnergyInfo(Executor executor,
+ BluetoothAdapter.OnBluetoothActivityEnergyInfoCallback callback) {
+ callback.onBluetoothActivityEnergyInfoAvailable(mBluetoothActivityEnergyInfo);
+ return true;
+ }
+ };
+
+ private final List<PowerStats> mRecordedPowerStats = new ArrayList<>();
+
+ private BluetoothPowerStatsCollector.Injector mInjector =
+ new BluetoothPowerStatsCollector.Injector() {
+ @Override
+ public Handler getHandler() {
+ return mStatsRule.getHandler();
+ }
+
+ @Override
+ public Clock getClock() {
+ return mStatsRule.getMockClock();
+ }
+
+ @Override
+ public PowerStatsUidResolver getUidResolver() {
+ return mPowerStatsUidResolver;
+ }
+
+ @Override
+ public long getPowerStatsCollectionThrottlePeriod(String powerComponentName) {
+ return 0;
+ }
+
+ @Override
+ public PackageManager getPackageManager() {
+ return mPackageManager;
+ }
+
+ @Override
+ public PowerStatsCollector.ConsumedEnergyRetriever getConsumedEnergyRetriever() {
+ return mConsumedEnergyRetriever;
+ }
+
+ @Override
+ public IntSupplier getVoltageSupplier() {
+ return () -> 3500;
+ }
+
+ @Override
+ public BluetoothPowerStatsCollector.BluetoothStatsRetriever
+ getBluetoothStatsRetriever() {
+ return mBluetoothStatsRetriever;
+ }
+ };
+
+ @Before
+ public void setup() {
+ MockitoAnnotations.initMocks(this);
+ when(mContext.getPackageManager()).thenReturn(mPackageManager);
+ when(mPackageManager.hasSystemFeature(PackageManager.FEATURE_BLUETOOTH)).thenReturn(true);
+ mPowerStatsUidResolver.noteIsolatedUidAdded(ISOLATED_UID, APP_UID2);
+ mBatteryStats = mStatsRule.getBatteryStats();
+ }
+
+ @SuppressWarnings("GuardedBy")
+ @Test
+ public void triggering() throws Throwable {
+ PowerStatsCollector collector = mBatteryStats.getPowerStatsCollector(
+ BatteryConsumer.POWER_COMPONENT_BLUETOOTH);
+ collector.addConsumer(mRecordedPowerStats::add);
+
+ mBatteryStats.setPowerStatsCollectorEnabled(BatteryConsumer.POWER_COMPONENT_BLUETOOTH,
+ true);
+
+ mBatteryStats.setDummyExternalStatsSync(new MockBatteryStatsImpl.DummyExternalStatsSync(){
+ @Override
+ public void scheduleSyncDueToProcessStateChange(int flags, long delayMillis) {
+ collector.schedule();
+ }
+ });
+
+ mBluetoothActivityEnergyInfo = mockBluetoothActivityEnergyInfo(1000, 2000, 3000, 600);
+
+ // This should trigger a sample collection to establish a baseline
+ mBatteryStats.onSystemReady(mContext);
+
+ mStatsRule.waitForBackgroundThread();
+ assertThat(mRecordedPowerStats).hasSize(1);
+
+ mRecordedPowerStats.clear();
+ mStatsRule.setTime(70000, 70000);
+ mBatteryStats.noteUidProcessStateLocked(APP_UID1, ActivityManager.PROCESS_STATE_TOP,
+ mClock.realtime, mClock.uptime);
+ mStatsRule.waitForBackgroundThread();
+ assertThat(mRecordedPowerStats).hasSize(1);
+ }
+
+ @Test
+ public void collectStats() {
+ PowerStats powerStats = collectPowerStats();
+ assertThat(powerStats.durationMs).isEqualTo(7200);
+
+ BluetoothPowerStatsLayout layout = new BluetoothPowerStatsLayout(powerStats.descriptor);
+ assertThat(layout.getDeviceRxTime(powerStats.stats)).isEqualTo(6000);
+ assertThat(layout.getDeviceTxTime(powerStats.stats)).isEqualTo(1000);
+ assertThat(layout.getDeviceIdleTime(powerStats.stats)).isEqualTo(200);
+ assertThat(layout.getDeviceScanTime(powerStats.stats)).isEqualTo(800);
+ assertThat(layout.getConsumedEnergy(powerStats.stats, 0))
+ .isEqualTo((64321 - 10000) * 1000 / 3500);
+
+ assertThat(powerStats.uidStats.size()).isEqualTo(2);
+ long[] actual1 = powerStats.uidStats.get(APP_UID1);
+ assertThat(layout.getUidRxBytes(actual1)).isEqualTo(1000);
+ assertThat(layout.getUidTxBytes(actual1)).isEqualTo(2000);
+ assertThat(layout.getUidScanTime(actual1)).isEqualTo(100);
+
+ // Combines APP_UID2 and ISOLATED_UID
+ long[] actual2 = powerStats.uidStats.get(APP_UID2);
+ assertThat(layout.getUidRxBytes(actual2)).isEqualTo(8000);
+ assertThat(layout.getUidTxBytes(actual2)).isEqualTo(10000);
+ assertThat(layout.getUidScanTime(actual2)).isEqualTo(700);
+
+ assertThat(powerStats.uidStats.get(ISOLATED_UID)).isNull();
+ }
+
+ @Test
+ public void dump() throws Throwable {
+ PowerStats powerStats = collectPowerStats();
+ StringWriter sw = new StringWriter();
+ IndentingPrintWriter pw = new IndentingPrintWriter(sw);
+ powerStats.dump(pw);
+ pw.flush();
+ String dump = sw.toString();
+ assertThat(dump).contains("duration=7200");
+ assertThat(dump).contains(
+ "rx: 6000 tx: 1000 idle: 200 scan: 800 energy: " + ((64321 - 10000) * 1000 / 3500));
+ assertThat(dump).contains("UID 24: rx-B: 8000 tx-B: 10000 scan: 700");
+ assertThat(dump).contains("UID 42: rx-B: 1000 tx-B: 2000 scan: 100");
+ }
+
+ private PowerStats collectPowerStats() {
+ BluetoothPowerStatsCollector collector = new BluetoothPowerStatsCollector(mInjector);
+ collector.setEnabled(true);
+
+ when(mConsumedEnergyRetriever.getEnergyConsumerIds(EnergyConsumerType.BLUETOOTH))
+ .thenReturn(new int[]{777});
+
+ mBluetoothActivityEnergyInfo = mockBluetoothActivityEnergyInfo(1000, 600, 100, 2000,
+ mockUidTraffic(APP_UID1, 100, 200),
+ mockUidTraffic(APP_UID2, 300, 400),
+ mockUidTraffic(ISOLATED_UID, 500, 600));
+
+ mUidScanTimes.put(APP_UID1, 100);
+
+ when(mConsumedEnergyRetriever.getConsumedEnergyUws(eq(new int[]{777})))
+ .thenReturn(new long[]{10000});
+
+ // Establish a baseline
+ collector.collectStats();
+
+ mBluetoothActivityEnergyInfo = mockBluetoothActivityEnergyInfo(1100, 6600, 1100, 2200,
+ mockUidTraffic(APP_UID1, 1100, 2200),
+ mockUidTraffic(APP_UID2, 3300, 4400),
+ mockUidTraffic(ISOLATED_UID, 5500, 6600));
+
+ mUidScanTimes.clear();
+ mUidScanTimes.put(APP_UID1, 200);
+ mUidScanTimes.put(APP_UID2, 300);
+ mUidScanTimes.put(ISOLATED_UID, 400);
+
+ when(mConsumedEnergyRetriever.getConsumedEnergyUws(eq(new int[]{777})))
+ .thenReturn(new long[]{64321});
+
+ mStatsRule.setTime(20000, 20000);
+ return collector.collectStats();
+ }
+
+ private BluetoothActivityEnergyInfo mockBluetoothActivityEnergyInfo(long timestamp,
+ long rxTimeMs, long txTimeMs, long idleTimeMs, UidTraffic... uidTraffic) {
+ if (RavenwoodRule.isOnRavenwood()) {
+ BluetoothActivityEnergyInfo info = mock(BluetoothActivityEnergyInfo.class);
+ when(info.getControllerRxTimeMillis()).thenReturn(rxTimeMs);
+ when(info.getControllerTxTimeMillis()).thenReturn(txTimeMs);
+ when(info.getControllerIdleTimeMillis()).thenReturn(idleTimeMs);
+ when(info.getUidTraffic()).thenReturn(List.of(uidTraffic));
+ return info;
+ } else {
+ final Parcel btActivityEnergyInfoParcel = Parcel.obtain();
+ btActivityEnergyInfoParcel.writeLong(timestamp);
+ btActivityEnergyInfoParcel.writeInt(
+ BluetoothActivityEnergyInfo.BT_STACK_STATE_STATE_ACTIVE);
+ btActivityEnergyInfoParcel.writeLong(txTimeMs);
+ btActivityEnergyInfoParcel.writeLong(rxTimeMs);
+ btActivityEnergyInfoParcel.writeLong(idleTimeMs);
+ btActivityEnergyInfoParcel.writeLong(0L);
+ btActivityEnergyInfoParcel.writeTypedList(List.of(uidTraffic));
+ btActivityEnergyInfoParcel.setDataPosition(0);
+
+ BluetoothActivityEnergyInfo info = BluetoothActivityEnergyInfo.CREATOR
+ .createFromParcel(btActivityEnergyInfoParcel);
+ btActivityEnergyInfoParcel.recycle();
+ return info;
+ }
+ }
+
+ private UidTraffic mockUidTraffic(int uid, long rxBytes, long txBytes) {
+ if (RavenwoodRule.isOnRavenwood()) {
+ UidTraffic traffic = mock(UidTraffic.class);
+ when(traffic.getUid()).thenReturn(uid);
+ when(traffic.getRxBytes()).thenReturn(rxBytes);
+ when(traffic.getTxBytes()).thenReturn(txBytes);
+ return traffic;
+ } else {
+ final Parcel uidTrafficParcel = Parcel.obtain();
+ uidTrafficParcel.writeInt(uid);
+ uidTrafficParcel.writeLong(rxBytes);
+ uidTrafficParcel.writeLong(txBytes);
+ uidTrafficParcel.setDataPosition(0);
+
+ UidTraffic traffic = UidTraffic.CREATOR.createFromParcel(uidTrafficParcel);
+ uidTrafficParcel.recycle();
+ return traffic;
+ }
+ }
+}
diff --git a/services/tests/powerstatstests/src/com/android/server/power/stats/BluetoothPowerStatsProcessorTest.java b/services/tests/powerstatstests/src/com/android/server/power/stats/BluetoothPowerStatsProcessorTest.java
new file mode 100644
index 000000000000..752bc2712fe2
--- /dev/null
+++ b/services/tests/powerstatstests/src/com/android/server/power/stats/BluetoothPowerStatsProcessorTest.java
@@ -0,0 +1,540 @@
+/*
+ * 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.power.stats;
+
+import static android.os.BatteryConsumer.PROCESS_STATE_BACKGROUND;
+import static android.os.BatteryConsumer.PROCESS_STATE_CACHED;
+import static android.os.BatteryConsumer.PROCESS_STATE_FOREGROUND;
+import static android.os.BatteryConsumer.PROCESS_STATE_FOREGROUND_SERVICE;
+
+import static com.android.server.power.stats.AggregatedPowerStatsConfig.POWER_STATE_OTHER;
+import static com.android.server.power.stats.AggregatedPowerStatsConfig.SCREEN_STATE_ON;
+import static com.android.server.power.stats.AggregatedPowerStatsConfig.SCREEN_STATE_OTHER;
+import static com.android.server.power.stats.AggregatedPowerStatsConfig.STATE_POWER;
+import static com.android.server.power.stats.AggregatedPowerStatsConfig.STATE_PROCESS_STATE;
+import static com.android.server.power.stats.AggregatedPowerStatsConfig.STATE_SCREEN;
+
+import static com.google.common.truth.Truth.assertThat;
+
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
+import android.bluetooth.BluetoothActivityEnergyInfo;
+import android.bluetooth.BluetoothAdapter;
+import android.bluetooth.UidTraffic;
+import android.content.Context;
+import android.content.pm.PackageManager;
+import android.hardware.power.stats.EnergyConsumerType;
+import android.os.BatteryConsumer;
+import android.os.Handler;
+import android.os.Parcel;
+import android.os.Process;
+import android.platform.test.ravenwood.RavenwoodRule;
+import android.util.SparseLongArray;
+
+import com.android.internal.os.Clock;
+import com.android.internal.os.PowerProfile;
+import com.android.server.power.stats.BluetoothPowerStatsCollector.BluetoothStatsRetriever;
+
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+
+import java.util.List;
+import java.util.concurrent.Executor;
+import java.util.function.IntSupplier;
+
+public class BluetoothPowerStatsProcessorTest {
+
+ @Rule(order = 0)
+ public final RavenwoodRule mRavenwood = new RavenwoodRule.Builder()
+ .setProvideMainThread(true)
+ .build();
+
+ private static final double PRECISION = 0.00001;
+ private static final int APP_UID1 = Process.FIRST_APPLICATION_UID + 42;
+ private static final int APP_UID2 = Process.FIRST_APPLICATION_UID + 101;
+ private static final int BLUETOOTH_ENERGY_CONSUMER_ID = 1;
+ private static final int VOLTAGE_MV = 3500;
+
+ @Rule(order = 1)
+ public final BatteryUsageStatsRule mStatsRule = new BatteryUsageStatsRule()
+ .setAveragePower(PowerProfile.POWER_BLUETOOTH_CONTROLLER_RX, 50.0)
+ .setAveragePower(PowerProfile.POWER_BLUETOOTH_CONTROLLER_TX, 100.0)
+ .setAveragePower(PowerProfile.POWER_BLUETOOTH_CONTROLLER_IDLE, 10.0)
+ .initMeasuredEnergyStatsLocked();
+
+ @Mock
+ private Context mContext;
+ @Mock
+ private PackageManager mPackageManager;
+ @Mock
+ private PowerStatsCollector.ConsumedEnergyRetriever mConsumedEnergyRetriever;
+ private final PowerStatsUidResolver mPowerStatsUidResolver = new PowerStatsUidResolver();
+
+ private BluetoothActivityEnergyInfo mBluetoothActivityEnergyInfo;
+ private final SparseLongArray mUidScanTimes = new SparseLongArray();
+
+ private final BluetoothPowerStatsCollector.BluetoothStatsRetriever mBluetoothStatsRetriever =
+ new BluetoothPowerStatsCollector.BluetoothStatsRetriever() {
+ @Override
+ public void retrieveBluetoothScanTimes(Callback callback) {
+ for (int i = 0; i < mUidScanTimes.size(); i++) {
+ callback.onBluetoothScanTime(mUidScanTimes.keyAt(i),
+ mUidScanTimes.valueAt(i));
+ }
+ }
+
+ @Override
+ public boolean requestControllerActivityEnergyInfo(Executor executor,
+ BluetoothAdapter.OnBluetoothActivityEnergyInfoCallback callback) {
+ callback.onBluetoothActivityEnergyInfoAvailable(mBluetoothActivityEnergyInfo);
+ return true;
+ }
+ };
+
+ private final BluetoothPowerStatsCollector.Injector mInjector =
+ new BluetoothPowerStatsCollector.Injector() {
+ @Override
+ public Handler getHandler() {
+ return mStatsRule.getHandler();
+ }
+
+ @Override
+ public Clock getClock() {
+ return mStatsRule.getMockClock();
+ }
+
+ @Override
+ public PowerStatsUidResolver getUidResolver() {
+ return mPowerStatsUidResolver;
+ }
+
+ @Override
+ public long getPowerStatsCollectionThrottlePeriod(String powerComponentName) {
+ return 0;
+ }
+
+ @Override
+ public PackageManager getPackageManager() {
+ return mPackageManager;
+ }
+
+ @Override
+ public PowerStatsCollector.ConsumedEnergyRetriever getConsumedEnergyRetriever() {
+ return mConsumedEnergyRetriever;
+ }
+
+ @Override
+ public IntSupplier getVoltageSupplier() {
+ return () -> VOLTAGE_MV;
+ }
+
+ @Override
+ public BluetoothStatsRetriever getBluetoothStatsRetriever() {
+ return mBluetoothStatsRetriever;
+ }
+ };
+
+ @Before
+ public void setup() {
+ MockitoAnnotations.initMocks(this);
+
+ when(mContext.getPackageManager()).thenReturn(mPackageManager);
+ when(mPackageManager.hasSystemFeature(PackageManager.FEATURE_BLUETOOTH)).thenReturn(true);
+ }
+
+ @Test
+ public void powerProfileModel_mostlyDataTransfer() {
+ // No power monitoring hardware
+ when(mConsumedEnergyRetriever.getEnergyConsumerIds(EnergyConsumerType.BLUETOOTH))
+ .thenReturn(new int[0]);
+
+ BluetoothPowerStatsProcessor processor =
+ new BluetoothPowerStatsProcessor(mStatsRule.getPowerProfile());
+
+ PowerComponentAggregatedPowerStats aggregatedStats = createAggregatedPowerStats(processor);
+
+ BluetoothPowerStatsCollector collector = new BluetoothPowerStatsCollector(mInjector);
+ collector.setEnabled(true);
+ mBluetoothActivityEnergyInfo = mockBluetoothActivityEnergyInfo(1000, 600, 100, 200,
+ mockUidTraffic(APP_UID1, 100, 200),
+ mockUidTraffic(APP_UID2, 300, 400));
+
+ mUidScanTimes.put(APP_UID1, 100);
+
+ // Establish a baseline
+ aggregatedStats.addPowerStats(collector.collectStats(), 0);
+
+ // Turn the screen off after 2.5 seconds
+ aggregatedStats.setState(STATE_SCREEN, SCREEN_STATE_OTHER, 2500);
+ aggregatedStats.setUidState(APP_UID1, STATE_PROCESS_STATE, PROCESS_STATE_BACKGROUND, 2500);
+ aggregatedStats.setUidState(APP_UID1, STATE_PROCESS_STATE, PROCESS_STATE_FOREGROUND_SERVICE,
+ 5000);
+
+ mBluetoothActivityEnergyInfo = mockBluetoothActivityEnergyInfo(1100, 6600, 1100, 2200,
+ mockUidTraffic(APP_UID1, 1100, 2200),
+ mockUidTraffic(APP_UID2, 3300, 4400));
+
+ mUidScanTimes.clear();
+ mUidScanTimes.put(APP_UID1, 200);
+ mUidScanTimes.put(APP_UID2, 300);
+
+ mStatsRule.setTime(10_000, 10_000);
+
+ aggregatedStats.addPowerStats(collector.collectStats(), 10_000);
+
+ processor.finish(aggregatedStats);
+
+ BluetoothPowerStatsLayout statsLayout =
+ new BluetoothPowerStatsLayout(aggregatedStats.getPowerStatsDescriptor());
+
+ // RX power = 'rx-duration * PowerProfile[bluetooth.controller.rx]`
+ // RX power = 6000 * 50 = 300000 mA-ms = 0.083333 mAh
+ // TX power = 'tx-duration * PowerProfile[bluetooth.controller.tx]`
+ // TX power = 1000 * 100 = 100000 mA-ms = 0.02777 mAh
+ // Idle power = 'idle-duration * PowerProfile[bluetooth.controller.idle]`
+ // Idle power = 2000 * 10 = 20000 mA-ms = 0.00555 mAh
+ // Total power = RX + TX + Idle = 0.116666
+ // Screen-on - 25%
+ // Screen-off - 75%
+ double expectedPower = 0.116666;
+ long[] deviceStats = new long[aggregatedStats.getPowerStatsDescriptor().statsArrayLength];
+ aggregatedStats.getDeviceStats(deviceStats, states(POWER_STATE_OTHER, SCREEN_STATE_ON));
+ assertThat(statsLayout.getDevicePowerEstimate(deviceStats))
+ .isWithin(PRECISION).of(expectedPower * 0.25);
+
+ aggregatedStats.getDeviceStats(deviceStats, states(POWER_STATE_OTHER, SCREEN_STATE_OTHER));
+ assertThat(statsLayout.getDevicePowerEstimate(deviceStats))
+ .isWithin(PRECISION).of(expectedPower * 0.75);
+
+ // UID1 =
+ // (1000 / 4000) * 0.083333 // rx
+ // + (2000 / 6000) * 0.027777 // tx
+ // = 0.030092 mAh
+ double expectedPower1 = 0.030092;
+ long[] uidStats = new long[aggregatedStats.getPowerStatsDescriptor().uidStatsArrayLength];
+ aggregatedStats.getUidStats(uidStats, APP_UID1,
+ states(POWER_STATE_OTHER, SCREEN_STATE_ON, PROCESS_STATE_FOREGROUND));
+ assertThat(statsLayout.getUidPowerEstimate(uidStats))
+ .isWithin(PRECISION).of(expectedPower1 * 0.25);
+
+ aggregatedStats.getUidStats(uidStats, APP_UID1,
+ states(POWER_STATE_OTHER, SCREEN_STATE_OTHER, PROCESS_STATE_BACKGROUND));
+ assertThat(statsLayout.getUidPowerEstimate(uidStats))
+ .isWithin(PRECISION).of(expectedPower1 * 0.25);
+
+ aggregatedStats.getUidStats(uidStats, APP_UID1,
+ states(POWER_STATE_OTHER, SCREEN_STATE_OTHER, PROCESS_STATE_FOREGROUND_SERVICE));
+ assertThat(statsLayout.getUidPowerEstimate(uidStats))
+ .isWithin(PRECISION).of(expectedPower1 * 0.5);
+
+ // UID2 =
+ // (3000 / 4000) * 0.083333 // rx
+ // + (4000 / 6000) * 0.027777 // tx
+ // = 0.08102 mAh
+ double expectedPower2 = 0.08102;
+ aggregatedStats.getUidStats(uidStats, APP_UID2,
+ states(POWER_STATE_OTHER, SCREEN_STATE_ON, PROCESS_STATE_CACHED));
+ assertThat(statsLayout.getUidPowerEstimate(uidStats))
+ .isWithin(PRECISION).of(expectedPower2 * 0.25);
+
+ aggregatedStats.getUidStats(uidStats, APP_UID2,
+ states(POWER_STATE_OTHER, SCREEN_STATE_OTHER, PROCESS_STATE_CACHED));
+ assertThat(statsLayout.getUidPowerEstimate(uidStats))
+ .isWithin(PRECISION).of(expectedPower2 * 0.75);
+ }
+
+ @Test
+ public void powerProfileModel_mostlyScan() {
+ // No power monitoring hardware
+ when(mConsumedEnergyRetriever.getEnergyConsumerIds(EnergyConsumerType.BLUETOOTH))
+ .thenReturn(new int[0]);
+
+ BluetoothPowerStatsProcessor processor =
+ new BluetoothPowerStatsProcessor(mStatsRule.getPowerProfile());
+
+ PowerComponentAggregatedPowerStats aggregatedStats = createAggregatedPowerStats(processor);
+
+ BluetoothPowerStatsCollector collector = new BluetoothPowerStatsCollector(mInjector);
+ collector.setEnabled(true);
+ mBluetoothActivityEnergyInfo = mockBluetoothActivityEnergyInfo(1000, 600, 100, 200,
+ mockUidTraffic(APP_UID1, 100, 200),
+ mockUidTraffic(APP_UID2, 300, 400));
+
+ mUidScanTimes.put(APP_UID1, 100);
+
+ // Establish a baseline
+ aggregatedStats.addPowerStats(collector.collectStats(), 0);
+
+ aggregatedStats.setState(STATE_SCREEN, SCREEN_STATE_OTHER, 2500);
+ aggregatedStats.setUidState(APP_UID1, STATE_PROCESS_STATE, PROCESS_STATE_BACKGROUND, 2500);
+ aggregatedStats.setUidState(APP_UID1, STATE_PROCESS_STATE, PROCESS_STATE_FOREGROUND_SERVICE,
+ 5000);
+
+ mBluetoothActivityEnergyInfo = mockBluetoothActivityEnergyInfo(1100, 6600, 1100, 2200,
+ mockUidTraffic(APP_UID1, 1100, 2200),
+ mockUidTraffic(APP_UID2, 3300, 4400));
+
+ // Total scan time exceeding data transfer times
+ mUidScanTimes.clear();
+ mUidScanTimes.put(APP_UID1, 3100);
+ mUidScanTimes.put(APP_UID2, 5000);
+
+ mStatsRule.setTime(10_000, 10_000);
+
+ aggregatedStats.addPowerStats(collector.collectStats(), 10_000);
+
+ processor.finish(aggregatedStats);
+
+ BluetoothPowerStatsLayout statsLayout =
+ new BluetoothPowerStatsLayout(aggregatedStats.getPowerStatsDescriptor());
+
+ // RX power = 'rx-duration * PowerProfile[bluetooth.controller.rx]`
+ // RX power = 6000 * 50 = 300000 mA-ms = 0.083333 mAh
+ // TX power = 'tx-duration * PowerProfile[bluetooth.controller.tx]`
+ // TX power = 1000 * 100 = 100000 mA-ms = 0.02777 mAh
+ // Idle power = 'idle-duration * PowerProfile[bluetooth.controller.idle]`
+ // Idle power = 2000 * 10 = 20000 mA-ms = 0.00555 mAh
+ // Total power = RX + TX + Idle = 0.116666
+ double expectedPower = 0.116666;
+ long[] deviceStats = new long[aggregatedStats.getPowerStatsDescriptor().statsArrayLength];
+ aggregatedStats.getDeviceStats(deviceStats, states(POWER_STATE_OTHER, SCREEN_STATE_ON));
+ assertThat(statsLayout.getDevicePowerEstimate(deviceStats))
+ .isWithin(PRECISION).of(expectedPower * 0.25);
+
+ aggregatedStats.getDeviceStats(deviceStats, states(POWER_STATE_OTHER, SCREEN_STATE_OTHER));
+ assertThat(statsLayout.getDevicePowerEstimate(deviceStats))
+ .isWithin(PRECISION).of(expectedPower * 0.75);
+
+ // UID1 =
+ // (3000 / 8000) * 0.083333 // rx
+ // + (3000 / 8000) * 0.027777 // tx
+ // = 0.041666 mAh
+ double expectedPower1 = 0.041666;
+ long[] uidStats = new long[aggregatedStats.getPowerStatsDescriptor().uidStatsArrayLength];
+ aggregatedStats.getUidStats(uidStats, APP_UID1,
+ states(POWER_STATE_OTHER, SCREEN_STATE_ON, PROCESS_STATE_FOREGROUND));
+ assertThat(statsLayout.getUidPowerEstimate(uidStats))
+ .isWithin(PRECISION).of(expectedPower1 * 0.25);
+
+ aggregatedStats.getUidStats(uidStats, APP_UID1,
+ states(POWER_STATE_OTHER, SCREEN_STATE_OTHER, PROCESS_STATE_BACKGROUND));
+ assertThat(statsLayout.getUidPowerEstimate(uidStats))
+ .isWithin(PRECISION).of(expectedPower1 * 0.25);
+
+ aggregatedStats.getUidStats(uidStats, APP_UID1,
+ states(POWER_STATE_OTHER, SCREEN_STATE_OTHER, PROCESS_STATE_FOREGROUND_SERVICE));
+ assertThat(statsLayout.getUidPowerEstimate(uidStats))
+ .isWithin(PRECISION).of(expectedPower1 * 0.5);
+
+ // UID2 =
+ // (5000 / 8000) * 0.083333 // rx
+ // + (5000 / 8000) * 0.027777 // tx
+ // = 0.069443 mAh
+ double expectedPower2 = 0.069443;
+ aggregatedStats.getUidStats(uidStats, APP_UID2,
+ states(POWER_STATE_OTHER, SCREEN_STATE_ON, PROCESS_STATE_CACHED));
+ assertThat(statsLayout.getUidPowerEstimate(uidStats))
+ .isWithin(PRECISION).of(expectedPower2 * 0.25);
+
+ aggregatedStats.getUidStats(uidStats, APP_UID2,
+ states(POWER_STATE_OTHER, SCREEN_STATE_OTHER, PROCESS_STATE_CACHED));
+ assertThat(statsLayout.getUidPowerEstimate(uidStats))
+ .isWithin(PRECISION).of(expectedPower2 * 0.75);
+ }
+
+ @Test
+ public void consumedEnergyModel() {
+ // No power monitoring hardware
+ when(mConsumedEnergyRetriever.getEnergyConsumerIds(EnergyConsumerType.BLUETOOTH))
+ .thenReturn(new int[]{BLUETOOTH_ENERGY_CONSUMER_ID});
+
+ BluetoothPowerStatsProcessor processor =
+ new BluetoothPowerStatsProcessor(mStatsRule.getPowerProfile());
+
+ PowerComponentAggregatedPowerStats aggregatedStats = createAggregatedPowerStats(processor);
+
+ BluetoothPowerStatsCollector collector = new BluetoothPowerStatsCollector(mInjector);
+ collector.setEnabled(true);
+ mBluetoothActivityEnergyInfo = mockBluetoothActivityEnergyInfo(1000, 600, 100, 200,
+ mockUidTraffic(APP_UID1, 100, 200),
+ mockUidTraffic(APP_UID2, 300, 400));
+
+ mUidScanTimes.put(APP_UID1, 100);
+
+ when(mConsumedEnergyRetriever.getConsumedEnergyUws(
+ new int[]{BLUETOOTH_ENERGY_CONSUMER_ID})).thenReturn(new long[]{0});
+
+ // Establish a baseline
+ aggregatedStats.addPowerStats(collector.collectStats(), 0);
+
+ // Turn the screen off after 2.5 seconds
+ aggregatedStats.setState(STATE_SCREEN, SCREEN_STATE_OTHER, 2500);
+ aggregatedStats.setUidState(APP_UID1, STATE_PROCESS_STATE, PROCESS_STATE_BACKGROUND, 2500);
+ aggregatedStats.setUidState(APP_UID1, STATE_PROCESS_STATE, PROCESS_STATE_FOREGROUND_SERVICE,
+ 5000);
+
+ mBluetoothActivityEnergyInfo = mockBluetoothActivityEnergyInfo(1100, 6600, 1100, 2200,
+ mockUidTraffic(APP_UID1, 1100, 2200),
+ mockUidTraffic(APP_UID2, 3300, 4400));
+
+ mUidScanTimes.clear();
+ mUidScanTimes.put(APP_UID1, 200);
+ mUidScanTimes.put(APP_UID2, 300);
+
+ mStatsRule.setTime(10_000, 10_000);
+
+ // 10 mAh represented as microWattSeconds
+ long energyUws = 10 * 3600 * VOLTAGE_MV;
+ when(mConsumedEnergyRetriever.getConsumedEnergyUws(
+ new int[]{BLUETOOTH_ENERGY_CONSUMER_ID})).thenReturn(new long[]{energyUws});
+
+ aggregatedStats.addPowerStats(collector.collectStats(), 10_000);
+
+ processor.finish(aggregatedStats);
+
+ BluetoothPowerStatsLayout statsLayout =
+ new BluetoothPowerStatsLayout(aggregatedStats.getPowerStatsDescriptor());
+
+ // All estimates are computed as in the #powerProfileModel_mostlyDataTransfer test,
+ // except they are all scaled by the same ratio to ensure that the total estimated
+ // energy is equal to the measured energy
+ double expectedPower = 10;
+ long[] deviceStats = new long[aggregatedStats.getPowerStatsDescriptor().statsArrayLength];
+ aggregatedStats.getDeviceStats(deviceStats, states(POWER_STATE_OTHER, SCREEN_STATE_ON));
+ assertThat(statsLayout.getDevicePowerEstimate(deviceStats))
+ .isWithin(PRECISION).of(expectedPower * 0.25);
+
+ aggregatedStats.getDeviceStats(deviceStats, states(POWER_STATE_OTHER, SCREEN_STATE_OTHER));
+ assertThat(statsLayout.getDevicePowerEstimate(deviceStats))
+ .isWithin(PRECISION).of(expectedPower * 0.75);
+
+ // UID1
+ // 0.030092 // power profile model estimate
+ // 0.116666 // power profile model estimate for total power
+ // 10 // total consumed energy
+ // = 0.030092 * (10 / 0.116666) = 2.579365
+ double expectedPower1 = 2.579365;
+ long[] uidStats = new long[aggregatedStats.getPowerStatsDescriptor().uidStatsArrayLength];
+ aggregatedStats.getUidStats(uidStats, APP_UID1,
+ states(POWER_STATE_OTHER, SCREEN_STATE_ON, PROCESS_STATE_FOREGROUND));
+ assertThat(statsLayout.getUidPowerEstimate(uidStats))
+ .isWithin(PRECISION).of(expectedPower1 * 0.25);
+
+ aggregatedStats.getUidStats(uidStats, APP_UID1,
+ states(POWER_STATE_OTHER, SCREEN_STATE_OTHER, PROCESS_STATE_BACKGROUND));
+ assertThat(statsLayout.getUidPowerEstimate(uidStats))
+ .isWithin(PRECISION).of(expectedPower1 * 0.25);
+
+ aggregatedStats.getUidStats(uidStats, APP_UID1,
+ states(POWER_STATE_OTHER, SCREEN_STATE_OTHER, PROCESS_STATE_FOREGROUND_SERVICE));
+ assertThat(statsLayout.getUidPowerEstimate(uidStats))
+ .isWithin(PRECISION).of(expectedPower1 * 0.5);
+
+ // UID2 =
+ // 0.08102 // power profile model estimate
+ // 0.116666 // power profile model estimate for total power
+ // 10 // total consumed energy
+ // = 0.08102 * (10 / 0.116666) = 6.944444
+ double expectedPower2 = 6.944444;
+ aggregatedStats.getUidStats(uidStats, APP_UID2,
+ states(POWER_STATE_OTHER, SCREEN_STATE_ON, PROCESS_STATE_CACHED));
+ assertThat(statsLayout.getUidPowerEstimate(uidStats))
+ .isWithin(PRECISION).of(expectedPower2 * 0.25);
+
+ aggregatedStats.getUidStats(uidStats, APP_UID2,
+ states(POWER_STATE_OTHER, SCREEN_STATE_OTHER, PROCESS_STATE_CACHED));
+ assertThat(statsLayout.getUidPowerEstimate(uidStats))
+ .isWithin(PRECISION).of(expectedPower2 * 0.75);
+ }
+
+ private static PowerComponentAggregatedPowerStats createAggregatedPowerStats(
+ BluetoothPowerStatsProcessor processor) {
+ AggregatedPowerStatsConfig.PowerComponent config =
+ new AggregatedPowerStatsConfig.PowerComponent(
+ BatteryConsumer.POWER_COMPONENT_BLUETOOTH)
+ .trackDeviceStates(STATE_POWER, STATE_SCREEN)
+ .trackUidStates(STATE_POWER, STATE_SCREEN, STATE_PROCESS_STATE)
+ .setProcessor(processor);
+
+ PowerComponentAggregatedPowerStats aggregatedStats =
+ new PowerComponentAggregatedPowerStats(
+ new AggregatedPowerStats(mock(AggregatedPowerStatsConfig.class)), config);
+
+ aggregatedStats.setState(STATE_POWER, POWER_STATE_OTHER, 0);
+ aggregatedStats.setState(STATE_SCREEN, SCREEN_STATE_ON, 0);
+ aggregatedStats.setUidState(APP_UID1, STATE_PROCESS_STATE, PROCESS_STATE_FOREGROUND, 0);
+ aggregatedStats.setUidState(APP_UID2, STATE_PROCESS_STATE, PROCESS_STATE_CACHED, 0);
+
+ return aggregatedStats;
+ }
+
+ private int[] states(int... states) {
+ return states;
+ }
+
+ private BluetoothActivityEnergyInfo mockBluetoothActivityEnergyInfo(long timestamp,
+ long rxTimeMs, long txTimeMs, long idleTimeMs, UidTraffic... uidTraffic) {
+ if (RavenwoodRule.isOnRavenwood()) {
+ BluetoothActivityEnergyInfo info = mock(BluetoothActivityEnergyInfo.class);
+ when(info.getControllerRxTimeMillis()).thenReturn(rxTimeMs);
+ when(info.getControllerTxTimeMillis()).thenReturn(txTimeMs);
+ when(info.getControllerIdleTimeMillis()).thenReturn(idleTimeMs);
+ when(info.getUidTraffic()).thenReturn(List.of(uidTraffic));
+ return info;
+ } else {
+ final Parcel btActivityEnergyInfoParcel = Parcel.obtain();
+ btActivityEnergyInfoParcel.writeLong(timestamp);
+ btActivityEnergyInfoParcel.writeInt(
+ BluetoothActivityEnergyInfo.BT_STACK_STATE_STATE_ACTIVE);
+ btActivityEnergyInfoParcel.writeLong(txTimeMs);
+ btActivityEnergyInfoParcel.writeLong(rxTimeMs);
+ btActivityEnergyInfoParcel.writeLong(idleTimeMs);
+ btActivityEnergyInfoParcel.writeLong(0L);
+ btActivityEnergyInfoParcel.writeTypedList(List.of(uidTraffic));
+ btActivityEnergyInfoParcel.setDataPosition(0);
+
+ BluetoothActivityEnergyInfo info = BluetoothActivityEnergyInfo.CREATOR
+ .createFromParcel(btActivityEnergyInfoParcel);
+ btActivityEnergyInfoParcel.recycle();
+ return info;
+ }
+ }
+
+ private UidTraffic mockUidTraffic(int uid, long rxBytes, long txBytes) {
+ if (RavenwoodRule.isOnRavenwood()) {
+ UidTraffic traffic = mock(UidTraffic.class);
+ when(traffic.getUid()).thenReturn(uid);
+ when(traffic.getRxBytes()).thenReturn(rxBytes);
+ when(traffic.getTxBytes()).thenReturn(txBytes);
+ return traffic;
+ } else {
+ final Parcel uidTrafficParcel = Parcel.obtain();
+ uidTrafficParcel.writeInt(uid);
+ uidTrafficParcel.writeLong(rxBytes);
+ uidTrafficParcel.writeLong(txBytes);
+ uidTrafficParcel.setDataPosition(0);
+
+ UidTraffic traffic = UidTraffic.CREATOR.createFromParcel(uidTrafficParcel);
+ uidTrafficParcel.recycle();
+ return traffic;
+ }
+ }
+}
diff --git a/services/tests/servicestests/src/com/android/server/accessibility/AccessibilityManagerServiceTest.java b/services/tests/servicestests/src/com/android/server/accessibility/AccessibilityManagerServiceTest.java
index cb4fc753aa4d..6152326bb6d4 100644
--- a/services/tests/servicestests/src/com/android/server/accessibility/AccessibilityManagerServiceTest.java
+++ b/services/tests/servicestests/src/com/android/server/accessibility/AccessibilityManagerServiceTest.java
@@ -30,7 +30,9 @@ import static com.android.window.flags.Flags.FLAG_ALWAYS_DRAW_MAGNIFICATION_FULL
import static com.google.common.truth.Truth.assertThat;
+import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertThrows;
+import static org.junit.Assert.assertTrue;
import static org.junit.Assume.assumeTrue;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyBoolean;
@@ -42,6 +44,7 @@ import static org.mockito.Mockito.doCallRealMethod;
import static org.mockito.Mockito.doThrow;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
+import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.timeout;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
@@ -102,6 +105,7 @@ import com.android.internal.accessibility.common.ShortcutConstants.UserShortcutT
import com.android.internal.accessibility.util.AccessibilityUtils;
import com.android.internal.accessibility.util.ShortcutUtils;
import com.android.internal.compat.IPlatformCompat;
+import com.android.internal.content.PackageMonitor;
import com.android.server.LocalServices;
import com.android.server.accessibility.AccessibilityManagerService.AccessibilityDisplayListener;
import com.android.server.accessibility.magnification.FullScreenMagnificationController;
@@ -910,6 +914,38 @@ public class AccessibilityManagerServiceTest {
}
@Test
+ public void onPackageChanged_disableComponent_updateInstalledServices() {
+ // Sets up two accessibility services as installed services
+ setupShortcutTargetServices();
+ assertThat(mA11yms.getCurrentUserState().mInstalledServices).hasSize(2);
+ AccessibilityServiceInfo installedService1 =
+ mA11yms.getCurrentUserState().mInstalledServices.getFirst();
+ ResolveInfo resolveInfo1 = installedService1.getResolveInfo();
+ AccessibilityServiceInfo installedService2 =
+ mA11yms.getCurrentUserState().mInstalledServices.getLast();
+
+ // Disables `installedService2`
+ when(mMockPackageManager.queryIntentServicesAsUser(any(), anyInt(), anyInt()))
+ .thenReturn(List.of(resolveInfo1));
+ when(mMockSecurityPolicy.canRegisterService(any())).thenReturn(true);
+ final Intent packageIntent = new Intent(Intent.ACTION_PACKAGE_CHANGED);
+ packageIntent.setData(
+ Uri.parse("package:" + installedService2.getResolveInfo().serviceInfo.packageName));
+ packageIntent.putExtra(Intent.EXTRA_UID, UserHandle.myUserId());
+ packageIntent.putExtra(Intent.EXTRA_USER_HANDLE, mA11yms.getCurrentUserIdLocked());
+ packageIntent.putExtra(Intent.EXTRA_CHANGED_COMPONENT_NAME_LIST,
+ new String[]{
+ installedService2.getComponentName().flattenToString()});
+ mA11yms.getPackageMonitor().doHandlePackageEvent(packageIntent);
+
+ assertThat(mA11yms.getCurrentUserState().mInstalledServices).hasSize(1);
+ ComponentName installedService =
+ mA11yms.getCurrentUserState().mInstalledServices.getFirst().getComponentName();
+ assertThat(installedService)
+ .isEqualTo(installedService1.getComponentName());
+ }
+
+ @Test
public void testSwitchUserScanPackages_scansWithoutHoldingLock() {
setupAccessibilityServiceConnection(0);
final AtomicReference<Set<Boolean>> lockState = collectLockStateWhilePackageScanning();
@@ -1620,6 +1656,67 @@ public class AccessibilityManagerServiceTest {
.containsExactlyElementsIn(Set.of(daltonizerTile));
}
+ @Test
+ @EnableFlags(Flags.FLAG_MANAGER_PACKAGE_MONITOR_LOGIC_FIX)
+ public void onHandleForceStop_dontDoIt_packageEnabled_returnsTrue() {
+ setupShortcutTargetServices();
+ AccessibilityUserState userState = mA11yms.getCurrentUserState();
+ userState.mEnabledServices.addAll(
+ userState.mInstalledServices.stream().map(
+ (AccessibilityServiceInfo::getComponentName)).toList());
+ String[] packages = userState.mEnabledServices.stream().map(
+ ComponentName::getPackageName).toList().toArray(new String[0]);
+
+ PackageMonitor monitor = spy(mA11yms.getPackageMonitor());
+ when(monitor.getChangingUserId()).thenReturn(UserHandle.USER_SYSTEM);
+ mA11yms.setPackageMonitor(monitor);
+
+ assertTrue(mA11yms.getPackageMonitor().onHandleForceStop(
+ new Intent(),
+ packages,
+ UserHandle.USER_SYSTEM,
+ false
+ ));
+ }
+
+ @Test
+ @EnableFlags(Flags.FLAG_MANAGER_PACKAGE_MONITOR_LOGIC_FIX)
+ public void onHandleForceStop_doIt_packageEnabled_returnsFalse() {
+ setupShortcutTargetServices();
+ AccessibilityUserState userState = mA11yms.getCurrentUserState();
+ userState.mEnabledServices.addAll(
+ userState.mInstalledServices.stream().map(
+ (AccessibilityServiceInfo::getComponentName)).toList());
+ String[] packages = userState.mEnabledServices.stream().map(
+ ComponentName::getPackageName).toList().toArray(new String[0]);
+
+ PackageMonitor monitor = spy(mA11yms.getPackageMonitor());
+ when(monitor.getChangingUserId()).thenReturn(UserHandle.USER_SYSTEM);
+ mA11yms.setPackageMonitor(monitor);
+
+ assertFalse(mA11yms.getPackageMonitor().onHandleForceStop(
+ new Intent(),
+ packages,
+ UserHandle.USER_SYSTEM,
+ true
+ ));
+ }
+
+ @Test
+ @EnableFlags(Flags.FLAG_MANAGER_PACKAGE_MONITOR_LOGIC_FIX)
+ public void onHandleForceStop_dontDoIt_packageNotEnabled_returnsFalse() {
+ PackageMonitor monitor = spy(mA11yms.getPackageMonitor());
+ when(monitor.getChangingUserId()).thenReturn(UserHandle.USER_SYSTEM);
+ mA11yms.setPackageMonitor(monitor);
+
+ assertFalse(mA11yms.getPackageMonitor().onHandleForceStop(
+ new Intent(),
+ new String[]{ "FOO", "BAR"},
+ UserHandle.USER_SYSTEM,
+ false
+ ));
+ }
+
private static AccessibilityServiceInfo mockAccessibilityServiceInfo(
ComponentName componentName) {
return mockAccessibilityServiceInfo(
@@ -1630,7 +1727,7 @@ public class AccessibilityManagerServiceTest {
ComponentName componentName,
boolean isSystemApp, boolean isAlwaysOnService) {
AccessibilityServiceInfo accessibilityServiceInfo =
- Mockito.spy(new AccessibilityServiceInfo());
+ spy(new AccessibilityServiceInfo());
accessibilityServiceInfo.setComponentName(componentName);
ResolveInfo mockResolveInfo = Mockito.mock(ResolveInfo.class);
when(accessibilityServiceInfo.getResolveInfo()).thenReturn(mockResolveInfo);
diff --git a/services/tests/servicestests/src/com/android/server/os/BugreportManagerServiceImplTest.java b/services/tests/servicestests/src/com/android/server/os/BugreportManagerServiceImplTest.java
index 9862663c37b2..1db97b9ede81 100644
--- a/services/tests/servicestests/src/com/android/server/os/BugreportManagerServiceImplTest.java
+++ b/services/tests/servicestests/src/com/android/server/os/BugreportManagerServiceImplTest.java
@@ -186,7 +186,8 @@ public class BugreportManagerServiceImplTest {
new FileDescriptor(), /* screenshotFd= */ null,
BugreportParams.BUGREPORT_MODE_FULL,
/* flags= */ 0, new Listener(new CountDownLatch(1)),
- /* isScreenshotRequested= */ false);
+ /* isScreenshotRequested= */ false,
+ /* skipUserConsentUnused = */ false);
assertThat(mInjector.isBugreportStarted()).isTrue();
}
@@ -202,7 +203,8 @@ public class BugreportManagerServiceImplTest {
new FileDescriptor(), /* screenshotFd= */ null,
BugreportParams.BUGREPORT_MODE_FULL,
/* flags= */ 0, new Listener(new CountDownLatch(1)),
- /* isScreenshotRequested= */ false);
+ /* isScreenshotRequested= */ false,
+ /* skipUserConsentUnused = */ false);
assertThat(mInjector.isBugreportStarted()).isTrue();
}
@@ -216,7 +218,8 @@ public class BugreportManagerServiceImplTest {
new FileDescriptor(), /* screenshotFd= */ null,
BugreportParams.BUGREPORT_MODE_FULL,
/* flags= */ 0, new Listener(new CountDownLatch(1)),
- /* isScreenshotRequested= */ false));
+ /* isScreenshotRequested= */ false,
+ /* skipUserConsentUnused = */ false));
assertThat(thrown.getMessage()).contains("not an admin user");
}
@@ -232,7 +235,8 @@ public class BugreportManagerServiceImplTest {
new FileDescriptor(), /* screenshotFd= */ null,
BugreportParams.BUGREPORT_MODE_REMOTE,
/* flags= */ 0, new Listener(new CountDownLatch(1)),
- /* isScreenshotRequested= */ false));
+ /* isScreenshotRequested= */ false,
+ /* skipUserConsentUnused = */ false));
assertThat(thrown.getMessage()).contains("not affiliated to the device owner");
}
@@ -243,7 +247,7 @@ public class BugreportManagerServiceImplTest {
Listener listener = new Listener(latch);
mService.retrieveBugreport(Binder.getCallingUid(), mContext.getPackageName(),
mContext.getUserId(), new FileDescriptor(), mBugreportFile,
- /* keepOnRetrieval= */ false, listener);
+ /* keepOnRetrieval= */ false, /* skipUserConsent = */ false, listener);
assertThat(latch.await(5, TimeUnit.SECONDS)).isTrue();
assertThat(listener.getErrorCode()).isEqualTo(
BugreportCallback.BUGREPORT_ERROR_NO_BUGREPORT_TO_RETRIEVE);
diff --git a/services/tests/servicestests/src/com/android/server/usage/AppIdleHistoryTests.java b/services/tests/servicestests/src/com/android/server/usage/AppIdleHistoryTests.java
index 06726b031a36..55d93fb8d9dc 100644
--- a/services/tests/servicestests/src/com/android/server/usage/AppIdleHistoryTests.java
+++ b/services/tests/servicestests/src/com/android/server/usage/AppIdleHistoryTests.java
@@ -144,7 +144,9 @@ public class AppIdleHistoryTests extends AndroidTestCase {
assertEquals(aih.getAppStandbyReason(PACKAGE_4, USER_ID, 3000),
REASON_MAIN_FORCED_BY_USER);
- assertTrue(aih.shouldInformListeners(PACKAGE_1, USER_ID, 5000, STANDBY_BUCKET_RARE));
+ if (!Flags.avoidIdleCheck()) {
+ assertTrue(aih.shouldInformListeners(PACKAGE_1, USER_ID, 5000, STANDBY_BUCKET_RARE));
+ }
assertFalse(aih.shouldInformListeners(PACKAGE_1, USER_ID, 5000, STANDBY_BUCKET_RARE));
assertTrue(aih.shouldInformListeners(PACKAGE_1, USER_ID, 5000, STANDBY_BUCKET_FREQUENT));
}
@@ -243,4 +245,4 @@ public class AppIdleHistoryTests extends AndroidTestCase {
expectedExpiryTimeMs, actualExpiryTimeMs);
}
}
-} \ No newline at end of file
+}
diff --git a/services/tests/servicestests/test-apps/PackageParserApp/Android.bp b/services/tests/servicestests/test-apps/PackageParserApp/Android.bp
index 131b380d9215..3def48aefa00 100644
--- a/services/tests/servicestests/test-apps/PackageParserApp/Android.bp
+++ b/services/tests/servicestests/test-apps/PackageParserApp/Android.bp
@@ -116,3 +116,20 @@ android_test_helper_app {
resource_dirs: ["res"],
manifest: "AndroidManifestApp7.xml",
}
+
+android_test_helper_app {
+ name: "PackageParserTestApp8",
+ sdk_version: "current",
+ srcs: ["**/*.java"],
+ dex_preopt: {
+ enabled: false,
+ },
+ optimize: {
+ enabled: false,
+ },
+ resource_dirs: ["res"],
+ aaptflags: [
+ "--feature-flags my.flag1,my.flag2,my.flag3,my.flag4,unknown.flag",
+ ],
+ manifest: "AndroidManifestApp8.xml",
+}
diff --git a/services/tests/servicestests/test-apps/PackageParserApp/AndroidManifestApp8.xml b/services/tests/servicestests/test-apps/PackageParserApp/AndroidManifestApp8.xml
new file mode 100644
index 000000000000..d489c1bb9e07
--- /dev/null
+++ b/services/tests/servicestests/test-apps/PackageParserApp/AndroidManifestApp8.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2020 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.
+-->
+
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="com.android.servicestests.apps.packageparserapp" >
+
+ <application>
+ <activity android:name=".TestActivity"
+ android:exported="true" />
+ </application>
+
+ <permission android:name="PERM1" android:featureFlag="my.flag1 " />
+ <permission android:name="PERM2" android:featureFlag=" !my.flag2" />
+ <permission android:name="PERM3" android:featureFlag="my.flag3" />
+ <permission android:name="PERM4" android:featureFlag="!my.flag4" />
+ <permission android:name="PERM5" android:featureFlag="unknown.flag" />
+</manifest> \ No newline at end of file
diff --git a/services/tests/wmtests/src/com/android/server/wm/LetterboxUiControllerTest.java b/services/tests/wmtests/src/com/android/server/wm/LetterboxUiControllerTest.java
index 6b17de4c8640..c7f502045ac8 100644
--- a/services/tests/wmtests/src/com/android/server/wm/LetterboxUiControllerTest.java
+++ b/services/tests/wmtests/src/com/android/server/wm/LetterboxUiControllerTest.java
@@ -908,6 +908,24 @@ public class LetterboxUiControllerTest extends WindowTestsBase {
}
@Test
+ public void testOverrideOrientationIfNeeded_fullscreenOverride_cameraActivity_unchanged() {
+ doReturn(true).when(mLetterboxConfiguration).isCameraCompatTreatmentEnabled();
+ doReturn(true).when(mLetterboxConfiguration)
+ .isCameraCompatTreatmentEnabledAtBuildTime();
+
+ // Recreate DisplayContent with DisplayRotationCompatPolicy
+ mActivity = setUpActivityWithComponent();
+ mController = new LetterboxUiController(mWm, mActivity);
+ spyOn(mDisplayContent.mDisplayRotationCompatPolicy);
+
+ doReturn(false).when(mDisplayContent.mDisplayRotationCompatPolicy)
+ .isCameraActive(mActivity, /* mustBeFullscreen= */ true);
+
+ assertEquals(SCREEN_ORIENTATION_PORTRAIT, mController.overrideOrientationIfNeeded(
+ /* candidate */ SCREEN_ORIENTATION_PORTRAIT));
+ }
+
+ @Test
public void testOverrideOrientationIfNeeded_respectOrientationRequestOverUserFullScreen() {
spyOn(mController);
doReturn(true).when(mController).shouldApplyUserFullscreenOverride();
diff --git a/services/tests/wmtests/src/com/android/server/wm/TaskFragmentTest.java b/services/tests/wmtests/src/com/android/server/wm/TaskFragmentTest.java
index a90a158e0c2a..d57a7e61ad63 100644
--- a/services/tests/wmtests/src/com/android/server/wm/TaskFragmentTest.java
+++ b/services/tests/wmtests/src/com/android/server/wm/TaskFragmentTest.java
@@ -18,6 +18,7 @@ package com.android.server.wm;
import static android.Manifest.permission.EMBED_ANY_APP_IN_UNTRUSTED_MODE;
import static android.Manifest.permission.MANAGE_ACTIVITY_TASKS;
+import static android.app.WindowConfiguration.ACTIVITY_TYPE_HOME;
import static android.app.WindowConfiguration.ACTIVITY_TYPE_STANDARD;
import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
import static android.app.WindowConfiguration.WINDOWING_MODE_MULTI_WINDOW;
@@ -961,6 +962,22 @@ public class TaskFragmentTest extends WindowTestsBase {
assertEquals(appLeftTop, task.getDisplayContent().mFocusedApp);
}
+ @Test
+ public void testShouldBeVisible_invisibleForEmptyTaskFragment() {
+ final Task task = new TaskBuilder(mSupervisor).setCreateActivity(true)
+ .setWindowingMode(WINDOWING_MODE_FULLSCREEN).build();
+ final TaskFragment taskFragment = new TaskFragmentBuilder(mAtm)
+ .setParentTask(task)
+ .build();
+
+ // Empty taskFragment should be invisible
+ assertFalse(taskFragment.shouldBeVisible(null));
+
+ // Should be invisible even if it is ACTIVITY_TYPE_HOME.
+ when(taskFragment.getActivityType()).thenReturn(ACTIVITY_TYPE_HOME);
+ assertFalse(taskFragment.shouldBeVisible(null));
+ }
+
private WindowState createAppWindow(ActivityRecord app, String name) {
final WindowState win = createWindow(null, TYPE_BASE_APPLICATION, app, name,
0 /* ownerId */, false /* ownerCanAddInternalSystemWindow */, new TestIWindow());
diff --git a/services/tests/wmtests/src/com/android/server/wm/TestIWindow.java b/services/tests/wmtests/src/com/android/server/wm/TestIWindow.java
index 4fc222b3e038..788b624b2325 100644
--- a/services/tests/wmtests/src/com/android/server/wm/TestIWindow.java
+++ b/services/tests/wmtests/src/com/android/server/wm/TestIWindow.java
@@ -53,7 +53,7 @@ public class TestIWindow extends IWindow.Stub {
@Override
public void insetsControlChanged(InsetsState insetsState,
- InsetsSourceControl[] activeControls) {
+ InsetsSourceControl.Array activeControls) {
}
@Override
diff --git a/services/tests/wmtests/src/com/android/server/wm/WallpaperControllerTests.java b/services/tests/wmtests/src/com/android/server/wm/WallpaperControllerTests.java
index 5b1a18da3173..9b48cb9d328c 100644
--- a/services/tests/wmtests/src/com/android/server/wm/WallpaperControllerTests.java
+++ b/services/tests/wmtests/src/com/android/server/wm/WallpaperControllerTests.java
@@ -314,6 +314,18 @@ public class WallpaperControllerTests extends WindowTestsBase {
// Wallpaper is invisible because the lowest show-when-locked activity is opaque.
assertNull(wallpaperController.getWallpaperTarget());
+ // Only transient-launch transition will make notification shade as last resort target.
+ // This verifies that regular transition won't choose invisible keyguard as the target.
+ final WindowState keyguard = createWindow(null /* parent */,
+ WindowManager.LayoutParams.TYPE_NOTIFICATION_SHADE, "keyguard");
+ keyguard.mAttrs.flags |= FLAG_SHOW_WALLPAPER;
+ registerTestTransitionPlayer();
+ final Transition transition = wallpaperWindow.mTransitionController.createTransition(
+ WindowManager.TRANSIT_CHANGE);
+ transition.collect(keyguard);
+ wallpaperController.adjustWallpaperWindows();
+ assertNull(wallpaperController.getWallpaperTarget());
+
// A show-when-locked wallpaper is used for lockscreen. So the top wallpaper should
// be the one that is not show-when-locked.
final WindowState wallpaperWindow2 = createWallpaperWindow(mDisplayContent);
diff --git a/telephony/java/com/android/internal/telephony/ITelephony.aidl b/telephony/java/com/android/internal/telephony/ITelephony.aidl
index 65de7e479890..7d845a3c086c 100644
--- a/telephony/java/com/android/internal/telephony/ITelephony.aidl
+++ b/telephony/java/com/android/internal/telephony/ITelephony.aidl
@@ -3372,4 +3372,13 @@ interface ITelephony {
+ "android.Manifest.permission.SATELLITE_COMMUNICATION)")
void unregisterForCommunicationAllowedStateChanged(int subId,
in ISatelliteCommunicationAllowedStateCallback callback);
+
+ /**
+ * This API can be used by only CTS to override the boolean configs used by the
+ * DatagramController module.
+ *
+ * @param enable Whether to enable boolean config.
+ * @return {@code true} if the boolean config is set successfully, {@code false} otherwise.
+ */
+ boolean setDatagramControllerBooleanConfig(boolean reset, int booleanType, boolean enable);
}
diff --git a/tests/BinderLeakTest/Android.bp b/tests/BinderLeakTest/Android.bp
index 78b0ede76d4e..3747d049417f 100644
--- a/tests/BinderLeakTest/Android.bp
+++ b/tests/BinderLeakTest/Android.bp
@@ -24,6 +24,9 @@ java_defaults {
"androidx.test.rules",
"androidx.test.runner",
],
+ test_suites: [
+ "general-tests",
+ ],
}
// Built with target_sdk_version: current
diff --git a/tests/FlickerTests/Rotation/Android.bp b/tests/FlickerTests/Rotation/Android.bp
index b3eb934ef46d..aceb8bad256f 100644
--- a/tests/FlickerTests/Rotation/Android.bp
+++ b/tests/FlickerTests/Rotation/Android.bp
@@ -29,6 +29,10 @@ android_test {
defaults: ["FlickerTestsDefault"],
manifest: "AndroidManifest.xml",
test_config_template: "AndroidTestTemplate.xml",
+ test_suites: [
+ "device-tests",
+ "device-platinum-tests",
+ ],
srcs: ["src/**/*"],
static_libs: ["FlickerTestsBase"],
data: ["trace_config/*"],
diff --git a/tests/Input/src/com/android/test/input/InputDeviceTest.java b/tests/Input/src/com/android/test/input/InputDeviceTest.java
index 5f1bc8748db8..87a0de63120e 100644
--- a/tests/Input/src/com/android/test/input/InputDeviceTest.java
+++ b/tests/Input/src/com/android/test/input/InputDeviceTest.java
@@ -61,6 +61,7 @@ public class InputDeviceTest {
assertEquals(device.getMotionRanges().size(), outDevice.getMotionRanges().size());
assertEquals(device.getHostUsiVersion(), outDevice.getHostUsiVersion());
assertEquals(device.getAssociatedDisplayId(), outDevice.getAssociatedDisplayId());
+ assertEquals(device.isEnabled(), outDevice.isEnabled());
KeyCharacterMap keyCharacterMap = device.getKeyCharacterMap();
KeyCharacterMap outKeyCharacterMap = outDevice.getKeyCharacterMap();
@@ -100,7 +101,9 @@ public class InputDeviceTest {
.setKeyboardLanguageTag("en-US")
.setKeyboardLayoutType("qwerty")
.setUsiVersion(new HostUsiVersion(2, 0))
- .setShouldSmoothScroll(true);
+ .setShouldSmoothScroll(true)
+ .setAssociatedDisplayId(Display.DEFAULT_DISPLAY)
+ .setEnabled(false);
for (int i = 0; i < 30; i++) {
deviceBuilder.addMotionRange(
diff --git a/tools/hoststubgen/OWNERS b/tools/hoststubgen/OWNERS
index a8c5321307d1..3d8888d83cf4 100644
--- a/tools/hoststubgen/OWNERS
+++ b/tools/hoststubgen/OWNERS
@@ -1,3 +1 @@
-omakoto@google.com
-jsharkey@google.com
-jaggies@google.com
+file:platform/frameworks/base:/ravenwood/OWNERS
diff --git a/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/asm/AsmUtils.kt b/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/asm/AsmUtils.kt
index b8d18001f37b..3f2b13aed5c0 100644
--- a/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/asm/AsmUtils.kt
+++ b/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/asm/AsmUtils.kt
@@ -290,6 +290,16 @@ fun FieldNode.getVisibility(): Visibility {
return Visibility.fromAccess(this.access)
}
+/** Return the [access] flags without the visibility */
+fun clearVisibility(access: Int): Int {
+ return access and (Opcodes.ACC_PUBLIC or Opcodes.ACC_PROTECTED or Opcodes.ACC_PRIVATE).inv()
+}
+
+/** Return the visibility part of the [access] flags */
+fun getVisibility(access: Int): Int {
+ return access and (Opcodes.ACC_PUBLIC or Opcodes.ACC_PROTECTED or Opcodes.ACC_PRIVATE)
+}
+
/*
diff --git a/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/visitors/BaseAdapter.kt b/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/visitors/BaseAdapter.kt
index 6643492a1394..c99ff0e5d990 100644
--- a/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/visitors/BaseAdapter.kt
+++ b/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/visitors/BaseAdapter.kt
@@ -195,6 +195,8 @@ abstract class BaseAdapter (
return null
}
+ var newAccess = access
+
// Maybe rename the method.
val newName: String
val renameTo = filter.getRenameTo(currentClassName, name, descriptor)
@@ -205,8 +207,9 @@ abstract class BaseAdapter (
// (the one with the @substitute/replace annotation).
// `name` is the name of the method we're currently visiting, so it's usually a
// "...$ravewnwood" name.
- if (!checkSubstitutionMethodCompatibility(
- classes, currentClassName, newName, name, descriptor, options.errors)) {
+ newAccess = checkSubstitutionMethodCompatibility(
+ classes, currentClassName, newName, name, descriptor, options.errors)
+ if (newAccess == NOT_COMPATIBLE) {
return null
}
@@ -221,7 +224,7 @@ abstract class BaseAdapter (
// But note, we only use it when calling the super's method,
// but not for visitMethodInner(), because when subclass wants to change access,
// it can do so inside visitMethodInner().
- val newAccess = updateAccessFlags(access, name, descriptor)
+ newAccess = updateAccessFlags(newAccess, name, descriptor)
val ret = visitMethodInner(access, newName, descriptor, signature, exceptions, policy,
renameTo != null,
@@ -303,4 +306,4 @@ abstract class BaseAdapter (
return ret
}
}
-} \ No newline at end of file
+}
diff --git a/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/visitors/Helper.kt b/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/visitors/Helper.kt
index 9d66c32e76ee..dc4f26bdda34 100644
--- a/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/visitors/Helper.kt
+++ b/tools/hoststubgen/hoststubgen/src/com/android/hoststubgen/visitors/Helper.kt
@@ -17,12 +17,19 @@ package com.android.hoststubgen.visitors
import com.android.hoststubgen.HostStubGenErrors
import com.android.hoststubgen.asm.ClassNodes
+import com.android.hoststubgen.asm.clearVisibility
import com.android.hoststubgen.asm.getVisibility
import com.android.hoststubgen.asm.isStatic
+const val NOT_COMPATIBLE: Int = -1
+
/**
* Make sure substitution from and to methods have matching definition.
- * (static-ness, visibility.)
+ * (static-ness, etc)
+ *
+ * If the methods are compatible, return the "merged" [access] of the new method.
+ *
+ * If they are not compatible, returns [NOT_COMPATIBLE]
*/
fun checkSubstitutionMethodCompatibility(
classes: ClassNodes,
@@ -31,33 +38,31 @@ fun checkSubstitutionMethodCompatibility(
toMethodName: String, // the one with either a "_host" or "$ravenwood" prefix. (typically)
descriptor: String,
errors: HostStubGenErrors,
-): Boolean {
+): Int {
val from = classes.findMethod(className, fromMethodName, descriptor)
if (from == null) {
errors.onErrorFound(
- "Substitution-from method not found: $className.$fromMethodName$descriptor")
- return false
+ "Substitution-from method not found: $className.$fromMethodName$descriptor"
+ )
+ return NOT_COMPATIBLE
}
val to = classes.findMethod(className, toMethodName, descriptor)
if (to == null) {
// This shouldn't happen, because the visitor visited this method...
errors.onErrorFound(
- "Substitution-to method not found: $className.$toMethodName$descriptor")
- return false
+ "Substitution-to method not found: $className.$toMethodName$descriptor"
+ )
+ return NOT_COMPATIBLE
}
if (from.isStatic() != to.isStatic()) {
errors.onErrorFound(
"Substitution method must have matching static-ness: " +
- "$className.$fromMethodName$descriptor")
- return false
- }
- if (from.getVisibility().ordinal > to.getVisibility().ordinal) {
- errors.onErrorFound(
- "Substitution method cannot have smaller visibility than original: " +
- "$className.$fromMethodName$descriptor")
- return false
+ "$className.$fromMethodName$descriptor"
+ )
+ return NOT_COMPATIBLE
}
- return true
+ // Return the substitution's access flag but with the original method's visibility.
+ return clearVisibility (to.access) or getVisibility(from.access)
}
diff --git a/tools/hoststubgen/hoststubgen/test-tiny-framework/golden-output/01-hoststubgen-test-tiny-framework-orig-dump.txt b/tools/hoststubgen/hoststubgen/test-tiny-framework/golden-output/01-hoststubgen-test-tiny-framework-orig-dump.txt
index 931f0c5fa793..dd638925a5bc 100644
--- a/tools/hoststubgen/hoststubgen/test-tiny-framework/golden-output/01-hoststubgen-test-tiny-framework-orig-dump.txt
+++ b/tools/hoststubgen/hoststubgen/test-tiny-framework/golden-output/01-hoststubgen-test-tiny-framework-orig-dump.txt
@@ -644,9 +644,9 @@ public class com.android.hoststubgen.test.tinyframework.TinyFrameworkClassAnnota
suffix="_host"
)
- public static int nativeAddThree_host(int);
+ private static int nativeAddThree_host(int);
descriptor: (I)I
- flags: (0x0009) ACC_PUBLIC, ACC_STATIC
+ flags: (0x000a) ACC_PRIVATE, ACC_STATIC
Code:
stack=2, locals=1, args_size=1
x: iload_0
diff --git a/tools/hoststubgen/hoststubgen/test-tiny-framework/tiny-framework/src/com/android/hoststubgen/test/tinyframework/TinyFrameworkClassAnnotations.java b/tools/hoststubgen/hoststubgen/test-tiny-framework/tiny-framework/src/com/android/hoststubgen/test/tinyframework/TinyFrameworkClassAnnotations.java
index ab387e0938c3..6d8a48a37fea 100644
--- a/tools/hoststubgen/hoststubgen/test-tiny-framework/tiny-framework/src/com/android/hoststubgen/test/tinyframework/TinyFrameworkClassAnnotations.java
+++ b/tools/hoststubgen/hoststubgen/test-tiny-framework/tiny-framework/src/com/android/hoststubgen/test/tinyframework/TinyFrameworkClassAnnotations.java
@@ -73,7 +73,8 @@ public class TinyFrameworkClassAnnotations {
@HostSideTestSubstitute(suffix = "_host")
public static native int nativeAddThree(int value);
- public static int nativeAddThree_host(int value) {
+ // This method is private, but at runtime, it'll inherit the visibility of the original method
+ private static int nativeAddThree_host(int value) {
return value + 3;
}
diff --git a/tools/hoststubgen/hoststubgen/test/com/android/hoststubgen/visitors/HelperTest.kt b/tools/hoststubgen/hoststubgen/test/com/android/hoststubgen/visitors/HelperTest.kt
index 0ea90ed2fbf0..75e2536a98fa 100644
--- a/tools/hoststubgen/hoststubgen/test/com/android/hoststubgen/visitors/HelperTest.kt
+++ b/tools/hoststubgen/hoststubgen/test/com/android/hoststubgen/visitors/HelperTest.kt
@@ -71,7 +71,7 @@ class HelperTest {
addClass(cn)
}
- fun check(from: MethodNode?, to: MethodNode?, expected: Boolean) {
+ fun check(from: MethodNode?, to: MethodNode?, expected: Int) {
assertThat(checkSubstitutionMethodCompatibility(
classes,
cn.name,
@@ -82,21 +82,21 @@ class HelperTest {
)).isEqualTo(expected)
}
- check(staticPublic, staticPublic, true)
- check(staticPrivate, staticPrivate, true)
- check(nonStaticPublic, nonStaticPublic, true)
- check(nonStaticPProtected, nonStaticPProtected, true)
+ check(staticPublic, staticPublic, Opcodes.ACC_PUBLIC or Opcodes.ACC_STATIC)
+ check(staticPrivate, staticPrivate, Opcodes.ACC_PRIVATE or Opcodes.ACC_STATIC)
+ check(nonStaticPublic, nonStaticPublic, Opcodes.ACC_PUBLIC)
+ check(nonStaticPProtected, nonStaticPProtected, 0)
- check(staticPublic, null, false)
- check(null, staticPublic, false)
+ check(staticPublic, null, NOT_COMPATIBLE)
+ check(null, staticPublic, NOT_COMPATIBLE)
- check(staticPublic, nonStaticPublic, false)
- check(nonStaticPublic, staticPublic, false)
+ check(staticPublic, nonStaticPublic, NOT_COMPATIBLE)
+ check(nonStaticPublic, staticPublic, NOT_COMPATIBLE)
- check(staticPublic, staticPrivate, false)
- check(staticPrivate, staticPublic, true)
+ check(staticPublic, staticPrivate, Opcodes.ACC_PUBLIC or Opcodes.ACC_STATIC)
+ check(staticPrivate, staticPublic, Opcodes.ACC_PRIVATE or Opcodes.ACC_STATIC)
- check(nonStaticPublic, nonStaticPProtected, false)
- check(nonStaticPProtected, nonStaticPublic, true)
+ check(nonStaticPublic, nonStaticPProtected, Opcodes.ACC_PUBLIC)
+ check(nonStaticPProtected, nonStaticPublic, 0)
}
} \ No newline at end of file