summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ApiDocs.bp2
-rw-r--r--BATTERY_STATS_OWNERS4
-rw-r--r--OWNERS9
-rw-r--r--OWNERS.md34
-rw-r--r--StubLibraries.bp4
-rw-r--r--apct-tests/perftests/blobstore/Android.bp1
-rw-r--r--apct-tests/perftests/blobstore/AndroidTest.xml17
-rw-r--r--apex/jobscheduler/OWNERS2
-rw-r--r--api/Android.bp18
-rw-r--r--core/api/current.txt4893
-rw-r--r--core/api/module-lib-current.txt14
-rw-r--r--core/api/removed.txt8
-rw-r--r--core/api/system-current.txt17
-rw-r--r--core/api/test-current.txt5
-rw-r--r--core/java/android/app/ActivityManager.java38
-rw-r--r--core/java/android/app/ActivityThread.java3
-rw-r--r--core/java/android/app/AppOpsManager.java14
-rw-r--r--core/java/android/app/ApplicationPackageManager.java284
-rw-r--r--core/java/android/app/ContextImpl.java6
-rw-r--r--core/java/android/app/OWNERS37
-rw-r--r--core/java/android/app/SystemServiceRegistry.java13
-rw-r--r--core/java/android/app/TaskInfo.java45
-rw-r--r--core/java/android/app/admin/DevicePolicyManager.java95
-rw-r--r--core/java/android/app/admin/OWNERS9
-rw-r--r--core/java/android/app/time/OWNERS3
-rw-r--r--core/java/android/app/timedetector/GnssTimeSuggestion.aidl19
-rw-r--r--core/java/android/app/timedetector/GnssTimeSuggestion.java135
-rw-r--r--core/java/android/app/timedetector/ITimeDetectorService.aidl2
-rw-r--r--core/java/android/app/timedetector/OWNERS2
-rw-r--r--core/java/android/app/timedetector/TimeDetector.java8
-rw-r--r--core/java/android/app/timedetector/TimeDetectorImpl.java12
-rw-r--r--core/java/android/app/timezone/OWNERS5
-rw-r--r--core/java/android/app/timezonedetector/OWNERS3
-rw-r--r--core/java/android/companion/CompanionDeviceManager.java72
-rw-r--r--core/java/android/companion/DeviceNotAssociatedException.java31
-rw-r--r--core/java/android/companion/ICompanionDeviceManager.aidl4
-rw-r--r--core/java/android/content/Context.java9
-rw-r--r--core/java/android/content/OWNERS3
-rw-r--r--core/java/android/content/pm/OWNERS1
-rw-r--r--core/java/android/content/pm/PackageManager.java44
-rw-r--r--core/java/android/content/pm/PackageParser.java14
-rw-r--r--core/java/android/content/pm/parsing/ParsingPackageUtils.java15
-rw-r--r--core/java/android/database/OWNERS2
-rw-r--r--core/java/android/hardware/ISensorPrivacyManager.aidl8
-rw-r--r--core/java/android/hardware/OWNERS3
-rw-r--r--core/java/android/hardware/SensorPrivacyManager.java51
-rw-r--r--core/java/android/hardware/camera2/CameraCaptureSession.java10
-rw-r--r--core/java/android/hardware/camera2/CameraMetadata.java4
-rw-r--r--core/java/android/hardware/camera2/impl/CameraMetadataNative.java12
-rw-r--r--core/java/android/hardware/hdmi/HdmiPortInfo.java3
-rw-r--r--core/java/android/net/NetworkAgent.java62
-rw-r--r--core/java/android/net/OWNERS8
-rw-r--r--core/java/android/net/TcpRepairWindow.java3
-rw-r--r--core/java/android/os/BatteryConsumer.java45
-rw-r--r--core/java/android/os/BatteryUsageStats.java19
-rwxr-xr-xcore/java/android/os/Build.java14
-rw-r--r--core/java/android/os/INetworkManagementService.aidl12
-rw-r--r--core/java/android/os/OWNERS9
-rw-r--r--core/java/android/os/PowerComponents.java98
-rw-r--r--core/java/android/os/RemoteException.java5
-rw-r--r--core/java/android/os/StatFs.java2
-rw-r--r--core/java/android/os/UidBatteryConsumer.java49
-rw-r--r--core/java/android/permission/ILegacyPermissionManager.aidl48
-rw-r--r--core/java/android/permission/IPermissionManager.aidl16
-rw-r--r--core/java/android/permission/LegacyPermissionManager.java217
-rw-r--r--core/java/android/permission/PermissionManager.java852
-rw-r--r--core/java/android/provider/CallLog.java188
-rw-r--r--core/java/android/provider/Settings.java34
-rw-r--r--core/java/android/security/keymaster/KeymasterDefs.java24
-rw-r--r--core/java/android/service/textservice/OWNERS4
-rw-r--r--core/java/android/telephony/OWNERS1
-rw-r--r--core/java/android/timezone/OWNERS4
-rw-r--r--core/java/android/util/ExceptionUtils.java2
-rw-r--r--core/java/android/view/IRecentsAnimationController.aidl9
-rw-r--r--core/java/android/view/InsetsAnimationThreadControlRunner.java1
-rw-r--r--core/java/android/view/OWNERS68
-rw-r--r--core/java/android/view/SurfaceControl.java172
-rw-r--r--core/java/android/view/Window.java25
-rw-r--r--core/java/android/view/WindowManager.java54
-rw-r--r--core/java/android/view/contentcapture/MainContentCaptureSession.java16
-rw-r--r--core/java/android/view/textservice/OWNERS4
-rw-r--r--core/java/android/widget/OWNERS2
-rw-r--r--core/java/android/window/TaskOrganizer.java9
-rw-r--r--core/java/android/window/TransitionInfo.java55
-rw-r--r--core/java/com/android/internal/app/IAppOpsNotedCallback.aidl2
-rw-r--r--core/java/com/android/internal/app/IAppOpsStartedCallback.aidl2
-rw-r--r--core/java/com/android/internal/app/OWNERS1
-rw-r--r--core/java/com/android/internal/inputmethod/CallbackUtils.java15
-rw-r--r--core/java/com/android/internal/inputmethod/Completable.java168
-rw-r--r--core/java/com/android/internal/inputmethod/IInputBindResultResultCallback.aidl2
-rw-r--r--core/java/com/android/internal/inputmethod/ResultCallbacks.java10
-rw-r--r--core/java/com/android/internal/inputmethod/ThrowableHolder.aidl19
-rw-r--r--core/java/com/android/internal/inputmethod/ThrowableHolder.java91
-rw-r--r--core/java/com/android/internal/net/OWNERS2
-rw-r--r--core/java/com/android/internal/notification/OWNERS1
-rw-r--r--core/java/com/android/internal/os/BatteryUsageStatsProvider.java82
-rw-r--r--core/java/com/android/internal/os/CpuPowerCalculator.java40
-rw-r--r--core/java/com/android/internal/os/OWNERS7
-rw-r--r--core/java/com/android/internal/os/PowerCalculator.java61
-rw-r--r--core/java/com/android/internal/telephony/OWNERS1
-rw-r--r--core/java/com/android/internal/util/LatencyTracker.java12
-rw-r--r--core/java/com/android/internal/util/dump/DualDumpOutputStream.java3
-rw-r--r--core/java/com/android/internal/view/OWNERS5
-rw-r--r--core/jni/OWNERS18
-rw-r--r--core/jni/android_media_AudioSystem.cpp13
-rw-r--r--core/proto/android/hardware/sensorprivacy.proto50
-rw-r--r--core/res/AndroidManifest.xml17
-rw-r--r--core/res/res/drawable-car/car_button_background.xml50
-rw-r--r--core/res/res/drawable-car/car_switch_thumb.xml21
-rw-r--r--core/res/res/drawable-car/car_switch_track.xml53
-rw-r--r--core/res/res/values/config.xml8
-rw-r--r--core/res/res/values/dimens_car.xml8
-rw-r--r--core/res/res/values/strings.xml9
-rw-r--r--core/res/res/values/symbols.xml5
-rw-r--r--core/tests/batterystatstests/BatteryStatsLoadTests/Android.bp (renamed from core/tests/powertests/PowerStatsLoadTests/Android.bp)2
-rw-r--r--core/tests/batterystatstests/BatteryStatsLoadTests/AndroidManifest.xml (renamed from core/tests/powertests/PowerStatsLoadTests/AndroidManifest.xml)4
-rw-r--r--core/tests/batterystatstests/BatteryStatsLoadTests/src/com/android/frameworks/core/batterystatsloadtests/ConnectivitySetupRule.java (renamed from core/tests/powertests/PowerStatsLoadTests/src/com/android/frameworks/core/powerstatsloadtests/ConnectivitySetupRule.java)2
-rw-r--r--core/tests/batterystatstests/BatteryStatsLoadTests/src/com/android/frameworks/core/batterystatsloadtests/PowerMetrics.java (renamed from core/tests/powertests/PowerStatsLoadTests/src/com/android/frameworks/core/powerstatsloadtests/PowerMetrics.java)2
-rw-r--r--core/tests/batterystatstests/BatteryStatsLoadTests/src/com/android/frameworks/core/batterystatsloadtests/PowerMetricsCollector.java (renamed from core/tests/powertests/PowerStatsLoadTests/src/com/android/frameworks/core/powerstatsloadtests/PowerMetricsCollector.java)3
-rw-r--r--core/tests/batterystatstests/BatteryStatsLoadTests/src/com/android/frameworks/core/batterystatsloadtests/SystemServiceCallLoadTest.java (renamed from core/tests/powertests/PowerStatsLoadTests/src/com/android/frameworks/core/powerstatsloadtests/SystemServiceCallLoadTest.java)2
-rw-r--r--core/tests/batterystatstests/BatteryStatsLoadTests/src/com/android/frameworks/core/batterystatsloadtests/WiFiLoadTest.java (renamed from core/tests/powertests/PowerStatsLoadTests/src/com/android/frameworks/core/powerstatsloadtests/WiFiLoadTest.java)2
-rw-r--r--core/tests/batterystatstests/BatteryStatsViewer/Android.bp (renamed from core/tests/powertests/PowerStatsViewer/Android.bp)2
-rw-r--r--core/tests/batterystatstests/BatteryStatsViewer/AndroidManifest.xml (renamed from core/tests/powertests/PowerStatsViewer/AndroidManifest.xml)12
-rw-r--r--core/tests/batterystatstests/BatteryStatsViewer/res/layout/battery_consumer_entry_layout.xml (renamed from core/tests/powertests/PowerStatsViewer/res/layout/power_stats_entry_layout.xml)0
-rw-r--r--core/tests/batterystatstests/BatteryStatsViewer/res/layout/battery_consumer_info_layout.xml (renamed from core/tests/powertests/PowerStatsViewer/res/layout/power_consumer_info_layout.xml)0
-rw-r--r--core/tests/batterystatstests/BatteryStatsViewer/res/layout/battery_consumer_picker_activity_layout.xml (renamed from core/tests/powertests/PowerStatsViewer/res/layout/power_consumer_picker_activity_layout.xml)0
-rw-r--r--core/tests/batterystatstests/BatteryStatsViewer/res/layout/battery_consumer_picker_layout.xml (renamed from core/tests/powertests/PowerStatsViewer/res/layout/power_consumer_picker_layout.xml)0
-rw-r--r--core/tests/batterystatstests/BatteryStatsViewer/res/layout/battery_stats_viewer_layout.xml (renamed from core/tests/powertests/PowerStatsViewer/res/layout/power_stats_viewer_layout.xml)6
-rw-r--r--core/tests/batterystatstests/BatteryStatsViewer/res/values/styles.xml (renamed from core/tests/powertests/PowerStatsViewer/res/values/styles.xml)0
-rw-r--r--core/tests/batterystatstests/BatteryStatsViewer/src/com/android/frameworks/core/batterystatsviewer/BatteryConsumerData.java (renamed from core/tests/powertests/PowerStatsViewer/src/com/android/frameworks/core/powerstatsviewer/PowerStatsData.java)121
-rw-r--r--core/tests/batterystatstests/BatteryStatsViewer/src/com/android/frameworks/core/batterystatsviewer/BatteryConsumerInfoHelper.java (renamed from core/tests/powertests/PowerStatsViewer/src/com/android/frameworks/core/powerstatsviewer/PowerConsumerInfoHelper.java)12
-rw-r--r--core/tests/batterystatstests/BatteryStatsViewer/src/com/android/frameworks/core/batterystatsviewer/BatteryConsumerPickerActivity.java (renamed from core/tests/powertests/PowerStatsViewer/src/com/android/frameworks/core/powerstatsviewer/PowerConsumerPickerActivity.java)20
-rw-r--r--core/tests/batterystatstests/BatteryStatsViewer/src/com/android/frameworks/core/batterystatsviewer/BatteryConsumerPickerFragment.java (renamed from core/tests/powertests/PowerStatsViewer/src/com/android/frameworks/core/powerstatsviewer/PowerConsumerPickerFragment.java)101
-rw-r--r--core/tests/batterystatstests/BatteryStatsViewer/src/com/android/frameworks/core/batterystatsviewer/BatteryStatsViewerActivity.java338
-rw-r--r--core/tests/batterystatstests/OWNERS (renamed from core/tests/powertests/OWNERS)1
-rw-r--r--core/tests/coretests/src/android/app/ApplicationPackageManagerTest.java2
-rw-r--r--core/tests/coretests/src/android/app/time/OWNERS3
-rw-r--r--core/tests/coretests/src/android/app/timedetector/GnssTimeSuggestionTest.java66
-rw-r--r--core/tests/coretests/src/android/app/timedetector/OWNERS3
-rw-r--r--core/tests/coretests/src/android/app/timezone/OWNERS3
-rw-r--r--core/tests/coretests/src/android/app/timezonedetector/OWNERS3
-rw-r--r--core/tests/coretests/src/com/android/internal/jank/OWNERS1
-rwxr-xr-xcore/tests/hdmitests/src/android/hardware/hdmi/HdmiPortInfoTest.java62
-rw-r--r--core/tests/powertests/PowerStatsViewer/src/com/android/frameworks/core/powerstatsviewer/PowerStatsViewerActivity.java276
-rw-r--r--data/etc/car/Android.bp7
-rw-r--r--data/etc/car/com.android.car.provision.xml2
-rw-r--r--data/etc/car/com.google.android.car.networking.preferenceupdater.xml27
-rw-r--r--data/etc/com.android.documentsui.xml1
-rw-r--r--data/etc/privapp-permissions-platform.xml2
-rw-r--r--data/etc/services.core.protolog.json42
-rw-r--r--graphics/java/android/graphics/OWNERS2
-rw-r--r--graphics/java/android/graphics/ParcelableColorSpace.java43
-rw-r--r--keystore/java/android/security/KeyStoreOperation.java2
-rw-r--r--keystore/java/android/security/KeyStoreSecurityLevel.java2
-rw-r--r--keystore/java/android/security/keystore2/AndroidKeyStore3DESCipherSpi.java2
-rw-r--r--keystore/java/android/security/keystore2/AndroidKeyStoreAuthenticatedAESCipherSpi.java2
-rw-r--r--keystore/java/android/security/keystore2/AndroidKeyStoreCipherSpiBase.java2
-rw-r--r--keystore/java/android/security/keystore2/AndroidKeyStoreECDSASignatureSpi.java2
-rw-r--r--keystore/java/android/security/keystore2/AndroidKeyStoreHmacSpi.java2
-rw-r--r--keystore/java/android/security/keystore2/AndroidKeyStoreKeyGeneratorSpi.java4
-rw-r--r--keystore/java/android/security/keystore2/AndroidKeyStoreKeyPairGeneratorSpi.java4
-rw-r--r--keystore/java/android/security/keystore2/AndroidKeyStoreRSACipherSpi.java2
-rw-r--r--keystore/java/android/security/keystore2/AndroidKeyStoreRSASignatureSpi.java2
-rw-r--r--keystore/java/android/security/keystore2/AndroidKeyStoreSignatureSpiBase.java2
-rw-r--r--keystore/java/android/security/keystore2/AndroidKeyStoreSpi.java6
-rw-r--r--keystore/java/android/security/keystore2/AndroidKeyStoreUnauthenticatedAESCipherSpi.java2
-rw-r--r--keystore/java/android/security/keystore2/KeyStore2ParameterUtils.java4
-rw-r--r--libs/WindowManager/Shell/res/values/config.xml12
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/FullscreenTaskListener.java66
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/ShellCommandHandler.java108
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/ShellInit.java16
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/ShellTaskOrganizer.java25
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/TaskView.java6
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/Transitions.java21
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleExpandedView.java6
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/common/split/DividerView.java4
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/common/split/SplitLayout.java47
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/letterbox/LetterboxConfigController.java108
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/letterbox/LetterboxTaskListener.java267
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/onehanded/OneHandedGestureHandler.java16
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/onehanded/OneHandedTutorialHandler.java70
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipBoundsAlgorithm.java49
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipBoundsState.java23
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipController.java26
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipResizeGestureHandler.java2
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/DividerImeController.java2
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/DividerView.java2
-rw-r--r--libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/CommonAssertions.kt46
-rw-r--r--libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/CommonConstants.kt1
-rw-r--r--libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/apppairs/AppPairsTest.kt46
-rw-r--r--libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/apppairs/AppPairsTestBase.kt4
-rw-r--r--libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/helpers/SplitScreenHelper.kt16
-rw-r--r--libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/EnterSplitScreenTest.kt138
-rw-r--r--libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/RotateOneLaunchedAppTest.kt146
-rw-r--r--libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/RotateTwoLaunchedAppTest.kt157
-rw-r--r--libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/SplitScreenRotateOneLaunchedAppTest.kt95
-rw-r--r--libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/SplitScreenRotateTwoLaunchedAppTest.kt104
-rw-r--r--libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/SplitScreenTestBase.kt4
-rw-r--r--libs/WindowManager/Shell/tests/flicker/test-apps/flickerapp/AndroidManifest.xml11
-rw-r--r--libs/WindowManager/Shell/tests/flicker/test-apps/flickerapp/res/layout/activity_non_resizeable.xml32
-rw-r--r--libs/WindowManager/Shell/tests/flicker/test-apps/flickerapp/src/com/android/wm/shell/flicker/testapp/Components.java7
-rw-r--r--libs/WindowManager/Shell/tests/flicker/test-apps/flickerapp/src/com/android/wm/shell/flicker/testapp/NonResizeableActivity.java29
-rw-r--r--libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/ShellTaskOrganizerTests.java39
-rw-r--r--libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/TaskViewTest.java4
-rw-r--r--libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/common/split/SplitLayoutTests.java23
-rw-r--r--libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/letterbox/LetterboxConfigControllerTest.java131
-rw-r--r--libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/letterbox/LetterboxTaskListenerTest.java367
-rw-r--r--libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/pip/PipBoundsAlgorithmTest.java6
-rw-r--r--libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/pip/PipBoundsStateTest.java18
-rw-r--r--libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/pip/phone/PipControllerTest.java26
-rw-r--r--libs/hwui/Android.bp1
-rw-r--r--libs/hwui/DisplayList.h5
-rw-r--r--libs/hwui/RenderNode.cpp2
-rw-r--r--libs/hwui/canvas/CanvasFrontend.cpp7
-rw-r--r--libs/hwui/canvas/CanvasFrontend.h24
-rw-r--r--libs/hwui/canvas/CanvasOps.h6
-rw-r--r--libs/hwui/canvas/OpBuffer.h3
-rw-r--r--libs/hwui/hwui/Canvas.h13
-rw-r--r--libs/hwui/jni/Typeface.cpp25
-rw-r--r--libs/hwui/pipeline/skia/SkiaDisplayList.cpp2
-rw-r--r--libs/hwui/pipeline/skia/SkiaDisplayList.h2
-rw-r--r--libs/hwui/tests/microbench/CanvasOpBench.cpp96
-rw-r--r--libs/hwui/tests/microbench/RenderNodeBench.cpp26
-rw-r--r--libs/hwui/tests/unit/SkiaDisplayListTests.cpp2
-rw-r--r--location/java/android/location/Location.java7
-rw-r--r--location/java/android/location/LocationManager.java78
-rw-r--r--location/java/android/location/OWNERS4
-rw-r--r--media/OWNERS2
-rw-r--r--media/java/android/media/AudioManager.java50
-rw-r--r--media/java/android/media/AudioSystem.java15
-rw-r--r--media/java/android/media/AudioTrack.java3
-rw-r--r--media/java/android/media/IMediaRouterService.aidl2
-rw-r--r--media/java/android/media/MediaCodecInfo.java54
-rw-r--r--media/java/android/media/MediaRouter2Manager.java30
-rw-r--r--media/java/android/media/RouteDiscoveryPreference.java1
-rw-r--r--media/java/android/media/tv/tuner/Tuner.java21
-rw-r--r--media/java/android/mtp/OWNERS2
-rw-r--r--media/jni/OWNERS2
-rw-r--r--media/jni/android_media_MediaExtractor.cpp2
-rw-r--r--media/jni/android_media_MediaMetadataRetriever.cpp12
-rw-r--r--media/native/midi/amidi.cpp6
-rw-r--r--media/tests/MtpTests/OWNERS2
-rw-r--r--packages/Connectivity/OWNERS3
-rw-r--r--packages/SettingsLib/OWNERS2
-rw-r--r--packages/SettingsLib/res/values-af/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-am/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-ar/strings.xml8
-rw-r--r--packages/SettingsLib/res/values-as/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-az/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-b+sr+Latn/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-be/strings.xml9
-rw-r--r--packages/SettingsLib/res/values-bg/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-bn/strings.xml9
-rw-r--r--packages/SettingsLib/res/values-bs/strings.xml8
-rw-r--r--packages/SettingsLib/res/values-ca/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-cs/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-da/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-de/strings.xml9
-rw-r--r--packages/SettingsLib/res/values-el/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-en-rAU/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-en-rCA/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-en-rGB/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-en-rIN/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-en-rXC/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-es-rUS/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-es/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-et/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-eu/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-fa/strings.xml8
-rw-r--r--packages/SettingsLib/res/values-fi/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-fr-rCA/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-fr/strings.xml8
-rw-r--r--packages/SettingsLib/res/values-gl/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-gu/strings.xml9
-rw-r--r--packages/SettingsLib/res/values-hi/strings.xml8
-rw-r--r--packages/SettingsLib/res/values-hr/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-hu/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-hy/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-in/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-is/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-it/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-iw/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-ja/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-ka/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-kk/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-km/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-kn/strings.xml9
-rw-r--r--packages/SettingsLib/res/values-ko/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-ky/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-lo/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-lt/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-lv/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-mk/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-ml/strings.xml9
-rw-r--r--packages/SettingsLib/res/values-mn/strings.xml10
-rw-r--r--packages/SettingsLib/res/values-mr/strings.xml9
-rw-r--r--packages/SettingsLib/res/values-ms/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-my/strings.xml8
-rw-r--r--packages/SettingsLib/res/values-nb/strings.xml8
-rw-r--r--packages/SettingsLib/res/values-ne/strings.xml9
-rw-r--r--packages/SettingsLib/res/values-nl/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-or/strings.xml11
-rw-r--r--packages/SettingsLib/res/values-pa/strings.xml9
-rw-r--r--packages/SettingsLib/res/values-pl/strings.xml9
-rw-r--r--packages/SettingsLib/res/values-pt-rBR/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-pt-rPT/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-pt/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-ro/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-ru/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-si/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-sk/strings.xml8
-rw-r--r--packages/SettingsLib/res/values-sl/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-sq/strings.xml9
-rw-r--r--packages/SettingsLib/res/values-sr/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-sv/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-sw/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-ta/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-te/strings.xml9
-rw-r--r--packages/SettingsLib/res/values-th/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-tl/strings.xml8
-rw-r--r--packages/SettingsLib/res/values-tr/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-uk/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-ur/strings.xml9
-rw-r--r--packages/SettingsLib/res/values-uz/arrays.xml2
-rw-r--r--packages/SettingsLib/res/values-uz/strings.xml12
-rw-r--r--packages/SettingsLib/res/values-vi/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-zh-rCN/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-zh-rHK/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-zh-rTW/strings.xml6
-rw-r--r--packages/SettingsLib/res/values-zu/strings.xml6
-rw-r--r--packages/SettingsLib/res/values/strings.xml2
-rw-r--r--packages/SettingsLib/src/com/android/settingslib/mobile/MobileMappings.java63
-rw-r--r--packages/SettingsLib/src/com/android/settingslib/mobile/MobileStatusTracker.java286
-rw-r--r--packages/Shell/AndroidManifest.xml3
-rw-r--r--packages/Shell/OWNERS2
-rw-r--r--packages/SystemUI/AndroidManifest.xml1
-rw-r--r--packages/SystemUI/OWNERS2
-rw-r--r--packages/SystemUI/res/layout-sw600dp-land/global_actions_grid_v2.xml68
-rw-r--r--packages/SystemUI/res/layout-sw600dp/global_actions_controls_list_view.xml30
-rw-r--r--packages/SystemUI/res/layout-sw600dp/global_actions_grid_v2.xml76
-rw-r--r--packages/SystemUI/res/layout/controls_with_favorites.xml8
-rw-r--r--packages/SystemUI/res/layout/global_actions_controls_list_view.xml9
-rw-r--r--packages/SystemUI/res/layout/global_actions_grid_item_v2.xml2
-rw-r--r--packages/SystemUI/res/values-sw600dp/config.xml3
-rw-r--r--packages/SystemUI/res/values-sw600dp/dimens.xml7
-rw-r--r--packages/SystemUI/res/values/config.xml3
-rw-r--r--packages/SystemUI/res/values/dimens.xml1
-rw-r--r--packages/SystemUI/shared/src/com/android/systemui/shared/recents/utilities/BitmapUtil.java3
-rw-r--r--packages/SystemUI/shared/src/com/android/systemui/shared/system/RecentsAnimationControllerCompat.java11
-rw-r--r--packages/SystemUI/src/com/android/systemui/accessibility/MagnificationModeSwitch.java13
-rw-r--r--packages/SystemUI/src/com/android/systemui/appops/AppOpsControllerImpl.java3
-rw-r--r--packages/SystemUI/src/com/android/systemui/classifier/BrightLineFalsingManager.java22
-rw-r--r--packages/SystemUI/src/com/android/systemui/classifier/DiagonalClassifier.java12
-rw-r--r--packages/SystemUI/src/com/android/systemui/classifier/DistanceClassifier.java8
-rw-r--r--packages/SystemUI/src/com/android/systemui/classifier/DoubleTapClassifier.java25
-rw-r--r--packages/SystemUI/src/com/android/systemui/classifier/FalsingClassifier.java53
-rw-r--r--packages/SystemUI/src/com/android/systemui/classifier/PointerCountClassifier.java15
-rw-r--r--packages/SystemUI/src/com/android/systemui/classifier/ProximityClassifier.java15
-rw-r--r--packages/SystemUI/src/com/android/systemui/classifier/SingleTapClassifier.java22
-rw-r--r--packages/SystemUI/src/com/android/systemui/classifier/TypeClassifier.java24
-rw-r--r--packages/SystemUI/src/com/android/systemui/classifier/ZigZagClassifier.java8
-rw-r--r--packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialog.java85
-rw-r--r--packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputController.java7
-rw-r--r--packages/SystemUI/src/com/android/systemui/people/PeopleSpaceUtils.java4
-rw-r--r--packages/SystemUI/src/com/android/systemui/qs/QuickQSPanel.java11
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/LockscreenLockIconController.java20
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java1
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelViewController.java2
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/policy/MobileSignalController.java166
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkControllerImpl.java16
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/policy/SmartReplyView.java8
-rw-r--r--packages/SystemUI/src/com/android/systemui/wmshell/WMShellBaseModule.java41
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/accessibility/MagnificationModeSwitchTest.java58
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/appops/AppOpsControllerTest.java28
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/classifier/BrightLineClassifierTest.java26
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/classifier/DoubleTapClassifierTest.java19
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/classifier/HistoryTrackerTest.java5
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/classifier/ProximityClassifierTest.java8
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/classifier/SingleTapClassifierTest.java4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/NotificationEntryManagerTest.java4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/NotificationEntryTest.java8
-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/row/NotificationConversationInfoTest.java4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationTestHelper.java4
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/LockscreenIconControllerTest.java14
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerBaseTest.java4
-rw-r--r--proto/src/metrics_constants/OWNERS2
-rw-r--r--services/autofill/java/com/android/server/autofill/TEST_MAPPING2
-rw-r--r--services/companion/java/com/android/server/companion/CompanionDeviceManagerService.java38
-rw-r--r--services/core/java/com/android/server/BluetoothAirplaneModeListener.java4
-rw-r--r--services/core/java/com/android/server/BluetoothManagerService.java4
-rw-r--r--services/core/java/com/android/server/ConnectivityService.java127
-rw-r--r--services/core/java/com/android/server/GestureLauncherService.java28
-rw-r--r--services/core/java/com/android/server/NetworkManagementService.java58
-rw-r--r--services/core/java/com/android/server/OWNERS5
-rw-r--r--services/core/java/com/android/server/SensorPrivacyService.java410
-rw-r--r--services/core/java/com/android/server/StorageManagerService.java20
-rw-r--r--services/core/java/com/android/server/TestNetworkService.java11
-rw-r--r--services/core/java/com/android/server/accounts/AccountManagerService.java6
-rw-r--r--services/core/java/com/android/server/am/ActiveServices.java26
-rw-r--r--services/core/java/com/android/server/am/ActivityManagerService.java58
-rw-r--r--services/core/java/com/android/server/am/AppErrors.java15
-rw-r--r--services/core/java/com/android/server/am/OWNERS2
-rw-r--r--services/core/java/com/android/server/am/OomAdjuster.java12
-rw-r--r--services/core/java/com/android/server/am/ProcessRecord.java90
-rw-r--r--services/core/java/com/android/server/appop/AppOpsService.java39
-rw-r--r--services/core/java/com/android/server/connectivity/NetworkAgentInfo.java7
-rw-r--r--services/core/java/com/android/server/connectivity/PermissionMonitor.java9
-rw-r--r--services/core/java/com/android/server/connectivity/Vpn.java65
-rw-r--r--services/core/java/com/android/server/display/DisplayManagerService.java2
-rw-r--r--services/core/java/com/android/server/display/LocalDisplayAdapter.java91
-rw-r--r--services/core/java/com/android/server/display/LogicalDisplayMapper.java9
-rw-r--r--services/core/java/com/android/server/dreams/OWNERS2
-rwxr-xr-xservices/core/java/com/android/server/hdmi/HdmiCecLocalDevice.java8
-rw-r--r--services/core/java/com/android/server/lights/LightsService.java44
-rw-r--r--services/core/java/com/android/server/location/LocationManagerService.java14
-rw-r--r--services/core/java/com/android/server/location/OWNERS9
-rw-r--r--services/core/java/com/android/server/location/contexthub/OWNERS2
-rw-r--r--services/core/java/com/android/server/media/BluetoothRouteProvider.java12
-rw-r--r--services/core/java/com/android/server/media/MediaRoute2Provider.java2
-rw-r--r--services/core/java/com/android/server/media/MediaRoute2ProviderServiceProxy.java8
-rw-r--r--services/core/java/com/android/server/media/MediaRouter2ServiceImpl.java130
-rw-r--r--services/core/java/com/android/server/media/MediaRouterService.java12
-rw-r--r--services/core/java/com/android/server/net/OWNERS2
-rw-r--r--services/core/java/com/android/server/notification/NotificationHistoryDatabase.java4
-rw-r--r--services/core/java/com/android/server/notification/OWNERS2
-rw-r--r--services/core/java/com/android/server/notification/SnoozeHelper.java4
-rw-r--r--services/core/java/com/android/server/pm/OWNERS8
-rw-r--r--services/core/java/com/android/server/pm/ShortcutPackage.java2
-rw-r--r--services/core/java/com/android/server/pm/permission/LegacyPermissionManagerInternal.java46
-rw-r--r--services/core/java/com/android/server/pm/permission/LegacyPermissionManagerService.java240
-rw-r--r--services/core/java/com/android/server/pm/permission/OWNERS4
-rw-r--r--services/core/java/com/android/server/pm/permission/PermissionManagerService.java230
-rw-r--r--services/core/java/com/android/server/policy/OWNERS1
-rw-r--r--services/core/java/com/android/server/policy/PhoneWindowManager.java9
-rw-r--r--services/core/java/com/android/server/policy/WindowManagerPolicy.java3
-rw-r--r--services/core/java/com/android/server/powerstats/OWNERS1
-rw-r--r--services/core/java/com/android/server/rollback/RollbackManagerServiceImpl.java2
-rw-r--r--services/core/java/com/android/server/stats/pull/StatsPullAtomService.java2
-rw-r--r--services/core/java/com/android/server/timedetector/OWNERS4
-rw-r--r--services/core/java/com/android/server/timedetector/TimeDetectorService.java15
-rw-r--r--services/core/java/com/android/server/timedetector/TimeDetectorStrategy.java14
-rw-r--r--services/core/java/com/android/server/timedetector/TimeDetectorStrategyImpl.java71
-rw-r--r--services/core/java/com/android/server/timezone/OWNERS4
-rw-r--r--services/core/java/com/android/server/timezonedetector/OWNERS4
-rw-r--r--services/core/java/com/android/server/wm/ActivityMetricsLogger.java4
-rw-r--r--services/core/java/com/android/server/wm/ActivityRecord.java76
-rw-r--r--services/core/java/com/android/server/wm/ActivityStarter.java6
-rw-r--r--services/core/java/com/android/server/wm/ActivityTaskManagerService.java7
-rw-r--r--services/core/java/com/android/server/wm/ActivityTaskSupervisor.java4
-rw-r--r--services/core/java/com/android/server/wm/AppTransition.java6
-rw-r--r--services/core/java/com/android/server/wm/AppTransitionController.java4
-rw-r--r--services/core/java/com/android/server/wm/DisplayContent.java262
-rw-r--r--services/core/java/com/android/server/wm/ImeInsetsSourceProvider.java119
-rw-r--r--services/core/java/com/android/server/wm/KeyguardController.java12
-rw-r--r--services/core/java/com/android/server/wm/RecentsAnimation.java10
-rw-r--r--services/core/java/com/android/server/wm/RecentsAnimationController.java23
-rw-r--r--services/core/java/com/android/server/wm/RootWindowContainer.java369
-rw-r--r--services/core/java/com/android/server/wm/Session.java5
-rw-r--r--services/core/java/com/android/server/wm/SurfaceAnimationRunner.java1
-rw-r--r--services/core/java/com/android/server/wm/Task.java292
-rw-r--r--services/core/java/com/android/server/wm/TaskDisplayArea.java194
-rw-r--r--services/core/java/com/android/server/wm/TaskLaunchParamsModifier.java16
-rw-r--r--services/core/java/com/android/server/wm/TaskOrganizerController.java20
-rw-r--r--services/core/java/com/android/server/wm/TaskScreenshotAnimatable.java2
-rw-r--r--services/core/java/com/android/server/wm/Transition.java34
-rw-r--r--services/core/java/com/android/server/wm/WindowContainer.java139
-rw-r--r--services/core/java/com/android/server/wm/WindowManagerService.java60
-rw-r--r--services/core/java/com/android/server/wm/WindowProcessController.java12
-rw-r--r--services/core/java/com/android/server/wm/WindowState.java80
-rw-r--r--services/core/java/com/android/server/wm/WindowStateAnimator.java181
-rw-r--r--services/core/java/com/android/server/wm/WindowSurfaceController.java135
-rw-r--r--services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java2
-rw-r--r--services/robotests/src/com/android/server/location/OWNERS1
-rw-r--r--services/tests/mockingservicestests/src/com/android/server/display/LocalDisplayAdapterTest.java50
-rw-r--r--services/tests/servicestests/src/com/android/server/GestureLauncherServiceTest.java27
-rw-r--r--services/tests/servicestests/src/com/android/server/OWNERS2
-rw-r--r--services/tests/servicestests/src/com/android/server/appop/AppOpsNotedWatcherTest.java6
-rw-r--r--services/tests/servicestests/src/com/android/server/appop/AppOpsStartedWatcherTest.java6
-rw-r--r--services/tests/servicestests/src/com/android/server/devicepolicy/DevicePolicyManagerTest.java2
-rw-r--r--services/tests/servicestests/src/com/android/server/hdmi/HdmiCecLocalDeviceTest.java108
-rw-r--r--services/tests/servicestests/src/com/android/server/pm/permission/LegacyPermissionManagerServiceTest.java (renamed from services/tests/servicestests/src/com/android/server/pm/permission/PermissionManagerServiceTest.java)37
-rw-r--r--services/tests/servicestests/src/com/android/server/timedetector/OWNERS4
-rw-r--r--services/tests/servicestests/src/com/android/server/timedetector/TimeDetectorServiceTest.java47
-rw-r--r--services/tests/servicestests/src/com/android/server/timedetector/TimeDetectorStrategyImplTest.java248
-rw-r--r--services/tests/servicestests/src/com/android/server/timezone/OWNERS4
-rw-r--r--services/tests/servicestests/src/com/android/server/timezonedetector/OWNERS4
-rw-r--r--services/tests/uiservicestests/src/com/android/server/notification/NotificationAdjustmentExtractorTest.java2
-rw-r--r--services/tests/uiservicestests/src/com/android/server/notification/NotificationIntrusivenessExtractorTest.java8
-rw-r--r--services/tests/uiservicestests/src/com/android/server/notification/NotificationListenerServiceTest.java4
-rwxr-xr-xservices/tests/uiservicestests/src/com/android/server/notification/NotificationManagerServiceTest.java33
-rw-r--r--services/tests/wmtests/Android.bp1
-rw-r--r--services/tests/wmtests/src/com/android/server/wm/ActivityDisplayTests.java16
-rw-r--r--services/tests/wmtests/src/com/android/server/wm/ActivityRecordTests.java4
-rw-r--r--services/tests/wmtests/src/com/android/server/wm/ActivityStackTests.java6
-rw-r--r--services/tests/wmtests/src/com/android/server/wm/ActivityStarterTests.java7
-rw-r--r--services/tests/wmtests/src/com/android/server/wm/ActivityTaskManagerServiceTests.java20
-rw-r--r--services/tests/wmtests/src/com/android/server/wm/AppTransitionControllerTest.java4
-rw-r--r--services/tests/wmtests/src/com/android/server/wm/DisplayContentTests.java64
-rw-r--r--services/tests/wmtests/src/com/android/server/wm/ImeInsetsSourceProviderTest.java14
-rw-r--r--services/tests/wmtests/src/com/android/server/wm/InsetsStateControllerTest.java11
-rw-r--r--services/tests/wmtests/src/com/android/server/wm/RootWindowContainerTests.java5
-rw-r--r--services/tests/wmtests/src/com/android/server/wm/RunningTasksTest.java8
-rw-r--r--services/tests/wmtests/src/com/android/server/wm/SizeCompatTests.java9
-rw-r--r--services/tests/wmtests/src/com/android/server/wm/TaskStackChangedListenerTest.java17
-rw-r--r--services/tests/wmtests/src/com/android/server/wm/TestWindowManagerPolicy.java5
-rw-r--r--services/tests/wmtests/src/com/android/server/wm/TransitionTests.java45
-rw-r--r--services/tests/wmtests/src/com/android/server/wm/WindowContainerTraversalTests.java2
-rw-r--r--services/tests/wmtests/src/com/android/server/wm/WindowFrameTests.java2
-rw-r--r--services/tests/wmtests/src/com/android/server/wm/WindowOrganizerTests.java9
-rw-r--r--services/tests/wmtests/src/com/android/server/wm/WindowStateTests.java4
-rw-r--r--services/tests/wmtests/src/com/android/server/wm/WindowTestsBase.java9
-rw-r--r--services/tests/wmtests/src/com/android/server/wm/ZOrderingTests.java12
-rw-r--r--services/tests/wmtests/src/com/android/server/wm/utils/CommonUtils.java37
-rw-r--r--telephony/common/com/android/internal/telephony/CarrierAppUtils.java6
-rw-r--r--telephony/common/com/android/internal/telephony/TelephonyPermissions.java6
-rw-r--r--telephony/java/android/telephony/DataFailCause.java106
-rw-r--r--telephony/java/android/telephony/TelephonyManager.java17
-rw-r--r--telephony/java/android/telephony/data/ApnThrottleStatus.java4
-rw-r--r--telephony/java/android/telephony/data/DataCallResponse.java4
-rw-r--r--telephony/java/android/telephony/ims/DelegateRegistrationState.java14
-rw-r--r--telephony/java/android/telephony/ims/SipDelegateConnection.java16
-rw-r--r--telephony/java/android/telephony/ims/aidl/ISipDelegate.aidl2
-rw-r--r--telephony/java/android/telephony/ims/aidl/SipDelegateConnectionAidlWrapper.java13
-rw-r--r--telephony/java/android/telephony/ims/stub/SipDelegate.java11
-rw-r--r--tests/FlickerTests/OWNERS1
-rw-r--r--tests/FlickerTests/src/com/android/server/wm/flicker/CommonAssertions.kt8
-rw-r--r--tests/FlickerTests/src/com/android/server/wm/flicker/helpers/ImeAppHelper.kt7
-rw-r--r--tests/FlickerTests/src/com/android/server/wm/flicker/ime/CloseImeAutoOpenWindowToAppTest.kt17
-rw-r--r--tests/FlickerTests/src/com/android/server/wm/flicker/ime/CloseImeAutoOpenWindowToHomeTest.kt18
-rw-r--r--tests/FlickerTests/src/com/android/server/wm/flicker/ime/CloseImeWindowToAppTest.kt13
-rw-r--r--tests/FlickerTests/src/com/android/server/wm/flicker/ime/CloseImeWindowToHomeTest.kt14
-rw-r--r--tests/FlickerTests/src/com/android/server/wm/flicker/ime/OpenImeWindowTest.kt4
-rw-r--r--tests/net/integration/util/com/android/server/NetworkAgentWrapper.java43
-rw-r--r--tests/net/java/com/android/server/ConnectivityServiceTest.java80
-rw-r--r--tests/net/java/com/android/server/connectivity/MultipathPolicyTrackerTest.java1
-rw-r--r--tests/net/java/com/android/server/connectivity/PermissionMonitorTest.java9
-rw-r--r--tests/net/java/com/android/server/connectivity/VpnTest.java176
-rw-r--r--wifi/api/current.txt6
-rw-r--r--wifi/api/system-current.txt15
-rw-r--r--wifi/java/android/net/wifi/ISoftApCallback.aidl6
-rw-r--r--wifi/java/android/net/wifi/IWifiManager.aidl2
-rw-r--r--wifi/java/android/net/wifi/ScanResult.java14
-rw-r--r--wifi/java/android/net/wifi/SecurityParams.java824
-rw-r--r--wifi/java/android/net/wifi/SoftApCapability.java29
-rw-r--r--wifi/java/android/net/wifi/SoftApConfiguration.java20
-rw-r--r--wifi/java/android/net/wifi/SoftApInfo.java67
-rw-r--r--wifi/java/android/net/wifi/WifiAnnotations.java5
-rw-r--r--wifi/java/android/net/wifi/WifiClient.java29
-rw-r--r--wifi/java/android/net/wifi/WifiConfiguration.java516
-rw-r--r--wifi/java/android/net/wifi/WifiManager.java75
-rw-r--r--wifi/java/android/net/wifi/rtt/RangingRequest.java123
-rw-r--r--wifi/tests/src/android/net/wifi/SecurityParamsTest.java502
-rw-r--r--wifi/tests/src/android/net/wifi/SoftApCapabilityTest.java4
-rw-r--r--wifi/tests/src/android/net/wifi/SoftApConfigurationTest.java10
-rw-r--r--wifi/tests/src/android/net/wifi/SoftApInfoTest.java45
-rw-r--r--wifi/tests/src/android/net/wifi/WifiClientTest.java14
-rw-r--r--wifi/tests/src/android/net/wifi/WifiConfigurationTest.java272
-rw-r--r--wifi/tests/src/android/net/wifi/WifiManagerTest.java29
-rw-r--r--wifi/tests/src/android/net/wifi/rtt/WifiRttManagerTest.java71
560 files changed, 12602 insertions, 10642 deletions
diff --git a/ApiDocs.bp b/ApiDocs.bp
index 7ed7ec526686..3d6bdbf19264 100644
--- a/ApiDocs.bp
+++ b/ApiDocs.bp
@@ -67,7 +67,7 @@ stubs_defaults {
":opt-net-voip-srcs",
":art.module.public.api{.public.stubs.source}",
":conscrypt.module.public.api{.public.stubs.source}",
- ":android_icu4j_public_api_files",
+ ":i18n.module.public.api{.public.stubs.source}",
"test-mock/src/**/*.java",
"test-runner/src/**/*.java",
],
diff --git a/BATTERY_STATS_OWNERS b/BATTERY_STATS_OWNERS
new file mode 100644
index 000000000000..7728975fcec1
--- /dev/null
+++ b/BATTERY_STATS_OWNERS
@@ -0,0 +1,4 @@
+# OWNERS of BatteryStats related files
+bookatz@google.com
+dplotnikov@google.com
+mwachens@google.com
diff --git a/OWNERS b/OWNERS
index 4f89f7dde6af..4160122532ff 100644
--- a/OWNERS
+++ b/OWNERS
@@ -1,22 +1,29 @@
# This top-level list should remain narrowly defined as team leads; individual
# teams are strongly encouraged to define narrower OWNERS files at deeper
# levels within the source tree; see OWNERS.md for more details
+akulian@google.com
dsandler@android.com
dsandler@google.com
hackbod@android.com
hackbod@google.com
+jjaggi@google.com
jsharkey@android.com
jsharkey@google.com
michaelwr@google.com
nandana@google.com
narayan@google.com
ogunwale@google.com
+roosa@google.com
svetoslavganov@android.com
svetoslavganov@google.com
yamasani@google.com
+# API changes are already covered by API-Review+1 (http://mdb/android-api-council)
+# via https://android.git.corp.google.com/All-Projects/+/refs/meta/config/rules.pl.
+per-file */api/*current.txt = *
+
# Support bulk translation updates
-per-file */res*/values*/*.xml = byi@google.com
+per-file */res*/values*/*.xml = byi@google.com, delphij@google.com
per-file Android.bp = file:platform/build/soong:/OWNERS
per-file Android.mk = file:platform/build/soong:/OWNERS
diff --git a/OWNERS.md b/OWNERS.md
index 6428c59fd793..601b5c641f21 100644
--- a/OWNERS.md
+++ b/OWNERS.md
@@ -1,3 +1,5 @@
+# Background
+
As general background, `OWNERS` files expedite code reviews by helping code
authors quickly find relevant reviewers, and they also ensure that stakeholders
are involved in code changes in their areas.
@@ -27,8 +29,40 @@ main `services/core/` project:
* `media/`
* `wifi/`
+# Design
+
Area maintainers are strongly encouraged to list people in a single
authoritative `OWNERS` file in **exactly one** location. Then, other paths
should reference that single authoritative `OWNERS` file using an include
directive. This approach ensures that updates are applied consistently across
the tree, reducing maintenance burden.
+
+# Examples
+
+The exact syntax of `OWNERS` files can be difficult to get correct, so here are
+some common examples:
+
+```
+# Complete include of top-level owners from this repo
+include /ZYGOTE_OWNERS
+# Partial include of top-level owners from this repo
+per-file ZygoteFile.java = file:/ZYGOTE_OWNERS
+```
+```
+# Complete include of subdirectory owners from this repo
+include /services/core/java/com/android/server/net/OWNERS
+# Partial include of subdirectory owners from this repo
+per-file NetworkFile.java = file:/services/core/java/com/android/server/net/OWNERS
+```
+```
+# Complete include of top-level owners from another repo
+include platform/libcore:/OWNERS
+# Partial include of top-level owners from another repo
+per-file LibcoreFile.java = file:platform/libcore:/OWNERS
+```
+```
+# Complete include of subdirectory owners from another repo
+include platform/frameworks/av:/camera/OWNERS
+# Partial include of subdirectory owners from another repo
+per-file CameraFile.java = file:platform/frameworks/av:/camera/OWNERS
+```
diff --git a/StubLibraries.bp b/StubLibraries.bp
index 380839e5c06b..12ee889387ec 100644
--- a/StubLibraries.bp
+++ b/StubLibraries.bp
@@ -48,7 +48,6 @@ stubs_defaults {
":opt-telephony-srcs",
":opt-net-voip-srcs",
":art.module.public.api{.public.stubs.source}",
- ":android_icu4j_public_api_files",
"**/package.html",
],
sdk_version: "core_platform",
@@ -251,6 +250,7 @@ java_library_static {
"framework-statsd.stubs",
"framework-tethering.stubs",
"framework-wifi.stubs",
+ "i18n.module.public.api.stubs",
"private-stub-annotations-jar",
],
defaults: ["android_defaults_stubs_current"],
@@ -270,6 +270,7 @@ java_library_static {
"framework-statsd.stubs.system",
"framework-tethering.stubs.system",
"framework-wifi.stubs.system",
+ "i18n.module.public.api.stubs",
"private-stub-annotations-jar",
],
defaults: [
@@ -305,6 +306,7 @@ java_library_static {
"framework-statsd.stubs.system",
"framework-tethering.stubs.system",
"framework-wifi.stubs.system",
+ "i18n.module.public.api.stubs",
"private-stub-annotations-jar",
],
defaults: [
diff --git a/apct-tests/perftests/blobstore/Android.bp b/apct-tests/perftests/blobstore/Android.bp
index be5072ce3d9d..be700a2b021c 100644
--- a/apct-tests/perftests/blobstore/Android.bp
+++ b/apct-tests/perftests/blobstore/Android.bp
@@ -21,6 +21,7 @@ android_test {
"androidx.annotation_annotation",
"apct-perftests-utils",
"ub-uiautomator",
+ "collector-device-lib-platform",
],
platform_apis: true,
test_suites: ["device-tests"],
diff --git a/apct-tests/perftests/blobstore/AndroidTest.xml b/apct-tests/perftests/blobstore/AndroidTest.xml
index 19456c6d81d7..58761d0e22f9 100644
--- a/apct-tests/perftests/blobstore/AndroidTest.xml
+++ b/apct-tests/perftests/blobstore/AndroidTest.xml
@@ -24,5 +24,22 @@
<test class="com.android.tradefed.testtype.AndroidJUnitTest" >
<option name="package" value="com.android.perftests.blob" />
<option name="hidden-api-checks" value="false"/>
+
+ <!-- TODO: Add PerfettoListener to automatically capture perfetto traces for each test-->
+ <!-- Listener related args for collecting the traces and waiting for the device
+ to stabilize. -->
+ <option name="device-listeners"
+ value="android.device.collectors.ProcLoadListener" />
+ <!-- Guarantee that user defined RunListeners will be running before any of the default
+ listeners defined in this runner. -->
+ <option name="instrumentation-arg" key="newRunListenerMode" value="true" />
+
+ <!-- ProcLoadListener related arguments -->
+ <!-- Wait for device last minute threshold to reach 3 with 2 minute timeout before
+ starting the test run -->
+ <option name="instrumentation-arg" key="procload-collector:per_run" value="true" />
+ <option name="instrumentation-arg" key="proc-loadavg-threshold" value="3" />
+ <option name="instrumentation-arg" key="proc-loadavg-timeout" value="120000" />
+ <option name="instrumentation-arg" key="proc-loadavg-interval" value="10000" />
</test>
</configuration> \ No newline at end of file
diff --git a/apex/jobscheduler/OWNERS b/apex/jobscheduler/OWNERS
index 0fe6cdffa5f6..d004eed2a0db 100644
--- a/apex/jobscheduler/OWNERS
+++ b/apex/jobscheduler/OWNERS
@@ -1,6 +1,6 @@
yamasani@google.com
omakoto@google.com
-ctate@google.com
+ctate@android.com
ctate@google.com
kwekua@google.com
suprabh@google.com \ No newline at end of file
diff --git a/api/Android.bp b/api/Android.bp
index 5ee41b79b58c..9417030fc937 100644
--- a/api/Android.bp
+++ b/api/Android.bp
@@ -38,6 +38,7 @@ genrule {
":framework-statsd{.public.api.txt}",
":framework-tethering{.public.api.txt}",
":framework-wifi{.public.api.txt}",
+ ":i18n.module.public.api{.public.api.txt}",
":non-updatable-current.txt",
],
out: ["current.txt"],
@@ -50,7 +51,10 @@ genrule {
dest: "current.txt",
},
{
- targets: ["sdk", "win_sdk"],
+ targets: [
+ "sdk",
+ "win_sdk",
+ ],
dir: "apistubs/android/public/api",
dest: "android.txt",
},
@@ -72,6 +76,7 @@ genrule {
":framework-statsd{.public.stubs.source}",
":framework-tethering{.public.stubs.source}",
":framework-wifi{.public.stubs.source}",
+ ":i18n.module.public.api{.public.stubs.source}",
],
out: ["current.srcjar"],
tools: ["merge_zips"],
@@ -92,6 +97,7 @@ genrule {
":framework-statsd{.public.removed-api.txt}",
":framework-tethering{.public.removed-api.txt}",
":framework-wifi{.public.removed-api.txt}",
+ ":i18n.module.public.api{.public.removed-api.txt}",
":non-updatable-removed.txt",
],
out: ["removed.txt"],
@@ -130,7 +136,10 @@ genrule {
dest: "system-current.txt",
},
{
- targets: ["sdk", "win_sdk"],
+ targets: [
+ "sdk",
+ "win_sdk",
+ ],
dir: "apistubs/android/system/api",
dest: "android.txt",
},
@@ -189,7 +198,10 @@ genrule {
dest: "module-lib-current.txt",
},
{
- targets: ["sdk", "win_sdk"],
+ targets: [
+ "sdk",
+ "win_sdk",
+ ],
dir: "apistubs/android/module-lib/api",
dest: "android.txt",
},
diff --git a/core/api/current.txt b/core/api/current.txt
index 15902310c9cf..92d5298bb6b9 100644
--- a/core/api/current.txt
+++ b/core/api/current.txt
@@ -87,6 +87,7 @@ package android {
field public static final String GET_PACKAGE_SIZE = "android.permission.GET_PACKAGE_SIZE";
field @Deprecated public static final String GET_TASKS = "android.permission.GET_TASKS";
field public static final String GLOBAL_SEARCH = "android.permission.GLOBAL_SEARCH";
+ field public static final String HIDE_OVERLAY_WINDOWS = "android.permission.HIDE_OVERLAY_WINDOWS";
field public static final String INSTALL_LOCATION_PROVIDER = "android.permission.INSTALL_LOCATION_PROVIDER";
field public static final String INSTALL_PACKAGES = "android.permission.INSTALL_PACKAGES";
field public static final String INSTALL_SHORTCUT = "com.android.launcher.permission.INSTALL_SHORTCUT";
@@ -140,6 +141,7 @@ package android {
field public static final String REQUEST_DELETE_PACKAGES = "android.permission.REQUEST_DELETE_PACKAGES";
field public static final String REQUEST_IGNORE_BATTERY_OPTIMIZATIONS = "android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS";
field public static final String REQUEST_INSTALL_PACKAGES = "android.permission.REQUEST_INSTALL_PACKAGES";
+ field public static final String REQUEST_OBSERVE_COMPANION_DEVICE_PRESENCE = "android.permission.REQUEST_OBSERVE_COMPANION_DEVICE_PRESENCE";
field public static final String REQUEST_PASSWORD_COMPLEXITY = "android.permission.REQUEST_PASSWORD_COMPLEXITY";
field @Deprecated public static final String RESTART_PACKAGES = "android.permission.RESTART_PACKAGES";
field public static final String SEND_RESPOND_VIA_MESSAGE = "android.permission.SEND_RESPOND_VIA_MESSAGE";
@@ -6940,14 +6942,14 @@ package android.app.admin {
method public long getPasswordExpirationTimeout(@Nullable android.content.ComponentName);
method public int getPasswordHistoryLength(@Nullable android.content.ComponentName);
method public int getPasswordMaximumLength(int);
- method public int getPasswordMinimumLength(@Nullable android.content.ComponentName);
- method public int getPasswordMinimumLetters(@Nullable android.content.ComponentName);
- method public int getPasswordMinimumLowerCase(@Nullable android.content.ComponentName);
- method public int getPasswordMinimumNonLetter(@Nullable android.content.ComponentName);
- method public int getPasswordMinimumNumeric(@Nullable android.content.ComponentName);
- method public int getPasswordMinimumSymbols(@Nullable android.content.ComponentName);
- method public int getPasswordMinimumUpperCase(@Nullable android.content.ComponentName);
- method public int getPasswordQuality(@Nullable android.content.ComponentName);
+ method @Deprecated public int getPasswordMinimumLength(@Nullable android.content.ComponentName);
+ method @Deprecated public int getPasswordMinimumLetters(@Nullable android.content.ComponentName);
+ method @Deprecated public int getPasswordMinimumLowerCase(@Nullable android.content.ComponentName);
+ method @Deprecated public int getPasswordMinimumNonLetter(@Nullable android.content.ComponentName);
+ method @Deprecated public int getPasswordMinimumNumeric(@Nullable android.content.ComponentName);
+ method @Deprecated public int getPasswordMinimumSymbols(@Nullable android.content.ComponentName);
+ method @Deprecated public int getPasswordMinimumUpperCase(@Nullable android.content.ComponentName);
+ method @Deprecated public int getPasswordQuality(@Nullable android.content.ComponentName);
method @Nullable public android.app.admin.SystemUpdateInfo getPendingSystemUpdate(@NonNull android.content.ComponentName);
method public int getPermissionGrantState(@Nullable android.content.ComponentName, @NonNull String, @NonNull String);
method public int getPermissionPolicy(android.content.ComponentName);
@@ -7071,14 +7073,14 @@ package android.app.admin {
method @NonNull public String[] setPackagesSuspended(@NonNull android.content.ComponentName, @NonNull String[], boolean);
method public void setPasswordExpirationTimeout(@NonNull android.content.ComponentName, long);
method public void setPasswordHistoryLength(@NonNull android.content.ComponentName, int);
- method public void setPasswordMinimumLength(@NonNull android.content.ComponentName, int);
- method public void setPasswordMinimumLetters(@NonNull android.content.ComponentName, int);
- method public void setPasswordMinimumLowerCase(@NonNull android.content.ComponentName, int);
- method public void setPasswordMinimumNonLetter(@NonNull android.content.ComponentName, int);
- method public void setPasswordMinimumNumeric(@NonNull android.content.ComponentName, int);
- method public void setPasswordMinimumSymbols(@NonNull android.content.ComponentName, int);
- method public void setPasswordMinimumUpperCase(@NonNull android.content.ComponentName, int);
- method public void setPasswordQuality(@NonNull android.content.ComponentName, int);
+ method @Deprecated public void setPasswordMinimumLength(@NonNull android.content.ComponentName, int);
+ method @Deprecated public void setPasswordMinimumLetters(@NonNull android.content.ComponentName, int);
+ method @Deprecated public void setPasswordMinimumLowerCase(@NonNull android.content.ComponentName, int);
+ method @Deprecated public void setPasswordMinimumNonLetter(@NonNull android.content.ComponentName, int);
+ method @Deprecated public void setPasswordMinimumNumeric(@NonNull android.content.ComponentName, int);
+ method @Deprecated public void setPasswordMinimumSymbols(@NonNull android.content.ComponentName, int);
+ method @Deprecated public void setPasswordMinimumUpperCase(@NonNull android.content.ComponentName, int);
+ method @Deprecated public void setPasswordQuality(@NonNull android.content.ComponentName, int);
method public boolean setPermissionGrantState(@NonNull android.content.ComponentName, @NonNull String, @NonNull String, int);
method public void setPermissionPolicy(@NonNull android.content.ComponentName, int);
method public boolean setPermittedAccessibilityServices(@NonNull android.content.ComponentName, java.util.List<java.lang.String>);
@@ -9519,6 +9521,8 @@ package android.companion {
method @NonNull public java.util.List<java.lang.String> getAssociations();
method public boolean hasNotificationAccess(android.content.ComponentName);
method public void requestNotificationAccess(android.content.ComponentName);
+ method @RequiresPermission(android.Manifest.permission.REQUEST_OBSERVE_COMPANION_DEVICE_PRESENCE) public void startObservingDevicePresence(@NonNull String) throws android.companion.DeviceNotAssociatedException;
+ method @RequiresPermission(android.Manifest.permission.REQUEST_OBSERVE_COMPANION_DEVICE_PRESENCE) public void stopObservingDevicePresence(@NonNull String) throws android.companion.DeviceNotAssociatedException;
field public static final String EXTRA_DEVICE = "android.companion.extra.DEVICE";
}
@@ -9539,6 +9543,9 @@ package android.companion {
public interface DeviceFilter<D extends android.os.Parcelable> extends android.os.Parcelable {
}
+ public class DeviceNotAssociatedException extends java.lang.Exception {
+ }
+
public final class WifiDeviceFilter implements android.companion.DeviceFilter<android.net.wifi.ScanResult> {
method public int describeContents();
method public void writeToParcel(@NonNull android.os.Parcel, int);
@@ -12256,6 +12263,7 @@ package android.content.pm {
field public static final String FEATURE_NFC_HOST_CARD_EMULATION_NFCF = "android.hardware.nfc.hcef";
field public static final String FEATURE_NFC_OFF_HOST_CARD_EMULATION_ESE = "android.hardware.nfc.ese";
field public static final String FEATURE_NFC_OFF_HOST_CARD_EMULATION_UICC = "android.hardware.nfc.uicc";
+ field public static final String FEATURE_OPENGLES_DEQP_LEVEL = "android.software.opengles.deqp.level";
field public static final String FEATURE_OPENGLES_EXTENSION_PACK = "android.hardware.opengles.aep";
field public static final String FEATURE_PC = "android.hardware.type.pc";
field public static final String FEATURE_PICTURE_IN_PICTURE = "android.software.picture_in_picture";
@@ -15279,16 +15287,11 @@ package android.graphics {
ctor public PaintFlagsDrawFilter(int, int);
}
- public final class ParcelableColorSpace extends android.graphics.ColorSpace implements android.os.Parcelable {
+ public final class ParcelableColorSpace implements android.os.Parcelable {
ctor public ParcelableColorSpace(@NonNull android.graphics.ColorSpace);
method public int describeContents();
- method @NonNull public float[] fromXyz(@NonNull float[]);
method @NonNull public android.graphics.ColorSpace getColorSpace();
- method public float getMaxValue(int);
- method public float getMinValue(int);
method public static boolean isParcelable(@NonNull android.graphics.ColorSpace);
- method public boolean isWideGamut();
- method @NonNull public float[] toXyz(@NonNull float[]);
method public void writeToParcel(@NonNull android.os.Parcel, int);
field @NonNull public static final android.os.Parcelable.Creator<android.graphics.ParcelableColorSpace> CREATOR;
}
@@ -18524,4812 +18527,6 @@ package android.hardware.usb {
}
-package android.icu.lang {
-
- public final class UCharacter implements android.icu.lang.UCharacterEnums.ECharacterCategory android.icu.lang.UCharacterEnums.ECharacterDirection {
- method public static int charCount(int);
- method public static int codePointAt(CharSequence, int);
- method public static int codePointAt(char[], int);
- method public static int codePointAt(char[], int, int);
- method public static int codePointBefore(CharSequence, int);
- method public static int codePointBefore(char[], int);
- method public static int codePointBefore(char[], int, int);
- method public static int codePointCount(CharSequence, int, int);
- method public static int codePointCount(char[], int, int);
- method public static int digit(int, int);
- method public static int digit(int);
- method public static int foldCase(int, boolean);
- method public static String foldCase(String, boolean);
- method public static int foldCase(int, int);
- method public static String foldCase(String, int);
- method public static char forDigit(int, int);
- method public static android.icu.util.VersionInfo getAge(int);
- method public static int getBidiPairedBracket(int);
- method public static int getCharFromExtendedName(String);
- method public static int getCharFromName(String);
- method public static int getCharFromNameAlias(String);
- method public static int getCodePoint(char, char);
- method public static int getCodePoint(char);
- method public static int getCombiningClass(int);
- method public static int getDirection(int);
- method public static byte getDirectionality(int);
- method public static String getExtendedName(int);
- method public static android.icu.util.ValueIterator getExtendedNameIterator();
- method public static int getHanNumericValue(int);
- method public static int getIntPropertyMaxValue(int);
- method public static int getIntPropertyMinValue(int);
- method public static int getIntPropertyValue(int, int);
- method public static int getMirror(int);
- method public static String getName(int);
- method public static String getName(String, String);
- method public static String getNameAlias(int);
- method public static android.icu.util.ValueIterator getNameIterator();
- method public static int getNumericValue(int);
- method public static int getPropertyEnum(CharSequence);
- method public static String getPropertyName(int, int);
- method public static int getPropertyValueEnum(int, CharSequence);
- method public static String getPropertyValueName(int, int, int);
- method public static int getType(int);
- method public static android.icu.util.RangeValueIterator getTypeIterator();
- method public static double getUnicodeNumericValue(int);
- method public static android.icu.util.VersionInfo getUnicodeVersion();
- method public static boolean hasBinaryProperty(int, int);
- method public static boolean isBMP(int);
- method public static boolean isBaseForm(int);
- method public static boolean isDefined(int);
- method public static boolean isDigit(int);
- method public static boolean isHighSurrogate(char);
- method public static boolean isISOControl(int);
- method public static boolean isIdentifierIgnorable(int);
- method public static boolean isJavaIdentifierPart(int);
- method public static boolean isJavaIdentifierStart(int);
- method public static boolean isLegal(int);
- method public static boolean isLegal(String);
- method public static boolean isLetter(int);
- method public static boolean isLetterOrDigit(int);
- method public static boolean isLowSurrogate(char);
- method public static boolean isLowerCase(int);
- method public static boolean isMirrored(int);
- method public static boolean isPrintable(int);
- method public static boolean isSpaceChar(int);
- method public static boolean isSupplementary(int);
- method public static boolean isSupplementaryCodePoint(int);
- method public static boolean isSurrogatePair(char, char);
- method public static boolean isTitleCase(int);
- method public static boolean isUAlphabetic(int);
- method public static boolean isULowercase(int);
- method public static boolean isUUppercase(int);
- method public static boolean isUWhiteSpace(int);
- method public static boolean isUnicodeIdentifierPart(int);
- method public static boolean isUnicodeIdentifierStart(int);
- method public static boolean isUpperCase(int);
- method public static boolean isValidCodePoint(int);
- method public static boolean isWhitespace(int);
- method public static int offsetByCodePoints(CharSequence, int, int);
- method public static int offsetByCodePoints(char[], int, int, int, int);
- method public static int toChars(int, char[], int);
- method public static char[] toChars(int);
- method public static int toCodePoint(char, char);
- method public static int toLowerCase(int);
- method public static String toLowerCase(String);
- method public static String toLowerCase(java.util.Locale, String);
- method public static String toLowerCase(android.icu.util.ULocale, String);
- method public static String toString(int);
- method public static int toTitleCase(int);
- method public static String toTitleCase(String, android.icu.text.BreakIterator);
- method public static String toTitleCase(java.util.Locale, String, android.icu.text.BreakIterator);
- method public static String toTitleCase(android.icu.util.ULocale, String, android.icu.text.BreakIterator);
- method public static String toTitleCase(android.icu.util.ULocale, String, android.icu.text.BreakIterator, int);
- method public static String toTitleCase(java.util.Locale, String, android.icu.text.BreakIterator, int);
- method public static int toUpperCase(int);
- method public static String toUpperCase(String);
- method public static String toUpperCase(java.util.Locale, String);
- method public static String toUpperCase(android.icu.util.ULocale, String);
- field public static final int FOLD_CASE_DEFAULT = 0; // 0x0
- field public static final int FOLD_CASE_EXCLUDE_SPECIAL_I = 1; // 0x1
- field public static final int MAX_CODE_POINT = 1114111; // 0x10ffff
- field public static final char MAX_HIGH_SURROGATE = 56319; // 0xdbff '\udbff'
- field public static final char MAX_LOW_SURROGATE = 57343; // 0xdfff '\udfff'
- field public static final int MAX_RADIX = 36; // 0x24
- field public static final char MAX_SURROGATE = 57343; // 0xdfff '\udfff'
- field public static final int MAX_VALUE = 1114111; // 0x10ffff
- field public static final int MIN_CODE_POINT = 0; // 0x0
- field public static final char MIN_HIGH_SURROGATE = 55296; // 0xd800 '\ud800'
- field public static final char MIN_LOW_SURROGATE = 56320; // 0xdc00 '\udc00'
- field public static final int MIN_RADIX = 2; // 0x2
- field public static final int MIN_SUPPLEMENTARY_CODE_POINT = 65536; // 0x10000
- field public static final char MIN_SURROGATE = 55296; // 0xd800 '\ud800'
- field public static final int MIN_VALUE = 0; // 0x0
- field public static final double NO_NUMERIC_VALUE = -1.23456789E8;
- field public static final int REPLACEMENT_CHAR = 65533; // 0xfffd
- field public static final int SUPPLEMENTARY_MIN_VALUE = 65536; // 0x10000
- field public static final int TITLECASE_NO_BREAK_ADJUSTMENT = 512; // 0x200
- field public static final int TITLECASE_NO_LOWERCASE = 256; // 0x100
- }
-
- public static interface UCharacter.BidiPairedBracketType {
- field public static final int CLOSE = 2; // 0x2
- field public static final int NONE = 0; // 0x0
- field public static final int OPEN = 1; // 0x1
- }
-
- public static interface UCharacter.DecompositionType {
- field public static final int CANONICAL = 1; // 0x1
- field public static final int CIRCLE = 3; // 0x3
- field public static final int COMPAT = 2; // 0x2
- field public static final int FINAL = 4; // 0x4
- field public static final int FONT = 5; // 0x5
- field public static final int FRACTION = 6; // 0x6
- field public static final int INITIAL = 7; // 0x7
- field public static final int ISOLATED = 8; // 0x8
- field public static final int MEDIAL = 9; // 0x9
- field public static final int NARROW = 10; // 0xa
- field public static final int NOBREAK = 11; // 0xb
- field public static final int NONE = 0; // 0x0
- field public static final int SMALL = 12; // 0xc
- field public static final int SQUARE = 13; // 0xd
- field public static final int SUB = 14; // 0xe
- field public static final int SUPER = 15; // 0xf
- field public static final int VERTICAL = 16; // 0x10
- field public static final int WIDE = 17; // 0x11
- }
-
- public static interface UCharacter.EastAsianWidth {
- field public static final int AMBIGUOUS = 1; // 0x1
- field public static final int FULLWIDTH = 3; // 0x3
- field public static final int HALFWIDTH = 2; // 0x2
- field public static final int NARROW = 4; // 0x4
- field public static final int NEUTRAL = 0; // 0x0
- field public static final int WIDE = 5; // 0x5
- }
-
- public static interface UCharacter.GraphemeClusterBreak {
- field public static final int CONTROL = 1; // 0x1
- field public static final int CR = 2; // 0x2
- field public static final int EXTEND = 3; // 0x3
- field public static final int E_BASE = 13; // 0xd
- field public static final int E_BASE_GAZ = 14; // 0xe
- field public static final int E_MODIFIER = 15; // 0xf
- field public static final int GLUE_AFTER_ZWJ = 16; // 0x10
- field public static final int L = 4; // 0x4
- field public static final int LF = 5; // 0x5
- field public static final int LV = 6; // 0x6
- field public static final int LVT = 7; // 0x7
- field public static final int OTHER = 0; // 0x0
- field public static final int PREPEND = 11; // 0xb
- field public static final int REGIONAL_INDICATOR = 12; // 0xc
- field public static final int SPACING_MARK = 10; // 0xa
- field public static final int T = 8; // 0x8
- field public static final int V = 9; // 0x9
- field public static final int ZWJ = 17; // 0x11
- }
-
- public static interface UCharacter.HangulSyllableType {
- field public static final int LEADING_JAMO = 1; // 0x1
- field public static final int LVT_SYLLABLE = 5; // 0x5
- field public static final int LV_SYLLABLE = 4; // 0x4
- field public static final int NOT_APPLICABLE = 0; // 0x0
- field public static final int TRAILING_JAMO = 3; // 0x3
- field public static final int VOWEL_JAMO = 2; // 0x2
- }
-
- public static interface UCharacter.IndicPositionalCategory {
- field public static final int BOTTOM = 1; // 0x1
- field public static final int BOTTOM_AND_LEFT = 2; // 0x2
- field public static final int BOTTOM_AND_RIGHT = 3; // 0x3
- field public static final int LEFT = 4; // 0x4
- field public static final int LEFT_AND_RIGHT = 5; // 0x5
- field public static final int NA = 0; // 0x0
- field public static final int OVERSTRUCK = 6; // 0x6
- field public static final int RIGHT = 7; // 0x7
- field public static final int TOP = 8; // 0x8
- field public static final int TOP_AND_BOTTOM = 9; // 0x9
- field public static final int TOP_AND_BOTTOM_AND_LEFT = 15; // 0xf
- field public static final int TOP_AND_BOTTOM_AND_RIGHT = 10; // 0xa
- field public static final int TOP_AND_LEFT = 11; // 0xb
- field public static final int TOP_AND_LEFT_AND_RIGHT = 12; // 0xc
- field public static final int TOP_AND_RIGHT = 13; // 0xd
- field public static final int VISUAL_ORDER_LEFT = 14; // 0xe
- }
-
- public static interface UCharacter.IndicSyllabicCategory {
- field public static final int AVAGRAHA = 1; // 0x1
- field public static final int BINDU = 2; // 0x2
- field public static final int BRAHMI_JOINING_NUMBER = 3; // 0x3
- field public static final int CANTILLATION_MARK = 4; // 0x4
- field public static final int CONSONANT = 5; // 0x5
- field public static final int CONSONANT_DEAD = 6; // 0x6
- field public static final int CONSONANT_FINAL = 7; // 0x7
- field public static final int CONSONANT_HEAD_LETTER = 8; // 0x8
- field public static final int CONSONANT_INITIAL_POSTFIXED = 9; // 0x9
- field public static final int CONSONANT_KILLER = 10; // 0xa
- field public static final int CONSONANT_MEDIAL = 11; // 0xb
- field public static final int CONSONANT_PLACEHOLDER = 12; // 0xc
- field public static final int CONSONANT_PRECEDING_REPHA = 13; // 0xd
- field public static final int CONSONANT_PREFIXED = 14; // 0xe
- field public static final int CONSONANT_SUBJOINED = 15; // 0xf
- field public static final int CONSONANT_SUCCEEDING_REPHA = 16; // 0x10
- field public static final int CONSONANT_WITH_STACKER = 17; // 0x11
- field public static final int GEMINATION_MARK = 18; // 0x12
- field public static final int INVISIBLE_STACKER = 19; // 0x13
- field public static final int JOINER = 20; // 0x14
- field public static final int MODIFYING_LETTER = 21; // 0x15
- field public static final int NON_JOINER = 22; // 0x16
- field public static final int NUKTA = 23; // 0x17
- field public static final int NUMBER = 24; // 0x18
- field public static final int NUMBER_JOINER = 25; // 0x19
- field public static final int OTHER = 0; // 0x0
- field public static final int PURE_KILLER = 26; // 0x1a
- field public static final int REGISTER_SHIFTER = 27; // 0x1b
- field public static final int SYLLABLE_MODIFIER = 28; // 0x1c
- field public static final int TONE_LETTER = 29; // 0x1d
- field public static final int TONE_MARK = 30; // 0x1e
- field public static final int VIRAMA = 31; // 0x1f
- field public static final int VISARGA = 32; // 0x20
- field public static final int VOWEL = 33; // 0x21
- field public static final int VOWEL_DEPENDENT = 34; // 0x22
- field public static final int VOWEL_INDEPENDENT = 35; // 0x23
- }
-
- public static interface UCharacter.JoiningGroup {
- field public static final int AFRICAN_FEH = 86; // 0x56
- field public static final int AFRICAN_NOON = 87; // 0x57
- field public static final int AFRICAN_QAF = 88; // 0x58
- field public static final int AIN = 1; // 0x1
- field public static final int ALAPH = 2; // 0x2
- field public static final int ALEF = 3; // 0x3
- field public static final int BEH = 4; // 0x4
- field public static final int BETH = 5; // 0x5
- field public static final int BURUSHASKI_YEH_BARREE = 54; // 0x36
- field public static final int DAL = 6; // 0x6
- field public static final int DALATH_RISH = 7; // 0x7
- field public static final int E = 8; // 0x8
- field public static final int FARSI_YEH = 55; // 0x37
- field public static final int FE = 51; // 0x33
- field public static final int FEH = 9; // 0x9
- field public static final int FINAL_SEMKATH = 10; // 0xa
- field public static final int GAF = 11; // 0xb
- field public static final int GAMAL = 12; // 0xc
- field public static final int HAH = 13; // 0xd
- field public static final int HAMZA_ON_HEH_GOAL = 14; // 0xe
- field public static final int HANIFI_ROHINGYA_KINNA_YA = 100; // 0x64
- field public static final int HANIFI_ROHINGYA_PA = 101; // 0x65
- field public static final int HE = 15; // 0xf
- field public static final int HEH = 16; // 0x10
- field public static final int HEH_GOAL = 17; // 0x11
- field public static final int HETH = 18; // 0x12
- field public static final int KAF = 19; // 0x13
- field public static final int KAPH = 20; // 0x14
- field public static final int KHAPH = 52; // 0x34
- field public static final int KNOTTED_HEH = 21; // 0x15
- field public static final int LAM = 22; // 0x16
- field public static final int LAMADH = 23; // 0x17
- field public static final int MALAYALAM_BHA = 89; // 0x59
- field public static final int MALAYALAM_JA = 90; // 0x5a
- field public static final int MALAYALAM_LLA = 91; // 0x5b
- field public static final int MALAYALAM_LLLA = 92; // 0x5c
- field public static final int MALAYALAM_NGA = 93; // 0x5d
- field public static final int MALAYALAM_NNA = 94; // 0x5e
- field public static final int MALAYALAM_NNNA = 95; // 0x5f
- field public static final int MALAYALAM_NYA = 96; // 0x60
- field public static final int MALAYALAM_RA = 97; // 0x61
- field public static final int MALAYALAM_SSA = 98; // 0x62
- field public static final int MALAYALAM_TTA = 99; // 0x63
- field public static final int MANICHAEAN_ALEPH = 58; // 0x3a
- field public static final int MANICHAEAN_AYIN = 59; // 0x3b
- field public static final int MANICHAEAN_BETH = 60; // 0x3c
- field public static final int MANICHAEAN_DALETH = 61; // 0x3d
- field public static final int MANICHAEAN_DHAMEDH = 62; // 0x3e
- field public static final int MANICHAEAN_FIVE = 63; // 0x3f
- field public static final int MANICHAEAN_GIMEL = 64; // 0x40
- field public static final int MANICHAEAN_HETH = 65; // 0x41
- field public static final int MANICHAEAN_HUNDRED = 66; // 0x42
- field public static final int MANICHAEAN_KAPH = 67; // 0x43
- field public static final int MANICHAEAN_LAMEDH = 68; // 0x44
- field public static final int MANICHAEAN_MEM = 69; // 0x45
- field public static final int MANICHAEAN_NUN = 70; // 0x46
- field public static final int MANICHAEAN_ONE = 71; // 0x47
- field public static final int MANICHAEAN_PE = 72; // 0x48
- field public static final int MANICHAEAN_QOPH = 73; // 0x49
- field public static final int MANICHAEAN_RESH = 74; // 0x4a
- field public static final int MANICHAEAN_SADHE = 75; // 0x4b
- field public static final int MANICHAEAN_SAMEKH = 76; // 0x4c
- field public static final int MANICHAEAN_TAW = 77; // 0x4d
- field public static final int MANICHAEAN_TEN = 78; // 0x4e
- field public static final int MANICHAEAN_TETH = 79; // 0x4f
- field public static final int MANICHAEAN_THAMEDH = 80; // 0x50
- field public static final int MANICHAEAN_TWENTY = 81; // 0x51
- field public static final int MANICHAEAN_WAW = 82; // 0x52
- field public static final int MANICHAEAN_YODH = 83; // 0x53
- field public static final int MANICHAEAN_ZAYIN = 84; // 0x54
- field public static final int MEEM = 24; // 0x18
- field public static final int MIM = 25; // 0x19
- field public static final int NOON = 26; // 0x1a
- field public static final int NO_JOINING_GROUP = 0; // 0x0
- field public static final int NUN = 27; // 0x1b
- field public static final int NYA = 56; // 0x38
- field public static final int PE = 28; // 0x1c
- field public static final int QAF = 29; // 0x1d
- field public static final int QAPH = 30; // 0x1e
- field public static final int REH = 31; // 0x1f
- field public static final int REVERSED_PE = 32; // 0x20
- field public static final int ROHINGYA_YEH = 57; // 0x39
- field public static final int SAD = 33; // 0x21
- field public static final int SADHE = 34; // 0x22
- field public static final int SEEN = 35; // 0x23
- field public static final int SEMKATH = 36; // 0x24
- field public static final int SHIN = 37; // 0x25
- field public static final int STRAIGHT_WAW = 85; // 0x55
- field public static final int SWASH_KAF = 38; // 0x26
- field public static final int SYRIAC_WAW = 39; // 0x27
- field public static final int TAH = 40; // 0x28
- field public static final int TAW = 41; // 0x29
- field public static final int TEH_MARBUTA = 42; // 0x2a
- field public static final int TEH_MARBUTA_GOAL = 14; // 0xe
- field public static final int TETH = 43; // 0x2b
- field public static final int WAW = 44; // 0x2c
- field public static final int YEH = 45; // 0x2d
- field public static final int YEH_BARREE = 46; // 0x2e
- field public static final int YEH_WITH_TAIL = 47; // 0x2f
- field public static final int YUDH = 48; // 0x30
- field public static final int YUDH_HE = 49; // 0x31
- field public static final int ZAIN = 50; // 0x32
- field public static final int ZHAIN = 53; // 0x35
- }
-
- public static interface UCharacter.JoiningType {
- field public static final int DUAL_JOINING = 2; // 0x2
- field public static final int JOIN_CAUSING = 1; // 0x1
- field public static final int LEFT_JOINING = 3; // 0x3
- field public static final int NON_JOINING = 0; // 0x0
- field public static final int RIGHT_JOINING = 4; // 0x4
- field public static final int TRANSPARENT = 5; // 0x5
- }
-
- public static interface UCharacter.LineBreak {
- field public static final int ALPHABETIC = 2; // 0x2
- field public static final int AMBIGUOUS = 1; // 0x1
- field public static final int BREAK_AFTER = 4; // 0x4
- field public static final int BREAK_BEFORE = 5; // 0x5
- field public static final int BREAK_BOTH = 3; // 0x3
- field public static final int BREAK_SYMBOLS = 27; // 0x1b
- field public static final int CARRIAGE_RETURN = 10; // 0xa
- field public static final int CLOSE_PARENTHESIS = 36; // 0x24
- field public static final int CLOSE_PUNCTUATION = 8; // 0x8
- field public static final int COMBINING_MARK = 9; // 0x9
- field public static final int COMPLEX_CONTEXT = 24; // 0x18
- field public static final int CONDITIONAL_JAPANESE_STARTER = 37; // 0x25
- field public static final int CONTINGENT_BREAK = 7; // 0x7
- field public static final int EXCLAMATION = 11; // 0xb
- field public static final int E_BASE = 40; // 0x28
- field public static final int E_MODIFIER = 41; // 0x29
- field public static final int GLUE = 12; // 0xc
- field public static final int H2 = 31; // 0x1f
- field public static final int H3 = 32; // 0x20
- field public static final int HEBREW_LETTER = 38; // 0x26
- field public static final int HYPHEN = 13; // 0xd
- field public static final int IDEOGRAPHIC = 14; // 0xe
- field public static final int INFIX_NUMERIC = 16; // 0x10
- field public static final int INSEPARABLE = 15; // 0xf
- field public static final int INSEPERABLE = 15; // 0xf
- field public static final int JL = 33; // 0x21
- field public static final int JT = 34; // 0x22
- field public static final int JV = 35; // 0x23
- field public static final int LINE_FEED = 17; // 0x11
- field public static final int MANDATORY_BREAK = 6; // 0x6
- field public static final int NEXT_LINE = 29; // 0x1d
- field public static final int NONSTARTER = 18; // 0x12
- field public static final int NUMERIC = 19; // 0x13
- field public static final int OPEN_PUNCTUATION = 20; // 0x14
- field public static final int POSTFIX_NUMERIC = 21; // 0x15
- field public static final int PREFIX_NUMERIC = 22; // 0x16
- field public static final int QUOTATION = 23; // 0x17
- field public static final int REGIONAL_INDICATOR = 39; // 0x27
- field public static final int SPACE = 26; // 0x1a
- field public static final int SURROGATE = 25; // 0x19
- field public static final int UNKNOWN = 0; // 0x0
- field public static final int WORD_JOINER = 30; // 0x1e
- field public static final int ZWJ = 42; // 0x2a
- field public static final int ZWSPACE = 28; // 0x1c
- }
-
- public static interface UCharacter.NumericType {
- field public static final int DECIMAL = 1; // 0x1
- field public static final int DIGIT = 2; // 0x2
- field public static final int NONE = 0; // 0x0
- field public static final int NUMERIC = 3; // 0x3
- }
-
- public static interface UCharacter.SentenceBreak {
- field public static final int ATERM = 1; // 0x1
- field public static final int CLOSE = 2; // 0x2
- field public static final int CR = 11; // 0xb
- field public static final int EXTEND = 12; // 0xc
- field public static final int FORMAT = 3; // 0x3
- field public static final int LF = 13; // 0xd
- field public static final int LOWER = 4; // 0x4
- field public static final int NUMERIC = 5; // 0x5
- field public static final int OLETTER = 6; // 0x6
- field public static final int OTHER = 0; // 0x0
- field public static final int SCONTINUE = 14; // 0xe
- field public static final int SEP = 7; // 0x7
- field public static final int SP = 8; // 0x8
- field public static final int STERM = 9; // 0x9
- field public static final int UPPER = 10; // 0xa
- }
-
- public static final class UCharacter.UnicodeBlock extends java.lang.Character.Subset {
- method public static android.icu.lang.UCharacter.UnicodeBlock forName(String);
- method public int getID();
- method public static android.icu.lang.UCharacter.UnicodeBlock getInstance(int);
- method public static android.icu.lang.UCharacter.UnicodeBlock of(int);
- field public static final android.icu.lang.UCharacter.UnicodeBlock ADLAM;
- field public static final int ADLAM_ID = 263; // 0x107
- field public static final android.icu.lang.UCharacter.UnicodeBlock AEGEAN_NUMBERS;
- field public static final int AEGEAN_NUMBERS_ID = 119; // 0x77
- field public static final android.icu.lang.UCharacter.UnicodeBlock AHOM;
- field public static final int AHOM_ID = 253; // 0xfd
- field public static final android.icu.lang.UCharacter.UnicodeBlock ALCHEMICAL_SYMBOLS;
- field public static final int ALCHEMICAL_SYMBOLS_ID = 208; // 0xd0
- field public static final android.icu.lang.UCharacter.UnicodeBlock ALPHABETIC_PRESENTATION_FORMS;
- field public static final int ALPHABETIC_PRESENTATION_FORMS_ID = 80; // 0x50
- field public static final android.icu.lang.UCharacter.UnicodeBlock ANATOLIAN_HIEROGLYPHS;
- field public static final int ANATOLIAN_HIEROGLYPHS_ID = 254; // 0xfe
- field public static final android.icu.lang.UCharacter.UnicodeBlock ANCIENT_GREEK_MUSICAL_NOTATION;
- field public static final int ANCIENT_GREEK_MUSICAL_NOTATION_ID = 126; // 0x7e
- field public static final android.icu.lang.UCharacter.UnicodeBlock ANCIENT_GREEK_NUMBERS;
- field public static final int ANCIENT_GREEK_NUMBERS_ID = 127; // 0x7f
- field public static final android.icu.lang.UCharacter.UnicodeBlock ANCIENT_SYMBOLS;
- field public static final int ANCIENT_SYMBOLS_ID = 165; // 0xa5
- field public static final android.icu.lang.UCharacter.UnicodeBlock ARABIC;
- field public static final android.icu.lang.UCharacter.UnicodeBlock ARABIC_EXTENDED_A;
- field public static final int ARABIC_EXTENDED_A_ID = 210; // 0xd2
- field public static final int ARABIC_ID = 12; // 0xc
- field public static final android.icu.lang.UCharacter.UnicodeBlock ARABIC_MATHEMATICAL_ALPHABETIC_SYMBOLS;
- field public static final int ARABIC_MATHEMATICAL_ALPHABETIC_SYMBOLS_ID = 211; // 0xd3
- field public static final android.icu.lang.UCharacter.UnicodeBlock ARABIC_PRESENTATION_FORMS_A;
- field public static final int ARABIC_PRESENTATION_FORMS_A_ID = 81; // 0x51
- field public static final android.icu.lang.UCharacter.UnicodeBlock ARABIC_PRESENTATION_FORMS_B;
- field public static final int ARABIC_PRESENTATION_FORMS_B_ID = 85; // 0x55
- field public static final android.icu.lang.UCharacter.UnicodeBlock ARABIC_SUPPLEMENT;
- field public static final int ARABIC_SUPPLEMENT_ID = 128; // 0x80
- field public static final android.icu.lang.UCharacter.UnicodeBlock ARMENIAN;
- field public static final int ARMENIAN_ID = 10; // 0xa
- field public static final android.icu.lang.UCharacter.UnicodeBlock ARROWS;
- field public static final int ARROWS_ID = 46; // 0x2e
- field public static final android.icu.lang.UCharacter.UnicodeBlock AVESTAN;
- field public static final int AVESTAN_ID = 188; // 0xbc
- field public static final android.icu.lang.UCharacter.UnicodeBlock BALINESE;
- field public static final int BALINESE_ID = 147; // 0x93
- field public static final android.icu.lang.UCharacter.UnicodeBlock BAMUM;
- field public static final int BAMUM_ID = 177; // 0xb1
- field public static final android.icu.lang.UCharacter.UnicodeBlock BAMUM_SUPPLEMENT;
- field public static final int BAMUM_SUPPLEMENT_ID = 202; // 0xca
- field public static final android.icu.lang.UCharacter.UnicodeBlock BASIC_LATIN;
- field public static final int BASIC_LATIN_ID = 1; // 0x1
- field public static final android.icu.lang.UCharacter.UnicodeBlock BASSA_VAH;
- field public static final int BASSA_VAH_ID = 221; // 0xdd
- field public static final android.icu.lang.UCharacter.UnicodeBlock BATAK;
- field public static final int BATAK_ID = 199; // 0xc7
- field public static final android.icu.lang.UCharacter.UnicodeBlock BENGALI;
- field public static final int BENGALI_ID = 16; // 0x10
- field public static final android.icu.lang.UCharacter.UnicodeBlock BHAIKSUKI;
- field public static final int BHAIKSUKI_ID = 264; // 0x108
- field public static final android.icu.lang.UCharacter.UnicodeBlock BLOCK_ELEMENTS;
- field public static final int BLOCK_ELEMENTS_ID = 53; // 0x35
- field public static final android.icu.lang.UCharacter.UnicodeBlock BOPOMOFO;
- field public static final android.icu.lang.UCharacter.UnicodeBlock BOPOMOFO_EXTENDED;
- field public static final int BOPOMOFO_EXTENDED_ID = 67; // 0x43
- field public static final int BOPOMOFO_ID = 64; // 0x40
- field public static final android.icu.lang.UCharacter.UnicodeBlock BOX_DRAWING;
- field public static final int BOX_DRAWING_ID = 52; // 0x34
- field public static final android.icu.lang.UCharacter.UnicodeBlock BRAHMI;
- field public static final int BRAHMI_ID = 201; // 0xc9
- field public static final android.icu.lang.UCharacter.UnicodeBlock BRAILLE_PATTERNS;
- field public static final int BRAILLE_PATTERNS_ID = 57; // 0x39
- field public static final android.icu.lang.UCharacter.UnicodeBlock BUGINESE;
- field public static final int BUGINESE_ID = 129; // 0x81
- field public static final android.icu.lang.UCharacter.UnicodeBlock BUHID;
- field public static final int BUHID_ID = 100; // 0x64
- field public static final android.icu.lang.UCharacter.UnicodeBlock BYZANTINE_MUSICAL_SYMBOLS;
- field public static final int BYZANTINE_MUSICAL_SYMBOLS_ID = 91; // 0x5b
- field public static final android.icu.lang.UCharacter.UnicodeBlock CARIAN;
- field public static final int CARIAN_ID = 168; // 0xa8
- field public static final android.icu.lang.UCharacter.UnicodeBlock CAUCASIAN_ALBANIAN;
- field public static final int CAUCASIAN_ALBANIAN_ID = 222; // 0xde
- field public static final android.icu.lang.UCharacter.UnicodeBlock CHAKMA;
- field public static final int CHAKMA_ID = 212; // 0xd4
- field public static final android.icu.lang.UCharacter.UnicodeBlock CHAM;
- field public static final int CHAM_ID = 164; // 0xa4
- field public static final android.icu.lang.UCharacter.UnicodeBlock CHEROKEE;
- field public static final int CHEROKEE_ID = 32; // 0x20
- field public static final android.icu.lang.UCharacter.UnicodeBlock CHEROKEE_SUPPLEMENT;
- field public static final int CHEROKEE_SUPPLEMENT_ID = 255; // 0xff
- field public static final android.icu.lang.UCharacter.UnicodeBlock CHESS_SYMBOLS;
- field public static final int CHESS_SYMBOLS_ID = 281; // 0x119
- field public static final android.icu.lang.UCharacter.UnicodeBlock CHORASMIAN;
- field public static final int CHORASMIAN_ID = 301; // 0x12d
- field public static final android.icu.lang.UCharacter.UnicodeBlock CJK_COMPATIBILITY;
- field public static final android.icu.lang.UCharacter.UnicodeBlock CJK_COMPATIBILITY_FORMS;
- field public static final int CJK_COMPATIBILITY_FORMS_ID = 83; // 0x53
- field public static final int CJK_COMPATIBILITY_ID = 69; // 0x45
- field public static final android.icu.lang.UCharacter.UnicodeBlock CJK_COMPATIBILITY_IDEOGRAPHS;
- field public static final int CJK_COMPATIBILITY_IDEOGRAPHS_ID = 79; // 0x4f
- field public static final android.icu.lang.UCharacter.UnicodeBlock CJK_COMPATIBILITY_IDEOGRAPHS_SUPPLEMENT;
- field public static final int CJK_COMPATIBILITY_IDEOGRAPHS_SUPPLEMENT_ID = 95; // 0x5f
- field public static final android.icu.lang.UCharacter.UnicodeBlock CJK_RADICALS_SUPPLEMENT;
- field public static final int CJK_RADICALS_SUPPLEMENT_ID = 58; // 0x3a
- field public static final android.icu.lang.UCharacter.UnicodeBlock CJK_STROKES;
- field public static final int CJK_STROKES_ID = 130; // 0x82
- field public static final android.icu.lang.UCharacter.UnicodeBlock CJK_SYMBOLS_AND_PUNCTUATION;
- field public static final int CJK_SYMBOLS_AND_PUNCTUATION_ID = 61; // 0x3d
- field public static final android.icu.lang.UCharacter.UnicodeBlock CJK_UNIFIED_IDEOGRAPHS;
- field public static final android.icu.lang.UCharacter.UnicodeBlock CJK_UNIFIED_IDEOGRAPHS_EXTENSION_A;
- field public static final int CJK_UNIFIED_IDEOGRAPHS_EXTENSION_A_ID = 70; // 0x46
- field public static final android.icu.lang.UCharacter.UnicodeBlock CJK_UNIFIED_IDEOGRAPHS_EXTENSION_B;
- field public static final int CJK_UNIFIED_IDEOGRAPHS_EXTENSION_B_ID = 94; // 0x5e
- field public static final android.icu.lang.UCharacter.UnicodeBlock CJK_UNIFIED_IDEOGRAPHS_EXTENSION_C;
- field public static final int CJK_UNIFIED_IDEOGRAPHS_EXTENSION_C_ID = 197; // 0xc5
- field public static final android.icu.lang.UCharacter.UnicodeBlock CJK_UNIFIED_IDEOGRAPHS_EXTENSION_D;
- field public static final int CJK_UNIFIED_IDEOGRAPHS_EXTENSION_D_ID = 209; // 0xd1
- field public static final android.icu.lang.UCharacter.UnicodeBlock CJK_UNIFIED_IDEOGRAPHS_EXTENSION_E;
- field public static final int CJK_UNIFIED_IDEOGRAPHS_EXTENSION_E_ID = 256; // 0x100
- field public static final android.icu.lang.UCharacter.UnicodeBlock CJK_UNIFIED_IDEOGRAPHS_EXTENSION_F;
- field public static final int CJK_UNIFIED_IDEOGRAPHS_EXTENSION_F_ID = 274; // 0x112
- field public static final android.icu.lang.UCharacter.UnicodeBlock CJK_UNIFIED_IDEOGRAPHS_EXTENSION_G;
- field public static final int CJK_UNIFIED_IDEOGRAPHS_EXTENSION_G_ID = 302; // 0x12e
- field public static final int CJK_UNIFIED_IDEOGRAPHS_ID = 71; // 0x47
- field public static final android.icu.lang.UCharacter.UnicodeBlock COMBINING_DIACRITICAL_MARKS;
- field public static final android.icu.lang.UCharacter.UnicodeBlock COMBINING_DIACRITICAL_MARKS_EXTENDED;
- field public static final int COMBINING_DIACRITICAL_MARKS_EXTENDED_ID = 224; // 0xe0
- field public static final int COMBINING_DIACRITICAL_MARKS_ID = 7; // 0x7
- field public static final android.icu.lang.UCharacter.UnicodeBlock COMBINING_DIACRITICAL_MARKS_SUPPLEMENT;
- field public static final int COMBINING_DIACRITICAL_MARKS_SUPPLEMENT_ID = 131; // 0x83
- field public static final android.icu.lang.UCharacter.UnicodeBlock COMBINING_HALF_MARKS;
- field public static final int COMBINING_HALF_MARKS_ID = 82; // 0x52
- field public static final android.icu.lang.UCharacter.UnicodeBlock COMBINING_MARKS_FOR_SYMBOLS;
- field public static final int COMBINING_MARKS_FOR_SYMBOLS_ID = 43; // 0x2b
- field public static final android.icu.lang.UCharacter.UnicodeBlock COMMON_INDIC_NUMBER_FORMS;
- field public static final int COMMON_INDIC_NUMBER_FORMS_ID = 178; // 0xb2
- field public static final android.icu.lang.UCharacter.UnicodeBlock CONTROL_PICTURES;
- field public static final int CONTROL_PICTURES_ID = 49; // 0x31
- field public static final android.icu.lang.UCharacter.UnicodeBlock COPTIC;
- field public static final android.icu.lang.UCharacter.UnicodeBlock COPTIC_EPACT_NUMBERS;
- field public static final int COPTIC_EPACT_NUMBERS_ID = 223; // 0xdf
- field public static final int COPTIC_ID = 132; // 0x84
- field public static final android.icu.lang.UCharacter.UnicodeBlock COUNTING_ROD_NUMERALS;
- field public static final int COUNTING_ROD_NUMERALS_ID = 154; // 0x9a
- field public static final android.icu.lang.UCharacter.UnicodeBlock CUNEIFORM;
- field public static final int CUNEIFORM_ID = 152; // 0x98
- field public static final android.icu.lang.UCharacter.UnicodeBlock CUNEIFORM_NUMBERS_AND_PUNCTUATION;
- field public static final int CUNEIFORM_NUMBERS_AND_PUNCTUATION_ID = 153; // 0x99
- field public static final android.icu.lang.UCharacter.UnicodeBlock CURRENCY_SYMBOLS;
- field public static final int CURRENCY_SYMBOLS_ID = 42; // 0x2a
- field public static final android.icu.lang.UCharacter.UnicodeBlock CYPRIOT_SYLLABARY;
- field public static final int CYPRIOT_SYLLABARY_ID = 123; // 0x7b
- field public static final android.icu.lang.UCharacter.UnicodeBlock CYRILLIC;
- field public static final android.icu.lang.UCharacter.UnicodeBlock CYRILLIC_EXTENDED_A;
- field public static final int CYRILLIC_EXTENDED_A_ID = 158; // 0x9e
- field public static final android.icu.lang.UCharacter.UnicodeBlock CYRILLIC_EXTENDED_B;
- field public static final int CYRILLIC_EXTENDED_B_ID = 160; // 0xa0
- field public static final android.icu.lang.UCharacter.UnicodeBlock CYRILLIC_EXTENDED_C;
- field public static final int CYRILLIC_EXTENDED_C_ID = 265; // 0x109
- field public static final int CYRILLIC_ID = 9; // 0x9
- field public static final android.icu.lang.UCharacter.UnicodeBlock CYRILLIC_SUPPLEMENT;
- field public static final android.icu.lang.UCharacter.UnicodeBlock CYRILLIC_SUPPLEMENTARY;
- field public static final int CYRILLIC_SUPPLEMENTARY_ID = 97; // 0x61
- field public static final int CYRILLIC_SUPPLEMENT_ID = 97; // 0x61
- field public static final android.icu.lang.UCharacter.UnicodeBlock DESERET;
- field public static final int DESERET_ID = 90; // 0x5a
- field public static final android.icu.lang.UCharacter.UnicodeBlock DEVANAGARI;
- field public static final android.icu.lang.UCharacter.UnicodeBlock DEVANAGARI_EXTENDED;
- field public static final int DEVANAGARI_EXTENDED_ID = 179; // 0xb3
- field public static final int DEVANAGARI_ID = 15; // 0xf
- field public static final android.icu.lang.UCharacter.UnicodeBlock DINGBATS;
- field public static final int DINGBATS_ID = 56; // 0x38
- field public static final android.icu.lang.UCharacter.UnicodeBlock DIVES_AKURU;
- field public static final int DIVES_AKURU_ID = 303; // 0x12f
- field public static final android.icu.lang.UCharacter.UnicodeBlock DOGRA;
- field public static final int DOGRA_ID = 282; // 0x11a
- field public static final android.icu.lang.UCharacter.UnicodeBlock DOMINO_TILES;
- field public static final int DOMINO_TILES_ID = 171; // 0xab
- field public static final android.icu.lang.UCharacter.UnicodeBlock DUPLOYAN;
- field public static final int DUPLOYAN_ID = 225; // 0xe1
- field public static final android.icu.lang.UCharacter.UnicodeBlock EARLY_DYNASTIC_CUNEIFORM;
- field public static final int EARLY_DYNASTIC_CUNEIFORM_ID = 257; // 0x101
- field public static final android.icu.lang.UCharacter.UnicodeBlock EGYPTIAN_HIEROGLYPHS;
- field public static final int EGYPTIAN_HIEROGLYPHS_ID = 194; // 0xc2
- field public static final android.icu.lang.UCharacter.UnicodeBlock EGYPTIAN_HIEROGLYPH_FORMAT_CONTROLS;
- field public static final int EGYPTIAN_HIEROGLYPH_FORMAT_CONTROLS_ID = 292; // 0x124
- field public static final android.icu.lang.UCharacter.UnicodeBlock ELBASAN;
- field public static final int ELBASAN_ID = 226; // 0xe2
- field public static final android.icu.lang.UCharacter.UnicodeBlock ELYMAIC;
- field public static final int ELYMAIC_ID = 293; // 0x125
- field public static final android.icu.lang.UCharacter.UnicodeBlock EMOTICONS;
- field public static final int EMOTICONS_ID = 206; // 0xce
- field public static final android.icu.lang.UCharacter.UnicodeBlock ENCLOSED_ALPHANUMERICS;
- field public static final int ENCLOSED_ALPHANUMERICS_ID = 51; // 0x33
- field public static final android.icu.lang.UCharacter.UnicodeBlock ENCLOSED_ALPHANUMERIC_SUPPLEMENT;
- field public static final int ENCLOSED_ALPHANUMERIC_SUPPLEMENT_ID = 195; // 0xc3
- field public static final android.icu.lang.UCharacter.UnicodeBlock ENCLOSED_CJK_LETTERS_AND_MONTHS;
- field public static final int ENCLOSED_CJK_LETTERS_AND_MONTHS_ID = 68; // 0x44
- field public static final android.icu.lang.UCharacter.UnicodeBlock ENCLOSED_IDEOGRAPHIC_SUPPLEMENT;
- field public static final int ENCLOSED_IDEOGRAPHIC_SUPPLEMENT_ID = 196; // 0xc4
- field public static final android.icu.lang.UCharacter.UnicodeBlock ETHIOPIC;
- field public static final android.icu.lang.UCharacter.UnicodeBlock ETHIOPIC_EXTENDED;
- field public static final android.icu.lang.UCharacter.UnicodeBlock ETHIOPIC_EXTENDED_A;
- field public static final int ETHIOPIC_EXTENDED_A_ID = 200; // 0xc8
- field public static final int ETHIOPIC_EXTENDED_ID = 133; // 0x85
- field public static final int ETHIOPIC_ID = 31; // 0x1f
- field public static final android.icu.lang.UCharacter.UnicodeBlock ETHIOPIC_SUPPLEMENT;
- field public static final int ETHIOPIC_SUPPLEMENT_ID = 134; // 0x86
- field public static final android.icu.lang.UCharacter.UnicodeBlock GENERAL_PUNCTUATION;
- field public static final int GENERAL_PUNCTUATION_ID = 40; // 0x28
- field public static final android.icu.lang.UCharacter.UnicodeBlock GEOMETRIC_SHAPES;
- field public static final android.icu.lang.UCharacter.UnicodeBlock GEOMETRIC_SHAPES_EXTENDED;
- field public static final int GEOMETRIC_SHAPES_EXTENDED_ID = 227; // 0xe3
- field public static final int GEOMETRIC_SHAPES_ID = 54; // 0x36
- field public static final android.icu.lang.UCharacter.UnicodeBlock GEORGIAN;
- field public static final android.icu.lang.UCharacter.UnicodeBlock GEORGIAN_EXTENDED;
- field public static final int GEORGIAN_EXTENDED_ID = 283; // 0x11b
- field public static final int GEORGIAN_ID = 29; // 0x1d
- field public static final android.icu.lang.UCharacter.UnicodeBlock GEORGIAN_SUPPLEMENT;
- field public static final int GEORGIAN_SUPPLEMENT_ID = 135; // 0x87
- field public static final android.icu.lang.UCharacter.UnicodeBlock GLAGOLITIC;
- field public static final int GLAGOLITIC_ID = 136; // 0x88
- field public static final android.icu.lang.UCharacter.UnicodeBlock GLAGOLITIC_SUPPLEMENT;
- field public static final int GLAGOLITIC_SUPPLEMENT_ID = 266; // 0x10a
- field public static final android.icu.lang.UCharacter.UnicodeBlock GOTHIC;
- field public static final int GOTHIC_ID = 89; // 0x59
- field public static final android.icu.lang.UCharacter.UnicodeBlock GRANTHA;
- field public static final int GRANTHA_ID = 228; // 0xe4
- field public static final android.icu.lang.UCharacter.UnicodeBlock GREEK;
- field public static final android.icu.lang.UCharacter.UnicodeBlock GREEK_EXTENDED;
- field public static final int GREEK_EXTENDED_ID = 39; // 0x27
- field public static final int GREEK_ID = 8; // 0x8
- field public static final android.icu.lang.UCharacter.UnicodeBlock GUJARATI;
- field public static final int GUJARATI_ID = 18; // 0x12
- field public static final android.icu.lang.UCharacter.UnicodeBlock GUNJALA_GONDI;
- field public static final int GUNJALA_GONDI_ID = 284; // 0x11c
- field public static final android.icu.lang.UCharacter.UnicodeBlock GURMUKHI;
- field public static final int GURMUKHI_ID = 17; // 0x11
- field public static final android.icu.lang.UCharacter.UnicodeBlock HALFWIDTH_AND_FULLWIDTH_FORMS;
- field public static final int HALFWIDTH_AND_FULLWIDTH_FORMS_ID = 87; // 0x57
- field public static final android.icu.lang.UCharacter.UnicodeBlock HANGUL_COMPATIBILITY_JAMO;
- field public static final int HANGUL_COMPATIBILITY_JAMO_ID = 65; // 0x41
- field public static final android.icu.lang.UCharacter.UnicodeBlock HANGUL_JAMO;
- field public static final android.icu.lang.UCharacter.UnicodeBlock HANGUL_JAMO_EXTENDED_A;
- field public static final int HANGUL_JAMO_EXTENDED_A_ID = 180; // 0xb4
- field public static final android.icu.lang.UCharacter.UnicodeBlock HANGUL_JAMO_EXTENDED_B;
- field public static final int HANGUL_JAMO_EXTENDED_B_ID = 185; // 0xb9
- field public static final int HANGUL_JAMO_ID = 30; // 0x1e
- field public static final android.icu.lang.UCharacter.UnicodeBlock HANGUL_SYLLABLES;
- field public static final int HANGUL_SYLLABLES_ID = 74; // 0x4a
- field public static final android.icu.lang.UCharacter.UnicodeBlock HANIFI_ROHINGYA;
- field public static final int HANIFI_ROHINGYA_ID = 285; // 0x11d
- field public static final android.icu.lang.UCharacter.UnicodeBlock HANUNOO;
- field public static final int HANUNOO_ID = 99; // 0x63
- field public static final android.icu.lang.UCharacter.UnicodeBlock HATRAN;
- field public static final int HATRAN_ID = 258; // 0x102
- field public static final android.icu.lang.UCharacter.UnicodeBlock HEBREW;
- field public static final int HEBREW_ID = 11; // 0xb
- field public static final android.icu.lang.UCharacter.UnicodeBlock HIGH_PRIVATE_USE_SURROGATES;
- field public static final int HIGH_PRIVATE_USE_SURROGATES_ID = 76; // 0x4c
- field public static final android.icu.lang.UCharacter.UnicodeBlock HIGH_SURROGATES;
- field public static final int HIGH_SURROGATES_ID = 75; // 0x4b
- field public static final android.icu.lang.UCharacter.UnicodeBlock HIRAGANA;
- field public static final int HIRAGANA_ID = 62; // 0x3e
- field public static final android.icu.lang.UCharacter.UnicodeBlock IDEOGRAPHIC_DESCRIPTION_CHARACTERS;
- field public static final int IDEOGRAPHIC_DESCRIPTION_CHARACTERS_ID = 60; // 0x3c
- field public static final android.icu.lang.UCharacter.UnicodeBlock IDEOGRAPHIC_SYMBOLS_AND_PUNCTUATION;
- field public static final int IDEOGRAPHIC_SYMBOLS_AND_PUNCTUATION_ID = 267; // 0x10b
- field public static final android.icu.lang.UCharacter.UnicodeBlock IMPERIAL_ARAMAIC;
- field public static final int IMPERIAL_ARAMAIC_ID = 186; // 0xba
- field public static final android.icu.lang.UCharacter.UnicodeBlock INDIC_SIYAQ_NUMBERS;
- field public static final int INDIC_SIYAQ_NUMBERS_ID = 286; // 0x11e
- field public static final android.icu.lang.UCharacter.UnicodeBlock INSCRIPTIONAL_PAHLAVI;
- field public static final int INSCRIPTIONAL_PAHLAVI_ID = 190; // 0xbe
- field public static final android.icu.lang.UCharacter.UnicodeBlock INSCRIPTIONAL_PARTHIAN;
- field public static final int INSCRIPTIONAL_PARTHIAN_ID = 189; // 0xbd
- field public static final android.icu.lang.UCharacter.UnicodeBlock INVALID_CODE;
- field public static final int INVALID_CODE_ID = -1; // 0xffffffff
- field public static final android.icu.lang.UCharacter.UnicodeBlock IPA_EXTENSIONS;
- field public static final int IPA_EXTENSIONS_ID = 5; // 0x5
- field public static final android.icu.lang.UCharacter.UnicodeBlock JAVANESE;
- field public static final int JAVANESE_ID = 181; // 0xb5
- field public static final android.icu.lang.UCharacter.UnicodeBlock KAITHI;
- field public static final int KAITHI_ID = 193; // 0xc1
- field public static final android.icu.lang.UCharacter.UnicodeBlock KANA_EXTENDED_A;
- field public static final int KANA_EXTENDED_A_ID = 275; // 0x113
- field public static final android.icu.lang.UCharacter.UnicodeBlock KANA_SUPPLEMENT;
- field public static final int KANA_SUPPLEMENT_ID = 203; // 0xcb
- field public static final android.icu.lang.UCharacter.UnicodeBlock KANBUN;
- field public static final int KANBUN_ID = 66; // 0x42
- field public static final android.icu.lang.UCharacter.UnicodeBlock KANGXI_RADICALS;
- field public static final int KANGXI_RADICALS_ID = 59; // 0x3b
- field public static final android.icu.lang.UCharacter.UnicodeBlock KANNADA;
- field public static final int KANNADA_ID = 22; // 0x16
- field public static final android.icu.lang.UCharacter.UnicodeBlock KATAKANA;
- field public static final int KATAKANA_ID = 63; // 0x3f
- field public static final android.icu.lang.UCharacter.UnicodeBlock KATAKANA_PHONETIC_EXTENSIONS;
- field public static final int KATAKANA_PHONETIC_EXTENSIONS_ID = 107; // 0x6b
- field public static final android.icu.lang.UCharacter.UnicodeBlock KAYAH_LI;
- field public static final int KAYAH_LI_ID = 162; // 0xa2
- field public static final android.icu.lang.UCharacter.UnicodeBlock KHAROSHTHI;
- field public static final int KHAROSHTHI_ID = 137; // 0x89
- field public static final android.icu.lang.UCharacter.UnicodeBlock KHITAN_SMALL_SCRIPT;
- field public static final int KHITAN_SMALL_SCRIPT_ID = 304; // 0x130
- field public static final android.icu.lang.UCharacter.UnicodeBlock KHMER;
- field public static final int KHMER_ID = 36; // 0x24
- field public static final android.icu.lang.UCharacter.UnicodeBlock KHMER_SYMBOLS;
- field public static final int KHMER_SYMBOLS_ID = 113; // 0x71
- field public static final android.icu.lang.UCharacter.UnicodeBlock KHOJKI;
- field public static final int KHOJKI_ID = 229; // 0xe5
- field public static final android.icu.lang.UCharacter.UnicodeBlock KHUDAWADI;
- field public static final int KHUDAWADI_ID = 230; // 0xe6
- field public static final android.icu.lang.UCharacter.UnicodeBlock LAO;
- field public static final int LAO_ID = 26; // 0x1a
- field public static final android.icu.lang.UCharacter.UnicodeBlock LATIN_1_SUPPLEMENT;
- field public static final int LATIN_1_SUPPLEMENT_ID = 2; // 0x2
- field public static final android.icu.lang.UCharacter.UnicodeBlock LATIN_EXTENDED_A;
- field public static final android.icu.lang.UCharacter.UnicodeBlock LATIN_EXTENDED_ADDITIONAL;
- field public static final int LATIN_EXTENDED_ADDITIONAL_ID = 38; // 0x26
- field public static final int LATIN_EXTENDED_A_ID = 3; // 0x3
- field public static final android.icu.lang.UCharacter.UnicodeBlock LATIN_EXTENDED_B;
- field public static final int LATIN_EXTENDED_B_ID = 4; // 0x4
- field public static final android.icu.lang.UCharacter.UnicodeBlock LATIN_EXTENDED_C;
- field public static final int LATIN_EXTENDED_C_ID = 148; // 0x94
- field public static final android.icu.lang.UCharacter.UnicodeBlock LATIN_EXTENDED_D;
- field public static final int LATIN_EXTENDED_D_ID = 149; // 0x95
- field public static final android.icu.lang.UCharacter.UnicodeBlock LATIN_EXTENDED_E;
- field public static final int LATIN_EXTENDED_E_ID = 231; // 0xe7
- field public static final android.icu.lang.UCharacter.UnicodeBlock LEPCHA;
- field public static final int LEPCHA_ID = 156; // 0x9c
- field public static final android.icu.lang.UCharacter.UnicodeBlock LETTERLIKE_SYMBOLS;
- field public static final int LETTERLIKE_SYMBOLS_ID = 44; // 0x2c
- field public static final android.icu.lang.UCharacter.UnicodeBlock LIMBU;
- field public static final int LIMBU_ID = 111; // 0x6f
- field public static final android.icu.lang.UCharacter.UnicodeBlock LINEAR_A;
- field public static final int LINEAR_A_ID = 232; // 0xe8
- field public static final android.icu.lang.UCharacter.UnicodeBlock LINEAR_B_IDEOGRAMS;
- field public static final int LINEAR_B_IDEOGRAMS_ID = 118; // 0x76
- field public static final android.icu.lang.UCharacter.UnicodeBlock LINEAR_B_SYLLABARY;
- field public static final int LINEAR_B_SYLLABARY_ID = 117; // 0x75
- field public static final android.icu.lang.UCharacter.UnicodeBlock LISU;
- field public static final int LISU_ID = 176; // 0xb0
- field public static final android.icu.lang.UCharacter.UnicodeBlock LISU_SUPPLEMENT;
- field public static final int LISU_SUPPLEMENT_ID = 305; // 0x131
- field public static final android.icu.lang.UCharacter.UnicodeBlock LOW_SURROGATES;
- field public static final int LOW_SURROGATES_ID = 77; // 0x4d
- field public static final android.icu.lang.UCharacter.UnicodeBlock LYCIAN;
- field public static final int LYCIAN_ID = 167; // 0xa7
- field public static final android.icu.lang.UCharacter.UnicodeBlock LYDIAN;
- field public static final int LYDIAN_ID = 169; // 0xa9
- field public static final android.icu.lang.UCharacter.UnicodeBlock MAHAJANI;
- field public static final int MAHAJANI_ID = 233; // 0xe9
- field public static final android.icu.lang.UCharacter.UnicodeBlock MAHJONG_TILES;
- field public static final int MAHJONG_TILES_ID = 170; // 0xaa
- field public static final android.icu.lang.UCharacter.UnicodeBlock MAKASAR;
- field public static final int MAKASAR_ID = 287; // 0x11f
- field public static final android.icu.lang.UCharacter.UnicodeBlock MALAYALAM;
- field public static final int MALAYALAM_ID = 23; // 0x17
- field public static final android.icu.lang.UCharacter.UnicodeBlock MANDAIC;
- field public static final int MANDAIC_ID = 198; // 0xc6
- field public static final android.icu.lang.UCharacter.UnicodeBlock MANICHAEAN;
- field public static final int MANICHAEAN_ID = 234; // 0xea
- field public static final android.icu.lang.UCharacter.UnicodeBlock MARCHEN;
- field public static final int MARCHEN_ID = 268; // 0x10c
- field public static final android.icu.lang.UCharacter.UnicodeBlock MASARAM_GONDI;
- field public static final int MASARAM_GONDI_ID = 276; // 0x114
- field public static final android.icu.lang.UCharacter.UnicodeBlock MATHEMATICAL_ALPHANUMERIC_SYMBOLS;
- field public static final int MATHEMATICAL_ALPHANUMERIC_SYMBOLS_ID = 93; // 0x5d
- field public static final android.icu.lang.UCharacter.UnicodeBlock MATHEMATICAL_OPERATORS;
- field public static final int MATHEMATICAL_OPERATORS_ID = 47; // 0x2f
- field public static final android.icu.lang.UCharacter.UnicodeBlock MAYAN_NUMERALS;
- field public static final int MAYAN_NUMERALS_ID = 288; // 0x120
- field public static final android.icu.lang.UCharacter.UnicodeBlock MEDEFAIDRIN;
- field public static final int MEDEFAIDRIN_ID = 289; // 0x121
- field public static final android.icu.lang.UCharacter.UnicodeBlock MEETEI_MAYEK;
- field public static final android.icu.lang.UCharacter.UnicodeBlock MEETEI_MAYEK_EXTENSIONS;
- field public static final int MEETEI_MAYEK_EXTENSIONS_ID = 213; // 0xd5
- field public static final int MEETEI_MAYEK_ID = 184; // 0xb8
- field public static final android.icu.lang.UCharacter.UnicodeBlock MENDE_KIKAKUI;
- field public static final int MENDE_KIKAKUI_ID = 235; // 0xeb
- field public static final android.icu.lang.UCharacter.UnicodeBlock MEROITIC_CURSIVE;
- field public static final int MEROITIC_CURSIVE_ID = 214; // 0xd6
- field public static final android.icu.lang.UCharacter.UnicodeBlock MEROITIC_HIEROGLYPHS;
- field public static final int MEROITIC_HIEROGLYPHS_ID = 215; // 0xd7
- field public static final android.icu.lang.UCharacter.UnicodeBlock MIAO;
- field public static final int MIAO_ID = 216; // 0xd8
- field public static final android.icu.lang.UCharacter.UnicodeBlock MISCELLANEOUS_MATHEMATICAL_SYMBOLS_A;
- field public static final int MISCELLANEOUS_MATHEMATICAL_SYMBOLS_A_ID = 102; // 0x66
- field public static final android.icu.lang.UCharacter.UnicodeBlock MISCELLANEOUS_MATHEMATICAL_SYMBOLS_B;
- field public static final int MISCELLANEOUS_MATHEMATICAL_SYMBOLS_B_ID = 105; // 0x69
- field public static final android.icu.lang.UCharacter.UnicodeBlock MISCELLANEOUS_SYMBOLS;
- field public static final android.icu.lang.UCharacter.UnicodeBlock MISCELLANEOUS_SYMBOLS_AND_ARROWS;
- field public static final int MISCELLANEOUS_SYMBOLS_AND_ARROWS_ID = 115; // 0x73
- field public static final android.icu.lang.UCharacter.UnicodeBlock MISCELLANEOUS_SYMBOLS_AND_PICTOGRAPHS;
- field public static final int MISCELLANEOUS_SYMBOLS_AND_PICTOGRAPHS_ID = 205; // 0xcd
- field public static final int MISCELLANEOUS_SYMBOLS_ID = 55; // 0x37
- field public static final android.icu.lang.UCharacter.UnicodeBlock MISCELLANEOUS_TECHNICAL;
- field public static final int MISCELLANEOUS_TECHNICAL_ID = 48; // 0x30
- field public static final android.icu.lang.UCharacter.UnicodeBlock MODI;
- field public static final android.icu.lang.UCharacter.UnicodeBlock MODIFIER_TONE_LETTERS;
- field public static final int MODIFIER_TONE_LETTERS_ID = 138; // 0x8a
- field public static final int MODI_ID = 236; // 0xec
- field public static final android.icu.lang.UCharacter.UnicodeBlock MONGOLIAN;
- field public static final int MONGOLIAN_ID = 37; // 0x25
- field public static final android.icu.lang.UCharacter.UnicodeBlock MONGOLIAN_SUPPLEMENT;
- field public static final int MONGOLIAN_SUPPLEMENT_ID = 269; // 0x10d
- field public static final android.icu.lang.UCharacter.UnicodeBlock MRO;
- field public static final int MRO_ID = 237; // 0xed
- field public static final android.icu.lang.UCharacter.UnicodeBlock MULTANI;
- field public static final int MULTANI_ID = 259; // 0x103
- field public static final android.icu.lang.UCharacter.UnicodeBlock MUSICAL_SYMBOLS;
- field public static final int MUSICAL_SYMBOLS_ID = 92; // 0x5c
- field public static final android.icu.lang.UCharacter.UnicodeBlock MYANMAR;
- field public static final android.icu.lang.UCharacter.UnicodeBlock MYANMAR_EXTENDED_A;
- field public static final int MYANMAR_EXTENDED_A_ID = 182; // 0xb6
- field public static final android.icu.lang.UCharacter.UnicodeBlock MYANMAR_EXTENDED_B;
- field public static final int MYANMAR_EXTENDED_B_ID = 238; // 0xee
- field public static final int MYANMAR_ID = 28; // 0x1c
- field public static final android.icu.lang.UCharacter.UnicodeBlock NABATAEAN;
- field public static final int NABATAEAN_ID = 239; // 0xef
- field public static final android.icu.lang.UCharacter.UnicodeBlock NANDINAGARI;
- field public static final int NANDINAGARI_ID = 294; // 0x126
- field public static final android.icu.lang.UCharacter.UnicodeBlock NEWA;
- field public static final int NEWA_ID = 270; // 0x10e
- field public static final android.icu.lang.UCharacter.UnicodeBlock NEW_TAI_LUE;
- field public static final int NEW_TAI_LUE_ID = 139; // 0x8b
- field public static final android.icu.lang.UCharacter.UnicodeBlock NKO;
- field public static final int NKO_ID = 146; // 0x92
- field public static final android.icu.lang.UCharacter.UnicodeBlock NO_BLOCK;
- field public static final android.icu.lang.UCharacter.UnicodeBlock NUMBER_FORMS;
- field public static final int NUMBER_FORMS_ID = 45; // 0x2d
- field public static final android.icu.lang.UCharacter.UnicodeBlock NUSHU;
- field public static final int NUSHU_ID = 277; // 0x115
- field public static final android.icu.lang.UCharacter.UnicodeBlock NYIAKENG_PUACHUE_HMONG;
- field public static final int NYIAKENG_PUACHUE_HMONG_ID = 295; // 0x127
- field public static final android.icu.lang.UCharacter.UnicodeBlock OGHAM;
- field public static final int OGHAM_ID = 34; // 0x22
- field public static final android.icu.lang.UCharacter.UnicodeBlock OLD_HUNGARIAN;
- field public static final int OLD_HUNGARIAN_ID = 260; // 0x104
- field public static final android.icu.lang.UCharacter.UnicodeBlock OLD_ITALIC;
- field public static final int OLD_ITALIC_ID = 88; // 0x58
- field public static final android.icu.lang.UCharacter.UnicodeBlock OLD_NORTH_ARABIAN;
- field public static final int OLD_NORTH_ARABIAN_ID = 240; // 0xf0
- field public static final android.icu.lang.UCharacter.UnicodeBlock OLD_PERMIC;
- field public static final int OLD_PERMIC_ID = 241; // 0xf1
- field public static final android.icu.lang.UCharacter.UnicodeBlock OLD_PERSIAN;
- field public static final int OLD_PERSIAN_ID = 140; // 0x8c
- field public static final android.icu.lang.UCharacter.UnicodeBlock OLD_SOGDIAN;
- field public static final int OLD_SOGDIAN_ID = 290; // 0x122
- field public static final android.icu.lang.UCharacter.UnicodeBlock OLD_SOUTH_ARABIAN;
- field public static final int OLD_SOUTH_ARABIAN_ID = 187; // 0xbb
- field public static final android.icu.lang.UCharacter.UnicodeBlock OLD_TURKIC;
- field public static final int OLD_TURKIC_ID = 191; // 0xbf
- field public static final android.icu.lang.UCharacter.UnicodeBlock OL_CHIKI;
- field public static final int OL_CHIKI_ID = 157; // 0x9d
- field public static final android.icu.lang.UCharacter.UnicodeBlock OPTICAL_CHARACTER_RECOGNITION;
- field public static final int OPTICAL_CHARACTER_RECOGNITION_ID = 50; // 0x32
- field public static final android.icu.lang.UCharacter.UnicodeBlock ORIYA;
- field public static final int ORIYA_ID = 19; // 0x13
- field public static final android.icu.lang.UCharacter.UnicodeBlock ORNAMENTAL_DINGBATS;
- field public static final int ORNAMENTAL_DINGBATS_ID = 242; // 0xf2
- field public static final android.icu.lang.UCharacter.UnicodeBlock OSAGE;
- field public static final int OSAGE_ID = 271; // 0x10f
- field public static final android.icu.lang.UCharacter.UnicodeBlock OSMANYA;
- field public static final int OSMANYA_ID = 122; // 0x7a
- field public static final android.icu.lang.UCharacter.UnicodeBlock OTTOMAN_SIYAQ_NUMBERS;
- field public static final int OTTOMAN_SIYAQ_NUMBERS_ID = 296; // 0x128
- field public static final android.icu.lang.UCharacter.UnicodeBlock PAHAWH_HMONG;
- field public static final int PAHAWH_HMONG_ID = 243; // 0xf3
- field public static final android.icu.lang.UCharacter.UnicodeBlock PALMYRENE;
- field public static final int PALMYRENE_ID = 244; // 0xf4
- field public static final android.icu.lang.UCharacter.UnicodeBlock PAU_CIN_HAU;
- field public static final int PAU_CIN_HAU_ID = 245; // 0xf5
- field public static final android.icu.lang.UCharacter.UnicodeBlock PHAGS_PA;
- field public static final int PHAGS_PA_ID = 150; // 0x96
- field public static final android.icu.lang.UCharacter.UnicodeBlock PHAISTOS_DISC;
- field public static final int PHAISTOS_DISC_ID = 166; // 0xa6
- field public static final android.icu.lang.UCharacter.UnicodeBlock PHOENICIAN;
- field public static final int PHOENICIAN_ID = 151; // 0x97
- field public static final android.icu.lang.UCharacter.UnicodeBlock PHONETIC_EXTENSIONS;
- field public static final int PHONETIC_EXTENSIONS_ID = 114; // 0x72
- field public static final android.icu.lang.UCharacter.UnicodeBlock PHONETIC_EXTENSIONS_SUPPLEMENT;
- field public static final int PHONETIC_EXTENSIONS_SUPPLEMENT_ID = 141; // 0x8d
- field public static final android.icu.lang.UCharacter.UnicodeBlock PLAYING_CARDS;
- field public static final int PLAYING_CARDS_ID = 204; // 0xcc
- field public static final android.icu.lang.UCharacter.UnicodeBlock PRIVATE_USE;
- field public static final android.icu.lang.UCharacter.UnicodeBlock PRIVATE_USE_AREA;
- field public static final int PRIVATE_USE_AREA_ID = 78; // 0x4e
- field public static final int PRIVATE_USE_ID = 78; // 0x4e
- field public static final android.icu.lang.UCharacter.UnicodeBlock PSALTER_PAHLAVI;
- field public static final int PSALTER_PAHLAVI_ID = 246; // 0xf6
- field public static final android.icu.lang.UCharacter.UnicodeBlock REJANG;
- field public static final int REJANG_ID = 163; // 0xa3
- field public static final android.icu.lang.UCharacter.UnicodeBlock RUMI_NUMERAL_SYMBOLS;
- field public static final int RUMI_NUMERAL_SYMBOLS_ID = 192; // 0xc0
- field public static final android.icu.lang.UCharacter.UnicodeBlock RUNIC;
- field public static final int RUNIC_ID = 35; // 0x23
- field public static final android.icu.lang.UCharacter.UnicodeBlock SAMARITAN;
- field public static final int SAMARITAN_ID = 172; // 0xac
- field public static final android.icu.lang.UCharacter.UnicodeBlock SAURASHTRA;
- field public static final int SAURASHTRA_ID = 161; // 0xa1
- field public static final android.icu.lang.UCharacter.UnicodeBlock SHARADA;
- field public static final int SHARADA_ID = 217; // 0xd9
- field public static final android.icu.lang.UCharacter.UnicodeBlock SHAVIAN;
- field public static final int SHAVIAN_ID = 121; // 0x79
- field public static final android.icu.lang.UCharacter.UnicodeBlock SHORTHAND_FORMAT_CONTROLS;
- field public static final int SHORTHAND_FORMAT_CONTROLS_ID = 247; // 0xf7
- field public static final android.icu.lang.UCharacter.UnicodeBlock SIDDHAM;
- field public static final int SIDDHAM_ID = 248; // 0xf8
- field public static final android.icu.lang.UCharacter.UnicodeBlock SINHALA;
- field public static final android.icu.lang.UCharacter.UnicodeBlock SINHALA_ARCHAIC_NUMBERS;
- field public static final int SINHALA_ARCHAIC_NUMBERS_ID = 249; // 0xf9
- field public static final int SINHALA_ID = 24; // 0x18
- field public static final android.icu.lang.UCharacter.UnicodeBlock SMALL_FORM_VARIANTS;
- field public static final int SMALL_FORM_VARIANTS_ID = 84; // 0x54
- field public static final android.icu.lang.UCharacter.UnicodeBlock SMALL_KANA_EXTENSION;
- field public static final int SMALL_KANA_EXTENSION_ID = 297; // 0x129
- field public static final android.icu.lang.UCharacter.UnicodeBlock SOGDIAN;
- field public static final int SOGDIAN_ID = 291; // 0x123
- field public static final android.icu.lang.UCharacter.UnicodeBlock SORA_SOMPENG;
- field public static final int SORA_SOMPENG_ID = 218; // 0xda
- field public static final android.icu.lang.UCharacter.UnicodeBlock SOYOMBO;
- field public static final int SOYOMBO_ID = 278; // 0x116
- field public static final android.icu.lang.UCharacter.UnicodeBlock SPACING_MODIFIER_LETTERS;
- field public static final int SPACING_MODIFIER_LETTERS_ID = 6; // 0x6
- field public static final android.icu.lang.UCharacter.UnicodeBlock SPECIALS;
- field public static final int SPECIALS_ID = 86; // 0x56
- field public static final android.icu.lang.UCharacter.UnicodeBlock SUNDANESE;
- field public static final int SUNDANESE_ID = 155; // 0x9b
- field public static final android.icu.lang.UCharacter.UnicodeBlock SUNDANESE_SUPPLEMENT;
- field public static final int SUNDANESE_SUPPLEMENT_ID = 219; // 0xdb
- field public static final android.icu.lang.UCharacter.UnicodeBlock SUPERSCRIPTS_AND_SUBSCRIPTS;
- field public static final int SUPERSCRIPTS_AND_SUBSCRIPTS_ID = 41; // 0x29
- field public static final android.icu.lang.UCharacter.UnicodeBlock SUPPLEMENTAL_ARROWS_A;
- field public static final int SUPPLEMENTAL_ARROWS_A_ID = 103; // 0x67
- field public static final android.icu.lang.UCharacter.UnicodeBlock SUPPLEMENTAL_ARROWS_B;
- field public static final int SUPPLEMENTAL_ARROWS_B_ID = 104; // 0x68
- field public static final android.icu.lang.UCharacter.UnicodeBlock SUPPLEMENTAL_ARROWS_C;
- field public static final int SUPPLEMENTAL_ARROWS_C_ID = 250; // 0xfa
- field public static final android.icu.lang.UCharacter.UnicodeBlock SUPPLEMENTAL_MATHEMATICAL_OPERATORS;
- field public static final int SUPPLEMENTAL_MATHEMATICAL_OPERATORS_ID = 106; // 0x6a
- field public static final android.icu.lang.UCharacter.UnicodeBlock SUPPLEMENTAL_PUNCTUATION;
- field public static final int SUPPLEMENTAL_PUNCTUATION_ID = 142; // 0x8e
- field public static final android.icu.lang.UCharacter.UnicodeBlock SUPPLEMENTAL_SYMBOLS_AND_PICTOGRAPHS;
- field public static final int SUPPLEMENTAL_SYMBOLS_AND_PICTOGRAPHS_ID = 261; // 0x105
- field public static final android.icu.lang.UCharacter.UnicodeBlock SUPPLEMENTARY_PRIVATE_USE_AREA_A;
- field public static final int SUPPLEMENTARY_PRIVATE_USE_AREA_A_ID = 109; // 0x6d
- field public static final android.icu.lang.UCharacter.UnicodeBlock SUPPLEMENTARY_PRIVATE_USE_AREA_B;
- field public static final int SUPPLEMENTARY_PRIVATE_USE_AREA_B_ID = 110; // 0x6e
- field public static final android.icu.lang.UCharacter.UnicodeBlock SUTTON_SIGNWRITING;
- field public static final int SUTTON_SIGNWRITING_ID = 262; // 0x106
- field public static final android.icu.lang.UCharacter.UnicodeBlock SYLOTI_NAGRI;
- field public static final int SYLOTI_NAGRI_ID = 143; // 0x8f
- field public static final android.icu.lang.UCharacter.UnicodeBlock SYMBOLS_AND_PICTOGRAPHS_EXTENDED_A;
- field public static final int SYMBOLS_AND_PICTOGRAPHS_EXTENDED_A_ID = 298; // 0x12a
- field public static final android.icu.lang.UCharacter.UnicodeBlock SYMBOLS_FOR_LEGACY_COMPUTING;
- field public static final int SYMBOLS_FOR_LEGACY_COMPUTING_ID = 306; // 0x132
- field public static final android.icu.lang.UCharacter.UnicodeBlock SYRIAC;
- field public static final int SYRIAC_ID = 13; // 0xd
- field public static final android.icu.lang.UCharacter.UnicodeBlock SYRIAC_SUPPLEMENT;
- field public static final int SYRIAC_SUPPLEMENT_ID = 279; // 0x117
- field public static final android.icu.lang.UCharacter.UnicodeBlock TAGALOG;
- field public static final int TAGALOG_ID = 98; // 0x62
- field public static final android.icu.lang.UCharacter.UnicodeBlock TAGBANWA;
- field public static final int TAGBANWA_ID = 101; // 0x65
- field public static final android.icu.lang.UCharacter.UnicodeBlock TAGS;
- field public static final int TAGS_ID = 96; // 0x60
- field public static final android.icu.lang.UCharacter.UnicodeBlock TAI_LE;
- field public static final int TAI_LE_ID = 112; // 0x70
- field public static final android.icu.lang.UCharacter.UnicodeBlock TAI_THAM;
- field public static final int TAI_THAM_ID = 174; // 0xae
- field public static final android.icu.lang.UCharacter.UnicodeBlock TAI_VIET;
- field public static final int TAI_VIET_ID = 183; // 0xb7
- field public static final android.icu.lang.UCharacter.UnicodeBlock TAI_XUAN_JING_SYMBOLS;
- field public static final int TAI_XUAN_JING_SYMBOLS_ID = 124; // 0x7c
- field public static final android.icu.lang.UCharacter.UnicodeBlock TAKRI;
- field public static final int TAKRI_ID = 220; // 0xdc
- field public static final android.icu.lang.UCharacter.UnicodeBlock TAMIL;
- field public static final int TAMIL_ID = 20; // 0x14
- field public static final android.icu.lang.UCharacter.UnicodeBlock TAMIL_SUPPLEMENT;
- field public static final int TAMIL_SUPPLEMENT_ID = 299; // 0x12b
- field public static final android.icu.lang.UCharacter.UnicodeBlock TANGUT;
- field public static final android.icu.lang.UCharacter.UnicodeBlock TANGUT_COMPONENTS;
- field public static final int TANGUT_COMPONENTS_ID = 273; // 0x111
- field public static final int TANGUT_ID = 272; // 0x110
- field public static final android.icu.lang.UCharacter.UnicodeBlock TANGUT_SUPPLEMENT;
- field public static final int TANGUT_SUPPLEMENT_ID = 307; // 0x133
- field public static final android.icu.lang.UCharacter.UnicodeBlock TELUGU;
- field public static final int TELUGU_ID = 21; // 0x15
- field public static final android.icu.lang.UCharacter.UnicodeBlock THAANA;
- field public static final int THAANA_ID = 14; // 0xe
- field public static final android.icu.lang.UCharacter.UnicodeBlock THAI;
- field public static final int THAI_ID = 25; // 0x19
- field public static final android.icu.lang.UCharacter.UnicodeBlock TIBETAN;
- field public static final int TIBETAN_ID = 27; // 0x1b
- field public static final android.icu.lang.UCharacter.UnicodeBlock TIFINAGH;
- field public static final int TIFINAGH_ID = 144; // 0x90
- field public static final android.icu.lang.UCharacter.UnicodeBlock TIRHUTA;
- field public static final int TIRHUTA_ID = 251; // 0xfb
- field public static final android.icu.lang.UCharacter.UnicodeBlock TRANSPORT_AND_MAP_SYMBOLS;
- field public static final int TRANSPORT_AND_MAP_SYMBOLS_ID = 207; // 0xcf
- field public static final android.icu.lang.UCharacter.UnicodeBlock UGARITIC;
- field public static final int UGARITIC_ID = 120; // 0x78
- field public static final android.icu.lang.UCharacter.UnicodeBlock UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS;
- field public static final android.icu.lang.UCharacter.UnicodeBlock UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS_EXTENDED;
- field public static final int UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS_EXTENDED_ID = 173; // 0xad
- field public static final int UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS_ID = 33; // 0x21
- field public static final android.icu.lang.UCharacter.UnicodeBlock VAI;
- field public static final int VAI_ID = 159; // 0x9f
- field public static final android.icu.lang.UCharacter.UnicodeBlock VARIATION_SELECTORS;
- field public static final int VARIATION_SELECTORS_ID = 108; // 0x6c
- field public static final android.icu.lang.UCharacter.UnicodeBlock VARIATION_SELECTORS_SUPPLEMENT;
- field public static final int VARIATION_SELECTORS_SUPPLEMENT_ID = 125; // 0x7d
- field public static final android.icu.lang.UCharacter.UnicodeBlock VEDIC_EXTENSIONS;
- field public static final int VEDIC_EXTENSIONS_ID = 175; // 0xaf
- field public static final android.icu.lang.UCharacter.UnicodeBlock VERTICAL_FORMS;
- field public static final int VERTICAL_FORMS_ID = 145; // 0x91
- field public static final android.icu.lang.UCharacter.UnicodeBlock WANCHO;
- field public static final int WANCHO_ID = 300; // 0x12c
- field public static final android.icu.lang.UCharacter.UnicodeBlock WARANG_CITI;
- field public static final int WARANG_CITI_ID = 252; // 0xfc
- field public static final android.icu.lang.UCharacter.UnicodeBlock YEZIDI;
- field public static final int YEZIDI_ID = 308; // 0x134
- field public static final android.icu.lang.UCharacter.UnicodeBlock YIJING_HEXAGRAM_SYMBOLS;
- field public static final int YIJING_HEXAGRAM_SYMBOLS_ID = 116; // 0x74
- field public static final android.icu.lang.UCharacter.UnicodeBlock YI_RADICALS;
- field public static final int YI_RADICALS_ID = 73; // 0x49
- field public static final android.icu.lang.UCharacter.UnicodeBlock YI_SYLLABLES;
- field public static final int YI_SYLLABLES_ID = 72; // 0x48
- field public static final android.icu.lang.UCharacter.UnicodeBlock ZANABAZAR_SQUARE;
- field public static final int ZANABAZAR_SQUARE_ID = 280; // 0x118
- }
-
- public static interface UCharacter.VerticalOrientation {
- field public static final int ROTATED = 0; // 0x0
- field public static final int TRANSFORMED_ROTATED = 1; // 0x1
- field public static final int TRANSFORMED_UPRIGHT = 2; // 0x2
- field public static final int UPRIGHT = 3; // 0x3
- }
-
- public static interface UCharacter.WordBreak {
- field public static final int ALETTER = 1; // 0x1
- field public static final int CR = 8; // 0x8
- field public static final int DOUBLE_QUOTE = 16; // 0x10
- field public static final int EXTEND = 9; // 0x9
- field public static final int EXTENDNUMLET = 7; // 0x7
- field public static final int E_BASE = 17; // 0x11
- field public static final int E_BASE_GAZ = 18; // 0x12
- field public static final int E_MODIFIER = 19; // 0x13
- field public static final int FORMAT = 2; // 0x2
- field public static final int GLUE_AFTER_ZWJ = 20; // 0x14
- field public static final int HEBREW_LETTER = 14; // 0xe
- field public static final int KATAKANA = 3; // 0x3
- field public static final int LF = 10; // 0xa
- field public static final int MIDLETTER = 4; // 0x4
- field public static final int MIDNUM = 5; // 0x5
- field public static final int MIDNUMLET = 11; // 0xb
- field public static final int NEWLINE = 12; // 0xc
- field public static final int NUMERIC = 6; // 0x6
- field public static final int OTHER = 0; // 0x0
- field public static final int REGIONAL_INDICATOR = 13; // 0xd
- field public static final int SINGLE_QUOTE = 15; // 0xf
- field public static final int WSEGSPACE = 22; // 0x16
- field public static final int ZWJ = 21; // 0x15
- }
-
- public final class UCharacterCategory implements android.icu.lang.UCharacterEnums.ECharacterCategory {
- method public static String toString(int);
- }
-
- public final class UCharacterDirection implements android.icu.lang.UCharacterEnums.ECharacterDirection {
- method public static String toString(int);
- }
-
- public class UCharacterEnums {
- }
-
- public static interface UCharacterEnums.ECharacterCategory {
- field public static final byte COMBINING_SPACING_MARK = 8; // 0x8
- field public static final byte CONNECTOR_PUNCTUATION = 22; // 0x16
- field public static final byte CONTROL = 15; // 0xf
- field public static final byte CURRENCY_SYMBOL = 25; // 0x19
- field public static final byte DASH_PUNCTUATION = 19; // 0x13
- field public static final byte DECIMAL_DIGIT_NUMBER = 9; // 0x9
- field public static final byte ENCLOSING_MARK = 7; // 0x7
- field public static final byte END_PUNCTUATION = 21; // 0x15
- field public static final byte FINAL_PUNCTUATION = 29; // 0x1d
- field public static final byte FINAL_QUOTE_PUNCTUATION = 29; // 0x1d
- field public static final byte FORMAT = 16; // 0x10
- field public static final byte GENERAL_OTHER_TYPES = 0; // 0x0
- field public static final byte INITIAL_PUNCTUATION = 28; // 0x1c
- field public static final byte INITIAL_QUOTE_PUNCTUATION = 28; // 0x1c
- field public static final byte LETTER_NUMBER = 10; // 0xa
- field public static final byte LINE_SEPARATOR = 13; // 0xd
- field public static final byte LOWERCASE_LETTER = 2; // 0x2
- field public static final byte MATH_SYMBOL = 24; // 0x18
- field public static final byte MODIFIER_LETTER = 4; // 0x4
- field public static final byte MODIFIER_SYMBOL = 26; // 0x1a
- field public static final byte NON_SPACING_MARK = 6; // 0x6
- field public static final byte OTHER_LETTER = 5; // 0x5
- field public static final byte OTHER_NUMBER = 11; // 0xb
- field public static final byte OTHER_PUNCTUATION = 23; // 0x17
- field public static final byte OTHER_SYMBOL = 27; // 0x1b
- field public static final byte PARAGRAPH_SEPARATOR = 14; // 0xe
- field public static final byte PRIVATE_USE = 17; // 0x11
- field public static final byte SPACE_SEPARATOR = 12; // 0xc
- field public static final byte START_PUNCTUATION = 20; // 0x14
- field public static final byte SURROGATE = 18; // 0x12
- field public static final byte TITLECASE_LETTER = 3; // 0x3
- field public static final byte UNASSIGNED = 0; // 0x0
- field public static final byte UPPERCASE_LETTER = 1; // 0x1
- }
-
- public static interface UCharacterEnums.ECharacterDirection {
- field public static final int ARABIC_NUMBER = 5; // 0x5
- field public static final int BLOCK_SEPARATOR = 7; // 0x7
- field public static final int BOUNDARY_NEUTRAL = 18; // 0x12
- field public static final int COMMON_NUMBER_SEPARATOR = 6; // 0x6
- field public static final byte DIRECTIONALITY_ARABIC_NUMBER = 5; // 0x5
- field public static final byte DIRECTIONALITY_BOUNDARY_NEUTRAL = 18; // 0x12
- field public static final byte DIRECTIONALITY_COMMON_NUMBER_SEPARATOR = 6; // 0x6
- field public static final byte DIRECTIONALITY_EUROPEAN_NUMBER = 2; // 0x2
- field public static final byte DIRECTIONALITY_EUROPEAN_NUMBER_SEPARATOR = 3; // 0x3
- field public static final byte DIRECTIONALITY_EUROPEAN_NUMBER_TERMINATOR = 4; // 0x4
- field public static final byte DIRECTIONALITY_LEFT_TO_RIGHT = 0; // 0x0
- field public static final byte DIRECTIONALITY_LEFT_TO_RIGHT_EMBEDDING = 11; // 0xb
- field public static final byte DIRECTIONALITY_LEFT_TO_RIGHT_OVERRIDE = 12; // 0xc
- field public static final byte DIRECTIONALITY_NONSPACING_MARK = 17; // 0x11
- field public static final byte DIRECTIONALITY_OTHER_NEUTRALS = 10; // 0xa
- field public static final byte DIRECTIONALITY_PARAGRAPH_SEPARATOR = 7; // 0x7
- field public static final byte DIRECTIONALITY_POP_DIRECTIONAL_FORMAT = 16; // 0x10
- field public static final byte DIRECTIONALITY_RIGHT_TO_LEFT = 1; // 0x1
- field public static final byte DIRECTIONALITY_RIGHT_TO_LEFT_ARABIC = 13; // 0xd
- field public static final byte DIRECTIONALITY_RIGHT_TO_LEFT_EMBEDDING = 14; // 0xe
- field public static final byte DIRECTIONALITY_RIGHT_TO_LEFT_OVERRIDE = 15; // 0xf
- field public static final byte DIRECTIONALITY_SEGMENT_SEPARATOR = 8; // 0x8
- field public static final byte DIRECTIONALITY_UNDEFINED = -1; // 0xffffffff
- field public static final byte DIRECTIONALITY_WHITESPACE = 9; // 0x9
- field public static final int DIR_NON_SPACING_MARK = 17; // 0x11
- field public static final int EUROPEAN_NUMBER = 2; // 0x2
- field public static final int EUROPEAN_NUMBER_SEPARATOR = 3; // 0x3
- field public static final int EUROPEAN_NUMBER_TERMINATOR = 4; // 0x4
- field public static final byte FIRST_STRONG_ISOLATE = 19; // 0x13
- field public static final int LEFT_TO_RIGHT = 0; // 0x0
- field public static final int LEFT_TO_RIGHT_EMBEDDING = 11; // 0xb
- field public static final byte LEFT_TO_RIGHT_ISOLATE = 20; // 0x14
- field public static final int LEFT_TO_RIGHT_OVERRIDE = 12; // 0xc
- field public static final int OTHER_NEUTRAL = 10; // 0xa
- field public static final int POP_DIRECTIONAL_FORMAT = 16; // 0x10
- field public static final byte POP_DIRECTIONAL_ISOLATE = 22; // 0x16
- field public static final int RIGHT_TO_LEFT = 1; // 0x1
- field public static final int RIGHT_TO_LEFT_ARABIC = 13; // 0xd
- field public static final int RIGHT_TO_LEFT_EMBEDDING = 14; // 0xe
- field public static final byte RIGHT_TO_LEFT_ISOLATE = 21; // 0x15
- field public static final int RIGHT_TO_LEFT_OVERRIDE = 15; // 0xf
- field public static final int SEGMENT_SEPARATOR = 8; // 0x8
- field public static final int WHITE_SPACE_NEUTRAL = 9; // 0x9
- }
-
- public interface UProperty {
- field public static final int AGE = 16384; // 0x4000
- field public static final int ALPHABETIC = 0; // 0x0
- field public static final int ASCII_HEX_DIGIT = 1; // 0x1
- field public static final int BIDI_CLASS = 4096; // 0x1000
- field public static final int BIDI_CONTROL = 2; // 0x2
- field public static final int BIDI_MIRRORED = 3; // 0x3
- field public static final int BIDI_MIRRORING_GLYPH = 16385; // 0x4001
- field public static final int BIDI_PAIRED_BRACKET = 16397; // 0x400d
- field public static final int BIDI_PAIRED_BRACKET_TYPE = 4117; // 0x1015
- field public static final int BINARY_START = 0; // 0x0
- field public static final int BLOCK = 4097; // 0x1001
- field public static final int CANONICAL_COMBINING_CLASS = 4098; // 0x1002
- field public static final int CASED = 49; // 0x31
- field public static final int CASE_FOLDING = 16386; // 0x4002
- field public static final int CASE_IGNORABLE = 50; // 0x32
- field public static final int CASE_SENSITIVE = 34; // 0x22
- field public static final int CHANGES_WHEN_CASEFOLDED = 54; // 0x36
- field public static final int CHANGES_WHEN_CASEMAPPED = 55; // 0x37
- field public static final int CHANGES_WHEN_LOWERCASED = 51; // 0x33
- field public static final int CHANGES_WHEN_NFKC_CASEFOLDED = 56; // 0x38
- field public static final int CHANGES_WHEN_TITLECASED = 53; // 0x35
- field public static final int CHANGES_WHEN_UPPERCASED = 52; // 0x34
- field public static final int DASH = 4; // 0x4
- field public static final int DECOMPOSITION_TYPE = 4099; // 0x1003
- field public static final int DEFAULT_IGNORABLE_CODE_POINT = 5; // 0x5
- field public static final int DEPRECATED = 6; // 0x6
- field public static final int DIACRITIC = 7; // 0x7
- field public static final int DOUBLE_START = 12288; // 0x3000
- field public static final int EAST_ASIAN_WIDTH = 4100; // 0x1004
- field public static final int EMOJI = 57; // 0x39
- field public static final int EMOJI_COMPONENT = 61; // 0x3d
- field public static final int EMOJI_MODIFIER = 59; // 0x3b
- field public static final int EMOJI_MODIFIER_BASE = 60; // 0x3c
- field public static final int EMOJI_PRESENTATION = 58; // 0x3a
- field public static final int EXTENDED_PICTOGRAPHIC = 64; // 0x40
- field public static final int EXTENDER = 8; // 0x8
- field public static final int FULL_COMPOSITION_EXCLUSION = 9; // 0x9
- field public static final int GENERAL_CATEGORY = 4101; // 0x1005
- field public static final int GENERAL_CATEGORY_MASK = 8192; // 0x2000
- field public static final int GRAPHEME_BASE = 10; // 0xa
- field public static final int GRAPHEME_CLUSTER_BREAK = 4114; // 0x1012
- field public static final int GRAPHEME_EXTEND = 11; // 0xb
- field public static final int GRAPHEME_LINK = 12; // 0xc
- field public static final int HANGUL_SYLLABLE_TYPE = 4107; // 0x100b
- field public static final int HEX_DIGIT = 13; // 0xd
- field public static final int HYPHEN = 14; // 0xe
- field public static final int IDEOGRAPHIC = 17; // 0x11
- field public static final int IDS_BINARY_OPERATOR = 18; // 0x12
- field public static final int IDS_TRINARY_OPERATOR = 19; // 0x13
- field public static final int ID_CONTINUE = 15; // 0xf
- field public static final int ID_START = 16; // 0x10
- field public static final int INDIC_POSITIONAL_CATEGORY = 4118; // 0x1016
- field public static final int INDIC_SYLLABIC_CATEGORY = 4119; // 0x1017
- field public static final int INT_START = 4096; // 0x1000
- field public static final int JOINING_GROUP = 4102; // 0x1006
- field public static final int JOINING_TYPE = 4103; // 0x1007
- field public static final int JOIN_CONTROL = 20; // 0x14
- field public static final int LEAD_CANONICAL_COMBINING_CLASS = 4112; // 0x1010
- field public static final int LINE_BREAK = 4104; // 0x1008
- field public static final int LOGICAL_ORDER_EXCEPTION = 21; // 0x15
- field public static final int LOWERCASE = 22; // 0x16
- field public static final int LOWERCASE_MAPPING = 16388; // 0x4004
- field public static final int MASK_START = 8192; // 0x2000
- field public static final int MATH = 23; // 0x17
- field public static final int NAME = 16389; // 0x4005
- field public static final int NFC_INERT = 39; // 0x27
- field public static final int NFC_QUICK_CHECK = 4110; // 0x100e
- field public static final int NFD_INERT = 37; // 0x25
- field public static final int NFD_QUICK_CHECK = 4108; // 0x100c
- field public static final int NFKC_INERT = 40; // 0x28
- field public static final int NFKC_QUICK_CHECK = 4111; // 0x100f
- field public static final int NFKD_INERT = 38; // 0x26
- field public static final int NFKD_QUICK_CHECK = 4109; // 0x100d
- field public static final int NONCHARACTER_CODE_POINT = 24; // 0x18
- field public static final int NUMERIC_TYPE = 4105; // 0x1009
- field public static final int NUMERIC_VALUE = 12288; // 0x3000
- field public static final int OTHER_PROPERTY_START = 28672; // 0x7000
- field public static final int PATTERN_SYNTAX = 42; // 0x2a
- field public static final int PATTERN_WHITE_SPACE = 43; // 0x2b
- field public static final int POSIX_ALNUM = 44; // 0x2c
- field public static final int POSIX_BLANK = 45; // 0x2d
- field public static final int POSIX_GRAPH = 46; // 0x2e
- field public static final int POSIX_PRINT = 47; // 0x2f
- field public static final int POSIX_XDIGIT = 48; // 0x30
- field public static final int PREPENDED_CONCATENATION_MARK = 63; // 0x3f
- field public static final int QUOTATION_MARK = 25; // 0x19
- field public static final int RADICAL = 26; // 0x1a
- field public static final int REGIONAL_INDICATOR = 62; // 0x3e
- field public static final int SCRIPT = 4106; // 0x100a
- field public static final int SCRIPT_EXTENSIONS = 28672; // 0x7000
- field public static final int SEGMENT_STARTER = 41; // 0x29
- field public static final int SENTENCE_BREAK = 4115; // 0x1013
- field public static final int SIMPLE_CASE_FOLDING = 16390; // 0x4006
- field public static final int SIMPLE_LOWERCASE_MAPPING = 16391; // 0x4007
- field public static final int SIMPLE_TITLECASE_MAPPING = 16392; // 0x4008
- field public static final int SIMPLE_UPPERCASE_MAPPING = 16393; // 0x4009
- field public static final int SOFT_DOTTED = 27; // 0x1b
- field public static final int STRING_START = 16384; // 0x4000
- field public static final int S_TERM = 35; // 0x23
- field public static final int TERMINAL_PUNCTUATION = 28; // 0x1c
- field public static final int TITLECASE_MAPPING = 16394; // 0x400a
- field public static final int TRAIL_CANONICAL_COMBINING_CLASS = 4113; // 0x1011
- field public static final int UNIFIED_IDEOGRAPH = 29; // 0x1d
- field public static final int UPPERCASE = 30; // 0x1e
- field public static final int UPPERCASE_MAPPING = 16396; // 0x400c
- field public static final int VARIATION_SELECTOR = 36; // 0x24
- field public static final int VERTICAL_ORIENTATION = 4120; // 0x1018
- field public static final int WHITE_SPACE = 31; // 0x1f
- field public static final int WORD_BREAK = 4116; // 0x1014
- field public static final int XID_CONTINUE = 32; // 0x20
- field public static final int XID_START = 33; // 0x21
- }
-
- public static interface UProperty.NameChoice {
- field public static final int LONG = 1; // 0x1
- field public static final int SHORT = 0; // 0x0
- }
-
- public final class UScript {
- method public static boolean breaksBetweenLetters(int);
- method public static int[] getCode(java.util.Locale);
- method public static int[] getCode(android.icu.util.ULocale);
- method public static int[] getCode(String);
- method public static int getCodeFromName(String);
- method public static String getName(int);
- method public static String getSampleString(int);
- method public static int getScript(int);
- method public static int getScriptExtensions(int, java.util.BitSet);
- method public static String getShortName(int);
- method public static android.icu.lang.UScript.ScriptUsage getUsage(int);
- method public static boolean hasScript(int, int);
- method public static boolean isCased(int);
- method public static boolean isRightToLeft(int);
- field public static final int ADLAM = 167; // 0xa7
- field public static final int AFAKA = 147; // 0x93
- field public static final int AHOM = 161; // 0xa1
- field public static final int ANATOLIAN_HIEROGLYPHS = 156; // 0x9c
- field public static final int ARABIC = 2; // 0x2
- field public static final int ARMENIAN = 3; // 0x3
- field public static final int AVESTAN = 117; // 0x75
- field public static final int BALINESE = 62; // 0x3e
- field public static final int BAMUM = 130; // 0x82
- field public static final int BASSA_VAH = 134; // 0x86
- field public static final int BATAK = 63; // 0x3f
- field public static final int BENGALI = 4; // 0x4
- field public static final int BHAIKSUKI = 168; // 0xa8
- field public static final int BLISSYMBOLS = 64; // 0x40
- field public static final int BOOK_PAHLAVI = 124; // 0x7c
- field public static final int BOPOMOFO = 5; // 0x5
- field public static final int BRAHMI = 65; // 0x41
- field public static final int BRAILLE = 46; // 0x2e
- field public static final int BUGINESE = 55; // 0x37
- field public static final int BUHID = 44; // 0x2c
- field public static final int CANADIAN_ABORIGINAL = 40; // 0x28
- field public static final int CARIAN = 104; // 0x68
- field public static final int CAUCASIAN_ALBANIAN = 159; // 0x9f
- field public static final int CHAKMA = 118; // 0x76
- field public static final int CHAM = 66; // 0x42
- field public static final int CHEROKEE = 6; // 0x6
- field public static final int CHORASMIAN = 189; // 0xbd
- field public static final int CIRTH = 67; // 0x43
- field public static final int COMMON = 0; // 0x0
- field public static final int COPTIC = 7; // 0x7
- field public static final int CUNEIFORM = 101; // 0x65
- field public static final int CYPRIOT = 47; // 0x2f
- field public static final int CYRILLIC = 8; // 0x8
- field public static final int DEMOTIC_EGYPTIAN = 69; // 0x45
- field public static final int DESERET = 9; // 0x9
- field public static final int DEVANAGARI = 10; // 0xa
- field public static final int DIVES_AKURU = 190; // 0xbe
- field public static final int DOGRA = 178; // 0xb2
- field public static final int DUPLOYAN = 135; // 0x87
- field public static final int EASTERN_SYRIAC = 97; // 0x61
- field public static final int EGYPTIAN_HIEROGLYPHS = 71; // 0x47
- field public static final int ELBASAN = 136; // 0x88
- field public static final int ELYMAIC = 185; // 0xb9
- field public static final int ESTRANGELO_SYRIAC = 95; // 0x5f
- field public static final int ETHIOPIC = 11; // 0xb
- field public static final int GEORGIAN = 12; // 0xc
- field public static final int GLAGOLITIC = 56; // 0x38
- field public static final int GOTHIC = 13; // 0xd
- field public static final int GRANTHA = 137; // 0x89
- field public static final int GREEK = 14; // 0xe
- field public static final int GUJARATI = 15; // 0xf
- field public static final int GUNJALA_GONDI = 179; // 0xb3
- field public static final int GURMUKHI = 16; // 0x10
- field public static final int HAN = 17; // 0x11
- field public static final int HANGUL = 18; // 0x12
- field public static final int HANIFI_ROHINGYA = 182; // 0xb6
- field public static final int HANUNOO = 43; // 0x2b
- field public static final int HAN_WITH_BOPOMOFO = 172; // 0xac
- field public static final int HARAPPAN_INDUS = 77; // 0x4d
- field public static final int HATRAN = 162; // 0xa2
- field public static final int HEBREW = 19; // 0x13
- field public static final int HIERATIC_EGYPTIAN = 70; // 0x46
- field public static final int HIRAGANA = 20; // 0x14
- field public static final int IMPERIAL_ARAMAIC = 116; // 0x74
- field public static final int INHERITED = 1; // 0x1
- field public static final int INSCRIPTIONAL_PAHLAVI = 122; // 0x7a
- field public static final int INSCRIPTIONAL_PARTHIAN = 125; // 0x7d
- field public static final int INVALID_CODE = -1; // 0xffffffff
- field public static final int JAMO = 173; // 0xad
- field public static final int JAPANESE = 105; // 0x69
- field public static final int JAVANESE = 78; // 0x4e
- field public static final int JURCHEN = 148; // 0x94
- field public static final int KAITHI = 120; // 0x78
- field public static final int KANNADA = 21; // 0x15
- field public static final int KATAKANA = 22; // 0x16
- field public static final int KATAKANA_OR_HIRAGANA = 54; // 0x36
- field public static final int KAYAH_LI = 79; // 0x4f
- field public static final int KHAROSHTHI = 57; // 0x39
- field public static final int KHITAN_SMALL_SCRIPT = 191; // 0xbf
- field public static final int KHMER = 23; // 0x17
- field public static final int KHOJKI = 157; // 0x9d
- field public static final int KHUDAWADI = 145; // 0x91
- field public static final int KHUTSURI = 72; // 0x48
- field public static final int KOREAN = 119; // 0x77
- field public static final int KPELLE = 138; // 0x8a
- field public static final int LANNA = 106; // 0x6a
- field public static final int LAO = 24; // 0x18
- field public static final int LATIN = 25; // 0x19
- field public static final int LATIN_FRAKTUR = 80; // 0x50
- field public static final int LATIN_GAELIC = 81; // 0x51
- field public static final int LEPCHA = 82; // 0x52
- field public static final int LIMBU = 48; // 0x30
- field public static final int LINEAR_A = 83; // 0x53
- field public static final int LINEAR_B = 49; // 0x31
- field public static final int LISU = 131; // 0x83
- field public static final int LOMA = 139; // 0x8b
- field public static final int LYCIAN = 107; // 0x6b
- field public static final int LYDIAN = 108; // 0x6c
- field public static final int MAHAJANI = 160; // 0xa0
- field public static final int MAKASAR = 180; // 0xb4
- field public static final int MALAYALAM = 26; // 0x1a
- field public static final int MANDAEAN = 84; // 0x54
- field public static final int MANDAIC = 84; // 0x54
- field public static final int MANICHAEAN = 121; // 0x79
- field public static final int MARCHEN = 169; // 0xa9
- field public static final int MASARAM_GONDI = 175; // 0xaf
- field public static final int MATHEMATICAL_NOTATION = 128; // 0x80
- field public static final int MAYAN_HIEROGLYPHS = 85; // 0x55
- field public static final int MEDEFAIDRIN = 181; // 0xb5
- field public static final int MEITEI_MAYEK = 115; // 0x73
- field public static final int MENDE = 140; // 0x8c
- field public static final int MEROITIC = 86; // 0x56
- field public static final int MEROITIC_CURSIVE = 141; // 0x8d
- field public static final int MEROITIC_HIEROGLYPHS = 86; // 0x56
- field public static final int MIAO = 92; // 0x5c
- field public static final int MODI = 163; // 0xa3
- field public static final int MONGOLIAN = 27; // 0x1b
- field public static final int MOON = 114; // 0x72
- field public static final int MRO = 149; // 0x95
- field public static final int MULTANI = 164; // 0xa4
- field public static final int MYANMAR = 28; // 0x1c
- field public static final int NABATAEAN = 143; // 0x8f
- field public static final int NAKHI_GEBA = 132; // 0x84
- field public static final int NANDINAGARI = 187; // 0xbb
- field public static final int NEWA = 170; // 0xaa
- field public static final int NEW_TAI_LUE = 59; // 0x3b
- field public static final int NKO = 87; // 0x57
- field public static final int NUSHU = 150; // 0x96
- field public static final int NYIAKENG_PUACHUE_HMONG = 186; // 0xba
- field public static final int OGHAM = 29; // 0x1d
- field public static final int OLD_CHURCH_SLAVONIC_CYRILLIC = 68; // 0x44
- field public static final int OLD_HUNGARIAN = 76; // 0x4c
- field public static final int OLD_ITALIC = 30; // 0x1e
- field public static final int OLD_NORTH_ARABIAN = 142; // 0x8e
- field public static final int OLD_PERMIC = 89; // 0x59
- field public static final int OLD_PERSIAN = 61; // 0x3d
- field public static final int OLD_SOGDIAN = 184; // 0xb8
- field public static final int OLD_SOUTH_ARABIAN = 133; // 0x85
- field public static final int OL_CHIKI = 109; // 0x6d
- field public static final int ORIYA = 31; // 0x1f
- field public static final int ORKHON = 88; // 0x58
- field public static final int OSAGE = 171; // 0xab
- field public static final int OSMANYA = 50; // 0x32
- field public static final int PAHAWH_HMONG = 75; // 0x4b
- field public static final int PALMYRENE = 144; // 0x90
- field public static final int PAU_CIN_HAU = 165; // 0xa5
- field public static final int PHAGS_PA = 90; // 0x5a
- field public static final int PHOENICIAN = 91; // 0x5b
- field public static final int PHONETIC_POLLARD = 92; // 0x5c
- field public static final int PSALTER_PAHLAVI = 123; // 0x7b
- field public static final int REJANG = 110; // 0x6e
- field public static final int RONGORONGO = 93; // 0x5d
- field public static final int RUNIC = 32; // 0x20
- field public static final int SAMARITAN = 126; // 0x7e
- field public static final int SARATI = 94; // 0x5e
- field public static final int SAURASHTRA = 111; // 0x6f
- field public static final int SHARADA = 151; // 0x97
- field public static final int SHAVIAN = 51; // 0x33
- field public static final int SIDDHAM = 166; // 0xa6
- field public static final int SIGN_WRITING = 112; // 0x70
- field public static final int SIMPLIFIED_HAN = 73; // 0x49
- field public static final int SINDHI = 145; // 0x91
- field public static final int SINHALA = 33; // 0x21
- field public static final int SOGDIAN = 183; // 0xb7
- field public static final int SORA_SOMPENG = 152; // 0x98
- field public static final int SOYOMBO = 176; // 0xb0
- field public static final int SUNDANESE = 113; // 0x71
- field public static final int SYLOTI_NAGRI = 58; // 0x3a
- field public static final int SYMBOLS = 129; // 0x81
- field public static final int SYMBOLS_EMOJI = 174; // 0xae
- field public static final int SYRIAC = 34; // 0x22
- field public static final int TAGALOG = 42; // 0x2a
- field public static final int TAGBANWA = 45; // 0x2d
- field public static final int TAI_LE = 52; // 0x34
- field public static final int TAI_VIET = 127; // 0x7f
- field public static final int TAKRI = 153; // 0x99
- field public static final int TAMIL = 35; // 0x23
- field public static final int TANGUT = 154; // 0x9a
- field public static final int TELUGU = 36; // 0x24
- field public static final int TENGWAR = 98; // 0x62
- field public static final int THAANA = 37; // 0x25
- field public static final int THAI = 38; // 0x26
- field public static final int TIBETAN = 39; // 0x27
- field public static final int TIFINAGH = 60; // 0x3c
- field public static final int TIRHUTA = 158; // 0x9e
- field public static final int TRADITIONAL_HAN = 74; // 0x4a
- field public static final int UCAS = 40; // 0x28
- field public static final int UGARITIC = 53; // 0x35
- field public static final int UNKNOWN = 103; // 0x67
- field public static final int UNWRITTEN_LANGUAGES = 102; // 0x66
- field public static final int VAI = 99; // 0x63
- field public static final int VISIBLE_SPEECH = 100; // 0x64
- field public static final int WANCHO = 188; // 0xbc
- field public static final int WARANG_CITI = 146; // 0x92
- field public static final int WESTERN_SYRIAC = 96; // 0x60
- field public static final int WOLEAI = 155; // 0x9b
- field public static final int YEZIDI = 192; // 0xc0
- field public static final int YI = 41; // 0x29
- field public static final int ZANABAZAR_SQUARE = 177; // 0xb1
- }
-
- public enum UScript.ScriptUsage {
- enum_constant public static final android.icu.lang.UScript.ScriptUsage ASPIRATIONAL;
- enum_constant public static final android.icu.lang.UScript.ScriptUsage EXCLUDED;
- enum_constant public static final android.icu.lang.UScript.ScriptUsage LIMITED_USE;
- enum_constant public static final android.icu.lang.UScript.ScriptUsage NOT_ENCODED;
- enum_constant public static final android.icu.lang.UScript.ScriptUsage RECOMMENDED;
- enum_constant public static final android.icu.lang.UScript.ScriptUsage UNKNOWN;
- }
-
-}
-
-package android.icu.math {
-
- public class BigDecimal extends java.lang.Number implements java.lang.Comparable<android.icu.math.BigDecimal> java.io.Serializable {
- ctor public BigDecimal(java.math.BigDecimal);
- ctor public BigDecimal(java.math.BigInteger);
- ctor public BigDecimal(java.math.BigInteger, int);
- ctor public BigDecimal(char[]);
- ctor public BigDecimal(char[], int, int);
- ctor public BigDecimal(double);
- ctor public BigDecimal(int);
- ctor public BigDecimal(long);
- ctor public BigDecimal(String);
- method public android.icu.math.BigDecimal abs();
- method public android.icu.math.BigDecimal abs(android.icu.math.MathContext);
- method public android.icu.math.BigDecimal add(android.icu.math.BigDecimal);
- method public android.icu.math.BigDecimal add(android.icu.math.BigDecimal, android.icu.math.MathContext);
- method public byte byteValueExact();
- method public int compareTo(android.icu.math.BigDecimal);
- method public int compareTo(android.icu.math.BigDecimal, android.icu.math.MathContext);
- method public android.icu.math.BigDecimal divide(android.icu.math.BigDecimal);
- method public android.icu.math.BigDecimal divide(android.icu.math.BigDecimal, int);
- method public android.icu.math.BigDecimal divide(android.icu.math.BigDecimal, int, int);
- method public android.icu.math.BigDecimal divide(android.icu.math.BigDecimal, android.icu.math.MathContext);
- method public android.icu.math.BigDecimal divideInteger(android.icu.math.BigDecimal);
- method public android.icu.math.BigDecimal divideInteger(android.icu.math.BigDecimal, android.icu.math.MathContext);
- method public double doubleValue();
- method public float floatValue();
- method public String format(int, int);
- method public String format(int, int, int, int, int, int);
- method public int intValue();
- method public int intValueExact();
- method public long longValue();
- method public long longValueExact();
- method public android.icu.math.BigDecimal max(android.icu.math.BigDecimal);
- method public android.icu.math.BigDecimal max(android.icu.math.BigDecimal, android.icu.math.MathContext);
- method public android.icu.math.BigDecimal min(android.icu.math.BigDecimal);
- method public android.icu.math.BigDecimal min(android.icu.math.BigDecimal, android.icu.math.MathContext);
- method public android.icu.math.BigDecimal movePointLeft(int);
- method public android.icu.math.BigDecimal movePointRight(int);
- method public android.icu.math.BigDecimal multiply(android.icu.math.BigDecimal);
- method public android.icu.math.BigDecimal multiply(android.icu.math.BigDecimal, android.icu.math.MathContext);
- method public android.icu.math.BigDecimal negate();
- method public android.icu.math.BigDecimal negate(android.icu.math.MathContext);
- method public android.icu.math.BigDecimal plus();
- method public android.icu.math.BigDecimal plus(android.icu.math.MathContext);
- method public android.icu.math.BigDecimal pow(android.icu.math.BigDecimal);
- method public android.icu.math.BigDecimal pow(android.icu.math.BigDecimal, android.icu.math.MathContext);
- method public android.icu.math.BigDecimal remainder(android.icu.math.BigDecimal);
- method public android.icu.math.BigDecimal remainder(android.icu.math.BigDecimal, android.icu.math.MathContext);
- method public int scale();
- method public android.icu.math.BigDecimal setScale(int);
- method public android.icu.math.BigDecimal setScale(int, int);
- method public short shortValueExact();
- method public int signum();
- method public android.icu.math.BigDecimal subtract(android.icu.math.BigDecimal);
- method public android.icu.math.BigDecimal subtract(android.icu.math.BigDecimal, android.icu.math.MathContext);
- method public java.math.BigDecimal toBigDecimal();
- method public java.math.BigInteger toBigInteger();
- method public java.math.BigInteger toBigIntegerExact();
- method public char[] toCharArray();
- method public java.math.BigInteger unscaledValue();
- method public static android.icu.math.BigDecimal valueOf(double);
- method public static android.icu.math.BigDecimal valueOf(long);
- method public static android.icu.math.BigDecimal valueOf(long, int);
- field public static final android.icu.math.BigDecimal ONE;
- field public static final int ROUND_CEILING = 2; // 0x2
- field public static final int ROUND_DOWN = 1; // 0x1
- field public static final int ROUND_FLOOR = 3; // 0x3
- field public static final int ROUND_HALF_DOWN = 5; // 0x5
- field public static final int ROUND_HALF_EVEN = 6; // 0x6
- field public static final int ROUND_HALF_UP = 4; // 0x4
- field public static final int ROUND_UNNECESSARY = 7; // 0x7
- field public static final int ROUND_UP = 0; // 0x0
- field public static final android.icu.math.BigDecimal TEN;
- field public static final android.icu.math.BigDecimal ZERO;
- }
-
- public final class MathContext implements java.io.Serializable {
- ctor public MathContext(int);
- ctor public MathContext(int, int);
- ctor public MathContext(int, int, boolean);
- ctor public MathContext(int, int, boolean, int);
- method public int getDigits();
- method public int getForm();
- method public boolean getLostDigits();
- method public int getRoundingMode();
- field public static final android.icu.math.MathContext DEFAULT;
- field public static final int ENGINEERING = 2; // 0x2
- field public static final int PLAIN = 0; // 0x0
- field public static final int ROUND_CEILING = 2; // 0x2
- field public static final int ROUND_DOWN = 1; // 0x1
- field public static final int ROUND_FLOOR = 3; // 0x3
- field public static final int ROUND_HALF_DOWN = 5; // 0x5
- field public static final int ROUND_HALF_EVEN = 6; // 0x6
- field public static final int ROUND_HALF_UP = 4; // 0x4
- field public static final int ROUND_UNNECESSARY = 7; // 0x7
- field public static final int ROUND_UP = 0; // 0x0
- field public static final int SCIENTIFIC = 1; // 0x1
- }
-
-}
-
-package android.icu.number {
-
- public class CompactNotation extends android.icu.number.Notation {
- }
-
- public abstract class CurrencyPrecision extends android.icu.number.Precision {
- method public android.icu.number.Precision withCurrency(android.icu.util.Currency);
- }
-
- public class FormattedNumber implements java.lang.CharSequence {
- method public char charAt(int);
- method public int length();
- method public CharSequence subSequence(int, int);
- method public java.math.BigDecimal toBigDecimal();
- method public java.text.AttributedCharacterIterator toCharacterIterator();
- }
-
- public class FormattedNumberRange implements java.lang.CharSequence {
- method public char charAt(int);
- method public java.math.BigDecimal getFirstBigDecimal();
- method public android.icu.number.NumberRangeFormatter.RangeIdentityResult getIdentityResult();
- method public java.math.BigDecimal getSecondBigDecimal();
- method public int length();
- method public CharSequence subSequence(int, int);
- method public java.text.AttributedCharacterIterator toCharacterIterator();
- }
-
- public abstract class FractionPrecision extends android.icu.number.Precision {
- method public android.icu.number.Precision withMaxDigits(int);
- method public android.icu.number.Precision withMinDigits(int);
- }
-
- public class IntegerWidth {
- method public android.icu.number.IntegerWidth truncateAt(int);
- method public static android.icu.number.IntegerWidth zeroFillTo(int);
- }
-
- public class LocalizedNumberFormatter extends android.icu.number.NumberFormatterSettings<android.icu.number.LocalizedNumberFormatter> {
- method public android.icu.number.FormattedNumber format(long);
- method public android.icu.number.FormattedNumber format(double);
- method public android.icu.number.FormattedNumber format(Number);
- method public android.icu.number.FormattedNumber format(android.icu.util.Measure);
- method public java.text.Format toFormat();
- }
-
- public class LocalizedNumberRangeFormatter extends android.icu.number.NumberRangeFormatterSettings<android.icu.number.LocalizedNumberRangeFormatter> {
- method public android.icu.number.FormattedNumberRange formatRange(int, int);
- method public android.icu.number.FormattedNumberRange formatRange(double, double);
- method public android.icu.number.FormattedNumberRange formatRange(Number, Number);
- }
-
- public class Notation {
- method public static android.icu.number.CompactNotation compactLong();
- method public static android.icu.number.CompactNotation compactShort();
- method public static android.icu.number.ScientificNotation engineering();
- method public static android.icu.number.ScientificNotation scientific();
- method public static android.icu.number.SimpleNotation simple();
- }
-
- public final class NumberFormatter {
- method public static android.icu.number.UnlocalizedNumberFormatter with();
- method public static android.icu.number.LocalizedNumberFormatter withLocale(java.util.Locale);
- method public static android.icu.number.LocalizedNumberFormatter withLocale(android.icu.util.ULocale);
- }
-
- public enum NumberFormatter.DecimalSeparatorDisplay {
- enum_constant public static final android.icu.number.NumberFormatter.DecimalSeparatorDisplay ALWAYS;
- enum_constant public static final android.icu.number.NumberFormatter.DecimalSeparatorDisplay AUTO;
- }
-
- public enum NumberFormatter.GroupingStrategy {
- enum_constant public static final android.icu.number.NumberFormatter.GroupingStrategy AUTO;
- enum_constant public static final android.icu.number.NumberFormatter.GroupingStrategy MIN2;
- enum_constant public static final android.icu.number.NumberFormatter.GroupingStrategy OFF;
- enum_constant public static final android.icu.number.NumberFormatter.GroupingStrategy ON_ALIGNED;
- enum_constant public static final android.icu.number.NumberFormatter.GroupingStrategy THOUSANDS;
- }
-
- public enum NumberFormatter.SignDisplay {
- enum_constant public static final android.icu.number.NumberFormatter.SignDisplay ACCOUNTING;
- enum_constant public static final android.icu.number.NumberFormatter.SignDisplay ACCOUNTING_ALWAYS;
- enum_constant public static final android.icu.number.NumberFormatter.SignDisplay ACCOUNTING_EXCEPT_ZERO;
- enum_constant public static final android.icu.number.NumberFormatter.SignDisplay ALWAYS;
- enum_constant public static final android.icu.number.NumberFormatter.SignDisplay AUTO;
- enum_constant public static final android.icu.number.NumberFormatter.SignDisplay EXCEPT_ZERO;
- enum_constant public static final android.icu.number.NumberFormatter.SignDisplay NEVER;
- }
-
- public enum NumberFormatter.UnitWidth {
- enum_constant public static final android.icu.number.NumberFormatter.UnitWidth FULL_NAME;
- enum_constant public static final android.icu.number.NumberFormatter.UnitWidth HIDDEN;
- enum_constant public static final android.icu.number.NumberFormatter.UnitWidth ISO_CODE;
- enum_constant public static final android.icu.number.NumberFormatter.UnitWidth NARROW;
- enum_constant public static final android.icu.number.NumberFormatter.UnitWidth SHORT;
- }
-
- public abstract class NumberFormatterSettings<T extends android.icu.number.NumberFormatterSettings<?>> {
- method public T decimal(android.icu.number.NumberFormatter.DecimalSeparatorDisplay);
- method public T grouping(android.icu.number.NumberFormatter.GroupingStrategy);
- method public T integerWidth(android.icu.number.IntegerWidth);
- method public T notation(android.icu.number.Notation);
- method public T perUnit(android.icu.util.MeasureUnit);
- method public T precision(android.icu.number.Precision);
- method public T roundingMode(java.math.RoundingMode);
- method public T scale(android.icu.number.Scale);
- method public T sign(android.icu.number.NumberFormatter.SignDisplay);
- method public T symbols(android.icu.text.DecimalFormatSymbols);
- method public T symbols(android.icu.text.NumberingSystem);
- method public T unit(android.icu.util.MeasureUnit);
- method public T unitWidth(android.icu.number.NumberFormatter.UnitWidth);
- }
-
- public abstract class NumberRangeFormatter {
- method public static android.icu.number.UnlocalizedNumberRangeFormatter with();
- method public static android.icu.number.LocalizedNumberRangeFormatter withLocale(java.util.Locale);
- method public static android.icu.number.LocalizedNumberRangeFormatter withLocale(android.icu.util.ULocale);
- }
-
- public enum NumberRangeFormatter.RangeCollapse {
- enum_constant public static final android.icu.number.NumberRangeFormatter.RangeCollapse ALL;
- enum_constant public static final android.icu.number.NumberRangeFormatter.RangeCollapse AUTO;
- enum_constant public static final android.icu.number.NumberRangeFormatter.RangeCollapse NONE;
- enum_constant public static final android.icu.number.NumberRangeFormatter.RangeCollapse UNIT;
- }
-
- public enum NumberRangeFormatter.RangeIdentityFallback {
- enum_constant public static final android.icu.number.NumberRangeFormatter.RangeIdentityFallback APPROXIMATELY;
- enum_constant public static final android.icu.number.NumberRangeFormatter.RangeIdentityFallback APPROXIMATELY_OR_SINGLE_VALUE;
- enum_constant public static final android.icu.number.NumberRangeFormatter.RangeIdentityFallback RANGE;
- enum_constant public static final android.icu.number.NumberRangeFormatter.RangeIdentityFallback SINGLE_VALUE;
- }
-
- public enum NumberRangeFormatter.RangeIdentityResult {
- enum_constant public static final android.icu.number.NumberRangeFormatter.RangeIdentityResult EQUAL_AFTER_ROUNDING;
- enum_constant public static final android.icu.number.NumberRangeFormatter.RangeIdentityResult EQUAL_BEFORE_ROUNDING;
- enum_constant public static final android.icu.number.NumberRangeFormatter.RangeIdentityResult NOT_EQUAL;
- }
-
- public abstract class NumberRangeFormatterSettings<T extends android.icu.number.NumberRangeFormatterSettings<?>> {
- method public T collapse(android.icu.number.NumberRangeFormatter.RangeCollapse);
- method public T identityFallback(android.icu.number.NumberRangeFormatter.RangeIdentityFallback);
- method public T numberFormatterBoth(android.icu.number.UnlocalizedNumberFormatter);
- method public T numberFormatterFirst(android.icu.number.UnlocalizedNumberFormatter);
- method public T numberFormatterSecond(android.icu.number.UnlocalizedNumberFormatter);
- }
-
- public abstract class Precision {
- method public static android.icu.number.CurrencyPrecision currency(android.icu.util.Currency.CurrencyUsage);
- method public static android.icu.number.FractionPrecision fixedFraction(int);
- method public static android.icu.number.Precision fixedSignificantDigits(int);
- method public static android.icu.number.Precision increment(java.math.BigDecimal);
- method public static android.icu.number.FractionPrecision integer();
- method public static android.icu.number.FractionPrecision maxFraction(int);
- method public static android.icu.number.Precision maxSignificantDigits(int);
- method public static android.icu.number.FractionPrecision minFraction(int);
- method public static android.icu.number.FractionPrecision minMaxFraction(int, int);
- method public static android.icu.number.Precision minMaxSignificantDigits(int, int);
- method public static android.icu.number.Precision minSignificantDigits(int);
- method public static android.icu.number.Precision unlimited();
- }
-
- public class Scale {
- method public static android.icu.number.Scale byBigDecimal(java.math.BigDecimal);
- method public static android.icu.number.Scale byDouble(double);
- method public static android.icu.number.Scale byDoubleAndPowerOfTen(double, int);
- method public static android.icu.number.Scale none();
- method public static android.icu.number.Scale powerOfTen(int);
- }
-
- public class ScientificNotation extends android.icu.number.Notation {
- method public android.icu.number.ScientificNotation withExponentSignDisplay(android.icu.number.NumberFormatter.SignDisplay);
- method public android.icu.number.ScientificNotation withMinExponentDigits(int);
- }
-
- public class SimpleNotation extends android.icu.number.Notation {
- }
-
- public class UnlocalizedNumberFormatter extends android.icu.number.NumberFormatterSettings<android.icu.number.UnlocalizedNumberFormatter> {
- method public android.icu.number.LocalizedNumberFormatter locale(java.util.Locale);
- method public android.icu.number.LocalizedNumberFormatter locale(android.icu.util.ULocale);
- }
-
- public class UnlocalizedNumberRangeFormatter extends android.icu.number.NumberRangeFormatterSettings<android.icu.number.UnlocalizedNumberRangeFormatter> {
- method public android.icu.number.LocalizedNumberRangeFormatter locale(java.util.Locale);
- method public android.icu.number.LocalizedNumberRangeFormatter locale(android.icu.util.ULocale);
- }
-
-}
-
-package android.icu.text {
-
- public final class AlphabeticIndex<V> implements java.lang.Iterable<android.icu.text.AlphabeticIndex.Bucket<V>> {
- ctor public AlphabeticIndex(android.icu.util.ULocale);
- ctor public AlphabeticIndex(java.util.Locale);
- ctor public AlphabeticIndex(android.icu.text.RuleBasedCollator);
- method public android.icu.text.AlphabeticIndex<V> addLabels(android.icu.text.UnicodeSet);
- method public android.icu.text.AlphabeticIndex<V> addLabels(android.icu.util.ULocale...);
- method public android.icu.text.AlphabeticIndex<V> addLabels(java.util.Locale...);
- method public android.icu.text.AlphabeticIndex<V> addRecord(CharSequence, V);
- method public android.icu.text.AlphabeticIndex.ImmutableIndex<V> buildImmutableIndex();
- method public android.icu.text.AlphabeticIndex<V> clearRecords();
- method public int getBucketCount();
- method public int getBucketIndex(CharSequence);
- method public java.util.List<java.lang.String> getBucketLabels();
- method public android.icu.text.RuleBasedCollator getCollator();
- method public String getInflowLabel();
- method public int getMaxLabelCount();
- method public String getOverflowLabel();
- method public int getRecordCount();
- method public String getUnderflowLabel();
- method public java.util.Iterator<android.icu.text.AlphabeticIndex.Bucket<V>> iterator();
- method public android.icu.text.AlphabeticIndex<V> setInflowLabel(String);
- method public android.icu.text.AlphabeticIndex<V> setMaxLabelCount(int);
- method public android.icu.text.AlphabeticIndex<V> setOverflowLabel(String);
- method public android.icu.text.AlphabeticIndex<V> setUnderflowLabel(String);
- }
-
- public static class AlphabeticIndex.Bucket<V> implements java.lang.Iterable<android.icu.text.AlphabeticIndex.Record<V>> {
- method public String getLabel();
- method public android.icu.text.AlphabeticIndex.Bucket.LabelType getLabelType();
- method public java.util.Iterator<android.icu.text.AlphabeticIndex.Record<V>> iterator();
- method public int size();
- }
-
- public enum AlphabeticIndex.Bucket.LabelType {
- enum_constant public static final android.icu.text.AlphabeticIndex.Bucket.LabelType INFLOW;
- enum_constant public static final android.icu.text.AlphabeticIndex.Bucket.LabelType NORMAL;
- enum_constant public static final android.icu.text.AlphabeticIndex.Bucket.LabelType OVERFLOW;
- enum_constant public static final android.icu.text.AlphabeticIndex.Bucket.LabelType UNDERFLOW;
- }
-
- public static final class AlphabeticIndex.ImmutableIndex<V> implements java.lang.Iterable<android.icu.text.AlphabeticIndex.Bucket<V>> {
- method public android.icu.text.AlphabeticIndex.Bucket<V> getBucket(int);
- method public int getBucketCount();
- method public int getBucketIndex(CharSequence);
- method public java.util.Iterator<android.icu.text.AlphabeticIndex.Bucket<V>> iterator();
- }
-
- public static class AlphabeticIndex.Record<V> {
- method public V getData();
- method public CharSequence getName();
- }
-
- public class Bidi {
- ctor public Bidi();
- ctor public Bidi(int, int);
- ctor public Bidi(String, int);
- ctor public Bidi(java.text.AttributedCharacterIterator);
- ctor public Bidi(char[], int, byte[], int, int, int);
- method public boolean baseIsLeftToRight();
- method public int countParagraphs();
- method public int countRuns();
- method public android.icu.text.Bidi createLineBidi(int, int);
- method public static byte getBaseDirection(CharSequence);
- method public int getBaseLevel();
- method public android.icu.text.BidiClassifier getCustomClassifier();
- method public int getCustomizedClass(int);
- method public byte getDirection();
- method public int getLength();
- method public byte getLevelAt(int);
- method public byte[] getLevels();
- method public int getLogicalIndex(int);
- method public int[] getLogicalMap();
- method public android.icu.text.BidiRun getLogicalRun(int);
- method public byte getParaLevel();
- method public android.icu.text.BidiRun getParagraph(int);
- method public android.icu.text.BidiRun getParagraphByIndex(int);
- method public int getParagraphIndex(int);
- method public int getProcessedLength();
- method public int getReorderingMode();
- method public int getReorderingOptions();
- method public int getResultLength();
- method public int getRunCount();
- method public int getRunLevel(int);
- method public int getRunLimit(int);
- method public int getRunStart(int);
- method public char[] getText();
- method public String getTextAsString();
- method public int getVisualIndex(int);
- method public int[] getVisualMap();
- method public android.icu.text.BidiRun getVisualRun(int);
- method public static int[] invertMap(int[]);
- method public boolean isInverse();
- method public boolean isLeftToRight();
- method public boolean isMixed();
- method public boolean isOrderParagraphsLTR();
- method public boolean isRightToLeft();
- method public void orderParagraphsLTR(boolean);
- method public static int[] reorderLogical(byte[]);
- method public static int[] reorderVisual(byte[]);
- method public static void reorderVisually(byte[], int, Object[], int, int);
- method public static boolean requiresBidi(char[], int, int);
- method public void setContext(String, String);
- method public void setCustomClassifier(android.icu.text.BidiClassifier);
- method public void setInverse(boolean);
- method public android.icu.text.Bidi setLine(int, int);
- method public void setPara(String, byte, byte[]);
- method public void setPara(char[], byte, byte[]);
- method public void setPara(java.text.AttributedCharacterIterator);
- method public void setReorderingMode(int);
- method public void setReorderingOptions(int);
- method public String writeReordered(int);
- method public static String writeReverse(String, int);
- field public static final int DIRECTION_DEFAULT_LEFT_TO_RIGHT = 126; // 0x7e
- field public static final int DIRECTION_DEFAULT_RIGHT_TO_LEFT = 127; // 0x7f
- field public static final int DIRECTION_LEFT_TO_RIGHT = 0; // 0x0
- field public static final int DIRECTION_RIGHT_TO_LEFT = 1; // 0x1
- field public static final short DO_MIRRORING = 2; // 0x2
- field public static final short INSERT_LRM_FOR_NUMERIC = 4; // 0x4
- field public static final short KEEP_BASE_COMBINING = 1; // 0x1
- field public static final byte LEVEL_DEFAULT_LTR = 126; // 0x7e
- field public static final byte LEVEL_DEFAULT_RTL = 127; // 0x7f
- field public static final byte LEVEL_OVERRIDE = -128; // 0xffffff80
- field public static final byte LTR = 0; // 0x0
- field public static final int MAP_NOWHERE = -1; // 0xffffffff
- field public static final byte MAX_EXPLICIT_LEVEL = 125; // 0x7d
- field public static final byte MIXED = 2; // 0x2
- field public static final byte NEUTRAL = 3; // 0x3
- field public static final int OPTION_DEFAULT = 0; // 0x0
- field public static final int OPTION_INSERT_MARKS = 1; // 0x1
- field public static final int OPTION_REMOVE_CONTROLS = 2; // 0x2
- field public static final int OPTION_STREAMING = 4; // 0x4
- field public static final short OUTPUT_REVERSE = 16; // 0x10
- field public static final short REMOVE_BIDI_CONTROLS = 8; // 0x8
- field public static final short REORDER_DEFAULT = 0; // 0x0
- field public static final short REORDER_GROUP_NUMBERS_WITH_R = 2; // 0x2
- field public static final short REORDER_INVERSE_FOR_NUMBERS_SPECIAL = 6; // 0x6
- field public static final short REORDER_INVERSE_LIKE_DIRECT = 5; // 0x5
- field public static final short REORDER_INVERSE_NUMBERS_AS_L = 4; // 0x4
- field public static final short REORDER_NUMBERS_SPECIAL = 1; // 0x1
- field public static final short REORDER_RUNS_ONLY = 3; // 0x3
- field public static final byte RTL = 1; // 0x1
- }
-
- public class BidiClassifier {
- ctor public BidiClassifier(Object);
- method public int classify(int);
- method public Object getContext();
- method public void setContext(Object);
- }
-
- public class BidiRun {
- method public byte getDirection();
- method public byte getEmbeddingLevel();
- method public int getLength();
- method public int getLimit();
- method public int getStart();
- method public boolean isEvenRun();
- method public boolean isOddRun();
- }
-
- public abstract class BreakIterator implements java.lang.Cloneable {
- ctor protected BreakIterator();
- method public Object clone();
- method public abstract int current();
- method public abstract int first();
- method public abstract int following(int);
- method public static java.util.Locale[] getAvailableLocales();
- method public static android.icu.text.BreakIterator getCharacterInstance();
- method public static android.icu.text.BreakIterator getCharacterInstance(java.util.Locale);
- method public static android.icu.text.BreakIterator getCharacterInstance(android.icu.util.ULocale);
- method public static android.icu.text.BreakIterator getLineInstance();
- method public static android.icu.text.BreakIterator getLineInstance(java.util.Locale);
- method public static android.icu.text.BreakIterator getLineInstance(android.icu.util.ULocale);
- method public int getRuleStatus();
- method public int getRuleStatusVec(int[]);
- method public static android.icu.text.BreakIterator getSentenceInstance();
- method public static android.icu.text.BreakIterator getSentenceInstance(java.util.Locale);
- method public static android.icu.text.BreakIterator getSentenceInstance(android.icu.util.ULocale);
- method public abstract java.text.CharacterIterator getText();
- method @Deprecated public static android.icu.text.BreakIterator getTitleInstance();
- method @Deprecated public static android.icu.text.BreakIterator getTitleInstance(java.util.Locale);
- method @Deprecated public static android.icu.text.BreakIterator getTitleInstance(android.icu.util.ULocale);
- method public static android.icu.text.BreakIterator getWordInstance();
- method public static android.icu.text.BreakIterator getWordInstance(java.util.Locale);
- method public static android.icu.text.BreakIterator getWordInstance(android.icu.util.ULocale);
- method public boolean isBoundary(int);
- method public abstract int last();
- method public abstract int next(int);
- method public abstract int next();
- method public int preceding(int);
- method public abstract int previous();
- method public void setText(String);
- method public void setText(CharSequence);
- method public abstract void setText(java.text.CharacterIterator);
- field public static final int DONE = -1; // 0xffffffff
- field public static final int KIND_CHARACTER = 0; // 0x0
- field public static final int KIND_LINE = 2; // 0x2
- field public static final int KIND_SENTENCE = 3; // 0x3
- field @Deprecated public static final int KIND_TITLE = 4; // 0x4
- field public static final int KIND_WORD = 1; // 0x1
- field public static final int WORD_IDEO = 400; // 0x190
- field public static final int WORD_IDEO_LIMIT = 500; // 0x1f4
- field public static final int WORD_KANA = 300; // 0x12c
- field public static final int WORD_KANA_LIMIT = 400; // 0x190
- field public static final int WORD_LETTER = 200; // 0xc8
- field public static final int WORD_LETTER_LIMIT = 300; // 0x12c
- field public static final int WORD_NONE = 0; // 0x0
- field public static final int WORD_NONE_LIMIT = 100; // 0x64
- field public static final int WORD_NUMBER = 100; // 0x64
- field public static final int WORD_NUMBER_LIMIT = 200; // 0xc8
- }
-
- public abstract class CaseMap {
- method public static android.icu.text.CaseMap.Fold fold();
- method public abstract android.icu.text.CaseMap omitUnchangedText();
- method public static android.icu.text.CaseMap.Lower toLower();
- method public static android.icu.text.CaseMap.Title toTitle();
- method public static android.icu.text.CaseMap.Upper toUpper();
- }
-
- public static final class CaseMap.Fold extends android.icu.text.CaseMap {
- method public String apply(CharSequence);
- method public <A extends java.lang.Appendable> A apply(CharSequence, A, android.icu.text.Edits);
- method public android.icu.text.CaseMap.Fold omitUnchangedText();
- method public android.icu.text.CaseMap.Fold turkic();
- }
-
- public static final class CaseMap.Lower extends android.icu.text.CaseMap {
- method public String apply(java.util.Locale, CharSequence);
- method public <A extends java.lang.Appendable> A apply(java.util.Locale, CharSequence, A, android.icu.text.Edits);
- method public android.icu.text.CaseMap.Lower omitUnchangedText();
- }
-
- public static final class CaseMap.Title extends android.icu.text.CaseMap {
- method public android.icu.text.CaseMap.Title adjustToCased();
- method public String apply(java.util.Locale, android.icu.text.BreakIterator, CharSequence);
- method public <A extends java.lang.Appendable> A apply(java.util.Locale, android.icu.text.BreakIterator, CharSequence, A, android.icu.text.Edits);
- method public android.icu.text.CaseMap.Title noBreakAdjustment();
- method public android.icu.text.CaseMap.Title noLowercase();
- method public android.icu.text.CaseMap.Title omitUnchangedText();
- method public android.icu.text.CaseMap.Title sentences();
- method public android.icu.text.CaseMap.Title wholeString();
- }
-
- public static final class CaseMap.Upper extends android.icu.text.CaseMap {
- method public String apply(java.util.Locale, CharSequence);
- method public <A extends java.lang.Appendable> A apply(java.util.Locale, CharSequence, A, android.icu.text.Edits);
- method public android.icu.text.CaseMap.Upper omitUnchangedText();
- }
-
- public final class CollationElementIterator {
- method public int getMaxExpansion(int);
- method public int getOffset();
- method public int next();
- method public int previous();
- method public static int primaryOrder(int);
- method public void reset();
- method public static int secondaryOrder(int);
- method public void setOffset(int);
- method public void setText(String);
- method public void setText(android.icu.text.UCharacterIterator);
- method public void setText(java.text.CharacterIterator);
- method public static int tertiaryOrder(int);
- field public static final int IGNORABLE = 0; // 0x0
- field public static final int NULLORDER = -1; // 0xffffffff
- }
-
- public final class CollationKey implements java.lang.Comparable<android.icu.text.CollationKey> {
- ctor public CollationKey(String, byte[]);
- method public int compareTo(android.icu.text.CollationKey);
- method public boolean equals(android.icu.text.CollationKey);
- method public android.icu.text.CollationKey getBound(int, int);
- method public String getSourceString();
- method public android.icu.text.CollationKey merge(android.icu.text.CollationKey);
- method public byte[] toByteArray();
- }
-
- public static final class CollationKey.BoundMode {
- field public static final int LOWER = 0; // 0x0
- field public static final int UPPER = 1; // 0x1
- field public static final int UPPER_LONG = 2; // 0x2
- }
-
- public abstract class Collator implements java.lang.Cloneable java.util.Comparator<java.lang.Object> android.icu.util.Freezable<android.icu.text.Collator> {
- ctor protected Collator();
- method public Object clone() throws java.lang.CloneNotSupportedException;
- method public android.icu.text.Collator cloneAsThawed();
- method public abstract int compare(String, String);
- method public int compare(Object, Object);
- method public boolean equals(String, String);
- method public android.icu.text.Collator freeze();
- method public static java.util.Locale[] getAvailableLocales();
- method public static final android.icu.util.ULocale[] getAvailableULocales();
- method public abstract android.icu.text.CollationKey getCollationKey(String);
- method public int getDecomposition();
- method public static String getDisplayName(java.util.Locale, java.util.Locale);
- method public static String getDisplayName(android.icu.util.ULocale, android.icu.util.ULocale);
- method public static String getDisplayName(java.util.Locale);
- method public static String getDisplayName(android.icu.util.ULocale);
- method public static int[] getEquivalentReorderCodes(int);
- method public static final android.icu.util.ULocale getFunctionalEquivalent(String, android.icu.util.ULocale, boolean[]);
- method public static final android.icu.util.ULocale getFunctionalEquivalent(String, android.icu.util.ULocale);
- method public static final android.icu.text.Collator getInstance();
- method public static final android.icu.text.Collator getInstance(android.icu.util.ULocale);
- method public static final android.icu.text.Collator getInstance(java.util.Locale);
- method public static final String[] getKeywordValues(String);
- method public static final String[] getKeywordValuesForLocale(String, android.icu.util.ULocale, boolean);
- method public static final String[] getKeywords();
- method public int getMaxVariable();
- method public int[] getReorderCodes();
- method public int getStrength();
- method public android.icu.text.UnicodeSet getTailoredSet();
- method public abstract android.icu.util.VersionInfo getUCAVersion();
- method public abstract int getVariableTop();
- method public abstract android.icu.util.VersionInfo getVersion();
- method public boolean isFrozen();
- method public void setDecomposition(int);
- method public android.icu.text.Collator setMaxVariable(int);
- method public void setReorderCodes(int...);
- method public void setStrength(int);
- field public static final int CANONICAL_DECOMPOSITION = 17; // 0x11
- field public static final int FULL_DECOMPOSITION = 15; // 0xf
- field public static final int IDENTICAL = 15; // 0xf
- field public static final int NO_DECOMPOSITION = 16; // 0x10
- field public static final int PRIMARY = 0; // 0x0
- field public static final int QUATERNARY = 3; // 0x3
- field public static final int SECONDARY = 1; // 0x1
- field public static final int TERTIARY = 2; // 0x2
- }
-
- public static interface Collator.ReorderCodes {
- field public static final int CURRENCY = 4099; // 0x1003
- field public static final int DEFAULT = -1; // 0xffffffff
- field public static final int DIGIT = 4100; // 0x1004
- field public static final int FIRST = 4096; // 0x1000
- field public static final int NONE = 103; // 0x67
- field public static final int OTHERS = 103; // 0x67
- field public static final int PUNCTUATION = 4097; // 0x1001
- field public static final int SPACE = 4096; // 0x1000
- field public static final int SYMBOL = 4098; // 0x1002
- }
-
- public class CompactDecimalFormat extends android.icu.text.DecimalFormat {
- method public static android.icu.text.CompactDecimalFormat getInstance(android.icu.util.ULocale, android.icu.text.CompactDecimalFormat.CompactStyle);
- method public static android.icu.text.CompactDecimalFormat getInstance(java.util.Locale, android.icu.text.CompactDecimalFormat.CompactStyle);
- }
-
- public enum CompactDecimalFormat.CompactStyle {
- enum_constant public static final android.icu.text.CompactDecimalFormat.CompactStyle LONG;
- enum_constant public static final android.icu.text.CompactDecimalFormat.CompactStyle SHORT;
- }
-
- public class CurrencyPluralInfo implements java.lang.Cloneable java.io.Serializable {
- ctor public CurrencyPluralInfo();
- ctor public CurrencyPluralInfo(java.util.Locale);
- ctor public CurrencyPluralInfo(android.icu.util.ULocale);
- method public Object clone();
- method public String getCurrencyPluralPattern(String);
- method public static android.icu.text.CurrencyPluralInfo getInstance();
- method public static android.icu.text.CurrencyPluralInfo getInstance(java.util.Locale);
- method public static android.icu.text.CurrencyPluralInfo getInstance(android.icu.util.ULocale);
- method public android.icu.util.ULocale getLocale();
- method public android.icu.text.PluralRules getPluralRules();
- method public void setCurrencyPluralPattern(String, String);
- method public void setLocale(android.icu.util.ULocale);
- method public void setPluralRules(String);
- }
-
- public abstract class DateFormat extends android.icu.text.UFormat {
- ctor protected DateFormat();
- method public final StringBuffer format(Object, StringBuffer, java.text.FieldPosition);
- method public abstract StringBuffer format(android.icu.util.Calendar, StringBuffer, java.text.FieldPosition);
- method public StringBuffer format(java.util.Date, StringBuffer, java.text.FieldPosition);
- method public final String format(java.util.Date);
- method public static java.util.Locale[] getAvailableLocales();
- method public boolean getBooleanAttribute(android.icu.text.DateFormat.BooleanAttribute);
- method public android.icu.util.Calendar getCalendar();
- method public android.icu.text.DisplayContext getContext(android.icu.text.DisplayContext.Type);
- method public static final android.icu.text.DateFormat getDateInstance();
- method public static final android.icu.text.DateFormat getDateInstance(int);
- method public static final android.icu.text.DateFormat getDateInstance(int, java.util.Locale);
- method public static final android.icu.text.DateFormat getDateInstance(int, android.icu.util.ULocale);
- method public static final android.icu.text.DateFormat getDateInstance(android.icu.util.Calendar, int, java.util.Locale);
- method public static final android.icu.text.DateFormat getDateInstance(android.icu.util.Calendar, int, android.icu.util.ULocale);
- method public static final android.icu.text.DateFormat getDateInstance(android.icu.util.Calendar, int);
- method public static final android.icu.text.DateFormat getDateTimeInstance();
- method public static final android.icu.text.DateFormat getDateTimeInstance(int, int);
- method public static final android.icu.text.DateFormat getDateTimeInstance(int, int, java.util.Locale);
- method public static final android.icu.text.DateFormat getDateTimeInstance(int, int, android.icu.util.ULocale);
- method public static final android.icu.text.DateFormat getDateTimeInstance(android.icu.util.Calendar, int, int, java.util.Locale);
- method public static final android.icu.text.DateFormat getDateTimeInstance(android.icu.util.Calendar, int, int, android.icu.util.ULocale);
- method public static final android.icu.text.DateFormat getDateTimeInstance(android.icu.util.Calendar, int, int);
- method public static final android.icu.text.DateFormat getInstance();
- method public static final android.icu.text.DateFormat getInstance(android.icu.util.Calendar, java.util.Locale);
- method public static final android.icu.text.DateFormat getInstance(android.icu.util.Calendar);
- method public static final android.icu.text.DateFormat getInstanceForSkeleton(String);
- method public static final android.icu.text.DateFormat getInstanceForSkeleton(String, java.util.Locale);
- method public static final android.icu.text.DateFormat getInstanceForSkeleton(String, android.icu.util.ULocale);
- method public static final android.icu.text.DateFormat getInstanceForSkeleton(android.icu.util.Calendar, String, java.util.Locale);
- method public static final android.icu.text.DateFormat getInstanceForSkeleton(android.icu.util.Calendar, String, android.icu.util.ULocale);
- method public android.icu.text.NumberFormat getNumberFormat();
- method public static final android.icu.text.DateFormat getPatternInstance(String);
- method public static final android.icu.text.DateFormat getPatternInstance(String, java.util.Locale);
- method public static final android.icu.text.DateFormat getPatternInstance(String, android.icu.util.ULocale);
- method public static final android.icu.text.DateFormat getPatternInstance(android.icu.util.Calendar, String, java.util.Locale);
- method public static final android.icu.text.DateFormat getPatternInstance(android.icu.util.Calendar, String, android.icu.util.ULocale);
- method public static final android.icu.text.DateFormat getTimeInstance();
- method public static final android.icu.text.DateFormat getTimeInstance(int);
- method public static final android.icu.text.DateFormat getTimeInstance(int, java.util.Locale);
- method public static final android.icu.text.DateFormat getTimeInstance(int, android.icu.util.ULocale);
- method public static final android.icu.text.DateFormat getTimeInstance(android.icu.util.Calendar, int, java.util.Locale);
- method public static final android.icu.text.DateFormat getTimeInstance(android.icu.util.Calendar, int, android.icu.util.ULocale);
- method public static final android.icu.text.DateFormat getTimeInstance(android.icu.util.Calendar, int);
- method public android.icu.util.TimeZone getTimeZone();
- method public boolean isCalendarLenient();
- method public boolean isLenient();
- method public java.util.Date parse(String) throws java.text.ParseException;
- method public abstract void parse(String, android.icu.util.Calendar, java.text.ParsePosition);
- method public java.util.Date parse(String, java.text.ParsePosition);
- method public Object parseObject(String, java.text.ParsePosition);
- method public android.icu.text.DateFormat setBooleanAttribute(android.icu.text.DateFormat.BooleanAttribute, boolean);
- method public void setCalendar(android.icu.util.Calendar);
- method public void setCalendarLenient(boolean);
- method public void setContext(android.icu.text.DisplayContext);
- method public void setLenient(boolean);
- method public void setNumberFormat(android.icu.text.NumberFormat);
- method public void setTimeZone(android.icu.util.TimeZone);
- field public static final String ABBR_GENERIC_TZ = "v";
- field public static final String ABBR_MONTH = "MMM";
- field public static final String ABBR_MONTH_DAY = "MMMd";
- field public static final String ABBR_MONTH_WEEKDAY_DAY = "MMMEd";
- field public static final String ABBR_QUARTER = "QQQ";
- field public static final String ABBR_SPECIFIC_TZ = "z";
- field public static final String ABBR_UTC_TZ = "ZZZZ";
- field public static final String ABBR_WEEKDAY = "E";
- field public static final int AM_PM_FIELD = 14; // 0xe
- field public static final int AM_PM_MIDNIGHT_NOON_FIELD = 35; // 0x23
- field public static final int DATE_FIELD = 3; // 0x3
- field public static final String DAY = "d";
- field public static final int DAY_OF_WEEK_FIELD = 9; // 0x9
- field public static final int DAY_OF_WEEK_IN_MONTH_FIELD = 11; // 0xb
- field public static final int DAY_OF_YEAR_FIELD = 10; // 0xa
- field public static final int DEFAULT = 2; // 0x2
- field public static final int DOW_LOCAL_FIELD = 19; // 0x13
- field public static final int ERA_FIELD = 0; // 0x0
- field public static final int EXTENDED_YEAR_FIELD = 20; // 0x14
- field public static final int FLEXIBLE_DAY_PERIOD_FIELD = 36; // 0x24
- field public static final int FRACTIONAL_SECOND_FIELD = 8; // 0x8
- field public static final int FULL = 0; // 0x0
- field public static final String GENERIC_TZ = "vvvv";
- field public static final String HOUR = "j";
- field public static final int HOUR0_FIELD = 16; // 0x10
- field public static final int HOUR1_FIELD = 15; // 0xf
- field public static final String HOUR24 = "H";
- field public static final String HOUR24_MINUTE = "Hm";
- field public static final String HOUR24_MINUTE_SECOND = "Hms";
- field public static final String HOUR_MINUTE = "jm";
- field public static final String HOUR_MINUTE_SECOND = "jms";
- field public static final int HOUR_OF_DAY0_FIELD = 5; // 0x5
- field public static final int HOUR_OF_DAY1_FIELD = 4; // 0x4
- field public static final int JULIAN_DAY_FIELD = 21; // 0x15
- field public static final String LOCATION_TZ = "VVVV";
- field public static final int LONG = 1; // 0x1
- field public static final int MEDIUM = 2; // 0x2
- field public static final int MILLISECONDS_IN_DAY_FIELD = 22; // 0x16
- field public static final int MILLISECOND_FIELD = 8; // 0x8
- field public static final String MINUTE = "m";
- field public static final int MINUTE_FIELD = 6; // 0x6
- field public static final String MINUTE_SECOND = "ms";
- field public static final String MONTH = "MMMM";
- field public static final String MONTH_DAY = "MMMMd";
- field public static final int MONTH_FIELD = 2; // 0x2
- field public static final String MONTH_WEEKDAY_DAY = "MMMMEEEEd";
- field public static final int NONE = -1; // 0xffffffff
- field public static final String NUM_MONTH = "M";
- field public static final String NUM_MONTH_DAY = "Md";
- field public static final String NUM_MONTH_WEEKDAY_DAY = "MEd";
- field public static final String QUARTER = "QQQQ";
- field public static final int QUARTER_FIELD = 27; // 0x1b
- field public static final int RELATIVE = 128; // 0x80
- field public static final int RELATIVE_DEFAULT = 130; // 0x82
- field public static final int RELATIVE_FULL = 128; // 0x80
- field public static final int RELATIVE_LONG = 129; // 0x81
- field public static final int RELATIVE_MEDIUM = 130; // 0x82
- field public static final int RELATIVE_SHORT = 131; // 0x83
- field public static final String SECOND = "s";
- field public static final int SECOND_FIELD = 7; // 0x7
- field public static final int SHORT = 3; // 0x3
- field public static final String SPECIFIC_TZ = "zzzz";
- field public static final int STANDALONE_DAY_FIELD = 25; // 0x19
- field public static final int STANDALONE_MONTH_FIELD = 26; // 0x1a
- field public static final int STANDALONE_QUARTER_FIELD = 28; // 0x1c
- field public static final int TIMEZONE_FIELD = 17; // 0x11
- field public static final int TIMEZONE_GENERIC_FIELD = 24; // 0x18
- field public static final int TIMEZONE_ISO_FIELD = 32; // 0x20
- field public static final int TIMEZONE_ISO_LOCAL_FIELD = 33; // 0x21
- field public static final int TIMEZONE_LOCALIZED_GMT_OFFSET_FIELD = 31; // 0x1f
- field public static final int TIMEZONE_RFC_FIELD = 23; // 0x17
- field public static final int TIMEZONE_SPECIAL_FIELD = 29; // 0x1d
- field public static final String WEEKDAY = "EEEE";
- field public static final int WEEK_OF_MONTH_FIELD = 13; // 0xd
- field public static final int WEEK_OF_YEAR_FIELD = 12; // 0xc
- field public static final String YEAR = "y";
- field public static final String YEAR_ABBR_MONTH = "yMMM";
- field public static final String YEAR_ABBR_MONTH_DAY = "yMMMd";
- field public static final String YEAR_ABBR_MONTH_WEEKDAY_DAY = "yMMMEd";
- field public static final String YEAR_ABBR_QUARTER = "yQQQ";
- field public static final int YEAR_FIELD = 1; // 0x1
- field public static final String YEAR_MONTH = "yMMMM";
- field public static final String YEAR_MONTH_DAY = "yMMMMd";
- field public static final String YEAR_MONTH_WEEKDAY_DAY = "yMMMMEEEEd";
- field public static final int YEAR_NAME_FIELD = 30; // 0x1e
- field public static final String YEAR_NUM_MONTH = "yM";
- field public static final String YEAR_NUM_MONTH_DAY = "yMd";
- field public static final String YEAR_NUM_MONTH_WEEKDAY_DAY = "yMEd";
- field public static final String YEAR_QUARTER = "yQQQQ";
- field public static final int YEAR_WOY_FIELD = 18; // 0x12
- field protected android.icu.util.Calendar calendar;
- field protected android.icu.text.NumberFormat numberFormat;
- }
-
- public enum DateFormat.BooleanAttribute {
- enum_constant public static final android.icu.text.DateFormat.BooleanAttribute PARSE_ALLOW_NUMERIC;
- enum_constant public static final android.icu.text.DateFormat.BooleanAttribute PARSE_ALLOW_WHITESPACE;
- enum_constant public static final android.icu.text.DateFormat.BooleanAttribute PARSE_MULTIPLE_PATTERNS_FOR_MATCH;
- enum_constant public static final android.icu.text.DateFormat.BooleanAttribute PARSE_PARTIAL_LITERAL_MATCH;
- }
-
- public static class DateFormat.Field extends java.text.Format.Field {
- ctor protected DateFormat.Field(String, int);
- method public int getCalendarField();
- method public static android.icu.text.DateFormat.Field ofCalendarField(int);
- field public static final android.icu.text.DateFormat.Field AM_PM;
- field public static final android.icu.text.DateFormat.Field AM_PM_MIDNIGHT_NOON;
- field public static final android.icu.text.DateFormat.Field DAY_OF_MONTH;
- field public static final android.icu.text.DateFormat.Field DAY_OF_WEEK;
- field public static final android.icu.text.DateFormat.Field DAY_OF_WEEK_IN_MONTH;
- field public static final android.icu.text.DateFormat.Field DAY_OF_YEAR;
- field public static final android.icu.text.DateFormat.Field DOW_LOCAL;
- field public static final android.icu.text.DateFormat.Field ERA;
- field public static final android.icu.text.DateFormat.Field EXTENDED_YEAR;
- field public static final android.icu.text.DateFormat.Field FLEXIBLE_DAY_PERIOD;
- field public static final android.icu.text.DateFormat.Field HOUR0;
- field public static final android.icu.text.DateFormat.Field HOUR1;
- field public static final android.icu.text.DateFormat.Field HOUR_OF_DAY0;
- field public static final android.icu.text.DateFormat.Field HOUR_OF_DAY1;
- field public static final android.icu.text.DateFormat.Field JULIAN_DAY;
- field public static final android.icu.text.DateFormat.Field MILLISECOND;
- field public static final android.icu.text.DateFormat.Field MILLISECONDS_IN_DAY;
- field public static final android.icu.text.DateFormat.Field MINUTE;
- field public static final android.icu.text.DateFormat.Field MONTH;
- field public static final android.icu.text.DateFormat.Field QUARTER;
- field public static final android.icu.text.DateFormat.Field SECOND;
- field public static final android.icu.text.DateFormat.Field TIME_ZONE;
- field public static final android.icu.text.DateFormat.Field WEEK_OF_MONTH;
- field public static final android.icu.text.DateFormat.Field WEEK_OF_YEAR;
- field public static final android.icu.text.DateFormat.Field YEAR;
- field public static final android.icu.text.DateFormat.Field YEAR_WOY;
- }
-
- public class DateFormatSymbols implements java.lang.Cloneable java.io.Serializable {
- ctor public DateFormatSymbols();
- ctor public DateFormatSymbols(java.util.Locale);
- ctor public DateFormatSymbols(android.icu.util.ULocale);
- ctor public DateFormatSymbols(android.icu.util.Calendar, java.util.Locale);
- ctor public DateFormatSymbols(android.icu.util.Calendar, android.icu.util.ULocale);
- ctor public DateFormatSymbols(Class<? extends android.icu.util.Calendar>, java.util.Locale);
- ctor public DateFormatSymbols(Class<? extends android.icu.util.Calendar>, android.icu.util.ULocale);
- ctor public DateFormatSymbols(java.util.ResourceBundle, java.util.Locale);
- ctor public DateFormatSymbols(java.util.ResourceBundle, android.icu.util.ULocale);
- method public Object clone();
- method public String[] getAmPmStrings();
- method public static java.util.Locale[] getAvailableLocales();
- method public String[] getEraNames();
- method public String[] getEras();
- method public static android.icu.text.DateFormatSymbols getInstance();
- method public static android.icu.text.DateFormatSymbols getInstance(java.util.Locale);
- method public static android.icu.text.DateFormatSymbols getInstance(android.icu.util.ULocale);
- method public String getLocalPatternChars();
- method public String[] getMonths();
- method public String[] getMonths(int, int);
- method public String[] getQuarters(int, int);
- method public String[] getShortMonths();
- method public String[] getShortWeekdays();
- method public String[] getWeekdays();
- method public String[] getWeekdays(int, int);
- method public String[] getYearNames(int, int);
- method public String[] getZodiacNames(int, int);
- method public String[][] getZoneStrings();
- method protected void initializeData(android.icu.util.ULocale, String);
- method public void setAmPmStrings(String[]);
- method public void setEraNames(String[]);
- method public void setEras(String[]);
- method public void setLocalPatternChars(String);
- method public void setMonths(String[]);
- method public void setMonths(String[], int, int);
- method public void setQuarters(String[], int, int);
- method public void setShortMonths(String[]);
- method public void setShortWeekdays(String[]);
- method public void setWeekdays(String[], int, int);
- method public void setWeekdays(String[]);
- method public void setYearNames(String[], int, int);
- method public void setZodiacNames(String[], int, int);
- method public void setZoneStrings(String[][]);
- field public static final int ABBREVIATED = 0; // 0x0
- field public static final int FORMAT = 0; // 0x0
- field public static final int NARROW = 2; // 0x2
- field public static final int SHORT = 3; // 0x3
- field public static final int STANDALONE = 1; // 0x1
- field public static final int WIDE = 1; // 0x1
- }
-
- public class DateIntervalFormat extends android.icu.text.UFormat {
- method public final StringBuffer format(Object, StringBuffer, java.text.FieldPosition);
- method public final StringBuffer format(android.icu.util.DateInterval, StringBuffer, java.text.FieldPosition);
- method public final StringBuffer format(android.icu.util.Calendar, android.icu.util.Calendar, StringBuffer, java.text.FieldPosition);
- method public android.icu.text.DateFormat getDateFormat();
- method public android.icu.text.DateIntervalInfo getDateIntervalInfo();
- method public static final android.icu.text.DateIntervalFormat getInstance(String);
- method public static final android.icu.text.DateIntervalFormat getInstance(String, java.util.Locale);
- method public static final android.icu.text.DateIntervalFormat getInstance(String, android.icu.util.ULocale);
- method public static final android.icu.text.DateIntervalFormat getInstance(String, android.icu.text.DateIntervalInfo);
- method public static final android.icu.text.DateIntervalFormat getInstance(String, java.util.Locale, android.icu.text.DateIntervalInfo);
- method public static final android.icu.text.DateIntervalFormat getInstance(String, android.icu.util.ULocale, android.icu.text.DateIntervalInfo);
- method public android.icu.util.TimeZone getTimeZone();
- method @Deprecated public Object parseObject(String, java.text.ParsePosition);
- method public void setDateIntervalInfo(android.icu.text.DateIntervalInfo);
- method public void setTimeZone(android.icu.util.TimeZone);
- }
-
- public class DateIntervalInfo implements java.lang.Cloneable android.icu.util.Freezable<android.icu.text.DateIntervalInfo> java.io.Serializable {
- ctor public DateIntervalInfo(android.icu.util.ULocale);
- ctor public DateIntervalInfo(java.util.Locale);
- method public Object clone();
- method public android.icu.text.DateIntervalInfo cloneAsThawed();
- method public android.icu.text.DateIntervalInfo freeze();
- method public boolean getDefaultOrder();
- method public String getFallbackIntervalPattern();
- method public android.icu.text.DateIntervalInfo.PatternInfo getIntervalPattern(String, int);
- method public boolean isFrozen();
- method public void setFallbackIntervalPattern(String);
- method public void setIntervalPattern(String, int, String);
- }
-
- public static final class DateIntervalInfo.PatternInfo implements java.lang.Cloneable java.io.Serializable {
- ctor public DateIntervalInfo.PatternInfo(String, String, boolean);
- method public boolean firstDateInPtnIsLaterDate();
- method public String getFirstPart();
- method public String getSecondPart();
- }
-
- public class DateTimePatternGenerator implements java.lang.Cloneable android.icu.util.Freezable<android.icu.text.DateTimePatternGenerator> {
- ctor protected DateTimePatternGenerator();
- method public android.icu.text.DateTimePatternGenerator addPattern(String, boolean, android.icu.text.DateTimePatternGenerator.PatternInfo);
- method public Object clone();
- method public android.icu.text.DateTimePatternGenerator cloneAsThawed();
- method public android.icu.text.DateTimePatternGenerator freeze();
- method public String getAppendItemFormat(int);
- method public String getAppendItemName(int);
- method public String getBaseSkeleton(String);
- method public java.util.Set<java.lang.String> getBaseSkeletons(java.util.Set<java.lang.String>);
- method public String getBestPattern(String);
- method public String getBestPattern(String, int);
- method public String getDateTimeFormat();
- method public String getDecimal();
- method public static android.icu.text.DateTimePatternGenerator getEmptyInstance();
- method public String getFieldDisplayName(int, android.icu.text.DateTimePatternGenerator.DisplayWidth);
- method public static android.icu.text.DateTimePatternGenerator getInstance();
- method public static android.icu.text.DateTimePatternGenerator getInstance(android.icu.util.ULocale);
- method public static android.icu.text.DateTimePatternGenerator getInstance(java.util.Locale);
- method public String getSkeleton(String);
- method public java.util.Map<java.lang.String,java.lang.String> getSkeletons(java.util.Map<java.lang.String,java.lang.String>);
- method public boolean isFrozen();
- method public String replaceFieldTypes(String, String);
- method public String replaceFieldTypes(String, String, int);
- method public void setAppendItemFormat(int, String);
- method public void setAppendItemName(int, String);
- method public void setDateTimeFormat(String);
- method public void setDecimal(String);
- field public static final int DAY = 7; // 0x7
- field public static final int DAYPERIOD = 10; // 0xa
- field public static final int DAY_OF_WEEK_IN_MONTH = 9; // 0x9
- field public static final int DAY_OF_YEAR = 8; // 0x8
- field public static final int ERA = 0; // 0x0
- field public static final int FRACTIONAL_SECOND = 14; // 0xe
- field public static final int HOUR = 11; // 0xb
- field public static final int MATCH_ALL_FIELDS_LENGTH = 65535; // 0xffff
- field public static final int MATCH_HOUR_FIELD_LENGTH = 2048; // 0x800
- field public static final int MATCH_NO_OPTIONS = 0; // 0x0
- field public static final int MINUTE = 12; // 0xc
- field public static final int MONTH = 3; // 0x3
- field public static final int QUARTER = 2; // 0x2
- field public static final int SECOND = 13; // 0xd
- field public static final int WEEKDAY = 6; // 0x6
- field public static final int WEEK_OF_MONTH = 5; // 0x5
- field public static final int WEEK_OF_YEAR = 4; // 0x4
- field public static final int YEAR = 1; // 0x1
- field public static final int ZONE = 15; // 0xf
- }
-
- public enum DateTimePatternGenerator.DisplayWidth {
- enum_constant public static final android.icu.text.DateTimePatternGenerator.DisplayWidth ABBREVIATED;
- enum_constant public static final android.icu.text.DateTimePatternGenerator.DisplayWidth NARROW;
- enum_constant public static final android.icu.text.DateTimePatternGenerator.DisplayWidth WIDE;
- }
-
- public static final class DateTimePatternGenerator.PatternInfo {
- ctor public DateTimePatternGenerator.PatternInfo();
- field public static final int BASE_CONFLICT = 1; // 0x1
- field public static final int CONFLICT = 2; // 0x2
- field public static final int OK = 0; // 0x0
- field public String conflictingPattern;
- field public int status;
- }
-
- public class DecimalFormat extends android.icu.text.NumberFormat {
- ctor public DecimalFormat();
- ctor public DecimalFormat(String);
- ctor public DecimalFormat(String, android.icu.text.DecimalFormatSymbols);
- ctor public DecimalFormat(String, android.icu.text.DecimalFormatSymbols, android.icu.text.CurrencyPluralInfo, int);
- method public void applyLocalizedPattern(String);
- method public void applyPattern(String);
- method public boolean areSignificantDigitsUsed();
- method public StringBuffer format(double, StringBuffer, java.text.FieldPosition);
- method public StringBuffer format(long, StringBuffer, java.text.FieldPosition);
- method public StringBuffer format(java.math.BigInteger, StringBuffer, java.text.FieldPosition);
- method public StringBuffer format(java.math.BigDecimal, StringBuffer, java.text.FieldPosition);
- method public StringBuffer format(android.icu.math.BigDecimal, StringBuffer, java.text.FieldPosition);
- method public android.icu.text.CurrencyPluralInfo getCurrencyPluralInfo();
- method public android.icu.util.Currency.CurrencyUsage getCurrencyUsage();
- method public android.icu.text.DecimalFormatSymbols getDecimalFormatSymbols();
- method public int getFormatWidth();
- method public int getGroupingSize();
- method public java.math.MathContext getMathContext();
- method public android.icu.math.MathContext getMathContextICU();
- method public int getMaximumSignificantDigits();
- method public byte getMinimumExponentDigits();
- method public int getMinimumSignificantDigits();
- method public int getMultiplier();
- method public String getNegativePrefix();
- method public String getNegativeSuffix();
- method public char getPadCharacter();
- method public int getPadPosition();
- method @Deprecated public int getParseMaxDigits();
- method public String getPositivePrefix();
- method public String getPositiveSuffix();
- method public java.math.BigDecimal getRoundingIncrement();
- method public int getSecondaryGroupingSize();
- method public boolean isDecimalPatternMatchRequired();
- method public boolean isDecimalSeparatorAlwaysShown();
- method public boolean isExponentSignAlwaysShown();
- method public boolean isParseBigDecimal();
- method public boolean isScientificNotation();
- method public Number parse(String, java.text.ParsePosition);
- method public void setCurrencyPluralInfo(android.icu.text.CurrencyPluralInfo);
- method public void setCurrencyUsage(android.icu.util.Currency.CurrencyUsage);
- method public void setDecimalFormatSymbols(android.icu.text.DecimalFormatSymbols);
- method public void setDecimalPatternMatchRequired(boolean);
- method public void setDecimalSeparatorAlwaysShown(boolean);
- method public void setExponentSignAlwaysShown(boolean);
- method public void setFormatWidth(int);
- method public void setGroupingSize(int);
- method public void setMathContext(java.math.MathContext);
- method public void setMathContextICU(android.icu.math.MathContext);
- method public void setMaximumSignificantDigits(int);
- method public void setMinimumExponentDigits(byte);
- method public void setMinimumSignificantDigits(int);
- method public void setMultiplier(int);
- method public void setNegativePrefix(String);
- method public void setNegativeSuffix(String);
- method public void setPadCharacter(char);
- method public void setPadPosition(int);
- method public void setParseBigDecimal(boolean);
- method @Deprecated public void setParseMaxDigits(int);
- method public void setPositivePrefix(String);
- method public void setPositiveSuffix(String);
- method public void setRoundingIncrement(java.math.BigDecimal);
- method public void setRoundingIncrement(android.icu.math.BigDecimal);
- method public void setRoundingIncrement(double);
- method public void setScientificNotation(boolean);
- method public void setSecondaryGroupingSize(int);
- method public void setSignificantDigitsUsed(boolean);
- method public String toLocalizedPattern();
- method public String toPattern();
- field public static final int PAD_AFTER_PREFIX = 1; // 0x1
- field public static final int PAD_AFTER_SUFFIX = 3; // 0x3
- field public static final int PAD_BEFORE_PREFIX = 0; // 0x0
- field public static final int PAD_BEFORE_SUFFIX = 2; // 0x2
- }
-
- public class DecimalFormatSymbols implements java.lang.Cloneable java.io.Serializable {
- ctor public DecimalFormatSymbols();
- ctor public DecimalFormatSymbols(java.util.Locale);
- ctor public DecimalFormatSymbols(android.icu.util.ULocale);
- method public Object clone();
- method public static android.icu.text.DecimalFormatSymbols forNumberingSystem(java.util.Locale, android.icu.text.NumberingSystem);
- method public static android.icu.text.DecimalFormatSymbols forNumberingSystem(android.icu.util.ULocale, android.icu.text.NumberingSystem);
- method public static java.util.Locale[] getAvailableLocales();
- method public android.icu.util.Currency getCurrency();
- method public String getCurrencySymbol();
- method public char getDecimalSeparator();
- method public String getDecimalSeparatorString();
- method public char getDigit();
- method public String[] getDigitStrings();
- method public char[] getDigits();
- method public String getExponentMultiplicationSign();
- method public String getExponentSeparator();
- method public char getGroupingSeparator();
- method public String getGroupingSeparatorString();
- method public String getInfinity();
- method public static android.icu.text.DecimalFormatSymbols getInstance();
- method public static android.icu.text.DecimalFormatSymbols getInstance(java.util.Locale);
- method public static android.icu.text.DecimalFormatSymbols getInstance(android.icu.util.ULocale);
- method public String getInternationalCurrencySymbol();
- method public java.util.Locale getLocale();
- method public char getMinusSign();
- method public String getMinusSignString();
- method public char getMonetaryDecimalSeparator();
- method public String getMonetaryDecimalSeparatorString();
- method public char getMonetaryGroupingSeparator();
- method public String getMonetaryGroupingSeparatorString();
- method public String getNaN();
- method public char getPadEscape();
- method public String getPatternForCurrencySpacing(int, boolean);
- method public char getPatternSeparator();
- method public char getPerMill();
- method public String getPerMillString();
- method public char getPercent();
- method public String getPercentString();
- method public char getPlusSign();
- method public String getPlusSignString();
- method public char getSignificantDigit();
- method public android.icu.util.ULocale getULocale();
- method public char getZeroDigit();
- method public void setCurrency(android.icu.util.Currency);
- method public void setCurrencySymbol(String);
- method public void setDecimalSeparator(char);
- method public void setDecimalSeparatorString(String);
- method public void setDigit(char);
- method public void setDigitStrings(String[]);
- method public void setExponentMultiplicationSign(String);
- method public void setExponentSeparator(String);
- method public void setGroupingSeparator(char);
- method public void setGroupingSeparatorString(String);
- method public void setInfinity(String);
- method public void setInternationalCurrencySymbol(String);
- method public void setMinusSign(char);
- method public void setMinusSignString(String);
- method public void setMonetaryDecimalSeparator(char);
- method public void setMonetaryDecimalSeparatorString(String);
- method public void setMonetaryGroupingSeparator(char);
- method public void setMonetaryGroupingSeparatorString(String);
- method public void setNaN(String);
- method public void setPadEscape(char);
- method public void setPatternForCurrencySpacing(int, boolean, String);
- method public void setPatternSeparator(char);
- method public void setPerMill(char);
- method public void setPerMillString(String);
- method public void setPercent(char);
- method public void setPercentString(String);
- method public void setPlusSign(char);
- method public void setPlusSignString(String);
- method public void setSignificantDigit(char);
- method public void setZeroDigit(char);
- field public static final int CURRENCY_SPC_CURRENCY_MATCH = 0; // 0x0
- field public static final int CURRENCY_SPC_INSERT = 2; // 0x2
- field public static final int CURRENCY_SPC_SURROUNDING_MATCH = 1; // 0x1
- }
-
- public enum DisplayContext {
- method public android.icu.text.DisplayContext.Type type();
- method public int value();
- enum_constant public static final android.icu.text.DisplayContext CAPITALIZATION_FOR_BEGINNING_OF_SENTENCE;
- enum_constant public static final android.icu.text.DisplayContext CAPITALIZATION_FOR_MIDDLE_OF_SENTENCE;
- enum_constant public static final android.icu.text.DisplayContext CAPITALIZATION_FOR_STANDALONE;
- enum_constant public static final android.icu.text.DisplayContext CAPITALIZATION_FOR_UI_LIST_OR_MENU;
- enum_constant public static final android.icu.text.DisplayContext CAPITALIZATION_NONE;
- enum_constant public static final android.icu.text.DisplayContext DIALECT_NAMES;
- enum_constant public static final android.icu.text.DisplayContext LENGTH_FULL;
- enum_constant public static final android.icu.text.DisplayContext LENGTH_SHORT;
- enum_constant public static final android.icu.text.DisplayContext NO_SUBSTITUTE;
- enum_constant public static final android.icu.text.DisplayContext STANDARD_NAMES;
- enum_constant public static final android.icu.text.DisplayContext SUBSTITUTE;
- }
-
- public enum DisplayContext.Type {
- enum_constant public static final android.icu.text.DisplayContext.Type CAPITALIZATION;
- enum_constant public static final android.icu.text.DisplayContext.Type DIALECT_HANDLING;
- enum_constant public static final android.icu.text.DisplayContext.Type DISPLAY_LENGTH;
- enum_constant public static final android.icu.text.DisplayContext.Type SUBSTITUTE_HANDLING;
- }
-
- public final class Edits {
- ctor public Edits();
- method public void addReplace(int, int);
- method public void addUnchanged(int);
- method public android.icu.text.Edits.Iterator getCoarseChangesIterator();
- method public android.icu.text.Edits.Iterator getCoarseIterator();
- method public android.icu.text.Edits.Iterator getFineChangesIterator();
- method public android.icu.text.Edits.Iterator getFineIterator();
- method public boolean hasChanges();
- method public int lengthDelta();
- method public android.icu.text.Edits mergeAndAppend(android.icu.text.Edits, android.icu.text.Edits);
- method public int numberOfChanges();
- method public void reset();
- }
-
- public static final class Edits.Iterator {
- method public int destinationIndex();
- method public int destinationIndexFromSourceIndex(int);
- method public boolean findDestinationIndex(int);
- method public boolean findSourceIndex(int);
- method public boolean hasChange();
- method public int newLength();
- method public boolean next();
- method public int oldLength();
- method public int replacementIndex();
- method public int sourceIndex();
- method public int sourceIndexFromDestinationIndex(int);
- }
-
- public abstract class IDNA {
- method public static android.icu.text.IDNA getUTS46Instance(int);
- method public abstract StringBuilder labelToASCII(CharSequence, StringBuilder, android.icu.text.IDNA.Info);
- method public abstract StringBuilder labelToUnicode(CharSequence, StringBuilder, android.icu.text.IDNA.Info);
- method public abstract StringBuilder nameToASCII(CharSequence, StringBuilder, android.icu.text.IDNA.Info);
- method public abstract StringBuilder nameToUnicode(CharSequence, StringBuilder, android.icu.text.IDNA.Info);
- field public static final int CHECK_BIDI = 4; // 0x4
- field public static final int CHECK_CONTEXTJ = 8; // 0x8
- field public static final int CHECK_CONTEXTO = 64; // 0x40
- field public static final int DEFAULT = 0; // 0x0
- field public static final int NONTRANSITIONAL_TO_ASCII = 16; // 0x10
- field public static final int NONTRANSITIONAL_TO_UNICODE = 32; // 0x20
- field public static final int USE_STD3_RULES = 2; // 0x2
- }
-
- public enum IDNA.Error {
- enum_constant public static final android.icu.text.IDNA.Error BIDI;
- enum_constant public static final android.icu.text.IDNA.Error CONTEXTJ;
- enum_constant public static final android.icu.text.IDNA.Error CONTEXTO_DIGITS;
- enum_constant public static final android.icu.text.IDNA.Error CONTEXTO_PUNCTUATION;
- enum_constant public static final android.icu.text.IDNA.Error DISALLOWED;
- enum_constant public static final android.icu.text.IDNA.Error DOMAIN_NAME_TOO_LONG;
- enum_constant public static final android.icu.text.IDNA.Error EMPTY_LABEL;
- enum_constant public static final android.icu.text.IDNA.Error HYPHEN_3_4;
- enum_constant public static final android.icu.text.IDNA.Error INVALID_ACE_LABEL;
- enum_constant public static final android.icu.text.IDNA.Error LABEL_HAS_DOT;
- enum_constant public static final android.icu.text.IDNA.Error LABEL_TOO_LONG;
- enum_constant public static final android.icu.text.IDNA.Error LEADING_COMBINING_MARK;
- enum_constant public static final android.icu.text.IDNA.Error LEADING_HYPHEN;
- enum_constant public static final android.icu.text.IDNA.Error PUNYCODE;
- enum_constant public static final android.icu.text.IDNA.Error TRAILING_HYPHEN;
- }
-
- public static final class IDNA.Info {
- ctor public IDNA.Info();
- method public java.util.Set<android.icu.text.IDNA.Error> getErrors();
- method public boolean hasErrors();
- method public boolean isTransitionalDifferent();
- }
-
- public final class ListFormatter {
- method public String format(java.lang.Object...);
- method public String format(java.util.Collection<?>);
- method public static android.icu.text.ListFormatter getInstance(android.icu.util.ULocale);
- method public static android.icu.text.ListFormatter getInstance(java.util.Locale);
- method public static android.icu.text.ListFormatter getInstance();
- method public String getPatternForNumItems(int);
- }
-
- public abstract class LocaleDisplayNames {
- method public abstract android.icu.text.DisplayContext getContext(android.icu.text.DisplayContext.Type);
- method public abstract android.icu.text.LocaleDisplayNames.DialectHandling getDialectHandling();
- method public static android.icu.text.LocaleDisplayNames getInstance(android.icu.util.ULocale);
- method public static android.icu.text.LocaleDisplayNames getInstance(java.util.Locale);
- method public static android.icu.text.LocaleDisplayNames getInstance(android.icu.util.ULocale, android.icu.text.LocaleDisplayNames.DialectHandling);
- method public static android.icu.text.LocaleDisplayNames getInstance(android.icu.util.ULocale, android.icu.text.DisplayContext...);
- method public static android.icu.text.LocaleDisplayNames getInstance(java.util.Locale, android.icu.text.DisplayContext...);
- method public abstract android.icu.util.ULocale getLocale();
- method public java.util.List<android.icu.text.LocaleDisplayNames.UiListItem> getUiList(java.util.Set<android.icu.util.ULocale>, boolean, java.util.Comparator<java.lang.Object>);
- method public abstract java.util.List<android.icu.text.LocaleDisplayNames.UiListItem> getUiListCompareWholeItems(java.util.Set<android.icu.util.ULocale>, java.util.Comparator<android.icu.text.LocaleDisplayNames.UiListItem>);
- method public abstract String keyDisplayName(String);
- method public abstract String keyValueDisplayName(String, String);
- method public abstract String languageDisplayName(String);
- method public abstract String localeDisplayName(android.icu.util.ULocale);
- method public abstract String localeDisplayName(java.util.Locale);
- method public abstract String localeDisplayName(String);
- method public abstract String regionDisplayName(String);
- method public abstract String scriptDisplayName(String);
- method public abstract String scriptDisplayName(int);
- method public abstract String variantDisplayName(String);
- }
-
- public enum LocaleDisplayNames.DialectHandling {
- enum_constant public static final android.icu.text.LocaleDisplayNames.DialectHandling DIALECT_NAMES;
- enum_constant public static final android.icu.text.LocaleDisplayNames.DialectHandling STANDARD_NAMES;
- }
-
- public static class LocaleDisplayNames.UiListItem {
- ctor public LocaleDisplayNames.UiListItem(android.icu.util.ULocale, android.icu.util.ULocale, String, String);
- method public static java.util.Comparator<android.icu.text.LocaleDisplayNames.UiListItem> getComparator(java.util.Comparator<java.lang.Object>, boolean);
- field public final android.icu.util.ULocale minimized;
- field public final android.icu.util.ULocale modified;
- field public final String nameInDisplayLocale;
- field public final String nameInSelf;
- }
-
- public class MeasureFormat extends android.icu.text.UFormat {
- method public final boolean equals(Object);
- method public StringBuffer format(Object, StringBuffer, java.text.FieldPosition);
- method public StringBuilder formatMeasurePerUnit(android.icu.util.Measure, android.icu.util.MeasureUnit, StringBuilder, java.text.FieldPosition);
- method public final String formatMeasures(android.icu.util.Measure...);
- method public StringBuilder formatMeasures(StringBuilder, java.text.FieldPosition, android.icu.util.Measure...);
- method public static android.icu.text.MeasureFormat getCurrencyFormat(android.icu.util.ULocale);
- method public static android.icu.text.MeasureFormat getCurrencyFormat(java.util.Locale);
- method public static android.icu.text.MeasureFormat getCurrencyFormat();
- method public static android.icu.text.MeasureFormat getInstance(android.icu.util.ULocale, android.icu.text.MeasureFormat.FormatWidth);
- method public static android.icu.text.MeasureFormat getInstance(java.util.Locale, android.icu.text.MeasureFormat.FormatWidth);
- method public static android.icu.text.MeasureFormat getInstance(android.icu.util.ULocale, android.icu.text.MeasureFormat.FormatWidth, android.icu.text.NumberFormat);
- method public static android.icu.text.MeasureFormat getInstance(java.util.Locale, android.icu.text.MeasureFormat.FormatWidth, android.icu.text.NumberFormat);
- method public final android.icu.util.ULocale getLocale();
- method public android.icu.text.NumberFormat getNumberFormat();
- method public String getUnitDisplayName(android.icu.util.MeasureUnit);
- method public android.icu.text.MeasureFormat.FormatWidth getWidth();
- method public final int hashCode();
- method public android.icu.util.Measure parseObject(String, java.text.ParsePosition);
- }
-
- public enum MeasureFormat.FormatWidth {
- enum_constant public static final android.icu.text.MeasureFormat.FormatWidth NARROW;
- enum_constant public static final android.icu.text.MeasureFormat.FormatWidth NUMERIC;
- enum_constant public static final android.icu.text.MeasureFormat.FormatWidth SHORT;
- enum_constant public static final android.icu.text.MeasureFormat.FormatWidth WIDE;
- }
-
- public class MessageFormat extends android.icu.text.UFormat {
- ctor public MessageFormat(String);
- ctor public MessageFormat(String, java.util.Locale);
- ctor public MessageFormat(String, android.icu.util.ULocale);
- method public void applyPattern(String);
- method public void applyPattern(String, android.icu.text.MessagePattern.ApostropheMode);
- method public static String autoQuoteApostrophe(String);
- method public final StringBuffer format(Object[], StringBuffer, java.text.FieldPosition);
- method public final StringBuffer format(java.util.Map<java.lang.String,java.lang.Object>, StringBuffer, java.text.FieldPosition);
- method public static String format(String, java.lang.Object...);
- method public static String format(String, java.util.Map<java.lang.String,java.lang.Object>);
- method public final StringBuffer format(Object, StringBuffer, java.text.FieldPosition);
- method public android.icu.text.MessagePattern.ApostropheMode getApostropheMode();
- method public java.util.Set<java.lang.String> getArgumentNames();
- method public java.text.Format getFormatByArgumentName(String);
- method public java.text.Format[] getFormats();
- method public java.text.Format[] getFormatsByArgumentIndex();
- method public java.util.Locale getLocale();
- method public android.icu.util.ULocale getULocale();
- method public Object[] parse(String, java.text.ParsePosition);
- method public Object[] parse(String) throws java.text.ParseException;
- method public Object parseObject(String, java.text.ParsePosition);
- method public java.util.Map<java.lang.String,java.lang.Object> parseToMap(String, java.text.ParsePosition);
- method public java.util.Map<java.lang.String,java.lang.Object> parseToMap(String) throws java.text.ParseException;
- method public void setFormat(int, java.text.Format);
- method public void setFormatByArgumentIndex(int, java.text.Format);
- method public void setFormatByArgumentName(String, java.text.Format);
- method public void setFormats(java.text.Format[]);
- method public void setFormatsByArgumentIndex(java.text.Format[]);
- method public void setFormatsByArgumentName(java.util.Map<java.lang.String,java.text.Format>);
- method public void setLocale(java.util.Locale);
- method public void setLocale(android.icu.util.ULocale);
- method public String toPattern();
- method public boolean usesNamedArguments();
- }
-
- public static class MessageFormat.Field extends java.text.Format.Field {
- ctor protected MessageFormat.Field(String);
- field public static final android.icu.text.MessageFormat.Field ARGUMENT;
- }
-
- public final class MessagePattern implements java.lang.Cloneable android.icu.util.Freezable<android.icu.text.MessagePattern> {
- ctor public MessagePattern();
- ctor public MessagePattern(android.icu.text.MessagePattern.ApostropheMode);
- ctor public MessagePattern(String);
- method public String autoQuoteApostropheDeep();
- method public void clear();
- method public void clearPatternAndSetApostropheMode(android.icu.text.MessagePattern.ApostropheMode);
- method public Object clone();
- method public android.icu.text.MessagePattern cloneAsThawed();
- method public int countParts();
- method public android.icu.text.MessagePattern freeze();
- method public android.icu.text.MessagePattern.ApostropheMode getApostropheMode();
- method public int getLimitPartIndex(int);
- method public double getNumericValue(android.icu.text.MessagePattern.Part);
- method public android.icu.text.MessagePattern.Part getPart(int);
- method public android.icu.text.MessagePattern.Part.Type getPartType(int);
- method public int getPatternIndex(int);
- method public String getPatternString();
- method public double getPluralOffset(int);
- method public String getSubstring(android.icu.text.MessagePattern.Part);
- method public boolean hasNamedArguments();
- method public boolean hasNumberedArguments();
- method public boolean isFrozen();
- method public android.icu.text.MessagePattern parse(String);
- method public android.icu.text.MessagePattern parseChoiceStyle(String);
- method public android.icu.text.MessagePattern parsePluralStyle(String);
- method public android.icu.text.MessagePattern parseSelectStyle(String);
- method public boolean partSubstringMatches(android.icu.text.MessagePattern.Part, String);
- method public static int validateArgumentName(String);
- field public static final int ARG_NAME_NOT_NUMBER = -1; // 0xffffffff
- field public static final int ARG_NAME_NOT_VALID = -2; // 0xfffffffe
- field public static final double NO_NUMERIC_VALUE = -1.23456789E8;
- }
-
- public enum MessagePattern.ApostropheMode {
- enum_constant public static final android.icu.text.MessagePattern.ApostropheMode DOUBLE_OPTIONAL;
- enum_constant public static final android.icu.text.MessagePattern.ApostropheMode DOUBLE_REQUIRED;
- }
-
- public enum MessagePattern.ArgType {
- method public boolean hasPluralStyle();
- enum_constant public static final android.icu.text.MessagePattern.ArgType CHOICE;
- enum_constant public static final android.icu.text.MessagePattern.ArgType NONE;
- enum_constant public static final android.icu.text.MessagePattern.ArgType PLURAL;
- enum_constant public static final android.icu.text.MessagePattern.ArgType SELECT;
- enum_constant public static final android.icu.text.MessagePattern.ArgType SELECTORDINAL;
- enum_constant public static final android.icu.text.MessagePattern.ArgType SIMPLE;
- }
-
- public static final class MessagePattern.Part {
- method public android.icu.text.MessagePattern.ArgType getArgType();
- method public int getIndex();
- method public int getLength();
- method public int getLimit();
- method public android.icu.text.MessagePattern.Part.Type getType();
- method public int getValue();
- }
-
- public enum MessagePattern.Part.Type {
- method public boolean hasNumericValue();
- enum_constant public static final android.icu.text.MessagePattern.Part.Type ARG_DOUBLE;
- enum_constant public static final android.icu.text.MessagePattern.Part.Type ARG_INT;
- enum_constant public static final android.icu.text.MessagePattern.Part.Type ARG_LIMIT;
- enum_constant public static final android.icu.text.MessagePattern.Part.Type ARG_NAME;
- enum_constant public static final android.icu.text.MessagePattern.Part.Type ARG_NUMBER;
- enum_constant public static final android.icu.text.MessagePattern.Part.Type ARG_SELECTOR;
- enum_constant public static final android.icu.text.MessagePattern.Part.Type ARG_START;
- enum_constant public static final android.icu.text.MessagePattern.Part.Type ARG_STYLE;
- enum_constant public static final android.icu.text.MessagePattern.Part.Type ARG_TYPE;
- enum_constant public static final android.icu.text.MessagePattern.Part.Type INSERT_CHAR;
- enum_constant public static final android.icu.text.MessagePattern.Part.Type MSG_LIMIT;
- enum_constant public static final android.icu.text.MessagePattern.Part.Type MSG_START;
- enum_constant public static final android.icu.text.MessagePattern.Part.Type REPLACE_NUMBER;
- enum_constant public static final android.icu.text.MessagePattern.Part.Type SKIP_SYNTAX;
- }
-
- public final class Normalizer implements java.lang.Cloneable {
- method @Deprecated public Object clone();
- method public static int compare(char[], int, int, char[], int, int, int);
- method public static int compare(String, String, int);
- method public static int compare(char[], char[], int);
- method public static int compare(int, int, int);
- method public static int compare(int, String, int);
- field public static final int COMPARE_CODE_POINT_ORDER = 32768; // 0x8000
- field public static final int COMPARE_IGNORE_CASE = 65536; // 0x10000
- field public static final int FOLD_CASE_DEFAULT = 0; // 0x0
- field public static final int FOLD_CASE_EXCLUDE_SPECIAL_I = 1; // 0x1
- field public static final int INPUT_IS_FCD = 131072; // 0x20000
- field public static final android.icu.text.Normalizer.QuickCheckResult MAYBE;
- field public static final android.icu.text.Normalizer.QuickCheckResult NO;
- field public static final android.icu.text.Normalizer.QuickCheckResult YES;
- }
-
- public static final class Normalizer.QuickCheckResult {
- }
-
- public abstract class Normalizer2 {
- method public abstract StringBuilder append(StringBuilder, CharSequence);
- method public int composePair(int, int);
- method public int getCombiningClass(int);
- method public abstract String getDecomposition(int);
- method public static android.icu.text.Normalizer2 getInstance(java.io.InputStream, String, android.icu.text.Normalizer2.Mode);
- method public static android.icu.text.Normalizer2 getNFCInstance();
- method public static android.icu.text.Normalizer2 getNFDInstance();
- method public static android.icu.text.Normalizer2 getNFKCCasefoldInstance();
- method public static android.icu.text.Normalizer2 getNFKCInstance();
- method public static android.icu.text.Normalizer2 getNFKDInstance();
- method public String getRawDecomposition(int);
- method public abstract boolean hasBoundaryAfter(int);
- method public abstract boolean hasBoundaryBefore(int);
- method public abstract boolean isInert(int);
- method public abstract boolean isNormalized(CharSequence);
- method public String normalize(CharSequence);
- method public abstract StringBuilder normalize(CharSequence, StringBuilder);
- method public abstract Appendable normalize(CharSequence, Appendable);
- method public abstract StringBuilder normalizeSecondAndAppend(StringBuilder, CharSequence);
- method public abstract android.icu.text.Normalizer.QuickCheckResult quickCheck(CharSequence);
- method public abstract int spanQuickCheckYes(CharSequence);
- }
-
- public enum Normalizer2.Mode {
- enum_constant public static final android.icu.text.Normalizer2.Mode COMPOSE;
- enum_constant public static final android.icu.text.Normalizer2.Mode COMPOSE_CONTIGUOUS;
- enum_constant public static final android.icu.text.Normalizer2.Mode DECOMPOSE;
- enum_constant public static final android.icu.text.Normalizer2.Mode FCD;
- }
-
- public abstract class NumberFormat extends android.icu.text.UFormat {
- ctor public NumberFormat();
- method public StringBuffer format(Object, StringBuffer, java.text.FieldPosition);
- method public final String format(double);
- method public final String format(long);
- method public final String format(java.math.BigInteger);
- method public final String format(java.math.BigDecimal);
- method public final String format(android.icu.math.BigDecimal);
- method public final String format(android.icu.util.CurrencyAmount);
- method public abstract StringBuffer format(double, StringBuffer, java.text.FieldPosition);
- method public abstract StringBuffer format(long, StringBuffer, java.text.FieldPosition);
- method public abstract StringBuffer format(java.math.BigInteger, StringBuffer, java.text.FieldPosition);
- method public abstract StringBuffer format(java.math.BigDecimal, StringBuffer, java.text.FieldPosition);
- method public abstract StringBuffer format(android.icu.math.BigDecimal, StringBuffer, java.text.FieldPosition);
- method public StringBuffer format(android.icu.util.CurrencyAmount, StringBuffer, java.text.FieldPosition);
- method public static java.util.Locale[] getAvailableLocales();
- method public android.icu.text.DisplayContext getContext(android.icu.text.DisplayContext.Type);
- method public android.icu.util.Currency getCurrency();
- method public static final android.icu.text.NumberFormat getCurrencyInstance();
- method public static android.icu.text.NumberFormat getCurrencyInstance(java.util.Locale);
- method public static android.icu.text.NumberFormat getCurrencyInstance(android.icu.util.ULocale);
- method public static final android.icu.text.NumberFormat getInstance();
- method public static android.icu.text.NumberFormat getInstance(java.util.Locale);
- method public static android.icu.text.NumberFormat getInstance(android.icu.util.ULocale);
- method public static final android.icu.text.NumberFormat getInstance(int);
- method public static android.icu.text.NumberFormat getInstance(java.util.Locale, int);
- method public static android.icu.text.NumberFormat getInstance(android.icu.util.ULocale, int);
- method public static final android.icu.text.NumberFormat getIntegerInstance();
- method public static android.icu.text.NumberFormat getIntegerInstance(java.util.Locale);
- method public static android.icu.text.NumberFormat getIntegerInstance(android.icu.util.ULocale);
- method public int getMaximumFractionDigits();
- method public int getMaximumIntegerDigits();
- method public int getMinimumFractionDigits();
- method public int getMinimumIntegerDigits();
- method public static final android.icu.text.NumberFormat getNumberInstance();
- method public static android.icu.text.NumberFormat getNumberInstance(java.util.Locale);
- method public static android.icu.text.NumberFormat getNumberInstance(android.icu.util.ULocale);
- method protected static String getPattern(android.icu.util.ULocale, int);
- method public static final android.icu.text.NumberFormat getPercentInstance();
- method public static android.icu.text.NumberFormat getPercentInstance(java.util.Locale);
- method public static android.icu.text.NumberFormat getPercentInstance(android.icu.util.ULocale);
- method public int getRoundingMode();
- method public static final android.icu.text.NumberFormat getScientificInstance();
- method public static android.icu.text.NumberFormat getScientificInstance(java.util.Locale);
- method public static android.icu.text.NumberFormat getScientificInstance(android.icu.util.ULocale);
- method public boolean isGroupingUsed();
- method public boolean isParseIntegerOnly();
- method public boolean isParseStrict();
- method public abstract Number parse(String, java.text.ParsePosition);
- method public Number parse(String) throws java.text.ParseException;
- method public android.icu.util.CurrencyAmount parseCurrency(CharSequence, java.text.ParsePosition);
- method public final Object parseObject(String, java.text.ParsePosition);
- method public void setContext(android.icu.text.DisplayContext);
- method public void setCurrency(android.icu.util.Currency);
- method public void setGroupingUsed(boolean);
- method public void setMaximumFractionDigits(int);
- method public void setMaximumIntegerDigits(int);
- method public void setMinimumFractionDigits(int);
- method public void setMinimumIntegerDigits(int);
- method public void setParseIntegerOnly(boolean);
- method public void setParseStrict(boolean);
- method public void setRoundingMode(int);
- field public static final int ACCOUNTINGCURRENCYSTYLE = 7; // 0x7
- field public static final int CASHCURRENCYSTYLE = 8; // 0x8
- field public static final int CURRENCYSTYLE = 1; // 0x1
- field public static final int FRACTION_FIELD = 1; // 0x1
- field public static final int INTEGERSTYLE = 4; // 0x4
- field public static final int INTEGER_FIELD = 0; // 0x0
- field public static final int ISOCURRENCYSTYLE = 5; // 0x5
- field public static final int NUMBERSTYLE = 0; // 0x0
- field public static final int PERCENTSTYLE = 2; // 0x2
- field public static final int PLURALCURRENCYSTYLE = 6; // 0x6
- field public static final int SCIENTIFICSTYLE = 3; // 0x3
- field public static final int STANDARDCURRENCYSTYLE = 9; // 0x9
- }
-
- public static class NumberFormat.Field extends java.text.Format.Field {
- ctor protected NumberFormat.Field(String);
- field public static final android.icu.text.NumberFormat.Field CURRENCY;
- field public static final android.icu.text.NumberFormat.Field DECIMAL_SEPARATOR;
- field public static final android.icu.text.NumberFormat.Field EXPONENT;
- field public static final android.icu.text.NumberFormat.Field EXPONENT_SIGN;
- field public static final android.icu.text.NumberFormat.Field EXPONENT_SYMBOL;
- field public static final android.icu.text.NumberFormat.Field FRACTION;
- field public static final android.icu.text.NumberFormat.Field GROUPING_SEPARATOR;
- field public static final android.icu.text.NumberFormat.Field INTEGER;
- field public static final android.icu.text.NumberFormat.Field PERCENT;
- field public static final android.icu.text.NumberFormat.Field PERMILLE;
- field public static final android.icu.text.NumberFormat.Field SIGN;
- }
-
- public class NumberingSystem {
- ctor public NumberingSystem();
- method public static String[] getAvailableNames();
- method public String getDescription();
- method public static android.icu.text.NumberingSystem getInstance(int, boolean, String);
- method public static android.icu.text.NumberingSystem getInstance(java.util.Locale);
- method public static android.icu.text.NumberingSystem getInstance(android.icu.util.ULocale);
- method public static android.icu.text.NumberingSystem getInstance();
- method public static android.icu.text.NumberingSystem getInstanceByName(String);
- method public String getName();
- method public int getRadix();
- method public boolean isAlgorithmic();
- method public static boolean isValidDigitString(String);
- field public static final android.icu.text.NumberingSystem LATIN;
- }
-
- public class PluralFormat extends android.icu.text.UFormat {
- ctor public PluralFormat();
- ctor public PluralFormat(android.icu.util.ULocale);
- ctor public PluralFormat(java.util.Locale);
- ctor public PluralFormat(android.icu.text.PluralRules);
- ctor public PluralFormat(android.icu.util.ULocale, android.icu.text.PluralRules);
- ctor public PluralFormat(java.util.Locale, android.icu.text.PluralRules);
- ctor public PluralFormat(android.icu.util.ULocale, android.icu.text.PluralRules.PluralType);
- ctor public PluralFormat(java.util.Locale, android.icu.text.PluralRules.PluralType);
- ctor public PluralFormat(String);
- ctor public PluralFormat(android.icu.util.ULocale, String);
- ctor public PluralFormat(android.icu.text.PluralRules, String);
- ctor public PluralFormat(android.icu.util.ULocale, android.icu.text.PluralRules, String);
- ctor public PluralFormat(android.icu.util.ULocale, android.icu.text.PluralRules.PluralType, String);
- method public void applyPattern(String);
- method public boolean equals(android.icu.text.PluralFormat);
- method public final String format(double);
- method public StringBuffer format(Object, StringBuffer, java.text.FieldPosition);
- method public Number parse(String, java.text.ParsePosition);
- method public Object parseObject(String, java.text.ParsePosition);
- method public void setNumberFormat(android.icu.text.NumberFormat);
- method public String toPattern();
- }
-
- public class PluralRules implements java.io.Serializable {
- method public static android.icu.text.PluralRules createRules(String);
- method public boolean equals(android.icu.text.PluralRules);
- method public static android.icu.text.PluralRules forLocale(android.icu.util.ULocale);
- method public static android.icu.text.PluralRules forLocale(java.util.Locale);
- method public static android.icu.text.PluralRules forLocale(android.icu.util.ULocale, android.icu.text.PluralRules.PluralType);
- method public static android.icu.text.PluralRules forLocale(java.util.Locale, android.icu.text.PluralRules.PluralType);
- method public java.util.Collection<java.lang.Double> getAllKeywordValues(String);
- method public java.util.Set<java.lang.String> getKeywords();
- method public java.util.Collection<java.lang.Double> getSamples(String);
- method public double getUniqueKeywordValue(String);
- method public static android.icu.text.PluralRules parseDescription(String) throws java.text.ParseException;
- method public String select(double);
- field public static final android.icu.text.PluralRules DEFAULT;
- field public static final String KEYWORD_FEW = "few";
- field public static final String KEYWORD_MANY = "many";
- field public static final String KEYWORD_ONE = "one";
- field public static final String KEYWORD_OTHER = "other";
- field public static final String KEYWORD_TWO = "two";
- field public static final String KEYWORD_ZERO = "zero";
- field public static final double NO_UNIQUE_VALUE = -0.00123456777;
- }
-
- public enum PluralRules.PluralType {
- enum_constant public static final android.icu.text.PluralRules.PluralType CARDINAL;
- enum_constant public static final android.icu.text.PluralRules.PluralType ORDINAL;
- }
-
- public final class RelativeDateTimeFormatter {
- method public String combineDateAndTime(String, String);
- method public String format(double, android.icu.text.RelativeDateTimeFormatter.Direction, android.icu.text.RelativeDateTimeFormatter.RelativeUnit);
- method public String format(android.icu.text.RelativeDateTimeFormatter.Direction, android.icu.text.RelativeDateTimeFormatter.AbsoluteUnit);
- method public String format(double, android.icu.text.RelativeDateTimeFormatter.RelativeDateTimeUnit);
- method public String formatNumeric(double, android.icu.text.RelativeDateTimeFormatter.RelativeDateTimeUnit);
- method public android.icu.text.DisplayContext getCapitalizationContext();
- method public android.icu.text.RelativeDateTimeFormatter.Style getFormatStyle();
- method public static android.icu.text.RelativeDateTimeFormatter getInstance();
- method public static android.icu.text.RelativeDateTimeFormatter getInstance(android.icu.util.ULocale);
- method public static android.icu.text.RelativeDateTimeFormatter getInstance(java.util.Locale);
- method public static android.icu.text.RelativeDateTimeFormatter getInstance(android.icu.util.ULocale, android.icu.text.NumberFormat);
- method public static android.icu.text.RelativeDateTimeFormatter getInstance(android.icu.util.ULocale, android.icu.text.NumberFormat, android.icu.text.RelativeDateTimeFormatter.Style, android.icu.text.DisplayContext);
- method public static android.icu.text.RelativeDateTimeFormatter getInstance(java.util.Locale, android.icu.text.NumberFormat);
- method public android.icu.text.NumberFormat getNumberFormat();
- }
-
- public enum RelativeDateTimeFormatter.AbsoluteUnit {
- enum_constant public static final android.icu.text.RelativeDateTimeFormatter.AbsoluteUnit DAY;
- enum_constant public static final android.icu.text.RelativeDateTimeFormatter.AbsoluteUnit FRIDAY;
- enum_constant public static final android.icu.text.RelativeDateTimeFormatter.AbsoluteUnit MONDAY;
- enum_constant public static final android.icu.text.RelativeDateTimeFormatter.AbsoluteUnit MONTH;
- enum_constant public static final android.icu.text.RelativeDateTimeFormatter.AbsoluteUnit NOW;
- enum_constant public static final android.icu.text.RelativeDateTimeFormatter.AbsoluteUnit SATURDAY;
- enum_constant public static final android.icu.text.RelativeDateTimeFormatter.AbsoluteUnit SUNDAY;
- enum_constant public static final android.icu.text.RelativeDateTimeFormatter.AbsoluteUnit THURSDAY;
- enum_constant public static final android.icu.text.RelativeDateTimeFormatter.AbsoluteUnit TUESDAY;
- enum_constant public static final android.icu.text.RelativeDateTimeFormatter.AbsoluteUnit WEDNESDAY;
- enum_constant public static final android.icu.text.RelativeDateTimeFormatter.AbsoluteUnit WEEK;
- enum_constant public static final android.icu.text.RelativeDateTimeFormatter.AbsoluteUnit YEAR;
- }
-
- public enum RelativeDateTimeFormatter.Direction {
- enum_constant public static final android.icu.text.RelativeDateTimeFormatter.Direction LAST;
- enum_constant public static final android.icu.text.RelativeDateTimeFormatter.Direction LAST_2;
- enum_constant public static final android.icu.text.RelativeDateTimeFormatter.Direction NEXT;
- enum_constant public static final android.icu.text.RelativeDateTimeFormatter.Direction NEXT_2;
- enum_constant public static final android.icu.text.RelativeDateTimeFormatter.Direction PLAIN;
- enum_constant public static final android.icu.text.RelativeDateTimeFormatter.Direction THIS;
- }
-
- public enum RelativeDateTimeFormatter.RelativeDateTimeUnit {
- enum_constant public static final android.icu.text.RelativeDateTimeFormatter.RelativeDateTimeUnit DAY;
- enum_constant public static final android.icu.text.RelativeDateTimeFormatter.RelativeDateTimeUnit FRIDAY;
- enum_constant public static final android.icu.text.RelativeDateTimeFormatter.RelativeDateTimeUnit HOUR;
- enum_constant public static final android.icu.text.RelativeDateTimeFormatter.RelativeDateTimeUnit MINUTE;
- enum_constant public static final android.icu.text.RelativeDateTimeFormatter.RelativeDateTimeUnit MONDAY;
- enum_constant public static final android.icu.text.RelativeDateTimeFormatter.RelativeDateTimeUnit MONTH;
- enum_constant public static final android.icu.text.RelativeDateTimeFormatter.RelativeDateTimeUnit QUARTER;
- enum_constant public static final android.icu.text.RelativeDateTimeFormatter.RelativeDateTimeUnit SATURDAY;
- enum_constant public static final android.icu.text.RelativeDateTimeFormatter.RelativeDateTimeUnit SECOND;
- enum_constant public static final android.icu.text.RelativeDateTimeFormatter.RelativeDateTimeUnit SUNDAY;
- enum_constant public static final android.icu.text.RelativeDateTimeFormatter.RelativeDateTimeUnit THURSDAY;
- enum_constant public static final android.icu.text.RelativeDateTimeFormatter.RelativeDateTimeUnit TUESDAY;
- enum_constant public static final android.icu.text.RelativeDateTimeFormatter.RelativeDateTimeUnit WEDNESDAY;
- enum_constant public static final android.icu.text.RelativeDateTimeFormatter.RelativeDateTimeUnit WEEK;
- enum_constant public static final android.icu.text.RelativeDateTimeFormatter.RelativeDateTimeUnit YEAR;
- }
-
- public enum RelativeDateTimeFormatter.RelativeUnit {
- enum_constant public static final android.icu.text.RelativeDateTimeFormatter.RelativeUnit DAYS;
- enum_constant public static final android.icu.text.RelativeDateTimeFormatter.RelativeUnit HOURS;
- enum_constant public static final android.icu.text.RelativeDateTimeFormatter.RelativeUnit MINUTES;
- enum_constant public static final android.icu.text.RelativeDateTimeFormatter.RelativeUnit MONTHS;
- enum_constant public static final android.icu.text.RelativeDateTimeFormatter.RelativeUnit SECONDS;
- enum_constant public static final android.icu.text.RelativeDateTimeFormatter.RelativeUnit WEEKS;
- enum_constant public static final android.icu.text.RelativeDateTimeFormatter.RelativeUnit YEARS;
- }
-
- public enum RelativeDateTimeFormatter.Style {
- enum_constant public static final android.icu.text.RelativeDateTimeFormatter.Style LONG;
- enum_constant public static final android.icu.text.RelativeDateTimeFormatter.Style NARROW;
- enum_constant public static final android.icu.text.RelativeDateTimeFormatter.Style SHORT;
- }
-
- public interface Replaceable {
- method public int char32At(int);
- method public char charAt(int);
- method public void copy(int, int, int);
- method public void getChars(int, int, char[], int);
- method public boolean hasMetaData();
- method public int length();
- method public void replace(int, int, String);
- method public void replace(int, int, char[], int, int);
- }
-
- public final class RuleBasedCollator extends android.icu.text.Collator {
- ctor public RuleBasedCollator(String) throws java.lang.Exception;
- method public android.icu.text.RuleBasedCollator cloneAsThawed();
- method public int compare(String, String);
- method public android.icu.text.CollationElementIterator getCollationElementIterator(String);
- method public android.icu.text.CollationElementIterator getCollationElementIterator(java.text.CharacterIterator);
- method public android.icu.text.CollationElementIterator getCollationElementIterator(android.icu.text.UCharacterIterator);
- method public android.icu.text.CollationKey getCollationKey(String);
- method public void getContractionsAndExpansions(android.icu.text.UnicodeSet, android.icu.text.UnicodeSet, boolean) throws java.lang.Exception;
- method public boolean getNumericCollation();
- method public String getRules();
- method public String getRules(boolean);
- method public android.icu.util.VersionInfo getUCAVersion();
- method public int getVariableTop();
- method public android.icu.util.VersionInfo getVersion();
- method public boolean isAlternateHandlingShifted();
- method public boolean isCaseLevel();
- method public boolean isFrenchCollation();
- method public boolean isLowerCaseFirst();
- method public boolean isUpperCaseFirst();
- method public void setAlternateHandlingDefault();
- method public void setAlternateHandlingShifted(boolean);
- method public void setCaseFirstDefault();
- method public void setCaseLevel(boolean);
- method public void setCaseLevelDefault();
- method public void setDecompositionDefault();
- method public void setFrenchCollation(boolean);
- method public void setFrenchCollationDefault();
- method public void setLowerCaseFirst(boolean);
- method public android.icu.text.RuleBasedCollator setMaxVariable(int);
- method public void setNumericCollation(boolean);
- method public void setNumericCollationDefault();
- method public void setStrengthDefault();
- method public void setUpperCaseFirst(boolean);
- }
-
- public final class ScientificNumberFormatter {
- method public String format(Object);
- method public static android.icu.text.ScientificNumberFormatter getMarkupInstance(android.icu.util.ULocale, String, String);
- method public static android.icu.text.ScientificNumberFormatter getMarkupInstance(android.icu.text.DecimalFormat, String, String);
- method public static android.icu.text.ScientificNumberFormatter getSuperscriptInstance(android.icu.util.ULocale);
- method public static android.icu.text.ScientificNumberFormatter getSuperscriptInstance(android.icu.text.DecimalFormat);
- }
-
- public abstract class SearchIterator {
- ctor protected SearchIterator(java.text.CharacterIterator, android.icu.text.BreakIterator);
- method public final int first();
- method public final int following(int);
- method public android.icu.text.BreakIterator getBreakIterator();
- method public android.icu.text.SearchIterator.ElementComparisonType getElementComparisonType();
- method public abstract int getIndex();
- method public int getMatchLength();
- method public int getMatchStart();
- method public String getMatchedText();
- method public java.text.CharacterIterator getTarget();
- method protected abstract int handleNext(int);
- method protected abstract int handlePrevious(int);
- method public boolean isOverlapping();
- method public final int last();
- method public int next();
- method public final int preceding(int);
- method public int previous();
- method public void reset();
- method public void setBreakIterator(android.icu.text.BreakIterator);
- method public void setElementComparisonType(android.icu.text.SearchIterator.ElementComparisonType);
- method public void setIndex(int);
- method protected void setMatchLength(int);
- method public void setOverlapping(boolean);
- method public void setTarget(java.text.CharacterIterator);
- field public static final int DONE = -1; // 0xffffffff
- field protected android.icu.text.BreakIterator breakIterator;
- field protected int matchLength;
- field protected java.text.CharacterIterator targetText;
- }
-
- public enum SearchIterator.ElementComparisonType {
- enum_constant public static final android.icu.text.SearchIterator.ElementComparisonType ANY_BASE_WEIGHT_IS_WILDCARD;
- enum_constant public static final android.icu.text.SearchIterator.ElementComparisonType PATTERN_BASE_WEIGHT_IS_WILDCARD;
- enum_constant public static final android.icu.text.SearchIterator.ElementComparisonType STANDARD_ELEMENT_COMPARISON;
- }
-
- public class SelectFormat extends java.text.Format {
- ctor public SelectFormat(String);
- method public void applyPattern(String);
- method public final String format(String);
- method public StringBuffer format(Object, StringBuffer, java.text.FieldPosition);
- method public Object parseObject(String, java.text.ParsePosition);
- method public String toPattern();
- }
-
- public class SimpleDateFormat extends android.icu.text.DateFormat {
- ctor public SimpleDateFormat();
- ctor public SimpleDateFormat(String);
- ctor public SimpleDateFormat(String, java.util.Locale);
- ctor public SimpleDateFormat(String, android.icu.util.ULocale);
- ctor public SimpleDateFormat(String, String, android.icu.util.ULocale);
- ctor public SimpleDateFormat(String, android.icu.text.DateFormatSymbols);
- method public void applyLocalizedPattern(String);
- method public void applyPattern(String);
- method public StringBuffer format(android.icu.util.Calendar, StringBuffer, java.text.FieldPosition);
- method public java.util.Date get2DigitYearStart();
- method public android.icu.text.DateFormatSymbols getDateFormatSymbols();
- method public android.icu.text.NumberFormat getNumberFormat(char);
- method protected android.icu.text.DateFormatSymbols getSymbols();
- method public android.icu.text.TimeZoneFormat getTimeZoneFormat();
- method protected int matchQuarterString(String, int, int, String[], android.icu.util.Calendar);
- method protected int matchString(String, int, int, String[], android.icu.util.Calendar);
- method public void parse(String, android.icu.util.Calendar, java.text.ParsePosition);
- method protected android.icu.text.DateFormat.Field patternCharToDateFormatField(char);
- method public void set2DigitYearStart(java.util.Date);
- method public void setDateFormatSymbols(android.icu.text.DateFormatSymbols);
- method public void setNumberFormat(String, android.icu.text.NumberFormat);
- method public void setTimeZoneFormat(android.icu.text.TimeZoneFormat);
- method protected String subFormat(char, int, int, java.text.FieldPosition, android.icu.text.DateFormatSymbols, android.icu.util.Calendar) throws java.lang.IllegalArgumentException;
- method protected int subParse(String, int, char, int, boolean, boolean, boolean[], android.icu.util.Calendar);
- method public String toLocalizedPattern();
- method public String toPattern();
- method protected String zeroPaddingNumber(long, int, int);
- }
-
- public class StringPrepParseException extends java.text.ParseException {
- ctor public StringPrepParseException(String, int);
- ctor public StringPrepParseException(String, int, String, int);
- ctor public StringPrepParseException(String, int, String, int, int);
- method public int getError();
- field public static final int ACE_PREFIX_ERROR = 6; // 0x6
- field public static final int BUFFER_OVERFLOW_ERROR = 9; // 0x9
- field public static final int CHECK_BIDI_ERROR = 4; // 0x4
- field public static final int DOMAIN_NAME_TOO_LONG_ERROR = 11; // 0xb
- field public static final int ILLEGAL_CHAR_FOUND = 1; // 0x1
- field public static final int INVALID_CHAR_FOUND = 0; // 0x0
- field public static final int LABEL_TOO_LONG_ERROR = 8; // 0x8
- field public static final int PROHIBITED_ERROR = 2; // 0x2
- field public static final int STD3_ASCII_RULES_ERROR = 5; // 0x5
- field public static final int UNASSIGNED_ERROR = 3; // 0x3
- field public static final int VERIFICATION_ERROR = 7; // 0x7
- field public static final int ZERO_LENGTH_LABEL = 10; // 0xa
- }
-
- public final class StringSearch extends android.icu.text.SearchIterator {
- ctor public StringSearch(String, java.text.CharacterIterator, android.icu.text.RuleBasedCollator, android.icu.text.BreakIterator);
- ctor public StringSearch(String, java.text.CharacterIterator, android.icu.text.RuleBasedCollator);
- ctor public StringSearch(String, java.text.CharacterIterator, java.util.Locale);
- ctor public StringSearch(String, java.text.CharacterIterator, android.icu.util.ULocale);
- ctor public StringSearch(String, String);
- method public android.icu.text.RuleBasedCollator getCollator();
- method public int getIndex();
- method public String getPattern();
- method protected int handleNext(int);
- method protected int handlePrevious(int);
- method public boolean isCanonical();
- method public void setCanonical(boolean);
- method public void setCollator(android.icu.text.RuleBasedCollator);
- method public void setPattern(String);
- }
-
- public interface SymbolTable {
- method public char[] lookup(String);
- method public android.icu.text.UnicodeMatcher lookupMatcher(int);
- method public String parseReference(String, java.text.ParsePosition, int);
- field public static final char SYMBOL_REF = 36; // 0x0024 '$'
- }
-
- public class TimeZoneFormat extends android.icu.text.UFormat implements android.icu.util.Freezable<android.icu.text.TimeZoneFormat> java.io.Serializable {
- ctor protected TimeZoneFormat(android.icu.util.ULocale);
- method public android.icu.text.TimeZoneFormat cloneAsThawed();
- method public final String format(android.icu.text.TimeZoneFormat.Style, android.icu.util.TimeZone, long);
- method public String format(android.icu.text.TimeZoneFormat.Style, android.icu.util.TimeZone, long, android.icu.util.Output<android.icu.text.TimeZoneFormat.TimeType>);
- method public StringBuffer format(Object, StringBuffer, java.text.FieldPosition);
- method public final String formatOffsetISO8601Basic(int, boolean, boolean, boolean);
- method public final String formatOffsetISO8601Extended(int, boolean, boolean, boolean);
- method public String formatOffsetLocalizedGMT(int);
- method public String formatOffsetShortLocalizedGMT(int);
- method public android.icu.text.TimeZoneFormat freeze();
- method public java.util.EnumSet<android.icu.text.TimeZoneFormat.ParseOption> getDefaultParseOptions();
- method public String getGMTOffsetDigits();
- method public String getGMTOffsetPattern(android.icu.text.TimeZoneFormat.GMTOffsetPatternType);
- method public String getGMTPattern();
- method public String getGMTZeroFormat();
- method public static android.icu.text.TimeZoneFormat getInstance(android.icu.util.ULocale);
- method public static android.icu.text.TimeZoneFormat getInstance(java.util.Locale);
- method public android.icu.text.TimeZoneNames getTimeZoneNames();
- method public boolean isFrozen();
- method public android.icu.util.TimeZone parse(android.icu.text.TimeZoneFormat.Style, String, java.text.ParsePosition, java.util.EnumSet<android.icu.text.TimeZoneFormat.ParseOption>, android.icu.util.Output<android.icu.text.TimeZoneFormat.TimeType>);
- method public android.icu.util.TimeZone parse(android.icu.text.TimeZoneFormat.Style, String, java.text.ParsePosition, android.icu.util.Output<android.icu.text.TimeZoneFormat.TimeType>);
- method public final android.icu.util.TimeZone parse(String, java.text.ParsePosition);
- method public final android.icu.util.TimeZone parse(String) throws java.text.ParseException;
- method public Object parseObject(String, java.text.ParsePosition);
- method public final int parseOffsetISO8601(String, java.text.ParsePosition);
- method public int parseOffsetLocalizedGMT(String, java.text.ParsePosition);
- method public int parseOffsetShortLocalizedGMT(String, java.text.ParsePosition);
- method public android.icu.text.TimeZoneFormat setDefaultParseOptions(java.util.EnumSet<android.icu.text.TimeZoneFormat.ParseOption>);
- method public android.icu.text.TimeZoneFormat setGMTOffsetDigits(String);
- method public android.icu.text.TimeZoneFormat setGMTOffsetPattern(android.icu.text.TimeZoneFormat.GMTOffsetPatternType, String);
- method public android.icu.text.TimeZoneFormat setGMTPattern(String);
- method public android.icu.text.TimeZoneFormat setGMTZeroFormat(String);
- method public android.icu.text.TimeZoneFormat setTimeZoneNames(android.icu.text.TimeZoneNames);
- }
-
- public enum TimeZoneFormat.GMTOffsetPatternType {
- enum_constant public static final android.icu.text.TimeZoneFormat.GMTOffsetPatternType NEGATIVE_H;
- enum_constant public static final android.icu.text.TimeZoneFormat.GMTOffsetPatternType NEGATIVE_HM;
- enum_constant public static final android.icu.text.TimeZoneFormat.GMTOffsetPatternType NEGATIVE_HMS;
- enum_constant public static final android.icu.text.TimeZoneFormat.GMTOffsetPatternType POSITIVE_H;
- enum_constant public static final android.icu.text.TimeZoneFormat.GMTOffsetPatternType POSITIVE_HM;
- enum_constant public static final android.icu.text.TimeZoneFormat.GMTOffsetPatternType POSITIVE_HMS;
- }
-
- public enum TimeZoneFormat.ParseOption {
- enum_constant public static final android.icu.text.TimeZoneFormat.ParseOption ALL_STYLES;
- enum_constant public static final android.icu.text.TimeZoneFormat.ParseOption TZ_DATABASE_ABBREVIATIONS;
- }
-
- public enum TimeZoneFormat.Style {
- enum_constant public static final android.icu.text.TimeZoneFormat.Style EXEMPLAR_LOCATION;
- enum_constant public static final android.icu.text.TimeZoneFormat.Style GENERIC_LOCATION;
- enum_constant public static final android.icu.text.TimeZoneFormat.Style GENERIC_LONG;
- enum_constant public static final android.icu.text.TimeZoneFormat.Style GENERIC_SHORT;
- enum_constant public static final android.icu.text.TimeZoneFormat.Style ISO_BASIC_FIXED;
- enum_constant public static final android.icu.text.TimeZoneFormat.Style ISO_BASIC_FULL;
- enum_constant public static final android.icu.text.TimeZoneFormat.Style ISO_BASIC_LOCAL_FIXED;
- enum_constant public static final android.icu.text.TimeZoneFormat.Style ISO_BASIC_LOCAL_FULL;
- enum_constant public static final android.icu.text.TimeZoneFormat.Style ISO_BASIC_LOCAL_SHORT;
- enum_constant public static final android.icu.text.TimeZoneFormat.Style ISO_BASIC_SHORT;
- enum_constant public static final android.icu.text.TimeZoneFormat.Style ISO_EXTENDED_FIXED;
- enum_constant public static final android.icu.text.TimeZoneFormat.Style ISO_EXTENDED_FULL;
- enum_constant public static final android.icu.text.TimeZoneFormat.Style ISO_EXTENDED_LOCAL_FIXED;
- enum_constant public static final android.icu.text.TimeZoneFormat.Style ISO_EXTENDED_LOCAL_FULL;
- enum_constant public static final android.icu.text.TimeZoneFormat.Style LOCALIZED_GMT;
- enum_constant public static final android.icu.text.TimeZoneFormat.Style LOCALIZED_GMT_SHORT;
- enum_constant public static final android.icu.text.TimeZoneFormat.Style SPECIFIC_LONG;
- enum_constant public static final android.icu.text.TimeZoneFormat.Style SPECIFIC_SHORT;
- enum_constant public static final android.icu.text.TimeZoneFormat.Style ZONE_ID;
- enum_constant public static final android.icu.text.TimeZoneFormat.Style ZONE_ID_SHORT;
- }
-
- public enum TimeZoneFormat.TimeType {
- enum_constant public static final android.icu.text.TimeZoneFormat.TimeType DAYLIGHT;
- enum_constant public static final android.icu.text.TimeZoneFormat.TimeType STANDARD;
- enum_constant public static final android.icu.text.TimeZoneFormat.TimeType UNKNOWN;
- }
-
- public abstract class TimeZoneNames implements java.io.Serializable {
- method public abstract java.util.Set<java.lang.String> getAvailableMetaZoneIDs();
- method public abstract java.util.Set<java.lang.String> getAvailableMetaZoneIDs(String);
- method public final String getDisplayName(String, android.icu.text.TimeZoneNames.NameType, long);
- method public String getExemplarLocationName(String);
- method public static android.icu.text.TimeZoneNames getInstance(android.icu.util.ULocale);
- method public static android.icu.text.TimeZoneNames getInstance(java.util.Locale);
- method public abstract String getMetaZoneDisplayName(String, android.icu.text.TimeZoneNames.NameType);
- method public abstract String getMetaZoneID(String, long);
- method public abstract String getReferenceZoneID(String, String);
- method public static android.icu.text.TimeZoneNames getTZDBInstance(android.icu.util.ULocale);
- method public abstract String getTimeZoneDisplayName(String, android.icu.text.TimeZoneNames.NameType);
- }
-
- public enum TimeZoneNames.NameType {
- enum_constant public static final android.icu.text.TimeZoneNames.NameType EXEMPLAR_LOCATION;
- enum_constant public static final android.icu.text.TimeZoneNames.NameType LONG_DAYLIGHT;
- enum_constant public static final android.icu.text.TimeZoneNames.NameType LONG_GENERIC;
- enum_constant public static final android.icu.text.TimeZoneNames.NameType LONG_STANDARD;
- enum_constant public static final android.icu.text.TimeZoneNames.NameType SHORT_DAYLIGHT;
- enum_constant public static final android.icu.text.TimeZoneNames.NameType SHORT_GENERIC;
- enum_constant public static final android.icu.text.TimeZoneNames.NameType SHORT_STANDARD;
- }
-
- public abstract class Transliterator {
- method public static final android.icu.text.Transliterator createFromRules(String, String, int);
- method public void filteredTransliterate(android.icu.text.Replaceable, android.icu.text.Transliterator.Position, boolean);
- method public final void finishTransliteration(android.icu.text.Replaceable, android.icu.text.Transliterator.Position);
- method public static final java.util.Enumeration<java.lang.String> getAvailableIDs();
- method public static final java.util.Enumeration<java.lang.String> getAvailableSources();
- method public static final java.util.Enumeration<java.lang.String> getAvailableTargets(String);
- method public static final java.util.Enumeration<java.lang.String> getAvailableVariants(String, String);
- method public static final String getDisplayName(String);
- method public static String getDisplayName(String, java.util.Locale);
- method public static String getDisplayName(String, android.icu.util.ULocale);
- method public android.icu.text.Transliterator[] getElements();
- method public final android.icu.text.UnicodeFilter getFilter();
- method public final String getID();
- method public static final android.icu.text.Transliterator getInstance(String);
- method public static android.icu.text.Transliterator getInstance(String, int);
- method public final android.icu.text.Transliterator getInverse();
- method public final int getMaximumContextLength();
- method public final android.icu.text.UnicodeSet getSourceSet();
- method public android.icu.text.UnicodeSet getTargetSet();
- method public void setFilter(android.icu.text.UnicodeFilter);
- method public String toRules(boolean);
- method public final int transliterate(android.icu.text.Replaceable, int, int);
- method public final void transliterate(android.icu.text.Replaceable);
- method public final String transliterate(String);
- method public final void transliterate(android.icu.text.Replaceable, android.icu.text.Transliterator.Position, String);
- method public final void transliterate(android.icu.text.Replaceable, android.icu.text.Transliterator.Position, int);
- method public final void transliterate(android.icu.text.Replaceable, android.icu.text.Transliterator.Position);
- field public static final int FORWARD = 0; // 0x0
- field public static final int REVERSE = 1; // 0x1
- }
-
- public static class Transliterator.Position {
- ctor public Transliterator.Position();
- ctor public Transliterator.Position(int, int, int);
- ctor public Transliterator.Position(int, int, int, int);
- ctor public Transliterator.Position(android.icu.text.Transliterator.Position);
- method public void set(android.icu.text.Transliterator.Position);
- method public final void validate(int);
- field public int contextLimit;
- field public int contextStart;
- field public int limit;
- field public int start;
- }
-
- public abstract class UCharacterIterator implements java.lang.Cloneable {
- ctor protected UCharacterIterator();
- method public Object clone() throws java.lang.CloneNotSupportedException;
- method public abstract int current();
- method public int currentCodePoint();
- method public java.text.CharacterIterator getCharacterIterator();
- method public abstract int getIndex();
- method public static final android.icu.text.UCharacterIterator getInstance(android.icu.text.Replaceable);
- method public static final android.icu.text.UCharacterIterator getInstance(String);
- method public static final android.icu.text.UCharacterIterator getInstance(char[]);
- method public static final android.icu.text.UCharacterIterator getInstance(char[], int, int);
- method public static final android.icu.text.UCharacterIterator getInstance(StringBuffer);
- method public static final android.icu.text.UCharacterIterator getInstance(java.text.CharacterIterator);
- method public abstract int getLength();
- method public abstract int getText(char[], int);
- method public final int getText(char[]);
- method public String getText();
- method public int moveCodePointIndex(int);
- method public int moveIndex(int);
- method public abstract int next();
- method public int nextCodePoint();
- method public abstract int previous();
- method public int previousCodePoint();
- method public abstract void setIndex(int);
- method public void setToLimit();
- method public void setToStart();
- field public static final int DONE = -1; // 0xffffffff
- }
-
- public abstract class UFormat extends java.text.Format {
- ctor public UFormat();
- }
-
- public abstract class UnicodeFilter implements android.icu.text.UnicodeMatcher {
- method public abstract boolean contains(int);
- method public int matches(android.icu.text.Replaceable, int[], int, boolean);
- }
-
- public interface UnicodeMatcher {
- method public void addMatchSetTo(android.icu.text.UnicodeSet);
- method public int matches(android.icu.text.Replaceable, int[], int, boolean);
- method public boolean matchesIndexValue(int);
- method public String toPattern(boolean);
- field public static final char ETHER = 65535; // 0xffff '\uffff'
- field public static final int U_MATCH = 2; // 0x2
- field public static final int U_MISMATCH = 0; // 0x0
- field public static final int U_PARTIAL_MATCH = 1; // 0x1
- }
-
- public class UnicodeSet extends android.icu.text.UnicodeFilter implements java.lang.Comparable<android.icu.text.UnicodeSet> android.icu.util.Freezable<android.icu.text.UnicodeSet> java.lang.Iterable<java.lang.String> {
- ctor public UnicodeSet();
- ctor public UnicodeSet(android.icu.text.UnicodeSet);
- ctor public UnicodeSet(int, int);
- ctor public UnicodeSet(int...);
- ctor public UnicodeSet(String);
- ctor public UnicodeSet(String, boolean);
- ctor public UnicodeSet(String, int);
- ctor public UnicodeSet(String, java.text.ParsePosition, android.icu.text.SymbolTable);
- ctor public UnicodeSet(String, java.text.ParsePosition, android.icu.text.SymbolTable, int);
- method public StringBuffer _generatePattern(StringBuffer, boolean);
- method public StringBuffer _generatePattern(StringBuffer, boolean, boolean);
- method public android.icu.text.UnicodeSet add(int, int);
- method public final android.icu.text.UnicodeSet add(int);
- method public final android.icu.text.UnicodeSet add(CharSequence);
- method public android.icu.text.UnicodeSet add(Iterable<?>);
- method public android.icu.text.UnicodeSet addAll(int, int);
- method public final android.icu.text.UnicodeSet addAll(CharSequence);
- method public android.icu.text.UnicodeSet addAll(android.icu.text.UnicodeSet);
- method public android.icu.text.UnicodeSet addAll(Iterable<?>);
- method public <T extends java.lang.CharSequence> android.icu.text.UnicodeSet addAll(T...);
- method public <T extends java.util.Collection<java.lang.String>> T addAllTo(T);
- method public void addMatchSetTo(android.icu.text.UnicodeSet);
- method public android.icu.text.UnicodeSet applyIntPropertyValue(int, int);
- method public final android.icu.text.UnicodeSet applyPattern(String);
- method public android.icu.text.UnicodeSet applyPattern(String, boolean);
- method public android.icu.text.UnicodeSet applyPattern(String, int);
- method public android.icu.text.UnicodeSet applyPropertyAlias(String, String);
- method public android.icu.text.UnicodeSet applyPropertyAlias(String, String, android.icu.text.SymbolTable);
- method public int charAt(int);
- method public android.icu.text.UnicodeSet clear();
- method public Object clone();
- method public android.icu.text.UnicodeSet cloneAsThawed();
- method public android.icu.text.UnicodeSet closeOver(int);
- method public android.icu.text.UnicodeSet compact();
- method public int compareTo(android.icu.text.UnicodeSet);
- method public int compareTo(android.icu.text.UnicodeSet, android.icu.text.UnicodeSet.ComparisonStyle);
- method public int compareTo(Iterable<java.lang.String>);
- method public android.icu.text.UnicodeSet complement(int, int);
- method public final android.icu.text.UnicodeSet complement(int);
- method public android.icu.text.UnicodeSet complement();
- method public final android.icu.text.UnicodeSet complement(CharSequence);
- method public final android.icu.text.UnicodeSet complementAll(CharSequence);
- method public android.icu.text.UnicodeSet complementAll(android.icu.text.UnicodeSet);
- method public boolean contains(int);
- method public boolean contains(int, int);
- method public final boolean contains(CharSequence);
- method public boolean containsAll(android.icu.text.UnicodeSet);
- method public boolean containsAll(String);
- method public <T extends java.lang.CharSequence> boolean containsAll(Iterable<T>);
- method public boolean containsNone(int, int);
- method public boolean containsNone(android.icu.text.UnicodeSet);
- method public boolean containsNone(CharSequence);
- method public <T extends java.lang.CharSequence> boolean containsNone(Iterable<T>);
- method public final boolean containsSome(int, int);
- method public final boolean containsSome(android.icu.text.UnicodeSet);
- method public final boolean containsSome(CharSequence);
- method public final <T extends java.lang.CharSequence> boolean containsSome(Iterable<T>);
- method public android.icu.text.UnicodeSet freeze();
- method public static android.icu.text.UnicodeSet from(CharSequence);
- method public static android.icu.text.UnicodeSet fromAll(CharSequence);
- method public int getRangeCount();
- method public int getRangeEnd(int);
- method public int getRangeStart(int);
- method public int indexOf(int);
- method public boolean isEmpty();
- method public boolean isFrozen();
- method public java.util.Iterator<java.lang.String> iterator();
- method public boolean matchesIndexValue(int);
- method public Iterable<android.icu.text.UnicodeSet.EntryRange> ranges();
- method public android.icu.text.UnicodeSet remove(int, int);
- method public final android.icu.text.UnicodeSet remove(int);
- method public final android.icu.text.UnicodeSet remove(CharSequence);
- method public final android.icu.text.UnicodeSet removeAll(CharSequence);
- method public android.icu.text.UnicodeSet removeAll(android.icu.text.UnicodeSet);
- method public <T extends java.lang.CharSequence> android.icu.text.UnicodeSet removeAll(Iterable<T>);
- method public final android.icu.text.UnicodeSet removeAllStrings();
- method public android.icu.text.UnicodeSet retain(int, int);
- method public final android.icu.text.UnicodeSet retain(int);
- method public final android.icu.text.UnicodeSet retain(CharSequence);
- method public final android.icu.text.UnicodeSet retainAll(CharSequence);
- method public android.icu.text.UnicodeSet retainAll(android.icu.text.UnicodeSet);
- method public <T extends java.lang.CharSequence> android.icu.text.UnicodeSet retainAll(Iterable<T>);
- method public android.icu.text.UnicodeSet set(int, int);
- method public android.icu.text.UnicodeSet set(android.icu.text.UnicodeSet);
- method public int size();
- method public int span(CharSequence, android.icu.text.UnicodeSet.SpanCondition);
- method public int span(CharSequence, int, android.icu.text.UnicodeSet.SpanCondition);
- method public int spanBack(CharSequence, android.icu.text.UnicodeSet.SpanCondition);
- method public int spanBack(CharSequence, int, android.icu.text.UnicodeSet.SpanCondition);
- method public java.util.Collection<java.lang.String> strings();
- method public String toPattern(boolean);
- field public static final int ADD_CASE_MAPPINGS = 4; // 0x4
- field public static final android.icu.text.UnicodeSet ALL_CODE_POINTS;
- field public static final int CASE = 2; // 0x2
- field public static final int CASE_INSENSITIVE = 2; // 0x2
- field public static final android.icu.text.UnicodeSet EMPTY;
- field public static final int IGNORE_SPACE = 1; // 0x1
- field public static final int MAX_VALUE = 1114111; // 0x10ffff
- field public static final int MIN_VALUE = 0; // 0x0
- }
-
- public enum UnicodeSet.ComparisonStyle {
- enum_constant public static final android.icu.text.UnicodeSet.ComparisonStyle LEXICOGRAPHIC;
- enum_constant public static final android.icu.text.UnicodeSet.ComparisonStyle LONGER_FIRST;
- enum_constant public static final android.icu.text.UnicodeSet.ComparisonStyle SHORTER_FIRST;
- }
-
- public static class UnicodeSet.EntryRange {
- field public int codepoint;
- field public int codepointEnd;
- }
-
- public enum UnicodeSet.SpanCondition {
- enum_constant public static final android.icu.text.UnicodeSet.SpanCondition CONDITION_COUNT;
- enum_constant public static final android.icu.text.UnicodeSet.SpanCondition CONTAINED;
- enum_constant public static final android.icu.text.UnicodeSet.SpanCondition NOT_CONTAINED;
- enum_constant public static final android.icu.text.UnicodeSet.SpanCondition SIMPLE;
- }
-
- public class UnicodeSetIterator {
- ctor public UnicodeSetIterator(android.icu.text.UnicodeSet);
- ctor public UnicodeSetIterator();
- method public String getString();
- method public boolean next();
- method public boolean nextRange();
- method public void reset(android.icu.text.UnicodeSet);
- method public void reset();
- field public static int IS_STRING;
- field public int codepoint;
- field public int codepointEnd;
- field public String string;
- }
-
- public class UnicodeSetSpanner {
- ctor public UnicodeSetSpanner(android.icu.text.UnicodeSet);
- method public int countIn(CharSequence);
- method public int countIn(CharSequence, android.icu.text.UnicodeSetSpanner.CountMethod);
- method public int countIn(CharSequence, android.icu.text.UnicodeSetSpanner.CountMethod, android.icu.text.UnicodeSet.SpanCondition);
- method public String deleteFrom(CharSequence);
- method public String deleteFrom(CharSequence, android.icu.text.UnicodeSet.SpanCondition);
- method public android.icu.text.UnicodeSet getUnicodeSet();
- method public String replaceFrom(CharSequence, CharSequence);
- method public String replaceFrom(CharSequence, CharSequence, android.icu.text.UnicodeSetSpanner.CountMethod);
- method public String replaceFrom(CharSequence, CharSequence, android.icu.text.UnicodeSetSpanner.CountMethod, android.icu.text.UnicodeSet.SpanCondition);
- method public CharSequence trim(CharSequence);
- method public CharSequence trim(CharSequence, android.icu.text.UnicodeSetSpanner.TrimOption);
- method public CharSequence trim(CharSequence, android.icu.text.UnicodeSetSpanner.TrimOption, android.icu.text.UnicodeSet.SpanCondition);
- }
-
- public enum UnicodeSetSpanner.CountMethod {
- enum_constant public static final android.icu.text.UnicodeSetSpanner.CountMethod MIN_ELEMENTS;
- enum_constant public static final android.icu.text.UnicodeSetSpanner.CountMethod WHOLE_SPAN;
- }
-
- public enum UnicodeSetSpanner.TrimOption {
- enum_constant public static final android.icu.text.UnicodeSetSpanner.TrimOption BOTH;
- enum_constant public static final android.icu.text.UnicodeSetSpanner.TrimOption LEADING;
- enum_constant public static final android.icu.text.UnicodeSetSpanner.TrimOption TRAILING;
- }
-
-}
-
-package android.icu.util {
-
- public class BuddhistCalendar extends android.icu.util.GregorianCalendar {
- ctor public BuddhistCalendar();
- ctor public BuddhistCalendar(android.icu.util.TimeZone);
- ctor public BuddhistCalendar(java.util.Locale);
- ctor public BuddhistCalendar(android.icu.util.ULocale);
- ctor public BuddhistCalendar(android.icu.util.TimeZone, java.util.Locale);
- ctor public BuddhistCalendar(android.icu.util.TimeZone, android.icu.util.ULocale);
- ctor public BuddhistCalendar(java.util.Date);
- ctor public BuddhistCalendar(int, int, int);
- ctor public BuddhistCalendar(int, int, int, int, int, int);
- field public static final int BE = 0; // 0x0
- }
-
- public abstract class Calendar implements java.lang.Cloneable java.lang.Comparable<android.icu.util.Calendar> java.io.Serializable {
- ctor protected Calendar();
- ctor protected Calendar(android.icu.util.TimeZone, java.util.Locale);
- ctor protected Calendar(android.icu.util.TimeZone, android.icu.util.ULocale);
- method public void add(int, int);
- method public boolean after(Object);
- method public boolean before(Object);
- method public final void clear();
- method public final void clear(int);
- method public Object clone();
- method public int compareTo(android.icu.util.Calendar);
- method protected void complete();
- method protected void computeFields();
- method protected final void computeGregorianFields(int);
- method protected int computeGregorianMonthStart(int, int);
- method protected int computeJulianDay();
- method @Deprecated protected int computeMillisInDay();
- method protected void computeTime();
- method @Deprecated protected int computeZoneOffset(long, int);
- method public int fieldDifference(java.util.Date, int);
- method protected String fieldName(int);
- method protected static final long floorDivide(long, long);
- method protected static final int floorDivide(int, int);
- method protected static final int floorDivide(int, int, int[]);
- method protected static final int floorDivide(long, int, int[]);
- method public final int get(int);
- method public int getActualMaximum(int);
- method public int getActualMinimum(int);
- method public static java.util.Locale[] getAvailableLocales();
- method public android.icu.text.DateFormat getDateTimeFormat(int, int, java.util.Locale);
- method public android.icu.text.DateFormat getDateTimeFormat(int, int, android.icu.util.ULocale);
- method public String getDisplayName(java.util.Locale);
- method public String getDisplayName(android.icu.util.ULocale);
- method public final int getFieldCount();
- method protected int[][][] getFieldResolutionTable();
- method public int getFirstDayOfWeek();
- method public final int getGreatestMinimum(int);
- method protected final int getGregorianDayOfMonth();
- method protected final int getGregorianDayOfYear();
- method protected final int getGregorianMonth();
- method protected final int getGregorianYear();
- method public static android.icu.util.Calendar getInstance();
- method public static android.icu.util.Calendar getInstance(android.icu.util.TimeZone);
- method public static android.icu.util.Calendar getInstance(java.util.Locale);
- method public static android.icu.util.Calendar getInstance(android.icu.util.ULocale);
- method public static android.icu.util.Calendar getInstance(android.icu.util.TimeZone, java.util.Locale);
- method public static android.icu.util.Calendar getInstance(android.icu.util.TimeZone, android.icu.util.ULocale);
- method public static final String[] getKeywordValuesForLocale(String, android.icu.util.ULocale, boolean);
- method public final int getLeastMaximum(int);
- method protected int getLimit(int, int);
- method public final int getMaximum(int);
- method public int getMinimalDaysInFirstWeek();
- method public final int getMinimum(int);
- method public int getRepeatedWallTimeOption();
- method public int getSkippedWallTimeOption();
- method protected final int getStamp(int);
- method public final java.util.Date getTime();
- method public long getTimeInMillis();
- method public android.icu.util.TimeZone getTimeZone();
- method public String getType();
- method public android.icu.util.Calendar.WeekData getWeekData();
- method public static android.icu.util.Calendar.WeekData getWeekDataForRegion(String);
- method protected static final int gregorianMonthLength(int, int);
- method protected static final int gregorianPreviousMonthLength(int, int);
- method protected void handleComputeFields(int);
- method protected int handleComputeJulianDay(int);
- method protected abstract int handleComputeMonthStart(int, int, boolean);
- method protected int[] handleCreateFields();
- method protected android.icu.text.DateFormat handleGetDateFormat(String, java.util.Locale);
- method protected android.icu.text.DateFormat handleGetDateFormat(String, String, java.util.Locale);
- method protected android.icu.text.DateFormat handleGetDateFormat(String, android.icu.util.ULocale);
- method protected abstract int handleGetExtendedYear();
- method protected abstract int handleGetLimit(int, int);
- method protected int handleGetMonthLength(int, int);
- method protected int handleGetYearLength(int);
- method protected final int internalGet(int);
- method protected final int internalGet(int, int);
- method protected final long internalGetTimeInMillis();
- method protected final void internalSet(int, int);
- method public boolean isEquivalentTo(android.icu.util.Calendar);
- method protected static final boolean isGregorianLeapYear(int);
- method public boolean isLenient();
- method public final boolean isSet(int);
- method public boolean isWeekend(java.util.Date);
- method public boolean isWeekend();
- method protected static final int julianDayToDayOfWeek(int);
- method protected static final long julianDayToMillis(int);
- method protected static final int millisToJulianDay(long);
- method protected int newerField(int, int);
- method protected int newestStamp(int, int, int);
- method protected void pinField(int);
- method protected void prepareGetActual(int, boolean);
- method protected int resolveFields(int[][][]);
- method public final void roll(int, boolean);
- method public void roll(int, int);
- method public final void set(int, int);
- method public final void set(int, int, int);
- method public final void set(int, int, int, int, int);
- method public final void set(int, int, int, int, int, int);
- method public void setFirstDayOfWeek(int);
- method public void setLenient(boolean);
- method public void setMinimalDaysInFirstWeek(int);
- method public void setRepeatedWallTimeOption(int);
- method public void setSkippedWallTimeOption(int);
- method public final void setTime(java.util.Date);
- method public void setTimeInMillis(long);
- method public void setTimeZone(android.icu.util.TimeZone);
- method public android.icu.util.Calendar setWeekData(android.icu.util.Calendar.WeekData);
- method protected void validateField(int);
- method protected final void validateField(int, int, int);
- method protected void validateFields();
- method protected int weekNumber(int, int, int);
- method protected final int weekNumber(int, int);
- field public static final int AM = 0; // 0x0
- field public static final int AM_PM = 9; // 0x9
- field public static final int APRIL = 3; // 0x3
- field public static final int AUGUST = 7; // 0x7
- field @Deprecated protected static final int BASE_FIELD_COUNT = 23; // 0x17
- field public static final int DATE = 5; // 0x5
- field public static final int DAY_OF_MONTH = 5; // 0x5
- field public static final int DAY_OF_WEEK = 7; // 0x7
- field public static final int DAY_OF_WEEK_IN_MONTH = 8; // 0x8
- field public static final int DAY_OF_YEAR = 6; // 0x6
- field public static final int DECEMBER = 11; // 0xb
- field public static final int DOW_LOCAL = 18; // 0x12
- field public static final int DST_OFFSET = 16; // 0x10
- field protected static final int EPOCH_JULIAN_DAY = 2440588; // 0x253d8c
- field public static final int ERA = 0; // 0x0
- field public static final int EXTENDED_YEAR = 19; // 0x13
- field public static final int FEBRUARY = 1; // 0x1
- field public static final int FRIDAY = 6; // 0x6
- field protected static final int GREATEST_MINIMUM = 1; // 0x1
- field public static final int HOUR = 10; // 0xa
- field public static final int HOUR_OF_DAY = 11; // 0xb
- field protected static final int INTERNALLY_SET = 1; // 0x1
- field public static final int IS_LEAP_MONTH = 22; // 0x16
- field public static final int JANUARY = 0; // 0x0
- field protected static final int JAN_1_1_JULIAN_DAY = 1721426; // 0x1a4452
- field public static final int JULIAN_DAY = 20; // 0x14
- field public static final int JULY = 6; // 0x6
- field public static final int JUNE = 5; // 0x5
- field protected static final int LEAST_MAXIMUM = 2; // 0x2
- field public static final int MARCH = 2; // 0x2
- field protected static final int MAXIMUM = 3; // 0x3
- field protected static final java.util.Date MAX_DATE;
- field @Deprecated protected static final int MAX_FIELD_COUNT = 32; // 0x20
- field protected static final int MAX_JULIAN = 2130706432; // 0x7f000000
- field protected static final long MAX_MILLIS = 183882168921600000L; // 0x28d47dbbf19b000L
- field public static final int MAY = 4; // 0x4
- field public static final int MILLISECOND = 14; // 0xe
- field public static final int MILLISECONDS_IN_DAY = 21; // 0x15
- field protected static final int MINIMUM = 0; // 0x0
- field protected static final int MINIMUM_USER_STAMP = 2; // 0x2
- field public static final int MINUTE = 12; // 0xc
- field protected static final java.util.Date MIN_DATE;
- field protected static final int MIN_JULIAN = -2130706432; // 0x81000000
- field protected static final long MIN_MILLIS = -184303902528000000L; // 0xfd713893bf19b000L
- field public static final int MONDAY = 2; // 0x2
- field public static final int MONTH = 2; // 0x2
- field public static final int NOVEMBER = 10; // 0xa
- field public static final int OCTOBER = 9; // 0x9
- field protected static final long ONE_DAY = 86400000L; // 0x5265c00L
- field protected static final int ONE_HOUR = 3600000; // 0x36ee80
- field protected static final int ONE_MINUTE = 60000; // 0xea60
- field protected static final int ONE_SECOND = 1000; // 0x3e8
- field protected static final long ONE_WEEK = 604800000L; // 0x240c8400L
- field public static final int PM = 1; // 0x1
- field protected static final int RESOLVE_REMAP = 32; // 0x20
- field public static final int SATURDAY = 7; // 0x7
- field public static final int SECOND = 13; // 0xd
- field public static final int SEPTEMBER = 8; // 0x8
- field public static final int SUNDAY = 1; // 0x1
- field public static final int THURSDAY = 5; // 0x5
- field public static final int TUESDAY = 3; // 0x3
- field public static final int UNDECIMBER = 12; // 0xc
- field protected static final int UNSET = 0; // 0x0
- field public static final int WALLTIME_FIRST = 1; // 0x1
- field public static final int WALLTIME_LAST = 0; // 0x0
- field public static final int WALLTIME_NEXT_VALID = 2; // 0x2
- field public static final int WEDNESDAY = 4; // 0x4
- field public static final int WEEK_OF_MONTH = 4; // 0x4
- field public static final int WEEK_OF_YEAR = 3; // 0x3
- field public static final int YEAR = 1; // 0x1
- field public static final int YEAR_WOY = 17; // 0x11
- field public static final int ZONE_OFFSET = 15; // 0xf
- }
-
- public static final class Calendar.WeekData {
- ctor public Calendar.WeekData(int, int, int, int, int, int);
- field public final int firstDayOfWeek;
- field public final int minimalDaysInFirstWeek;
- field public final int weekendCease;
- field public final int weekendCeaseMillis;
- field public final int weekendOnset;
- field public final int weekendOnsetMillis;
- }
-
- public class ChineseCalendar extends android.icu.util.Calendar {
- ctor public ChineseCalendar();
- ctor public ChineseCalendar(java.util.Date);
- ctor public ChineseCalendar(int, int, int, int);
- ctor public ChineseCalendar(int, int, int, int, int, int, int);
- ctor public ChineseCalendar(int, int, int, int, int);
- ctor public ChineseCalendar(int, int, int, int, int, int, int, int);
- ctor public ChineseCalendar(java.util.Locale);
- ctor public ChineseCalendar(android.icu.util.TimeZone);
- ctor public ChineseCalendar(android.icu.util.TimeZone, java.util.Locale);
- ctor public ChineseCalendar(android.icu.util.ULocale);
- ctor public ChineseCalendar(android.icu.util.TimeZone, android.icu.util.ULocale);
- method protected int handleComputeMonthStart(int, int, boolean);
- method protected android.icu.text.DateFormat handleGetDateFormat(String, String, android.icu.util.ULocale);
- method protected int handleGetExtendedYear();
- method protected int handleGetLimit(int, int);
- }
-
- public final class CopticCalendar extends android.icu.util.Calendar {
- ctor public CopticCalendar();
- ctor public CopticCalendar(android.icu.util.TimeZone);
- ctor public CopticCalendar(java.util.Locale);
- ctor public CopticCalendar(android.icu.util.ULocale);
- ctor public CopticCalendar(android.icu.util.TimeZone, java.util.Locale);
- ctor public CopticCalendar(android.icu.util.TimeZone, android.icu.util.ULocale);
- ctor public CopticCalendar(int, int, int);
- ctor public CopticCalendar(java.util.Date);
- ctor public CopticCalendar(int, int, int, int, int, int);
- method @Deprecated protected void handleComputeFields(int);
- method protected int handleComputeMonthStart(int, int, boolean);
- method @Deprecated protected int handleGetExtendedYear();
- method protected int handleGetLimit(int, int);
- field public static final int AMSHIR = 5; // 0x5
- field public static final int BABA = 1; // 0x1
- field public static final int BARAMHAT = 6; // 0x6
- field public static final int BARAMOUDA = 7; // 0x7
- field public static final int BASHANS = 8; // 0x8
- field public static final int EPEP = 10; // 0xa
- field public static final int HATOR = 2; // 0x2
- field public static final int KIAHK = 3; // 0x3
- field public static final int MESRA = 11; // 0xb
- field public static final int NASIE = 12; // 0xc
- field public static final int PAONA = 9; // 0x9
- field public static final int TOBA = 4; // 0x4
- field public static final int TOUT = 0; // 0x0
- }
-
- public class Currency extends android.icu.util.MeasureUnit {
- ctor protected Currency(String);
- method public static android.icu.util.Currency fromJavaCurrency(java.util.Currency);
- method public static java.util.Set<android.icu.util.Currency> getAvailableCurrencies();
- method public static String[] getAvailableCurrencyCodes(android.icu.util.ULocale, java.util.Date);
- method public static String[] getAvailableCurrencyCodes(java.util.Locale, java.util.Date);
- method public static java.util.Locale[] getAvailableLocales();
- method public static android.icu.util.ULocale[] getAvailableULocales();
- method public String getCurrencyCode();
- method public int getDefaultFractionDigits();
- method public int getDefaultFractionDigits(android.icu.util.Currency.CurrencyUsage);
- method public String getDisplayName();
- method public String getDisplayName(java.util.Locale);
- method public static android.icu.util.Currency getInstance(java.util.Locale);
- method public static android.icu.util.Currency getInstance(android.icu.util.ULocale);
- method public static android.icu.util.Currency getInstance(String);
- method public static final String[] getKeywordValuesForLocale(String, android.icu.util.ULocale, boolean);
- method public String getName(java.util.Locale, int, boolean[]);
- method public String getName(android.icu.util.ULocale, int, boolean[]);
- method public String getName(java.util.Locale, int, String, boolean[]);
- method public String getName(android.icu.util.ULocale, int, String, boolean[]);
- method public int getNumericCode();
- method public double getRoundingIncrement();
- method public double getRoundingIncrement(android.icu.util.Currency.CurrencyUsage);
- method public String getSymbol();
- method public String getSymbol(java.util.Locale);
- method public String getSymbol(android.icu.util.ULocale);
- method public static boolean isAvailable(String, java.util.Date, java.util.Date);
- method public java.util.Currency toJavaCurrency();
- field public static final int LONG_NAME = 1; // 0x1
- field public static final int NARROW_SYMBOL_NAME = 3; // 0x3
- field public static final int PLURAL_LONG_NAME = 2; // 0x2
- field public static final int SYMBOL_NAME = 0; // 0x0
- }
-
- public enum Currency.CurrencyUsage {
- enum_constant public static final android.icu.util.Currency.CurrencyUsage CASH;
- enum_constant public static final android.icu.util.Currency.CurrencyUsage STANDARD;
- }
-
- public class CurrencyAmount extends android.icu.util.Measure {
- ctor public CurrencyAmount(Number, android.icu.util.Currency);
- ctor public CurrencyAmount(double, android.icu.util.Currency);
- ctor public CurrencyAmount(Number, java.util.Currency);
- ctor public CurrencyAmount(double, java.util.Currency);
- method public android.icu.util.Currency getCurrency();
- }
-
- public final class DateInterval implements java.io.Serializable {
- ctor public DateInterval(long, long);
- method public long getFromDate();
- method public long getToDate();
- }
-
- public final class EthiopicCalendar extends android.icu.util.Calendar {
- ctor public EthiopicCalendar();
- ctor public EthiopicCalendar(android.icu.util.TimeZone);
- ctor public EthiopicCalendar(java.util.Locale);
- ctor public EthiopicCalendar(android.icu.util.ULocale);
- ctor public EthiopicCalendar(android.icu.util.TimeZone, java.util.Locale);
- ctor public EthiopicCalendar(android.icu.util.TimeZone, android.icu.util.ULocale);
- ctor public EthiopicCalendar(int, int, int);
- ctor public EthiopicCalendar(java.util.Date);
- ctor public EthiopicCalendar(int, int, int, int, int, int);
- method @Deprecated protected void handleComputeFields(int);
- method protected int handleComputeMonthStart(int, int, boolean);
- method @Deprecated protected int handleGetExtendedYear();
- method @Deprecated protected int handleGetLimit(int, int);
- method public boolean isAmeteAlemEra();
- method public void setAmeteAlemEra(boolean);
- field public static final int GENBOT = 8; // 0x8
- field public static final int HAMLE = 10; // 0xa
- field public static final int HEDAR = 2; // 0x2
- field public static final int MEGABIT = 6; // 0x6
- field public static final int MESKEREM = 0; // 0x0
- field public static final int MIAZIA = 7; // 0x7
- field public static final int NEHASSE = 11; // 0xb
- field public static final int PAGUMEN = 12; // 0xc
- field public static final int SENE = 9; // 0x9
- field public static final int TAHSAS = 3; // 0x3
- field public static final int TEKEMT = 1; // 0x1
- field public static final int TER = 4; // 0x4
- field public static final int YEKATIT = 5; // 0x5
- }
-
- public interface Freezable<T> extends java.lang.Cloneable {
- method public T cloneAsThawed();
- method public T freeze();
- method public boolean isFrozen();
- }
-
- public class GregorianCalendar extends android.icu.util.Calendar {
- ctor public GregorianCalendar();
- ctor public GregorianCalendar(android.icu.util.TimeZone);
- ctor public GregorianCalendar(java.util.Locale);
- ctor public GregorianCalendar(android.icu.util.ULocale);
- ctor public GregorianCalendar(android.icu.util.TimeZone, java.util.Locale);
- ctor public GregorianCalendar(android.icu.util.TimeZone, android.icu.util.ULocale);
- ctor public GregorianCalendar(int, int, int);
- ctor public GregorianCalendar(int, int, int, int, int);
- ctor public GregorianCalendar(int, int, int, int, int, int);
- method public final java.util.Date getGregorianChange();
- method protected int handleComputeMonthStart(int, int, boolean);
- method protected int handleGetExtendedYear();
- method protected int handleGetLimit(int, int);
- method public boolean isLeapYear(int);
- method public void setGregorianChange(java.util.Date);
- field public static final int AD = 1; // 0x1
- field public static final int BC = 0; // 0x0
- field protected transient boolean invertGregorian;
- field protected transient boolean isGregorian;
- }
-
- public class HebrewCalendar extends android.icu.util.Calendar {
- ctor public HebrewCalendar();
- ctor public HebrewCalendar(android.icu.util.TimeZone);
- ctor public HebrewCalendar(java.util.Locale);
- ctor public HebrewCalendar(android.icu.util.ULocale);
- ctor public HebrewCalendar(android.icu.util.TimeZone, java.util.Locale);
- ctor public HebrewCalendar(android.icu.util.TimeZone, android.icu.util.ULocale);
- ctor public HebrewCalendar(int, int, int);
- ctor public HebrewCalendar(java.util.Date);
- ctor public HebrewCalendar(int, int, int, int, int, int);
- method protected int handleComputeMonthStart(int, int, boolean);
- method protected int handleGetExtendedYear();
- method protected int handleGetLimit(int, int);
- method @Deprecated protected void validateField(int);
- field public static final int ADAR = 6; // 0x6
- field public static final int ADAR_1 = 5; // 0x5
- field public static final int AV = 11; // 0xb
- field public static final int ELUL = 12; // 0xc
- field public static final int HESHVAN = 1; // 0x1
- field public static final int IYAR = 8; // 0x8
- field public static final int KISLEV = 2; // 0x2
- field public static final int NISAN = 7; // 0x7
- field public static final int SHEVAT = 4; // 0x4
- field public static final int SIVAN = 9; // 0x9
- field public static final int TAMUZ = 10; // 0xa
- field public static final int TEVET = 3; // 0x3
- field public static final int TISHRI = 0; // 0x0
- }
-
- public class ICUUncheckedIOException extends java.lang.RuntimeException {
- ctor public ICUUncheckedIOException();
- ctor public ICUUncheckedIOException(String);
- ctor public ICUUncheckedIOException(Throwable);
- ctor public ICUUncheckedIOException(String, Throwable);
- }
-
- public class IllformedLocaleException extends java.lang.RuntimeException {
- ctor public IllformedLocaleException();
- ctor public IllformedLocaleException(String);
- ctor public IllformedLocaleException(String, int);
- method public int getErrorIndex();
- }
-
- public class IndianCalendar extends android.icu.util.Calendar {
- ctor public IndianCalendar();
- ctor public IndianCalendar(android.icu.util.TimeZone);
- ctor public IndianCalendar(java.util.Locale);
- ctor public IndianCalendar(android.icu.util.ULocale);
- ctor public IndianCalendar(android.icu.util.TimeZone, java.util.Locale);
- ctor public IndianCalendar(android.icu.util.TimeZone, android.icu.util.ULocale);
- ctor public IndianCalendar(java.util.Date);
- ctor public IndianCalendar(int, int, int);
- ctor public IndianCalendar(int, int, int, int, int, int);
- method protected int handleComputeMonthStart(int, int, boolean);
- method protected int handleGetExtendedYear();
- method protected int handleGetLimit(int, int);
- field public static final int AGRAHAYANA = 8; // 0x8
- field public static final int ASADHA = 3; // 0x3
- field public static final int ASVINA = 6; // 0x6
- field public static final int BHADRA = 5; // 0x5
- field public static final int CHAITRA = 0; // 0x0
- field public static final int IE = 0; // 0x0
- field public static final int JYAISTHA = 2; // 0x2
- field public static final int KARTIKA = 7; // 0x7
- field public static final int MAGHA = 10; // 0xa
- field public static final int PAUSA = 9; // 0x9
- field public static final int PHALGUNA = 11; // 0xb
- field public static final int SRAVANA = 4; // 0x4
- field public static final int VAISAKHA = 1; // 0x1
- }
-
- public class IslamicCalendar extends android.icu.util.Calendar {
- ctor public IslamicCalendar();
- ctor public IslamicCalendar(android.icu.util.TimeZone);
- ctor public IslamicCalendar(java.util.Locale);
- ctor public IslamicCalendar(android.icu.util.ULocale);
- ctor public IslamicCalendar(android.icu.util.TimeZone, java.util.Locale);
- ctor public IslamicCalendar(android.icu.util.TimeZone, android.icu.util.ULocale);
- ctor public IslamicCalendar(java.util.Date);
- ctor public IslamicCalendar(int, int, int);
- ctor public IslamicCalendar(int, int, int, int, int, int);
- method public android.icu.util.IslamicCalendar.CalculationType getCalculationType();
- method protected int handleComputeMonthStart(int, int, boolean);
- method protected int handleGetExtendedYear();
- method protected int handleGetLimit(int, int);
- method public void setCalculationType(android.icu.util.IslamicCalendar.CalculationType);
- field public static final int DHU_AL_HIJJAH = 11; // 0xb
- field public static final int DHU_AL_QIDAH = 10; // 0xa
- field public static final int JUMADA_1 = 4; // 0x4
- field public static final int JUMADA_2 = 5; // 0x5
- field public static final int MUHARRAM = 0; // 0x0
- field public static final int RABI_1 = 2; // 0x2
- field public static final int RABI_2 = 3; // 0x3
- field public static final int RAJAB = 6; // 0x6
- field public static final int RAMADAN = 8; // 0x8
- field public static final int SAFAR = 1; // 0x1
- field public static final int SHABAN = 7; // 0x7
- field public static final int SHAWWAL = 9; // 0x9
- }
-
- public enum IslamicCalendar.CalculationType {
- enum_constant public static final android.icu.util.IslamicCalendar.CalculationType ISLAMIC;
- enum_constant public static final android.icu.util.IslamicCalendar.CalculationType ISLAMIC_CIVIL;
- enum_constant public static final android.icu.util.IslamicCalendar.CalculationType ISLAMIC_TBLA;
- enum_constant public static final android.icu.util.IslamicCalendar.CalculationType ISLAMIC_UMALQURA;
- }
-
- public class JapaneseCalendar extends android.icu.util.GregorianCalendar {
- ctor public JapaneseCalendar();
- ctor public JapaneseCalendar(android.icu.util.TimeZone);
- ctor public JapaneseCalendar(java.util.Locale);
- ctor public JapaneseCalendar(android.icu.util.ULocale);
- ctor public JapaneseCalendar(android.icu.util.TimeZone, java.util.Locale);
- ctor public JapaneseCalendar(android.icu.util.TimeZone, android.icu.util.ULocale);
- ctor public JapaneseCalendar(java.util.Date);
- ctor public JapaneseCalendar(int, int, int, int);
- ctor public JapaneseCalendar(int, int, int);
- ctor public JapaneseCalendar(int, int, int, int, int, int);
- field public static final int HEISEI;
- field public static final int MEIJI;
- field public static final int REIWA;
- field public static final int SHOWA;
- field public static final int TAISHO;
- }
-
- public final class LocaleData {
- method public static android.icu.util.VersionInfo getCLDRVersion();
- method public String getDelimiter(int);
- method public static android.icu.util.LocaleData getInstance(android.icu.util.ULocale);
- method public static android.icu.util.LocaleData getInstance();
- method public static android.icu.util.LocaleData.MeasurementSystem getMeasurementSystem(android.icu.util.ULocale);
- method public boolean getNoSubstitute();
- method public static android.icu.util.LocaleData.PaperSize getPaperSize(android.icu.util.ULocale);
- method public void setNoSubstitute(boolean);
- field public static final int ALT_QUOTATION_END = 3; // 0x3
- field public static final int ALT_QUOTATION_START = 2; // 0x2
- field public static final int QUOTATION_END = 1; // 0x1
- field public static final int QUOTATION_START = 0; // 0x0
- }
-
- public static final class LocaleData.MeasurementSystem {
- field public static final android.icu.util.LocaleData.MeasurementSystem SI;
- field public static final android.icu.util.LocaleData.MeasurementSystem UK;
- field public static final android.icu.util.LocaleData.MeasurementSystem US;
- }
-
- public static final class LocaleData.PaperSize {
- method public int getHeight();
- method public int getWidth();
- }
-
- public class Measure {
- ctor public Measure(Number, android.icu.util.MeasureUnit);
- method public Number getNumber();
- method public android.icu.util.MeasureUnit getUnit();
- }
-
- public class MeasureUnit implements java.io.Serializable {
- method public static java.util.Set<android.icu.util.MeasureUnit> getAvailable(String);
- method public static java.util.Set<android.icu.util.MeasureUnit> getAvailable();
- method public static java.util.Set<java.lang.String> getAvailableTypes();
- method public String getSubtype();
- method public String getType();
- field public static final android.icu.util.MeasureUnit ACRE;
- field public static final android.icu.util.MeasureUnit ACRE_FOOT;
- field public static final android.icu.util.MeasureUnit AMPERE;
- field public static final android.icu.util.MeasureUnit ARC_MINUTE;
- field public static final android.icu.util.MeasureUnit ARC_SECOND;
- field public static final android.icu.util.MeasureUnit ASTRONOMICAL_UNIT;
- field public static final android.icu.util.MeasureUnit ATMOSPHERE;
- field public static final android.icu.util.MeasureUnit BIT;
- field public static final android.icu.util.MeasureUnit BUSHEL;
- field public static final android.icu.util.MeasureUnit BYTE;
- field public static final android.icu.util.MeasureUnit CALORIE;
- field public static final android.icu.util.MeasureUnit CARAT;
- field public static final android.icu.util.MeasureUnit CELSIUS;
- field public static final android.icu.util.MeasureUnit CENTILITER;
- field public static final android.icu.util.MeasureUnit CENTIMETER;
- field public static final android.icu.util.MeasureUnit CENTURY;
- field public static final android.icu.util.MeasureUnit CUBIC_CENTIMETER;
- field public static final android.icu.util.MeasureUnit CUBIC_FOOT;
- field public static final android.icu.util.MeasureUnit CUBIC_INCH;
- field public static final android.icu.util.MeasureUnit CUBIC_KILOMETER;
- field public static final android.icu.util.MeasureUnit CUBIC_METER;
- field public static final android.icu.util.MeasureUnit CUBIC_MILE;
- field public static final android.icu.util.MeasureUnit CUBIC_YARD;
- field public static final android.icu.util.MeasureUnit CUP;
- field public static final android.icu.util.MeasureUnit CUP_METRIC;
- field public static final android.icu.util.TimeUnit DAY;
- field public static final android.icu.util.MeasureUnit DECILITER;
- field public static final android.icu.util.MeasureUnit DECIMETER;
- field public static final android.icu.util.MeasureUnit DEGREE;
- field public static final android.icu.util.MeasureUnit FAHRENHEIT;
- field public static final android.icu.util.MeasureUnit FATHOM;
- field public static final android.icu.util.MeasureUnit FLUID_OUNCE;
- field public static final android.icu.util.MeasureUnit FOODCALORIE;
- field public static final android.icu.util.MeasureUnit FOOT;
- field public static final android.icu.util.MeasureUnit FURLONG;
- field public static final android.icu.util.MeasureUnit GALLON;
- field public static final android.icu.util.MeasureUnit GALLON_IMPERIAL;
- field public static final android.icu.util.MeasureUnit GENERIC_TEMPERATURE;
- field public static final android.icu.util.MeasureUnit GIGABIT;
- field public static final android.icu.util.MeasureUnit GIGABYTE;
- field public static final android.icu.util.MeasureUnit GIGAHERTZ;
- field public static final android.icu.util.MeasureUnit GIGAWATT;
- field public static final android.icu.util.MeasureUnit GRAM;
- field public static final android.icu.util.MeasureUnit G_FORCE;
- field public static final android.icu.util.MeasureUnit HECTARE;
- field public static final android.icu.util.MeasureUnit HECTOLITER;
- field public static final android.icu.util.MeasureUnit HECTOPASCAL;
- field public static final android.icu.util.MeasureUnit HERTZ;
- field public static final android.icu.util.MeasureUnit HORSEPOWER;
- field public static final android.icu.util.TimeUnit HOUR;
- field public static final android.icu.util.MeasureUnit INCH;
- field public static final android.icu.util.MeasureUnit INCH_HG;
- field public static final android.icu.util.MeasureUnit JOULE;
- field public static final android.icu.util.MeasureUnit KARAT;
- field public static final android.icu.util.MeasureUnit KELVIN;
- field public static final android.icu.util.MeasureUnit KILOBIT;
- field public static final android.icu.util.MeasureUnit KILOBYTE;
- field public static final android.icu.util.MeasureUnit KILOCALORIE;
- field public static final android.icu.util.MeasureUnit KILOGRAM;
- field public static final android.icu.util.MeasureUnit KILOHERTZ;
- field public static final android.icu.util.MeasureUnit KILOJOULE;
- field public static final android.icu.util.MeasureUnit KILOMETER;
- field public static final android.icu.util.MeasureUnit KILOMETER_PER_HOUR;
- field public static final android.icu.util.MeasureUnit KILOWATT;
- field public static final android.icu.util.MeasureUnit KILOWATT_HOUR;
- field public static final android.icu.util.MeasureUnit KNOT;
- field public static final android.icu.util.MeasureUnit LIGHT_YEAR;
- field public static final android.icu.util.MeasureUnit LITER;
- field public static final android.icu.util.MeasureUnit LITER_PER_100KILOMETERS;
- field public static final android.icu.util.MeasureUnit LITER_PER_KILOMETER;
- field public static final android.icu.util.MeasureUnit LUX;
- field public static final android.icu.util.MeasureUnit MEGABIT;
- field public static final android.icu.util.MeasureUnit MEGABYTE;
- field public static final android.icu.util.MeasureUnit MEGAHERTZ;
- field public static final android.icu.util.MeasureUnit MEGALITER;
- field public static final android.icu.util.MeasureUnit MEGAWATT;
- field public static final android.icu.util.MeasureUnit METER;
- field public static final android.icu.util.MeasureUnit METER_PER_SECOND;
- field public static final android.icu.util.MeasureUnit METER_PER_SECOND_SQUARED;
- field public static final android.icu.util.MeasureUnit METRIC_TON;
- field public static final android.icu.util.MeasureUnit MICROGRAM;
- field public static final android.icu.util.MeasureUnit MICROMETER;
- field public static final android.icu.util.MeasureUnit MICROSECOND;
- field public static final android.icu.util.MeasureUnit MILE;
- field public static final android.icu.util.MeasureUnit MILE_PER_GALLON;
- field public static final android.icu.util.MeasureUnit MILE_PER_GALLON_IMPERIAL;
- field public static final android.icu.util.MeasureUnit MILE_PER_HOUR;
- field public static final android.icu.util.MeasureUnit MILE_SCANDINAVIAN;
- field public static final android.icu.util.MeasureUnit MILLIAMPERE;
- field public static final android.icu.util.MeasureUnit MILLIBAR;
- field public static final android.icu.util.MeasureUnit MILLIGRAM;
- field public static final android.icu.util.MeasureUnit MILLIGRAM_PER_DECILITER;
- field public static final android.icu.util.MeasureUnit MILLILITER;
- field public static final android.icu.util.MeasureUnit MILLIMETER;
- field public static final android.icu.util.MeasureUnit MILLIMETER_OF_MERCURY;
- field public static final android.icu.util.MeasureUnit MILLIMOLE_PER_LITER;
- field public static final android.icu.util.MeasureUnit MILLISECOND;
- field public static final android.icu.util.MeasureUnit MILLIWATT;
- field public static final android.icu.util.TimeUnit MINUTE;
- field public static final android.icu.util.TimeUnit MONTH;
- field public static final android.icu.util.MeasureUnit NANOMETER;
- field public static final android.icu.util.MeasureUnit NANOSECOND;
- field public static final android.icu.util.MeasureUnit NAUTICAL_MILE;
- field public static final android.icu.util.MeasureUnit OHM;
- field public static final android.icu.util.MeasureUnit OUNCE;
- field public static final android.icu.util.MeasureUnit OUNCE_TROY;
- field public static final android.icu.util.MeasureUnit PARSEC;
- field public static final android.icu.util.MeasureUnit PART_PER_MILLION;
- field public static final android.icu.util.MeasureUnit PERCENT;
- field public static final android.icu.util.MeasureUnit PERMILLE;
- field public static final android.icu.util.MeasureUnit PETABYTE;
- field public static final android.icu.util.MeasureUnit PICOMETER;
- field public static final android.icu.util.MeasureUnit PINT;
- field public static final android.icu.util.MeasureUnit PINT_METRIC;
- field public static final android.icu.util.MeasureUnit POINT;
- field public static final android.icu.util.MeasureUnit POUND;
- field public static final android.icu.util.MeasureUnit POUND_PER_SQUARE_INCH;
- field public static final android.icu.util.MeasureUnit QUART;
- field public static final android.icu.util.MeasureUnit RADIAN;
- field public static final android.icu.util.MeasureUnit REVOLUTION_ANGLE;
- field public static final android.icu.util.TimeUnit SECOND;
- field public static final android.icu.util.MeasureUnit SQUARE_CENTIMETER;
- field public static final android.icu.util.MeasureUnit SQUARE_FOOT;
- field public static final android.icu.util.MeasureUnit SQUARE_INCH;
- field public static final android.icu.util.MeasureUnit SQUARE_KILOMETER;
- field public static final android.icu.util.MeasureUnit SQUARE_METER;
- field public static final android.icu.util.MeasureUnit SQUARE_MILE;
- field public static final android.icu.util.MeasureUnit SQUARE_YARD;
- field public static final android.icu.util.MeasureUnit STONE;
- field public static final android.icu.util.MeasureUnit TABLESPOON;
- field public static final android.icu.util.MeasureUnit TEASPOON;
- field public static final android.icu.util.MeasureUnit TERABIT;
- field public static final android.icu.util.MeasureUnit TERABYTE;
- field public static final android.icu.util.MeasureUnit TON;
- field public static final android.icu.util.MeasureUnit VOLT;
- field public static final android.icu.util.MeasureUnit WATT;
- field public static final android.icu.util.TimeUnit WEEK;
- field public static final android.icu.util.MeasureUnit YARD;
- field public static final android.icu.util.TimeUnit YEAR;
- }
-
- public class Output<T> {
- ctor public Output();
- ctor public Output(T);
- field public T value;
- }
-
- public interface RangeValueIterator {
- method public boolean next(android.icu.util.RangeValueIterator.Element);
- method public void reset();
- }
-
- public static class RangeValueIterator.Element {
- ctor public RangeValueIterator.Element();
- field public int limit;
- field public int start;
- field public int value;
- }
-
- public class TaiwanCalendar extends android.icu.util.GregorianCalendar {
- ctor public TaiwanCalendar();
- ctor public TaiwanCalendar(android.icu.util.TimeZone);
- ctor public TaiwanCalendar(java.util.Locale);
- ctor public TaiwanCalendar(android.icu.util.ULocale);
- ctor public TaiwanCalendar(android.icu.util.TimeZone, java.util.Locale);
- ctor public TaiwanCalendar(android.icu.util.TimeZone, android.icu.util.ULocale);
- ctor public TaiwanCalendar(java.util.Date);
- ctor public TaiwanCalendar(int, int, int);
- ctor public TaiwanCalendar(int, int, int, int, int, int);
- field public static final int BEFORE_MINGUO = 0; // 0x0
- field public static final int MINGUO = 1; // 0x1
- }
-
- public class TimeUnit extends android.icu.util.MeasureUnit {
- method public static android.icu.util.TimeUnit[] values();
- }
-
- public abstract class TimeZone implements java.lang.Cloneable android.icu.util.Freezable<android.icu.util.TimeZone> java.io.Serializable {
- ctor public TimeZone();
- method public Object clone();
- method public android.icu.util.TimeZone cloneAsThawed();
- method public static int countEquivalentIDs(String);
- method public android.icu.util.TimeZone freeze();
- method public static java.util.Set<java.lang.String> getAvailableIDs(android.icu.util.TimeZone.SystemTimeZoneType, String, Integer);
- method public static String[] getAvailableIDs(int);
- method public static String[] getAvailableIDs(String);
- method public static String[] getAvailableIDs();
- method public static String getCanonicalID(String);
- method public static String getCanonicalID(String, boolean[]);
- method public int getDSTSavings();
- method public static android.icu.util.TimeZone getDefault();
- method public final String getDisplayName();
- method public final String getDisplayName(java.util.Locale);
- method public final String getDisplayName(android.icu.util.ULocale);
- method public final String getDisplayName(boolean, int);
- method public String getDisplayName(boolean, int, java.util.Locale);
- method public String getDisplayName(boolean, int, android.icu.util.ULocale);
- method public static String getEquivalentID(String, int);
- method public static android.icu.util.TimeZone getFrozenTimeZone(String);
- method public String getID();
- method public static String getIDForWindowsID(String, String);
- method public abstract int getOffset(int, int, int, int, int, int);
- method public int getOffset(long);
- method public void getOffset(long, boolean, int[]);
- method public abstract int getRawOffset();
- method public static String getRegion(String);
- method public static String getTZDataVersion();
- method public static android.icu.util.TimeZone getTimeZone(String);
- method public static android.icu.util.TimeZone getTimeZone(String, int);
- method public static String getWindowsID(String);
- method public boolean hasSameRules(android.icu.util.TimeZone);
- method public abstract boolean inDaylightTime(java.util.Date);
- method public boolean isFrozen();
- method public boolean observesDaylightTime();
- method public void setID(String);
- method public abstract void setRawOffset(int);
- method public abstract boolean useDaylightTime();
- field public static final int GENERIC_LOCATION = 7; // 0x7
- field public static final android.icu.util.TimeZone GMT_ZONE;
- field public static final int LONG = 1; // 0x1
- field public static final int LONG_GENERIC = 3; // 0x3
- field public static final int LONG_GMT = 5; // 0x5
- field public static final int SHORT = 0; // 0x0
- field public static final int SHORT_COMMONLY_USED = 6; // 0x6
- field public static final int SHORT_GENERIC = 2; // 0x2
- field public static final int SHORT_GMT = 4; // 0x4
- field public static final int TIMEZONE_ICU = 0; // 0x0
- field public static final int TIMEZONE_JDK = 1; // 0x1
- field public static final android.icu.util.TimeZone UNKNOWN_ZONE;
- field public static final String UNKNOWN_ZONE_ID = "Etc/Unknown";
- }
-
- public enum TimeZone.SystemTimeZoneType {
- enum_constant public static final android.icu.util.TimeZone.SystemTimeZoneType ANY;
- enum_constant public static final android.icu.util.TimeZone.SystemTimeZoneType CANONICAL;
- enum_constant public static final android.icu.util.TimeZone.SystemTimeZoneType CANONICAL_LOCATION;
- }
-
- public final class ULocale implements java.lang.Comparable<android.icu.util.ULocale> java.io.Serializable {
- ctor public ULocale(String);
- ctor public ULocale(String, String);
- ctor public ULocale(String, String, String);
- method public static android.icu.util.ULocale acceptLanguage(String, android.icu.util.ULocale[], boolean[]);
- method public static android.icu.util.ULocale acceptLanguage(android.icu.util.ULocale[], android.icu.util.ULocale[], boolean[]);
- method public static android.icu.util.ULocale acceptLanguage(String, boolean[]);
- method public static android.icu.util.ULocale acceptLanguage(android.icu.util.ULocale[], boolean[]);
- method public static android.icu.util.ULocale addLikelySubtags(android.icu.util.ULocale);
- method public static String canonicalize(String);
- method public Object clone();
- method public int compareTo(android.icu.util.ULocale);
- method public static android.icu.util.ULocale createCanonical(String);
- method public static android.icu.util.ULocale forLanguageTag(String);
- method public static android.icu.util.ULocale forLocale(java.util.Locale);
- method public static android.icu.util.ULocale[] getAvailableLocales();
- method public String getBaseName();
- method public static String getBaseName(String);
- method public String getCharacterOrientation();
- method public String getCountry();
- method public static String getCountry(String);
- method public static android.icu.util.ULocale getDefault();
- method public static android.icu.util.ULocale getDefault(android.icu.util.ULocale.Category);
- method public String getDisplayCountry();
- method public String getDisplayCountry(android.icu.util.ULocale);
- method public static String getDisplayCountry(String, String);
- method public static String getDisplayCountry(String, android.icu.util.ULocale);
- method public static String getDisplayKeyword(String);
- method public static String getDisplayKeyword(String, String);
- method public static String getDisplayKeyword(String, android.icu.util.ULocale);
- method public String getDisplayKeywordValue(String);
- method public String getDisplayKeywordValue(String, android.icu.util.ULocale);
- method public static String getDisplayKeywordValue(String, String, String);
- method public static String getDisplayKeywordValue(String, String, android.icu.util.ULocale);
- method public String getDisplayLanguage();
- method public String getDisplayLanguage(android.icu.util.ULocale);
- method public static String getDisplayLanguage(String, String);
- method public static String getDisplayLanguage(String, android.icu.util.ULocale);
- method public String getDisplayLanguageWithDialect();
- method public String getDisplayLanguageWithDialect(android.icu.util.ULocale);
- method public static String getDisplayLanguageWithDialect(String, String);
- method public static String getDisplayLanguageWithDialect(String, android.icu.util.ULocale);
- method public String getDisplayName();
- method public String getDisplayName(android.icu.util.ULocale);
- method public static String getDisplayName(String, String);
- method public static String getDisplayName(String, android.icu.util.ULocale);
- method public String getDisplayNameWithDialect();
- method public String getDisplayNameWithDialect(android.icu.util.ULocale);
- method public static String getDisplayNameWithDialect(String, String);
- method public static String getDisplayNameWithDialect(String, android.icu.util.ULocale);
- method public String getDisplayScript();
- method public String getDisplayScript(android.icu.util.ULocale);
- method public static String getDisplayScript(String, String);
- method public static String getDisplayScript(String, android.icu.util.ULocale);
- method public String getDisplayVariant();
- method public String getDisplayVariant(android.icu.util.ULocale);
- method public static String getDisplayVariant(String, String);
- method public static String getDisplayVariant(String, android.icu.util.ULocale);
- method public String getExtension(char);
- method public java.util.Set<java.lang.Character> getExtensionKeys();
- method public static String getFallback(String);
- method public android.icu.util.ULocale getFallback();
- method public String getISO3Country();
- method public static String getISO3Country(String);
- method public String getISO3Language();
- method public static String getISO3Language(String);
- method public static String[] getISOCountries();
- method public static String[] getISOLanguages();
- method public String getKeywordValue(String);
- method public static String getKeywordValue(String, String);
- method public java.util.Iterator<java.lang.String> getKeywords();
- method public static java.util.Iterator<java.lang.String> getKeywords(String);
- method public String getLanguage();
- method public static String getLanguage(String);
- method public String getLineOrientation();
- method public String getName();
- method public static String getName(String);
- method public String getScript();
- method public static String getScript(String);
- method public java.util.Set<java.lang.String> getUnicodeLocaleAttributes();
- method public java.util.Set<java.lang.String> getUnicodeLocaleKeys();
- method public String getUnicodeLocaleType(String);
- method public String getVariant();
- method public static String getVariant(String);
- method public boolean isRightToLeft();
- method public static android.icu.util.ULocale minimizeSubtags(android.icu.util.ULocale);
- method public android.icu.util.ULocale setKeywordValue(String, String);
- method public static String setKeywordValue(String, String, String);
- method public String toLanguageTag();
- method public static String toLegacyKey(String);
- method public static String toLegacyType(String, String);
- method public java.util.Locale toLocale();
- method public static String toUnicodeLocaleKey(String);
- method public static String toUnicodeLocaleType(String, String);
- field public static final android.icu.util.ULocale CANADA;
- field public static final android.icu.util.ULocale CANADA_FRENCH;
- field public static final android.icu.util.ULocale CHINA;
- field public static final android.icu.util.ULocale CHINESE;
- field public static final android.icu.util.ULocale ENGLISH;
- field public static final android.icu.util.ULocale FRANCE;
- field public static final android.icu.util.ULocale FRENCH;
- field public static final android.icu.util.ULocale GERMAN;
- field public static final android.icu.util.ULocale GERMANY;
- field public static final android.icu.util.ULocale ITALIAN;
- field public static final android.icu.util.ULocale ITALY;
- field public static final android.icu.util.ULocale JAPAN;
- field public static final android.icu.util.ULocale JAPANESE;
- field public static final android.icu.util.ULocale KOREA;
- field public static final android.icu.util.ULocale KOREAN;
- field public static final android.icu.util.ULocale PRC;
- field public static final char PRIVATE_USE_EXTENSION = 120; // 0x0078 'x'
- field public static final android.icu.util.ULocale ROOT;
- field public static final android.icu.util.ULocale SIMPLIFIED_CHINESE;
- field public static final android.icu.util.ULocale TAIWAN;
- field public static final android.icu.util.ULocale TRADITIONAL_CHINESE;
- field public static final android.icu.util.ULocale UK;
- field public static final char UNICODE_LOCALE_EXTENSION = 117; // 0x0075 'u'
- field public static final android.icu.util.ULocale US;
- }
-
- public static final class ULocale.Builder {
- ctor public ULocale.Builder();
- method public android.icu.util.ULocale.Builder addUnicodeLocaleAttribute(String);
- method public android.icu.util.ULocale build();
- method public android.icu.util.ULocale.Builder clear();
- method public android.icu.util.ULocale.Builder clearExtensions();
- method public android.icu.util.ULocale.Builder removeUnicodeLocaleAttribute(String);
- method public android.icu.util.ULocale.Builder setExtension(char, String);
- method public android.icu.util.ULocale.Builder setLanguage(String);
- method public android.icu.util.ULocale.Builder setLanguageTag(String);
- method public android.icu.util.ULocale.Builder setLocale(android.icu.util.ULocale);
- method public android.icu.util.ULocale.Builder setRegion(String);
- method public android.icu.util.ULocale.Builder setScript(String);
- method public android.icu.util.ULocale.Builder setUnicodeLocaleKeyword(String, String);
- method public android.icu.util.ULocale.Builder setVariant(String);
- }
-
- public enum ULocale.Category {
- enum_constant public static final android.icu.util.ULocale.Category DISPLAY;
- enum_constant public static final android.icu.util.ULocale.Category FORMAT;
- }
-
- public final class UniversalTimeScale {
- method public static android.icu.math.BigDecimal bigDecimalFrom(double, int);
- method public static android.icu.math.BigDecimal bigDecimalFrom(long, int);
- method public static android.icu.math.BigDecimal bigDecimalFrom(android.icu.math.BigDecimal, int);
- method public static long from(long, int);
- method public static long getTimeScaleValue(int, int);
- method public static android.icu.math.BigDecimal toBigDecimal(long, int);
- method public static android.icu.math.BigDecimal toBigDecimal(android.icu.math.BigDecimal, int);
- method public static long toLong(long, int);
- field public static final int DB2_TIME = 8; // 0x8
- field public static final int DOTNET_DATE_TIME = 4; // 0x4
- field public static final int EPOCH_OFFSET_PLUS_1_VALUE = 6; // 0x6
- field public static final int EPOCH_OFFSET_VALUE = 1; // 0x1
- field public static final int EXCEL_TIME = 7; // 0x7
- field public static final int FROM_MAX_VALUE = 3; // 0x3
- field public static final int FROM_MIN_VALUE = 2; // 0x2
- field public static final int ICU4C_TIME = 2; // 0x2
- field public static final int JAVA_TIME = 0; // 0x0
- field public static final int MAC_OLD_TIME = 5; // 0x5
- field public static final int MAC_TIME = 6; // 0x6
- field @Deprecated public static final int MAX_SCALE = 10; // 0xa
- field public static final int TO_MAX_VALUE = 5; // 0x5
- field public static final int TO_MIN_VALUE = 4; // 0x4
- field public static final int UNITS_VALUE = 0; // 0x0
- field public static final int UNIX_MICROSECONDS_TIME = 9; // 0x9
- field public static final int UNIX_TIME = 1; // 0x1
- field public static final int WINDOWS_FILE_TIME = 3; // 0x3
- }
-
- public interface ValueIterator {
- method public boolean next(android.icu.util.ValueIterator.Element);
- method public void reset();
- method public void setRange(int, int);
- }
-
- public static final class ValueIterator.Element {
- ctor public ValueIterator.Element();
- field public int integer;
- field public Object value;
- }
-
- public final class VersionInfo implements java.lang.Comparable<android.icu.util.VersionInfo> {
- method public int compareTo(android.icu.util.VersionInfo);
- method public static android.icu.util.VersionInfo getInstance(String);
- method public static android.icu.util.VersionInfo getInstance(int, int, int, int);
- method public static android.icu.util.VersionInfo getInstance(int, int, int);
- method public static android.icu.util.VersionInfo getInstance(int, int);
- method public static android.icu.util.VersionInfo getInstance(int);
- method public int getMajor();
- method public int getMicro();
- method public int getMilli();
- method public int getMinor();
- field public static final android.icu.util.VersionInfo ICU_VERSION;
- field public static final android.icu.util.VersionInfo UCOL_BUILDER_VERSION;
- field public static final android.icu.util.VersionInfo UCOL_RUNTIME_VERSION;
- field public static final android.icu.util.VersionInfo UNICODE_10_0;
- field public static final android.icu.util.VersionInfo UNICODE_11_0;
- field public static final android.icu.util.VersionInfo UNICODE_12_0;
- field public static final android.icu.util.VersionInfo UNICODE_12_1;
- field public static final android.icu.util.VersionInfo UNICODE_13_0;
- field public static final android.icu.util.VersionInfo UNICODE_1_0;
- field public static final android.icu.util.VersionInfo UNICODE_1_0_1;
- field public static final android.icu.util.VersionInfo UNICODE_1_1_0;
- field public static final android.icu.util.VersionInfo UNICODE_1_1_5;
- field public static final android.icu.util.VersionInfo UNICODE_2_0;
- field public static final android.icu.util.VersionInfo UNICODE_2_1_2;
- field public static final android.icu.util.VersionInfo UNICODE_2_1_5;
- field public static final android.icu.util.VersionInfo UNICODE_2_1_8;
- field public static final android.icu.util.VersionInfo UNICODE_2_1_9;
- field public static final android.icu.util.VersionInfo UNICODE_3_0;
- field public static final android.icu.util.VersionInfo UNICODE_3_0_1;
- field public static final android.icu.util.VersionInfo UNICODE_3_1_0;
- field public static final android.icu.util.VersionInfo UNICODE_3_1_1;
- field public static final android.icu.util.VersionInfo UNICODE_3_2;
- field public static final android.icu.util.VersionInfo UNICODE_4_0;
- field public static final android.icu.util.VersionInfo UNICODE_4_0_1;
- field public static final android.icu.util.VersionInfo UNICODE_4_1;
- field public static final android.icu.util.VersionInfo UNICODE_5_0;
- field public static final android.icu.util.VersionInfo UNICODE_5_1;
- field public static final android.icu.util.VersionInfo UNICODE_5_2;
- field public static final android.icu.util.VersionInfo UNICODE_6_0;
- field public static final android.icu.util.VersionInfo UNICODE_6_1;
- field public static final android.icu.util.VersionInfo UNICODE_6_2;
- field public static final android.icu.util.VersionInfo UNICODE_6_3;
- field public static final android.icu.util.VersionInfo UNICODE_7_0;
- field public static final android.icu.util.VersionInfo UNICODE_8_0;
- field public static final android.icu.util.VersionInfo UNICODE_9_0;
- }
-
-}
-
package android.inputmethodservice {
public abstract class AbstractInputMethodService extends android.app.Service implements android.view.KeyEvent.Callback {
@@ -24007,7 +19204,7 @@ package android.location {
method public float getBearingAccuracyDegrees();
method public long getElapsedRealtimeNanos();
method public double getElapsedRealtimeUncertaintyNanos();
- method @Deprecated public android.os.Bundle getExtras();
+ method public android.os.Bundle getExtras();
method public double getLatitude();
method public double getLongitude();
method public String getProvider();
@@ -24036,7 +19233,7 @@ package android.location {
method public void setBearingAccuracyDegrees(float);
method public void setElapsedRealtimeNanos(long);
method public void setElapsedRealtimeUncertaintyNanos(double);
- method @Deprecated public void setExtras(@Nullable android.os.Bundle);
+ method public void setExtras(@Nullable android.os.Bundle);
method public void setLatitude(double);
method public void setLongitude(double);
method public void setProvider(String);
@@ -24107,10 +19304,10 @@ package android.location {
method @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void requestLocationUpdates(@NonNull String, long, float, @NonNull android.location.LocationListener);
method @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void requestLocationUpdates(@NonNull String, long, float, @NonNull android.location.LocationListener, @Nullable android.os.Looper);
method @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void requestLocationUpdates(@NonNull String, long, float, @NonNull java.util.concurrent.Executor, @NonNull android.location.LocationListener);
- method @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void requestLocationUpdates(long, float, @NonNull android.location.Criteria, @NonNull android.location.LocationListener, @Nullable android.os.Looper);
- method @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void requestLocationUpdates(long, float, @NonNull android.location.Criteria, @NonNull java.util.concurrent.Executor, @NonNull android.location.LocationListener);
+ method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void requestLocationUpdates(long, float, @NonNull android.location.Criteria, @NonNull android.location.LocationListener, @Nullable android.os.Looper);
+ method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void requestLocationUpdates(long, float, @NonNull android.location.Criteria, @NonNull java.util.concurrent.Executor, @NonNull android.location.LocationListener);
method @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void requestLocationUpdates(@NonNull String, long, float, @NonNull android.app.PendingIntent);
- method @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void requestLocationUpdates(long, float, @NonNull android.location.Criteria, @NonNull android.app.PendingIntent);
+ method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void requestLocationUpdates(long, float, @NonNull android.location.Criteria, @NonNull android.app.PendingIntent);
method @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void requestLocationUpdates(@NonNull String, @NonNull android.location.LocationRequest, @NonNull java.util.concurrent.Executor, @NonNull android.location.LocationListener);
method @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void requestLocationUpdates(@NonNull String, @NonNull android.location.LocationRequest, @NonNull android.app.PendingIntent);
method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void requestSingleUpdate(@NonNull String, @NonNull android.location.LocationListener, @Nullable android.os.Looper);
@@ -24128,6 +19325,7 @@ package android.location {
field public static final String EXTRA_LOCATION_ENABLED = "android.location.extra.LOCATION_ENABLED";
field public static final String EXTRA_PROVIDER_ENABLED = "android.location.extra.PROVIDER_ENABLED";
field public static final String EXTRA_PROVIDER_NAME = "android.location.extra.PROVIDER_NAME";
+ field public static final String FUSED_PROVIDER = "fused";
field public static final String GPS_PROVIDER = "gps";
field public static final String KEY_FLUSH_COMPLETE = "flushComplete";
field public static final String KEY_LOCATION_CHANGED = "location";
@@ -24475,6 +19673,7 @@ package android.media {
method public java.util.List<android.media.MicrophoneInfo> getMicrophones() throws java.io.IOException;
method public int getMode();
method public String getParameters(String);
+ method public static int getPlaybackOffloadSupport(@NonNull android.media.AudioFormat, @NonNull android.media.AudioAttributes);
method public String getProperty(String);
method public int getRingerMode();
method @Deprecated public int getRouting(int);
@@ -24593,6 +19792,9 @@ package android.media {
field public static final int MODE_NORMAL = 0; // 0x0
field public static final int MODE_RINGTONE = 1; // 0x1
field @Deprecated public static final int NUM_STREAMS = 5; // 0x5
+ field public static final int PLAYBACK_OFFLOAD_GAPLESS_SUPPORTED = 2; // 0x2
+ field public static final int PLAYBACK_OFFLOAD_NOT_SUPPORTED = 0; // 0x0
+ field public static final int PLAYBACK_OFFLOAD_SUPPORTED = 1; // 0x1
field public static final String PROPERTY_OUTPUT_FRAMES_PER_BUFFER = "android.media.property.OUTPUT_FRAMES_PER_BUFFER";
field public static final String PROPERTY_OUTPUT_SAMPLE_RATE = "android.media.property.OUTPUT_SAMPLE_RATE";
field public static final String PROPERTY_SUPPORT_AUDIO_SOURCE_UNPROCESSED = "android.media.property.SUPPORT_AUDIO_SOURCE_UNPROCESSED";
@@ -34725,6 +29927,7 @@ package android.os {
field public static final String ID;
field public static final String MANUFACTURER;
field public static final String MODEL;
+ field @NonNull public static final String ODM_SKU;
field public static final String PRODUCT;
field @Deprecated public static final String RADIO;
field @Deprecated public static final String SERIAL;
@@ -45881,6 +41084,28 @@ package android.telephony {
field public static final int IP_VERSION_MISMATCH = 2055; // 0x807
field public static final int IRAT_HANDOVER_FAILED = 2194; // 0x892
field public static final int IS707B_MAX_ACCESS_PROBES = 2089; // 0x829
+ field public static final int IWLAN_AUTHORIZATION_REJECTED = 9003; // 0x232b
+ field public static final int IWLAN_DNS_RESOLUTION_NAME_FAILURE = 16388; // 0x4004
+ field public static final int IWLAN_DNS_RESOLUTION_TIMEOUT = 16389; // 0x4005
+ field public static final int IWLAN_IKEV2_AUTH_FAILURE = 16385; // 0x4001
+ field public static final int IWLAN_IKEV2_CERT_INVALID = 16387; // 0x4003
+ field public static final int IWLAN_IKEV2_CONFIG_FAILURE = 16384; // 0x4000
+ field public static final int IWLAN_IKEV2_MSG_TIMEOUT = 16386; // 0x4002
+ field public static final int IWLAN_ILLEGAL_ME = 9006; // 0x232e
+ field public static final int IWLAN_IMEI_NOT_ACCEPTED = 11005; // 0x2afd
+ field public static final int IWLAN_MAX_CONNECTION_REACHED = 8193; // 0x2001
+ field public static final int IWLAN_NETWORK_FAILURE = 10500; // 0x2904
+ field public static final int IWLAN_NON_3GPP_ACCESS_TO_EPC_NOT_ALLOWED = 9000; // 0x2328
+ field public static final int IWLAN_NO_APN_SUBSCRIPTION = 9002; // 0x232a
+ field public static final int IWLAN_PDN_CONNECTION_REJECTION = 8192; // 0x2000
+ field public static final int IWLAN_PLMN_NOT_ALLOWED = 11011; // 0x2b03
+ field public static final int IWLAN_RAT_TYPE_NOT_ALLOWED = 11001; // 0x2af9
+ field public static final int IWLAN_SEMANTIC_ERRORS_IN_PACKET_FILTERS = 8244; // 0x2034
+ field public static final int IWLAN_SEMANTIC_ERROR_IN_THE_TFT_OPERATION = 8241; // 0x2031
+ field public static final int IWLAN_SYNTACTICAL_ERRORS_IN_PACKET_FILTERS = 8245; // 0x2035
+ field public static final int IWLAN_SYNTACTICAL_ERROR_IN_THE_TFT_OPERATION = 8242; // 0x2032
+ field public static final int IWLAN_UNAUTHENTICATED_EMERGENCY_NOT_SUPPORTED = 11055; // 0x2b2f
+ field public static final int IWLAN_USER_UNKNOWN = 9001; // 0x2329
field public static final int LIMITED_TO_IPV4 = 2234; // 0x8ba
field public static final int LIMITED_TO_IPV6 = 2235; // 0x8bb
field public static final int LLC_SNDCP = 25; // 0x19
@@ -46990,6 +42215,7 @@ package android.telephony {
method @NonNull @RequiresPermission(android.Manifest.permission.READ_PRECISE_PHONE_STATE) public String getManualNetworkSelectionPlmn();
method @Nullable public String getManufacturerCode();
method @Nullable public String getManufacturerCode(int);
+ method public static long getMaximumCallComposerPictureSize();
method @RequiresPermission("android.permission.READ_PRIVILEGED_PHONE_STATE") public String getMeid();
method @RequiresPermission("android.permission.READ_PRIVILEGED_PHONE_STATE") public String getMeid(int);
method public String getMmsUAProfUrl();
@@ -54230,6 +49456,7 @@ package android.view {
method public void setFlags(int, int);
method public void setFormat(int);
method public void setGravity(int);
+ method @RequiresPermission(android.Manifest.permission.HIDE_OVERLAY_WINDOWS) public final void setHideOverlayWindows(boolean);
method public void setIcon(@DrawableRes int);
method public void setLayout(int, int);
method public void setLocalFocus(boolean, boolean);
diff --git a/core/api/module-lib-current.txt b/core/api/module-lib-current.txt
index d83c0adb3ae1..cbb3bea6327e 100644
--- a/core/api/module-lib-current.txt
+++ b/core/api/module-lib-current.txt
@@ -122,6 +122,20 @@ package android.media.session {
}
+package android.net {
+
+ public final class TcpRepairWindow {
+ ctor public TcpRepairWindow(int, int, int, int, int, int);
+ field public final int maxWindow;
+ field public final int rcvWnd;
+ field public final int rcvWndScale;
+ field public final int rcvWup;
+ field public final int sndWl1;
+ field public final int sndWnd;
+ }
+
+}
+
package android.os {
public class Binder implements android.os.IBinder {
diff --git a/core/api/removed.txt b/core/api/removed.txt
index f2dfb84eb8fe..990388a54c85 100644
--- a/core/api/removed.txt
+++ b/core/api/removed.txt
@@ -213,14 +213,6 @@ package android.hardware {
}
-package android.icu.util {
-
- public class JapaneseCalendar extends android.icu.util.GregorianCalendar {
- field @Deprecated public static final int CURRENT_ERA;
- }
-
-}
-
package android.location {
public class Location implements android.os.Parcelable {
diff --git a/core/api/system-current.txt b/core/api/system-current.txt
index 98dd42de8212..821d3f147282 100644
--- a/core/api/system-current.txt
+++ b/core/api/system-current.txt
@@ -94,7 +94,7 @@ package android {
field public static final String HANDLE_CAR_MODE_CHANGES = "android.permission.HANDLE_CAR_MODE_CHANGES";
field public static final String HARDWARE_TEST = "android.permission.HARDWARE_TEST";
field public static final String HDMI_CEC = "android.permission.HDMI_CEC";
- field public static final String HIDE_NON_SYSTEM_OVERLAY_WINDOWS = "android.permission.HIDE_NON_SYSTEM_OVERLAY_WINDOWS";
+ field @Deprecated public static final String HIDE_NON_SYSTEM_OVERLAY_WINDOWS = "android.permission.HIDE_NON_SYSTEM_OVERLAY_WINDOWS";
field public static final String INJECT_EVENTS = "android.permission.INJECT_EVENTS";
field public static final String INSTALL_DYNAMIC_SYSTEM = "android.permission.INSTALL_DYNAMIC_SYSTEM";
field public static final String INSTALL_GRANT_RUNTIME_PERMISSIONS = "android.permission.INSTALL_GRANT_RUNTIME_PERMISSIONS";
@@ -4173,7 +4173,6 @@ package android.location {
method @RequiresPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) public void setLocationEnabledForUser(boolean, @NonNull android.os.UserHandle);
method @Deprecated @RequiresPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) public boolean setProviderEnabledForUser(@NonNull String, boolean, @NonNull android.os.UserHandle);
method @Deprecated @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public boolean unregisterGnssBatchedLocationCallback(@NonNull android.location.BatchedLocationCallback);
- field public static final String FUSED_PROVIDER = "fused";
}
public final class LocationRequest implements android.os.Parcelable {
@@ -8389,6 +8388,18 @@ package android.printservice.recommendation {
package android.provider {
+ public class CallLog {
+ method @RequiresPermission(android.Manifest.permission.WRITE_CALL_LOG) public static void storeCallComposerPictureAsUser(@NonNull android.content.Context, @Nullable android.os.UserHandle, @NonNull java.io.InputStream, @NonNull java.util.concurrent.Executor, @NonNull android.os.OutcomeReceiver<android.net.Uri,android.provider.CallLog.CallComposerLoggingException>);
+ }
+
+ public static class CallLog.CallComposerLoggingException extends java.lang.Throwable {
+ method public int getErrorCode();
+ field public static final int ERROR_INPUT_CLOSED = 3; // 0x3
+ field public static final int ERROR_REMOTE_END_CLOSED = 1; // 0x1
+ field public static final int ERROR_STORAGE_FULL = 2; // 0x2
+ field public static final int ERROR_UNKNOWN = 0; // 0x0
+ }
+
@Deprecated public static final class ContactsContract.MetadataSync implements android.provider.BaseColumns android.provider.ContactsContract.MetadataSyncColumns {
field @Deprecated public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/contact_metadata";
field @Deprecated public static final String CONTENT_TYPE = "vnd.android.cursor.dir/contact_metadata";
@@ -11282,7 +11293,6 @@ package android.telephony.data {
method @NonNull public android.telephony.data.ApnThrottleStatus.Builder setSlotIndex(int);
method @NonNull public android.telephony.data.ApnThrottleStatus.Builder setThrottleExpiryTimeMillis(long);
method @NonNull public android.telephony.data.ApnThrottleStatus.Builder setTransportType(int);
- field public static final long NO_THROTTLE_EXPIRY_TIME = -1L; // 0xffffffffffffffffL
}
public final class DataCallResponse implements android.os.Parcelable {
@@ -12318,6 +12328,7 @@ package android.telephony.ims {
}
public interface SipDelegateConnection {
+ method public void closeDialog(@NonNull String);
method public void notifyMessageReceiveError(@NonNull String, int);
method public void notifyMessageReceived(@NonNull String);
method public void sendMessage(@NonNull android.telephony.ims.SipMessage, long);
diff --git a/core/api/test-current.txt b/core/api/test-current.txt
index eef73c1f6089..ffe2736fe8c5 100644
--- a/core/api/test-current.txt
+++ b/core/api/test-current.txt
@@ -94,6 +94,8 @@ package android.app {
method public static void resumeAppSwitches() throws android.os.RemoteException;
method @RequiresPermission(android.Manifest.permission.CHANGE_CONFIGURATION) public void scheduleApplicationInfoChanged(java.util.List<java.lang.String>, int);
method @RequiresPermission(android.Manifest.permission.CHANGE_CONFIGURATION) public boolean updateMccMncConfiguration(@NonNull String, @NonNull String);
+ field public static final long DROP_CLOSE_SYSTEM_DIALOGS = 174664120L; // 0xa6929b8L
+ field public static final long LOCK_DOWN_CLOSE_SYSTEM_DIALOGS = 174664365L; // 0xa692aadL
field public static final int PROCESS_CAPABILITY_ALL = 7; // 0x7
field public static final int PROCESS_CAPABILITY_ALL_EXPLICIT = 1; // 0x1
field public static final int PROCESS_CAPABILITY_ALL_IMPLICIT = 6; // 0x6
@@ -961,7 +963,6 @@ package android.location {
method @NonNull public String[] getBackgroundThrottlingWhitelist();
method @NonNull public String[] getIgnoreSettingsWhitelist();
method @Deprecated @Nullable @RequiresPermission(android.Manifest.permission.READ_DEVICE_CONFIG) public java.util.List<java.lang.String> getProviderPackages(@NonNull String);
- field public static final String FUSED_PROVIDER = "fused";
}
}
@@ -1009,6 +1010,8 @@ package android.media {
field public static final int DEVICE_ROLE_DISABLED = 2; // 0x2
field public static final int DEVICE_ROLE_NONE = 0; // 0x0
field public static final int DEVICE_ROLE_PREFERRED = 1; // 0x1
+ field public static final int OFFLOAD_GAPLESS_SUPPORTED = 2; // 0x2
+ field public static final int OFFLOAD_SUPPORTED = 1; // 0x1
field public static final int STREAM_DEFAULT = -1; // 0xffffffff
}
diff --git a/core/java/android/app/ActivityManager.java b/core/java/android/app/ActivityManager.java
index 7af96d660f54..a5d88ef4c8af 100644
--- a/core/java/android/app/ActivityManager.java
+++ b/core/java/android/app/ActivityManager.java
@@ -31,6 +31,8 @@ import android.annotation.RequiresPermission;
import android.annotation.SystemApi;
import android.annotation.SystemService;
import android.annotation.TestApi;
+import android.compat.annotation.ChangeId;
+import android.compat.annotation.Disabled;
import android.compat.annotation.UnsupportedAppUsage;
import android.content.ComponentName;
import android.content.Context;
@@ -91,9 +93,6 @@ import com.android.internal.util.MemInfoReader;
import com.android.internal.util.Preconditions;
import com.android.server.LocalServices;
-import org.xmlpull.v1.XmlPullParser;
-import org.xmlpull.v1.XmlSerializer;
-
import java.io.FileDescriptor;
import java.io.FileOutputStream;
import java.io.IOException;
@@ -870,6 +869,39 @@ public class ActivityManager {
private static final boolean DEVELOPMENT_FORCE_LOW_RAM =
SystemProperties.getBoolean("debug.force_low_ram", false);
+ /**
+ * Intent {@link Intent#ACTION_CLOSE_SYSTEM_DIALOGS} is too powerful to be unrestricted. We
+ * restrict its usage for a few legitimate use-cases only, regardless of targetSdk. For the
+ * other use-cases we drop the intent with a log message.
+ *
+ * Note that this is the lighter version of {@link ActivityManager
+ * #LOCK_DOWN_CLOSE_SYSTEM_DIALOGS} which is not gated on targetSdk in order to eliminate the
+ * abuse vector.
+ *
+ * @hide
+ */
+ @TestApi
+ @ChangeId
+ @Disabled
+ public static final long DROP_CLOSE_SYSTEM_DIALOGS = 174664120L;
+
+ /**
+ * Intent {@link Intent#ACTION_CLOSE_SYSTEM_DIALOGS} is too powerful to be unrestricted. So,
+ * apps targeting {@link Build.VERSION_CODES#S} or higher will crash if they try to send such
+ * intent and don't have permission {@code android.permission.BROADCAST_CLOSE_SYSTEM_DIALOGS}.
+ *
+ * Note that this is the more restrict version of {@link ActivityManager
+ * #DROP_CLOSE_SYSTEM_DIALOGS} that expects the app to stop sending aforementioned intent once
+ * it bumps its targetSdk to {@link Build.VERSION_CODES#S} or higher.
+ *
+ * @hide
+ */
+ @TestApi
+ @ChangeId
+ @Disabled
+ // @EnabledSince(targetSdkVersion = VERSION_CODES.S)
+ public static final long LOCK_DOWN_CLOSE_SYSTEM_DIALOGS = 174664365L;
+
/** @hide */
public int getFrontActivityScreenCompatMode() {
try {
diff --git a/core/java/android/app/ActivityThread.java b/core/java/android/app/ActivityThread.java
index ed6dea815e4c..6d564a3ce61c 100644
--- a/core/java/android/app/ActivityThread.java
+++ b/core/java/android/app/ActivityThread.java
@@ -6681,8 +6681,7 @@ public final class ActivityThread extends ClientTransactionHandler {
private InstrumentationInfo prepareInstrumentation(AppBindData data) {
final InstrumentationInfo ii;
try {
- ii = new ApplicationPackageManager(
- null, getPackageManager(), getPermissionManager())
+ ii = new ApplicationPackageManager(null, getPackageManager())
.getInstrumentationInfo(data.instrumentationName, 0);
} catch (PackageManager.NameNotFoundException e) {
throw new RuntimeException(
diff --git a/core/java/android/app/AppOpsManager.java b/core/java/android/app/AppOpsManager.java
index f60f569be892..1009f6625bcc 100644
--- a/core/java/android/app/AppOpsManager.java
+++ b/core/java/android/app/AppOpsManager.java
@@ -6511,9 +6511,10 @@ public class AppOpsManager {
* @param code The op code.
* @param uid The UID performing the operation.
* @param packageName The package performing the operation.
+ * @param flags The flags of this op
* @param result The result of the note.
*/
- void onOpNoted(int code, int uid, String packageName, int result);
+ void onOpNoted(int code, int uid, String packageName, @OpFlags int flags, @Mode int result);
}
/**
@@ -6550,9 +6551,10 @@ public class AppOpsManager {
* @param op The op code.
* @param uid The UID performing the operation.
* @param packageName The package performing the operation.
+ * @param flags The flags of this op
* @param result The result of the start.
*/
- void onOpStarted(int op, int uid, String packageName, int result);
+ void onOpStarted(int op, int uid, String packageName, @OpFlags int flags, @Mode int result);
}
AppOpsManager(Context context, IAppOpsService service) {
@@ -7135,8 +7137,8 @@ public class AppOpsManager {
}
cb = new IAppOpsStartedCallback.Stub() {
@Override
- public void opStarted(int op, int uid, String packageName, int mode) {
- callback.onOpStarted(op, uid, packageName, mode);
+ public void opStarted(int op, int uid, String packageName, int flags, int mode) {
+ callback.onOpStarted(op, uid, packageName, flags, mode);
}
};
mStartedWatchers.put(callback, cb);
@@ -7202,8 +7204,8 @@ public class AppOpsManager {
}
cb = new IAppOpsNotedCallback.Stub() {
@Override
- public void opNoted(int op, int uid, String packageName, int mode) {
- callback.onOpNoted(op, uid, packageName, mode);
+ public void opNoted(int op, int uid, String packageName, int flags, int mode) {
+ callback.onOpNoted(op, uid, packageName, flags, mode);
}
};
mNotedWatchers.put(callback, cb);
diff --git a/core/java/android/app/ApplicationPackageManager.java b/core/java/android/app/ApplicationPackageManager.java
index 3642d318e820..186d1fede5e0 100644
--- a/core/java/android/app/ApplicationPackageManager.java
+++ b/core/java/android/app/ApplicationPackageManager.java
@@ -59,8 +59,6 @@ import android.content.pm.PackageInfo;
import android.content.pm.PackageInstaller;
import android.content.pm.PackageItemInfo;
import android.content.pm.PackageManager;
-import android.content.pm.PackageManager.NameNotFoundException;
-import android.content.pm.PackageManager.Property;
import android.content.pm.ParceledListSlice;
import android.content.pm.PermissionGroupInfo;
import android.content.pm.PermissionInfo;
@@ -95,8 +93,6 @@ import android.os.UserHandle;
import android.os.UserManager;
import android.os.storage.StorageManager;
import android.os.storage.VolumeInfo;
-import android.permission.IOnPermissionsChangeListener;
-import android.permission.IPermissionManager;
import android.permission.PermissionManager;
import android.provider.Settings;
import android.system.ErrnoException;
@@ -106,7 +102,6 @@ import android.system.StructStat;
import android.text.TextUtils;
import android.util.ArrayMap;
import android.util.ArraySet;
-import android.util.DebugUtils;
import android.util.LauncherIcons;
import android.util.Log;
@@ -129,7 +124,6 @@ import java.util.Arrays;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
-import java.util.Map;
import java.util.Objects;
import java.util.Set;
@@ -137,14 +131,6 @@ import java.util.Set;
public class ApplicationPackageManager extends PackageManager {
private static final String TAG = "ApplicationPackageManager";
private static final boolean DEBUG_ICONS = false;
- /**
- * Note: Changing this won't do anything on it's own - you should also change the filtering in
- * {@link #shouldTraceGrant}
- *
- * @hide
- */
- public static final boolean DEBUG_TRACE_GRANTS = false;
- public static final boolean DEBUG_TRACE_PERMISSION_UPDATES = false;
private static final int DEFAULT_EPHEMERAL_COOKIE_MAX_SIZE_BYTES = 16384; // 16KB
@@ -171,6 +157,8 @@ public class ApplicationPackageManager extends PackageManager {
@GuardedBy("mLock")
private UserManager mUserManager;
@GuardedBy("mLock")
+ private PermissionManager mPermissionManager;
+ @GuardedBy("mLock")
private PackageInstaller mInstaller;
@GuardedBy("mLock")
private ArtManager mArtManager;
@@ -190,6 +178,15 @@ public class ApplicationPackageManager extends PackageManager {
}
}
+ private PermissionManager getPermissionManager() {
+ synchronized (mLock) {
+ if (mPermissionManager == null) {
+ mPermissionManager = mContext.getSystemService(PermissionManager.class);
+ }
+ return mPermissionManager;
+ }
+ }
+
@Override
public int getUserId() {
return mContext.getUserId();
@@ -355,66 +352,41 @@ public class ApplicationPackageManager extends PackageManager {
@Override
@SuppressWarnings("unchecked")
public List<PermissionGroupInfo> getAllPermissionGroups(int flags) {
- try {
- final ParceledListSlice<PermissionGroupInfo> parceledList =
- mPermissionManager.getAllPermissionGroups(flags);
- if (parceledList == null) {
- return Collections.emptyList();
- }
- return parceledList.getList();
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
+ return getPermissionManager().getAllPermissionGroups(flags);
}
@Override
public PermissionGroupInfo getPermissionGroupInfo(String groupName, int flags)
throws NameNotFoundException {
- try {
- final PermissionGroupInfo pgi =
- mPermissionManager.getPermissionGroupInfo(groupName, flags);
- if (pgi != null) {
- return pgi;
- }
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
+ final PermissionGroupInfo permissionGroupInfo = getPermissionManager()
+ .getPermissionGroupInfo(groupName, flags);
+ if (permissionGroupInfo == null) {
+ throw new NameNotFoundException(groupName);
}
- throw new NameNotFoundException(groupName);
+ return permissionGroupInfo;
}
@Override
public PermissionInfo getPermissionInfo(String permName, int flags)
throws NameNotFoundException {
- try {
- final String packageName = mContext.getOpPackageName();
- final PermissionInfo pi =
- mPermissionManager.getPermissionInfo(permName, packageName, flags);
- if (pi != null) {
- return pi;
- }
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
+ final PermissionInfo permissionInfo = getPermissionManager().getPermissionInfo(permName,
+ flags);
+ if (permissionInfo == null) {
+ throw new NameNotFoundException(permName);
}
- throw new NameNotFoundException(permName);
+ return permissionInfo;
}
@Override
@SuppressWarnings("unchecked")
public List<PermissionInfo> queryPermissionsByGroup(String groupName, int flags)
throws NameNotFoundException {
- try {
- final ParceledListSlice<PermissionInfo> parceledList =
- mPermissionManager.queryPermissionsByGroup(groupName, flags);
- if (parceledList != null) {
- final List<PermissionInfo> pi = parceledList.getList();
- if (pi != null) {
- return pi;
- }
- }
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
+ final List<PermissionInfo> permissionInfos = getPermissionManager().queryPermissionsByGroup(
+ groupName, flags);
+ if (permissionInfos == null) {
+ throw new NameNotFoundException(groupName);
}
- throw new NameNotFoundException(groupName);
+ return permissionInfos;
}
@Override
@@ -724,11 +696,7 @@ public class ApplicationPackageManager extends PackageManager {
@Override
public boolean isPermissionRevokedByPolicy(String permName, String pkgName) {
- try {
- return mPermissionManager.isPermissionRevokedByPolicy(permName, pkgName, getUserId());
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
+ return getPermissionManager().isPermissionRevokedByPolicy(pkgName, permName);
}
/**
@@ -750,50 +718,23 @@ public class ApplicationPackageManager extends PackageManager {
@Override
public boolean addPermission(PermissionInfo info) {
- try {
- return mPermissionManager.addPermission(info, false);
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
+ return getPermissionManager().addPermission(info, false);
}
@Override
public boolean addPermissionAsync(PermissionInfo info) {
- try {
- return mPermissionManager.addPermission(info, true);
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
+ return getPermissionManager().addPermission(info, true);
}
@Override
public void removePermission(String name) {
- try {
- mPermissionManager.removePermission(name);
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
+ getPermissionManager().removePermission(name);
}
@Override
public void grantRuntimePermission(String packageName, String permissionName,
UserHandle user) {
- if (DEBUG_TRACE_GRANTS
- && shouldTraceGrant(packageName, permissionName, user.getIdentifier())) {
- Log.i(TAG, "App " + mContext.getPackageName() + " is granting " + packageName + " "
- + permissionName + " for user " + user.getIdentifier(), new RuntimeException());
- }
- try {
- mPM.grantRuntimePermission(packageName, permissionName, user.getIdentifier());
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /** @hide */
- public static boolean shouldTraceGrant(String packageName, String permissionName, int userId) {
- // To be modified when debugging
- return false;
+ getPermissionManager().grantRuntimePermission(packageName, permissionName, user);
}
@Override
@@ -804,124 +745,55 @@ public class ApplicationPackageManager extends PackageManager {
@Override
public void revokeRuntimePermission(String packageName, String permName, UserHandle user,
String reason) {
- if (DEBUG_TRACE_PERMISSION_UPDATES
- && shouldTraceGrant(packageName, permName, user.getIdentifier())) {
- Log.i(TAG, "App " + mContext.getPackageName() + " is revoking " + packageName + " "
- + permName + " for user " + user.getIdentifier() + " with reason " + reason,
- new RuntimeException());
- }
- try {
- mPermissionManager
- .revokeRuntimePermission(packageName, permName, user.getIdentifier(), reason);
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
+ getPermissionManager().revokeRuntimePermission(packageName, permName, user, reason);
}
@Override
public int getPermissionFlags(String permName, String packageName, UserHandle user) {
- try {
- return mPermissionManager
- .getPermissionFlags(permName, packageName, user.getIdentifier());
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
+ return getPermissionManager().getPermissionFlags(packageName, permName, user);
}
@Override
public void updatePermissionFlags(String permName, String packageName,
int flagMask, int flagValues, UserHandle user) {
- if (DEBUG_TRACE_PERMISSION_UPDATES
- && shouldTraceGrant(packageName, permName, user.getIdentifier())) {
- Log.i(TAG, "App " + mContext.getPackageName() + " is updating flags for "
- + packageName + " "
- + permName + " for user " + user.getIdentifier() + ": "
- + DebugUtils.flagsToString(PackageManager.class, "FLAG_PERMISSION_", flagMask)
- + " := " + DebugUtils.flagsToString(
- PackageManager.class, "FLAG_PERMISSION_", flagValues),
- new RuntimeException());
- }
- try {
- final boolean checkAdjustPolicyFlagPermission =
- mContext.getApplicationInfo().targetSdkVersion >= Build.VERSION_CODES.Q;
- mPermissionManager.updatePermissionFlags(permName, packageName, flagMask,
- flagValues, checkAdjustPolicyFlagPermission, user.getIdentifier());
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
+ getPermissionManager().updatePermissionFlags(packageName, permName, flagMask, flagValues,
+ user);
}
@Override
public @NonNull Set<String> getWhitelistedRestrictedPermissions(
@NonNull String packageName, @PermissionWhitelistFlags int flags) {
- try {
- final int userId = getUserId();
- final List<String> whitelist = mPermissionManager
- .getWhitelistedRestrictedPermissions(packageName, flags, userId);
- if (whitelist != null) {
- return new ArraySet<>(whitelist);
- }
- return Collections.emptySet();
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
+ return getPermissionManager().getAllowlistedRestrictedPermissions(packageName, flags);
}
@Override
public boolean addWhitelistedRestrictedPermission(@NonNull String packageName,
@NonNull String permName, @PermissionWhitelistFlags int flags) {
- try {
- final int userId = getUserId();
- return mPermissionManager
- .addWhitelistedRestrictedPermission(packageName, permName, flags, userId);
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
+ return getPermissionManager().addAllowlistedRestrictedPermission(packageName, permName,
+ flags);
}
@Override
- public boolean setAutoRevokeWhitelisted(
- @NonNull String packageName, boolean whitelisted) {
- try {
- final int userId = getUserId();
- return mPermissionManager.setAutoRevokeWhitelisted(packageName, whitelisted, userId);
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
+ public boolean setAutoRevokeWhitelisted(@NonNull String packageName, boolean whitelisted) {
+ return getPermissionManager().setAutoRevokeExempted(packageName, whitelisted);
}
@Override
public boolean isAutoRevokeWhitelisted(@NonNull String packageName) {
- try {
- final int userId = getUserId();
- return mPermissionManager.isAutoRevokeWhitelisted(packageName, userId);
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
+ return getPermissionManager().isAutoRevokeExempted(packageName);
}
@Override
public boolean removeWhitelistedRestrictedPermission(@NonNull String packageName,
@NonNull String permName, @PermissionWhitelistFlags int flags) {
- try {
- final int userId = getUserId();
- return mPermissionManager
- .removeWhitelistedRestrictedPermission(packageName, permName, flags, userId);
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
+ return getPermissionManager().removeAllowlistedRestrictedPermission(packageName, permName,
+ flags);
}
@Override
@UnsupportedAppUsage
public boolean shouldShowRequestPermissionRationale(String permName) {
- try {
- final String packageName = mContext.getPackageName();
- return mPermissionManager
- .shouldShowRequestPermissionRationale(permName, packageName, getUserId());
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
+ return getPermissionManager().shouldShowRequestPermissionRationale(permName);
}
@Override
@@ -1880,34 +1752,12 @@ public class ApplicationPackageManager extends PackageManager {
@Override
public void addOnPermissionsChangeListener(OnPermissionsChangedListener listener) {
- synchronized (mPermissionListeners) {
- if (mPermissionListeners.get(listener) != null) {
- return;
- }
- OnPermissionsChangeListenerDelegate delegate =
- new OnPermissionsChangeListenerDelegate(listener, Looper.getMainLooper());
- try {
- mPermissionManager.addOnPermissionsChangeListener(delegate);
- mPermissionListeners.put(listener, delegate);
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
+ getPermissionManager().addOnPermissionsChangeListener(listener);
}
@Override
public void removeOnPermissionsChangeListener(OnPermissionsChangedListener listener) {
- synchronized (mPermissionListeners) {
- IOnPermissionsChangeListener delegate = mPermissionListeners.get(listener);
- if (delegate != null) {
- try {
- mPermissionManager.removeOnPermissionsChangeListener(delegate);
- mPermissionListeners.remove(listener);
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
- }
+ getPermissionManager().removeOnPermissionsChangeListener(listener);
}
@UnsupportedAppUsage
@@ -1918,11 +1768,9 @@ public class ApplicationPackageManager extends PackageManager {
}
}
- protected ApplicationPackageManager(ContextImpl context, IPackageManager pm,
- IPermissionManager permissionManager) {
+ protected ApplicationPackageManager(ContextImpl context, IPackageManager pm) {
mContext = context;
mPM = pm;
- mPermissionManager = permissionManager;
}
/**
@@ -3234,7 +3082,6 @@ public class ApplicationPackageManager extends PackageManager {
private final ContextImpl mContext;
@UnsupportedAppUsage
private final IPackageManager mPM;
- private final IPermissionManager mPermissionManager;
/** Assume locked until we hear otherwise */
private volatile boolean mUserUnlocked = false;
@@ -3245,41 +3092,6 @@ public class ApplicationPackageManager extends PackageManager {
private static ArrayMap<ResourceName, WeakReference<CharSequence>> sStringCache
= new ArrayMap<ResourceName, WeakReference<CharSequence>>();
- private final Map<OnPermissionsChangedListener, IOnPermissionsChangeListener>
- mPermissionListeners = new ArrayMap<>();
-
- public class OnPermissionsChangeListenerDelegate extends IOnPermissionsChangeListener.Stub
- implements Handler.Callback{
- private static final int MSG_PERMISSIONS_CHANGED = 1;
-
- private final OnPermissionsChangedListener mListener;
- private final Handler mHandler;
-
-
- public OnPermissionsChangeListenerDelegate(OnPermissionsChangedListener listener,
- Looper looper) {
- mListener = listener;
- mHandler = new Handler(looper, this);
- }
-
- @Override
- public void onPermissionsChanged(int uid) {
- mHandler.obtainMessage(MSG_PERMISSIONS_CHANGED, uid, 0).sendToTarget();
- }
-
- @Override
- public boolean handleMessage(Message msg) {
- switch (msg.what) {
- case MSG_PERMISSIONS_CHANGED: {
- final int uid = msg.arg1;
- mListener.onPermissionsChanged(uid);
- return true;
- }
- }
- return false;
- }
- }
-
@Override
public boolean canRequestPackageInstalls() {
try {
diff --git a/core/java/android/app/ContextImpl.java b/core/java/android/app/ContextImpl.java
index 2fec9f79717a..124cf71edc9c 100644
--- a/core/java/android/app/ContextImpl.java
+++ b/core/java/android/app/ContextImpl.java
@@ -72,7 +72,6 @@ import android.os.Trace;
import android.os.UserHandle;
import android.os.UserManager;
import android.os.storage.StorageManager;
-import android.permission.IPermissionManager;
import android.permission.PermissionManager;
import android.system.ErrnoException;
import android.system.Os;
@@ -370,10 +369,9 @@ class ContextImpl extends Context {
}
final IPackageManager pm = ActivityThread.getPackageManager();
- final IPermissionManager permissionManager = ActivityThread.getPermissionManager();
- if (pm != null && permissionManager != null) {
+ if (pm != null) {
// Doesn't matter if we make more than one instance.
- return (mPackageManager = new ApplicationPackageManager(this, pm, permissionManager));
+ return (mPackageManager = new ApplicationPackageManager(this, pm));
}
return null;
diff --git a/core/java/android/app/OWNERS b/core/java/android/app/OWNERS
index 633d093435ee..abdd537a9a26 100644
--- a/core/java/android/app/OWNERS
+++ b/core/java/android/app/OWNERS
@@ -1 +1,38 @@
+
+# Remain no owner because multiple modules may touch this file.
+per-file ContextImpl.java = *
+
+# ActivityThread
+per-file ActivityThread.java = file:/services/core/java/com/android/server/am/OWNERS
+per-file ActivityThread.java = file:/services/core/java/com/android/server/wm/OWNERS
+
+# Alarm
+per-file *Alarm* = file:/apex/jobscheduler/OWNERS
+
+# AppOps
+per-file *AppOp* = file:/core/java/android/permission/OWNERS
+
+# Notification
+per-file *Notification* = file:/packages/SystemUI/OWNERS
+
+#Wallpaper
+per-file Wallpaper*.java = file:/core/java/android/service/wallpaper/OWNERS
+per-file IWallpaper*.aidl = file:/core/java/android/service/wallpaper/OWNERS
+
+# WindowManager
+per-file Activity*.aidl = file:/services/core/java/com/android/server/wm/OWNERS
+per-file Activity*.java = file:/services/core/java/com/android/server/wm/OWNERS
+per-file ClientTransactionHandler.java = file:/services/core/java/com/android/server/wm/OWNERS
+per-file Fragment.java = file:/services/core/java/com/android/server/wm/OWNERS
+per-file IActivity*.aidl = file:/services/core/java/com/android/server/wm/OWNERS
+per-file IAppTask.aidl = file:/services/core/java/com/android/server/wm/OWNERS
+per-file ITaskStackListener.aidl = file:/services/core/java/com/android/server/wm/OWNERS
+per-file LocalActivityManager.java = file:/services/core/java/com/android/server/wm/OWNERS
+per-file Task*.java = file:/services/core/java/com/android/server/wm/OWNERS
+per-file Window*.aidl = file:/services/core/java/com/android/server/wm/OWNERS
+per-file Window*.java = file:/services/core/java/com/android/server/wm/OWNERS
+
+# TODO(b/174932174): determine the ownership of KeyguardManager.java
+
+# Zygote
per-file *Zygote* = file:/ZYGOTE_OWNERS
diff --git a/core/java/android/app/SystemServiceRegistry.java b/core/java/android/app/SystemServiceRegistry.java
index 392d6fbe53d6..a6bf4dddf855 100644
--- a/core/java/android/app/SystemServiceRegistry.java
+++ b/core/java/android/app/SystemServiceRegistry.java
@@ -63,7 +63,6 @@ import android.content.pm.CrossProfileApps;
import android.content.pm.DataLoaderManager;
import android.content.pm.ICrossProfileApps;
import android.content.pm.IDataLoaderManager;
-import android.content.pm.IPackageManager;
import android.content.pm.IShortcutService;
import android.content.pm.LauncherApps;
import android.content.pm.PackageManager;
@@ -176,6 +175,7 @@ import android.os.image.IDynamicSystemService;
import android.os.incremental.IIncrementalService;
import android.os.incremental.IncrementalManager;
import android.os.storage.StorageManager;
+import android.permission.LegacyPermissionManager;
import android.permission.PermissionControllerManager;
import android.permission.PermissionManager;
import android.print.IPrintManager;
@@ -1264,8 +1264,15 @@ public final class SystemServiceRegistry {
@Override
public PermissionManager createService(ContextImpl ctx)
throws ServiceNotFoundException {
- IPackageManager packageManager = AppGlobals.getPackageManager();
- return new PermissionManager(ctx.getOuterContext(), packageManager);
+ return new PermissionManager(ctx.getOuterContext());
+ }});
+
+ registerService(Context.LEGACY_PERMISSION_SERVICE, LegacyPermissionManager.class,
+ new CachedServiceFetcher<LegacyPermissionManager>() {
+ @Override
+ public LegacyPermissionManager createService(ContextImpl ctx)
+ throws ServiceNotFoundException {
+ return new LegacyPermissionManager();
}});
registerService(Context.PERMISSION_CONTROLLER_SERVICE, PermissionControllerManager.class,
diff --git a/core/java/android/app/TaskInfo.java b/core/java/android/app/TaskInfo.java
index fe382a33a8c5..2da5e001a3e4 100644
--- a/core/java/android/app/TaskInfo.java
+++ b/core/java/android/app/TaskInfo.java
@@ -27,7 +27,6 @@ import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.content.res.Configuration;
import android.graphics.Point;
-import android.graphics.Rect;
import android.os.Build;
import android.os.IBinder;
import android.os.Parcel;
@@ -187,22 +186,6 @@ public class TaskInfo {
public boolean isResizeable;
/**
- * Activity bounds if this task or its top activity is presented in letterbox mode and
- * {@code null} otherwise.
- * @hide
- */
- @Nullable
- public Rect letterboxActivityBounds;
-
- /**
- * Activity insets if this task or its top activity is presented in letterbox mode and
- * {@code null} otherwise.
- * @hide
- */
- @Nullable
- public Rect letterboxActivityInsets;
-
- /**
* Relative position of the task's top left corner in the parent container.
* @hide
*/
@@ -223,12 +206,6 @@ public class TaskInfo {
public int parentTaskId;
/**
- * Parent bounds.
- * @hide
- */
- public Rect parentBounds;
-
- /**
* Whether this task is focused.
* @hide
*/
@@ -320,7 +297,6 @@ public class TaskInfo {
return topActivityType == that.topActivityType
&& isResizeable == that.isResizeable
&& Objects.equals(positionInParent, that.positionInParent)
- && equalsLetterboxParams(that)
&& Objects.equals(pictureInPictureParams, that.pictureInPictureParams)
&& getWindowingMode() == that.getWindowingMode()
&& Objects.equals(taskDescription, that.taskDescription)
@@ -328,18 +304,6 @@ public class TaskInfo {
&& isVisible == that.isVisible;
}
- private boolean equalsLetterboxParams(TaskInfo that) {
- return Objects.equals(letterboxActivityBounds, that.letterboxActivityBounds)
- && Objects.equals(
- getConfiguration().windowConfiguration.getBounds(),
- that.getConfiguration().windowConfiguration.getBounds())
- && Objects.equals(
- getConfiguration().windowConfiguration.getMaxBounds(),
- that.getConfiguration().windowConfiguration.getMaxBounds())
- && Objects.equals(parentBounds, that.parentBounds)
- && Objects.equals(letterboxActivityInsets, that.letterboxActivityInsets);
- }
-
/**
* Reads the TaskInfo from a parcel.
*/
@@ -368,13 +332,10 @@ public class TaskInfo {
topActivityInfo = source.readTypedObject(ActivityInfo.CREATOR);
isResizeable = source.readBoolean();
source.readBinderList(launchCookies);
- letterboxActivityBounds = source.readTypedObject(Rect.CREATOR);
positionInParent = source.readTypedObject(Point.CREATOR);
parentTaskId = source.readInt();
- parentBounds = source.readTypedObject(Rect.CREATOR);
isFocused = source.readBoolean();
isVisible = source.readBoolean();
- letterboxActivityInsets = source.readTypedObject(Rect.CREATOR);
}
/**
@@ -406,13 +367,10 @@ public class TaskInfo {
dest.writeTypedObject(topActivityInfo, flags);
dest.writeBoolean(isResizeable);
dest.writeBinderList(launchCookies);
- dest.writeTypedObject(letterboxActivityBounds, flags);
dest.writeTypedObject(positionInParent, flags);
dest.writeInt(parentTaskId);
- dest.writeTypedObject(parentBounds, flags);
dest.writeBoolean(isFocused);
dest.writeBoolean(isVisible);
- dest.writeTypedObject(letterboxActivityInsets, flags);
}
@Override
@@ -433,13 +391,10 @@ public class TaskInfo {
+ " pictureInPictureParams=" + pictureInPictureParams
+ " topActivityInfo=" + topActivityInfo
+ " launchCookies=" + launchCookies
- + " letterboxActivityBounds=" + letterboxActivityBounds
+ " positionInParent=" + positionInParent
+ " parentTaskId=" + parentTaskId
- + " parentBounds=" + parentBounds
+ " isFocused=" + isFocused
+ " isVisible=" + isVisible
- + " letterboxActivityInsets=" + letterboxActivityInsets
+ "}";
}
}
diff --git a/core/java/android/app/admin/DevicePolicyManager.java b/core/java/android/app/admin/DevicePolicyManager.java
index ab94fd5922bc..94084b851ae0 100644
--- a/core/java/android/app/admin/DevicePolicyManager.java
+++ b/core/java/android/app/admin/DevicePolicyManager.java
@@ -2919,22 +2919,36 @@ public class DevicePolicyManager {
* {@link DeviceAdminInfo#USES_POLICY_LIMIT_PASSWORD} to be able to call this method; if it has
* not, a security exception will be thrown.
* <p>
- * This method can be called on the {@link DevicePolicyManager} instance returned by
+ * Apps targeting {@link android.os.Build.VERSION_CODES#R} and below can call this method on the
+ * {@link DevicePolicyManager} instance returned by
* {@link #getParentProfileInstance(ComponentName)} in order to set restrictions on the parent
- * profile.
+ * profile. Apps targeting {@link android.os.Build.VERSION_CODES#S} and above will get a
+ * {@code IllegalArgumentException} when calling this method on the parent
+ * {@link DevicePolicyManager} instance.
*
* <p><strong>Note:</strong> Specifying password requirements using this method clears the
* password complexity requirements set using {@link #setRequiredPasswordComplexity(int)}.
*
+ * @deprecated Prefer using {@link #setRequiredPasswordComplexity(int)}, to require a password
+ * that satisfies a complexity level defined by the platform, rather than specifying custom
+ * password requirement.
+ * Setting custom, overly-complicated password requirements leads to passwords that are hard
+ * for users to remember and may not provide any security benefits given as Android uses
+ * hardware-backed throttling to thwart online and offline brute-forcing of the device's
+ * screen lock.
* @param admin Which {@link DeviceAdminReceiver} this request is associated with.
* @param quality The new desired quality. One of {@link #PASSWORD_QUALITY_UNSPECIFIED},
* {@link #PASSWORD_QUALITY_BIOMETRIC_WEAK},
* {@link #PASSWORD_QUALITY_SOMETHING}, {@link #PASSWORD_QUALITY_NUMERIC},
* {@link #PASSWORD_QUALITY_NUMERIC_COMPLEX}, {@link #PASSWORD_QUALITY_ALPHABETIC},
* {@link #PASSWORD_QUALITY_ALPHANUMERIC} or {@link #PASSWORD_QUALITY_COMPLEX}.
- * @throws SecurityException if {@code admin} is not an active administrator or if {@code admin}
- * does not use {@link DeviceAdminInfo#USES_POLICY_LIMIT_PASSWORD}
+ * @throws SecurityException if {@code admin} is not an active administrator, if {@code admin}
+ * does not use {@link DeviceAdminInfo#USES_POLICY_LIMIT_PASSWORD} or if the
+ * calling app is targeting {@link android.os.Build.VERSION_CODES#S} and above,
+ * and is calling the method the {@link DevicePolicyManager} instance returned by
+ * {@link #getParentProfileInstance(ComponentName)}.
*/
+ @Deprecated
public void setPasswordQuality(@NonNull ComponentName admin, int quality) {
if (mService != null) {
try {
@@ -2957,9 +2971,12 @@ public class DevicePolicyManager {
* <p>Note: on devices not supporting {@link PackageManager#FEATURE_SECURE_LOCK_SCREEN} feature,
* the password is always treated as empty.
*
+ * @deprecated see {@link #setPasswordQuality(ComponentName, int)} for details.
+ *
* @param admin The name of the admin component to check, or {@code null} to aggregate
* all admins.
*/
+ @Deprecated
public int getPasswordQuality(@Nullable ComponentName admin) {
return getPasswordQuality(admin, myUserId());
}
@@ -2999,10 +3016,14 @@ public class DevicePolicyManager {
* {@link DeviceAdminInfo#USES_POLICY_LIMIT_PASSWORD} to be able to call this method; if it has
* not, a security exception will be thrown.
* <p>
- * This method can be called on the {@link DevicePolicyManager} instance returned by
+ *
+ * Apps targeting {@link android.os.Build.VERSION_CODES#R} and below can call this method on the
+ * {@link DevicePolicyManager} instance returned by
* {@link #getParentProfileInstance(ComponentName)} in order to set restrictions on the parent
* profile.
*
+ * @deprecated see {@link #setPasswordQuality(ComponentName, int)} for details.
+ *
* @param admin Which {@link DeviceAdminReceiver} this request is associated with.
* @param length The new desired minimum password length. A value of 0 means there is no
* restriction.
@@ -3012,6 +3033,7 @@ public class DevicePolicyManager {
* {@link android.os.Build.VERSION_CODES#R} and above and didn't set a sufficient password
* quality requirement prior to calling this method.
*/
+ @Deprecated
public void setPasswordMinimumLength(@NonNull ComponentName admin, int length) {
if (mService != null) {
try {
@@ -3034,9 +3056,12 @@ public class DevicePolicyManager {
* returned by {@link #getParentProfileInstance(ComponentName)} in order to retrieve
* restrictions on the parent profile.
*
+ * @deprecated see {@link #setPasswordQuality(ComponentName, int)} for details.
+ *
* @param admin The name of the admin component to check, or {@code null} to aggregate
* all admins.
*/
+ @Deprecated
public int getPasswordMinimumLength(@Nullable ComponentName admin) {
return getPasswordMinimumLength(admin, myUserId());
}
@@ -3074,10 +3099,14 @@ public class DevicePolicyManager {
* {@link DeviceAdminInfo#USES_POLICY_LIMIT_PASSWORD} to be able to call this method; if it has
* not, a security exception will be thrown.
* <p>
- * This method can be called on the {@link DevicePolicyManager} instance returned by
+ *
+ * Apps targeting {@link android.os.Build.VERSION_CODES#R} and below can call this method on the
+ * {@link DevicePolicyManager} instance returned by
* {@link #getParentProfileInstance(ComponentName)} in order to set restrictions on the parent
* profile.
*
+ * @deprecated see {@link #setPasswordQuality(ComponentName, int)} for details.
+ *
* @param admin Which {@link DeviceAdminReceiver} this request is associated with.
* @param length The new desired minimum number of upper case letters required in the password.
* A value of 0 means there is no restriction.
@@ -3087,6 +3116,7 @@ public class DevicePolicyManager {
* {@link android.os.Build.VERSION_CODES#R} and above and didn't set a sufficient password
* quality requirement prior to calling this method.
*/
+ @Deprecated
public void setPasswordMinimumUpperCase(@NonNull ComponentName admin, int length) {
if (mService != null) {
try {
@@ -3114,11 +3144,14 @@ public class DevicePolicyManager {
* returned by {@link #getParentProfileInstance(ComponentName)} in order to retrieve
* restrictions on the parent profile.
*
+ * @deprecated see {@link #setPasswordQuality(ComponentName, int)} for details.
+ *
* @param admin The name of the admin component to check, or {@code null} to
* aggregate all admins.
* @return The minimum number of upper case letters required in the
* password.
*/
+ @Deprecated
public int getPasswordMinimumUpperCase(@Nullable ComponentName admin) {
return getPasswordMinimumUpperCase(admin, myUserId());
}
@@ -3156,10 +3189,14 @@ public class DevicePolicyManager {
* {@link DeviceAdminInfo#USES_POLICY_LIMIT_PASSWORD} to be able to call this method; if it has
* not, a security exception will be thrown.
* <p>
- * This method can be called on the {@link DevicePolicyManager} instance returned by
+ *
+ * Apps targeting {@link android.os.Build.VERSION_CODES#R} and below can call this method on the
+ * {@link DevicePolicyManager} instance returned by
* {@link #getParentProfileInstance(ComponentName)} in order to set restrictions on the parent
* profile.
*
+ * @deprecated see {@link #setPasswordQuality(ComponentName, int)} for details.
+ *
* @param admin Which {@link DeviceAdminReceiver} this request is associated with.
* @param length The new desired minimum number of lower case letters required in the password.
* A value of 0 means there is no restriction.
@@ -3169,6 +3206,7 @@ public class DevicePolicyManager {
* {@link android.os.Build.VERSION_CODES#R} and above and didn't set a sufficient password
* quality requirement prior to calling this method.
*/
+ @Deprecated
public void setPasswordMinimumLowerCase(@NonNull ComponentName admin, int length) {
if (mService != null) {
try {
@@ -3196,11 +3234,14 @@ public class DevicePolicyManager {
* returned by {@link #getParentProfileInstance(ComponentName)} in order to retrieve
* restrictions on the parent profile.
*
+ * @deprecated see {@link #setPasswordQuality(ComponentName, int)} for details.
+ *
* @param admin The name of the admin component to check, or {@code null} to
* aggregate all admins.
* @return The minimum number of lower case letters required in the
* password.
*/
+ @Deprecated
public int getPasswordMinimumLowerCase(@Nullable ComponentName admin) {
return getPasswordMinimumLowerCase(admin, myUserId());
}
@@ -3238,10 +3279,14 @@ public class DevicePolicyManager {
* {@link DeviceAdminInfo#USES_POLICY_LIMIT_PASSWORD} to be able to call this method; if it has
* not, a security exception will be thrown.
* <p>
- * This method can be called on the {@link DevicePolicyManager} instance returned by
+ *
+ * Apps targeting {@link android.os.Build.VERSION_CODES#R} and below can call this method on the
+ * {@link DevicePolicyManager} instance returned by
* {@link #getParentProfileInstance(ComponentName)} in order to set restrictions on the parent
* profile.
*
+ * @deprecated see {@link #setPasswordQuality(ComponentName, int)} for details.
+ *
* @param admin Which {@link DeviceAdminReceiver} this request is associated with.
* @param length The new desired minimum number of letters required in the password. A value of
* 0 means there is no restriction.
@@ -3251,6 +3296,7 @@ public class DevicePolicyManager {
* {@link android.os.Build.VERSION_CODES#R} and above and didn't set a sufficient password
* quality requirement prior to calling this method.
*/
+ @Deprecated
public void setPasswordMinimumLetters(@NonNull ComponentName admin, int length) {
if (mService != null) {
try {
@@ -3278,10 +3324,13 @@ public class DevicePolicyManager {
* returned by {@link #getParentProfileInstance(ComponentName)} in order to retrieve
* restrictions on the parent profile.
*
+ * @deprecated see {@link #setPasswordQuality(ComponentName, int)} for details.
+ *
* @param admin The name of the admin component to check, or {@code null} to
* aggregate all admins.
* @return The minimum number of letters required in the password.
*/
+ @Deprecated
public int getPasswordMinimumLetters(@Nullable ComponentName admin) {
return getPasswordMinimumLetters(admin, myUserId());
}
@@ -3319,10 +3368,14 @@ public class DevicePolicyManager {
* {@link DeviceAdminInfo#USES_POLICY_LIMIT_PASSWORD} to be able to call this method; if it has
* not, a security exception will be thrown.
* <p>
- * This method can be called on the {@link DevicePolicyManager} instance returned by
+ *
+ * Apps targeting {@link android.os.Build.VERSION_CODES#R} and below can call this method on the
+ * {@link DevicePolicyManager} instance returned by
* {@link #getParentProfileInstance(ComponentName)} in order to set restrictions on the parent
* profile.
*
+ * @deprecated see {@link #setPasswordQuality(ComponentName, int)} for details.
+ *
* @param admin Which {@link DeviceAdminReceiver} this request is associated with.
* @param length The new desired minimum number of numerical digits required in the password. A
* value of 0 means there is no restriction.
@@ -3332,6 +3385,7 @@ public class DevicePolicyManager {
* {@link android.os.Build.VERSION_CODES#R} and above and didn't set a sufficient password
* quality requirement prior to calling this method.
*/
+ @Deprecated
public void setPasswordMinimumNumeric(@NonNull ComponentName admin, int length) {
if (mService != null) {
try {
@@ -3359,10 +3413,13 @@ public class DevicePolicyManager {
* returned by {@link #getParentProfileInstance(ComponentName)} in order to retrieve
* restrictions on the parent profile.
*
+ * @deprecated see {@link #setPasswordQuality(ComponentName, int)} for details.
+ *
* @param admin The name of the admin component to check, or {@code null} to
* aggregate all admins.
* @return The minimum number of numerical digits required in the password.
*/
+ @Deprecated
public int getPasswordMinimumNumeric(@Nullable ComponentName admin) {
return getPasswordMinimumNumeric(admin, myUserId());
}
@@ -3400,10 +3457,14 @@ public class DevicePolicyManager {
* {@link DeviceAdminInfo#USES_POLICY_LIMIT_PASSWORD} to be able to call this method; if it has
* not, a security exception will be thrown.
* <p>
- * This method can be called on the {@link DevicePolicyManager} instance returned by
+ *
+ * Apps targeting {@link android.os.Build.VERSION_CODES#R} and below can call this method on the
+ * {@link DevicePolicyManager} instance returned by
* {@link #getParentProfileInstance(ComponentName)} in order to set restrictions on the parent
* profile.
*
+ * @deprecated see {@link #setPasswordQuality(ComponentName, int)} for details.
+ *
* @param admin Which {@link DeviceAdminReceiver} this request is associated with.
* @param length The new desired minimum number of symbols required in the password. A value of
* 0 means there is no restriction.
@@ -3413,6 +3474,7 @@ public class DevicePolicyManager {
* {@link android.os.Build.VERSION_CODES#R} and above and didn't set a sufficient password
* quality requirement prior to calling this method.
*/
+ @Deprecated
public void setPasswordMinimumSymbols(@NonNull ComponentName admin, int length) {
if (mService != null) {
try {
@@ -3439,10 +3501,13 @@ public class DevicePolicyManager {
* returned by {@link #getParentProfileInstance(ComponentName)} in order to retrieve
* restrictions on the parent profile.
*
+ * @deprecated see {@link #setPasswordQuality(ComponentName, int)} for details.
+ *
* @param admin The name of the admin component to check, or {@code null} to
* aggregate all admins.
* @return The minimum number of symbols required in the password.
*/
+ @Deprecated
public int getPasswordMinimumSymbols(@Nullable ComponentName admin) {
return getPasswordMinimumSymbols(admin, myUserId());
}
@@ -3480,10 +3545,14 @@ public class DevicePolicyManager {
* {@link DeviceAdminInfo#USES_POLICY_LIMIT_PASSWORD} to be able to call this method; if it has
* not, a security exception will be thrown.
* <p>
- * This method can be called on the {@link DevicePolicyManager} instance returned by
+ *
+ * Apps targeting {@link android.os.Build.VERSION_CODES#R} and below can call this method on the
+ * {@link DevicePolicyManager} instance returned by
* {@link #getParentProfileInstance(ComponentName)} in order to set restrictions on the parent
* profile.
*
+ * @deprecated see {@link #setPasswordQuality(ComponentName, int)} for details.
+ *
* @param admin Which {@link DeviceAdminReceiver} this request is associated with.
* @param length The new desired minimum number of letters required in the password. A value of
* 0 means there is no restriction.
@@ -3493,6 +3562,7 @@ public class DevicePolicyManager {
* {@link android.os.Build.VERSION_CODES#R} and above and didn't set a sufficient password
* quality requirement prior to calling this method.
*/
+ @Deprecated
public void setPasswordMinimumNonLetter(@NonNull ComponentName admin, int length) {
if (mService != null) {
try {
@@ -3520,10 +3590,13 @@ public class DevicePolicyManager {
* returned by {@link #getParentProfileInstance(ComponentName)} in order to retrieve
* restrictions on the parent profile.
*
+ * @deprecated see {@link #setPasswordQuality(ComponentName, int)} for details.
+ *
* @param admin The name of the admin component to check, or {@code null} to
* aggregate all admins.
* @return The minimum number of letters required in the password.
*/
+ @Deprecated
public int getPasswordMinimumNonLetter(@Nullable ComponentName admin) {
return getPasswordMinimumNonLetter(admin, myUserId());
}
diff --git a/core/java/android/app/admin/OWNERS b/core/java/android/app/admin/OWNERS
index 64a1d27d4cf7..8462cbe7497b 100644
--- a/core/java/android/app/admin/OWNERS
+++ b/core/java/android/app/admin/OWNERS
@@ -1,4 +1,11 @@
# Bug component: 142675
-yamasani@google.com
+# Android Enterprise team
rubinxu@google.com
+sandness@google.com
+eranm@google.com
+alexkershaw@google.com
+pgrafov@google.com
+
+# Emeritus
+yamasani@google.com
diff --git a/core/java/android/app/time/OWNERS b/core/java/android/app/time/OWNERS
new file mode 100644
index 000000000000..8f8089717e3b
--- /dev/null
+++ b/core/java/android/app/time/OWNERS
@@ -0,0 +1,3 @@
+# Bug component: 847766
+mingaleev@google.com
+include /core/java/android/app/timedetector/OWNERS
diff --git a/core/java/android/app/timedetector/GnssTimeSuggestion.aidl b/core/java/android/app/timedetector/GnssTimeSuggestion.aidl
new file mode 100644
index 000000000000..81475ec8156d
--- /dev/null
+++ b/core/java/android/app/timedetector/GnssTimeSuggestion.aidl
@@ -0,0 +1,19 @@
+/*
+ * 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 android.app.timedetector;
+
+parcelable GnssTimeSuggestion;
diff --git a/core/java/android/app/timedetector/GnssTimeSuggestion.java b/core/java/android/app/timedetector/GnssTimeSuggestion.java
new file mode 100644
index 000000000000..6478a2dd2aa9
--- /dev/null
+++ b/core/java/android/app/timedetector/GnssTimeSuggestion.java
@@ -0,0 +1,135 @@
+/*
+ * 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 android.app.timedetector;
+
+import android.annotation.NonNull;
+import android.annotation.Nullable;
+import android.os.Parcel;
+import android.os.Parcelable;
+import android.os.TimestampedValue;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+import java.util.Objects;
+
+/**
+ * A time signal from a GNSS source.
+ *
+ * <p>{@code utcTime} is the suggested time. The {@code utcTime.value} is the number of milliseconds
+ * elapsed since 1/1/1970 00:00:00 UTC. The {@code utcTime.referenceTimeMillis} is the value of the
+ * elapsed realtime clock when the {@code utcTime.value} was established.
+ * Note that the elapsed realtime clock is considered accurate but it is volatile, so time
+ * suggestions cannot be persisted across device resets.
+ *
+ * <p>{@code debugInfo} contains debugging metadata associated with the suggestion. This is used to
+ * record why the suggestion exists and how it was entered. This information exists only to aid in
+ * debugging and therefore is used by {@link #toString()}, but it is not for use in detection
+ * logic and is not considered in {@link #hashCode()} or {@link #equals(Object)}.
+ *
+ * @hide
+ */
+public final class GnssTimeSuggestion implements Parcelable {
+
+ public static final @NonNull Creator<GnssTimeSuggestion> CREATOR =
+ new Creator<GnssTimeSuggestion>() {
+ public GnssTimeSuggestion createFromParcel(Parcel in) {
+ return GnssTimeSuggestion.createFromParcel(in);
+ }
+
+ public GnssTimeSuggestion[] newArray(int size) {
+ return new GnssTimeSuggestion[size];
+ }
+ };
+
+ @NonNull private final TimestampedValue<Long> mUtcTime;
+ @Nullable private ArrayList<String> mDebugInfo;
+
+ public GnssTimeSuggestion(@NonNull TimestampedValue<Long> utcTime) {
+ mUtcTime = Objects.requireNonNull(utcTime);
+ Objects.requireNonNull(utcTime.getValue());
+ }
+
+ private static GnssTimeSuggestion createFromParcel(Parcel in) {
+ TimestampedValue<Long> utcTime = in.readParcelable(null /* classLoader */);
+ GnssTimeSuggestion suggestion = new GnssTimeSuggestion(utcTime);
+ @SuppressWarnings("unchecked")
+ ArrayList<String> debugInfo = (ArrayList<String>) in.readArrayList(null /* classLoader */);
+ suggestion.mDebugInfo = debugInfo;
+ return suggestion;
+ }
+
+ @Override
+ public int describeContents() {
+ return 0;
+ }
+
+ @Override
+ public void writeToParcel(@NonNull Parcel dest, int flags) {
+ dest.writeParcelable(mUtcTime, 0);
+ dest.writeList(mDebugInfo);
+ }
+
+ @NonNull
+ public TimestampedValue<Long> getUtcTime() {
+ return mUtcTime;
+ }
+
+ @NonNull
+ public List<String> getDebugInfo() {
+ return mDebugInfo == null
+ ? Collections.emptyList() : Collections.unmodifiableList(mDebugInfo);
+ }
+
+ /**
+ * Associates information with the instance that can be useful for debugging / logging. The
+ * information is present in {@link #toString()} but is not considered for
+ * {@link #equals(Object)} and {@link #hashCode()}.
+ */
+ public void addDebugInfo(String... debugInfos) {
+ if (mDebugInfo == null) {
+ mDebugInfo = new ArrayList<>();
+ }
+ mDebugInfo.addAll(Arrays.asList(debugInfos));
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ GnssTimeSuggestion that = (GnssTimeSuggestion) o;
+ return Objects.equals(mUtcTime, that.mUtcTime);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(mUtcTime);
+ }
+
+ @Override
+ public String toString() {
+ return "GnssTimeSuggestion{"
+ + "mUtcTime=" + mUtcTime
+ + ", mDebugInfo=" + mDebugInfo
+ + '}';
+ }
+}
diff --git a/core/java/android/app/timedetector/ITimeDetectorService.aidl b/core/java/android/app/timedetector/ITimeDetectorService.aidl
index 7bea5d7d60b1..87e72332274e 100644
--- a/core/java/android/app/timedetector/ITimeDetectorService.aidl
+++ b/core/java/android/app/timedetector/ITimeDetectorService.aidl
@@ -16,6 +16,7 @@
package android.app.timedetector;
+import android.app.timedetector.GnssTimeSuggestion;
import android.app.timedetector.ManualTimeSuggestion;
import android.app.timedetector.NetworkTimeSuggestion;
import android.app.timedetector.TelephonyTimeSuggestion;
@@ -34,6 +35,7 @@ import android.app.timedetector.TelephonyTimeSuggestion;
* {@hide}
*/
interface ITimeDetectorService {
+ void suggestGnssTime(in GnssTimeSuggestion timeSuggestion);
boolean suggestManualTime(in ManualTimeSuggestion timeSuggestion);
void suggestNetworkTime(in NetworkTimeSuggestion timeSuggestion);
void suggestTelephonyTime(in TelephonyTimeSuggestion timeSuggestion);
diff --git a/core/java/android/app/timedetector/OWNERS b/core/java/android/app/timedetector/OWNERS
index 8c113246b5d4..941eed8de631 100644
--- a/core/java/android/app/timedetector/OWNERS
+++ b/core/java/android/app/timedetector/OWNERS
@@ -1,4 +1,4 @@
# Bug component: 847766
-
+mingaleev@google.com
narayan@google.com
nfuller@google.com
diff --git a/core/java/android/app/timedetector/TimeDetector.java b/core/java/android/app/timedetector/TimeDetector.java
index 162e18215cae..52016b65688b 100644
--- a/core/java/android/app/timedetector/TimeDetector.java
+++ b/core/java/android/app/timedetector/TimeDetector.java
@@ -71,4 +71,12 @@ public interface TimeDetector {
*/
@RequiresPermission(android.Manifest.permission.SET_TIME)
void suggestNetworkTime(NetworkTimeSuggestion timeSuggestion);
+
+ /**
+ * Suggests the time according to a gnss time source.
+ *
+ * @hide
+ */
+ @RequiresPermission(android.Manifest.permission.SET_TIME)
+ void suggestGnssTime(GnssTimeSuggestion timeSuggestion);
}
diff --git a/core/java/android/app/timedetector/TimeDetectorImpl.java b/core/java/android/app/timedetector/TimeDetectorImpl.java
index ac02c8930982..b0aa3c8d4575 100644
--- a/core/java/android/app/timedetector/TimeDetectorImpl.java
+++ b/core/java/android/app/timedetector/TimeDetectorImpl.java
@@ -74,4 +74,16 @@ public final class TimeDetectorImpl implements TimeDetector {
throw e.rethrowFromSystemServer();
}
}
+
+ @Override
+ public void suggestGnssTime(GnssTimeSuggestion timeSuggestion) {
+ if (DEBUG) {
+ Log.d(TAG, "suggestGnssTime called: " + timeSuggestion);
+ }
+ try {
+ mITimeDetectorService.suggestGnssTime(timeSuggestion);
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
+ }
}
diff --git a/core/java/android/app/timezone/OWNERS b/core/java/android/app/timezone/OWNERS
index 8c113246b5d4..8f8089717e3b 100644
--- a/core/java/android/app/timezone/OWNERS
+++ b/core/java/android/app/timezone/OWNERS
@@ -1,4 +1,3 @@
# Bug component: 847766
-
-narayan@google.com
-nfuller@google.com
+mingaleev@google.com
+include /core/java/android/app/timedetector/OWNERS
diff --git a/core/java/android/app/timezonedetector/OWNERS b/core/java/android/app/timezonedetector/OWNERS
new file mode 100644
index 000000000000..8f8089717e3b
--- /dev/null
+++ b/core/java/android/app/timezonedetector/OWNERS
@@ -0,0 +1,3 @@
+# Bug component: 847766
+mingaleev@google.com
+include /core/java/android/app/timedetector/OWNERS
diff --git a/core/java/android/companion/CompanionDeviceManager.java b/core/java/android/companion/CompanionDeviceManager.java
index c3c270e52eb6..59646f106db5 100644
--- a/core/java/android/companion/CompanionDeviceManager.java
+++ b/core/java/android/companion/CompanionDeviceManager.java
@@ -34,6 +34,7 @@ import android.os.Handler;
import android.os.RemoteException;
import android.os.UserHandle;
import android.service.notification.NotificationListenerService;
+import android.util.ExceptionUtils;
import android.util.Log;
import java.util.Collections;
@@ -321,6 +322,77 @@ public final class CompanionDeviceManager {
}
}
+ /**
+ * Register to receive callbacks whenever the associated device comes in and out of range.
+ *
+ * The provided device must be {@link #associate associated} with the calling app before
+ * calling this method.
+ *
+ * Caller must implement a single {@link CompanionDeviceService} which will be bound to and
+ * receive callbacks to {@link CompanionDeviceService#onDeviceAppeared} and
+ * {@link CompanionDeviceService#onDeviceDisappeared}.
+ * The app doesn't need to remain running in order to receive its callbacks.
+ *
+ * Calling app must declare uses-permission
+ * {@link android.Manifest.permission#REQUEST_OBSERVE_COMPANION_DEVICE_PRESENCE}.
+ *
+ * Calling app must check for feature presence of
+ * {@link PackageManager#FEATURE_COMPANION_DEVICE_SETUP} before calling this API.
+ *
+ * @param deviceAddress a previously-associated companion device's address
+ *
+ * @throws DeviceNotAssociatedException if the given device was not previously associated
+ * with this app.
+ */
+ @RequiresPermission(android.Manifest.permission.REQUEST_OBSERVE_COMPANION_DEVICE_PRESENCE)
+ public void startObservingDevicePresence(@NonNull String deviceAddress)
+ throws DeviceNotAssociatedException {
+ if (!checkFeaturePresent()) {
+ return;
+ }
+ Objects.requireNonNull(deviceAddress, "address cannot be null");
+ try {
+ mService.registerDevicePresenceListenerService(
+ mContext.getPackageName(), deviceAddress);
+ } catch (RemoteException e) {
+ ExceptionUtils.propagateIfInstanceOf(e.getCause(), DeviceNotAssociatedException.class);
+ throw e.rethrowFromSystemServer();
+ }
+ }
+
+ /**
+ * Unregister for receiving callbacks whenever the associated device comes in and out of range.
+ *
+ * The provided device must be {@link #associate associated} with the calling app before
+ * calling this method.
+ *
+ * Calling app must declare uses-permission
+ * {@link android.Manifest.permission#REQUEST_OBSERVE_COMPANION_DEVICE_PRESENCE}.
+ *
+ * Calling app must check for feature presence of
+ * {@link PackageManager#FEATURE_COMPANION_DEVICE_SETUP} before calling this API.
+ *
+ * @param deviceAddress a previously-associated companion device's address
+ *
+ * @throws DeviceNotAssociatedException if the given device was not previously associated
+ * with this app.
+ */
+ @RequiresPermission(android.Manifest.permission.REQUEST_OBSERVE_COMPANION_DEVICE_PRESENCE)
+ public void stopObservingDevicePresence(@NonNull String deviceAddress)
+ throws DeviceNotAssociatedException {
+ if (!checkFeaturePresent()) {
+ return;
+ }
+ Objects.requireNonNull(deviceAddress, "address cannot be null");
+ try {
+ mService.unregisterDevicePresenceListenerService(
+ mContext.getPackageName(), deviceAddress);
+ } catch (RemoteException e) {
+ ExceptionUtils.propagateIfInstanceOf(e.getCause(), DeviceNotAssociatedException.class);
+ throw e.rethrowFromSystemServer();
+ }
+ }
+
private boolean checkFeaturePresent() {
boolean featurePresent = mService != null;
if (!featurePresent && DEBUG) {
diff --git a/core/java/android/companion/DeviceNotAssociatedException.java b/core/java/android/companion/DeviceNotAssociatedException.java
new file mode 100644
index 000000000000..bebb6c9ff7eb
--- /dev/null
+++ b/core/java/android/companion/DeviceNotAssociatedException.java
@@ -0,0 +1,31 @@
+/*
+ * 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 android.companion;
+
+import android.annotation.Nullable;
+
+/**
+ * An exception for a case when a given device was not
+ * {@link CompanionDeviceManager#associate associated} to the calling app.
+ */
+public class DeviceNotAssociatedException extends Exception {
+ /** @hide */
+ public DeviceNotAssociatedException(@Nullable String deviceName) {
+ super("Device not associated with the current app: " + deviceName);
+ }
+}
diff --git a/core/java/android/companion/ICompanionDeviceManager.aidl b/core/java/android/companion/ICompanionDeviceManager.aidl
index bcb9be80e6a4..527d8df94ea0 100644
--- a/core/java/android/companion/ICompanionDeviceManager.aidl
+++ b/core/java/android/companion/ICompanionDeviceManager.aidl
@@ -45,4 +45,8 @@ interface ICompanionDeviceManager {
boolean isDeviceAssociatedForWifiConnection(in String packageName, in String macAddress,
int userId);
+
+ void registerDevicePresenceListenerService(in String packageName, in String deviceAddress);
+
+ void unregisterDevicePresenceListenerService(in String packageName, in String deviceAddress);
}
diff --git a/core/java/android/content/Context.java b/core/java/android/content/Context.java
index d920fb3e97e6..f3e1a87ea271 100644
--- a/core/java/android/content/Context.java
+++ b/core/java/android/content/Context.java
@@ -4564,6 +4564,15 @@ public abstract class Context {
public static final String PERMISSION_SERVICE = "permission";
/**
+ * Official published name of the legacy (internal) permission service.
+ *
+ * @see #getSystemService(String)
+ * @hide
+ */
+ //@SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
+ public static final String LEGACY_PERMISSION_SERVICE = "legacy_permission";
+
+ /**
* Official published name of the (internal) permission controller service.
*
* @see #getSystemService(String)
diff --git a/core/java/android/content/OWNERS b/core/java/android/content/OWNERS
new file mode 100644
index 000000000000..c1e7e41972ba
--- /dev/null
+++ b/core/java/android/content/OWNERS
@@ -0,0 +1,3 @@
+# Remain no owner because multiple modules may touch this file.
+per-file Context.java = *
+per-file ContextWrapper.java = *
diff --git a/core/java/android/content/pm/OWNERS b/core/java/android/content/pm/OWNERS
index 3a590dac7c0b..24872e8c3c1d 100644
--- a/core/java/android/content/pm/OWNERS
+++ b/core/java/android/content/pm/OWNERS
@@ -5,3 +5,4 @@ toddke@google.com
patb@google.com
per-file PackageParser.java = chiuwinson@google.com
+per-file *Shortcut* = omakoto@google.com, yamasani@google.com, sunnygoyal@google.com, mett@google.com, pinyaoting@google.com
diff --git a/core/java/android/content/pm/PackageManager.java b/core/java/android/content/pm/PackageManager.java
index cf3f7069c63f..bd270997ead0 100644
--- a/core/java/android/content/pm/PackageManager.java
+++ b/core/java/android/content/pm/PackageManager.java
@@ -2682,6 +2682,23 @@ public abstract class PackageManager {
/**
* Feature for {@link #getSystemAvailableFeatures} and
+ * {@link #hasSystemFeature(String, int)}: If this feature is supported, the feature version
+ * specifies a date such that the device is known to pass the OpenGLES dEQP test suite
+ * associated with that date. The date is encoded as follows:
+ * <ul>
+ * <li>Year in bits 31-16</li>
+ * <li>Month in bits 15-8</li>
+ * <li>Day in bits 7-0</li>
+ * </ul>
+ * <p>
+ * Example: 2021-03-01 is encoded as 0x07E50301, and would indicate that the device passes the
+ * OpenGL ES dEQP test suite version that was current on 2021-03-01.
+ */
+ @SdkConstant(SdkConstantType.FEATURE)
+ public static final String FEATURE_OPENGLES_DEQP_LEVEL = "android.software.opengles.deqp.level";
+
+ /**
+ * Feature for {@link #getSystemAvailableFeatures} and
* {@link #hasSystemFeature}: The device includes broadcast radio tuner.
* @hide
*/
@@ -4438,6 +4455,7 @@ public abstract class PackageManager {
* @throws NameNotFoundException if a package with the given name cannot be
* found on the system.
*/
+ //@Deprecated
public abstract PermissionInfo getPermissionInfo(@NonNull String permName,
@PermissionInfoFlags int flags) throws NameNotFoundException;
@@ -4450,9 +4468,10 @@ public abstract class PackageManager {
* @param flags Additional option flags to modify the data returned.
* @return Returns a list of {@link PermissionInfo} containing information
* about all of the permissions in the given group.
- * @throws NameNotFoundException if a package with the given name cannot be
+ * @throws NameNotFoundException if a group with the given name cannot be
* found on the system.
*/
+ //@Deprecated
@NonNull
public abstract List<PermissionInfo> queryPermissionsByGroup(@NonNull String permissionGroup,
@PermissionInfoFlags int flags) throws NameNotFoundException;
@@ -4481,7 +4500,7 @@ public abstract class PackageManager {
* Retrieve all of the information we know about a particular group of
* permissions.
*
- * @param permName The fully qualified name (i.e.
+ * @param groupName The fully qualified name (i.e.
* com.google.permission_group.APPS) of the permission you are
* interested in.
* @param flags Additional option flags to modify the data returned.
@@ -4490,8 +4509,9 @@ public abstract class PackageManager {
* @throws NameNotFoundException if a package with the given name cannot be
* found on the system.
*/
+ //@Deprecated
@NonNull
- public abstract PermissionGroupInfo getPermissionGroupInfo(@NonNull String permName,
+ public abstract PermissionGroupInfo getPermissionGroupInfo(@NonNull String groupName,
@PermissionGroupInfoFlags int flags) throws NameNotFoundException;
/**
@@ -4501,6 +4521,7 @@ public abstract class PackageManager {
* @return Returns a list of {@link PermissionGroupInfo} containing
* information about all of the known permission groups.
*/
+ //@Deprecated
@NonNull
public abstract List<PermissionGroupInfo> getAllPermissionGroups(
@PermissionGroupInfoFlags int flags);
@@ -4757,6 +4778,7 @@ public abstract class PackageManager {
* @return Whether the permission is restricted by policy.
*/
@CheckResult
+ //@Deprecated
public abstract boolean isPermissionRevokedByPolicy(@NonNull String permName,
@NonNull String packageName);
@@ -4805,6 +4827,7 @@ public abstract class PackageManager {
*
* @see #removePermission(String)
*/
+ //@Deprecated
public abstract boolean addPermission(@NonNull PermissionInfo info);
/**
@@ -4814,6 +4837,7 @@ public abstract class PackageManager {
* expense of no guarantee the added permission will be retained if
* the device is rebooted before it is written.
*/
+ //@Deprecated
public abstract boolean addPermissionAsync(@NonNull PermissionInfo info);
/**
@@ -4829,6 +4853,7 @@ public abstract class PackageManager {
*
* @see #addPermission(PermissionInfo)
*/
+ //@Deprecated
public abstract void removePermission(@NonNull String permName);
/**
@@ -4881,6 +4906,7 @@ public abstract class PackageManager {
*
* @hide
*/
+ //@Deprecated
@SuppressWarnings("HiddenAbstractMethod")
@SystemApi
@RequiresPermission(android.Manifest.permission.GRANT_RUNTIME_PERMISSIONS)
@@ -4908,6 +4934,7 @@ public abstract class PackageManager {
*
* @hide
*/
+ //@Deprecated
@SuppressWarnings("HiddenAbstractMethod")
@SystemApi
@RequiresPermission(android.Manifest.permission.REVOKE_RUNTIME_PERMISSIONS)
@@ -4936,6 +4963,7 @@ public abstract class PackageManager {
*
* @hide
*/
+ //@Deprecated
@SystemApi
@RequiresPermission(android.Manifest.permission.REVOKE_RUNTIME_PERMISSIONS)
public void revokeRuntimePermission(@NonNull String packageName,
@@ -4953,6 +4981,7 @@ public abstract class PackageManager {
*
* @hide
*/
+ //@Deprecated
@SuppressWarnings("HiddenAbstractMethod")
@SystemApi
@RequiresPermission(anyOf = {
@@ -4976,6 +5005,7 @@ public abstract class PackageManager {
*
* @hide
*/
+ //@Deprecated
@SuppressWarnings("HiddenAbstractMethod")
@SystemApi
@RequiresPermission(anyOf = {
@@ -5040,6 +5070,7 @@ public abstract class PackageManager {
*
* @throws SecurityException if you try to access a whitelist that you have no access to.
*/
+ //@Deprecated
@RequiresPermission(value = Manifest.permission.WHITELIST_RESTRICTED_PERMISSIONS,
conditional = true)
public @NonNull Set<String> getWhitelistedRestrictedPermissions(
@@ -5106,6 +5137,7 @@ public abstract class PackageManager {
*
* @throws SecurityException if you try to modify a whitelist that you have no access to.
*/
+ //@Deprecated
@RequiresPermission(value = Manifest.permission.WHITELIST_RESTRICTED_PERMISSIONS,
conditional = true)
public boolean addWhitelistedRestrictedPermission(@NonNull String packageName,
@@ -5175,6 +5207,7 @@ public abstract class PackageManager {
*
* @throws SecurityException if you try to modify a whitelist that you have no access to.
*/
+ //@Deprecated
@RequiresPermission(value = Manifest.permission.WHITELIST_RESTRICTED_PERMISSIONS,
conditional = true)
public boolean removeWhitelistedRestrictedPermission(@NonNull String packageName,
@@ -5207,6 +5240,7 @@ public abstract class PackageManager {
*
* @throws SecurityException if you you have no access to modify this.
*/
+ //@Deprecated
@RequiresPermission(value = Manifest.permission.WHITELIST_AUTO_REVOKE_PERMISSIONS,
conditional = true)
public boolean setAutoRevokeWhitelisted(@NonNull String packageName, boolean whitelisted) {
@@ -5234,6 +5268,7 @@ public abstract class PackageManager {
*
* @throws SecurityException if you you have no access to this.
*/
+ //@Deprecated
@RequiresPermission(value = Manifest.permission.WHITELIST_AUTO_REVOKE_PERMISSIONS,
conditional = true)
public boolean isAutoRevokeWhitelisted(@NonNull String packageName) {
@@ -5252,6 +5287,7 @@ public abstract class PackageManager {
*
* @hide
*/
+ //@Deprecated
@SuppressWarnings("HiddenAbstractMethod")
@UnsupportedAppUsage
public abstract boolean shouldShowRequestPermissionRationale(@NonNull String permName);
@@ -7554,6 +7590,7 @@ public abstract class PackageManager {
*
* @hide
*/
+ //@Deprecated
@SuppressWarnings("HiddenAbstractMethod")
@SystemApi
@RequiresPermission(Manifest.permission.OBSERVE_GRANT_REVOKE_PERMISSIONS)
@@ -7567,6 +7604,7 @@ public abstract class PackageManager {
*
* @hide
*/
+ //@Deprecated
@SuppressWarnings("HiddenAbstractMethod")
@SystemApi
@RequiresPermission(Manifest.permission.OBSERVE_GRANT_REVOKE_PERMISSIONS)
diff --git a/core/java/android/content/pm/PackageParser.java b/core/java/android/content/pm/PackageParser.java
index 4dfbd75a9d67..45f072adf801 100644
--- a/core/java/android/content/pm/PackageParser.java
+++ b/core/java/android/content/pm/PackageParser.java
@@ -53,7 +53,6 @@ import android.compat.annotation.UnsupportedAppUsage;
import android.content.ComponentName;
import android.content.Intent;
import android.content.IntentFilter;
-import android.content.pm.permission.SplitPermissionInfoParcelable;
import android.content.pm.split.DefaultSplitAssetLoader;
import android.content.pm.split.SplitAssetDependencyLoader;
import android.content.pm.split.SplitAssetLoader;
@@ -74,6 +73,7 @@ import android.os.SystemProperties;
import android.os.Trace;
import android.os.UserHandle;
import android.os.storage.StorageManager;
+import android.permission.PermissionManager;
import android.text.TextUtils;
import android.util.ArrayMap;
import android.util.ArraySet;
@@ -2394,17 +2394,13 @@ public class PackageParser {
Slog.i(TAG, newPermsMsg.toString());
}
- List<SplitPermissionInfoParcelable> splitPermissions;
-
- try {
- splitPermissions = ActivityThread.getPermissionManager().getSplitPermissions();
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
+ final List<PermissionManager.SplitPermissionInfo> splitPermissions =
+ ActivityThread.currentApplication().getSystemService(PermissionManager.class)
+ .getSplitPermissions();
final int listSize = splitPermissions.size();
for (int is = 0; is < listSize; is++) {
- final SplitPermissionInfoParcelable spi = splitPermissions.get(is);
+ final PermissionManager.SplitPermissionInfo spi = splitPermissions.get(is);
if (pkg.applicationInfo.targetSdkVersion >= spi.getTargetSdk()
|| !pkg.requestedPermissions.contains(spi.getSplitPermission())) {
continue;
diff --git a/core/java/android/content/pm/parsing/ParsingPackageUtils.java b/core/java/android/content/pm/parsing/ParsingPackageUtils.java
index eae7d452ff74..561a9e31b4b0 100644
--- a/core/java/android/content/pm/parsing/ParsingPackageUtils.java
+++ b/core/java/android/content/pm/parsing/ParsingPackageUtils.java
@@ -71,7 +71,6 @@ import android.content.pm.parsing.result.ParseInput;
import android.content.pm.parsing.result.ParseInput.DeferredError;
import android.content.pm.parsing.result.ParseResult;
import android.content.pm.parsing.result.ParseTypeImpl;
-import android.content.pm.permission.SplitPermissionInfoParcelable;
import android.content.pm.split.DefaultSplitAssetLoader;
import android.content.pm.split.SplitAssetDependencyLoader;
import android.content.pm.split.SplitAssetLoader;
@@ -85,9 +84,9 @@ import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.FileUtils;
-import android.os.RemoteException;
import android.os.Trace;
import android.os.ext.SdkExtensions;
+import android.permission.PermissionManager;
import android.text.TextUtils;
import android.util.ArrayMap;
import android.util.ArraySet;
@@ -2664,17 +2663,13 @@ public class ParsingPackageUtils {
}
private static void convertSplitPermissions(ParsingPackage pkg) {
- List<SplitPermissionInfoParcelable> splitPermissions;
-
- try {
- splitPermissions = ActivityThread.getPermissionManager().getSplitPermissions();
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
+ final List<PermissionManager.SplitPermissionInfo> splitPermissions =
+ ActivityThread.currentApplication().getSystemService(PermissionManager.class)
+ .getSplitPermissions();
final int listSize = splitPermissions.size();
for (int is = 0; is < listSize; is++) {
- final SplitPermissionInfoParcelable spi = splitPermissions.get(is);
+ final PermissionManager.SplitPermissionInfo spi = splitPermissions.get(is);
List<String> requestedPermissions = pkg.getRequestedPermissions();
if (pkg.getTargetSdkVersion() >= spi.getTargetSdk()
|| !requestedPermissions.contains(spi.getSplitPermission())) {
diff --git a/core/java/android/database/OWNERS b/core/java/android/database/OWNERS
index 1734cfcad360..7e19942ba332 100644
--- a/core/java/android/database/OWNERS
+++ b/core/java/android/database/OWNERS
@@ -1,3 +1,3 @@
omakoto@google.com
-jsharkey@google.com
+jsharkey@android.com
yamasani@google.com
diff --git a/core/java/android/hardware/ISensorPrivacyManager.aidl b/core/java/android/hardware/ISensorPrivacyManager.aidl
index 1ba7b989a764..4e368d0610b3 100644
--- a/core/java/android/hardware/ISensorPrivacyManager.aidl
+++ b/core/java/android/hardware/ISensorPrivacyManager.aidl
@@ -32,4 +32,12 @@ interface ISensorPrivacyManager {
void setSensorPrivacy(boolean enable);
// =============== End of transactions used on native side as well ============================
+
+ // TODO(evanseverson) add to native interface
+ boolean isIndividualSensorPrivacyEnabled(int sensor);
+
+ // TODO(evanseverson) add to native interface
+ void setIndividualSensorPrivacy(int sensor, boolean enable);
+
+ // TODO(evanseverson) listeners
} \ No newline at end of file
diff --git a/core/java/android/hardware/OWNERS b/core/java/android/hardware/OWNERS
index 47dbf2d960e3..3295042b0b35 100644
--- a/core/java/android/hardware/OWNERS
+++ b/core/java/android/hardware/OWNERS
@@ -1,2 +1,5 @@
# Camera
per-file *Camera*=cychen@google.com,epeev@google.com,etalvala@google.com,shuzhenwang@google.com,yinchiayeh@google.com,zhijunhe@google.com,jchowdhary@google.com
+
+# Sensor Privacy
+per-file *SensorPrivacy* = file:platform/frameworks/native:/libs/sensorprivacy/OWNERS
diff --git a/core/java/android/hardware/SensorPrivacyManager.java b/core/java/android/hardware/SensorPrivacyManager.java
index 274202f7c190..c647239d9049 100644
--- a/core/java/android/hardware/SensorPrivacyManager.java
+++ b/core/java/android/hardware/SensorPrivacyManager.java
@@ -16,6 +16,7 @@
package android.hardware;
+import android.annotation.IntDef;
import android.annotation.NonNull;
import android.annotation.RequiresPermission;
import android.annotation.SystemService;
@@ -23,10 +24,14 @@ import android.content.Context;
import android.os.IBinder;
import android.os.RemoteException;
import android.os.ServiceManager;
+import android.service.SensorPrivacyIndividualEnabledSensorProto;
import android.util.ArrayMap;
import com.android.internal.annotations.GuardedBy;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+
/**
* This class provides access to the sensor privacy services; sensor privacy allows the
* user to disable access to all sensors on the device. This class provides methods to query the
@@ -38,6 +43,25 @@ import com.android.internal.annotations.GuardedBy;
@SystemService(Context.SENSOR_PRIVACY_SERVICE)
public final class SensorPrivacyManager {
+ /** Microphone */
+ public static final int INDIVIDUAL_SENSOR_MICROPHONE =
+ SensorPrivacyIndividualEnabledSensorProto.MICROPHONE;
+
+ /** Camera */
+ public static final int INDIVIDUAL_SENSOR_CAMERA =
+ SensorPrivacyIndividualEnabledSensorProto.CAMERA;
+
+ /**
+ * Individual sensors not listed in {@link Sensor}
+ * @hide
+ */
+ @IntDef(prefix = "INDIVIDUAL_SENSOR_", value = {
+ INDIVIDUAL_SENSOR_MICROPHONE,
+ INDIVIDUAL_SENSOR_CAMERA
+ })
+ @Retention(RetentionPolicy.SOURCE)
+ public @interface IndividualSensor {}
+
/**
* A class implementing this interface can register with the {@link
* android.hardware.SensorPrivacyManager} to receive notification when the sensor privacy
@@ -168,4 +192,31 @@ public final class SensorPrivacyManager {
throw e.rethrowFromSystemServer();
}
}
+
+ /**
+ * Returns whether sensor privacy is currently enabled for a specific sensor.
+ *
+ * @return true if sensor privacy is currently enabled, false otherwise.
+ */
+ public boolean isIndividualSensorPrivacyEnabled(@IndividualSensor int sensor) {
+ try {
+ return mService.isIndividualSensorPrivacyEnabled(sensor);
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
+ }
+
+ /**
+ * Sets sensor privacy to the specified state for an individual sensor.
+ *
+ * @param enable the state to which sensor privacy should be set.
+ */
+ @RequiresPermission(android.Manifest.permission.MANAGE_SENSOR_PRIVACY)
+ public void setIndividualSensorPrivacy(@IndividualSensor int sensor, boolean enable) {
+ try {
+ mService.setIndividualSensorPrivacy(sensor, enable);
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
+ }
}
diff --git a/core/java/android/hardware/camera2/CameraCaptureSession.java b/core/java/android/hardware/camera2/CameraCaptureSession.java
index e8581595ad91..bd4746369811 100644
--- a/core/java/android/hardware/camera2/CameraCaptureSession.java
+++ b/core/java/android/hardware/camera2/CameraCaptureSession.java
@@ -964,12 +964,20 @@ public abstract class CameraCaptureSession implements AutoCloseable {
* <p>Closing a session frees up the target output Surfaces of the session for reuse with either
* a new session, or to other APIs that can draw to Surfaces.</p>
*
- * <p>Note that creating a new capture session with {@link CameraDevice#createCaptureSession}
+ * <p>Note that for common usage scenarios like creating a new session or closing the camera
+ * device, it is faster to call respective APIs directly (see below for more details) without
+ * calling into this method. This API is only useful when application wants to uncofigure the
+ * camera but keep the device open for later use.</p>
+ *
+ * <p>Creating a new capture session with {@link CameraDevice#createCaptureSession}
* will close any existing capture session automatically, and call the older session listener's
* {@link StateCallback#onClosed} callback. Using {@link CameraDevice#createCaptureSession}
* directly without closing is the recommended approach for quickly switching to a new session,
* since unchanged target outputs can be reused more efficiently.</p>
*
+ * <p>Closing the device with {@link CameraDevice#close} directly without calling this API is
+ * also recommended for quickly closing the camera.</p>
+ *
* <p>Once a session is closed, all methods on it will throw an IllegalStateException, and any
* repeating requests or bursts are stopped (as if {@link #stopRepeating()} was called).
* However, any in-progress capture requests submitted to the session will be completed as
diff --git a/core/java/android/hardware/camera2/CameraMetadata.java b/core/java/android/hardware/camera2/CameraMetadata.java
index 7afba1a214b8..41cc12f3b2e3 100644
--- a/core/java/android/hardware/camera2/CameraMetadata.java
+++ b/core/java/android/hardware/camera2/CameraMetadata.java
@@ -2856,10 +2856,10 @@ public abstract class CameraMetadata<TKey> {
* respective color channel provided in
* {@link CaptureRequest#SENSOR_TEST_PATTERN_DATA android.sensor.testPatternData}.</p>
* <p>For example:</p>
- * <pre><code>android.testPatternData = [0, 0xFFFFFFFF, 0xFFFFFFFF, 0]
+ * <pre><code>android.control.testPatternData = [0, 0xFFFFFFFF, 0xFFFFFFFF, 0]
* </code></pre>
* <p>All green pixels are 100% green. All red/blue pixels are black.</p>
- * <pre><code>android.testPatternData = [0xFFFFFFFF, 0, 0xFFFFFFFF, 0]
+ * <pre><code>android.control.testPatternData = [0xFFFFFFFF, 0, 0xFFFFFFFF, 0]
* </code></pre>
* <p>All red pixels are 100% red. Only the odd green pixels
* are 100% green. All blue pixels are 100% black.</p>
diff --git a/core/java/android/hardware/camera2/impl/CameraMetadataNative.java b/core/java/android/hardware/camera2/impl/CameraMetadataNative.java
index 19f4cd6e991a..5cc7bf8cefed 100644
--- a/core/java/android/hardware/camera2/impl/CameraMetadataNative.java
+++ b/core/java/android/hardware/camera2/impl/CameraMetadataNative.java
@@ -1719,37 +1719,25 @@ public class CameraMetadataNative implements Parcelable {
private static native long nativeAllocateCopy(long ptr)
throws NullPointerException;
- @FastNative
private static synchronized native void nativeWriteToParcel(Parcel dest, long ptr);
- @FastNative
private static synchronized native void nativeReadFromParcel(Parcel source, long ptr);
- @FastNative
private static synchronized native void nativeSwap(long ptr, long otherPtr)
throws NullPointerException;
- @FastNative
private static synchronized native void nativeClose(long ptr);
- @FastNative
private static synchronized native boolean nativeIsEmpty(long ptr);
- @FastNative
private static synchronized native int nativeGetEntryCount(long ptr);
- @FastNative
private static synchronized native long nativeGetBufferSize(long ptr);
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
- @FastNative
private static synchronized native byte[] nativeReadValues(int tag, long ptr);
- @FastNative
private static synchronized native void nativeWriteValues(int tag, byte[] src, long ptr);
private static synchronized native void nativeDump(long ptr) throws IOException; // dump to LOGD
- @FastNative
private static synchronized native ArrayList nativeGetAllVendorKeys(long ptr, Class keyClass);
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
- @FastNative
private static synchronized native int nativeGetTagFromKeyLocal(long ptr, String keyName)
throws IllegalArgumentException;
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
- @FastNative
private static synchronized native int nativeGetTypeFromTagLocal(long ptr, int tag)
throws IllegalArgumentException;
@FastNative
diff --git a/core/java/android/hardware/hdmi/HdmiPortInfo.java b/core/java/android/hardware/hdmi/HdmiPortInfo.java
index e4b311a64c31..625a6a53d9ce 100644
--- a/core/java/android/hardware/hdmi/HdmiPortInfo.java
+++ b/core/java/android/hardware/hdmi/HdmiPortInfo.java
@@ -192,6 +192,7 @@ public final class HdmiPortInfo implements Parcelable {
@Override
public int hashCode() {
- return mId;
+ return java.util.Objects.hash(
+ mId, mType, mAddress, mCecSupported, mArcSupported, mMhlSupported);
}
}
diff --git a/core/java/android/net/NetworkAgent.java b/core/java/android/net/NetworkAgent.java
index 0676ad4e2322..6780167fa63e 100644
--- a/core/java/android/net/NetworkAgent.java
+++ b/core/java/android/net/NetworkAgent.java
@@ -51,7 +51,7 @@ import java.util.concurrent.atomic.AtomicBoolean;
* An agent manages the life cycle of a network. A network starts its
* life cycle when {@link register} is called on NetworkAgent. The network
* is then connecting. When full L3 connectivity has been established,
- * the agent shoud call {@link markConnected} to inform the system that
+ * the agent should call {@link markConnected} to inform the system that
* this network is ready to use. When the network disconnects its life
* ends and the agent should call {@link unregister}, at which point the
* system will clean up and free resources.
@@ -94,12 +94,6 @@ public abstract class NetworkAgent {
@Nullable
private volatile Network mNetwork;
- // Whether this NetworkAgent is using the legacy (never unhidden) API. The difference is
- // that the legacy API uses NetworkInfo to convey the state, while the current API is
- // exposing methods to manage it and generate it internally instead.
- // TODO : remove this as soon as all agents have been converted.
- private final boolean mIsLegacy;
-
private final Handler mHandler;
private volatile AsyncChannel mAsyncChannel;
private final String LOG_TAG;
@@ -110,8 +104,6 @@ public abstract class NetworkAgent {
private static final long BW_REFRESH_MIN_WIN_MS = 500;
private boolean mBandwidthUpdateScheduled = false;
private AtomicBoolean mBandwidthUpdatePending = new AtomicBoolean(false);
- // Not used by legacy agents. Non-legacy agents use this to convert the NetworkAgent system API
- // into the internal API of ConnectivityService.
@NonNull
private NetworkInfo mNetworkInfo;
@NonNull
@@ -337,35 +329,6 @@ public abstract class NetworkAgent {
*/
public static final int CMD_REMOVE_KEEPALIVE_PACKET_FILTER = BASE + 17;
- /** @hide TODO: remove and replace usage with the public constructor. */
- public NetworkAgent(Looper looper, Context context, String logTag, NetworkInfo ni,
- NetworkCapabilities nc, LinkProperties lp, int score) {
- this(looper, context, logTag, ni, nc, lp, score, null, NetworkProvider.ID_NONE);
- // Register done by the constructor called in the previous line
- }
-
- /** @hide TODO: remove and replace usage with the public constructor. */
- public NetworkAgent(Looper looper, Context context, String logTag, NetworkInfo ni,
- NetworkCapabilities nc, LinkProperties lp, int score, NetworkAgentConfig config) {
- this(looper, context, logTag, ni, nc, lp, score, config, NetworkProvider.ID_NONE);
- // Register done by the constructor called in the previous line
- }
-
- /** @hide TODO: remove and replace usage with the public constructor. */
- public NetworkAgent(Looper looper, Context context, String logTag, NetworkInfo ni,
- NetworkCapabilities nc, LinkProperties lp, int score, int providerId) {
- this(looper, context, logTag, ni, nc, lp, score, null, providerId);
- // Register done by the constructor called in the previous line
- }
-
- /** @hide TODO: remove and replace usage with the public constructor. */
- public NetworkAgent(Looper looper, Context context, String logTag, NetworkInfo ni,
- NetworkCapabilities nc, LinkProperties lp, int score, NetworkAgentConfig config,
- int providerId) {
- this(looper, context, logTag, nc, lp, score, config, providerId, ni, true /* legacy */);
- register();
- }
-
private static NetworkInfo getLegacyNetworkInfo(final NetworkAgentConfig config) {
// The subtype can be changed with (TODO) setLegacySubtype, but it starts
// with 0 (TelephonyManager.NETWORK_TYPE_UNKNOWN) and an empty description.
@@ -393,7 +356,7 @@ public abstract class NetworkAgent {
@NonNull NetworkAgentConfig config, @Nullable NetworkProvider provider) {
this(looper, context, logTag, nc, lp, score, config,
provider == null ? NetworkProvider.ID_NONE : provider.getProviderId(),
- getLegacyNetworkInfo(config), false /* legacy */);
+ getLegacyNetworkInfo(config));
}
private static class InitialConfiguration {
@@ -418,11 +381,9 @@ public abstract class NetworkAgent {
private NetworkAgent(@NonNull Looper looper, @NonNull Context context, @NonNull String logTag,
@NonNull NetworkCapabilities nc, @NonNull LinkProperties lp, int score,
- @NonNull NetworkAgentConfig config, int providerId, @NonNull NetworkInfo ni,
- boolean legacy) {
+ @NonNull NetworkAgentConfig config, int providerId, @NonNull NetworkInfo ni) {
mHandler = new NetworkAgentHandler(looper);
LOG_TAG = logTag;
- mIsLegacy = legacy;
mNetworkInfo = new NetworkInfo(ni);
this.providerId = providerId;
if (ni == null || nc == null || lp == null) {
@@ -696,11 +657,6 @@ public abstract class NetworkAgent {
* Call {@link #unregister} to disconnect.
*/
public void markConnected() {
- if (mIsLegacy) {
- throw new UnsupportedOperationException(
- "Legacy agents can't call markConnected.");
- }
- // |reason| cannot be used by the non-legacy agents
mNetworkInfo.setDetailedState(NetworkInfo.DetailedState.CONNECTED, null /* reason */,
mNetworkInfo.getExtraInfo());
queueOrSendMessage(EVENT_NETWORK_INFO_CHANGED, mNetworkInfo);
@@ -713,9 +669,6 @@ public abstract class NetworkAgent {
* the network is torn down and this agent can no longer be used.
*/
public void unregister() {
- if (mIsLegacy) {
- throw new UnsupportedOperationException("Legacy agents can't call unregister.");
- }
// When unregistering an agent nobody should use the extrainfo (or reason) any more.
mNetworkInfo.setDetailedState(NetworkInfo.DetailedState.DISCONNECTED, null /* reason */,
null /* extraInfo */);
@@ -735,9 +688,6 @@ public abstract class NetworkAgent {
*/
@Deprecated
public void setLegacySubtype(final int legacySubtype, @NonNull final String legacySubtypeName) {
- if (mIsLegacy) {
- throw new UnsupportedOperationException("Legacy agents can't call setLegacySubtype.");
- }
mNetworkInfo.setSubtype(legacySubtype, legacySubtypeName);
queueOrSendMessage(EVENT_NETWORK_INFO_CHANGED, mNetworkInfo);
}
@@ -760,9 +710,6 @@ public abstract class NetworkAgent {
*/
@Deprecated
public void setLegacyExtraInfo(@Nullable final String extraInfo) {
- if (mIsLegacy) {
- throw new UnsupportedOperationException("Legacy agents can't call setLegacyExtraInfo.");
- }
mNetworkInfo.setExtraInfo(extraInfo);
queueOrSendMessage(EVENT_NETWORK_INFO_CHANGED, mNetworkInfo);
}
@@ -773,9 +720,6 @@ public abstract class NetworkAgent {
*/
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023)
public final void sendNetworkInfo(NetworkInfo networkInfo) {
- if (!mIsLegacy) {
- throw new UnsupportedOperationException("Only legacy agents can call sendNetworkInfo.");
- }
queueOrSendMessage(EVENT_NETWORK_INFO_CHANGED, new NetworkInfo(networkInfo));
}
diff --git a/core/java/android/net/OWNERS b/core/java/android/net/OWNERS
index 2f8f685af40b..4ea8a54828b3 100644
--- a/core/java/android/net/OWNERS
+++ b/core/java/android/net/OWNERS
@@ -1,11 +1,5 @@
set noparent
-codewiz@google.com
-jchalard@google.com
-jsharkey@google.com
-junyulai@google.com
-lorenzo@google.com
-reminv@google.com
-satk@google.com
+include platform/frameworks/base:/services/core/java/com/android/server/net/OWNERS
per-file SSL*, Uri*, Url* = prb@google.com, dauletz@google.com, narayan@google.com, ngeoffray@google.com
diff --git a/core/java/android/net/TcpRepairWindow.java b/core/java/android/net/TcpRepairWindow.java
index 86034f0a76ed..f062fa9034ea 100644
--- a/core/java/android/net/TcpRepairWindow.java
+++ b/core/java/android/net/TcpRepairWindow.java
@@ -16,12 +16,15 @@
package android.net;
+import android.annotation.SystemApi;
+
/**
* Corresponds to C's {@code struct tcp_repair_window} from
* include/uapi/linux/tcp.h
*
* @hide
*/
+@SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
public final class TcpRepairWindow {
public final int sndWl1;
public final int sndWnd;
diff --git a/core/java/android/os/BatteryConsumer.java b/core/java/android/os/BatteryConsumer.java
index d00c3c361722..74880b2d61d3 100644
--- a/core/java/android/os/BatteryConsumer.java
+++ b/core/java/android/os/BatteryConsumer.java
@@ -49,6 +49,28 @@ public abstract class BatteryConsumer {
public static final int FIRST_CUSTOM_POWER_COMPONENT_ID = 1000;
public static final int LAST_CUSTOM_POWER_COMPONENT_ID = 9999;
+ /**
+ * Time usage component, describing the particular part of the system
+ * that was used for the corresponding amount of time.
+ *
+ * @hide
+ */
+ @IntDef(prefix = {"TIME_COMPONENT_"}, value = {
+ TIME_COMPONENT_CPU,
+ TIME_COMPONENT_CPU_FOREGROUND,
+ })
+ @Retention(RetentionPolicy.SOURCE)
+ public static @interface TimeComponent {
+ }
+
+ public static final int TIME_COMPONENT_CPU = 0;
+ public static final int TIME_COMPONENT_CPU_FOREGROUND = 1;
+
+ public static final int TIME_COMPONENT_COUNT = 2;
+
+ public static final int FIRST_CUSTOM_TIME_COMPONENT_ID = 1000;
+ public static final int LAST_CUSTOM_TIME_COMPONENT_ID = 9999;
+
private final PowerComponents mPowerComponents;
protected BatteryConsumer(@NonNull PowerComponents powerComponents) {
@@ -83,6 +105,29 @@ public abstract class BatteryConsumer {
return mPowerComponents.getConsumedPowerForCustomComponent(componentId);
}
+ /**
+ * Returns the amount of time since BatteryStats reset used by the specified component, e.g.
+ * CPU, WiFi etc.
+ *
+ * @param componentId The ID of the time component, e.g.
+ * {@link UidBatteryConsumer#TIME_COMPONENT_CPU}.
+ * @return Amount of time in milliseconds.
+ */
+ public long getUsageDurationMillis(@TimeComponent int componentId) {
+ return mPowerComponents.getUsageDurationMillis(componentId);
+ }
+
+ /**
+ * Returns the amount of usage time attributed to the specified custom component
+ * since BatteryStats reset.
+ *
+ * @param componentId The ID of the custom power component.
+ * @return Amount of time in milliseconds.
+ */
+ public long getUsageDurationForCustomComponentMillis(int componentId) {
+ return mPowerComponents.getUsageDurationForCustomComponentMillis(componentId);
+ }
+
protected void writeToParcel(Parcel dest, int flags) {
mPowerComponents.writeToParcel(dest, flags);
}
diff --git a/core/java/android/os/BatteryUsageStats.java b/core/java/android/os/BatteryUsageStats.java
index 3f036cdcfa72..79f58f68b637 100644
--- a/core/java/android/os/BatteryUsageStats.java
+++ b/core/java/android/os/BatteryUsageStats.java
@@ -35,7 +35,11 @@ public final class BatteryUsageStats implements Parcelable {
private BatteryUsageStats(@NonNull Builder builder) {
mConsumedPower = builder.mConsumedPower;
mDischargePercentage = builder.mDischargePercentage;
- mUidBatteryConsumers = builder.mUidBatteryConsumers;
+ final int uidBatteryConsumerCount = builder.mUidBatteryConsumerBuilders.size();
+ mUidBatteryConsumers = new ArrayList<>(uidBatteryConsumerCount);
+ for (int i = 0; i < uidBatteryConsumerCount; i++) {
+ mUidBatteryConsumers.add(builder.mUidBatteryConsumerBuilders.get(i).build());
+ }
}
/**
@@ -95,7 +99,8 @@ public final class BatteryUsageStats implements Parcelable {
public static final class Builder {
private double mConsumedPower;
private int mDischargePercentage;
- private final ArrayList<UidBatteryConsumer> mUidBatteryConsumers = new ArrayList<>();
+ private final ArrayList<UidBatteryConsumer.Builder> mUidBatteryConsumerBuilders =
+ new ArrayList<>();
/**
* Constructs a read-only object using the Builder values.
@@ -130,9 +135,15 @@ public final class BatteryUsageStats implements Parcelable {
* individual UID.
*/
@NonNull
- public Builder addUidBatteryConsumer(@NonNull UidBatteryConsumer uidBatteryConsumer) {
- mUidBatteryConsumers.add(uidBatteryConsumer);
+ public Builder addUidBatteryConsumerBuilder(
+ @NonNull UidBatteryConsumer.Builder uidBatteryConsumer) {
+ mUidBatteryConsumerBuilders.add(uidBatteryConsumer);
return this;
}
+
+ @NonNull
+ public List<UidBatteryConsumer.Builder> getUidBatteryConsumerBuilders() {
+ return mUidBatteryConsumerBuilders;
+ }
}
}
diff --git a/core/java/android/os/Build.java b/core/java/android/os/Build.java
index bd18150da201..8148c457ec99 100755
--- a/core/java/android/os/Build.java
+++ b/core/java/android/os/Build.java
@@ -107,12 +107,24 @@ public class Build {
public static final String HARDWARE = getString("ro.hardware");
/**
- * The hardware variant (SKU), if available.
+ * The SKU of the hardware (from the kernel command line). The SKU is reported by the bootloader
+ * to configure system software features.
*/
@NonNull
public static final String SKU = getString("ro.boot.hardware.sku");
/**
+ * The SKU of the device as set by the original design manufacturer (ODM). This is a
+ * runtime-initialized property set during startup to configure device services.
+ *
+ * <p>The ODM SKU may have multiple variants for the same system SKU in case a manufacturer
+ * produces variants of the same design. For example, the same build may be released with
+ * variations in physical keyboard and/or display hardware, each with a different ODM SKU.
+ */
+ @NonNull
+ public static final String ODM_SKU = getString("ro.boot.product.hardware.sku");
+
+ /**
* Whether this build was for an emulator device.
* @hide
*/
diff --git a/core/java/android/os/INetworkManagementService.aidl b/core/java/android/os/INetworkManagementService.aidl
index e1d900528f07..25d84bab89e2 100644
--- a/core/java/android/os/INetworkManagementService.aidl
+++ b/core/java/android/os/INetworkManagementService.aidl
@@ -321,16 +321,6 @@ interface INetworkManagementService
void setFirewallChainEnabled(int chain, boolean enable);
/**
- * Set all packets from users in ranges to go through VPN specified by netId.
- */
- void addVpnUidRanges(int netId, in UidRange[] ranges);
-
- /**
- * Clears the special VPN rules for users in ranges and VPN specified by netId.
- */
- void removeVpnUidRanges(int netId, in UidRange[] ranges);
-
- /**
* Start listening for mobile activity state changes.
*/
void registerNetworkActivityListener(INetworkActivityListener listener);
@@ -361,7 +351,5 @@ interface INetworkManagementService
void removeInterfaceFromLocalNetwork(String iface);
int removeRoutesFromLocalNetwork(in List<RouteInfo> routes);
- void setAllowOnlyVpnForUids(boolean enable, in UidRange[] uidRanges);
-
boolean isNetworkRestricted(int uid);
}
diff --git a/core/java/android/os/OWNERS b/core/java/android/os/OWNERS
index d392d7170f2f..3b334a719011 100644
--- a/core/java/android/os/OWNERS
+++ b/core/java/android/os/OWNERS
@@ -16,7 +16,16 @@ per-file IPowerManager.aidl = michaelwr@google.com, santoscordon@google.com
per-file PowerManager.java = michaelwr@google.com, santoscordon@google.com
per-file PowerManagerInternal.java = michaelwr@google.com, santoscordon@google.com
+# BatteryStats
+per-file *BatteryConsumer* = file:/BATTERY_STATS_OWNERS
+per-file BatteryManager* = file:/BATTERY_STATS_OWNERS
+per-file BatteryStats* = file:/BATTERY_STATS_OWNERS
+per-file BatteryUsageStats* = file:/BATTERY_STATS_OWNERS
+per-file PowerComponents.java = file:/BATTERY_STATS_OWNERS
per-file GraphicsEnvironment.java = chrisforbes@google.com, cnorthrop@google.com, lpy@google.com, timvp@google.com, zzyiwei@google.com
+per-file *Network* = file:/services/core/java/com/android/server/net/OWNERS
+per-file *Power* = file:/services/core/java/com/android/server/power/OWNERS
+per-file *Telephony* = file:/telephony/OWNERS
per-file *Zygote* = file:/ZYGOTE_OWNERS
diff --git a/core/java/android/os/PowerComponents.java b/core/java/android/os/PowerComponents.java
index 42ba1ff60e5a..c18fff64ba62 100644
--- a/core/java/android/os/PowerComponents.java
+++ b/core/java/android/os/PowerComponents.java
@@ -29,21 +29,25 @@ class PowerComponents {
private final double mTotalPowerConsumed;
private final double[] mPowerComponents;
+ private final long[] mTimeComponents;
PowerComponents(@NonNull Builder builder) {
mTotalPowerConsumed = builder.mTotalPowerConsumed;
mPowerComponents = builder.mPowerComponents;
+ mTimeComponents = builder.mTimeComponents;
}
PowerComponents(@NonNull Parcel source) {
mTotalPowerConsumed = source.readDouble();
mPowerComponents = source.createDoubleArray();
+ mTimeComponents = source.createLongArray();
}
/** Writes contents to Parcel */
void writeToParcel(@NonNull Parcel dest, int flags) {
dest.writeDouble(mTotalPowerConsumed);
dest.writeDoubleArray(mPowerComponents);
+ dest.writeLongArray(mTimeComponents);
}
/**
@@ -94,15 +98,58 @@ class PowerComponents {
}
/**
+ * Returns the amount of time used by the specified component, e.g. CPU, WiFi etc.
+ *
+ * @param componentId The ID of the time component, e.g.
+ * {@link UidBatteryConsumer#TIME_COMPONENT_CPU}.
+ * @return Amount of time in milliseconds.
+ */
+ public long getUsageDurationMillis(@UidBatteryConsumer.TimeComponent int componentId) {
+ if (componentId >= UidBatteryConsumer.TIME_COMPONENT_COUNT) {
+ throw new IllegalArgumentException(
+ "Unsupported time component ID: " + componentId);
+ }
+ try {
+ return mTimeComponents[componentId];
+ } catch (ArrayIndexOutOfBoundsException e) {
+ throw new IllegalArgumentException("Unsupported power component ID: " + componentId);
+ }
+ }
+
+ /**
+ * Returns the amount of usage time attributed to the specified custom component.
+ *
+ * @param componentId The ID of the custom power component.
+ * @return Amount of time in milliseconds.
+ */
+ public long getUsageDurationForCustomComponentMillis(int componentId) {
+ if (componentId < UidBatteryConsumer.FIRST_CUSTOM_TIME_COMPONENT_ID) {
+ throw new IllegalArgumentException(
+ "Unsupported custom time component ID: " + componentId);
+ }
+ try {
+ return mTimeComponents[
+ UidBatteryConsumer.TIME_COMPONENT_COUNT + componentId
+ - UidBatteryConsumer.FIRST_CUSTOM_TIME_COMPONENT_ID];
+ } catch (ArrayIndexOutOfBoundsException e) {
+ throw new IllegalArgumentException(
+ "Unsupported custom time component ID: " + componentId);
+ }
+ }
+
+ /**
* Builder for PowerComponents.
*/
static final class Builder {
private double mTotalPowerConsumed;
private final double[] mPowerComponents;
+ private final long[] mTimeComponents;
- Builder(int customPowerComponentCount) {
- mPowerComponents = new double[BatteryConsumer.POWER_COMPONENT_COUNT
+ Builder(int customPowerComponentCount, int customTimeComponentCount) {
+ mPowerComponents = new double[UidBatteryConsumer.POWER_COMPONENT_COUNT
+ customPowerComponentCount];
+ mTimeComponents = new long[UidBatteryConsumer.TIME_COMPONENT_COUNT
+ + customTimeComponentCount];
}
/**
@@ -160,6 +207,53 @@ class PowerComponents {
}
/**
+ * Sets the amount of time used by the specified component, e.g. CPU, WiFi etc.
+ *
+ * @param componentId The ID of the time component, e.g.
+ * {@link UidBatteryConsumer#TIME_COMPONENT_CPU}.
+ * @param componentUsageDurationMillis Amount of time in milliseconds.
+ */
+ @NonNull
+ public Builder setUsageDurationMillis(@UidBatteryConsumer.TimeComponent int componentId,
+ long componentUsageDurationMillis) {
+ if (componentId >= UidBatteryConsumer.TIME_COMPONENT_COUNT) {
+ throw new IllegalArgumentException(
+ "Unsupported time component ID: " + componentId);
+ }
+ try {
+ mTimeComponents[componentId] = componentUsageDurationMillis;
+ } catch (ArrayIndexOutOfBoundsException e) {
+ throw new IllegalArgumentException(
+ "Unsupported time component ID: " + componentId);
+ }
+ return this;
+ }
+
+ /**
+ * Sets the amount of time used by the specified custom component.
+ *
+ * @param componentId The ID of the custom power component.
+ * @param componentUsageDurationMillis Amount of time in milliseconds.
+ */
+ @NonNull
+ public Builder setUsageDurationForCustomComponentMillis(int componentId,
+ long componentUsageDurationMillis) {
+ if (componentId < UidBatteryConsumer.FIRST_CUSTOM_TIME_COMPONENT_ID) {
+ throw new IllegalArgumentException(
+ "Unsupported custom time component ID: " + componentId);
+ }
+ try {
+ mTimeComponents[UidBatteryConsumer.TIME_COMPONENT_COUNT + componentId
+ - UidBatteryConsumer.FIRST_CUSTOM_TIME_COMPONENT_ID] =
+ componentUsageDurationMillis;
+ } catch (ArrayIndexOutOfBoundsException e) {
+ throw new IllegalArgumentException(
+ "Unsupported custom time component ID: " + componentId);
+ }
+ return this;
+ }
+
+ /**
* Creates a read-only object out of the Builder values.
*/
@NonNull
diff --git a/core/java/android/os/RemoteException.java b/core/java/android/os/RemoteException.java
index 98c66d1beaf4..e9fc2f38072b 100644
--- a/core/java/android/os/RemoteException.java
+++ b/core/java/android/os/RemoteException.java
@@ -37,6 +37,11 @@ public class RemoteException extends AndroidException {
super(message, cause, enableSuppression, writableStackTrace);
}
+ /** @hide */
+ public RemoteException(Throwable cause) {
+ this(cause.getMessage(), cause, true, false);
+ }
+
/**
* Rethrow this as an unchecked runtime exception.
* <p>
diff --git a/core/java/android/os/StatFs.java b/core/java/android/os/StatFs.java
index eb8e71761294..bb6066e78a52 100644
--- a/core/java/android/os/StatFs.java
+++ b/core/java/android/os/StatFs.java
@@ -109,7 +109,7 @@ public class StatFs {
* The total number of blocks that are free on the file system, including
* reserved blocks (that are not available to normal applications). This
* corresponds to the Unix {@code statvfs.f_bfree} field. Most applications
- * will want to use {@link #getAvailableBlocks()} instead.
+ * will want to use {@link #getAvailableBlocksLong()} instead.
*/
public long getFreeBlocksLong() {
return mStat.f_bfree;
diff --git a/core/java/android/os/UidBatteryConsumer.java b/core/java/android/os/UidBatteryConsumer.java
index 7dcbf7d4cef3..d12ccb57794b 100644
--- a/core/java/android/os/UidBatteryConsumer.java
+++ b/core/java/android/os/UidBatteryConsumer.java
@@ -82,12 +82,24 @@ public final class UidBatteryConsumer extends BatteryConsumer implements Parcela
*/
public static final class Builder {
private final PowerComponents.Builder mPowerComponentsBuilder;
+ private final BatteryStats.Uid mBatteryStatsUid;
private final int mUid;
private String mPackageWithHighestDrain;
- public Builder(int customPowerComponentCount, int uid) {
- mPowerComponentsBuilder = new PowerComponents.Builder(customPowerComponentCount);
- mUid = uid;
+ public Builder(int customPowerComponentCount, int customTimeComponentCount,
+ BatteryStats.Uid batteryStatsUid) {
+ mPowerComponentsBuilder = new PowerComponents.Builder(customPowerComponentCount,
+ customTimeComponentCount);
+ mBatteryStatsUid = batteryStatsUid;
+ mUid = batteryStatsUid.getUid();
+ }
+
+ public BatteryStats.Uid getBatteryStatsUid() {
+ return mBatteryStatsUid;
+ }
+
+ public int getUid() {
+ return mUid;
}
/**
@@ -102,7 +114,7 @@ public final class UidBatteryConsumer extends BatteryConsumer implements Parcela
* Sets the amount of drain attributed to the specified drain type, e.g. CPU, WiFi etc.
*
* @param componentId The ID of the power component, e.g.
- * {@link BatteryConsumer#POWER_COMPONENT_CPU}.
+ * {@link BatteryConsumer#POWER_COMPONENT_CPU}.
* @param componentPower Amount of consumed power in mAh.
*/
@NonNull
@@ -133,6 +145,35 @@ public final class UidBatteryConsumer extends BatteryConsumer implements Parcela
}
/**
+ * Sets the amount of time used by the specified component, e.g. CPU, WiFi etc.
+ *
+ * @param componentId The ID of the time component, e.g.
+ * {@link UidBatteryConsumer#TIME_COMPONENT_CPU}.
+ * @param componentUsageDurationMillis Amount of time in milliseconds.
+ */
+ @NonNull
+ public Builder setUsageDurationMillis(@UidBatteryConsumer.TimeComponent int componentId,
+ long componentUsageDurationMillis) {
+ mPowerComponentsBuilder.setUsageDurationMillis(componentId,
+ componentUsageDurationMillis);
+ return this;
+ }
+
+ /**
+ * Sets the amount of time used by the specified custom component.
+ *
+ * @param componentId The ID of the custom power component.
+ * @param componentUsageDurationMillis Amount of time in milliseconds.
+ */
+ @NonNull
+ public Builder setUsageDurationForCustomComponentMillis(int componentId,
+ long componentUsageDurationMillis) {
+ mPowerComponentsBuilder.setUsageDurationForCustomComponentMillis(componentId,
+ componentUsageDurationMillis);
+ return this;
+ }
+
+ /**
* Sets the name of the package owned by this UID that consumed the highest amount
* of power since BatteryStats reset.
*/
diff --git a/core/java/android/permission/ILegacyPermissionManager.aidl b/core/java/android/permission/ILegacyPermissionManager.aidl
new file mode 100644
index 000000000000..3bd4bf549df0
--- /dev/null
+++ b/core/java/android/permission/ILegacyPermissionManager.aidl
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.permission;
+
+import android.content.pm.ParceledListSlice;
+import android.content.pm.PermissionGroupInfo;
+import android.content.pm.PermissionInfo;
+import android.content.pm.permission.SplitPermissionInfoParcelable;
+import android.os.UserHandle;
+import android.permission.IOnPermissionsChangeListener;
+
+/**
+ * Interface to communicate directly with the legacy permission manager service.
+ *
+ * @see PermissionManager
+ * @hide
+ */
+interface ILegacyPermissionManager {
+ int checkDeviceIdentifierAccess(String packageName, String callingFeatureId, String message, int pid, int uid);
+
+ void grantDefaultPermissionsToEnabledCarrierApps(in String[] packageNames, int userId);
+
+ void grantDefaultPermissionsToEnabledImsServices(in String[] packageNames, int userId);
+
+ void grantDefaultPermissionsToEnabledTelephonyDataServices(
+ in String[] packageNames, int userId);
+
+ void revokeDefaultPermissionsFromDisabledTelephonyDataServices(
+ in String[] packageNames, int userId);
+
+ void grantDefaultPermissionsToActiveLuiApp(in String packageName, int userId);
+
+ void revokeDefaultPermissionsFromLuiApps(in String[] packageNames, int userId);
+}
diff --git a/core/java/android/permission/IPermissionManager.aidl b/core/java/android/permission/IPermissionManager.aidl
index a94077dd7ad6..4ad17ef58945 100644
--- a/core/java/android/permission/IPermissionManager.aidl
+++ b/core/java/android/permission/IPermissionManager.aidl
@@ -52,8 +52,6 @@ interface IPermissionManager {
int checkUidPermission(String permName, int uid);
- int checkDeviceIdentifierAccess(String packageName, String callingFeatureId, String message, int pid, int uid);
-
void addOnPermissionsChangeListener(in IOnPermissionsChangeListener listener);
void removeOnPermissionsChangeListener(in IOnPermissionsChangeListener listener);
@@ -73,20 +71,6 @@ interface IPermissionManager {
void resetRuntimePermissions();
- void grantDefaultPermissionsToEnabledCarrierApps(in String[] packageNames, int userId);
-
- void grantDefaultPermissionsToEnabledImsServices(in String[] packageNames, int userId);
-
- void grantDefaultPermissionsToEnabledTelephonyDataServices(
- in String[] packageNames, int userId);
-
- void revokeDefaultPermissionsFromDisabledTelephonyDataServices(
- in String[] packageNames, int userId);
-
- void grantDefaultPermissionsToActiveLuiApp(in String packageName, int userId);
-
- void revokeDefaultPermissionsFromLuiApps(in String[] packageNames, int userId);
-
boolean shouldShowRequestPermissionRationale(String permName,
String packageName, int userId);
diff --git a/core/java/android/permission/LegacyPermissionManager.java b/core/java/android/permission/LegacyPermissionManager.java
new file mode 100644
index 000000000000..b66dd82965d3
--- /dev/null
+++ b/core/java/android/permission/LegacyPermissionManager.java
@@ -0,0 +1,217 @@
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.permission;
+
+import android.Manifest;
+import android.annotation.CallbackExecutor;
+import android.annotation.NonNull;
+import android.annotation.Nullable;
+import android.annotation.RequiresPermission;
+import android.annotation.SystemService;
+import android.content.Context;
+import android.content.pm.PackageManager;
+import android.os.RemoteException;
+import android.os.ServiceManager;
+import android.os.UserHandle;
+
+import com.android.internal.annotations.VisibleForTesting;
+
+import java.util.concurrent.Executor;
+import java.util.function.Consumer;
+
+/**
+ * System level service for accessing the permission capabilities of the platform, version 2.
+ *
+ * @hide
+ */
+//@SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
+@SystemService(Context.LEGACY_PERMISSION_SERVICE)
+public final class LegacyPermissionManager {
+ private final ILegacyPermissionManager mLegacyPermissionManager;
+
+ /**
+ * Creates a new instance.
+ *
+ * @hide
+ */
+ public LegacyPermissionManager() throws ServiceManager.ServiceNotFoundException {
+ this(ILegacyPermissionManager.Stub.asInterface(ServiceManager.getServiceOrThrow(
+ "legacy_permission")));
+ }
+
+ /**
+ * Creates a new instance with the provided instantiation of the ILegacyPermissionManager.
+ *
+ * @param legacyPermissionManager injectable legacy permission manager service
+ *
+ * @hide
+ */
+ @VisibleForTesting
+ public LegacyPermissionManager(@NonNull ILegacyPermissionManager legacyPermissionManager) {
+ mLegacyPermissionManager = legacyPermissionManager;
+ }
+
+ /**
+ * Checks whether the package with the given pid/uid can read device identifiers.
+ *
+ * @param packageName the name of the package to be checked for identifier access
+ * @param message the message to be used for logging during identifier access
+ * verification
+ * @param callingFeatureId the feature in the package
+ * @param pid the process id of the package to be checked
+ * @param uid the uid of the package to be checked
+ * @return {@link PackageManager#PERMISSION_GRANTED} if the package is allowed identifier
+ * access, {@link PackageManager#PERMISSION_DENIED} otherwise
+ * @hide
+ */
+ //@SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
+ public int checkDeviceIdentifierAccess(@Nullable String packageName, @Nullable String message,
+ @Nullable String callingFeatureId, int pid, int uid) {
+ try {
+ return mLegacyPermissionManager.checkDeviceIdentifierAccess(packageName, message,
+ callingFeatureId, pid, uid);
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
+ }
+
+ /**
+ * Grant default permissions to currently active LUI app
+ * @param packageName The package name for the LUI app
+ * @param user The user handle
+ * @param executor The executor for the callback
+ * @param callback The callback provided by caller to be notified when grant completes
+ * @hide
+ */
+ @RequiresPermission(Manifest.permission.GRANT_RUNTIME_PERMISSIONS_TO_TELEPHONY_DEFAULTS)
+ public void grantDefaultPermissionsToLuiApp(
+ @NonNull String packageName, @NonNull UserHandle user,
+ @NonNull @CallbackExecutor Executor executor, @NonNull Consumer<Boolean> callback) {
+ try {
+ mLegacyPermissionManager.grantDefaultPermissionsToActiveLuiApp(
+ packageName, user.getIdentifier());
+ executor.execute(() -> callback.accept(true));
+ } catch (RemoteException e) {
+ e.rethrowFromSystemServer();
+ }
+ }
+
+ /**
+ * Revoke default permissions to currently active LUI app
+ * @param packageNames The package names for the LUI apps
+ * @param user The user handle
+ * @param executor The executor for the callback
+ * @param callback The callback provided by caller to be notified when grant completes
+ * @hide
+ */
+ @RequiresPermission(Manifest.permission.GRANT_RUNTIME_PERMISSIONS_TO_TELEPHONY_DEFAULTS)
+ public void revokeDefaultPermissionsFromLuiApps(
+ @NonNull String[] packageNames, @NonNull UserHandle user,
+ @NonNull @CallbackExecutor Executor executor, @NonNull Consumer<Boolean> callback) {
+ try {
+ mLegacyPermissionManager.revokeDefaultPermissionsFromLuiApps(
+ packageNames, user.getIdentifier());
+ executor.execute(() -> callback.accept(true));
+ } catch (RemoteException e) {
+ e.rethrowFromSystemServer();
+ }
+ }
+
+ /**
+ * Grant default permissions to currently active Ims services
+ * @param packageNames The package names for the Ims services
+ * @param user The user handle
+ * @param executor The executor for the callback
+ * @param callback The callback provided by caller to be notified when grant completes
+ * @hide
+ */
+ @RequiresPermission(Manifest.permission.GRANT_RUNTIME_PERMISSIONS_TO_TELEPHONY_DEFAULTS)
+ public void grantDefaultPermissionsToEnabledImsServices(
+ @NonNull String[] packageNames, @NonNull UserHandle user,
+ @NonNull @CallbackExecutor Executor executor, @NonNull Consumer<Boolean> callback) {
+ try {
+ mLegacyPermissionManager.grantDefaultPermissionsToEnabledImsServices(
+ packageNames, user.getIdentifier());
+ executor.execute(() -> callback.accept(true));
+ } catch (RemoteException e) {
+ e.rethrowFromSystemServer();
+ }
+ }
+
+ /**
+ * Grant default permissions to currently enabled telephony data services
+ * @param packageNames The package name for the services
+ * @param user The user handle
+ * @param executor The executor for the callback
+ * @param callback The callback provided by caller to be notified when grant completes
+ * @hide
+ */
+ @RequiresPermission(Manifest.permission.GRANT_RUNTIME_PERMISSIONS_TO_TELEPHONY_DEFAULTS)
+ public void grantDefaultPermissionsToEnabledTelephonyDataServices(
+ @NonNull String[] packageNames, @NonNull UserHandle user,
+ @NonNull @CallbackExecutor Executor executor, @NonNull Consumer<Boolean> callback) {
+ try {
+ mLegacyPermissionManager.grantDefaultPermissionsToEnabledTelephonyDataServices(
+ packageNames, user.getIdentifier());
+ executor.execute(() -> callback.accept(true));
+ } catch (RemoteException e) {
+ e.rethrowFromSystemServer();
+ }
+ }
+
+ /**
+ * Revoke default permissions to currently active telephony data services
+ * @param packageNames The package name for the services
+ * @param user The user handle
+ * @param executor The executor for the callback
+ * @param callback The callback provided by caller to be notified when revoke completes
+ * @hide
+ */
+ @RequiresPermission(Manifest.permission.GRANT_RUNTIME_PERMISSIONS_TO_TELEPHONY_DEFAULTS)
+ public void revokeDefaultPermissionsFromDisabledTelephonyDataServices(
+ @NonNull String[] packageNames, @NonNull UserHandle user,
+ @NonNull @CallbackExecutor Executor executor, @NonNull Consumer<Boolean> callback) {
+ try {
+ mLegacyPermissionManager.revokeDefaultPermissionsFromDisabledTelephonyDataServices(
+ packageNames, user.getIdentifier());
+ executor.execute(() -> callback.accept(true));
+ } catch (RemoteException e) {
+ e.rethrowFromSystemServer();
+ }
+ }
+
+ /**
+ * Grant default permissions to currently enabled carrier apps
+ * @param packageNames Package names of the apps to be granted permissions
+ * @param user The user handle
+ * @param executor The executor for the callback
+ * @param callback The callback provided by caller to be notified when grant completes
+ * @hide
+ */
+ @RequiresPermission(Manifest.permission.GRANT_RUNTIME_PERMISSIONS_TO_TELEPHONY_DEFAULTS)
+ public void grantDefaultPermissionsToEnabledCarrierApps(@NonNull String[] packageNames,
+ @NonNull UserHandle user, @NonNull @CallbackExecutor Executor executor,
+ @NonNull Consumer<Boolean> callback) {
+ try {
+ mLegacyPermissionManager.grantDefaultPermissionsToEnabledCarrierApps(packageNames,
+ user.getIdentifier());
+ executor.execute(() -> callback.accept(true));
+ } catch (RemoteException e) {
+ e.rethrowFromSystemServer();
+ }
+ }
+}
diff --git a/core/java/android/permission/PermissionManager.java b/core/java/android/permission/PermissionManager.java
index e4220dd00a5b..d31e0129fb27 100644
--- a/core/java/android/permission/PermissionManager.java
+++ b/core/java/android/permission/PermissionManager.java
@@ -19,7 +19,7 @@ package android.permission;
import static android.os.Build.VERSION_CODES.S;
import android.Manifest;
-import android.annotation.CallbackExecutor;
+import android.annotation.CheckResult;
import android.annotation.IntRange;
import android.annotation.NonNull;
import android.annotation.Nullable;
@@ -29,6 +29,7 @@ import android.annotation.SystemService;
import android.annotation.UserIdInt;
import android.app.ActivityManager;
import android.app.ActivityThread;
+import android.app.AppGlobals;
import android.app.IActivityManager;
import android.app.PropertyInvalidatedCache;
import android.compat.annotation.ChangeId;
@@ -36,15 +37,25 @@ import android.compat.annotation.EnabledAfter;
import android.content.Context;
import android.content.pm.IPackageManager;
import android.content.pm.PackageManager;
+import android.content.pm.ParceledListSlice;
+import android.content.pm.PermissionGroupInfo;
+import android.content.pm.PermissionInfo;
import android.content.pm.permission.SplitPermissionInfoParcelable;
+import android.os.Build;
+import android.os.Handler;
+import android.os.Looper;
+import android.os.Message;
import android.os.Process;
import android.os.RemoteException;
import android.os.ServiceManager;
import android.os.UserHandle;
+import android.util.ArrayMap;
+import android.util.ArraySet;
+import android.util.DebugUtils;
+import android.util.Log;
import android.util.Slog;
import com.android.internal.annotations.Immutable;
-import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.util.CollectionUtils;
import java.util.ArrayList;
@@ -52,8 +63,6 @@ import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Set;
-import java.util.concurrent.Executor;
-import java.util.function.Consumer;
/**
* System level service for accessing the permission capabilities of the platform.
@@ -63,7 +72,7 @@ import java.util.function.Consumer;
@SystemApi
@SystemService(Context.PERMISSION_SERVICE)
public final class PermissionManager {
- private static final String TAG = PermissionManager.class.getName();
+ private static final String LOG_TAG = PermissionManager.class.getName();
/** @hide */
public static final String KILL_APP_REASON_PERMISSIONS_REVOKED =
@@ -83,244 +92,765 @@ public final class PermissionManager {
@EnabledAfter(targetSdkVersion = S)
public static final long CANNOT_INSTALL_WITH_BAD_PERMISSION_GROUPS = 146211400;
+ /**
+ * Note: Changing this won't do anything on its own - you should also change the filtering in
+ * {@link #shouldTraceGrant}.
+ *
+ * @hide
+ */
+ public static final boolean DEBUG_TRACE_GRANTS = false;
+ /**
+ * @hide
+ */
+ public static final boolean DEBUG_TRACE_PERMISSION_UPDATES = false;
+
private final @NonNull Context mContext;
private final IPackageManager mPackageManager;
private final IPermissionManager mPermissionManager;
+ private final LegacyPermissionManager mLegacyPermissionManager;
+
+ private final ArrayMap<PackageManager.OnPermissionsChangedListener,
+ IOnPermissionsChangeListener> mPermissionListeners = new ArrayMap<>();
+
private List<SplitPermissionInfo> mSplitPermissionInfos;
/**
* Creates a new instance.
*
- * @param context The current context in which to operate.
+ * @param context The current context in which to operate
+ *
* @hide
*/
- public PermissionManager(@NonNull Context context, IPackageManager packageManager)
+ public PermissionManager(@NonNull Context context)
throws ServiceManager.ServiceNotFoundException {
- this(context, packageManager, IPermissionManager.Stub.asInterface(
- ServiceManager.getServiceOrThrow("permissionmgr")));
+ mContext = context;
+ mPackageManager = AppGlobals.getPackageManager();
+ mPermissionManager = IPermissionManager.Stub.asInterface(ServiceManager.getServiceOrThrow(
+ "permissionmgr"));
+ mLegacyPermissionManager = context.getSystemService(LegacyPermissionManager.class);
+ }
+
+ /**
+ * Retrieve all of the information we know about a particular permission.
+ *
+ * @param permissionName the fully qualified name (e.g. com.android.permission.LOGIN) of the
+ * permission you are interested in
+ * @param flags additional option flags to modify the data returned
+ * @return a {@link PermissionInfo} containing information about the permission, or {@code null}
+ * if not found
+ *
+ * @hide Pending API
+ */
+ @Nullable
+ public PermissionInfo getPermissionInfo(@NonNull String permissionName,
+ @PackageManager.PermissionInfoFlags int flags) {
+ try {
+ final String packageName = mContext.getOpPackageName();
+ return mPermissionManager.getPermissionInfo(permissionName, packageName, flags);
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
+ }
+
+ /**
+ * Query for all of the permissions associated with a particular group.
+ *
+ * @param groupName the fully qualified name (e.g. com.android.permission.LOGIN) of the
+ * permission group you are interested in. Use {@code null} to find all of the
+ * permissions not associated with a group
+ * @param flags additional option flags to modify the data returned
+ * @return a list of {@link PermissionInfo} containing information about all of the permissions
+ * in the given group, or {@code null} if the group is not found
+ *
+ * @hide Pending API
+ */
+ @Nullable
+ public List<PermissionInfo> queryPermissionsByGroup(@NonNull String groupName,
+ @PackageManager.PermissionInfoFlags int flags) {
+ try {
+ final ParceledListSlice<PermissionInfo> parceledList =
+ mPermissionManager.queryPermissionsByGroup(groupName, flags);
+ if (parceledList == null) {
+ return null;
+ }
+ return parceledList.getList();
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
+ }
+
+ /**
+ * Add a new dynamic permission to the system. For this to work, your package must have defined
+ * a permission tree through the
+ * {@link android.R.styleable#AndroidManifestPermissionTree &lt;permission-tree&gt;} tag in its
+ * manifest. A package can only add permissions to trees that were defined by either its own
+ * package or another with the same user id; a permission is in a tree if it matches the name of
+ * the permission tree + ".": for example, "com.foo.bar" is a member of the permission tree
+ * "com.foo".
+ * <p>
+ * It is good to make your permission tree name descriptive, because you are taking possession
+ * of that entire set of permission names. Thus, it must be under a domain you control, with a
+ * suffix that will not match any normal permissions that may be declared in any applications
+ * that are part of that domain.
+ * <p>
+ * New permissions must be added before any .apks are installed that use those permissions.
+ * Permissions you add through this method are remembered across reboots of the device. If the
+ * given permission already exists, the info you supply here will be used to update it.
+ *
+ * @param permissionInfo description of the permission to be added
+ * @param async whether the persistence of the permission should be asynchronous, allowing it to
+ * return quicker and batch a series of adds, at the expense of no guarantee the
+ * added permission will be retained if the device is rebooted before it is
+ * written.
+ * @return {@code true} if a new permission was created, {@code false} if an existing one was
+ * updated
+ * @throws SecurityException if you are not allowed to add the given permission name
+ *
+ * @see #removePermission(String)
+ *
+ * @hide Pending API
+ */
+ public boolean addPermission(@NonNull PermissionInfo permissionInfo, boolean async) {
+ try {
+ return mPermissionManager.addPermission(permissionInfo, async);
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
+ }
+
+ /**
+ * Removes a permission that was previously added with
+ * {@link #addPermission(PermissionInfo, boolean)}. The same ownership rules apply -- you are
+ * only allowed to remove permissions that you are allowed to add.
+ *
+ * @param permissionName the name of the permission to remove
+ * @throws SecurityException if you are not allowed to remove the given permission name
+ *
+ * @see #addPermission(PermissionInfo, boolean)
+ *
+ * @hide Pending API
+ */
+ public void removePermission(@NonNull String permissionName) {
+ try {
+ mPermissionManager.removePermission(permissionName);
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
+ }
+
+ /**
+ * Retrieve all of the information we know about a particular group of permissions.
+ *
+ * @param groupName the fully qualified name (e.g. com.android.permission_group.APPS) of the
+ * permission you are interested in
+ * @param flags additional option flags to modify the data returned
+ * @return a {@link PermissionGroupInfo} containing information about the permission, or
+ * {@code null} if not found
+ *
+ * @hide Pending API
+ */
+ @Nullable
+ public PermissionGroupInfo getPermissionGroupInfo(@NonNull String groupName,
+ @PackageManager.PermissionGroupInfoFlags int flags) {
+ try {
+ return mPermissionManager.getPermissionGroupInfo(groupName, flags);
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
+ }
+
+ /**
+ * Retrieve all of the known permission groups in the system.
+ *
+ * @param flags additional option flags to modify the data returned
+ * @return a list of {@link PermissionGroupInfo} containing information about all of the known
+ * permission groups
+ *
+ * @hide Pending API
+ */
+ @NonNull
+ public List<PermissionGroupInfo> getAllPermissionGroups(
+ @PackageManager.PermissionGroupInfoFlags int flags) {
+ try {
+ final ParceledListSlice<PermissionGroupInfo> parceledList =
+ mPermissionManager.getAllPermissionGroups(flags);
+ if (parceledList == null) {
+ return Collections.emptyList();
+ }
+ return parceledList.getList();
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
+ }
+
+ /**
+ * Checks whether a particular permissions has been revoked for a package by policy. Typically
+ * the device owner or the profile owner may apply such a policy. The user cannot grant policy
+ * revoked permissions, hence the only way for an app to get such a permission is by a policy
+ * change.
+ *
+ * @param packageName the name of the package you are checking against
+ * @param permissionName the name of the permission you are checking for
+ *
+ * @return whether the permission is restricted by policy
+ *
+ * @hide Pending API
+ */
+ @CheckResult
+ public boolean isPermissionRevokedByPolicy(@NonNull String packageName,
+ @NonNull String permissionName) {
+ try {
+ return mPermissionManager.isPermissionRevokedByPolicy(permissionName, packageName,
+ mContext.getUserId());
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
+ }
+
+ /** @hide */
+ public static boolean shouldTraceGrant(String packageName, String permissionName, int userId) {
+ // To be modified when debugging
+ return false;
}
/**
- * Creates a new instance with the provided instantiation of the IPermissionManager.
+ * Grant a runtime permission to an application which the application does not already have. The
+ * permission must have been requested by the application. If the application is not allowed to
+ * hold the permission, a {@link java.lang.SecurityException} is thrown. If the package or
+ * permission is invalid, a {@link java.lang.IllegalArgumentException} is thrown.
+ * <p>
+ * <strong>Note: </strong>Using this API requires holding
+ * {@code android.permission.GRANT_RUNTIME_PERMISSIONS} and if the user ID is not the current
+ * user {@code android.permission.INTERACT_ACROSS_USERS_FULL}.
+ *
+ * @param packageName the package to which to grant the permission
+ * @param permissionName the permission name to grant
+ * @param user the user for which to grant the permission
+ *
+ * @see #revokeRuntimePermission(String, String, android.os.UserHandle)
*
- * @param context the current context in which to operate
- * @param packageManager package manager service to be used for package related permission
- * requests
- * @param permissionManager injectable permission manager service
* @hide
*/
- @VisibleForTesting
- public PermissionManager(@NonNull Context context, IPackageManager packageManager,
- IPermissionManager permissionManager) {
- mContext = context;
- mPackageManager = packageManager;
- mPermissionManager = permissionManager;
+ @RequiresPermission(android.Manifest.permission.GRANT_RUNTIME_PERMISSIONS)
+ //@SystemApi
+ public void grantRuntimePermission(@NonNull String packageName,
+ @NonNull String permissionName, @NonNull UserHandle user) {
+ if (DEBUG_TRACE_GRANTS
+ && shouldTraceGrant(packageName, permissionName, user.getIdentifier())) {
+ Log.i(LOG_TAG, "App " + mContext.getPackageName() + " is granting " + packageName + " "
+ + permissionName + " for user " + user.getIdentifier(), new RuntimeException());
+ }
+ try {
+ mPermissionManager.grantRuntimePermission(packageName, permissionName,
+ user.getIdentifier());
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
}
/**
- * Gets the version of the runtime permission database.
+ * Revoke a runtime permission that was previously granted by
+ * {@link #grantRuntimePermission(String, String, android.os.UserHandle)}. The permission must
+ * have been requested by and granted to the application. If the application is not allowed to
+ * hold the permission, a {@link java.lang.SecurityException} is thrown. If the package or
+ * permission is invalid, a {@link java.lang.IllegalArgumentException} is thrown.
+ * <p>
+ * <strong>Note: </strong>Using this API requires holding
+ * {@code android.permission.REVOKE_RUNTIME_PERMISSIONS} and if the user ID is not the current
+ * user {@code android.permission.INTERACT_ACROSS_USERS_FULL}.
*
- * @return The database version, -1 when this is an upgrade from pre-Q, 0 when this is a fresh
- * install.
+ * @param packageName the package from which to revoke the permission
+ * @param permName the permission name to revoke
+ * @param user the user for which to revoke the permission
+ * @param reason the reason for the revoke, or {@code null} for unspecified
+ *
+ * @see #grantRuntimePermission(String, String, android.os.UserHandle)
*
* @hide
*/
- @SystemApi
+ @RequiresPermission(android.Manifest.permission.REVOKE_RUNTIME_PERMISSIONS)
+ //@SystemApi
+ public void revokeRuntimePermission(@NonNull String packageName,
+ @NonNull String permName, @NonNull UserHandle user, @Nullable String reason) {
+ if (DEBUG_TRACE_PERMISSION_UPDATES
+ && shouldTraceGrant(packageName, permName, user.getIdentifier())) {
+ Log.i(LOG_TAG, "App " + mContext.getPackageName() + " is revoking " + packageName + " "
+ + permName + " for user " + user.getIdentifier() + " with reason "
+ + reason, new RuntimeException());
+ }
+ try {
+ mPermissionManager
+ .revokeRuntimePermission(packageName, permName, user.getIdentifier(), reason);
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
+ }
+
+ /**
+ * Gets the state flags associated with a permission.
+ *
+ * @param packageName the package name for which to get the flags
+ * @param permissionName the permission for which to get the flags
+ * @param user the user for which to get permission flags
+ * @return the permission flags
+ *
+ * @hide
+ */
+ @PackageManager.PermissionFlags
@RequiresPermission(anyOf = {
- Manifest.permission.ADJUST_RUNTIME_PERMISSIONS_POLICY,
- Manifest.permission.UPGRADE_RUNTIME_PERMISSIONS
+ android.Manifest.permission.GRANT_RUNTIME_PERMISSIONS,
+ android.Manifest.permission.REVOKE_RUNTIME_PERMISSIONS,
+ android.Manifest.permission.GET_RUNTIME_PERMISSIONS
})
- public @IntRange(from = 0) int getRuntimePermissionsVersion() {
+ //@SystemApi
+ public int getPermissionFlags(@NonNull String packageName, @NonNull String permissionName,
+ @NonNull UserHandle user) {
try {
- return mPackageManager.getRuntimePermissionsVersion(mContext.getUserId());
+ return mPermissionManager.getPermissionFlags(permissionName, packageName,
+ user.getIdentifier());
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
}
/**
- * Sets the version of the runtime permission database.
+ * Updates the flags associated with a permission by replacing the flags in the specified mask
+ * with the provided flag values.
*
- * @param version The new version.
+ * @param packageName The package name for which to update the flags
+ * @param permissionName The permission for which to update the flags
+ * @param flagMask The flags which to replace
+ * @param flagValues The flags with which to replace
+ * @param user The user for which to update the permission flags
*
* @hide
*/
- @SystemApi
@RequiresPermission(anyOf = {
- Manifest.permission.ADJUST_RUNTIME_PERMISSIONS_POLICY,
- Manifest.permission.UPGRADE_RUNTIME_PERMISSIONS
+ android.Manifest.permission.GRANT_RUNTIME_PERMISSIONS,
+ android.Manifest.permission.REVOKE_RUNTIME_PERMISSIONS
})
- public void setRuntimePermissionsVersion(@IntRange(from = 0) int version) {
+ //@SystemApi
+ public void updatePermissionFlags(@NonNull String packageName, @NonNull String permissionName,
+ @PackageManager.PermissionFlags int flagMask,
+ @PackageManager.PermissionFlags int flagValues, @NonNull UserHandle user) {
+ if (DEBUG_TRACE_PERMISSION_UPDATES && shouldTraceGrant(packageName, permissionName,
+ user.getIdentifier())) {
+ Log.i(LOG_TAG, "App " + mContext.getPackageName() + " is updating flags for "
+ + packageName + " " + permissionName + " for user "
+ + user.getIdentifier() + ": " + DebugUtils.flagsToString(
+ PackageManager.class, "FLAG_PERMISSION_", flagMask) + " := "
+ + DebugUtils.flagsToString(PackageManager.class, "FLAG_PERMISSION_",
+ flagValues), new RuntimeException());
+ }
try {
- mPackageManager.setRuntimePermissionsVersion(version, mContext.getUserId());
+ final boolean checkAdjustPolicyFlagPermission =
+ mContext.getApplicationInfo().targetSdkVersion >= Build.VERSION_CODES.Q;
+ mPermissionManager.updatePermissionFlags(permissionName, packageName, flagMask,
+ flagValues, checkAdjustPolicyFlagPermission, user.getIdentifier());
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
}
/**
- * Get set of permissions that have been split into more granular or dependent permissions.
+ * Gets the restricted permissions that have been allowlisted and the app is allowed to have
+ * them granted in their full form.
+ * <p>
+ * Permissions can be hard restricted which means that the app cannot hold them or soft
+ * restricted where the app can hold the permission but in a weaker form. Whether a permission
+ * is {@link PermissionInfo#FLAG_HARD_RESTRICTED hard restricted} or
+ * {@link PermissionInfo#FLAG_SOFT_RESTRICTED soft restricted} depends on the permission
+ * declaration. Allowlisting a hard restricted permission allows for the to hold that permission
+ * and allowlisting a soft restricted permission allows the app to hold the permission in its
+ * full, unrestricted form.
+ * <p>
+ * There are four allowlists:
+ * <ol>
+ * <li>
+ * One for cases where the system permission policy allowlists a permission. This list
+ * corresponds to the {@link PackageManager#FLAG_PERMISSION_WHITELIST_SYSTEM} flag. Can only be
+ * accessed by pre-installed holders of a dedicated permission.
+ * <li>
+ * One for cases where the system allowlists the permission when upgrading from an OS version in
+ * which the permission was not restricted to an OS version in which the permission is
+ * restricted. This list corresponds to the
+ * {@link PackageManager#FLAG_PERMISSION_WHITELIST_UPGRADE} flag. Can be accessed by
+ * pre-installed holders of a dedicated permission or the installer on record.
+ * <li>
+ * One for cases where the installer of the package allowlists a permission. This list
+ * corresponds to the {@link PackageManager#FLAG_PERMISSION_WHITELIST_INSTALLER} flag. Can be
+ * accessed by pre-installed holders of a dedicated permission or the installer on record.
+ * <li>
+ * One for cases where the system exempts the permission when granting a role. This list
+ * corresponds to the {@link PackageManager#FLAG_PERMISSION_ALLOWLIST_ROLE} flag. Can be
+ * accessed by pre-installed holders of a dedicated permission.
+ * </ol>
*
- * <p>E.g. before {@link android.os.Build.VERSION_CODES#Q} an app that was granted
- * {@link Manifest.permission#ACCESS_COARSE_LOCATION} could access the location while it was in
- * foreground and background. On platforms after {@link android.os.Build.VERSION_CODES#Q}
- * the location permission only grants location access while the app is in foreground. This
- * would break apps that target before {@link android.os.Build.VERSION_CODES#Q}. Hence whenever
- * such an old app asks for a location permission (i.e. the
- * {@link SplitPermissionInfo#getSplitPermission()}), then the
- * {@link Manifest.permission#ACCESS_BACKGROUND_LOCATION} permission (inside
- * {@link SplitPermissionInfo#getNewPermissions}) is added.
+ * @param packageName the app for which to get allowlisted permissions
+ * @param allowlistFlag the flag to determine which allowlist to query. Only one flag can be
+ * passed.
+ * @return the allowlisted permissions that are on any of the allowlists you query for
+ * @throws SecurityException if you try to access a allowlist that you have no access to
*
- * <p>Note: Regular apps do not have to worry about this. The platform and permission controller
- * automatically add the new permissions where needed.
+ * @see #addAllowlistedRestrictedPermission(String, String, int)
+ * @see #removeAllowlistedRestrictedPermission(String, String, int)
+ * @see PackageManager#FLAG_PERMISSION_WHITELIST_SYSTEM
+ * @see PackageManager#FLAG_PERMISSION_WHITELIST_UPGRADE
+ * @see PackageManager#FLAG_PERMISSION_WHITELIST_INSTALLER
+ * @see PackageManager#FLAG_PERMISSION_ALLOWLIST_ROLE
*
- * @return All permissions that are split.
+ * @hide Pending API
*/
- public @NonNull List<SplitPermissionInfo> getSplitPermissions() {
- if (mSplitPermissionInfos != null) {
- return mSplitPermissionInfos;
+ @NonNull
+ @RequiresPermission(value = Manifest.permission.WHITELIST_RESTRICTED_PERMISSIONS,
+ conditional = true)
+ public Set<String> getAllowlistedRestrictedPermissions(@NonNull String packageName,
+ @PackageManager.PermissionWhitelistFlags int allowlistFlag) {
+ try {
+ final List<String> allowlist = mPermissionManager.getWhitelistedRestrictedPermissions(
+ packageName, allowlistFlag, mContext.getUserId());
+ if (allowlist == null) {
+ return Collections.emptySet();
+ }
+ return new ArraySet<>(allowlist);
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
}
+ }
- List<SplitPermissionInfoParcelable> parcelableList;
+ /**
+ * Adds a allowlisted restricted permission for an app.
+ * <p>
+ * Permissions can be hard restricted which means that the app cannot hold them or soft
+ * restricted where the app can hold the permission but in a weaker form. Whether a permission
+ * is {@link PermissionInfo#FLAG_HARD_RESTRICTED hard restricted} or
+ * {@link PermissionInfo#FLAG_SOFT_RESTRICTED soft restricted} depends on the permission
+ * declaration. Allowlisting a hard restricted permission allows for the to hold that permission
+ * and allowlisting a soft restricted permission allows the app to hold the permission in its
+ * full, unrestricted form.
+ * <p>There are four allowlists:
+ * <ol>
+ * <li>
+ * One for cases where the system permission policy allowlists a permission. This list
+ * corresponds to the {@link PackageManager#FLAG_PERMISSION_WHITELIST_SYSTEM} flag. Can only be
+ * accessed by pre-installed holders of a dedicated permission.
+ * <li>
+ * One for cases where the system allowlists the permission when upgrading from an OS version in
+ * which the permission was not restricted to an OS version in which the permission is
+ * restricted. This list corresponds to the
+ * {@link PackageManager#FLAG_PERMISSION_WHITELIST_UPGRADE} flag. Can be accessed by
+ * pre-installed holders of a dedicated permission or the installer on record.
+ * <li>
+ * One for cases where the installer of the package allowlists a permission. This list
+ * corresponds to the {@link PackageManager#FLAG_PERMISSION_WHITELIST_INSTALLER} flag. Can be
+ * accessed by pre-installed holders of a dedicated permission or the installer on record.
+ * <li>
+ * One for cases where the system exempts the permission when granting a role. This list
+ * corresponds to the {@link PackageManager#FLAG_PERMISSION_ALLOWLIST_ROLE} flag. Can be
+ * accessed by pre-installed holders of a dedicated permission.
+ * </ol>
+ * <p>
+ * You need to specify the allowlists for which to set the allowlisted permissions which will
+ * clear the previous allowlisted permissions and replace them with the provided ones.
+ *
+ * @param packageName the app for which to get allowlisted permissions
+ * @param permissionName the allowlisted permission to add
+ * @param allowlistFlags the allowlists to which to add. Passing multiple flags updates all
+ * specified allowlists.
+ * @return whether the permission was added to the allowlist
+ * @throws SecurityException if you try to modify a allowlist that you have no access to.
+ *
+ * @see #getAllowlistedRestrictedPermissions(String, int)
+ * @see #removeAllowlistedRestrictedPermission(String, String, int)
+ * @see PackageManager#FLAG_PERMISSION_WHITELIST_SYSTEM
+ * @see PackageManager#FLAG_PERMISSION_WHITELIST_UPGRADE
+ * @see PackageManager#FLAG_PERMISSION_WHITELIST_INSTALLER
+ * @see PackageManager#FLAG_PERMISSION_ALLOWLIST_ROLE
+ *
+ * @hide Pending API
+ */
+ @RequiresPermission(value = Manifest.permission.WHITELIST_RESTRICTED_PERMISSIONS,
+ conditional = true)
+ public boolean addAllowlistedRestrictedPermission(@NonNull String packageName,
+ @NonNull String permissionName,
+ @PackageManager.PermissionWhitelistFlags int allowlistFlags) {
try {
- parcelableList = ActivityThread.getPermissionManager().getSplitPermissions();
+ return mPermissionManager.addWhitelistedRestrictedPermission(packageName,
+ permissionName, allowlistFlags, mContext.getUserId());
} catch (RemoteException e) {
- Slog.e(TAG, "Error getting split permissions", e);
- return Collections.emptyList();
+ throw e.rethrowFromSystemServer();
}
+ }
- mSplitPermissionInfos = splitPermissionInfoListToNonParcelableList(parcelableList);
-
- return mSplitPermissionInfos;
+ /**
+ * Removes a allowlisted restricted permission for an app.
+ * <p>
+ * Permissions can be hard restricted which means that the app cannot hold them or soft
+ * restricted where the app can hold the permission but in a weaker form. Whether a permission
+ * is {@link PermissionInfo#FLAG_HARD_RESTRICTED hard restricted} or
+ * {@link PermissionInfo#FLAG_SOFT_RESTRICTED soft restricted} depends on the permission
+ * declaration. Allowlisting a hard restricted permission allows for the to hold that permission
+ * and allowlisting a soft restricted permission allows the app to hold the permission in its
+ * full, unrestricted form.
+ * <p>There are four allowlists:
+ * <ol>
+ * <li>
+ * One for cases where the system permission policy allowlists a permission. This list
+ * corresponds to the {@link PackageManager#FLAG_PERMISSION_WHITELIST_SYSTEM} flag. Can only be
+ * accessed by pre-installed holders of a dedicated permission.
+ * <li>
+ * One for cases where the system allowlists the permission when upgrading from an OS version in
+ * which the permission was not restricted to an OS version in which the permission is
+ * restricted. This list corresponds to the
+ * {@link PackageManager#FLAG_PERMISSION_WHITELIST_UPGRADE} flag. Can be accessed by
+ * pre-installed holders of a dedicated permission or the installer on record.
+ * <li>
+ * One for cases where the installer of the package allowlists a permission. This list
+ * corresponds to the {@link PackageManager#FLAG_PERMISSION_WHITELIST_INSTALLER} flag. Can be
+ * accessed by pre-installed holders of a dedicated permission or the installer on record.
+ * <li>
+ * One for cases where the system exempts the permission when granting a role. This list
+ * corresponds to the {@link PackageManager#FLAG_PERMISSION_ALLOWLIST_ROLE} flag. Can be
+ * accessed by pre-installed holders of a dedicated permission.
+ * </ol>
+ * <p>
+ * You need to specify the allowlists for which to set the allowlisted permissions which will
+ * clear the previous allowlisted permissions and replace them with the provided ones.
+ *
+ * @param packageName the app for which to get allowlisted permissions
+ * @param permissionName the allowlisted permission to remove
+ * @param allowlistFlags the allowlists from which to remove. Passing multiple flags updates all
+ * specified allowlists.
+ * @return whether the permission was removed from the allowlist
+ * @throws SecurityException if you try to modify a allowlist that you have no access to.
+ *
+ * @see #getAllowlistedRestrictedPermissions(String, int)
+ * @see #addAllowlistedRestrictedPermission(String, String, int)
+ * @see PackageManager#FLAG_PERMISSION_WHITELIST_SYSTEM
+ * @see PackageManager#FLAG_PERMISSION_WHITELIST_UPGRADE
+ * @see PackageManager#FLAG_PERMISSION_WHITELIST_INSTALLER
+ * @see PackageManager#FLAG_PERMISSION_ALLOWLIST_ROLE
+ *
+ * @hide Pending API
+ */
+ @RequiresPermission(value = Manifest.permission.WHITELIST_RESTRICTED_PERMISSIONS,
+ conditional = true)
+ public boolean removeAllowlistedRestrictedPermission(@NonNull String packageName,
+ @NonNull String permissionName,
+ @PackageManager.PermissionWhitelistFlags int allowlistFlags) {
+ try {
+ return mPermissionManager.removeWhitelistedRestrictedPermission(packageName,
+ permissionName, allowlistFlags, mContext.getUserId());
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
}
/**
- * Grant default permissions to currently active LUI app
- * @param packageName The package name for the LUI app
- * @param user The user handle
- * @param executor The executor for the callback
- * @param callback The callback provided by caller to be notified when grant completes
- * @hide
+ * Checks whether an application is exempted from having its permissions be automatically
+ * revoked when the app is unused for an extended period of time.
+ * <p>
+ * Only the installer on record that installed the given package, or a holder of
+ * {@code WHITELIST_AUTO_REVOKE_PERMISSIONS} is allowed to call this.
+ *
+ * @param packageName the app for which to set exemption
+ * @return whether the app is exempted
+ * @throws SecurityException if you you have no access to this
+ *
+ * @see #setAutoRevokeExempted
+ *
+ * @hide Pending API
*/
- @RequiresPermission(Manifest.permission.GRANT_RUNTIME_PERMISSIONS_TO_TELEPHONY_DEFAULTS)
- public void grantDefaultPermissionsToLuiApp(
- @NonNull String packageName, @NonNull UserHandle user,
- @NonNull @CallbackExecutor Executor executor, @NonNull Consumer<Boolean> callback) {
+ @RequiresPermission(value = Manifest.permission.WHITELIST_AUTO_REVOKE_PERMISSIONS,
+ conditional = true)
+ public boolean isAutoRevokeExempted(@NonNull String packageName) {
try {
- mPermissionManager.grantDefaultPermissionsToActiveLuiApp(
- packageName, user.getIdentifier());
- executor.execute(() -> callback.accept(true));
+ return mPermissionManager.isAutoRevokeWhitelisted(packageName, mContext.getUserId());
} catch (RemoteException e) {
- e.rethrowFromSystemServer();
+ throw e.rethrowFromSystemServer();
}
}
/**
- * Revoke default permissions to currently active LUI app
- * @param packageNames The package names for the LUI apps
- * @param user The user handle
- * @param executor The executor for the callback
- * @param callback The callback provided by caller to be notified when grant completes
- * @hide
+ * Marks an application exempted from having its permissions be automatically revoked when the
+ * app is unused for an extended period of time.
+ * <p>
+ * Only the installer on record that installed the given package is allowed to call this.
+ * <p>
+ * Packages start in exempted state, and it is the installer's responsibility to un-exempt the
+ * packages it installs, unless auto-revoking permissions from that package would cause
+ * breakages beyond having to re-request the permission(s).
+ *
+ * @param packageName the app for which to set exemption
+ * @param exempted whether the app should be exempted
+ * @return whether any change took effect
+ * @throws SecurityException if you you have no access to modify this
+ *
+ * @see #isAutoRevokeExempted
+ *
+ * @hide Pending API
*/
- @RequiresPermission(Manifest.permission.GRANT_RUNTIME_PERMISSIONS_TO_TELEPHONY_DEFAULTS)
- public void revokeDefaultPermissionsFromLuiApps(
- @NonNull String[] packageNames, @NonNull UserHandle user,
- @NonNull @CallbackExecutor Executor executor, @NonNull Consumer<Boolean> callback) {
+ @RequiresPermission(value = Manifest.permission.WHITELIST_AUTO_REVOKE_PERMISSIONS,
+ conditional = true)
+ public boolean setAutoRevokeExempted(@NonNull String packageName, boolean exempted) {
try {
- mPermissionManager.revokeDefaultPermissionsFromLuiApps(
- packageNames, user.getIdentifier());
- executor.execute(() -> callback.accept(true));
+ return mPermissionManager.setAutoRevokeWhitelisted(packageName, exempted,
+ mContext.getUserId());
} catch (RemoteException e) {
- e.rethrowFromSystemServer();
+ throw e.rethrowFromSystemServer();
}
}
/**
- * Grant default permissions to currently active Ims services
- * @param packageNames The package names for the Ims services
- * @param user The user handle
- * @param executor The executor for the callback
- * @param callback The callback provided by caller to be notified when grant completes
+ * Get whether you should show UI with rationale for requesting a permission. You should do this
+ * only if you do not have the permission and the context in which the permission is requested
+ * does not clearly communicate to the user what would be the benefit from grating this
+ * permission.
+ *
+ * @param permissionName a permission your app wants to request
+ * @return whether you can show permission rationale UI
+ *
* @hide
*/
- @RequiresPermission(Manifest.permission.GRANT_RUNTIME_PERMISSIONS_TO_TELEPHONY_DEFAULTS)
- public void grantDefaultPermissionsToEnabledImsServices(
- @NonNull String[] packageNames, @NonNull UserHandle user,
- @NonNull @CallbackExecutor Executor executor, @NonNull Consumer<Boolean> callback) {
+ //@SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
+ public boolean shouldShowRequestPermissionRationale(@NonNull String permissionName) {
try {
- mPermissionManager.grantDefaultPermissionsToEnabledImsServices(
- packageNames, user.getIdentifier());
- executor.execute(() -> callback.accept(true));
+ final String packageName = mContext.getPackageName();
+ return mPermissionManager.shouldShowRequestPermissionRationale(permissionName,
+ packageName, mContext.getUserId());
} catch (RemoteException e) {
- e.rethrowFromSystemServer();
+ throw e.rethrowFromSystemServer();
+ }
+ }
+
+ /**
+ * Add a listener for permission changes for installed packages.
+ *
+ * @param listener the listener to add
+ *
+ * @hide
+ */
+ //@SystemApi
+ @RequiresPermission(Manifest.permission.OBSERVE_GRANT_REVOKE_PERMISSIONS)
+ public void addOnPermissionsChangeListener(
+ @NonNull PackageManager.OnPermissionsChangedListener listener) {
+ synchronized (mPermissionListeners) {
+ if (mPermissionListeners.get(listener) != null) {
+ return;
+ }
+ final OnPermissionsChangeListenerDelegate delegate =
+ new OnPermissionsChangeListenerDelegate(listener, Looper.getMainLooper());
+ try {
+ mPermissionManager.addOnPermissionsChangeListener(delegate);
+ mPermissionListeners.put(listener, delegate);
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
+ }
+ }
+
+ /**
+ * Remove a listener for permission changes for installed packages.
+ *
+ * @param listener the listener to remove
+ *
+ * @hide
+ */
+ //@SystemApi
+ @RequiresPermission(Manifest.permission.OBSERVE_GRANT_REVOKE_PERMISSIONS)
+ public void removeOnPermissionsChangeListener(
+ @NonNull PackageManager.OnPermissionsChangedListener listener) {
+ synchronized (mPermissionListeners) {
+ final IOnPermissionsChangeListener delegate = mPermissionListeners.get(listener);
+ if (delegate != null) {
+ try {
+ mPermissionManager.removeOnPermissionsChangeListener(delegate);
+ mPermissionListeners.remove(listener);
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
+ }
}
}
/**
- * Grant default permissions to currently enabled telephony data services
- * @param packageNames The package name for the services
- * @param user The user handle
- * @param executor The executor for the callback
- * @param callback The callback provided by caller to be notified when grant completes
+ * Gets the version of the runtime permission database.
+ *
+ * @return The database version, -1 when this is an upgrade from pre-Q, 0 when this is a fresh
+ * install.
+ *
* @hide
*/
- @RequiresPermission(Manifest.permission.GRANT_RUNTIME_PERMISSIONS_TO_TELEPHONY_DEFAULTS)
- public void grantDefaultPermissionsToEnabledTelephonyDataServices(
- @NonNull String[] packageNames, @NonNull UserHandle user,
- @NonNull @CallbackExecutor Executor executor, @NonNull Consumer<Boolean> callback) {
+ @SystemApi
+ @RequiresPermission(anyOf = {
+ Manifest.permission.ADJUST_RUNTIME_PERMISSIONS_POLICY,
+ Manifest.permission.UPGRADE_RUNTIME_PERMISSIONS
+ })
+ public @IntRange(from = 0) int getRuntimePermissionsVersion() {
try {
- mPermissionManager.grantDefaultPermissionsToEnabledTelephonyDataServices(
- packageNames, user.getIdentifier());
- executor.execute(() -> callback.accept(true));
+ return mPackageManager.getRuntimePermissionsVersion(mContext.getUserId());
} catch (RemoteException e) {
- e.rethrowFromSystemServer();
+ throw e.rethrowFromSystemServer();
}
}
/**
- * Revoke default permissions to currently active telephony data services
- * @param packageNames The package name for the services
- * @param user The user handle
- * @param executor The executor for the callback
- * @param callback The callback provided by caller to be notified when revoke completes
+ * Sets the version of the runtime permission database.
+ *
+ * @param version The new version.
+ *
* @hide
*/
- @RequiresPermission(Manifest.permission.GRANT_RUNTIME_PERMISSIONS_TO_TELEPHONY_DEFAULTS)
- public void revokeDefaultPermissionsFromDisabledTelephonyDataServices(
- @NonNull String[] packageNames, @NonNull UserHandle user,
- @NonNull @CallbackExecutor Executor executor, @NonNull Consumer<Boolean> callback) {
+ @SystemApi
+ @RequiresPermission(anyOf = {
+ Manifest.permission.ADJUST_RUNTIME_PERMISSIONS_POLICY,
+ Manifest.permission.UPGRADE_RUNTIME_PERMISSIONS
+ })
+ public void setRuntimePermissionsVersion(@IntRange(from = 0) int version) {
try {
- mPermissionManager.revokeDefaultPermissionsFromDisabledTelephonyDataServices(
- packageNames, user.getIdentifier());
- executor.execute(() -> callback.accept(true));
+ mPackageManager.setRuntimePermissionsVersion(version, mContext.getUserId());
} catch (RemoteException e) {
- e.rethrowFromSystemServer();
+ throw e.rethrowFromSystemServer();
}
}
/**
- * Grant default permissions to currently enabled carrier apps
- * @param packageNames Package names of the apps to be granted permissions
- * @param user The user handle
- * @param executor The executor for the callback
- * @param callback The callback provided by caller to be notified when grant completes
- * @hide
+ * Get set of permissions that have been split into more granular or dependent permissions.
+ *
+ * <p>E.g. before {@link android.os.Build.VERSION_CODES#Q} an app that was granted
+ * {@link Manifest.permission#ACCESS_COARSE_LOCATION} could access the location while it was in
+ * foreground and background. On platforms after {@link android.os.Build.VERSION_CODES#Q}
+ * the location permission only grants location access while the app is in foreground. This
+ * would break apps that target before {@link android.os.Build.VERSION_CODES#Q}. Hence whenever
+ * such an old app asks for a location permission (i.e. the
+ * {@link SplitPermissionInfo#getSplitPermission()}), then the
+ * {@link Manifest.permission#ACCESS_BACKGROUND_LOCATION} permission (inside
+ * {@link SplitPermissionInfo#getNewPermissions}) is added.
+ *
+ * <p>Note: Regular apps do not have to worry about this. The platform and permission controller
+ * automatically add the new permissions where needed.
+ *
+ * @return All permissions that are split.
*/
- @RequiresPermission(Manifest.permission.GRANT_RUNTIME_PERMISSIONS_TO_TELEPHONY_DEFAULTS)
- public void grantDefaultPermissionsToEnabledCarrierApps(@NonNull String[] packageNames,
- @NonNull UserHandle user, @NonNull @CallbackExecutor Executor executor,
- @NonNull Consumer<Boolean> callback) {
+ public @NonNull List<SplitPermissionInfo> getSplitPermissions() {
+ if (mSplitPermissionInfos != null) {
+ return mSplitPermissionInfos;
+ }
+
+ List<SplitPermissionInfoParcelable> parcelableList;
try {
- mPermissionManager.grantDefaultPermissionsToEnabledCarrierApps(packageNames,
- user.getIdentifier());
- executor.execute(() -> callback.accept(true));
+ parcelableList = ActivityThread.getPermissionManager().getSplitPermissions();
} catch (RemoteException e) {
- e.rethrowFromSystemServer();
+ Slog.e(LOG_TAG, "Error getting split permissions", e);
+ return Collections.emptyList();
}
+
+ mSplitPermissionInfos = splitPermissionInfoListToNonParcelableList(parcelableList);
+
+ return mSplitPermissionInfos;
}
/**
@@ -530,12 +1060,8 @@ public final class PermissionManager {
@SystemApi
public int checkDeviceIdentifierAccess(@Nullable String packageName, @Nullable String message,
@Nullable String callingFeatureId, int pid, int uid) {
- try {
- return mPermissionManager.checkDeviceIdentifierAccess(packageName, message,
- callingFeatureId, pid, uid);
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
+ return mLegacyPermissionManager.checkDeviceIdentifierAccess(packageName, message,
+ callingFeatureId, pid, uid);
}
/* @hide */
@@ -547,10 +1073,11 @@ public final class PermissionManager {
// permission this is.
final int appId = UserHandle.getAppId(uid);
if (appId == Process.ROOT_UID || appId == Process.SYSTEM_UID) {
- Slog.w(TAG, "Missing ActivityManager; assuming " + uid + " holds " + permission);
+ Slog.w(LOG_TAG, "Missing ActivityManager; assuming " + uid + " holds "
+ + permission);
return PackageManager.PERMISSION_GRANTED;
}
- Slog.w(TAG, "Missing ActivityManager; assuming " + uid + " does not hold "
+ Slog.w(LOG_TAG, "Missing ActivityManager; assuming " + uid + " does not hold "
+ permission);
return PackageManager.PERMISSION_DENIED;
}
@@ -730,4 +1257,35 @@ public final class PermissionManager {
sPackageNamePermissionCache.disableLocal();
}
+ private final class OnPermissionsChangeListenerDelegate
+ extends IOnPermissionsChangeListener.Stub implements Handler.Callback{
+ private static final int MSG_PERMISSIONS_CHANGED = 1;
+
+ private final PackageManager.OnPermissionsChangedListener mListener;
+ private final Handler mHandler;
+
+ public OnPermissionsChangeListenerDelegate(
+ PackageManager.OnPermissionsChangedListener listener, Looper looper) {
+ mListener = listener;
+ mHandler = new Handler(looper, this);
+ }
+
+ @Override
+ public void onPermissionsChanged(int uid) {
+ mHandler.obtainMessage(MSG_PERMISSIONS_CHANGED, uid, 0).sendToTarget();
+ }
+
+ @Override
+ public boolean handleMessage(Message msg) {
+ switch (msg.what) {
+ case MSG_PERMISSIONS_CHANGED: {
+ final int uid = msg.arg1;
+ mListener.onPermissionsChanged(uid);
+ return true;
+ }
+ default:
+ return false;
+ }
+ }
+ }
}
diff --git a/core/java/android/provider/CallLog.java b/core/java/android/provider/CallLog.java
index 105ffaa4718e..d1aa48914e70 100644
--- a/core/java/android/provider/CallLog.java
+++ b/core/java/android/provider/CallLog.java
@@ -17,7 +17,14 @@
package android.provider;
+import android.Manifest;
+import android.annotation.CallbackExecutor;
+import android.annotation.IntDef;
import android.annotation.LongDef;
+import android.annotation.NonNull;
+import android.annotation.Nullable;
+import android.annotation.RequiresPermission;
+import android.annotation.SystemApi;
import android.compat.annotation.UnsupportedAppUsage;
import android.content.ContentProvider;
import android.content.ContentResolver;
@@ -30,6 +37,9 @@ import android.location.Country;
import android.location.CountryDetector;
import android.net.Uri;
import android.os.Build;
+import android.os.OutcomeReceiver;
+import android.os.ParcelFileDescriptor;
+import android.os.ParcelableException;
import android.os.UserHandle;
import android.os.UserManager;
import android.provider.ContactsContract.CommonDataKinds.Callable;
@@ -44,9 +54,15 @@ import android.telephony.PhoneNumberUtils;
import android.text.TextUtils;
import android.util.Log;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.util.List;
+import java.util.Objects;
+import java.util.concurrent.Executor;
/**
* The CallLog provider contains information about placed and received calls.
@@ -63,6 +79,12 @@ public class CallLog {
public static final Uri CONTENT_URI =
Uri.parse("content://" + AUTHORITY);
+ /** @hide */
+ public static final String CALL_COMPOSER_SEGMENT = "call_composer";
+
+ /** @hide */
+ public static final Uri CALL_COMPOSER_PICTURE_URI =
+ CONTENT_URI.buildUpon().appendPath(CALL_COMPOSER_SEGMENT).build();
/**
* The "shadow" provider stores calllog when the real calllog provider is encrypted. The
@@ -75,6 +97,172 @@ public class CallLog {
public static final String SHADOW_AUTHORITY = "call_log_shadow";
/**
+ * Describes an error encountered while storing a call composer picture in the call log.
+ * @hide
+ */
+ @SystemApi
+ public static class CallComposerLoggingException extends Throwable {
+ /**
+ * Indicates an unknown error.
+ */
+ public static final int ERROR_UNKNOWN = 0;
+
+ /**
+ * Indicates that the process hosting the call log died or otherwise encountered an
+ * unrecoverable error while storing the picture.
+ *
+ * The caller should retry if this error is encountered.
+ */
+ public static final int ERROR_REMOTE_END_CLOSED = 1;
+
+ /**
+ * Indicates that the device has insufficient space to store this picture.
+ *
+ * The caller should not retry if this error is encountered.
+ */
+ public static final int ERROR_STORAGE_FULL = 2;
+
+ /**
+ * Indicates that the {@link InputStream} passed to {@link #storeCallComposerPictureAsUser}
+ * was closed.
+ *
+ * The caller should retry if this error is encountered, and be sure to not close the stream
+ * before the callback is called this time.
+ */
+ public static final int ERROR_INPUT_CLOSED = 3;
+
+ /** @hide */
+ @IntDef(prefix = {"ERROR_"}, value = {
+ ERROR_UNKNOWN,
+ ERROR_REMOTE_END_CLOSED,
+ ERROR_STORAGE_FULL,
+ ERROR_INPUT_CLOSED,
+ })
+ @Retention(RetentionPolicy.SOURCE)
+ public @interface CallComposerLoggingError { }
+
+ private final int mErrorCode;
+
+ /** @hide */
+ public CallComposerLoggingException(@CallComposerLoggingError int errorCode) {
+ mErrorCode = errorCode;
+ }
+
+ /**
+ * @return The error code for this exception.
+ */
+ public @CallComposerLoggingError int getErrorCode() {
+ return mErrorCode;
+ }
+ }
+
+ /**
+ * Supplies a call composer picture to the call log for persistent storage.
+ *
+ * This method is used by Telephony to store pictures selected by the user or sent from the
+ * remote party as part of a voice call with call composer. The {@link Uri} supplied in the
+ * callback can be used to retrieve the image via {@link ContentResolver#openFile} or stored in
+ * the {@link Calls} table in the TODO: link column name.
+ *
+ * The caller is responsible for closing the {@link InputStream} after the callback indicating
+ * success or failure.
+ *
+ * @param context An instance of {@link Context}.
+ * @param user The user for whom the picture is stored. If {@code null}, the picture will be
+ * stored for all users.
+ * @param input An input stream from which the picture to store should be read. The input data
+ * must be decodeable as either a JPEG, PNG, or GIF image.
+ * @param executor The {@link Executor} on which to perform the file transfer operation and
+ * call the supplied callback.
+ * @param callback Callback that's called after the picture is successfully stored or when an
+ * error occurs.
+ * @hide
+ */
+ @SystemApi
+ @RequiresPermission(Manifest.permission.WRITE_CALL_LOG)
+ public static void storeCallComposerPictureAsUser(@NonNull Context context,
+ @Nullable UserHandle user,
+ @NonNull InputStream input,
+ @CallbackExecutor @NonNull Executor executor,
+ @NonNull OutcomeReceiver<Uri, CallComposerLoggingException> callback) {
+ Objects.requireNonNull(context);
+ Objects.requireNonNull(input);
+ Objects.requireNonNull(executor);
+ Objects.requireNonNull(callback);
+
+ executor.execute(() -> {
+ Uri pictureFileUri;
+ Uri pictureInsertionUri = context.getSystemService(UserManager.class)
+ .isUserUnlocked() ? CALL_COMPOSER_PICTURE_URI
+ : CALL_COMPOSER_PICTURE_URI.buildUpon().authority(SHADOW_AUTHORITY).build();
+ try {
+ // ContentResolver#insert says that the second argument is nullable. It is in fact
+ // not nullable.
+ ContentValues cv = new ContentValues();
+ pictureFileUri = context.getContentResolver().insert(pictureInsertionUri, cv);
+ } catch (ParcelableException e) {
+ // Most likely an IOException. We don't have a good way of distinguishing them so
+ // just return an unknown error.
+ sendCallComposerError(callback, CallComposerLoggingException.ERROR_UNKNOWN);
+ return;
+ }
+ if (pictureFileUri == null) {
+ // If the call log provider returns null, it means that there's not enough space
+ // left to store the maximum-sized call composer image.
+ sendCallComposerError(callback, CallComposerLoggingException.ERROR_STORAGE_FULL);
+ return;
+ }
+
+ boolean wroteSuccessfully = false;
+ try (ParcelFileDescriptor pfd =
+ context.getContentResolver().openFileDescriptor(pictureFileUri, "w")) {
+ FileOutputStream output = new FileOutputStream(pfd.getFileDescriptor());
+ byte[] buffer = new byte[1024];
+ int bytesRead;
+ while (true) {
+ try {
+ bytesRead = input.read(buffer);
+ } catch (IOException e) {
+ sendCallComposerError(callback,
+ CallComposerLoggingException.ERROR_INPUT_CLOSED);
+ throw e;
+ }
+ if (bytesRead < 0) {
+ break;
+ }
+ try {
+ output.write(buffer, 0, bytesRead);
+ } catch (IOException e) {
+ sendCallComposerError(callback,
+ CallComposerLoggingException.ERROR_REMOTE_END_CLOSED);
+ throw e;
+ }
+ }
+ wroteSuccessfully = true;
+ } catch (FileNotFoundException e) {
+ callback.onError(new CallComposerLoggingException(
+ CallComposerLoggingException.ERROR_UNKNOWN));
+ } catch (IOException e) {
+ Log.e(LOG_TAG, "IOException while writing call composer pic to call log: "
+ + e);
+ }
+
+ if (wroteSuccessfully) {
+ callback.onResult(pictureFileUri);
+ } else {
+ // Clean up our mess if we didn't successfully write the file.
+ context.getContentResolver().delete(pictureFileUri, null);
+ }
+ });
+ }
+
+ // Only call on the correct executor.
+ private static void sendCallComposerError(OutcomeReceiver<?, CallComposerLoggingException> cb,
+ int error) {
+ cb.onError(new CallComposerLoggingException(error));
+ }
+
+ /**
* Contains the recent calls.
*/
public static class Calls implements BaseColumns {
diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java
index fb0aea05ba4b..daa17aaefa7f 100644
--- a/core/java/android/provider/Settings.java
+++ b/core/java/android/provider/Settings.java
@@ -3060,6 +3060,7 @@ public final class Settings {
// com.android.providers.settings.SettingsProtoDumpUtil#dumpProtoSystemSettingsLocked.
private static final float DEFAULT_FONT_SCALE = 1.0f;
+ private static final int DEFAULT_FONT_WEIGHT = 0;
/**
* The content:// style URL for this table
@@ -3581,9 +3582,7 @@ public final class Settings {
outConfig.fontScale = DEFAULT_FONT_SCALE;
}
outConfig.fontWeightAdjustment = Settings.Secure.getIntForUser(
- cr, Settings.Secure.FONT_WEIGHT_ADJUSTMENT,
- Configuration.FONT_WEIGHT_ADJUSTMENT_UNDEFINED,
- userHandle);
+ cr, Settings.Secure.FONT_WEIGHT_ADJUSTMENT, DEFAULT_FONT_WEIGHT, userHandle);
final String localeValue =
Settings.System.getStringForUser(cr, SYSTEM_LOCALES, userHandle);
@@ -7761,6 +7760,32 @@ public final class Settings {
"minimal_post_processing_allowed";
/**
+ * No mode switching will happen.
+ *
+ * @see #MATCH_CONTENT_FRAME_RATE
+ * @hide
+ */
+ public static final int MATCH_CONTENT_FRAMERATE_NEVER = 0;
+
+ /**
+ * Allow only refresh rate switching between modes in the same configuration group.
+ * This way only switches without visual interruptions for the user will be allowed.
+ *
+ * @see #MATCH_CONTENT_FRAME_RATE
+ * @hide
+ */
+ public static final int MATCH_CONTENT_FRAMERATE_SEAMLESSS_ONLY = 1;
+
+ /**
+ * Allow refresh rate switching between all refresh rates even if the switch will have
+ * visual interruptions for the user.
+ *
+ * @see #MATCH_CONTENT_FRAME_RATE
+ * @hide
+ */
+ public static final int MATCH_CONTENT_FRAMERATE_ALWAYS = 2;
+
+ /**
* User's preference for refresh rate switching.
*
* <p>Values:
@@ -7770,6 +7795,9 @@ public final class Settings {
* for the user.
*
* @see android.view.Surface#setFrameRate
+ * @see #MATCH_CONTENT_FRAMERATE_NEVER
+ * @see #MATCH_CONTENT_FRAMERATE_SEAMLESSS_ONLY
+ * @see #MATCH_CONTENT_FRAMERATE_ALWAYS
* @hide
*/
public static final String MATCH_CONTENT_FRAME_RATE =
diff --git a/core/java/android/security/keymaster/KeymasterDefs.java b/core/java/android/security/keymaster/KeymasterDefs.java
index 6ef9e7e3d9b8..017f40521a81 100644
--- a/core/java/android/security/keymaster/KeymasterDefs.java
+++ b/core/java/android/security/keymaster/KeymasterDefs.java
@@ -16,18 +16,18 @@
package android.security.keymaster;
-import android.hardware.keymint.Algorithm;
-import android.hardware.keymint.BlockMode;
-import android.hardware.keymint.Digest;
-import android.hardware.keymint.ErrorCode;
-import android.hardware.keymint.HardwareAuthenticatorType;
-import android.hardware.keymint.KeyFormat;
-import android.hardware.keymint.KeyOrigin;
-import android.hardware.keymint.KeyPurpose;
-import android.hardware.keymint.PaddingMode;
-import android.hardware.keymint.SecurityLevel;
-import android.hardware.keymint.Tag;
-import android.hardware.keymint.TagType;
+import android.hardware.security.keymint.Algorithm;
+import android.hardware.security.keymint.BlockMode;
+import android.hardware.security.keymint.Digest;
+import android.hardware.security.keymint.ErrorCode;
+import android.hardware.security.keymint.HardwareAuthenticatorType;
+import android.hardware.security.keymint.KeyFormat;
+import android.hardware.security.keymint.KeyOrigin;
+import android.hardware.security.keymint.KeyPurpose;
+import android.hardware.security.keymint.PaddingMode;
+import android.hardware.security.keymint.SecurityLevel;
+import android.hardware.security.keymint.Tag;
+import android.hardware.security.keymint.TagType;
import java.util.HashMap;
import java.util.Map;
diff --git a/core/java/android/service/textservice/OWNERS b/core/java/android/service/textservice/OWNERS
index a637754ba17a..10b8b7637431 100644
--- a/core/java/android/service/textservice/OWNERS
+++ b/core/java/android/service/textservice/OWNERS
@@ -1,5 +1,3 @@
# Bug component: 34867
-ogunwale@google.com
-roosa@google.com
-yukawa@google.com
+include ../../inputmethodservice/OWNERS \ No newline at end of file
diff --git a/core/java/android/telephony/OWNERS b/core/java/android/telephony/OWNERS
new file mode 100644
index 000000000000..640baf2297b4
--- /dev/null
+++ b/core/java/android/telephony/OWNERS
@@ -0,0 +1 @@
+include /telephony/OWNERS
diff --git a/core/java/android/timezone/OWNERS b/core/java/android/timezone/OWNERS
index 09447a971bdd..8f8089717e3b 100644
--- a/core/java/android/timezone/OWNERS
+++ b/core/java/android/timezone/OWNERS
@@ -1 +1,3 @@
-include /core/java/android/app/timezone/OWNERS
+# Bug component: 847766
+mingaleev@google.com
+include /core/java/android/app/timedetector/OWNERS
diff --git a/core/java/android/util/ExceptionUtils.java b/core/java/android/util/ExceptionUtils.java
index 1a397b39ef3c..4b511acc280f 100644
--- a/core/java/android/util/ExceptionUtils.java
+++ b/core/java/android/util/ExceptionUtils.java
@@ -98,4 +98,6 @@ public class ExceptionUtils {
}
return t;
}
+
+
} \ No newline at end of file
diff --git a/core/java/android/view/IRecentsAnimationController.aidl b/core/java/android/view/IRecentsAnimationController.aidl
index f209d88ac825..cac91a9f07d7 100644
--- a/core/java/android/view/IRecentsAnimationController.aidl
+++ b/core/java/android/view/IRecentsAnimationController.aidl
@@ -136,4 +136,13 @@ interface IRecentsAnimationController {
* @return {@code true} when target removed successfully, {@code false} otherwise.
*/
boolean removeTask(int taskId);
+
+ /**
+ * Detach navigation bar from app.
+ *
+ * The system reparents the leash of navigation bar to the app when the recents animation starts
+ * and Launcher should call this method to let system restore the navigation bar to its
+ * original position when the quick switch gesture is finished.
+ */
+ void detachNavigationBarFromApp();
}
diff --git a/core/java/android/view/InsetsAnimationThreadControlRunner.java b/core/java/android/view/InsetsAnimationThreadControlRunner.java
index 4a5fa0f971ae..0939336132a8 100644
--- a/core/java/android/view/InsetsAnimationThreadControlRunner.java
+++ b/core/java/android/view/InsetsAnimationThreadControlRunner.java
@@ -81,6 +81,7 @@ public class InsetsAnimationThreadControlRunner implements InsetsAnimationContro
SyncRtSurfaceTransactionApplier.SurfaceParams surfaceParams = params[i];
applyParams(t, surfaceParams, mTmpFloat9);
}
+ t.setFrameTimelineVsync(Choreographer.getSfInstance().getVsyncId());
t.apply();
t.close();
}
diff --git a/core/java/android/view/OWNERS b/core/java/android/view/OWNERS
index 4f82b86f260c..72fa4c39f1bc 100644
--- a/core/java/android/view/OWNERS
+++ b/core/java/android/view/OWNERS
@@ -8,19 +8,67 @@ nduca@google.com
sumir@google.com
ogunwale@google.com
jjaggi@google.com
+roosa@google.com
# Display
-per-file Display.java = michaelwr@google.com, santoscordon@google.com
-per-file DisplayInfo.java = michaelwr@google.com, santoscordon@google.com
+per-file Display*.java = file:/services/core/java/com/android/server/display/OWNERS
+per-file Display*.aidl = file:/services/core/java/com/android/server/display/OWNERS
# Haptics
-per-file HapticFeedbackConstants.java = michaelwr@google.com, santoscordon@google.com
+per-file HapticFeedbackConstants.java = file:/services/core/java/com/android/server/input/OWNERS
+
+# Ime
+per-file Ime*.java = file:/core/java/android/view/inputmethod/OWNERS
# Input
-per-file IInputMonitorHost.aidl = michaelwr@google.com, svv@google.com
-per-file Input*.java = michaelwr@google.com, svv@google.com
-per-file Input*.aidl = michaelwr@google.com, svv@google.com
-per-file KeyEvent.java = michaelwr@google.com, svv@google.com
-per-file MotionEvent.java = michaelwr@google.com, svv@google.com
-per-file PointerIcon.java = michaelwr@google.com, svv@google.com
-per-file SimulatedDpad.java = michaelwr@google.com, svv@google.com
+per-file IInput*.aidl = file:/services/core/java/com/android/server/input/OWNERS
+per-file Input*.java = file:/services/core/java/com/android/server/input/OWNERS
+per-file Input*.aidl = file:/services/core/java/com/android/server/input/OWNERS
+per-file KeyEvent.java = file:/services/core/java/com/android/server/input/OWNERS
+per-file MotionEvent.java = file:/services/core/java/com/android/server/input/OWNERS
+per-file PointerIcon.java = file:/services/core/java/com/android/server/input/OWNERS
+per-file SimulatedDpad.java = file:/services/core/java/com/android/server/input/OWNERS
+
+# InputWindowHandle
+per-file InputWindowHandle.java = file:/services/core/java/com/android/server/input/OWNERS
+per-file InputWindowHandle.java = file:/services/core/java/com/android/server/wm/OWNERS
+
+# Surface
+per-file Surface.java = file:/graphics/java/android/graphics/OWNERS
+per-file Surface.java = file:/services/core/java/com/android/server/wm/OWNERS
+per-file SurfaceView.java = file:/graphics/java/android/graphics/OWNERS
+per-file SurfaceView.java = file:/services/core/java/com/android/server/wm/OWNERS
+per-file SurfaceHolder.java = file:/graphics/java/android/graphics/OWNERS
+per-file SurfaceHolder.java = file:/services/core/java/com/android/server/wm/OWNERS
+
+# View
+per-file View.java = file:/services/accessibility/OWNERS
+per-file View.java = file:/core/java/android/service/autofill/OWNERS
+per-file View.java = file:/graphics/java/android/graphics/OWNERS
+per-file View.java = file:/services/core/java/com/android/server/input/OWNERS
+per-file View.java = file:/services/core/java/com/android/server/wm/OWNERS
+per-file ViewRootImpl.java = file:/services/accessibility/OWNERS
+per-file ViewRootImpl.java = file:/core/java/android/service/autofill/OWNERS
+per-file ViewRootImpl.java = file:/graphics/java/android/graphics/OWNERS
+per-file ViewRootImpl.java = file:/services/core/java/com/android/server/input/OWNERS
+per-file ViewRootImpl.java = file:/services/core/java/com/android/server/wm/OWNERS
+
+# WindowManager
+per-file DisplayCutout.aidl = file:/services/core/java/com/android/server/wm/OWNERS
+per-file DisplayCutout.java = file:/services/core/java/com/android/server/wm/OWNERS
+per-file IDisplay*.aidl = file:/services/core/java/com/android/server/wm/OWNERS
+per-file Inset*.java = file:/services/core/java/com/android/server/wm/OWNERS
+per-file Inset*.aidl = file:/services/core/java/com/android/server/wm/OWNERS
+per-file IPinnedStackListener.aidl = file:/services/core/java/com/android/server/wm/OWNERS
+per-file IRecents*.aidl = file:/services/core/java/com/android/server/wm/OWNERS
+per-file IRemote*.aidl = file:/services/core/java/com/android/server/wm/OWNERS
+per-file IWindow*.aidl = file:/services/core/java/com/android/server/wm/OWNERS
+per-file RemoteAnimation*.java = file:/services/core/java/com/android/server/wm/OWNERS
+per-file RemoteAnimation*.aidl = file:/services/core/java/com/android/server/wm/OWNERS
+per-file SurfaceControl*.java = file:/services/core/java/com/android/server/wm/OWNERS
+per-file SurfaceControl*.aidl = file:/services/core/java/com/android/server/wm/OWNERS
+per-file SurfaceSession.java = file:/services/core/java/com/android/server/wm/OWNERS
+per-file SyncRtSurfaceTransactionApplier.java = file:/services/core/java/com/android/server/wm/OWNERS
+per-file ViewRootInsetsControllerHost.java = file:/services/core/java/com/android/server/wm/OWNERS
+per-file Window*.java = file:/services/core/java/com/android/server/wm/OWNERS
+per-file Window*.aidl = file:/services/core/java/com/android/server/wm/OWNERS
diff --git a/core/java/android/view/SurfaceControl.java b/core/java/android/view/SurfaceControl.java
index 81e0852fdfa2..23de215eeefc 100644
--- a/core/java/android/view/SurfaceControl.java
+++ b/core/java/android/view/SurfaceControl.java
@@ -1601,97 +1601,6 @@ public final class SurfaceControl implements Parcelable {
/**
* @hide
*/
- public void deferTransactionUntil(SurfaceControl barrier, long frame) {
- synchronized(SurfaceControl.class) {
- sGlobalTransaction.deferTransactionUntil(this, barrier, frame);
- }
- }
-
- /**
- * @hide
- */
- public void reparentChildren(SurfaceControl newParent) {
- synchronized(SurfaceControl.class) {
- sGlobalTransaction.reparentChildren(this, newParent);
- }
- }
-
- /**
- * @hide
- */
- public void detachChildren() {
- synchronized(SurfaceControl.class) {
- sGlobalTransaction.detachChildren(this);
- }
- }
-
- /**
- * @hide
- */
- @UnsupportedAppUsage
- public void setLayer(int zorder) {
- checkNotReleased();
- synchronized(SurfaceControl.class) {
- sGlobalTransaction.setLayer(this, zorder);
- }
- }
-
- /**
- * @hide
- */
- @UnsupportedAppUsage
- public void setPosition(float x, float y) {
- checkNotReleased();
- synchronized(SurfaceControl.class) {
- sGlobalTransaction.setPosition(this, x, y);
- }
- }
-
- /**
- * @hide
- */
- public void setBufferSize(int w, int h) {
- checkNotReleased();
- synchronized(SurfaceControl.class) {
- sGlobalTransaction.setBufferSize(this, w, h);
- }
- }
-
- /**
- * @hide
- */
- @UnsupportedAppUsage
- public void hide() {
- checkNotReleased();
- synchronized(SurfaceControl.class) {
- sGlobalTransaction.hide(this);
- }
- }
-
- /**
- * @hide
- */
- @UnsupportedAppUsage
- public void show() {
- checkNotReleased();
- synchronized(SurfaceControl.class) {
- sGlobalTransaction.show(this);
- }
- }
-
- /**
- * @hide
- */
- public void setTransparentRegionHint(Region region) {
- checkNotReleased();
- synchronized(SurfaceControl.class) {
- sGlobalTransaction.setTransparentRegionHint(this, region);
- }
- }
-
- /**
- * @hide
- */
public boolean clearContentFrameStats() {
checkNotReleased();
return nativeClearContentFrameStats(mNativeObject);
@@ -1722,87 +1631,6 @@ public final class SurfaceControl implements Parcelable {
/**
* @hide
*/
- public void setAlpha(float alpha) {
- checkNotReleased();
- synchronized(SurfaceControl.class) {
- sGlobalTransaction.setAlpha(this, alpha);
- }
- }
-
- /**
- * @hide
- */
- public void setBackgroundBlurRadius(int blur) {
- checkNotReleased();
- synchronized (SurfaceControl.class) {
- sGlobalTransaction.setBackgroundBlurRadius(this, blur);
- }
- }
-
- /**
- * @hide
- */
- public void setMatrix(float dsdx, float dtdx, float dtdy, float dsdy) {
- checkNotReleased();
- synchronized(SurfaceControl.class) {
- sGlobalTransaction.setMatrix(this, dsdx, dtdx, dtdy, dsdy);
- }
- }
-
- /**
- * Sets the Surface to be color space agnostic. If a surface is color space agnostic,
- * the color can be interpreted in any color space.
- * @param agnostic A boolean to indicate whether the surface is color space agnostic
- * @hide
- */
- public void setColorSpaceAgnostic(boolean agnostic) {
- checkNotReleased();
- synchronized (SurfaceControl.class) {
- sGlobalTransaction.setColorSpaceAgnostic(this, agnostic);
- }
- }
-
- /**
- * Bounds the surface and its children to the bounds specified. Size of the surface will be
- * ignored and only the crop and buffer size will be used to determine the bounds of the
- * surface. If no crop is specified and the surface has no buffer, the surface bounds is only
- * constrained by the size of its parent bounds.
- *
- * @param crop Bounds of the crop to apply.
- * @hide
- */
- public void setWindowCrop(Rect crop) {
- checkNotReleased();
- synchronized (SurfaceControl.class) {
- sGlobalTransaction.setWindowCrop(this, crop);
- }
- }
-
- /**
- * @hide
- */
- public void setOpaque(boolean isOpaque) {
- checkNotReleased();
-
- synchronized (SurfaceControl.class) {
- sGlobalTransaction.setOpaque(this, isOpaque);
- }
- }
-
- /**
- * @hide
- */
- public void setSecure(boolean isSecure) {
- checkNotReleased();
-
- synchronized (SurfaceControl.class) {
- sGlobalTransaction.setSecure(this, isSecure);
- }
- }
-
- /**
- * @hide
- */
public int getWidth() {
synchronized (mLock) {
return mWidth;
diff --git a/core/java/android/view/Window.java b/core/java/android/view/Window.java
index 13d9eb9d3c7d..af18293398da 100644
--- a/core/java/android/view/Window.java
+++ b/core/java/android/view/Window.java
@@ -16,7 +16,11 @@
package android.view;
+import static android.Manifest.permission.HIDE_NON_SYSTEM_OVERLAY_WINDOWS;
+import static android.Manifest.permission.HIDE_OVERLAY_WINDOWS;
+import static android.content.pm.PackageManager.PERMISSION_GRANTED;
import static android.view.WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED;
+import static android.view.WindowManager.LayoutParams.SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS;
import android.annotation.ColorInt;
import android.annotation.DrawableRes;
@@ -24,6 +28,7 @@ import android.annotation.IdRes;
import android.annotation.LayoutRes;
import android.annotation.NonNull;
import android.annotation.Nullable;
+import android.annotation.RequiresPermission;
import android.annotation.StyleRes;
import android.annotation.SystemApi;
import android.annotation.TestApi;
@@ -991,6 +996,26 @@ public abstract class Window {
}
/**
+ * Prevent non-system overlay windows from being drawn on top of this window.
+ *
+ * @param hide whether non-system overlay windows should be hidden.
+ */
+ @RequiresPermission(HIDE_OVERLAY_WINDOWS)
+ public final void setHideOverlayWindows(boolean hide) {
+ // This permission check is here to throw early and let the developer know that they need
+ // to hold HIDE_OVERLAY_WINDOWS for the flag to have any effect. The WM verifies that the
+ // owner of the window has the permission before applying the flag, but this is done
+ // asynchronously.
+ if (mContext.checkSelfPermission(HIDE_NON_SYSTEM_OVERLAY_WINDOWS) != PERMISSION_GRANTED
+ && mContext.checkSelfPermission(HIDE_OVERLAY_WINDOWS) != PERMISSION_GRANTED) {
+ throw new SecurityException(
+ "Permission denial: setHideOverlayWindows: HIDE_OVERLAY_WINDOWS");
+ }
+ setPrivateFlags(hide ? SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS : 0,
+ SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS);
+ }
+
+ /**
* Take ownership of this window's surface. The window's view hierarchy
* will no longer draw into the surface, though it will otherwise continue
* to operate (such as for receiving input events). The given SurfaceHolder
diff --git a/core/java/android/view/WindowManager.java b/core/java/android/view/WindowManager.java
index b9afbc95de0d..6d88d637dc24 100644
--- a/core/java/android/view/WindowManager.java
+++ b/core/java/android/view/WindowManager.java
@@ -343,23 +343,48 @@ public interface WindowManager extends ViewManager {
/** @hide */
int TRANSIT_NONE = 0;
- /** @hide */
+ /**
+ * A window that didn't exist before has been created and made visible.
+ * @hide
+ */
int TRANSIT_OPEN = 1;
- /** @hide */
+ /**
+ * A window that was visible no-longer exists (was finished or destroyed).
+ * @hide
+ */
int TRANSIT_CLOSE = 2;
- /** @hide */
+ /**
+ * A window that already existed but was not visible is made visible.
+ * @hide
+ */
int TRANSIT_TO_FRONT = 3;
- /** @hide */
+ /**
+ * A window that was visible is made invisible but still exists.
+ * @hide
+ */
int TRANSIT_TO_BACK = 4;
/** @hide */
int TRANSIT_RELAUNCH = 5;
- /** @hide */
- int TRANSIT_CHANGE_WINDOWING_MODE = 6;
- /** @hide */
+ /**
+ * A window is visible before and after but changes in some way (eg. it resizes or changes
+ * windowing-mode).
+ * @hide
+ */
+ int TRANSIT_CHANGE = 6;
+ /**
+ * The keyguard was visible and has been dismissed.
+ * @hide
+ */
int TRANSIT_KEYGUARD_GOING_AWAY = 7;
- /** @hide */
+ /**
+ * A window is appearing above a locked keyguard.
+ * @hide
+ */
int TRANSIT_KEYGUARD_OCCLUDE = 8;
- /** @hide */
+ /**
+ * A window is made invisible revealing a locked keyguard.
+ * @hide
+ */
int TRANSIT_KEYGUARD_UNOCCLUDE = 9;
/**
@@ -372,7 +397,7 @@ public interface WindowManager extends ViewManager {
TRANSIT_TO_FRONT,
TRANSIT_TO_BACK,
TRANSIT_RELAUNCH,
- TRANSIT_CHANGE_WINDOWING_MODE,
+ TRANSIT_CHANGE,
TRANSIT_KEYGUARD_GOING_AWAY,
TRANSIT_KEYGUARD_OCCLUDE,
TRANSIT_KEYGUARD_UNOCCLUDE,
@@ -418,6 +443,12 @@ public interface WindowManager extends ViewManager {
int TRANSIT_FLAG_OPEN_BEHIND = 0x20;
/**
+ * Transition flag: The keyguard is locked throughout the whole transition.
+ * @hide
+ */
+ int TRANSIT_FLAG_KEYGUARD_LOCKED = 0x40;
+
+ /**
* @hide
*/
@IntDef(flag = true, prefix = { "TRANSIT_FLAG_" }, value = {
@@ -426,7 +457,8 @@ public interface WindowManager extends ViewManager {
TRANSIT_FLAG_KEYGUARD_GOING_AWAY_WITH_WALLPAPER,
TRANSIT_FLAG_KEYGUARD_GOING_AWAY_SUBTLE_ANIMATION,
TRANSIT_FLAG_APP_CRASHED,
- TRANSIT_FLAG_OPEN_BEHIND
+ TRANSIT_FLAG_OPEN_BEHIND,
+ TRANSIT_FLAG_KEYGUARD_LOCKED
})
@Retention(RetentionPolicy.SOURCE)
@interface TransitionFlags {}
diff --git a/core/java/android/view/contentcapture/MainContentCaptureSession.java b/core/java/android/view/contentcapture/MainContentCaptureSession.java
index 16fd383fa7ff..3c18b6b89af8 100644
--- a/core/java/android/view/contentcapture/MainContentCaptureSession.java
+++ b/core/java/android/view/contentcapture/MainContentCaptureSession.java
@@ -43,6 +43,7 @@ import android.os.Handler;
import android.os.IBinder;
import android.os.IBinder.DeathRecipient;
import android.os.RemoteException;
+import android.text.TextUtils;
import android.util.LocalLog;
import android.util.Log;
import android.util.TimeUtils;
@@ -334,15 +335,22 @@ public final class MainContentCaptureSession extends ContentCaptureSession {
if (!mEvents.isEmpty() && eventType == TYPE_VIEW_TEXT_CHANGED) {
final ContentCaptureEvent lastEvent = mEvents.get(mEvents.size() - 1);
- // TODO(b/121045053): check if flags match
+ // We merge two consecutive text change event, unless one of them clears the text.
if (lastEvent.getType() == TYPE_VIEW_TEXT_CHANGED
&& lastEvent.getId().equals(event.getId())) {
- if (sVerbose) {
+ boolean bothNonEmpty = !TextUtils.isEmpty(lastEvent.getText())
+ && !TextUtils.isEmpty(event.getText());
+ boolean equalContent = TextUtils.equals(lastEvent.getText(), event.getText());
+ if (equalContent) {
+ addEvent = false;
+ } else if (bothNonEmpty) {
+ lastEvent.mergeEvent(event);
+ addEvent = false;
+ }
+ if (!addEvent && sVerbose) {
Log.v(TAG, "Buffering VIEW_TEXT_CHANGED event, updated text="
+ getSanitizedString(event.getText()));
}
- lastEvent.mergeEvent(event);
- addEvent = false;
}
}
diff --git a/core/java/android/view/textservice/OWNERS b/core/java/android/view/textservice/OWNERS
index a637754ba17a..582be8dc4594 100644
--- a/core/java/android/view/textservice/OWNERS
+++ b/core/java/android/view/textservice/OWNERS
@@ -1,5 +1,3 @@
# Bug component: 34867
-ogunwale@google.com
-roosa@google.com
-yukawa@google.com
+include ../inputmethod/OWNERS
diff --git a/core/java/android/widget/OWNERS b/core/java/android/widget/OWNERS
index fbb975b806f1..718076b49f77 100644
--- a/core/java/android/widget/OWNERS
+++ b/core/java/android/widget/OWNERS
@@ -7,3 +7,5 @@ aurimas@google.com
siyamed@google.com
per-file TextView.java, EditText.java, Editor.java = siyamed@google.com, nona@google.com, clarabayarri@google.com
+
+per-file SpellChecker.java = file:../view/inputmethod/OWNERS
diff --git a/core/java/android/window/TaskOrganizer.java b/core/java/android/window/TaskOrganizer.java
index c4bdb5a72689..12c4b5b7794a 100644
--- a/core/java/android/window/TaskOrganizer.java
+++ b/core/java/android/window/TaskOrganizer.java
@@ -210,6 +210,15 @@ public class TaskOrganizer extends WindowOrganizer {
}
}
+ /**
+ * Gets the executor to run callbacks on.
+ * @hide
+ */
+ @NonNull
+ public Executor getExecutor() {
+ return mExecutor;
+ }
+
private final ITaskOrganizer mInterface = new ITaskOrganizer.Stub() {
@Override
public void addStartingWindow(ActivityManager.RunningTaskInfo taskInfo, IBinder appToken) {
diff --git a/core/java/android/window/TransitionInfo.java b/core/java/android/window/TransitionInfo.java
index b4e7d6a9269f..52ab38fa2889 100644
--- a/core/java/android/window/TransitionInfo.java
+++ b/core/java/android/window/TransitionInfo.java
@@ -16,6 +16,13 @@
package android.window;
+import static android.view.WindowManager.TRANSIT_CHANGE;
+import static android.view.WindowManager.TRANSIT_CLOSE;
+import static android.view.WindowManager.TRANSIT_NONE;
+import static android.view.WindowManager.TRANSIT_OPEN;
+import static android.view.WindowManager.TRANSIT_TO_BACK;
+import static android.view.WindowManager.TRANSIT_TO_FRONT;
+
import android.annotation.IntDef;
import android.annotation.NonNull;
import android.annotation.Nullable;
@@ -35,48 +42,38 @@ import java.util.List;
*/
public final class TransitionInfo implements Parcelable {
- /** No transition mode. This is a placeholder, don't use this as an actual mode. */
- public static final int TRANSIT_NONE = 0;
-
- /** The container didn't exist before but will exist and be visible after. */
- public static final int TRANSIT_OPEN = 1;
-
- /** The container existed and was visible before but won't exist after. */
- public static final int TRANSIT_CLOSE = 2;
-
- /** The container existed before but was invisible and will be visible after. */
- public static final int TRANSIT_SHOW = 3;
-
- /** The container is going from visible to invisible but it will still exist after. */
- public static final int TRANSIT_HIDE = 4;
-
- /** The container exists and is visible before and after but it changes. */
- public static final int TRANSIT_CHANGE = 5;
-
- /** @hide */
+ /**
+ * Modes are only a sub-set of all the transit-types since they are per-container
+ * @hide
+ */
@IntDef(prefix = { "TRANSIT_" }, value = {
TRANSIT_NONE,
TRANSIT_OPEN,
TRANSIT_CLOSE,
- TRANSIT_SHOW,
- TRANSIT_HIDE,
+ // Note: to_front/to_back really mean show/hide respectively at the container level.
+ TRANSIT_TO_FRONT,
+ TRANSIT_TO_BACK,
TRANSIT_CHANGE
})
public @interface TransitionMode {}
private final @WindowManager.TransitionOldType int mType;
+ private final @WindowManager.TransitionFlags int mFlags;
private final ArrayList<Change> mChanges = new ArrayList<>();
private SurfaceControl mRootLeash;
private final Point mRootOffset = new Point();
/** @hide */
- public TransitionInfo(@WindowManager.TransitionOldType int type) {
+ public TransitionInfo(@WindowManager.TransitionOldType int type,
+ @WindowManager.TransitionFlags int flags) {
mType = type;
+ mFlags = flags;
}
private TransitionInfo(Parcel in) {
mType = in.readInt();
+ mFlags = in.readInt();
in.readList(mChanges, null /* classLoader */);
mRootLeash = new SurfaceControl();
mRootLeash.readFromParcel(in);
@@ -87,6 +84,7 @@ public final class TransitionInfo implements Parcelable {
/** @hide */
public void writeToParcel(@NonNull Parcel dest, int flags) {
dest.writeInt(mType);
+ dest.writeInt(mFlags);
dest.writeList(mChanges);
mRootLeash.writeToParcel(dest, flags);
mRootOffset.writeToParcel(dest, flags);
@@ -122,6 +120,10 @@ public final class TransitionInfo implements Parcelable {
return mType;
}
+ public int getFlags() {
+ return mFlags;
+ }
+
/**
* @return a surfacecontrol that can serve as a parent surfacecontrol for all the changing
* participants to animate within. This will generally be placed at the highest-z-order
@@ -170,7 +172,8 @@ public final class TransitionInfo implements Parcelable {
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
- sb.append("{t=" + mType + " ro=" + mRootOffset + " c=[");
+ sb.append("{t=" + mType + " f=" + Integer.toHexString(mFlags)
+ + " ro=" + mRootOffset + " c=[");
for (int i = 0; i < mChanges.size(); ++i) {
if (i > 0) {
sb.append(',');
@@ -188,8 +191,8 @@ public final class TransitionInfo implements Parcelable {
case TRANSIT_NONE: return "NONE";
case TRANSIT_OPEN: return "OPEN";
case TRANSIT_CLOSE: return "CLOSE";
- case TRANSIT_SHOW: return "SHOW";
- case TRANSIT_HIDE: return "HIDE";
+ case TRANSIT_TO_FRONT: return "SHOW";
+ case TRANSIT_TO_BACK: return "HIDE";
case TRANSIT_CHANGE: return "CHANGE";
default: return "<unknown:" + mode + ">";
}
@@ -200,7 +203,7 @@ public final class TransitionInfo implements Parcelable {
private final WindowContainerToken mContainer;
private WindowContainerToken mParent;
private final SurfaceControl mLeash;
- private int mMode = TRANSIT_NONE;
+ private @TransitionMode int mMode = TRANSIT_NONE;
private final Rect mStartAbsBounds = new Rect();
private final Rect mEndAbsBounds = new Rect();
private final Point mEndRelOffset = new Point();
diff --git a/core/java/com/android/internal/app/IAppOpsNotedCallback.aidl b/core/java/com/android/internal/app/IAppOpsNotedCallback.aidl
index fa5c30a03e78..cb280cd14180 100644
--- a/core/java/com/android/internal/app/IAppOpsNotedCallback.aidl
+++ b/core/java/com/android/internal/app/IAppOpsNotedCallback.aidl
@@ -18,5 +18,5 @@ package com.android.internal.app;
// Iterface to observe op note/checks of ops
oneway interface IAppOpsNotedCallback {
- void opNoted(int op, int uid, String packageName, int mode);
+ void opNoted(int op, int uid, String packageName, int flags, int mode);
}
diff --git a/core/java/com/android/internal/app/IAppOpsStartedCallback.aidl b/core/java/com/android/internal/app/IAppOpsStartedCallback.aidl
index ed521e656981..b0cb2a8ceb64 100644
--- a/core/java/com/android/internal/app/IAppOpsStartedCallback.aidl
+++ b/core/java/com/android/internal/app/IAppOpsStartedCallback.aidl
@@ -18,5 +18,5 @@ package com.android.internal.app;
// Iterface to observe op starts
oneway interface IAppOpsStartedCallback {
- void opStarted(int op, int uid, String packageName, int mode);
+ void opStarted(int op, int uid, String packageName, int flags, int mode);
}
diff --git a/core/java/com/android/internal/app/OWNERS b/core/java/com/android/internal/app/OWNERS
new file mode 100644
index 000000000000..108ab92f0e9b
--- /dev/null
+++ b/core/java/com/android/internal/app/OWNERS
@@ -0,0 +1 @@
+per-file *AppOp* = file:/core/java/android/permission/OWNERS
diff --git a/core/java/com/android/internal/inputmethod/CallbackUtils.java b/core/java/com/android/internal/inputmethod/CallbackUtils.java
index ec6779216ae5..a315e5a4fc94 100644
--- a/core/java/com/android/internal/inputmethod/CallbackUtils.java
+++ b/core/java/com/android/internal/inputmethod/CallbackUtils.java
@@ -45,8 +45,21 @@ public final class CallbackUtils {
@AnyThread
public static void onResult(@NonNull IInputBindResultResultCallback callback,
@NonNull Supplier<InputBindResult> resultSupplier) {
+ InputBindResult result = null;
+ Throwable exception = null;
+
+ try {
+ result = resultSupplier.get();
+ } catch (Throwable throwable) {
+ exception = throwable;
+ }
+
try {
- callback.onResult(resultSupplier.get());
+ if (exception != null) {
+ callback.onError(ThrowableHolder.of(exception));
+ return;
+ }
+ callback.onResult(result);
} catch (RemoteException ignored) { }
}
}
diff --git a/core/java/com/android/internal/inputmethod/Completable.java b/core/java/com/android/internal/inputmethod/Completable.java
index b9e1cf09dc07..bd8c23e66e51 100644
--- a/core/java/com/android/internal/inputmethod/Completable.java
+++ b/core/java/com/android/internal/inputmethod/Completable.java
@@ -16,13 +16,17 @@
package com.android.internal.inputmethod;
+import static java.lang.annotation.RetentionPolicy.SOURCE;
+
import android.annotation.AnyThread;
+import android.annotation.IntDef;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.util.Log;
import com.android.internal.annotations.GuardedBy;
+import java.lang.annotation.Retention;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
@@ -51,21 +55,100 @@ public final class Completable {
/**
* Lock {@link Object} to guard complete operations within this class.
*/
- protected final Object mValueLock = new Object();
+ protected final Object mStateLock = new Object();
/**
- * {@code true} after {@link #onComplete()} gets called.
+ * Indicates the completion state of this object.
*/
- @GuardedBy("mValueLock")
- protected boolean mHasValue = false;
+ @GuardedBy("mStateLock")
+ @CompletionState
+ protected int mState = CompletionState.NOT_COMPLETED;
/**
- * @return {@link true} if {@link #onComplete()} gets called already.
+ * {@link Throwable} message passed to {@link #onError(ThrowableHolder)}.
+ *
+ * <p>This is not {@code null} only when {@link #mState} is
+ * {@link CompletionState#COMPLETED_WITH_ERROR}.</p>
+ */
+ @GuardedBy("mStateLock")
+ @Nullable
+ protected String mMessage = null;
+
+ @Retention(SOURCE)
+ @IntDef({
+ CompletionState.NOT_COMPLETED,
+ CompletionState.COMPLETED_WITH_VALUE,
+ CompletionState.COMPLETED_WITH_ERROR})
+ protected @interface CompletionState {
+ /**
+ * This object is not completed yet.
+ */
+ int NOT_COMPLETED = 0;
+ /**
+ * This object is already completed with a value.
+ */
+ int COMPLETED_WITH_VALUE = 1;
+ /**
+ * This object is already completed with an error.
+ */
+ int COMPLETED_WITH_ERROR = 2;
+ }
+
+ /**
+ * Converts the given {@link CompletionState} into a human-readable string.
+ *
+ * @param state {@link CompletionState} to be converted.
+ * @return a human-readable {@link String} for the given {@code state}.
+ */
+ @AnyThread
+ protected static String stateToString(@CompletionState int state) {
+ switch (state) {
+ case CompletionState.NOT_COMPLETED:
+ return "NOT_COMPLETED";
+ case CompletionState.COMPLETED_WITH_VALUE:
+ return "COMPLETED_WITH_VALUE";
+ case CompletionState.COMPLETED_WITH_ERROR:
+ return "COMPLETED_WITH_ERROR";
+ default:
+ return "Unknown(value=" + state + ")";
+ }
+ }
+
+ /**
+ * @return {@link true} if {@link #onComplete()} gets called and {@link #mState} is
+ * {@link CompletionState#COMPLETED_WITH_VALUE} .
*/
@AnyThread
public boolean hasValue() {
- synchronized (mValueLock) {
- return mHasValue;
+ synchronized (mStateLock) {
+ return mState == CompletionState.COMPLETED_WITH_VALUE;
+ }
+ }
+
+ /**
+ * Provides the base implementation of {@code getValue()} for derived classes.
+ *
+ * <p>Must be called after acquiring {@link #mStateLock}.</p>
+ *
+ * @throws RuntimeException when {@link #mState} is
+ * {@link CompletionState#COMPLETED_WITH_ERROR}.
+ * @throws UnsupportedOperationException when {@link #mState} is not
+ * {@link CompletionState#COMPLETED_WITH_VALUE} and
+ * {@link CompletionState#COMPLETED_WITH_ERROR}.
+ */
+ @GuardedBy("mStateLock")
+ protected void enforceGetValueLocked() {
+ switch (mState) {
+ case CompletionState.NOT_COMPLETED:
+ throw new UnsupportedOperationException(
+ "getValue() is allowed only if hasValue() returns true");
+ case CompletionState.COMPLETED_WITH_VALUE:
+ return;
+ case CompletionState.COMPLETED_WITH_ERROR:
+ throw new RuntimeException(mMessage);
+ default:
+ throw new UnsupportedOperationException(
+ "getValue() is not allowed on state=" + stateToString(mState));
}
}
@@ -78,6 +161,27 @@ public final class Completable {
}
/**
+ * Notify when exception happened.
+ *
+ * @param throwableHolder contains the {@link Throwable} object when exception happened.
+ */
+ @AnyThread
+ protected void onError(ThrowableHolder throwableHolder) {
+ synchronized (mStateLock) {
+ switch (mState) {
+ case CompletionState.NOT_COMPLETED:
+ mMessage = throwableHolder.getMessage();
+ mState = CompletionState.COMPLETED_WITH_ERROR;
+ break;
+ default:
+ throw new UnsupportedOperationException(
+ "onError() is not allowed on state=" + stateToString(mState));
+ }
+ }
+ onComplete();
+ }
+
+ /**
* Blocks the calling thread until at least one of the following conditions is met.
*
* <p>
@@ -140,7 +244,7 @@ public final class Completable {
* Completable object of integer primitive.
*/
public static final class Int extends ValueBase {
- @GuardedBy("mValueLock")
+ @GuardedBy("mStateLock")
private int mValue = 0;
/**
@@ -150,29 +254,30 @@ public final class Completable {
*/
@AnyThread
void onComplete(int value) {
- synchronized (mValueLock) {
- if (mHasValue) {
- throw new UnsupportedOperationException(
- "onComplete() cannot be called multiple times");
+ synchronized (mStateLock) {
+ switch (mState) {
+ case CompletionState.NOT_COMPLETED:
+ mValue = value;
+ mState = CompletionState.COMPLETED_WITH_VALUE;
+ break;
+ default:
+ throw new UnsupportedOperationException(
+ "onComplete() is not allowed on state=" + stateToString(mState));
}
- mValue = value;
- mHasValue = true;
}
onComplete();
}
/**
* @return value associated with this object.
+ * @throws RuntimeException when called while {@link #onError} happened.
* @throws UnsupportedOperationException when called while {@link #hasValue()} returns
* {@code false}.
*/
@AnyThread
public int getValue() {
- synchronized (mValueLock) {
- if (!mHasValue) {
- throw new UnsupportedOperationException(
- "getValue() is allowed only if hasValue() returns true");
- }
+ synchronized (mStateLock) {
+ enforceGetValueLocked();
return mValue;
}
}
@@ -184,7 +289,7 @@ public final class Completable {
* @param <T> type associated with this completable object.
*/
public static class Values<T> extends ValueBase {
- @GuardedBy("mValueLock")
+ @GuardedBy("mStateLock")
@Nullable
private T mValue = null;
@@ -195,30 +300,31 @@ public final class Completable {
*/
@AnyThread
void onComplete(@Nullable T value) {
- synchronized (mValueLock) {
- if (mHasValue) {
- throw new UnsupportedOperationException(
- "onComplete() cannot be called multiple times");
+ synchronized (mStateLock) {
+ switch (mState) {
+ case CompletionState.NOT_COMPLETED:
+ mValue = value;
+ mState = CompletionState.COMPLETED_WITH_VALUE;
+ break;
+ default:
+ throw new UnsupportedOperationException(
+ "onComplete() is not allowed on state=" + stateToString(mState));
}
- mValue = value;
- mHasValue = true;
}
onComplete();
}
/**
* @return value associated with this object.
+ * @throws RuntimeException when called while {@link #onError} happened
* @throws UnsupportedOperationException when called while {@link #hasValue()} returns
* {@code false}.
*/
@AnyThread
@Nullable
public T getValue() {
- synchronized (mValueLock) {
- if (!mHasValue) {
- throw new UnsupportedOperationException(
- "getValue() is allowed only if hasValue() returns true");
- }
+ synchronized (mStateLock) {
+ enforceGetValueLocked();
return mValue;
}
}
diff --git a/core/java/com/android/internal/inputmethod/IInputBindResultResultCallback.aidl b/core/java/com/android/internal/inputmethod/IInputBindResultResultCallback.aidl
index b52b3b100ed0..269198404873 100644
--- a/core/java/com/android/internal/inputmethod/IInputBindResultResultCallback.aidl
+++ b/core/java/com/android/internal/inputmethod/IInputBindResultResultCallback.aidl
@@ -17,7 +17,9 @@
package com.android.internal.inputmethod;
import com.android.internal.view.InputBindResult;
+import com.android.internal.inputmethod.ThrowableHolder;
oneway interface IInputBindResultResultCallback {
void onResult(in InputBindResult result);
+ void onError(in ThrowableHolder exception);
} \ No newline at end of file
diff --git a/core/java/com/android/internal/inputmethod/ResultCallbacks.java b/core/java/com/android/internal/inputmethod/ResultCallbacks.java
index c59dcf4ce420..1929b6f22f8b 100644
--- a/core/java/com/android/internal/inputmethod/ResultCallbacks.java
+++ b/core/java/com/android/internal/inputmethod/ResultCallbacks.java
@@ -181,6 +181,16 @@ public final class ResultCallbacks {
}
value.onComplete(result);
}
+
+ @BinderThread
+ @Override
+ public void onError(ThrowableHolder throwableHolder) {
+ final Completable.InputBindResult value = unwrap(atomicRef);
+ if (value == null) {
+ return;
+ }
+ value.onError(throwableHolder);
+ }
};
}
}
diff --git a/core/java/com/android/internal/inputmethod/ThrowableHolder.aidl b/core/java/com/android/internal/inputmethod/ThrowableHolder.aidl
new file mode 100644
index 000000000000..ed1129345061
--- /dev/null
+++ b/core/java/com/android/internal/inputmethod/ThrowableHolder.aidl
@@ -0,0 +1,19 @@
+/*
+ * Copyright (C) 2008 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.inputmethod;
+
+parcelable ThrowableHolder; \ No newline at end of file
diff --git a/core/java/com/android/internal/inputmethod/ThrowableHolder.java b/core/java/com/android/internal/inputmethod/ThrowableHolder.java
new file mode 100644
index 000000000000..b6f449864e54
--- /dev/null
+++ b/core/java/com/android/internal/inputmethod/ThrowableHolder.java
@@ -0,0 +1,91 @@
+/*
+ * 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.internal.inputmethod;
+
+import android.annotation.AnyThread;
+import android.annotation.NonNull;
+import android.annotation.Nullable;
+import android.os.Parcel;
+import android.os.Parcelable;
+
+/**
+ * A {@link Parcelable} helper class to encapsulate the exception information.
+ */
+public final class ThrowableHolder implements Parcelable {
+
+ @Nullable
+ private final String mMessage;
+
+ ThrowableHolder(@NonNull Throwable throwable) {
+ mMessage = throwable.getMessage();
+ }
+
+ ThrowableHolder(Parcel source) {
+ mMessage = source.readString();
+ }
+
+ /**
+ * Returns a {@link ThrowableHolder} with given {@link Throwable}.
+ */
+ @NonNull
+ @AnyThread
+ public static ThrowableHolder of(@NonNull Throwable throwable) {
+ return new ThrowableHolder(throwable);
+ }
+
+ /**
+ * Gets the message in this {@link ThrowableHolder}.
+ */
+ @Nullable
+ @AnyThread
+ String getMessage() {
+ return mMessage;
+ }
+
+ @Override
+ public int describeContents() {
+ return 0;
+ }
+
+ /**
+ * Used to package this object into a {@link Parcel}.
+ *
+ * @param dest The {@link Parcel} to be written.
+ * @param flags The flags used for parceling.
+ */
+ @Override
+ public void writeToParcel(Parcel dest, int flags) {
+ dest.writeString(mMessage);
+ }
+
+ /**
+ * Used to make this class parcelable.
+ */
+ public static final Parcelable.Creator<ThrowableHolder> CREATOR =
+ new Parcelable.Creator<ThrowableHolder>() {
+
+ @Override
+ public ThrowableHolder createFromParcel(Parcel source) {
+ return new ThrowableHolder(source);
+ }
+
+ @Override
+ public ThrowableHolder[] newArray(int size) {
+ return new ThrowableHolder[size];
+ }
+ };
+}
diff --git a/core/java/com/android/internal/net/OWNERS b/core/java/com/android/internal/net/OWNERS
index fec56c3cc506..050cb5c2b44e 100644
--- a/core/java/com/android/internal/net/OWNERS
+++ b/core/java/com/android/internal/net/OWNERS
@@ -3,7 +3,7 @@ set noparent
codewiz@google.com
ek@google.com
jchalard@google.com
-jsharkey@google.com
+jsharkey@android.com
lorenzo@google.com
reminv@google.com
satk@google.com
diff --git a/core/java/com/android/internal/notification/OWNERS b/core/java/com/android/internal/notification/OWNERS
new file mode 100644
index 000000000000..396fd1213aca
--- /dev/null
+++ b/core/java/com/android/internal/notification/OWNERS
@@ -0,0 +1 @@
+include /services/core/java/com/android/server/notification/OWNERS
diff --git a/core/java/com/android/internal/os/BatteryUsageStatsProvider.java b/core/java/com/android/internal/os/BatteryUsageStatsProvider.java
index 62e9f98181ab..e1d0a151c723 100644
--- a/core/java/com/android/internal/os/BatteryUsageStatsProvider.java
+++ b/core/java/com/android/internal/os/BatteryUsageStatsProvider.java
@@ -17,13 +17,18 @@
package com.android.internal.os;
import android.content.Context;
-import android.os.BatteryConsumer;
+import android.hardware.SensorManager;
+import android.net.ConnectivityManager;
import android.os.BatteryStats;
import android.os.BatteryUsageStats;
import android.os.Bundle;
+import android.os.SystemClock;
import android.os.UidBatteryConsumer;
+import android.os.UserHandle;
import android.os.UserManager;
+import android.util.SparseArray;
+import java.util.ArrayList;
import java.util.List;
/**
@@ -33,10 +38,53 @@ import java.util.List;
public class BatteryUsageStatsProvider {
private final Context mContext;
private final BatteryStatsImpl mStats;
+ private final PowerProfile mPowerProfile;
+ private final Object mLock = new Object();
+ private List<PowerCalculator> mPowerCalculators;
public BatteryUsageStatsProvider(Context context, BatteryStatsImpl stats) {
mContext = context;
mStats = stats;
+ mPowerProfile = new PowerProfile(mContext);
+ }
+
+ private List<PowerCalculator> getPowerCalculators() {
+ synchronized (mLock) {
+ if (mPowerCalculators == null) {
+ mPowerCalculators = new ArrayList<>();
+
+ // Power calculators are applied in the order of registration
+ mPowerCalculators.add(new CpuPowerCalculator(mPowerProfile));
+ mPowerCalculators.add(new MemoryPowerCalculator(mPowerProfile));
+ mPowerCalculators.add(new WakelockPowerCalculator(mPowerProfile));
+ if (!isWifiOnlyDevice(mContext)) {
+ mPowerCalculators.add(new MobileRadioPowerCalculator(mPowerProfile));
+ }
+ mPowerCalculators.add(new WifiPowerCalculator(mPowerProfile));
+ mPowerCalculators.add(new BluetoothPowerCalculator(mPowerProfile));
+ mPowerCalculators.add(new SensorPowerCalculator(mPowerProfile,
+ mContext.getSystemService(SensorManager.class)));
+ mPowerCalculators.add(new CameraPowerCalculator(mPowerProfile));
+ mPowerCalculators.add(new FlashlightPowerCalculator(mPowerProfile));
+ mPowerCalculators.add(new MediaPowerCalculator(mPowerProfile));
+ mPowerCalculators.add(new PhonePowerCalculator(mPowerProfile));
+ mPowerCalculators.add(new ScreenPowerCalculator(mPowerProfile));
+ mPowerCalculators.add(new AmbientDisplayPowerCalculator(mPowerProfile));
+ mPowerCalculators.add(new SystemServicePowerCalculator(mPowerProfile));
+ mPowerCalculators.add(new IdlePowerCalculator(mPowerProfile));
+
+ mPowerCalculators.add(new UserPowerCalculator());
+ }
+ }
+ return mPowerCalculators;
+ }
+
+ private static boolean isWifiOnlyDevice(Context context) {
+ ConnectivityManager cm = context.getSystemService(ConnectivityManager.class);
+ if (cm == null) {
+ return false;
+ }
+ return !cm.isNetworkSupported(ConnectivityManager.TYPE_MOBILE);
}
/**
@@ -49,11 +97,19 @@ public class BatteryUsageStatsProvider {
false /* collectBatteryBroadcast */);
batteryStatsHelper.create((Bundle) null);
final UserManager userManager = mContext.getSystemService(UserManager.class);
- batteryStatsHelper.refreshStats(BatteryStats.STATS_SINCE_CHARGED,
- userManager.getUserProfiles());
+ final List<UserHandle> asUsers = userManager.getUserProfiles();
+ final int n = asUsers.size();
+ SparseArray<UserHandle> users = new SparseArray<>(n);
+ for (int i = 0; i < n; ++i) {
+ UserHandle userHandle = asUsers.get(i);
+ users.put(userHandle.getIdentifier(), userHandle);
+ }
+
+ batteryStatsHelper.refreshStats(BatteryStats.STATS_SINCE_CHARGED, users);
// TODO(b/174186358): read extra power component number from configuration
final int customPowerComponentCount = 0;
+ final int customTimeComponentCount = 0;
final BatteryUsageStats.Builder batteryUsageStatsBuilder = new BatteryUsageStats.Builder()
.setDischargePercentage(batteryStatsHelper.getStats().getDischargeAmount(0))
.setConsumedPower(batteryStatsHelper.getTotalPower());
@@ -62,15 +118,23 @@ public class BatteryUsageStatsProvider {
for (int i = 0; i < usageList.size(); i++) {
final BatterySipper sipper = usageList.get(i);
if (sipper.drainType == BatterySipper.DrainType.APP) {
- batteryUsageStatsBuilder.addUidBatteryConsumer(
- new UidBatteryConsumer.Builder(customPowerComponentCount, sipper.getUid())
+ batteryUsageStatsBuilder.addUidBatteryConsumerBuilder(
+ new UidBatteryConsumer.Builder(customPowerComponentCount,
+ customTimeComponentCount, sipper.uidObj)
.setPackageWithHighestDrain(sipper.packageWithHighestDrain)
- .setConsumedPower(sipper.sumPower())
- .setConsumedPower(BatteryConsumer.POWER_COMPONENT_CPU,
- sipper.cpuPowerMah)
- .build());
+ .setConsumedPower(sipper.sumPower()));
}
}
+
+ final long realtimeUs = SystemClock.elapsedRealtime() * 1000;
+ final long uptimeUs = SystemClock.uptimeMillis() * 1000;
+
+ final List<PowerCalculator> powerCalculators = getPowerCalculators();
+ for (PowerCalculator powerCalculator : powerCalculators) {
+ powerCalculator.calculate(batteryUsageStatsBuilder, mStats, realtimeUs, uptimeUs,
+ BatteryStats.STATS_SINCE_CHARGED, users);
+ }
+
return batteryUsageStatsBuilder.build();
}
}
diff --git a/core/java/com/android/internal/os/CpuPowerCalculator.java b/core/java/com/android/internal/os/CpuPowerCalculator.java
index dac62a678665..732d2916a092 100644
--- a/core/java/com/android/internal/os/CpuPowerCalculator.java
+++ b/core/java/com/android/internal/os/CpuPowerCalculator.java
@@ -16,6 +16,7 @@
package com.android.internal.os;
import android.os.BatteryStats;
+import android.os.UidBatteryConsumer;
import android.util.ArrayMap;
import android.util.Log;
@@ -30,9 +31,9 @@ public class CpuPowerCalculator extends PowerCalculator {
}
@Override
- protected void calculateApp(BatterySipper app, BatteryStats.Uid u, long rawRealtimeUs,
- long rawUptimeUs, int statsType) {
- app.cpuTimeMs = (u.getUserCpuTimeUs(statsType) + u.getSystemCpuTimeUs(statsType)) / 1000;
+ protected void calculateApp(UidBatteryConsumer.Builder app, BatteryStats.Uid u,
+ long rawRealtimeUs, long rawUptimeUs, int statsType) {
+ long cpuTimeMs = (u.getUserCpuTimeUs(statsType) + u.getSystemCpuTimeUs(statsType)) / 1000;
final int numClusters = mProfile.getNumCpuClusters();
double cpuPowerMaUs = 0;
@@ -70,47 +71,52 @@ public class CpuPowerCalculator extends PowerCalculator {
+ numClusters + " actual # " + cpuClusterTimes.length);
}
}
- app.cpuPowerMah = cpuPowerMaUs / MICROSEC_IN_HR;
+ final double cpuPowerMah = cpuPowerMaUs / MICROSEC_IN_HR;
- if (DEBUG && (app.cpuTimeMs != 0 || app.cpuPowerMah != 0)) {
- Log.d(TAG, "UID " + u.getUid() + ": CPU time=" + app.cpuTimeMs + " ms power="
- + formatCharge(app.cpuPowerMah));
+ if (DEBUG && (cpuTimeMs != 0 || cpuPowerMah != 0)) {
+ Log.d(TAG, "UID " + u.getUid() + ": CPU time=" + cpuTimeMs + " ms power="
+ + formatCharge(cpuPowerMah));
}
// Keep track of the package with highest drain.
double highestDrain = 0;
-
- app.cpuFgTimeMs = 0;
+ String packageWithHighestDrain = null;
+ long cpuFgTimeMs = 0;
final ArrayMap<String, ? extends BatteryStats.Uid.Proc> processStats = u.getProcessStats();
final int processStatsCount = processStats.size();
for (int i = 0; i < processStatsCount; i++) {
final BatteryStats.Uid.Proc ps = processStats.valueAt(i);
final String processName = processStats.keyAt(i);
- app.cpuFgTimeMs += ps.getForegroundTime(statsType);
+ cpuFgTimeMs += ps.getForegroundTime(statsType);
final long costValue = ps.getUserTime(statsType) + ps.getSystemTime(statsType)
+ ps.getForegroundTime(statsType);
// Each App can have multiple packages and with multiple running processes.
// Keep track of the package who's process has the highest drain.
- if (app.packageWithHighestDrain == null ||
- app.packageWithHighestDrain.startsWith("*")) {
+ if (packageWithHighestDrain == null || packageWithHighestDrain.startsWith("*")) {
highestDrain = costValue;
- app.packageWithHighestDrain = processName;
+ packageWithHighestDrain = processName;
} else if (highestDrain < costValue && !processName.startsWith("*")) {
highestDrain = costValue;
- app.packageWithHighestDrain = processName;
+ packageWithHighestDrain = processName;
}
}
+
// Ensure that the CPU times make sense.
- if (app.cpuFgTimeMs > app.cpuTimeMs) {
- if (DEBUG && app.cpuFgTimeMs > app.cpuTimeMs + 10000) {
+ if (cpuFgTimeMs > cpuTimeMs) {
+ if (DEBUG && cpuFgTimeMs > cpuTimeMs + 10000) {
Log.d(TAG, "WARNING! Cputime is more than 10 seconds behind Foreground time");
}
// Statistics may not have been gathered yet.
- app.cpuTimeMs = app.cpuFgTimeMs;
+ cpuTimeMs = cpuFgTimeMs;
}
+
+ app.setConsumedPower(UidBatteryConsumer.POWER_COMPONENT_CPU, cpuPowerMah);
+ app.setUsageDurationMillis(UidBatteryConsumer.TIME_COMPONENT_CPU, cpuTimeMs);
+ app.setUsageDurationMillis(UidBatteryConsumer.TIME_COMPONENT_CPU_FOREGROUND, cpuFgTimeMs);
+ app.setPackageWithHighestDrain(packageWithHighestDrain);
}
}
diff --git a/core/java/com/android/internal/os/OWNERS b/core/java/com/android/internal/os/OWNERS
index 633d093435ee..8f78b2a3a5ea 100644
--- a/core/java/com/android/internal/os/OWNERS
+++ b/core/java/com/android/internal/os/OWNERS
@@ -1 +1,8 @@
+per-file *Power* = file:/services/core/java/com/android/server/power/OWNERS
per-file *Zygote* = file:/ZYGOTE_OWNERS
+
+# BatteryStats
+per-file BatterySipper.java = file:/BATTERY_STATS_OWNERS
+per-file BatteryStats* = file:/BATTERY_STATS_OWNERS
+per-file BatteryUsageStats* = file:/BATTERY_STATS_OWNERS
+per-file *PowerCalculator* = file:/BATTERY_STATS_OWNERS
diff --git a/core/java/com/android/internal/os/PowerCalculator.java b/core/java/com/android/internal/os/PowerCalculator.java
index f171b0d99acc..a57339b84b50 100644
--- a/core/java/com/android/internal/os/PowerCalculator.java
+++ b/core/java/com/android/internal/os/PowerCalculator.java
@@ -16,6 +16,8 @@
package com.android.internal.os;
import android.os.BatteryStats;
+import android.os.BatteryUsageStats;
+import android.os.UidBatteryConsumer;
import android.os.UserHandle;
import android.util.SparseArray;
@@ -55,6 +57,34 @@ public abstract class PowerCalculator {
}
/**
+ * Attributes the total amount of power used by this subsystem to various consumers such
+ * as apps.
+ *
+ * @param builder {@link BatteryUsageStats.Builder that contains a list of
+ * per-UID battery consumer builders for attribution data.
+ * The calculator may modify the builder and its constituent parts.
+ * @param batteryStats The recorded battery stats.
+ * @param rawRealtimeUs The raw system realtime in microseconds.
+ * @param rawUptimeUs The raw system uptime in microseconds.
+ * @param statsType The type of stats. As of {@link android.os.Build.VERSION_CODES#Q}, this
+ * can only be {@link BatteryStats#STATS_SINCE_CHARGED}, since
+ * {@link BatteryStats#STATS_CURRENT} and
+ * {@link BatteryStats#STATS_SINCE_UNPLUGGED} are deprecated.
+ * @param asUsers An array of users for which the attribution is requested. It may
+ * contain {@link UserHandle#USER_ALL} to indicate that the attribution
+ * should be performed for all users.
+ */
+ public void calculate(BatteryUsageStats.Builder builder, BatteryStats batteryStats,
+ long rawRealtimeUs, long rawUptimeUs, int statsType, SparseArray<UserHandle> asUsers) {
+ final List<UidBatteryConsumer.Builder> uidBatteryConsumerBuilders =
+ builder.getUidBatteryConsumerBuilders();
+ for (int i = uidBatteryConsumerBuilders.size() - 1; i >= 0; i--) {
+ final UidBatteryConsumer.Builder app = uidBatteryConsumerBuilders.get(i);
+ calculateApp(app, app.getBatteryStatsUid(), rawRealtimeUs, rawUptimeUs, statsType);
+ }
+ }
+
+ /**
* Calculate the amount of power an app used for this subsystem.
* @param app The BatterySipper that represents the power use of an app.
* @param u The recorded stats for the app.
@@ -66,7 +96,36 @@ public abstract class PowerCalculator {
* {@link BatteryStats#STATS_SINCE_UNPLUGGED} are deprecated.
*/
protected void calculateApp(BatterySipper app, BatteryStats.Uid u, long rawRealtimeUs,
- long rawUptimeUs, int statsType) {}
+ long rawUptimeUs, int statsType) {
+
+ // TODO(b/175156498): Temporary code during the transition from BatterySippers to
+ // BatteryConsumers.
+ UidBatteryConsumer.Builder builder = new UidBatteryConsumer.Builder(0, 0, u);
+ calculateApp(builder, u, rawRealtimeUs, rawUptimeUs, statsType);
+ final UidBatteryConsumer uidBatteryConsumer = builder.build();
+ app.cpuPowerMah = uidBatteryConsumer.getConsumedPower(
+ UidBatteryConsumer.POWER_COMPONENT_CPU);
+ app.cpuTimeMs = uidBatteryConsumer.getUsageDurationMillis(
+ UidBatteryConsumer.TIME_COMPONENT_CPU);
+ app.cpuFgTimeMs = uidBatteryConsumer.getUsageDurationMillis(
+ UidBatteryConsumer.TIME_COMPONENT_CPU_FOREGROUND);
+ app.packageWithHighestDrain = uidBatteryConsumer.getPackageWithHighestDrain();
+ }
+
+ /**
+ * Calculate the amount of power an app used for this subsystem.
+ * @param app The UidBatteryConsumer.Builder that represents the power use of an app.
+ * @param u The recorded stats for the app.
+ * @param rawRealtimeUs The raw system realtime in microseconds.
+ * @param rawUptimeUs The raw system uptime in microseconds.
+ * @param statsType The type of stats. As of {@link android.os.Build.VERSION_CODES#Q}, this can
+ * only be {@link BatteryStats#STATS_SINCE_CHARGED}, since
+ * {@link BatteryStats#STATS_CURRENT} and
+ * {@link BatteryStats#STATS_SINCE_UNPLUGGED} are deprecated.
+ */
+ protected void calculateApp(UidBatteryConsumer.Builder app, BatteryStats.Uid u,
+ long rawRealtimeUs, long rawUptimeUs, int statsType) {
+ }
/**
* Reset any state maintained in this calculator.
diff --git a/core/java/com/android/internal/telephony/OWNERS b/core/java/com/android/internal/telephony/OWNERS
new file mode 100644
index 000000000000..640baf2297b4
--- /dev/null
+++ b/core/java/com/android/internal/telephony/OWNERS
@@ -0,0 +1 @@
+include /telephony/OWNERS
diff --git a/core/java/com/android/internal/util/LatencyTracker.java b/core/java/com/android/internal/util/LatencyTracker.java
index 8012540ed314..254c2997fa65 100644
--- a/core/java/com/android/internal/util/LatencyTracker.java
+++ b/core/java/com/android/internal/util/LatencyTracker.java
@@ -86,6 +86,11 @@ public class LatencyTracker {
*/
public static final int ACTION_FACE_WAKE_AND_UNLOCK = 7;
+ /**
+ * Time between the swipe-up gesture and window drawn of recents activity.
+ */
+ public static final int ACTION_START_RECENTS_ANIMATION = 8;
+
private static final String[] NAMES = new String[]{
"expand panel",
"toggle recents",
@@ -94,7 +99,9 @@ public class LatencyTracker {
"check credential unlocked",
"turn on screen",
"rotate the screen",
- "face wake-and-unlock"};
+ "face wake-and-unlock",
+ "start recents-animation",
+ };
private static final int[] STATSD_ACTION = new int[]{
FrameworkStatsLog.UIACTION_LATENCY_REPORTED__ACTION__ACTION_EXPAND_PANEL,
@@ -105,6 +112,7 @@ public class LatencyTracker {
FrameworkStatsLog.UIACTION_LATENCY_REPORTED__ACTION__ACTION_TURN_ON_SCREEN,
FrameworkStatsLog.UIACTION_LATENCY_REPORTED__ACTION__ACTION_ROTATE_SCREEN,
FrameworkStatsLog.UIACTION_LATENCY_REPORTED__ACTION__ACTION_FACE_WAKE_AND_UNLOCK,
+ FrameworkStatsLog.UIACTION_LATENCY_REPORTED__ACTION__ACTION_START_RECENTS_ANIMATION,
};
private static LatencyTracker sLatencyTracker;
@@ -170,6 +178,8 @@ public class LatencyTracker {
return "ACTION_ROTATE_SCREEN";
case 8:
return "ACTION_FACE_WAKE_AND_UNLOCK";
+ case 9:
+ return "ACTION_START_RECENTS_ANIMATION";
default:
throw new IllegalArgumentException("Invalid action");
}
diff --git a/core/java/com/android/internal/util/dump/DualDumpOutputStream.java b/core/java/com/android/internal/util/dump/DualDumpOutputStream.java
index 3ac38edaddb4..20419db80e88 100644
--- a/core/java/com/android/internal/util/dump/DualDumpOutputStream.java
+++ b/core/java/com/android/internal/util/dump/DualDumpOutputStream.java
@@ -18,11 +18,10 @@ package com.android.internal.util.dump;
import android.annotation.NonNull;
import android.annotation.Nullable;
+import android.util.IndentingPrintWriter;
import android.util.Log;
import android.util.proto.ProtoOutputStream;
-import com.android.internal.util.IndentingPrintWriter;
-
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.Arrays;
diff --git a/core/java/com/android/internal/view/OWNERS b/core/java/com/android/internal/view/OWNERS
new file mode 100644
index 000000000000..99a76861c542
--- /dev/null
+++ b/core/java/com/android/internal/view/OWNERS
@@ -0,0 +1,5 @@
+# Bug component: 25700
+
+file:/core/java/android/view/OWNERS
+
+per-file *Input* = file:/services/core/java/com/android/server/inputmethod/OWNERS \ No newline at end of file
diff --git a/core/jni/OWNERS b/core/jni/OWNERS
index bcd1278d87e7..804829801b29 100644
--- a/core/jni/OWNERS
+++ b/core/jni/OWNERS
@@ -6,15 +6,19 @@ per-file *Camera*,*camera* = shuzhenwang@google.com, yinchiayeh@google.com, zhij
per-file android_net_* = codewiz@google.com, jchalard@google.com, lorenzo@google.com, reminv@google.com, satk@google.com
# Display
-per-file android_hardware_display_* = michaelwr@google.com, santoscordon@google.com
+per-file android_hardware_display_* = file:/services/core/java/com/android/server/display/OWNERS
# Input
-per-file android_hardware_input* = michaelwr@google.com, svv@google.com
-per-file android_view_Input* = michaelwr@google.com, svv@google.com
-per-file android_view_KeyCharacterMap.* = michaelwr@google.com, svv@google.com
-per-file android_view_*KeyEvent.* = michaelwr@google.com, svv@google.com
-per-file android_view_*MotionEvent.* = michaelwr@google.com, svv@google.com
-per-file android_view_PointerIcon.* = michaelwr@google.com, svv@google.com
+per-file android_hardware_input* = file:/services/core/java/com/android/server/input/OWNERS
+per-file android_view_Input* = file:/services/core/java/com/android/server/input/OWNERS
+per-file android_view_KeyCharacterMap.* = file:/services/core/java/com/android/server/input/OWNERS
+per-file android_view_*KeyEvent.* = file:/services/core/java/com/android/server/input/OWNERS
+per-file android_view_*MotionEvent.* = file:/services/core/java/com/android/server/input/OWNERS
+per-file android_view_PointerIcon.* = file:/services/core/java/com/android/server/input/OWNERS
+
+# WindowManager
+per-file android_graphics_BLASTBufferQueue.cpp = file:/services/core/java/com/android/server/wm/OWNERS
+per-file android_view_Surface* = file:/services/core/java/com/android/server/wm/OWNERS
per-file *Zygote* = file:/ZYGOTE_OWNERS
per-file Android.bp = file:platform/build/soong:/OWNERS
diff --git a/core/jni/android_media_AudioSystem.cpp b/core/jni/android_media_AudioSystem.cpp
index b1b0284e5295..a95ee4f12c51 100644
--- a/core/jni/android_media_AudioSystem.cpp
+++ b/core/jni/android_media_AudioSystem.cpp
@@ -2083,10 +2083,9 @@ android_media_AudioSystem_getStreamVolumeDB(JNIEnv *env, jobject thiz,
(audio_devices_t)device);
}
-static jboolean
-android_media_AudioSystem_isOffloadSupported(JNIEnv *env, jobject thiz,
- jint encoding, jint sampleRate, jint channelMask, jint channelIndexMask, jint streamType)
-{
+static jint android_media_AudioSystem_getOffloadSupport(JNIEnv *env, jobject thiz, jint encoding,
+ jint sampleRate, jint channelMask,
+ jint channelIndexMask, jint streamType) {
audio_offload_info_t format = AUDIO_INFO_INITIALIZER;
format.format = (audio_format_t) audioFormatToNative(encoding);
format.sample_rate = (uint32_t) sampleRate;
@@ -2098,7 +2097,7 @@ android_media_AudioSystem_isOffloadSupported(JNIEnv *env, jobject thiz,
// client side code cannot access "audio.offload.min.duration.secs" property to make a query
// agnostic of duration, so using acceptable estimate of 2mn
format.duration_us = 120 * 1000000;
- return AudioSystem::isOffloadSupported(format);
+ return AudioSystem::getOffloadSupport(format);
}
static jint
@@ -2574,8 +2573,8 @@ static const JNINativeMethod gMethods[] =
(void *)android_media_AudioSystem_registerRecordingCallback},
{"systemReady", "()I", (void *)android_media_AudioSystem_systemReady},
{"getStreamVolumeDB", "(III)F", (void *)android_media_AudioSystem_getStreamVolumeDB},
- {"native_is_offload_supported", "(IIIII)Z",
- (void *)android_media_AudioSystem_isOffloadSupported},
+ {"native_get_offload_support", "(IIIII)I",
+ (void *)android_media_AudioSystem_getOffloadSupport},
{"getMicrophones", "(Ljava/util/ArrayList;)I",
(void *)android_media_AudioSystem_getMicrophones},
{"getSurroundFormats", "(Ljava/util/Map;Z)I",
diff --git a/core/proto/android/hardware/sensorprivacy.proto b/core/proto/android/hardware/sensorprivacy.proto
new file mode 100644
index 000000000000..07e938ddfc5d
--- /dev/null
+++ b/core/proto/android/hardware/sensorprivacy.proto
@@ -0,0 +1,50 @@
+/*
+ * 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.
+ */
+
+syntax = "proto2";
+package android.service;
+
+option java_multiple_files = true;
+option java_outer_classname = "SensorPrivacyServiceProto";
+
+import "frameworks/base/core/proto/android/privacy.proto";
+
+message SensorPrivacyServiceDumpProto {
+ option (android.msg_privacy).dest = DEST_AUTOMATIC;
+
+ // Is global sensor privacy enabled
+ optional bool is_enabled = 1;
+
+ // Per sensor privacy enabled
+ repeated SensorPrivacyIndividualEnabledSensorProto individual_enabled_sensor = 2;
+}
+
+message SensorPrivacyIndividualEnabledSensorProto {
+ option (android.msg_privacy).dest = DEST_AUTOMATIC;
+
+ enum Sensor {
+ UNKNOWN = 0;
+
+ MICROPHONE = 1;
+ CAMERA = 2;
+ }
+
+ // Sensor for which privacy might be enabled
+ optional Sensor sensor = 1;
+
+ // If sensor privacy is enabled for this sensor
+ optional bool is_enabled = 2;
+} \ No newline at end of file
diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml
index fc0f63835e27..ef7edc2f2dd2 100644
--- a/core/res/AndroidManifest.xml
+++ b/core/res/AndroidManifest.xml
@@ -2259,7 +2259,9 @@
<!-- Allows to query ongoing call details and manage ongoing calls
<p>Protection level: signature|appop -->
<permission android:name="android.permission.MANAGE_ONGOING_CALLS"
- android:protectionLevel="signature|appop" />
+ android:protectionLevel="signature|appop"
+ android:label="@string/permlab_manageOngoingCalls"
+ android:description="@string/permdesc_manageOngoingCalls" />
<!-- Allows the app to request network scans from telephony.
<p>Not for use by third-party applications.
@@ -2730,6 +2732,10 @@
<permission android:name="android.permission.TOGGLE_AUTOMOTIVE_PROJECTION"
android:protectionLevel="signature|privileged" />
+ <!-- Allows an app to prevent non-system-overlay windows from being drawn on top of it -->
+ <permission android:name="android.permission.HIDE_OVERLAY_WINDOWS"
+ android:protectionLevel="normal" />
+
<!-- ================================== -->
<!-- Permissions affecting the system wallpaper -->
<!-- ================================== -->
@@ -3284,6 +3290,7 @@
{@link android.view.WindowManager.LayoutsParams#SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS}
to hide non-system-overlay windows.
<p>Not for use by third-party applications.
+ @deprecated Use {@link android.Manifest.permission#HIDE_OVERLAY_WINDOWS} instead
@hide
-->
<permission android:name="android.permission.HIDE_NON_SYSTEM_OVERLAY_WINDOWS"
@@ -3962,6 +3969,12 @@
<permission android:name="android.permission.MANAGE_COMPANION_DEVICES"
android:protectionLevel="signature" />
+ <!-- Allows an application to subscribe to notifications about the presence status change
+ of their associated companion device
+ -->
+ <permission android:name="android.permission.REQUEST_OBSERVE_COMPANION_DEVICE_PRESENCE"
+ android:protectionLevel="normal" />
+
<!-- @SystemApi Allows an application to use SurfaceFlinger's low level features.
<p>Not for use by third-party applications.
@hide
@@ -4639,7 +4652,7 @@
<!-- Allows access to keyguard secure storage. Only allowed for system processes.
@hide -->
<permission android:name="android.permission.ACCESS_KEYGUARD_SECURE_STORAGE"
- android:protectionLevel="signature" />
+ android:protectionLevel="signature|setup" />
<!-- Allows applications to set the initial lockscreen state.
<p>Not for use by third-party applications. @hide -->
diff --git a/core/res/res/drawable-car/car_button_background.xml b/core/res/res/drawable-car/car_button_background.xml
index 3e2610c5047b..e568aebfe81d 100644
--- a/core/res/res/drawable-car/car_button_background.xml
+++ b/core/res/res/drawable-car/car_button_background.xml
@@ -13,24 +13,48 @@ 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.
-->
-<!-- Default background styles for car buttons when enabled/disabled. -->
-<ripple
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:color="?android:attr/colorControlHighlight">
+<!-- Default background styles for car buttons when enabled/disabled,
+ focused/unfocused, and pressed/unpressed -->
+<!-- TODO(b/175161842) Add rotary fill color -->
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:state_focused="true" android:state_enabled="false">
+ <shape android:shape="rectangle">
+ <corners android:radius="@*android:dimen/car_button_radius"/>
+ <solid android:color="@*android:color/car_grey_300"/>
+ <stroke android:width="8dp"
+ android:color="#0059B3"/>
+ </shape>
+ </item>
+ <item android:state_focused="true" android:state_pressed="true">
+ <shape android:shape="rectangle">
+ <corners android:radius="@*android:dimen/car_button_radius"/>
+ <solid android:color="?android:attr/colorButtonNormal"/>
+ <stroke android:width="4dp"
+ android:color="#0059B3"/>
+ </shape>
+ </item>
+ <item android:state_focused="true">
+ <shape android:shape="rectangle">
+ <corners android:radius="@*android:dimen/car_button_radius"/>
+ <solid android:color="?android:attr/colorButtonNormal"/>
+ <stroke android:width="8dp"
+ android:color="#0059B3"/>
+ </shape>
+ </item>
+ <item android:state_enabled="false">
+ <shape android:shape="rectangle">
+ <corners android:radius="@*android:dimen/car_button_radius"/>
+ <solid android:color="@*android:color/car_grey_300"/>
+ </shape>
+ </item>
<item>
- <selector>
- <item android:state_enabled="false">
- <shape android:shape="rectangle">
- <corners android:radius="@*android:dimen/car_button_radius"/>
- <solid android:color="@*android:color/car_grey_300"/>
- </shape>
- </item>
+ <ripple android:color="?android:attr/colorControlHighlight">
<item>
<shape android:shape="rectangle">
<corners android:radius="@*android:dimen/car_button_radius"/>
<solid android:color="?android:attr/colorButtonNormal"/>
</shape>
</item>
- </selector>
+ </ripple>
</item>
-</ripple>
+</selector>
diff --git a/core/res/res/drawable-car/car_switch_thumb.xml b/core/res/res/drawable-car/car_switch_thumb.xml
index 03efc189aa95..66cf4438418d 100644
--- a/core/res/res/drawable-car/car_switch_thumb.xml
+++ b/core/res/res/drawable-car/car_switch_thumb.xml
@@ -14,12 +14,15 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-
-<shape
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:shape="oval">
- <solid android:color="@color/car_switch"/>
- <size
- android:width="@dimen/car_seekbar_thumb_size"
- android:height="@dimen/car_seekbar_thumb_size"/>
-</shape>
+<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:gravity="center_vertical|fill_horizontal"
+ android:top="@dimen/car_switch_thumb_margin_size"
+ android:bottom="@dimen/car_switch_thumb_margin_size">
+ <shape android:shape="oval">
+ <solid android:color="@color/car_switch"/>
+ <size
+ android:width="@dimen/car_switch_thumb_size"
+ android:height="@dimen/car_switch_thumb_size"/>
+ </shape>
+ </item>
+</layer-list>
diff --git a/core/res/res/drawable-car/car_switch_track.xml b/core/res/res/drawable-car/car_switch_track.xml
new file mode 100644
index 000000000000..cb0b9beeeab6
--- /dev/null
+++ b/core/res/res/drawable-car/car_switch_track.xml
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright 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.
+-->
+<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
+ <item
+ android:height="@dimen/car_touch_target_size_minus_one"
+ android:width="@dimen/car_touch_target_size_minus_one"
+ android:gravity="center">
+ <selector>
+ <item android:state_focused="true" android:state_pressed="true">
+ <shape android:shape="oval">
+ <solid android:color="#8A94CBFF"/>
+ <stroke android:width="4dp"
+ android:color="#94CBFF"/>
+ </shape>
+ </item>
+ <item android:state_focused="true">
+ <shape android:shape="oval">
+ <solid android:color="#3D94CBFF"/>
+ <stroke android:width="8dp"
+ android:color="#94CBFF"/>
+ </shape>
+ </item>
+ </selector>
+ </item>
+ <item android:gravity="center_vertical|fill_horizontal"
+ android:left="@dimen/car_switch_track_margin_size"
+ android:right="@dimen/car_switch_track_margin_size">
+ <shape
+ android:shape="rectangle"
+ android:tint="@color/switch_track_material">
+ <corners android:radius="7dp" />
+ <solid android:color="@color/white_disabled_material" />
+ <size android:height="14dp" />
+ <padding
+ android:right="@dimen/car_switch_track_margin_size"
+ android:left="@dimen/car_switch_track_margin_size"/>
+ </shape>
+ </item>
+</layer-list>
diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml
index 3d0c5f1a68fe..fab65d05e69f 100644
--- a/core/res/res/values/config.xml
+++ b/core/res/res/values/config.xml
@@ -3302,6 +3302,10 @@
is non-interactive. -->
<bool name="config_cameraDoubleTapPowerGestureEnabled">true</bool>
+ <!-- Allow the gesture to quick tap the power button multiple times to start the emergency sos
+ experience while the device is non-interactive. -->
+ <bool name="config_emergencyGestureEnabled">true</bool>
+
<!-- Allow the gesture power + volume up to change the ringer mode while the device
is interactive. -->
<bool name="config_volumeHushGestureEnabled">true</bool>
@@ -4569,6 +4573,6 @@
<!-- Indicates that default fitness tracker app needs to request sensor and location permissions. -->
<bool name="config_trackerAppNeedsPermissions">false</bool>
- <!-- Component with platform query permissions for AppSearch -->
- <string name="config_defaultAppSearchPlatformQuerierComponent" translatable="false"></string>
+ <!-- Package with global data query permissions for AppSearch -->
+ <string name="config_globalAppSearchDataQuerierPackage" translatable="false"></string>
</resources>
diff --git a/core/res/res/values/dimens_car.xml b/core/res/res/values/dimens_car.xml
index 2c4f4c89ab81..c3cd80b1edda 100644
--- a/core/res/res/values/dimens_car.xml
+++ b/core/res/res/values/dimens_car.xml
@@ -84,6 +84,14 @@
<dimen name="car_button_radius">@dimen/car_radius_1</dimen>
<dimen name="car_pill_button_size">56dp</dimen>
<dimen name="car_touch_target_size">76dp</dimen>
+ <dimen name="car_touch_target_size_minus_one">75dp</dimen>
+
+ <!-- Switch. -->
+ <!-- Thumb size + 2*thumb margin size must equal car_touch_target_size -->
+ <!-- 2 * Thumb size + 2*track margin size must equal car_touch_target_size -->
+ <dimen name="car_switch_thumb_size">24dp</dimen>
+ <dimen name="car_switch_thumb_margin_size">26dp</dimen>
+ <dimen name="car_switch_track_margin_size">14dp</dimen>
<!-- Seekbar -->
<dimen name="car_seekbar_height">6dp</dimen>
diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml
index 89b986b8fcb8..31aee4a2e8b4 100644
--- a/core/res/res/values/strings.xml
+++ b/core/res/res/values/strings.xml
@@ -928,6 +928,15 @@
interfere with the performance or operation of your device when an
emergency cell broadcast is received.</string>
+ <!-- Title for an application which grants an app the ability to see and manage calls on
+ the user's device. Usually reserved for apps associated with wearable devices that
+ can show information about calls. -->
+ <string name="permlab_manageOngoingCalls">Manage ongoing calls</string>
+ <!-- Description of an application permission, listed so the user can choose whether they
+ want to allow the application to do this. -->
+ <string name="permdesc_manageOngoingCalls">Allows an app to see details about ongoing calls
+ on your device and to control these calls.</string>
+
<!-- Title of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
<string name="permlab_readCellBroadcasts">read cell broadcast messages</string>
<!-- Description of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml
index 9a08a494021b..611808d6c5e7 100644
--- a/core/res/res/values/symbols.xml
+++ b/core/res/res/values/symbols.xml
@@ -2823,6 +2823,7 @@
<java-symbol type="bool" name="config_cameraDoubleTapPowerGestureEnabled" />
<java-symbol type="integer" name="config_cameraLiftTriggerSensorType" />
<java-symbol type="string" name="config_cameraLiftTriggerSensorStringType" />
+ <java-symbol type="bool" name="config_emergencyGestureEnabled" />
<java-symbol type="bool" name="config_volumeHushGestureEnabled" />
<java-symbol type="drawable" name="platlogo_m" />
@@ -4115,8 +4116,8 @@
<java-symbol type="bool" name="config_trackerAppNeedsPermissions"/>
- <!-- Component with platform query permissions for AppSearch -->
- <java-symbol type="string" name="config_defaultAppSearchPlatformQuerierComponent" />
+ <!-- Package with global data query permissions for AppSearch -->
+ <java-symbol type="string" name="config_globalAppSearchDataQuerierPackage" />
<!-- Color used by the accessibility focus rectangle -->
<java-symbol type="color" name="accessibility_focus_highlight_color" />
diff --git a/core/tests/powertests/PowerStatsLoadTests/Android.bp b/core/tests/batterystatstests/BatteryStatsLoadTests/Android.bp
index 66c91adc6540..ade97b81e775 100644
--- a/core/tests/powertests/PowerStatsLoadTests/Android.bp
+++ b/core/tests/batterystatstests/BatteryStatsLoadTests/Android.bp
@@ -1,5 +1,5 @@
android_test {
- name: "PowerStatsLoadTests",
+ name: "BatteryStatsLoadTests",
srcs: ["src/**/*.java"],
static_libs: [
"androidx.test.rules",
diff --git a/core/tests/powertests/PowerStatsLoadTests/AndroidManifest.xml b/core/tests/batterystatstests/BatteryStatsLoadTests/AndroidManifest.xml
index 9cecaedf1380..adc20c6ae496 100644
--- a/core/tests/powertests/PowerStatsLoadTests/AndroidManifest.xml
+++ b/core/tests/batterystatstests/BatteryStatsLoadTests/AndroidManifest.xml
@@ -16,7 +16,7 @@
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="com.android.frameworks.core.powerstatsloadtests">
+ package="com.android.frameworks.core.batterystatsloadtests">
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
@@ -27,7 +27,7 @@
<instrumentation
android:name="androidx.test.runner.AndroidJUnitRunner"
- android:targetPackage="com.android.frameworks.core.powerstatsloadtests"
+ android:targetPackage="com.android.frameworks.core.batterystatsloadtests"
android:label="Power Stats Load Tests" />
<queries>
diff --git a/core/tests/powertests/PowerStatsLoadTests/src/com/android/frameworks/core/powerstatsloadtests/ConnectivitySetupRule.java b/core/tests/batterystatstests/BatteryStatsLoadTests/src/com/android/frameworks/core/batterystatsloadtests/ConnectivitySetupRule.java
index ca2942647f08..1afc22b7406d 100644
--- a/core/tests/powertests/PowerStatsLoadTests/src/com/android/frameworks/core/powerstatsloadtests/ConnectivitySetupRule.java
+++ b/core/tests/batterystatstests/BatteryStatsLoadTests/src/com/android/frameworks/core/batterystatsloadtests/ConnectivitySetupRule.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.frameworks.core.powerstatsloadtests;
+package com.android.frameworks.core.batterystatsloadtests;
import static org.junit.Assert.assertEquals;
diff --git a/core/tests/powertests/PowerStatsLoadTests/src/com/android/frameworks/core/powerstatsloadtests/PowerMetrics.java b/core/tests/batterystatstests/BatteryStatsLoadTests/src/com/android/frameworks/core/batterystatsloadtests/PowerMetrics.java
index 88cb719add60..dbe5773a3107 100644
--- a/core/tests/powertests/PowerStatsLoadTests/src/com/android/frameworks/core/powerstatsloadtests/PowerMetrics.java
+++ b/core/tests/batterystatstests/BatteryStatsLoadTests/src/com/android/frameworks/core/batterystatsloadtests/PowerMetrics.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.frameworks.core.powerstatsloadtests;
+package com.android.frameworks.core.batterystatsloadtests;
import android.os.Process;
diff --git a/core/tests/powertests/PowerStatsLoadTests/src/com/android/frameworks/core/powerstatsloadtests/PowerMetricsCollector.java b/core/tests/batterystatstests/BatteryStatsLoadTests/src/com/android/frameworks/core/batterystatsloadtests/PowerMetricsCollector.java
index a71559b5ad6b..254458cc8935 100644
--- a/core/tests/powertests/PowerStatsLoadTests/src/com/android/frameworks/core/powerstatsloadtests/PowerMetricsCollector.java
+++ b/core/tests/batterystatstests/BatteryStatsLoadTests/src/com/android/frameworks/core/batterystatsloadtests/PowerMetricsCollector.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.frameworks.core.powerstatsloadtests;
+package com.android.frameworks.core.batterystatsloadtests;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
@@ -106,6 +106,7 @@ public class PowerMetricsCollector implements TestRule {
mContext = instrumentation.getContext();
mUid = Process.myUid();
mUserManager = mContext.getSystemService(UserManager.class);
+ // TODO(b/175324611): Use BatteryUsageStats instead
mStatsHelper = new BatteryStatsHelper(mContext, false /* collectBatteryBroadcast */);
mStatsHelper.create((Bundle) null);
}
diff --git a/core/tests/powertests/PowerStatsLoadTests/src/com/android/frameworks/core/powerstatsloadtests/SystemServiceCallLoadTest.java b/core/tests/batterystatstests/BatteryStatsLoadTests/src/com/android/frameworks/core/batterystatsloadtests/SystemServiceCallLoadTest.java
index 911ccba3ac78..488469d54f29 100644
--- a/core/tests/powertests/PowerStatsLoadTests/src/com/android/frameworks/core/powerstatsloadtests/SystemServiceCallLoadTest.java
+++ b/core/tests/batterystatstests/BatteryStatsLoadTests/src/com/android/frameworks/core/batterystatsloadtests/SystemServiceCallLoadTest.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.frameworks.core.powerstatsloadtests;
+package com.android.frameworks.core.batterystatsloadtests;
import static org.junit.Assert.assertNotNull;
diff --git a/core/tests/powertests/PowerStatsLoadTests/src/com/android/frameworks/core/powerstatsloadtests/WiFiLoadTest.java b/core/tests/batterystatstests/BatteryStatsLoadTests/src/com/android/frameworks/core/batterystatsloadtests/WiFiLoadTest.java
index 90627192946d..27495da8d839 100644
--- a/core/tests/powertests/PowerStatsLoadTests/src/com/android/frameworks/core/powerstatsloadtests/WiFiLoadTest.java
+++ b/core/tests/batterystatstests/BatteryStatsLoadTests/src/com/android/frameworks/core/batterystatsloadtests/WiFiLoadTest.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.frameworks.core.powerstatsloadtests;
+package com.android.frameworks.core.batterystatsloadtests;
import android.util.Log;
diff --git a/core/tests/powertests/PowerStatsViewer/Android.bp b/core/tests/batterystatstests/BatteryStatsViewer/Android.bp
index a3dc4fb4ff74..1e0498be5800 100644
--- a/core/tests/powertests/PowerStatsViewer/Android.bp
+++ b/core/tests/batterystatstests/BatteryStatsViewer/Android.bp
@@ -1,5 +1,5 @@
android_test {
- name: "PowerStatsViewer",
+ name: "BatteryStatsViewer",
srcs: ["src/**/*.java"],
defaults: ["SettingsLibDefaults"],
static_libs: [
diff --git a/core/tests/powertests/PowerStatsViewer/AndroidManifest.xml b/core/tests/batterystatstests/BatteryStatsViewer/AndroidManifest.xml
index 28ea05fca61e..edb1b108b7bc 100644
--- a/core/tests/powertests/PowerStatsViewer/AndroidManifest.xml
+++ b/core/tests/batterystatstests/BatteryStatsViewer/AndroidManifest.xml
@@ -16,7 +16,7 @@
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="com.android.frameworks.core.powerstatsviewer"
+ package="com.android.frameworks.core.batterystatsviewer"
android:sharedUserId="android.uid.system">
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
@@ -24,9 +24,9 @@
<application
android:theme="@style/Theme"
- android:label="Power Stats Viewer">
- <activity android:name=".PowerStatsViewerActivity"
- android:label="Power Stats Viewer"
+ android:label="Battery Stats Viewer">
+ <activity android:name=".BatteryStatsViewerActivity"
+ android:label="Battery Stats Viewer"
android:launchMode="singleTop"
android:exported="true">
<intent-filter>
@@ -35,7 +35,7 @@
</intent-filter>
</activity>
- <activity android:name=".PowerConsumerPickerActivity"
- android:label="Select a power consumer"/>
+ <activity android:name=".BatteryConsumerPickerActivity"
+ android:label="Select a battery consumer"/>
</application>
</manifest>
diff --git a/core/tests/powertests/PowerStatsViewer/res/layout/power_stats_entry_layout.xml b/core/tests/batterystatstests/BatteryStatsViewer/res/layout/battery_consumer_entry_layout.xml
index 1ced825adf31..1ced825adf31 100644
--- a/core/tests/powertests/PowerStatsViewer/res/layout/power_stats_entry_layout.xml
+++ b/core/tests/batterystatstests/BatteryStatsViewer/res/layout/battery_consumer_entry_layout.xml
diff --git a/core/tests/powertests/PowerStatsViewer/res/layout/power_consumer_info_layout.xml b/core/tests/batterystatstests/BatteryStatsViewer/res/layout/battery_consumer_info_layout.xml
index fbd0ebd61bc7..fbd0ebd61bc7 100644
--- a/core/tests/powertests/PowerStatsViewer/res/layout/power_consumer_info_layout.xml
+++ b/core/tests/batterystatstests/BatteryStatsViewer/res/layout/battery_consumer_info_layout.xml
diff --git a/core/tests/powertests/PowerStatsViewer/res/layout/power_consumer_picker_activity_layout.xml b/core/tests/batterystatstests/BatteryStatsViewer/res/layout/battery_consumer_picker_activity_layout.xml
index ecc89f0cb33e..ecc89f0cb33e 100644
--- a/core/tests/powertests/PowerStatsViewer/res/layout/power_consumer_picker_activity_layout.xml
+++ b/core/tests/batterystatstests/BatteryStatsViewer/res/layout/battery_consumer_picker_activity_layout.xml
diff --git a/core/tests/powertests/PowerStatsViewer/res/layout/power_consumer_picker_layout.xml b/core/tests/batterystatstests/BatteryStatsViewer/res/layout/battery_consumer_picker_layout.xml
index bea38c18c20b..bea38c18c20b 100644
--- a/core/tests/powertests/PowerStatsViewer/res/layout/power_consumer_picker_layout.xml
+++ b/core/tests/batterystatstests/BatteryStatsViewer/res/layout/battery_consumer_picker_layout.xml
diff --git a/core/tests/powertests/PowerStatsViewer/res/layout/power_stats_viewer_layout.xml b/core/tests/batterystatstests/BatteryStatsViewer/res/layout/battery_stats_viewer_layout.xml
index 238e238deeaa..e58a08fd362c 100644
--- a/core/tests/powertests/PowerStatsViewer/res/layout/power_stats_viewer_layout.xml
+++ b/core/tests/batterystatstests/BatteryStatsViewer/res/layout/battery_stats_viewer_layout.xml
@@ -42,13 +42,13 @@
android:paddingStart="10dp"
android:paddingEnd="10dp">
- <include layout="@layout/power_consumer_info_layout"/>
+ <include layout="@layout/battery_consumer_info_layout"/>
</LinearLayout>
</androidx.cardview.widget.CardView>
<androidx.recyclerview.widget.RecyclerView
- android:id="@+id/power_stats_data_view"
+ android:id="@+id/battery_consumer_data_view"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"/>
@@ -59,7 +59,7 @@
android:layout_height="match_parent"
android:gravity="center"
android:visibility="gone"
- android:text="No power stats available"/>
+ android:text="No battery stats available"/>
</LinearLayout>
<FrameLayout
diff --git a/core/tests/powertests/PowerStatsViewer/res/values/styles.xml b/core/tests/batterystatstests/BatteryStatsViewer/res/values/styles.xml
index 629d729e7b9a..629d729e7b9a 100644
--- a/core/tests/powertests/PowerStatsViewer/res/values/styles.xml
+++ b/core/tests/batterystatstests/BatteryStatsViewer/res/values/styles.xml
diff --git a/core/tests/powertests/PowerStatsViewer/src/com/android/frameworks/core/powerstatsviewer/PowerStatsData.java b/core/tests/batterystatstests/BatteryStatsViewer/src/com/android/frameworks/core/batterystatsviewer/BatteryConsumerData.java
index 7aeb86ae0cb1..b077ea313b9d 100644
--- a/core/tests/powertests/PowerStatsViewer/src/com/android/frameworks/core/powerstatsviewer/PowerStatsData.java
+++ b/core/tests/batterystatstests/BatteryStatsViewer/src/com/android/frameworks/core/batterystatsviewer/BatteryConsumerData.java
@@ -14,11 +14,15 @@
* limitations under the License.
*/
-package com.android.frameworks.core.powerstatsviewer;
+package com.android.frameworks.core.batterystatsviewer;
import android.content.Context;
+import android.os.BatteryConsumer;
import android.os.BatteryStats;
+import android.os.BatteryUsageStats;
import android.os.Process;
+import android.os.UidBatteryConsumer;
+import android.os.UserHandle;
import com.android.internal.os.BatterySipper;
import com.android.internal.os.BatteryStatsHelper;
@@ -26,7 +30,7 @@ import com.android.internal.os.BatteryStatsHelper;
import java.util.ArrayList;
import java.util.List;
-public class PowerStatsData {
+public class BatteryConsumerData {
private static final String PACKAGE_CALENDAR_PROVIDER = "com.android.providers.calendar";
private static final String PACKAGE_MEDIA_PROVIDER = "com.android.providers.media";
private static final String PACKAGE_SYSTEMUI = "com.android.systemui";
@@ -54,11 +58,11 @@ public class PowerStatsData {
public double total;
}
- private final PowerConsumerInfoHelper.PowerConsumerInfo mPowerConsumerInfo;
+ private final BatteryConsumerInfoHelper.BatteryConsumerInfo mBatteryConsumerInfo;
private final List<Entry> mEntries = new ArrayList<>();
- public PowerStatsData(Context context, BatteryStatsHelper batteryStatsHelper,
- String powerConsumerId) {
+ public BatteryConsumerData(Context context, BatteryStatsHelper batteryStatsHelper,
+ BatteryUsageStats batteryUsageStats, String batteryConsumerId) {
List<BatterySipper> usageList = batteryStatsHelper.getUsageList();
BatteryStats batteryStats = batteryStatsHelper.getStats();
@@ -92,14 +96,14 @@ public class PowerStatsData {
long totalAudioTimeMs = 0;
long totalVideoTimeMs = 0;
- BatterySipper requestedPowerConsumer = null;
+ BatterySipper requestedBatterySipper = null;
for (BatterySipper sipper : usageList) {
if (sipper.drainType == BatterySipper.DrainType.SCREEN) {
totalScreenPower = sipper.sumPower();
}
- if (powerConsumerId(sipper).equals(powerConsumerId)) {
- requestedPowerConsumer = sipper;
+ if (batteryConsumerId(sipper).equals(batteryConsumerId)) {
+ requestedBatterySipper = sipper;
}
totalPowerMah += sipper.sumPower();
@@ -136,81 +140,94 @@ public class PowerStatsData {
totalVideoTimeMs += sipper.videoTimeMs;
}
- long totalScreenMeasuredEnergyUJ = batteryStats.getScreenOnEnergy();
+ BatteryConsumer requestedBatteryConsumer = null;
+
+ for (BatteryConsumer consumer : batteryUsageStats.getUidBatteryConsumers()) {
+ if (batteryConsumerId(consumer).equals(batteryConsumerId)) {
+ requestedBatteryConsumer = consumer;
+ break;
+ }
+ }
- if (requestedPowerConsumer == null) {
- mPowerConsumerInfo = null;
+ if (requestedBatterySipper == null) {
+ mBatteryConsumerInfo = null;
return;
}
- mPowerConsumerInfo = PowerConsumerInfoHelper.makePowerConsumerInfo(
- context.getPackageManager(), requestedPowerConsumer);
+ mBatteryConsumerInfo = BatteryConsumerInfoHelper.makeBatteryConsumerInfo(
+ context.getPackageManager(), requestedBatterySipper);
+ long totalScreenMeasuredEnergyUJ = batteryStats.getScreenOnEnergy();
addEntry("Total power", EntryType.POWER,
- requestedPowerConsumer.totalSmearedPowerMah, totalSmearedPowerMah);
- maybeAddMeasuredEnergyEntry(requestedPowerConsumer.drainType, batteryStats);
+ requestedBatterySipper.totalSmearedPowerMah, totalSmearedPowerMah);
+ maybeAddMeasuredEnergyEntry(requestedBatterySipper.drainType, batteryStats);
addEntry("... excluding system", EntryType.POWER,
- requestedPowerConsumer.totalSmearedPowerMah, totalPowerExcludeSystemMah);
+ requestedBatterySipper.totalSmearedPowerMah, totalPowerExcludeSystemMah);
addEntry("Screen, smeared", EntryType.POWER,
- requestedPowerConsumer.screenPowerMah, totalScreenPower);
+ requestedBatterySipper.screenPowerMah, totalScreenPower);
if (totalScreenMeasuredEnergyUJ != BatteryStats.ENERGY_DATA_UNAVAILABLE) {
final double measuredCharge = UJ_2_MAH * totalScreenMeasuredEnergyUJ;
final double ratio = measuredCharge / totalScreenPower;
addEntry("Screen, smeared (PowerStatsHal adjusted)", EntryType.POWER,
- requestedPowerConsumer.screenPowerMah * ratio, measuredCharge);
+ requestedBatterySipper.screenPowerMah * ratio, measuredCharge);
}
addEntry("Other, smeared", EntryType.POWER,
- requestedPowerConsumer.proportionalSmearMah, totalProportionalSmearMah);
+ requestedBatterySipper.proportionalSmearMah, totalProportionalSmearMah);
addEntry("Excluding smeared", EntryType.POWER,
- requestedPowerConsumer.totalPowerMah, totalPowerMah);
- addEntry("CPU", EntryType.POWER,
- requestedPowerConsumer.cpuPowerMah, totalCpuPowerMah);
+ requestedBatterySipper.totalPowerMah, totalPowerMah);
+ if (requestedBatteryConsumer != null) {
+ addEntry("CPU", EntryType.POWER,
+ requestedBatteryConsumer.getConsumedPower(BatteryConsumer.POWER_COMPONENT_CPU),
+ totalCpuPowerMah);
+ }
+ addEntry("CPU (sipper)", EntryType.POWER,
+ requestedBatterySipper.cpuPowerMah, totalCpuPowerMah);
addEntry("System services", EntryType.POWER,
- requestedPowerConsumer.systemServiceCpuPowerMah, totalSystemServiceCpuPowerMah);
+ requestedBatterySipper.systemServiceCpuPowerMah, totalSystemServiceCpuPowerMah);
addEntry("Usage", EntryType.POWER,
- requestedPowerConsumer.usagePowerMah, totalUsagePowerMah);
+ requestedBatterySipper.usagePowerMah, totalUsagePowerMah);
addEntry("Wake lock", EntryType.POWER,
- requestedPowerConsumer.wakeLockPowerMah, totalWakeLockPowerMah);
+ requestedBatterySipper.wakeLockPowerMah, totalWakeLockPowerMah);
addEntry("Mobile radio", EntryType.POWER,
- requestedPowerConsumer.mobileRadioPowerMah, totalMobileRadioPowerMah);
+ requestedBatterySipper.mobileRadioPowerMah, totalMobileRadioPowerMah);
addEntry("WiFi", EntryType.POWER,
- requestedPowerConsumer.wifiPowerMah, totalWifiPowerMah);
+ requestedBatterySipper.wifiPowerMah, totalWifiPowerMah);
addEntry("Bluetooth", EntryType.POWER,
- requestedPowerConsumer.bluetoothPowerMah, totalBluetoothPowerMah);
+ requestedBatterySipper.bluetoothPowerMah, totalBluetoothPowerMah);
addEntry("GPS", EntryType.POWER,
- requestedPowerConsumer.gpsPowerMah, totalGpsPowerMah);
+ requestedBatterySipper.gpsPowerMah, totalGpsPowerMah);
addEntry("Camera", EntryType.POWER,
- requestedPowerConsumer.cameraPowerMah, totalCameraPowerMah);
+ requestedBatterySipper.cameraPowerMah, totalCameraPowerMah);
addEntry("Flashlight", EntryType.POWER,
- requestedPowerConsumer.flashlightPowerMah, totalFlashlightPowerMah);
+ requestedBatterySipper.flashlightPowerMah, totalFlashlightPowerMah);
addEntry("Sensors", EntryType.POWER,
- requestedPowerConsumer.sensorPowerMah, totalSensorPowerMah);
+ requestedBatterySipper.sensorPowerMah, totalSensorPowerMah);
addEntry("Audio", EntryType.POWER,
- requestedPowerConsumer.audioPowerMah, totalAudioPowerMah);
+ requestedBatterySipper.audioPowerMah, totalAudioPowerMah);
addEntry("Video", EntryType.POWER,
- requestedPowerConsumer.videoPowerMah, totalVideoPowerMah);
+ requestedBatterySipper.videoPowerMah, totalVideoPowerMah);
addEntry("CPU time", EntryType.DURATION,
- requestedPowerConsumer.cpuTimeMs, totalCpuTimeMs);
+ requestedBatterySipper.cpuTimeMs, totalCpuTimeMs);
addEntry("CPU foreground time", EntryType.DURATION,
- requestedPowerConsumer.cpuFgTimeMs, totalCpuFgTimeMs);
+ requestedBatterySipper.cpuFgTimeMs, totalCpuFgTimeMs);
addEntry("Wake lock time", EntryType.DURATION,
- requestedPowerConsumer.wakeLockTimeMs, totalWakeLockTimeMs);
+ requestedBatterySipper.wakeLockTimeMs, totalWakeLockTimeMs);
addEntry("WiFi running time", EntryType.DURATION,
- requestedPowerConsumer.wifiRunningTimeMs, totalWifiRunningTimeMs);
+ requestedBatterySipper.wifiRunningTimeMs, totalWifiRunningTimeMs);
addEntry("Bluetooth time", EntryType.DURATION,
- requestedPowerConsumer.bluetoothRunningTimeMs, totalBluetoothRunningTimeMs);
+ requestedBatterySipper.bluetoothRunningTimeMs, totalBluetoothRunningTimeMs);
addEntry("GPS time", EntryType.DURATION,
- requestedPowerConsumer.gpsTimeMs, totalGpsTimeMs);
+ requestedBatterySipper.gpsTimeMs, totalGpsTimeMs);
addEntry("Camera time", EntryType.DURATION,
- requestedPowerConsumer.cameraTimeMs, totalCameraTimeMs);
+ requestedBatterySipper.cameraTimeMs, totalCameraTimeMs);
addEntry("Flashlight time", EntryType.DURATION,
- requestedPowerConsumer.flashlightTimeMs, totalFlashlightTimeMs);
+ requestedBatterySipper.flashlightTimeMs, totalFlashlightTimeMs);
addEntry("Audio time", EntryType.DURATION,
- requestedPowerConsumer.audioTimeMs, totalAudioTimeMs);
+ requestedBatterySipper.audioTimeMs, totalAudioTimeMs);
addEntry("Video time", EntryType.DURATION,
- requestedPowerConsumer.videoTimeMs, totalVideoTimeMs);
+ requestedBatterySipper.videoTimeMs, totalVideoTimeMs);
}
private boolean isSystemSipper(BatterySipper sipper) {
@@ -261,15 +278,25 @@ public class PowerStatsData {
}
}
- public PowerConsumerInfoHelper.PowerConsumerInfo getPowerConsumerInfo() {
- return mPowerConsumerInfo;
+ public BatteryConsumerInfoHelper.BatteryConsumerInfo getBatteryConsumerInfo() {
+ return mBatteryConsumerInfo;
}
public List<Entry> getEntries() {
return mEntries;
}
- public static String powerConsumerId(BatterySipper sipper) {
+ public static String batteryConsumerId(BatterySipper sipper) {
return sipper.drainType + "|" + sipper.userId + "|" + sipper.getUid();
}
+
+ public static String batteryConsumerId(BatteryConsumer consumer) {
+ if (consumer instanceof UidBatteryConsumer) {
+ return BatterySipper.DrainType.APP + "|"
+ + UserHandle.getUserId(((UidBatteryConsumer) consumer).getUid()) + "|"
+ + ((UidBatteryConsumer) consumer).getUid();
+ } else {
+ return "";
+ }
+ }
}
diff --git a/core/tests/powertests/PowerStatsViewer/src/com/android/frameworks/core/powerstatsviewer/PowerConsumerInfoHelper.java b/core/tests/batterystatstests/BatteryStatsViewer/src/com/android/frameworks/core/batterystatsviewer/BatteryConsumerInfoHelper.java
index 6fec2405b0c6..8ee6c604cb3e 100644
--- a/core/tests/powertests/PowerStatsViewer/src/com/android/frameworks/core/powerstatsviewer/PowerConsumerInfoHelper.java
+++ b/core/tests/batterystatstests/BatteryStatsViewer/src/com/android/frameworks/core/batterystatsviewer/BatteryConsumerInfoHelper.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.frameworks.core.powerstatsviewer;
+package com.android.frameworks.core.batterystatsviewer;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
@@ -26,11 +26,11 @@ import com.android.internal.os.BatterySipper;
import java.util.Locale;
-class PowerConsumerInfoHelper {
+class BatteryConsumerInfoHelper {
private static final String SYSTEM_SERVER_PACKAGE_NAME = "android";
- public static class PowerConsumerInfo {
+ public static class BatteryConsumerInfo {
public String id;
public CharSequence label;
public double powerMah;
@@ -40,10 +40,10 @@ class PowerConsumerInfoHelper {
}
@NonNull
- public static PowerConsumerInfo makePowerConsumerInfo(PackageManager packageManager,
+ public static BatteryConsumerInfo makeBatteryConsumerInfo(PackageManager packageManager,
@NonNull BatterySipper sipper) {
- PowerConsumerInfo info = new PowerConsumerInfo();
- info.id = PowerStatsData.powerConsumerId(sipper);
+ BatteryConsumerInfo info = new BatteryConsumerInfo();
+ info.id = BatteryConsumerData.batteryConsumerId(sipper);
sipper.sumPower();
info.powerMah = sipper.totalSmearedPowerMah;
switch (sipper.drainType) {
diff --git a/core/tests/powertests/PowerStatsViewer/src/com/android/frameworks/core/powerstatsviewer/PowerConsumerPickerActivity.java b/core/tests/batterystatstests/BatteryStatsViewer/src/com/android/frameworks/core/batterystatsviewer/BatteryConsumerPickerActivity.java
index f56d113980c8..2db848b084a6 100644
--- a/core/tests/powertests/PowerStatsViewer/src/com/android/frameworks/core/powerstatsviewer/PowerConsumerPickerActivity.java
+++ b/core/tests/batterystatstests/BatteryStatsViewer/src/com/android/frameworks/core/batterystatsviewer/BatteryConsumerPickerActivity.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.frameworks.core.powerstatsviewer;
+package com.android.frameworks.core.batterystatsviewer;
import android.content.Context;
import android.content.Intent;
@@ -34,14 +34,14 @@ import com.google.android.material.tabs.TabLayout;
* Picker, showing a sorted lists of applications and other types of entities consuming power.
* Returns the selected entity ID or null.
*/
-public class PowerConsumerPickerActivity extends FragmentActivity {
+public class BatteryConsumerPickerActivity extends FragmentActivity {
public static final ActivityResultContract<Void, String> CONTRACT =
new ActivityResultContract<Void, String>() {
@NonNull
@Override
public Intent createIntent(@NonNull Context context, Void aVoid) {
- return new Intent(context, PowerConsumerPickerActivity.class);
+ return new Intent(context, BatteryConsumerPickerActivity.class);
}
@Override
@@ -58,7 +58,7 @@ public class PowerConsumerPickerActivity extends FragmentActivity {
super.onCreate(icicle);
getActionBar().setDisplayHomeAsUpEnabled(true);
- setContentView(R.layout.power_consumer_picker_activity_layout);
+ setContentView(R.layout.battery_consumer_picker_activity_layout);
ViewPager viewPager = findViewById(R.id.pager);
@@ -75,12 +75,12 @@ public class PowerConsumerPickerActivity extends FragmentActivity {
public Fragment getItem(int position) {
switch (position) {
case 0:
- return new PowerConsumerPickerFragment(
- PowerConsumerPickerFragment.PICKER_TYPE_APP);
+ return new BatteryConsumerPickerFragment(
+ BatteryConsumerPickerFragment.PICKER_TYPE_APP);
case 1:
default:
- return new PowerConsumerPickerFragment(
- PowerConsumerPickerFragment.PICKER_TYPE_DRAIN);
+ return new BatteryConsumerPickerFragment(
+ BatteryConsumerPickerFragment.PICKER_TYPE_DRAIN);
}
}
@@ -101,9 +101,9 @@ public class PowerConsumerPickerActivity extends FragmentActivity {
tabLayout.setupWithViewPager(viewPager);
}
- public void setSelectedPowerConsumer(String id) {
+ public void setSelectedBatteryConsumer(String batteryConsumerId) {
Intent intent = new Intent();
- intent.putExtra(Intent.EXTRA_RETURN_RESULT, id);
+ intent.putExtra(Intent.EXTRA_RETURN_RESULT, batteryConsumerId);
setResult(RESULT_OK, intent);
finish();
}
diff --git a/core/tests/powertests/PowerStatsViewer/src/com/android/frameworks/core/powerstatsviewer/PowerConsumerPickerFragment.java b/core/tests/batterystatstests/BatteryStatsViewer/src/com/android/frameworks/core/batterystatsviewer/BatteryConsumerPickerFragment.java
index 25225b87f602..bb11fd598511 100644
--- a/core/tests/powertests/PowerStatsViewer/src/com/android/frameworks/core/powerstatsviewer/PowerConsumerPickerFragment.java
+++ b/core/tests/batterystatstests/BatteryStatsViewer/src/com/android/frameworks/core/batterystatsviewer/BatteryConsumerPickerFragment.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.frameworks.core.powerstatsviewer;
+package com.android.frameworks.core.batterystatsviewer;
import android.content.Context;
import android.content.pm.PackageManager;
@@ -36,7 +36,7 @@ import androidx.loader.content.Loader;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
-import com.android.frameworks.core.powerstatsviewer.PowerConsumerInfoHelper.PowerConsumerInfo;
+import com.android.frameworks.core.batterystatsviewer.BatteryConsumerInfoHelper.BatteryConsumerInfo;
import com.android.internal.os.BatterySipper;
import com.android.internal.os.BatteryStatsHelper;
import com.android.settingslib.utils.AsyncLoaderCompat;
@@ -50,7 +50,7 @@ import java.util.Locale;
* Picker, showing a sorted lists of applications or other types of entities consuming power.
* Returns the selected entity ID or null.
*/
-public class PowerConsumerPickerFragment extends Fragment {
+public class BatteryConsumerPickerFragment extends Fragment {
private static final String TAG = "AppPicker";
public static final String PICKER_TYPE = "pickertype";
@@ -58,53 +58,53 @@ public class PowerConsumerPickerFragment extends Fragment {
public static final int PICKER_TYPE_APP = 0;
public static final int PICKER_TYPE_DRAIN = 1;
- private PowerConsumerListAdapter mPowerConsumerListAdapter;
+ private BatteryConsumerListAdapter mBatteryConsumerListAdapter;
private RecyclerView mAppList;
private View mLoadingView;
- private interface OnPowerConsumerSelectedListener {
- void onPowerConsumerSelected(String uid);
+ private interface OnBatteryConsumerSelectedListener {
+ void onBatteryConsumerSelected(String batteryConsumerId);
}
- public PowerConsumerPickerFragment(int pickerType) {
+ public BatteryConsumerPickerFragment(int pickerType) {
Bundle args = new Bundle();
args.putInt(PICKER_TYPE, pickerType);
setArguments(args);
}
- public PowerConsumerPickerFragment() {
+ public BatteryConsumerPickerFragment() {
}
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container,
@Nullable Bundle savedInstanceState) {
- View view = inflater.inflate(R.layout.power_consumer_picker_layout, container, false);
+ View view = inflater.inflate(R.layout.battery_consumer_picker_layout, container, false);
mLoadingView = view.findViewById(R.id.loading_view);
mAppList = view.findViewById(R.id.list_view);
mAppList.setLayoutManager(new LinearLayoutManager(getContext()));
- mPowerConsumerListAdapter = new PowerConsumerListAdapter(
- PowerConsumerPickerFragment.this::setSelectedPowerConsumer);
- mAppList.setAdapter(mPowerConsumerListAdapter);
+ mBatteryConsumerListAdapter = new BatteryConsumerListAdapter(
+ BatteryConsumerPickerFragment.this::setSelectedBatteryConsumer);
+ mAppList.setAdapter(mBatteryConsumerListAdapter);
LoaderManager.getInstance(this).initLoader(0, getArguments(),
- new PowerConsumerListLoaderCallbacks());
+ new BatteryConsumerListLoaderCallbacks());
return view;
}
- public void setSelectedPowerConsumer(String id) {
- ((PowerConsumerPickerActivity) getActivity()).setSelectedPowerConsumer(id);
+ public void setSelectedBatteryConsumer(String id) {
+ ((BatteryConsumerPickerActivity) getActivity()).setSelectedBatteryConsumer(id);
}
- private static class PowerConsumerListLoader extends
- AsyncLoaderCompat<List<PowerConsumerInfo>> {
+ private static class BatteryConsumerListLoader extends
+ AsyncLoaderCompat<List<BatteryConsumerInfo>> {
private final BatteryStatsHelper mStatsHelper;
private final int mPickerType;
private final UserManager mUserManager;
private final PackageManager mPackageManager;
- PowerConsumerListLoader(Context context, int pickerType) {
+ BatteryConsumerListLoader(Context context, int pickerType) {
super(context);
mUserManager = context.getSystemService(UserManager.class);
mStatsHelper = new BatteryStatsHelper(context, false /* collectBatteryBroadcast */);
@@ -115,8 +115,8 @@ public class PowerConsumerPickerFragment extends Fragment {
}
@Override
- public List<PowerConsumerInfo> loadInBackground() {
- List<PowerConsumerInfoHelper.PowerConsumerInfo> powerConsumerList = new ArrayList<>();
+ public List<BatteryConsumerInfo> loadInBackground() {
+ List<BatteryConsumerInfo> batteryConsumerList = new ArrayList<>();
mStatsHelper.refreshStats(BatteryStats.STATS_SINCE_CHARGED, UserHandle.myUserId());
@@ -135,74 +135,75 @@ public class PowerConsumerPickerFragment extends Fragment {
}
}
- powerConsumerList.add(
- PowerConsumerInfoHelper.makePowerConsumerInfo(mPackageManager, sipper));
+ batteryConsumerList.add(
+ BatteryConsumerInfoHelper.makeBatteryConsumerInfo(mPackageManager, sipper));
}
- powerConsumerList.sort(
- Comparator.comparing((PowerConsumerInfo a) -> a.powerMah).reversed());
- return powerConsumerList;
+ batteryConsumerList.sort(
+ Comparator.comparing((BatteryConsumerInfo a) -> a.powerMah).reversed());
+ return batteryConsumerList;
}
@Override
- protected void onDiscardResult(List<PowerConsumerInfo> result) {
+ protected void onDiscardResult(List<BatteryConsumerInfo> result) {
}
}
- private class PowerConsumerListLoaderCallbacks implements
- LoaderManager.LoaderCallbacks<List<PowerConsumerInfo>> {
+ private class BatteryConsumerListLoaderCallbacks implements
+ LoaderManager.LoaderCallbacks<List<BatteryConsumerInfo>> {
@NonNull
@Override
- public Loader<List<PowerConsumerInfo>> onCreateLoader(int id, Bundle args) {
- return new PowerConsumerListLoader(getContext(), args.getInt(PICKER_TYPE));
+ public Loader<List<BatteryConsumerInfo>> onCreateLoader(int id, Bundle args) {
+ return new BatteryConsumerListLoader(getContext(), args.getInt(PICKER_TYPE));
}
@Override
- public void onLoadFinished(@NonNull Loader<List<PowerConsumerInfo>> loader,
- List<PowerConsumerInfoHelper.PowerConsumerInfo> powerConsumerList) {
- mPowerConsumerListAdapter.setPowerConsumerList(powerConsumerList);
+ public void onLoadFinished(@NonNull Loader<List<BatteryConsumerInfo>> loader,
+ List<BatteryConsumerInfo> batteryConsumerList) {
+ mBatteryConsumerListAdapter.setBatteryConsumerList(batteryConsumerList);
mAppList.setVisibility(View.VISIBLE);
mLoadingView.setVisibility(View.GONE);
}
@Override
public void onLoaderReset(
- @NonNull Loader<List<PowerConsumerInfoHelper.PowerConsumerInfo>> loader) {
+ @NonNull Loader<List<BatteryConsumerInfo>> loader) {
}
}
- public class PowerConsumerListAdapter extends RecyclerView.Adapter<PowerConsumerViewHolder> {
- private final OnPowerConsumerSelectedListener mListener;
- private List<PowerConsumerInfo> mPowerConsumerList;
+ public class BatteryConsumerListAdapter extends
+ RecyclerView.Adapter<BatteryConsumerViewHolder> {
+ private final OnBatteryConsumerSelectedListener mListener;
+ private List<BatteryConsumerInfo> mBatteryConsumerList;
- public PowerConsumerListAdapter(OnPowerConsumerSelectedListener listener) {
+ public BatteryConsumerListAdapter(OnBatteryConsumerSelectedListener listener) {
mListener = listener;
}
- void setPowerConsumerList(List<PowerConsumerInfo> powerConsumerList) {
- mPowerConsumerList = powerConsumerList;
+ void setBatteryConsumerList(List<BatteryConsumerInfo> batteryConsumerList) {
+ mBatteryConsumerList = batteryConsumerList;
notifyDataSetChanged();
}
@Override
public int getItemCount() {
- return mPowerConsumerList.size();
+ return mBatteryConsumerList.size();
}
@NonNull
@Override
- public PowerConsumerViewHolder onCreateViewHolder(@NonNull ViewGroup viewGroup,
+ public BatteryConsumerViewHolder onCreateViewHolder(@NonNull ViewGroup viewGroup,
int position) {
LayoutInflater layoutInflater = LayoutInflater.from(viewGroup.getContext());
- View view = layoutInflater.inflate(R.layout.power_consumer_info_layout, viewGroup,
+ View view = layoutInflater.inflate(R.layout.battery_consumer_info_layout, viewGroup,
false);
- return new PowerConsumerViewHolder(view, mListener);
+ return new BatteryConsumerViewHolder(view, mListener);
}
@Override
- public void onBindViewHolder(@NonNull PowerConsumerViewHolder viewHolder, int position) {
- PowerConsumerInfoHelper.PowerConsumerInfo item = mPowerConsumerList.get(position);
+ public void onBindViewHolder(@NonNull BatteryConsumerViewHolder viewHolder, int position) {
+ BatteryConsumerInfo item = mBatteryConsumerList.get(position);
viewHolder.id = item.id;
viewHolder.titleView.setText(item.label);
if (item.details != null) {
@@ -225,9 +226,9 @@ public class PowerConsumerPickerFragment extends Fragment {
}
// View Holder used when displaying apps
- public static class PowerConsumerViewHolder extends RecyclerView.ViewHolder
+ public static class BatteryConsumerViewHolder extends RecyclerView.ViewHolder
implements View.OnClickListener {
- private final OnPowerConsumerSelectedListener mListener;
+ private final OnBatteryConsumerSelectedListener mListener;
public String id;
public TextView titleView;
@@ -236,7 +237,7 @@ public class PowerConsumerPickerFragment extends Fragment {
public TextView packagesView;
public TextView powerView;
- PowerConsumerViewHolder(View view, OnPowerConsumerSelectedListener listener) {
+ BatteryConsumerViewHolder(View view, OnBatteryConsumerSelectedListener listener) {
super(view);
mListener = listener;
view.setOnClickListener(this);
@@ -250,7 +251,7 @@ public class PowerConsumerPickerFragment extends Fragment {
@Override
public void onClick(View v) {
- mListener.onPowerConsumerSelected(id);
+ mListener.onBatteryConsumerSelected(id);
}
}
}
diff --git a/core/tests/batterystatstests/BatteryStatsViewer/src/com/android/frameworks/core/batterystatsviewer/BatteryStatsViewerActivity.java b/core/tests/batterystatstests/BatteryStatsViewer/src/com/android/frameworks/core/batterystatsviewer/BatteryStatsViewerActivity.java
new file mode 100644
index 000000000000..4978010f8591
--- /dev/null
+++ b/core/tests/batterystatstests/BatteryStatsViewer/src/com/android/frameworks/core/batterystatsviewer/BatteryStatsViewerActivity.java
@@ -0,0 +1,338 @@
+/*
+ * 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.frameworks.core.batterystatsviewer;
+
+import android.content.Context;
+import android.content.SharedPreferences;
+import android.os.BatteryStats;
+import android.os.BatteryStatsManager;
+import android.os.BatteryUsageStats;
+import android.os.Bundle;
+import android.os.UserHandle;
+import android.os.UserManager;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import androidx.activity.ComponentActivity;
+import androidx.activity.result.ActivityResultLauncher;
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+import androidx.loader.app.LoaderManager;
+import androidx.loader.app.LoaderManager.LoaderCallbacks;
+import androidx.loader.content.Loader;
+import androidx.recyclerview.widget.LinearLayoutManager;
+import androidx.recyclerview.widget.RecyclerView;
+
+import com.android.internal.os.BatteryStatsHelper;
+import com.android.settingslib.utils.AsyncLoaderCompat;
+
+import java.util.Collections;
+import java.util.List;
+import java.util.Locale;
+
+public class BatteryStatsViewerActivity extends ComponentActivity {
+ private static final int BATTERY_STATS_REFRESH_RATE_MILLIS = 60 * 1000;
+ public static final String PREF_SELECTED_BATTERY_CONSUMER = "batteryConsumerId";
+ public static final int LOADER_BATTERY_STATS_HELPER = 0;
+ public static final int LOADER_BATTERY_USAGE_STATS = 1;
+
+ private BatteryStatsDataAdapter mBatteryStatsDataAdapter;
+ private Runnable mBatteryStatsRefresh = this::periodicBatteryStatsRefresh;
+ private SharedPreferences mSharedPref;
+ private String mBatteryConsumerId;
+ private TextView mTitleView;
+ private TextView mDetailsView;
+ private ImageView mIconView;
+ private TextView mPackagesView;
+ private RecyclerView mBatteryConsumerDataView;
+ private View mLoadingView;
+ private View mEmptyView;
+ private ActivityResultLauncher<Void> mStartAppPicker = registerForActivityResult(
+ BatteryConsumerPickerActivity.CONTRACT, this::onApplicationSelected);
+ private BatteryStatsHelper mBatteryStatsHelper;
+ private BatteryUsageStats mBatteryUsageStats;
+
+ @Override
+ protected void onCreate(@Nullable Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+
+ mSharedPref = getPreferences(Context.MODE_PRIVATE);
+
+ setContentView(R.layout.battery_stats_viewer_layout);
+
+ View appCard = findViewById(R.id.app_card);
+ appCard.setOnClickListener((e) -> startAppPicker());
+
+ mTitleView = findViewById(android.R.id.title);
+ mDetailsView = findViewById(R.id.details);
+ mIconView = findViewById(android.R.id.icon);
+ mPackagesView = findViewById(R.id.packages);
+
+ mBatteryConsumerDataView = findViewById(R.id.battery_consumer_data_view);
+ mBatteryConsumerDataView.setLayoutManager(new LinearLayoutManager(this));
+ mBatteryStatsDataAdapter = new BatteryStatsDataAdapter();
+ mBatteryConsumerDataView.setAdapter(mBatteryStatsDataAdapter);
+
+ mLoadingView = findViewById(R.id.loading_view);
+ mEmptyView = findViewById(R.id.empty_view);
+
+ mBatteryConsumerId = mSharedPref.getString(PREF_SELECTED_BATTERY_CONSUMER, null);
+ loadBatteryStats();
+ if (mBatteryConsumerId == null) {
+ startAppPicker();
+ }
+ }
+
+ @Override
+ protected void onResume() {
+ super.onResume();
+ periodicBatteryStatsRefresh();
+ }
+
+ @Override
+ protected void onPause() {
+ super.onPause();
+ getMainThreadHandler().removeCallbacks(mBatteryStatsRefresh);
+ }
+
+ private void startAppPicker() {
+ mStartAppPicker.launch(null);
+ }
+
+ private void onApplicationSelected(String batteryConsumerId) {
+ if (batteryConsumerId == null) {
+ if (mBatteryConsumerId == null) {
+ finish();
+ }
+ } else {
+ mBatteryConsumerId = batteryConsumerId;
+ mSharedPref.edit()
+ .putString(PREF_SELECTED_BATTERY_CONSUMER, mBatteryConsumerId)
+ .apply();
+ mLoadingView.setVisibility(View.VISIBLE);
+ loadBatteryStats();
+ }
+ }
+
+ private void periodicBatteryStatsRefresh() {
+ loadBatteryStats();
+ getMainThreadHandler().postDelayed(mBatteryStatsRefresh, BATTERY_STATS_REFRESH_RATE_MILLIS);
+ }
+
+ private void loadBatteryStats() {
+ LoaderManager loaderManager = LoaderManager.getInstance(this);
+ loaderManager.restartLoader(LOADER_BATTERY_STATS_HELPER, null,
+ new BatteryStatsHelperLoaderCallbacks());
+ loaderManager.restartLoader(LOADER_BATTERY_USAGE_STATS, null,
+ new BatteryUsageStatsLoaderCallbacks());
+ }
+
+ private static class BatteryStatsHelperLoader extends AsyncLoaderCompat<BatteryStatsHelper> {
+ private final BatteryStatsHelper mBatteryStatsHelper;
+ private final UserManager mUserManager;
+
+ BatteryStatsHelperLoader(Context context) {
+ super(context);
+ mUserManager = context.getSystemService(UserManager.class);
+ mBatteryStatsHelper = new BatteryStatsHelper(context,
+ false /* collectBatteryBroadcast */);
+ mBatteryStatsHelper.create((Bundle) null);
+ mBatteryStatsHelper.clearStats();
+ }
+
+ @Override
+ public BatteryStatsHelper loadInBackground() {
+ mBatteryStatsHelper.refreshStats(BatteryStats.STATS_SINCE_CHARGED,
+ UserHandle.myUserId());
+ return mBatteryStatsHelper;
+ }
+
+ @Override
+ protected void onDiscardResult(BatteryStatsHelper result) {
+ }
+ }
+
+ private class BatteryStatsHelperLoaderCallbacks implements LoaderCallbacks<BatteryStatsHelper> {
+ @NonNull
+ @Override
+ public Loader<BatteryStatsHelper> onCreateLoader(int id, Bundle args) {
+ return new BatteryStatsHelperLoader(BatteryStatsViewerActivity.this);
+ }
+
+ @Override
+ public void onLoadFinished(@NonNull Loader<BatteryStatsHelper> loader,
+ BatteryStatsHelper batteryStatsHelper) {
+ onBatteryStatsHelperLoaded(batteryStatsHelper);
+ }
+
+ @Override
+ public void onLoaderReset(@NonNull Loader<BatteryStatsHelper> loader) {
+ }
+ }
+
+ private static class BatteryUsageStatsLoader extends AsyncLoaderCompat<BatteryUsageStats> {
+ private final BatteryStatsManager mBatteryStatsManager;
+
+ BatteryUsageStatsLoader(Context context) {
+ super(context);
+ mBatteryStatsManager = context.getSystemService(BatteryStatsManager.class);
+ }
+
+ @Override
+ public BatteryUsageStats loadInBackground() {
+ return mBatteryStatsManager.getBatteryUsageStats();
+ }
+
+ @Override
+ protected void onDiscardResult(BatteryUsageStats result) {
+ }
+ }
+
+ private class BatteryUsageStatsLoaderCallbacks implements LoaderCallbacks<BatteryUsageStats> {
+ @NonNull
+ @Override
+ public Loader<BatteryUsageStats> onCreateLoader(int id, Bundle args) {
+ return new BatteryUsageStatsLoader(BatteryStatsViewerActivity.this);
+ }
+
+ @Override
+ public void onLoadFinished(@NonNull Loader<BatteryUsageStats> loader,
+ BatteryUsageStats batteryUsageStats) {
+ onBatteryUsageStatsLoaded(batteryUsageStats);
+ }
+
+ @Override
+ public void onLoaderReset(@NonNull Loader<BatteryUsageStats> loader) {
+ }
+ }
+
+ public void onBatteryStatsHelperLoaded(BatteryStatsHelper batteryStatsHelper) {
+ mBatteryStatsHelper = batteryStatsHelper;
+ onBatteryStatsDataLoaded();
+ }
+
+ private void onBatteryUsageStatsLoaded(BatteryUsageStats batteryUsageStats) {
+ mBatteryUsageStats = batteryUsageStats;
+ onBatteryStatsDataLoaded();
+ }
+
+ public void onBatteryStatsDataLoaded() {
+ if (mBatteryStatsHelper == null || mBatteryUsageStats == null) {
+ return;
+ }
+
+ BatteryConsumerData batteryConsumerData = new BatteryConsumerData(this, mBatteryStatsHelper,
+ mBatteryUsageStats, mBatteryConsumerId);
+
+ BatteryConsumerInfoHelper.BatteryConsumerInfo
+ batteryConsumerInfo = batteryConsumerData.getBatteryConsumerInfo();
+ if (batteryConsumerInfo == null) {
+ mTitleView.setText("Battery consumer not found");
+ mPackagesView.setVisibility(View.GONE);
+ } else {
+ mTitleView.setText(batteryConsumerInfo.label);
+ if (batteryConsumerInfo.details != null) {
+ mDetailsView.setText(batteryConsumerInfo.details);
+ mDetailsView.setVisibility(View.VISIBLE);
+ } else {
+ mDetailsView.setVisibility(View.GONE);
+ }
+ mIconView.setImageDrawable(
+ batteryConsumerInfo.iconInfo.loadIcon(getPackageManager()));
+
+ if (batteryConsumerInfo.packages != null) {
+ mPackagesView.setText(batteryConsumerInfo.packages);
+ mPackagesView.setVisibility(View.VISIBLE);
+ } else {
+ mPackagesView.setVisibility(View.GONE);
+ }
+ }
+
+ mBatteryStatsDataAdapter.setEntries(batteryConsumerData.getEntries());
+ if (batteryConsumerData.getEntries().isEmpty()) {
+ mEmptyView.setVisibility(View.VISIBLE);
+ mBatteryConsumerDataView.setVisibility(View.GONE);
+ } else {
+ mEmptyView.setVisibility(View.GONE);
+ mBatteryConsumerDataView.setVisibility(View.VISIBLE);
+ }
+
+ mLoadingView.setVisibility(View.GONE);
+ }
+
+ private static class BatteryStatsDataAdapter extends
+ RecyclerView.Adapter<BatteryStatsDataAdapter.ViewHolder> {
+ public static class ViewHolder extends RecyclerView.ViewHolder {
+ public TextView titleTextView;
+ public TextView amountTextView;
+ public TextView percentTextView;
+
+ ViewHolder(View itemView) {
+ super(itemView);
+
+ titleTextView = itemView.findViewById(R.id.title);
+ amountTextView = itemView.findViewById(R.id.amount);
+ percentTextView = itemView.findViewById(R.id.percent);
+ }
+ }
+
+ private List<BatteryConsumerData.Entry> mEntries = Collections.emptyList();
+
+ public void setEntries(List<BatteryConsumerData.Entry> entries) {
+ mEntries = entries;
+ notifyDataSetChanged();
+ }
+
+ @Override
+ public int getItemCount() {
+ return mEntries.size();
+ }
+
+ @NonNull
+ @Override
+ public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int position) {
+ LayoutInflater layoutInflater = LayoutInflater.from(parent.getContext());
+ View itemView = layoutInflater.inflate(R.layout.battery_consumer_entry_layout, parent,
+ false);
+ return new ViewHolder(itemView);
+ }
+
+ @Override
+ public void onBindViewHolder(@NonNull ViewHolder viewHolder, int position) {
+ BatteryConsumerData.Entry entry = mEntries.get(position);
+ switch (entry.entryType) {
+ case POWER:
+ viewHolder.titleTextView.setText(entry.title);
+ viewHolder.amountTextView.setText(
+ String.format(Locale.getDefault(), "%.1f mAh", entry.value));
+ break;
+ case DURATION:
+ viewHolder.titleTextView.setText(entry.title);
+ viewHolder.amountTextView.setText(
+ String.format(Locale.getDefault(), "%,d ms", (long) entry.value));
+ break;
+ }
+
+ double proportion = entry.total != 0 ? entry.value * 100 / entry.total : 0;
+ viewHolder.percentTextView.setText(String.format(Locale.getDefault(), "%.1f%%",
+ proportion));
+ }
+ }
+}
diff --git a/core/tests/powertests/OWNERS b/core/tests/batterystatstests/OWNERS
index d68066bb8c40..c22f6a4bbbf6 100644
--- a/core/tests/powertests/OWNERS
+++ b/core/tests/batterystatstests/OWNERS
@@ -1 +1,2 @@
+include /BATTERY_STATS_OWNERS
include /services/core/java/com/android/server/power/OWNERS
diff --git a/core/tests/coretests/src/android/app/ApplicationPackageManagerTest.java b/core/tests/coretests/src/android/app/ApplicationPackageManagerTest.java
index 95da532045ac..4b0ed65e5fde 100644
--- a/core/tests/coretests/src/android/app/ApplicationPackageManagerTest.java
+++ b/core/tests/coretests/src/android/app/ApplicationPackageManagerTest.java
@@ -90,7 +90,7 @@ public class ApplicationPackageManagerTest extends TestCase {
private boolean mAllow3rdPartyOnInternal = true;
public MockedApplicationPackageManager() {
- super(null, null, null);
+ super(null, null);
}
public void setForceAllowOnExternal(boolean forceAllowOnExternal) {
diff --git a/core/tests/coretests/src/android/app/time/OWNERS b/core/tests/coretests/src/android/app/time/OWNERS
new file mode 100644
index 000000000000..8f8089717e3b
--- /dev/null
+++ b/core/tests/coretests/src/android/app/time/OWNERS
@@ -0,0 +1,3 @@
+# Bug component: 847766
+mingaleev@google.com
+include /core/java/android/app/timedetector/OWNERS
diff --git a/core/tests/coretests/src/android/app/timedetector/GnssTimeSuggestionTest.java b/core/tests/coretests/src/android/app/timedetector/GnssTimeSuggestionTest.java
new file mode 100644
index 000000000000..e248010319e1
--- /dev/null
+++ b/core/tests/coretests/src/android/app/timedetector/GnssTimeSuggestionTest.java
@@ -0,0 +1,66 @@
+/*
+ * Copyright 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 android.app.timedetector;
+
+import static android.app.timezonedetector.ParcelableTestSupport.assertRoundTripParcelable;
+import static android.app.timezonedetector.ParcelableTestSupport.roundTripParcelable;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotEquals;
+
+import android.os.TimestampedValue;
+
+import org.junit.Test;
+
+public class GnssTimeSuggestionTest {
+
+ private static final TimestampedValue<Long> ARBITRARY_TIME =
+ new TimestampedValue<>(1111L, 2222L);
+
+ @Test
+ public void testEquals() {
+ GnssTimeSuggestion one = new GnssTimeSuggestion(ARBITRARY_TIME);
+ assertEquals(one, one);
+
+ GnssTimeSuggestion two = new GnssTimeSuggestion(ARBITRARY_TIME);
+ assertEquals(one, two);
+ assertEquals(two, one);
+
+ TimestampedValue<Long> differentTime = new TimestampedValue<>(
+ ARBITRARY_TIME.getReferenceTimeMillis() + 1,
+ ARBITRARY_TIME.getValue());
+ GnssTimeSuggestion three = new GnssTimeSuggestion(differentTime);
+ assertNotEquals(one, three);
+ assertNotEquals(three, one);
+
+ // DebugInfo must not be considered in equals().
+ one.addDebugInfo("Debug info 1");
+ two.addDebugInfo("Debug info 2");
+ assertEquals(one, two);
+ }
+
+ @Test
+ public void testParcelable() {
+ GnssTimeSuggestion suggestion = new GnssTimeSuggestion(ARBITRARY_TIME);
+ assertRoundTripParcelable(suggestion);
+
+ // DebugInfo should also be stored (but is not checked by equals()
+ suggestion.addDebugInfo("This is debug info");
+ GnssTimeSuggestion rtSuggestion = roundTripParcelable(suggestion);
+ assertEquals(suggestion.getDebugInfo(), rtSuggestion.getDebugInfo());
+ }
+}
diff --git a/core/tests/coretests/src/android/app/timedetector/OWNERS b/core/tests/coretests/src/android/app/timedetector/OWNERS
new file mode 100644
index 000000000000..8f8089717e3b
--- /dev/null
+++ b/core/tests/coretests/src/android/app/timedetector/OWNERS
@@ -0,0 +1,3 @@
+# Bug component: 847766
+mingaleev@google.com
+include /core/java/android/app/timedetector/OWNERS
diff --git a/core/tests/coretests/src/android/app/timezone/OWNERS b/core/tests/coretests/src/android/app/timezone/OWNERS
new file mode 100644
index 000000000000..8f8089717e3b
--- /dev/null
+++ b/core/tests/coretests/src/android/app/timezone/OWNERS
@@ -0,0 +1,3 @@
+# Bug component: 847766
+mingaleev@google.com
+include /core/java/android/app/timedetector/OWNERS
diff --git a/core/tests/coretests/src/android/app/timezonedetector/OWNERS b/core/tests/coretests/src/android/app/timezonedetector/OWNERS
new file mode 100644
index 000000000000..8f8089717e3b
--- /dev/null
+++ b/core/tests/coretests/src/android/app/timezonedetector/OWNERS
@@ -0,0 +1,3 @@
+# Bug component: 847766
+mingaleev@google.com
+include /core/java/android/app/timedetector/OWNERS
diff --git a/core/tests/coretests/src/com/android/internal/jank/OWNERS b/core/tests/coretests/src/com/android/internal/jank/OWNERS
new file mode 100644
index 000000000000..faece0818a09
--- /dev/null
+++ b/core/tests/coretests/src/com/android/internal/jank/OWNERS
@@ -0,0 +1 @@
+include /core/java/com/android/internal/jank/OWNERS \ No newline at end of file
diff --git a/core/tests/hdmitests/src/android/hardware/hdmi/HdmiPortInfoTest.java b/core/tests/hdmitests/src/android/hardware/hdmi/HdmiPortInfoTest.java
new file mode 100755
index 000000000000..d8dc1eabe045
--- /dev/null
+++ b/core/tests/hdmitests/src/android/hardware/hdmi/HdmiPortInfoTest.java
@@ -0,0 +1,62 @@
+/*
+ * 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 android.hardware.hdmi;
+
+import androidx.test.filters.SmallTest;
+
+import com.google.common.testing.EqualsTester;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
+
+/** Tests for {@link HdmiPortInfo} */
+@RunWith(JUnit4.class)
+@SmallTest
+public class HdmiPortInfoTest {
+
+ @Test
+ public void testEquals() {
+ int portId = 1;
+ int portType = 0;
+ int address = 0x123456;
+ boolean isCec = true;
+ boolean isMhl = false;
+ boolean isArcSupported = false;
+
+ new EqualsTester()
+ .addEqualityGroup(
+ new HdmiPortInfo(portId, portType, address, isCec, isMhl, isArcSupported),
+ new HdmiPortInfo(portId, portType, address, isCec, isMhl, isArcSupported))
+ .addEqualityGroup(
+ new HdmiPortInfo(
+ portId + 1, portType, address, isCec, isMhl, isArcSupported))
+ .addEqualityGroup(
+ new HdmiPortInfo(
+ portId, portType + 1, address, isCec, isMhl, isArcSupported))
+ .addEqualityGroup(
+ new HdmiPortInfo(
+ portId, portType, address + 1, isCec, isMhl, isArcSupported))
+ .addEqualityGroup(
+ new HdmiPortInfo(portId, portType, address, !isCec, isMhl, isArcSupported))
+ .addEqualityGroup(
+ new HdmiPortInfo(portId, portType, address, isCec, !isMhl, isArcSupported))
+ .addEqualityGroup(
+ new HdmiPortInfo(portId, portType, address, isCec, isMhl, !isArcSupported))
+ .testEquals();
+ }
+}
diff --git a/core/tests/powertests/PowerStatsViewer/src/com/android/frameworks/core/powerstatsviewer/PowerStatsViewerActivity.java b/core/tests/powertests/PowerStatsViewer/src/com/android/frameworks/core/powerstatsviewer/PowerStatsViewerActivity.java
deleted file mode 100644
index 05679101f86a..000000000000
--- a/core/tests/powertests/PowerStatsViewer/src/com/android/frameworks/core/powerstatsviewer/PowerStatsViewerActivity.java
+++ /dev/null
@@ -1,276 +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.frameworks.core.powerstatsviewer;
-
-import android.content.Context;
-import android.content.SharedPreferences;
-import android.os.BatteryStats;
-import android.os.Bundle;
-import android.os.UserHandle;
-import android.os.UserManager;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.view.ViewGroup;
-import android.widget.ImageView;
-import android.widget.TextView;
-
-import androidx.activity.ComponentActivity;
-import androidx.activity.result.ActivityResultLauncher;
-import androidx.annotation.NonNull;
-import androidx.annotation.Nullable;
-import androidx.loader.app.LoaderManager;
-import androidx.loader.app.LoaderManager.LoaderCallbacks;
-import androidx.loader.content.Loader;
-import androidx.recyclerview.widget.LinearLayoutManager;
-import androidx.recyclerview.widget.RecyclerView;
-
-import com.android.internal.os.BatteryStatsHelper;
-import com.android.settingslib.utils.AsyncLoaderCompat;
-
-import java.util.Collections;
-import java.util.List;
-import java.util.Locale;
-
-public class PowerStatsViewerActivity extends ComponentActivity {
- private static final int POWER_STATS_REFRESH_RATE_MILLIS = 60 * 1000;
- public static final String PREF_SELECTED_POWER_CONSUMER = "powerConsumerId";
- private static final String LOADER_ARG_POWER_CONSUMER_ID = "powerConsumerId";
-
- private PowerStatsDataAdapter mPowerStatsDataAdapter;
- private Runnable mPowerStatsRefresh = this::periodicPowerStatsRefresh;
- private SharedPreferences mSharedPref;
- private String mPowerConsumerId;
- private TextView mTitleView;
- private TextView mDetailsView;
- private ImageView mIconView;
- private TextView mPackagesView;
- private RecyclerView mPowerStatsDataView;
- private View mLoadingView;
- private View mEmptyView;
- private ActivityResultLauncher<Void> mStartAppPicker = registerForActivityResult(
- PowerConsumerPickerActivity.CONTRACT, this::onApplicationSelected);
-
- @Override
- protected void onCreate(@Nullable Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
-
- mSharedPref = getPreferences(Context.MODE_PRIVATE);
-
- setContentView(R.layout.power_stats_viewer_layout);
-
- View appCard = findViewById(R.id.app_card);
- appCard.setOnClickListener((e) -> startAppPicker());
-
- mTitleView = findViewById(android.R.id.title);
- mDetailsView = findViewById(R.id.details);
- mIconView = findViewById(android.R.id.icon);
- mPackagesView = findViewById(R.id.packages);
-
- mPowerStatsDataView = findViewById(R.id.power_stats_data_view);
- mPowerStatsDataView.setLayoutManager(new LinearLayoutManager(this));
- mPowerStatsDataAdapter = new PowerStatsDataAdapter();
- mPowerStatsDataView.setAdapter(mPowerStatsDataAdapter);
-
- mLoadingView = findViewById(R.id.loading_view);
- mEmptyView = findViewById(R.id.empty_view);
-
- mPowerConsumerId = mSharedPref.getString(PREF_SELECTED_POWER_CONSUMER, null);
- loadPowerStats();
- if (mPowerConsumerId == null) {
- startAppPicker();
- }
- }
-
- @Override
- protected void onResume() {
- super.onResume();
- periodicPowerStatsRefresh();
- }
-
- @Override
- protected void onPause() {
- super.onPause();
- getMainThreadHandler().removeCallbacks(mPowerStatsRefresh);
- }
-
- private void startAppPicker() {
- mStartAppPicker.launch(null);
- }
-
- private void onApplicationSelected(String powerConsumerId) {
- if (powerConsumerId == null) {
- if (mPowerConsumerId == null) {
- finish();
- }
- } else {
- mPowerConsumerId = powerConsumerId;
- mSharedPref.edit().putString(PREF_SELECTED_POWER_CONSUMER, mPowerConsumerId).apply();
- mLoadingView.setVisibility(View.VISIBLE);
- loadPowerStats();
- }
- }
-
- private void periodicPowerStatsRefresh() {
- loadPowerStats();
- getMainThreadHandler().postDelayed(mPowerStatsRefresh, POWER_STATS_REFRESH_RATE_MILLIS);
- }
-
- private void loadPowerStats() {
- Bundle args = new Bundle();
- args.putString(LOADER_ARG_POWER_CONSUMER_ID, mPowerConsumerId);
- LoaderManager.getInstance(this).restartLoader(0, args, new PowerStatsDataLoaderCallbacks());
- }
-
- private static class PowerStatsDataLoader extends AsyncLoaderCompat<PowerStatsData> {
- private final String mPowerConsumerId;
- private final BatteryStatsHelper mBatteryStatsHelper;
- private final UserManager mUserManager;
-
- PowerStatsDataLoader(Context context, String powerConsumerId) {
- super(context);
- mPowerConsumerId = powerConsumerId;
- mUserManager = context.getSystemService(UserManager.class);
- mBatteryStatsHelper = new BatteryStatsHelper(context,
- false /* collectBatteryBroadcast */);
- mBatteryStatsHelper.create((Bundle) null);
- mBatteryStatsHelper.clearStats();
- }
-
- @Override
- public PowerStatsData loadInBackground() {
- mBatteryStatsHelper.refreshStats(BatteryStats.STATS_SINCE_CHARGED,
- UserHandle.myUserId());
- return new PowerStatsData(getContext(), mBatteryStatsHelper, mPowerConsumerId);
- }
-
- @Override
- protected void onDiscardResult(PowerStatsData result) {
- }
- }
-
- private class PowerStatsDataLoaderCallbacks implements LoaderCallbacks<PowerStatsData> {
- @NonNull
- @Override
- public Loader<PowerStatsData> onCreateLoader(int id, Bundle args) {
- return new PowerStatsDataLoader(PowerStatsViewerActivity.this,
- args.getString(LOADER_ARG_POWER_CONSUMER_ID));
- }
-
- @Override
- public void onLoadFinished(@NonNull Loader<PowerStatsData> loader,
- PowerStatsData powerStatsData) {
-
- PowerConsumerInfoHelper.PowerConsumerInfo
- powerConsumerInfo = powerStatsData.getPowerConsumerInfo();
- if (powerConsumerInfo == null) {
- mTitleView.setText("Power consumer not found");
- mPackagesView.setVisibility(View.GONE);
- } else {
- mTitleView.setText(powerConsumerInfo.label);
- if (powerConsumerInfo.details != null) {
- mDetailsView.setText(powerConsumerInfo.details);
- mDetailsView.setVisibility(View.VISIBLE);
- } else {
- mDetailsView.setVisibility(View.GONE);
- }
- mIconView.setImageDrawable(
- powerConsumerInfo.iconInfo.loadIcon(getPackageManager()));
-
- if (powerConsumerInfo.packages != null) {
- mPackagesView.setText(powerConsumerInfo.packages);
- mPackagesView.setVisibility(View.VISIBLE);
- } else {
- mPackagesView.setVisibility(View.GONE);
- }
- }
-
- mPowerStatsDataAdapter.setEntries(powerStatsData.getEntries());
- if (powerStatsData.getEntries().isEmpty()) {
- mEmptyView.setVisibility(View.VISIBLE);
- mPowerStatsDataView.setVisibility(View.GONE);
- } else {
- mEmptyView.setVisibility(View.GONE);
- mPowerStatsDataView.setVisibility(View.VISIBLE);
- }
-
- mLoadingView.setVisibility(View.GONE);
- }
-
- @Override
- public void onLoaderReset(@NonNull Loader<PowerStatsData> loader) {
- }
- }
-
- private static class PowerStatsDataAdapter extends
- RecyclerView.Adapter<PowerStatsDataAdapter.ViewHolder> {
- public static class ViewHolder extends RecyclerView.ViewHolder {
- public TextView titleTextView;
- public TextView amountTextView;
- public TextView percentTextView;
-
- ViewHolder(View itemView) {
- super(itemView);
-
- titleTextView = itemView.findViewById(R.id.title);
- amountTextView = itemView.findViewById(R.id.amount);
- percentTextView = itemView.findViewById(R.id.percent);
- }
- }
-
- private List<PowerStatsData.Entry> mEntries = Collections.emptyList();
-
- public void setEntries(List<PowerStatsData.Entry> entries) {
- mEntries = entries;
- notifyDataSetChanged();
- }
-
- @Override
- public int getItemCount() {
- return mEntries.size();
- }
-
- @NonNull
- @Override
- public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int position) {
- LayoutInflater layoutInflater = LayoutInflater.from(parent.getContext());
- View itemView = layoutInflater.inflate(R.layout.power_stats_entry_layout, parent,
- false);
- return new ViewHolder(itemView);
- }
-
- @Override
- public void onBindViewHolder(@NonNull ViewHolder viewHolder, int position) {
- PowerStatsData.Entry entry = mEntries.get(position);
- switch (entry.entryType) {
- case POWER:
- viewHolder.titleTextView.setText(entry.title);
- viewHolder.amountTextView.setText(
- String.format(Locale.getDefault(), "%.1f mAh", entry.value));
- break;
- case DURATION:
- viewHolder.titleTextView.setText(entry.title);
- viewHolder.amountTextView.setText(
- String.format(Locale.getDefault(), "%,d ms", (long) entry.value));
- break;
- }
-
- double proportion = entry.total != 0 ? entry.value * 100 / entry.total : 0;
- viewHolder.percentTextView.setText(String.format(Locale.getDefault(), "%.1f%%",
- proportion));
- }
- }
-}
diff --git a/data/etc/car/Android.bp b/data/etc/car/Android.bp
index 3e3aefc6f51d..7f20b3bf2c40 100644
--- a/data/etc/car/Android.bp
+++ b/data/etc/car/Android.bp
@@ -159,6 +159,13 @@ prebuilt_etc {
}
prebuilt_etc {
+ name: "privapp_allowlist_com.google.android.car.networking.preferenceupdater",
+ sub_dir: "permissions",
+ src: "com.google.android.car.networking.preferenceupdater.xml",
+ filename_from_src: true,
+}
+
+prebuilt_etc {
name: "allowed_privapp_com.android.carshell",
sub_dir: "permissions",
src: "com.android.car.shell.xml",
diff --git a/data/etc/car/com.android.car.provision.xml b/data/etc/car/com.android.car.provision.xml
index 474cd543d593..4fd9cae53bd7 100644
--- a/data/etc/car/com.android.car.provision.xml
+++ b/data/etc/car/com.android.car.provision.xml
@@ -18,6 +18,8 @@
<privapp-permissions package="com.android.car.provision">
<permission name="android.car.permission.CAR_POWERTRAIN"/>
<permission name="android.permission.INTERACT_ACROSS_USERS"/>
+ <permission name="android.permission.INTERACT_ACROSS_USERS_FULL"/>
+ <permission name="android.permission.MANAGE_USERS"/>
<permission name="android.permission.MASTER_CLEAR"/>
<permission name="android.permission.QUERY_ALL_PACKAGES"/>
<permission name="android.permission.SEND_CATEGORY_CAR_NOTIFICATIONS"/>
diff --git a/data/etc/car/com.google.android.car.networking.preferenceupdater.xml b/data/etc/car/com.google.android.car.networking.preferenceupdater.xml
new file mode 100644
index 000000000000..489ce1b47ffa
--- /dev/null
+++ b/data/etc/car/com.google.android.car.networking.preferenceupdater.xml
@@ -0,0 +1,27 @@
+<?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
+ -->
+<permissions>
+ <privapp-permissions package="com.google.android.car.networking.preferenceupdater">
+ <permission name="android.permission.ACCESS_NETWORK_STATE"/>
+ <permission name="android.permission.ACCESS_WIFI_STATE"/>
+ <permission name="android.permission.ACTIVITY_EMBEDDING"/>
+ <permission name="android.permission.INTERACT_ACROSS_USERS"/>
+ <permission name="android.permission.INTERACT_ACROSS_USERS_FULL"/>
+ <permission name="android.permission.CONNECTIVITY_USE_RESTRICTED_NETWORKS"/>
+ <permission name="android.permission.LOCATION_HARDWARE"/>
+ </privapp-permissions>
+</permissions>
diff --git a/data/etc/com.android.documentsui.xml b/data/etc/com.android.documentsui.xml
index 1e570ba9ac1c..d32cbecb16ec 100644
--- a/data/etc/com.android.documentsui.xml
+++ b/data/etc/com.android.documentsui.xml
@@ -22,5 +22,6 @@
<permission name="android.permission.LOG_COMPAT_CHANGE"/>
<permission name="android.permission.MODIFY_QUIET_MODE"/>
<permission name="android.permission.READ_COMPAT_CHANGE_CONFIG"/>
+ <permission name="android.permission.START_FOREGROUND_SERVICES_FROM_BACKGROUND"/>
</privapp-permissions>
</permissions>
diff --git a/data/etc/privapp-permissions-platform.xml b/data/etc/privapp-permissions-platform.xml
index 5f129fe03b61..0a77be967ace 100644
--- a/data/etc/privapp-permissions-platform.xml
+++ b/data/etc/privapp-permissions-platform.xml
@@ -210,6 +210,7 @@ applications that come with the platform
<privapp-permissions package="com.android.providers.contacts">
<permission name="android.permission.BIND_DIRECTORY_SEARCH"/>
+ <permission name="android.permission.CHANGE_DEVICE_IDLE_TEMP_WHITELIST"/>
<permission name="android.permission.GET_ACCOUNTS_PRIVILEGED"/>
<permission name="android.permission.INTERACT_ACROSS_USERS"/>
<permission name="android.permission.MANAGE_USERS"/>
@@ -245,6 +246,7 @@ applications that come with the platform
<permission name="android.permission.REGISTER_STATS_PULL_ATOM" />
<!-- Permissions required for reading DeviceConfig -->
<permission name="android.permission.READ_DEVICE_CONFIG" />
+ <permission name="android.permission.START_FOREGROUND_SERVICES_FROM_BACKGROUND"/>
</privapp-permissions>
<privapp-permissions package="com.android.providers.telephony">
diff --git a/data/etc/services.core.protolog.json b/data/etc/services.core.protolog.json
index a5667b2f0a8a..d8a735c78ca3 100644
--- a/data/etc/services.core.protolog.json
+++ b/data/etc/services.core.protolog.json
@@ -1021,12 +1021,6 @@
"group": "WM_ERROR",
"at": "com\/android\/server\/wm\/WindowManagerService.java"
},
- "-903853754": {
- "message": "pauseBackStacks: stack=%s mResumedActivity=%s",
- "level": "DEBUG",
- "group": "WM_DEBUG_STATES",
- "at": "com\/android\/server\/wm\/TaskDisplayArea.java"
- },
"-883738232": {
"message": "Adding more than one toast window for UID at a time.",
"level": "WARN",
@@ -1069,6 +1063,12 @@
"group": "WM_DEBUG_TASKS",
"at": "com\/android\/server\/wm\/ActivityTaskSupervisor.java"
},
+ "-856590985": {
+ "message": "dcTarget: %s mImeRequester: %s",
+ "level": "DEBUG",
+ "group": "WM_DEBUG_IME",
+ "at": "com\/android\/server\/wm\/ImeInsetsSourceProvider.java"
+ },
"-856025122": {
"message": "SURFACE transparentRegionHint=%s: %s",
"level": "INFO",
@@ -1717,12 +1717,6 @@
"group": "WM_SHOW_TRANSACTIONS",
"at": "com\/android\/server\/wm\/Session.java"
},
- "-49129622": {
- "message": "performLayout: Activity exiting now removed %s",
- "level": "VERBOSE",
- "group": "WM_DEBUG_ADD_REMOVE",
- "at": "com\/android\/server\/wm\/TaskDisplayArea.java"
- },
"-33096143": {
"message": "applyAnimation: transition animation is disabled or skipped. container=%s",
"level": "VERBOSE",
@@ -1777,6 +1771,12 @@
"group": "WM_ERROR",
"at": "com\/android\/server\/wm\/WindowManagerService.java"
},
+ "44438983": {
+ "message": "performLayout: Activity exiting now removed %s",
+ "level": "VERBOSE",
+ "group": "WM_DEBUG_ADD_REMOVE",
+ "at": "com\/android\/server\/wm\/DisplayContent.java"
+ },
"45285419": {
"message": "startingWindow was set but startingSurface==null, couldn't remove",
"level": "VERBOSE",
@@ -1837,12 +1837,6 @@
"group": "WM_ERROR",
"at": "com\/android\/server\/wm\/WindowContextListenerController.java"
},
- "91350919": {
- "message": "Attempted to set IME flag to a display that does not exist: %d",
- "level": "WARN",
- "group": "WM_ERROR",
- "at": "com\/android\/server\/wm\/WindowManagerService.java"
- },
"94402792": {
"message": "Moving to RESUMED: %s (in existing)",
"level": "VERBOSE",
@@ -2125,6 +2119,12 @@
"group": "WM_DEBUG_APP_TRANSITIONS",
"at": "com\/android\/server\/wm\/AppTransition.java"
},
+ "349443311": {
+ "message": "pauseBackStacks: task=%s mResumedActivity=%s",
+ "level": "DEBUG",
+ "group": "WM_DEBUG_STATES",
+ "at": "com\/android\/server\/wm\/TaskDisplayArea.java"
+ },
"355720268": {
"message": "stopFreezingDisplayLocked: Unfreezing now",
"level": "DEBUG",
@@ -2383,12 +2383,6 @@
"group": "WM_ERROR",
"at": "com\/android\/server\/wm\/WindowManagerService.java"
},
- "632168013": {
- "message": "dcTarget: %s mImeTargetFromIme: %s",
- "level": "DEBUG",
- "group": "WM_DEBUG_IME",
- "at": "com\/android\/server\/wm\/ImeInsetsSourceProvider.java"
- },
"633654009": {
"message": "SURFACE POS (setPositionInTransaction) @ (%f,%f): %s",
"level": "INFO",
diff --git a/graphics/java/android/graphics/OWNERS b/graphics/java/android/graphics/OWNERS
index 61968890b837..c3fb6f8eba7c 100644
--- a/graphics/java/android/graphics/OWNERS
+++ b/graphics/java/android/graphics/OWNERS
@@ -4,3 +4,5 @@ romainguy@google.com
jreck@google.com
njawad@google.com
sumir@google.com
+
+per-file BLASTBufferQueue.java = file:/services/core/java/com/android/server/wm/OWNERS
diff --git a/graphics/java/android/graphics/ParcelableColorSpace.java b/graphics/java/android/graphics/ParcelableColorSpace.java
index 326084924450..748d66cb5f6c 100644
--- a/graphics/java/android/graphics/ParcelableColorSpace.java
+++ b/graphics/java/android/graphics/ParcelableColorSpace.java
@@ -22,18 +22,19 @@ import android.os.Parcel;
import android.os.Parcelable;
/**
- * A {@link Parcelable} {@link ColorSpace}. In order to enable parceling, the ColorSpace
- * must be either a {@link ColorSpace.Named Named} ColorSpace or a {@link ColorSpace.Rgb} instance
- * that has an ICC parametric transfer function as returned by {@link Rgb#getTransferParameters()}.
+ * A {@link Parcelable} wrapper for a {@link ColorSpace}. In order to enable parceling, the
+ * ColorSpace must be either a {@link ColorSpace.Named Named} ColorSpace or a
+ * {@link ColorSpace.Rgb} instance that has an ICC parametric transfer function as returned by
+ * {@link ColorSpace.Rgb#getTransferParameters()}.
*/
-public final class ParcelableColorSpace extends ColorSpace implements Parcelable {
+public final class ParcelableColorSpace implements Parcelable {
private final ColorSpace mColorSpace;
/**
* Checks if the given ColorSpace is able to be parceled. A ColorSpace can only be
* parceled if it is a {@link ColorSpace.Named Named} ColorSpace or a {@link ColorSpace.Rgb}
* instance that has an ICC parametric transfer function as returned by
- * {@link Rgb#getTransferParameters()}
+ * {@link ColorSpace.Rgb#getTransferParameters()}
*/
public static boolean isParcelable(@NonNull ColorSpace colorSpace) {
if (colorSpace.getId() == ColorSpace.MIN_ID) {
@@ -57,7 +58,6 @@ public final class ParcelableColorSpace extends ColorSpace implements Parcelable
* to be parceled. See {@link #isParcelable(ColorSpace)}.
*/
public ParcelableColorSpace(@NonNull ColorSpace colorSpace) {
- super(colorSpace.getName(), colorSpace.getModel(), colorSpace.getId());
mColorSpace = colorSpace;
if (mColorSpace.getId() == ColorSpace.MIN_ID) {
@@ -139,31 +139,6 @@ public final class ParcelableColorSpace extends ColorSpace implements Parcelable
};
@Override
- public boolean isWideGamut() {
- return mColorSpace.isWideGamut();
- }
-
- @Override
- public float getMinValue(int component) {
- return mColorSpace.getMinValue(component);
- }
-
- @Override
- public float getMaxValue(int component) {
- return mColorSpace.getMaxValue(component);
- }
-
- @Override
- public @NonNull float[] toXyz(@NonNull float[] v) {
- return mColorSpace.toXyz(v);
- }
-
- @Override
- public @NonNull float[] fromXyz(@NonNull float[] v) {
- return mColorSpace.fromXyz(v);
- }
-
- @Override
public boolean equals(@Nullable Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
@@ -175,10 +150,4 @@ public final class ParcelableColorSpace extends ColorSpace implements Parcelable
public int hashCode() {
return mColorSpace.hashCode();
}
-
- /** @hide */
- @Override
- long getNativeInstance() {
- return mColorSpace.getNativeInstance();
- }
}
diff --git a/keystore/java/android/security/KeyStoreOperation.java b/keystore/java/android/security/KeyStoreOperation.java
index 49a48871fd30..7ea9e1438845 100644
--- a/keystore/java/android/security/KeyStoreOperation.java
+++ b/keystore/java/android/security/KeyStoreOperation.java
@@ -17,7 +17,7 @@
package android.security;
import android.annotation.NonNull;
-import android.hardware.keymint.KeyParameter;
+import android.hardware.security.keymint.KeyParameter;
import android.os.RemoteException;
import android.os.ServiceSpecificException;
import android.security.keymaster.KeymasterDefs;
diff --git a/keystore/java/android/security/KeyStoreSecurityLevel.java b/keystore/java/android/security/KeyStoreSecurityLevel.java
index 7c3de8bee475..3ef4aa5b7ec3 100644
--- a/keystore/java/android/security/KeyStoreSecurityLevel.java
+++ b/keystore/java/android/security/KeyStoreSecurityLevel.java
@@ -18,7 +18,7 @@ package android.security;
import android.annotation.NonNull;
import android.app.compat.CompatChanges;
-import android.hardware.keymint.KeyParameter;
+import android.hardware.security.keymint.KeyParameter;
import android.os.RemoteException;
import android.os.ServiceSpecificException;
import android.security.keystore.BackendBusyException;
diff --git a/keystore/java/android/security/keystore2/AndroidKeyStore3DESCipherSpi.java b/keystore/java/android/security/keystore2/AndroidKeyStore3DESCipherSpi.java
index 69c7a2589d6f..0775a1a99886 100644
--- a/keystore/java/android/security/keystore2/AndroidKeyStore3DESCipherSpi.java
+++ b/keystore/java/android/security/keystore2/AndroidKeyStore3DESCipherSpi.java
@@ -17,7 +17,7 @@
package android.security.keystore2;
import android.annotation.NonNull;
-import android.hardware.keymint.KeyParameter;
+import android.hardware.security.keymint.KeyParameter;
import android.security.keymaster.KeymasterDefs;
import android.security.keystore.ArrayUtils;
import android.security.keystore.KeyProperties;
diff --git a/keystore/java/android/security/keystore2/AndroidKeyStoreAuthenticatedAESCipherSpi.java b/keystore/java/android/security/keystore2/AndroidKeyStoreAuthenticatedAESCipherSpi.java
index 2b5f6c31607b..bc56f015f3bd 100644
--- a/keystore/java/android/security/keystore2/AndroidKeyStoreAuthenticatedAESCipherSpi.java
+++ b/keystore/java/android/security/keystore2/AndroidKeyStoreAuthenticatedAESCipherSpi.java
@@ -18,7 +18,7 @@ package android.security.keystore2;
import android.annotation.NonNull;
import android.annotation.Nullable;
-import android.hardware.keymint.KeyParameter;
+import android.hardware.security.keymint.KeyParameter;
import android.security.KeyStoreException;
import android.security.KeyStoreOperation;
import android.security.keymaster.KeymasterDefs;
diff --git a/keystore/java/android/security/keystore2/AndroidKeyStoreCipherSpiBase.java b/keystore/java/android/security/keystore2/AndroidKeyStoreCipherSpiBase.java
index 18d26922f1ae..a3b04abfba3f 100644
--- a/keystore/java/android/security/keystore2/AndroidKeyStoreCipherSpiBase.java
+++ b/keystore/java/android/security/keystore2/AndroidKeyStoreCipherSpiBase.java
@@ -19,7 +19,7 @@ package android.security.keystore2;
import android.annotation.CallSuper;
import android.annotation.NonNull;
import android.annotation.Nullable;
-import android.hardware.keymint.KeyParameter;
+import android.hardware.security.keymint.KeyParameter;
import android.security.KeyStoreException;
import android.security.KeyStoreOperation;
import android.security.keymaster.KeymasterDefs;
diff --git a/keystore/java/android/security/keystore2/AndroidKeyStoreECDSASignatureSpi.java b/keystore/java/android/security/keystore2/AndroidKeyStoreECDSASignatureSpi.java
index 2250c89aac41..d1ef1df817e6 100644
--- a/keystore/java/android/security/keystore2/AndroidKeyStoreECDSASignatureSpi.java
+++ b/keystore/java/android/security/keystore2/AndroidKeyStoreECDSASignatureSpi.java
@@ -17,7 +17,7 @@
package android.security.keystore2;
import android.annotation.NonNull;
-import android.hardware.keymint.KeyParameter;
+import android.hardware.security.keymint.KeyParameter;
import android.security.KeyStoreException;
import android.security.KeyStoreOperation;
import android.security.keymaster.KeymasterDefs;
diff --git a/keystore/java/android/security/keystore2/AndroidKeyStoreHmacSpi.java b/keystore/java/android/security/keystore2/AndroidKeyStoreHmacSpi.java
index eea45c287622..8475ad9fd57b 100644
--- a/keystore/java/android/security/keystore2/AndroidKeyStoreHmacSpi.java
+++ b/keystore/java/android/security/keystore2/AndroidKeyStoreHmacSpi.java
@@ -16,7 +16,7 @@
package android.security.keystore2;
-import android.hardware.keymint.KeyParameter;
+import android.hardware.security.keymint.KeyParameter;
import android.security.KeyStoreException;
import android.security.KeyStoreOperation;
import android.security.keymaster.KeymasterDefs;
diff --git a/keystore/java/android/security/keystore2/AndroidKeyStoreKeyGeneratorSpi.java b/keystore/java/android/security/keystore2/AndroidKeyStoreKeyGeneratorSpi.java
index 479fd8a6a73a..233f352989ab 100644
--- a/keystore/java/android/security/keystore2/AndroidKeyStoreKeyGeneratorSpi.java
+++ b/keystore/java/android/security/keystore2/AndroidKeyStoreKeyGeneratorSpi.java
@@ -16,8 +16,8 @@
package android.security.keystore2;
-import android.hardware.keymint.KeyParameter;
-import android.hardware.keymint.SecurityLevel;
+import android.hardware.security.keymint.KeyParameter;
+import android.hardware.security.keymint.SecurityLevel;
import android.security.KeyStore2;
import android.security.KeyStoreSecurityLevel;
import android.security.keymaster.KeymasterArguments;
diff --git a/keystore/java/android/security/keystore2/AndroidKeyStoreKeyPairGeneratorSpi.java b/keystore/java/android/security/keystore2/AndroidKeyStoreKeyPairGeneratorSpi.java
index 61725e3e8c24..df0e1462a492 100644
--- a/keystore/java/android/security/keystore2/AndroidKeyStoreKeyPairGeneratorSpi.java
+++ b/keystore/java/android/security/keystore2/AndroidKeyStoreKeyPairGeneratorSpi.java
@@ -18,8 +18,8 @@ package android.security.keystore2;
import android.annotation.NonNull;
import android.annotation.Nullable;
-import android.hardware.keymint.KeyParameter;
-import android.hardware.keymint.SecurityLevel;
+import android.hardware.security.keymint.KeyParameter;
+import android.hardware.security.keymint.SecurityLevel;
import android.os.Build;
import android.security.KeyPairGeneratorSpec;
import android.security.KeyStore2;
diff --git a/keystore/java/android/security/keystore2/AndroidKeyStoreRSACipherSpi.java b/keystore/java/android/security/keystore2/AndroidKeyStoreRSACipherSpi.java
index 2686ddc20c1d..951f91887894 100644
--- a/keystore/java/android/security/keystore2/AndroidKeyStoreRSACipherSpi.java
+++ b/keystore/java/android/security/keystore2/AndroidKeyStoreRSACipherSpi.java
@@ -18,7 +18,7 @@ package android.security.keystore2;
import android.annotation.NonNull;
import android.annotation.Nullable;
-import android.hardware.keymint.KeyParameter;
+import android.hardware.security.keymint.KeyParameter;
import android.security.keymaster.KeymasterDefs;
import android.security.keystore.KeyProperties;
import android.security.keystore.KeymasterUtils;
diff --git a/keystore/java/android/security/keystore2/AndroidKeyStoreRSASignatureSpi.java b/keystore/java/android/security/keystore2/AndroidKeyStoreRSASignatureSpi.java
index 444dad4cffbe..ab7559116a41 100644
--- a/keystore/java/android/security/keystore2/AndroidKeyStoreRSASignatureSpi.java
+++ b/keystore/java/android/security/keystore2/AndroidKeyStoreRSASignatureSpi.java
@@ -17,7 +17,7 @@
package android.security.keystore2;
import android.annotation.NonNull;
-import android.hardware.keymint.KeyParameter;
+import android.hardware.security.keymint.KeyParameter;
import android.security.keymaster.KeymasterDefs;
import android.security.keystore.KeyProperties;
diff --git a/keystore/java/android/security/keystore2/AndroidKeyStoreSignatureSpiBase.java b/keystore/java/android/security/keystore2/AndroidKeyStoreSignatureSpiBase.java
index a168f8feb3db..9b4f01e744f7 100644
--- a/keystore/java/android/security/keystore2/AndroidKeyStoreSignatureSpiBase.java
+++ b/keystore/java/android/security/keystore2/AndroidKeyStoreSignatureSpiBase.java
@@ -18,7 +18,7 @@ package android.security.keystore2;
import android.annotation.CallSuper;
import android.annotation.NonNull;
-import android.hardware.keymint.KeyParameter;
+import android.hardware.security.keymint.KeyParameter;
import android.security.KeyStoreException;
import android.security.KeyStoreOperation;
import android.security.keymaster.KeymasterDefs;
diff --git a/keystore/java/android/security/keystore2/AndroidKeyStoreSpi.java b/keystore/java/android/security/keystore2/AndroidKeyStoreSpi.java
index 9790a4ae5b65..aca531458382 100644
--- a/keystore/java/android/security/keystore2/AndroidKeyStoreSpi.java
+++ b/keystore/java/android/security/keystore2/AndroidKeyStoreSpi.java
@@ -18,9 +18,9 @@ package android.security.keystore2;
import android.annotation.NonNull;
import android.hardware.biometrics.BiometricManager;
-import android.hardware.keymint.HardwareAuthenticatorType;
-import android.hardware.keymint.KeyParameter;
-import android.hardware.keymint.SecurityLevel;
+import android.hardware.security.keymint.HardwareAuthenticatorType;
+import android.hardware.security.keymint.KeyParameter;
+import android.hardware.security.keymint.SecurityLevel;
import android.security.GateKeeper;
import android.security.KeyStore2;
import android.security.KeyStoreParameter;
diff --git a/keystore/java/android/security/keystore2/AndroidKeyStoreUnauthenticatedAESCipherSpi.java b/keystore/java/android/security/keystore2/AndroidKeyStoreUnauthenticatedAESCipherSpi.java
index a2d4528b99fd..4d4b0d8f183b 100644
--- a/keystore/java/android/security/keystore2/AndroidKeyStoreUnauthenticatedAESCipherSpi.java
+++ b/keystore/java/android/security/keystore2/AndroidKeyStoreUnauthenticatedAESCipherSpi.java
@@ -18,7 +18,7 @@ package android.security.keystore2;
import android.annotation.NonNull;
import android.annotation.Nullable;
-import android.hardware.keymint.KeyParameter;
+import android.hardware.security.keymint.KeyParameter;
import android.security.keymaster.KeymasterDefs;
import android.security.keystore.ArrayUtils;
import android.security.keystore.KeyProperties;
diff --git a/keystore/java/android/security/keystore2/KeyStore2ParameterUtils.java b/keystore/java/android/security/keystore2/KeyStore2ParameterUtils.java
index 8fa532b6e188..18c786aa3093 100644
--- a/keystore/java/android/security/keystore2/KeyStore2ParameterUtils.java
+++ b/keystore/java/android/security/keystore2/KeyStore2ParameterUtils.java
@@ -18,8 +18,8 @@ package android.security.keystore2;
import android.annotation.NonNull;
import android.hardware.biometrics.BiometricManager;
-import android.hardware.keymint.KeyParameter;
-import android.hardware.keymint.SecurityLevel;
+import android.hardware.security.keymint.KeyParameter;
+import android.hardware.security.keymint.SecurityLevel;
import android.security.GateKeeper;
import android.security.keymaster.KeymasterDefs;
import android.security.keystore.KeyProperties;
diff --git a/libs/WindowManager/Shell/res/values/config.xml b/libs/WindowManager/Shell/res/values/config.xml
index f0eae97b107e..807e5afae890 100644
--- a/libs/WindowManager/Shell/res/values/config.xml
+++ b/libs/WindowManager/Shell/res/values/config.xml
@@ -42,16 +42,4 @@
<!-- Bounds [left top right bottom] on screen for picture-in-picture (PIP) windows,
when the PIP menu is shown in center. -->
<string translatable="false" name="pip_menu_bounds">"596 280 1324 690"</string>
-
- <!-- Gravity of letterboxed apps in portrait screen orientation.
- Can be Gravity.TOP, Gravity.CENTER or Gravity.BOTTOM.
- Any other value will result in runtime exception for a letterboxed activity.
- Default is Gravity.TOP. -->
- <integer name="config_letterboxPortraitGravity">0x00000030</integer>
-
- <!-- Gravity of letterboxed apps in landscape screen orientation.
- Can be Gravity.LEFT, Gravity.CENTER or Gravity.RIGHT.
- Any other value will result in runtime exception for a letterboxed activity.
- Default is Gravity.CENTER. -->
- <integer name="config_letterboxLandscapeGravity">0x00000011</integer>
</resources>
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/FullscreenTaskListener.java b/libs/WindowManager/Shell/src/com/android/wm/shell/FullscreenTaskListener.java
index 4f13b83bc29d..63d31182a748 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/FullscreenTaskListener.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/FullscreenTaskListener.java
@@ -20,8 +20,9 @@ import static com.android.wm.shell.ShellTaskOrganizer.TASK_LISTENER_TYPE_FULLSCR
import static com.android.wm.shell.ShellTaskOrganizer.taskListenerTypeToString;
import android.app.ActivityManager;
-import android.util.ArraySet;
+import android.graphics.Point;
import android.util.Slog;
+import android.util.SparseArray;
import android.view.SurfaceControl;
import androidx.annotation.NonNull;
@@ -40,7 +41,7 @@ public class FullscreenTaskListener implements ShellTaskOrganizer.TaskListener {
private final SyncTransactionQueue mSyncQueue;
- private final ArraySet<Integer> mTasks = new ArraySet<>();
+ private final SparseArray<SurfaceControl> mLeashByTaskId = new SparseArray<>();
public FullscreenTaskListener(SyncTransactionQueue syncQueue) {
mSyncQueue = syncQueue;
@@ -48,39 +49,44 @@ public class FullscreenTaskListener implements ShellTaskOrganizer.TaskListener {
@Override
public void onTaskAppeared(ActivityManager.RunningTaskInfo taskInfo, SurfaceControl leash) {
- synchronized (mTasks) {
- if (mTasks.contains(taskInfo.taskId)) {
- throw new RuntimeException("Task appeared more than once: #" + taskInfo.taskId);
- }
- ProtoLog.v(ShellProtoLogGroup.WM_SHELL_TASK_ORG, "Fullscreen Task Appeared: #%d",
- taskInfo.taskId);
- mTasks.add(taskInfo.taskId);
- mSyncQueue.runInSync(t -> {
- // Reset several properties back to fullscreen (PiP, for example, leaves all these
- // properties in a bad state).
- t.setWindowCrop(leash, null);
- t.setPosition(leash, 0, 0);
- // TODO(shell-transitions): Eventually set everything in transition so there's no
- // SF Transaction here.
- if (!Transitions.ENABLE_SHELL_TRANSITIONS) {
- t.setAlpha(leash, 1f);
- t.setMatrix(leash, 1, 0, 0, 1);
- t.show(leash);
- }
- });
+ if (mLeashByTaskId.get(taskInfo.taskId) != null) {
+ throw new IllegalStateException("Task appeared more than once: #" + taskInfo.taskId);
}
+ ProtoLog.v(ShellProtoLogGroup.WM_SHELL_TASK_ORG, "Fullscreen Task Appeared: #%d",
+ taskInfo.taskId);
+ mLeashByTaskId.put(taskInfo.taskId, leash);
+ final Point positionInParent = taskInfo.positionInParent;
+ mSyncQueue.runInSync(t -> {
+ // Reset several properties back to fullscreen (PiP, for example, leaves all these
+ // properties in a bad state).
+ t.setWindowCrop(leash, null);
+ t.setPosition(leash, positionInParent.x, positionInParent.y);
+ // TODO(shell-transitions): Eventually set everything in transition so there's no
+ // SF Transaction here.
+ if (!Transitions.ENABLE_SHELL_TRANSITIONS) {
+ t.setAlpha(leash, 1f);
+ t.setMatrix(leash, 1, 0, 0, 1);
+ t.show(leash);
+ }
+ });
+ }
+
+ @Override
+ public void onTaskInfoChanged(ActivityManager.RunningTaskInfo taskInfo) {
+ final SurfaceControl leash = mLeashByTaskId.get(taskInfo.taskId);
+ final Point positionInParent = taskInfo.positionInParent;
+ mSyncQueue.runInSync(t -> t.setPosition(leash, positionInParent.x, positionInParent.y));
}
@Override
public void onTaskVanished(ActivityManager.RunningTaskInfo taskInfo) {
- synchronized (mTasks) {
- if (!mTasks.remove(taskInfo.taskId)) {
- Slog.e(TAG, "Task already vanished: #" + taskInfo.taskId);
- return;
- }
- ProtoLog.v(ShellProtoLogGroup.WM_SHELL_TASK_ORG, "Fullscreen Task Vanished: #%d",
- taskInfo.taskId);
+ if (mLeashByTaskId.get(taskInfo.taskId) == null) {
+ Slog.e(TAG, "Task already vanished: #" + taskInfo.taskId);
+ return;
}
+ mLeashByTaskId.remove(taskInfo.taskId);
+ ProtoLog.v(ShellProtoLogGroup.WM_SHELL_TASK_ORG, "Fullscreen Task Vanished: #%d",
+ taskInfo.taskId);
}
@Override
@@ -88,7 +94,7 @@ public class FullscreenTaskListener implements ShellTaskOrganizer.TaskListener {
final String innerPrefix = prefix + " ";
final String childPrefix = innerPrefix + " ";
pw.println(prefix + this);
- pw.println(innerPrefix + mTasks.size() + " Tasks");
+ pw.println(innerPrefix + mLeashByTaskId.size() + " Tasks");
}
@Override
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/ShellCommandHandler.java b/libs/WindowManager/Shell/src/com/android/wm/shell/ShellCommandHandler.java
index 45948dd9e800..20850428d3bd 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/ShellCommandHandler.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/ShellCommandHandler.java
@@ -16,12 +16,9 @@
package com.android.wm.shell;
-import android.view.Gravity;
-
import com.android.wm.shell.apppairs.AppPairs;
import com.android.wm.shell.common.annotations.ExternalThread;
import com.android.wm.shell.hidedisplaycutout.HideDisplayCutout;
-import com.android.wm.shell.letterbox.LetterboxConfigController;
import com.android.wm.shell.onehanded.OneHanded;
import com.android.wm.shell.pip.Pip;
import com.android.wm.shell.splitscreen.SplitScreen;
@@ -42,7 +39,6 @@ public final class ShellCommandHandler {
private final Optional<HideDisplayCutout> mHideDisplayCutout;
private final ShellTaskOrganizer mShellTaskOrganizer;
private final Optional<AppPairs> mAppPairsOptional;
- private final LetterboxConfigController mLetterboxConfigController;
public ShellCommandHandler(
ShellTaskOrganizer shellTaskOrganizer,
@@ -50,15 +46,13 @@ public final class ShellCommandHandler {
Optional<Pip> pipOptional,
Optional<OneHanded> oneHandedOptional,
Optional<HideDisplayCutout> hideDisplayCutout,
- Optional<AppPairs> appPairsOptional,
- LetterboxConfigController letterboxConfigController) {
+ Optional<AppPairs> appPairsOptional) {
mShellTaskOrganizer = shellTaskOrganizer;
mSplitScreenOptional = splitScreenOptional;
mPipOptional = pipOptional;
mOneHandedOptional = oneHandedOptional;
mHideDisplayCutout = hideDisplayCutout;
mAppPairsOptional = appPairsOptional;
- mLetterboxConfigController = letterboxConfigController;
}
/** Dumps WM Shell internal state. */
@@ -85,14 +79,6 @@ public final class ShellCommandHandler {
return false;
}
switch (args[1]) {
- case "set-letterbox-portrait-gravity":
- return runSetLetterboxPortraitGravity(args, pw);
- case "get-letterbox-portrait-gravity":
- return runGetLetterboxPortraitGravity(pw);
- case "set-letterbox-landscape-gravity":
- return runSetLetterboxLandscapeGravity(args, pw);
- case "get-letterbox-landscape-gravity":
- return runGetLetterboxLandscapeGravity(pw);
case "pair":
return runPair(args, pw);
case "unpair":
@@ -104,92 +90,6 @@ public final class ShellCommandHandler {
}
}
- private boolean runSetLetterboxPortraitGravity(String[] args, PrintWriter pw) {
- if (args.length < 3) {
- // First two arguments are "WMShell" and command name.
- pw.println("Error: reset, TOP, CENTER or BOTTOM should be provided as an argument");
- return true;
- }
- switch (args[2]) {
- case "reset":
- mLetterboxConfigController.resetPortraitGravity();
- break;
- case "TOP":
- mLetterboxConfigController.setPortraitGravity(Gravity.TOP);
- break;
- case "CENTER":
- mLetterboxConfigController.setPortraitGravity(Gravity.CENTER);
- break;
- case "BOTTOM":
- mLetterboxConfigController.setPortraitGravity(Gravity.BOTTOM);
- break;
- default:
- pw.println("Error: expected reset, TOP, CENTER or BOTTOM but got " + args[2]);
- }
- return true;
- }
-
- private boolean runGetLetterboxPortraitGravity(PrintWriter pw) {
- final int gravity = mLetterboxConfigController.getPortraitGravity();
- switch (gravity) {
- case Gravity.TOP:
- pw.println("TOP");
- break;
- case Gravity.CENTER:
- pw.println("CENTER");
- break;
- case Gravity.BOTTOM:
- pw.println("BOTTOM");
- break;
- default:
- throw new AssertionError("Unexpected gravity: " + gravity);
- }
- return true;
- }
-
- private boolean runSetLetterboxLandscapeGravity(String[] args, PrintWriter pw) {
- if (args.length < 3) {
- // First two arguments are "WMShell" and command name.
- pw.println("Error: reset, LEFT, CENTER or RIGHT should be provided as an argument");
- return false;
- }
- switch (args[2]) {
- case "reset":
- mLetterboxConfigController.resetLandscapeGravity();
- break;
- case "LEFT":
- mLetterboxConfigController.setLandscapeGravity(Gravity.LEFT);
- break;
- case "CENTER":
- mLetterboxConfigController.setLandscapeGravity(Gravity.CENTER);
- break;
- case "RIGHT":
- mLetterboxConfigController.setLandscapeGravity(Gravity.RIGHT);
- break;
- default:
- pw.println(
- "Error: expected reset, LEFT, CENTER or RIGHT but got " + args[2]);
- }
- return true;
- }
-
- private boolean runGetLetterboxLandscapeGravity(PrintWriter pw) {
- final int gravity = mLetterboxConfigController.getLandscapeGravity();
- switch (gravity) {
- case Gravity.LEFT:
- pw.println("LEFT");
- break;
- case Gravity.CENTER:
- pw.println("CENTER");
- break;
- case Gravity.RIGHT:
- pw.println("RIGHT");
- break;
- default:
- throw new AssertionError("Unexpected gravity: " + gravity);
- }
- return true;
- }
private boolean runPair(String[] args, PrintWriter pw) {
if (args.length < 4) {
@@ -220,12 +120,6 @@ public final class ShellCommandHandler {
pw.println(" Print this help text.");
pw.println(" <no arguments provided>");
pw.println(" Dump Window Manager Shell internal state");
- pw.println(" set-letterbox-portrait-gravity [reset|TOP|CENTER|BOTTOM]");
- pw.println(" get-letterbox-portrait-gravity");
- pw.println(" Set, reset or print letterbox gravity for portrait screen mode.");
- pw.println(" set-letterbox-landscape-gravity [reset|LEFT|CENTER|RIGHT]");
- pw.println(" get-letterbox-landscape-gravity");
- pw.println(" Set, reset or print letterbox gravity for landscape screen mode.");
pw.println(" pair <taskId1> <taskId2>");
pw.println(" unpair <taskId>");
pw.println(" Pairs/unpairs tasks with given ids.");
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/ShellInit.java b/libs/WindowManager/Shell/src/com/android/wm/shell/ShellInit.java
index 94555de4f05c..f8956030936c 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/ShellInit.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/ShellInit.java
@@ -17,13 +17,11 @@
package com.android.wm.shell;
import static com.android.wm.shell.ShellTaskOrganizer.TASK_LISTENER_TYPE_FULLSCREEN;
-import static com.android.wm.shell.ShellTaskOrganizer.TASK_LISTENER_TYPE_LETTERBOX;
import com.android.wm.shell.apppairs.AppPairs;
import com.android.wm.shell.common.DisplayImeController;
import com.android.wm.shell.common.annotations.ExternalThread;
import com.android.wm.shell.draganddrop.DragAndDropController;
-import com.android.wm.shell.letterbox.LetterboxTaskListener;
import com.android.wm.shell.splitscreen.SplitScreen;
import java.util.Optional;
@@ -38,23 +36,23 @@ public class ShellInit {
private final ShellTaskOrganizer mShellTaskOrganizer;
private final Optional<SplitScreen> mSplitScreenOptional;
private final Optional<AppPairs> mAppPairsOptional;
- private final LetterboxTaskListener mLetterboxTaskListener;
private final FullscreenTaskListener mFullscreenTaskListener;
+ private final Transitions mTransitions;
public ShellInit(DisplayImeController displayImeController,
DragAndDropController dragAndDropController,
ShellTaskOrganizer shellTaskOrganizer,
Optional<SplitScreen> splitScreenOptional,
Optional<AppPairs> appPairsOptional,
- LetterboxTaskListener letterboxTaskListener,
- FullscreenTaskListener fullscreenTaskListener) {
+ FullscreenTaskListener fullscreenTaskListener,
+ Transitions transitions) {
mDisplayImeController = displayImeController;
mDragAndDropController = dragAndDropController;
mShellTaskOrganizer = shellTaskOrganizer;
mSplitScreenOptional = splitScreenOptional;
mAppPairsOptional = appPairsOptional;
- mLetterboxTaskListener = letterboxTaskListener;
mFullscreenTaskListener = fullscreenTaskListener;
+ mTransitions = transitions;
}
@ExternalThread
@@ -63,8 +61,6 @@ public class ShellInit {
mDisplayImeController.startMonitorDisplays();
mShellTaskOrganizer.addListenerForType(
- mLetterboxTaskListener, TASK_LISTENER_TYPE_LETTERBOX);
- mShellTaskOrganizer.addListenerForType(
mFullscreenTaskListener, TASK_LISTENER_TYPE_FULLSCREEN);
// Register the shell organizer
mShellTaskOrganizer.registerOrganizer();
@@ -72,5 +68,9 @@ public class ShellInit {
mAppPairsOptional.ifPresent(AppPairs::onOrganizerRegistered);
// Bind the splitscreen impl to the drag drop controller
mDragAndDropController.setSplitScreenController(mSplitScreenOptional);
+
+ if (Transitions.ENABLE_SHELL_TRANSITIONS) {
+ mTransitions.register(mShellTaskOrganizer);
+ }
}
}
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/ShellTaskOrganizer.java b/libs/WindowManager/Shell/src/com/android/wm/shell/ShellTaskOrganizer.java
index e68a7471fdaf..10cec6d59cbe 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/ShellTaskOrganizer.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/ShellTaskOrganizer.java
@@ -43,8 +43,6 @@ import androidx.annotation.Nullable;
import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.protolog.common.ProtoLog;
import com.android.wm.shell.common.ShellExecutor;
-import com.android.wm.shell.common.SyncTransactionQueue;
-import com.android.wm.shell.common.TransactionPool;
import com.android.wm.shell.startingsurface.StartingSurfaceDrawer;
import java.io.PrintWriter;
@@ -64,14 +62,12 @@ public class ShellTaskOrganizer extends TaskOrganizer {
public static final int TASK_LISTENER_TYPE_FULLSCREEN = -2;
public static final int TASK_LISTENER_TYPE_MULTI_WINDOW = -3;
public static final int TASK_LISTENER_TYPE_PIP = -4;
- public static final int TASK_LISTENER_TYPE_LETTERBOX = -5;
@IntDef(prefix = {"TASK_LISTENER_TYPE_"}, value = {
TASK_LISTENER_TYPE_UNDEFINED,
TASK_LISTENER_TYPE_FULLSCREEN,
TASK_LISTENER_TYPE_MULTI_WINDOW,
TASK_LISTENER_TYPE_PIP,
- TASK_LISTENER_TYPE_LETTERBOX,
})
public @interface TaskListenerType {}
@@ -102,24 +98,17 @@ public class ShellTaskOrganizer extends TaskOrganizer {
/** @see #setPendingLaunchCookieListener */
private final ArrayMap<IBinder, TaskListener> mLaunchCookieToListener = new ArrayMap<>();
- // TODO(shell-transitions): move to a more "global" Shell location as this isn't only for Tasks
- private final Transitions mTransitions;
-
private final Object mLock = new Object();
private final StartingSurfaceDrawer mStartingSurfaceDrawer;
- public ShellTaskOrganizer(SyncTransactionQueue syncQueue, TransactionPool transactionPool,
- ShellExecutor mainExecutor, ShellExecutor animExecutor, Context context) {
- this(null, syncQueue, transactionPool, mainExecutor, animExecutor, context);
+ public ShellTaskOrganizer(ShellExecutor mainExecutor, Context context) {
+ this(null, mainExecutor, context);
}
@VisibleForTesting
- ShellTaskOrganizer(ITaskOrganizerController taskOrganizerController,
- SyncTransactionQueue syncQueue, TransactionPool transactionPool,
- ShellExecutor mainExecutor, ShellExecutor animExecutor, Context context) {
+ ShellTaskOrganizer(ITaskOrganizerController taskOrganizerController, ShellExecutor mainExecutor,
+ Context context) {
super(taskOrganizerController, mainExecutor);
- mTransitions = new Transitions(this, transactionPool, mainExecutor, animExecutor);
- if (Transitions.ENABLE_SHELL_TRANSITIONS) mTransitions.register(this);
// TODO(b/131727939) temporarily live here, the starting surface drawer should be controlled
// by a controller, that class should be create while porting
// ActivityRecord#addStartingWindow to WMShell.
@@ -380,9 +369,7 @@ public class ShellTaskOrganizer extends TaskOrganizer {
static @TaskListenerType int taskInfoToTaskListenerType(RunningTaskInfo runningTaskInfo) {
switch (runningTaskInfo.getWindowingMode()) {
case WINDOWING_MODE_FULLSCREEN:
- return runningTaskInfo.letterboxActivityBounds != null
- ? TASK_LISTENER_TYPE_LETTERBOX
- : TASK_LISTENER_TYPE_FULLSCREEN;
+ return TASK_LISTENER_TYPE_FULLSCREEN;
case WINDOWING_MODE_MULTI_WINDOW:
return TASK_LISTENER_TYPE_MULTI_WINDOW;
case WINDOWING_MODE_PINNED:
@@ -398,8 +385,6 @@ public class ShellTaskOrganizer extends TaskOrganizer {
switch (type) {
case TASK_LISTENER_TYPE_FULLSCREEN:
return "TASK_LISTENER_TYPE_FULLSCREEN";
- case TASK_LISTENER_TYPE_LETTERBOX:
- return "TASK_LISTENER_TYPE_LETTERBOX";
case TASK_LISTENER_TYPE_MULTI_WINDOW:
return "TASK_LISTENER_TYPE_MULTI_WINDOW";
case TASK_LISTENER_TYPE_PIP:
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/TaskView.java b/libs/WindowManager/Shell/src/com/android/wm/shell/TaskView.java
index 59a765d49a14..7440f19a6e7c 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/TaskView.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/TaskView.java
@@ -87,16 +87,12 @@ public class TaskView extends SurfaceView implements SurfaceHolder.Callback,
super(context, null, 0, 0, true /* disableBackgroundLayer */);
mTaskOrganizer = organizer;
+ mExecutor = organizer.getExecutor();
setUseAlpha();
getHolder().addCallback(this);
mGuard.open("release");
}
- // TODO: Use TaskOrganizer executor when part of wmshell proper
- public void setExecutor(Executor executor) {
- mExecutor = executor;
- }
-
/**
* Only one listener may be set on the view, throws an exception otherwise.
*/
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/Transitions.java b/libs/WindowManager/Shell/src/com/android/wm/shell/Transitions.java
index 10195b6a26b2..a779531f8b91 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/Transitions.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/Transitions.java
@@ -16,10 +16,10 @@
package com.android.wm.shell;
-import static android.window.TransitionInfo.TRANSIT_CLOSE;
-import static android.window.TransitionInfo.TRANSIT_HIDE;
-import static android.window.TransitionInfo.TRANSIT_OPEN;
-import static android.window.TransitionInfo.TRANSIT_SHOW;
+import static android.view.WindowManager.TRANSIT_CLOSE;
+import static android.view.WindowManager.TRANSIT_OPEN;
+import static android.view.WindowManager.TRANSIT_TO_BACK;
+import static android.view.WindowManager.TRANSIT_TO_FRONT;
import android.animation.Animator;
import android.animation.ValueAnimator;
@@ -40,7 +40,6 @@ import androidx.annotation.BinderThread;
import com.android.internal.protolog.common.ProtoLog;
import com.android.wm.shell.common.ShellExecutor;
import com.android.wm.shell.common.TransactionPool;
-import com.android.wm.shell.common.annotations.ShellMainThread;
import com.android.wm.shell.protolog.ShellProtoLogGroup;
import java.util.ArrayList;
@@ -62,7 +61,7 @@ public class Transitions {
/** Keeps track of currently tracked transitions and all the animations associated with each */
private final ArrayMap<IBinder, ArrayList<Animator>> mActiveTransitions = new ArrayMap<>();
- Transitions(@NonNull WindowOrganizer organizer, @NonNull TransactionPool pool,
+ public Transitions(@NonNull WindowOrganizer organizer, @NonNull TransactionPool pool,
@NonNull ShellExecutor mainExecutor, @NonNull ShellExecutor animExecutor) {
mOrganizer = organizer;
mTransactionPool = pool;
@@ -119,8 +118,8 @@ public class Transitions {
}
private static boolean isOpeningType(@WindowManager.TransitionType int type) {
- return type == WindowManager.TRANSIT_OPEN
- || type == WindowManager.TRANSIT_TO_FRONT
+ return type == TRANSIT_OPEN
+ || type == TRANSIT_TO_FRONT
|| type == WindowManager.TRANSIT_KEYGUARD_GOING_AWAY;
}
@@ -150,7 +149,7 @@ public class Transitions {
// Don't animate anything with an animating parent
if (change.getParent() != null) {
- if (mode == TRANSIT_OPEN || mode == TRANSIT_SHOW) {
+ if (mode == TRANSIT_OPEN || mode == TRANSIT_TO_FRONT) {
t.show(leash);
t.setMatrix(leash, 1, 0, 0, 1);
}
@@ -161,7 +160,7 @@ public class Transitions {
t.setPosition(leash, change.getEndAbsBounds().left - info.getRootOffset().x,
change.getEndAbsBounds().top - info.getRootOffset().y);
// Put all the OPEN/SHOW on top
- if (mode == TRANSIT_OPEN || mode == TRANSIT_SHOW) {
+ if (mode == TRANSIT_OPEN || mode == TRANSIT_TO_FRONT) {
t.show(leash);
t.setMatrix(leash, 1, 0, 0, 1);
if (isOpening) {
@@ -174,7 +173,7 @@ public class Transitions {
t.setLayer(leash, -i);
t.setAlpha(leash, 1.f);
}
- } else if (mode == TRANSIT_CLOSE || mode == TRANSIT_HIDE) {
+ } else if (mode == TRANSIT_CLOSE || mode == TRANSIT_TO_BACK) {
if (isOpening) {
// put on bottom and leave visible without fade
t.setLayer(leash, -i);
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleExpandedView.java b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleExpandedView.java
index 318a0bd42940..4bf01f7cffac 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleExpandedView.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleExpandedView.java
@@ -59,7 +59,6 @@ import com.android.internal.policy.ScreenDecorationsUtils;
import com.android.wm.shell.R;
import com.android.wm.shell.TaskView;
import com.android.wm.shell.common.AlphaOptimizedButton;
-import com.android.wm.shell.common.HandlerExecutor;
import com.android.wm.shell.common.TriangleShape;
import java.io.FileDescriptor;
@@ -304,11 +303,6 @@ public class BubbleExpandedView extends LinearLayout {
setLayoutDirection(LAYOUT_DIRECTION_LOCALE);
}
- @Override
- protected void onAttachedToWindow() {
- super.onAttachedToWindow();
- mTaskView.setExecutor(new HandlerExecutor(getHandler()));
- }
/**
* Initialize {@link BubbleController} and {@link BubbleStackView} here, this method must need
* to be called after view inflate.
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 50d9fe8629ac..e97fe0a9111c 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
@@ -112,7 +112,7 @@ public class DividerView extends FrameLayout implements View.OnTouchListener {
}
if (mMoving) {
final int position = mSplitLayout.getDividePosition() + touchPos - mStartPos;
- mSplitLayout.updateDividePosition(position);
+ mSplitLayout.updateDivideBounds(position);
}
break;
case MotionEvent.ACTION_UP:
@@ -131,7 +131,7 @@ public class DividerView extends FrameLayout implements View.OnTouchListener {
final int position = mSplitLayout.getDividePosition() + touchPos - mStartPos;
final DividerSnapAlgorithm.SnapTarget snapTarget =
mSplitLayout.findSnapTarget(position, velocity);
- mSplitLayout.setSnapTarget(snapTarget);
+ mSplitLayout.snapToTarget(position, snapTarget);
break;
}
return true;
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 e11037f55cfa..e1a94b071bf4 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
@@ -22,6 +22,9 @@ import static android.view.WindowManager.DOCKED_TOP;
import static com.android.internal.policy.DividerSnapAlgorithm.SnapTarget.FLAG_DISMISS_END;
import static com.android.internal.policy.DividerSnapAlgorithm.SnapTarget.FLAG_DISMISS_START;
+import android.animation.Animator;
+import android.animation.AnimatorListenerAdapter;
+import android.animation.ValueAnimator;
import android.content.Context;
import android.content.res.Configuration;
import android.content.res.Resources;
@@ -31,6 +34,7 @@ import android.view.SurfaceControl;
import androidx.annotation.Nullable;
import com.android.internal.policy.DividerSnapAlgorithm;
+import com.android.wm.shell.animation.Interpolators;
/**
* Records and handles layout of splits. Helps to calculate proper bounds when configuration or
@@ -119,14 +123,16 @@ public class SplitLayout {
mBounds1.set(mRootBounds);
mBounds2.set(mRootBounds);
if (isLandscape(mRootBounds)) {
+ position += mRootBounds.left;
mDividerBounds.left = position - mDividerInsets;
mDividerBounds.right = mDividerBounds.left + mDividerWindowWidth;
- mBounds1.right = mBounds1.left + position;
+ mBounds1.right = position;
mBounds2.left = mBounds1.right + mDividerSize;
} else {
+ position += mRootBounds.top;
mDividerBounds.top = position - mDividerInsets;
mDividerBounds.bottom = mDividerBounds.top + mDividerWindowWidth;
- mBounds1.bottom = mBounds1.top + position;
+ mBounds1.bottom = position;
mBounds2.top = mBounds1.bottom + mDividerSize;
}
}
@@ -145,17 +151,23 @@ public class SplitLayout {
* Updates bounds with the passing position. Usually used to update recording bounds while
* performing animation or dragging divider bar to resize the splits.
*/
- public void updateDividePosition(int position) {
+ void updateDivideBounds(int position) {
updateBounds(position);
mLayoutChangeListener.onBoundsChanging(this);
}
+ void setDividePosition(int position) {
+ mDividePosition = position;
+ updateBounds(mDividePosition);
+ mLayoutChangeListener.onBoundsChanged(this);
+ }
+
/**
* Sets new divide position and updates bounds correspondingly. Notifies listener if the new
* target indicates dismissing split.
*/
- public void setSnapTarget(DividerSnapAlgorithm.SnapTarget snapTarget) {
- switch(snapTarget.flag) {
+ public void snapToTarget(int currentPosition, DividerSnapAlgorithm.SnapTarget snapTarget) {
+ switch (snapTarget.flag) {
case FLAG_DISMISS_START:
mLayoutChangeListener.onSnappedToDismiss(false /* snappedToEnd */);
break;
@@ -163,9 +175,7 @@ public class SplitLayout {
mLayoutChangeListener.onSnappedToDismiss(true /* snappedToEnd */);
break;
default:
- mDividePosition = snapTarget.position;
- updateBounds(mDividePosition);
- mLayoutChangeListener.onBoundsChanged(this);
+ flingDividePosition(currentPosition, snapTarget.position);
break;
}
}
@@ -189,6 +199,27 @@ public class SplitLayout {
isLandscape ? DOCKED_LEFT : DOCKED_TOP /* dockSide */);
}
+ private void flingDividePosition(int from, int to) {
+ ValueAnimator animator = ValueAnimator
+ .ofInt(from, to)
+ .setDuration(250);
+ animator.setInterpolator(Interpolators.FAST_OUT_SLOW_IN);
+ animator.addUpdateListener(
+ animation -> updateDivideBounds((int) animation.getAnimatedValue()));
+ animator.addListener(new AnimatorListenerAdapter() {
+ @Override
+ public void onAnimationEnd(Animator animation) {
+ setDividePosition(to);
+ }
+
+ @Override
+ public void onAnimationCancel(Animator animation) {
+ setDividePosition(to);
+ }
+ });
+ animator.start();
+ }
+
private static boolean isLandscape(Rect bounds) {
return bounds.width() > bounds.height();
}
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/letterbox/LetterboxConfigController.java b/libs/WindowManager/Shell/src/com/android/wm/shell/letterbox/LetterboxConfigController.java
deleted file mode 100644
index 0a549c6aa7d9..000000000000
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/letterbox/LetterboxConfigController.java
+++ /dev/null
@@ -1,108 +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.wm.shell.letterbox;
-
-import android.content.Context;
-import android.view.Gravity;
-
-import com.android.wm.shell.R;
-
-/**
- * Controls access to and overrides of resource config values used by {@link
- * LetterboxTaskOrganizer}.
- */
-public final class LetterboxConfigController {
-
- private final Context mContext;
-
- /** {@link Gravity} of letterboxed apps in portrait screen orientation. */
- private int mLetterboxPortraitGravity;
-
- /** {@link Gravity} of letterboxed apps in landscape screen orientation. */
- private int mLetterboxLandscapeGravity;
-
- public LetterboxConfigController(Context context) {
- mContext = context;
- mLetterboxPortraitGravity =
- mContext.getResources().getInteger(R.integer.config_letterboxPortraitGravity);
- mLetterboxLandscapeGravity =
- mContext.getResources().getInteger(R.integer.config_letterboxLandscapeGravity);
- }
-
- /**
- * Overrides {@link Gravity} of letterboxed apps in portrait screen orientation.
- *
- * @throws IllegalArgumentException if gravity isn't equal to {@link Gravity#TOP}, {@link
- * Gravity#CENTER} or {@link Gravity#BOTTOM}.
- */
- public void setPortraitGravity(int gravity) {
- if (gravity != Gravity.TOP && gravity != Gravity.CENTER && gravity != Gravity.BOTTOM) {
- throw new IllegalArgumentException(
- "Expected Gravity#TOP, Gravity#CENTER or Gravity#BOTTOM but got"
- + gravity);
- }
- mLetterboxPortraitGravity = gravity;
- }
-
- /**
- * Resets {@link Gravity} of letterboxed apps in portrait screen orientation to {@link
- * R.integer.config_letterboxPortraitGravity}.
- */
- public void resetPortraitGravity() {
- mLetterboxPortraitGravity =
- mContext.getResources().getInteger(R.integer.config_letterboxPortraitGravity);
- }
-
- /**
- * Gets {@link Gravity} of letterboxed apps in portrait screen orientation.
- */
- public int getPortraitGravity() {
- return mLetterboxPortraitGravity;
- }
-
- /**
- * Overrides {@link Gravity} of letterboxed apps in landscape screen orientation.
- *
- * @throws IllegalArgumentException if gravity isn't equal to {@link Gravity#RIGHT}, {@link
- * Gravity#CENTER} or {@link Gravity#LEFT}.
- */
- public void setLandscapeGravity(int gravity) {
- if (gravity != Gravity.LEFT && gravity != Gravity.CENTER && gravity != Gravity.RIGHT) {
- throw new IllegalArgumentException(
- "Expected Gravity#LEFT, Gravity#CENTER or Gravity#RIGHT but got"
- + gravity);
- }
- mLetterboxLandscapeGravity = gravity;
- }
-
- /**
- * Resets {@link Gravity} of letterboxed apps in landscape screen orientation to {@link
- * R.integer.config_letterboxLandscapeGravity}.
- */
- public void resetLandscapeGravity() {
- mLetterboxLandscapeGravity =
- mContext.getResources().getInteger(R.integer.config_letterboxLandscapeGravity);
- }
-
- /**
- * Gets {@link Gravity} of letterboxed apps in landscape screen orientation.
- */
- public int getLandscapeGravity() {
- return mLetterboxLandscapeGravity;
- }
-
-}
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/letterbox/LetterboxTaskListener.java b/libs/WindowManager/Shell/src/com/android/wm/shell/letterbox/LetterboxTaskListener.java
deleted file mode 100644
index 490ef3296be6..000000000000
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/letterbox/LetterboxTaskListener.java
+++ /dev/null
@@ -1,267 +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.wm.shell.letterbox;
-
-import android.app.ActivityManager;
-import android.graphics.Insets;
-import android.graphics.Point;
-import android.graphics.Rect;
-import android.util.Slog;
-import android.util.SparseArray;
-import android.view.Gravity;
-import android.view.SurfaceControl;
-import android.view.WindowInsets;
-import android.view.WindowManager;
-
-import com.android.internal.protolog.common.ProtoLog;
-import com.android.wm.shell.ShellTaskOrganizer;
-import com.android.wm.shell.Transitions;
-import com.android.wm.shell.common.SyncTransactionQueue;
-import com.android.wm.shell.protolog.ShellProtoLogGroup;
-
-/**
- * Organizes a task in {@link android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN} when
- * it's presented in the letterbox mode either because orientations of a top activity and a device
- * don't match or because a top activity is in a size compat mode.
- */
-public class LetterboxTaskListener implements ShellTaskOrganizer.TaskListener {
- private static final String TAG = "LetterboxTaskListener";
-
- private final SyncTransactionQueue mSyncQueue;
- private final LetterboxConfigController mLetterboxConfigController;
- private final WindowManager mWindowManager;
- private final SparseArray<SurfaceControl> mLeashByTaskId = new SparseArray<>();
-
- public LetterboxTaskListener(
- SyncTransactionQueue syncQueue,
- LetterboxConfigController letterboxConfigController,
- WindowManager windowManager) {
- mSyncQueue = syncQueue;
- mLetterboxConfigController = letterboxConfigController;
- mWindowManager = windowManager;
- }
-
- @Override
- public void onTaskAppeared(ActivityManager.RunningTaskInfo taskInfo, SurfaceControl leash) {
- if (mLeashByTaskId.get(taskInfo.taskId) != null) {
- throw new IllegalStateException("Task appeared more than once: #" + taskInfo.taskId);
- }
- ProtoLog.v(ShellProtoLogGroup.WM_SHELL_TASK_ORG, "Letterbox Task Appeared: #%d",
- taskInfo.taskId);
- mLeashByTaskId.put(taskInfo.taskId, leash);
- Point positionInParent = new Point();
- Rect crop = new Rect();
- resolveTaskPositionAndCrop(taskInfo, positionInParent, crop);
- mSyncQueue.runInSync(t -> {
- setPositionAndWindowCrop(t, leash, positionInParent, crop);
- if (!Transitions.ENABLE_SHELL_TRANSITIONS) {
- t.setAlpha(leash, 1f);
- t.setMatrix(leash, 1, 0, 0, 1);
- t.show(leash);
- }
- });
- }
-
- @Override
- public void onTaskVanished(ActivityManager.RunningTaskInfo taskInfo) {
- if (mLeashByTaskId.get(taskInfo.taskId) == null) {
- Slog.e(TAG, "Task already vanished: #" + taskInfo.taskId);
- return;
- }
- mLeashByTaskId.remove(taskInfo.taskId);
- ProtoLog.v(ShellProtoLogGroup.WM_SHELL_TASK_ORG, "Letterbox Task Vanished: #%d",
- taskInfo.taskId);
- }
-
- @Override
- public void onTaskInfoChanged(ActivityManager.RunningTaskInfo taskInfo) {
- ProtoLog.v(ShellProtoLogGroup.WM_SHELL_TASK_ORG, "Letterbox Task Changed: #%d",
- taskInfo.taskId);
- final SurfaceControl leash = mLeashByTaskId.get(taskInfo.taskId);
- Point positionInParent = new Point();
- Rect crop = new Rect();
- resolveTaskPositionAndCrop(taskInfo, positionInParent, crop);
- mSyncQueue.runInSync(t -> setPositionAndWindowCrop(t, leash, positionInParent, crop));
- }
-
- private static void setPositionAndWindowCrop(
- SurfaceControl.Transaction transaction,
- SurfaceControl leash,
- final Point positionInParent,
- final Rect crop) {
- transaction.setPosition(leash, positionInParent.x, positionInParent.y);
- transaction.setWindowCrop(leash, crop);
- }
-
- // TODO(b/173440321): Correct presentation of letterboxed activities in One-handed mode.
- private void resolveTaskPositionAndCrop(
- ActivityManager.RunningTaskInfo taskInfo,
- Point positionInParent,
- Rect crop) {
- // In screen coordinates
- Rect parentBounds = new Rect(taskInfo.parentBounds);
- // Intersect parent and max bounds. This is required for situations when parent bounds
- // go beyond display bounds, for example, in One-handed mode.
- final Rect maxBounds = taskInfo.getConfiguration().windowConfiguration.getMaxBounds();
- if (!parentBounds.intersect(maxBounds)) {
- Slog.w(TAG, "Task parent and max bounds don't intersect: #" + taskInfo.taskId);
- }
-
- // In screen coordinates
- final Rect taskBounds = taskInfo.getConfiguration().windowConfiguration.getBounds();
- final Rect activityBounds = taskInfo.letterboxActivityBounds;
-
- Insets insets = getInsets();
- Rect displayBoundsWithInsets =
- new Rect(mWindowManager.getMaximumWindowMetrics().getBounds());
- displayBoundsWithInsets.inset(insets);
-
- Rect taskBoundsWithInsets = new Rect(taskBounds);
- taskBoundsWithInsets.intersect(displayBoundsWithInsets);
-
- Rect activityBoundsWithInsets = new Rect(activityBounds);
- activityBoundsWithInsets.intersect(displayBoundsWithInsets);
-
- Rect parentBoundsWithInsets = new Rect(parentBounds);
- parentBoundsWithInsets.intersect(displayBoundsWithInsets);
-
- // Crop need to be in the task coordinates.
- crop.set(activityBoundsWithInsets);
- crop.offset(-taskBounds.left, -taskBounds.top);
-
- // Account for insets since coordinates calculations below are done with them.
- positionInParent.x = parentBoundsWithInsets.left - parentBounds.left
- - (taskBoundsWithInsets.left - taskBounds.left);
- positionInParent.y = parentBoundsWithInsets.top - parentBounds.top
- - (taskBoundsWithInsets.top - taskBounds.top);
-
- // Calculating a position of task bounds (without insets) in parent coordinates (without
- // insets) to align activity bounds (without insets) as requested in config. Activity
- // accounts for insets that overlap with its bounds (this overlap can be partial) so
- // ignoring overlap with insets when computing the position. Also, cropping unwanted insets
- // while keeping the top one if the activity is aligned at the top of the window to show
- // status bar decor view.
- if (parentBounds.height() >= parentBounds.width()) {
- final int gravity = mLetterboxConfigController.getPortraitGravity();
- // Center activity horizontally.
- positionInParent.x +=
- (parentBoundsWithInsets.width() - activityBoundsWithInsets.width()) / 2
- + taskBoundsWithInsets.left - activityBoundsWithInsets.left;
- switch (gravity) {
- case Gravity.TOP:
- positionInParent.y += taskBoundsWithInsets.top - activityBoundsWithInsets.top;
- break;
- case Gravity.CENTER:
- positionInParent.y +=
- taskBoundsWithInsets.top - activityBoundsWithInsets.top
- + (parentBoundsWithInsets.height()
- - activityBoundsWithInsets.height()) / 2;
- break;
- case Gravity.BOTTOM:
- positionInParent.y +=
- parentBoundsWithInsets.height() - activityBoundsWithInsets.bottom
- + taskBoundsWithInsets.top;
- break;
- default:
- throw new AssertionError(
- "Unexpected portrait gravity " + gravity
- + " for task: #" + taskInfo.taskId);
- }
- } else {
- final int gravity = mLetterboxConfigController.getLandscapeGravity();
- // Align activity to the top.
- positionInParent.y += taskBoundsWithInsets.top - activityBoundsWithInsets.top;
- switch (gravity) {
- case Gravity.LEFT:
- positionInParent.x += taskBoundsWithInsets.left - activityBoundsWithInsets.left;
- break;
- case Gravity.CENTER:
- positionInParent.x +=
- (parentBoundsWithInsets.width() - activityBoundsWithInsets.width()) / 2
- + taskBoundsWithInsets.left - activityBoundsWithInsets.left;
- break;
- case Gravity.RIGHT:
- positionInParent.x +=
- parentBoundsWithInsets.width()
- - activityBoundsWithInsets.right + taskBoundsWithInsets.left;
- break;
- default:
- throw new AssertionError(
- "Unexpected landscape gravity " + gravity
- + " for task: #" + taskInfo.taskId);
- }
- }
-
- // New bounds of the activity after it's repositioned with required gravity.
- Rect newActivityBounds = new Rect(activityBounds);
- // Task's surfce will be repositioned to positionInParent together with the activity
- // inside it so the new activity bounds are the original activity bounds offset by
- // the task's offset.
- newActivityBounds.offset(
- positionInParent.x - taskBounds.left, positionInParent.y - taskBounds.top);
- Rect newActivityBoundsWithInsets = new Rect(newActivityBounds);
- newActivityBoundsWithInsets.intersect(displayBoundsWithInsets);
- // Activity handles insets on its own (e.g. under status bar or navigation bar).
- // crop that is calculated above crops all insets from an activity and below insets that
- // can be shown are added back to the crop bounds (e.g. if activity is still shown at the
- // top of the display then the top inset won't be cropped).
- // After task's surface is repositioned, intersection between an activity and insets can
- // change but if it doesn't, the activity should be shown under insets to maximize visible
- // area.
- // Also, an activity can use area under insets and insets shouldn't be cropped in this case
- // regardless of a position on the screen.
- final Rect activityInsetsFromCore = taskInfo.letterboxActivityInsets;
- if (newActivityBounds.top - newActivityBoundsWithInsets.top
- == activityBounds.top - activityBoundsWithInsets.top
- // Check whether an activity is shown under inset. If it is, then the inset from
- // WM Core and the inset computed here will be different because local insets
- // doesn't take into account visibility of insets requested by the activity.
- || activityBoundsWithInsets.top - activityBounds.top
- != activityInsetsFromCore.top) {
- crop.top -= activityBoundsWithInsets.top - activityBounds.top;
- }
- if (newActivityBounds.bottom - newActivityBoundsWithInsets.bottom
- == activityBounds.bottom - activityBoundsWithInsets.bottom
- || activityBounds.bottom - activityBoundsWithInsets.bottom
- != activityInsetsFromCore.bottom) {
- crop.bottom += activityBounds.bottom - activityBoundsWithInsets.bottom;
- }
- if (newActivityBounds.left - newActivityBoundsWithInsets.left
- == activityBounds.left - activityBoundsWithInsets.left
- || activityBoundsWithInsets.left - activityBounds.left
- != activityInsetsFromCore.left) {
- crop.left -= activityBoundsWithInsets.left - activityBounds.left;
- }
- if (newActivityBounds.right - newActivityBoundsWithInsets.right
- == activityBounds.right - activityBoundsWithInsets.right
- || activityBounds.right - activityBoundsWithInsets.right
- != activityInsetsFromCore.right) {
- crop.right += activityBounds.right - activityBoundsWithInsets.right;
- }
- }
-
- private Insets getInsets() {
- return mWindowManager
- .getMaximumWindowMetrics()
- .getWindowInsets()
- .getInsets(
- WindowInsets.Type.navigationBars()
- | WindowInsets.Type.statusBars()
- | WindowInsets.Type.displayCutout());
- }
-
-}
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/onehanded/OneHandedGestureHandler.java b/libs/WindowManager/Shell/src/com/android/wm/shell/onehanded/OneHandedGestureHandler.java
index 3b1e6cbe5ccd..951a68884e11 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/onehanded/OneHandedGestureHandler.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/onehanded/OneHandedGestureHandler.java
@@ -75,6 +75,7 @@ public class OneHandedGestureHandler implements OneHandedTransitionCallback,
@Nullable
OneHandedGestureEventCallback mGestureEventCallback;
private Rect mGestureRegion = new Rect();
+ private boolean mIsStopGesture;
/**
* Constructor of OneHandedGestureHandler, we only handle the gesture of
@@ -153,20 +154,20 @@ public class OneHandedGestureHandler implements OneHandedTransitionCallback,
float distance = (float) Math.hypot(mLastPos.x - mDownPos.x,
mLastPos.y - mDownPos.y);
if (distance > mDragDistThreshold) {
- mGestureEventCallback.onStop();
+ mIsStopGesture = true;
}
}
break;
case MotionEvent.ACTION_UP:
if (mLastPos.y >= mDownPos.y && mPassedSlop) {
mGestureEventCallback.onStart();
+ } else if (mIsStopGesture) {
+ mGestureEventCallback.onStop();
}
- mPassedSlop = false;
- mAllowGesture = false;
+ clearState();
break;
case MotionEvent.ACTION_CANCEL:
- mPassedSlop = false;
- mAllowGesture = false;
+ clearState();
break;
default:
break;
@@ -174,6 +175,11 @@ public class OneHandedGestureHandler implements OneHandedTransitionCallback,
}
}
+ private void clearState() {
+ mPassedSlop = false;
+ mIsStopGesture = false;
+ }
+
private void disposeInputChannel() {
if (mInputEventReceiver != null) {
mInputEventReceiver.dispose();
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/onehanded/OneHandedTutorialHandler.java b/libs/WindowManager/Shell/src/com/android/wm/shell/onehanded/OneHandedTutorialHandler.java
index d65ad62cdbbb..a944e3bc50cf 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/onehanded/OneHandedTutorialHandler.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/onehanded/OneHandedTutorialHandler.java
@@ -63,6 +63,16 @@ public class OneHandedTutorialHandler implements OneHandedTransitionCallback {
private String mStartOneHandedDescription;
private String mStopOneHandedDescription;
+ private enum ONE_HANDED_TRIGGER_STATE {
+ UNSET, ENTERING, EXITING
+ }
+ /**
+ * Current One-Handed trigger state.
+ * Note: This is a dynamic state, whenever last state has been confirmed
+ * (i.e. onStartFinished() or onStopFinished()), the state should be set "UNSET" at final.
+ */
+ private ONE_HANDED_TRIGGER_STATE mTriggerState = ONE_HANDED_TRIGGER_STATE.UNSET;
+
/**
* Container of the tutorial panel showing at outside region when one handed starting
*/
@@ -74,6 +84,21 @@ public class OneHandedTutorialHandler implements OneHandedTransitionCallback {
public void onTutorialAnimationUpdate(int offset) {
mUpdateHandler.post(() -> onAnimationUpdate(offset));
}
+
+ @Override
+ public void onOneHandedAnimationStart(
+ OneHandedAnimationController.OneHandedTransitionAnimator animator) {
+ mUpdateHandler.post(() -> {
+ final Rect startValue = (Rect) animator.getStartValue();
+ if (mTriggerState == ONE_HANDED_TRIGGER_STATE.UNSET) {
+ mTriggerState = (startValue.top == 0)
+ ? ONE_HANDED_TRIGGER_STATE.ENTERING : ONE_HANDED_TRIGGER_STATE.EXITING;
+ if (mCanShowTutorial && mTriggerState == ONE_HANDED_TRIGGER_STATE.ENTERING) {
+ createTutorialTarget();
+ }
+ }
+ });
+ }
};
public OneHandedTutorialHandler(Context context) {
@@ -100,9 +125,6 @@ public class OneHandedTutorialHandler implements OneHandedTransitionCallback {
R.string.accessibility_action_start_one_handed);
mStopOneHandedDescription = context.getResources().getString(
R.string.accessibility_action_stop_one_handed);
- if (mCanShowTutorial) {
- createOrUpdateTutorialTarget();
- }
}
@Override
@@ -111,6 +133,7 @@ public class OneHandedTutorialHandler implements OneHandedTransitionCallback {
updateFinished(View.VISIBLE, 0f);
updateTutorialCount();
announcementForScreenReader(true);
+ mTriggerState = ONE_HANDED_TRIGGER_STATE.UNSET;
});
}
@@ -119,6 +142,8 @@ public class OneHandedTutorialHandler implements OneHandedTransitionCallback {
mUpdateHandler.post(() -> {
updateFinished(View.INVISIBLE, -mTargetViewContainer.getHeight());
announcementForScreenReader(false);
+ removeTutorialFromWindowManager();
+ mTriggerState = ONE_HANDED_TRIGGER_STATE.UNSET;
});
}
@@ -126,7 +151,6 @@ public class OneHandedTutorialHandler implements OneHandedTransitionCallback {
if (!canShowTutorial()) {
return;
}
-
mTargetViewContainer.setVisibility(visible);
mTargetViewContainer.setTranslationY(finalPosition);
}
@@ -155,24 +179,23 @@ public class OneHandedTutorialHandler implements OneHandedTransitionCallback {
* Adds the tutorial target view to the WindowManager and update its layout, so it's ready
* to be animated in.
*/
- private void createOrUpdateTutorialTarget() {
- mUpdateHandler.post(() -> {
- if (!mTargetViewContainer.isAttachedToWindow()) {
- mTargetViewContainer.setVisibility(View.INVISIBLE);
-
- try {
- mWindowManager.addView(mTargetViewContainer, getTutorialTargetLayoutParams());
- } catch (IllegalStateException e) {
- // This shouldn't happen, but if the target is already added, just update its
- // layout params.
- mWindowManager.updateViewLayout(
- mTargetViewContainer, getTutorialTargetLayoutParams());
- }
- } else {
- mWindowManager.updateViewLayout(mTargetViewContainer,
- getTutorialTargetLayoutParams());
+ private void createTutorialTarget() {
+ if (!mTargetViewContainer.isAttachedToWindow()) {
+ try {
+ mWindowManager.addView(mTargetViewContainer, getTutorialTargetLayoutParams());
+ } catch (IllegalStateException e) {
+ // This shouldn't happen, but if the target is already added, just update its
+ // layout params.
+ mWindowManager.updateViewLayout(
+ mTargetViewContainer, getTutorialTargetLayoutParams());
}
- });
+ }
+ }
+
+ private void removeTutorialFromWindowManager() {
+ if (mTargetViewContainer.isAttachedToWindow()) {
+ mWindowManager.removeViewImmediate(mTargetViewContainer);
+ }
}
OneHandedAnimationCallback getAnimationCallback() {
@@ -193,7 +216,6 @@ public class OneHandedTutorialHandler implements OneHandedTransitionCallback {
lp.privateFlags |= WindowManager.LayoutParams.SYSTEM_FLAG_SHOW_FOR_ALL_USERS;
lp.setFitInsetsTypes(0 /* types */);
lp.setTitle("one-handed-tutorial-overlay");
-
return lp;
}
@@ -206,10 +228,12 @@ public class OneHandedTutorialHandler implements OneHandedTransitionCallback {
private boolean canShowTutorial() {
if (!mCanShowTutorial) {
+ // Since canSHowTutorial() will be called in onAnimationUpdate() and we still need to
+ // hide Tutorial text in the period of continuously onAnimationUpdate() API call,
+ // so we have to hide mTargetViewContainer here.
mTargetViewContainer.setVisibility(View.GONE);
return false;
}
-
return true;
}
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipBoundsAlgorithm.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipBoundsAlgorithm.java
index 22d8ed50c10e..484592e87a20 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipBoundsAlgorithm.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipBoundsAlgorithm.java
@@ -123,15 +123,16 @@ public class PipBoundsAlgorithm {
/** Returns the destination bounds to place the PIP window on entry. */
public Rect getEntryDestinationBounds() {
final PipBoundsState.PipReentryState reentryState = mPipBoundsState.getReentryState();
- final boolean shouldRestoreReentryBounds = reentryState != null;
- final Rect destinationBounds = shouldRestoreReentryBounds
+ final Rect destinationBounds = reentryState != null
? getDefaultBounds(reentryState.getSnapFraction(), reentryState.getSize())
: getDefaultBounds();
- return transformBoundsToAspectRatioIfValid(destinationBounds,
+ final boolean useCurrentSize = reentryState != null && reentryState.getSize() != null;
+ final Rect r = transformBoundsToAspectRatioIfValid(destinationBounds,
mPipBoundsState.getAspectRatio(), false /* useCurrentMinEdgeSize */,
- shouldRestoreReentryBounds);
+ useCurrentSize);
+ return r;
}
/** Returns the current bounds adjusted to the new aspect ratio, if valid. */
@@ -221,24 +222,36 @@ public class PipBoundsAlgorithm {
private Rect getDefaultBounds(float snapFraction, Size size) {
final Rect defaultBounds = new Rect();
if (snapFraction != INVALID_SNAP_FRACTION && size != null) {
+ // The default bounds are the given size positioned at the given snap fraction.
defaultBounds.set(0, 0, size.getWidth(), size.getHeight());
final Rect movementBounds = getMovementBounds(defaultBounds);
mSnapAlgorithm.applySnapFraction(defaultBounds, movementBounds, snapFraction);
+ return defaultBounds;
+ }
+
+ // Calculate the default size.
+ final Size defaultSize;
+ final Rect insetBounds = new Rect();
+ getInsetBounds(insetBounds);
+ final DisplayInfo displayInfo = mPipBoundsState.getDisplayInfo();
+ final Size overrideMinSize = mPipBoundsState.getOverrideMinSize();
+ if (overrideMinSize != null) {
+ // The override minimal size is set, use that as the default size making sure it's
+ // adjusted to the aspect ratio.
+ defaultSize = adjustSizeToAspectRatio(overrideMinSize, mDefaultAspectRatio);
+ } else {
+ // Calculate the default size using the display size and default min edge size.
+ defaultSize = getSizeForAspectRatio(mDefaultAspectRatio,
+ mDefaultMinSize, displayInfo.logicalWidth, displayInfo.logicalHeight);
+ }
+
+ // Now that we have the default size, apply the snap fraction if valid or position the
+ // bounds using the default gravity.
+ if (snapFraction != INVALID_SNAP_FRACTION) {
+ defaultBounds.set(0, 0, defaultSize.getWidth(), defaultSize.getHeight());
+ final Rect movementBounds = getMovementBounds(defaultBounds);
+ mSnapAlgorithm.applySnapFraction(defaultBounds, movementBounds, snapFraction);
} else {
- final Rect insetBounds = new Rect();
- getInsetBounds(insetBounds);
- final DisplayInfo displayInfo = mPipBoundsState.getDisplayInfo();
- final Size defaultSize;
- final Size overrideMinSize = mPipBoundsState.getOverrideMinSize();
- if (overrideMinSize != null) {
- // The override minimal size is set, use that as the default size making sure it's
- // adjusted to the aspect ratio.
- defaultSize = adjustSizeToAspectRatio(overrideMinSize, mDefaultAspectRatio);
- } else {
- // Calculate the default size using the display size and default min edge size.
- defaultSize = getSizeForAspectRatio(mDefaultAspectRatio,
- mDefaultMinSize, displayInfo.logicalWidth, displayInfo.logicalHeight);
- }
Gravity.apply(mDefaultStackGravity, defaultSize.getWidth(), defaultSize.getHeight(),
insetBounds, 0, Math.max(
mPipBoundsState.isImeShowing() ? mPipBoundsState.getImeHeight() : 0,
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipBoundsState.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipBoundsState.java
index 53aa61477483..4493d38d2144 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipBoundsState.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/PipBoundsState.java
@@ -76,6 +76,8 @@ public final class PipBoundsState {
private int mImeHeight;
private boolean mIsShelfShowing;
private int mShelfHeight;
+ /** Whether the user has resized the PIP manually. */
+ private boolean mHasUserResizedPip;
private @Nullable Runnable mOnMinimalSizeChangeCallback;
private @Nullable BiConsumer<Boolean, Integer> mOnShelfVisibilityChangeCallback;
@@ -189,8 +191,8 @@ public final class PipBoundsState {
}
/** Save the reentry state to restore to when re-entering PIP mode. */
- public void saveReentryState(@NonNull Rect bounds, float fraction) {
- mPipReentryState = new PipReentryState(new Size(bounds.width(), bounds.height()), fraction);
+ public void saveReentryState(Size size, float fraction) {
+ mPipReentryState = new PipReentryState(size, fraction);
}
/** Returns the saved reentry state. */
@@ -205,6 +207,7 @@ public final class PipBoundsState {
mLastPipComponentName = lastPipComponentName;
if (changed) {
clearReentryState();
+ setHasUserResizedPip(false);
}
}
@@ -329,6 +332,16 @@ public final class PipBoundsState {
return mShelfHeight;
}
+ /** Returns whether the user has resized the PIP. */
+ public boolean hasUserResizedPip() {
+ return mHasUserResizedPip;
+ }
+
+ /** Set whether the user has resized the PIP. */
+ public void setHasUserResizedPip(boolean hasUserResizedPip) {
+ mHasUserResizedPip = hasUserResizedPip;
+ }
+
/**
* Registers a callback when the minimal size of PIP that is set by the app changes.
*/
@@ -397,15 +410,15 @@ public final class PipBoundsState {
static final class PipReentryState {
private static final String TAG = PipReentryState.class.getSimpleName();
- private final @NonNull Size mSize;
+ private final @Nullable Size mSize;
private final float mSnapFraction;
- PipReentryState(@NonNull Size size, float snapFraction) {
+ PipReentryState(@Nullable Size size, float snapFraction) {
mSize = size;
mSnapFraction = snapFraction;
}
- @NonNull
+ @Nullable
Size getSize() {
return mSize;
}
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipController.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipController.java
index 46fff85ca58d..4d2760259521 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipController.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipController.java
@@ -40,6 +40,7 @@ import android.os.UserHandle;
import android.os.UserManager;
import android.util.Log;
import android.util.Pair;
+import android.util.Size;
import android.util.Slog;
import android.view.DisplayInfo;
import android.view.WindowManagerGlobal;
@@ -86,7 +87,6 @@ public class PipController implements Pip, PipTaskOrganizer.PipTransitionCallbac
private final DisplayInfo mTmpDisplayInfo = new DisplayInfo();
private final Rect mTmpInsetBounds = new Rect();
- protected final Rect mReentryBounds = new Rect();
private boolean mIsInFixedRotation;
private Consumer<Boolean> mPinnedStackAnimationRecentsCallback;
@@ -438,10 +438,8 @@ public class PipController implements Pip, PipTaskOrganizer.PipTransitionCallbac
@Override
public void onPipTransitionStarted(ComponentName activity, int direction, Rect pipBounds) {
if (isOutPipDirection(direction)) {
- // Exiting PIP, save the reentry bounds to restore to when re-entering.
- updateReentryBounds(pipBounds);
- final float snapFraction = mPipBoundsAlgorithm.getSnapFraction(mReentryBounds);
- mPipBoundsState.saveReentryState(mReentryBounds, snapFraction);
+ // Exiting PIP, save the reentry state to restore to when re-entering.
+ saveReentryState(pipBounds);
}
// Disable touches while the animation is running
mTouchHandler.setTouchEnabled(false);
@@ -450,14 +448,16 @@ public class PipController implements Pip, PipTaskOrganizer.PipTransitionCallbac
}
}
- /**
- * Update the bounds used to save the re-entry size and snap fraction when exiting PIP.
- */
- public void updateReentryBounds(Rect bounds) {
- final Rect reentryBounds = mTouchHandler.getUserResizeBounds();
- float snapFraction = mPipBoundsAlgorithm.getSnapFraction(bounds);
- mPipBoundsAlgorithm.applySnapFraction(reentryBounds, snapFraction);
- mReentryBounds.set(reentryBounds);
+ /** Save the state to restore to on re-entry. */
+ public void saveReentryState(Rect pipBounds) {
+ float snapFraction = mPipBoundsAlgorithm.getSnapFraction(pipBounds);
+ if (mPipBoundsState.hasUserResizedPip()) {
+ final Rect reentryBounds = mTouchHandler.getUserResizeBounds();
+ final Size reentrySize = new Size(reentryBounds.width(), reentryBounds.height());
+ mPipBoundsState.saveReentryState(reentrySize, snapFraction);
+ } else {
+ mPipBoundsState.saveReentryState(null /* bounds */, snapFraction);
+ }
}
/**
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipResizeGestureHandler.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipResizeGestureHandler.java
index 2f5219c59bf2..02f6231c6ecf 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipResizeGestureHandler.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipResizeGestureHandler.java
@@ -410,6 +410,7 @@ public class PipResizeGestureHandler {
mPipTaskOrganizer.scheduleUserResizePip(mLastDownBounds, mLastResizeBounds,
null);
+ mPipBoundsState.setHasUserResizedPip(true);
}
}
}
@@ -462,6 +463,7 @@ public class PipResizeGestureHandler {
true /* useCurrentSize */);
mPipTaskOrganizer.scheduleUserResizePip(mLastDownBounds, mLastResizeBounds,
null);
+ mPipBoundsState.setHasUserResizedPip(true);
}
break;
case MotionEvent.ACTION_UP:
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/DividerImeController.java b/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/DividerImeController.java
index eb82357f2dea..71710af4ffb5 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/DividerImeController.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/DividerImeController.java
@@ -26,6 +26,7 @@ import android.annotation.Nullable;
import android.graphics.Rect;
import android.os.Handler;
import android.util.Slog;
+import android.view.Choreographer;
import android.view.SurfaceControl;
import android.window.TaskOrganizer;
import android.window.WindowContainerToken;
@@ -338,6 +339,7 @@ class DividerImeController implements DisplayImeController.ImePositionProcessor
SurfaceControl.Transaction t = mTransactionPool.acquire();
float value = (float) animation.getAnimatedValue();
onProgress(value, t);
+ t.setFrameTimelineVsync(Choreographer.getSfInstance().getVsyncId());
t.apply();
mTransactionPool.release(t);
});
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/DividerView.java b/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/DividerView.java
index c6496ad6246f..ba071666b5aa 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/DividerView.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/DividerView.java
@@ -37,6 +37,7 @@ import android.os.Handler;
import android.os.RemoteException;
import android.util.AttributeSet;
import android.util.Slog;
+import android.view.Choreographer;
import android.view.Display;
import android.view.MotionEvent;
import android.view.PointerIcon;
@@ -1108,6 +1109,7 @@ public class DividerView extends FrameLayout implements OnTouchListener,
}
resizeSplitSurfaces(t, mDockedRect, mDockedTaskRect, mOtherRect, mOtherTaskRect);
if (ownTransaction) {
+ t.setFrameTimelineVsync(Choreographer.getSfInstance().getVsyncId());
t.apply();
mTiles.releaseTransaction(t);
}
diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/CommonAssertions.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/CommonAssertions.kt
index 1638d72f9914..c5b54bc4abcb 100644
--- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/CommonAssertions.kt
+++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/CommonAssertions.kt
@@ -16,8 +16,10 @@
package com.android.wm.shell.flicker
+import android.graphics.Region
import com.android.server.wm.flicker.dsl.EventLogAssertion
import com.android.server.wm.flicker.dsl.LayersAssertion
+import com.android.server.wm.flicker.helpers.WindowUtils
@JvmOverloads
fun LayersAssertion.appPairsDividerIsVisible(
@@ -59,6 +61,50 @@ fun LayersAssertion.dockedStackDividerIsInvisible(
}
}
+@JvmOverloads
+fun LayersAssertion.dockedStackPrimaryBoundsIsVisible(
+ rotation: Int,
+ primaryLayerName: String,
+ bugId: Int = 0,
+ enabled: Boolean = bugId == 0
+) {
+ end("PrimaryAppBounds", bugId, enabled) {
+ val entry = this.trace.entries.firstOrNull()
+ ?: throw IllegalStateException("Trace is empty")
+ val dividerRegion = entry.getVisibleBounds(FlickerTestBase.DOCKED_STACK_DIVIDER)
+ this.hasVisibleRegion(primaryLayerName, getPrimaryRegion(dividerRegion, rotation))
+ }
+}
+
+@JvmOverloads
+fun LayersAssertion.dockedStackSecondaryBoundsIsVisible(
+ rotation: Int,
+ secondaryLayerName: String,
+ bugId: Int = 0,
+ enabled: Boolean = bugId == 0
+) {
+ end("SecondaryAppBounds", bugId, enabled) {
+ val entry = this.trace.entries.firstOrNull()
+ ?: throw IllegalStateException("Trace is empty")
+ val dividerRegion = entry.getVisibleBounds(FlickerTestBase.DOCKED_STACK_DIVIDER)
+ this.hasVisibleRegion(secondaryLayerName, getSecondaryRegion(dividerRegion, rotation))
+ }
+}
+
+fun getPrimaryRegion(dividerRegion: Region, rotation: Int): Region {
+ val displayBounds = WindowUtils.getDisplayBounds(rotation)
+ return Region(0, 0, displayBounds.getBounds().right,
+ dividerRegion.getBounds().bottom - WindowUtils.dockedStackDividerInset)
+}
+
+fun getSecondaryRegion(dividerRegion: Region, rotation: Int): Region {
+ val displayBounds = WindowUtils.getDisplayBounds(rotation)
+ return Region(0,
+ dividerRegion.getBounds().bottom - WindowUtils.dockedStackDividerInset,
+ displayBounds.getBounds().right,
+ displayBounds.getBounds().bottom - WindowUtils.navigationBarHeight)
+}
+
fun EventLogAssertion.focusChanges(
vararg windows: String,
bugId: Int = 0,
diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/CommonConstants.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/CommonConstants.kt
index 96234fcc8570..5125a3972cf4 100644
--- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/CommonConstants.kt
+++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/CommonConstants.kt
@@ -37,3 +37,4 @@ const val TEST_APP_FIXED_ACTIVITY_LABEL = "FixedApp"
// Test App > SplitScreen Activity
const val TEST_APP_SPLITSCREEN_PRIMARY_LABEL = "SplitScreenPrimaryApp"
const val TEST_APP_SPLITSCREEN_SECONDARY_LABEL = "SplitScreenSecondaryApp"
+const val TEST_APP_NONRESIZEABLE_LABEL = "NonResizeableApp"
diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/apppairs/AppPairsTest.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/apppairs/AppPairsTest.kt
index 0f8d30a94ec6..379ec95b6792 100644
--- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/apppairs/AppPairsTest.kt
+++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/apppairs/AppPairsTest.kt
@@ -61,10 +61,9 @@ class AppPairsTest(
setup {
eachRun {
uiDevice.wakeUpAndGoToHomeScreen()
- primaryApp.open()
- uiDevice.pressHome()
- secondaryApp.open()
- uiDevice.pressHome()
+ primaryApp.launchViaIntent()
+ secondaryApp.launchViaIntent()
+ nonResizeableApp.launchViaIntent()
updateTaskId()
}
}
@@ -90,7 +89,7 @@ class AppPairsTest(
@Test
fun testAppPairs_pairPrimaryAndSecondaryApps() {
- val testTag = "testAppPaired_pairPrimaryAndSecondary"
+ val testTag = "testAppPairs_pairPrimaryAndSecondaryApps"
runWithFlicker(appPairsSetup) {
withTestName { testTag }
repeat {
@@ -176,6 +175,36 @@ class AppPairsTest(
}
}
+ @Test
+ fun testAppPairs_canNotPairNonResizeableApps() {
+ val testTag = "testAppPairs_canNotPairNonResizeableApps"
+ runWithFlicker(appPairsSetup) {
+ withTestName { testTag }
+ repeat {
+ TEST_REPETITIONS
+ }
+ transitions {
+ nonResizeableApp.launchViaIntent()
+ // TODO pair apps through normal UX flow
+ executeShellCommand(composePairsCommand(
+ primaryTaskId, nonResizeableTaskId, true /* pair */))
+ SystemClock.sleep(AppPairsHelper.TIMEOUT_MS)
+ }
+ assertions {
+ layersTrace {
+ appPairsDividerIsInvisible()
+ }
+ windowManagerTrace {
+ end {
+ showsAppWindow(nonResizeableApp.defaultWindowName)
+ .and()
+ .hidesAppWindow(primaryApp.defaultWindowName)
+ }
+ }
+ }
+ }
+ }
+
private fun composePairsCommand(
primaryApp: String,
secondaryApp: String,
@@ -202,6 +231,7 @@ class AppPairsTest(
private fun updateTaskId() {
val primaryAppComponent = primaryApp.openAppIntent.component
val secondaryAppComponent = secondaryApp.openAppIntent.component
+ val nonResizeableAppComponent = nonResizeableApp.openAppIntent.component
if (primaryAppComponent != null) {
primaryTaskId = appPairsHelper.getTaskIdForActivity(
primaryAppComponent.packageName, primaryAppComponent.className).toString()
@@ -210,11 +240,17 @@ class AppPairsTest(
secondaryTaskId = appPairsHelper.getTaskIdForActivity(
secondaryAppComponent.packageName, secondaryAppComponent.className).toString()
}
+ if (nonResizeableAppComponent != null) {
+ nonResizeableTaskId = appPairsHelper.getTaskIdForActivity(
+ nonResizeableAppComponent.packageName,
+ nonResizeableAppComponent.className).toString()
+ }
}
companion object {
var primaryTaskId = ""
var secondaryTaskId = ""
+ var nonResizeableTaskId = ""
@Parameterized.Parameters(name = "{0}")
@JvmStatic
fun getParams(): Collection<Array<Any>> {
diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/apppairs/AppPairsTestBase.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/apppairs/AppPairsTestBase.kt
index f32cd8842074..4d46f2856704 100644
--- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/apppairs/AppPairsTestBase.kt
+++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/apppairs/AppPairsTestBase.kt
@@ -17,6 +17,7 @@
package com.android.wm.shell.flicker.apppairs
import com.android.wm.shell.flicker.NonRotationTestBase
+import com.android.wm.shell.flicker.TEST_APP_NONRESIZEABLE_LABEL
import com.android.wm.shell.flicker.TEST_APP_SPLITSCREEN_PRIMARY_LABEL
import com.android.wm.shell.flicker.TEST_APP_SPLITSCREEN_SECONDARY_LABEL
import com.android.wm.shell.flicker.helpers.AppPairsHelper
@@ -36,4 +37,7 @@ abstract class AppPairsTestBase(
protected val secondaryApp = SplitScreenHelper(instrumentation,
TEST_APP_SPLITSCREEN_SECONDARY_LABEL,
Components.SplitScreenSecondaryActivity())
+ protected val nonResizeableApp = SplitScreenHelper(instrumentation,
+ TEST_APP_NONRESIZEABLE_LABEL,
+ Components.NonResizeableActivity())
}
diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/helpers/SplitScreenHelper.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/helpers/SplitScreenHelper.kt
index e67fc97dad2e..fb795c72b106 100644
--- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/helpers/SplitScreenHelper.kt
+++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/helpers/SplitScreenHelper.kt
@@ -17,9 +17,7 @@
package com.android.wm.shell.flicker.helpers
import android.app.Instrumentation
-import android.graphics.Region
import android.os.SystemClock
-import com.android.server.wm.flicker.helpers.WindowUtils
import com.android.wm.shell.flicker.testapp.Components
class SplitScreenHelper(
@@ -43,20 +41,6 @@ class SplitScreenHelper(
SystemClock.sleep(TIMEOUT_MS)
}
- fun getPrimaryBounds(dividerBounds: Region): android.graphics.Region {
- val primaryAppBounds = Region(0, 0, dividerBounds.bounds.right,
- dividerBounds.bounds.bottom + WindowUtils.dockedStackDividerInset)
- return primaryAppBounds
- }
-
- fun getSecondaryBounds(dividerBounds: Region): android.graphics.Region {
- val displayBounds = WindowUtils.displayBounds
- val secondaryAppBounds = Region(0,
- dividerBounds.bounds.bottom - WindowUtils.dockedStackDividerInset,
- displayBounds.right, displayBounds.bottom - WindowUtils.navigationBarHeight)
- return secondaryAppBounds
- }
-
companion object {
const val TEST_REPETITIONS = 1
const val TIMEOUT_MS = 3_000L
diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/EnterSplitScreenTest.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/EnterSplitScreenTest.kt
index 5570a562a515..348676189524 100644
--- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/EnterSplitScreenTest.kt
+++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/EnterSplitScreenTest.kt
@@ -21,14 +21,23 @@ import android.view.Surface
import androidx.test.filters.RequiresDevice
import com.android.server.wm.flicker.dsl.FlickerBuilder
import com.android.server.wm.flicker.dsl.runWithFlicker
+import com.android.server.wm.flicker.helpers.WindowUtils
+import com.android.server.wm.flicker.helpers.canSplitScreen
+import com.android.server.wm.flicker.helpers.exitSplitScreen
+import com.android.server.wm.flicker.helpers.isInSplitScreen
import com.android.server.wm.flicker.helpers.launchSplitScreen
+import com.android.server.wm.flicker.helpers.openQuickstep
import com.android.server.wm.flicker.helpers.wakeUpAndGoToHomeScreen
+import com.android.wm.shell.flicker.dockedStackDividerIsInvisible
import com.android.wm.shell.flicker.dockedStackDividerIsVisible
import com.android.wm.shell.flicker.helpers.SplitScreenHelper.Companion.TEST_REPETITIONS
import com.android.server.wm.flicker.navBarWindowIsAlwaysVisible
import com.android.server.wm.flicker.statusBarLayerIsAlwaysVisible
import com.android.server.wm.flicker.navBarLayerIsAlwaysVisible
import com.android.server.wm.flicker.statusBarWindowIsAlwaysVisible
+import com.android.wm.shell.flicker.dockedStackPrimaryBoundsIsVisible
+import com.android.wm.shell.flicker.dockedStackSecondaryBoundsIsVisible
+import org.junit.Assert
import org.junit.FixMethodOrder
import org.junit.Test
import org.junit.runner.RunWith
@@ -56,14 +65,16 @@ class EnterSplitScreenTest(
setup {
eachRun {
uiDevice.wakeUpAndGoToHomeScreen()
- splitScreenApp.open()
- uiDevice.pressHome()
}
}
teardown {
eachRun {
+ if (uiDevice.isInSplitScreen()) {
+ uiDevice.exitSplitScreen()
+ }
splitScreenApp.exit()
secondaryApp.exit()
+ nonResizeableApp.exit()
}
}
assertions {
@@ -87,18 +98,14 @@ class EnterSplitScreenTest(
TEST_REPETITIONS
}
transitions {
+ splitScreenApp.launchViaIntent()
uiDevice.launchSplitScreen()
}
assertions {
layersTrace {
dockedStackDividerIsVisible()
- end("appsEndingBounds", enabled = false) {
- val entry = this.trace.entries.firstOrNull()
- ?: throw IllegalStateException("Trace is empty")
- this.hasVisibleRegion(splitScreenApp.defaultWindowName,
- splitScreenApp.getPrimaryBounds(
- entry.getVisibleBounds(DOCKED_STACK_DIVIDER)))
- }
+ dockedStackPrimaryBoundsIsVisible(
+ rotation, splitScreenApp.defaultWindowName, 169271943)
}
windowManagerTrace {
end {
@@ -118,27 +125,18 @@ class EnterSplitScreenTest(
TEST_REPETITIONS
}
transitions {
- secondaryApp.open()
- uiDevice.pressHome()
- splitScreenApp.open()
- uiDevice.pressHome()
+ secondaryApp.launchViaIntent()
+ splitScreenApp.launchViaIntent()
uiDevice.launchSplitScreen()
splitScreenApp.reopenAppFromOverview()
}
assertions {
layersTrace {
dockedStackDividerIsVisible()
- end("appsEndingBounds", enabled = false) {
- val entry = this.trace.entries.firstOrNull()
- ?: throw IllegalStateException("Trace is empty")
- this.hasVisibleRegion(splitScreenApp.defaultWindowName,
- splitScreenApp.getPrimaryBounds(
- entry.getVisibleBounds(DOCKED_STACK_DIVIDER)))
- .and()
- .hasVisibleRegion(secondaryApp.defaultWindowName,
- splitScreenApp.getSecondaryBounds(
- entry.getVisibleBounds(DOCKED_STACK_DIVIDER)))
- }
+ dockedStackPrimaryBoundsIsVisible(
+ rotation, splitScreenApp.defaultWindowName, 169271943)
+ dockedStackSecondaryBoundsIsVisible(
+ rotation, secondaryApp.defaultWindowName, 169271943)
}
windowManagerTrace {
end {
@@ -150,6 +148,98 @@ class EnterSplitScreenTest(
}
}
+ @Test
+ fun testNonResizeableNotDocked() {
+ val testTag = "testNonResizeableNotDocked"
+ runWithFlicker(splitScreenSetup) {
+ withTestName { testTag }
+ repeat {
+ TEST_REPETITIONS
+ }
+ transitions {
+ nonResizeableApp.launchViaIntent()
+ uiDevice.openQuickstep()
+ if (uiDevice.canSplitScreen()) {
+ Assert.fail("Non-resizeable app should not enter split screen")
+ }
+ }
+ assertions {
+ layersTrace {
+ dockedStackDividerIsInvisible()
+ }
+ windowManagerTrace {
+ end {
+ hidesAppWindow(nonResizeableApp.defaultWindowName)
+ }
+ }
+ }
+ }
+ }
+
+ @Test
+ fun testNonResizeableWhenAlreadyInSplitScreenPrimary() {
+ val testTag = "testNonResizeableWhenAlreadyInSplitScreenPrimary"
+ runWithFlicker(splitScreenSetup) {
+ withTestName { testTag }
+ repeat {
+ TEST_REPETITIONS
+ }
+ transitions {
+ nonResizeableApp.launchViaIntent()
+ splitScreenApp.launchViaIntent()
+ uiDevice.launchSplitScreen()
+ nonResizeableApp.reopenAppFromOverview()
+ }
+ assertions {
+ layersTrace {
+ dockedStackDividerIsInvisible()
+ end("appsEndingBounds", enabled = false) {
+ val displayBounds = WindowUtils.getDisplayBounds(rotation)
+ this.hasVisibleRegion(nonResizeableApp.defaultWindowName, displayBounds)
+ }
+ }
+ windowManagerTrace {
+ end {
+ showsAppWindow(nonResizeableApp.defaultWindowName)
+ hidesAppWindow(splitScreenApp.defaultWindowName)
+ }
+ }
+ }
+ }
+ }
+
+ @Test
+ fun testNonResizeableWhenAlreadyInSplitScreenSecondary() {
+ val testTag = "testNonResizeableWhenAlreadyInSplitScreenSecondary"
+ runWithFlicker(splitScreenSetup) {
+ withTestName { testTag }
+ repeat {
+ TEST_REPETITIONS
+ }
+ transitions {
+ splitScreenApp.launchViaIntent()
+ uiDevice.launchSplitScreen()
+ uiDevice.pressBack()
+ nonResizeableApp.launchViaIntent()
+ }
+ assertions {
+ layersTrace {
+ dockedStackDividerIsInvisible()
+ end("appsEndingBounds", enabled = false) {
+ val displayBounds = WindowUtils.getDisplayBounds(rotation)
+ this.hasVisibleRegion(nonResizeableApp.defaultWindowName, displayBounds)
+ }
+ }
+ windowManagerTrace {
+ end {
+ showsAppWindow(nonResizeableApp.defaultWindowName)
+ hidesAppWindow(splitScreenApp.defaultWindowName)
+ }
+ }
+ }
+ }
+ }
+
companion object {
@Parameterized.Parameters(name = "{0}")
@JvmStatic
diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/RotateOneLaunchedAppTest.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/RotateOneLaunchedAppTest.kt
new file mode 100644
index 000000000000..be8f9bcdedb6
--- /dev/null
+++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/RotateOneLaunchedAppTest.kt
@@ -0,0 +1,146 @@
+/*
+ * 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.wm.shell.flicker.splitscreen
+
+import android.view.Surface
+import androidx.test.filters.RequiresDevice
+import com.android.server.wm.flicker.dsl.FlickerBuilder
+import com.android.server.wm.flicker.dsl.runWithFlicker
+import com.android.server.wm.flicker.helpers.exitSplitScreen
+import com.android.server.wm.flicker.helpers.isInSplitScreen
+import com.android.server.wm.flicker.helpers.launchSplitScreen
+import com.android.server.wm.flicker.helpers.wakeUpAndGoToHomeScreen
+import com.android.server.wm.flicker.navBarLayerRotatesAndScales
+import com.android.server.wm.flicker.navBarWindowIsAlwaysVisible
+import com.android.server.wm.flicker.statusBarLayerRotatesScales
+import com.android.server.wm.flicker.statusBarWindowIsAlwaysVisible
+import com.android.wm.shell.flicker.dockedStackDividerIsVisible
+import com.android.wm.shell.flicker.dockedStackPrimaryBoundsIsVisible
+import com.android.wm.shell.flicker.helpers.SplitScreenHelper
+import org.junit.FixMethodOrder
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.junit.runners.MethodSorters
+import org.junit.runners.Parameterized
+
+/**
+ * Test open app to split screen.
+ * To run this test: `atest WMShellFlickerTests:RotateOneLaunchedAppTest`
+ */
+@RequiresDevice
+@RunWith(Parameterized::class)
+@FixMethodOrder(MethodSorters.NAME_ASCENDING)
+class RotateOneLaunchedAppTest(
+ rotationName: String,
+ rotation: Int
+) : SplitScreenTestBase(rotationName, rotation) {
+ private val splitScreenRotationSetup: FlickerBuilder
+ get() = FlickerBuilder(instrumentation).apply {
+ val testSetupRotation = "testSetupRotation"
+ withTestName {
+ testSetupRotation
+ }
+ setup {
+ test {
+ device.wakeUpAndGoToHomeScreen()
+ }
+ }
+ teardown {
+ eachRun {
+ if (uiDevice.isInSplitScreen()) {
+ uiDevice.exitSplitScreen()
+ }
+ setRotation(Surface.ROTATION_0)
+ splitScreenApp.exit()
+ secondaryApp.exit()
+ }
+ }
+ }
+
+ @Test
+ fun testRotateInSplitScreenMode() {
+ val testTag = "testEnterSplitScreen_launchToSide"
+ runWithFlicker(splitScreenRotationSetup) {
+ withTestName { testTag }
+ repeat {
+ SplitScreenHelper.TEST_REPETITIONS
+ }
+ transitions {
+ splitScreenApp.launchViaIntent()
+ device.launchSplitScreen()
+ setRotation(rotation)
+ }
+ assertions {
+ layersTrace {
+ navBarLayerRotatesAndScales(Surface.ROTATION_0, rotation, 169271943)
+ statusBarLayerRotatesScales(Surface.ROTATION_0, rotation, 169271943)
+ dockedStackDividerIsVisible()
+ dockedStackPrimaryBoundsIsVisible(
+ rotation, splitScreenApp.defaultWindowName, 169271943)
+ }
+ windowManagerTrace {
+ navBarWindowIsAlwaysVisible()
+ statusBarWindowIsAlwaysVisible()
+ end {
+ showsAppWindow(splitScreenApp.defaultWindowName)
+ }
+ }
+ }
+ }
+ }
+
+ @Test
+ fun testRotateAndEnterSplitScreenMode() {
+ val testTag = "testRotateAndEnterSplitScreenMode"
+ runWithFlicker(splitScreenRotationSetup) {
+ withTestName { testTag }
+ repeat {
+ SplitScreenHelper.TEST_REPETITIONS
+ }
+ transitions {
+ splitScreenApp.launchViaIntent()
+ setRotation(rotation)
+ device.launchSplitScreen()
+ }
+ assertions {
+ layersTrace {
+ navBarLayerRotatesAndScales(Surface.ROTATION_0, rotation, 169271943)
+ statusBarLayerRotatesScales(Surface.ROTATION_0, rotation, 169271943)
+ dockedStackDividerIsVisible()
+ dockedStackPrimaryBoundsIsVisible(
+ rotation, splitScreenApp.defaultWindowName, 169271943)
+ }
+ windowManagerTrace {
+ navBarWindowIsAlwaysVisible()
+ statusBarWindowIsAlwaysVisible()
+ end {
+ showsAppWindow(splitScreenApp.defaultWindowName)
+ }
+ }
+ }
+ }
+ }
+
+ companion object {
+ @Parameterized.Parameters(name = "{0}")
+ @JvmStatic
+ fun getParams(): Collection<Array<Any>> {
+ val supportedRotations = intArrayOf(Surface.ROTATION_90, Surface.ROTATION_270)
+ return supportedRotations.map { arrayOf(Surface.rotationToString(it), it) }
+ }
+ }
+} \ No newline at end of file
diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/RotateTwoLaunchedAppTest.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/RotateTwoLaunchedAppTest.kt
new file mode 100644
index 000000000000..2e05c2a99273
--- /dev/null
+++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/RotateTwoLaunchedAppTest.kt
@@ -0,0 +1,157 @@
+/*
+ * 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.wm.shell.flicker.splitscreen
+
+import android.view.Surface
+import androidx.test.filters.RequiresDevice
+import com.android.server.wm.flicker.dsl.FlickerBuilder
+import com.android.server.wm.flicker.dsl.runWithFlicker
+import com.android.server.wm.flicker.helpers.exitSplitScreen
+import com.android.server.wm.flicker.helpers.isInSplitScreen
+import com.android.server.wm.flicker.helpers.launchSplitScreen
+import com.android.server.wm.flicker.helpers.wakeUpAndGoToHomeScreen
+import com.android.server.wm.flicker.navBarLayerRotatesAndScales
+import com.android.server.wm.flicker.navBarWindowIsAlwaysVisible
+import com.android.server.wm.flicker.statusBarLayerRotatesScales
+import com.android.server.wm.flicker.statusBarWindowIsAlwaysVisible
+import com.android.wm.shell.flicker.dockedStackDividerIsVisible
+import com.android.wm.shell.flicker.dockedStackPrimaryBoundsIsVisible
+import com.android.wm.shell.flicker.dockedStackSecondaryBoundsIsVisible
+import com.android.wm.shell.flicker.helpers.SplitScreenHelper
+import org.junit.FixMethodOrder
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.junit.runners.MethodSorters
+import org.junit.runners.Parameterized
+
+/**
+ * Test open app to split screen.
+ * To run this test: `atest WMShellFlickerTests:RotateTwoLaunchedAppTest`
+ */
+@RequiresDevice
+@RunWith(Parameterized::class)
+@FixMethodOrder(MethodSorters.NAME_ASCENDING)
+class RotateTwoLaunchedAppTest(
+ rotationName: String,
+ rotation: Int
+) : SplitScreenTestBase(rotationName, rotation) {
+ private val splitScreenRotationSetup: FlickerBuilder
+ get() = FlickerBuilder(instrumentation).apply {
+ val testSetupRotation = "testSetupRotation"
+ withTestName {
+ testSetupRotation
+ }
+ setup {
+ test {
+ device.wakeUpAndGoToHomeScreen()
+ }
+ }
+ teardown {
+ eachRun {
+ if (uiDevice.isInSplitScreen()) {
+ uiDevice.exitSplitScreen()
+ }
+ setRotation(Surface.ROTATION_0)
+ splitScreenApp.exit()
+ secondaryApp.exit()
+ }
+ }
+ }
+
+ @Test
+ fun testRotateInSplitScreenMode() {
+ val testTag = "testRotateInSplitScreenMode"
+ runWithFlicker(splitScreenRotationSetup) {
+ withTestName { testTag }
+ repeat {
+ SplitScreenHelper.TEST_REPETITIONS
+ }
+ transitions {
+ secondaryApp.launchViaIntent()
+ splitScreenApp.launchViaIntent()
+ device.launchSplitScreen()
+ splitScreenApp.reopenAppFromOverview()
+ setRotation(rotation)
+ }
+ assertions {
+ layersTrace {
+ navBarLayerRotatesAndScales(Surface.ROTATION_0, rotation, 169271943)
+ statusBarLayerRotatesScales(Surface.ROTATION_0, rotation, 169271943)
+ dockedStackDividerIsVisible()
+ dockedStackPrimaryBoundsIsVisible(
+ rotation, splitScreenApp.defaultWindowName, 169271943)
+ dockedStackSecondaryBoundsIsVisible(
+ rotation, secondaryApp.defaultWindowName, 169271943)
+ }
+ windowManagerTrace {
+ navBarWindowIsAlwaysVisible()
+ statusBarWindowIsAlwaysVisible()
+ end {
+ showsAppWindow(splitScreenApp.defaultWindowName)
+ .and().showsAppWindow(secondaryApp.defaultWindowName)
+ }
+ }
+ }
+ }
+ }
+
+ @Test
+ fun testRotateAndEnterSplitScreenMode() {
+ val testTag = "testRotateAndEnterSplitScreenMode"
+ runWithFlicker(splitScreenRotationSetup) {
+ withTestName { testTag }
+ repeat {
+ SplitScreenHelper.TEST_REPETITIONS
+ }
+ transitions {
+ secondaryApp.launchViaIntent()
+ splitScreenApp.launchViaIntent()
+ setRotation(rotation)
+ device.launchSplitScreen()
+ splitScreenApp.reopenAppFromOverview()
+ }
+ assertions {
+ layersTrace {
+ navBarLayerRotatesAndScales(Surface.ROTATION_0, rotation, 169271943)
+ statusBarLayerRotatesScales(Surface.ROTATION_0, rotation, 169271943)
+ dockedStackDividerIsVisible()
+ dockedStackPrimaryBoundsIsVisible(
+ rotation, splitScreenApp.defaultWindowName, 169271943)
+ dockedStackSecondaryBoundsIsVisible(
+ rotation, secondaryApp.defaultWindowName, 169271943)
+ }
+ windowManagerTrace {
+ navBarWindowIsAlwaysVisible()
+ statusBarWindowIsAlwaysVisible()
+ end {
+ showsAppWindow(splitScreenApp.defaultWindowName)
+ .and().showsAppWindow(secondaryApp.defaultWindowName)
+ }
+ }
+ }
+ }
+ }
+
+ companion object {
+ @Parameterized.Parameters(name = "{0}")
+ @JvmStatic
+ fun getParams(): Collection<Array<Any>> {
+ val supportedRotations = intArrayOf(Surface.ROTATION_90, Surface.ROTATION_270)
+ return supportedRotations.map { arrayOf(Surface.rotationToString(it), it) }
+ }
+ }
+} \ No newline at end of file
diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/SplitScreenRotateOneLaunchedAppTest.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/SplitScreenRotateOneLaunchedAppTest.kt
deleted file mode 100644
index d2371bd766f5..000000000000
--- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/SplitScreenRotateOneLaunchedAppTest.kt
+++ /dev/null
@@ -1,95 +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.wm.shell.flicker.splitscreen
-
-import androidx.test.filters.FlakyTest
-import android.view.Surface
-import androidx.test.filters.RequiresDevice
-import androidx.test.platform.app.InstrumentationRegistry
-import com.android.server.wm.flicker.Flicker
-import com.android.server.wm.flicker.FlickerTestRunner
-import com.android.server.wm.flicker.FlickerTestRunnerFactory
-import com.android.server.wm.flicker.helpers.StandardAppHelper
-import com.android.server.wm.flicker.startRotation
-import com.android.server.wm.flicker.endRotation
-import com.android.server.wm.flicker.helpers.buildTestTag
-import com.android.server.wm.flicker.helpers.exitSplitScreen
-import com.android.server.wm.flicker.helpers.isInSplitScreen
-import com.android.server.wm.flicker.helpers.launchSplitScreen
-import com.android.server.wm.flicker.helpers.setRotation
-import com.android.server.wm.flicker.helpers.wakeUpAndGoToHomeScreen
-import com.android.server.wm.flicker.repetitions
-import org.junit.FixMethodOrder
-import org.junit.runner.RunWith
-import org.junit.runners.MethodSorters
-import org.junit.runners.Parameterized
-
-/**
- * Test open app to split screen.
- * To run this test: `atest WMShellFlickerTests:SplitScreenRotateOneLaunchedAppTest`
- */
-@RequiresDevice
-@RunWith(Parameterized::class)
-@FixMethodOrder(MethodSorters.NAME_ASCENDING)
-@FlakyTest
-class SplitScreenRotateOneLaunchedAppTest(
- testName: String,
- flickerSpec: Flicker
-) : FlickerTestRunner(testName, flickerSpec) {
- companion object {
- @Parameterized.Parameters(name = "{0}")
- @JvmStatic
- fun getParams(): Collection<Array<Any>> {
- val instrumentation = InstrumentationRegistry.getInstrumentation()
- val testApp = StandardAppHelper(instrumentation,
- "com.android.wm.shell.flicker.testapp", "SimpleApp")
-
- return FlickerTestRunnerFactory(instrumentation, repetitions = 3)
- .buildTest { configuration ->
- withTestName {
- buildTestTag("splitScreenRotateOneApp", testApp, configuration)
- }
- repeat { configuration.repetitions }
- setup {
- test {
- device.wakeUpAndGoToHomeScreen()
- testApp.open()
- device.launchSplitScreen()
- device.waitForIdle()
- }
- eachRun {
- this.setRotation(configuration.startRotation)
- }
- }
- teardown {
- eachRun {
- setRotation(Surface.ROTATION_0)
- }
- test {
- testApp.exit()
- if (device.isInSplitScreen()) {
- device.exitSplitScreen()
- }
- }
- }
- transitions {
- this.setRotation(configuration.endRotation)
- }
- }
- }
- }
-} \ No newline at end of file
diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/SplitScreenRotateTwoLaunchedAppTest.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/SplitScreenRotateTwoLaunchedAppTest.kt
deleted file mode 100644
index 67346424acd2..000000000000
--- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/SplitScreenRotateTwoLaunchedAppTest.kt
+++ /dev/null
@@ -1,104 +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.wm.shell.flicker.splitscreen
-
-import androidx.test.filters.FlakyTest
-import android.view.Surface
-import androidx.test.filters.RequiresDevice
-import androidx.test.platform.app.InstrumentationRegistry
-import com.android.server.wm.flicker.Flicker
-import com.android.server.wm.flicker.FlickerTestRunner
-import com.android.server.wm.flicker.FlickerTestRunnerFactory
-import com.android.server.wm.flicker.helpers.StandardAppHelper
-import com.android.server.wm.flicker.startRotation
-import com.android.server.wm.flicker.endRotation
-import com.android.server.wm.flicker.helpers.buildTestTag
-import com.android.server.wm.flicker.helpers.exitSplitScreen
-import com.android.server.wm.flicker.helpers.reopenAppFromOverview
-import com.android.server.wm.flicker.helpers.isInSplitScreen
-import com.android.server.wm.flicker.helpers.launchSplitScreen
-import com.android.server.wm.flicker.helpers.setRotation
-import com.android.server.wm.flicker.helpers.wakeUpAndGoToHomeScreen
-import com.android.server.wm.flicker.repetitions
-import org.junit.FixMethodOrder
-import org.junit.runner.RunWith
-import org.junit.runners.MethodSorters
-import org.junit.runners.Parameterized
-
-/**
- * Test open app to split screen.
- * To run this test: `atest WMShellFlickerTests:SplitScreenRotateTwoLaunchedAppTest`
- */
-@RequiresDevice
-@RunWith(Parameterized::class)
-@FixMethodOrder(MethodSorters.NAME_ASCENDING)
-@FlakyTest
-class SplitScreenRotateTwoLaunchedAppTest(
- testName: String,
- flickerSpec: Flicker
-) : FlickerTestRunner(testName, flickerSpec) {
- companion object {
- @Parameterized.Parameters(name = "{0}")
- @JvmStatic
- fun getParams(): Collection<Array<Any>> {
- val instrumentation = InstrumentationRegistry.getInstrumentation()
- val testApp = StandardAppHelper(instrumentation,
- "com.android.wm.shell.flicker.testapp", "SimpleApp")
- val secondaryApp = StandardAppHelper(instrumentation,
- "com.android.wm.shell.flicker.testapp",
- "SplitScreenSecondaryApp")
-
- return FlickerTestRunnerFactory(instrumentation, repetitions = 3)
- .buildTest { configuration ->
- withTestName {
- buildTestTag("splitScreenRotateTwoApps", testApp, configuration)
- }
- repeat { configuration.repetitions }
- setup {
- test {
- device.wakeUpAndGoToHomeScreen()
- testApp.open()
- device.pressHome()
- secondaryApp.open()
- device.pressHome()
- device.launchSplitScreen()
- device.reopenAppFromOverview()
- device.waitForIdle()
- }
- eachRun {
- this.setRotation(configuration.startRotation)
- }
- }
- teardown {
- eachRun {
- setRotation(Surface.ROTATION_0)
- }
- test {
- testApp.exit()
- secondaryApp.exit()
- if (device.isInSplitScreen()) {
- device.exitSplitScreen()
- }
- }
- }
- transitions {
- this.setRotation(configuration.endRotation)
- }
- }
- }
- }
-} \ No newline at end of file
diff --git a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/SplitScreenTestBase.kt b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/SplitScreenTestBase.kt
index a3440df9ddf8..42c509d6eba8 100644
--- a/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/SplitScreenTestBase.kt
+++ b/libs/WindowManager/Shell/tests/flicker/src/com/android/wm/shell/flicker/splitscreen/SplitScreenTestBase.kt
@@ -17,6 +17,7 @@
package com.android.wm.shell.flicker.splitscreen
import com.android.wm.shell.flicker.NonRotationTestBase
+import com.android.wm.shell.flicker.TEST_APP_NONRESIZEABLE_LABEL
import com.android.wm.shell.flicker.TEST_APP_SPLITSCREEN_PRIMARY_LABEL
import com.android.wm.shell.flicker.TEST_APP_SPLITSCREEN_SECONDARY_LABEL
import com.android.wm.shell.flicker.helpers.SplitScreenHelper
@@ -32,4 +33,7 @@ abstract class SplitScreenTestBase(
protected val secondaryApp = SplitScreenHelper(instrumentation,
TEST_APP_SPLITSCREEN_SECONDARY_LABEL,
Components.SplitScreenSecondaryActivity())
+ protected val nonResizeableApp = SplitScreenHelper(instrumentation,
+ TEST_APP_NONRESIZEABLE_LABEL,
+ Components.NonResizeableActivity())
}
diff --git a/libs/WindowManager/Shell/tests/flicker/test-apps/flickerapp/AndroidManifest.xml b/libs/WindowManager/Shell/tests/flicker/test-apps/flickerapp/AndroidManifest.xml
index a583b725899b..28ed3431db62 100644
--- a/libs/WindowManager/Shell/tests/flicker/test-apps/flickerapp/AndroidManifest.xml
+++ b/libs/WindowManager/Shell/tests/flicker/test-apps/flickerapp/AndroidManifest.xml
@@ -86,6 +86,17 @@
</intent-filter>
</activity>
+ <activity android:name=".NonResizeableActivity"
+ android:resizeableActivity="false"
+ android:taskAffinity="com.android.wm.shell.flicker.testapp.NonResizeableActivity"
+ android:label="NonResizeableApp"
+ android:exported="true">
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN"/>
+ <category android:name="android.intent.category.LAUNCHER"/>
+ </intent-filter>
+ </activity>
+
<activity android:name=".SimpleActivity"
android:taskAffinity="com.android.wm.shell.flicker.testapp.SimpleActivity"
android:label="SimpleApp"
diff --git a/libs/WindowManager/Shell/tests/flicker/test-apps/flickerapp/res/layout/activity_non_resizeable.xml b/libs/WindowManager/Shell/tests/flicker/test-apps/flickerapp/res/layout/activity_non_resizeable.xml
new file mode 100644
index 000000000000..45d5917f86d6
--- /dev/null
+++ b/libs/WindowManager/Shell/tests/flicker/test-apps/flickerapp/res/layout/activity_non_resizeable.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright 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.
+-->
+<LinearLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="vertical"
+ android:background="@android:color/holo_orange_light">
+
+ <TextView
+ android:id="@+id/NonResizeableTest"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:gravity="center_vertical|center_horizontal"
+ android:text="NonResizeableActivity"
+ android:textAppearance="?android:attr/textAppearanceLarge"/>
+
+</LinearLayout>
diff --git a/libs/WindowManager/Shell/tests/flicker/test-apps/flickerapp/src/com/android/wm/shell/flicker/testapp/Components.java b/libs/WindowManager/Shell/tests/flicker/test-apps/flickerapp/src/com/android/wm/shell/flicker/testapp/Components.java
index 8e9b4cb2d53e..f729ea554072 100644
--- a/libs/WindowManager/Shell/tests/flicker/test-apps/flickerapp/src/com/android/wm/shell/flicker/testapp/Components.java
+++ b/libs/WindowManager/Shell/tests/flicker/test-apps/flickerapp/src/com/android/wm/shell/flicker/testapp/Components.java
@@ -38,6 +38,13 @@ public class Components {
}
}
+ public static class NonResizeableActivity extends ComponentsInfo {
+ @Override
+ public String getActivityName() {
+ return NonResizeableActivity.class.getSimpleName();
+ }
+ }
+
public static class PipActivity extends ComponentsInfo {
// Intent action that this activity dynamically registers to enter picture-in-picture
public static final String ACTION_ENTER_PIP = PACKAGE_NAME + ".PipActivity.ENTER_PIP";
diff --git a/libs/WindowManager/Shell/tests/flicker/test-apps/flickerapp/src/com/android/wm/shell/flicker/testapp/NonResizeableActivity.java b/libs/WindowManager/Shell/tests/flicker/test-apps/flickerapp/src/com/android/wm/shell/flicker/testapp/NonResizeableActivity.java
new file mode 100644
index 000000000000..24275e002c7f
--- /dev/null
+++ b/libs/WindowManager/Shell/tests/flicker/test-apps/flickerapp/src/com/android/wm/shell/flicker/testapp/NonResizeableActivity.java
@@ -0,0 +1,29 @@
+/*
+ * 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.wm.shell.flicker.testapp;
+
+import android.app.Activity;
+import android.os.Bundle;
+
+public class NonResizeableActivity extends Activity {
+
+ @Override
+ protected void onCreate(Bundle icicle) {
+ super.onCreate(icicle);
+ setContentView(R.layout.activity_non_resizeable);
+ }
+}
diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/ShellTaskOrganizerTests.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/ShellTaskOrganizerTests.java
index fdf4d31f0281..862776ec7df2 100644
--- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/ShellTaskOrganizerTests.java
+++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/ShellTaskOrganizerTests.java
@@ -16,18 +16,14 @@
package com.android.wm.shell;
-import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
import static android.app.WindowConfiguration.WINDOWING_MODE_MULTI_WINDOW;
import static android.app.WindowConfiguration.WINDOWING_MODE_PINNED;
import static com.android.dx.mockito.inline.extended.ExtendedMockito.doReturn;
import static com.android.dx.mockito.inline.extended.ExtendedMockito.spy;
-import static com.android.wm.shell.ShellTaskOrganizer.TASK_LISTENER_TYPE_FULLSCREEN;
-import static com.android.wm.shell.ShellTaskOrganizer.TASK_LISTENER_TYPE_LETTERBOX;
import static com.android.wm.shell.ShellTaskOrganizer.TASK_LISTENER_TYPE_MULTI_WINDOW;
import static com.android.wm.shell.ShellTaskOrganizer.TASK_LISTENER_TYPE_PIP;
-import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
@@ -38,7 +34,6 @@ import static org.mockito.Mockito.verify;
import android.app.ActivityManager.RunningTaskInfo;
import android.content.Context;
import android.content.pm.ParceledListSlice;
-import android.graphics.Rect;
import android.os.Binder;
import android.os.IBinder;
import android.os.RemoteException;
@@ -47,7 +42,6 @@ import android.window.ITaskOrganizer;
import android.window.ITaskOrganizerController;
import android.window.TaskAppearedInfo;
-import androidx.annotation.Nullable;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.SmallTest;
@@ -108,8 +102,7 @@ public class ShellTaskOrganizerTests {
doReturn(ParceledListSlice.<TaskAppearedInfo>emptyList())
.when(mTaskOrganizerController).registerTaskOrganizer(any());
} catch (RemoteException e) {}
- mOrganizer = spy(new ShellTaskOrganizer(mTaskOrganizerController, mSyncTransactionQueue,
- mTransactionPool, mTestExecutor, mTestExecutor, mContext));
+ mOrganizer = spy(new ShellTaskOrganizer(mTaskOrganizerController, mTestExecutor, mContext));
}
@Test
@@ -264,28 +257,6 @@ public class ShellTaskOrganizerTests {
assertTrue(mwListener.appeared.contains(task2));
}
- @Test
- public void testTaskInfoToTaskListenerType_whenLetterboxBoundsPassed_returnsLetterboxType() {
- RunningTaskInfo taskInfo = createTaskInfo(
- /* taskId */ 1,
- WINDOWING_MODE_FULLSCREEN,
- /* letterboxActivityBounds */ new Rect(1, 1, 1, 1));
-
- assertEquals(
- ShellTaskOrganizer.taskInfoToTaskListenerType(taskInfo),
- TASK_LISTENER_TYPE_LETTERBOX);
- }
-
- @Test
- public void testTaskInfoToTaskListenerType_whenLetterboxBoundsIsNull_returnsFullscreenType() {
- RunningTaskInfo taskInfo = createTaskInfo(
- /* taskId */ 1, WINDOWING_MODE_FULLSCREEN, /* letterboxActivityBounds */ null);
-
- assertEquals(
- ShellTaskOrganizer.taskInfoToTaskListenerType(taskInfo),
- TASK_LISTENER_TYPE_FULLSCREEN);
- }
-
private static RunningTaskInfo createTaskInfo(int taskId, int windowingMode) {
RunningTaskInfo taskInfo = new RunningTaskInfo();
taskInfo.taskId = taskId;
@@ -293,12 +264,4 @@ public class ShellTaskOrganizerTests {
return taskInfo;
}
- private static RunningTaskInfo createTaskInfo(
- int taskId, int windowingMode, @Nullable Rect letterboxActivityBounds) {
- RunningTaskInfo taskInfo = new RunningTaskInfo();
- taskInfo.taskId = taskId;
- taskInfo.configuration.windowConfiguration.setWindowingMode(windowingMode);
- taskInfo.letterboxActivityBounds = Rect.copyOrNull(letterboxActivityBounds);
- return taskInfo;
- }
}
diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/TaskViewTest.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/TaskViewTest.java
index 34f772faf9a9..11bf4ff2fd35 100644
--- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/TaskViewTest.java
+++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/TaskViewTest.java
@@ -30,6 +30,7 @@ import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.reset;
import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
import android.app.ActivityManager;
import android.app.ActivityOptions;
@@ -96,8 +97,8 @@ public class TaskViewTest extends ShellTestCase {
return null;
}).when(mExecutor).execute(any());
+ when(mOrganizer.getExecutor()).thenReturn(mExecutor);
mTaskView = new TaskView(mContext, mOrganizer);
- mTaskView.setExecutor(mExecutor);
mTaskView.setListener(mViewListener);
}
@@ -111,7 +112,6 @@ public class TaskViewTest extends ShellTestCase {
@Test
public void testSetPendingListener_throwsException() {
TaskView taskView = new TaskView(mContext, mOrganizer);
- mTaskView.setExecutor(mExecutor);
taskView.setListener(mViewListener);
try {
taskView.setListener(mViewListener);
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 d87f4c60fad4..9fdd59bee176 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
@@ -69,24 +69,27 @@ public class SplitLayoutTests extends ShellTestCase {
}
@Test
- public void testUpdateDividePosition() {
- mSplitLayout.updateDividePosition(anyInt());
+ public void testUpdateDivideBounds() {
+ mSplitLayout.updateDivideBounds(anyInt());
verify(mLayoutChangeListener).onBoundsChanging(any(SplitLayout.class));
}
@Test
- public void testSetSnapTarget() {
- DividerSnapAlgorithm.SnapTarget snapTarget = getSnapTarget(0,
+ @UiThreadTest
+ public void testSnapToTarget() {
+ DividerSnapAlgorithm.SnapTarget snapTarget = getSnapTarget(0 /* position */,
DividerSnapAlgorithm.SnapTarget.FLAG_NONE);
- mSplitLayout.setSnapTarget(snapTarget);
- verify(mLayoutChangeListener).onBoundsChanged(any(SplitLayout.class));
+ mSplitLayout.snapToTarget(0 /* currentPosition */, snapTarget);
+ verify(mLayoutChangeListener).onBoundsChanging(any(SplitLayout.class));
// verify it callbacks properly when the snap target indicates dismissing split.
- snapTarget = getSnapTarget(0, DividerSnapAlgorithm.SnapTarget.FLAG_DISMISS_START);
- mSplitLayout.setSnapTarget(snapTarget);
+ snapTarget = getSnapTarget(0 /* position */,
+ DividerSnapAlgorithm.SnapTarget.FLAG_DISMISS_START);
+ mSplitLayout.snapToTarget(0 /* currentPosition */, snapTarget);
verify(mLayoutChangeListener).onSnappedToDismiss(eq(false));
- snapTarget = getSnapTarget(0, DividerSnapAlgorithm.SnapTarget.FLAG_DISMISS_END);
- mSplitLayout.setSnapTarget(snapTarget);
+ snapTarget = getSnapTarget(0 /* position */,
+ DividerSnapAlgorithm.SnapTarget.FLAG_DISMISS_END);
+ mSplitLayout.snapToTarget(0 /* currentPosition */, snapTarget);
verify(mLayoutChangeListener).onSnappedToDismiss(eq(true));
}
diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/letterbox/LetterboxConfigControllerTest.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/letterbox/LetterboxConfigControllerTest.java
deleted file mode 100644
index 29233366d4f3..000000000000
--- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/letterbox/LetterboxConfigControllerTest.java
+++ /dev/null
@@ -1,131 +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.wm.shell.letterbox;
-
-import static org.junit.Assert.assertEquals;
-
-import android.view.Gravity;
-
-import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.SmallTest;
-
-import com.android.wm.shell.R;
-import com.android.wm.shell.ShellTestCase;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-/**
- * Tests for {@link LetterboxConfigController}.
- */
-@SmallTest
-@RunWith(AndroidJUnit4.class)
-public final class LetterboxConfigControllerTest extends ShellTestCase {
-
- private LetterboxConfigController mLetterboxConfigController;
-
- @Before
- public void setUp() {
- mLetterboxConfigController = new LetterboxConfigController(getContext());
- }
-
- @Test
- public void testGetPortraitGravity_noOverrides_returnConfigValue() {
- assertEquals(
- mLetterboxConfigController.getPortraitGravity(),
- getContext().getResources().getInteger(R.integer.config_letterboxPortraitGravity));
- }
-
- @Test
- public void testGetLandscapeGravity_noOverrides_returnConfigValue() {
- assertEquals(
- mLetterboxConfigController.getLandscapeGravity(),
- getContext().getResources().getInteger(R.integer.config_letterboxLandscapeGravity));
- }
-
- @Test
- public void testSetPortraitGravity_validValue_savesValue() {
- mLetterboxConfigController.setPortraitGravity(Gravity.BOTTOM);
- assertEquals(mLetterboxConfigController.getPortraitGravity(), Gravity.BOTTOM);
-
- mLetterboxConfigController.setPortraitGravity(Gravity.CENTER);
- assertEquals(mLetterboxConfigController.getPortraitGravity(), Gravity.CENTER);
-
- mLetterboxConfigController.setPortraitGravity(Gravity.TOP);
- assertEquals(mLetterboxConfigController.getPortraitGravity(), Gravity.TOP);
- }
-
- @Test
- public void testSetLandscapeGravity_validValue_savesValue() {
- mLetterboxConfigController.setLandscapeGravity(Gravity.LEFT);
- assertEquals(mLetterboxConfigController.getLandscapeGravity(), Gravity.LEFT);
-
- mLetterboxConfigController.setLandscapeGravity(Gravity.CENTER);
- assertEquals(mLetterboxConfigController.getLandscapeGravity(), Gravity.CENTER);
-
- mLetterboxConfigController.setLandscapeGravity(Gravity.RIGHT);
- assertEquals(mLetterboxConfigController.getLandscapeGravity(), Gravity.RIGHT);
- }
-
- @Test(expected = IllegalArgumentException.class)
- public void testSetPortraitGravity_invalidValue_throwsException() {
- mLetterboxConfigController.setPortraitGravity(Gravity.RIGHT);
- }
-
- @Test(expected = IllegalArgumentException.class)
- public void testSetLandscapeGravity_invalidValue_throwsException() {
- mLetterboxConfigController.setLandscapeGravity(Gravity.TOP);
- }
-
- @Test
- public void testResetPortraitGravity() {
- int defaultGravity =
- getContext().getResources().getInteger(R.integer.config_letterboxPortraitGravity);
-
- mLetterboxConfigController.setPortraitGravity(Gravity.BOTTOM);
- mLetterboxConfigController.resetPortraitGravity();
- assertEquals(mLetterboxConfigController.getPortraitGravity(), defaultGravity);
-
- mLetterboxConfigController.setPortraitGravity(Gravity.CENTER);
- mLetterboxConfigController.resetPortraitGravity();
- assertEquals(mLetterboxConfigController.getPortraitGravity(), defaultGravity);
-
- mLetterboxConfigController.setPortraitGravity(Gravity.TOP);
- mLetterboxConfigController.resetPortraitGravity();
- assertEquals(mLetterboxConfigController.getPortraitGravity(), defaultGravity);
- }
-
- @Test
- public void testResetLandscapeGravity() {
- int defaultGravity =
- getContext().getResources().getInteger(R.integer.config_letterboxLandscapeGravity);
-
- mLetterboxConfigController.setLandscapeGravity(Gravity.RIGHT);
- mLetterboxConfigController.resetLandscapeGravity();
- assertEquals(mLetterboxConfigController.getLandscapeGravity(), defaultGravity);
-
- mLetterboxConfigController.setLandscapeGravity(Gravity.CENTER);
- mLetterboxConfigController.resetLandscapeGravity();
- assertEquals(mLetterboxConfigController.getLandscapeGravity(), defaultGravity);
-
- mLetterboxConfigController.setLandscapeGravity(Gravity.LEFT);
- mLetterboxConfigController.resetLandscapeGravity();
- assertEquals(mLetterboxConfigController.getLandscapeGravity(), defaultGravity);
- }
-
-}
diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/letterbox/LetterboxTaskListenerTest.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/letterbox/LetterboxTaskListenerTest.java
deleted file mode 100644
index 5cbc7d927d61..000000000000
--- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/letterbox/LetterboxTaskListenerTest.java
+++ /dev/null
@@ -1,367 +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.wm.shell.letterbox;
-
-import static com.android.dx.mockito.inline.extended.ExtendedMockito.verify;
-
-import static org.mockito.ArgumentMatchers.anyInt;
-import static org.mockito.ArgumentMatchers.eq;
-import static org.mockito.Mockito.when;
-
-import android.app.ActivityManager.RunningTaskInfo;
-import android.graphics.Insets;
-import android.graphics.Rect;
-import android.os.Handler;
-import android.os.Looper;
-import android.view.Gravity;
-import android.view.SurfaceControl;
-import android.view.WindowInsets;
-import android.view.WindowManager;
-import android.view.WindowMetrics;
-
-import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.SmallTest;
-
-import com.android.wm.shell.ShellTestCase;
-import com.android.wm.shell.common.SyncTransactionQueue;
-import com.android.wm.shell.common.TransactionPool;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.Mock;
-import org.mockito.MockitoAnnotations;
-
-/**
- * Tests for {@link LetterboxTaskListener}.
- */
-@SmallTest
-@RunWith(AndroidJUnit4.class)
-public final class LetterboxTaskListenerTest extends ShellTestCase {
-
- @Mock private SurfaceControl mLeash;
- @Mock private SurfaceControl.Transaction mTransaction;
- @Mock private WindowManager mWindowManager;
- @Mock private WindowMetrics mWindowMetrics;
- @Mock private WindowInsets mWindowInsets;
- private LetterboxTaskListener mLetterboxTaskListener;
- private LetterboxConfigController mLetterboxConfigController;
-
- @Before
- public void setUp() {
- MockitoAnnotations.initMocks(this);
-
- mLetterboxConfigController = new LetterboxConfigController(getContext());
- mLetterboxTaskListener = new LetterboxTaskListener(
- new SyncTransactionQueue(
- new TransactionPool() {
- @Override
- public SurfaceControl.Transaction acquire() {
- return mTransaction;
- }
-
- @Override
- public void release(SurfaceControl.Transaction t) {
- }
- },
- new Handler(Looper.getMainLooper())),
- mLetterboxConfigController,
- mWindowManager);
-
- when(mWindowManager.getMaximumWindowMetrics()).thenReturn(mWindowMetrics);
- when(mWindowMetrics.getWindowInsets()).thenReturn(mWindowInsets);
- }
-
- @Test
- public void testOnTaskInfoChanged_updatesPositionAndCrop() {
- setWindowBoundsAndInsets(
- /* windowBounds= */ new Rect(0, 0, 200, 100), // equal to parent bounds
- Insets.NONE);
-
- mLetterboxConfigController.setLandscapeGravity(Gravity.CENTER);
- mLetterboxTaskListener.onTaskAppeared(
- createTaskInfo(
- /* taskId */ 1,
- /* maxBounds= */ new Rect(0, 0, 200, 100), // equal to parent bounds
- /* parentBounds */ new Rect(0, 0, 200, 100),
- /* activityBounds */ new Rect(75, 0, 125, 75),
- /* taskBounds */ new Rect(50, 0, 125, 100),
- /* activityInsets */ new Rect(0, 0, 0, 0)),
- mLeash);
-
- // Task doesn't need to repositioned
- verifySetPosition(50, 0);
- // Should return activity coordinates offset by task coordinates
- verifySetWindowCrop(new Rect(25, 0, 75, 75));
-
- mLetterboxTaskListener.onTaskInfoChanged(
- createTaskInfo(
- /* taskId */ 1,
- /* maxBounds= */ new Rect(0, 0, 200, 100), // equal to parent bounds
- /* parentBounds */ new Rect(0, 0, 200, 100),
- // Activity is offset by 25 to the left
- /* activityBounds */ new Rect(50, 0, 100, 75),
- /* taskBounds */ new Rect(50, 0, 125, 100),
- /* activityInsets */ new Rect(0, 0, 0, 0)));
-
- // Task needs to be repositioned by 25 to the left
- verifySetPosition(75, 0);
- // Should return activity coordinates offset by task coordinates
- verifySetWindowCrop(new Rect(0, 0, 50, 75));
- }
-
- @Test
- public void testOnTaskInfoAppeared_landscapeWithLeftGravity() {
- mLetterboxConfigController.setLandscapeGravity(Gravity.LEFT);
- setWindowBoundsAndInsets(
- /* windowBounds= */ new Rect(0, 0, 200, 100), // equal to parent bounds
- Insets.of(/* left= */ 10, /* top= */ 10, /* right= */ 10, /* bottom= */ 10));
-
- mLetterboxTaskListener.onTaskAppeared(
- createTaskInfo(
- /* taskId */ 1,
- /* maxBounds= */ new Rect(0, 0, 200, 100), // equal to parent bounds
- /* parentBounds */ new Rect(0, 0, 200, 100),
- /* activityBounds */ new Rect(150, 0, 200, 75),
- /* taskBounds */ new Rect(125, 0, 200, 100),
- /* activityInsets */ new Rect(0, 10, 10, 0)),
- mLeash);
-
- verifySetPosition(-15, 0);
- // Should return activity coordinates offset by task coordinates minus unwanted right inset
- verifySetWindowCrop(new Rect(25, 0, 65, 75));
- }
-
- @Test
- public void testOnTaskInfoAppeared_landscapeWithCenterGravity() {
- mLetterboxConfigController.setLandscapeGravity(Gravity.CENTER);
- setWindowBoundsAndInsets(
- /* windowBounds= */ new Rect(0, 0, 200, 100), // equal to parent bounds
- Insets.of(/* left= */ 10, /* top= */ 10, /* right= */ 10, /* bottom= */ 10));
-
- mLetterboxTaskListener.onTaskAppeared(
- createTaskInfo(
- /* taskId */ 1,
- /* maxBounds= */ new Rect(0, 0, 200, 100), // equal to parent bounds
- /* parentBounds */ new Rect(0, 0, 200, 100),
- /* activityBounds */ new Rect(150, 0, 200, 75),
- /* taskBounds */ new Rect(125, 0, 200, 100),
- /* activityInsets */ new Rect(0, 10, 10, 0)),
- mLeash);
-
- verifySetPosition(55, 0);
- // Should return activity coordinates offset by task coordinates minus unwanted right inset
- verifySetWindowCrop(new Rect(25, 0, 65, 75));
- }
-
- @Test
- public void testOnTaskInfoAppeared_landscapeWithRightGravity() {
- mLetterboxConfigController.setLandscapeGravity(Gravity.RIGHT);
- setWindowBoundsAndInsets(
- /* windowBounds= */ new Rect(0, 0, 200, 100), // equal to parent bounds
- Insets.of(/* left= */ 10, /* top= */ 10, /* right= */ 10, /* bottom= */ 10));
-
- mLetterboxTaskListener.onTaskAppeared(
- createTaskInfo(
- /* taskId */ 1,
- /* maxBounds= */ new Rect(0, 0, 200, 100), // equal to parent bounds
- /* parentBounds */ new Rect(0, 0, 200, 100),
- /* activityBounds */ new Rect(50, 0, 100, 75),
- /* taskBounds */ new Rect(25, 0, 100, 100),
- /* activityInsets */ new Rect(0, 10, 10, 0)),
- mLeash);
-
- verifySetPosition(115, 0);
- // Should return activity coordinates offset by task coordinates
- verifySetWindowCrop(new Rect(25, 0, 75, 75));
- }
-
- @Test
- public void testOnTaskInfoAppeared_portraitWithTopGravity() {
- mLetterboxConfigController.setPortraitGravity(Gravity.TOP);
- setWindowBoundsAndInsets(
- /* windowBounds= */ new Rect(0, 0, 100, 150), // equal to parent bounds
- Insets.of(/* left= */ 10, /* top= */ 10, /* right= */ 10, /* bottom= */ 20));
-
- mLetterboxTaskListener.onTaskAppeared(
- createTaskInfo(
- /* taskId */ 1,
- /* maxBounds= */ new Rect(0, 0, 100, 150), // equal to parent bounds
- /* parentBounds */ new Rect(0, 0, 100, 150),
- /* activityBounds */ new Rect(0, 75, 50, 125),
- /* taskBounds */ new Rect(0, 50, 100, 125),
- /* activityInsets */ new Rect(10, 0, 0, 0)),
- mLeash);
-
- verifySetPosition(20, -15);
- // Should return activity coordinates offset by task coordinates minus unwanted left inset
- verifySetWindowCrop(new Rect(10, 25, 50, 75));
- }
-
- @Test
- public void testOnTaskInfoAppeared_portraitWithCenterGravity() {
- mLetterboxConfigController.setPortraitGravity(Gravity.CENTER);
- setWindowBoundsAndInsets(
- /* windowBounds= */ new Rect(0, 0, 100, 150), // equal to parent bounds
- Insets.of(/* left= */ 10, /* top= */ 10, /* right= */ 10, /* bottom= */ 20));
-
- mLetterboxTaskListener.onTaskAppeared(
- createTaskInfo(
- /* taskId */ 1,
- /* maxBounds= */ new Rect(0, 0, 100, 150), // equal to parent bounds
- /* parentBounds */ new Rect(0, 0, 100, 150),
- /* activityBounds */ new Rect(0, 75, 50, 125),
- /* taskBounds */ new Rect(0, 50, 100, 125),
- /* activityInsets */ new Rect(10, 0, 0, 0)),
- mLeash);
-
- verifySetPosition(20, 20);
- // Should return activity coordinates offset by task coordinates minus unwanted left inset
- verifySetWindowCrop(new Rect(10, 25, 50, 75));
- }
-
- @Test
- public void testOnTaskInfoAppeared_portraitWithCenterGravity_visibleLeftInset() {
- mLetterboxConfigController.setPortraitGravity(Gravity.CENTER);
- setWindowBoundsAndInsets(
- /* windowBounds= */ new Rect(0, 0, 100, 150), // equal to parent bounds
- Insets.of(/* left= */ 10, /* top= */ 10, /* right= */ 10, /* bottom= */ 20));
-
- mLetterboxTaskListener.onTaskAppeared(
- createTaskInfo(
- /* taskId */ 1,
- /* maxBounds= */ new Rect(0, 0, 100, 150), // equal to parent bounds
- /* parentBounds */ new Rect(0, 0, 100, 150),
- /* activityBounds */ new Rect(0, 75, 50, 125),
- /* taskBounds */ new Rect(0, 50, 100, 125),
- // Activity is drawn under the left inset.
- /* activityInsets */ new Rect(0, 0, 0, 0)),
- mLeash);
-
- verifySetPosition(20, 20);
- // Should return activity coordinates offset by task coordinates
- verifySetWindowCrop(new Rect(0, 25, 50, 75));
- }
-
- @Test
- public void testOnTaskInfoAppeared_portraitWithBottomGravity() {
- mLetterboxConfigController.setPortraitGravity(Gravity.BOTTOM);
- setWindowBoundsAndInsets(
- /* windowBounds= */ new Rect(0, 0, 100, 150), // equal to parent bounds
- Insets.of(/* left= */ 10, /* top= */ 10, /* right= */ 10, /* bottom= */ 20));
-
- mLetterboxTaskListener.onTaskAppeared(
- createTaskInfo(
- /* taskId */ 1,
- /* maxBounds= */ new Rect(0, 0, 100, 150), // equal to parent bounds
- /* parentBounds */ new Rect(0, 0, 100, 150),
- /* activityBounds */ new Rect(0, 75, 50, 125),
- /* taskBounds */ new Rect(0, 50, 100, 125),
- /* activityInsets */ new Rect(10, 0, 0, 0)),
- mLeash);
-
- verifySetPosition(20, 55);
- // Should return activity coordinates offset by task coordinates minus unwanted left inset
- verifySetWindowCrop(new Rect(10, 25, 50, 75));
- }
-
- @Test
- public void testOnTaskInfoAppeared_partlyOverlapsWithAllInsets() {
- mLetterboxConfigController.setPortraitGravity(Gravity.TOP);
- setWindowBoundsAndInsets(
- /* windowBounds= */ new Rect(0, 0, 200, 125), // equal to parent bounds
- Insets.of(/* left= */ 25, /* top= */ 25, /* right= */ 35, /* bottom= */ 15));
-
- mLetterboxTaskListener.onTaskAppeared(
- createTaskInfo(
- /* taskId */ 1,
- /* maxBounds= */ new Rect(0, 0, 200, 125), // equal to parent bounds
- /* parentBounds */ new Rect(0, 0, 200, 125),
- /* activityBounds */ new Rect(15, 0, 175, 120),
- /* taskBounds */ new Rect(0, 0, 200, 125),
- /* activityInsets */ new Rect(10, 25, 10, 10)), // equal to parent bounds
- mLeash);
-
- // Activity fully covers parent bounds with insets so doesn't need to be moved.
- verifySetPosition(0, 0);
- // Should return activity coordinates offset by task coordinates
- verifySetWindowCrop(new Rect(15, 0, 175, 120));
- }
-
- @Test
- public void testOnTaskInfoAppeared_parentShiftedLikeInOneHandedMode() {
- mLetterboxConfigController.setPortraitGravity(Gravity.TOP);
- setWindowBoundsAndInsets(
- /* windowBounds= */ new Rect(0, 0, 100, 150),
- Insets.of(/* left= */ 0, /* top= */ 10, /* right= */ 0, /* bottom= */ 0));
-
- mLetterboxTaskListener.onTaskAppeared(
- createTaskInfo(
- /* taskId */ 1,
- /* maxBounds= */ new Rect(0, 0, 100, 150),
- /* parentBounds */ new Rect(0, 75, 100, 225),
- /* activityBounds */ new Rect(25, 75, 75, 125),
- /* taskBounds */ new Rect(0, 75, 100, 125),
- /* activityInsets */ new Rect(10, 0, 0, 0)),
- mLeash);
-
- verifySetPosition(0, 0);
- verifySetWindowCrop(new Rect(25, 0, 75, 50));
- }
-
- @Test(expected = IllegalStateException.class)
- public void testOnTaskAppeared_calledSecondTimeWithSameTaskId_throwsException() {
- setWindowBoundsAndInsets(new Rect(), Insets.NONE);
- RunningTaskInfo taskInfo =
- createTaskInfo(/* taskId */ 1, new Rect(), new Rect(), new Rect(), new Rect(),
- new Rect());
- mLetterboxTaskListener.onTaskAppeared(taskInfo, mLeash);
- mLetterboxTaskListener.onTaskAppeared(taskInfo, mLeash);
- }
-
- private void setWindowBoundsAndInsets(Rect windowBounds, Insets insets) {
- when(mWindowMetrics.getBounds()).thenReturn(windowBounds);
- when(mWindowInsets.getInsets(anyInt())).thenReturn(insets);
- }
-
- private void verifySetPosition(int x, int y) {
- verify(mTransaction).setPosition(eq(mLeash), eq((float) x), eq((float) y));
- }
-
- private void verifySetWindowCrop(final Rect crop) {
- // Should return activty coordinates offset by task coordinates
- verify(mTransaction).setWindowCrop(eq(mLeash), eq(crop));
- }
-
- private static RunningTaskInfo createTaskInfo(
- int taskId,
- final Rect maxBounds,
- final Rect parentBounds,
- final Rect activityBounds,
- final Rect taskBounds,
- final Rect activityInsets) {
- RunningTaskInfo taskInfo = new RunningTaskInfo();
- taskInfo.taskId = taskId;
- taskInfo.configuration.windowConfiguration.setMaxBounds(maxBounds);
- taskInfo.parentBounds = parentBounds;
- taskInfo.configuration.windowConfiguration.setBounds(taskBounds);
- taskInfo.letterboxActivityBounds = Rect.copyOrNull(activityBounds);
- taskInfo.letterboxActivityInsets = Rect.copyOrNull(activityInsets);
-
- return taskInfo;
- }
-}
diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/pip/PipBoundsAlgorithmTest.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/pip/PipBoundsAlgorithmTest.java
index a65d832359d2..ef9923550fc5 100644
--- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/pip/PipBoundsAlgorithmTest.java
+++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/pip/PipBoundsAlgorithmTest.java
@@ -337,7 +337,8 @@ public class PipBoundsAlgorithmTest extends ShellTestCase {
reentryBounds.scale(1.25f);
final float reentrySnapFraction = mPipBoundsAlgorithm.getSnapFraction(reentryBounds);
- mPipBoundsState.saveReentryState(reentryBounds, reentrySnapFraction);
+ mPipBoundsState.saveReentryState(
+ new Size(reentryBounds.width(), reentryBounds.height()), reentrySnapFraction);
final Rect destinationBounds = mPipBoundsAlgorithm.getEntryDestinationBounds();
assertEquals(reentryBounds.width(), destinationBounds.width());
@@ -351,7 +352,8 @@ public class PipBoundsAlgorithmTest extends ShellTestCase {
reentryBounds.offset(0, -100);
final float reentrySnapFraction = mPipBoundsAlgorithm.getSnapFraction(reentryBounds);
- mPipBoundsState.saveReentryState(reentryBounds, reentrySnapFraction);
+ mPipBoundsState.saveReentryState(
+ new Size(reentryBounds.width(), reentryBounds.height()), reentrySnapFraction);
final Rect destinationBounds = mPipBoundsAlgorithm.getEntryDestinationBounds();
diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/pip/PipBoundsStateTest.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/pip/PipBoundsStateTest.java
index 4bcca06b592f..8ba301a9ebfa 100644
--- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/pip/PipBoundsStateTest.java
+++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/pip/PipBoundsStateTest.java
@@ -47,7 +47,7 @@ import java.util.function.BiConsumer;
@SmallTest
public class PipBoundsStateTest extends ShellTestCase {
- private static final Rect DEFAULT_BOUNDS = new Rect(0, 0, 10, 10);
+ private static final Size DEFAULT_SIZE = new Size(10, 10);
private static final float DEFAULT_SNAP_FRACTION = 1.0f;
private PipBoundsState mPipBoundsState;
@@ -71,22 +71,22 @@ public class PipBoundsStateTest extends ShellTestCase {
@Test
public void testSetReentryState() {
- final Rect bounds = new Rect(0, 0, 100, 100);
+ final Size size = new Size(100, 100);
final float snapFraction = 0.5f;
- mPipBoundsState.saveReentryState(bounds, snapFraction);
+ mPipBoundsState.saveReentryState(size, snapFraction);
final PipBoundsState.PipReentryState state = mPipBoundsState.getReentryState();
- assertEquals(new Size(100, 100), state.getSize());
+ assertEquals(size, state.getSize());
assertEquals(snapFraction, state.getSnapFraction(), 0.01);
}
@Test
public void testClearReentryState() {
- final Rect bounds = new Rect(0, 0, 100, 100);
+ final Size size = new Size(100, 100);
final float snapFraction = 0.5f;
- mPipBoundsState.saveReentryState(bounds, snapFraction);
+ mPipBoundsState.saveReentryState(size, snapFraction);
mPipBoundsState.clearReentryState();
assertNull(mPipBoundsState.getReentryState());
@@ -95,20 +95,20 @@ public class PipBoundsStateTest extends ShellTestCase {
@Test
public void testSetLastPipComponentName_notChanged_doesNotClearReentryState() {
mPipBoundsState.setLastPipComponentName(mTestComponentName1);
- mPipBoundsState.saveReentryState(DEFAULT_BOUNDS, DEFAULT_SNAP_FRACTION);
+ mPipBoundsState.saveReentryState(DEFAULT_SIZE, DEFAULT_SNAP_FRACTION);
mPipBoundsState.setLastPipComponentName(mTestComponentName1);
final PipBoundsState.PipReentryState state = mPipBoundsState.getReentryState();
assertNotNull(state);
- assertEquals(new Size(DEFAULT_BOUNDS.width(), DEFAULT_BOUNDS.height()), state.getSize());
+ assertEquals(DEFAULT_SIZE, state.getSize());
assertEquals(DEFAULT_SNAP_FRACTION, state.getSnapFraction(), 0.01);
}
@Test
public void testSetLastPipComponentName_changed_clearReentryState() {
mPipBoundsState.setLastPipComponentName(mTestComponentName1);
- mPipBoundsState.saveReentryState(DEFAULT_BOUNDS, DEFAULT_SNAP_FRACTION);
+ mPipBoundsState.saveReentryState(DEFAULT_SIZE, DEFAULT_SNAP_FRACTION);
mPipBoundsState.setLastPipComponentName(mTestComponentName2);
diff --git a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/pip/phone/PipControllerTest.java b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/pip/phone/PipControllerTest.java
index 4687d2d9667c..62ffac4fbd3f 100644
--- a/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/pip/phone/PipControllerTest.java
+++ b/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/pip/phone/PipControllerTest.java
@@ -30,10 +30,12 @@ import static org.mockito.Mockito.when;
import android.content.ComponentName;
import android.content.Context;
import android.content.pm.PackageManager;
+import android.graphics.Rect;
import android.os.RemoteException;
import android.test.suitebuilder.annotation.SmallTest;
import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper;
+import android.util.Size;
import com.android.wm.shell.ShellTestCase;
import com.android.wm.shell.WindowManagerShellWrapper;
@@ -135,4 +137,28 @@ public class PipControllerTest extends ShellTestCase {
verify(mMockPipBoundsState, never()).setLastPipComponentName(null);
}
+
+ @Test
+ public void saveReentryState_noUserResize_doesNotSaveSize() {
+ final Rect bounds = new Rect(0, 0, 10, 10);
+ when(mMockPipBoundsAlgorithm.getSnapFraction(bounds)).thenReturn(1.0f);
+ when(mMockPipBoundsState.hasUserResizedPip()).thenReturn(false);
+
+ mPipController.saveReentryState(bounds);
+
+ verify(mMockPipBoundsState).saveReentryState(null, 1.0f);
+ }
+
+ @Test
+ public void saveReentryState_userHasResized_savesSize() {
+ final Rect bounds = new Rect(0, 0, 10, 10);
+ final Rect resizedBounds = new Rect(0, 0, 30, 30);
+ when(mMockPipBoundsAlgorithm.getSnapFraction(bounds)).thenReturn(1.0f);
+ when(mMockPipTouchHandler.getUserResizeBounds()).thenReturn(resizedBounds);
+ when(mMockPipBoundsState.hasUserResizedPip()).thenReturn(true);
+
+ mPipController.saveReentryState(bounds);
+
+ verify(mMockPipBoundsState).saveReentryState(new Size(30, 30), 1.0f);
+ }
}
diff --git a/libs/hwui/Android.bp b/libs/hwui/Android.bp
index 1ff1978044b9..0533aa6ad45d 100644
--- a/libs/hwui/Android.bp
+++ b/libs/hwui/Android.bp
@@ -672,6 +672,7 @@ cc_benchmark {
srcs: [
"tests/microbench/main.cpp",
+ "tests/microbench/CanvasOpBench.cpp",
"tests/microbench/DisplayListCanvasBench.cpp",
"tests/microbench/LinearAllocatorBench.cpp",
"tests/microbench/PathParserBench.cpp",
diff --git a/libs/hwui/DisplayList.h b/libs/hwui/DisplayList.h
index dc63e5db4a70..dd2476313b19 100644
--- a/libs/hwui/DisplayList.h
+++ b/libs/hwui/DisplayList.h
@@ -16,14 +16,15 @@
#pragma once
-#include "pipeline/skia/SkiaDisplayList.h"
-
namespace android {
namespace uirenderer {
namespace VectorDrawable {
class Tree;
};
+namespace skiapipeline {
+class SkiaDisplayList;
+}
typedef uirenderer::VectorDrawable::Tree VectorDrawableRoot;
/**
diff --git a/libs/hwui/RenderNode.cpp b/libs/hwui/RenderNode.cpp
index 31e45558139d..74c70c8969f2 100644
--- a/libs/hwui/RenderNode.cpp
+++ b/libs/hwui/RenderNode.cpp
@@ -380,7 +380,7 @@ void RenderNode::deleteDisplayList(TreeObserver& observer, TreeInfo* info) {
if (mDisplayList) {
mDisplayList->updateChildren(
[&observer, info](RenderNode* child) { child->decParentRefCount(observer, info); });
- if (!mDisplayList->reuseDisplayList(this, info ? &info->canvasContext : nullptr)) {
+ if (!mDisplayList->reuseDisplayList(this)) {
delete mDisplayList;
}
}
diff --git a/libs/hwui/canvas/CanvasFrontend.cpp b/libs/hwui/canvas/CanvasFrontend.cpp
index 2c839b0ffc15..8f261c83b8d3 100644
--- a/libs/hwui/canvas/CanvasFrontend.cpp
+++ b/libs/hwui/canvas/CanvasFrontend.cpp
@@ -21,7 +21,14 @@
namespace android::uirenderer {
CanvasStateHelper::CanvasStateHelper(int width, int height) {
+ resetState(width, height);
+}
+
+void CanvasStateHelper::resetState(int width, int height) {
mInitialBounds = SkIRect::MakeWH(width, height);
+ mSaveStack.clear();
+ mClipStack.clear();
+ mTransformStack.clear();
mSaveStack.emplace_back();
mClipStack.emplace_back().setRect(mInitialBounds);
mTransformStack.emplace_back();
diff --git a/libs/hwui/canvas/CanvasFrontend.h b/libs/hwui/canvas/CanvasFrontend.h
index 5fccccb0bb43..d749d2f2596b 100644
--- a/libs/hwui/canvas/CanvasFrontend.h
+++ b/libs/hwui/canvas/CanvasFrontend.h
@@ -57,9 +57,7 @@ protected:
}
bool internalSave(SaveEntry saveEntry);
- bool internalSave(SaveFlags::Flags flags) {
- return internalSave(flagsToSaveEntry(flags));
- }
+
void internalSaveLayer(const SkCanvas::SaveLayerRec& layerRec) {
internalSave({
.clip = true,
@@ -90,6 +88,8 @@ protected:
return mClipStack[mCurrentClipIndex];
}
+ void resetState(int width, int height);
+
public:
int saveCount() const { return mSaveStack.size(); }
@@ -186,14 +186,26 @@ public:
submit(std::move(op));
}
- const CanvasOpReceiver& receiver() const { return mReceiver; }
+ const CanvasOpReceiver& receiver() const { return *mReceiver; }
+
+ CanvasOpReceiver finish() {
+ auto ret = std::move(mReceiver.value());
+ mReceiver.reset();
+ return std::move(ret);
+ }
+
+ template<class... Args>
+ void reset(int newWidth, int newHeight, Args&&... args) {
+ resetState(newWidth, newHeight);
+ mReceiver.emplace(std::forward<Args>(args)...);
+ }
private:
- CanvasOpReceiver mReceiver;
+ std::optional<CanvasOpReceiver> mReceiver;
template <CanvasOpType T>
void submit(CanvasOp<T>&& op) {
- mReceiver.push_container(CanvasOpContainer(std::move(op), transform()));
+ mReceiver->push_container(CanvasOpContainer(std::move(op), transform()));
}
};
diff --git a/libs/hwui/canvas/CanvasOps.h b/libs/hwui/canvas/CanvasOps.h
index 242dbdb27362..62c26c7b6f6a 100644
--- a/libs/hwui/canvas/CanvasOps.h
+++ b/libs/hwui/canvas/CanvasOps.h
@@ -310,7 +310,7 @@ struct CanvasOp<CanvasOpType::DrawVertices> {
template<>
struct CanvasOp<CanvasOpType::DrawImage> {
- CanvasOp<CanvasOpType::DrawImageRect>(
+ CanvasOp(
const sk_sp<Bitmap>& bitmap,
float left,
float top,
@@ -336,7 +336,7 @@ struct CanvasOp<CanvasOpType::DrawImage> {
template<>
struct CanvasOp<CanvasOpType::DrawImageRect> {
- CanvasOp<CanvasOpType::DrawImageRect>(
+ CanvasOp(
const sk_sp<Bitmap>& bitmap,
SkRect src,
SkRect dst,
@@ -367,7 +367,7 @@ struct CanvasOp<CanvasOpType::DrawImageRect> {
template<>
struct CanvasOp<CanvasOpType::DrawImageLattice> {
- CanvasOp<CanvasOpType::DrawImageLattice>(
+ CanvasOp(
const sk_sp<Bitmap>& bitmap,
SkRect dst,
SkCanvas::Lattice lattice,
diff --git a/libs/hwui/canvas/OpBuffer.h b/libs/hwui/canvas/OpBuffer.h
index 98e385f37a6e..6dc29d9a4bfe 100644
--- a/libs/hwui/canvas/OpBuffer.h
+++ b/libs/hwui/canvas/OpBuffer.h
@@ -60,9 +60,8 @@ class OpBuffer {
return (size + (Alignment - 1)) & -Alignment;
}
- static constexpr auto STARTING_SIZE = PadAlign(sizeof(BufferHeader));
-
public:
+ static constexpr auto STARTING_SIZE = PadAlign(sizeof(BufferHeader));
using ItemHeader = OpBufferItemHeader<ItemTypes>;
OpBuffer() = default;
diff --git a/libs/hwui/hwui/Canvas.h b/libs/hwui/hwui/Canvas.h
index 4d67166dd8d2..11fa3223a9c8 100644
--- a/libs/hwui/hwui/Canvas.h
+++ b/libs/hwui/hwui/Canvas.h
@@ -21,6 +21,7 @@
#include <SaveFlags.h>
#include <androidfw/ResourceTypes.h>
+#include "DisplayList.h"
#include "Properties.h"
#include "utils/Macros.h"
@@ -47,18 +48,6 @@ class CanvasPropertyPaint;
class CanvasPropertyPrimitive;
class DeferredLayerUpdater;
class RenderNode;
-
-namespace skiapipeline {
-class SkiaDisplayList;
-}
-
-/**
- * Data structure that holds the list of commands used in display list stream
- */
-using DisplayList = skiapipeline::SkiaDisplayList;
-}
-
-namespace uirenderer {
namespace VectorDrawable {
class Tree;
}
diff --git a/libs/hwui/jni/Typeface.cpp b/libs/hwui/jni/Typeface.cpp
index a2964d6627a1..10c80774fd16 100644
--- a/libs/hwui/jni/Typeface.cpp
+++ b/libs/hwui/jni/Typeface.cpp
@@ -14,6 +14,7 @@
* limitations under the License.
*/
+#define ATRACE_TAG ATRACE_TAG_VIEW
#include "FontUtils.h"
#include "GraphicsJNI.h"
#include "fonts/Font.h"
@@ -25,8 +26,13 @@
#include <minikin/FontCollection.h>
#include <minikin/FontFamily.h>
#include <minikin/SystemFonts.h>
+#include <utils/TraceUtils.h>
+
+#include <mutex>
+#include <unordered_map>
using namespace android;
+using android::uirenderer::TraceUtils;
static inline Typeface* toTypeface(jlong ptr) {
return reinterpret_cast<Typeface*>(ptr);
@@ -149,6 +155,20 @@ static void Typeface_registerGenericFamily(JNIEnv *env, jobject, jstring familyN
toTypeface(ptr)->fFontCollection);
}
+static sk_sp<SkData> makeSkDataCached(const std::string& path) {
+ // We don't clear cache as Typeface objects created by Typeface_readTypefaces() will be stored
+ // in a static field and will not be garbage collected.
+ static std::unordered_map<std::string, sk_sp<SkData>> cache;
+ static std::mutex mutex;
+ ALOG_ASSERT(!path.empty());
+ std::lock_guard lock{mutex};
+ sk_sp<SkData>& entry = cache[path];
+ if (entry.get() == nullptr) {
+ entry = SkData::MakeFromFileName(path.c_str());
+ }
+ return entry;
+}
+
static std::function<std::shared_ptr<minikin::MinikinFont>()> readMinikinFontSkia(
minikin::BufferReader* reader) {
std::string_view fontPath = reader->readString();
@@ -158,8 +178,9 @@ static std::function<std::shared_ptr<minikin::MinikinFont>()> readMinikinFontSki
std::tie(axesPtr, axesCount) = reader->readArray<minikin::FontVariation>();
return [fontPath, fontIndex, axesPtr, axesCount]() -> std::shared_ptr<minikin::MinikinFont> {
std::string path(fontPath.data(), fontPath.size());
- sk_sp<SkData> data = SkData::MakeFromFileName(path.c_str());
- if (data == nullptr) {
+ ATRACE_FORMAT("Loading font %s", path.c_str());
+ sk_sp<SkData> data = makeSkDataCached(path);
+ if (data.get() == nullptr) {
// This may happen if:
// 1. When the process failed to open the file (e.g. invalid path or permission).
// 2. When the process failed to map the file (e.g. hitting max_map_count limit).
diff --git a/libs/hwui/pipeline/skia/SkiaDisplayList.cpp b/libs/hwui/pipeline/skia/SkiaDisplayList.cpp
index 158c3493a90c..c63f5d349311 100644
--- a/libs/hwui/pipeline/skia/SkiaDisplayList.cpp
+++ b/libs/hwui/pipeline/skia/SkiaDisplayList.cpp
@@ -47,7 +47,7 @@ void SkiaDisplayList::syncContents(const WebViewSyncData& data) {
}
}
-bool SkiaDisplayList::reuseDisplayList(RenderNode* node, renderthread::CanvasContext* context) {
+bool SkiaDisplayList::reuseDisplayList(RenderNode* node) {
reset();
node->attachAvailableList(this);
return true;
diff --git a/libs/hwui/pipeline/skia/SkiaDisplayList.h b/libs/hwui/pipeline/skia/SkiaDisplayList.h
index cdd00db9afdc..f2f19ba2975e 100644
--- a/libs/hwui/pipeline/skia/SkiaDisplayList.h
+++ b/libs/hwui/pipeline/skia/SkiaDisplayList.h
@@ -98,7 +98,7 @@ public:
*
* @return true if the displayList will be reused and therefore should not be deleted
*/
- bool reuseDisplayList(RenderNode* node, renderthread::CanvasContext* context);
+ bool reuseDisplayList(RenderNode* node);
/**
* ONLY to be called by RenderNode::syncDisplayList so that we can notify any
diff --git a/libs/hwui/tests/microbench/CanvasOpBench.cpp b/libs/hwui/tests/microbench/CanvasOpBench.cpp
new file mode 100644
index 000000000000..ef5749e6b79b
--- /dev/null
+++ b/libs/hwui/tests/microbench/CanvasOpBench.cpp
@@ -0,0 +1,96 @@
+/*
+ * Copyright (C) 2015 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.
+ */
+
+#include <benchmark/benchmark.h>
+
+#include "DisplayList.h"
+#include "hwui/Paint.h"
+#include "canvas/CanvasOpBuffer.h"
+#include "canvas/CanvasFrontend.h"
+#include "tests/common/TestUtils.h"
+
+using namespace android;
+using namespace android::uirenderer;
+
+void BM_CanvasOpBuffer_alloc(benchmark::State& benchState) {
+ while (benchState.KeepRunning()) {
+ auto displayList = new CanvasOpBuffer();
+ benchmark::DoNotOptimize(displayList);
+ delete displayList;
+ }
+}
+BENCHMARK(BM_CanvasOpBuffer_alloc);
+
+void BM_CanvasOpBuffer_record_saverestore(benchmark::State& benchState) {
+ CanvasFrontend<CanvasOpBuffer> canvas(100, 100);
+ while (benchState.KeepRunning()) {
+ canvas.reset(100, 100);
+ canvas.save(SaveFlags::MatrixClip);
+ canvas.save(SaveFlags::MatrixClip);
+ benchmark::DoNotOptimize(&canvas);
+ canvas.restore();
+ canvas.restore();
+ canvas.finish();
+ }
+}
+BENCHMARK(BM_CanvasOpBuffer_record_saverestore);
+
+void BM_CanvasOpBuffer_record_saverestoreWithReuse(benchmark::State& benchState) {
+ CanvasFrontend<CanvasOpBuffer> canvas(100, 100);
+
+ while (benchState.KeepRunning()) {
+ canvas.reset(100, 100);
+ canvas.save(SaveFlags::MatrixClip);
+ canvas.save(SaveFlags::MatrixClip);
+ benchmark::DoNotOptimize(&canvas);
+ canvas.restore();
+ canvas.restore();
+ }
+}
+BENCHMARK(BM_CanvasOpBuffer_record_saverestoreWithReuse);
+
+void BM_CanvasOpBuffer_record_simpleBitmapView(benchmark::State& benchState) {
+ CanvasFrontend<CanvasOpBuffer> canvas(100, 100);
+
+ Paint rectPaint;
+ sk_sp<Bitmap> iconBitmap(TestUtils::createBitmap(80, 80));
+
+ while (benchState.KeepRunning()) {
+ canvas.reset(100, 100);
+ {
+ canvas.save(SaveFlags::MatrixClip);
+ canvas.draw(CanvasOp<CanvasOpType::DrawRect> {
+ .rect = SkRect::MakeWH(100, 100),
+ .paint = rectPaint,
+ });
+ canvas.restore();
+ }
+ {
+ canvas.save(SaveFlags::MatrixClip);
+ canvas.translate(10, 10);
+ canvas.draw(CanvasOp<CanvasOpType::DrawImage> {
+ iconBitmap,
+ 0,
+ 0,
+ SkPaint{}
+ });
+ canvas.restore();
+ }
+ benchmark::DoNotOptimize(&canvas);
+ canvas.finish();
+ }
+}
+BENCHMARK(BM_CanvasOpBuffer_record_simpleBitmapView);
diff --git a/libs/hwui/tests/microbench/RenderNodeBench.cpp b/libs/hwui/tests/microbench/RenderNodeBench.cpp
index 206dcd58d785..011939a6e4b2 100644
--- a/libs/hwui/tests/microbench/RenderNodeBench.cpp
+++ b/libs/hwui/tests/microbench/RenderNodeBench.cpp
@@ -30,3 +30,29 @@ void BM_RenderNode_create(benchmark::State& state) {
}
}
BENCHMARK(BM_RenderNode_create);
+
+void BM_RenderNode_recordSimple(benchmark::State& state) {
+ sp<RenderNode> node = new RenderNode();
+ std::unique_ptr<Canvas> canvas(Canvas::create_recording_canvas(100, 100));
+ delete canvas->finishRecording();
+
+ while (state.KeepRunning()) {
+ canvas->resetRecording(100, 100, node.get());
+ canvas->drawColor(0x00000000, SkBlendMode::kSrcOver);
+ node->setStagingDisplayList(canvas->finishRecording());
+ }
+}
+BENCHMARK(BM_RenderNode_recordSimple);
+
+void BM_RenderNode_recordSimpleWithReuse(benchmark::State& state) {
+ sp<RenderNode> node = new RenderNode();
+ std::unique_ptr<Canvas> canvas(Canvas::create_recording_canvas(100, 100));
+ delete canvas->finishRecording();
+
+ while (state.KeepRunning()) {
+ canvas->resetRecording(100, 100, node.get());
+ canvas->drawColor(0x00000000, SkBlendMode::kSrcOver);
+ canvas->finishRecording()->reuseDisplayList(node.get());
+ }
+}
+BENCHMARK(BM_RenderNode_recordSimpleWithReuse); \ No newline at end of file
diff --git a/libs/hwui/tests/unit/SkiaDisplayListTests.cpp b/libs/hwui/tests/unit/SkiaDisplayListTests.cpp
index 2d34b0980546..c63f008c4aed 100644
--- a/libs/hwui/tests/unit/SkiaDisplayListTests.cpp
+++ b/libs/hwui/tests/unit/SkiaDisplayListTests.cpp
@@ -84,7 +84,7 @@ TEST(SkiaDisplayList, reuseDisplayList) {
// attach a displayList for reuse
SkiaDisplayList skiaDL;
- ASSERT_TRUE(skiaDL.reuseDisplayList(renderNode.get(), nullptr));
+ ASSERT_TRUE(skiaDL.reuseDisplayList(renderNode.get()));
// detach the list that you just attempted to reuse
availableList = renderNode->detachAvailableList();
diff --git a/location/java/android/location/Location.java b/location/java/android/location/Location.java
index 47ecbd80a07f..a7e9a0de538a 100644
--- a/location/java/android/location/Location.java
+++ b/location/java/android/location/Location.java
@@ -1049,11 +1049,7 @@ public class Location implements Parcelable {
* <ul>
* <li> satellites - the number of satellites used to derive the fix
* </ul>
- *
- * @deprecated Do not use. For GNSS related information, prefer listening for GNSS status
- * information via {@link LocationManager}.
*/
- @Deprecated
public Bundle getExtras() {
return mExtras;
}
@@ -1063,10 +1059,7 @@ public class Location implements Parcelable {
*
* <p>Note this stores a copy of the given extras, so any changes to extras after calling this
* method won't be reflected in the location bundle.
- *
- * @deprecated Do not use.
*/
- @Deprecated
public void setExtras(@Nullable Bundle extras) {
mExtras = (extras == null) ? null : new Bundle(extras);
}
diff --git a/location/java/android/location/LocationManager.java b/location/java/android/location/LocationManager.java
index 7085a755990f..914beaff225e 100644
--- a/location/java/android/location/LocationManager.java
+++ b/location/java/android/location/LocationManager.java
@@ -159,21 +159,21 @@ public class LocationManager {
public static final long BLOCK_GPS_STATUS_USAGE = 144027538L;
/**
- * Name of the network location provider.
+ * Standard name of the network location provider.
*
- * <p>This provider determines location based on nearby of cell tower and WiFi access points.
- * Results are retrieved by means of a network lookup.
+ * <p>If present, this provider determines location based on nearby of cell tower and WiFi
+ * access points. Operation of this provider may require a data connection.
*/
public static final String NETWORK_PROVIDER = "network";
/**
- * Name of the GNSS location provider.
+ * Standard name of the GNSS location provider.
*
- * <p>This provider determines location using GNSS satellites. Depending on conditions, this
- * provider may take a while to return a location fix. Requires the
- * {@link android.Manifest.permission#ACCESS_FINE_LOCATION} permission.
+ * <p>If present, this provider determines location using GNSS satellites. The responsiveness
+ * and accuracy of location fixes may depend on GNSS signal conditions.
*
- * <p>The extras Bundle for the GPS location provider can contain the following key/value pairs:
+ * <p>The extras Bundle for locations derived by this location provider may contain the
+ * following key/value pairs:
* <ul>
* <li> satellites - the number of satellites used to derive the fix
* </ul>
@@ -181,29 +181,22 @@ public class LocationManager {
public static final String GPS_PROVIDER = "gps";
/**
- * A special location provider for receiving locations without actually initiating a location
- * fix.
+ * A special location provider for receiving locations without actively initiating a location
+ * fix. This location provider is always present.
*
* <p>This provider can be used to passively receive location updates when other applications or
* services request them without actually requesting the locations yourself. This provider will
- * only return locations generated by other providers. You can query the
- * {@link Location#getProvider()} method to determine the actual provider that supplied the
- * location update. Requires the {@link android.Manifest.permission#ACCESS_FINE_LOCATION}
- * permission, although there is no guarantee of fine locations.
+ * only return locations generated by other providers.
*/
public static final String PASSIVE_PROVIDER = "passive";
/**
- * The fused location provider.
- *
- * <p>This provider may combine inputs from several location sources to provide the
- * best possible location fix. It is implicitly used for all API's that involve the
- * {@link LocationRequest} object.
+ * Standard name of the fused location provider.
*
- * @hide
+ * <p>If present, this provider may combine inputs from several other location providers to
+ * provide the best possible location fix. It is implicitly used for all requestLocationUpdates
+ * APIs that involve a {@link Criteria}.
*/
- @SystemApi
- @TestApi
public static final String FUSED_PROVIDER = "fused";
/**
@@ -918,6 +911,9 @@ public class LocationManager {
/**
* Register for a single location update using a Criteria and a callback.
*
+ * <p>Note: Since Android KitKat, Criteria requests will always result in using the
+ * {@link #FUSED_PROVIDER}.
+ *
* <p>See {@link #requestLocationUpdates(long, float, Criteria, PendingIntent)} for more detail
* on how to use this method.
*
@@ -985,6 +981,9 @@ public class LocationManager {
/**
* Register for a single location update using a Criteria and pending intent.
*
+ * <p>Note: Since Android KitKat, Criteria requests will always result in using the
+ * {@link #FUSED_PROVIDER}.
+ *
* <p>See {@link #requestLocationUpdates(long, float, Criteria, PendingIntent)} for more detail
* on how to use this method.
*
@@ -1113,6 +1112,9 @@ public class LocationManager {
* Register for location updates using a provider selected through the given Criteria, and a
* callback on the specified {@link Looper}.
*
+ * <p>Note: Since Android KitKat, Criteria requests will always result in using the
+ * {@link #FUSED_PROVIDER}.
+ *
* <p>See {@link #requestLocationUpdates(String, LocationRequest, Executor, LocationListener)}
* for more detail on how this method works.
*
@@ -1124,7 +1126,12 @@ public class LocationManager {
* @throws IllegalArgumentException if criteria is null
* @throws IllegalArgumentException if listener is null
* @throws SecurityException if no suitable permission is present
+ *
+ * @deprecated Use
+ * {@link #requestLocationUpdates(String, long, float, LocationListener, Looper)} instead to
+ * explicitly select a provider.
*/
+ @Deprecated
@RequiresPermission(anyOf = {ACCESS_COARSE_LOCATION, ACCESS_FINE_LOCATION})
public void requestLocationUpdates(long minTimeMs, float minDistanceM,
@NonNull Criteria criteria, @NonNull LocationListener listener,
@@ -1138,6 +1145,9 @@ public class LocationManager {
* Register for location updates using a provider selected through the given Criteria, and a
* callback on the specified {@link Executor}.
*
+ * <p>Note: Since Android KitKat, Criteria requests will always result in using the
+ * {@link #FUSED_PROVIDER}.
+ *
* <p>See {@link #requestLocationUpdates(String, LocationRequest, Executor, LocationListener)}
* for more detail on how this method works.
*
@@ -1151,7 +1161,12 @@ public class LocationManager {
* @throws IllegalArgumentException if executor is null
* @throws IllegalArgumentException if listener is null
* @throws SecurityException if no suitable permission is present
+ *
+ * @deprecated Use
+ * {@link #requestLocationUpdates(String, long, float, Executor, LocationListener)} instead to
+ * explicitly select a provider.
*/
+ @Deprecated
@RequiresPermission(anyOf = {ACCESS_COARSE_LOCATION, ACCESS_FINE_LOCATION})
public void requestLocationUpdates(
long minTimeMs,
@@ -1199,6 +1214,9 @@ public class LocationManager {
* Register for location updates using a provider selected through the given Criteria, and
* callbacks delivered via the provided {@link PendingIntent}.
*
+ * <p>Note: Since Android KitKat, Criteria requests will always result in using the
+ * {@link #FUSED_PROVIDER}.
+ *
* <p>See {@link #requestLocationUpdates(String, long, float, PendingIntent)} for more detail on
* how this method works.
*
@@ -1210,7 +1228,11 @@ public class LocationManager {
* @throws IllegalArgumentException if provider is null or doesn't exist
* @throws IllegalArgumentException if pendingIntent is null
* @throws SecurityException if no suitable permission is present
+ *
+ * @deprecated Use {@link #requestLocationUpdates(String, long, float, PendingIntent)} instead
+ * to explicitly select a provider.
*/
+ @Deprecated
@RequiresPermission(anyOf = {ACCESS_COARSE_LOCATION, ACCESS_FINE_LOCATION})
public void requestLocationUpdates(long minTimeMs, float minDistanceM,
@NonNull Criteria criteria, @NonNull PendingIntent pendingIntent) {
@@ -1594,9 +1616,8 @@ public class LocationManager {
}
/**
- * Returns a list of the names of all known location providers. All providers are returned,
- * including ones that are not permitted to be accessed by the calling activity or are currently
- * disabled.
+ * Returns a list of the names of all available location providers. All providers are returned,
+ * including those that are currently disabled.
*
* @return list of provider names
*/
@@ -1609,8 +1630,8 @@ public class LocationManager {
}
/**
- * Returns a list of the names of location providers. Only providers that the caller has
- * permission to access will be returned.
+ * Returns a list of the names of available location providers. If {@code enabledOnly} is false,
+ * this is functionally the same as {@link #getAllProviders()}.
*
* @param enabledOnly if true then only enabled providers are included
* @return list of provider names
@@ -1624,8 +1645,7 @@ public class LocationManager {
}
/**
- * Returns a list of the names of providers that satisfy the given criteria. Only providers that
- * the caller has permission to access will be returned.
+ * Returns a list of the names of available location providers that satisfy the given criteria.
*
* @param criteria the criteria that providers must match
* @param enabledOnly if true then only enabled providers are included
diff --git a/location/java/android/location/OWNERS b/location/java/android/location/OWNERS
index 383321bc3d69..60321448a58a 100644
--- a/location/java/android/location/OWNERS
+++ b/location/java/android/location/OWNERS
@@ -1,6 +1,6 @@
# Bug component: 880425
-mstogaitis@google.com
+sooniln@google.com
wyattriley@google.com
-etn@google.com
+yuhany@google.com
weiwa@google.com
diff --git a/media/OWNERS b/media/OWNERS
index b2875e7f067c..e74149019b11 100644
--- a/media/OWNERS
+++ b/media/OWNERS
@@ -10,7 +10,7 @@ insun@google.com
jaewan@google.com
jinpark@google.com
jmtrivi@google.com
-jsharkey@google.com
+jsharkey@android.com
klhyun@google.com
lajos@google.com
marcone@google.com
diff --git a/media/java/android/media/AudioManager.java b/media/java/android/media/AudioManager.java
index c67d90a5ea0f..3bd68d893521 100644
--- a/media/java/android/media/AudioManager.java
+++ b/media/java/android/media/AudioManager.java
@@ -2319,7 +2319,55 @@ public class AudioManager {
if (attributes == null) {
throw new NullPointerException("Illegal null AudioAttributes");
}
- return AudioSystem.isOffloadSupported(format, attributes);
+ return AudioSystem.getOffloadSupport(format, attributes) != PLAYBACK_OFFLOAD_NOT_SUPPORTED;
+ }
+
+ /** Return value for {@link #getPlaybackOffloadSupport(AudioFormat, AudioAttributes)}:
+ offload playback not supported */
+ public static final int PLAYBACK_OFFLOAD_NOT_SUPPORTED = AudioSystem.OFFLOAD_NOT_SUPPORTED;
+ /** Return value for {@link #getPlaybackOffloadSupport(AudioFormat, AudioAttributes)}:
+ offload playback supported */
+ public static final int PLAYBACK_OFFLOAD_SUPPORTED = AudioSystem.OFFLOAD_SUPPORTED;
+ /** Return value for {@link #getPlaybackOffloadSupport(AudioFormat, AudioAttributes)}:
+ offload playback supported with gapless transitions */
+ public static final int PLAYBACK_OFFLOAD_GAPLESS_SUPPORTED =
+ AudioSystem.OFFLOAD_GAPLESS_SUPPORTED;
+
+ /** @hide */
+ @IntDef(flag = false, prefix = "PLAYBACK_OFFLOAD_", value = {
+ PLAYBACK_OFFLOAD_NOT_SUPPORTED,
+ PLAYBACK_OFFLOAD_SUPPORTED,
+ PLAYBACK_OFFLOAD_GAPLESS_SUPPORTED }
+ )
+ @Retention(RetentionPolicy.SOURCE)
+ public @interface AudioOffloadMode {}
+
+ /**
+ * Returns whether offloaded playback of an audio format is supported on the device or not and
+ * when supported whether gapless transitions are possible or not.
+ * <p>Offloaded playback is the feature where the decoding and playback of an audio stream
+ * is not competing with other software resources. In general, it is supported by dedicated
+ * hardware, such as audio DSPs.
+ * <p>Note that this query only provides information about the support of an audio format,
+ * it does not indicate whether the resources necessary for the offloaded playback are
+ * available at that instant.
+ * @param format the audio format (codec, sample rate, channels) being checked.
+ * @param attributes the {@link AudioAttributes} to be used for playback
+ * @return {@link #PLAYBACK_OFFLOAD_NOT_SUPPORTED} if offload playback if not supported,
+ * {@link #PLAYBACK_OFFLOAD_SUPPORTED} if offload playback is supported or
+ * {@link #PLAYBACK_OFFLOAD_GAPLESS_SUPPORTED} if gapless transitions are
+ * also supported.
+ */
+ @AudioOffloadMode
+ public static int getPlaybackOffloadSupport(@NonNull AudioFormat format,
+ @NonNull AudioAttributes attributes) {
+ if (format == null) {
+ throw new NullPointerException("Illegal null AudioFormat");
+ }
+ if (attributes == null) {
+ throw new NullPointerException("Illegal null AudioAttributes");
+ }
+ return AudioSystem.getOffloadSupport(format, attributes);
}
//====================================================================
diff --git a/media/java/android/media/AudioSystem.java b/media/java/android/media/AudioSystem.java
index bd27f6d068bc..8987a713e505 100644
--- a/media/java/android/media/AudioSystem.java
+++ b/media/java/android/media/AudioSystem.java
@@ -1639,13 +1639,22 @@ public class AudioSystem
*/
public static native int setAllowedCapturePolicy(int uid, int flags);
- static boolean isOffloadSupported(@NonNull AudioFormat format, @NonNull AudioAttributes attr) {
- return native_is_offload_supported(format.getEncoding(), format.getSampleRate(),
+ /**
+ * @hide
+ * Compressed audio offload decoding modes supported by audio HAL implementation.
+ * Keep in sync with system/media/include/media/audio.h.
+ */
+ public static final int OFFLOAD_NOT_SUPPORTED = 0;
+ public static final int OFFLOAD_SUPPORTED = 1;
+ public static final int OFFLOAD_GAPLESS_SUPPORTED = 2;
+
+ static int getOffloadSupport(@NonNull AudioFormat format, @NonNull AudioAttributes attr) {
+ return native_get_offload_support(format.getEncoding(), format.getSampleRate(),
format.getChannelMask(), format.getChannelIndexMask(),
attr.getVolumeControlStream());
}
- private static native boolean native_is_offload_supported(int encoding, int sampleRate,
+ private static native int native_get_offload_support(int encoding, int sampleRate,
int channelMask, int channelIndexMask, int streamType);
/** @hide */
diff --git a/media/java/android/media/AudioTrack.java b/media/java/android/media/AudioTrack.java
index e8c62067580f..e3b6fba18eb0 100644
--- a/media/java/android/media/AudioTrack.java
+++ b/media/java/android/media/AudioTrack.java
@@ -1256,7 +1256,8 @@ public class AudioTrack extends PlayerBase
throw new UnsupportedOperationException(
"Offload and low latency modes are incompatible");
}
- if (!AudioSystem.isOffloadSupported(mFormat, mAttributes)) {
+ if (AudioSystem.getOffloadSupport(mFormat, mAttributes)
+ == AudioSystem.OFFLOAD_NOT_SUPPORTED) {
throw new UnsupportedOperationException(
"Cannot create AudioTrack, offload format / attributes not supported");
}
diff --git a/media/java/android/media/IMediaRouterService.aidl b/media/java/android/media/IMediaRouterService.aidl
index 068f9689d06f..4b8a8adade1f 100644
--- a/media/java/android/media/IMediaRouterService.aidl
+++ b/media/java/android/media/IMediaRouterService.aidl
@@ -73,6 +73,8 @@ interface IMediaRouterService {
void unregisterManager(IMediaRouter2Manager manager);
void setRouteVolumeWithManager(IMediaRouter2Manager manager, int requestId,
in MediaRoute2Info route, int volume);
+ void startScan(IMediaRouter2Manager manager);
+ void stopScan(IMediaRouter2Manager manager);
void requestCreateSessionWithManager(IMediaRouter2Manager manager, int requestId,
in RoutingSessionInfo oldSession, in @nullable MediaRoute2Info route);
diff --git a/media/java/android/media/MediaCodecInfo.java b/media/java/android/media/MediaCodecInfo.java
index c2168f12a351..e7e83ebb001f 100644
--- a/media/java/android/media/MediaCodecInfo.java
+++ b/media/java/android/media/MediaCodecInfo.java
@@ -25,6 +25,7 @@ import android.annotation.SuppressLint;
import android.annotation.TestApi;
import android.compat.annotation.UnsupportedAppUsage;
import android.os.Build;
+import android.os.Process;
import android.os.SystemProperties;
import android.util.Log;
import android.util.Pair;
@@ -188,13 +189,14 @@ public final class MediaCodecInfo {
// COMMON CONSTANTS
private static final Range<Integer> POSITIVE_INTEGERS =
- Range.create(1, Integer.MAX_VALUE);
+ Range.create(1, Integer.MAX_VALUE);
private static final Range<Long> POSITIVE_LONGS =
- Range.create(1l, Long.MAX_VALUE);
+ Range.create(1L, Long.MAX_VALUE);
private static final Range<Rational> POSITIVE_RATIONALS =
- Range.create(new Rational(1, Integer.MAX_VALUE),
- new Rational(Integer.MAX_VALUE, 1));
- private static final Range<Integer> SIZE_RANGE = Range.create(1, 32768);
+ Range.create(new Rational(1, Integer.MAX_VALUE),
+ new Rational(Integer.MAX_VALUE, 1));
+ private static final Range<Integer> SIZE_RANGE =
+ Process.is64Bit() ? Range.create(1, 32768) : Range.create(1, 4096);
private static final Range<Integer> FRAME_RATE_RANGE = Range.create(0, 960);
private static final Range<Integer> BITRATE_RANGE = Range.create(0, 500000000);
private static final int DEFAULT_MAX_SUPPORTED_INSTANCES = 32;
@@ -1399,6 +1401,9 @@ public final class MediaCodecInfo {
/**
* Returns the range of supported video widths.
+ * <p class=note>
+ * 32-bit processes will not support resolutions larger than 4096x4096 due to
+ * the limited address space.
*/
public Range<Integer> getSupportedWidths() {
return mWidthRange;
@@ -1406,6 +1411,9 @@ public final class MediaCodecInfo {
/**
* Returns the range of supported video heights.
+ * <p class=note>
+ * 32-bit processes will not support resolutions larger than 4096x4096 due to
+ * the limited address space.
*/
public Range<Integer> getSupportedHeights() {
return mHeightRange;
@@ -1857,6 +1865,10 @@ public final class MediaCodecInfo {
&& aligned.mMaxMacroBlockRate >= otherAligned.mMaxMacroBlockRate);
}
+ /* package private */ boolean isEqualDimension(@NonNull PerformancePoint other) {
+ return mWidth == other.mWidth && mHeight == other.mHeight;
+ }
+
private @NonNull Size getCommonBlockSize(@NonNull PerformancePoint other) {
return new Size(
Math.max(mBlockSize.getWidth(), other.mBlockSize.getWidth()) * 16,
@@ -1997,6 +2009,9 @@ public final class MediaCodecInfo {
* Performance points assume a single active codec. For use cases where multiple
* codecs are active, should use that highest pixel count, and add the frame rates of
* each individual codec.
+ * <p class=note>
+ * Supported resolution could be further restricted for 32-bit processes due to
+ * the limited virtual memory space.
*/
@Nullable
public List<PerformancePoint> getSupportedPerformancePoints() {
@@ -2164,6 +2179,12 @@ public final class MediaCodecInfo {
if (size == null || size.getWidth() * size.getHeight() <= 0) {
continue;
}
+ if (size.getWidth() > SIZE_RANGE.getUpper()
+ || size.getHeight() > SIZE_RANGE.getUpper()) {
+ size = new Size(
+ Math.min(size.getWidth(), SIZE_RANGE.getUpper()),
+ Math.min(size.getHeight(), SIZE_RANGE.getUpper()));
+ }
Range<Long> range = Utils.parseLongRange(map.get(key), null);
if (range == null || range.getLower() < 0 || range.getUpper() < 0) {
continue;
@@ -2193,6 +2214,29 @@ public final class MediaCodecInfo {
(a.getMaxMacroBlockRate() < b.getMaxMacroBlockRate() ? -1 : 1) :
(a.getMaxFrameRate() != b.getMaxFrameRate()) ?
(a.getMaxFrameRate() < b.getMaxFrameRate() ? -1 : 1) : 0));
+
+ // remove redundant points
+ for (int i = 1; i < ret.size(); ++i) {
+ PerformancePoint a = ret.get(i);
+ for (int j = 0; j < i; ++j) {
+ PerformancePoint b = ret.get(j);
+ if (b.isEqualDimension(a) && b.covers(a)) {
+ ret.set(i, null);
+ break;
+ }
+ }
+ }
+ int newSize = 0;
+ for (int i = 0; i < ret.size(); ++i) {
+ PerformancePoint a = ret.get(i);
+ if (a == null) {
+ continue;
+ }
+ ret.set(newSize, a);
+ ++newSize;
+ }
+ ret.setSize(newSize);
+
return Collections.unmodifiableList(ret);
}
diff --git a/media/java/android/media/MediaRouter2Manager.java b/media/java/android/media/MediaRouter2Manager.java
index 4b09a5f19fb0..68237de2ca98 100644
--- a/media/java/android/media/MediaRouter2Manager.java
+++ b/media/java/android/media/MediaRouter2Manager.java
@@ -147,6 +147,36 @@ public final class MediaRouter2Manager {
}
/**
+ * Starts scanning remote routes.
+ * @see #stopScan(String)
+ */
+ public void startScan() {
+ Client client = getOrCreateClient();
+ if (client != null) {
+ try {
+ mMediaRouterService.startScan(client);
+ } catch (RemoteException ex) {
+ Log.e(TAG, "Unable to get sessions. Service probably died.", ex);
+ }
+ }
+ }
+
+ /**
+ * Stops scanning remote routes to reduce resource consumption.
+ * @see #startScan(String)
+ */
+ public void stopScan() {
+ Client client = getOrCreateClient();
+ if (client != null) {
+ try {
+ mMediaRouterService.stopScan(client);
+ } catch (RemoteException ex) {
+ Log.e(TAG, "Unable to get sessions. Service probably died.", ex);
+ }
+ }
+ }
+
+ /**
* Gets a {@link android.media.session.MediaController} associated with the
* given routing session.
* If there is no matching media session, {@code null} is returned.
diff --git a/media/java/android/media/RouteDiscoveryPreference.java b/media/java/android/media/RouteDiscoveryPreference.java
index 68f2964dbeb2..2f952474b7f0 100644
--- a/media/java/android/media/RouteDiscoveryPreference.java
+++ b/media/java/android/media/RouteDiscoveryPreference.java
@@ -153,6 +153,7 @@ public final class RouteDiscoveryPreference implements Parcelable {
return false;
}
RouteDiscoveryPreference other = (RouteDiscoveryPreference) o;
+ //TODO: Make this order-free
return Objects.equals(mPreferredFeatures, other.mPreferredFeatures)
&& mShouldPerformActiveScan == other.mShouldPerformActiveScan;
}
diff --git a/media/java/android/media/tv/tuner/Tuner.java b/media/java/android/media/tv/tuner/Tuner.java
index d094c2cd3c63..20f02a46ea63 100644
--- a/media/java/android/media/tv/tuner/Tuner.java
+++ b/media/java/android/media/tv/tuner/Tuner.java
@@ -279,6 +279,7 @@ public class Tuner implements AutoCloseable {
@Nullable
private FrontendInfo mFrontendInfo;
private Integer mFrontendHandle;
+ private Boolean mIsSharedFrontend = false;
private int mFrontendType = FrontendSettings.TYPE_UNDEFINED;
private int mUserId;
private Lnb mLnb;
@@ -441,8 +442,11 @@ public class Tuner implements AutoCloseable {
*/
public void shareFrontendFromTuner(@NonNull Tuner tuner) {
mTunerResourceManager.shareFrontend(mClientId, tuner.mClientId);
- mFrontendHandle = tuner.mFrontendHandle;
- mFrontend = nativeOpenFrontendByHandle(mFrontendHandle);
+ synchronized (mIsSharedFrontend) {
+ mFrontendHandle = tuner.mFrontendHandle;
+ mFrontend = tuner.mFrontend;
+ mIsSharedFrontend = true;
+ }
}
/**
@@ -473,14 +477,19 @@ public class Tuner implements AutoCloseable {
private void releaseAll() {
if (mFrontendHandle != null) {
- int res = nativeCloseFrontend(mFrontendHandle);
- if (res != Tuner.RESULT_SUCCESS) {
- TunerUtils.throwExceptionForResult(res, "failed to close frontend");
+ synchronized (mIsSharedFrontend) {
+ if (!mIsSharedFrontend) {
+ int res = nativeCloseFrontend(mFrontendHandle);
+ if (res != Tuner.RESULT_SUCCESS) {
+ TunerUtils.throwExceptionForResult(res, "failed to close frontend");
+ }
+ }
+ mIsSharedFrontend = false;
}
mTunerResourceManager.releaseFrontend(mFrontendHandle, mClientId);
FrameworkStatsLog
.write(FrameworkStatsLog.TV_TUNER_STATE_CHANGED, mUserId,
- FrameworkStatsLog.TV_TUNER_STATE_CHANGED__STATE__UNKNOWN);
+ FrameworkStatsLog.TV_TUNER_STATE_CHANGED__STATE__UNKNOWN);
mFrontendHandle = null;
mFrontend = null;
}
diff --git a/media/java/android/mtp/OWNERS b/media/java/android/mtp/OWNERS
index e27d06f4825a..1928ba811e7e 100644
--- a/media/java/android/mtp/OWNERS
+++ b/media/java/android/mtp/OWNERS
@@ -1,7 +1,7 @@
set noparent
marcone@google.com
-jsharkey@google.com
+jsharkey@android.com
jameswei@google.com
rmojumder@google.com
diff --git a/media/jni/OWNERS b/media/jni/OWNERS
index e6e4f86505cf..f1b0237d9008 100644
--- a/media/jni/OWNERS
+++ b/media/jni/OWNERS
@@ -1,5 +1,5 @@
# extra for MTP related files
-per-file android_mtp_*.cpp=marcone@google.com,jsharkey@google.com,jameswei@google.com,rmojumder@google.com
+per-file android_mtp_*.cpp=marcone@google.com,jsharkey@android.com,jameswei@google.com,rmojumder@google.com
# extra for TV related files
per-file android_media_tv_*=nchalko@google.com,quxiangfang@google.com
diff --git a/media/jni/android_media_MediaExtractor.cpp b/media/jni/android_media_MediaExtractor.cpp
index 948ebcd9fdd5..6a622c5a1566 100644
--- a/media/jni/android_media_MediaExtractor.cpp
+++ b/media/jni/android_media_MediaExtractor.cpp
@@ -68,7 +68,7 @@ JMediaExtractor::JMediaExtractor(JNIEnv *env, jobject thiz)
mClass = (jclass)env->NewGlobalRef(clazz);
mObject = env->NewWeakGlobalRef(thiz);
- mImpl = new NuMediaExtractor;
+ mImpl = new NuMediaExtractor(NuMediaExtractor::EntryPoint::SDK);
}
JMediaExtractor::~JMediaExtractor() {
diff --git a/media/jni/android_media_MediaMetadataRetriever.cpp b/media/jni/android_media_MediaMetadataRetriever.cpp
index 126897a908f8..ddc51cdb861c 100644
--- a/media/jni/android_media_MediaMetadataRetriever.cpp
+++ b/media/jni/android_media_MediaMetadataRetriever.cpp
@@ -464,11 +464,13 @@ static jobject android_media_MediaMetadataRetriever_getThumbnailImageAtIndex(
|| thumbPixels * 6 >= maxPixels) {
frameMemory = retriever->getImageAtIndex(
index, colorFormat, false /*metaOnly*/, true /*thumbnail*/);
- // TODO: Using unsecurePointer() has some associated security pitfalls
- // (see declaration for details).
- // Either document why it is safe in this case or address the
- // issue (e.g. by copying).
- videoFrame = static_cast<VideoFrame *>(frameMemory->unsecurePointer());
+ if (frameMemory != 0) {
+ // TODO: Using unsecurePointer() has some associated security pitfalls
+ // (see declaration for details).
+ // Either document why it is safe in this case or address the
+ // issue (e.g. by copying).
+ videoFrame = static_cast<VideoFrame *>(frameMemory->unsecurePointer());
+ }
if (thumbPixels > maxPixels) {
int downscale = ceil(sqrt(thumbPixels / (float)maxPixels));
diff --git a/media/native/midi/amidi.cpp b/media/native/midi/amidi.cpp
index 35c4d42a0aa8..923377c8180e 100644
--- a/media/native/midi/amidi.cpp
+++ b/media/native/midi/amidi.cpp
@@ -131,7 +131,7 @@ static media_status_t AMIDI_getDeviceInfo(const AMidiDevice *device,
MidiDeviceInfo deviceInfo;
Status txResult = device->server->getDeviceInfo(&deviceInfo);
if (!txResult.isOk()) {
- ALOGE("AMIDI_getDeviceInfo transaction error: %d", txResult.transactionError());
+ ALOGE("%s server exception code: %d", __func__, txResult.exceptionCode());
return AMEDIA_ERROR_UNKNOWN;
}
@@ -253,7 +253,7 @@ static media_status_t AMIDI_openPort(const AMidiDevice *device, int32_t portNumb
? device->server->openOutputPort(portToken, portNumber, &ufd)
: device->server->openInputPort(portToken, portNumber, &ufd);
if (!txResult.isOk()) {
- ALOGE("AMIDI_openPort transaction error: %d", txResult.transactionError());
+ ALOGE("%s server exception code: %d", __func__, txResult.exceptionCode());
return AMEDIA_ERROR_UNKNOWN;
}
@@ -282,7 +282,7 @@ static void AMIDI_closePort(AMIDI_Port *port) {
Status txResult = port->device->server->closePort(port->binderToken);
if (!txResult.isOk()) {
- ALOGE("Transaction error closing MIDI port:%d", txResult.transactionError());
+ ALOGE("%s server exception code: %d", __func__, txResult.exceptionCode());
}
delete port;
diff --git a/media/tests/MtpTests/OWNERS b/media/tests/MtpTests/OWNERS
index e27d06f4825a..1928ba811e7e 100644
--- a/media/tests/MtpTests/OWNERS
+++ b/media/tests/MtpTests/OWNERS
@@ -1,7 +1,7 @@
set noparent
marcone@google.com
-jsharkey@google.com
+jsharkey@android.com
jameswei@google.com
rmojumder@google.com
diff --git a/packages/Connectivity/OWNERS b/packages/Connectivity/OWNERS
new file mode 100644
index 000000000000..48e54da82cc2
--- /dev/null
+++ b/packages/Connectivity/OWNERS
@@ -0,0 +1,3 @@
+set noparent
+
+include platform/frameworks/base:/services/core/java/com/android/server/net/OWNERS
diff --git a/packages/SettingsLib/OWNERS b/packages/SettingsLib/OWNERS
index 30c10d3ef3b8..8eafbdfdf6bc 100644
--- a/packages/SettingsLib/OWNERS
+++ b/packages/SettingsLib/OWNERS
@@ -1,5 +1,5 @@
# People who can approve changes for submission
-dsandler@google.com
+dsandler@android.com
edgarwang@google.com
emilychuang@google.com
evanlaird@google.com
diff --git a/packages/SettingsLib/res/values-af/strings.xml b/packages/SettingsLib/res/values-af/strings.xml
index 41af185da0b7..438e8b8c5bf2 100644
--- a/packages/SettingsLib/res/values-af/strings.xml
+++ b/packages/SettingsLib/res/values-af/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"Aktief. Tik om te wissel."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"Programbystandstatus:<xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"Mediakodewisselinginstellings"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"Deaktiveer kodewisseling"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"Ignoreer kodewisselingverstekke"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"Aktiveer kodewisseling"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"Aanvaar dat programme moderne formate steun"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"Aktiveer kodewisseling vir programme"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"Lopende dienste"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"Sien en beheer dienste wat tans aktief is"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> – <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"<xliff:g id="TIME">%1$s</xliff:g> oor tot battery gelaai is"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> – <xliff:g id="TIME">%2$s</xliff:g> tot battery gelaai is"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> – Battery word tydelik beperk"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> – Optimeer tans vir batterygesondheid"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"Onbekend"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"Laai"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"Laai tans vinnig"</string>
diff --git a/packages/SettingsLib/res/values-am/strings.xml b/packages/SettingsLib/res/values-am/strings.xml
index 8e4e402c2e16..fd5777d5fe70 100644
--- a/packages/SettingsLib/res/values-am/strings.xml
+++ b/packages/SettingsLib/res/values-am/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"ገቢር። ለመቀያየር ነካ ያድርጉ።"</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"የመተግበሪያ ዝግጁ የመሆን ሁኔታ፦<xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"የሚዲያ ትራንስኮዲንግ ቅንብሮች"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"ትራንስኮንግን አሰናክል"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"የትራንስኮዲንግ ነባሪዎችን ሻር"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"ትራንስኮዲንግን ያንቁ"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"መተግበሪያዎች ዘመናዊ ቅርጸቶችን እንደሚደግፉ አድርገው ይቁጠሩ"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"ለመተግበሪያዎች ትራንስኮዲንግን ያንቁ"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"አሂድ አገልግሎቶች"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"በአሁኑጊዜ እየሄዱ ያሉ አገልግሎቶችን ተቆጣጠር እና እይ"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"<xliff:g id="TIME">%1$s</xliff:g> ኃይል እስከሚሞላ ድረስ ይቀራል"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="TIME">%2$s</xliff:g> ኃይል እስከሚሞላ ድረስ"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> - ባትሪ ለጊዜው ተገድቧል"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> - ለባትሪ ጤና ማመቻቸት"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"ያልታወቀ"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"ኃይል በመሙላት ላይ"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"ኃይል በፍጥነት በመሙላት ላይ"</string>
diff --git a/packages/SettingsLib/res/values-ar/strings.xml b/packages/SettingsLib/res/values-ar/strings.xml
index 691ec046da02..b81031ee5835 100644
--- a/packages/SettingsLib/res/values-ar/strings.xml
+++ b/packages/SettingsLib/res/values-ar/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"نشط، انقر للتبديل."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"حالة تطبيق وضع الاستعداد:<xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"إعدادات تحويل ترميز الوسائط"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"إيقاف تحويل الترميز"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"إلغاء الإعدادات التلقائية لتحويل الترميز"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"تفعيل تحويل الترميز"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"افتراض أن التطبيق يتوافق مع التنسيقات الحديثة"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"تفعيل تحويل الترميز للتطبيقات"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"الخدمات قيد التشغيل"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"عرض الخدمات قيد التشغيل في الوقت الحالي والتحكم فيها"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"<xliff:g id="TIME">%1$s</xliff:g> إلى أن يتم شحن الجهاز بالكامل"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="TIME">%2$s</xliff:g> إلى أن يتم شحن الجهاز بالكامل"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> - تأثير محدود على البطارية مؤقتًا"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> - التحسين لسلامة البطارية"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"غير معروف"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"جارٍ الشحن"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"جارٍ الشحن سريعًا"</string>
@@ -518,7 +520,7 @@
<string name="media_transfer_this_device_name" msgid="2716555073132169240">"مكبر صوت الهاتف"</string>
<string name="profile_connect_timeout_subtext" msgid="4043408193005851761">"حدثت مشكلة أثناء الاتصال. يُرجى إيقاف الجهاز ثم إعادة تشغيله."</string>
<string name="media_transfer_wired_device_name" msgid="4447880899964056007">"جهاز سماعي سلكي"</string>
- <string name="help_label" msgid="3528360748637781274">"المساعدة والتعليقات"</string>
+ <string name="help_label" msgid="3528360748637781274">"المساعدة والملاحظات والآراء"</string>
<string name="storage_category" msgid="2287342585424631813">"مساحة التخزين"</string>
<string name="shared_data_title" msgid="1017034836800864953">"البيانات المشتركة"</string>
<string name="shared_data_summary" msgid="5516326713822885652">"عرض البيانات المشتركة وتعديلها"</string>
diff --git a/packages/SettingsLib/res/values-as/strings.xml b/packages/SettingsLib/res/values-as/strings.xml
index 61214e09ba26..e4823299c296 100644
--- a/packages/SettingsLib/res/values-as/strings.xml
+++ b/packages/SettingsLib/res/values-as/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"সক্ৰিয়। ট\'গল কৰিবলৈ টিপক।"</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"এপ্ ষ্টেণ্ডবাই অৱস্থাত আছে:<xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"মিডিয়া ট্ৰান্সক\'ডিঙৰ ছেটিং"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"ট্ৰান্সক\'ডিং অক্ষম কৰক"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"ট্ৰেন্সক’ডিং ডিফ’ল্ট অ’ভাৰৰাইড কৰক"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"ট্ৰেন্সক’ডিং সক্ষম কৰক"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"এপে আধুনিক ফৰ্মেট সমৰ্থন কৰে বুলি ধৰি লওক"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"এপৰ বাবে ট্ৰান্সক\'ডিং সক্ষম কৰক"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"চলিত সেৱা"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"বৰ্তমান চলি থকা সেৱাসমূহ চাওক আৰু নিয়ন্ত্ৰণ কৰক"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"চাৰ্জ হ’বলৈ <xliff:g id="TIME">%1$s</xliff:g> বাকী আছে"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="TIME">%2$s</xliff:g> চাৰ্জ হ\'বলৈ"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> - বেটাৰী সাময়িকভাৱে সীমিত কৰা হৈছে"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> - বেটাৰীৰ অৱস্থা অপ্টিমাইজ কৰি থকা হৈছে"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"অজ্ঞাত"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"চাৰ্জ কৰি থকা হৈছে"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"দ্ৰুততাৰে চাৰ্জ হৈছে"</string>
diff --git a/packages/SettingsLib/res/values-az/strings.xml b/packages/SettingsLib/res/values-az/strings.xml
index db61527a54d8..637785d06d2e 100644
--- a/packages/SettingsLib/res/values-az/strings.xml
+++ b/packages/SettingsLib/res/values-az/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"Aktivdir. Keçid etmək üçün basın."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"Tətbiqin gözləmə rejimi:<xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"Media yenidən kodlaşdırma ayarları"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"Yenidən kodlaşdırmanı deaktiv edin"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"Yenidən kodlaşdırma defoltlarını əvəzləyin"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"Yenidən kodlaşdırmanı aktiv edin"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"Tətbiqlərin müasir formatları dəstəklədiyini qəbul edin"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"Tətbiqlər üçün yenidən kodlaşdırmanı aktiv edin"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"İşləyən xidmətlər"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"Hazırda prosesdə olan xidmətləri görüntüləyin və onlara nəzarət edin"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"Enerjinin dolmasına <xliff:g id="TIME">%1$s</xliff:g> qalıb"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> - Enerjinin dolmasına <xliff:g id="TIME">%2$s</xliff:g> qalıb"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> - Batareya müvəqqəti məhdudlaşdırılıb"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> - Enerjiyə qənaət üçün optimallaşdırma"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"Naməlum"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"Enerji doldurma"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"Sürətlə doldurulur"</string>
diff --git a/packages/SettingsLib/res/values-b+sr+Latn/strings.xml b/packages/SettingsLib/res/values-b+sr+Latn/strings.xml
index 70fb3636b492..219d5a072c45 100644
--- a/packages/SettingsLib/res/values-b+sr+Latn/strings.xml
+++ b/packages/SettingsLib/res/values-b+sr+Latn/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"Aktivna. Dodirnite da biste je deaktivirali."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"Stanje pripravnosti aplikacije: <xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"Podešavanja transkodiranja medija"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"Onemogući transkodiranje"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"Zameni podrazumevana podešavanja transkodiranja"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"Omogući transkodiranje"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"Podrazumevaj da aplikacije podržavaju moderne formate"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"Omogućite transkodiranje za aplikacije"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"Pokrenute usluge"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"Prikaz i kontrola trenutno pokrenutih usluga"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> – <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"Napuniće se za <xliff:g id="TIME">%1$s</xliff:g>"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> – napuniće se za <xliff:g id="TIME">%2$s</xliff:g>"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> – baterija je trenutno ograničena"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> – Optimizuje se radi stanja baterije"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"Nepoznato"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"Puni se"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"Brzo se puni"</string>
diff --git a/packages/SettingsLib/res/values-be/strings.xml b/packages/SettingsLib/res/values-be/strings.xml
index 8a0db8261a71..4772e032268f 100644
--- a/packages/SettingsLib/res/values-be/strings.xml
+++ b/packages/SettingsLib/res/values-be/strings.xml
@@ -400,7 +400,12 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"Актыўная. Краніце, каб пераключыць."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"Стан праграмы ў рэжыме чакання: <xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"Налады перакадзіравання мультымедыя"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"Выключыць перакадзіраванне"</string>
+ <!-- no translation found for transcode_user_control (6176368544817731314) -->
+ <skip />
+ <!-- no translation found for transcode_enable_all (2411165920039166710) -->
+ <skip />
+ <!-- no translation found for transcode_default (3784803084573509491) -->
+ <skip />
<string name="transcode_skip_apps" msgid="8249721984597390142">"Уключыць перакадзіраванне для праграм"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"Запушчаныя службы"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"Прагляд запушчаных службаў i кіраванне iмi"</string>
@@ -449,7 +454,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> – <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"Засталося <xliff:g id="TIME">%1$s</xliff:g> да поўнай зарадкі"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> – <xliff:g id="TIME">%2$s</xliff:g> да поўнай зарадкі"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> – зарад акумулятара часова абмежаваны"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> - Аптымізацыя стану акумулятара"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"Невядома"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"Зарадка"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"Хуткая зарадка"</string>
diff --git a/packages/SettingsLib/res/values-bg/strings.xml b/packages/SettingsLib/res/values-bg/strings.xml
index 27dcf105fd2e..75d1eeb1093f 100644
--- a/packages/SettingsLib/res/values-bg/strings.xml
+++ b/packages/SettingsLib/res/values-bg/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"Активно. Докоснете, за да превключите."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"Състояние на готовност на приложението: <xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"Настройки за прекодирането на мултимедия"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"Деактивиране на прекодирането"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"Отмяна на стандартните настройки за прекодирането"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"Активиране на прекодирането"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"Предполагане, че приложенията поддържат съвременни формати"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"Активиране на прекодирането за приложения"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"Изпълнявани услуги"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"Преглед и контрол върху изпълняващите се понастоящем услуги"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> – <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"Оставащо време до пълно зареждане: <xliff:g id="TIME">%1$s</xliff:g>"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> – <xliff:g id="TIME">%2$s</xliff:g> до пълно зареждане"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> – Батерията е временно ограничена"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> – Оптимизиране за състоян. на батерията"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"Неизвестно"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"Зарежда се"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"Зарежда се бързо"</string>
diff --git a/packages/SettingsLib/res/values-bn/strings.xml b/packages/SettingsLib/res/values-bn/strings.xml
index 29862e6efd31..325f2bdc5807 100644
--- a/packages/SettingsLib/res/values-bn/strings.xml
+++ b/packages/SettingsLib/res/values-bn/strings.xml
@@ -400,7 +400,12 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"সক্রিয় রয়েছে৷ টগল করতে আলতো চাপুন৷"</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"অ্যাপ স্ট্যান্ডবাই-এর অবস্থা:<xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"মিডিয়া ট্রান্সকোডিং সেটিংস"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"ট্রান্সকোডিং বন্ধ করুন"</string>
+ <!-- no translation found for transcode_user_control (6176368544817731314) -->
+ <skip />
+ <!-- no translation found for transcode_enable_all (2411165920039166710) -->
+ <skip />
+ <!-- no translation found for transcode_default (3784803084573509491) -->
+ <skip />
<string name="transcode_skip_apps" msgid="8249721984597390142">"অ্যাপের জন্য ট্রান্সকোডিং চালু করুন"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"এখন চলছে যে পরিষেবাগুলি"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"বর্তমান চলমান পরিষেবাগুলি দেখুন এবং নিয়ন্ত্রণ করুন"</string>
@@ -449,7 +454,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"সম্পূর্ণ চার্জ হতে <xliff:g id="TIME">%1$s</xliff:g> বাকি আছে"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="TIME">%2$s</xliff:g>-এ সম্পূর্ণ চার্জ হয়ে যাবে"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> - ব্যাটারি কিছুক্ষণের জন্য সীমিত করা হয়েছে"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> - ব্যাটারির চার্জ অপটিমাইজ করা হচ্ছে"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"অজানা"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"চার্জ হচ্ছে"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"দ্রুত চার্জ হচ্ছে"</string>
diff --git a/packages/SettingsLib/res/values-bs/strings.xml b/packages/SettingsLib/res/values-bs/strings.xml
index 4704ec8db79a..ab4ac1460d6f 100644
--- a/packages/SettingsLib/res/values-bs/strings.xml
+++ b/packages/SettingsLib/res/values-bs/strings.xml
@@ -28,7 +28,7 @@
<string name="wifi_disabled_network_failure" msgid="2660396183242399585">"Greška u konfiguraciji IP-a"</string>
<string name="wifi_disabled_by_recommendation_provider" msgid="1302938248432705534">"Niste povezani zbog slabog kvaliteta mreže"</string>
<string name="wifi_disabled_wifi_failure" msgid="8819554899148331100">"Greška pri povezivanju na WiFi"</string>
- <string name="wifi_disabled_password_failure" msgid="6892387079613226738">"Problem pri autentifikaciji."</string>
+ <string name="wifi_disabled_password_failure" msgid="6892387079613226738">"Problem pri autentifikaciji"</string>
<string name="wifi_cant_connect" msgid="5718417542623056783">"Nije se moguće povezati"</string>
<string name="wifi_cant_connect_to_ap" msgid="3099667989279700135">"Nije se moguće povezati na aplikaciju \'<xliff:g id="AP_NAME">%1$s</xliff:g>\'"</string>
<string name="wifi_check_password_try_again" msgid="8817789642851605628">"Provjerite lozinku i pokušajte ponovo"</string>
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"Aktivno. Dodirnite za promjenu opcije."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"Stanje mirovanja aplikacije:<xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"Postavke transkodiranja medija"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"Onemogućite transkodiranje"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"Zaobiđi zadane postavke transkodiranja"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"Omogući transkodiranje"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"Pretpostavi da aplikacije podržavaju moderne formate"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"Omogućite transkodiranje za aplikacije"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"Pokrenute usluge"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"Prikaz i kontrola trenutno pokrenutih usluga"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> – <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"Napunit će se za <xliff:g id="TIME">%1$s</xliff:g>"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> – napunit će se za <xliff:g id="TIME">%2$s</xliff:g>"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> – Baterija je privremeno ograničena"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> – Optimiziranje radi očuvanja baterije"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"Nepoznato"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"Punjenje"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"Brzo punjenje"</string>
diff --git a/packages/SettingsLib/res/values-ca/strings.xml b/packages/SettingsLib/res/values-ca/strings.xml
index 5d04963d9b4a..9bb919f39091 100644
--- a/packages/SettingsLib/res/values-ca/strings.xml
+++ b/packages/SettingsLib/res/values-ca/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"Aplicació activa. Toca per desactivar-la."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"Estat de les aplicacions inactives: <xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"Configuració de la transcodificació de contingut multimèdia"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"Desactiva la transcodificació"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"Substitueix els valors predeterminats de la transcodificació"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"Activa la transcodificació"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"Assumeix que les aplicacions són compatibles amb formats moderns"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"Activa la transcodificació per a les aplicacions"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"Serveis en execució"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"Visualitza i controla els serveis en execució"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g>: <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"<xliff:g id="TIME">%1$s</xliff:g> per completar la càrrega"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g>: <xliff:g id="TIME">%2$s</xliff:g> per completar la càrrega"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g>: bateria limitada temporalment"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g>: optimitzant per a l\'estat de la bateria"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"Desconegut"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"S\'està carregant"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"Carregant ràpidament"</string>
diff --git a/packages/SettingsLib/res/values-cs/strings.xml b/packages/SettingsLib/res/values-cs/strings.xml
index a99a4dabbc60..5f2e00534461 100644
--- a/packages/SettingsLib/res/values-cs/strings.xml
+++ b/packages/SettingsLib/res/values-cs/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"Aktivní. Klepnutím možnost přepnete."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"Stav pohotovostního režimu aplikace: <xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"Nastavení překódování médií"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"Zakázat překódování"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"Přepsat výchozí nastavení překódování"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"Povolit překódování"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"Předpokládat, že aplikace podporují moderní formáty"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"Povolit překódování pro aplikace"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"Spuštěné služby"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"Umožňuje zobrazit a ovládat aktuálně spuštěné služby"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> – <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"Do nabití zbývá: <xliff:g id="TIME">%1$s</xliff:g>"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> – <xliff:g id="TIME">%2$s</xliff:g> do nabití"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> – Baterie dočasně omezena"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> – Optimalizace pro výdrž baterie"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"Neznámé"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"Nabíjí se"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"Rychlé nabíjení"</string>
diff --git a/packages/SettingsLib/res/values-da/strings.xml b/packages/SettingsLib/res/values-da/strings.xml
index c90155eb2b68..f4f46507a9f3 100644
--- a/packages/SettingsLib/res/values-da/strings.xml
+++ b/packages/SettingsLib/res/values-da/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"Aktiv. Tryk for at skifte."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"Standbystatus for appen:<xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"Indstillinger for omkodning af medier"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"Deaktiver omkodning"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"Tilsidesæt standardindstillingerne for omkodning"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"Aktivér omkodning"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"Gå ud fra, at apps understøtter moderne formater"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"Aktivér omkodning for apps"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"Kørende tjenester"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"Vis og administrer kørende tjenester"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> – <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"Opladet om <xliff:g id="TIME">%1$s</xliff:g>"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> – opladet om <xliff:g id="TIME">%2$s</xliff:g>"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> – Batteriet er midlertidigt begrænset"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> – Optimerer batteritilstanden"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"Ukendt"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"Oplader"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"Oplader hurtigt"</string>
diff --git a/packages/SettingsLib/res/values-de/strings.xml b/packages/SettingsLib/res/values-de/strings.xml
index b5b9fc480607..1d6894b097f7 100644
--- a/packages/SettingsLib/res/values-de/strings.xml
+++ b/packages/SettingsLib/res/values-de/strings.xml
@@ -400,7 +400,12 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"Aktiv. Zum Wechseln tippen."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"Standby-Status der App:<xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"Einstellungen für Medientranscodierung"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"Transcodierung deaktivieren"</string>
+ <!-- no translation found for transcode_user_control (6176368544817731314) -->
+ <skip />
+ <!-- no translation found for transcode_enable_all (2411165920039166710) -->
+ <skip />
+ <!-- no translation found for transcode_default (3784803084573509491) -->
+ <skip />
<string name="transcode_skip_apps" msgid="8249721984597390142">"Transcodierung für Apps aktivieren"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"Aktive Dienste"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"Momentan ausgeführte Dienste anzeigen und steuern"</string>
@@ -449,7 +454,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> – <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"Noch <xliff:g id="TIME">%1$s</xliff:g> bis zur Aufladung"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> – <xliff:g id="TIME">%2$s</xliff:g> bis zur Aufladung"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> – Akku vorübergehend eingeschränkt"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> – Optimierung des Akkuzustands"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"Unbekannt"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"Wird aufgeladen"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"Schnelles Aufladen"</string>
diff --git a/packages/SettingsLib/res/values-el/strings.xml b/packages/SettingsLib/res/values-el/strings.xml
index 203ec40c5a42..3affbce49f09 100644
--- a/packages/SettingsLib/res/values-el/strings.xml
+++ b/packages/SettingsLib/res/values-el/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"Ενεργό. Πατήστε για εναλλαγή."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"Κατάσταση αναμονής εφαρμογής:<xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"Ρυθμίσεις διακωδικοποίησης μέσων"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"Απενεργοποίηση διακωδικοποίησης"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"Παράκαμψη προεπιλογών διακωδικοποίησης"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"Ενεργοποίηση διακωδικοποίησης"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"Να θεωρείται ότι οι εφαρμογές χρησιμοποιούν σύγχρονες μορφές"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"Ενεργοποίηση διακωδικοποίησης για εφαρμογές"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"Υπηρεσίες που εκτελούνται"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"Προβολή και έλεγχος των εφαρμογών που εκτελούνται αυτή τη στιγμή"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"Απομένουν <xliff:g id="TIME">%1$s</xliff:g> για ολοκλήρωση της φόρτισης"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="TIME">%2$s</xliff:g> για την ολοκλήρωση της φόρτισης"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> - Η μπαταρία περιορίστηκε προσωρινά."</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> - Βελτιστοποίηση κατάστασης μπαταρίας"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"Άγνωστο"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"Φόρτιση"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"Ταχεία φόρτιση"</string>
diff --git a/packages/SettingsLib/res/values-en-rAU/strings.xml b/packages/SettingsLib/res/values-en-rAU/strings.xml
index f8019d21c65b..9d5debba80c5 100644
--- a/packages/SettingsLib/res/values-en-rAU/strings.xml
+++ b/packages/SettingsLib/res/values-en-rAU/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"Active. Tap to toggle."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"App standby state:<xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"Media transcoding settings"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"Disable transcoding"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"Override transcoding defaults"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"Enable transcoding"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"Assume apps support modern formats"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"Enable transcoding for apps"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"Running services"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"View and control currently running services"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"<xliff:g id="TIME">%1$s</xliff:g> left until charged"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="TIME">%2$s</xliff:g> until charged"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> – Battery limited temporarily"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> – Optimising for battery health"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"Unknown"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"Charging"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"Charging rapidly"</string>
diff --git a/packages/SettingsLib/res/values-en-rCA/strings.xml b/packages/SettingsLib/res/values-en-rCA/strings.xml
index 7135de5676b2..b0190a2e1112 100644
--- a/packages/SettingsLib/res/values-en-rCA/strings.xml
+++ b/packages/SettingsLib/res/values-en-rCA/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"Active. Tap to toggle."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"App standby state:<xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"Media transcoding settings"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"Disable transcoding"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"Override transcoding defaults"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"Enable transcoding"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"Assume apps support modern formats"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"Enable transcoding for apps"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"Running services"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"View and control currently running services"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"<xliff:g id="TIME">%1$s</xliff:g> left until charged"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="TIME">%2$s</xliff:g> until charged"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> – Battery limited temporarily"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> – Optimising for battery health"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"Unknown"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"Charging"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"Charging rapidly"</string>
diff --git a/packages/SettingsLib/res/values-en-rGB/strings.xml b/packages/SettingsLib/res/values-en-rGB/strings.xml
index f8019d21c65b..9d5debba80c5 100644
--- a/packages/SettingsLib/res/values-en-rGB/strings.xml
+++ b/packages/SettingsLib/res/values-en-rGB/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"Active. Tap to toggle."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"App standby state:<xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"Media transcoding settings"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"Disable transcoding"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"Override transcoding defaults"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"Enable transcoding"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"Assume apps support modern formats"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"Enable transcoding for apps"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"Running services"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"View and control currently running services"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"<xliff:g id="TIME">%1$s</xliff:g> left until charged"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="TIME">%2$s</xliff:g> until charged"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> – Battery limited temporarily"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> – Optimising for battery health"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"Unknown"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"Charging"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"Charging rapidly"</string>
diff --git a/packages/SettingsLib/res/values-en-rIN/strings.xml b/packages/SettingsLib/res/values-en-rIN/strings.xml
index f8019d21c65b..9d5debba80c5 100644
--- a/packages/SettingsLib/res/values-en-rIN/strings.xml
+++ b/packages/SettingsLib/res/values-en-rIN/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"Active. Tap to toggle."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"App standby state:<xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"Media transcoding settings"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"Disable transcoding"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"Override transcoding defaults"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"Enable transcoding"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"Assume apps support modern formats"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"Enable transcoding for apps"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"Running services"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"View and control currently running services"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"<xliff:g id="TIME">%1$s</xliff:g> left until charged"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="TIME">%2$s</xliff:g> until charged"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> – Battery limited temporarily"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> – Optimising for battery health"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"Unknown"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"Charging"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"Charging rapidly"</string>
diff --git a/packages/SettingsLib/res/values-en-rXC/strings.xml b/packages/SettingsLib/res/values-en-rXC/strings.xml
index 54290d269f44..9296a5968ec1 100644
--- a/packages/SettingsLib/res/values-en-rXC/strings.xml
+++ b/packages/SettingsLib/res/values-en-rXC/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"‎‏‎‎‎‎‎‏‎‏‏‏‎‎‎‎‎‎‏‎‎‏‎‎‎‏‎‏‏‏‏‏‏‏‏‎‏‏‏‏‏‎‏‎‏‏‏‎‏‏‏‎‏‏‎‏‏‎‏‏‏‏‏‏‎‏‎‏‎‏‏‎‏‏‎‏‎‎‎‎‏‏‏‎‎‏‎‏‏‎‏‎‏‎‎‎‎Active. Tap to toggle.‎‏‎‎‏‎"</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"‎‏‎‎‎‎‎‏‎‏‏‏‎‎‎‎‎‎‏‎‎‏‎‎‎‏‎‏‏‏‏‏‏‏‎‎‎‏‏‏‎‎‏‎‏‎‏‏‎‎‎‎‎‎‎‎‏‏‎‎‎‏‎‏‎‎‏‎‏‏‎‎‏‎‏‏‏‎‏‎‏‎‏‎‏‎‎‏‏‎‏‎‎‎‎‎‎App standby state:‎‏‎‎‏‏‎<xliff:g id="BUCKET"> %s</xliff:g>‎‏‎‎‏‏‏‎‎‏‎‎‏‎"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"‎‏‎‎‎‎‎‏‎‏‏‏‎‎‎‎‎‎‏‎‎‏‎‎‎‏‎‏‏‏‏‏‎‏‎‎‎‏‏‏‏‎‏‎‏‎‏‎‎‎‎‎‏‎‏‎‏‎‏‏‏‏‏‏‏‎‎‏‏‏‏‏‎‎‏‏‎‎‏‏‏‏‎‏‎‏‏‏‎‏‏‎‏‎‏‎Media transcoding settings‎‏‎‎‏‎"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"‎‏‎‎‎‎‎‏‎‏‏‏‎‎‎‎‎‎‏‎‎‏‎‎‎‏‎‏‏‏‏‏‏‏‏‏‏‏‏‎‎‏‎‏‎‎‏‎‎‏‏‎‏‏‏‏‎‏‎‎‎‏‏‎‎‎‏‎‏‏‏‎‎‏‏‏‎‎‏‎‏‏‏‎‏‏‏‏‎‏‎‏‏‏‏‏‎Disable transcoding‎‏‎‎‏‎"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"‎‏‎‎‎‎‎‏‎‏‏‏‎‎‎‎‎‎‏‎‎‏‎‎‎‏‎‏‏‏‏‏‏‏‎‏‎‏‎‏‏‎‏‏‎‏‏‎‏‏‎‏‏‏‏‎‎‏‏‏‎‏‏‏‏‎‏‏‏‎‏‏‏‏‎‎‎‎‎‏‏‏‎‏‎‏‏‎‏‏‏‏‎‎‏‎‎Override transcoding defaults‎‏‎‎‏‎"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"‎‏‎‎‎‎‎‏‎‏‏‏‎‎‎‎‎‎‏‎‎‏‎‎‎‏‎‏‏‏‏‏‎‏‎‎‎‎‏‎‏‏‏‎‏‏‎‎‎‏‎‏‏‏‎‏‎‏‎‎‎‎‏‎‎‎‏‏‏‏‎‎‏‏‏‎‏‏‎‎‏‏‎‎‎‏‎‏‏‏‏‎‏‏‎‎Enable transcoding‎‏‎‎‏‎"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"‎‏‎‎‎‎‎‏‎‏‏‏‎‎‎‎‎‎‏‎‎‏‎‎‎‏‎‏‏‏‏‏‎‏‏‎‏‎‎‏‎‎‎‎‏‏‎‎‏‎‏‎‎‏‎‎‏‎‏‏‎‏‎‎‏‎‎‏‎‎‎‏‏‎‎‏‏‏‎‏‎‎‎‎‏‏‏‎‏‏‏‎‎‏‏‎Assume apps support modern formats‎‏‎‎‏‎"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"‎‏‎‎‎‎‎‏‎‏‏‏‎‎‎‎‎‎‏‎‎‏‎‎‎‏‎‏‏‏‏‏‏‏‏‏‎‎‏‎‎‏‏‏‏‏‎‎‏‏‏‎‎‏‏‎‎‏‏‎‏‏‏‏‏‎‏‎‎‎‏‏‏‎‏‎‏‎‎‎‎‏‏‏‎‎‏‏‎‎‏‏‏‏‏‎‎Enable transcoding for apps‎‏‎‎‏‎"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"‎‏‎‎‎‎‎‏‎‏‏‏‎‎‎‎‎‎‏‎‎‏‎‎‎‏‎‏‏‏‏‏‏‏‎‏‏‎‎‏‏‎‏‎‎‏‏‎‏‏‏‎‎‎‏‎‎‎‎‏‎‎‏‏‏‏‎‏‏‏‏‏‏‎‎‏‎‏‏‏‏‏‏‎‏‎‏‏‎‎‏‏‎‎‏‏‎Running services‎‏‎‎‏‎"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"‎‏‎‎‎‎‎‏‎‏‏‏‎‎‎‎‎‎‏‎‎‏‎‎‎‏‎‏‏‏‏‎‎‏‏‏‎‏‎‎‎‎‏‎‎‎‏‏‎‏‏‎‎‏‏‎‎‏‏‎‏‎‏‏‏‏‏‎‎‎‎‎‏‎‏‎‏‎‏‎‏‎‏‎‎‎‎‎‎‏‏‏‏‎View and control currently running services‎‏‎‎‏‎"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"‎‏‎‎‎‎‎‏‎‏‏‏‎‎‎‎‎‎‏‎‎‏‎‎‎‏‎‏‏‏‏‏‏‏‎‏‏‏‎‏‎‏‎‏‏‎‏‏‏‎‎‏‎‎‏‏‏‎‎‎‎‎‎‎‏‏‎‎‏‎‎‎‏‏‏‎‎‎‏‏‏‏‎‎‏‏‎‎‎‎‎‎‎‎‏‎‎‎‏‎‎‏‏‎<xliff:g id="LEVEL">%1$s</xliff:g>‎‏‎‎‏‏‏‎ - ‎‏‎‎‏‏‎<xliff:g id="STATE">%2$s</xliff:g>‎‏‎‎‏‏‏‎‎‏‎‎‏‎"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"‎‏‎‎‎‎‎‏‎‏‏‏‎‎‎‎‎‎‏‎‎‏‎‎‎‏‎‏‏‏‏‏‏‏‏‎‎‏‏‎‏‏‏‎‏‎‎‏‏‎‏‎‎‏‎‏‎‎‎‎‎‏‎‎‎‏‎‎‏‎‏‎‎‎‎‏‏‎‏‎‏‏‏‏‎‏‏‏‎‏‏‏‏‎‏‎‎‎‏‎‎‏‏‎<xliff:g id="TIME">%1$s</xliff:g>‎‏‎‎‏‏‏‎ left until charged‎‏‎‎‏‎"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"‎‏‎‎‎‎‎‏‎‏‏‏‎‎‎‎‎‎‏‎‎‏‎‎‎‏‎‏‏‏‏‏‏‏‎‎‎‏‎‏‎‏‏‏‎‏‏‏‏‏‏‏‎‏‏‎‎‎‎‎‏‎‏‏‏‎‎‏‏‎‏‏‎‏‏‏‎‏‏‏‏‎‏‏‏‎‏‏‎‏‏‏‏‎‎‏‎‎‏‎‎‏‏‎<xliff:g id="LEVEL">%1$s</xliff:g>‎‏‎‎‏‏‏‎ - ‎‏‎‎‏‏‎<xliff:g id="TIME">%2$s</xliff:g>‎‏‎‎‏‏‏‎ until charged‎‏‎‎‏‎"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"‎‏‎‎‎‎‎‏‎‏‏‏‎‎‎‎‎‎‏‎‎‏‎‎‎‏‎‏‏‏‏‏‏‏‎‏‎‎‎‏‏‏‏‎‏‎‎‏‎‎‏‏‎‎‎‎‎‎‏‏‎‏‏‏‏‎‎‎‎‎‏‎‎‎‏‏‎‏‏‏‎‎‎‎‏‏‎‏‏‎‎‎‎‎‏‎‎‎‏‎‎‏‏‎<xliff:g id="LEVEL">%1$s</xliff:g>‎‏‎‎‏‏‏‎ - Battery limited temporarily‎‏‎‎‏‎"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"‎‏‎‎‎‎‎‏‎‏‏‏‎‎‎‎‎‎‏‎‎‏‎‎‎‏‎‏‏‏‏‎‏‏‏‎‏‏‎‎‏‎‏‎‎‎‎‎‏‏‎‏‏‏‎‏‎‎‎‏‎‏‏‎‏‏‎‏‏‏‎‎‏‏‏‏‎‏‎‏‎‎‏‏‎‏‏‎‎‎‎‎‎‏‎‎‏‎‎‏‏‎<xliff:g id="LEVEL">%1$s</xliff:g>‎‏‎‎‏‏‏‎ - Optimizing for battery health‎‏‎‎‏‎"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"‎‏‎‎‎‎‎‏‎‏‏‏‎‎‎‎‎‎‏‎‎‏‎‎‎‏‎‏‏‏‎‏‎‏‏‏‎‏‏‏‎‏‎‎‏‎‏‏‎‎‏‎‏‎‏‏‏‎‏‎‏‎‎‎‎‏‎‏‎‏‏‏‎‏‏‏‏‎‎‏‏‏‏‏‏‎‏‏‎‏‎‎Unknown‎‏‎‎‏‎"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"‎‏‎‎‎‎‎‏‎‏‏‏‎‎‎‎‎‎‏‎‎‏‎‎‎‏‎‏‏‏‏‏‎‏‏‏‎‏‏‎‏‏‎‎‏‎‏‎‏‏‏‎‏‏‏‎‎‏‎‎‎‏‏‏‎‎‎‏‎‏‏‎‏‎‏‎‎‎‎‎‏‏‎‎‏‏‎‏‏‎‎‏‏‎‏‎Charging‎‏‎‎‏‎"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"‎‏‎‎‎‎‎‏‎‏‏‏‎‎‎‎‎‎‏‎‎‏‎‎‎‏‎‏‏‏‏‏‏‏‏‎‏‏‏‏‎‏‏‎‎‏‏‏‏‎‎‏‏‏‏‏‎‎‎‏‎‎‎‎‏‏‏‎‏‏‏‏‏‏‎‏‎‎‎‏‎‎‏‎‏‏‎‏‏‎‎‎‎‏‎‏‎Charging rapidly‎‏‎‎‏‎"</string>
diff --git a/packages/SettingsLib/res/values-es-rUS/strings.xml b/packages/SettingsLib/res/values-es-rUS/strings.xml
index 08ff55099c9c..41466be75fb7 100644
--- a/packages/SettingsLib/res/values-es-rUS/strings.xml
+++ b/packages/SettingsLib/res/values-es-rUS/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"Activa. Presiona para activar o desactivar."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"Estado de la app en espera: <xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"Configuración de transcodificación de contenido multimedia"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"Inhabilitar transcodificación"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"Anular los valores predeterminados de transcodificación"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"Habilitar la transcodificación"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"Suponer que las apps admiten formatos modernos"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"Habilitar transcodificación en apps"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"En ejecución"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"Ver y controlar servicios actuales en ejecución"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g>: <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"<xliff:g id="TIME">%1$s</xliff:g> para completar la carga"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="TIME">%2$s</xliff:g> para completar la carga"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> - Batería limitada temporalmente"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g>: Optimizando el estado de la batería"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"Desconocido"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"Cargando"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"Cargando rápido"</string>
diff --git a/packages/SettingsLib/res/values-es/strings.xml b/packages/SettingsLib/res/values-es/strings.xml
index 6f6a1a1c9b17..8a0a123081e3 100644
--- a/packages/SettingsLib/res/values-es/strings.xml
+++ b/packages/SettingsLib/res/values-es/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"Activa. Toca para alternar."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"Estado de la aplicación en espera: <xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"Configuración de la transcodificación multimedia"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"Inhabilitar transcodificación"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"Anular valores predeterminados de transcodificación"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"Habilitar transcodificación"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"Considerar que las aplicaciones admiten formatos modernos"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"Habilitar transcodificación en las aplicaciones"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"Servicios en ejecución"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"Ver y controlar los servicios en ejecución"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"<xliff:g id="TIME">%1$s</xliff:g> hasta cargarse completamente"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> (<xliff:g id="TIME">%2$s</xliff:g> hasta cargarse completamente)"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g>: batería limitada temporalmente"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g>: preservando estado de la batería"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"Desconocido"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"Cargando"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"Cargando rápidamente"</string>
diff --git a/packages/SettingsLib/res/values-et/strings.xml b/packages/SettingsLib/res/values-et/strings.xml
index 9d6326e45706..4b82c08a46e7 100644
--- a/packages/SettingsLib/res/values-et/strings.xml
+++ b/packages/SettingsLib/res/values-et/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"Aktiivne. Puudutage vahetamiseks."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"Rakenduse ootelolek:<xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"Meedia transkodeerimise seaded"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"Keela transkodeerimine"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"Alista transkodeerimise vaikeseaded"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"Luba transkodeerimine"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"Oleta, et rakendused toetavad kaasaegseid vorminguid"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"Luba rakenduste puhul transkodeerimine"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"Käitatud teenused"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"Praegu käitatud teenuste vaatamine ja juhtimine"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> – <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"Täislaadimiseni on jäänud <xliff:g id="TIME">%1$s</xliff:g>"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> – <xliff:g id="TIME">%2$s</xliff:g> täislaadimiseni"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> – akutase on ajutiselt piiratud"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> – optimeerimine aku seisukorra põhjal"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"Tundmatu"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"Laadimine"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"Kiirlaadimine"</string>
diff --git a/packages/SettingsLib/res/values-eu/strings.xml b/packages/SettingsLib/res/values-eu/strings.xml
index 01afa1706e3e..37c1fd8db552 100644
--- a/packages/SettingsLib/res/values-eu/strings.xml
+++ b/packages/SettingsLib/res/values-eu/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"Aktibo. Aldatzeko, sakatu hau."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"Egonean moduko aplikazioaren egoera: <xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"Multimedia-edukia transkodetzeko ezarpenak"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"Desgaitu transkodetzeko aukera"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"Ez erabili transkodetzearen balio lehenetsiak"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"Gaitu transkodetzea"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"Arduratu aplikazioek formatu modernoak onartzeaz"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"Gaitu aplikazioak transkodetzeko aukera"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"Abian diren zerbitzuak"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"Ikusi eta kontrolatu une honetan abian diren zerbitzuak"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"<xliff:g id="TIME">%1$s</xliff:g> guztiz kargatu arte"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="TIME">%2$s</xliff:g> guztiz kargatu arte"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g>: bateria mugatuta egongo da aldi batez"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> - Optimizatzen bateria egoera onean mantentzeko"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"Ezezaguna"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"Kargatzen"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"Bizkor kargatzen"</string>
diff --git a/packages/SettingsLib/res/values-fa/strings.xml b/packages/SettingsLib/res/values-fa/strings.xml
index dd7ab9672e96..7d20aaf0f5f7 100644
--- a/packages/SettingsLib/res/values-fa/strings.xml
+++ b/packages/SettingsLib/res/values-fa/strings.xml
@@ -34,7 +34,7 @@
<string name="wifi_check_password_try_again" msgid="8817789642851605628">"گذرواژه را بررسی و دوباره امتحان کنید"</string>
<string name="wifi_not_in_range" msgid="1541760821805777772">"در محدوده نیست"</string>
<string name="wifi_no_internet_no_reconnect" msgid="821591791066497347">"اتصال به‌صورت خودکار انجام نمی‌شود"</string>
- <string name="wifi_no_internet" msgid="1774198889176926299">"بدون دسترسی به اینترنت"</string>
+ <string name="wifi_no_internet" msgid="1774198889176926299">"دسترسی به اینترنت ندارد"</string>
<string name="saved_network" msgid="7143698034077223645">"ذخیره‌شده توسط <xliff:g id="NAME">%1$s</xliff:g>"</string>
<string name="connected_via_network_scorer" msgid="7665725527352893558">"‏اتصال خودکار ازطریق %1$s"</string>
<string name="connected_via_network_scorer_default" msgid="7973529709744526285">"اتصال خودکار ازطریق ارائه‌دهنده رتبه‌بندی شبکه"</string>
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"فعال. برای تغییر حالت ضربه بزنید."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"وضعیت حالت آماده به‌کار برنامه:<xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"تنظیمات تراتبدیل رسانه"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"غیرفعال کردن تراتبدیل"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"ملغی کردن پیش‌فرض‌های تراتبدیل"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"فعال کردن تراتبدیل"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"فرض شود برنامه‌ها از قالب‌های مدرن پشتیبانی می‌کنند"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"فعال کردن تراتبدیل برای برنامه‌ها"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"سرویس‌های در حال اجرا"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"مشاهده و کنترل سرویس‌های در حال اجرای فعلی"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> - ‏<xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"<xliff:g id="TIME">%1$s</xliff:g> مانده تا شارژ کامل"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="TIME">%2$s</xliff:g> تا شارژ کامل"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> - باتری موقتاً محدود شده است"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> - بهینه‌سازی برای سلامت باتری"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"ناشناس"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"در حال شارژ شدن"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"درحال شارژ شدن سریع"</string>
diff --git a/packages/SettingsLib/res/values-fi/strings.xml b/packages/SettingsLib/res/values-fi/strings.xml
index b86b02d8c25f..a43c5d706e3b 100644
--- a/packages/SettingsLib/res/values-fi/strings.xml
+++ b/packages/SettingsLib/res/values-fi/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"Aktiivinen. Vaihda koskettamalla."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"Sovelluksen valmiusluokka: <xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"Median transkoodausasetukset"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"Poista transkoodaus käytöstä"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"Ohita transkoodauksen oletukset"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"Salli transkoodaus"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"Oleta, että sovellukset tukevat nykyaikaisia formaatteja"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"Ota sovellusten transkoodaus käyttöön"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"Käynnissä olevat palvelut"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"Tarkastele ja hallitse käynnissä olevia palveluita."</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> – <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"<xliff:g id="TIME">%1$s</xliff:g> jäljellä täyteen lataukseen"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> – <xliff:g id="TIME">%2$s</xliff:g> täyteen lataukseen"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> – Akun käyttöä rajoitettu tilapäisesti"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> – Akun kunnon optimointi"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"Tuntematon"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"Ladataan"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"Nopea lataus"</string>
diff --git a/packages/SettingsLib/res/values-fr-rCA/strings.xml b/packages/SettingsLib/res/values-fr-rCA/strings.xml
index 0bca1dba1aa4..0cb7b1746101 100644
--- a/packages/SettingsLib/res/values-fr-rCA/strings.xml
+++ b/packages/SettingsLib/res/values-fr-rCA/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"Application active. Touchez ici pour la désactiver."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"État de l\'application en veille :<xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"Paramètres de transcodage des éléments multimédias"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"Désactiver le transcodage"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"Remplacer les valeurs par défaut de transcodage"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"Activer le transcodage"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"Présumer que les applications prennent en charge les formats modernes"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"Activer le transcodage pour les applications"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"Services en cours d\'exécution"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"Afficher et contrôler les services en cours d\'exécution"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"<xliff:g id="TIME">%1$s</xliff:g> jusqu\'à la charge complète"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> : <xliff:g id="TIME">%2$s</xliff:g> jusqu\'à la charge complète"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> – Pile limitée temporairement"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> – Optimisation pour la santé de la pile"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"Inconnu"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"Charge en cours…"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"Recharge rapide"</string>
diff --git a/packages/SettingsLib/res/values-fr/strings.xml b/packages/SettingsLib/res/values-fr/strings.xml
index ebde43ba52a2..e928a48fca26 100644
--- a/packages/SettingsLib/res/values-fr/strings.xml
+++ b/packages/SettingsLib/res/values-fr/strings.xml
@@ -28,7 +28,7 @@
<string name="wifi_disabled_network_failure" msgid="2660396183242399585">"Échec de configuration de l\'adresse IP"</string>
<string name="wifi_disabled_by_recommendation_provider" msgid="1302938248432705534">"Non connecté en raison de la faible qualité du réseau"</string>
<string name="wifi_disabled_wifi_failure" msgid="8819554899148331100">"Échec de la connexion Wi-Fi"</string>
- <string name="wifi_disabled_password_failure" msgid="6892387079613226738">"Problème d\'authentification."</string>
+ <string name="wifi_disabled_password_failure" msgid="6892387079613226738">"Problème d\'authentification"</string>
<string name="wifi_cant_connect" msgid="5718417542623056783">"Connexion impossible"</string>
<string name="wifi_cant_connect_to_ap" msgid="3099667989279700135">"Impossible de se connecter au réseau \"<xliff:g id="AP_NAME">%1$s</xliff:g>\""</string>
<string name="wifi_check_password_try_again" msgid="8817789642851605628">"Vérifiez le mot de passe et réessayez"</string>
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"Application active. Appuyez ici pour la désactiver."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"État de mise en veille de l\'application : <xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"Paramètres de transcodage des contenus multimédias"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"Désactiver le transcodage"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"Ignorer les paramètres de transcodage par défaut"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"Activer le transcodage"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"Supposer que les applications sont compatibles avec les formats modernes"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"Activer le transcodage pour les applications"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"Services en cours d\'exécution"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"Afficher et contrôler les services en cours d\'exécution"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> – <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"<xliff:g id="TIME">%1$s</xliff:g> jusqu\'à ce que la batterie soit chargée"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="TIME">%2$s</xliff:g> jusqu\'à la charge complète"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> - Batterie limitée temporairement"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> - Optimisation pour préserver batterie"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"Inconnu"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"Batterie en charge"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"Charge rapide"</string>
diff --git a/packages/SettingsLib/res/values-gl/strings.xml b/packages/SettingsLib/res/values-gl/strings.xml
index b040817b2801..c43925375a2b 100644
--- a/packages/SettingsLib/res/values-gl/strings.xml
+++ b/packages/SettingsLib/res/values-gl/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"Aplicación activa. Toca para alternar a configuración."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"Estado en espera da aplicación: <xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"Configuración de transcodificación de contido multimedia"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"Desactivar transcodificación"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"Anular valores predeterminados de transcodificación"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"Activar transcodificación"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"Considerar que as aplicacións admiten formatos modernos"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"Activar transcodificación para as aplicacións"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"Servizos en uso"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"Comproba e controla os servizos actualmente en uso"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"<xliff:g id="TIME">%1$s</xliff:g> para completar a carga"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g>: <xliff:g id="TIME">%2$s</xliff:g> para completar a carga"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> (batería limitada temporalmente)"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g>: optimizando para manter a batería en bo estado"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"Descoñecido"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"Cargando"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"Cargando rapidamente"</string>
diff --git a/packages/SettingsLib/res/values-gu/strings.xml b/packages/SettingsLib/res/values-gu/strings.xml
index c1bd7cac30a6..7dfdceeaf867 100644
--- a/packages/SettingsLib/res/values-gu/strings.xml
+++ b/packages/SettingsLib/res/values-gu/strings.xml
@@ -400,7 +400,12 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"સક્રિય. ટોગલ કરવા માટે ટૅપ કરો."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"ઍપ સ્ટૅન્ડબાયની સ્થિતિ:<xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"મીડિયાનું ફૉર્મેટ બદલવાની પ્રક્રિયાના સેટિંગ"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"ફૉર્મેટ બદલવાની પ્રક્રિયા બંધ કરો"</string>
+ <!-- no translation found for transcode_user_control (6176368544817731314) -->
+ <skip />
+ <!-- no translation found for transcode_enable_all (2411165920039166710) -->
+ <skip />
+ <!-- no translation found for transcode_default (3784803084573509491) -->
+ <skip />
<string name="transcode_skip_apps" msgid="8249721984597390142">"ઍપ માટે ફૉર્મેટ બદલવાની પ્રક્રિયા ચાલુ કરો"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"ચાલુ સેવાઓ"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"હાલમાં ચાલતી સેવાઓ જુઓ અને નિયંત્રિત કરો"</string>
@@ -449,7 +454,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"ચાર્જ થવામાં <xliff:g id="TIME">%1$s</xliff:g> બાકી છે"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> - ચાર્જ થવા માટે <xliff:g id="TIME">%2$s</xliff:g>"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> - બૅટરીનો વપરાશ હંગામી રૂપે મર્યાદિત છે"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> • બૅટરીની ક્ષમતા વધારવા ઑપ્ટિમાઇઝ કરી રહ્યાં છીએ"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"અજાણ્યું"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"ચાર્જ થઈ રહ્યું છે"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"ઝડપથી ચાર્જ થાય છે"</string>
diff --git a/packages/SettingsLib/res/values-hi/strings.xml b/packages/SettingsLib/res/values-hi/strings.xml
index d9153a1ab542..26d1a756318d 100644
--- a/packages/SettingsLib/res/values-hi/strings.xml
+++ b/packages/SettingsLib/res/values-hi/strings.xml
@@ -28,7 +28,7 @@
<string name="wifi_disabled_network_failure" msgid="2660396183242399585">"IP कॉन्‍फ़िगरेशन की विफलता"</string>
<string name="wifi_disabled_by_recommendation_provider" msgid="1302938248432705534">"खराब नेटवर्क होने के कारण कनेक्ट नहीं हुआ"</string>
<string name="wifi_disabled_wifi_failure" msgid="8819554899148331100">"वाईफ़ाई कनेक्‍शन विफलता"</string>
- <string name="wifi_disabled_password_failure" msgid="6892387079613226738">"प्रमाणीकरण समस्या"</string>
+ <string name="wifi_disabled_password_failure" msgid="6892387079613226738">"पुष्टि नहीं हो सकी"</string>
<string name="wifi_cant_connect" msgid="5718417542623056783">"कनेक्ट नहीं हो पा रहा है"</string>
<string name="wifi_cant_connect_to_ap" msgid="3099667989279700135">"\'<xliff:g id="AP_NAME">%1$s</xliff:g>\' से कनेक्ट नहीं हो पा रहा है"</string>
<string name="wifi_check_password_try_again" msgid="8817789642851605628">"पासवर्ड जाँचें और दोबारा कोशिश करें"</string>
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"सक्रिय. टॉगल करने के लिए टैप करें."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"ऐप्लिकेशन स्टैंडबाय की स्थिति:<xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"मीडिया ट्रांसकोडिंग सेटिंग"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"ट्रांसकोडिंग को बंद करें"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"ट्रांसकोडिंग की डिफ़ॉल्ट सेटिंग बदलें"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"ट्रांसकोडिंग चालू करें"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"मानकर चलें कि ऐप्लिकेशन, मॉडर्न फ़ॉर्मैट के साथ काम करेंगे"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"ऐप्लिकेशन के लिए ट्रांसकोडिंग चालू करें"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"चल रही सेवाएं"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"इस समय चल रही सेवाओं को देखें और नियंत्रित करें"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"चार्ज पूरा होने में <xliff:g id="TIME">%1$s</xliff:g> बचा है"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="TIME">%2$s</xliff:g> में पूरा चार्ज हो जाएगा"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> - कुछ समय के लिए, बैटरी का सीमित इस्तेमाल होगा"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> - बैटरी की परफ़ॉर्मेंस बेहतर करने के लिए, ऑप्टिमाइज़ किया जा रहा है"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"अज्ञात"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"चार्ज हो रही है"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"तेज़ चार्ज हो रही है"</string>
diff --git a/packages/SettingsLib/res/values-hr/strings.xml b/packages/SettingsLib/res/values-hr/strings.xml
index b51e096ca6b7..eccfd7ad56ba 100644
--- a/packages/SettingsLib/res/values-hr/strings.xml
+++ b/packages/SettingsLib/res/values-hr/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"Aktivno. Dodirnite da biste to promijenili."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"Stanje aplikacije u mirovanju: <xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"Postavke konvertiranja medija"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"Onemogućivanje konvertiranja"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"Nadjačaj zadane postavke konvertiranja"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"Omogući konvertiranje"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"Pretpostavi da aplikacije podržavaju moderne formate"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"Omogućivanje konvertiranja za aplikacije"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"Pokrenute usluge"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"Pregledajte i kontrolirajte pokrenute usluge"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> – <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"Napunit će se za <xliff:g id="TIME">%1$s</xliff:g>"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> – napunit će se za <xliff:g id="TIME">%2$s</xliff:g>"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> – Baterija je privremeno ograničena"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> – Optimiziranje radi zdravlja baterije"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"Nepoznato"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"Punjenje"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"Brzo punjenje"</string>
diff --git a/packages/SettingsLib/res/values-hu/strings.xml b/packages/SettingsLib/res/values-hu/strings.xml
index 33770fc1bdd8..e5d4bd15ce72 100644
--- a/packages/SettingsLib/res/values-hu/strings.xml
+++ b/packages/SettingsLib/res/values-hu/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"Bekapcsolva. Koppintson ide a váltáshoz."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"Alkalmazás készenléti állapota:<xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"Médiaátkódolási beállítások"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"Átkódolás letiltása"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"Az átkódolás alapértelmezett beállításainak felülbírálása"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"Átkódolás engedélyezése"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"Annak feltételezése, hogy az alkalmazások támogatják a modern formátumokat"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"Átkódolás engedélyezése az alkalmazásoknál"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"Futó szolgáltatások"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"A jelenleg futó szolgáltatások megtekintése és vezérlése"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> – <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"<xliff:g id="TIME">%1$s</xliff:g> van hátra a feltöltésből"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> – <xliff:g id="TIME">%2$s</xliff:g> a feltöltésig"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> – Akkumulátor ideiglenesen korlátozva"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> – Akkumulátor-élettartam optimalizálása"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"Ismeretlen"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"Töltés"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"Gyorstöltés"</string>
diff --git a/packages/SettingsLib/res/values-hy/strings.xml b/packages/SettingsLib/res/values-hy/strings.xml
index 06d70f854f27..53eb766e3b17 100644
--- a/packages/SettingsLib/res/values-hy/strings.xml
+++ b/packages/SettingsLib/res/values-hy/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"Ակտիվ է: Հպեք՝ փոխելու համար:"</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"Հավելվածի սպասման կարգավիճակ՝ <xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"Մեդիա ֆայլերի վերակոդավորման կարգավորումներ"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"Անջատել վերակոդավորումը"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"Չեղարկել վերակոդավորման կանխադրված կարգավորումները"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"Միացնել վերակոդավորումը"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"Ենթադրել, որ հավելվածներն աջակցում են ժամանակակից ձևաչափեր"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"Միացնել վերակոդավորումը հավելվածների համար"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"Աշխատող ծառայություններ"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"Դիտել և վերահսկել ընթացիկ աշխատող ծառայությունները"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"<xliff:g id="TIME">%1$s</xliff:g> մինչև լիցքավորումը"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> – <xliff:g id="TIME">%2$s</xliff:g> մինչև լիցքավորումը"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> – Մարտկոցը ժամանակավորապես սահմանափակված է"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> – Օպտիմալացվում է"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"Անհայտ"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"Լիցքավորում"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"Արագ լիցքավորում"</string>
diff --git a/packages/SettingsLib/res/values-in/strings.xml b/packages/SettingsLib/res/values-in/strings.xml
index 4123d9e3b755..edce3c5d7336 100644
--- a/packages/SettingsLib/res/values-in/strings.xml
+++ b/packages/SettingsLib/res/values-in/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"Aktif. Ketuk untuk beralih."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"Status standby aplikasi:<xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"Setelan transcoding media"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"Menonaktifkan transcoding"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"Ganti default transcoding"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"Aktifkan transcoding"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"Asumsikan aplikasi mendukung format modern"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"Mengaktifkan transcoding untuk aplikasi"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"Layanan yang sedang berjalan"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"Melihat dan mengontrol layanan yang sedang berjalan"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"Sisa <xliff:g id="TIME">%1$s</xliff:g> hingga terisi penuh"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="TIME">%2$s</xliff:g> lagi terisi penuh"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> - Daya baterai terbatas untuk sementara"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> - Mengoptimalkan untuk kesehatan baterai"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"Tidak diketahui"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"Mengisi daya"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"Mengisi daya cepat"</string>
diff --git a/packages/SettingsLib/res/values-is/strings.xml b/packages/SettingsLib/res/values-is/strings.xml
index 3b9bef872177..9e072ccdc8f7 100644
--- a/packages/SettingsLib/res/values-is/strings.xml
+++ b/packages/SettingsLib/res/values-is/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"Virkt. Ýttu til að breyta."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"Biðstaða forrits: <xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"Stillingar efnisumkóðunar"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"Slökkva á umkóðun"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"Hnekkja sjálfgefinni umkóðun"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"Kveikja á umkóðun"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"Gera ráð fyrir að forrit styðji nútímasnið"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"Kveikja á umkóðun í forritum"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"Þjónustur í gangi"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"Skoða og stjórna þjónustum í gangi"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> – <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"<xliff:g id="TIME">%1$s</xliff:g> að fullri hleðslu"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="TIME">%2$s</xliff:g> að fullri hleðslu"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> - Rafhlaða takmörkuð tímabundið"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> – Fínstillir fyrir rafhlöðuendingu"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"Óþekkt"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"Í hleðslu"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"Hröð hleðsla"</string>
diff --git a/packages/SettingsLib/res/values-it/strings.xml b/packages/SettingsLib/res/values-it/strings.xml
index 1ab6b24456f3..fc87d89b915d 100644
--- a/packages/SettingsLib/res/values-it/strings.xml
+++ b/packages/SettingsLib/res/values-it/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"Attiva. Tocca per attivare/disattivare."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"Stato di standby dell\'app: <xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"Impostazioni transcodifica contenuti multimediali"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"Disattiva transcodifica"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"Sostituisci impostazioni predefinite transcodifica"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"Attiva transcodifica"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"Presupponi che le app supportino i formati moderni"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"Attiva transcodifica per le app"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"Servizi in esecuzione"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"Visualizza e controlla i servizi attualmente in esecuzione"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"Tempo rimanente alla carica completa: <xliff:g id="TIME">%1$s</xliff:g>"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="TIME">%2$s</xliff:g> alla carica completa"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> - Batteria momentaneamente limitata"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> - Ottimizzazione per integrità batteria"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"Sconosciuta"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"In carica"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"Ricarica veloce"</string>
diff --git a/packages/SettingsLib/res/values-iw/strings.xml b/packages/SettingsLib/res/values-iw/strings.xml
index 15868d5fc997..b899b594e784 100644
--- a/packages/SettingsLib/res/values-iw/strings.xml
+++ b/packages/SettingsLib/res/values-iw/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"אפליקציה פעילה. הקש כדי להחליף מצב."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"אפליקציה במצב המתנה:<xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"הגדרות של המרת קידוד למדיה"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"השבתה של המרת קידוד"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"ביטול ברירות המחדל של המרת קידוד"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"הפעלת המרת קידוד"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"הנחת העבודה היא שאפליקציות תומכות בפורמטים מודרניים"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"הפעלה של המרת קידוד לאפליקציות"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"שירותים פועלים"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"הצגת השירותים הפועלים כעת ושליטה בהם"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g>‏ - <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"נשארו <xliff:g id="TIME">%1$s</xliff:g> עד הטעינה"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="TIME">%2$s</xliff:g> עד הטעינה"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> - הסוללה מוגבלת באופן זמני"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> ﹣ מופעל מיטוב לשמירה על תקינות הסוללה"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"לא ידוע"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"בטעינה"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"הסוללה נטענת מהר"</string>
diff --git a/packages/SettingsLib/res/values-ja/strings.xml b/packages/SettingsLib/res/values-ja/strings.xml
index 89ee98eeeb42..ded207d325a3 100644
--- a/packages/SettingsLib/res/values-ja/strings.xml
+++ b/packages/SettingsLib/res/values-ja/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"有効です。タップすると切り替わります。"</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"アプリ スタンバイ状態: <xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"メディアのコード変換設定"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"コード変換を無効にする"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"デフォルトのコード変換をオーバーライド"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"コード変換を有効にする"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"アプリによる最新形式のサポートを想定"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"アプリに対しコード変換を有効にする"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"実行中のサービス"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"現在実行中のサービスを表示して制御する"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"充電完了まであと <xliff:g id="TIME">%1$s</xliff:g>"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> - 充電完了まで <xliff:g id="TIME">%2$s</xliff:g>"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> - 電池の使用が一時的に制限されています"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> - 電池の状態を最適化"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"不明"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"充電中"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"急速充電中"</string>
diff --git a/packages/SettingsLib/res/values-ka/strings.xml b/packages/SettingsLib/res/values-ka/strings.xml
index d1885789779a..2d89dc65cb60 100644
--- a/packages/SettingsLib/res/values-ka/strings.xml
+++ b/packages/SettingsLib/res/values-ka/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"აქტიური. შეეხეთ გადასართავად."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"აპის მოლოდინის რეჟიმის მდგომარეობა:<xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"მედიის ტრანსკოდირების პარამეტრები"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"ტრანსკოდირების გათიშვა"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"ტრანსკოდირების ნაგულისხმევების უგულებელყოფა"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"ტრანსკოდირების ჩართვა"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"დაშვება, რომ აპებს აქვთ თანამედროვე ფორმატების მხარდაჭერა"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"ტრანსკოდირების ჩართვა აპებისთვის"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"მიმდინარე სერვისები"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"ამჟამად მოქმედი სერვისების ნახვა და მართვა"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"დატენვამდე დარჩა <xliff:g id="TIME">%1$s</xliff:g>"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="TIME">%2$s</xliff:g> დატენვამდე"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> — ბატარეა დროებით შეზღუდულია"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> — ოპტიმიზაცია ბატარეის გამართულობისთვის"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"უცნობი"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"იტენება"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"სწრაფად იტენება"</string>
diff --git a/packages/SettingsLib/res/values-kk/strings.xml b/packages/SettingsLib/res/values-kk/strings.xml
index 2bc1c4d20728..fa99529f84d4 100644
--- a/packages/SettingsLib/res/values-kk/strings.xml
+++ b/packages/SettingsLib/res/values-kk/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"Белсенді. Ауыстырып қосу үшін түртіңіз."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"Қолданбаның күту режимі: <xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"Медиамазмұнды қайта кодтау параметрлері"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"Қайта кодтауды өшіру"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"Қайта қодтаудың әдепкі параметрлерін қайта анықтау"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"Қайта кодтауды қосу"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"Қолданбалар қазіргі заманғы форматтарды қолдайды делік"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"Қолданбалар үшін қайта кодтауға рұқсат ету"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"Қосылып тұрған қызметтер"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"Қазір істеп тұрған қызметтерді көру және басқару"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"Зарядталғанға дейін <xliff:g id="TIME">%1$s</xliff:g> қалды"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> – зарядталғанға дейін <xliff:g id="TIME">%2$s</xliff:g>"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> - Батарея жұмысы уақытша шектелген"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> - Батареяның жұмыс істеу қабілеті оңтайландырылуда"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"Белгісіз"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"Зарядталуда"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"Жылдам зарядталуда"</string>
diff --git a/packages/SettingsLib/res/values-km/strings.xml b/packages/SettingsLib/res/values-km/strings.xml
index 7306cf8c5d3f..a2b5e014937e 100644
--- a/packages/SettingsLib/res/values-km/strings.xml
+++ b/packages/SettingsLib/res/values-km/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"សកម្ម។ ប៉ះដើម្បីបិទ/បើក។"</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"ស្ថាន​ភាព​មុខងារ​ផ្អាក​ដំណើរការ​កម្មវិធី៖<xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"ការកំណត់​ការបំប្លែង​កូដមេឌៀ"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"បិទ​ការបំប្លែងកូដ"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"លុបពីលើលំនាំដើម​នៃការបំប្លែងកូដ"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"បើក​ការបំប្លែងកូដ"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"សន្មតថាកម្មវិធី​អាចប្រើ​ទម្រង់ទំនើបបាន"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"បើក​ការបំប្លែងកូដ​សម្រាប់​កម្មវិធី"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"សេវាកម្ម​កំពុង​ដំណើរការ"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"មើល និង​គ្រប់គ្រង​សេវាកម្ម​កំពុង​ដំណើរការ​បច្ចុប្បន្ន"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"<xliff:g id="TIME">%1$s</xliff:g> ទៀតទើបសាកថ្មពេញ"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="TIME">%2$s</xliff:g> ទៀតទើប​សាកថ្មពេញ"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> - បានដាក់កម្រិតថ្ម​ជាបណ្ដោះអាសន្ន"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> - កំពុងបង្កើនប្រសិទ្ធភាព​គុណភាពថ្ម"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"មិន​ស្គាល់"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"កំពុងបញ្ចូល​ថ្ម"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"កំពុងសាកថ្មយ៉ាងឆាប់រហ័ស"</string>
diff --git a/packages/SettingsLib/res/values-kn/strings.xml b/packages/SettingsLib/res/values-kn/strings.xml
index 0c1502ca620d..f37cf8be13f5 100644
--- a/packages/SettingsLib/res/values-kn/strings.xml
+++ b/packages/SettingsLib/res/values-kn/strings.xml
@@ -400,7 +400,12 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"ಸಕ್ರಿಯ. ಟಾಗಲ್ ಮಾಡಲು ಟ್ಯಾಪ್ ಮಾಡಿ."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"ಅಪ್ಲಿಕೇಶನ್ ಸ್ಟ್ಯಾಂಡ್‌ಬೈ ಸ್ಥಿತಿ:<xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"ಮೀಡಿಯಾ ಟ್ರಾನ್ಸ್‌ಕೋಡಿಂಗ್ ಸೆಟ್ಟಿಂಗ್‌ಗಳು"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"ಟ್ರಾನ್ಸ್‌ಕೋಡಿಂಗ್ ಅನ್ನು ನಿಷ್ಕ್ರಿಯಗೊಳಿಸಿ"</string>
+ <!-- no translation found for transcode_user_control (6176368544817731314) -->
+ <skip />
+ <!-- no translation found for transcode_enable_all (2411165920039166710) -->
+ <skip />
+ <!-- no translation found for transcode_default (3784803084573509491) -->
+ <skip />
<string name="transcode_skip_apps" msgid="8249721984597390142">"ಆ್ಯಪ್‌ಗಳಿಗಾಗಿ ಟ್ರಾನ್ಸ್‌ಕೋಡಿಂಗ್ ಅನ್ನು ಸಕ್ರಿಯಗೊಳಿಸಿ"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"ರನ್‌ ಆಗುತ್ತಿರುವ ಸೇವೆಗಳು"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"ಈಗ ರನ್‌ ಆಗುತ್ತಿರುವ ಸೇವೆಗಳನ್ನು ವೀಕ್ಷಿಸಿ ಮತ್ತು ನಿಯಂತ್ರಿಸಿ"</string>
@@ -449,7 +454,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"ಚಾರ್ಜ್ ಆಗಲು <xliff:g id="TIME">%1$s</xliff:g> ಸಮಯ ಬಾಕಿ ಇದೆ"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> - ಚಾರ್ಜ್ ಆಗಲು <xliff:g id="TIME">%2$s</xliff:g> ಸಮಯ ಬೇಕು"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> - ಬ್ಯಾಟರಿ ತಾತ್ಕಾಲಿಕವಾಗಿ ಸೀಮಿತವಾಗಿದೆ"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> - ಬ್ಯಾಟರಿಯ ಆರೋಗ್ಯಕ್ಕಾಗಿ ಆಪ್ಟಿಮೈಸ್ ಮಾಡಲಾಗುತ್ತಿದೆ"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"ಅಪರಿಚಿತ"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"ಚಾರ್ಜ್ ಆಗುತ್ತಿದೆ"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"ವೇಗದ ಚಾರ್ಜಿಂಗ್"</string>
diff --git a/packages/SettingsLib/res/values-ko/strings.xml b/packages/SettingsLib/res/values-ko/strings.xml
index 13223440d098..73921c29815f 100644
--- a/packages/SettingsLib/res/values-ko/strings.xml
+++ b/packages/SettingsLib/res/values-ko/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"활성화되었습니다. 전환하려면 탭하세요."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"앱 대기 상태:<xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"미디어 트랜스코딩 설정"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"트랜스코딩 사용 중지"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"트랜스코딩 기본값 재정의"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"트랜스코딩 사용"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"앱이 최신 형식을 지원하는 것으로 가정"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"앱 트랜스코딩 사용 설정"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"실행 중인 서비스"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"현재 실행 중인 서비스 보기 및 제어"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"충전 완료까지 <xliff:g id="TIME">%1$s</xliff:g> 남음"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> - 충전 완료까지 <xliff:g id="TIME">%2$s</xliff:g> 남음"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> - 일시적으로 배터리 사용 제한"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> - 배터리 상태 최적화 중"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"알 수 없음"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"충전 중"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"고속 충전 중"</string>
diff --git a/packages/SettingsLib/res/values-ky/strings.xml b/packages/SettingsLib/res/values-ky/strings.xml
index 9697aa70e44f..5e978ba7ac1b 100644
--- a/packages/SettingsLib/res/values-ky/strings.xml
+++ b/packages/SettingsLib/res/values-ky/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"Иштеп турат. Өчүрүү үчүн басып коюңуз."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"Көшүү режиминдеги колдонмонун абалы:<xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"Медиа файлдарды транскоддоо жөндөөлөрү"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"Транскоддоону өчүрүү"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"Демейки жүргүзүлгөн транскоддоону өзгөртүп коюу"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"Транскоддоо жүргүзүүнү иштетүү"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"Колдонмолордо заманбап форматтар колдоого алынат"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"Колдонмолорду транскоддоону күйгүзүү"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"Иштеп жаткан кызматтар"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"Учурда иштеп жаткан кызматтарды көрүп, көзөмөлдөп турасыз"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"<xliff:g id="TIME">%1$s</xliff:g> кийин толук кубатталып бүтөт"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="TIME">%2$s</xliff:g> кийин толук кубатталып бүтөт"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> - Батареяны колдонуу убактлуу чектелген"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> - Батареянын кубатын үнөмдөө иштетилди"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"Белгисиз"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"Кубатталууда"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"Ыкчам кубатталууда"</string>
diff --git a/packages/SettingsLib/res/values-lo/strings.xml b/packages/SettingsLib/res/values-lo/strings.xml
index 720122262dcf..498cb25d96ff 100644
--- a/packages/SettingsLib/res/values-lo/strings.xml
+++ b/packages/SettingsLib/res/values-lo/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"ນຳໃຊ້ຢູ່. ແຕະເພື່ອສັບປ່ຽນ."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"ສະຖານະສະແຕນບາຍແອັບ:<xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"ການຕັ້ງຄ່າການປ່ຽນຮູບແບບລະຫັດມີເດຍ"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"ປິດການນຳໃຊ້ການປ່ຽນຮູບແບບລະຫັດ"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"ຍົກເລີກຄ່າເລີ່ມຕົ້ນການ​ປ່ຽນ​ຮູບ​ແບບ​ລະ​ຫັດ"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"ເປີດການນຳໃຊ້ການ​ປ່ຽນ​ຮູບ​ແບບ​ລະ​ຫັດ"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"ສົມມຸດວ່າແອັບຮອງຮັບຮູບແບບສະໄໝໃໝ່"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"ເປີດການນຳໃຊ້ການປ່ຽນຮູບແບບລະຫັດສຳລັບແອັບ"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"ບໍລິການທີ່ເຮັດວຽກຢູ່"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"ເບິ່ງ ແລະຈັດການບໍລິການທີ່ກຳລັງເຮັດວຽກຢູ່ໃນປັດຈຸບັນ"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"<xliff:g id="TIME">%1$s</xliff:g> ຈົນກວ່າຈະສາກເຕັມ"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="TIME">%2$s</xliff:g> ຈົນກວ່າຈະສາກເຕັມ"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> - ຈຳກັດແບັດເຕີຣີຊົ່ວຄາວ"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> - ກຳລັງເພີ່ມປະສິດທິພາບເພື່ອສຸຂະພາບແບັດເຕີຣີ"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"ບໍ່ຮູ້ຈັກ"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"ກຳລັງສາກໄຟ"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"ກຳລັງສາກໄຟດ່ວນ"</string>
diff --git a/packages/SettingsLib/res/values-lt/strings.xml b/packages/SettingsLib/res/values-lt/strings.xml
index e62eeb2dbd97..c077268f3fad 100644
--- a/packages/SettingsLib/res/values-lt/strings.xml
+++ b/packages/SettingsLib/res/values-lt/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"Aktyvi. Palieskite, kad perjungtumėte."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"Programų budėjimo režimo būsena: <xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"Medijos perkodavimo nustatymai"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"Išjungti perkodavimą"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"Perkodavimo numatytųjų nustatymų nepaisymas"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"Perkodavimo įgalinimas"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"Manoma, kad programos palaiko modernius formatus"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"Įjungti programų perkodavimą"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"Vykdomos paslaugos"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"Žiūrėti ir valdyti dabar vykdomas paslaugas"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> – <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"Iki visiškos įkrovos liko <xliff:g id="TIME">%1$s</xliff:g>"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> – iki visiškos įkrovos liko <xliff:g id="TIME">%2$s</xliff:g>"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> – akumuliatorius laikinai apribotas"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> – optimizuoj. siekiant apsaugoti akum."</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"Nežinomas"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"Kraunasi..."</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"Greitai įkraunama"</string>
diff --git a/packages/SettingsLib/res/values-lv/strings.xml b/packages/SettingsLib/res/values-lv/strings.xml
index 2f305612a5fc..d5755511f032 100644
--- a/packages/SettingsLib/res/values-lv/strings.xml
+++ b/packages/SettingsLib/res/values-lv/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"Aktīva. Pieskarieties, lai pārslēgtu."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"Lietotnes gaidstāves stāvoklis: <xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"Multivides failu pārkodēšanas iestatījumi"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"Atspējot pārkodēšanu"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"Ignorēt pārkodēšanas noklusējuma iestatījumus"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"Iespējot pārkodēšanu"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"Pieņemt, ka lietotnēs tiek atbalstīti moderni formāti"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"Iespējot pārkodēšanu noteiktām lietotnēm"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"Aktīvie pakalpojumi"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"Pašreiz darbojošos pakalpojumu skatīšana un vadība"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> — <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"Vēl <xliff:g id="TIME">%1$s</xliff:g> līdz pilnai uzlādei"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> — <xliff:g id="TIME">%2$s</xliff:g> līdz pilnai uzlādei"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g>, akumulatora uzlāde pagaidām ierobežota"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g>: akumulatora darbības optimizēšana"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"Nezināms"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"Uzlāde"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"Notiek ātrā uzlāde"</string>
diff --git a/packages/SettingsLib/res/values-mk/strings.xml b/packages/SettingsLib/res/values-mk/strings.xml
index 1936fe2d32a4..21dcb0285557 100644
--- a/packages/SettingsLib/res/values-mk/strings.xml
+++ b/packages/SettingsLib/res/values-mk/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"Активно. Допрете за да смените."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"Состојба на мирување на апликацијата: <xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"Поставки за транскодирање аудиовизуелни содржини"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"Оневозможи транскодирање"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"Отфрли стандардни вредности за транскодирање"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"Овозможи транскодирање"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"Претпостави дека апликациите поддржуваат модерни формати"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"Овозможете транскодирање за апликациите"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"Активни услуги"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"Погледнете и контролирајте услуги што се моментално активни"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> – <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"Уште <xliff:g id="TIME">%1$s</xliff:g> до целосно полнење"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="TIME">%2$s</xliff:g> до целосно полнење"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> - Батеријата е привремено ограничена"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> - Се оптимизира за состојба на батерија"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"Непознато"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"Се полни"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"Брзо полнење"</string>
diff --git a/packages/SettingsLib/res/values-ml/strings.xml b/packages/SettingsLib/res/values-ml/strings.xml
index de4a49a2ed06..97c22d569775 100644
--- a/packages/SettingsLib/res/values-ml/strings.xml
+++ b/packages/SettingsLib/res/values-ml/strings.xml
@@ -400,7 +400,12 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"സജീവം. മാറ്റുന്നതിന് ടാപ്പുചെയ്യുക."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"ആപ്പ് സ്‌റ്റാൻഡ്‌ബൈ നില:<xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"മീഡിയ ട്രാൻസ്കോഡ് ചെയ്യൽ ക്രമീകരണം"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"ട്രാൻസ്കോഡ് ചെയ്യൽ പ്രവർത്തനരഹിതമാക്കുക"</string>
+ <!-- no translation found for transcode_user_control (6176368544817731314) -->
+ <skip />
+ <!-- no translation found for transcode_enable_all (2411165920039166710) -->
+ <skip />
+ <!-- no translation found for transcode_default (3784803084573509491) -->
+ <skip />
<string name="transcode_skip_apps" msgid="8249721984597390142">"ആപ്പുകൾക്കായി ട്രാൻസ്കോഡ് ചെയ്യുന്നത് പ്രവർത്തനക്ഷമമാക്കുക"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"പ്രവർത്തിക്കുന്ന സേവനങ്ങൾ"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"നിലവിൽ പ്രവർത്തിക്കുന്ന സേവനങ്ങൾ കാണുക, നിയന്ത്രിക്കുക"</string>
@@ -449,7 +454,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"പൂർണ്ണമായി ചാർജാവാൻ <xliff:g id="TIME">%1$s</xliff:g> ശേഷിക്കുന്നു"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> - പൂർണ്ണമായി ചാർജാവാൻ <xliff:g id="TIME">%2$s</xliff:g>"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> - ബാറ്ററി താൽക്കാലം പരിമിതപ്പെടുത്തി"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> - ബാറ്ററി നില ഒപ്റ്റിമൈസ് ചെയ്യുന്നു"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"അജ്ഞാതം"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"ചാർജ് ചെയ്യുന്നു"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"അതിവേഗ ചാർജിംഗ്"</string>
diff --git a/packages/SettingsLib/res/values-mn/strings.xml b/packages/SettingsLib/res/values-mn/strings.xml
index dee8add685f9..8d1cc3391c5a 100644
--- a/packages/SettingsLib/res/values-mn/strings.xml
+++ b/packages/SettingsLib/res/values-mn/strings.xml
@@ -28,7 +28,7 @@
<string name="wifi_disabled_network_failure" msgid="2660396183242399585">"IP тохируулга амжилтгүй"</string>
<string name="wifi_disabled_by_recommendation_provider" msgid="1302938248432705534">"Сүлжээний чанар муу байгаа тул холбогдож чадсангүй"</string>
<string name="wifi_disabled_wifi_failure" msgid="8819554899148331100">"WiFi холболт амжилтгүй"</string>
- <string name="wifi_disabled_password_failure" msgid="6892387079613226738">"Гэрчлэлийн асуудал"</string>
+ <string name="wifi_disabled_password_failure" msgid="6892387079613226738">"Баталгаажуулалтын асуудал"</string>
<string name="wifi_cant_connect" msgid="5718417542623056783">"Холбогдож чадсангүй"</string>
<string name="wifi_cant_connect_to_ap" msgid="3099667989279700135">"\'<xliff:g id="AP_NAME">%1$s</xliff:g>\'-д холбогдож чадсангүй"</string>
<string name="wifi_check_password_try_again" msgid="8817789642851605628">"Нууц үгийг шалгаад дахин оролдоно уу"</string>
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"Идэвхтэй байна. Унтраах/асаахын тулд дарна уу."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"Апп зогсолтын горимын төлөв:<xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"Медиа хөрвүүлгийн тохиргоо"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"Хөрвүүлгийг идэвхгүй болгох"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"Хөрвүүлгийн өгөгдмөлийг дарах"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"Хөрвүүлгийг идэвхжүүлэх"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"Аппыг орчин үеийн форматыг дэмждэг гэж үздэг"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"Аппуудад хөрвүүлгийг идэвхжүүлэх"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"Ажиллаж байгаа үйлчилгээнүүд"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"Одоо ажиллаж байгаа үйлчилгээнүүдийг харах болон хянах"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"Цэнэглэх хүртэл үлдсэн <xliff:g id="TIME">%1$s</xliff:g>"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> - цэнэглэх хүртэл <xliff:g id="TIME">%2$s</xliff:g>"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> - Батарейг түр хугацаанд хязгаарласан"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> - Батарейн чанарыг оновчилж байна"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"Тодорхойгүй"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"Цэнэглэж байна"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"Хурдан цэнэглэж байна"</string>
@@ -534,7 +536,7 @@
<string name="user_add_user_item_title" msgid="2394272381086965029">"Хэрэглэгч"</string>
<string name="user_add_profile_item_title" msgid="3111051717414643029">"Хязгаарлагдсан профайл"</string>
<string name="user_add_user_title" msgid="5457079143694924885">"Шинэ хэрэглэгч нэмэх үү?"</string>
- <string name="user_add_user_message_long" msgid="1527434966294733380">"Та нэмэлт хэрэглэгч үүсгэх замаар бусад хүмүүстэй энэ төхөөрөмжийг хуваалцаж болно. Хэрэглэгч тус бүр апп, ханын цаас болон бусад зүйлээ өөрчлөх боломжтой хувийн орон зайтай байдаг. Түүнчлэн хэрэглэгч нь бүх хэрэглэгчид нөлөөлөх боломжтой Wi-Fi зэрэг төхөөрөмжийн тохиргоог өөрчлөх боломжтой.\n\nХэрэв та шинэ хэрэглэгч нэмэх бол тухайн хүн хувийн орон зайгаа бүрдүүлэх ёстой.\n\nХэрэглэгч бүр бусад бүх хэрэглэгчийн өмнөөс апп шинэчилж болно. Хүртээмжийн тохиргоо болон үйлчилгээг шинэ хэрэглэгчид шилжүүлэх боломжгүй байж болзошгүй."</string>
+ <string name="user_add_user_message_long" msgid="1527434966294733380">"Та нэмэлт хэрэглэгч үүсгэх замаар бусад хүмүүстэй энэ төхөөрөмжийг хуваалцаж болно. Хэрэглэгч тус бүр апп, дэлгэцийн зураг болон бусад зүйлээ өөрчлөх боломжтой хувийн орон зайтай байдаг. Түүнчлэн хэрэглэгч нь бүх хэрэглэгчид нөлөөлөх боломжтой Wi-Fi зэрэг төхөөрөмжийн тохиргоог өөрчлөх боломжтой.\n\nХэрэв та шинэ хэрэглэгч нэмэх бол тухайн хүн хувийн орон зайгаа бүрдүүлэх ёстой.\n\nХэрэглэгч бүр бусад бүх хэрэглэгчийн өмнөөс апп шинэчилж болно. Хүртээмжийн тохиргоо болон үйлчилгээг шинэ хэрэглэгчид шилжүүлэх боломжгүй байж болзошгүй."</string>
<string name="user_add_user_message_short" msgid="3295959985795716166">"Та шинэ хэрэглэгч нэмбэл тухайн хүн өөрийн профайлыг тохируулах шаардлагатай.\n\nАль ч хэрэглэгч бүх хэрэглэгчийн апп-уудыг шинэчлэх боломжтой."</string>
<string name="user_setup_dialog_title" msgid="8037342066381939995">"Хэрэглэгчийг одоо тохируулах уу?"</string>
<string name="user_setup_dialog_message" msgid="269931619868102841">"Хэрэглэгч төхөөрөмжийг авч өөрийн профайлыг тохируулах боломжтой эсэхийг шалгана уу"</string>
diff --git a/packages/SettingsLib/res/values-mr/strings.xml b/packages/SettingsLib/res/values-mr/strings.xml
index 60ad68e42c09..c20888ea0af2 100644
--- a/packages/SettingsLib/res/values-mr/strings.xml
+++ b/packages/SettingsLib/res/values-mr/strings.xml
@@ -400,7 +400,12 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"सक्रिय. टॉगल करण्यासाठी टॅप करा."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"अ‍ॅप स्टँडबाय स्थिती: <xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"मीडिया ट्रान्सकोडिंगची सेटिंग्ज"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"ट्रान्सकोडिंग बंद करा"</string>
+ <!-- no translation found for transcode_user_control (6176368544817731314) -->
+ <skip />
+ <!-- no translation found for transcode_enable_all (2411165920039166710) -->
+ <skip />
+ <!-- no translation found for transcode_default (3784803084573509491) -->
+ <skip />
<string name="transcode_skip_apps" msgid="8249721984597390142">"ॲप्ससाठी ट्रान्सकोडिंग सुरू करा"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"सुरू सेवा"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"सध्या सुरू असलेल्या सेवा पहा आणि नियंत्रित करा"</string>
@@ -449,7 +454,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"<xliff:g id="TIME">%1$s</xliff:g> पर्यंत पूर्ण चार्ज होईल"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="TIME">%2$s</xliff:g> पर्यंत पूर्ण चार्ज होईल"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> - बॅटरी तात्पुरती मर्यादित आहे"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> - बॅटरीची क्षमता वाढवण्यासाठी ऑप्टिमाइझ करत आहे"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"अज्ञात"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"चार्ज होत आहे"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"वेगाने चार्ज होत आहे"</string>
diff --git a/packages/SettingsLib/res/values-ms/strings.xml b/packages/SettingsLib/res/values-ms/strings.xml
index e4d591207937..76840a52b0a2 100644
--- a/packages/SettingsLib/res/values-ms/strings.xml
+++ b/packages/SettingsLib/res/values-ms/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"Aktif. Ketik untuk menogol."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"Keadaan tunggu sedia apl:<xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"Tetapan transpengekodan media"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"Lumpuhkan transpengekodan"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"Batalkan transpengekodan lalai"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"Dayakan transpengekodan"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"Mengambil alih sokongan apl format moden"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"Dayakan transpengekodan untuk apl"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"Perkhidmatan dijalankan"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"Lihat dan kawal perkhidmatan yang sedang dijalankan"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"<xliff:g id="TIME">%1$s</xliff:g> lagi sehingga dicas penuh"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="TIME">%2$s</xliff:g> sehingga dicas"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> - Bateri terhad untuk sementara"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> - Pengoptimuman untuk kesihatan bateri"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"Tidak diketahui"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"Mengecas"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"Mengecas dgn cepat"</string>
diff --git a/packages/SettingsLib/res/values-my/strings.xml b/packages/SettingsLib/res/values-my/strings.xml
index 09a8bf87700b..377e49da5031 100644
--- a/packages/SettingsLib/res/values-my/strings.xml
+++ b/packages/SettingsLib/res/values-my/strings.xml
@@ -28,7 +28,7 @@
<string name="wifi_disabled_network_failure" msgid="2660396183242399585">"IP ပြုပြင်ခြင်း မအောင်မြင်ပါ"</string>
<string name="wifi_disabled_by_recommendation_provider" msgid="1302938248432705534">"ကွန်ရက်ချိတ်ဆက်မှု အားနည်းသည့်အတွက် ချိတ်ဆက်ထားခြင်း မရှိပါ"</string>
<string name="wifi_disabled_wifi_failure" msgid="8819554899148331100">"WiFi ချိတ်ဆက်မှု မအောင်မြင်ပါ"</string>
- <string name="wifi_disabled_password_failure" msgid="6892387079613226738">"စစ်မှန်ကြောင်းအတည်ပြုရန်၌ ပြသနာရှိခြင်း"</string>
+ <string name="wifi_disabled_password_failure" msgid="6892387079613226738">"အထောက်အထားစိစစ်မှု ပြဿနာ"</string>
<string name="wifi_cant_connect" msgid="5718417542623056783">"ချိတ်ဆက်၍ မရပါ"</string>
<string name="wifi_cant_connect_to_ap" msgid="3099667989279700135">"\'<xliff:g id="AP_NAME">%1$s</xliff:g>\' နှင့် ချိတ်ဆက်၍ မရပါ"</string>
<string name="wifi_check_password_try_again" msgid="8817789642851605628">"စကားဝှက်ကို စစ်ဆေးပြီး ထပ်လုပ်ကြည့်ပါ"</string>
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"ပွင့်နေသည်။ ပြောင်းရန်တို့ပါ။"</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"အက်ပ်ကို အရန်သင့်ထားရှိခြင်း အခြေအနေ-<xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"မီဒီယာအမျိုးအစားပြောင်းခြင်း ဆက်တင်များ"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"အမျိုးအစားပြောင်းခြင်းကို ပိတ်ရန်"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"အမျိုးအစားပြောင်းခြင်း၏ မူရင်းဆက်တင်များကို အစားထိုးရန်"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"အမျိုးအစားပြောင်းခြင်းကို ဖွင့်ရန်"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"ဤအက်ပ်များက ဖော်မက်အသစ်များကို ပံ့ပိုးသည်"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"အက်ပ်များအတွက် အမျိုးအစားပြောင်းခြင်းကို ဖွင့်ရန်"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"အလုပ်လုပ်နေသောဝန်ဆောင်မှုများ"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"လက်ရှိ ဝန်ဆောင်မှုများကို ကြည့်ရှု ထိန်းသိမ်းသည်"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"အားပြည့်ရန် <xliff:g id="TIME">%1$s</xliff:g> ကျန်သည်"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> - အားပြည့်ရန် <xliff:g id="TIME">%2$s</xliff:g> ကျန်သည်"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> - ဘက်ထရီ ယာယီကန့်သတ်ထားသည်"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> - ဘက်ထရီအခြေအနေကို အကောင်းဆုံးဖြစ်အောင် လုပ်နေသည်"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"မသိ"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"အားသွင်းနေပါသည်"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"အမြန် အားသွင်းနေသည်"</string>
diff --git a/packages/SettingsLib/res/values-nb/strings.xml b/packages/SettingsLib/res/values-nb/strings.xml
index d1af28940f1b..db931218567f 100644
--- a/packages/SettingsLib/res/values-nb/strings.xml
+++ b/packages/SettingsLib/res/values-nb/strings.xml
@@ -34,7 +34,7 @@
<string name="wifi_check_password_try_again" msgid="8817789642851605628">"Sjekk passordet og prøv igjen"</string>
<string name="wifi_not_in_range" msgid="1541760821805777772">"Utenfor område"</string>
<string name="wifi_no_internet_no_reconnect" msgid="821591791066497347">"Kobler ikke til automatisk"</string>
- <string name="wifi_no_internet" msgid="1774198889176926299">"Ingen Internett-tilgang"</string>
+ <string name="wifi_no_internet" msgid="1774198889176926299">"Ingen internettilgang"</string>
<string name="saved_network" msgid="7143698034077223645">"Lagret av <xliff:g id="NAME">%1$s</xliff:g>"</string>
<string name="connected_via_network_scorer" msgid="7665725527352893558">"Automatisk tilkoblet via %1$s"</string>
<string name="connected_via_network_scorer_default" msgid="7973529709744526285">"Automatisk tilkoblet via leverandør av nettverksvurdering"</string>
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"Aktiv. Trykk for å slå av/på."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"Hvilemodus:<xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"Innstillinger for omkoding av medier"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"Deaktiver omkoding"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"Overstyr omkodingsstandarder"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"Slå på omkoding"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"Anta at apper støtter moderne formater"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"Aktiver omkoding for apper"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"Aktive tjenester"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"Se og kontrollér tjenester som kjører"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> – <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"<xliff:g id="TIME">%1$s</xliff:g> til batteriet er fulladet"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> – <xliff:g id="TIME">%2$s</xliff:g> til batteriet er fulladet"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> – Batteriet er midlertidig begrenset"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> – Optimaliserer batteritilstanden"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"Ukjent"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"Lader"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"Lader raskt"</string>
diff --git a/packages/SettingsLib/res/values-ne/strings.xml b/packages/SettingsLib/res/values-ne/strings.xml
index 0c6114b9e220..25a2919f0958 100644
--- a/packages/SettingsLib/res/values-ne/strings.xml
+++ b/packages/SettingsLib/res/values-ne/strings.xml
@@ -400,7 +400,12 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"सक्रिय। टगल गर्न ट्याप गर्नुहोस्।"</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"एपको स्ट्यान्डबाई अवस्था:<xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"मिडिया ट्रान्सकोडिङ सेटिङ"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"ट्रान्सकोडिङ अफ गर्नुहोस्"</string>
+ <!-- no translation found for transcode_user_control (6176368544817731314) -->
+ <skip />
+ <!-- no translation found for transcode_enable_all (2411165920039166710) -->
+ <skip />
+ <!-- no translation found for transcode_default (3784803084573509491) -->
+ <skip />
<string name="transcode_skip_apps" msgid="8249721984597390142">"एपहरूमा ट्रान्सकोडिङ अन गर्नुहोस्"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"चलिरहेका सेवाहरू"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"हाल चालु भइरहेका सेवाहरू हेर्नुहोस् र नियन्त्रण गर्नुहोस्"</string>
@@ -449,7 +454,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"पूर्ण चार्ज हुन <xliff:g id="TIME">%1$s</xliff:g> बाँकी"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"पूर्ण चार्ज हुन <xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="TIME">%2$s</xliff:g> लाग्छ"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> - केही समयका लागि ब्याट्री प्रयोग सीमित गरिएको छ"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> - ब्याट्री लामो समयसम्म टिक्ने बनाउन अप्टिमाइज गरिँदै छ"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"अज्ञात"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"चार्ज हुँदै"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"द्रुत गतिमा चार्ज गरिँदै"</string>
diff --git a/packages/SettingsLib/res/values-nl/strings.xml b/packages/SettingsLib/res/values-nl/strings.xml
index a409756e5b5f..0f2cc6ff66e8 100644
--- a/packages/SettingsLib/res/values-nl/strings.xml
+++ b/packages/SettingsLib/res/values-nl/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"Actief. Tik om te schakelen."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"Stand-bystatus app: <xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"Instellingen voor mediatranscodering"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"Transcodering uitschakelen"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"Standaardwaarden voor transcodering overschrijven"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"Transcodering inschakelen"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"Aannemen dat apps moderne indelingen ondersteunen"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"Transcodering inschakelen voor apps"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"Actieve services"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"Services die momenteel actief zijn, weergeven en beheren"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"Nog <xliff:g id="TIME">%1$s</xliff:g> tot opgeladen"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="TIME">%2$s</xliff:g> tot opgeladen"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> - Batterij tijdelijk beperkt"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> - Optimaliseren voor batterijduur"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"Onbekend"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"Opladen"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"Snel opladen"</string>
diff --git a/packages/SettingsLib/res/values-or/strings.xml b/packages/SettingsLib/res/values-or/strings.xml
index 0a0eeff6de60..040ddddf96f7 100644
--- a/packages/SettingsLib/res/values-or/strings.xml
+++ b/packages/SettingsLib/res/values-or/strings.xml
@@ -28,7 +28,7 @@
<string name="wifi_disabled_network_failure" msgid="2660396183242399585">"IP କନଫିଗରେଶନ ବିଫଳ ହୋଇଛି"</string>
<string name="wifi_disabled_by_recommendation_provider" msgid="1302938248432705534">"ନିମ୍ନ ମାନର ନେଟ୍‌ୱର୍କ କାରଣରୁ ସଂଯୁକ୍ତ ହୋଇନାହିଁ"</string>
<string name="wifi_disabled_wifi_failure" msgid="8819554899148331100">"ୱାଇଫାଇ ସଂଯୋଗ ବିଫଳ ହୋଇଛି"</string>
- <string name="wifi_disabled_password_failure" msgid="6892387079613226738">"ସତ୍ୟାପନରେ ସମସ୍ୟା"</string>
+ <string name="wifi_disabled_password_failure" msgid="6892387079613226738">"ପ୍ରମାଣୀକରଣରେ ସମସ୍ୟା"</string>
<string name="wifi_cant_connect" msgid="5718417542623056783">"ସଂଯୋଗ କରିପାରିବ ନାହିଁ"</string>
<string name="wifi_cant_connect_to_ap" msgid="3099667989279700135">"\'<xliff:g id="AP_NAME">%1$s</xliff:g>\' ସହିତ ସଂଯୁକ୍ତ ହୋଇପାରୁନାହିଁ"</string>
<string name="wifi_check_password_try_again" msgid="8817789642851605628">"ପାସ୍‌ୱର୍ଡ ଯାଞ୍ଚ କରନ୍ତୁ ଏବଂ ପୁଣି ଚେଷ୍ଟା କରନ୍ତୁ"</string>
@@ -400,7 +400,12 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"ସକ୍ରିୟ। ବଦଳାଇବା ପାଇଁ ଟାପ୍‌ କରନ୍ତୁ"</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"ଆପ୍ ଷ୍ଟାଣ୍ଡବାଏ ଅବସ୍ଥା:<xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"ମିଡିଆ ଟ୍ରାନ୍ସକୋଡିଂ ସେଟିଂସ୍"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"ଟ୍ରାନ୍ସକୋଡିଂ ଅକ୍ଷମ କରନ୍ତୁ"</string>
+ <!-- no translation found for transcode_user_control (6176368544817731314) -->
+ <skip />
+ <!-- no translation found for transcode_enable_all (2411165920039166710) -->
+ <skip />
+ <!-- no translation found for transcode_default (3784803084573509491) -->
+ <skip />
<string name="transcode_skip_apps" msgid="8249721984597390142">"ଆପଗୁଡ଼ିକ ପାଇଁ ଟ୍ରାନ୍ସକୋଡିଂ ସକ୍ଷମ କରନ୍ତୁ"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"ଚାଲୁଥିବା ସେବାଗୁଡ଼ିକ"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"ଏବେ ଚାଲୁଥିବା ସେବାଗୁଡ଼ିକୁ ଦେଖନ୍ତୁ ଓ ନିୟନ୍ତ୍ରଣ କରନ୍ତୁ"</string>
@@ -449,7 +454,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"ଚାର୍ଜ ହେବା ପାଇଁ <xliff:g id="TIME">%1$s</xliff:g> ବାକି ଅଛି"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="TIME">%2$s</xliff:g> ଚାର୍ଜ ହେବା ପର୍ଯ୍ୟନ୍ତ"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> - ବ୍ୟାଟେରୀ ଅସ୍ଥାୟୀ ଭାବେ ସୀମିତ ଅଛି"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> - ବ୍ୟାଟେରୀ ହେଲ୍ଥ ପାଇଁ ଅପ୍ଟିମାଇଜ୍ ହେଉଛି"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"ଅଜ୍ଞାତ"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"ଚାର୍ଜ ହେଉଛି"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"ଶୀଘ୍ର ଚାର୍ଜ ହେଉଛି"</string>
diff --git a/packages/SettingsLib/res/values-pa/strings.xml b/packages/SettingsLib/res/values-pa/strings.xml
index c9c37d922537..e6adff30b2cf 100644
--- a/packages/SettingsLib/res/values-pa/strings.xml
+++ b/packages/SettingsLib/res/values-pa/strings.xml
@@ -400,7 +400,12 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"ਕਿਰਿਆਸ਼ੀਲ। ਟੌਗਲ ਕਰਨ ਲਈ ਟੈਪ ਕਰੋ।"</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"ਐਪ ਸਟੈਂਡਬਾਈ ਸਥਿਤੀ:<xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"ਮੀਡੀਆ ਟ੍ਰਾਂਸਕੋਡਿੰਗ ਸੈਟਿੰਗਾਂ"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"ਟ੍ਰਾਂਸਕੋਡਿੰਗ ਬੰਦ ਕਰੋ"</string>
+ <!-- no translation found for transcode_user_control (6176368544817731314) -->
+ <skip />
+ <!-- no translation found for transcode_enable_all (2411165920039166710) -->
+ <skip />
+ <!-- no translation found for transcode_default (3784803084573509491) -->
+ <skip />
<string name="transcode_skip_apps" msgid="8249721984597390142">"ਐਪਾਂ ਲਈ ਟ੍ਰਾਂਸਕੋਡਿੰਗ ਚਾਲੂ ਕਰੋ"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"ਚੱਲ ਰਹੀਆਂ ਸੇਵਾਵਾਂ"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"ਇਸ ਵੇਲੇ ਚੱਲ ਰਹੀਆਂ ਸੇਵਾਵਾਂ ਦੇਖੋ ਅਤੇ ਇਹਨਾਂ ਨੂੰ ਕੰਟਰੋਲ ਕਰੋ"</string>
@@ -449,7 +454,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"ਚਾਰਜ ਹੋਣ ਵਿੱਚ <xliff:g id="TIME">%1$s</xliff:g> ਬਾਕੀ"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="TIME">%2$s</xliff:g> ਤੱਕ ਚਾਰਜ ਹੋ ਜਾਵੇਗੀ"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> - ਬੈਟਰੀ ਕੁਝ ਸਮੇਂ ਲਈ ਸੀਮਤ"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> - ਬੈਟਰੀ ਸਥਿਤੀ ਲਈ ਅਨੁਕੂਲ ਬਣਾਇਆ ਜਾ ਰਿਹਾ"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"ਅਗਿਆਤ"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"ਚਾਰਜ ਹੋ ਰਿਹਾ ਹੈ"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"ਤੇਜ਼ ਚਾਰਜ ਹੋ ਰਹੀ ਹੈ"</string>
diff --git a/packages/SettingsLib/res/values-pl/strings.xml b/packages/SettingsLib/res/values-pl/strings.xml
index e894c2cbc34c..5690e748c4cd 100644
--- a/packages/SettingsLib/res/values-pl/strings.xml
+++ b/packages/SettingsLib/res/values-pl/strings.xml
@@ -400,7 +400,12 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"Aktywna. Dotknij, by zmienić."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"Stan aplikacji w trybie czuwania: <xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"Ustawienia transkodowania multimediów"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"Wyłącz transkodowanie"</string>
+ <!-- no translation found for transcode_user_control (6176368544817731314) -->
+ <skip />
+ <!-- no translation found for transcode_enable_all (2411165920039166710) -->
+ <skip />
+ <!-- no translation found for transcode_default (3784803084573509491) -->
+ <skip />
<string name="transcode_skip_apps" msgid="8249721984597390142">"Włącz transkodowanie dla aplikacji"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"Uruchomione usługi"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"Wyświetl obecnie uruchomione usługi i nimi zarządzaj"</string>
@@ -449,7 +454,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> – <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"Do naładowania <xliff:g id="TIME">%1$s</xliff:g>"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> – do naładowania <xliff:g id="TIME">%2$s</xliff:g>"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> – bateria tymczasowo ograniczona"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> – Optymalizuję, by utrzymać baterię w dobrym stanie"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"Nieznane"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"Ładowanie"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"Szybkie ładowanie"</string>
diff --git a/packages/SettingsLib/res/values-pt-rBR/strings.xml b/packages/SettingsLib/res/values-pt-rBR/strings.xml
index acaabc793970..a0ddcf226a0d 100644
--- a/packages/SettingsLib/res/values-pt-rBR/strings.xml
+++ b/packages/SettingsLib/res/values-pt-rBR/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"Ativo. Tocar para alternar."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"Estado em espera do app:<xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"Configurações de transcodificação de mídia"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"Desativar transcodificação"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"Substituir os padrões de transcodificação"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"Ativar transcodificação"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"Considerar que os apps são compatíveis com formatos modernos"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"Ativar transcodificação para apps"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"Serviços em execução"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"Visualizar e controlar os serviços em execução no momento"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"Tempo restante até a carga completa: <xliff:g id="TIME">%1$s</xliff:g>"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g>: <xliff:g id="TIME">%2$s</xliff:g> até a carga completa"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g>: bateria limitada temporariamente"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g>: otimizando para integridade da bateria"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"Desconhecido"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"Carregando"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"Carregando rápido"</string>
diff --git a/packages/SettingsLib/res/values-pt-rPT/strings.xml b/packages/SettingsLib/res/values-pt-rPT/strings.xml
index 2c1a9678f158..adaed743477e 100644
--- a/packages/SettingsLib/res/values-pt-rPT/strings.xml
+++ b/packages/SettingsLib/res/values-pt-rPT/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"Ativo. Toque para ativar/desativar."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"Estado do Modo de espera das apps:<xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"Definições da transcodificação de multimédia"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"Desativar a transcodificação"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"Substituir as predefinições da transcodificação"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"Ativar a transcodificação"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"Assumir que as apps suportam formatos modernos"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"Ative a transcodificação para apps"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"Serviços em execução"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"Ver e controlar os serviços actualmente em execução"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> – <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"Falta(m) <xliff:g id="TIME">%1$s</xliff:g> até ficar carregada"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> – <xliff:g id="TIME">%2$s</xliff:g> até ficar carregada"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> – Bateria limitada temporariamente."</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> – A otimizar o estado da bateria"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"Desconhecido"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"A carregar"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"Carregamento rápido"</string>
diff --git a/packages/SettingsLib/res/values-pt/strings.xml b/packages/SettingsLib/res/values-pt/strings.xml
index acaabc793970..a0ddcf226a0d 100644
--- a/packages/SettingsLib/res/values-pt/strings.xml
+++ b/packages/SettingsLib/res/values-pt/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"Ativo. Tocar para alternar."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"Estado em espera do app:<xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"Configurações de transcodificação de mídia"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"Desativar transcodificação"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"Substituir os padrões de transcodificação"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"Ativar transcodificação"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"Considerar que os apps são compatíveis com formatos modernos"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"Ativar transcodificação para apps"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"Serviços em execução"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"Visualizar e controlar os serviços em execução no momento"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"Tempo restante até a carga completa: <xliff:g id="TIME">%1$s</xliff:g>"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g>: <xliff:g id="TIME">%2$s</xliff:g> até a carga completa"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g>: bateria limitada temporariamente"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g>: otimizando para integridade da bateria"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"Desconhecido"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"Carregando"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"Carregando rápido"</string>
diff --git a/packages/SettingsLib/res/values-ro/strings.xml b/packages/SettingsLib/res/values-ro/strings.xml
index 57a0454f3465..266dff2fa81b 100644
--- a/packages/SettingsLib/res/values-ro/strings.xml
+++ b/packages/SettingsLib/res/values-ro/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"Activă. Atingeți pentru a comuta."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"Stare Standby aplicații: <xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"Setări pentru transcodarea conținutului media"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"Dezactivați transcodarea"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"Modificați setările prestabilite de transcodare"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"Activați transcodarea"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"Presupuneți că aplicațiile acceptă formatele moderne"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"Activați transcodarea pentru aplicații"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"Servicii în curs de funcționare"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"Vedeți și controlați serviciile care funcționează în prezent"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"Au mai rămas <xliff:g id="TIME">%1$s</xliff:g> până la încărcare"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> – <xliff:g id="TIME">%2$s</xliff:g> până la încărcare"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> – baterie limitată temporar"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> – Se fac optimizări pentru buna funcționare a bateriei"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"Necunoscut"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"Se încarcă"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"Se încarcă rapid"</string>
diff --git a/packages/SettingsLib/res/values-ru/strings.xml b/packages/SettingsLib/res/values-ru/strings.xml
index 09b8de04388b..ca20baee55b1 100644
--- a/packages/SettingsLib/res/values-ru/strings.xml
+++ b/packages/SettingsLib/res/values-ru/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"Включено. Нажмите, чтобы отключить."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"Статус приложения в режиме ожидания:<xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"Настройки перекодирования медиафайлов"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"Отключить перекодирование"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"Переопределять настройки транскодирования по умолчанию"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"Включить перекодирование"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"Считать, что приложения поддерживают современные форматы кодирования"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"Включить перекодирование для приложений"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"Работающие службы"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"Просмотр и управление работающими службами"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> – <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"<xliff:g id="TIME">%1$s</xliff:g> до полной зарядки"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> – <xliff:g id="TIME">%2$s</xliff:g> до полной зарядки"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> • Уровень заряда временно ограничен"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"Оптимизация для увеличения срока службы батареи (<xliff:g id="LEVEL">%1$s</xliff:g>)"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"Неизвестно"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"Идет зарядка"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"Быстрая зарядка"</string>
diff --git a/packages/SettingsLib/res/values-si/strings.xml b/packages/SettingsLib/res/values-si/strings.xml
index d36140f66b54..da69b813ee88 100644
--- a/packages/SettingsLib/res/values-si/strings.xml
+++ b/packages/SettingsLib/res/values-si/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"සක්‍රියයි. ටොගල කිරීමට තට්ටු කරන්න."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"යෙදුම් පොරොත්තු තත්ත්වය:<xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"මාධ්‍ය ට්‍රාන්ස්කෝඩින් සැකසීම්"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"ට්‍රාන්ස්කෝඩින් අබල කරන්න"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"ට්‍රාන්ස්කෝඩින් පෙරනිමි ප්‍රතික්ෂේප කරන්න"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"ට්‍රාන්ස්කෝඩින් සබල කරන්න"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"යෙදුම් නවීන ආකෘති සඳහා සහාය දක්වයි යැයි උපකල්පනය කරමු"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"යෙදුම් සඳහා ට්‍රාන්ස්කෝඩින් සබල කරන්න"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"ධාවනය වන සේවා"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"දැනට ධාවනය වන සේවා බලන්න සහ පාලනය කරන්න"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"ආරෝපණය වන තෙක් <xliff:g id="TIME">%1$s</xliff:g> ඇත"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> - ආරෝපණය වන තෙක් <xliff:g id="TIME">%2$s</xliff:g>"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> - බැටරිය තාවකාලිකව සීමිතයි"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> - බැටරි සෞඛ්‍යය සඳහා ප්‍රශස්ත කරමින්"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"නොදනී"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"ආරෝපණය වෙමින්"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"ශීඝ්‍ර ආරෝපණය"</string>
diff --git a/packages/SettingsLib/res/values-sk/strings.xml b/packages/SettingsLib/res/values-sk/strings.xml
index 096e95e7050b..b428b421ad32 100644
--- a/packages/SettingsLib/res/values-sk/strings.xml
+++ b/packages/SettingsLib/res/values-sk/strings.xml
@@ -28,7 +28,7 @@
<string name="wifi_disabled_network_failure" msgid="2660396183242399585">"Zlyhanie konfigurácie adresy IP"</string>
<string name="wifi_disabled_by_recommendation_provider" msgid="1302938248432705534">"Nepripojené z dôvodu siete nízkej kvality"</string>
<string name="wifi_disabled_wifi_failure" msgid="8819554899148331100">"Zlyhanie pripojenia Wi‑Fi"</string>
- <string name="wifi_disabled_password_failure" msgid="6892387079613226738">"Problém s overením totožnosti"</string>
+ <string name="wifi_disabled_password_failure" msgid="6892387079613226738">"Problém s overením"</string>
<string name="wifi_cant_connect" msgid="5718417542623056783">"Nedá sa pripojiť"</string>
<string name="wifi_cant_connect_to_ap" msgid="3099667989279700135">"K sieti <xliff:g id="AP_NAME">%1$s</xliff:g> sa nedá pripojiť"</string>
<string name="wifi_check_password_try_again" msgid="8817789642851605628">"Skontrolujte heslo a skúste to znova"</string>
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"Aktívne. Prepnite klepnutím."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"Stav pohotovostného režimu aplikácie: <xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"Nastavenia prekódovania médií"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"Vypnúť prekódovanie"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"Prepísať predvolené nastavenia prekódovania"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"Povoliť prekódovanie"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"Prepdokladať, že aplikácie podporujú moderné formáty"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"Zapnúť prekódovanie aplikácií"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"Spustené služby"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"Zobrazovať a riadiť aktuálne spustené služby"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> – <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"Zostávajúci čas do úplného nabitia: <xliff:g id="TIME">%1$s</xliff:g>"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> – <xliff:g id="TIME">%2$s</xliff:g> do úplného nabitia"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> – Batéria je dočasne obmedzená"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> – Optimalizácia stavu batérie"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"Neznáme"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"Nabíja sa"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"Rýchle nabíjanie"</string>
diff --git a/packages/SettingsLib/res/values-sl/strings.xml b/packages/SettingsLib/res/values-sl/strings.xml
index 345fa36d3bd6..3ba31fa1eed5 100644
--- a/packages/SettingsLib/res/values-sl/strings.xml
+++ b/packages/SettingsLib/res/values-sl/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"Aktivno. Dotaknite se za preklop."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"Stanje pripravljenosti aplikacije: <xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"Nastavitve prekodiranja predstavnosti"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"Onemogočanje prekodiranja"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"Preglasi privzete nastavitve prekodiranja"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"Omogoči prekodiranje"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"Aplikacije naj bi podpirale sodobne oblike zapisov"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"Omogočanje prekodiranja za aplikacije"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"Zagnane storitve"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"Preglejte in nadzorujte storitve, ki so trenutno zagnane"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> – <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"Še <xliff:g id="TIME">%1$s</xliff:g> do polne napolnjenosti"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> – <xliff:g id="TIME">%2$s</xliff:g> do polne napolnjenosti"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> – baterija je začasno omejena"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> – Optimizacija za ohran. zmog. baterije"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"Neznano"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"Polnjenje"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"Hitro polnjenje"</string>
diff --git a/packages/SettingsLib/res/values-sq/strings.xml b/packages/SettingsLib/res/values-sq/strings.xml
index 3953a6a4f6e0..15cbb7439c64 100644
--- a/packages/SettingsLib/res/values-sq/strings.xml
+++ b/packages/SettingsLib/res/values-sq/strings.xml
@@ -400,7 +400,12 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"Aktiv. Trokit për ta ndryshuar."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"Gjendja e gatishmërisë e aplikacionit:<xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"Cilësimet e transkodimit të multimediave"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"Çaktivizo transkodimin"</string>
+ <!-- no translation found for transcode_user_control (6176368544817731314) -->
+ <skip />
+ <!-- no translation found for transcode_enable_all (2411165920039166710) -->
+ <skip />
+ <!-- no translation found for transcode_default (3784803084573509491) -->
+ <skip />
<string name="transcode_skip_apps" msgid="8249721984597390142">"Aktivizo transkodimin për aplikacionet"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"Shërbimet në ekzekutim"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"Shiko dhe kontrollo shërbimet që po ekzekutohen aktualisht"</string>
@@ -449,7 +454,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"<xliff:g id="TIME">%1$s</xliff:g> të mbetura deri në karikim"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="TIME">%2$s</xliff:g> derisa të karikohet"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> - Bateria e kufizuar përkohësisht"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> - Po optimizohet për integritetin e baterisë"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"I panjohur"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"Po karikohet"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"Po ngarkon me shpejtësi"</string>
diff --git a/packages/SettingsLib/res/values-sr/strings.xml b/packages/SettingsLib/res/values-sr/strings.xml
index 70b287933c93..c3371829361d 100644
--- a/packages/SettingsLib/res/values-sr/strings.xml
+++ b/packages/SettingsLib/res/values-sr/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"Активна. Додирните да бисте је деактивирали."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"Стање приправности апликације: <xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"Подешавања транскодирања медија"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"Онемогући транскодирање"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"Замени подразумевана подешавања транскодирања"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"Омогући транскодирање"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"Подразумевај да апликације подржавају модерне формате"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"Омогућите транскодирање за апликације"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"Покренуте услуге"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"Приказ и контрола тренутно покренутих услуга"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> – <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"Напуниће се за <xliff:g id="TIME">%1$s</xliff:g>"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> – напуниће се за <xliff:g id="TIME">%2$s</xliff:g>"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> – батерија је тренутно ограничена"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> – Оптимизује се ради стања батерије"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"Непознато"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"Пуни се"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"Брзо се пуни"</string>
diff --git a/packages/SettingsLib/res/values-sv/strings.xml b/packages/SettingsLib/res/values-sv/strings.xml
index f466e882c2fc..2bf9785f67d4 100644
--- a/packages/SettingsLib/res/values-sv/strings.xml
+++ b/packages/SettingsLib/res/values-sv/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"Aktiv. Tryck om du vill inaktivera."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"Status för strömsparfunktion för appar:<xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"Inställningar för medieomkodning"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"Inaktivera omkodning"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"Åsidosätta standardinställningar för omkodning"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"Aktivera omkodning"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"Anta att appar har stöd för moderna format"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"Aktivera omkodning för appar"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"Aktiva tjänster"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"Visa och styr aktiva tjänster"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> – <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"<xliff:g id="TIME">%1$s</xliff:g> kvar till full laddning"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> – <xliff:g id="TIME">%2$s</xliff:g> till full laddning"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> – batteriet är tillfälligt begränsat"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> – Optimerar batteriets livslängd"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"Okänd"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"Laddar"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"Laddas snabbt"</string>
diff --git a/packages/SettingsLib/res/values-sw/strings.xml b/packages/SettingsLib/res/values-sw/strings.xml
index e1060fec2a66..610bfeefc743 100644
--- a/packages/SettingsLib/res/values-sw/strings.xml
+++ b/packages/SettingsLib/res/values-sw/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"Inatumika. Gusa ili ugeuze."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"Hali ya kisitisha programu:<xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"Mipangilio ya kubadilisha muundo wa faili ya maudhui"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"Zima ubadilishaji muundo wa faili"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"Batilisha chaguomsingi za kubadilisha miundo ya faili"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"Ruhusu ubadilishaji wa miundo ya faili"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"Chukulia kuwa programu zinatumia miundo ya kisasa"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"Washa ubadilishaji muundo wa faili kwenye programu"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"Huduma zinazoendeshwa"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"Onyesha na udhibiti huduma zinazoendeshwa kwa sasa"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"Imebakisha <xliff:g id="TIME">%1$s</xliff:g> ijae chaji"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="TIME">%2$s</xliff:g> ijae chaji"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> - Betri imedhibitiwa kwa muda"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> - Inaboresha muda wa kutumia betri"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"Haijulikani"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"Inachaji"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"Inachaji kwa kasi"</string>
diff --git a/packages/SettingsLib/res/values-ta/strings.xml b/packages/SettingsLib/res/values-ta/strings.xml
index ba98d79ff7e4..7d77967e0daf 100644
--- a/packages/SettingsLib/res/values-ta/strings.xml
+++ b/packages/SettingsLib/res/values-ta/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"செயலில் உள்ளது. மாற்ற, தட்டவும்."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"காத்திருப்பில் உள்ள ஆப்ஸின் நிலை:<xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"மீடியா குறிமாற்ற அமைப்புகள்"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"குறிமாற்றத்தை முடக்கு"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"இயல்புநிலை குறிமாற்றங்களை மீறிச் செயல்படு"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"குறிமாற்றத்தை இயக்கு"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"ஆப்ஸ் மாடர்ன் வடிவங்களை ஆதரிக்கும்படி அமை"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"ஆப்ஸுக்குக் குறிமாற்றத்தை இயக்கு"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"இயங்கும் சேவைகள்"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"தற்போது இயக்கத்தில் இருக்கும் சேவைகளைப் பார்த்து கட்டுப்படுத்து"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"முழு சார்ஜாக <xliff:g id="TIME">%1$s</xliff:g> ஆகும்"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> - முழு சார்ஜாக <xliff:g id="TIME">%2$s</xliff:g> ஆகும்"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g>-பேட்டரி தற்காலிகக் கட்டுப்பாட்டிலுள்ளது"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> - பேட்டரியின் ஆயுளை மேம்படுத்துகிறது"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"அறியப்படாத"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"சார்ஜ் ஆகிறது"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"வேகமாக சார்ஜாகிறது"</string>
diff --git a/packages/SettingsLib/res/values-te/strings.xml b/packages/SettingsLib/res/values-te/strings.xml
index 0b93979dbd07..f24caecc453f 100644
--- a/packages/SettingsLib/res/values-te/strings.xml
+++ b/packages/SettingsLib/res/values-te/strings.xml
@@ -400,7 +400,12 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"సక్రియంగా ఉంది. టోగుల్ చేయడానికి నొక్కండి."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"యాప్ స్టాండ్‌బై స్థితి:<xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"మీడియా ట్రాన్స్‌కోడింగ్ సెట్టింగ్‌లు"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"ట్రాన్స్‌కోడింగ్‌ను డిజేబుల్ చేయండి"</string>
+ <!-- no translation found for transcode_user_control (6176368544817731314) -->
+ <skip />
+ <!-- no translation found for transcode_enable_all (2411165920039166710) -->
+ <skip />
+ <!-- no translation found for transcode_default (3784803084573509491) -->
+ <skip />
<string name="transcode_skip_apps" msgid="8249721984597390142">"యాప్‌ల కోసం ట్రాన్స్‌కోడింగ్‌ను ఎనేబుల్ చేయండి"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"అమలులో ఉన్న సేవలు"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"ప్రస్తుతం అమలులో ఉన్న సేవలను వీక్షించండి మరియు నియంత్రించండి"</string>
@@ -449,7 +454,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"ఛార్జ్ అవ్వడానికి <xliff:g id="TIME">%1$s</xliff:g> సమయం మిగిలి ఉంది"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> - ఛార్జ్ అవ్వడానికి <xliff:g id="TIME">%2$s</xliff:g> పడుతుంది"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> -బ్యాటరీ తాత్కాలికంగా పరిమితం చేయబడింది"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> - బ్యాటరీ స్థితిని ఆప్టిమైజ్ చేయడం కోసం"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"తెలియదు"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"ఛార్జ్ అవుతోంది"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"వేగవంతమైన ఛార్జింగ్"</string>
diff --git a/packages/SettingsLib/res/values-th/strings.xml b/packages/SettingsLib/res/values-th/strings.xml
index a31e14611bf6..2c019983f639 100644
--- a/packages/SettingsLib/res/values-th/strings.xml
+++ b/packages/SettingsLib/res/values-th/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"ใช้งานอยู่ แตะเพื่อสลับ"</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"สถานะการสแตนด์บายของแอป:<xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"การตั้งค่าการแปลงสื่อ"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"ปิดใช้การแปลง"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"ลบล้างค่าเริ่มต้นของการแปลง"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"เปิดใช้การแปลง"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"ถือว่าแอปรองรับรูปแบบสมัยใหม่"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"เปิดใช้การแปลงสำหรับแอป"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"บริการที่ทำงานอยู่"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"ดูและควบคุมบริการที่ทำงานอยู่"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"เหลือ <xliff:g id="TIME">%1$s</xliff:g> จนกว่าจะชาร์จเต็ม"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="TIME">%2$s</xliff:g> จนกว่าจะชาร์จ"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> - การชาร์จแบตเตอรี่จำกัดชั่วคราว"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> - กำลังเพิ่มประสิทธิภาพแบตเตอรี่"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"ไม่ทราบ"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"กำลังชาร์จ"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"กำลังชาร์จอย่างเร็ว"</string>
diff --git a/packages/SettingsLib/res/values-tl/strings.xml b/packages/SettingsLib/res/values-tl/strings.xml
index bbb77790e68a..54ba90ef4b31 100644
--- a/packages/SettingsLib/res/values-tl/strings.xml
+++ b/packages/SettingsLib/res/values-tl/strings.xml
@@ -28,7 +28,7 @@
<string name="wifi_disabled_network_failure" msgid="2660396183242399585">"Pagkabigo ng Configuration ng IP"</string>
<string name="wifi_disabled_by_recommendation_provider" msgid="1302938248432705534">"Hindi nakakonekta dahil mababa ang kalidad ng network"</string>
<string name="wifi_disabled_wifi_failure" msgid="8819554899148331100">"Pagkabigo ng Koneksyon sa WiFi"</string>
- <string name="wifi_disabled_password_failure" msgid="6892387079613226738">"Problema sa pagpapatotoo"</string>
+ <string name="wifi_disabled_password_failure" msgid="6892387079613226738">"Problema sa pag-authenticate"</string>
<string name="wifi_cant_connect" msgid="5718417542623056783">"Hindi makakonekta"</string>
<string name="wifi_cant_connect_to_ap" msgid="3099667989279700135">"Hindi makakonekta sa \'<xliff:g id="AP_NAME">%1$s</xliff:g>\'"</string>
<string name="wifi_check_password_try_again" msgid="8817789642851605628">"Suriin ang password at subukang muli"</string>
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"Aktibo. I-tap upang i-toggle."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"Status ng app standby:<xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"Mga setting ng pag-transcode ng media"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"I-disable ang pag-transcode"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"I-override ang mga default ng pagta-transcode"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"I-enable ang pagta-transcode"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"Ipagpalagay na sinusuportahan ng mga app ang mga modernong format"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"I-enable ang pag-transcode para sa mga app"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"Mga tumatakbong serbisyo"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"Tingnan at kontrolin ang mga kasalukuyang tumatakbong serbisyo"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"<xliff:g id="TIME">%1$s</xliff:g> ang natitira bago matapos mag-charge"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="TIME">%2$s</xliff:g> hanggang matapos mag-charge"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> - Pansamantalang limitado ang baterya"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> - Ino-optimize para sa tagal ng baterya"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"Hindi Kilala"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"Nagcha-charge"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"Mabilis na charge"</string>
diff --git a/packages/SettingsLib/res/values-tr/strings.xml b/packages/SettingsLib/res/values-tr/strings.xml
index fba7f41bbbf5..942834f230eb 100644
--- a/packages/SettingsLib/res/values-tr/strings.xml
+++ b/packages/SettingsLib/res/values-tr/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"Etkin. Geçiş yapmak için dokunun."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"Uygulamayı beklemeye alma durumu: <xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"Medya kod dönüştürme ayarları"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"Kod dönüştürmeyi devre dışı bırak"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"Kod dönüştürme varsayılanlarını geçersiz kıl"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"Kod dönüştürmeyi etkinleştir"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"Uygulamaların modern biçimleri desteklediğini varsay"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"Uygulamalar için kod dönüştürmeyi etkinleştir"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"Çalışan hizmetler"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"Şu anda çalışan hizmetleri görüntüle ve denetle"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"Şarj olmaya <xliff:g id="TIME">%1$s</xliff:g> kaldı"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> - şarj olmaya <xliff:g id="TIME">%2$s</xliff:g> kaldı"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> - Pil geçici olarak sınırlı"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> - Pil sağlığı için optimize ediliyor"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"Bilinmiyor"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"Şarj oluyor"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"Hızlı şarj oluyor"</string>
diff --git a/packages/SettingsLib/res/values-uk/strings.xml b/packages/SettingsLib/res/values-uk/strings.xml
index b633752d28a9..f6063f8147ba 100644
--- a/packages/SettingsLib/res/values-uk/strings.xml
+++ b/packages/SettingsLib/res/values-uk/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"Активний додаток. Торкніться, щоб дезактивувати."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"Режим очікування: <xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"Налаштування перекодування медіафайлів"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"Вимкнути перекодування"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"Замінити стандартні налаштування перекодування"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"Увімкнути перекодування"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"Вважати, що додатки підтримують сучасні формати"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"Увімкнути перекодування додатків"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"Запущені сервіси"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"Переглянути й налаштувати запущені сервіси"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> – <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"<xliff:g id="TIME">%1$s</xliff:g> до повного заряду"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> – <xliff:g id="TIME">%2$s</xliff:g> до повного заряду"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> – дані акумулятора тимчасово недоступні"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> – стан акумулятора оптимізується"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"Невідомо"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"Заряджається"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"Швидке заряджання"</string>
diff --git a/packages/SettingsLib/res/values-ur/strings.xml b/packages/SettingsLib/res/values-ur/strings.xml
index b4d8ad2576bd..5d754373a5a4 100644
--- a/packages/SettingsLib/res/values-ur/strings.xml
+++ b/packages/SettingsLib/res/values-ur/strings.xml
@@ -400,7 +400,12 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"فعال۔ ٹوگل کرنے کیلئے تھپتھپائیں۔"</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"ایپ اسٹینڈ بائی کی حالت:<xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"میڈیا ٹرانسکوڈنگ کی ترتیبات"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"ٹرانسکوڈنگ غیر فعال کریں"</string>
+ <!-- no translation found for transcode_user_control (6176368544817731314) -->
+ <skip />
+ <!-- no translation found for transcode_enable_all (2411165920039166710) -->
+ <skip />
+ <!-- no translation found for transcode_default (3784803084573509491) -->
+ <skip />
<string name="transcode_skip_apps" msgid="8249721984597390142">"ایپس کے لئے ٹرانسکوڈنگ فعال کریں"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"چل رہی سروسز"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"فی الحال چل رہی سروسز دیکھیں اور انہیں کنٹرول کریں"</string>
@@ -449,7 +454,7 @@
<string name="power_charging" msgid="6727132649743436802">"‎<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="STATE">%2$s</xliff:g>‎"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"چارج ہونے میں <xliff:g id="TIME">%1$s</xliff:g> باقی"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="TIME">%2$s</xliff:g> چارج ہونے تک"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> - بیٹری عارضی طور پر محدود ہے"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> - بیٹری کی صحت کیلئے بہتر بنایا جا رہا ہے"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"نامعلوم"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"چارج ہو رہا ہے"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"تیزی سے چارج ہو رہا ہے"</string>
diff --git a/packages/SettingsLib/res/values-uz/arrays.xml b/packages/SettingsLib/res/values-uz/arrays.xml
index 2f06fcfd5dee..0770dcc42bc8 100644
--- a/packages/SettingsLib/res/values-uz/arrays.xml
+++ b/packages/SettingsLib/res/values-uz/arrays.xml
@@ -25,7 +25,7 @@
<item msgid="3288373008277313483">"Qidiruv…"</item>
<item msgid="6050951078202663628">"Ulanmoqda…"</item>
<item msgid="8356618438494652335">"Tasdiqdan o‘tilmoqda…"</item>
- <item msgid="2837871868181677206">"IP manzil o‘zlashtirilmoqda…"</item>
+ <item msgid="2837871868181677206">"IP manzil olinmoqda…"</item>
<item msgid="4613015005934755724">"Ulangan"</item>
<item msgid="3763530049995655072">"Muzlatildi"</item>
<item msgid="7852381437933824454">"Uzilmoqda…"</item>
diff --git a/packages/SettingsLib/res/values-uz/strings.xml b/packages/SettingsLib/res/values-uz/strings.xml
index 5bb422ecf96a..f1fc8ddcc5ea 100644
--- a/packages/SettingsLib/res/values-uz/strings.xml
+++ b/packages/SettingsLib/res/values-uz/strings.xml
@@ -28,7 +28,7 @@
<string name="wifi_disabled_network_failure" msgid="2660396183242399585">"IP manzilini sozlab bo‘lmadi"</string>
<string name="wifi_disabled_by_recommendation_provider" msgid="1302938248432705534">"Sifatsiz tarmoq sababli ulanib bo‘lmadi"</string>
<string name="wifi_disabled_wifi_failure" msgid="8819554899148331100">"Wi-Fi ulanishini o‘rnatib bo‘lmadi"</string>
- <string name="wifi_disabled_password_failure" msgid="6892387079613226738">"Tasdiqdan o‘tishda muammo"</string>
+ <string name="wifi_disabled_password_failure" msgid="6892387079613226738">"Tekshiruvda muammo"</string>
<string name="wifi_cant_connect" msgid="5718417542623056783">"Tarmoqqa ulanilmadi"</string>
<string name="wifi_cant_connect_to_ap" msgid="3099667989279700135">"“<xliff:g id="AP_NAME">%1$s</xliff:g>” nomli tarmoqqa ulanilmadi"</string>
<string name="wifi_check_password_try_again" msgid="8817789642851605628">"Parolni tekshirib, qaytadan urining"</string>
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"Faol. O‘zgartirish uchun bu yerga bosing."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"Kutish rejimi holati: <xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"Media transkripsiyasi sozlamalari"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"Transkripsiyani faolsizlantirish"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"Transkripsiya parametrlarini almashtirish"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"Transkripsiyasini yoqish"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"Ilovalar zamonaviy kodlash formatlarini qoʻllab-quvvatlaydi deb hisoblash"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"Ilovalar uchun transkripsiyani yoqish"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"Ishlab turgan ilovalar"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"Ishlab turgan ilovalarni ko‘rish va boshqarish"</string>
@@ -432,8 +434,8 @@
<skip />
<string name="power_discharge_by_enhanced" msgid="563438403581662942">"Joriy holatda taxminan <xliff:g id="TIME">%1$s</xliff:g> gacha davom etadi (<xliff:g id="LEVEL">%2$s</xliff:g>)"</string>
<string name="power_discharge_by_only_enhanced" msgid="3268796172652988877">"Joriy holatda taxminan <xliff:g id="TIME">%1$s</xliff:g> gacha davom etadi"</string>
- <string name="power_discharge_by" msgid="4113180890060388350">"Taxminan <xliff:g id="TIME">%1$s</xliff:g> gacha davom etadi (<xliff:g id="LEVEL">%2$s</xliff:g>)"</string>
- <string name="power_discharge_by_only" msgid="92545648425937000">"Taxminan <xliff:g id="TIME">%1$s</xliff:g> gacha davom etadi"</string>
+ <string name="power_discharge_by" msgid="4113180890060388350">"Taxminan <xliff:g id="TIME">%1$s</xliff:g> gacha yetadi (<xliff:g id="LEVEL">%2$s</xliff:g>)"</string>
+ <string name="power_discharge_by_only" msgid="92545648425937000">"Taxminan <xliff:g id="TIME">%1$s</xliff:g> gacha yetadi"</string>
<string name="power_discharge_by_only_short" msgid="5883041507426914446">"<xliff:g id="TIME">%1$s</xliff:g> gacha"</string>
<string name="power_suggestion_battery_run_out" msgid="6332089307827787087">"Batareya quvvati tugash vaqti: <xliff:g id="TIME">%1$s</xliff:g>"</string>
<string name="power_remaining_less_than_duration_only" msgid="8956656616031395152">"<xliff:g id="THRESHOLD">%1$s</xliff:g>dan kam qoldi"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> – <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"<xliff:g id="TIME">%1$s</xliff:g> ichida toʻladi"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> – <xliff:g id="TIME">%2$s</xliff:g> ichida toʻladi"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> – Quvvat darajasi vaqtincha cheklangan"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> – Batareya quvvati muvozanatlanmoqda"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"Noma’lum"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"Quvvat olmoqda"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"Tezkor quvvat olmoqda"</string>
diff --git a/packages/SettingsLib/res/values-vi/strings.xml b/packages/SettingsLib/res/values-vi/strings.xml
index 0acf9418b718..910fa2634f8c 100644
--- a/packages/SettingsLib/res/values-vi/strings.xml
+++ b/packages/SettingsLib/res/values-vi/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"Hiện hoạt. Nhấn để chuyển đổi."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"Trạng thái chờ ứng dụng:<xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"Cài đặt chuyển mã nội dung nghe nhìn"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"Tắt tùy chọn chuyển mã"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"Ghi đè tùy chọn chuyển mã mặc định"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"Bật tính năng chuyển mã"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"Giả định rằng các ứng dụng hỗ trợ định dạng hiện đại"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"Bật tùy chọn chuyển mã cho ứng dụng"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"Các dịch vụ đang chạy"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"Xem và kiểm soát các dịch vụ đang chạy"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"Còn <xliff:g id="TIME">%1$s</xliff:g> nữa là sạc đầy"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> – <xliff:g id="TIME">%2$s</xliff:g> nữa là sạc đầy"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> – Thời lượng pin bị hạn chế tạm thời"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> – Đang tối ưu hóa để cải thiện độ bền của pin"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"Không xác định"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"Đang sạc"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"Đang sạc nhanh"</string>
diff --git a/packages/SettingsLib/res/values-zh-rCN/strings.xml b/packages/SettingsLib/res/values-zh-rCN/strings.xml
index ca2ad87fb864..c9ecab19bfaf 100644
--- a/packages/SettingsLib/res/values-zh-rCN/strings.xml
+++ b/packages/SettingsLib/res/values-zh-rCN/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"已启用。点按即可切换。"</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"应用待机状态:<xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"媒体转码设置"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"停用转码功能"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"覆盖转码默认设置"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"启用转码"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"假设应用支持现代格式"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"为应用启用转码功能"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"正在运行的服务"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"查看和控制当前正在运行的服务"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"还剩 <xliff:g id="TIME">%1$s</xliff:g>充满电"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="TIME">%2$s</xliff:g>后充满电"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> - 暂时限用电池"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> - 正在针对电池状况进行优化"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"未知"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"正在充电"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"正在快速充电"</string>
diff --git a/packages/SettingsLib/res/values-zh-rHK/strings.xml b/packages/SettingsLib/res/values-zh-rHK/strings.xml
index 16ca19d313c1..3bbfa21220de 100644
--- a/packages/SettingsLib/res/values-zh-rHK/strings.xml
+++ b/packages/SettingsLib/res/values-zh-rHK/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"已啟用。輕按即可切換。"</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"備用應用程式狀態:<xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"媒體轉碼設定"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"停用轉碼功能"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"覆寫轉碼預設設定"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"啟用轉碼功能"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"假設應用程式支援新型格式"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"為應用程式啟用轉碼功能"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"執行中的服務"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"查看並控制目前正在執行中的服務"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"還需 <xliff:g id="TIME">%1$s</xliff:g>才能充滿電"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> - 還需 <xliff:g id="TIME">%2$s</xliff:g>才能充滿電"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> - 暫時限制電池充電"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> - 正在優化電池狀態"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"未知"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"充電中"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"正在快速充電"</string>
diff --git a/packages/SettingsLib/res/values-zh-rTW/strings.xml b/packages/SettingsLib/res/values-zh-rTW/strings.xml
index 810119b97777..b0dbb5fdac66 100644
--- a/packages/SettingsLib/res/values-zh-rTW/strings.xml
+++ b/packages/SettingsLib/res/values-zh-rTW/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"已啟用。輕觸即可切換。"</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"應用程式待命狀態:<xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"媒體轉碼功能設定"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"停用轉碼功能"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"覆寫轉碼預設設定"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"啟用轉碼"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"假設應用程式支援新格式"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"替應用程式啟用轉碼功能"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"正在運作的服務"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"查看並管理目前正在執行的服務"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"<xliff:g id="TIME">%1$s</xliff:g>後充飽電"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="TIME">%2$s</xliff:g>後充飽電"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> - 暫時限制電池用量"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> - 針對電池狀態進行最佳化調整"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"不明"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"充電中"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"快速充電中"</string>
diff --git a/packages/SettingsLib/res/values-zu/strings.xml b/packages/SettingsLib/res/values-zu/strings.xml
index 23beeb1aee82..8f7c2ac100bc 100644
--- a/packages/SettingsLib/res/values-zu/strings.xml
+++ b/packages/SettingsLib/res/values-zu/strings.xml
@@ -400,7 +400,9 @@
<string name="inactive_app_active_summary" msgid="8047630990208722344">"Kuyasebenza. Thepha ukuze ushintshe."</string>
<string name="standby_bucket_summary" msgid="5128193447550429600">"Isimo sokulinda kohlelo lokusebenza:<xliff:g id="BUCKET"> %s</xliff:g>"</string>
<string name="transcode_settings_title" msgid="2581975870429850549">"Amasethingi wemidiya yokudlulisela ikhodi"</string>
- <string name="transcode_enable_all" msgid="9102460144086871903">"Khubaza ukudlulisela ikhodi"</string>
+ <string name="transcode_user_control" msgid="6176368544817731314">"Khipha okuzenzakalelayo kokudlulisela ikhodi"</string>
+ <string name="transcode_enable_all" msgid="2411165920039166710">"Nika amandla ukudlulisela ikhodi"</string>
+ <string name="transcode_default" msgid="3784803084573509491">"Kuthathe njengokungathi izinhlelo zokusebenza zisekela amafomethi esimanje"</string>
<string name="transcode_skip_apps" msgid="8249721984597390142">"Nika amandla ukudlulisela ikhodi kwezinhlelo zokusebenza"</string>
<string name="runningservices_settings_title" msgid="6460099290493086515">"Amasevisi asebenzayo"</string>
<string name="runningservices_settings_summary" msgid="1046080643262665743">"Buka futhi ulawule amasevisi asebenzayo okwamanje"</string>
@@ -449,7 +451,7 @@
<string name="power_charging" msgid="6727132649743436802">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="STATE">%2$s</xliff:g>"</string>
<string name="power_remaining_charging_duration_only" msgid="7415639699283965818">"<xliff:g id="TIME">%1$s</xliff:g> esele ize ishaje"</string>
<string name="power_charging_duration" msgid="5005740040558984057">"<xliff:g id="LEVEL">%1$s</xliff:g> - <xliff:g id="TIME">%2$s</xliff:g> ize igcwale"</string>
- <string name="power_charging_limited" msgid="5902301801611726210">"<xliff:g id="LEVEL">%1$s</xliff:g> - Ibhethri ikhawulelwe okwesikhashana"</string>
+ <string name="power_charging_limited" msgid="1956874810658999681">"<xliff:g id="LEVEL">%1$s</xliff:g> - Ilungiselela impilo yebhethri"</string>
<string name="battery_info_status_unknown" msgid="268625384868401114">"Akwaziwa"</string>
<string name="battery_info_status_charging" msgid="4279958015430387405">"Iyashaja"</string>
<string name="battery_info_status_charging_fast" msgid="8027559755902954885">"Ishaja ngokushesha"</string>
diff --git a/packages/SettingsLib/res/values/strings.xml b/packages/SettingsLib/res/values/strings.xml
index 4e9721218a02..ca0686751873 100644
--- a/packages/SettingsLib/res/values/strings.xml
+++ b/packages/SettingsLib/res/values/strings.xml
@@ -1112,7 +1112,7 @@
<string name="power_remaining_charging_duration_only"><xliff:g id="time">%1$s</xliff:g> left until charged</string>
<!-- [CHAR_LIMIT=40] Label for battery level chart when charging with duration -->
<string name="power_charging_duration"><xliff:g id="level">%1$s</xliff:g> - <xliff:g id="time">%2$s</xliff:g> until charged</string>
- <!-- [CHAR_LIMIT=40] Label for battery level chart when charge been limited -->
+ <!-- [CHAR_LIMIT=80] Label for battery level chart when charge been limited -->
<string name="power_charging_limited"><xliff:g id="level">%1$s</xliff:g> - Optimizing for battery health</string>
<!-- Battery Info screen. Value for a status item. Used for diagnostic info screens, precise translation isn't needed -->
diff --git a/packages/SettingsLib/src/com/android/settingslib/mobile/MobileMappings.java b/packages/SettingsLib/src/com/android/settingslib/mobile/MobileMappings.java
new file mode 100644
index 000000000000..56898605ec94
--- /dev/null
+++ b/packages/SettingsLib/src/com/android/settingslib/mobile/MobileMappings.java
@@ -0,0 +1,63 @@
+/*
+ * 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.settingslib.mobile;
+
+import android.telephony.Annotation;
+import android.telephony.TelephonyDisplayInfo;
+import android.telephony.TelephonyManager;
+
+/**
+ * Holds the utility functions to create the RAT to MobileIconGroup mappings.
+ */
+public class MobileMappings {
+
+ /**
+ * Generates the RAT key from the TelephonyDisplayInfo.
+ */
+ public static String getIconKey(TelephonyDisplayInfo telephonyDisplayInfo) {
+ if (telephonyDisplayInfo.getOverrideNetworkType()
+ == TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_NONE) {
+ return toIconKey(telephonyDisplayInfo.getNetworkType());
+ } else {
+ return toDisplayIconKey(telephonyDisplayInfo.getOverrideNetworkType());
+ }
+ }
+
+ /**
+ * Converts the networkType into the RAT key.
+ */
+ public static String toIconKey(@Annotation.NetworkType int networkType) {
+ return Integer.toString(networkType);
+ }
+
+ /**
+ * Converts the displayNetworkType into the RAT key.
+ */
+ public static String toDisplayIconKey(@Annotation.OverrideNetworkType int displayNetworkType) {
+ switch (displayNetworkType) {
+ case TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_LTE_CA:
+ return toIconKey(TelephonyManager.NETWORK_TYPE_LTE) + "_CA";
+ case TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_LTE_ADVANCED_PRO:
+ return toIconKey(TelephonyManager.NETWORK_TYPE_LTE) + "_CA_Plus";
+ case TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_NR_NSA:
+ return toIconKey(TelephonyManager.NETWORK_TYPE_NR);
+ case TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_NR_NSA_MMWAVE:
+ return toIconKey(TelephonyManager.NETWORK_TYPE_NR) + "_Plus";
+ default:
+ return "unsupported";
+ }
+ }
+}
diff --git a/packages/SettingsLib/src/com/android/settingslib/mobile/MobileStatusTracker.java b/packages/SettingsLib/src/com/android/settingslib/mobile/MobileStatusTracker.java
new file mode 100644
index 000000000000..b8030f166436
--- /dev/null
+++ b/packages/SettingsLib/src/com/android/settingslib/mobile/MobileStatusTracker.java
@@ -0,0 +1,286 @@
+/*
+ * 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.settingslib.mobile;
+
+import android.os.Handler;
+import android.os.Looper;
+import android.telephony.PhoneStateListener;
+import android.telephony.ServiceState;
+import android.telephony.SignalStrength;
+import android.telephony.SubscriptionInfo;
+import android.telephony.SubscriptionManager;
+import android.telephony.TelephonyDisplayInfo;
+import android.telephony.TelephonyManager;
+import android.util.Log;
+
+/**
+ * Tracks the mobile signal status for the SysUI and Settings.
+ *
+ * This class is not threadsafe. All the mobile statuses monitored by this class is stored in
+ * MobileStatus. Whoever uses this class should only rely on the MobileStatusTracker#Callback
+ * to get the latest mobile statuses. Do not get mobile statues directly from
+ * MobileStatusTracker#MobileStatus.
+ */
+public class MobileStatusTracker {
+ private static final String TAG = "MobileStatusTracker";
+ private final TelephonyManager mPhone;
+ private final SubscriptionInfo mSubscriptionInfo;
+ private final Callback mCallback;
+ private final MobileStatus mMobileStatus;
+ private final PhoneStateListener mPhoneStateListener;
+ private final SubscriptionDefaults mDefaults;
+ private final Handler mReceiverHandler;
+
+ /**
+ * MobileStatusTracker constructors
+ *
+ * @param phone The TelephonyManager which corresponds to the subscription being monitored.
+ * @param receiverLooper The Looper on which the callback will be invoked.
+ * @param info The subscription being monitored.
+ * @param defaults The wrapper of the SubscriptionManager.
+ * @param callback The callback to notify any changes of the mobile status, users should only
+ * use this callback to get the latest mobile status.
+ */
+ public MobileStatusTracker(TelephonyManager phone, Looper receiverLooper,
+ SubscriptionInfo info, SubscriptionDefaults defaults, Callback callback) {
+ mPhone = phone;
+ mReceiverHandler = new Handler(receiverLooper);
+ mPhoneStateListener = new MobilePhoneStateListener();
+ mSubscriptionInfo = info;
+ mDefaults = defaults;
+ mCallback = callback;
+ mMobileStatus = new MobileStatus();
+ updateDataSim();
+ mReceiverHandler.post(() -> mCallback.onMobileStatusChanged(
+ /* updateTelephony= */false, new MobileStatus(mMobileStatus)));
+ }
+
+ public PhoneStateListener getPhoneStateListener() {
+ return mPhoneStateListener;
+ }
+
+ /**
+ * Config the MobileStatusTracker to start or stop monitoring platform signals.
+ */
+ public void setListening(boolean listening) {
+ if (listening) {
+ mPhone.registerPhoneStateListener(mReceiverHandler::post, mPhoneStateListener);
+ } else {
+ mPhone.unregisterPhoneStateListener(mPhoneStateListener);
+ }
+ }
+
+ private void updateDataSim() {
+ int activeDataSubId = mDefaults.getActiveDataSubId();
+ if (SubscriptionManager.isValidSubscriptionId(activeDataSubId)) {
+ mMobileStatus.dataSim = activeDataSubId == mSubscriptionInfo.getSubscriptionId();
+ } else {
+ // There doesn't seem to be a data sim selected, however if
+ // there isn't a MobileSignalController with dataSim set, then
+ // QS won't get any callbacks and will be blank. Instead
+ // lets just assume we are the data sim (which will basically
+ // show one at random) in QS until one is selected. The user
+ // should pick one soon after, so we shouldn't be in this state
+ // for long.
+ mMobileStatus.dataSim = true;
+ }
+ }
+
+ private void setActivity(int activity) {
+ mMobileStatus.activityIn = activity == TelephonyManager.DATA_ACTIVITY_INOUT
+ || activity == TelephonyManager.DATA_ACTIVITY_IN;
+ mMobileStatus.activityOut = activity == TelephonyManager.DATA_ACTIVITY_INOUT
+ || activity == TelephonyManager.DATA_ACTIVITY_OUT;
+ }
+
+ private class MobilePhoneStateListener extends PhoneStateListener implements
+ PhoneStateListener.ServiceStateChangedListener,
+ PhoneStateListener.SignalStrengthsChangedListener,
+ PhoneStateListener.CallStateChangedListener,
+ PhoneStateListener.DataConnectionStateChangedListener,
+ PhoneStateListener.DataActivityListener,
+ PhoneStateListener.CarrierNetworkChangeListener,
+ PhoneStateListener.ActiveDataSubscriptionIdChangedListener,
+ PhoneStateListener.DisplayInfoChangedListener{
+
+ @Override
+ public void onSignalStrengthsChanged(SignalStrength signalStrength) {
+ if (Log.isLoggable(TAG, Log.DEBUG)) {
+ Log.d(TAG, "onSignalStrengthsChanged signalStrength=" + signalStrength
+ + ((signalStrength == null) ? ""
+ : (" level=" + signalStrength.getLevel())));
+ }
+ mMobileStatus.signalStrength = signalStrength;
+ mCallback.onMobileStatusChanged(
+ /* updateTelephony= */true, new MobileStatus(mMobileStatus));
+ }
+
+ @Override
+ public void onServiceStateChanged(ServiceState state) {
+ if (Log.isLoggable(TAG, Log.DEBUG)) {
+ Log.d(TAG, "onServiceStateChanged voiceState="
+ + (state == null ? "" : state.getState())
+ + " dataState=" + (state == null ? "" : state.getDataRegistrationState()));
+ }
+ mMobileStatus.serviceState = state;
+ mCallback.onMobileStatusChanged(
+ /* updateTelephony= */true, new MobileStatus(mMobileStatus));
+ }
+
+ @Override
+ public void onDataConnectionStateChanged(int state, int networkType) {
+ if (Log.isLoggable(TAG, Log.DEBUG)) {
+ Log.d(TAG, "onDataConnectionStateChanged: state=" + state
+ + " type=" + networkType);
+ }
+ mMobileStatus.dataState = state;
+ mCallback.onMobileStatusChanged(
+ /* updateTelephony= */true, new MobileStatus(mMobileStatus));
+ }
+
+ @Override
+ public void onDataActivity(int direction) {
+ if (Log.isLoggable(TAG, Log.DEBUG)) {
+ Log.d(TAG, "onDataActivity: direction=" + direction);
+ }
+ setActivity(direction);
+ mCallback.onMobileStatusChanged(
+ /* updateTelephony= */false, new MobileStatus(mMobileStatus));
+ }
+
+ @Override
+ public void onCarrierNetworkChange(boolean active) {
+ if (Log.isLoggable(TAG, Log.DEBUG)) {
+ Log.d(TAG, "onCarrierNetworkChange: active=" + active);
+ }
+ mMobileStatus.carrierNetworkChangeMode = active;
+ mCallback.onMobileStatusChanged(
+ /* updateTelephony= */true, new MobileStatus(mMobileStatus));
+ }
+
+ @Override
+ public void onActiveDataSubscriptionIdChanged(int subId) {
+ if (Log.isLoggable(TAG, Log.DEBUG)) {
+ Log.d(TAG, "onActiveDataSubscriptionIdChanged: subId=" + subId);
+ }
+ updateDataSim();
+ mCallback.onMobileStatusChanged(
+ /* updateTelephony= */true, new MobileStatus(mMobileStatus));
+ }
+
+ @Override
+ public void onDisplayInfoChanged(TelephonyDisplayInfo telephonyDisplayInfo) {
+ if (Log.isLoggable(TAG, Log.DEBUG)) {
+ Log.d(TAG, "onDisplayInfoChanged: telephonyDisplayInfo=" + telephonyDisplayInfo);
+ }
+ mMobileStatus.telephonyDisplayInfo = telephonyDisplayInfo;
+ mCallback.onMobileStatusChanged(
+ /* updateTelephony= */ true, new MobileStatus(mMobileStatus));
+ }
+ }
+
+ /**
+ * Wrapper class of the SubscriptionManager, for mock testing purpose
+ */
+ public static class SubscriptionDefaults {
+ public int getDefaultVoiceSubId() {
+ return SubscriptionManager.getDefaultVoiceSubscriptionId();
+ }
+
+ public int getDefaultDataSubId() {
+ return SubscriptionManager.getDefaultDataSubscriptionId();
+ }
+
+ public int getActiveDataSubId() {
+ return SubscriptionManager.getActiveDataSubscriptionId();
+ }
+ }
+
+ /**
+ * Wrapper class which contains all the mobile status tracked by MobileStatusTracker.
+ */
+ public static class MobileStatus {
+ public boolean activityIn;
+ public boolean activityOut;
+ public boolean dataSim;
+ public boolean carrierNetworkChangeMode;
+ public int dataState = TelephonyManager.DATA_DISCONNECTED;
+ public ServiceState serviceState;
+ public SignalStrength signalStrength;
+ public TelephonyDisplayInfo telephonyDisplayInfo =
+ new TelephonyDisplayInfo(TelephonyManager.NETWORK_TYPE_UNKNOWN,
+ TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_NONE);
+
+ /**
+ * Empty constructor
+ */
+ public MobileStatus() { }
+
+ /**
+ * Copy constructors
+ *
+ * @param status Source MobileStatus
+ */
+ public MobileStatus(MobileStatus status) {
+ copyFrom(status);
+ }
+
+ protected void copyFrom(MobileStatus status) {
+ activityIn = status.activityIn;
+ activityOut = status.activityOut;
+ dataSim = status.dataSim;
+ carrierNetworkChangeMode = status.carrierNetworkChangeMode;
+ dataState = status.dataState;
+ // We don't do deep copy for the below members since they may be Mockito instances.
+ serviceState = status.serviceState;
+ signalStrength = status.signalStrength;
+ telephonyDisplayInfo = status.telephonyDisplayInfo;
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder builder = new StringBuilder();
+ return builder.append("[activityIn=").append(activityIn).append(',')
+ .append("activityOut=").append(activityOut).append(',')
+ .append("dataSim=").append(dataSim).append(',')
+ .append("carrierNetworkChangeMode=").append(carrierNetworkChangeMode).append(',')
+ .append("dataState=").append(dataState).append(',')
+ .append("serviceState=").append(serviceState == null ? ""
+ : serviceState.toString()).append(',')
+ .append("signalStrength=").append(signalStrength == null ? ""
+ : signalStrength.toString()).append(',')
+ .append("telephonyDisplayInfo=").append(telephonyDisplayInfo == null ? ""
+ : telephonyDisplayInfo.toString()).append(']').toString();
+ }
+ }
+
+ /**
+ * Callback for notifying any changes of the mobile status.
+ *
+ * This callback will always be invoked on the receiverLooper which must be specified when
+ * MobileStatusTracker is constructed.
+ */
+ public interface Callback {
+ /**
+ * Notify the mobile status has been updated.
+ *
+ * @param updateTelephony Whether needs to update other Telephony related parameters, this
+ * is only used by SysUI.
+ * @param mobileStatus Holds the latest mobile statuses
+ */
+ void onMobileStatusChanged(boolean updateTelephony, MobileStatus mobileStatus);
+ }
+}
diff --git a/packages/Shell/AndroidManifest.xml b/packages/Shell/AndroidManifest.xml
index cb1faf5e5163..af775cc64ae1 100644
--- a/packages/Shell/AndroidManifest.xml
+++ b/packages/Shell/AndroidManifest.xml
@@ -364,6 +364,9 @@
<!-- Permissions required for CTS tests to close system dialogs -->
<uses-permission android:name="android.permission.BROADCAST_CLOSE_SYSTEM_DIALOGS" />
+ <!-- Permission required for CTS test - HideOverlayWindowsTest -->
+ <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
+
<application android:label="@string/app_label"
android:theme="@android:style/Theme.DeviceDefault.DayNight"
android:defaultToDeviceProtectedStorage="true"
diff --git a/packages/Shell/OWNERS b/packages/Shell/OWNERS
index 2d7a3e68f86a..6ba1fcb058b1 100644
--- a/packages/Shell/OWNERS
+++ b/packages/Shell/OWNERS
@@ -1,6 +1,6 @@
set noparent
-jsharkey@google.com
+jsharkey@android.com
felipeal@google.com
nandana@google.com
svetoslavganov@google.com
diff --git a/packages/SystemUI/AndroidManifest.xml b/packages/SystemUI/AndroidManifest.xml
index 285c4a172e68..6e7b0b875294 100644
--- a/packages/SystemUI/AndroidManifest.xml
+++ b/packages/SystemUI/AndroidManifest.xml
@@ -103,6 +103,7 @@
<uses-permission android:name="android.permission.START_ACTIVITY_AS_CALLER" />
<uses-permission android:name="android.permission.START_TASKS_FROM_RECENTS" />
<uses-permission android:name="android.permission.GET_INTENT_SENDER_INTENT" />
+ <uses-permission android:name="android.permission.BROADCAST_CLOSE_SYSTEM_DIALOGS" />
<!-- WindowManager -->
<uses-permission android:name="android.permission.INTERNAL_SYSTEM_WINDOW" />
diff --git a/packages/SystemUI/OWNERS b/packages/SystemUI/OWNERS
index 3bda7106defa..f884270eaba8 100644
--- a/packages/SystemUI/OWNERS
+++ b/packages/SystemUI/OWNERS
@@ -1,6 +1,6 @@
set noparent
-dsandler@google.com
+dsandler@android.com
aaliomer@google.com
adamcohen@google.com
diff --git a/packages/SystemUI/res/layout-sw600dp-land/global_actions_grid_v2.xml b/packages/SystemUI/res/layout-sw600dp-land/global_actions_grid_v2.xml
new file mode 100644
index 000000000000..953a29e3a07e
--- /dev/null
+++ b/packages/SystemUI/res/layout-sw600dp-land/global_actions_grid_v2.xml
@@ -0,0 +1,68 @@
+<?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.
+ -->
+
+<LinearLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/global_actions_container"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="horizontal">
+
+ <LinearLayout
+ android:layout_weight="1"
+ android:layout_height="match_parent"
+ android:layout_width="0dp"
+ android:clipChildren="false"
+ android:orientation="vertical"
+ android:clipToPadding="false"
+ android:id="@+id/controls_pane"
+ >
+ <LinearLayout
+ android:id="@+id/global_actions_controls"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="vertical"/>
+ </LinearLayout>
+
+ <LinearLayout
+ android:layout_weight="1"
+ android:layout_height="match_parent"
+ android:layout_width="0dp"
+ android:orientation="vertical"
+ android:id="@+id/nfc_pane"
+ >
+ <include layout="@layout/global_actions_view" />
+
+ <include layout="@layout/global_actions_lock_view" />
+
+ <LinearLayout
+ android:id="@+id/global_actions_grid_root"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:clipChildren="false"
+ android:orientation="vertical"
+ android:clipToPadding="false">
+
+ <FrameLayout
+ android:id="@+id/global_actions_wallet"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"/>
+
+ </LinearLayout>
+
+ </LinearLayout>
+</LinearLayout>
diff --git a/packages/SystemUI/res/layout-sw600dp/global_actions_controls_list_view.xml b/packages/SystemUI/res/layout-sw600dp/global_actions_controls_list_view.xml
new file mode 100644
index 000000000000..ef49b9c3b6ad
--- /dev/null
+++ b/packages/SystemUI/res/layout-sw600dp/global_actions_controls_list_view.xml
@@ -0,0 +1,30 @@
+<!--
+ ~ 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.
+ -->
+
+<com.android.systemui.globalactions.MinHeightScrollView
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="vertical"
+ android:scrollbars="none">
+ <LinearLayout
+ android:id="@+id/global_actions_controls_list"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="vertical"
+ android:layout_marginLeft="@dimen/global_actions_side_margin"
+ android:layout_marginRight="@dimen/global_actions_side_margin" />
+</com.android.systemui.globalactions.MinHeightScrollView> \ No newline at end of file
diff --git a/packages/SystemUI/res/layout-sw600dp/global_actions_grid_v2.xml b/packages/SystemUI/res/layout-sw600dp/global_actions_grid_v2.xml
new file mode 100644
index 000000000000..6ffcef7b24e6
--- /dev/null
+++ b/packages/SystemUI/res/layout-sw600dp/global_actions_grid_v2.xml
@@ -0,0 +1,76 @@
+<?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.
+ -->
+
+<LinearLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/global_actions_container"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="vertical">
+
+ <LinearLayout
+ android:layout_weight="1"
+ android:layout_height="0dp"
+ android:layout_width="match_parent"
+ android:orientation="vertical"
+ android:id="@+id/nfc_pane"
+ >
+
+ <include layout="@layout/global_actions_view" />
+
+ <include layout="@layout/global_actions_lock_view" />
+
+
+ <com.android.systemui.globalactions.MinHeightScrollView
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="vertical"
+ android:scrollbars="none">
+
+ <LinearLayout
+ android:id="@+id/global_actions_grid_root"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:clipChildren="false"
+ android:orientation="vertical"
+ android:clipToPadding="false">
+
+ <FrameLayout
+ android:id="@+id/global_actions_wallet"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"/>
+
+ </LinearLayout>
+ </com.android.systemui.globalactions.MinHeightScrollView>
+
+ </LinearLayout>
+
+ <LinearLayout
+ android:layout_weight="1"
+ android:layout_height="0dp"
+ android:layout_width="match_parent"
+ android:orientation="vertical"
+ android:id="@+id/controls_pane"
+ android:clipToPadding="false"
+ android:clipChildren="false">
+ <LinearLayout
+ android:id="@+id/global_actions_controls"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="vertical"/>
+ </LinearLayout>
+</LinearLayout>
diff --git a/packages/SystemUI/res/layout/controls_with_favorites.xml b/packages/SystemUI/res/layout/controls_with_favorites.xml
index 065ff68774eb..b060afdc18e3 100644
--- a/packages/SystemUI/res/layout/controls_with_favorites.xml
+++ b/packages/SystemUI/res/layout/controls_with_favorites.xml
@@ -58,11 +58,5 @@
android:background="?android:attr/selectableItemBackgroundBorderless" />
</LinearLayout>
- <LinearLayout
- android:id="@+id/global_actions_controls_list"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:orientation="vertical"
- android:layout_marginLeft="@dimen/global_actions_side_margin"
- android:layout_marginRight="@dimen/global_actions_side_margin" />
+ <include layout="@layout/global_actions_controls_list_view" />
</merge>
diff --git a/packages/SystemUI/res/layout/global_actions_controls_list_view.xml b/packages/SystemUI/res/layout/global_actions_controls_list_view.xml
new file mode 100644
index 000000000000..e1c2611cc4d4
--- /dev/null
+++ b/packages/SystemUI/res/layout/global_actions_controls_list_view.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/global_actions_controls_list"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="vertical"
+ android:layout_marginLeft="@dimen/global_actions_side_margin"
+ android:layout_marginRight="@dimen/global_actions_side_margin" /> \ No newline at end of file
diff --git a/packages/SystemUI/res/layout/global_actions_grid_item_v2.xml b/packages/SystemUI/res/layout/global_actions_grid_item_v2.xml
index 99b9ced53090..14a5e584a06d 100644
--- a/packages/SystemUI/res/layout/global_actions_grid_item_v2.xml
+++ b/packages/SystemUI/res/layout/global_actions_grid_item_v2.xml
@@ -18,7 +18,7 @@
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="0dp"
android:layout_weight="1"
- android:layout_height="98dp"
+ android:layout_height="@dimen/global_actions_grid_item_layout_height"
android:gravity="bottom|center_horizontal"
android:orientation="vertical"
android:paddingTop="12dp"
diff --git a/packages/SystemUI/res/values-sw600dp/config.xml b/packages/SystemUI/res/values-sw600dp/config.xml
index be66320975d9..d886f00cf028 100644
--- a/packages/SystemUI/res/values-sw600dp/config.xml
+++ b/packages/SystemUI/res/values-sw600dp/config.xml
@@ -32,4 +32,7 @@
<!-- orientation of the dead zone when touches have recently occurred elsewhere on screen -->
<integer name="navigation_bar_deadzone_orientation">0</integer>
+ <!-- Whether wallet view is shown in landscape / seascape orientations -->
+ <bool name="global_actions_show_landscape_wallet_view">true</bool>
+
</resources>
diff --git a/packages/SystemUI/res/values-sw600dp/dimens.xml b/packages/SystemUI/res/values-sw600dp/dimens.xml
index fdf4e3b1b796..3be73ba8df25 100644
--- a/packages/SystemUI/res/values-sw600dp/dimens.xml
+++ b/packages/SystemUI/res/values-sw600dp/dimens.xml
@@ -94,4 +94,11 @@
<!-- Text size for user name in user switcher -->
<dimen name="kg_user_switcher_text_size">18sp</dimen>
+
+ <!-- TODO(himanshujaju) - add comments -->
+ <dimen name="global_actions_wallet_top_margin">5dp</dimen>
+ <dimen name="controls_header_bottom_margin">12dp</dimen>
+ <dimen name="controls_top_margin">24dp</dimen>
+
+ <dimen name="global_actions_grid_item_layout_height">80dp</dimen>
</resources>
diff --git a/packages/SystemUI/res/values/config.xml b/packages/SystemUI/res/values/config.xml
index 880dd378e390..2bf513c604bd 100644
--- a/packages/SystemUI/res/values/config.xml
+++ b/packages/SystemUI/res/values/config.xml
@@ -570,4 +570,7 @@
<bool name="config_showNotificationForUnknownBatteryState">false</bool>
<!-- content URL in a notification when ACTION_BATTERY_CHANGED.EXTRA_PRESENT field is false -->
<string translatable="false" name="config_batteryStateUnknownUrl"></string>
+
+ <!-- Whether wallet view is shown in landscape / seascape orientations -->
+ <bool name="global_actions_show_landscape_wallet_view">false</bool>
</resources>
diff --git a/packages/SystemUI/res/values/dimens.xml b/packages/SystemUI/res/values/dimens.xml
index 3a5d607e92ef..e1f7e7e56726 100644
--- a/packages/SystemUI/res/values/dimens.xml
+++ b/packages/SystemUI/res/values/dimens.xml
@@ -1005,6 +1005,7 @@
<dimen name="global_actions_grid_vertical_padding">3dp</dimen>
<dimen name="global_actions_grid_horizontal_padding">3dp</dimen>
+ <dimen name="global_actions_grid_item_layout_height">98dp</dimen>
<dimen name="global_actions_grid_item_side_margin">5dp</dimen>
<dimen name="global_actions_grid_item_vertical_margin">4dp</dimen>
<dimen name="global_actions_grid_item_width">64dp</dimen>
diff --git a/packages/SystemUI/shared/src/com/android/systemui/shared/recents/utilities/BitmapUtil.java b/packages/SystemUI/shared/src/com/android/systemui/shared/recents/utilities/BitmapUtil.java
index b79fcbd43972..325bcfc622d7 100644
--- a/packages/SystemUI/shared/src/com/android/systemui/shared/recents/utilities/BitmapUtil.java
+++ b/packages/SystemUI/shared/src/com/android/systemui/shared/recents/utilities/BitmapUtil.java
@@ -81,6 +81,7 @@ public final class BitmapUtil {
HardwareBuffer buffer = bundle.getParcelable(KEY_BUFFER);
ParcelableColorSpace colorSpace = bundle.getParcelable(KEY_COLOR_SPACE);
- return Bitmap.wrapHardwareBuffer(Objects.requireNonNull(buffer), colorSpace);
+ return Bitmap.wrapHardwareBuffer(Objects.requireNonNull(buffer),
+ colorSpace.getColorSpace());
}
}
diff --git a/packages/SystemUI/shared/src/com/android/systemui/shared/system/RecentsAnimationControllerCompat.java b/packages/SystemUI/shared/src/com/android/systemui/shared/system/RecentsAnimationControllerCompat.java
index 611c4b766b4e..fa2f8b97b039 100644
--- a/packages/SystemUI/shared/src/com/android/systemui/shared/system/RecentsAnimationControllerCompat.java
+++ b/packages/SystemUI/shared/src/com/android/systemui/shared/system/RecentsAnimationControllerCompat.java
@@ -137,4 +137,15 @@ public class RecentsAnimationControllerCompat {
return false;
}
}
+
+ /**
+ * @see IRecentsAnimationController#detachNavigationBarFromApp
+ */
+ public void detachNavigationBarFromApp() {
+ try {
+ mAnimationController.detachNavigationBarFromApp();
+ } catch (RemoteException e) {
+ Log.e(TAG, "Failed to detach the navigation bar from app", e);
+ }
+ }
} \ No newline at end of file
diff --git a/packages/SystemUI/src/com/android/systemui/accessibility/MagnificationModeSwitch.java b/packages/SystemUI/src/com/android/systemui/accessibility/MagnificationModeSwitch.java
index 267debc7dc2d..edc3216e0b81 100644
--- a/packages/SystemUI/src/com/android/systemui/accessibility/MagnificationModeSwitch.java
+++ b/packages/SystemUI/src/com/android/systemui/accessibility/MagnificationModeSwitch.java
@@ -149,7 +149,7 @@ class MagnificationModeSwitch {
}
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
- mImageView.animate().cancel();
+ stopFadeOutAnimation();
mLastDown.set(event.getRawX(), event.getRawY());
mLastDrag.set(event.getRawX(), event.getRawY());
return true;
@@ -217,13 +217,18 @@ class MagnificationModeSwitch {
AccessibilityManager.FLAG_CONTENT_ICONS
| AccessibilityManager.FLAG_CONTENT_CONTROLS);
}
+ // Refresh the time slot of the fade-out task whenever this method is called.
+ stopFadeOutAnimation();
+ mImageView.postOnAnimationDelayed(mFadeOutAnimationTask, mUiTimeout);
+ }
+
+ private void stopFadeOutAnimation() {
+ mImageView.removeCallbacks(mFadeOutAnimationTask);
if (mIsFadeOutAnimating) {
mImageView.animate().cancel();
mImageView.setAlpha(1f);
+ mIsFadeOutAnimating = false;
}
- // Refresh the time slot of the fade-out task whenever this method is called.
- mImageView.removeCallbacks(mFadeOutAnimationTask);
- mImageView.postOnAnimationDelayed(mFadeOutAnimationTask, mUiTimeout);
}
void onConfigurationChanged(int configDiff) {
diff --git a/packages/SystemUI/src/com/android/systemui/appops/AppOpsControllerImpl.java b/packages/SystemUI/src/com/android/systemui/appops/AppOpsControllerImpl.java
index 0fd47654ebb9..c289ca2173be 100644
--- a/packages/SystemUI/src/com/android/systemui/appops/AppOpsControllerImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/appops/AppOpsControllerImpl.java
@@ -438,7 +438,8 @@ public class AppOpsControllerImpl extends BroadcastReceiver implements AppOpsCon
}
@Override
- public void onOpNoted(int code, int uid, String packageName, int result) {
+ public void onOpNoted(int code, int uid, String packageName,
+ @AppOpsManager.OpFlags int flags, @AppOpsManager.Mode int result) {
if (DEBUG) {
Log.w(TAG, "Noted op: " + code + " with result "
+ AppOpsManager.MODE_NAMES[result] + " for package " + packageName);
diff --git a/packages/SystemUI/src/com/android/systemui/classifier/BrightLineFalsingManager.java b/packages/SystemUI/src/com/android/systemui/classifier/BrightLineFalsingManager.java
index e9b1abcd5999..e78057f5bd71 100644
--- a/packages/SystemUI/src/com/android/systemui/classifier/BrightLineFalsingManager.java
+++ b/packages/SystemUI/src/com/android/systemui/classifier/BrightLineFalsingManager.java
@@ -137,22 +137,22 @@ public class BrightLineFalsingManager implements FalsingManager {
mPreviousResult = !mTestHarness
&& !mDataProvider.isJustUnlockedWithFace() && !mDockManager.isDocked()
&& mClassifiers.stream().anyMatch(falsingClassifier -> {
- boolean result = falsingClassifier.classifyGesture(
+ FalsingClassifier.Result result = falsingClassifier.classifyGesture(
mHistoryTracker.falsePenalty(), mHistoryTracker.falseConfidence());
- if (result) {
+ if (result.isFalse()) {
logInfo(String.format(
(Locale) null,
"{classifier=%s, interactionType=%d}",
falsingClassifier.getClass().getName(),
mDataProvider.getInteractionType()));
- String reason = falsingClassifier.getReason();
+ String reason = result.getReason();
if (reason != null) {
logInfo(reason);
}
} else {
logDebug(falsingClassifier.getClass().getName() + ": false");
}
- return result;
+ return result.isFalse();
});
logDebug("Is false touch? " + mPreviousResult);
@@ -178,10 +178,12 @@ public class BrightLineFalsingManager implements FalsingManager {
@Override
public boolean isFalseTap(boolean robustCheck) {
- if (!mSingleTapClassifier.isTap(mDataProvider.getRecentMotionEvents())) {
+ FalsingClassifier.Result singleTapResult =
+ mSingleTapClassifier.isTap(mDataProvider.getRecentMotionEvents());
+ if (singleTapResult.isFalse()) {
logInfo(String.format(
(Locale) null, "{classifier=%s}", mSingleTapClassifier.getClass().getName()));
- String reason = mSingleTapClassifier.getReason();
+ String reason = singleTapResult.getReason();
if (reason != null) {
logInfo(reason);
}
@@ -198,16 +200,16 @@ public class BrightLineFalsingManager implements FalsingManager {
@Override
public boolean isFalseDoubleTap() {
- boolean result = mDoubleTapClassifier.classifyGesture().isFalse();
- if (result) {
+ FalsingClassifier.Result result = mDoubleTapClassifier.classifyGesture();
+ if (result.isFalse()) {
logInfo(String.format(
(Locale) null, "{classifier=%s}", mDoubleTapClassifier.getClass().getName()));
- String reason = mDoubleTapClassifier.getReason();
+ String reason = result.getReason();
if (reason != null) {
logInfo(reason);
}
}
- return result;
+ return result.isFalse();
}
@Override
diff --git a/packages/SystemUI/src/com/android/systemui/classifier/DiagonalClassifier.java b/packages/SystemUI/src/com/android/systemui/classifier/DiagonalClassifier.java
index 3a758ae0bbf5..bbb937176f59 100644
--- a/packages/SystemUI/src/com/android/systemui/classifier/DiagonalClassifier.java
+++ b/packages/SystemUI/src/com/android/systemui/classifier/DiagonalClassifier.java
@@ -66,12 +66,12 @@ class DiagonalClassifier extends FalsingClassifier {
float angle = getAngle();
if (angle == Float.MAX_VALUE) { // Unknown angle
- return new Result(false, 0);
+ return Result.passed(0);
}
if (getInteractionType() == LEFT_AFFORDANCE
|| getInteractionType() == RIGHT_AFFORDANCE) {
- return new Result(false, 0);
+ return Result.passed(0);
}
float minAngle = DIAGONAL - mHorizontalAngleRange;
@@ -81,15 +81,15 @@ class DiagonalClassifier extends FalsingClassifier {
maxAngle = DIAGONAL + mVerticalAngleRange;
}
- return new Result(angleBetween(angle, minAngle, maxAngle)
+ boolean falsed = angleBetween(angle, minAngle, maxAngle)
|| angleBetween(angle, minAngle + NINETY_DEG, maxAngle + NINETY_DEG)
|| angleBetween(angle, minAngle - NINETY_DEG, maxAngle - NINETY_DEG)
|| angleBetween(angle, minAngle + ONE_HUNDRED_EIGHTY_DEG,
- maxAngle + ONE_HUNDRED_EIGHTY_DEG), 0.5f);
+ maxAngle + ONE_HUNDRED_EIGHTY_DEG);
+ return falsed ? Result.falsed(0.5f, getReason()) : Result.passed(0.5);
}
- @Override
- String getReason() {
+ private String getReason() {
return String.format(
(Locale) null,
"{angle=%f, vertical=%s}",
diff --git a/packages/SystemUI/src/com/android/systemui/classifier/DistanceClassifier.java b/packages/SystemUI/src/com/android/systemui/classifier/DistanceClassifier.java
index 9661b57b620f..4cb5aa2cce37 100644
--- a/packages/SystemUI/src/com/android/systemui/classifier/DistanceClassifier.java
+++ b/packages/SystemUI/src/com/android/systemui/classifier/DistanceClassifier.java
@@ -148,10 +148,10 @@ class DistanceClassifier extends FalsingClassifier {
@Override
Result calculateFalsingResult(double historyPenalty, double historyConfidence) {
- return new Result(!getPassedFlingThreshold(), 0.5);
+ return !getPassedFlingThreshold()
+ ? Result.falsed(0.5, getReason()) : Result.passed(0.5);
}
- @Override
String getReason() {
DistanceVectors distanceVectors = getDistances();
@@ -169,10 +169,10 @@ class DistanceClassifier extends FalsingClassifier {
mVerticalSwipeThresholdPx);
}
- boolean isLongSwipe() {
+ Result isLongSwipe() {
boolean longSwipe = getPassedDistanceThreshold();
logDebug("Is longSwipe? " + longSwipe);
- return longSwipe;
+ return longSwipe ? Result.passed(0.5) : Result.falsed(0.5, getReason());
}
private boolean getPassedDistanceThreshold() {
diff --git a/packages/SystemUI/src/com/android/systemui/classifier/DoubleTapClassifier.java b/packages/SystemUI/src/com/android/systemui/classifier/DoubleTapClassifier.java
index 225e066d1b36..64576a97ddb2 100644
--- a/packages/SystemUI/src/com/android/systemui/classifier/DoubleTapClassifier.java
+++ b/packages/SystemUI/src/com/android/systemui/classifier/DoubleTapClassifier.java
@@ -36,8 +36,6 @@ public class DoubleTapClassifier extends FalsingClassifier {
private final float mDoubleTapSlop;
private final long mDoubleTapTimeMs;
- private StringBuilder mReason = new StringBuilder();
-
@Inject
DoubleTapClassifier(FalsingDataProvider dataProvider, SingleTapClassifier singleTapClassifier,
@Named(DOUBLE_TAP_TOUCH_SLOP) float doubleTapSlop,
@@ -54,27 +52,29 @@ public class DoubleTapClassifier extends FalsingClassifier {
Queue<? extends List<MotionEvent>> historicalEvents = getHistoricalEvents();
List<MotionEvent> firstTapEvents = historicalEvents.peek();
- mReason = new StringBuilder();
+ StringBuilder reason = new StringBuilder();
if (firstTapEvents == null) {
- mReason.append("Only one gesture recorded");
- return new Result(true, 1);
+ return Result.falsed(1, "Only one gesture recorded");
}
- return new Result(!isDoubleTap(firstTapEvents, secondTapEvents, mReason), 0.5);
+ return !isDoubleTap(firstTapEvents, secondTapEvents, reason)
+ ? Result.falsed(0.5, reason.toString()) : Result.passed(0.5);
}
/** Returns true if the two supplied lists of {@link MotionEvent}s look like a double-tap. */
public boolean isDoubleTap(List<MotionEvent> firstEvents, List<MotionEvent> secondEvents,
StringBuilder reason) {
- if (!mSingleTapClassifier.isTap(firstEvents)) {
- reason.append("First gesture is not a tap. ").append(mSingleTapClassifier.getReason());
+ Result firstTap = mSingleTapClassifier.isTap(firstEvents);
+ if (firstTap.isFalse()) {
+ reason.append("First gesture is not a tap. ").append(firstTap.getReason());
return false;
}
- if (!mSingleTapClassifier.isTap(secondEvents)) {
- reason.append("Second gesture is not a tap. ").append(mSingleTapClassifier.getReason());
+ Result secondTap = mSingleTapClassifier.isTap(secondEvents);
+ if (secondTap.isFalse()) {
+ reason.append("Second gesture is not a tap. ").append(secondTap.getReason());
return false;
}
@@ -106,9 +106,4 @@ public class DoubleTapClassifier extends FalsingClassifier {
return true;
}
-
- @Override
- String getReason() {
- return mReason.toString();
- }
}
diff --git a/packages/SystemUI/src/com/android/systemui/classifier/FalsingClassifier.java b/packages/SystemUI/src/com/android/systemui/classifier/FalsingClassifier.java
index ce5f21a3a5c4..dbfeacfa91c4 100644
--- a/packages/SystemUI/src/com/android/systemui/classifier/FalsingClassifier.java
+++ b/packages/SystemUI/src/com/android/systemui/classifier/FalsingClassifier.java
@@ -120,25 +120,32 @@ public abstract class FalsingClassifier {
void onSessionEnded() {};
/**
- * Returns true if the data captured so far looks like a false touch.
+ * Returns whether a gesture looks like a false touch.
+ *
+ * See also {@link #classifyGesture(double, double)}.
*/
Result classifyGesture() {
return calculateFalsingResult(0, 0);
}
- boolean classifyGesture(double historyPenalty, double historyConfidence) {
- return calculateFalsingResult(historyPenalty, historyConfidence).isFalse();
+ /**
+ * Returns whether a gesture looks like a false touch, with the option to consider history.
+ *
+ * Unlike the parameter-less version of this method, this method allows the classifier to take
+ * history into account, penalizing or boosting confidence in a gesture based on recent results.
+ *
+ * See also {@link #classifyGesture()}.
+ */
+ Result classifyGesture(double historyPenalty, double historyConfidence) {
+ return calculateFalsingResult(historyPenalty, historyConfidence);
}
- abstract Result calculateFalsingResult(double historyPenalty, double historyConfidence);
-
/**
- * Give the classifier a chance to log more details about why it triggered.
+ * Calculate a result based on available data.
*
- * This should only be called after a call to {@link #classifyGesture()}, and only if
- * {@link #classifyGesture()} returns true;
+ * When passed a historyConfidence of 0, the history penalty should be wholly ignored.
*/
- abstract String getReason();
+ abstract Result calculateFalsingResult(double historyPenalty, double historyConfidence);
/** */
public static void logDebug(String msg) {
@@ -155,13 +162,21 @@ public abstract class FalsingClassifier {
BrightLineFalsingManager.logError(msg);
}
+ /**
+ * A Falsing result that encapsulates the boolean result along with confidence and a reason.
+ */
static class Result {
private final boolean mFalsed;
private final double mConfidence;
+ private final String mReason;
- Result(boolean falsed, double confidence) {
+ /**
+ * See {@link #falsed(double, String)} abd {@link #passed(double)}.
+ */
+ private Result(boolean falsed, double confidence, String reason) {
mFalsed = falsed;
mConfidence = confidence;
+ mReason = reason;
}
public boolean isFalse() {
@@ -171,5 +186,23 @@ public abstract class FalsingClassifier {
public double getConfidence() {
return mConfidence;
}
+
+ public String getReason() {
+ return mReason;
+ }
+
+ /**
+ * Construct a "falsed" result indicating that a gesture should be treated as accidental.
+ */
+ static Result falsed(double confidence, String reason) {
+ return new Result(true, confidence, reason);
+ }
+
+ /**
+ * Construct a "passed" result indicating that a gesture should be allowed.
+ */
+ static Result passed(double confidence) {
+ return new Result(false, confidence, null);
+ }
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/classifier/PointerCountClassifier.java b/packages/SystemUI/src/com/android/systemui/classifier/PointerCountClassifier.java
index 6d8bb42bd01b..cd399fe15de1 100644
--- a/packages/SystemUI/src/com/android/systemui/classifier/PointerCountClassifier.java
+++ b/packages/SystemUI/src/com/android/systemui/classifier/PointerCountClassifier.java
@@ -58,18 +58,19 @@ class PointerCountClassifier extends FalsingClassifier {
@Override
Result calculateFalsingResult(double historyPenalty, double historyConfidence) {
int interactionType = getInteractionType();
- if (interactionType == QUICK_SETTINGS || interactionType == NOTIFICATION_DRAG_DOWN) {
- return new Result(mMaxPointerCount > MAX_ALLOWED_POINTERS_SWIPE_DOWN, 1);
- }
- return new Result(mMaxPointerCount > MAX_ALLOWED_POINTERS, 1);
+ int allowedPointerCount =
+ (interactionType == QUICK_SETTINGS || interactionType == NOTIFICATION_DRAG_DOWN)
+ ? MAX_ALLOWED_POINTERS_SWIPE_DOWN : MAX_ALLOWED_POINTERS;
+
+ return mMaxPointerCount > allowedPointerCount
+ ? Result.falsed(1, getReason(allowedPointerCount)) : Result.passed(0);
}
- @Override
- String getReason() {
+ private String getReason(int allowedPointerCount) {
return String.format(
(Locale) null,
"{pointersObserved=%d, threshold=%d}",
mMaxPointerCount,
- MAX_ALLOWED_POINTERS);
+ allowedPointerCount);
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/classifier/ProximityClassifier.java b/packages/SystemUI/src/com/android/systemui/classifier/ProximityClassifier.java
index 64601362454e..9ee85986c53c 100644
--- a/packages/SystemUI/src/com/android/systemui/classifier/ProximityClassifier.java
+++ b/packages/SystemUI/src/com/android/systemui/classifier/ProximityClassifier.java
@@ -33,7 +33,7 @@ import javax.inject.Inject;
/**
* False touch if proximity sensor is covered for more than a certain percentage of the gesture.
*
- * This classifer is essentially a no-op for QUICK_SETTINGS, as we assume the sensor may be
+ * This classifier is essentially a no-op for QUICK_SETTINGS, as we assume the sensor may be
* covered when swiping from the top.
*/
class ProximityClassifier extends FalsingClassifier {
@@ -114,26 +114,27 @@ class ProximityClassifier extends FalsingClassifier {
@Override
Result calculateFalsingResult(double historyPenalty, double historyConfidence) {
if (getInteractionType() == QUICK_SETTINGS) {
- return new Result(false, 0);
+ return Result.passed(0);
}
logInfo("Percent of gesture in proximity: " + mPercentNear);
if (mPercentNear > mPercentCoveredThreshold) {
- return new Result(!mDistanceClassifier.isLongSwipe(), 0.5);
+ Result longSwipeResult = mDistanceClassifier.isLongSwipe();
+ return longSwipeResult.isFalse()
+ ? Result.falsed(0.5, getReason(longSwipeResult)) : Result.passed(0.5);
}
- return new Result(false, 0.5);
+ return Result.passed(0.5);
}
- @Override
- String getReason() {
+ private String getReason(Result longSwipeResult) {
return String.format(
(Locale) null,
"{percentInProximity=%f, threshold=%f, distanceClassifier=%s}",
mPercentNear,
mPercentCoveredThreshold,
- mDistanceClassifier.getReason());
+ longSwipeResult.getReason());
}
/**
diff --git a/packages/SystemUI/src/com/android/systemui/classifier/SingleTapClassifier.java b/packages/SystemUI/src/com/android/systemui/classifier/SingleTapClassifier.java
index bcca59981740..f2622ec4e6e9 100644
--- a/packages/SystemUI/src/com/android/systemui/classifier/SingleTapClassifier.java
+++ b/packages/SystemUI/src/com/android/systemui/classifier/SingleTapClassifier.java
@@ -30,7 +30,6 @@ import javax.inject.Named;
*/
public class SingleTapClassifier extends FalsingClassifier {
private final float mTouchSlop;
- private String mReason;
@Inject
SingleTapClassifier(FalsingDataProvider dataProvider,
@@ -41,35 +40,30 @@ public class SingleTapClassifier extends FalsingClassifier {
@Override
Result calculateFalsingResult(double historyPenalty, double historyConfidence) {
- return new Result(!isTap(getRecentMotionEvents()), 0.5);
+ return isTap(getRecentMotionEvents());
}
/** Given a list of {@link android.view.MotionEvent}'s, returns true if the look like a tap. */
- public boolean isTap(List<MotionEvent> motionEvents) {
+ public Result isTap(List<MotionEvent> motionEvents) {
float downX = motionEvents.get(0).getX();
float downY = motionEvents.get(0).getY();
for (MotionEvent event : motionEvents) {
+ String reason;
if (Math.abs(event.getX() - downX) >= mTouchSlop) {
- mReason = "dX too big for a tap: "
+ reason = "dX too big for a tap: "
+ Math.abs(event.getX() - downX)
+ "vs "
+ mTouchSlop;
- return false;
+ return Result.falsed(0.5, reason);
} else if (Math.abs(event.getY() - downY) >= mTouchSlop) {
- mReason = "dY too big for a tap: "
+ reason = "dY too big for a tap: "
+ Math.abs(event.getY() - downY)
+ "vs "
+ mTouchSlop;
- return false;
+ return Result.falsed(0.5, reason);
}
}
- mReason = "";
- return true;
- }
-
- @Override
- String getReason() {
- return mReason;
+ return Result.passed(0);
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/classifier/TypeClassifier.java b/packages/SystemUI/src/com/android/systemui/classifier/TypeClassifier.java
index 3269d836859e..d470d6297170 100644
--- a/packages/SystemUI/src/com/android/systemui/classifier/TypeClassifier.java
+++ b/packages/SystemUI/src/com/android/systemui/classifier/TypeClassifier.java
@@ -43,27 +43,35 @@ public class TypeClassifier extends FalsingClassifier {
boolean up = isUp();
boolean right = isRight();
+ boolean wrongDirection = true;
switch (getInteractionType()) {
case QUICK_SETTINGS:
case PULSE_EXPAND:
case NOTIFICATION_DRAG_DOWN:
- return new Result(!vertical || up, 0.5);
+ wrongDirection = !vertical || up;
+ break;
case NOTIFICATION_DISMISS:
- return new Result(vertical, 0.5);
+ wrongDirection = vertical;
+ break;
case UNLOCK:
case BOUNCER_UNLOCK:
- return new Result(!vertical || !up, 0.5);
+ wrongDirection = !vertical || !up;
+ break;
case LEFT_AFFORDANCE: // Swiping from the bottom left corner for camera or similar.
- return new Result(!right || !up, 0.5);
+ wrongDirection = !right || !up;
+ break;
case RIGHT_AFFORDANCE: // Swiping from the bottom right corner for camera or similar.
- return new Result(right || !up, 0.5);
+ wrongDirection = right || !up;
+ break;
default:
- return new Result(true, 1);
+ wrongDirection = true;
+ break;
}
+
+ return wrongDirection ? Result.falsed(1, getReason()) : Result.passed(0.5);
}
- @Override
- String getReason() {
+ private String getReason() {
return String.format("{vertical=%s, up=%s, right=%s}", isVertical(), isUp(), isRight());
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/classifier/ZigZagClassifier.java b/packages/SystemUI/src/com/android/systemui/classifier/ZigZagClassifier.java
index 04634da47ac9..2bfb2186191b 100644
--- a/packages/SystemUI/src/com/android/systemui/classifier/ZigZagClassifier.java
+++ b/packages/SystemUI/src/com/android/systemui/classifier/ZigZagClassifier.java
@@ -95,7 +95,7 @@ class ZigZagClassifier extends FalsingClassifier {
// For vertical lines, the difference in the y direction should be small.
if (motionEvents.size() < 3) {
- return new Result(false, 0);
+ return Result.passed(0);
}
List<Point> rotatedPoints;
@@ -155,11 +155,11 @@ class ZigZagClassifier extends FalsingClassifier {
logDebug("Straightness Deviance: (" + devianceX + "," + devianceY + ") vs "
+ "(" + maxXDeviance + "," + maxYDeviance + ")");
- return new Result(devianceX > maxXDeviance || devianceY > maxYDeviance, 0.5);
+ return devianceX > maxXDeviance || devianceY > maxYDeviance
+ ? Result.falsed(0.5, getReason()) : Result.passed(0.5);
}
- @Override
- String getReason() {
+ private String getReason() {
return String.format(
(Locale) null,
"{devianceX=%f, maxDevianceX=%s, devianceY=%s, maxDevianceY=%s}",
diff --git a/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialog.java b/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialog.java
index 9c90510099a2..ad4c44767995 100644
--- a/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialog.java
+++ b/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialog.java
@@ -50,6 +50,7 @@ import android.content.IntentFilter;
import android.content.SharedPreferences;
import android.content.pm.UserInfo;
import android.content.res.ColorStateList;
+import android.content.res.Configuration;
import android.content.res.Resources;
import android.database.ContentObserver;
import android.graphics.Color;
@@ -256,6 +257,7 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener,
private UserContextProvider mUserContextProvider;
@VisibleForTesting
boolean mShowLockScreenCardsAndControls = false;
+ private int mSmallestScreenWidthDp;
@VisibleForTesting
public enum GlobalActionsEvent implements UiEventLogger.UiEventEnum {
@@ -344,6 +346,7 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener,
mSysUiState = sysUiState;
mMainHandler = handler;
mUserContextProvider = userContextProvider;
+ mSmallestScreenWidthDp = mContext.getResources().getConfiguration().smallestScreenWidthDp;
// receive broadcasts
IntentFilter filter = new IntentFilter();
@@ -760,6 +763,15 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener,
}
}
+ @Override
+ public void onConfigChanged(Configuration newConfig) {
+ if (mDialog != null && mDialog.isShowing()
+ && (newConfig.smallestScreenWidthDp != mSmallestScreenWidthDp)) {
+ mSmallestScreenWidthDp = newConfig.smallestScreenWidthDp;
+ mDialog.refreshDialog();
+ }
+ }
+
public void destroy() {
mConfigurationController.removeCallback(this);
}
@@ -2230,6 +2242,9 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener,
return;
}
+ boolean isLandscapeWalletViewShown = mContext.getResources().getBoolean(
+ com.android.systemui.R.bool.global_actions_show_landscape_wallet_view);
+
int rotation = RotationUtils.getRotation(mContext);
boolean rotationLocked = RotationPolicy.isRotationLocked(mContext);
if (rotation != RotationUtils.ROTATION_NONE) {
@@ -2246,6 +2261,10 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener,
mGlobalActionsLayout.post(() ->
RotationPolicy.setRotationLockAtAngle(
mContext, false, RotationUtils.ROTATION_NONE));
+
+ if (!isLandscapeWalletViewShown) {
+ return;
+ }
}
} else {
if (!rotationLocked) {
@@ -2253,44 +2272,48 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener,
mResetOrientationData = new ResetOrientationData();
mResetOrientationData.locked = false;
}
+ }
- // Lock to portrait, so the user doesn't accidentally hide the panel.
+ boolean shouldLockRotation = !isLandscapeWalletViewShown;
+ if (rotationLocked != shouldLockRotation) {
+ // Locks the screen to portrait if the landscape / seascape orientation does not
+ // show the wallet view, so the user doesn't accidentally hide the panel.
// This call is posted so that the rotation does not change until post-layout,
// otherwise onConfigurationChanged() may not get invoked.
mGlobalActionsLayout.post(() ->
RotationPolicy.setRotationLockAtAngle(
- mContext, true, RotationUtils.ROTATION_NONE));
+ mContext, shouldLockRotation, RotationUtils.ROTATION_NONE));
}
+ }
- // Disable rotation suggestions, if enabled
- setRotationSuggestionsEnabled(false);
-
- FrameLayout panelContainer =
- findViewById(com.android.systemui.R.id.global_actions_wallet);
- FrameLayout.LayoutParams panelParams =
- new FrameLayout.LayoutParams(
- FrameLayout.LayoutParams.MATCH_PARENT,
- FrameLayout.LayoutParams.MATCH_PARENT);
- if (!mControlsAvailable) {
- panelParams.topMargin = mContext.getResources().getDimensionPixelSize(
- com.android.systemui.R.dimen.global_actions_wallet_top_margin);
- }
- View walletView = mWalletViewController.getPanelContent();
- panelContainer.addView(walletView, panelParams);
- // Smooth transitions when wallet is resized, which can happen when a card is added
- ViewGroup root = findViewById(com.android.systemui.R.id.global_actions_grid_root);
- if (root != null) {
- walletView.addOnLayoutChangeListener((v, l, t, r, b, ol, ot, or, ob) -> {
- int oldHeight = ob - ot;
- int newHeight = b - t;
- if (oldHeight > 0 && oldHeight != newHeight) {
- TransitionSet transition = new AutoTransition()
- .setDuration(250)
- .setOrdering(TransitionSet.ORDERING_TOGETHER);
- TransitionManager.beginDelayedTransition(root, transition);
- }
- });
- }
+ // Disable rotation suggestions, if enabled
+ setRotationSuggestionsEnabled(false);
+
+ FrameLayout panelContainer =
+ findViewById(com.android.systemui.R.id.global_actions_wallet);
+ FrameLayout.LayoutParams panelParams =
+ new FrameLayout.LayoutParams(
+ FrameLayout.LayoutParams.MATCH_PARENT,
+ FrameLayout.LayoutParams.MATCH_PARENT);
+ if (!mControlsAvailable) {
+ panelParams.topMargin = mContext.getResources().getDimensionPixelSize(
+ com.android.systemui.R.dimen.global_actions_wallet_top_margin);
+ }
+ View walletView = mWalletViewController.getPanelContent();
+ panelContainer.addView(walletView, panelParams);
+ // Smooth transitions when wallet is resized, which can happen when a card is added
+ ViewGroup root = findViewById(com.android.systemui.R.id.global_actions_grid_root);
+ if (root != null) {
+ walletView.addOnLayoutChangeListener((v, l, t, r, b, ol, ot, or, ob) -> {
+ int oldHeight = ob - ot;
+ int newHeight = b - t;
+ if (oldHeight > 0 && oldHeight != newHeight) {
+ TransitionSet transition = new AutoTransition()
+ .setDuration(250)
+ .setOrdering(TransitionSet.ORDERING_TOGETHER);
+ TransitionManager.beginDelayedTransition(root, transition);
+ }
+ });
}
}
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 eb86128a82a5..9e2538977fab 100644
--- a/packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputController.java
+++ b/packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputController.java
@@ -24,6 +24,7 @@ import android.graphics.drawable.Drawable;
import android.graphics.drawable.Icon;
import android.media.MediaMetadata;
import android.media.MediaRoute2Info;
+import android.media.MediaRouter2Manager;
import android.media.RoutingSessionInfo;
import android.media.session.MediaController;
import android.media.session.MediaSessionManager;
@@ -76,6 +77,7 @@ public class MediaOutputController implements LocalMediaManager.DeviceCallback {
private final List<MediaDevice> mGroupMediaDevices = new CopyOnWriteArrayList<>();
private final boolean mAboveStatusbar;
private final NotificationEntryManager mNotificationEntryManager;
+ private final MediaRouter2Manager mRouterManager;
@VisibleForTesting
final List<MediaDevice> mMediaDevices = new CopyOnWriteArrayList<>();
@@ -104,6 +106,7 @@ public class MediaOutputController implements LocalMediaManager.DeviceCallback {
mLocalMediaManager = new LocalMediaManager(mContext, lbm, imm, packageName);
mMetricLogger = new MediaOutputMetricLogger(mContext, mPackageName);
mUiEventLogger = uiEventLogger;
+ mRouterManager = MediaRouter2Manager.getInstance(mContext);
}
void start(@NonNull Callback cb) {
@@ -134,6 +137,7 @@ public class MediaOutputController implements LocalMediaManager.DeviceCallback {
mLocalMediaManager.stopScan();
mLocalMediaManager.registerCallback(this);
mLocalMediaManager.startScan();
+ mRouterManager.startScan();
}
void stop() {
@@ -144,6 +148,9 @@ public class MediaOutputController implements LocalMediaManager.DeviceCallback {
mLocalMediaManager.unregisterCallback(this);
mLocalMediaManager.stopScan();
}
+ if (mRouterManager != null) {
+ mRouterManager.stopScan();
+ }
mMediaDevices.clear();
}
diff --git a/packages/SystemUI/src/com/android/systemui/people/PeopleSpaceUtils.java b/packages/SystemUI/src/com/android/systemui/people/PeopleSpaceUtils.java
index dddd39b17209..bc9500a68a52 100644
--- a/packages/SystemUI/src/com/android/systemui/people/PeopleSpaceUtils.java
+++ b/packages/SystemUI/src/com/android/systemui/people/PeopleSpaceUtils.java
@@ -21,7 +21,6 @@ import android.app.PendingIntent;
import android.app.people.ConversationChannel;
import android.app.people.IPeopleManager;
import android.app.people.PeopleSpaceTile;
-import android.appwidget.AppWidgetHost;
import android.appwidget.AppWidgetManager;
import android.content.Context;
import android.content.Intent;
@@ -120,8 +119,7 @@ public class PeopleSpaceUtils {
e -> e.getValue().getId().equals(shortcutId)).findFirst();
if (!entry.isPresent() || shortcutId == null) {
if (DEBUG) Log.d(TAG, "Matching conversation not found for shortcut ID");
- AppWidgetHost host = new AppWidgetHost(context, 0);
- host.deleteAppWidgetId(appWidgetId);
+ //TODO: Delete app widget id when crash is fixed (b/175486868)
continue;
}
PeopleSpaceTile tile = entry.get().getValue();
diff --git a/packages/SystemUI/src/com/android/systemui/qs/QuickQSPanel.java b/packages/SystemUI/src/com/android/systemui/qs/QuickQSPanel.java
index c89f8e58f980..6074ef6156c3 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/QuickQSPanel.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/QuickQSPanel.java
@@ -252,11 +252,9 @@ public class QuickQSPanel extends QSPanel {
final int availableWidth = getMeasuredWidth() - getPaddingStart() - getPaddingEnd();
final int leftoverWhitespace = availableWidth - maxTiles * mCellWidth;
- final int smallestHorizontalMarginNeeded;
- smallestHorizontalMarginNeeded = leftoverWhitespace / Math.max(1, maxTiles - 1);
- if (smallestHorizontalMarginNeeded > 0){
- mCellMarginHorizontal = smallestHorizontalMarginNeeded;
+ if (leftoverWhitespace > 0) {
+ mCellMarginHorizontal = leftoverWhitespace / Math.max(1, maxTiles);
mColumns = maxTiles;
} else{
mColumns = mCellWidth == 0 ? 1 :
@@ -266,7 +264,7 @@ public class QuickQSPanel extends QSPanel {
mCellMarginHorizontal = (availableWidth - mCellWidth) / 2;
} else {
mCellMarginHorizontal =
- (availableWidth - mColumns * mCellWidth) / (mColumns - 1);
+ (availableWidth - mColumns * mCellWidth) / mColumns;
}
}
@@ -310,7 +308,8 @@ public class QuickQSPanel extends QSPanel {
// Only one column/tile. Use the margin to center the tile.
return getPaddingStart() + mCellMarginHorizontal;
}
- return getPaddingStart() + column * (mCellWidth + mCellMarginHorizontal);
+ return getPaddingStart() + mCellMarginHorizontal / 2
+ + column * (mCellWidth + mCellMarginHorizontal);
}
@Override
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/LockscreenLockIconController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/LockscreenLockIconController.java
index 547a3705266a..6bdc303b4786 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/LockscreenLockIconController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/LockscreenLockIconController.java
@@ -37,6 +37,7 @@ import androidx.annotation.Nullable;
import com.android.internal.logging.nano.MetricsProto;
import com.android.internal.widget.LockPatternUtils;
+import com.android.keyguard.KeyguardSecurityModel;
import com.android.keyguard.KeyguardUpdateMonitor;
import com.android.keyguard.KeyguardUpdateMonitorCallback;
import com.android.settingslib.Utils;
@@ -78,6 +79,7 @@ public class LockscreenLockIconController {
private final KeyguardStateController mKeyguardStateController;
private final Resources mResources;
private final HeadsUpManagerPhone mHeadsUpManagerPhone;
+ private final KeyguardSecurityModel mKeyguardSecurityModel;
private boolean mKeyguardShowing;
private boolean mKeyguardJustShown;
private boolean mBlockUpdates;
@@ -326,7 +328,8 @@ public class LockscreenLockIconController {
@Nullable DockManager dockManager,
KeyguardStateController keyguardStateController,
@Main Resources resources,
- HeadsUpManagerPhone headsUpManagerPhone) {
+ HeadsUpManagerPhone headsUpManagerPhone,
+ KeyguardSecurityModel keyguardSecurityModel) {
mLockscreenGestureLogger = lockscreenGestureLogger;
mKeyguardUpdateMonitor = keyguardUpdateMonitor;
mLockPatternUtils = lockPatternUtils;
@@ -341,6 +344,7 @@ public class LockscreenLockIconController {
mKeyguardStateController = keyguardStateController;
mResources = resources;
mHeadsUpManagerPhone = headsUpManagerPhone;
+ mKeyguardSecurityModel = keyguardSecurityModel;
mKeyguardIndicationController.setLockIconController(this);
}
@@ -541,13 +545,20 @@ public class LockscreenLockIconController {
* @return true if the visibility changed
*/
private boolean updateIconVisibility() {
+ if (mLockIcon == null) {
+ return false;
+ }
+
if (mKeyguardUpdateMonitor.isUdfpsEnrolled()) {
boolean changed = mLockIcon.getVisibility() == GONE;
mLockIcon.setVisibility(GONE);
return changed;
}
+
boolean onAodOrDocked = mStatusBarStateController.isDozing() || mDocked;
- boolean invisible = onAodOrDocked || mWakeAndUnlockRunning || mShowingLaunchAffordance;
+ boolean invisible = onAodOrDocked || mWakeAndUnlockRunning || mShowingLaunchAffordance
+ || (mKeyguardSecurityModel.getSecurityMode(KeyguardUpdateMonitor.getCurrentUser())
+ == KeyguardSecurityModel.SecurityMode.None);
boolean fingerprintOrBypass = mFingerprintUnlock
|| mKeyguardBypassController.getBypassEnabled();
if (fingerprintOrBypass && !mBouncerShowingScrimmed) {
@@ -559,11 +570,6 @@ public class LockscreenLockIconController {
invisible = true;
}
}
-
- if (mLockIcon == null) {
- return false;
- }
-
return mLockIcon.updateIconVisibility(!invisible);
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java
index 01a729235eda..8d3b12868dd7 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java
@@ -1140,6 +1140,7 @@ public class NotificationPanelViewController extends PanelViewController {
if (isFullyCollapsed()) {
expand(true /* animate */);
} else {
+ traceQsJank(true /* startTracing */, false /* wasCancelled */);
flingSettings(0 /* velocity */, FLING_EXPAND);
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelViewController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelViewController.java
index 5a01f471d0cd..8ed971087508 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelViewController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelViewController.java
@@ -862,6 +862,8 @@ public abstract class PanelViewController {
mView.getViewTreeObserver().removeOnGlobalLayoutListener(this);
if (mAnimateAfterExpanding) {
notifyExpandingStarted();
+ InteractionJankMonitor.getInstance().begin(
+ CUJ_NOTIFICATION_SHADE_EXPAND_COLLAPSE);
fling(0, true /* expand */);
} else {
setExpandedFraction(1f);
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/MobileSignalController.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/MobileSignalController.java
index 49be648755c3..dd9165d0697b 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/MobileSignalController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/MobileSignalController.java
@@ -15,6 +15,10 @@
*/
package com.android.systemui.statusbar.policy;
+import static com.android.settingslib.mobile.MobileMappings.getIconKey;
+import static com.android.settingslib.mobile.MobileMappings.toDisplayIconKey;
+import static com.android.settingslib.mobile.MobileMappings.toIconKey;
+
import android.content.Context;
import android.content.Intent;
import android.database.ContentObserver;
@@ -22,10 +26,8 @@ import android.net.NetworkCapabilities;
import android.os.Handler;
import android.os.Looper;
import android.provider.Settings.Global;
-import android.telephony.Annotation;
import android.telephony.CellSignalStrength;
import android.telephony.CellSignalStrengthCdma;
-import android.telephony.PhoneStateListener;
import android.telephony.ServiceState;
import android.telephony.SignalStrength;
import android.telephony.SubscriptionInfo;
@@ -39,12 +41,13 @@ import android.util.Log;
import com.android.internal.annotations.VisibleForTesting;
import com.android.settingslib.Utils;
import com.android.settingslib.graph.SignalDrawable;
+import com.android.settingslib.mobile.MobileStatusTracker;
+import com.android.settingslib.mobile.MobileStatusTracker.SubscriptionDefaults;
import com.android.settingslib.net.SignalStrengthUtil;
import com.android.systemui.R;
import com.android.systemui.statusbar.policy.NetworkController.IconState;
import com.android.systemui.statusbar.policy.NetworkController.SignalCallback;
import com.android.systemui.statusbar.policy.NetworkControllerImpl.Config;
-import com.android.systemui.statusbar.policy.NetworkControllerImpl.SubscriptionDefaults;
import java.io.PrintWriter;
import java.util.BitSet;
@@ -52,8 +55,6 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
-import java.util.concurrent.Executor;
-
public class MobileSignalController extends SignalController<
MobileSignalController.MobileState, MobileSignalController.MobileIconGroup> {
@@ -62,14 +63,10 @@ public class MobileSignalController extends SignalController<
private final String mNetworkNameDefault;
private final String mNetworkNameSeparator;
private final ContentObserver mObserver;
- @VisibleForTesting
- final PhoneStateListener mPhoneStateListener;
// Save entire info for logging, we only use the id.
final SubscriptionInfo mSubscriptionInfo;
-
// @VisibleForDemoMode
final Map<String, MobileIconGroup> mNetworkToIconLookup;
-
// Since some pieces of the phone state are interdependent we store it locally,
// this could potentially become part of MobileState for simplification/complication
// of code.
@@ -83,6 +80,9 @@ public class MobileSignalController extends SignalController<
private Config mConfig;
@VisibleForTesting
boolean mInflateSignalStrengths = false;
+ private MobileStatusTracker.Callback mCallback;
+ @VisibleForTesting
+ MobileStatusTracker mMobileStatusTracker;
// TODO: Reduce number of vars passed in, if we have the NetworkController, probably don't
// need listener lists anymore.
@@ -98,28 +98,42 @@ public class MobileSignalController extends SignalController<
mPhone = phone;
mDefaults = defaults;
mSubscriptionInfo = info;
- mPhoneStateListener = new MobilePhoneStateListener((new Handler(receiverLooper))::post);
mNetworkNameSeparator = getTextIfExists(R.string.status_bar_network_name_separator)
.toString();
mNetworkNameDefault = getTextIfExists(
com.android.internal.R.string.lockscreen_carrier_default).toString();
-
mapIconSets();
-
String networkName = info.getCarrierName() != null ? info.getCarrierName().toString()
: mNetworkNameDefault;
mLastState.networkName = mCurrentState.networkName = networkName;
mLastState.networkNameData = mCurrentState.networkNameData = networkName;
mLastState.enabled = mCurrentState.enabled = hasMobileData;
mLastState.iconGroup = mCurrentState.iconGroup = mDefaultIcons;
- // Get initial data sim state.
- updateDataSim();
mObserver = new ContentObserver(new Handler(receiverLooper)) {
@Override
public void onChange(boolean selfChange) {
updateTelephony();
}
};
+ mCallback = new MobileStatusTracker.Callback() {
+ @Override
+ public void onMobileStatusChanged(boolean updateTelephony,
+ MobileStatusTracker.MobileStatus mobileStatus) {
+ if (Log.isLoggable(mTag, Log.DEBUG)) {
+ Log.d(mTag, "onMobileStatusChanged="
+ + " updateTelephony=" + updateTelephony
+ + " mobileStatus=" + mobileStatus.toString());
+ }
+ updateMobileStatus(mobileStatus);
+ if (updateTelephony) {
+ updateTelephony();
+ } else {
+ notifyListenersIfNecessary();
+ }
+ }
+ };
+ mMobileStatusTracker = new MobileStatusTracker(mPhone, receiverLooper,
+ info, mDefaults, mCallback);
}
public void setConfiguration(Config config) {
@@ -157,15 +171,7 @@ public class MobileSignalController extends SignalController<
* Start listening for phone state changes.
*/
public void registerListener() {
- mPhone.listen(mPhoneStateListener,
- PhoneStateListener.LISTEN_SERVICE_STATE
- | PhoneStateListener.LISTEN_SIGNAL_STRENGTHS
- | PhoneStateListener.LISTEN_CALL_STATE
- | PhoneStateListener.LISTEN_DATA_CONNECTION_STATE
- | PhoneStateListener.LISTEN_DATA_ACTIVITY
- | PhoneStateListener.LISTEN_CARRIER_NETWORK_CHANGE
- | PhoneStateListener.LISTEN_ACTIVE_DATA_SUBSCRIPTION_ID_CHANGE
- | PhoneStateListener.LISTEN_DISPLAY_INFO_CHANGED);
+ mMobileStatusTracker.setListening(true);
mContext.getContentResolver().registerContentObserver(Global.getUriFor(Global.MOBILE_DATA),
true, mObserver);
mContext.getContentResolver().registerContentObserver(Global.getUriFor(
@@ -177,7 +183,7 @@ public class MobileSignalController extends SignalController<
* Stop listening for phone state changes.
*/
public void unregisterListener() {
- mPhone.listen(mPhoneStateListener, 0);
+ mMobileStatusTracker.setListening(false);
mContext.getContentResolver().unregisterContentObserver(mObserver);
}
@@ -288,34 +294,6 @@ public class MobileSignalController extends SignalController<
TelephonyIcons.NR_5G);
}
- private String getIconKey() {
- if (mTelephonyDisplayInfo.getOverrideNetworkType()
- == TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_NONE) {
- return toIconKey(mTelephonyDisplayInfo.getNetworkType());
- } else {
- return toDisplayIconKey(mTelephonyDisplayInfo.getOverrideNetworkType());
- }
- }
-
- private String toIconKey(@Annotation.NetworkType int networkType) {
- return Integer.toString(networkType);
- }
-
- private String toDisplayIconKey(@Annotation.OverrideNetworkType int displayNetworkType) {
- switch (displayNetworkType) {
- case TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_LTE_CA:
- return toIconKey(TelephonyManager.NETWORK_TYPE_LTE) + "_CA";
- case TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_LTE_ADVANCED_PRO:
- return toIconKey(TelephonyManager.NETWORK_TYPE_LTE) + "_CA_Plus";
- case TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_NR_NSA:
- return toIconKey(TelephonyManager.NETWORK_TYPE_NR);
- case TelephonyDisplayInfo.OVERRIDE_NETWORK_TYPE_NR_NSA_MMWAVE:
- return toIconKey(TelephonyManager.NETWORK_TYPE_NR) + "_Plus";
- default:
- return "unsupported";
- }
- }
-
private void updateInflateSignalStrength() {
mInflateSignalStrengths = SignalStrengthUtil.shouldInflateSignalStrength(mContext,
mSubscriptionInfo.getSubscriptionId());
@@ -521,13 +499,24 @@ public class MobileSignalController extends SignalController<
return CellSignalStrength.SIGNAL_STRENGTH_NONE_OR_UNKNOWN;
}
+ private void updateMobileStatus(MobileStatusTracker.MobileStatus mobileStatus) {
+ mCurrentState.activityIn = mobileStatus.activityIn;
+ mCurrentState.activityOut = mobileStatus.activityOut;
+ mCurrentState.dataSim = mobileStatus.dataSim;
+ mCurrentState.carrierNetworkChangeMode = mobileStatus.carrierNetworkChangeMode;
+ mDataState = mobileStatus.dataState;
+ mServiceState = mobileStatus.serviceState;
+ mSignalStrength = mobileStatus.signalStrength;
+ mTelephonyDisplayInfo = mobileStatus.telephonyDisplayInfo;
+ }
+
/**
* Updates the current state based on mServiceState, mSignalStrength, mDataState,
* mTelephonyDisplayInfo, and mSimState. It should be called any time one of these is updated.
* This will call listeners if necessary.
*/
private final void updateTelephony() {
- if (DEBUG) {
+ if (Log.isLoggable(mTag, Log.DEBUG)) {
Log.d(mTag, "updateTelephonySignalStrength: hasService=" +
Utils.isInService(mServiceState) + " ss=" + mSignalStrength
+ " displayInfo=" + mTelephonyDisplayInfo);
@@ -542,7 +531,7 @@ public class MobileSignalController extends SignalController<
}
}
- String iconKey = getIconKey();
+ String iconKey = getIconKey(mTelephonyDisplayInfo);
if (mNetworkToIconLookup.get(iconKey) != null) {
mCurrentState.iconGroup = mNetworkToIconLookup.get(iconKey);
} else {
@@ -622,75 +611,6 @@ public class MobileSignalController extends SignalController<
pw.println(" isDataDisabled=" + isDataDisabled() + ",");
}
- class MobilePhoneStateListener extends PhoneStateListener {
- public MobilePhoneStateListener(Executor executor) {
- super(executor);
- }
-
- @Override
- public void onSignalStrengthsChanged(SignalStrength signalStrength) {
- if (DEBUG) {
- Log.d(mTag, "onSignalStrengthsChanged signalStrength=" + signalStrength +
- ((signalStrength == null) ? "" : (" level=" + signalStrength.getLevel())));
- }
- mSignalStrength = signalStrength;
- updateTelephony();
- }
-
- @Override
- public void onServiceStateChanged(ServiceState state) {
- if (DEBUG) {
- Log.d(mTag, "onServiceStateChanged voiceState=" + state.getState()
- + " dataState=" + state.getDataRegistrationState());
- }
- mServiceState = state;
- updateTelephony();
- }
-
- @Override
- public void onDataConnectionStateChanged(int state, int networkType) {
- if (DEBUG) {
- Log.d(mTag, "onDataConnectionStateChanged: state=" + state
- + " type=" + networkType);
- }
- mDataState = state;
- updateTelephony();
- }
-
- @Override
- public void onDataActivity(int direction) {
- if (DEBUG) {
- Log.d(mTag, "onDataActivity: direction=" + direction);
- }
- setActivity(direction);
- }
-
- @Override
- public void onCarrierNetworkChange(boolean active) {
- if (DEBUG) {
- Log.d(mTag, "onCarrierNetworkChange: active=" + active);
- }
- mCurrentState.carrierNetworkChangeMode = active;
- updateTelephony();
- }
-
- @Override
- public void onActiveDataSubscriptionIdChanged(int subId) {
- if (DEBUG) Log.d(mTag, "onActiveDataSubscriptionIdChanged: subId=" + subId);
- updateDataSim();
- updateTelephony();
- }
-
- @Override
- public void onDisplayInfoChanged(TelephonyDisplayInfo telephonyDisplayInfo) {
- if (DEBUG) {
- Log.d(mTag, "onDisplayInfoChanged: telephonyDisplayInfo=" + telephonyDisplayInfo);
- }
- mTelephonyDisplayInfo = telephonyDisplayInfo;
- updateTelephony();
- }
- }
-
static class MobileIconGroup extends SignalController.IconGroup {
final int mDataContentDescription; // mContentDescriptionDataType
final int mDataType;
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkControllerImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkControllerImpl.java
index 62b922e23532..a3abb31a36e4 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkControllerImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkControllerImpl.java
@@ -59,6 +59,7 @@ import androidx.annotation.NonNull;
import com.android.internal.annotations.GuardedBy;
import com.android.internal.annotations.VisibleForTesting;
+import com.android.settingslib.mobile.MobileStatusTracker.SubscriptionDefaults;
import com.android.settingslib.net.DataUsageController;
import com.android.systemui.Dumpable;
import com.android.systemui.R;
@@ -391,7 +392,6 @@ public class NetworkControllerImpl extends BroadcastReceiver
}
}
});
-
updateMobileControllers();
// Initial setup of emergency information. Handled as if we had received a sticky broadcast
@@ -1202,20 +1202,6 @@ public class NetworkControllerImpl extends BroadcastReceiver
}
};
- public static class SubscriptionDefaults {
- public int getDefaultVoiceSubId() {
- return SubscriptionManager.getDefaultVoiceSubscriptionId();
- }
-
- public int getDefaultDataSubId() {
- return SubscriptionManager.getDefaultDataSubscriptionId();
- }
-
- public int getActiveDataSubId() {
- return SubscriptionManager.getActiveDataSubscriptionId();
- }
- }
-
@VisibleForTesting
static class Config {
boolean showAtLeast3G = false;
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/SmartReplyView.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/SmartReplyView.java
index e7f84a55eb5f..34c78813d11a 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/SmartReplyView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/SmartReplyView.java
@@ -102,8 +102,7 @@ public class SmartReplyView extends ViewGroup {
mHeightUpperLimit = NotificationUtils.getFontScaledHeight(mContext,
R.dimen.smart_reply_button_max_height);
- mCurrentBackgroundColor = context.getColor(R.color.smart_reply_button_background);
- mDefaultBackgroundColor = mCurrentBackgroundColor;
+ mDefaultBackgroundColor = context.getColor(R.color.smart_reply_button_background);
mDefaultTextColor = mContext.getColor(R.color.smart_reply_button_text);
mDefaultTextColorDarkBg = mContext.getColor(R.color.smart_reply_button_text_dark_bg);
mDefaultStrokeColor = mContext.getColor(R.color.smart_reply_button_stroke);
@@ -142,8 +141,9 @@ public class SmartReplyView extends ViewGroup {
mSingleToDoubleLineButtonWidthIncrease =
2 * (doubleLineButtonPaddingHorizontal - singleLineButtonPaddingHorizontal);
-
mBreakIterator = BreakIterator.getLineInstance();
+
+ setBackgroundTintColor(mDefaultBackgroundColor);
reallocateCandidateButtonQueueForSqueezing();
}
@@ -182,7 +182,7 @@ public class SmartReplyView extends ViewGroup {
public void resetSmartSuggestions(View newSmartReplyContainer) {
mSmartReplyContainer = newSmartReplyContainer;
removeAllViews();
- mCurrentBackgroundColor = mDefaultBackgroundColor;
+ setBackgroundTintColor(mDefaultBackgroundColor);
}
/** Add buttons to the {@link SmartReplyView} */
diff --git a/packages/SystemUI/src/com/android/systemui/wmshell/WMShellBaseModule.java b/packages/SystemUI/src/com/android/systemui/wmshell/WMShellBaseModule.java
index 71a883d20988..ee58947a691c 100644
--- a/packages/SystemUI/src/com/android/systemui/wmshell/WMShellBaseModule.java
+++ b/packages/SystemUI/src/com/android/systemui/wmshell/WMShellBaseModule.java
@@ -37,6 +37,7 @@ import com.android.wm.shell.FullscreenTaskListener;
import com.android.wm.shell.ShellCommandHandler;
import com.android.wm.shell.ShellInit;
import com.android.wm.shell.ShellTaskOrganizer;
+import com.android.wm.shell.Transitions;
import com.android.wm.shell.WindowManagerShellWrapper;
import com.android.wm.shell.apppairs.AppPairs;
import com.android.wm.shell.bubbles.BubbleController;
@@ -56,8 +57,6 @@ import com.android.wm.shell.common.annotations.ShellMainThread;
import com.android.wm.shell.draganddrop.DragAndDropController;
import com.android.wm.shell.hidedisplaycutout.HideDisplayCutout;
import com.android.wm.shell.hidedisplaycutout.HideDisplayCutoutController;
-import com.android.wm.shell.letterbox.LetterboxConfigController;
-import com.android.wm.shell.letterbox.LetterboxTaskListener;
import com.android.wm.shell.onehanded.OneHanded;
import com.android.wm.shell.onehanded.OneHandedController;
import com.android.wm.shell.pip.Pip;
@@ -172,15 +171,15 @@ public abstract class WMShellBaseModule {
ShellTaskOrganizer shellTaskOrganizer,
Optional<SplitScreen> splitScreenOptional,
Optional<AppPairs> appPairsOptional,
- LetterboxTaskListener letterboxTaskListener,
- FullscreenTaskListener fullscreenTaskListener) {
+ FullscreenTaskListener fullscreenTaskListener,
+ Transitions transitions) {
return new ShellInit(displayImeController,
dragAndDropController,
shellTaskOrganizer,
splitScreenOptional,
appPairsOptional,
- letterboxTaskListener,
- fullscreenTaskListener);
+ fullscreenTaskListener,
+ transitions);
}
/**
@@ -195,11 +194,9 @@ public abstract class WMShellBaseModule {
Optional<Pip> pipOptional,
Optional<OneHanded> oneHandedOptional,
Optional<HideDisplayCutout> hideDisplayCutout,
- Optional<AppPairs> appPairsOptional,
- LetterboxConfigController letterboxConfigController) {
+ Optional<AppPairs> appPairsOptional) {
return Optional.of(new ShellCommandHandler(shellTaskOrganizer, splitScreenOptional,
- pipOptional, oneHandedOptional, hideDisplayCutout, appPairsOptional,
- letterboxConfigController));
+ pipOptional, oneHandedOptional, hideDisplayCutout, appPairsOptional));
}
@WMSingleton
@@ -278,12 +275,9 @@ public abstract class WMShellBaseModule {
@WMSingleton
@Provides
- static ShellTaskOrganizer provideShellTaskOrganizer(SyncTransactionQueue syncQueue,
- @ShellMainThread ShellExecutor shellMainExecutor,
- @ShellAnimationThread ShellExecutor shellAnimationExecutor,
- TransactionPool transactionPool, Context context) {
- return new ShellTaskOrganizer(syncQueue, transactionPool, shellMainExecutor,
- shellAnimationExecutor, context);
+ static ShellTaskOrganizer provideShellTaskOrganizer(@ShellMainThread ShellExecutor mainExecutor,
+ Context context) {
+ return new ShellTaskOrganizer(mainExecutor, context);
}
@WMSingleton
@@ -338,16 +332,9 @@ public abstract class WMShellBaseModule {
@WMSingleton
@Provides
- static LetterboxTaskListener provideLetterboxTaskListener(
- SyncTransactionQueue syncQueue,
- LetterboxConfigController letterboxConfigController,
- WindowManager windowManager) {
- return new LetterboxTaskListener(syncQueue, letterboxConfigController, windowManager);
- }
-
- @WMSingleton
- @Provides
- static LetterboxConfigController provideLetterboxConfigController(Context context) {
- return new LetterboxConfigController(context);
+ static Transitions provideTransitions(ShellTaskOrganizer organizer, TransactionPool pool,
+ @ShellMainThread ShellExecutor mainExecutor,
+ @ShellAnimationThread ShellExecutor animExecutor) {
+ return new Transitions(organizer, pool, mainExecutor, animExecutor);
}
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/accessibility/MagnificationModeSwitchTest.java b/packages/SystemUI/tests/src/com/android/systemui/accessibility/MagnificationModeSwitchTest.java
index 0451d45a628b..96f3c156c978 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/accessibility/MagnificationModeSwitchTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/accessibility/MagnificationModeSwitchTest.java
@@ -33,6 +33,7 @@ import static junit.framework.Assert.assertNotNull;
import static org.hamcrest.CoreMatchers.hasItems;
import static org.hamcrest.MatcherAssert.assertThat;
+import static org.junit.Assert.assertNull;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyInt;
import static org.mockito.ArgumentMatchers.anyLong;
@@ -91,6 +92,7 @@ public class MagnificationModeSwitchTest extends SysuiTestCase {
private MagnificationModeSwitch mMagnificationModeSwitch;
private View.OnTouchListener mTouchListener;
private List<MotionEvent> mMotionEvents = new ArrayList<>();
+ private Runnable mFadeOutAnimation;
@Before
public void setUp() throws Exception {
@@ -119,6 +121,7 @@ public class MagnificationModeSwitchTest extends SysuiTestCase {
event.recycle();
}
mMotionEvents.clear();
+ mFadeOutAnimation = null;
}
@Test
@@ -164,15 +167,9 @@ public class MagnificationModeSwitchTest extends SysuiTestCase {
}
@Test
- public void showMagnificationButton_windowMode_verifyAnimationEndAction() {
- // Execute the runnable immediately to run the animation.
- doAnswer((invocation) -> {
- final Runnable action = invocation.getArgument(0);
- action.run();
- return null;
- }).when(mSpyImageView).postOnAnimationDelayed(any(Runnable.class), anyLong());
-
+ public void showMagnificationButton_windowModeAndFadingOut_verifyAnimationEndAction() {
mMagnificationModeSwitch.showButton(ACCESSIBILITY_MAGNIFICATION_MODE_WINDOW);
+ executeFadeOutAnimation();
// Verify the end action after fade-out.
final ArgumentCaptor<Runnable> endActionCaptor = ArgumentCaptor.forClass(Runnable.class);
@@ -207,9 +204,6 @@ public class MagnificationModeSwitchTest extends SysuiTestCase {
final long downTime = SystemClock.uptimeMillis();
mTouchListener.onTouch(mSpyImageView,
obtainMotionEvent(downTime, 0, ACTION_DOWN, 100, 100));
-
- verify(mViewPropertyAnimator).cancel();
-
resetAndStubMockImageViewAndAnimator();
mTouchListener.onTouch(mSpyImageView,
obtainMotionEvent(downTime, downTime, ACTION_UP, 100, 100));
@@ -218,6 +212,31 @@ public class MagnificationModeSwitchTest extends SysuiTestCase {
}
@Test
+ public void sendDownEvent_fullscreenMode_fadeOutAnimationIsNull() {
+ mMagnificationModeSwitch.showButton(ACCESSIBILITY_MAGNIFICATION_MODE_FULLSCREEN);
+ resetAndStubMockImageViewAndAnimator();
+
+ final long downTime = SystemClock.uptimeMillis();
+ mTouchListener.onTouch(mSpyImageView,
+ obtainMotionEvent(downTime, 0, ACTION_DOWN, 100, 100));
+
+ assertNull(mFadeOutAnimation);
+ }
+
+ @Test
+ public void sendDownEvent_fullscreenModeAndFadingOut_cancelAnimation() {
+ mMagnificationModeSwitch.showButton(ACCESSIBILITY_MAGNIFICATION_MODE_FULLSCREEN);
+ executeFadeOutAnimation();
+ resetAndStubMockImageViewAndAnimator();
+
+ final long downTime = SystemClock.uptimeMillis();
+ mTouchListener.onTouch(mSpyImageView,
+ obtainMotionEvent(downTime, 0, ACTION_DOWN, 100, 100));
+
+ verify(mViewPropertyAnimator).cancel();
+ }
+
+ @Test
public void performDragging_showMagnificationButton_updateViewLayout() {
mMagnificationModeSwitch.showButton(ACCESSIBILITY_MAGNIFICATION_MODE_FULLSCREEN);
resetAndStubMockImageViewAndAnimator();
@@ -229,7 +248,6 @@ public class MagnificationModeSwitchTest extends SysuiTestCase {
final long downTime = SystemClock.uptimeMillis();
mTouchListener.onTouch(mSpyImageView, obtainMotionEvent(
downTime, 0, ACTION_DOWN, 100, 100));
- verify(mViewPropertyAnimator).cancel();
mTouchListener.onTouch(mSpyImageView,
obtainMotionEvent(downTime, downTime, ACTION_MOVE, 100 + offset,
@@ -384,6 +402,16 @@ public class MagnificationModeSwitchTest extends SysuiTestCase {
return null;
}).when(mSpyImageView).post(any(Runnable.class));
doReturn(mViewPropertyAnimator).when(mSpyImageView).animate();
+ doAnswer((invocation) -> {
+ mFadeOutAnimation = invocation.getArgument(0);
+ return null;
+ }).when(mSpyImageView).postOnAnimationDelayed(any(Runnable.class), anyLong());
+ doAnswer((invocation) -> {
+ if (mFadeOutAnimation == invocation.getArgument(0)) {
+ mFadeOutAnimation = null;
+ }
+ return null;
+ }).when(mSpyImageView).removeCallbacks(any(Runnable.class));
}
private void resetAndStubMockAnimator() {
@@ -412,4 +440,10 @@ public class MagnificationModeSwitchTest extends SysuiTestCase {
mMotionEvents.add(event);
return event;
}
+
+ private void executeFadeOutAnimation() {
+ assertNotNull(mFadeOutAnimation);
+ mFadeOutAnimation.run();
+ mFadeOutAnimation = null;
+ }
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/appops/AppOpsControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/appops/AppOpsControllerTest.java
index ade329011b7d..02143a750cae 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/appops/AppOpsControllerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/appops/AppOpsControllerTest.java
@@ -150,7 +150,7 @@ public class AppOpsControllerTest extends SysuiTestCase {
mController.onOpActiveChanged(
AppOpsManager.OP_RECORD_AUDIO, TEST_UID, TEST_PACKAGE_NAME, true);
mController.onOpNoted(AppOpsManager.OP_FINE_LOCATION, TEST_UID, TEST_PACKAGE_NAME,
- AppOpsManager.MODE_ALLOWED);
+ AppOpsManager.OP_FLAG_SELF, AppOpsManager.MODE_ALLOWED);
mTestableLooper.processAllMessages();
verify(mCallback).onActiveStateChanged(AppOpsManager.OP_RECORD_AUDIO,
TEST_UID, TEST_PACKAGE_NAME, true);
@@ -204,7 +204,8 @@ public class AppOpsControllerTest extends SysuiTestCase {
mController.onOpActiveChanged(AppOpsManager.OP_CAMERA,
TEST_UID, TEST_PACKAGE_NAME, true);
mController.onOpNoted(AppOpsManager.OP_FINE_LOCATION,
- TEST_UID, TEST_PACKAGE_NAME, AppOpsManager.MODE_ALLOWED);
+ TEST_UID, TEST_PACKAGE_NAME, AppOpsManager.OP_FLAG_SELF,
+ AppOpsManager.MODE_ALLOWED);
assertEquals(3, mController.getActiveAppOps().size());
}
@@ -215,7 +216,8 @@ public class AppOpsControllerTest extends SysuiTestCase {
mController.onOpActiveChanged(AppOpsManager.OP_CAMERA,
TEST_UID_OTHER, TEST_PACKAGE_NAME, true);
mController.onOpNoted(AppOpsManager.OP_FINE_LOCATION,
- TEST_UID, TEST_PACKAGE_NAME, AppOpsManager.MODE_ALLOWED);
+ TEST_UID, TEST_PACKAGE_NAME, AppOpsManager.OP_FLAG_SELF,
+ AppOpsManager.MODE_ALLOWED);
assertEquals(2,
mController.getActiveAppOpsForUser(UserHandle.getUserId(TEST_UID)).size());
assertEquals(1,
@@ -246,7 +248,7 @@ public class AppOpsControllerTest extends SysuiTestCase {
public void opNotedScheduledForRemoval() {
mController.setBGHandler(mMockHandler);
mController.onOpNoted(AppOpsManager.OP_FINE_LOCATION, TEST_UID, TEST_PACKAGE_NAME,
- AppOpsManager.MODE_ALLOWED);
+ AppOpsManager.OP_FLAG_SELF, AppOpsManager.MODE_ALLOWED);
verify(mMockHandler).scheduleRemoval(any(AppOpItem.class), anyLong());
}
@@ -258,7 +260,7 @@ public class AppOpsControllerTest extends SysuiTestCase {
mController.onOpActiveChanged(AppOpsManager.OP_FINE_LOCATION, TEST_UID, TEST_PACKAGE_NAME,
true);
mController.onOpNoted(AppOpsManager.OP_FINE_LOCATION, TEST_UID, TEST_PACKAGE_NAME,
- AppOpsManager.MODE_ALLOWED);
+ AppOpsManager.OP_FLAG_SELF, AppOpsManager.MODE_ALLOWED);
assertFalse(mController.getActiveAppOps().isEmpty());
mController.setListening(false);
@@ -272,9 +274,9 @@ public class AppOpsControllerTest extends SysuiTestCase {
mController.setBGHandler(mMockHandler);
mController.onOpNoted(AppOpsManager.OP_FINE_LOCATION, TEST_UID, TEST_PACKAGE_NAME,
- AppOpsManager.MODE_ALLOWED);
+ AppOpsManager.OP_FLAG_SELF, AppOpsManager.MODE_ALLOWED);
mController.onOpNoted(AppOpsManager.OP_FINE_LOCATION, TEST_UID, TEST_PACKAGE_NAME,
- AppOpsManager.MODE_ALLOWED);
+ AppOpsManager.OP_FLAG_SELF, AppOpsManager.MODE_ALLOWED);
// Only one post to notify subscribers
verify(mMockHandler, times(1)).post(any());
@@ -288,9 +290,9 @@ public class AppOpsControllerTest extends SysuiTestCase {
mController.setBGHandler(mMockHandler);
mController.onOpNoted(AppOpsManager.OP_FINE_LOCATION, TEST_UID, TEST_PACKAGE_NAME,
- AppOpsManager.MODE_ALLOWED);
+ AppOpsManager.OP_FLAG_SELF, AppOpsManager.MODE_ALLOWED);
mController.onOpNoted(AppOpsManager.OP_FINE_LOCATION, TEST_UID, TEST_PACKAGE_NAME,
- AppOpsManager.MODE_ALLOWED);
+ AppOpsManager.OP_FLAG_SELF, AppOpsManager.MODE_ALLOWED);
// Only one post to notify subscribers
verify(mMockHandler, times(2)).scheduleRemoval(any(), anyLong());
@@ -308,7 +310,7 @@ public class AppOpsControllerTest extends SysuiTestCase {
AppOpsManager.OP_FINE_LOCATION, TEST_UID, TEST_PACKAGE_NAME, true);
mController.onOpNoted(AppOpsManager.OP_FINE_LOCATION, TEST_UID, TEST_PACKAGE_NAME,
- AppOpsManager.MODE_ALLOWED);
+ AppOpsManager.OP_FLAG_SELF, AppOpsManager.MODE_ALLOWED);
// Check that we "scheduled" the removal. Don't actually schedule until we are ready to
// process messages at a later time.
@@ -337,7 +339,7 @@ public class AppOpsControllerTest extends SysuiTestCase {
mController.addCallback(new int[]{AppOpsManager.OP_FINE_LOCATION}, mCallback);
mController.onOpNoted(AppOpsManager.OP_FINE_LOCATION, TEST_UID, TEST_PACKAGE_NAME,
- AppOpsManager.MODE_ALLOWED);
+ AppOpsManager.OP_FLAG_SELF, AppOpsManager.MODE_ALLOWED);
mController.onOpActiveChanged(
AppOpsManager.OP_FINE_LOCATION, TEST_UID, TEST_PACKAGE_NAME, true);
@@ -366,7 +368,7 @@ public class AppOpsControllerTest extends SysuiTestCase {
mController.addCallback(new int[]{AppOpsManager.OP_FINE_LOCATION}, mCallback);
mController.onOpNoted(AppOpsManager.OP_FINE_LOCATION, TEST_UID, TEST_PACKAGE_NAME,
- AppOpsManager.MODE_ALLOWED);
+ AppOpsManager.OP_FLAG_SELF, AppOpsManager.MODE_ALLOWED);
mController.onOpActiveChanged(
AppOpsManager.OP_FINE_LOCATION, TEST_UID, TEST_PACKAGE_NAME, true);
@@ -384,7 +386,7 @@ public class AppOpsControllerTest extends SysuiTestCase {
AppOpsManager.OP_FINE_LOCATION, TEST_UID, TEST_PACKAGE_NAME, true);
mController.onOpNoted(AppOpsManager.OP_FINE_LOCATION, TEST_UID, TEST_PACKAGE_NAME,
- AppOpsManager.MODE_ALLOWED);
+ AppOpsManager.OP_FLAG_SELF, AppOpsManager.MODE_ALLOWED);
mTestableLooper.processAllMessages();
verify(mCallback).onActiveStateChanged(
diff --git a/packages/SystemUI/tests/src/com/android/systemui/classifier/BrightLineClassifierTest.java b/packages/SystemUI/tests/src/com/android/systemui/classifier/BrightLineClassifierTest.java
index d9df8282f086..8c547b127da2 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/classifier/BrightLineClassifierTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/classifier/BrightLineClassifierTest.java
@@ -72,12 +72,14 @@ public class BrightLineClassifierTest extends SysuiTestCase {
private HistoryTracker mHistoryTracker;
private FakeSystemClock mSystemClock = new FakeSystemClock();
- private FalsingClassifier.Result mTrueResult = new FalsingClassifier.Result(true, 1);
- private FalsingClassifier.Result mFalseResult = new FalsingClassifier.Result(false, 1);
+ private final FalsingClassifier.Result mFalsedResult = FalsingClassifier.Result.falsed(1, "");
+ private final FalsingClassifier.Result mPassedResult = FalsingClassifier.Result.passed(1);
@Before
public void setup() {
MockitoAnnotations.initMocks(this);
+ when(mClassifierA.classifyGesture(anyDouble(), anyDouble())).thenReturn(mPassedResult);
+ when(mClassifierB.classifyGesture(anyDouble(), anyDouble())).thenReturn(mPassedResult);
mClassifiers.add(mClassifierA);
mClassifiers.add(mClassifierB);
when(mFalsingDataProvider.isDirty()).thenReturn(true);
@@ -111,20 +113,20 @@ public class BrightLineClassifierTest extends SysuiTestCase {
@Test
public void testIsFalseTouch_ClassifierARejects() {
- when(mClassifierA.classifyGesture(anyDouble(), anyDouble())).thenReturn(true);
+ when(mClassifierA.classifyGesture(anyDouble(), anyDouble())).thenReturn(mFalsedResult);
assertThat(mBrightLineFalsingManager.isFalseTouch(0)).isTrue();
}
@Test
public void testIsFalseTouch_ClassifierBRejects() {
- when(mClassifierB.classifyGesture(anyDouble(), anyDouble())).thenReturn(true);
+ when(mClassifierB.classifyGesture(anyDouble(), anyDouble())).thenReturn(mFalsedResult);
assertThat(mBrightLineFalsingManager.isFalseTouch(0)).isTrue();
}
@Test
public void testIsFalseTouch_FaceAuth() {
// Even when the classifiers report a false, we should allow.
- when(mClassifierA.classifyGesture(anyDouble(), anyDouble())).thenReturn(true);
+ when(mClassifierA.classifyGesture(anyDouble(), anyDouble())).thenReturn(mPassedResult);
when(mFalsingDataProvider.isJustUnlockedWithFace()).thenReturn(true);
assertThat(mBrightLineFalsingManager.isFalseTouch(0)).isFalse();
@@ -133,7 +135,7 @@ public class BrightLineClassifierTest extends SysuiTestCase {
@Test
public void testIsFalseTouch_Docked() {
// Even when the classifiers report a false, we should allow.
- when(mClassifierA.classifyGesture(anyDouble(), anyDouble())).thenReturn(true);
+ when(mClassifierA.classifyGesture(anyDouble(), anyDouble())).thenReturn(mPassedResult);
mDockManager.setIsDocked(true);
assertThat(mBrightLineFalsingManager.isFalseTouch(0)).isFalse();
@@ -141,36 +143,36 @@ public class BrightLineClassifierTest extends SysuiTestCase {
@Test
public void testIsFalseTap_BasicCheck() {
- when(mSingleTapClassfier.isTap(mMotionEventList)).thenReturn(false);
+ when(mSingleTapClassfier.isTap(mMotionEventList)).thenReturn(mFalsedResult);
assertThat(mBrightLineFalsingManager.isFalseTap(false)).isTrue();
- when(mSingleTapClassfier.isTap(mMotionEventList)).thenReturn(true);
+ when(mSingleTapClassfier.isTap(mMotionEventList)).thenReturn(mPassedResult);
assertThat(mBrightLineFalsingManager.isFalseTap(false)).isFalse();
}
@Test
public void testIsFalseTap_RobustCheck_NoFaceAuth() {
- when(mSingleTapClassfier.isTap(mMotionEventList)).thenReturn(true);
+ when(mSingleTapClassfier.isTap(mMotionEventList)).thenReturn(mPassedResult);
mFalsingDataProvider.setJustUnlockedWithFace(false);
assertThat(mBrightLineFalsingManager.isFalseTap(true)).isTrue();
}
@Test
public void testIsFalseTap_RobustCheck_FaceAuth() {
- when(mSingleTapClassfier.isTap(mMotionEventList)).thenReturn(true);
+ when(mSingleTapClassfier.isTap(mMotionEventList)).thenReturn(mPassedResult);
when(mFalsingDataProvider.isJustUnlockedWithFace()).thenReturn(true);
assertThat(mBrightLineFalsingManager.isFalseTap(true)).isFalse();
}
@Test
public void testIsFalseDoubleTap() {
- when(mDoubleTapClassifier.classifyGesture()).thenReturn(mFalseResult);
+ when(mDoubleTapClassifier.classifyGesture()).thenReturn(mPassedResult);
assertThat(mBrightLineFalsingManager.isFalseDoubleTap()).isFalse();
- when(mDoubleTapClassifier.classifyGesture()).thenReturn(mTrueResult);
+ when(mDoubleTapClassifier.classifyGesture()).thenReturn(mFalsedResult);
assertThat(mBrightLineFalsingManager.isFalseDoubleTap()).isTrue();
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/classifier/DoubleTapClassifierTest.java b/packages/SystemUI/tests/src/com/android/systemui/classifier/DoubleTapClassifierTest.java
index 67890a557367..17c2700c5bda 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/classifier/DoubleTapClassifierTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/classifier/DoubleTapClassifierTest.java
@@ -55,6 +55,9 @@ public class DoubleTapClassifierTest extends ClassifierTest {
private SingleTapClassifier mSingleTapClassifier;
private DoubleTapClassifier mClassifier;
+ private final FalsingClassifier.Result mFalsedResult = FalsingClassifier.Result.falsed(1, "");
+ private final FalsingClassifier.Result mPassedResult = FalsingClassifier.Result.passed(1);
+
@Before
public void setup() {
super.setup();
@@ -77,7 +80,7 @@ public class DoubleTapClassifierTest extends ClassifierTest {
@Test
public void testSingleTap() {
- when(mSingleTapClassifier.isTap(anyList())).thenReturn(true);
+ when(mSingleTapClassifier.isTap(anyList())).thenReturn(mFalsedResult);
addMotionEvent(0, 0, MotionEvent.ACTION_DOWN, 1, 1);
addMotionEvent(0, 1, MotionEvent.ACTION_UP, TOUCH_SLOP, 1);
@@ -87,7 +90,7 @@ public class DoubleTapClassifierTest extends ClassifierTest {
@Test
public void testDoubleTap() {
- when(mSingleTapClassifier.isTap(anyList())).thenReturn(true);
+ when(mSingleTapClassifier.isTap(anyList())).thenReturn(mPassedResult);
addMotionEvent(0, 0, MotionEvent.ACTION_DOWN, 1, 1);
addMotionEvent(0, 1, MotionEvent.ACTION_UP, 1, 1);
@@ -97,13 +100,13 @@ public class DoubleTapClassifierTest extends ClassifierTest {
addMotionEvent(2, 2, MotionEvent.ACTION_DOWN, TOUCH_SLOP, TOUCH_SLOP);
addMotionEvent(2, 3, MotionEvent.ACTION_UP, TOUCH_SLOP, TOUCH_SLOP);
- boolean result = mClassifier.classifyGesture().isFalse();
- assertThat(mClassifier.getReason(), result, is(false));
+ FalsingClassifier.Result result = mClassifier.classifyGesture();
+ assertThat(result.getReason(), result.isFalse(), is(false));
}
@Test
public void testBadFirstTap() {
- when(mSingleTapClassifier.isTap(anyList())).thenReturn(false, true);
+ when(mSingleTapClassifier.isTap(anyList())).thenReturn(mPassedResult, mFalsedResult);
addMotionEvent(0, 0, MotionEvent.ACTION_DOWN, 1, 1);
addMotionEvent(0, 1, MotionEvent.ACTION_UP, 1, 1);
@@ -119,7 +122,7 @@ public class DoubleTapClassifierTest extends ClassifierTest {
@Test
public void testBadSecondTap() {
- when(mSingleTapClassifier.isTap(anyList())).thenReturn(true, false);
+ when(mSingleTapClassifier.isTap(anyList())).thenReturn(mFalsedResult, mPassedResult);
addMotionEvent(0, 0, MotionEvent.ACTION_DOWN, 1, 1);
addMotionEvent(0, 1, MotionEvent.ACTION_UP, 1, 1);
@@ -135,7 +138,7 @@ public class DoubleTapClassifierTest extends ClassifierTest {
@Test
public void testBadTouchSlop() {
- when(mSingleTapClassifier.isTap(anyList())).thenReturn(true);
+ when(mSingleTapClassifier.isTap(anyList())).thenReturn(mFalsedResult);
addMotionEvent(0, 0, MotionEvent.ACTION_DOWN, 1, 1);
addMotionEvent(0, 1, MotionEvent.ACTION_UP, 1, 1);
@@ -151,7 +154,7 @@ public class DoubleTapClassifierTest extends ClassifierTest {
@Test
public void testBadTouchSlow() {
- when(mSingleTapClassifier.isTap(anyList())).thenReturn(true);
+ when(mSingleTapClassifier.isTap(anyList())).thenReturn(mFalsedResult);
addMotionEvent(0, 0, MotionEvent.ACTION_DOWN, 1, 1);
addMotionEvent(0, 1, MotionEvent.ACTION_UP, 1, 1);
diff --git a/packages/SystemUI/tests/src/com/android/systemui/classifier/HistoryTrackerTest.java b/packages/SystemUI/tests/src/com/android/systemui/classifier/HistoryTrackerTest.java
index 8e7cc4e1013c..01cce3579b0c 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/classifier/HistoryTrackerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/classifier/HistoryTrackerTest.java
@@ -120,6 +120,9 @@ public class HistoryTrackerTest extends SysuiTestCase {
private void addResult(boolean falsed, double confidence) {
mHistoryTracker.addResults(Collections.singletonList(
- new FalsingClassifier.Result(falsed, confidence)), mSystemClock.uptimeMillis());
+ falsed
+ ? FalsingClassifier.Result.falsed(confidence, "test")
+ : FalsingClassifier.Result.passed(confidence)),
+ mSystemClock.uptimeMillis());
}
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/classifier/ProximityClassifierTest.java b/packages/SystemUI/tests/src/com/android/systemui/classifier/ProximityClassifierTest.java
index 3986bb7ff7eb..ba8ca9abc2d7 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/classifier/ProximityClassifierTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/classifier/ProximityClassifierTest.java
@@ -50,12 +50,16 @@ public class ProximityClassifierTest extends ClassifierTest {
private DistanceClassifier mDistanceClassifier;
private FalsingClassifier mClassifier;
+ private final FalsingClassifier.Result mFalsedResult =
+ FalsingClassifier.Result.falsed(1, "test");
+ private final FalsingClassifier.Result mPassedResult = FalsingClassifier.Result.passed(1);
+
@Before
public void setup() {
super.setup();
MockitoAnnotations.initMocks(this);
when(mDataProvider.getInteractionType()).thenReturn(GENERIC);
- when(mDistanceClassifier.isLongSwipe()).thenReturn(false);
+ when(mDistanceClassifier.isLongSwipe()).thenReturn(mFalsedResult);
mClassifier = new ProximityClassifier(
mDistanceClassifier, mDataProvider, new DeviceConfigProxyFake());
}
@@ -117,7 +121,7 @@ public class ProximityClassifierTest extends ClassifierTest {
mClassifier.onProximityEvent(createSensorEvent(true, 1));
mClassifier.onProximityEvent(createSensorEvent(false, 11));
touchUp(10);
- when(mDistanceClassifier.isLongSwipe()).thenReturn(true);
+ when(mDistanceClassifier.isLongSwipe()).thenReturn(mPassedResult);
assertThat(mClassifier.classifyGesture().isFalse(), is(false));
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/classifier/SingleTapClassifierTest.java b/packages/SystemUI/tests/src/com/android/systemui/classifier/SingleTapClassifierTest.java
index e4470759cb46..62c876f99a15 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/classifier/SingleTapClassifierTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/classifier/SingleTapClassifierTest.java
@@ -142,12 +142,12 @@ public class SingleTapClassifierTest extends ClassifierTest {
addMotionEvent(0, 0, MotionEvent.ACTION_DOWN, 1, 1);
addMotionEvent(0, 1, MotionEvent.ACTION_UP, 1, 1);
- assertThat(mClassifier.isTap(mMotionEvents), is(true));
+ assertThat(mClassifier.isTap(mMotionEvents).isFalse(), is(false));
addMotionEvent(0, 0, MotionEvent.ACTION_DOWN, 1, 1);
addMotionEvent(0, 1, MotionEvent.ACTION_UP, 1, TOUCH_SLOP + 1);
- assertThat(mClassifier.isTap(mMotionEvents), is(false));
+ assertThat(mClassifier.isTap(mMotionEvents).isFalse(), is(true));
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/NotificationEntryManagerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/NotificationEntryManagerTest.java
index b0e17cdab8e4..5fc01ccd96b4 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/NotificationEntryManagerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/NotificationEntryManagerTest.java
@@ -629,10 +629,8 @@ public class NotificationEntryManagerTest extends SysuiTestCase {
return new Notification.Action.Builder(
Icon.createWithResource(getContext(), android.R.drawable.sym_def_app_icon),
"action",
- // TODO(b/174935104) Please replace FLAG_MUTABLE_UNAUDITED below
- // with either FLAG_IMMUTABLE (recommended) or FLAG_MUTABLE.
PendingIntent.getBroadcast(getContext(), 0, new Intent("Action"),
- PendingIntent.FLAG_MUTABLE_UNAUDITED)).build();
+ PendingIntent.FLAG_IMMUTABLE)).build();
}
private static class FakeNotificationLifetimeExtender implements NotificationLifetimeExtender {
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 01b3d8e787e6..241451edf698 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
@@ -233,10 +233,8 @@ public class NotificationEntryTest extends SysuiTestCase {
return new Notification.Action.Builder(
Icon.createWithResource(getContext(), android.R.drawable.sym_def_app_icon),
title,
- // TODO(b/174965424) Please replace FLAG_MUTABLE_UNAUDITED below
- // with either FLAG_IMMUTABLE (recommended) or FLAG_MUTABLE.
PendingIntent.getBroadcast(getContext(), 0, new Intent("Action"),
- PendingIntent.FLAG_MUTABLE_UNAUDITED))
+ PendingIntent.FLAG_IMMUTABLE))
.setContextual(true)
.build();
}
@@ -245,10 +243,8 @@ public class NotificationEntryTest extends SysuiTestCase {
return new Notification.Action.Builder(
Icon.createWithResource(getContext(), android.R.drawable.sym_def_app_icon),
title,
- // TODO(b/174965424) Please replace FLAG_MUTABLE_UNAUDITED below
- // with either FLAG_IMMUTABLE (recommended) or FLAG_MUTABLE.
PendingIntent.getBroadcast(getContext(), 0, new Intent("Action"),
- PendingIntent.FLAG_MUTABLE_UNAUDITED)).build();
+ PendingIntent.FLAG_IMMUTABLE)).build();
}
private ArrayList<Notification.Action> createActions(String... titles) {
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 d606316f16ed..60c3bc874235 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
@@ -476,10 +476,8 @@ public class NotificationInterruptStateProviderImplTest extends SysuiTestCase {
private NotificationEntry createBubble() {
Notification.BubbleMetadata data = new Notification.BubbleMetadata.Builder(
- // TODO(b/174970399) Please replace FLAG_MUTABLE_UNAUDITED below
- // with either FLAG_IMMUTABLE (recommended) or FLAG_MUTABLE.
PendingIntent.getActivity(mContext, 0, new Intent(),
- PendingIntent.FLAG_MUTABLE_UNAUDITED),
+ PendingIntent.FLAG_MUTABLE),
Icon.createWithResource(mContext.getResources(), R.drawable.android))
.build();
Notification n = new Notification.Builder(getContext(), "a")
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 1387a63d449f..291b223d72bb 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
@@ -213,11 +213,9 @@ public class NotificationConversationInfoTest extends SysuiTestCase {
notification, UserHandle.CURRENT, null, 0);
mEntry = new NotificationEntryBuilder().setSbn(mSbn).setShortcutInfo(mShortcutInfo).build();
- // TODO(b/175005650) Please replace FLAG_MUTABLE_UNAUDITED below
- // with either FLAG_IMMUTABLE (recommended) or FLAG_MUTABLE.
PendingIntent bubbleIntent = PendingIntent.getActivity(mContext, 0,
new Intent(mContext, BubblesTestActivity.class),
- PendingIntent.FLAG_MUTABLE_UNAUDITED);
+ PendingIntent.FLAG_MUTABLE);
mBubbleSbn = new SbnBuilder(mSbn).setBubbleMetadata(
new Notification.BubbleMetadata.Builder(bubbleIntent,
Icon.createWithResource(mContext, R.drawable.android)).build())
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationTestHelper.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationTestHelper.java
index 43ba844bdef3..6fcc7fa9376c 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationTestHelper.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/NotificationTestHelper.java
@@ -455,10 +455,8 @@ public class NotificationTestHelper {
private BubbleMetadata makeBubbleMetadata(PendingIntent deleteIntent) {
Intent target = new Intent(mContext, BubblesTestActivity.class);
- // TODO(b/175014468) Please replace FLAG_MUTABLE_UNAUDITED below
- // with either FLAG_IMMUTABLE (recommended) or FLAG_MUTABLE.
PendingIntent bubbleIntent = PendingIntent.getActivity(mContext, 0, target,
- PendingIntent.FLAG_MUTABLE_UNAUDITED);
+ PendingIntent.FLAG_MUTABLE);
return new BubbleMetadata.Builder(bubbleIntent,
Icon.createWithResource(mContext, R.drawable.android))
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/LockscreenIconControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/LockscreenIconControllerTest.java
index aca34242e5fa..1ac793730f02 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/LockscreenIconControllerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/LockscreenIconControllerTest.java
@@ -30,6 +30,7 @@ import androidx.test.filters.SmallTest;
import androidx.test.runner.AndroidJUnit4;
import com.android.internal.widget.LockPatternUtils;
+import com.android.keyguard.KeyguardSecurityModel;
import com.android.keyguard.KeyguardUpdateMonitor;
import com.android.systemui.SysuiTestCase;
import com.android.systemui.dock.DockManager;
@@ -80,6 +81,8 @@ public class LockscreenIconControllerTest extends SysuiTestCase {
private Resources mResources;
@Mock
private HeadsUpManagerPhone mHeadsUpManagerPhone;
+ @Mock
+ private KeyguardSecurityModel mKeyguardSecurityModel;
private LockscreenLockIconController mLockIconController;
private OnAttachStateChangeListener mOnAttachStateChangeListener;
@@ -94,7 +97,7 @@ public class LockscreenIconControllerTest extends SysuiTestCase {
mShadeController, mAccessibilityController, mKeyguardIndicationController,
mStatusBarStateController, mConfigurationController, mNotificationWakeUpCoordinator,
mKeyguardBypassController, mDockManager, mKeyguardStateController, mResources,
- mHeadsUpManagerPhone);
+ mHeadsUpManagerPhone, mKeyguardSecurityModel);
ArgumentCaptor<OnAttachStateChangeListener> onAttachStateChangeListenerArgumentCaptor =
ArgumentCaptor.forClass(OnAttachStateChangeListener.class);
@@ -139,6 +142,15 @@ public class LockscreenIconControllerTest extends SysuiTestCase {
sBStateListenerCaptor.getValue().onDozingChanged(true);
verify(mLockIcon).updateIconVisibility(false);
+ }
+
+ @Test
+ public void testVisibility_noBouncer() {
+ // no security (ie: no lock screen OR swipe to unlock)
+ when(mKeyguardSecurityModel.getSecurityMode(anyInt())).thenReturn(
+ KeyguardSecurityModel.SecurityMode.None);
+ mOnAttachStateChangeListener.onViewAttachedToWindow(mLockIcon);
+ verify(mLockIcon).updateIconVisibility(false);
}
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerBaseTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerBaseTest.java
index 138236af70ce..ce9ca9d633fd 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerBaseTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/policy/NetworkControllerBaseTest.java
@@ -61,6 +61,7 @@ import android.util.Log;
import androidx.test.InstrumentationRegistry;
import com.android.settingslib.graph.SignalDrawable;
+import com.android.settingslib.mobile.MobileStatusTracker.SubscriptionDefaults;
import com.android.settingslib.net.DataUsageController;
import com.android.systemui.R;
import com.android.systemui.SysuiTestCase;
@@ -70,7 +71,6 @@ import com.android.systemui.statusbar.policy.DeviceProvisionedController.DeviceP
import com.android.systemui.statusbar.policy.NetworkController.IconState;
import com.android.systemui.statusbar.policy.NetworkController.SignalCallback;
import com.android.systemui.statusbar.policy.NetworkControllerImpl.Config;
-import com.android.systemui.statusbar.policy.NetworkControllerImpl.SubscriptionDefaults;
import org.junit.Before;
import org.junit.Rule;
@@ -225,7 +225,7 @@ public class NetworkControllerBaseTest extends SysuiTestCase {
setDefaultSubId(mSubId);
setSubscriptions(mSubId);
mMobileSignalController = mNetworkController.mMobileSignalControllers.get(mSubId);
- mPhoneStateListener = mMobileSignalController.mPhoneStateListener;
+ mPhoneStateListener = mMobileSignalController.mMobileStatusTracker.getPhoneStateListener();
ArgumentCaptor<ConnectivityManager.NetworkCallback> callbackArg =
ArgumentCaptor.forClass(ConnectivityManager.NetworkCallback.class);
diff --git a/proto/src/metrics_constants/OWNERS b/proto/src/metrics_constants/OWNERS
index ab4d808f5ff0..7009282b66e1 100644
--- a/proto/src/metrics_constants/OWNERS
+++ b/proto/src/metrics_constants/OWNERS
@@ -1,4 +1,4 @@
-cwren@google.com
+cwren@android.com
yanglu@google.com
yaochen@google.com
yro@google.com
diff --git a/services/autofill/java/com/android/server/autofill/TEST_MAPPING b/services/autofill/java/com/android/server/autofill/TEST_MAPPING
index cf058add0262..d8a69177387d 100644
--- a/services/autofill/java/com/android/server/autofill/TEST_MAPPING
+++ b/services/autofill/java/com/android/server/autofill/TEST_MAPPING
@@ -1,5 +1,5 @@
{
- "presubmit": [
+ "presubmit-large": [
{
"name": "CtsAutoFillServiceTestCases",
"options": [
diff --git a/services/companion/java/com/android/server/companion/CompanionDeviceManagerService.java b/services/companion/java/com/android/server/companion/CompanionDeviceManagerService.java
index 0a80b02a964c..e6e52de0440f 100644
--- a/services/companion/java/com/android/server/companion/CompanionDeviceManagerService.java
+++ b/services/companion/java/com/android/server/companion/CompanionDeviceManagerService.java
@@ -40,6 +40,7 @@ import android.bluetooth.BluetoothDevice;
import android.companion.Association;
import android.companion.AssociationRequest;
import android.companion.CompanionDeviceManager;
+import android.companion.DeviceNotAssociatedException;
import android.companion.ICompanionDeviceDiscoveryService;
import android.companion.ICompanionDeviceManager;
import android.companion.IFindDeviceCallback;
@@ -486,6 +487,43 @@ public class CompanionDeviceManagerService extends SystemService implements Bind
a -> Objects.equals(a.getDeviceMacAddress(), macAddress));
}
+ @Override
+ public void registerDevicePresenceListenerService(
+ String packageName, String deviceAddress)
+ throws RemoteException {
+ checkCanRegisterObserverService(packageName, deviceAddress);
+
+ //TODO(eugenesusla) implement
+ }
+
+ @Override
+ public void unregisterDevicePresenceListenerService(
+ String packageName, String deviceAddress)
+ throws RemoteException {
+ checkCanRegisterObserverService(packageName, deviceAddress);
+
+ //TODO(eugenesusla) implement
+ }
+
+ private void checkCanRegisterObserverService(String packageName, String deviceAddress)
+ throws RemoteException {
+ getContext().enforceCallingOrSelfPermission(
+ android.Manifest.permission.REQUEST_OBSERVE_COMPANION_DEVICE_PRESENCE,
+ "[un]registerDevicePresenceListenerService");
+ checkCallerIsSystemOr(packageName);
+
+ int userId = getCallingUserId();
+ Set<Association> deviceAssociations = CollectionUtils.filter(
+ getAllAssociations(userId, packageName),
+ association -> deviceAddress.equals(association.getDeviceMacAddress()));
+
+ if (deviceAssociations.isEmpty()) {
+ throw new RemoteException(new DeviceNotAssociatedException("App " + packageName
+ + " is not associated with device " + deviceAddress
+ + " for user " + userId));
+ }
+ }
+
private void checkCanCallNotificationApi(String callingPackage) throws RemoteException {
checkCallerIsSystemOr(callingPackage);
int userId = getCallingUserId();
diff --git a/services/core/java/com/android/server/BluetoothAirplaneModeListener.java b/services/core/java/com/android/server/BluetoothAirplaneModeListener.java
index 4d9680c785bc..aa56da5773e9 100644
--- a/services/core/java/com/android/server/BluetoothAirplaneModeListener.java
+++ b/services/core/java/com/android/server/BluetoothAirplaneModeListener.java
@@ -119,7 +119,9 @@ class BluetoothAirplaneModeListener {
}
return;
}
- mAirplaneHelper.onAirplaneModeChanged(mBluetoothManager);
+ if (mAirplaneHelper != null) {
+ mAirplaneHelper.onAirplaneModeChanged(mBluetoothManager);
+ }
}
@VisibleForTesting
diff --git a/services/core/java/com/android/server/BluetoothManagerService.java b/services/core/java/com/android/server/BluetoothManagerService.java
index 0a684287849a..dc24ffdb936d 100644
--- a/services/core/java/com/android/server/BluetoothManagerService.java
+++ b/services/core/java/com/android/server/BluetoothManagerService.java
@@ -1275,7 +1275,7 @@ class BluetoothManagerService extends IBluetoothManager.Stub {
@Override
public boolean bindBluetoothProfileService(int bluetoothProfile,
IBluetoothProfileServiceConnection proxy) {
- if (!mEnable) {
+ if (mState != BluetoothAdapter.STATE_ON) {
if (DBG) {
Slog.d(TAG, "Trying to bind to profile: " + bluetoothProfile
+ ", while Bluetooth was disabled");
@@ -1441,7 +1441,7 @@ class BluetoothManagerService extends IBluetoothManager.Stub {
mBluetoothLock.readLock().unlock();
}
- if (!mEnable || state != BluetoothAdapter.STATE_ON) {
+ if (state != BluetoothAdapter.STATE_ON) {
if (DBG) {
Slog.d(TAG, "Unable to bindService while Bluetooth is disabled");
}
diff --git a/services/core/java/com/android/server/ConnectivityService.java b/services/core/java/com/android/server/ConnectivityService.java
index 7ebe05695d5d..a6559f9521e0 100644
--- a/services/core/java/com/android/server/ConnectivityService.java
+++ b/services/core/java/com/android/server/ConnectivityService.java
@@ -129,6 +129,7 @@ import android.net.RouteInfoParcel;
import android.net.SocketKeepalive;
import android.net.TetheringManager;
import android.net.UidRange;
+import android.net.UidRangeParcel;
import android.net.Uri;
import android.net.VpnManager;
import android.net.VpnService;
@@ -2822,6 +2823,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
break;
}
case NetworkAgent.EVENT_UNDERLYING_NETWORKS_CHANGED: {
+ // TODO: prevent loops, e.g., if a network declares itself as underlying.
if (!nai.supportsUnderlyingNetworks()) {
Log.wtf(TAG, "Non-virtual networks cannot have underlying networks");
break;
@@ -3421,6 +3423,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
}
}
nai.clearLingerState();
+ propagateUnderlyingNetworkCapabilities(nai.network);
if (nai.isSatisfyingRequest(mDefaultRequest.requestId)) {
mDefaultNetworkNai = null;
updateDataActivityTracking(null /* newNetwork */, nai);
@@ -3428,9 +3431,6 @@ public class ConnectivityService extends IConnectivityManager.Stub
ensureNetworkTransitionWakelock(nai.toShortString());
}
mLegacyTypeTracker.remove(nai, wasDefault);
- if (!nai.networkCapabilities.hasTransport(TRANSPORT_VPN)) {
- propagateUnderlyingNetworkCapabilities();
- }
rematchAllNetworksAndRequests();
mLingerMonitor.noteDisconnect(nai);
if (nai.created) {
@@ -4819,17 +4819,35 @@ public class ConnectivityService extends IConnectivityManager.Stub
}
}
+ private Network[] underlyingNetworksOrDefault(Network[] underlyingNetworks) {
+ final Network defaultNetwork = getNetwork(getDefaultNetwork());
+ if (underlyingNetworks == null && defaultNetwork != null) {
+ // null underlying networks means to track the default.
+ underlyingNetworks = new Network[] { defaultNetwork };
+ }
+ return underlyingNetworks;
+ }
+
+ // Returns true iff |network| is an underlying network of |nai|.
+ private boolean hasUnderlyingNetwork(NetworkAgentInfo nai, Network network) {
+ // TODO: support more than one level of underlying networks, either via a fixed-depth search
+ // (e.g., 2 levels of underlying networks), or via loop detection, or....
+ if (!nai.supportsUnderlyingNetworks()) return false;
+ final Network[] underlying = underlyingNetworksOrDefault(nai.declaredUnderlyingNetworks);
+ return ArrayUtils.contains(underlying, network);
+ }
+
/**
- * Ask all networks with underlying networks to recompute and update their capabilities.
+ * Recompute the capabilities for any networks that had a specific network as underlying.
*
* When underlying networks change, such networks may have to update capabilities to reflect
* things like the metered bit, their transports, and so on. The capabilities are calculated
* immediately. This method runs on the ConnectivityService thread.
*/
- private void propagateUnderlyingNetworkCapabilities() {
+ private void propagateUnderlyingNetworkCapabilities(Network updatedNetwork) {
ensureRunningOnConnectivityServiceThread();
for (NetworkAgentInfo nai : mNetworkAgentInfos.values()) {
- if (nai.supportsUnderlyingNetworks()) {
+ if (updatedNetwork == null || hasUnderlyingNetwork(nai, updatedNetwork)) {
updateCapabilitiesForNetwork(nai);
}
}
@@ -5152,7 +5170,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
loge("Starting user already has a VPN");
return;
}
- userVpn = new Vpn(mHandler.getLooper(), mContext, mNMS, userId, mKeyStore);
+ userVpn = new Vpn(mHandler.getLooper(), mContext, mNMS, mNetd, userId, mKeyStore);
mVpns.put(userId, userVpn);
if (mUserManager.getUserInfo(userId).isPrimary() && LockdownVpnTracker.isEnabled()) {
updateLockdownVpn();
@@ -5579,11 +5597,12 @@ public class ConnectivityService extends IConnectivityManager.Stub
}
private boolean checkUnsupportedStartingFrom(int version, String callingPackageName) {
- final PackageManager pm = mContext.getPackageManager();
- final int userId = UserHandle.getCallingUserId();
+ final UserHandle user = UserHandle.getUserHandleForUid(Binder.getCallingUid());
+ final PackageManager pm =
+ mContext.createContextAsUser(user, 0 /* flags */).getPackageManager();
try {
- final int callingVersion = pm.getApplicationInfoAsUser(
- callingPackageName, 0 /* flags */, userId).targetSdkVersion;
+ final int callingVersion = pm.getApplicationInfo(
+ callingPackageName, 0 /* flags */).targetSdkVersion;
if (callingVersion < version) return false;
} catch (PackageManager.NameNotFoundException e) { }
return true;
@@ -6367,27 +6386,28 @@ public class ConnectivityService extends IConnectivityManager.Stub
* This method should never alter the agent's NetworkCapabilities, only store data in |nai|.
*/
private void processCapabilitiesFromAgent(NetworkAgentInfo nai, NetworkCapabilities nc) {
- nai.declaredMetered = !nc.hasCapability(NET_CAPABILITY_NOT_METERED);
+ // Note: resetting the owner UID before storing the agent capabilities in NAI means that if
+ // the agent attempts to change the owner UID, then nai.declaredCapabilities will not
+ // actually be the same as the capabilities sent by the agent. Still, it is safer to reset
+ // the owner UID here and behave as if the agent had never tried to change it.
if (nai.networkCapabilities.getOwnerUid() != nc.getOwnerUid()) {
Log.e(TAG, nai.toShortString() + ": ignoring attempt to change owner from "
+ nai.networkCapabilities.getOwnerUid() + " to " + nc.getOwnerUid());
nc.setOwnerUid(nai.networkCapabilities.getOwnerUid());
}
+ nai.declaredCapabilities = new NetworkCapabilities(nc);
}
- /** Modifies |caps| based on the capabilities of the specified underlying networks. */
+ /** Modifies |newNc| based on the capabilities of |underlyingNetworks| and |agentCaps|. */
@VisibleForTesting
void applyUnderlyingCapabilities(@Nullable Network[] underlyingNetworks,
- @NonNull NetworkCapabilities caps, boolean declaredMetered) {
- final Network defaultNetwork = getNetwork(getDefaultNetwork());
- if (underlyingNetworks == null && defaultNetwork != null) {
- // null underlying networks means to track the default.
- underlyingNetworks = new Network[] { defaultNetwork };
- }
- int[] transportTypes = new int[] { NetworkCapabilities.TRANSPORT_VPN };
+ @NonNull NetworkCapabilities agentCaps, @NonNull NetworkCapabilities newNc) {
+ underlyingNetworks = underlyingNetworksOrDefault(underlyingNetworks);
+ int[] transportTypes = agentCaps.getTransportTypes();
int downKbps = NetworkCapabilities.LINK_BANDWIDTH_UNSPECIFIED;
int upKbps = NetworkCapabilities.LINK_BANDWIDTH_UNSPECIFIED;
- boolean metered = declaredMetered; // metered if any underlying is metered, or agentMetered
+ // metered if any underlying is metered, or originally declared metered by the agent.
+ boolean metered = !agentCaps.hasCapability(NET_CAPABILITY_NOT_METERED);
boolean roaming = false; // roaming if any underlying is roaming
boolean congested = false; // congested if any underlying is congested
boolean suspended = true; // suspended if all underlying are suspended
@@ -6433,13 +6453,13 @@ public class ConnectivityService extends IConnectivityManager.Stub
suspended = false;
}
- caps.setTransportTypes(transportTypes);
- caps.setLinkDownstreamBandwidthKbps(downKbps);
- caps.setLinkUpstreamBandwidthKbps(upKbps);
- caps.setCapability(NET_CAPABILITY_NOT_METERED, !metered);
- caps.setCapability(NET_CAPABILITY_NOT_ROAMING, !roaming);
- caps.setCapability(NET_CAPABILITY_NOT_CONGESTED, !congested);
- caps.setCapability(NET_CAPABILITY_NOT_SUSPENDED, !suspended);
+ newNc.setTransportTypes(transportTypes);
+ newNc.setLinkDownstreamBandwidthKbps(downKbps);
+ newNc.setLinkUpstreamBandwidthKbps(upKbps);
+ newNc.setCapability(NET_CAPABILITY_NOT_METERED, !metered);
+ newNc.setCapability(NET_CAPABILITY_NOT_ROAMING, !roaming);
+ newNc.setCapability(NET_CAPABILITY_NOT_CONGESTED, !congested);
+ newNc.setCapability(NET_CAPABILITY_NOT_SUSPENDED, !suspended);
}
/**
@@ -6496,7 +6516,8 @@ public class ConnectivityService extends IConnectivityManager.Stub
}
if (nai.supportsUnderlyingNetworks()) {
- applyUnderlyingCapabilities(nai.declaredUnderlyingNetworks, newNc, nai.declaredMetered);
+ applyUnderlyingCapabilities(nai.declaredUnderlyingNetworks, nai.declaredCapabilities,
+ newNc);
}
return newNc;
@@ -6575,11 +6596,8 @@ public class ConnectivityService extends IConnectivityManager.Stub
}
}
- if (!newNc.hasTransport(TRANSPORT_VPN)) {
- // Tell VPNs about updated capabilities, since they may need to
- // bubble those changes through.
- propagateUnderlyingNetworkCapabilities();
- }
+ // This network might have been underlying another network. Propagate its capabilities.
+ propagateUnderlyingNetworkCapabilities(nai.network);
if (!newNc.equalsTransportTypes(prevNc)) {
mDnsManager.updateTransportsForNetwork(
@@ -6621,6 +6639,16 @@ public class ConnectivityService extends IConnectivityManager.Stub
&& (lp.hasIpv6DefaultRoute() || lp.hasIpv6UnreachableDefaultRoute());
}
+ private static UidRangeParcel[] toUidRangeStableParcels(final @NonNull Set<UidRange> ranges) {
+ final UidRangeParcel[] stableRanges = new UidRangeParcel[ranges.size()];
+ int index = 0;
+ for (UidRange range : ranges) {
+ stableRanges[index] = new UidRangeParcel(range.start, range.stop);
+ index++;
+ }
+ return stableRanges;
+ }
+
private void updateUids(NetworkAgentInfo nai, NetworkCapabilities prevNc,
NetworkCapabilities newNc) {
Set<UidRange> prevRanges = null == prevNc ? null : prevNc.getUids();
@@ -6640,14 +6668,11 @@ public class ConnectivityService extends IConnectivityManager.Stub
// removing old range works because, unlike the filtering rules below, it's possible to
// add duplicate UID routing rules.
if (!newRanges.isEmpty()) {
- final UidRange[] addedRangesArray = new UidRange[newRanges.size()];
- newRanges.toArray(addedRangesArray);
- mNMS.addVpnUidRanges(nai.network.getNetId(), addedRangesArray);
+ mNetd.networkAddUidRanges(nai.network.netId, toUidRangeStableParcels(newRanges));
}
if (!prevRanges.isEmpty()) {
- final UidRange[] removedRangesArray = new UidRange[prevRanges.size()];
- prevRanges.toArray(removedRangesArray);
- mNMS.removeVpnUidRanges(nai.network.getNetId(), removedRangesArray);
+ mNetd.networkRemoveUidRanges(
+ nai.network.netId, toUidRangeStableParcels(prevRanges));
}
final boolean wasFiltering = requiresVpnIsolation(nai, prevNc, nai.linkProperties);
final boolean shouldFilter = requiresVpnIsolation(nai, newNc, nai.linkProperties);
@@ -6902,8 +6927,10 @@ public class ConnectivityService extends IConnectivityManager.Stub
updateTcpBufferSizes(null != newNetwork
? newNetwork.linkProperties.getTcpBufferSizes() : null);
notifyIfacesChangedForNetworkStats();
- // Fix up the NetworkCapabilities of any VPNs that don't specify underlying networks.
- propagateUnderlyingNetworkCapabilities();
+ // Fix up the NetworkCapabilities of any networks that have this network as underlying.
+ if (newNetwork != null) {
+ propagateUnderlyingNetworkCapabilities(newNetwork.network);
+ }
}
private void processListenRequests(@NonNull final NetworkAgentInfo nai) {
@@ -7359,13 +7386,11 @@ public class ConnectivityService extends IConnectivityManager.Stub
networkAgent.networkCapabilities.addCapability(NET_CAPABILITY_FOREGROUND);
if (!createNativeNetwork(networkAgent)) return;
- if (networkAgent.isVPN()) {
- // Initialize the VPN capabilities to their starting values according to the
- // underlying networks. This will avoid a spurious callback to
- // onCapabilitiesUpdated being sent in updateAllVpnCapabilities below as
- // the VPN would switch from its default, blank capabilities to those
- // that reflect the capabilities of its underlying networks.
- propagateUnderlyingNetworkCapabilities();
+ if (networkAgent.supportsUnderlyingNetworks()) {
+ // Initialize the network's capabilities to their starting values according to the
+ // underlying networks. This ensures that the capabilities are correct before
+ // anything happens to the network.
+ updateCapabilitiesForNetwork(networkAgent);
}
networkAgent.created = true;
}
@@ -7407,10 +7432,6 @@ public class ConnectivityService extends IConnectivityManager.Stub
// doing.
updateSignalStrengthThresholds(networkAgent, "CONNECT", null);
- if (networkAgent.supportsUnderlyingNetworks()) {
- propagateUnderlyingNetworkCapabilities();
- }
-
// Consider network even though it is not yet validated.
rematchAllNetworksAndRequests();
diff --git a/services/core/java/com/android/server/GestureLauncherService.java b/services/core/java/com/android/server/GestureLauncherService.java
index 8ed23f900d73..c34285e9c062 100644
--- a/services/core/java/com/android/server/GestureLauncherService.java
+++ b/services/core/java/com/android/server/GestureLauncherService.java
@@ -257,7 +257,7 @@ public class GestureLauncherService extends SystemService {
@VisibleForTesting
void updateEmergencyGestureEnabled() {
- boolean enabled = isEmergencyGestureEnabled(mContext, mUserId);
+ boolean enabled = isEmergencyGestureSettingEnabled(mContext, mUserId);
synchronized (this) {
mEmergencyGestureEnabled = enabled;
}
@@ -390,38 +390,50 @@ public class GestureLauncherService extends SystemService {
/**
* Whether to enable emergency gesture.
*/
- public static boolean isEmergencyGestureEnabled(Context context, int userId) {
- return Settings.Secure.getIntForUser(context.getContentResolver(),
+ @VisibleForTesting
+ static boolean isEmergencyGestureSettingEnabled(Context context, int userId) {
+ return isEmergencyGestureEnabled(context.getResources())
+ && Settings.Secure.getIntForUser(context.getContentResolver(),
Settings.Secure.EMERGENCY_GESTURE_ENABLED, 0, userId) != 0;
}
/**
* Whether to enable the camera launch gesture.
*/
- public static boolean isCameraLaunchEnabled(Resources resources) {
+ private static boolean isCameraLaunchEnabled(Resources resources) {
boolean configSet = resources.getInteger(
com.android.internal.R.integer.config_cameraLaunchGestureSensorType) != -1;
return configSet &&
!SystemProperties.getBoolean("gesture.disable_camera_launch", false);
}
- public static boolean isCameraDoubleTapPowerEnabled(Resources resources) {
+ @VisibleForTesting
+ static boolean isCameraDoubleTapPowerEnabled(Resources resources) {
return resources.getBoolean(
com.android.internal.R.bool.config_cameraDoubleTapPowerGestureEnabled);
}
- public static boolean isCameraLiftTriggerEnabled(Resources resources) {
+ private static boolean isCameraLiftTriggerEnabled(Resources resources) {
boolean configSet = resources.getInteger(
com.android.internal.R.integer.config_cameraLiftTriggerSensorType) != -1;
return configSet;
}
/**
+ * Whether or not the emergency gesture feature is enabled by platform
+ */
+ private static boolean isEmergencyGestureEnabled(Resources resources) {
+ return resources.getBoolean(com.android.internal.R.bool.config_emergencyGestureEnabled);
+ }
+
+ /**
* Whether GestureLauncherService should be enabled according to system properties.
*/
public static boolean isGestureLauncherEnabled(Resources resources) {
- return isCameraLaunchEnabled(resources) || isCameraDoubleTapPowerEnabled(resources) ||
- isCameraLiftTriggerEnabled(resources);
+ return isCameraLaunchEnabled(resources)
+ || isCameraDoubleTapPowerEnabled(resources)
+ || isCameraLiftTriggerEnabled(resources)
+ || isEmergencyGestureEnabled(resources);
}
/**
diff --git a/services/core/java/com/android/server/NetworkManagementService.java b/services/core/java/com/android/server/NetworkManagementService.java
index 5e86f855c1e7..086cc1ca32ed 100644
--- a/services/core/java/com/android/server/NetworkManagementService.java
+++ b/services/core/java/com/android/server/NetworkManagementService.java
@@ -60,7 +60,6 @@ import android.net.NetworkStack;
import android.net.NetworkStats;
import android.net.RouteInfo;
import android.net.TetherStatsParcel;
-import android.net.UidRange;
import android.net.UidRangeParcel;
import android.net.shared.NetdUtils;
import android.net.shared.RouteUtils;
@@ -1393,38 +1392,6 @@ public class NetworkManagementService extends INetworkManagementService.Stub {
}
}
- private static UidRangeParcel makeUidRangeParcel(int start, int stop) {
- UidRangeParcel range = new UidRangeParcel();
- range.start = start;
- range.stop = stop;
- return range;
- }
-
- private static UidRangeParcel[] toStableParcels(UidRange[] ranges) {
- UidRangeParcel[] stableRanges = new UidRangeParcel[ranges.length];
- for (int i = 0; i < ranges.length; i++) {
- stableRanges[i] = makeUidRangeParcel(ranges[i].start, ranges[i].stop);
- }
- return stableRanges;
- }
-
- @Override
- public void setAllowOnlyVpnForUids(boolean add, UidRange[] uidRanges)
- throws ServiceSpecificException {
- NetworkStack.checkNetworkStackPermission(mContext);
- try {
- mNetdService.networkRejectNonSecureVpn(add, toStableParcels(uidRanges));
- } catch (ServiceSpecificException e) {
- Log.w(TAG, "setAllowOnlyVpnForUids(" + add + ", " + Arrays.toString(uidRanges) + ")"
- + ": netd command failed", e);
- throw e;
- } catch (RemoteException e) {
- Log.w(TAG, "setAllowOnlyVpnForUids(" + add + ", " + Arrays.toString(uidRanges) + ")"
- + ": netd command failed", e);
- throw e.rethrowAsRuntimeException();
- }
- }
-
private void applyUidCleartextNetworkPolicy(int uid, int policy) {
final int policyValue;
switch (policy) {
@@ -1553,27 +1520,6 @@ public class NetworkManagementService extends INetworkManagementService.Stub {
}
@Override
- public void addVpnUidRanges(int netId, UidRange[] ranges) {
- NetworkStack.checkNetworkStackPermission(mContext);
-
- try {
- mNetdService.networkAddUidRanges(netId, toStableParcels(ranges));
- } catch (RemoteException | ServiceSpecificException e) {
- throw new IllegalStateException(e);
- }
- }
-
- @Override
- public void removeVpnUidRanges(int netId, UidRange[] ranges) {
- NetworkStack.checkNetworkStackPermission(mContext);
- try {
- mNetdService.networkRemoveUidRanges(netId, toStableParcels(ranges));
- } catch (RemoteException | ServiceSpecificException e) {
- throw new IllegalStateException(e);
- }
- }
-
- @Override
public void setFirewallEnabled(boolean enabled) {
enforceSystemUid();
try {
@@ -1616,7 +1562,7 @@ public class NetworkManagementService extends INetworkManagementService.Stub {
ranges = new UidRangeParcel[] {
// TODO: is there a better way of finding all existing users? If so, we could
// specify their ranges here.
- makeUidRangeParcel(Process.FIRST_APPLICATION_UID, Integer.MAX_VALUE),
+ new UidRangeParcel(Process.FIRST_APPLICATION_UID, Integer.MAX_VALUE),
};
// ... except for the UIDs that have allow rules.
synchronized (mRulesLock) {
@@ -1647,7 +1593,7 @@ public class NetworkManagementService extends INetworkManagementService.Stub {
for (int i = 0; i < ranges.length; i++) {
if (rules.valueAt(i) == FIREWALL_RULE_DENY) {
int uid = rules.keyAt(i);
- ranges[numUids] = makeUidRangeParcel(uid, uid);
+ ranges[numUids] = new UidRangeParcel(uid, uid);
numUids++;
}
}
diff --git a/services/core/java/com/android/server/OWNERS b/services/core/java/com/android/server/OWNERS
index 733590c4f6c6..a10764b9956c 100644
--- a/services/core/java/com/android/server/OWNERS
+++ b/services/core/java/com/android/server/OWNERS
@@ -10,8 +10,11 @@ per-file ZramWriteback.java = minchan@google.com, rajekumar@google.com, srnvs@go
# Userspace reboot
per-file UserspaceRebootLogger.java = ioffe@google.com, tomcherry@google.com
+# Sensor Privacy
+per-file SensorPrivacyService.java = file:platform/frameworks/native:/libs/sensorprivacy/OWNERS
+
per-file *Alarm* = file:/apex/jobscheduler/OWNERS
-per-file *AppOps* = file:/core/java/android/permission/OWNERS
+per-file *AppOp* = file:/core/java/android/permission/OWNERS
per-file *Bluetooth* = file:/core/java/android/bluetooth/OWNERS
per-file *Gnss* = file:/services/core/java/com/android/server/location/OWNERS
per-file *Location* = file:/services/core/java/com/android/server/location/OWNERS
diff --git a/services/core/java/com/android/server/SensorPrivacyService.java b/services/core/java/com/android/server/SensorPrivacyService.java
index 51e2b12bcee4..010213453940 100644
--- a/services/core/java/com/android/server/SensorPrivacyService.java
+++ b/services/core/java/com/android/server/SensorPrivacyService.java
@@ -16,39 +16,68 @@
package com.android.server;
+import static android.app.AppOpsManager.MODE_ALLOWED;
+import static android.app.AppOpsManager.OP_CAMERA;
+import static android.app.AppOpsManager.OP_RECORD_AUDIO;
import static android.content.pm.PackageManager.PERMISSION_GRANTED;
-
+import static android.service.SensorPrivacyIndividualEnabledSensorProto.CAMERA;
+import static android.service.SensorPrivacyIndividualEnabledSensorProto.MICROPHONE;
+import static android.service.SensorPrivacyIndividualEnabledSensorProto.UNKNOWN;
+
+import android.annotation.NonNull;
+import android.annotation.Nullable;
+import android.app.AppOpsManager;
+import android.app.Notification;
+import android.app.NotificationChannel;
+import android.app.NotificationManager;
+import android.app.PendingIntent;
+import android.content.BroadcastReceiver;
import android.content.Context;
+import android.content.Intent;
+import android.content.IntentFilter;
+import android.graphics.drawable.Icon;
import android.hardware.ISensorPrivacyListener;
import android.hardware.ISensorPrivacyManager;
+import android.hardware.SensorPrivacyManager;
+import android.os.Binder;
import android.os.Environment;
import android.os.Handler;
import android.os.IBinder;
import android.os.Looper;
import android.os.RemoteCallbackList;
import android.os.RemoteException;
+import android.os.ResultReceiver;
+import android.os.ShellCallback;
+import android.os.ShellCommand;
+import android.service.SensorPrivacyIndividualEnabledSensorProto;
+import android.service.SensorPrivacyServiceDumpProto;
import android.util.ArrayMap;
import android.util.AtomicFile;
+import android.util.IndentingPrintWriter;
import android.util.Log;
+import android.util.SparseBooleanArray;
import android.util.TypedXmlPullParser;
import android.util.TypedXmlSerializer;
import android.util.Xml;
+import android.util.proto.ProtoOutputStream;
import com.android.internal.annotations.GuardedBy;
-import com.android.internal.util.FastXmlSerializer;
+import com.android.internal.util.DumpUtils;
import com.android.internal.util.XmlUtils;
+import com.android.internal.util.dump.DualDumpOutputStream;
import com.android.internal.util.function.pooled.PooledLambda;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;
-import org.xmlpull.v1.XmlSerializer;
import java.io.File;
+import java.io.FileDescriptor;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
-import java.nio.charset.StandardCharsets;
+import java.io.PrintWriter;
import java.util.NoSuchElementException;
+import java.util.Objects;
/** @hide */
public final class SensorPrivacyService extends SystemService {
@@ -57,7 +86,15 @@ public final class SensorPrivacyService extends SystemService {
private static final String SENSOR_PRIVACY_XML_FILE = "sensor_privacy.xml";
private static final String XML_TAG_SENSOR_PRIVACY = "sensor-privacy";
+ private static final String XML_TAG_INDIVIDUAL_SENSOR_PRIVACY = "individual-sensor-privacy";
private static final String XML_ATTRIBUTE_ENABLED = "enabled";
+ private static final String XML_ATTRIBUTE_SENSOR = "sensor";
+
+ private static final String SENSOR_PRIVACY_CHANNEL_ID = Context.SENSOR_PRIVACY_SERVICE;
+ private static final String ACTION_DISABLE_INDIVIDUAL_SENSOR_PRIVACY =
+ SensorPrivacyService.class.getName() + ".action.disable_sensor_privacy";
+ private static final String EXTRA_SENSOR = SensorPrivacyService.class.getName()
+ + ".extra.sensor";
private final SensorPrivacyServiceImpl mSensorPrivacyServiceImpl;
@@ -71,7 +108,8 @@ public final class SensorPrivacyService extends SystemService {
publishBinderService(Context.SENSOR_PRIVACY_SERVICE, mSensorPrivacyServiceImpl);
}
- class SensorPrivacyServiceImpl extends ISensorPrivacyManager.Stub {
+ class SensorPrivacyServiceImpl extends ISensorPrivacyManager.Stub implements
+ AppOpsManager.OnOpNotedListener, AppOpsManager.OnOpStartedListener {
private final SensorPrivacyHandler mHandler;
private final Context mContext;
@@ -80,6 +118,7 @@ public final class SensorPrivacyService extends SystemService {
private final AtomicFile mAtomicFile;
@GuardedBy("mLock")
private boolean mEnabled;
+ private SparseBooleanArray mIndividualEnabled = new SparseBooleanArray();
SensorPrivacyServiceImpl(Context context) {
mContext = context;
@@ -88,8 +127,100 @@ public final class SensorPrivacyService extends SystemService {
SENSOR_PRIVACY_XML_FILE);
mAtomicFile = new AtomicFile(sensorPrivacyFile);
synchronized (mLock) {
- mEnabled = readPersistedSensorPrivacyEnabledLocked();
+ readPersistedSensorPrivacyStateLocked();
}
+
+ int[] micAndCameraOps = new int[]{OP_RECORD_AUDIO, OP_CAMERA};
+ AppOpsManager appOpsManager = mContext.getSystemService(AppOpsManager.class);
+ appOpsManager.startWatchingNoted(micAndCameraOps, this);
+ appOpsManager.startWatchingStarted(micAndCameraOps, this);
+
+ mContext.registerReceiver(new BroadcastReceiver() {
+ @Override
+ public void onReceive(Context context, Intent intent) {
+ setIndividualSensorPrivacy(intent.getIntExtra(EXTRA_SENSOR, UNKNOWN), false);
+ }
+ }, new IntentFilter(ACTION_DISABLE_INDIVIDUAL_SENSOR_PRIVACY));
+ }
+
+ @Override
+ public void onOpStarted(int code, int uid, String packageName,
+ @AppOpsManager.OpFlags int flags, @AppOpsManager.Mode int result) {
+ onOpNoted(code, uid, packageName, flags, result);
+ }
+
+ @Override
+ public void onOpNoted(int code, int uid, String packageName,
+ @AppOpsManager.OpFlags int flags, @AppOpsManager.Mode int result) {
+ if (result != MODE_ALLOWED || (flags & AppOpsManager.OP_FLAGS_ALL_TRUSTED) == 0) {
+ return;
+ }
+
+ int sensor;
+ if (code == OP_RECORD_AUDIO) {
+ sensor = MICROPHONE;
+ } else {
+ sensor = CAMERA;
+ }
+
+ onSensorUseStarted(uid, packageName, sensor);
+ }
+
+ /**
+ * Called when a sensor protected by individual sensor privacy is attempting to get used.
+ *
+ * @param uid The uid of the app using the sensor
+ * @param packageName The package name of the app using the sensor
+ * @param sensor The sensor that is attempting to be used
+ */
+ private void onSensorUseStarted(int uid, String packageName, int sensor) {
+ if (!isIndividualSensorPrivacyEnabled(sensor)) {
+ return;
+ }
+
+ // TODO moltmann: Use dialog instead of notification if we can determine the activity
+ // which triggered this usage
+
+ // TODO evanseverson: - Implement final UX for notification
+ // - Finalize strings and icons and add as resources
+
+ int icon;
+ CharSequence notificationMessage;
+ if (sensor == MICROPHONE) {
+ icon = com.android.internal.R.drawable.ic_mic;
+ notificationMessage = "Microphone is muted because of sensor privacy";
+ } else {
+ icon = com.android.internal.R.drawable.ic_camera;
+ notificationMessage = "Camera is blocked because of sensor privacy";
+ }
+
+ NotificationManager notificationManager =
+ mContext.getSystemService(NotificationManager.class);
+ NotificationChannel channel = new NotificationChannel(
+ SENSOR_PRIVACY_CHANNEL_ID, "Sensor privacy",
+ NotificationManager.IMPORTANCE_HIGH);
+ channel.setSound(null, null);
+ channel.setBypassDnd(true);
+ channel.enableVibration(false);
+ channel.setBlockable(false);
+
+ notificationManager.createNotificationChannel(channel);
+
+ notificationManager.notify(sensor,
+ new Notification.Builder(mContext, SENSOR_PRIVACY_CHANNEL_ID)
+ .setContentTitle(notificationMessage)
+ .setSmallIcon(icon)
+ .addAction(new Notification.Action.Builder(
+ Icon.createWithResource(mContext, icon),
+ "Disable sensor privacy",
+ PendingIntent.getBroadcast(mContext, sensor,
+ new Intent(ACTION_DISABLE_INDIVIDUAL_SENSOR_PRIVACY)
+ .setPackage(mContext.getPackageName())
+ .putExtra(EXTRA_SENSOR, sensor),
+ PendingIntent.FLAG_IMMUTABLE
+ | PendingIntent.FLAG_UPDATE_CURRENT))
+ .build())
+ .build());
}
/**
@@ -101,24 +232,28 @@ public final class SensorPrivacyService extends SystemService {
enforceSensorPrivacyPermission();
synchronized (mLock) {
mEnabled = enable;
- FileOutputStream outputStream = null;
- try {
- outputStream = mAtomicFile.startWrite();
- TypedXmlSerializer serializer = Xml.resolveSerializer(outputStream);
- serializer.startDocument(null, true);
- serializer.startTag(null, XML_TAG_SENSOR_PRIVACY);
- serializer.attributeBoolean(null, XML_ATTRIBUTE_ENABLED, enable);
- serializer.endTag(null, XML_TAG_SENSOR_PRIVACY);
- serializer.endDocument();
- mAtomicFile.finishWrite(outputStream);
- } catch (IOException e) {
- Log.e(TAG, "Caught an exception persisting the sensor privacy state: ", e);
- mAtomicFile.failWrite(outputStream);
- }
+ persistSensorPrivacyStateLocked();
}
mHandler.onSensorPrivacyChanged(enable);
}
+ public void setIndividualSensorPrivacy(int sensor, boolean enable) {
+ enforceSensorPrivacyPermission();
+ synchronized (mLock) {
+ mIndividualEnabled.put(sensor, enable);
+
+ if (!enable) {
+ // Remove any notifications prompting the user to disable sensory privacy
+ NotificationManager notificationManager =
+ mContext.getSystemService(NotificationManager.class);
+
+ notificationManager.cancel(sensor);
+ }
+
+ persistSensorPrivacyState();
+ }
+ }
+
/**
* Enforces the caller contains the necessary permission to change the state of sensor
* privacy.
@@ -143,30 +278,48 @@ public final class SensorPrivacyService extends SystemService {
}
}
+ @Override
+ public boolean isIndividualSensorPrivacyEnabled(int sensor) {
+ synchronized (mLock) {
+ return mIndividualEnabled.get(sensor, false);
+ }
+ }
+
/**
* Returns the state of sensor privacy from persistent storage.
*/
- private boolean readPersistedSensorPrivacyEnabledLocked() {
+ private void readPersistedSensorPrivacyStateLocked() {
// if the file does not exist then sensor privacy has not yet been enabled on
// the device.
if (!mAtomicFile.exists()) {
- return false;
+ return;
}
- boolean enabled;
try (FileInputStream inputStream = mAtomicFile.openRead()) {
TypedXmlPullParser parser = Xml.resolvePullParser(inputStream);
XmlUtils.beginDocument(parser, XML_TAG_SENSOR_PRIVACY);
parser.next();
- String tagName = parser.getName();
- enabled = parser.getAttributeBoolean(null, XML_ATTRIBUTE_ENABLED, false);
+ mEnabled = parser.getAttributeBoolean(null, XML_ATTRIBUTE_ENABLED, false);
+
+ XmlUtils.nextElement(parser);
+ while (parser.getEventType() != XmlPullParser.END_DOCUMENT) {
+ String tagName = parser.getName();
+ if (XML_TAG_INDIVIDUAL_SENSOR_PRIVACY.equals(tagName)) {
+ int sensor = XmlUtils.readIntAttribute(parser, XML_ATTRIBUTE_SENSOR);
+ boolean enabled = XmlUtils.readBooleanAttribute(parser,
+ XML_ATTRIBUTE_ENABLED);
+ mIndividualEnabled.put(sensor, enabled);
+ XmlUtils.skipCurrentTag(parser);
+ } else {
+ XmlUtils.nextElement(parser);
+ }
+ }
+
} catch (IOException | XmlPullParserException e) {
Log.e(TAG, "Caught an exception reading the state from storage: ", e);
// Delete the file to prevent the same error on subsequent calls and assume sensor
// privacy is not enabled.
mAtomicFile.delete();
- enabled = false;
}
- return enabled;
}
/**
@@ -174,20 +327,33 @@ public final class SensorPrivacyService extends SystemService {
*/
private void persistSensorPrivacyState() {
synchronized (mLock) {
- FileOutputStream outputStream = null;
- try {
- outputStream = mAtomicFile.startWrite();
- TypedXmlSerializer serializer = Xml.resolveSerializer(outputStream);
- serializer.startDocument(null, true);
- serializer.startTag(null, XML_TAG_SENSOR_PRIVACY);
- serializer.attributeBoolean(null, XML_ATTRIBUTE_ENABLED, mEnabled);
- serializer.endTag(null, XML_TAG_SENSOR_PRIVACY);
- serializer.endDocument();
- mAtomicFile.finishWrite(outputStream);
- } catch (IOException e) {
- Log.e(TAG, "Caught an exception persisting the sensor privacy state: ", e);
- mAtomicFile.failWrite(outputStream);
+ persistSensorPrivacyStateLocked();
+ }
+ }
+
+ private void persistSensorPrivacyStateLocked() {
+ FileOutputStream outputStream = null;
+ try {
+ outputStream = mAtomicFile.startWrite();
+ TypedXmlSerializer serializer = Xml.resolveSerializer(outputStream);
+ serializer.startDocument(null, true);
+ serializer.startTag(null, XML_TAG_SENSOR_PRIVACY);
+ serializer.attributeBoolean(null, XML_ATTRIBUTE_ENABLED, mEnabled);
+ int numIndividual = mIndividualEnabled.size();
+ for (int i = 0; i < numIndividual; i++) {
+ serializer.startTag(null, XML_TAG_INDIVIDUAL_SENSOR_PRIVACY);
+ int sensor = mIndividualEnabled.keyAt(i);
+ boolean enabled = mIndividualEnabled.valueAt(i);
+ serializer.attributeInt(null, XML_ATTRIBUTE_SENSOR, sensor);
+ serializer.attributeBoolean(null, XML_ATTRIBUTE_ENABLED, enabled);
+ serializer.endTag(null, XML_TAG_INDIVIDUAL_SENSOR_PRIVACY);
}
+ serializer.endTag(null, XML_TAG_SENSOR_PRIVACY);
+ serializer.endDocument();
+ mAtomicFile.finishWrite(outputStream);
+ } catch (IOException e) {
+ Log.e(TAG, "Caught an exception persisting the sensor privacy state: ", e);
+ mAtomicFile.failWrite(outputStream);
}
}
@@ -212,6 +378,170 @@ public final class SensorPrivacyService extends SystemService {
}
mHandler.removeListener(listener);
}
+
+ @Override
+ public void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
+ Objects.requireNonNull(fd);
+
+ if (!DumpUtils.checkDumpPermission(mContext, TAG, pw)) return;
+
+ int opti = 0;
+ boolean dumpAsProto = false;
+ while (opti < args.length) {
+ String opt = args[opti];
+ if (opt == null || opt.length() <= 0 || opt.charAt(0) != '-') {
+ break;
+ }
+ opti++;
+ if ("--proto".equals(opt)) {
+ dumpAsProto = true;
+ } else {
+ pw.println("Unknown argument: " + opt + "; use -h for help");
+ }
+ }
+
+ final long identity = Binder.clearCallingIdentity();
+ try {
+ if (dumpAsProto) {
+ dump(new DualDumpOutputStream(new ProtoOutputStream(fd)));
+ } else {
+ pw.println("SENSOR PRIVACY MANAGER STATE (dumpsys "
+ + Context.SENSOR_PRIVACY_SERVICE + ")");
+
+ dump(new DualDumpOutputStream(new IndentingPrintWriter(pw, " ")));
+ }
+ } finally {
+ Binder.restoreCallingIdentity(identity);
+ }
+ }
+
+ /**
+ * Dump state to {@link DualDumpOutputStream}.
+ *
+ * @param dumpStream The destination to dump to
+ */
+ private void dump(@NonNull DualDumpOutputStream dumpStream) {
+ synchronized (mLock) {
+ dumpStream.write("is_enabled", SensorPrivacyServiceDumpProto.IS_ENABLED, mEnabled);
+
+ int numIndividualEnabled = mIndividualEnabled.size();
+ for (int i = 0; i < numIndividualEnabled; i++) {
+ long token = dumpStream.start("individual_enabled_sensor",
+ SensorPrivacyServiceDumpProto.INDIVIDUAL_ENABLED_SENSOR);
+
+ dumpStream.write("sensor",
+ SensorPrivacyIndividualEnabledSensorProto.SENSOR,
+ mIndividualEnabled.keyAt(i));
+ dumpStream.write("is_enabled",
+ SensorPrivacyIndividualEnabledSensorProto.IS_ENABLED,
+ mIndividualEnabled.valueAt(i));
+
+ dumpStream.end(token);
+ }
+ }
+
+ dumpStream.flush();
+ }
+
+ /**
+ * Convert a string into a {@link SensorPrivacyManager.IndividualSensor id}.
+ *
+ * @param sensor The name to convert
+ *
+ * @return The id corresponding to the name
+ */
+ private @SensorPrivacyManager.IndividualSensor int sensorStrToId(@Nullable String sensor) {
+ if (sensor == null) {
+ return UNKNOWN;
+ }
+
+ switch (sensor) {
+ case "microphone":
+ return MICROPHONE;
+ case "camera":
+ return CAMERA;
+ default: {
+ return UNKNOWN;
+ }
+ }
+ }
+
+ @Override
+ public void onShellCommand(FileDescriptor in, FileDescriptor out,
+ FileDescriptor err, String[] args, ShellCallback callback,
+ ResultReceiver resultReceiver) {
+ (new ShellCommand() {
+ @Override
+ public int onCommand(String cmd) {
+ if (cmd == null) {
+ return handleDefaultCommands(cmd);
+ }
+
+ final PrintWriter pw = getOutPrintWriter();
+ switch (cmd) {
+ case "enable" : {
+ int sensor = sensorStrToId(getNextArg());
+ if (sensor == UNKNOWN) {
+ pw.println("Invalid sensor");
+ return -1;
+ }
+
+ setIndividualSensorPrivacy(sensor, true);
+ }
+ break;
+ case "disable" : {
+ int sensor = sensorStrToId(getNextArg());
+ if (sensor == UNKNOWN) {
+ pw.println("Invalid sensor");
+ return -1;
+ }
+
+ setIndividualSensorPrivacy(sensor, false);
+ }
+ break;
+ case "reset": {
+ int sensor = sensorStrToId(getNextArg());
+ if (sensor == UNKNOWN) {
+ pw.println("Invalid sensor");
+ return -1;
+ }
+
+ enforceSensorPrivacyPermission();
+
+ synchronized (mLock) {
+ mIndividualEnabled.delete(sensor);
+ persistSensorPrivacyState();
+ }
+ }
+ break;
+ default:
+ return handleDefaultCommands(cmd);
+ }
+
+ return 0;
+ }
+
+ @Override
+ public void onHelp() {
+ final PrintWriter pw = getOutPrintWriter();
+
+ pw.println("Sensor privacy manager (" + Context.SENSOR_PRIVACY_SERVICE
+ + ") commands:");
+ pw.println(" help");
+ pw.println(" Print this help text.");
+ pw.println("");
+ pw.println(" enable SENSOR");
+ pw.println(" Enable privacy for a certain sensor.");
+ pw.println("");
+ pw.println(" disable SENSOR");
+ pw.println(" Disable privacy for a certain sensor.");
+ pw.println("");
+ pw.println(" reset SENSOR");
+ pw.println(" Reset privacy state for a certain sensor.");
+ pw.println("");
+ }
+ }).exec(this, in, out, err, args, callback, resultReceiver);
+ }
}
/**
diff --git a/services/core/java/com/android/server/StorageManagerService.java b/services/core/java/com/android/server/StorageManagerService.java
index c95bfd031af4..ad547c5cb48e 100644
--- a/services/core/java/com/android/server/StorageManagerService.java
+++ b/services/core/java/com/android/server/StorageManagerService.java
@@ -4375,14 +4375,7 @@ class StorageManagerService extends IStorageManager.Stub
// Create package obb and data dir if it doesn't exist.
int appUid = UserHandle.getUid(userId, mPmInternal.getPackage(pkg).getUid());
- File file = new File(packageObbDir);
- if (!file.exists()) {
- vold.setupAppDir(packageObbDir, appUid);
- }
- file = new File(packageDataDir);
- if (!file.exists()) {
- vold.setupAppDir(packageDataDir, appUid);
- }
+ vold.ensureAppDirsCreated(new String[] {packageObbDir, packageDataDir}, appUid);
}
} catch (ServiceManager.ServiceNotFoundException | RemoteException e) {
Slog.e(TAG, "Unable to create obb and data directories for " + processName,e);
@@ -4488,10 +4481,13 @@ class StorageManagerService extends IStorageManager.Stub
// When using FUSE, we may need to kill the app if the op changes
switch(code) {
case OP_REQUEST_INSTALL_PACKAGES:
- if (previousMode == MODE_ALLOWED || mode == MODE_ALLOWED) {
- // If we transition to/from MODE_ALLOWED, kill the app to make
- // sure it has the correct view of /storage. Changing between
- // MODE_DEFAULT / MODE_ERRORED is a no-op
+ // In R, we used to kill the app here if it transitioned to/from
+ // MODE_ALLOWED, to make sure the app had the correct (writable) OBB
+ // view. But the majority of apps don't handle OBBs anyway, and for those
+ // that do, they can restart themselves. Therefore, starting from S,
+ // only kill the app when it transitions away from MODE_ALLOWED (eg,
+ // when the permission is taken away).
+ if (previousMode == MODE_ALLOWED && mode != MODE_ALLOWED) {
killAppForOpChange(code, uid);
}
return;
diff --git a/services/core/java/com/android/server/TestNetworkService.java b/services/core/java/com/android/server/TestNetworkService.java
index 75ebe70591df..655d8abf3e84 100644
--- a/services/core/java/com/android/server/TestNetworkService.java
+++ b/services/core/java/com/android/server/TestNetworkService.java
@@ -61,9 +61,8 @@ import java.util.concurrent.atomic.AtomicInteger;
/** @hide */
class TestNetworkService extends ITestNetworkManager.Stub {
- @NonNull private static final String TAG = TestNetworkService.class.getSimpleName();
@NonNull private static final String TEST_NETWORK_LOGTAG = "TestNetworkAgent";
- @NonNull private static final String TEST_NETWORK_PROVIDER_NAME = TAG;
+ @NonNull private static final String TEST_NETWORK_PROVIDER_NAME = "TestNetworkProvider";
@NonNull private static final AtomicInteger sTestTunIndex = new AtomicInteger();
@NonNull private final Context mContext;
@@ -168,17 +167,15 @@ class TestNetworkService extends ITestNetworkManager.Stub {
private TestNetworkAgent(
@NonNull Context context,
@NonNull Looper looper,
- @NonNull NetworkAgentConfig config,
@NonNull NetworkCapabilities nc,
@NonNull LinkProperties lp,
+ @NonNull NetworkAgentConfig config,
int uid,
@NonNull IBinder binder,
@NonNull NetworkProvider np)
throws RemoteException {
super(context, looper, TEST_NETWORK_LOGTAG, nc, lp, NETWORK_SCORE, config, np);
-
mUid = uid;
-
synchronized (mBinderLock) {
mBinder = binder; // Binder null-checks in create()
@@ -286,8 +283,8 @@ class TestNetworkService extends ITestNetworkManager.Stub {
lp.addRoute(new RouteInfo(new IpPrefix(Inet6Address.ANY, 0), null, iface));
}
- final TestNetworkAgent agent = new TestNetworkAgent(context, looper,
- new NetworkAgentConfig.Builder().build(), nc, lp, callingUid, binder,
+ final TestNetworkAgent agent = new TestNetworkAgent(context, looper, nc, lp,
+ new NetworkAgentConfig.Builder().build(), callingUid, binder,
mNetworkProvider);
agent.register();
agent.markConnected();
diff --git a/services/core/java/com/android/server/accounts/AccountManagerService.java b/services/core/java/com/android/server/accounts/AccountManagerService.java
index 9a94e4efdfe3..15e31ba0f140 100644
--- a/services/core/java/com/android/server/accounts/AccountManagerService.java
+++ b/services/core/java/com/android/server/accounts/AccountManagerService.java
@@ -3085,7 +3085,8 @@ public class AccountManagerService
.setContentTitle(title)
.setContentText(subtitle)
.setContentIntent(PendingIntent.getActivityAsUser(mContext, 0, intent,
- PendingIntent.FLAG_CANCEL_CURRENT, null, user))
+ PendingIntent.FLAG_CANCEL_CURRENT | PendingIntent.FLAG_IMMUTABLE,
+ null, user))
.build();
installNotification(getCredentialPermissionNotificationId(
account, authTokenType, uid), n, packageName, user.getIdentifier());
@@ -5307,7 +5308,8 @@ public class AccountManagerService
.setContentTitle(String.format(notificationTitleFormat, account.name))
.setContentText(message)
.setContentIntent(PendingIntent.getActivityAsUser(
- mContext, 0, intent, PendingIntent.FLAG_CANCEL_CURRENT,
+ mContext, 0, intent,
+ PendingIntent.FLAG_CANCEL_CURRENT | PendingIntent.FLAG_IMMUTABLE,
null, new UserHandle(userId)))
.build();
installNotification(id, n, packageName, userId);
diff --git a/services/core/java/com/android/server/am/ActiveServices.java b/services/core/java/com/android/server/am/ActiveServices.java
index c364c8463f1b..7d6e54243d89 100644
--- a/services/core/java/com/android/server/am/ActiveServices.java
+++ b/services/core/java/com/android/server/am/ActiveServices.java
@@ -19,7 +19,6 @@ package com.android.server.am;
import static android.Manifest.permission.START_ACTIVITIES_FROM_BACKGROUND;
import static android.Manifest.permission.START_FOREGROUND_SERVICES_FROM_BACKGROUND;
import static android.Manifest.permission.SYSTEM_ALERT_WINDOW;
-import static android.app.ActivityManager.PROCESS_STATE_BOUND_FOREGROUND_SERVICE;
import static android.content.pm.PackageManager.PERMISSION_GRANTED;
import static android.content.pm.ServiceInfo.FOREGROUND_SERVICE_TYPE_MANIFEST;
import static android.os.Process.NFC_UID;
@@ -168,6 +167,7 @@ public final class ActiveServices {
public static final int FGS_FEATURE_ALLOWED_BY_SYSTEM_ALERT_WINDOW_PERMISSION = 16;
public static final int FGS_FEATURE_ALLOWED_BY_FGS_BINDING = 17;
public static final int FGS_FEATURE_ALLOWED_BY_DEVICE_DEMO_MODE = 18;
+ public static final int FGS_FEATURE_ALLOWED_BY_PROCESS_RECORD = 19;
@IntDef(flag = true, prefix = { "FGS_FEATURE_" }, value = {
FGS_FEATURE_DENIED,
@@ -187,7 +187,8 @@ public final class ActiveServices {
FGS_FEATURE_ALLOWED_BY_DEVICE_IDLE_ALLOW_LIST,
FGS_FEATURE_ALLOWED_BY_SYSTEM_ALERT_WINDOW_PERMISSION,
FGS_FEATURE_ALLOWED_BY_FGS_BINDING,
- FGS_FEATURE_ALLOWED_BY_DEVICE_DEMO_MODE
+ FGS_FEATURE_ALLOWED_BY_DEVICE_DEMO_MODE,
+ FGS_FEATURE_ALLOWED_BY_PROCESS_RECORD
})
@Retention(RetentionPolicy.SOURCE)
public @interface FgsFeatureRetCode {}
@@ -1859,7 +1860,7 @@ public final class ActiveServices {
private final AppOpsManager.OnOpNotedListener mOpNotedCallback =
new AppOpsManager.OnOpNotedListener() {
@Override
- public void onOpNoted(int op, int uid, String pkgName, int result) {
+ public void onOpNoted(int op, int uid, String pkgName, int flags, int result) {
incrementOpCountIfNeeded(op, uid, result);
}
};
@@ -1867,7 +1868,8 @@ public final class ActiveServices {
private final AppOpsManager.OnOpStartedListener mOpStartedCallback =
new AppOpsManager.OnOpStartedListener() {
@Override
- public void onOpStarted(int op, int uid, String pkgName, int result) {
+ public void onOpStarted(int op, int uid, String pkgName, int flags,
+ int result) {
incrementOpCountIfNeeded(op, uid, result);
}
};
@@ -5243,10 +5245,14 @@ public final class ActiveServices {
if (ret == FGS_FEATURE_DENIED) {
for (int i = mAm.mProcessList.mLruProcesses.size() - 1; i >= 0; i--) {
final ProcessRecord pr = mAm.mProcessList.mLruProcesses.get(i);
- if (pr.uid == callingUid
- && pr.mAllowStartFgsState <= PROCESS_STATE_BOUND_FOREGROUND_SERVICE) {
- ret = FGS_FEATURE_ALLOWED_BY_PROC_STATE;
- break;
+ if (pr.uid == callingUid) {
+ if (pr.mAllowStartFgs) {
+ ret = FGS_FEATURE_ALLOWED_BY_PROCESS_RECORD;
+ break;
+ } else if (pr.isAllowedStartFgsState()) {
+ ret = FGS_FEATURE_ALLOWED_BY_PROC_STATE;
+ break;
+ }
}
}
}
@@ -5285,7 +5291,7 @@ public final class ActiveServices {
}
if (ret == FGS_FEATURE_DENIED) {
- if (mAm.isWhitelistedForFgsStartLocked(r.appInfo.uid)) {
+ if (mAm.isWhitelistedForFgsStartLocked(callingUid)) {
// uid is on DeviceIdleController's user/system allowlist
// or AMS's FgsStartTempAllowList.
ret = FGS_FEATURE_ALLOWED_BY_DEVICE_IDLE_ALLOW_LIST;
@@ -5353,6 +5359,8 @@ public final class ActiveServices {
return "ALLOWED_BY_FGS_BINDING";
case FGS_FEATURE_ALLOWED_BY_DEVICE_DEMO_MODE:
return "ALLOWED_BY_DEVICE_DEMO_MODE";
+ case FGS_FEATURE_ALLOWED_BY_PROCESS_RECORD:
+ return "ALLOWED_BY_PROCESS_RECORD";
default:
return "";
}
diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java
index 2f4373cf473a..10102cd12346 100644
--- a/services/core/java/com/android/server/am/ActivityManagerService.java
+++ b/services/core/java/com/android/server/am/ActivityManagerService.java
@@ -174,6 +174,7 @@ import android.app.ProfilerInfo;
import android.app.WaitResult;
import android.app.backup.BackupManager.OperationType;
import android.app.backup.IBackupManager;
+import android.app.compat.CompatChanges;
import android.app.usage.UsageEvents;
import android.app.usage.UsageEvents.Event;
import android.app.usage.UsageStatsManager;
@@ -13713,6 +13714,37 @@ public class ActivityManagerService extends IActivityManager.Stub
forceStopPackageLocked(packageName, -1, false, true, true,
false, false, userId, "package unstartable");
break;
+ case Intent.ACTION_CLOSE_SYSTEM_DIALOGS:
+ if (!canCloseSystemDialogs(callingPid, callingUid, callerApp)) {
+ // The app can't close system dialogs, throw only if it targets S+
+ if (CompatChanges.isChangeEnabled(
+ ActivityManager.LOCK_DOWN_CLOSE_SYSTEM_DIALOGS, callingUid)) {
+ throw new SecurityException(
+ "Permission Denial: " + Intent.ACTION_CLOSE_SYSTEM_DIALOGS
+ + " broadcast from " + callerPackage + " (pid="
+ + callingPid + ", uid=" + callingUid + ")"
+ + " requires "
+ + permission.BROADCAST_CLOSE_SYSTEM_DIALOGS + ".");
+ } else if (CompatChanges.isChangeEnabled(
+ ActivityManager.DROP_CLOSE_SYSTEM_DIALOGS, callingUid)) {
+ Slog.w(TAG, "Permission Denial: " + intent.getAction()
+ + " broadcast from " + callerPackage + " (pid=" + callingPid
+ + ", uid=" + callingUid + ")"
+ + " requires "
+ + permission.BROADCAST_CLOSE_SYSTEM_DIALOGS
+ + ", dropping broadcast.");
+ // Returning success seems to be the pattern here
+ return ActivityManager.BROADCAST_SUCCESS;
+ } else {
+ Slog.w(TAG, intent.getAction()
+ + " broadcast from " + callerPackage + " (pid=" + callingPid
+ + ", uid=" + callingUid + ")"
+ + " will require "
+ + permission.BROADCAST_CLOSE_SYSTEM_DIALOGS
+ + " in future builds.");
+ }
+ }
+ break;
}
if (Intent.ACTION_PACKAGE_ADDED.equals(action) ||
@@ -14005,6 +14037,32 @@ public class ActivityManagerService extends IActivityManager.Stub
return ActivityManager.BROADCAST_SUCCESS;
}
+ private boolean canCloseSystemDialogs(int pid, int uid, @Nullable ProcessRecord callerApp) {
+ if (checkPermission(permission.BROADCAST_CLOSE_SYSTEM_DIALOGS, pid, uid)
+ == PERMISSION_GRANTED) {
+ return true;
+ }
+ if (callerApp == null) {
+ synchronized (mPidsSelfLocked) {
+ callerApp = mPidsSelfLocked.get(pid);
+ }
+ }
+ // Check if the instrumentation of the process has the permission. This covers the usual
+ // test started from the shell (which has the permission) case. This is needed for apps
+ // targeting SDK level < S but we are also allowing for targetSdk S+ as a convenience to
+ // avoid breaking a bunch of existing tests and asking them to adopt shell permissions to do
+ // this.
+ if (callerApp != null) {
+ ActiveInstrumentation instrumentation = callerApp.getActiveInstrumentation();
+ if (instrumentation != null && checkPermission(
+ permission.BROADCAST_CLOSE_SYSTEM_DIALOGS, -1, instrumentation.mSourceUid)
+ == PERMISSION_GRANTED) {
+ return true;
+ }
+ }
+ return false;
+ }
+
/**
* @return uid from the extra field {@link Intent#EXTRA_UID} if present, Otherwise -1
*/
diff --git a/services/core/java/com/android/server/am/AppErrors.java b/services/core/java/com/android/server/am/AppErrors.java
index 0b4d27f4990b..f2c1e90e2476 100644
--- a/services/core/java/com/android/server/am/AppErrors.java
+++ b/services/core/java/com/android/server/am/AppErrors.java
@@ -756,8 +756,9 @@ class AppErrors {
boolean handleAppCrashLocked(ProcessRecord app, String reason,
String shortMsg, String longMsg, String stackTrace, AppErrorDialog.Data data) {
final long now = SystemClock.uptimeMillis();
- final boolean showBackground = Settings.Secure.getInt(mContext.getContentResolver(),
- Settings.Secure.ANR_SHOW_BACKGROUND, 0) != 0;
+ final boolean showBackground = Settings.Secure.getIntForUser(mContext.getContentResolver(),
+ Settings.Secure.ANR_SHOW_BACKGROUND, 0,
+ mService.mUserController.getCurrentUserId()) != 0;
final boolean procIsBoundForeground =
(app.getCurProcState() == ActivityManager.PROCESS_STATE_BOUND_FOREGROUND_SERVICE);
@@ -889,8 +890,9 @@ class AppErrors {
void handleShowAppErrorUi(Message msg) {
AppErrorDialog.Data data = (AppErrorDialog.Data) msg.obj;
- boolean showBackground = Settings.Secure.getInt(mContext.getContentResolver(),
- Settings.Secure.ANR_SHOW_BACKGROUND, 0) != 0;
+ boolean showBackground = Settings.Secure.getIntForUser(mContext.getContentResolver(),
+ Settings.Secure.ANR_SHOW_BACKGROUND, 0,
+ mService.mUserController.getCurrentUserId()) != 0;
final int userId;
synchronized (mService) {
@@ -982,8 +984,9 @@ class AppErrors {
return;
}
- boolean showBackground = Settings.Secure.getInt(mContext.getContentResolver(),
- Settings.Secure.ANR_SHOW_BACKGROUND, 0) != 0;
+ boolean showBackground = Settings.Secure.getIntForUser(mContext.getContentResolver(),
+ Settings.Secure.ANR_SHOW_BACKGROUND, 0,
+ mService.mUserController.getCurrentUserId()) != 0;
if (mService.mAtmInternal.canShowErrorDialogs() || showBackground) {
proc.getDialogController().showAnrDialogs(data);
} else {
diff --git a/services/core/java/com/android/server/am/OWNERS b/services/core/java/com/android/server/am/OWNERS
index 60530c4eb920..9e79b02f8c96 100644
--- a/services/core/java/com/android/server/am/OWNERS
+++ b/services/core/java/com/android/server/am/OWNERS
@@ -23,6 +23,8 @@ toddke@google.com
# Battery Stats
joeo@google.com
+per-file BatteryStats* = file:/BATTERY_STATS_OWNERS
+per-file BatteryExternalStats* = file:/BATTERY_STATS_OWNERS
# Londoners
michaelwr@google.com
diff --git a/services/core/java/com/android/server/am/OomAdjuster.java b/services/core/java/com/android/server/am/OomAdjuster.java
index 771f273781fa..5b3e6514c6a6 100644
--- a/services/core/java/com/android/server/am/OomAdjuster.java
+++ b/services/core/java/com/android/server/am/OomAdjuster.java
@@ -1329,7 +1329,7 @@ public final class OomAdjuster {
app.setCached(false);
app.shouldNotFreeze = false;
- app.mAllowStartFgsState = PROCESS_STATE_NONEXISTENT;
+ app.resetAllowStartFgs();
final int appUid = app.info.uid;
final int logUid = mService.mCurOomAdjUid;
@@ -1351,7 +1351,6 @@ public final class OomAdjuster {
app.setCurrentSchedulingGroup(ProcessList.SCHED_GROUP_DEFAULT);
app.curCapability = PROCESS_CAPABILITY_ALL;
app.setCurProcState(ActivityManager.PROCESS_STATE_PERSISTENT);
- app.bumpAllowStartFgsState(PROCESS_STATE_PERSISTENT);
// System processes can do UI, and when they do we want to have
// them trim their memory after the user leaves the UI. To
// facilitate this, here we need to determine whether or not it
@@ -1382,6 +1381,8 @@ public final class OomAdjuster {
app.setCurRawProcState(app.getCurProcState());
app.curAdj = app.maxAdj;
app.completedAdjSeq = app.adjSeq;
+ app.bumpAllowStartFgsState(app.getCurProcState());
+ app.setAllowStartFgs();
// if curAdj is less than prevAppAdj, then this process was promoted
return app.curAdj < prevAppAdj || app.getCurProcState() < prevProcState;
}
@@ -1773,6 +1774,11 @@ public final class OomAdjuster {
int clientAdj = client.getCurRawAdj();
int clientProcState = client.getCurRawProcState();
+ // pass client's mAllowStartFgs to the app if client is not persistent process.
+ if (client.mAllowStartFgs && client.maxAdj >= ProcessList.FOREGROUND_APP_ADJ) {
+ app.mAllowStartFgs = true;
+ }
+
if ((cr.flags & Context.BIND_WAIVE_PRIORITY) == 0) {
if (shouldSkipDueToCycle(app, client, procState, adj, cycleReEval)) {
continue;
@@ -2236,7 +2242,7 @@ public final class OomAdjuster {
app.setCurRawProcState(procState);
app.setHasForegroundActivities(foregroundActivities);
app.completedAdjSeq = mAdjSeq;
-
+ app.setAllowStartFgs();
// if curAdj or curProcState improved, then this process was promoted
return app.curAdj < prevAppAdj || app.getCurProcState() < prevProcState
|| app.curCapability != prevCapability ;
diff --git a/services/core/java/com/android/server/am/ProcessRecord.java b/services/core/java/com/android/server/am/ProcessRecord.java
index cf4adc65a7fc..255badd3239f 100644
--- a/services/core/java/com/android/server/am/ProcessRecord.java
+++ b/services/core/java/com/android/server/am/ProcessRecord.java
@@ -16,7 +16,16 @@
package com.android.server.am;
+import static android.Manifest.permission.START_ACTIVITIES_FROM_BACKGROUND;
+import static android.Manifest.permission.START_FOREGROUND_SERVICES_FROM_BACKGROUND;
+import static android.Manifest.permission.SYSTEM_ALERT_WINDOW;
+import static android.app.ActivityManager.PROCESS_STATE_BOUND_FOREGROUND_SERVICE;
import static android.app.ActivityManager.PROCESS_STATE_NONEXISTENT;
+import static android.content.pm.PackageManager.PERMISSION_GRANTED;
+import static android.os.Process.NFC_UID;
+import static android.os.Process.ROOT_UID;
+import static android.os.Process.SHELL_UID;
+import static android.os.Process.SYSTEM_UID;
import static com.android.server.Watchdog.NATIVE_STACKS_OF_INTEREST;
import static com.android.server.am.ActivityManagerDebugConfig.DEBUG_ANR;
@@ -361,6 +370,17 @@ class ProcessRecord implements WindowProcessListener {
private final ArraySet<Binder> mBackgroundFgsStartTokens = new ArraySet<>();
+ // The list of permissions that can start FGS from background.
+ private static String[] ALLOW_BG_START_FGS_PERMISSIONS =
+ {START_ACTIVITIES_FROM_BACKGROUND, START_FOREGROUND_SERVICES_FROM_BACKGROUND,
+ SYSTEM_ALERT_WINDOW};
+ // Does the process has permission to start FGS from background.
+ boolean mAllowStartFgsByPermission;
+ // Can this process start FGS from background?
+ // If this process has the ability to start FGS from background, this ability can be passed to
+ // another process through service binding.
+ boolean mAllowStartFgs;
+
void setStartParams(int startUid, HostingRecord hostingRecord, String seInfo,
long startTime) {
this.startUid = startUid;
@@ -476,6 +496,9 @@ class ProcessRecord implements WindowProcessListener {
pw.println();
pw.print(prefix); pw.print("allowStartFgsState=");
pw.println(mAllowStartFgsState);
+ if (mAllowStartFgs) {
+ pw.print(prefix); pw.print("allowStartFgs="); pw.println(mAllowStartFgs);
+ }
if (hasShownUi || mPendingUiClean || hasAboveClient || treatLikeActivity) {
pw.print(prefix); pw.print("hasShownUi="); pw.print(hasShownUi);
pw.print(" pendingUiClean="); pw.print(mPendingUiClean);
@@ -672,6 +695,7 @@ class ProcessRecord implements WindowProcessListener {
mWindowProcessController = new WindowProcessController(
mService.mActivityTaskManager, info, processName, uid, userId, this, this);
pkgList.put(_info.packageName, new ProcessStats.ProcessStateHolder(_info.longVersionCode));
+ setAllowStartFgsByPermission();
}
public void setPid(int _pid) {
@@ -1983,12 +2007,78 @@ class ProcessRecord implements WindowProcessListener {
return mDialogController;
}
+ void resetAllowStartFgs() {
+ mAllowStartFgsState = PROCESS_STATE_NONEXISTENT;
+ mAllowStartFgs = mAllowStartFgsByPermission;
+ }
+
void bumpAllowStartFgsState(int newProcState) {
if (newProcState < mAllowStartFgsState) {
mAllowStartFgsState = newProcState;
}
}
+ void setAllowStartFgsByPermission() {
+ boolean ret = false;
+ if (!ret) {
+ boolean isSystem = false;
+ final int uid = UserHandle.getAppId(info.uid);
+ switch (uid) {
+ case ROOT_UID:
+ case SYSTEM_UID:
+ case NFC_UID:
+ case SHELL_UID:
+ isSystem = true;
+ break;
+ default:
+ isSystem = false;
+ break;
+ }
+
+ if (isSystem) {
+ ret = true;
+ }
+ }
+
+ if (!ret) {
+ for (int i = 0; i < ALLOW_BG_START_FGS_PERMISSIONS.length; ++i) {
+ if (ActivityManager.checkComponentPermission(ALLOW_BG_START_FGS_PERMISSIONS[i],
+ info.uid, -1, true)
+ == PERMISSION_GRANTED) {
+ ret = true;
+ break;
+ }
+ }
+ }
+ mAllowStartFgs = mAllowStartFgsByPermission = ret;
+ }
+
+ boolean isAllowedStartFgsState() {
+ return mAllowStartFgsState <= PROCESS_STATE_BOUND_FOREGROUND_SERVICE;
+ }
+
+ void setAllowStartFgs() {
+ if (mAllowStartFgs) {
+ return;
+ }
+ if (!mAllowStartFgs) {
+ mAllowStartFgs = isAllowedStartFgsState();
+ }
+
+ if (!mAllowStartFgs) {
+ // Is the calling UID a device owner app?
+ if (mService.mInternal != null) {
+ mAllowStartFgs = mService.mInternal.isDeviceOwner(info.uid);
+ }
+ }
+
+ if (!mAllowStartFgs) {
+ // uid is on DeviceIdleController's user/system allowlist
+ // or AMS's FgsStartTempAllowList.
+ mAllowStartFgs = mService.isWhitelistedForFgsStartLocked(info.uid);
+ }
+ }
+
/** A controller to generate error dialogs in {@link ProcessRecord} */
class ErrorDialogController {
/** dialogs being displayed due to crash */
diff --git a/services/core/java/com/android/server/appop/AppOpsService.java b/services/core/java/com/android/server/appop/AppOpsService.java
index d4e2d27ca7a1..4da78252bccb 100644
--- a/services/core/java/com/android/server/appop/AppOpsService.java
+++ b/services/core/java/com/android/server/appop/AppOpsService.java
@@ -3090,7 +3090,7 @@ public class AppOpsService extends IAppOpsService.Stub {
final Ops ops = getOpsLocked(uid, packageName, attributionTag, bypass,
true /* edit */);
if (ops == null) {
- scheduleOpNotedIfNeededLocked(code, uid, packageName,
+ scheduleOpNotedIfNeededLocked(code, uid, packageName, flags,
AppOpsManager.MODE_IGNORED);
if (DEBUG) Slog.d(TAG, "noteOperation: no op for code " + code + " uid " + uid
+ " package " + packageName);
@@ -3098,7 +3098,7 @@ public class AppOpsService extends IAppOpsService.Stub {
}
final Op op = getOpLocked(ops, code, uid, true);
if (isOpRestrictedLocked(uid, code, packageName, bypass)) {
- scheduleOpNotedIfNeededLocked(code, uid, packageName,
+ scheduleOpNotedIfNeededLocked(code, uid, packageName, flags,
AppOpsManager.MODE_IGNORED);
return AppOpsManager.MODE_IGNORED;
}
@@ -3120,7 +3120,7 @@ public class AppOpsService extends IAppOpsService.Stub {
+ switchCode + " (" + code + ") uid " + uid + " package "
+ packageName);
attributedOp.rejected(uidState.state, flags);
- scheduleOpNotedIfNeededLocked(code, uid, packageName, uidMode);
+ scheduleOpNotedIfNeededLocked(code, uid, packageName, flags, uidMode);
return uidMode;
}
} else {
@@ -3132,7 +3132,7 @@ public class AppOpsService extends IAppOpsService.Stub {
+ switchCode + " (" + code + ") uid " + uid + " package "
+ packageName);
attributedOp.rejected(uidState.state, flags);
- scheduleOpNotedIfNeededLocked(code, uid, packageName, mode);
+ scheduleOpNotedIfNeededLocked(code, uid, packageName, flags, mode);
return mode;
}
}
@@ -3142,7 +3142,8 @@ public class AppOpsService extends IAppOpsService.Stub {
+ packageName + (attributionTag == null ? ""
: "." + attributionTag));
}
- scheduleOpNotedIfNeededLocked(code, uid, packageName, AppOpsManager.MODE_ALLOWED);
+ scheduleOpNotedIfNeededLocked(code, uid, packageName, flags,
+ AppOpsManager.MODE_ALLOWED);
attributedOp.accessed(proxyUid, proxyPackageName, proxyAttributionTag, uidState.state,
flags);
@@ -3545,7 +3546,7 @@ public class AppOpsService extends IAppOpsService.Stub {
if (ops == null) {
if (!dryRun) {
scheduleOpStartedIfNeededLocked(code, uid, packageName,
- AppOpsManager.MODE_IGNORED);
+ flags, AppOpsManager.MODE_IGNORED);
}
if (DEBUG) Slog.d(TAG, "startOperation: no op for code " + code + " uid " + uid
+ " package " + packageName);
@@ -3555,7 +3556,7 @@ public class AppOpsService extends IAppOpsService.Stub {
if (isOpRestrictedLocked(uid, code, packageName, bypass)) {
if (!dryRun) {
scheduleOpStartedIfNeededLocked(code, uid, packageName,
- AppOpsManager.MODE_IGNORED);
+ flags, AppOpsManager.MODE_IGNORED);
}
return AppOpsManager.MODE_IGNORED;
}
@@ -3575,7 +3576,7 @@ public class AppOpsService extends IAppOpsService.Stub {
}
if (!dryRun) {
attributedOp.rejected(uidState.state, flags);
- scheduleOpStartedIfNeededLocked(code, uid, packageName, uidMode);
+ scheduleOpStartedIfNeededLocked(code, uid, packageName, flags, uidMode);
}
return uidMode;
}
@@ -3590,7 +3591,7 @@ public class AppOpsService extends IAppOpsService.Stub {
+ packageName);
if (!dryRun) {
attributedOp.rejected(uidState.state, flags);
- scheduleOpStartedIfNeededLocked(code, uid, packageName, mode);
+ scheduleOpStartedIfNeededLocked(code, uid, packageName, flags, mode);
}
return mode;
}
@@ -3598,7 +3599,8 @@ public class AppOpsService extends IAppOpsService.Stub {
if (DEBUG) Slog.d(TAG, "startOperation: allowing code " + code + " uid " + uid
+ " package " + packageName);
if (!dryRun) {
- scheduleOpStartedIfNeededLocked(code, uid, packageName, AppOpsManager.MODE_ALLOWED);
+ scheduleOpStartedIfNeededLocked(code, uid, packageName, flags,
+ AppOpsManager.MODE_ALLOWED);
try {
attributedOp.started(clientId, proxyUid, proxyPackageName, proxyAttributionTag,
uidState.state, flags);
@@ -3736,7 +3738,8 @@ public class AppOpsService extends IAppOpsService.Stub {
}
}
- private void scheduleOpStartedIfNeededLocked(int code, int uid, String pkgName, int result) {
+ private void scheduleOpStartedIfNeededLocked(int code, int uid, String pkgName,
+ @OpFlags int flags, @Mode int result) {
ArraySet<StartedCallback> dispatchedCallbacks = null;
final int callbackListCount = mStartedWatchers.size();
for (int i = 0; i < callbackListCount; i++) {
@@ -3761,18 +3764,18 @@ public class AppOpsService extends IAppOpsService.Stub {
mHandler.sendMessage(PooledLambda.obtainMessage(
AppOpsService::notifyOpStarted,
- this, dispatchedCallbacks, code, uid, pkgName, result));
+ this, dispatchedCallbacks, code, uid, pkgName, flags, result));
}
private void notifyOpStarted(ArraySet<StartedCallback> callbacks,
- int code, int uid, String packageName, int result) {
+ int code, int uid, String packageName, @OpFlags int flags, @Mode int result) {
final long identity = Binder.clearCallingIdentity();
try {
final int callbackCount = callbacks.size();
for (int i = 0; i < callbackCount; i++) {
final StartedCallback callback = callbacks.valueAt(i);
try {
- callback.mCallback.opStarted(code, uid, packageName, result);
+ callback.mCallback.opStarted(code, uid, packageName, flags, result);
} catch (RemoteException e) {
/* do nothing */
}
@@ -3783,7 +3786,7 @@ public class AppOpsService extends IAppOpsService.Stub {
}
private void scheduleOpNotedIfNeededLocked(int code, int uid, String packageName,
- int result) {
+ @OpFlags int flags, @Mode int result) {
ArraySet<NotedCallback> dispatchedCallbacks = null;
final int callbackListCount = mNotedWatchers.size();
for (int i = 0; i < callbackListCount; i++) {
@@ -3804,11 +3807,11 @@ public class AppOpsService extends IAppOpsService.Stub {
}
mHandler.sendMessage(PooledLambda.obtainMessage(
AppOpsService::notifyOpChecked,
- this, dispatchedCallbacks, code, uid, packageName, result));
+ this, dispatchedCallbacks, code, uid, packageName, flags, result));
}
private void notifyOpChecked(ArraySet<NotedCallback> callbacks,
- int code, int uid, String packageName, int result) {
+ int code, int uid, String packageName, @OpFlags int flags, @Mode int result) {
// There are features watching for checks in our process. The callbacks in
// these features may require permissions our remote caller does not have.
final long identity = Binder.clearCallingIdentity();
@@ -3817,7 +3820,7 @@ public class AppOpsService extends IAppOpsService.Stub {
for (int i = 0; i < callbackCount; i++) {
final NotedCallback callback = callbacks.valueAt(i);
try {
- callback.mCallback.opNoted(code, uid, packageName, result);
+ callback.mCallback.opNoted(code, uid, packageName, flags, result);
} catch (RemoteException e) {
/* do nothing */
}
diff --git a/services/core/java/com/android/server/connectivity/NetworkAgentInfo.java b/services/core/java/com/android/server/connectivity/NetworkAgentInfo.java
index ccd1f3bb16f6..52b9f5c15c50 100644
--- a/services/core/java/com/android/server/connectivity/NetworkAgentInfo.java
+++ b/services/core/java/com/android/server/connectivity/NetworkAgentInfo.java
@@ -138,9 +138,10 @@ public class NetworkAgentInfo implements Comparable<NetworkAgentInfo> {
// not guaranteed to be current or correct, or even to exist.
public @Nullable Network[] declaredUnderlyingNetworks;
- // Whether this network is always metered even if its underlying networks are unmetered.
- // Only relevant if #supportsUnderlyingNetworks is true.
- public boolean declaredMetered;
+ // The capabilities originally announced by the NetworkAgent, regardless of any capabilities
+ // that were added or removed due to this network's underlying networks.
+ // Only set if #supportsUnderlyingNetworks is true.
+ public @Nullable NetworkCapabilities declaredCapabilities;
// Indicates if netd has been told to create this Network. From this point on the appropriate
// routing rules are setup and routes are added so packets can begin flowing over the Network.
diff --git a/services/core/java/com/android/server/connectivity/PermissionMonitor.java b/services/core/java/com/android/server/connectivity/PermissionMonitor.java
index 4c63eb488118..d507b5f82bd0 100644
--- a/services/core/java/com/android/server/connectivity/PermissionMonitor.java
+++ b/services/core/java/com/android/server/connectivity/PermissionMonitor.java
@@ -35,7 +35,6 @@ import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
import android.content.pm.PackageManagerInternal;
-import android.content.pm.UserInfo;
import android.net.INetd;
import android.net.UidRange;
import android.os.Build;
@@ -174,11 +173,9 @@ public class PermissionMonitor implements PackageManagerInternal.PackageListObse
netdPermsUids.put(uid, netdPermsUids.get(uid) | otherNetdPerms);
}
- List<UserInfo> users = mUserManager.getAliveUsers();
- if (users != null) {
- for (UserInfo user : users) {
- mUsers.add(user.id);
- }
+ final List<UserHandle> users = mUserManager.getUserHandles(true /* excludeDying */);
+ for (UserHandle user : users) {
+ mUsers.add(user.getIdentifier());
}
final SparseArray<ArraySet<String>> systemPermission =
diff --git a/services/core/java/com/android/server/connectivity/Vpn.java b/services/core/java/com/android/server/connectivity/Vpn.java
index 5cb0994c5cb2..cabfbc02491c 100644
--- a/services/core/java/com/android/server/connectivity/Vpn.java
+++ b/services/core/java/com/android/server/connectivity/Vpn.java
@@ -48,6 +48,7 @@ import android.content.pm.ResolveInfo;
import android.content.pm.UserInfo;
import android.net.ConnectivityManager;
import android.net.DnsResolver;
+import android.net.INetd;
import android.net.INetworkManagementEventObserver;
import android.net.Ikev2VpnProfile;
import android.net.IpPrefix;
@@ -68,6 +69,7 @@ import android.net.NetworkProvider;
import android.net.NetworkRequest;
import android.net.RouteInfo;
import android.net.UidRange;
+import android.net.UidRangeParcel;
import android.net.VpnManager;
import android.net.VpnService;
import android.net.ipsec.ike.ChildSessionCallback;
@@ -188,7 +190,8 @@ public class Vpn {
private PendingIntent mStatusIntent;
private volatile boolean mEnableTeardown = true;
- private final INetworkManagementService mNetd;
+ private final INetworkManagementService mNms;
+ private final INetd mNetd;
@VisibleForTesting
protected VpnConfig mConfig;
private final NetworkProvider mNetworkProvider;
@@ -234,7 +237,7 @@ public class Vpn {
* @see mLockdown
*/
@GuardedBy("this")
- private final Set<UidRange> mBlockedUidsAsToldToNetd = new ArraySet<>();
+ private final Set<UidRangeParcel> mBlockedUidsAsToldToNetd = new ArraySet<>();
// The user id of initiating VPN.
private final int mUserId;
@@ -363,22 +366,23 @@ public class Vpn {
}
}
- public Vpn(Looper looper, Context context, INetworkManagementService netService,
+ public Vpn(Looper looper, Context context, INetworkManagementService netService, INetd netd,
@UserIdInt int userId, @NonNull KeyStore keyStore) {
- this(looper, context, new Dependencies(), netService, userId, keyStore,
+ this(looper, context, new Dependencies(), netService, netd, userId, keyStore,
new SystemServices(context), new Ikev2SessionCreator());
}
@VisibleForTesting
protected Vpn(Looper looper, Context context, Dependencies deps,
- INetworkManagementService netService,
+ INetworkManagementService netService, INetd netd,
int userId, @NonNull KeyStore keyStore, SystemServices systemServices,
Ikev2SessionCreator ikev2SessionCreator) {
mContext = context;
mConnectivityManager = mContext.getSystemService(ConnectivityManager.class);
mUserIdContext = context.createContextAsUser(UserHandle.of(userId), 0 /* flags */);
mDeps = deps;
- mNetd = netService;
+ mNms = netService;
+ mNetd = netd;
mUserId = userId;
mLooper = looper;
mSystemServices = systemServices;
@@ -912,7 +916,7 @@ public class Vpn {
}
try {
- mNetd.denyProtect(mOwnerUID);
+ mNms.denyProtect(mOwnerUID);
} catch (Exception e) {
Log.wtf(TAG, "Failed to disallow UID " + mOwnerUID + " to call protect() " + e);
}
@@ -922,7 +926,7 @@ public class Vpn {
mOwnerUID = getAppUid(newPackage, mUserId);
mIsPackageTargetingAtLeastQ = doesPackageTargetAtLeastQ(newPackage);
try {
- mNetd.allowProtect(mOwnerUID);
+ mNms.allowProtect(mOwnerUID);
} catch (Exception e) {
Log.wtf(TAG, "Failed to allow UID " + mOwnerUID + " to call protect() " + e);
}
@@ -1253,7 +1257,7 @@ public class Vpn {
final PackageManager packageManager = mUserIdContext.getPackageManager();
if (packageManager == null) {
- throw new UnsupportedOperationException("Cannot get PackageManager.");
+ throw new IllegalStateException("Cannot get PackageManager.");
}
final ResolveInfo info = packageManager.resolveService(intent, 0 /* flags */);
if (info == null) {
@@ -1579,24 +1583,25 @@ public class Vpn {
exemptedPackages = new ArrayList<>(mLockdownAllowlist);
exemptedPackages.add(mPackage);
}
- final Set<UidRange> rangesToTellNetdToRemove = new ArraySet<>(mBlockedUidsAsToldToNetd);
+ final Set<UidRangeParcel> rangesToTellNetdToRemove =
+ new ArraySet<>(mBlockedUidsAsToldToNetd);
- final Set<UidRange> rangesToTellNetdToAdd;
+ final Set<UidRangeParcel> rangesToTellNetdToAdd;
if (enforce) {
- final Set<UidRange> rangesThatShouldBeBlocked =
+ final Set<UidRange> restrictedProfilesRanges =
createUserAndRestrictedProfilesRanges(mUserId,
- /* allowedApplications */ null,
- /* disallowedApplications */ exemptedPackages);
+ /* allowedApplications */ null,
+ /* disallowedApplications */ exemptedPackages);
+ final Set<UidRangeParcel> rangesThatShouldBeBlocked = new ArraySet<>();
// The UID range of the first user (0-99999) would block the IPSec traffic, which comes
// directly from the kernel and is marked as uid=0. So we adjust the range to allow
// it through (b/69873852).
- for (UidRange range : rangesThatShouldBeBlocked) {
- if (range.start == 0) {
- rangesThatShouldBeBlocked.remove(range);
- if (range.stop != 0) {
- rangesThatShouldBeBlocked.add(new UidRange(1, range.stop));
- }
+ for (UidRange range : restrictedProfilesRanges) {
+ if (range.start == 0 && range.stop != 0) {
+ rangesThatShouldBeBlocked.add(new UidRangeParcel(1, range.stop));
+ } else if (range.start != 0) {
+ rangesThatShouldBeBlocked.add(new UidRangeParcel(range.start, range.stop));
}
}
@@ -1628,13 +1633,13 @@ public class Vpn {
* including added ranges that already existed or removed ones that didn't.
*/
@GuardedBy("this")
- private boolean setAllowOnlyVpnForUids(boolean enforce, Collection<UidRange> ranges) {
+ private boolean setAllowOnlyVpnForUids(boolean enforce, Collection<UidRangeParcel> ranges) {
if (ranges.size() == 0) {
return true;
}
- final UidRange[] rangesArray = ranges.toArray(new UidRange[ranges.size()]);
+ final UidRangeParcel[] stableRanges = ranges.toArray(new UidRangeParcel[ranges.size()]);
try {
- mNetd.setAllowOnlyVpnForUids(enforce, rangesArray);
+ mNetd.networkRejectNonSecureVpn(enforce, stableRanges);
} catch (RemoteException | RuntimeException e) {
Log.e(TAG, "Updating blocked=" + enforce
+ " for UIDs " + Arrays.toString(ranges.toArray()) + " failed", e);
@@ -1849,10 +1854,20 @@ public class Vpn {
if (mNetworkInfo.isConnected()) {
return !appliesToUid(uid);
} else {
- return UidRange.containsUid(mBlockedUidsAsToldToNetd, uid);
+ return containsUid(mBlockedUidsAsToldToNetd, uid);
}
}
+ private boolean containsUid(Collection<UidRangeParcel> ranges, int uid) {
+ if (ranges == null) return false;
+ for (UidRangeParcel range : ranges) {
+ if (range.start <= uid && uid <= range.stop) {
+ return true;
+ }
+ }
+ return false;
+ }
+
private void updateAlwaysOnNotification(DetailedState networkState) {
final boolean visible = (mAlwaysOn && networkState != DetailedState.CONNECTED);
@@ -2495,7 +2510,7 @@ public class Vpn {
address /* unused */,
address /* unused */,
network);
- mNetd.setInterfaceUp(mTunnelIface.getInterfaceName());
+ mNms.setInterfaceUp(mTunnelIface.getInterfaceName());
mSession = mIkev2SessionCreator.createIkeSession(
mContext,
diff --git a/services/core/java/com/android/server/display/DisplayManagerService.java b/services/core/java/com/android/server/display/DisplayManagerService.java
index d4a19d6bc366..2c7cd5bce514 100644
--- a/services/core/java/com/android/server/display/DisplayManagerService.java
+++ b/services/core/java/com/android/server/display/DisplayManagerService.java
@@ -403,7 +403,7 @@ public final class DisplayManagerService extends SystemService {
mUiHandler = UiThread.getHandler();
mDisplayDeviceRepo = new DisplayDeviceRepository(mSyncRoot, mPersistentDataStore);
mLogicalDisplayMapper = new LogicalDisplayMapper(context, mDisplayDeviceRepo,
- new LogicalDisplayListener(), mPersistentDataStore);
+ new LogicalDisplayListener());
mDisplayModeDirector = new DisplayModeDirector(context, mHandler);
Resources resources = mContext.getResources();
mDefaultDisplayDefaultColorMode = mContext.getResources().getInteger(
diff --git a/services/core/java/com/android/server/display/LocalDisplayAdapter.java b/services/core/java/com/android/server/display/LocalDisplayAdapter.java
index 74ea2d7114fc..155b246a1408 100644
--- a/services/core/java/com/android/server/display/LocalDisplayAdapter.java
+++ b/services/core/java/com/android/server/display/LocalDisplayAdapter.java
@@ -177,10 +177,10 @@ final class LocalDisplayAdapter extends DisplayAdapter {
private final class LocalDisplayDevice extends DisplayDevice {
private final long mPhysicalDisplayId;
- private final LogicalLight mBacklight;
private final SparseArray<DisplayModeRecord> mSupportedModes = new SparseArray<>();
private final ArrayList<Integer> mSupportedColorModes = new ArrayList<>();
private final boolean mIsDefaultDisplay;
+ private final BacklightAdapter mBacklightAdapter;
private DisplayDeviceInfo mInfo;
private boolean mHavePendingChanges;
@@ -205,7 +205,6 @@ final class LocalDisplayAdapter extends DisplayAdapter {
private SurfaceControl.DisplayConfig[] mDisplayConfigs;
private Spline mSystemBrightnessToNits;
private Spline mNitsToHalBrightness;
-
private DisplayDeviceConfig mDisplayDeviceConfig;
private DisplayEventReceiver.FrameRateOverride[] mFrameRateOverrides =
@@ -222,12 +221,7 @@ final class LocalDisplayAdapter extends DisplayAdapter {
updateDisplayPropertiesLocked(info, configs, activeConfigId, configSpecs, colorModes,
activeColorMode, hdrCapabilities);
mSidekickInternal = LocalServices.getService(SidekickInternal.class);
- if (mIsDefaultDisplay) {
- LightsManager lights = LocalServices.getService(LightsManager.class);
- mBacklight = lights.getLight(LightsManager.LIGHT_ID_BACKLIGHT);
- } else {
- mBacklight = null;
- }
+ mBacklightAdapter = new BacklightAdapter(displayToken, isDefaultDisplay);
mAllmSupported = SurfaceControl.getAutoLowLatencyModeSupport(displayToken);
mGameContentTypeSupported = SurfaceControl.getGameContentTypeSupport(displayToken);
mDisplayDeviceConfig = null;
@@ -643,8 +637,7 @@ final class LocalDisplayAdapter extends DisplayAdapter {
brightnessState, PowerManager.BRIGHTNESS_OFF_FLOAT);
final boolean stateChanged = (mState != state);
final boolean brightnessChanged = (!BrightnessSynchronizer.floatEquals(
- mBrightnessState, brightnessState))
- && mBacklight != null;
+ mBrightnessState, brightnessState));
if (stateChanged || brightnessChanged) {
final long physicalDisplayId = mPhysicalDisplayId;
final IBinder token = getDisplayTokenLocked();
@@ -712,9 +705,7 @@ final class LocalDisplayAdapter extends DisplayAdapter {
+ "id=" + physicalDisplayId
+ ", state=" + Display.stateToString(state) + ")");
}
- if (mBacklight != null) {
- mBacklight.setVrMode(isVrEnabled);
- }
+ mBacklightAdapter.setVrMode(isVrEnabled);
}
private void setDisplayState(int state) {
@@ -770,13 +761,8 @@ final class LocalDisplayAdapter extends DisplayAdapter {
Trace.traceBegin(Trace.TRACE_TAG_POWER, "setDisplayBrightness("
+ "id=" + physicalDisplayId + ", brightness=" + brightness + ")");
try {
- if (isHalBrightnessRangeSpecified()) {
- brightness = displayBrightnessToHalBrightness(
- BrightnessSynchronizer.brightnessFloatToIntRange(brightness));
- }
- if (mBacklight != null) {
- mBacklight.setBrightness(brightness);
- }
+ brightness = displayBrightnessToHalBrightness(brightness);
+ mBacklightAdapter.setBrightness(brightness);
Trace.traceCounter(Trace.TRACE_TAG_POWER,
"ScreenBrightness",
BrightnessSynchronizer.brightnessFloatToInt(brightness));
@@ -785,26 +771,33 @@ final class LocalDisplayAdapter extends DisplayAdapter {
}
}
- private boolean isHalBrightnessRangeSpecified() {
- return !(mSystemBrightnessToNits == null || mNitsToHalBrightness == null);
- }
-
/**
* Converts brightness range from the framework's brightness space to the
* Hal brightness space if the HAL brightness space has been provided via
* a display device configuration file.
*/
private float displayBrightnessToHalBrightness(float brightness) {
- if (!isHalBrightnessRangeSpecified()) {
- return PowerManager.BRIGHTNESS_INVALID_FLOAT;
+ // TODO: b/171380847 - This needs to be deprecated. The nits-to-brightness
+ // relationship should be specified in display-config OR config.xml, but not
+ // both, and no nits-space conversion should be necessary.
+ //
+ // Only do a conversion if there exists a unique system brightness and a
+ // unique HAL brightness-to-nits range defined.
+ if (mSystemBrightnessToNits == null || mNitsToHalBrightness == null) {
+ return brightness;
}
+ // Sys brightness in this conversion is always specified in the old 1-255
+ // range, so convert that here before the translation.
+ final float brightnessInt =
+ BrightnessSynchronizer.brightnessFloatToIntRange(brightness);
+
if (BrightnessSynchronizer.floatEquals(
- brightness, PowerManager.BRIGHTNESS_OFF)) {
+ brightnessInt, PowerManager.BRIGHTNESS_OFF)) {
return PowerManager.BRIGHTNESS_OFF_FLOAT;
}
- final float nits = mSystemBrightnessToNits.interpolate(brightness);
+ final float nits = mSystemBrightnessToNits.interpolate(brightnessInt);
final float halBrightness = mNitsToHalBrightness.interpolate(nits);
return halBrightness;
}
@@ -988,7 +981,7 @@ final class LocalDisplayAdapter extends DisplayAdapter {
pw.println("mDefaultModeId=" + mDefaultModeId);
pw.println("mState=" + Display.stateToString(mState));
pw.println("mBrightnessState=" + mBrightnessState);
- pw.println("mBacklight=" + mBacklight);
+ pw.println("mBacklightAdapter=" + mBacklightAdapter);
pw.println("mAllmSupported=" + mAllmSupported);
pw.println("mAllmRequested=" + mAllmRequested);
pw.println("mGameContentTypeSupported=" + mGameContentTypeSupported);
@@ -1209,4 +1202,44 @@ final class LocalDisplayAdapter extends DisplayAdapter {
}
}
}
+
+ static class BacklightAdapter {
+ private final IBinder mDisplayToken;
+ private final LogicalLight mBacklight;
+ private final boolean mUseSurfaceControlBrightness;
+
+ BacklightAdapter(IBinder displayToken, boolean isDefaultDisplay) {
+ mDisplayToken = displayToken;
+
+ mUseSurfaceControlBrightness =
+ SurfaceControl.getDisplayBrightnessSupport(mDisplayToken);
+
+ if (!mUseSurfaceControlBrightness && isDefaultDisplay) {
+ LightsManager lights = LocalServices.getService(LightsManager.class);
+ mBacklight = lights.getLight(LightsManager.LIGHT_ID_BACKLIGHT);
+ } else {
+ mBacklight = null;
+ }
+ }
+
+ public void setBrightness(float brightness) {
+ if (mUseSurfaceControlBrightness) {
+ SurfaceControl.setDisplayBrightness(mDisplayToken, brightness);
+ } else if (mBacklight != null) {
+ mBacklight.setBrightness(brightness);
+ }
+ }
+
+ public void setVrMode(boolean isVrModeEnabled) {
+ if (mBacklight != null) {
+ mBacklight.setVrMode(isVrModeEnabled);
+ }
+ }
+
+ @Override
+ public String toString() {
+ return "BacklightAdapter [useSurfaceControl=" + mUseSurfaceControlBrightness
+ + ", backlight=" + mBacklight + "]";
+ }
+ }
}
diff --git a/services/core/java/com/android/server/display/LogicalDisplayMapper.java b/services/core/java/com/android/server/display/LogicalDisplayMapper.java
index cdcbb4f123a1..a12785889bd3 100644
--- a/services/core/java/com/android/server/display/LogicalDisplayMapper.java
+++ b/services/core/java/com/android/server/display/LogicalDisplayMapper.java
@@ -20,13 +20,13 @@ import android.content.Context;
import android.os.Process;
import android.os.SystemProperties;
import android.text.TextUtils;
+import android.util.IndentingPrintWriter;
import android.util.Slog;
import android.util.SparseArray;
import android.view.Display;
import android.view.DisplayEventReceiver;
import android.view.DisplayInfo;
-import com.android.internal.util.IndentingPrintWriter;
import java.io.PrintWriter;
import java.util.Arrays;
@@ -102,13 +102,10 @@ class LogicalDisplayMapper implements DisplayDeviceRepository.Listener {
private final SparseArray<DisplayGroup> mDisplayGroups = new SparseArray<>();
private final DisplayDeviceRepository mDisplayDeviceRepo;
- private final PersistentDataStore mPersistentDataStore;
private final Listener mListener;
- LogicalDisplayMapper(Context context, DisplayDeviceRepository repo, Listener listener,
- PersistentDataStore persistentDataStore) {
+ LogicalDisplayMapper(Context context, DisplayDeviceRepository repo, Listener listener) {
mDisplayDeviceRepo = repo;
- mPersistentDataStore = persistentDataStore;
mListener = listener;
mSingleDisplayDemoMode = SystemProperties.getBoolean("persist.demo.singledisplay", false);
mDisplayDeviceRepo.addListener(this);
@@ -238,7 +235,7 @@ class LogicalDisplayMapper implements DisplayDeviceRepository.Listener {
// Find the associated LogicalDisplays for the configured "folding" DeviceDisplays.
final LogicalDisplay displayFolded = getLocked(deviceFolded);
final LogicalDisplay displayUnfolded = getLocked(deviceUnfolded);
- if (displayFolded == null || displayFolded == null) {
+ if (displayFolded == null || displayUnfolded == null) {
// If the expected displays are not present, return early.
return;
}
diff --git a/services/core/java/com/android/server/dreams/OWNERS b/services/core/java/com/android/server/dreams/OWNERS
index 3c9bbf8797ea..426f002ad236 100644
--- a/services/core/java/com/android/server/dreams/OWNERS
+++ b/services/core/java/com/android/server/dreams/OWNERS
@@ -1,3 +1,3 @@
-dsandler@google.com
+dsandler@android.com
michaelwr@google.com
roosa@google.com
diff --git a/services/core/java/com/android/server/hdmi/HdmiCecLocalDevice.java b/services/core/java/com/android/server/hdmi/HdmiCecLocalDevice.java
index 0e196f278ddf..52121f352783 100755
--- a/services/core/java/com/android/server/hdmi/HdmiCecLocalDevice.java
+++ b/services/core/java/com/android/server/hdmi/HdmiCecLocalDevice.java
@@ -623,6 +623,14 @@ abstract class HdmiCecLocalDevice {
return false;
}
+ if (isPowerOffOrToggleCommand(message) || isPowerOnOrToggleCommand(message)) {
+ // Power commands should already be handled above. Don't continue and convert the CEC
+ // keycode to Android keycode.
+ // Do not <Feature Abort> as the local device should already be in the correct power
+ // state.
+ return true;
+ }
+
final long downTime = SystemClock.uptimeMillis();
final byte[] params = message.getParams();
final int keycode = HdmiCecKeycode.cecKeycodeAndParamsToAndroidKey(params);
diff --git a/services/core/java/com/android/server/lights/LightsService.java b/services/core/java/com/android/server/lights/LightsService.java
index d624019bfec8..43c965dde27b 100644
--- a/services/core/java/com/android/server/lights/LightsService.java
+++ b/services/core/java/com/android/server/lights/LightsService.java
@@ -29,14 +29,12 @@ import android.os.Binder;
import android.os.Handler;
import android.os.IBinder;
import android.os.Looper;
-import android.os.PowerManager;
import android.os.RemoteException;
import android.os.ServiceManager;
import android.os.Trace;
import android.provider.Settings;
import android.util.Slog;
import android.util.SparseArray;
-import android.view.SurfaceControl;
import com.android.internal.BrightnessSynchronizer;
import com.android.internal.annotations.GuardedBy;
@@ -262,25 +260,9 @@ public class LightsService extends SystemService {
}
private final class LightImpl extends LogicalLight {
- private final IBinder mDisplayToken;
- private final int mSurfaceControlMaximumBrightness;
private LightImpl(Context context, HwLight hwLight) {
mHwLight = hwLight;
- mDisplayToken = SurfaceControl.getInternalDisplayToken();
- final boolean brightnessSupport = SurfaceControl.getDisplayBrightnessSupport(
- mDisplayToken);
- if (DEBUG) {
- Slog.d(TAG, "Display brightness support: " + brightnessSupport);
- }
- int maximumBrightness = 0;
- if (brightnessSupport) {
- PowerManager pm = context.getSystemService(PowerManager.class);
- if (pm != null) {
- maximumBrightness = pm.getMaximumScreenBrightnessSetting();
- }
- }
- mSurfaceControlMaximumBrightness = maximumBrightness;
}
@Override
@@ -301,28 +283,10 @@ public class LightsService extends SystemService {
+ ": brightness=" + brightness);
return;
}
- // Ideally, we'd like to set the brightness mode through the SF/HWC as well, but
- // right now we just fall back to the old path through Lights brightessMode is
- // anything but USER or the device shouldBeInLowPersistenceMode().
- if (brightnessMode == BRIGHTNESS_MODE_USER && !shouldBeInLowPersistenceMode()
- && mSurfaceControlMaximumBrightness == 255) {
- // New system
- // TODO: the last check should be mSurfaceControlMaximumBrightness != 0; the
- // reason we enforce 255 right now is to stay consistent with the old path. In
- // the future, the framework should be refactored so that brightness is a float
- // between 0.0f and 1.0f, and the actual number of supported brightness levels
- // is determined in the device-specific implementation.
- if (DEBUG) {
- Slog.d(TAG, "Using new setBrightness path!");
- }
- SurfaceControl.setDisplayBrightness(mDisplayToken, brightness);
- } else {
- // Old system
- int brightnessInt = BrightnessSynchronizer.brightnessFloatToInt(brightness);
- int color = brightnessInt & 0x000000ff;
- color = 0xff000000 | (color << 16) | (color << 8) | color;
- setLightLocked(color, LIGHT_FLASH_NONE, 0, 0, brightnessMode);
- }
+ int brightnessInt = BrightnessSynchronizer.brightnessFloatToInt(brightness);
+ int color = brightnessInt & 0x000000ff;
+ color = 0xff000000 | (color << 16) | (color << 8) | color;
+ setLightLocked(color, LIGHT_FLASH_NONE, 0, 0, brightnessMode);
}
}
diff --git a/services/core/java/com/android/server/location/LocationManagerService.java b/services/core/java/com/android/server/location/LocationManagerService.java
index 3854f8c8ff76..324332f1e134 100644
--- a/services/core/java/com/android/server/location/LocationManagerService.java
+++ b/services/core/java/com/android/server/location/LocationManagerService.java
@@ -519,9 +519,6 @@ public class LocationManagerService extends ILocationManager.Stub {
public List<String> getAllProviders() {
ArrayList<String> providers = new ArrayList<>(mProviderManagers.size());
for (LocationProviderManager manager : mProviderManagers) {
- if (FUSED_PROVIDER.equals(manager.getName())) {
- continue;
- }
providers.add(manager.getName());
}
return providers;
@@ -538,9 +535,6 @@ public class LocationManagerService extends ILocationManager.Stub {
ArrayList<String> providers = new ArrayList<>(mProviderManagers.size());
for (LocationProviderManager manager : mProviderManagers) {
String name = manager.getName();
- if (FUSED_PROVIDER.equals(name)) {
- continue;
- }
if (enabledOnly && !manager.isEnabled(UserHandle.getCallingUserId())) {
continue;
}
@@ -565,7 +559,9 @@ public class LocationManagerService extends ILocationManager.Stub {
}
if (!providers.isEmpty()) {
- if (providers.contains(GPS_PROVIDER)) {
+ if (providers.contains(FUSED_PROVIDER)) {
+ return FUSED_PROVIDER;
+ } else if (providers.contains(GPS_PROVIDER)) {
return GPS_PROVIDER;
} else if (providers.contains(NETWORK_PROVIDER)) {
return NETWORK_PROVIDER;
@@ -1046,10 +1042,6 @@ public class LocationManagerService extends ILocationManager.Stub {
@Override
public boolean isProviderEnabledForUser(String provider, int userId) {
- // fused provider is accessed indirectly via criteria rather than the provider-based APIs,
- // so we discourage its use
- if (FUSED_PROVIDER.equals(provider)) return false;
-
return mLocalService.isProviderEnabledForUser(provider, userId);
}
diff --git a/services/core/java/com/android/server/location/OWNERS b/services/core/java/com/android/server/location/OWNERS
index c2c95e6042de..696a0c22c605 100644
--- a/services/core/java/com/android/server/location/OWNERS
+++ b/services/core/java/com/android/server/location/OWNERS
@@ -1,8 +1 @@
-aadmal@google.com
-arthuri@google.com
-bduddie@google.com
-gomo@google.com
-sooniln@google.com
-weiwa@google.com
-wyattriley@google.com
-yuhany@google.com
+file:/location/java/android/location/OWNERS
diff --git a/services/core/java/com/android/server/location/contexthub/OWNERS b/services/core/java/com/android/server/location/contexthub/OWNERS
new file mode 100644
index 000000000000..d4393d6a83d2
--- /dev/null
+++ b/services/core/java/com/android/server/location/contexthub/OWNERS
@@ -0,0 +1,2 @@
+arthuri@google.com
+bduddie@google.com
diff --git a/services/core/java/com/android/server/media/BluetoothRouteProvider.java b/services/core/java/com/android/server/media/BluetoothRouteProvider.java
index 0b3cdae9231e..7afa81aa047d 100644
--- a/services/core/java/com/android/server/media/BluetoothRouteProvider.java
+++ b/services/core/java/com/android/server/media/BluetoothRouteProvider.java
@@ -165,11 +165,13 @@ class BluetoothRouteProvider {
private void buildBluetoothRoutes() {
mBluetoothRoutes.clear();
- for (BluetoothDevice device : mBluetoothAdapter.getBondedDevices()) {
- if (device.isConnected()) {
- BluetoothRouteInfo newBtRoute = createBluetoothRoute(device);
- if (newBtRoute.connectedProfiles.size() > 0) {
- mBluetoothRoutes.put(device.getAddress(), newBtRoute);
+ if (mBluetoothAdapter.getBondedDevices() != null) {
+ for (BluetoothDevice device : mBluetoothAdapter.getBondedDevices()) {
+ if (device.isConnected()) {
+ BluetoothRouteInfo newBtRoute = createBluetoothRoute(device);
+ if (newBtRoute.connectedProfiles.size() > 0) {
+ mBluetoothRoutes.put(device.getAddress(), newBtRoute);
+ }
}
}
}
diff --git a/services/core/java/com/android/server/media/MediaRoute2Provider.java b/services/core/java/com/android/server/media/MediaRoute2Provider.java
index f882c57e49ba..edc9d7c64146 100644
--- a/services/core/java/com/android/server/media/MediaRoute2Provider.java
+++ b/services/core/java/com/android/server/media/MediaRoute2Provider.java
@@ -77,7 +77,7 @@ abstract class MediaRoute2Provider {
@NonNull
public List<RoutingSessionInfo> getSessionInfos() {
synchronized (mLock) {
- return mSessionInfos;
+ return new ArrayList<>(mSessionInfos);
}
}
diff --git a/services/core/java/com/android/server/media/MediaRoute2ProviderServiceProxy.java b/services/core/java/com/android/server/media/MediaRoute2ProviderServiceProxy.java
index 85af346aa88a..ab38dca2387d 100644
--- a/services/core/java/com/android/server/media/MediaRoute2ProviderServiceProxy.java
+++ b/services/core/java/com/android/server/media/MediaRoute2ProviderServiceProxy.java
@@ -108,8 +108,8 @@ final class MediaRoute2ProviderServiceProxy extends MediaRoute2Provider
mLastDiscoveryPreference = discoveryPreference;
if (mConnectionReady) {
mActiveConnection.updateDiscoveryPreference(discoveryPreference);
- updateBinding();
}
+ updateBinding();
}
@Override
@@ -205,9 +205,11 @@ final class MediaRoute2ProviderServiceProxy extends MediaRoute2Provider
}
private boolean shouldBind() {
- //TODO: Binding could be delayed until it's necessary.
if (mRunning) {
- return true;
+ // Bind when there is a discovery preference or an active route session.
+ return (mLastDiscoveryPreference != null
+ && !mLastDiscoveryPreference.getPreferredFeatures().isEmpty())
+ || !getSessionInfos().isEmpty();
}
return false;
}
diff --git a/services/core/java/com/android/server/media/MediaRouter2ServiceImpl.java b/services/core/java/com/android/server/media/MediaRouter2ServiceImpl.java
index 1114fe0d9bf8..31edf43679e9 100644
--- a/services/core/java/com/android/server/media/MediaRouter2ServiceImpl.java
+++ b/services/core/java/com/android/server/media/MediaRouter2ServiceImpl.java
@@ -16,6 +16,7 @@
package com.android.server.media;
+import static android.app.ActivityManager.RunningAppProcessInfo.IMPORTANCE_FOREGROUND;
import static android.media.MediaRoute2ProviderService.REASON_UNKNOWN_ERROR;
import static android.media.MediaRouter2Utils.getOriginalId;
import static android.media.MediaRouter2Utils.getProviderId;
@@ -73,10 +74,12 @@ class MediaRouter2ServiceImpl {
// TODO: (In Android S or later) if we add callback methods for generic failures
// in MediaRouter2, remove this constant and replace the usages with the real request IDs.
private static final long DUMMY_REQUEST_ID = -1;
+ private static final int PACKAGE_IMPORTANCE_FOR_DISCOVERY = IMPORTANCE_FOREGROUND;
private final Context mContext;
private final Object mLock = new Object();
final AtomicInteger mNextRouterOrManagerId = new AtomicInteger(1);
+ final ActivityManager mActivityManager;
@GuardedBy("mLock")
private final SparseArray<UserRecord> mUserRecords = new SparseArray<>();
@@ -87,8 +90,21 @@ class MediaRouter2ServiceImpl {
@GuardedBy("mLock")
private int mCurrentUserId = -1;
+ private final ActivityManager.OnUidImportanceListener mOnUidImportanceListener =
+ (uid, importance) -> {
+ synchronized (mLock) {
+ final int count = mUserRecords.size();
+ for (int i = 0; i < count; i++) {
+ mUserRecords.valueAt(i).mHandler.maybeUpdateDiscoveryPreferenceForUid(uid);
+ }
+ }
+ };
+
MediaRouter2ServiceImpl(Context context) {
mContext = context;
+ mActivityManager = mContext.getSystemService(ActivityManager.class);
+ mActivityManager.addOnUidImportanceListener(mOnUidImportanceListener,
+ PACKAGE_IMPORTANCE_FOR_DISCOVERY);
}
////////////////////////////////////////////////////////////////
@@ -388,6 +404,30 @@ class MediaRouter2ServiceImpl {
}
}
+ public void startScan(IMediaRouter2Manager manager) {
+ Objects.requireNonNull(manager, "manager must not be null");
+ final long token = Binder.clearCallingIdentity();
+ try {
+ synchronized (mLock) {
+ startScanLocked(manager);
+ }
+ } finally {
+ Binder.restoreCallingIdentity(token);
+ }
+ }
+
+ public void stopScan(IMediaRouter2Manager manager) {
+ Objects.requireNonNull(manager, "manager must not be null");
+ final long token = Binder.clearCallingIdentity();
+ try {
+ synchronized (mLock) {
+ stopScanLocked(manager);
+ }
+ } finally {
+ Binder.restoreCallingIdentity(token);
+ }
+ }
+
public void setRouteVolumeWithManager(IMediaRouter2Manager manager, int requestId,
MediaRoute2Info route, int volume) {
Objects.requireNonNull(manager, "manager must not be null");
@@ -839,6 +879,24 @@ class MediaRouter2ServiceImpl {
disposeUserIfNeededLocked(userRecord); // since manager removed from user
}
+ private void startScanLocked(@NonNull IMediaRouter2Manager manager) {
+ final IBinder binder = manager.asBinder();
+ ManagerRecord managerRecord = mAllManagerRecords.get(binder);
+ if (managerRecord == null) {
+ return;
+ }
+ managerRecord.startScan();
+ }
+
+ private void stopScanLocked(@NonNull IMediaRouter2Manager manager) {
+ final IBinder binder = manager.asBinder();
+ ManagerRecord managerRecord = mAllManagerRecords.get(binder);
+ if (managerRecord == null) {
+ return;
+ }
+ managerRecord.stopScan();
+ }
+
private void setRouteVolumeWithManagerLocked(int requestId,
@NonNull IMediaRouter2Manager manager,
@NonNull MediaRoute2Info route, int volume) {
@@ -1122,6 +1180,7 @@ class MediaRouter2ServiceImpl {
public final String mPackageName;
public final int mManagerId;
public SessionCreationRequest mLastSessionCreationRequest;
+ public boolean mIsScanning;
ManagerRecord(UserRecord userRecord, IMediaRouter2Manager manager,
int uid, int pid, String packageName) {
@@ -1146,6 +1205,24 @@ class MediaRouter2ServiceImpl {
pw.println(prefix + this);
}
+ public void startScan() {
+ if (mIsScanning) {
+ return;
+ }
+ mIsScanning = true;
+ mUserRecord.mHandler.sendMessage(PooledLambda.obtainMessage(
+ UserHandler::updateDiscoveryPreferenceOnHandler, mUserRecord.mHandler));
+ }
+
+ public void stopScan() {
+ if (!mIsScanning) {
+ return;
+ }
+ mIsScanning = false;
+ mUserRecord.mHandler.sendMessage(PooledLambda.obtainMessage(
+ UserHandler::updateDiscoveryPreferenceOnHandler, mUserRecord.mHandler));
+ }
+
@Override
public String toString() {
return "Manager " + mPackageName + " (pid " + mPid + ")";
@@ -1262,6 +1339,24 @@ class MediaRouter2ServiceImpl {
return null;
}
+ public void maybeUpdateDiscoveryPreferenceForUid(int uid) {
+ MediaRouter2ServiceImpl service = mServiceRef.get();
+ if (service == null) {
+ return;
+ }
+ boolean isUidRelevant;
+ synchronized (service.mLock) {
+ isUidRelevant = mUserRecord.mRouterRecords.stream().anyMatch(
+ router -> router.mUid == uid)
+ | mUserRecord.mManagerRecords.stream().anyMatch(
+ manager -> manager.mUid == uid);
+ }
+ if (isUidRelevant) {
+ sendMessage(PooledLambda.obtainMessage(
+ UserHandler::updateDiscoveryPreferenceOnHandler, this));
+ }
+ }
+
private void onProviderStateChangedOnHandler(@NonNull MediaRoute2Provider provider) {
int providerInfoIndex = getLastProviderInfoIndex(provider.getUniqueId());
MediaRoute2ProviderInfo currentInfo = provider.getProviderInfo();
@@ -1767,6 +1862,16 @@ class MediaRouter2ServiceImpl {
return managers;
}
+ private List<RouterRecord> getRouterRecords() {
+ MediaRouter2ServiceImpl service = mServiceRef.get();
+ if (service == null) {
+ return Collections.emptyList();
+ }
+ synchronized (service.mLock) {
+ return new ArrayList<>(mUserRecord.mRouterRecords);
+ }
+ }
+
private List<ManagerRecord> getManagerRecords() {
MediaRouter2ServiceImpl service = mServiceRef.get();
if (service == null) {
@@ -2001,13 +2106,28 @@ class MediaRouter2ServiceImpl {
return;
}
List<RouteDiscoveryPreference> discoveryPreferences = new ArrayList<>();
- synchronized (service.mLock) {
- for (RouterRecord routerRecord : mUserRecord.mRouterRecords) {
+ List<RouterRecord> routerRecords = getRouterRecords();
+ List<ManagerRecord> managerRecords = getManagerRecords();
+ boolean isAnyManagerScanning =
+ managerRecords.stream().anyMatch(manager -> manager.mIsScanning
+ && service.mActivityManager.getPackageImportance(manager.mPackageName)
+ <= PACKAGE_IMPORTANCE_FOR_DISCOVERY);
+
+ for (RouterRecord routerRecord : routerRecords) {
+ if (isAnyManagerScanning
+ || service.mActivityManager.getPackageImportance(routerRecord.mPackageName)
+ <= PACKAGE_IMPORTANCE_FOR_DISCOVERY) {
discoveryPreferences.add(routerRecord.mDiscoveryPreference);
}
- mUserRecord.mCompositeDiscoveryPreference =
- new RouteDiscoveryPreference.Builder(discoveryPreferences)
- .build();
+ }
+
+ synchronized (service.mLock) {
+ RouteDiscoveryPreference newPreference =
+ new RouteDiscoveryPreference.Builder(discoveryPreferences).build();
+ if (newPreference.equals(mUserRecord.mCompositeDiscoveryPreference)) {
+ return;
+ }
+ mUserRecord.mCompositeDiscoveryPreference = newPreference;
}
for (MediaRoute2Provider provider : mRouteProviders) {
provider.updateDiscoveryPreference(mUserRecord.mCompositeDiscoveryPreference);
diff --git a/services/core/java/com/android/server/media/MediaRouterService.java b/services/core/java/com/android/server/media/MediaRouterService.java
index 0e52a67c8d39..b6d6cc48d0cd 100644
--- a/services/core/java/com/android/server/media/MediaRouterService.java
+++ b/services/core/java/com/android/server/media/MediaRouterService.java
@@ -544,6 +544,18 @@ public final class MediaRouterService extends IMediaRouterService.Stub
// Binder call
@Override
+ public void startScan(IMediaRouter2Manager manager) {
+ mService2.startScan(manager);
+ }
+
+ // Binder call
+ @Override
+ public void stopScan(IMediaRouter2Manager manager) {
+ mService2.stopScan(manager);
+ }
+
+ // Binder call
+ @Override
public void setRouteVolumeWithManager(IMediaRouter2Manager manager, int requestId,
MediaRoute2Info route, int volume) {
mService2.setRouteVolumeWithManager(manager, requestId, route, volume);
diff --git a/services/core/java/com/android/server/net/OWNERS b/services/core/java/com/android/server/net/OWNERS
index d5c7618199fe..28ae6a417bd3 100644
--- a/services/core/java/com/android/server/net/OWNERS
+++ b/services/core/java/com/android/server/net/OWNERS
@@ -2,7 +2,7 @@ set noparent
codewiz@google.com
jchalard@google.com
-jsharkey@google.com
+jsharkey@android.com
junyulai@google.com
lorenzo@google.com
reminv@google.com
diff --git a/services/core/java/com/android/server/notification/NotificationHistoryDatabase.java b/services/core/java/com/android/server/notification/NotificationHistoryDatabase.java
index c1deb965b054..b9984a5c24ee 100644
--- a/services/core/java/com/android/server/notification/NotificationHistoryDatabase.java
+++ b/services/core/java/com/android/server/notification/NotificationHistoryDatabase.java
@@ -293,9 +293,7 @@ public class NotificationHistoryDatabase {
.appendPath(file.getAbsolutePath()).build())
.addFlags(Intent.FLAG_RECEIVER_FOREGROUND)
.putExtra(EXTRA_KEY, file.getAbsolutePath()),
- // TODO(b/174161800) Please replace FLAG_MUTABLE_UNAUDITED below
- // with either FLAG_IMMUTABLE (recommended) or FLAG_MUTABLE.
- PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_MUTABLE_UNAUDITED);
+ PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_IMMUTABLE);
mAlarmManager.setExactAndAllowWhileIdle(AlarmManager.RTC_WAKEUP, deletionTime, pi);
}
diff --git a/services/core/java/com/android/server/notification/OWNERS b/services/core/java/com/android/server/notification/OWNERS
index 4dcb7995d8ae..5a19656b36a6 100644
--- a/services/core/java/com/android/server/notification/OWNERS
+++ b/services/core/java/com/android/server/notification/OWNERS
@@ -1,4 +1,4 @@
-dsandler@google.com
+dsandler@android.com
juliacr@google.com
beverlyt@google.com
pixel@google.com
diff --git a/services/core/java/com/android/server/notification/SnoozeHelper.java b/services/core/java/com/android/server/notification/SnoozeHelper.java
index 3e197fb78346..f078242a659f 100644
--- a/services/core/java/com/android/server/notification/SnoozeHelper.java
+++ b/services/core/java/com/android/server/notification/SnoozeHelper.java
@@ -462,8 +462,6 @@ public class SnoozeHelper {
}
private PendingIntent createPendingIntent(String pkg, String key, int userId) {
- // TODO(b/174969959) Please replace FLAG_MUTABLE_UNAUDITED below
- // with either FLAG_IMMUTABLE (recommended) or FLAG_MUTABLE.
return PendingIntent.getBroadcast(mContext,
REQUEST_CODE_REPOST,
new Intent(REPOST_ACTION)
@@ -471,7 +469,7 @@ public class SnoozeHelper {
.addFlags(Intent.FLAG_RECEIVER_FOREGROUND)
.putExtra(EXTRA_KEY, key)
.putExtra(EXTRA_USER_ID, userId),
- PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_MUTABLE_UNAUDITED);
+ PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_IMMUTABLE);
}
public void scheduleRepostsForPersistedNotifications(long currentTime) {
diff --git a/services/core/java/com/android/server/pm/OWNERS b/services/core/java/com/android/server/pm/OWNERS
index 7a2b7a62b7dd..004259b7478c 100644
--- a/services/core/java/com/android/server/pm/OWNERS
+++ b/services/core/java/com/android/server/pm/OWNERS
@@ -1,12 +1,12 @@
+hackbod@android.com
hackbod@google.com
-hackbod@google.com
-jsharkey@google.com
+jsharkey@android.com
jsharkey@google.com
narayan@google.com
patb@google.com
+svetoslavganov@android.com
svetoslavganov@google.com
-svetoslavganov@google.com
-toddke@google.com
+toddke@android.com
toddke@google.com
# apex support
diff --git a/services/core/java/com/android/server/pm/ShortcutPackage.java b/services/core/java/com/android/server/pm/ShortcutPackage.java
index 0ac0c8d95423..9f07695fcecf 100644
--- a/services/core/java/com/android/server/pm/ShortcutPackage.java
+++ b/services/core/java/com/android/server/pm/ShortcutPackage.java
@@ -737,7 +737,7 @@ class ShortcutPackage extends ShortcutPackageItem {
|| ((pinnedByCallerSet != null) && pinnedByCallerSet.contains(si.getId()));
if (!getPinnedByAnyLauncher) {
- if (si.isFloating()) {
+ if (si.isFloating() && !si.isCached()) {
if (!isPinnedByCaller) {
continue;
}
diff --git a/services/core/java/com/android/server/pm/permission/LegacyPermissionManagerInternal.java b/services/core/java/com/android/server/pm/permission/LegacyPermissionManagerInternal.java
index a098484b803b..7ca9f0536de1 100644
--- a/services/core/java/com/android/server/pm/permission/LegacyPermissionManagerInternal.java
+++ b/services/core/java/com/android/server/pm/permission/LegacyPermissionManagerInternal.java
@@ -99,52 +99,6 @@ public interface LegacyPermissionManagerInternal {
*/
void scheduleReadDefaultPermissionExceptions();
- // TODO(zhanghai): The following methods should be moved to a new AIDL to support
- // the legacy PermissionManager directly in a later CL.
-
- /**
- * Grant default permissions to currently active LUI app
- * @param packageName The package name for the LUI app
- * @param userId The user ID
- */
- void grantDefaultPermissionsToActiveLuiApp(String packageName, int userId);
-
- /**
- * Revoke default permissions to currently active LUI app
- * @param packageNames The package names for the LUI apps
- * @param userId The user ID
- */
- void revokeDefaultPermissionsFromLuiApps(String[] packageNames, int userId);
-
- /**
- * Grant default permissions to currently active Ims services
- * @param packageNames The package names for the Ims services
- * @param userId The user ID
- */
- void grantDefaultPermissionsToEnabledImsServices(String[] packageNames, int userId);
-
- /**
- * Grant default permissions to currently enabled telephony data services
- * @param packageNames The package name for the services
- * @param userId The user ID
- */
- void grantDefaultPermissionsToEnabledTelephonyDataServices(String[] packageNames, int userId);
-
- /**
- * Revoke default permissions to currently active telephony data services
- * @param packageNames The package name for the services
- * @param userId The IDhandle
- */
- void revokeDefaultPermissionsFromDisabledTelephonyDataServices(String[] packageNames,
- int userId);
-
- /**
- * Grant default permissions to currently enabled carrier apps
- * @param packageNames Package names of the apps to be granted permissions
- * @param userId The user ID
- */
- void grantDefaultPermissionsToEnabledCarrierApps(String[] packageNames, int userId);
-
/**
* Provider for package names.
*/
diff --git a/services/core/java/com/android/server/pm/permission/LegacyPermissionManagerService.java b/services/core/java/com/android/server/pm/permission/LegacyPermissionManagerService.java
index 0c0a8dfeaaec..f453d7460d9d 100644
--- a/services/core/java/com/android/server/pm/permission/LegacyPermissionManagerService.java
+++ b/services/core/java/com/android/server/pm/permission/LegacyPermissionManagerService.java
@@ -17,16 +17,31 @@
package com.android.server.pm.permission;
import android.annotation.NonNull;
+import android.annotation.Nullable;
+import android.app.AppOpsManager;
+import android.app.admin.DevicePolicyManager;
import android.content.Context;
+import android.content.pm.PackageManager;
import android.os.Binder;
+import android.os.Process;
+import android.os.ServiceManager;
+import android.os.UserHandle;
+import android.permission.ILegacyPermissionManager;
+import android.util.Log;
+import com.android.internal.annotations.VisibleForTesting;
import com.android.server.LocalServices;
import com.android.server.pm.PackageManagerServiceUtils;
/**
* Legacy permission manager service.
*/
-public class LegacyPermissionManagerService {
+public class LegacyPermissionManagerService extends ILegacyPermissionManager.Stub {
+ private static final String TAG = "PackageManager";
+
+ /** Injector that can be used to facilitate testing. */
+ private final Injector mInjector;
+
@NonNull
private final DefaultPermissionGrantPolicy mDefaultPermissionGrantPolicy;
@@ -51,8 +66,126 @@ public class LegacyPermissionManagerService {
}
private LegacyPermissionManagerService(@NonNull Context context) {
- mDefaultPermissionGrantPolicy = new DefaultPermissionGrantPolicy(context);
+ this(context, new Injector(context));
+
LocalServices.addService(LegacyPermissionManagerInternal.class, new Internal());
+ ServiceManager.addService("legacy_permission", this);
+ }
+
+ @VisibleForTesting
+ LegacyPermissionManagerService(@NonNull Context context, @NonNull Injector injector) {
+ mInjector = injector;
+ mDefaultPermissionGrantPolicy = new DefaultPermissionGrantPolicy(context);
+ }
+
+ @Override
+ public int checkDeviceIdentifierAccess(@Nullable String packageName, @Nullable String message,
+ @Nullable String callingFeatureId, int pid, int uid) {
+ // If the check is being requested by an app then only allow the app to query its own
+ // access status.
+ int callingUid = mInjector.getCallingUid();
+ int callingPid = mInjector.getCallingPid();
+ if (UserHandle.getAppId(callingUid) >= Process.FIRST_APPLICATION_UID && (callingUid != uid
+ || callingPid != pid)) {
+ String response = String.format(
+ "Calling uid %d, pid %d cannot check device identifier access for package %s "
+ + "(uid=%d, pid=%d)",
+ callingUid, callingPid, packageName, uid, pid);
+ Log.w(TAG, response);
+ throw new SecurityException(response);
+ }
+ // Allow system and root access to the device identifiers.
+ final int appId = UserHandle.getAppId(uid);
+ if (appId == Process.SYSTEM_UID || appId == Process.ROOT_UID) {
+ return PackageManager.PERMISSION_GRANTED;
+ }
+ // Allow access to packages that have the READ_PRIVILEGED_PHONE_STATE permission.
+ if (mInjector.checkPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE, pid,
+ uid) == PackageManager.PERMISSION_GRANTED) {
+ return PackageManager.PERMISSION_GRANTED;
+ }
+ // If the calling package is not null then perform the appop and device / profile owner
+ // check.
+ if (packageName != null) {
+ // Allow access to a package that has been granted the READ_DEVICE_IDENTIFIERS appop.
+ final long token = mInjector.clearCallingIdentity();
+ AppOpsManager appOpsManager = (AppOpsManager) mInjector.getSystemService(
+ Context.APP_OPS_SERVICE);
+ try {
+ if (appOpsManager.noteOpNoThrow(AppOpsManager.OPSTR_READ_DEVICE_IDENTIFIERS, uid,
+ packageName, callingFeatureId, message) == AppOpsManager.MODE_ALLOWED) {
+ return PackageManager.PERMISSION_GRANTED;
+ }
+ } finally {
+ mInjector.restoreCallingIdentity(token);
+ }
+ // Check if the calling packages meets the device / profile owner requirements for
+ // identifier access.
+ DevicePolicyManager devicePolicyManager =
+ (DevicePolicyManager) mInjector.getSystemService(Context.DEVICE_POLICY_SERVICE);
+ if (devicePolicyManager != null && devicePolicyManager.hasDeviceIdentifierAccess(
+ packageName, pid, uid)) {
+ return PackageManager.PERMISSION_GRANTED;
+ }
+ }
+ return PackageManager.PERMISSION_DENIED;
+ }
+
+ @Override
+ public void grantDefaultPermissionsToActiveLuiApp(String packageName, int userId) {
+ final int callingUid = Binder.getCallingUid();
+ PackageManagerServiceUtils.enforceSystemOrPhoneCaller(
+ "grantDefaultPermissionsToActiveLuiApp", callingUid);
+ Binder.withCleanCallingIdentity(() -> mDefaultPermissionGrantPolicy
+ .grantDefaultPermissionsToActiveLuiApp(packageName, userId));
+ }
+
+ @Override
+ public void revokeDefaultPermissionsFromLuiApps(String[] packageNames, int userId) {
+ final int callingUid = Binder.getCallingUid();
+ PackageManagerServiceUtils.enforceSystemOrPhoneCaller(
+ "revokeDefaultPermissionsFromLuiApps", callingUid);
+ Binder.withCleanCallingIdentity(() -> mDefaultPermissionGrantPolicy
+ .revokeDefaultPermissionsFromLuiApps(packageNames, userId));
+ }
+
+ @Override
+ public void grantDefaultPermissionsToEnabledImsServices(String[] packageNames, int userId) {
+ final int callingUid = Binder.getCallingUid();
+ PackageManagerServiceUtils.enforceSystemOrPhoneCaller(
+ "grantDefaultPermissionsToEnabledImsServices", callingUid);
+ Binder.withCleanCallingIdentity(() -> mDefaultPermissionGrantPolicy
+ .grantDefaultPermissionsToEnabledImsServices(packageNames, userId));
+ }
+
+ @Override
+ public void grantDefaultPermissionsToEnabledTelephonyDataServices(
+ String[] packageNames, int userId) {
+ final int callingUid = Binder.getCallingUid();
+ PackageManagerServiceUtils.enforceSystemOrPhoneCaller(
+ "grantDefaultPermissionsToEnabledTelephonyDataServices", callingUid);
+ Binder.withCleanCallingIdentity(() -> mDefaultPermissionGrantPolicy
+ .grantDefaultPermissionsToEnabledTelephonyDataServices(packageNames, userId));
+ }
+
+ @Override
+ public void revokeDefaultPermissionsFromDisabledTelephonyDataServices(
+ String[] packageNames, int userId) {
+ final int callingUid = Binder.getCallingUid();
+ PackageManagerServiceUtils.enforceSystemOrPhoneCaller(
+ "revokeDefaultPermissionsFromDisabledTelephonyDataServices", callingUid);
+ Binder.withCleanCallingIdentity(() -> mDefaultPermissionGrantPolicy
+ .revokeDefaultPermissionsFromDisabledTelephonyDataServices(packageNames,
+ userId));
+ }
+
+ @Override
+ public void grantDefaultPermissionsToEnabledCarrierApps(String[] packageNames, int userId) {
+ final int callingUid = Binder.getCallingUid();
+ PackageManagerServiceUtils.enforceSystemOrPhoneCaller(
+ "grantPermissionsToEnabledCarrierApps", callingUid);
+ Binder.withCleanCallingIdentity(() -> mDefaultPermissionGrantPolicy
+ .grantDefaultPermissionsToEnabledCarrierApps(packageNames, userId));
}
private class Internal implements LegacyPermissionManagerInternal {
@@ -117,65 +250,74 @@ public class LegacyPermissionManagerService {
public void scheduleReadDefaultPermissionExceptions() {
mDefaultPermissionGrantPolicy.scheduleReadDefaultPermissionExceptions();
}
+ }
+
+ /**
+ * Allows injection of services and method responses to facilitate testing.
+ *
+ * <p>Test classes can create a mock of this class and pass it to the PermissionManagerService
+ * constructor to control behavior of services and external methods during execution.
+ * @hide
+ */
+ @VisibleForTesting
+ public static class Injector {
+ private final Context mContext;
- // TODO(zhanghai): The following methods should be moved to a new AIDL to support
- // the legacy PermissionManager directly in a later CL.
+ /**
+ * Public constructor that accepts a {@code context} within which to operate.
+ */
+ public Injector(@NonNull Context context) {
+ mContext = context;
+ }
- @Override
- public void grantDefaultPermissionsToActiveLuiApp(String packageName, int userId) {
- final int callingUid = Binder.getCallingUid();
- PackageManagerServiceUtils.enforceSystemOrPhoneCaller(
- "grantDefaultPermissionsToActiveLuiApp", callingUid);
- Binder.withCleanCallingIdentity(() -> mDefaultPermissionGrantPolicy
- .grantDefaultPermissionsToActiveLuiApp(packageName, userId));
+ /**
+ * Returns the UID of the calling package.
+ */
+ public int getCallingUid() {
+ return Binder.getCallingUid();
}
- @Override
- public void revokeDefaultPermissionsFromLuiApps(String[] packageNames, int userId) {
- final int callingUid = Binder.getCallingUid();
- PackageManagerServiceUtils.enforceSystemOrPhoneCaller(
- "revokeDefaultPermissionsFromLuiApps", callingUid);
- Binder.withCleanCallingIdentity(() -> mDefaultPermissionGrantPolicy
- .revokeDefaultPermissionsFromLuiApps(packageNames, userId));
+ /**
+ * Returns the process ID of the calling package.
+ */
+ public int getCallingPid() {
+ return Binder.getCallingPid();
}
- @Override
- public void grantDefaultPermissionsToEnabledImsServices(String[] packageNames, int userId) {
- final int callingUid = Binder.getCallingUid();
- PackageManagerServiceUtils.enforceSystemOrPhoneCaller(
- "grantDefaultPermissionsToEnabledImsServices", callingUid);
- Binder.withCleanCallingIdentity(() -> mDefaultPermissionGrantPolicy
- .grantDefaultPermissionsToEnabledImsServices(packageNames, userId));
+ /**
+ * Checks if the package running under the specified {@code pid} and {@code uid} has been
+ * granted the provided {@code permission}.
+ *
+ * @return {@link PackageManager#PERMISSION_GRANTED} if the package has been granted the
+ * permission, {@link PackageManager#PERMISSION_DENIED} otherwise
+ */
+ public int checkPermission(@NonNull String permission, int pid, int uid) {
+ return mContext.checkPermission(permission, pid, uid);
}
- @Override
- public void grantDefaultPermissionsToEnabledTelephonyDataServices(
- String[] packageNames, int userId) {
- final int callingUid = Binder.getCallingUid();
- PackageManagerServiceUtils.enforceSystemOrPhoneCaller(
- "grantDefaultPermissionsToEnabledTelephonyDataServices", callingUid);
- Binder.withCleanCallingIdentity(() -> mDefaultPermissionGrantPolicy
- .grantDefaultPermissionsToEnabledTelephonyDataServices(packageNames, userId));
+ /**
+ * Clears the calling identity to allow subsequent calls to be treated as coming from this
+ * package.
+ *
+ * @return a token that can be used to restore the calling identity
+ */
+ public long clearCallingIdentity() {
+ return Binder.clearCallingIdentity();
}
- @Override
- public void revokeDefaultPermissionsFromDisabledTelephonyDataServices(
- String[] packageNames, int userId) {
- final int callingUid = Binder.getCallingUid();
- PackageManagerServiceUtils.enforceSystemOrPhoneCaller(
- "revokeDefaultPermissionsFromDisabledTelephonyDataServices", callingUid);
- Binder.withCleanCallingIdentity(() -> mDefaultPermissionGrantPolicy
- .revokeDefaultPermissionsFromDisabledTelephonyDataServices(packageNames,
- userId));
+ /**
+ * Restores the calling identity to that of the calling package based on the provided
+ * {@code token}.
+ */
+ public void restoreCallingIdentity(long token) {
+ Binder.restoreCallingIdentity(token);
}
- @Override
- public void grantDefaultPermissionsToEnabledCarrierApps(String[] packageNames, int userId) {
- final int callingUid = Binder.getCallingUid();
- PackageManagerServiceUtils.enforceSystemOrPhoneCaller(
- "grantPermissionsToEnabledCarrierApps", callingUid);
- Binder.withCleanCallingIdentity(() -> mDefaultPermissionGrantPolicy
- .grantDefaultPermissionsToEnabledCarrierApps(packageNames, userId));
+ /**
+ * Returns the system service with the provided {@code name}.
+ */
+ public Object getSystemService(@NonNull String name) {
+ return mContext.getSystemService(name);
}
}
}
diff --git a/services/core/java/com/android/server/pm/permission/OWNERS b/services/core/java/com/android/server/pm/permission/OWNERS
index 6e678305b860..0e88862e01b1 100644
--- a/services/core/java/com/android/server/pm/permission/OWNERS
+++ b/services/core/java/com/android/server/pm/permission/OWNERS
@@ -1,7 +1,7 @@
moltmann@google.com
zhanghai@google.com
-per-file DefaultPermissionGrantPolicy.java = hackbod@google.com
-per-file DefaultPermissionGrantPolicy.java = jsharkey@google.com
+per-file DefaultPermissionGrantPolicy.java = hackbod@android.com
+per-file DefaultPermissionGrantPolicy.java = jsharkey@android.com
per-file DefaultPermissionGrantPolicy.java = svetoslavganov@google.com
per-file DefaultPermissionGrantPolicy.java = toddke@google.com
per-file DefaultPermissionGrantPolicy.java = yamasani@google.com
diff --git a/services/core/java/com/android/server/pm/permission/PermissionManagerService.java b/services/core/java/com/android/server/pm/permission/PermissionManagerService.java
index 1df51772f823..1dbf8396bcfb 100644
--- a/services/core/java/com/android/server/pm/permission/PermissionManagerService.java
+++ b/services/core/java/com/android/server/pm/permission/PermissionManagerService.java
@@ -66,9 +66,7 @@ import android.annotation.Nullable;
import android.annotation.UserIdInt;
import android.app.ActivityManager;
import android.app.AppOpsManager;
-import android.app.ApplicationPackageManager;
import android.app.IActivityManager;
-import android.app.admin.DevicePolicyManager;
import android.app.admin.DevicePolicyManagerInternal;
import android.app.role.RoleManager;
import android.compat.annotation.ChangeId;
@@ -126,7 +124,6 @@ import android.util.SparseArray;
import android.util.SparseBooleanArray;
import com.android.internal.annotations.GuardedBy;
-import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.compat.IPlatformCompat;
import com.android.internal.logging.MetricsLogger;
import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
@@ -264,9 +261,6 @@ public class PermissionManagerService extends IPermissionManager.Stub {
@NonNull
private final PermissionRegistry mRegistry = new PermissionRegistry();
- /** Injector that can be used to facilitate testing. */
- private final Injector mInjector;
-
@GuardedBy("mLock")
@Nullable
private ArraySet<String> mPrivappPermissionsViolations;
@@ -364,17 +358,11 @@ public class PermissionManagerService extends IPermissionManager.Stub {
};
PermissionManagerService(@NonNull Context context) {
- this(context, new Injector(context));
- }
-
- @VisibleForTesting
- PermissionManagerService(@NonNull Context context, @NonNull Injector injector) {
- mInjector = injector;
// The package info cache is the cache for package and permission information.
// Disable the package info and package permission caches locally but leave the
// checkPermission cache active.
- mInjector.invalidatePackageInfoCache();
- mInjector.disablePackageNamePermissionCache();
+ PackageManager.invalidatePackageInfoCache();
+ PermissionManager.disablePackageNamePermissionCache();
mContext = context;
mPackageManagerInt = LocalServices.getService(PackageManagerInternal.class);
@@ -806,8 +794,8 @@ public class PermissionManagerService extends IPermissionManager.Stub {
private void updatePermissionFlagsInternal(String permName, String packageName, int flagMask,
int flagValues, int callingUid, int userId, boolean overridePolicy,
PermissionCallback callback) {
- if (ApplicationPackageManager.DEBUG_TRACE_PERMISSION_UPDATES
- && ApplicationPackageManager.shouldTraceGrant(packageName, permName, userId)) {
+ if (PermissionManager.DEBUG_TRACE_PERMISSION_UPDATES
+ && PermissionManager.shouldTraceGrant(packageName, permName, userId)) {
Log.i(TAG, "System is updating flags for " + packageName + " "
+ permName + " for user " + userId + " "
+ DebugUtils.flagsToString(
@@ -1113,59 +1101,6 @@ public class PermissionManagerService extends IPermissionManager.Stub {
}
@Override
- public int checkDeviceIdentifierAccess(@Nullable String packageName, @Nullable String message,
- @Nullable String callingFeatureId, int pid, int uid) {
- // If the check is being requested by an app then only allow the app to query its own
- // access status.
- int callingUid = mInjector.getCallingUid();
- int callingPid = mInjector.getCallingPid();
- if (UserHandle.getAppId(callingUid) >= Process.FIRST_APPLICATION_UID && (callingUid != uid
- || callingPid != pid)) {
- String response = String.format(
- "Calling uid %d, pid %d cannot check device identifier access for package %s "
- + "(uid=%d, pid=%d)",
- callingUid, callingPid, packageName, uid, pid);
- Log.w(TAG, response);
- throw new SecurityException(response);
- }
- // Allow system and root access to the device identifiers.
- final int appId = UserHandle.getAppId(uid);
- if (appId == Process.SYSTEM_UID || appId == Process.ROOT_UID) {
- return PackageManager.PERMISSION_GRANTED;
- }
- // Allow access to packages that have the READ_PRIVILEGED_PHONE_STATE permission.
- if (mInjector.checkPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE, pid,
- uid) == PackageManager.PERMISSION_GRANTED) {
- return PackageManager.PERMISSION_GRANTED;
- }
- // If the calling package is not null then perform the appop and device / profile owner
- // check.
- if (packageName != null) {
- // Allow access to a package that has been granted the READ_DEVICE_IDENTIFIERS appop.
- final long token = mInjector.clearCallingIdentity();
- AppOpsManager appOpsManager = (AppOpsManager) mInjector.getSystemService(
- Context.APP_OPS_SERVICE);
- try {
- if (appOpsManager.noteOpNoThrow(AppOpsManager.OPSTR_READ_DEVICE_IDENTIFIERS, uid,
- packageName, callingFeatureId, message) == AppOpsManager.MODE_ALLOWED) {
- return PackageManager.PERMISSION_GRANTED;
- }
- } finally {
- mInjector.restoreCallingIdentity(token);
- }
- // Check if the calling packages meets the device / profile owner requirements for
- // identifier access.
- DevicePolicyManager devicePolicyManager =
- (DevicePolicyManager) mInjector.getSystemService(Context.DEVICE_POLICY_SERVICE);
- if (devicePolicyManager != null && devicePolicyManager.hasDeviceIdentifierAccess(
- packageName, pid, uid)) {
- return PackageManager.PERMISSION_GRANTED;
- }
- }
- return PackageManager.PERMISSION_DENIED;
- }
-
- @Override
public void addOnPermissionsChangeListener(IOnPermissionsChangeListener listener) {
mContext.enforceCallingOrSelfPermission(
Manifest.permission.OBSERVE_GRANT_REVOKE_PERMISSIONS,
@@ -1520,8 +1455,8 @@ public class PermissionManagerService extends IPermissionManager.Stub {
// TODO swap permission name and package name
private void grantRuntimePermissionInternal(String permName, String packageName,
boolean overridePolicy, int callingUid, final int userId, PermissionCallback callback) {
- if (ApplicationPackageManager.DEBUG_TRACE_GRANTS
- && ApplicationPackageManager.shouldTraceGrant(packageName, permName, userId)) {
+ if (PermissionManager.DEBUG_TRACE_GRANTS
+ && PermissionManager.shouldTraceGrant(packageName, permName, userId)) {
Log.i(TAG, "System is granting " + packageName + " "
+ permName + " for user " + userId + " on behalf of uid " + callingUid
+ " " + mPackageManagerInt.getNameForUid(callingUid),
@@ -1697,8 +1632,8 @@ public class PermissionManagerService extends IPermissionManager.Stub {
private void revokeRuntimePermissionInternal(String permName, String packageName,
boolean overridePolicy, int callingUid, final int userId, String reason,
PermissionCallback callback) {
- if (ApplicationPackageManager.DEBUG_TRACE_PERMISSION_UPDATES
- && ApplicationPackageManager.shouldTraceGrant(packageName, permName, userId)) {
+ if (PermissionManager.DEBUG_TRACE_PERMISSION_UPDATES
+ && PermissionManager.shouldTraceGrant(packageName, permName, userId)) {
Log.i(TAG, "System is revoking " + packageName + " "
+ permName + " for user " + userId + " on behalf of uid " + callingUid
+ " " + mPackageManagerInt.getNameForUid(callingUid),
@@ -2037,44 +1972,6 @@ public class PermissionManagerService extends IPermissionManager.Stub {
mPackageManagerInt.writePermissionSettings(asyncUpdatedUsers.toArray(), true);
}
- @Override
- public void grantDefaultPermissionsToEnabledCarrierApps(String[] packageNames, int userId) {
- LocalServices.getService(LegacyPermissionManagerInternal.class)
- .grantDefaultPermissionsToEnabledCarrierApps(packageNames, userId);
- }
-
- @Override
- public void grantDefaultPermissionsToEnabledImsServices(String[] packageNames, int userId) {
- LocalServices.getService(LegacyPermissionManagerInternal.class)
- .grantDefaultPermissionsToEnabledImsServices(packageNames, userId);
- }
-
- @Override
- public void grantDefaultPermissionsToEnabledTelephonyDataServices(
- String[] packageNames, int userId) {
- LocalServices.getService(LegacyPermissionManagerInternal.class)
- .grantDefaultPermissionsToEnabledTelephonyDataServices(packageNames, userId);
- }
-
- @Override
- public void revokeDefaultPermissionsFromDisabledTelephonyDataServices(
- String[] packageNames, int userId) {
- LocalServices.getService(LegacyPermissionManagerInternal.class)
- .revokeDefaultPermissionsFromDisabledTelephonyDataServices(packageNames, userId);
- }
-
- @Override
- public void grantDefaultPermissionsToActiveLuiApp(String packageName, int userId) {
- LocalServices.getService(LegacyPermissionManagerInternal.class)
- .grantDefaultPermissionsToActiveLuiApp(packageName, userId);
- }
-
- @Override
- public void revokeDefaultPermissionsFromLuiApps(String[] packageNames, int userId) {
- LocalServices.getService(LegacyPermissionManagerInternal.class)
- .revokeDefaultPermissionsFromLuiApps(packageNames, userId);
- }
-
/**
* This change makes it so that apps are told to show rationale for asking for background
* location access every time they request.
@@ -2885,12 +2782,13 @@ public class PermissionManagerService extends IPermissionManager.Stub {
// TODO(zhanghai): This calls into SystemConfig, which generally
// shouldn't cause deadlock, but maybe we should keep a cache of the
// split permission list and just eliminate the possibility.
- final List<SplitPermissionInfoParcelable> permissionList =
- getSplitPermissions();
+ final List<PermissionManager.SplitPermissionInfo> permissionList =
+ getSplitPermissionInfos();
int numSplitPerms = permissionList.size();
for (int splitPermNum = 0; splitPermNum < numSplitPerms;
splitPermNum++) {
- SplitPermissionInfoParcelable sp = permissionList.get(splitPermNum);
+ PermissionManager.SplitPermissionInfo sp = permissionList.get(
+ splitPermNum);
String splitPermName = sp.getSplitPermission();
if (sp.getNewPermissions().contains(permName)
&& origState.isPermissionGranted(splitPermName)) {
@@ -3287,10 +3185,11 @@ public class PermissionManagerService extends IPermissionManager.Stub {
String pkgName = pkg.getPackageName();
ArrayMap<String, ArraySet<String>> newToSplitPerms = new ArrayMap<>();
- final List<SplitPermissionInfoParcelable> permissionList = getSplitPermissions();
+ final List<PermissionManager.SplitPermissionInfo> permissionList =
+ getSplitPermissionInfos();
int numSplitPerms = permissionList.size();
for (int splitPermNum = 0; splitPermNum < numSplitPerms; splitPermNum++) {
- SplitPermissionInfoParcelable spi = permissionList.get(splitPermNum);
+ PermissionManager.SplitPermissionInfo spi = permissionList.get(splitPermNum);
List<String> newPerms = spi.getNewPermissions();
int numNewPerms = newPerms.size();
@@ -3356,10 +3255,15 @@ public class PermissionManagerService extends IPermissionManager.Stub {
return updatedUserIds;
}
+ @NonNull
@Override
public List<SplitPermissionInfoParcelable> getSplitPermissions() {
- return PermissionManager.splitPermissionInfoListToParcelableList(
- SystemConfig.getInstance().getSplitPermissions());
+ return PermissionManager.splitPermissionInfoListToParcelableList(getSplitPermissionInfos());
+ }
+
+ @NonNull
+ private List<PermissionManager.SplitPermissionInfo> getSplitPermissionInfos() {
+ return SystemConfig.getInstance().getSplitPermissions();
}
@NonNull
@@ -5456,94 +5360,4 @@ public class PermissionManagerService extends IPermissionManager.Stub {
|| mDelegatedPermissionNames.contains(permissionName);
}
}
-
- /**
- * Allows injection of services and method responses to facilitate testing.
- *
- * <p>Test classes can create a mock of this class and pass it to the PermissionManagerService
- * constructor to control behavior of services and external methods during execution.
- * @hide
- */
- @VisibleForTesting
- public static class Injector {
- private final Context mContext;
-
- /**
- * Public constructor that accepts a {@code context} within which to operate.
- */
- public Injector(@NonNull Context context) {
- mContext = context;
- }
-
- /**
- * Returns the UID of the calling package.
- */
- public int getCallingUid() {
- return Binder.getCallingUid();
- }
-
- /**
- * Returns the process ID of the calling package.
- */
- public int getCallingPid() {
- return Binder.getCallingPid();
- }
-
- /**
- * Invalidates the package info cache.
- */
- public void invalidatePackageInfoCache() {
- PackageManager.invalidatePackageInfoCache();
- }
-
- /**
- * Disables the permission cache.
- */
- public void disablePermissionCache() {
- PermissionManager.disablePermissionCache();
- }
-
- /**
- * Disables the package name permission cache.
- */
- public void disablePackageNamePermissionCache() {
- PermissionManager.disablePackageNamePermissionCache();
- }
-
- /**
- * Checks if the package running under the specified {@code pid} and {@code uid} has been
- * granted the provided {@code permission}.
- *
- * @return {@link PackageManager#PERMISSION_GRANTED} if the package has been granted the
- * permission, {@link PackageManager#PERMISSION_DENIED} otherwise
- */
- public int checkPermission(@NonNull String permission, int pid, int uid) {
- return mContext.checkPermission(permission, pid, uid);
- }
-
- /**
- * Clears the calling identity to allow subsequent calls to be treated as coming from this
- * package.
- *
- * @return a token that can be used to restore the calling identity
- */
- public long clearCallingIdentity() {
- return Binder.clearCallingIdentity();
- }
-
- /**
- * Restores the calling identity to that of the calling package based on the provided
- * {@code token}.
- */
- public void restoreCallingIdentity(long token) {
- Binder.restoreCallingIdentity(token);
- }
-
- /**
- * Returns the system service with the provided {@code name}.
- */
- public Object getSystemService(@NonNull String name) {
- return mContext.getSystemService(name);
- }
- }
}
diff --git a/services/core/java/com/android/server/policy/OWNERS b/services/core/java/com/android/server/policy/OWNERS
index 0862c05e0ee4..d25ec4a560a3 100644
--- a/services/core/java/com/android/server/policy/OWNERS
+++ b/services/core/java/com/android/server/policy/OWNERS
@@ -1 +1,2 @@
include /services/core/java/com/android/server/wm/OWNERS
+include /services/core/java/com/android/server/input/OWNERS
diff --git a/services/core/java/com/android/server/policy/PhoneWindowManager.java b/services/core/java/com/android/server/policy/PhoneWindowManager.java
index 4fa8c8e1395d..cc4f5592cbb6 100644
--- a/services/core/java/com/android/server/policy/PhoneWindowManager.java
+++ b/services/core/java/com/android/server/policy/PhoneWindowManager.java
@@ -3126,7 +3126,8 @@ public class PhoneWindowManager implements WindowManagerPolicy {
}
}
- private int handleStartTransitionForKeyguardLw(boolean keyguardGoingAway, long duration) {
+ @Override
+ public int applyKeyguardOcclusionChange() {
if (mKeyguardOccludedChanged) {
if (DEBUG_KEYGUARD) Slog.d(TAG, "transition/occluded changed occluded="
+ mPendingKeyguardOccluded);
@@ -3135,6 +3136,12 @@ public class PhoneWindowManager implements WindowManagerPolicy {
return FINISH_LAYOUT_REDO_LAYOUT | FINISH_LAYOUT_REDO_WALLPAPER;
}
}
+ return 0;
+ }
+
+ private int handleStartTransitionForKeyguardLw(boolean keyguardGoingAway, long duration) {
+ final int res = applyKeyguardOcclusionChange();
+ if (res != 0) return res;
if (keyguardGoingAway) {
if (DEBUG_KEYGUARD) Slog.d(TAG, "Starting keyguard exit animation");
startKeyguardExitAnimation(SystemClock.uptimeMillis(), duration);
diff --git a/services/core/java/com/android/server/policy/WindowManagerPolicy.java b/services/core/java/com/android/server/policy/WindowManagerPolicy.java
index 6934e5c3bcc1..977b31e6d683 100644
--- a/services/core/java/com/android/server/policy/WindowManagerPolicy.java
+++ b/services/core/java/com/android/server/policy/WindowManagerPolicy.java
@@ -172,6 +172,9 @@ public interface WindowManagerPolicy extends WindowManagerPolicyConstants {
*/
void onKeyguardOccludedChangedLw(boolean occluded);
+ /** Applies a keyguard occlusion change if one happened. */
+ int applyKeyguardOcclusionChange();
+
/**
* Interface to the Window Manager state associated with a particular
* window. You can hold on to an instance of this interface from the call
diff --git a/services/core/java/com/android/server/powerstats/OWNERS b/services/core/java/com/android/server/powerstats/OWNERS
index d68066bb8c40..c22f6a4bbbf6 100644
--- a/services/core/java/com/android/server/powerstats/OWNERS
+++ b/services/core/java/com/android/server/powerstats/OWNERS
@@ -1 +1,2 @@
+include /BATTERY_STATS_OWNERS
include /services/core/java/com/android/server/power/OWNERS
diff --git a/services/core/java/com/android/server/rollback/RollbackManagerServiceImpl.java b/services/core/java/com/android/server/rollback/RollbackManagerServiceImpl.java
index 192a00303a30..bd66aa39b8d2 100644
--- a/services/core/java/com/android/server/rollback/RollbackManagerServiceImpl.java
+++ b/services/core/java/com/android/server/rollback/RollbackManagerServiceImpl.java
@@ -1316,7 +1316,7 @@ class RollbackManagerServiceImpl extends IRollbackManager.Stub implements Rollba
private SparseIntArray getExtensionVersions() {
// This list must be updated whenever the current API level is increased, or should be
// replaced when we have another way of determining the relevant SDK versions.
- final int[] relevantSdkVersions = { Build.VERSION_CODES.R };
+ final int[] relevantSdkVersions = { Build.VERSION_CODES.R, Build.VERSION_CODES.S };
SparseIntArray result = new SparseIntArray(relevantSdkVersions.length);
for (int i = 0; i < relevantSdkVersions.length; i++) {
diff --git a/services/core/java/com/android/server/stats/pull/StatsPullAtomService.java b/services/core/java/com/android/server/stats/pull/StatsPullAtomService.java
index 49f9b311d95c..8438652c084e 100644
--- a/services/core/java/com/android/server/stats/pull/StatsPullAtomService.java
+++ b/services/core/java/com/android/server/stats/pull/StatsPullAtomService.java
@@ -169,7 +169,6 @@ import com.android.server.stats.pull.netstats.SubInfo;
import com.android.server.storage.DiskStatsFileLogger;
import com.android.server.storage.DiskStatsLoggingService;
-import java.util.concurrent.ExecutionException;
import libcore.io.IoUtils;
import org.json.JSONArray;
@@ -192,6 +191,7 @@ import java.util.Random;
import java.util.Set;
import java.util.UUID;
import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.ExecutionException;
import java.util.concurrent.Executor;
import java.util.concurrent.ThreadLocalRandom;
import java.util.concurrent.TimeUnit;
diff --git a/services/core/java/com/android/server/timedetector/OWNERS b/services/core/java/com/android/server/timedetector/OWNERS
index 09447a971bdd..8f8089717e3b 100644
--- a/services/core/java/com/android/server/timedetector/OWNERS
+++ b/services/core/java/com/android/server/timedetector/OWNERS
@@ -1 +1,3 @@
-include /core/java/android/app/timezone/OWNERS
+# Bug component: 847766
+mingaleev@google.com
+include /core/java/android/app/timedetector/OWNERS
diff --git a/services/core/java/com/android/server/timedetector/TimeDetectorService.java b/services/core/java/com/android/server/timedetector/TimeDetectorService.java
index 7de0e87f91c3..c7fe20415511 100644
--- a/services/core/java/com/android/server/timedetector/TimeDetectorService.java
+++ b/services/core/java/com/android/server/timedetector/TimeDetectorService.java
@@ -18,6 +18,7 @@ package com.android.server.timedetector;
import android.annotation.NonNull;
import android.annotation.Nullable;
+import android.app.timedetector.GnssTimeSuggestion;
import android.app.timedetector.ITimeDetectorService;
import android.app.timedetector.ManualTimeSuggestion;
import android.app.timedetector.NetworkTimeSuggestion;
@@ -129,6 +130,14 @@ public final class TimeDetectorService extends ITimeDetectorService.Stub {
mHandler.post(() -> mTimeDetectorStrategy.suggestNetworkTime(timeSignal));
}
+ @Override
+ public void suggestGnssTime(@NonNull GnssTimeSuggestion timeSignal) {
+ enforceSuggestGnssTimePermission();
+ Objects.requireNonNull(timeSignal);
+
+ mHandler.post(() -> mTimeDetectorStrategy.suggestGnssTime(timeSignal));
+ }
+
/** Internal method for handling the auto time setting being changed. */
@VisibleForTesting
public void handleAutoTimeDetectionChanged() {
@@ -162,4 +171,10 @@ public final class TimeDetectorService extends ITimeDetectorService.Stub {
android.Manifest.permission.SET_TIME,
"set time");
}
+
+ private void enforceSuggestGnssTimePermission() {
+ mContext.enforceCallingOrSelfPermission(
+ android.Manifest.permission.SET_TIME,
+ "suggest gnss time");
+ }
}
diff --git a/services/core/java/com/android/server/timedetector/TimeDetectorStrategy.java b/services/core/java/com/android/server/timedetector/TimeDetectorStrategy.java
index f278ef68c536..b539f013d6d3 100644
--- a/services/core/java/com/android/server/timedetector/TimeDetectorStrategy.java
+++ b/services/core/java/com/android/server/timedetector/TimeDetectorStrategy.java
@@ -18,6 +18,7 @@ package com.android.server.timedetector;
import android.annotation.IntDef;
import android.annotation.NonNull;
+import android.app.timedetector.GnssTimeSuggestion;
import android.app.timedetector.ManualTimeSuggestion;
import android.app.timedetector.NetworkTimeSuggestion;
import android.app.timedetector.TelephonyTimeSuggestion;
@@ -41,7 +42,7 @@ import java.lang.annotation.RetentionPolicy;
*/
public interface TimeDetectorStrategy extends Dumpable {
- @IntDef({ ORIGIN_TELEPHONY, ORIGIN_MANUAL, ORIGIN_NETWORK })
+ @IntDef({ ORIGIN_TELEPHONY, ORIGIN_MANUAL, ORIGIN_NETWORK, ORIGIN_GNSS })
@Retention(RetentionPolicy.SOURCE)
@interface Origin {}
@@ -57,6 +58,10 @@ public interface TimeDetectorStrategy extends Dumpable {
@Origin
int ORIGIN_NETWORK = 3;
+ /** Used when a time value originated from a gnss signal. */
+ @Origin
+ int ORIGIN_GNSS = 4;
+
/** Processes the suggested time from telephony sources. */
void suggestTelephonyTime(@NonNull TelephonyTimeSuggestion timeSuggestion);
@@ -71,6 +76,9 @@ public interface TimeDetectorStrategy extends Dumpable {
/** Processes the suggested time from network sources. */
void suggestNetworkTime(@NonNull NetworkTimeSuggestion timeSuggestion);
+ /** Processes the suggested time from gnss sources. */
+ void suggestGnssTime(@NonNull GnssTimeSuggestion timeSuggestion);
+
/**
* Handles the auto-time configuration changing For example, when the auto-time setting is
* toggled on or off.
@@ -100,6 +108,8 @@ public interface TimeDetectorStrategy extends Dumpable {
return "network";
case ORIGIN_TELEPHONY:
return "telephony";
+ case ORIGIN_GNSS:
+ return "gnss";
default:
throw new IllegalArgumentException("origin=" + origin);
}
@@ -117,6 +127,8 @@ public interface TimeDetectorStrategy extends Dumpable {
return ORIGIN_NETWORK;
case "telephony":
return ORIGIN_TELEPHONY;
+ case "gnss":
+ return ORIGIN_GNSS;
default:
throw new IllegalArgumentException("originString=" + originString);
}
diff --git a/services/core/java/com/android/server/timedetector/TimeDetectorStrategyImpl.java b/services/core/java/com/android/server/timedetector/TimeDetectorStrategyImpl.java
index b5d49cfbe9c8..48af81e5c59c 100644
--- a/services/core/java/com/android/server/timedetector/TimeDetectorStrategyImpl.java
+++ b/services/core/java/com/android/server/timedetector/TimeDetectorStrategyImpl.java
@@ -23,6 +23,7 @@ import static java.util.stream.Collectors.joining;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.app.AlarmManager;
+import android.app.timedetector.GnssTimeSuggestion;
import android.app.timedetector.ManualTimeSuggestion;
import android.app.timedetector.NetworkTimeSuggestion;
import android.app.timedetector.TelephonyTimeSuggestion;
@@ -108,6 +109,10 @@ public final class TimeDetectorStrategyImpl implements TimeDetectorStrategy {
private final ReferenceWithHistory<NetworkTimeSuggestion> mLastNetworkSuggestion =
new ReferenceWithHistory<>(KEEP_SUGGESTION_HISTORY_SIZE);
+ @GuardedBy("this")
+ private final ReferenceWithHistory<GnssTimeSuggestion> mLastGnssSuggestion =
+ new ReferenceWithHistory<>(KEEP_SUGGESTION_HISTORY_SIZE);
+
/**
* The interface used by the strategy to interact with the surrounding service.
*
@@ -165,6 +170,20 @@ public final class TimeDetectorStrategyImpl implements TimeDetectorStrategy {
}
@Override
+ public synchronized void suggestGnssTime(@NonNull GnssTimeSuggestion timeSuggestion) {
+ final TimestampedValue<Long> newUtcTime = timeSuggestion.getUtcTime();
+
+ if (!validateAutoSuggestionTime(newUtcTime, timeSuggestion)) {
+ return;
+ }
+
+ mLastGnssSuggestion.set(timeSuggestion);
+
+ String reason = "GNSS time suggestion received: suggestion=" + timeSuggestion;
+ doAutoTimeDetection(reason);
+ }
+
+ @Override
public synchronized boolean suggestManualTime(@NonNull ManualTimeSuggestion suggestion) {
final TimestampedValue<Long> newUtcTime = suggestion.getUtcTime();
@@ -278,6 +297,11 @@ public final class TimeDetectorStrategyImpl implements TimeDetectorStrategy {
mLastNetworkSuggestion.dump(ipw);
ipw.decreaseIndent(); // level 2
+ ipw.println("Gnss suggestion history:");
+ ipw.increaseIndent(); // level 2
+ mLastGnssSuggestion.dump(ipw);
+ ipw.decreaseIndent(); // level 2
+
ipw.decreaseIndent(); // level 1
}
@@ -383,6 +407,14 @@ public final class TimeDetectorStrategyImpl implements TimeDetectorStrategy {
+ ", networkSuggestion=" + networkSuggestion
+ ", detectionReason=" + detectionReason;
}
+ } else if (origin == ORIGIN_GNSS) {
+ GnssTimeSuggestion gnssTimeSuggestion = findLatestValidGnssSuggestion();
+ if (gnssTimeSuggestion != null) {
+ newUtcTime = gnssTimeSuggestion.getUtcTime();
+ cause = "Found good gnss suggestion."
+ + ", gnssTimeSuggestion=" + gnssTimeSuggestion
+ + ", detectionReason=" + detectionReason;
+ }
} else {
Slog.w(LOG_TAG, "Unknown or unsupported origin=" + origin
+ " in " + Arrays.toString(originPriorities)
@@ -524,6 +556,26 @@ public final class TimeDetectorStrategyImpl implements TimeDetectorStrategy {
return networkSuggestion;
}
+ /** Returns the latest, valid, gnss suggestion. Returns {@code null} if there isn't one. */
+ @GuardedBy("this")
+ @Nullable
+ private GnssTimeSuggestion findLatestValidGnssSuggestion() {
+ GnssTimeSuggestion gnssTimeSuggestion = mLastGnssSuggestion.get();
+ if (gnssTimeSuggestion == null) {
+ // No gnss suggestions received. This is normal if there's no gnss signal.
+ return null;
+ }
+
+ TimestampedValue<Long> utcTime = gnssTimeSuggestion.getUtcTime();
+ long elapsedRealTimeMillis = mCallback.elapsedRealtimeMillis();
+ if (!validateSuggestionUtcTime(elapsedRealTimeMillis, utcTime)) {
+ // The latest suggestion is not valid, usually due to its age.
+ return null;
+ }
+
+ return gnssTimeSuggestion;
+ }
+
@GuardedBy("this")
private boolean setSystemClockIfRequired(
@Origin int origin, @NonNull TimestampedValue<Long> time, @NonNull String cause) {
@@ -652,6 +704,16 @@ public final class TimeDetectorStrategyImpl implements TimeDetectorStrategy {
}
/**
+ * Returns the latest valid gnss suggestion. Not intended for general use: it is used during
+ * tests to check strategy behavior.
+ */
+ @VisibleForTesting
+ @Nullable
+ public synchronized GnssTimeSuggestion findLatestValidGnssSuggestionForTests() {
+ return findLatestValidGnssSuggestion();
+ }
+
+ /**
* A method used to inspect state during tests. Not intended for general use.
*/
@VisibleForTesting
@@ -669,6 +731,15 @@ public final class TimeDetectorStrategyImpl implements TimeDetectorStrategy {
return mLastNetworkSuggestion.get();
}
+ /**
+ * A method used to inspect state during tests. Not intended for general use.
+ */
+ @VisibleForTesting
+ @Nullable
+ public synchronized GnssTimeSuggestion getLatestGnssSuggestion() {
+ return mLastGnssSuggestion.get();
+ }
+
private static boolean validateSuggestionUtcTime(
long elapsedRealtimeMillis, TimestampedValue<Long> utcTime) {
long referenceTimeMillis = utcTime.getReferenceTimeMillis();
diff --git a/services/core/java/com/android/server/timezone/OWNERS b/services/core/java/com/android/server/timezone/OWNERS
index 09447a971bdd..8f8089717e3b 100644
--- a/services/core/java/com/android/server/timezone/OWNERS
+++ b/services/core/java/com/android/server/timezone/OWNERS
@@ -1 +1,3 @@
-include /core/java/android/app/timezone/OWNERS
+# Bug component: 847766
+mingaleev@google.com
+include /core/java/android/app/timedetector/OWNERS
diff --git a/services/core/java/com/android/server/timezonedetector/OWNERS b/services/core/java/com/android/server/timezonedetector/OWNERS
index 09447a971bdd..8f8089717e3b 100644
--- a/services/core/java/com/android/server/timezonedetector/OWNERS
+++ b/services/core/java/com/android/server/timezonedetector/OWNERS
@@ -1 +1,3 @@
-include /core/java/android/app/timezone/OWNERS
+# Bug component: 847766
+mingaleev@google.com
+include /core/java/android/app/timedetector/OWNERS
diff --git a/services/core/java/com/android/server/wm/ActivityMetricsLogger.java b/services/core/java/com/android/server/wm/ActivityMetricsLogger.java
index 6a50b793de0f..b0847879f456 100644
--- a/services/core/java/com/android/server/wm/ActivityMetricsLogger.java
+++ b/services/core/java/com/android/server/wm/ActivityMetricsLogger.java
@@ -631,6 +631,10 @@ class ActivityMetricsLogger {
if (info.mLoggedTransitionStarting && info.allDrawn()) {
done(false /* abort */, info, "notifyWindowsDrawn - all windows drawn", timestampNs);
}
+ if (r.mWmService.isRecentsAnimationTarget(r)) {
+ r.mWmService.getRecentsAnimationController().logRecentsAnimationStartTime(
+ info.mSourceEventDelayMs + info.mWindowsDrawnDelayMs);
+ }
return infoSnapshot;
}
diff --git a/services/core/java/com/android/server/wm/ActivityRecord.java b/services/core/java/com/android/server/wm/ActivityRecord.java
index 113f4d856bdd..4c18310df226 100644
--- a/services/core/java/com/android/server/wm/ActivityRecord.java
+++ b/services/core/java/com/android/server/wm/ActivityRecord.java
@@ -95,18 +95,18 @@ import static android.view.Display.COLOR_MODE_DEFAULT;
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.TRANSIT_CLOSE;
-import static android.view.WindowManager.TRANSIT_OLD_ACTIVITY_CLOSE;
-import static android.view.WindowManager.TRANSIT_OLD_TASK_CLOSE;
-import static android.view.WindowManager.TRANSIT_OLD_TASK_OPEN_BEHIND;
-import static android.view.WindowManager.TRANSIT_OLD_UNSET;
+import static android.view.SurfaceControl.getGlobalTransaction;
import static android.view.WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD;
import static android.view.WindowManager.LayoutParams.FLAG_SHOW_WALLPAPER;
import static android.view.WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED;
import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION;
import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION_STARTING;
import static android.view.WindowManager.LayoutParams.TYPE_BASE_APPLICATION;
+import static android.view.WindowManager.TRANSIT_CLOSE;
import static android.view.WindowManager.TRANSIT_FLAG_OPEN_BEHIND;
+import static android.view.WindowManager.TRANSIT_OLD_ACTIVITY_CLOSE;
+import static android.view.WindowManager.TRANSIT_OLD_TASK_CLOSE;
+import static android.view.WindowManager.TRANSIT_OLD_UNSET;
import static com.android.internal.protolog.ProtoLogGroup.WM_DEBUG_ADD_REMOVE;
import static com.android.internal.protolog.ProtoLogGroup.WM_DEBUG_APP_TRANSITIONS;
@@ -182,7 +182,6 @@ import static com.android.server.wm.IdentifierProto.USER_ID;
import static com.android.server.wm.SurfaceAnimator.ANIMATION_TYPE_APP_TRANSITION;
import static com.android.server.wm.SurfaceAnimator.ANIMATION_TYPE_RECENTS;
import static com.android.server.wm.SurfaceAnimator.ANIMATION_TYPE_WINDOW_ANIMATION;
-import static com.android.server.wm.Task.TASK_VISIBILITY_VISIBLE;
import static com.android.server.wm.Task.ActivityState.DESTROYED;
import static com.android.server.wm.Task.ActivityState.DESTROYING;
import static com.android.server.wm.Task.ActivityState.FINISHING;
@@ -194,6 +193,7 @@ import static com.android.server.wm.Task.ActivityState.RESUMED;
import static com.android.server.wm.Task.ActivityState.STARTED;
import static com.android.server.wm.Task.ActivityState.STOPPED;
import static com.android.server.wm.Task.ActivityState.STOPPING;
+import static com.android.server.wm.Task.TASK_VISIBILITY_VISIBLE;
import static com.android.server.wm.TaskPersister.DEBUG;
import static com.android.server.wm.TaskPersister.IMAGE_EXTENSION;
import static com.android.server.wm.WindowContainer.AnimationFlags.CHILDREN;
@@ -1366,19 +1366,6 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
} else if (mLetterbox != null) {
mLetterbox.hide();
}
- maybeUpdateLetterboxInTaskOrganizer(w);
- }
-
- private void maybeUpdateLetterboxInTaskOrganizer(WindowState w) {
- boolean isLetterboxed = w.isLetterboxedAppWindow() && fillsParent();
- if (!isLetterboxed) {
- task.maybeUpdateLetterboxInTaskOrganizer(
- this, /* activityBounds= */ null, /* activityInsets= */ null);
- return;
- }
- final Rect insets = w.getInsetsStateWithVisibilityOverride().calculateInsets(
- getBounds(), Type.systemBars(), false /* ignoreVisibility */);
- task.maybeUpdateLetterboxInTaskOrganizer(this, getBounds(), insets);
}
void updateLetterboxSurface(WindowState winHint) {
@@ -2568,7 +2555,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
}
final Task rootTask = getRootTask();
- final boolean mayAdjustTop = (isState(RESUMED) || rootTask.mResumedActivity == null)
+ final boolean mayAdjustTop = (isState(RESUMED) || rootTask.getResumedActivity() == null)
&& rootTask.isFocusedStackOnDisplay()
// Do not adjust focus task because the task will be reused to launch new activity.
&& !task.isClearingToReuseTask();
@@ -2640,12 +2627,12 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
// Tell window manager to prepare for this one to be removed.
setVisibility(false);
- if (rootTask.mPausingActivity == null) {
+ if (task.getPausingActivity() == null) {
ProtoLog.v(WM_DEBUG_STATES, "Finish needs to pause: %s", this);
if (DEBUG_USER_LEAVING) {
Slog.v(TAG_USER_LEAVING, "finish() => pause with userLeaving=false");
}
- rootTask.startPausingLocked(false /* userLeaving */, false /* uiSleeping */,
+ task.startPausingLocked(false /* userLeaving */, false /* uiSleeping */,
null /* resuming */, "finish");
}
@@ -2733,7 +2720,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
final boolean isCurrentVisible = mVisibleRequested || isState(PAUSED);
if (isCurrentVisible) {
final Task stack = getStack();
- final ActivityRecord activity = stack.mResumedActivity;
+ final ActivityRecord activity = stack.getResumedActivity();
boolean ensureVisibility = false;
if (activity != null && !activity.occludesParent()) {
// If the resume activity is not opaque, we need to make sure the visibilities of
@@ -2961,10 +2948,10 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
boolean safelyDestroy(String reason) {
if (isDestroyable()) {
if (DEBUG_SWITCH) {
- final Task stack = getRootTask();
+ final Task task = getTask();
Slog.v(TAG_SWITCH, "Safely destroying " + this + " in state " + getState()
- + " resumed=" + stack.mResumedActivity
- + " pausing=" + stack.mPausingActivity
+ + " resumed=" + task.getResumedActivity()
+ + " pausing=" + task.getPausingActivity()
+ " for reason " + reason);
}
return destroyImmediately(reason);
@@ -3137,7 +3124,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
SurfaceControl.openTransaction();
for (int i = mChildren.size() - 1; i >= 0; i--) {
final WindowState w = mChildren.get(i);
- w.mWinAnimator.detachChildren();
+ w.mWinAnimator.detachChildren(getGlobalTransaction());
}
SurfaceControl.closeTransaction();
}
@@ -4449,7 +4436,8 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
SurfaceControl.openTransaction();
try {
forAllWindows(win -> {
- win.mWinAnimator.hide("immediately hidden"); }, true);
+ win.mWinAnimator.hide(getGlobalTransaction(), "immediately hidden");
+ }, true);
} finally {
SurfaceControl.closeTransaction();
}
@@ -4841,7 +4829,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
// If the app is capable of entering PIP, we should try pausing it now
// so it can PIP correctly.
if (deferHidingClient) {
- getRootTask().startPausingLocked(userLeaving, false /* uiSleeping */,
+ task.startPausingLocked(userLeaving, false /* uiSleeping */,
null /* resuming */, "makeInvisible");
break;
}
@@ -5072,25 +5060,24 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
ProtoLog.v(WM_DEBUG_STATES, "Activity paused: token=%s, timeout=%b", appToken,
timeout);
- final Task stack = getStack();
-
- if (stack != null) {
+ if (task != null) {
removePauseTimeout();
- if (stack.mPausingActivity == this) {
+ final ActivityRecord pausingActivity = task.getPausingActivity();
+ if (pausingActivity == this) {
ProtoLog.v(WM_DEBUG_STATES, "Moving to PAUSED: %s %s", this,
(timeout ? "(due to timeout)" : " (pause complete)"));
mAtmService.deferWindowLayout();
try {
- stack.completePauseLocked(true /* resumeNext */, null /* resumingActivity */);
+ task.completePauseLocked(true /* resumeNext */, null /* resumingActivity */);
} finally {
mAtmService.continueWindowLayout();
}
return;
} else {
EventLogTags.writeWmFailedToPause(mUserId, System.identityHashCode(this),
- shortComponentName, stack.mPausingActivity != null
- ? stack.mPausingActivity.shortComponentName : "(none)");
+ shortComponentName, pausingActivity != null
+ ? pausingActivity.shortComponentName : "(none)");
if (isState(PAUSING)) {
setState(PAUSED, "activityPausedLocked");
if (finishing) {
@@ -5188,10 +5175,9 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
void activityStopped(Bundle newIcicle, PersistableBundle newPersistentState,
CharSequence description) {
- final Task stack = getRootTask();
final boolean isStopping = mState == STOPPING;
if (!isStopping && mState != RESTARTING_PROCESS) {
- Slog.i(TAG, "Activity reported stop, but no longer stopping: " + this);
+ Slog.i(TAG, "Activity reported stop, but no longer stopping: " + this + " " + mState);
removeStopTimeout();
return;
}
@@ -5228,6 +5214,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
mRootWindowContainer.updatePreviousProcess(this);
}
}
+ mTaskSupervisor.checkReadyForSleepLocked(true /* allowDelay */);
}
}
@@ -5720,14 +5707,14 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
// First find the real culprit... if this activity has stopped, then the key dispatching
// timeout should not be caused by this.
if (stopped) {
- final Task stack = mRootWindowContainer.getTopDisplayFocusedRootTask();
- if (stack == null) {
+ final Task rootTask = mRootWindowContainer.getTopDisplayFocusedRootTask();
+ if (rootTask == null) {
return this;
}
// Try to use the one which is closest to top.
- ActivityRecord r = stack.getResumedActivity();
+ ActivityRecord r = rootTask.getResumedActivity();
if (r == null) {
- r = stack.mPausingActivity;
+ r = rootTask.getPausingActivity();
}
if (r != null) {
return r;
@@ -5805,9 +5792,8 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
// This would be redundant.
return false;
}
- final Task stack = getRootTask();
- if (isState(RESUMED) || stack == null || this == stack.mPausingActivity || !mHaveState
- || !stopped) {
+ if (isState(RESUMED) || getRootTask() == null || this == task.getPausingActivity()
+ || !mHaveState || !stopped) {
// We're not ready for this kind of thing.
return false;
}
diff --git a/services/core/java/com/android/server/wm/ActivityStarter.java b/services/core/java/com/android/server/wm/ActivityStarter.java
index 1ff3a3fb1d35..ecbf266c89cb 100644
--- a/services/core/java/com/android/server/wm/ActivityStarter.java
+++ b/services/core/java/com/android/server/wm/ActivityStarter.java
@@ -2647,7 +2647,11 @@ class ActivityStarter {
if (next != null) {
next.setCurrentLaunchCanTurnScreenOn(true);
}
- mRootWindowContainer.resumeFocusedTasksTopActivities(mTargetStack, null, mOptions);
+ if (mTargetStack.isFocusable()) {
+ mRootWindowContainer.resumeFocusedTasksTopActivities(mTargetStack, null, mOptions);
+ } else {
+ mRootWindowContainer.ensureActivitiesVisible(null, 0, !PRESERVE_WINDOWS);
+ }
} else {
ActivityOptions.abort(mOptions);
}
diff --git a/services/core/java/com/android/server/wm/ActivityTaskManagerService.java b/services/core/java/com/android/server/wm/ActivityTaskManagerService.java
index 9e7ddbaeb434..791d74afebdd 100644
--- a/services/core/java/com/android/server/wm/ActivityTaskManagerService.java
+++ b/services/core/java/com/android/server/wm/ActivityTaskManagerService.java
@@ -1133,9 +1133,10 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub {
synchronized (mGlobalLock) {
// If this is coming from the currently resumed activity, it is
// effectively saying that app switches are allowed at this point.
- final Task stack = getTopDisplayFocusedRootTask();
- if (stack != null && stack.mResumedActivity != null
- && stack.mResumedActivity.info.applicationInfo.uid == Binder.getCallingUid()) {
+ final Task topFocusedRootTask = getTopDisplayFocusedRootTask();
+ if (topFocusedRootTask != null && topFocusedRootTask.getResumedActivity() != null
+ && topFocusedRootTask.getResumedActivity().info.applicationInfo.uid
+ == Binder.getCallingUid()) {
mAppSwitchesAllowedTime = 0;
}
}
diff --git a/services/core/java/com/android/server/wm/ActivityTaskSupervisor.java b/services/core/java/com/android/server/wm/ActivityTaskSupervisor.java
index 370ee265bc00..400633c849ab 100644
--- a/services/core/java/com/android/server/wm/ActivityTaskSupervisor.java
+++ b/services/core/java/com/android/server/wm/ActivityTaskSupervisor.java
@@ -2066,7 +2066,7 @@ public class ActivityTaskSupervisor implements RecentTasks.Callbacks {
void updateTopResumedActivityIfNeeded() {
final ActivityRecord prevTopActivity = mTopResumedActivity;
final Task topStack = mRootWindowContainer.getTopDisplayFocusedRootTask();
- if (topStack == null || topStack.mResumedActivity == prevTopActivity) {
+ if (topStack == null || topStack.getResumedActivity() == prevTopActivity) {
if (mService.isSleepingLocked()) {
// There won't be a next resumed activity. The top process should still be updated
// according to the current top focused activity.
@@ -2088,7 +2088,7 @@ public class ActivityTaskSupervisor implements RecentTasks.Callbacks {
}
// Update the current top activity.
- mTopResumedActivity = topStack.mResumedActivity;
+ mTopResumedActivity = topStack.getResumedActivity();
scheduleTopResumedActivityStateIfNeeded();
mService.updateTopApp(mTopResumedActivity);
diff --git a/services/core/java/com/android/server/wm/AppTransition.java b/services/core/java/com/android/server/wm/AppTransition.java
index 758aaa0fee9a..605a23e065a5 100644
--- a/services/core/java/com/android/server/wm/AppTransition.java
+++ b/services/core/java/com/android/server/wm/AppTransition.java
@@ -17,7 +17,7 @@
package com.android.server.wm;
import static android.view.WindowManager.LayoutParams;
-import static android.view.WindowManager.TRANSIT_CHANGE_WINDOWING_MODE;
+import static android.view.WindowManager.TRANSIT_CHANGE;
import static android.view.WindowManager.TRANSIT_CLOSE;
import static android.view.WindowManager.TRANSIT_FLAG_APP_CRASHED;
import static android.view.WindowManager.TRANSIT_FLAG_KEYGUARD_GOING_AWAY_NO_ANIMATION;
@@ -2092,8 +2092,8 @@ public class AppTransition implements Dump {
case TRANSIT_RELAUNCH: {
return "TRANSIT_RELAUNCH";
}
- case TRANSIT_CHANGE_WINDOWING_MODE: {
- return "TRANSIT_CHANGE_WINDOWING_MODE";
+ case TRANSIT_CHANGE: {
+ return "TRANSIT_CHANGE";
}
case TRANSIT_KEYGUARD_GOING_AWAY: {
return "TRANSIT_KEYGUARD_GOING_AWAY";
diff --git a/services/core/java/com/android/server/wm/AppTransitionController.java b/services/core/java/com/android/server/wm/AppTransitionController.java
index 64cbb0dec635..dde527d161e0 100644
--- a/services/core/java/com/android/server/wm/AppTransitionController.java
+++ b/services/core/java/com/android/server/wm/AppTransitionController.java
@@ -17,7 +17,7 @@
package com.android.server.wm;
import static android.view.WindowManager.LayoutParams.FLAG_SHOW_WALLPAPER;
-import static android.view.WindowManager.TRANSIT_CHANGE_WINDOWING_MODE;
+import static android.view.WindowManager.TRANSIT_CHANGE;
import static android.view.WindowManager.TRANSIT_CLOSE;
import static android.view.WindowManager.TRANSIT_FLAG_APP_CRASHED;
import static android.view.WindowManager.TRANSIT_FLAG_KEYGUARD_GOING_AWAY_NO_ANIMATION;
@@ -303,7 +303,7 @@ public class AppTransitionController {
// Special transitions
// TODO(new-app-transitions): Revisit if those can be rewritten by using flags.
- if (appTransition.containsTransitRequest(TRANSIT_CHANGE_WINDOWING_MODE)) {
+ if (appTransition.containsTransitRequest(TRANSIT_CHANGE)) {
return TRANSIT_OLD_TASK_CHANGE_WINDOWING_MODE;
}
if ((flags & TRANSIT_FLAG_APP_CRASHED) != 0) {
diff --git a/services/core/java/com/android/server/wm/DisplayContent.java b/services/core/java/com/android/server/wm/DisplayContent.java
index 0678a5e4383b..8d6d981be2b8 100644
--- a/services/core/java/com/android/server/wm/DisplayContent.java
+++ b/services/core/java/com/android/server/wm/DisplayContent.java
@@ -80,6 +80,7 @@ import static android.view.WindowManager.TRANSIT_TO_FRONT;
import static android.window.DisplayAreaOrganizer.FEATURE_ROOT;
import static android.window.DisplayAreaOrganizer.FEATURE_WINDOWED_MAGNIFICATION;
+import static com.android.internal.protolog.ProtoLogGroup.WM_DEBUG_ADD_REMOVE;
import static com.android.internal.protolog.ProtoLogGroup.WM_DEBUG_APP_TRANSITIONS;
import static com.android.internal.protolog.ProtoLogGroup.WM_DEBUG_BOOT;
import static com.android.internal.protolog.ProtoLogGroup.WM_DEBUG_FOCUS;
@@ -552,24 +553,56 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
* This just indicates the window the input method is on top of, not
* necessarily the window its input is going to.
*/
- WindowState mInputMethodTarget;
+ private WindowState mImeLayeringTarget;
/**
* The window which receives input from the input method. This is also a candidate of the
* input method control target.
*/
- WindowState mInputMethodInputTarget;
+ private WindowState mImeInputTarget;
/**
* This controls the visibility and animation of the input method window.
*/
- InsetsControlTarget mInputMethodControlTarget;
+ private InsetsControlTarget mImeControlTarget;
+
+ /**
+ * Used by {@link #getImeTarget} to return the IME target which the input method window on
+ * top of for adjusting input method window surface layer Z-Ordering.
+ *
+ * @see #mImeLayeringTarget
+ */
+ static final int IME_TARGET_LAYERING = 0;
+
+ /**
+ * Used by {@link #getImeTarget} to return the IME target which received the input connection
+ * from IME.
+ *
+ * @see #mImeInputTarget
+ */
+ static final int IME_TARGET_INPUT = 1;
+
+ /**
+ * Used by {@link #getImeTarget} to return the IME target which controls the IME insets
+ * visibility and animation.
+ *
+ * @see #mImeControlTarget
+ */
+ static final int IME_TARGET_CONTROL = 2;
+
+ @IntDef(flag = false, prefix = { "IME_TARGET_" }, value = {
+ IME_TARGET_LAYERING,
+ IME_TARGET_INPUT,
+ IME_TARGET_CONTROL,
+ })
+ @Retention(RetentionPolicy.SOURCE)
+ @interface InputMethodTarget {}
/** The surface parent of the IME container. */
private SurfaceControl mInputMethodSurfaceParent;
- /** If true hold off on modifying the animation layer of mInputMethodTarget */
- boolean mInputMethodTargetWaitingAnim;
+ /** If {@code true} hold off on modifying the animation layer of {@link #mImeLayeringTarget} */
+ boolean mImeLayeringTargetWaitingAnim;
private final PointerEventDispatcher mPointerEventDispatcher;
@@ -814,7 +847,7 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
private final Consumer<WindowState> mApplyPostLayoutPolicy =
w -> getDisplayPolicy().applyPostLayoutPolicyLw(w, w.mAttrs, w.getParentWindow(),
- mInputMethodTarget);
+ mImeLayeringTarget);
private final Consumer<WindowState> mApplySurfaceChangesTransaction = w -> {
final WindowSurfacePlacer surfacePlacer = mWmService.mWindowPlacerLocked;
@@ -2256,13 +2289,15 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
@Nullable
Task getRootTask(int rootTaskId) {
- return getItemFromTaskDisplayAreas(taskDisplayArea ->
- taskDisplayArea.getRootTask(rootTaskId));
+ return getRootTask(rootTask -> rootTask.getRootTaskId() == rootTaskId);
}
- protected int getRootTaskCount() {
- return reduceOnAllTaskDisplayAreas((taskDisplayArea, count) ->
- count + taskDisplayArea.getRootTaskCount(), 0 /* initValue */);
+ int getRootTaskCount() {
+ final int[] count = new int[1];
+ forAllRootTasks(task -> {
+ count[0]++;
+ });
+ return count[0];
}
@VisibleForTesting
@@ -2831,7 +2866,7 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
}
void prepareFreezingTaskBounds() {
- forAllTaskDisplayAreas(TaskDisplayArea::prepareFreezingTaskBounds);
+ forAllRootTasks(Task::prepareFreezingTaskBounds);
}
void rotateBounds(int oldRotation, int newRotation, Rect bounds) {
@@ -2940,15 +2975,15 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
proto.write(FOCUSED_ROOT_TASK_ID, INVALID_TASK_ID);
}
proto.write(DISPLAY_READY, isReady());
- if (mInputMethodTarget != null) {
- mInputMethodTarget.dumpDebug(proto, INPUT_METHOD_TARGET, logLevel);
+ if (mImeLayeringTarget != null) {
+ mImeLayeringTarget.dumpDebug(proto, INPUT_METHOD_TARGET, logLevel);
}
- if (mInputMethodInputTarget != null) {
- mInputMethodInputTarget.dumpDebug(proto, INPUT_METHOD_INPUT_TARGET, logLevel);
+ if (mImeInputTarget != null) {
+ mImeInputTarget.dumpDebug(proto, INPUT_METHOD_INPUT_TARGET, logLevel);
}
- if (mInputMethodControlTarget != null
- && mInputMethodControlTarget.getWindow() != null) {
- mInputMethodControlTarget.getWindow().dumpDebug(proto, INPUT_METHOD_CONTROL_TARGET,
+ if (mImeControlTarget != null
+ && mImeControlTarget.getWindow() != null) {
+ mImeControlTarget.getWindow().dumpDebug(proto, INPUT_METHOD_CONTROL_TARGET,
logLevel);
}
if (mCurrentFocus != null) {
@@ -3204,7 +3239,7 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
boolean imWindowChanged = false;
final WindowState imWindow = mInputMethodWindow;
if (imWindow != null) {
- final WindowState prevTarget = mInputMethodTarget;
+ final WindowState prevTarget = mImeLayeringTarget;
final WindowState newTarget = computeImeTarget(true /* updateImeTarget*/);
imWindowChanged = prevTarget != newTarget;
@@ -3401,6 +3436,7 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
boolean destroyLeakedSurfaces() {
// Used to indicate that a surface was leaked.
mTmpWindow = null;
+ final Transaction t = mWmService.mTransactionFactory.get();
forAllWindows(w -> {
final WindowStateAnimator wsa = w.mWinAnimator;
if (wsa.mSurfaceController == null) {
@@ -3412,7 +3448,7 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
+ " token=" + w.mToken
+ " pid=" + w.mSession.mPid
+ " uid=" + w.mSession.mUid);
- wsa.destroySurface();
+ wsa.destroySurface(t);
mWmService.mForceRemoves.add(w);
mTmpWindow = w;
} else if (w.mActivityRecord != null && !w.mActivityRecord.isClientVisible()) {
@@ -3420,10 +3456,11 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
+ w + " surface=" + wsa.mSurfaceController
+ " token=" + w.mActivityRecord);
ProtoLog.i(WM_SHOW_TRANSACTIONS, "SURFACE LEAK DESTROY: %s", w);
- wsa.destroySurface();
+ wsa.destroySurface(t);
mTmpWindow = w;
}
}, false /* traverseTopToBottom */);
+ t.apply();
return mTmpWindow != null;
}
@@ -3456,7 +3493,7 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
}
/**
- * Determine and return the window that should be the IME target.
+ * Determine and return the window that should be the IME target for layering the IME window.
* @param updateImeTarget If true the system IME target will be updated to match what we found.
* @return The window that should be used as the IME target or null if there isn't any.
*/
@@ -3465,13 +3502,13 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
// There isn't an IME so there shouldn't be a target...That was easy!
if (updateImeTarget) {
if (DEBUG_INPUT_METHOD) Slog.w(TAG_WM, "Moving IM target from "
- + mInputMethodTarget + " to null since mInputMethodWindow is null");
- setInputMethodTarget(null, mInputMethodTargetWaitingAnim);
+ + mImeLayeringTarget + " to null since mInputMethodWindow is null");
+ setImeLayeringTarget(null, mImeLayeringTargetWaitingAnim);
}
return null;
}
- final WindowState curTarget = mInputMethodTarget;
+ final WindowState curTarget = mImeLayeringTarget;
if (!canUpdateImeTarget()) {
if (DEBUG_INPUT_METHOD) Slog.w(TAG_WM, "Defer updating IME target");
return curTarget;
@@ -3526,7 +3563,7 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
if (DEBUG_INPUT_METHOD) Slog.w(TAG_WM, "Moving IM target from " + curTarget
+ " to null." + (SHOW_STACK_CRAWLS ? " Callers="
+ Debug.getCallers(4) : ""));
- setInputMethodTarget(null, mInputMethodTargetWaitingAnim);
+ setImeLayeringTarget(null, mImeLayeringTargetWaitingAnim);
}
return null;
@@ -3553,7 +3590,7 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
if (mAppTransition.isTransitionSet()) {
// If we are currently setting up for an animation, hold everything until we
// can find out what will happen.
- setInputMethodTarget(highestTarget, true);
+ setImeLayeringTarget(highestTarget, true);
return highestTarget;
}
}
@@ -3561,7 +3598,7 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
if (DEBUG_INPUT_METHOD) Slog.w(TAG_WM, "Moving IM target from " + curTarget + " to "
+ target + (SHOW_STACK_CRAWLS ? " Callers=" + Debug.getCallers(4) : ""));
- setInputMethodTarget(target, false);
+ setImeLayeringTarget(target, false);
}
return target;
@@ -3572,24 +3609,24 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
* the candidate app window token if needed.
*/
void computeImeTargetIfNeeded(ActivityRecord candidate) {
- if (mInputMethodTarget != null && mInputMethodTarget.mActivityRecord == candidate) {
+ if (mImeLayeringTarget != null && mImeLayeringTarget.mActivityRecord == candidate) {
computeImeTarget(true /* updateImeTarget */);
}
}
private boolean isImeControlledByApp() {
- return mInputMethodInputTarget != null && !WindowConfiguration.isSplitScreenWindowingMode(
- mInputMethodInputTarget.getWindowingMode());
+ return mImeInputTarget != null && !WindowConfiguration.isSplitScreenWindowingMode(
+ mImeInputTarget.getWindowingMode());
}
boolean isImeAttachedToApp() {
return isImeControlledByApp()
- && mInputMethodTarget != null
- && mInputMethodTarget.mActivityRecord != null
- && mInputMethodTarget.getWindowingMode() == WINDOWING_MODE_FULLSCREEN
+ && mImeLayeringTarget != null
+ && mImeLayeringTarget.mActivityRecord != null
+ && mImeLayeringTarget.getWindowingMode() == WINDOWING_MODE_FULLSCREEN
// An activity with override bounds should be letterboxed inside its parent bounds,
// so it doesn't fill the screen.
- && mInputMethodTarget.mActivityRecord.matchParentBounds();
+ && mImeLayeringTarget.mActivityRecord.matchParentBounds();
}
/**
@@ -3616,6 +3653,24 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
return statusBar != null ? statusBar : defaultDc.mRemoteInsetsControlTarget;
}
+ /**
+ * Returns the corresponding IME insets control target according the IME target type.
+ *
+ * @param type The type of the IME target.
+ * @see #IME_TARGET_LAYERING
+ * @see #IME_TARGET_INPUT
+ * @see #IME_TARGET_CONTROL
+ */
+ InsetsControlTarget getImeTarget(@InputMethodTarget int type) {
+ switch (type) {
+ case IME_TARGET_LAYERING: return mImeLayeringTarget;
+ case IME_TARGET_INPUT: return mImeInputTarget;
+ case IME_TARGET_CONTROL: return mImeControlTarget;
+ default:
+ return null;
+ }
+ }
+
@DisplayImePolicy int getImePolicy() {
if (!isTrusted()) {
return DISPLAY_IME_POLICY_FALLBACK_DISPLAY;
@@ -3633,6 +3688,11 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
return mWmService.mForceDesktopModeOnExternalDisplays && !isDefaultDisplay && !isPrivate();
}
+ @VisibleForTesting
+ void setImeLayeringTarget(WindowState target) {
+ mImeLayeringTarget = target;
+ }
+
/**
* Sets the window the IME is on top of.
* @param target window to place the IME surface on top of. If {@code null}, the IME will be
@@ -3640,13 +3700,13 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
* @param targetWaitingAnim if {@code true}, hold off on modifying the animation layer of
* the target.
*/
- private void setInputMethodTarget(@Nullable WindowState target, boolean targetWaitingAnim) {
- if (target == mInputMethodTarget && mInputMethodTargetWaitingAnim == targetWaitingAnim) {
+ private void setImeLayeringTarget(@Nullable WindowState target, boolean targetWaitingAnim) {
+ if (target == mImeLayeringTarget && mImeLayeringTargetWaitingAnim == targetWaitingAnim) {
return;
}
ProtoLog.i(WM_DEBUG_IME, "setInputMethodTarget %s", target);
- mInputMethodTarget = target;
- mInputMethodTargetWaitingAnim = targetWaitingAnim;
+ mImeLayeringTarget = target;
+ mImeLayeringTargetWaitingAnim = targetWaitingAnim;
// 1. Reparent the IME container window to the target root DA to get the correct bounds and
// config. (Only happens when the target window is in a different root DA)
@@ -3668,23 +3728,33 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
updateImeControlTarget();
}
+ @VisibleForTesting
+ void setImeInputTarget(WindowState target) {
+ mImeInputTarget = target;
+ }
+
+ @VisibleForTesting
+ void setImeControlTarget(InsetsControlTarget target) {
+ mImeControlTarget = target;
+ }
+
/**
* The IME input target is the window which receives input from IME. It is also a candidate
* which controls the visibility and animation of the input method window.
*/
- void setInputMethodInputTarget(WindowState target) {
- if (mInputMethodInputTarget != target) {
+ void updateImeInputAndControlTarget(WindowState target) {
+ if (mImeInputTarget != target) {
ProtoLog.i(WM_DEBUG_IME, "setInputMethodInputTarget %s", target);
- mInputMethodInputTarget = target;
+ mImeInputTarget = target;
updateImeControlTarget();
}
}
void updateImeControlTarget() {
- mInputMethodControlTarget = computeImeControlTarget();
- mInsetsStateController.onImeControlTargetChanged(mInputMethodControlTarget);
+ mImeControlTarget = computeImeControlTarget();
+ mInsetsStateController.onImeControlTargetChanged(mImeControlTarget);
- final WindowState win = InsetsControlTarget.asWindowOrNull(mInputMethodControlTarget);
+ final WindowState win = InsetsControlTarget.asWindowOrNull(mImeControlTarget);
final IBinder token = win != null ? win.mClient.asBinder() : null;
// Note: not allowed to call into IMMS with the WM lock held, hence the post.
mWmService.mH.post(() ->
@@ -3707,12 +3777,12 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
@VisibleForTesting
InsetsControlTarget computeImeControlTarget() {
if (!isImeControlledByApp() && mRemoteInsetsControlTarget != null
- || (mInputMethodInputTarget != null
- && getImeHostOrFallback(mInputMethodInputTarget.getWindow())
+ || (mImeInputTarget != null
+ && getImeHostOrFallback(mImeInputTarget.getWindow())
== mRemoteInsetsControlTarget)) {
return mRemoteInsetsControlTarget;
} else {
- return mInputMethodInputTarget;
+ return mImeInputTarget;
}
}
@@ -3729,7 +3799,7 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
// screen. If it's not covering the entire screen the IME might extend beyond the apps
// bounds.
if (allowAttachToApp && isImeAttachedToApp()) {
- return mInputMethodTarget.mActivityRecord.getSurfaceControl();
+ return mImeLayeringTarget.mActivityRecord.getSurfaceControl();
}
// Otherwise, we just attach it to where the display area policy put it.
@@ -4186,8 +4256,11 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
}
// Initialize state of exiting applications.
- forAllTaskDisplayAreas(taskDisplayArea -> {
- taskDisplayArea.setExitingTokensHasVisible(hasVisible);
+ forAllRootTasks(task -> {
+ final ArrayList<ActivityRecord> activities = task.mExitingActivities;
+ for (int j = activities.size() - 1; j >= 0; --j) {
+ activities.get(j).hasVisible = hasVisible;
+ }
});
}
@@ -4200,7 +4273,22 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
}
// Time to remove any exiting applications?
- forAllTaskDisplayAreas(TaskDisplayArea::removeExistingAppTokensIfPossible);
+ forAllRootTasks(task -> {
+ final ArrayList<ActivityRecord> activities = task.mExitingActivities;
+ for (int j = activities.size() - 1; j >= 0; --j) {
+ final ActivityRecord activity = activities.get(j);
+ if (!activity.hasVisible && !mDisplayContent.mClosingApps.contains(activity)
+ && (!activity.mIsExiting || activity.isEmpty())) {
+ // Make sure there is no animation running on this activity, so any windows
+ // associated with it will be removed as soon as their animations are
+ // complete.
+ cancelAnimation();
+ ProtoLog.v(WM_DEBUG_ADD_REMOVE,
+ "performLayout: Activity exiting now removed %s", activity);
+ activity.removeIfPossible();
+ }
+ }
+ });
}
@Override
@@ -4350,7 +4438,7 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
private boolean skipImeWindowsDuringTraversal(DisplayContent dc) {
// We skip IME windows so they're processed just above their target, except
// in split-screen mode where we process the IME containers above the docked divider.
- return dc.mInputMethodTarget != null
+ return dc.getImeTarget(IME_TARGET_LAYERING) != null
&& !dc.getDefaultTaskDisplayArea().isSplitScreenModeActivated();
}
@@ -4465,7 +4553,7 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
@Override
void assignChildLayers(SurfaceControl.Transaction t) {
mImeWindowsContainers.setNeedsLayer();
- final WindowState imeTarget = mInputMethodTarget;
+ final WindowState imeTarget = mImeLayeringTarget;
// In the case where we have an IME target that is not in split-screen mode IME
// assignment is easy. We just need the IME to go directly above the target. This way
// children of the target will naturally go above the IME and everyone is happy.
@@ -5123,15 +5211,56 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
* ACTIVITY_TYPE_STANDARD or ACTIVITY_TYPE_UNDEFINED
*/
void removeRootTasksInWindowingModes(int... windowingModes) {
- forAllTaskDisplayAreas(taskDisplayArea -> {
- taskDisplayArea.removeRootTasksInWindowingModes(windowingModes);
+ if (windowingModes == null || windowingModes.length == 0) {
+ return;
+ }
+
+ // Collect the root tasks that are necessary to be removed instead of performing the removal
+ // by looping the children, so that we don't miss any root tasks after the children size
+ // changed or reordered.
+ final ArrayList<Task> rootTasks = new ArrayList<>();
+ forAllRootTasks(rootTask -> {
+ for (int windowingMode : windowingModes) {
+ if (rootTask.mCreatedByOrganizer
+ || rootTask.getWindowingMode() != windowingMode
+ || !rootTask.isActivityTypeStandardOrUndefined()) {
+ continue;
+ }
+ rootTasks.add(rootTask);
+ }
});
+ for (int i = rootTasks.size() - 1; i >= 0; --i) {
+ mRootWindowContainer.mTaskSupervisor.removeRootTask(rootTasks.get(i));
+ }
}
void removeRootTasksWithActivityTypes(int... activityTypes) {
- forAllTaskDisplayAreas(taskDisplayArea -> {
- taskDisplayArea.removeRootTasksWithActivityTypes(activityTypes);
+ if (activityTypes == null || activityTypes.length == 0) {
+ return;
+ }
+
+ // Collect the root tasks that are necessary to be removed instead of performing the removal
+ // by looping the children, so that we don't miss any root tasks after the children size
+ // changed or reordered.
+ final ArrayList<Task> rootTasks = new ArrayList<>();
+ forAllRootTasks(rootTask -> {
+ for (int activityType : activityTypes) {
+ // Collect the root tasks that are currently being organized.
+ if (rootTask.mCreatedByOrganizer) {
+ for (int k = rootTask.getChildCount() - 1; k >= 0; --k) {
+ final Task task = (Task) rootTask.getChildAt(k);
+ if (task.getActivityType() == activityType) {
+ rootTasks.add(task);
+ }
+ }
+ } else if (rootTask.getActivityType() == activityType) {
+ rootTasks.add(rootTask);
+ }
+ }
});
+ for (int i = rootTasks.size() - 1; i >= 0; --i) {
+ mRootWindowContainer.mTaskSupervisor.removeRootTask(rootTasks.get(i));
+ }
}
ActivityRecord topRunningActivity() {
@@ -5351,19 +5480,12 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
}
// Check if all task display areas have only the empty home stacks left.
- boolean hasNonEmptyHomeStack = forAllTaskDisplayAreas(taskDisplayArea -> {
- if (taskDisplayArea.getRootTaskCount() != 1) {
- return true;
- }
- final Task stack = taskDisplayArea.getRootTaskAt(0);
- return !stack.isActivityTypeHome() || stack.hasChild();
- });
- if (!hasNonEmptyHomeStack) {
+ boolean hasNonEmptyHomeStack = forAllRootTasks(stack ->
+ !stack.isActivityTypeHome() || stack.hasChild());
+ if (!hasNonEmptyHomeStack && getRootTaskCount() > 0) {
// Release this display if only empty home stack(s) are left. This display will be
// released along with the stack(s) removal.
- forAllTaskDisplayAreas(taskDisplayArea -> {
- taskDisplayArea.getRootTaskAt(0).removeIfPossible();
- });
+ forAllRootTasks(Task::removeIfPossible);
} else if (getTopRootTask() == null) {
removeIfPossible();
mRootWindowContainer.mTaskSupervisor
diff --git a/services/core/java/com/android/server/wm/ImeInsetsSourceProvider.java b/services/core/java/com/android/server/wm/ImeInsetsSourceProvider.java
index 91106eff9805..17c3b20c9e40 100644
--- a/services/core/java/com/android/server/wm/ImeInsetsSourceProvider.java
+++ b/services/core/java/com/android/server/wm/ImeInsetsSourceProvider.java
@@ -19,10 +19,14 @@ package com.android.server.wm;
import static android.os.Trace.TRACE_TAG_WINDOW_MANAGER;
import static com.android.internal.protolog.ProtoLogGroup.WM_DEBUG_IME;
+import static com.android.server.wm.DisplayContent.IME_TARGET_CONTROL;
+import static com.android.server.wm.DisplayContent.IME_TARGET_INPUT;
+import static com.android.server.wm.DisplayContent.IME_TARGET_LAYERING;
import static com.android.server.wm.ImeInsetsSourceProviderProto.IME_TARGET_FROM_IME;
import static com.android.server.wm.ImeInsetsSourceProviderProto.INSETS_SOURCE_PROVIDER;
import static com.android.server.wm.ImeInsetsSourceProviderProto.IS_IME_LAYOUT_DRAWN;
+import android.annotation.NonNull;
import android.os.Trace;
import android.util.proto.ProtoOutputStream;
import android.view.InsetsSource;
@@ -37,9 +41,9 @@ import java.io.PrintWriter;
* Controller for IME inset source on the server. It's called provider as it provides the
* {@link InsetsSource} to the client that uses it in {@link InsetsSourceConsumer}.
*/
-class ImeInsetsSourceProvider extends InsetsSourceProvider {
+final class ImeInsetsSourceProvider extends InsetsSourceProvider {
- private InsetsControlTarget mImeTargetFromIme;
+ private InsetsControlTarget mImeRequester;
private Runnable mShowImeRunner;
private boolean mIsImeLayoutDrawn;
private boolean mImeShowing;
@@ -56,12 +60,8 @@ class ImeInsetsSourceProvider extends InsetsSourceProvider {
* @param imeTarget imeTarget on which IME request is coming from.
*/
void scheduleShowImePostLayout(InsetsControlTarget imeTarget) {
- boolean targetChanged = mImeTargetFromIme != imeTarget
- && mImeTargetFromIme != null && imeTarget != null && mShowImeRunner != null
- && imeTarget.getWindow() != null && mImeTargetFromIme.getWindow() != null
- && mImeTargetFromIme.getWindow().mActivityRecord
- == imeTarget.getWindow().mActivityRecord;
- mImeTargetFromIme = imeTarget;
+ boolean targetChanged = isTargetChangedWithinActivity(imeTarget);
+ mImeRequester = imeTarget;
if (targetChanged) {
// target changed, check if new target can show IME.
ProtoLog.d(WM_DEBUG_IME, "IME target changed within ActivityRecord");
@@ -72,24 +72,24 @@ class ImeInsetsSourceProvider extends InsetsSourceProvider {
return;
}
- ProtoLog.d(WM_DEBUG_IME, "Schedule IME show for %s", mImeTargetFromIme.getWindow() == null
- ? mImeTargetFromIme : mImeTargetFromIme.getWindow().getName());
+ ProtoLog.d(WM_DEBUG_IME, "Schedule IME show for %s", mImeRequester.getWindow() == null
+ ? mImeRequester : mImeRequester.getWindow().getName());
mShowImeRunner = () -> {
ProtoLog.d(WM_DEBUG_IME, "Run showImeRunner");
// Target should still be the same.
- if (isImeTargetFromDisplayContentAndImeSame()) {
- final InsetsControlTarget target = mDisplayContent.mInputMethodControlTarget;
+ if (isReadyToShowIme()) {
+ final InsetsControlTarget target = mDisplayContent.getImeTarget(IME_TARGET_CONTROL);
ProtoLog.i(WM_DEBUG_IME, "call showInsets(ime) on %s",
target.getWindow() != null ? target.getWindow().getName() : "");
setImeShowing(true);
target.showInsets(WindowInsets.Type.ime(), true /* fromIme */);
Trace.asyncTraceEnd(TRACE_TAG_WINDOW_MANAGER, "WMS.showImePostLayout", 0);
- if (target != mImeTargetFromIme && mImeTargetFromIme != null) {
+ if (target != mImeRequester && mImeRequester != null) {
ProtoLog.w(WM_DEBUG_IME,
"showInsets(ime) was requested by different window: %s ",
- (mImeTargetFromIme.getWindow() != null
- ? mImeTargetFromIme.getWindow().getName() : ""));
+ (mImeRequester.getWindow() != null
+ ? mImeRequester.getWindow().getName() : ""));
}
}
abortShowImePostLayout();
@@ -100,8 +100,7 @@ class ImeInsetsSourceProvider extends InsetsSourceProvider {
void checkShowImePostLayout() {
// check if IME is drawn
if (mIsImeLayoutDrawn
- || (mImeTargetFromIme != null
- && isImeTargetFromDisplayContentAndImeSame()
+ || (isReadyToShowIme()
&& mWin != null
&& mWin.isDrawn()
&& !mWin.mGivenInsetsPending)) {
@@ -118,13 +117,13 @@ class ImeInsetsSourceProvider extends InsetsSourceProvider {
*/
void abortShowImePostLayout() {
ProtoLog.d(WM_DEBUG_IME, "abortShowImePostLayout");
- mImeTargetFromIme = null;
+ mImeRequester = null;
mIsImeLayoutDrawn = false;
mShowImeRunner = null;
}
@VisibleForTesting
- boolean isImeTargetFromDisplayContentAndImeSame() {
+ boolean isReadyToShowIme() {
// IMMS#mLastImeTargetWindow always considers focused window as
// IME target, however DisplayContent#computeImeTarget() can compute
// a different IME target.
@@ -134,35 +133,75 @@ class ImeInsetsSourceProvider extends InsetsSourceProvider {
// Also, if imeTarget is closing, it would be considered as outdated target.
// TODO(b/139861270): Remove the child & sublayer check once IMMS is aware of
// actual IME target.
- final WindowState dcTarget = mDisplayContent.mInputMethodTarget;
- final InsetsControlTarget controlTarget = mDisplayContent.mInputMethodControlTarget;
- if (dcTarget == null || mImeTargetFromIme == null) {
+ final InsetsControlTarget dcTarget = mDisplayContent.getImeTarget(IME_TARGET_LAYERING);
+ if (dcTarget == null || mImeRequester == null) {
return false;
}
- ProtoLog.d(WM_DEBUG_IME, "dcTarget: %s mImeTargetFromIme: %s",
- dcTarget.getName(), mImeTargetFromIme.getWindow() == null
- ? mImeTargetFromIme : mImeTargetFromIme.getWindow().getName());
-
- return (!dcTarget.isClosing() && mImeTargetFromIme == dcTarget)
- || (mImeTargetFromIme != null && mImeTargetFromIme.getWindow() != null
- && dcTarget.getParentWindow() == mImeTargetFromIme
- && dcTarget.mSubLayer > mImeTargetFromIme.getWindow().mSubLayer)
- || mImeTargetFromIme == mDisplayContent.getImeFallback()
- || mImeTargetFromIme == mDisplayContent.mInputMethodInputTarget
- || controlTarget == mImeTargetFromIme
- && (mImeTargetFromIme.getWindow() == null
- || !mImeTargetFromIme.getWindow().isClosing());
+ ProtoLog.d(WM_DEBUG_IME, "dcTarget: %s mImeRequester: %s",
+ dcTarget.getWindow().getName(), mImeRequester.getWindow() == null
+ ? mImeRequester : mImeRequester.getWindow().getName());
+
+ return isImeLayeringTarget(mImeRequester, dcTarget)
+ || isAboveImeLayeringTarget(mImeRequester, dcTarget)
+ || isImeFallbackTarget(mImeRequester)
+ || isImeInputTarget(mImeRequester)
+ || sameAsImeControlTarget();
}
+ // ---------------------------------------------------------------------------------------
+ // Methods for checking IME insets target changing state.
+ //
+ private static boolean isImeLayeringTarget(@NonNull InsetsControlTarget target,
+ @NonNull InsetsControlTarget dcTarget) {
+ return !dcTarget.getWindow().isClosing() && target == dcTarget;
+ }
+
+ private static boolean isAboveImeLayeringTarget(@NonNull InsetsControlTarget target,
+ @NonNull InsetsControlTarget dcTarget) {
+ return target.getWindow() != null
+ && dcTarget.getWindow().getParentWindow() == target
+ && dcTarget.getWindow().mSubLayer > target.getWindow().mSubLayer;
+ }
+
+ private boolean isImeFallbackTarget(InsetsControlTarget target) {
+ return target == mDisplayContent.getImeFallback();
+ }
+
+ private boolean isImeInputTarget(InsetsControlTarget target) {
+ return target == mDisplayContent.getImeTarget(IME_TARGET_INPUT);
+ }
+
+ private boolean sameAsImeControlTarget() {
+ final InsetsControlTarget target = mDisplayContent.getImeTarget(IME_TARGET_CONTROL);
+ return target == mImeRequester
+ && (mImeRequester.getWindow() == null
+ || !mImeRequester.getWindow().isClosing());
+ }
+
+ private boolean isTargetChangedWithinActivity(InsetsControlTarget target) {
+ // We don't consider the target out of the activity.
+ if (target == null || target.getWindow() == null) {
+ return false;
+ }
+ return mImeRequester != target
+ && mImeRequester != null && mShowImeRunner != null
+ && mImeRequester.getWindow() != null
+ && mImeRequester.getWindow().mActivityRecord
+ == target.getWindow().mActivityRecord;
+ }
+ // ---------------------------------------------------------------------------------------
+
@Override
public void dump(PrintWriter pw, String prefix) {
super.dump(pw, prefix);
pw.print(prefix);
pw.print("mImeShowing=");
pw.print(mImeShowing);
- if (mImeTargetFromIme != null) {
- pw.print(" showImePostLayout pending for mImeTargetFromIme=");
- pw.print(mImeTargetFromIme);
+ if (mImeRequester != null) {
+ pw.print(prefix);
+ pw.print("showImePostLayout pending for mImeRequester=");
+ pw.print(mImeRequester);
+ pw.println();
}
pw.println();
}
@@ -171,8 +210,8 @@ class ImeInsetsSourceProvider extends InsetsSourceProvider {
void dumpDebug(ProtoOutputStream proto, long fieldId, @WindowTraceLogLevel int logLevel) {
final long token = proto.start(fieldId);
super.dumpDebug(proto, INSETS_SOURCE_PROVIDER, logLevel);
- if (mImeTargetFromIme != null) {
- mImeTargetFromIme.getWindow().dumpDebug(proto, IME_TARGET_FROM_IME, logLevel);
+ if (mImeRequester != null) {
+ mImeRequester.getWindow().dumpDebug(proto, IME_TARGET_FROM_IME, logLevel);
}
proto.write(IS_IME_LAYOUT_DRAWN, mIsImeLayoutDrawn);
proto.end(token);
diff --git a/services/core/java/com/android/server/wm/KeyguardController.java b/services/core/java/com/android/server/wm/KeyguardController.java
index e45310a99fbd..57f263885ef2 100644
--- a/services/core/java/com/android/server/wm/KeyguardController.java
+++ b/services/core/java/com/android/server/wm/KeyguardController.java
@@ -594,16 +594,8 @@ class KeyguardController {
*/
@Nullable
private Task getRootTaskForControllingOccluding(DisplayContent display) {
- return display.getItemFromTaskDisplayAreas(taskDisplayArea -> {
- for (int sNdx = taskDisplayArea.getRootTaskCount() - 1; sNdx >= 0; --sNdx) {
- final Task task = taskDisplayArea.getRootTaskAt(sNdx);
- if (task != null && task.isFocusableAndVisible()
- && !task.inPinnedWindowingMode()) {
- return task;
- }
- }
- return null;
- });
+ return display.getRootTask(task ->
+ task != null && task.isFocusableAndVisible() && !task.inPinnedWindowingMode());
}
void dumpStatus(PrintWriter pw, String prefix) {
diff --git a/services/core/java/com/android/server/wm/RecentsAnimation.java b/services/core/java/com/android/server/wm/RecentsAnimation.java
index 067c772dad93..05dcd366dbac 100644
--- a/services/core/java/com/android/server/wm/RecentsAnimation.java
+++ b/services/core/java/com/android/server/wm/RecentsAnimation.java
@@ -468,14 +468,8 @@ class RecentsAnimation implements RecentsAnimationCallbacks, OnRootTaskOrderChan
* @return The top stack that is not always-on-top.
*/
private Task getTopNonAlwaysOnTopStack() {
- for (int i = mDefaultTaskDisplayArea.getRootTaskCount() - 1; i >= 0; i--) {
- final Task s = mDefaultTaskDisplayArea.getRootTaskAt(i);
- if (s.getWindowConfiguration().isAlwaysOnTop()) {
- continue;
- }
- return s;
- }
- return null;
+ return mDefaultTaskDisplayArea.getRootTask(task ->
+ !task.getWindowConfiguration().isAlwaysOnTop());
}
/**
diff --git a/services/core/java/com/android/server/wm/RecentsAnimationController.java b/services/core/java/com/android/server/wm/RecentsAnimationController.java
index 128c259926c7..edd01ebee42f 100644
--- a/services/core/java/com/android/server/wm/RecentsAnimationController.java
+++ b/services/core/java/com/android/server/wm/RecentsAnimationController.java
@@ -57,7 +57,9 @@ import android.view.WindowInsets.Type;
import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.inputmethod.SoftInputShowHideReason;
+import com.android.internal.os.BackgroundThread;
import com.android.internal.protolog.common.ProtoLog;
+import com.android.internal.util.LatencyTracker;
import com.android.internal.util.function.pooled.PooledConsumer;
import com.android.internal.util.function.pooled.PooledFunction;
import com.android.internal.util.function.pooled.PooledLambda;
@@ -84,6 +86,11 @@ import java.util.stream.Collectors;
public class RecentsAnimationController implements DeathRecipient {
private static final String TAG = RecentsAnimationController.class.getSimpleName();
private static final long FAILSAFE_DELAY = 1000;
+ /**
+ * If the recents animation is canceled before the delay since the window drawn, do not log the
+ * action because the duration is too small that may be just a mistouch,
+ */
+ private static final long LATENCY_TRACKER_LOG_DELAY_MS = 300;
public static final int REORDER_KEEP_IN_PLACE = 0;
public static final int REORDER_MOVE_TO_TOP = 1;
@@ -123,7 +130,7 @@ public class RecentsAnimationController implements DeathRecipient {
private boolean mPendingStart = true;
// Set when the animation has been canceled
- private boolean mCanceled;
+ private volatile boolean mCanceled;
// Whether or not the input consumer is enabled. The input consumer must be both registered and
// enabled for it to start intercepting touch events.
@@ -364,6 +371,9 @@ public class RecentsAnimationController implements DeathRecipient {
Binder.restoreCallingIdentity(token);
}
}
+
+ @Override
+ public void detachNavigationBarFromApp() {}
};
/**
@@ -592,6 +602,15 @@ public class RecentsAnimationController implements DeathRecipient {
return adapter.createRemoteAnimationTarget();
}
+ void logRecentsAnimationStartTime(int durationMs) {
+ BackgroundThread.getHandler().postDelayed(() -> {
+ if (!mCanceled) {
+ mService.mLatencyTracker.logAction(LatencyTracker.ACTION_START_RECENTS_ANIMATION,
+ durationMs);
+ }
+ }, LATENCY_TRACKER_LOG_DELAY_MS);
+ }
+
private boolean removeTaskInternal(int taskId) {
boolean result = false;
for (int i = mPendingAnimations.size() - 1; i >= 0; i--) {
@@ -996,7 +1015,7 @@ public class RecentsAnimationController implements DeathRecipient {
.setWindowCrop(taskSurface, mFinishBounds.width(), mFinishBounds.height())
.apply();
mFinishBounds.setEmpty();
- } else {
+ } else if (!mTask.isAttached()) {
// Apply the task's pending transaction in case it is detached and its transaction
// is not reachable.
mTask.getPendingTransaction().apply();
diff --git a/services/core/java/com/android/server/wm/RootWindowContainer.java b/services/core/java/com/android/server/wm/RootWindowContainer.java
index 497087a967f3..d652393dbdc1 100644
--- a/services/core/java/com/android/server/wm/RootWindowContainer.java
+++ b/services/core/java/com/android/server/wm/RootWindowContainer.java
@@ -778,7 +778,9 @@ class RootWindowContainer extends WindowContainer<DisplayContent>
if (surfaceController != null) {
ProtoLog.i(WM_SHOW_SURFACE_ALLOC,
"SURFACE RECOVER DESTROY: %s", winAnimator.mWin);
- winAnimator.destroySurface();
+ SurfaceControl.Transaction t = mWmService.mTransactionFactory.get();
+ winAnimator.destroySurface(t);
+ t.apply();
if (winAnimator.mWin.mActivityRecord != null) {
winAnimator.mWin.mActivityRecord.removeStartingWindow();
}
@@ -926,7 +928,7 @@ class RootWindowContainer extends WindowContainer<DisplayContent>
displayContent.pendingLayoutChanges |= FINISH_LAYOUT_REDO_WALLPAPER;
}
win.destroySurfaceUnchecked();
- win.mWinAnimator.destroyPreservedSurfaceLocked();
+ win.mWinAnimator.destroyPreservedSurfaceLocked(win.getSyncTransaction());
} while (i > 0);
mWmService.mDestroySurface.clear();
}
@@ -1833,19 +1835,15 @@ class RootWindowContainer extends WindowContainer<DisplayContent>
final ArrayList<IBinder> topActivityTokens = new ArrayList<>();
final Task topFocusedStack = getTopDisplayFocusedRootTask();
// Traverse all displays.
- forAllTaskDisplayAreas(taskDisplayArea -> {
- // Traverse all stacks on a display area.
- for (int sNdx = taskDisplayArea.getRootTaskCount() - 1; sNdx >= 0; --sNdx) {
- final Task stack = taskDisplayArea.getRootTaskAt(sNdx);
- // Get top activity from a visible stack and add it to the list.
- if (stack.shouldBeVisible(null /* starting */)) {
- final ActivityRecord top = stack.getTopNonFinishingActivity();
- if (top != null) {
- if (stack == topFocusedStack) {
- topActivityTokens.add(0, top.appToken);
- } else {
- topActivityTokens.add(top.appToken);
- }
+ forAllRootTasks(stack -> {
+ // Get top activity from a visible stack and add it to the list.
+ if (stack.shouldBeVisible(null /* starting */)) {
+ final ActivityRecord top = stack.getTopNonFinishingActivity();
+ if (top != null) {
+ if (stack == topFocusedStack) {
+ topActivityTokens.add(0, top.appToken);
+ } else {
+ topActivityTokens.add(top.appToken);
}
}
}
@@ -1890,21 +1888,17 @@ class RootWindowContainer extends WindowContainer<DisplayContent>
// First, found out what is currently the foreground app, so that we don't blow away the
// previous app if this activity is being hosted by the process that is actually still the
// foreground.
- WindowProcessController fgApp = reduceOnAllTaskDisplayAreas((taskDisplayArea, app) -> {
- for (int sNdx = taskDisplayArea.getRootTaskCount() - 1; sNdx >= 0; --sNdx) {
- final Task stack = taskDisplayArea.getRootTaskAt(sNdx);
- if (isTopDisplayFocusedRootTask(stack)) {
- final ActivityRecord resumedActivity = stack.getResumedActivity();
- if (resumedActivity != null) {
- app = resumedActivity.app;
- } else if (stack.mPausingActivity != null) {
- app = stack.mPausingActivity.app;
- }
- break;
+ WindowProcessController fgApp = getItemFromRootTasks(rootTask -> {
+ if (isTopDisplayFocusedRootTask(rootTask)) {
+ final ActivityRecord resumedActivity = rootTask.getResumedActivity();
+ if (resumedActivity != null) {
+ return resumedActivity.app;
+ } else if (rootTask.getPausingActivity() != null) {
+ return rootTask.getPausingActivity().app;
}
}
- return app;
- }, null /* initValue */);
+ return null;
+ });
// Now set this one as the previous process, only if that really makes sense to.
if (r.hasProcess() && fgApp != null && r.app != fgApp
@@ -1921,27 +1915,21 @@ class RootWindowContainer extends WindowContainer<DisplayContent>
mTmpRemoteException = null;
mTmpBoolean = false; // Set to true if an activity was started.
final DisplayContent display = getChildAt(displayNdx);
- display.forAllTaskDisplayAreas(displayArea -> {
+ display.forAllRootTasks(rootTask -> {
if (mTmpRemoteException != null) {
return;
}
- for (int taskNdx = displayArea.getRootTaskCount() - 1; taskNdx >= 0; --taskNdx) {
- final Task rootTask = displayArea.getRootTaskAt(taskNdx);
- if (rootTask.getVisibility(null /*starting*/) == TASK_VISIBILITY_INVISIBLE) {
- break;
- }
-
- final PooledFunction c = PooledLambda.obtainFunction(
- RootWindowContainer::startActivityForAttachedApplicationIfNeeded, this,
- PooledLambda.__(ActivityRecord.class), app,
- rootTask.topRunningActivity());
- rootTask.forAllActivities(c);
- c.recycle();
- if (mTmpRemoteException != null) {
- return;
- }
+ if (rootTask.getVisibility(null /*starting*/) == TASK_VISIBILITY_INVISIBLE) {
+ return;
}
+
+ final PooledFunction c = PooledLambda.obtainFunction(
+ RootWindowContainer::startActivityForAttachedApplicationIfNeeded, this,
+ PooledLambda.__(ActivityRecord.class), app,
+ rootTask.topRunningActivity());
+ rootTask.forAllActivities(c);
+ c.recycle();
});
if (mTmpRemoteException != null) {
throw mTmpRemoteException;
@@ -2025,11 +2013,8 @@ class RootWindowContainer extends WindowContainer<DisplayContent>
mCurrentUser = userId;
mTaskSupervisor.mStartingUsers.add(uss);
- forAllTaskDisplayAreas(taskDisplayArea -> {
- for (int sNdx = taskDisplayArea.getRootTaskCount() - 1; sNdx >= 0; --sNdx) {
- final Task stack = taskDisplayArea.getRootTaskAt(sNdx);
- stack.switchUser(userId);
- }
+ forAllRootTasks(stack -> {
+ stack.switchUser(userId);
});
final int restoreStackId = mUserRootTaskInFront.get(userId);
@@ -2292,20 +2277,14 @@ class RootWindowContainer extends WindowContainer<DisplayContent>
*/
int finishTopCrashedActivities(WindowProcessController app, String reason) {
Task focusedStack = getTopDisplayFocusedRootTask();
- Task finishedTask = reduceOnAllTaskDisplayAreas((taskDisplayArea, task) -> {
- // It is possible that request to finish activity might also remove its task and
- // stack, so we need to be careful with indexes in the loop and check child count
- // every time.
- for (int stackNdx = 0; stackNdx < taskDisplayArea.getRootTaskCount(); ++stackNdx) {
- final Task stack = taskDisplayArea.getRootTaskAt(stackNdx);
- final Task t = stack.finishTopCrashedActivityLocked(app, reason);
- if (stack == focusedStack || task == null) {
- task = t;
- }
+ final Task[] finishedTask = new Task[1];
+ forAllTasks(stack -> {
+ final Task t = stack.finishTopCrashedActivityLocked(app, reason);
+ if (stack == focusedStack || finishedTask[0] == null) {
+ finishedTask[0] = t;
}
- return task;
- }, null /* initValue */);
- return finishedTask != null ? finishedTask.mTaskId : INVALID_TASK_ID;
+ });
+ return finishedTask[0] != null ? finishedTask[0].mTaskId : INVALID_TASK_ID;
}
boolean resumeFocusedTasksTopActivities() {
@@ -2328,36 +2307,32 @@ class RootWindowContainer extends WindowContainer<DisplayContent>
for (int displayNdx = getChildCount() - 1; displayNdx >= 0; --displayNdx) {
final DisplayContent display = getChildAt(displayNdx);
final boolean curResult = result;
- boolean resumedOnDisplay = display.reduceOnAllTaskDisplayAreas(
- (taskDisplayArea, resumed) -> {
- for (int sNdx = taskDisplayArea.getRootTaskCount() - 1; sNdx >= 0; --sNdx) {
- final Task rootTask = taskDisplayArea.getRootTaskAt(sNdx);
- final ActivityRecord topRunningActivity = rootTask.topRunningActivity();
- if (!rootTask.isFocusableAndVisible() || topRunningActivity == null) {
- continue;
- }
- if (rootTask == targetRootTask) {
- // Simply update the result for targetStack because the targetStack
- // had already resumed in above. We don't want to resume it again,
- // especially in some cases, it would cause a second launch failure
- // if app process was dead.
- resumed |= curResult;
- continue;
- }
- if (taskDisplayArea.isTopRootTask(rootTask)
- && topRunningActivity.isState(RESUMED)) {
- // Kick off any lingering app transitions form the MoveTaskToFront
- // operation, but only consider the top task and stack on that
- // display.
- rootTask.executeAppTransition(targetOptions);
- } else {
- resumed |= topRunningActivity.makeActiveIfNeeded(target);
- }
- }
- return resumed;
- }, false /* initValue */);
- result |= resumedOnDisplay;
- if (!resumedOnDisplay) {
+ boolean[] resumedOnDisplay = new boolean[1];
+ display.forAllRootTasks(rootTask -> {
+ final ActivityRecord topRunningActivity = rootTask.topRunningActivity();
+ if (!rootTask.isFocusableAndVisible() || topRunningActivity == null) {
+ return;
+ }
+ if (rootTask == targetRootTask) {
+ // Simply update the result for targetStack because the targetStack
+ // had already resumed in above. We don't want to resume it again,
+ // especially in some cases, it would cause a second launch failure
+ // if app process was dead.
+ resumedOnDisplay[0] |= curResult;
+ return;
+ }
+ if (rootTask.getDisplayArea().isTopRootTask(rootTask)
+ && topRunningActivity.isState(RESUMED)) {
+ // Kick off any lingering app transitions form the MoveTaskToFront
+ // operation, but only consider the top task and stack on that
+ // display.
+ rootTask.executeAppTransition(targetOptions);
+ } else {
+ resumedOnDisplay[0] |= topRunningActivity.makeActiveIfNeeded(target);
+ }
+ });
+ result |= resumedOnDisplay[0];
+ if (!resumedOnDisplay[0]) {
// In cases when there are no valid activities (e.g. device just booted or launcher
// crashed) it's possible that nothing was resumed on a display. Requesting resume
// of top activity in focused stack explicitly will make sure that at least home
@@ -2390,30 +2365,27 @@ class RootWindowContainer extends WindowContainer<DisplayContent>
}
// Set the sleeping state of the stacks on the display.
- display.forAllTaskDisplayAreas(taskDisplayArea -> {
- for (int sNdx = taskDisplayArea.getRootTaskCount() - 1; sNdx >= 0; --sNdx) {
- final Task stack = taskDisplayArea.getRootTaskAt(sNdx);
- if (displayShouldSleep) {
- stack.goToSleepIfPossible(false /* shuttingDown */);
- } else {
- stack.awakeFromSleepingLocked();
- if (stack.isFocusedStackOnDisplay()
- && !mTaskSupervisor.getKeyguardController()
- .isKeyguardOrAodShowing(display.mDisplayId)) {
- // If the keyguard is unlocked - resume immediately.
- // It is possible that the display will not be awake at the time we
- // process the keyguard going away, which can happen before the sleep
- // token is released. As a result, it is important we resume the
- // activity here.
- stack.resumeTopActivityUncheckedLocked(null, null);
- }
- // The visibility update must not be called before resuming the top, so the
- // display orientation can be updated first if needed. Otherwise there may
- // have redundant configuration changes due to apply outdated display
- // orientation (from keyguard) to activity.
- stack.ensureActivitiesVisible(null /* starting */, 0 /* configChanges */,
- false /* preserveWindows */);
+ display.forAllRootTasks(stack -> {
+ if (displayShouldSleep) {
+ stack.goToSleepIfPossible(false /* shuttingDown */);
+ } else {
+ stack.awakeFromSleepingLocked();
+ if (stack.isFocusedStackOnDisplay()
+ && !mTaskSupervisor.getKeyguardController()
+ .isKeyguardOrAodShowing(display.mDisplayId)) {
+ // If the keyguard is unlocked - resume immediately.
+ // It is possible that the display will not be awake at the time we
+ // process the keyguard going away, which can happen before the sleep
+ // token is released. As a result, it is important we resume the
+ // activity here.
+ stack.resumeTopActivityUncheckedLocked(null, null);
}
+ // The visibility update must not be called before resuming the top, so the
+ // display orientation can be updated first if needed. Otherwise there may
+ // have redundant configuration changes due to apply outdated display
+ // orientation (from keyguard) to activity.
+ stack.ensureActivitiesVisible(null /* starting */, 0 /* configChanges */,
+ false /* preserveWindows */);
}
});
}
@@ -2510,13 +2482,10 @@ class RootWindowContainer extends WindowContainer<DisplayContent>
/** If displayId == INVALID_DISPLAY, this will get root task infos on all displays */
ArrayList<RootTaskInfo> getAllRootTaskInfos(int displayId) {
- ArrayList<RootTaskInfo> list = new ArrayList<>();
+ final ArrayList<RootTaskInfo> list = new ArrayList<>();
if (displayId == INVALID_DISPLAY) {
- forAllTaskDisplayAreas(taskDisplayArea -> {
- for (int sNdx = taskDisplayArea.getRootTaskCount() - 1; sNdx >= 0; --sNdx) {
- final Task stack = taskDisplayArea.getRootTaskAt(sNdx);
- list.add(getRootTaskInfo(stack));
- }
+ forAllRootTasks(stack -> {
+ list.add(getRootTaskInfo(stack));
});
return list;
}
@@ -2524,11 +2493,8 @@ class RootWindowContainer extends WindowContainer<DisplayContent>
if (display == null) {
return list;
}
- display.forAllTaskDisplayAreas(taskDisplayArea -> {
- for (int sNdx = taskDisplayArea.getRootTaskCount() - 1; sNdx >= 0; --sNdx) {
- final Task stack = taskDisplayArea.getRootTaskAt(sNdx);
- list.add(getRootTaskInfo(stack));
- }
+ display.forAllRootTasks(stack -> {
+ list.add(getRootTaskInfo(stack));
});
return list;
}
@@ -2601,10 +2567,17 @@ class RootWindowContainer extends WindowContainer<DisplayContent>
Task findRootTaskBehind(Task rootTask) {
final TaskDisplayArea taskDisplayArea = rootTask.getDisplayArea();
if (taskDisplayArea != null) {
- for (int i = taskDisplayArea.getRootTaskCount() - 1; i >= 0; i--) {
- if (taskDisplayArea.getRootTaskAt(i) == rootTask && i > 0) {
- return taskDisplayArea.getRootTaskAt(i - 1);
+ final boolean[] hasFound = new boolean[1];
+ // TODO(b/175136051): should this be only the direct child root task?
+ final Task rootTaskBehind = taskDisplayArea.getRootTask(task -> {
+ if (hasFound[0]) {
+ return true;
}
+ hasFound[0] = task == rootTask;
+ return false;
+ });
+ if (rootTaskBehind != null) {
+ return rootTaskBehind;
}
}
throw new IllegalStateException("Failed to find a root task behind root task =" + rootTask
@@ -2736,8 +2709,9 @@ class RootWindowContainer extends WindowContainer<DisplayContent>
if (DEBUG_SWITCH) {
Slog.v(TAG_SWITCH, "Destroying " + r + " in state " + r.getState()
- + " resumed=" + r.getStack().mResumedActivity + " pausing="
- + r.getStack().mPausingActivity + " for reason " + mDestroyAllActivitiesReason);
+ + " resumed=" + r.getTask().getResumedActivity() + " pausing="
+ + r.getTask().getPausingActivity() + " for reason "
+ + mDestroyAllActivitiesReason);
}
r.destroyImmediately(mDestroyAllActivitiesReason);
@@ -2746,24 +2720,16 @@ class RootWindowContainer extends WindowContainer<DisplayContent>
// Tries to put all activity tasks to sleep. Returns true if all tasks were
// successfully put to sleep.
boolean putTasksToSleep(boolean allowDelay, boolean shuttingDown) {
- return reduceOnAllTaskDisplayAreas((taskDisplayArea, result) -> {
- for (int sNdx = taskDisplayArea.getRootTaskCount() - 1; sNdx >= 0; --sNdx) {
- // Stacks and activities could be removed while putting activities to sleep if
- // the app process was gone. This prevents us getting exception by accessing an
- // invalid stack index.
- if (sNdx >= taskDisplayArea.getRootTaskCount()) {
- continue;
- }
- final Task task = taskDisplayArea.getRootTaskAt(sNdx);
- if (allowDelay) {
- result &= task.goToSleepIfPossible(shuttingDown);
- } else {
- task.ensureActivitiesVisible(null /* starting */, 0 /* configChanges */,
- !PRESERVE_WINDOWS);
- }
+ final boolean[] result = {true};
+ forAllRootTasks(task -> {
+ if (allowDelay) {
+ result[0] &= task.goToSleepIfPossible(shuttingDown);
+ } else {
+ task.ensureActivitiesVisible(null /* starting */, 0 /* configChanges */,
+ !PRESERVE_WINDOWS);
}
- return result;
- }, true /* initValue */);
+ });
+ return result[0];
}
void handleAppCrash(WindowProcessController app) {
@@ -3019,11 +2985,11 @@ class RootWindowContainer extends WindowContainer<DisplayContent>
r.getActivityType());
// Return the topmost valid stack on the display.
- for (int i = taskDisplayArea.getRootTaskCount() - 1; i >= 0; --i) {
- final Task stack = taskDisplayArea.getRootTaskAt(i);
- if (isValidLaunchRootTask(stack, r, windowingMode)) {
- return stack;
- }
+ final int targetWindowingMode = windowingMode;
+ final Task topmostValidStack = taskDisplayArea.getRootTask(stack ->
+ isValidLaunchRootTask(stack, r, targetWindowingMode));
+ if (topmostValidStack != null) {
+ return topmostValidStack;
}
// If there is no valid stack on the secondary display area - check if new dynamic stack
@@ -3258,12 +3224,8 @@ class RootWindowContainer extends WindowContainer<DisplayContent>
}
void finishVoiceTask(IVoiceInteractionSession session) {
- forAllTaskDisplayAreas(taskDisplayArea -> {
- final int numStacks = taskDisplayArea.getRootTaskCount();
- for (int stackNdx = 0; stackNdx < numStacks; ++stackNdx) {
- final Task stack = taskDisplayArea.getRootTaskAt(stackNdx);
- stack.finishVoiceTask(session);
- }
+ forAllRootTasks(stack -> {
+ stack.finishVoiceTask(session);
});
}
@@ -3322,20 +3284,16 @@ class RootWindowContainer extends WindowContainer<DisplayContent>
boolean allResumedActivitiesVisible() {
boolean[] foundResumed = {false};
- final boolean foundInvisibleResumedActivity = forAllTaskDisplayAreas(
- taskDisplayArea -> {
- for (int sNdx = taskDisplayArea.getRootTaskCount() - 1; sNdx >= 0; --sNdx) {
- final Task stack = taskDisplayArea.getRootTaskAt(sNdx);
- final ActivityRecord r = stack.getResumedActivity();
- if (r != null) {
- if (!r.nowVisible) {
- return true;
- }
- foundResumed[0] = true;
- }
- }
- return false;
- });
+ final boolean foundInvisibleResumedActivity = forAllRootTasks(stack -> {
+ final ActivityRecord r = stack.getResumedActivity();
+ if (r != null) {
+ if (!r.nowVisible) {
+ return true;
+ }
+ foundResumed[0] = true;
+ }
+ return false;
+ });
if (foundInvisibleResumedActivity) {
return false;
}
@@ -3344,23 +3302,19 @@ class RootWindowContainer extends WindowContainer<DisplayContent>
boolean allPausedActivitiesComplete() {
boolean[] pausing = {true};
- final boolean hasActivityNotCompleted = forAllTaskDisplayAreas(
- taskDisplayArea -> {
- for (int sNdx = taskDisplayArea.getRootTaskCount() - 1; sNdx >= 0; --sNdx) {
- final Task stack = taskDisplayArea.getRootTaskAt(sNdx);
- final ActivityRecord r = stack.mPausingActivity;
- if (r != null && !r.isState(PAUSED, STOPPED, STOPPING, FINISHING)) {
- ProtoLog.d(WM_DEBUG_STATES, "allPausedActivitiesComplete: "
- + "r=%s state=%s", r, r.getState());
- if (WM_DEBUG_STATES.isEnabled()) {
- pausing[0] = false;
- } else {
- return true;
- }
- }
- }
- return false;
- });
+ final boolean hasActivityNotCompleted = forAllLeafTasks(task -> {
+ final ActivityRecord r = task.getPausingActivity();
+ if (r != null && !r.isState(PAUSED, STOPPED, STOPPING, FINISHING)) {
+ ProtoLog.d(WM_DEBUG_STATES, "allPausedActivitiesComplete: "
+ + "r=%s state=%s", r, r.getState());
+ if (WM_DEBUG_STATES.isEnabled()) {
+ pausing[0] = false;
+ } else {
+ return true;
+ }
+ }
+ return false;
+ });
if (hasActivityNotCompleted) {
return false;
}
@@ -3411,13 +3365,10 @@ class RootWindowContainer extends WindowContainer<DisplayContent>
}
void cancelInitializingActivities() {
- forAllTaskDisplayAreas(taskDisplayArea -> {
- for (int sNdx = taskDisplayArea.getRootTaskCount() - 1; sNdx >= 0; --sNdx) {
- // We don't want to clear starting window for activities that aren't occluded
- // as we need to display their starting window until they are done initializing.
- taskDisplayArea.getRootTaskAt(sNdx).forAllOccludedActivities(
- ActivityRecord::cancelInitializing);
- }
+ forAllRootTasks(task -> {
+ // We don't want to clear starting window for activities that aren't occluded
+ // as we need to display their starting window until they are done initializing.
+ task.forAllOccludedActivities(ActivityRecord::cancelInitializing);
});
}
@@ -3577,13 +3528,10 @@ class RootWindowContainer extends WindowContainer<DisplayContent>
return new ArrayList<>();
}
} else {
- ArrayList<ActivityRecord> activities = new ArrayList<>();
- forAllTaskDisplayAreas(taskDisplayArea -> {
- for (int sNdx = taskDisplayArea.getRootTaskCount() - 1; sNdx >= 0; --sNdx) {
- final Task stack = taskDisplayArea.getRootTaskAt(sNdx);
- if (!dumpVisibleStacksOnly || stack.shouldBeVisible(null)) {
- activities.addAll(stack.getDumpActivitiesLocked(name));
- }
+ final ArrayList<ActivityRecord> activities = new ArrayList<>();
+ forAllRootTasks(stack -> {
+ if (!dumpVisibleStacksOnly || stack.shouldBeVisible(null)) {
+ activities.addAll(stack.getDumpActivitiesLocked(name));
}
});
return activities;
@@ -3633,15 +3581,12 @@ class RootWindowContainer extends WindowContainer<DisplayContent>
pw.print("Display #");
pw.print(displayContent.mDisplayId);
pw.println(" (activities from top to bottom):");
- displayContent.forAllTaskDisplayAreas(taskDisplayArea -> {
- for (int sNdx = taskDisplayArea.getRootTaskCount() - 1; sNdx >= 0; --sNdx) {
- final Task stack = taskDisplayArea.getRootTaskAt(sNdx);
- if (needSep[0]) {
- pw.println();
- }
- needSep[0] = stack.dump(fd, pw, dumpAll, dumpClient, dumpPackage, false);
- printed[0] |= needSep[0];
+ displayContent.forAllRootTasks(stack -> {
+ if (needSep[0]) {
+ pw.println();
}
+ needSep[0] = stack.dump(fd, pw, dumpAll, dumpClient, dumpPackage, false);
+ printed[0] |= needSep[0];
});
displayContent.forAllTaskDisplayAreas(taskDisplayArea -> {
printed[0] |= printThisActivity(pw, taskDisplayArea.getFocusedActivity(),
diff --git a/services/core/java/com/android/server/wm/Session.java b/services/core/java/com/android/server/wm/Session.java
index c414c6421dc8..57d48c6bb9f4 100644
--- a/services/core/java/com/android/server/wm/Session.java
+++ b/services/core/java/com/android/server/wm/Session.java
@@ -18,6 +18,7 @@ package com.android.server.wm;
import static android.Manifest.permission.DEVICE_POWER;
import static android.Manifest.permission.HIDE_NON_SYSTEM_OVERLAY_WINDOWS;
+import static android.Manifest.permission.HIDE_OVERLAY_WINDOWS;
import static android.Manifest.permission.INTERNAL_SYSTEM_WINDOW;
import static android.Manifest.permission.START_TASKS_FROM_RECENTS;
import static android.app.ActivityTaskManager.INVALID_TASK_ID;
@@ -124,7 +125,9 @@ class Session extends IWindowSession.Stub implements IBinder.DeathRecipient {
mCanAddInternalSystemWindow = service.mContext.checkCallingOrSelfPermission(
INTERNAL_SYSTEM_WINDOW) == PERMISSION_GRANTED;
mCanHideNonSystemOverlayWindows = service.mContext.checkCallingOrSelfPermission(
- HIDE_NON_SYSTEM_OVERLAY_WINDOWS) == PERMISSION_GRANTED;
+ HIDE_NON_SYSTEM_OVERLAY_WINDOWS) == PERMISSION_GRANTED
+ || service.mContext.checkCallingOrSelfPermission(HIDE_OVERLAY_WINDOWS)
+ == PERMISSION_GRANTED;
mOverlaysCanBeHidden = !mCanAddInternalSystemWindow
&& !mService.mAtmInternal.isCallerRecents(mUid);
mCanAcquireSleepToken = service.mContext.checkCallingOrSelfPermission(DEVICE_POWER)
diff --git a/services/core/java/com/android/server/wm/SurfaceAnimationRunner.java b/services/core/java/com/android/server/wm/SurfaceAnimationRunner.java
index 34d084a3f9f8..92e2ee6f8af9 100644
--- a/services/core/java/com/android/server/wm/SurfaceAnimationRunner.java
+++ b/services/core/java/com/android/server/wm/SurfaceAnimationRunner.java
@@ -259,6 +259,7 @@ class SurfaceAnimationRunner {
private void applyTransaction() {
mFrameTransaction.setAnimationTransaction();
+ mFrameTransaction.setFrameTimelineVsync(mChoreographer.getVsyncId());
mFrameTransaction.apply();
mApplyScheduled = false;
}
diff --git a/services/core/java/com/android/server/wm/Task.java b/services/core/java/com/android/server/wm/Task.java
index 8564cbc02df8..69723ff99d06 100644
--- a/services/core/java/com/android/server/wm/Task.java
+++ b/services/core/java/com/android/server/wm/Task.java
@@ -59,7 +59,7 @@ import static android.provider.Settings.Secure.USER_SETUP_COMPLETE;
import static android.view.Display.DEFAULT_DISPLAY;
import static android.view.Display.INVALID_DISPLAY;
import static android.view.SurfaceControl.METADATA_TASK_ID;
-import static android.view.WindowManager.TRANSIT_CHANGE_WINDOWING_MODE;
+import static android.view.WindowManager.TRANSIT_CHANGE;
import static android.view.WindowManager.TRANSIT_CLOSE;
import static android.view.WindowManager.TRANSIT_FLAG_APP_CRASHED;
import static android.view.WindowManager.TRANSIT_FLAG_OPEN_BEHIND;
@@ -514,16 +514,6 @@ class Task extends WindowContainer<WindowContainer> {
// {@link ActivityInfo#FLAG_SUPPORTS_PICTURE_IN_PICTURE} flag of the root activity.
boolean mSupportsPictureInPicture;
- // Activity bounds if this task or its top activity is presented in letterbox mode and
- // {@code null} otherwise.
- @Nullable
- private Rect mLetterboxActivityBounds;
-
- // Activity insets if this task or its top activity is presented in letterbox mode and
- // {@code null} otherwise.
- @Nullable
- private Rect mLetterboxActivityInsets;
-
// Whether the task is currently being drag-resized
private boolean mDragResizing;
private int mDragResizeMode;
@@ -553,8 +543,11 @@ class Task extends WindowContainer<WindowContainer> {
/**
* When we are in the process of pausing an activity, before starting the
* next one, this variable holds the activity that is currently being paused.
+ *
+ * Only set at leaf tasks.
*/
- ActivityRecord mPausingActivity = null;
+ @Nullable
+ private ActivityRecord mPausingActivity = null;
/**
* This is the last activity that we put into the paused state. This is
@@ -570,8 +563,12 @@ class Task extends WindowContainer<WindowContainer> {
*/
ActivityRecord mLastNoHistoryActivity = null;
- /** Current activity that is resumed, or null if there is none. */
- ActivityRecord mResumedActivity = null;
+ /**
+ * Current activity that is resumed, or null if there is none.
+ * Only set at leaf tasks.
+ */
+ @Nullable
+ private ActivityRecord mResumedActivity = null;
/** Last activity that is used to compute the Task bounds. */
@Nullable
@@ -1111,14 +1108,6 @@ class Task extends WindowContainer<WindowContainer> {
return false;
}
- final boolean toTopOfStack = position == MAX_VALUE;
- if (toTopOfStack && toStack.getResumedActivity() != null
- && toStack.topRunningActivity() != null) {
- // Pause the resumed activity on the target stack while re-parenting task on top of it.
- toStack.startPausingLocked(false /* userLeaving */, false /* uiSleeping */,
- null /* resuming */, "reparent");
- }
-
final int toStackWindowingMode = toStack.getWindowingMode();
final ActivityRecord topActivity = getTopNonFinishingActivity();
@@ -1142,8 +1131,6 @@ class Task extends WindowContainer<WindowContainer> {
final ActivityRecord r = topRunningActivityLocked();
final boolean wasFocused = r != null && root.isTopDisplayFocusedRootTask(sourceStack)
&& (topRunningActivityLocked() == r);
- final boolean wasResumed = r != null && sourceStack.getResumedActivity() == r;
- final boolean wasPaused = r != null && sourceStack.mPausingActivity == r;
// In some cases the focused stack isn't the front stack. E.g. pinned stack.
// Whenever we are moving the top activity from the front stack we want to make sure to
@@ -1164,9 +1151,15 @@ class Task extends WindowContainer<WindowContainer> {
// If the task had focus before (or we're requested to move focus), move focus to the
// new stack by moving the stack to the front.
- if (r != null) {
- toStack.moveToFrontAndResumeStateIfNeeded(r, moveStackToFront, wasResumed,
- wasPaused, reason);
+ if (r != null && moveStackToFront) {
+ // Move the stack in which we are placing the activity to the front.
+ toStack.moveToFront(reason);
+
+ // If the original state is resumed, there is no state change to update focused app.
+ // So here makes sure the activity focus is set if it is the top.
+ if (r.isState(RESUMED) && r == mRootWindowContainer.getTopResumedActivity()) {
+ mAtmService.setResumedActivityUncheckLocked(r, reason);
+ }
}
if (!animate) {
mTaskSupervisor.mNoAnimActivities.add(topActivity);
@@ -1462,15 +1455,6 @@ class Task extends WindowContainer<WindowContainer> {
}
if (newParent != null) {
- final Task newParentTask = ((WindowContainer) newParent).asTask();
- if (newParentTask != null) {
- final ActivityRecord top = newParentTask.getTopNonFinishingActivity(
- false /* includeOverlays */);
- if (top != null && top.isState(RESUMED)) {
- newParentTask.setResumedActivity(top, "addedToTask");
- }
- }
-
// TODO: Ensure that this is actually necessary here
// Notify the voice session if required
if (voiceSession != null) {
@@ -1507,6 +1491,15 @@ class Task extends WindowContainer<WindowContainer> {
mLastTaskBoundsComputeActivity = null;
}
+ // mPausingActivity is set at leaf task
+ if (mPausingActivity != null && mPausingActivity == r) {
+ mPausingActivity = null;
+ }
+
+ if (mResumedActivity != null && mResumedActivity == r) {
+ setResumedActivity(null, "cleanUpActivityReferences");
+ }
+
final WindowContainer parent = getParent();
if (parent != null && parent.asTask() != null) {
parent.asTask().cleanUpActivityReferences(r);
@@ -1514,21 +1507,38 @@ class Task extends WindowContainer<WindowContainer> {
}
r.removeTimeouts();
mExitingActivities.remove(r);
-
- if (mResumedActivity != null && mResumedActivity == r) {
- setResumedActivity(null, "cleanUpActivityReferences");
- }
- if (mPausingActivity != null && mPausingActivity == r) {
- mPausingActivity = null;
- }
}
/** @return the currently resumed activity. */
ActivityRecord getResumedActivity() {
- return mResumedActivity;
+ if (isLeafTask()) {
+ return mResumedActivity;
+ }
+
+ final Task task = getTask(t -> t.mResumedActivity != null, true /* traverseTopToBottom */);
+ return task != null ? task.mResumedActivity : null;
+ }
+
+ @VisibleForTesting
+ void setPausingActivity(ActivityRecord pausing) {
+ mPausingActivity = pausing;
+ }
+
+ /**
+ * @return the currently pausing activity of this task or the topmost pausing activity of the
+ * child tasks
+ */
+ ActivityRecord getPausingActivity() {
+ if (isLeafTask()) {
+ return mPausingActivity;
+ }
+
+ final Task task = getTask(t -> t.mPausingActivity != null, true /* traverseTopToBottom */);
+ return task != null ? task.mPausingActivity : null;
}
void setResumedActivity(ActivityRecord r, String reason) {
+ warnForNonLeafTask("setResumedActivity");
if (mResumedActivity == r) {
return;
}
@@ -2168,17 +2178,7 @@ class Task extends WindowContainer<WindowContainer> {
* @param reason The reason for the change.
*/
void onActivityStateChanged(ActivityRecord record, ActivityState state, String reason) {
- final Task parentTask = getParent().asTask();
- if (parentTask != null) {
- parentTask.onActivityStateChanged(record, state, reason);
- // We still want to update the resumed activity if the parent task is created by
- // organizer in order to keep the information synced once got reparented out from the
- // organized task.
- if (!parentTask.mCreatedByOrganizer) {
- return;
- }
- }
-
+ warnForNonLeafTask("onActivityStateChanged");
if (record == mResumedActivity && state != RESUMED) {
setResumedActivity(null, reason + " - onActivityStateChanged");
}
@@ -2356,7 +2356,7 @@ class Task extends WindowContainer<WindowContainer> {
* Initializes a change transition. See {@link SurfaceFreezer} for more information.
*/
private void initializeChangeTransition(Rect startBounds) {
- mDisplayContent.prepareAppTransition(TRANSIT_CHANGE_WINDOWING_MODE);
+ mDisplayContent.prepareAppTransition(TRANSIT_CHANGE);
mDisplayContent.mChangingContainers.add(this);
mSurfaceFreezer.freeze(getPendingTransaction(), startBounds);
@@ -2440,8 +2440,7 @@ class Task extends WindowContainer<WindowContainer> {
@Override
public SurfaceControl getFreezeSnapshotTarget() {
- if (!mDisplayContent.mAppTransition.containsTransitRequest(
- TRANSIT_CHANGE_WINDOWING_MODE)) {
+ if (!mDisplayContent.mAppTransition.containsTransitRequest(TRANSIT_CHANGE)) {
return null;
}
// Skip creating snapshot if this transition is controlled by a remote animator which
@@ -3135,12 +3134,12 @@ class Task extends WindowContainer<WindowContainer> {
// and focused application if needed.
focusableTask.moveToFront(myReason);
// Top display focused stack is changed, update top resumed activity if needed.
- if (rootTask.mResumedActivity != null) {
+ if (rootTask.getResumedActivity() != null) {
mTaskSupervisor.updateTopResumedActivityIfNeeded();
// Set focused app directly because if the next focused activity is already resumed
// (e.g. the next top activity is on a different display), there won't have activity
// state change to update it.
- mAtmService.setResumedActivityUncheckLocked(rootTask.mResumedActivity, reason);
+ mAtmService.setResumedActivityUncheckLocked(rootTask.getResumedActivity(), reason);
}
return rootTask;
}
@@ -3879,6 +3878,13 @@ class Task extends WindowContainer<WindowContainer> {
}
@Override
+ void forAllRootTasks(Consumer<Task> callback, boolean traverseTopToBottom) {
+ if (isRootTask()) {
+ callback.accept(this);
+ }
+ }
+
+ @Override
boolean forAllTasks(Function<Task, Boolean> callback) {
if (super.forAllTasks(callback)) return true;
return callback.apply(this);
@@ -3903,12 +3909,29 @@ class Task extends WindowContainer<WindowContainer> {
}
@Override
+ boolean forAllRootTasks(Function<Task, Boolean> callback, boolean traverseTopToBottom) {
+ return isRootTask() ? callback.apply(this) : false;
+ }
+
+ @Override
Task getTask(Predicate<Task> callback, boolean traverseTopToBottom) {
final Task t = super.getTask(callback, traverseTopToBottom);
if (t != null) return t;
return callback.test(this) ? this : null;
}
+ @Nullable
+ @Override
+ Task getRootTask(Predicate<Task> callback, boolean traverseTopToBottom) {
+ return isRootTask() && callback.test(this) ? this : null;
+ }
+
+ @Nullable
+ @Override
+ <R> R getItemFromRootTasks(Function<Task, R> callback, boolean traverseTopToBottom) {
+ return isRootTask() ? callback.apply(this) : null;
+ }
+
/**
* @param canAffectSystemUiFlags If false, all windows in this task can not affect SystemUI
* flags. See {@link WindowState#canAffectSystemUiFlags()}.
@@ -4083,16 +4106,10 @@ class Task extends WindowContainer<WindowContainer> {
info.resizeMode = top != null ? top.mResizeMode : mResizeMode;
info.topActivityType = top.getActivityType();
info.isResizeable = isResizeable();
- // Don't query getTopNonFinishingActivity().getBounds() directly because when fillTaskInfo
- // is triggered for the first time after activities change, getBounds() may return non final
- // bounds, e.g. fullscreen bounds instead of letterboxed bounds. To work around this,
- // assigning bounds from ActivityRecord#layoutLetterbox when they are ready.
- info.letterboxActivityBounds = Rect.copyOrNull(mLetterboxActivityBounds);
- info.letterboxActivityInsets = Rect.copyOrNull(mLetterboxActivityInsets);
+
info.positionInParent = getRelativePosition();
- info.parentBounds = getParentBounds();
- info.pictureInPictureParams = getPictureInPictureParams();
+ info.pictureInPictureParams = getPictureInPictureParams(top);
info.topActivityInfo = mReuseActivitiesReport.top != null
? mReuseActivitiesReport.top.info
: null;
@@ -4109,34 +4126,16 @@ class Task extends WindowContainer<WindowContainer> {
}
@Nullable PictureInPictureParams getPictureInPictureParams() {
- final Task top = getTopMostTask();
+ return getPictureInPictureParams(getTopMostTask());
+ }
+
+ private @Nullable PictureInPictureParams getPictureInPictureParams(Task top) {
if (top == null) return null;
final ActivityRecord rootActivity = top.getRootActivity();
return (rootActivity == null || rootActivity.pictureInPictureArgs.empty())
? null : new PictureInPictureParams(rootActivity.pictureInPictureArgs);
}
- void maybeUpdateLetterboxInTaskOrganizer(
- ActivityRecord activityRecord,
- @Nullable Rect activityBounds,
- @Nullable Rect activityInsets) {
- if (isOrganized()
- && mReuseActivitiesReport.top == activityRecord
- // Want to force update only if letterbox bounds have changed.
- && (!Objects.equals(mLetterboxActivityBounds, activityBounds)
- || !Objects.equals(mLetterboxActivityInsets, activityInsets))) {
- mLetterboxActivityBounds = Rect.copyOrNull(activityBounds);
- mLetterboxActivityInsets = Rect.copyOrNull(activityInsets);
- // Forcing update to reduce visual jank during the transition.
- dispatchTaskInfoChangedIfNeeded(true /* force */);
- }
- }
-
- private Rect getParentBounds() {
- final WindowContainer parent = getParent();
- return parent != null ? new Rect(parent.getBounds()) : new Rect();
- }
-
/**
* Returns a {@link TaskInfo} with information from this task.
*/
@@ -5422,6 +5421,12 @@ class Task extends WindowContainer<WindowContainer> {
}
void awakeFromSleepingLocked() {
+ if (!isLeafTask()) {
+ forAllLeafTasks((task) -> task.awakeFromSleepingLocked(),
+ true /* traverseTopToBottom */);
+ return;
+ }
+
if (mPausingActivity != null) {
Slog.d(TAG, "awakeFromSleepingLocked: previously pausing activity didn't pause");
mPausingActivity.activityPaused(true);
@@ -5446,8 +5451,17 @@ class Task extends WindowContainer<WindowContainer> {
* process of going to sleep (checkReadyForSleep will be called when that process finishes).
*/
boolean goToSleepIfPossible(boolean shuttingDown) {
- boolean shouldSleep = true;
+ if (!isLeafTask()) {
+ final int[] sleepInProgress = {0};
+ forAllLeafTasks((t) -> {
+ if (!t.goToSleepIfPossible(shuttingDown)) {
+ sleepInProgress[0]++;
+ }
+ }, true);
+ return sleepInProgress[0] == 0;
+ }
+ boolean shouldSleep = true;
if (mResumedActivity != null) {
// Still have something resumed; can't sleep until it is paused.
ProtoLog.v(WM_DEBUG_STATES, "Sleep needs to pause %s", mResumedActivity);
@@ -5507,6 +5521,16 @@ class Task extends WindowContainer<WindowContainer> {
*/
final boolean startPausingLocked(boolean userLeaving, boolean uiSleeping,
ActivityRecord resuming, String reason) {
+ if (!isLeafTask()) {
+ final int[] pausing = {0};
+ forAllLeafTasks((t) -> {
+ if (t.startPausingLocked(userLeaving, uiSleeping, resuming, reason)) {
+ pausing[0]++;
+ }
+ }, true /* traverseTopToBottom */);
+ return pausing[0] > 0;
+ }
+
if (mPausingActivity != null) {
Slog.wtf(TAG, "Going to pause when pause is already pending for " + mPausingActivity
+ " state=" + mPausingActivity.getState());
@@ -5637,6 +5661,10 @@ class Task extends WindowContainer<WindowContainer> {
@VisibleForTesting
void completePauseLocked(boolean resumeNext, ActivityRecord resuming) {
+ // Complete the pausing process of a pausing activity, so it doesn't make sense to
+ // operate on non-leaf tasks.
+ warnForNonLeafTask("completePauseLocked");
+
ActivityRecord prev = mPausingActivity;
ProtoLog.v(WM_DEBUG_STATES, "Complete pause: %s", prev);
@@ -5896,24 +5924,34 @@ class Task extends WindowContainer<WindowContainer> {
return false;
}
- boolean result = false;
+ boolean someActivityResumed = false;
try {
// Protect against recursion.
mInResumeTopActivity = true;
- // TODO(b/172885410): Allow the top activities of all visible leaf tasks to be resumed
- if (mCreatedByOrganizer && !isLeafTask()
- && getConfiguration().windowConfiguration.getWindowingMode()
- == WINDOWING_MODE_FULLSCREEN) {
- for (int i = mChildren.size() - 1; i >= 0; i--) {
- final Task child = (Task) getChildAt(i);
- if (!child.shouldBeVisible(null /* starting */)) {
+ if (isLeafTask()) {
+ someActivityResumed = resumeTopActivityInnerLocked(prev, options);
+ } else {
+ int idx = mChildren.size() - 1;
+ while (idx >= 0) {
+ final Task child = (Task) getChildAt(idx--);
+ if (!child.isFocusableAndVisible()) {
break;
}
- result |= child.resumeTopActivityUncheckedLocked(prev, options);
+
+ // Only allow one activity to be resumed among sibling tasks in split-screen.
+ if (inSplitScreenWindowingMode() && someActivityResumed) {
+ break;
+ }
+
+ someActivityResumed |= child.resumeTopActivityUncheckedLocked(prev, options);
+ // Doing so in order to prevent IndexOOB since hierarchy might changes while
+ // resuming activities, for example dismissing split-screen while starting
+ // non-resizeable activity.
+ if (idx >= mChildren.size()) {
+ idx = mChildren.size() - 1;
+ }
}
- } else {
- result = resumeTopActivityInnerLocked(prev, options);
}
// When resuming the top activity, it may be necessary to pause the top activity (for
@@ -5931,7 +5969,7 @@ class Task extends WindowContainer<WindowContainer> {
mInResumeTopActivity = false;
}
- return result;
+ return someActivityResumed;
}
@GuardedBy("mService")
@@ -6045,7 +6083,7 @@ class Task extends WindowContainer<WindowContainer> {
// So, why aren't we using prev here??? See the param comment on the method. prev
// doesn't represent the last resumed activity. However, the last focus stack does if
// it isn't null.
- lastResumed = lastFocusedStack.mResumedActivity;
+ lastResumed = lastFocusedStack.getResumedActivity();
if (userLeaving && inMultiWindowMode() && lastFocusedStack.shouldBeVisible(next)) {
// The user isn't leaving if this stack is the multi-window mode and the last
// focused stack should still be visible.
@@ -6214,7 +6252,7 @@ class Task extends WindowContainer<WindowContainer> {
next.startLaunchTickingLocked();
ActivityRecord lastResumedActivity =
- lastFocusedStack == null ? null : lastFocusedStack.mResumedActivity;
+ lastFocusedStack == null ? null : lastFocusedStack.getResumedActivity();
final ActivityState lastState = next.getState();
mAtmService.updateCpuStats();
@@ -7068,6 +7106,7 @@ class Task extends WindowContainer<WindowContainer> {
* @return {@code true} if the process of the pausing activity is died.
*/
boolean handleAppDied(WindowProcessController app) {
+ warnForNonLeafTask("handleAppDied");
boolean isPausingDied = false;
if (mPausingActivity != null && mPausingActivity.app == app) {
ProtoLog.v(WM_DEBUG_STATES, "App died while pausing: %s",
@@ -7105,7 +7144,7 @@ class Task extends WindowContainer<WindowContainer> {
printed = true;
}
- printed |= printThisActivity(pw, mPausingActivity, dumpPackage, false,
+ printed |= printThisActivity(pw, getPausingActivity(), dumpPackage, false,
" mPausingActivity: ", null);
printed |= printThisActivity(pw, getResumedActivity(), dumpPackage, false,
" mResumedActivity: ", null);
@@ -7284,7 +7323,7 @@ class Task extends WindowContainer<WindowContainer> {
task.updateOverrideConfigurationForStack(this);
final ActivityRecord topRunningActivity = task.topRunningActivityLocked();
- final boolean wasResumed = topRunningActivity == task.getRootTask().mResumedActivity;
+ final boolean wasResumed = topRunningActivity == task.mResumedActivity;
boolean toTop = position >= getChildCount();
boolean includingParents = toTop || getDisplayArea().getNextFocusableRootTask(this,
@@ -7307,7 +7346,7 @@ class Task extends WindowContainer<WindowContainer> {
if (wasResumed) {
if (mResumedActivity != null) {
Log.wtf(TAG, "mResumedActivity was already set when moving mResumedActivity from"
- + " other stack to this stack mResumedActivity=" + mResumedActivity
+ + " other stack to this task mResumedActivity=" + mResumedActivity
+ " other mResumedActivity=" + topRunningActivity);
}
topRunningActivity.setState(RESUMED, "positionChildAt");
@@ -7333,34 +7372,6 @@ class Task extends WindowContainer<WindowContainer> {
taskDisplayArea.positionChildAt(POSITION_TOP, this, false /* includingParents */);
}
- /** NOTE: Should only be called from {@link Task#reparent}. */
- void moveToFrontAndResumeStateIfNeeded(ActivityRecord r, boolean moveToFront, boolean setResume,
- boolean setPause, String reason) {
- if (!moveToFront) {
- return;
- }
-
- final ActivityState origState = r.getState();
- // If the activity owns the last resumed activity, transfer that together,
- // so that we don't resume the same activity again in the new stack.
- // Apps may depend on onResume()/onPause() being called in pairs.
- if (setResume) {
- r.setState(RESUMED, "moveToFrontAndResumeStateIfNeeded");
- }
- // If the activity was previously pausing, then ensure we transfer that as well
- if (setPause) {
- mPausingActivity = r;
- r.schedulePauseTimeout();
- }
- // Move the stack in which we are placing the activity to the front.
- moveToFront(reason);
- // If the original state is resumed, there is no state change to update focused app.
- // So here makes sure the activity focus is set if it is the top.
- if (origState == RESUMED && r == mRootWindowContainer.getTopResumedActivity()) {
- mAtmService.setResumedActivityUncheckLocked(r, reason);
- }
- }
-
void dismissPip() {
if (!isActivityTypeStandardOrUndefined()) {
throw new IllegalArgumentException(
@@ -7510,6 +7521,15 @@ class Task extends WindowContainer<WindowContainer> {
}
/**
+ * Simply check and give warning logs if this is not operated on leaf task.
+ */
+ private void warnForNonLeafTask(String func) {
+ if (!isLeafTask()) {
+ Slog.w(TAG, func + " on non-leaf task " + this);
+ }
+ }
+
+ /**
* Sets the current picture-in-picture aspect ratio.
*/
void setPictureInPictureAspectRatio(float aspectRatio) {
diff --git a/services/core/java/com/android/server/wm/TaskDisplayArea.java b/services/core/java/com/android/server/wm/TaskDisplayArea.java
index 9425602763c5..7fed84015e8b 100644
--- a/services/core/java/com/android/server/wm/TaskDisplayArea.java
+++ b/services/core/java/com/android/server/wm/TaskDisplayArea.java
@@ -33,7 +33,6 @@ import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_BEHIND;
import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_UNSET;
import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED;
-import static com.android.internal.protolog.ProtoLogGroup.WM_DEBUG_ADD_REMOVE;
import static com.android.internal.protolog.ProtoLogGroup.WM_DEBUG_ORIENTATION;
import static com.android.internal.protolog.ProtoLogGroup.WM_DEBUG_STATES;
import static com.android.internal.protolog.ProtoLogGroup.WM_DEBUG_TASKS;
@@ -474,7 +473,7 @@ final class TaskDisplayArea extends DisplayArea<Task> {
private int findMinPositionForRootTask(Task rootTask) {
int minPosition = POSITION_BOTTOM;
for (int i = 0; i < mChildren.size(); ++i) {
- if (getPriority(getRootTaskAt(i)) < getPriority(rootTask)) {
+ if (getPriority(mChildren.get(i)) < getPriority(rootTask)) {
minPosition = i;
} else {
break;
@@ -495,7 +494,7 @@ final class TaskDisplayArea extends DisplayArea<Task> {
private int findMaxPositionForRootTask(Task rootTask) {
for (int i = mChildren.size() - 1; i >= 0; --i) {
- final Task curr = getRootTaskAt(i);
+ final Task curr = mChildren.get(i);
// Since a stack could be repositioned while still being one of the children, we check
// if 'curr' is the same stack and skip it if so
final boolean sameRootTask = curr == rootTask;
@@ -610,34 +609,6 @@ final class TaskDisplayArea extends DisplayArea<Task> {
return false;
}
- void setExitingTokensHasVisible(boolean hasVisible) {
- for (int i = mChildren.size() - 1; i >= 0; --i) {
- final ArrayList<ActivityRecord> activities = mChildren.get(i).mExitingActivities;
- for (int j = activities.size() - 1; j >= 0; --j) {
- activities.get(j).hasVisible = hasVisible;
- }
- }
- }
-
- void removeExistingAppTokensIfPossible() {
- for (int i = mChildren.size() - 1; i >= 0; --i) {
- final ArrayList<ActivityRecord> activities = mChildren.get(i).mExitingActivities;
- for (int j = activities.size() - 1; j >= 0; --j) {
- final ActivityRecord activity = activities.get(j);
- if (!activity.hasVisible && !mDisplayContent.mClosingApps.contains(activity)
- && (!activity.mIsExiting || activity.isEmpty())) {
- // Make sure there is no animation running on this activity, so any windows
- // associated with it will be removed as soon as their animations are
- // complete.
- cancelAnimation();
- ProtoLog.v(WM_DEBUG_ADD_REMOVE,
- "performLayout: Activity exiting now removed %s", activity);
- activity.removeIfPossible();
- }
- }
- }
- }
-
@Override
int getOrientation(int candidate) {
mLastOrientationSource = null;
@@ -894,16 +865,6 @@ final class TaskDisplayArea extends DisplayArea<Task> {
}
}
- Task getRootTask(int rootTaskId) {
- for (int i = getRootTaskCount() - 1; i >= 0; --i) {
- final Task stack = getRootTaskAt(i);
- if (stack.getRootTaskId() == rootTaskId) {
- return stack;
- }
- }
- return null;
- }
-
/**
* Returns an existing stack compatible with the windowing mode and activity type or creates one
* if a compatible stack doesn't exist.
@@ -1065,15 +1026,15 @@ final class TaskDisplayArea extends DisplayArea<Task> {
// Only split-screen windowing modes can do this currently...
return null;
}
- for (int i = getRootTaskCount() - 1; i >= 0; --i) {
- final Task t = getRootTaskAt(i);
+ for (int i = mChildren.size() - 1; i >= 0; --i) {
+ final Task t = mChildren.get(i);
if (!t.mCreatedByOrganizer || t.getRequestedOverrideWindowingMode() != windowingMode) {
continue;
}
// If not already set, pick a launch root which is not the one we are launching into.
if (mLaunchRootTask == null) {
- for (int j = 0, n = getRootTaskCount(); j < n; ++j) {
- final Task tt = getRootTaskAt(j);
+ for (int j = 0, n = mChildren.size(); j < n; ++j) {
+ final Task tt = mChildren.get(j);
if (tt.mCreatedByOrganizer && tt != t) {
mLaunchRootTask = tt;
break;
@@ -1128,8 +1089,8 @@ final class TaskDisplayArea extends DisplayArea<Task> {
return mPreferredTopFocusableRootTask;
}
- for (int i = getRootTaskCount() - 1; i >= 0; --i) {
- final Task stack = getRootTaskAt(i);
+ for (int i = mChildren.size() - 1; i >= 0; --i) {
+ final Task stack = mChildren.get(i);
if (stack.isFocusableAndVisible()) {
return stack;
}
@@ -1143,8 +1104,8 @@ final class TaskDisplayArea extends DisplayArea<Task> {
? currentFocus.getWindowingMode() : WINDOWING_MODE_UNDEFINED;
Task candidate = null;
- for (int i = getRootTaskCount() - 1; i >= 0; --i) {
- final Task rootTask = getRootTaskAt(i);
+ for (int i = mChildren.size() - 1; i >= 0; --i) {
+ final Task rootTask = mChildren.get(i);
if (ignoreCurrent && rootTask == currentFocus) {
continue;
}
@@ -1184,7 +1145,7 @@ final class TaskDisplayArea extends DisplayArea<Task> {
if (resumedActivity == null || resumedActivity.app == null) {
// If there is no registered resumed activity in the stack or it is not running -
// try to use previously resumed one.
- resumedActivity = focusedStack.mPausingActivity;
+ resumedActivity = focusedStack.getPausingActivity();
if (resumedActivity == null || resumedActivity.app == null) {
// If previously resumed activity doesn't work either - find the topmost running
// activity that can be focused.
@@ -1223,8 +1184,8 @@ final class TaskDisplayArea extends DisplayArea<Task> {
}
boolean allResumedActivitiesComplete() {
- for (int stackNdx = getRootTaskCount() - 1; stackNdx >= 0; --stackNdx) {
- final ActivityRecord r = getRootTaskAt(stackNdx).getResumedActivity();
+ for (int stackNdx = mChildren.size() - 1; stackNdx >= 0; --stackNdx) {
+ final ActivityRecord r = mChildren.get(stackNdx).getResumedActivity();
if (r != null && !r.isState(RESUMED)) {
return false;
}
@@ -1250,20 +1211,21 @@ final class TaskDisplayArea extends DisplayArea<Task> {
* @return {@code true} if any activity was paused as a result of this call.
*/
boolean pauseBackTasks(boolean userLeaving, ActivityRecord resuming) {
- boolean someActivityPaused = false;
- for (int stackNdx = getRootTaskCount() - 1; stackNdx >= 0; --stackNdx) {
- final Task stack = getRootTaskAt(stackNdx);
- final ActivityRecord resumedActivity = stack.getResumedActivity();
+ final int[] someActivityPaused = {0};
+ forAllLeafTasks((task) -> {
+ final ActivityRecord resumedActivity = task.getResumedActivity();
if (resumedActivity != null
- && (stack.getVisibility(resuming) != TASK_VISIBILITY_VISIBLE
- || !stack.isTopActivityFocusable())) {
- ProtoLog.d(WM_DEBUG_STATES, "pauseBackStacks: stack=%s "
- + "mResumedActivity=%s", stack, resumedActivity);
- someActivityPaused |= stack.startPausingLocked(userLeaving, false /* uiSleeping*/,
- resuming, "pauseBackStacks");
+ && (task.getVisibility(resuming) != TASK_VISIBILITY_VISIBLE
+ || !task.isTopActivityFocusable())) {
+ ProtoLog.d(WM_DEBUG_STATES, "pauseBackStacks: task=%s "
+ + "mResumedActivity=%s", task, resumedActivity);
+ if (task.startPausingLocked(userLeaving, false /* uiSleeping*/,
+ resuming, "pauseBackStacks")) {
+ someActivityPaused[0]++;
+ }
}
- }
- return someActivityPaused;
+ }, true /* traverseTopToBottom */);
+ return someActivityPaused[0] > 0;
}
/**
@@ -1272,8 +1234,8 @@ final class TaskDisplayArea extends DisplayArea<Task> {
void findTaskLocked(final ActivityRecord r, final boolean isPreferredDisplayArea,
RootWindowContainer.FindTaskResult result) {
mTmpFindTaskResult.clear();
- for (int stackNdx = getRootTaskCount() - 1; stackNdx >= 0; --stackNdx) {
- final Task stack = getRootTaskAt(stackNdx);
+ for (int stackNdx = mChildren.size() - 1; stackNdx >= 0; --stackNdx) {
+ final Task stack = mChildren.get(stackNdx);
if (!r.hasCompatibleActivityType(stack) && stack.isLeafTask()) {
ProtoLog.d(WM_DEBUG_TASKS, "Skipping stack: (mismatch activity/stack) "
+ "%s", stack);
@@ -1300,69 +1262,6 @@ final class TaskDisplayArea extends DisplayArea<Task> {
}
}
- /**
- * Removes root tasks in the input windowing modes from the system if they are of activity type
- * ACTIVITY_TYPE_STANDARD or ACTIVITY_TYPE_UNDEFINED
- */
- void removeRootTasksInWindowingModes(int... windowingModes) {
- if (windowingModes == null || windowingModes.length == 0) {
- return;
- }
-
- // Collect the root tasks that are necessary to be removed instead of performing the removal
- // by looping the children, so that we don't miss any root tasks after the children size
- // changed or reordered.
- final ArrayList<Task> rootTasks = new ArrayList<>();
- for (int j = windowingModes.length - 1; j >= 0; --j) {
- final int windowingMode = windowingModes[j];
- for (int i = mChildren.size() - 1; i >= 0; --i) {
- final Task rootTask = mChildren.get(i);
- if (rootTask.mCreatedByOrganizer
- || !rootTask.isActivityTypeStandardOrUndefined()
- || rootTask.getWindowingMode() != windowingMode) {
- continue;
- }
- rootTasks.add(rootTask);
- }
- }
-
- for (int i = rootTasks.size() - 1; i >= 0; --i) {
- mRootWindowContainer.mTaskSupervisor.removeRootTask(rootTasks.get(i));
- }
- }
-
- void removeRootTasksWithActivityTypes(int... activityTypes) {
- if (activityTypes == null || activityTypes.length == 0) {
- return;
- }
-
- // Collect the root tasks that are necessary to be removed instead of performing the removal
- // by looping the children, so that we don't miss any root tasks after the children size
- // changed or reordered.
- final ArrayList<Task> rootTasks = new ArrayList<>();
- for (int j = activityTypes.length - 1; j >= 0; --j) {
- final int activityType = activityTypes[j];
- for (int i = mChildren.size() - 1; i >= 0; --i) {
- final Task rootTask = mChildren.get(i);
- // Collect the root tasks that are currently being organized.
- if (rootTask.mCreatedByOrganizer) {
- for (int k = rootTask.getChildCount() - 1; k >= 0; --k) {
- final Task task = (Task) rootTask.getChildAt(k);
- if (task.getActivityType() == activityType) {
- rootTasks.add(task);
- }
- }
- } else if (rootTask.getActivityType() == activityType) {
- rootTasks.add(rootTask);
- }
- }
- }
-
- for (int i = rootTasks.size() - 1; i >= 0; --i) {
- mRootWindowContainer.mTaskSupervisor.removeRootTask(rootTasks.get(i));
- }
- }
-
void onSplitScreenModeDismissed() {
// The focused task could be a non-resizeable fullscreen root task that is on top of the
// other split-screen tasks, therefore had to dismiss split-screen, make sure the current
@@ -1582,8 +1481,8 @@ final class TaskDisplayArea extends DisplayArea<Task> {
// Look in other focusable stacks.
if (topRunning == null) {
- for (int i = getRootTaskCount() - 1; i >= 0; --i) {
- final Task stack = getRootTaskAt(i);
+ for (int i = mChildren.size() - 1; i >= 0; --i) {
+ final Task stack = mChildren.get(i);
// Only consider focusable stacks other than the current focused one.
if (stack == focusedStack || !stack.isTopActivityFocusable()) {
continue;
@@ -1608,11 +1507,11 @@ final class TaskDisplayArea extends DisplayArea<Task> {
}
protected int getRootTaskCount() {
- return mChildren.size();
- }
-
- protected Task getRootTaskAt(int index) {
- return mChildren.get(index);
+ final int[] count = new int[1];
+ forAllRootTasks(task -> {
+ count[0]++;
+ });
+ return count[0];
}
@Nullable
@@ -1711,9 +1610,9 @@ final class TaskDisplayArea extends DisplayArea<Task> {
// Find the next position where the stack should be placed
final boolean isRootTask = rootTask.isRootTask();
final int numRootTasks =
- isRootTask ? getRootTaskCount() : rootTask.getParent().getChildCount();
+ isRootTask ? mChildren.size() : rootTask.getParent().getChildCount();
for (int rootTaskNdx = 0; rootTaskNdx < numRootTasks; rootTaskNdx++) {
- final Task s = isRootTask ? getRootTaskAt(rootTaskNdx)
+ final Task s = isRootTask ? mChildren.get(rootTaskNdx)
: (Task) rootTask.getParent().getChildAt(rootTaskNdx);
if (s == rootTask) {
continue;
@@ -1836,8 +1735,8 @@ final class TaskDisplayArea extends DisplayArea<Task> {
boolean preserveWindows, boolean notifyClients, boolean userLeaving) {
mAtmService.mTaskSupervisor.beginActivityVisibilityUpdate();
try {
- for (int stackNdx = getRootTaskCount() - 1; stackNdx >= 0; --stackNdx) {
- final Task stack = getRootTaskAt(stackNdx);
+ for (int stackNdx = mChildren.size() - 1; stackNdx >= 0; --stackNdx) {
+ final Task stack = mChildren.get(stackNdx);
stack.ensureActivitiesVisible(starting, configChanges, preserveWindows,
notifyClients, userLeaving);
}
@@ -1846,13 +1745,6 @@ final class TaskDisplayArea extends DisplayArea<Task> {
}
}
- void prepareFreezingTaskBounds() {
- for (int stackNdx = getChildCount() - 1; stackNdx >= 0; --stackNdx) {
- final Task stack = getChildAt(stackNdx);
- stack.prepareFreezingTaskBounds();
- }
- }
-
/**
* Removes the stacks in the node applying the content removal node from the display.
*
@@ -1871,13 +1763,13 @@ final class TaskDisplayArea extends DisplayArea<Task> {
// related WindowContainer will also be removed. So, we set display area as removed after
// reparenting stack finished.
// Keep the order from bottom to top.
- int numStacks = getRootTaskCount();
+ int numStacks = mChildren.size();
final boolean splitScreenActivated = toDisplayArea.isSplitScreenModeActivated();
final Task rootStack = splitScreenActivated ? toDisplayArea
.getTopRootTaskInWindowingMode(WINDOWING_MODE_SPLIT_SCREEN_SECONDARY) : null;
for (int stackNdx = 0; stackNdx < numStacks; stackNdx++) {
- final Task stack = getRootTaskAt(stackNdx);
+ final Task stack = mChildren.get(stackNdx);
// Always finish non-standard type stacks and stacks created by a organizer.
// TODO: For stacks created by organizer, consider reparenting children tasks if the use
// case arises in the future.
@@ -1897,8 +1789,8 @@ final class TaskDisplayArea extends DisplayArea<Task> {
}
// Stacks may be removed from this display. Ensure each stack will be processed
// and the loop will end.
- stackNdx -= numStacks - getRootTaskCount();
- numStacks = getRootTaskCount();
+ stackNdx -= numStacks - mChildren.size();
+ numStacks = mChildren.size();
}
if (lastReparentedStack != null && splitScreenActivated) {
if (!lastReparentedStack.supportsSplitScreenWindowingMode()) {
diff --git a/services/core/java/com/android/server/wm/TaskLaunchParamsModifier.java b/services/core/java/com/android/server/wm/TaskLaunchParamsModifier.java
index 9d36b84431f3..a7306c97bd2a 100644
--- a/services/core/java/com/android/server/wm/TaskLaunchParamsModifier.java
+++ b/services/core/java/com/android/server/wm/TaskLaunchParamsModifier.java
@@ -795,17 +795,13 @@ class TaskLaunchParamsModifier implements LaunchParamsModifier {
private void adjustBoundsToAvoidConflictInDisplay(@NonNull DisplayContent display,
@NonNull Rect inOutBounds) {
final List<Rect> taskBoundsToCheck = new ArrayList<>();
- display.forAllTaskDisplayAreas(taskDisplayArea -> {
- int numStacks = taskDisplayArea.getRootTaskCount();
- for (int sNdx = 0; sNdx < numStacks; ++sNdx) {
- final Task task = taskDisplayArea.getRootTaskAt(sNdx);
- if (!task.inFreeformWindowingMode()) {
- continue;
- }
+ display.forAllRootTasks(task -> {
+ if (!task.inFreeformWindowingMode()) {
+ return;
+ }
- for (int j = 0; j < task.getChildCount(); ++j) {
- taskBoundsToCheck.add(task.getChildAt(j).getBounds());
- }
+ for (int j = 0; j < task.getChildCount(); ++j) {
+ taskBoundsToCheck.add(task.getChildAt(j).getBounds());
}
}, false /* traverseTopToBottom */);
adjustBoundsToAvoidConflict(display.getBounds(), taskBoundsToCheck, inOutBounds);
diff --git a/services/core/java/com/android/server/wm/TaskOrganizerController.java b/services/core/java/com/android/server/wm/TaskOrganizerController.java
index 2095d1925e4b..58aca20af926 100644
--- a/services/core/java/com/android/server/wm/TaskOrganizerController.java
+++ b/services/core/java/com/android/server/wm/TaskOrganizerController.java
@@ -21,6 +21,7 @@ import static android.app.WindowConfiguration.WINDOWING_MODE_FREEFORM;
import static android.app.WindowConfiguration.WINDOWING_MODE_UNDEFINED;
import static com.android.internal.protolog.ProtoLogGroup.WM_DEBUG_WINDOW_ORGANIZER;
+import static com.android.server.wm.DisplayContent.IME_TARGET_LAYERING;
import static com.android.server.wm.WindowOrganizerController.CONTROLLABLE_CONFIGS;
import static com.android.server.wm.WindowOrganizerController.CONTROLLABLE_WINDOW_CONFIGS;
@@ -580,11 +581,11 @@ class TaskOrganizerController extends ITaskOrganizerController.Stub {
synchronized (mGlobalLock) {
DisplayContent dc = mService.mWindowManager.mRoot
.getDisplayContent(displayId);
- if (dc == null || dc.mInputMethodTarget == null) {
+ if (dc == null || dc.getImeTarget(IME_TARGET_LAYERING) == null) {
return null;
}
// Avoid WindowState#getRootTask() so we don't attribute system windows to a task.
- final Task task = dc.mInputMethodTarget.getTask();
+ final Task task = dc.getImeTarget(IME_TARGET_LAYERING).getWindow().getTask();
if (task == null) {
return null;
}
@@ -687,16 +688,13 @@ class TaskOrganizerController extends ITaskOrganizerController.Stub {
if (dc == null) {
throw new IllegalArgumentException("Display " + displayId + " doesn't exist");
}
- ArrayList<RunningTaskInfo> out = new ArrayList<>();
- dc.forAllTaskDisplayAreas(taskDisplayArea -> {
- for (int sNdx = taskDisplayArea.getRootTaskCount() - 1; sNdx >= 0; --sNdx) {
- final Task task = taskDisplayArea.getRootTaskAt(sNdx);
- if (activityTypes != null
- && !ArrayUtils.contains(activityTypes, task.getActivityType())) {
- continue;
- }
- out.add(task.getTaskInfo());
+ final ArrayList<RunningTaskInfo> out = new ArrayList<>();
+ dc.forAllRootTasks(task -> {
+ if (activityTypes != null
+ && !ArrayUtils.contains(activityTypes, task.getActivityType())) {
+ return;
}
+ out.add(task.getTaskInfo());
});
return out;
}
diff --git a/services/core/java/com/android/server/wm/TaskScreenshotAnimatable.java b/services/core/java/com/android/server/wm/TaskScreenshotAnimatable.java
index 3def0911bd76..1779d2a394eb 100644
--- a/services/core/java/com/android/server/wm/TaskScreenshotAnimatable.java
+++ b/services/core/java/com/android/server/wm/TaskScreenshotAnimatable.java
@@ -60,7 +60,7 @@ class TaskScreenshotAnimatable implements SurfaceAnimator.Animatable {
surface.attachAndQueueBufferWithColorSpace(buffer, screenshotBuffer.getColorSpace());
surface.release();
final float scale = 1.0f * mTask.getBounds().width() / mWidth;
- mSurfaceControl.setMatrix(scale, 0, 0, scale);
+ getPendingTransaction().setMatrix(mSurfaceControl, scale, 0, 0, scale);
}
getPendingTransaction().show(mSurfaceControl);
}
diff --git a/services/core/java/com/android/server/wm/Transition.java b/services/core/java/com/android/server/wm/Transition.java
index 0cdd055d4052..14504d896052 100644
--- a/services/core/java/com/android/server/wm/Transition.java
+++ b/services/core/java/com/android/server/wm/Transition.java
@@ -18,11 +18,18 @@ package com.android.server.wm;
import static android.view.Display.DEFAULT_DISPLAY;
+import static android.view.WindowManager.TRANSIT_CHANGE;
+import static android.view.WindowManager.TRANSIT_CLOSE;
import static android.view.WindowManager.TRANSIT_FLAG_KEYGUARD_GOING_AWAY_NO_ANIMATION;
import static android.view.WindowManager.TRANSIT_FLAG_KEYGUARD_GOING_AWAY_SUBTLE_ANIMATION;
import static android.view.WindowManager.TRANSIT_FLAG_KEYGUARD_GOING_AWAY_TO_SHADE;
import static android.view.WindowManager.TRANSIT_FLAG_KEYGUARD_GOING_AWAY_WITH_WALLPAPER;
+import static android.view.WindowManager.TRANSIT_FLAG_KEYGUARD_LOCKED;
import static android.view.WindowManager.TRANSIT_KEYGUARD_GOING_AWAY;
+import static android.view.WindowManager.TRANSIT_NONE;
+import static android.view.WindowManager.TRANSIT_OPEN;
+import static android.view.WindowManager.TRANSIT_TO_BACK;
+import static android.view.WindowManager.TRANSIT_TO_FRONT;
import android.annotation.IntDef;
import android.annotation.NonNull;
@@ -282,9 +289,13 @@ class Transition extends Binder implements BLASTSyncEngine.TransactionReadyListe
mState = STATE_PLAYING;
mController.moveToPlaying(this);
+ if (mController.mAtm.mTaskSupervisor.getKeyguardController().isKeyguardLocked()) {
+ mFlags |= TRANSIT_FLAG_KEYGUARD_LOCKED;
+ }
+
// Resolve the animating targets from the participants
mTargets = calculateTargets(mParticipants, mChanges);
- final TransitionInfo info = calculateTransitionInfo(mType, mTargets, mChanges);
+ final TransitionInfo info = calculateTransitionInfo(mType, mFlags, mTargets, mChanges);
mRootLeash = info.getRootLeash();
handleNonAppWindowsInTransition(displayId, mType, mFlags);
@@ -337,6 +348,9 @@ class Transition extends Binder implements BLASTSyncEngine.TransactionReadyListe
mController.mAtm.mWindowManager.mPolicy.startKeyguardExitAnimation(
SystemClock.uptimeMillis(), 0 /* duration */);
}
+ if ((flags & TRANSIT_FLAG_KEYGUARD_LOCKED) != 0) {
+ mController.mAtm.mWindowManager.mPolicy.applyKeyguardOcclusionChange();
+ }
}
@Override
@@ -389,7 +403,7 @@ class Transition extends Binder implements BLASTSyncEngine.TransactionReadyListe
parent == null ? "no parent" : ("parent can't be target " + parent));
return false;
}
- @TransitionInfo.TransitionMode int mode = TransitionInfo.TRANSIT_NONE;
+ @TransitionInfo.TransitionMode int mode = TRANSIT_NONE;
// Go through all siblings of this target to see if any of them would prevent
// the target from promoting.
siblingLoop:
@@ -403,11 +417,11 @@ class Transition extends Binder implements BLASTSyncEngine.TransactionReadyListe
if (depth < 0) continue;
if (depth == 0) {
final int siblingMode = sibling.isVisibleRequested()
- ? TransitionInfo.TRANSIT_OPEN : TransitionInfo.TRANSIT_CLOSE;
+ ? TRANSIT_OPEN : TRANSIT_CLOSE;
ProtoLog.v(ProtoLogGroup.WM_DEBUG_WINDOW_TRANSITIONS,
" sibling is a top target with mode %s",
TransitionInfo.modeToString(siblingMode));
- if (mode == TransitionInfo.TRANSIT_NONE) {
+ if (mode == TRANSIT_NONE) {
ProtoLog.v(ProtoLogGroup.WM_DEBUG_WINDOW_TRANSITIONS,
" no common mode yet, so set it");
mode = siblingMode;
@@ -587,9 +601,9 @@ class Transition extends Binder implements BLASTSyncEngine.TransactionReadyListe
*/
@VisibleForTesting
@NonNull
- static TransitionInfo calculateTransitionInfo(int type, ArraySet<WindowContainer> targets,
- ArrayMap<WindowContainer, ChangeInfo> changes) {
- final TransitionInfo out = new TransitionInfo(type);
+ static TransitionInfo calculateTransitionInfo(int type, int flags,
+ ArraySet<WindowContainer> targets, ArrayMap<WindowContainer, ChangeInfo> changes) {
+ final TransitionInfo out = new TransitionInfo(type, flags);
if (targets.isEmpty()) {
out.setRootLeash(new SurfaceControl(), 0, 0);
return out;
@@ -693,12 +707,12 @@ class Transition extends Binder implements BLASTSyncEngine.TransactionReadyListe
int getTransitMode(@NonNull WindowContainer wc) {
final boolean nowVisible = wc.isVisibleRequested();
if (nowVisible == mVisible) {
- return TransitionInfo.TRANSIT_CHANGE;
+ return TRANSIT_CHANGE;
}
if (mExistenceChanged) {
- return nowVisible ? TransitionInfo.TRANSIT_OPEN : TransitionInfo.TRANSIT_CLOSE;
+ return nowVisible ? TRANSIT_OPEN : TRANSIT_CLOSE;
} else {
- return nowVisible ? TransitionInfo.TRANSIT_SHOW : TransitionInfo.TRANSIT_HIDE;
+ return nowVisible ? TRANSIT_TO_FRONT : TRANSIT_TO_BACK;
}
}
diff --git a/services/core/java/com/android/server/wm/WindowContainer.java b/services/core/java/com/android/server/wm/WindowContainer.java
index adc7a227861a..6e0fec1c80fa 100644
--- a/services/core/java/com/android/server/wm/WindowContainer.java
+++ b/services/core/java/com/android/server/wm/WindowContainer.java
@@ -1664,6 +1664,39 @@ class WindowContainer<E extends WindowContainer> extends ConfigurationContainer<
}
/**
+ * For all root tasks at or below this container call the callback.
+ *
+ * @param callback Calls the {@link ToBooleanFunction#apply} method for each root task found and
+ * stops the search if {@link ToBooleanFunction#apply} returns {@code true}.
+ */
+ boolean forAllRootTasks(Function<Task, Boolean> callback) {
+ return forAllRootTasks(callback, true /* traverseTopToBottom */);
+ }
+
+ boolean forAllRootTasks(Function<Task, Boolean> callback, boolean traverseTopToBottom) {
+ int count = mChildren.size();
+ if (traverseTopToBottom) {
+ for (int i = count - 1; i >= 0; --i) {
+ if (mChildren.get(i).forAllRootTasks(callback)) {
+ return true;
+ }
+ }
+ } else {
+ for (int i = 0; i < count; i++) {
+ if (mChildren.get(i).forAllRootTasks(callback)) {
+ return true;
+ }
+ // Root tasks may be removed from this display. Ensure each task will be processed
+ // and the loop will end.
+ int newCount = mChildren.size();
+ i -= count - newCount;
+ count = newCount;
+ }
+ }
+ return false;
+ }
+
+ /**
* For all tasks at or below this container call the callback.
*
* @param callback Callback to be called for every task.
@@ -1698,6 +1731,33 @@ class WindowContainer<E extends WindowContainer> extends ConfigurationContainer<
}
}
+ /**
+ * For all root tasks at or below this container call the callback.
+ *
+ * @param callback Callback to be called for every root task.
+ */
+ void forAllRootTasks(Consumer<Task> callback) {
+ forAllRootTasks(callback, true /* traverseTopToBottom */);
+ }
+
+ void forAllRootTasks(Consumer<Task> callback, boolean traverseTopToBottom) {
+ int count = mChildren.size();
+ if (traverseTopToBottom) {
+ for (int i = count - 1; i >= 0; --i) {
+ mChildren.get(i).forAllRootTasks(callback, traverseTopToBottom);
+ }
+ } else {
+ for (int i = 0; i < count; i++) {
+ mChildren.get(i).forAllRootTasks(callback, traverseTopToBottom);
+ // Root tasks may be removed from this display. Ensure each task will be processed
+ // and the loop will end.
+ int newCount = mChildren.size();
+ i -= count - newCount;
+ count = newCount;
+ }
+ }
+ }
+
Task getTaskAbove(Task t) {
return getTask(
(above) -> true, t, false /*includeBoundary*/, false /*traverseTopToBottom*/);
@@ -1780,6 +1840,44 @@ class WindowContainer<E extends WindowContainer> extends ConfigurationContainer<
return null;
}
+ /**
+ * Gets a root task in a branch of the tree.
+ *
+ * @param callback called to test if this is the task that should be returned.
+ * @return The root task if found or null.
+ */
+ @Nullable
+ Task getRootTask(Predicate<Task> callback) {
+ return getRootTask(callback, true /*traverseTopToBottom*/);
+ }
+
+ @Nullable
+ Task getRootTask(Predicate<Task> callback, boolean traverseTopToBottom) {
+ int count = mChildren.size();
+ if (traverseTopToBottom) {
+ for (int i = count - 1; i >= 0; --i) {
+ final Task t = mChildren.get(i).getRootTask(callback, traverseTopToBottom);
+ if (t != null) {
+ return t;
+ }
+ }
+ } else {
+ for (int i = 0; i < count; i++) {
+ final Task t = mChildren.get(i).getRootTask(callback, traverseTopToBottom);
+ if (t != null) {
+ return t;
+ }
+ // Root tasks may be removed from this display. Ensure each task will be processed
+ // and the loop will end.
+ int newCount = mChildren.size();
+ i -= count - newCount;
+ count = newCount;
+ }
+ }
+
+ return null;
+ }
+
private Task processGetTaskWithBoundary(Predicate<Task> callback,
WindowContainer boundary, boolean includeBoundary, boolean traverseTopToBottom,
boolean[] boundaryFound, WindowContainer wc) {
@@ -1973,6 +2071,47 @@ class WindowContainer<E extends WindowContainer> extends ConfigurationContainer<
}
/**
+ * Finds the first non {@code null} return value from calling the callback on all root
+ * {@link Task} at or below this container.
+ * @param callback Applies on each root {@link Task} found and stops the search if it
+ * returns non {@code null}.
+ * @param traverseTopToBottom If {@code true}, traverses the hierarchy from top-to-bottom in
+ * terms of z-order, else from bottom-to-top.
+ * @return the first returned object that is not {@code null}. Returns {@code null} if not
+ * found.
+ */
+ @Nullable
+ <R> R getItemFromRootTasks(Function<Task, R> callback, boolean traverseTopToBottom) {
+ int count = mChildren.size();
+ if (traverseTopToBottom) {
+ for (int i = count - 1; i >= 0; --i) {
+ R result = (R) mChildren.get(i).getItemFromRootTasks(callback, traverseTopToBottom);
+ if (result != null) {
+ return result;
+ }
+ }
+ } else {
+ for (int i = 0; i < count; i++) {
+ R result = (R) mChildren.get(i).getItemFromRootTasks(callback, traverseTopToBottom);
+ if (result != null) {
+ return result;
+ }
+ // Root tasks may be removed from this display. Ensure each task will be processed
+ // and the loop will end.
+ int newCount = mChildren.size();
+ i -= count - newCount;
+ count = newCount;
+ }
+ }
+ return null;
+ }
+
+ @Nullable
+ <R> R getItemFromRootTasks(Function<Task, R> callback) {
+ return getItemFromRootTasks(callback, true /* traverseTopToBottom */);
+ }
+
+ /**
* Returns 1, 0, or -1 depending on if this container is greater than, equal to, or lesser than
* the input container in terms of z-order.
*/
diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java
index 8fd342c25bc3..6f10edfc59e5 100644
--- a/services/core/java/com/android/server/wm/WindowManagerService.java
+++ b/services/core/java/com/android/server/wm/WindowManagerService.java
@@ -48,6 +48,7 @@ import static android.provider.Settings.Global.DEVELOPMENT_RENDER_SHADOWS_IN_COM
import static android.provider.Settings.Global.DEVELOPMENT_WM_DISPLAY_SETTINGS_PATH;
import static android.view.Display.DEFAULT_DISPLAY;
import static android.view.Display.INVALID_DISPLAY;
+import static android.view.SurfaceControl.getGlobalTransaction;
import static android.view.WindowManager.DISPLAY_IME_POLICY_FALLBACK_DISPLAY;
import static android.view.WindowManager.LayoutParams.FIRST_APPLICATION_WINDOW;
import static android.view.WindowManager.LayoutParams.FIRST_SUB_WINDOW;
@@ -104,6 +105,9 @@ import static com.android.internal.util.LatencyTracker.ACTION_ROTATE_SCREEN;
import static com.android.server.LockGuard.INDEX_WINDOW;
import static com.android.server.LockGuard.installLock;
import static com.android.server.policy.WindowManagerPolicy.FINISH_LAYOUT_REDO_WALLPAPER;
+import static com.android.server.wm.DisplayContent.IME_TARGET_CONTROL;
+import static com.android.server.wm.DisplayContent.IME_TARGET_INPUT;
+import static com.android.server.wm.DisplayContent.IME_TARGET_LAYERING;
import static com.android.server.wm.WindowContainer.AnimationFlags.CHILDREN;
import static com.android.server.wm.WindowContainer.AnimationFlags.PARENTS;
import static com.android.server.wm.WindowContainer.AnimationFlags.TRANSITION;
@@ -1036,7 +1040,7 @@ public class WindowManagerService extends IWindowManager.Stub
private WindowContentFrameStats mTempWindowRenderStats;
- private final LatencyTracker mLatencyTracker;
+ final LatencyTracker mLatencyTracker;
/**
* Whether the UI is currently running in touch mode (not showing
@@ -1120,18 +1124,16 @@ public class WindowManagerService extends IWindowManager.Stub
// While running a recents animation, this will get called early because we show the
// recents animation target activity immediately when the animation starts. Defer the
// mLaunchTaskBehind updates until recents animation finishes.
- final boolean isRecentsAnimationTarget = getRecentsAnimationController() != null
- && getRecentsAnimationController().isTargetApp(atoken);
- if (atoken.mLaunchTaskBehind && !isRecentsAnimationTarget) {
+ if (atoken.mLaunchTaskBehind && !isRecentsAnimationTarget(atoken)) {
mAtmService.mTaskSupervisor.scheduleLaunchTaskBehindComplete(atoken.token);
atoken.mLaunchTaskBehind = false;
} else {
atoken.updateReportedVisibilityLocked();
// We should also defer sending the finished callback until the recents animation
// successfully finishes.
- if (atoken.mEnteringAnimation && !isRecentsAnimationTarget) {
+ if (atoken.mEnteringAnimation && !isRecentsAnimationTarget(atoken)) {
atoken.mEnteringAnimation = false;
- if (atoken != null && atoken.attachedToProcess()) {
+ if (atoken.attachedToProcess()) {
try {
atoken.app.getThread().scheduleEnterAnimationComplete(atoken.appToken);
} catch (RemoteException e) {
@@ -2557,7 +2559,7 @@ public class WindowManagerService extends IWindowManager.Stub
// side child surfaces, so they will remain preserved in their current state
// (rather than be cleaned up immediately by the app code).
SurfaceControl.openTransaction();
- winAnimator.detachChildren();
+ winAnimator.detachChildren(getGlobalTransaction());
SurfaceControl.closeTransaction();
return focusMayChange;
@@ -2968,6 +2970,10 @@ public class WindowManagerService extends IWindowManager.Stub
}
}
+ boolean isRecentsAnimationTarget(ActivityRecord r) {
+ return mRecentsAnimationController != null && mRecentsAnimationController.isTargetApp(r);
+ }
+
void setWindowOpaqueLocked(IBinder token, boolean isOpaque) {
final ActivityRecord wtoken = mRoot.getActivityRecord(token);
if (wtoken != null) {
@@ -5349,7 +5355,7 @@ public class WindowManagerService extends IWindowManager.Stub
void destroyPreservedSurfaceLocked() {
for (int i = mDestroyPreservedSurface.size() - 1; i >= 0 ; i--) {
final WindowState w = mDestroyPreservedSurface.get(i);
- w.mWinAnimator.destroyPreservedSurfaceLocked();
+ w.mWinAnimator.destroyPreservedSurfaceLocked(w.getSyncTransaction());
}
mDestroyPreservedSurface.clear();
}
@@ -6321,20 +6327,20 @@ public class WindowManagerService extends IWindowManager.Stub
mRoot.dumpTopFocusedDisplayId(pw);
mRoot.forAllDisplays(dc -> {
final int displayId = dc.getDisplayId();
- final WindowState inputMethodTarget = dc.mInputMethodTarget;
- final WindowState inputMethodInputTarget = dc.mInputMethodInputTarget;
- final InsetsControlTarget inputMethodControlTarget = dc.mInputMethodControlTarget;
- if (inputMethodTarget != null) {
- pw.print(" mInputMethodTarget in display# "); pw.print(displayId);
- pw.print(' '); pw.println(inputMethodTarget);
+ final InsetsControlTarget imeLayeringTarget = dc.getImeTarget(IME_TARGET_LAYERING);
+ final InsetsControlTarget imeInputTarget = dc.getImeTarget(IME_TARGET_INPUT);
+ final InsetsControlTarget imeControlTarget = dc.getImeTarget(IME_TARGET_CONTROL);
+ if (imeLayeringTarget != null) {
+ pw.print(" imeLayeringTarget in display# "); pw.print(displayId);
+ pw.print(' '); pw.println(imeLayeringTarget);
}
- if (inputMethodInputTarget != null) {
- pw.print(" mInputMethodInputTarget in display# "); pw.print(displayId);
- pw.print(' '); pw.println(inputMethodInputTarget);
+ if (imeInputTarget != null) {
+ pw.print(" imeInputTarget in display# "); pw.print(displayId);
+ pw.print(' '); pw.println(imeInputTarget);
}
- if (inputMethodControlTarget != null) {
- pw.print(" inputMethodControlTarget in display# "); pw.print(displayId);
- pw.print(' '); pw.println(inputMethodControlTarget);
+ if (imeControlTarget != null) {
+ pw.print(" imeControlTarget in display# "); pw.print(displayId);
+ pw.print(' '); pw.println(imeControlTarget);
}
});
pw.print(" mInTouchMode="); pw.println(mInTouchMode);
@@ -7629,7 +7635,7 @@ public class WindowManagerService extends IWindowManager.Stub
synchronized (mGlobalLock) {
final WindowState imeTarget = mWindowMap.get(imeTargetWindowToken);
if (imeTarget != null) {
- imeTarget.getDisplayContent().setInputMethodInputTarget(imeTarget);
+ imeTarget.getDisplayContent().updateImeInputAndControlTarget(imeTarget);
}
}
}
@@ -7772,10 +7778,10 @@ public class WindowManagerService extends IWindowManager.Stub
// requested to be hidden.
dc.getInsetsStateController().getImeSourceProvider().abortShowImePostLayout();
}
- if (dc != null && dc.mInputMethodControlTarget != null) {
+ if (dc != null && dc.getImeTarget(IME_TARGET_CONTROL) != null) {
ProtoLog.d(WM_DEBUG_IME, "hideIme Control target: %s ",
- dc.mInputMethodControlTarget);
- dc.mInputMethodControlTarget.hideInsets(
+ dc.getImeTarget(IME_TARGET_CONTROL));
+ dc.getImeTarget(IME_TARGET_CONTROL).hideInsets(
WindowInsets.Type.ime(), true /* fromIme */);
}
if (dc != null) {
@@ -7899,7 +7905,7 @@ public class WindowManagerService extends IWindowManager.Stub
if (dc == null) {
return null;
}
- final InsetsControlTarget target = dc.mInputMethodControlTarget;
+ final InsetsControlTarget target = dc.getImeTarget(IME_TARGET_CONTROL);
if (target == null) {
return null;
}
@@ -7912,10 +7918,10 @@ public class WindowManagerService extends IWindowManager.Stub
public String getImeTargetNameForLogging(int displayId) {
synchronized (mGlobalLock) {
final DisplayContent dc = mRoot.getDisplayContent(displayId);
- if (dc == null) {
+ if (dc == null || dc.getImeTarget(IME_TARGET_LAYERING) == null) {
return null;
}
- return dc.mInputMethodTarget != null ? dc.mInputMethodTarget.getName() : null;
+ return dc.getImeTarget(IME_TARGET_LAYERING).getWindow().getName();
}
}
}
diff --git a/services/core/java/com/android/server/wm/WindowProcessController.java b/services/core/java/com/android/server/wm/WindowProcessController.java
index f3fa978f35dc..835e8036ddbd 100644
--- a/services/core/java/com/android/server/wm/WindowProcessController.java
+++ b/services/core/java/com/android/server/wm/WindowProcessController.java
@@ -819,9 +819,9 @@ public class WindowProcessController extends ConfigurationContainer<Configuratio
if (canUpdate) {
// Make sure the previous top activity in the process no longer be resumed.
if (mPreQTopResumedActivity != null && mPreQTopResumedActivity.isState(RESUMED)) {
- final Task stack = mPreQTopResumedActivity.getRootTask();
- if (stack != null) {
- stack.startPausingLocked(false /* userLeaving */, false /* uiSleeping */,
+ final Task task = mPreQTopResumedActivity.getTask();
+ if (task != null) {
+ task.startPausingLocked(false /* userLeaving */, false /* uiSleeping */,
activity, "top-resumed-changed");
}
}
@@ -1286,12 +1286,12 @@ public class WindowProcessController extends ConfigurationContainer<Configuratio
hasVisibleActivities = true;
}
- final Task rootTask = r.getRootTask();
- if (rootTask != null) {
+ final Task task = r.getTask();
+ if (task != null) {
// There may be a pausing activity that hasn't shown any window and was requested
// to be hidden. But pausing is also a visible state, it should be regarded as
// visible, so the caller can know the next activity should be resumed.
- hasVisibleActivities |= rootTask.handleAppDied(this);
+ hasVisibleActivities |= task.handleAppDied(this);
}
r.handleAppDied();
}
diff --git a/services/core/java/com/android/server/wm/WindowState.java b/services/core/java/com/android/server/wm/WindowState.java
index bc8699e2ee39..32b84a8d0a2c 100644
--- a/services/core/java/com/android/server/wm/WindowState.java
+++ b/services/core/java/com/android/server/wm/WindowState.java
@@ -32,6 +32,7 @@ import static android.os.Trace.TRACE_TAG_WINDOW_MANAGER;
import static android.view.InsetsState.ITYPE_IME;
import static android.view.InsetsState.ITYPE_NAVIGATION_BAR;
import static android.view.SurfaceControl.Transaction;
+import static android.view.SurfaceControl.getGlobalTransaction;
import static android.view.ViewTreeObserver.InternalInsetsInfo.TOUCHABLE_INSETS_CONTENT;
import static android.view.ViewTreeObserver.InternalInsetsInfo.TOUCHABLE_INSETS_FRAME;
import static android.view.ViewTreeObserver.InternalInsetsInfo.TOUCHABLE_INSETS_REGION;
@@ -118,6 +119,8 @@ import static com.android.server.policy.WindowManagerPolicy.TRANSIT_ENTER;
import static com.android.server.policy.WindowManagerPolicy.TRANSIT_EXIT;
import static com.android.server.policy.WindowManagerPolicy.TRANSIT_PREVIEW_DONE;
import static com.android.server.wm.AnimationSpecProto.MOVE;
+import static com.android.server.wm.DisplayContent.IME_TARGET_INPUT;
+import static com.android.server.wm.DisplayContent.IME_TARGET_LAYERING;
import static com.android.server.wm.DisplayContent.logsGestureExclusionRestrictions;
import static com.android.server.wm.DragResizeMode.DRAG_RESIZE_MODE_DOCKED_DIVIDER;
import static com.android.server.wm.DragResizeMode.DRAG_RESIZE_MODE_FREEFORM;
@@ -617,6 +620,8 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
private final Rect mTmpRect = new Rect();
private final Point mTmpPoint = new Point();
+ private final Transaction mTmpTransaction;
+
/**
* If a window is on a display which has been re-parented to a view in another window,
* use this offset to indicate the correct location.
@@ -861,6 +866,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
int ownerId, int showUserId, boolean ownerCanAddInternalSystemWindow,
PowerManagerWrapper powerManagerWrapper) {
super(service);
+ mTmpTransaction = service.mTransactionFactory.get();
mSession = s;
mClient = c;
mAppOp = appOp;
@@ -1108,9 +1114,10 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
final int layoutXDiff;
final int layoutYDiff;
final WindowState imeWin = mWmService.mRoot.getCurrentInputMethodWindow();
+ final InsetsControlTarget imeTarget = dc.getImeTarget(IME_TARGET_LAYERING);
final boolean isInputMethodAdjustTarget = windowsAreFloating
- ? dc.mInputMethodTarget != null && task == dc.mInputMethodTarget.getTask()
- : isInputMethodTarget();
+ ? imeTarget != null && task == imeTarget.getWindow().getTask()
+ : isImeLayeringTarget();
final boolean isImeTarget =
imeWin != null && imeWin.isVisibleNow() && isInputMethodAdjustTarget;
if (isFullscreenAndFillsDisplay || layoutInParentFrame()) {
@@ -1447,9 +1454,9 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
@Override
void onDisplayChanged(DisplayContent dc) {
if (dc != null && mDisplayContent != null && dc != mDisplayContent
- && mDisplayContent.mInputMethodInputTarget == this) {
- dc.setInputMethodInputTarget(mDisplayContent.mInputMethodInputTarget);
- mDisplayContent.mInputMethodInputTarget = null;
+ && getImeInputTarget() == this) {
+ dc.updateImeInputAndControlTarget(getImeInputTarget());
+ mDisplayContent.setImeInputTarget(null);
}
super.onDisplayChanged(dc);
// Window was not laid out for this display yet, so make sure mLayoutSeq does not match.
@@ -2154,14 +2161,14 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
}
final DisplayContent dc = getDisplayContent();
- if (isInputMethodTarget()) {
- // Make sure to set mInputMethodTarget as null when the removed window is the IME
- // target, in case computeImeTarget may use the outdated target.
- dc.mInputMethodTarget = null;
+ if (isImeLayeringTarget()) {
+ // Make sure to set mImeLayeringTarget as null when the removed window is the
+ // IME target, in case computeImeTarget may use the outdated target.
+ dc.setImeLayeringTarget(null);
dc.computeImeTarget(true /* updateImeTarget */);
}
- if (dc.mInputMethodInputTarget == this) {
- dc.setInputMethodInputTarget(null);
+ if (dc.getImeTarget(IME_TARGET_INPUT) == this) {
+ dc.updateImeInputAndControlTarget(null);
}
final int type = mAttrs.type;
@@ -2176,8 +2183,9 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
disposeInputChannel();
- mWinAnimator.destroyDeferredSurfaceLocked();
- mWinAnimator.destroySurfaceLocked();
+ mWinAnimator.destroyDeferredSurfaceLocked(mTmpTransaction);
+ mWinAnimator.destroySurfaceLocked(mTmpTransaction);
+ mTmpTransaction.apply();
mSession.windowRemovedLocked();
try {
mClient.asBinder().unlinkToDeath(mDeathRecipient, 0);
@@ -2645,7 +2653,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
clearPolicyVisibilityFlag(LEGACY_POLICY_VISIBILITY);
}
if (!isVisibleByPolicy()) {
- mWinAnimator.hide("checkPolicyVisibilityChange");
+ mWinAnimator.hide(getGlobalTransaction(), "checkPolicyVisibilityChange");
if (isFocused()) {
ProtoLog.i(WM_DEBUG_FOCUS_LIGHT,
"setAnimationLocked: setting mFocusMayChange true");
@@ -3176,10 +3184,10 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
// detaching any surface control the client added from the client.
for (int i = mChildren.size() - 1; i >= 0; --i) {
final WindowState c = mChildren.get(i);
- c.mWinAnimator.detachChildren();
+ c.mWinAnimator.detachChildren(getGlobalTransaction());
}
- mWinAnimator.detachChildren();
+ mWinAnimator.detachChildren(getGlobalTransaction());
}
try {
@@ -3238,7 +3246,8 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
}
if (appStopped || mWindowRemovalAllowed) {
- mWinAnimator.destroyPreservedSurfaceLocked();
+ mWinAnimator.destroyPreservedSurfaceLocked(mTmpTransaction);
+ mTmpTransaction.apply();
}
if (mDestroying) {
@@ -3274,7 +3283,8 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
// various indicators of whether the client has released the surface.
// This is in general unsafe, and most callers should use {@link #destroySurface}
void destroySurfaceUnchecked() {
- mWinAnimator.destroySurfaceLocked();
+ mWinAnimator.destroySurfaceLocked(mTmpTransaction);
+ mTmpTransaction.apply();
// Clear animating flags now, since the surface is now gone. (Note this is true even
// if the surface is saved, to outside world the surface is still NO_SURFACE.)
@@ -4608,7 +4618,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
// directly above it. The exception is if we are in split screen
// in which case we process the IME at the DisplayContent level to
// ensure it is above the docked divider.
- if (isInputMethodTarget() && !inSplitScreenWindowingMode()) {
+ if (isImeLayeringTarget() && !inSplitScreenWindowingMode()) {
if (getDisplayContent().forAllImeWindows(callback, traverseTopToBottom)) {
return true;
}
@@ -4800,7 +4810,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
c.hideWallpaperWindow(wasDeferred, reason);
}
if (!mWinAnimator.mLastHidden || wasDeferred) {
- mWinAnimator.hide(reason);
+ mWinAnimator.hide(getGlobalTransaction(), reason);
getDisplayContent().mWallpaperController.mDeferredHideWallpaper = null;
dispatchWallpaperVisibility(false);
final DisplayContent displayContent = getDisplayContent();
@@ -4942,7 +4952,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
// on the new one. This prevents blinking when we change elevation of freeform and
// pinned windows.
if (!mWinAnimator.tryChangeFormatInPlaceLocked()) {
- mWinAnimator.preserveSurfaceLocked(getPendingTransaction());
+ mWinAnimator.preserveSurfaceLocked(getSyncTransaction());
result |= RELAYOUT_RES_SURFACE_CHANGED
| RELAYOUT_RES_FIRST_TIME;
scheduleAnimation();
@@ -4961,7 +4971,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
// to preserve and destroy windows which are attached to another, they
// will keep their surface and its size may change over time.
if (mHasSurface && !isChildWindow()) {
- mWinAnimator.preserveSurfaceLocked(getPendingTransaction());
+ mWinAnimator.preserveSurfaceLocked(getSyncTransaction());
result |= RELAYOUT_RES_SURFACE_CHANGED |
RELAYOUT_RES_FIRST_TIME;
scheduleAnimation();
@@ -5204,9 +5214,9 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
@Override
boolean needsZBoost() {
- final WindowState inputMethodTarget = getDisplayContent().mInputMethodTarget;
- if (mIsImWindow && inputMethodTarget != null) {
- final ActivityRecord activity = inputMethodTarget.mActivityRecord;
+ final InsetsControlTarget target = getDisplayContent().getImeTarget(IME_TARGET_LAYERING);
+ if (mIsImWindow && target != null) {
+ final ActivityRecord activity = target.getWindow().mActivityRecord;
if (activity != null) {
return activity.needsZBoost();
}
@@ -5264,7 +5274,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
updateFrameRateSelectionPriorityIfNeeded();
updateGlobalScaleIfNeeded();
- mWinAnimator.prepareSurfaceLocked(SurfaceControl.getGlobalTransaction(), true);
+ mWinAnimator.prepareSurfaceLocked(getSyncTransaction());
super.prepareSurfaces();
}
@@ -5358,14 +5368,14 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
if (isChildWindow()) {
// If we are a child of the input method target we need this promotion.
- if (getParentWindow().isInputMethodTarget()) {
+ if (getParentWindow().isImeLayeringTarget()) {
return true;
}
} else if (mActivityRecord != null) {
// Likewise if we share a token with the Input method target and are ordered
// above it but not necessarily a child (e.g. a Dialog) then we also need
// this promotion.
- final WindowState imeTarget = getDisplayContent().mInputMethodTarget;
+ final WindowState imeTarget = getImeLayeringTarget();
boolean inTokenWithAndAboveImeTarget = imeTarget != null && imeTarget != this
&& imeTarget.mToken == mToken
&& mAttrs.type != TYPE_APPLICATION_STARTING
@@ -5492,8 +5502,18 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
return !mTapExcludeRegion.isEmpty();
}
- boolean isInputMethodTarget() {
- return getDisplayContent().mInputMethodTarget == this;
+ boolean isImeLayeringTarget() {
+ return getDisplayContent().getImeTarget(IME_TARGET_LAYERING) == this;
+ }
+
+ WindowState getImeLayeringTarget() {
+ final InsetsControlTarget target = getDisplayContent().getImeTarget(IME_TARGET_LAYERING);
+ return target != null ? target.getWindow() : null;
+ }
+
+ WindowState getImeInputTarget() {
+ final InsetsControlTarget target = mDisplayContent.getImeTarget(IME_TARGET_INPUT);
+ return target != null ? target.getWindow() : null;
}
long getFrameNumber() {
diff --git a/services/core/java/com/android/server/wm/WindowStateAnimator.java b/services/core/java/com/android/server/wm/WindowStateAnimator.java
index 9cc72a2ddf7c..068d0dfd0602 100644
--- a/services/core/java/com/android/server/wm/WindowStateAnimator.java
+++ b/services/core/java/com/android/server/wm/WindowStateAnimator.java
@@ -57,7 +57,6 @@ import static com.android.server.wm.WindowSurfacePlacer.SET_ORIENTATION_CHANGE_C
import android.content.Context;
import android.graphics.Matrix;
import android.graphics.PixelFormat;
-import android.graphics.Point;
import android.graphics.Rect;
import android.graphics.Region;
import android.os.Debug;
@@ -130,10 +129,6 @@ class WindowStateAnimator {
float mAlpha = 0;
float mLastAlpha = 0;
- Rect mTmpStackBounds = new Rect();
- private Rect mTmpAnimatingBounds = new Rect();
- private Rect mTmpSourceBounds = new Rect();
-
/**
* This is rectangle of the window's surface that is not covered by
* system decorations.
@@ -154,8 +149,6 @@ class WindowStateAnimator {
* window is first added or shown, cleared when the callback has been made. */
boolean mEnteringAnimation;
- private final SurfaceControl.Transaction mTmpTransaction;
-
/** The pixel format of the underlying SurfaceControl */
int mSurfaceFormat;
@@ -201,12 +194,6 @@ class WindowStateAnimator {
// region.
float mWallpaperScale = 1f;
- /**
- * A flag to determine if the WSA needs to offset its position to compensate for the stack's
- * position update before the WSA surface has resized.
- */
- private boolean mOffsetPositionForStackResize;
-
private final Rect mTmpSize = new Rect();
/**
@@ -220,13 +207,10 @@ class WindowStateAnimator {
private final SurfaceControl.Transaction mPostDrawTransaction =
new SurfaceControl.Transaction();
- private final Point mTmpPos = new Point();
-
WindowStateAnimator(final WindowState win) {
final WindowManagerService service = win.mWmService;
mService = service;
- mTmpTransaction = service.mTransactionFactory.get();
mAnimator = service.mAnimator;
mPolicy = service.mPolicy;
mContext = service.mContext;
@@ -243,7 +227,7 @@ class WindowStateAnimator {
if (DEBUG_ANIM) Slog.v(
TAG, "Animation done in " + this + ": exiting=" + mWin.mAnimatingExit
+ ", reportedVisible="
- + (mWin.mActivityRecord != null ? mWin.mActivityRecord.reportedVisible : false));
+ + (mWin.mActivityRecord != null && mWin.mActivityRecord.reportedVisible));
mWin.checkPolicyVisibilityChange();
final DisplayContent displayContent = mWin.getDisplayContent();
@@ -284,11 +268,6 @@ class WindowStateAnimator {
}
}
- void hide(String reason) {
- hide(mTmpTransaction, reason);
- SurfaceControl.mergeToGlobalTransaction(mTmpTransaction);
- }
-
boolean finishDrawingLocked(SurfaceControl.Transaction postDrawTransaction) {
final boolean startingWindow =
mWin.mAttrs.type == WindowManager.LayoutParams.TYPE_APPLICATION_STARTING;
@@ -362,7 +341,7 @@ class WindowStateAnimator {
mSurfaceController.mSurfaceControl,
mPendingDestroySurface.mSurfaceControl).apply();
}
- destroySurfaceLocked();
+ destroySurfaceLocked(t);
mSurfaceDestroyDeferred = true;
return;
}
@@ -375,10 +354,10 @@ class WindowStateAnimator {
}
mDestroyPreservedSurfaceUponRedraw = true;
mSurfaceDestroyDeferred = true;
- destroySurfaceLocked();
+ destroySurfaceLocked(t);
}
- void destroyPreservedSurfaceLocked() {
+ void destroyPreservedSurfaceLocked(SurfaceControl.Transaction t) {
if (!mDestroyPreservedSurfaceUponRedraw) {
return;
}
@@ -397,7 +376,7 @@ class WindowStateAnimator {
mSurfaceController.mSurfaceControl).apply();
}
- destroyDeferredSurfaceLocked();
+ destroyDeferredSurfaceLocked(t);
mDestroyPreservedSurfaceUponRedraw = false;
}
@@ -484,7 +463,6 @@ class WindowStateAnimator {
mSurfaceController.setColorSpaceAgnostic((attrs.privateFlags
& WindowManager.LayoutParams.PRIVATE_FLAG_COLOR_SPACE_AGNOSTIC) != 0);
- setOffsetPositionForStackResize(false);
mSurfaceFormat = format;
w.setHasSurface(true);
@@ -529,7 +507,7 @@ class WindowStateAnimator {
return mSurfaceController != null && mSurfaceController.hasSurface();
}
- void destroySurfaceLocked() {
+ void destroySurfaceLocked(SurfaceControl.Transaction t) {
final ActivityRecord activity = mWin.mActivityRecord;
if (activity != null) {
if (mWin == activity.mStartingWindow) {
@@ -557,14 +535,14 @@ class WindowStateAnimator {
if (mPendingDestroySurface != null) {
ProtoLog.i(WM_SHOW_SURFACE_ALLOC, "SURFACE DESTROY PENDING: %s. %s",
mWin, new RuntimeException().fillInStackTrace());
- mPendingDestroySurface.destroyNotInTransaction();
+ mPendingDestroySurface.destroy(t);
}
mPendingDestroySurface = mSurfaceController;
}
} else {
ProtoLog.i(WM_SHOW_SURFACE_ALLOC, "SURFACE DESTROY: %s. %s",
mWin, new RuntimeException().fillInStackTrace());
- destroySurface();
+ destroySurface(t);
}
// Don't hide wallpaper if we're deferring the surface destroy
// because of a surface change.
@@ -587,12 +565,12 @@ class WindowStateAnimator {
mDrawState = NO_SURFACE;
}
- void destroyDeferredSurfaceLocked() {
+ void destroyDeferredSurfaceLocked(SurfaceControl.Transaction t) {
try {
if (mPendingDestroySurface != null) {
ProtoLog.i(WM_SHOW_SURFACE_ALLOC, "SURFACE DESTROY PENDING: %s. %s",
mWin, new RuntimeException().fillInStackTrace());
- mPendingDestroySurface.destroyNotInTransaction();
+ mPendingDestroySurface.destroy(t);
// Don't hide wallpaper if we're destroying a deferred surface
// after a surface mode change.
if (!mDestroyPreservedSurfaceUponRedraw) {
@@ -655,93 +633,49 @@ class WindowStateAnimator {
return true;
}
- void setSurfaceBoundariesLocked(SurfaceControl.Transaction t, final boolean recoveringMemory) {
+ void setSurfaceBoundariesLocked(SurfaceControl.Transaction t) {
if (mSurfaceController == null) {
return;
}
final WindowState w = mWin;
- final LayoutParams attrs = mWin.getAttrs();
final Task task = w.getTask();
if (shouldConsumeMainWindowSizeTransaction()) {
- t.deferTransactionUntil(task.getMainWindowSizeChangeTask().getSurfaceControl(),
- mWin.getClientViewRootSurface(), mWin.getFrameNumber());
- t.deferTransactionUntil(mSurfaceController.mSurfaceControl,
- mWin.getClientViewRootSurface(), mWin.getFrameNumber());
- t.merge(task.getMainWindowSizeChangeTransaction());
+ // Use pending transaction here instead of the transaction passed in because we want to
+ // ensure the defer transaction is applied on the main transaction and not on the sync
+ // transaction. This is because the sync transaction could contain the buffer and we'd
+ // defer the transaction that contains the buffer we're deferring on.
+ SurfaceControl.Transaction pendingTransaction = mWin.getPendingTransaction();
+ pendingTransaction.deferTransactionUntil(
+ task.getMainWindowSizeChangeTask().getSurfaceControl(),
+ mWin.getClientViewRootSurface(), mWin.getFrameNumber());
+ pendingTransaction.deferTransactionUntil(mSurfaceController.mSurfaceControl,
+ mWin.getClientViewRootSurface(), mWin.getFrameNumber());
+ pendingTransaction.merge(task.getMainWindowSizeChangeTransaction());
task.setMainWindowSizeChangeTransaction(null);
}
- float surfaceWidth = mSurfaceController.getWidth();
- float surfaceHeight = mSurfaceController.getHeight();
-
- final Rect insets = attrs.surfaceInsets;
-
- // getFrameNumber is only valid in the call-stack of relayoutWindow
- // as this is the only-time we know the client renderer
- // is paused.
- final boolean relayout = !w.mRelayoutCalled || w.mInRelayout;
-
if (!w.mSeamlesslyRotated) {
// Used to offset the WSA when stack position changes before a resize.
int xOffset = mXOffset;
int yOffset = mYOffset;
- if (mOffsetPositionForStackResize) {
- if (relayout) {
- // Once a relayout is called, reset the offset back to 0 and defer
- // setting it until a new frame with the updated size. This ensures that
- // the WS position is reset (so the stack position is shown) at the same
- // time that the buffer size changes.
- setOffsetPositionForStackResize(false);
- t.deferTransactionUntil(mSurfaceController.mSurfaceControl,
- mWin.getClientViewRootSurface(), mWin.getFrameNumber());
- } else {
- final Task stack = mWin.getRootTask();
- mTmpPos.x = 0;
- mTmpPos.y = 0;
- if (stack != null) {
- stack.getRelativePosition(mTmpPos);
- }
- xOffset = -mTmpPos.x;
- yOffset = -mTmpPos.y;
- }
- }
- if (!mIsWallpaper) {
- mSurfaceController.setPosition(t, xOffset, yOffset, recoveringMemory);
- } else {
- setWallpaperPositionAndScale(t,
- xOffset, yOffset, mWallpaperScale, recoveringMemory);
- }
- }
-
- if (!w.mSeamlesslyRotated) {
- // Wallpaper is already updated above when calling setWallpaperPositionAndScale so
- // we only need to consider the non-wallpaper case here.
if (!mIsWallpaper) {
+ mSurfaceController.setPosition(t, xOffset, yOffset);
+ // Wallpaper is already updated above when calling setWallpaperPositionAndScale so
+ // we only need to consider the non-wallpaper case here.
mSurfaceController.setMatrix(t,
- mDsDx * w.mHScale,
- mDtDx * w.mVScale,
- mDtDy * w.mHScale,
- mDsDy * w.mVScale, recoveringMemory);
+ mDsDx * w.mHScale,
+ mDtDx * w.mVScale,
+ mDtDy * w.mHScale,
+ mDsDy * w.mVScale);
+ } else {
+ setWallpaperPositionAndScale(t, xOffset, yOffset, mWallpaperScale);
}
}
}
- /**
- * Get rect of the task this window is currently in. If there is no task, rect will be set to
- * empty.
- */
- void getContainerRect(Rect rect) {
- final Task task = mWin.getTask();
- if (task != null) {
- task.getDimBounds(rect);
- } else {
- rect.left = rect.top = rect.right = rect.bottom = 0;
- }
- }
-
- void prepareSurfaceLocked(SurfaceControl.Transaction t, final boolean recoveringMemory) {
+ void prepareSurfaceLocked(SurfaceControl.Transaction t) {
final WindowState w = mWin;
if (!hasSurface()) {
@@ -758,13 +692,13 @@ class WindowStateAnimator {
computeShownFrameLocked();
- setSurfaceBoundariesLocked(t, recoveringMemory);
+ setSurfaceBoundariesLocked(t);
if (mIsWallpaper && !w.mWallpaperVisible) {
// Wallpaper is no longer visible and there is no wp target => hide it.
- hide("prepareSurfaceLocked");
+ hide(t, "prepareSurfaceLocked");
} else if (w.isParentWindowHidden() || !w.isOnScreen()) {
- hide("prepareSurfaceLocked");
+ hide(t, "prepareSurfaceLocked");
mWallpaperControllerLocked.hideWallpapers(w);
// If we are waiting for this window to handle an orientation change. If this window is
@@ -800,21 +734,20 @@ class WindowStateAnimator {
boolean prepared = true;
if (mIsWallpaper) {
- setWallpaperPositionAndScale(t,
- mXOffset, mYOffset, mWallpaperScale, recoveringMemory);
+ setWallpaperPositionAndScale(t, mXOffset, mYOffset, mWallpaperScale);
} else {
prepared =
- mSurfaceController.prepareToShowInTransaction(mShownAlpha,
+ mSurfaceController.prepareToShowInTransaction(t, mShownAlpha,
mDsDx * w.mHScale,
mDtDx * w.mVScale,
mDtDy * w.mHScale,
- mDsDy * w.mVScale,
- recoveringMemory);
+ mDsDy * w.mVScale
+ );
}
if (prepared && mDrawState == HAS_DRAWN) {
if (mLastHidden) {
- if (showSurfaceRobustlyLocked()) {
+ if (showSurfaceRobustlyLocked(t)) {
markPreservedSurfaceForDestroy();
mAnimator.requestRemovalOfReplacedWindows(w);
mLastHidden = false;
@@ -888,8 +821,7 @@ class WindowStateAnimator {
Slog.i(TAG, ">>> OPEN TRANSACTION setWallpaperOffset");
}
mService.openSurfaceTransaction();
- setWallpaperPositionAndScale(SurfaceControl.getGlobalTransaction(),
- dx, dy, scale, false);
+ setWallpaperPositionAndScale(SurfaceControl.getGlobalTransaction(), dx, dy, scale);
} catch (RuntimeException e) {
Slog.w(TAG, "Error positioning surface of " + mWin
+ " pos=(" + dx + "," + dy + ")", e);
@@ -904,8 +836,8 @@ class WindowStateAnimator {
return true;
}
- private void setWallpaperPositionAndScale(SurfaceControl.Transaction t,
- int dx, int dy, float scale, boolean recoveringMemory) {
+ private void setWallpaperPositionAndScale(SurfaceControl.Transaction t, int dx, int dy,
+ float scale) {
DisplayInfo displayInfo = mWin.getDisplayInfo();
Matrix matrix = mWin.mTmpMatrix;
matrix.setTranslate(dx, dy);
@@ -915,13 +847,12 @@ class WindowStateAnimator {
matrix.reset();
mSurfaceController.setPosition(t,mWin.mTmpMatrixArray[MTRANS_X],
- mWin.mTmpMatrixArray[MTRANS_Y], recoveringMemory);
+ mWin.mTmpMatrixArray[MTRANS_Y]);
mSurfaceController.setMatrix(t,
mDsDx * mWin.mTmpMatrixArray[MSCALE_X] * mWin.mHScale,
mDtDx * mWin.mTmpMatrixArray[MSKEW_Y] * mWin.mVScale,
mDtDy * mWin.mTmpMatrixArray[MSKEW_X] * mWin.mHScale,
- mDsDy * mWin.mTmpMatrixArray[MSCALE_Y] * mWin.mVScale,
- recoveringMemory);
+ mDsDy * mWin.mTmpMatrixArray[MSCALE_Y] * mWin.mVScale);
}
/**
@@ -974,8 +905,8 @@ class WindowStateAnimator {
*
* @return Returns true if the surface was successfully shown.
*/
- private boolean showSurfaceRobustlyLocked() {
- boolean shown = mSurfaceController.showRobustlyInTransaction();
+ private boolean showSurfaceRobustlyLocked(SurfaceControl.Transaction t) {
+ boolean shown = mSurfaceController.showRobustly(t);
if (!shown)
return false;
@@ -993,7 +924,7 @@ class WindowStateAnimator {
}
}
- SurfaceControl.mergeToGlobalTransaction(mPostDrawTransaction);
+ t.merge(mPostDrawTransaction);
return true;
}
@@ -1163,10 +1094,6 @@ class WindowStateAnimator {
return sb.toString();
}
- void reclaimSomeSurfaceMemory(String operation, boolean secure) {
- mService.mRoot.reclaimSomeSurfaceMemory(this, operation, secure);
- }
-
boolean getShown() {
if (mSurfaceController != null) {
return mSurfaceController.getShown();
@@ -1174,10 +1101,10 @@ class WindowStateAnimator {
return false;
}
- void destroySurface() {
+ void destroySurface(SurfaceControl.Transaction t) {
try {
if (mSurfaceController != null) {
- mSurfaceController.destroyNotInTransaction();
+ mSurfaceController.destroy(t);
}
} catch (RuntimeException e) {
Slog.w(TAG, "Exception thrown when destroying surface " + this
@@ -1189,7 +1116,7 @@ class WindowStateAnimator {
}
}
- void detachChildren() {
+ void detachChildren(SurfaceControl.Transaction t) {
// Do not detach children of starting windows, as their lifecycle is well under control and
// it may lead to issues in case we relaunch when we just added the starting window.
@@ -1197,14 +1124,10 @@ class WindowStateAnimator {
return;
}
if (mSurfaceController != null) {
- mSurfaceController.detachChildren();
+ mSurfaceController.detachChildren(t);
}
}
- void setOffsetPositionForStackResize(boolean offsetPositionForStackResize) {
- mOffsetPositionForStackResize = offsetPositionForStackResize;
- }
-
SurfaceControl getSurfaceControl() {
if (!hasSurface()) {
return null;
diff --git a/services/core/java/com/android/server/wm/WindowSurfaceController.java b/services/core/java/com/android/server/wm/WindowSurfaceController.java
index ec79c5999a3f..788f00407671 100644
--- a/services/core/java/com/android/server/wm/WindowSurfaceController.java
+++ b/services/core/java/com/android/server/wm/WindowSurfaceController.java
@@ -20,6 +20,7 @@ import static android.os.Trace.TRACE_TAG_WINDOW_MANAGER;
import static android.view.SurfaceControl.METADATA_OWNER_PID;
import static android.view.SurfaceControl.METADATA_OWNER_UID;
import static android.view.SurfaceControl.METADATA_WINDOW_TYPE;
+import static android.view.SurfaceControl.getGlobalTransaction;
import static com.android.internal.protolog.ProtoLogGroup.WM_SHOW_SURFACE_ALLOC;
import static com.android.internal.protolog.ProtoLogGroup.WM_SHOW_TRANSACTIONS;
@@ -76,8 +77,6 @@ class WindowSurfaceController {
private final int mWindowType;
private final Session mWindowSession;
- private final SurfaceControl.Transaction mTmpTransaction;
-
// Used to track whether we have called detach children on the way to invisibility.
boolean mChildrenDetached;
@@ -94,7 +93,6 @@ class WindowSurfaceController {
final WindowState win = animator.mWin;
mWindowType = windowType;
mWindowSession = win.mSession;
- mTmpTransaction = mService.mTransactionFactory.get();
Trace.traceBegin(TRACE_TAG_WINDOW_MANAGER, "new SurfaceControl");
final SurfaceControl.Builder b = win.makeSurface()
@@ -120,18 +118,18 @@ class WindowSurfaceController {
Trace.traceEnd(TRACE_TAG_WINDOW_MANAGER);
}
- void detachChildren() {
+ void detachChildren(SurfaceControl.Transaction t) {
ProtoLog.i(WM_SHOW_TRANSACTIONS, "SEVER CHILDREN");
mChildrenDetached = true;
if (mSurfaceControl != null) {
- mSurfaceControl.detachChildren();
+ t.detachChildren(mSurfaceControl);
}
}
void hide(SurfaceControl.Transaction transaction, String reason) {
ProtoLog.i(WM_SHOW_TRANSACTIONS, "SURFACE HIDE ( %s ): %s", reason, title);
- mAnimator.destroyPreservedSurfaceLocked();
+ mAnimator.destroyPreservedSurfaceLocked(transaction);
if (mSurfaceShown) {
hideSurface(transaction);
}
@@ -149,12 +147,12 @@ class WindowSurfaceController {
}
}
- void destroyNotInTransaction() {
+ void destroy(SurfaceControl.Transaction t) {
ProtoLog.i(WM_SHOW_SURFACE_ALLOC,
- "Destroying surface %s called by %s", this, Debug.getCallers(8));
+ "Destroying surface %s called by %s", this, Debug.getCallers(8));
try {
if (mSurfaceControl != null) {
- mTmpTransaction.remove(mSurfaceControl).apply();
+ t.remove(mSurfaceControl);
}
} catch (RuntimeException e) {
Slog.w(TAG, "Error destroying surface in: " + this, e);
@@ -164,30 +162,22 @@ class WindowSurfaceController {
}
}
- void setPosition(SurfaceControl.Transaction t, float left, float top,
- boolean recoveringMemory) {
+ void setPosition(SurfaceControl.Transaction t, float left, float top) {
final boolean surfaceMoved = mSurfaceX != left || mSurfaceY != top;
- if (surfaceMoved) {
- mSurfaceX = left;
- mSurfaceY = top;
-
- try {
- ProtoLog.i(WM_SHOW_TRANSACTIONS,
- "SURFACE POS (setPositionInTransaction) @ (%f,%f): %s", left, top, title);
-
- t.setPosition(mSurfaceControl, left, top);
- } catch (RuntimeException e) {
- Slog.w(TAG, "Error positioning surface of " + this
- + " pos=(" + left + "," + top + ")", e);
- if (!recoveringMemory) {
- mAnimator.reclaimSomeSurfaceMemory("position", true);
- }
- }
+ if (!surfaceMoved) {
+ return;
}
+
+ mSurfaceX = left;
+ mSurfaceY = top;
+
+ ProtoLog.i(WM_SHOW_TRANSACTIONS,
+ "SURFACE POS (setPositionInTransaction) @ (%f,%f): %s", left, top, title);
+
+ t.setPosition(mSurfaceControl, left, top);
}
- void setMatrix(SurfaceControl.Transaction t, float dsdx, float dtdx,
- float dtdy, float dsdy, boolean recoveringMemory) {
+ void setMatrix(SurfaceControl.Transaction t, float dsdx, float dtdx, float dtdy, float dsdy) {
final boolean matrixChanged = mLastDsdx != dsdx || mLastDtdx != dtdx ||
mLastDtdy != dtdy || mLastDsdy != dsdy;
if (!matrixChanged) {
@@ -199,43 +189,24 @@ class WindowSurfaceController {
mLastDtdy = dtdy;
mLastDsdy = dsdy;
- try {
- ProtoLog.i(WM_SHOW_TRANSACTIONS, "SURFACE MATRIX [%f,%f,%f,%f]: %s",
- dsdx, dtdx, dtdy, dsdy, title);
- t.setMatrix(mSurfaceControl, dsdx, dtdx, dtdy, dsdy);
- } catch (RuntimeException e) {
- // If something goes wrong with the surface (such
- // as running out of memory), don't take down the
- // entire system.
- Slog.e(TAG, "Error setting matrix on surface surface" + title
- + " MATRIX [" + dsdx + "," + dtdx + "," + dtdy + "," + dsdy + "]", null);
- if (!recoveringMemory) {
- mAnimator.reclaimSomeSurfaceMemory("matrix", true);
- }
- }
+ ProtoLog.i(WM_SHOW_TRANSACTIONS, "SURFACE MATRIX [%f,%f,%f,%f]: %s",
+ dsdx, dtdx, dtdy, dsdy, title);
+ t.setMatrix(mSurfaceControl, dsdx, dtdx, dtdy, dsdy);
}
- boolean prepareToShowInTransaction(float alpha,
- float dsdx, float dtdx, float dsdy,
- float dtdy, boolean recoveringMemory) {
- if (mSurfaceControl != null) {
- try {
- mSurfaceAlpha = alpha;
- mSurfaceControl.setAlpha(alpha);
- mLastDsdx = dsdx;
- mLastDtdx = dtdx;
- mLastDsdy = dsdy;
- mLastDtdy = dtdy;
- mSurfaceControl.setMatrix(
- dsdx, dtdx, dsdy, dtdy);
- } catch (RuntimeException e) {
- Slog.w(TAG, "Error updating surface in " + title, e);
- if (!recoveringMemory) {
- mAnimator.reclaimSomeSurfaceMemory("update", true);
- }
- return false;
- }
+ boolean prepareToShowInTransaction(SurfaceControl.Transaction t, float alpha, float dsdx,
+ float dtdx, float dsdy, float dtdy) {
+ if (mSurfaceControl == null) {
+ return false;
}
+
+ mSurfaceAlpha = alpha;
+ t.setAlpha(mSurfaceControl, alpha);
+ mLastDsdx = dsdx;
+ mLastDtdx = dtdx;
+ mLastDsdy = dsdy;
+ mLastDtdy = dtdy;
+ t.setMatrix(mSurfaceControl, dsdx, dtdx, dsdy, dtdy);
return true;
}
@@ -247,7 +218,7 @@ class WindowSurfaceController {
if (SHOW_LIGHT_TRANSACTIONS) Slog.i(TAG, ">>> OPEN TRANSACTION setTransparentRegion");
mService.openSurfaceTransaction();
try {
- mSurfaceControl.setTransparentRegionHint(region);
+ getGlobalTransaction().setTransparentRegionHint(mSurfaceControl, region);
} finally {
mService.closeSurfaceTransaction("setTransparentRegion");
if (SHOW_LIGHT_TRANSACTIONS) Slog.i(TAG,
@@ -264,7 +235,7 @@ class WindowSurfaceController {
if (SHOW_LIGHT_TRANSACTIONS) Slog.i(TAG, ">>> OPEN TRANSACTION setOpaqueLocked");
mService.openSurfaceTransaction();
try {
- mSurfaceControl.setOpaque(isOpaque);
+ getGlobalTransaction().setOpaque(mSurfaceControl, isOpaque);
} finally {
mService.closeSurfaceTransaction("setOpaqueLocked");
if (SHOW_LIGHT_TRANSACTIONS) Slog.i(TAG, "<<< CLOSE TRANSACTION setOpaqueLocked");
@@ -282,7 +253,7 @@ class WindowSurfaceController {
if (SHOW_LIGHT_TRANSACTIONS) Slog.i(TAG, ">>> OPEN TRANSACTION setBackgroundBlurRadius");
mService.openSurfaceTransaction();
try {
- mSurfaceControl.setBackgroundBlurRadius(radius);
+ getGlobalTransaction().setBackgroundBlurRadius(mSurfaceControl, radius);
} finally {
mService.closeSurfaceTransaction("setBackgroundBlurRadius");
if (SHOW_LIGHT_TRANSACTIONS) {
@@ -300,7 +271,7 @@ class WindowSurfaceController {
if (SHOW_LIGHT_TRANSACTIONS) Slog.i(TAG, ">>> OPEN TRANSACTION setSecureLocked");
mService.openSurfaceTransaction();
try {
- mSurfaceControl.setSecure(isSecure);
+ getGlobalTransaction().setSecure(mSurfaceControl, isSecure);
} finally {
mService.closeSurfaceTransaction("setSecure");
if (SHOW_LIGHT_TRANSACTIONS) Slog.i(TAG, "<<< CLOSE TRANSACTION setSecureLocked");
@@ -318,7 +289,7 @@ class WindowSurfaceController {
}
mService.openSurfaceTransaction();
try {
- mSurfaceControl.setColorSpaceAgnostic(agnostic);
+ getGlobalTransaction().setColorSpaceAgnostic(mSurfaceControl, agnostic);
} finally {
mService.closeSurfaceTransaction("setColorSpaceAgnostic");
if (SHOW_LIGHT_TRANSACTIONS) {
@@ -327,7 +298,7 @@ class WindowSurfaceController {
}
}
- boolean showRobustlyInTransaction() {
+ boolean showRobustly(SurfaceControl.Transaction t) {
ProtoLog.i(WM_SHOW_TRANSACTIONS, "SURFACE SHOW (performLayout): %s", title);
if (DEBUG_VISIBILITY) Slog.v(TAG, "Showing " + this
+ " during relayout");
@@ -336,21 +307,9 @@ class WindowSurfaceController {
return true;
}
- try {
- setShown(true);
- mSurfaceControl.show();
- return true;
- } catch (RuntimeException e) {
- Slog.w(TAG, "Failure showing surface " + mSurfaceControl + " in " + this, e);
- }
-
- mAnimator.reclaimSomeSurfaceMemory("show", true);
- return false;
- }
-
- void deferTransactionUntil(SurfaceControl barrier, long frame) {
- // TODO: Logging
- mSurfaceControl.deferTransactionUntil(barrier, frame);
+ setShown(true);
+ t.show(mSurfaceControl);
+ return true;
}
boolean clearWindowContentFrameStats() {
@@ -391,14 +350,6 @@ class WindowSurfaceController {
}
}
- int getWidth() {
- return mSurfaceW;
- }
-
- int getHeight() {
- return mSurfaceH;
- }
-
void dumpDebug(ProtoOutputStream proto, long fieldId) {
final long token = proto.start(fieldId);
proto.write(SHOWN, mSurfaceShown);
diff --git a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
index 62cf3aa53e7c..d35d806741e6 100644
--- a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
+++ b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
@@ -3368,7 +3368,7 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager {
final boolean qualityMayApplyToParent =
canSetPasswordQualityOnParent(who.getPackageName(), caller.getUserId());
if (!qualityMayApplyToParent) {
- Preconditions.checkArgument(!parent,
+ Preconditions.checkCallAuthorization(!parent,
"Profile Owner may not apply password quality requirements device-wide");
}
diff --git a/services/robotests/src/com/android/server/location/OWNERS b/services/robotests/src/com/android/server/location/OWNERS
new file mode 100644
index 000000000000..696a0c22c605
--- /dev/null
+++ b/services/robotests/src/com/android/server/location/OWNERS
@@ -0,0 +1 @@
+file:/location/java/android/location/OWNERS
diff --git a/services/tests/mockingservicestests/src/com/android/server/display/LocalDisplayAdapterTest.java b/services/tests/mockingservicestests/src/com/android/server/display/LocalDisplayAdapterTest.java
index dbdee979b6a4..af4130d92cfe 100644
--- a/services/tests/mockingservicestests/src/com/android/server/display/LocalDisplayAdapterTest.java
+++ b/services/tests/mockingservicestests/src/com/android/server/display/LocalDisplayAdapterTest.java
@@ -19,11 +19,14 @@ package com.android.server.display;
import static com.android.dx.mockito.inline.extended.ExtendedMockito.doReturn;
import static com.android.dx.mockito.inline.extended.ExtendedMockito.mockitoSession;
import static com.android.dx.mockito.inline.extended.ExtendedMockito.spyOn;
+import static com.android.dx.mockito.inline.extended.ExtendedMockito.verify;
import static com.google.common.truth.Truth.assertThat;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
+import static org.mockito.ArgumentMatchers.anyFloat;
+import static org.mockito.Mockito.never;
import android.content.Context;
import android.content.res.Resources;
@@ -40,7 +43,9 @@ import androidx.test.runner.AndroidJUnit4;
import com.android.dx.mockito.inline.extended.StaticMockitoSession;
import com.android.server.LocalServices;
+import com.android.server.display.LocalDisplayAdapter.BacklightAdapter;
import com.android.server.lights.LightsManager;
+import com.android.server.lights.LogicalLight;
import com.google.common.truth.Truth;
@@ -78,6 +83,8 @@ public class LocalDisplayAdapterTest {
private Resources mMockedResources;
@Mock
private LightsManager mMockedLightsManager;
+ @Mock
+ private LogicalLight mMockedBacklight;
private Handler mHandler;
@@ -492,6 +499,49 @@ public class LocalDisplayAdapterTest {
waitForHandlerToComplete(mHandler, HANDLER_WAIT_MS);
}
+ @Test
+ public void testBacklightAdapter_withSurfaceControlSupport() {
+ final Binder displayToken = new Binder();
+ doReturn(true).when(() -> SurfaceControl.getDisplayBrightnessSupport(displayToken));
+
+ // Test as default display
+ BacklightAdapter ba = new BacklightAdapter(displayToken, true /*isDefault*/);
+ ba.setBrightness(0.514f);
+ verify(() -> SurfaceControl.setDisplayBrightness(displayToken, 0.514f));
+
+ // Test as not default display
+ BacklightAdapter ba2 = new BacklightAdapter(displayToken,
+ false /*isDefault*/);
+ ba2.setBrightness(0.323f);
+ verify(() -> SurfaceControl.setDisplayBrightness(displayToken, 0.323f));
+ }
+
+ @Test
+ public void testBacklightAdapter_withoutSourceControlSupport_defaultDisplay() {
+ final Binder displayToken = new Binder();
+ doReturn(false).when(() -> SurfaceControl.getDisplayBrightnessSupport(displayToken));
+ doReturn(mMockedBacklight).when(mMockedLightsManager)
+ .getLight(LightsManager.LIGHT_ID_BACKLIGHT);
+
+ BacklightAdapter ba = new BacklightAdapter(displayToken, true /*isDefault*/);
+ ba.setBrightness(0.123f);
+ verify(mMockedBacklight).setBrightness(0.123f);
+ }
+
+ @Test
+ public void testBacklightAdapter_withoutSourceControlSupport_nonDefaultDisplay() {
+ final Binder displayToken = new Binder();
+ doReturn(false).when(() -> SurfaceControl.getDisplayBrightnessSupport(displayToken));
+ doReturn(mMockedBacklight).when(mMockedLightsManager)
+ .getLight(LightsManager.LIGHT_ID_BACKLIGHT);
+
+ BacklightAdapter ba = new BacklightAdapter(displayToken, false /*isDefault*/);
+ ba.setBrightness(0.456f);
+
+ // Adapter does not forward any brightness in this case.
+ verify(mMockedBacklight, never()).setBrightness(anyFloat());
+ }
+
private void assertDisplayDpi(DisplayDeviceInfo info, int expectedPort,
float expectedXdpi,
float expectedYDpi,
diff --git a/services/tests/servicestests/src/com/android/server/GestureLauncherServiceTest.java b/services/tests/servicestests/src/com/android/server/GestureLauncherServiceTest.java
index a02c53336da0..6814c050a845 100644
--- a/services/tests/servicestests/src/com/android/server/GestureLauncherServiceTest.java
+++ b/services/tests/servicestests/src/com/android/server/GestureLauncherServiceTest.java
@@ -163,16 +163,26 @@ public class GestureLauncherServiceTest {
}
@Test
- public void testIsEmergencyGestureEnabled_settingDisabled() {
+ public void testIsEmergencyGestureSettingEnabled_settingDisabled() {
+ withEmergencyGestureEnabledConfigValue(true);
withEmergencyGestureEnabledSettingValue(false);
- assertFalse(mGestureLauncherService.isEmergencyGestureEnabled(
+ assertFalse(mGestureLauncherService.isEmergencyGestureSettingEnabled(
mContext, FAKE_USER_ID));
}
@Test
- public void testIsEmergencyGestureEnabled_settingEnabled() {
+ public void testIsEmergencyGestureSettingEnabled_settingEnabled() {
+ withEmergencyGestureEnabledConfigValue(true);
withEmergencyGestureEnabledSettingValue(true);
- assertTrue(mGestureLauncherService.isEmergencyGestureEnabled(
+ assertTrue(mGestureLauncherService.isEmergencyGestureSettingEnabled(
+ mContext, FAKE_USER_ID));
+ }
+
+ @Test
+ public void testIsEmergencyGestureSettingEnabled_supportDisabled() {
+ withEmergencyGestureEnabledConfigValue(false);
+ withEmergencyGestureEnabledSettingValue(true);
+ assertFalse(mGestureLauncherService.isEmergencyGestureSettingEnabled(
mContext, FAKE_USER_ID));
}
@@ -438,6 +448,7 @@ public class GestureLauncherServiceTest {
testInterceptPowerKeyDown_fiveInboundPresses_cameraAndEmergencyEnabled_bothLaunch() {
withCameraDoubleTapPowerEnableConfigValue(true);
withCameraDoubleTapPowerDisableSettingValue(0);
+ withEmergencyGestureEnabledConfigValue(true);
withEmergencyGestureEnabledSettingValue(true);
mGestureLauncherService.updateCameraDoubleTapPowerEnabled();
mGestureLauncherService.updateEmergencyGestureEnabled();
@@ -527,6 +538,7 @@ public class GestureLauncherServiceTest {
@Test
public void
testInterceptPowerKeyDown_fiveInboundPresses_emergencyGestureEnabled_launchesFlow() {
+ withEmergencyGestureEnabledConfigValue(true);
withEmergencyGestureEnabledSettingValue(true);
mGestureLauncherService.updateEmergencyGestureEnabled();
withUserSetupCompleteValue(true);
@@ -580,6 +592,7 @@ public class GestureLauncherServiceTest {
@Test
public void
testInterceptPowerKeyDown_tenInboundPresses_emergencyGestureEnabled_keyIntercepted() {
+ withEmergencyGestureEnabledConfigValue(true);
withEmergencyGestureEnabledSettingValue(true);
mGestureLauncherService.updateEmergencyGestureEnabled();
withUserSetupCompleteValue(true);
@@ -1146,6 +1159,12 @@ public class GestureLauncherServiceTest {
.thenReturn(enableConfigValue);
}
+ private void withEmergencyGestureEnabledConfigValue(boolean enableConfigValue) {
+ when(mResources.getBoolean(
+ com.android.internal.R.bool.config_emergencyGestureEnabled))
+ .thenReturn(enableConfigValue);
+ }
+
private void withCameraDoubleTapPowerDisableSettingValue(int disableSettingValue) {
Settings.Secure.putIntForUser(
mContentResolver,
diff --git a/services/tests/servicestests/src/com/android/server/OWNERS b/services/tests/servicestests/src/com/android/server/OWNERS
index 2463fc617f0b..6561778cb47d 100644
--- a/services/tests/servicestests/src/com/android/server/OWNERS
+++ b/services/tests/servicestests/src/com/android/server/OWNERS
@@ -1,5 +1,5 @@
per-file *Alarm* = file:/apex/jobscheduler/OWNERS
-per-file *AppOps* = file:/core/java/android/permission/OWNERS
+per-file *AppOp* = file:/core/java/android/permission/OWNERS
per-file *Bluetooth* = file:/core/java/android/bluetooth/OWNERS
per-file *Gnss* = file:/services/core/java/com/android/server/location/OWNERS
per-file *Network* = file:/services/core/java/com/android/server/net/OWNERS
diff --git a/services/tests/servicestests/src/com/android/server/appop/AppOpsNotedWatcherTest.java b/services/tests/servicestests/src/com/android/server/appop/AppOpsNotedWatcherTest.java
index 1e602f84071d..41e15631d258 100644
--- a/services/tests/servicestests/src/com/android/server/appop/AppOpsNotedWatcherTest.java
+++ b/services/tests/servicestests/src/com/android/server/appop/AppOpsNotedWatcherTest.java
@@ -66,11 +66,11 @@ public class AppOpsNotedWatcherTest {
inOrder.verify(listener, timeout(NOTIFICATION_TIMEOUT_MILLIS)
.times(1)).onOpNoted(eq(AppOpsManager.OP_FINE_LOCATION),
eq(Process.myUid()), eq(getContext().getPackageName()),
- eq(AppOpsManager.MODE_ALLOWED));
+ eq(AppOpsManager.OP_FLAG_SELF), eq(AppOpsManager.MODE_ALLOWED));
inOrder.verify(listener, timeout(NOTIFICATION_TIMEOUT_MILLIS)
.times(1)).onOpNoted(eq(AppOpsManager.OP_CAMERA),
eq(Process.myUid()), eq(getContext().getPackageName()),
- eq(AppOpsManager.MODE_ALLOWED));
+ eq(AppOpsManager.OP_FLAG_SELF), eq(AppOpsManager.MODE_ALLOWED));
// Stop watching
appOpsManager.stopWatchingNoted(listener);
@@ -94,7 +94,7 @@ public class AppOpsNotedWatcherTest {
verify(listener, timeout(NOTIFICATION_TIMEOUT_MILLIS)
.times(2)).onOpNoted(eq(AppOpsManager.OP_FINE_LOCATION),
eq(Process.myUid()), eq(getContext().getPackageName()),
- eq(AppOpsManager.MODE_ALLOWED));
+ eq(AppOpsManager.OP_FLAG_SELF), eq(AppOpsManager.MODE_ALLOWED));
// Finish up
appOpsManager.stopWatchingNoted(listener);
diff --git a/services/tests/servicestests/src/com/android/server/appop/AppOpsStartedWatcherTest.java b/services/tests/servicestests/src/com/android/server/appop/AppOpsStartedWatcherTest.java
index 1aa697b04f1d..fec8aa9ceaff 100644
--- a/services/tests/servicestests/src/com/android/server/appop/AppOpsStartedWatcherTest.java
+++ b/services/tests/servicestests/src/com/android/server/appop/AppOpsStartedWatcherTest.java
@@ -63,11 +63,11 @@ public class AppOpsStartedWatcherTest {
inOrder.verify(listener, timeout(NOTIFICATION_TIMEOUT_MILLIS)
.times(1)).onOpStarted(eq(AppOpsManager.OP_FINE_LOCATION),
eq(Process.myUid()), eq(getContext().getPackageName()),
- eq(AppOpsManager.MODE_ALLOWED));
+ eq(AppOpsManager.OP_FLAG_SELF), eq(AppOpsManager.MODE_ALLOWED));
inOrder.verify(listener, timeout(NOTIFICATION_TIMEOUT_MILLIS)
.times(1)).onOpStarted(eq(AppOpsManager.OP_CAMERA),
eq(Process.myUid()), eq(getContext().getPackageName()),
- eq(AppOpsManager.MODE_ALLOWED));
+ eq(AppOpsManager.OP_FLAG_SELF), eq(AppOpsManager.MODE_ALLOWED));
// Stop watching
appOpsManager.stopWatchingStarted(listener);
@@ -91,7 +91,7 @@ public class AppOpsStartedWatcherTest {
verify(listener, timeout(NOTIFICATION_TIMEOUT_MILLIS)
.times(2)).onOpStarted(eq(AppOpsManager.OP_CAMERA),
eq(Process.myUid()), eq(getContext().getPackageName()),
- eq(AppOpsManager.MODE_ALLOWED));
+ eq(AppOpsManager.OP_FLAG_SELF), eq(AppOpsManager.MODE_ALLOWED));
verifyNoMoreInteractions(listener);
// Finish up
diff --git a/services/tests/servicestests/src/com/android/server/devicepolicy/DevicePolicyManagerTest.java b/services/tests/servicestests/src/com/android/server/devicepolicy/DevicePolicyManagerTest.java
index e2c5e97b8896..d9daf17058c9 100644
--- a/services/tests/servicestests/src/com/android/server/devicepolicy/DevicePolicyManagerTest.java
+++ b/services/tests/servicestests/src/com/android/server/devicepolicy/DevicePolicyManagerTest.java
@@ -5127,7 +5127,7 @@ public class DevicePolicyManagerTest extends DpmTestBase {
admin1.getPackageName(), managedProfileUserId);
try {
- assertExpectException(IllegalArgumentException.class, null, () ->
+ assertExpectException(SecurityException.class, null, () ->
parentDpm.setPasswordQuality(
admin1, DevicePolicyManager.PASSWORD_QUALITY_COMPLEX));
} finally {
diff --git a/services/tests/servicestests/src/com/android/server/hdmi/HdmiCecLocalDeviceTest.java b/services/tests/servicestests/src/com/android/server/hdmi/HdmiCecLocalDeviceTest.java
index 2cb1113e7325..ef77f32bb211 100644
--- a/services/tests/servicestests/src/com/android/server/hdmi/HdmiCecLocalDeviceTest.java
+++ b/services/tests/servicestests/src/com/android/server/hdmi/HdmiCecLocalDeviceTest.java
@@ -112,6 +112,7 @@ public class HdmiCecLocalDeviceTest {
private HdmiCecMessageValidator mMessageValidator;
private static byte[] param;
private boolean mStandbyMessageReceived;
+ private boolean mWakeupMessageReceived;
private boolean isControlEnabled;
private int mPowerStatus;
@@ -131,9 +132,21 @@ public class HdmiCecLocalDeviceTest {
}
@Override
+ boolean isPowerStandbyOrTransient() {
+ return mPowerStatus == HdmiControlManager.POWER_STATUS_STANDBY
+ || mPowerStatus
+ == HdmiControlManager.POWER_STATUS_TRANSIENT_TO_STANDBY;
+ }
+
+ @Override
void standby() {
mStandbyMessageReceived = true;
}
+
+ @Override
+ void wakeUp() {
+ mWakeupMessageReceived = true;
+ }
};
mHdmiControlService.setIoLooper(mTestLooper.getLooper());
mHdmiCecController = HdmiCecController.createWithNativeWrapper(
@@ -276,4 +289,99 @@ public class HdmiCecLocalDeviceTest {
assertThat(result).isTrue();
}
+ @Test
+ public void handleUserControlPressed_power_localDeviceInStandby_shouldTurnOn() {
+ mPowerStatus = HdmiControlManager.POWER_STATUS_STANDBY;
+ boolean result = mHdmiLocalDevice.handleUserControlPressed(
+ HdmiCecMessageBuilder.buildUserControlPressed(ADDR_TV, ADDR_PLAYBACK_1,
+ HdmiCecKeycode.CEC_KEYCODE_POWER));
+
+ assertThat(result).isTrue();
+ assertThat(mWakeupMessageReceived).isTrue();
+ assertThat(mStandbyMessageReceived).isFalse();
+ }
+
+ @Test
+ public void handleUserControlPressed_power_localDeviceOn_shouldNotChangePowerStatus() {
+ mPowerStatus = HdmiControlManager.POWER_STATUS_ON;
+ boolean result = mHdmiLocalDevice.handleUserControlPressed(
+ HdmiCecMessageBuilder.buildUserControlPressed(ADDR_TV, ADDR_PLAYBACK_1,
+ HdmiCecKeycode.CEC_KEYCODE_POWER));
+
+ assertThat(result).isTrue();
+ assertThat(mWakeupMessageReceived).isFalse();
+ assertThat(mStandbyMessageReceived).isFalse();
+ }
+
+ @Test
+ public void handleUserControlPressed_powerToggleFunction_localDeviceInStandby_shouldTurnOn() {
+ mPowerStatus = HdmiControlManager.POWER_STATUS_STANDBY;
+ boolean result = mHdmiLocalDevice.handleUserControlPressed(
+ HdmiCecMessageBuilder.buildUserControlPressed(ADDR_TV, ADDR_PLAYBACK_1,
+ HdmiCecKeycode.CEC_KEYCODE_POWER_TOGGLE_FUNCTION));
+
+ assertThat(result).isTrue();
+ assertThat(mWakeupMessageReceived).isTrue();
+ assertThat(mStandbyMessageReceived).isFalse();
+ }
+
+ @Test
+ public void handleUserControlPressed_powerToggleFunction_localDeviceOn_shouldTurnOff() {
+ mPowerStatus = HdmiControlManager.POWER_STATUS_ON;
+ boolean result = mHdmiLocalDevice.handleUserControlPressed(
+ HdmiCecMessageBuilder.buildUserControlPressed(ADDR_TV, ADDR_PLAYBACK_1,
+ HdmiCecKeycode.CEC_KEYCODE_POWER_TOGGLE_FUNCTION));
+
+ assertThat(result).isTrue();
+ assertThat(mWakeupMessageReceived).isFalse();
+ assertThat(mStandbyMessageReceived).isTrue();
+ }
+
+ @Test
+ public void handleUserControlPressed_powerOnFunction_localDeviceInStandby_shouldTurnOn() {
+ mPowerStatus = HdmiControlManager.POWER_STATUS_STANDBY;
+ boolean result = mHdmiLocalDevice.handleUserControlPressed(
+ HdmiCecMessageBuilder.buildUserControlPressed(ADDR_TV, ADDR_PLAYBACK_1,
+ HdmiCecKeycode.CEC_KEYCODE_POWER_ON_FUNCTION));
+
+ assertThat(result).isTrue();
+ assertThat(mWakeupMessageReceived).isTrue();
+ assertThat(mStandbyMessageReceived).isFalse();
+ }
+
+ @Test
+ public void handleUserControlPressed_powerOnFunction_localDeviceOn_noPowerStatusChange() {
+ mPowerStatus = HdmiControlManager.POWER_STATUS_ON;
+ boolean result = mHdmiLocalDevice.handleUserControlPressed(
+ HdmiCecMessageBuilder.buildUserControlPressed(ADDR_TV, ADDR_PLAYBACK_1,
+ HdmiCecKeycode.CEC_KEYCODE_POWER_ON_FUNCTION));
+
+ assertThat(result).isTrue();
+ assertThat(mWakeupMessageReceived).isFalse();
+ assertThat(mStandbyMessageReceived).isFalse();
+ }
+
+ @Test
+ public void handleUserControlPressed_powerOffFunction_localDeviceStandby_noPowerStatusChange() {
+ mPowerStatus = HdmiControlManager.POWER_STATUS_STANDBY;
+ boolean result = mHdmiLocalDevice.handleUserControlPressed(
+ HdmiCecMessageBuilder.buildUserControlPressed(ADDR_TV, ADDR_PLAYBACK_1,
+ HdmiCecKeycode.CEC_KEYCODE_POWER_OFF_FUNCTION));
+
+ assertThat(result).isTrue();
+ assertThat(mWakeupMessageReceived).isFalse();
+ assertThat(mStandbyMessageReceived).isFalse();
+ }
+
+ @Test
+ public void handleUserControlPressed_powerOffFunction_localDeviceOn_shouldTurnOff() {
+ mPowerStatus = HdmiControlManager.POWER_STATUS_ON;
+ boolean result = mHdmiLocalDevice.handleUserControlPressed(
+ HdmiCecMessageBuilder.buildUserControlPressed(ADDR_TV, ADDR_PLAYBACK_1,
+ HdmiCecKeycode.CEC_KEYCODE_POWER_OFF_FUNCTION));
+
+ assertThat(result).isTrue();
+ assertThat(mWakeupMessageReceived).isFalse();
+ assertThat(mStandbyMessageReceived).isTrue();
+ }
}
diff --git a/services/tests/servicestests/src/com/android/server/pm/permission/PermissionManagerServiceTest.java b/services/tests/servicestests/src/com/android/server/pm/permission/LegacyPermissionManagerServiceTest.java
index 6cea9280f080..4f6441ff4e62 100644
--- a/services/tests/servicestests/src/com/android/server/pm/permission/PermissionManagerServiceTest.java
+++ b/services/tests/servicestests/src/com/android/server/pm/permission/LegacyPermissionManagerServiceTest.java
@@ -29,14 +29,10 @@ import android.app.admin.DevicePolicyManager;
import android.content.Context;
import android.content.pm.PackageManager;
import android.os.Process;
-import android.permission.PermissionManagerInternal;
import androidx.test.InstrumentationRegistry;
import androidx.test.runner.AndroidJUnit4;
-import com.android.server.LocalServices;
-
-import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -44,19 +40,17 @@ import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
@RunWith(AndroidJUnit4.class)
-public class PermissionManagerServiceTest {
- private static final String TAG = "PermissionManagerServiceTag";
-
+public class LegacyPermissionManagerServiceTest {
private static final int SYSTEM_UID = 1000;
private static final int SYSTEM_PID = 1234;
private static final int APP_UID = Process.FIRST_APPLICATION_UID;
private static final int APP_PID = 5678;
- private PermissionManagerService mPermissionManagerService;
+ private LegacyPermissionManagerService mLegacyPermissionManagerService;
private Context mContext;
@Mock
- private PermissionManagerService.Injector mInjector;
+ private LegacyPermissionManagerService.Injector mInjector;
@Mock
private AppOpsManager mAppOpsManager;
@@ -69,16 +63,7 @@ public class PermissionManagerServiceTest {
MockitoAnnotations.initMocks(this);
mContext = InstrumentationRegistry.getContext();
- mPermissionManagerService = new PermissionManagerService(mContext, mInjector);
- }
-
- @After
- public void tearDown() {
- // The LocalServices added by the constructor of the PermissionManagerService can either be
- // removed here after each test when tests are run serially, or to run them in parallel
- // the Injector can provide methods to add these that can be ignored by the mock.
- LocalServices.removeServiceForTest(PermissionManagerServiceInternal.class);
- LocalServices.removeServiceForTest(PermissionManagerInternal.class);
+ mLegacyPermissionManagerService = new LegacyPermissionManagerService(mContext, mInjector);
}
@Test
@@ -88,7 +73,7 @@ public class PermissionManagerServiceTest {
setupCheckDeviceIdentifierAccessTest(APP_PID, APP_UID);
assertThrows(SecurityException.class,
- () -> mPermissionManagerService.checkDeviceIdentifierAccess(
+ () -> mLegacyPermissionManagerService.checkDeviceIdentifierAccess(
mContext.getPackageName(), "testCheckDeviceIdentifierAccess", null,
APP_PID, SYSTEM_UID));
}
@@ -100,7 +85,7 @@ public class PermissionManagerServiceTest {
setupCheckDeviceIdentifierAccessTest(APP_PID, APP_UID);
assertThrows(SecurityException.class,
- () -> mPermissionManagerService.checkDeviceIdentifierAccess(
+ () -> mLegacyPermissionManagerService.checkDeviceIdentifierAccess(
mContext.getPackageName(), "testCheckDeviceIdentifierAccess", null,
SYSTEM_PID, APP_UID));
}
@@ -111,7 +96,7 @@ public class PermissionManagerServiceTest {
// checks can run through completion and return denied.
setupCheckDeviceIdentifierAccessTest(APP_PID, APP_UID);
- int result = mPermissionManagerService.checkDeviceIdentifierAccess(
+ int result = mLegacyPermissionManagerService.checkDeviceIdentifierAccess(
mContext.getPackageName(), "testCheckDeviceIdentifierAccess", null, APP_PID,
APP_UID);
@@ -122,7 +107,7 @@ public class PermissionManagerServiceTest {
public void checkDeviceIdentifierAccess_systemUid_returnsGranted() {
// The system UID should always have access to device identifiers.
setupCheckDeviceIdentifierAccessTest(SYSTEM_PID, SYSTEM_UID);
- int result = mPermissionManagerService.checkDeviceIdentifierAccess(
+ int result = mLegacyPermissionManagerService.checkDeviceIdentifierAccess(
mContext.getPackageName(), "testCheckDeviceIdentifierAccess", null, SYSTEM_PID,
SYSTEM_UID);
@@ -137,7 +122,7 @@ public class PermissionManagerServiceTest {
when(mInjector.checkPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE,
APP_PID, APP_UID)).thenReturn(PackageManager.PERMISSION_GRANTED);
- int result = mPermissionManagerService.checkDeviceIdentifierAccess(
+ int result = mLegacyPermissionManagerService.checkDeviceIdentifierAccess(
mContext.getPackageName(), "testCheckDeviceIdentifierAccess", null, APP_PID,
APP_UID);
@@ -153,7 +138,7 @@ public class PermissionManagerServiceTest {
eq(APP_UID), eq(mContext.getPackageName()), any(), any())).thenReturn(
AppOpsManager.MODE_ALLOWED);
- int result = mPermissionManagerService.checkDeviceIdentifierAccess(
+ int result = mLegacyPermissionManagerService.checkDeviceIdentifierAccess(
mContext.getPackageName(), "testCheckDeviceIdentifierAccess", null, APP_PID,
APP_UID);
@@ -168,7 +153,7 @@ public class PermissionManagerServiceTest {
when(mDevicePolicyManager.hasDeviceIdentifierAccess(mContext.getPackageName(), APP_PID,
APP_UID)).thenReturn(true);
- int result = mPermissionManagerService.checkDeviceIdentifierAccess(
+ int result = mLegacyPermissionManagerService.checkDeviceIdentifierAccess(
mContext.getPackageName(), "testCheckDeviceIdentifierAccess", null, APP_PID,
APP_UID);
diff --git a/services/tests/servicestests/src/com/android/server/timedetector/OWNERS b/services/tests/servicestests/src/com/android/server/timedetector/OWNERS
index 09447a971bdd..8f8089717e3b 100644
--- a/services/tests/servicestests/src/com/android/server/timedetector/OWNERS
+++ b/services/tests/servicestests/src/com/android/server/timedetector/OWNERS
@@ -1 +1,3 @@
-include /core/java/android/app/timezone/OWNERS
+# Bug component: 847766
+mingaleev@google.com
+include /core/java/android/app/timedetector/OWNERS
diff --git a/services/tests/servicestests/src/com/android/server/timedetector/TimeDetectorServiceTest.java b/services/tests/servicestests/src/com/android/server/timedetector/TimeDetectorServiceTest.java
index 4a44005e9602..5276ac4e98c1 100644
--- a/services/tests/servicestests/src/com/android/server/timedetector/TimeDetectorServiceTest.java
+++ b/services/tests/servicestests/src/com/android/server/timedetector/TimeDetectorServiceTest.java
@@ -28,6 +28,7 @@ import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
+import android.app.timedetector.GnssTimeSuggestion;
import android.app.timedetector.ManualTimeSuggestion;
import android.app.timedetector.NetworkTimeSuggestion;
import android.app.timedetector.TelephonyTimeSuggestion;
@@ -174,6 +175,36 @@ public class TimeDetectorServiceTest {
mStubbedTimeDetectorStrategy.verifySuggestNetworkTimeCalled(NetworkTimeSuggestion);
}
+ @Test(expected = SecurityException.class)
+ public void testSuggestGnssTime_withoutPermission() {
+ doThrow(new SecurityException("Mock"))
+ .when(mMockContext).enforceCallingOrSelfPermission(anyString(), any());
+ GnssTimeSuggestion gnssTimeSuggestion = createGnssTimeSuggestion();
+
+ try {
+ mTimeDetectorService.suggestGnssTime(gnssTimeSuggestion);
+ fail();
+ } finally {
+ verify(mMockContext).enforceCallingOrSelfPermission(
+ eq(android.Manifest.permission.SET_TIME), anyString());
+ }
+ }
+
+ @Test
+ public void testSuggestGnssTime() throws Exception {
+ doNothing().when(mMockContext).enforceCallingOrSelfPermission(anyString(), any());
+
+ GnssTimeSuggestion gnssTimeSuggestion = createGnssTimeSuggestion();
+ mTimeDetectorService.suggestGnssTime(gnssTimeSuggestion);
+ mTestHandler.assertTotalMessagesEnqueued(1);
+
+ verify(mMockContext).enforceCallingOrSelfPermission(
+ eq(android.Manifest.permission.SET_TIME), anyString());
+
+ mTestHandler.waitForMessagesToBeProcessed();
+ mStubbedTimeDetectorStrategy.verifySuggestGnssTimeCalled(gnssTimeSuggestion);
+ }
+
@Test
public void testDump() {
when(mMockContext.checkCallingOrSelfPermission(android.Manifest.permission.DUMP))
@@ -219,12 +250,18 @@ public class TimeDetectorServiceTest {
return new NetworkTimeSuggestion(timeValue);
}
+ private static GnssTimeSuggestion createGnssTimeSuggestion() {
+ TimestampedValue<Long> timeValue = new TimestampedValue<>(100L, 1_000_000L);
+ return new GnssTimeSuggestion(timeValue);
+ }
+
private static class StubbedTimeDetectorStrategy implements TimeDetectorStrategy {
// Call tracking.
private TelephonyTimeSuggestion mLastTelephonySuggestion;
private ManualTimeSuggestion mLastManualSuggestion;
private NetworkTimeSuggestion mLastNetworkSuggestion;
+ private GnssTimeSuggestion mLastGnssSuggestion;
private boolean mHandleAutoTimeDetectionChangedCalled;
private boolean mDumpCalled;
@@ -245,6 +282,11 @@ public class TimeDetectorServiceTest {
}
@Override
+ public void suggestGnssTime(GnssTimeSuggestion timeSuggestion) {
+ mLastGnssSuggestion = timeSuggestion;
+ }
+
+ @Override
public void handleAutoTimeConfigChanged() {
mHandleAutoTimeDetectionChangedCalled = true;
}
@@ -258,6 +300,7 @@ public class TimeDetectorServiceTest {
mLastTelephonySuggestion = null;
mLastManualSuggestion = null;
mLastNetworkSuggestion = null;
+ mLastGnssSuggestion = null;
mHandleAutoTimeDetectionChangedCalled = false;
mDumpCalled = false;
}
@@ -274,6 +317,10 @@ public class TimeDetectorServiceTest {
assertEquals(expectedSuggestion, mLastNetworkSuggestion);
}
+ void verifySuggestGnssTimeCalled(GnssTimeSuggestion expectedSuggestion) {
+ assertEquals(expectedSuggestion, mLastGnssSuggestion);
+ }
+
void verifyHandleAutoTimeDetectionChangedCalled() {
assertTrue(mHandleAutoTimeDetectionChangedCalled);
}
diff --git a/services/tests/servicestests/src/com/android/server/timedetector/TimeDetectorStrategyImplTest.java b/services/tests/servicestests/src/com/android/server/timedetector/TimeDetectorStrategyImplTest.java
index 21396fd0516e..b1adb0b4ce60 100644
--- a/services/tests/servicestests/src/com/android/server/timedetector/TimeDetectorStrategyImplTest.java
+++ b/services/tests/servicestests/src/com/android/server/timedetector/TimeDetectorStrategyImplTest.java
@@ -16,6 +16,7 @@
package com.android.server.timedetector;
+import static com.android.server.timedetector.TimeDetectorStrategy.ORIGIN_GNSS;
import static com.android.server.timedetector.TimeDetectorStrategy.ORIGIN_NETWORK;
import static com.android.server.timedetector.TimeDetectorStrategy.ORIGIN_TELEPHONY;
@@ -25,6 +26,7 @@ import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
+import android.app.timedetector.GnssTimeSuggestion;
import android.app.timedetector.ManualTimeSuggestion;
import android.app.timedetector.NetworkTimeSuggestion;
import android.app.timedetector.TelephonyTimeSuggestion;
@@ -569,7 +571,53 @@ public class TimeDetectorStrategyImplTest {
}
@Test
- public void highPrioritySuggestionsShouldBeatLowerPrioritySuggestions() {
+ public void testSuggestGnssTime_autoTimeEnabled() {
+ mScript.pokeFakeClocks(ARBITRARY_CLOCK_INITIALIZATION_INFO)
+ .pokeAutoOriginPriorities(ORIGIN_GNSS)
+ .pokeAutoTimeDetectionEnabled(true);
+
+ GnssTimeSuggestion timeSuggestion =
+ mScript.generateGnssTimeSuggestion(ARBITRARY_TEST_TIME);
+
+ mScript.simulateTimePassing();
+
+ long expectedSystemClockMillis =
+ mScript.calculateTimeInMillisForNow(timeSuggestion.getUtcTime());
+ mScript.simulateGnssTimeSuggestion(timeSuggestion)
+ .verifySystemClockWasSetAndResetCallTracking(expectedSystemClockMillis);
+ }
+
+ @Test
+ public void testSuggestGnssTime_autoTimeDisabled() {
+ mScript.pokeFakeClocks(ARBITRARY_CLOCK_INITIALIZATION_INFO)
+ .pokeAutoOriginPriorities(ORIGIN_GNSS)
+ .pokeAutoTimeDetectionEnabled(false);
+
+ GnssTimeSuggestion timeSuggestion =
+ mScript.generateGnssTimeSuggestion(ARBITRARY_TEST_TIME);
+
+ mScript.simulateTimePassing()
+ .simulateGnssTimeSuggestion(timeSuggestion)
+ .verifySystemClockWasNotSetAndResetCallTracking();
+ }
+
+ @Test
+ public void gnssTimeSuggestion_ignoredWhenReferencedTimeIsInThePast() {
+ mScript.pokeFakeClocks(ARBITRARY_CLOCK_INITIALIZATION_INFO)
+ .pokeAutoOriginPriorities(ORIGIN_GNSS)
+ .pokeAutoTimeDetectionEnabled(true);
+
+ Instant suggestedTime = TIME_LOWER_BOUND.minus(Duration.ofDays(1));
+ GnssTimeSuggestion timeSuggestion = mScript
+ .generateGnssTimeSuggestion(suggestedTime);
+
+ mScript.simulateGnssTimeSuggestion(timeSuggestion)
+ .verifySystemClockWasNotSetAndResetCallTracking()
+ .assertLatestGnssSuggestion(null);
+ }
+
+ @Test
+ public void highPrioritySuggestionsBeatLowerPrioritySuggestions_telephonyNetworkOrigins() {
mScript.pokeFakeClocks(ARBITRARY_CLOCK_INITIALIZATION_INFO)
.pokeAutoTimeDetectionEnabled(true)
.pokeAutoOriginPriorities(ORIGIN_TELEPHONY, ORIGIN_NETWORK);
@@ -672,22 +720,130 @@ public class TimeDetectorStrategyImplTest {
}
@Test
+ public void highPrioritySuggestionsBeatLowerPrioritySuggestions_networkGnssOrigins() {
+ mScript.pokeFakeClocks(ARBITRARY_CLOCK_INITIALIZATION_INFO)
+ .pokeAutoTimeDetectionEnabled(true)
+ .pokeAutoOriginPriorities(ORIGIN_NETWORK, ORIGIN_GNSS);
+
+ // Three obviously different times that could not be mistaken for each other.
+ Instant gnssTime1 = ARBITRARY_TEST_TIME;
+ Instant gnssTime2 = ARBITRARY_TEST_TIME.plus(Duration.ofDays(30));
+ Instant networkTime = ARBITRARY_TEST_TIME.plus(Duration.ofDays(60));
+ // A small increment used to simulate the passage of time, but not enough to interfere with
+ // macro-level time changes associated with suggestion age.
+ final long smallTimeIncrementMillis = 101;
+
+ // A gnss suggestion is made. It should be used because there is no network suggestion.
+ GnssTimeSuggestion gnssTimeSuggestion1 =
+ mScript.generateGnssTimeSuggestion(gnssTime1);
+ mScript.simulateTimePassing(smallTimeIncrementMillis)
+ .simulateGnssTimeSuggestion(gnssTimeSuggestion1)
+ .verifySystemClockWasSetAndResetCallTracking(
+ mScript.calculateTimeInMillisForNow(gnssTimeSuggestion1.getUtcTime()));
+
+ // Check internal state.
+ mScript.assertLatestNetworkSuggestion(null)
+ .assertLatestGnssSuggestion(gnssTimeSuggestion1);
+ assertEquals(gnssTimeSuggestion1, mScript.peekLatestValidGnssSuggestion());
+ assertNull("No network suggestions were made:", mScript.peekLatestValidNetworkSuggestion());
+
+ // Simulate a little time passing.
+ mScript.simulateTimePassing(smallTimeIncrementMillis)
+ .verifySystemClockWasNotSetAndResetCallTracking();
+
+ // Now a network suggestion is made. Network suggestions are prioritized over gnss
+ // suggestions so it should "win".
+ NetworkTimeSuggestion networkTimeSuggestion =
+ mScript.generateNetworkTimeSuggestion(networkTime);
+ mScript.simulateTimePassing(smallTimeIncrementMillis)
+ .simulateNetworkTimeSuggestion(networkTimeSuggestion)
+ .verifySystemClockWasSetAndResetCallTracking(
+ mScript.calculateTimeInMillisForNow(networkTimeSuggestion.getUtcTime()));
+
+ // Check internal state.
+ mScript.assertLatestNetworkSuggestion(networkTimeSuggestion)
+ .assertLatestGnssSuggestion(gnssTimeSuggestion1);
+ assertEquals(gnssTimeSuggestion1, mScript.peekLatestValidGnssSuggestion());
+ assertEquals(networkTimeSuggestion, mScript.peekLatestValidNetworkSuggestion());
+
+ // Simulate some significant time passing: half the time allowed before a time signal
+ // becomes "too old to use".
+ mScript.simulateTimePassing(TimeDetectorStrategyImpl.MAX_UTC_TIME_AGE_MILLIS / 2)
+ .verifySystemClockWasNotSetAndResetCallTracking();
+
+ // Now another gnss suggestion is made. Network suggestions are prioritized over
+ // gnss suggestions so the latest network suggestion should still "win".
+ GnssTimeSuggestion gnssTimeSuggestion2 =
+ mScript.generateGnssTimeSuggestion(gnssTime2);
+ mScript.simulateTimePassing(smallTimeIncrementMillis)
+ .simulateGnssTimeSuggestion(gnssTimeSuggestion2)
+ .verifySystemClockWasNotSetAndResetCallTracking();
+
+ // Check internal state.
+ mScript.assertLatestNetworkSuggestion(networkTimeSuggestion)
+ .assertLatestGnssSuggestion(gnssTimeSuggestion2);
+ assertEquals(gnssTimeSuggestion2, mScript.peekLatestValidGnssSuggestion());
+ assertEquals(networkTimeSuggestion, mScript.peekLatestValidNetworkSuggestion());
+
+ // Simulate some significant time passing: half the time allowed before a time signal
+ // becomes "too old to use". This should mean that telephonyTimeSuggestion is now too old to
+ // be used but networkTimeSuggestion2 is not.
+ mScript.simulateTimePassing(TimeDetectorStrategyImpl.MAX_UTC_TIME_AGE_MILLIS / 2);
+
+ // NOTE: The TimeDetectorStrategyImpl doesn't set an alarm for the point when the last
+ // suggestion it used becomes too old: it requires a new suggestion or an auto-time toggle
+ // to re-run the detection logic. This may change in future but until then we rely on a
+ // steady stream of suggestions to re-evaluate.
+ mScript.verifySystemClockWasNotSetAndResetCallTracking();
+
+ // Check internal state.
+ mScript.assertLatestNetworkSuggestion(networkTimeSuggestion)
+ .assertLatestGnssSuggestion(gnssTimeSuggestion2);
+ assertEquals(gnssTimeSuggestion2, mScript.peekLatestValidGnssSuggestion());
+ assertNull(
+ "Network suggestion should be expired:",
+ mScript.peekLatestValidNetworkSuggestion());
+
+ // Toggle auto-time off and on to force the detection logic to run.
+ mScript.simulateAutoTimeDetectionToggle()
+ .simulateTimePassing(smallTimeIncrementMillis)
+ .simulateAutoTimeDetectionToggle();
+
+ // Verify the latest gnss time now wins.
+ mScript.verifySystemClockWasSetAndResetCallTracking(
+ mScript.calculateTimeInMillisForNow(gnssTimeSuggestion2.getUtcTime()));
+
+ // Check internal state.
+ mScript.assertLatestNetworkSuggestion(networkTimeSuggestion)
+ .assertLatestGnssSuggestion(gnssTimeSuggestion2);
+ assertEquals(gnssTimeSuggestion2, mScript.peekLatestValidGnssSuggestion());
+ assertNull(
+ "Network suggestion should still be expired:",
+ mScript.peekLatestValidNetworkSuggestion());
+ }
+
+ @Test
public void whenAllTimeSuggestionsAreAvailable_higherPriorityWins_lowerPriorityComesFirst() {
mScript.pokeFakeClocks(ARBITRARY_CLOCK_INITIALIZATION_INFO)
.pokeAutoTimeDetectionEnabled(true)
- .pokeAutoOriginPriorities(ORIGIN_TELEPHONY, ORIGIN_NETWORK);
+ .pokeAutoOriginPriorities(ORIGIN_TELEPHONY, ORIGIN_NETWORK, ORIGIN_GNSS);
Instant networkTime = ARBITRARY_TEST_TIME;
- Instant telephonyTime = ARBITRARY_TEST_TIME.plus(Duration.ofDays(30));
+ Instant gnssTime = ARBITRARY_TEST_TIME.plus(Duration.ofDays(30));
+ Instant telephonyTime = ARBITRARY_TEST_TIME.plus(Duration.ofDays(60));
NetworkTimeSuggestion networkTimeSuggestion =
mScript.generateNetworkTimeSuggestion(networkTime);
+ GnssTimeSuggestion gnssTimeSuggestion =
+ mScript.generateGnssTimeSuggestion(gnssTime);
TelephonyTimeSuggestion telephonyTimeSuggestion =
mScript.generateTelephonyTimeSuggestion(ARBITRARY_SLOT_INDEX, telephonyTime);
mScript.simulateNetworkTimeSuggestion(networkTimeSuggestion)
+ .simulateGnssTimeSuggestion(gnssTimeSuggestion)
.simulateTelephonyTimeSuggestion(telephonyTimeSuggestion)
.assertLatestNetworkSuggestion(networkTimeSuggestion)
+ .assertLatestGnssSuggestion(gnssTimeSuggestion)
.assertLatestTelephonySuggestion(ARBITRARY_SLOT_INDEX, telephonyTimeSuggestion)
.verifySystemClockWasSetAndResetCallTracking(telephonyTime.toEpochMilli());
}
@@ -696,20 +852,25 @@ public class TimeDetectorStrategyImplTest {
public void whenAllTimeSuggestionsAreAvailable_higherPriorityWins_higherPriorityComesFirst() {
mScript.pokeFakeClocks(ARBITRARY_CLOCK_INITIALIZATION_INFO)
.pokeAutoTimeDetectionEnabled(true)
- .pokeAutoOriginPriorities(ORIGIN_TELEPHONY, ORIGIN_NETWORK);
+ .pokeAutoOriginPriorities(ORIGIN_TELEPHONY, ORIGIN_NETWORK, ORIGIN_GNSS);
Instant networkTime = ARBITRARY_TEST_TIME;
Instant telephonyTime = ARBITRARY_TEST_TIME.plus(Duration.ofDays(30));
+ Instant gnssTime = ARBITRARY_TEST_TIME.plus(Duration.ofDays(60));
NetworkTimeSuggestion networkTimeSuggestion =
mScript.generateNetworkTimeSuggestion(networkTime);
TelephonyTimeSuggestion telephonyTimeSuggestion =
mScript.generateTelephonyTimeSuggestion(ARBITRARY_SLOT_INDEX, telephonyTime);
+ GnssTimeSuggestion gnssTimeSuggestion =
+ mScript.generateGnssTimeSuggestion(gnssTime);
mScript.simulateTelephonyTimeSuggestion(telephonyTimeSuggestion)
.simulateNetworkTimeSuggestion(networkTimeSuggestion)
+ .simulateGnssTimeSuggestion(gnssTimeSuggestion)
.assertLatestNetworkSuggestion(networkTimeSuggestion)
.assertLatestTelephonySuggestion(ARBITRARY_SLOT_INDEX, telephonyTimeSuggestion)
+ .assertLatestGnssSuggestion(gnssTimeSuggestion)
.verifySystemClockWasSetAndResetCallTracking(telephonyTime.toEpochMilli());
}
@@ -728,7 +889,37 @@ public class TimeDetectorStrategyImplTest {
}
@Test
- public void suggestionsFromSourceNotListedInPrioritiesList_areIgnored() {
+ public void whenHigherPrioritySuggestionsAreNotAvailable_fallbacksToNext() {
+ mScript.pokeFakeClocks(ARBITRARY_CLOCK_INITIALIZATION_INFO)
+ .pokeAutoTimeDetectionEnabled(true)
+ .pokeAutoOriginPriorities(ORIGIN_TELEPHONY, ORIGIN_NETWORK, ORIGIN_GNSS);
+
+ GnssTimeSuggestion timeSuggestion =
+ mScript.generateGnssTimeSuggestion(ARBITRARY_TEST_TIME);
+
+ mScript.simulateGnssTimeSuggestion(timeSuggestion)
+ .assertLatestGnssSuggestion(timeSuggestion)
+ .verifySystemClockWasSetAndResetCallTracking(ARBITRARY_TEST_TIME.toEpochMilli());
+ }
+
+ @Test
+ public void suggestionsFromTelephonyOriginNotInPriorityList_areIgnored() {
+ mScript.pokeFakeClocks(ARBITRARY_CLOCK_INITIALIZATION_INFO)
+ .pokeAutoTimeDetectionEnabled(true)
+ .pokeAutoOriginPriorities(ORIGIN_NETWORK);
+
+ int slotIndex = ARBITRARY_SLOT_INDEX;
+ Instant testTime = ARBITRARY_TEST_TIME;
+ TelephonyTimeSuggestion timeSuggestion =
+ mScript.generateTelephonyTimeSuggestion(slotIndex, testTime);
+
+ mScript.simulateTelephonyTimeSuggestion(timeSuggestion)
+ .assertLatestTelephonySuggestion(ARBITRARY_SLOT_INDEX, timeSuggestion)
+ .verifySystemClockWasNotSetAndResetCallTracking();
+ }
+
+ @Test
+ public void suggestionsFromNetworkOriginNotInPriorityList_areIgnored() {
mScript.pokeFakeClocks(ARBITRARY_CLOCK_INITIALIZATION_INFO)
.pokeAutoTimeDetectionEnabled(true)
.pokeAutoOriginPriorities(ORIGIN_TELEPHONY);
@@ -742,6 +933,20 @@ public class TimeDetectorStrategyImplTest {
}
@Test
+ public void suggestionsFromGnssOriginNotInPriorityList_areIgnored() {
+ mScript.pokeFakeClocks(ARBITRARY_CLOCK_INITIALIZATION_INFO)
+ .pokeAutoTimeDetectionEnabled(true)
+ .pokeAutoOriginPriorities(ORIGIN_TELEPHONY);
+
+ GnssTimeSuggestion timeSuggestion = mScript.generateGnssTimeSuggestion(
+ ARBITRARY_TEST_TIME);
+
+ mScript.simulateGnssTimeSuggestion(timeSuggestion)
+ .assertLatestGnssSuggestion(timeSuggestion)
+ .verifySystemClockWasNotSetAndResetCallTracking();
+ }
+
+ @Test
public void autoOriginPrioritiesList_doesNotAffectManualSuggestion() {
mScript.pokeFakeClocks(ARBITRARY_CLOCK_INITIALIZATION_INFO)
.pokeAutoTimeDetectionEnabled(false)
@@ -945,6 +1150,11 @@ public class TimeDetectorStrategyImplTest {
return this;
}
+ Script simulateGnssTimeSuggestion(GnssTimeSuggestion timeSuggestion) {
+ mTimeDetectorStrategy.suggestGnssTime(timeSuggestion);
+ return this;
+ }
+
Script simulateAutoTimeDetectionToggle() {
mFakeCallback.simulateAutoTimeZoneDetectionToggle();
mTimeDetectorStrategy.handleAutoTimeConfigChanged();
@@ -995,6 +1205,14 @@ public class TimeDetectorStrategyImplTest {
}
/**
+ * White box test info: Asserts the latest gnss suggestion is as expected.
+ */
+ Script assertLatestGnssSuggestion(GnssTimeSuggestion expected) {
+ assertEquals(expected, mTimeDetectorStrategy.getLatestGnssSuggestion());
+ return this;
+ }
+
+ /**
* White box test info: Returns the telephony suggestion that would be used, if any, given
* the current elapsed real time clock and regardless of origin prioritization.
*/
@@ -1011,6 +1229,14 @@ public class TimeDetectorStrategyImplTest {
}
/**
+ * White box test info: Returns the gnss suggestion that would be used, if any, given the
+ * current elapsed real time clock and regardless of origin prioritization.
+ */
+ GnssTimeSuggestion peekLatestValidGnssSuggestion() {
+ return mTimeDetectorStrategy.findLatestValidGnssSuggestionForTests();
+ }
+
+ /**
* Generates a ManualTimeSuggestion using the current elapsed realtime clock for the
* reference time.
*/
@@ -1057,6 +1283,18 @@ public class TimeDetectorStrategyImplTest {
}
/**
+ * Generates a GnssTimeSuggestion using the current elapsed realtime clock for the
+ * reference time.
+ */
+ GnssTimeSuggestion generateGnssTimeSuggestion(Instant suggestedTime) {
+ TimestampedValue<Long> utcTime =
+ new TimestampedValue<>(
+ mFakeCallback.peekElapsedRealtimeMillis(),
+ suggestedTime.toEpochMilli());
+ return new GnssTimeSuggestion(utcTime);
+ }
+
+ /**
* Calculates what the supplied time would be when adjusted for the movement of the fake
* elapsed realtime clock.
*/
diff --git a/services/tests/servicestests/src/com/android/server/timezone/OWNERS b/services/tests/servicestests/src/com/android/server/timezone/OWNERS
index 09447a971bdd..8f8089717e3b 100644
--- a/services/tests/servicestests/src/com/android/server/timezone/OWNERS
+++ b/services/tests/servicestests/src/com/android/server/timezone/OWNERS
@@ -1 +1,3 @@
-include /core/java/android/app/timezone/OWNERS
+# Bug component: 847766
+mingaleev@google.com
+include /core/java/android/app/timedetector/OWNERS
diff --git a/services/tests/servicestests/src/com/android/server/timezonedetector/OWNERS b/services/tests/servicestests/src/com/android/server/timezonedetector/OWNERS
index 09447a971bdd..8f8089717e3b 100644
--- a/services/tests/servicestests/src/com/android/server/timezonedetector/OWNERS
+++ b/services/tests/servicestests/src/com/android/server/timezonedetector/OWNERS
@@ -1 +1,3 @@
-include /core/java/android/app/timezone/OWNERS
+# Bug component: 847766
+mingaleev@google.com
+include /core/java/android/app/timedetector/OWNERS
diff --git a/services/tests/uiservicestests/src/com/android/server/notification/NotificationAdjustmentExtractorTest.java b/services/tests/uiservicestests/src/com/android/server/notification/NotificationAdjustmentExtractorTest.java
index 824c05e4ae47..18ca09be235c 100644
--- a/services/tests/uiservicestests/src/com/android/server/notification/NotificationAdjustmentExtractorTest.java
+++ b/services/tests/uiservicestests/src/com/android/server/notification/NotificationAdjustmentExtractorTest.java
@@ -127,6 +127,6 @@ public class NotificationAdjustmentExtractorTest extends UiServiceTestCase {
Icon.createWithResource(getContext(), android.R.drawable.sym_def_app_icon),
"action",
PendingIntent.getBroadcast(getContext(), 0, new Intent("Action"),
- PendingIntent.FLAG_MUTABLE_UNAUDITED)).build();
+ PendingIntent.FLAG_IMMUTABLE)).build();
}
}
diff --git a/services/tests/uiservicestests/src/com/android/server/notification/NotificationIntrusivenessExtractorTest.java b/services/tests/uiservicestests/src/com/android/server/notification/NotificationIntrusivenessExtractorTest.java
index a9a3b2b0ed22..ac9a77bc5cb7 100644
--- a/services/tests/uiservicestests/src/com/android/server/notification/NotificationIntrusivenessExtractorTest.java
+++ b/services/tests/uiservicestests/src/com/android/server/notification/NotificationIntrusivenessExtractorTest.java
@@ -58,10 +58,8 @@ public class NotificationIntrusivenessExtractorTest extends UiServiceTestCase {
NotificationChannel channel = new NotificationChannel("a", "a", IMPORTANCE_DEFAULT);
final Notification.Builder builder = new Notification.Builder(getContext())
.setContentTitle("foo")
- // TODO(b/174258141) Please replace FLAG_MUTABLE_UNAUDITED below
- // with either FLAG_IMMUTABLE (recommended) or FLAG_MUTABLE.
.setFullScreenIntent(PendingIntent.getActivity(
- getContext(), 0, new Intent(""), PendingIntent.FLAG_MUTABLE_UNAUDITED),
+ getContext(), 0, new Intent(""), PendingIntent.FLAG_IMMUTABLE),
true)
.setSmallIcon(android.R.drawable.sym_def_app_icon);
@@ -79,10 +77,8 @@ public class NotificationIntrusivenessExtractorTest extends UiServiceTestCase {
NotificationChannel channel = new NotificationChannel("a", "a", IMPORTANCE_DEFAULT);
final Notification.Builder builder = new Notification.Builder(getContext())
.setContentTitle("foo")
- // TODO(b/174258141) Please replace FLAG_MUTABLE_UNAUDITED below
- // with either FLAG_IMMUTABLE (recommended) or FLAG_MUTABLE.
.setFullScreenIntent(PendingIntent.getActivity(
- getContext(), 0, new Intent(""), PendingIntent.FLAG_MUTABLE_UNAUDITED),
+ getContext(), 0, new Intent(""), PendingIntent.FLAG_IMMUTABLE),
true)
.setSmallIcon(android.R.drawable.sym_def_app_icon);
diff --git a/services/tests/uiservicestests/src/com/android/server/notification/NotificationListenerServiceTest.java b/services/tests/uiservicestests/src/com/android/server/notification/NotificationListenerServiceTest.java
index c63470617288..be489c3bcd12 100644
--- a/services/tests/uiservicestests/src/com/android/server/notification/NotificationListenerServiceTest.java
+++ b/services/tests/uiservicestests/src/com/android/server/notification/NotificationListenerServiceTest.java
@@ -357,13 +357,11 @@ public class NotificationListenerServiceTest extends UiServiceTestCase {
private ArrayList<Notification.Action> getSmartActions(String key, int index) {
ArrayList<Notification.Action> actions = new ArrayList<>();
for (int i = 0; i < index; i++) {
- // TODO(b/174935955) Please replace FLAG_MUTABLE_UNAUDITED below
- // with either FLAG_IMMUTABLE (recommended) or FLAG_MUTABLE.
PendingIntent intent = PendingIntent.getBroadcast(
getContext(),
index /*requestCode*/,
new Intent("ACTION_" + key),
- PendingIntent.FLAG_MUTABLE_UNAUDITED /*flags*/);
+ PendingIntent.FLAG_IMMUTABLE /*flags*/);
actions.add(new Notification.Action.Builder(null /*icon*/, key, intent).build());
}
return actions;
diff --git a/services/tests/uiservicestests/src/com/android/server/notification/NotificationManagerServiceTest.java b/services/tests/uiservicestests/src/com/android/server/notification/NotificationManagerServiceTest.java
index 1115b1fbe82e..45b6bce1f811 100755
--- a/services/tests/uiservicestests/src/com/android/server/notification/NotificationManagerServiceTest.java
+++ b/services/tests/uiservicestests/src/com/android/server/notification/NotificationManagerServiceTest.java
@@ -305,6 +305,8 @@ public class NotificationManagerServiceTest extends UiServiceTestCase {
@Mock
StatusBarManagerInternal mStatusBar;
+ private NotificationManagerService.WorkerHandler mWorkerHandler;
+
// Use a Testable subclass so we can simulate calls from the system without failing.
private static class TestableNotificationManagerService extends NotificationManagerService {
int countSystemChecks = 0;
@@ -482,14 +484,13 @@ public class NotificationManagerServiceTest extends UiServiceTestCase {
when(mAssistants.isAdjustmentAllowed(anyString())).thenReturn(true);
- mService.init(mService.new WorkerHandler(mTestableLooper.getLooper()),
- mRankingHandler, mPackageManager, mPackageManagerClient, mockLightsManager,
- mListeners, mAssistants, mConditionProviders,
- mCompanionMgr, mSnoozeHelper, mUsageStats, mPolicyFile, mActivityManager,
- mGroupHelper, mAm, mAtm, mAppUsageStats,
- mock(DevicePolicyManagerInternal.class), mUgm, mUgmInternal,
- mAppOpsManager, mUm, mHistoryManager, mStatsManager,
- mock(TelephonyManager.class), mAmi, mToastRateLimiter);
+ mWorkerHandler = mService.new WorkerHandler(mTestableLooper.getLooper());
+ mService.init(mWorkerHandler, mRankingHandler, mPackageManager, mPackageManagerClient,
+ mockLightsManager, mListeners, mAssistants, mConditionProviders, mCompanionMgr,
+ mSnoozeHelper, mUsageStats, mPolicyFile, mActivityManager, mGroupHelper, mAm, mAtm,
+ mAppUsageStats, mock(DevicePolicyManagerInternal.class), mUgm, mUgmInternal,
+ mAppOpsManager, mUm, mHistoryManager, mStatsManager, mock(TelephonyManager.class),
+ mAmi, mToastRateLimiter);
mService.onBootPhase(SystemService.PHASE_SYSTEM_SERVICES_READY);
mService.setAudioManager(mAudioManager);
@@ -575,6 +576,10 @@ public class NotificationManagerServiceTest extends UiServiceTestCase {
InstrumentationRegistry.getInstrumentation()
.getUiAutomation().dropShellPermissionIdentity();
+ // Remove scheduled messages that would be processed when the test is already done, and
+ // could cause issues, for example, messages that remove/cancel shown toasts (this causes
+ // problematic interactions with mocks when they're no longer working as expected).
+ mWorkerHandler.removeCallbacksAndMessages(null);
}
private void simulatePackageSuspendBroadcast(boolean suspend, String pkg,
@@ -790,10 +795,8 @@ public class NotificationManagerServiceTest extends UiServiceTestCase {
.setName("bubblebot")
.build();
RemoteInput remoteInput = new RemoteInput.Builder("reply_key").setLabel("reply").build();
- // TODO(b/174965245) Please replace FLAG_MUTABLE_UNAUDITED below
- // with either FLAG_IMMUTABLE (recommended) or FLAG_MUTABLE.
PendingIntent inputIntent = PendingIntent.getActivity(mContext, 0, new Intent(),
- PendingIntent.FLAG_MUTABLE_UNAUDITED);
+ PendingIntent.FLAG_MUTABLE);
Icon icon = Icon.createWithResource(mContext, android.R.drawable.sym_def_app_icon);
Notification.Action replyAction = new Notification.Action.Builder(icon, "Reply",
inputIntent).addRemoteInput(remoteInput)
@@ -7403,10 +7406,8 @@ public class NotificationManagerServiceTest extends UiServiceTestCase {
NotificationRecord r = generateNotificationRecord(mTestNotificationChannel);
ArrayList<Notification.Action> extraAction = new ArrayList<>();
RemoteInput remoteInput = new RemoteInput.Builder("reply_key").setLabel("reply").build();
- // TODO(b/174965245) Please replace FLAG_MUTABLE_UNAUDITED below
- // with either FLAG_IMMUTABLE (recommended) or FLAG_MUTABLE.
PendingIntent inputIntent = PendingIntent.getActivity(mContext, 0, new Intent(),
- PendingIntent.FLAG_MUTABLE_UNAUDITED);
+ PendingIntent.FLAG_IMMUTABLE);
Icon icon = Icon.createWithResource(mContext, android.R.drawable.sym_def_app_icon);
Notification.Action replyAction = new Notification.Action.Builder(icon, "Reply",
inputIntent).addRemoteInput(remoteInput)
@@ -7436,10 +7437,8 @@ public class NotificationManagerServiceTest extends UiServiceTestCase {
NotificationRecord r = generateNotificationRecord(mTestNotificationChannel);
ArrayList<Notification.Action> extraAction = new ArrayList<>();
RemoteInput remoteInput = new RemoteInput.Builder("reply_key").setLabel("reply").build();
- // TODO(b/174965245) Please replace FLAG_MUTABLE_UNAUDITED below
- // with either FLAG_IMMUTABLE (recommended) or FLAG_MUTABLE.
PendingIntent inputIntent = PendingIntent.getActivity(mContext, 0, new Intent(),
- PendingIntent.FLAG_MUTABLE_UNAUDITED);
+ PendingIntent.FLAG_MUTABLE);
Icon icon = Icon.createWithResource(mContext, android.R.drawable.sym_def_app_icon);
Notification.Action replyAction = new Notification.Action.Builder(icon, "Reply",
inputIntent).addRemoteInput(remoteInput)
diff --git a/services/tests/wmtests/Android.bp b/services/tests/wmtests/Android.bp
index 4ca5b9e4b14f..1ecf850adb1f 100644
--- a/services/tests/wmtests/Android.bp
+++ b/services/tests/wmtests/Android.bp
@@ -47,7 +47,6 @@ android_test {
"testables",
"ub-uiautomator",
"hamcrest-library",
- "compatibility-device-util-axt",
],
libs: [
diff --git a/services/tests/wmtests/src/com/android/server/wm/ActivityDisplayTests.java b/services/tests/wmtests/src/com/android/server/wm/ActivityDisplayTests.java
index 99bd0d7198c0..466b86117fdc 100644
--- a/services/tests/wmtests/src/com/android/server/wm/ActivityDisplayTests.java
+++ b/services/tests/wmtests/src/com/android/server/wm/ActivityDisplayTests.java
@@ -248,7 +248,7 @@ public class ActivityDisplayTests extends WindowTestsBase {
int topPosition = taskDisplayArea.getRootTaskCount() - 1;
// Ensure the new alwaysOnTop stack is put below the pinned stack, but on top of the
// existing alwaysOnTop stack.
- assertEquals(anotherAlwaysOnTopStack, taskDisplayArea.getRootTaskAt(topPosition - 1));
+ assertEquals(topPosition - 1, taskDisplayArea.getIndexOf(anotherAlwaysOnTopStack));
final Task nonAlwaysOnTopStack = taskDisplayArea.createRootTask(
WINDOWING_MODE_FREEFORM, ACTIVITY_TYPE_STANDARD, true /* onTop */);
@@ -256,7 +256,7 @@ public class ActivityDisplayTests extends WindowTestsBase {
topPosition = taskDisplayArea.getRootTaskCount() - 1;
// Ensure the non-alwaysOnTop stack is put below the three alwaysOnTop stacks, but above the
// existing other non-alwaysOnTop stacks.
- assertEquals(nonAlwaysOnTopStack, taskDisplayArea.getRootTaskAt(topPosition - 3));
+ assertEquals(topPosition - 3, taskDisplayArea.getIndexOf(nonAlwaysOnTopStack));
anotherAlwaysOnTopStack.setAlwaysOnTop(false);
taskDisplayArea.positionChildAt(POSITION_TOP, anotherAlwaysOnTopStack,
@@ -264,16 +264,16 @@ public class ActivityDisplayTests extends WindowTestsBase {
assertFalse(anotherAlwaysOnTopStack.isAlwaysOnTop());
// Ensure, when always on top is turned off for a stack, the stack is put just below all
// other always on top stacks.
- assertEquals(anotherAlwaysOnTopStack, taskDisplayArea.getRootTaskAt(topPosition - 2));
+ assertEquals(topPosition - 2, taskDisplayArea.getIndexOf(anotherAlwaysOnTopStack));
anotherAlwaysOnTopStack.setAlwaysOnTop(true);
// Ensure always on top state changes properly when windowing mode changes.
anotherAlwaysOnTopStack.setWindowingMode(WINDOWING_MODE_FULLSCREEN);
assertFalse(anotherAlwaysOnTopStack.isAlwaysOnTop());
- assertEquals(anotherAlwaysOnTopStack, taskDisplayArea.getRootTaskAt(topPosition - 2));
+ assertEquals(topPosition - 2, taskDisplayArea.getIndexOf(anotherAlwaysOnTopStack));
anotherAlwaysOnTopStack.setWindowingMode(WINDOWING_MODE_FREEFORM);
assertTrue(anotherAlwaysOnTopStack.isAlwaysOnTop());
- assertEquals(anotherAlwaysOnTopStack, taskDisplayArea.getRootTaskAt(topPosition - 1));
+ assertEquals(topPosition - 1, taskDisplayArea.getIndexOf(anotherAlwaysOnTopStack));
final Task dreamStack = taskDisplayArea.createRootTask(
WINDOWING_MODE_FULLSCREEN, ACTIVITY_TYPE_DREAM, true /* onTop */);
@@ -282,7 +282,7 @@ public class ActivityDisplayTests extends WindowTestsBase {
topPosition = taskDisplayArea.getRootTaskCount() - 1;
// Ensure dream shows above all activities, including PiP
assertEquals(dreamStack, taskDisplayArea.getTopRootTask());
- assertEquals(pinnedStack, taskDisplayArea.getRootTaskAt(topPosition - 1));
+ assertEquals(topPosition - 1, taskDisplayArea.getIndexOf(pinnedStack));
final Task assistStack = taskDisplayArea.createRootTask(
WINDOWING_MODE_FULLSCREEN, ACTIVITY_TYPE_ASSISTANT, true /* onTop */);
@@ -294,8 +294,8 @@ public class ActivityDisplayTests extends WindowTestsBase {
// is false and on top of everything when true.
final boolean isAssistantOnTop = mContext.getResources()
.getBoolean(com.android.internal.R.bool.config_assistantOnTopOfDream);
- assertEquals(assistStack, taskDisplayArea.getRootTaskAt(
- isAssistantOnTop ? topPosition : topPosition - 4));
+ assertEquals(isAssistantOnTop ? topPosition : topPosition - 4,
+ taskDisplayArea.getIndexOf(assistStack));
}
@Test
diff --git a/services/tests/wmtests/src/com/android/server/wm/ActivityRecordTests.java b/services/tests/wmtests/src/com/android/server/wm/ActivityRecordTests.java
index 2f34f708a562..78cebf3568c2 100644
--- a/services/tests/wmtests/src/com/android/server/wm/ActivityRecordTests.java
+++ b/services/tests/wmtests/src/com/android/server/wm/ActivityRecordTests.java
@@ -1051,7 +1051,7 @@ public class ActivityRecordTests extends WindowTestsBase {
final ActivityRecord nextTop = nextStack.getTopNonFinishingActivity();
nextTop.setState(STOPPED, "test");
- task.mPausingActivity = currentTop;
+ task.setPausingActivity(currentTop);
currentTop.finishing = true;
currentTop.setState(PAUSED, "test");
currentTop.completeFinishing("completePauseLocked");
@@ -1211,7 +1211,7 @@ public class ActivityRecordTests extends WindowTestsBase {
focusedActivity.nowVisible = true;
focusedActivity.mVisibleRequested = true;
focusedActivity.setState(RESUMED, "test");
- stack.mResumedActivity = focusedActivity;
+ stack.setResumedActivity(focusedActivity, "test");
topActivity.completeFinishing("test");
diff --git a/services/tests/wmtests/src/com/android/server/wm/ActivityStackTests.java b/services/tests/wmtests/src/com/android/server/wm/ActivityStackTests.java
index 8e3e668804ff..5504460f1036 100644
--- a/services/tests/wmtests/src/com/android/server/wm/ActivityStackTests.java
+++ b/services/tests/wmtests/src/com/android/server/wm/ActivityStackTests.java
@@ -1014,7 +1014,7 @@ public class ActivityStackTests extends WindowTestsBase {
final ActivityRecord secondActivity = new ActivityBuilder(mAtm).setTask(task).build();
firstActivity.setState(STOPPED, "testFinishDisabledPackageActivities");
secondActivity.setState(RESUMED, "testFinishDisabledPackageActivities");
- task.mResumedActivity = secondActivity;
+ task.setResumedActivity(secondActivity, "test");
// Note the activities have non-null ActivityRecord.app, so it won't remove directly.
mRootWindowContainer.mFinishDisabledPackageActivitiesHelper.process(
@@ -1140,8 +1140,8 @@ public class ActivityStackTests extends WindowTestsBase {
final Task task = new TaskBuilder(mSupervisor).build();
final ActivityRecord bottomActivity = new ActivityBuilder(mAtm).setTask(task).build();
doReturn(true).when(bottomActivity).attachedToProcess();
- task.mPausingActivity = null;
- task.mResumedActivity = bottomActivity;
+ task.setPausingActivity(null);
+ task.setResumedActivity(bottomActivity, "test");
final ActivityRecord topActivity = new ActivityBuilder(mAtm).setTask(task).build();
topActivity.info.flags |= FLAG_RESUME_WHILE_PAUSING;
diff --git a/services/tests/wmtests/src/com/android/server/wm/ActivityStarterTests.java b/services/tests/wmtests/src/com/android/server/wm/ActivityStarterTests.java
index ef2e88913914..5695412394ce 100644
--- a/services/tests/wmtests/src/com/android/server/wm/ActivityStarterTests.java
+++ b/services/tests/wmtests/src/com/android/server/wm/ActivityStarterTests.java
@@ -512,11 +512,8 @@ public class ActivityStarterTests extends WindowTestsBase {
}
private void assertNoTasks(DisplayContent display) {
- display.forAllTaskDisplayAreas(taskDisplayArea -> {
- for (int sNdx = taskDisplayArea.getRootTaskCount() - 1; sNdx >= 0; --sNdx) {
- final Task stack = taskDisplayArea.getRootTaskAt(sNdx);
- assertFalse(stack.hasChild());
- }
+ display.forAllRootTasks(stack -> {
+ assertFalse(stack.hasChild());
});
}
diff --git a/services/tests/wmtests/src/com/android/server/wm/ActivityTaskManagerServiceTests.java b/services/tests/wmtests/src/com/android/server/wm/ActivityTaskManagerServiceTests.java
index 080f04efa9b4..d34e2c4923dc 100644
--- a/services/tests/wmtests/src/com/android/server/wm/ActivityTaskManagerServiceTests.java
+++ b/services/tests/wmtests/src/com/android/server/wm/ActivityTaskManagerServiceTests.java
@@ -247,7 +247,7 @@ public class ActivityTaskManagerServiceTests extends WindowTestsBase {
activity.finishing = true;
activity.mVisibleRequested = false;
activity.setVisible(false);
- activity.getRootTask().mPausingActivity = activity;
+ activity.getTask().setPausingActivity(activity);
homeActivity.setState(Task.ActivityState.PAUSED, "test");
// Even the visibility states are invisible, the next activity should be resumed because
@@ -262,8 +262,8 @@ public class ActivityTaskManagerServiceTests extends WindowTestsBase {
public void testUpdateSleep() {
doCallRealMethod().when(mWm.mRoot).hasAwakeDisplay();
mSupervisor.mGoingToSleepWakeLock = mock(PowerManager.WakeLock.class);
- final ActivityRecord homeActivity = new ActivityBuilder(mAtm)
- .setTask(mWm.mRoot.getDefaultTaskDisplayArea().getOrCreateRootHomeTask()).build();
+ final Task rootHomeTask = mWm.mRoot.getDefaultTaskDisplayArea().getOrCreateRootHomeTask();
+ final ActivityRecord homeActivity = new ActivityBuilder(mAtm).setTask(rootHomeTask).build();
final ActivityRecord topActivity = new ActivityBuilder(mAtm).setCreateTask(true).build();
topActivity.setState(Task.ActivityState.RESUMED, "test");
@@ -277,6 +277,9 @@ public class ActivityTaskManagerServiceTests extends WindowTestsBase {
// Sleep all displays.
mWm.mRoot.forAllDisplays(display -> doReturn(true).when(display).shouldSleep());
mAtm.updateSleepIfNeededLocked();
+ // Simulate holding sleep wake lock if it is acquired.
+ verify(mSupervisor.mGoingToSleepWakeLock).acquire();
+ doReturn(true).when(mSupervisor.mGoingToSleepWakeLock).isHeld();
assertEquals(Task.ActivityState.PAUSING, topActivity.getState());
assertTrue(mAtm.mInternal.isSleeping());
@@ -285,8 +288,17 @@ public class ActivityTaskManagerServiceTests extends WindowTestsBase {
// The top app should not change while sleeping.
assertEquals(topActivity.app, mAtm.mInternal.getTopApp());
+ // If all activities are stopped, the sleep wake lock must be released.
+ final Task topRootTask = topActivity.getRootTask();
+ doReturn(true).when(rootHomeTask).goToSleepIfPossible(anyBoolean());
+ doReturn(true).when(topRootTask).goToSleepIfPossible(anyBoolean());
+ topActivity.setState(Task.ActivityState.STOPPING, "test");
+ topActivity.activityStopped(null /* newIcicle */, null /* newPersistentState */,
+ null /* description */);
+ verify(mSupervisor.mGoingToSleepWakeLock).release();
+
// Move the current top to back, the top app should update to the next activity.
- topActivity.getRootTask().moveToBack("test", null /* self */);
+ topRootTask.moveToBack("test", null /* self */);
assertEquals(homeActivity.app, mAtm.mInternal.getTopApp());
// Wake all displays.
diff --git a/services/tests/wmtests/src/com/android/server/wm/AppTransitionControllerTest.java b/services/tests/wmtests/src/com/android/server/wm/AppTransitionControllerTest.java
index 8cad56a45518..295c50bcda55 100644
--- a/services/tests/wmtests/src/com/android/server/wm/AppTransitionControllerTest.java
+++ b/services/tests/wmtests/src/com/android/server/wm/AppTransitionControllerTest.java
@@ -20,7 +20,7 @@ import static android.app.WindowConfiguration.ACTIVITY_TYPE_STANDARD;
import static android.app.WindowConfiguration.WINDOWING_MODE_FREEFORM;
import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
import static android.view.WindowManager.LayoutParams.TYPE_BASE_APPLICATION;
-import static android.view.WindowManager.TRANSIT_CHANGE_WINDOWING_MODE;
+import static android.view.WindowManager.TRANSIT_CHANGE;
import static android.view.WindowManager.TRANSIT_CLOSE;
import static android.view.WindowManager.TRANSIT_OLD_ACTIVITY_OPEN;
import static android.view.WindowManager.TRANSIT_OLD_TASK_CHANGE_WINDOWING_MODE;
@@ -111,7 +111,7 @@ public class AppTransitionControllerTest extends WindowTestsBase {
WINDOWING_MODE_FULLSCREEN, ACTIVITY_TYPE_STANDARD);
translucentOpening.setOccludesParent(false);
translucentOpening.setVisible(false);
- mDisplayContent.prepareAppTransition(TRANSIT_CHANGE_WINDOWING_MODE);
+ mDisplayContent.prepareAppTransition(TRANSIT_CHANGE);
mDisplayContent.mOpeningApps.add(behind);
mDisplayContent.mOpeningApps.add(translucentOpening);
assertEquals(TRANSIT_OLD_TASK_CHANGE_WINDOWING_MODE,
diff --git a/services/tests/wmtests/src/com/android/server/wm/DisplayContentTests.java b/services/tests/wmtests/src/com/android/server/wm/DisplayContentTests.java
index 2053bfb45884..b451d9f4aaf0 100644
--- a/services/tests/wmtests/src/com/android/server/wm/DisplayContentTests.java
+++ b/services/tests/wmtests/src/com/android/server/wm/DisplayContentTests.java
@@ -62,6 +62,8 @@ import static com.android.dx.mockito.inline.extended.ExtendedMockito.same;
import static com.android.dx.mockito.inline.extended.ExtendedMockito.spyOn;
import static com.android.dx.mockito.inline.extended.ExtendedMockito.times;
import static com.android.dx.mockito.inline.extended.ExtendedMockito.verify;
+import static com.android.server.wm.DisplayContent.IME_TARGET_INPUT;
+import static com.android.server.wm.DisplayContent.IME_TARGET_LAYERING;
import static com.android.server.wm.SurfaceAnimator.ANIMATION_TYPE_FIXED_TRANSFORM;
import static com.android.server.wm.WindowContainer.POSITION_TOP;
import static com.android.server.wm.WindowManagerService.UPDATE_FOCUS_NORMAL;
@@ -168,7 +170,7 @@ public class DisplayContentTests extends WindowTestsBase {
final WindowState imeAppTarget =
createWindow(null, TYPE_BASE_APPLICATION, mDisplayContent, "imeAppTarget");
- mDisplayContent.mInputMethodTarget = imeAppTarget;
+ mDisplayContent.setImeLayeringTarget(imeAppTarget);
assertForAllWindowsOrder(Arrays.asList(
mWallpaperWindow,
@@ -187,7 +189,7 @@ public class DisplayContentTests extends WindowTestsBase {
@UseTestDisplay(addAllCommonWindows = true)
@Test
public void testForAllWindows_WithChildWindowImeTarget() throws Exception {
- mDisplayContent.mInputMethodTarget = mChildAppWindowAbove;
+ mDisplayContent.setImeLayeringTarget(mChildAppWindowAbove);
assertForAllWindowsOrder(Arrays.asList(
mWallpaperWindow,
@@ -205,7 +207,7 @@ public class DisplayContentTests extends WindowTestsBase {
@UseTestDisplay(addAllCommonWindows = true)
@Test
public void testForAllWindows_WithStatusBarImeTarget() throws Exception {
- mDisplayContent.mInputMethodTarget = mStatusBarWindow;
+ mDisplayContent.setImeLayeringTarget(mStatusBarWindow);
assertForAllWindowsOrder(Arrays.asList(
mWallpaperWindow,
@@ -223,7 +225,7 @@ public class DisplayContentTests extends WindowTestsBase {
@UseTestDisplay(addAllCommonWindows = true)
@Test
public void testForAllWindows_WithNotificationShadeImeTarget() throws Exception {
- mDisplayContent.mInputMethodTarget = mNotificationShadeWindow;
+ mDisplayContent.setImeLayeringTarget(mNotificationShadeWindow);
assertForAllWindowsOrder(Arrays.asList(
mWallpaperWindow,
@@ -855,15 +857,17 @@ public class DisplayContentTests extends WindowTestsBase {
mDisplayContent.setInputMethodWindowLocked(mImeWindow);
newDisplay.setInputMethodWindowLocked(null);
assertEquals("appWin should be IME target window",
- appWin, mDisplayContent.mInputMethodTarget);
- assertNull("newDisplay Ime target: ", newDisplay.mInputMethodTarget);
+ appWin, mDisplayContent.getImeTarget(IME_TARGET_LAYERING));
+ assertNull("newDisplay Ime target: ", newDisplay.getImeTarget(IME_TARGET_LAYERING));
// Switch input method window on new display & make sure the input method target also
// switched as expected.
newDisplay.setInputMethodWindowLocked(mImeWindow);
mDisplayContent.setInputMethodWindowLocked(null);
- assertEquals("appWin1 should be IME target window", appWin1, newDisplay.mInputMethodTarget);
- assertNull("default display Ime target: ", mDisplayContent.mInputMethodTarget);
+ assertEquals("appWin1 should be IME target window", appWin1,
+ newDisplay.getImeTarget(IME_TARGET_LAYERING));
+ assertNull("default display Ime target: ",
+ mDisplayContent.getImeTarget(IME_TARGET_LAYERING));
}
@Test
@@ -937,17 +941,17 @@ public class DisplayContentTests extends WindowTestsBase {
@Test
public void testComputeImeParent_app() throws Exception {
final DisplayContent dc = createNewDisplay();
- dc.mInputMethodTarget = createWindow(null, TYPE_BASE_APPLICATION, "app");
- dc.mInputMethodInputTarget = dc.mInputMethodTarget;
- assertEquals(dc.mInputMethodTarget.mActivityRecord.getSurfaceControl(),
- dc.computeImeParent());
+ dc.setImeLayeringTarget(createWindow(null, TYPE_BASE_APPLICATION, "app"));
+ dc.setImeInputTarget(dc.getImeTarget(IME_TARGET_LAYERING).getWindow());
+ assertEquals(dc.getImeTarget(IME_TARGET_LAYERING).getWindow()
+ .mActivityRecord.getSurfaceControl(), dc.computeImeParent());
}
@Test
public void testComputeImeParent_app_notFullscreen() throws Exception {
final DisplayContent dc = createNewDisplay();
- dc.mInputMethodTarget = createWindow(null, TYPE_STATUS_BAR, "app");
- dc.mInputMethodTarget.setWindowingMode(
+ dc.setImeLayeringTarget(createWindow(null, TYPE_STATUS_BAR, "app"));
+ dc.getImeTarget(IME_TARGET_LAYERING).getWindow().setWindowingMode(
WindowConfiguration.WINDOWING_MODE_SPLIT_SCREEN_PRIMARY);
assertEquals(dc.getImeContainer().getParentSurfaceControl(), dc.computeImeParent());
}
@@ -957,7 +961,7 @@ public class DisplayContentTests extends WindowTestsBase {
public void testComputeImeParent_app_notMatchParentBounds() {
spyOn(mAppWindow.mActivityRecord);
doReturn(false).when(mAppWindow.mActivityRecord).matchParentBounds();
- mDisplayContent.mInputMethodTarget = mAppWindow;
+ mDisplayContent.setImeLayeringTarget(mAppWindow);
// The surface parent of IME should be the display instead of app window.
assertEquals(mDisplayContent.getImeContainer().getParentSurfaceControl(),
mDisplayContent.computeImeParent());
@@ -966,7 +970,7 @@ public class DisplayContentTests extends WindowTestsBase {
@Test
public void testComputeImeParent_noApp() throws Exception {
final DisplayContent dc = createNewDisplay();
- dc.mInputMethodTarget = createWindow(null, TYPE_STATUS_BAR, "statusBar");
+ dc.setImeLayeringTarget(createWindow(null, TYPE_STATUS_BAR, "statusBar"));
assertEquals(dc.getImeContainer().getParentSurfaceControl(), dc.computeImeParent());
}
@@ -976,12 +980,12 @@ public class DisplayContentTests extends WindowTestsBase {
WindowState app = createWindow(null, TYPE_BASE_APPLICATION, dc, "app");
- dc.mInputMethodInputTarget = app;
+ dc.setImeInputTarget(app);
assertEquals(app, dc.computeImeControlTarget());
app.removeImmediately();
- assertNull(dc.mInputMethodInputTarget);
+ assertNull(dc.getImeTarget(IME_TARGET_INPUT));
assertNull(dc.computeImeControlTarget());
}
@@ -989,20 +993,21 @@ public class DisplayContentTests extends WindowTestsBase {
public void testComputeImeControlTarget() throws Exception {
final DisplayContent dc = createNewDisplay();
dc.setRemoteInsetsController(createDisplayWindowInsetsController());
- dc.mInputMethodInputTarget = createWindow(null, TYPE_BASE_APPLICATION, "app");
- dc.mInputMethodTarget = dc.mInputMethodInputTarget;
- assertEquals(dc.mInputMethodInputTarget, dc.computeImeControlTarget());
+ dc.setImeInputTarget(createWindow(null, TYPE_BASE_APPLICATION, "app"));
+ dc.setImeLayeringTarget(dc.getImeTarget(IME_TARGET_INPUT).getWindow());
+ assertEquals(dc.getImeTarget(IME_TARGET_INPUT).getWindow(), dc.computeImeControlTarget());
}
@Test
public void testComputeImeControlTarget_splitscreen() throws Exception {
final DisplayContent dc = createNewDisplay();
- dc.mInputMethodInputTarget = createWindow(null, TYPE_BASE_APPLICATION, "app");
- dc.mInputMethodInputTarget.setWindowingMode(
+ dc.setImeInputTarget(createWindow(null, TYPE_BASE_APPLICATION, "app"));
+ dc.getImeTarget(IME_TARGET_INPUT).getWindow().setWindowingMode(
WindowConfiguration.WINDOWING_MODE_SPLIT_SCREEN_PRIMARY);
- dc.mInputMethodTarget = dc.mInputMethodInputTarget;
+ dc.setImeLayeringTarget(dc.getImeTarget(IME_TARGET_INPUT).getWindow());
dc.setRemoteInsetsController(createDisplayWindowInsetsController());
- assertNotEquals(dc.mInputMethodInputTarget, dc.computeImeControlTarget());
+ assertNotEquals(dc.getImeTarget(IME_TARGET_INPUT).getWindow(),
+ dc.computeImeControlTarget());
}
@UseTestDisplay(addWindows = W_ACTIVITY)
@@ -1010,8 +1015,9 @@ public class DisplayContentTests extends WindowTestsBase {
public void testComputeImeControlTarget_notMatchParentBounds() throws Exception {
spyOn(mAppWindow.mActivityRecord);
doReturn(false).when(mAppWindow.mActivityRecord).matchParentBounds();
- mDisplayContent.mInputMethodInputTarget = mAppWindow;
- mDisplayContent.mInputMethodTarget = mDisplayContent.mInputMethodInputTarget;
+ mDisplayContent.setImeInputTarget(mAppWindow);
+ mDisplayContent.setImeLayeringTarget(
+ mDisplayContent.getImeTarget(IME_TARGET_INPUT).getWindow());
mDisplayContent.setRemoteInsetsController(createDisplayWindowInsetsController());
assertEquals(mAppWindow, mDisplayContent.computeImeControlTarget());
}
@@ -1637,7 +1643,7 @@ public class DisplayContentTests extends WindowTestsBase {
TYPE_BASE_APPLICATION, "nextImeTargetApp");
spyOn(child1);
doReturn(true).when(child1).inSplitScreenWindowingMode();
- mDisplayContent.mInputMethodTarget = child1;
+ mDisplayContent.setImeLayeringTarget(child1);
spyOn(nextImeTargetApp);
spyOn(mAppWindow);
@@ -1648,7 +1654,7 @@ public class DisplayContentTests extends WindowTestsBase {
child1.removeImmediately();
verify(mDisplayContent).computeImeTarget(true);
- assertNull(mDisplayContent.mInputMethodInputTarget);
+ assertNull(mDisplayContent.getImeTarget(IME_TARGET_INPUT));
verify(child1, never()).needsRelativeLayeringToIme();
}
diff --git a/services/tests/wmtests/src/com/android/server/wm/ImeInsetsSourceProviderTest.java b/services/tests/wmtests/src/com/android/server/wm/ImeInsetsSourceProviderTest.java
index 59d195b670a8..5f9626711896 100644
--- a/services/tests/wmtests/src/com/android/server/wm/ImeInsetsSourceProviderTest.java
+++ b/services/tests/wmtests/src/com/android/server/wm/ImeInsetsSourceProviderTest.java
@@ -52,19 +52,19 @@ public class ImeInsetsSourceProviderTest extends WindowTestsBase {
public void testTransparentControlTargetWindowCanShowIme() {
final WindowState appWin = createWindow(null, TYPE_APPLICATION, "app");
final WindowState popup = createWindow(appWin, TYPE_APPLICATION, "popup");
- mDisplayContent.mInputMethodControlTarget = popup;
- mDisplayContent.mInputMethodTarget = appWin;
+ mDisplayContent.setImeControlTarget(popup);
+ mDisplayContent.setImeLayeringTarget(appWin);
popup.mAttrs.format = PixelFormat.TRANSPARENT;
mImeProvider.scheduleShowImePostLayout(appWin);
- assertTrue(mImeProvider.isImeTargetFromDisplayContentAndImeSame());
+ assertTrue(mImeProvider.isReadyToShowIme());
}
@Test
public void testInputMethodInputTargetCanShowIme() {
WindowState target = createWindow(null, TYPE_APPLICATION, "app");
- mDisplayContent.mInputMethodTarget = target;
+ mDisplayContent.setImeLayeringTarget(target);
mImeProvider.scheduleShowImePostLayout(target);
- assertTrue(mImeProvider.isImeTargetFromDisplayContentAndImeSame());
+ assertTrue(mImeProvider.isReadyToShowIme());
}
@Test
@@ -74,8 +74,8 @@ public class ImeInsetsSourceProviderTest extends WindowTestsBase {
mImeProvider.setWindow(ime, null, null);
WindowState target = createWindow(null, TYPE_APPLICATION, "app");
- mDisplayContent.mInputMethodTarget = target;
- mDisplayContent.mInputMethodControlTarget = target;
+ mDisplayContent.setImeLayeringTarget(target);
+ mDisplayContent.setImeControlTarget(target);
mImeProvider.scheduleShowImePostLayout(target);
assertFalse(mImeProvider.isImeShowing());
diff --git a/services/tests/wmtests/src/com/android/server/wm/InsetsStateControllerTest.java b/services/tests/wmtests/src/com/android/server/wm/InsetsStateControllerTest.java
index 90caf35e2936..276643847712 100644
--- a/services/tests/wmtests/src/com/android/server/wm/InsetsStateControllerTest.java
+++ b/services/tests/wmtests/src/com/android/server/wm/InsetsStateControllerTest.java
@@ -31,6 +31,7 @@ import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION;
import static com.android.dx.mockito.inline.extended.ExtendedMockito.doReturn;
import static com.android.dx.mockito.inline.extended.ExtendedMockito.spyOn;
+import static com.android.server.wm.DisplayContent.IME_TARGET_INPUT;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
@@ -181,16 +182,18 @@ public class InsetsStateControllerTest extends WindowTestsBase {
// This can be the IME z-order target while app cannot be the IME z-order target.
// This is also the only IME control target in this test, so IME won't be invisible caused
// by the control-target change.
- mDisplayContent.mInputMethodInputTarget = createWindow(null, TYPE_APPLICATION, "base");
+ mDisplayContent.updateImeInputAndControlTarget(
+ createWindow(null, TYPE_APPLICATION, "base"));
// Make IME and stay visible during the test.
mImeWindow.setHasSurface(true);
getController().getSourceProvider(ITYPE_IME).setWindow(mImeWindow, null, null);
- getController().onImeControlTargetChanged(mDisplayContent.mInputMethodInputTarget);
+ getController().onImeControlTargetChanged(mDisplayContent.getImeTarget(IME_TARGET_INPUT));
final InsetsState requestedState = new InsetsState();
requestedState.getSource(ITYPE_IME).setVisible(true);
- mDisplayContent.mInputMethodInputTarget.updateRequestedVisibility(requestedState);
- getController().onInsetsModified(mDisplayContent.mInputMethodInputTarget);
+ mDisplayContent.getImeTarget(IME_TARGET_INPUT).getWindow()
+ .updateRequestedVisibility(requestedState);
+ getController().onInsetsModified(mDisplayContent.getImeTarget(IME_TARGET_INPUT));
// Send our spy window (app) into the system so that we can detect the invocation.
final WindowState win = createWindow(null, TYPE_APPLICATION, "app");
diff --git a/services/tests/wmtests/src/com/android/server/wm/RootWindowContainerTests.java b/services/tests/wmtests/src/com/android/server/wm/RootWindowContainerTests.java
index 9af2b96f3f78..171aa76032db 100644
--- a/services/tests/wmtests/src/com/android/server/wm/RootWindowContainerTests.java
+++ b/services/tests/wmtests/src/com/android/server/wm/RootWindowContainerTests.java
@@ -91,10 +91,9 @@ public class RootWindowContainerTests extends WindowTestsBase {
@Test
public void testAllPausedActivitiesComplete() {
DisplayContent displayContent = mWm.mRoot.getDisplayContent(DEFAULT_DISPLAY);
- TaskDisplayArea taskDisplayArea = displayContent.getDefaultTaskDisplayArea();
- Task stack = taskDisplayArea.getRootTaskAt(0);
ActivityRecord activity = createActivityRecord(displayContent);
- stack.mPausingActivity = activity;
+ Task task = activity.getTask();
+ task.setPausingActivity(activity);
activity.setState(PAUSING, "test PAUSING");
assertThat(mWm.mRoot.allPausedActivitiesComplete()).isFalse();
diff --git a/services/tests/wmtests/src/com/android/server/wm/RunningTasksTest.java b/services/tests/wmtests/src/com/android/server/wm/RunningTasksTest.java
index 6821d47d5b1a..e2be39b6eb15 100644
--- a/services/tests/wmtests/src/com/android/server/wm/RunningTasksTest.java
+++ b/services/tests/wmtests/src/com/android/server/wm/RunningTasksTest.java
@@ -34,6 +34,7 @@ import org.junit.Test;
import org.junit.runner.RunWith;
import java.util.ArrayList;
+import java.util.List;
/**
* Build/Install/Run:
@@ -70,9 +71,12 @@ public class RunningTasksTest extends WindowTestsBase {
final int numTasks = 10;
int activeTime = 0;
+ final List<Task> rootTasks = new ArrayList<>();
+ display.getDefaultTaskDisplayArea().forAllRootTasks(task -> {
+ rootTasks.add(task);
+ }, false /* traverseTopToBottom */);
for (int i = 0; i < numTasks; i++) {
- createTask(display.getDefaultTaskDisplayArea().getRootTaskAt(i % numStacks),
- ".Task" + i, i, activeTime++, null);
+ createTask(rootTasks.get(i % numStacks), ".Task" + i, i, activeTime++, null);
}
// Ensure that the latest tasks were returned in order of decreasing last active time,
diff --git a/services/tests/wmtests/src/com/android/server/wm/SizeCompatTests.java b/services/tests/wmtests/src/com/android/server/wm/SizeCompatTests.java
index dd6e490b8282..c7175a0c424d 100644
--- a/services/tests/wmtests/src/com/android/server/wm/SizeCompatTests.java
+++ b/services/tests/wmtests/src/com/android/server/wm/SizeCompatTests.java
@@ -30,6 +30,7 @@ import static com.android.dx.mockito.inline.extended.ExtendedMockito.mock;
import static com.android.dx.mockito.inline.extended.ExtendedMockito.never;
import static com.android.dx.mockito.inline.extended.ExtendedMockito.spyOn;
import static com.android.dx.mockito.inline.extended.ExtendedMockito.verify;
+import static com.android.server.wm.DisplayContent.IME_TARGET_LAYERING;
import static com.android.server.wm.Task.ActivityState.STOPPED;
import static org.junit.Assert.assertEquals;
@@ -270,7 +271,7 @@ public class SizeCompatTests extends WindowTestsBase {
// The position should be horizontal centered.
assertEquals((displayWidth - bounds.width()) / 2, bounds.left);
- mActivity.mDisplayContent.mInputMethodTarget = addWindowToActivity(mActivity);
+ mActivity.mDisplayContent.setImeLayeringTarget(addWindowToActivity(mActivity));
// Make sure IME cannot attach to the app, otherwise IME window will also be shifted.
assertFalse(mActivity.mDisplayContent.isImeAttachedToApp());
@@ -290,9 +291,9 @@ public class SizeCompatTests extends WindowTestsBase {
assertFitted();
rotateDisplay(mActivity.mDisplayContent, ROTATION_90);
- mActivity.mDisplayContent.mInputMethodTarget = addWindowToActivity(mActivity);
- mActivity.mDisplayContent.mInputMethodInputTarget =
- mActivity.mDisplayContent.mInputMethodTarget;
+ mActivity.mDisplayContent.setImeLayeringTarget(addWindowToActivity(mActivity));
+ mActivity.mDisplayContent.setImeInputTarget(
+ mActivity.mDisplayContent.getImeTarget(IME_TARGET_LAYERING).getWindow());
// Because the aspect ratio of display doesn't exceed the max aspect ratio of activity.
// The activity should still fill its parent container and IME can attach to the activity.
assertTrue(mActivity.matchParentBounds());
diff --git a/services/tests/wmtests/src/com/android/server/wm/TaskStackChangedListenerTest.java b/services/tests/wmtests/src/com/android/server/wm/TaskStackChangedListenerTest.java
index 788ef5ad2ec4..6046c9b2c2b1 100644
--- a/services/tests/wmtests/src/com/android/server/wm/TaskStackChangedListenerTest.java
+++ b/services/tests/wmtests/src/com/android/server/wm/TaskStackChangedListenerTest.java
@@ -20,20 +20,19 @@ import static android.view.ViewGroup.LayoutParams.MATCH_PARENT;
import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
+import static com.android.server.wm.utils.CommonUtils.runWithShellPermissionIdentity;
+
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import android.app.Activity;
-import android.app.ActivityManager;
import android.app.ActivityManager.TaskDescription;
import android.app.ActivityOptions;
import android.app.ActivityTaskManager;
import android.app.ActivityView;
-import android.app.IActivityManager;
import android.app.ITaskStackListener;
-import android.app.Instrumentation;
import android.app.Instrumentation.ActivityMonitor;
import android.app.TaskStackListener;
import android.content.ComponentName;
@@ -44,7 +43,6 @@ import android.os.Bundle;
import android.os.RemoteException;
import android.os.SystemClock;
import android.platform.test.annotations.Presubmit;
-import android.support.test.uiautomator.UiDevice;
import android.text.TextUtils;
import android.view.Display;
import android.view.ViewGroup;
@@ -52,10 +50,7 @@ import android.view.ViewGroup;
import androidx.test.filters.FlakyTest;
import androidx.test.filters.MediumTest;
-import com.android.compatibility.common.util.SystemUtil;
-
import org.junit.After;
-import org.junit.Before;
import org.junit.Test;
import java.util.concurrent.ArrayBlockingQueue;
@@ -70,17 +65,11 @@ import java.util.function.Predicate;
@MediumTest
public class TaskStackChangedListenerTest {
- private IActivityManager mService;
private ITaskStackListener mTaskStackListener;
private static final int WAIT_TIMEOUT_MS = 5000;
private static final Object sLock = new Object();
- @Before
- public void setUp() throws Exception {
- mService = ActivityManager.getService();
- }
-
@After
public void tearDown() throws Exception {
ActivityTaskManager.getService().unregisterTaskStackListener(mTaskStackListener);
@@ -374,7 +363,7 @@ public class TaskStackChangedListenerTest {
final ActivityMonitor monitor = new ActivityMonitor(activityClass.getName(), null, false);
getInstrumentation().addMonitor(monitor);
final Context context = getInstrumentation().getContext();
- SystemUtil.runWithShellPermissionIdentity(() -> context.startActivity(
+ runWithShellPermissionIdentity(() -> context.startActivity(
new Intent(context, activityClass).addFlags(Intent.FLAG_ACTIVITY_NEW_TASK),
options.toBundle()));
final TestActivity activity =
diff --git a/services/tests/wmtests/src/com/android/server/wm/TestWindowManagerPolicy.java b/services/tests/wmtests/src/com/android/server/wm/TestWindowManagerPolicy.java
index eb5f1f9b9c5f..ccf2394e7f81 100644
--- a/services/tests/wmtests/src/com/android/server/wm/TestWindowManagerPolicy.java
+++ b/services/tests/wmtests/src/com/android/server/wm/TestWindowManagerPolicy.java
@@ -372,6 +372,11 @@ class TestWindowManagerPolicy implements WindowManagerPolicy {
}
@Override
+ public int applyKeyguardOcclusionChange() {
+ return 0;
+ }
+
+ @Override
public void setPipVisibilityLw(boolean visible) {
}
diff --git a/services/tests/wmtests/src/com/android/server/wm/TransitionTests.java b/services/tests/wmtests/src/com/android/server/wm/TransitionTests.java
index 4909b1d7629e..00c2aa5ebc63 100644
--- a/services/tests/wmtests/src/com/android/server/wm/TransitionTests.java
+++ b/services/tests/wmtests/src/com/android/server/wm/TransitionTests.java
@@ -20,8 +20,8 @@ import static android.app.WindowConfiguration.ACTIVITY_TYPE_STANDARD;
import static android.app.WindowConfiguration.WINDOWING_MODE_FREEFORM;
import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
import static android.view.WindowManager.TRANSIT_OLD_TASK_OPEN;
-import static android.window.TransitionInfo.TRANSIT_HIDE;
-import static android.window.TransitionInfo.TRANSIT_OPEN;
+import static android.view.WindowManager.TRANSIT_OPEN;
+import static android.view.WindowManager.TRANSIT_TO_BACK;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
@@ -74,21 +74,22 @@ public class TransitionTests extends WindowTestsBase {
closing.mVisibleRequested = false;
opening.mVisibleRequested = true;
- int transitType = TRANSIT_OLD_TASK_OPEN;
+ int transit = TRANSIT_OLD_TASK_OPEN;
+ int flags = 0;
// Check basic both tasks participating
participants.add(oldTask);
participants.add(newTask);
ArraySet<WindowContainer> targets = Transition.calculateTargets(participants, changes);
- TransitionInfo info = Transition.calculateTransitionInfo(transitType, targets, changes);
+ TransitionInfo info = Transition.calculateTransitionInfo(transit, flags, targets, changes);
assertEquals(2, info.getChanges().size());
- assertEquals(transitType, info.getType());
+ assertEquals(transit, info.getType());
// Check that children are pruned
participants.add(opening);
participants.add(closing);
targets = Transition.calculateTargets(participants, changes);
- info = Transition.calculateTransitionInfo(transitType, targets, changes);
+ info = Transition.calculateTransitionInfo(transit, flags, targets, changes);
assertEquals(2, info.getChanges().size());
assertNotNull(info.getChange(newTask.mRemoteToken.toWindowContainerToken()));
assertNotNull(info.getChange(oldTask.mRemoteToken.toWindowContainerToken()));
@@ -96,7 +97,7 @@ public class TransitionTests extends WindowTestsBase {
// Check combined prune and promote
participants.remove(newTask);
targets = Transition.calculateTargets(participants, changes);
- info = Transition.calculateTransitionInfo(transitType, targets, changes);
+ info = Transition.calculateTransitionInfo(transit, flags, targets, changes);
assertEquals(2, info.getChanges().size());
assertNotNull(info.getChange(newTask.mRemoteToken.toWindowContainerToken()));
assertNotNull(info.getChange(oldTask.mRemoteToken.toWindowContainerToken()));
@@ -104,7 +105,7 @@ public class TransitionTests extends WindowTestsBase {
// Check multi promote
participants.remove(oldTask);
targets = Transition.calculateTargets(participants, changes);
- info = Transition.calculateTransitionInfo(transitType, targets, changes);
+ info = Transition.calculateTransitionInfo(transit, flags, targets, changes);
assertEquals(2, info.getChanges().size());
assertNotNull(info.getChange(newTask.mRemoteToken.toWindowContainerToken()));
assertNotNull(info.getChange(oldTask.mRemoteToken.toWindowContainerToken()));
@@ -138,23 +139,24 @@ public class TransitionTests extends WindowTestsBase {
opening.mVisibleRequested = true;
opening2.mVisibleRequested = true;
- int transitType = TRANSIT_OLD_TASK_OPEN;
+ int transit = TRANSIT_OLD_TASK_OPEN;
+ int flags = 0;
// Check full promotion from leaf
participants.add(oldTask);
participants.add(opening);
participants.add(opening2);
ArraySet<WindowContainer> targets = Transition.calculateTargets(participants, changes);
- TransitionInfo info = Transition.calculateTransitionInfo(transitType, targets, changes);
+ TransitionInfo info = Transition.calculateTransitionInfo(transit, flags, targets, changes);
assertEquals(2, info.getChanges().size());
- assertEquals(transitType, info.getType());
+ assertEquals(transit, info.getType());
assertNotNull(info.getChange(newTask.mRemoteToken.toWindowContainerToken()));
assertNotNull(info.getChange(oldTask.mRemoteToken.toWindowContainerToken()));
// Check that unchanging but visible descendant of sibling prevents promotion
participants.remove(opening2);
targets = Transition.calculateTargets(participants, changes);
- info = Transition.calculateTransitionInfo(transitType, targets, changes);
+ info = Transition.calculateTransitionInfo(transit, flags, targets, changes);
assertEquals(2, info.getChanges().size());
assertNotNull(info.getChange(newNestedTask.mRemoteToken.toWindowContainerToken()));
assertNotNull(info.getChange(oldTask.mRemoteToken.toWindowContainerToken()));
@@ -184,29 +186,30 @@ public class TransitionTests extends WindowTestsBase {
showing.mVisibleRequested = true;
showing2.mVisibleRequested = true;
- int transitType = TRANSIT_OLD_TASK_OPEN;
+ int transit = TRANSIT_OLD_TASK_OPEN;
+ int flags = 0;
// Check promotion to DisplayArea
participants.add(showing);
participants.add(showing2);
ArraySet<WindowContainer> targets = Transition.calculateTargets(participants, changes);
- TransitionInfo info = Transition.calculateTransitionInfo(transitType, targets, changes);
+ TransitionInfo info = Transition.calculateTransitionInfo(transit, flags, targets, changes);
assertEquals(1, info.getChanges().size());
- assertEquals(transitType, info.getType());
+ assertEquals(transit, info.getType());
assertNotNull(info.getChange(tda.mRemoteToken.toWindowContainerToken()));
ITaskOrganizer mockOrg = mock(ITaskOrganizer.class);
// Check that organized tasks get reported even if not top
showTask.mTaskOrganizer = mockOrg;
targets = Transition.calculateTargets(participants, changes);
- info = Transition.calculateTransitionInfo(transitType, targets, changes);
+ info = Transition.calculateTransitionInfo(transit, flags, targets, changes);
assertEquals(2, info.getChanges().size());
assertNotNull(info.getChange(tda.mRemoteToken.toWindowContainerToken()));
assertNotNull(info.getChange(showTask.mRemoteToken.toWindowContainerToken()));
// Even if DisplayArea explicitly participating
participants.add(tda);
targets = Transition.calculateTargets(participants, changes);
- info = Transition.calculateTransitionInfo(transitType, targets, changes);
+ info = Transition.calculateTransitionInfo(transit, flags, targets, changes);
assertEquals(2, info.getChanges().size());
}
@@ -231,13 +234,14 @@ public class TransitionTests extends WindowTestsBase {
ArraySet<WindowContainer> targets = Transition.calculateTargets(
transition.mParticipants, transition.mChanges);
- TransitionInfo info = Transition.calculateTransitionInfo(0, targets, transition.mChanges);
+ TransitionInfo info = Transition.calculateTransitionInfo(
+ 0, 0, targets, transition.mChanges);
assertEquals(2, info.getChanges().size());
// There was an existence change on open, so it should be OPEN rather than SHOW
assertEquals(TRANSIT_OPEN,
info.getChange(openTask.mRemoteToken.toWindowContainerToken()).getMode());
// No exestence change on closing, so HIDE rather than CLOSE
- assertEquals(TRANSIT_HIDE,
+ assertEquals(TRANSIT_TO_BACK,
info.getChange(closeTask.mRemoteToken.toWindowContainerToken()).getMode());
}
@@ -267,7 +271,8 @@ public class TransitionTests extends WindowTestsBase {
ArraySet<WindowContainer> targets = Transition.calculateTargets(
transition.mParticipants, transition.mChanges);
- TransitionInfo info = Transition.calculateTransitionInfo(0, targets, transition.mChanges);
+ TransitionInfo info = Transition.calculateTransitionInfo(
+ 0, 0, targets, transition.mChanges);
assertEquals(taskCount, info.getChanges().size());
// verify order is top-to-bottem
for (int i = 0; i < taskCount; ++i) {
diff --git a/services/tests/wmtests/src/com/android/server/wm/WindowContainerTraversalTests.java b/services/tests/wmtests/src/com/android/server/wm/WindowContainerTraversalTests.java
index 78e873e2b0a3..f13847559aa0 100644
--- a/services/tests/wmtests/src/com/android/server/wm/WindowContainerTraversalTests.java
+++ b/services/tests/wmtests/src/com/android/server/wm/WindowContainerTraversalTests.java
@@ -56,7 +56,7 @@ public class WindowContainerTraversalTests extends WindowTestsBase {
WINDOWING_MODE_SPLIT_SCREEN_SECONDARY, ACTIVITY_TYPE_STANDARD,
TYPE_BASE_APPLICATION, mDisplayContent, "splitScreenSecondaryWindow");
- mDisplayContent.mInputMethodTarget = splitScreenWindow;
+ mDisplayContent.setImeLayeringTarget(splitScreenWindow);
Consumer<WindowState> c = mock(Consumer.class);
mDisplayContent.forAllWindows(c, false);
diff --git a/services/tests/wmtests/src/com/android/server/wm/WindowFrameTests.java b/services/tests/wmtests/src/com/android/server/wm/WindowFrameTests.java
index d2be50d02ef3..4a6906b88710 100644
--- a/services/tests/wmtests/src/com/android/server/wm/WindowFrameTests.java
+++ b/services/tests/wmtests/src/com/android/server/wm/WindowFrameTests.java
@@ -292,7 +292,7 @@ public class WindowFrameTests extends WindowTestsBase {
// Make IME attach to the window and can produce insets.
final DisplayContent dc = mTestDisplayContent;
- dc.mInputMethodTarget = w;
+ dc.setImeLayeringTarget(w);
WindowState mockIme = mock(WindowState.class);
Mockito.doReturn(true).when(mockIme).isVisibleNow();
dc.mInputMethodWindow = mockIme;
diff --git a/services/tests/wmtests/src/com/android/server/wm/WindowOrganizerTests.java b/services/tests/wmtests/src/com/android/server/wm/WindowOrganizerTests.java
index f123bc16e52c..3c8268533b6e 100644
--- a/services/tests/wmtests/src/com/android/server/wm/WindowOrganizerTests.java
+++ b/services/tests/wmtests/src/com/android/server/wm/WindowOrganizerTests.java
@@ -741,11 +741,10 @@ public class WindowOrganizerTests extends WindowTestsBase {
}
private List<Task> getTasksCreatedByOrganizer(DisplayContent dc) {
- ArrayList<Task> out = new ArrayList<>();
- dc.forAllTaskDisplayAreas(taskDisplayArea -> {
- for (int sNdx = taskDisplayArea.getRootTaskCount() - 1; sNdx >= 0; --sNdx) {
- final Task t = taskDisplayArea.getRootTaskAt(sNdx);
- if (t.mCreatedByOrganizer) out.add(t);
+ final ArrayList<Task> out = new ArrayList<>();
+ dc.forAllRootTasks(task -> {
+ if (task.mCreatedByOrganizer) {
+ out.add(task);
}
});
return out;
diff --git a/services/tests/wmtests/src/com/android/server/wm/WindowStateTests.java b/services/tests/wmtests/src/com/android/server/wm/WindowStateTests.java
index a57de094a210..76f8207b4ad8 100644
--- a/services/tests/wmtests/src/com/android/server/wm/WindowStateTests.java
+++ b/services/tests/wmtests/src/com/android/server/wm/WindowStateTests.java
@@ -789,7 +789,7 @@ public class WindowStateTests extends WindowTestsBase {
public void testNeedsRelativeLayeringToIme_notAttached() {
WindowState sameTokenWindow = createWindow(null, TYPE_BASE_APPLICATION, mAppWindow.mToken,
"SameTokenWindow");
- mDisplayContent.mInputMethodTarget = mAppWindow;
+ mDisplayContent.setImeLayeringTarget(mAppWindow);
sameTokenWindow.mActivityRecord.getStack().setWindowingMode(
WINDOWING_MODE_SPLIT_SCREEN_PRIMARY);
assertTrue(sameTokenWindow.needsRelativeLayeringToIme());
@@ -802,7 +802,7 @@ public class WindowStateTests extends WindowTestsBase {
public void testNeedsRelativeLayeringToIme_startingWindow() {
WindowState sameTokenWindow = createWindow(null, TYPE_APPLICATION_STARTING,
mAppWindow.mToken, "SameTokenWindow");
- mDisplayContent.mInputMethodTarget = mAppWindow;
+ mDisplayContent.setImeLayeringTarget(mAppWindow);
sameTokenWindow.mActivityRecord.getStack().setWindowingMode(
WINDOWING_MODE_SPLIT_SCREEN_PRIMARY);
assertFalse(sameTokenWindow.needsRelativeLayeringToIme());
diff --git a/services/tests/wmtests/src/com/android/server/wm/WindowTestsBase.java b/services/tests/wmtests/src/com/android/server/wm/WindowTestsBase.java
index d64b46d925ff..e13a5952ccac 100644
--- a/services/tests/wmtests/src/com/android/server/wm/WindowTestsBase.java
+++ b/services/tests/wmtests/src/com/android/server/wm/WindowTestsBase.java
@@ -1121,12 +1121,9 @@ class WindowTestsBase extends SystemServiceTestsBase {
mService.mTaskOrganizerController.setLaunchRoot(mDisplayId,
mSecondary.mRemoteToken.toWindowContainerToken());
DisplayContent dc = mService.mRootWindowContainer.getDisplayContent(mDisplayId);
- dc.forAllTaskDisplayAreas(taskDisplayArea -> {
- for (int sNdx = taskDisplayArea.getRootTaskCount() - 1; sNdx >= 0; --sNdx) {
- final Task stack = taskDisplayArea.getRootTaskAt(sNdx);
- if (!WindowConfiguration.isSplitScreenWindowingMode(stack.getWindowingMode())) {
- stack.reparent(mSecondary, POSITION_BOTTOM);
- }
+ dc.forAllRootTasks(stack -> {
+ if (!WindowConfiguration.isSplitScreenWindowingMode(stack.getWindowingMode())) {
+ stack.reparent(mSecondary, POSITION_BOTTOM);
}
});
}
diff --git a/services/tests/wmtests/src/com/android/server/wm/ZOrderingTests.java b/services/tests/wmtests/src/com/android/server/wm/ZOrderingTests.java
index e44d47a59fe5..811a14666db9 100644
--- a/services/tests/wmtests/src/com/android/server/wm/ZOrderingTests.java
+++ b/services/tests/wmtests/src/com/android/server/wm/ZOrderingTests.java
@@ -218,7 +218,7 @@ public class ZOrderingTests extends WindowTestsBase {
@Test
public void testAssignWindowLayers_ForImeWithNoTarget() {
- mDisplayContent.mInputMethodTarget = null;
+ mDisplayContent.setImeLayeringTarget(null);
mDisplayContent.assignChildLayers(mTransaction);
// The Ime has an higher base layer than app windows and lower base layer than system
@@ -236,7 +236,7 @@ public class ZOrderingTests extends WindowTestsBase {
@Test
public void testAssignWindowLayers_ForImeWithAppTarget() {
final WindowState imeAppTarget = createWindow("imeAppTarget");
- mDisplayContent.mInputMethodTarget = imeAppTarget;
+ mDisplayContent.setImeLayeringTarget(imeAppTarget);
mDisplayContent.assignChildLayers(mTransaction);
@@ -262,7 +262,7 @@ public class ZOrderingTests extends WindowTestsBase {
TYPE_APPLICATION_MEDIA_OVERLAY, imeAppTarget.mToken,
"imeAppTargetChildBelowWindow");
- mDisplayContent.mInputMethodTarget = imeAppTarget;
+ mDisplayContent.setImeLayeringTarget(imeAppTarget);
mDisplayContent.assignChildLayers(mTransaction);
// Ime should be above all app windows except for child windows that are z-ordered above it
@@ -284,7 +284,7 @@ public class ZOrderingTests extends WindowTestsBase {
final WindowState imeAppTarget = createWindow("imeAppTarget");
final WindowState appAboveImeTarget = createWindow("appAboveImeTarget");
- mDisplayContent.mInputMethodTarget = imeAppTarget;
+ mDisplayContent.setImeLayeringTarget(imeAppTarget);
mDisplayContent.assignChildLayers(mTransaction);
// Ime should be above all app windows except for non-fullscreen app window above it and
@@ -307,7 +307,7 @@ public class ZOrderingTests extends WindowTestsBase {
mDisplayContent, "imeSystemOverlayTarget",
true /* ownerCanAddInternalSystemWindow */);
- mDisplayContent.mInputMethodTarget = imeSystemOverlayTarget;
+ mDisplayContent.setImeLayeringTarget(imeSystemOverlayTarget);
mDisplayContent.assignChildLayers(mTransaction);
// The IME target base layer is higher than all window except for the nav bar window, so the
@@ -330,7 +330,7 @@ public class ZOrderingTests extends WindowTestsBase {
@Test
public void testAssignWindowLayers_ForStatusBarImeTarget() {
- mDisplayContent.mInputMethodTarget = mStatusBarWindow;
+ mDisplayContent.setImeLayeringTarget(mStatusBarWindow);
mDisplayContent.assignChildLayers(mTransaction);
assertWindowHigher(mImeWindow, mChildAppWindowAbove);
diff --git a/services/tests/wmtests/src/com/android/server/wm/utils/CommonUtils.java b/services/tests/wmtests/src/com/android/server/wm/utils/CommonUtils.java
new file mode 100644
index 000000000000..99d73cf5f7d3
--- /dev/null
+++ b/services/tests/wmtests/src/com/android/server/wm/utils/CommonUtils.java
@@ -0,0 +1,37 @@
+/*
+ * 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.server.wm.utils;
+
+import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
+
+import android.app.UiAutomation;
+
+/** Provides common utility functions. */
+public class CommonUtils {
+ public static UiAutomation getUiAutomation() {
+ return getInstrumentation().getUiAutomation();
+ }
+
+ public static void runWithShellPermissionIdentity(Runnable runnable) {
+ getUiAutomation().adoptShellPermissionIdentity();
+ try {
+ runnable.run();
+ } finally {
+ getUiAutomation().dropShellPermissionIdentity();
+ }
+ }
+}
diff --git a/telephony/common/com/android/internal/telephony/CarrierAppUtils.java b/telephony/common/com/android/internal/telephony/CarrierAppUtils.java
index 76291631b37d..8531b507a92f 100644
--- a/telephony/common/com/android/internal/telephony/CarrierAppUtils.java
+++ b/telephony/common/com/android/internal/telephony/CarrierAppUtils.java
@@ -26,7 +26,7 @@ import android.os.Build;
import android.os.CarrierAssociatedAppEntry;
import android.os.SystemConfigManager;
import android.os.UserHandle;
-import android.permission.PermissionManager;
+import android.permission.LegacyPermissionManager;
import android.provider.Settings;
import android.telephony.TelephonyManager;
import android.util.ArrayMap;
@@ -141,8 +141,8 @@ public final class CarrierAppUtils {
Map<String, List<CarrierAssociatedAppEntry>>
systemCarrierAssociatedAppsDisabledUntilUsed, Context context) {
PackageManager packageManager = context.getPackageManager();
- PermissionManager permissionManager =
- (PermissionManager) context.getSystemService(Context.PERMISSION_SERVICE);
+ LegacyPermissionManager permissionManager = (LegacyPermissionManager)
+ context.getSystemService(Context.LEGACY_PERMISSION_SERVICE);
List<ApplicationInfo> candidates = getDefaultCarrierAppCandidatesHelper(
userId, systemCarrierAppsDisabledUntilUsed, context);
if (candidates == null || candidates.isEmpty()) {
diff --git a/telephony/common/com/android/internal/telephony/TelephonyPermissions.java b/telephony/common/com/android/internal/telephony/TelephonyPermissions.java
index 4bb7cc47d702..556df885dec3 100644
--- a/telephony/common/com/android/internal/telephony/TelephonyPermissions.java
+++ b/telephony/common/com/android/internal/telephony/TelephonyPermissions.java
@@ -27,7 +27,7 @@ import android.os.Binder;
import android.os.Build;
import android.os.Process;
import android.os.UserHandle;
-import android.permission.PermissionManager;
+import android.permission.LegacyPermissionManager;
import android.telephony.SubscriptionManager;
import android.telephony.TelephonyManager;
import android.util.Log;
@@ -327,8 +327,8 @@ public final class TelephonyPermissions {
return true;
}
- PermissionManager permissionManager = (PermissionManager) context.getSystemService(
- Context.PERMISSION_SERVICE);
+ LegacyPermissionManager permissionManager = (LegacyPermissionManager)
+ context.getSystemService(Context.LEGACY_PERMISSION_SERVICE);
if (permissionManager.checkDeviceIdentifierAccess(callingPackage, message, callingFeatureId,
pid, uid) == PackageManager.PERMISSION_GRANTED) {
return true;
diff --git a/telephony/java/android/telephony/DataFailCause.java b/telephony/java/android/telephony/DataFailCause.java
index 8b7a243c30e6..d502da9fb9ec 100644
--- a/telephony/java/android/telephony/DataFailCause.java
+++ b/telephony/java/android/telephony/DataFailCause.java
@@ -916,6 +916,84 @@ public final class DataFailCause {
/** System preference change back to SRAT during handoff */
public static final int HANDOFF_PREFERENCE_CHANGED = 0x8CB;
+ //IKE error notifications message as specified in 3GPP TS 24.302 (Section 8.1.2.2).
+
+ /** The PDN connection corresponding to the requested APN has been rejected. */
+ public static final int IWLAN_PDN_CONNECTION_REJECTION = 0x2000;
+ /**
+ * The PDN connection has been rejected. No additional PDN connections can be established
+ * for the UE due to the network policies or capabilities.
+ */
+ public static final int IWLAN_MAX_CONNECTION_REACHED = 0x2001;
+ /**
+ * The PDN connection has been rejected due to a semantic error in TFT operation.
+ */
+ public static final int IWLAN_SEMANTIC_ERROR_IN_THE_TFT_OPERATION = 0x2031;
+ /**
+ * The PDN connection has been rejected due to a syntactic error in TFT operation.
+ */
+ public static final int IWLAN_SYNTACTICAL_ERROR_IN_THE_TFT_OPERATION = 0x2032;
+ /**
+ * The PDN connection has been rejected due to sematic errors in the packet filter.
+ */
+ public static final int IWLAN_SEMANTIC_ERRORS_IN_PACKET_FILTERS = 0x2034;
+ /**
+ * The PDN connection has been rejected due to syntactic errors in the packet filter.
+ */
+ public static final int IWLAN_SYNTACTICAL_ERRORS_IN_PACKET_FILTERS = 0x2035;
+ /**
+ * No non-3GPP subscription is associated with the IMSI.
+ * The UE is not allowed to use non-3GPP access to EPC.
+ */
+ public static final int IWLAN_NON_3GPP_ACCESS_TO_EPC_NOT_ALLOWED = 0x2328;
+ /** The user identified by the IMSI is unknown. */
+ public static final int IWLAN_USER_UNKNOWN = 0x2329;
+ /**
+ * The requested APN is not included in the user's profile,
+ * and therefore is not authorized for that user.
+ */
+ public static final int IWLAN_NO_APN_SUBSCRIPTION = 0x232A;
+ /** The user is barred from using the non-3GPP access or the subscribed APN. */
+ public static final int IWLAN_AUTHORIZATION_REJECTED = 0x232B;
+ /** The Mobile Equipment used is not acceptable to the network */
+ public static final int IWLAN_ILLEGAL_ME = 0x232E;
+ /**
+ * The network has determined that the requested procedure cannot be completed successfully
+ * due to network failure.
+ */
+ public static final int IWLAN_NETWORK_FAILURE = 0x2904;
+ /** The access type is restricted to the user. */
+ public static final int IWLAN_RAT_TYPE_NOT_ALLOWED = 0x2AF9;
+ /** The network does not accept emergency PDN bringup request using an IMEI */
+ public static final int IWLAN_IMEI_NOT_ACCEPTED = 0x2AFD;
+ /**
+ * The ePDG performs PLMN filtering (based on roaming agreements) and rejects
+ * the request from the UE.
+ * The UE requests service in a PLMN where the UE is not allowed to operate.
+ */
+ public static final int IWLAN_PLMN_NOT_ALLOWED = 0x2B03;
+ /** The ePDG does not support un-authenticated IMSI based emergency PDN bringup **/
+ public static final int IWLAN_UNAUTHENTICATED_EMERGENCY_NOT_SUPPORTED = 0x2B2F;
+
+ // Device is unable to establish an IPSec tunnel with the ePDG for any reason
+ // e.g authentication fail or certificate validation or DNS Resolution and timeout failure.
+
+ /** IKE configuration error resulting in failure */
+ public static final int IWLAN_IKEV2_CONFIG_FAILURE = 0x4000;
+ /**
+ * Sent in the response to an IKE_AUTH message when, for some reason,
+ * the authentication failed.
+ */
+ public static final int IWLAN_IKEV2_AUTH_FAILURE = 0x4001;
+ /** IKE message timeout, tunnel setup failed due to no response from EPDG */
+ public static final int IWLAN_IKEV2_MSG_TIMEOUT = 0x4002;
+ /** IKE Certification validation failure */
+ public static final int IWLAN_IKEV2_CERT_INVALID = 0x4003;
+ /** Unable to resolve FQDN for the ePDG to an IP address */
+ public static final int IWLAN_DNS_RESOLUTION_NAME_FAILURE = 0x4004;
+ /** No response received from the DNS Server due to a timeout*/
+ public static final int IWLAN_DNS_RESOLUTION_TIMEOUT = 0x4005;
+
// OEM sepecific error codes. To be used by OEMs when they don't
// want to reveal error code which would be replaced by ERROR_UNSPECIFIED
public static final int OEM_DCFAILCAUSE_1 = 0x1001;
@@ -1341,6 +1419,34 @@ public final class DataFailCause {
sFailCauseMap.put(VSNCP_RECONNECT_NOT_ALLOWED, "VSNCP_RECONNECT_NOT_ALLOWED");
sFailCauseMap.put(IPV6_PREFIX_UNAVAILABLE, "IPV6_PREFIX_UNAVAILABLE");
sFailCauseMap.put(HANDOFF_PREFERENCE_CHANGED, "HANDOFF_PREFERENCE_CHANGED");
+ sFailCauseMap.put(IWLAN_PDN_CONNECTION_REJECTION, "IWLAN_PDN_CONNECTION_REJECTION");
+ sFailCauseMap.put(IWLAN_MAX_CONNECTION_REACHED, "IWLAN_MAX_CONNECTION_REACHED");
+ sFailCauseMap.put(IWLAN_SEMANTIC_ERROR_IN_THE_TFT_OPERATION,
+ "IWLAN_SEMANTIC_ERROR_IN_THE_TFT_OPERATION");
+ sFailCauseMap.put(IWLAN_SYNTACTICAL_ERROR_IN_THE_TFT_OPERATION,
+ "IWLAN_SYNTACTICAL_ERROR_IN_THE_TFT_OPERATION");
+ sFailCauseMap.put(IWLAN_SEMANTIC_ERRORS_IN_PACKET_FILTERS,
+ "IWLAN_SEMANTIC_ERRORS_IN_PACKET_FILTERS");
+ sFailCauseMap.put(IWLAN_SYNTACTICAL_ERRORS_IN_PACKET_FILTERS,
+ "IWLAN_SYNTACTICAL_ERRORS_IN_PACKET_FILTERS");
+ sFailCauseMap.put(IWLAN_NON_3GPP_ACCESS_TO_EPC_NOT_ALLOWED,
+ "IWLAN_NON_3GPP_ACCESS_TO_EPC_NOT_ALLOWED");
+ sFailCauseMap.put(IWLAN_USER_UNKNOWN, "IWLAN_USER_UNKNOWN");
+ sFailCauseMap.put(IWLAN_NO_APN_SUBSCRIPTION, "IWLAN_NO_APN_SUBSCRIPTION");
+ sFailCauseMap.put(IWLAN_AUTHORIZATION_REJECTED, "IWLAN_AUTHORIZATION_REJECTED");
+ sFailCauseMap.put(IWLAN_ILLEGAL_ME, "IWLAN_ILLEGAL_ME");
+ sFailCauseMap.put(IWLAN_NETWORK_FAILURE, "IWLAN_NETWORK_FAILURE");
+ sFailCauseMap.put(IWLAN_RAT_TYPE_NOT_ALLOWED, "IWLAN_RAT_TYPE_NOT_ALLOWED");
+ sFailCauseMap.put(IWLAN_IMEI_NOT_ACCEPTED, "IWLAN_IMEI_NOT_ACCEPTED");
+ sFailCauseMap.put(IWLAN_PLMN_NOT_ALLOWED, "IWLAN_PLMN_NOT_ALLOWED");
+ sFailCauseMap.put(IWLAN_UNAUTHENTICATED_EMERGENCY_NOT_SUPPORTED,
+ "IWLAN_UNAUTHENTICATED_EMERGENCY_NOT_SUPPORTED");
+ sFailCauseMap.put(IWLAN_IKEV2_CONFIG_FAILURE, "IWLAN_IKEV2_CONFIG_FAILURE");
+ sFailCauseMap.put(IWLAN_IKEV2_AUTH_FAILURE, "IWLAN_IKEV2_AUTH_FAILURE");
+ sFailCauseMap.put(IWLAN_IKEV2_MSG_TIMEOUT, "IWLAN_IKEV2_MSG_TIMEOUT");
+ sFailCauseMap.put(IWLAN_IKEV2_CERT_INVALID, "IWLAN_IKEV2_CERT_INVALID");
+ sFailCauseMap.put(IWLAN_DNS_RESOLUTION_NAME_FAILURE, "IWLAN_DNS_RESOLUTION_NAME_FAILURE");
+ sFailCauseMap.put(IWLAN_DNS_RESOLUTION_TIMEOUT, "IWLAN_DNS_RESOLUTION_TIMEOUT");
sFailCauseMap.put(OEM_DCFAILCAUSE_1, "OEM_DCFAILCAUSE_1");
sFailCauseMap.put(OEM_DCFAILCAUSE_2, "OEM_DCFAILCAUSE_2");
sFailCauseMap.put(OEM_DCFAILCAUSE_3, "OEM_DCFAILCAUSE_3");
diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java
index b48df717e56c..df0b9ac66ea0 100644
--- a/telephony/java/android/telephony/TelephonyManager.java
+++ b/telephony/java/android/telephony/TelephonyManager.java
@@ -23,6 +23,7 @@ import static android.provider.Telephony.Carriers.INVALID_APN_ID;
import static com.android.internal.util.Preconditions.checkNotNull;
import android.Manifest;
+import android.annotation.BytesLong;
import android.annotation.CallbackExecutor;
import android.annotation.IntDef;
import android.annotation.LongDef;
@@ -126,7 +127,6 @@ import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Objects;
-import java.util.Set;
import java.util.UUID;
import java.util.concurrent.Executor;
import java.util.function.Consumer;
@@ -551,6 +551,21 @@ public class TelephonyManager {
return getPhoneCount() > 1;
}
+ private static final int MAXIMUM_CALL_COMPOSER_PICTURE_SIZE = 80000;
+
+ // TODO(hallliu): link to upload method in docs
+ /**
+ * Indicates the maximum size of the call composure picture.
+ *
+ * Pictures sent via uploadCallComposerPicture must not exceed this size, or an
+ * {@link IllegalArgumentException} will be thrown.
+ *
+ * @return Maximum file size in bytes.
+ */
+ public static @BytesLong long getMaximumCallComposerPictureSize() {
+ return MAXIMUM_CALL_COMPOSER_PICTURE_SIZE;
+ }
+
//
// Broadcast Intent actions
//
diff --git a/telephony/java/android/telephony/data/ApnThrottleStatus.java b/telephony/java/android/telephony/data/ApnThrottleStatus.java
index 51461d17690a..eec140869466 100644
--- a/telephony/java/android/telephony/data/ApnThrottleStatus.java
+++ b/telephony/java/android/telephony/data/ApnThrottleStatus.java
@@ -261,6 +261,10 @@ public final class ApnThrottleStatus implements Parcelable {
private long mThrottleExpiryTimeMillis;
private @RetryType int mRetryType;
private @ThrottleType int mThrottleType;
+
+ /**
+ * @hide
+ */
public static final long NO_THROTTLE_EXPIRY_TIME =
DataCallResponse.RETRY_DURATION_UNDEFINED;
diff --git a/telephony/java/android/telephony/data/DataCallResponse.java b/telephony/java/android/telephony/data/DataCallResponse.java
index 090c970c2b53..556f2d5bdbef 100644
--- a/telephony/java/android/telephony/data/DataCallResponse.java
+++ b/telephony/java/android/telephony/data/DataCallResponse.java
@@ -253,7 +253,9 @@ public final class DataCallResponse implements Parcelable {
public int getCause() { return mCause; }
/**
- * @return The suggested data retry time in milliseconds.
+ * @return The suggested data retry time in milliseconds. 0 when network does not
+ * suggest a retry time (Note this is different from the replacement
+ * {@link #getRetryDurationMillis()}).
*
* @deprecated Use {@link #getRetryDurationMillis()} instead.
*/
diff --git a/telephony/java/android/telephony/ims/DelegateRegistrationState.java b/telephony/java/android/telephony/ims/DelegateRegistrationState.java
index 3558a9b79ce0..66281edc0de1 100644
--- a/telephony/java/android/telephony/ims/DelegateRegistrationState.java
+++ b/telephony/java/android/telephony/ims/DelegateRegistrationState.java
@@ -62,7 +62,8 @@ public final class DelegateRegistrationState implements Parcelable {
/**
* This feature tag is being deregistered because the PDN that the IMS registration is on is
*changing.
- * All open SIP dialogs need to be closed before the PDN change can proceed.
+ * All open SIP dialogs need to be closed before the PDN change can proceed using
+ * {@link SipDelegateConnection#closeDialog(String)}.
*/
public static final int DEREGISTERING_REASON_PDN_CHANGE = 3;
@@ -73,7 +74,8 @@ public final class DelegateRegistrationState implements Parcelable {
* a user triggered hange, such as data being enabled/disabled.
* <p>
* All open SIP dialogs associated with the new deprovisioned feature tag need to be closed
- * before the IMS registration modification can proceed.
+ * using {@link SipDelegateConnection#closeDialog(String)} before the IMS registration
+ * modification can proceed.
*/
public static final int DEREGISTERING_REASON_PROVISIONING_CHANGE = 4;
@@ -81,8 +83,8 @@ public final class DelegateRegistrationState implements Parcelable {
* This feature tag is deregistering because the SipDelegate associated with this feature tag
* needs to change its supported feature set.
* <p>
- * All open SIP Dialogs associated with this feature tag must be closed before this operation
- * can proceed.
+ * All open SIP Dialogs associated with this feature tag must be closed
+ * using {@link SipDelegateConnection#closeDialog(String)} before this operation can proceed.
*/
public static final int DEREGISTERING_REASON_FEATURE_TAGS_CHANGING = 5;
@@ -90,8 +92,8 @@ public final class DelegateRegistrationState implements Parcelable {
* This feature tag is deregistering because the SipDelegate is in the process of being
* destroyed.
* <p>
- * All open SIP Dialogs associated with this feature tag must be closed before this operation
- * can proceed.
+ * All open SIP Dialogs associated with this feature tag must be closed
+ * using {@link SipDelegateConnection#closeDialog(String)} before this operation can proceed.
*/
public static final int DEREGISTERING_REASON_DESTROY_PENDING = 6;
diff --git a/telephony/java/android/telephony/ims/SipDelegateConnection.java b/telephony/java/android/telephony/ims/SipDelegateConnection.java
index c3cc1edf590b..04a772cd873d 100644
--- a/telephony/java/android/telephony/ims/SipDelegateConnection.java
+++ b/telephony/java/android/telephony/ims/SipDelegateConnection.java
@@ -62,6 +62,22 @@ public interface SipDelegateConnection {
void notifyMessageReceived(@NonNull String viaTransactionId);
/**
+ * The SIP Dialog associated with the provided Call-ID is being closed and routing resources
+ * associated with the SIP dialog are free to be released.
+ * <p>
+ * Calling this method is also mandatory for situations where the framework IMS stack is waiting
+ * for pending SIP dialogs to be closed before it can perform a handover or apply a provisioning
+ * change. See {@link DelegateRegistrationState} for more information about
+ * the scenarios where this can occur.
+ * <p>
+ * This method will need to be called for each SIP dialog managed by this application when it is
+ * closed.
+ * @param callId The call-ID header value associated with the ongoing SIP Dialog that is
+ * closing.
+ */
+ void closeDialog(@NonNull String callId);
+
+ /**
* Notify the SIP delegate that the SIP message has been received from
* {@link DelegateMessageCallback#onMessageReceived(SipMessage)}, however there was an error
* processing it.
diff --git a/telephony/java/android/telephony/ims/aidl/ISipDelegate.aidl b/telephony/java/android/telephony/ims/aidl/ISipDelegate.aidl
index 5d6766a65155..ad75be439da8 100644
--- a/telephony/java/android/telephony/ims/aidl/ISipDelegate.aidl
+++ b/telephony/java/android/telephony/ims/aidl/ISipDelegate.aidl
@@ -26,7 +26,5 @@ oneway interface ISipDelegate {
void sendMessage(in SipMessage sipMessage, long configVersion);
void notifyMessageReceived(in String viaTransactionId);
void notifyMessageReceiveError(in String viaTransactionId, int reason);
-
- // only used by SipDelegate.
void closeDialog(in String callId);
}
diff --git a/telephony/java/android/telephony/ims/aidl/SipDelegateConnectionAidlWrapper.java b/telephony/java/android/telephony/ims/aidl/SipDelegateConnectionAidlWrapper.java
index 29ba8e2d50c4..a35039bd7668 100644
--- a/telephony/java/android/telephony/ims/aidl/SipDelegateConnectionAidlWrapper.java
+++ b/telephony/java/android/telephony/ims/aidl/SipDelegateConnectionAidlWrapper.java
@@ -199,6 +199,19 @@ public class SipDelegateConnectionAidlWrapper implements SipDelegateConnection,
}
}
+ @Override
+ public void closeDialog(String callId) {
+ try {
+ ISipDelegate conn = getSipDelegateBinder();
+ if (conn == null) {
+ return;
+ }
+ conn.closeDialog(callId);
+ } catch (RemoteException e) {
+ // Nothing to do here, app will eventually get remote death callback.
+ }
+ }
+
// Also called upon IImsRcsController death (telephony process dies).
@Override
public void binderDied() {
diff --git a/telephony/java/android/telephony/ims/stub/SipDelegate.java b/telephony/java/android/telephony/ims/stub/SipDelegate.java
index d7e7b62dd550..b036b5e71125 100644
--- a/telephony/java/android/telephony/ims/stub/SipDelegate.java
+++ b/telephony/java/android/telephony/ims/stub/SipDelegate.java
@@ -19,7 +19,9 @@ package android.telephony.ims.stub;
import android.annotation.NonNull;
import android.annotation.SystemApi;
import android.telephony.ims.DelegateMessageCallback;
+import android.telephony.ims.DelegateRegistrationState;
import android.telephony.ims.ImsService;
+import android.telephony.ims.SipDelegateConnection;
import android.telephony.ims.SipDelegateImsConfiguration;
import android.telephony.ims.SipDelegateManager;
import android.telephony.ims.SipMessage;
@@ -65,10 +67,13 @@ public interface SipDelegate {
* The framework is requesting that routing resources associated with the SIP dialog using the
* provided Call-ID to be cleaned up.
* <p>
- * Typically a SIP Dialog close event will be signalled by that dialog receiving a BYE or 200 OK
- * message, however, in some cases, the framework will request that the ImsService close the
+ * Typically, a SIP Dialog close event will be signalled by that dialog receiving a BYE or
+ * 200 OK message, however, the IMS application will still call
+ * {@link SipDelegateConnection#closeDialog(String)} to signal to the framework that resources
+ * can be released. In some cases, the framework will request that the ImsService close the
* dialog due to the open dialog holding up an event such as applying a provisioning change or
- * handing over to another transport type.
+ * handing over to another transport type. See {@link DelegateRegistrationState}.
+ *
* @param callId The call-ID header value associated with the ongoing SIP Dialog that the
* framework is requesting be closed.
*/
diff --git a/tests/FlickerTests/OWNERS b/tests/FlickerTests/OWNERS
index 0862c05e0ee4..f35a318acbf7 100644
--- a/tests/FlickerTests/OWNERS
+++ b/tests/FlickerTests/OWNERS
@@ -1 +1,2 @@
include /services/core/java/com/android/server/wm/OWNERS
+natanieljr@google.com \ No newline at end of file
diff --git a/tests/FlickerTests/src/com/android/server/wm/flicker/CommonAssertions.kt b/tests/FlickerTests/src/com/android/server/wm/flicker/CommonAssertions.kt
index bb03237ca4c6..bd7e8d7683d1 100644
--- a/tests/FlickerTests/src/com/android/server/wm/flicker/CommonAssertions.kt
+++ b/tests/FlickerTests/src/com/android/server/wm/flicker/CommonAssertions.kt
@@ -48,11 +48,12 @@ fun WmAssertion.navBarWindowIsAlwaysVisible(
}
fun WmAssertion.visibleWindowsShownMoreThanOneConsecutiveEntry(
+ ignoreWindows: List<String> = emptyList(),
bugId: Int = 0,
enabled: Boolean = bugId == 0
) {
- all("visibleWindowShownMoreThanOneConsecutiveEntry", bugId, enabled) {
- this.visibleWindowsShownMoreThanOneConsecutiveEntry()
+ all("visibleWindowsShownMoreThanOneConsecutiveEntry", bugId, enabled) {
+ this.visibleWindowsShownMoreThanOneConsecutiveEntry(ignoreWindows)
}
}
@@ -204,11 +205,12 @@ fun LayersAssertion.statusBarLayerRotatesScales(
}
fun LayersAssertion.visibleLayersShownMoreThanOneConsecutiveEntry(
+ ignoreLayers: List<String> = emptyList(),
bugId: Int = 0,
enabled: Boolean = bugId == 0
) {
all("visibleLayersShownMoreThanOneConsecutiveEntry", bugId, enabled) {
- this.visibleLayersShownMoreThanOneConsecutiveEntry()
+ this.visibleLayersShownMoreThanOneConsecutiveEntry(ignoreLayers)
}
}
diff --git a/tests/FlickerTests/src/com/android/server/wm/flicker/helpers/ImeAppHelper.kt b/tests/FlickerTests/src/com/android/server/wm/flicker/helpers/ImeAppHelper.kt
index f4de36e99952..3565ca40474e 100644
--- a/tests/FlickerTests/src/com/android/server/wm/flicker/helpers/ImeAppHelper.kt
+++ b/tests/FlickerTests/src/com/android/server/wm/flicker/helpers/ImeAppHelper.kt
@@ -22,6 +22,7 @@ import android.support.test.launcherhelper.LauncherStrategyFactory
import androidx.test.uiautomator.By
import androidx.test.uiautomator.UiDevice
import androidx.test.uiautomator.Until
+import com.android.server.wm.traces.parser.windowmanager.WindowManagerStateHelper
import org.junit.Assert
open class ImeAppHelper(
@@ -38,7 +39,7 @@ open class ImeAppHelper(
Assert.assertNotNull("Text field not found, this usually happens when the device " +
"was left in an unknown state (e.g. in split screen)", editText)
editText.click()
- if (!device.waitForIME()) {
+ if (!WindowManagerStateHelper().waitImeWindowShown()) {
Assert.fail("IME did not appear")
}
}
@@ -46,6 +47,8 @@ open class ImeAppHelper(
open fun closeIME(device: UiDevice) {
device.pressBack()
// Using only the AccessibilityInfo it is not possible to identify if the IME is active
- device.waitForIdle(1000)
+ if (!WindowManagerStateHelper().waitImeWindowGone()) {
+ Assert.fail("IME did not close")
+ }
}
} \ No newline at end of file
diff --git a/tests/FlickerTests/src/com/android/server/wm/flicker/ime/CloseImeAutoOpenWindowToAppTest.kt b/tests/FlickerTests/src/com/android/server/wm/flicker/ime/CloseImeAutoOpenWindowToAppTest.kt
index a73264d304f8..b341e621d9ed 100644
--- a/tests/FlickerTests/src/com/android/server/wm/flicker/ime/CloseImeAutoOpenWindowToAppTest.kt
+++ b/tests/FlickerTests/src/com/android/server/wm/flicker/ime/CloseImeAutoOpenWindowToAppTest.kt
@@ -27,6 +27,8 @@ import com.android.server.wm.flicker.helpers.ImeAppAutoFocusHelper
import com.android.server.wm.flicker.helpers.buildTestTag
import com.android.server.wm.flicker.helpers.setRotation
import com.android.server.wm.flicker.helpers.wakeUpAndGoToHomeScreen
+import com.android.server.wm.flicker.visibleWindowsShownMoreThanOneConsecutiveEntry
+import com.android.server.wm.flicker.visibleLayersShownMoreThanOneConsecutiveEntry
import com.android.server.wm.flicker.navBarLayerIsAlwaysVisible
import com.android.server.wm.flicker.navBarLayerRotatesAndScales
import com.android.server.wm.flicker.navBarWindowIsAlwaysVisible
@@ -66,8 +68,10 @@ class CloseImeAutoOpenWindowToAppTest(
withTag { buildTestTag("imeToAppAutoOpen", testApp, configuration) }
repeat { configuration.repetitions }
setup {
- eachRun {
+ test {
device.wakeUpAndGoToHomeScreen()
+ }
+ eachRun {
this.setRotation(configuration.startRotation)
testApp.open()
testApp.openIME(device)
@@ -80,14 +84,15 @@ class CloseImeAutoOpenWindowToAppTest(
}
}
transitions {
- device.pressBack()
- device.waitForIdle()
+ testApp.closeIME(device)
}
assertions {
windowManagerTrace {
navBarWindowIsAlwaysVisible()
statusBarWindowIsAlwaysVisible()
- imeAppWindowIsAlwaysVisible(testApp, bugId = 141458352)
+ visibleWindowsShownMoreThanOneConsecutiveEntry(listOf("InputMethod"))
+
+ imeAppWindowIsAlwaysVisible(testApp)
}
layersTrace {
@@ -96,8 +101,10 @@ class CloseImeAutoOpenWindowToAppTest(
noUncoveredRegions(configuration.startRotation)
navBarLayerRotatesAndScales(configuration.startRotation)
statusBarLayerRotatesScales(configuration.startRotation)
+ visibleLayersShownMoreThanOneConsecutiveEntry()
+
imeLayerBecomesInvisible(bugId = 141458352)
- imeAppLayerIsAlwaysVisible(testApp, bugId = 141458352)
+ imeAppLayerIsAlwaysVisible(testApp)
}
}
}
diff --git a/tests/FlickerTests/src/com/android/server/wm/flicker/ime/CloseImeAutoOpenWindowToHomeTest.kt b/tests/FlickerTests/src/com/android/server/wm/flicker/ime/CloseImeAutoOpenWindowToHomeTest.kt
index 6cc2e2236127..51a4ca86681b 100644
--- a/tests/FlickerTests/src/com/android/server/wm/flicker/ime/CloseImeAutoOpenWindowToHomeTest.kt
+++ b/tests/FlickerTests/src/com/android/server/wm/flicker/ime/CloseImeAutoOpenWindowToHomeTest.kt
@@ -27,6 +27,8 @@ import com.android.server.wm.flicker.helpers.ImeAppAutoFocusHelper
import com.android.server.wm.flicker.helpers.buildTestTag
import com.android.server.wm.flicker.helpers.setRotation
import com.android.server.wm.flicker.helpers.wakeUpAndGoToHomeScreen
+import com.android.server.wm.flicker.visibleWindowsShownMoreThanOneConsecutiveEntry
+import com.android.server.wm.flicker.visibleLayersShownMoreThanOneConsecutiveEntry
import com.android.server.wm.flicker.navBarLayerIsAlwaysVisible
import com.android.server.wm.flicker.navBarLayerRotatesAndScales
import com.android.server.wm.flicker.navBarWindowIsAlwaysVisible
@@ -68,8 +70,10 @@ class CloseImeAutoOpenWindowToHomeTest(
}
repeat { configuration.repetitions }
setup {
- eachRun {
+ test {
device.wakeUpAndGoToHomeScreen()
+ }
+ eachRun {
this.setRotation(configuration.startRotation)
testApp.open()
testApp.openIME(device)
@@ -89,6 +93,8 @@ class CloseImeAutoOpenWindowToHomeTest(
windowManagerTrace {
navBarWindowIsAlwaysVisible()
statusBarWindowIsAlwaysVisible()
+ visibleWindowsShownMoreThanOneConsecutiveEntry(listOf(IME_WINDOW_TITLE))
+
imeWindowBecomesInvisible(bugId = 141458352)
imeAppWindowBecomesInvisible(testApp, bugId = 157449248)
}
@@ -100,10 +106,14 @@ class CloseImeAutoOpenWindowToHomeTest(
Surface.ROTATION_0, bugId = 140855415)
statusBarLayerRotatesScales(configuration.startRotation,
Surface.ROTATION_0)
- navBarLayerIsAlwaysVisible(enabled = false)
- statusBarLayerIsAlwaysVisible(enabled = false)
+ navBarLayerIsAlwaysVisible(
+ enabled = Surface.ROTATION_0 == configuration.startRotation)
+ statusBarLayerIsAlwaysVisible(
+ enabled = Surface.ROTATION_0 == configuration.startRotation)
+ visibleLayersShownMoreThanOneConsecutiveEntry(listOf(IME_WINDOW_TITLE))
+
imeLayerBecomesInvisible(bugId = 141458352)
- imeAppLayerBecomesInvisible(testApp, bugId = 153739621)
+ imeAppLayerBecomesInvisible(testApp)
}
}
}
diff --git a/tests/FlickerTests/src/com/android/server/wm/flicker/ime/CloseImeWindowToAppTest.kt b/tests/FlickerTests/src/com/android/server/wm/flicker/ime/CloseImeWindowToAppTest.kt
index 136cf86037a1..663d45607f93 100644
--- a/tests/FlickerTests/src/com/android/server/wm/flicker/ime/CloseImeWindowToAppTest.kt
+++ b/tests/FlickerTests/src/com/android/server/wm/flicker/ime/CloseImeWindowToAppTest.kt
@@ -31,6 +31,8 @@ import com.android.server.wm.flicker.navBarLayerIsAlwaysVisible
import com.android.server.wm.flicker.navBarLayerRotatesAndScales
import com.android.server.wm.flicker.navBarWindowIsAlwaysVisible
import com.android.server.wm.flicker.noUncoveredRegions
+import com.android.server.wm.flicker.visibleWindowsShownMoreThanOneConsecutiveEntry
+import com.android.server.wm.flicker.visibleLayersShownMoreThanOneConsecutiveEntry
import com.android.server.wm.flicker.repetitions
import com.android.server.wm.flicker.startRotation
import com.android.server.wm.flicker.statusBarLayerIsAlwaysVisible
@@ -65,8 +67,10 @@ class CloseImeWindowToAppTest(
withTestName { buildTestTag("imeToApp", testApp, configuration) }
repeat { configuration.repetitions }
setup {
- eachRun {
+ test {
device.wakeUpAndGoToHomeScreen()
+ }
+ eachRun {
this.setRotation(configuration.startRotation)
testApp.open()
testApp.openIME(device)
@@ -79,13 +83,14 @@ class CloseImeWindowToAppTest(
}
}
transitions {
- device.pressBack()
- device.waitForIdle()
+ testApp.closeIME(device)
}
assertions {
windowManagerTrace {
navBarWindowIsAlwaysVisible()
statusBarWindowIsAlwaysVisible()
+ visibleWindowsShownMoreThanOneConsecutiveEntry(listOf("InputMethod"))
+
imeAppWindowIsAlwaysVisible(testApp)
}
@@ -95,6 +100,8 @@ class CloseImeWindowToAppTest(
noUncoveredRegions(configuration.startRotation)
navBarLayerRotatesAndScales(configuration.startRotation)
statusBarLayerRotatesScales(configuration.startRotation)
+ visibleLayersShownMoreThanOneConsecutiveEntry()
+
imeLayerBecomesInvisible(enabled = false)
imeAppLayerIsAlwaysVisible(testApp)
}
diff --git a/tests/FlickerTests/src/com/android/server/wm/flicker/ime/CloseImeWindowToHomeTest.kt b/tests/FlickerTests/src/com/android/server/wm/flicker/ime/CloseImeWindowToHomeTest.kt
index 8d9881ec2063..bfe5264ed358 100644
--- a/tests/FlickerTests/src/com/android/server/wm/flicker/ime/CloseImeWindowToHomeTest.kt
+++ b/tests/FlickerTests/src/com/android/server/wm/flicker/ime/CloseImeWindowToHomeTest.kt
@@ -33,6 +33,8 @@ import com.android.server.wm.flicker.navBarLayerIsAlwaysVisible
import com.android.server.wm.flicker.navBarLayerRotatesAndScales
import com.android.server.wm.flicker.navBarWindowIsAlwaysVisible
import com.android.server.wm.flicker.noUncoveredRegions
+import com.android.server.wm.flicker.visibleWindowsShownMoreThanOneConsecutiveEntry
+import com.android.server.wm.flicker.visibleLayersShownMoreThanOneConsecutiveEntry
import com.android.server.wm.flicker.repetitions
import com.android.server.wm.flicker.startRotation
import com.android.server.wm.flicker.statusBarLayerIsAlwaysVisible
@@ -95,6 +97,8 @@ class CloseImeWindowToHomeTest(
windowManagerTrace {
navBarWindowIsAlwaysVisible()
statusBarWindowIsAlwaysVisible()
+ visibleWindowsShownMoreThanOneConsecutiveEntry(listOf(IME_WINDOW_TITLE))
+
imeWindowBecomesInvisible()
imeAppWindowBecomesInvisible(testApp)
}
@@ -106,10 +110,14 @@ class CloseImeWindowToHomeTest(
Surface.ROTATION_0, bugId = 140855415)
statusBarLayerRotatesScales(configuration.startRotation,
Surface.ROTATION_0)
- navBarLayerIsAlwaysVisible(enabled = false)
- statusBarLayerIsAlwaysVisible(enabled = false)
+ navBarLayerIsAlwaysVisible(
+ enabled = Surface.ROTATION_0 == configuration.startRotation)
+ statusBarLayerIsAlwaysVisible(
+ enabled = Surface.ROTATION_0 == configuration.startRotation)
+ visibleLayersShownMoreThanOneConsecutiveEntry(listOf(IME_WINDOW_TITLE))
+
imeLayerBecomesInvisible(bugId = 153739621)
- imeAppLayerBecomesInvisible(testApp, bugId = 153739621)
+ imeAppLayerBecomesInvisible(testApp)
}
}
}
diff --git a/tests/FlickerTests/src/com/android/server/wm/flicker/ime/OpenImeWindowTest.kt b/tests/FlickerTests/src/com/android/server/wm/flicker/ime/OpenImeWindowTest.kt
index 5767a94025e9..64a8f304298b 100644
--- a/tests/FlickerTests/src/com/android/server/wm/flicker/ime/OpenImeWindowTest.kt
+++ b/tests/FlickerTests/src/com/android/server/wm/flicker/ime/OpenImeWindowTest.kt
@@ -30,6 +30,8 @@ import com.android.server.wm.flicker.helpers.wakeUpAndGoToHomeScreen
import com.android.server.wm.flicker.navBarLayerIsAlwaysVisible
import com.android.server.wm.flicker.navBarLayerRotatesAndScales
import com.android.server.wm.flicker.navBarWindowIsAlwaysVisible
+import com.android.server.wm.flicker.visibleWindowsShownMoreThanOneConsecutiveEntry
+import com.android.server.wm.flicker.visibleLayersShownMoreThanOneConsecutiveEntry
import com.android.server.wm.flicker.noUncoveredRegions
import com.android.server.wm.flicker.repetitions
import com.android.server.wm.flicker.startRotation
@@ -89,6 +91,7 @@ class OpenImeWindowTest(
windowManagerTrace {
navBarWindowIsAlwaysVisible()
statusBarWindowIsAlwaysVisible()
+ visibleWindowsShownMoreThanOneConsecutiveEntry()
all("imeWindowBecomesVisible") {
this.skipUntilFirstAssertion()
@@ -104,6 +107,7 @@ class OpenImeWindowTest(
noUncoveredRegions(configuration.startRotation)
navBarLayerRotatesAndScales(configuration.startRotation)
statusBarLayerRotatesScales(configuration.startRotation)
+ visibleLayersShownMoreThanOneConsecutiveEntry()
imeLayerBecomesVisible()
}
diff --git a/tests/net/integration/util/com/android/server/NetworkAgentWrapper.java b/tests/net/integration/util/com/android/server/NetworkAgentWrapper.java
index 2a24d1ac22d2..3d4dc4d67dcc 100644
--- a/tests/net/integration/util/com/android/server/NetworkAgentWrapper.java
+++ b/tests/net/integration/util/com/android/server/NetworkAgentWrapper.java
@@ -29,7 +29,7 @@ import static com.android.server.ConnectivityServiceTestUtils.transportToLegacyT
import static junit.framework.Assert.assertTrue;
import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotEquals;
+import static org.junit.Assert.fail;
import android.content.Context;
import android.net.ConnectivityManager;
@@ -38,7 +38,6 @@ import android.net.Network;
import android.net.NetworkAgent;
import android.net.NetworkAgentConfig;
import android.net.NetworkCapabilities;
-import android.net.NetworkInfo;
import android.net.NetworkProvider;
import android.net.NetworkSpecifier;
import android.net.SocketKeepalive;
@@ -53,9 +52,9 @@ import com.android.testutils.HandlerUtils;
import com.android.testutils.TestableNetworkCallback;
import java.util.Set;
+import java.util.concurrent.atomic.AtomicBoolean;
public class NetworkAgentWrapper implements TestableNetworkCallback.HasNetwork {
- private final NetworkInfo mNetworkInfo;
private final NetworkCapabilities mNetworkCapabilities;
private final HandlerThread mHandlerThread;
private final Context mContext;
@@ -63,6 +62,7 @@ public class NetworkAgentWrapper implements TestableNetworkCallback.HasNetwork {
private final ConditionVariable mDisconnected = new ConditionVariable();
private final ConditionVariable mPreventReconnectReceived = new ConditionVariable();
+ private final AtomicBoolean mConnected = new AtomicBoolean(false);
private int mScore;
private NetworkAgent mNetworkAgent;
private int mStartKeepaliveError = SocketKeepalive.ERROR_UNSUPPORTED;
@@ -76,7 +76,6 @@ public class NetworkAgentWrapper implements TestableNetworkCallback.HasNetwork {
NetworkCapabilities ncTemplate, Context context) throws Exception {
final int type = transportToLegacyType(transport);
final String typeName = ConnectivityManager.getNetworkTypeName(type);
- mNetworkInfo = new NetworkInfo(type, 0, typeName, "Mock");
mNetworkCapabilities = (ncTemplate != null) ? ncTemplate : new NetworkCapabilities();
mNetworkCapabilities.addCapability(NET_CAPABILITY_NOT_SUSPENDED);
mNetworkCapabilities.addTransportType(transport);
@@ -108,22 +107,29 @@ public class NetworkAgentWrapper implements TestableNetworkCallback.HasNetwork {
mHandlerThread = new HandlerThread(mLogTag);
mHandlerThread.start();
- mNetworkAgent = makeNetworkAgent(linkProperties);
+ mNetworkAgent = makeNetworkAgent(linkProperties, type, typeName);
}
- protected InstrumentedNetworkAgent makeNetworkAgent(LinkProperties linkProperties)
+ protected InstrumentedNetworkAgent makeNetworkAgent(LinkProperties linkProperties,
+ final int type, final String typeName)
throws Exception {
- return new InstrumentedNetworkAgent(this, linkProperties);
+ return new InstrumentedNetworkAgent(this, linkProperties, type, typeName);
}
public static class InstrumentedNetworkAgent extends NetworkAgent {
private final NetworkAgentWrapper mWrapper;
-
- public InstrumentedNetworkAgent(NetworkAgentWrapper wrapper, LinkProperties lp) {
- super(wrapper.mHandlerThread.getLooper(), wrapper.mContext, wrapper.mLogTag,
- wrapper.mNetworkInfo, wrapper.mNetworkCapabilities, lp, wrapper.mScore,
- new NetworkAgentConfig(), NetworkProvider.ID_NONE);
+ private static final String PROVIDER_NAME = "InstrumentedNetworkAgentProvider";
+
+ public InstrumentedNetworkAgent(NetworkAgentWrapper wrapper, LinkProperties lp,
+ final int type, final String typeName) {
+ super(wrapper.mContext, wrapper.mHandlerThread.getLooper(), wrapper.mLogTag,
+ wrapper.mNetworkCapabilities, lp, wrapper.mScore,
+ new NetworkAgentConfig.Builder()
+ .setLegacyType(type).setLegacyTypeName(typeName).build(),
+ new NetworkProvider(wrapper.mContext, wrapper.mHandlerThread.getLooper(),
+ PROVIDER_NAME));
mWrapper = wrapper;
+ register();
}
@Override
@@ -212,10 +218,12 @@ public class NetworkAgentWrapper implements TestableNetworkCallback.HasNetwork {
}
public void connect() {
- assertNotEquals("MockNetworkAgents can only be connected once",
- mNetworkInfo.getDetailedState(), NetworkInfo.DetailedState.CONNECTED);
- mNetworkInfo.setDetailedState(NetworkInfo.DetailedState.CONNECTED, null, null);
- mNetworkAgent.sendNetworkInfo(mNetworkInfo);
+ if (!mConnected.compareAndSet(false /* expect */, true /* update */)) {
+ // compareAndSet returns false when the value couldn't be updated because it did not
+ // match the expected value.
+ fail("Test NetworkAgents can only be connected once");
+ }
+ mNetworkAgent.markConnected();
}
public void suspend() {
@@ -227,8 +235,7 @@ public class NetworkAgentWrapper implements TestableNetworkCallback.HasNetwork {
}
public void disconnect() {
- mNetworkInfo.setDetailedState(NetworkInfo.DetailedState.DISCONNECTED, null, null);
- mNetworkAgent.sendNetworkInfo(mNetworkInfo);
+ mNetworkAgent.unregister();
}
@Override
diff --git a/tests/net/java/com/android/server/ConnectivityServiceTest.java b/tests/net/java/com/android/server/ConnectivityServiceTest.java
index 5bfcd5202cbf..b3bdd6055c62 100644
--- a/tests/net/java/com/android/server/ConnectivityServiceTest.java
+++ b/tests/net/java/com/android/server/ConnectivityServiceTest.java
@@ -18,6 +18,7 @@ package com.android.server;
import static android.Manifest.permission.CHANGE_NETWORK_STATE;
import static android.Manifest.permission.CONNECTIVITY_USE_RESTRICTED_NETWORKS;
+import static android.app.PendingIntent.FLAG_IMMUTABLE;
import static android.content.Intent.ACTION_USER_ADDED;
import static android.content.Intent.ACTION_USER_REMOVED;
import static android.content.pm.PackageInfo.REQUESTED_PERMISSION_GRANTED;
@@ -187,6 +188,7 @@ import android.net.RouteInfo;
import android.net.RouteInfoParcel;
import android.net.SocketKeepalive;
import android.net.UidRange;
+import android.net.UidRangeParcel;
import android.net.Uri;
import android.net.VpnManager;
import android.net.metrics.IpConnectivityLog;
@@ -645,8 +647,8 @@ public class ConnectivityServiceTest {
}
@Override
- protected InstrumentedNetworkAgent makeNetworkAgent(LinkProperties linkProperties)
- throws Exception {
+ protected InstrumentedNetworkAgent makeNetworkAgent(LinkProperties linkProperties,
+ final int type, final String typeName) throws Exception {
mNetworkMonitor = mock(INetworkMonitor.class);
final Answer validateAnswer = inv -> {
@@ -665,7 +667,8 @@ public class ConnectivityServiceTest {
any() /* name */,
nmCbCaptor.capture());
- final InstrumentedNetworkAgent na = new InstrumentedNetworkAgent(this, linkProperties) {
+ final InstrumentedNetworkAgent na = new InstrumentedNetworkAgent(this, linkProperties,
+ type, typeName) {
@Override
public void networkStatus(int status, String redirectUrl) {
mRedirectUrl = redirectUrl;
@@ -1053,7 +1056,7 @@ public class ConnectivityServiceTest {
public MockVpn(int userId) {
super(startHandlerThreadAndReturnLooper(), mServiceContext, mNetworkManagementService,
- userId, mock(KeyStore.class));
+ mMockNetd, userId, mock(KeyStore.class));
mConfig = new VpnConfig();
}
@@ -1092,10 +1095,11 @@ public class ConnectivityServiceTest {
mMockNetworkAgent = new TestNetworkAgentWrapper(TRANSPORT_VPN, lp,
mNetworkCapabilities);
mMockNetworkAgent.waitForIdle(TIMEOUT_MS);
- verify(mNetworkManagementService, times(1))
- .addVpnUidRanges(eq(mMockVpn.getNetId()), eq(uids.toArray(new UidRange[0])));
- verify(mNetworkManagementService, never())
- .removeVpnUidRanges(eq(mMockVpn.getNetId()), any());
+
+ verify(mMockNetd, times(1)).networkAddUidRanges(eq(mMockVpn.getNetId()),
+ eq(toUidRangeStableParcels(uids)));
+ verify(mMockNetd, never())
+ .networkRemoveUidRanges(eq(mMockVpn.getNetId()), any());
mAgentRegistered = true;
mNetworkCapabilities.set(mMockNetworkAgent.getNetworkCapabilities());
mNetworkAgent = mMockNetworkAgent.getNetworkAgent();
@@ -1167,6 +1171,11 @@ public class ConnectivityServiceTest {
}
}
+ private UidRangeParcel[] toUidRangeStableParcels(final @NonNull Set<UidRange> ranges) {
+ return ranges.stream().map(
+ r -> new UidRangeParcel(r.start, r.stop)).toArray(UidRangeParcel[]::new);
+ }
+
private void mockVpn(int uid) {
synchronized (mService.mVpns) {
int userId = UserHandle.getUserId(uid);
@@ -2547,7 +2556,8 @@ public class ConnectivityServiceTest {
@Test
public void testNoMutableNetworkRequests() throws Exception {
- PendingIntent pendingIntent = PendingIntent.getBroadcast(mContext, 0, new Intent("a"), 0);
+ final PendingIntent pendingIntent = PendingIntent.getBroadcast(
+ mContext, 0 /* requestCode */, new Intent("a"), FLAG_IMMUTABLE);
NetworkRequest request1 = new NetworkRequest.Builder()
.addCapability(NET_CAPABILITY_VALIDATED)
.build();
@@ -3209,7 +3219,7 @@ public class ConnectivityServiceTest {
assertThrows(SecurityException.class, () ->
mCm.registerNetworkCallback(r, PendingIntent.getService(
- mServiceContext, 0, new Intent(), 0)));
+ mServiceContext, 0 /* requestCode */, new Intent(), FLAG_IMMUTABLE)));
// Requesting a Network with signal strength should get IllegalArgumentException.
assertThrows(IllegalArgumentException.class, () ->
@@ -3217,7 +3227,7 @@ public class ConnectivityServiceTest {
assertThrows(IllegalArgumentException.class, () ->
mCm.requestNetwork(r, PendingIntent.getService(
- mServiceContext, 0, new Intent(), 0)));
+ mServiceContext, 0 /* requestCode */, new Intent(), FLAG_IMMUTABLE)));
}
@Test
@@ -4681,12 +4691,14 @@ public class ConnectivityServiceTest {
}
j = 0;
while (j++ < INTENTS / 2) {
- PendingIntent pi = PendingIntent.getBroadcast(mContext, 0, new Intent("a" + j), 0);
+ final PendingIntent pi = PendingIntent.getBroadcast(mContext, 0 /* requestCode */,
+ new Intent("a" + j), FLAG_IMMUTABLE);
mCm.requestNetwork(networkRequest, pi);
registered.add(pi);
}
while (j++ < INTENTS) {
- PendingIntent pi = PendingIntent.getBroadcast(mContext, 0, new Intent("b" + j), 0);
+ final PendingIntent pi = PendingIntent.getBroadcast(mContext, 0 /* requestCode */,
+ new Intent("b" + j), FLAG_IMMUTABLE);
mCm.registerNetworkCallback(networkRequest, pi);
registered.add(pi);
}
@@ -4700,11 +4712,13 @@ public class ConnectivityServiceTest {
);
assertThrows(TooManyRequestsException.class, () ->
mCm.requestNetwork(networkRequest,
- PendingIntent.getBroadcast(mContext, 0, new Intent("c"), 0))
+ PendingIntent.getBroadcast(mContext, 0 /* requestCode */,
+ new Intent("c"), FLAG_IMMUTABLE))
);
assertThrows(TooManyRequestsException.class, () ->
mCm.registerNetworkCallback(networkRequest,
- PendingIntent.getBroadcast(mContext, 0, new Intent("d"), 0))
+ PendingIntent.getBroadcast(mContext, 0 /* requestCode */,
+ new Intent("d"), FLAG_IMMUTABLE))
);
for (Object o : registered) {
@@ -4733,16 +4747,16 @@ public class ConnectivityServiceTest {
waitForIdle();
for (int i = 0; i < MAX_REQUESTS; i++) {
- PendingIntent pendingIntent =
- PendingIntent.getBroadcast(mContext, 0, new Intent("e" + i), 0);
+ final PendingIntent pendingIntent = PendingIntent.getBroadcast(
+ mContext, 0 /* requestCode */, new Intent("e" + i), FLAG_IMMUTABLE);
mCm.requestNetwork(networkRequest, pendingIntent);
mCm.unregisterNetworkCallback(pendingIntent);
}
waitForIdle();
for (int i = 0; i < MAX_REQUESTS; i++) {
- PendingIntent pendingIntent =
- PendingIntent.getBroadcast(mContext, 0, new Intent("f" + i), 0);
+ final PendingIntent pendingIntent = PendingIntent.getBroadcast(
+ mContext, 0 /* requestCode */, new Intent("f" + i), FLAG_IMMUTABLE);
mCm.registerNetworkCallback(networkRequest, pendingIntent);
mCm.unregisterNetworkCallback(pendingIntent);
}
@@ -4940,8 +4954,8 @@ public class ConnectivityServiceTest {
expectForceUpdateIfaces(onlyCell, MOBILE_IFNAME);
reset(mStatsService);
- // Captive portal change shouldn't update ifaces
- mCellNetworkAgent.addCapability(NetworkCapabilities.NET_CAPABILITY_CAPTIVE_PORTAL);
+ // Temp metered change shouldn't update ifaces
+ mCellNetworkAgent.addCapability(NetworkCapabilities.NET_CAPABILITY_TEMPORARILY_NOT_METERED);
waitForIdle();
verify(mStatsService, never())
.forceUpdateIfaces(eq(onlyCell), any(NetworkState[].class), eq(MOBILE_IFNAME),
@@ -5457,6 +5471,7 @@ public class ConnectivityServiceTest {
final Network wifi = mWiFiNetworkAgent.getNetwork();
final NetworkCapabilities initialCaps = new NetworkCapabilities();
+ initialCaps.addTransportType(TRANSPORT_VPN);
initialCaps.addCapability(NET_CAPABILITY_INTERNET);
initialCaps.removeCapability(NET_CAPABILITY_NOT_VPN);
@@ -5488,44 +5503,45 @@ public class ConnectivityServiceTest {
withWifiAndMobileUnderlying.setLinkDownstreamBandwidthKbps(10);
withWifiAndMobileUnderlying.setLinkUpstreamBandwidthKbps(20);
+ final NetworkCapabilities initialCapsNotMetered = new NetworkCapabilities(initialCaps);
+ initialCapsNotMetered.addCapability(NET_CAPABILITY_NOT_METERED);
+
NetworkCapabilities caps = new NetworkCapabilities(initialCaps);
- final boolean notDeclaredMetered = false;
- mService.applyUnderlyingCapabilities(new Network[]{}, caps, notDeclaredMetered);
+ mService.applyUnderlyingCapabilities(new Network[]{}, initialCapsNotMetered, caps);
assertEquals(withNoUnderlying, caps);
caps = new NetworkCapabilities(initialCaps);
- mService.applyUnderlyingCapabilities(new Network[]{null}, caps, notDeclaredMetered);
+ mService.applyUnderlyingCapabilities(new Network[]{null}, initialCapsNotMetered, caps);
assertEquals(withNoUnderlying, caps);
caps = new NetworkCapabilities(initialCaps);
- mService.applyUnderlyingCapabilities(new Network[]{mobile}, caps, notDeclaredMetered);
+ mService.applyUnderlyingCapabilities(new Network[]{mobile}, initialCapsNotMetered, caps);
assertEquals(withMobileUnderlying, caps);
- mService.applyUnderlyingCapabilities(new Network[]{wifi}, caps, notDeclaredMetered);
+ mService.applyUnderlyingCapabilities(new Network[]{wifi}, initialCapsNotMetered, caps);
assertEquals(withWifiUnderlying, caps);
- final boolean isDeclaredMetered = true;
withWifiUnderlying.removeCapability(NET_CAPABILITY_NOT_METERED);
caps = new NetworkCapabilities(initialCaps);
- mService.applyUnderlyingCapabilities(new Network[]{wifi}, caps, isDeclaredMetered);
+ mService.applyUnderlyingCapabilities(new Network[]{wifi}, initialCaps, caps);
assertEquals(withWifiUnderlying, caps);
caps = new NetworkCapabilities(initialCaps);
- mService.applyUnderlyingCapabilities(new Network[]{mobile, wifi}, caps, isDeclaredMetered);
+ mService.applyUnderlyingCapabilities(new Network[]{mobile, wifi}, initialCaps, caps);
assertEquals(withWifiAndMobileUnderlying, caps);
withWifiUnderlying.addCapability(NET_CAPABILITY_NOT_METERED);
caps = new NetworkCapabilities(initialCaps);
mService.applyUnderlyingCapabilities(new Network[]{null, mobile, null, wifi},
- caps, notDeclaredMetered);
+ initialCapsNotMetered, caps);
assertEquals(withWifiAndMobileUnderlying, caps);
caps = new NetworkCapabilities(initialCaps);
mService.applyUnderlyingCapabilities(new Network[]{null, mobile, null, wifi},
- caps, notDeclaredMetered);
+ initialCapsNotMetered, caps);
assertEquals(withWifiAndMobileUnderlying, caps);
- mService.applyUnderlyingCapabilities(null, caps, notDeclaredMetered);
+ mService.applyUnderlyingCapabilities(null, initialCapsNotMetered, caps);
assertEquals(withWifiUnderlying, caps);
}
diff --git a/tests/net/java/com/android/server/connectivity/MultipathPolicyTrackerTest.java b/tests/net/java/com/android/server/connectivity/MultipathPolicyTrackerTest.java
index c53462cfb0b2..950d7163c78a 100644
--- a/tests/net/java/com/android/server/connectivity/MultipathPolicyTrackerTest.java
+++ b/tests/net/java/com/android/server/connectivity/MultipathPolicyTrackerTest.java
@@ -130,6 +130,7 @@ public class MultipathPolicyTrackerTest {
when(mContext.getResources()).thenReturn(mResources);
when(mContext.getApplicationInfo()).thenReturn(new ApplicationInfo());
+ // Mock user id to all users that Context#registerReceiver will register with all users too.
doReturn(UserHandle.ALL.getIdentifier()).when(mUserAllContext).getUserId();
when(mContext.createContextAsUser(eq(UserHandle.ALL), anyInt()))
.thenReturn(mUserAllContext);
diff --git a/tests/net/java/com/android/server/connectivity/PermissionMonitorTest.java b/tests/net/java/com/android/server/connectivity/PermissionMonitorTest.java
index de35f910d53a..3556c72776dc 100644
--- a/tests/net/java/com/android/server/connectivity/PermissionMonitorTest.java
+++ b/tests/net/java/com/android/server/connectivity/PermissionMonitorTest.java
@@ -58,7 +58,6 @@ import android.content.pm.ApplicationInfo;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.PackageManagerInternal;
-import android.content.pm.UserInfo;
import android.net.INetd;
import android.net.UidRange;
import android.os.Build;
@@ -123,10 +122,10 @@ public class PermissionMonitorTest {
MockitoAnnotations.initMocks(this);
when(mContext.getPackageManager()).thenReturn(mPackageManager);
when(mContext.getSystemService(eq(Context.USER_SERVICE))).thenReturn(mUserManager);
- when(mUserManager.getAliveUsers()).thenReturn(
- Arrays.asList(new UserInfo[] {
- new UserInfo(MOCK_USER1, "", 0),
- new UserInfo(MOCK_USER2, "", 0),
+ when(mUserManager.getUserHandles(eq(true))).thenReturn(
+ Arrays.asList(new UserHandle[] {
+ new UserHandle(MOCK_USER1),
+ new UserHandle(MOCK_USER2),
}));
mPermissionMonitor = spy(new PermissionMonitor(mContext, mNetdService, mDeps));
diff --git a/tests/net/java/com/android/server/connectivity/VpnTest.java b/tests/net/java/com/android/server/connectivity/VpnTest.java
index 337507ac1d46..6e380be6c583 100644
--- a/tests/net/java/com/android/server/connectivity/VpnTest.java
+++ b/tests/net/java/com/android/server/connectivity/VpnTest.java
@@ -58,6 +58,7 @@ import android.content.pm.ServiceInfo;
import android.content.pm.UserInfo;
import android.content.res.Resources;
import android.net.ConnectivityManager;
+import android.net.INetd;
import android.net.Ikev2VpnProfile;
import android.net.InetAddresses;
import android.net.IpPrefix;
@@ -70,6 +71,7 @@ import android.net.NetworkCapabilities;
import android.net.NetworkInfo.DetailedState;
import android.net.RouteInfo;
import android.net.UidRange;
+import android.net.UidRangeParcel;
import android.net.VpnManager;
import android.net.VpnService;
import android.net.ipsec.ike.IkeSessionCallback;
@@ -172,11 +174,13 @@ public class VpnTest {
mPackages.put(PKGS[i], PKG_UIDS[i]);
}
}
+ private static final UidRange PRI_USER_RANGE = UidRange.createForUser(primaryUser.id);
@Mock(answer = Answers.RETURNS_DEEP_STUBS) private Context mContext;
@Mock private UserManager mUserManager;
@Mock private PackageManager mPackageManager;
@Mock private INetworkManagementService mNetService;
+ @Mock private INetd mNetd;
@Mock private AppOpsManager mAppOps;
@Mock private NotificationManager mNotificationManager;
@Mock private Vpn.SystemServices mSystemServices;
@@ -256,8 +260,7 @@ public class VpnTest {
null, null);
assertEquals(new ArraySet<>(Arrays.asList(new UidRange[] {
- UidRange.createForUser(primaryUser.id),
- UidRange.createForUser(restrictedProfileA.id)
+ PRI_USER_RANGE, UidRange.createForUser(restrictedProfileA.id)
})), ranges);
}
@@ -269,9 +272,7 @@ public class VpnTest {
final Set<UidRange> ranges = vpn.createUserAndRestrictedProfilesRanges(primaryUser.id,
null, null);
- assertEquals(new ArraySet<>(Arrays.asList(new UidRange[] {
- UidRange.createForUser(primaryUser.id)
- })), ranges);
+ assertEquals(new ArraySet<>(Arrays.asList(new UidRange[] { PRI_USER_RANGE })), ranges);
}
@Test
@@ -282,15 +283,13 @@ public class VpnTest {
final Set<UidRange> ranges = new ArraySet<>();
vpn.addUserToRanges(ranges, primaryUser.id, null, null);
- assertEquals(new ArraySet<>(Arrays.asList(new UidRange[] {
- UidRange.createForUser(primaryUser.id)
- })), ranges);
+ assertEquals(new ArraySet<>(Arrays.asList(new UidRange[] { PRI_USER_RANGE })), ranges);
}
@Test
public void testUidAllowAndDenylist() throws Exception {
final Vpn vpn = createVpn(primaryUser.id);
- final UidRange user = UidRange.createForUser(primaryUser.id);
+ final UidRange user = PRI_USER_RANGE;
final String[] packages = {PKGS[0], PKGS[1], PKGS[2]};
// Allowed list
@@ -339,62 +338,67 @@ public class VpnTest {
@Test
public void testLockdownChangingPackage() throws Exception {
final Vpn vpn = createVpn(primaryUser.id);
- final UidRange user = UidRange.createForUser(primaryUser.id);
+ final UidRange user = PRI_USER_RANGE;
// Default state.
- assertUnblocked(vpn, user.start + PKG_UIDS[0], user.start + PKG_UIDS[1], user.start + PKG_UIDS[2], user.start + PKG_UIDS[3]);
+ assertUnblocked(vpn, user.start + PKG_UIDS[0], user.start + PKG_UIDS[1],
+ user.start + PKG_UIDS[2], user.start + PKG_UIDS[3]);
// Set always-on without lockdown.
assertTrue(vpn.setAlwaysOnPackage(PKGS[1], false, null, mKeyStore));
- assertUnblocked(vpn, user.start + PKG_UIDS[0], user.start + PKG_UIDS[1], user.start + PKG_UIDS[2], user.start + PKG_UIDS[3]);
+ assertUnblocked(vpn, user.start + PKG_UIDS[0], user.start + PKG_UIDS[1],
+ user.start + PKG_UIDS[2], user.start + PKG_UIDS[3]);
// Set always-on with lockdown.
assertTrue(vpn.setAlwaysOnPackage(PKGS[1], true, null, mKeyStore));
- verify(mNetService).setAllowOnlyVpnForUids(eq(true), aryEq(new UidRange[] {
- new UidRange(user.start, user.start + PKG_UIDS[1] - 1),
- new UidRange(user.start + PKG_UIDS[1] + 1, user.stop)
+ verify(mNetd).networkRejectNonSecureVpn(eq(true), aryEq(new UidRangeParcel[] {
+ new UidRangeParcel(user.start, user.start + PKG_UIDS[1] - 1),
+ new UidRangeParcel(user.start + PKG_UIDS[1] + 1, user.stop)
}));
- assertBlocked(vpn, user.start + PKG_UIDS[0], user.start + PKG_UIDS[2], user.start + PKG_UIDS[3]);
+
+ assertBlocked(vpn, user.start + PKG_UIDS[0], user.start + PKG_UIDS[2],
+ user.start + PKG_UIDS[3]);
assertUnblocked(vpn, user.start + PKG_UIDS[1]);
// Switch to another app.
assertTrue(vpn.setAlwaysOnPackage(PKGS[3], true, null, mKeyStore));
- verify(mNetService).setAllowOnlyVpnForUids(eq(false), aryEq(new UidRange[] {
- new UidRange(user.start, user.start + PKG_UIDS[1] - 1),
- new UidRange(user.start + PKG_UIDS[1] + 1, user.stop)
+ verify(mNetd).networkRejectNonSecureVpn(eq(false), aryEq(new UidRangeParcel[] {
+ new UidRangeParcel(user.start, user.start + PKG_UIDS[1] - 1),
+ new UidRangeParcel(user.start + PKG_UIDS[1] + 1, user.stop)
}));
- verify(mNetService).setAllowOnlyVpnForUids(eq(true), aryEq(new UidRange[] {
- new UidRange(user.start, user.start + PKG_UIDS[3] - 1),
- new UidRange(user.start + PKG_UIDS[3] + 1, user.stop)
+
+ verify(mNetd).networkRejectNonSecureVpn(eq(true), aryEq(new UidRangeParcel[] {
+ new UidRangeParcel(user.start, user.start + PKG_UIDS[3] - 1),
+ new UidRangeParcel(user.start + PKG_UIDS[3] + 1, user.stop)
}));
- assertBlocked(vpn, user.start + PKG_UIDS[0], user.start + PKG_UIDS[1], user.start + PKG_UIDS[2]);
+ assertBlocked(vpn, user.start + PKG_UIDS[0], user.start + PKG_UIDS[1],
+ user.start + PKG_UIDS[2]);
assertUnblocked(vpn, user.start + PKG_UIDS[3]);
}
@Test
public void testLockdownAllowlist() throws Exception {
final Vpn vpn = createVpn(primaryUser.id);
- final UidRange user = UidRange.createForUser(primaryUser.id);
+ final UidRange user = PRI_USER_RANGE;
// Set always-on with lockdown and allow app PKGS[2] from lockdown.
assertTrue(vpn.setAlwaysOnPackage(
PKGS[1], true, Collections.singletonList(PKGS[2]), mKeyStore));
- verify(mNetService).setAllowOnlyVpnForUids(eq(true), aryEq(new UidRange[] {
- new UidRange(user.start, user.start + PKG_UIDS[1] - 1),
- new UidRange(user.start + PKG_UIDS[2] + 1, user.stop)
+ verify(mNetd).networkRejectNonSecureVpn(eq(true), aryEq(new UidRangeParcel[] {
+ new UidRangeParcel(user.start, user.start + PKG_UIDS[1] - 1),
+ new UidRangeParcel(user.start + PKG_UIDS[2] + 1, user.stop)
}));
assertBlocked(vpn, user.start + PKG_UIDS[0], user.start + PKG_UIDS[3]);
assertUnblocked(vpn, user.start + PKG_UIDS[1], user.start + PKG_UIDS[2]);
-
// Change allowed app list to PKGS[3].
assertTrue(vpn.setAlwaysOnPackage(
PKGS[1], true, Collections.singletonList(PKGS[3]), mKeyStore));
- verify(mNetService).setAllowOnlyVpnForUids(eq(false), aryEq(new UidRange[] {
- new UidRange(user.start + PKG_UIDS[2] + 1, user.stop)
+ verify(mNetd).networkRejectNonSecureVpn(eq(false), aryEq(new UidRangeParcel[] {
+ new UidRangeParcel(user.start + PKG_UIDS[2] + 1, user.stop)
}));
- verify(mNetService).setAllowOnlyVpnForUids(eq(true), aryEq(new UidRange[] {
- new UidRange(user.start + PKG_UIDS[1] + 1, user.start + PKG_UIDS[3] - 1),
- new UidRange(user.start + PKG_UIDS[3] + 1, user.stop)
+ verify(mNetd).networkRejectNonSecureVpn(eq(true), aryEq(new UidRangeParcel[] {
+ new UidRangeParcel(user.start + PKG_UIDS[1] + 1, user.start + PKG_UIDS[3] - 1),
+ new UidRangeParcel(user.start + PKG_UIDS[3] + 1, user.stop)
}));
assertBlocked(vpn, user.start + PKG_UIDS[0], user.start + PKG_UIDS[2]);
assertUnblocked(vpn, user.start + PKG_UIDS[1], user.start + PKG_UIDS[3]);
@@ -402,25 +406,25 @@ public class VpnTest {
// Change the VPN app.
assertTrue(vpn.setAlwaysOnPackage(
PKGS[0], true, Collections.singletonList(PKGS[3]), mKeyStore));
- verify(mNetService).setAllowOnlyVpnForUids(eq(false), aryEq(new UidRange[] {
- new UidRange(user.start, user.start + PKG_UIDS[1] - 1),
- new UidRange(user.start + PKG_UIDS[1] + 1, user.start + PKG_UIDS[3] - 1)
+ verify(mNetd).networkRejectNonSecureVpn(eq(false), aryEq(new UidRangeParcel[] {
+ new UidRangeParcel(user.start, user.start + PKG_UIDS[1] - 1),
+ new UidRangeParcel(user.start + PKG_UIDS[1] + 1, user.start + PKG_UIDS[3] - 1)
}));
- verify(mNetService).setAllowOnlyVpnForUids(eq(true), aryEq(new UidRange[] {
- new UidRange(user.start, user.start + PKG_UIDS[0] - 1),
- new UidRange(user.start + PKG_UIDS[0] + 1, user.start + PKG_UIDS[3] - 1)
+ verify(mNetd).networkRejectNonSecureVpn(eq(true), aryEq(new UidRangeParcel[] {
+ new UidRangeParcel(user.start, user.start + PKG_UIDS[0] - 1),
+ new UidRangeParcel(user.start + PKG_UIDS[0] + 1, user.start + PKG_UIDS[3] - 1)
}));
assertBlocked(vpn, user.start + PKG_UIDS[1], user.start + PKG_UIDS[2]);
assertUnblocked(vpn, user.start + PKG_UIDS[0], user.start + PKG_UIDS[3]);
// Remove the list of allowed packages.
assertTrue(vpn.setAlwaysOnPackage(PKGS[0], true, null, mKeyStore));
- verify(mNetService).setAllowOnlyVpnForUids(eq(false), aryEq(new UidRange[] {
- new UidRange(user.start + PKG_UIDS[0] + 1, user.start + PKG_UIDS[3] - 1),
- new UidRange(user.start + PKG_UIDS[3] + 1, user.stop)
+ verify(mNetd).networkRejectNonSecureVpn(eq(false), aryEq(new UidRangeParcel[] {
+ new UidRangeParcel(user.start + PKG_UIDS[0] + 1, user.start + PKG_UIDS[3] - 1),
+ new UidRangeParcel(user.start + PKG_UIDS[3] + 1, user.stop)
}));
- verify(mNetService).setAllowOnlyVpnForUids(eq(true), aryEq(new UidRange[] {
- new UidRange(user.start + PKG_UIDS[0] + 1, user.stop),
+ verify(mNetd).networkRejectNonSecureVpn(eq(true), aryEq(new UidRangeParcel[] {
+ new UidRangeParcel(user.start + PKG_UIDS[0] + 1, user.stop),
}));
assertBlocked(vpn, user.start + PKG_UIDS[1], user.start + PKG_UIDS[2],
user.start + PKG_UIDS[3]);
@@ -429,12 +433,12 @@ public class VpnTest {
// Add the list of allowed packages.
assertTrue(vpn.setAlwaysOnPackage(
PKGS[0], true, Collections.singletonList(PKGS[1]), mKeyStore));
- verify(mNetService).setAllowOnlyVpnForUids(eq(false), aryEq(new UidRange[] {
- new UidRange(user.start + PKG_UIDS[0] + 1, user.stop)
+ verify(mNetd).networkRejectNonSecureVpn(eq(false), aryEq(new UidRangeParcel[] {
+ new UidRangeParcel(user.start + PKG_UIDS[0] + 1, user.stop)
}));
- verify(mNetService).setAllowOnlyVpnForUids(eq(true), aryEq(new UidRange[] {
- new UidRange(user.start + PKG_UIDS[0] + 1, user.start + PKG_UIDS[1] - 1),
- new UidRange(user.start + PKG_UIDS[1] + 1, user.stop)
+ verify(mNetd).networkRejectNonSecureVpn(eq(true), aryEq(new UidRangeParcel[] {
+ new UidRangeParcel(user.start + PKG_UIDS[0] + 1, user.start + PKG_UIDS[1] - 1),
+ new UidRangeParcel(user.start + PKG_UIDS[1] + 1, user.stop)
}));
assertBlocked(vpn, user.start + PKG_UIDS[2], user.start + PKG_UIDS[3]);
assertUnblocked(vpn, user.start + PKG_UIDS[0], user.start + PKG_UIDS[1]);
@@ -447,13 +451,13 @@ public class VpnTest {
// allowed package should change from PGKS[1] to PKGS[2].
assertTrue(vpn.setAlwaysOnPackage(
PKGS[0], true, Arrays.asList("com.foo.app", PKGS[2], "com.bar.app"), mKeyStore));
- verify(mNetService).setAllowOnlyVpnForUids(eq(false), aryEq(new UidRange[]{
- new UidRange(user.start + PKG_UIDS[0] + 1, user.start + PKG_UIDS[1] - 1),
- new UidRange(user.start + PKG_UIDS[1] + 1, user.stop)
+ verify(mNetd).networkRejectNonSecureVpn(eq(false), aryEq(new UidRangeParcel[]{
+ new UidRangeParcel(user.start + PKG_UIDS[0] + 1, user.start + PKG_UIDS[1] - 1),
+ new UidRangeParcel(user.start + PKG_UIDS[1] + 1, user.stop)
}));
- verify(mNetService).setAllowOnlyVpnForUids(eq(true), aryEq(new UidRange[]{
- new UidRange(user.start + PKG_UIDS[0] + 1, user.start + PKG_UIDS[2] - 1),
- new UidRange(user.start + PKG_UIDS[2] + 1, user.stop)
+ verify(mNetd).networkRejectNonSecureVpn(eq(true), aryEq(new UidRangeParcel[]{
+ new UidRangeParcel(user.start + PKG_UIDS[0] + 1, user.start + PKG_UIDS[2] - 1),
+ new UidRangeParcel(user.start + PKG_UIDS[2] + 1, user.stop)
}));
}
@@ -467,86 +471,86 @@ public class VpnTest {
restrictedProfileA.flags);
tempProfile.restrictedProfileParentId = primaryUser.id;
- final UidRange user = UidRange.createForUser(primaryUser.id);
+ final UidRange user = PRI_USER_RANGE;
final UidRange profile = UidRange.createForUser(tempProfile.id);
// Set lockdown.
assertTrue(vpn.setAlwaysOnPackage(PKGS[3], true, null, mKeyStore));
- verify(mNetService).setAllowOnlyVpnForUids(eq(true), aryEq(new UidRange[] {
- new UidRange(user.start, user.start + PKG_UIDS[3] - 1),
- new UidRange(user.start + PKG_UIDS[3] + 1, user.stop)
+ verify(mNetd).networkRejectNonSecureVpn(eq(true), aryEq(new UidRangeParcel[] {
+ new UidRangeParcel(user.start, user.start + PKG_UIDS[3] - 1),
+ new UidRangeParcel(user.start + PKG_UIDS[3] + 1, user.stop)
}));
-
// Verify restricted user isn't affected at first.
assertUnblocked(vpn, profile.start + PKG_UIDS[0]);
// Add the restricted user.
setMockedUsers(primaryUser, tempProfile);
vpn.onUserAdded(tempProfile.id);
- verify(mNetService).setAllowOnlyVpnForUids(eq(true), aryEq(new UidRange[] {
- new UidRange(profile.start, profile.start + PKG_UIDS[3] - 1),
- new UidRange(profile.start + PKG_UIDS[3] + 1, profile.stop)
+ verify(mNetd).networkRejectNonSecureVpn(eq(true), aryEq(new UidRangeParcel[] {
+ new UidRangeParcel(profile.start, profile.start + PKG_UIDS[3] - 1),
+ new UidRangeParcel(profile.start + PKG_UIDS[3] + 1, profile.stop)
}));
// Remove the restricted user.
tempProfile.partial = true;
vpn.onUserRemoved(tempProfile.id);
- verify(mNetService).setAllowOnlyVpnForUids(eq(false), aryEq(new UidRange[] {
- new UidRange(profile.start, profile.start + PKG_UIDS[3] - 1),
- new UidRange(profile.start + PKG_UIDS[3] + 1, profile.stop)
+ verify(mNetd).networkRejectNonSecureVpn(eq(false), aryEq(new UidRangeParcel[] {
+ new UidRangeParcel(profile.start, profile.start + PKG_UIDS[3] - 1),
+ new UidRangeParcel(profile.start + PKG_UIDS[3] + 1, profile.stop)
}));
}
@Test
public void testLockdownRuleRepeatability() throws Exception {
final Vpn vpn = createVpn(primaryUser.id);
-
+ final UidRangeParcel[] primaryUserRangeParcel = new UidRangeParcel[] {
+ new UidRangeParcel(PRI_USER_RANGE.start, PRI_USER_RANGE.stop)};
// Given legacy lockdown is already enabled,
vpn.setLockdown(true);
- verify(mNetService, times(1)).setAllowOnlyVpnForUids(
- eq(true), aryEq(new UidRange[] {UidRange.createForUser(primaryUser.id)}));
+
+ verify(mNetd).networkRejectNonSecureVpn(eq(true), aryEq(primaryUserRangeParcel));
// Enabling legacy lockdown twice should do nothing.
vpn.setLockdown(true);
- verify(mNetService, times(1)).setAllowOnlyVpnForUids(anyBoolean(), any(UidRange[].class));
+ verify(mNetd, times(1))
+ .networkRejectNonSecureVpn(anyBoolean(), any(UidRangeParcel[].class));
// And disabling should remove the rules exactly once.
vpn.setLockdown(false);
- verify(mNetService, times(1)).setAllowOnlyVpnForUids(
- eq(false), aryEq(new UidRange[] {UidRange.createForUser(primaryUser.id)}));
+ verify(mNetd).networkRejectNonSecureVpn(eq(false), aryEq(primaryUserRangeParcel));
// Removing the lockdown again should have no effect.
vpn.setLockdown(false);
- verify(mNetService, times(2)).setAllowOnlyVpnForUids(anyBoolean(), any(UidRange[].class));
+ verify(mNetd, times(2)).networkRejectNonSecureVpn(
+ anyBoolean(), any(UidRangeParcel[].class));
}
@Test
public void testLockdownRuleReversibility() throws Exception {
final Vpn vpn = createVpn(primaryUser.id);
-
- final UidRange[] entireUser = {
- UidRange.createForUser(primaryUser.id)
+ final UidRangeParcel[] entireUser = {
+ new UidRangeParcel(PRI_USER_RANGE.start, PRI_USER_RANGE.stop)
};
- final UidRange[] exceptPkg0 = {
- new UidRange(entireUser[0].start, entireUser[0].start + PKG_UIDS[0] - 1),
- new UidRange(entireUser[0].start + PKG_UIDS[0] + 1, entireUser[0].stop)
+ final UidRangeParcel[] exceptPkg0 = {
+ new UidRangeParcel(entireUser[0].start, entireUser[0].start + PKG_UIDS[0] - 1),
+ new UidRangeParcel(entireUser[0].start + PKG_UIDS[0] + 1, entireUser[0].stop)
};
- final InOrder order = inOrder(mNetService);
+ final InOrder order = inOrder(mNetd);
// Given lockdown is enabled with no package (legacy VPN),
vpn.setLockdown(true);
- order.verify(mNetService).setAllowOnlyVpnForUids(eq(true), aryEq(entireUser));
+ order.verify(mNetd).networkRejectNonSecureVpn(eq(true), aryEq(entireUser));
// When a new VPN package is set the rules should change to cover that package.
vpn.prepare(null, PKGS[0], VpnManager.TYPE_VPN_SERVICE);
- order.verify(mNetService).setAllowOnlyVpnForUids(eq(false), aryEq(entireUser));
- order.verify(mNetService).setAllowOnlyVpnForUids(eq(true), aryEq(exceptPkg0));
+ order.verify(mNetd).networkRejectNonSecureVpn(eq(false), aryEq(entireUser));
+ order.verify(mNetd).networkRejectNonSecureVpn(eq(true), aryEq(exceptPkg0));
// When that VPN package is unset, everything should be undone again in reverse.
vpn.prepare(null, VpnConfig.LEGACY_VPN, VpnManager.TYPE_VPN_SERVICE);
- order.verify(mNetService).setAllowOnlyVpnForUids(eq(false), aryEq(exceptPkg0));
- order.verify(mNetService).setAllowOnlyVpnForUids(eq(true), aryEq(entireUser));
+ order.verify(mNetd).networkRejectNonSecureVpn(eq(false), aryEq(exceptPkg0));
+ order.verify(mNetd).networkRejectNonSecureVpn(eq(true), aryEq(entireUser));
}
@Test
@@ -1186,7 +1190,7 @@ public class VpnTest {
.thenReturn(asUserContext);
final TestLooper testLooper = new TestLooper();
final Vpn vpn = new Vpn(testLooper.getLooper(), mContext, new TestDeps(), mNetService,
- userId, mKeyStore, mSystemServices, mIkev2SessionCreator);
+ mNetd, userId, mKeyStore, mSystemServices, mIkev2SessionCreator);
verify(mConnectivityManager, times(1)).registerNetworkProvider(argThat(
provider -> provider.getName().contains("VpnNetworkProvider")
));
diff --git a/wifi/api/current.txt b/wifi/api/current.txt
index e11b33efcc33..4b0d38df0260 100644
--- a/wifi/api/current.txt
+++ b/wifi/api/current.txt
@@ -35,6 +35,7 @@ package android.net.wifi {
field @NonNull public static final android.os.Parcelable.Creator<android.net.wifi.ScanResult> CREATOR;
field public String SSID;
field public static final int WIFI_STANDARD_11AC = 5; // 0x5
+ field public static final int WIFI_STANDARD_11AD = 7; // 0x7
field public static final int WIFI_STANDARD_11AX = 6; // 0x6
field public static final int WIFI_STANDARD_11N = 4; // 0x4
field public static final int WIFI_STANDARD_LEGACY = 1; // 0x1
@@ -1156,7 +1157,11 @@ package android.net.wifi.rtt {
public final class RangingRequest implements android.os.Parcelable {
method public int describeContents();
+ method public static int getDefaultRttBurstSize();
method public static int getMaxPeers();
+ method public static int getMaxRttBurstSize();
+ method public static int getMinRttBurstSize();
+ method public int getRttBurstSize();
method public void writeToParcel(android.os.Parcel, int);
field @NonNull public static final android.os.Parcelable.Creator<android.net.wifi.rtt.RangingRequest> CREATOR;
}
@@ -1168,6 +1173,7 @@ package android.net.wifi.rtt {
method public android.net.wifi.rtt.RangingRequest.Builder addWifiAwarePeer(@NonNull android.net.MacAddress);
method public android.net.wifi.rtt.RangingRequest.Builder addWifiAwarePeer(@NonNull android.net.wifi.aware.PeerHandle);
method public android.net.wifi.rtt.RangingRequest build();
+ method @NonNull public android.net.wifi.rtt.RangingRequest.Builder setRttBurstSize(int);
}
public final class RangingResult implements android.os.Parcelable {
diff --git a/wifi/api/system-current.txt b/wifi/api/system-current.txt
index eba744330a2e..e15d0f132b87 100644
--- a/wifi/api/system-current.txt
+++ b/wifi/api/system-current.txt
@@ -277,6 +277,7 @@ package android.net.wifi {
method @Nullable public android.net.wifi.WifiConfiguration toWifiConfiguration();
field public static final int BAND_2GHZ = 1; // 0x1
field public static final int BAND_5GHZ = 2; // 0x2
+ field public static final int BAND_60GHZ = 8; // 0x8
field public static final int BAND_6GHZ = 4; // 0x4
field @Deprecated public static final int BAND_ANY = 7; // 0x7
field public static final int RANDOMIZATION_NONE = 0; // 0x0
@@ -314,9 +315,13 @@ package android.net.wifi {
field public static final int CHANNEL_WIDTH_160MHZ = 6; // 0x6
field public static final int CHANNEL_WIDTH_20MHZ = 2; // 0x2
field public static final int CHANNEL_WIDTH_20MHZ_NOHT = 1; // 0x1
+ field public static final int CHANNEL_WIDTH_2160MHZ = 7; // 0x7
field public static final int CHANNEL_WIDTH_40MHZ = 3; // 0x3
+ field public static final int CHANNEL_WIDTH_4320MHZ = 8; // 0x8
+ field public static final int CHANNEL_WIDTH_6480MHZ = 9; // 0x9
field public static final int CHANNEL_WIDTH_80MHZ = 4; // 0x4
field public static final int CHANNEL_WIDTH_80MHZ_PLUS_MHZ = 5; // 0x5
+ field public static final int CHANNEL_WIDTH_8640MHZ = 10; // 0xa
field public static final int CHANNEL_WIDTH_INVALID = 0; // 0x0
field @NonNull public static final android.os.Parcelable.Creator<android.net.wifi.SoftApInfo> CREATOR;
}
@@ -495,6 +500,7 @@ package android.net.wifi {
method @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS) public void registerSoftApCallback(@NonNull java.util.concurrent.Executor, @NonNull android.net.wifi.WifiManager.SoftApCallback);
method @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS) public void registerTrafficStateCallback(@NonNull java.util.concurrent.Executor, @NonNull android.net.wifi.WifiManager.TrafficStateCallback);
method @RequiresPermission(android.Manifest.permission.WIFI_UPDATE_USABILITY_STATS_SCORE) public void removeOnWifiUsabilityStatsListener(@NonNull android.net.wifi.WifiManager.OnWifiUsabilityStatsListener);
+ method @RequiresPermission(android.Manifest.permission.NETWORK_AIRPLANE_MODE) public void restartWifiSubsystem(@Nullable String);
method @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS) public void restoreBackupData(@NonNull byte[]);
method @Nullable @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS) public android.net.wifi.SoftApConfiguration restoreSoftApBackupData(@NonNull byte[]);
method @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS) public void restoreSupplicantBackupData(@NonNull byte[], @NonNull byte[]);
@@ -519,11 +525,11 @@ package android.net.wifi {
method @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_SETTINGS, android.Manifest.permission.NETWORK_SETUP_WIZARD}) public void startLocalOnlyHotspot(@NonNull android.net.wifi.SoftApConfiguration, @Nullable java.util.concurrent.Executor, @Nullable android.net.wifi.WifiManager.LocalOnlyHotspotCallback);
method @RequiresPermission(android.Manifest.permission.UPDATE_DEVICE_STATS) public boolean startScan(android.os.WorkSource);
method @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_SETTINGS, android.Manifest.permission.NETWORK_SETUP_WIZARD}) public void startSubscriptionProvisioning(@NonNull android.net.wifi.hotspot2.OsuProvider, @NonNull java.util.concurrent.Executor, @NonNull android.net.wifi.hotspot2.ProvisioningCallback);
- method @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS) public void startTemporarilyDisablingAllNonCarrierMergedWifi(int);
+ method @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_SETTINGS, android.Manifest.permission.NETWORK_SETUP_WIZARD}) public void startTemporarilyDisablingAllNonCarrierMergedWifi(int);
method @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_STACK, android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK}) public boolean startTetheredHotspot(@Nullable android.net.wifi.SoftApConfiguration);
method @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_SETTINGS, android.Manifest.permission.NETWORK_SETUP_WIZARD}) public void stopEasyConnectSession();
method @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_STACK, android.net.NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK}) public boolean stopSoftAp();
- method @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS) public void stopTemporarilyDisablingAllNonCarrierMergedWifi();
+ method @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_SETTINGS, android.Manifest.permission.NETWORK_SETUP_WIZARD}) public void stopTemporarilyDisablingAllNonCarrierMergedWifi();
method @RequiresPermission(android.Manifest.permission.WIFI_ACCESS_COEX_UNSAFE_CHANNELS) public void unregisterCoexCallback(@NonNull android.net.wifi.WifiManager.CoexCallback);
method @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS) public void unregisterNetworkRequestMatchCallback(@NonNull android.net.wifi.WifiManager.NetworkRequestMatchCallback);
method @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS) public void unregisterSoftApCallback(@NonNull android.net.wifi.WifiManager.SoftApCallback);
@@ -632,6 +638,7 @@ package android.net.wifi {
method public default void onCapabilityChanged(@NonNull android.net.wifi.SoftApCapability);
method public default void onConnectedClientsChanged(@NonNull java.util.List<android.net.wifi.WifiClient>);
method public default void onInfoChanged(@NonNull android.net.wifi.SoftApInfo);
+ method public default void onInfoListChanged(@NonNull java.util.List<android.net.wifi.SoftApInfo>);
method public default void onStateChanged(int, int);
}
@@ -957,6 +964,10 @@ package android.net.wifi.p2p {
package android.net.wifi.rtt {
+ public final class RangingRequest implements android.os.Parcelable {
+ method @NonNull public java.util.List<android.net.wifi.rtt.ResponderConfig> getRttPeers();
+ }
+
public static final class RangingRequest.Builder {
method public android.net.wifi.rtt.RangingRequest.Builder addResponder(@NonNull android.net.wifi.rtt.ResponderConfig);
}
diff --git a/wifi/java/android/net/wifi/ISoftApCallback.aidl b/wifi/java/android/net/wifi/ISoftApCallback.aidl
index f81bcb9e06d7..a28a8fb626b1 100644
--- a/wifi/java/android/net/wifi/ISoftApCallback.aidl
+++ b/wifi/java/android/net/wifi/ISoftApCallback.aidl
@@ -53,6 +53,12 @@ oneway interface ISoftApCallback
*/
void onInfoChanged(in SoftApInfo softApInfo);
+ /**
+ * Service to manager callback providing informations of softap.
+ *
+ * @param softApInfoList is the list of the softap informations. {@link SoftApInfo}
+ */
+ void onInfoListChanged(in List<SoftApInfo> softApInfoList);
/**
* Service to manager callback providing capability of softap.
diff --git a/wifi/java/android/net/wifi/IWifiManager.aidl b/wifi/java/android/net/wifi/IWifiManager.aidl
index 866e913800fd..e7b8475405ad 100644
--- a/wifi/java/android/net/wifi/IWifiManager.aidl
+++ b/wifi/java/android/net/wifi/IWifiManager.aidl
@@ -300,4 +300,6 @@ interface IWifiManager
void setCarrierNetworkOffloadEnabled(int subscriptionId, boolean merged, boolean enabled);
boolean isCarrierNetworkOffloadEnabled(int subscriptionId, boolean merged);
+
+ void restartWifiSubsystem(String reason);
}
diff --git a/wifi/java/android/net/wifi/ScanResult.java b/wifi/java/android/net/wifi/ScanResult.java
index 4c23286258d8..9f8ecf14175d 100644
--- a/wifi/java/android/net/wifi/ScanResult.java
+++ b/wifi/java/android/net/wifi/ScanResult.java
@@ -320,6 +320,11 @@ public final class ScanResult implements Parcelable {
public static final int WIFI_STANDARD_11AX = 6;
/**
+ * Wi-Fi 802.11ad/ay
+ */
+ public static final int WIFI_STANDARD_11AD = 7;
+
+ /**
* AP wifi standard.
*/
private @WifiStandard int mWifiStandard;
@@ -352,6 +357,8 @@ public final class ScanResult implements Parcelable {
return "11ac";
case WIFI_STANDARD_11AX:
return "11ax";
+ case WIFI_STANDARD_11AD:
+ return "11ad";
case WIFI_STANDARD_UNKNOWN:
return "unknown";
}
@@ -705,6 +712,13 @@ public final class ScanResult implements Parcelable {
return UNSPECIFIED;
}
}
+ if (band == WifiScanner.WIFI_BAND_60_GHZ) {
+ if (channel >= BAND_60_GHZ_FIRST_CH_NUM && channel <= BAND_60_GHZ_LAST_CH_NUM) {
+ return ((channel - BAND_60_GHZ_FIRST_CH_NUM) * 2160) + BAND_60_GHZ_START_FREQ_MHZ;
+ } else {
+ return UNSPECIFIED;
+ }
+ }
return UNSPECIFIED;
}
diff --git a/wifi/java/android/net/wifi/SecurityParams.java b/wifi/java/android/net/wifi/SecurityParams.java
new file mode 100644
index 000000000000..0ab6f572fba3
--- /dev/null
+++ b/wifi/java/android/net/wifi/SecurityParams.java
@@ -0,0 +1,824 @@
+/*
+ * 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 android.net.wifi;
+
+import android.annotation.IntDef;
+import android.annotation.NonNull;
+import android.net.wifi.WifiConfiguration.AuthAlgorithm;
+import android.net.wifi.WifiConfiguration.GroupCipher;
+import android.net.wifi.WifiConfiguration.GroupMgmtCipher;
+import android.net.wifi.WifiConfiguration.KeyMgmt;
+import android.net.wifi.WifiConfiguration.PairwiseCipher;
+import android.net.wifi.WifiConfiguration.Protocol;
+import android.net.wifi.WifiConfiguration.SecurityType;
+import android.net.wifi.WifiConfiguration.SuiteBCipher;
+import android.os.Parcel;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.util.BitSet;
+import java.util.Objects;
+
+/**
+ * A class representing a security configuration.
+ * @hide
+ */
+public class SecurityParams {
+ private static final String TAG = "SecurityParams";
+
+ /** Passpoint Release 1 */
+ public static final int PASSPOINT_R1 = 1;
+
+ /** Passpoint Release 2 */
+ public static final int PASSPOINT_R2 = 2;
+
+ /** Passpoint Release 3 */
+ public static final int PASSPOINT_R3 = 3;
+
+ @IntDef(prefix = { "PASSPOINT_" }, value = {
+ PASSPOINT_R1,
+ PASSPOINT_R2,
+ PASSPOINT_R3,
+ })
+ @Retention(RetentionPolicy.SOURCE)
+ public @interface PasspointRelease {}
+
+ private @SecurityType int mSecurityType = WifiConfiguration.SECURITY_TYPE_PSK;
+
+ /**
+ * This indicates that this security type is enabled or disabled.
+ * Ex. While receiving Transition Disable Indication, older
+ * security should be disabled.
+ */
+ private boolean mEnabled = true;
+
+ /**
+ * The set of key management protocols supported by this configuration.
+ * See {@link KeyMgmt} for descriptions of the values.
+ * This is set automatically based on the security type.
+ */
+ private BitSet mAllowedKeyManagement = new BitSet();
+
+ /**
+ * The set of security protocols supported by this configuration.
+ * See {@link Protocol} for descriptions of the values.
+ * This is set automatically based on the security type.
+ */
+ private BitSet mAllowedProtocols = new BitSet();
+
+ /**
+ * The set of authentication protocols supported by this configuration.
+ * See {@link AuthAlgorithm} for descriptions of the values.
+ * This is set automatically based on the security type.
+ */
+ private BitSet mAllowedAuthAlgorithms = new BitSet();
+
+ /**
+ * The set of pairwise ciphers for WPA supported by this configuration.
+ * See {@link PairwiseCipher} for descriptions of the values.
+ * This is set automatically based on the security type.
+ */
+ private BitSet mAllowedPairwiseCiphers = new BitSet();
+
+ /**
+ * The set of group ciphers supported by this configuration.
+ * See {@link GroupCipher} for descriptions of the values.
+ * This is set automatically based on the security type.
+ */
+ private BitSet mAllowedGroupCiphers = new BitSet();
+
+ /**
+ * The set of group management ciphers supported by this configuration.
+ * See {@link GroupMgmtCipher} for descriptions of the values.
+ */
+ private BitSet mAllowedGroupManagementCiphers = new BitSet();
+
+ /**
+ * The set of SuiteB ciphers supported by this configuration.
+ * To be used for WPA3-Enterprise mode. Set automatically by the framework based on the
+ * certificate type that is used in this configuration.
+ */
+ private BitSet mAllowedSuiteBCiphers = new BitSet();
+
+ /**
+ * True if the network requires Protected Management Frames (PMF), false otherwise.
+ */
+ private boolean mRequirePmf = false;
+
+ private @PasspointRelease int mPasspointRelease = PASSPOINT_R2;
+
+ /** Indicate that this SAE security type only accepts H2E (Hash-to-Element) mode. */
+ private boolean mIsSaeH2eOnlyMode = false;
+
+ /** Indicate that this SAE security type only accepts PK (Public Key) mode. */
+ private boolean mIsSaePkOnlyMode = false;
+
+ /** Indicate whether this is added by auto-upgrade or not. */
+ private boolean mIsAddedByAutoUpgrade = false;
+
+ /** Constructor */
+ private SecurityParams() {
+ }
+
+ /** Copy constructor */
+ public SecurityParams(@NonNull SecurityParams source) {
+ this.mSecurityType = source.mSecurityType;
+ this.mEnabled = source.mEnabled;
+ this.mAllowedKeyManagement = (BitSet) source.mAllowedKeyManagement.clone();
+ this.mAllowedProtocols = (BitSet) source.mAllowedProtocols.clone();
+ this.mAllowedAuthAlgorithms = (BitSet) source.mAllowedAuthAlgorithms.clone();
+ this.mAllowedPairwiseCiphers = (BitSet) source.mAllowedPairwiseCiphers.clone();
+ this.mAllowedGroupCiphers = (BitSet) source.mAllowedGroupCiphers.clone();
+ this.mAllowedGroupManagementCiphers =
+ (BitSet) source.mAllowedGroupManagementCiphers.clone();
+ this.mAllowedSuiteBCiphers =
+ (BitSet) source.mAllowedSuiteBCiphers.clone();
+ this.mRequirePmf = source.mRequirePmf;
+ this.mIsSaeH2eOnlyMode = source.mIsSaeH2eOnlyMode;
+ this.mIsSaePkOnlyMode = source.mIsSaePkOnlyMode;
+ this.mIsAddedByAutoUpgrade = source.mIsAddedByAutoUpgrade;
+ }
+
+ @Override
+ public boolean equals(Object thatObject) {
+ if (this == thatObject) {
+ return true;
+ }
+ if (!(thatObject instanceof SecurityParams)) {
+ return false;
+ }
+ SecurityParams that = (SecurityParams) thatObject;
+
+ if (this.mSecurityType != that.mSecurityType) return false;
+ if (this.mEnabled != that.mEnabled) return false;
+ if (!this.mAllowedKeyManagement.equals(that.mAllowedKeyManagement)) return false;
+ if (!this.mAllowedProtocols.equals(that.mAllowedProtocols)) return false;
+ if (!this.mAllowedAuthAlgorithms.equals(that.mAllowedAuthAlgorithms)) return false;
+ if (!this.mAllowedPairwiseCiphers.equals(that.mAllowedPairwiseCiphers)) return false;
+ if (!this.mAllowedGroupCiphers.equals(that.mAllowedGroupCiphers)) return false;
+ if (!this.mAllowedGroupManagementCiphers.equals(that.mAllowedGroupManagementCiphers)) {
+ return false;
+ }
+ if (!this.mAllowedSuiteBCiphers.equals(that.mAllowedSuiteBCiphers)) return false;
+ if (this.mRequirePmf != that.mRequirePmf) return false;
+ if (this.mIsSaeH2eOnlyMode != that.mIsSaeH2eOnlyMode) return false;
+ if (this.mIsSaePkOnlyMode != that.mIsSaePkOnlyMode) return false;
+ if (this.mIsAddedByAutoUpgrade != that.mIsAddedByAutoUpgrade) return false;
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(mSecurityType, mEnabled,
+ mAllowedKeyManagement, mAllowedProtocols, mAllowedAuthAlgorithms,
+ mAllowedPairwiseCiphers, mAllowedGroupCiphers, mAllowedGroupManagementCiphers,
+ mAllowedSuiteBCiphers, mRequirePmf,
+ mIsSaeH2eOnlyMode, mIsSaePkOnlyMode, mIsAddedByAutoUpgrade);
+ }
+
+ /**
+ * Check the security type of this params.
+ *
+ * @param type the testing security type.
+ * @return true if this is for the corresponiding type.
+ */
+ public boolean isSecurityType(@SecurityType int type) {
+ return type == mSecurityType;
+ }
+
+ /**
+ * Check whether the security of given params is the same as this one.
+ *
+ * @param params the testing security params.
+ * @return true if their security types are the same.
+ */
+ public boolean isSameSecurityType(SecurityParams params) {
+ return params.mSecurityType == mSecurityType;
+ }
+
+ /**
+ * Update security params to legacy WifiConfiguration object.
+ *
+ * @param config the target configuration.
+ */
+ public void updateLegacyWifiConfiguration(WifiConfiguration config) {
+ config.allowedKeyManagement = (BitSet) mAllowedKeyManagement.clone();
+ config.allowedProtocols = (BitSet) mAllowedProtocols.clone();
+ config.allowedAuthAlgorithms = (BitSet) mAllowedAuthAlgorithms.clone();
+ config.allowedPairwiseCiphers = (BitSet) mAllowedPairwiseCiphers.clone();
+ config.allowedGroupCiphers = (BitSet) mAllowedGroupCiphers.clone();
+ config.allowedGroupManagementCiphers = (BitSet) mAllowedGroupManagementCiphers.clone();
+ config.allowedSuiteBCiphers = (BitSet) mAllowedSuiteBCiphers.clone();
+ config.requirePmf = mRequirePmf;
+ }
+
+ /**
+ * Set this params enabled.
+ *
+ * @param enable enable a specific security type.
+ */
+ public void setEnabled(boolean enable) {
+ mEnabled = enable;
+ }
+
+ /**
+ * Indicate this params is enabled or not.
+ */
+ public boolean isEnabled() {
+ return mEnabled;
+ }
+
+ /**
+ * Set the supporting Fast Initial Link Set-up (FILS) key management.
+ *
+ * FILS can be applied to all security types.
+ * @param enableFilsSha256 Enable FILS SHA256.
+ * @param enableFilsSha384 Enable FILS SHA256.
+ */
+ public void enableFils(boolean enableFilsSha256, boolean enableFilsSha384) {
+ if (enableFilsSha256) {
+ mAllowedKeyManagement.set(KeyMgmt.FILS_SHA256);
+ }
+
+ if (enableFilsSha384) {
+ mAllowedKeyManagement.set(KeyMgmt.FILS_SHA384);
+ }
+ }
+
+ /**
+ * Get the copy of allowed key management.
+ */
+ public BitSet getAllowedKeyManagement() {
+ return (BitSet) mAllowedKeyManagement.clone();
+ }
+
+ /**
+ * Get the copy of allowed protocols.
+ */
+ public BitSet getAllowedProtocols() {
+ return (BitSet) mAllowedProtocols.clone();
+ }
+
+ /**
+ * Get the copy of allowed auth algorithms.
+ */
+ public BitSet getAllowedAuthAlgorithms() {
+ return (BitSet) mAllowedAuthAlgorithms.clone();
+ }
+
+ /**
+ * Get the copy of allowed pairwise ciphers.
+ */
+ public BitSet getAllowedPairwiseCiphers() {
+ return (BitSet) mAllowedPairwiseCiphers.clone();
+ }
+
+ /**
+ * Get the copy of allowed group ciphers.
+ */
+ public BitSet getAllowedGroupCiphers() {
+ return (BitSet) mAllowedGroupCiphers.clone();
+ }
+
+ /**
+ * Get the copy of allowed group management ciphers.
+ */
+ public BitSet getAllowedGroupManagementCiphers() {
+ return (BitSet) mAllowedGroupManagementCiphers.clone();
+ }
+
+ /**
+ * Enable Suite-B ciphers.
+ *
+ * @param enableEcdheEcdsa enable Diffie-Hellman with Elliptic Curve ECDSA cipher support.
+ * @param enableEcdheRsa enable Diffie-Hellman with RSA cipher support.
+ */
+ public void enableSuiteBCiphers(boolean enableEcdheEcdsa, boolean enableEcdheRsa) {
+ if (enableEcdheEcdsa) {
+ mAllowedSuiteBCiphers.set(SuiteBCipher.ECDHE_ECDSA);
+ } else {
+ mAllowedSuiteBCiphers.clear(SuiteBCipher.ECDHE_ECDSA);
+ }
+
+ if (enableEcdheRsa) {
+ mAllowedSuiteBCiphers.set(SuiteBCipher.ECDHE_RSA);
+ } else {
+ mAllowedSuiteBCiphers.clear(SuiteBCipher.ECDHE_RSA);
+ }
+ }
+
+ /**
+ * Get the copy of allowed suite-b ciphers.
+ */
+ public BitSet getAllowedSuiteBCiphers() {
+ return (BitSet) mAllowedSuiteBCiphers.clone();
+ }
+
+ /**
+ * Indicate PMF is required or not.
+ */
+ public boolean isRequirePmf() {
+ return mRequirePmf;
+ }
+
+ /**
+ * Indicate that this is open security type.
+ */
+ public boolean isOpenSecurityType() {
+ return isSecurityType(WifiConfiguration.SECURITY_TYPE_OPEN)
+ || isSecurityType(WifiConfiguration.SECURITY_TYPE_OWE);
+ }
+
+ /**
+ * Indicate that this is enterprise security type.
+ */
+ public boolean isEnterpriseSecurityType() {
+ return mAllowedKeyManagement.get(KeyMgmt.WPA_EAP)
+ || mAllowedKeyManagement.get(KeyMgmt.IEEE8021X)
+ || mAllowedKeyManagement.get(KeyMgmt.SUITE_B_192)
+ || mAllowedKeyManagement.get(KeyMgmt.WAPI_CERT);
+ }
+
+ /**
+ * Enable Hash-to-Element only mode.
+ *
+ * @param enable set H2E only mode enabled or not.
+ */
+ public void enableSaeH2eOnlyMode(boolean enable) {
+ mIsSaeH2eOnlyMode = enable;
+ }
+
+ /**
+ * Indicate whether this params is H2E only mode.
+ *
+ * @return true if this is H2E only mode params.
+ */
+ public boolean isSaeH2eOnlyMode() {
+ return mIsSaeH2eOnlyMode;
+ }
+ /**
+ * Enable Pubilc-Key only mode.
+ *
+ * @param enable set PK only mode enabled or not.
+ */
+ public void enableSaePkOnlyMode(boolean enable) {
+ mIsSaePkOnlyMode = enable;
+ }
+
+ /**
+ * Indicate whether this params is PK only mode.
+ *
+ * @return true if this is PK only mode params.
+ */
+ public boolean isSaePkOnlyMode() {
+ return mIsSaePkOnlyMode;
+ }
+
+ /**
+ * Set whether this is added by auto-upgrade.
+ *
+ * @param addedByAutoUpgrade true if added by auto-upgrade.
+ */
+ public void setIsAddedByAutoUpgrade(boolean addedByAutoUpgrade) {
+ mIsAddedByAutoUpgrade = addedByAutoUpgrade;
+ }
+
+ /**
+ * Indicate whether this is added by auto-upgrade or not.
+ *
+ * @return true if added by auto-upgrade; otherwise, false.
+ */
+ public boolean isAddedByAutoUpgrade() {
+ return mIsAddedByAutoUpgrade;
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sbuf = new StringBuilder();
+ sbuf.append("Security Parameters:\n");
+ sbuf.append(" Type: ").append(mSecurityType).append("\n");
+ sbuf.append(" Enabled: ").append(mEnabled).append("\n");
+ sbuf.append(" KeyMgmt:");
+ for (int k = 0; k < mAllowedKeyManagement.size(); k++) {
+ if (mAllowedKeyManagement.get(k)) {
+ sbuf.append(" ");
+ if (k < KeyMgmt.strings.length) {
+ sbuf.append(KeyMgmt.strings[k]);
+ } else {
+ sbuf.append("??");
+ }
+ }
+ }
+ sbuf.append('\n');
+ sbuf.append(" Protocols:");
+ for (int p = 0; p < mAllowedProtocols.size(); p++) {
+ if (mAllowedProtocols.get(p)) {
+ sbuf.append(" ");
+ if (p < Protocol.strings.length) {
+ sbuf.append(Protocol.strings[p]);
+ } else {
+ sbuf.append("??");
+ }
+ }
+ }
+ sbuf.append('\n');
+ sbuf.append(" AuthAlgorithms:");
+ for (int a = 0; a < mAllowedAuthAlgorithms.size(); a++) {
+ if (mAllowedAuthAlgorithms.get(a)) {
+ sbuf.append(" ");
+ if (a < AuthAlgorithm.strings.length) {
+ sbuf.append(AuthAlgorithm.strings[a]);
+ } else {
+ sbuf.append("??");
+ }
+ }
+ }
+ sbuf.append('\n');
+ sbuf.append(" PairwiseCiphers:");
+ for (int pc = 0; pc < mAllowedPairwiseCiphers.size(); pc++) {
+ if (mAllowedPairwiseCiphers.get(pc)) {
+ sbuf.append(" ");
+ if (pc < PairwiseCipher.strings.length) {
+ sbuf.append(PairwiseCipher.strings[pc]);
+ } else {
+ sbuf.append("??");
+ }
+ }
+ }
+ sbuf.append('\n');
+ sbuf.append(" GroupCiphers:");
+ for (int gc = 0; gc < mAllowedGroupCiphers.size(); gc++) {
+ if (mAllowedGroupCiphers.get(gc)) {
+ sbuf.append(" ");
+ if (gc < GroupCipher.strings.length) {
+ sbuf.append(GroupCipher.strings[gc]);
+ } else {
+ sbuf.append("??");
+ }
+ }
+ }
+ sbuf.append('\n');
+ sbuf.append(" GroupMgmtCiphers:");
+ for (int gmc = 0; gmc < mAllowedGroupManagementCiphers.size(); gmc++) {
+ if (mAllowedGroupManagementCiphers.get(gmc)) {
+ sbuf.append(" ");
+ if (gmc < GroupMgmtCipher.strings.length) {
+ sbuf.append(GroupMgmtCipher.strings[gmc]);
+ } else {
+ sbuf.append("??");
+ }
+ }
+ }
+ sbuf.append('\n');
+ sbuf.append(" SuiteBCiphers:");
+ for (int sbc = 0; sbc < mAllowedSuiteBCiphers.size(); sbc++) {
+ if (mAllowedSuiteBCiphers.get(sbc)) {
+ sbuf.append(" ");
+ if (sbc < SuiteBCipher.strings.length) {
+ sbuf.append(SuiteBCipher.strings[sbc]);
+ } else {
+ sbuf.append("??");
+ }
+ }
+ }
+ sbuf.append('\n');
+ sbuf.append(" RequirePmf: ").append(mRequirePmf).append('\n');
+ sbuf.append(" IsAddedByAutoUpgrade: ").append(mIsAddedByAutoUpgrade).append("\n");
+ sbuf.append(" IsSaeH2eOnlyMode: ").append(mIsSaeH2eOnlyMode).append("\n");
+ sbuf.append(" IsSaePkOnlyMode: ").append(mIsSaePkOnlyMode).append("\n");
+ return sbuf.toString();
+ }
+
+ private static BitSet readBitSet(Parcel src) {
+ int cardinality = src.readInt();
+
+ BitSet set = new BitSet();
+ for (int i = 0; i < cardinality; i++) {
+ set.set(src.readInt());
+ }
+
+ return set;
+ }
+
+ private static void writeBitSet(Parcel dest, BitSet set) {
+ int nextSetBit = -1;
+
+ dest.writeInt(set.cardinality());
+
+ while ((nextSetBit = set.nextSetBit(nextSetBit + 1)) != -1) {
+ dest.writeInt(nextSetBit);
+ }
+ }
+
+ /** Write this object to the parcel. */
+ public void writeToParcel(Parcel dest, int flags) {
+ dest.writeInt(mSecurityType);
+ dest.writeBoolean(mEnabled);
+ writeBitSet(dest, mAllowedKeyManagement);
+ writeBitSet(dest, mAllowedProtocols);
+ writeBitSet(dest, mAllowedAuthAlgorithms);
+ writeBitSet(dest, mAllowedPairwiseCiphers);
+ writeBitSet(dest, mAllowedGroupCiphers);
+ writeBitSet(dest, mAllowedGroupManagementCiphers);
+ writeBitSet(dest, mAllowedSuiteBCiphers);
+ dest.writeBoolean(mRequirePmf);
+ dest.writeBoolean(mIsAddedByAutoUpgrade);
+ dest.writeBoolean(mIsSaeH2eOnlyMode);
+ dest.writeBoolean(mIsSaePkOnlyMode);
+
+ }
+
+ /** Create a SecurityParams object from the parcel. */
+ public static final @NonNull SecurityParams createFromParcel(Parcel in) {
+ SecurityParams params = new SecurityParams();
+ params.mSecurityType = in.readInt();
+ params.mEnabled = in.readBoolean();
+ params.mAllowedKeyManagement = readBitSet(in);
+ params.mAllowedProtocols = readBitSet(in);
+ params.mAllowedAuthAlgorithms = readBitSet(in);
+ params.mAllowedPairwiseCiphers = readBitSet(in);
+ params.mAllowedGroupCiphers = readBitSet(in);
+ params.mAllowedGroupManagementCiphers = readBitSet(in);
+ params.mAllowedSuiteBCiphers = readBitSet(in);
+ params.mRequirePmf = in.readBoolean();
+ params.mIsAddedByAutoUpgrade = in.readBoolean();
+ params.mIsSaeH2eOnlyMode = in.readBoolean();
+ params.mIsSaePkOnlyMode = in.readBoolean();
+ return params;
+ }
+
+ /**
+ * Create EAP security params.
+ */
+ public static @NonNull SecurityParams createWpaWpa2EnterpriseParams() {
+ SecurityParams params = new SecurityParams();
+ params.mSecurityType = WifiConfiguration.SECURITY_TYPE_EAP;
+
+ params.mAllowedKeyManagement.set(KeyMgmt.WPA_EAP);
+ params.mAllowedKeyManagement.set(KeyMgmt.IEEE8021X);
+
+ params.mAllowedProtocols.set(Protocol.RSN);
+ params.mAllowedProtocols.set(Protocol.WPA);
+
+ params.mAllowedPairwiseCiphers.set(PairwiseCipher.CCMP);
+ params.mAllowedPairwiseCiphers.set(PairwiseCipher.TKIP);
+
+ params.mAllowedGroupCiphers.set(GroupCipher.CCMP);
+ params.mAllowedGroupCiphers.set(GroupCipher.TKIP);
+ return params;
+ }
+
+ /**
+ * Create Passpoint security params.
+ */
+ public static @NonNull SecurityParams createPasspointParams(@PasspointRelease int release) {
+ SecurityParams params = new SecurityParams();
+ switch (release) {
+ case PASSPOINT_R1:
+ case PASSPOINT_R2:
+ params.mSecurityType = WifiConfiguration.SECURITY_TYPE_PASSPOINT_R1_R2;
+ break;
+ case PASSPOINT_R3:
+ params.mSecurityType = WifiConfiguration.SECURITY_TYPE_PASSPOINT_R3;
+ params.mRequirePmf = true;
+ break;
+ default:
+ throw new IllegalArgumentException("invalid passpoint release " + release);
+ }
+
+ params.mAllowedKeyManagement.set(KeyMgmt.WPA_EAP);
+ params.mAllowedKeyManagement.set(KeyMgmt.IEEE8021X);
+
+ params.mAllowedProtocols.set(Protocol.RSN);
+
+ params.mAllowedPairwiseCiphers.set(PairwiseCipher.CCMP);
+
+ params.mAllowedGroupCiphers.set(GroupCipher.CCMP);
+
+ return params;
+ }
+
+ /**
+ * Create Enhanced Open params.
+ */
+ public static @NonNull SecurityParams createEnhancedOpenParams() {
+ SecurityParams params = new SecurityParams();
+ params.mSecurityType = WifiConfiguration.SECURITY_TYPE_OWE;
+
+ params.mAllowedKeyManagement.set(KeyMgmt.OWE);
+
+ params.mAllowedProtocols.set(Protocol.RSN);
+
+ params.mAllowedPairwiseCiphers.set(PairwiseCipher.CCMP);
+ params.mAllowedPairwiseCiphers.set(PairwiseCipher.GCMP_128);
+ params.mAllowedPairwiseCiphers.set(PairwiseCipher.GCMP_256);
+
+ params.mAllowedGroupCiphers.set(GroupCipher.CCMP);
+ params.mAllowedGroupCiphers.set(GroupCipher.GCMP_128);
+ params.mAllowedGroupCiphers.set(GroupCipher.GCMP_256);
+
+ params.mRequirePmf = true;
+ return params;
+ }
+
+ /**
+ * Create Open params.
+ */
+ public static @NonNull SecurityParams createOpenParams() {
+ SecurityParams params = new SecurityParams();
+ params.mSecurityType = WifiConfiguration.SECURITY_TYPE_OPEN;
+
+ params.mAllowedKeyManagement.set(KeyMgmt.NONE);
+
+ params.mAllowedProtocols.set(Protocol.RSN);
+ params.mAllowedProtocols.set(Protocol.WPA);
+ return params;
+ }
+
+ /**
+ * Create OSEN params.
+ */
+ public static @NonNull SecurityParams createOsenParams() {
+ SecurityParams params = new SecurityParams();
+ params.mSecurityType = WifiConfiguration.SECURITY_TYPE_OSEN;
+
+ params.mAllowedKeyManagement.set(KeyMgmt.OSEN);
+
+ params.mAllowedProtocols.set(Protocol.OSEN);
+
+ params.mAllowedPairwiseCiphers.set(PairwiseCipher.CCMP);
+ params.mAllowedPairwiseCiphers.set(PairwiseCipher.TKIP);
+
+ params.mAllowedGroupCiphers.set(GroupCipher.CCMP);
+ params.mAllowedGroupCiphers.set(GroupCipher.TKIP);
+ return params;
+ }
+
+ /**
+ * Create WAPI-CERT params.
+ */
+ public static @NonNull SecurityParams createWapiCertParams() {
+ SecurityParams params = new SecurityParams();
+ params.mSecurityType = WifiConfiguration.SECURITY_TYPE_WAPI_CERT;
+
+ params.mAllowedKeyManagement.set(KeyMgmt.WAPI_CERT);
+
+ params.mAllowedProtocols.set(Protocol.WAPI);
+
+ params.mAllowedPairwiseCiphers.set(PairwiseCipher.SMS4);
+
+ params.mAllowedGroupCiphers.set(GroupCipher.SMS4);
+ return params;
+ }
+
+ /**
+ * Create WAPI-PSK params.
+ */
+ public static @NonNull SecurityParams createWapiPskParams() {
+ SecurityParams params = new SecurityParams();
+ params.mSecurityType = WifiConfiguration.SECURITY_TYPE_WAPI_PSK;
+
+ params.mAllowedKeyManagement.set(KeyMgmt.WAPI_PSK);
+
+ params.mAllowedProtocols.set(Protocol.WAPI);
+
+ params.mAllowedPairwiseCiphers.set(PairwiseCipher.SMS4);
+
+ params.mAllowedGroupCiphers.set(GroupCipher.SMS4);
+ return params;
+ }
+
+ /**
+ * Create WEP params.
+ */
+ public static @NonNull SecurityParams createWepParams() {
+ SecurityParams params = new SecurityParams();
+ params.mSecurityType = WifiConfiguration.SECURITY_TYPE_WEP;
+
+ params.mAllowedKeyManagement.set(KeyMgmt.NONE);
+
+ params.mAllowedProtocols.set(Protocol.RSN);
+
+ params.mAllowedAuthAlgorithms.set(AuthAlgorithm.OPEN);
+ params.mAllowedAuthAlgorithms.set(AuthAlgorithm.SHARED);
+
+ params.mAllowedPairwiseCiphers.set(PairwiseCipher.CCMP);
+ params.mAllowedPairwiseCiphers.set(PairwiseCipher.TKIP);
+
+ params.mAllowedGroupCiphers.set(GroupCipher.CCMP);
+ params.mAllowedGroupCiphers.set(GroupCipher.TKIP);
+ params.mAllowedGroupCiphers.set(GroupCipher.WEP40);
+ params.mAllowedGroupCiphers.set(GroupCipher.WEP104);
+ return params;
+ }
+
+ /**
+ * Create WPA3 Enterprise 192-bit params.
+ */
+ public static @NonNull SecurityParams createWpa3Enterprise192BitParams() {
+ SecurityParams params = new SecurityParams();
+ params.mSecurityType = WifiConfiguration.SECURITY_TYPE_EAP_WPA3_ENTERPRISE_192_BIT;
+
+ params.mAllowedKeyManagement.set(KeyMgmt.WPA_EAP);
+ params.mAllowedKeyManagement.set(KeyMgmt.IEEE8021X);
+ params.mAllowedKeyManagement.set(KeyMgmt.SUITE_B_192);
+
+ params.mAllowedProtocols.set(Protocol.RSN);
+
+ params.mAllowedPairwiseCiphers.set(PairwiseCipher.GCMP_128);
+ params.mAllowedPairwiseCiphers.set(PairwiseCipher.GCMP_256);
+
+ params.mAllowedGroupCiphers.set(GroupCipher.GCMP_128);
+ params.mAllowedGroupCiphers.set(GroupCipher.GCMP_256);
+
+ params.mAllowedGroupManagementCiphers.set(GroupMgmtCipher.BIP_GMAC_256);
+
+ // Note: allowedSuiteBCiphers bitset will be set by the service once the
+ // certificates are attached to this profile
+
+ params.mRequirePmf = true;
+ return params;
+ }
+
+ /**
+ * Create WPA3 Enterprise params.
+ */
+ public static @NonNull SecurityParams createWpa3EnterpriseParams() {
+ SecurityParams params = new SecurityParams();
+ params.mSecurityType = WifiConfiguration.SECURITY_TYPE_EAP_WPA3_ENTERPRISE;
+
+ params.mAllowedKeyManagement.set(KeyMgmt.WPA_EAP);
+ params.mAllowedKeyManagement.set(KeyMgmt.IEEE8021X);
+
+ params.mAllowedProtocols.set(Protocol.RSN);
+
+ params.mAllowedPairwiseCiphers.set(PairwiseCipher.CCMP);
+ params.mAllowedPairwiseCiphers.set(PairwiseCipher.GCMP_256);
+
+ params.mAllowedGroupCiphers.set(GroupCipher.CCMP);
+ params.mAllowedGroupCiphers.set(GroupCipher.GCMP_256);
+
+ params.mRequirePmf = true;
+ return params;
+ }
+
+ /**
+ * Create WPA3 Personal params.
+ */
+ public static @NonNull SecurityParams createWpa3PersonalParams() {
+ SecurityParams params = new SecurityParams();
+ params.mSecurityType = WifiConfiguration.SECURITY_TYPE_SAE;
+
+ params.mAllowedKeyManagement.set(KeyMgmt.SAE);
+
+ params.mAllowedProtocols.set(Protocol.RSN);
+
+ params.mAllowedPairwiseCiphers.set(PairwiseCipher.CCMP);
+ params.mAllowedPairwiseCiphers.set(PairwiseCipher.GCMP_128);
+ params.mAllowedPairwiseCiphers.set(PairwiseCipher.GCMP_256);
+
+ params.mAllowedGroupCiphers.set(GroupCipher.CCMP);
+ params.mAllowedGroupCiphers.set(GroupCipher.GCMP_128);
+ params.mAllowedGroupCiphers.set(GroupCipher.GCMP_256);
+
+ params.mRequirePmf = true;
+ return params;
+ }
+
+ /**
+ * Create WPA/WPA2 Personal params.
+ */
+ public static @NonNull SecurityParams createWpaWpa2PersonalParams() {
+ SecurityParams params = new SecurityParams();
+ params.mSecurityType = WifiConfiguration.SECURITY_TYPE_PSK;
+
+ params.mAllowedKeyManagement.set(KeyMgmt.WPA_PSK);
+
+ params.mAllowedProtocols.set(Protocol.RSN);
+ params.mAllowedProtocols.set(Protocol.WPA);
+
+ params.mAllowedPairwiseCiphers.set(PairwiseCipher.CCMP);
+ params.mAllowedPairwiseCiphers.set(PairwiseCipher.TKIP);
+
+ params.mAllowedGroupCiphers.set(GroupCipher.CCMP);
+ params.mAllowedGroupCiphers.set(GroupCipher.TKIP);
+ params.mAllowedGroupCiphers.set(GroupCipher.WEP40);
+ params.mAllowedGroupCiphers.set(GroupCipher.WEP104);
+ return params;
+ }
+}
diff --git a/wifi/java/android/net/wifi/SoftApCapability.java b/wifi/java/android/net/wifi/SoftApCapability.java
index d570b7e8afa9..6f72f0b58b4b 100644
--- a/wifi/java/android/net/wifi/SoftApCapability.java
+++ b/wifi/java/android/net/wifi/SoftApCapability.java
@@ -116,6 +116,11 @@ public final class SoftApCapability implements Parcelable {
private int[] mSupportedChannelListIn6g = EMPTY_INT_ARRAY;
/**
+ * A list storing supported 60G channels.
+ */
+ private int[] mSupportedChannelListIn60g = EMPTY_INT_ARRAY;
+
+ /**
* Get the maximum supported client numbers which AP resides on.
*/
public int getMaxSupportedClients() {
@@ -147,8 +152,8 @@ public final class SoftApCapability implements Parcelable {
* Set supported channel list in target band type.
*
* @param band One of the following band types:
- * {@link SoftApConfiguation#BAND_2GHZ}, {@link SoftApConfiguation#BAND_5GHZ} or
- * {@link SoftApConfiguation#BAND_6GHZ}.
+ * {@link SoftApConfiguation#BAND_2GHZ}, {@link SoftApConfiguation#BAND_5GHZ},
+ * {@link SoftApConfiguation#BAND_6GHZ}, or {@link SoftApConfiguation#BAND_60GHZ}.
* @param supportedChannelList supported channel list in target band
* @return true if band and supportedChannelList are valid, otherwise false.
*
@@ -168,6 +173,9 @@ public final class SoftApCapability implements Parcelable {
case SoftApConfiguration.BAND_6GHZ:
mSupportedChannelListIn6g = supportedChannelList;
break;
+ case SoftApConfiguration.BAND_60GHZ:
+ mSupportedChannelListIn60g = supportedChannelList;
+ break;
default:
throw new IllegalArgumentException("Invalid band: " + band);
}
@@ -181,8 +189,8 @@ public final class SoftApCapability implements Parcelable {
* {@link SoftapConfiguration.Builder#setChannel(int, int)} API.
*
* @param band One of the following band types:
- * {@link SoftApConfiguation#BAND_2GHZ}, {@link SoftApConfiguation#BAND_5GHZ} or
- * {@link SoftApConfiguation#BAND_6GHZ}.
+ * {@link SoftApConfiguation#BAND_2GHZ}, {@link SoftApConfiguation#BAND_5GHZ},
+ * {@link SoftApConfiguation#BAND_6GHZ}, {@link SoftApConfiguation#BAND_60GHZ}.
* @return List of supported channels for the band.
*
* @throws IllegalArgumentException when band type is invalid.
@@ -199,6 +207,8 @@ public final class SoftApCapability implements Parcelable {
return mSupportedChannelListIn5g;
case SoftApConfiguration.BAND_6GHZ:
return mSupportedChannelListIn6g;
+ case SoftApConfiguration.BAND_60GHZ:
+ return mSupportedChannelListIn60g;
default:
throw new IllegalArgumentException("Invalid band: " + band);
}
@@ -214,6 +224,7 @@ public final class SoftApCapability implements Parcelable {
mSupportedChannelListIn24g = source.mSupportedChannelListIn24g;
mSupportedChannelListIn5g = source.mSupportedChannelListIn5g;
mSupportedChannelListIn6g = source.mSupportedChannelListIn6g;
+ mSupportedChannelListIn60g = source.mSupportedChannelListIn60g;
}
}
@@ -244,6 +255,7 @@ public final class SoftApCapability implements Parcelable {
dest.writeIntArray(mSupportedChannelListIn24g);
dest.writeIntArray(mSupportedChannelListIn5g);
dest.writeIntArray(mSupportedChannelListIn6g);
+ dest.writeIntArray(mSupportedChannelListIn60g);
}
@NonNull
@@ -255,6 +267,7 @@ public final class SoftApCapability implements Parcelable {
capability.setSupportedChannelList(SoftApConfiguration.BAND_2GHZ, in.createIntArray());
capability.setSupportedChannelList(SoftApConfiguration.BAND_5GHZ, in.createIntArray());
capability.setSupportedChannelList(SoftApConfiguration.BAND_6GHZ, in.createIntArray());
+ capability.setSupportedChannelList(SoftApConfiguration.BAND_60GHZ, in.createIntArray());
return capability;
}
@@ -273,6 +286,8 @@ public final class SoftApCapability implements Parcelable {
.append(Arrays.toString(mSupportedChannelListIn24g));
sbuf.append("SupportedChannelListIn5g").append(Arrays.toString(mSupportedChannelListIn5g));
sbuf.append("SupportedChannelListIn6g").append(Arrays.toString(mSupportedChannelListIn6g));
+ sbuf.append("SupportedChannelListIn60g")
+ .append(Arrays.toString(mSupportedChannelListIn60g));
return sbuf.toString();
}
@@ -285,7 +300,8 @@ public final class SoftApCapability implements Parcelable {
&& mMaximumSupportedClientNumber == capability.mMaximumSupportedClientNumber
&& Arrays.equals(mSupportedChannelListIn24g, capability.mSupportedChannelListIn24g)
&& Arrays.equals(mSupportedChannelListIn5g, capability.mSupportedChannelListIn5g)
- && Arrays.equals(mSupportedChannelListIn6g, capability.mSupportedChannelListIn6g);
+ && Arrays.equals(mSupportedChannelListIn6g, capability.mSupportedChannelListIn6g)
+ && Arrays.equals(mSupportedChannelListIn60g, capability.mSupportedChannelListIn60g);
}
@Override
@@ -293,6 +309,7 @@ public final class SoftApCapability implements Parcelable {
return Objects.hash(mSupportedFeatures, mMaximumSupportedClientNumber,
Arrays.hashCode(mSupportedChannelListIn24g),
Arrays.hashCode(mSupportedChannelListIn5g),
- Arrays.hashCode(mSupportedChannelListIn6g));
+ Arrays.hashCode(mSupportedChannelListIn6g),
+ Arrays.hashCode(mSupportedChannelListIn60g));
}
}
diff --git a/wifi/java/android/net/wifi/SoftApConfiguration.java b/wifi/java/android/net/wifi/SoftApConfiguration.java
index 1bb9ebccb01a..d36acb72ff8a 100644
--- a/wifi/java/android/net/wifi/SoftApConfiguration.java
+++ b/wifi/java/android/net/wifi/SoftApConfiguration.java
@@ -88,6 +88,13 @@ public final class SoftApConfiguration implements Parcelable {
public static final int BAND_6GHZ = 1 << 2;
/**
+ * 60GHz band.
+ * @hide
+ */
+ @SystemApi
+ public static final int BAND_60GHZ = 1 << 3;
+
+ /**
* Device is allowed to choose the optimal band (2Ghz, 5Ghz, 6Ghz) based on device capability,
* operating country code and current radio conditions.
* @hide
@@ -104,11 +111,13 @@ public final class SoftApConfiguration implements Parcelable {
BAND_2GHZ,
BAND_5GHZ,
BAND_6GHZ,
+ BAND_60GHZ,
})
public @interface BandType {}
private static boolean isBandValid(@BandType int band) {
- return ((band != 0) && ((band & ~BAND_ANY) == 0));
+ int bandAny = BAND_2GHZ | BAND_5GHZ | BAND_6GHZ | BAND_60GHZ;
+ return ((band != 0) && ((band & ~bandAny) == 0));
}
private static final int MIN_CH_2G_BAND = 1;
@@ -117,6 +126,8 @@ public final class SoftApConfiguration implements Parcelable {
private static final int MAX_CH_5G_BAND = 196;
private static final int MIN_CH_6G_BAND = 1;
private static final int MAX_CH_6G_BAND = 253;
+ private static final int MIN_CH_60G_BAND = 1;
+ private static final int MAX_CH_60G_BAND = 6;
@@ -139,6 +150,13 @@ public final class SoftApConfiguration implements Parcelable {
return false;
}
break;
+
+ case BAND_60GHZ:
+ if (channel < MIN_CH_60G_BAND || channel > MAX_CH_60G_BAND) {
+ return false;
+ }
+ break;
+
default:
return false;
}
diff --git a/wifi/java/android/net/wifi/SoftApInfo.java b/wifi/java/android/net/wifi/SoftApInfo.java
index 9a16facfec26..e42e7868e944 100644
--- a/wifi/java/android/net/wifi/SoftApInfo.java
+++ b/wifi/java/android/net/wifi/SoftApInfo.java
@@ -86,6 +86,34 @@ public final class SoftApInfo implements Parcelable {
*/
public static final int CHANNEL_WIDTH_160MHZ = 6;
+ /**
+ * AP Channel bandwidth is 2160 MHZ.
+ *
+ * @see #getBandwidth()
+ */
+ public static final int CHANNEL_WIDTH_2160MHZ = 7;
+
+ /**
+ * AP Channel bandwidth is 4320 MHZ.
+ *
+ * @see #getBandwidth()
+ */
+ public static final int CHANNEL_WIDTH_4320MHZ = 8;
+
+ /**
+ * AP Channel bandwidth is 6480 MHZ.
+ *
+ * @see #getBandwidth()
+ */
+ public static final int CHANNEL_WIDTH_6480MHZ = 9;
+
+ /**
+ * AP Channel bandwidth is 8640 MHZ.
+ *
+ * @see #getBandwidth()
+ */
+ public static final int CHANNEL_WIDTH_8640MHZ = 10;
+
/** The frequency which AP resides on. */
private int mFrequency = 0;
@@ -96,6 +124,10 @@ public final class SoftApInfo implements Parcelable {
@Nullable
private MacAddress mBssid;
+ /** The identifier of the AP instance which AP resides on with current info. */
+ @Nullable
+ private String mApInstanceIdentifier;
+
/**
* The operational mode of the AP.
*/
@@ -121,7 +153,9 @@ public final class SoftApInfo implements Parcelable {
*
* @return One of {@link #CHANNEL_WIDTH_20MHZ}, {@link #CHANNEL_WIDTH_40MHZ},
* {@link #CHANNEL_WIDTH_80MHZ}, {@link #CHANNEL_WIDTH_160MHZ},
- * {@link #CHANNEL_WIDTH_80MHZ_PLUS_MHZ} or {@link #CHANNEL_WIDTH_INVALID}.
+ * {@link #CHANNEL_WIDTH_80MHZ_PLUS_MHZ}, {@link #CHANNEL_WIDTH_2160MHZ},
+ * {@link #CHANNEL_WIDTH_4320MHZ}, {@link #CHANNEL_WIDTH_6480MHZ},
+ * {@link #CHANNEL_WIDTH_8640MHZ}, or {@link #CHANNEL_WIDTH_INVALID}.
*/
@WifiAnnotations.Bandwidth
public int getBandwidth() {
@@ -187,6 +221,28 @@ public final class SoftApInfo implements Parcelable {
}
/**
+ * Set the AP instance identifier.
+ * @hide
+ */
+ public void setApInstanceIdentifier(@NonNull String apInstanceIdentifier) {
+ mApInstanceIdentifier = apInstanceIdentifier;
+ }
+
+ /**
+ * Get the AP instance identifier.
+ *
+ * The AP instance identifier is a unique identity which can be used to
+ * associate the {@link SoftApInfo} to a specific {@link WifiClient}
+ * - see {@link WifiClient#getApInstanceIdentifier()}
+ *
+ * @hide
+ */
+ @Nullable
+ public String getApInstanceIdentifier() {
+ return mApInstanceIdentifier;
+ }
+
+ /**
* @hide
*/
public SoftApInfo(@Nullable SoftApInfo source) {
@@ -195,6 +251,7 @@ public final class SoftApInfo implements Parcelable {
mBandwidth = source.mBandwidth;
mBssid = source.mBssid;
mWifiStandard = source.mWifiStandard;
+ mApInstanceIdentifier = source.mApInstanceIdentifier;
}
}
@@ -217,6 +274,7 @@ public final class SoftApInfo implements Parcelable {
dest.writeInt(mBandwidth);
dest.writeParcelable(mBssid, flags);
dest.writeInt(mWifiStandard);
+ dest.writeString(mApInstanceIdentifier);
}
@NonNull
@@ -228,6 +286,7 @@ public final class SoftApInfo implements Parcelable {
info.mBandwidth = in.readInt();
info.mBssid = in.readParcelable(MacAddress.class.getClassLoader());
info.mWifiStandard = in.readInt();
+ info.mApInstanceIdentifier = in.readString();
return info;
}
@@ -245,6 +304,7 @@ public final class SoftApInfo implements Parcelable {
sbuf.append(", frequency= ").append(mFrequency);
if (mBssid != null) sbuf.append(",bssid=").append(mBssid.toString());
sbuf.append(", wifiStandard= ").append(mWifiStandard);
+ sbuf.append(", mApInstanceIdentifier= ").append(mApInstanceIdentifier);
sbuf.append("}");
return sbuf.toString();
}
@@ -257,11 +317,12 @@ public final class SoftApInfo implements Parcelable {
return mFrequency == softApInfo.mFrequency
&& mBandwidth == softApInfo.mBandwidth
&& Objects.equals(mBssid, softApInfo.mBssid)
- && mWifiStandard == softApInfo.mWifiStandard;
+ && mWifiStandard == softApInfo.mWifiStandard
+ && Objects.equals(mApInstanceIdentifier, softApInfo.mApInstanceIdentifier);
}
@Override
public int hashCode() {
- return Objects.hash(mFrequency, mBandwidth, mBssid, mWifiStandard);
+ return Objects.hash(mFrequency, mBandwidth, mBssid, mWifiStandard, mApInstanceIdentifier);
}
}
diff --git a/wifi/java/android/net/wifi/WifiAnnotations.java b/wifi/java/android/net/wifi/WifiAnnotations.java
index acda7e06c95d..807b40b5722c 100644
--- a/wifi/java/android/net/wifi/WifiAnnotations.java
+++ b/wifi/java/android/net/wifi/WifiAnnotations.java
@@ -57,6 +57,10 @@ public final class WifiAnnotations {
SoftApInfo.CHANNEL_WIDTH_80MHZ,
SoftApInfo.CHANNEL_WIDTH_80MHZ_PLUS_MHZ,
SoftApInfo.CHANNEL_WIDTH_160MHZ,
+ SoftApInfo.CHANNEL_WIDTH_2160MHZ,
+ SoftApInfo.CHANNEL_WIDTH_4320MHZ,
+ SoftApInfo.CHANNEL_WIDTH_6480MHZ,
+ SoftApInfo.CHANNEL_WIDTH_8640MHZ,
})
@Retention(RetentionPolicy.SOURCE)
public @interface Bandwidth {}
@@ -77,6 +81,7 @@ public final class WifiAnnotations {
ScanResult.WIFI_STANDARD_11N,
ScanResult.WIFI_STANDARD_11AC,
ScanResult.WIFI_STANDARD_11AX,
+ ScanResult.WIFI_STANDARD_11AD,
})
@Retention(RetentionPolicy.SOURCE)
public @interface WifiStandard{}
diff --git a/wifi/java/android/net/wifi/WifiClient.java b/wifi/java/android/net/wifi/WifiClient.java
index 3794566f3d8f..85e2b3312b29 100644
--- a/wifi/java/android/net/wifi/WifiClient.java
+++ b/wifi/java/android/net/wifi/WifiClient.java
@@ -30,6 +30,9 @@ public final class WifiClient implements Parcelable {
private final MacAddress mMacAddress;
+ /** The identifier of the AP instance which the client connected. */
+ private final String mApInstanceIdentifier;
+
/**
* The mac address of this client.
*/
@@ -38,15 +41,30 @@ public final class WifiClient implements Parcelable {
return mMacAddress;
}
+ /**
+ * Get AP instance identifier.
+ *
+ * The AP instance identifier is a unique identity which can be used to
+ * associate the {@link SoftApInfo} to a specific {@link WifiClient}
+ * - see {@link SoftApInfo#getApInstanceIdentifier()}
+ * @hide
+ */
+ @NonNull
+ public String getApInstanceIdentifier() {
+ return mApInstanceIdentifier;
+ }
+
private WifiClient(Parcel in) {
mMacAddress = in.readParcelable(null);
+ mApInstanceIdentifier = in.readString();
}
/** @hide */
- public WifiClient(@NonNull MacAddress macAddress) {
+ public WifiClient(@NonNull MacAddress macAddress, @NonNull String apInstanceIdentifier) {
Objects.requireNonNull(macAddress, "mMacAddress must not be null.");
this.mMacAddress = macAddress;
+ this.mApInstanceIdentifier = apInstanceIdentifier;
}
@Override
@@ -57,6 +75,7 @@ public final class WifiClient implements Parcelable {
@Override
public void writeToParcel(@NonNull Parcel dest, int flags) {
dest.writeParcelable(mMacAddress, flags);
+ dest.writeString(mApInstanceIdentifier);
}
@NonNull
@@ -75,6 +94,7 @@ public final class WifiClient implements Parcelable {
public String toString() {
return "WifiClient{"
+ "mMacAddress=" + mMacAddress
+ + "mApInstanceIdentifier=" + mApInstanceIdentifier
+ '}';
}
@@ -83,13 +103,12 @@ public final class WifiClient implements Parcelable {
if (this == o) return true;
if (!(o instanceof WifiClient)) return false;
WifiClient client = (WifiClient) o;
- return mMacAddress.equals(client.mMacAddress);
+ return Objects.equals(mMacAddress, client.mMacAddress)
+ && mApInstanceIdentifier.equals(client.mApInstanceIdentifier);
}
@Override
public int hashCode() {
- return Objects.hash(mMacAddress);
+ return Objects.hash(mMacAddress, mApInstanceIdentifier);
}
}
-
-
diff --git a/wifi/java/android/net/wifi/WifiConfiguration.java b/wifi/java/android/net/wifi/WifiConfiguration.java
index 271a73943425..2a98977fc08e 100644
--- a/wifi/java/android/net/wifi/WifiConfiguration.java
+++ b/wifi/java/android/net/wifi/WifiConfiguration.java
@@ -19,6 +19,7 @@ package android.net.wifi;
import android.annotation.IntDef;
import android.annotation.NonNull;
import android.annotation.Nullable;
+import android.annotation.SuppressLint;
import android.annotation.SystemApi;
import android.compat.annotation.UnsupportedAppUsage;
import android.content.pm.PackageManager;
@@ -46,10 +47,13 @@ import com.android.net.module.util.MacAddressUtils;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
+import java.util.ArrayList;
import java.util.Arrays;
import java.util.BitSet;
import java.util.Calendar;
+import java.util.Collections;
import java.util.HashMap;
+import java.util.List;
/**
* A class representing a configured Wi-Fi network, including the
@@ -250,6 +254,11 @@ public class WifiConfiguration implements Parcelable {
*/
public static final int WAPI = 3;
+ /** @hide */
+ @Retention(RetentionPolicy.SOURCE)
+ @IntDef(value = {WPA, RSN, OSEN, WAPI})
+ public @interface ProtocolScheme {};
+
public static final String varName = "proto";
public static final String[] strings = { "WPA", "RSN", "OSEN", "WAPI" };
@@ -274,6 +283,11 @@ public class WifiConfiguration implements Parcelable {
/** SAE (Used only for WPA3-Personal) */
public static final int SAE = 3;
+ /** @hide */
+ @Retention(RetentionPolicy.SOURCE)
+ @IntDef(value = {OPEN, SHARED, LEAP, SAE})
+ public @interface AuthAlgorithmScheme {};
+
public static final String varName = "auth_alg";
public static final String[] strings = { "OPEN", "SHARED", "LEAP", "SAE" };
@@ -308,6 +322,10 @@ public class WifiConfiguration implements Parcelable {
*/
public static final int GCMP_128 = 5;
+ /** @hide */
+ @Retention(RetentionPolicy.SOURCE)
+ @IntDef(value = {NONE, TKIP, CCMP, GCMP_256, SMS4, GCMP_128})
+ public @interface PairwiseCipherScheme {};
public static final String varName = "pairwise";
@@ -359,6 +377,11 @@ public class WifiConfiguration implements Parcelable {
*/
public static final int GCMP_128 = 7;
+ /** @hide */
+ @Retention(RetentionPolicy.SOURCE)
+ @IntDef(value = {WEP40, WEP104, TKIP, CCMP, GTK_NOT_USED, GCMP_256, SMS4, GCMP_128})
+ public @interface GroupCipherScheme {};
+
public static final String varName = "group";
public static final String[] strings =
@@ -387,9 +410,16 @@ public class WifiConfiguration implements Parcelable {
/** GMAC-256 = Galois Message Authentication Code */
public static final int BIP_GMAC_256 = 2;
+ /** @hide */
+ @Retention(RetentionPolicy.SOURCE)
+ @IntDef(value = {BIP_CMAC_256, BIP_GMAC_128, BIP_GMAC_256})
+ public @interface GroupMgmtCipherScheme {};
+
private static final String varName = "groupMgmt";
- private static final String[] strings = { "BIP_CMAC_256",
+ /** @hide */
+ @SuppressLint("AllUpper")
+ public static final @NonNull String[] strings = { "BIP_CMAC_256",
"BIP_GMAC_128", "BIP_GMAC_256"};
}
@@ -410,9 +440,16 @@ public class WifiConfiguration implements Parcelable {
/** Diffie-Hellman with_RSA signature */
public static final int ECDHE_RSA = 1;
+ /** @hide */
+ @Retention(RetentionPolicy.SOURCE)
+ @IntDef(value = {ECDHE_ECDSA, ECDHE_RSA})
+ public @interface SuiteBCipherScheme {};
+
private static final String varName = "SuiteB";
- private static final String[] strings = { "ECDHE_ECDSA", "ECDHE_RSA" };
+ /** @hide */
+ @SuppressLint("AllUpper")
+ public static final String[] strings = { "ECDHE_ECDSA", "ECDHE_RSA" };
}
/** Possible status of a network configuration. */
@@ -460,6 +497,25 @@ public class WifiConfiguration implements Parcelable {
public static final int SECURITY_TYPE_WAPI_CERT = 8;
/** Security type for a WPA3-Enterprise network. */
public static final int SECURITY_TYPE_EAP_WPA3_ENTERPRISE = 9;
+ /**
+ * Security type for an OSEN network.
+ * @hide
+ */
+ public static final int SECURITY_TYPE_OSEN = 10;
+ /**
+ * Security type for a Passpoint R1/R2 network.
+ * Passpoint R1/R2 uses Enterprise security, where TKIP and WEP are not allowed.
+ * @hide
+ */
+ public static final int SECURITY_TYPE_PASSPOINT_R1_R2 = 11;
+
+ /**
+ * Security type for a Passpoint R3 network.
+ * Passpoint R3 uses Enterprise security, where TKIP and WEP are not allowed,
+ * and PMF must be set to Required.
+ * @hide
+ */
+ public static final int SECURITY_TYPE_PASSPOINT_R3 = 12;
/**
* Security types we support.
@@ -478,12 +534,23 @@ public class WifiConfiguration implements Parcelable {
SECURITY_TYPE_WAPI_CERT,
SECURITY_TYPE_EAP_WPA3_ENTERPRISE,
SECURITY_TYPE_EAP_WPA3_ENTERPRISE_192_BIT,
+ SECURITY_TYPE_PASSPOINT_R1_R2,
+ SECURITY_TYPE_PASSPOINT_R3,
})
public @interface SecurityType {}
+ private List<SecurityParams> mSecurityParamsList = new ArrayList<>();
+
+ private void updateLegacySecurityParams() {
+ if (mSecurityParamsList.isEmpty()) return;
+ mSecurityParamsList.get(0).updateLegacyWifiConfiguration(this);
+ }
+
/**
* Set the various security params to correspond to the provided security type.
* This is accomplished by setting the various BitSets exposed in WifiConfiguration.
+ * <br>
+ * This API would clear existing security types and add a default one.
*
* @param securityType One of the following security types:
* {@link #SECURITY_TYPE_OPEN},
@@ -491,103 +558,358 @@ public class WifiConfiguration implements Parcelable {
* {@link #SECURITY_TYPE_PSK},
* {@link #SECURITY_TYPE_EAP},
* {@link #SECURITY_TYPE_SAE},
- * {@link #SECURITY_TYPE_EAP_SUITE_B},
* {@link #SECURITY_TYPE_OWE},
* {@link #SECURITY_TYPE_WAPI_PSK},
* {@link #SECURITY_TYPE_WAPI_CERT},
* {@link #SECURITY_TYPE_EAP_WPA3_ENTERPRISE},
- * {@link #SECURITY_TYPE_EAP_WPA3_ENTERPRISE_192_BIT}
+ * {@link #SECURITY_TYPE_EAP_WPA3_ENTERPRISE_192_BIT},
*/
public void setSecurityParams(@SecurityType int securityType) {
- // Clear all the bitsets.
- allowedKeyManagement.clear();
- allowedProtocols.clear();
- allowedAuthAlgorithms.clear();
- allowedPairwiseCiphers.clear();
- allowedGroupCiphers.clear();
- allowedGroupManagementCiphers.clear();
- allowedSuiteBCiphers.clear();
+ // Clear existing data.
+ mSecurityParamsList = new ArrayList<>();
+ addSecurityParams(securityType);
+ }
+ /**
+ * Add the various security params.
+ * <br>
+ * This API would clear existing security types and add a default one.
+ * @hide
+ */
+ public void setSecurityParams(SecurityParams params) {
+ // Clear existing data.
+ mSecurityParamsList = new ArrayList<>();
+ addSecurityParams(params);
+ }
+
+ /**
+ * Add the various security params to correspond to the provided security type.
+ * This is accomplished by setting the various BitSets exposed in WifiConfiguration.
+ *
+ * @param securityType One of the following security types:
+ * {@link #SECURITY_TYPE_OPEN},
+ * {@link #SECURITY_TYPE_WEP},
+ * {@link #SECURITY_TYPE_PSK},
+ * {@link #SECURITY_TYPE_EAP},
+ * {@link #SECURITY_TYPE_SAE},
+ * {@link #SECURITY_TYPE_OWE},
+ * {@link #SECURITY_TYPE_WAPI_PSK},
+ * {@link #SECURITY_TYPE_WAPI_CERT},
+ * {@link #SECURITY_TYPE_EAP_WPA3_ENTERPRISE},
+ * {@link #SECURITY_TYPE_EAP_WPA3_ENTERPRISE_192_BIT},
+ *
+ * @hide
+ */
+ public void addSecurityParams(@SecurityType int securityType) {
+ // This ensures that there won't be duplicate security types.
+ if (mSecurityParamsList.stream().anyMatch(params -> params.isSecurityType(securityType))) {
+ throw new IllegalArgumentException("duplicate security type " + securityType);
+ }
+ SecurityParams params = null;
switch (securityType) {
case SECURITY_TYPE_OPEN:
- allowedKeyManagement.set(WifiConfiguration.KeyMgmt.NONE);
+ params = SecurityParams.createOpenParams();
break;
case SECURITY_TYPE_WEP:
- allowedKeyManagement.set(WifiConfiguration.KeyMgmt.NONE);
- allowedAuthAlgorithms.set(WifiConfiguration.AuthAlgorithm.OPEN);
- allowedAuthAlgorithms.set(WifiConfiguration.AuthAlgorithm.SHARED);
+ params = SecurityParams.createWepParams();
break;
case SECURITY_TYPE_PSK:
- allowedKeyManagement.set(WifiConfiguration.KeyMgmt.WPA_PSK);
+ params = SecurityParams.createWpaWpa2PersonalParams();
break;
case SECURITY_TYPE_EAP:
- allowedKeyManagement.set(WifiConfiguration.KeyMgmt.WPA_EAP);
- allowedKeyManagement.set(WifiConfiguration.KeyMgmt.IEEE8021X);
+ params = SecurityParams.createWpaWpa2EnterpriseParams();
break;
case SECURITY_TYPE_SAE:
- allowedProtocols.set(WifiConfiguration.Protocol.RSN);
- allowedKeyManagement.set(WifiConfiguration.KeyMgmt.SAE);
- allowedPairwiseCiphers.set(WifiConfiguration.PairwiseCipher.CCMP);
- allowedPairwiseCiphers.set(WifiConfiguration.PairwiseCipher.GCMP_128);
- allowedPairwiseCiphers.set(WifiConfiguration.PairwiseCipher.GCMP_256);
- allowedGroupCiphers.set(WifiConfiguration.GroupCipher.CCMP);
- allowedGroupCiphers.set(WifiConfiguration.GroupCipher.GCMP_128);
- allowedGroupCiphers.set(WifiConfiguration.GroupCipher.GCMP_256);
- requirePmf = true;
+ params = SecurityParams.createWpa3PersonalParams();
break;
// The value of {@link SECURITY_TYPE_EAP_SUITE_B} is the same as
- // {@link SECURITY_TYPE_EAP_WPA3_ENTERPRISE_192_BIT}, remove it to avoid
+ // {@link #SECURITY_TYPE_EAP_WPA3_ENTERPRISE_192_BIT}, remove it to avoid
// duplicate case label errors.
case SECURITY_TYPE_EAP_WPA3_ENTERPRISE_192_BIT:
- allowedProtocols.set(WifiConfiguration.Protocol.RSN);
- allowedKeyManagement.set(WifiConfiguration.KeyMgmt.WPA_EAP);
- allowedKeyManagement.set(WifiConfiguration.KeyMgmt.IEEE8021X);
- allowedKeyManagement.set(WifiConfiguration.KeyMgmt.SUITE_B_192);
- allowedPairwiseCiphers.set(WifiConfiguration.PairwiseCipher.GCMP_128);
- allowedPairwiseCiphers.set(WifiConfiguration.PairwiseCipher.GCMP_256);
- allowedGroupCiphers.set(WifiConfiguration.GroupCipher.GCMP_128);
- allowedGroupCiphers.set(WifiConfiguration.GroupCipher.GCMP_256);
- allowedGroupManagementCiphers.set(WifiConfiguration.GroupMgmtCipher.BIP_GMAC_256);
- // Note: allowedSuiteBCiphers bitset will be set by the service once the
- // certificates are attached to this profile
- requirePmf = true;
+ params = SecurityParams.createWpa3Enterprise192BitParams();
break;
case SECURITY_TYPE_OWE:
- allowedProtocols.set(WifiConfiguration.Protocol.RSN);
- allowedKeyManagement.set(WifiConfiguration.KeyMgmt.OWE);
- allowedPairwiseCiphers.set(WifiConfiguration.PairwiseCipher.CCMP);
- allowedPairwiseCiphers.set(WifiConfiguration.PairwiseCipher.GCMP_128);
- allowedPairwiseCiphers.set(WifiConfiguration.PairwiseCipher.GCMP_256);
- allowedGroupCiphers.set(WifiConfiguration.GroupCipher.CCMP);
- allowedGroupCiphers.set(WifiConfiguration.GroupCipher.GCMP_128);
- allowedGroupCiphers.set(WifiConfiguration.GroupCipher.GCMP_256);
- requirePmf = true;
+ params = SecurityParams.createEnhancedOpenParams();
break;
case SECURITY_TYPE_WAPI_PSK:
- allowedKeyManagement.set(WifiConfiguration.KeyMgmt.WAPI_PSK);
- allowedProtocols.set(WifiConfiguration.Protocol.WAPI);
- allowedPairwiseCiphers.set(WifiConfiguration.PairwiseCipher.SMS4);
- allowedGroupCiphers.set(WifiConfiguration.GroupCipher.SMS4);
+ params = SecurityParams.createWapiPskParams();
break;
case SECURITY_TYPE_WAPI_CERT:
- allowedKeyManagement.set(WifiConfiguration.KeyMgmt.WAPI_CERT);
- allowedProtocols.set(WifiConfiguration.Protocol.WAPI);
- allowedPairwiseCiphers.set(WifiConfiguration.PairwiseCipher.SMS4);
- allowedGroupCiphers.set(WifiConfiguration.GroupCipher.SMS4);
+ params = SecurityParams.createWapiCertParams();
break;
case SECURITY_TYPE_EAP_WPA3_ENTERPRISE:
- allowedKeyManagement.set(WifiConfiguration.KeyMgmt.WPA_EAP);
- allowedKeyManagement.set(WifiConfiguration.KeyMgmt.IEEE8021X);
- allowedProtocols.set(WifiConfiguration.Protocol.RSN);
- allowedPairwiseCiphers.set(WifiConfiguration.PairwiseCipher.CCMP);
- allowedPairwiseCiphers.set(WifiConfiguration.PairwiseCipher.GCMP_256);
- allowedGroupCiphers.set(WifiConfiguration.GroupCipher.CCMP);
- allowedGroupCiphers.set(WifiConfiguration.GroupCipher.GCMP_256);
- requirePmf = true;
+ params = SecurityParams.createWpa3EnterpriseParams();
+ break;
+ case SECURITY_TYPE_OSEN:
+ params = SecurityParams.createOsenParams();
+ break;
+ case SECURITY_TYPE_PASSPOINT_R1_R2:
+ params = SecurityParams.createPasspointParams(SecurityParams.PASSPOINT_R2);
+ break;
+ case SECURITY_TYPE_PASSPOINT_R3:
+ params = SecurityParams.createPasspointParams(SecurityParams.PASSPOINT_R3);
break;
default:
throw new IllegalArgumentException("unknown security type " + securityType);
}
+
+ addSecurityParams(params);
+ }
+
+ /** @hide */
+ public void addSecurityParams(@NonNull SecurityParams newParams) {
+ if (mSecurityParamsList.stream().anyMatch(params -> params.isSameSecurityType(newParams))) {
+ throw new IllegalArgumentException("duplicate security params " + newParams);
+ }
+ if (!mSecurityParamsList.isEmpty()) {
+ if (newParams.isEnterpriseSecurityType() && !isEnterprise()) {
+ throw new IllegalArgumentException(
+ "An enterprise security type cannot be added to a personal configuation.");
+ }
+ if (!newParams.isEnterpriseSecurityType() && isEnterprise()) {
+ throw new IllegalArgumentException(
+ "A personal security type cannot be added to an enterprise configuation.");
+ }
+ if (newParams.isOpenSecurityType() && !isOpenNetwork()) {
+ throw new IllegalArgumentException(
+ "An open security type cannot be added to a non-open configuation.");
+ }
+ if (!newParams.isOpenSecurityType() && isOpenNetwork()) {
+ throw new IllegalArgumentException(
+ "A non-open security type cannot be added to an open configuation.");
+ }
+ if (newParams.isSecurityType(SECURITY_TYPE_OSEN)) {
+ throw new IllegalArgumentException(
+ "An OSEN security type must be the only one type.");
+ }
+ }
+ mSecurityParamsList.add(new SecurityParams(newParams));
+ updateLegacySecurityParams();
+ }
+
+ /**
+ * If there is no security params, generate one according to legacy fields.
+ * @hide
+ */
+ public void convertLegacyFieldsToSecurityParamsIfNeeded() {
+ if (!mSecurityParamsList.isEmpty()) return;
+
+ if (allowedKeyManagement.get(KeyMgmt.WAPI_CERT)) {
+ setSecurityParams(SECURITY_TYPE_WAPI_CERT);
+ } else if (allowedKeyManagement.get(KeyMgmt.WAPI_PSK)) {
+ setSecurityParams(SECURITY_TYPE_WAPI_PSK);
+ } else if (allowedKeyManagement.get(KeyMgmt.SUITE_B_192)) {
+ setSecurityParams(SECURITY_TYPE_EAP_WPA3_ENTERPRISE_192_BIT);
+ } else if (allowedKeyManagement.get(KeyMgmt.OWE)) {
+ setSecurityParams(SECURITY_TYPE_OWE);
+ } else if (allowedKeyManagement.get(KeyMgmt.SAE)) {
+ setSecurityParams(SECURITY_TYPE_SAE);
+ } else if (allowedKeyManagement.get(KeyMgmt.OSEN)) {
+ setSecurityParams(SECURITY_TYPE_OSEN);
+ } else if (allowedKeyManagement.get(KeyMgmt.WPA2_PSK)) {
+ setSecurityParams(SECURITY_TYPE_PSK);
+ } else if (allowedKeyManagement.get(KeyMgmt.WPA_EAP)) {
+ if (requirePmf) {
+ setSecurityParams(SECURITY_TYPE_EAP_WPA3_ENTERPRISE);
+ } else {
+ setSecurityParams(SECURITY_TYPE_EAP);
+ }
+ } else if (allowedKeyManagement.get(KeyMgmt.WPA_PSK)) {
+ setSecurityParams(SECURITY_TYPE_PSK);
+ } else if (allowedKeyManagement.get(KeyMgmt.NONE)) {
+ if (hasWepKeys()) {
+ setSecurityParams(SECURITY_TYPE_WEP);
+ } else {
+ setSecurityParams(SECURITY_TYPE_OPEN);
+ }
+ } else {
+ setSecurityParams(SECURITY_TYPE_OPEN);
+ }
+ }
+
+ /**
+ * Disable the various security params to correspond to the provided security type.
+ * This is accomplished by setting the various BitSets exposed in WifiConfiguration.
+ *
+ * @param securityType One of the following security types:
+ * {@link #SECURITY_TYPE_OPEN},
+ * {@link #SECURITY_TYPE_WEP},
+ * {@link #SECURITY_TYPE_PSK},
+ * {@link #SECURITY_TYPE_EAP},
+ * {@link #SECURITY_TYPE_SAE},
+ * {@link #SECURITY_TYPE_OWE},
+ * {@link #SECURITY_TYPE_WAPI_PSK},
+ * {@link #SECURITY_TYPE_WAPI_CERT},
+ * {@link #SECURITY_TYPE_EAP_WPA3_ENTERPRISE},
+ * {@link #SECURITY_TYPE_EAP_WPA3_ENTERPRISE_192_BIT},
+ *
+ * @hide
+ */
+ public void setSecurityParamsEnabled(@SecurityType int securityType, boolean enable) {
+ mSecurityParamsList.stream()
+ .filter(params -> params.isSecurityType(securityType))
+ .findAny()
+ .ifPresent(params -> params.setEnabled(enable));
+ }
+
+ /**
+ * Get the specific security param.
+ *
+ * @param securityType One of the following security types:
+ * {@link #SECURITY_TYPE_OPEN},
+ * {@link #SECURITY_TYPE_WEP},
+ * {@link #SECURITY_TYPE_PSK},
+ * {@link #SECURITY_TYPE_EAP},
+ * {@link #SECURITY_TYPE_SAE},
+ * {@link #SECURITY_TYPE_OWE},
+ * {@link #SECURITY_TYPE_WAPI_PSK},
+ * {@link #SECURITY_TYPE_WAPI_CERT},
+ * {@link #SECURITY_TYPE_EAP_WPA3_ENTERPRISE},
+ * {@link #SECURITY_TYPE_EAP_WPA3_ENTERPRISE_192_BIT},
+ *
+ * @return the copy of specific security params if found; otherwise null.
+ * @hide
+ */
+ public @Nullable SecurityParams getSecurityParams(@SecurityType int securityType) {
+ SecurityParams p = mSecurityParamsList.stream()
+ .filter(params -> params.isSecurityType(securityType))
+ .findAny()
+ .orElse(null);
+ return (p != null) ? new SecurityParams(p) : null;
+ }
+
+ /**
+ * Indicate whether this configuration is the specific security type.
+ *
+ * @param securityType One of the following security types:
+ * {@link #SECURITY_TYPE_OPEN},
+ * {@link #SECURITY_TYPE_WEP},
+ * {@link #SECURITY_TYPE_PSK},
+ * {@link #SECURITY_TYPE_EAP},
+ * {@link #SECURITY_TYPE_SAE},
+ * {@link #SECURITY_TYPE_OWE},
+ * {@link #SECURITY_TYPE_WAPI_PSK},
+ * {@link #SECURITY_TYPE_WAPI_CERT},
+ * {@link #SECURITY_TYPE_EAP_WPA3_ENTERPRISE},
+ * {@link #SECURITY_TYPE_EAP_WPA3_ENTERPRISE_192_BIT},
+ *
+ * @return true if there is a security params matches the type.
+ * @hide
+ */
+ public boolean isSecurityType(@SecurityType int securityType) {
+ return mSecurityParamsList.stream()
+ .anyMatch(params -> params.isSecurityType(securityType));
+ }
+
+ /**
+ * Get the security params list of this configuration.
+ *
+ * The returning list is a priority list, the first is the lowest priority and default one.
+ *
+ * @return this list of security params.
+ * @hide
+ */
+ public List<SecurityParams> getSecurityParamsList() {
+ return Collections.unmodifiableList(mSecurityParamsList);
+ }
+
+ /**
+ * Enable the support of Fast Initial Link Set-up (FILS).
+ *
+ * FILS can be applied to all security types.
+ * @param enableFilsSha256 Enable FILS SHA256.
+ * @param enableFilsSha384 Enable FILS SHA256.
+ * @hide
+ */
+ public void enableFils(boolean enableFilsSha256, boolean enableFilsSha384) {
+ mSecurityParamsList.stream()
+ .forEach(params -> params.enableFils(enableFilsSha256, enableFilsSha384));
+ updateLegacySecurityParams();
+ }
+
+ /**
+ * Indicate FILS SHA256 is enabled.
+ *
+ * @return true if FILS SHA256 is enabled.
+ * @hide
+ */
+ public boolean isFilsSha256Enabled() {
+ return mSecurityParamsList.stream()
+ .anyMatch(params -> params.getAllowedKeyManagement().get(KeyMgmt.FILS_SHA256));
+ }
+
+ /**
+ * Indicate FILS SHA384 is enabled.
+ *
+ * @return true if FILS SHA384 is enabled.
+ * @hide
+ */
+ public boolean isFilsSha384Enabled() {
+ return mSecurityParamsList.stream()
+ .anyMatch(params -> params.getAllowedKeyManagement().get(KeyMgmt.FILS_SHA384));
+ }
+
+ /**
+ * Enable Suite-B ciphers.
+ *
+ * @param enableEcdheEcdsa enable Diffie-Hellman with Elliptic Curve ECDSA cipher support.
+ * @param enableEcdheRsa enable Diffie-Hellman with RSA cipher support.
+ * @hide
+ */
+ public void enableSuiteBCiphers(boolean enableEcdheEcdsa, boolean enableEcdheRsa) {
+ mSecurityParamsList.stream()
+ .filter(params -> params.isSecurityType(SECURITY_TYPE_EAP_WPA3_ENTERPRISE_192_BIT))
+ .findAny()
+ .ifPresent(params -> params.enableSuiteBCiphers(enableEcdheEcdsa, enableEcdheRsa));
+ updateLegacySecurityParams();
+ }
+
+ /**
+ * Indicate ECDHE_ECDSA is enabled.
+ *
+ * @return true if enabled.
+ * @hide
+ */
+ public boolean isSuiteBCipherEcdheEcdsaEnabled() {
+ return mSecurityParamsList.stream()
+ .anyMatch(params -> params.getAllowedSuiteBCiphers().get(SuiteBCipher.ECDHE_ECDSA));
+ }
+
+ /**
+ * Indicate ECDHE_RSA is enabled.
+ *
+ * @return true if enabled.
+ * @hide
+ */
+ public boolean isSuiteBCipherEcdheRsaEnabled() {
+ return mSecurityParamsList.stream()
+ .anyMatch(params -> params.getAllowedSuiteBCiphers().get(SuiteBCipher.ECDHE_RSA));
+ }
+
+ /**
+ * Set SAE Hash-toElement only mode enabled.
+ *
+ * @param enable true if enabled; false otherwise.
+ * @hide
+ */
+ public void enableSaeH2eOnlyMode(boolean enable) {
+ mSecurityParamsList.stream()
+ .filter(params -> params.isSecurityType(SECURITY_TYPE_SAE))
+ .findAny()
+ .ifPresent(params -> params.enableSaeH2eOnlyMode(enable));
+ }
+
+ /**
+ * Set SAE Public-Key only mode enabled.
+ *
+ * @param enable true if enabled; false otherwise.
+ * @hide
+ */
+ public void enableSaePkOnlyMode(boolean enable) {
+ mSecurityParamsList.stream()
+ .filter(params -> params.isSecurityType(SECURITY_TYPE_SAE))
+ .findAny()
+ .ifPresent(params -> params.enableSaePkOnlyMode(enable));
}
/** @hide */
@@ -1161,27 +1483,25 @@ public class WifiConfiguration implements Parcelable {
return metered;
}
+ /** Check whether wep keys exist. */
+ private boolean hasWepKeys() {
+ if (wepKeys == null) return false;
+ for (int i = 0; i < wepKeys.length; i++) {
+ if (wepKeys[i] != null) {
+ return true;
+ }
+ }
+ return false;
+ }
+
/**
* @hide
- * Returns true if this WiFi config is for an open network.
+ * Returns true if this WiFi config is for an Open or Enhanced Open network.
*/
public boolean isOpenNetwork() {
- final int cardinality = allowedKeyManagement.cardinality();
- final boolean hasNoKeyMgmt = cardinality == 0
- || (cardinality == 1 && (allowedKeyManagement.get(KeyMgmt.NONE)
- || allowedKeyManagement.get(KeyMgmt.OWE)));
-
- boolean hasNoWepKeys = true;
- if (wepKeys != null) {
- for (int i = 0; i < wepKeys.length; i++) {
- if (wepKeys[i] != null) {
- hasNoWepKeys = false;
- break;
- }
- }
- }
-
- return hasNoKeyMgmt && hasNoWepKeys;
+ boolean hasNonOpenSecurityType = mSecurityParamsList.stream()
+ .anyMatch(params -> !params.isOpenSecurityType());
+ return !hasNonOpenSecurityType && !hasWepKeys();
}
/**
@@ -2365,12 +2685,11 @@ public class WifiConfiguration implements Parcelable {
*/
@UnsupportedAppUsage
public boolean isEnterprise() {
- return (allowedKeyManagement.get(KeyMgmt.WPA_EAP)
- || allowedKeyManagement.get(KeyMgmt.IEEE8021X)
- || allowedKeyManagement.get(KeyMgmt.SUITE_B_192)
- || allowedKeyManagement.get(KeyMgmt.WAPI_CERT))
+ boolean hasEnterpriseSecurityType = mSecurityParamsList.stream()
+ .anyMatch(params -> params.isEnterpriseSecurityType());
+ return (hasEnterpriseSecurityType
&& enterpriseConfig != null
- && enterpriseConfig.getEapMethod() != WifiEnterpriseConfig.Eap.NONE;
+ && enterpriseConfig.getEapMethod() != WifiEnterpriseConfig.Eap.NONE);
}
private static String logTimeOfDay(long millis) {
@@ -2552,6 +2871,10 @@ public class WifiConfiguration implements Parcelable {
sbuf.append('*');
}
+ sbuf.append("\nSecurityParams List:\n");
+ mSecurityParamsList.stream()
+ .forEach(params -> sbuf.append(params.toString()));
+
sbuf.append("\nEnterprise config:\n");
sbuf.append(enterpriseConfig);
@@ -3000,6 +3323,7 @@ public class WifiConfiguration implements Parcelable {
allowedGroupCiphers = (BitSet) source.allowedGroupCiphers.clone();
allowedGroupManagementCiphers = (BitSet) source.allowedGroupManagementCiphers.clone();
allowedSuiteBCiphers = (BitSet) source.allowedSuiteBCiphers.clone();
+ mSecurityParamsList = new ArrayList(source.mSecurityParamsList);
enterpriseConfig = new WifiEnterpriseConfig(source.enterpriseConfig);
defaultGwMacAddress = source.defaultGwMacAddress;
@@ -3090,6 +3414,10 @@ public class WifiConfiguration implements Parcelable {
writeBitSet(dest, allowedGroupManagementCiphers);
writeBitSet(dest, allowedSuiteBCiphers);
+ dest.writeInt(mSecurityParamsList.size());
+ mSecurityParamsList.stream()
+ .forEach(params -> params.writeToParcel(dest, flags));
+
dest.writeParcelable(enterpriseConfig, flags);
dest.writeParcelable(mIpConfiguration, flags);
@@ -3171,6 +3499,11 @@ public class WifiConfiguration implements Parcelable {
config.allowedGroupManagementCiphers = readBitSet(in);
config.allowedSuiteBCiphers = readBitSet(in);
+ int numSecurityParams = in.readInt();
+ for (int i = 0; i < numSecurityParams; i++) {
+ config.mSecurityParamsList.add(SecurityParams.createFromParcel(in));
+ }
+
config.enterpriseConfig = in.readParcelable(null);
config.setIpConfiguration(in.readParcelable(null));
config.dhcpServer = in.readString();
@@ -3253,9 +3586,10 @@ public class WifiConfiguration implements Parcelable {
* @hide
*/
public boolean needsPreSharedKey() {
- return allowedKeyManagement.get(KeyMgmt.WPA_PSK)
- || allowedKeyManagement.get(KeyMgmt.SAE)
- || allowedKeyManagement.get(KeyMgmt.WAPI_PSK);
+ return mSecurityParamsList.stream()
+ .anyMatch(params -> params.isSecurityType(SECURITY_TYPE_PSK)
+ || params.isSecurityType(SECURITY_TYPE_SAE)
+ || params.isSecurityType(SECURITY_TYPE_WAPI_PSK));
}
/**
diff --git a/wifi/java/android/net/wifi/WifiManager.java b/wifi/java/android/net/wifi/WifiManager.java
index 2b931a380f43..03114982a71c 100644
--- a/wifi/java/android/net/wifi/WifiManager.java
+++ b/wifi/java/android/net/wifi/WifiManager.java
@@ -3041,6 +3041,37 @@ public class WifiManager {
}
/**
+ * Restart the Wi-Fi subsystem.
+ *
+ * Restarts the Wi-Fi subsystem - effectively disabling it and re-enabling it. All existing
+ * Access Point (AP) associations are torn down, all Soft APs are disabled, Wi-Fi Direct and
+ * Wi-Fi Aware are disabled.
+ *
+ * The state of the system after restart is not guaranteed to match its state before the API is
+ * called - for instance the device may associate to a different Access Point (AP), and tethered
+ * hotspots may or may not be restored.
+ *
+ * @param reason If non-null, requests a bug report and attaches the reason string to it. A bug
+ * report may still not be generated based on framework criteria - for instance,
+ * build type or throttling. The WiFi subsystem is restarted whether or not a bug
+ * report is requested or generated.
+ *
+ * @hide
+ */
+ @SystemApi
+ @RequiresPermission(android.Manifest.permission.NETWORK_AIRPLANE_MODE)
+ public void restartWifiSubsystem(@Nullable String reason) {
+ if (!SdkLevel.isAtLeastS()) {
+ throw new UnsupportedOperationException();
+ }
+ try {
+ mService.restartWifiSubsystem(reason);
+ } catch (RemoteException e) {
+ throw e.rethrowFromSystemServer();
+ }
+ }
+
+ /**
* Gets the Wi-Fi enabled state.
* @return One of {@link #WIFI_STATE_DISABLED},
* {@link #WIFI_STATE_DISABLING}, {@link #WIFI_STATE_ENABLED},
@@ -3985,6 +4016,11 @@ public class WifiManager {
/**
* Called when information of softap changes.
*
+ * Note: this API is only valid when the Soft AP is configured as a single AP
+ * - not as a bridged AP (2 Soft APs). When the Soft AP is configured as bridged AP
+ * this callback will not be triggered - use the
+ * {@link #onInfoListChanged(List<SoftApInfo>)} callback in bridged AP mode.
+ *
* @param softApInfo is the softap information. {@link SoftApInfo}
*/
default void onInfoChanged(@NonNull SoftApInfo softApInfo) {
@@ -3992,6 +4028,24 @@ public class WifiManager {
}
/**
+ * Called when information of softap changes.
+ *
+ * The number of the information elements in the list depends on Soft AP configuration
+ * and state.
+ * For instance, an empty list will be returned when the Soft AP is disabled.
+ * One information element will be returned in the list when the Soft AP is configured
+ * as a single AP, and two information elements will be returned in the list
+ * when the Soft AP is configured in bridged mode.
+ *
+ * See {@link #isBridgedApConcurrencySupported()} for the detail of the bridged AP.
+ *
+ * @param softApInfoList is the list of the softap information elements. {@link SoftApInfo}
+ */
+ default void onInfoListChanged(@NonNull List<SoftApInfo> softApInfoList) {
+ // Do nothing: can be updated to add SoftApInfo details (e.g. channel) to the UI.
+ }
+
+ /**
* Called when capability of softap changes.
*
* @param softApCapability is the softap capability. {@link SoftApCapability}
@@ -4071,6 +4125,19 @@ public class WifiManager {
}
@Override
+ public void onInfoListChanged(List<SoftApInfo> softApInfoList) {
+ if (mVerboseLoggingEnabled) {
+ Log.v(TAG, "SoftApCallbackProxy: onInfoListChange: softApInfoList="
+ + softApInfoList);
+ }
+
+ Binder.clearCallingIdentity();
+ mExecutor.execute(() -> {
+ mCallback.onInfoListChanged(softApInfoList);
+ });
+ }
+
+ @Override
public void onCapabilityChanged(SoftApCapability capability) {
if (mVerboseLoggingEnabled) {
Log.v(TAG, "SoftApCallbackProxy: onCapabilityChanged: SoftApCapability="
@@ -4580,7 +4647,9 @@ public class WifiManager {
* @hide
*/
@SystemApi
- @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS)
+ @RequiresPermission(anyOf = {
+ android.Manifest.permission.NETWORK_SETTINGS,
+ android.Manifest.permission.NETWORK_SETUP_WIZARD})
public void startTemporarilyDisablingAllNonCarrierMergedWifi(int subscriptionId) {
try {
mService.startTemporarilyDisablingAllNonCarrierMergedWifi(subscriptionId);
@@ -4595,7 +4664,9 @@ public class WifiManager {
* @hide
*/
@SystemApi
- @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS)
+ @RequiresPermission(anyOf = {
+ android.Manifest.permission.NETWORK_SETTINGS,
+ android.Manifest.permission.NETWORK_SETUP_WIZARD})
public void stopTemporarilyDisablingAllNonCarrierMergedWifi() {
try {
mService.stopTemporarilyDisablingAllNonCarrierMergedWifi();
diff --git a/wifi/java/android/net/wifi/rtt/RangingRequest.java b/wifi/java/android/net/wifi/rtt/RangingRequest.java
index 318efa61a110..04dfcf2f9cad 100644
--- a/wifi/java/android/net/wifi/rtt/RangingRequest.java
+++ b/wifi/java/android/net/wifi/rtt/RangingRequest.java
@@ -30,8 +30,11 @@ import android.os.Handler;
import android.os.Parcel;
import android.os.Parcelable;
+import com.android.modules.utils.build.SdkLevel;
+
import java.util.ArrayList;
import java.util.List;
+import java.util.Objects;
import java.util.StringJoiner;
/**
@@ -46,6 +49,9 @@ import java.util.StringJoiner;
*/
public final class RangingRequest implements Parcelable {
private static final int MAX_PEERS = 10;
+ private static final int DEFAULT_RTT_BURST_SIZE = 8;
+ private static final int MIN_RTT_BURST_SIZE = 2;
+ private static final int MAX_RTT_BURST_SIZE = 17;
/**
* Returns the maximum number of peers to range which can be specified in a single {@code
@@ -59,12 +65,80 @@ public final class RangingRequest implements Parcelable {
return MAX_PEERS;
}
+ /**
+ * Returns the default RTT burst size used to determine the average range.
+ *
+ * @return the RTT burst size used by default
+ */
+ public static int getDefaultRttBurstSize() {
+ if (!SdkLevel.isAtLeastS()) {
+ throw new UnsupportedOperationException();
+ }
+ return DEFAULT_RTT_BURST_SIZE;
+ }
+
+ /**
+ * Returns the minimum RTT burst size that can be used to determine a average range.
+ *
+ * @return the minimum RTT burst size that can be used
+ */
+ public static int getMinRttBurstSize() {
+ if (!SdkLevel.isAtLeastS()) {
+ throw new UnsupportedOperationException();
+ }
+ return MIN_RTT_BURST_SIZE;
+ }
+
+ /**
+ * Returns the minimum RTT burst size that can be used to determine a average range.
+ *
+ * @return the maximum RTT burst size that can be used
+ */
+ public static int getMaxRttBurstSize() {
+ if (!SdkLevel.isAtLeastS()) {
+ throw new UnsupportedOperationException();
+ }
+ return MAX_RTT_BURST_SIZE;
+ }
+
/** @hide */
public final List<ResponderConfig> mRttPeers;
/** @hide */
- private RangingRequest(List<ResponderConfig> rttPeers) {
+ public final int mRttBurstSize;
+
+ /** @hide */
+ private RangingRequest(List<ResponderConfig> rttPeers, int rttBurstSize) {
mRttPeers = rttPeers;
+ mRttBurstSize = rttBurstSize;
+ }
+
+ /**
+ * Returns the list of RTT capable peers.
+ *
+ * @return the list of RTT capable peers in a common system representation
+ *
+ * @hide
+ */
+ @SystemApi
+ @NonNull
+ public List<ResponderConfig> getRttPeers() {
+ if (!SdkLevel.isAtLeastS()) {
+ throw new UnsupportedOperationException();
+ }
+ return mRttPeers;
+ }
+
+ /**
+ * Returns the RTT burst size used to determine the average range.
+ *
+ * @return the RTT burst size used
+ */
+ public int getRttBurstSize() {
+ if (!SdkLevel.isAtLeastS()) {
+ throw new UnsupportedOperationException();
+ }
+ return mRttBurstSize;
}
@Override
@@ -75,6 +149,7 @@ public final class RangingRequest implements Parcelable {
@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeList(mRttPeers);
+ dest.writeInt(mRttBurstSize);
}
public static final @android.annotation.NonNull Creator<RangingRequest> CREATOR = new Creator<RangingRequest>() {
@@ -85,7 +160,7 @@ public final class RangingRequest implements Parcelable {
@Override
public RangingRequest createFromParcel(Parcel in) {
- return new RangingRequest(in.readArrayList(null));
+ return new RangingRequest(in.readArrayList(null), in.readInt());
}
};
@@ -105,12 +180,20 @@ public final class RangingRequest implements Parcelable {
throw new IllegalArgumentException(
"Ranging to too many peers requested. Use getMaxPeers() API to get limit.");
}
-
for (ResponderConfig peer: mRttPeers) {
if (!peer.isValid(awareSupported)) {
throw new IllegalArgumentException("Invalid Responder specification");
}
}
+ if (SdkLevel.isAtLeastS()) {
+ if (mRttBurstSize < getMinRttBurstSize() || mRttBurstSize > getMaxRttBurstSize()) {
+ throw new IllegalArgumentException("RTT burst size is out of range");
+ }
+ } else {
+ if (mRttBurstSize != DEFAULT_RTT_BURST_SIZE) {
+ throw new IllegalArgumentException("RTT burst size is not the default value");
+ }
+ }
}
/**
@@ -118,6 +201,32 @@ public final class RangingRequest implements Parcelable {
*/
public static final class Builder {
private List<ResponderConfig> mRttPeers = new ArrayList<>();
+ private int mRttBurstSize = DEFAULT_RTT_BURST_SIZE;
+
+ /**
+ * Set the RTT Burst size for the ranging request.
+ * <p>
+ * If not set, the default RTT burst size given by
+ * {@link #getDefaultRttBurstSize()} is used to determine the default value.
+ * If set, the value must be in the range {@link #getMinRttBurstSize()} and
+ * {@link #getMaxRttBurstSize()} inclusively, or a
+ * {@link java.lang.IllegalArgumentException} will be thrown.
+ *
+ * @param rttBurstSize The number of FTM packets used to estimate a range.
+ * @return The builder to facilitate chaining
+ * {@code builder.setXXX(..).setXXX(..)}.
+ */
+ @NonNull
+ public Builder setRttBurstSize(int rttBurstSize) {
+ if (!SdkLevel.isAtLeastS()) {
+ throw new UnsupportedOperationException();
+ }
+ if (rttBurstSize < MIN_RTT_BURST_SIZE || rttBurstSize > MAX_RTT_BURST_SIZE) {
+ throw new IllegalArgumentException("RTT burst size out of range.");
+ }
+ mRttBurstSize = rttBurstSize;
+ return this;
+ }
/**
* Add the device specified by the {@link ScanResult} to the list of devices with
@@ -241,7 +350,7 @@ public final class RangingRequest implements Parcelable {
* builder.
*/
public RangingRequest build() {
- return new RangingRequest(mRttPeers);
+ return new RangingRequest(mRttPeers, mRttBurstSize);
}
}
@@ -257,11 +366,13 @@ public final class RangingRequest implements Parcelable {
RangingRequest lhs = (RangingRequest) o;
- return mRttPeers.size() == lhs.mRttPeers.size() && mRttPeers.containsAll(lhs.mRttPeers);
+ return mRttPeers.size() == lhs.mRttPeers.size()
+ && mRttPeers.containsAll(lhs.mRttPeers)
+ && mRttBurstSize == lhs.mRttBurstSize;
}
@Override
public int hashCode() {
- return mRttPeers.hashCode();
+ return Objects.hash(mRttPeers, mRttBurstSize);
}
}
diff --git a/wifi/tests/src/android/net/wifi/SecurityParamsTest.java b/wifi/tests/src/android/net/wifi/SecurityParamsTest.java
new file mode 100644
index 000000000000..2f6b7245795f
--- /dev/null
+++ b/wifi/tests/src/android/net/wifi/SecurityParamsTest.java
@@ -0,0 +1,502 @@
+/*
+ * 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 android.net.wifi;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotEquals;
+import static org.junit.Assert.assertTrue;
+
+import android.net.wifi.WifiConfiguration.AuthAlgorithm;
+import android.net.wifi.WifiConfiguration.GroupCipher;
+import android.net.wifi.WifiConfiguration.GroupMgmtCipher;
+import android.net.wifi.WifiConfiguration.KeyMgmt;
+import android.net.wifi.WifiConfiguration.PairwiseCipher;
+import android.net.wifi.WifiConfiguration.Protocol;
+import android.os.Parcel;
+
+import androidx.test.filters.SmallTest;
+
+import org.junit.Test;
+
+import java.util.BitSet;
+
+/**
+ * Unit tests for {@link android.net.wifi.WifiInfo}.
+ */
+@SmallTest
+public class SecurityParamsTest {
+
+ private void verifySecurityParams(SecurityParams params,
+ int expectedSecurityType,
+ int[] expectedAllowedKeyManagement,
+ int[] expectedAllowedProtocols,
+ int[] expectedAllowedAuthAlgorithms,
+ int[] expectedAllowedPairwiseCiphers,
+ int[] expectedAllowedGroupCiphers,
+ boolean expectedRequirePmf) {
+ assertTrue(params.isSecurityType(expectedSecurityType));
+ for (int b: expectedAllowedKeyManagement) {
+ assertTrue(params.getAllowedKeyManagement().get(b));
+ }
+ for (int b: expectedAllowedProtocols) {
+ assertTrue(params.getAllowedProtocols().get(b));
+ }
+ for (int b: expectedAllowedAuthAlgorithms) {
+ assertTrue(params.getAllowedAuthAlgorithms().get(b));
+ }
+ for (int b: expectedAllowedPairwiseCiphers) {
+ assertTrue(params.getAllowedPairwiseCiphers().get(b));
+ }
+ for (int b: expectedAllowedGroupCiphers) {
+ assertTrue(params.getAllowedGroupCiphers().get(b));
+ }
+ assertEquals(expectedRequirePmf, params.isRequirePmf());
+ }
+
+ /** Verify EAP params creator. */
+ @Test
+ public void testEapCreator() throws Exception {
+ SecurityParams p = SecurityParams.createWpaWpa2EnterpriseParams();
+ int expectedSecurityType = WifiConfiguration.SECURITY_TYPE_EAP;
+ int[] expectedAllowedKeyManagement = new int[] {KeyMgmt.WPA_EAP, KeyMgmt.IEEE8021X};
+ int[] expectedAllowedProtocols = new int[] {};
+ int[] expectedAllowedAuthAlgorithms = new int[] {};
+ int[] expectedAllowedPairwiseCiphers = new int[] {};
+ int[] expectedAllowedGroupCiphers = new int[] {};
+ boolean expectedRequirePmf = false;
+ verifySecurityParams(p, expectedSecurityType,
+ expectedAllowedKeyManagement, expectedAllowedProtocols,
+ expectedAllowedAuthAlgorithms, expectedAllowedPairwiseCiphers,
+ expectedAllowedGroupCiphers, expectedRequirePmf);
+ }
+
+ /** Verify Passpoint R1 params creator. */
+ @Test
+ public void testEapPasspointR1Creator() throws Exception {
+ SecurityParams p = SecurityParams.createPasspointParams(SecurityParams.PASSPOINT_R1);
+ int expectedSecurityType = WifiConfiguration.SECURITY_TYPE_PASSPOINT_R1_R2;
+ int[] expectedAllowedKeyManagement = new int[] {KeyMgmt.WPA_EAP, KeyMgmt.IEEE8021X};
+ int[] expectedAllowedProtocols = new int[] {};
+ int[] expectedAllowedAuthAlgorithms = new int[] {};
+ int[] expectedAllowedPairwiseCiphers = new int[] {};
+ int[] expectedAllowedGroupCiphers = new int[] {};
+ boolean expectedRequirePmf = false;
+ verifySecurityParams(p, expectedSecurityType,
+ expectedAllowedKeyManagement, expectedAllowedProtocols,
+ expectedAllowedAuthAlgorithms, expectedAllowedPairwiseCiphers,
+ expectedAllowedGroupCiphers, expectedRequirePmf);
+ }
+
+ /** Verify Passpoint R2 params creator. */
+ @Test
+ public void testEapPasspointR2Creator() throws Exception {
+ SecurityParams p = SecurityParams.createPasspointParams(SecurityParams.PASSPOINT_R2);
+ int expectedSecurityType = WifiConfiguration.SECURITY_TYPE_PASSPOINT_R1_R2;
+ int[] expectedAllowedKeyManagement = new int[] {KeyMgmt.WPA_EAP, KeyMgmt.IEEE8021X};
+ int[] expectedAllowedProtocols = new int[] {};
+ int[] expectedAllowedAuthAlgorithms = new int[] {};
+ int[] expectedAllowedPairwiseCiphers = new int[] {};
+ int[] expectedAllowedGroupCiphers = new int[] {};
+ boolean expectedRequirePmf = false;
+ verifySecurityParams(p, expectedSecurityType,
+ expectedAllowedKeyManagement, expectedAllowedProtocols,
+ expectedAllowedAuthAlgorithms, expectedAllowedPairwiseCiphers,
+ expectedAllowedGroupCiphers, expectedRequirePmf);
+ }
+
+ /** Verify Passpoint R3 params creator. */
+ @Test
+ public void testEapPasspointR3Creator() throws Exception {
+ SecurityParams p = SecurityParams.createPasspointParams(SecurityParams.PASSPOINT_R3);
+ int expectedSecurityType = WifiConfiguration.SECURITY_TYPE_PASSPOINT_R3;
+ int[] expectedAllowedKeyManagement = new int[] {KeyMgmt.WPA_EAP, KeyMgmt.IEEE8021X};
+ int[] expectedAllowedProtocols = new int[] {};
+ int[] expectedAllowedAuthAlgorithms = new int[] {};
+ int[] expectedAllowedPairwiseCiphers = new int[] {};
+ int[] expectedAllowedGroupCiphers = new int[] {};
+ boolean expectedRequirePmf = true;
+ verifySecurityParams(p, expectedSecurityType,
+ expectedAllowedKeyManagement, expectedAllowedProtocols,
+ expectedAllowedAuthAlgorithms, expectedAllowedPairwiseCiphers,
+ expectedAllowedGroupCiphers, expectedRequirePmf);
+ }
+
+ /** Verify Enhanced Open params creator. */
+ @Test
+ public void testEnhancedOpenCreator() throws Exception {
+ SecurityParams p = SecurityParams.createEnhancedOpenParams();
+ int expectedSecurityType = WifiConfiguration.SECURITY_TYPE_OWE;
+ int[] expectedAllowedKeyManagement = new int[] {KeyMgmt.OWE};
+ int[] expectedAllowedProtocols = new int[] {Protocol.RSN};
+ int[] expectedAllowedAuthAlgorithms = new int[] {};
+ int[] expectedAllowedPairwiseCiphers = new int[] {
+ PairwiseCipher.CCMP, PairwiseCipher.GCMP_128, PairwiseCipher.GCMP_256};
+ int[] expectedAllowedGroupCiphers = new int[] {
+ GroupCipher.CCMP, GroupCipher.GCMP_128, GroupCipher.GCMP_256};
+ boolean expectedRequirePmf = true;
+ verifySecurityParams(p, expectedSecurityType,
+ expectedAllowedKeyManagement, expectedAllowedProtocols,
+ expectedAllowedAuthAlgorithms, expectedAllowedPairwiseCiphers,
+ expectedAllowedGroupCiphers, expectedRequirePmf);
+ }
+
+ /** Verify Open params creator. */
+ @Test
+ public void testOpenCreator() throws Exception {
+ SecurityParams p = SecurityParams.createOpenParams();
+ int expectedSecurityType = WifiConfiguration.SECURITY_TYPE_OPEN;
+ int[] expectedAllowedKeyManagement = new int[] {KeyMgmt.NONE};
+ int[] expectedAllowedProtocols = new int[] {};
+ int[] expectedAllowedAuthAlgorithms = new int[] {};
+ int[] expectedAllowedPairwiseCiphers = new int[] {};
+ int[] expectedAllowedGroupCiphers = new int[] {};
+ boolean expectedRequirePmf = false;
+ verifySecurityParams(p, expectedSecurityType,
+ expectedAllowedKeyManagement, expectedAllowedProtocols,
+ expectedAllowedAuthAlgorithms, expectedAllowedPairwiseCiphers,
+ expectedAllowedGroupCiphers, expectedRequirePmf);
+ }
+
+ /** Verify OSEN params creator. */
+ @Test
+ public void testOsenCreator() throws Exception {
+ SecurityParams p = SecurityParams.createOsenParams();
+ int expectedSecurityType = WifiConfiguration.SECURITY_TYPE_OSEN;
+ int[] expectedAllowedKeyManagement = new int[] {KeyMgmt.OSEN};
+ int[] expectedAllowedProtocols = new int[] {Protocol.OSEN};
+ int[] expectedAllowedAuthAlgorithms = new int[] {};
+ int[] expectedAllowedPairwiseCiphers = new int[] {};
+ int[] expectedAllowedGroupCiphers = new int[] {};
+ boolean expectedRequirePmf = false;
+ verifySecurityParams(p, expectedSecurityType,
+ expectedAllowedKeyManagement, expectedAllowedProtocols,
+ expectedAllowedAuthAlgorithms, expectedAllowedPairwiseCiphers,
+ expectedAllowedGroupCiphers, expectedRequirePmf);
+ }
+
+ /** Verify WAPI CERT params creator. */
+ @Test
+ public void testWapiCertCreator() throws Exception {
+ SecurityParams p = SecurityParams.createWapiCertParams();
+ int expectedSecurityType = WifiConfiguration.SECURITY_TYPE_WAPI_CERT;
+ int[] expectedAllowedKeyManagement = new int[] {KeyMgmt.WAPI_CERT};
+ int[] expectedAllowedProtocols = new int[] {Protocol.WAPI};
+ int[] expectedAllowedAuthAlgorithms = new int[] {};
+ int[] expectedAllowedPairwiseCiphers = new int[] {PairwiseCipher.SMS4};
+ int[] expectedAllowedGroupCiphers = new int[] {GroupCipher.SMS4};
+ boolean expectedRequirePmf = false;
+ verifySecurityParams(p, expectedSecurityType,
+ expectedAllowedKeyManagement, expectedAllowedProtocols,
+ expectedAllowedAuthAlgorithms, expectedAllowedPairwiseCiphers,
+ expectedAllowedGroupCiphers, expectedRequirePmf);
+ }
+
+ /** Verify WAPI PSK params creator. */
+ @Test
+ public void testWapiPskCreator() throws Exception {
+ SecurityParams p = SecurityParams.createWapiPskParams();
+ int expectedSecurityType = WifiConfiguration.SECURITY_TYPE_WAPI_PSK;
+ int[] expectedAllowedKeyManagement = new int[] {KeyMgmt.WAPI_PSK};
+ int[] expectedAllowedProtocols = new int[] {Protocol.WAPI};
+ int[] expectedAllowedAuthAlgorithms = new int[] {};
+ int[] expectedAllowedPairwiseCiphers = new int[] {PairwiseCipher.SMS4};
+ int[] expectedAllowedGroupCiphers = new int[] {GroupCipher.SMS4};
+ boolean expectedRequirePmf = false;
+ verifySecurityParams(p, expectedSecurityType,
+ expectedAllowedKeyManagement, expectedAllowedProtocols,
+ expectedAllowedAuthAlgorithms, expectedAllowedPairwiseCiphers,
+ expectedAllowedGroupCiphers, expectedRequirePmf);
+ }
+
+ /** Verify WEP params creator. */
+ @Test
+ public void testWepCreator() throws Exception {
+ SecurityParams p = SecurityParams.createWepParams();
+ int expectedSecurityType = WifiConfiguration.SECURITY_TYPE_WEP;
+ int[] expectedAllowedKeyManagement = new int[] {KeyMgmt.NONE};
+ int[] expectedAllowedProtocols = new int[] {};
+ int[] expectedAllowedAuthAlgorithms = new int[] {AuthAlgorithm.OPEN, AuthAlgorithm.SHARED};
+ int[] expectedAllowedPairwiseCiphers = new int[] {};
+ int[] expectedAllowedGroupCiphers = new int[] {};
+ boolean expectedRequirePmf = false;
+ verifySecurityParams(p, expectedSecurityType,
+ expectedAllowedKeyManagement, expectedAllowedProtocols,
+ expectedAllowedAuthAlgorithms, expectedAllowedPairwiseCiphers,
+ expectedAllowedGroupCiphers, expectedRequirePmf);
+ }
+
+ /** Verify WPA3 Enterprise 192-bit params creator. */
+ @Test
+ public void testWpa3Enterprise192BitCreator() throws Exception {
+ SecurityParams p = SecurityParams.createWpa3Enterprise192BitParams();
+ int expectedSecurityType = WifiConfiguration.SECURITY_TYPE_EAP_WPA3_ENTERPRISE_192_BIT;
+ int[] expectedAllowedKeyManagement = new int[] {
+ KeyMgmt.WPA_EAP, KeyMgmt.IEEE8021X, KeyMgmt.SUITE_B_192};
+ int[] expectedAllowedProtocols = new int[] {Protocol.RSN};
+ int[] expectedAllowedAuthAlgorithms = new int[] {};
+ int[] expectedAllowedPairwiseCiphers = new int[] {
+ PairwiseCipher.GCMP_128, PairwiseCipher.GCMP_256};
+ int[] expectedAllowedGroupCiphers = new int[] {GroupCipher.GCMP_128, GroupCipher.GCMP_256};
+ boolean expectedRequirePmf = true;
+ verifySecurityParams(p, expectedSecurityType,
+ expectedAllowedKeyManagement, expectedAllowedProtocols,
+ expectedAllowedAuthAlgorithms, expectedAllowedPairwiseCiphers,
+ expectedAllowedGroupCiphers, expectedRequirePmf);
+
+ assertTrue(p.getAllowedGroupManagementCiphers().get(GroupMgmtCipher.BIP_GMAC_256));
+ }
+
+ /** Verify WPA3 Enterprise params creator. */
+ @Test
+ public void testWpa3EnterpriseCreator() throws Exception {
+ SecurityParams p = SecurityParams.createWpa3EnterpriseParams();
+ int expectedSecurityType = WifiConfiguration.SECURITY_TYPE_EAP_WPA3_ENTERPRISE;
+ int[] expectedAllowedKeyManagement = new int[] {KeyMgmt.WPA_EAP, KeyMgmt.IEEE8021X};
+ int[] expectedAllowedProtocols = new int[] {Protocol.RSN};
+ int[] expectedAllowedAuthAlgorithms = new int[] {};
+ int[] expectedAllowedPairwiseCiphers = new int[] {
+ PairwiseCipher.CCMP, PairwiseCipher.GCMP_256};
+ int[] expectedAllowedGroupCiphers = new int[] {GroupCipher.CCMP, GroupCipher.GCMP_256};
+ boolean expectedRequirePmf = true;
+ verifySecurityParams(p, expectedSecurityType,
+ expectedAllowedKeyManagement, expectedAllowedProtocols,
+ expectedAllowedAuthAlgorithms, expectedAllowedPairwiseCiphers,
+ expectedAllowedGroupCiphers, expectedRequirePmf);
+ }
+
+ /** Verify WPA3 Personal params creator. */
+ @Test
+ public void testWpa3PersonalCreator() throws Exception {
+ SecurityParams p = SecurityParams.createWpa3PersonalParams();
+ int expectedSecurityType = WifiConfiguration.SECURITY_TYPE_SAE;
+ int[] expectedAllowedKeyManagement = new int[] {KeyMgmt.SAE};
+ int[] expectedAllowedProtocols = new int[] {Protocol.RSN};
+ int[] expectedAllowedAuthAlgorithms = new int[] {};
+ int[] expectedAllowedPairwiseCiphers = new int[] {
+ PairwiseCipher.CCMP, PairwiseCipher.GCMP_128, PairwiseCipher.GCMP_256};
+ int[] expectedAllowedGroupCiphers = new int[] {
+ GroupCipher.CCMP, GroupCipher.GCMP_128, GroupCipher.GCMP_256};
+ boolean expectedRequirePmf = true;
+ verifySecurityParams(p, expectedSecurityType,
+ expectedAllowedKeyManagement, expectedAllowedProtocols,
+ expectedAllowedAuthAlgorithms, expectedAllowedPairwiseCiphers,
+ expectedAllowedGroupCiphers, expectedRequirePmf);
+ }
+
+ /** Verify WPA2 Personal EAP params creator. */
+ @Test
+ public void testWpaWpa2PersonalCreator() throws Exception {
+ SecurityParams p = SecurityParams.createWpaWpa2PersonalParams();
+ int expectedSecurityType = WifiConfiguration.SECURITY_TYPE_PSK;
+ int[] expectedAllowedKeyManagement = new int[] {KeyMgmt.WPA_PSK};
+ int[] expectedAllowedProtocols = new int[] {};
+ int[] expectedAllowedAuthAlgorithms = new int[] {};
+ int[] expectedAllowedPairwiseCiphers = new int[] {};
+ int[] expectedAllowedGroupCiphers = new int[] {};
+ boolean expectedRequirePmf = false;
+ verifySecurityParams(p, expectedSecurityType,
+ expectedAllowedKeyManagement, expectedAllowedProtocols,
+ expectedAllowedAuthAlgorithms, expectedAllowedPairwiseCiphers,
+ expectedAllowedGroupCiphers, expectedRequirePmf);
+ }
+
+ /** Verify setter/getter methods */
+ @Test
+ public void testCommonSetterGetter() throws Exception {
+ SecurityParams params = SecurityParams.createWpaWpa2PersonalParams();
+
+ // PSK setting
+ BitSet allowedKeyManagement = new BitSet();
+ allowedKeyManagement.set(KeyMgmt.WPA_PSK);
+
+ BitSet allowedProtocols = new BitSet();
+ allowedProtocols.set(Protocol.RSN);
+ allowedProtocols.set(Protocol.WPA);
+
+ BitSet allowedPairwiseCiphers = new BitSet();
+ allowedPairwiseCiphers.set(PairwiseCipher.CCMP);
+ allowedPairwiseCiphers.set(PairwiseCipher.TKIP);
+
+ BitSet allowedGroupCiphers = new BitSet();
+ allowedGroupCiphers.set(GroupCipher.CCMP);
+ allowedGroupCiphers.set(GroupCipher.TKIP);
+ allowedGroupCiphers.set(GroupCipher.WEP40);
+ allowedGroupCiphers.set(GroupCipher.WEP104);
+
+ assertEquals(allowedKeyManagement, params.getAllowedKeyManagement());
+ assertTrue(params.getAllowedKeyManagement().get(KeyMgmt.WPA_PSK));
+
+ assertEquals(allowedProtocols, params.getAllowedProtocols());
+ assertTrue(params.getAllowedProtocols().get(Protocol.RSN));
+ assertTrue(params.getAllowedProtocols().get(Protocol.WPA));
+
+ assertEquals(allowedPairwiseCiphers, params.getAllowedPairwiseCiphers());
+ assertTrue(params.getAllowedPairwiseCiphers().get(PairwiseCipher.CCMP));
+ assertTrue(params.getAllowedPairwiseCiphers().get(PairwiseCipher.TKIP));
+
+ assertEquals(allowedGroupCiphers, params.getAllowedGroupCiphers());
+ assertTrue(params.getAllowedGroupCiphers().get(GroupCipher.CCMP));
+ assertTrue(params.getAllowedGroupCiphers().get(GroupCipher.TKIP));
+ assertTrue(params.getAllowedGroupCiphers().get(GroupCipher.WEP40));
+ assertTrue(params.getAllowedGroupCiphers().get(GroupCipher.WEP104));
+
+ params.setEnabled(false);
+ assertFalse(params.isEnabled());
+ }
+
+ /** Verify SAE-specific methods */
+ @Test
+ public void testSaeMethods() throws Exception {
+ SecurityParams p = SecurityParams.createWpa3PersonalParams();
+
+ assertFalse(p.isAddedByAutoUpgrade());
+ p.setIsAddedByAutoUpgrade(true);
+ assertTrue(p.isAddedByAutoUpgrade());
+
+ assertFalse(p.isSaeH2eOnlyMode());
+ p.enableSaeH2eOnlyMode(true);
+ assertTrue(p.isSaeH2eOnlyMode());
+
+ assertFalse(p.isSaePkOnlyMode());
+ p.enableSaePkOnlyMode(true);
+ assertTrue(p.isSaePkOnlyMode());
+ }
+
+ /** Verify copy constructor. */
+ @Test
+ public void testCopyConstructor() throws Exception {
+ SecurityParams params = SecurityParams.createWpaWpa2PersonalParams();
+ params.setEnabled(false);
+ params.setIsAddedByAutoUpgrade(true);
+
+ SecurityParams copiedParams = new SecurityParams(params);
+
+ assertTrue(params.isSameSecurityType(copiedParams));
+ assertEquals(params.getAllowedKeyManagement(), copiedParams.getAllowedKeyManagement());
+ assertEquals(params.getAllowedProtocols(), copiedParams.getAllowedProtocols());
+ assertEquals(params.getAllowedAuthAlgorithms(), copiedParams.getAllowedAuthAlgorithms());
+ assertEquals(params.getAllowedPairwiseCiphers(), copiedParams.getAllowedPairwiseCiphers());
+ assertEquals(params.getAllowedGroupCiphers(), copiedParams.getAllowedGroupCiphers());
+ assertEquals(params.getAllowedGroupManagementCiphers(),
+ copiedParams.getAllowedGroupManagementCiphers());
+ assertEquals(params.getAllowedSuiteBCiphers(), copiedParams.getAllowedSuiteBCiphers());
+ assertEquals(params.isRequirePmf(), copiedParams.isRequirePmf());
+ assertEquals(params.isEnabled(), copiedParams.isEnabled());
+ assertEquals(params.isSaeH2eOnlyMode(), copiedParams.isSaeH2eOnlyMode());
+ assertEquals(params.isSaePkOnlyMode(), copiedParams.isSaePkOnlyMode());
+ assertEquals(params.isAddedByAutoUpgrade(), copiedParams.isAddedByAutoUpgrade());
+ }
+
+ /** Check that two params are equal if and only if their types are the same. */
+ @Test
+ public void testEquals() {
+ SecurityParams saeParams1 = SecurityParams.createWpa3PersonalParams();
+ SecurityParams saeParams2 = SecurityParams.createWpa3PersonalParams();
+ SecurityParams pskParams = SecurityParams.createWpaWpa2PersonalParams();
+ assertEquals(saeParams1, saeParams2);
+ assertNotEquals(saeParams1, pskParams);
+ }
+
+ /** Check that hash values are the same if and only if their types are the same. */
+ @Test
+ public void testHashCode() {
+ SecurityParams saeParams1 = SecurityParams.createWpa3PersonalParams();
+ SecurityParams saeParams2 = SecurityParams.createWpa3PersonalParams();
+ SecurityParams pskParams = SecurityParams.createWpaWpa2PersonalParams();
+ assertEquals(saeParams1.hashCode(), saeParams2.hashCode());
+ assertNotEquals(saeParams1.hashCode(), pskParams.hashCode());
+ }
+
+ /** Verify open network check */
+ @Test
+ public void testIsOpenNetwork() {
+ SecurityParams[] openSecurityParams = new SecurityParams[] {
+ SecurityParams.createEnhancedOpenParams(),
+ SecurityParams.createOpenParams(),
+ };
+ for (SecurityParams p: openSecurityParams) {
+ assertTrue(p.isOpenSecurityType());
+ }
+
+ SecurityParams[] nonOpenSecurityParams = new SecurityParams[] {
+ SecurityParams.createWpaWpa2EnterpriseParams(),
+ SecurityParams.createPasspointParams(SecurityParams.PASSPOINT_R1),
+ SecurityParams.createPasspointParams(SecurityParams.PASSPOINT_R2),
+ SecurityParams.createPasspointParams(SecurityParams.PASSPOINT_R3),
+ SecurityParams.createOsenParams(),
+ SecurityParams.createWapiCertParams(),
+ SecurityParams.createWapiPskParams(),
+ SecurityParams.createWepParams(),
+ SecurityParams.createWpa3Enterprise192BitParams(),
+ SecurityParams.createWpa3EnterpriseParams(),
+ SecurityParams.createWpa3PersonalParams(),
+ SecurityParams.createWpaWpa2PersonalParams(),
+ };
+ for (SecurityParams p: nonOpenSecurityParams) {
+ assertFalse(p.isOpenSecurityType());
+ }
+ }
+
+ /** Verify enterprise network check */
+ @Test
+ public void testIsEnterpriseNetwork() {
+ SecurityParams[] enterpriseSecurityParams = new SecurityParams[] {
+ SecurityParams.createWpaWpa2EnterpriseParams(),
+ SecurityParams.createPasspointParams(SecurityParams.PASSPOINT_R1),
+ SecurityParams.createPasspointParams(SecurityParams.PASSPOINT_R2),
+ SecurityParams.createPasspointParams(SecurityParams.PASSPOINT_R3),
+ SecurityParams.createWapiCertParams(),
+ SecurityParams.createWpa3Enterprise192BitParams(),
+ SecurityParams.createWpa3EnterpriseParams(),
+ };
+ for (SecurityParams p: enterpriseSecurityParams) {
+ assertTrue(p.isEnterpriseSecurityType());
+ }
+
+ SecurityParams[] nonEnterpriseSecurityParams = new SecurityParams[] {
+ SecurityParams.createEnhancedOpenParams(),
+ SecurityParams.createOpenParams(),
+ SecurityParams.createOsenParams(),
+ SecurityParams.createWapiPskParams(),
+ SecurityParams.createWepParams(),
+ SecurityParams.createWpa3PersonalParams(),
+ SecurityParams.createWpaWpa2PersonalParams(),
+ };
+ for (SecurityParams p: nonEnterpriseSecurityParams) {
+ assertFalse(p.isEnterpriseSecurityType());
+ }
+ }
+
+ /** Check that parcel marshalling/unmarshalling works */
+ @Test
+ public void testParcelMethods() {
+ SecurityParams params = SecurityParams.createWpa3PersonalParams();
+
+ Parcel parcelW = Parcel.obtain();
+ params.writeToParcel(parcelW, 0);
+ byte[] bytes = parcelW.marshall();
+ parcelW.recycle();
+
+ Parcel parcelR = Parcel.obtain();
+ parcelR.unmarshall(bytes, 0, bytes.length);
+ parcelR.setDataPosition(0);
+
+ SecurityParams reParams = SecurityParams.createFromParcel(parcelR);
+ assertEquals(params, reParams);
+ }
+}
diff --git a/wifi/tests/src/android/net/wifi/SoftApCapabilityTest.java b/wifi/tests/src/android/net/wifi/SoftApCapabilityTest.java
index 702212b324f6..9e3b02266de1 100644
--- a/wifi/tests/src/android/net/wifi/SoftApCapabilityTest.java
+++ b/wifi/tests/src/android/net/wifi/SoftApCapabilityTest.java
@@ -42,10 +42,12 @@ public class SoftApCapabilityTest {
| SoftApCapability.SOFTAP_FEATURE_ACS_OFFLOAD;
int[] testSupported2Glist = {1, 2, 3, 4};
int[] testSupported5Glist = {36, 149};
+ int[] testSupported60Glist = {1, 2};
SoftApCapability capability = new SoftApCapability(testSoftApFeature);
capability.setMaxSupportedClients(10);
capability.setSupportedChannelList(SoftApConfiguration.BAND_2GHZ, testSupported2Glist);
capability.setSupportedChannelList(SoftApConfiguration.BAND_5GHZ, testSupported5Glist);
+ capability.setSupportedChannelList(SoftApConfiguration.BAND_60GHZ, testSupported60Glist);
SoftApCapability copiedCapability = new SoftApCapability(capability);
@@ -64,9 +66,11 @@ public class SoftApCapabilityTest {
capability.setMaxSupportedClients(10);
int[] testSupported2Glist = {1, 2, 3, 4};
int[] testSupported5Glist = {36, 149};
+ int[] testSupported60Glist = {1, 2};
capability.setSupportedChannelList(SoftApConfiguration.BAND_2GHZ, testSupported2Glist);
capability.setSupportedChannelList(SoftApConfiguration.BAND_5GHZ, testSupported5Glist);
+ capability.setSupportedChannelList(SoftApConfiguration.BAND_60GHZ, testSupported60Glist);
Parcel parcelW = Parcel.obtain();
capability.writeToParcel(parcelW, 0);
diff --git a/wifi/tests/src/android/net/wifi/SoftApConfigurationTest.java b/wifi/tests/src/android/net/wifi/SoftApConfigurationTest.java
index bcfdf7d80061..a609a120b61f 100644
--- a/wifi/tests/src/android/net/wifi/SoftApConfigurationTest.java
+++ b/wifi/tests/src/android/net/wifi/SoftApConfigurationTest.java
@@ -519,4 +519,14 @@ public class SoftApConfigurationTest {
}
assertTrue(isIllegalArgumentExceptionHappened);
}
+
+ @Test(expected = IllegalArgumentException.class)
+ public void testInvalidConfigWhenSet60GhzChannels() throws Exception {
+ SparseIntArray invalid_channels = new SparseIntArray();
+ invalid_channels.put(SoftApConfiguration.BAND_60GHZ, 99);
+ SoftApConfiguration config = new SoftApConfiguration.Builder()
+ .setSsid("ssid")
+ .setChannels(invalid_channels)
+ .build();
+ }
}
diff --git a/wifi/tests/src/android/net/wifi/SoftApInfoTest.java b/wifi/tests/src/android/net/wifi/SoftApInfoTest.java
index 28758432119c..2121d10121b0 100644
--- a/wifi/tests/src/android/net/wifi/SoftApInfoTest.java
+++ b/wifi/tests/src/android/net/wifi/SoftApInfoTest.java
@@ -32,17 +32,22 @@ import org.junit.Test;
*/
@SmallTest
public class SoftApInfoTest {
-
+ private static final String TEST_AP_INSTANCE = "wlan1";
+ private static final int TEST_FREQUENCY = 2412;
+ private static final int TEST_BANDWIDTH = SoftApInfo.CHANNEL_WIDTH_20MHZ;
+ private static final int TEST_WIFI_STANDARD = ScanResult.WIFI_STANDARD_LEGACY;
+ private static final MacAddress TEST_AP_MAC = MacAddress.fromString("aa:bb:cc:dd:ee:ff");
/**
* Verifies copy constructor.
*/
@Test
public void testCopyOperator() throws Exception {
SoftApInfo info = new SoftApInfo();
- info.setFrequency(2412);
- info.setBandwidth(SoftApInfo.CHANNEL_WIDTH_20MHZ);
- info.setBssid(MacAddress.fromString("aa:bb:cc:dd:ee:ff"));
- info.setWifiStandard(ScanResult.WIFI_STANDARD_LEGACY);
+ info.setFrequency(TEST_FREQUENCY);
+ info.setBandwidth(TEST_BANDWIDTH);
+ info.setBssid(TEST_AP_MAC);
+ info.setWifiStandard(TEST_WIFI_STANDARD);
+ info.setApInstanceIdentifier(TEST_AP_INSTANCE);
SoftApInfo copiedInfo = new SoftApInfo(info);
@@ -57,10 +62,11 @@ public class SoftApInfoTest {
@Test
public void testParcelOperation() throws Exception {
SoftApInfo info = new SoftApInfo();
- info.setFrequency(2412);
- info.setBandwidth(SoftApInfo.CHANNEL_WIDTH_20MHZ);
- info.setBssid(MacAddress.fromString("aa:bb:cc:dd:ee:ff"));
- info.setWifiStandard(ScanResult.WIFI_STANDARD_LEGACY);
+ info.setFrequency(TEST_FREQUENCY);
+ info.setBandwidth(TEST_BANDWIDTH);
+ info.setBssid(TEST_AP_MAC);
+ info.setWifiStandard(TEST_WIFI_STANDARD);
+ info.setApInstanceIdentifier(TEST_AP_INSTANCE);
Parcel parcelW = Parcel.obtain();
info.writeToParcel(parcelW, 0);
@@ -88,6 +94,27 @@ public class SoftApInfoTest {
if (SdkLevel.isAtLeastS()) {
assertEquals(info.getBssid(), null);
assertEquals(info.getWifiStandard(), ScanResult.WIFI_STANDARD_UNKNOWN);
+ assertEquals(info.getApInstanceIdentifier(), null);
+ }
+ }
+
+ /**
+ * Verifies the set/get method same as expected.
+ */
+ @Test
+ public void testGetXXXAlignedWithSetXXX() throws Exception {
+ SoftApInfo info = new SoftApInfo();
+ info.setFrequency(TEST_FREQUENCY);
+ info.setBandwidth(TEST_BANDWIDTH);
+ info.setBssid(TEST_AP_MAC);
+ info.setWifiStandard(TEST_WIFI_STANDARD);
+ info.setApInstanceIdentifier(TEST_AP_INSTANCE);
+ assertEquals(info.getFrequency(), TEST_FREQUENCY);
+ assertEquals(info.getBandwidth(), TEST_BANDWIDTH);
+ if (SdkLevel.isAtLeastS()) {
+ assertEquals(info.getBssid(), TEST_AP_MAC);
+ assertEquals(info.getWifiStandard(), TEST_WIFI_STANDARD);
+ assertEquals(info.getApInstanceIdentifier(), TEST_AP_INSTANCE);
}
}
diff --git a/wifi/tests/src/android/net/wifi/WifiClientTest.java b/wifi/tests/src/android/net/wifi/WifiClientTest.java
index 7a3baf9ebaf2..704656320a91 100644
--- a/wifi/tests/src/android/net/wifi/WifiClientTest.java
+++ b/wifi/tests/src/android/net/wifi/WifiClientTest.java
@@ -42,9 +42,9 @@ public class WifiClientTest {
*/
@Test
public void testWifiClientParcelWriteRead() throws Exception {
- WifiClient writeWifiClient = new WifiClient(MAC_ADDRESS);
+ WifiClient writeWifiClient = new WifiClient(MAC_ADDRESS, INTERFACE_NAME);
- assertParcelSane(writeWifiClient, 1);
+ assertParcelSane(writeWifiClient, 2);
}
/**
@@ -52,12 +52,12 @@ public class WifiClientTest {
*/
@Test
public void testWifiClientEquals() throws Exception {
- WifiClient writeWifiClient = new WifiClient(MAC_ADDRESS);
- WifiClient writeWifiClientEquals = new WifiClient(MAC_ADDRESS);
+ WifiClient writeWifiClient = new WifiClient(MAC_ADDRESS, INTERFACE_NAME);
+ WifiClient writeWifiClientEquals = new WifiClient(MAC_ADDRESS, INTERFACE_NAME);
assertEquals(writeWifiClient, writeWifiClientEquals);
assertEquals(writeWifiClient.hashCode(), writeWifiClientEquals.hashCode());
- assertFieldCountEquals(1, WifiClient.class);
+ assertFieldCountEquals(2, WifiClient.class);
}
/**
@@ -66,8 +66,8 @@ public class WifiClientTest {
@Test
public void testWifiClientNotEquals() throws Exception {
final MacAddress macAddressNotEquals = MacAddress.fromString("00:00:00:00:00:00");
- WifiClient writeWifiClient = new WifiClient(MAC_ADDRESS);
- WifiClient writeWifiClientNotEquals = new WifiClient(macAddressNotEquals);
+ WifiClient writeWifiClient = new WifiClient(MAC_ADDRESS, INTERFACE_NAME);
+ WifiClient writeWifiClientNotEquals = new WifiClient(macAddressNotEquals, INTERFACE_NAME);
assertNotEquals(writeWifiClient, writeWifiClientNotEquals);
assertNotEquals(writeWifiClient.hashCode(), writeWifiClientNotEquals.hashCode());
diff --git a/wifi/tests/src/android/net/wifi/WifiConfigurationTest.java b/wifi/tests/src/android/net/wifi/WifiConfigurationTest.java
index c25374695463..f351e61b5eb8 100644
--- a/wifi/tests/src/android/net/wifi/WifiConfigurationTest.java
+++ b/wifi/tests/src/android/net/wifi/WifiConfigurationTest.java
@@ -20,11 +20,13 @@ import static android.net.wifi.WifiConfiguration.SECURITY_TYPE_EAP;
import static android.net.wifi.WifiConfiguration.SECURITY_TYPE_EAP_WPA3_ENTERPRISE;
import static android.net.wifi.WifiConfiguration.SECURITY_TYPE_EAP_WPA3_ENTERPRISE_192_BIT;
import static android.net.wifi.WifiConfiguration.SECURITY_TYPE_OPEN;
+import static android.net.wifi.WifiConfiguration.SECURITY_TYPE_OSEN;
import static android.net.wifi.WifiConfiguration.SECURITY_TYPE_OWE;
import static android.net.wifi.WifiConfiguration.SECURITY_TYPE_PSK;
import static android.net.wifi.WifiConfiguration.SECURITY_TYPE_SAE;
import static android.net.wifi.WifiConfiguration.SECURITY_TYPE_WAPI_CERT;
import static android.net.wifi.WifiConfiguration.SECURITY_TYPE_WAPI_PSK;
+import static android.net.wifi.WifiConfiguration.SECURITY_TYPE_WEP;
import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
@@ -34,9 +36,13 @@ import static org.junit.Assert.assertNotSame;
import static org.junit.Assert.assertTrue;
import android.net.MacAddress;
+import android.net.wifi.WifiConfiguration.GroupCipher;
import android.net.wifi.WifiConfiguration.KeyMgmt;
import android.net.wifi.WifiConfiguration.NetworkSelectionStatus;
+import android.net.wifi.WifiConfiguration.PairwiseCipher;
+import android.net.wifi.WifiConfiguration.Protocol;
import android.os.Parcel;
+import android.util.Pair;
import androidx.test.filters.SmallTest;
@@ -45,6 +51,8 @@ import com.android.net.module.util.MacAddressUtils;
import org.junit.Before;
import org.junit.Test;
+import java.util.List;
+
/**
* Unit tests for {@link android.net.wifi.WifiConfiguration}.
*/
@@ -187,18 +195,24 @@ public class WifiConfigurationTest {
@Test
public void testIsOpenNetwork_NotOpen_HasAuthType() {
- for (int keyMgmt = 0; keyMgmt < WifiConfiguration.KeyMgmt.strings.length; keyMgmt++) {
- if (keyMgmt == WifiConfiguration.KeyMgmt.NONE
- || keyMgmt == WifiConfiguration.KeyMgmt.OWE) {
- continue;
- }
+ int[] securityTypes = new int [] {
+ SECURITY_TYPE_WEP,
+ SECURITY_TYPE_PSK,
+ SECURITY_TYPE_EAP,
+ SECURITY_TYPE_SAE,
+ SECURITY_TYPE_EAP_WPA3_ENTERPRISE_192_BIT,
+ SECURITY_TYPE_WAPI_PSK,
+ SECURITY_TYPE_WAPI_CERT,
+ SECURITY_TYPE_EAP_WPA3_ENTERPRISE,
+ SECURITY_TYPE_OSEN,
+ };
+ for (int type: securityTypes) {
WifiConfiguration config = new WifiConfiguration();
- config.allowedKeyManagement.clear();
- config.allowedKeyManagement.set(keyMgmt);
+ config.setSecurityParams(type);
config.wepKeys = null;
- assertFalse("Open network reported when key mgmt was set to "
- + WifiConfiguration.KeyMgmt.strings[keyMgmt], config.isOpenNetwork());
+ assertFalse("Open network reported when security type was set to "
+ + type, config.isOpenNetwork());
}
}
@@ -208,6 +222,7 @@ public class WifiConfigurationTest {
config.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.NONE);
config.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.WPA_EAP);
config.wepKeys = null;
+ config.convertLegacyFieldsToSecurityParamsIfNeeded();
assertFalse(config.isOpenNetwork());
}
@@ -865,4 +880,243 @@ public class WifiConfigurationTest {
}
return sb.toString();
}
+
+ private void verifyAllowedKeyManagement(WifiConfiguration config, int[] akms) {
+ for (int akm: akms) {
+ assertTrue(config.getSecurityParamsList().stream()
+ .anyMatch(params -> params.getAllowedKeyManagement().get(akm)));
+ }
+ }
+
+ private void verifyAllowedProtocols(WifiConfiguration config, int[] aps) {
+ for (int ap: aps) {
+ assertTrue(config.getSecurityParamsList().stream()
+ .anyMatch(params -> params.getAllowedProtocols().get(ap)));
+ }
+ }
+
+ private void verifyAllowedPairwiseCiphers(WifiConfiguration config, int[] apcs) {
+ for (int apc: apcs) {
+ assertTrue(config.getSecurityParamsList().stream()
+ .anyMatch(params -> params.getAllowedPairwiseCiphers().get(apc)));
+ }
+ }
+
+ private void verifyAllowedGroupCiphers(WifiConfiguration config, int[] agcs) {
+ for (int agc: agcs) {
+ assertTrue(config.getSecurityParamsList().stream()
+ .anyMatch(params -> params.getAllowedGroupCiphers().get(agc)));
+ }
+ }
+
+ /** Verify that adding security types works as expected. */
+ @Test
+ public void testAddSecurityTypes() {
+ WifiConfiguration config = new WifiConfiguration();
+ config.setSecurityParams(WifiConfiguration.SECURITY_TYPE_PSK);
+ config.addSecurityParams(WifiConfiguration.SECURITY_TYPE_SAE);
+ config.addSecurityParams(SecurityParams.createWapiPskParams());
+ List<SecurityParams> paramsList = config.getSecurityParamsList();
+ assertEquals(3, paramsList.size());
+
+ verifyAllowedKeyManagement(config, new int[] {
+ KeyMgmt.WPA_PSK, KeyMgmt.SAE, KeyMgmt.WAPI_PSK});
+ verifyAllowedProtocols(config, new int[] {Protocol.WPA, Protocol.RSN, Protocol.WAPI});
+ verifyAllowedPairwiseCiphers(config, new int[] {
+ PairwiseCipher.CCMP, PairwiseCipher.TKIP,
+ PairwiseCipher.GCMP_128, PairwiseCipher.GCMP_256,
+ PairwiseCipher.SMS4});
+ verifyAllowedGroupCiphers(config, new int[] {
+ GroupCipher.CCMP, GroupCipher.TKIP,
+ GroupCipher.GCMP_128, GroupCipher.GCMP_256,
+ GroupCipher.SMS4});
+ }
+
+ /** Check that a personal security type can be added to a personal configuration. */
+ @Test
+ public void testAddPersonalTypeToPersonalConfiguration() {
+ WifiConfiguration config = new WifiConfiguration();
+ config.addSecurityParams(WifiConfiguration.SECURITY_TYPE_PSK);
+ config.addSecurityParams(WifiConfiguration.SECURITY_TYPE_SAE);
+ }
+
+ /** Check that an enterprise security type can be added to an enterprise configuration. */
+ @Test
+ public void testAddEnterpriseTypeToEnterpriseConfiguration() {
+ WifiConfiguration config = new WifiConfiguration();
+ config.addSecurityParams(WifiConfiguration.SECURITY_TYPE_EAP);
+ config.enterpriseConfig.setEapMethod(WifiEnterpriseConfig.Eap.SIM);
+ config.enterpriseConfig.setPhase2Method(WifiEnterpriseConfig.Phase2.NONE);
+ config.addSecurityParams(WifiConfiguration.SECURITY_TYPE_EAP_WPA3_ENTERPRISE);
+ }
+
+ /** Verify that adding an enterprise type to a personal configuration. */
+ @Test (expected = IllegalArgumentException.class)
+ public void testAddEnterpriseTypeToPersonalConfig() {
+ WifiConfiguration config = new WifiConfiguration();
+ config.setSecurityParams(WifiConfiguration.SECURITY_TYPE_PSK);
+ config.addSecurityParams(WifiConfiguration.SECURITY_TYPE_EAP);
+ }
+
+ /** Verify that adding a personal type to an enterprise configuration. */
+ @Test (expected = IllegalArgumentException.class)
+ public void testAddPersonalTypeToEnterpriseConfig() {
+ WifiConfiguration config = new WifiConfiguration();
+ config.setSecurityParams(WifiConfiguration.SECURITY_TYPE_EAP);
+ config.enterpriseConfig.setEapMethod(WifiEnterpriseConfig.Eap.SIM);
+ config.enterpriseConfig.setPhase2Method(WifiEnterpriseConfig.Phase2.NONE);
+ config.addSecurityParams(WifiConfiguration.SECURITY_TYPE_PSK);
+ }
+
+ /** Check that an open security cannot be added to a non-open configuration. */
+ @Test(expected = IllegalArgumentException.class)
+ public void testAddOpenTypeToNonOpenConfiguration() {
+ WifiConfiguration config = new WifiConfiguration();
+ config.addSecurityParams(WifiConfiguration.SECURITY_TYPE_PSK);
+ config.addSecurityParams(WifiConfiguration.SECURITY_TYPE_OPEN);
+ }
+
+ /** Check that a non-open security cannot be added to an open configuration. */
+ @Test(expected = IllegalArgumentException.class)
+ public void testAddNonOpenTypeToOpenConfiguration() {
+ WifiConfiguration config = new WifiConfiguration();
+ config.addSecurityParams(WifiConfiguration.SECURITY_TYPE_OPEN);
+ config.addSecurityParams(WifiConfiguration.SECURITY_TYPE_PSK);
+ }
+
+ /** Check that a OSEN security cannot be added as additional type. */
+ @Test(expected = IllegalArgumentException.class)
+ public void testAddOsenTypeToConfiguration() {
+ WifiConfiguration config = new WifiConfiguration();
+ config.addSecurityParams(WifiConfiguration.SECURITY_TYPE_PSK);
+ config.addSecurityParams(WifiConfiguration.SECURITY_TYPE_OSEN);
+ }
+
+ /** Verify that adding duplicate security types raises the exception. */
+ @Test (expected = IllegalArgumentException.class)
+ public void testAddDuplicateSecurityTypes() {
+ WifiConfiguration config = new WifiConfiguration();
+ config.setSecurityParams(WifiConfiguration.SECURITY_TYPE_PSK);
+ config.addSecurityParams(WifiConfiguration.SECURITY_TYPE_PSK);
+ }
+
+ /** Verify that adding duplicate security params raises the exception. */
+ @Test (expected = IllegalArgumentException.class)
+ public void testAddDuplicateSecurityParams() {
+ WifiConfiguration config = new WifiConfiguration();
+ config.addSecurityParams(SecurityParams.createWpaWpa2PersonalParams());
+ config.addSecurityParams(SecurityParams.createWpaWpa2PersonalParams());
+ }
+
+ /** Verify that Suite-B type works as expected. */
+ @Test
+ public void testAddSuiteBSecurityType() {
+ WifiConfiguration config = new WifiConfiguration();
+ config.addSecurityParams(SecurityParams.createWpa3EnterpriseParams());
+ config.enterpriseConfig.setEapMethod(WifiEnterpriseConfig.Eap.SIM);
+ config.enterpriseConfig.setPhase2Method(WifiEnterpriseConfig.Phase2.NONE);
+ config.addSecurityParams(SecurityParams.createWpa3Enterprise192BitParams());
+
+ assertFalse(config.isSuiteBCipherEcdheRsaEnabled());
+ config.enableSuiteBCiphers(false, true);
+ assertTrue(config.isSuiteBCipherEcdheRsaEnabled());
+ }
+
+ /** Verify that FILS bit can be set correctly. */
+ @Test
+ public void testFilsKeyMgmt() {
+ WifiConfiguration config = new WifiConfiguration();
+ config.setSecurityParams(WifiConfiguration.SECURITY_TYPE_PSK);
+ config.addSecurityParams(WifiConfiguration.SECURITY_TYPE_SAE);
+
+ config.enableFils(false, true);
+ assertFalse(config.isFilsSha256Enabled());
+ assertTrue(config.isFilsSha384Enabled());
+ }
+
+ /** Verify that SAE mode can be configured correctly. */
+ @Test
+ public void testSaeTypeMethods() {
+ WifiConfiguration config = new WifiConfiguration();
+ config.setSecurityParams(WifiConfiguration.SECURITY_TYPE_PSK);
+ config.addSecurityParams(WifiConfiguration.SECURITY_TYPE_SAE);
+
+ SecurityParams saeParams = config.getSecurityParams(WifiConfiguration.SECURITY_TYPE_SAE);
+ assertNotNull(saeParams);
+ assertFalse(saeParams.isSaeH2eOnlyMode());
+ assertFalse(saeParams.isSaePkOnlyMode());
+
+ config.enableSaeH2eOnlyMode(true);
+ config.enableSaePkOnlyMode(true);
+
+ saeParams = config.getSecurityParams(WifiConfiguration.SECURITY_TYPE_SAE);
+ assertNotNull(saeParams);
+ assertTrue(saeParams.isSaeH2eOnlyMode());
+ assertTrue(saeParams.isSaePkOnlyMode());
+ }
+
+ /** Verify the legacy configuration conversion */
+ @Test
+ public void testLegacyConfigurationConversion() {
+ Pair[] keyMgmtSecurityTypePairs = new Pair[] {
+ new Pair<>(KeyMgmt.WAPI_CERT, SECURITY_TYPE_WAPI_CERT),
+ new Pair<>(KeyMgmt.WAPI_PSK, SECURITY_TYPE_WAPI_PSK),
+ new Pair<>(KeyMgmt.SUITE_B_192, SECURITY_TYPE_EAP_WPA3_ENTERPRISE_192_BIT),
+ new Pair<>(KeyMgmt.OWE, SECURITY_TYPE_OWE),
+ new Pair<>(KeyMgmt.SAE, SECURITY_TYPE_SAE),
+ new Pair<>(KeyMgmt.OSEN, SECURITY_TYPE_OSEN),
+ new Pair<>(KeyMgmt.WPA2_PSK, SECURITY_TYPE_PSK),
+ new Pair<>(KeyMgmt.WPA_EAP, SECURITY_TYPE_EAP),
+ new Pair<>(KeyMgmt.WPA_PSK, SECURITY_TYPE_PSK),
+ new Pair<>(KeyMgmt.NONE, SECURITY_TYPE_OPEN),
+ };
+
+ for (Pair pair: keyMgmtSecurityTypePairs) {
+ WifiConfiguration config = new WifiConfiguration();
+ config.allowedKeyManagement.set((int) pair.first);
+ config.convertLegacyFieldsToSecurityParamsIfNeeded();
+ assertNotNull(config.getSecurityParams((int) pair.second));
+ }
+
+ // If none of key management is set, it should be open.
+ WifiConfiguration emptyConfig = new WifiConfiguration();
+ emptyConfig.convertLegacyFieldsToSecurityParamsIfNeeded();
+ assertNotNull(emptyConfig.getSecurityParams(SECURITY_TYPE_OPEN));
+
+ // If EAP key management is set and requirePmf is true, it is WPA3 Enterprise.
+ WifiConfiguration wpa3EnterpriseConfig = new WifiConfiguration();
+ wpa3EnterpriseConfig.allowedKeyManagement.set(KeyMgmt.WPA_EAP);
+ wpa3EnterpriseConfig.requirePmf = true;
+ wpa3EnterpriseConfig.convertLegacyFieldsToSecurityParamsIfNeeded();
+ assertNotNull(wpa3EnterpriseConfig.getSecurityParams(SECURITY_TYPE_EAP_WPA3_ENTERPRISE));
+
+ // If key management is NONE and wep key is set, it is WEP type.
+ WifiConfiguration wepConfig = new WifiConfiguration();
+ wepConfig.allowedKeyManagement.set(KeyMgmt.NONE);
+ wepConfig.wepKeys = new String[] {"\"abcdef\""};
+ wepConfig.convertLegacyFieldsToSecurityParamsIfNeeded();
+ assertNotNull(wepConfig.getSecurityParams(SECURITY_TYPE_WEP));
+ }
+
+ /** Verify the set security params by SecurityParams objects. */
+ @Test
+ public void testSetBySecurityParamsObject() {
+ Pair[] securityParamsSecurityTypePairs = new Pair[] {
+ new Pair<>(SecurityParams.createWapiCertParams(), SECURITY_TYPE_WAPI_CERT),
+ new Pair<>(SecurityParams.createWapiPskParams(), SECURITY_TYPE_WAPI_PSK),
+ new Pair<>(SecurityParams.createWpa3Enterprise192BitParams(),
+ SECURITY_TYPE_EAP_WPA3_ENTERPRISE_192_BIT),
+ new Pair<>(SecurityParams.createEnhancedOpenParams(), SECURITY_TYPE_OWE),
+ new Pair<>(SecurityParams.createWpa3PersonalParams(), SECURITY_TYPE_SAE),
+ new Pair<>(SecurityParams.createOsenParams(), SECURITY_TYPE_OSEN),
+ new Pair<>(SecurityParams.createWpaWpa2EnterpriseParams(), SECURITY_TYPE_EAP),
+ new Pair<>(SecurityParams.createWpaWpa2PersonalParams(), SECURITY_TYPE_PSK),
+ new Pair<>(SecurityParams.createOpenParams(), SECURITY_TYPE_OPEN),
+ };
+ for (Pair pair: securityParamsSecurityTypePairs) {
+ WifiConfiguration config = new WifiConfiguration();
+ config.setSecurityParams((SecurityParams) pair.first);
+ assertNotNull(config.getSecurityParams((int) pair.second));
+ }
+ }
}
diff --git a/wifi/tests/src/android/net/wifi/WifiManagerTest.java b/wifi/tests/src/android/net/wifi/WifiManagerTest.java
index 52e91394d8bf..bd56e5b49ee6 100644
--- a/wifi/tests/src/android/net/wifi/WifiManagerTest.java
+++ b/wifi/tests/src/android/net/wifi/WifiManagerTest.java
@@ -137,6 +137,7 @@ public class WifiManagerTest {
private static final int TEST_AP_FREQUENCY = 2412;
private static final int TEST_AP_BANDWIDTH = SoftApInfo.CHANNEL_WIDTH_20MHZ;
private static final int TEST_SUB_ID = 3;
+ private static final String TEST_AP_INSTANCE = "wlan1";
@Mock Context mContext;
@Mock android.net.wifi.IWifiManager mWifiService;
@@ -1111,6 +1112,27 @@ public class WifiManagerTest {
verify(mSoftApCallback).onInfoChanged(testSoftApInfo);
}
+ /*
+ * Verify client-provided callback is being called through callback proxy
+ */
+ @Test
+ public void softApCallbackProxyCallsOnSoftApInfoListChanged() throws Exception {
+ SoftApInfo testSoftApInfo = new SoftApInfo();
+ testSoftApInfo.setFrequency(TEST_AP_FREQUENCY);
+ testSoftApInfo.setBandwidth(TEST_AP_BANDWIDTH);
+ List<SoftApInfo> infoList = new ArrayList<>();
+ infoList.add(testSoftApInfo);
+ ArgumentCaptor<ISoftApCallback.Stub> callbackCaptor =
+ ArgumentCaptor.forClass(ISoftApCallback.Stub.class);
+ mWifiManager.registerSoftApCallback(new HandlerExecutor(mHandler), mSoftApCallback);
+ verify(mWifiService).registerSoftApCallback(any(IBinder.class), callbackCaptor.capture(),
+ anyInt());
+
+ callbackCaptor.getValue().onInfoListChanged(infoList);
+ mLooper.dispatchAll();
+ verify(mSoftApCallback).onInfoListChanged(infoList);
+ }
+
/*
* Verify client-provided callback is being called through callback proxy
@@ -1135,7 +1157,8 @@ public class WifiManagerTest {
*/
@Test
public void softApCallbackProxyCallsOnBlockedClientConnecting() throws Exception {
- WifiClient testWifiClient = new WifiClient(MacAddress.fromString("22:33:44:55:66:77"));
+ WifiClient testWifiClient = new WifiClient(MacAddress.fromString("22:33:44:55:66:77"),
+ TEST_AP_INSTANCE);
ArgumentCaptor<ISoftApCallback.Stub> callbackCaptor =
ArgumentCaptor.forClass(ISoftApCallback.Stub.class);
mWifiManager.registerSoftApCallback(new HandlerExecutor(mHandler), mSoftApCallback);
@@ -1157,6 +1180,8 @@ public class WifiManagerTest {
SoftApInfo testSoftApInfo = new SoftApInfo();
testSoftApInfo.setFrequency(TEST_AP_FREQUENCY);
testSoftApInfo.setBandwidth(TEST_AP_BANDWIDTH);
+ List<SoftApInfo> infoList = new ArrayList<>();
+ infoList.add(testSoftApInfo);
SoftApCapability testSoftApCapability = new SoftApCapability(0);
testSoftApCapability.setMaxSupportedClients(10);
ArgumentCaptor<ISoftApCallback.Stub> callbackCaptor =
@@ -1169,6 +1194,7 @@ public class WifiManagerTest {
callbackCaptor.getValue().onStateChanged(WIFI_AP_STATE_ENABLING, 0);
callbackCaptor.getValue().onConnectedClientsChanged(testClients);
callbackCaptor.getValue().onInfoChanged(testSoftApInfo);
+ callbackCaptor.getValue().onInfoListChanged(infoList);
callbackCaptor.getValue().onStateChanged(WIFI_AP_STATE_FAILED, SAP_START_FAILURE_GENERAL);
callbackCaptor.getValue().onCapabilityChanged(testSoftApCapability);
@@ -1177,6 +1203,7 @@ public class WifiManagerTest {
verify(mSoftApCallback).onStateChanged(WIFI_AP_STATE_ENABLING, 0);
verify(mSoftApCallback).onConnectedClientsChanged(testClients);
verify(mSoftApCallback).onInfoChanged(testSoftApInfo);
+ verify(mSoftApCallback).onInfoListChanged(infoList);
verify(mSoftApCallback).onStateChanged(WIFI_AP_STATE_FAILED, SAP_START_FAILURE_GENERAL);
verify(mSoftApCallback).onCapabilityChanged(testSoftApCapability);
}
diff --git a/wifi/tests/src/android/net/wifi/rtt/WifiRttManagerTest.java b/wifi/tests/src/android/net/wifi/rtt/WifiRttManagerTest.java
index e6eae416ba78..c8006fead55b 100644
--- a/wifi/tests/src/android/net/wifi/rtt/WifiRttManagerTest.java
+++ b/wifi/tests/src/android/net/wifi/rtt/WifiRttManagerTest.java
@@ -16,6 +16,8 @@
package android.net.wifi.rtt;
+import static junit.framework.Assert.fail;
+
import static org.junit.Assert.assertEquals;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.eq;
@@ -143,6 +145,7 @@ public class WifiRttManagerTest {
PeerHandle peerHandle1 = new PeerHandle(12);
RangingRequest.Builder builder = new RangingRequest.Builder();
+ builder.setRttBurstSize(4);
builder.addAccessPoint(scanResult1);
builder.addAccessPoints(scanResults2and3);
builder.addWifiAwarePeer(mac1);
@@ -163,6 +166,60 @@ public class WifiRttManagerTest {
}
/**
+ * Validate the rtt burst size is set correctly when in range.
+ */
+ @Test
+ public void testRangingRequestSetBurstSize() {
+ ScanResult scanResult = new ScanResult();
+ scanResult.BSSID = "AA:BB:CC:DD:EE:FF";
+
+ // create request
+ RangingRequest.Builder builder = new RangingRequest.Builder();
+ builder.setRttBurstSize(4);
+ builder.addAccessPoint(scanResult);
+ RangingRequest request = builder.build();
+
+ // confirm rtt burst size is set correctly to default value
+ assertEquals(request.getRttBurstSize(), 4);
+ }
+
+ /**
+ * Validate the rtt burst size cannot be smaller than the minimum.
+ */
+ @Test
+ public void testRangingRequestMinBurstSizeIsEnforced() {
+ ScanResult scanResult = new ScanResult();
+ scanResult.BSSID = "AA:BB:CC:DD:EE:FF";
+
+ // create request
+ try {
+ RangingRequest.Builder builder = new RangingRequest.Builder();
+ builder.setRttBurstSize(RangingRequest.getMinRttBurstSize() - 1);
+ fail("RTT burst size was smaller than min value.");
+ } catch (IllegalArgumentException e) {
+ // expected
+ }
+ }
+
+ /**
+ * Validate the rtt burst size cannot exceed the maximum.
+ */
+ @Test
+ public void testRangingRequestMaxBurstSizeIsEnforced() {
+ ScanResult scanResult = new ScanResult();
+ scanResult.BSSID = "AA:BB:CC:DD:EE:FF";
+
+ // create request
+ try {
+ RangingRequest.Builder builder = new RangingRequest.Builder();
+ builder.setRttBurstSize(RangingRequest.getMaxRttBurstSize() + 1);
+ fail("RTT Burst size exceeded max value.");
+ } catch (IllegalArgumentException e) {
+ // expected
+ }
+ }
+
+ /**
* Validate that can request as many range operation as the upper limit on number of requests.
*/
@Test
@@ -175,7 +232,7 @@ public class WifiRttManagerTest {
}
MacAddress mac1 = MacAddress.fromString("00:01:02:03:04:05");
- // create request
+ // create request using max RTT Peers
RangingRequest.Builder builder = new RangingRequest.Builder();
builder.addAccessPoint(scanResult);
builder.addAccessPoints(scanResultList);
@@ -185,6 +242,18 @@ public class WifiRttManagerTest {
// verify request
request.enforceValidity(true);
+ // confirm rtt burst size is set correctly to default value
+ assertEquals(request.getRttBurstSize(), RangingRequest.getDefaultRttBurstSize());
+ // confirm the number of peers in the request is the max number of peers
+ List<ResponderConfig> rttPeers = request.getRttPeers();
+ int numRttPeers = rttPeers.size();
+ assertEquals(RangingRequest.getMaxPeers(), numRttPeers);
+ // confirm each peer has the correct mac address
+ for (int i = 0; i < numRttPeers - 1; ++i) {
+ assertEquals("AA:BB:CC:DD:EE:FF", rttPeers.get(i).macAddress.toString().toUpperCase());
+ }
+ assertEquals("00:01:02:03:04:05",
+ rttPeers.get(numRttPeers - 1).macAddress.toString().toUpperCase());
}
/**