diff --git a/AconfigFlags.bp b/AconfigFlags.bp index 54baae5a886dcde9b368f7e499a6dc52cd2d8280..5ea35210b5aedfefb9a7ca04f42ad71d96a24fd4 100644 --- a/AconfigFlags.bp +++ b/AconfigFlags.bp @@ -20,28 +20,35 @@ aconfig_declarations_group { java_aconfig_libraries: [ // !!! KEEP THIS LIST ALPHABETICAL !!! "aconfig_mediacodec_flags_java_lib", + "android.adaptiveauth.flags-aconfig-java", "android.app.flags-aconfig-java", + "android.app.ondeviceintelligence-aconfig-java", "android.app.smartspace.flags-aconfig-java", "android.app.usage.flags-aconfig-java", + "android.app.wearable.flags-aconfig-java", "android.appwidget.flags-aconfig-java", + "android.chre.flags-aconfig-java", "android.companion.flags-aconfig-java", "android.companion.virtual.flags-aconfig-java", + "android.companion.virtualdevice.flags-aconfig-java", + "android.content.flags-aconfig-java", "android.content.pm.flags-aconfig-java", "android.content.res.flags-aconfig-java", "android.crashrecovery.flags-aconfig-java", "android.credentials.flags-aconfig-java", "android.database.sqlite-aconfig-java", "android.hardware.biometrics.flags-aconfig-java", + "android.hardware.devicestate.feature.flags-aconfig-java", "android.hardware.flags-aconfig-java", "android.hardware.radio.flags-aconfig-java", "android.hardware.usb.flags-aconfig-java", "android.location.flags-aconfig-java", "android.media.codec-aconfig-java", - "android.media.playback.flags-aconfig-java", "android.media.tv.flags-aconfig-java", "android.multiuser.flags-aconfig-java", "android.net.platform.flags-aconfig-java", "android.net.vcn.flags-aconfig-java", + "android.net.wifi.flags-aconfig-java", "android.nfc.flags-aconfig-java", "android.os.flags-aconfig-java", "android.os.vibrator.flags-aconfig-java", @@ -54,7 +61,10 @@ aconfig_declarations_group { "android.service.controls.flags-aconfig-java", "android.service.dreams.flags-aconfig-java", "android.service.notification.flags-aconfig-java", + "android.service.appprediction.flags-aconfig-java", "android.service.voice.flags-aconfig-java", + "android.speech.flags-aconfig-java", + "android.systemserver.flags-aconfig-java", "android.tracing.flags-aconfig-java", "android.view.accessibility.flags-aconfig-java", "android.view.contentcapture.flags-aconfig-java", @@ -63,13 +73,17 @@ aconfig_declarations_group { "android.view.inputmethod.flags-aconfig-java", "android.webkit.flags-aconfig-java", "android.widget.flags-aconfig-java", + "backup_flags_lib", "camera_platform_flags_core_java_lib", "com.android.hardware.input-aconfig-java", "com.android.input.flags-aconfig-java", "com.android.internal.foldables.flags-aconfig-java", + "com.android.internal.pm.pkg.component.flags-aconfig-java", "com.android.media.flags.bettertogether-aconfig-java", + "com.android.media.flags.editing-aconfig-java", + "com.android.media.flags.projection-aconfig-java", "com.android.net.thread.platform.flags-aconfig-java", - "com.android.server.flags.pinner-aconfig-java", + "com.android.server.flags.services-aconfig-java", "com.android.text.flags-aconfig-java", "com.android.window.flags.window-aconfig-java", "device_policy_aconfig_flags_lib", @@ -77,6 +91,7 @@ aconfig_declarations_group { "framework-jobscheduler-job.flags-aconfig-java", "framework_graphics_flags_java_lib", "hwui_flags_java_lib", + "power_flags_lib", "sdk_sandbox_flags_lib", "surfaceflinger_flags_java_lib", "telecom_flags_core_java_lib", @@ -96,10 +111,10 @@ filegroup { java_defaults { name: "framework-minus-apex-aconfig-libraries", // Add java_aconfig_libraries to here to add them to the core framework + // Add aconfig-annotations-lib as a dependency for the optimization srcs: [ ":framework-minus-apex-aconfig-declarations{.srcjars}", ], - // Add aconfig-annotations-lib as a dependency for the optimization libs: ["aconfig-annotations-lib"], } @@ -151,6 +166,20 @@ java_aconfig_library { defaults: ["framework-minus-apex-aconfig-java-defaults"], } +// DeviceStateManager +aconfig_declarations { + name: "android.hardware.devicestate.feature.flags-aconfig", + package: "android.hardware.devicestate.feature.flags", + container: "system", + srcs: ["core/java/android/hardware/devicestate/feature/*.aconfig"], +} + +java_aconfig_library { + name: "android.hardware.devicestate.feature.flags-aconfig-java", + aconfig_declarations: "android.hardware.devicestate.feature.flags-aconfig", + defaults: ["framework-minus-apex-aconfig-java-defaults"], +} + // Input aconfig_declarations { name: "com.android.hardware.input.input-aconfig", @@ -200,6 +229,12 @@ aconfig_declarations { ], } +cc_aconfig_library { + name: "android_location_flags_c_lib", + vendor_available: true, + aconfig_declarations: "android.location.flags-aconfig", +} + java_aconfig_library { name: "android.location.flags-aconfig-java", aconfig_declarations: "android.location.flags-aconfig", @@ -272,6 +307,13 @@ java_aconfig_library { defaults: ["framework-minus-apex-aconfig-java-defaults"], } +java_aconfig_library { + name: "android.app.usage.flags-aconfig-java-host", + aconfig_declarations: "android.app.usage.flags-aconfig", + host_supported: true, + defaults: ["framework-minus-apex-aconfig-java-defaults"], +} + // OS aconfig_declarations { name: "android.os.flags-aconfig", @@ -465,10 +507,7 @@ aconfig_declarations { name: "com.android.media.flags.bettertogether-aconfig", package: "com.android.media.flags", container: "system", - srcs: [ - "media/java/android/media/flags/media_better_together.aconfig", - "media/java/android/media/flags/fade_manager_configuration.aconfig", - ], + srcs: ["media/java/android/media/flags/media_better_together.aconfig"], } java_aconfig_library { @@ -477,6 +516,45 @@ java_aconfig_library { defaults: ["framework-minus-apex-aconfig-java-defaults"], } +java_aconfig_library { + name: "com.android.media.flags.bettertogether-aconfig-java-host", + aconfig_declarations: "com.android.media.flags.bettertogether-aconfig", + host_supported: true, + defaults: ["framework-minus-apex-aconfig-java-defaults"], +} + +// Media Editing +aconfig_declarations { + name: "com.android.media.flags.editing-aconfig", + package: "com.android.media.editing.flags", + container: "system", + srcs: [ + "media/java/android/media/flags/editing.aconfig", + ], +} + +java_aconfig_library { + name: "com.android.media.flags.editing-aconfig-java", + aconfig_declarations: "com.android.media.flags.editing-aconfig", + defaults: ["framework-minus-apex-aconfig-java-defaults"], +} + +// MediaProjection +aconfig_declarations { + name: "com.android.media.flags.projection-aconfig", + package: "com.android.media.projection.flags", + container: "system", + srcs: [ + "media/java/android/media/flags/projection.aconfig", + ], +} + +java_aconfig_library { + name: "com.android.media.flags.projection-aconfig-java", + aconfig_declarations: "com.android.media.flags.projection-aconfig", + defaults: ["framework-minus-apex-aconfig-java-defaults"], +} + // Media TV aconfig_declarations { name: "android.media.tv.flags-aconfig", @@ -491,6 +569,20 @@ java_aconfig_library { defaults: ["framework-minus-apex-aconfig-java-defaults"], } +// OnDeviceIntelligence +aconfig_declarations { + name: "android.app.ondeviceintelligence-aconfig", + package: "android.app.ondeviceintelligence.flags", + container: "system", + srcs: ["core/java/android/app/ondeviceintelligence/flags/ondevice_intelligence.aconfig"], +} + +java_aconfig_library { + name: "android.app.ondeviceintelligence-aconfig-java", + aconfig_declarations: "android.app.ondeviceintelligence-aconfig", + defaults: ["framework-minus-apex-aconfig-java-defaults"], +} + // Permissions aconfig_declarations { name: "android.permission.flags-aconfig", @@ -507,8 +599,8 @@ java_aconfig_library { apex_available: [ "//apex_available:platform", "com.android.permission", + "com.android.nfcservices", ], - } // SQLite @@ -635,17 +727,31 @@ java_aconfig_library { defaults: ["framework-minus-apex-aconfig-java-defaults"], } -// Pinner Service +// Server Services Flags aconfig_declarations { - name: "com.android.server.flags.pinner-aconfig", + name: "com.android.server.flags.services-aconfig", package: "com.android.server.flags", container: "system", - srcs: ["services/core/java/com/android/server/flags/pinner.aconfig"], + srcs: ["services/core/java/com/android/server/flags/*.aconfig"], +} + +java_aconfig_library { + name: "com.android.server.flags.services-aconfig-java", + aconfig_declarations: "com.android.server.flags.services-aconfig", + defaults: ["framework-minus-apex-aconfig-java-defaults"], +} + +// App prediction +aconfig_declarations { + name: "android.service.appprediction.flags-aconfig", + package: "android.service.appprediction.flags", + container: "system", + srcs: ["core/java/android/service/appprediction/flags/*.aconfig"], } java_aconfig_library { - name: "com.android.server.flags.pinner-aconfig-java", - aconfig_declarations: "com.android.server.flags.pinner-aconfig", + name: "android.service.appprediction.flags-aconfig-java", + aconfig_declarations: "android.service.appprediction.flags-aconfig", defaults: ["framework-minus-apex-aconfig-java-defaults"], } @@ -787,6 +893,13 @@ java_aconfig_library { defaults: ["framework-minus-apex-aconfig-java-defaults"], } +java_aconfig_library { + name: "device_policy_aconfig_flags_lib_host", + aconfig_declarations: "device_policy_aconfig_flags", + host_supported: true, + defaults: ["framework-minus-apex-aconfig-java-defaults"], +} + cc_aconfig_library { name: "device_policy_aconfig_flags_c_lib", aconfig_declarations: "device_policy_aconfig_flags", @@ -803,6 +916,11 @@ aconfig_declarations { java_aconfig_library { name: "android.service.chooser.flags-aconfig-java", aconfig_declarations: "android.service.chooser.flags-aconfig", + min_sdk_version: "34", + apex_available: [ + "//apex_available:platform", + "com.android.nfcservices", + ], defaults: ["framework-minus-apex-aconfig-java-defaults"], } @@ -838,6 +956,7 @@ java_aconfig_library { aconfig_declarations { name: "android.service.notification.flags-aconfig", package: "android.service.notification", + exportable: true, container: "system", srcs: ["core/java/android/service/notification/flags.aconfig"], } @@ -848,6 +967,18 @@ java_aconfig_library { defaults: ["framework-minus-apex-aconfig-java-defaults"], } +java_aconfig_library { + name: "android.service.notification.flags-aconfig-export-java", + aconfig_declarations: "android.service.notification.flags-aconfig", + defaults: ["framework-minus-apex-aconfig-java-defaults"], + mode: "exported", + min_sdk_version: "30", + apex_available: [ + "//apex_available:platform", + "com.android.extservices", + ], +} + // Smartspace aconfig_declarations { name: "android.app.smartspace.flags-aconfig", @@ -918,6 +1049,11 @@ java_aconfig_library { defaults: ["framework-minus-apex-aconfig-java-defaults"], } +cc_aconfig_library { + name: "android.tracing.flags_c_lib", + aconfig_declarations: "android.tracing.flags-aconfig", +} + // App Widgets aconfig_declarations { name: "android.appwidget.flags-aconfig", @@ -977,6 +1113,62 @@ java_aconfig_library { defaults: ["framework-minus-apex-aconfig-java-defaults"], } +// ContextHub +java_aconfig_library { + name: "android.chre.flags-aconfig-java", + aconfig_declarations: "chre_flags", + defaults: ["framework-minus-apex-aconfig-java-defaults"], +} + +// Speech +aconfig_declarations { + name: "android.speech.flags-aconfig", + package: "android.speech.flags", + container: "system", + srcs: ["core/java/android/speech/flags/*.aconfig"], +} + +java_aconfig_library { + name: "android.speech.flags-aconfig-java", + aconfig_declarations: "android.speech.flags-aconfig", + defaults: ["framework-minus-apex-aconfig-java-defaults"], +} + +// Power +java_aconfig_library { + name: "power_flags_lib", + aconfig_declarations: "power_flags", + defaults: ["framework-minus-apex-aconfig-java-defaults"], +} + +// Content +aconfig_declarations { + name: "android.content.flags-aconfig", + package: "android.content.flags", + container: "system", + srcs: ["core/java/android/content/flags/flags.aconfig"], +} + +java_aconfig_library { + name: "android.content.flags-aconfig-java", + aconfig_declarations: "android.content.flags-aconfig", + defaults: ["framework-minus-apex-aconfig-java-defaults"], +} + +// Adaptive Auth +aconfig_declarations { + name: "android.adaptiveauth.flags-aconfig", + package: "android.adaptiveauth", + container: "system", + srcs: ["core/java/android/adaptiveauth/*.aconfig"], +} + +java_aconfig_library { + name: "android.adaptiveauth.flags-aconfig-java", + aconfig_declarations: "android.adaptiveauth.flags-aconfig", + defaults: ["framework-minus-apex-aconfig-java-defaults"], +} + // CrashRecovery Module aconfig_declarations { name: "android.crashrecovery.flags-aconfig", @@ -990,3 +1182,77 @@ java_aconfig_library { aconfig_declarations: "android.crashrecovery.flags-aconfig", defaults: ["framework-minus-apex-aconfig-java-defaults"], } + +// Backup +java_aconfig_library { + name: "backup_flags_lib", + aconfig_declarations: "backup_flags", + defaults: ["framework-minus-apex-aconfig-java-defaults"], +} + +// Wifi +aconfig_declarations { + name: "android.net.wifi.flags-aconfig", + package: "android.net.wifi.flags", + container: "system", + srcs: ["wifi/*.aconfig"], +} + +java_aconfig_library { + name: "android.net.wifi.flags-aconfig-java", + aconfig_declarations: "android.net.wifi.flags-aconfig", + min_sdk_version: "30", + apex_available: [ + "//apex_available:platform", + "com.android.wifi", + ], + defaults: ["framework-minus-apex-aconfig-java-defaults"], +} + +// Wearable Sensing +aconfig_declarations { + name: "android.app.wearable.flags-aconfig", + package: "android.app.wearable", + container: "system", + srcs: ["core/java/android/app/wearable/*.aconfig"], +} + +java_aconfig_library { + name: "android.app.wearable.flags-aconfig-java", + aconfig_declarations: "android.app.wearable.flags-aconfig", + defaults: ["framework-minus-apex-aconfig-java-defaults"], +} + +aconfig_declarations { + name: "com.android.internal.pm.pkg.component.flags-aconfig", + package: "com.android.internal.pm.pkg.component.flags", + container: "system", + srcs: ["core/java/com/android/internal/pm/pkg/component/flags/flags.aconfig"], +} + +java_aconfig_library { + name: "com.android.internal.pm.pkg.component.flags-aconfig-java", + aconfig_declarations: "com.android.internal.pm.pkg.component.flags-aconfig", + defaults: ["framework-minus-apex-aconfig-java-defaults"], +} + +java_aconfig_library { + name: "com.android.internal.pm.pkg.component.flags-aconfig-java-host", + aconfig_declarations: "com.android.internal.pm.pkg.component.flags-aconfig", + host_supported: true, + defaults: ["framework-minus-apex-aconfig-java-defaults"], +} + +// System Server +aconfig_declarations { + name: "android.systemserver.flags-aconfig", + package: "android.server", + container: "system", + srcs: ["services/java/com/android/server/flags.aconfig"], +} + +java_aconfig_library { + name: "android.systemserver.flags-aconfig-java", + aconfig_declarations: "android.systemserver.flags-aconfig", + defaults: ["framework-minus-apex-aconfig-java-defaults"], +} diff --git a/Android.bp b/Android.bp index 900fba03daa7f2815ceba8eeb3dab534184dbaf0..804892e84a5022130ff2c912b843f58f5b0b0081 100644 --- a/Android.bp +++ b/Android.bp @@ -95,8 +95,10 @@ filegroup { ":platform-compat-native-aidl", // AIDL sources from external directories + ":android.frameworks.location.altitude-V2-java-source", ":android.hardware.biometrics.common-V4-java-source", ":android.hardware.biometrics.fingerprint-V3-java-source", + ":android.hardware.biometrics.face-V4-java-source", ":android.hardware.gnss-V2-java-source", ":android.hardware.graphics.common-V3-java-source", ":android.hardware.keymaster-V4-java-source", @@ -174,9 +176,6 @@ java_library { // and remove this line. "//frameworks/base/tools/hoststubgen:__subpackages__", ], - lint: { - baseline_filename: "lint-baseline.xml", - }, } // AIDL files under these paths are mixture of public and private ones. @@ -210,6 +209,9 @@ java_defaults { // framework_srcs. These have no or very limited dependency to the framework. java_library { name: "framework-internal-utils", + defaults: [ + "android.hardware.power-java_static", + ], static_libs: [ "apex_aidl_interface-java", "packagemanager_aidl-java", @@ -265,9 +267,6 @@ java_library { ], sdk_version: "core_platform", installable: false, - lint: { - baseline_filename: "lint-baseline.xml", - }, } // NOTE: This filegroup is exposed for vendor libraries to depend on and is referenced in @@ -422,6 +421,7 @@ java_defaults { "audiopolicy-aidl-java", "sounddose-aidl-java", "modules-utils-expresslog", + "perfetto_trace_javastream_protos_jarjar", ], } @@ -434,9 +434,6 @@ java_library { ], sdk_version: "core_platform", installable: false, - lint: { - baseline_filename: "lint-baseline.xml", - }, } // Separated so framework-minus-apex-defaults can be used without the libs dependency @@ -480,11 +477,6 @@ java_library { ], compile_dex: false, headers_only: true, - lint: { - baseline_filename: "lint-baseline.xml", - }, - // For jarjar repackaging - jarjar_prefix: "com.android.internal.hidden_from_bootclasspath", } java_library { @@ -515,6 +507,7 @@ java_library { lint: { baseline_filename: "lint-baseline.xml", }, + jarjar_prefix: "com.android.internal.hidden_from_bootclasspath", } java_library { @@ -529,7 +522,7 @@ java_library { }, lint: { enabled: false, - baseline_filename: "lint-baseline.xml", + }, } @@ -554,9 +547,6 @@ java_library { ], sdk_version: "core_platform", apex_available: ["//apex_available:platform"], - lint: { - baseline_filename: "lint-baseline.xml", - }, } java_library { @@ -572,9 +562,6 @@ java_library { "calendar-provider-compat-config", "contacts-provider-platform-compat-config", ], - lint: { - baseline_filename: "lint-baseline.xml", - }, } platform_compat_config { @@ -629,9 +616,6 @@ java_library { "rappor", ], dxflags: ["--core-library"], - lint: { - baseline_filename: "lint-baseline.xml", - }, } // utility classes statically linked into framework-wifi and dynamically linked @@ -677,6 +661,16 @@ filegroup { visibility: ["//frameworks/base/api"], } +java_library { + name: "perfetto_trace_javastream_protos_jarjar", + srcs: [ + ":perfetto_trace_javastream_protos", + ], + jarjar_rules: ":framework-jarjar-rules", + sdk_version: "core_platform", + installable: false, +} + build = [ "AconfigFlags.bp", "ProtoLibraries.bp", diff --git a/OWNERS b/OWNERS index 555bbfb8d00f70ea00d7f4afe2bad0c1c32a29af..7ceca321283bfd9b58bff106224cd772c3b8fa6e 100644 --- a/OWNERS +++ b/OWNERS @@ -42,3 +42,5 @@ per-file *Ravenwood* = file:ravenwood/OWNERS per-file PERFORMANCE_OWNERS = file:/PERFORMANCE_OWNERS per-file PACKAGE_MANAGER_OWNERS = file:/PACKAGE_MANAGER_OWNERS + +per-file WEAR_OWNERS = file:/WEAR_OWNERS diff --git a/Ravenwood.bp b/Ravenwood.bp index 03f3f0f3d61d89b781a3330433e2481999d15ba3..f43c37bf637df4ef246a43ae9d535547f42602f8 100644 --- a/Ravenwood.bp +++ b/Ravenwood.bp @@ -33,6 +33,7 @@ java_genrule { "@$(location ravenwood/ravenwood-standard-options.txt) " + "--debug-log $(location hoststubgen_framework-minus-apex.log) " + + "--stats-file $(location hoststubgen_framework-minus-apex_stats.csv) " + "--out-impl-jar $(location ravenwood.jar) " + @@ -56,6 +57,7 @@ java_genrule { "hoststubgen_dump.txt", "hoststubgen_framework-minus-apex.log", + "hoststubgen_framework-minus-apex_stats.csv", ], visibility: ["//visibility:private"], } @@ -65,7 +67,7 @@ java_genrule { // depend on it. java_genrule { name: "framework-minus-apex.ravenwood", - defaults: ["hoststubgen-for-prototype-only-genrule"], + defaults: ["ravenwood-internal-only-visibility-genrule"], cmd: "cp $(in) $(out)", srcs: [ ":framework-minus-apex.ravenwood-base{ravenwood.jar}", @@ -75,16 +77,143 @@ java_genrule { ], } +java_library { + name: "services.core-for-hoststubgen", + installable: false, // host only jar. + static_libs: [ + "services.core", + ], + sdk_version: "core_platform", + visibility: ["//visibility:private"], +} + +java_genrule { + name: "services.core.ravenwood-base", + tools: ["hoststubgen"], + cmd: "$(location hoststubgen) " + + "@$(location ravenwood/ravenwood-standard-options.txt) " + + + "--debug-log $(location hoststubgen_services.core.log) " + + "--stats-file $(location hoststubgen_services.core_stats.csv) " + + + "--out-impl-jar $(location ravenwood.jar) " + + + "--gen-keep-all-file $(location hoststubgen_keep_all.txt) " + + "--gen-input-dump-file $(location hoststubgen_dump.txt) " + + + "--in-jar $(location :services.core-for-hoststubgen) " + + "--policy-override-file $(location ravenwood/services.core-ravenwood-policies.txt) " + + "--annotation-allowed-classes-file $(location ravenwood/ravenwood-annotation-allowed-classes.txt) ", + srcs: [ + ":services.core-for-hoststubgen", + "ravenwood/services.core-ravenwood-policies.txt", + "ravenwood/ravenwood-standard-options.txt", + "ravenwood/ravenwood-annotation-allowed-classes.txt", + ], + out: [ + "ravenwood.jar", + + // Following files are created just as FYI. + "hoststubgen_keep_all.txt", + "hoststubgen_dump.txt", + + "hoststubgen_services.core.log", + "hoststubgen_services.core_stats.csv", + ], + visibility: ["//visibility:private"], +} + +java_genrule { + name: "services.core.ravenwood", + defaults: ["ravenwood-internal-only-visibility-genrule"], + cmd: "cp $(in) $(out)", + srcs: [ + ":services.core.ravenwood-base{ravenwood.jar}", + ], + out: [ + "services.core.ravenwood.jar", + ], +} + +java_library { + name: "services.core.ravenwood-jarjar", + installable: false, + static_libs: [ + "services.core.ravenwood", + ], + jarjar_rules: ":ravenwood-services-jarjar-rules", +} + +java_library { + name: "services.fakes.ravenwood-jarjar", + installable: false, + srcs: [":services.fakes-sources"], + libs: [ + "ravenwood-framework", + "services.core.ravenwood", + ], + jarjar_rules: ":ravenwood-services-jarjar-rules", +} + +java_library { + name: "mockito-ravenwood-prebuilt", + installable: false, + static_libs: [ + "mockito-robolectric-prebuilt", + ], +} + +java_library { + name: "inline-mockito-ravenwood-prebuilt", + installable: false, + static_libs: [ + "inline-mockito-robolectric-prebuilt", + ], +} + +// Jars in "ravenwood-runtime" are set to the classpath, sorted alphabetically. +// Rename some of the dependencies to make sure they're included in the intended order. +java_genrule { + name: "100-framework-minus-apex.ravenwood", + cmd: "cp $(in) $(out)", + srcs: [":framework-minus-apex.ravenwood"], + out: ["100-framework-minus-apex.ravenwood.jar"], + visibility: ["//visibility:private"], +} + +java_genrule { + // Use 200 to make sure it comes before the mainline stub ("all-updatable..."). + name: "200-kxml2-android", + cmd: "cp $(in) $(out)", + srcs: [":kxml2-android"], + out: ["200-kxml2-android.jar"], + visibility: ["//visibility:private"], +} + android_ravenwood_libgroup { name: "ravenwood-runtime", libs: [ - "framework-minus-apex.ravenwood", + "100-framework-minus-apex.ravenwood", + "200-kxml2-android", + "all-updatable-modules-system-stubs", + "android.test.mock.ravenwood", + "ravenwood-helper-runtime", "hoststubgen-helper-runtime.ravenwood", - "hoststubgen-helper-framework-runtime.ravenwood", + "services.core.ravenwood-jarjar", + "services.fakes.ravenwood-jarjar", + + // Provide runtime versions of utils linked in below "junit", "truth", + "flag-junit", + "ravenwood-framework", "ravenwood-junit-impl", - "android.test.mock.ravenwood", + "ravenwood-junit-impl-flag", + "mockito-ravenwood-prebuilt", + "inline-mockito-ravenwood-prebuilt", + ], + jni_libs: [ + "libandroid_runtime", ], } @@ -93,6 +222,10 @@ android_ravenwood_libgroup { libs: [ "junit", "truth", + "flag-junit", + "ravenwood-framework", "ravenwood-junit", + "mockito-ravenwood-prebuilt", + "inline-mockito-ravenwood-prebuilt", ], } diff --git a/TEST_MAPPING b/TEST_MAPPING index 6d9756dddd4e8ec0307b4a4e3a97f4cc31e98fd1..49384cde5803c99fde16b0f9e6bd3830dcb448bf 100644 --- a/TEST_MAPPING +++ b/TEST_MAPPING @@ -138,15 +138,13 @@ } ], "postsubmit-ravenwood": [ - // TODO(ravenwood) promote it to presubmit - // TODO: Enable it once the infra knows how to run it. -// { -// "name": "CtsUtilTestCasesRavenwood", -// "file_patterns": [ -// "*Ravenwood*", -// "*ravenwood*" -// ] -// } + { + "name": "CtsUtilTestCasesRavenwood", + "host": true, + "file_patterns": [ + "[Rr]avenwood" + ] + } ], "postsubmit-managedprofile-stress": [ { diff --git a/WEAR_OWNERS b/WEAR_OWNERS index 4127f996da03bad3fb0835341fe106f0c92aadfe..4ffb239e24ceb14373c8929765edb43a6250204e 100644 --- a/WEAR_OWNERS +++ b/WEAR_OWNERS @@ -10,3 +10,5 @@ sadrul@google.com rwmyers@google.com nalmalki@google.com shijianli@google.com +latkin@google.com +djsollen@google.com diff --git a/apct-tests/perftests/autofill/Android.bp b/apct-tests/perftests/autofill/Android.bp index 84145beb5b5f244efca8864c94a1d51569d2a3b0..2ff8b4e21a833e838ece75e0b4c9d53e16a91d5d 100644 --- a/apct-tests/perftests/autofill/Android.bp +++ b/apct-tests/perftests/autofill/Android.bp @@ -13,6 +13,7 @@ // limitations under the License. package { + default_team: "trendy_team_input_framework", // See: http://go/android-license-faq // A large-scale-change added 'default_applicable_licenses' to import // all of the 'license_kinds' from "frameworks_base_license" diff --git a/apct-tests/perftests/blobstore/Android.bp b/apct-tests/perftests/blobstore/Android.bp index 2590fe3d843f2ff2d851d1015a0fb2c53fa3a0ae..e9353fe3e85414e4aadf8c447a11ad08e0fa461e 100644 --- a/apct-tests/perftests/blobstore/Android.bp +++ b/apct-tests/perftests/blobstore/Android.bp @@ -13,6 +13,7 @@ // limitations under the License. package { + default_team: "trendy_team_input_framework", // See: http://go/android-license-faq // A large-scale-change added 'default_applicable_licenses' to import // all of the 'license_kinds' from "frameworks_base_license" diff --git a/apct-tests/perftests/contentcapture/Android.bp b/apct-tests/perftests/contentcapture/Android.bp index 638403d40ea35f924c79489ea6ccd51911de4a3b..5e559d703dbde588d1664ab9cd1dd0597c826cce 100644 --- a/apct-tests/perftests/contentcapture/Android.bp +++ b/apct-tests/perftests/contentcapture/Android.bp @@ -13,6 +13,7 @@ // limitations under the License. package { + default_team: "trendy_team_input_framework", // See: http://go/android-license-faq // A large-scale-change added 'default_applicable_licenses' to import // all of the 'license_kinds' from "frameworks_base_license" diff --git a/apct-tests/perftests/contentcapture/src/android/view/contentcapture/AbstractContentCapturePerfTestCase.java b/apct-tests/perftests/contentcapture/src/android/view/contentcapture/AbstractContentCapturePerfTestCase.java index 0ea2dafbb047ec06dd78bc5cc2fb7984ea9beb18..bc8470888a5a4596c4ad1e14a1a80c287025403d 100644 --- a/apct-tests/perftests/contentcapture/src/android/view/contentcapture/AbstractContentCapturePerfTestCase.java +++ b/apct-tests/perftests/contentcapture/src/android/view/contentcapture/AbstractContentCapturePerfTestCase.java @@ -248,6 +248,11 @@ public abstract class AbstractContentCapturePerfTestCase { return mServiceWatcher.waitOnCreate(); } + /** Wait for session paused. */ + public void waitForSessionPaused() throws InterruptedException { + mServiceWatcher.waitSessionPaused(); + } + @NonNull protected ActivityWatcher startWatcher() { return mActivitiesWatcher.watch(CustomTestActivity.class); diff --git a/apct-tests/perftests/contentcapture/src/android/view/contentcapture/LoginTest.java b/apct-tests/perftests/contentcapture/src/android/view/contentcapture/LoginTest.java index aa95dfdfdf164f21fec83b00da2efcbfe0b1d04d..44e8a67e72efc88a5a2ac22d91c4bd1d1f10da06 100644 --- a/apct-tests/perftests/contentcapture/src/android/view/contentcapture/LoginTest.java +++ b/apct-tests/perftests/contentcapture/src/android/view/contentcapture/LoginTest.java @@ -80,6 +80,34 @@ public class LoginTest extends AbstractContentCapturePerfTestCase { testActivityLaunchTime(R.layout.test_container_activity, 500); } + @Test + public void testSendEventsLatency() throws Throwable { + enableService(); + + testSendEventLatency(R.layout.test_container_activity, 0); + } + + @Test + public void testSendEventsLatency_contains100Views() throws Throwable { + enableService(); + + testSendEventLatency(R.layout.test_container_activity, 100); + } + + @Test + public void testSendEventsLatency_contains300Views() throws Throwable { + enableService(); + + testSendEventLatency(R.layout.test_container_activity, 300); + } + + @Test + public void testSendEventsLatency_contains500Views() throws Throwable { + enableService(); + + testSendEventLatency(R.layout.test_container_activity, 500); + } + private void testActivityLaunchTime(int layoutId, int numViews) throws Throwable { final Object drawNotifier = new Object(); final Intent intent = getLaunchIntent(layoutId, numViews); @@ -111,6 +139,38 @@ public class LoginTest extends AbstractContentCapturePerfTestCase { } } + private void testSendEventLatency(int layoutId, int numViews) throws Throwable { + final Object drawNotifier = new Object(); + final Intent intent = getLaunchIntent(layoutId, numViews); + intent.putExtra(CustomTestActivity.INTENT_EXTRA_FINISH_ON_IDLE, true); + intent.putExtra(CustomTestActivity.INTENT_EXTRA_DRAW_CALLBACK, + new RemoteCallback(result -> { + synchronized (drawNotifier) { + drawNotifier.notifyAll(); + } + })); + final ActivityWatcher watcher = startWatcher(); + + final BenchmarkState state = mPerfStatusReporter.getBenchmarkState(); + while (state.keepRunning()) { + mEntryActivity.startActivity(intent); + synchronized (drawNotifier) { + try { + drawNotifier.wait(GENERIC_TIMEOUT_MS); + } catch (InterruptedException e) { + throw new RuntimeException(e); + } + } + waitForSessionPaused(); + + // Ignore the time to finish the activity + state.pauseTiming(); + watcher.waitFor(DESTROYED); + sInstrumentation.waitForIdleSync(); + state.resumeTiming(); + } + } + @Test public void testOnVisibilityAggregated_visibleChanged() throws Throwable { enableService(); diff --git a/apct-tests/perftests/contentcapture/src/android/view/contentcapture/MyContentCaptureService.java b/apct-tests/perftests/contentcapture/src/android/view/contentcapture/MyContentCaptureService.java index ecc5112ab6dd8abbe7beacad376071a675aab93c..0b5345f5e2e1c881683fe2682ada60674048cb49 100644 --- a/apct-tests/perftests/contentcapture/src/android/view/contentcapture/MyContentCaptureService.java +++ b/apct-tests/perftests/contentcapture/src/android/view/contentcapture/MyContentCaptureService.java @@ -114,6 +114,10 @@ public class MyContentCaptureService extends ContentCaptureService { public void onContentCaptureEvent(ContentCaptureSessionId sessionId, ContentCaptureEvent event) { Log.i(TAG, "onContentCaptureEventsRequest(session=" + sessionId + "): " + event); + if (sServiceWatcher != null + && event.getType() == ContentCaptureEvent.TYPE_SESSION_PAUSED) { + sServiceWatcher.mSessionPaused.countDown(); + } } @Override @@ -126,6 +130,7 @@ public class MyContentCaptureService extends ContentCaptureService { private static final long GENERIC_TIMEOUT_MS = 10_000; private final CountDownLatch mCreated = new CountDownLatch(1); private final CountDownLatch mDestroyed = new CountDownLatch(1); + private final CountDownLatch mSessionPaused = new CountDownLatch(1); private boolean mReadyToClear = true; private Pair, Set> mAllowList; @@ -151,6 +156,11 @@ public class MyContentCaptureService extends ContentCaptureService { await(mDestroyed, "not destroyed"); } + /** Wait for session paused. */ + public void waitSessionPaused() throws InterruptedException { + await(mSessionPaused, "no Paused"); + } + /** * Allow just this package. */ diff --git a/apct-tests/perftests/core/Android.bp b/apct-tests/perftests/core/Android.bp index e1b3241e051e016033f8feee238ddd73e4350c82..e092499cb41fbd44193457de1d10a179675d3d80 100644 --- a/apct-tests/perftests/core/Android.bp +++ b/apct-tests/perftests/core/Android.bp @@ -15,6 +15,7 @@ // package { + default_team: "trendy_team_framework_accessibility", // See: http://go/android-license-faq // A large-scale-change added 'default_applicable_licenses' to import // all of the 'license_kinds' from "frameworks_base_license" diff --git a/apct-tests/perftests/core/apps/overlay/Android.bp b/apct-tests/perftests/core/apps/overlay/Android.bp index 646530788907ca89c04379a4b50366d0f88316ba..2170fa7f255396741e0c44e3a61414ebab6c9561 100644 --- a/apct-tests/perftests/core/apps/overlay/Android.bp +++ b/apct-tests/perftests/core/apps/overlay/Android.bp @@ -13,6 +13,7 @@ // limitations under the License. package { + default_team: "trendy_team_framework_accessibility", // See: http://go/android-license-faq // A large-scale-change added 'default_applicable_licenses' to import // all of the 'license_kinds' from "frameworks_base_license" @@ -25,149 +26,150 @@ android_test_helper_app { name: "Overlay0", aaptflags: [ "--rename-manifest-package com.android.perftests.overlay0", - ] + ], } android_test_helper_app { name: "Overlay1", aaptflags: [ "--rename-manifest-package com.android.perftests.overlay1", - ] + ], } android_test_helper_app { name: "Overlay2", aaptflags: [ "--rename-manifest-package com.android.perftests.overlay2", - ] + ], } android_test_helper_app { name: "Overlay3", aaptflags: [ "--rename-manifest-package com.android.perftests.overlay3", - ] + ], } android_test_helper_app { name: "Overlay4", aaptflags: [ "--rename-manifest-package com.android.perftests.overlay4", - ] + ], } android_test_helper_app { name: "Overlay5", aaptflags: [ "--rename-manifest-package com.android.perftests.overlay5", - ] + ], } android_test_helper_app { name: "Overlay6", aaptflags: [ "--rename-manifest-package com.android.perftests.overlay6", - ] + ], } android_test_helper_app { name: "Overlay7", aaptflags: [ "--rename-manifest-package com.android.perftests.overlay7", - ] + ], } + android_test_helper_app { name: "Overlay8", aaptflags: [ "--rename-manifest-package com.android.perftests.overlay8", - ] + ], } android_test_helper_app { name: "Overlay9", aaptflags: [ "--rename-manifest-package com.android.perftests.overlay9", - ] + ], } android_test_helper_app { name: "LargeOverlay0", - resource_dirs : [ "res_large" ], + resource_dirs: ["res_large"], aaptflags: [ "--rename-manifest-package com.android.perftests.overlay.large0", - ] + ], } android_test_helper_app { name: "LargeOverlay1", - resource_dirs : [ "res_large" ], + resource_dirs: ["res_large"], aaptflags: [ "--rename-manifest-package com.android.perftests.overlay.large1", - ] + ], } android_test_helper_app { name: "LargeOverlay2", - resource_dirs : [ "res_large" ], + resource_dirs: ["res_large"], aaptflags: [ "--rename-manifest-package com.android.perftests.overlay.large2", - ] + ], } android_test_helper_app { name: "LargeOverlay3", - resource_dirs : [ "res_large" ], + resource_dirs: ["res_large"], aaptflags: [ "--rename-manifest-package com.android.perftests.overlay.large3", - ] + ], } android_test_helper_app { name: "LargeOverlay4", - resource_dirs : [ "res_large" ], + resource_dirs: ["res_large"], aaptflags: [ "--rename-manifest-package com.android.perftests.overlay.large4", - ] + ], } android_test_helper_app { name: "LargeOverlay5", - resource_dirs : [ "res_large" ], + resource_dirs: ["res_large"], aaptflags: [ "--rename-manifest-package com.android.perftests.overlay.large5", - ] + ], } android_test_helper_app { name: "LargeOverlay6", - resource_dirs : [ "res_large" ], + resource_dirs: ["res_large"], aaptflags: [ "--rename-manifest-package com.android.perftests.overlay.large6", - ] + ], } android_test_helper_app { name: "LargeOverlay7", - resource_dirs : [ "res_large" ], + resource_dirs: ["res_large"], aaptflags: [ "--rename-manifest-package com.android.perftests.overlay.large7", - ] + ], } android_test_helper_app { name: "LargeOverlay8", - resource_dirs : [ "res_large" ], + resource_dirs: ["res_large"], aaptflags: [ "--rename-manifest-package com.android.perftests.overlay.large8", - ] + ], } android_test_helper_app { name: "LargeOverlay9", - resource_dirs : [ "res_large" ], + resource_dirs: ["res_large"], aaptflags: [ "--rename-manifest-package com.android.perftests.overlay.large9", - ] + ], } java_library { diff --git a/apct-tests/perftests/core/apps/reources_manager/Android.bp b/apct-tests/perftests/core/apps/reources_manager/Android.bp index 766b8c455d23ba348cb2de5b28e174e5161bca8c..96b9d6af5f318161732fd1fd5a67638628f5accd 100644 --- a/apct-tests/perftests/core/apps/reources_manager/Android.bp +++ b/apct-tests/perftests/core/apps/reources_manager/Android.bp @@ -13,6 +13,7 @@ // limitations under the License. package { + default_team: "trendy_team_framework_accessibility", // See: http://go/android-license-faq // A large-scale-change added 'default_applicable_licenses' to import // all of the 'license_kinds' from "frameworks_base_license" diff --git a/apct-tests/perftests/core/jni/Android.bp b/apct-tests/perftests/core/jni/Android.bp index b92b13b5b75a4791b0f894fe5ffa1babdcd15ab0..a9c9526726a39cfbfbefce577a9d76def16a65f4 100644 --- a/apct-tests/perftests/core/jni/Android.bp +++ b/apct-tests/perftests/core/jni/Android.bp @@ -1,4 +1,5 @@ package { + default_team: "trendy_team_framework_accessibility", // See: http://go/android-license-faq // A large-scale-change added 'default_applicable_licenses' to import // all of the 'license_kinds' from "frameworks_base_license" diff --git a/apct-tests/perftests/core/src/android/database/SQLiteDatabasePerfTest.java b/apct-tests/perftests/core/src/android/database/SQLiteDatabasePerfTest.java index b7460cd6ead453f40382eb56c9a1ef94ab95a3fc..fa4387b405c92de1a0c073da3b2215d04fc636f2 100644 --- a/apct-tests/perftests/core/src/android/database/SQLiteDatabasePerfTest.java +++ b/apct-tests/perftests/core/src/android/database/SQLiteDatabasePerfTest.java @@ -433,6 +433,17 @@ public class SQLiteDatabasePerfTest { performMultithreadedReadWriteTest(); } + /** + * This test measures a multi-threaded read-write environment where there are 2 readers and + * 1 writer in the database using WAL journal mode and NORMAL syncMode. + */ + @Test + public void testMultithreadedReadWriteWithWalNormal() { + recreateTestDatabase(SQLiteDatabase.JOURNAL_MODE_WAL, SQLiteDatabase.SYNC_MODE_NORMAL); + insertT1TestDataSet(); + performMultithreadedReadWriteTest(); + } + private void doReadLoop(int totalIterations) { Random rnd = new Random(0); int currentIteration = 0; @@ -472,7 +483,6 @@ public class SQLiteDatabasePerfTest { } private void doUpdateLoop(int totalIterations) { - SQLiteDatabase db = mContext.openOrCreateDatabase(DB_NAME, Context.MODE_PRIVATE, null); Random rnd = new Random(0); int i = 0; ContentValues cv = new ContentValues(); @@ -485,24 +495,12 @@ public class SQLiteDatabasePerfTest { cv.put("COL_B", "UpdatedValue"); cv.put("COL_C", i); argArray[0] = String.valueOf(id); - db.update("T1", cv, "_ID=?", argArray); + mDatabase.update("T1", cv, "_ID=?", argArray); i++; android.os.Trace.endSection(); } } - /** - * This test measures a multi-threaded read-write environment where there are 2 readers and - * 1 writer in the database using WAL journal mode and NORMAL syncMode. - */ - @Test - public void testMultithreadedReadWriteWithWalNormal() { - recreateTestDatabase(SQLiteDatabase.JOURNAL_MODE_WAL, SQLiteDatabase.SYNC_MODE_NORMAL); - insertT1TestDataSet(); - - performMultithreadedReadWriteTest(); - } - private void performMultithreadedReadWriteTest() { int totalBGIterations = 10000; // Writer - Fixed iterations to avoid consuming cycles from mainloop benchmark iterations @@ -555,4 +553,3 @@ public class SQLiteDatabasePerfTest { createOrOpenTestDatabase(journalMode, syncMode); } } - diff --git a/apct-tests/perftests/core/src/android/graphics/perftests/CanvasPerfTest.java b/apct-tests/perftests/core/src/android/graphics/perftests/CanvasPerfTest.java index e5a06c9bd146a5fd3a11af974856a0c42b1cc672..95730e83605675afac0aecde71eff7b56f5c09da 100644 --- a/apct-tests/perftests/core/src/android/graphics/perftests/CanvasPerfTest.java +++ b/apct-tests/perftests/core/src/android/graphics/perftests/CanvasPerfTest.java @@ -16,12 +16,14 @@ package android.graphics.perftests; +import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import android.content.Context; import android.graphics.Bitmap; import android.graphics.Bitmap.Config; import android.graphics.Color; +import android.graphics.ColorSpace; import android.graphics.ImageDecoder; import android.graphics.Paint; import android.graphics.RecordingCanvas; @@ -104,20 +106,45 @@ public class CanvasPerfTest { } @Test - public void testCreateScaledBitmap() throws IOException { + public void testCreateScaledSrgbBitmap() throws IOException { BenchmarkState state = mPerfStatusReporter.getBenchmarkState(); final Context context = InstrumentationRegistry.getContext(); Bitmap source = ImageDecoder.decodeBitmap( ImageDecoder.createSource(context.getResources(), R.drawable.fountain_night), (decoder, info, source1) -> { decoder.setAllocator(ImageDecoder.ALLOCATOR_SOFTWARE); + decoder.setTargetColorSpace(ColorSpace.get(ColorSpace.Named.SRGB)); }); source.setGainmap(null); + assertEquals(source.getColorSpace().getId(), ColorSpace.Named.SRGB.ordinal()); while (state.keepRunning()) { Bitmap.createScaledBitmap(source, source.getWidth() / 2, source.getHeight() / 2, true) .recycle(); } + source.recycle(); + Runtime.getRuntime().gc(); + } + + @Test + public void testCreateScaledP3Bitmap() throws IOException { + BenchmarkState state = mPerfStatusReporter.getBenchmarkState(); + final Context context = InstrumentationRegistry.getContext(); + Bitmap source = ImageDecoder.decodeBitmap( + ImageDecoder.createSource(context.getResources(), R.drawable.fountain_night), + (decoder, info, source1) -> { + decoder.setAllocator(ImageDecoder.ALLOCATOR_SOFTWARE); + decoder.setTargetColorSpace(ColorSpace.get(ColorSpace.Named.DISPLAY_P3)); + }); + source.setGainmap(null); + assertEquals(source.getColorSpace().getId(), ColorSpace.Named.DISPLAY_P3.ordinal()); + + while (state.keepRunning()) { + Bitmap.createScaledBitmap(source, source.getWidth() / 2, source.getHeight() / 2, true) + .recycle(); + } + source.recycle(); + Runtime.getRuntime().gc(); } @Test @@ -135,5 +162,7 @@ public class CanvasPerfTest { Bitmap.createScaledBitmap(source, source.getWidth() / 2, source.getHeight() / 2, true) .recycle(); } + source.recycle(); + Runtime.getRuntime().gc(); } } diff --git a/apct-tests/perftests/core/src/android/graphics/perftests/VectorDrawablePerfTest.java b/apct-tests/perftests/core/src/android/graphics/perftests/VectorDrawablePerfTest.java index d14e93e553f6af456748bfb5d98f28b9ed94a3c6..80a9c06b549e2a717374cb181a7135d57f716b4b 100644 --- a/apct-tests/perftests/core/src/android/graphics/perftests/VectorDrawablePerfTest.java +++ b/apct-tests/perftests/core/src/android/graphics/perftests/VectorDrawablePerfTest.java @@ -27,8 +27,8 @@ import android.perftests.utils.BenchmarkState; import android.perftests.utils.BitmapUtils; import android.perftests.utils.PerfStatusReporter; import android.perftests.utils.PerfTestActivity; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.rule.ActivityTestRule; import androidx.test.runner.AndroidJUnit4; diff --git a/apct-tests/perftests/core/src/android/libcore/AdditionPerfTest.java b/apct-tests/perftests/core/src/android/libcore/AdditionPerfTest.java index aa47e0a29695f2c556e4d1028225c8bbff46f789..80cd86cf9a5b28fb2407b33708bdb36a51fc4a3f 100644 --- a/apct-tests/perftests/core/src/android/libcore/AdditionPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/AdditionPerfTest.java @@ -18,8 +18,8 @@ package android.libcore; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/ArrayCopyPerfTest.java b/apct-tests/perftests/core/src/android/libcore/ArrayCopyPerfTest.java index 97ab6c7cd6b4a3a048d24cd0fcaff8de87875252..2f6c37832d043fbdde4550c763b500e09f20d276 100644 --- a/apct-tests/perftests/core/src/android/libcore/ArrayCopyPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/ArrayCopyPerfTest.java @@ -18,8 +18,8 @@ package android.libcore; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/ArrayIterationPerfTest.java b/apct-tests/perftests/core/src/android/libcore/ArrayIterationPerfTest.java index bb452d394d4731ea831f3c314dc603ad1c3bc235..d17add767257bcaff43eacbcbd063d7c8bcd2874 100644 --- a/apct-tests/perftests/core/src/android/libcore/ArrayIterationPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/ArrayIterationPerfTest.java @@ -18,8 +18,8 @@ package android.libcore; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/ArrayListIterationPerfTest.java b/apct-tests/perftests/core/src/android/libcore/ArrayListIterationPerfTest.java index ff6d46f6db7fbd954deb309d2d5de12844feb7b5..3a57db8f323fdeba2d82d15746d03fd894533862 100644 --- a/apct-tests/perftests/core/src/android/libcore/ArrayListIterationPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/ArrayListIterationPerfTest.java @@ -18,8 +18,8 @@ package android.libcore; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/BigIntegerPerfTest.java b/apct-tests/perftests/core/src/android/libcore/BigIntegerPerfTest.java index e0c12dd660e2aecccd1d9677c6304adca142cace..3fb3bc8c0ff2cd878c37d66b7cbfb44309a71b11 100644 --- a/apct-tests/perftests/core/src/android/libcore/BigIntegerPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/BigIntegerPerfTest.java @@ -18,8 +18,8 @@ package android.libcore; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/BufferedZipFilePerfTest.java b/apct-tests/perftests/core/src/android/libcore/BufferedZipFilePerfTest.java index 04ef09e4b68245788d09cd23e36418750fb28f17..2a1b5d1cc6ce4b1ee17f01e0139bd8d14b8f8cb8 100644 --- a/apct-tests/perftests/core/src/android/libcore/BufferedZipFilePerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/BufferedZipFilePerfTest.java @@ -18,8 +18,8 @@ package android.libcore; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Before; diff --git a/apct-tests/perftests/core/src/android/libcore/ClassLoaderResourcePerfTest.java b/apct-tests/perftests/core/src/android/libcore/ClassLoaderResourcePerfTest.java index 4ae88b88b0907c855c7d4914fdfc6d3d538b5cf1..5f599ea85eb4913e40027bc1cd5350b3acafbf2b 100644 --- a/apct-tests/perftests/core/src/android/libcore/ClassLoaderResourcePerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/ClassLoaderResourcePerfTest.java @@ -18,8 +18,8 @@ package android.libcore; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Assert; diff --git a/apct-tests/perftests/core/src/android/libcore/ClonePerfTest.java b/apct-tests/perftests/core/src/android/libcore/ClonePerfTest.java index 5e73916d5f5b04d23eccd02ab52a15a3a91c9b35..ea249848daad1cf5782d020f67b7501504dcff83 100644 --- a/apct-tests/perftests/core/src/android/libcore/ClonePerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/ClonePerfTest.java @@ -18,8 +18,8 @@ package android.libcore; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/DeepArrayOpsPerfTest.java b/apct-tests/perftests/core/src/android/libcore/DeepArrayOpsPerfTest.java index 3ebaa4cd0bfa4332757f74aa8906361c6bce918c..82247dcee772876983b243273ee86c41d0a5769c 100644 --- a/apct-tests/perftests/core/src/android/libcore/DeepArrayOpsPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/DeepArrayOpsPerfTest.java @@ -18,7 +18,8 @@ package android.libcore; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; + +import androidx.test.filters.LargeTest; import junitparams.JUnitParamsRunner; import junitparams.Parameters; diff --git a/apct-tests/perftests/core/src/android/libcore/FieldAccessPerfTest.java b/apct-tests/perftests/core/src/android/libcore/FieldAccessPerfTest.java index da94ae1189004d7521c95436409714372e2809a3..0bebf04c6897261caba03ddb0b60761a6983d1cc 100644 --- a/apct-tests/perftests/core/src/android/libcore/FieldAccessPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/FieldAccessPerfTest.java @@ -18,8 +18,8 @@ package android.libcore; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/HashedCollectionsPerfTest.java b/apct-tests/perftests/core/src/android/libcore/HashedCollectionsPerfTest.java index 9446d99c959dfcb36f9e6aae2925615ef96d530e..55c1027e1addc621bec4bf80500a5bc329ea3e8e 100644 --- a/apct-tests/perftests/core/src/android/libcore/HashedCollectionsPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/HashedCollectionsPerfTest.java @@ -18,8 +18,8 @@ package android.libcore; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/ImtConflictPerfTest.java b/apct-tests/perftests/core/src/android/libcore/ImtConflictPerfTest.java index be2a7e97f775c1334dd901b12cb1c69917daff6a..da60a777352883d623bc4a6943195e5e9f8b4147 100644 --- a/apct-tests/perftests/core/src/android/libcore/ImtConflictPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/ImtConflictPerfTest.java @@ -18,8 +18,8 @@ package android.libcore; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Before; diff --git a/apct-tests/perftests/core/src/android/libcore/MethodInvocationPerfTest.java b/apct-tests/perftests/core/src/android/libcore/MethodInvocationPerfTest.java index ca9977974a8a00c5bfab74669870530216a1f21c..6d9d0c92ff2517e48d958057fa9be196a4c0368a 100644 --- a/apct-tests/perftests/core/src/android/libcore/MethodInvocationPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/MethodInvocationPerfTest.java @@ -18,8 +18,8 @@ package android.libcore; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/MultiplicationPerfTest.java b/apct-tests/perftests/core/src/android/libcore/MultiplicationPerfTest.java index 8496fbecb6bdb4eb8954cdbbd23d8d1f66713abf..09b09771e9de8df7b12ef50dce40b648fcd3a267 100644 --- a/apct-tests/perftests/core/src/android/libcore/MultiplicationPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/MultiplicationPerfTest.java @@ -18,8 +18,8 @@ package android.libcore; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/ReferenceGetPerfTest.java b/apct-tests/perftests/core/src/android/libcore/ReferenceGetPerfTest.java index bb794249e9f442ced467c5b13fed8613d92ca71d..ba21ed33bdb245f083da5a83e3a741b74f2f93a8 100644 --- a/apct-tests/perftests/core/src/android/libcore/ReferenceGetPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/ReferenceGetPerfTest.java @@ -18,8 +18,8 @@ package android.libcore; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Before; diff --git a/apct-tests/perftests/core/src/android/libcore/ReferencePerfTest.java b/apct-tests/perftests/core/src/android/libcore/ReferencePerfTest.java index 05a3e1201a00260fd2cc238c4caaa146beab5d70..293752ee5dd130702ab99f66c1c176157a75166c 100644 --- a/apct-tests/perftests/core/src/android/libcore/ReferencePerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/ReferencePerfTest.java @@ -18,8 +18,8 @@ package android.libcore; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/SmallBigIntegerPerfTest.java b/apct-tests/perftests/core/src/android/libcore/SmallBigIntegerPerfTest.java index 65a2fdbae30426abc8cb5e78c4952e714b350f7d..528b751d15513c8147f6c680561341709f3b62c0 100644 --- a/apct-tests/perftests/core/src/android/libcore/SmallBigIntegerPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/SmallBigIntegerPerfTest.java @@ -18,8 +18,8 @@ package android.libcore; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/StringDexCachePerfTest.java b/apct-tests/perftests/core/src/android/libcore/StringDexCachePerfTest.java index 4f5c54d6a84738af26d916401a9e2695095df62b..1f301acd1dc6638eb4370d494b37d79badb8cd9b 100644 --- a/apct-tests/perftests/core/src/android/libcore/StringDexCachePerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/StringDexCachePerfTest.java @@ -18,8 +18,8 @@ package android.libcore; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/StringIterationPerfTest.java b/apct-tests/perftests/core/src/android/libcore/StringIterationPerfTest.java index 08ad92694013dbef43724bb5a4eceb868e3f901f..4268325f8c648904c29b0c98b44c8502c180460b 100644 --- a/apct-tests/perftests/core/src/android/libcore/StringIterationPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/StringIterationPerfTest.java @@ -18,8 +18,8 @@ package android.libcore; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/SystemArrayCopyPerfTest.java b/apct-tests/perftests/core/src/android/libcore/SystemArrayCopyPerfTest.java index 20f1309bd8e6e6cf80fa0deee018e92b74a9a894..6363e9c3ef219a2e364b6b2a7ede9a07e2673472 100644 --- a/apct-tests/perftests/core/src/android/libcore/SystemArrayCopyPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/SystemArrayCopyPerfTest.java @@ -18,7 +18,8 @@ package android.libcore; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; + +import androidx.test.filters.LargeTest; import junitparams.JUnitParamsRunner; import junitparams.Parameters; diff --git a/apct-tests/perftests/core/src/android/libcore/VirtualVersusInterfacePerfTest.java b/apct-tests/perftests/core/src/android/libcore/VirtualVersusInterfacePerfTest.java index 7e71976fdc9df804e0c40735dec78ec2dad34be1..cb3d3acb337f88881e64b4d4c241245c1f7eecb7 100644 --- a/apct-tests/perftests/core/src/android/libcore/VirtualVersusInterfacePerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/VirtualVersusInterfacePerfTest.java @@ -18,8 +18,8 @@ package android.libcore; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/XmlSerializePerfTest.java b/apct-tests/perftests/core/src/android/libcore/XmlSerializePerfTest.java index b1b594d643241fa642da04d4ab0817cc52933c3c..5be8ee6e67e246b86e98ad7b30e5cbd7f6abfd70 100644 --- a/apct-tests/perftests/core/src/android/libcore/XmlSerializePerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/XmlSerializePerfTest.java @@ -18,7 +18,8 @@ package android.libcore; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; + +import androidx.test.filters.LargeTest; import junitparams.JUnitParamsRunner; import junitparams.Parameters; diff --git a/apct-tests/perftests/core/src/android/libcore/XmlSerializerPerfTest.java b/apct-tests/perftests/core/src/android/libcore/XmlSerializerPerfTest.java index 412cb5acbf8b2063be82ddbd2b86790fffca1aba..a37b89ddf033a09bd118737b3fdecc0ba1aaccac 100644 --- a/apct-tests/perftests/core/src/android/libcore/XmlSerializerPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/XmlSerializerPerfTest.java @@ -18,9 +18,9 @@ package android.libcore; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; import android.util.Xml; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import libcore.util.XmlObjectFactory; diff --git a/apct-tests/perftests/core/src/android/libcore/ZipFilePerfTest.java b/apct-tests/perftests/core/src/android/libcore/ZipFilePerfTest.java index 3a45d4045d625f16ca2a87b2a1b8d7a8d6cf83ca..ed669beae1ce40c3277f97a3e381c25d4d521d0f 100644 --- a/apct-tests/perftests/core/src/android/libcore/ZipFilePerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/ZipFilePerfTest.java @@ -18,7 +18,8 @@ package android.libcore; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; + +import androidx.test.filters.LargeTest; import junitparams.JUnitParamsRunner; import junitparams.Parameters; diff --git a/apct-tests/perftests/core/src/android/libcore/ZipFileReadPerfTest.java b/apct-tests/perftests/core/src/android/libcore/ZipFileReadPerfTest.java index 2e89518ec9fbf43dab2c6309ae2745ba16f8934c..d239a054fac707f56304f16c56ec415b32becbb0 100644 --- a/apct-tests/perftests/core/src/android/libcore/ZipFileReadPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/ZipFileReadPerfTest.java @@ -18,7 +18,8 @@ package android.libcore; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; + +import androidx.test.filters.LargeTest; import junitparams.JUnitParamsRunner; import junitparams.Parameters; diff --git a/apct-tests/perftests/core/src/android/libcore/regression/AnnotatedElementPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/AnnotatedElementPerfTest.java index d38d5197b93760397c45849f2b318659bbcffea8..487295c03c0e00b0418b85aa21dbf074922c30c4 100644 --- a/apct-tests/perftests/core/src/android/libcore/regression/AnnotatedElementPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/regression/AnnotatedElementPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.regression; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Before; diff --git a/apct-tests/perftests/core/src/android/libcore/regression/BidiPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/BidiPerfTest.java index cc56868468e50cdfca7bfd17b829e85445cbefde..adc5d8c2bb3ec116db18ec0674a9b15ca0ca9d62 100644 --- a/apct-tests/perftests/core/src/android/libcore/regression/BidiPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/regression/BidiPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.regression; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/regression/BigIntegerPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/BigIntegerPerfTest.java index 662694b1b5d1824f57106821e315df194a2ed97e..286d70339c5f50ab1a830a52c4185a7fe4fca37b 100644 --- a/apct-tests/perftests/core/src/android/libcore/regression/BigIntegerPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/regression/BigIntegerPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.regression; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/regression/BitSetPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/BitSetPerfTest.java index 2c0473eda830ab4c9f65c7e31fa791a7ac6f608c..d6462024a380a0166f1b37b44466b0f36e58dee2 100644 --- a/apct-tests/perftests/core/src/android/libcore/regression/BitSetPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/regression/BitSetPerfTest.java @@ -18,7 +18,8 @@ package android.libcore.regression; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; + +import androidx.test.filters.LargeTest; import junitparams.JUnitParamsRunner; import junitparams.Parameters; diff --git a/apct-tests/perftests/core/src/android/libcore/regression/BreakIteratorPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/BreakIteratorPerfTest.java index 6a2ce5847daad3cd27dfd20efa7ef29339ceff70..b887f40334622dbea82931215f991a54bc642bb7 100644 --- a/apct-tests/perftests/core/src/android/libcore/regression/BreakIteratorPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/regression/BreakIteratorPerfTest.java @@ -18,7 +18,8 @@ package android.libcore.regression; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; + +import androidx.test.filters.LargeTest; import junitparams.JUnitParamsRunner; import junitparams.Parameters; diff --git a/apct-tests/perftests/core/src/android/libcore/regression/BulkPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/BulkPerfTest.java index b7b7e83f147c93b795687c3c5a3161498be6bebb..e4eaf12e9dcb8f37ce431abe5c21e3b03561b4f7 100644 --- a/apct-tests/perftests/core/src/android/libcore/regression/BulkPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/regression/BulkPerfTest.java @@ -18,7 +18,8 @@ package android.libcore.regression; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; + +import androidx.test.filters.LargeTest; import junitparams.JUnitParamsRunner; import junitparams.Parameters; diff --git a/apct-tests/perftests/core/src/android/libcore/regression/ByteBufferPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/ByteBufferPerfTest.java index 9ac36d076c7bafc98d5171ed9213265cce8a3efb..cb2438e519dadcef2b7e6185800a2910435c4704 100644 --- a/apct-tests/perftests/core/src/android/libcore/regression/ByteBufferPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/regression/ByteBufferPerfTest.java @@ -18,7 +18,8 @@ package android.libcore.regression; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; + +import androidx.test.filters.LargeTest; import junitparams.JUnitParamsRunner; import junitparams.Parameters; diff --git a/apct-tests/perftests/core/src/android/libcore/regression/ByteBufferScalarVersusVectorPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/ByteBufferScalarVersusVectorPerfTest.java index 5dd9d6e2bc2c0ebfd58cb7d0ff9449ac9379da60..9ee927cfc353df38c4065073c85b5a4284299d58 100644 --- a/apct-tests/perftests/core/src/android/libcore/regression/ByteBufferScalarVersusVectorPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/regression/ByteBufferScalarVersusVectorPerfTest.java @@ -18,7 +18,8 @@ package android.libcore.regression; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; + +import androidx.test.filters.LargeTest; import junitparams.JUnitParamsRunner; import junitparams.Parameters; diff --git a/apct-tests/perftests/core/src/android/libcore/regression/CharacterPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/CharacterPerfTest.java index 0a598998bced56c6956d9dba4f9f46382ccc32ef..e4a4db739235bcf8909e3a429c1446853927dc55 100644 --- a/apct-tests/perftests/core/src/android/libcore/regression/CharacterPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/regression/CharacterPerfTest.java @@ -18,7 +18,8 @@ package android.libcore.regression; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; + +import androidx.test.filters.LargeTest; import junitparams.JUnitParamsRunner; import junitparams.Parameters; diff --git a/apct-tests/perftests/core/src/android/libcore/regression/CharsetForNamePerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/CharsetForNamePerfTest.java index 8da13a9b7f914edf6de72e50beee9f88f5f983aa..858c101fc33e6a07b6933a4d8868f20da3b4d3ab 100644 --- a/apct-tests/perftests/core/src/android/libcore/regression/CharsetForNamePerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/regression/CharsetForNamePerfTest.java @@ -18,7 +18,8 @@ package android.libcore.regression; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; + +import androidx.test.filters.LargeTest; import junitparams.JUnitParamsRunner; import junitparams.Parameters; diff --git a/apct-tests/perftests/core/src/android/libcore/regression/CharsetPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/CharsetPerfTest.java index 048c50f044c89b6d28cf8408bbdc05d9c33a7b91..a2fb7d7f83d8872e6703cf9e1d31609586f601e6 100644 --- a/apct-tests/perftests/core/src/android/libcore/regression/CharsetPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/regression/CharsetPerfTest.java @@ -18,7 +18,8 @@ package android.libcore.regression; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; + +import androidx.test.filters.LargeTest; import junitparams.JUnitParamsRunner; import junitparams.Parameters; diff --git a/apct-tests/perftests/core/src/android/libcore/regression/CharsetUtf8PerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/CharsetUtf8PerfTest.java index b753006e193ec976fd3159afda776204642bc815..2047444a7f52401750a225e2ae68f3f2403ebb64 100644 --- a/apct-tests/perftests/core/src/android/libcore/regression/CharsetUtf8PerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/regression/CharsetUtf8PerfTest.java @@ -18,8 +18,8 @@ package android.libcore.regression; import android.icu.lang.UCharacter; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/regression/ChecksumPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/ChecksumPerfTest.java index 1d33fcb250b9db8cb4363c6f4d2433924e08463f..4ce8b41de403d82edd7903910a0fc808ac992aff 100644 --- a/apct-tests/perftests/core/src/android/libcore/regression/ChecksumPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/regression/ChecksumPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.regression; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/regression/CipherInputStreamPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/CipherInputStreamPerfTest.java index 35730ec753f11fa4a737f83c02c8385e612f9c2b..6a7ec1ad62e9fdb8fcab3f23f558c9e25aad071f 100644 --- a/apct-tests/perftests/core/src/android/libcore/regression/CipherInputStreamPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/regression/CipherInputStreamPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.regression; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Before; diff --git a/apct-tests/perftests/core/src/android/libcore/regression/CipherPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/CipherPerfTest.java index 42b058815bfef28b1adb1fdf6cc2646c260077cb..238c028fa0cf55a63d530916e956ef99eb397257 100644 --- a/apct-tests/perftests/core/src/android/libcore/regression/CipherPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/regression/CipherPerfTest.java @@ -18,7 +18,8 @@ package android.libcore.regression; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; + +import androidx.test.filters.LargeTest; import junitparams.JUnitParamsRunner; import junitparams.Parameters; diff --git a/apct-tests/perftests/core/src/android/libcore/regression/CollatorPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/CollatorPerfTest.java index 6728e73d0c4bd73268b67e88bc4dc82fe3c1ade5..7e5566055fb4e06fd090c5a14076ee2fa16c2b1e 100644 --- a/apct-tests/perftests/core/src/android/libcore/regression/CollatorPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/regression/CollatorPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.regression; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/regression/CollectionsPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/CollectionsPerfTest.java index 69197c3325f4e3c94af50256d68b3705930b2b10..100798a7957bf6c9865c81ee4cbc08b16442feb9 100644 --- a/apct-tests/perftests/core/src/android/libcore/regression/CollectionsPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/regression/CollectionsPerfTest.java @@ -18,7 +18,8 @@ package android.libcore.regression; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; + +import androidx.test.filters.LargeTest; import junitparams.JUnitParamsRunner; import junitparams.Parameters; diff --git a/apct-tests/perftests/core/src/android/libcore/regression/DateFormatPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/DateFormatPerfTest.java index 4dba1391438ce34602447dd48993275bcc825e91..b6784a8d38670f77ea87eb09d703afca616c5c32 100644 --- a/apct-tests/perftests/core/src/android/libcore/regression/DateFormatPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/regression/DateFormatPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.regression; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Before; diff --git a/apct-tests/perftests/core/src/android/libcore/regression/DecimalFormatPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/DecimalFormatPerfTest.java index f3eddab0e77c1f2e6f1cb0d1b604f825fc8dff18..52f98738481fbc36b21cb6629eb8f3eb0f07c9a5 100644 --- a/apct-tests/perftests/core/src/android/libcore/regression/DecimalFormatPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/regression/DecimalFormatPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.regression; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/regression/DecimalFormatSymbolsPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/DecimalFormatSymbolsPerfTest.java index 2bf04180fa79f14b8a58a66701da7502087cc847..6105420611074fc442e1751629997dbb3eb8b15c 100644 --- a/apct-tests/perftests/core/src/android/libcore/regression/DecimalFormatSymbolsPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/regression/DecimalFormatSymbolsPerfTest.java @@ -17,8 +17,8 @@ package android.libcore.regression; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/regression/DefaultCharsetPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/DefaultCharsetPerfTest.java index c3320a4e5a2096e2b15b73761078232a68d8db44..fae74a5e86208a6c1fbe1344d408f02238d00061 100644 --- a/apct-tests/perftests/core/src/android/libcore/regression/DefaultCharsetPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/regression/DefaultCharsetPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.regression; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/regression/DnsPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/DnsPerfTest.java index 7c52ac424a2ad0b2ea7dba5cba667df4a84c7452..2915363786f3a49ca823afc2f5046b4564e127ab 100644 --- a/apct-tests/perftests/core/src/android/libcore/regression/DnsPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/regression/DnsPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.regression; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/regression/DoPrivilegedPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/DoPrivilegedPerfTest.java index d13335906ec6a1482b96ae70496b43bbada0ef59..dd7e5cc1057b223bb74257865c2994a6b5d7250d 100644 --- a/apct-tests/perftests/core/src/android/libcore/regression/DoPrivilegedPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/regression/DoPrivilegedPerfTest.java @@ -18,15 +18,14 @@ package android.libcore.regression; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; import org.junit.Test; import org.junit.runner.RunWith; - import java.security.AccessController; import java.security.PrivilegedAction; diff --git a/apct-tests/perftests/core/src/android/libcore/regression/DoublePerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/DoublePerfTest.java index 38904af7edd7db74e3b529cfd83c303562341ecc..e034a47e79d211532579a7fd42bbd924a58aec62 100644 --- a/apct-tests/perftests/core/src/android/libcore/regression/DoublePerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/regression/DoublePerfTest.java @@ -18,8 +18,8 @@ package android.libcore.regression; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/regression/EqualsHashCodePerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/EqualsHashCodePerfTest.java index 839120336697a1e984b4c45afaca6235d5d71247..fe1b599cc5ad1bd7c3f338de9d11d80ae34d91dd 100644 --- a/apct-tests/perftests/core/src/android/libcore/regression/EqualsHashCodePerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/regression/EqualsHashCodePerfTest.java @@ -18,7 +18,8 @@ package android.libcore.regression; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; + +import androidx.test.filters.LargeTest; import junitparams.JUnitParamsRunner; import junitparams.Parameters; diff --git a/apct-tests/perftests/core/src/android/libcore/regression/ExpensiveObjectsPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/ExpensiveObjectsPerfTest.java index 7712aeef416142fc195b337fb5ad90e65e43e83f..ecbfc7169945ad808ee25cdfb193bcc89d333573 100644 --- a/apct-tests/perftests/core/src/android/libcore/regression/ExpensiveObjectsPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/regression/ExpensiveObjectsPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.regression; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/regression/FilePerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/FilePerfTest.java index 783136a5b3a2feea3cd3e07b6a2678c7c0965a13..0c14d64c27a94dc6a2a7f8c84835896282f85485 100644 --- a/apct-tests/perftests/core/src/android/libcore/regression/FilePerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/regression/FilePerfTest.java @@ -18,8 +18,8 @@ package android.libcore.regression; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/regression/FloatPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/FloatPerfTest.java index a995f5caa183af8601c7af5adb71a2a9fd93a1c7..7d7d83b3fdbf3645078c2252f1184f6f2cb2db07 100644 --- a/apct-tests/perftests/core/src/android/libcore/regression/FloatPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/regression/FloatPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.regression; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/regression/FormatterPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/FormatterPerfTest.java index 94c4f0807cbc9d22acd37a2d81f72911251bf050..08dda5314eacf491ed6e24844500e5bf3a68c879 100644 --- a/apct-tests/perftests/core/src/android/libcore/regression/FormatterPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/regression/FormatterPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.regression; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/regression/IdnPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/IdnPerfTest.java index c60930f99682bf6e0d448138b37f79af2282aec8..a09ad809a6a219f431a213763d86c921871548c2 100644 --- a/apct-tests/perftests/core/src/android/libcore/regression/IdnPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/regression/IdnPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.regression; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/regression/IntConstantDivisionPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/IntConstantDivisionPerfTest.java index abcc972b0ac362241b3b819fefcf2bb70d43daa1..be22814ef8f42af84698634c676ff4ae57aa20bf 100644 --- a/apct-tests/perftests/core/src/android/libcore/regression/IntConstantDivisionPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/regression/IntConstantDivisionPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.regression; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/regression/IntConstantMultiplicationPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/IntConstantMultiplicationPerfTest.java index c9f06166e33b754bb70fa1ef74d32982cc6d1e9d..4337c903ecd6f788236713ad63c8bce7903b67b1 100644 --- a/apct-tests/perftests/core/src/android/libcore/regression/IntConstantMultiplicationPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/regression/IntConstantMultiplicationPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.regression; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/regression/IntConstantRemainderPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/IntConstantRemainderPerfTest.java index 78f744c1b938ba93ad5cab999b696f847167da91..1b6c5026e1f61734d811ad54aa0d355fbae754b9 100644 --- a/apct-tests/perftests/core/src/android/libcore/regression/IntConstantRemainderPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/regression/IntConstantRemainderPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.regression; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/regression/IntegralToStringPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/IntegralToStringPerfTest.java index 5129fcbfb24723db3d172ec2a02f43a1144fd555..0aa854ecfa8009b98492c6f1bc53b99a9dca6b4f 100644 --- a/apct-tests/perftests/core/src/android/libcore/regression/IntegralToStringPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/regression/IntegralToStringPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.regression; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/regression/KeyPairGeneratorPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/KeyPairGeneratorPerfTest.java index 80c448732b59c4bbab5c93b8841e081fad702744..9b3d7a0447206dfb28e4a01ff0e968bdbe615ede 100644 --- a/apct-tests/perftests/core/src/android/libcore/regression/KeyPairGeneratorPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/regression/KeyPairGeneratorPerfTest.java @@ -18,7 +18,8 @@ package android.libcore.regression; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; + +import androidx.test.filters.LargeTest; import junitparams.JUnitParamsRunner; import junitparams.Parameters; diff --git a/apct-tests/perftests/core/src/android/libcore/regression/LoopingBackwardsPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/LoopingBackwardsPerfTest.java index c9b0cbe1bedb2945df0f0a448c6761a99e967f38..1a9e19aeb78dee7e7e7f302b3e13fb609d407919 100644 --- a/apct-tests/perftests/core/src/android/libcore/regression/LoopingBackwardsPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/regression/LoopingBackwardsPerfTest.java @@ -18,7 +18,8 @@ package android.libcore.regression; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; + +import androidx.test.filters.LargeTest; import junitparams.JUnitParamsRunner; import junitparams.Parameters; diff --git a/apct-tests/perftests/core/src/android/libcore/regression/MathPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/MathPerfTest.java index 4c2d7fb7e6631a3ff5386b28cff29e75cec6b686..a8a704c09d6d713e926fa007eeb0ec3f839bdb1d 100644 --- a/apct-tests/perftests/core/src/android/libcore/regression/MathPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/regression/MathPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.regression; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/regression/MessageDigestPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/MessageDigestPerfTest.java index 2dc947a613d2c01be22baf7bd758e2ac774a006b..6da9666db23b07a5a98120b7f3d5169c250a3122 100644 --- a/apct-tests/perftests/core/src/android/libcore/regression/MessageDigestPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/regression/MessageDigestPerfTest.java @@ -18,7 +18,8 @@ package android.libcore.regression; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; + +import androidx.test.filters.LargeTest; import junitparams.JUnitParamsRunner; import junitparams.Parameters; diff --git a/apct-tests/perftests/core/src/android/libcore/regression/MutableIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/MutableIntPerfTest.java index d9d4bb5d0ae1f95ea518bd223e39b21425394c60..060d18fb3de39777e3be43754a0abea045b5a5ee 100644 --- a/apct-tests/perftests/core/src/android/libcore/regression/MutableIntPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/regression/MutableIntPerfTest.java @@ -18,7 +18,8 @@ package android.libcore.regression; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; + +import androidx.test.filters.LargeTest; import junitparams.JUnitParamsRunner; import junitparams.Parameters; diff --git a/apct-tests/perftests/core/src/android/libcore/regression/NumberFormatPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/NumberFormatPerfTest.java index dae185e1209c4720453b54469d9399fe481afaac..7cb3b2283779fcc1bb14efadc73f4a5ba6535c7d 100644 --- a/apct-tests/perftests/core/src/android/libcore/regression/NumberFormatPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/regression/NumberFormatPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.regression; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/regression/NumberFormatTrivialFormatLongPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/NumberFormatTrivialFormatLongPerfTest.java index 5ff2b225d64f1074657cc36a054c3d24b410d667..272b45a3affe9a41d2a95274c3183156601208ba 100644 --- a/apct-tests/perftests/core/src/android/libcore/regression/NumberFormatTrivialFormatLongPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/regression/NumberFormatTrivialFormatLongPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.regression; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/regression/PriorityQueuePerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/PriorityQueuePerfTest.java index 48450b4616e6abf7131ed9aab0c63199a10f0d9b..c3a09662fd1fd26a5bc6e52114c793e3c71c65e9 100644 --- a/apct-tests/perftests/core/src/android/libcore/regression/PriorityQueuePerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/regression/PriorityQueuePerfTest.java @@ -18,7 +18,8 @@ package android.libcore.regression; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; + +import androidx.test.filters.LargeTest; import junitparams.JUnitParamsRunner; import junitparams.Parameters; diff --git a/apct-tests/perftests/core/src/android/libcore/regression/PropertyAccessPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/PropertyAccessPerfTest.java index 21ccba5cc2e75ea70bf967806a5c0fea731af1d3..2ac56bed191005d6dab578afea983cbf938e8e8c 100644 --- a/apct-tests/perftests/core/src/android/libcore/regression/PropertyAccessPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/regression/PropertyAccessPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.regression; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Before; diff --git a/apct-tests/perftests/core/src/android/libcore/regression/ProviderPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/ProviderPerfTest.java index f7bcf12c858ebfc07cb017f7cddac083b9c87b6c..7ad0141c8471827848b20c558efab7ba829028e2 100644 --- a/apct-tests/perftests/core/src/android/libcore/regression/ProviderPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/regression/ProviderPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.regression; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/regression/RandomPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/RandomPerfTest.java index d8bff4cc20d1303a8679a61fb82c0abfe95b4d6c..c7b6cb5a190cb960eb4c48a5e66ea3754c5a6bc3 100644 --- a/apct-tests/perftests/core/src/android/libcore/regression/RandomPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/regression/RandomPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.regression; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/regression/RealToStringPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/RealToStringPerfTest.java index 2542df90896ff4d46aa42c1bba942554cc4b468e..44e5f227b00abb3c07ff20bebe838d3ba8c97982 100644 --- a/apct-tests/perftests/core/src/android/libcore/regression/RealToStringPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/regression/RealToStringPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.regression; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/regression/ReflectionPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/ReflectionPerfTest.java index b06662ccd9b5b92fb1fc9c402ceaa6d3d737fd8d..6e00b10838a6c574dbd68397f15f09498e15ddcb 100644 --- a/apct-tests/perftests/core/src/android/libcore/regression/ReflectionPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/regression/ReflectionPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.regression; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/regression/SSLLoopbackPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/SSLLoopbackPerfTest.java index 694d609cd950070325f574bf205a6b6eaa8cd360..5a9b5c36d0d3c51c325ff417d5b41850c46bb340 100644 --- a/apct-tests/perftests/core/src/android/libcore/regression/SSLLoopbackPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/regression/SSLLoopbackPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.regression; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import libcore.java.security.TestKeyStore; diff --git a/apct-tests/perftests/core/src/android/libcore/regression/SSLSocketFactoryPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/SSLSocketFactoryPerfTest.java index bdbbcb0da0068f37b808c21de9809c53e20e6313..6d48cf26c971d41a63913c782871ccdd7825ac56 100644 --- a/apct-tests/perftests/core/src/android/libcore/regression/SSLSocketFactoryPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/regression/SSLSocketFactoryPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.regression; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/regression/SchemePrefixPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/SchemePrefixPerfTest.java index 5ad62dedcae77a2eb9b30b4482bcd5bf8bf9827a..86416291f26d7fdd2a78a8fdff820be643355f42 100644 --- a/apct-tests/perftests/core/src/android/libcore/regression/SchemePrefixPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/regression/SchemePrefixPerfTest.java @@ -18,7 +18,8 @@ package android.libcore.regression; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; + +import androidx.test.filters.LargeTest; import junitparams.JUnitParamsRunner; import junitparams.Parameters; diff --git a/apct-tests/perftests/core/src/android/libcore/regression/SerializationPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/SerializationPerfTest.java index 1ec22d217109d396c47c655cbc2d5d90363879e2..afd1191a07fa44d388e925d8eeec1003f0c71f5b 100644 --- a/apct-tests/perftests/core/src/android/libcore/regression/SerializationPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/regression/SerializationPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.regression; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/regression/SignaturePerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/SignaturePerfTest.java index a9a0788f613620086369ccfc97c75038460f3a31..6c261332aa99b16d8dd363071126e8b08d55ff73 100644 --- a/apct-tests/perftests/core/src/android/libcore/regression/SignaturePerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/regression/SignaturePerfTest.java @@ -17,7 +17,8 @@ package android.libcore.regression; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; + +import androidx.test.filters.LargeTest; import junitparams.JUnitParamsRunner; import junitparams.Parameters; diff --git a/apct-tests/perftests/core/src/android/libcore/regression/SimpleDateFormatPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/SimpleDateFormatPerfTest.java index c25b0ce6d7d902966f2684998e3b27fdf228ffd3..274b51f6fae460f7241a9227b3fd670f779e4eb2 100644 --- a/apct-tests/perftests/core/src/android/libcore/regression/SimpleDateFormatPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/regression/SimpleDateFormatPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.regression; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/regression/StrictMathPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/StrictMathPerfTest.java index eeccb5bd64f4e60f1a9bedcbff0150de30fddc0f..b4c427beac659d7f4bd7ae2c9ac398f9db1122fc 100644 --- a/apct-tests/perftests/core/src/android/libcore/regression/StrictMathPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/regression/StrictMathPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.regression; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/regression/StringBuilderPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/StringBuilderPerfTest.java index 10fa8b93acaf2b4b5470d320df5cc4a2b953535e..2235cc5611a4155524d9bbbc3cca009d67c6e7a7 100644 --- a/apct-tests/perftests/core/src/android/libcore/regression/StringBuilderPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/regression/StringBuilderPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.regression; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/regression/StringEqualsPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/StringEqualsPerfTest.java index 6854c0de93878710f16e454a081af50f0281edda..9ab50005e62abc3a7dc2613bc41ac08369c0bbb1 100644 --- a/apct-tests/perftests/core/src/android/libcore/regression/StringEqualsPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/regression/StringEqualsPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.regression; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import junit.framework.Assert; diff --git a/apct-tests/perftests/core/src/android/libcore/regression/StringIsEmptyPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/StringIsEmptyPerfTest.java index 79ff646bbfffacf88cb8b87ad47165a2927c8932..b1e749cc538c8490b1449810d17a389fccbee144 100644 --- a/apct-tests/perftests/core/src/android/libcore/regression/StringIsEmptyPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/regression/StringIsEmptyPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.regression; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/regression/StringLengthPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/StringLengthPerfTest.java index 8dbf9f58fbf8fb2606e435a54ddb98d41bc31bd8..9e5759171a6fd4300f46401f3c86db337253961c 100644 --- a/apct-tests/perftests/core/src/android/libcore/regression/StringLengthPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/regression/StringLengthPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.regression; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/regression/StringPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/StringPerfTest.java index 36db014b75a56556c8fd8febee66a8ef807dc81b..a80514c72e95de80ff7e7d679efa9b51741e61cf 100644 --- a/apct-tests/perftests/core/src/android/libcore/regression/StringPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/regression/StringPerfTest.java @@ -18,7 +18,8 @@ package android.libcore.regression; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; + +import androidx.test.filters.LargeTest; import junitparams.JUnitParamsRunner; import junitparams.Parameters; diff --git a/apct-tests/perftests/core/src/android/libcore/regression/StringReplaceAllPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/StringReplaceAllPerfTest.java index 5b4423a3283195e00da74861fe217e294a390170..78ae3952719b6c1cd7f0081c672be8a7b5294530 100644 --- a/apct-tests/perftests/core/src/android/libcore/regression/StringReplaceAllPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/regression/StringReplaceAllPerfTest.java @@ -18,7 +18,8 @@ package android.libcore.regression; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; + +import androidx.test.filters.LargeTest; import junitparams.JUnitParamsRunner; import junitparams.Parameters; diff --git a/apct-tests/perftests/core/src/android/libcore/regression/StringReplacePerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/StringReplacePerfTest.java index 4d5c792295b93f170c3d85ddb5101ae053e47c44..73911c71c351fdbb9824d6b5977938c23686c710 100644 --- a/apct-tests/perftests/core/src/android/libcore/regression/StringReplacePerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/regression/StringReplacePerfTest.java @@ -18,7 +18,8 @@ package android.libcore.regression; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; + +import androidx.test.filters.LargeTest; import junitparams.JUnitParamsRunner; import junitparams.Parameters; diff --git a/apct-tests/perftests/core/src/android/libcore/regression/StringSplitPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/StringSplitPerfTest.java index 2bb25ac566941650298c99ea52ed2821499bcc3a..1539271c2b3c76346e79280534c2cba2af56924c 100644 --- a/apct-tests/perftests/core/src/android/libcore/regression/StringSplitPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/regression/StringSplitPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.regression; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/regression/StringToBytesPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/StringToBytesPerfTest.java index c004d959b9b389804f0e3e07d3b35699f7691b33..0d5e62b4268c791fbc15dc01a5e4169a94462a61 100644 --- a/apct-tests/perftests/core/src/android/libcore/regression/StringToBytesPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/regression/StringToBytesPerfTest.java @@ -18,7 +18,8 @@ package android.libcore.regression; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; + +import androidx.test.filters.LargeTest; import junitparams.JUnitParamsRunner; import junitparams.Parameters; diff --git a/apct-tests/perftests/core/src/android/libcore/regression/StringToRealPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/StringToRealPerfTest.java index 15516fc1c51c0536179659e1267e2b170a9e4b3b..ecdf809f1610b2240379467cb9272e1bbbcecff9 100644 --- a/apct-tests/perftests/core/src/android/libcore/regression/StringToRealPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/regression/StringToRealPerfTest.java @@ -18,7 +18,8 @@ package android.libcore.regression; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; + +import androidx.test.filters.LargeTest; import junitparams.JUnitParamsRunner; import junitparams.Parameters; diff --git a/apct-tests/perftests/core/src/android/libcore/regression/ThreadLocalPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/ThreadLocalPerfTest.java index f2565550c6c579a437d8323db5e833ccf112a28b..2b2a6b5727deea5325b2fed9ae37b519ef27286b 100644 --- a/apct-tests/perftests/core/src/android/libcore/regression/ThreadLocalPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/regression/ThreadLocalPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.regression; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/regression/TimeZonePerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/TimeZonePerfTest.java index 8274512e1501256f16bba85c2ffc446405c01243..6eb8fccf5b2a3a7123c3ed050fa685ace0682b89 100644 --- a/apct-tests/perftests/core/src/android/libcore/regression/TimeZonePerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/regression/TimeZonePerfTest.java @@ -18,8 +18,8 @@ package android.libcore.regression; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/regression/XMLEntitiesPerfTest.java b/apct-tests/perftests/core/src/android/libcore/regression/XMLEntitiesPerfTest.java index ae1e8bce42ac9d345a07ebde038c3d947235204e..288c646ec67d9ea547f2b1d301e1afbdc558890e 100644 --- a/apct-tests/perftests/core/src/android/libcore/regression/XMLEntitiesPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/regression/XMLEntitiesPerfTest.java @@ -18,7 +18,8 @@ package android.libcore.regression; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; + +import androidx.test.filters.LargeTest; import junitparams.JUnitParamsRunner; import junitparams.Parameters; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/ReflectGetFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/ReflectGetFieldLittleEndianIntPerfTest.java index e7bb8f84d6716eaabfc4d33eb59940cf19b3103b..003c957d894fe0b400cb43b8f15ef843a3066a11 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/ReflectGetFieldLittleEndianIntPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/ReflectGetFieldLittleEndianIntPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/ReflectGetFieldLittleEndianStringPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/ReflectGetFieldLittleEndianStringPerfTest.java index 5bac46af4630c7f2b516a23e2f5f7b83a98eb1fa..4f216181d5e3627afe24a24083e780673f98159a 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/ReflectGetFieldLittleEndianStringPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/ReflectGetFieldLittleEndianStringPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/ReflectGetStaticFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/ReflectGetStaticFieldLittleEndianIntPerfTest.java index 1005a70e96e0f77531232e1c4f4dfa1805f71c56..210014ad3f6e885db539f66ac8215aac327ee624 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/ReflectGetStaticFieldLittleEndianIntPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/ReflectGetStaticFieldLittleEndianIntPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/ReflectGetStaticFieldLittleEndianStringPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/ReflectGetStaticFieldLittleEndianStringPerfTest.java index 5224ad3b5911b14043cd85fe67938690eb41c263..22c68273bf1280c444d839b971915980eac960c1 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/ReflectGetStaticFieldLittleEndianStringPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/ReflectGetStaticFieldLittleEndianStringPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/ReflectSetFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/ReflectSetFieldLittleEndianIntPerfTest.java index 06696ef0773b012184352a1ac4515eabb4922dd3..5b391091253b33cd79f7da0ccaf1166f4913b1e8 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/ReflectSetFieldLittleEndianIntPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/ReflectSetFieldLittleEndianIntPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/ReflectSetFieldLittleEndianStringPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/ReflectSetFieldLittleEndianStringPerfTest.java index a784c524a4c57eefd1b219af487cc74c8b6d17a0..883e8a76586b298bcc8bc81c2e39b72106a960ed 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/ReflectSetFieldLittleEndianStringPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/ReflectSetFieldLittleEndianStringPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/ReflectSetStaticFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/ReflectSetStaticFieldLittleEndianIntPerfTest.java index 4ce0078ff1c1da62c66889d600b66a95e7cc33a8..50bc85c3128063f88620020e13064acab756d6f5 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/ReflectSetStaticFieldLittleEndianIntPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/ReflectSetStaticFieldLittleEndianIntPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/ReflectSetStaticFieldLittleEndianStringPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/ReflectSetStaticFieldLittleEndianStringPerfTest.java index 587e201c4e17d362ce2d4a4d081213601fb68369..13fa2bf7d230903f23681e21fab5985bccb6b269 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/ReflectSetStaticFieldLittleEndianStringPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/ReflectSetStaticFieldLittleEndianStringPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandexchangeAcquireFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandexchangeAcquireFieldLittleEndianIntPerfTest.java index e06b53434438157090c7f6f6e120d00c71b96884..85c9bae9a9d920ca1b68640674e2c35cfc585501 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandexchangeAcquireFieldLittleEndianIntPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandexchangeAcquireFieldLittleEndianIntPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandexchangeAcquireFieldLittleEndianStringPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandexchangeAcquireFieldLittleEndianStringPerfTest.java index 0fd16a02e22ca5170a25fa2da9082e07030ac70b..2b8f430440f574b1359bb70631f4a7480b00e372 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandexchangeAcquireFieldLittleEndianStringPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandexchangeAcquireFieldLittleEndianStringPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandexchangeAcquireStaticFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandexchangeAcquireStaticFieldLittleEndianIntPerfTest.java index 7ad42d0575889d143e52581969ddcb249af7b7a9..246fa43d0dca8836440bfc9cc276cbb4271b2e40 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandexchangeAcquireStaticFieldLittleEndianIntPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandexchangeAcquireStaticFieldLittleEndianIntPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandexchangeAcquireStaticFieldLittleEndianStringPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandexchangeAcquireStaticFieldLittleEndianStringPerfTest.java index 76e1f47251cf1e02e3c42cc67affded23b9f0e32..d12ffae25c5e58305db20d2c99dfdf6c884b2925 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandexchangeAcquireStaticFieldLittleEndianStringPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandexchangeAcquireStaticFieldLittleEndianStringPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandexchangeFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandexchangeFieldLittleEndianIntPerfTest.java index b4b78408a45ffa4467bbcf62a921686a2c76c3b4..5ced1157cb73223a5c7de75cb064981271752991 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandexchangeFieldLittleEndianIntPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandexchangeFieldLittleEndianIntPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandexchangeFieldLittleEndianStringPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandexchangeFieldLittleEndianStringPerfTest.java index 09ed167cef35237153c207a101d5bffd9259acdd..b955d506fe856e3a30191837803671e796b5c06d 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandexchangeFieldLittleEndianStringPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandexchangeFieldLittleEndianStringPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandexchangeReleaseFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandexchangeReleaseFieldLittleEndianIntPerfTest.java index 920d2e4767e59596e1142d94ed96481039d2a341..601ff3461f5bcca4eb834ab5f35b45246af01901 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandexchangeReleaseFieldLittleEndianIntPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandexchangeReleaseFieldLittleEndianIntPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandexchangeReleaseFieldLittleEndianStringPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandexchangeReleaseFieldLittleEndianStringPerfTest.java index 55ed789d1227da4cf9b62d06536dc010e3d4e2ed..0e567f9568e6fda60a9ed6e9f5f6cae3da9fe35e 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandexchangeReleaseFieldLittleEndianStringPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandexchangeReleaseFieldLittleEndianStringPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandexchangeReleaseStaticFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandexchangeReleaseStaticFieldLittleEndianIntPerfTest.java index ea3057b3f54f747ffb539bf89b0106d48565e7af..6be287006f42e5fbd17fa9929898cd490c873d3c 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandexchangeReleaseStaticFieldLittleEndianIntPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandexchangeReleaseStaticFieldLittleEndianIntPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandexchangeReleaseStaticFieldLittleEndianStringPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandexchangeReleaseStaticFieldLittleEndianStringPerfTest.java index 20558aa92f48277920d9283482f11dc8d943c4f5..84c186bd24e6544d01436cc45f7cbabc98cf77d7 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandexchangeReleaseStaticFieldLittleEndianStringPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandexchangeReleaseStaticFieldLittleEndianStringPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandexchangeStaticFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandexchangeStaticFieldLittleEndianIntPerfTest.java index d7b1d2989c0e831ba8ef2a127af90412ea7ab817..b093234b2bc56a6c5cc78cf12a9ea17226d069c5 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandexchangeStaticFieldLittleEndianIntPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandexchangeStaticFieldLittleEndianIntPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandexchangeStaticFieldLittleEndianStringPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandexchangeStaticFieldLittleEndianStringPerfTest.java index d138dc979b1d86f85342a545bbe16f1db11414e6..0d2037b4ab27b294105a542e2264ad945a156203 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandexchangeStaticFieldLittleEndianStringPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandexchangeStaticFieldLittleEndianStringPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandsetFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandsetFieldLittleEndianIntPerfTest.java index 36153f2b70370276cb75f152a70774a29b1b716d..ee31973c308aefcfbccc4ce5f7a9f374557410b2 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandsetFieldLittleEndianIntPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandsetFieldLittleEndianIntPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandsetFieldLittleEndianStringPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandsetFieldLittleEndianStringPerfTest.java index bf4fbc4eeefbfa9f5e97bdf9ddde94783f345f8e..0571fefe2a434ea0287fca14cc2e8d41f67f858d 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandsetFieldLittleEndianStringPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandsetFieldLittleEndianStringPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandsetStaticFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandsetStaticFieldLittleEndianIntPerfTest.java index d3c1b36bd3a6cb327085b61e836af8164e945803..f619dabdd50ac49c595617648d698785daf96b68 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandsetStaticFieldLittleEndianIntPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandsetStaticFieldLittleEndianIntPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandsetStaticFieldLittleEndianStringPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandsetStaticFieldLittleEndianStringPerfTest.java index 90e69a1683916c0f76f431ba3d9526b0b0a8cbf4..fc443fa362bc803d99079c6e4656d13446dce402 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandsetStaticFieldLittleEndianStringPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleCompareandsetStaticFieldLittleEndianStringPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetAcquireFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetAcquireFieldLittleEndianIntPerfTest.java index 96bc1049fad4f7707710833c290bf2781e07d3a1..bf3d58b68692ecac8a633b4bd0abbb333430f7fe 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetAcquireFieldLittleEndianIntPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetAcquireFieldLittleEndianIntPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Before; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetAcquireFieldLittleEndianStringPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetAcquireFieldLittleEndianStringPerfTest.java index 2679494eb6de688b9e24c13a8deafe7d6e267ec5..1f4bc31f24c658daa78c609415e7481aff905156 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetAcquireFieldLittleEndianStringPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetAcquireFieldLittleEndianStringPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Before; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetAcquireStaticFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetAcquireStaticFieldLittleEndianIntPerfTest.java index 170dce76d9c869555469d31d520bfb0fa9d1f498..2085552e91dd73f69f199cb31345a69870be5fc6 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetAcquireStaticFieldLittleEndianIntPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetAcquireStaticFieldLittleEndianIntPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Before; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetAcquireStaticFieldLittleEndianStringPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetAcquireStaticFieldLittleEndianStringPerfTest.java index 11d12db39397fff84eb99d418b4db4c60e422b1e..d9c7d7b7695ef40d2feb5e0c04d3f74d662afc95 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetAcquireStaticFieldLittleEndianStringPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetAcquireStaticFieldLittleEndianStringPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Before; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetArrayLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetArrayLittleEndianIntPerfTest.java index bd2a6008e239d6d27a859b8560c7f32e005b1972..acd2533a38e4d5039a780b79c2ca14f608b99985 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetArrayLittleEndianIntPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetArrayLittleEndianIntPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Before; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetArrayLittleEndianStringPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetArrayLittleEndianStringPerfTest.java index 99a09cda367f70b0485938928ed440e6171b926d..de9944a8c274f9eb98a42e27450fa7c3012afa19 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetArrayLittleEndianStringPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetArrayLittleEndianStringPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Before; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetByteArrayViewBigEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetByteArrayViewBigEndianIntPerfTest.java index db83606bdb5454580fc9036849486dec719478cf..a8639292cbb3162a0e53967710cb3513a727d33c 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetByteArrayViewBigEndianIntPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetByteArrayViewBigEndianIntPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Before; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetByteArrayViewLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetByteArrayViewLittleEndianIntPerfTest.java index 4a8f92461301f0b406a608f8fa62ae3b8f43bad5..4999b9bf68506948f3c2a9cf12ebc268a8429f01 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetByteArrayViewLittleEndianIntPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetByteArrayViewLittleEndianIntPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Before; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetFieldLittleEndianIntPerfTest.java index 4e4a9ee980fdaf83fc7f5f2e62aae4d7985e9d12..ee80a6f72c930c78889b2522467603a160428e81 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetFieldLittleEndianIntPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetFieldLittleEndianIntPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Before; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetFieldLittleEndianStringPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetFieldLittleEndianStringPerfTest.java index 3e7de1d08a0e874ff16f70ed14fee5aab5500987..ec29f7a33b39d4d1ac21c57c67e94aeed8809ea3 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetFieldLittleEndianStringPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetFieldLittleEndianStringPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Before; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetOpaqueFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetOpaqueFieldLittleEndianIntPerfTest.java index 67d53b34c4d63b255b0ae0dda384d0a62dd9e1ca..ee6a669f2f839cacc2d19b69462902d3274352c1 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetOpaqueFieldLittleEndianIntPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetOpaqueFieldLittleEndianIntPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Before; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetOpaqueFieldLittleEndianStringPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetOpaqueFieldLittleEndianStringPerfTest.java index 470a1ce0fb71b4d847e8f5bd1c6f19eb13d32e38..1702b84e703b3399fe99af8d4cc509cca1eff42f 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetOpaqueFieldLittleEndianStringPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetOpaqueFieldLittleEndianStringPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Before; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetOpaqueStaticFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetOpaqueStaticFieldLittleEndianIntPerfTest.java index 8a982c23b1cbb73451d8e6b7555c5f7b20eb0e84..514ddb9c4b1196b9994d4ada9b154443573db66e 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetOpaqueStaticFieldLittleEndianIntPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetOpaqueStaticFieldLittleEndianIntPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Before; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetOpaqueStaticFieldLittleEndianStringPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetOpaqueStaticFieldLittleEndianStringPerfTest.java index 2c17a698b5e762814980efc24f755dfcda9a7599..fbcee6906bd7300790b44b68b45f1758618f4db0 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetOpaqueStaticFieldLittleEndianStringPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetOpaqueStaticFieldLittleEndianStringPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Before; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetStaticFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetStaticFieldLittleEndianIntPerfTest.java index 099b1f4f6d828fe36d63be01db1cb84e60614f47..2c5658810b05f89ead052dc4dd2808b3d23d7e48 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetStaticFieldLittleEndianIntPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetStaticFieldLittleEndianIntPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Before; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetStaticFieldLittleEndianStringPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetStaticFieldLittleEndianStringPerfTest.java index 7f6b4b8b637e382023a7d8e6ae5fb7ef5e3e509f..8fce69e620339b64854eee38919480b23235dc2d 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetStaticFieldLittleEndianStringPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetStaticFieldLittleEndianStringPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Before; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetVolatileFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetVolatileFieldLittleEndianIntPerfTest.java index 8592d30f58f0aa0ab3e554357a2ae9f60d1f910e..ef530607bb56bee741a4a1f8abeccb6b84e9f678 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetVolatileFieldLittleEndianIntPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetVolatileFieldLittleEndianIntPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Before; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetVolatileFieldLittleEndianStringPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetVolatileFieldLittleEndianStringPerfTest.java index 539bd2aa8e8c3601fe4d3432de3bbf50a2cf8c38..64c08983a06330b5b6a04e966caaa5bf0b805815 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetVolatileFieldLittleEndianStringPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetVolatileFieldLittleEndianStringPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Before; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetVolatileStaticFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetVolatileStaticFieldLittleEndianIntPerfTest.java index a36a7b6d39a220b573f5a8ef37fb62da182b6212..939100c47c0568a60503a55923ec95f689453adf 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetVolatileStaticFieldLittleEndianIntPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetVolatileStaticFieldLittleEndianIntPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Before; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetVolatileStaticFieldLittleEndianStringPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetVolatileStaticFieldLittleEndianStringPerfTest.java index 90d2a70691adce0705150bba67760ca633a2b412..728b1995ff52259458aa747b3121e105c135256c 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetVolatileStaticFieldLittleEndianStringPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetVolatileStaticFieldLittleEndianStringPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Before; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandaddAcquireFieldLittleEndianFloatPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandaddAcquireFieldLittleEndianFloatPerfTest.java index 4e5fcf32edd26cc6313fa03f53ee9312fc466bb9..bf5ef99ff4569835c6082af896e13c39dfa9aea9 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandaddAcquireFieldLittleEndianFloatPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandaddAcquireFieldLittleEndianFloatPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandaddAcquireFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandaddAcquireFieldLittleEndianIntPerfTest.java index fd0abf85abfc9ae852ae6827f9fbcc7caa12e3ab..d15705e9106dde83d77788a413d62557f0f03d9d 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandaddAcquireFieldLittleEndianIntPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandaddAcquireFieldLittleEndianIntPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandaddAcquireStaticFieldLittleEndianFloatPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandaddAcquireStaticFieldLittleEndianFloatPerfTest.java index 9272b1164d072d039ec98dab5795f8f700b0cd2c..222a60da35502ad8eb1a2e333d221a69b0058796 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandaddAcquireStaticFieldLittleEndianFloatPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandaddAcquireStaticFieldLittleEndianFloatPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandaddAcquireStaticFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandaddAcquireStaticFieldLittleEndianIntPerfTest.java index a896d0a8e3e7975e8a2a4c8408f378cc7592d383..7436476b5329b2312fc5e9dc2c62d9fcd809d3cb 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandaddAcquireStaticFieldLittleEndianIntPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandaddAcquireStaticFieldLittleEndianIntPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandaddFieldLittleEndianFloatPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandaddFieldLittleEndianFloatPerfTest.java index 671b0a3c7c83888fb185c0a716b78d9d62c440d4..cca97f42e4b7d5d6f3336bc85314801d99003b74 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandaddFieldLittleEndianFloatPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandaddFieldLittleEndianFloatPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandaddFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandaddFieldLittleEndianIntPerfTest.java index 1eb3f9277d5662a92844f81d4d88bf37293c2115..170ee7313891eb29924c63c79a21ecccce122529 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandaddFieldLittleEndianIntPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandaddFieldLittleEndianIntPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandaddReleaseFieldLittleEndianFloatPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandaddReleaseFieldLittleEndianFloatPerfTest.java index f23d5e269154e04a25b623565bd8371402694eb9..184f796ad61cd26e1d7be0295477cdcf544edcb4 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandaddReleaseFieldLittleEndianFloatPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandaddReleaseFieldLittleEndianFloatPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandaddReleaseFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandaddReleaseFieldLittleEndianIntPerfTest.java index 161379851ce6fea83c85f6b4f45fa706e14d2c0b..7e75c44089ff8aa1ec164f2c8003744cc2db9cbe 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandaddReleaseFieldLittleEndianIntPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandaddReleaseFieldLittleEndianIntPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandaddReleaseStaticFieldLittleEndianFloatPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandaddReleaseStaticFieldLittleEndianFloatPerfTest.java index 14f1c002812ff6f13dffb66e5cac6773c401070b..39c386b645d8db8fe1fb5e8bb46d27f6dba1f38c 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandaddReleaseStaticFieldLittleEndianFloatPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandaddReleaseStaticFieldLittleEndianFloatPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandaddReleaseStaticFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandaddReleaseStaticFieldLittleEndianIntPerfTest.java index 8327caf0a124d8f801237dd6320ca943cebc4f58..04ab5310655c38149fb27a3b5f97cd6d9f346213 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandaddReleaseStaticFieldLittleEndianIntPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandaddReleaseStaticFieldLittleEndianIntPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandaddStaticFieldLittleEndianFloatPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandaddStaticFieldLittleEndianFloatPerfTest.java index 6c211fb5371be001aed0938c5f0c7d02ed704f9c..b71351fca81cb476a762f00202f109e6d9123b9a 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandaddStaticFieldLittleEndianFloatPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandaddStaticFieldLittleEndianFloatPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandaddStaticFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandaddStaticFieldLittleEndianIntPerfTest.java index d02cd735e753754a3ab436107d448aa1d8466fe8..e3955c0518900383d8445419958670cec8b6c3bd 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandaddStaticFieldLittleEndianIntPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandaddStaticFieldLittleEndianIntPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseAndAcquireFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseAndAcquireFieldLittleEndianIntPerfTest.java index 0777586dadd903b587eba94feafb969132252d0f..adf05a6befb1beb4eb83f14ab6ce031ba04562e4 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseAndAcquireFieldLittleEndianIntPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseAndAcquireFieldLittleEndianIntPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseAndAcquireStaticFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseAndAcquireStaticFieldLittleEndianIntPerfTest.java index 24a949f7b73c619a99005ba3619d337fb38bc78e..4d657d9a351175041664d4aafd4538f6ac1647f0 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseAndAcquireStaticFieldLittleEndianIntPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseAndAcquireStaticFieldLittleEndianIntPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseAndFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseAndFieldLittleEndianIntPerfTest.java index 4b94bbe5d86deab7da7ea92714a957a4b6668c88..dc641741691751e5932fe116363e07b3d2a1c730 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseAndFieldLittleEndianIntPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseAndFieldLittleEndianIntPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseAndReleaseFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseAndReleaseFieldLittleEndianIntPerfTest.java index 1784c055744291ce021d214fbbcc7558c860e167..25d5631308ef74d5f69247998407b3e163b5eac8 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseAndReleaseFieldLittleEndianIntPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseAndReleaseFieldLittleEndianIntPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseAndReleaseStaticFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseAndReleaseStaticFieldLittleEndianIntPerfTest.java index f85d3eeae9aa55fe9860358c4e37a40852c86d7e..de2d5489dbcc5d9b5b0ebc394306bf344ece4ffe 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseAndReleaseStaticFieldLittleEndianIntPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseAndReleaseStaticFieldLittleEndianIntPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseAndStaticFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseAndStaticFieldLittleEndianIntPerfTest.java index 81f6779e98208960e9f965a41418ef10c05e4012..36544c6f8f50fe654f255cd08ff948535ab3805f 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseAndStaticFieldLittleEndianIntPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseAndStaticFieldLittleEndianIntPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseOrAcquireFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseOrAcquireFieldLittleEndianIntPerfTest.java index 9436fadfde72666936052088ab563365e2730016..fb36d0cb495f9871634f29ed218f9e161a640ef1 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseOrAcquireFieldLittleEndianIntPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseOrAcquireFieldLittleEndianIntPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseOrAcquireStaticFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseOrAcquireStaticFieldLittleEndianIntPerfTest.java index 9ebc45848003e4f0adb5d2c0484a2fffd2441b2c..4194b12a4a6e6fc3a0390e5950920d8d7b224437 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseOrAcquireStaticFieldLittleEndianIntPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseOrAcquireStaticFieldLittleEndianIntPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseOrFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseOrFieldLittleEndianIntPerfTest.java index ea159a123d21d7473965835ea3d9a3c8ec037ba5..355c6e823803eba792454f3d1276be2456a99941 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseOrFieldLittleEndianIntPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseOrFieldLittleEndianIntPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseOrReleaseFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseOrReleaseFieldLittleEndianIntPerfTest.java index a42ec7e93c05284b7b4e020a148131d1d9e6f7ae..401079d0bece3b30a3852eb57e63e5443380292d 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseOrReleaseFieldLittleEndianIntPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseOrReleaseFieldLittleEndianIntPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseOrReleaseStaticFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseOrReleaseStaticFieldLittleEndianIntPerfTest.java index 6f1007e553cfece6efa32aef764e2d851cbea17c..322dcbf7453e4c78caaf18cfba0b58ac06930b78 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseOrReleaseStaticFieldLittleEndianIntPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseOrReleaseStaticFieldLittleEndianIntPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseOrStaticFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseOrStaticFieldLittleEndianIntPerfTest.java index 6a738181104b9ffa21f989cde2cd6b3e5211fd14..c98281416012b3f05556a5f712f823cd00e11e24 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseOrStaticFieldLittleEndianIntPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseOrStaticFieldLittleEndianIntPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseXorAcquireFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseXorAcquireFieldLittleEndianIntPerfTest.java index e9a365bd72a419434536734c2d10b59cf0bb598b..0b1cb32528ffea89b05d3b6172424336ffff52bc 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseXorAcquireFieldLittleEndianIntPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseXorAcquireFieldLittleEndianIntPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseXorAcquireStaticFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseXorAcquireStaticFieldLittleEndianIntPerfTest.java index fc9191cc2b77113baad92eb4579f0ef3a4dcfed2..47370720178247774bd16d7bb12345d9ed2c6662 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseXorAcquireStaticFieldLittleEndianIntPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseXorAcquireStaticFieldLittleEndianIntPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseXorFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseXorFieldLittleEndianIntPerfTest.java index 5919a1dc32c9628e2deded41e85761e6cfdb9989..204cd70b2f9e1eb5995272dac8ca34e7ed865877 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseXorFieldLittleEndianIntPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseXorFieldLittleEndianIntPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseXorReleaseFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseXorReleaseFieldLittleEndianIntPerfTest.java index 313e5806cbf7d56d725ba280cf736c4e99ff6e5b..b3ffed7de91a6c5da42e14d6b94f1ea9fe8bc7d2 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseXorReleaseFieldLittleEndianIntPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseXorReleaseFieldLittleEndianIntPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseXorReleaseStaticFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseXorReleaseStaticFieldLittleEndianIntPerfTest.java index 9c8b3ae1b939840a4d46eac9b3528d56f406f04c..d0ab8de4502d8858ff6d560cc5fe7ff49b6d70f7 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseXorReleaseStaticFieldLittleEndianIntPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseXorReleaseStaticFieldLittleEndianIntPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseXorStaticFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseXorStaticFieldLittleEndianIntPerfTest.java index ea618cc405bef40a202a9963dbe2ade8627bbd48..b378b684114eab352ff27b4f16218f1df9b3a14b 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseXorStaticFieldLittleEndianIntPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandbitwiseXorStaticFieldLittleEndianIntPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandsetAcquireFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandsetAcquireFieldLittleEndianIntPerfTest.java index df6f470450ea6869d05b4d352c7d1477df53b230..c7c66fe20513123b1eceb7b6f8224eb124522d6d 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandsetAcquireFieldLittleEndianIntPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandsetAcquireFieldLittleEndianIntPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandsetAcquireFieldLittleEndianStringPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandsetAcquireFieldLittleEndianStringPerfTest.java index 63fd7406cee4e88c856bcc00b749c0819659f759..98d6bd71c610896c2d22579f27a14284541aad66 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandsetAcquireFieldLittleEndianStringPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandsetAcquireFieldLittleEndianStringPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandsetAcquireStaticFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandsetAcquireStaticFieldLittleEndianIntPerfTest.java index a96031e673cf6fa233ead96d0bba8e3cf577c1d5..206358f21c1d5dfe16e817d5ec68c29eea6631a6 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandsetAcquireStaticFieldLittleEndianIntPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandsetAcquireStaticFieldLittleEndianIntPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandsetAcquireStaticFieldLittleEndianStringPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandsetAcquireStaticFieldLittleEndianStringPerfTest.java index 3bc25fbbf524571e39b5764961797ce76feab442..0532e73c9d66215ef6e00fef6f36b16909267069 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandsetAcquireStaticFieldLittleEndianStringPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandsetAcquireStaticFieldLittleEndianStringPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandsetFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandsetFieldLittleEndianIntPerfTest.java index 7ffdf11d0fa630c45ef53d6b36f3837c4963ba90..f192d7153fce438415b52c003e6f814d719d88f9 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandsetFieldLittleEndianIntPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandsetFieldLittleEndianIntPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandsetFieldLittleEndianStringPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandsetFieldLittleEndianStringPerfTest.java index cc7f3be26319219729f7a199d013248f2de4ee9a..0a8909c6c7b5d79567d7fd8d726ffc48994d95bb 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandsetFieldLittleEndianStringPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandsetFieldLittleEndianStringPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandsetReleaseFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandsetReleaseFieldLittleEndianIntPerfTest.java index 8d54c00f0fe1a86ca6577f85018e458df289979d..bfcb0f410256610c8edd73abea925d54dc4a6cc8 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandsetReleaseFieldLittleEndianIntPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandsetReleaseFieldLittleEndianIntPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandsetReleaseFieldLittleEndianStringPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandsetReleaseFieldLittleEndianStringPerfTest.java index 22e92dd06330ba802e1e062c6979d66c5b61b8b9..c6b0509d619bd917f9378ce75a206c5391fd519f 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandsetReleaseFieldLittleEndianStringPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandsetReleaseFieldLittleEndianStringPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandsetReleaseStaticFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandsetReleaseStaticFieldLittleEndianIntPerfTest.java index 08ddc8b0227c9f9d1e1743590770daac331beaf7..45a01eda2fd54e78f2a5ffe311b8d53c69d618da 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandsetReleaseStaticFieldLittleEndianIntPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandsetReleaseStaticFieldLittleEndianIntPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandsetReleaseStaticFieldLittleEndianStringPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandsetReleaseStaticFieldLittleEndianStringPerfTest.java index 429e090642e98dc3d77d21be83ce2f97d82496bc..30472811d5d657751bf0595115d6b8c4b9f59fad 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandsetReleaseStaticFieldLittleEndianStringPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandsetReleaseStaticFieldLittleEndianStringPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandsetStaticFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandsetStaticFieldLittleEndianIntPerfTest.java index d5b31f66cab5ba243b42c081f6e069be996bf5b6..6f1f1a01603986b2043c5d3a749639154b099af8 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandsetStaticFieldLittleEndianIntPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandsetStaticFieldLittleEndianIntPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandsetStaticFieldLittleEndianStringPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandsetStaticFieldLittleEndianStringPerfTest.java index 8667aaa961a4e8da7f7bca2935bce88d489684f7..c4d279f37a4cf56595d8c65d8ef9fdda27b33767 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandsetStaticFieldLittleEndianStringPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleGetandsetStaticFieldLittleEndianStringPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetArrayLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetArrayLittleEndianIntPerfTest.java index aa202469eb930f875335946dd164541c8389a027..c4f600593067982b7fc1507221827d65be380cab 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetArrayLittleEndianIntPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetArrayLittleEndianIntPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.After; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetArrayLittleEndianStringPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetArrayLittleEndianStringPerfTest.java index 9e0210fbd72c4aeeb55383c08772af36a010007e..a6858c261eb0d6c31751df4022ecfe8401f7f19f 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetArrayLittleEndianStringPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetArrayLittleEndianStringPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.After; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetByteArrayViewBigEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetByteArrayViewBigEndianIntPerfTest.java index d489168863418c2e87ad54309c155a8d52952494..a994cbeaf02c0f38d718ee102156c02e59d20046 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetByteArrayViewBigEndianIntPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetByteArrayViewBigEndianIntPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.After; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetByteArrayViewLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetByteArrayViewLittleEndianIntPerfTest.java index b06d7eff199d1f1599e7a24f0a797c14a734d9d9..65412ec84aa46e8af1238fc512e3bdd36fd9e03b 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetByteArrayViewLittleEndianIntPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetByteArrayViewLittleEndianIntPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.After; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetFieldLittleEndianIntPerfTest.java index 84469375c7e20d6545f3e53fb4daeed16d1acd3d..573b0ff277cc3d02499530875f1b6ec1a3fb7fcc 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetFieldLittleEndianIntPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetFieldLittleEndianIntPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.After; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetFieldLittleEndianStringPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetFieldLittleEndianStringPerfTest.java index 34540a31ad7813eeb69fc194fd71bbb48236dcdd..fe3c0fc04a84547cb1971fc6942006c90e39bd0e 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetFieldLittleEndianStringPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetFieldLittleEndianStringPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.After; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetOpaqueFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetOpaqueFieldLittleEndianIntPerfTest.java index c79b5133afd51c21197cb52b63b8199fc9c66842..f398899880ce4318b4db0d99b0dbd365e60c8206 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetOpaqueFieldLittleEndianIntPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetOpaqueFieldLittleEndianIntPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.After; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetOpaqueFieldLittleEndianStringPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetOpaqueFieldLittleEndianStringPerfTest.java index 028130ddef96069da73f9d31ea3f5a1772935963..74931205fd3e1a426a47e79e93722c5e792a15db 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetOpaqueFieldLittleEndianStringPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetOpaqueFieldLittleEndianStringPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.After; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetOpaqueStaticFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetOpaqueStaticFieldLittleEndianIntPerfTest.java index 06a5a8ce8ceb6c7db0915512c6641e4f2341dcf4..5e7326985c9d0de70d041af2b32292ee37e95da2 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetOpaqueStaticFieldLittleEndianIntPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetOpaqueStaticFieldLittleEndianIntPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.After; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetOpaqueStaticFieldLittleEndianStringPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetOpaqueStaticFieldLittleEndianStringPerfTest.java index 78eefc89c8fd537e2ff07a4a6ad81acf29dfd0d5..9a217d1fd142591566ea57272b5fd08a52990e57 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetOpaqueStaticFieldLittleEndianStringPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetOpaqueStaticFieldLittleEndianStringPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.After; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetReleaseFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetReleaseFieldLittleEndianIntPerfTest.java index cd1bd4824175cf42cb0f081728362bb8a4cefabf..1ce2270ecc58fd6577dd84504bce699d7f22d35c 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetReleaseFieldLittleEndianIntPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetReleaseFieldLittleEndianIntPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.After; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetReleaseFieldLittleEndianStringPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetReleaseFieldLittleEndianStringPerfTest.java index 6c0740c7169ef7e5dc13a53e5ebadbf99f5c9281..ed84528fe8690699013c2a17811fc036a0aaf752 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetReleaseFieldLittleEndianStringPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetReleaseFieldLittleEndianStringPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.After; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetReleaseStaticFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetReleaseStaticFieldLittleEndianIntPerfTest.java index b95f24b0a1e80429b8f94670d54b1182c382d76d..aeb96404a223eeb21196a2073e4102a132d326cf 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetReleaseStaticFieldLittleEndianIntPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetReleaseStaticFieldLittleEndianIntPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.After; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetReleaseStaticFieldLittleEndianStringPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetReleaseStaticFieldLittleEndianStringPerfTest.java index b03cf826c7f499633d7480feb6c54ff3cb945a1a..8959a0c3d50ca01b350224b9d67b91ef8f8afb3e 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetReleaseStaticFieldLittleEndianStringPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetReleaseStaticFieldLittleEndianStringPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.After; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetStaticFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetStaticFieldLittleEndianIntPerfTest.java index c98c0927410258bb28e997619a837cc5d8e0095e..400772231d48ed079a0fdb9ab2eb9c7b0aacb75a 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetStaticFieldLittleEndianIntPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetStaticFieldLittleEndianIntPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.After; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetStaticFieldLittleEndianStringPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetStaticFieldLittleEndianStringPerfTest.java index 625cfc77e15b51f8788ff7daac9afb8e04390a1d..732315862eb2bf1775969852d022694f61d440a6 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetStaticFieldLittleEndianStringPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetStaticFieldLittleEndianStringPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.After; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetVolatileFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetVolatileFieldLittleEndianIntPerfTest.java index 58319b3f632614c5bb2a0e47aa9f19a98b3d2fac..f4119c28b826780c20fde79e83970b07e64f8b4d 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetVolatileFieldLittleEndianIntPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetVolatileFieldLittleEndianIntPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.After; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetVolatileFieldLittleEndianStringPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetVolatileFieldLittleEndianStringPerfTest.java index f741542411f510a88076c147bb76352c86629f69..9b9c2612fe2574c9982886aeba5fc2b4c7bbcc11 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetVolatileFieldLittleEndianStringPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetVolatileFieldLittleEndianStringPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.After; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetVolatileStaticFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetVolatileStaticFieldLittleEndianIntPerfTest.java index 87f6a78325263e8e8bf2a90e7d2adcc6a91902df..f125384706ca88b101001aa72cba4580bfaaa69f 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetVolatileStaticFieldLittleEndianIntPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetVolatileStaticFieldLittleEndianIntPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.After; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetVolatileStaticFieldLittleEndianStringPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetVolatileStaticFieldLittleEndianStringPerfTest.java index 610345f690514ab3b1a975f8828c9a3f30295626..2ad605d83d0416bba8ec0b624962b6a271256224 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetVolatileStaticFieldLittleEndianStringPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleSetVolatileStaticFieldLittleEndianStringPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.After; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetAcquireFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetAcquireFieldLittleEndianIntPerfTest.java index 519d4fd6179b5c4ce9f9437c9b0a0bc8d2aa163d..5ef3bf00204b49d46d0a24a41f3c143f3312591c 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetAcquireFieldLittleEndianIntPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetAcquireFieldLittleEndianIntPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetAcquireFieldLittleEndianStringPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetAcquireFieldLittleEndianStringPerfTest.java index 322cf639e81dafbc6eb782e58b27459b77bd5eee..0c4ed66fc6b7f128ecb8a70192b6d1938c6b2e10 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetAcquireFieldLittleEndianStringPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetAcquireFieldLittleEndianStringPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetAcquireStaticFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetAcquireStaticFieldLittleEndianIntPerfTest.java index f8ccbadf682f5a39dcd8ba72131d9e64e43068d6..db6bd2429e26da99abfe1cdc5b1e1a460ecbed51 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetAcquireStaticFieldLittleEndianIntPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetAcquireStaticFieldLittleEndianIntPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetAcquireStaticFieldLittleEndianStringPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetAcquireStaticFieldLittleEndianStringPerfTest.java index 16f1059d150f437f00e4897f7db5db7e24e41450..d2b0bf76158f9acae37a5d0579dabab0492df244 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetAcquireStaticFieldLittleEndianStringPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetAcquireStaticFieldLittleEndianStringPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetFieldLittleEndianIntPerfTest.java index c7084fe63b0608d9ffd59bbac54ba1d24c81db71..3cd5ae6533b634c7f16bf2d544e17ae057ab6e79 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetFieldLittleEndianIntPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetFieldLittleEndianIntPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetFieldLittleEndianStringPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetFieldLittleEndianStringPerfTest.java index 9d526b8687ca862baeea4c69969ffbf25e0fddca..6ddfc25deca950be140b1dfd86fb8b089d82f099 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetFieldLittleEndianStringPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetFieldLittleEndianStringPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetPlainFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetPlainFieldLittleEndianIntPerfTest.java index 8372f6ccffbbd104bc99679f56065d14b2d34bda..375f0bc08027da35ab8df5020ce2fa0a16c974ce 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetPlainFieldLittleEndianIntPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetPlainFieldLittleEndianIntPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetPlainFieldLittleEndianStringPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetPlainFieldLittleEndianStringPerfTest.java index 87e47e76984f2355dbfe17ea13da312dafc0faa2..7e2492ace1dd48bc16f3acc02cebff219d73f7aa 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetPlainFieldLittleEndianStringPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetPlainFieldLittleEndianStringPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetPlainStaticFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetPlainStaticFieldLittleEndianIntPerfTest.java index aa2e1049e30250d63bcdad7c27f03469bc5bf1fe..190118c551e656dad68a34dda357856702c9da04 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetPlainStaticFieldLittleEndianIntPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetPlainStaticFieldLittleEndianIntPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetPlainStaticFieldLittleEndianStringPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetPlainStaticFieldLittleEndianStringPerfTest.java index ebaa0801e894ace62e97909d51d8924c391f337c..484ba1b88183e66f71eecb0da4b9570cccc9e7ca 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetPlainStaticFieldLittleEndianStringPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetPlainStaticFieldLittleEndianStringPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetReleaseFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetReleaseFieldLittleEndianIntPerfTest.java index d90356a02fa654223f55dd3246f4d23092d98c78..80e4e153a41fd42d5d28edc5d9a3f6cb448089bc 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetReleaseFieldLittleEndianIntPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetReleaseFieldLittleEndianIntPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetReleaseFieldLittleEndianStringPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetReleaseFieldLittleEndianStringPerfTest.java index 6db995a7fd0b4ff57bc234342d18313ab2107d3e..fa26c59304f9e128c46c9119757d04ab2b0c7aa1 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetReleaseFieldLittleEndianStringPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetReleaseFieldLittleEndianStringPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetReleaseStaticFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetReleaseStaticFieldLittleEndianIntPerfTest.java index ecea19e2036a4f38d4ee2e1e1ad19e6338618f6b..16bf2a208870c325a4c35c53b1094bc935442931 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetReleaseStaticFieldLittleEndianIntPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetReleaseStaticFieldLittleEndianIntPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetReleaseStaticFieldLittleEndianStringPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetReleaseStaticFieldLittleEndianStringPerfTest.java index ab86284729c2bd7d4796869ad09fe78d9179dba4..e1716dede024d4197af95bc426b4528523cce50a 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetReleaseStaticFieldLittleEndianStringPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetReleaseStaticFieldLittleEndianStringPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetStaticFieldLittleEndianIntPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetStaticFieldLittleEndianIntPerfTest.java index 23a33f54fcb988c2209264f70e943680f52f26e8..dc6f2adfe951300fdeb96e9c9f934d1317164075 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetStaticFieldLittleEndianIntPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetStaticFieldLittleEndianIntPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetStaticFieldLittleEndianStringPerfTest.java b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetStaticFieldLittleEndianStringPerfTest.java index 270b5adccde139b3b448e2a47214803df2da21f1..d1096c629ed8ba7323994ba3a3c9a6f02e4ff3d9 100644 --- a/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetStaticFieldLittleEndianStringPerfTest.java +++ b/apct-tests/perftests/core/src/android/libcore/varhandles/VarHandleWeakcompareandsetStaticFieldLittleEndianStringPerfTest.java @@ -18,8 +18,8 @@ package android.libcore.varhandles; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; -import android.test.suitebuilder.annotation.LargeTest; +import androidx.test.filters.LargeTest; import androidx.test.runner.AndroidJUnit4; import org.junit.Rule; diff --git a/apct-tests/perftests/core/src/android/permission/AppOpsPerfTest.kt b/apct-tests/perftests/core/src/android/permission/AppOpsPerfTest.kt new file mode 100644 index 0000000000000000000000000000000000000000..2af878e60db714121c74961ed715a17b11eb7004 --- /dev/null +++ b/apct-tests/perftests/core/src/android/permission/AppOpsPerfTest.kt @@ -0,0 +1,75 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package android.permission + +import android.app.AppOpsManager +import android.content.Context +import androidx.benchmark.BenchmarkState +import androidx.benchmark.junit4.BenchmarkRule +import androidx.test.core.app.ApplicationProvider +import androidx.test.filters.LargeTest +import org.junit.Before +import org.junit.Rule +import org.junit.Test + +@LargeTest +/** + * Performance unit tests for app ops APIs. + * + * The APIs under test are used for checking permissions and tracking permission accesses and are + * therefore invoked frequently by the system for all permission-protected data accesses, hence + * these APIs should be monitored closely for performance. + */ +class AppOpsPerfTest { + @get:Rule val mBenchmarkRule: BenchmarkRule = BenchmarkRule() + private lateinit var appOpsManager: AppOpsManager + private lateinit var opPackageName: String + private var opPackageUid: Int = 0 + + @Before + fun setUp() { + val context: Context = ApplicationProvider.getApplicationContext() + appOpsManager = context.getSystemService(AppOpsManager::class.java)!! + opPackageName = context.getOpPackageName() + opPackageUid = context.getPackageManager().getPackageUid(opPackageName, 0) + } + + @Test + fun testNoteOp() { + val state: BenchmarkState = mBenchmarkRule.getState() + while (state.keepRunning()) { + appOpsManager.noteOp( + AppOpsManager.OPSTR_FINE_LOCATION, + opPackageUid, + opPackageName, + null, + null + ) + } + } + + @Test + fun testUnsafeCheckOp() { + val state: BenchmarkState = mBenchmarkRule.getState() + while (state.keepRunning()) { + appOpsManager.unsafeCheckOp( + AppOpsManager.OPSTR_FINE_LOCATION, + opPackageUid, + opPackageName + ) + } + } +} diff --git a/apct-tests/perftests/core/src/android/permission/OWNERS b/apct-tests/perftests/core/src/android/permission/OWNERS new file mode 100644 index 0000000000000000000000000000000000000000..b4b2b9e30e907d3b649d3a20ffd23e827498bfc2 --- /dev/null +++ b/apct-tests/perftests/core/src/android/permission/OWNERS @@ -0,0 +1,3 @@ +# Bug component: 137825 + +include platform/frameworks/base:/core/java/android/permission/OWNERS \ No newline at end of file diff --git a/apct-tests/perftests/core/src/android/text/TextViewSetTextMeasurePerfTest.java b/apct-tests/perftests/core/src/android/text/TextViewSetTextMeasurePerfTest.java index 10bfa424715909717a86ef0e5ece2e28fffd38f1..426fcab96281f667fb0a2971695c76f9f07aabcd 100644 --- a/apct-tests/perftests/core/src/android/text/TextViewSetTextMeasurePerfTest.java +++ b/apct-tests/perftests/core/src/android/text/TextViewSetTextMeasurePerfTest.java @@ -20,10 +20,12 @@ import static android.view.View.MeasureSpec.UNSPECIFIED; import android.graphics.Canvas; import android.graphics.RecordingCanvas; +import android.graphics.RectF; import android.graphics.RenderNode; import android.perftests.utils.BenchmarkState; import android.perftests.utils.PerfStatusReporter; import android.text.NonEditableTextGenerator.TextType; +import android.view.View; import android.widget.TextView; import androidx.test.InstrumentationRegistry; @@ -79,7 +81,7 @@ public class TextViewSetTextMeasurePerfTest { mCached = cached; mTextPaint = new TextPaint(); mTextPaint.setTextSize(10); - mLineWidth = Integer.MAX_VALUE; + mLineWidth = 2048; } /** @@ -106,7 +108,9 @@ public class TextViewSetTextMeasurePerfTest { state.resumeTiming(); textView.setText(text); - textView.measure(AT_MOST | mLineWidth, UNSPECIFIED); + textView.measure( + View.MeasureSpec.makeMeasureSpec(mLineWidth, AT_MOST), + UNSPECIFIED); } } @@ -129,10 +133,16 @@ public class TextViewSetTextMeasurePerfTest { while (state.keepRunning()) { state.pauseTiming(); - final RecordingCanvas canvas = node.start(1200, 200); - int save = canvas.save(); textView.setTextLocale(Locale.UK); textView.setTextLocale(Locale.US); + textView.measure( + View.MeasureSpec.makeMeasureSpec(mLineWidth, AT_MOST), + UNSPECIFIED); + RectF bounds = textView.getLayout().computeDrawingBoundingBox(); + final RecordingCanvas canvas = node.start( + (int) Math.ceil(bounds.width()), + (int) Math.ceil(bounds.height())); + int save = canvas.save(); if (!mCached) Canvas.freeTextLayoutCaches(); state.resumeTiming(); diff --git a/apct-tests/perftests/core/src/android/view/HandwritingInitiatorPerfTest.java b/apct-tests/perftests/core/src/android/view/HandwritingInitiatorPerfTest.java index 123b2eeba5dddfb60ca9a567081f58c828384eef..0fd24493f2d5a47f14e11079688431a1f5ba1051 100644 --- a/apct-tests/perftests/core/src/android/view/HandwritingInitiatorPerfTest.java +++ b/apct-tests/perftests/core/src/android/view/HandwritingInitiatorPerfTest.java @@ -21,8 +21,11 @@ import static android.view.MotionEvent.ACTION_MOVE; import static android.view.MotionEvent.ACTION_UP; import static android.view.MotionEvent.TOOL_TYPE_FINGER; import static android.view.MotionEvent.TOOL_TYPE_STYLUS; +import static android.view.inputmethod.Flags.initiationWithoutInputConnection; +import static org.junit.Assume.assumeFalse; + import android.app.Instrumentation; import android.content.Context; import android.perftests.utils.BenchmarkState; @@ -186,6 +189,7 @@ public class HandwritingInitiatorPerfTest { @Test public void onInputConnectionCreated() { + assumeFalse(initiationWithoutInputConnection()); final BenchmarkState state = mPerfStatusReporter.getBenchmarkState(); final View view = new View(mContext); final EditorInfo editorInfo = new EditorInfo(); @@ -199,6 +203,7 @@ public class HandwritingInitiatorPerfTest { @Test public void onInputConnectionClosed() { + assumeFalse(initiationWithoutInputConnection()); final BenchmarkState state = mPerfStatusReporter.getBenchmarkState(); final View view = new View(mContext); while (state.keepRunning()) { diff --git a/packages/SystemUI/compose/features/tests/Android.bp b/apct-tests/perftests/healthconnect/Android.bp similarity index 55% rename from packages/SystemUI/compose/features/tests/Android.bp rename to apct-tests/perftests/healthconnect/Android.bp index 69b18c45aed679cbd72bd536b19205cdbe38e868..c38a24ee05d226af47d5647c21e485b162062183 100644 --- a/packages/SystemUI/compose/features/tests/Android.bp +++ b/apct-tests/perftests/healthconnect/Android.bp @@ -1,4 +1,4 @@ -// Copyright (C) 2022 The Android Open Source Project +// Copyright (C) 2023 The Android Open Source Project // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -13,38 +13,33 @@ // limitations under the License. package { - default_team: "trendy_team_system_ui_please_use_a_more_specific_subteam_if_possible_", + default_team: "trendy_team_input_framework", // See: http://go/android-license-faq // A large-scale-change added 'default_applicable_licenses' to import - // all of the 'license_kinds' from "frameworks_base_packages_SystemUI_license" + // all of the 'license_kinds' from "frameworks_base_license" // to get the below license kinds: // SPDX-license-identifier-Apache-2.0 - default_applicable_licenses: ["frameworks_base_packages_SystemUI_license"], + default_applicable_licenses: ["frameworks_base_license"], } -// TODO(b/230606318): Make those host tests instead of device tests. android_test { - name: "SystemUIComposeFeaturesTests", - use_resource_processor: true, - manifest: "AndroidManifest.xml", - test_suites: ["device-tests"], - sdk_version: "current", - certificate: "platform", + name: "HealthConnectPerfTests", srcs: [ + "src/**/*.java", "src/**/*.kt", ], static_libs: [ - "SystemUIComposeFeatures", - - "androidx.test.runner", + "androidx.test.rules", "androidx.test.ext.junit", - - "androidx.compose.runtime_runtime", - "androidx.compose.ui_ui-test-junit4", - "androidx.compose.ui_ui-test-manifest", + "apct-perftests-utils", + "collector-device-lib-platform", ], - kotlincflags: ["-Xjvm-default=all"], + libs: ["android.test.base"], + platform_apis: true, + test_suites: ["device-tests"], + data: [":perfetto_artifacts"], + certificate: "platform", } diff --git a/services/tests/servicestests/test-apps/JobTestApp/AndroidManifest.xml b/apct-tests/perftests/healthconnect/AndroidManifest.xml similarity index 67% rename from services/tests/servicestests/test-apps/JobTestApp/AndroidManifest.xml rename to apct-tests/perftests/healthconnect/AndroidManifest.xml index ac35805e8af6d693d7ef3e155a39ebb4a1f2d55b..6a6370b6214ae4f42807092ebaf4fe83ef1d65ba 100644 --- a/services/tests/servicestests/test-apps/JobTestApp/AndroidManifest.xml +++ b/apct-tests/perftests/healthconnect/AndroidManifest.xml @@ -1,5 +1,5 @@ - + package="com.android.perftests.healthconnect"> - - + - \ No newline at end of file + + diff --git a/apct-tests/perftests/healthconnect/AndroidTest.xml b/apct-tests/perftests/healthconnect/AndroidTest.xml new file mode 100644 index 0000000000000000000000000000000000000000..5036202a9f4adaead430fb57339540ba2f74a78a --- /dev/null +++ b/apct-tests/perftests/healthconnect/AndroidTest.xml @@ -0,0 +1,61 @@ + + + + diff --git a/apct-tests/perftests/healthconnect/OWNERS b/apct-tests/perftests/healthconnect/OWNERS new file mode 100644 index 0000000000000000000000000000000000000000..da0b46adeaef2b29bf0b1fcd8404b3bd0b9b26e4 --- /dev/null +++ b/apct-tests/perftests/healthconnect/OWNERS @@ -0,0 +1,6 @@ +# Bug component: 1219472 + +arkivanov@google.com +jstembridge@google.com +pratyushmore@google.com +itsleo@google.com diff --git a/apct-tests/perftests/healthconnect/src/com/android/perftests/healthconnect/HealthConnectReadWritePerfTest.kt b/apct-tests/perftests/healthconnect/src/com/android/perftests/healthconnect/HealthConnectReadWritePerfTest.kt new file mode 100644 index 0000000000000000000000000000000000000000..21a4ca048f62cc28661e34864dc96f76e4da1db8 --- /dev/null +++ b/apct-tests/perftests/healthconnect/src/com/android/perftests/healthconnect/HealthConnectReadWritePerfTest.kt @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.android.perftests.healthconnect + +import android.health.connect.HealthConnectManager +import android.os.SystemClock +import android.perftests.utils.PerfStatusReporter +import androidx.test.ext.junit.runners.AndroidJUnit4 +import androidx.test.platform.app.InstrumentationRegistry +import org.junit.Rule +import org.junit.Test +import org.junit.runner.RunWith + +/** + * Read/write benchmark tests for [HealthConnectManager] + * + * Build/Install/Run: atest HealthConnectReadWritePerfTest + */ +@RunWith(AndroidJUnit4::class) +class HealthConnectReadWritePerfTest { + + @get:Rule + val perfStatusReporter = PerfStatusReporter() + + private val context by lazy { InstrumentationRegistry.getInstrumentation().context } + + private val manager by lazy { + requireNotNull(context.getSystemService(HealthConnectManager::class.java)) + } + + /** + * A first empty test just to setup the test package and make sure it runs properly. + */ + @Test + fun placeholder() { + val state = perfStatusReporter.benchmarkState + while (state.keepRunning()) { + SystemClock.sleep(100) + } + } +} \ No newline at end of file diff --git a/apct-tests/perftests/inputmethod/Android.bp b/apct-tests/perftests/inputmethod/Android.bp index f2f1f758112e1c5ac639b20ccaec852d9036d2ca..7fcfdea88d5d4adafb40e5139c85e1a0937ec287 100644 --- a/apct-tests/perftests/inputmethod/Android.bp +++ b/apct-tests/perftests/inputmethod/Android.bp @@ -13,6 +13,7 @@ // limitations under the License. package { + default_team: "trendy_team_input_method_framework", // See: http://go/android-license-faq // A large-scale-change added 'default_applicable_licenses' to import // all of the 'license_kinds' from "frameworks_base_license" diff --git a/apct-tests/perftests/multiuser/Android.bp b/apct-tests/perftests/multiuser/Android.bp index 45c6b8c5bf16a3332945ac1e37e57f95311be4f2..1653edc77de914a14fe2da25e196e7e8f2571279 100644 --- a/apct-tests/perftests/multiuser/Android.bp +++ b/apct-tests/perftests/multiuser/Android.bp @@ -13,6 +13,7 @@ // limitations under the License. package { + default_team: "trendy_team_input_framework", // See: http://go/android-license-faq // A large-scale-change added 'default_applicable_licenses' to import // all of the 'license_kinds' from "frameworks_base_license" diff --git a/apct-tests/perftests/multiuser/apps/dummyapp/Android.bp b/apct-tests/perftests/multiuser/apps/dummyapp/Android.bp index 892c14006f87843077bbce827aeff9d6aae1da14..022655d5440b1407972fa9be6b4544e6908bc19b 100644 --- a/apct-tests/perftests/multiuser/apps/dummyapp/Android.bp +++ b/apct-tests/perftests/multiuser/apps/dummyapp/Android.bp @@ -13,6 +13,7 @@ // limitations under the License. package { + default_team: "trendy_team_input_framework", // See: http://go/android-license-faq // A large-scale-change added 'default_applicable_licenses' to import // all of the 'license_kinds' from "frameworks_base_license" diff --git a/apct-tests/perftests/packagemanager/Android.bp b/apct-tests/perftests/packagemanager/Android.bp index b6ea54d3d53f595d04284aa5adf44c37eb372b76..02fc12cde04bf946046b731092c6099e1e6f4a69 100644 --- a/apct-tests/perftests/packagemanager/Android.bp +++ b/apct-tests/perftests/packagemanager/Android.bp @@ -1,4 +1,5 @@ package { + default_team: "trendy_team_input_framework", // See: http://go/android-license-faq // A large-scale-change added 'default_applicable_licenses' to import // all of the 'license_kinds' from "frameworks_base_license" diff --git a/apct-tests/perftests/packagemanager/apps/query-all/Android.bp b/apct-tests/perftests/packagemanager/apps/query-all/Android.bp index b2339d5965a06df0d186fca10cc8a35a12bbe025..6984936b7e564ac4d3945e2808cc7a0c5a6137d1 100644 --- a/apct-tests/perftests/packagemanager/apps/query-all/Android.bp +++ b/apct-tests/perftests/packagemanager/apps/query-all/Android.bp @@ -13,6 +13,7 @@ // limitations under the License. package { + default_team: "trendy_team_input_framework", // See: http://go/android-license-faq // A large-scale-change added 'default_applicable_licenses' to import // all of the 'license_kinds' from "frameworks_base_license" @@ -25,299 +26,348 @@ android_test_helper_app { name: "QueriesAll0", aaptflags: [ "--rename-manifest-package com.android.perftests.appenumeration0", - ] + ], } + android_test_helper_app { name: "QueriesAll1", aaptflags: [ "--rename-manifest-package com.android.perftests.appenumeration1", - ] + ], } + android_test_helper_app { name: "QueriesAll2", aaptflags: [ "--rename-manifest-package com.android.perftests.appenumeration2", - ] + ], } + android_test_helper_app { name: "QueriesAll3", aaptflags: [ "--rename-manifest-package com.android.perftests.appenumeration3", - ] + ], } + android_test_helper_app { name: "QueriesAll4", aaptflags: [ "--rename-manifest-package com.android.perftests.appenumeration4", - ] + ], } + android_test_helper_app { name: "QueriesAll5", aaptflags: [ "--rename-manifest-package com.android.perftests.appenumeration5", - ] + ], } + android_test_helper_app { name: "QueriesAll6", aaptflags: [ "--rename-manifest-package com.android.perftests.appenumeration6", - ] + ], } + android_test_helper_app { name: "QueriesAll7", aaptflags: [ "--rename-manifest-package com.android.perftests.appenumeration7", - ] + ], } + android_test_helper_app { name: "QueriesAll8", aaptflags: [ "--rename-manifest-package com.android.perftests.appenumeration8", - ] + ], } + android_test_helper_app { name: "QueriesAll9", aaptflags: [ "--rename-manifest-package com.android.perftests.appenumeration9", - ] + ], } + android_test_helper_app { name: "QueriesAll10", aaptflags: [ "--rename-manifest-package com.android.perftests.appenumeration10", - ] + ], } + android_test_helper_app { name: "QueriesAll11", aaptflags: [ "--rename-manifest-package com.android.perftests.appenumeration11", - ] + ], } + android_test_helper_app { name: "QueriesAll12", aaptflags: [ "--rename-manifest-package com.android.perftests.appenumeration12", - ] + ], } + android_test_helper_app { name: "QueriesAll13", aaptflags: [ "--rename-manifest-package com.android.perftests.appenumeration13", - ] + ], } + android_test_helper_app { name: "QueriesAll14", aaptflags: [ "--rename-manifest-package com.android.perftests.appenumeration14", - ] + ], } + android_test_helper_app { name: "QueriesAll15", aaptflags: [ "--rename-manifest-package com.android.perftests.appenumeration15", - ] + ], } + android_test_helper_app { name: "QueriesAll16", aaptflags: [ "--rename-manifest-package com.android.perftests.appenumeration16", - ] + ], } + android_test_helper_app { name: "QueriesAll17", aaptflags: [ "--rename-manifest-package com.android.perftests.appenumeration17", - ] + ], } + android_test_helper_app { name: "QueriesAll18", aaptflags: [ "--rename-manifest-package com.android.perftests.appenumeration18", - ] + ], } + android_test_helper_app { name: "QueriesAll19", aaptflags: [ "--rename-manifest-package com.android.perftests.appenumeration19", - ] + ], } + android_test_helper_app { name: "QueriesAll20", aaptflags: [ "--rename-manifest-package com.android.perftests.appenumeration20", - ] + ], } + android_test_helper_app { name: "QueriesAll21", aaptflags: [ "--rename-manifest-package com.android.perftests.appenumeration21", - ] + ], } + android_test_helper_app { name: "QueriesAll22", aaptflags: [ "--rename-manifest-package com.android.perftests.appenumeration22", - ] + ], } + android_test_helper_app { name: "QueriesAll23", aaptflags: [ "--rename-manifest-package com.android.perftests.appenumeration23", - ] + ], } + android_test_helper_app { name: "QueriesAll24", aaptflags: [ "--rename-manifest-package com.android.perftests.appenumeration24", - ] + ], } + android_test_helper_app { name: "QueriesAll25", aaptflags: [ "--rename-manifest-package com.android.perftests.appenumeration25", - ] + ], } + android_test_helper_app { name: "QueriesAll26", aaptflags: [ "--rename-manifest-package com.android.perftests.appenumeration26", - ] + ], } + android_test_helper_app { name: "QueriesAll27", aaptflags: [ "--rename-manifest-package com.android.perftests.appenumeration27", - ] + ], } + android_test_helper_app { name: "QueriesAll28", aaptflags: [ "--rename-manifest-package com.android.perftests.appenumeration28", - ] + ], } + android_test_helper_app { name: "QueriesAll29", aaptflags: [ "--rename-manifest-package com.android.perftests.appenumeration29", - ] + ], } + android_test_helper_app { name: "QueriesAll30", aaptflags: [ "--rename-manifest-package com.android.perftests.appenumeration30", - ] + ], } + android_test_helper_app { name: "QueriesAll31", aaptflags: [ "--rename-manifest-package com.android.perftests.appenumeration31", - ] + ], } + android_test_helper_app { name: "QueriesAll32", aaptflags: [ "--rename-manifest-package com.android.perftests.appenumeration32", - ] + ], } + android_test_helper_app { name: "QueriesAll33", aaptflags: [ "--rename-manifest-package com.android.perftests.appenumeration33", - ] + ], } + android_test_helper_app { name: "QueriesAll34", aaptflags: [ "--rename-manifest-package com.android.perftests.appenumeration34", - ] + ], } + android_test_helper_app { name: "QueriesAll35", aaptflags: [ "--rename-manifest-package com.android.perftests.appenumeration35", - ] + ], } + android_test_helper_app { name: "QueriesAll36", aaptflags: [ "--rename-manifest-package com.android.perftests.appenumeration36", - ] + ], } + android_test_helper_app { name: "QueriesAll37", aaptflags: [ "--rename-manifest-package com.android.perftests.appenumeration37", - ] + ], } + android_test_helper_app { name: "QueriesAll38", aaptflags: [ "--rename-manifest-package com.android.perftests.appenumeration38", - ] + ], } + android_test_helper_app { name: "QueriesAll39", aaptflags: [ "--rename-manifest-package com.android.perftests.appenumeration39", - ] + ], } + android_test_helper_app { name: "QueriesAll40", aaptflags: [ "--rename-manifest-package com.android.perftests.appenumeration40", - ] + ], } + android_test_helper_app { name: "QueriesAll41", aaptflags: [ "--rename-manifest-package com.android.perftests.appenumeration41", - ] + ], } + android_test_helper_app { name: "QueriesAll42", aaptflags: [ "--rename-manifest-package com.android.perftests.appenumeration42", - ] + ], } + android_test_helper_app { name: "QueriesAll43", aaptflags: [ "--rename-manifest-package com.android.perftests.appenumeration43", - ] + ], } + android_test_helper_app { name: "QueriesAll44", aaptflags: [ "--rename-manifest-package com.android.perftests.appenumeration44", - ] + ], } + android_test_helper_app { name: "QueriesAll45", aaptflags: [ "--rename-manifest-package com.android.perftests.appenumeration45", - ] + ], } + android_test_helper_app { name: "QueriesAll46", aaptflags: [ "--rename-manifest-package com.android.perftests.appenumeration46", - ] + ], } + android_test_helper_app { name: "QueriesAll47", aaptflags: [ "--rename-manifest-package com.android.perftests.appenumeration47", - ] + ], } + android_test_helper_app { name: "QueriesAll48", aaptflags: [ "--rename-manifest-package com.android.perftests.appenumeration48", - ] + ], } + android_test_helper_app { name: "QueriesAll49", aaptflags: [ "--rename-manifest-package com.android.perftests.appenumeration49", - ] + ], } diff --git a/apct-tests/perftests/packagemanager/src/android/os/PackageParsingPerfTest.kt b/apct-tests/perftests/packagemanager/src/android/os/PackageParsingPerfTest.kt index 4352c8ae982ebec0adb18f009f5ff52bbbd856a3..ea10690bd672b7eb6c9516598a3c2361db1d9348 100644 --- a/apct-tests/perftests/packagemanager/src/android/os/PackageParsingPerfTest.kt +++ b/apct-tests/perftests/packagemanager/src/android/os/PackageParsingPerfTest.kt @@ -24,11 +24,11 @@ import android.content.pm.parsing.result.ParseTypeImpl import android.content.res.TypedArray import android.perftests.utils.BenchmarkState import android.perftests.utils.PerfStatusReporter -import android.util.ArraySet import androidx.test.filters.LargeTest import com.android.internal.pm.parsing.pkg.PackageImpl import com.android.internal.pm.pkg.parsing.ParsingPackageUtils import com.android.internal.util.ConcurrentUtils +import com.android.server.SystemConfig import java.io.File import java.io.FileOutputStream import java.util.concurrent.ArrayBlockingQueue @@ -217,8 +217,10 @@ public class PackageParsingPerfTest { isCoreApp, this, ) - override fun getHiddenApiWhitelistedApps() = ArraySet() - override fun getInstallConstraintsAllowlist() = ArraySet() + override fun getHiddenApiWhitelistedApps() = + SystemConfig.getInstance().hiddenApiWhitelistedApps + override fun getInstallConstraintsAllowlist() = + SystemConfig.getInstance().installConstraintsAllowlist }) override fun parseImpl(file: File) = diff --git a/apct-tests/perftests/permission/Android.bp b/apct-tests/perftests/permission/Android.bp new file mode 100644 index 0000000000000000000000000000000000000000..bc8e7696440a49ba320c96be8fa4388d105b89d5 --- /dev/null +++ b/apct-tests/perftests/permission/Android.bp @@ -0,0 +1,88 @@ +// Copyright (C) 2024 The Android Open Source Project +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package { + default_team: "trendy_team_input_framework", + // See: http://go/android-license-faq + // A large-scale-change added 'default_applicable_licenses' to import + // all of the 'license_kinds' from "frameworks_base_license" + // to get the below license kinds: + // SPDX-license-identifier-Apache-2.0 + default_applicable_licenses: ["frameworks_base_license"], +} + +android_test { + name: "PermissionServicePerfTests", + + srcs: [ + "src/**/*.java", + "src/**/*.kt", + ], + + static_libs: [ + "platform-compat-test-rules", + "androidx.appcompat_appcompat", + "androidx.test.rules", + "androidx.test.ext.junit", + "androidx.annotation_annotation", + "apct-perftests-utils", + "androidx.benchmark_benchmark-common", + "androidx.benchmark_benchmark-junit4", + "collector-device-lib-platform", + "cts-install-lib-java", + ], + + libs: ["android.test.base"], + + platform_apis: true, + + test_suites: ["device-tests"], + + data: [ + ":UsePermissionApp0", + ":UsePermissionApp1", + ":UsePermissionApp2", + ":UsePermissionApp3", + ":UsePermissionApp4", + ":UsePermissionApp5", + ":UsePermissionApp6", + ":UsePermissionApp7", + ":UsePermissionApp8", + ":UsePermissionApp9", + ":UsePermissionApp10", + ":UsePermissionApp11", + ":UsePermissionApp12", + ":UsePermissionApp13", + ":UsePermissionApp14", + ":UsePermissionApp15", + ":UsePermissionApp16", + ":UsePermissionApp17", + ":UsePermissionApp18", + ":UsePermissionApp19", + ":UsePermissionApp20", + ":UsePermissionApp21", + ":UsePermissionApp22", + ":UsePermissionApp23", + ":UsePermissionApp24", + ":UsePermissionApp25", + ":UsePermissionApp26", + ":UsePermissionApp27", + ":UsePermissionApp28", + ":UsePermissionApp29", + ":perfetto_artifacts", + ], + + certificate: "platform", + +} diff --git a/apct-tests/perftests/permission/AndroidManifest.xml b/apct-tests/perftests/permission/AndroidManifest.xml new file mode 100644 index 0000000000000000000000000000000000000000..fa29ad0404da0adc032702abb1a3925fda9b9553 --- /dev/null +++ b/apct-tests/perftests/permission/AndroidManifest.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + diff --git a/apct-tests/perftests/permission/AndroidTest.xml b/apct-tests/perftests/permission/AndroidTest.xml new file mode 100644 index 0000000000000000000000000000000000000000..07558deafb6c770445f0e50e79ec3c121d4c50d1 --- /dev/null +++ b/apct-tests/perftests/permission/AndroidTest.xml @@ -0,0 +1,180 @@ + + + + diff --git a/apct-tests/perftests/permission/apps/usepermissionapp/Android.bp b/apct-tests/perftests/permission/apps/usepermissionapp/Android.bp new file mode 100644 index 0000000000000000000000000000000000000000..d5039726693d58b6233f4230c59fb1b463f42e2c --- /dev/null +++ b/apct-tests/perftests/permission/apps/usepermissionapp/Android.bp @@ -0,0 +1,233 @@ +// Copyright (C) 2024 The Android Open Source Project +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package { + default_team: "trendy_team_input_framework", + // See: http://go/android-license-faq + // A large-scale-change added 'default_applicable_licenses' to import + // all of the 'license_kinds' from "frameworks_base_license" + // to get the below license kinds: + // SPDX-license-identifier-Apache-2.0 + default_applicable_licenses: ["frameworks_base_license"], +} + +android_test_helper_app { + name: "UsePermissionApp0", + aaptflags: [ + "--rename-manifest-package android.perftests.appenumeration0", + ], +} + +android_test_helper_app { + name: "UsePermissionApp1", + aaptflags: [ + "--rename-manifest-package android.perftests.appenumeration1", + ], +} + +android_test_helper_app { + name: "UsePermissionApp2", + aaptflags: [ + "--rename-manifest-package android.perftests.appenumeration2", + ], +} + +android_test_helper_app { + name: "UsePermissionApp3", + aaptflags: [ + "--rename-manifest-package android.perftests.appenumeration3", + ], +} + +android_test_helper_app { + name: "UsePermissionApp4", + aaptflags: [ + "--rename-manifest-package android.perftests.appenumeration4", + ], +} + +android_test_helper_app { + name: "UsePermissionApp5", + aaptflags: [ + "--rename-manifest-package android.perftests.appenumeration5", + ], +} + +android_test_helper_app { + name: "UsePermissionApp6", + aaptflags: [ + "--rename-manifest-package android.perftests.appenumeration6", + ], +} + +android_test_helper_app { + name: "UsePermissionApp7", + aaptflags: [ + "--rename-manifest-package android.perftests.appenumeration7", + ], +} + +android_test_helper_app { + name: "UsePermissionApp8", + aaptflags: [ + "--rename-manifest-package android.perftests.appenumeration8", + ], +} + +android_test_helper_app { + name: "UsePermissionApp9", + aaptflags: [ + "--rename-manifest-package android.perftests.appenumeration9", + ], +} + +android_test_helper_app { + name: "UsePermissionApp10", + aaptflags: [ + "--rename-manifest-package android.perftests.appenumeration10", + ], +} + +android_test_helper_app { + name: "UsePermissionApp11", + aaptflags: [ + "--rename-manifest-package android.perftests.appenumeration11", + ], +} + +android_test_helper_app { + name: "UsePermissionApp12", + aaptflags: [ + "--rename-manifest-package android.perftests.appenumeration12", + ], +} + +android_test_helper_app { + name: "UsePermissionApp13", + aaptflags: [ + "--rename-manifest-package android.perftests.appenumeration13", + ], +} + +android_test_helper_app { + name: "UsePermissionApp14", + aaptflags: [ + "--rename-manifest-package android.perftests.appenumeration14", + ], +} + +android_test_helper_app { + name: "UsePermissionApp15", + aaptflags: [ + "--rename-manifest-package android.perftests.appenumeration15", + ], +} + +android_test_helper_app { + name: "UsePermissionApp16", + aaptflags: [ + "--rename-manifest-package android.perftests.appenumeration16", + ], +} + +android_test_helper_app { + name: "UsePermissionApp17", + aaptflags: [ + "--rename-manifest-package android.perftests.appenumeration17", + ], +} + +android_test_helper_app { + name: "UsePermissionApp18", + aaptflags: [ + "--rename-manifest-package android.perftests.appenumeration18", + ], +} + +android_test_helper_app { + name: "UsePermissionApp19", + aaptflags: [ + "--rename-manifest-package android.perftests.appenumeration19", + ], +} + +android_test_helper_app { + name: "UsePermissionApp20", + aaptflags: [ + "--rename-manifest-package android.perftests.appenumeration20", + ], +} + +android_test_helper_app { + name: "UsePermissionApp21", + aaptflags: [ + "--rename-manifest-package android.perftests.appenumeration21", + ], +} + +android_test_helper_app { + name: "UsePermissionApp22", + aaptflags: [ + "--rename-manifest-package android.perftests.appenumeration22", + ], +} + +android_test_helper_app { + name: "UsePermissionApp23", + aaptflags: [ + "--rename-manifest-package android.perftests.appenumeration23", + ], +} + +android_test_helper_app { + name: "UsePermissionApp24", + aaptflags: [ + "--rename-manifest-package android.perftests.appenumeration24", + ], +} + +android_test_helper_app { + name: "UsePermissionApp25", + aaptflags: [ + "--rename-manifest-package android.perftests.appenumeration25", + ], +} + +android_test_helper_app { + name: "UsePermissionApp26", + aaptflags: [ + "--rename-manifest-package android.perftests.appenumeration26", + ], +} + +android_test_helper_app { + name: "UsePermissionApp27", + aaptflags: [ + "--rename-manifest-package android.perftests.appenumeration27", + ], +} + +android_test_helper_app { + name: "UsePermissionApp28", + aaptflags: [ + "--rename-manifest-package android.perftests.appenumeration28", + ], +} + +android_test_helper_app { + name: "UsePermissionApp29", + aaptflags: [ + "--rename-manifest-package android.perftests.appenumeration29", + ], +} diff --git a/apct-tests/perftests/permission/apps/usepermissionapp/AndroidManifest.xml b/apct-tests/perftests/permission/apps/usepermissionapp/AndroidManifest.xml new file mode 100644 index 0000000000000000000000000000000000000000..3bccefd24b49e3b4190d3ffa670c63967a5e420f --- /dev/null +++ b/apct-tests/perftests/permission/apps/usepermissionapp/AndroidManifest.xml @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/apct-tests/perftests/permission/src/android/perftests/permission/PermissionServicePerfTest.kt b/apct-tests/perftests/permission/src/android/perftests/permission/PermissionServicePerfTest.kt new file mode 100644 index 0000000000000000000000000000000000000000..13e67e34a8d96f89310c0f15ab778329db40a3b9 --- /dev/null +++ b/apct-tests/perftests/permission/src/android/perftests/permission/PermissionServicePerfTest.kt @@ -0,0 +1,127 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.perftests.permission + +import android.Manifest +import android.os.ParcelFileDescriptor +import android.os.Trace +import android.perftests.utils.PerfManualStatusReporter +import android.perftests.utils.TraceMarkParser +import android.util.Log +import androidx.test.ext.junit.runners.AndroidJUnit4 +import androidx.test.platform.app.InstrumentationRegistry +import com.android.compatibility.common.util.AdoptShellPermissionsRule +import com.android.compatibility.common.util.SystemUtil.eventually +import com.android.compatibility.common.util.SystemUtil.runShellCommand +import com.google.common.truth.Truth.assertThat +import org.junit.Rule +import org.junit.Test +import org.junit.runner.RunWith +import java.io.BufferedReader +import java.io.IOException +import java.io.InputStreamReader +import java.util.concurrent.TimeUnit +import java.util.function.BiConsumer + +@RunWith(AndroidJUnit4::class) +class PermissionServicePerfTest { + @get:Rule val mPerfManualStatusReporter = PerfManualStatusReporter() + @get:Rule val mAdoptShellPermissionsRule = AdoptShellPermissionsRule( + InstrumentationRegistry.getInstrumentation().getUiAutomation(), + Manifest.permission.INSTALL_PACKAGES, + Manifest.permission.DELETE_PACKAGES + ) + val mUiAutomation = InstrumentationRegistry.getInstrumentation().getUiAutomation() + + @Test + fun testInstallPackages() { + mUiAutomation.executeShellCommand(COMMAND_TRACE_START) + eventually { assertThat(Trace.isTagEnabled(TRACE_TAG)).isTrue() } + val benchmarkState = mPerfManualStatusReporter.benchmarkState + val durations = ArrayList() + + while (benchmarkState.keepRunning(durations)) { + uninstallAllTestApps() + installAllTestApps() + + val parser = TraceMarkParser { line -> line.name.contains(PKG_INSTALL_TRACE_PREFIX) } + dumpResult(parser) { _, slices -> + slices.forEachIndexed { _, slice -> + durations.add(TimeUnit.MICROSECONDS.toNanos(slice.durationInMicroseconds)) + } + } + } + + mUiAutomation.executeShellCommand(COMMAND_TRACE_END) + } + + private fun installAllTestApps() { + for (i in 0..29) { + installTestApp(i) + } + } + + private fun installTestApp(appId: Int) { + val apkPath = "$APK_DIR$APK_NAME$appId.apk" + runShellCommand("pm install -t $apkPath") + } + + private fun uninstallAllTestApps() { + for (i in 0..29) { + uninstallTestApp(i) + } + } + + private fun uninstallTestApp(appId: Int) { + val packageName = "$PKG_NAME$appId" + runShellCommand("pm uninstall $packageName") + } + + private fun dumpResult( + parser: TraceMarkParser, + handler: BiConsumer> + ) { + parser.reset() + try { + val inputStream = ParcelFileDescriptor.AutoCloseInputStream( + mUiAutomation.executeShellCommand(COMMAND_TRACE_DUMP) + ) + val reader = BufferedReader(InputStreamReader(inputStream)) + var line = reader.readLine() + while (line != null) { + parser.visit(line) + line = reader.readLine() + } + } catch (e: IOException) { + Log.e(LOG_TAG, "IO error while reading trace dump file.") + } + parser.forAllSlices(handler) + } + + companion object { + private val LOG_TAG = PermissionServicePerfTest::class.java.simpleName + private const val TRACE_TAG = Trace.TRACE_TAG_PACKAGE_MANAGER + private const val PKG_INSTALL_TRACE_PREFIX = + "TaggedTracingPermissionManagerServiceImpl#onPackageInstalled" + private const val COMMAND_TRACE_START = "atrace --async_start -b 16000 pm" + private const val COMMAND_TRACE_END = "atrace --async_stop" + private const val COMMAND_TRACE_DUMP = "atrace --async_dump" + private const val APK_DIR = "/data/local/tmp/perftests/" + private const val APK_NAME = "UsePermissionApp" + private const val PKG_NAME = "android.perftests.appenumeration" + } +} diff --git a/apct-tests/perftests/rubidium/Android.bp b/apct-tests/perftests/rubidium/Android.bp index ebd228f76a1d2d988e2547691d15b20c39fb2d7d..4f4fb11fd8382eae533c05287bc1608be6a389e0 100644 --- a/apct-tests/perftests/rubidium/Android.bp +++ b/apct-tests/perftests/rubidium/Android.bp @@ -13,6 +13,7 @@ // limitations under the License. package { + default_team: "trendy_team_input_framework", // See: http://go/android-license-faq // A large-scale-change added 'default_applicable_licenses' to import // all of the 'license_kinds' from "frameworks_base_license" diff --git a/apct-tests/perftests/rubidium/src/android/rubidium/js/JSScriptEnginePerfTests.java b/apct-tests/perftests/rubidium/src/android/rubidium/js/JSScriptEnginePerfTests.java index ba15796f47fe547d4c1d55f2d09eebb8ca80a682..fc3738c7134a0606ff757d194131f5205549a0ae 100644 --- a/apct-tests/perftests/rubidium/src/android/rubidium/js/JSScriptEnginePerfTests.java +++ b/apct-tests/perftests/rubidium/src/android/rubidium/js/JSScriptEnginePerfTests.java @@ -53,6 +53,7 @@ import com.android.adservices.service.adselection.AdSelectionConfigArgumentUtil; import com.android.adservices.service.adselection.AdWithBidArgumentUtil; import com.android.adservices.service.adselection.CustomAudienceBiddingSignalsArgumentUtil; import com.android.adservices.service.adselection.CustomAudienceScoringSignalsArgumentUtil; +import com.android.adservices.service.common.NoOpRetryStrategyImpl; import com.android.adservices.service.js.IsolateSettings; import com.android.adservices.service.js.JSScriptArgument; import com.android.adservices.service.js.JSScriptArrayArgument; @@ -411,7 +412,8 @@ public class JSScriptEnginePerfTests { jsScript, args, functionName, - IsolateSettings.forMaxHeapSizeEnforcementDisabled()); + IsolateSettings.forMaxHeapSizeEnforcementDisabled(), + new NoOpRetryStrategyImpl()); result.addListener(resultLatch::countDown, sExecutorService); return result; } @@ -430,7 +432,8 @@ public class JSScriptEnginePerfTests { wasmScript, args, functionName, - IsolateSettings.forMaxHeapSizeEnforcementDisabled()); + IsolateSettings.forMaxHeapSizeEnforcementDisabled(), + new NoOpRetryStrategyImpl()); result.addListener(resultLatch::countDown, sExecutorService); return result; } diff --git a/apct-tests/perftests/settingsprovider/Android.bp b/apct-tests/perftests/settingsprovider/Android.bp index 43ec0e0b4620bcc075e8aef47065613024415b59..e4aa14cd8a77afcd532447c0096698bf1d0ac01a 100644 --- a/apct-tests/perftests/settingsprovider/Android.bp +++ b/apct-tests/perftests/settingsprovider/Android.bp @@ -1,4 +1,5 @@ package { + default_team: "trendy_team_input_framework", // See: http://go/android-license-faq // A large-scale-change added 'default_applicable_licenses' to import // all of the 'license_kinds' from "frameworks_base_license" diff --git a/apct-tests/perftests/surfaceflinger/Android.bp b/apct-tests/perftests/surfaceflinger/Android.bp index 21d0d44fdd2ffe6324202ff3578586431a70c847..735c725184b18103d4ccfc63e8d39c10c547969d 100644 --- a/apct-tests/perftests/surfaceflinger/Android.bp +++ b/apct-tests/perftests/surfaceflinger/Android.bp @@ -13,6 +13,7 @@ // limitations under the License. package { + default_team: "trendy_team_input_framework", // See: http://go/android-license-faq // A large-scale-change added 'default_applicable_licenses' to import // all of the 'license_kinds' from "frameworks_base_license" diff --git a/apct-tests/perftests/textclassifier/Android.bp b/apct-tests/perftests/textclassifier/Android.bp index 1011267bcdc386670af6d7cda07c72e3bd011482..cf99771e59062b583bab29518d851ca2ab012333 100644 --- a/apct-tests/perftests/textclassifier/Android.bp +++ b/apct-tests/perftests/textclassifier/Android.bp @@ -13,6 +13,7 @@ // limitations under the License. package { + default_team: "trendy_team_input_framework", // See: http://go/android-license-faq // A large-scale-change added 'default_applicable_licenses' to import // all of the 'license_kinds' from "frameworks_base_license" diff --git a/apct-tests/perftests/utils/Android.bp b/apct-tests/perftests/utils/Android.bp index 6c46a9b58f069cda0eccb45f63ba78e4b5487c46..d2653cd148db90a1c0373076085c828ebdd31514 100644 --- a/apct-tests/perftests/utils/Android.bp +++ b/apct-tests/perftests/utils/Android.bp @@ -1,4 +1,5 @@ package { + default_team: "trendy_team_input_framework", // See: http://go/android-license-faq // A large-scale-change added 'default_applicable_licenses' to import // all of the 'license_kinds' from "frameworks_base_license" diff --git a/apct-tests/perftests/windowmanager/Android.bp b/apct-tests/perftests/windowmanager/Android.bp index 903cf8ca955ac53bbd492edb21c1caab9106fb5d..e9357f4a9d3cdde2bf1b556bcff0859b160a236e 100644 --- a/apct-tests/perftests/windowmanager/Android.bp +++ b/apct-tests/perftests/windowmanager/Android.bp @@ -13,6 +13,7 @@ // limitations under the License. package { + default_team: "trendy_team_input_framework", // See: http://go/android-license-faq // A large-scale-change added 'default_applicable_licenses' to import // all of the 'license_kinds' from "frameworks_base_license" diff --git a/apex/jobscheduler/framework/aconfig/job.aconfig b/apex/jobscheduler/framework/aconfig/job.aconfig index 6dbb96974bd33c2a70572cbfc2d1ced63d471f09..e4799657616d818f72aced2d11a0f8a02f28e552 100644 --- a/apex/jobscheduler/framework/aconfig/job.aconfig +++ b/apex/jobscheduler/framework/aconfig/job.aconfig @@ -14,3 +14,10 @@ flag { description: "Add APIs to let apps attach debug information to jobs" bug: "293491637" } + +flag { + name: "backup_jobs_exemption" + namespace: "backstage_power" + description: "Introduce a new RUN_BACKUP_JOBS permission and exemption logic allowing for longer running jobs for apps whose primary purpose is to backup or sync content." + bug: "318731461" +} diff --git a/apex/jobscheduler/framework/java/android/app/job/JobInfo.java b/apex/jobscheduler/framework/java/android/app/job/JobInfo.java index 4bc73130db291c4aa8a4fcaa6451f3d16abe2fb9..60eb4ac61076987230f43af8fd62465187a960e1 100644 --- a/apex/jobscheduler/framework/java/android/app/job/JobInfo.java +++ b/apex/jobscheduler/framework/java/android/app/job/JobInfo.java @@ -23,7 +23,6 @@ import static android.net.NetworkCapabilities.NET_CAPABILITY_NOT_ROAMING; import static android.net.NetworkCapabilities.NET_CAPABILITY_NOT_VPN; import static android.net.NetworkCapabilities.NET_CAPABILITY_VALIDATED; import static android.net.NetworkCapabilities.TRANSPORT_CELLULAR; -import static android.text.format.DateUtils.HOUR_IN_MILLIS; import static android.util.TimeUtils.formatDuration; import android.annotation.BytesLong; @@ -50,9 +49,7 @@ import android.os.Bundle; import android.os.Parcel; import android.os.Parcelable; import android.os.PersistableBundle; -import android.os.Process; import android.os.Trace; -import android.os.UserHandle; import android.util.ArraySet; import android.util.Log; @@ -127,6 +124,15 @@ public class JobInfo implements Parcelable { @Overridable // Aid in testing public static final long ENFORCE_MINIMUM_TIME_WINDOWS = 311402873L; + /** + * Require that minimum latencies and override deadlines are nonnegative. + * + * @hide + */ + @ChangeId + @EnabledAfter(targetSdkVersion = Build.VERSION_CODES.UPSIDE_DOWN_CAKE) + public static final long REJECT_NEGATIVE_DELAYS_AND_DEADLINES = 323349338L; + /** @hide */ @IntDef(prefix = { "NETWORK_TYPE_" }, value = { NETWORK_TYPE_NONE, @@ -206,6 +212,8 @@ public class JobInfo implements Parcelable { /* Minimum flex for a periodic job, in milliseconds. */ private static final long MIN_FLEX_MILLIS = 5 * 60 * 1000L; // 5 minutes + private static final long MIN_ALLOWED_TIME_WINDOW_MILLIS = MIN_PERIOD_MILLIS; + /** * Minimum backoff interval for a job, in milliseconds * @hide @@ -288,12 +296,16 @@ public class JobInfo implements Parcelable { public static final int PRIORITY_HIGH = 400; /** - * This task should be run ahead of all other tasks. Only Expedited Jobs - * {@link Builder#setExpedited(boolean)} can have this priority and as such, - * are subject to the same execution time details noted in - * {@link Builder#setExpedited(boolean)}. - * A sample task of max priority: receiving a text message and processing it to - * show a notification + * This task is critical to user experience or functionality + * and should be run ahead of all other tasks. Only + * {@link Builder#setExpedited(boolean) expedited jobs} and + * {@link Builder#setUserInitiated(boolean) user-initiated jobs} can have this priority. + *

+ * Example tasks of max priority: + *

    + *
  • Receiving a text message and processing it to show a notification
  • + *
  • Downloading or uploading some content the user requested to transfer immediately
  • + *
*/ public static final int PRIORITY_MAX = 500; @@ -689,14 +701,14 @@ public class JobInfo implements Parcelable { * @see JobInfo.Builder#setMinimumLatency(long) */ public long getMinLatencyMillis() { - return minLatencyMillis; + return Math.max(0, minLatencyMillis); } /** * @see JobInfo.Builder#setOverrideDeadline(long) */ public long getMaxExecutionDelayMillis() { - return maxExecutionDelayMillis; + return Math.max(0, maxExecutionDelayMillis); } /** @@ -1866,6 +1878,13 @@ public class JobInfo implements Parcelable { * Because it doesn't make sense setting this property on a periodic job, doing so will * throw an {@link java.lang.IllegalArgumentException} when * {@link android.app.job.JobInfo.Builder#build()} is called. + * + * Negative latencies also don't make sense for a job and are indicative of an error, + * so starting in Android version {@link android.os.Build.VERSION_CODES#VANILLA_ICE_CREAM}, + * setting a negative deadline will result in + * {@link android.app.job.JobInfo.Builder#build()} throwing an + * {@link java.lang.IllegalArgumentException}. + * * @param minLatencyMillis Milliseconds before which this job will not be considered for * execution. * @see JobInfo#getMinLatencyMillis() @@ -1877,43 +1896,44 @@ public class JobInfo implements Parcelable { } /** - * Set deadline which is the maximum scheduling latency. The job will be run by this - * deadline even if other requirements (including a delay set through - * {@link #setMinimumLatency(long)}) are not met. + * Set a deadline after which all other functional requested constraints will be ignored. + * After the deadline has passed, the job can run even if other requirements (including + * a delay set through {@link #setMinimumLatency(long)}) are not met. * {@link JobParameters#isOverrideDeadlineExpired()} will return {@code true} if the job's - * deadline has passed. + * deadline has passed. The job's execution may be delayed beyond the set deadline by + * other factors such as Doze mode and system health signals. * *

* Because it doesn't make sense setting this property on a periodic job, doing so will * throw an {@link java.lang.IllegalArgumentException} when * {@link android.app.job.JobInfo.Builder#build()} is called. * + *

+ * Negative deadlines also don't make sense for a job and are indicative of an error, + * so starting in Android version {@link android.os.Build.VERSION_CODES#VANILLA_ICE_CREAM}, + * setting a negative deadline will result in + * {@link android.app.job.JobInfo.Builder#build()} throwing an + * {@link java.lang.IllegalArgumentException}. + * *

* Since a job will run once the deadline has passed regardless of the status of other - * constraints, setting a deadline of 0 with other constraints makes those constraints - * meaningless when it comes to execution decisions. Avoid doing this. - *

- * - *

- * Short deadlines hinder the system's ability to optimize scheduling behavior and may - * result in running jobs at inopportune times. Therefore, starting in Android version - * {@link android.os.Build.VERSION_CODES#VANILLA_ICE_CREAM}, minimum time windows will be - * enforced to help make it easier to better optimize job execution. Time windows are + * constraints, setting a deadline of 0 (or a {@link #setMinimumLatency(long) delay} equal + * to the deadline) with other constraints makes those constraints + * meaningless when it comes to execution decisions. Since doing so is indicative of an + * error in the logic, starting in Android version + * {@link android.os.Build.VERSION_CODES#VANILLA_ICE_CREAM}, jobs with extremely short + * time windows will fail to build. Time windows are * defined as the time between a job's {@link #setMinimumLatency(long) minimum latency} * and its deadline. If the minimum latency is not set, it is assumed to be 0. - * The following minimums will be enforced: - *

    - *
  • - * Jobs with {@link #PRIORITY_DEFAULT} or higher priorities have a minimum time - * window of one hour. - *
  • - *
  • Jobs with {@link #PRIORITY_LOW} have a minimum time window of 6 hours.
  • - *
  • Jobs with {@link #PRIORITY_MIN} have a minimum time window of 12 hours.
  • - *
* * Work that must happen immediately should use {@link #setExpedited(boolean)} or * {@link #setUserInitiated(boolean)} in the appropriate manner. * + *

+ * This API aimed to guarantee execution of the job by the deadline only on Android version + * {@link android.os.Build.VERSION_CODES#LOLLIPOP}. That aim and guarantee has not existed + * since {@link android.os.Build.VERSION_CODES#M}. + * * @see JobInfo#getMaxExecutionDelayMillis() */ public Builder setOverrideDeadline(long maxExecutionDelayMillis) { @@ -1969,6 +1989,9 @@ public class JobInfo implements Parcelable { * * *

+ * Expedited jobs are given {@link #PRIORITY_MAX} by default. + * + *

* Since these jobs have stronger guarantees than regular jobs, they will be subject to * stricter quotas. As long as an app has available expedited quota, jobs scheduled with * this set to true will run with these guarantees. If an app has run out of available @@ -2059,6 +2082,7 @@ public class JobInfo implements Parcelable { *

* These jobs will not be subject to quotas and will be started immediately once scheduled * if all constraints are met and the device system health allows for additional tasks. + * They are also given {@link #PRIORITY_MAX} by default, and the priority cannot be changed. * * @see JobInfo#isUserInitiated() */ @@ -2188,13 +2212,15 @@ public class JobInfo implements Parcelable { public JobInfo build() { return build(Compatibility.isChangeEnabled(DISALLOW_DEADLINES_FOR_PREFETCH_JOBS), Compatibility.isChangeEnabled(REJECT_NEGATIVE_NETWORK_ESTIMATES), - Compatibility.isChangeEnabled(ENFORCE_MINIMUM_TIME_WINDOWS)); + Compatibility.isChangeEnabled(ENFORCE_MINIMUM_TIME_WINDOWS), + Compatibility.isChangeEnabled(REJECT_NEGATIVE_DELAYS_AND_DEADLINES)); } /** @hide */ public JobInfo build(boolean disallowPrefetchDeadlines, boolean rejectNegativeNetworkEstimates, - boolean enforceMinimumTimeWindows) { + boolean enforceMinimumTimeWindows, + boolean rejectNegativeDelaysAndDeadlines) { // This check doesn't need to be inside enforceValidity. It's an unnecessary legacy // check that would ideally be phased out instead. if (mBackoffPolicySet && (mConstraintFlags & CONSTRAINT_FLAG_DEVICE_IDLE) != 0) { @@ -2204,7 +2230,7 @@ public class JobInfo implements Parcelable { } JobInfo jobInfo = new JobInfo(this); jobInfo.enforceValidity(disallowPrefetchDeadlines, rejectNegativeNetworkEstimates, - enforceMinimumTimeWindows); + enforceMinimumTimeWindows, rejectNegativeDelaysAndDeadlines); return jobInfo; } @@ -2224,7 +2250,8 @@ public class JobInfo implements Parcelable { */ public final void enforceValidity(boolean disallowPrefetchDeadlines, boolean rejectNegativeNetworkEstimates, - boolean enforceMinimumTimeWindows) { + boolean enforceMinimumTimeWindows, + boolean rejectNegativeDelaysAndDeadlines) { // Check that network estimates require network type and are reasonable values. if ((networkDownloadBytes > 0 || networkUploadBytes > 0 || minimumNetworkChunkBytes > 0) && networkRequest == null) { @@ -2258,6 +2285,17 @@ public class JobInfo implements Parcelable { throw new IllegalArgumentException("Minimum chunk size must be positive"); } + if (rejectNegativeDelaysAndDeadlines) { + if (minLatencyMillis < 0) { + throw new IllegalArgumentException( + "Minimum latency is negative: " + minLatencyMillis); + } + if (maxExecutionDelayMillis < 0) { + throw new IllegalArgumentException( + "Override deadline is negative: " + maxExecutionDelayMillis); + } + } + final boolean hasDeadline = maxExecutionDelayMillis != 0L; // Check that a deadline was not set on a periodic job. if (isPeriodic) { @@ -2339,35 +2377,36 @@ public class JobInfo implements Parcelable { throw new IllegalArgumentException("Invalid priority level provided: " + mPriority); } - if (enforceMinimumTimeWindows - && Flags.enforceMinimumTimeWindows() - // TODO(312197030): remove exemption for the system - && !UserHandle.isCore(Process.myUid()) - && hasLateConstraint && !isPeriodic) { - final long windowStart = hasEarlyConstraint ? minLatencyMillis : 0; - if (mPriority >= PRIORITY_DEFAULT) { - if (maxExecutionDelayMillis - windowStart < HOUR_IN_MILLIS) { - throw new IllegalArgumentException( - getPriorityString(mPriority) - + " cannot have a time window less than 1 hour." - + " Delay=" + windowStart - + ", deadline=" + maxExecutionDelayMillis); - } - } else if (mPriority >= PRIORITY_LOW) { - if (maxExecutionDelayMillis - windowStart < 6 * HOUR_IN_MILLIS) { - throw new IllegalArgumentException( - getPriorityString(mPriority) - + " cannot have a time window less than 6 hours." - + " Delay=" + windowStart - + ", deadline=" + maxExecutionDelayMillis); - } + final boolean hasFunctionalConstraint = networkRequest != null + || constraintFlags != 0 + || (triggerContentUris != null && triggerContentUris.length > 0); + if (hasLateConstraint && !isPeriodic) { + if (!hasFunctionalConstraint) { + Log.w(TAG, "Job '" + service.flattenToShortString() + "#" + jobId + "'" + + " has a deadline with no functional constraints." + + " The deadline won't improve job execution latency." + + " Consider removing the deadline."); } else { - if (maxExecutionDelayMillis - windowStart < 12 * HOUR_IN_MILLIS) { - throw new IllegalArgumentException( - getPriorityString(mPriority) - + " cannot have a time window less than 12 hours." - + " Delay=" + windowStart - + ", deadline=" + maxExecutionDelayMillis); + final long windowStart = hasEarlyConstraint ? minLatencyMillis : 0; + if (maxExecutionDelayMillis - windowStart < MIN_ALLOWED_TIME_WINDOW_MILLIS) { + if (enforceMinimumTimeWindows + && Flags.enforceMinimumTimeWindows()) { + throw new IllegalArgumentException("Time window too short. Constraints" + + " unlikely to be satisfied. Increase deadline to a reasonable" + + " duration." + + " Job '" + service.flattenToShortString() + "#" + jobId + "'" + + " has delay=" + windowStart + + ", deadline=" + maxExecutionDelayMillis); + } else { + Log.w(TAG, "Job '" + service.flattenToShortString() + "#" + jobId + "'" + + " has a deadline with functional constraints and an extremely" + + " short time window of " + + (maxExecutionDelayMillis - windowStart) + " ms" + + " (delay=" + windowStart + + ", deadline=" + maxExecutionDelayMillis + ")." + + " The functional constraints are not likely to be satisfied when" + + " the job runs."); + } } } } diff --git a/apex/jobscheduler/framework/java/com/android/server/DeviceIdleInternal.java b/apex/jobscheduler/framework/java/com/android/server/DeviceIdleInternal.java index caf7e7f4a4ed2806f388a965e688a8af974b471e..1fc888b06ffd3d532cbfd3592916dd595fd1def4 100644 --- a/apex/jobscheduler/framework/java/com/android/server/DeviceIdleInternal.java +++ b/apex/jobscheduler/framework/java/com/android/server/DeviceIdleInternal.java @@ -16,6 +16,7 @@ package com.android.server; +import android.annotation.NonNull; import android.annotation.Nullable; import android.os.PowerExemptionManager; import android.os.PowerExemptionManager.ReasonCode; @@ -77,6 +78,9 @@ public interface DeviceIdleInternal { int[] getPowerSaveTempWhitelistAppIds(); + @NonNull + String[] getFullPowerWhitelistExceptIdle(); + /** * Listener to be notified when DeviceIdleController determines that the device has moved or is * stationary. diff --git a/apex/jobscheduler/framework/java/com/android/server/job/JobSchedulerInternal.java b/apex/jobscheduler/framework/java/com/android/server/job/JobSchedulerInternal.java index 6c8af39015f5dce0c47c8cfe971b0feed2ee6753..ae98fe14fbe61ca7d66951640fdbd6bee8c0a2b2 100644 --- a/apex/jobscheduler/framework/java/com/android/server/job/JobSchedulerInternal.java +++ b/apex/jobscheduler/framework/java/com/android/server/job/JobSchedulerInternal.java @@ -76,6 +76,12 @@ public interface JobSchedulerInternal { boolean isNotificationChannelAssociatedWithAnyUserInitiatedJobs( @NonNull String notificationChannel, int userId, @NonNull String packageName); + /** + * @return {@code true} if the given package holds the + * {@link android.Manifest.permission.RUN_BACKUP_JOBS} permission. + */ + boolean hasRunBackupJobsPermission(@NonNull String packageName, int packageUid); + /** * Report a snapshot of sync-related jobs back to the sync manager */ diff --git a/apex/jobscheduler/service/Android.bp b/apex/jobscheduler/service/Android.bp index a654f7a2d97421e4f99bf33d39befe00164d2e0a..ace56d42ddd122463bef16121c861af539104489 100644 --- a/apex/jobscheduler/service/Android.bp +++ b/apex/jobscheduler/service/Android.bp @@ -30,6 +30,7 @@ java_library { static_libs: [ "modules-utils-fastxmlserializer", + "service-jobscheduler-alarm.flags-aconfig-java", "service-jobscheduler-job.flags-aconfig-java", ], diff --git a/apex/jobscheduler/service/aconfig/Android.bp b/apex/jobscheduler/service/aconfig/Android.bp index 7f1fd47afcba53e7a905b84b4eb3329372b57695..859c67ad8910265fefb82f83f4d706a1fe9c8b18 100644 --- a/apex/jobscheduler/service/aconfig/Android.bp +++ b/apex/jobscheduler/service/aconfig/Android.bp @@ -29,3 +29,16 @@ java_aconfig_library { aconfig_declarations: "service-job.flags-aconfig", visibility: ["//frameworks/base:__subpackages__"], } + +// Alarm +aconfig_declarations { + name: "alarm_flags", + package: "com.android.server.alarm", + container: "system", + srcs: ["alarm.aconfig"], +} + +java_aconfig_library { + name: "service-jobscheduler-alarm.flags-aconfig-java", + aconfig_declarations: "alarm_flags", +} diff --git a/apex/jobscheduler/service/aconfig/alarm.aconfig b/apex/jobscheduler/service/aconfig/alarm.aconfig new file mode 100644 index 0000000000000000000000000000000000000000..d3068d7d37e8210843e947edf7ba91150668fc40 --- /dev/null +++ b/apex/jobscheduler/service/aconfig/alarm.aconfig @@ -0,0 +1,19 @@ +package: "com.android.server.alarm" +container: "system" + +flag { + name: "use_frozen_state_to_drop_listener_alarms" + namespace: "backstage_power" + description: "Use frozen state callback to drop listener alarms for cached apps" + bug: "324470945" + metadata { + purpose: PURPOSE_BUGFIX + } +} + +flag { + name: "start_user_before_scheduled_alarms" + namespace: "multiuser" + description: "Persist list of users with alarms scheduled and wakeup stopped users before alarms are due" + bug: "314907186" +} diff --git a/apex/jobscheduler/service/aconfig/device_idle.aconfig b/apex/jobscheduler/service/aconfig/device_idle.aconfig index 7a5e4bfd4c4a66daeec6062882236adf13add3b3..e8c99b12828fb7cd50b40206517be7b8b69f9414 100644 --- a/apex/jobscheduler/service/aconfig/device_idle.aconfig +++ b/apex/jobscheduler/service/aconfig/device_idle.aconfig @@ -5,5 +5,5 @@ flag { name: "disable_wakelocks_in_light_idle" namespace: "backstage_power" description: "Disable wakelocks for background apps while Light Device Idle is active" - bug: "299329948" + bug: "326607666" } diff --git a/apex/jobscheduler/service/aconfig/job.aconfig b/apex/jobscheduler/service/aconfig/job.aconfig index db8124eb0a2327d266f63e6166602d6e657d1a88..75e2efd2ec99edd56de903d08f2da51539f355fb 100644 --- a/apex/jobscheduler/service/aconfig/job.aconfig +++ b/apex/jobscheduler/service/aconfig/job.aconfig @@ -2,15 +2,29 @@ package: "com.android.server.job" container: "system" flag { - name: "relax_prefetch_connectivity_constraint_only_on_charger" + name: "batch_active_bucket_jobs" namespace: "backstage_power" - description: "Only relax a prefetch job's connectivity constraint when the device is charging and battery is not low" - bug: "299329948" + description: "Include jobs in the ACTIVE bucket in the job batching effort. Don't let them run as freely as they're ready." + bug: "326607666" +} + +flag { + name: "batch_connectivity_jobs_per_network" + namespace: "backstage_power" + description: "Have JobScheduler attempt to delay the start of some connectivity jobs until there are several ready or the network is active" + bug: "28382445" } flag { - name: "throw_on_unsupported_bias_usage" + name: "do_not_force_rush_execution_at_boot" namespace: "backstage_power" - description: "Throw an exception if an unsupported app uses JobInfo.setBias" - bug: "300477393" -} \ No newline at end of file + description: "Don't force rush job execution right after boot completion" + bug: "321598070" +} + +flag { + name: "relax_prefetch_connectivity_constraint_only_on_charger" + namespace: "backstage_power" + description: "Only relax a prefetch job's connectivity constraint when the device is charging and battery is not low" + bug: "299329948" +} diff --git a/apex/jobscheduler/service/java/com/android/server/AppStateTrackerImpl.java b/apex/jobscheduler/service/java/com/android/server/AppStateTrackerImpl.java index e08200b055d86406bdc3c42418214f2f68359ed2..33f6899239c6373dd59b1471fefad11293f5d17f 100644 --- a/apex/jobscheduler/service/java/com/android/server/AppStateTrackerImpl.java +++ b/apex/jobscheduler/service/java/com/android/server/AppStateTrackerImpl.java @@ -743,7 +743,8 @@ public class AppStateTrackerImpl implements AppStateTracker { private final class AppOpsWatcher extends IAppOpsCallback.Stub { @Override - public void opChanged(int op, int uid, String packageName) throws RemoteException { + public void opChanged(int op, int uid, String packageName, + String persistentDeviceId) throws RemoteException { boolean restricted = false; try { restricted = mAppOpsService.checkOperation(TARGET_OP, diff --git a/apex/jobscheduler/service/java/com/android/server/DeviceIdleController.java b/apex/jobscheduler/service/java/com/android/server/DeviceIdleController.java index 6383ed873e592836df221dc71791c4f01844e85b..4832ea624bd73c36c5a160ea3af9a8ae50a0c447 100644 --- a/apex/jobscheduler/service/java/com/android/server/DeviceIdleController.java +++ b/apex/jobscheduler/service/java/com/android/server/DeviceIdleController.java @@ -893,8 +893,9 @@ public class DeviceIdleController extends SystemService } // Fall through when quick doze is not requested. - if (!mIsOffBody) { - // Quick doze was not requested and device is on body so turn the device active. + if (!mIsOffBody && !mForceIdle) { + // Quick doze wasn't requested, doze wasn't forced and device is on body + // so turn the device active. mActiveReason = ACTIVE_REASON_ONBODY; becomeActiveLocked("on_body", Process.myUid()); } @@ -2374,6 +2375,11 @@ public class DeviceIdleController extends SystemService return DeviceIdleController.this.isAppOnWhitelistInternal(appid); } + @Override + public String[] getFullPowerWhitelistExceptIdle() { + return DeviceIdleController.this.getFullPowerWhitelistInternalUnchecked(); + } + /** * Returns the array of app ids whitelisted by user. Take care not to * modify this, as it is a reference to the original copy. But the reference @@ -3100,10 +3106,14 @@ public class DeviceIdleController extends SystemService } private String[] getFullPowerWhitelistInternal(final int callingUid, final int callingUserId) { - final String[] apps; + return ArrayUtils.filter(getFullPowerWhitelistInternalUnchecked(), String[]::new, + (pkg) -> !mPackageManagerInternal.filterAppAccess(pkg, callingUid, callingUserId)); + } + + private String[] getFullPowerWhitelistInternalUnchecked() { synchronized (this) { int size = mPowerSaveWhitelistApps.size() + mPowerSaveWhitelistUserApps.size(); - apps = new String[size]; + final String[] apps = new String[size]; int cur = 0; for (int i = 0; i < mPowerSaveWhitelistApps.size(); i++) { apps[cur] = mPowerSaveWhitelistApps.keyAt(i); @@ -3113,9 +3123,8 @@ public class DeviceIdleController extends SystemService apps[cur] = mPowerSaveWhitelistUserApps.keyAt(i); cur++; } + return apps; } - return ArrayUtils.filter(apps, String[]::new, - (pkg) -> !mPackageManagerInternal.filterAppAccess(pkg, callingUid, callingUserId)); } public boolean isPowerSaveWhitelistExceptIdleAppInternal(String packageName) { @@ -3911,6 +3920,7 @@ public class DeviceIdleController extends SystemService if (locationManager != null && locationManager.getProvider(LocationManager.FUSED_PROVIDER) != null) { + mHasFusedLocation = true; locationManager.requestLocationUpdates(LocationManager.FUSED_PROVIDER, mLocationRequest, AppSchedulingModuleThread.getExecutor(), diff --git a/apex/jobscheduler/service/java/com/android/server/alarm/AlarmManagerService.java b/apex/jobscheduler/service/java/com/android/server/alarm/AlarmManagerService.java index 5a32a02ca8ce70582b39a40be5886655e76f0f80..d0a1b027ec48ed206a13dd128d00cc687d21d1fa 100644 --- a/apex/jobscheduler/service/java/com/android/server/alarm/AlarmManagerService.java +++ b/apex/jobscheduler/service/java/com/android/server/alarm/AlarmManagerService.java @@ -16,6 +16,7 @@ package com.android.server.alarm; +import static android.app.ActivityManager.UidFrozenStateChangedCallback.UID_FROZEN_STATE_FROZEN; import static android.app.ActivityManagerInternal.ALLOW_NON_FULL; import static android.app.AlarmManager.ELAPSED_REALTIME; import static android.app.AlarmManager.ELAPSED_REALTIME_WAKEUP; @@ -75,6 +76,7 @@ import android.annotation.NonNull; import android.annotation.SuppressLint; import android.annotation.UserIdInt; import android.app.Activity; +import android.app.ActivityManager; import android.app.ActivityManagerInternal; import android.app.ActivityOptions; import android.app.AlarmManager; @@ -103,6 +105,7 @@ import android.os.Binder; import android.os.Build; import android.os.Bundle; import android.os.Handler; +import android.os.HandlerExecutor; import android.os.IBinder; import android.os.Looper; import android.os.Message; @@ -115,6 +118,7 @@ import android.os.ServiceManager; import android.os.ShellCallback; import android.os.ShellCommand; import android.os.SystemClock; +import android.os.SystemProperties; import android.os.ThreadLocalWorkSource; import android.os.Trace; import android.os.UserHandle; @@ -144,6 +148,7 @@ import com.android.internal.annotations.GuardedBy; import com.android.internal.annotations.VisibleForTesting; import com.android.internal.app.IAppOpsCallback; import com.android.internal.app.IAppOpsService; +import com.android.internal.util.ArrayUtils; import com.android.internal.util.DumpUtils; import com.android.internal.util.FrameworkStatsLog; import com.android.internal.util.LocalLog; @@ -178,6 +183,9 @@ import java.io.PrintWriter; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.text.SimpleDateFormat; +import java.time.Instant; +import java.time.zone.ZoneOffsetTransition; +import java.time.zone.ZoneRules; import java.util.ArrayList; import java.util.Arrays; import java.util.Calendar; @@ -189,6 +197,7 @@ import java.util.Set; import java.util.TimeZone; import java.util.TreeSet; import java.util.concurrent.ThreadLocalRandom; +import java.util.concurrent.TimeUnit; import java.util.function.Predicate; /** @@ -229,6 +238,13 @@ public class AlarmManagerService extends SystemService { private static final long TEMPORARY_QUOTA_DURATION = INTERVAL_DAY; + // System properties read on some device configurations to initialize time properly and + // perform DST transitions at the bootloader level. + private static final String TIMEOFFSET_PROPERTY = "persist.sys.time.offset"; + private static final String DST_TRANSITION_PROPERTY = "persist.sys.time.dst_transition"; + private static final String DST_OFFSET_PROPERTY = "persist.sys.time.dst_offset"; + + private final Intent mBackgroundIntent = new Intent().addFlags(Intent.FLAG_FROM_BACKGROUND); @@ -289,6 +305,7 @@ public class AlarmManagerService extends SystemService { private final Injector mInjector; int mBroadcastRefCount = 0; + boolean mUseFrozenStateToDropListenerAlarms; MetricsHelper mMetricsHelper; PowerManager.WakeLock mWakeLock; SparseIntArray mAlarmsPerUid = new SparseIntArray(); @@ -1852,15 +1869,47 @@ public class AlarmManagerService extends SystemService { @Override public void onStart() { mInjector.init(); + mHandler = new AlarmHandler(); + mOptsWithFgs.setPendingIntentBackgroundActivityLaunchAllowed(false); mOptsWithFgsForAlarmClock.setPendingIntentBackgroundActivityLaunchAllowed(false); mOptsWithoutFgs.setPendingIntentBackgroundActivityLaunchAllowed(false); mOptsTimeBroadcast.setPendingIntentBackgroundActivityLaunchAllowed(false); mActivityOptsRestrictBal.setPendingIntentBackgroundActivityLaunchAllowed(false); mBroadcastOptsRestrictBal.setPendingIntentBackgroundActivityLaunchAllowed(false); + mMetricsHelper = new MetricsHelper(getContext(), mLock); mActivityManagerInternal = LocalServices.getService(ActivityManagerInternal.class); + mUseFrozenStateToDropListenerAlarms = Flags.useFrozenStateToDropListenerAlarms(); + if (mUseFrozenStateToDropListenerAlarms) { + final ActivityManager.UidFrozenStateChangedCallback callback = (uids, frozenStates) -> { + final int size = frozenStates.length; + if (uids.length != size) { + Slog.wtf(TAG, "Got different length arrays in frozen state callback!" + + " uids.length: " + uids.length + " frozenStates.length: " + size); + // Cannot process received data in any meaningful way. + return; + } + final IntArray affectedUids = new IntArray(); + for (int i = 0; i < size; i++) { + if (frozenStates[i] != UID_FROZEN_STATE_FROZEN) { + continue; + } + if (!CompatChanges.isChangeEnabled(EXACT_LISTENER_ALARMS_DROPPED_ON_CACHED, + uids[i])) { + continue; + } + affectedUids.add(uids[i]); + } + if (affectedUids.size() > 0) { + removeExactListenerAlarms(affectedUids.toArray()); + } + }; + final ActivityManager am = getContext().getSystemService(ActivityManager.class); + am.registerUidFrozenStateChangedCallback(new HandlerExecutor(mHandler), callback); + } + mListenerDeathRecipient = new IBinder.DeathRecipient() { @Override public void binderDied() { @@ -1876,7 +1925,6 @@ public class AlarmManagerService extends SystemService { }; synchronized (mLock) { - mHandler = new AlarmHandler(); mConstants = new Constants(mHandler); mAlarmStore = new LazyAlarmStore(); @@ -1956,6 +2004,21 @@ public class AlarmManagerService extends SystemService { publishBinderService(Context.ALARM_SERVICE, mService); } + private void removeExactListenerAlarms(int... whichUids) { + synchronized (mLock) { + removeAlarmsInternalLocked(a -> { + if (!ArrayUtils.contains(whichUids, a.uid) || a.listener == null + || a.windowLength != 0) { + return false; + } + Slog.w(TAG, "Alarm " + a.listenerTag + " being removed for " + + UserHandle.formatUid(a.uid) + ":" + a.packageName + + " because the app got frozen"); + return true; + }, REMOVE_REASON_LISTENER_CACHED); + } + } + void refreshExactAlarmCandidates() { final String[] candidates = mLocalPermissionManager.getAppOpPermissionPackages( Manifest.permission.SCHEDULE_EXACT_ALARM); @@ -2022,8 +2085,8 @@ public class AlarmManagerService extends SystemService { iAppOpsService.startWatchingMode(AppOpsManager.OP_SCHEDULE_EXACT_ALARM, null, new IAppOpsCallback.Stub() { @Override - public void opChanged(int op, int uid, String packageName) - throws RemoteException { + public void opChanged(int op, int uid, String packageName, + String persistentDeviceId) throws RemoteException { final int userId = UserHandle.getUserId(uid); if (op != AppOpsManager.OP_SCHEDULE_EXACT_ALARM || !isExactAlarmChangeEnabled(packageName, userId)) { @@ -2142,6 +2205,22 @@ public class AlarmManagerService extends SystemService { // "GMT" if the ID is unrecognized). The parameter ID is used here rather than // newZone.getId(). It will be rejected if it is invalid. timeZoneWasChanged = SystemTimeZone.setTimeZoneId(tzId, confidence, logInfo); + + final int gmtOffset = newZone.getOffset(mInjector.getCurrentTimeMillis()); + SystemProperties.set(TIMEOFFSET_PROPERTY, String.valueOf(gmtOffset)); + + final ZoneRules rules = newZone.toZoneId().getRules(); + final ZoneOffsetTransition transition = rules.nextTransition(Instant.now()); + if (null != transition) { + // Get the offset between the time after the DST transition and before. + final long transitionOffset = TimeUnit.SECONDS.toMillis(( + transition.getOffsetAfter().getTotalSeconds() + - transition.getOffsetBefore().getTotalSeconds())); + // Time when the next DST transition is programmed. + final long nextTransition = TimeUnit.SECONDS.toMillis(transition.toEpochSecond()); + SystemProperties.set(DST_TRANSITION_PROPERTY, String.valueOf(nextTransition)); + SystemProperties.set(DST_OFFSET_PROPERTY, String.valueOf(transitionOffset)); + } } // Clear the default time zone in the system server process. This forces the next call @@ -3067,6 +3146,14 @@ public class AlarmManagerService extends SystemService { mConstants.dump(pw); pw.println(); + pw.println("Feature Flags:"); + pw.increaseIndent(); + pw.print(Flags.FLAG_USE_FROZEN_STATE_TO_DROP_LISTENER_ALARMS, + mUseFrozenStateToDropListenerAlarms); + pw.decreaseIndent(); + pw.println(); + pw.println(); + if (mConstants.USE_TARE_POLICY == EconomyManager.ENABLED_MODE_ON) { pw.println("TARE details:"); pw.increaseIndent(); @@ -4952,18 +5039,7 @@ public class AlarmManagerService extends SystemService { break; case REMOVE_EXACT_LISTENER_ALARMS_ON_CACHED: uid = (Integer) msg.obj; - synchronized (mLock) { - removeAlarmsInternalLocked(a -> { - if (a.uid != uid || a.listener == null || a.windowLength != 0) { - return false; - } - // TODO (b/265195908): Change to .w once we have some data on breakages. - Slog.wtf(TAG, "Alarm " + a.listenerTag + " being removed for " - + UserHandle.formatUid(a.uid) + ":" + a.packageName - + " because the app went into cached state"); - return true; - }, REMOVE_REASON_LISTENER_CACHED); - } + removeExactListenerAlarms(uid); break; default: // nope, just ignore it @@ -5315,6 +5391,10 @@ public class AlarmManagerService extends SystemService { @Override public void handleUidCachedChanged(int uid, boolean cached) { + if (mUseFrozenStateToDropListenerAlarms) { + // Use ActivityManager#UidFrozenStateChangedCallback instead. + return; + } if (!CompatChanges.isChangeEnabled(EXACT_LISTENER_ALARMS_DROPPED_ON_CACHED, uid)) { return; } diff --git a/apex/jobscheduler/service/java/com/android/server/job/JobConcurrencyManager.java b/apex/jobscheduler/service/java/com/android/server/job/JobConcurrencyManager.java index 6550f26436d420a848f6d2c996e0ca8e42e3a242..012ede274bc142c0b3ecd05f19bb5ba4b623701e 100644 --- a/apex/jobscheduler/service/java/com/android/server/job/JobConcurrencyManager.java +++ b/apex/jobscheduler/service/java/com/android/server/job/JobConcurrencyManager.java @@ -96,7 +96,6 @@ class JobConcurrencyManager { static final String CONFIG_KEY_PREFIX_CONCURRENCY = "concurrency_"; private static final String KEY_CONCURRENCY_LIMIT = CONFIG_KEY_PREFIX_CONCURRENCY + "limit"; - @VisibleForTesting static final int DEFAULT_CONCURRENCY_LIMIT; static { diff --git a/apex/jobscheduler/service/java/com/android/server/job/JobSchedulerService.java b/apex/jobscheduler/service/java/com/android/server/job/JobSchedulerService.java index 83db4cbb7e435d5ce5d47b7067471df8c8e6a182..bd00c03741f3d5ac7d2b0bfb91f5f1f25cdcda4c 100644 --- a/apex/jobscheduler/service/java/com/android/server/job/JobSchedulerService.java +++ b/apex/jobscheduler/service/java/com/android/server/job/JobSchedulerService.java @@ -65,6 +65,7 @@ import android.content.pm.ParceledListSlice; import android.content.pm.ProviderInfo; import android.content.pm.ServiceInfo; import android.net.Network; +import android.net.NetworkCapabilities; import android.net.Uri; import android.os.BatteryManager; import android.os.BatteryManagerInternal; @@ -89,6 +90,7 @@ import android.text.format.DateUtils; import android.util.ArrayMap; import android.util.ArraySet; import android.util.IndentingPrintWriter; +import android.util.KeyValueListParser; import android.util.Log; import android.util.Pair; import android.util.Slog; @@ -159,6 +161,7 @@ import java.util.List; import java.util.Map; import java.util.Objects; import java.util.concurrent.CountDownLatch; +import java.util.concurrent.TimeUnit; import java.util.function.Consumer; import java.util.function.Predicate; @@ -315,7 +318,8 @@ public class JobSchedulerService extends com.android.server.SystemService private final List mJobRestrictions; @GuardedBy("mLock") - private final BatteryStateTracker mBatteryStateTracker; + @VisibleForTesting + final BatteryStateTracker mBatteryStateTracker; @GuardedBy("mLock") private final SparseArray mCloudMediaProviderPackages = new SparseArray<>(); @@ -481,6 +485,32 @@ public class JobSchedulerService extends com.android.server.SystemService private class ConstantsObserver implements DeviceConfig.OnPropertiesChangedListener, EconomyManagerInternal.TareStateChangeListener { + @Nullable + @GuardedBy("mLock") + private DeviceConfig.Properties mLastPropertiesPulled; + @GuardedBy("mLock") + private boolean mCacheConfigChanges = false; + + @Nullable + @GuardedBy("mLock") + public String getValueLocked(String key) { + if (mLastPropertiesPulled == null) { + return null; + } + return mLastPropertiesPulled.getString(key, null); + } + + @GuardedBy("mLock") + public void setCacheConfigChangesLocked(boolean enabled) { + if (enabled && !mCacheConfigChanges) { + mLastPropertiesPulled = + DeviceConfig.getProperties(DeviceConfig.NAMESPACE_JOB_SCHEDULER); + } else { + mLastPropertiesPulled = null; + } + mCacheConfigChanges = enabled; + } + public void start() { DeviceConfig.addOnPropertiesChangedListener(DeviceConfig.NAMESPACE_JOB_SCHEDULER, AppSchedulingModuleThread.getExecutor(), this); @@ -509,10 +539,18 @@ public class JobSchedulerService extends com.android.server.SystemService } synchronized (mLock) { + if (mCacheConfigChanges) { + mLastPropertiesPulled = + DeviceConfig.getProperties(DeviceConfig.NAMESPACE_JOB_SCHEDULER); + } for (String name : properties.getKeyset()) { if (name == null) { continue; } + if (DEBUG || mCacheConfigChanges) { + Slog.d(TAG, "DeviceConfig " + name + + " changed to " + properties.getString(name, null)); + } switch (name) { case Constants.KEY_ENABLE_API_QUOTAS: case Constants.KEY_ENABLE_EXECUTION_SAFEGUARDS_UDC: @@ -533,7 +571,9 @@ public class JobSchedulerService extends com.android.server.SystemService apiQuotaScheduleUpdated = true; } break; + case Constants.KEY_MIN_READY_CPU_ONLY_JOBS_COUNT: case Constants.KEY_MIN_READY_NON_ACTIVE_JOBS_COUNT: + case Constants.KEY_MAX_CPU_ONLY_JOB_BATCH_DELAY_MS: case Constants.KEY_MAX_NON_ACTIVE_JOB_BATCH_DELAY_MS: mConstants.updateBatchingConstantsLocked(); break; @@ -549,6 +589,8 @@ public class JobSchedulerService extends com.android.server.SystemService case Constants.KEY_CONN_CONGESTION_DELAY_FRAC: case Constants.KEY_CONN_PREFETCH_RELAX_FRAC: case Constants.KEY_CONN_LOW_SIGNAL_STRENGTH_RELAX_FRAC: + case Constants.KEY_CONN_MAX_CONNECTIVITY_JOB_BATCH_DELAY_MS: + case Constants.KEY_CONN_TRANSPORT_BATCH_THRESHOLD: case Constants.KEY_CONN_USE_CELL_SIGNAL_STRENGTH: case Constants.KEY_CONN_UPDATE_ALL_JOBS_MIN_INTERVAL_MS: mConstants.updateConnectivityConstantsLocked(); @@ -597,6 +639,8 @@ public class JobSchedulerService extends com.android.server.SystemService sc.onConstantsUpdatedLocked(); } } + + mHandler.sendEmptyMessage(MSG_CHECK_JOB); } @Override @@ -641,8 +685,12 @@ public class JobSchedulerService extends com.android.server.SystemService */ public static class Constants { // Key names stored in the settings value. + private static final String KEY_MIN_READY_CPU_ONLY_JOBS_COUNT = + "min_ready_cpu_only_jobs_count"; private static final String KEY_MIN_READY_NON_ACTIVE_JOBS_COUNT = "min_ready_non_active_jobs_count"; + private static final String KEY_MAX_CPU_ONLY_JOB_BATCH_DELAY_MS = + "max_cpu_only_job_batch_delay_ms"; private static final String KEY_MAX_NON_ACTIVE_JOB_BATCH_DELAY_MS = "max_non_active_job_batch_delay_ms"; private static final String KEY_HEAVY_USE_FACTOR = "heavy_use_factor"; @@ -660,6 +708,10 @@ public class JobSchedulerService extends com.android.server.SystemService "conn_update_all_jobs_min_interval_ms"; private static final String KEY_CONN_LOW_SIGNAL_STRENGTH_RELAX_FRAC = "conn_low_signal_strength_relax_frac"; + private static final String KEY_CONN_TRANSPORT_BATCH_THRESHOLD = + "conn_transport_batch_threshold"; + private static final String KEY_CONN_MAX_CONNECTIVITY_JOB_BATCH_DELAY_MS = + "conn_max_connectivity_job_batch_delay_ms"; private static final String KEY_PREFETCH_FORCE_BATCH_RELAX_THRESHOLD_MS = "prefetch_force_batch_relax_threshold_ms"; // This has been enabled for 3+ full releases. We're unlikely to disable it. @@ -708,7 +760,11 @@ public class JobSchedulerService extends com.android.server.SystemService private static final String KEY_MAX_NUM_PERSISTED_JOB_WORK_ITEMS = "max_num_persisted_job_work_items"; - private static final int DEFAULT_MIN_READY_NON_ACTIVE_JOBS_COUNT = 5; + private static final int DEFAULT_MIN_READY_CPU_ONLY_JOBS_COUNT = + Math.min(3, JobConcurrencyManager.DEFAULT_CONCURRENCY_LIMIT / 3); + private static final int DEFAULT_MIN_READY_NON_ACTIVE_JOBS_COUNT = + Math.min(5, JobConcurrencyManager.DEFAULT_CONCURRENCY_LIMIT / 3); + private static final long DEFAULT_MAX_CPU_ONLY_JOB_BATCH_DELAY_MS = 31 * MINUTE_IN_MILLIS; private static final long DEFAULT_MAX_NON_ACTIVE_JOB_BATCH_DELAY_MS = 31 * MINUTE_IN_MILLIS; private static final float DEFAULT_HEAVY_USE_FACTOR = .9f; private static final float DEFAULT_MODERATE_USE_FACTOR = .5f; @@ -720,6 +776,15 @@ public class JobSchedulerService extends com.android.server.SystemService private static final boolean DEFAULT_CONN_USE_CELL_SIGNAL_STRENGTH = true; private static final long DEFAULT_CONN_UPDATE_ALL_JOBS_MIN_INTERVAL_MS = MINUTE_IN_MILLIS; private static final float DEFAULT_CONN_LOW_SIGNAL_STRENGTH_RELAX_FRAC = 0.5f; + private static final SparseIntArray DEFAULT_CONN_TRANSPORT_BATCH_THRESHOLD = + new SparseIntArray(); + private static final long DEFAULT_CONN_MAX_CONNECTIVITY_JOB_BATCH_DELAY_MS = + 31 * MINUTE_IN_MILLIS; + static { + DEFAULT_CONN_TRANSPORT_BATCH_THRESHOLD.put( + NetworkCapabilities.TRANSPORT_CELLULAR, + Math.min(3, JobConcurrencyManager.DEFAULT_CONCURRENCY_LIMIT / 3)); + } private static final long DEFAULT_PREFETCH_FORCE_BATCH_RELAX_THRESHOLD_MS = HOUR_IN_MILLIS; private static final boolean DEFAULT_ENABLE_API_QUOTAS = true; private static final int DEFAULT_API_QUOTA_SCHEDULE_COUNT = 250; @@ -757,10 +822,22 @@ public class JobSchedulerService extends com.android.server.SystemService static final int DEFAULT_MAX_NUM_PERSISTED_JOB_WORK_ITEMS = 100_000; /** - * Minimum # of non-ACTIVE jobs for which the JMS will be happy running some work early. + * Minimum # of jobs that have to be ready for JS to be happy running work. + * Only valid if {@link Flags#batchActiveBucketJobs()} is true. + */ + int MIN_READY_CPU_ONLY_JOBS_COUNT = DEFAULT_MIN_READY_CPU_ONLY_JOBS_COUNT; + + /** + * Minimum # of non-ACTIVE jobs that have to be ready for JS to be happy running work. */ int MIN_READY_NON_ACTIVE_JOBS_COUNT = DEFAULT_MIN_READY_NON_ACTIVE_JOBS_COUNT; + /** + * Don't batch a CPU-only job if it's been delayed due to force batching attempts for + * at least this amount of time. + */ + long MAX_CPU_ONLY_JOB_BATCH_DELAY_MS = DEFAULT_MAX_CPU_ONLY_JOB_BATCH_DELAY_MS; + /** * Don't batch a non-ACTIVE job if it's been delayed due to force batching attempts for * at least this amount of time. @@ -817,6 +894,17 @@ public class JobSchedulerService extends com.android.server.SystemService */ public float CONN_LOW_SIGNAL_STRENGTH_RELAX_FRAC = DEFAULT_CONN_LOW_SIGNAL_STRENGTH_RELAX_FRAC; + /** + * The minimum batch requirement per each transport type before allowing a network to run + * on a network with that transport. + */ + public SparseIntArray CONN_TRANSPORT_BATCH_THRESHOLD = new SparseIntArray(); + /** + * Don't batch a connectivity job if it's been delayed due to force batching attempts for + * at least this amount of time. + */ + public long CONN_MAX_CONNECTIVITY_JOB_BATCH_DELAY_MS = + DEFAULT_CONN_MAX_CONNECTIVITY_JOB_BATCH_DELAY_MS; /** * The amount of time within which we would consider the app to be launching relatively soon @@ -967,11 +1055,31 @@ public class JobSchedulerService extends com.android.server.SystemService public boolean USE_TARE_POLICY = EconomyManager.DEFAULT_ENABLE_POLICY_JOB_SCHEDULER && EconomyManager.DEFAULT_ENABLE_TARE_MODE == EconomyManager.ENABLED_MODE_ON; + public Constants() { + copyTransportBatchThresholdDefaults(); + } + private void updateBatchingConstantsLocked() { - MIN_READY_NON_ACTIVE_JOBS_COUNT = DeviceConfig.getInt( + // The threshold should be in the range + // [0, DEFAULT_CONCURRENCY_LIMIT / 3]. + MIN_READY_CPU_ONLY_JOBS_COUNT = + Math.max(0, Math.min(JobConcurrencyManager.DEFAULT_CONCURRENCY_LIMIT / 3, + DeviceConfig.getInt( + DeviceConfig.NAMESPACE_JOB_SCHEDULER, + KEY_MIN_READY_CPU_ONLY_JOBS_COUNT, + DEFAULT_MIN_READY_CPU_ONLY_JOBS_COUNT))); + // The threshold should be in the range + // [0, DEFAULT_CONCURRENCY_LIMIT / 3]. + MIN_READY_NON_ACTIVE_JOBS_COUNT = + Math.max(0, Math.min(JobConcurrencyManager.DEFAULT_CONCURRENCY_LIMIT / 3, + DeviceConfig.getInt( + DeviceConfig.NAMESPACE_JOB_SCHEDULER, + KEY_MIN_READY_NON_ACTIVE_JOBS_COUNT, + DEFAULT_MIN_READY_NON_ACTIVE_JOBS_COUNT))); + MAX_CPU_ONLY_JOB_BATCH_DELAY_MS = DeviceConfig.getLong( DeviceConfig.NAMESPACE_JOB_SCHEDULER, - KEY_MIN_READY_NON_ACTIVE_JOBS_COUNT, - DEFAULT_MIN_READY_NON_ACTIVE_JOBS_COUNT); + KEY_MAX_CPU_ONLY_JOB_BATCH_DELAY_MS, + DEFAULT_MAX_CPU_ONLY_JOB_BATCH_DELAY_MS); MAX_NON_ACTIVE_JOB_BATCH_DELAY_MS = DeviceConfig.getLong( DeviceConfig.NAMESPACE_JOB_SCHEDULER, KEY_MAX_NON_ACTIVE_JOB_BATCH_DELAY_MS, @@ -1019,6 +1127,46 @@ public class JobSchedulerService extends com.android.server.SystemService DeviceConfig.NAMESPACE_JOB_SCHEDULER, KEY_CONN_LOW_SIGNAL_STRENGTH_RELAX_FRAC, DEFAULT_CONN_LOW_SIGNAL_STRENGTH_RELAX_FRAC); + final String batchThresholdConfigString = DeviceConfig.getString( + DeviceConfig.NAMESPACE_JOB_SCHEDULER, + KEY_CONN_TRANSPORT_BATCH_THRESHOLD, + null); + final KeyValueListParser parser = new KeyValueListParser(','); + CONN_TRANSPORT_BATCH_THRESHOLD.clear(); + try { + parser.setString(batchThresholdConfigString); + + for (int t = parser.size() - 1; t >= 0; --t) { + final String transportString = parser.keyAt(t); + try { + final int transport = Integer.parseInt(transportString); + // The threshold should be in the range + // [0, DEFAULT_CONCURRENCY_LIMIT / 3]. + CONN_TRANSPORT_BATCH_THRESHOLD.put(transport, Math.max(0, + Math.min(JobConcurrencyManager.DEFAULT_CONCURRENCY_LIMIT / 3, + parser.getInt(transportString, 1)))); + } catch (NumberFormatException e) { + Slog.e(TAG, "Bad transport string", e); + } + } + } catch (IllegalArgumentException e) { + Slog.wtf(TAG, "Bad string for " + KEY_CONN_TRANSPORT_BATCH_THRESHOLD, e); + // Use the defaults. + copyTransportBatchThresholdDefaults(); + } + CONN_MAX_CONNECTIVITY_JOB_BATCH_DELAY_MS = Math.max(0, Math.min(24 * HOUR_IN_MILLIS, + DeviceConfig.getLong( + DeviceConfig.NAMESPACE_JOB_SCHEDULER, + KEY_CONN_MAX_CONNECTIVITY_JOB_BATCH_DELAY_MS, + DEFAULT_CONN_MAX_CONNECTIVITY_JOB_BATCH_DELAY_MS))); + } + + private void copyTransportBatchThresholdDefaults() { + for (int i = DEFAULT_CONN_TRANSPORT_BATCH_THRESHOLD.size() - 1; i >= 0; --i) { + CONN_TRANSPORT_BATCH_THRESHOLD.put( + DEFAULT_CONN_TRANSPORT_BATCH_THRESHOLD.keyAt(i), + DEFAULT_CONN_TRANSPORT_BATCH_THRESHOLD.valueAt(i)); + } } private void updatePersistingConstantsLocked() { @@ -1163,8 +1311,11 @@ public class JobSchedulerService extends com.android.server.SystemService void dump(IndentingPrintWriter pw) { pw.println("Settings:"); pw.increaseIndent(); + pw.print(KEY_MIN_READY_CPU_ONLY_JOBS_COUNT, MIN_READY_CPU_ONLY_JOBS_COUNT).println(); pw.print(KEY_MIN_READY_NON_ACTIVE_JOBS_COUNT, MIN_READY_NON_ACTIVE_JOBS_COUNT).println(); + pw.print(KEY_MAX_CPU_ONLY_JOB_BATCH_DELAY_MS, + MAX_CPU_ONLY_JOB_BATCH_DELAY_MS).println(); pw.print(KEY_MAX_NON_ACTIVE_JOB_BATCH_DELAY_MS, MAX_NON_ACTIVE_JOB_BATCH_DELAY_MS).println(); pw.print(KEY_HEAVY_USE_FACTOR, HEAVY_USE_FACTOR).println(); @@ -1180,6 +1331,10 @@ public class JobSchedulerService extends com.android.server.SystemService .println(); pw.print(KEY_CONN_LOW_SIGNAL_STRENGTH_RELAX_FRAC, CONN_LOW_SIGNAL_STRENGTH_RELAX_FRAC) .println(); + pw.print(KEY_CONN_TRANSPORT_BATCH_THRESHOLD, CONN_TRANSPORT_BATCH_THRESHOLD.toString()) + .println(); + pw.print(KEY_CONN_MAX_CONNECTIVITY_JOB_BATCH_DELAY_MS, + CONN_MAX_CONNECTIVITY_JOB_BATCH_DELAY_MS).println(); pw.print(KEY_PREFETCH_FORCE_BATCH_RELAX_THRESHOLD_MS, PREFETCH_FORCE_BATCH_RELAX_THRESHOLD_MS).println(); @@ -1828,7 +1983,16 @@ public class JobSchedulerService extends com.android.server.SystemService /* system_measured_source_download_bytes */0, /* system_measured_source_upload_bytes */ 0, /* system_measured_calling_download_bytes */0, - /* system_measured_calling_upload_bytes */ 0); + /* system_measured_calling_upload_bytes */ 0, + jobStatus.getJob().getIntervalMillis(), + jobStatus.getJob().getFlexMillis(), + jobStatus.hasFlexibilityConstraint(), + /* isFlexConstraintSatisfied */ false, + jobStatus.canApplyTransportAffinities(), + jobStatus.getNumAppliedFlexibleConstraints(), + jobStatus.getNumDroppedFlexibleConstraints(), + jobStatus.getFilteredTraceTag(), + jobStatus.getFilteredDebugTags()); // If the job is immediately ready to run, then we can just immediately // put it in the pending list and try to schedule it. This is especially @@ -2269,7 +2433,16 @@ public class JobSchedulerService extends com.android.server.SystemService /* system_measured_source_download_bytes */ 0, /* system_measured_source_upload_bytes */ 0, /* system_measured_calling_download_bytes */0, - /* system_measured_calling_upload_bytes */ 0); + /* system_measured_calling_upload_bytes */ 0, + cancelled.getJob().getIntervalMillis(), + cancelled.getJob().getFlexMillis(), + cancelled.hasFlexibilityConstraint(), + cancelled.isConstraintSatisfied(JobStatus.CONSTRAINT_FLEXIBLE), + cancelled.canApplyTransportAffinities(), + cancelled.getNumAppliedFlexibleConstraints(), + cancelled.getNumDroppedFlexibleConstraints(), + cancelled.getFilteredTraceTag(), + cancelled.getFilteredDebugTags()); } // If this is a replacement, bring in the new version of the job if (incomingJob != null) { @@ -2701,8 +2874,10 @@ public class JobSchedulerService extends com.android.server.SystemService sc.maybeStartTrackingJobLocked(job, null); } }); - // GO GO GO! - mHandler.obtainMessage(MSG_CHECK_JOB).sendToTarget(); + if (!Flags.doNotForceRushExecutionAtBoot()) { + // GO GO GO! + mHandler.obtainMessage(MSG_CHECK_JOB).sendToTarget(); + } } } } @@ -2810,9 +2985,9 @@ public class JobSchedulerService extends com.android.server.SystemService mJobPackageTracker.notePending(job); } - void noteJobsPending(List jobs) { - for (int i = jobs.size() - 1; i >= 0; i--) { - noteJobPending(jobs.get(i)); + void noteJobsPending(ArraySet jobs) { + for (int i = jobs.size() - 1; i >= 0; --i) { + noteJobPending(jobs.valueAt(i)); } } @@ -3438,7 +3613,7 @@ public class JobSchedulerService extends com.android.server.SystemService } final class ReadyJobQueueFunctor implements Consumer { - final ArrayList newReadyJobs = new ArrayList<>(); + final ArraySet newReadyJobs = new ArraySet<>(); @Override public void accept(JobStatus job) { @@ -3466,9 +3641,27 @@ public class JobSchedulerService extends com.android.server.SystemService * policies on when we want to execute jobs. */ final class MaybeReadyJobQueueFunctor implements Consumer { - int forceBatchedCount; - int unbatchedCount; + /** + * Set of jobs that will be force batched, mapped by network. A {@code null} network is + * reserved/intended for CPU-only (non-networked) jobs. + * The set may include already running jobs. + */ + @VisibleForTesting + final ArrayMap> mBatches = new ArrayMap<>(); + /** List of all jobs that could run if allowed. Already running jobs are excluded. */ + @VisibleForTesting final List runnableJobs = new ArrayList<>(); + /** + * Convenience holder of all jobs ready to run that won't be force batched. + * Already running jobs are excluded. + */ + final ArraySet mUnbatchedJobs = new ArraySet<>(); + /** + * Count of jobs that won't be force batched, mapped by network. A {@code null} network is + * reserved/intended for CPU-only (non-networked) jobs. + * The set may include already running jobs. + */ + final ArrayMap mUnbatchedJobCount = new ArrayMap<>(); public MaybeReadyJobQueueFunctor() { reset(); @@ -3493,7 +3686,10 @@ public class JobSchedulerService extends com.android.server.SystemService } final boolean shouldForceBatchJob; - if (job.shouldTreatAsExpeditedJob() || job.shouldTreatAsUserInitiatedJob()) { + if (job.overrideState > JobStatus.OVERRIDE_NONE) { + // The job should run for some test. Don't force batch it. + shouldForceBatchJob = false; + } else if (job.shouldTreatAsExpeditedJob() || job.shouldTreatAsUserInitiatedJob()) { // Never batch expedited or user-initiated jobs, even for RESTRICTED apps. shouldForceBatchJob = false; } else if (job.getEffectiveStandbyBucket() == RESTRICTED_INDEX) { @@ -3512,27 +3708,77 @@ public class JobSchedulerService extends com.android.server.SystemService shouldForceBatchJob = false; } else { final long nowElapsed = sElapsedRealtimeClock.millis(); - final boolean batchDelayExpired = job.getFirstForceBatchedTimeElapsed() > 0 - && nowElapsed - job.getFirstForceBatchedTimeElapsed() - >= mConstants.MAX_NON_ACTIVE_JOB_BATCH_DELAY_MS; - shouldForceBatchJob = - mConstants.MIN_READY_NON_ACTIVE_JOBS_COUNT > 1 - && job.getEffectiveStandbyBucket() != ACTIVE_INDEX - && job.getEffectiveStandbyBucket() != EXEMPTED_INDEX - && !batchDelayExpired; + final long timeUntilDeadlineMs = job.hasDeadlineConstraint() + ? job.getLatestRunTimeElapsed() - nowElapsed + : Long.MAX_VALUE; + // Differentiate behavior based on whether the job needs network or not. + if (Flags.batchConnectivityJobsPerNetwork() + && job.hasConnectivityConstraint()) { + // For connectivity jobs, let them run immediately if the network is already + // active (in a state for job run), otherwise, only run them if there are + // enough to meet the batching requirement or the job has been waiting + // long enough. + final boolean batchDelayExpired = + job.getFirstForceBatchedTimeElapsed() > 0 + && nowElapsed - job.getFirstForceBatchedTimeElapsed() + >= mConstants.CONN_MAX_CONNECTIVITY_JOB_BATCH_DELAY_MS; + shouldForceBatchJob = !batchDelayExpired + && job.getEffectiveStandbyBucket() != EXEMPTED_INDEX + && timeUntilDeadlineMs + > mConstants.CONN_MAX_CONNECTIVITY_JOB_BATCH_DELAY_MS / 2 + && !mConnectivityController.isNetworkInStateForJobRunLocked(job); + } else { + final boolean batchDelayExpired; + final boolean batchingEnabled; + if (Flags.batchActiveBucketJobs()) { + batchingEnabled = mConstants.MIN_READY_CPU_ONLY_JOBS_COUNT > 1 + && timeUntilDeadlineMs + > mConstants.MAX_CPU_ONLY_JOB_BATCH_DELAY_MS / 2 + // Active UIDs' jobs were by default treated as in the ACTIVE + // bucket, so we must explicitly exclude them when batching + // ACTIVE jobs. + && !job.uidActive + && !job.getJob().isExemptedFromAppStandby(); + batchDelayExpired = job.getFirstForceBatchedTimeElapsed() > 0 + && nowElapsed - job.getFirstForceBatchedTimeElapsed() + >= mConstants.MAX_CPU_ONLY_JOB_BATCH_DELAY_MS; + } else { + batchingEnabled = mConstants.MIN_READY_NON_ACTIVE_JOBS_COUNT > 1 + && job.getEffectiveStandbyBucket() != ACTIVE_INDEX; + batchDelayExpired = job.getFirstForceBatchedTimeElapsed() > 0 + && nowElapsed - job.getFirstForceBatchedTimeElapsed() + >= mConstants.MAX_NON_ACTIVE_JOB_BATCH_DELAY_MS; + } + shouldForceBatchJob = batchingEnabled + && job.getEffectiveStandbyBucket() != EXEMPTED_INDEX + && !batchDelayExpired; + } + } + + // If connectivity job batching isn't enabled, treat every job as + // a non-connectivity job since that mimics the old behavior. + final Network network = + Flags.batchConnectivityJobsPerNetwork() ? job.network : null; + ArraySet batch = mBatches.get(network); + if (batch == null) { + batch = new ArraySet<>(); + mBatches.put(network, batch); } + batch.add(job); if (shouldForceBatchJob) { - // Force batching non-ACTIVE jobs. Don't include them in the other counts. - forceBatchedCount++; if (job.getFirstForceBatchedTimeElapsed() == 0) { job.setFirstForceBatchedTimeElapsed(sElapsedRealtimeClock.millis()); } } else { - unbatchedCount++; + mUnbatchedJobCount.put(network, + mUnbatchedJobCount.getOrDefault(job.network, 0) + 1); } if (!isRunning) { runnableJobs.add(job); + if (!shouldForceBatchJob) { + mUnbatchedJobs.add(job); + } } } else { if (isRunning) { @@ -3572,34 +3818,135 @@ public class JobSchedulerService extends com.android.server.SystemService @GuardedBy("mLock") @VisibleForTesting void postProcessLocked() { - if (unbatchedCount > 0 - || forceBatchedCount >= mConstants.MIN_READY_NON_ACTIVE_JOBS_COUNT) { + final ArraySet jobsToRun = mUnbatchedJobs; + + if (DEBUG) { + Slog.d(TAG, "maybeQueueReadyJobsForExecutionLocked: " + + mUnbatchedJobs.size() + " unbatched jobs."); + } + + int unbatchedCount = 0; + + for (int n = mBatches.size() - 1; n >= 0; --n) { + final Network network = mBatches.keyAt(n); + + // Count all of the unbatched jobs, including the ones without a network. + final Integer unbatchedJobCountObj = mUnbatchedJobCount.get(network); + final int unbatchedJobCount; + if (unbatchedJobCountObj != null) { + unbatchedJobCount = unbatchedJobCountObj; + unbatchedCount += unbatchedJobCount; + } else { + unbatchedJobCount = 0; + } + + // Skip the non-networked jobs here. They'll be handled after evaluating + // everything else. + if (network == null) { + continue; + } + + final ArraySet batchedJobs = mBatches.valueAt(n); + if (unbatchedJobCount > 0) { + // Some job is going to activate the network anyway. Might as well run all + // the other jobs that will use this network. + if (DEBUG) { + Slog.d(TAG, "maybeQueueReadyJobsForExecutionLocked: piggybacking " + + (batchedJobs.size() - unbatchedJobCount) + " jobs on " + network + + " because of unbatched job"); + } + jobsToRun.addAll(batchedJobs); + continue; + } + + final NetworkCapabilities networkCapabilities = + mConnectivityController.getNetworkCapabilities(network); + if (networkCapabilities == null) { + Slog.e(TAG, "Couldn't get NetworkCapabilities for network " + network); + continue; + } + + final int[] transports = networkCapabilities.getTransportTypes(); + int maxNetworkBatchReq = 1; + for (int transport : transports) { + maxNetworkBatchReq = Math.max(maxNetworkBatchReq, + mConstants.CONN_TRANSPORT_BATCH_THRESHOLD.get(transport)); + } + + if (batchedJobs.size() >= maxNetworkBatchReq) { + if (DEBUG) { + Slog.d(TAG, "maybeQueueReadyJobsForExecutionLocked: " + + batchedJobs.size() + + " batched network jobs meet requirement for " + network); + } + jobsToRun.addAll(batchedJobs); + } + } + + final ArraySet batchedNonNetworkedJobs = mBatches.get(null); + if (batchedNonNetworkedJobs != null) { + final int minReadyCount = Flags.batchActiveBucketJobs() + ? mConstants.MIN_READY_CPU_ONLY_JOBS_COUNT + : mConstants.MIN_READY_NON_ACTIVE_JOBS_COUNT; + if (jobsToRun.size() > 0) { + // Some job is going to use the CPU anyway. Might as well run all the other + // CPU-only jobs. + if (DEBUG) { + final Integer unbatchedJobCountObj = mUnbatchedJobCount.get(null); + final int unbatchedJobCount = + unbatchedJobCountObj == null ? 0 : unbatchedJobCountObj; + Slog.d(TAG, "maybeQueueReadyJobsForExecutionLocked: piggybacking " + + (batchedNonNetworkedJobs.size() - unbatchedJobCount) + + " non-network jobs"); + } + jobsToRun.addAll(batchedNonNetworkedJobs); + } else if (batchedNonNetworkedJobs.size() >= minReadyCount) { + if (DEBUG) { + Slog.d(TAG, "maybeQueueReadyJobsForExecutionLocked: adding " + + batchedNonNetworkedJobs.size() + " batched non-network jobs."); + } + jobsToRun.addAll(batchedNonNetworkedJobs); + } + } + + // In order to properly determine an accurate batch count, the running jobs must be + // included in the earlier lists and can only be removed after checking if the batch + // count requirement is satisfied. + jobsToRun.removeIf(JobSchedulerService.this::isCurrentlyRunningLocked); + + if (unbatchedCount > 0 || jobsToRun.size() > 0) { if (DEBUG) { - Slog.d(TAG, "maybeQueueReadyJobsForExecutionLocked: Running jobs."); + Slog.d(TAG, "maybeQueueReadyJobsForExecutionLocked: Running " + + jobsToRun + " jobs."); } - noteJobsPending(runnableJobs); - mPendingJobQueue.addAll(runnableJobs); + noteJobsPending(jobsToRun); + mPendingJobQueue.addAll(jobsToRun); } else { if (DEBUG) { Slog.d(TAG, "maybeQueueReadyJobsForExecutionLocked: Not running anything."); } - final int numRunnableJobs = runnableJobs.size(); - if (numRunnableJobs > 0) { - synchronized (mPendingJobReasonCache) { - for (int i = 0; i < numRunnableJobs; ++i) { - final JobStatus job = runnableJobs.get(i); - SparseIntArray reasons = - mPendingJobReasonCache.get(job.getUid(), job.getNamespace()); - if (reasons == null) { - reasons = new SparseIntArray(); - mPendingJobReasonCache - .add(job.getUid(), job.getNamespace(), reasons); - } - // We're force batching these jobs, so consider it an optimization - // policy reason. - reasons.put(job.getJobId(), - JobScheduler.PENDING_JOB_REASON_JOB_SCHEDULER_OPTIMIZATION); + } + + // Update the pending reason for any jobs that aren't going to be run. + final int numRunnableJobs = runnableJobs.size(); + if (numRunnableJobs > 0 && numRunnableJobs != jobsToRun.size()) { + synchronized (mPendingJobReasonCache) { + for (int i = 0; i < numRunnableJobs; ++i) { + final JobStatus job = runnableJobs.get(i); + if (jobsToRun.contains(job)) { + // We're running this job. Skip updating the pending reason. + continue; } + SparseIntArray reasons = + mPendingJobReasonCache.get(job.getUid(), job.getNamespace()); + if (reasons == null) { + reasons = new SparseIntArray(); + mPendingJobReasonCache.add(job.getUid(), job.getNamespace(), reasons); + } + // We're force batching these jobs, so consider it an optimization + // policy reason. + reasons.put(job.getJobId(), + JobScheduler.PENDING_JOB_REASON_JOB_SCHEDULER_OPTIMIZATION); } } } @@ -3610,9 +3957,10 @@ public class JobSchedulerService extends com.android.server.SystemService @VisibleForTesting void reset() { - forceBatchedCount = 0; - unbatchedCount = 0; runnableJobs.clear(); + mBatches.clear(); + mUnbatchedJobs.clear(); + mUnbatchedJobCount.clear(); } } @@ -3948,20 +4296,34 @@ public class JobSchedulerService extends com.android.server.SystemService .sendToTarget(); } - private final class BatteryStateTracker extends BroadcastReceiver { + @VisibleForTesting + final class BatteryStateTracker extends BroadcastReceiver + implements BatteryManagerInternal.ChargingPolicyChangeListener { + private final BatteryManagerInternal mBatteryManagerInternal; + + /** Last reported battery level. */ + private int mBatteryLevel; + /** Keep track of whether the battery is charged enough that we want to do work. */ + private boolean mBatteryNotLow; /** - * Track whether we're "charging", where charging means that we're ready to commit to - * doing work. + * Charging status based on {@link BatteryManager#ACTION_CHARGING} and + * {@link BatteryManager#ACTION_DISCHARGING}. */ private boolean mCharging; - /** Keep track of whether the battery is charged enough that we want to do work. */ - private boolean mBatteryNotLow; + /** + * The most recently acquired value of + * {@link BatteryManager#BATTERY_PROPERTY_CHARGING_POLICY}. + */ + private int mChargingPolicy; + /** Track whether there is power connected. It doesn't mean the device is charging. */ + private boolean mPowerConnected; /** Sequence number of last broadcast. */ private int mLastBatterySeq = -1; private BroadcastReceiver mMonitor; BatteryStateTracker() { + mBatteryManagerInternal = LocalServices.getService(BatteryManagerInternal.class); } public void startTracking() { @@ -3973,13 +4335,18 @@ public class JobSchedulerService extends com.android.server.SystemService // Charging/not charging. filter.addAction(BatteryManager.ACTION_CHARGING); filter.addAction(BatteryManager.ACTION_DISCHARGING); + filter.addAction(Intent.ACTION_BATTERY_LEVEL_CHANGED); + filter.addAction(Intent.ACTION_POWER_CONNECTED); + filter.addAction(Intent.ACTION_POWER_DISCONNECTED); getTestableContext().registerReceiver(this, filter); + mBatteryManagerInternal.registerChargingPolicyChangeListener(this); + // Initialise tracker state. - BatteryManagerInternal batteryManagerInternal = - LocalServices.getService(BatteryManagerInternal.class); - mBatteryNotLow = !batteryManagerInternal.getBatteryLevelLow(); - mCharging = batteryManagerInternal.isPowered(BatteryManager.BATTERY_PLUGGED_ANY); + mBatteryLevel = mBatteryManagerInternal.getBatteryLevel(); + mBatteryNotLow = !mBatteryManagerInternal.getBatteryLevelLow(); + mCharging = mBatteryManagerInternal.isPowered(BatteryManager.BATTERY_PLUGGED_ANY); + mChargingPolicy = mBatteryManagerInternal.getChargingPolicy(); } public void setMonitorBatteryLocked(boolean enabled) { @@ -4002,7 +4369,7 @@ public class JobSchedulerService extends com.android.server.SystemService } public boolean isCharging() { - return mCharging; + return isConsideredCharging(); } public boolean isBatteryNotLow() { @@ -4013,17 +4380,42 @@ public class JobSchedulerService extends com.android.server.SystemService return mMonitor != null; } + public boolean isPowerConnected() { + return mPowerConnected; + } + public int getSeq() { return mLastBatterySeq; } + @Override + public void onChargingPolicyChanged(int newPolicy) { + synchronized (mLock) { + if (mChargingPolicy == newPolicy) { + return; + } + if (DEBUG) { + Slog.i(TAG, + "Charging policy changed from " + mChargingPolicy + " to " + newPolicy); + } + + final boolean wasConsideredCharging = isConsideredCharging(); + mChargingPolicy = newPolicy; + + if (isConsideredCharging() != wasConsideredCharging) { + for (int c = mControllers.size() - 1; c >= 0; --c) { + mControllers.get(c).onBatteryStateChangedLocked(); + } + } + } + } + @Override public void onReceive(Context context, Intent intent) { onReceiveInternal(intent); } - @VisibleForTesting - public void onReceiveInternal(Intent intent) { + private void onReceiveInternal(Intent intent) { synchronized (mLock) { final String action = intent.getAction(); boolean changed = false; @@ -4043,21 +4435,49 @@ public class JobSchedulerService extends com.android.server.SystemService mBatteryNotLow = true; changed = true; } + } else if (Intent.ACTION_BATTERY_LEVEL_CHANGED.equals(action)) { + if (DEBUG) { + Slog.d(TAG, "Battery level changed @ " + + sElapsedRealtimeClock.millis()); + } + final boolean wasConsideredCharging = isConsideredCharging(); + mBatteryLevel = mBatteryManagerInternal.getBatteryLevel(); + changed = isConsideredCharging() != wasConsideredCharging; + } else if (Intent.ACTION_POWER_CONNECTED.equals(action)) { + if (DEBUG) { + Slog.d(TAG, "Power connected @ " + sElapsedRealtimeClock.millis()); + } + if (mPowerConnected) { + return; + } + mPowerConnected = true; + changed = true; + } else if (Intent.ACTION_POWER_DISCONNECTED.equals(action)) { + if (DEBUG) { + Slog.d(TAG, "Power disconnected @ " + sElapsedRealtimeClock.millis()); + } + if (!mPowerConnected) { + return; + } + mPowerConnected = false; + changed = true; } else if (BatteryManager.ACTION_CHARGING.equals(action)) { if (DEBUG) { Slog.d(TAG, "Battery charging @ " + sElapsedRealtimeClock.millis()); } if (!mCharging) { + final boolean wasConsideredCharging = isConsideredCharging(); mCharging = true; - changed = true; + changed = isConsideredCharging() != wasConsideredCharging; } } else if (BatteryManager.ACTION_DISCHARGING.equals(action)) { if (DEBUG) { Slog.d(TAG, "Battery discharging @ " + sElapsedRealtimeClock.millis()); } if (mCharging) { + final boolean wasConsideredCharging = isConsideredCharging(); mCharging = false; - changed = true; + changed = isConsideredCharging() != wasConsideredCharging; } } mLastBatterySeq = @@ -4069,6 +4489,30 @@ public class JobSchedulerService extends com.android.server.SystemService } } } + + private boolean isConsideredCharging() { + if (mCharging) { + return true; + } + // BatteryService (or Health HAL or whatever central location makes sense) + // should ideally hold this logic so that everyone has a consistent + // idea of when the device is charging (or an otherwise stable charging/plugged state). + // TODO(304512874): move this determination to BatteryService + if (!mPowerConnected) { + return false; + } + + if (mChargingPolicy == Integer.MIN_VALUE) { + // Property not supported on this device. + return false; + } + // Adaptive charging policies don't expose their target battery level, but 80% is a + // commonly used threshold for battery health, so assume that's what's being used by + // the policies and use 70%+ as the threshold here for charging in case some + // implementations choose to discharge the device slightly before recharging back up + // to the target level. + return mBatteryLevel >= 70 && BatteryManager.isAdaptiveChargingPolicy(mChargingPolicy); + } } final class LocalService implements JobSchedulerInternal { @@ -4168,6 +4612,11 @@ public class JobSchedulerService extends com.android.server.SystemService notificationChannel, userId, packageName); } + @Override + public boolean hasRunBackupJobsPermission(@NonNull String packageName, int packageUid) { + return JobSchedulerService.this.hasRunBackupJobsPermission(packageName, packageUid); + } + @Override public JobStorePersistStats getPersistStats() { synchronized (mLock) { @@ -4330,6 +4779,22 @@ public class JobSchedulerService extends com.android.server.SystemService } } + /** + * Returns whether the app holds the {@link Manifest.permission.RUN_BACKUP_JOBS} permission. + */ + private boolean hasRunBackupJobsPermission(@NonNull String packageName, int packageUid) { + if (packageName == null) { + Slog.wtfStack(TAG, + "Expected a non-null package name when calling hasRunBackupJobsPermission"); + return false; + } + + return PermissionChecker.checkPermissionForPreflight(getTestableContext(), + android.Manifest.permission.RUN_BACKUP_JOBS, + PermissionChecker.PID_UNKNOWN, packageUid, packageName) + == PermissionChecker.PERMISSION_GRANTED; + } + /** * Binder stub trampoline implementation */ @@ -4381,8 +4846,7 @@ public class JobSchedulerService extends com.android.server.SystemService private JobInfo enforceBuilderApiPermissions(int uid, int pid, JobInfo job) { if (job.getBias() != JobInfo.BIAS_DEFAULT && !hasPermission(uid, pid, Manifest.permission.UPDATE_DEVICE_STATS)) { - if (CompatChanges.isChangeEnabled(THROW_ON_UNSUPPORTED_BIAS_USAGE, uid) - && Flags.throwOnUnsupportedBiasUsage()) { + if (CompatChanges.isChangeEnabled(THROW_ON_UNSUPPORTED_BIAS_USAGE, uid)) { throw new SecurityException("Apps may not call setBias()"); } else { // We can't throw the exception. Log the issue and modify the job to remove @@ -4390,7 +4854,7 @@ public class JobSchedulerService extends com.android.server.SystemService Slog.w(TAG, "Uid " + uid + " set bias on its job"); return new JobInfo.Builder(job) .setBias(JobInfo.BIAS_DEFAULT) - .build(false, false, false); + .build(false, false, false, false); } } @@ -4414,7 +4878,9 @@ public class JobSchedulerService extends com.android.server.SystemService JobInfo.DISALLOW_DEADLINES_FOR_PREFETCH_JOBS, callingUid), rejectNegativeNetworkEstimates, CompatChanges.isChangeEnabled( - JobInfo.ENFORCE_MINIMUM_TIME_WINDOWS, callingUid)); + JobInfo.ENFORCE_MINIMUM_TIME_WINDOWS, callingUid), + CompatChanges.isChangeEnabled( + JobInfo.REJECT_NEGATIVE_DELAYS_AND_DEADLINES, callingUid)); if ((job.getFlags() & JobInfo.FLAG_WILL_BE_FOREGROUND) != 0) { getContext().enforceCallingOrSelfPermission( android.Manifest.permission.CONNECTIVITY_INTERNAL, TAG); @@ -4946,6 +5412,8 @@ public class JobSchedulerService extends com.android.server.SystemService Slog.d(TAG, "executeRunCommand(): " + pkgName + "/" + namespace + "/" + userId + " " + jobId + " s=" + satisfied + " f=" + force); + final CountDownLatch delayLatch = new CountDownLatch(1); + final JobStatus js; try { final int uid = AppGlobals.getPackageManager().getPackageUid(pkgName, 0, userId != UserHandle.USER_ALL ? userId : UserHandle.USER_SYSTEM); @@ -4954,7 +5422,7 @@ public class JobSchedulerService extends com.android.server.SystemService } synchronized (mLock) { - final JobStatus js = mJobs.getJobByUidAndJobId(uid, namespace, jobId); + js = mJobs.getJobByUidAndJobId(uid, namespace, jobId); if (js == null) { return JobSchedulerShellCommand.CMD_ERR_NO_JOB; } @@ -4965,23 +5433,71 @@ public class JobSchedulerService extends com.android.server.SystemService // Re-evaluate constraints after the override is set in case one of the overridden // constraints was preventing another constraint from thinking it needed to update. for (int c = mControllers.size() - 1; c >= 0; --c) { - mControllers.get(c).reevaluateStateLocked(uid); + mControllers.get(c).evaluateStateLocked(js); } if (!js.isConstraintsSatisfied()) { - js.overrideState = JobStatus.OVERRIDE_NONE; - return JobSchedulerShellCommand.CMD_ERR_CONSTRAINTS; + if (js.hasConnectivityConstraint() + && !js.isConstraintSatisfied(JobStatus.CONSTRAINT_CONNECTIVITY) + && js.wouldBeReadyWithConstraint(JobStatus.CONSTRAINT_CONNECTIVITY)) { + // Because of how asynchronous the connectivity signals are, JobScheduler + // may not get the connectivity satisfaction signal immediately. In this + // case, wait a few seconds to see if it comes in before saying the + // connectivity constraint isn't satisfied. + mHandler.postDelayed( + checkConstraintRunnableForTesting( + mHandler, js, delayLatch, 5, 1000), + 1000); + } else { + // There's no asynchronous signal to wait for. We can immediately say the + // job's constraints aren't satisfied and return. + js.overrideState = JobStatus.OVERRIDE_NONE; + return JobSchedulerShellCommand.CMD_ERR_CONSTRAINTS; + } + } else { + delayLatch.countDown(); } - - queueReadyJobsForExecutionLocked(); - maybeRunPendingJobsLocked(); } } catch (RemoteException e) { // can't happen + return 0; + } + + // Choose to block the return until we're sure about the state of the connectivity job + // so that tests can expect a reliable state after calling the run command. + try { + delayLatch.await(7L, TimeUnit.SECONDS); + } catch (InterruptedException e) { + Slog.e(TAG, "Couldn't wait for asynchronous constraint change", e); + } + + synchronized (mLock) { + if (!js.isConstraintsSatisfied()) { + js.overrideState = JobStatus.OVERRIDE_NONE; + return JobSchedulerShellCommand.CMD_ERR_CONSTRAINTS; + } + + queueReadyJobsForExecutionLocked(); + maybeRunPendingJobsLocked(); } return 0; } + private static Runnable checkConstraintRunnableForTesting(@NonNull final Handler handler, + @NonNull final JobStatus js, @NonNull final CountDownLatch latch, + final int remainingAttempts, final long delayMs) { + return () -> { + if (remainingAttempts <= 0 || js.isConstraintsSatisfied()) { + latch.countDown(); + return; + } + handler.postDelayed( + checkConstraintRunnableForTesting( + handler, js, latch, remainingAttempts - 1, delayMs), + delayMs); + }; + } + // Shell command infrastructure: immediately timeout currently executing jobs int executeStopCommand(PrintWriter pw, String pkgName, int userId, @Nullable String namespace, boolean hasJobId, int jobId, @@ -5066,6 +5582,25 @@ public class JobSchedulerService extends com.android.server.SystemService } } + /** Return {@code true} if the device is connected to power. */ + public boolean isPowerConnected() { + synchronized (mLock) { + return mBatteryStateTracker.isPowerConnected(); + } + } + + void setCacheConfigChanges(boolean enabled) { + synchronized (mLock) { + mConstantsObserver.setCacheConfigChangesLocked(enabled); + } + } + + String getConfigValue(String key) { + synchronized (mLock) { + return mConstantsObserver.getValueLocked(key); + } + } + int getStorageSeq() { synchronized (mLock) { return mStorageController.getTracker().getSeq(); @@ -5369,8 +5904,16 @@ public class JobSchedulerService extends com.android.server.SystemService pw.println("Aconfig flags:"); pw.increaseIndent(); - pw.print(Flags.FLAG_THROW_ON_UNSUPPORTED_BIAS_USAGE, - Flags.throwOnUnsupportedBiasUsage()); + pw.print(Flags.FLAG_BATCH_ACTIVE_BUCKET_JOBS, Flags.batchActiveBucketJobs()); + pw.println(); + pw.print(Flags.FLAG_BATCH_CONNECTIVITY_JOBS_PER_NETWORK, + Flags.batchConnectivityJobsPerNetwork()); + pw.println(); + pw.print(Flags.FLAG_DO_NOT_FORCE_RUSH_EXECUTION_AT_BOOT, + Flags.doNotForceRushExecutionAtBoot()); + pw.println(); + pw.print(android.app.job.Flags.FLAG_BACKUP_JOBS_EXEMPTION, + android.app.job.Flags.backupJobsExemption()); pw.println(); pw.decreaseIndent(); pw.println(); @@ -5383,8 +5926,14 @@ public class JobSchedulerService extends com.android.server.SystemService mQuotaTracker.dump(pw); pw.println(); + pw.print("Power connected: "); + pw.println(mBatteryStateTracker.isPowerConnected()); pw.print("Battery charging: "); - pw.println(mBatteryStateTracker.isCharging()); + pw.println(mBatteryStateTracker.mCharging); + pw.print("Considered charging: "); + pw.println(mBatteryStateTracker.isConsideredCharging()); + pw.print("Battery level: "); + pw.println(mBatteryStateTracker.mBatteryLevel); pw.print("Battery not low: "); pw.println(mBatteryStateTracker.isBatteryNotLow()); if (mBatteryStateTracker.isMonitoring()) { diff --git a/apex/jobscheduler/service/java/com/android/server/job/JobSchedulerShellCommand.java b/apex/jobscheduler/service/java/com/android/server/job/JobSchedulerShellCommand.java index c14efae3fa6273ce1bc21413dec3dafa913789f8..af7b27e51e200c3f614f10134a9b6d1705b8235d 100644 --- a/apex/jobscheduler/service/java/com/android/server/job/JobSchedulerShellCommand.java +++ b/apex/jobscheduler/service/java/com/android/server/job/JobSchedulerShellCommand.java @@ -16,6 +16,7 @@ package com.android.server.job; +import android.Manifest; import android.annotation.Nullable; import android.app.ActivityManager; import android.app.AppGlobals; @@ -66,6 +67,8 @@ public final class JobSchedulerShellCommand extends BasicShellCommandHandler { return getBatteryCharging(pw); case "get-battery-not-low": return getBatteryNotLow(pw); + case "get-config-value": + return getConfigValue(pw); case "get-estimated-download-bytes": return getEstimatedNetworkBytes(pw, BYTE_OPTION_DOWNLOAD); case "get-estimated-upload-bytes": @@ -82,6 +85,8 @@ public final class JobSchedulerShellCommand extends BasicShellCommandHandler { return getJobState(pw); case "heartbeat": return doHeartbeat(pw); + case "cache-config-changes": + return cacheConfigChanges(pw); case "reset-execution-quota": return resetExecutionQuota(pw); case "reset-schedule-quota": @@ -100,13 +105,16 @@ public final class JobSchedulerShellCommand extends BasicShellCommandHandler { } private void checkPermission(String operation) throws Exception { + checkPermission(operation, Manifest.permission.CHANGE_APP_IDLE_STATE); + } + + private void checkPermission(String operation, String permission) throws Exception { final int uid = Binder.getCallingUid(); if (uid == 0) { // Root can do anything. return; } - final int perm = mPM.checkUidPermission( - "android.permission.CHANGE_APP_IDLE_STATE", uid); + final int perm = mPM.checkUidPermission(permission, uid); if (perm != PackageManager.PERMISSION_GRANTED) { throw new SecurityException("Uid " + uid + " not permitted to " + operation); @@ -339,19 +347,28 @@ public final class JobSchedulerShellCommand extends BasicShellCommandHandler { } private int getAconfigFlagState(PrintWriter pw) throws Exception { - checkPermission("get aconfig flag state"); + checkPermission("get aconfig flag state", Manifest.permission.DUMP); final String flagName = getNextArgRequired(); switch (flagName) { + case android.app.job.Flags.FLAG_ENFORCE_MINIMUM_TIME_WINDOWS: + pw.println(android.app.job.Flags.enforceMinimumTimeWindows()); + break; case android.app.job.Flags.FLAG_JOB_DEBUG_INFO_APIS: pw.println(android.app.job.Flags.jobDebugInfoApis()); break; - case android.app.job.Flags.FLAG_ENFORCE_MINIMUM_TIME_WINDOWS: - pw.println(android.app.job.Flags.enforceMinimumTimeWindows()); + case com.android.server.job.Flags.FLAG_BATCH_ACTIVE_BUCKET_JOBS: + pw.println(com.android.server.job.Flags.batchActiveBucketJobs()); + break; + case com.android.server.job.Flags.FLAG_BATCH_CONNECTIVITY_JOBS_PER_NETWORK: + pw.println(com.android.server.job.Flags.batchConnectivityJobsPerNetwork()); + break; + case com.android.server.job.Flags.FLAG_DO_NOT_FORCE_RUSH_EXECUTION_AT_BOOT: + pw.println(com.android.server.job.Flags.doNotForceRushExecutionAtBoot()); break; - case com.android.server.job.Flags.FLAG_THROW_ON_UNSUPPORTED_BIAS_USAGE: - pw.println(com.android.server.job.Flags.throwOnUnsupportedBiasUsage()); + case android.app.job.Flags.FLAG_BACKUP_JOBS_EXEMPTION: + pw.println(android.app.job.Flags.backupJobsExemption()); break; default: pw.println("Unknown flag: " + flagName); @@ -378,6 +395,20 @@ public final class JobSchedulerShellCommand extends BasicShellCommandHandler { return 0; } + private int getConfigValue(PrintWriter pw) throws Exception { + checkPermission("get device config value", Manifest.permission.DUMP); + + final String key = getNextArgRequired(); + + final long ident = Binder.clearCallingIdentity(); + try { + pw.println(mInternal.getConfigValue(key)); + return 0; + } finally { + Binder.restoreCallingIdentity(ident); + } + } + private int getEstimatedNetworkBytes(PrintWriter pw, int byteOption) throws Exception { checkPermission("get estimated bytes"); @@ -528,6 +559,28 @@ public final class JobSchedulerShellCommand extends BasicShellCommandHandler { return -1; } + private int cacheConfigChanges(PrintWriter pw) throws Exception { + checkPermission("change config caching", Manifest.permission.DUMP); + String opt = getNextArgRequired(); + boolean enabled; + if ("on".equals(opt)) { + enabled = true; + } else if ("off".equals(opt)) { + enabled = false; + } else { + getErrPrintWriter().println("Error: unknown option " + opt); + return 1; + } + final long ident = Binder.clearCallingIdentity(); + try { + mInternal.setCacheConfigChanges(enabled); + pw.println("Config caching " + (enabled ? "enabled" : "disabled")); + } finally { + Binder.restoreCallingIdentity(ident); + } + return 0; + } + private int resetExecutionQuota(PrintWriter pw) throws Exception { checkPermission("reset execution quota"); @@ -714,6 +767,9 @@ public final class JobSchedulerShellCommand extends BasicShellCommandHandler { pw.println(" is null (no namespace)."); pw.println(" heartbeat [num]"); pw.println(" No longer used."); + pw.println(" cache-config-changes [on|off]"); + pw.println(" Control caching the set of most recently processed config flags."); + pw.println(" Off by default. Turning on makes get-config-value useful."); pw.println(" monitor-battery [on|off]"); pw.println(" Control monitoring of all battery changes. Off by default. Turning"); pw.println(" on makes get-battery-seq useful."); @@ -726,6 +782,9 @@ public final class JobSchedulerShellCommand extends BasicShellCommandHandler { pw.println(" Return whether the battery is currently considered to be charging."); pw.println(" get-battery-not-low"); pw.println(" Return whether the battery is currently considered to not be low."); + pw.println(" get-config-value KEY"); + pw.println(" Return the most recently processed and cached config value for the KEY."); + pw.println(" Only useful if caching is turned on with cache-config-changes."); pw.println(" get-estimated-download-bytes [-u | --user USER_ID]" + " [-n | --namespace NAMESPACE] PACKAGE JOB_ID"); pw.println(" Return the most recent estimated download bytes for the job."); diff --git a/apex/jobscheduler/service/java/com/android/server/job/JobServiceContext.java b/apex/jobscheduler/service/java/com/android/server/job/JobServiceContext.java index 6449edcd3103c35c275c4d308b69621d64096134..8ab7d2fae49f54af28116d7066ea030d9c1eb18f 100644 --- a/apex/jobscheduler/service/java/com/android/server/job/JobServiceContext.java +++ b/apex/jobscheduler/service/java/com/android/server/job/JobServiceContext.java @@ -534,7 +534,16 @@ public final class JobServiceContext implements ServiceConnection { /* system_measured_source_download_bytes */ 0, /* system_measured_source_upload_bytes */ 0, /* system_measured_calling_download_bytes */ 0, - /* system_measured_calling_upload_bytes */ 0); + /* system_measured_calling_upload_bytes */ 0, + job.getJob().getIntervalMillis(), + job.getJob().getFlexMillis(), + job.hasFlexibilityConstraint(), + job.isConstraintSatisfied(JobStatus.CONSTRAINT_FLEXIBLE), + job.canApplyTransportAffinities(), + job.getNumAppliedFlexibleConstraints(), + job.getNumDroppedFlexibleConstraints(), + job.getFilteredTraceTag(), + job.getFilteredDebugTags()); sEnqueuedJwiAtJobStart.logSampleWithUid(job.getUid(), job.getWorkCount()); final String sourcePackage = job.getSourcePackageName(); if (Trace.isTagEnabled(Trace.TRACE_TAG_SYSTEM_SERVER)) { @@ -1616,7 +1625,16 @@ public final class JobServiceContext implements ServiceConnection { TrafficStats.getUidRxBytes(completedJob.getUid()) - mInitialDownloadedBytesFromCalling, TrafficStats.getUidTxBytes(completedJob.getUid()) - - mInitialUploadedBytesFromCalling); + - mInitialUploadedBytesFromCalling, + completedJob.getJob().getIntervalMillis(), + completedJob.getJob().getFlexMillis(), + completedJob.hasFlexibilityConstraint(), + completedJob.isConstraintSatisfied(JobStatus.CONSTRAINT_FLEXIBLE), + completedJob.canApplyTransportAffinities(), + completedJob.getNumAppliedFlexibleConstraints(), + completedJob.getNumDroppedFlexibleConstraints(), + completedJob.getFilteredTraceTag(), + completedJob.getFilteredDebugTags()); if (Trace.isTagEnabled(Trace.TRACE_TAG_SYSTEM_SERVER)) { Trace.asyncTraceForTrackEnd(Trace.TRACE_TAG_SYSTEM_SERVER, "JobScheduler", getId()); diff --git a/apex/jobscheduler/service/java/com/android/server/job/JobStore.java b/apex/jobscheduler/service/java/com/android/server/job/JobStore.java index 53b14d616ecc663479ebb2d9433690e7865a4dcd..d8934d8f83b818ca1be2a524f8acae5ffda09bcd 100644 --- a/apex/jobscheduler/service/java/com/android/server/job/JobStore.java +++ b/apex/jobscheduler/service/java/com/android/server/job/JobStore.java @@ -1495,7 +1495,7 @@ public final class JobStore { // return value), the deadline is dropped. Periodic jobs require all constraints // to be met, so there's no issue with their deadlines. // The same logic applies for other target SDK-based validation checks. - builtJob = jobBuilder.build(false, false, false); + builtJob = jobBuilder.build(false, false, false, false); } catch (Exception e) { Slog.w(TAG, "Unable to build job from XML, ignoring: " + jobBuilder.summarize(), e); return null; diff --git a/apex/jobscheduler/service/java/com/android/server/job/PendingJobQueue.java b/apex/jobscheduler/service/java/com/android/server/job/PendingJobQueue.java index 4f4096f69ad5e19258b789a5f5003b5ea50f2918..813cf8710ab1bb0c438a3a2499504d76d2a21041 100644 --- a/apex/jobscheduler/service/java/com/android/server/job/PendingJobQueue.java +++ b/apex/jobscheduler/service/java/com/android/server/job/PendingJobQueue.java @@ -18,6 +18,7 @@ package com.android.server.job; import android.annotation.NonNull; import android.annotation.Nullable; +import android.util.ArraySet; import android.util.Pools; import android.util.SparseArray; @@ -96,10 +97,10 @@ class PendingJobQueue { } } - void addAll(@NonNull List jobs) { + void addAll(@NonNull ArraySet jobs) { final SparseArray> jobsByUid = new SparseArray<>(); for (int i = jobs.size() - 1; i >= 0; --i) { - final JobStatus job = jobs.get(i); + final JobStatus job = jobs.valueAt(i); List appJobs = jobsByUid.get(job.getSourceUid()); if (appJobs == null) { appJobs = new ArrayList<>(); diff --git a/apex/jobscheduler/service/java/com/android/server/job/controllers/BackgroundJobsController.java b/apex/jobscheduler/service/java/com/android/server/job/controllers/BackgroundJobsController.java index e3ba50dc635b97c9ec8b6921e3181a699ded959a..e3ac780abf09975cf707fbf5a1e5dac2e2b25216 100644 --- a/apex/jobscheduler/service/java/com/android/server/job/controllers/BackgroundJobsController.java +++ b/apex/jobscheduler/service/java/com/android/server/job/controllers/BackgroundJobsController.java @@ -318,6 +318,10 @@ public final class BackgroundJobsController extends StateController { try { final boolean isStopped = mPackageManagerInternal.isPackageStopped(packageName, uid); + if (DEBUG) { + Slog.d(TAG, + "Pulled stopped state of " + packageName + " (" + uid + "): " + isStopped); + } mPackageStoppedState.add(uid, packageName, isStopped); return isStopped; } catch (PackageManager.NameNotFoundException e) { diff --git a/apex/jobscheduler/service/java/com/android/server/job/controllers/BatteryController.java b/apex/jobscheduler/service/java/com/android/server/job/controllers/BatteryController.java index ddbc2ecf5e3e387bf0b224c7893c08ac10fb1d0f..e9f9b14daed35b388f3fe9b44b5efbd781951bf9 100644 --- a/apex/jobscheduler/service/java/com/android/server/job/controllers/BatteryController.java +++ b/apex/jobscheduler/service/java/com/android/server/job/controllers/BatteryController.java @@ -20,12 +20,6 @@ import static com.android.server.job.JobSchedulerService.sElapsedRealtimeClock; import android.annotation.NonNull; import android.app.job.JobInfo; -import android.content.BroadcastReceiver; -import android.content.Context; -import android.content.Intent; -import android.content.IntentFilter; -import android.os.BatteryManager; -import android.os.BatteryManagerInternal; import android.os.UserHandle; import android.util.ArraySet; import android.util.IndentingPrintWriter; @@ -36,7 +30,6 @@ import android.util.proto.ProtoOutputStream; import com.android.internal.annotations.GuardedBy; import com.android.internal.annotations.VisibleForTesting; import com.android.server.AppSchedulingModuleThread; -import com.android.server.LocalServices; import com.android.server.job.JobSchedulerService; import com.android.server.job.StateControllerProto; @@ -60,8 +53,6 @@ public final class BatteryController extends RestrictingController { @GuardedBy("mLock") private final ArraySet mTopStartedJobs = new ArraySet<>(); - private final PowerTracker mPowerTracker; - private final FlexibilityController mFlexibilityController; /** * Helper set to avoid too much GC churn from frequent calls to @@ -77,15 +68,9 @@ public final class BatteryController extends RestrictingController { public BatteryController(JobSchedulerService service, FlexibilityController flexibilityController) { super(service); - mPowerTracker = new PowerTracker(); mFlexibilityController = flexibilityController; } - @Override - public void startTrackingLocked() { - mPowerTracker.startTracking(); - } - @Override public void maybeStartTrackingJobLocked(JobStatus taskStatus, JobStatus lastJob) { if (taskStatus.hasPowerConstraint()) { @@ -95,7 +80,7 @@ public final class BatteryController extends RestrictingController { if (taskStatus.hasChargingConstraint()) { if (hasTopExemptionLocked(taskStatus)) { taskStatus.setChargingConstraintSatisfied(nowElapsed, - mPowerTracker.isPowerConnected()); + mService.isPowerConnected()); } else { taskStatus.setChargingConstraintSatisfied(nowElapsed, mService.isBatteryCharging() && mService.isBatteryNotLow()); @@ -178,7 +163,7 @@ public final class BatteryController extends RestrictingController { @GuardedBy("mLock") private void maybeReportNewChargingStateLocked() { - final boolean powerConnected = mPowerTracker.isPowerConnected(); + final boolean powerConnected = mService.isPowerConnected(); final boolean stablePower = mService.isBatteryCharging() && mService.isBatteryNotLow(); final boolean batteryNotLow = mService.isBatteryNotLow(); if (DEBUG) { @@ -239,62 +224,6 @@ public final class BatteryController extends RestrictingController { mChangedJobs.clear(); } - private final class PowerTracker extends BroadcastReceiver { - /** - * Track whether there is power connected. It doesn't mean the device is charging. - * Use {@link JobSchedulerService#isBatteryCharging()} to determine if the device is - * charging. - */ - private boolean mPowerConnected; - - PowerTracker() { - } - - void startTracking() { - IntentFilter filter = new IntentFilter(); - - filter.addAction(Intent.ACTION_POWER_CONNECTED); - filter.addAction(Intent.ACTION_POWER_DISCONNECTED); - mContext.registerReceiver(this, filter); - - // Initialize tracker state. - BatteryManagerInternal batteryManagerInternal = - LocalServices.getService(BatteryManagerInternal.class); - mPowerConnected = batteryManagerInternal.isPowered(BatteryManager.BATTERY_PLUGGED_ANY); - } - - boolean isPowerConnected() { - return mPowerConnected; - } - - @Override - public void onReceive(Context context, Intent intent) { - synchronized (mLock) { - final String action = intent.getAction(); - - if (Intent.ACTION_POWER_CONNECTED.equals(action)) { - if (DEBUG) { - Slog.d(TAG, "Power connected @ " + sElapsedRealtimeClock.millis()); - } - if (mPowerConnected) { - return; - } - mPowerConnected = true; - } else if (Intent.ACTION_POWER_DISCONNECTED.equals(action)) { - if (DEBUG) { - Slog.d(TAG, "Power disconnected @ " + sElapsedRealtimeClock.millis()); - } - if (!mPowerConnected) { - return; - } - mPowerConnected = false; - } - - maybeReportNewChargingStateLocked(); - } - } - } - @VisibleForTesting ArraySet getTrackedJobs() { return mTrackedTasks; @@ -308,7 +237,6 @@ public final class BatteryController extends RestrictingController { @Override public void dumpControllerStateLocked(IndentingPrintWriter pw, Predicate predicate) { - pw.println("Power connected: " + mPowerTracker.isPowerConnected()); pw.println("Stable power: " + (mService.isBatteryCharging() && mService.isBatteryNotLow())); pw.println("Not low: " + mService.isBatteryNotLow()); diff --git a/apex/jobscheduler/service/java/com/android/server/job/controllers/ConnectivityController.java b/apex/jobscheduler/service/java/com/android/server/job/controllers/ConnectivityController.java index f40508302ee3618986bb221656160b2d3db252cc..3219f7e5ce20e489ce75bc145453a74df8f769e9 100644 --- a/apex/jobscheduler/service/java/com/android/server/job/controllers/ConnectivityController.java +++ b/apex/jobscheduler/service/java/com/android/server/job/controllers/ConnectivityController.java @@ -21,12 +21,13 @@ import static android.net.NetworkCapabilities.NET_CAPABILITY_NOT_METERED; import static android.net.NetworkCapabilities.NET_CAPABILITY_TEMPORARILY_NOT_METERED; import static android.net.NetworkCapabilities.TRANSPORT_CELLULAR; import static android.net.NetworkCapabilities.TRANSPORT_ETHERNET; +import static android.net.NetworkCapabilities.TRANSPORT_SATELLITE; import static android.net.NetworkCapabilities.TRANSPORT_WIFI; +import static android.text.format.DateUtils.MINUTE_IN_MILLIS; import static com.android.server.job.JobSchedulerService.RESTRICTED_INDEX; import static com.android.server.job.JobSchedulerService.sElapsedRealtimeClock; import static com.android.server.job.Flags.FLAG_RELAX_PREFETCH_CONNECTIVITY_CONSTRAINT_ONLY_ON_CHARGER; -import static com.android.server.job.Flags.relaxPrefetchConnectivityConstraintOnlyOnCharger; import android.annotation.NonNull; import android.annotation.Nullable; @@ -66,6 +67,7 @@ import com.android.internal.annotations.GuardedBy; import com.android.internal.annotations.VisibleForTesting; import com.android.server.AppSchedulingModuleThread; import com.android.server.LocalServices; +import com.android.server.job.Flags; import com.android.server.job.JobSchedulerService; import com.android.server.job.JobSchedulerService.Constants; import com.android.server.job.StateControllerProto; @@ -138,8 +140,9 @@ public final class ConnectivityController extends RestrictingController implemen static final SparseIntArray sNetworkTransportAffinities = new SparseIntArray(); static { sNetworkTransportAffinities.put(TRANSPORT_CELLULAR, TRANSPORT_AFFINITY_AVOID); - sNetworkTransportAffinities.put(TRANSPORT_WIFI, TRANSPORT_AFFINITY_PREFER); sNetworkTransportAffinities.put(TRANSPORT_ETHERNET, TRANSPORT_AFFINITY_PREFER); + sNetworkTransportAffinities.put(TRANSPORT_SATELLITE, TRANSPORT_AFFINITY_AVOID); + sNetworkTransportAffinities.put(TRANSPORT_WIFI, TRANSPORT_AFFINITY_PREFER); } private final CcConfig mCcConfig; @@ -166,6 +169,10 @@ public final class ConnectivityController extends RestrictingController implemen @GuardedBy("mLock") private final ArrayMap mAvailableNetworks = new ArrayMap<>(); + @GuardedBy("mLock") + @Nullable + private Network mSystemDefaultNetwork; + private final SparseArray mCurrentDefaultNetworkCallbacks = new SparseArray<>(); private final Comparator mUidStatsComparator = new Comparator() { @@ -286,6 +293,7 @@ public final class ConnectivityController extends RestrictingController implemen private static final int MSG_UPDATE_ALL_TRACKED_JOBS = 1; private static final int MSG_DATA_SAVER_TOGGLED = 2; private static final int MSG_UID_POLICIES_CHANGED = 3; + private static final int MSG_PROCESS_ACTIVE_NETWORK = 4; private final Handler mHandler; @@ -313,6 +321,14 @@ public final class ConnectivityController extends RestrictingController implemen } } + @Override + public void startTrackingLocked() { + if (Flags.batchConnectivityJobsPerNetwork()) { + mConnManager.registerSystemDefaultNetworkCallback(mDefaultNetworkCallback, mHandler); + mConnManager.addDefaultNetworkActiveListener(this); + } + } + @GuardedBy("mLock") @Override public void maybeStartTrackingJobLocked(JobStatus jobStatus, JobStatus lastJob) { @@ -911,8 +927,8 @@ public final class ConnectivityController extends RestrictingController implemen return true; } if (capabilities.hasTransport(NetworkCapabilities.TRANSPORT_VPN)) { - // Exclude VPNs because it's currently not possible to determine the VPN's underlying - // network, and thus the correct signal strength of the VPN's network. + // VPNs may have multiple underlying networks and determining the correct strength + // may not be straightforward. // Transmitting data over a VPN is generally more battery-expensive than on the // underlying network, so: // TODO: find a good way to reduce job use of VPN when it'll be very expensive @@ -1007,7 +1023,7 @@ public final class ConnectivityController extends RestrictingController implemen // Need to at least know the estimated download bytes for a prefetch job. return false; } - if (relaxPrefetchConnectivityConstraintOnlyOnCharger()) { + if (Flags.relaxPrefetchConnectivityConstraintOnlyOnCharger()) { // Since the constraint relaxation isn't required by the job, only do it when the // device is charging and the battery level is above the "low battery" threshold. if (!mService.isBatteryCharging() || !mService.isBatteryNotLow()) { @@ -1309,7 +1325,7 @@ public final class ConnectivityController extends RestrictingController implemen } @Nullable - private NetworkCapabilities getNetworkCapabilities(@Nullable Network network) { + public NetworkCapabilities getNetworkCapabilities(@Nullable Network network) { final CachedNetworkMetadata metadata = getNetworkMetadata(network); return metadata == null ? null : metadata.networkCapabilities; } @@ -1526,27 +1542,139 @@ public final class ConnectivityController extends RestrictingController implemen return changed; } + /** + * Returns {@code true} if the job's assigned network is active or otherwise considered to be + * in a good state to run the job now. + */ + @GuardedBy("mLock") + public boolean isNetworkInStateForJobRunLocked(@NonNull JobStatus jobStatus) { + if (jobStatus.network == null) { + return false; + } + if (jobStatus.shouldTreatAsExpeditedJob() || jobStatus.shouldTreatAsUserInitiatedJob() + || mService.getUidProcState(jobStatus.getSourceUid()) + <= ActivityManager.PROCESS_STATE_BOUND_FOREGROUND_SERVICE) { + // EJs, UIJs, and BFGS+ jobs should be able to activate the network. + return true; + } + return isNetworkInStateForJobRunLocked(jobStatus.network); + } + + @GuardedBy("mLock") + @VisibleForTesting + boolean isNetworkInStateForJobRunLocked(@NonNull Network network) { + if (!Flags.batchConnectivityJobsPerNetwork()) { + // Active network batching isn't enabled. We don't care about the network state. + return true; + } + + CachedNetworkMetadata cachedNetworkMetadata = mAvailableNetworks.get(network); + if (cachedNetworkMetadata == null) { + return false; + } + + final long nowElapsed = sElapsedRealtimeClock.millis(); + if (cachedNetworkMetadata.defaultNetworkActivationLastConfirmedTimeElapsed + + mCcConfig.NETWORK_ACTIVATION_EXPIRATION_MS > nowElapsed) { + // Network is still presumed to be active. + return true; + } + + final boolean inactiveForTooLong = + cachedNetworkMetadata.capabilitiesFirstAcquiredTimeElapsed + < nowElapsed - mCcConfig.NETWORK_ACTIVATION_MAX_WAIT_TIME_MS + && cachedNetworkMetadata.defaultNetworkActivationLastConfirmedTimeElapsed + < nowElapsed - mCcConfig.NETWORK_ACTIVATION_MAX_WAIT_TIME_MS; + // We can only know the state of the system default network. If that's not available + // or the network in question isn't the system default network, + // then return true if we haven't gotten an active signal in a long time. + if (mSystemDefaultNetwork == null) { + return inactiveForTooLong; + } + + if (!mSystemDefaultNetwork.equals(network)) { + final NetworkCapabilities capabilities = cachedNetworkMetadata.networkCapabilities; + if (capabilities != null + && capabilities.hasTransport(NetworkCapabilities.TRANSPORT_VPN)) { + // VPNs won't have an active signal sent for them. Check their underlying networks + // instead, prioritizing the system default if it's one of them. + final List underlyingNetworks = capabilities.getUnderlyingNetworks(); + if (underlyingNetworks == null) { + return inactiveForTooLong; + } + + if (underlyingNetworks.contains(mSystemDefaultNetwork)) { + if (DEBUG) { + Slog.i(TAG, "Substituting system default network " + + mSystemDefaultNetwork + " for VPN " + network); + } + return isNetworkInStateForJobRunLocked(mSystemDefaultNetwork); + } + + for (int i = underlyingNetworks.size() - 1; i >= 0; --i) { + if (isNetworkInStateForJobRunLocked(underlyingNetworks.get(i))) { + return true; + } + } + } + return inactiveForTooLong; + } + + if (cachedNetworkMetadata.defaultNetworkActivationLastCheckTimeElapsed + + mCcConfig.NETWORK_ACTIVATION_EXPIRATION_MS < nowElapsed) { + // We haven't checked the state recently enough. Let's check if the network is active. + // However, if we checked after the last confirmed active time and it wasn't active, + // then the network is still not active (we would be told when it becomes active + // via onNetworkActive()). + if (cachedNetworkMetadata.defaultNetworkActivationLastCheckTimeElapsed + > cachedNetworkMetadata.defaultNetworkActivationLastConfirmedTimeElapsed) { + return inactiveForTooLong; + } + // We need to explicitly check because there's no callback telling us when the network + // leaves the high power state. + cachedNetworkMetadata.defaultNetworkActivationLastCheckTimeElapsed = nowElapsed; + final boolean isActive = mConnManager.isDefaultNetworkActive(); + if (isActive) { + cachedNetworkMetadata.defaultNetworkActivationLastConfirmedTimeElapsed = nowElapsed; + return true; + } + return inactiveForTooLong; + } + + // We checked the state recently enough, but the network wasn't active. Assume it still + // isn't active. + return false; + } + /** * We know the network has just come up. We want to run any jobs that are ready. */ @Override public void onNetworkActive() { synchronized (mLock) { - for (int i = mTrackedJobs.size()-1; i >= 0; i--) { - final ArraySet jobs = mTrackedJobs.valueAt(i); - for (int j = jobs.size() - 1; j >= 0; j--) { - final JobStatus js = jobs.valueAt(j); - if (js.isReady()) { - if (DEBUG) { - Slog.d(TAG, "Running " + js + " due to network activity."); - } - mStateChangedListener.onRunJobNow(js); - } - } + if (mSystemDefaultNetwork == null) { + Slog.wtf(TAG, "System default network is unknown but active"); + return; + } + + CachedNetworkMetadata cachedNetworkMetadata = + mAvailableNetworks.get(mSystemDefaultNetwork); + if (cachedNetworkMetadata == null) { + Slog.wtf(TAG, "System default network capabilities are unknown but active"); + return; } + + // This method gets called on the system's main thread (not the + // AppSchedulingModuleThread), so shift the processing work to a handler to avoid + // blocking important operations on the main thread. + cachedNetworkMetadata.defaultNetworkActivationLastConfirmedTimeElapsed = + cachedNetworkMetadata.defaultNetworkActivationLastCheckTimeElapsed = + sElapsedRealtimeClock.millis(); + mHandler.sendEmptyMessage(MSG_PROCESS_ACTIVE_NETWORK); } } + /** NetworkCallback to track all network changes. */ private final NetworkCallback mNetworkCallback = new NetworkCallback() { @Override public void onAvailable(Network network) { @@ -1565,6 +1693,7 @@ public final class ConnectivityController extends RestrictingController implemen CachedNetworkMetadata cnm = mAvailableNetworks.get(network); if (cnm == null) { cnm = new CachedNetworkMetadata(); + cnm.capabilitiesFirstAcquiredTimeElapsed = sElapsedRealtimeClock.millis(); mAvailableNetworks.put(network, cnm); } else { final NetworkCapabilities oldCaps = cnm.networkCapabilities; @@ -1700,6 +1829,29 @@ public final class ConnectivityController extends RestrictingController implemen } }; + /** NetworkCallback to track only changes to the default network. */ + private final NetworkCallback mDefaultNetworkCallback = new NetworkCallback() { + @Override + public void onAvailable(Network network) { + if (DEBUG) Slog.v(TAG, "systemDefault-onAvailable: " + network); + synchronized (mLock) { + mSystemDefaultNetwork = network; + } + } + + @Override + public void onLost(Network network) { + if (DEBUG) { + Slog.v(TAG, "systemDefault-onLost: " + network); + } + synchronized (mLock) { + if (network.equals(mSystemDefaultNetwork)) { + mSystemDefaultNetwork = null; + } + } + } + }; + private final INetworkPolicyListener mNetPolicyListener = new NetworkPolicyManager.Listener() { @Override public void onRestrictBackgroundChanged(boolean restrictBackground) { @@ -1762,6 +1914,66 @@ public final class ConnectivityController extends RestrictingController implemen } } break; + + case MSG_PROCESS_ACTIVE_NETWORK: + removeMessages(MSG_PROCESS_ACTIVE_NETWORK); + synchronized (mLock) { + if (mSystemDefaultNetwork == null) { + break; + } + if (!Flags.batchConnectivityJobsPerNetwork()) { + break; + } + if (!isNetworkInStateForJobRunLocked(mSystemDefaultNetwork)) { + break; + } + + final ArrayMap includeInProcessing = new ArrayMap<>(); + // Try to get the jobs to piggyback on the active network. + for (int u = mTrackedJobs.size() - 1; u >= 0; --u) { + final ArraySet jobs = mTrackedJobs.valueAt(u); + for (int j = jobs.size() - 1; j >= 0; --j) { + final JobStatus js = jobs.valueAt(j); + if (!mSystemDefaultNetwork.equals(js.network)) { + final NetworkCapabilities capabilities = + getNetworkCapabilities(js.network); + if (capabilities == null + || !capabilities.hasTransport( + NetworkCapabilities.TRANSPORT_VPN)) { + includeInProcessing.put(js.network, Boolean.FALSE); + continue; + } + if (includeInProcessing.containsKey(js.network)) { + if (!includeInProcessing.get(js.network)) { + continue; + } + } else { + // VPNs most likely use the system default network as + // their underlying network. If so, process the job. + final List underlyingNetworks = + capabilities.getUnderlyingNetworks(); + final boolean isSystemDefaultInUnderlying = + underlyingNetworks != null + && underlyingNetworks.contains( + mSystemDefaultNetwork); + includeInProcessing.put(js.network, + isSystemDefaultInUnderlying); + if (!isSystemDefaultInUnderlying) { + continue; + } + } + } + if (js.isReady()) { + if (DEBUG) { + Slog.d(TAG, "Potentially running " + js + + " due to network activity"); + } + mStateChangedListener.onRunJobNow(js); + } + } + } + } + break; } } } @@ -1782,8 +1994,15 @@ public final class ConnectivityController extends RestrictingController implemen @VisibleForTesting static final String KEY_AVOID_UNDEFINED_TRANSPORT_AFFINITY = CC_CONFIG_PREFIX + "avoid_undefined_transport_affinity"; + private static final String KEY_NETWORK_ACTIVATION_EXPIRATION_MS = + CC_CONFIG_PREFIX + "network_activation_expiration_ms"; + private static final String KEY_NETWORK_ACTIVATION_MAX_WAIT_TIME_MS = + CC_CONFIG_PREFIX + "network_activation_max_wait_time_ms"; private static final boolean DEFAULT_AVOID_UNDEFINED_TRANSPORT_AFFINITY = false; + private static final long DEFAULT_NETWORK_ACTIVATION_EXPIRATION_MS = 10000L; + private static final long DEFAULT_NETWORK_ACTIVATION_MAX_WAIT_TIME_MS = + 31 * MINUTE_IN_MILLIS; /** * If true, will avoid network transports that don't have an explicitly defined affinity. @@ -1791,6 +2010,19 @@ public final class ConnectivityController extends RestrictingController implemen public boolean AVOID_UNDEFINED_TRANSPORT_AFFINITY = DEFAULT_AVOID_UNDEFINED_TRANSPORT_AFFINITY; + /** + * Amount of time that needs to pass before needing to determine if the network is still + * active. + */ + public long NETWORK_ACTIVATION_EXPIRATION_MS = DEFAULT_NETWORK_ACTIVATION_EXPIRATION_MS; + + /** + * Max time to wait since the network was last activated before deciding to allow jobs to + * run even if the network isn't active + */ + public long NETWORK_ACTIVATION_MAX_WAIT_TIME_MS = + DEFAULT_NETWORK_ACTIVATION_MAX_WAIT_TIME_MS; + @GuardedBy("mLock") public void processConstantLocked(@NonNull DeviceConfig.Properties properties, @NonNull String key) { @@ -1803,6 +2035,22 @@ public final class ConnectivityController extends RestrictingController implemen mShouldReprocessNetworkCapabilities = true; } break; + case KEY_NETWORK_ACTIVATION_EXPIRATION_MS: + final long gracePeriodMs = properties.getLong(key, + DEFAULT_NETWORK_ACTIVATION_EXPIRATION_MS); + if (NETWORK_ACTIVATION_EXPIRATION_MS != gracePeriodMs) { + NETWORK_ACTIVATION_EXPIRATION_MS = gracePeriodMs; + // This doesn't need to trigger network capability reprocessing. + } + break; + case KEY_NETWORK_ACTIVATION_MAX_WAIT_TIME_MS: + final long maxWaitMs = properties.getLong(key, + DEFAULT_NETWORK_ACTIVATION_MAX_WAIT_TIME_MS); + if (NETWORK_ACTIVATION_MAX_WAIT_TIME_MS != maxWaitMs) { + NETWORK_ACTIVATION_MAX_WAIT_TIME_MS = maxWaitMs; + mShouldReprocessNetworkCapabilities = true; + } + break; } } @@ -1814,6 +2062,10 @@ public final class ConnectivityController extends RestrictingController implemen pw.print(KEY_AVOID_UNDEFINED_TRANSPORT_AFFINITY, AVOID_UNDEFINED_TRANSPORT_AFFINITY).println(); + pw.print(KEY_NETWORK_ACTIVATION_EXPIRATION_MS, + NETWORK_ACTIVATION_EXPIRATION_MS).println(); + pw.print(KEY_NETWORK_ACTIVATION_MAX_WAIT_TIME_MS, + NETWORK_ACTIVATION_MAX_WAIT_TIME_MS).println(); pw.decreaseIndent(); } @@ -1925,11 +2177,24 @@ public final class ConnectivityController extends RestrictingController implemen private static class CachedNetworkMetadata { public NetworkCapabilities networkCapabilities; public boolean satisfiesTransportAffinities; + /** + * Track the first time ConnectivityController was informed about the capabilities of the + * network after it became available. + */ + public long capabilitiesFirstAcquiredTimeElapsed; + public long defaultNetworkActivationLastCheckTimeElapsed; + public long defaultNetworkActivationLastConfirmedTimeElapsed; public String toString() { return "CNM{" + networkCapabilities.toString() + ", satisfiesTransportAffinities=" + satisfiesTransportAffinities + + ", capabilitiesFirstAcquiredTimeElapsed=" + + capabilitiesFirstAcquiredTimeElapsed + + ", defaultNetworkActivationLastCheckTimeElapsed=" + + defaultNetworkActivationLastCheckTimeElapsed + + ", defaultNetworkActivationLastConfirmedTimeElapsed=" + + defaultNetworkActivationLastConfirmedTimeElapsed + "}"; } } @@ -2017,7 +2282,7 @@ public final class ConnectivityController extends RestrictingController implemen pw.println("Aconfig flags:"); pw.increaseIndent(); pw.print(FLAG_RELAX_PREFETCH_CONNECTIVITY_CONSTRAINT_ONLY_ON_CHARGER, - relaxPrefetchConnectivityConstraintOnlyOnCharger()); + Flags.relaxPrefetchConnectivityConstraintOnlyOnCharger()); pw.println(); pw.decreaseIndent(); pw.println(); diff --git a/apex/jobscheduler/service/java/com/android/server/job/controllers/FlexibilityController.java b/apex/jobscheduler/service/java/com/android/server/job/controllers/FlexibilityController.java index 0e67b9ac944f30b84a621a32b0e7f63665dd029d..e96d07f44b34665c16ee5dfa3ae5c97b51feed18 100644 --- a/apex/jobscheduler/service/java/com/android/server/job/controllers/FlexibilityController.java +++ b/apex/jobscheduler/service/java/com/android/server/job/controllers/FlexibilityController.java @@ -16,6 +16,11 @@ package com.android.server.job.controllers; +import static android.app.job.JobInfo.PRIORITY_DEFAULT; +import static android.app.job.JobInfo.PRIORITY_HIGH; +import static android.app.job.JobInfo.PRIORITY_LOW; +import static android.app.job.JobInfo.PRIORITY_MAX; +import static android.app.job.JobInfo.PRIORITY_MIN; import static android.text.format.DateUtils.DAY_IN_MILLIS; import static android.text.format.DateUtils.HOUR_IN_MILLIS; import static android.text.format.DateUtils.MINUTE_IN_MILLIS; @@ -30,24 +35,34 @@ import android.annotation.ElapsedRealtimeLong; import android.annotation.NonNull; import android.annotation.Nullable; import android.app.job.JobInfo; +import android.content.BroadcastReceiver; import android.content.Context; +import android.content.Intent; +import android.content.IntentFilter; import android.content.pm.PackageManager; import android.os.Handler; import android.os.Looper; import android.os.Message; +import android.os.PowerManager; import android.os.UserHandle; import android.provider.DeviceConfig; import android.util.ArraySet; import android.util.IndentingPrintWriter; +import android.util.KeyValueListParser; import android.util.Log; import android.util.Slog; +import android.util.SparseArray; import android.util.SparseArrayMap; +import android.util.SparseIntArray; import android.util.SparseLongArray; +import android.util.SparseSetArray; import android.util.TimeUtils; import com.android.internal.annotations.GuardedBy; import com.android.internal.annotations.VisibleForTesting; import com.android.server.AppSchedulingModuleThread; +import com.android.server.DeviceIdleInternal; +import com.android.server.LocalServices; import com.android.server.job.JobSchedulerService; import com.android.server.utils.AlarmQueue; @@ -85,6 +100,23 @@ public final class FlexibilityController extends StateController { */ private long mFallbackFlexibilityDeadlineMs = FcConfig.DEFAULT_FALLBACK_FLEXIBILITY_DEADLINE_MS; + /** + * The default deadline that all flexible constraints should be dropped by if a job lacks + * a deadline, keyed by job priority. + */ + private SparseLongArray mFallbackFlexibilityDeadlines = + FcConfig.DEFAULT_FALLBACK_FLEXIBILITY_DEADLINES; + /** + * The scores to use for each job, keyed by job priority. + */ + private SparseIntArray mFallbackFlexibilityDeadlineScores = + FcConfig.DEFAULT_FALLBACK_FLEXIBILITY_DEADLINE_SCORES; + /** + * The amount of time to add (scaled by job run score) to the fallback flexibility deadline, + * keyed by job priority. + */ + private SparseLongArray mFallbackFlexibilityAdditionalScoreTimeFactors = + FcConfig.DEFAULT_FALLBACK_FLEXIBILITY_DEADLINE_ADDITIONAL_SCORE_TIME_FACTORS; private long mRescheduledJobDeadline = FcConfig.DEFAULT_RESCHEDULED_JOB_DEADLINE_MS; private long mMaxRescheduledDeadline = FcConfig.DEFAULT_MAX_RESCHEDULED_DEADLINE_MS; @@ -111,10 +143,10 @@ public final class FlexibilityController extends StateController { /** * The percent of a job's lifecycle to drop number of required constraints. - * mPercentToDropConstraints[i] denotes that at x% of a Jobs lifecycle, - * the controller should have i+1 constraints dropped. + * mPercentsToDropConstraints[i] denotes that at x% of a Jobs lifecycle, + * the controller should have i+1 constraints dropped. Keyed by job priority. */ - private int[] mPercentToDropConstraints; + private SparseArray mPercentsToDropConstraints; /** * Keeps track of what flexible constraints are satisfied at the moment. @@ -138,6 +170,7 @@ public final class FlexibilityController extends StateController { private final FcHandler mHandler; @VisibleForTesting final PrefetchController mPrefetchController; + private final SpecialAppTracker mSpecialAppTracker; /** * Stores the beginning of prefetch jobs lifecycle per app as a maximum of @@ -180,8 +213,115 @@ public final class FlexibilityController extends StateController { } }; - private static final int MSG_UPDATE_JOBS = 0; - private static final int MSG_UPDATE_JOB = 1; + /** Helper object to track job run score for each app. */ + private static class JobScoreTracker { + private static class JobScoreBucket { + @ElapsedRealtimeLong + public long startTimeElapsed; + public int score; + + private void reset() { + startTimeElapsed = 0; + score = 0; + } + } + + private static final int NUM_SCORE_BUCKETS = 24; + private static final long MAX_TIME_WINDOW_MS = 24 * HOUR_IN_MILLIS; + private final JobScoreBucket[] mScoreBuckets = new JobScoreBucket[NUM_SCORE_BUCKETS]; + private int mScoreBucketIndex = 0; + private long mCachedScoreExpirationTimeElapsed; + private int mCachedScore; + + public void addScore(int add, long nowElapsed) { + JobScoreBucket bucket = mScoreBuckets[mScoreBucketIndex]; + if (bucket == null) { + bucket = new JobScoreBucket(); + bucket.startTimeElapsed = nowElapsed; + mScoreBuckets[mScoreBucketIndex] = bucket; + // Brand new bucket, there's nothing to remove from the score, + // so just update the expiration time if needed. + mCachedScoreExpirationTimeElapsed = Math.min(mCachedScoreExpirationTimeElapsed, + nowElapsed + MAX_TIME_WINDOW_MS); + } else if (bucket.startTimeElapsed < nowElapsed - MAX_TIME_WINDOW_MS) { + // The bucket is too old. + bucket.reset(); + bucket.startTimeElapsed = nowElapsed; + // Force a recalculation of the cached score instead of just updating the cached + // value and time in case there are multiple stale buckets. + mCachedScoreExpirationTimeElapsed = nowElapsed; + } else if (bucket.startTimeElapsed + < nowElapsed - MAX_TIME_WINDOW_MS / NUM_SCORE_BUCKETS) { + // The current bucket's duration has completed. Move on to the next bucket. + mScoreBucketIndex = (mScoreBucketIndex + 1) % NUM_SCORE_BUCKETS; + addScore(add, nowElapsed); + return; + } + + bucket.score += add; + mCachedScore += add; + } + + public int getScore(long nowElapsed) { + if (nowElapsed < mCachedScoreExpirationTimeElapsed) { + return mCachedScore; + } + int score = 0; + final long earliestElapsed = nowElapsed - MAX_TIME_WINDOW_MS; + long earliestValidBucketTimeElapsed = Long.MAX_VALUE; + for (JobScoreBucket bucket : mScoreBuckets) { + if (bucket != null && bucket.startTimeElapsed >= earliestElapsed) { + score += bucket.score; + if (earliestValidBucketTimeElapsed > bucket.startTimeElapsed) { + earliestValidBucketTimeElapsed = bucket.startTimeElapsed; + } + } + } + mCachedScore = score; + mCachedScoreExpirationTimeElapsed = earliestValidBucketTimeElapsed + MAX_TIME_WINDOW_MS; + return score; + } + + public void dump(@NonNull IndentingPrintWriter pw, long nowElapsed) { + pw.print("{"); + + boolean printed = false; + for (int x = 0; x < mScoreBuckets.length; ++x) { + final int idx = (mScoreBucketIndex + 1 + x) % mScoreBuckets.length; + final JobScoreBucket jsb = mScoreBuckets[idx]; + if (jsb == null || jsb.startTimeElapsed == 0) { + continue; + } + if (printed) { + pw.print(", "); + } + TimeUtils.formatDuration(jsb.startTimeElapsed, nowElapsed, pw); + pw.print("="); + pw.print(jsb.score); + printed = true; + } + + pw.print("}"); + } + } + + /** + * Set of {@link JobScoreTracker JobScoreTrackers} for each app. + * Keyed by source UID -> source package. + **/ + private final SparseArrayMap mJobScoreTrackers = + new SparseArrayMap<>(); + + private static final int MSG_CHECK_ALL_JOBS = 0; + /** Check the jobs in {@link #mJobsToCheck} */ + private static final int MSG_CHECK_JOBS = 1; + /** Check the jobs of packages in {@link #mPackagesToCheck} */ + private static final int MSG_CHECK_PACKAGES = 2; + + @GuardedBy("mLock") + private final ArraySet mJobsToCheck = new ArraySet<>(); + @GuardedBy("mLock") + private final ArraySet mPackagesToCheck = new ArraySet<>(); public FlexibilityController( JobSchedulerService service, PrefetchController prefetchController) { @@ -201,9 +341,19 @@ public final class FlexibilityController extends StateController { mFcConfig = new FcConfig(); mFlexibilityAlarmQueue = new FlexibilityAlarmQueue( mContext, AppSchedulingModuleThread.get().getLooper()); - mPercentToDropConstraints = - mFcConfig.DEFAULT_PERCENT_TO_DROP_FLEXIBLE_CONSTRAINTS; + mPercentsToDropConstraints = + FcConfig.DEFAULT_PERCENTS_TO_DROP_FLEXIBLE_CONSTRAINTS; mPrefetchController = prefetchController; + mSpecialAppTracker = new SpecialAppTracker(); + + if (mFlexibilityEnabled) { + mSpecialAppTracker.startTracking(); + } + } + + @Override + public void onSystemServicesReady() { + mSpecialAppTracker.onSystemServicesReady(); } @Override @@ -234,6 +384,48 @@ public final class FlexibilityController extends StateController { } } + @Override + public void prepareForExecutionLocked(JobStatus jobStatus) { + if (jobStatus.lastEvaluatedBias == JobInfo.BIAS_TOP_APP) { + // Don't include jobs for the TOP app in the score calculation. + return; + } + // Use the job's requested priority to determine its score since that is what the developer + // selected and it will be stable across job runs. + final int priority = jobStatus.getJob().getPriority(); + final int score = mFallbackFlexibilityDeadlineScores.get(priority, + FcConfig.DEFAULT_FALLBACK_FLEXIBILITY_DEADLINE_SCORES + .get(priority, priority / 100)); + JobScoreTracker jobScoreTracker = + mJobScoreTrackers.get(jobStatus.getSourceUid(), jobStatus.getSourcePackageName()); + if (jobScoreTracker == null) { + jobScoreTracker = new JobScoreTracker(); + mJobScoreTrackers.add(jobStatus.getSourceUid(), jobStatus.getSourcePackageName(), + jobScoreTracker); + } + jobScoreTracker.addScore(score, sElapsedRealtimeClock.millis()); + } + + @Override + public void unprepareFromExecutionLocked(JobStatus jobStatus) { + if (jobStatus.lastEvaluatedBias == JobInfo.BIAS_TOP_APP) { + // Jobs for the TOP app are excluded from the score calculation. + return; + } + // The job didn't actually start. Undo the score increase. + JobScoreTracker jobScoreTracker = + mJobScoreTrackers.get(jobStatus.getSourceUid(), jobStatus.getSourcePackageName()); + if (jobScoreTracker == null) { + Slog.e(TAG, "Unprepared a job that didn't result in a score change"); + return; + } + final int priority = jobStatus.getJob().getPriority(); + final int score = mFallbackFlexibilityDeadlineScores.get(priority, + FcConfig.DEFAULT_FALLBACK_FLEXIBILITY_DEADLINE_SCORES + .get(priority, priority / 100)); + jobScoreTracker.addScore(-score, sElapsedRealtimeClock.millis()); + } + @Override @GuardedBy("mLock") public void maybeStopTrackingJobLocked(JobStatus js, JobStatus incomingJob) { @@ -241,6 +433,7 @@ public final class FlexibilityController extends StateController { mFlexibilityAlarmQueue.removeAlarmForKey(js); mFlexibilityTracker.remove(js); } + mJobsToCheck.remove(js); } @Override @@ -248,12 +441,35 @@ public final class FlexibilityController extends StateController { public void onAppRemovedLocked(String packageName, int uid) { final int userId = UserHandle.getUserId(uid); mPrefetchLifeCycleStart.delete(userId, packageName); + mJobScoreTrackers.delete(uid, packageName); + mSpecialAppTracker.onAppRemoved(userId, packageName); + for (int i = mJobsToCheck.size() - 1; i >= 0; --i) { + final JobStatus js = mJobsToCheck.valueAt(i); + if ((js.getSourceUid() == uid && js.getSourcePackageName().equals(packageName)) + || (js.getUid() == uid && js.getCallingPackageName().equals(packageName))) { + mJobsToCheck.removeAt(i); + } + } } @Override @GuardedBy("mLock") public void onUserRemovedLocked(int userId) { mPrefetchLifeCycleStart.delete(userId); + mSpecialAppTracker.onUserRemoved(userId); + for (int u = mJobScoreTrackers.numMaps() - 1; u >= 0; --u) { + final int uid = mJobScoreTrackers.keyAt(u); + if (UserHandle.getUserId(uid) == userId) { + mJobScoreTrackers.deleteAt(u); + } + } + for (int i = mJobsToCheck.size() - 1; i >= 0; --i) { + final JobStatus js = mJobsToCheck.valueAt(i); + if (UserHandle.getUserId(js.getSourceUid()) == userId + || UserHandle.getUserId(js.getUid()) == userId) { + mJobsToCheck.removeAt(i); + } + } } boolean isEnabled() { @@ -266,7 +482,15 @@ public final class FlexibilityController extends StateController { @GuardedBy("mLock") boolean isFlexibilitySatisfiedLocked(JobStatus js) { return !mFlexibilityEnabled + // Exclude all jobs of the TOP app || mService.getUidBias(js.getSourceUid()) == JobInfo.BIAS_TOP_APP + // Only exclude DEFAULT+ priority jobs for BFGS+ apps + || (mService.getUidBias(js.getSourceUid()) >= JobInfo.BIAS_BOUND_FOREGROUND_SERVICE + && js.getEffectivePriority() >= PRIORITY_DEFAULT) + // For special/privileged apps, automatically exclude DEFAULT+ priority jobs. + || (js.getEffectivePriority() >= PRIORITY_DEFAULT + && mSpecialAppTracker.isSpecialApp( + js.getSourceUserId(), js.getSourcePackageName())) || hasEnoughSatisfiedConstraintsLocked(js) || mService.isCurrentlyRunningLocked(js); } @@ -371,7 +595,7 @@ public final class FlexibilityController extends StateController { // Push the job update to the handler to avoid blocking other controllers and // potentially batch back-to-back controller state updates together. - mHandler.obtainMessage(MSG_UPDATE_JOBS).sendToTarget(); + mHandler.obtainMessage(MSG_CHECK_ALL_JOBS).sendToTarget(); } } } @@ -417,7 +641,14 @@ public final class FlexibilityController extends StateController { @VisibleForTesting @GuardedBy("mLock") - long getLifeCycleEndElapsedLocked(JobStatus js, long earliest) { + int getScoreLocked(int uid, @NonNull String pkgName, long nowElapsed) { + final JobScoreTracker scoreTracker = mJobScoreTrackers.get(uid, pkgName); + return scoreTracker == null ? 0 : scoreTracker.getScore(nowElapsed); + } + + @VisibleForTesting + @GuardedBy("mLock") + long getLifeCycleEndElapsedLocked(JobStatus js, long nowElapsed, long earliest) { if (js.getJob().isPrefetch()) { final long estimatedLaunchTime = mPrefetchController.getNextEstimatedLaunchTimeLocked(js); @@ -441,15 +672,31 @@ public final class FlexibilityController extends StateController { (long) Math.scalb(mRescheduledJobDeadline, js.getNumPreviousAttempts() - 2), mMaxRescheduledDeadline); } - return js.getLatestRunTimeElapsed() == JobStatus.NO_LATEST_RUNTIME - ? earliest + mFallbackFlexibilityDeadlineMs : js.getLatestRunTimeElapsed(); + + // Intentionally use the effective priority here. If a job's priority was effectively + // lowered, it will be less likely to run quickly given other policies in JobScheduler. + // Thus, there's no need to further delay the job based on flex policy. + final int jobPriority = js.getEffectivePriority(); + final int jobScore = + getScoreLocked(js.getSourceUid(), js.getSourcePackageName(), nowElapsed); + // Set an upper limit on the fallback deadline so that the delay doesn't become extreme. + final long fallbackDurationMs = Math.min(3 * mFallbackFlexibilityDeadlineMs, + mFallbackFlexibilityDeadlines.get(jobPriority, mFallbackFlexibilityDeadlineMs) + + mFallbackFlexibilityAdditionalScoreTimeFactors + .get(jobPriority, MINUTE_IN_MILLIS) * jobScore); + final long fallbackDeadlineMs = earliest + fallbackDurationMs; + + if (js.getLatestRunTimeElapsed() == JobStatus.NO_LATEST_RUNTIME) { + return fallbackDeadlineMs; + } + return Math.max(fallbackDeadlineMs, js.getLatestRunTimeElapsed()); } @VisibleForTesting @GuardedBy("mLock") int getCurPercentOfLifecycleLocked(JobStatus js, long nowElapsed) { final long earliest = getLifeCycleBeginningElapsedLocked(js); - final long latest = getLifeCycleEndElapsedLocked(js, earliest); + final long latest = getLifeCycleEndElapsedLocked(js, nowElapsed, earliest); if (latest == NO_LIFECYCLE_END || earliest >= nowElapsed) { return 0; } @@ -465,7 +712,8 @@ public final class FlexibilityController extends StateController { @GuardedBy("mLock") long getNextConstraintDropTimeElapsedLocked(JobStatus js) { final long earliest = getLifeCycleBeginningElapsedLocked(js); - final long latest = getLifeCycleEndElapsedLocked(js, earliest); + final long latest = + getLifeCycleEndElapsedLocked(js, sElapsedRealtimeClock.millis(), earliest); return getNextConstraintDropTimeElapsedLocked(js, earliest, latest); } @@ -473,19 +721,33 @@ public final class FlexibilityController extends StateController { @ElapsedRealtimeLong @GuardedBy("mLock") long getNextConstraintDropTimeElapsedLocked(JobStatus js, long earliest, long latest) { + final int[] percentsToDropConstraints = + getPercentsToDropConstraints(js.getEffectivePriority()); if (latest == NO_LIFECYCLE_END - || js.getNumDroppedFlexibleConstraints() == mPercentToDropConstraints.length) { + || js.getNumDroppedFlexibleConstraints() == percentsToDropConstraints.length) { return NO_LIFECYCLE_END; } - final int percent = mPercentToDropConstraints[js.getNumDroppedFlexibleConstraints()]; + final int percent = percentsToDropConstraints[js.getNumDroppedFlexibleConstraints()]; final long percentInTime = ((latest - earliest) * percent) / 100; return earliest + percentInTime; } + @NonNull + private int[] getPercentsToDropConstraints(int priority) { + int[] percentsToDropConstraints = mPercentsToDropConstraints.get(priority); + if (percentsToDropConstraints == null) { + Slog.wtf(TAG, "No %-to-drop for priority " + JobInfo.getPriorityString(priority)); + return new int[]{50, 60, 70, 80}; + } + return percentsToDropConstraints; + } + @Override @GuardedBy("mLock") public void onUidBiasChangedLocked(int uid, int prevBias, int newBias) { - if (prevBias != JobInfo.BIAS_TOP_APP && newBias != JobInfo.BIAS_TOP_APP) { + if (prevBias < JobInfo.BIAS_BOUND_FOREGROUND_SERVICE + && newBias < JobInfo.BIAS_BOUND_FOREGROUND_SERVICE) { + // All changes are below BFGS. There's no significant change to care about. return; } final long nowElapsed = sElapsedRealtimeClock.millis(); @@ -601,10 +863,12 @@ public final class FlexibilityController extends StateController { Integer.bitCount(getRelevantAppliedConstraintsLocked(js)); js.setNumAppliedFlexibleConstraints(numAppliedConstraints); + final int[] percentsToDropConstraints = + getPercentsToDropConstraints(js.getEffectivePriority()); final int curPercent = getCurPercentOfLifecycleLocked(js, nowElapsed); int toDrop = 0; for (int i = 0; i < numAppliedConstraints; i++) { - if (curPercent >= mPercentToDropConstraints[i]) { + if (curPercent >= percentsToDropConstraints[i]) { toDrop++; } } @@ -625,8 +889,10 @@ public final class FlexibilityController extends StateController { final int curPercent = getCurPercentOfLifecycleLocked(js, nowElapsed); int toDrop = 0; final int jsMaxFlexibleConstraints = js.getNumAppliedFlexibleConstraints(); + final int[] percentsToDropConstraints = + getPercentsToDropConstraints(js.getEffectivePriority()); for (int i = 0; i < jsMaxFlexibleConstraints; i++) { - if (curPercent >= mPercentToDropConstraints[i]) { + if (curPercent >= percentsToDropConstraints[i]) { toDrop++; } } @@ -653,7 +919,7 @@ public final class FlexibilityController extends StateController { return mTrackedJobs.size(); } - public void dump(IndentingPrintWriter pw, Predicate predicate) { + public void dump(IndentingPrintWriter pw, Predicate predicate, long nowElapsed) { for (int i = 0; i < mTrackedJobs.size(); i++) { ArraySet jobs = mTrackedJobs.get(i); for (int j = 0; j < jobs.size(); j++) { @@ -664,8 +930,18 @@ public final class FlexibilityController extends StateController { js.printUniqueId(pw); pw.print(" from "); UserHandle.formatUid(pw, js.getSourceUid()); - pw.print(" Num Required Constraints: "); + pw.print("-> Num Required Constraints: "); pw.print(js.getNumRequiredFlexibleConstraints()); + + pw.print(", lifecycle=["); + final long earliest = getLifeCycleBeginningElapsedLocked(js); + pw.print(earliest); + pw.print(", ("); + pw.print(getCurPercentOfLifecycleLocked(js, nowElapsed)); + pw.print("%), "); + pw.print(getLifeCycleEndElapsedLocked(js, nowElapsed, earliest)); + pw.print("]"); + pw.println(); } } @@ -688,13 +964,28 @@ public final class FlexibilityController extends StateController { public void scheduleDropNumConstraintsAlarm(JobStatus js, long nowElapsed) { synchronized (mLock) { final long earliest = getLifeCycleBeginningElapsedLocked(js); - final long latest = getLifeCycleEndElapsedLocked(js, earliest); + final long latest = getLifeCycleEndElapsedLocked(js, nowElapsed, earliest); + if (latest <= earliest) { + // Something has gone horribly wrong. This has only occurred on incorrectly + // configured tests, but add a check here for safety. + Slog.wtf(TAG, "Got invalid latest when scheduling alarm." + + " prefetch=" + js.getJob().isPrefetch() + + " periodic=" + js.getJob().isPeriodic()); + // Since things have gone wrong, the safest and most reliable thing to do is + // stop applying flex policy to the job. + mFlexibilityTracker.setNumDroppedFlexibleConstraints(js, + js.getNumAppliedFlexibleConstraints()); + mJobsToCheck.add(js); + mHandler.sendEmptyMessage(MSG_CHECK_JOBS); + return; + } + final long nextTimeElapsed = getNextConstraintDropTimeElapsedLocked(js, earliest, latest); if (DEBUG) { Slog.d(TAG, "scheduleDropNumConstraintsAlarm: " - + js.getSourcePackageName() + " " + js.getSourceUserId() + + js.toShortString() + " numApplied: " + js.getNumAppliedFlexibleConstraints() + " numRequired: " + js.getNumRequiredFlexibleConstraints() + " numSatisfied: " + Integer.bitCount( @@ -710,7 +1001,8 @@ public final class FlexibilityController extends StateController { } mFlexibilityTracker.setNumDroppedFlexibleConstraints(js, js.getNumAppliedFlexibleConstraints()); - mHandler.obtainMessage(MSG_UPDATE_JOB, js).sendToTarget(); + mJobsToCheck.add(js); + mHandler.sendEmptyMessage(MSG_CHECK_JOBS); return; } if (nextTimeElapsed == NO_LIFECYCLE_END) { @@ -761,10 +1053,12 @@ public final class FlexibilityController extends StateController { @Override public void handleMessage(Message msg) { switch (msg.what) { - case MSG_UPDATE_JOBS: - removeMessages(MSG_UPDATE_JOBS); + case MSG_CHECK_ALL_JOBS: + removeMessages(MSG_CHECK_ALL_JOBS); synchronized (mLock) { + mJobsToCheck.clear(); + mPackagesToCheck.clear(); final long nowElapsed = sElapsedRealtimeClock.millis(); final ArraySet changedJobs = new ArraySet<>(); @@ -790,19 +1084,50 @@ public final class FlexibilityController extends StateController { } break; - case MSG_UPDATE_JOB: + case MSG_CHECK_JOBS: synchronized (mLock) { - final JobStatus js = (JobStatus) msg.obj; - if (DEBUG) { - Slog.d("blah", "Checking on " + js.toShortString()); + final long nowElapsed = sElapsedRealtimeClock.millis(); + ArraySet changedJobs = new ArraySet<>(); + + for (int i = mJobsToCheck.size() - 1; i >= 0; --i) { + final JobStatus js = mJobsToCheck.valueAt(i); + if (DEBUG) { + Slog.d(TAG, "Checking on " + js.toShortString()); + } + if (js.setFlexibilityConstraintSatisfied( + nowElapsed, isFlexibilitySatisfiedLocked(js))) { + changedJobs.add(js); + } + } + + mJobsToCheck.clear(); + if (changedJobs.size() > 0) { + mStateChangedListener.onControllerStateChanged(changedJobs); } + } + break; + + case MSG_CHECK_PACKAGES: + synchronized (mLock) { final long nowElapsed = sElapsedRealtimeClock.millis(); - if (js.setFlexibilityConstraintSatisfied( - nowElapsed, isFlexibilitySatisfiedLocked(js))) { - // TODO(141645789): add method that will take a single job - ArraySet changedJob = new ArraySet<>(); - changedJob.add(js); - mStateChangedListener.onControllerStateChanged(changedJob); + final ArraySet changedJobs = new ArraySet<>(); + + mService.getJobStore().forEachJob( + (js) -> mPackagesToCheck.contains(js.getSourcePackageName()) + || mPackagesToCheck.contains(js.getCallingPackageName()), + (js) -> { + if (DEBUG) { + Slog.d(TAG, "Checking on " + js.toShortString()); + } + if (js.setFlexibilityConstraintSatisfied( + nowElapsed, isFlexibilitySatisfiedLocked(js))) { + changedJobs.add(js); + } + }); + + mPackagesToCheck.clear(); + if (changedJobs.size() > 0) { + mStateChangedListener.onControllerStateChanged(changedJobs); } } break; @@ -822,10 +1147,16 @@ public final class FlexibilityController extends StateController { FC_CONFIG_PREFIX + "flexibility_deadline_proximity_limit_ms"; static final String KEY_FALLBACK_FLEXIBILITY_DEADLINE = FC_CONFIG_PREFIX + "fallback_flexibility_deadline_ms"; + static final String KEY_FALLBACK_FLEXIBILITY_DEADLINES = + FC_CONFIG_PREFIX + "fallback_flexibility_deadlines"; + static final String KEY_FALLBACK_FLEXIBILITY_DEADLINE_SCORES = + FC_CONFIG_PREFIX + "fallback_flexibility_deadline_scores"; + static final String KEY_FALLBACK_FLEXIBILITY_DEADLINE_ADDITIONAL_SCORE_TIME_FACTORS = + FC_CONFIG_PREFIX + "fallback_flexibility_deadline_additional_score_time_factors"; static final String KEY_MIN_TIME_BETWEEN_FLEXIBILITY_ALARMS_MS = FC_CONFIG_PREFIX + "min_time_between_flexibility_alarms_ms"; - static final String KEY_PERCENTS_TO_DROP_NUM_FLEXIBLE_CONSTRAINTS = - FC_CONFIG_PREFIX + "percents_to_drop_num_flexible_constraints"; + static final String KEY_PERCENTS_TO_DROP_FLEXIBLE_CONSTRAINTS = + FC_CONFIG_PREFIX + "percents_to_drop_flexible_constraints"; static final String KEY_MAX_RESCHEDULED_DEADLINE_MS = FC_CONFIG_PREFIX + "max_rescheduled_deadline_ms"; static final String KEY_RESCHEDULED_JOB_DEADLINE_MS = @@ -837,12 +1168,53 @@ public final class FlexibilityController extends StateController { @VisibleForTesting static final long DEFAULT_DEADLINE_PROXIMITY_LIMIT_MS = 15 * MINUTE_IN_MILLIS; @VisibleForTesting - static final long DEFAULT_FALLBACK_FLEXIBILITY_DEADLINE_MS = 72 * HOUR_IN_MILLIS; - private static final long DEFAULT_MIN_TIME_BETWEEN_FLEXIBILITY_ALARMS_MS = MINUTE_IN_MILLIS; + static final long DEFAULT_FALLBACK_FLEXIBILITY_DEADLINE_MS = 24 * HOUR_IN_MILLIS; + static final SparseLongArray DEFAULT_FALLBACK_FLEXIBILITY_DEADLINES = new SparseLongArray(); + static final SparseIntArray DEFAULT_FALLBACK_FLEXIBILITY_DEADLINE_SCORES = + new SparseIntArray(); + static final SparseLongArray + DEFAULT_FALLBACK_FLEXIBILITY_DEADLINE_ADDITIONAL_SCORE_TIME_FACTORS = + new SparseLongArray(); @VisibleForTesting - final int[] DEFAULT_PERCENT_TO_DROP_FLEXIBLE_CONSTRAINTS = {50, 60, 70, 80}; + static final SparseArray DEFAULT_PERCENTS_TO_DROP_FLEXIBLE_CONSTRAINTS = + new SparseArray<>(); + + static { + DEFAULT_FALLBACK_FLEXIBILITY_DEADLINES.put(PRIORITY_MAX, HOUR_IN_MILLIS); + DEFAULT_FALLBACK_FLEXIBILITY_DEADLINES.put(PRIORITY_HIGH, 6 * HOUR_IN_MILLIS); + DEFAULT_FALLBACK_FLEXIBILITY_DEADLINES.put(PRIORITY_DEFAULT, 12 * HOUR_IN_MILLIS); + DEFAULT_FALLBACK_FLEXIBILITY_DEADLINES.put(PRIORITY_LOW, 24 * HOUR_IN_MILLIS); + DEFAULT_FALLBACK_FLEXIBILITY_DEADLINES.put(PRIORITY_MIN, 48 * HOUR_IN_MILLIS); + DEFAULT_FALLBACK_FLEXIBILITY_DEADLINE_SCORES.put(PRIORITY_MAX, 5); + DEFAULT_FALLBACK_FLEXIBILITY_DEADLINE_SCORES.put(PRIORITY_HIGH, 4); + DEFAULT_FALLBACK_FLEXIBILITY_DEADLINE_SCORES.put(PRIORITY_DEFAULT, 3); + DEFAULT_FALLBACK_FLEXIBILITY_DEADLINE_SCORES.put(PRIORITY_LOW, 2); + DEFAULT_FALLBACK_FLEXIBILITY_DEADLINE_SCORES.put(PRIORITY_MIN, 1); + DEFAULT_FALLBACK_FLEXIBILITY_DEADLINE_ADDITIONAL_SCORE_TIME_FACTORS + .put(PRIORITY_MAX, 0); + DEFAULT_FALLBACK_FLEXIBILITY_DEADLINE_ADDITIONAL_SCORE_TIME_FACTORS + .put(PRIORITY_HIGH, 3 * MINUTE_IN_MILLIS); + DEFAULT_FALLBACK_FLEXIBILITY_DEADLINE_ADDITIONAL_SCORE_TIME_FACTORS + .put(PRIORITY_DEFAULT, 2 * MINUTE_IN_MILLIS); + DEFAULT_FALLBACK_FLEXIBILITY_DEADLINE_ADDITIONAL_SCORE_TIME_FACTORS + .put(PRIORITY_LOW, 1 * MINUTE_IN_MILLIS); + DEFAULT_FALLBACK_FLEXIBILITY_DEADLINE_ADDITIONAL_SCORE_TIME_FACTORS + .put(PRIORITY_MIN, 1 * MINUTE_IN_MILLIS); + DEFAULT_PERCENTS_TO_DROP_FLEXIBLE_CONSTRAINTS + .put(PRIORITY_MAX, new int[]{1, 2, 3, 4}); + DEFAULT_PERCENTS_TO_DROP_FLEXIBLE_CONSTRAINTS + .put(PRIORITY_HIGH, new int[]{33, 50, 60, 75}); + DEFAULT_PERCENTS_TO_DROP_FLEXIBLE_CONSTRAINTS + .put(PRIORITY_DEFAULT, new int[]{50, 60, 70, 80}); + DEFAULT_PERCENTS_TO_DROP_FLEXIBLE_CONSTRAINTS + .put(PRIORITY_LOW, new int[]{50, 60, 70, 80}); + DEFAULT_PERCENTS_TO_DROP_FLEXIBLE_CONSTRAINTS + .put(PRIORITY_MIN, new int[]{55, 65, 75, 85}); + } + + private static final long DEFAULT_MIN_TIME_BETWEEN_FLEXIBILITY_ALARMS_MS = MINUTE_IN_MILLIS; private static final long DEFAULT_RESCHEDULED_JOB_DEADLINE_MS = HOUR_IN_MILLIS; - private static final long DEFAULT_MAX_RESCHEDULED_DEADLINE_MS = 5 * DAY_IN_MILLIS; + private static final long DEFAULT_MAX_RESCHEDULED_DEADLINE_MS = DAY_IN_MILLIS; @VisibleForTesting static final long DEFAULT_UNSEEN_CONSTRAINT_GRACE_PERIOD_MS = 3 * DAY_IN_MILLIS; @@ -854,9 +1226,11 @@ public final class FlexibilityController extends StateController { public long FALLBACK_FLEXIBILITY_DEADLINE_MS = DEFAULT_FALLBACK_FLEXIBILITY_DEADLINE_MS; public long MIN_TIME_BETWEEN_FLEXIBILITY_ALARMS_MS = DEFAULT_MIN_TIME_BETWEEN_FLEXIBILITY_ALARMS_MS; - /** The percentages of a jobs' lifecycle to drop the number of required constraints. */ - public int[] PERCENTS_TO_DROP_NUM_FLEXIBLE_CONSTRAINTS = - DEFAULT_PERCENT_TO_DROP_FLEXIBLE_CONSTRAINTS; + /** + * The percentages of a jobs' lifecycle to drop the number of required constraints. + * Keyed by job priority. + */ + public SparseArray PERCENTS_TO_DROP_FLEXIBLE_CONSTRAINTS = new SparseArray<>(); /** Initial fallback flexible deadline for rescheduled jobs. */ public long RESCHEDULED_JOB_DEADLINE_MS = DEFAULT_RESCHEDULED_JOB_DEADLINE_MS; /** The max deadline for rescheduled jobs. */ @@ -866,10 +1240,56 @@ public final class FlexibilityController extends StateController { * it in order to run jobs. */ public long UNSEEN_CONSTRAINT_GRACE_PERIOD_MS = DEFAULT_UNSEEN_CONSTRAINT_GRACE_PERIOD_MS; + /** + * The base fallback deadlines to use if a job doesn't have its own deadline. Values are in + * milliseconds and keyed by job priority. + */ + public final SparseLongArray FALLBACK_FLEXIBILITY_DEADLINES = new SparseLongArray(); + /** + * The score to ascribe to each job, keyed by job priority. + */ + public final SparseIntArray FALLBACK_FLEXIBILITY_DEADLINE_SCORES = new SparseIntArray(); + /** + * How much additional time to increase the fallback deadline by based on the app's current + * job run score. Values are in + * milliseconds and keyed by job priority. + */ + public final SparseLongArray FALLBACK_FLEXIBILITY_DEADLINE_ADDITIONAL_SCORE_TIME_FACTORS = + new SparseLongArray(); + + FcConfig() { + // Copy the values from the DEFAULT_* data structures to avoid accidentally modifying + // the DEFAULT_* data structures in other parts of the code. + for (int i = 0; i < DEFAULT_FALLBACK_FLEXIBILITY_DEADLINES.size(); ++i) { + FALLBACK_FLEXIBILITY_DEADLINES.put( + DEFAULT_FALLBACK_FLEXIBILITY_DEADLINES.keyAt(i), + DEFAULT_FALLBACK_FLEXIBILITY_DEADLINES.valueAt(i)); + } + for (int i = 0; i < DEFAULT_FALLBACK_FLEXIBILITY_DEADLINE_SCORES.size(); ++i) { + FALLBACK_FLEXIBILITY_DEADLINE_SCORES.put( + DEFAULT_FALLBACK_FLEXIBILITY_DEADLINE_SCORES.keyAt(i), + DEFAULT_FALLBACK_FLEXIBILITY_DEADLINE_SCORES.valueAt(i)); + } + for (int i = 0; + i < DEFAULT_FALLBACK_FLEXIBILITY_DEADLINE_ADDITIONAL_SCORE_TIME_FACTORS.size(); + ++i) { + FALLBACK_FLEXIBILITY_DEADLINE_ADDITIONAL_SCORE_TIME_FACTORS.put( + DEFAULT_FALLBACK_FLEXIBILITY_DEADLINE_ADDITIONAL_SCORE_TIME_FACTORS + .keyAt(i), + DEFAULT_FALLBACK_FLEXIBILITY_DEADLINE_ADDITIONAL_SCORE_TIME_FACTORS + .valueAt(i)); + } + for (int i = 0; i < DEFAULT_PERCENTS_TO_DROP_FLEXIBLE_CONSTRAINTS.size(); ++i) { + PERCENTS_TO_DROP_FLEXIBLE_CONSTRAINTS.put( + DEFAULT_PERCENTS_TO_DROP_FLEXIBLE_CONSTRAINTS.keyAt(i), + DEFAULT_PERCENTS_TO_DROP_FLEXIBLE_CONSTRAINTS.valueAt(i)); + } + } @GuardedBy("mLock") public void processConstantLocked(@NonNull DeviceConfig.Properties properties, @NonNull String key) { + // TODO(257322915): add appropriate minimums and maximums to constants when parsing switch (key) { case KEY_APPLIED_CONSTRAINTS: APPLIED_CONSTRAINTS = @@ -882,10 +1302,12 @@ public final class FlexibilityController extends StateController { mFlexibilityEnabled = true; mPrefetchController .registerPrefetchChangedListener(mPrefetchChangedListener); + mSpecialAppTracker.startTracking(); } else { mFlexibilityEnabled = false; mPrefetchController .unRegisterPrefetchChangedListener(mPrefetchChangedListener); + mSpecialAppTracker.stopTracking(); } } break; @@ -918,6 +1340,33 @@ public final class FlexibilityController extends StateController { properties.getLong(key, DEFAULT_FALLBACK_FLEXIBILITY_DEADLINE_MS); if (mFallbackFlexibilityDeadlineMs != FALLBACK_FLEXIBILITY_DEADLINE_MS) { mFallbackFlexibilityDeadlineMs = FALLBACK_FLEXIBILITY_DEADLINE_MS; + } + break; + case KEY_FALLBACK_FLEXIBILITY_DEADLINES: + if (parsePriorityToLongKeyValueString( + properties.getString(key, null), + FALLBACK_FLEXIBILITY_DEADLINES, + DEFAULT_FALLBACK_FLEXIBILITY_DEADLINES)) { + mFallbackFlexibilityDeadlines = FALLBACK_FLEXIBILITY_DEADLINES; + mShouldReevaluateConstraints = true; + } + break; + case KEY_FALLBACK_FLEXIBILITY_DEADLINE_SCORES: + if (parsePriorityToIntKeyValueString( + properties.getString(key, null), + FALLBACK_FLEXIBILITY_DEADLINE_SCORES, + DEFAULT_FALLBACK_FLEXIBILITY_DEADLINE_SCORES)) { + mFallbackFlexibilityDeadlineScores = FALLBACK_FLEXIBILITY_DEADLINE_SCORES; + mShouldReevaluateConstraints = true; + } + break; + case KEY_FALLBACK_FLEXIBILITY_DEADLINE_ADDITIONAL_SCORE_TIME_FACTORS: + if (parsePriorityToLongKeyValueString( + properties.getString(key, null), + FALLBACK_FLEXIBILITY_DEADLINE_ADDITIONAL_SCORE_TIME_FACTORS, + DEFAULT_FALLBACK_FLEXIBILITY_DEADLINE_ADDITIONAL_SCORE_TIME_FACTORS)) { + mFallbackFlexibilityAdditionalScoreTimeFactors = + FALLBACK_FLEXIBILITY_DEADLINE_ADDITIONAL_SCORE_TIME_FACTORS; mShouldReevaluateConstraints = true; } break; @@ -940,25 +1389,69 @@ public final class FlexibilityController extends StateController { mShouldReevaluateConstraints = true; } break; - case KEY_PERCENTS_TO_DROP_NUM_FLEXIBLE_CONSTRAINTS: - String dropPercentString = properties.getString(key, ""); - PERCENTS_TO_DROP_NUM_FLEXIBLE_CONSTRAINTS = - parsePercentToDropString(dropPercentString); - if (PERCENTS_TO_DROP_NUM_FLEXIBLE_CONSTRAINTS != null - && !Arrays.equals(mPercentToDropConstraints, - PERCENTS_TO_DROP_NUM_FLEXIBLE_CONSTRAINTS)) { - mPercentToDropConstraints = PERCENTS_TO_DROP_NUM_FLEXIBLE_CONSTRAINTS; + case KEY_PERCENTS_TO_DROP_FLEXIBLE_CONSTRAINTS: + if (parsePercentToDropKeyValueString( + properties.getString(key, null), + PERCENTS_TO_DROP_FLEXIBLE_CONSTRAINTS, + DEFAULT_PERCENTS_TO_DROP_FLEXIBLE_CONSTRAINTS)) { + mPercentsToDropConstraints = PERCENTS_TO_DROP_FLEXIBLE_CONSTRAINTS; mShouldReevaluateConstraints = true; } break; } } - private int[] parsePercentToDropString(String s) { - String[] dropPercentString = s.split(","); + private boolean parsePercentToDropKeyValueString(@Nullable String s, + SparseArray into, SparseArray defaults) { + final KeyValueListParser priorityParser = new KeyValueListParser(','); + try { + priorityParser.setString(s); + } catch (IllegalArgumentException e) { + Slog.wtf(TAG, "Bad percent to drop key value string given", e); + // Clear the string and continue with the defaults. + priorityParser.setString(null); + } + + final int[] oldMax = into.get(PRIORITY_MAX); + final int[] oldHigh = into.get(PRIORITY_HIGH); + final int[] oldDefault = into.get(PRIORITY_DEFAULT); + final int[] oldLow = into.get(PRIORITY_LOW); + final int[] oldMin = into.get(PRIORITY_MIN); + + final int[] newMax = parsePercentToDropString(priorityParser.getString( + String.valueOf(PRIORITY_MAX), null)); + final int[] newHigh = parsePercentToDropString(priorityParser.getString( + String.valueOf(PRIORITY_HIGH), null)); + final int[] newDefault = parsePercentToDropString(priorityParser.getString( + String.valueOf(PRIORITY_DEFAULT), null)); + final int[] newLow = parsePercentToDropString(priorityParser.getString( + String.valueOf(PRIORITY_LOW), null)); + final int[] newMin = parsePercentToDropString(priorityParser.getString( + String.valueOf(PRIORITY_MIN), null)); + + into.put(PRIORITY_MAX, newMax == null ? defaults.get(PRIORITY_MAX) : newMax); + into.put(PRIORITY_HIGH, newHigh == null ? defaults.get(PRIORITY_HIGH) : newHigh); + into.put(PRIORITY_DEFAULT, + newDefault == null ? defaults.get(PRIORITY_DEFAULT) : newDefault); + into.put(PRIORITY_LOW, newLow == null ? defaults.get(PRIORITY_LOW) : newLow); + into.put(PRIORITY_MIN, newMin == null ? defaults.get(PRIORITY_MIN) : newMin); + + return !Arrays.equals(oldMax, into.get(PRIORITY_MAX)) + || !Arrays.equals(oldHigh, into.get(PRIORITY_HIGH)) + || !Arrays.equals(oldDefault, into.get(PRIORITY_DEFAULT)) + || !Arrays.equals(oldLow, into.get(PRIORITY_LOW)) + || !Arrays.equals(oldMin, into.get(PRIORITY_MIN)); + } + + @Nullable + private int[] parsePercentToDropString(@Nullable String s) { + if (s == null || s.isEmpty()) { + return null; + } + final String[] dropPercentString = s.split("\\|"); int[] dropPercentInt = new int[Integer.bitCount(FLEXIBLE_CONSTRAINTS)]; if (dropPercentInt.length != dropPercentString.length) { - return DEFAULT_PERCENT_TO_DROP_FLEXIBLE_CONSTRAINTS; + return null; } int prevPercent = 0; for (int i = 0; i < dropPercentString.length; i++) { @@ -967,11 +1460,15 @@ public final class FlexibilityController extends StateController { Integer.parseInt(dropPercentString[i]); } catch (NumberFormatException ex) { Slog.e(TAG, "Provided string was improperly formatted.", ex); - return DEFAULT_PERCENT_TO_DROP_FLEXIBLE_CONSTRAINTS; + return null; } if (dropPercentInt[i] < prevPercent) { Slog.wtf(TAG, "Percents to drop constraints were not in increasing order."); - return DEFAULT_PERCENT_TO_DROP_FLEXIBLE_CONSTRAINTS; + return null; + } + if (dropPercentInt[i] > 100) { + Slog.e(TAG, "Found % over 100"); + return null; } prevPercent = dropPercentInt[i]; } @@ -979,19 +1476,127 @@ public final class FlexibilityController extends StateController { return dropPercentInt; } + /** + * Parses the input string, expecting it to a key-value string where the keys are job + * priorities, and replaces everything in {@code into} with the values from the string, + * or the default values if the string contains none. + * + * Returns true if any values changed. + */ + private boolean parsePriorityToIntKeyValueString(@Nullable String s, + SparseIntArray into, SparseIntArray defaults) { + final KeyValueListParser parser = new KeyValueListParser(','); + try { + parser.setString(s); + } catch (IllegalArgumentException e) { + Slog.wtf(TAG, "Bad string given", e); + // Clear the string and continue with the defaults. + parser.setString(null); + } + + final int oldMax = into.get(PRIORITY_MAX); + final int oldHigh = into.get(PRIORITY_HIGH); + final int oldDefault = into.get(PRIORITY_DEFAULT); + final int oldLow = into.get(PRIORITY_LOW); + final int oldMin = into.get(PRIORITY_MIN); + + final int newMax = parser.getInt(String.valueOf(PRIORITY_MAX), + defaults.get(PRIORITY_MAX)); + final int newHigh = parser.getInt(String.valueOf(PRIORITY_HIGH), + defaults.get(PRIORITY_HIGH)); + final int newDefault = parser.getInt(String.valueOf(PRIORITY_DEFAULT), + defaults.get(PRIORITY_DEFAULT)); + final int newLow = parser.getInt(String.valueOf(PRIORITY_LOW), + defaults.get(PRIORITY_LOW)); + final int newMin = parser.getInt(String.valueOf(PRIORITY_MIN), + defaults.get(PRIORITY_MIN)); + + into.put(PRIORITY_MAX, newMax); + into.put(PRIORITY_HIGH, newHigh); + into.put(PRIORITY_DEFAULT, newDefault); + into.put(PRIORITY_LOW, newLow); + into.put(PRIORITY_MIN, newMin); + + return oldMax != newMax + || oldHigh != newHigh + || oldDefault != newDefault + || oldLow != newLow + || oldMin != newMin; + } + + /** + * Parses the input string, expecting it to a key-value string where the keys are job + * priorities, and replaces everything in {@code into} with the values from the string, + * or the default values if the string contains none. + * + * Returns true if any values changed. + */ + private boolean parsePriorityToLongKeyValueString(@Nullable String s, + SparseLongArray into, SparseLongArray defaults) { + final KeyValueListParser parser = new KeyValueListParser(','); + try { + parser.setString(s); + } catch (IllegalArgumentException e) { + Slog.wtf(TAG, "Bad string given", e); + // Clear the string and continue with the defaults. + parser.setString(null); + } + + final long oldMax = into.get(PRIORITY_MAX); + final long oldHigh = into.get(PRIORITY_HIGH); + final long oldDefault = into.get(PRIORITY_DEFAULT); + final long oldLow = into.get(PRIORITY_LOW); + final long oldMin = into.get(PRIORITY_MIN); + + final long newMax = parser.getLong(String.valueOf(PRIORITY_MAX), + defaults.get(PRIORITY_MAX)); + final long newHigh = parser.getLong(String.valueOf(PRIORITY_HIGH), + defaults.get(PRIORITY_HIGH)); + final long newDefault = parser.getLong(String.valueOf(PRIORITY_DEFAULT), + defaults.get(PRIORITY_DEFAULT)); + final long newLow = parser.getLong(String.valueOf(PRIORITY_LOW), + defaults.get(PRIORITY_LOW)); + final long newMin = parser.getLong(String.valueOf(PRIORITY_MIN), + defaults.get(PRIORITY_MIN)); + + into.put(PRIORITY_MAX, newMax); + into.put(PRIORITY_HIGH, newHigh); + into.put(PRIORITY_DEFAULT, newDefault); + into.put(PRIORITY_LOW, newLow); + into.put(PRIORITY_MIN, newMin); + + return oldMax != newMax + || oldHigh != newHigh + || oldDefault != newDefault + || oldLow != newLow + || oldMin != newMin; + } + private void dump(IndentingPrintWriter pw) { pw.println(); pw.print(FlexibilityController.class.getSimpleName()); pw.println(":"); pw.increaseIndent(); - pw.print(KEY_APPLIED_CONSTRAINTS, APPLIED_CONSTRAINTS).println(); + pw.print(KEY_APPLIED_CONSTRAINTS, APPLIED_CONSTRAINTS); + pw.print("("); + if (APPLIED_CONSTRAINTS != 0) { + JobStatus.dumpConstraints(pw, APPLIED_CONSTRAINTS); + } else { + pw.print("nothing"); + } + pw.println(")"); pw.print(KEY_DEADLINE_PROXIMITY_LIMIT, DEADLINE_PROXIMITY_LIMIT_MS).println(); pw.print(KEY_FALLBACK_FLEXIBILITY_DEADLINE, FALLBACK_FLEXIBILITY_DEADLINE_MS).println(); + pw.print(KEY_FALLBACK_FLEXIBILITY_DEADLINES, FALLBACK_FLEXIBILITY_DEADLINES).println(); + pw.print(KEY_FALLBACK_FLEXIBILITY_DEADLINE_SCORES, + FALLBACK_FLEXIBILITY_DEADLINE_SCORES).println(); + pw.print(KEY_FALLBACK_FLEXIBILITY_DEADLINE_ADDITIONAL_SCORE_TIME_FACTORS, + FALLBACK_FLEXIBILITY_DEADLINE_ADDITIONAL_SCORE_TIME_FACTORS).println(); pw.print(KEY_MIN_TIME_BETWEEN_FLEXIBILITY_ALARMS_MS, MIN_TIME_BETWEEN_FLEXIBILITY_ALARMS_MS).println(); - pw.print(KEY_PERCENTS_TO_DROP_NUM_FLEXIBLE_CONSTRAINTS, - PERCENTS_TO_DROP_NUM_FLEXIBLE_CONSTRAINTS).println(); + pw.print(KEY_PERCENTS_TO_DROP_FLEXIBLE_CONSTRAINTS, + PERCENTS_TO_DROP_FLEXIBLE_CONSTRAINTS).println(); pw.print(KEY_RESCHEDULED_JOB_DEADLINE_MS, RESCHEDULED_JOB_DEADLINE_MS).println(); pw.print(KEY_MAX_RESCHEDULED_DEADLINE_MS, MAX_RESCHEDULED_DEADLINE_MS).println(); pw.print(KEY_UNSEEN_CONSTRAINT_GRACE_PERIOD_MS, UNSEEN_CONSTRAINT_GRACE_PERIOD_MS) @@ -1007,6 +1612,176 @@ public final class FlexibilityController extends StateController { return mFcConfig; } + private class SpecialAppTracker { + /** + * Lock for objects inside this class. This should never be held when attempting to acquire + * {@link #mLock}. It is fine to acquire this if already holding {@link #mLock}. + */ + private final Object mSatLock = new Object(); + + private DeviceIdleInternal mDeviceIdleInternal; + + /** Set of all apps that have been deemed special, keyed by user ID. */ + private final SparseSetArray mSpecialApps = new SparseSetArray<>(); + @GuardedBy("mSatLock") + private final ArraySet mPowerAllowlistedApps = new ArraySet<>(); + + private final BroadcastReceiver mBroadcastReceiver = new BroadcastReceiver() { + @Override + public void onReceive(Context context, Intent intent) { + switch (intent.getAction()) { + case PowerManager.ACTION_POWER_SAVE_WHITELIST_CHANGED: + mHandler.post(SpecialAppTracker.this::updatePowerAllowlistCache); + break; + } + } + }; + + public boolean isSpecialApp(final int userId, @NonNull String packageName) { + synchronized (mSatLock) { + if (mSpecialApps.contains(UserHandle.USER_ALL, packageName)) { + return true; + } + if (mSpecialApps.contains(userId, packageName)) { + return true; + } + } + return false; + } + + private boolean isSpecialAppInternal(final int userId, @NonNull String packageName) { + synchronized (mSatLock) { + if (mPowerAllowlistedApps.contains(packageName)) { + return true; + } + } + return false; + } + + private void onAppRemoved(final int userId, String packageName) { + synchronized (mSatLock) { + // Don't touch the USER_ALL set here. If the app is completely removed from the + // device, any list that affects USER_ALL should update and this would eventually + // be updated with those lists no longer containing the app. + mSpecialApps.remove(userId, packageName); + } + } + + private void onSystemServicesReady() { + mDeviceIdleInternal = LocalServices.getService(DeviceIdleInternal.class); + + synchronized (mLock) { + if (mFlexibilityEnabled) { + mHandler.post(SpecialAppTracker.this::updatePowerAllowlistCache); + } + } + } + + private void onUserRemoved(final int userId) { + synchronized (mSatLock) { + mSpecialApps.remove(userId); + } + } + + private void startTracking() { + IntentFilter filter = new IntentFilter( + PowerManager.ACTION_POWER_SAVE_WHITELIST_CHANGED); + mContext.registerReceiver(mBroadcastReceiver, filter); + + updatePowerAllowlistCache(); + } + + private void stopTracking() { + mContext.unregisterReceiver(mBroadcastReceiver); + + synchronized (mSatLock) { + mPowerAllowlistedApps.clear(); + mSpecialApps.clear(); + } + } + + /** + * Update the processed special app set for the specified user ID, only looking at the + * specified set of apps. This method must NEVER be called while holding + * {@link #mSatLock}. + */ + private void updateSpecialAppSetUnlocked(final int userId, @NonNull ArraySet pkgs) { + // This method may need to acquire mLock, so ensure that mSatLock isn't held to avoid + // lock inversion. + if (Thread.holdsLock(mSatLock)) { + throw new IllegalStateException("Must never hold local mSatLock"); + } + if (pkgs.size() == 0) { + return; + } + final ArraySet changedPkgs = new ArraySet<>(); + + synchronized (mSatLock) { + for (int i = pkgs.size() - 1; i >= 0; --i) { + final String pkgName = pkgs.valueAt(i); + if (isSpecialAppInternal(userId, pkgName)) { + if (mSpecialApps.add(userId, pkgName)) { + changedPkgs.add(pkgName); + } + } else if (mSpecialApps.remove(userId, pkgName)) { + changedPkgs.add(pkgName); + } + } + } + + if (changedPkgs.size() > 0) { + synchronized (mLock) { + mPackagesToCheck.addAll(changedPkgs); + mHandler.sendEmptyMessage(MSG_CHECK_PACKAGES); + } + } + } + + private void updatePowerAllowlistCache() { + if (mDeviceIdleInternal == null) { + return; + } + + // Don't call out to DeviceIdleController with the lock held. + final String[] allowlistedPkgs = mDeviceIdleInternal.getFullPowerWhitelistExceptIdle(); + final ArraySet changedPkgs = new ArraySet<>(); + synchronized (mSatLock) { + changedPkgs.addAll(mPowerAllowlistedApps); + mPowerAllowlistedApps.clear(); + for (String pkgName : allowlistedPkgs) { + mPowerAllowlistedApps.add(pkgName); + if (!changedPkgs.remove(pkgName)) { + // The package wasn't in the previous set of allowlisted apps. Add it + // since its state has changed. + changedPkgs.add(pkgName); + } + } + } + + // The full allowlist is currently user-agnostic, so use USER_ALL for these packages. + updateSpecialAppSetUnlocked(UserHandle.USER_ALL, changedPkgs); + } + + public void dump(@NonNull IndentingPrintWriter pw) { + pw.println("Special apps:"); + pw.increaseIndent(); + + synchronized (mSatLock) { + for (int u = 0; u < mSpecialApps.size(); ++u) { + pw.print(mSpecialApps.keyAt(u)); + pw.print(": "); + pw.println(mSpecialApps.valuesAt(u)); + } + + pw.println(); + pw.print("Power allowlisted packages: "); + pw.println(mPowerAllowlistedApps); + } + + pw.decreaseIndent(); + } + } + @Override @GuardedBy("mLock") public void dumpConstants(IndentingPrintWriter pw) { @@ -1044,7 +1819,24 @@ public final class FlexibilityController extends StateController { pw.decreaseIndent(); pw.println(); - mFlexibilityTracker.dump(pw, predicate); + mSpecialAppTracker.dump(pw); + + pw.println(); + mFlexibilityTracker.dump(pw, predicate, nowElapsed); + + pw.println(); + pw.println("Job scores:"); + pw.increaseIndent(); + mJobScoreTrackers.forEach((uid, pkgName, jobScoreTracker) -> { + pw.print(uid); + pw.print("/"); + pw.print(pkgName); + pw.print(": "); + jobScoreTracker.dump(pw, nowElapsed); + pw.println(); + }); + pw.decreaseIndent(); + pw.println(); mFlexibilityAlarmQueue.dump(pw); } diff --git a/apex/jobscheduler/service/java/com/android/server/job/controllers/JobStatus.java b/apex/jobscheduler/service/java/com/android/server/job/controllers/JobStatus.java index 0d5d11e98860114e1f79a94e9ea2819d209cac7e..edd86e3454a5b02649641c66acb23357f8995c70 100644 --- a/apex/jobscheduler/service/java/com/android/server/job/controllers/JobStatus.java +++ b/apex/jobscheduler/service/java/com/android/server/job/controllers/JobStatus.java @@ -16,8 +16,6 @@ package com.android.server.job.controllers; -import static android.text.format.DateUtils.HOUR_IN_MILLIS; - import static com.android.server.job.JobSchedulerService.ACTIVE_INDEX; import static com.android.server.job.JobSchedulerService.EXEMPTED_INDEX; import static com.android.server.job.JobSchedulerService.NEVER_INDEX; @@ -48,6 +46,7 @@ import android.util.ArrayMap; import android.util.ArraySet; import android.util.IndentingPrintWriter; import android.util.Pair; +import android.util.Patterns; import android.util.Range; import android.util.Slog; import android.util.TimeUtils; @@ -76,6 +75,7 @@ import java.util.Collections; import java.util.Objects; import java.util.Random; import java.util.function.Predicate; +import java.util.regex.Pattern; /** * Uniquely identifies a job internally. @@ -106,11 +106,8 @@ public final class JobStatus { public static final long NO_LATEST_RUNTIME = Long.MAX_VALUE; public static final long NO_EARLIEST_RUNTIME = 0L; - @VisibleForTesting(visibility = VisibleForTesting.Visibility.PACKAGE) public static final int CONSTRAINT_CHARGING = JobInfo.CONSTRAINT_FLAG_CHARGING; // 1 < 0 - @VisibleForTesting(visibility = VisibleForTesting.Visibility.PACKAGE) public static final int CONSTRAINT_IDLE = JobInfo.CONSTRAINT_FLAG_DEVICE_IDLE; // 1 << 2 - @VisibleForTesting(visibility = VisibleForTesting.Visibility.PACKAGE) public static final int CONSTRAINT_BATTERY_NOT_LOW = JobInfo.CONSTRAINT_FLAG_BATTERY_NOT_LOW; // 1 << 1 @VisibleForTesting(visibility = VisibleForTesting.Visibility.PACKAGE) @@ -125,7 +122,7 @@ public final class JobStatus { static final int CONSTRAINT_WITHIN_QUOTA = 1 << 24; // Implicit constraint static final int CONSTRAINT_PREFETCH = 1 << 23; static final int CONSTRAINT_BACKGROUND_NOT_RESTRICTED = 1 << 22; // Implicit constraint - static final int CONSTRAINT_FLEXIBLE = 1 << 21; // Implicit constraint + public static final int CONSTRAINT_FLEXIBLE = 1 << 21; // Implicit constraint private static final int IMPLICIT_CONSTRAINTS = 0 | CONSTRAINT_BACKGROUND_NOT_RESTRICTED @@ -206,6 +203,17 @@ public final class JobStatus { // TODO(b/129954980): ensure this doesn't spam statsd, especially at boot private static final boolean STATS_LOG_ENABLED = false; + /** + * Simple patterns to match some common forms of PII. This is not intended all-encompassing and + * any clients should aim to do additional filtering. + */ + private static final ArrayMap BASIC_PII_FILTERS = new ArrayMap<>(); + + static { + BASIC_PII_FILTERS.put(Patterns.EMAIL_ADDRESS, "[EMAIL]"); + BASIC_PII_FILTERS.put(Patterns.PHONE, "[PHONE]"); + } + // No override. public static final int OVERRIDE_NONE = 0; // Override to improve sorting order. Does not affect constraint evaluation. @@ -252,6 +260,18 @@ public final class JobStatus { /** An ID that can be used to uniquely identify the job when logging statsd metrics. */ private final long mLoggingJobId; + /** + * List of tags from {@link JobInfo#getDebugTags()}, filtered using {@link #BASIC_PII_FILTERS}. + * Lazily loaded in {@link #getFilteredDebugTags()}. + */ + @Nullable + private String[] mFilteredDebugTags; + /** + * Trace tag from {@link JobInfo#getTraceTag()}, filtered using {@link #BASIC_PII_FILTERS}. + * Lazily loaded in {@link #getFilteredTraceTag()}. + */ + @Nullable + private String mFilteredTraceTag; /** * Tag to identify the wakelock held for this job. Lazily loaded in * {@link #getWakelockTag()} since it's not typically needed until the job is about to run. @@ -408,9 +428,6 @@ public final class JobStatus { */ public static final int INTERNAL_FLAG_DEMOTED_BY_SYSTEM_UIJ = 1 << 2; - /** Minimum difference between start and end time to have flexible constraint */ - @VisibleForTesting - static final long MIN_WINDOW_FOR_FLEXIBILITY_MS = HOUR_IN_MILLIS; /** * Versatile, persistable flags for a job that's updated within the system server, * as opposed to {@link JobInfo#flags} that's set by callers. @@ -635,7 +652,7 @@ public final class JobStatus { .build()); // Don't perform validation checks at this point since we've already passed the // initial validation check. - job = builder.build(false, false, false); + job = builder.build(false, false, false, false); } this.job = job; @@ -686,14 +703,10 @@ public final class JobStatus { final boolean lacksSomeFlexibleConstraints = ((~requiredConstraints) & SYSTEM_WIDE_FLEXIBLE_CONSTRAINTS) != 0 || mCanApplyTransportAffinities; - final boolean satisfiesMinWindowException = - (latestRunTimeElapsedMillis - earliestRunTimeElapsedMillis) - >= MIN_WINDOW_FOR_FLEXIBILITY_MS; // The first time a job is rescheduled it will not be subject to flexible constraints. // Otherwise, every consecutive reschedule increases a jobs' flexibility deadline. if (!isRequestedExpeditedJob() && !job.isUserInitiated() - && satisfiesMinWindowException && (numFailures + numSystemStops) != 1 && lacksSomeFlexibleConstraints) { requiredConstraints |= CONSTRAINT_FLEXIBLE; @@ -1200,21 +1213,25 @@ public final class JobStatus { return ACTIVE_INDEX; } - final int bucketWithMediaExemption; - if (actualBucket != RESTRICTED_INDEX && actualBucket != NEVER_INDEX - && mHasMediaBackupExemption) { + final boolean isEligibleAsBackupJob = job.getTriggerContentUris() != null + && job.getRequiredNetwork() != null + && !job.hasLateConstraint() + && mJobSchedulerInternal.hasRunBackupJobsPermission(sourcePackageName, sourceUid); + final boolean isBackupExempt = mHasMediaBackupExemption || isEligibleAsBackupJob; + final int bucketWithBackupExemption; + if (actualBucket != RESTRICTED_INDEX && actualBucket != NEVER_INDEX && isBackupExempt) { // Treat it as if it's at most WORKING_INDEX (lower index grants higher quota) since // media backup jobs are important to the user, and the source package may not have // been used directly in a while. - bucketWithMediaExemption = Math.min(WORKING_INDEX, actualBucket); + bucketWithBackupExemption = Math.min(WORKING_INDEX, actualBucket); } else { - bucketWithMediaExemption = actualBucket; + bucketWithBackupExemption = actualBucket; } // If the app is considered buggy, but hasn't yet been put in the RESTRICTED bucket // (potentially because it's used frequently by the user), limit its effective bucket // so that it doesn't get to run as much as a normal ACTIVE app. - if (isBuggy && bucketWithMediaExemption < WORKING_INDEX) { + if (isBuggy && bucketWithBackupExemption < WORKING_INDEX) { if (!mIsDowngradedDueToBuggyApp) { // Safety check to avoid logging multiple times for the same job. Counter.logIncrementWithUid( @@ -1224,7 +1241,7 @@ public final class JobStatus { } return WORKING_INDEX; } - return bucketWithMediaExemption; + return bucketWithBackupExemption; } /** Returns the real standby bucket of the job. */ @@ -1328,6 +1345,47 @@ public final class JobStatus { return batteryName; } + @VisibleForTesting + @NonNull + static String applyBasicPiiFilters(@NonNull String val) { + for (int i = BASIC_PII_FILTERS.size() - 1; i >= 0; --i) { + val = BASIC_PII_FILTERS.keyAt(i).matcher(val).replaceAll(BASIC_PII_FILTERS.valueAt(i)); + } + return val; + } + + /** + * List of tags from {@link JobInfo#getDebugTags()}, filtered using a basic set of PII filters. + */ + @NonNull + public String[] getFilteredDebugTags() { + if (mFilteredDebugTags != null) { + return mFilteredDebugTags; + } + final ArraySet debugTags = job.getDebugTagsArraySet(); + mFilteredDebugTags = new String[debugTags.size()]; + for (int i = 0; i < mFilteredDebugTags.length; ++i) { + mFilteredDebugTags[i] = applyBasicPiiFilters(debugTags.valueAt(i)); + } + return mFilteredDebugTags; + } + + /** + * Trace tag from {@link JobInfo#getTraceTag()}, filtered using a basic set of PII filters. + */ + @Nullable + public String getFilteredTraceTag() { + if (mFilteredTraceTag != null) { + return mFilteredTraceTag; + } + final String rawTag = job.getTraceTag(); + if (rawTag == null) { + return null; + } + mFilteredTraceTag = applyBasicPiiFilters(rawTag); + return mFilteredTraceTag; + } + /** Return the String to be used as the tag for the wakelock held for this job. */ @NonNull public String getWakelockTag() { @@ -1534,7 +1592,7 @@ public final class JobStatus { /** * Returns the number of required flexible job constraints that have been dropped with time. - * The lower this number is the easier it is for the flexibility constraint to be satisfied. + * The higher this number is the easier it is for the flexibility constraint to be satisfied. */ public int getNumDroppedFlexibleConstraints() { return mNumDroppedFlexibleConstraints; @@ -1600,7 +1658,8 @@ public final class JobStatus { mTransportAffinitiesSatisfied = isSatisfied; } - boolean canApplyTransportAffinities() { + /** Whether transport affinities can be applied to the job in flex scheduling. */ + public boolean canApplyTransportAffinities() { return mCanApplyTransportAffinities; } @@ -1985,6 +2044,11 @@ public final class JobStatus { case CONSTRAINT_WITHIN_QUOTA: return JobParameters.STOP_REASON_QUOTA; + // This can change from true to false, but should never change when a job is already + // running, so there's no reason to log a message or create a new stop reason. + case CONSTRAINT_FLEXIBLE: + return JobParameters.STOP_REASON_UNDEFINED; + // These should never be stop reasons since they can never go from true to false. case CONSTRAINT_CONTENT_TRIGGER: case CONSTRAINT_DEADLINE: @@ -2194,7 +2258,7 @@ public final class JobStatus { * @return Whether or not this job would be ready to run if it had the specified constraint * granted, based on its requirements. */ - boolean wouldBeReadyWithConstraint(int constraint) { + public boolean wouldBeReadyWithConstraint(int constraint) { return readinessStatusWithConstraint(constraint, true); } diff --git a/apex/jobscheduler/service/java/com/android/server/tare/InternalResourceService.java b/apex/jobscheduler/service/java/com/android/server/tare/InternalResourceService.java index 357e139617ef317c321f98530356ee493e7325dd..6635484b20b9027ca70111e08004d2107d280a9b 100644 --- a/apex/jobscheduler/service/java/com/android/server/tare/InternalResourceService.java +++ b/apex/jobscheduler/service/java/com/android/server/tare/InternalResourceService.java @@ -227,7 +227,7 @@ public class InternalResourceService extends SystemService { private final IAppOpsCallback mApbListener = new IAppOpsCallback.Stub() { @Override - public void opChanged(int op, int uid, String packageName) { + public void opChanged(int op, int uid, String packageName, String persistentDeviceId) { boolean restricted = false; try { restricted = mAppOpsService.checkOperation( diff --git a/apex/jobscheduler/service/java/com/android/server/usage/AppIdleHistory.java b/apex/jobscheduler/service/java/com/android/server/usage/AppIdleHistory.java index 913a76a6502697732278a12521194d0622f136e4..4d4e3407a3c389f3623d5f481913230c5a72313b 100644 --- a/apex/jobscheduler/service/java/com/android/server/usage/AppIdleHistory.java +++ b/apex/jobscheduler/service/java/com/android/server/usage/AppIdleHistory.java @@ -591,6 +591,16 @@ public class AppIdleHistory { if (idle) { newBucket = IDLE_BUCKET_CUTOFF; reason = REASON_MAIN_FORCED_BY_USER; + final AppUsageHistory appHistory = getAppUsageHistory(packageName, userId, + elapsedRealtime); + // Wipe all expiry times that could raise the bucket on reevaluation. + if (appHistory.bucketExpiryTimesMs != null) { + for (int i = appHistory.bucketExpiryTimesMs.size() - 1; i >= 0; --i) { + if (appHistory.bucketExpiryTimesMs.keyAt(i) < newBucket) { + appHistory.bucketExpiryTimesMs.removeAt(i); + } + } + } } else { newBucket = STANDBY_BUCKET_ACTIVE; // This is to pretend that the app was just used, don't freeze the state anymore. diff --git a/apex/jobscheduler/service/java/com/android/server/usage/AppStandbyController.java b/apex/jobscheduler/service/java/com/android/server/usage/AppStandbyController.java index 12f455ad014411ce837c520ad23ca6810e0124c0..19bc7160e16aadeb47afca1c3236e20d080fb417 100644 --- a/apex/jobscheduler/service/java/com/android/server/usage/AppStandbyController.java +++ b/apex/jobscheduler/service/java/com/android/server/usage/AppStandbyController.java @@ -59,6 +59,7 @@ import static com.android.server.SystemService.PHASE_SYSTEM_SERVICES_READY; import static com.android.server.usage.AppIdleHistory.STANDBY_BUCKET_UNKNOWN; import android.annotation.CurrentTimeMillisLong; +import android.annotation.DurationMillisLong; import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.UserIdInt; @@ -670,7 +671,8 @@ public class AppStandbyController /*packageName=*/ null, new IAppOpsCallback.Stub() { @Override - public void opChanged(int op, int uid, String packageName) { + public void opChanged(int op, int uid, String packageName, + String persistentDeviceId) { final int userId = UserHandle.getUserId(uid); synchronized (mSystemExemptionAppOpMode) { mSystemExemptionAppOpMode.delete(uid); @@ -2146,6 +2148,15 @@ public class AppStandbyController } } + /** + * Flush the handler. + * Returns true if successfully flushed within the timeout, otherwise return false. + */ + @VisibleForTesting + boolean flushHandler(@DurationMillisLong long timeoutMillis) { + return mHandler.runWithScissors(() -> {}, timeoutMillis); + } + @Override public void flushToDisk() { synchronized (mAppIdleLock) { @@ -2258,7 +2269,8 @@ public class AppStandbyController } synchronized (mSystemExemptionAppOpMode) { if (Intent.ACTION_PACKAGE_REMOVED.equals(action)) { - mSystemExemptionAppOpMode.delete(UserHandle.getUid(userId, getAppId(pkgName))); + final int uid = intent.getIntExtra(Intent.EXTRA_UID, Process.INVALID_UID); + mSystemExemptionAppOpMode.delete(uid); } } diff --git a/api/Android.bp b/api/Android.bp index 65baf7827f3bb9fb70c91c0685e9f620d843539b..fd2a6d29c3771288c0a5d49ecb47538d8067c209 100644 --- a/api/Android.bp +++ b/api/Android.bp @@ -116,6 +116,7 @@ combined_apis { "framework-pdf-v", "framework-permission", "framework-permission-s", + "framework-profiling", "framework-scheduling", "framework-sdkextensions", "framework-statsd", diff --git a/api/ApiDocs.bp b/api/ApiDocs.bp index 5cff4725cba1ddf21d32bd560004c5d0acbf8b30..e8fcf4b2b32daa065c98c544835847f8939e86c0 100644 --- a/api/ApiDocs.bp +++ b/api/ApiDocs.bp @@ -67,6 +67,7 @@ stubs_defaults { ":framework-ondevicepersonalization-sources", ":framework-permission-sources", ":framework-permission-s-sources", + ":framework-profiling-sources", ":framework-scheduling-sources", ":framework-sdkextensions-sources", ":framework-statsd-sources", diff --git a/api/StubLibraries.bp b/api/StubLibraries.bp index f77f1c638f093b0fe74f858b8febd58c6f1e52bd..6cfd2e0ce833012a62d1c716c2f119daef11b616 100644 --- a/api/StubLibraries.bp +++ b/api/StubLibraries.bp @@ -840,6 +840,10 @@ java_library { system_modules: "none", static_libs: ["android_stubs_private_hjar"], dist: { + // Add to private_api_stubs dist target for easier packaging by scripts. This module is + // useful for creating a platform SDK, which can be packaged in ANDROID_HOME and used from + // Gradle, allowing for development of platform apps that make use of hidden APIs. + targets: ["private_api_stubs"], dir: "apistubs/android/private", }, } @@ -857,7 +861,12 @@ java_genrule { "done && " + "sort -u $(genDir)/framework.aidl.merged > $(out)", dist: { - targets: ["sdk"], + targets: [ + "sdk", + // Add to private_api_stubs dist target for easier packaging by scripts. + // See explanation in the "android_stubs_private" module above. + "private_api_stubs", + ], dir: "apistubs/android/private", }, } diff --git a/boot/Android.bp b/boot/Android.bp index 4b3ad655d36b43d687f27472d9f48adf40541a7c..f60bb9e7149a9e619ee933e5587dbad0116dd25c 100644 --- a/boot/Android.bp +++ b/boot/Android.bp @@ -26,10 +26,12 @@ package { soong_config_module_type { name: "custom_platform_bootclasspath", module_type: "platform_bootclasspath", - config_namespace: "AUTO", + config_namespace: "bootclasspath", bool_variables: [ "car_bootclasspath_fragment", + "nfc_apex_bootclasspath_fragment", "release_crashrecovery_module", + "release_package_profiling_module", ], properties: [ "fragments", @@ -156,6 +158,15 @@ custom_platform_bootclasspath { }, ], }, + nfc_apex_bootclasspath_fragment: { + fragments: [ + // only used if NFC mainline is enabled. + { + apex: "com.android.nfcservices", + module: "com.android.nfcservices-bootclasspath-fragment", + }, + ], + }, release_crashrecovery_module: { fragments: [ // only used when crashrecovery is enabled @@ -165,6 +176,15 @@ custom_platform_bootclasspath { }, ], }, + release_package_profiling_module: { + fragments: [ + // only used if profiling is enabled. + { + apex: "com.android.profiling", + module: "com.android.profiling-bootclasspath-fragment", + }, + ], + }, }, // Additional information needed by hidden api processing. diff --git a/boot/hiddenapi/hiddenapi-max-target-o.txt b/boot/hiddenapi/hiddenapi-max-target-o.txt index 3c16915cf71f0f4fb0439c697bdb8c3c0c248ca0..2d417ce752e15c5286bd95b7a8650bcfc5f51404 100644 --- a/boot/hiddenapi/hiddenapi-max-target-o.txt +++ b/boot/hiddenapi/hiddenapi-max-target-o.txt @@ -33834,649 +33834,6 @@ Landroid/net/WifiLinkQualityInfo;->setRssi(I)V Landroid/net/WifiLinkQualityInfo;->setTxBad(J)V Landroid/net/WifiLinkQualityInfo;->setTxGood(J)V Landroid/net/WifiLinkQualityInfo;->setType(I)V -Landroid/nfc/ApduList;->()V -Landroid/nfc/ApduList;->(Landroid/os/Parcel;)V -Landroid/nfc/ApduList;->add([B)V -Landroid/nfc/ApduList;->commands:Ljava/util/ArrayList; -Landroid/nfc/ApduList;->CREATOR:Landroid/os/Parcelable$Creator; -Landroid/nfc/ApduList;->get()Ljava/util/List; -Landroid/nfc/BeamShareData;->(Landroid/nfc/NdefMessage;[Landroid/net/Uri;Landroid/os/UserHandle;I)V -Landroid/nfc/BeamShareData;->CREATOR:Landroid/os/Parcelable$Creator; -Landroid/nfc/BeamShareData;->flags:I -Landroid/nfc/BeamShareData;->ndefMessage:Landroid/nfc/NdefMessage; -Landroid/nfc/BeamShareData;->uris:[Landroid/net/Uri; -Landroid/nfc/BeamShareData;->userHandle:Landroid/os/UserHandle; -Landroid/nfc/cardemulation/AidGroup;->(Ljava/util/List;Ljava/lang/String;)V -Landroid/nfc/cardemulation/AidGroup;->isValidCategory(Ljava/lang/String;)Z -Landroid/nfc/cardemulation/AidGroup;->MAX_NUM_AIDS:I -Landroid/nfc/cardemulation/AidGroup;->TAG:Ljava/lang/String; -Landroid/nfc/cardemulation/ApduServiceInfo;->dump(Ljava/io/FileDescriptor;Ljava/io/PrintWriter;[Ljava/lang/String;)V -Landroid/nfc/cardemulation/ApduServiceInfo;->getAidGroups()Ljava/util/ArrayList; -Landroid/nfc/cardemulation/ApduServiceInfo;->getAids()Ljava/util/List; -Landroid/nfc/cardemulation/ApduServiceInfo;->getCategoryForAid(Ljava/lang/String;)Ljava/lang/String; -Landroid/nfc/cardemulation/ApduServiceInfo;->getComponent()Landroid/content/ComponentName; -Landroid/nfc/cardemulation/ApduServiceInfo;->getDynamicAidGroupForCategory(Ljava/lang/String;)Landroid/nfc/cardemulation/AidGroup; -Landroid/nfc/cardemulation/ApduServiceInfo;->getPrefixAids()Ljava/util/List; -Landroid/nfc/cardemulation/ApduServiceInfo;->getSubsetAids()Ljava/util/List; -Landroid/nfc/cardemulation/ApduServiceInfo;->hasCategory(Ljava/lang/String;)Z -Landroid/nfc/cardemulation/ApduServiceInfo;->loadAppLabel(Landroid/content/pm/PackageManager;)Ljava/lang/CharSequence; -Landroid/nfc/cardemulation/ApduServiceInfo;->loadIcon(Landroid/content/pm/PackageManager;)Landroid/graphics/drawable/Drawable; -Landroid/nfc/cardemulation/ApduServiceInfo;->loadLabel(Landroid/content/pm/PackageManager;)Ljava/lang/CharSequence; -Landroid/nfc/cardemulation/ApduServiceInfo;->mBannerResourceId:I -Landroid/nfc/cardemulation/ApduServiceInfo;->mDescription:Ljava/lang/String; -Landroid/nfc/cardemulation/ApduServiceInfo;->mOnHost:Z -Landroid/nfc/cardemulation/ApduServiceInfo;->mRequiresDeviceUnlock:Z -Landroid/nfc/cardemulation/ApduServiceInfo;->mSettingsActivityName:Ljava/lang/String; -Landroid/nfc/cardemulation/ApduServiceInfo;->mUid:I -Landroid/nfc/cardemulation/ApduServiceInfo;->removeDynamicAidGroupForCategory(Ljava/lang/String;)Z -Landroid/nfc/cardemulation/ApduServiceInfo;->setOrReplaceDynamicAidGroup(Landroid/nfc/cardemulation/AidGroup;)V -Landroid/nfc/cardemulation/ApduServiceInfo;->TAG:Ljava/lang/String; -Landroid/nfc/cardemulation/CardEmulation;->(Landroid/content/Context;Landroid/nfc/INfcCardEmulation;)V -Landroid/nfc/cardemulation/CardEmulation;->getServices(Ljava/lang/String;)Ljava/util/List; -Landroid/nfc/cardemulation/CardEmulation;->isValidAid(Ljava/lang/String;)Z -Landroid/nfc/cardemulation/CardEmulation;->mContext:Landroid/content/Context; -Landroid/nfc/cardemulation/CardEmulation;->recoverService()V -Landroid/nfc/cardemulation/CardEmulation;->sCardEmus:Ljava/util/HashMap; -Landroid/nfc/cardemulation/CardEmulation;->setDefaultForNextTap(Landroid/content/ComponentName;)Z -Landroid/nfc/cardemulation/CardEmulation;->setDefaultServiceForCategory(Landroid/content/ComponentName;Ljava/lang/String;)Z -Landroid/nfc/cardemulation/CardEmulation;->sIsInitialized:Z -Landroid/nfc/cardemulation/CardEmulation;->sService:Landroid/nfc/INfcCardEmulation; -Landroid/nfc/cardemulation/CardEmulation;->TAG:Ljava/lang/String; -Landroid/nfc/cardemulation/HostApduService;->KEY_DATA:Ljava/lang/String; -Landroid/nfc/cardemulation/HostApduService;->mMessenger:Landroid/os/Messenger; -Landroid/nfc/cardemulation/HostApduService;->mNfcService:Landroid/os/Messenger; -Landroid/nfc/cardemulation/HostApduService;->MSG_COMMAND_APDU:I -Landroid/nfc/cardemulation/HostApduService;->MSG_DEACTIVATED:I -Landroid/nfc/cardemulation/HostApduService;->MSG_RESPONSE_APDU:I -Landroid/nfc/cardemulation/HostApduService;->MSG_UNHANDLED:I -Landroid/nfc/cardemulation/HostApduService;->TAG:Ljava/lang/String; -Landroid/nfc/cardemulation/HostNfcFService;->KEY_DATA:Ljava/lang/String; -Landroid/nfc/cardemulation/HostNfcFService;->KEY_MESSENGER:Ljava/lang/String; -Landroid/nfc/cardemulation/HostNfcFService;->mMessenger:Landroid/os/Messenger; -Landroid/nfc/cardemulation/HostNfcFService;->mNfcService:Landroid/os/Messenger; -Landroid/nfc/cardemulation/HostNfcFService;->MSG_COMMAND_PACKET:I -Landroid/nfc/cardemulation/HostNfcFService;->MSG_DEACTIVATED:I -Landroid/nfc/cardemulation/HostNfcFService;->MSG_RESPONSE_PACKET:I -Landroid/nfc/cardemulation/HostNfcFService;->TAG:Ljava/lang/String; -Landroid/nfc/cardemulation/NfcFCardEmulation;->(Landroid/content/Context;Landroid/nfc/INfcFCardEmulation;)V -Landroid/nfc/cardemulation/NfcFCardEmulation;->getMaxNumOfRegisterableSystemCodes()I -Landroid/nfc/cardemulation/NfcFCardEmulation;->getNfcFServices()Ljava/util/List; -Landroid/nfc/cardemulation/NfcFCardEmulation;->isValidNfcid2(Ljava/lang/String;)Z -Landroid/nfc/cardemulation/NfcFCardEmulation;->isValidSystemCode(Ljava/lang/String;)Z -Landroid/nfc/cardemulation/NfcFCardEmulation;->mContext:Landroid/content/Context; -Landroid/nfc/cardemulation/NfcFCardEmulation;->recoverService()V -Landroid/nfc/cardemulation/NfcFCardEmulation;->sCardEmus:Ljava/util/HashMap; -Landroid/nfc/cardemulation/NfcFCardEmulation;->sIsInitialized:Z -Landroid/nfc/cardemulation/NfcFCardEmulation;->sService:Landroid/nfc/INfcFCardEmulation; -Landroid/nfc/cardemulation/NfcFCardEmulation;->TAG:Ljava/lang/String; -Landroid/nfc/cardemulation/NfcFServiceInfo;->(Landroid/content/pm/PackageManager;Landroid/content/pm/ResolveInfo;)V -Landroid/nfc/cardemulation/NfcFServiceInfo;->(Landroid/content/pm/ResolveInfo;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ILjava/lang/String;)V -Landroid/nfc/cardemulation/NfcFServiceInfo;->CREATOR:Landroid/os/Parcelable$Creator; -Landroid/nfc/cardemulation/NfcFServiceInfo;->DEFAULT_T3T_PMM:Ljava/lang/String; -Landroid/nfc/cardemulation/NfcFServiceInfo;->dump(Ljava/io/FileDescriptor;Ljava/io/PrintWriter;[Ljava/lang/String;)V -Landroid/nfc/cardemulation/NfcFServiceInfo;->getComponent()Landroid/content/ComponentName; -Landroid/nfc/cardemulation/NfcFServiceInfo;->getDescription()Ljava/lang/String; -Landroid/nfc/cardemulation/NfcFServiceInfo;->getNfcid2()Ljava/lang/String; -Landroid/nfc/cardemulation/NfcFServiceInfo;->getSystemCode()Ljava/lang/String; -Landroid/nfc/cardemulation/NfcFServiceInfo;->getT3tPmm()Ljava/lang/String; -Landroid/nfc/cardemulation/NfcFServiceInfo;->getUid()I -Landroid/nfc/cardemulation/NfcFServiceInfo;->loadIcon(Landroid/content/pm/PackageManager;)Landroid/graphics/drawable/Drawable; -Landroid/nfc/cardemulation/NfcFServiceInfo;->loadLabel(Landroid/content/pm/PackageManager;)Ljava/lang/CharSequence; -Landroid/nfc/cardemulation/NfcFServiceInfo;->mDescription:Ljava/lang/String; -Landroid/nfc/cardemulation/NfcFServiceInfo;->mDynamicNfcid2:Ljava/lang/String; -Landroid/nfc/cardemulation/NfcFServiceInfo;->mDynamicSystemCode:Ljava/lang/String; -Landroid/nfc/cardemulation/NfcFServiceInfo;->mNfcid2:Ljava/lang/String; -Landroid/nfc/cardemulation/NfcFServiceInfo;->mService:Landroid/content/pm/ResolveInfo; -Landroid/nfc/cardemulation/NfcFServiceInfo;->mSystemCode:Ljava/lang/String; -Landroid/nfc/cardemulation/NfcFServiceInfo;->mT3tPmm:Ljava/lang/String; -Landroid/nfc/cardemulation/NfcFServiceInfo;->mUid:I -Landroid/nfc/cardemulation/NfcFServiceInfo;->setOrReplaceDynamicNfcid2(Ljava/lang/String;)V -Landroid/nfc/cardemulation/NfcFServiceInfo;->setOrReplaceDynamicSystemCode(Ljava/lang/String;)V -Landroid/nfc/cardemulation/NfcFServiceInfo;->TAG:Ljava/lang/String; -Landroid/nfc/ErrorCodes;->()V -Landroid/nfc/ErrorCodes;->asString(I)Ljava/lang/String; -Landroid/nfc/ErrorCodes;->ERROR_BUFFER_TO_SMALL:I -Landroid/nfc/ErrorCodes;->ERROR_BUSY:I -Landroid/nfc/ErrorCodes;->ERROR_CANCELLED:I -Landroid/nfc/ErrorCodes;->ERROR_CONNECT:I -Landroid/nfc/ErrorCodes;->ERROR_DISCONNECT:I -Landroid/nfc/ErrorCodes;->ERROR_INSUFFICIENT_RESOURCES:I -Landroid/nfc/ErrorCodes;->ERROR_INVALID_PARAM:I -Landroid/nfc/ErrorCodes;->ERROR_IO:I -Landroid/nfc/ErrorCodes;->ERROR_NFC_ON:I -Landroid/nfc/ErrorCodes;->ERROR_NOT_INITIALIZED:I -Landroid/nfc/ErrorCodes;->ERROR_NOT_SUPPORTED:I -Landroid/nfc/ErrorCodes;->ERROR_NO_SE_CONNECTED:I -Landroid/nfc/ErrorCodes;->ERROR_READ:I -Landroid/nfc/ErrorCodes;->ERROR_SAP_USED:I -Landroid/nfc/ErrorCodes;->ERROR_SERVICE_NAME_USED:I -Landroid/nfc/ErrorCodes;->ERROR_SE_ALREADY_SELECTED:I -Landroid/nfc/ErrorCodes;->ERROR_SE_CONNECTED:I -Landroid/nfc/ErrorCodes;->ERROR_SOCKET_CREATION:I -Landroid/nfc/ErrorCodes;->ERROR_SOCKET_NOT_CONNECTED:I -Landroid/nfc/ErrorCodes;->ERROR_SOCKET_OPTIONS:I -Landroid/nfc/ErrorCodes;->ERROR_TIMEOUT:I -Landroid/nfc/ErrorCodes;->ERROR_WRITE:I -Landroid/nfc/ErrorCodes;->SUCCESS:I -Landroid/nfc/IAppCallback$Stub$Proxy;->(Landroid/os/IBinder;)V -Landroid/nfc/IAppCallback$Stub$Proxy;->createBeamShareData(B)Landroid/nfc/BeamShareData; -Landroid/nfc/IAppCallback$Stub$Proxy;->getInterfaceDescriptor()Ljava/lang/String; -Landroid/nfc/IAppCallback$Stub$Proxy;->mRemote:Landroid/os/IBinder; -Landroid/nfc/IAppCallback$Stub$Proxy;->onNdefPushComplete(B)V -Landroid/nfc/IAppCallback$Stub$Proxy;->onTagDiscovered(Landroid/nfc/Tag;)V -Landroid/nfc/IAppCallback$Stub;->()V -Landroid/nfc/IAppCallback$Stub;->asInterface(Landroid/os/IBinder;)Landroid/nfc/IAppCallback; -Landroid/nfc/IAppCallback$Stub;->DESCRIPTOR:Ljava/lang/String; -Landroid/nfc/IAppCallback$Stub;->TRANSACTION_createBeamShareData:I -Landroid/nfc/IAppCallback$Stub;->TRANSACTION_onNdefPushComplete:I -Landroid/nfc/IAppCallback$Stub;->TRANSACTION_onTagDiscovered:I -Landroid/nfc/IAppCallback;->createBeamShareData(B)Landroid/nfc/BeamShareData; -Landroid/nfc/IAppCallback;->onNdefPushComplete(B)V -Landroid/nfc/IAppCallback;->onTagDiscovered(Landroid/nfc/Tag;)V -Landroid/nfc/INfcAdapter$Stub$Proxy;->(Landroid/os/IBinder;)V -Landroid/nfc/INfcAdapter$Stub$Proxy;->addNfcUnlockHandler(Landroid/nfc/INfcUnlockHandler;[I)V -Landroid/nfc/INfcAdapter$Stub$Proxy;->disable(Z)Z -Landroid/nfc/INfcAdapter$Stub$Proxy;->disableNdefPush()Z -Landroid/nfc/INfcAdapter$Stub$Proxy;->dispatch(Landroid/nfc/Tag;)V -Landroid/nfc/INfcAdapter$Stub$Proxy;->enable()Z -Landroid/nfc/INfcAdapter$Stub$Proxy;->enableNdefPush()Z -Landroid/nfc/INfcAdapter$Stub$Proxy;->getInterfaceDescriptor()Ljava/lang/String; -Landroid/nfc/INfcAdapter$Stub$Proxy;->getNfcAdapterExtrasInterface(Ljava/lang/String;)Landroid/nfc/INfcAdapterExtras; -Landroid/nfc/INfcAdapter$Stub$Proxy;->getNfcCardEmulationInterface()Landroid/nfc/INfcCardEmulation; -Landroid/nfc/INfcAdapter$Stub$Proxy;->getNfcDtaInterface(Ljava/lang/String;)Landroid/nfc/INfcDta; -Landroid/nfc/INfcAdapter$Stub$Proxy;->getNfcFCardEmulationInterface()Landroid/nfc/INfcFCardEmulation; -Landroid/nfc/INfcAdapter$Stub$Proxy;->getNfcTagInterface()Landroid/nfc/INfcTag; -Landroid/nfc/INfcAdapter$Stub$Proxy;->getState()I -Landroid/nfc/INfcAdapter$Stub$Proxy;->ignore(IILandroid/nfc/ITagRemovedCallback;)Z -Landroid/nfc/INfcAdapter$Stub$Proxy;->invokeBeam()V -Landroid/nfc/INfcAdapter$Stub$Proxy;->invokeBeamInternal(Landroid/nfc/BeamShareData;)V -Landroid/nfc/INfcAdapter$Stub$Proxy;->isNdefPushEnabled()Z -Landroid/nfc/INfcAdapter$Stub$Proxy;->mRemote:Landroid/os/IBinder; -Landroid/nfc/INfcAdapter$Stub$Proxy;->pausePolling(I)V -Landroid/nfc/INfcAdapter$Stub$Proxy;->removeNfcUnlockHandler(Landroid/nfc/INfcUnlockHandler;)V -Landroid/nfc/INfcAdapter$Stub$Proxy;->resumePolling()V -Landroid/nfc/INfcAdapter$Stub$Proxy;->setAppCallback(Landroid/nfc/IAppCallback;)V -Landroid/nfc/INfcAdapter$Stub$Proxy;->setForegroundDispatch(Landroid/app/PendingIntent;[Landroid/content/IntentFilter;Landroid/nfc/TechListParcel;)V -Landroid/nfc/INfcAdapter$Stub$Proxy;->setP2pModes(II)V -Landroid/nfc/INfcAdapter$Stub$Proxy;->setReaderMode(Landroid/os/IBinder;Landroid/nfc/IAppCallback;ILandroid/os/Bundle;)V -Landroid/nfc/INfcAdapter$Stub$Proxy;->verifyNfcPermission()V -Landroid/nfc/INfcAdapter$Stub;->()V -Landroid/nfc/INfcAdapter$Stub;->asInterface(Landroid/os/IBinder;)Landroid/nfc/INfcAdapter; -Landroid/nfc/INfcAdapter$Stub;->DESCRIPTOR:Ljava/lang/String; -Landroid/nfc/INfcAdapter$Stub;->TRANSACTION_addNfcUnlockHandler:I -Landroid/nfc/INfcAdapter$Stub;->TRANSACTION_disable:I -Landroid/nfc/INfcAdapter$Stub;->TRANSACTION_disableNdefPush:I -Landroid/nfc/INfcAdapter$Stub;->TRANSACTION_dispatch:I -Landroid/nfc/INfcAdapter$Stub;->TRANSACTION_enableNdefPush:I -Landroid/nfc/INfcAdapter$Stub;->TRANSACTION_getNfcAdapterExtrasInterface:I -Landroid/nfc/INfcAdapter$Stub;->TRANSACTION_getNfcCardEmulationInterface:I -Landroid/nfc/INfcAdapter$Stub;->TRANSACTION_getNfcDtaInterface:I -Landroid/nfc/INfcAdapter$Stub;->TRANSACTION_getNfcFCardEmulationInterface:I -Landroid/nfc/INfcAdapter$Stub;->TRANSACTION_getNfcTagInterface:I -Landroid/nfc/INfcAdapter$Stub;->TRANSACTION_getState:I -Landroid/nfc/INfcAdapter$Stub;->TRANSACTION_ignore:I -Landroid/nfc/INfcAdapter$Stub;->TRANSACTION_invokeBeam:I -Landroid/nfc/INfcAdapter$Stub;->TRANSACTION_invokeBeamInternal:I -Landroid/nfc/INfcAdapter$Stub;->TRANSACTION_isNdefPushEnabled:I -Landroid/nfc/INfcAdapter$Stub;->TRANSACTION_pausePolling:I -Landroid/nfc/INfcAdapter$Stub;->TRANSACTION_removeNfcUnlockHandler:I -Landroid/nfc/INfcAdapter$Stub;->TRANSACTION_resumePolling:I -Landroid/nfc/INfcAdapter$Stub;->TRANSACTION_setAppCallback:I -Landroid/nfc/INfcAdapter$Stub;->TRANSACTION_setForegroundDispatch:I -Landroid/nfc/INfcAdapter$Stub;->TRANSACTION_setP2pModes:I -Landroid/nfc/INfcAdapter$Stub;->TRANSACTION_setReaderMode:I -Landroid/nfc/INfcAdapter$Stub;->TRANSACTION_verifyNfcPermission:I -Landroid/nfc/INfcAdapter;->addNfcUnlockHandler(Landroid/nfc/INfcUnlockHandler;[I)V -Landroid/nfc/INfcAdapter;->disable(Z)Z -Landroid/nfc/INfcAdapter;->disableNdefPush()Z -Landroid/nfc/INfcAdapter;->dispatch(Landroid/nfc/Tag;)V -Landroid/nfc/INfcAdapter;->enable()Z -Landroid/nfc/INfcAdapter;->enableNdefPush()Z -Landroid/nfc/INfcAdapter;->getNfcAdapterExtrasInterface(Ljava/lang/String;)Landroid/nfc/INfcAdapterExtras; -Landroid/nfc/INfcAdapter;->getNfcCardEmulationInterface()Landroid/nfc/INfcCardEmulation; -Landroid/nfc/INfcAdapter;->getNfcDtaInterface(Ljava/lang/String;)Landroid/nfc/INfcDta; -Landroid/nfc/INfcAdapter;->getNfcFCardEmulationInterface()Landroid/nfc/INfcFCardEmulation; -Landroid/nfc/INfcAdapter;->getNfcTagInterface()Landroid/nfc/INfcTag; -Landroid/nfc/INfcAdapter;->getState()I -Landroid/nfc/INfcAdapter;->ignore(IILandroid/nfc/ITagRemovedCallback;)Z -Landroid/nfc/INfcAdapter;->invokeBeam()V -Landroid/nfc/INfcAdapter;->invokeBeamInternal(Landroid/nfc/BeamShareData;)V -Landroid/nfc/INfcAdapter;->isNdefPushEnabled()Z -Landroid/nfc/INfcAdapter;->pausePolling(I)V -Landroid/nfc/INfcAdapter;->removeNfcUnlockHandler(Landroid/nfc/INfcUnlockHandler;)V -Landroid/nfc/INfcAdapter;->resumePolling()V -Landroid/nfc/INfcAdapter;->setAppCallback(Landroid/nfc/IAppCallback;)V -Landroid/nfc/INfcAdapter;->setForegroundDispatch(Landroid/app/PendingIntent;[Landroid/content/IntentFilter;Landroid/nfc/TechListParcel;)V -Landroid/nfc/INfcAdapter;->setP2pModes(II)V -Landroid/nfc/INfcAdapter;->setReaderMode(Landroid/os/IBinder;Landroid/nfc/IAppCallback;ILandroid/os/Bundle;)V -Landroid/nfc/INfcAdapter;->verifyNfcPermission()V -Landroid/nfc/INfcAdapterExtras$Stub$Proxy;->(Landroid/os/IBinder;)V -Landroid/nfc/INfcAdapterExtras$Stub$Proxy;->authenticate(Ljava/lang/String;[B)V -Landroid/nfc/INfcAdapterExtras$Stub$Proxy;->close(Ljava/lang/String;Landroid/os/IBinder;)Landroid/os/Bundle; -Landroid/nfc/INfcAdapterExtras$Stub$Proxy;->getCardEmulationRoute(Ljava/lang/String;)I -Landroid/nfc/INfcAdapterExtras$Stub$Proxy;->getDriverName(Ljava/lang/String;)Ljava/lang/String; -Landroid/nfc/INfcAdapterExtras$Stub$Proxy;->getInterfaceDescriptor()Ljava/lang/String; -Landroid/nfc/INfcAdapterExtras$Stub$Proxy;->mRemote:Landroid/os/IBinder; -Landroid/nfc/INfcAdapterExtras$Stub$Proxy;->open(Ljava/lang/String;Landroid/os/IBinder;)Landroid/os/Bundle; -Landroid/nfc/INfcAdapterExtras$Stub$Proxy;->setCardEmulationRoute(Ljava/lang/String;I)V -Landroid/nfc/INfcAdapterExtras$Stub$Proxy;->transceive(Ljava/lang/String;[B)Landroid/os/Bundle; -Landroid/nfc/INfcAdapterExtras$Stub;->()V -Landroid/nfc/INfcAdapterExtras$Stub;->asInterface(Landroid/os/IBinder;)Landroid/nfc/INfcAdapterExtras; -Landroid/nfc/INfcAdapterExtras$Stub;->DESCRIPTOR:Ljava/lang/String; -Landroid/nfc/INfcAdapterExtras$Stub;->TRANSACTION_authenticate:I -Landroid/nfc/INfcAdapterExtras$Stub;->TRANSACTION_close:I -Landroid/nfc/INfcAdapterExtras$Stub;->TRANSACTION_getCardEmulationRoute:I -Landroid/nfc/INfcAdapterExtras$Stub;->TRANSACTION_getDriverName:I -Landroid/nfc/INfcAdapterExtras$Stub;->TRANSACTION_open:I -Landroid/nfc/INfcAdapterExtras$Stub;->TRANSACTION_setCardEmulationRoute:I -Landroid/nfc/INfcAdapterExtras$Stub;->TRANSACTION_transceive:I -Landroid/nfc/INfcCardEmulation$Stub$Proxy;->(Landroid/os/IBinder;)V -Landroid/nfc/INfcCardEmulation$Stub$Proxy;->getAidGroupForService(ILandroid/content/ComponentName;Ljava/lang/String;)Landroid/nfc/cardemulation/AidGroup; -Landroid/nfc/INfcCardEmulation$Stub$Proxy;->getInterfaceDescriptor()Ljava/lang/String; -Landroid/nfc/INfcCardEmulation$Stub$Proxy;->getServices(ILjava/lang/String;)Ljava/util/List; -Landroid/nfc/INfcCardEmulation$Stub$Proxy;->isDefaultServiceForAid(ILandroid/content/ComponentName;Ljava/lang/String;)Z -Landroid/nfc/INfcCardEmulation$Stub$Proxy;->isDefaultServiceForCategory(ILandroid/content/ComponentName;Ljava/lang/String;)Z -Landroid/nfc/INfcCardEmulation$Stub$Proxy;->mRemote:Landroid/os/IBinder; -Landroid/nfc/INfcCardEmulation$Stub$Proxy;->registerAidGroupForService(ILandroid/content/ComponentName;Landroid/nfc/cardemulation/AidGroup;)Z -Landroid/nfc/INfcCardEmulation$Stub$Proxy;->removeAidGroupForService(ILandroid/content/ComponentName;Ljava/lang/String;)Z -Landroid/nfc/INfcCardEmulation$Stub$Proxy;->setDefaultForNextTap(ILandroid/content/ComponentName;)Z -Landroid/nfc/INfcCardEmulation$Stub$Proxy;->setDefaultServiceForCategory(ILandroid/content/ComponentName;Ljava/lang/String;)Z -Landroid/nfc/INfcCardEmulation$Stub$Proxy;->setPreferredService(Landroid/content/ComponentName;)Z -Landroid/nfc/INfcCardEmulation$Stub$Proxy;->supportsAidPrefixRegistration()Z -Landroid/nfc/INfcCardEmulation$Stub$Proxy;->unsetPreferredService()Z -Landroid/nfc/INfcCardEmulation$Stub;->()V -Landroid/nfc/INfcCardEmulation$Stub;->asInterface(Landroid/os/IBinder;)Landroid/nfc/INfcCardEmulation; -Landroid/nfc/INfcCardEmulation$Stub;->DESCRIPTOR:Ljava/lang/String; -Landroid/nfc/INfcCardEmulation$Stub;->TRANSACTION_getAidGroupForService:I -Landroid/nfc/INfcCardEmulation$Stub;->TRANSACTION_getServices:I -Landroid/nfc/INfcCardEmulation$Stub;->TRANSACTION_isDefaultServiceForAid:I -Landroid/nfc/INfcCardEmulation$Stub;->TRANSACTION_isDefaultServiceForCategory:I -Landroid/nfc/INfcCardEmulation$Stub;->TRANSACTION_registerAidGroupForService:I -Landroid/nfc/INfcCardEmulation$Stub;->TRANSACTION_removeAidGroupForService:I -Landroid/nfc/INfcCardEmulation$Stub;->TRANSACTION_setDefaultForNextTap:I -Landroid/nfc/INfcCardEmulation$Stub;->TRANSACTION_setDefaultServiceForCategory:I -Landroid/nfc/INfcCardEmulation$Stub;->TRANSACTION_setPreferredService:I -Landroid/nfc/INfcCardEmulation$Stub;->TRANSACTION_supportsAidPrefixRegistration:I -Landroid/nfc/INfcCardEmulation$Stub;->TRANSACTION_unsetPreferredService:I -Landroid/nfc/INfcCardEmulation;->getAidGroupForService(ILandroid/content/ComponentName;Ljava/lang/String;)Landroid/nfc/cardemulation/AidGroup; -Landroid/nfc/INfcCardEmulation;->getServices(ILjava/lang/String;)Ljava/util/List; -Landroid/nfc/INfcCardEmulation;->isDefaultServiceForAid(ILandroid/content/ComponentName;Ljava/lang/String;)Z -Landroid/nfc/INfcCardEmulation;->isDefaultServiceForCategory(ILandroid/content/ComponentName;Ljava/lang/String;)Z -Landroid/nfc/INfcCardEmulation;->registerAidGroupForService(ILandroid/content/ComponentName;Landroid/nfc/cardemulation/AidGroup;)Z -Landroid/nfc/INfcCardEmulation;->removeAidGroupForService(ILandroid/content/ComponentName;Ljava/lang/String;)Z -Landroid/nfc/INfcCardEmulation;->setDefaultForNextTap(ILandroid/content/ComponentName;)Z -Landroid/nfc/INfcCardEmulation;->setDefaultServiceForCategory(ILandroid/content/ComponentName;Ljava/lang/String;)Z -Landroid/nfc/INfcCardEmulation;->setPreferredService(Landroid/content/ComponentName;)Z -Landroid/nfc/INfcCardEmulation;->supportsAidPrefixRegistration()Z -Landroid/nfc/INfcCardEmulation;->unsetPreferredService()Z -Landroid/nfc/INfcDta$Stub$Proxy;->(Landroid/os/IBinder;)V -Landroid/nfc/INfcDta$Stub$Proxy;->disableClient()V -Landroid/nfc/INfcDta$Stub$Proxy;->disableDta()V -Landroid/nfc/INfcDta$Stub$Proxy;->disableServer()V -Landroid/nfc/INfcDta$Stub$Proxy;->enableClient(Ljava/lang/String;III)Z -Landroid/nfc/INfcDta$Stub$Proxy;->enableDta()V -Landroid/nfc/INfcDta$Stub$Proxy;->enableServer(Ljava/lang/String;IIII)Z -Landroid/nfc/INfcDta$Stub$Proxy;->getInterfaceDescriptor()Ljava/lang/String; -Landroid/nfc/INfcDta$Stub$Proxy;->mRemote:Landroid/os/IBinder; -Landroid/nfc/INfcDta$Stub$Proxy;->registerMessageService(Ljava/lang/String;)Z -Landroid/nfc/INfcDta$Stub;->()V -Landroid/nfc/INfcDta$Stub;->asInterface(Landroid/os/IBinder;)Landroid/nfc/INfcDta; -Landroid/nfc/INfcDta$Stub;->DESCRIPTOR:Ljava/lang/String; -Landroid/nfc/INfcDta$Stub;->TRANSACTION_disableClient:I -Landroid/nfc/INfcDta$Stub;->TRANSACTION_disableDta:I -Landroid/nfc/INfcDta$Stub;->TRANSACTION_disableServer:I -Landroid/nfc/INfcDta$Stub;->TRANSACTION_enableClient:I -Landroid/nfc/INfcDta$Stub;->TRANSACTION_enableDta:I -Landroid/nfc/INfcDta$Stub;->TRANSACTION_enableServer:I -Landroid/nfc/INfcDta$Stub;->TRANSACTION_registerMessageService:I -Landroid/nfc/INfcDta;->disableClient()V -Landroid/nfc/INfcDta;->disableDta()V -Landroid/nfc/INfcDta;->disableServer()V -Landroid/nfc/INfcDta;->enableClient(Ljava/lang/String;III)Z -Landroid/nfc/INfcDta;->enableDta()V -Landroid/nfc/INfcDta;->enableServer(Ljava/lang/String;IIII)Z -Landroid/nfc/INfcDta;->registerMessageService(Ljava/lang/String;)Z -Landroid/nfc/INfcFCardEmulation$Stub$Proxy;->(Landroid/os/IBinder;)V -Landroid/nfc/INfcFCardEmulation$Stub$Proxy;->disableNfcFForegroundService()Z -Landroid/nfc/INfcFCardEmulation$Stub$Proxy;->enableNfcFForegroundService(Landroid/content/ComponentName;)Z -Landroid/nfc/INfcFCardEmulation$Stub$Proxy;->getInterfaceDescriptor()Ljava/lang/String; -Landroid/nfc/INfcFCardEmulation$Stub$Proxy;->getMaxNumOfRegisterableSystemCodes()I -Landroid/nfc/INfcFCardEmulation$Stub$Proxy;->getNfcFServices(I)Ljava/util/List; -Landroid/nfc/INfcFCardEmulation$Stub$Proxy;->getNfcid2ForService(ILandroid/content/ComponentName;)Ljava/lang/String; -Landroid/nfc/INfcFCardEmulation$Stub$Proxy;->getSystemCodeForService(ILandroid/content/ComponentName;)Ljava/lang/String; -Landroid/nfc/INfcFCardEmulation$Stub$Proxy;->mRemote:Landroid/os/IBinder; -Landroid/nfc/INfcFCardEmulation$Stub$Proxy;->registerSystemCodeForService(ILandroid/content/ComponentName;Ljava/lang/String;)Z -Landroid/nfc/INfcFCardEmulation$Stub$Proxy;->removeSystemCodeForService(ILandroid/content/ComponentName;)Z -Landroid/nfc/INfcFCardEmulation$Stub$Proxy;->setNfcid2ForService(ILandroid/content/ComponentName;Ljava/lang/String;)Z -Landroid/nfc/INfcFCardEmulation$Stub;->()V -Landroid/nfc/INfcFCardEmulation$Stub;->asInterface(Landroid/os/IBinder;)Landroid/nfc/INfcFCardEmulation; -Landroid/nfc/INfcFCardEmulation$Stub;->DESCRIPTOR:Ljava/lang/String; -Landroid/nfc/INfcFCardEmulation$Stub;->TRANSACTION_disableNfcFForegroundService:I -Landroid/nfc/INfcFCardEmulation$Stub;->TRANSACTION_enableNfcFForegroundService:I -Landroid/nfc/INfcFCardEmulation$Stub;->TRANSACTION_getMaxNumOfRegisterableSystemCodes:I -Landroid/nfc/INfcFCardEmulation$Stub;->TRANSACTION_getNfcFServices:I -Landroid/nfc/INfcFCardEmulation$Stub;->TRANSACTION_getNfcid2ForService:I -Landroid/nfc/INfcFCardEmulation$Stub;->TRANSACTION_getSystemCodeForService:I -Landroid/nfc/INfcFCardEmulation$Stub;->TRANSACTION_registerSystemCodeForService:I -Landroid/nfc/INfcFCardEmulation$Stub;->TRANSACTION_removeSystemCodeForService:I -Landroid/nfc/INfcFCardEmulation$Stub;->TRANSACTION_setNfcid2ForService:I -Landroid/nfc/INfcFCardEmulation;->disableNfcFForegroundService()Z -Landroid/nfc/INfcFCardEmulation;->enableNfcFForegroundService(Landroid/content/ComponentName;)Z -Landroid/nfc/INfcFCardEmulation;->getMaxNumOfRegisterableSystemCodes()I -Landroid/nfc/INfcFCardEmulation;->getNfcFServices(I)Ljava/util/List; -Landroid/nfc/INfcFCardEmulation;->getNfcid2ForService(ILandroid/content/ComponentName;)Ljava/lang/String; -Landroid/nfc/INfcFCardEmulation;->getSystemCodeForService(ILandroid/content/ComponentName;)Ljava/lang/String; -Landroid/nfc/INfcFCardEmulation;->registerSystemCodeForService(ILandroid/content/ComponentName;Ljava/lang/String;)Z -Landroid/nfc/INfcFCardEmulation;->removeSystemCodeForService(ILandroid/content/ComponentName;)Z -Landroid/nfc/INfcFCardEmulation;->setNfcid2ForService(ILandroid/content/ComponentName;Ljava/lang/String;)Z -Landroid/nfc/INfcTag$Stub$Proxy;->(Landroid/os/IBinder;)V -Landroid/nfc/INfcTag$Stub$Proxy;->canMakeReadOnly(I)Z -Landroid/nfc/INfcTag$Stub$Proxy;->connect(II)I -Landroid/nfc/INfcTag$Stub$Proxy;->formatNdef(I[B)I -Landroid/nfc/INfcTag$Stub$Proxy;->getExtendedLengthApdusSupported()Z -Landroid/nfc/INfcTag$Stub$Proxy;->getInterfaceDescriptor()Ljava/lang/String; -Landroid/nfc/INfcTag$Stub$Proxy;->getMaxTransceiveLength(I)I -Landroid/nfc/INfcTag$Stub$Proxy;->getTechList(I)[I -Landroid/nfc/INfcTag$Stub$Proxy;->getTimeout(I)I -Landroid/nfc/INfcTag$Stub$Proxy;->isNdef(I)Z -Landroid/nfc/INfcTag$Stub$Proxy;->isPresent(I)Z -Landroid/nfc/INfcTag$Stub$Proxy;->mRemote:Landroid/os/IBinder; -Landroid/nfc/INfcTag$Stub$Proxy;->ndefIsWritable(I)Z -Landroid/nfc/INfcTag$Stub$Proxy;->ndefMakeReadOnly(I)I -Landroid/nfc/INfcTag$Stub$Proxy;->ndefRead(I)Landroid/nfc/NdefMessage; -Landroid/nfc/INfcTag$Stub$Proxy;->ndefWrite(ILandroid/nfc/NdefMessage;)I -Landroid/nfc/INfcTag$Stub$Proxy;->reconnect(I)I -Landroid/nfc/INfcTag$Stub$Proxy;->rediscover(I)Landroid/nfc/Tag; -Landroid/nfc/INfcTag$Stub$Proxy;->resetTimeouts()V -Landroid/nfc/INfcTag$Stub$Proxy;->setTimeout(II)I -Landroid/nfc/INfcTag$Stub$Proxy;->transceive(I[BZ)Landroid/nfc/TransceiveResult; -Landroid/nfc/INfcTag$Stub;->()V -Landroid/nfc/INfcTag$Stub;->asInterface(Landroid/os/IBinder;)Landroid/nfc/INfcTag; -Landroid/nfc/INfcTag$Stub;->DESCRIPTOR:Ljava/lang/String; -Landroid/nfc/INfcTag$Stub;->TRANSACTION_canMakeReadOnly:I -Landroid/nfc/INfcTag$Stub;->TRANSACTION_connect:I -Landroid/nfc/INfcTag$Stub;->TRANSACTION_formatNdef:I -Landroid/nfc/INfcTag$Stub;->TRANSACTION_getExtendedLengthApdusSupported:I -Landroid/nfc/INfcTag$Stub;->TRANSACTION_getMaxTransceiveLength:I -Landroid/nfc/INfcTag$Stub;->TRANSACTION_getTechList:I -Landroid/nfc/INfcTag$Stub;->TRANSACTION_getTimeout:I -Landroid/nfc/INfcTag$Stub;->TRANSACTION_isNdef:I -Landroid/nfc/INfcTag$Stub;->TRANSACTION_isPresent:I -Landroid/nfc/INfcTag$Stub;->TRANSACTION_ndefIsWritable:I -Landroid/nfc/INfcTag$Stub;->TRANSACTION_ndefMakeReadOnly:I -Landroid/nfc/INfcTag$Stub;->TRANSACTION_ndefRead:I -Landroid/nfc/INfcTag$Stub;->TRANSACTION_ndefWrite:I -Landroid/nfc/INfcTag$Stub;->TRANSACTION_reconnect:I -Landroid/nfc/INfcTag$Stub;->TRANSACTION_rediscover:I -Landroid/nfc/INfcTag$Stub;->TRANSACTION_resetTimeouts:I -Landroid/nfc/INfcTag$Stub;->TRANSACTION_setTimeout:I -Landroid/nfc/INfcTag$Stub;->TRANSACTION_transceive:I -Landroid/nfc/INfcTag;->canMakeReadOnly(I)Z -Landroid/nfc/INfcTag;->connect(II)I -Landroid/nfc/INfcTag;->formatNdef(I[B)I -Landroid/nfc/INfcTag;->getExtendedLengthApdusSupported()Z -Landroid/nfc/INfcTag;->getMaxTransceiveLength(I)I -Landroid/nfc/INfcTag;->getTechList(I)[I -Landroid/nfc/INfcTag;->getTimeout(I)I -Landroid/nfc/INfcTag;->isNdef(I)Z -Landroid/nfc/INfcTag;->isPresent(I)Z -Landroid/nfc/INfcTag;->ndefIsWritable(I)Z -Landroid/nfc/INfcTag;->ndefMakeReadOnly(I)I -Landroid/nfc/INfcTag;->ndefRead(I)Landroid/nfc/NdefMessage; -Landroid/nfc/INfcTag;->ndefWrite(ILandroid/nfc/NdefMessage;)I -Landroid/nfc/INfcTag;->reconnect(I)I -Landroid/nfc/INfcTag;->rediscover(I)Landroid/nfc/Tag; -Landroid/nfc/INfcTag;->resetTimeouts()V -Landroid/nfc/INfcTag;->setTimeout(II)I -Landroid/nfc/INfcTag;->transceive(I[BZ)Landroid/nfc/TransceiveResult; -Landroid/nfc/INfcUnlockHandler$Stub$Proxy;->(Landroid/os/IBinder;)V -Landroid/nfc/INfcUnlockHandler$Stub$Proxy;->getInterfaceDescriptor()Ljava/lang/String; -Landroid/nfc/INfcUnlockHandler$Stub$Proxy;->mRemote:Landroid/os/IBinder; -Landroid/nfc/INfcUnlockHandler$Stub$Proxy;->onUnlockAttempted(Landroid/nfc/Tag;)Z -Landroid/nfc/INfcUnlockHandler$Stub;->()V -Landroid/nfc/INfcUnlockHandler$Stub;->asInterface(Landroid/os/IBinder;)Landroid/nfc/INfcUnlockHandler; -Landroid/nfc/INfcUnlockHandler$Stub;->DESCRIPTOR:Ljava/lang/String; -Landroid/nfc/INfcUnlockHandler$Stub;->TRANSACTION_onUnlockAttempted:I -Landroid/nfc/INfcUnlockHandler;->onUnlockAttempted(Landroid/nfc/Tag;)Z -Landroid/nfc/ITagRemovedCallback$Stub$Proxy;->(Landroid/os/IBinder;)V -Landroid/nfc/ITagRemovedCallback$Stub$Proxy;->getInterfaceDescriptor()Ljava/lang/String; -Landroid/nfc/ITagRemovedCallback$Stub$Proxy;->mRemote:Landroid/os/IBinder; -Landroid/nfc/ITagRemovedCallback$Stub$Proxy;->onTagRemoved()V -Landroid/nfc/ITagRemovedCallback$Stub;->()V -Landroid/nfc/ITagRemovedCallback$Stub;->asInterface(Landroid/os/IBinder;)Landroid/nfc/ITagRemovedCallback; -Landroid/nfc/ITagRemovedCallback$Stub;->DESCRIPTOR:Ljava/lang/String; -Landroid/nfc/ITagRemovedCallback$Stub;->TRANSACTION_onTagRemoved:I -Landroid/nfc/ITagRemovedCallback;->onTagRemoved()V -Landroid/nfc/NdefMessage;->mRecords:[Landroid/nfc/NdefRecord; -Landroid/nfc/NdefRecord;->bytesToString([B)Ljava/lang/StringBuilder; -Landroid/nfc/NdefRecord;->EMPTY_BYTE_ARRAY:[B -Landroid/nfc/NdefRecord;->ensureSanePayloadSize(J)V -Landroid/nfc/NdefRecord;->FLAG_CF:B -Landroid/nfc/NdefRecord;->FLAG_IL:B -Landroid/nfc/NdefRecord;->FLAG_MB:B -Landroid/nfc/NdefRecord;->FLAG_ME:B -Landroid/nfc/NdefRecord;->FLAG_SR:B -Landroid/nfc/NdefRecord;->getByteLength()I -Landroid/nfc/NdefRecord;->MAX_PAYLOAD_SIZE:I -Landroid/nfc/NdefRecord;->mPayload:[B -Landroid/nfc/NdefRecord;->mTnf:S -Landroid/nfc/NdefRecord;->mType:[B -Landroid/nfc/NdefRecord;->parse(Ljava/nio/ByteBuffer;Z)[Landroid/nfc/NdefRecord; -Landroid/nfc/NdefRecord;->parseWktUri()Landroid/net/Uri; -Landroid/nfc/NdefRecord;->RTD_ANDROID_APP:[B -Landroid/nfc/NdefRecord;->TNF_RESERVED:S -Landroid/nfc/NdefRecord;->toUri(Z)Landroid/net/Uri; -Landroid/nfc/NdefRecord;->URI_PREFIX_MAP:[Ljava/lang/String; -Landroid/nfc/NdefRecord;->validateTnf(S[B[B[B)Ljava/lang/String; -Landroid/nfc/NdefRecord;->writeToByteBuffer(Ljava/nio/ByteBuffer;ZZ)V -Landroid/nfc/NfcActivityManager$NfcActivityState;->activity:Landroid/app/Activity; -Landroid/nfc/NfcActivityManager$NfcActivityState;->destroy()V -Landroid/nfc/NfcActivityManager$NfcActivityState;->flags:I -Landroid/nfc/NfcActivityManager$NfcActivityState;->ndefMessage:Landroid/nfc/NdefMessage; -Landroid/nfc/NfcActivityManager$NfcActivityState;->ndefMessageCallback:Landroid/nfc/NfcAdapter$CreateNdefMessageCallback; -Landroid/nfc/NfcActivityManager$NfcActivityState;->onNdefPushCompleteCallback:Landroid/nfc/NfcAdapter$OnNdefPushCompleteCallback; -Landroid/nfc/NfcActivityManager$NfcActivityState;->readerCallback:Landroid/nfc/NfcAdapter$ReaderCallback; -Landroid/nfc/NfcActivityManager$NfcActivityState;->readerModeExtras:Landroid/os/Bundle; -Landroid/nfc/NfcActivityManager$NfcActivityState;->readerModeFlags:I -Landroid/nfc/NfcActivityManager$NfcActivityState;->resumed:Z -Landroid/nfc/NfcActivityManager$NfcActivityState;->token:Landroid/os/Binder; -Landroid/nfc/NfcActivityManager$NfcActivityState;->uriCallback:Landroid/nfc/NfcAdapter$CreateBeamUrisCallback; -Landroid/nfc/NfcActivityManager$NfcActivityState;->uris:[Landroid/net/Uri; -Landroid/nfc/NfcActivityManager$NfcApplicationState;->app:Landroid/app/Application; -Landroid/nfc/NfcActivityManager$NfcApplicationState;->refCount:I -Landroid/nfc/NfcActivityManager$NfcApplicationState;->register()V -Landroid/nfc/NfcActivityManager$NfcApplicationState;->unregister()V -Landroid/nfc/NfcActivityManager;->(Landroid/nfc/NfcAdapter;)V -Landroid/nfc/NfcActivityManager;->createBeamShareData(B)Landroid/nfc/BeamShareData; -Landroid/nfc/NfcActivityManager;->DBG:Ljava/lang/Boolean; -Landroid/nfc/NfcActivityManager;->destroyActivityState(Landroid/app/Activity;)V -Landroid/nfc/NfcActivityManager;->disableReaderMode(Landroid/app/Activity;)V -Landroid/nfc/NfcActivityManager;->enableReaderMode(Landroid/app/Activity;Landroid/nfc/NfcAdapter$ReaderCallback;ILandroid/os/Bundle;)V -Landroid/nfc/NfcActivityManager;->findActivityState(Landroid/app/Activity;)Landroid/nfc/NfcActivityManager$NfcActivityState; -Landroid/nfc/NfcActivityManager;->findAppState(Landroid/app/Application;)Landroid/nfc/NfcActivityManager$NfcApplicationState; -Landroid/nfc/NfcActivityManager;->findResumedActivityState()Landroid/nfc/NfcActivityManager$NfcActivityState; -Landroid/nfc/NfcActivityManager;->getActivityState(Landroid/app/Activity;)Landroid/nfc/NfcActivityManager$NfcActivityState; -Landroid/nfc/NfcActivityManager;->mActivities:Ljava/util/List; -Landroid/nfc/NfcActivityManager;->mApps:Ljava/util/List; -Landroid/nfc/NfcActivityManager;->onNdefPushComplete(B)V -Landroid/nfc/NfcActivityManager;->onTagDiscovered(Landroid/nfc/Tag;)V -Landroid/nfc/NfcActivityManager;->registerApplication(Landroid/app/Application;)V -Landroid/nfc/NfcActivityManager;->requestNfcServiceCallback()V -Landroid/nfc/NfcActivityManager;->setNdefPushContentUri(Landroid/app/Activity;[Landroid/net/Uri;)V -Landroid/nfc/NfcActivityManager;->setNdefPushContentUriCallback(Landroid/app/Activity;Landroid/nfc/NfcAdapter$CreateBeamUrisCallback;)V -Landroid/nfc/NfcActivityManager;->setNdefPushMessage(Landroid/app/Activity;Landroid/nfc/NdefMessage;I)V -Landroid/nfc/NfcActivityManager;->setNdefPushMessageCallback(Landroid/app/Activity;Landroid/nfc/NfcAdapter$CreateNdefMessageCallback;I)V -Landroid/nfc/NfcActivityManager;->setOnNdefPushCompleteCallback(Landroid/app/Activity;Landroid/nfc/NfcAdapter$OnNdefPushCompleteCallback;)V -Landroid/nfc/NfcActivityManager;->setReaderMode(Landroid/os/Binder;ILandroid/os/Bundle;)V -Landroid/nfc/NfcActivityManager;->TAG:Ljava/lang/String; -Landroid/nfc/NfcActivityManager;->unregisterApplication(Landroid/app/Application;)V -Landroid/nfc/NfcActivityManager;->verifyNfcPermission()V -Landroid/nfc/NfcAdapter;->(Landroid/content/Context;)V -Landroid/nfc/NfcAdapter;->ACTION_HANDOVER_TRANSFER_DONE:Ljava/lang/String; -Landroid/nfc/NfcAdapter;->ACTION_HANDOVER_TRANSFER_STARTED:Ljava/lang/String; -Landroid/nfc/NfcAdapter;->ACTION_TAG_LEFT_FIELD:Ljava/lang/String; -Landroid/nfc/NfcAdapter;->disableForegroundDispatchInternal(Landroid/app/Activity;Z)V -Landroid/nfc/NfcAdapter;->dispatch(Landroid/nfc/Tag;)V -Landroid/nfc/NfcAdapter;->enforceResumed(Landroid/app/Activity;)V -Landroid/nfc/NfcAdapter;->EXTRA_HANDOVER_TRANSFER_STATUS:Ljava/lang/String; -Landroid/nfc/NfcAdapter;->EXTRA_HANDOVER_TRANSFER_URI:Ljava/lang/String; -Landroid/nfc/NfcAdapter;->getCardEmulationService()Landroid/nfc/INfcCardEmulation; -Landroid/nfc/NfcAdapter;->getNfcDtaInterface()Landroid/nfc/INfcDta; -Landroid/nfc/NfcAdapter;->getNfcFCardEmulationService()Landroid/nfc/INfcFCardEmulation; -Landroid/nfc/NfcAdapter;->getSdkVersion()I -Landroid/nfc/NfcAdapter;->getServiceInterface()Landroid/nfc/INfcAdapter; -Landroid/nfc/NfcAdapter;->getTagService()Landroid/nfc/INfcTag; -Landroid/nfc/NfcAdapter;->HANDOVER_TRANSFER_STATUS_FAILURE:I -Landroid/nfc/NfcAdapter;->HANDOVER_TRANSFER_STATUS_SUCCESS:I -Landroid/nfc/NfcAdapter;->hasNfcFeature()Z -Landroid/nfc/NfcAdapter;->hasNfcHceFeature()Z -Landroid/nfc/NfcAdapter;->invokeBeam(Landroid/nfc/BeamShareData;)Z -Landroid/nfc/NfcAdapter;->mContext:Landroid/content/Context; -Landroid/nfc/NfcAdapter;->mForegroundDispatchListener:Landroid/app/OnActivityPausedListener; -Landroid/nfc/NfcAdapter;->mLock:Ljava/lang/Object; -Landroid/nfc/NfcAdapter;->mNfcActivityManager:Landroid/nfc/NfcActivityManager; -Landroid/nfc/NfcAdapter;->mNfcUnlockHandlers:Ljava/util/HashMap; -Landroid/nfc/NfcAdapter;->mTagRemovedListener:Landroid/nfc/ITagRemovedCallback; -Landroid/nfc/NfcAdapter;->pausePolling(I)V -Landroid/nfc/NfcAdapter;->resumePolling()V -Landroid/nfc/NfcAdapter;->sCardEmulationService:Landroid/nfc/INfcCardEmulation; -Landroid/nfc/NfcAdapter;->setP2pModes(II)V -Landroid/nfc/NfcAdapter;->sHasNfcFeature:Z -Landroid/nfc/NfcAdapter;->sIsInitialized:Z -Landroid/nfc/NfcAdapter;->sNfcAdapters:Ljava/util/HashMap; -Landroid/nfc/NfcAdapter;->sNfcFCardEmulationService:Landroid/nfc/INfcFCardEmulation; -Landroid/nfc/NfcAdapter;->sNullContextNfcAdapter:Landroid/nfc/NfcAdapter; -Landroid/nfc/NfcAdapter;->sTagService:Landroid/nfc/INfcTag; -Landroid/nfc/NfcAdapter;->TAG:Ljava/lang/String; -Landroid/nfc/NfcEvent;->(Landroid/nfc/NfcAdapter;B)V -Landroid/nfc/NfcManager;->mAdapter:Landroid/nfc/NfcAdapter; -Landroid/nfc/Tag;->([B[I[Landroid/os/Bundle;ILandroid/nfc/INfcTag;)V -Landroid/nfc/Tag;->createMockTag([B[I[Landroid/os/Bundle;)Landroid/nfc/Tag; -Landroid/nfc/Tag;->generateTechStringList([I)[Ljava/lang/String; -Landroid/nfc/Tag;->getConnectedTechnology()I -Landroid/nfc/Tag;->getTechCodeList()[I -Landroid/nfc/Tag;->getTechCodesFromStrings([Ljava/lang/String;)[I -Landroid/nfc/Tag;->getTechExtras(I)Landroid/os/Bundle; -Landroid/nfc/Tag;->getTechStringToCodeMap()Ljava/util/HashMap; -Landroid/nfc/Tag;->hasTech(I)Z -Landroid/nfc/Tag;->mConnectedTechnology:I -Landroid/nfc/Tag;->mServiceHandle:I -Landroid/nfc/Tag;->mTagService:Landroid/nfc/INfcTag; -Landroid/nfc/Tag;->mTechExtras:[Landroid/os/Bundle; -Landroid/nfc/Tag;->mTechList:[I -Landroid/nfc/Tag;->mTechStringList:[Ljava/lang/String; -Landroid/nfc/Tag;->readBytesWithNull(Landroid/os/Parcel;)[B -Landroid/nfc/Tag;->rediscover()Landroid/nfc/Tag; -Landroid/nfc/Tag;->setConnectedTechnology(I)V -Landroid/nfc/Tag;->setTechnologyDisconnected()V -Landroid/nfc/Tag;->writeBytesWithNull(Landroid/os/Parcel;[B)V -Landroid/nfc/tech/BasicTagTechnology;->(Landroid/nfc/Tag;I)V -Landroid/nfc/tech/BasicTagTechnology;->checkConnected()V -Landroid/nfc/tech/BasicTagTechnology;->getMaxTransceiveLengthInternal()I -Landroid/nfc/tech/BasicTagTechnology;->mIsConnected:Z -Landroid/nfc/tech/BasicTagTechnology;->mSelectedTechnology:I -Landroid/nfc/tech/BasicTagTechnology;->mTag:Landroid/nfc/Tag; -Landroid/nfc/tech/BasicTagTechnology;->reconnect()V -Landroid/nfc/tech/BasicTagTechnology;->TAG:Ljava/lang/String; -Landroid/nfc/tech/BasicTagTechnology;->transceive([BZ)[B -Landroid/nfc/tech/IsoDep;->(Landroid/nfc/Tag;)V -Landroid/nfc/tech/IsoDep;->EXTRA_HIST_BYTES:Ljava/lang/String; -Landroid/nfc/tech/IsoDep;->EXTRA_HI_LAYER_RESP:Ljava/lang/String; -Landroid/nfc/tech/IsoDep;->mHiLayerResponse:[B -Landroid/nfc/tech/IsoDep;->mHistBytes:[B -Landroid/nfc/tech/IsoDep;->TAG:Ljava/lang/String; -Landroid/nfc/tech/MifareClassic;->(Landroid/nfc/Tag;)V -Landroid/nfc/tech/MifareClassic;->authenticate(I[BZ)Z -Landroid/nfc/tech/MifareClassic;->isEmulated()Z -Landroid/nfc/tech/MifareClassic;->MAX_BLOCK_COUNT:I -Landroid/nfc/tech/MifareClassic;->MAX_SECTOR_COUNT:I -Landroid/nfc/tech/MifareClassic;->mIsEmulated:Z -Landroid/nfc/tech/MifareClassic;->mSize:I -Landroid/nfc/tech/MifareClassic;->mType:I -Landroid/nfc/tech/MifareClassic;->TAG:Ljava/lang/String; -Landroid/nfc/tech/MifareClassic;->validateBlock(I)V -Landroid/nfc/tech/MifareClassic;->validateSector(I)V -Landroid/nfc/tech/MifareClassic;->validateValueOperand(I)V -Landroid/nfc/tech/MifareUltralight;->(Landroid/nfc/Tag;)V -Landroid/nfc/tech/MifareUltralight;->EXTRA_IS_UL_C:Ljava/lang/String; -Landroid/nfc/tech/MifareUltralight;->MAX_PAGE_COUNT:I -Landroid/nfc/tech/MifareUltralight;->mType:I -Landroid/nfc/tech/MifareUltralight;->NXP_MANUFACTURER_ID:I -Landroid/nfc/tech/MifareUltralight;->TAG:Ljava/lang/String; -Landroid/nfc/tech/MifareUltralight;->validatePageIndex(I)V -Landroid/nfc/tech/Ndef;->(Landroid/nfc/Tag;)V -Landroid/nfc/tech/Ndef;->EXTRA_NDEF_CARDSTATE:Ljava/lang/String; -Landroid/nfc/tech/Ndef;->EXTRA_NDEF_MAXLENGTH:Ljava/lang/String; -Landroid/nfc/tech/Ndef;->EXTRA_NDEF_MSG:Ljava/lang/String; -Landroid/nfc/tech/Ndef;->EXTRA_NDEF_TYPE:Ljava/lang/String; -Landroid/nfc/tech/Ndef;->ICODE_SLI:Ljava/lang/String; -Landroid/nfc/tech/Ndef;->mCardState:I -Landroid/nfc/tech/Ndef;->mMaxNdefSize:I -Landroid/nfc/tech/Ndef;->mNdefMsg:Landroid/nfc/NdefMessage; -Landroid/nfc/tech/Ndef;->mNdefType:I -Landroid/nfc/tech/Ndef;->NDEF_MODE_READ_ONLY:I -Landroid/nfc/tech/Ndef;->NDEF_MODE_READ_WRITE:I -Landroid/nfc/tech/Ndef;->NDEF_MODE_UNKNOWN:I -Landroid/nfc/tech/Ndef;->TAG:Ljava/lang/String; -Landroid/nfc/tech/Ndef;->TYPE_1:I -Landroid/nfc/tech/Ndef;->TYPE_2:I -Landroid/nfc/tech/Ndef;->TYPE_3:I -Landroid/nfc/tech/Ndef;->TYPE_4:I -Landroid/nfc/tech/Ndef;->TYPE_ICODE_SLI:I -Landroid/nfc/tech/Ndef;->TYPE_MIFARE_CLASSIC:I -Landroid/nfc/tech/Ndef;->TYPE_OTHER:I -Landroid/nfc/tech/Ndef;->UNKNOWN:Ljava/lang/String; -Landroid/nfc/tech/NdefFormatable;->(Landroid/nfc/Tag;)V -Landroid/nfc/tech/NdefFormatable;->format(Landroid/nfc/NdefMessage;Z)V -Landroid/nfc/tech/NdefFormatable;->TAG:Ljava/lang/String; -Landroid/nfc/tech/NfcA;->(Landroid/nfc/Tag;)V -Landroid/nfc/tech/NfcA;->EXTRA_ATQA:Ljava/lang/String; -Landroid/nfc/tech/NfcA;->EXTRA_SAK:Ljava/lang/String; -Landroid/nfc/tech/NfcA;->mAtqa:[B -Landroid/nfc/tech/NfcA;->mSak:S -Landroid/nfc/tech/NfcA;->TAG:Ljava/lang/String; -Landroid/nfc/tech/NfcB;->(Landroid/nfc/Tag;)V -Landroid/nfc/tech/NfcB;->EXTRA_APPDATA:Ljava/lang/String; -Landroid/nfc/tech/NfcB;->EXTRA_PROTINFO:Ljava/lang/String; -Landroid/nfc/tech/NfcB;->mAppData:[B -Landroid/nfc/tech/NfcB;->mProtInfo:[B -Landroid/nfc/tech/NfcBarcode;->(Landroid/nfc/Tag;)V -Landroid/nfc/tech/NfcBarcode;->EXTRA_BARCODE_TYPE:Ljava/lang/String; -Landroid/nfc/tech/NfcBarcode;->mType:I -Landroid/nfc/tech/NfcF;->(Landroid/nfc/Tag;)V -Landroid/nfc/tech/NfcF;->EXTRA_PMM:Ljava/lang/String; -Landroid/nfc/tech/NfcF;->EXTRA_SC:Ljava/lang/String; -Landroid/nfc/tech/NfcF;->mManufacturer:[B -Landroid/nfc/tech/NfcF;->mSystemCode:[B -Landroid/nfc/tech/NfcF;->TAG:Ljava/lang/String; -Landroid/nfc/tech/NfcV;->(Landroid/nfc/Tag;)V -Landroid/nfc/tech/NfcV;->EXTRA_DSFID:Ljava/lang/String; -Landroid/nfc/tech/NfcV;->EXTRA_RESP_FLAGS:Ljava/lang/String; -Landroid/nfc/tech/NfcV;->mDsfId:B -Landroid/nfc/tech/NfcV;->mRespFlags:B -Landroid/nfc/tech/TagTechnology;->ISO_DEP:I -Landroid/nfc/tech/TagTechnology;->MIFARE_CLASSIC:I -Landroid/nfc/tech/TagTechnology;->MIFARE_ULTRALIGHT:I -Landroid/nfc/tech/TagTechnology;->NDEF:I -Landroid/nfc/tech/TagTechnology;->NDEF_FORMATABLE:I -Landroid/nfc/tech/TagTechnology;->NFC_A:I -Landroid/nfc/tech/TagTechnology;->NFC_B:I -Landroid/nfc/tech/TagTechnology;->NFC_BARCODE:I -Landroid/nfc/tech/TagTechnology;->NFC_F:I -Landroid/nfc/tech/TagTechnology;->NFC_V:I -Landroid/nfc/tech/TagTechnology;->reconnect()V -Landroid/nfc/TechListParcel;->CREATOR:Landroid/os/Parcelable$Creator; -Landroid/nfc/TechListParcel;->getTechLists()[[Ljava/lang/String; -Landroid/nfc/TechListParcel;->mTechLists:[[Ljava/lang/String; -Landroid/nfc/TransceiveResult;->(I[B)V -Landroid/nfc/TransceiveResult;->CREATOR:Landroid/os/Parcelable$Creator; -Landroid/nfc/TransceiveResult;->getResponseOrThrow()[B -Landroid/nfc/TransceiveResult;->mResponseData:[B -Landroid/nfc/TransceiveResult;->mResult:I -Landroid/nfc/TransceiveResult;->RESULT_EXCEEDED_LENGTH:I -Landroid/nfc/TransceiveResult;->RESULT_FAILURE:I -Landroid/nfc/TransceiveResult;->RESULT_SUCCESS:I -Landroid/nfc/TransceiveResult;->RESULT_TAGLOST:I Landroid/opengl/EGL14;->eglCreatePbufferFromClientBuffer(Landroid/opengl/EGLDisplay;IJLandroid/opengl/EGLConfig;[II)Landroid/opengl/EGLSurface; Landroid/opengl/EGL14;->_eglCreateWindowSurface(Landroid/opengl/EGLDisplay;Landroid/opengl/EGLConfig;Ljava/lang/Object;[II)Landroid/opengl/EGLSurface; Landroid/opengl/EGL14;->_eglCreateWindowSurfaceTexture(Landroid/opengl/EGLDisplay;Landroid/opengl/EGLConfig;Ljava/lang/Object;[II)Landroid/opengl/EGLSurface; diff --git a/boot/hiddenapi/hiddenapi-max-target-r-loprio.txt b/boot/hiddenapi/hiddenapi-max-target-r-loprio.txt index f5184e7963d7633998be5310757e215f18ad93de..4df1dcaed1360b5a6d1156f0c220c2ea4629f6bd 100644 --- a/boot/hiddenapi/hiddenapi-max-target-r-loprio.txt +++ b/boot/hiddenapi/hiddenapi-max-target-r-loprio.txt @@ -19,7 +19,6 @@ Landroid/Manifest$permission;->READ_FRAME_BUFFER:Ljava/lang/String; Landroid/media/IVolumeController$Stub;->asInterface(Landroid/os/IBinder;)Landroid/media/IVolumeController; Landroid/net/INetworkPolicyListener$Stub;->()V Landroid/net/sip/ISipSession$Stub;->asInterface(Landroid/os/IBinder;)Landroid/net/sip/ISipSession; -Landroid/nfc/INfcAdapter$Stub;->TRANSACTION_enable:I Landroid/os/IPowerManager$Stub;->TRANSACTION_acquireWakeLock:I Landroid/os/IPowerManager$Stub;->TRANSACTION_goToSleep:I Landroid/service/euicc/IEuiccService$Stub;->()V diff --git a/boot/hiddenapi/hiddenapi-unsupported.txt b/boot/hiddenapi/hiddenapi-unsupported.txt index 26dc7003a828fc300c1f2d63db5a7d87f041520f..adcc3df2d7fe6763df2eb0b90e8b3066856b7ef8 100644 --- a/boot/hiddenapi/hiddenapi-unsupported.txt +++ b/boot/hiddenapi/hiddenapi-unsupported.txt @@ -133,8 +133,6 @@ Landroid/hardware/input/IInputManager$Stub;->asInterface(Landroid/os/IBinder;)La Landroid/hardware/location/IContextHubService$Stub;->asInterface(Landroid/os/IBinder;)Landroid/hardware/location/IContextHubService; Landroid/hardware/usb/IUsbManager$Stub$Proxy;->(Landroid/os/IBinder;)V Landroid/location/ICountryListener$Stub;->()V -Landroid/location/IGeocodeProvider$Stub;->()V -Landroid/location/IGeocodeProvider$Stub;->asInterface(Landroid/os/IBinder;)Landroid/location/IGeocodeProvider; Landroid/location/ILocationListener$Stub$Proxy;->(Landroid/os/IBinder;)V Landroid/location/ILocationListener$Stub$Proxy;->mRemote:Landroid/os/IBinder; Landroid/location/ILocationListener$Stub;->()V diff --git a/cmds/am/src/com/android/commands/am/Am.java b/cmds/am/src/com/android/commands/am/Am.java index d79131ca5d7cd39037e4af1d783e601831075dd0..3b16cab06bab2169bb654bb78ecd59654c5409ed 100644 --- a/cmds/am/src/com/android/commands/am/Am.java +++ b/cmds/am/src/com/android/commands/am/Am.java @@ -183,6 +183,8 @@ public class Am extends BaseCommand { instrument.disableTestApiChecks = false; } else if (opt.equals("--no-isolated-storage")) { instrument.disableIsolatedStorage = true; + } else if (opt.equals("--no-logcat")) { + instrument.captureLogcat = false; } else if (opt.equals("--user")) { instrument.userId = parseUserArg(nextArgRequired()); } else if (opt.equals("--abi")) { diff --git a/cmds/am/src/com/android/commands/am/Instrument.java b/cmds/am/src/com/android/commands/am/Instrument.java index e60593e8b6335fee0ecbe7ff578dc9e72b13ac0b..e0d949e04a921457ff8ae05286ce9a85144743ab 100644 --- a/cmds/am/src/com/android/commands/am/Instrument.java +++ b/cmds/am/src/com/android/commands/am/Instrument.java @@ -85,6 +85,7 @@ public class Instrument { public String profileFile = null; public boolean wait = false; public boolean rawMode = false; + public boolean captureLogcat = true; boolean protoStd = false; // write proto to stdout boolean protoFile = false; // write proto to a file String logPath = null; @@ -266,16 +267,18 @@ public class Instrument { proto.write(InstrumentationData.TestStatus.RESULT_CODE, resultCode); writeBundle(proto, InstrumentationData.TestStatus.RESULTS, results); - if (resultCode == STATUS_TEST_STARTED) { - // Logcat -T takes wall clock time (!?) - mTestStartMs = System.currentTimeMillis(); - } else { - if (mTestStartMs > 0) { - proto.write(InstrumentationData.TestStatus.LOGCAT, readLogcat(mTestStartMs)); + if (captureLogcat) { + if (resultCode == STATUS_TEST_STARTED) { + // Logcat -T takes wall clock time (!?) + mTestStartMs = System.currentTimeMillis(); + } else { + if (mTestStartMs > 0) { + proto.write(InstrumentationData.TestStatus.LOGCAT, + readLogcat(mTestStartMs)); + } + mTestStartMs = 0; } - mTestStartMs = 0; } - proto.end(testStatusToken); outputProto(proto); diff --git a/cmds/idmap2/libidmap2/FabricatedOverlay.cpp b/cmds/idmap2/libidmap2/FabricatedOverlay.cpp index 16bb896e939c90f79a3cc61359035cde8db765a8..55ea15d0cdf1e884f0a6f37c3b607a60842671ea 100644 --- a/cmds/idmap2/libidmap2/FabricatedOverlay.cpp +++ b/cmds/idmap2/libidmap2/FabricatedOverlay.cpp @@ -468,9 +468,9 @@ Result FabContainer::GetOverlayData(const OverlayManifestInfo& info entry.name().c_str()); const auto& res_value = entry.res_value(); result.pairs.emplace_back(OverlayData::Value{ - name, TargetValueWithConfig{.config = entry.configuration(), .value = TargetValue{ + name, TargetValueWithConfig{.value = TargetValue{ .data_type = static_cast(res_value.data_type()), - .data_value = res_value.data_value()}}}); + .data_value = res_value.data_value()}, .config = entry.configuration()}}); } } } diff --git a/cmds/idmap2/libidmap2/ResourceContainer.cpp b/cmds/idmap2/libidmap2/ResourceContainer.cpp index 7869fbdb8cea874f1135c4ee28783c8a212ff061..3c0e118bbfe76f09af9db8ae12ad340554f79ed7 100644 --- a/cmds/idmap2/libidmap2/ResourceContainer.cpp +++ b/cmds/idmap2/libidmap2/ResourceContainer.cpp @@ -227,9 +227,9 @@ Result CreateResourceMapping(ResourceId id, const ZipAssetsProvider } else { overlay_data.pairs.emplace_back( OverlayData::Value{*target_resource, TargetValueWithConfig{ - .config = std::string(), .value = TargetValue{.data_type = overlay_resource->dataType, - .data_value = overlay_resource->data}}}); + .data_value = overlay_resource->data}, + .config = std::string()}}); } } @@ -268,10 +268,11 @@ struct ResState { std::unique_ptr am; ZipAssetsProvider* zip_assets; - static Result Initialize(std::unique_ptr zip) { + static Result Initialize(std::unique_ptr zip, + package_property_t flags) { ResState state; state.zip_assets = zip.get(); - if ((state.apk_assets = ApkAssets::Load(std::move(zip))) == nullptr) { + if ((state.apk_assets = ApkAssets::Load(std::move(zip), flags)) == nullptr) { return Error("failed to load apk asset"); } @@ -284,7 +285,7 @@ struct ResState { } state.am = std::make_unique(); - if (!state.am->SetApkAssets({state.apk_assets})) { + if (!state.am->SetApkAssets({state.apk_assets}, false)) { return Error("failed to create asset manager"); } @@ -343,8 +344,8 @@ Result ApkResourceContainer::GetState() const { return state; } - auto state = - ResState::Initialize(std::move(std::get>(state_))); + auto state = ResState::Initialize(std::move(std::get>(state_)), + PROPERTY_OPTIMIZE_NAME_LOOKUPS); if (!state) { return state.GetError(); } diff --git a/cmds/idmap2/tests/FabricatedOverlayTests.cpp b/cmds/idmap2/tests/FabricatedOverlayTests.cpp index 6b1c7e83c826f6d90f0f082c39fbf4e092174661..15109d99a6fd752c8b09a283e8f40125ec8e8672 100644 --- a/cmds/idmap2/tests/FabricatedOverlayTests.cpp +++ b/cmds/idmap2/tests/FabricatedOverlayTests.cpp @@ -144,7 +144,7 @@ TEST(FabricatedOverlayTests, SerializeAndDeserialize) { "com.example.target:string/string1", Res_value::TYPE_STRING, "foobar", "") .Build(); ASSERT_TRUE(overlay); - TemporaryFile tf; + TempFrroFile tf; std::ofstream out(tf.path); ASSERT_TRUE((*overlay).ToBinaryStream(out)); out.close(); diff --git a/cmds/idmap2/tests/IdmapTests.cpp b/cmds/idmap2/tests/IdmapTests.cpp index a384305da43db45063a3f4e3dc1c044bfa130e61..c85619c1e4bfb265e92da14af7f82a58ed6883c1 100644 --- a/cmds/idmap2/tests/IdmapTests.cpp +++ b/cmds/idmap2/tests/IdmapTests.cpp @@ -274,7 +274,7 @@ TEST(IdmapTests, FabricatedOverlay) { .Build(); ASSERT_TRUE(frro); - TemporaryFile tf; + TempFrroFile tf; std::ofstream out(tf.path); ASSERT_TRUE((*frro).ToBinaryStream(out)); out.close(); @@ -467,9 +467,9 @@ TEST(IdmapTests, CreateIdmapDataInlineResources) { TEST(IdmapTests, IdmapHeaderIsUpToDate) { fclose(stderr); // silence expected warnings from libandroidfw - const std::string target_apk_path = kIdmapRawTargetPath; - const std::string overlay_apk_path = kIdmapRawOverlayPath; - const std::string overlay_name = kIdmapRawOverlayName; + const std::string target_apk_path {kIdmapRawTargetPath}; + const std::string overlay_apk_path {kIdmapRawOverlayPath}; + const std::string overlay_name {kIdmapRawOverlayName}; const PolicyBitmask policies = kIdmapRawDataPolicies; const uint32_t target_crc = kIdmapRawDataTargetCrc; const uint32_t overlay_crc = kIdmapRawOverlayCrc; diff --git a/cmds/idmap2/tests/ResourceMappingTests.cpp b/cmds/idmap2/tests/ResourceMappingTests.cpp index db44c23a41f9b113bfe390f422c38b430b57c27c..1d2255378018cbfb8f16c8c18557044e326b3080 100644 --- a/cmds/idmap2/tests/ResourceMappingTests.cpp +++ b/cmds/idmap2/tests/ResourceMappingTests.cpp @@ -217,7 +217,7 @@ TEST(ResourceMappingTests, FabricatedOverlay) { .Build(); ASSERT_TRUE(frro); - TemporaryFile tf; + TempFrroFile tf; std::ofstream out(tf.path); ASSERT_TRUE((*frro).ToBinaryStream(out)); out.close(); diff --git a/cmds/idmap2/tests/TestHelpers.h b/cmds/idmap2/tests/TestHelpers.h index cdc0b8fbb87e6d1b47bb2ed76e1fdbf5a35b918b..bf01c32c4c86ad8aaf82089f43cf8c2c4cbb491e 100644 --- a/cmds/idmap2/tests/TestHelpers.h +++ b/cmds/idmap2/tests/TestHelpers.h @@ -17,11 +17,15 @@ #ifndef IDMAP2_TESTS_TESTHELPERS_H_ #define IDMAP2_TESTS_TESTHELPERS_H_ +#include #include +#include #include "gmock/gmock.h" #include "gtest/gtest.h" +#include "android-base/file.h" + namespace android::idmap2 { const unsigned char kIdmapRawData[] = { @@ -197,12 +201,23 @@ const unsigned int kIdmapRawDataOffset = 0x54; const unsigned int kIdmapRawDataTargetCrc = 0x1234; const unsigned int kIdmapRawOverlayCrc = 0x5678; const unsigned int kIdmapRawDataPolicies = 0x11; -inline const std::string kIdmapRawTargetPath = "targetX.apk"; -inline const std::string kIdmapRawOverlayPath = "overlayX.apk"; -inline const std::string kIdmapRawOverlayName = "OverlayName"; +inline const std::string_view kIdmapRawTargetPath = "targetX.apk"; +inline const std::string_view kIdmapRawOverlayPath = "overlayX.apk"; +inline const std::string_view kIdmapRawOverlayName = "OverlayName"; std::string GetTestDataPath(); +class TempFrroFile : public TemporaryFile { +public: + TempFrroFile() { + std::string new_path = path; + new_path += ".frro"; + ::rename(path, new_path.c_str()); + const auto new_len = new_path.copy(path, sizeof(path) - 1); + path[new_len] = '\0'; + } +}; + class Idmap2Tests : public testing::Test { protected: void SetUp() override { diff --git a/cmds/uinput/README.md b/cmds/uinput/README.md index e7361fe95e8ed52e65556c7b3c743cbeba891bcb..f1775864aca06b92b71eed7485e35445c2b97fa7 100644 --- a/cmds/uinput/README.md +++ b/cmds/uinput/README.md @@ -7,11 +7,23 @@ There are two ways to use the `uinput` command: or app (such as the CTS tests via [`UinputDevice`][UinputDevice]). * `uinput ` reads commands from a file instead of standard input. +There are also two supported input formats, described in the sections below. The tool will +automatically detect which format is being used. + [UinputDevice]: https://cs.android.com/android/platform/superproject/main/+/main:cts/libs/input/src/com/android/cts/input/UinputDevice.java -## Command format +## evemu recording format (recommended) + +`uinput` supports the evemu format, as used by the [FreeDesktop project's evemu suite][FreeDesktop]. +This is a simple text-based format compatible with recording and replay tools on other platforms. +However, it only supports playback of events from one device from a single recording. Recordings can +be made using the `evemu-record` command on Android or other Linux-based OSes. + +[FreeDesktop]: https://gitlab.freedesktop.org/libevdev/evemu + +## JSON-like format -Input commands should be in JSON format, though the parser is in [lenient mode] to allow comments, +The other supported format is JSON-based, though the parser is in [lenient mode] to allow comments, and integers can be specified in hexadecimal (e.g. `0xABCD`). The input file (or standard input) can contain multiple commands, which will be executed in sequence. Simply add multiple JSON objects to the file, one after the other without separators: @@ -34,9 +46,9 @@ Many examples of command files can be found [in the CTS tests][cts-example-jsons [lenient mode]: https://developer.android.com/reference/android/util/JsonReader#setLenient(boolean) [cts-example-jsons]: https://cs.android.com/android/platform/superproject/main/+/main:cts/tests/tests/hardware/res/raw/ -## Command reference +### Command reference -### `register` +#### `register` Register a new uinput device @@ -122,7 +134,7 @@ Example: [struct input_absinfo]: https://cs.android.com/android/platform/superproject/main/+/main:bionic/libc/kernel/uapi/linux/input.h?q=%22struct%20input_absinfo%22 -#### Waiting for registration +##### Waiting for registration After the command is sent, there will be a delay before the device is set up by the Android input stack, and `uinput` does not wait for that process to finish. Any commands sent to the device during @@ -135,14 +147,15 @@ finished processing. [onInputDeviceAdded]: https://developer.android.com/reference/android/hardware/input/InputManager.InputDeviceListener.html -#### Unregistering the device +##### Unregistering the device As soon as EOF is reached (either in interactive mode, or in file mode), the device that was created will be unregistered. There is no explicit command for unregistering a device. -### `delay` +#### `delay` -Add a delay to command processing +Add a delay between the processing of commands. The delay will be timed from when the last delay +ended, rather than from the current time, to allow for more precise timings to be produced. | Field | Type | Description | |:-------------:|:-------------:|:-------------------------- | @@ -160,7 +173,7 @@ Example: } ``` -### `inject` +#### `inject` Send an array of uinput event packets to the uinput device @@ -190,7 +203,7 @@ keys would look like this: } ``` -### `sync` +#### `sync` A command used to get a response once the command is processed. When several `inject` and `delay` commands are used in a row, the `sync` command can be used to track the progress of the command diff --git a/cmds/uinput/jni/com_android_commands_uinput_Device.cpp b/cmds/uinput/jni/com_android_commands_uinput_Device.cpp index a78a465046845f1cbd1c0797264d3a1182cf5ad0..bd61000186e5a23a97e239563bd828ab92093e72 100644 --- a/cmds/uinput/jni/com_android_commands_uinput_Device.cpp +++ b/cmds/uinput/jni/com_android_commands_uinput_Device.cpp @@ -166,14 +166,14 @@ UinputDevice::~UinputDevice() { ::ioctl(mFd, UI_DEV_DESTROY); } -void UinputDevice::injectEvent(uint16_t type, uint16_t code, int32_t value) { +void UinputDevice::injectEvent(std::chrono::microseconds timestamp, uint16_t type, uint16_t code, + int32_t value) { struct input_event event = {}; event.type = type; event.code = code; event.value = value; - timespec ts; - clock_gettime(CLOCK_MONOTONIC, &ts); - TIMESPEC_TO_TIMEVAL(&event.time, &ts); + event.time.tv_sec = timestamp.count() / 1'000'000; + event.time.tv_usec = timestamp.count() % 1'000'000; if (::write(mFd, &event, sizeof(input_event)) < 0) { ALOGE("Could not write event %" PRIu16 " %" PRIu16 " with value %" PRId32 " : %s", type, @@ -268,12 +268,12 @@ static void closeUinputDevice(JNIEnv* /* env */, jclass /* clazz */, jlong ptr) } } -static void injectEvent(JNIEnv* /* env */, jclass /* clazz */, jlong ptr, jint type, jint code, - jint value) { +static void injectEvent(JNIEnv* /* env */, jclass /* clazz */, jlong ptr, jlong timestampMicros, + jint type, jint code, jint value) { uinput::UinputDevice* d = reinterpret_cast(ptr); if (d != nullptr) { - d->injectEvent(static_cast(type), static_cast(code), - static_cast(value)); + d->injectEvent(std::chrono::microseconds(timestampMicros), static_cast(type), + static_cast(code), static_cast(value)); } else { ALOGE("Could not inject event, Device* is null!"); } @@ -330,7 +330,7 @@ static JNINativeMethod sMethods[] = { "(Ljava/lang/String;IIIIIILjava/lang/String;" "Lcom/android/commands/uinput/Device$DeviceCallback;)J", reinterpret_cast(openUinputDevice)}, - {"nativeInjectEvent", "(JIII)V", reinterpret_cast(injectEvent)}, + {"nativeInjectEvent", "(JJIII)V", reinterpret_cast(injectEvent)}, {"nativeConfigure", "(II[I)V", reinterpret_cast(configure)}, {"nativeSetAbsInfo", "(IILandroid/os/Parcel;)V", reinterpret_cast(setAbsInfo)}, {"nativeCloseUinputDevice", "(J)V", reinterpret_cast(closeUinputDevice)}, diff --git a/cmds/uinput/jni/com_android_commands_uinput_Device.h b/cmds/uinput/jni/com_android_commands_uinput_Device.h index 9769a75bd9efc36907656b38eb16c4dbb803369b..72c8647ae743376e9a90fc2610b4240deb63f846 100644 --- a/cmds/uinput/jni/com_android_commands_uinput_Device.h +++ b/cmds/uinput/jni/com_android_commands_uinput_Device.h @@ -14,13 +14,14 @@ * limitations under the License. */ -#include -#include - +#include #include #include -#include +#include +#include +#include + #include "src/com/android/commands/uinput/InputAbsInfo.h" namespace android { @@ -53,7 +54,8 @@ public: virtual ~UinputDevice(); - void injectEvent(uint16_t type, uint16_t code, int32_t value); + void injectEvent(std::chrono::microseconds timestamp, uint16_t type, uint16_t code, + int32_t value); int handleEvents(int events); private: diff --git a/cmds/uinput/src/com/android/commands/uinput/Device.java b/cmds/uinput/src/com/android/commands/uinput/Device.java index 787055c8cd89e0558688a7ca591621d402af1f59..b452fc7094ba1a20b5d3d64b06565d75ae6821a9 100644 --- a/cmds/uinput/src/com/android/commands/uinput/Device.java +++ b/cmds/uinput/src/com/android/commands/uinput/Device.java @@ -55,7 +55,7 @@ public class Device { private final SparseArray mAbsInfo; private final OutputStream mOutputStream; private final Object mCond = new Object(); - private long mTimeToSend; + private long mTimeToSendNanos; static { System.loadLibrary("uinputcommand_jni"); @@ -65,7 +65,8 @@ public class Device { int productId, int versionId, int bus, int ffEffectsMax, String port, DeviceCallback callback); private static native void nativeCloseUinputDevice(long ptr); - private static native void nativeInjectEvent(long ptr, int type, int code, int value); + private static native void nativeInjectEvent(long ptr, long timestampMicros, int type, int code, + int value); private static native void nativeConfigure(int handle, int code, int[] configs); private static native void nativeSetAbsInfo(int handle, int axisCode, Parcel axisParcel); private static native int nativeGetEvdevEventTypeByLabel(String label); @@ -101,27 +102,54 @@ public class Device { } mHandler.obtainMessage(MSG_OPEN_UINPUT_DEVICE, args).sendToTarget(); - mTimeToSend = SystemClock.uptimeMillis(); + mTimeToSendNanos = SystemClock.uptimeNanos(); + } + + private long getTimeToSendMillis() { + // Since we can only specify delays in milliseconds but evemu timestamps are in + // microseconds, we have to round up the delays to avoid setting event timestamps + // which are in the future (which the kernel would silently reject and replace with + // the current time). + // + // This should be the same as (long) Math.ceil(mTimeToSendNanos / 1_000_000.0), except + // without the precision loss that comes from converting from long to double and back. + return mTimeToSendNanos / 1_000_000 + ((mTimeToSendNanos % 1_000_000 > 0) ? 1 : 0); } /** * Inject uinput events to device * * @param events Array of raw uinput events. + * @param offsetMicros The difference in microseconds between the timestamps of the previous + * batch of events injected and this batch. If set to -1, the current + * timestamp will be used. */ - public void injectEvent(int[] events) { + public void injectEvent(int[] events, long offsetMicros) { // if two messages are sent at identical time, they will be processed in order received - Message msg = mHandler.obtainMessage(MSG_INJECT_EVENT, events); - mHandler.sendMessageAtTime(msg, mTimeToSend); + SomeArgs args = SomeArgs.obtain(); + args.arg1 = events; + args.argl1 = offsetMicros; + args.argl2 = SystemClock.uptimeNanos(); + Message msg = mHandler.obtainMessage(MSG_INJECT_EVENT, args); + mHandler.sendMessageAtTime(msg, getTimeToSendMillis()); } /** - * Impose a delay to the device for execution. + * Delay subsequent device activity by the specified amount of time. + * + *

Note that although the delay is specified in nanoseconds, due to limitations of {@link + * Handler}'s API, scheduling only occurs with millisecond precision. When scheduling an + * injection or sync, the time at which it is scheduled will be rounded up to the nearest + * millisecond. While this means that a particular injection cannot be scheduled precisely, + * rounding errors will not accumulate over time. For example, if five injections are scheduled + * with a delay of 1,200,000ns before each one, the total delay will be 6ms, as opposed to the + * 10ms it would have been if each individual delay had been rounded up (as {@link EvemuParser} + * would otherwise have to do to avoid sending timestamps that are in the future). * - * @param delay Time to delay in unit of milliseconds. + * @param delayNanos Time to delay in unit of nanoseconds. */ - public void addDelay(int delay) { - mTimeToSend = Math.max(SystemClock.uptimeMillis(), mTimeToSend) + delay; + public void addDelayNanos(long delayNanos) { + mTimeToSendNanos += delayNanos; } /** @@ -131,7 +159,8 @@ public class Device { * @param syncToken The token for this sync command. */ public void syncEvent(String syncToken) { - mHandler.sendMessageAtTime(mHandler.obtainMessage(MSG_SYNC_EVENT, syncToken), mTimeToSend); + mHandler.sendMessageAtTime( + mHandler.obtainMessage(MSG_SYNC_EVENT, syncToken), getTimeToSendMillis()); } /** @@ -140,7 +169,8 @@ public class Device { */ public void close() { Message msg = mHandler.obtainMessage(MSG_CLOSE_UINPUT_DEVICE); - mHandler.sendMessageAtTime(msg, Math.max(SystemClock.uptimeMillis(), mTimeToSend) + 1); + mHandler.sendMessageAtTime( + msg, Math.max(SystemClock.uptimeMillis(), getTimeToSendMillis()) + 1); try { synchronized (mCond) { mCond.wait(); @@ -151,6 +181,7 @@ public class Device { private class DeviceHandler extends Handler { private long mPtr; + private long mLastInjectTimestampMicros = -1; private int mBarrierToken; DeviceHandler(Looper looper) { @@ -160,7 +191,7 @@ public class Device { @Override public void handleMessage(Message msg) { switch (msg.what) { - case MSG_OPEN_UINPUT_DEVICE: + case MSG_OPEN_UINPUT_DEVICE: { SomeArgs args = (SomeArgs) msg.obj; String name = (String) args.arg1; mPtr = nativeOpenUinputDevice(name, args.argi1 /* id */, @@ -172,18 +203,48 @@ public class Device { RuntimeException ex = new RuntimeException( "Could not create uinput device \"" + name + "\""); Log.e(TAG, "Couldn't create uinput device, exiting.", ex); + args.recycle(); throw ex; } + args.recycle(); break; - case MSG_INJECT_EVENT: - if (mPtr != 0) { - int[] events = (int[]) msg.obj; - for (int pos = 0; pos + 2 < events.length; pos += 3) { - nativeInjectEvent(mPtr, events[pos], events[pos + 1], events[pos + 2]); - } + } + case MSG_INJECT_EVENT: { + SomeArgs args = (SomeArgs) msg.obj; + if (mPtr == 0) { + args.recycle(); + break; } + long offsetMicros = args.argl1; + if (mLastInjectTimestampMicros == -1 || offsetMicros == -1) { + // There's often a delay of a few milliseconds between the time specified to + // Handler.sendMessageAtTime and the handler actually being called, due to + // the way threads are scheduled. We don't take this into account when + // calling addDelayNanos between the first batch of event injections (when + // we set the "base timestamp" from which all others will be offset) and the + // second batch, meaning that the actual time between the handler calls for + // those batches may be less than the offset between their timestamps. When + // that happens, we would pass a timestamp for the second batch that's + // actually in the future. The kernel's uinput API rejects timestamps that + // are in the future and uses the current time instead, making the reported + // timestamps inconsistent with the recording we're replaying. + // + // To prevent this, we need to use the time at which we scheduled this first + // batch, rather than the actual current time. + mLastInjectTimestampMicros = args.argl2 / 1000; + } else { + mLastInjectTimestampMicros += offsetMicros; + } + + int[] events = (int[]) args.arg1; + for (int pos = 0; pos + 2 < events.length; pos += 3) { + nativeInjectEvent(mPtr, mLastInjectTimestampMicros, events[pos], + events[pos + 1], events[pos + 2]); + } + args.recycle(); break; - case MSG_CLOSE_UINPUT_DEVICE: + } + case MSG_CLOSE_UINPUT_DEVICE: { if (mPtr != 0) { nativeCloseUinputDevice(mPtr); getLooper().quitSafely(); @@ -196,11 +257,14 @@ public class Device { mCond.notify(); } break; - case MSG_SYNC_EVENT: + } + case MSG_SYNC_EVENT: { handleSyncEvent((String) msg.obj); break; - default: + } + default: { throw new IllegalArgumentException("Unknown device message"); + } } } diff --git a/cmds/uinput/src/com/android/commands/uinput/EvemuParser.java b/cmds/uinput/src/com/android/commands/uinput/EvemuParser.java index 7652f2403f6e55a291688bc3f4d017044a8d9162..da991624e6856fb90879f83ab906a5e2e1cee3f3 100644 --- a/cmds/uinput/src/com/android/commands/uinput/EvemuParser.java +++ b/cmds/uinput/src/com/android/commands/uinput/EvemuParser.java @@ -44,7 +44,7 @@ public class EvemuParser implements EventParser { * recordings, this will always be the same. */ private static final int DEVICE_ID = 1; - private static final int REGISTRATION_DELAY_MILLIS = 500; + private static final int REGISTRATION_DELAY_NANOS = 500_000_000; private static class CommentAwareReader { private final LineNumberReader mReader; @@ -152,7 +152,7 @@ public class EvemuParser implements EventParser { final Event.Builder delayEb = new Event.Builder(); delayEb.setId(DEVICE_ID); delayEb.setCommand(Event.Command.DELAY); - delayEb.setDurationMillis(REGISTRATION_DELAY_MILLIS); + delayEb.setDurationNanos(REGISTRATION_DELAY_NANOS); mQueuedEvents.add(delayEb.build()); } @@ -175,7 +175,6 @@ public class EvemuParser implements EventParser { throw new ParsingException( "Invalid timestamp '" + parts[0] + "' (should contain a single '.')", mReader); } - // TODO(b/310958309): use timeMicros to set the timestamp on the event being sent. final long timeMicros = parseLong(timeParts[0], 10) * 1_000_000 + parseInt(timeParts[1], 10); final Event.Builder eb = new Event.Builder(); @@ -192,21 +191,18 @@ public class EvemuParser implements EventParser { return eb.build(); } else { final long delayMicros = timeMicros - mLastEventTimeMicros; - // The shortest delay supported by Handler.sendMessageAtTime (used for timings by the - // Device class) is 1ms, so ignore time differences smaller than that. - if (delayMicros < 1000) { - mLastEventTimeMicros = timeMicros; + eb.setTimestampOffsetMicros(delayMicros); + if (delayMicros == 0) { return eb.build(); - } else { - // Send a delay now, and queue the actual event for the next call. - mQueuedEvents.add(eb.build()); - mLastEventTimeMicros = timeMicros; - final Event.Builder delayEb = new Event.Builder(); - delayEb.setId(DEVICE_ID); - delayEb.setCommand(Event.Command.DELAY); - delayEb.setDurationMillis((int) (delayMicros / 1000)); - return delayEb.build(); } + // Send a delay now, and queue the actual event for the next call. + mQueuedEvents.add(eb.build()); + mLastEventTimeMicros = timeMicros; + final Event.Builder delayEb = new Event.Builder(); + delayEb.setId(DEVICE_ID); + delayEb.setCommand(Event.Command.DELAY); + delayEb.setDurationNanos(delayMicros * 1000); + return delayEb.build(); } } diff --git a/cmds/uinput/src/com/android/commands/uinput/Event.java b/cmds/uinput/src/com/android/commands/uinput/Event.java index 0f16a27aac1dc6df127911f4d6be490841e48296..9e7ee0937efe497e02050c5a8b9082c37c80b7f1 100644 --- a/cmds/uinput/src/com/android/commands/uinput/Event.java +++ b/cmds/uinput/src/com/android/commands/uinput/Event.java @@ -99,8 +99,9 @@ public class Event { private int mVersionId; private int mBusId; private int[] mInjections; + private long mTimestampOffsetMicros = -1; private SparseArray mConfiguration; - private int mDurationMillis; + private long mDurationNanos; private int mFfEffectsMax = 0; private String mInputPort; private SparseArray mAbsInfo; @@ -138,20 +139,29 @@ public class Event { return mInjections; } + /** + * Returns the number of microseconds that should be added to the previous {@code INJECT} + * event's timestamp to produce the timestamp for this {@code INJECT} event. A value of -1 + * indicates that the current timestamp should be used instead. + */ + public long getTimestampOffsetMicros() { + return mTimestampOffsetMicros; + } + /** * Returns a {@link SparseArray} describing the event codes that should be registered for the * device. The keys are uinput ioctl codes (such as those returned from {@link * UinputControlCode#getValue()}, while the values are arrays of event codes to be enabled with * those ioctls. For example, key 101 (corresponding to {@link UinputControlCode#UI_SET_KEYBIT}) - * could have values 0x110 ({@code BTN_LEFT}, 0x111 ({@code BTN_RIGHT}), and 0x112 + * could have values 0x110 ({@code BTN_LEFT}), 0x111 ({@code BTN_RIGHT}), and 0x112 * ({@code BTN_MIDDLE}). */ public SparseArray getConfiguration() { return mConfiguration; } - public int getDurationMillis() { - return mDurationMillis; + public long getDurationNanos() { + return mDurationNanos; } public int getFfEffectsMax() { @@ -182,7 +192,7 @@ public class Event { + ", busId=" + mBusId + ", events=" + Arrays.toString(mInjections) + ", configuration=" + mConfiguration - + ", duration=" + mDurationMillis + "ms" + + ", duration=" + mDurationNanos + "ns" + ", ff_effects_max=" + mFfEffectsMax + ", port=" + mInputPort + "}"; @@ -211,6 +221,10 @@ public class Event { mEvent.mInjections = events; } + public void setTimestampOffsetMicros(long offsetMicros) { + mEvent.mTimestampOffsetMicros = offsetMicros; + } + /** * Sets the event codes that should be registered with a {@code register} command. * @@ -237,8 +251,8 @@ public class Event { mEvent.mBusId = busId; } - public void setDurationMillis(int durationMillis) { - mEvent.mDurationMillis = durationMillis; + public void setDurationNanos(long durationNanos) { + mEvent.mDurationNanos = durationNanos; } public void setFfEffectsMax(int ffEffectsMax) { @@ -271,7 +285,7 @@ public class Event { } } case DELAY -> { - if (mEvent.mDurationMillis <= 0) { + if (mEvent.mDurationNanos <= 0) { throw new IllegalStateException("Delay has missing or invalid duration"); } } diff --git a/cmds/uinput/src/com/android/commands/uinput/JsonStyleParser.java b/cmds/uinput/src/com/android/commands/uinput/JsonStyleParser.java index ed3ff33f7e528e8c4d3aac6d40419987f2a52959..6994f0cb0e4bf2db8edcd148830d815dc8e917f5 100644 --- a/cmds/uinput/src/com/android/commands/uinput/JsonStyleParser.java +++ b/cmds/uinput/src/com/android/commands/uinput/JsonStyleParser.java @@ -71,7 +71,8 @@ public class JsonStyleParser implements EventParser { case "configuration" -> eb.setConfiguration(readConfiguration()); case "ff_effects_max" -> eb.setFfEffectsMax(readInt()); case "abs_info" -> eb.setAbsInfo(readAbsInfoArray()); - case "duration" -> eb.setDurationMillis(readInt()); + // Duration is specified in milliseconds in the JSON-style format. + case "duration" -> eb.setDurationNanos(readInt() * 1_000_000L); case "port" -> eb.setInputPort(mReader.nextString()); case "syncToken" -> eb.setSyncToken(mReader.nextString()); default -> mReader.skipValue(); diff --git a/cmds/uinput/src/com/android/commands/uinput/Uinput.java b/cmds/uinput/src/com/android/commands/uinput/Uinput.java index 04df27987d5832e7b9bb757f48e778800f88fa29..760e981c8465504f091725d4b7972008b922925e 100644 --- a/cmds/uinput/src/com/android/commands/uinput/Uinput.java +++ b/cmds/uinput/src/com/android/commands/uinput/Uinput.java @@ -134,8 +134,8 @@ public class Uinput { switch (Objects.requireNonNull(e.getCommand())) { case REGISTER -> error("Device id=" + e.getId() + " is already registered. Ignoring event."); - case INJECT -> d.injectEvent(e.getInjections()); - case DELAY -> d.addDelay(e.getDurationMillis()); + case INJECT -> d.injectEvent(e.getInjections(), e.getTimestampOffsetMicros()); + case DELAY -> d.addDelayNanos(e.getDurationNanos()); case SYNC -> d.syncEvent(e.getSyncToken()); } } diff --git a/cmds/uinput/tests/src/com/android/commands/uinput/tests/EvemuParserTest.java b/cmds/uinput/tests/src/com/android/commands/uinput/tests/EvemuParserTest.java index 06b0aac271ad5b513a661665478bb247a5463571..5239fbc7e0a8c5ea0a7bcdba5ed4c945316824ae 100644 --- a/cmds/uinput/tests/src/com/android/commands/uinput/tests/EvemuParserTest.java +++ b/cmds/uinput/tests/src/com/android/commands/uinput/tests/EvemuParserTest.java @@ -183,16 +183,22 @@ public class EvemuParserTest { } private void assertInjectEvent(Event event, int eventType, int eventCode, int value) { + assertInjectEvent(event, eventType, eventCode, value, 0); + } + + private void assertInjectEvent(Event event, int eventType, int eventCode, int value, + long timestampOffsetMicros) { assertThat(event).isNotNull(); assertThat(event.getCommand()).isEqualTo(Event.Command.INJECT); assertThat(event.getInjections()).asList() .containsExactly(eventType, eventCode, value).inOrder(); + assertThat(event.getTimestampOffsetMicros()).isEqualTo(timestampOffsetMicros); } - private void assertDelayEvent(Event event, int durationMillis) { + private void assertDelayEvent(Event event, int durationNanos) { assertThat(event).isNotNull(); assertThat(event.getCommand()).isEqualTo(Event.Command.DELAY); - assertThat(event.getDurationMillis()).isEqualTo(durationMillis); + assertThat(event.getDurationNanos()).isEqualTo(durationNanos); } @Test @@ -207,7 +213,7 @@ public class EvemuParserTest { EvemuParser parser = new EvemuParser(reader); assertThat(parser.getNextEvent().getCommand()).isEqualTo(Event.Command.REGISTER); assertThat(parser.getNextEvent().getCommand()).isEqualTo(Event.Command.DELAY); - assertInjectEvent(parser.getNextEvent(), 0x2, 0x0, 1); + assertInjectEvent(parser.getNextEvent(), 0x2, 0x0, 1, -1); assertInjectEvent(parser.getNextEvent(), 0x2, 0x1, -2); assertInjectEvent(parser.getNextEvent(), 0x0, 0x0, 0); } @@ -228,17 +234,17 @@ public class EvemuParserTest { assertThat(parser.getNextEvent().getCommand()).isEqualTo(Event.Command.REGISTER); assertThat(parser.getNextEvent().getCommand()).isEqualTo(Event.Command.DELAY); - assertInjectEvent(parser.getNextEvent(), 0x1, 0x15, 1); + assertInjectEvent(parser.getNextEvent(), 0x1, 0x15, 1, -1); assertInjectEvent(parser.getNextEvent(), 0x0, 0x0, 0); - assertDelayEvent(parser.getNextEvent(), 10); + assertDelayEvent(parser.getNextEvent(), 10_000_000); - assertInjectEvent(parser.getNextEvent(), 0x1, 0x15, 0); + assertInjectEvent(parser.getNextEvent(), 0x1, 0x15, 0, 10_000); assertInjectEvent(parser.getNextEvent(), 0x0, 0x0, 0); - assertDelayEvent(parser.getNextEvent(), 1000); + assertDelayEvent(parser.getNextEvent(), 1_000_000_000); - assertInjectEvent(parser.getNextEvent(), 0x1, 0x15, 1); + assertInjectEvent(parser.getNextEvent(), 0x1, 0x15, 1, 1_000_000); assertInjectEvent(parser.getNextEvent(), 0x0, 0x0, 0); } @@ -449,7 +455,7 @@ public class EvemuParserTest { assertThat(regEvent.getBus()).isEqualTo(0x001d); assertThat(regEvent.getVendorId()).isEqualTo(0x6cb); assertThat(regEvent.getProductId()).isEqualTo(0x0000); - // TODO(b/302297266): check version ID once it's supported + assertThat(regEvent.getVersionId()).isEqualTo(0x0000); assertThat(regEvent.getConfiguration().get(UinputControlCode.UI_SET_PROPBIT.getValue())) .asList().containsExactly(0, 2); @@ -477,7 +483,7 @@ public class EvemuParserTest { assertThat(parser.getNextEvent().getCommand()).isEqualTo(Event.Command.DELAY); - assertInjectEvent(parser.getNextEvent(), 0x3, 0x39, 0); + assertInjectEvent(parser.getNextEvent(), 0x3, 0x39, 0, -1); assertInjectEvent(parser.getNextEvent(), 0x3, 0x35, 891); assertInjectEvent(parser.getNextEvent(), 0x3, 0x36, 333); assertInjectEvent(parser.getNextEvent(), 0x3, 0x3a, 56); @@ -490,8 +496,8 @@ public class EvemuParserTest { assertInjectEvent(parser.getNextEvent(), 0x3, 0x18, 56); assertInjectEvent(parser.getNextEvent(), 0x0, 0x0, 0); - assertDelayEvent(parser.getNextEvent(), 6); + assertDelayEvent(parser.getNextEvent(), 6_080_000); - assertInjectEvent(parser.getNextEvent(), 0x3, 0x0035, 888); + assertInjectEvent(parser.getNextEvent(), 0x3, 0x0035, 888, 6_080); } } diff --git a/core/api/current.txt b/core/api/current.txt index 588396ac21406141d40da2d5772f48e7cdfe4d5f..23cccd630b73a3a0c8631a91f4345d241ad17271 100644 --- a/core/api/current.txt +++ b/core/api/current.txt @@ -13,6 +13,7 @@ package android { field public static final String ACCESS_CHECKIN_PROPERTIES = "android.permission.ACCESS_CHECKIN_PROPERTIES"; field public static final String ACCESS_COARSE_LOCATION = "android.permission.ACCESS_COARSE_LOCATION"; field public static final String ACCESS_FINE_LOCATION = "android.permission.ACCESS_FINE_LOCATION"; + field @FlaggedApi("android.multiuser.enable_permission_to_access_hidden_profiles") public static final String ACCESS_HIDDEN_PROFILES = "android.permission.ACCESS_HIDDEN_PROFILES"; field public static final String ACCESS_LOCATION_EXTRA_COMMANDS = "android.permission.ACCESS_LOCATION_EXTRA_COMMANDS"; field public static final String ACCESS_MEDIA_LOCATION = "android.permission.ACCESS_MEDIA_LOCATION"; field public static final String ACCESS_NETWORK_STATE = "android.permission.ACCESS_NETWORK_STATE"; @@ -49,6 +50,7 @@ package android { field public static final String BIND_SCREENING_SERVICE = "android.permission.BIND_SCREENING_SERVICE"; field public static final String BIND_TELECOM_CONNECTION_SERVICE = "android.permission.BIND_TELECOM_CONNECTION_SERVICE"; field public static final String BIND_TEXT_SERVICE = "android.permission.BIND_TEXT_SERVICE"; + field @FlaggedApi("android.media.tv.flags.enable_ad_service_fw") public static final String BIND_TV_AD_SERVICE = "android.permission.BIND_TV_AD_SERVICE"; field public static final String BIND_TV_INPUT = "android.permission.BIND_TV_INPUT"; field public static final String BIND_TV_INTERACTIVE_APP = "android.permission.BIND_TV_INTERACTIVE_APP"; field public static final String BIND_VISUAL_VOICEMAIL_SERVICE = "android.permission.BIND_VISUAL_VOICEMAIL_SERVICE"; @@ -88,6 +90,7 @@ package android { field public static final String DELETE_PACKAGES = "android.permission.DELETE_PACKAGES"; field public static final String DELIVER_COMPANION_MESSAGES = "android.permission.DELIVER_COMPANION_MESSAGES"; field public static final String DETECT_SCREEN_CAPTURE = "android.permission.DETECT_SCREEN_CAPTURE"; + field @FlaggedApi("com.android.window.flags.screen_recording_callbacks") public static final String DETECT_SCREEN_RECORDING = "android.permission.DETECT_SCREEN_RECORDING"; field public static final String DIAGNOSTIC = "android.permission.DIAGNOSTIC"; field public static final String DISABLE_KEYGUARD = "android.permission.DISABLE_KEYGUARD"; field public static final String DUMP = "android.permission.DUMP"; @@ -102,6 +105,7 @@ package android { field public static final String FOREGROUND_SERVICE_HEALTH = "android.permission.FOREGROUND_SERVICE_HEALTH"; field public static final String FOREGROUND_SERVICE_LOCATION = "android.permission.FOREGROUND_SERVICE_LOCATION"; field public static final String FOREGROUND_SERVICE_MEDIA_PLAYBACK = "android.permission.FOREGROUND_SERVICE_MEDIA_PLAYBACK"; + field @FlaggedApi("android.content.pm.introduce_media_processing_type") public static final String FOREGROUND_SERVICE_MEDIA_PROCESSING = "android.permission.FOREGROUND_SERVICE_MEDIA_PROCESSING"; field public static final String FOREGROUND_SERVICE_MEDIA_PROJECTION = "android.permission.FOREGROUND_SERVICE_MEDIA_PROJECTION"; field public static final String FOREGROUND_SERVICE_MICROPHONE = "android.permission.FOREGROUND_SERVICE_MICROPHONE"; field public static final String FOREGROUND_SERVICE_PHONE_CALL = "android.permission.FOREGROUND_SERVICE_PHONE_CALL"; @@ -136,15 +140,19 @@ package android { field public static final String MANAGE_DEVICE_POLICY_APPS_CONTROL = "android.permission.MANAGE_DEVICE_POLICY_APPS_CONTROL"; field public static final String MANAGE_DEVICE_POLICY_APP_RESTRICTIONS = "android.permission.MANAGE_DEVICE_POLICY_APP_RESTRICTIONS"; field public static final String MANAGE_DEVICE_POLICY_APP_USER_DATA = "android.permission.MANAGE_DEVICE_POLICY_APP_USER_DATA"; + field @FlaggedApi("android.app.admin.flags.assist_content_user_restriction_enabled") public static final String MANAGE_DEVICE_POLICY_ASSIST_CONTENT = "android.permission.MANAGE_DEVICE_POLICY_ASSIST_CONTENT"; field public static final String MANAGE_DEVICE_POLICY_AUDIO_OUTPUT = "android.permission.MANAGE_DEVICE_POLICY_AUDIO_OUTPUT"; field public static final String MANAGE_DEVICE_POLICY_AUTOFILL = "android.permission.MANAGE_DEVICE_POLICY_AUTOFILL"; field public static final String MANAGE_DEVICE_POLICY_BACKUP_SERVICE = "android.permission.MANAGE_DEVICE_POLICY_BACKUP_SERVICE"; + field @FlaggedApi("android.app.admin.flags.dedicated_device_control_api_enabled") public static final String MANAGE_DEVICE_POLICY_BLOCK_UNINSTALL = "android.permission.MANAGE_DEVICE_POLICY_BLOCK_UNINSTALL"; field public static final String MANAGE_DEVICE_POLICY_BLUETOOTH = "android.permission.MANAGE_DEVICE_POLICY_BLUETOOTH"; field public static final String MANAGE_DEVICE_POLICY_BUGREPORT = "android.permission.MANAGE_DEVICE_POLICY_BUGREPORT"; field public static final String MANAGE_DEVICE_POLICY_CALLS = "android.permission.MANAGE_DEVICE_POLICY_CALLS"; field public static final String MANAGE_DEVICE_POLICY_CAMERA = "android.permission.MANAGE_DEVICE_POLICY_CAMERA"; + field @FlaggedApi("android.app.admin.flags.dedicated_device_control_api_enabled") public static final String MANAGE_DEVICE_POLICY_CAMERA_TOGGLE = "android.permission.MANAGE_DEVICE_POLICY_CAMERA_TOGGLE"; field public static final String MANAGE_DEVICE_POLICY_CERTIFICATES = "android.permission.MANAGE_DEVICE_POLICY_CERTIFICATES"; field public static final String MANAGE_DEVICE_POLICY_COMMON_CRITERIA_MODE = "android.permission.MANAGE_DEVICE_POLICY_COMMON_CRITERIA_MODE"; + field @FlaggedApi("android.view.contentprotection.flags.manage_device_policy_enabled") public static final String MANAGE_DEVICE_POLICY_CONTENT_PROTECTION = "android.permission.MANAGE_DEVICE_POLICY_CONTENT_PROTECTION"; field public static final String MANAGE_DEVICE_POLICY_DEBUGGING_FEATURES = "android.permission.MANAGE_DEVICE_POLICY_DEBUGGING_FEATURES"; field public static final String MANAGE_DEVICE_POLICY_DEFAULT_SMS = "android.permission.MANAGE_DEVICE_POLICY_DEFAULT_SMS"; field public static final String MANAGE_DEVICE_POLICY_DEVICE_IDENTIFIERS = "android.permission.MANAGE_DEVICE_POLICY_DEVICE_IDENTIFIERS"; @@ -160,8 +168,10 @@ package android { field public static final String MANAGE_DEVICE_POLICY_LOCK = "android.permission.MANAGE_DEVICE_POLICY_LOCK"; field public static final String MANAGE_DEVICE_POLICY_LOCK_CREDENTIALS = "android.permission.MANAGE_DEVICE_POLICY_LOCK_CREDENTIALS"; field public static final String MANAGE_DEVICE_POLICY_LOCK_TASK = "android.permission.MANAGE_DEVICE_POLICY_LOCK_TASK"; + field @FlaggedApi("android.app.admin.flags.esim_management_enabled") public static final String MANAGE_DEVICE_POLICY_MANAGED_SUBSCRIPTIONS = "android.permission.MANAGE_DEVICE_POLICY_MANAGED_SUBSCRIPTIONS"; field public static final String MANAGE_DEVICE_POLICY_METERED_DATA = "android.permission.MANAGE_DEVICE_POLICY_METERED_DATA"; field public static final String MANAGE_DEVICE_POLICY_MICROPHONE = "android.permission.MANAGE_DEVICE_POLICY_MICROPHONE"; + field @FlaggedApi("android.app.admin.flags.dedicated_device_control_api_enabled") public static final String MANAGE_DEVICE_POLICY_MICROPHONE_TOGGLE = "android.permission.MANAGE_DEVICE_POLICY_MICROPHONE_TOGGLE"; field public static final String MANAGE_DEVICE_POLICY_MOBILE_NETWORK = "android.permission.MANAGE_DEVICE_POLICY_MOBILE_NETWORK"; field public static final String MANAGE_DEVICE_POLICY_MODIFY_USERS = "android.permission.MANAGE_DEVICE_POLICY_MODIFY_USERS"; field public static final String MANAGE_DEVICE_POLICY_MTE = "android.permission.MANAGE_DEVICE_POLICY_MTE"; @@ -272,8 +282,10 @@ package android { 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 @FlaggedApi("android.companion.flags.device_presence") public static final String REQUEST_OBSERVE_DEVICE_UUID_PRESENCE = "android.permission.REQUEST_OBSERVE_DEVICE_UUID_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 @FlaggedApi("android.app.job.backup_jobs_exemption") public static final String RUN_BACKUP_JOBS = "android.permission.RUN_BACKUP_JOBS"; field public static final String RUN_USER_INITIATED_JOBS = "android.permission.RUN_USER_INITIATED_JOBS"; field public static final String SCHEDULE_EXACT_ALARM = "android.permission.SCHEDULE_EXACT_ALARM"; field public static final String SEND_RESPOND_VIA_MESSAGE = "android.permission.SEND_RESPOND_VIA_MESSAGE"; @@ -281,6 +293,7 @@ package android { field public static final String SET_ALARM = "com.android.alarm.permission.SET_ALARM"; field public static final String SET_ALWAYS_FINISH = "android.permission.SET_ALWAYS_FINISH"; field public static final String SET_ANIMATION_SCALE = "android.permission.SET_ANIMATION_SCALE"; + field @FlaggedApi("android.hardware.biometrics.custom_biometric_prompt") public static final String SET_BIOMETRIC_DIALOG_LOGO = "android.permission.SET_BIOMETRIC_DIALOG_LOGO"; field public static final String SET_DEBUG_APP = "android.permission.SET_DEBUG_APP"; field @Deprecated public static final String SET_PREFERRED_APPLICATIONS = "android.permission.SET_PREFERRED_APPLICATIONS"; field public static final String SET_PROCESS_LIMIT = "android.permission.SET_PROCESS_LIMIT"; @@ -429,6 +442,7 @@ package android { field public static final int activityCloseExitAnimation = 16842939; // 0x10100bb field public static final int activityOpenEnterAnimation = 16842936; // 0x10100b8 field public static final int activityOpenExitAnimation = 16842937; // 0x10100b9 + field @FlaggedApi("android.media.tv.flags.enable_ad_service_fw") public static final int adServiceTypes; field public static final int addPrintersActivity = 16843750; // 0x10103e6 field public static final int addStatesFromChildren = 16842992; // 0x10100f0 field public static final int adjustViewBounds = 16843038; // 0x101011e @@ -438,10 +452,12 @@ package android { field public static final int alertDialogTheme = 16843529; // 0x1010309 field public static final int alignmentMode = 16843642; // 0x101037a field public static final int allContactsName = 16843468; // 0x10102cc + field @FlaggedApi("android.content.pm.relative_reference_intent_filters") public static final int allow; field public static final int allowAudioPlaybackCapture = 16844289; // 0x1010601 field public static final int allowBackup = 16843392; // 0x1010280 field public static final int allowClearUserData = 16842757; // 0x1010005 field public static final int allowClickWhenDisabled = 16844312; // 0x1010618 + field @FlaggedApi("android.security.asm_restrictions_enabled") public static final int allowCrossUidActivitySwitchFromBelow; field public static final int allowEmbedded = 16843765; // 0x10103f5 field public static final int allowGameAngleDriver = 16844376; // 0x1010658 field public static final int allowGameDownscaling = 16844377; // 0x1010659 @@ -496,6 +512,7 @@ package android { field public static final int autoSizeTextType = 16844085; // 0x1010535 field public static final int autoStart = 16843445; // 0x10102b5 field @Deprecated public static final int autoText = 16843114; // 0x101016a + field @FlaggedApi("android.nfc.Flags.FLAG_NFC_READ_POLLING_LOOP") public static final int autoTransact; field public static final int autoUrlDetect = 16843404; // 0x101028c field public static final int autoVerify = 16844014; // 0x10104ee field public static final int autofillHints = 16844118; // 0x1010556 @@ -642,6 +659,7 @@ package android { field public static final int contentInsetRight = 16843862; // 0x1010456 field public static final int contentInsetStart = 16843859; // 0x1010453 field public static final int contentInsetStartWithNavigation = 16844066; // 0x1010522 + field @FlaggedApi("android.view.flags.sensitive_content_app_protection_api") public static final int contentSensitivity; field public static final int contextClickable = 16844007; // 0x10104e7 field public static final int contextDescription = 16844078; // 0x101052e field public static final int contextPopupMenuStyle = 16844033; // 0x1010501 @@ -754,7 +772,7 @@ package android { field public static final int endY = 16844051; // 0x1010513 field @Deprecated public static final int endYear = 16843133; // 0x101017d field public static final int enforceNavigationBarContrast = 16844293; // 0x1010605 - field public static final int enforceStatusBarContrast = 16844292; // 0x1010604 + field @Deprecated public static final int enforceStatusBarContrast = 16844292; // 0x1010604 field public static final int enterFadeDuration = 16843532; // 0x101030c field public static final int entries = 16842930; // 0x10100b2 field public static final int entryValues = 16843256; // 0x10101f8 @@ -841,6 +859,7 @@ package android { field public static final int format24Hour = 16843723; // 0x10103cb field public static final int fraction = 16843992; // 0x10104d8 field public static final int fragment = 16843491; // 0x10102e3 + field @FlaggedApi("android.content.pm.relative_reference_intent_filters") public static final int fragmentAdvancedPattern; field public static final int fragmentAllowEnterTransitionOverlap = 16843976; // 0x10104c8 field public static final int fragmentAllowReturnTransitionOverlap = 16843977; // 0x10104c9 field public static final int fragmentCloseEnterAnimation = 16843495; // 0x10102e7 @@ -851,10 +870,13 @@ package android { field public static final int fragmentFadeExitAnimation = 16843498; // 0x10102ea field public static final int fragmentOpenEnterAnimation = 16843493; // 0x10102e5 field public static final int fragmentOpenExitAnimation = 16843494; // 0x10102e6 + field @FlaggedApi("android.content.pm.relative_reference_intent_filters") public static final int fragmentPattern; + field @FlaggedApi("android.content.pm.relative_reference_intent_filters") public static final int fragmentPrefix; field public static final int fragmentReenterTransition = 16843975; // 0x10104c7 field public static final int fragmentReturnTransition = 16843973; // 0x10104c5 field public static final int fragmentSharedElementEnterTransition = 16843972; // 0x10104c4 field public static final int fragmentSharedElementReturnTransition = 16843974; // 0x10104c6 + field @FlaggedApi("android.content.pm.relative_reference_intent_filters") public static final int fragmentSuffix; field public static final int freezesText = 16843116; // 0x101016c field public static final int fromAlpha = 16843210; // 0x10101ca field public static final int fromDegrees = 16843187; // 0x10101b3 @@ -1037,6 +1059,7 @@ package android { field public static final int label = 16842753; // 0x1010001 field public static final int labelFor = 16843718; // 0x10103c6 field @Deprecated public static final int labelTextSize = 16843317; // 0x1010235 + field @FlaggedApi("android.view.inputmethod.ime_switcher_revamp") public static final int languageSettingsActivity; field public static final int languageTag = 16844040; // 0x1010508 field public static final int largeHeap = 16843610; // 0x101035a field public static final int largeScreens = 16843398; // 0x1010286 @@ -1181,8 +1204,8 @@ package android { field public static final int multiprocess = 16842771; // 0x1010013 field public static final int name = 16842755; // 0x1010003 field public static final int nativeHeapZeroInitialized = 16844325; // 0x1010625 - field public static final int navigationBarColor = 16843858; // 0x1010452 - field public static final int navigationBarDividerColor = 16844141; // 0x101056d + field @Deprecated public static final int navigationBarColor = 16843858; // 0x1010452 + field @Deprecated public static final int navigationBarDividerColor = 16844141; // 0x101056d field public static final int navigationContentDescription = 16843969; // 0x10104c1 field public static final int navigationIcon = 16843968; // 0x10104c0 field public static final int navigationMode = 16843471; // 0x10102cf @@ -1323,10 +1346,15 @@ package android { field public static final int propertyYName = 16843893; // 0x1010475 field public static final int protectionLevel = 16842761; // 0x1010009 field public static final int publicKey = 16843686; // 0x10103a6 + field @FlaggedApi("android.content.pm.relative_reference_intent_filters") public static final int query; field public static final int queryActionMsg = 16843227; // 0x10101db + field @FlaggedApi("android.content.pm.relative_reference_intent_filters") public static final int queryAdvancedPattern; field public static final int queryAfterZeroResults = 16843394; // 0x1010282 field public static final int queryBackground = 16843911; // 0x1010487 field public static final int queryHint = 16843608; // 0x1010358 + field @FlaggedApi("android.content.pm.relative_reference_intent_filters") public static final int queryPattern; + field @FlaggedApi("android.content.pm.relative_reference_intent_filters") public static final int queryPrefix; + field @FlaggedApi("android.content.pm.relative_reference_intent_filters") public static final int querySuffix; field public static final int quickContactBadgeStyleSmallWindowLarge = 16843443; // 0x10102b3 field public static final int quickContactBadgeStyleSmallWindowMedium = 16843442; // 0x10102b2 field public static final int quickContactBadgeStyleSmallWindowSmall = 16843441; // 0x10102b1 @@ -1355,6 +1383,7 @@ package android { field public static final int reqTouchScreen = 16843303; // 0x1010227 field public static final int requestLegacyExternalStorage = 16844291; // 0x1010603 field public static final int requestRawExternalStorageAccess = 16844357; // 0x1010645 + field @FlaggedApi("android.security.content_uri_permission_apis") public static final int requireContentUriPermissionFromCaller; field public static final int requireDeviceScreenOn = 16844317; // 0x101061d field public static final int requireDeviceUnlock = 16843756; // 0x10103ec field public static final int required = 16843406; // 0x101028e @@ -1466,10 +1495,12 @@ package android { field @Deprecated public static final int sharedUserLabel = 16843361; // 0x1010261 field public static final int sharedUserMaxSdkVersion = 16844365; // 0x101064d field public static final int shell = 16844180; // 0x1010594 + field @FlaggedApi("com.android.text.flags.use_bounds_for_width") public static final int shiftDrawingOffsetForStartOverhang; field public static final int shortcutDisabledMessage = 16844075; // 0x101052b field public static final int shortcutId = 16844072; // 0x1010528 field public static final int shortcutLongLabel = 16844074; // 0x101052a field public static final int shortcutShortLabel = 16844073; // 0x1010529 + field @FlaggedApi("android.nfc.Flags.FLAG_OBSERVE_MODE") public static final int shouldDefaultToObserveMode; field public static final int shouldDisableView = 16843246; // 0x10101ee field public static final int shouldUseDefaultUnfoldTransition = 16844364; // 0x101064c field public static final int showAsAction = 16843481; // 0x10102d9 @@ -1548,7 +1579,7 @@ package android { field public static final int state_single = 16842915; // 0x10100a3 field public static final int state_window_focused = 16842909; // 0x101009d field public static final int staticWallpaperPreview = 16843569; // 0x1010331 - field public static final int statusBarColor = 16843857; // 0x1010451 + field @Deprecated public static final int statusBarColor = 16843857; // 0x1010451 field public static final int stepSize = 16843078; // 0x1010146 field public static final int stopWithTask = 16843626; // 0x101036a field public static final int streamType = 16843273; // 0x1010209 @@ -1580,6 +1611,7 @@ package android { field public static final int supportedTypes = 16844369; // 0x1010651 field public static final int supportsAssist = 16844016; // 0x10104f0 field public static final int supportsBatteryGameMode = 16844374; // 0x1010656 + field @FlaggedApi("android.view.inputmethod.connectionless_handwriting") public static final int supportsConnectionlessStylusHandwriting; field public static final int supportsInlineSuggestions = 16844301; // 0x101060d field public static final int supportsInlineSuggestionsWithTouchExploration = 16844397; // 0x101066d field public static final int supportsLaunchVoiceAssistFromKeyguard = 16844017; // 0x10104f1 @@ -1600,6 +1632,7 @@ package android { field public static final int switchTextOff = 16843628; // 0x101036c field public static final int switchTextOn = 16843627; // 0x101036b field public static final int syncable = 16842777; // 0x1010019 + field @FlaggedApi("android.multiuser.enable_system_user_only_for_services_and_providers") public static final int systemUserOnly; field public static final int tabStripEnabled = 16843453; // 0x10102bd field public static final int tabStripLeft = 16843451; // 0x10102bb field public static final int tabStripRight = 16843452; // 0x10102bc @@ -1776,10 +1809,12 @@ package android { field public static final int updatePeriodMillis = 16843344; // 0x1010250 field public static final int use32bitAbi = 16844053; // 0x1010515 field public static final int useAppZygote = 16844183; // 0x1010597 + field @FlaggedApi("com.android.text.flags.use_bounds_for_width") public static final int useBoundsForWidth; field public static final int useDefaultMargins = 16843641; // 0x1010379 field public static final int useEmbeddedDex = 16844190; // 0x101059e field public static final int useIntrinsicSizeAsMinimum = 16843536; // 0x1010310 field public static final int useLevel = 16843167; // 0x101019f + field @FlaggedApi("com.android.text.flags.fix_line_height_for_locale") public static final int useLocalePreferredLineHeightForMinimum; field public static final int userVisible = 16843409; // 0x1010291 field public static final int usesCleartextTraffic = 16844012; // 0x10104ec field public static final int usesPermissionFlags = 16844356; // 0x1010644 @@ -1858,6 +1893,7 @@ package android { field public static final int windowFullscreen = 16843277; // 0x101020d field public static final int windowHideAnimation = 16842935; // 0x10100b7 field public static final int windowIsFloating = 16842839; // 0x1010057 + field @FlaggedApi("android.view.flags.toolkit_set_frame_rate_read_only") public static final int windowIsFrameRatePowerSavingsBalanced; field public static final int windowIsTranslucent = 16842840; // 0x1010058 field public static final int windowLayoutAffinity = 16844313; // 0x1010619 field public static final int windowLayoutInDisplayCutoutMode = 16844166; // 0x1010586 @@ -1868,6 +1904,7 @@ package android { field public static final int windowNoDisplay = 16843294; // 0x101021e field public static final int windowNoMoveAnimation = 16844421; // 0x1010685 field public static final int windowNoTitle = 16842838; // 0x1010056 + field @FlaggedApi("com.android.window.flags.enforce_edge_to_edge") public static final int windowOptOutEdgeToEdgeEnforcement; field @Deprecated public static final int windowOverscan = 16843727; // 0x10103cf field public static final int windowReenterTransition = 16843951; // 0x10104af field public static final int windowReturnTransition = 16843950; // 0x10104ae @@ -1979,6 +2016,19 @@ package android { field public static final int system_control_highlight_light = 17170558; // 0x106007e field public static final int system_control_normal_dark = 17170600; // 0x10600a8 field public static final int system_control_normal_light = 17170557; // 0x106007d + field public static final int system_error_0; + field public static final int system_error_10; + field public static final int system_error_100; + field public static final int system_error_1000; + field public static final int system_error_200; + field public static final int system_error_300; + field public static final int system_error_400; + field public static final int system_error_50; + field public static final int system_error_500; + field public static final int system_error_600; + field public static final int system_error_700; + field public static final int system_error_800; + field public static final int system_error_900; field public static final int system_error_container_dark = 17170597; // 0x10600a5 field public static final int system_error_container_light = 17170554; // 0x106007a field public static final int system_error_dark = 17170595; // 0x10600a3 @@ -2028,6 +2078,7 @@ package android { field public static final int system_on_secondary_fixed_variant = 17170619; // 0x10600bb field public static final int system_on_secondary_light = 17170533; // 0x1060065 field public static final int system_on_surface_dark = 17170584; // 0x1060098 + field public static final int system_on_surface_disabled; field public static final int system_on_surface_light = 17170541; // 0x106006d field public static final int system_on_surface_variant_dark = 17170593; // 0x10600a1 field public static final int system_on_surface_variant_light = 17170550; // 0x1060076 @@ -2038,6 +2089,7 @@ package android { field public static final int system_on_tertiary_fixed_variant = 17170623; // 0x10600bf field public static final int system_on_tertiary_light = 17170537; // 0x1060069 field public static final int system_outline_dark = 17170594; // 0x10600a2 + field public static final int system_outline_disabled; field public static final int system_outline_light = 17170551; // 0x1060077 field public static final int system_outline_variant_dark = 17170625; // 0x10600c1 field public static final int system_outline_variant_light = 17170624; // 0x10600c0 @@ -2078,6 +2130,7 @@ package android { field public static final int system_surface_dark = 17170583; // 0x1060097 field public static final int system_surface_dim_dark = 17170591; // 0x106009f field public static final int system_surface_dim_light = 17170548; // 0x1060074 + field public static final int system_surface_disabled; field public static final int system_surface_light = 17170540; // 0x106006c field public static final int system_surface_variant_dark = 17170592; // 0x10600a0 field public static final int system_surface_variant_light = 17170549; // 0x1060075 @@ -3302,6 +3355,7 @@ package android.accessibilityservice { method public android.view.accessibility.AccessibilityNodeInfo findFocus(int); method @NonNull public final android.accessibilityservice.AccessibilityButtonController getAccessibilityButtonController(); method @NonNull public final android.accessibilityservice.AccessibilityButtonController getAccessibilityButtonController(int); + method @FlaggedApi("android.view.accessibility.braille_display_hid") @NonNull public android.accessibilityservice.BrailleDisplayController getBrailleDisplayController(); method @NonNull @RequiresPermission(android.Manifest.permission.USE_FINGERPRINT) public final android.accessibilityservice.FingerprintGestureController getFingerprintGestureController(); method @Nullable public final android.accessibilityservice.InputMethod getInputMethod(); method @NonNull public final android.accessibilityservice.AccessibilityService.MagnificationController getMagnificationController(); @@ -3535,6 +3589,25 @@ package android.accessibilityservice { field public String[] packageNames; } + @FlaggedApi("android.view.accessibility.braille_display_hid") public interface BrailleDisplayController { + method @FlaggedApi("android.view.accessibility.braille_display_hid") @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public void connect(@NonNull android.bluetooth.BluetoothDevice, @NonNull android.accessibilityservice.BrailleDisplayController.BrailleDisplayCallback); + method @FlaggedApi("android.view.accessibility.braille_display_hid") @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public void connect(@NonNull android.bluetooth.BluetoothDevice, @NonNull java.util.concurrent.Executor, @NonNull android.accessibilityservice.BrailleDisplayController.BrailleDisplayCallback); + method @FlaggedApi("android.view.accessibility.braille_display_hid") public void connect(@NonNull android.hardware.usb.UsbDevice, @NonNull android.accessibilityservice.BrailleDisplayController.BrailleDisplayCallback); + method @FlaggedApi("android.view.accessibility.braille_display_hid") public void connect(@NonNull android.hardware.usb.UsbDevice, @NonNull java.util.concurrent.Executor, @NonNull android.accessibilityservice.BrailleDisplayController.BrailleDisplayCallback); + method @FlaggedApi("android.view.accessibility.braille_display_hid") public void disconnect(); + method @FlaggedApi("android.view.accessibility.braille_display_hid") public boolean isConnected(); + method @FlaggedApi("android.view.accessibility.braille_display_hid") public void write(@NonNull byte[]) throws java.io.IOException; + } + + @FlaggedApi("android.view.accessibility.braille_display_hid") public static interface BrailleDisplayController.BrailleDisplayCallback { + method @FlaggedApi("android.view.accessibility.braille_display_hid") public void onConnected(@NonNull byte[]); + method @FlaggedApi("android.view.accessibility.braille_display_hid") public void onConnectionFailed(int); + method @FlaggedApi("android.view.accessibility.braille_display_hid") public void onDisconnected(); + method @FlaggedApi("android.view.accessibility.braille_display_hid") public void onInput(@NonNull byte[]); + field @FlaggedApi("android.view.accessibility.braille_display_hid") public static final int FLAG_ERROR_BRAILLE_DISPLAY_NOT_FOUND = 2; // 0x2 + field @FlaggedApi("android.view.accessibility.braille_display_hid") public static final int FLAG_ERROR_CANNOT_ACCESS = 1; // 0x1 + } + public final class FingerprintGestureController { method public boolean isGestureDetectionAvailable(); method public void registerFingerprintGestureCallback(@NonNull android.accessibilityservice.FingerprintGestureController.FingerprintGestureCallback, @Nullable android.os.Handler); @@ -4350,14 +4423,17 @@ package android.app { method @Deprecated public void finishFromChild(android.app.Activity); method @Nullable public android.app.ActionBar getActionBar(); method public final android.app.Application getApplication(); + method @FlaggedApi("android.security.content_uri_permission_apis") @Nullable public android.app.ComponentCaller getCaller(); method @Nullable public android.content.ComponentName getCallingActivity(); method @Nullable public String getCallingPackage(); method public int getChangingConfigurations(); method public android.content.ComponentName getComponentName(); method public android.transition.Scene getContentScene(); method public android.transition.TransitionManager getContentTransitionManager(); + method @FlaggedApi("android.security.content_uri_permission_apis") @NonNull public android.app.ComponentCaller getCurrentCaller(); method @Nullable public android.view.View getCurrentFocus(); method @Deprecated public android.app.FragmentManager getFragmentManager(); + method @FlaggedApi("android.security.content_uri_permission_apis") @NonNull public android.app.ComponentCaller getInitialCaller(); method public android.content.Intent getIntent(); method @Nullable public Object getLastNonConfigurationInstance(); method @Nullable public String getLaunchedFromPackage(); @@ -4406,6 +4482,7 @@ package android.app { method @CallSuper public void onActionModeStarted(android.view.ActionMode); method public void onActivityReenter(int, android.content.Intent); method protected void onActivityResult(int, int, android.content.Intent); + method @FlaggedApi("android.security.content_uri_permission_apis") public void onActivityResult(int, int, @NonNull android.content.Intent, @NonNull android.app.ComponentCaller); method @Deprecated public void onAttachFragment(android.app.Fragment); method public void onAttachedToWindow(); method @Deprecated public void onBackPressed(); @@ -4447,6 +4524,7 @@ package android.app { method public boolean onNavigateUp(); method @Deprecated public boolean onNavigateUpFromChild(android.app.Activity); method protected void onNewIntent(android.content.Intent); + method @FlaggedApi("android.security.content_uri_permission_apis") public void onNewIntent(@NonNull android.content.Intent, @NonNull android.app.ComponentCaller); method public boolean onOptionsItemSelected(@NonNull android.view.MenuItem); method public void onOptionsMenuClosed(android.view.Menu); method public void onPanelClosed(int, @NonNull android.view.Menu); @@ -4534,6 +4612,7 @@ package android.app { method public void setImmersive(boolean); method public void setInheritShowWhenLocked(boolean); method public void setIntent(android.content.Intent); + method @FlaggedApi("android.security.content_uri_permission_apis") public void setIntent(@Nullable android.content.Intent, @Nullable android.app.ComponentCaller); method public void setLocusContext(@Nullable android.content.LocusId, @Nullable android.os.Bundle); method public final void setMediaController(android.media.session.MediaController); method public void setPictureInPictureParams(@NonNull android.app.PictureInPictureParams); @@ -4622,9 +4701,9 @@ package android.app { public class ActivityManager { method public int addAppTask(@NonNull android.app.Activity, @NonNull android.content.Intent, @Nullable android.app.ActivityManager.TaskDescription, @NonNull android.graphics.Bitmap); + method @FlaggedApi("android.app.app_start_info") public void addApplicationStartInfoCompletionListener(@NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer); method @FlaggedApi("android.app.app_start_info") public void addStartInfoTimestamp(@IntRange(from=android.app.ApplicationStartInfo.START_TIMESTAMP_RESERVED_RANGE_DEVELOPER_START, to=android.app.ApplicationStartInfo.START_TIMESTAMP_RESERVED_RANGE_DEVELOPER) int, long); method public void appNotResponding(@NonNull String); - method @FlaggedApi("android.app.app_start_info") public void clearApplicationStartInfoCompletionListener(); method public boolean clearApplicationUserData(); method public void clearWatchHeapLimit(); method @RequiresPermission(android.Manifest.permission.DUMP) public void dumpPackageState(java.io.FileDescriptor, String); @@ -4658,8 +4737,8 @@ package android.app { method @RequiresPermission(android.Manifest.permission.KILL_BACKGROUND_PROCESSES) public void killBackgroundProcesses(String); method @RequiresPermission(android.Manifest.permission.REORDER_TASKS) public void moveTaskToFront(int, int); method @RequiresPermission(android.Manifest.permission.REORDER_TASKS) public void moveTaskToFront(int, int, android.os.Bundle); + method @FlaggedApi("android.app.app_start_info") public void removeApplicationStartInfoCompletionListener(@NonNull java.util.function.Consumer); method @Deprecated public void restartPackage(String); - method @FlaggedApi("android.app.app_start_info") public void setApplicationStartInfoCompletionListener(@NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer); method public void setProcessStateSummary(@Nullable byte[]); method public static void setVrThread(int); method public void setWatchHeapLimit(long); @@ -5077,10 +5156,12 @@ package android.app { public static interface AppOpsManager.OnOpActiveChangedListener { method public void onOpActiveChanged(@NonNull String, int, @NonNull String, boolean); + method @FlaggedApi("android.permission.flags.device_aware_permission_apis_enabled") public default void onOpActiveChanged(@NonNull String, int, @NonNull String, @Nullable String, int, boolean, int, int); } public static interface AppOpsManager.OnOpChangedListener { method public void onOpChanged(String, String); + method @FlaggedApi("android.permission.flags.device_aware_permission_apis_enabled") public default void onOpChanged(@NonNull String, @NonNull String, int, @NonNull String); } public abstract static class AppOpsManager.OnOpNotedCallback { @@ -5253,6 +5334,7 @@ package android.app { method public int getStartType(); method public int getStartupState(); method @NonNull public java.util.Map getStartupTimestamps(); + method @FlaggedApi("android.content.pm.stay_stopped") public boolean wasForceStopped(); method public void writeToParcel(@NonNull android.os.Parcel, int); field @NonNull public static final android.os.Parcelable.Creator CREATOR; field public static final int LAUNCH_MODE_SINGLE_INSTANCE = 2; // 0x2 @@ -5382,11 +5464,15 @@ package android.app { method public int getDeferralPolicy(); method @Nullable public String getDeliveryGroupMatchingKey(); method public int getDeliveryGroupPolicy(); + method @FlaggedApi("android.app.bcast_event_timestamps") public long getEventTriggerTimestampMillis(); + method @FlaggedApi("android.app.bcast_event_timestamps") public long getRemoteEventTriggerTimestampMillis(); method public boolean isShareIdentityEnabled(); method @NonNull public static android.app.BroadcastOptions makeBasic(); method @NonNull public android.app.BroadcastOptions setDeferralPolicy(int); method @NonNull public android.app.BroadcastOptions setDeliveryGroupMatchingKey(@NonNull String, @NonNull String); method @NonNull public android.app.BroadcastOptions setDeliveryGroupPolicy(int); + method @FlaggedApi("android.app.bcast_event_timestamps") public void setEventTriggerTimestampMillis(long); + method @FlaggedApi("android.app.bcast_event_timestamps") public void setRemoteEventTriggerTimestampMillis(long); method @NonNull public android.app.BroadcastOptions setShareIdentityEnabled(boolean); method @NonNull public android.os.Bundle toBundle(); field public static final int DEFERRAL_POLICY_DEFAULT = 0; // 0x0 @@ -5396,6 +5482,12 @@ package android.app { field public static final int DELIVERY_GROUP_POLICY_MOST_RECENT = 1; // 0x1 } + @FlaggedApi("android.security.content_uri_permission_apis") public final class ComponentCaller { + method public int checkContentUriPermission(@NonNull android.net.Uri, int); + method @Nullable public String getPackage(); + method public int getUid(); + } + public class DatePickerDialog extends android.app.AlertDialog implements android.widget.DatePicker.OnDateChangedListener android.content.DialogInterface.OnClickListener { ctor public DatePickerDialog(@NonNull android.content.Context); ctor public DatePickerDialog(@NonNull android.content.Context, @StyleRes int); @@ -6008,6 +6100,7 @@ package android.app { method public void callActivityOnCreate(android.app.Activity, android.os.Bundle, android.os.PersistableBundle); method public void callActivityOnDestroy(android.app.Activity); method public void callActivityOnNewIntent(android.app.Activity, android.content.Intent); + method @FlaggedApi("android.security.content_uri_permission_apis") public void callActivityOnNewIntent(@NonNull android.app.Activity, @NonNull android.content.Intent, @NonNull android.app.ComponentCaller); method public void callActivityOnPause(android.app.Activity); method public void callActivityOnPictureInPictureRequested(@NonNull android.app.Activity); method public void callActivityOnPostCreate(@NonNull android.app.Activity, @Nullable android.os.Bundle); @@ -6335,6 +6428,7 @@ package android.app { field public static final String CATEGORY_STOPWATCH = "stopwatch"; field public static final String CATEGORY_SYSTEM = "sys"; field public static final String CATEGORY_TRANSPORT = "transport"; + field @FlaggedApi("android.app.category_voicemail") public static final String CATEGORY_VOICEMAIL = "voicemail"; field public static final String CATEGORY_WORKOUT = "workout"; field @ColorInt public static final int COLOR_DEFAULT = 0; // 0x0 field @NonNull public static final android.os.Parcelable.Creator CREATOR; @@ -6857,6 +6951,7 @@ package android.app { method public CharSequence getName(); method @Nullable public String getParentChannelId(); method public android.net.Uri getSound(); + method @FlaggedApi("android.app.notification_channel_vibration_effect_api") @Nullable public android.os.VibrationEffect getVibrationEffect(); method public long[] getVibrationPattern(); method public boolean hasUserSetImportance(); method public boolean hasUserSetSound(); @@ -6876,6 +6971,7 @@ package android.app { method public void setName(CharSequence); method public void setShowBadge(boolean); method public void setSound(android.net.Uri, android.media.AudioAttributes); + method @FlaggedApi("android.app.notification_channel_vibration_effect_api") public void setVibrationEffect(@Nullable android.os.VibrationEffect); method public void setVibrationPattern(long[]); method public boolean shouldShowLights(); method public boolean shouldVibrate(); @@ -6926,6 +7022,7 @@ package android.app { method public void deleteNotificationChannelGroup(String); method public android.service.notification.StatusBarNotification[] getActiveNotifications(); method public android.app.AutomaticZenRule getAutomaticZenRule(String); + method @FlaggedApi("android.app.modes_api") public int getAutomaticZenRuleState(@NonNull String); method public java.util.Map getAutomaticZenRules(); method public int getBubblePreference(); method @NonNull public android.app.NotificationManager.Policy getConsolidatedNotificationPolicy(); @@ -6954,6 +7051,7 @@ package android.app { field public static final String ACTION_APP_BLOCK_STATE_CHANGED = "android.app.action.APP_BLOCK_STATE_CHANGED"; field public static final String ACTION_AUTOMATIC_ZEN_RULE = "android.app.action.AUTOMATIC_ZEN_RULE"; field public static final String ACTION_AUTOMATIC_ZEN_RULE_STATUS_CHANGED = "android.app.action.AUTOMATIC_ZEN_RULE_STATUS_CHANGED"; + field @FlaggedApi("android.app.modes_api") public static final String ACTION_CONSOLIDATED_NOTIFICATION_POLICY_CHANGED = "android.app.action.CONSOLIDATED_NOTIFICATION_POLICY_CHANGED"; field public static final String ACTION_INTERRUPTION_FILTER_CHANGED = "android.app.action.INTERRUPTION_FILTER_CHANGED"; field public static final String ACTION_NOTIFICATION_CHANNEL_BLOCK_STATE_CHANGED = "android.app.action.NOTIFICATION_CHANNEL_BLOCK_STATE_CHANGED"; field public static final String ACTION_NOTIFICATION_CHANNEL_GROUP_BLOCK_STATE_CHANGED = "android.app.action.NOTIFICATION_CHANNEL_GROUP_BLOCK_STATE_CHANGED"; @@ -6974,6 +7072,7 @@ package android.app { field public static final String EXTRA_BLOCKED_STATE = "android.app.extra.BLOCKED_STATE"; field public static final String EXTRA_NOTIFICATION_CHANNEL_GROUP_ID = "android.app.extra.NOTIFICATION_CHANNEL_GROUP_ID"; field public static final String EXTRA_NOTIFICATION_CHANNEL_ID = "android.app.extra.NOTIFICATION_CHANNEL_ID"; + field @FlaggedApi("android.app.modes_api") public static final String EXTRA_NOTIFICATION_POLICY = "android.app.extra.NOTIFICATION_POLICY"; field public static final int IMPORTANCE_DEFAULT = 3; // 0x3 field public static final int IMPORTANCE_HIGH = 4; // 0x4 field public static final int IMPORTANCE_LOW = 2; // 0x2 @@ -7139,6 +7238,7 @@ package android.app { public final class PictureInPictureUiState implements android.os.Parcelable { method public int describeContents(); method public boolean isStashed(); + method @FlaggedApi("android.app.enable_pip_ui_state_callback_on_entering") public boolean isTransitioningToPip(); method public void writeToParcel(@NonNull android.os.Parcel, int); field @NonNull public static final android.os.Parcelable.Creator CREATOR; } @@ -7362,6 +7462,7 @@ package android.app { method public int onStartCommand(android.content.Intent, int, int); method public void onTaskRemoved(android.content.Intent); method public void onTimeout(int); + method @FlaggedApi("android.app.introduce_new_service_ontimeout_callback") public void onTimeout(int, int); method public void onTrimMemory(int); method public boolean onUnbind(android.content.Intent); method public final void startForeground(int, android.app.Notification); @@ -7696,7 +7797,7 @@ package android.app { method @Nullable public android.app.WallpaperColors getWallpaperColors(int); method @Nullable @RequiresPermission(anyOf={android.Manifest.permission.MANAGE_EXTERNAL_STORAGE, "android.permission.READ_WALLPAPER_INTERNAL"}) public android.os.ParcelFileDescriptor getWallpaperFile(int); method public int getWallpaperId(int); - method public android.app.WallpaperInfo getWallpaperInfo(); + method @RequiresPermission(value="QUERY_ALL_PACKAGES", conditional=true) public android.app.WallpaperInfo getWallpaperInfo(); method @Nullable public android.app.WallpaperInfo getWallpaperInfo(int); method public boolean hasResourceWallpaper(@RawRes int); method public boolean isSetWallpaperAllowed(); @@ -7777,6 +7878,7 @@ package android.app.admin { method public void writeToParcel(android.os.Parcel, int); field @NonNull public static final android.os.Parcelable.Creator CREATOR; field public static final int HEADLESS_DEVICE_OWNER_MODE_AFFILIATED = 1; // 0x1 + field @FlaggedApi("android.app.admin.flags.headless_device_owner_single_user_enabled") public static final int HEADLESS_DEVICE_OWNER_MODE_SINGLE_USER = 2; // 0x2 field public static final int HEADLESS_DEVICE_OWNER_MODE_UNSUPPORTED = 0; // 0x0 field public static final int USES_ENCRYPTED_STORAGE = 7; // 0x7 field public static final int USES_POLICY_DISABLE_CAMERA = 8; // 0x8 @@ -7860,13 +7962,16 @@ package android.app.admin { field public static final String AUTO_TIME_POLICY = "autoTime"; field public static final String BACKUP_SERVICE_POLICY = "backupService"; field public static final String CAMERA_DISABLED_POLICY = "cameraDisabled"; + field @FlaggedApi("android.view.contentprotection.flags.manage_device_policy_enabled") public static final String CONTENT_PROTECTION_POLICY = "contentProtection"; field public static final String KEYGUARD_DISABLED_FEATURES_POLICY = "keyguardDisabledFeatures"; field public static final String LOCK_TASK_POLICY = "lockTask"; field public static final String PACKAGES_SUSPENDED_POLICY = "packagesSuspended"; field public static final String PACKAGE_UNINSTALL_BLOCKED_POLICY = "packageUninstallBlocked"; + field @FlaggedApi("android.app.admin.flags.policy_engine_migration_v2_enabled") public static final String PASSWORD_COMPLEXITY_POLICY = "passwordComplexity"; field public static final String PERMISSION_GRANT_POLICY = "permissionGrant"; field public static final String PERSISTENT_PREFERRED_ACTIVITY_POLICY = "persistentPreferredActivity"; field public static final String RESET_PASSWORD_TOKEN_POLICY = "resetPasswordToken"; + field @FlaggedApi("android.app.admin.flags.security_log_v2_enabled") public static final String SECURITY_LOGGING_POLICY = "securityLogging"; field public static final String STATUS_BAR_DISABLED_POLICY = "statusBarDisabled"; field @FlaggedApi("android.app.admin.flags.policy_engine_migration_v2_enabled") public static final String USB_DATA_SIGNALING_POLICY = "usbDataSignaling"; field public static final String USER_CONTROL_DISABLED_PACKAGES_POLICY = "userControlDisabledPackages"; @@ -7910,6 +8015,7 @@ package android.app.admin { method public boolean getBluetoothContactSharingDisabled(@NonNull android.content.ComponentName); method @RequiresPermission(value=android.Manifest.permission.MANAGE_DEVICE_POLICY_CAMERA, conditional=true) public boolean getCameraDisabled(@Nullable android.content.ComponentName); method @Deprecated @Nullable public String getCertInstallerPackage(@NonNull android.content.ComponentName) throws java.lang.SecurityException; + method @FlaggedApi("android.view.contentprotection.flags.manage_device_policy_enabled") @RequiresPermission(value=android.Manifest.permission.MANAGE_DEVICE_POLICY_CONTENT_PROTECTION, conditional=true) public int getContentProtectionPolicy(@Nullable android.content.ComponentName); method @Nullable public android.app.admin.PackagePolicy getCredentialManagerPolicy(); method @Deprecated @Nullable public java.util.Set getCrossProfileCalendarPackages(@NonNull android.content.ComponentName); method @Deprecated public boolean getCrossProfileCallerIdDisabled(@NonNull android.content.ComponentName); @@ -7922,7 +8028,7 @@ package android.app.admin { method public CharSequence getDeviceOwnerLockScreenInfo(); method @Nullable public String getDevicePolicyManagementRoleHolderPackage(); method public CharSequence getEndUserSessionMessage(@NonNull android.content.ComponentName); - method @NonNull public String getEnrollmentSpecificId(); + method @FlaggedApi("android.app.admin.flags.permission_migration_for_zero_trust_api_enabled") @NonNull @RequiresPermission(value=android.Manifest.permission.MANAGE_DEVICE_POLICY_CERTIFICATES, conditional=true) public String getEnrollmentSpecificId(); method @Nullable @RequiresPermission(value=android.Manifest.permission.MANAGE_DEVICE_POLICY_FACTORY_RESET, conditional=true) public android.app.admin.FactoryResetProtectionPolicy getFactoryResetProtectionPolicy(@Nullable android.content.ComponentName); method @Nullable public String getGlobalPrivateDnsHost(@NonNull android.content.ComponentName); method public int getGlobalPrivateDnsMode(@NonNull android.content.ComponentName); @@ -7961,7 +8067,7 @@ package android.app.admin { 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 @FlaggedApi("android.app.admin.flags.permission_migration_for_zero_trust_api_enabled") @Nullable @RequiresPermission(value=android.Manifest.permission.MANAGE_DEVICE_POLICY_QUERY_SYSTEM_UPDATES, conditional=true) public android.app.admin.SystemUpdateInfo getPendingSystemUpdate(@Nullable android.content.ComponentName); method @RequiresPermission(value=android.Manifest.permission.MANAGE_DEVICE_POLICY_RUNTIME_PERMISSIONS, conditional=true) public int getPermissionGrantState(@Nullable android.content.ComponentName, @NonNull String, @NonNull String); method public int getPermissionPolicy(android.content.ComponentName); method @Nullable public java.util.List getPermittedAccessibilityServices(@NonNull android.content.ComponentName); @@ -7978,6 +8084,7 @@ package android.app.admin { method public CharSequence getStartUserSessionMessage(@NonNull android.content.ComponentName); method @Deprecated public boolean getStorageEncryption(@Nullable android.content.ComponentName); method public int getStorageEncryptionStatus(); + method @FlaggedApi("android.app.admin.flags.esim_management_enabled") @NonNull @RequiresPermission(android.Manifest.permission.MANAGE_DEVICE_POLICY_MANAGED_SUBSCRIPTIONS) public java.util.Set getSubscriptionsIds(); method @Nullable public android.app.admin.SystemUpdatePolicy getSystemUpdatePolicy(); method @Nullable public android.os.PersistableBundle getTransferOwnershipBundle(); method @Nullable public java.util.List getTrustAgentConfiguration(@Nullable android.content.ComponentName, @NonNull android.content.ComponentName); @@ -8017,6 +8124,7 @@ package android.app.admin { method public boolean isLogoutEnabled(); method public boolean isManagedProfile(@NonNull android.content.ComponentName); method public boolean isMasterVolumeMuted(@NonNull android.content.ComponentName); + method @FlaggedApi("android.app.admin.flags.is_mte_policy_enforced") public static boolean isMtePolicyEnforced(); method public boolean isNetworkLoggingEnabled(@Nullable android.content.ComponentName); method public boolean isOrganizationOwnedDeviceWithManagedProfile(); method public boolean isOverrideApnEnabled(@NonNull android.content.ComponentName); @@ -8033,8 +8141,8 @@ package android.app.admin { method public boolean isUsbDataSignalingEnabled(); method public boolean isUsingUnifiedPassword(@NonNull android.content.ComponentName); method @NonNull public java.util.List listForegroundAffiliatedUsers(); - method @RequiresPermission(value=android.Manifest.permission.MANAGE_DEVICE_POLICY_LOCK, conditional=true) public void lockNow(); - method @RequiresPermission(value=android.Manifest.permission.MANAGE_DEVICE_POLICY_LOCK, conditional=true) public void lockNow(int); + method @RequiresPermission(value="android.permission.LOCK_DEVICE", conditional=true) public void lockNow(); + method @RequiresPermission(value="android.permission.LOCK_DEVICE", conditional=true) public void lockNow(int); method public int logoutUser(@NonNull android.content.ComponentName); method public void reboot(@NonNull android.content.ComponentName); method public void removeActiveAdmin(@NonNull android.content.ComponentName); @@ -8066,6 +8174,7 @@ package android.app.admin { method @Deprecated public void setCertInstallerPackage(@NonNull android.content.ComponentName, @Nullable String) throws java.lang.SecurityException; method @RequiresPermission(value=android.Manifest.permission.MANAGE_DEVICE_POLICY_COMMON_CRITERIA_MODE, conditional=true) public void setCommonCriteriaModeEnabled(@Nullable android.content.ComponentName, boolean); method @RequiresPermission(value=android.Manifest.permission.MANAGE_DEVICE_POLICY_WIFI, conditional=true) public void setConfiguredNetworksLockdownState(@Nullable android.content.ComponentName, boolean); + method @FlaggedApi("android.view.contentprotection.flags.manage_device_policy_enabled") @RequiresPermission(value=android.Manifest.permission.MANAGE_DEVICE_POLICY_CONTENT_PROTECTION, conditional=true) public void setContentProtectionPolicy(@Nullable android.content.ComponentName, int); method public void setCredentialManagerPolicy(@Nullable android.app.admin.PackagePolicy); method @Deprecated public void setCrossProfileCalendarPackages(@NonNull android.content.ComponentName, @Nullable java.util.Set); method @Deprecated public void setCrossProfileCallerIdDisabled(@NonNull android.content.ComponentName, boolean); @@ -8177,6 +8286,9 @@ package android.app.admin { field public static final String ACTION_SET_NEW_PASSWORD = "android.app.action.SET_NEW_PASSWORD"; field public static final String ACTION_START_ENCRYPTION = "android.app.action.START_ENCRYPTION"; field public static final String ACTION_SYSTEM_UPDATE_POLICY_CHANGED = "android.app.action.SYSTEM_UPDATE_POLICY_CHANGED"; + field @FlaggedApi("android.view.contentprotection.flags.manage_device_policy_enabled") public static final int CONTENT_PROTECTION_DISABLED = 1; // 0x1 + field @FlaggedApi("android.view.contentprotection.flags.manage_device_policy_enabled") public static final int CONTENT_PROTECTION_ENABLED = 2; // 0x2 + field @FlaggedApi("android.view.contentprotection.flags.manage_device_policy_enabled") public static final int CONTENT_PROTECTION_NOT_CONTROLLED_BY_POLICY = 0; // 0x0 field public static final String DELEGATION_APP_RESTRICTIONS = "delegation-app-restrictions"; field public static final String DELEGATION_BLOCK_UNINSTALL = "delegation-block-uninstall"; field public static final String DELEGATION_CERT_INSTALL = "delegation-cert-install"; @@ -8488,6 +8600,7 @@ package android.app.admin { field public static final int TAG_ADB_SHELL_CMD = 210002; // 0x33452 field public static final int TAG_ADB_SHELL_INTERACTIVE = 210001; // 0x33451 field public static final int TAG_APP_PROCESS_START = 210005; // 0x33455 + field @FlaggedApi("android.app.admin.flags.backup_service_security_log_event_enabled") public static final int TAG_BACKUP_SERVICE_TOGGLED = 210044; // 0x3347c field public static final int TAG_BLUETOOTH_CONNECTION = 210039; // 0x33477 field public static final int TAG_BLUETOOTH_DISCONNECTION = 210040; // 0x33478 field public static final int TAG_CAMERA_POLICY_SET = 210034; // 0x33472 @@ -9315,10 +9428,17 @@ package android.app.usage { public final class StorageStats implements android.os.Parcelable { method public int describeContents(); method public long getAppBytes(); + method @FlaggedApi("android.app.usage.get_app_bytes_by_data_type_api") public long getAppBytesByDataType(int); method public long getCacheBytes(); method public long getDataBytes(); method public long getExternalCacheBytes(); method public void writeToParcel(android.os.Parcel, int); + field @FlaggedApi("android.app.usage.get_app_bytes_by_data_type_api") public static final int APP_DATA_TYPE_FILE_TYPE_APK = 3; // 0x3 + field @FlaggedApi("android.app.usage.get_app_bytes_by_data_type_api") public static final int APP_DATA_TYPE_FILE_TYPE_CURRENT_PROFILE = 2; // 0x2 + field @FlaggedApi("android.app.usage.get_app_bytes_by_data_type_api") public static final int APP_DATA_TYPE_FILE_TYPE_DEXOPT_ARTIFACT = 0; // 0x0 + field @FlaggedApi("android.app.usage.get_app_bytes_by_data_type_api") public static final int APP_DATA_TYPE_FILE_TYPE_DM = 4; // 0x4 + field @FlaggedApi("android.app.usage.get_app_bytes_by_data_type_api") public static final int APP_DATA_TYPE_FILE_TYPE_REFERENCE_PROFILE = 1; // 0x1 + field @FlaggedApi("android.app.usage.get_app_bytes_by_data_type_api") public static final int APP_DATA_TYPE_LIB = 5; // 0x5 field @NonNull public static final android.os.Parcelable.Creator CREATOR; } @@ -9373,15 +9493,17 @@ package android.app.usage { method public int describeContents(); method public long getBeginTimeMillis(); method public long getEndTimeMillis(); - method @NonNull public java.util.Set getEventTypes(); + method @NonNull public int[] getEventTypes(); + method @NonNull public java.util.Set getPackageNames(); method public void writeToParcel(@NonNull android.os.Parcel, int); field @NonNull public static final android.os.Parcelable.Creator CREATOR; } public static final class UsageEventsQuery.Builder { ctor public UsageEventsQuery.Builder(long, long); - method @NonNull public android.app.usage.UsageEventsQuery.Builder addEventTypes(@NonNull int...); method @NonNull public android.app.usage.UsageEventsQuery build(); + method @NonNull public android.app.usage.UsageEventsQuery.Builder setEventTypes(@NonNull int...); + method @NonNull public android.app.usage.UsageEventsQuery.Builder setPackageNames(@NonNull java.lang.String...); } public final class UsageStats implements android.os.Parcelable { @@ -9408,7 +9530,7 @@ package android.app.usage { method public java.util.List queryConfigurations(int, long, long); method public java.util.List queryEventStats(int, long, long); method public android.app.usage.UsageEvents queryEvents(long, long); - method @FlaggedApi("android.app.usage.filter_based_event_query_api") @NonNull @RequiresPermission(android.Manifest.permission.PACKAGE_USAGE_STATS) public android.app.usage.UsageEvents queryEvents(@NonNull android.app.usage.UsageEventsQuery); + method @FlaggedApi("android.app.usage.filter_based_event_query_api") @Nullable @RequiresPermission(android.Manifest.permission.PACKAGE_USAGE_STATS) public android.app.usage.UsageEvents queryEvents(@NonNull android.app.usage.UsageEventsQuery); method public android.app.usage.UsageEvents queryEventsForSelf(long, long); method public java.util.List queryUsageStats(int, long, long); field @FlaggedApi("android.app.usage.user_interaction_type_api") public static final String EXTRA_EVENT_ACTION = "android.app.usage.extra.EVENT_ACTION"; @@ -9478,12 +9600,15 @@ package android.appwidget { method @NonNull public java.util.List getInstalledProvidersForPackage(@NonNull String, @Nullable android.os.UserHandle); method @NonNull public java.util.List getInstalledProvidersForProfile(@Nullable android.os.UserHandle); method public static android.appwidget.AppWidgetManager getInstance(android.content.Context); + method @FlaggedApi("android.appwidget.flags.generated_previews") @Nullable public android.widget.RemoteViews getWidgetPreview(@NonNull android.content.ComponentName, @Nullable android.os.UserHandle, int); method public boolean isRequestPinAppWidgetSupported(); - method @Deprecated public void notifyAppWidgetViewDataChanged(int[], int); - method @Deprecated public void notifyAppWidgetViewDataChanged(int, int); + method public void notifyAppWidgetViewDataChanged(int[], int); + method public void notifyAppWidgetViewDataChanged(int, int); method public void partiallyUpdateAppWidget(int[], android.widget.RemoteViews); method public void partiallyUpdateAppWidget(int, android.widget.RemoteViews); + method @FlaggedApi("android.appwidget.flags.generated_previews") public void removeWidgetPreview(@NonNull android.content.ComponentName, int); method public boolean requestPinAppWidget(@NonNull android.content.ComponentName, @Nullable android.os.Bundle, @Nullable android.app.PendingIntent); + method @FlaggedApi("android.appwidget.flags.generated_previews") public void setWidgetPreview(@NonNull android.content.ComponentName, int, @NonNull android.widget.RemoteViews); method public void updateAppWidget(int[], android.widget.RemoteViews); method public void updateAppWidget(int, android.widget.RemoteViews); method public void updateAppWidget(android.content.ComponentName, android.widget.RemoteViews); @@ -9557,6 +9682,7 @@ package android.appwidget { field public int autoAdvanceViewId; field public android.content.ComponentName configure; field @IdRes public int descriptionRes; + field @FlaggedApi("android.appwidget.flags.generated_previews") public int generatedPreviewCategories; field public int icon; field public int initialKeyguardLayout; field public int initialLayout; @@ -9683,8 +9809,10 @@ package android.companion { method public void requestNotificationAccess(android.content.ComponentName); method @FlaggedApi("android.companion.association_tag") public void setAssociationTag(int, @NonNull String); method @RequiresPermission(android.Manifest.permission.REQUEST_OBSERVE_COMPANION_DEVICE_PRESENCE) public void startObservingDevicePresence(@NonNull String) throws android.companion.DeviceNotAssociatedException; + method @FlaggedApi("android.companion.device_presence") @RequiresPermission(android.Manifest.permission.REQUEST_OBSERVE_COMPANION_DEVICE_PRESENCE) public void startObservingDevicePresence(@NonNull android.companion.ObservingDevicePresenceRequest); method public void startSystemDataTransfer(int, @NonNull java.util.concurrent.Executor, @NonNull android.os.OutcomeReceiver) throws android.companion.DeviceNotAssociatedException; method @RequiresPermission(android.Manifest.permission.REQUEST_OBSERVE_COMPANION_DEVICE_PRESENCE) public void stopObservingDevicePresence(@NonNull String) throws android.companion.DeviceNotAssociatedException; + method @FlaggedApi("android.companion.device_presence") @RequiresPermission(android.Manifest.permission.REQUEST_OBSERVE_COMPANION_DEVICE_PRESENCE) public void stopObservingDevicePresence(@NonNull android.companion.ObservingDevicePresenceRequest); field public static final String EXTRA_ASSOCIATION = "android.companion.extra.ASSOCIATION"; field @Deprecated public static final String EXTRA_DEVICE = "android.companion.extra.DEVICE"; field public static final int FLAG_CALL_METADATA = 1; // 0x1 @@ -9712,13 +9840,7 @@ package android.companion { method @MainThread public void onDeviceAppeared(@NonNull android.companion.AssociationInfo); method @Deprecated @MainThread public void onDeviceDisappeared(@NonNull String); method @MainThread public void onDeviceDisappeared(@NonNull android.companion.AssociationInfo); - method @FlaggedApi("android.companion.device_presence") @MainThread public void onDeviceEvent(@NonNull android.companion.AssociationInfo, int); - field @FlaggedApi("android.companion.device_presence") public static final int DEVICE_EVENT_BLE_APPEARED = 0; // 0x0 - field @FlaggedApi("android.companion.device_presence") public static final int DEVICE_EVENT_BLE_DISAPPEARED = 1; // 0x1 - field @FlaggedApi("android.companion.device_presence") public static final int DEVICE_EVENT_BT_CONNECTED = 2; // 0x2 - field @FlaggedApi("android.companion.device_presence") public static final int DEVICE_EVENT_BT_DISCONNECTED = 3; // 0x3 - field @FlaggedApi("android.companion.device_presence") public static final int DEVICE_EVENT_SELF_MANAGED_APPEARED = 4; // 0x4 - field @FlaggedApi("android.companion.device_presence") public static final int DEVICE_EVENT_SELF_MANAGED_DISAPPEARED = 5; // 0x5 + method @FlaggedApi("android.companion.device_presence") @MainThread public void onDevicePresenceEvent(@NonNull android.companion.DevicePresenceEvent); field public static final String SERVICE_INTERFACE = "android.companion.CompanionDeviceService"; } @@ -9731,6 +9853,38 @@ package android.companion { public class DeviceNotAssociatedException extends java.lang.RuntimeException { } + @FlaggedApi("android.companion.device_presence") public final class DevicePresenceEvent implements android.os.Parcelable { + ctor public DevicePresenceEvent(int, int, @Nullable android.os.ParcelUuid); + method public int describeContents(); + method public int getAssociationId(); + method public int getEvent(); + method @Nullable public android.os.ParcelUuid getUuid(); + method public void writeToParcel(@NonNull android.os.Parcel, int); + field @NonNull public static final android.os.Parcelable.Creator CREATOR; + field public static final int EVENT_BLE_APPEARED = 0; // 0x0 + field public static final int EVENT_BLE_DISAPPEARED = 1; // 0x1 + field public static final int EVENT_BT_CONNECTED = 2; // 0x2 + field public static final int EVENT_BT_DISCONNECTED = 3; // 0x3 + field public static final int EVENT_SELF_MANAGED_APPEARED = 4; // 0x4 + field public static final int EVENT_SELF_MANAGED_DISAPPEARED = 5; // 0x5 + field public static final int NO_ASSOCIATION = -1; // 0xffffffff + } + + @FlaggedApi("android.companion.device_presence") public final class ObservingDevicePresenceRequest implements android.os.Parcelable { + method public int describeContents(); + method public int getAssociationId(); + method @Nullable public android.os.ParcelUuid getUuid(); + method public void writeToParcel(@NonNull android.os.Parcel, int); + field @NonNull public static final android.os.Parcelable.Creator CREATOR; + } + + public static final class ObservingDevicePresenceRequest.Builder { + ctor public ObservingDevicePresenceRequest.Builder(); + method @NonNull public android.companion.ObservingDevicePresenceRequest build(); + method @NonNull public android.companion.ObservingDevicePresenceRequest.Builder setAssociationId(int); + method @NonNull @RequiresPermission(android.Manifest.permission.REQUEST_OBSERVE_DEVICE_UUID_PRESENCE) public android.companion.ObservingDevicePresenceRequest.Builder setUuid(@NonNull android.os.ParcelUuid); + } + public final class WifiDeviceFilter implements android.companion.DeviceFilter { method public int describeContents(); method public void writeToParcel(@NonNull android.os.Parcel, int); @@ -9933,11 +10087,22 @@ package android.content { method public CharSequence coerceToText(android.content.Context); method public String getHtmlText(); method public android.content.Intent getIntent(); + method @FlaggedApi("com.android.window.flags.delegate_unhandled_drags") @Nullable public android.content.IntentSender getIntentSender(); method public CharSequence getText(); method @Nullable public android.view.textclassifier.TextLinks getTextLinks(); method public android.net.Uri getUri(); } + @FlaggedApi("com.android.window.flags.delegate_unhandled_drags") public static final class ClipData.Item.Builder { + ctor public ClipData.Item.Builder(); + method @FlaggedApi("com.android.window.flags.delegate_unhandled_drags") @NonNull public android.content.ClipData.Item build(); + method @FlaggedApi("com.android.window.flags.delegate_unhandled_drags") @NonNull public android.content.ClipData.Item.Builder setHtmlText(@Nullable String); + method @FlaggedApi("com.android.window.flags.delegate_unhandled_drags") @NonNull public android.content.ClipData.Item.Builder setIntent(@Nullable android.content.Intent); + method @FlaggedApi("com.android.window.flags.delegate_unhandled_drags") @NonNull public android.content.ClipData.Item.Builder setIntentSender(@Nullable android.content.IntentSender); + method @FlaggedApi("com.android.window.flags.delegate_unhandled_drags") @NonNull public android.content.ClipData.Item.Builder setText(@Nullable CharSequence); + method @FlaggedApi("com.android.window.flags.delegate_unhandled_drags") @NonNull public android.content.ClipData.Item.Builder setUri(@Nullable android.net.Uri); + } + public class ClipDescription implements android.os.Parcelable { ctor public ClipDescription(CharSequence, String[]); ctor public ClipDescription(android.content.ClipDescription); @@ -10375,6 +10540,7 @@ package android.content { method @CheckResult(suggest="#enforceCallingPermission(String,String)") public abstract int checkCallingPermission(@NonNull String); method @CheckResult(suggest="#enforceCallingUriPermission(Uri,int,String)") public abstract int checkCallingUriPermission(android.net.Uri, int); method @NonNull public int[] checkCallingUriPermissions(@NonNull java.util.List, int); + method @FlaggedApi("android.security.content_uri_permission_apis") public int checkContentUriPermissionFull(@NonNull android.net.Uri, int, int, int); method @CheckResult(suggest="#enforcePermission(String,int,int,String)") public abstract int checkPermission(@NonNull String, int, int); method public abstract int checkSelfPermission(@NonNull String); method @CheckResult(suggest="#enforceUriPermission(Uri,int,int,String)") public abstract int checkUriPermission(android.net.Uri, int, int, int); @@ -10533,6 +10699,7 @@ package android.content { field public static final int BIND_INCLUDE_CAPABILITIES = 4096; // 0x1000 field public static final int BIND_NOT_FOREGROUND = 4; // 0x4 field public static final int BIND_NOT_PERCEPTIBLE = 256; // 0x100 + field @FlaggedApi("android.content.flags.enable_bind_package_isolated_process") public static final int BIND_PACKAGE_ISOLATED_PROCESS = 16384; // 0x4000 field public static final int BIND_SHARED_ISOLATED_PROCESS = 8192; // 0x2000 field public static final int BIND_WAIVE_PRIORITY = 32; // 0x20 field public static final String BIOMETRIC_SERVICE = "biometric"; @@ -10547,6 +10714,7 @@ package android.content { field public static final String CONNECTIVITY_DIAGNOSTICS_SERVICE = "connectivity_diagnostics"; field public static final String CONNECTIVITY_SERVICE = "connectivity"; field public static final String CONSUMER_IR_SERVICE = "consumer_ir"; + field @FlaggedApi("android.provider.user_keys") public static final String CONTACT_KEYS_SERVICE = "contact_keys"; field public static final int CONTEXT_IGNORE_SECURITY = 2; // 0x2 field public static final int CONTEXT_INCLUDE_CODE = 1; // 0x1 field public static final int CONTEXT_RESTRICTED = 4; // 0x4 @@ -10599,6 +10767,7 @@ package android.content { field public static final String PERFORMANCE_HINT_SERVICE = "performance_hint"; field public static final String POWER_SERVICE = "power"; field public static final String PRINT_SERVICE = "print"; + field @FlaggedApi("android.os.telemetry_apis_framework_initialization") public static final String PROFILING_SERVICE = "profiling"; field public static final int RECEIVER_EXPORTED = 2; // 0x2 field public static final int RECEIVER_NOT_EXPORTED = 4; // 0x4 field public static final int RECEIVER_VISIBLE_TO_INSTANT_APPS = 1; // 0x1 @@ -10905,6 +11074,7 @@ package android.content { method public boolean hasCategory(String); method public boolean hasExtra(String); method public boolean hasFileDescriptors(); + method @FlaggedApi("android.security.enforce_intent_filter_match") public boolean isMismatchingFilter(); method public static android.content.Intent makeMainActivity(android.content.ComponentName); method public static android.content.Intent makeMainSelectorActivity(String, String); method public static android.content.Intent makeRestartActivityTask(android.content.ComponentName); @@ -11167,6 +11337,7 @@ package android.content { field public static final String CATEGORY_UNIT_TEST = "android.intent.category.UNIT_TEST"; field public static final String CATEGORY_VOICE = "android.intent.category.VOICE"; field public static final String CATEGORY_VR_HOME = "android.intent.category.VR_HOME"; + field @FlaggedApi("android.service.chooser.chooser_album_text") public static final int CHOOSER_CONTENT_TYPE_ALBUM = 1; // 0x1 field @NonNull public static final android.os.Parcelable.Creator CREATOR; field public static final String EXTRA_ALARM_COUNT = "android.intent.extra.ALARM_COUNT"; field public static final String EXTRA_ALLOW_MULTIPLE = "android.intent.extra.ALLOW_MULTIPLE"; @@ -11188,9 +11359,14 @@ package android.content { field public static final String EXTRA_CHANGED_COMPONENT_NAME_LIST = "android.intent.extra.changed_component_name_list"; field public static final String EXTRA_CHANGED_PACKAGE_LIST = "android.intent.extra.changed_package_list"; field public static final String EXTRA_CHANGED_UID_LIST = "android.intent.extra.changed_uid_list"; + field @FlaggedApi("android.service.chooser.chooser_payload_toggling") public static final String EXTRA_CHOOSER_ADDITIONAL_CONTENT_URI = "android.intent.extra.CHOOSER_ADDITIONAL_CONTENT_URI"; + field @FlaggedApi("android.service.chooser.chooser_album_text") public static final String EXTRA_CHOOSER_CONTENT_TYPE_HINT = "android.intent.extra.CHOOSER_CONTENT_TYPE_HINT"; field public static final String EXTRA_CHOOSER_CUSTOM_ACTIONS = "android.intent.extra.CHOOSER_CUSTOM_ACTIONS"; + field @FlaggedApi("android.service.chooser.chooser_payload_toggling") public static final String EXTRA_CHOOSER_FOCUSED_ITEM_POSITION = "android.intent.extra.CHOOSER_FOCUSED_ITEM_POSITION"; field public static final String EXTRA_CHOOSER_MODIFY_SHARE_ACTION = "android.intent.extra.CHOOSER_MODIFY_SHARE_ACTION"; field public static final String EXTRA_CHOOSER_REFINEMENT_INTENT_SENDER = "android.intent.extra.CHOOSER_REFINEMENT_INTENT_SENDER"; + field @FlaggedApi("android.service.chooser.enable_chooser_result") public static final String EXTRA_CHOOSER_RESULT = "android.intent.extra.CHOOSER_RESULT"; + field @FlaggedApi("android.service.chooser.enable_chooser_result") public static final String EXTRA_CHOOSER_RESULT_INTENT_SENDER = "android.intent.extra.CHOOSER_RESULT_INTENT_SENDER"; field public static final String EXTRA_CHOOSER_TARGETS = "android.intent.extra.CHOOSER_TARGETS"; field public static final String EXTRA_CHOSEN_COMPONENT = "android.intent.extra.CHOSEN_COMPONENT"; field public static final String EXTRA_CHOSEN_COMPONENT_INTENT_SENDER = "android.intent.extra.CHOSEN_COMPONENT_INTENT_SENDER"; @@ -11219,6 +11395,7 @@ package android.content { field public static final String EXTRA_LOCALE_LIST = "android.intent.extra.LOCALE_LIST"; field public static final String EXTRA_LOCAL_ONLY = "android.intent.extra.LOCAL_ONLY"; field public static final String EXTRA_LOCUS_ID = "android.intent.extra.LOCUS_ID"; + field @FlaggedApi("android.service.chooser.enable_sharesheet_metadata_extra") public static final String EXTRA_METADATA_TEXT = "android.intent.extra.METADATA_TEXT"; field public static final String EXTRA_MIME_TYPES = "android.intent.extra.MIME_TYPES"; field public static final String EXTRA_NOT_UNKNOWN_SOURCE = "android.intent.extra.NOT_UNKNOWN_SOURCE"; field public static final String EXTRA_ORIGINATING_URI = "android.intent.extra.ORIGINATING_URI"; @@ -11340,10 +11517,12 @@ package android.content { method public final void addDataScheme(String); method public final void addDataSchemeSpecificPart(String, int); method public final void addDataType(String) throws android.content.IntentFilter.MalformedMimeTypeException; + method @FlaggedApi("android.content.pm.relative_reference_intent_filters") public final void addUriRelativeFilterGroup(@NonNull android.content.UriRelativeFilterGroup); method @NonNull public java.util.function.Predicate asPredicate(); method @NonNull public java.util.function.Predicate asPredicateWithTypeResolution(@NonNull android.content.ContentResolver); method public final java.util.Iterator authoritiesIterator(); method public final java.util.Iterator categoriesIterator(); + method @FlaggedApi("android.content.pm.relative_reference_intent_filters") public final void clearUriRelativeFilterGroups(); method public final int countActions(); method public final int countCategories(); method public final int countDataAuthorities(); @@ -11351,6 +11530,7 @@ package android.content { method public final int countDataSchemeSpecificParts(); method public final int countDataSchemes(); method public final int countDataTypes(); + method @FlaggedApi("android.content.pm.relative_reference_intent_filters") public final int countUriRelativeFilterGroups(); method public static android.content.IntentFilter create(String, String); method public final int describeContents(); method public void dump(android.util.Printer, String); @@ -11362,6 +11542,7 @@ package android.content { method public final android.os.PatternMatcher getDataSchemeSpecificPart(int); method public final String getDataType(int); method public final int getPriority(); + method @FlaggedApi("android.content.pm.relative_reference_intent_filters") @NonNull public final android.content.UriRelativeFilterGroup getUriRelativeFilterGroup(int); method public final boolean hasAction(String); method public final boolean hasCategory(String); method public final boolean hasDataAuthority(android.net.Uri); @@ -11783,6 +11964,27 @@ package android.content { field public static final long INVALID_TIME = -9223372036854775808L; // 0x8000000000000000L } + @FlaggedApi("android.content.pm.relative_reference_intent_filters") public final class UriRelativeFilter { + ctor public UriRelativeFilter(int, int, @NonNull String); + method @NonNull public String getFilter(); + method public int getPatternType(); + method public int getUriPart(); + method public boolean matchData(@NonNull android.net.Uri); + field public static final int FRAGMENT = 2; // 0x2 + field public static final int PATH = 0; // 0x0 + field public static final int QUERY = 1; // 0x1 + } + + @FlaggedApi("android.content.pm.relative_reference_intent_filters") public final class UriRelativeFilterGroup { + ctor public UriRelativeFilterGroup(int); + method public void addUriRelativeFilter(@NonNull android.content.UriRelativeFilter); + method public int getAction(); + method @NonNull public java.util.Collection getUriRelativeFilters(); + method public boolean matchData(@NonNull android.net.Uri); + field public static final int ACTION_ALLOW = 0; // 0x0 + field public static final int ACTION_BLOCK = 1; // 0x1 + } + } package android.content.om { @@ -12196,6 +12398,8 @@ package android.content.pm { method @NonNull public android.graphics.drawable.Drawable getProfileSwitchingIconDrawable(@NonNull android.os.UserHandle); method @NonNull public CharSequence getProfileSwitchingLabel(@NonNull android.os.UserHandle); method @NonNull public java.util.List getTargetUserProfiles(); + method @FlaggedApi("android.app.admin.flags.allow_querying_profile_type") public boolean isManagedProfile(@NonNull android.os.UserHandle); + method @FlaggedApi("android.app.admin.flags.allow_querying_profile_type") public boolean isProfile(@NonNull android.os.UserHandle); method @RequiresPermission(anyOf={android.Manifest.permission.INTERACT_ACROSS_PROFILES, "android.permission.INTERACT_ACROSS_USERS"}) public void startActivity(@NonNull android.content.Intent, @NonNull android.os.UserHandle, @Nullable android.app.Activity); method @RequiresPermission(anyOf={android.Manifest.permission.INTERACT_ACROSS_PROFILES, "android.permission.INTERACT_ACROSS_USERS"}) public void startActivity(@NonNull android.content.Intent, @NonNull android.os.UserHandle, @Nullable android.app.Activity, @Nullable android.os.Bundle); method public void startMainActivity(@NonNull android.content.ComponentName, @NonNull android.os.UserHandle); @@ -12286,8 +12490,11 @@ package android.content.pm { public class LauncherApps { method public java.util.List getActivityList(String, android.os.UserHandle); method @NonNull public java.util.List getAllPackageInstallerSessions(); + method @FlaggedApi("android.os.allow_private_profile") @Nullable @RequiresPermission(conditional=true, anyOf={"android.permission.ACCESS_HIDDEN_PROFILES_FULL", android.Manifest.permission.ACCESS_HIDDEN_PROFILES}) public android.content.IntentSender getAppMarketActivityIntent(@Nullable String, @NonNull android.os.UserHandle); method public android.content.pm.ApplicationInfo getApplicationInfo(@NonNull String, int, @NonNull android.os.UserHandle) throws android.content.pm.PackageManager.NameNotFoundException; + method @FlaggedApi("android.os.allow_private_profile") @Nullable @RequiresPermission(conditional=true, anyOf={"android.permission.ACCESS_HIDDEN_PROFILES_FULL", android.Manifest.permission.ACCESS_HIDDEN_PROFILES}) public final android.content.pm.LauncherUserInfo getLauncherUserInfo(@NonNull android.os.UserHandle); method public android.content.pm.LauncherApps.PinItemRequest getPinItemRequest(android.content.Intent); + method @FlaggedApi("android.os.allow_private_profile") @NonNull @RequiresPermission(conditional=true, anyOf={"android.permission.ACCESS_HIDDEN_PROFILES_FULL", android.Manifest.permission.ACCESS_HIDDEN_PROFILES}) public java.util.List getPreInstalledSystemPackages(@NonNull android.os.UserHandle); method public java.util.List getProfiles(); method public android.graphics.drawable.Drawable getShortcutBadgedIconDrawable(android.content.pm.ShortcutInfo, int); method @Nullable public android.content.IntentSender getShortcutConfigActivityIntent(@NonNull android.content.pm.LauncherActivityInfo); @@ -12304,6 +12511,7 @@ package android.content.pm { method public void registerCallback(android.content.pm.LauncherApps.Callback, android.os.Handler); method public void registerPackageInstallerSessionCallback(@NonNull java.util.concurrent.Executor, @NonNull android.content.pm.PackageInstaller.SessionCallback); method public android.content.pm.LauncherActivityInfo resolveActivity(android.content.Intent, android.os.UserHandle); + method @FlaggedApi("android.content.pm.archiving") public void setArchiveCompatibility(@NonNull android.content.pm.LauncherApps.ArchiveCompatibilityParams); method public boolean shouldHideFromSuggestions(@NonNull String, @NonNull android.os.UserHandle); method public void startAppDetailsActivity(android.content.ComponentName, android.os.UserHandle, android.graphics.Rect, android.os.Bundle); method public void startMainActivity(android.content.ComponentName, android.os.UserHandle, android.graphics.Rect, android.os.Bundle); @@ -12317,6 +12525,12 @@ package android.content.pm { field public static final String EXTRA_PIN_ITEM_REQUEST = "android.content.pm.extra.PIN_ITEM_REQUEST"; } + @FlaggedApi("android.content.pm.archiving") public static class LauncherApps.ArchiveCompatibilityParams { + ctor public LauncherApps.ArchiveCompatibilityParams(); + method public void setEnableIconOverlay(boolean); + method public void setEnableUnarchivalConfirmation(boolean); + } + public abstract static class LauncherApps.Callback { ctor public LauncherApps.Callback(); method public abstract void onPackageAdded(String, android.os.UserHandle); @@ -12362,6 +12576,14 @@ package android.content.pm { field public static final int FLAG_MATCH_PINNED_BY_ANY_LAUNCHER = 1024; // 0x400 } + @FlaggedApi("android.os.allow_private_profile") public final class LauncherUserInfo implements android.os.Parcelable { + method @FlaggedApi("android.os.allow_private_profile") public int describeContents(); + method @FlaggedApi("android.os.allow_private_profile") public int getUserSerialNumber(); + method @FlaggedApi("android.os.allow_private_profile") @NonNull public String getUserType(); + method @FlaggedApi("android.os.allow_private_profile") public void writeToParcel(@NonNull android.os.Parcel, int); + field @FlaggedApi("android.os.allow_private_profile") @NonNull public static final android.os.Parcelable.Creator CREATOR; + } + public final class ModuleInfo implements android.os.Parcelable { method public int describeContents(); method @Nullable public CharSequence getName(); @@ -12374,6 +12596,7 @@ package android.content.pm { public class PackageInfo implements android.os.Parcelable { ctor public PackageInfo(); method public int describeContents(); + method @FlaggedApi("android.content.pm.provide_info_of_apk_in_apex") @Nullable public String getApexPackageName(); method @FlaggedApi("android.content.pm.archiving") public long getArchiveTimeMillis(); method public long getLongVersionCode(); method public void setLongVersionCode(long); @@ -12431,8 +12654,9 @@ package android.content.pm { method @NonNull public android.content.pm.PackageInstaller.Session openSession(int) throws java.io.IOException; method public void registerSessionCallback(@NonNull android.content.pm.PackageInstaller.SessionCallback); method public void registerSessionCallback(@NonNull android.content.pm.PackageInstaller.SessionCallback, @NonNull android.os.Handler); + method @FlaggedApi("android.content.pm.archiving") @RequiresPermission(anyOf={android.Manifest.permission.INSTALL_PACKAGES, android.Manifest.permission.REQUEST_INSTALL_PACKAGES}) public void reportUnarchivalState(@NonNull android.content.pm.PackageInstaller.UnarchivalState) throws android.content.pm.PackageManager.NameNotFoundException; method @FlaggedApi("android.content.pm.archiving") @RequiresPermission(anyOf={android.Manifest.permission.INSTALL_PACKAGES, android.Manifest.permission.REQUEST_INSTALL_PACKAGES}) public void reportUnarchivalStatus(int, int, long, @Nullable android.app.PendingIntent) throws android.content.pm.PackageManager.NameNotFoundException; - method @FlaggedApi("android.content.pm.archiving") @RequiresPermission(anyOf={android.Manifest.permission.DELETE_PACKAGES, android.Manifest.permission.REQUEST_DELETE_PACKAGES}) public void requestArchive(@NonNull String, @NonNull android.content.IntentSender, int) throws android.content.pm.PackageManager.NameNotFoundException; + method @FlaggedApi("android.content.pm.archiving") @RequiresPermission(anyOf={android.Manifest.permission.DELETE_PACKAGES, android.Manifest.permission.REQUEST_DELETE_PACKAGES}) public void requestArchive(@NonNull String, @NonNull android.content.IntentSender) throws android.content.pm.PackageManager.NameNotFoundException; method @FlaggedApi("android.content.pm.archiving") @RequiresPermission(anyOf={android.Manifest.permission.INSTALL_PACKAGES, android.Manifest.permission.REQUEST_INSTALL_PACKAGES}) public void requestUnarchive(@NonNull String, @NonNull android.content.IntentSender) throws java.io.IOException, android.content.pm.PackageManager.NameNotFoundException; method @RequiresPermission(anyOf={android.Manifest.permission.DELETE_PACKAGES, android.Manifest.permission.REQUEST_DELETE_PACKAGES}) public void uninstall(@NonNull String, @NonNull android.content.IntentSender); method @RequiresPermission(anyOf={android.Manifest.permission.DELETE_PACKAGES, android.Manifest.permission.REQUEST_DELETE_PACKAGES}) public void uninstall(@NonNull android.content.pm.VersionedPackage, @NonNull android.content.IntentSender); @@ -12660,6 +12884,14 @@ package android.content.pm { field public static final int USER_ACTION_UNSPECIFIED = 0; // 0x0 } + @FlaggedApi("android.content.pm.archiving") public static final class PackageInstaller.UnarchivalState { + method @NonNull public static android.content.pm.PackageInstaller.UnarchivalState createGenericErrorState(int); + method @NonNull public static android.content.pm.PackageInstaller.UnarchivalState createInsufficientStorageState(int, long, @Nullable android.app.PendingIntent); + method @NonNull public static android.content.pm.PackageInstaller.UnarchivalState createNoConnectivityState(int); + method @NonNull public static android.content.pm.PackageInstaller.UnarchivalState createOkState(int); + method @NonNull public static android.content.pm.PackageInstaller.UnarchivalState createUserActionRequiredState(int, @NonNull android.app.PendingIntent); + } + public class PackageItemInfo { ctor public PackageItemInfo(); ctor public PackageItemInfo(android.content.pm.PackageItemInfo); @@ -12811,7 +13043,7 @@ package android.content.pm { method public boolean isPackageSuspended(); method @CheckResult public abstract boolean isPermissionRevokedByPolicy(@NonNull String, @NonNull String); method public abstract boolean isSafeMode(); - method @FlaggedApi("android.content.pm.get_package_info") @WorkerThread public T parseAndroidManifest(@NonNull String, @NonNull java.util.function.Function) throws java.io.IOException; + method @FlaggedApi("android.content.pm.get_package_info") @WorkerThread public T parseAndroidManifest(@NonNull java.io.File, @NonNull java.util.function.Function) throws java.io.IOException; method @NonNull public java.util.List queryActivityProperty(@NonNull String); method @NonNull public java.util.List queryApplicationProperty(@NonNull String); method @NonNull public abstract java.util.List queryBroadcastReceivers(@NonNull android.content.Intent, int); @@ -12859,7 +13091,6 @@ package android.content.pm { field public static final int COMPONENT_ENABLED_STATE_DISABLED_USER = 3; // 0x3 field public static final int COMPONENT_ENABLED_STATE_ENABLED = 1; // 0x1 field @FlaggedApi("android.content.pm.archiving") public static final int DELETE_ARCHIVE = 16; // 0x10 - field @FlaggedApi("android.content.pm.archiving") public static final int DELETE_SHOW_DIALOG = 32; // 0x20 field public static final int DONT_KILL_APP = 1; // 0x1 field public static final String EXTRA_VERIFICATION_ID = "android.content.pm.extra.VERIFICATION_ID"; field public static final String EXTRA_VERIFICATION_RESULT = "android.content.pm.extra.VERIFICATION_RESULT"; @@ -12868,6 +13099,7 @@ package android.content.pm { field public static final String FEATURE_AUDIO_LOW_LATENCY = "android.hardware.audio.low_latency"; field public static final String FEATURE_AUDIO_OUTPUT = "android.hardware.audio.output"; field public static final String FEATURE_AUDIO_PRO = "android.hardware.audio.pro"; + field @FlaggedApi("android.media.audio.feature_spatial_audio_headtracking_low_latency") public static final String FEATURE_AUDIO_SPATIAL_HEADTRACKING_LOW_LATENCY = "android.hardware.audio.spatial.headtracking.low_latency"; field public static final String FEATURE_AUTOFILL = "android.software.autofill"; field public static final String FEATURE_AUTOMOTIVE = "android.hardware.type.automotive"; field public static final String FEATURE_BACKUP = "android.software.backup"; @@ -12887,7 +13119,6 @@ package android.content.pm { field public static final String FEATURE_CAMERA_LEVEL_FULL = "android.hardware.camera.level.full"; field public static final String FEATURE_CANT_SAVE_STATE = "android.software.cant_save_state"; field public static final String FEATURE_COMPANION_DEVICE_SETUP = "android.software.companion_device_setup"; - field @FlaggedApi("android.view.inputmethod.concurrent_input_methods") public static final String FEATURE_CONCURRENT_INPUT_METHODS = "android.software.concurrent_input_methods"; field @Deprecated public static final String FEATURE_CONNECTION_SERVICE = "android.software.connectionservice"; field public static final String FEATURE_CONSUMER_IR = "android.hardware.consumerir"; field public static final String FEATURE_CONTROLS = "android.software.controls"; @@ -12928,6 +13159,7 @@ package android.content.pm { field public static final String FEATURE_MIDI = "android.software.midi"; field public static final String FEATURE_NFC = "android.hardware.nfc"; field public static final String FEATURE_NFC_BEAM = "android.sofware.nfc.beam"; + field @FlaggedApi("android.nfc.enable_nfc_charging") public static final String FEATURE_NFC_CHARGING = "android.hardware.nfc.charging"; field public static final String FEATURE_NFC_HOST_CARD_EMULATION = "android.hardware.nfc.hce"; 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"; @@ -13280,6 +13512,7 @@ package android.content.pm { field @RequiresPermission(allOf={android.Manifest.permission.FOREGROUND_SERVICE_LOCATION}, anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}, conditional=true) public static final int FOREGROUND_SERVICE_TYPE_LOCATION = 8; // 0x8 field public static final int FOREGROUND_SERVICE_TYPE_MANIFEST = -1; // 0xffffffff field @RequiresPermission(value=android.Manifest.permission.FOREGROUND_SERVICE_MEDIA_PLAYBACK, conditional=true) public static final int FOREGROUND_SERVICE_TYPE_MEDIA_PLAYBACK = 2; // 0x2 + field @FlaggedApi("android.content.pm.introduce_media_processing_type") @RequiresPermission(android.Manifest.permission.FOREGROUND_SERVICE_MEDIA_PROCESSING) public static final int FOREGROUND_SERVICE_TYPE_MEDIA_PROCESSING = 8192; // 0x2000 field @RequiresPermission(value=android.Manifest.permission.FOREGROUND_SERVICE_MEDIA_PROJECTION, conditional=true) public static final int FOREGROUND_SERVICE_TYPE_MEDIA_PROJECTION = 32; // 0x20 field @RequiresPermission(allOf={android.Manifest.permission.FOREGROUND_SERVICE_MICROPHONE}, anyOf={android.Manifest.permission.CAPTURE_AUDIO_OUTPUT, android.Manifest.permission.RECORD_AUDIO}, conditional=true) public static final int FOREGROUND_SERVICE_TYPE_MICROPHONE = 128; // 0x80 field @Deprecated public static final int FOREGROUND_SERVICE_TYPE_NONE = 0; // 0x0 @@ -13418,12 +13651,12 @@ package android.content.pm { public final class SigningInfo implements android.os.Parcelable { ctor public SigningInfo(); - ctor @FlaggedApi("android.content.pm.archiving") public SigningInfo(@IntRange(from=0) int, @Nullable java.util.Collection, @Nullable java.util.Collection, @Nullable java.util.Collection); + ctor @FlaggedApi("android.content.pm.archiving") public SigningInfo(int, @Nullable java.util.Collection, @Nullable java.util.Collection, @Nullable java.util.Collection); ctor public SigningInfo(android.content.pm.SigningInfo); method public int describeContents(); method public android.content.pm.Signature[] getApkContentsSigners(); method @FlaggedApi("android.content.pm.archiving") @NonNull public java.util.Collection getPublicKeys(); - method @FlaggedApi("android.content.pm.archiving") @IntRange(from=0) public int getSchemeVersion(); + method @FlaggedApi("android.content.pm.archiving") public int getSchemeVersion(); method public android.content.pm.Signature[] getSigningCertificateHistory(); method public boolean hasMultipleSigners(); method public boolean hasPastSigningCertificates(); @@ -13657,6 +13890,13 @@ package android.content.res { field public int uiMode; } + @FlaggedApi("android.content.res.font_scale_converter_public") public interface FontScaleConverter { + method public float convertDpToSp(float); + method public float convertSpToDp(float); + method @AnyThread @Nullable public static android.content.res.FontScaleConverter forScale(float); + method @AnyThread public static boolean isNonLinearFontScalingActive(float); + } + public class ObbInfo implements android.os.Parcelable { method public int describeContents(); method public void writeToParcel(android.os.Parcel, int); @@ -13728,6 +13968,7 @@ package android.content.res { method public android.content.res.AssetFileDescriptor openRawResourceFd(@RawRes int) throws android.content.res.Resources.NotFoundException; method public void parseBundleExtra(String, android.util.AttributeSet, android.os.Bundle) throws org.xmlpull.v1.XmlPullParserException; method public void parseBundleExtras(android.content.res.XmlResourceParser, android.os.Bundle) throws java.io.IOException, org.xmlpull.v1.XmlPullParserException; + method @FlaggedApi("android.content.res.register_resource_paths") public static void registerResourcePaths(@NonNull String, @NonNull android.content.pm.ApplicationInfo); method public void removeLoaders(@NonNull android.content.res.loader.ResourcesLoader...); method @Deprecated public void updateConfiguration(android.content.res.Configuration, android.util.DisplayMetrics); field @AnyRes public static final int ID_NULL = 0; // 0x0 @@ -15455,6 +15696,7 @@ package android.graphics { method public boolean clipOutRect(@NonNull android.graphics.Rect); method public boolean clipOutRect(float, float, float, float); method public boolean clipOutRect(int, int, int, int); + method @FlaggedApi("com.android.graphics.hwui.flags.clip_shader") public void clipOutShader(@NonNull android.graphics.Shader); method @Deprecated public boolean clipPath(@NonNull android.graphics.Path, @NonNull android.graphics.Region.Op); method public boolean clipPath(@NonNull android.graphics.Path); method @Deprecated public boolean clipRect(@NonNull android.graphics.RectF, @NonNull android.graphics.Region.Op); @@ -15464,7 +15706,9 @@ package android.graphics { method @Deprecated public boolean clipRect(float, float, float, float, @NonNull android.graphics.Region.Op); method public boolean clipRect(float, float, float, float); method public boolean clipRect(int, int, int, int); + method @FlaggedApi("com.android.graphics.hwui.flags.clip_shader") public void clipShader(@NonNull android.graphics.Shader); method public void concat(@Nullable android.graphics.Matrix); + method @FlaggedApi("com.android.graphics.hwui.flags.matrix_44") public void concat44(@Nullable android.graphics.Matrix44); method public void disableZ(); method public void drawARGB(int, int, int, int); method public void drawArc(@NonNull android.graphics.RectF, float, float, boolean, @NonNull android.graphics.Paint); @@ -16113,6 +16357,24 @@ package android.graphics { enum_constant public static final android.graphics.Matrix.ScaleToFit START; } + @FlaggedApi("com.android.graphics.hwui.flags.matrix_44") public class Matrix44 { + ctor @FlaggedApi("com.android.graphics.hwui.flags.matrix_44") public Matrix44(); + ctor @FlaggedApi("com.android.graphics.hwui.flags.matrix_44") public Matrix44(@NonNull android.graphics.Matrix); + method @FlaggedApi("com.android.graphics.hwui.flags.matrix_44") @NonNull public android.graphics.Matrix44 concat(@NonNull android.graphics.Matrix44); + method @FlaggedApi("com.android.graphics.hwui.flags.matrix_44") public float get(int, int); + method @FlaggedApi("com.android.graphics.hwui.flags.matrix_44") public void getValues(@NonNull float[]); + method @FlaggedApi("com.android.graphics.hwui.flags.matrix_44") public boolean invert(); + method @FlaggedApi("com.android.graphics.hwui.flags.matrix_44") public boolean isIdentity(); + method @FlaggedApi("com.android.graphics.hwui.flags.matrix_44") @NonNull public float[] map(float, float, float, float); + method @FlaggedApi("com.android.graphics.hwui.flags.matrix_44") public void map(float, float, float, float, @NonNull float[]); + method @FlaggedApi("com.android.graphics.hwui.flags.matrix_44") public void reset(); + method @FlaggedApi("com.android.graphics.hwui.flags.matrix_44") @NonNull public android.graphics.Matrix44 rotate(float, float, float, float); + method @FlaggedApi("com.android.graphics.hwui.flags.matrix_44") @NonNull public android.graphics.Matrix44 scale(float, float, float); + method @FlaggedApi("com.android.graphics.hwui.flags.matrix_44") public void set(int, int, float); + method @FlaggedApi("com.android.graphics.hwui.flags.matrix_44") public void setValues(@NonNull float[]); + method @FlaggedApi("com.android.graphics.hwui.flags.matrix_44") @NonNull public android.graphics.Matrix44 translate(float, float, float); + } + public class Mesh { ctor public Mesh(@NonNull android.graphics.MeshSpecification, int, @NonNull java.nio.Buffer, int, @NonNull android.graphics.RectF); ctor public Mesh(@NonNull android.graphics.MeshSpecification, int, @NonNull java.nio.Buffer, int, @NonNull java.nio.ShortBuffer, @NonNull android.graphics.RectF); @@ -16374,6 +16636,8 @@ package android.graphics { field public static final int START_HYPHEN_EDIT_NO_EDIT = 0; // 0x0 field public static final int STRIKE_THRU_TEXT_FLAG = 16; // 0x10 field public static final int SUBPIXEL_TEXT_FLAG = 128; // 0x80 + field @FlaggedApi("com.android.text.flags.letter_spacing_justification") public static final int TEXT_RUN_FLAG_LEFT_EDGE = 8192; // 0x2000 + field @FlaggedApi("com.android.text.flags.letter_spacing_justification") public static final int TEXT_RUN_FLAG_RIGHT_EDGE = 16384; // 0x4000 field public static final int UNDERLINE_TEXT_FLAG = 8; // 0x8 } @@ -17850,6 +18114,7 @@ package android.graphics.text { field public static final int HYPHENATION_FREQUENCY_FULL = 2; // 0x2 field public static final int HYPHENATION_FREQUENCY_NONE = 0; // 0x0 field public static final int HYPHENATION_FREQUENCY_NORMAL = 1; // 0x1 + field @FlaggedApi("com.android.text.flags.letter_spacing_justification") public static final int JUSTIFICATION_MODE_INTER_CHARACTER = 2; // 0x2 field public static final int JUSTIFICATION_MODE_INTER_WORD = 1; // 0x1 field public static final int JUSTIFICATION_MODE_NONE = 0; // 0x0 } @@ -18303,8 +18568,8 @@ package android.hardware { field public static final int RGBX_8888 = 2; // 0x2 field public static final int RGB_565 = 4; // 0x4 field public static final int RGB_888 = 3; // 0x3 - field @FlaggedApi("com.android.graphics.hwui.flags.requested_formats_v") public static final int RG_1616_UINT = 58; // 0x3a - field @FlaggedApi("com.android.graphics.hwui.flags.requested_formats_v") public static final int R_16_UINT = 57; // 0x39 + field @FlaggedApi("com.android.graphics.hwui.flags.requested_formats_v") public static final int RG_1616 = 58; // 0x3a + field @FlaggedApi("com.android.graphics.hwui.flags.requested_formats_v") public static final int R_16 = 57; // 0x39 field @FlaggedApi("com.android.graphics.hwui.flags.requested_formats_v") public static final int R_8 = 56; // 0x38 field public static final int S_UI8 = 53; // 0x35 field public static final long USAGE_COMPOSER_OVERLAY = 2048L; // 0x800L @@ -18327,6 +18592,7 @@ package android.hardware { @FlaggedApi("android.hardware.flags.overlayproperties_class_api") public final class OverlayProperties implements android.os.Parcelable { method @FlaggedApi("android.hardware.flags.overlayproperties_class_api") public int describeContents(); + method @FlaggedApi("android.hardware.flags.overlayproperties_class_api") public boolean isCombinationSupported(int, int); method @FlaggedApi("android.hardware.flags.overlayproperties_class_api") public boolean isMixedColorSpacesSupported(); method @FlaggedApi("android.hardware.flags.overlayproperties_class_api") public void writeToParcel(@NonNull android.os.Parcel, int); field @FlaggedApi("android.hardware.flags.overlayproperties_class_api") @NonNull public static final android.os.Parcelable.Creator CREATOR; @@ -18597,6 +18863,7 @@ package android.hardware { } public final class SyncFence implements java.lang.AutoCloseable android.os.Parcelable { + ctor @FlaggedApi("com.android.window.flags.sdk_desired_present_time") public SyncFence(@NonNull android.hardware.SyncFence); method public boolean await(@NonNull java.time.Duration); method public boolean awaitForever(); method public void close(); @@ -18653,7 +18920,11 @@ package android.hardware.biometrics { method @RequiresPermission(android.Manifest.permission.USE_BIOMETRIC) public void authenticate(@NonNull android.hardware.biometrics.BiometricPrompt.CryptoObject, @NonNull android.os.CancellationSignal, @NonNull java.util.concurrent.Executor, @NonNull android.hardware.biometrics.BiometricPrompt.AuthenticationCallback); method @RequiresPermission(android.Manifest.permission.USE_BIOMETRIC) public void authenticate(@NonNull android.os.CancellationSignal, @NonNull java.util.concurrent.Executor, @NonNull android.hardware.biometrics.BiometricPrompt.AuthenticationCallback); method @Nullable public int getAllowedAuthenticators(); + method @FlaggedApi("android.hardware.biometrics.custom_biometric_prompt") @Nullable public android.hardware.biometrics.PromptContentView getContentView(); method @Nullable public CharSequence getDescription(); + method @FlaggedApi("android.hardware.biometrics.custom_biometric_prompt") @Nullable @RequiresPermission(android.Manifest.permission.SET_BIOMETRIC_DIALOG_LOGO) public android.graphics.Bitmap getLogoBitmap(); + method @FlaggedApi("android.hardware.biometrics.custom_biometric_prompt") @Nullable @RequiresPermission(android.Manifest.permission.SET_BIOMETRIC_DIALOG_LOGO) public String getLogoDescription(); + method @FlaggedApi("android.hardware.biometrics.custom_biometric_prompt") @DrawableRes @RequiresPermission(android.Manifest.permission.SET_BIOMETRIC_DIALOG_LOGO) public int getLogoRes(); method @Nullable public CharSequence getNegativeButtonText(); method @Nullable public CharSequence getSubtitle(); method @NonNull public CharSequence getTitle(); @@ -18700,8 +18971,12 @@ package android.hardware.biometrics { method @NonNull public android.hardware.biometrics.BiometricPrompt build(); method @NonNull public android.hardware.biometrics.BiometricPrompt.Builder setAllowedAuthenticators(int); method @NonNull public android.hardware.biometrics.BiometricPrompt.Builder setConfirmationRequired(boolean); + method @FlaggedApi("android.hardware.biometrics.custom_biometric_prompt") @NonNull public android.hardware.biometrics.BiometricPrompt.Builder setContentView(@NonNull android.hardware.biometrics.PromptContentView); method @NonNull public android.hardware.biometrics.BiometricPrompt.Builder setDescription(@NonNull CharSequence); method @Deprecated @NonNull public android.hardware.biometrics.BiometricPrompt.Builder setDeviceCredentialAllowed(boolean); + method @FlaggedApi("android.hardware.biometrics.custom_biometric_prompt") @NonNull @RequiresPermission(android.Manifest.permission.SET_BIOMETRIC_DIALOG_LOGO) public android.hardware.biometrics.BiometricPrompt.Builder setLogoBitmap(@NonNull android.graphics.Bitmap); + method @FlaggedApi("android.hardware.biometrics.custom_biometric_prompt") @NonNull @RequiresPermission(android.Manifest.permission.SET_BIOMETRIC_DIALOG_LOGO) public android.hardware.biometrics.BiometricPrompt.Builder setLogoDescription(@NonNull String); + method @FlaggedApi("android.hardware.biometrics.custom_biometric_prompt") @NonNull @RequiresPermission(android.Manifest.permission.SET_BIOMETRIC_DIALOG_LOGO) public android.hardware.biometrics.BiometricPrompt.Builder setLogoRes(@DrawableRes int); method @NonNull public android.hardware.biometrics.BiometricPrompt.Builder setNegativeButton(@NonNull CharSequence, @NonNull java.util.concurrent.Executor, @NonNull android.content.DialogInterface.OnClickListener); method @NonNull public android.hardware.biometrics.BiometricPrompt.Builder setSubtitle(@NonNull CharSequence); method @NonNull public android.hardware.biometrics.BiometricPrompt.Builder setTitle(@NonNull CharSequence); @@ -18723,6 +18998,44 @@ package android.hardware.biometrics { method @Nullable public java.security.Signature getSignature(); } + @FlaggedApi("android.hardware.biometrics.custom_biometric_prompt") public interface PromptContentItem { + } + + @FlaggedApi("android.hardware.biometrics.custom_biometric_prompt") public final class PromptContentItemBulletedText implements android.os.Parcelable android.hardware.biometrics.PromptContentItem { + ctor public PromptContentItemBulletedText(@NonNull String); + method public int describeContents(); + method public void writeToParcel(@NonNull android.os.Parcel, int); + field @NonNull public static final android.os.Parcelable.Creator CREATOR; + } + + @FlaggedApi("android.hardware.biometrics.custom_biometric_prompt") public final class PromptContentItemPlainText implements android.os.Parcelable android.hardware.biometrics.PromptContentItem { + ctor public PromptContentItemPlainText(@NonNull String); + method public int describeContents(); + method public void writeToParcel(@NonNull android.os.Parcel, int); + field @NonNull public static final android.os.Parcelable.Creator CREATOR; + } + + @FlaggedApi("android.hardware.biometrics.custom_biometric_prompt") public interface PromptContentView { + } + + @FlaggedApi("android.hardware.biometrics.custom_biometric_prompt") public final class PromptVerticalListContentView implements android.os.Parcelable android.hardware.biometrics.PromptContentView { + method public int describeContents(); + method @Nullable public String getDescription(); + method @NonNull public java.util.List getListItems(); + method public static int getMaxEachItemCharacterNumber(); + method public static int getMaxItemCount(); + method public void writeToParcel(@NonNull android.os.Parcel, int); + field @NonNull public static final android.os.Parcelable.Creator CREATOR; + } + + public static final class PromptVerticalListContentView.Builder { + ctor public PromptVerticalListContentView.Builder(); + method @NonNull public android.hardware.biometrics.PromptVerticalListContentView.Builder addListItem(@NonNull android.hardware.biometrics.PromptContentItem); + method @NonNull public android.hardware.biometrics.PromptVerticalListContentView.Builder addListItem(@NonNull android.hardware.biometrics.PromptContentItem, int); + method @NonNull public android.hardware.biometrics.PromptVerticalListContentView build(); + method @NonNull public android.hardware.biometrics.PromptVerticalListContentView.Builder setDescription(@NonNull String); + } + } package android.hardware.camera2 { @@ -18945,8 +19258,7 @@ package android.hardware.camera2 { method @Deprecated public abstract void createReprocessableCaptureSessionByConfigurations(@NonNull android.hardware.camera2.params.InputConfiguration, @NonNull java.util.List, @NonNull android.hardware.camera2.CameraCaptureSession.StateCallback, @Nullable android.os.Handler) throws android.hardware.camera2.CameraAccessException; method public int getCameraAudioRestriction() throws android.hardware.camera2.CameraAccessException; method @NonNull public abstract String getId(); - method @FlaggedApi("com.android.internal.camera.flags.feature_combination_query") @NonNull public android.hardware.camera2.CameraCharacteristics getSessionCharacteristics(@NonNull android.hardware.camera2.params.SessionConfiguration) throws android.hardware.camera2.CameraAccessException; - method @Deprecated public boolean isSessionConfigurationSupported(@NonNull android.hardware.camera2.params.SessionConfiguration) throws android.hardware.camera2.CameraAccessException; + method public boolean isSessionConfigurationSupported(@NonNull android.hardware.camera2.params.SessionConfiguration) throws android.hardware.camera2.CameraAccessException; method public void setCameraAudioRestriction(int) throws android.hardware.camera2.CameraAccessException; field public static final int AUDIO_RESTRICTION_NONE = 0; // 0x0 field public static final int AUDIO_RESTRICTION_VIBRATION = 1; // 0x1 @@ -18959,6 +19271,14 @@ package android.hardware.camera2 { field public static final int TEMPLATE_ZERO_SHUTTER_LAG = 5; // 0x5 } + @FlaggedApi("com.android.internal.camera.flags.camera_device_setup") public abstract static class CameraDevice.CameraDeviceSetup { + method @FlaggedApi("com.android.internal.camera.flags.camera_device_setup") @NonNull public abstract android.hardware.camera2.CaptureRequest.Builder createCaptureRequest(int) throws android.hardware.camera2.CameraAccessException; + method @FlaggedApi("com.android.internal.camera.flags.camera_device_setup") @NonNull public abstract String getId(); + method @FlaggedApi("com.android.internal.camera.flags.camera_device_setup") @NonNull public abstract android.hardware.camera2.CameraCharacteristics getSessionCharacteristics(@NonNull android.hardware.camera2.params.SessionConfiguration) throws android.hardware.camera2.CameraAccessException; + method @FlaggedApi("com.android.internal.camera.flags.camera_device_setup") public abstract boolean isSessionConfigurationSupported(@NonNull android.hardware.camera2.params.SessionConfiguration) throws android.hardware.camera2.CameraAccessException; + method @FlaggedApi("com.android.internal.camera.flags.camera_device_setup") @RequiresPermission(android.Manifest.permission.CAMERA) public abstract void openCamera(@NonNull java.util.concurrent.Executor, @NonNull android.hardware.camera2.CameraDevice.StateCallback) throws android.hardware.camera2.CameraAccessException; + } + public abstract static class CameraDevice.StateCallback { ctor public CameraDevice.StateCallback(); method public void onClosed(@NonNull android.hardware.camera2.CameraDevice); @@ -18973,15 +19293,18 @@ package android.hardware.camera2 { } public final class CameraExtensionCharacteristics { + method @FlaggedApi("com.android.internal.camera.flags.camera_extensions_characteristics_get") public T get(int, @NonNull android.hardware.camera2.CameraCharacteristics.Key); method @NonNull public java.util.Set getAvailableCaptureRequestKeys(int); method @NonNull public java.util.Set getAvailableCaptureResultKeys(int); method @Nullable public android.util.Range getEstimatedCaptureLatencyRangeMillis(int, @NonNull android.util.Size, int); method @NonNull public java.util.List getExtensionSupportedSizes(int, @NonNull Class); method @NonNull public java.util.List getExtensionSupportedSizes(int, int); + method @FlaggedApi("com.android.internal.camera.flags.camera_extensions_characteristics_get") @NonNull public java.util.Set getKeys(int); method @NonNull public java.util.List getPostviewSupportedSizes(int, @NonNull android.util.Size, int); method @NonNull public java.util.List getSupportedExtensions(); method public boolean isCaptureProcessProgressAvailable(int); method public boolean isPostviewAvailable(int); + field @FlaggedApi("com.android.internal.camera.flags.concert_mode") @NonNull public static final android.hardware.camera2.CameraCharacteristics.Key> EFV_PADDING_ZOOM_FACTOR_RANGE; field public static final int EXTENSION_AUTOMATIC = 0; // 0x0 field @Deprecated public static final int EXTENSION_BEAUTY = 1; // 0x1 field public static final int EXTENSION_BOKEH = 2; // 0x2 @@ -19003,6 +19326,7 @@ package android.hardware.camera2 { public abstract static class CameraExtensionSession.ExtensionCaptureCallback { ctor public CameraExtensionSession.ExtensionCaptureCallback(); method public void onCaptureFailed(@NonNull android.hardware.camera2.CameraExtensionSession, @NonNull android.hardware.camera2.CaptureRequest); + method @FlaggedApi("com.android.internal.camera.flags.concert_mode") public void onCaptureFailed(@NonNull android.hardware.camera2.CameraExtensionSession, @NonNull android.hardware.camera2.CaptureRequest, int); method public void onCaptureProcessProgressed(@NonNull android.hardware.camera2.CameraExtensionSession, @NonNull android.hardware.camera2.CaptureRequest, @IntRange(from=0, to=100) int); method public void onCaptureProcessStarted(@NonNull android.hardware.camera2.CameraExtensionSession, @NonNull android.hardware.camera2.CaptureRequest); method public void onCaptureResultAvailable(@NonNull android.hardware.camera2.CameraExtensionSession, @NonNull android.hardware.camera2.CaptureRequest, @NonNull android.hardware.camera2.TotalCaptureResult); @@ -19025,14 +19349,14 @@ package android.hardware.camera2 { } public final class CameraManager { - method @FlaggedApi("com.android.internal.camera.flags.feature_combination_query") @NonNull @RequiresPermission(android.Manifest.permission.CAMERA) public android.hardware.camera2.CaptureRequest.Builder createCaptureRequest(@NonNull String, int) throws android.hardware.camera2.CameraAccessException; method @NonNull public android.hardware.camera2.CameraCharacteristics getCameraCharacteristics(@NonNull String) throws android.hardware.camera2.CameraAccessException; + method @FlaggedApi("com.android.internal.camera.flags.camera_device_setup") @NonNull public android.hardware.camera2.CameraDevice.CameraDeviceSetup getCameraDeviceSetup(@NonNull String) throws android.hardware.camera2.CameraAccessException; method @NonNull public android.hardware.camera2.CameraExtensionCharacteristics getCameraExtensionCharacteristics(@NonNull String) throws android.hardware.camera2.CameraAccessException; method @NonNull public String[] getCameraIdList() throws android.hardware.camera2.CameraAccessException; method @NonNull public java.util.Set> getConcurrentCameraIds() throws android.hardware.camera2.CameraAccessException; method public int getTorchStrengthLevel(@NonNull String) throws android.hardware.camera2.CameraAccessException; + method @FlaggedApi("com.android.internal.camera.flags.camera_device_setup") public boolean isCameraDeviceSetupSupported(@NonNull String) throws android.hardware.camera2.CameraAccessException; method @RequiresPermission(android.Manifest.permission.CAMERA) public boolean isConcurrentSessionConfigurationSupported(@NonNull java.util.Map) throws android.hardware.camera2.CameraAccessException; - method @FlaggedApi("com.android.internal.camera.flags.feature_combination_query") @RequiresPermission(android.Manifest.permission.CAMERA) public boolean isSessionConfigurationWithParametersSupported(@NonNull String, @NonNull android.hardware.camera2.params.SessionConfiguration) throws android.hardware.camera2.CameraAccessException; method @RequiresPermission(android.Manifest.permission.CAMERA) public void openCamera(@NonNull String, @NonNull android.hardware.camera2.CameraDevice.StateCallback, @Nullable android.os.Handler) throws android.hardware.camera2.CameraAccessException; method @RequiresPermission(android.Manifest.permission.CAMERA) public void openCamera(@NonNull String, @NonNull java.util.concurrent.Executor, @NonNull android.hardware.camera2.CameraDevice.StateCallback) throws android.hardware.camera2.CameraAccessException; method public void registerAvailabilityCallback(@NonNull android.hardware.camera2.CameraManager.AvailabilityCallback, @Nullable android.os.Handler); @@ -19583,6 +19907,32 @@ package android.hardware.camera2 { field public static final int MAX_THUMBNAIL_DIMENSION = 256; // 0x100 } + @FlaggedApi("com.android.internal.camera.flags.concert_mode") public final class ExtensionCaptureRequest { + ctor public ExtensionCaptureRequest(); + field @FlaggedApi("com.android.internal.camera.flags.concert_mode") @NonNull public static final android.hardware.camera2.CaptureRequest.Key EFV_AUTO_ZOOM; + field @FlaggedApi("com.android.internal.camera.flags.concert_mode") @NonNull public static final android.hardware.camera2.CaptureRequest.Key EFV_MAX_PADDING_ZOOM_FACTOR; + field @FlaggedApi("com.android.internal.camera.flags.concert_mode") @NonNull public static final android.hardware.camera2.CaptureRequest.Key EFV_PADDING_ZOOM_FACTOR; + field @FlaggedApi("com.android.internal.camera.flags.concert_mode") @NonNull public static final android.hardware.camera2.CaptureRequest.Key EFV_ROTATE_VIEWPORT; + field @FlaggedApi("com.android.internal.camera.flags.concert_mode") @NonNull public static final android.hardware.camera2.CaptureRequest.Key EFV_STABILIZATION_MODE; + field @FlaggedApi("com.android.internal.camera.flags.concert_mode") public static final int EFV_STABILIZATION_MODE_GIMBAL = 1; // 0x1 + field @FlaggedApi("com.android.internal.camera.flags.concert_mode") public static final int EFV_STABILIZATION_MODE_LOCKED = 2; // 0x2 + field @FlaggedApi("com.android.internal.camera.flags.concert_mode") public static final int EFV_STABILIZATION_MODE_OFF = 0; // 0x0 + field @FlaggedApi("com.android.internal.camera.flags.concert_mode") @NonNull public static final android.hardware.camera2.CaptureRequest.Key> EFV_TRANSLATE_VIEWPORT; + } + + @FlaggedApi("com.android.internal.camera.flags.concert_mode") public final class ExtensionCaptureResult { + ctor public ExtensionCaptureResult(); + field @FlaggedApi("com.android.internal.camera.flags.concert_mode") @NonNull public static final android.hardware.camera2.CaptureResult.Key EFV_AUTO_ZOOM; + field @FlaggedApi("com.android.internal.camera.flags.concert_mode") @NonNull public static final android.hardware.camera2.CaptureResult.Key EFV_AUTO_ZOOM_PADDING_REGION; + field @FlaggedApi("com.android.internal.camera.flags.concert_mode") @NonNull public static final android.hardware.camera2.CaptureResult.Key EFV_MAX_PADDING_ZOOM_FACTOR; + field @FlaggedApi("com.android.internal.camera.flags.concert_mode") @NonNull public static final android.hardware.camera2.CaptureResult.Key EFV_PADDING_REGION; + field @FlaggedApi("com.android.internal.camera.flags.concert_mode") @NonNull public static final android.hardware.camera2.CaptureResult.Key EFV_PADDING_ZOOM_FACTOR; + field @FlaggedApi("com.android.internal.camera.flags.concert_mode") @NonNull public static final android.hardware.camera2.CaptureResult.Key EFV_ROTATE_VIEWPORT; + field @FlaggedApi("com.android.internal.camera.flags.concert_mode") @NonNull public static final android.hardware.camera2.CaptureResult.Key EFV_STABILIZATION_MODE; + field @FlaggedApi("com.android.internal.camera.flags.concert_mode") @NonNull public static final android.hardware.camera2.CaptureResult.Key EFV_TARGET_COORDINATES; + field @FlaggedApi("com.android.internal.camera.flags.concert_mode") @NonNull public static final android.hardware.camera2.CaptureResult.Key> EFV_TRANSLATE_VIEWPORT; + } + public class MultiResolutionImageReader implements java.lang.AutoCloseable { ctor public MultiResolutionImageReader(@NonNull java.util.Collection, int, @IntRange(from=1) int); method public void close(); @@ -19668,11 +20018,14 @@ package android.hardware.camera2.params { public final class ExtensionSessionConfiguration { ctor public ExtensionSessionConfiguration(int, @NonNull java.util.List, @NonNull java.util.concurrent.Executor, @NonNull android.hardware.camera2.CameraExtensionSession.StateCallback); + method @FlaggedApi("com.android.internal.camera.flags.extension_10_bit") public void clearColorSpace(); + method @FlaggedApi("com.android.internal.camera.flags.extension_10_bit") @Nullable public android.graphics.ColorSpace getColorSpace(); method @NonNull public java.util.concurrent.Executor getExecutor(); method public int getExtension(); method @NonNull public java.util.List getOutputConfigurations(); method @Nullable public android.hardware.camera2.params.OutputConfiguration getPostviewOutputConfiguration(); method @NonNull public android.hardware.camera2.CameraExtensionSession.StateCallback getStateCallback(); + method @FlaggedApi("com.android.internal.camera.flags.extension_10_bit") public void setColorSpace(@NonNull android.graphics.ColorSpace.Named); method public void setPostviewOutputConfiguration(@Nullable android.hardware.camera2.params.OutputConfiguration); } @@ -19712,7 +20065,7 @@ package android.hardware.camera2.params { @FlaggedApi("com.android.internal.camera.flags.concert_mode") public final class LensIntrinsicsSample { ctor @FlaggedApi("com.android.internal.camera.flags.concert_mode") public LensIntrinsicsSample(long, @NonNull float[]); method @FlaggedApi("com.android.internal.camera.flags.concert_mode") @NonNull public float[] getLensIntrinsics(); - method @FlaggedApi("com.android.internal.camera.flags.concert_mode") public long getTimestamp(); + method @FlaggedApi("com.android.internal.camera.flags.concert_mode") public long getTimestampNanos(); } public final class LensShadingMap { @@ -20088,6 +20441,7 @@ package android.hardware.input { method @Nullable public android.hardware.input.HostUsiVersion getHostUsiVersion(@NonNull android.view.Display); method @Nullable public android.view.InputDevice getInputDevice(int); method public int[] getInputDeviceIds(); + method @FlaggedApi("com.android.input.flags.input_device_view_behavior_api") @Nullable public android.view.InputDevice.ViewBehavior getInputDeviceViewBehavior(int); method @FloatRange(from=0, to=1) public float getMaximumObscuringOpacityForTouch(); method public boolean isStylusPointerIconEnabled(); method public void registerInputDeviceListener(android.hardware.input.InputManager.InputDeviceListener, android.os.Handler); @@ -20373,6 +20727,7 @@ package android.inputmethodservice { @UiContext public class InputMethodService extends android.inputmethodservice.AbstractInputMethodService { ctor public InputMethodService(); method @Deprecated public boolean enableHardwareAcceleration(); + method @FlaggedApi("android.view.inputmethod.connectionless_handwriting") public final void finishConnectionlessStylusHandwriting(@Nullable CharSequence); method public final void finishStylusHandwriting(); method public int getBackDisposition(); method public int getCandidatesHiddenVisibility(); @@ -20426,6 +20781,7 @@ package android.inputmethodservice { method public void onPrepareStylusHandwriting(); method public boolean onShowInputRequested(int, boolean); method public void onStartCandidatesView(android.view.inputmethod.EditorInfo, boolean); + method @FlaggedApi("android.view.inputmethod.connectionless_handwriting") public boolean onStartConnectionlessStylusHandwriting(int, @Nullable android.view.inputmethod.CursorAnchorInfo); method public void onStartInput(android.view.inputmethod.EditorInfo, boolean); method public void onStartInputView(android.view.inputmethod.EditorInfo, boolean); method public boolean onStartStylusHandwriting(); @@ -21018,6 +21374,7 @@ package android.media { method public int getStreamMinVolume(int); method public int getStreamVolume(int); method public float getStreamVolumeDb(int, int, int); + method @FlaggedApi("android.media.audio.supported_device_types_api") @NonNull public java.util.Set getSupportedDeviceTypes(int); method @NonNull public java.util.List getSupportedMixerAttributes(@NonNull android.media.AudioDeviceInfo); method @Deprecated public int getVibrateSetting(int); method public int getVolumeGroupIdForAttributes(@NonNull android.media.AudioAttributes); @@ -22083,16 +22440,16 @@ package android.media { method public void onJetUserIdUpdate(android.media.JetPlayer, int, int); } - @FlaggedApi("android.media.audio.loudness_configurator_api") public class LoudnessCodecConfigurator { - method @FlaggedApi("android.media.audio.loudness_configurator_api") public void addMediaCodec(@NonNull android.media.MediaCodec); - method @FlaggedApi("android.media.audio.loudness_configurator_api") @NonNull public static android.media.LoudnessCodecConfigurator create(); - method @FlaggedApi("android.media.audio.loudness_configurator_api") @NonNull public static android.media.LoudnessCodecConfigurator create(@NonNull java.util.concurrent.Executor, @NonNull android.media.LoudnessCodecConfigurator.OnLoudnessCodecUpdateListener); - method @FlaggedApi("android.media.audio.loudness_configurator_api") @NonNull public android.os.Bundle getLoudnessCodecParams(@NonNull android.media.AudioTrack, @NonNull android.media.MediaCodec); + @FlaggedApi("android.media.audio.loudness_configurator_api") public class LoudnessCodecController implements java.lang.AutoCloseable { + method @FlaggedApi("android.media.audio.loudness_configurator_api") public boolean addMediaCodec(@NonNull android.media.MediaCodec); + method @FlaggedApi("android.media.audio.loudness_configurator_api") public void close(); + method @FlaggedApi("android.media.audio.loudness_configurator_api") @NonNull public static android.media.LoudnessCodecController create(int); + method @FlaggedApi("android.media.audio.loudness_configurator_api") @NonNull public static android.media.LoudnessCodecController create(int, @NonNull java.util.concurrent.Executor, @NonNull android.media.LoudnessCodecController.OnLoudnessCodecUpdateListener); + method @FlaggedApi("android.media.audio.loudness_configurator_api") @NonNull public android.os.Bundle getLoudnessCodecParams(@NonNull android.media.MediaCodec); method @FlaggedApi("android.media.audio.loudness_configurator_api") public void removeMediaCodec(@NonNull android.media.MediaCodec); - method @FlaggedApi("android.media.audio.loudness_configurator_api") public void setAudioTrack(@Nullable android.media.AudioTrack); } - @FlaggedApi("android.media.audio.loudness_configurator_api") public static interface LoudnessCodecConfigurator.OnLoudnessCodecUpdateListener { + @FlaggedApi("android.media.audio.loudness_configurator_api") public static interface LoudnessCodecController.OnLoudnessCodecUpdateListener { method @FlaggedApi("android.media.audio.loudness_configurator_api") @NonNull public default android.os.Bundle onLoudnessCodecUpdate(@NonNull android.media.MediaCodec, @NonNull android.os.Bundle); } @@ -23993,6 +24350,7 @@ package android.media { method @Nullable public android.net.Uri getIconUri(); method @NonNull public String getId(); method @NonNull public CharSequence getName(); + method @FlaggedApi("com.android.media.flags.enable_built_in_speaker_route_suitability_statuses") public int getSuitabilityStatus(); method public int getType(); method public int getVolume(); method public int getVolumeHandling(); @@ -24010,6 +24368,9 @@ package android.media { field public static final String FEATURE_REMOTE_VIDEO_PLAYBACK = "android.media.route.feature.REMOTE_VIDEO_PLAYBACK"; field public static final int PLAYBACK_VOLUME_FIXED = 0; // 0x0 field public static final int PLAYBACK_VOLUME_VARIABLE = 1; // 0x1 + field @FlaggedApi("com.android.media.flags.enable_built_in_speaker_route_suitability_statuses") public static final int SUITABILITY_STATUS_NOT_SUITABLE_FOR_TRANSFER = 2; // 0x2 + field @FlaggedApi("com.android.media.flags.enable_built_in_speaker_route_suitability_statuses") public static final int SUITABILITY_STATUS_SUITABLE_FOR_DEFAULT_TRANSFER = 0; // 0x0 + field @FlaggedApi("com.android.media.flags.enable_built_in_speaker_route_suitability_statuses") public static final int SUITABILITY_STATUS_SUITABLE_FOR_MANUAL_TRANSFER = 1; // 0x1 field public static final int TYPE_BLE_HEADSET = 26; // 0x1a field public static final int TYPE_BLUETOOTH_A2DP = 8; // 0x8 field public static final int TYPE_BUILTIN_SPEAKER = 2; // 0x2 @@ -24050,6 +24411,7 @@ package android.media { method @NonNull public android.media.MediaRoute2Info.Builder setDescription(@Nullable CharSequence); method @NonNull public android.media.MediaRoute2Info.Builder setExtras(@Nullable android.os.Bundle); method @NonNull public android.media.MediaRoute2Info.Builder setIconUri(@Nullable android.net.Uri); + method @FlaggedApi("com.android.media.flags.enable_built_in_speaker_route_suitability_statuses") @NonNull public android.media.MediaRoute2Info.Builder setSuitabilityStatus(int); method @NonNull public android.media.MediaRoute2Info.Builder setType(int); method @NonNull public android.media.MediaRoute2Info.Builder setVisibilityPublic(); method @NonNull public android.media.MediaRoute2Info.Builder setVisibilityRestricted(@NonNull java.util.Set); @@ -24209,10 +24571,11 @@ package android.media { } public final class MediaRouter2 { + method @FlaggedApi("com.android.media.flags.enable_screen_off_scanning") public void cancelScanRequest(@NonNull android.media.MediaRouter2.ScanToken); method @Nullable public android.media.MediaRouter2.RoutingController getController(@NonNull String); method @NonNull public java.util.List getControllers(); method @NonNull public static android.media.MediaRouter2 getInstance(@NonNull android.content.Context); - method @FlaggedApi("com.android.media.flags.enable_cross_user_routing_in_media_router2") @NonNull @RequiresPermission(anyOf={android.Manifest.permission.MEDIA_CONTENT_CONTROL, android.Manifest.permission.MEDIA_ROUTING_CONTROL}) public static android.media.MediaRouter2 getInstance(@NonNull android.content.Context, @NonNull android.os.Looper, @NonNull String, @NonNull android.os.UserHandle); + method @FlaggedApi("com.android.media.flags.enable_cross_user_routing_in_media_router2") @Nullable @RequiresPermission(anyOf={android.Manifest.permission.MEDIA_CONTENT_CONTROL, android.Manifest.permission.MEDIA_ROUTING_CONTROL}) public static android.media.MediaRouter2 getInstance(@NonNull android.content.Context, @NonNull String); method @FlaggedApi("com.android.media.flags.enable_rlp_callbacks_in_media_router2") @Nullable public android.media.RouteListingPreference getRouteListingPreference(); method @NonNull public java.util.List getRoutes(); method @NonNull public android.media.MediaRouter2.RoutingController getSystemController(); @@ -24220,8 +24583,10 @@ package android.media { method public void registerRouteCallback(@NonNull java.util.concurrent.Executor, @NonNull android.media.MediaRouter2.RouteCallback, @NonNull android.media.RouteDiscoveryPreference); method @FlaggedApi("com.android.media.flags.enable_rlp_callbacks_in_media_router2") public void registerRouteListingPreferenceUpdatedCallback(@NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer); method public void registerTransferCallback(@NonNull java.util.concurrent.Executor, @NonNull android.media.MediaRouter2.TransferCallback); + method @FlaggedApi("com.android.media.flags.enable_screen_off_scanning") @NonNull public android.media.MediaRouter2.ScanToken requestScan(@NonNull android.media.MediaRouter2.ScanRequest); method public void setOnGetControllerHintsListener(@Nullable android.media.MediaRouter2.OnGetControllerHintsListener); method public void setRouteListingPreference(@Nullable android.media.RouteListingPreference); + method @FlaggedApi("com.android.media.flags.enable_privileged_routing_for_media_routing_control") @RequiresPermission(anyOf={android.Manifest.permission.MEDIA_CONTENT_CONTROL, android.Manifest.permission.MEDIA_ROUTING_CONTROL}) public void setRouteVolume(@NonNull android.media.MediaRoute2Info, int); method public boolean showSystemOutputSwitcher(); method public void stop(); method public void transferTo(@NonNull android.media.MediaRoute2Info); @@ -24256,6 +24621,7 @@ package android.media { method @NonNull public android.media.RoutingSessionInfo getRoutingSessionInfo(); method @NonNull public java.util.List getSelectableRoutes(); method @NonNull public java.util.List getSelectedRoutes(); + method @FlaggedApi("com.android.media.flags.enable_get_transferable_routes") @NonNull public java.util.List getTransferableRoutes(); method public int getVolume(); method public int getVolumeHandling(); method public int getVolumeMax(); @@ -24263,6 +24629,20 @@ package android.media { method public void release(); method public void selectRoute(@NonNull android.media.MediaRoute2Info); method public void setVolume(int); + method @FlaggedApi("com.android.media.flags.enable_built_in_speaker_route_suitability_statuses") public boolean wasTransferInitiatedBySelf(); + } + + @FlaggedApi("com.android.media.flags.enable_screen_off_scanning") public static final class MediaRouter2.ScanRequest { + method public boolean isScreenOffScan(); + } + + public static final class MediaRouter2.ScanRequest.Builder { + ctor public MediaRouter2.ScanRequest.Builder(); + method @NonNull public android.media.MediaRouter2.ScanRequest build(); + method @NonNull public android.media.MediaRouter2.ScanRequest.Builder setScreenOffScan(boolean); + } + + @FlaggedApi("com.android.media.flags.enable_screen_off_scanning") public static final class MediaRouter2.ScanToken { } public abstract static class MediaRouter2.TransferCallback { @@ -24522,6 +24902,7 @@ package android.media { } public class Ringtone { + method protected void finalize(); method public android.media.AudioAttributes getAudioAttributes(); method @Deprecated public int getStreamType(); method public String getTitle(android.content.Context); @@ -24660,12 +25041,16 @@ package android.media { method @Nullable public CharSequence getName(); method @NonNull public java.util.List getSelectableRoutes(); method @NonNull public java.util.List getSelectedRoutes(); + method @FlaggedApi("com.android.media.flags.enable_built_in_speaker_route_suitability_statuses") public int getTransferReason(); method @NonNull public java.util.List getTransferableRoutes(); method public int getVolume(); method public int getVolumeHandling(); method public int getVolumeMax(); method public void writeToParcel(@NonNull android.os.Parcel, int); field @NonNull public static final android.os.Parcelable.Creator CREATOR; + field @FlaggedApi("com.android.media.flags.enable_built_in_speaker_route_suitability_statuses") public static final int TRANSFER_REASON_APP = 2; // 0x2 + field @FlaggedApi("com.android.media.flags.enable_built_in_speaker_route_suitability_statuses") public static final int TRANSFER_REASON_FALLBACK = 0; // 0x0 + field @FlaggedApi("com.android.media.flags.enable_built_in_speaker_route_suitability_statuses") public static final int TRANSFER_REASON_SYSTEM_REQUEST = 1; // 0x1 } public static final class RoutingSessionInfo.Builder { @@ -24686,6 +25071,8 @@ package android.media { method @NonNull public android.media.RoutingSessionInfo.Builder removeTransferableRoute(@NonNull String); method @NonNull public android.media.RoutingSessionInfo.Builder setControlHints(@Nullable android.os.Bundle); method @NonNull public android.media.RoutingSessionInfo.Builder setName(@Nullable CharSequence); + method @FlaggedApi("com.android.media.flags.enable_built_in_speaker_route_suitability_statuses") @NonNull public android.media.RoutingSessionInfo.Builder setTransferInitiator(@Nullable android.os.UserHandle, @Nullable String); + method @FlaggedApi("com.android.media.flags.enable_built_in_speaker_route_suitability_statuses") @NonNull public android.media.RoutingSessionInfo.Builder setTransferReason(int); method @NonNull public android.media.RoutingSessionInfo.Builder setVolume(int); method @NonNull public android.media.RoutingSessionInfo.Builder setVolumeHandling(int); method @NonNull public android.media.RoutingSessionInfo.Builder setVolumeMax(int); @@ -25421,34 +25808,34 @@ package android.media.audiofx { field public short preset; } - public class Virtualizer extends android.media.audiofx.AudioEffect { - ctor public Virtualizer(int, int) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException, java.lang.RuntimeException, java.lang.UnsupportedOperationException; - method public boolean canVirtualize(int, int) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException, java.lang.UnsupportedOperationException; - method public boolean forceVirtualizationMode(int) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException, java.lang.UnsupportedOperationException; - method public android.media.audiofx.Virtualizer.Settings getProperties() throws java.lang.IllegalArgumentException, java.lang.IllegalStateException, java.lang.UnsupportedOperationException; - method public short getRoundedStrength() throws java.lang.IllegalArgumentException, java.lang.IllegalStateException, java.lang.UnsupportedOperationException; - method public boolean getSpeakerAngles(int, int, int[]) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException, java.lang.UnsupportedOperationException; - method public boolean getStrengthSupported(); - method public int getVirtualizationMode() throws java.lang.IllegalStateException, java.lang.UnsupportedOperationException; - method public void setParameterListener(android.media.audiofx.Virtualizer.OnParameterChangeListener); - method public void setProperties(android.media.audiofx.Virtualizer.Settings) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException, java.lang.UnsupportedOperationException; - method public void setStrength(short) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException, java.lang.UnsupportedOperationException; - field public static final int PARAM_STRENGTH = 1; // 0x1 - field public static final int PARAM_STRENGTH_SUPPORTED = 0; // 0x0 - field public static final int VIRTUALIZATION_MODE_AUTO = 1; // 0x1 - field public static final int VIRTUALIZATION_MODE_BINAURAL = 2; // 0x2 - field public static final int VIRTUALIZATION_MODE_OFF = 0; // 0x0 - field public static final int VIRTUALIZATION_MODE_TRANSAURAL = 3; // 0x3 + @Deprecated public class Virtualizer extends android.media.audiofx.AudioEffect { + ctor @Deprecated public Virtualizer(int, int) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException, java.lang.RuntimeException, java.lang.UnsupportedOperationException; + method @Deprecated public boolean canVirtualize(int, int) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException, java.lang.UnsupportedOperationException; + method @Deprecated public boolean forceVirtualizationMode(int) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException, java.lang.UnsupportedOperationException; + method @Deprecated public android.media.audiofx.Virtualizer.Settings getProperties() throws java.lang.IllegalArgumentException, java.lang.IllegalStateException, java.lang.UnsupportedOperationException; + method @Deprecated public short getRoundedStrength() throws java.lang.IllegalArgumentException, java.lang.IllegalStateException, java.lang.UnsupportedOperationException; + method @Deprecated public boolean getSpeakerAngles(int, int, int[]) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException, java.lang.UnsupportedOperationException; + method @Deprecated public boolean getStrengthSupported(); + method @Deprecated public int getVirtualizationMode() throws java.lang.IllegalStateException, java.lang.UnsupportedOperationException; + method @Deprecated public void setParameterListener(android.media.audiofx.Virtualizer.OnParameterChangeListener); + method @Deprecated public void setProperties(android.media.audiofx.Virtualizer.Settings) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException, java.lang.UnsupportedOperationException; + method @Deprecated public void setStrength(short) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException, java.lang.UnsupportedOperationException; + field @Deprecated public static final int PARAM_STRENGTH = 1; // 0x1 + field @Deprecated public static final int PARAM_STRENGTH_SUPPORTED = 0; // 0x0 + field @Deprecated public static final int VIRTUALIZATION_MODE_AUTO = 1; // 0x1 + field @Deprecated public static final int VIRTUALIZATION_MODE_BINAURAL = 2; // 0x2 + field @Deprecated public static final int VIRTUALIZATION_MODE_OFF = 0; // 0x0 + field @Deprecated public static final int VIRTUALIZATION_MODE_TRANSAURAL = 3; // 0x3 } - public static interface Virtualizer.OnParameterChangeListener { - method public void onParameterChange(android.media.audiofx.Virtualizer, int, int, short); + @Deprecated public static interface Virtualizer.OnParameterChangeListener { + method @Deprecated public void onParameterChange(android.media.audiofx.Virtualizer, int, int, short); } - public static class Virtualizer.Settings { - ctor public Virtualizer.Settings(); - ctor public Virtualizer.Settings(String); - field public short strength; + @Deprecated public static class Virtualizer.Settings { + ctor @Deprecated public Virtualizer.Settings(); + ctor @Deprecated public Virtualizer.Settings(String); + field @Deprecated public short strength; } public class Visualizer { @@ -25621,9 +26008,70 @@ package android.media.metrics { field public static final String KEY_STATSD_ATOM = "bundlesession-statsd-atom"; } + @FlaggedApi("com.android.media.editing.flags.add_media_metrics_editing") public final class EditingEndedEvent extends android.media.metrics.Event implements android.os.Parcelable { + method public int describeContents(); + method public int getErrorCode(); + method @Nullable public String getExporterName(); + method public float getFinalProgressPercent(); + method public int getFinalState(); + method @NonNull public java.util.List getInputMediaItemInfos(); + method @Nullable public String getMuxerName(); + method public long getOperationTypes(); + method @Nullable public android.media.metrics.MediaItemInfo getOutputMediaItemInfo(); + method public void writeToParcel(@NonNull android.os.Parcel, int); + field @NonNull public static final android.os.Parcelable.Creator CREATOR; + field public static final int ERROR_CODE_AUDIO_PROCESSING_FAILED = 18; // 0x12 + field public static final int ERROR_CODE_DECODER_INIT_FAILED = 11; // 0xb + field public static final int ERROR_CODE_DECODING_FAILED = 12; // 0xc + field public static final int ERROR_CODE_DECODING_FORMAT_UNSUPPORTED = 13; // 0xd + field public static final int ERROR_CODE_ENCODER_INIT_FAILED = 14; // 0xe + field public static final int ERROR_CODE_ENCODING_FAILED = 15; // 0xf + field public static final int ERROR_CODE_ENCODING_FORMAT_UNSUPPORTED = 16; // 0x10 + field public static final int ERROR_CODE_FAILED_RUNTIME_CHECK = 2; // 0x2 + field public static final int ERROR_CODE_IO_BAD_HTTP_STATUS = 6; // 0x6 + field public static final int ERROR_CODE_IO_CLEARTEXT_NOT_PERMITTED = 9; // 0x9 + field public static final int ERROR_CODE_IO_FILE_NOT_FOUND = 7; // 0x7 + field public static final int ERROR_CODE_IO_NETWORK_CONNECTION_FAILED = 4; // 0x4 + field public static final int ERROR_CODE_IO_NETWORK_CONNECTION_TIMEOUT = 5; // 0x5 + field public static final int ERROR_CODE_IO_NO_PERMISSION = 8; // 0x8 + field public static final int ERROR_CODE_IO_READ_POSITION_OUT_OF_RANGE = 10; // 0xa + field public static final int ERROR_CODE_IO_UNSPECIFIED = 3; // 0x3 + field public static final int ERROR_CODE_MUXING_FAILED = 19; // 0x13 + field public static final int ERROR_CODE_NONE = 1; // 0x1 + field public static final int ERROR_CODE_VIDEO_FRAME_PROCESSING_FAILED = 17; // 0x11 + field public static final int FINAL_STATE_CANCELED = 2; // 0x2 + field public static final int FINAL_STATE_ERROR = 3; // 0x3 + field public static final int FINAL_STATE_SUCCEEDED = 1; // 0x1 + field public static final long OPERATION_TYPE_AUDIO_EDIT = 8L; // 0x8L + field public static final long OPERATION_TYPE_AUDIO_TRANSCODE = 2L; // 0x2L + field public static final long OPERATION_TYPE_AUDIO_TRANSMUX = 32L; // 0x20L + field public static final long OPERATION_TYPE_PAUSED = 64L; // 0x40L + field public static final long OPERATION_TYPE_RESUMED = 128L; // 0x80L + field public static final long OPERATION_TYPE_VIDEO_EDIT = 4L; // 0x4L + field public static final long OPERATION_TYPE_VIDEO_TRANSCODE = 1L; // 0x1L + field public static final long OPERATION_TYPE_VIDEO_TRANSMUX = 16L; // 0x10L + field public static final int PROGRESS_PERCENT_UNKNOWN = -1; // 0xffffffff + field public static final int TIME_SINCE_CREATED_UNKNOWN = -1; // 0xffffffff + } + + @FlaggedApi("com.android.media.editing.flags.add_media_metrics_editing") public static final class EditingEndedEvent.Builder { + ctor public EditingEndedEvent.Builder(int); + method @NonNull public android.media.metrics.EditingEndedEvent.Builder addInputMediaItemInfo(@NonNull android.media.metrics.MediaItemInfo); + method @NonNull public android.media.metrics.EditingEndedEvent.Builder addOperationType(long); + method @NonNull public android.media.metrics.EditingEndedEvent build(); + method @NonNull public android.media.metrics.EditingEndedEvent.Builder setErrorCode(int); + method @NonNull public android.media.metrics.EditingEndedEvent.Builder setExporterName(@NonNull String); + method @NonNull public android.media.metrics.EditingEndedEvent.Builder setFinalProgressPercent(@FloatRange(from=0, to=100) float); + method @NonNull public android.media.metrics.EditingEndedEvent.Builder setMetricsBundle(@NonNull android.os.Bundle); + method @NonNull public android.media.metrics.EditingEndedEvent.Builder setMuxerName(@NonNull String); + method @NonNull public android.media.metrics.EditingEndedEvent.Builder setOutputMediaItemInfo(@NonNull android.media.metrics.MediaItemInfo); + method @NonNull public android.media.metrics.EditingEndedEvent.Builder setTimeSinceCreatedMillis(@IntRange(from=android.media.metrics.EditingEndedEvent.TIME_SINCE_CREATED_UNKNOWN) long); + } + public final class EditingSession implements java.lang.AutoCloseable { method public void close(); method @NonNull public android.media.metrics.LogSessionId getSessionId(); + method @FlaggedApi("com.android.media.editing.flags.add_media_metrics_editing") public void reportEditingEndedEvent(@NonNull android.media.metrics.EditingEndedEvent); } public abstract class Event { @@ -25636,6 +26084,65 @@ package android.media.metrics { field @NonNull public static final android.media.metrics.LogSessionId LOG_SESSION_ID_NONE; } + @FlaggedApi("com.android.media.editing.flags.add_media_metrics_editing") public final class MediaItemInfo implements android.os.Parcelable { + method public int describeContents(); + method public int getAudioChannelCount(); + method public long getAudioSampleCount(); + method public int getAudioSampleRateHz(); + method public long getClipDurationMillis(); + method @NonNull public java.util.List getCodecNames(); + method @Nullable public String getContainerMimeType(); + method public long getDataTypes(); + method public long getDurationMillis(); + method @NonNull public java.util.List getSampleMimeTypes(); + method public int getSourceType(); + method public int getVideoDataSpace(); + method public float getVideoFrameRate(); + method public long getVideoSampleCount(); + method @NonNull public android.util.Size getVideoSize(); + method public void writeToParcel(@NonNull android.os.Parcel, int); + field @NonNull public static final android.os.Parcelable.Creator CREATOR; + field public static final long DATA_TYPE_AUDIO = 4L; // 0x4L + field public static final long DATA_TYPE_DEPTH = 16L; // 0x10L + field public static final long DATA_TYPE_GAIN_MAP = 32L; // 0x20L + field public static final long DATA_TYPE_GAPLESS = 256L; // 0x100L + field public static final long DATA_TYPE_HIGH_DYNAMIC_RANGE_VIDEO = 1024L; // 0x400L + field public static final long DATA_TYPE_HIGH_FRAME_RATE = 64L; // 0x40L + field public static final long DATA_TYPE_IMAGE = 1L; // 0x1L + field public static final long DATA_TYPE_METADATA = 8L; // 0x8L + field public static final long DATA_TYPE_SPATIAL_AUDIO = 512L; // 0x200L + field public static final long DATA_TYPE_SPEED_SETTING_CUE_POINTS = 128L; // 0x80L + field public static final long DATA_TYPE_VIDEO = 2L; // 0x2L + field public static final int SOURCE_TYPE_CAMERA = 2; // 0x2 + field public static final int SOURCE_TYPE_EDITING_SESSION = 3; // 0x3 + field public static final int SOURCE_TYPE_GALLERY = 1; // 0x1 + field public static final int SOURCE_TYPE_GENERATED = 7; // 0x7 + field public static final int SOURCE_TYPE_LOCAL_FILE = 4; // 0x4 + field public static final int SOURCE_TYPE_REMOTE_FILE = 5; // 0x5 + field public static final int SOURCE_TYPE_REMOTE_LIVE_STREAM = 6; // 0x6 + field public static final int SOURCE_TYPE_UNSPECIFIED = 0; // 0x0 + field public static final int VALUE_UNSPECIFIED = -1; // 0xffffffff + } + + @FlaggedApi("com.android.media.editing.flags.add_media_metrics_editing") public static final class MediaItemInfo.Builder { + ctor public MediaItemInfo.Builder(); + method @NonNull public android.media.metrics.MediaItemInfo.Builder addCodecName(@NonNull String); + method @NonNull public android.media.metrics.MediaItemInfo.Builder addDataType(long); + method @NonNull public android.media.metrics.MediaItemInfo.Builder addSampleMimeType(@NonNull String); + method @NonNull public android.media.metrics.MediaItemInfo build(); + method @NonNull public android.media.metrics.MediaItemInfo.Builder setAudioChannelCount(@IntRange(from=0) int); + method @NonNull public android.media.metrics.MediaItemInfo.Builder setAudioSampleCount(@IntRange(from=0) long); + method @NonNull public android.media.metrics.MediaItemInfo.Builder setAudioSampleRateHz(@IntRange(from=0) int); + method @NonNull public android.media.metrics.MediaItemInfo.Builder setClipDurationMillis(long); + method @NonNull public android.media.metrics.MediaItemInfo.Builder setContainerMimeType(@NonNull String); + method @NonNull public android.media.metrics.MediaItemInfo.Builder setDurationMillis(long); + method @NonNull public android.media.metrics.MediaItemInfo.Builder setSourceType(int); + method @NonNull public android.media.metrics.MediaItemInfo.Builder setVideoDataSpace(int); + method @NonNull public android.media.metrics.MediaItemInfo.Builder setVideoFrameRate(@FloatRange(from=0) float); + method @NonNull public android.media.metrics.MediaItemInfo.Builder setVideoSampleCount(@IntRange(from=0) long); + method @NonNull public android.media.metrics.MediaItemInfo.Builder setVideoSize(@NonNull android.util.Size); + } + public final class MediaMetricsManager { method @NonNull public android.media.metrics.BundleSession createBundleSession(); method @NonNull public android.media.metrics.EditingSession createEditingSession(); @@ -26293,6 +26800,7 @@ package android.media.session { field public static final int STATE_FAST_FORWARDING = 4; // 0x4 field public static final int STATE_NONE = 0; // 0x0 field public static final int STATE_PAUSED = 2; // 0x2 + field @FlaggedApi("com.android.media.flags.enable_notifying_activity_manager_with_media_session_status_change") public static final int STATE_PLAYBACK_SUPPRESSED = 12; // 0xc field public static final int STATE_PLAYING = 3; // 0x3 field public static final int STATE_REWINDING = 5; // 0x5 field public static final int STATE_SKIPPING_TO_NEXT = 10; // 0xa @@ -26401,6 +26909,8 @@ package android.media.tv { method public void writeToParcel(@NonNull android.os.Parcel, int); field @NonNull public static final android.os.Parcelable.Creator CREATOR; field public static final int REQUEST_OPTION_AUTO_UPDATE = 1; // 0x1 + field @FlaggedApi("android.media.tv.flags.tiaf_v_apis") public static final int REQUEST_OPTION_ONESHOT = 3; // 0x3 + field @FlaggedApi("android.media.tv.flags.tiaf_v_apis") public static final int REQUEST_OPTION_ONEWAY = 2; // 0x2 field public static final int REQUEST_OPTION_REPEAT = 0; // 0x0 } @@ -26488,6 +26998,67 @@ package android.media.tv { field @NonNull public static final android.os.Parcelable.Creator CREATOR; } + @FlaggedApi("android.media.tv.flags.tiaf_v_apis") public final class SignalingDataInfo implements android.os.Parcelable { + ctor public SignalingDataInfo(@NonNull String, @NonNull String, int, int); + ctor public SignalingDataInfo(@NonNull String, @NonNull String, int, int, @NonNull String); + method public int describeContents(); + method @NonNull public String getEncoding(); + method public int getGroup(); + method @NonNull public String getSignalingDataType(); + method @NonNull public String getTable(); + method public int getVersion(); + method public void writeToParcel(@NonNull android.os.Parcel, int); + field public static final String CONTENT_ENCODING_BASE64 = "Base64"; + field public static final String CONTENT_ENCODING_UTF_8 = "UTF-8"; + field @NonNull public static final android.os.Parcelable.Creator CREATOR; + field public static final int LLS_NO_GROUP_ID = -1; // 0xffffffff + } + + @FlaggedApi("android.media.tv.flags.tiaf_v_apis") public final class SignalingDataRequest extends android.media.tv.BroadcastInfoRequest implements android.os.Parcelable { + ctor public SignalingDataRequest(int, int, int, @NonNull java.util.List); + method public int getGroup(); + method @NonNull public java.util.List getSignalingDataTypes(); + field @NonNull public static final android.os.Parcelable.Creator CREATOR; + field public static final int SIGNALING_DATA_NO_GROUP_ID = -1; // 0xffffffff + field public static final String SIGNALING_METADATA_AEAT = "AEAT"; + field public static final String SIGNALING_METADATA_AEI = "AEI"; + field public static final String SIGNALING_METADATA_APD = "APD"; + field public static final String SIGNALING_METADATA_ASD = "ASD"; + field public static final String SIGNALING_METADATA_ASPD = "ASPD"; + field public static final String SIGNALING_METADATA_CAD = "CAD"; + field public static final String SIGNALING_METADATA_CDT = "CDT"; + field public static final String SIGNALING_METADATA_CRIT = "CRIT"; + field public static final String SIGNALING_METADATA_DCIT = "DCIT"; + field public static final String SIGNALING_METADATA_DWD = "DWD"; + field public static final String SIGNALING_METADATA_EMSG = "EMSG"; + field public static final String SIGNALING_METADATA_EVTI = "EVTI"; + field public static final String SIGNALING_METADATA_HELD = "HELD"; + field public static final String SIGNALING_METADATA_IED = "IED"; + field public static final String SIGNALING_METADATA_MPD = "MPD"; + field public static final String SIGNALING_METADATA_MPIT = "MPIT"; + field public static final String SIGNALING_METADATA_MPT = "MPT"; + field public static final String SIGNALING_METADATA_OSN = "OSN"; + field public static final String SIGNALING_METADATA_PAT = "PAT"; + field public static final String SIGNALING_METADATA_RDT = "RDT"; + field public static final String SIGNALING_METADATA_RRT = "RRT"; + field public static final String SIGNALING_METADATA_RSAT = "RSAT"; + field public static final String SIGNALING_METADATA_SLT = "SLT"; + field public static final String SIGNALING_METADATA_SMT = "SMT"; + field public static final String SIGNALING_METADATA_SSD = "SSD"; + field public static final String SIGNALING_METADATA_STSID = "STSID"; + field public static final String SIGNALING_METADATA_STT = "STT"; + field public static final String SIGNALING_METADATA_USBD = "USBD"; + field public static final String SIGNALING_METADATA_USD = "USD"; + field public static final String SIGNALING_METADATA_VSPD = "VSPD"; + } + + @FlaggedApi("android.media.tv.flags.tiaf_v_apis") public final class SignalingDataResponse extends android.media.tv.BroadcastInfoResponse implements android.os.Parcelable { + ctor public SignalingDataResponse(int, int, int, @NonNull java.util.List, @NonNull java.util.List); + method @NonNull public java.util.List getSignalingDataInfoList(); + method @NonNull public java.util.List getSignalingDataTypes(); + field @NonNull public static final android.os.Parcelable.Creator CREATOR; + } + public final class StreamEventRequest extends android.media.tv.BroadcastInfoRequest implements android.os.Parcelable { ctor public StreamEventRequest(int, int, @NonNull android.net.Uri, @NonNull String); method @NonNull public String getEventName(); @@ -26621,12 +27192,16 @@ package android.media.tv { public static final class TvContract.Channels implements android.media.tv.TvContract.BaseTvColumns { method @Nullable public static String getVideoResolution(String); + field @FlaggedApi("android.media.tv.flags.broadcast_visibility_types") public static final int BROADCAST_VISIBILITY_TYPE_INVISIBLE = 2; // 0x2 + field @FlaggedApi("android.media.tv.flags.broadcast_visibility_types") public static final int BROADCAST_VISIBILITY_TYPE_NUMERIC_SELECTABLE_ONLY = 1; // 0x1 + field @FlaggedApi("android.media.tv.flags.broadcast_visibility_types") public static final int BROADCAST_VISIBILITY_TYPE_VISIBLE = 0; // 0x0 field public static final String COLUMN_APP_LINK_COLOR = "app_link_color"; field public static final String COLUMN_APP_LINK_ICON_URI = "app_link_icon_uri"; field public static final String COLUMN_APP_LINK_INTENT_URI = "app_link_intent_uri"; field public static final String COLUMN_APP_LINK_POSTER_ART_URI = "app_link_poster_art_uri"; field public static final String COLUMN_APP_LINK_TEXT = "app_link_text"; field public static final String COLUMN_BROADCAST_GENRE = "broadcast_genre"; + field @FlaggedApi("android.media.tv.flags.broadcast_visibility_types") public static final String COLUMN_BROADCAST_VISIBILITY_TYPE = "broadcast_visibility_type"; field public static final String COLUMN_BROWSABLE = "browsable"; field public static final String COLUMN_CHANNEL_LIST_ID = "channel_list_id"; field public static final String COLUMN_DESCRIPTION = "description"; @@ -27070,6 +27645,24 @@ package android.media.tv { field public static final int RECORDING_ERROR_INSUFFICIENT_SPACE = 1; // 0x1 field public static final int RECORDING_ERROR_RESOURCE_BUSY = 2; // 0x2 field public static final int RECORDING_ERROR_UNKNOWN = 0; // 0x0 + field @FlaggedApi("android.media.tv.flags.enable_ad_service_fw") public static final String SESSION_DATA_KEY_AD_BUFFER = "ad_buffer"; + field @FlaggedApi("android.media.tv.flags.enable_ad_service_fw") public static final String SESSION_DATA_KEY_AD_RESPONSE = "ad_response"; + field @FlaggedApi("android.media.tv.flags.enable_ad_service_fw") public static final String SESSION_DATA_KEY_BROADCAST_INFO_RESPONSE = "broadcast_info_response"; + field @FlaggedApi("android.media.tv.flags.enable_ad_service_fw") public static final String SESSION_DATA_KEY_CHANNEL_URI = "channel_uri"; + field @FlaggedApi("android.media.tv.flags.enable_ad_service_fw") public static final String SESSION_DATA_KEY_TRACKS = "tracks"; + field @FlaggedApi("android.media.tv.flags.enable_ad_service_fw") public static final String SESSION_DATA_KEY_TRACK_ID = "track_id"; + field @FlaggedApi("android.media.tv.flags.enable_ad_service_fw") public static final String SESSION_DATA_KEY_TRACK_TYPE = "track_type"; + field @FlaggedApi("android.media.tv.flags.enable_ad_service_fw") public static final String SESSION_DATA_KEY_TV_MESSAGE_TYPE = "tv_message_type"; + field @FlaggedApi("android.media.tv.flags.enable_ad_service_fw") public static final String SESSION_DATA_KEY_VIDEO_UNAVAILABLE_REASON = "video_unavailable_reason"; + field @FlaggedApi("android.media.tv.flags.enable_ad_service_fw") public static final String SESSION_DATA_TYPE_AD_BUFFER_CONSUMED = "ad_buffer_consumed"; + field @FlaggedApi("android.media.tv.flags.enable_ad_service_fw") public static final String SESSION_DATA_TYPE_AD_RESPONSE = "ad_response"; + field @FlaggedApi("android.media.tv.flags.enable_ad_service_fw") public static final String SESSION_DATA_TYPE_BROADCAST_INFO_RESPONSE = "broadcast_info_response"; + field @FlaggedApi("android.media.tv.flags.enable_ad_service_fw") public static final String SESSION_DATA_TYPE_TRACKS_CHANGED = "tracks_changed"; + field @FlaggedApi("android.media.tv.flags.enable_ad_service_fw") public static final String SESSION_DATA_TYPE_TRACK_SELECTED = "track_selected"; + field @FlaggedApi("android.media.tv.flags.enable_ad_service_fw") public static final String SESSION_DATA_TYPE_TUNED = "tuned"; + field @FlaggedApi("android.media.tv.flags.enable_ad_service_fw") public static final String SESSION_DATA_TYPE_TV_MESSAGE = "tv_message"; + field @FlaggedApi("android.media.tv.flags.enable_ad_service_fw") public static final String SESSION_DATA_TYPE_VIDEO_AVAILABLE = "video_available"; + field @FlaggedApi("android.media.tv.flags.enable_ad_service_fw") public static final String SESSION_DATA_TYPE_VIDEO_UNAVAILABLE = "video_unavailable"; field public static final int SIGNAL_STRENGTH_LOST = 1; // 0x1 field public static final int SIGNAL_STRENGTH_STRONG = 3; // 0x3 field public static final int SIGNAL_STRENGTH_WEAK = 2; // 0x2 @@ -27107,6 +27700,7 @@ package android.media.tv { field public static final int VIDEO_UNAVAILABLE_REASON_CAS_UNKNOWN = 18; // 0x12 field public static final int VIDEO_UNAVAILABLE_REASON_INSUFFICIENT_RESOURCE = 6; // 0x6 field public static final int VIDEO_UNAVAILABLE_REASON_NOT_CONNECTED = 5; // 0x5 + field @FlaggedApi("android.media.tv.flags.tiaf_v_apis") public static final int VIDEO_UNAVAILABLE_REASON_STOPPED = 19; // 0x13 field public static final int VIDEO_UNAVAILABLE_REASON_TUNING = 1; // 0x1 field public static final int VIDEO_UNAVAILABLE_REASON_UNKNOWN = 0; // 0x0 field public static final int VIDEO_UNAVAILABLE_REASON_WEAK_SIGNAL = 2; // 0x2 @@ -27184,6 +27778,7 @@ package android.media.tv { method public void notifyTuned(@NonNull android.net.Uri); method public void notifyTvMessage(int, @NonNull android.os.Bundle); method public void notifyVideoAvailable(); + method @FlaggedApi("android.media.tv.flags.tiaf_v_apis") public void notifyVideoFreezeUpdated(boolean); method public void notifyVideoUnavailable(int); method public void onAdBufferReady(@NonNull android.media.tv.AdBuffer); method public void onAppPrivateCommand(@NonNull String, android.os.Bundle); @@ -27198,6 +27793,7 @@ package android.media.tv { method public void onRemoveBroadcastInfo(int); method public void onRequestAd(@NonNull android.media.tv.AdRequest); method public void onRequestBroadcastInfo(@NonNull android.media.tv.BroadcastInfoRequest); + method @FlaggedApi("android.media.tv.flags.tiaf_v_apis") public void onResumePlayback(); method public boolean onSelectAudioPresentation(int, int); method public boolean onSelectTrack(int, @Nullable String); method public abstract void onSetCaptionEnabled(boolean); @@ -27205,6 +27801,7 @@ package android.media.tv { method public abstract void onSetStreamVolume(@FloatRange(from=0.0, to=1.0) float); method public abstract boolean onSetSurface(@Nullable android.view.Surface); method public void onSetTvMessageEnabled(int, boolean); + method @FlaggedApi("android.media.tv.flags.tiaf_v_apis") public void onStopPlayback(int); method public void onSurfaceChanged(int, int, int); method public long onTimeShiftGetCurrentPosition(); method public long onTimeShiftGetStartPosition(); @@ -27218,8 +27815,10 @@ package android.media.tv { method public boolean onTrackballEvent(android.view.MotionEvent); method public abstract boolean onTune(android.net.Uri); method public boolean onTune(android.net.Uri, android.os.Bundle); + method @FlaggedApi("android.media.tv.flags.enable_ad_service_fw") public void onTvAdSessionData(@NonNull String, @NonNull android.os.Bundle); method public void onTvMessage(int, @NonNull android.os.Bundle); method public void onUnblockContent(android.media.tv.TvContentRating); + method @FlaggedApi("android.media.tv.flags.enable_ad_service_fw") public void sendTvInputSessionData(@NonNull String, @NonNull android.os.Bundle); method public void setOverlayViewEnabled(boolean); } @@ -27339,6 +27938,7 @@ package android.media.tv { method public boolean onUnhandledInputEvent(android.view.InputEvent); method public void overrideTvAppAttributionSource(@NonNull android.content.AttributionSource); method public void reset(); + method @FlaggedApi("android.media.tv.flags.tiaf_v_apis") public void resumePlayback(); method public void selectAudioPresentation(int, int); method public void selectTrack(int, String); method public void sendAppPrivateCommand(@NonNull String, android.os.Bundle); @@ -27349,8 +27949,10 @@ package android.media.tv { method public void setStreamVolume(@FloatRange(from=0.0, to=1.0) float); method public void setTimeShiftPositionCallback(@Nullable android.media.tv.TvView.TimeShiftPositionCallback); method public void setTvMessageEnabled(int, boolean); + method @FlaggedApi("android.media.tv.flags.tiaf_v_apis") public void setVideoFrozen(boolean); method public void setZOrderMediaOverlay(boolean); method public void setZOrderOnTop(boolean); + method @FlaggedApi("android.media.tv.flags.tiaf_v_apis") public void stopPlayback(int); method public void timeShiftPause(); method public void timeShiftPlay(String, android.net.Uri); method public void timeShiftResume(); @@ -27391,6 +27993,7 @@ package android.media.tv { method public void onTuned(@NonNull String, @NonNull android.net.Uri); method public void onTvMessage(@NonNull String, int, @NonNull android.os.Bundle); method public void onVideoAvailable(String); + method @FlaggedApi("android.media.tv.flags.tiaf_v_apis") public void onVideoFreezeUpdated(@NonNull String, boolean); method public void onVideoSizeChanged(String, int, int); method public void onVideoUnavailable(String, int); } @@ -27399,7 +28002,150 @@ package android.media.tv { package android.media.tv.ad { - @FlaggedApi("android.media.tv.flags.enable_ad_service_fw") public class TvAdManager { + @FlaggedApi("android.media.tv.flags.enable_ad_service_fw") public final class TvAdManager { + method @NonNull public java.util.List getTvAdServiceList(); + method public void registerCallback(@NonNull java.util.concurrent.Executor, @NonNull android.media.tv.ad.TvAdManager.TvAdServiceCallback); + method public void sendAppLinkCommand(@NonNull String, @NonNull android.os.Bundle); + method public void unregisterCallback(@NonNull android.media.tv.ad.TvAdManager.TvAdServiceCallback); + field public static final String ACTION_APP_LINK_COMMAND = "android.media.tv.ad.action.APP_LINK_COMMAND"; + field public static final String APP_LINK_KEY_BACK_URI = "back_uri"; + field public static final String APP_LINK_KEY_CLASS_NAME = "class_name"; + field public static final String APP_LINK_KEY_COMMAND_TYPE = "command_type"; + field public static final String APP_LINK_KEY_PACKAGE_NAME = "package_name"; + field public static final String APP_LINK_KEY_SERVICE_ID = "service_id"; + field public static final int ERROR_BLOCKED = 5; // 0x5 + field public static final int ERROR_ENCRYPTED = 6; // 0x6 + field public static final int ERROR_NONE = 0; // 0x0 + field public static final int ERROR_NOT_SUPPORTED = 2; // 0x2 + field public static final int ERROR_RESOURCE_UNAVAILABLE = 4; // 0x4 + field public static final int ERROR_UNKNOWN = 1; // 0x1 + field public static final int ERROR_UNKNOWN_CHANNEL = 7; // 0x7 + field public static final int ERROR_WEAK_SIGNAL = 3; // 0x3 + field public static final String INTENT_KEY_AD_SERVICE_ID = "ad_service_id"; + field public static final String INTENT_KEY_CHANNEL_URI = "channel_uri"; + field public static final String INTENT_KEY_COMMAND_TYPE = "command_type"; + field public static final String INTENT_KEY_TV_INPUT_ID = "tv_input_id"; + field public static final String SESSION_DATA_KEY_AD_BUFFER = "ad_buffer"; + field public static final String SESSION_DATA_KEY_AD_REQUEST = "ad_request"; + field public static final String SESSION_DATA_KEY_BROADCAST_INFO_REQUEST = "broadcast_info_request"; + field public static final String SESSION_DATA_KEY_REQUEST_ID = "request_id"; + field public static final String SESSION_DATA_TYPE_AD_BUFFER_READY = "ad_buffer_ready"; + field public static final String SESSION_DATA_TYPE_AD_REQUEST = "ad_request"; + field public static final String SESSION_DATA_TYPE_BROADCAST_INFO_REQUEST = "broadcast_info_request"; + field public static final String SESSION_DATA_TYPE_REMOVE_BROADCAST_INFO_REQUEST = "remove_broadcast_info_request"; + field public static final int SESSION_STATE_ERROR = 3; // 0x3 + field public static final int SESSION_STATE_RUNNING = 2; // 0x2 + field public static final int SESSION_STATE_STOPPED = 1; // 0x1 + } + + public abstract static class TvAdManager.TvAdServiceCallback { + ctor public TvAdManager.TvAdServiceCallback(); + method public void onAdServiceAdded(@NonNull String); + method public void onAdServiceRemoved(@NonNull String); + method public void onAdServiceUpdated(@NonNull String); + } + + @FlaggedApi("android.media.tv.flags.enable_ad_service_fw") public abstract class TvAdService extends android.app.Service { + ctor public TvAdService(); + method public void onAppLinkCommand(@NonNull android.os.Bundle); + method @Nullable public final android.os.IBinder onBind(@Nullable android.content.Intent); + method @Nullable public abstract android.media.tv.ad.TvAdService.Session onCreateSession(@NonNull String, @NonNull String); + field public static final String SERVICE_INTERFACE = "android.media.tv.ad.TvAdService"; + field public static final String SERVICE_META_DATA = "android.media.tv.ad.service"; + } + + public abstract static class TvAdService.Session implements android.view.KeyEvent.Callback { + ctor public TvAdService.Session(@NonNull android.content.Context); + method public boolean isMediaViewEnabled(); + method @CallSuper public void layoutSurface(int, int, int, int); + method @CallSuper public void notifySessionStateChanged(int, int); + method @Nullable public android.view.View onCreateMediaView(); + method public void onCurrentChannelUri(@Nullable android.net.Uri); + method public void onCurrentTvInputId(@Nullable String); + method public void onCurrentVideoBounds(@NonNull android.graphics.Rect); + method public void onError(@NonNull String, @NonNull android.os.Bundle); + method public boolean onGenericMotionEvent(@NonNull android.view.MotionEvent); + method public boolean onKeyDown(int, @Nullable android.view.KeyEvent); + method public boolean onKeyLongPress(int, @Nullable android.view.KeyEvent); + method public boolean onKeyMultiple(int, int, @Nullable android.view.KeyEvent); + method public boolean onKeyUp(int, @Nullable android.view.KeyEvent); + method public void onMediaViewSizeChanged(@Px int, @Px int); + method public abstract void onRelease(); + method public void onResetAdService(); + method public abstract boolean onSetSurface(@Nullable android.view.Surface); + method public void onSigningResult(@NonNull String, @NonNull byte[]); + method public void onStartAdService(); + method public void onStopAdService(); + method public void onSurfaceChanged(int, int, int); + method public boolean onTouchEvent(@NonNull android.view.MotionEvent); + method public void onTrackInfoList(@NonNull java.util.List); + method public boolean onTrackballEvent(@NonNull android.view.MotionEvent); + method public void onTvInputSessionData(@NonNull String, @NonNull android.os.Bundle); + method public void onTvMessage(int, @NonNull android.os.Bundle); + method @CallSuper public void requestCurrentChannelUri(); + method @CallSuper public void requestCurrentTvInputId(); + method @CallSuper public void requestCurrentVideoBounds(); + method @CallSuper public void requestSigning(@NonNull String, @NonNull String, @NonNull String, @NonNull byte[]); + method @CallSuper public void requestTrackInfoList(); + method public void sendTvAdSessionData(@NonNull String, @NonNull android.os.Bundle); + method @CallSuper public void setMediaViewEnabled(boolean); + } + + @FlaggedApi("android.media.tv.flags.enable_ad_service_fw") public final class TvAdServiceInfo implements android.os.Parcelable { + ctor public TvAdServiceInfo(@NonNull android.content.Context, @NonNull android.content.ComponentName); + method public int describeContents(); + method @NonNull public String getId(); + method @Nullable public android.content.pm.ServiceInfo getServiceInfo(); + method @NonNull public java.util.List getSupportedTypes(); + method public void writeToParcel(@NonNull android.os.Parcel, int); + field @NonNull public static final android.os.Parcelable.Creator CREATOR; + } + + @FlaggedApi("android.media.tv.flags.enable_ad_service_fw") public class TvAdView extends android.view.ViewGroup { + ctor public TvAdView(@NonNull android.content.Context); + ctor public TvAdView(@NonNull android.content.Context, @Nullable android.util.AttributeSet); + ctor public TvAdView(@NonNull android.content.Context, @Nullable android.util.AttributeSet, int); + method public void clearCallback(); + method public void clearOnUnhandledInputEventListener(); + method public boolean dispatchUnhandledInputEvent(@NonNull android.view.InputEvent); + method @Nullable public android.media.tv.ad.TvAdView.OnUnhandledInputEventListener getOnUnhandledInputEventListener(); + method public void notifyError(@NonNull String, @NonNull android.os.Bundle); + method public void notifyTvMessage(@NonNull int, @NonNull android.os.Bundle); + method public void onAttachedToWindow(); + method public void onDetachedFromWindow(); + method public void onLayout(boolean, int, int, int, int); + method public void onMeasure(int, int); + method public boolean onUnhandledInputEvent(@NonNull android.view.InputEvent); + method public void onVisibilityChanged(@NonNull android.view.View, int); + method public void prepareAdService(@NonNull String, @NonNull String); + method public void reset(); + method public void resetAdService(); + method public void sendCurrentChannelUri(@Nullable android.net.Uri); + method public void sendCurrentTvInputId(@Nullable String); + method public void sendCurrentVideoBounds(@NonNull android.graphics.Rect); + method public void sendSigningResult(@NonNull String, @NonNull byte[]); + method public void sendTrackInfoList(@Nullable java.util.List); + method public void setCallback(@NonNull java.util.concurrent.Executor, @NonNull android.media.tv.ad.TvAdView.TvAdCallback); + method public void setOnUnhandledInputEventListener(@NonNull java.util.concurrent.Executor, @NonNull android.media.tv.ad.TvAdView.OnUnhandledInputEventListener); + method public boolean setTvView(@Nullable android.media.tv.TvView); + method public void startAdService(); + method public void stopAdService(); + field public static final String ERROR_KEY_ERROR_CODE = "error_code"; + field public static final String ERROR_KEY_METHOD_NAME = "method_name"; + } + + public static interface TvAdView.OnUnhandledInputEventListener { + method public boolean onUnhandledInputEvent(@NonNull android.view.InputEvent); + } + + public abstract static class TvAdView.TvAdCallback { + ctor public TvAdView.TvAdCallback(); + method public void onRequestCurrentChannelUri(@NonNull String); + method public void onRequestCurrentTvInputId(@NonNull String); + method public void onRequestCurrentVideoBounds(@NonNull String); + method public void onRequestSigning(@NonNull String, @NonNull String, @NonNull String, @NonNull String, @NonNull byte[]); + method public void onRequestTrackInfoList(@NonNull String); + method public void onStateChanged(@NonNull String, int, int); } } @@ -27512,6 +28258,7 @@ package android.media.tv.interactive { method public void onAdResponse(@NonNull android.media.tv.AdResponse); method public void onAvailableSpeeds(@NonNull float[]); method public void onBroadcastInfoResponse(@NonNull android.media.tv.BroadcastInfoResponse); + method @FlaggedApi("android.media.tv.flags.tiaf_v_apis") public void onCertificate(@NonNull String, int, @NonNull android.net.http.SslCertificate); method public void onContentAllowed(); method public void onContentBlocked(@NonNull android.media.tv.TvContentRating); method public void onCreateBiInteractiveAppRequest(@NonNull android.net.Uri, @Nullable android.os.Bundle); @@ -27537,6 +28284,7 @@ package android.media.tv.interactive { method public void onRecordingTuned(@NonNull String, @NonNull android.net.Uri); method public abstract void onRelease(); method public void onResetInteractiveApp(); + method @FlaggedApi("android.media.tv.flags.tiaf_v_apis") public void onSelectedTrackInfo(@NonNull java.util.List); method public abstract boolean onSetSurface(@Nullable android.view.Surface); method public void onSetTeletextAppEnabled(boolean); method public void onSignalStrength(int); @@ -27560,18 +28308,22 @@ package android.media.tv.interactive { method public void onTvRecordingInfo(@Nullable android.media.tv.TvRecordingInfo); method public void onTvRecordingInfoList(@NonNull java.util.List); method public void onVideoAvailable(); + method @FlaggedApi("android.media.tv.flags.tiaf_v_apis") public void onVideoFreezeUpdated(boolean); method public void onVideoUnavailable(int); method @CallSuper public void removeBroadcastInfo(int); method @CallSuper public void requestAd(@NonNull android.media.tv.AdRequest); method @CallSuper public void requestAvailableSpeeds(); method @CallSuper public void requestBroadcastInfo(@NonNull android.media.tv.BroadcastInfoRequest); + method @FlaggedApi("android.media.tv.flags.tiaf_v_apis") @CallSuper public void requestCertificate(@NonNull String, int); method @CallSuper public void requestCurrentChannelLcn(); method @CallSuper public void requestCurrentChannelUri(); method @CallSuper public void requestCurrentTvInputId(); method @CallSuper public void requestCurrentVideoBounds(); method @CallSuper public void requestScheduleRecording(@NonNull String, @NonNull String, @NonNull android.net.Uri, @NonNull android.net.Uri, @NonNull android.os.Bundle); method @CallSuper public void requestScheduleRecording(@NonNull String, @NonNull String, @NonNull android.net.Uri, long, long, int, @NonNull android.os.Bundle); + method @FlaggedApi("android.media.tv.flags.tiaf_v_apis") @CallSuper public void requestSelectedTrackInfo(); method @CallSuper public void requestSigning(@NonNull String, @NonNull String, @NonNull String, @NonNull byte[]); + method @FlaggedApi("android.media.tv.flags.tiaf_v_apis") @CallSuper public void requestSigning(@NonNull String, @NonNull String, @NonNull String, int, @NonNull byte[]); method @CallSuper public void requestStartRecording(@NonNull String, @Nullable android.net.Uri); method @CallSuper public void requestStopRecording(@NonNull String); method @CallSuper public void requestStreamVolume(); @@ -27621,6 +28373,7 @@ package android.media.tv.interactive { method public void notifyTimeShiftStartPositionChanged(@NonNull String, long); method public void notifyTimeShiftStatusChanged(@NonNull String, int); method public void notifyTvMessage(@NonNull int, @NonNull android.os.Bundle); + method @FlaggedApi("android.media.tv.flags.tiaf_v_apis") public void notifyVideoFreezeUpdated(boolean); method public void onAttachedToWindow(); method public void onDetachedFromWindow(); method public void onLayout(boolean, int, int, int, int); @@ -27631,10 +28384,12 @@ package android.media.tv.interactive { method public void reset(); method public void resetInteractiveApp(); method public void sendAvailableSpeeds(@NonNull float[]); + method @FlaggedApi("android.media.tv.flags.tiaf_v_apis") public void sendCertificate(@NonNull String, int, @NonNull android.net.http.SslCertificate); method public void sendCurrentChannelLcn(int); method public void sendCurrentChannelUri(@Nullable android.net.Uri); method public void sendCurrentTvInputId(@Nullable String); method public void sendCurrentVideoBounds(@NonNull android.graphics.Rect); + method @FlaggedApi("android.media.tv.flags.tiaf_v_apis") public void sendSelectedTrackInfo(@Nullable java.util.List); method public void sendSigningResult(@NonNull String, @NonNull byte[]); method public void sendStreamVolume(float); method public void sendTimeShiftMode(int); @@ -27664,13 +28419,16 @@ package android.media.tv.interactive { method public void onBiInteractiveAppCreated(@NonNull String, @NonNull android.net.Uri, @Nullable String); method public void onPlaybackCommandRequest(@NonNull String, @NonNull String, @NonNull android.os.Bundle); method public void onRequestAvailableSpeeds(@NonNull String); + method @FlaggedApi("android.media.tv.flags.tiaf_v_apis") public void onRequestCertificate(@NonNull String, @NonNull String, int); method public void onRequestCurrentChannelLcn(@NonNull String); method public void onRequestCurrentChannelUri(@NonNull String); method public void onRequestCurrentTvInputId(@NonNull String); method public void onRequestCurrentVideoBounds(@NonNull String); method public void onRequestScheduleRecording(@NonNull String, @NonNull String, @NonNull String, @NonNull android.net.Uri, @NonNull android.net.Uri, @NonNull android.os.Bundle); method public void onRequestScheduleRecording(@NonNull String, @NonNull String, @NonNull String, @NonNull android.net.Uri, long, long, int, @NonNull android.os.Bundle); + method @FlaggedApi("android.media.tv.flags.tiaf_v_apis") public void onRequestSelectedTrackInfo(@NonNull String); method public void onRequestSigning(@NonNull String, @NonNull String, @NonNull String, @NonNull String, @NonNull byte[]); + method @FlaggedApi("android.media.tv.flags.tiaf_v_apis") public void onRequestSigning(@NonNull String, @NonNull String, @NonNull String, @NonNull String, int, @NonNull byte[]); method public void onRequestStartRecording(@NonNull String, @NonNull String, @Nullable android.net.Uri); method public void onRequestStopRecording(@NonNull String, @NonNull String); method public void onRequestStreamVolume(@NonNull String); @@ -31797,6 +32555,7 @@ package android.os { method public long computeChargeTimeRemaining(); method public int getIntProperty(int); method public long getLongProperty(int); + method @FlaggedApi("android.os.battery_part_status_api") @Nullable public String getStringProperty(int); method public boolean isCharging(); field public static final String ACTION_CHARGING = "android.os.action.CHARGING"; field public static final String ACTION_DISCHARGING = "android.os.action.DISCHARGING"; @@ -32944,26 +33703,29 @@ package android.os { @FlaggedApi("com.android.server.power.optimization.power_monitor_api") public final class PowerMonitorReadings { method @FlaggedApi("com.android.server.power.optimization.power_monitor_api") public long getConsumedEnergy(@NonNull android.os.PowerMonitor); - method @FlaggedApi("com.android.server.power.optimization.power_monitor_api") public long getTimestamp(@NonNull android.os.PowerMonitor); + method @FlaggedApi("com.android.server.power.optimization.power_monitor_api") public long getTimestampMillis(@NonNull android.os.PowerMonitor); field @FlaggedApi("com.android.server.power.optimization.power_monitor_api") public static final int ENERGY_UNAVAILABLE = -1; // 0xffffffff } public class Process { ctor public Process(); + method public static final int getAppUidForSdkSandboxUid(int); method public static final long getElapsedCpuTime(); method public static final int[] getExclusiveCores(); method public static final int getGidForName(String); + method @FlaggedApi("com.android.sdksandbox.flags.sdk_sandbox_uid_to_app_uid_api") public static final int getSdkSandboxUidForAppUid(int); method public static long getStartElapsedRealtime(); method public static long getStartRequestedElapsedRealtime(); method public static long getStartRequestedUptimeMillis(); method public static long getStartUptimeMillis(); - method public static final int getThreadPriority(int) throws java.lang.IllegalArgumentException; + method @IntRange(from=0xffffffec, to=android.os.Process.THREAD_PRIORITY_LOWEST) public static final int getThreadPriority(int) throws java.lang.IllegalArgumentException; method public static final int getUidForName(String); method public static final boolean is64Bit(); method public static boolean isApplicationUid(int); method public static final boolean isIsolated(); method public static final boolean isIsolatedUid(int); method public static final boolean isSdkSandbox(); + method public static final boolean isSdkSandboxUid(int); method public static final void killProcess(int); method public static final int myPid(); method @NonNull public static String myProcessName(); @@ -32971,8 +33733,8 @@ package android.os { method public static final int myUid(); method public static android.os.UserHandle myUserHandle(); method public static final void sendSignal(int, int); - method public static final void setThreadPriority(int, int) throws java.lang.IllegalArgumentException, java.lang.SecurityException; - method public static final void setThreadPriority(int) throws java.lang.IllegalArgumentException, java.lang.SecurityException; + method public static final void setThreadPriority(int, @IntRange(from=0xffffffec, to=android.os.Process.THREAD_PRIORITY_LOWEST) int) throws java.lang.IllegalArgumentException, java.lang.SecurityException; + method public static final void setThreadPriority(@IntRange(from=0xffffffec, to=android.os.Process.THREAD_PRIORITY_LOWEST) int) throws java.lang.IllegalArgumentException, java.lang.SecurityException; method @Deprecated public static final boolean supportsProcesses(); field public static final int BLUETOOTH_UID = 1002; // 0x3ea field public static final int FIRST_APPLICATION_UID = 10000; // 0x2710 @@ -33276,6 +34038,7 @@ package android.os { field public static final String DISALLOW_AIRPLANE_MODE = "no_airplane_mode"; field public static final String DISALLOW_AMBIENT_DISPLAY = "no_ambient_display"; field public static final String DISALLOW_APPS_CONTROL = "no_control_apps"; + field @FlaggedApi("android.app.admin.flags.assist_content_user_restriction_enabled") public static final String DISALLOW_ASSIST_CONTENT = "no_assist_content"; field public static final String DISALLOW_AUTOFILL = "no_autofill"; field public static final String DISALLOW_BLUETOOTH = "no_bluetooth"; field public static final String DISALLOW_BLUETOOTH_SHARING = "no_bluetooth_sharing"; @@ -33324,6 +34087,7 @@ package android.os { field public static final String DISALLOW_SHARE_INTO_MANAGED_PROFILE = "no_sharing_into_profile"; field public static final String DISALLOW_SHARE_LOCATION = "no_share_location"; field public static final String DISALLOW_SHARING_ADMIN_CONFIGURED_WIFI = "no_sharing_admin_configured_wifi"; + field @FlaggedApi("android.app.admin.flags.esim_management_enabled") public static final String DISALLOW_SIM_GLOBALLY = "no_sim_globally"; field public static final String DISALLOW_SMS = "no_sms"; field public static final String DISALLOW_SYSTEM_ERROR_DIALOGS = "no_system_error_dialogs"; field @FlaggedApi("com.android.net.thread.platform.flags.thread_user_restriction_enabled") public static final String DISALLOW_THREAD_NETWORK = "no_thread_network"; @@ -33347,6 +34111,9 @@ package android.os { field public static final int USER_OPERATION_ERROR_MAX_USERS = 6; // 0x6 field public static final int USER_OPERATION_ERROR_UNKNOWN = 1; // 0x1 field public static final int USER_OPERATION_SUCCESS = 0; // 0x0 + field @FlaggedApi("android.os.allow_private_profile") public static final String USER_TYPE_PROFILE_CLONE = "android.os.usertype.profile.CLONE"; + field @FlaggedApi("android.os.allow_private_profile") public static final String USER_TYPE_PROFILE_MANAGED = "android.os.usertype.profile.MANAGED"; + field @FlaggedApi("android.os.allow_private_profile") public static final String USER_TYPE_PROFILE_PRIVATE = "android.os.usertype.profile.PRIVATE"; } public static class UserManager.UserOperationException extends java.lang.RuntimeException { @@ -33454,7 +34221,6 @@ package android.os { @FlaggedApi("android.os.adpf_gpu_report_actual_work_duration") public final class WorkDuration implements android.os.Parcelable { ctor public WorkDuration(); - ctor public WorkDuration(long, long, long, long); method public int describeContents(); method public long getActualCpuDurationNanos(); method public long getActualGpuDurationNanos(); @@ -33537,8 +34303,8 @@ package android.os.health { } public class SystemHealthManager { - method @FlaggedApi("com.android.server.power.optimization.power_monitor_api") public void getPowerMonitorReadings(@NonNull java.util.List, @Nullable android.os.Handler, @NonNull java.util.function.Consumer, @NonNull java.util.function.Consumer); - method @FlaggedApi("com.android.server.power.optimization.power_monitor_api") public void getSupportedPowerMonitors(@Nullable android.os.Handler, @NonNull java.util.function.Consumer>); + method @FlaggedApi("com.android.server.power.optimization.power_monitor_api") public void getPowerMonitorReadings(@NonNull java.util.List, @Nullable java.util.concurrent.Executor, @NonNull android.os.OutcomeReceiver); + method @FlaggedApi("com.android.server.power.optimization.power_monitor_api") public void getSupportedPowerMonitors(@Nullable java.util.concurrent.Executor, @NonNull java.util.function.Consumer>); method public android.os.health.HealthStats takeMyUidSnapshot(); method public android.os.health.HealthStats takeUidSnapshot(int); method public android.os.health.HealthStats[] takeUidSnapshots(int[]); @@ -34959,6 +35725,7 @@ package android.provider { ctor public CallLog.Calls(); method public static String getLastOutgoingCall(android.content.Context); field public static final int ANSWERED_EXTERNALLY_TYPE = 7; // 0x7 + field @FlaggedApi("com.android.server.telecom.flags.business_call_composer") public static final String ASSERTED_DISPLAY_NAME = "asserted_display_name"; field public static final long AUTO_MISSED_EMERGENCY_CALL = 1L; // 0x1L field public static final long AUTO_MISSED_MAXIMUM_DIALING = 4L; // 0x4L field public static final long AUTO_MISSED_MAXIMUM_RINGING = 2L; // 0x2L @@ -35005,6 +35772,7 @@ package android.provider { field public static final int FEATURES_WIFI = 8; // 0x8 field public static final String GEOCODED_LOCATION = "geocoded_location"; field public static final int INCOMING_TYPE = 1; // 0x1 + field @FlaggedApi("com.android.server.telecom.flags.business_call_composer") public static final String IS_BUSINESS_CALL = "is_business_call"; field public static final String IS_READ = "is_read"; field public static final String LAST_MODIFIED = "last_modified"; field public static final String LIMIT_PARAM_KEY = "limit"; @@ -35467,19 +36235,19 @@ package android.provider { field public static final String NAMESPACE = "data2"; } - public static final class ContactsContract.CommonDataKinds.Im implements android.provider.ContactsContract.CommonDataKinds.CommonColumns android.provider.ContactsContract.DataColumnsWithJoins { - method public static CharSequence getProtocolLabel(android.content.res.Resources, int, CharSequence); - method public static int getProtocolLabelResource(int); - method public static CharSequence getTypeLabel(android.content.res.Resources, int, @Nullable CharSequence); - method public static int getTypeLabelResource(int); - field public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/im"; - field public static final String CUSTOM_PROTOCOL = "data6"; + @Deprecated public static final class ContactsContract.CommonDataKinds.Im implements android.provider.ContactsContract.CommonDataKinds.CommonColumns android.provider.ContactsContract.DataColumnsWithJoins { + method @Deprecated public static CharSequence getProtocolLabel(android.content.res.Resources, int, CharSequence); + method @Deprecated public static int getProtocolLabelResource(int); + method @Deprecated public static CharSequence getTypeLabel(android.content.res.Resources, int, @Nullable CharSequence); + method @Deprecated public static int getTypeLabelResource(int); + field @Deprecated public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/im"; + field @Deprecated public static final String CUSTOM_PROTOCOL = "data6"; field public static final String EXTRA_ADDRESS_BOOK_INDEX = "android.provider.extra.ADDRESS_BOOK_INDEX"; field public static final String EXTRA_ADDRESS_BOOK_INDEX_COUNTS = "android.provider.extra.ADDRESS_BOOK_INDEX_COUNTS"; field public static final String EXTRA_ADDRESS_BOOK_INDEX_TITLES = "android.provider.extra.ADDRESS_BOOK_INDEX_TITLES"; - field public static final String PROTOCOL = "data5"; + field @Deprecated public static final String PROTOCOL = "data5"; field @Deprecated public static final int PROTOCOL_AIM = 0; // 0x0 - field public static final int PROTOCOL_CUSTOM = -1; // 0xffffffff + field @Deprecated public static final int PROTOCOL_CUSTOM = -1; // 0xffffffff field @Deprecated public static final int PROTOCOL_GOOGLE_TALK = 5; // 0x5 field @Deprecated public static final int PROTOCOL_ICQ = 6; // 0x6 field @Deprecated public static final int PROTOCOL_JABBER = 7; // 0x7 @@ -35488,9 +36256,9 @@ package android.provider { field @Deprecated public static final int PROTOCOL_QQ = 4; // 0x4 field @Deprecated public static final int PROTOCOL_SKYPE = 3; // 0x3 field @Deprecated public static final int PROTOCOL_YAHOO = 2; // 0x2 - field public static final int TYPE_HOME = 1; // 0x1 - field public static final int TYPE_OTHER = 3; // 0x3 - field public static final int TYPE_WORK = 2; // 0x2 + field @Deprecated public static final int TYPE_HOME = 1; // 0x1 + field @Deprecated public static final int TYPE_OTHER = 3; // 0x3 + field @Deprecated public static final int TYPE_WORK = 2; // 0x2 } public static final class ContactsContract.CommonDataKinds.Nickname implements android.provider.ContactsContract.CommonDataKinds.CommonColumns android.provider.ContactsContract.DataColumnsWithJoins { @@ -35605,17 +36373,17 @@ package android.provider { field public static final int TYPE_SPOUSE = 14; // 0xe } - public static final class ContactsContract.CommonDataKinds.SipAddress implements android.provider.ContactsContract.CommonDataKinds.CommonColumns android.provider.ContactsContract.DataColumnsWithJoins { - method public static CharSequence getTypeLabel(android.content.res.Resources, int, @Nullable CharSequence); - method public static int getTypeLabelResource(int); - field public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/sip_address"; + @Deprecated public static final class ContactsContract.CommonDataKinds.SipAddress implements android.provider.ContactsContract.CommonDataKinds.CommonColumns android.provider.ContactsContract.DataColumnsWithJoins { + method @Deprecated public static CharSequence getTypeLabel(android.content.res.Resources, int, @Nullable CharSequence); + method @Deprecated public static int getTypeLabelResource(int); + field @Deprecated public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/sip_address"; field public static final String EXTRA_ADDRESS_BOOK_INDEX = "android.provider.extra.ADDRESS_BOOK_INDEX"; field public static final String EXTRA_ADDRESS_BOOK_INDEX_COUNTS = "android.provider.extra.ADDRESS_BOOK_INDEX_COUNTS"; field public static final String EXTRA_ADDRESS_BOOK_INDEX_TITLES = "android.provider.extra.ADDRESS_BOOK_INDEX_TITLES"; - field public static final String SIP_ADDRESS = "data1"; - field public static final int TYPE_HOME = 1; // 0x1 - field public static final int TYPE_OTHER = 3; // 0x3 - field public static final int TYPE_WORK = 2; // 0x2 + field @Deprecated public static final String SIP_ADDRESS = "data1"; + field @Deprecated public static final int TYPE_HOME = 1; // 0x1 + field @Deprecated public static final int TYPE_OTHER = 3; // 0x3 + field @Deprecated public static final int TYPE_WORK = 2; // 0x2 } public static final class ContactsContract.CommonDataKinds.StructuredName implements android.provider.ContactsContract.DataColumnsWithJoins { @@ -36353,6 +37121,54 @@ package android.provider { method public final int update(android.net.Uri, android.content.ContentValues, String, String[]); } + @FlaggedApi("android.provider.user_keys") public final class E2eeContactKeysManager { + method @NonNull @RequiresPermission(android.Manifest.permission.READ_CONTACTS) public java.util.List getAllE2eeContactKeys(@NonNull String); + method @NonNull @RequiresPermission(android.Manifest.permission.READ_CONTACTS) public java.util.List getAllE2eeSelfKeys(); + method @Nullable @RequiresPermission(android.Manifest.permission.READ_CONTACTS) public android.provider.E2eeContactKeysManager.E2eeContactKey getE2eeContactKey(@NonNull String, @NonNull String, @NonNull String); + method @Nullable @RequiresPermission(android.Manifest.permission.READ_CONTACTS) public android.provider.E2eeContactKeysManager.E2eeSelfKey getE2eeSelfKey(@NonNull String, @NonNull String); + method public static int getMaxKeySizeBytes(); + method @NonNull @RequiresPermission(android.Manifest.permission.READ_CONTACTS) public java.util.List getOwnerE2eeContactKeys(@NonNull String); + method @NonNull @RequiresPermission(android.Manifest.permission.READ_CONTACTS) public java.util.List getOwnerE2eeSelfKeys(); + method @RequiresPermission(android.Manifest.permission.WRITE_CONTACTS) public boolean removeE2eeContactKey(@NonNull String, @NonNull String, @NonNull String); + method @RequiresPermission(android.Manifest.permission.WRITE_CONTACTS) public boolean removeE2eeSelfKey(@NonNull String, @NonNull String); + method @RequiresPermission(android.Manifest.permission.WRITE_CONTACTS) public boolean updateE2eeContactKeyLocalVerificationState(@NonNull String, @NonNull String, @NonNull String, int); + method @RequiresPermission(android.Manifest.permission.WRITE_CONTACTS) public boolean updateE2eeContactKeyRemoteVerificationState(@NonNull String, @NonNull String, @NonNull String, int); + method @RequiresPermission(android.Manifest.permission.WRITE_CONTACTS) public boolean updateE2eeSelfKeyRemoteVerificationState(@NonNull String, @NonNull String, int); + method @RequiresPermission(android.Manifest.permission.WRITE_CONTACTS) public void updateOrInsertE2eeContactKey(@NonNull String, @NonNull String, @NonNull String, @NonNull byte[]); + method @RequiresPermission(android.Manifest.permission.WRITE_CONTACTS) public boolean updateOrInsertE2eeSelfKey(@NonNull String, @NonNull String, @NonNull byte[]); + field public static final int VERIFICATION_STATE_UNVERIFIED = 0; // 0x0 + field public static final int VERIFICATION_STATE_VERIFICATION_FAILED = 1; // 0x1 + field public static final int VERIFICATION_STATE_VERIFIED = 2; // 0x2 + } + + public static final class E2eeContactKeysManager.E2eeContactKey implements android.os.Parcelable { + method public int describeContents(); + method @NonNull public String getAccountId(); + method @Nullable public String getDeviceId(); + method @Nullable public String getDisplayName(); + method @Nullable public String getEmailAddress(); + method @Nullable public byte[] getKeyValue(); + method public int getLocalVerificationState(); + method @NonNull public String getOwnerPackageName(); + method @Nullable public String getPhoneNumber(); + method public int getRemoteVerificationState(); + method public long getTimeUpdated(); + method public void writeToParcel(@NonNull android.os.Parcel, int); + field @NonNull public static final android.os.Parcelable.Creator CREATOR; + } + + public static final class E2eeContactKeysManager.E2eeSelfKey implements android.os.Parcelable { + method public int describeContents(); + method @NonNull public String getAccountId(); + method @Nullable public String getDeviceId(); + method @Nullable public byte[] getKeyValue(); + method @NonNull public String getOwnerPackageName(); + method public int getRemoteVerificationState(); + method public long getTimeUpdated(); + method public void writeToParcel(@NonNull android.os.Parcel, int); + field @NonNull public static final android.os.Parcelable.Creator CREATOR; + } + @Deprecated public final class FontRequest { ctor @Deprecated public FontRequest(@NonNull String, @NonNull String, @NonNull String); ctor @Deprecated public FontRequest(@NonNull String, @NonNull String, @NonNull String, @NonNull java.util.List>); @@ -36465,6 +37281,7 @@ package android.provider { field public static final String ACTION_APP_USAGE_SETTINGS = "android.settings.action.APP_USAGE_SETTINGS"; field @FlaggedApi("android.app.modes_api") public static final String ACTION_AUTOMATIC_ZEN_RULE_SETTINGS = "android.settings.AUTOMATIC_ZEN_RULE_SETTINGS"; field public static final String ACTION_AUTO_ROTATE_SETTINGS = "android.settings.AUTO_ROTATE_SETTINGS"; + field @FlaggedApi("android.app.app_restrictions_api") public static final String ACTION_BACKGROUND_RESTRICTIONS_SETTINGS = "android.settings.BACKGROUND_RESTRICTIONS_SETTINGS"; field public static final String ACTION_BATTERY_SAVER_SETTINGS = "android.settings.BATTERY_SAVER_SETTINGS"; field public static final String ACTION_BIOMETRIC_ENROLL = "android.settings.BIOMETRIC_ENROLL"; field public static final String ACTION_BLUETOOTH_SETTINGS = "android.settings.BLUETOOTH_SETTINGS"; @@ -36519,8 +37336,10 @@ package android.provider { field public static final String ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS = "android.settings.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS"; field public static final String ACTION_REQUEST_MANAGE_MEDIA = "android.settings.REQUEST_MANAGE_MEDIA"; field @FlaggedApi("com.android.media.flags.enable_privileged_routing_for_media_routing_control") public static final String ACTION_REQUEST_MEDIA_ROUTING_CONTROL = "android.settings.REQUEST_MEDIA_ROUTING_CONTROL"; + field @FlaggedApi("android.provider.backup_tasks_settings_screen") public static final String ACTION_REQUEST_RUN_BACKUP_JOBS = "android.settings.REQUEST_RUN_BACKUP_JOBS"; field public static final String ACTION_REQUEST_SCHEDULE_EXACT_ALARM = "android.settings.REQUEST_SCHEDULE_EXACT_ALARM"; field public static final String ACTION_REQUEST_SET_AUTOFILL_SERVICE = "android.settings.REQUEST_SET_AUTOFILL_SERVICE"; + field @FlaggedApi("com.android.internal.telephony.flags.carrier_enabled_satellite_flag") public static final String ACTION_SATELLITE_SETTING = "android.settings.SATELLITE_SETTING"; field public static final String ACTION_SEARCH_SETTINGS = "android.search.action.SEARCH_SETTINGS"; field public static final String ACTION_SECURITY_SETTINGS = "android.settings.SECURITY_SETTINGS"; field public static final String ACTION_SETTINGS = "android.settings.SETTINGS"; @@ -39655,6 +40474,21 @@ package android.service.carrier { package android.service.chooser { + @FlaggedApi("android.service.chooser.chooser_payload_toggling") public interface AdditionalContentContract { + } + + public static interface AdditionalContentContract.Columns { + field public static final String URI = "uri"; + } + + public static interface AdditionalContentContract.CursorExtraKeys { + field public static final String POSITION = "position"; + } + + public static interface AdditionalContentContract.MethodNames { + field public static final String ON_SELECTION_CHANGED = "onSelectionChanged"; + } + public final class ChooserAction implements android.os.Parcelable { method public int describeContents(); method @NonNull public android.app.PendingIntent getAction(); @@ -39669,6 +40503,19 @@ package android.service.chooser { method @NonNull public android.service.chooser.ChooserAction build(); } + @FlaggedApi("android.service.chooser.enable_chooser_result") public final class ChooserResult implements android.os.Parcelable { + method public int describeContents(); + method @Nullable public android.content.ComponentName getSelectedComponent(); + method public int getType(); + method public boolean isShortcut(); + method public void writeToParcel(@NonNull android.os.Parcel, int); + field public static final int CHOOSER_RESULT_COPY = 1; // 0x1 + field public static final int CHOOSER_RESULT_EDIT = 2; // 0x2 + field public static final int CHOOSER_RESULT_SELECTED_COMPONENT = 0; // 0x0 + field public static final int CHOOSER_RESULT_UNKNOWN = -1; // 0xffffffff + field @NonNull public static final android.os.Parcelable.Creator CREATOR; + } + @Deprecated public final class ChooserTarget implements android.os.Parcelable { ctor @Deprecated public ChooserTarget(CharSequence, android.graphics.drawable.Icon, float, android.content.ComponentName, @Nullable android.os.Bundle); method @Deprecated public int describeContents(); @@ -40464,7 +41311,6 @@ package android.service.notification { public final class ZenPolicy implements android.os.Parcelable { method public int describeContents(); - method @FlaggedApi("android.app.modes_api") public int getAllowedChannels(); method public int getPriorityCallSenders(); method public int getPriorityCategoryAlarms(); method public int getPriorityCategoryCalls(); @@ -40475,6 +41321,7 @@ package android.service.notification { method public int getPriorityCategoryReminders(); method public int getPriorityCategoryRepeatCallers(); method public int getPriorityCategorySystem(); + method @FlaggedApi("android.app.modes_api") public int getPriorityChannelsAllowed(); method public int getPriorityConversationSenders(); method public int getPriorityMessageSenders(); method public int getVisualEffectAmbient(); @@ -40485,9 +41332,6 @@ package android.service.notification { method public int getVisualEffectPeek(); method public int getVisualEffectStatusBar(); method public void writeToParcel(android.os.Parcel, int); - field @FlaggedApi("android.app.modes_api") public static final int CHANNEL_TYPE_NONE = 2; // 0x2 - field @FlaggedApi("android.app.modes_api") public static final int CHANNEL_TYPE_PRIORITY = 1; // 0x1 - field @FlaggedApi("android.app.modes_api") public static final int CHANNEL_TYPE_UNSET = 0; // 0x0 field public static final int CONVERSATION_SENDERS_ANYONE = 1; // 0x1 field public static final int CONVERSATION_SENDERS_IMPORTANT = 2; // 0x2 field public static final int CONVERSATION_SENDERS_NONE = 3; // 0x3 @@ -40508,11 +41352,11 @@ package android.service.notification { method @NonNull public android.service.notification.ZenPolicy.Builder allowAlarms(boolean); method @NonNull public android.service.notification.ZenPolicy.Builder allowAllSounds(); method @NonNull public android.service.notification.ZenPolicy.Builder allowCalls(int); - method @FlaggedApi("android.app.modes_api") @NonNull public android.service.notification.ZenPolicy.Builder allowChannels(int); method @NonNull public android.service.notification.ZenPolicy.Builder allowConversations(int); method @NonNull public android.service.notification.ZenPolicy.Builder allowEvents(boolean); method @NonNull public android.service.notification.ZenPolicy.Builder allowMedia(boolean); method @NonNull public android.service.notification.ZenPolicy.Builder allowMessages(int); + method @FlaggedApi("android.app.modes_api") @NonNull public android.service.notification.ZenPolicy.Builder allowPriorityChannels(boolean); method @NonNull public android.service.notification.ZenPolicy.Builder allowReminders(boolean); method @NonNull public android.service.notification.ZenPolicy.Builder allowRepeatCallers(boolean); method @NonNull public android.service.notification.ZenPolicy.Builder allowSystem(boolean); @@ -40531,6 +41375,14 @@ package android.service.notification { } +package android.service.persistentdata { + + @FlaggedApi("android.security.frp_enforcement") public class PersistentDataBlockManager { + method @FlaggedApi("android.security.frp_enforcement") public boolean isFactoryResetProtectionActive(); + } + +} + package android.service.quickaccesswallet { public interface GetWalletCardsCallback { @@ -40796,6 +41648,7 @@ package android.service.voice { method public void startAssistantActivity(@NonNull android.content.Intent, @NonNull android.os.Bundle); method public void startVoiceActivity(android.content.Intent); method public final void unregisterVisibleActivityCallback(@NonNull android.service.voice.VoiceInteractionSession.VisibleActivityCallback); + field @FlaggedApi("android.service.voice.flags.allow_foreground_activities_in_on_show") public static final String KEY_FOREGROUND_ACTIVITIES = "android.service.voice.FOREGROUND_ACTIVITIES"; field public static final String KEY_SHOW_SESSION_ID = "android.service.voice.SHOW_SESSION_ID"; field public static final int SHOW_SOURCE_ACTIVITY = 16; // 0x10 field public static final int SHOW_SOURCE_APPLICATION = 8; // 0x8 @@ -41094,6 +41947,8 @@ package android.speech { field public static final String EXTRA_LANGUAGE_MODEL = "android.speech.extra.LANGUAGE_MODEL"; field public static final String EXTRA_LANGUAGE_PREFERENCE = "android.speech.extra.LANGUAGE_PREFERENCE"; field public static final String EXTRA_LANGUAGE_SWITCH_ALLOWED_LANGUAGES = "android.speech.extra.LANGUAGE_SWITCH_ALLOWED_LANGUAGES"; + field @FlaggedApi("android.speech.flags.multilang_extra_launch") public static final String EXTRA_LANGUAGE_SWITCH_INITIAL_ACTIVE_DURATION_TIME_MILLIS = "android.speech.extra.LANGUAGE_SWITCH_INITIAL_ACTIVE_DURATION_TIME_MILLIS"; + field @FlaggedApi("android.speech.flags.multilang_extra_launch") public static final String EXTRA_LANGUAGE_SWITCH_MAX_SWITCHES = "android.speech.extra.LANGUAGE_SWITCH_MAX_SWITCHES"; field public static final String EXTRA_MASK_OFFENSIVE_WORDS = "android.speech.extra.MASK_OFFENSIVE_WORDS"; field public static final String EXTRA_MAX_RESULTS = "android.speech.extra.MAX_RESULTS"; field public static final String EXTRA_ONLY_RETURN_LANGUAGE_PREFERENCE = "android.speech.extra.ONLY_RETURN_LANGUAGE_PREFERENCE"; @@ -41425,8 +42280,10 @@ package android.telecom { field @Deprecated public static final String AVAILABLE_PHONE_ACCOUNTS = "selectPhoneAccountAccounts"; field public static final String EVENT_CLEAR_DIAGNOSTIC_MESSAGE = "android.telecom.event.CLEAR_DIAGNOSTIC_MESSAGE"; field public static final String EVENT_DISPLAY_DIAGNOSTIC_MESSAGE = "android.telecom.event.DISPLAY_DIAGNOSTIC_MESSAGE"; + field @FlaggedApi("com.android.server.telecom.flags.business_call_composer") public static final String EXTRA_ASSERTED_DISPLAY_NAME = "android.telecom.extra.ASSERTED_DISPLAY_NAME"; field public static final String EXTRA_DIAGNOSTIC_MESSAGE = "android.telecom.extra.DIAGNOSTIC_MESSAGE"; field public static final String EXTRA_DIAGNOSTIC_MESSAGE_ID = "android.telecom.extra.DIAGNOSTIC_MESSAGE_ID"; + field @FlaggedApi("com.android.server.telecom.flags.business_call_composer") public static final String EXTRA_IS_BUSINESS_CALL = "android.telecom.extra.IS_BUSINESS_CALL"; field public static final String EXTRA_IS_SUPPRESSED_BY_DO_NOT_DISTURB = "android.telecom.extra.IS_SUPPRESSED_BY_DO_NOT_DISTURB"; field public static final String EXTRA_LAST_EMERGENCY_CALLBACK_TIME_MILLIS = "android.telecom.extra.LAST_EMERGENCY_CALLBACK_TIME_MILLIS"; field public static final String EXTRA_SILENT_RINGING_REQUESTED = "android.telecom.extra.SILENT_RINGING_REQUESTED"; @@ -41569,6 +42426,7 @@ package android.telecom { field public static final int SUPPORTS_SET_INACTIVE = 2; // 0x2 field public static final int SUPPORTS_STREAM = 4; // 0x4 field public static final int SUPPORTS_TRANSFER = 8; // 0x8 + field @FlaggedApi("com.android.server.telecom.flags.transactional_video_state") public static final int SUPPORTS_VIDEO_CALLING = 16; // 0x10 field public static final int VIDEO_CALL = 2; // 0x2 } @@ -41603,6 +42461,8 @@ package android.telecom { method public void disconnect(@NonNull android.telecom.DisconnectCause, @NonNull java.util.concurrent.Executor, @NonNull android.os.OutcomeReceiver); method @NonNull public android.os.ParcelUuid getCallId(); method public void requestCallEndpointChange(@NonNull android.telecom.CallEndpoint, @NonNull java.util.concurrent.Executor, @NonNull android.os.OutcomeReceiver); + method @FlaggedApi("com.android.server.telecom.flags.set_mute_state") public void requestMuteState(boolean, @NonNull java.util.concurrent.Executor, @NonNull android.os.OutcomeReceiver); + method @FlaggedApi("com.android.server.telecom.flags.transactional_video_state") public void requestVideoState(int, @NonNull java.util.concurrent.Executor, @NonNull android.os.OutcomeReceiver); method public void sendEvent(@NonNull String, @NonNull android.os.Bundle); method public void setActive(@NonNull java.util.concurrent.Executor, @NonNull android.os.OutcomeReceiver); method public void setInactive(@NonNull java.util.concurrent.Executor, @NonNull android.os.OutcomeReceiver); @@ -41651,6 +42511,7 @@ package android.telecom { method public void onCallStreamingFailed(int); method public void onEvent(@NonNull String, @NonNull android.os.Bundle); method public void onMuteStateChanged(boolean); + method @FlaggedApi("com.android.server.telecom.flags.transactional_video_state") public default void onVideoStateChanged(int); } public final class CallException extends java.lang.RuntimeException implements android.os.Parcelable { @@ -42039,6 +42900,8 @@ package android.telecom { method public void onConference(android.telecom.Connection, android.telecom.Connection); method public void onConnectionServiceFocusGained(); method public void onConnectionServiceFocusLost(); + method @FlaggedApi("com.android.server.telecom.flags.telecom_resolve_hidden_dependencies") public void onCreateConferenceComplete(@NonNull android.telecom.Conference); + method @FlaggedApi("com.android.server.telecom.flags.telecom_resolve_hidden_dependencies") public void onCreateConnectionComplete(@NonNull android.telecom.Connection); method @Nullable public android.telecom.Conference onCreateIncomingConference(@NonNull android.telecom.PhoneAccountHandle, @NonNull android.telecom.ConnectionRequest); method public void onCreateIncomingConferenceFailed(@Nullable android.telecom.PhoneAccountHandle, @Nullable android.telecom.ConnectionRequest); method public android.telecom.Connection onCreateIncomingConnection(android.telecom.PhoneAccountHandle, android.telecom.ConnectionRequest); @@ -42161,9 +43024,11 @@ package android.telecom { method public android.graphics.drawable.Icon getIcon(); method public CharSequence getLabel(); method public CharSequence getShortDescription(); + method @FlaggedApi("com.android.internal.telephony.flags.simultaneous_calling_indications") @NonNull public java.util.Set getSimultaneousCallingRestriction(); method public android.net.Uri getSubscriptionAddress(); method public java.util.List getSupportedUriSchemes(); method public boolean hasCapabilities(int); + method @FlaggedApi("com.android.internal.telephony.flags.simultaneous_calling_indications") public boolean hasSimultaneousCallingRestriction(); method public boolean isEnabled(); method public boolean supportsUriScheme(String); method public android.telecom.PhoneAccount.Builder toBuilder(); @@ -42204,12 +43069,14 @@ package android.telecom { ctor public PhoneAccount.Builder(android.telecom.PhoneAccount); method public android.telecom.PhoneAccount.Builder addSupportedUriScheme(String); method public android.telecom.PhoneAccount build(); + method @FlaggedApi("com.android.internal.telephony.flags.simultaneous_calling_indications") @NonNull public android.telecom.PhoneAccount.Builder clearSimultaneousCallingRestriction(); method public android.telecom.PhoneAccount.Builder setAddress(android.net.Uri); method public android.telecom.PhoneAccount.Builder setCapabilities(int); method public android.telecom.PhoneAccount.Builder setExtras(android.os.Bundle); method public android.telecom.PhoneAccount.Builder setHighlightColor(int); method public android.telecom.PhoneAccount.Builder setIcon(android.graphics.drawable.Icon); method public android.telecom.PhoneAccount.Builder setShortDescription(CharSequence); + method @FlaggedApi("com.android.internal.telephony.flags.simultaneous_calling_indications") @NonNull public android.telecom.PhoneAccount.Builder setSimultaneousCallingRestriction(@NonNull java.util.Set); method public android.telecom.PhoneAccount.Builder setSubscriptionAddress(android.net.Uri); method public android.telecom.PhoneAccount.Builder setSupportedUriSchemes(java.util.List); } @@ -42395,11 +43262,13 @@ package android.telecom { method @Deprecated @RequiresPermission(android.Manifest.permission.ANSWER_PHONE_CALLS) public boolean endCall(); method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public android.net.Uri getAdnUriForPhoneAccount(android.telecom.PhoneAccountHandle); method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public java.util.List getCallCapablePhoneAccounts(); + method @FlaggedApi("com.android.internal.telephony.flags.work_profile_api_split") @NonNull @RequiresPermission(allOf={android.Manifest.permission.READ_PHONE_STATE, android.Manifest.permission.INTERACT_ACROSS_PROFILES}) public java.util.List getCallCapablePhoneAccountsAcrossProfiles(); method public String getDefaultDialerPackage(); method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public android.telecom.PhoneAccountHandle getDefaultOutgoingPhoneAccount(String); method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.READ_PHONE_STATE, android.Manifest.permission.READ_SMS, android.Manifest.permission.READ_PHONE_NUMBERS}, conditional=true) public String getLine1Number(android.telecom.PhoneAccountHandle); method @NonNull @RequiresPermission(android.Manifest.permission.MANAGE_OWN_CALLS) public java.util.List getOwnSelfManagedPhoneAccounts(); method public android.telecom.PhoneAccount getPhoneAccount(android.telecom.PhoneAccountHandle); + method @FlaggedApi("com.android.server.telecom.flags.get_registered_phone_accounts") @NonNull public java.util.List getRegisteredPhoneAccounts(); method @NonNull @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public java.util.List getSelfManagedPhoneAccounts(); method public android.telecom.PhoneAccountHandle getSimCallManager(); method @Nullable public android.telecom.PhoneAccountHandle getSimCallManagerForSubscription(int); @@ -42870,6 +43739,7 @@ package android.telephony { field public static final String KEY_CDMA_NONROAMING_NETWORKS_STRING_ARRAY = "cdma_nonroaming_networks_string_array"; field public static final String KEY_CDMA_ROAMING_MODE_INT = "cdma_roaming_mode_int"; field public static final String KEY_CDMA_ROAMING_NETWORKS_STRING_ARRAY = "cdma_roaming_networks_string_array"; + field @FlaggedApi("com.android.internal.telephony.flags.data_only_cellular_service") public static final String KEY_CELLULAR_SERVICE_CAPABILITIES_INT_ARRAY = "cellular_service_capabilities_int_array"; field public static final String KEY_CELLULAR_USAGE_SETTING_INT = "cellular_usage_setting_int"; field public static final String KEY_CHECK_PRICING_WITH_CARRIER_FOR_DATA_ROAMING_BOOL = "check_pricing_with_carrier_data_roaming_bool"; field public static final String KEY_CI_ACTION_ON_SYS_UPDATE_BOOL = "ci_action_on_sys_update_bool"; @@ -42996,6 +43866,7 @@ package android.telephony { field @FlaggedApi("com.android.internal.telephony.flags.carrier_enabled_satellite_flag") public static final String KEY_PARAMETERS_USED_FOR_NTN_LTE_SIGNAL_BAR_INT = "parameters_used_for_ntn_lte_signal_bar_int"; field public static final String KEY_PING_TEST_BEFORE_DATA_SWITCH_BOOL = "ping_test_before_data_switch_bool"; field public static final String KEY_PREFER_2G_BOOL = "prefer_2g_bool"; + field @FlaggedApi("com.android.internal.telephony.flags.hide_prefer_3g_item") public static final String KEY_PREFER_3G_VISIBILITY_BOOL = "prefer_3g_visibility_bool"; field public static final String KEY_PREMIUM_CAPABILITY_MAXIMUM_DAILY_NOTIFICATION_COUNT_INT = "premium_capability_maximum_daily_notification_count_int"; field public static final String KEY_PREMIUM_CAPABILITY_MAXIMUM_MONTHLY_NOTIFICATION_COUNT_INT = "premium_capability_maximum_monthly_notification_count_int"; field public static final String KEY_PREMIUM_CAPABILITY_NETWORK_SETUP_TIME_MILLIS_LONG = "premium_capability_network_setup_time_millis_long"; @@ -43021,6 +43892,8 @@ package android.telephony { field public static final String KEY_RTT_UPGRADE_SUPPORTED_FOR_DOWNGRADED_VT_CALL_BOOL = "rtt_upgrade_supported_for_downgraded_vt_call"; field @FlaggedApi("com.android.internal.telephony.flags.carrier_enabled_satellite_flag") public static final String KEY_SATELLITE_ATTACH_SUPPORTED_BOOL = "satellite_attach_supported_bool"; field @FlaggedApi("com.android.internal.telephony.flags.carrier_enabled_satellite_flag") public static final String KEY_SATELLITE_CONNECTION_HYSTERESIS_SEC_INT = "satellite_connection_hysteresis_sec_int"; + field @FlaggedApi("com.android.internal.telephony.flags.carrier_enabled_satellite_flag") public static final String KEY_SATELLITE_ENTITLEMENT_STATUS_REFRESH_DAYS_INT = "satellite_entitlement_status_refresh_days_int"; + field @FlaggedApi("com.android.internal.telephony.flags.carrier_enabled_satellite_flag") public static final String KEY_SATELLITE_ENTITLEMENT_SUPPORTED_BOOL = "satellite_entitlement_supported_bool"; field public static final String KEY_SHOW_4G_FOR_3G_DATA_ICON_BOOL = "show_4g_for_3g_data_icon_bool"; field public static final String KEY_SHOW_4G_FOR_LTE_DATA_ICON_BOOL = "show_4g_for_lte_data_icon_bool"; field public static final String KEY_SHOW_APN_SETTING_CDMA_BOOL = "show_apn_setting_cdma_bool"; @@ -43042,6 +43915,7 @@ package android.telephony { field public static final String KEY_SMS_REQUIRES_DESTINATION_NUMBER_CONVERSION_BOOL = "sms_requires_destination_number_conversion_bool"; field public static final String KEY_SUBSCRIPTION_GROUP_UUID_STRING = "subscription_group_uuid_string"; field public static final String KEY_SUPPORTED_PREMIUM_CAPABILITIES_INT_ARRAY = "supported_premium_capabilities_int_array"; + field @FlaggedApi("com.android.server.telecom.flags.business_call_composer") public static final String KEY_SUPPORTS_BUSINESS_CALL_COMPOSER_BOOL = "supports_business_call_composer_bool"; field public static final String KEY_SUPPORTS_CALL_COMPOSER_BOOL = "supports_call_composer_bool"; field public static final String KEY_SUPPORTS_DEVICE_TO_DEVICE_COMMUNICATION_USING_DTMF_BOOL = "supports_device_to_device_communication_using_dtmf_bool"; field public static final String KEY_SUPPORTS_DEVICE_TO_DEVICE_COMMUNICATION_USING_RTP_BOOL = "supports_device_to_device_communication_using_rtp_bool"; @@ -43197,13 +44071,44 @@ package android.telephony { } public static final class CarrierConfigManager.ImsEmergency { + field @FlaggedApi("com.android.internal.telephony.flags.use_oem_domain_selection_service") public static final int DOMAIN_CS = 1; // 0x1 + field @FlaggedApi("com.android.internal.telephony.flags.use_oem_domain_selection_service") public static final int DOMAIN_PS_3GPP = 2; // 0x2 + field @FlaggedApi("com.android.internal.telephony.flags.use_oem_domain_selection_service") public static final int DOMAIN_PS_NON_3GPP = 3; // 0x3 + field @FlaggedApi("com.android.internal.telephony.flags.use_oem_domain_selection_service") public static final String KEY_CROSS_STACK_REDIAL_TIMER_SEC_INT = "imsemergency.cross_stack_redial_timer_sec_int"; field public static final String KEY_EMERGENCY_CALLBACK_MODE_SUPPORTED_BOOL = "imsemergency.emergency_callback_mode_supported_bool"; + field @FlaggedApi("com.android.internal.telephony.flags.use_oem_domain_selection_service") public static final String KEY_EMERGENCY_CALL_SETUP_TIMER_ON_CURRENT_NETWORK_SEC_INT = "imsemergency.emergency_call_setup_timer_on_current_network_sec_int"; + field @FlaggedApi("com.android.internal.telephony.flags.use_oem_domain_selection_service") public static final String KEY_EMERGENCY_CDMA_PREFERRED_NUMBERS_STRING_ARRAY = "imsemergency.emergency_cdma_preferred_numbers_string_array"; + field @FlaggedApi("com.android.internal.telephony.flags.use_oem_domain_selection_service") public static final String KEY_EMERGENCY_DOMAIN_PREFERENCE_INT_ARRAY = "imsemergency.emergency_domain_preference_int_array"; + field @FlaggedApi("com.android.internal.telephony.flags.use_oem_domain_selection_service") public static final String KEY_EMERGENCY_DOMAIN_PREFERENCE_ROAMING_INT_ARRAY = "imsemergency.emergency_domain_preference_roaming_int_array"; + field @FlaggedApi("com.android.internal.telephony.flags.use_oem_domain_selection_service") public static final String KEY_EMERGENCY_LTE_PREFERRED_AFTER_NR_FAILED_BOOL = "imsemergency.emergency_lte_preferred_after_nr_failed_bool"; + field @FlaggedApi("com.android.internal.telephony.flags.use_oem_domain_selection_service") public static final String KEY_EMERGENCY_NETWORK_SCAN_TYPE_INT = "imsemergency.emergency_network_scan_type_int"; + field @FlaggedApi("com.android.internal.telephony.flags.use_oem_domain_selection_service") public static final String KEY_EMERGENCY_OVER_CS_ROAMING_SUPPORTED_ACCESS_NETWORK_TYPES_INT_ARRAY = "imsemergency.emergency_over_cs_roaming_supported_access_network_types_int_array"; + field @FlaggedApi("com.android.internal.telephony.flags.use_oem_domain_selection_service") public static final String KEY_EMERGENCY_OVER_CS_SUPPORTED_ACCESS_NETWORK_TYPES_INT_ARRAY = "imsemergency.emergency_over_cs_supported_access_network_types_int_array"; + field @FlaggedApi("com.android.internal.telephony.flags.use_oem_domain_selection_service") public static final String KEY_EMERGENCY_OVER_IMS_ROAMING_SUPPORTED_3GPP_NETWORK_TYPES_INT_ARRAY = "imsemergency.emergency_over_ims_roaming_supported_3gpp_network_types_int_array"; + field @FlaggedApi("com.android.internal.telephony.flags.use_oem_domain_selection_service") public static final String KEY_EMERGENCY_OVER_IMS_SUPPORTED_3GPP_NETWORK_TYPES_INT_ARRAY = "imsemergency.emergency_over_ims_supported_3gpp_network_types_int_array"; field public static final String KEY_EMERGENCY_OVER_IMS_SUPPORTED_RATS_INT_ARRAY = "imsemergency.emergency_over_ims_supported_rats_int_array"; field public static final String KEY_EMERGENCY_QOS_PRECONDITION_SUPPORTED_BOOL = "imsemergency.emergency_qos_precondition_supported_bool"; field public static final String KEY_EMERGENCY_REGISTRATION_TIMER_MILLIS_INT = "imsemergency.emergency_registration_timer_millis_int"; + field @FlaggedApi("com.android.internal.telephony.flags.use_oem_domain_selection_service") public static final String KEY_EMERGENCY_REQUIRES_IMS_REGISTRATION_BOOL = "imsemergency.emergency_requires_ims_registration_bool"; + field @FlaggedApi("com.android.internal.telephony.flags.use_oem_domain_selection_service") public static final String KEY_EMERGENCY_REQUIRES_VOLTE_ENABLED_BOOL = "imsemergency.emergency_requires_volte_enabled_bool"; + field @FlaggedApi("com.android.internal.telephony.flags.use_oem_domain_selection_service") public static final String KEY_EMERGENCY_SCAN_TIMER_SEC_INT = "imsemergency.emergency_scan_timer_sec_int"; + field @FlaggedApi("com.android.internal.telephony.flags.use_oem_domain_selection_service") public static final String KEY_EMERGENCY_VOWIFI_REQUIRES_CONDITION_INT = "imsemergency.emergency_vowifi_requires_condition_int"; + field @FlaggedApi("com.android.internal.telephony.flags.use_oem_domain_selection_service") public static final String KEY_MAXIMUM_CELLULAR_SEARCH_TIMER_SEC_INT = "imsemergency.maximum_cellular_search_timer_sec_int"; + field @FlaggedApi("com.android.internal.telephony.flags.use_oem_domain_selection_service") public static final String KEY_MAXIMUM_NUMBER_OF_EMERGENCY_TRIES_OVER_VOWIFI_INT = "imsemergency.maximum_number_of_emergency_tries_over_vowifi_int"; + field @FlaggedApi("com.android.internal.telephony.flags.use_oem_domain_selection_service") public static final String KEY_PREFER_IMS_EMERGENCY_WHEN_VOICE_CALLS_ON_CS_BOOL = "imsemergency.prefer_ims_emergency_when_voice_calls_on_cs_bool"; field public static final String KEY_PREFIX = "imsemergency."; + field @FlaggedApi("com.android.internal.telephony.flags.use_oem_domain_selection_service") public static final String KEY_QUICK_CROSS_STACK_REDIAL_TIMER_SEC_INT = "imsemergency.quick_cross_stack_redial_timer_sec_int"; field public static final String KEY_REFRESH_GEOLOCATION_TIMEOUT_MILLIS_INT = "imsemergency.refresh_geolocation_timeout_millis_int"; field public static final String KEY_RETRY_EMERGENCY_ON_IMS_PDN_BOOL = "imsemergency.retry_emergency_on_ims_pdn_bool"; + field @FlaggedApi("com.android.internal.telephony.flags.use_oem_domain_selection_service") public static final String KEY_SCAN_LIMITED_SERVICE_AFTER_VOLTE_FAILURE_BOOL = "imsemergency.scan_limited_service_after_volte_failure_bool"; + field @FlaggedApi("com.android.internal.telephony.flags.use_oem_domain_selection_service") public static final String KEY_START_QUICK_CROSS_STACK_REDIAL_TIMER_WHEN_REGISTERED_BOOL = "imsemergency.start_quick_cross_stack_redial_timer_when_registered_bool"; + field @FlaggedApi("com.android.internal.telephony.flags.use_oem_domain_selection_service") public static final int REDIAL_TIMER_DISABLED = 0; // 0x0 + field @FlaggedApi("com.android.internal.telephony.flags.use_oem_domain_selection_service") public static final int SCAN_TYPE_FULL_SERVICE = 1; // 0x1 + field @FlaggedApi("com.android.internal.telephony.flags.use_oem_domain_selection_service") public static final int SCAN_TYPE_FULL_SERVICE_FOLLOWED_BY_LIMITED_SERVICE = 2; // 0x2 + field @FlaggedApi("com.android.internal.telephony.flags.use_oem_domain_selection_service") public static final int SCAN_TYPE_NO_PREFERENCE = 0; // 0x0 + field @FlaggedApi("com.android.internal.telephony.flags.use_oem_domain_selection_service") public static final int VOWIFI_REQUIRES_NONE = 0; // 0x0 + field @FlaggedApi("com.android.internal.telephony.flags.use_oem_domain_selection_service") public static final int VOWIFI_REQUIRES_SETTING_ENABLED = 1; // 0x1 + field @FlaggedApi("com.android.internal.telephony.flags.use_oem_domain_selection_service") public static final int VOWIFI_REQUIRES_VALID_EID = 2; // 0x2 } public static final class CarrierConfigManager.ImsRtt { @@ -44275,6 +45180,7 @@ package android.telephony { method @Nullable public android.telephony.CellIdentity getCellIdentity(); method public int getDomain(); method @Nullable public String getRegisteredPlmn(); + method @FlaggedApi("com.android.internal.telephony.flags.network_registration_info_reject_cause") public int getRejectCause(); method public int getTransportType(); method public boolean isNetworkRegistered(); method public boolean isNetworkRoaming(); @@ -44864,6 +45770,7 @@ package android.telephony { method @Nullable public String getMncString(); method @Deprecated public String getNumber(); method public int getPortIndex(); + method @FlaggedApi("com.android.internal.telephony.flags.data_only_cellular_service") @NonNull public java.util.Set getServiceCapabilities(); method public int getSimSlotIndex(); method public int getSubscriptionId(); method public int getSubscriptionType(); @@ -44881,16 +45788,16 @@ package android.telephony { method public void addOnSubscriptionsChangedListener(@NonNull java.util.concurrent.Executor, @NonNull android.telephony.SubscriptionManager.OnSubscriptionsChangedListener); method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void addSubscriptionsIntoGroup(@NonNull java.util.List, @NonNull android.os.ParcelUuid); method public boolean canManageSubscription(android.telephony.SubscriptionInfo); - method @FlaggedApi("com.android.internal.telephony.flags.work_profile_api_split") @NonNull public android.telephony.SubscriptionManager createForAllUserProfiles(); + method @FlaggedApi("com.android.internal.telephony.flags.enforce_subscription_user_filter") @NonNull @RequiresPermission(android.Manifest.permission.INTERACT_ACROSS_PROFILES) public android.telephony.SubscriptionManager createForAllUserProfiles(); method @NonNull @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public android.os.ParcelUuid createSubscriptionGroup(@NonNull java.util.List); method @Deprecated public static android.telephony.SubscriptionManager from(android.content.Context); - method public java.util.List getAccessibleSubscriptionInfoList(); + method @Nullable public java.util.List getAccessibleSubscriptionInfoList(); method public static int getActiveDataSubscriptionId(); method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public android.telephony.SubscriptionInfo getActiveSubscriptionInfo(int); method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public int getActiveSubscriptionInfoCount(); method public int getActiveSubscriptionInfoCountMax(); method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public android.telephony.SubscriptionInfo getActiveSubscriptionInfoForSimSlotIndex(int); - method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public java.util.List getActiveSubscriptionInfoList(); + method @Nullable @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public java.util.List getActiveSubscriptionInfoList(); method @NonNull @RequiresPermission(anyOf={android.Manifest.permission.READ_PHONE_STATE, "carrier privileges"}) public java.util.List getAllSubscriptionInfoList(); method @NonNull public java.util.List getCompleteActiveSubscriptionInfoList(); method public static int getDefaultDataSubscriptionId(); @@ -44909,6 +45816,7 @@ package android.telephony { method @NonNull @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public java.util.List getSubscriptionsInGroup(@NonNull android.os.ParcelUuid); method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public boolean isActiveSubscriptionId(int); method public boolean isNetworkRoaming(int); + method @FlaggedApi("com.android.internal.telephony.flags.subscription_user_association_query") @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public boolean isSubscriptionAssociatedWithUser(int); method public static boolean isUsableSubscriptionId(int); method public static boolean isValidSubscriptionId(int); method public void removeOnOpportunisticSubscriptionsChangedListener(@NonNull android.telephony.SubscriptionManager.OnOpportunisticSubscriptionsChangedListener); @@ -44945,6 +45853,9 @@ package android.telephony { field public static final int PHONE_NUMBER_SOURCE_CARRIER = 2; // 0x2 field public static final int PHONE_NUMBER_SOURCE_IMS = 3; // 0x3 field public static final int PHONE_NUMBER_SOURCE_UICC = 1; // 0x1 + field @FlaggedApi("com.android.internal.telephony.flags.data_only_cellular_service") public static final int SERVICE_CAPABILITY_DATA = 3; // 0x3 + field @FlaggedApi("com.android.internal.telephony.flags.data_only_cellular_service") public static final int SERVICE_CAPABILITY_SMS = 2; // 0x2 + field @FlaggedApi("com.android.internal.telephony.flags.data_only_cellular_service") public static final int SERVICE_CAPABILITY_VOICE = 1; // 0x1 field public static final int SUBSCRIPTION_TYPE_LOCAL_SIM = 0; // 0x0 field public static final int SUBSCRIPTION_TYPE_REMOTE_SIM = 1; // 0x1 field public static final int USAGE_SETTING_DATA_CENTRIC = 2; // 0x2 @@ -45193,6 +46104,8 @@ package android.telephony { method @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_NETWORK_STATE, android.Manifest.permission.MODIFY_PHONE_STATE, android.Manifest.permission.READ_PHONE_STATE, android.Manifest.permission.READ_BASIC_PHONE_STATE}) public boolean isDataEnabled(); method @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_NETWORK_STATE, android.Manifest.permission.READ_PHONE_STATE, android.Manifest.permission.MODIFY_PHONE_STATE, android.Manifest.permission.READ_BASIC_PHONE_STATE}) public boolean isDataEnabledForReason(int); method @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_NETWORK_STATE, android.Manifest.permission.READ_PHONE_STATE, android.Manifest.permission.READ_BASIC_PHONE_STATE}) public boolean isDataRoamingEnabled(); + method @FlaggedApi("com.android.internal.telephony.flags.data_only_cellular_service") public boolean isDeviceSmsCapable(); + method @FlaggedApi("com.android.internal.telephony.flags.data_only_cellular_service") public boolean isDeviceVoiceCapable(); method public boolean isEmergencyNumber(@NonNull String); method public boolean isHearingAidCompatibilitySupported(); method @RequiresPermission(anyOf={android.Manifest.permission.READ_PRECISE_PHONE_STATE, "android.permission.READ_PRIVILEGED_PHONE_STATE"}) public boolean isManualNetworkSelectionAllowed(); @@ -45202,9 +46115,9 @@ package android.telephony { method @RequiresPermission(android.Manifest.permission.READ_BASIC_PHONE_STATE) public boolean isPremiumCapabilityAvailableForPurchase(int); method public boolean isRadioInterfaceCapabilitySupported(@NonNull String); method public boolean isRttSupported(); - method public boolean isSmsCapable(); + method @Deprecated public boolean isSmsCapable(); method @Deprecated public boolean isTtyModeSupported(); - method public boolean isVoiceCapable(); + method @Deprecated public boolean isVoiceCapable(); method public boolean isVoicemailVibrationEnabled(android.telecom.PhoneAccountHandle); method public boolean isWorldPhone(); method @Deprecated public void listen(android.telephony.PhoneStateListener, int); @@ -45251,6 +46164,7 @@ package android.telephony { field public static final String ACTION_MULTI_SIM_CONFIG_CHANGED = "android.telephony.action.MULTI_SIM_CONFIG_CHANGED"; field public static final String ACTION_NETWORK_COUNTRY_CHANGED = "android.telephony.action.NETWORK_COUNTRY_CHANGED"; field @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public static final String ACTION_PHONE_STATE_CHANGED = "android.intent.action.PHONE_STATE"; + field @FlaggedApi("com.android.internal.telephony.flags.reset_mobile_network_settings") public static final String ACTION_RESET_MOBILE_NETWORK_SETTINGS = "android.telephony.action.RESET_MOBILE_NETWORK_SETTINGS"; field public static final String ACTION_RESPOND_VIA_MESSAGE = "android.intent.action.RESPOND_VIA_MESSAGE"; field public static final String ACTION_SECRET_CODE = "android.telephony.action.SECRET_CODE"; field public static final String ACTION_SHOW_VOICEMAIL_NOTIFICATION = "android.telephony.action.SHOW_VOICEMAIL_NOTIFICATION"; @@ -45268,6 +46182,7 @@ package android.telephony { field public static final int AUTHTYPE_EAP_SIM = 128; // 0x80 field public static final int AUTHTYPE_GBA_BOOTSTRAP = 132; // 0x84 field public static final int AUTHTYPE_GBA_NAF_KEY_EXTERNAL = 133; // 0x85 + field @FlaggedApi("com.android.server.telecom.flags.business_call_composer") public static final int CALL_COMPOSER_STATUS_BUSINESS_ONLY = 2; // 0x2 field public static final int CALL_COMPOSER_STATUS_OFF = 0; // 0x0 field public static final int CALL_COMPOSER_STATUS_ON = 1; // 0x1 field public static final int CALL_STATE_IDLE = 0; // 0x0 @@ -45820,8 +46735,9 @@ package android.telephony.euicc { public class EuiccManager { method @NonNull public android.telephony.euicc.EuiccManager createForCardId(int); - method @RequiresPermission("android.permission.WRITE_EMBEDDED_SUBSCRIPTIONS") public void deleteSubscription(int, android.app.PendingIntent); - method @RequiresPermission("android.permission.WRITE_EMBEDDED_SUBSCRIPTIONS") public void downloadSubscription(android.telephony.euicc.DownloadableSubscription, boolean, android.app.PendingIntent); + method @RequiresPermission(anyOf={"android.permission.WRITE_EMBEDDED_SUBSCRIPTIONS", android.Manifest.permission.MANAGE_DEVICE_POLICY_MANAGED_SUBSCRIPTIONS}) public void deleteSubscription(int, android.app.PendingIntent); + method @RequiresPermission(anyOf={"android.permission.WRITE_EMBEDDED_SUBSCRIPTIONS", android.Manifest.permission.MANAGE_DEVICE_POLICY_MANAGED_SUBSCRIPTIONS}) public void downloadSubscription(android.telephony.euicc.DownloadableSubscription, boolean, android.app.PendingIntent); + method @FlaggedApi("com.android.internal.telephony.flags.esim_available_memory") @RequiresPermission(anyOf={android.Manifest.permission.READ_PHONE_STATE, "android.permission.READ_PRIVILEGED_PHONE_STATE", "carrier privileges"}) public long getAvailableMemoryInBytes(); method @Nullable public String getEid(); method @Nullable public android.telephony.euicc.EuiccInfo getEuiccInfo(); method public boolean isEnabled(); @@ -45854,6 +46770,7 @@ package android.telephony.euicc { field public static final int ERROR_SIM_MISSING = 10008; // 0x2718 field public static final int ERROR_TIME_OUT = 10005; // 0x2715 field public static final int ERROR_UNSUPPORTED_VERSION = 10007; // 0x2717 + field @FlaggedApi("com.android.internal.telephony.flags.esim_available_memory") public static final long EUICC_MEMORY_FIELD_UNAVAILABLE = -1L; // 0xffffffffffffffffL field public static final String EXTRA_EMBEDDED_SUBSCRIPTION_DETAILED_CODE = "android.telephony.euicc.extra.EMBEDDED_SUBSCRIPTION_DETAILED_CODE"; field public static final String EXTRA_EMBEDDED_SUBSCRIPTION_DOWNLOADABLE_SUBSCRIPTION = "android.telephony.euicc.extra.EMBEDDED_SUBSCRIPTION_DOWNLOADABLE_SUBSCRIPTION"; field public static final String EXTRA_EMBEDDED_SUBSCRIPTION_ERROR_CODE = "android.telephony.euicc.extra.EMBEDDED_SUBSCRIPTION_ERROR_CODE"; @@ -46216,6 +47133,8 @@ package android.telephony.ims { method public int getTransportType(); method public void writeToParcel(@NonNull android.os.Parcel, int); field public static final int ATTR_EPDG_OVER_CELL_INTERNET = 1; // 0x1 + field @FlaggedApi("com.android.internal.telephony.flags.emergency_registration_state") public static final int ATTR_REGISTRATION_TYPE_EMERGENCY = 2; // 0x2 + field @FlaggedApi("com.android.internal.telephony.flags.emergency_registration_state") public static final int ATTR_VIRTUAL_FOR_ANONYMOUS_EMERGENCY_CALL = 4; // 0x4 field @NonNull public static final android.os.Parcelable.Creator CREATOR; } @@ -46300,6 +47219,7 @@ package android.telephony.ims.feature { public static class MmTelFeature.MmTelCapabilities { method public final boolean isCapable(int); field public static final int CAPABILITY_TYPE_CALL_COMPOSER = 16; // 0x10 + field @FlaggedApi("com.android.server.telecom.flags.business_call_composer") public static final int CAPABILITY_TYPE_CALL_COMPOSER_BUSINESS_ONLY = 32; // 0x20 field public static final int CAPABILITY_TYPE_SMS = 8; // 0x8 field public static final int CAPABILITY_TYPE_UT = 4; // 0x4 field public static final int CAPABILITY_TYPE_VIDEO = 2; // 0x2 @@ -46646,6 +47566,7 @@ package android.text { method @FlaggedApi("com.android.text.flags.no_break_no_hyphenation_span") @NonNull public android.text.DynamicLayout.Builder setLineBreakConfig(@NonNull android.graphics.text.LineBreakConfig); method @NonNull public android.text.DynamicLayout.Builder setLineSpacing(float, @FloatRange(from=0.0) float); method @FlaggedApi("com.android.text.flags.fix_line_height_for_locale") @NonNull public android.text.DynamicLayout.Builder setMinimumFontMetrics(@Nullable android.graphics.Paint.FontMetrics); + method @FlaggedApi("com.android.text.flags.use_bounds_for_width") @NonNull public android.text.DynamicLayout.Builder setShiftDrawingOffsetForStartOverhang(boolean); method @NonNull public android.text.DynamicLayout.Builder setTextDirection(@NonNull android.text.TextDirectionHeuristic); method @FlaggedApi("com.android.text.flags.use_bounds_for_width") @NonNull public android.text.DynamicLayout.Builder setUseBoundsForWidth(boolean); method @NonNull public android.text.DynamicLayout.Builder setUseLineSpacingFromFallbacks(boolean); @@ -46825,6 +47746,7 @@ package android.text { method public int getLineForOffset(int); method public int getLineForVertical(int); method public float getLineLeft(int); + method @FlaggedApi("com.android.text.flags.letter_spacing_justification") @IntRange(from=0) public int getLineLetterSpacingUnitCount(@IntRange(from=0) int, boolean); method public float getLineMax(int); method public float getLineRight(int); method @FlaggedApi("com.android.text.flags.use_bounds_for_width") public final float getLineSpacingAmount(); @@ -46848,6 +47770,7 @@ package android.text { method @FlaggedApi("com.android.text.flags.use_bounds_for_width") @Nullable public final int[] getRightIndents(); method public float getSecondaryHorizontal(int); method public void getSelectionPath(int, int, android.graphics.Path); + method @FlaggedApi("com.android.text.flags.use_bounds_for_width") public boolean getShiftDrawingOffsetForStartOverhang(); method public final float getSpacingAdd(); method public final float getSpacingMultiplier(); method @NonNull public final CharSequence getText(); @@ -46875,6 +47798,7 @@ package android.text { field @NonNull public static final android.text.Layout.TextInclusionStrategy INCLUSION_STRATEGY_ANY_OVERLAP; field @NonNull public static final android.text.Layout.TextInclusionStrategy INCLUSION_STRATEGY_CONTAINS_ALL; field @NonNull public static final android.text.Layout.TextInclusionStrategy INCLUSION_STRATEGY_CONTAINS_CENTER; + field @FlaggedApi("com.android.text.flags.letter_spacing_justification") public static final int JUSTIFICATION_MODE_INTER_CHARACTER = 2; // 0x2 field public static final int JUSTIFICATION_MODE_INTER_WORD = 1; // 0x1 field public static final int JUSTIFICATION_MODE_NONE = 0; // 0x0 } @@ -46903,6 +47827,7 @@ package android.text { method @NonNull public android.text.Layout.Builder setMaxLines(@IntRange(from=1) int); method @FlaggedApi("com.android.text.flags.fix_line_height_for_locale") @NonNull public android.text.Layout.Builder setMinimumFontMetrics(@Nullable android.graphics.Paint.FontMetrics); method @NonNull public android.text.Layout.Builder setRightIndents(@Nullable int[]); + method @FlaggedApi("com.android.text.flags.use_bounds_for_width") @NonNull public android.text.Layout.Builder setShiftDrawingOffsetForStartOverhang(boolean); method @NonNull public android.text.Layout.Builder setTextDirectionHeuristic(@NonNull android.text.TextDirectionHeuristic); method @FlaggedApi("com.android.text.flags.use_bounds_for_width") @NonNull public android.text.Layout.Builder setUseBoundsForWidth(boolean); } @@ -47174,6 +48099,7 @@ package android.text { method @NonNull public android.text.StaticLayout.Builder setLineSpacing(float, @FloatRange(from=0.0) float); method @NonNull public android.text.StaticLayout.Builder setMaxLines(@IntRange(from=0) int); method @FlaggedApi("com.android.text.flags.fix_line_height_for_locale") @NonNull public android.text.StaticLayout.Builder setMinimumFontMetrics(@Nullable android.graphics.Paint.FontMetrics); + method @FlaggedApi("com.android.text.flags.use_bounds_for_width") @NonNull public android.text.StaticLayout.Builder setShiftDrawingOffsetForStartOverhang(boolean); method public android.text.StaticLayout.Builder setText(CharSequence); method @NonNull public android.text.StaticLayout.Builder setTextDirection(@NonNull android.text.TextDirectionHeuristic); method @FlaggedApi("com.android.text.flags.use_bounds_for_width") @NonNull public android.text.StaticLayout.Builder setUseBoundsForWidth(boolean); @@ -49679,11 +50605,10 @@ package android.view { method public boolean applyTransactionOnDraw(@NonNull android.view.SurfaceControl.Transaction); method @Nullable public android.view.SurfaceControl.Transaction buildReparentTransaction(@NonNull android.view.SurfaceControl); method public default int getBufferTransformHint(); - method @FlaggedApi("com.android.window.flags.get_host_token_api") @Nullable public default android.os.IBinder getHostToken(); + method @FlaggedApi("com.android.window.flags.surface_control_input_receiver") @NonNull public default android.window.InputTransferToken getInputTransferToken(); method public default void removeOnBufferTransformHintChangedListener(@NonNull android.view.AttachedSurfaceControl.OnBufferTransformHintChangedListener); method public default void setChildBoundingInsets(@NonNull android.graphics.Rect); method public default void setTouchableRegion(@Nullable android.graphics.Region); - method @FlaggedApi("com.android.window.flags.transfer_gesture_to_embedded") public default boolean transferHostTouchGestureToEmbedded(@NonNull android.view.SurfaceControlViewHost.SurfacePackage); } @UiThread public static interface AttachedSurfaceControl.OnBufferTransformHintChangedListener { @@ -50154,6 +51079,10 @@ package android.view { method public boolean isFromSource(int); } + @FlaggedApi("com.android.input.flags.input_device_view_behavior_api") public static final class InputDevice.ViewBehavior { + method @FlaggedApi("com.android.input.flags.input_device_view_behavior_api") public boolean shouldSmoothScroll(int, int); + } + public abstract class InputEvent implements android.os.Parcelable { method public int describeContents(); method public final android.view.InputDevice getDevice(); @@ -50393,6 +51322,7 @@ package android.view { field public static final int KEYCODE_DVR = 173; // 0xad field public static final int KEYCODE_E = 33; // 0x21 field public static final int KEYCODE_EISU = 212; // 0xd4 + field @FlaggedApi("com.android.hardware.input.emoji_and_screenshot_keycodes_available") public static final int KEYCODE_EMOJI_PICKER = 317; // 0x13d field public static final int KEYCODE_ENDCALL = 6; // 0x6 field public static final int KEYCODE_ENTER = 66; // 0x42 field public static final int KEYCODE_ENVELOPE = 65; // 0x41 @@ -50525,6 +51455,7 @@ package android.view { field public static final int KEYCODE_RIGHT_BRACKET = 72; // 0x48 field public static final int KEYCODE_RO = 217; // 0xd9 field public static final int KEYCODE_S = 47; // 0x2f + field @FlaggedApi("com.android.hardware.input.emoji_and_screenshot_keycodes_available") public static final int KEYCODE_SCREENSHOT = 318; // 0x13e field public static final int KEYCODE_SCROLL_LOCK = 116; // 0x74 field public static final int KEYCODE_SEARCH = 84; // 0x54 field public static final int KEYCODE_SEMICOLON = 74; // 0x4a @@ -51331,6 +52262,7 @@ package android.view { public static class SurfaceControl.Transaction implements java.io.Closeable android.os.Parcelable { ctor public SurfaceControl.Transaction(); method @NonNull public android.view.SurfaceControl.Transaction addTransactionCommittedListener(@NonNull java.util.concurrent.Executor, @NonNull android.view.SurfaceControl.TransactionCommittedListener); + method @FlaggedApi("com.android.window.flags.sdk_desired_present_time") @NonNull public android.view.SurfaceControl.Transaction addTransactionCompletedListener(@NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer); method public void apply(); method @NonNull public android.view.SurfaceControl.Transaction clearFrameRate(@NonNull android.view.SurfaceControl); method @NonNull public android.view.SurfaceControl.Transaction clearTrustedPresentationCallback(@NonNull android.view.SurfaceControl); @@ -51347,9 +52279,12 @@ package android.view { method @NonNull public android.view.SurfaceControl.Transaction setCrop(@NonNull android.view.SurfaceControl, @Nullable android.graphics.Rect); method @NonNull public android.view.SurfaceControl.Transaction setDamageRegion(@NonNull android.view.SurfaceControl, @Nullable android.graphics.Region); method @NonNull public android.view.SurfaceControl.Transaction setDataSpace(@NonNull android.view.SurfaceControl, int); + method @FlaggedApi("com.android.graphics.hwui.flags.limited_hdr") @NonNull public android.view.SurfaceControl.Transaction setDesiredHdrHeadroom(@NonNull android.view.SurfaceControl, @FloatRange(from=0.0f) float); + method @FlaggedApi("com.android.window.flags.sdk_desired_present_time") @NonNull public android.view.SurfaceControl.Transaction setDesiredPresentTimeNanos(long); method @NonNull public android.view.SurfaceControl.Transaction setExtendedRangeBrightness(@NonNull android.view.SurfaceControl, float, float); method @NonNull public android.view.SurfaceControl.Transaction setFrameRate(@NonNull android.view.SurfaceControl, @FloatRange(from=0.0) float, int); method @NonNull public android.view.SurfaceControl.Transaction setFrameRate(@NonNull android.view.SurfaceControl, @FloatRange(from=0.0) float, int, int); + method @FlaggedApi("com.android.window.flags.sdk_desired_present_time") @NonNull public android.view.SurfaceControl.Transaction setFrameTimeline(long); method @Deprecated @NonNull public android.view.SurfaceControl.Transaction setGeometry(@NonNull android.view.SurfaceControl, @Nullable android.graphics.Rect, @Nullable android.graphics.Rect, int); method @NonNull public android.view.SurfaceControl.Transaction setLayer(@NonNull android.view.SurfaceControl, @IntRange(from=java.lang.Integer.MIN_VALUE, to=java.lang.Integer.MAX_VALUE) int); method @NonNull public android.view.SurfaceControl.Transaction setOpaque(@NonNull android.view.SurfaceControl, boolean); @@ -51365,12 +52300,22 @@ package android.view { method public void onTransactionCommitted(); } + @FlaggedApi("com.android.window.flags.sdk_desired_present_time") public static final class SurfaceControl.TransactionStats { + method @FlaggedApi("com.android.window.flags.sdk_desired_present_time") public long getLatchTimeNanos(); + method @FlaggedApi("com.android.window.flags.sdk_desired_present_time") @NonNull public android.hardware.SyncFence getPresentFence(); + } + public static final class SurfaceControl.TrustedPresentationThresholds { ctor public SurfaceControl.TrustedPresentationThresholds(@FloatRange(from=0.0f, fromInclusive=false, to=1.0f) float, @FloatRange(from=0.0f, fromInclusive=false, to=1.0f) float, @IntRange(from=1) int); } + @FlaggedApi("com.android.window.flags.surface_control_input_receiver") public interface SurfaceControlInputReceiver { + method public boolean onInputEvent(@NonNull android.view.InputEvent); + } + public class SurfaceControlViewHost { ctor public SurfaceControlViewHost(@NonNull android.content.Context, @NonNull android.view.Display, @Nullable android.os.IBinder); + ctor @FlaggedApi("com.android.window.flags.surface_control_input_receiver") public SurfaceControlViewHost(@NonNull android.content.Context, @NonNull android.view.Display, @Nullable android.window.InputTransferToken); method @Nullable public android.view.SurfaceControlViewHost.SurfacePackage getSurfacePackage(); method @Nullable public android.view.View getView(); method public void relayout(int, int); @@ -51382,6 +52327,7 @@ package android.view { public static final class SurfaceControlViewHost.SurfacePackage implements android.os.Parcelable { ctor public SurfaceControlViewHost.SurfacePackage(@NonNull android.view.SurfaceControlViewHost.SurfacePackage); method public int describeContents(); + method @FlaggedApi("com.android.window.flags.surface_control_input_receiver") @Nullable public android.window.InputTransferToken getInputTransferToken(); method @NonNull public android.view.SurfaceControl getSurfaceControl(); method public void notifyConfigurationChanged(@NonNull android.content.res.Configuration); method public void notifyDetachedFromWindow(); @@ -51437,6 +52383,7 @@ package android.view { method @Nullable public android.os.IBinder getHostToken(); method public android.view.SurfaceControl getSurfaceControl(); method public void setChildSurfacePackage(@NonNull android.view.SurfaceControlViewHost.SurfacePackage); + method @FlaggedApi("com.android.graphics.hwui.flags.limited_hdr") public void setDesiredHdrHeadroom(@FloatRange(from=0.0f, to=10000.0) float); method public void setSecure(boolean); method public void setSurfaceLifecycle(int); method public void setZOrderMediaOverlay(boolean); @@ -51572,6 +52519,7 @@ package android.view { method public final void cancelPendingInputEvents(); method public boolean checkInputConnectionProxy(android.view.View); method public void clearAnimation(); + method @FlaggedApi("android.service.autofill.autofill_credman_dev_integration") public void clearCredentialManagerRequest(); method public void clearFocus(); method public void clearViewTranslationCallback(); method public static int combineMeasuredStates(int, int); @@ -51678,8 +52626,11 @@ package android.view { method public final boolean getClipToOutline(); method @Nullable public final android.view.contentcapture.ContentCaptureSession getContentCaptureSession(); method public CharSequence getContentDescription(); + method @FlaggedApi("android.view.flags.sensitive_content_app_protection_api") public final int getContentSensitivity(); method @UiContext public final android.content.Context getContext(); method protected android.view.ContextMenu.ContextMenuInfo getContextMenuInfo(); + method @FlaggedApi("android.service.autofill.autofill_credman_dev_integration") @Nullable public final android.os.OutcomeReceiver getCredentialManagerCallback(); + method @FlaggedApi("android.service.autofill.autofill_credman_dev_integration") @Nullable public final android.credentials.GetCredentialRequest getCredentialManagerRequest(); method public final boolean getDefaultFocusHighlightEnabled(); method public static int getDefaultSize(int, int); method public android.view.Display getDisplay(); @@ -51857,6 +52808,7 @@ package android.view { method public boolean isAttachedToWindow(); method public boolean isAutoHandwritingEnabled(); method public boolean isClickable(); + method @FlaggedApi("android.view.flags.sensitive_content_app_protection_api") public final boolean isContentSensitive(); method public boolean isContextClickable(); method public boolean isCredential(); method public boolean isDirty(); @@ -52061,7 +53013,9 @@ package android.view { method public void setClipToOutline(boolean); method public void setContentCaptureSession(@Nullable android.view.contentcapture.ContentCaptureSession); method public void setContentDescription(CharSequence); + method @FlaggedApi("android.view.flags.sensitive_content_app_protection_api") public final void setContentSensitivity(int); method public void setContextClickable(boolean); + method @FlaggedApi("android.service.autofill.autofill_credman_dev_integration") public void setCredentialManagerRequest(@NonNull android.credentials.GetCredentialRequest, @NonNull android.os.OutcomeReceiver); method public void setDefaultFocusHighlightEnabled(boolean); method @Deprecated public void setDrawingCacheBackgroundColor(@ColorInt int); method @Deprecated public void setDrawingCacheEnabled(boolean); @@ -52245,13 +53199,18 @@ package android.view { field public static final int AUTOFILL_TYPE_NONE = 0; // 0x0 field public static final int AUTOFILL_TYPE_TEXT = 1; // 0x1 field public static final int AUTOFILL_TYPE_TOGGLE = 2; // 0x2 + field @FlaggedApi("android.view.flags.sensitive_content_app_protection_api") public static final int CONTENT_SENSITIVITY_AUTO = 0; // 0x0 + field @FlaggedApi("android.view.flags.sensitive_content_app_protection_api") public static final int CONTENT_SENSITIVITY_NOT_SENSITIVE = 2; // 0x2 + field @FlaggedApi("android.view.flags.sensitive_content_app_protection_api") public static final int CONTENT_SENSITIVITY_SENSITIVE = 1; // 0x1 field public static final int DRAG_FLAG_ACCESSIBILITY_ACTION = 1024; // 0x400 field public static final int DRAG_FLAG_GLOBAL = 256; // 0x100 field public static final int DRAG_FLAG_GLOBAL_PERSISTABLE_URI_PERMISSION = 64; // 0x40 field public static final int DRAG_FLAG_GLOBAL_PREFIX_URI_PERMISSION = 128; // 0x80 + field @FlaggedApi("com.android.window.flags.delegate_unhandled_drags") public static final int DRAG_FLAG_GLOBAL_SAME_APPLICATION = 4096; // 0x1000 field public static final int DRAG_FLAG_GLOBAL_URI_READ = 1; // 0x1 field public static final int DRAG_FLAG_GLOBAL_URI_WRITE = 2; // 0x2 field public static final int DRAG_FLAG_OPAQUE = 512; // 0x200 + field @FlaggedApi("com.android.window.flags.delegate_unhandled_drags") public static final int DRAG_FLAG_START_INTENT_SENDER_ON_UNHANDLED_DRAG = 8192; // 0x2000 field @Deprecated public static final int DRAWING_CACHE_QUALITY_AUTO = 0; // 0x0 field @Deprecated public static final int DRAWING_CACHE_QUALITY_HIGH = 1048576; // 0x100000 field @Deprecated public static final int DRAWING_CACHE_QUALITY_LOW = 524288; // 0x80000 @@ -52330,10 +53289,10 @@ package android.view { field protected static final int[] PRESSED_SELECTED_WINDOW_FOCUSED_STATE_SET; field protected static final int[] PRESSED_STATE_SET; field protected static final int[] PRESSED_WINDOW_FOCUSED_STATE_SET; - field @FlaggedApi("android.view.flags.toolkit_set_frame_rate_read_only") public static final float REQUESTED_FRAME_RATE_CATEGORY_DEFAULT = 0.0f; - field @FlaggedApi("android.view.flags.toolkit_set_frame_rate_read_only") public static final float REQUESTED_FRAME_RATE_CATEGORY_HIGH = -120.0f; - field @FlaggedApi("android.view.flags.toolkit_set_frame_rate_read_only") public static final float REQUESTED_FRAME_RATE_CATEGORY_LOW = -30.0f; - field @FlaggedApi("android.view.flags.toolkit_set_frame_rate_read_only") public static final float REQUESTED_FRAME_RATE_CATEGORY_NORMAL = -60.0f; + field @FlaggedApi("android.view.flags.toolkit_set_frame_rate_read_only") public static final float REQUESTED_FRAME_RATE_CATEGORY_DEFAULT = (0.0f/0.0f); + field @FlaggedApi("android.view.flags.toolkit_set_frame_rate_read_only") public static final float REQUESTED_FRAME_RATE_CATEGORY_HIGH = -4.0f; + field @FlaggedApi("android.view.flags.toolkit_set_frame_rate_read_only") public static final float REQUESTED_FRAME_RATE_CATEGORY_LOW = -2.0f; + field @FlaggedApi("android.view.flags.toolkit_set_frame_rate_read_only") public static final float REQUESTED_FRAME_RATE_CATEGORY_NORMAL = -3.0f; field @FlaggedApi("android.view.flags.toolkit_set_frame_rate_read_only") public static final float REQUESTED_FRAME_RATE_CATEGORY_NO_PREFERENCE = -1.0f; field public static final android.util.Property ROTATION; field public static final android.util.Property ROTATION_X; @@ -52935,8 +53894,11 @@ package android.view { method public abstract int addChildCount(int); method public abstract void asyncCommit(); method public abstract android.view.ViewStructure asyncNewChild(int); + method @FlaggedApi("android.service.autofill.autofill_credman_dev_integration") public void clearCredentialManagerRequest(); method @Nullable public abstract android.view.autofill.AutofillId getAutofillId(); method public abstract int getChildCount(); + method @FlaggedApi("android.service.autofill.autofill_credman_dev_integration") @Nullable public android.os.OutcomeReceiver getCredentialManagerCallback(); + method @FlaggedApi("android.service.autofill.autofill_credman_dev_integration") @Nullable public android.credentials.GetCredentialRequest getCredentialManagerRequest(); method public abstract android.os.Bundle getExtras(); method public abstract CharSequence getHint(); method public abstract CharSequence getText(); @@ -52961,6 +53923,7 @@ package android.view { method public abstract void setClickable(boolean); method public abstract void setContentDescription(CharSequence); method public abstract void setContextClickable(boolean); + method @FlaggedApi("android.service.autofill.autofill_credman_dev_integration") public void setCredentialManagerRequest(@NonNull android.credentials.GetCredentialRequest, @NonNull android.os.OutcomeReceiver); method public abstract void setDataIsSensitive(boolean); method public abstract void setDimens(int, int, int, int, int, int); method public abstract void setElevation(float); @@ -53115,12 +54078,13 @@ package android.view { method public android.transition.Transition getExitTransition(); method protected final int getFeatures(); method protected final int getForcedWindowFlags(); + method @FlaggedApi("android.view.flags.toolkit_set_frame_rate_read_only") public boolean getFrameRateBoostOnTouchEnabled(); method @Nullable public android.view.WindowInsetsController getInsetsController(); method @NonNull public abstract android.view.LayoutInflater getLayoutInflater(); method protected final int getLocalFeatures(); method public android.media.session.MediaController getMediaController(); - method @ColorInt public abstract int getNavigationBarColor(); - method @ColorInt public int getNavigationBarDividerColor(); + method @Deprecated @ColorInt public abstract int getNavigationBarColor(); + method @Deprecated @ColorInt public int getNavigationBarDividerColor(); method @NonNull public android.window.OnBackInvokedDispatcher getOnBackInvokedDispatcher(); method public android.transition.Transition getReenterTransition(); method public android.transition.Transition getReturnTransition(); @@ -53130,7 +54094,7 @@ package android.view { method public android.transition.Transition getSharedElementReenterTransition(); method public android.transition.Transition getSharedElementReturnTransition(); method public boolean getSharedElementsUseOverlay(); - method @ColorInt public abstract int getStatusBarColor(); + method @Deprecated @ColorInt public abstract int getStatusBarColor(); method @NonNull public java.util.List getSystemGestureExclusionRects(); method public long getTransitionBackgroundFadeDuration(); method public android.transition.TransitionManager getTransitionManager(); @@ -53144,9 +54108,10 @@ package android.view { method public abstract void invalidatePanelMenu(int); method public final boolean isActive(); method public abstract boolean isFloating(); + method @FlaggedApi("android.view.flags.toolkit_set_frame_rate_read_only") public boolean isFrameRatePowerSavingsBalanced(); method public boolean isNavigationBarContrastEnforced(); method public abstract boolean isShortcutKey(int, android.view.KeyEvent); - method public boolean isStatusBarContrastEnforced(); + method @Deprecated public boolean isStatusBarContrastEnforced(); method public boolean isWideColorGamut(); method public final void makeActive(); method protected abstract void onActive(); @@ -53178,7 +54143,7 @@ package android.view { method public abstract void setContentView(android.view.View); method public abstract void setContentView(android.view.View, android.view.ViewGroup.LayoutParams); method public abstract void setDecorCaptionShade(int); - method public void setDecorFitsSystemWindows(boolean); + method @Deprecated public void setDecorFitsSystemWindows(boolean); method protected void setDefaultWindowFormat(int); method @FlaggedApi("com.android.graphics.hwui.flags.limited_hdr") public void setDesiredHdrHeadroom(@FloatRange(from=0.0f, to=10000.0) float); method public void setDimAmount(float); @@ -53192,6 +54157,8 @@ package android.view { method public abstract void setFeatureInt(int, int); method public void setFlags(int, int); method public void setFormat(int); + method @FlaggedApi("android.view.flags.toolkit_set_frame_rate_read_only") public void setFrameRateBoostOnTouchEnabled(boolean); + method @FlaggedApi("android.view.flags.toolkit_set_frame_rate_read_only") public void setFrameRatePowerSavingsBalanced(boolean); method public void setGravity(int); method @RequiresPermission(android.Manifest.permission.HIDE_OVERLAY_WINDOWS) public final void setHideOverlayWindows(boolean); method public void setIcon(@DrawableRes int); @@ -53199,9 +54166,9 @@ package android.view { method public void setLocalFocus(boolean, boolean); method public void setLogo(@DrawableRes int); method public void setMediaController(android.media.session.MediaController); - method public abstract void setNavigationBarColor(@ColorInt int); + method @Deprecated public abstract void setNavigationBarColor(@ColorInt int); method public void setNavigationBarContrastEnforced(boolean); - method public void setNavigationBarDividerColor(@ColorInt int); + method @Deprecated public void setNavigationBarDividerColor(@ColorInt int); method public void setPreferMinimalPostProcessing(boolean); method public void setReenterTransition(android.transition.Transition); method public abstract void setResizingCaptionDrawable(android.graphics.drawable.Drawable); @@ -53213,8 +54180,8 @@ package android.view { method public void setSharedElementReturnTransition(android.transition.Transition); method public void setSharedElementsUseOverlay(boolean); method public void setSoftInputMode(int); - method public abstract void setStatusBarColor(@ColorInt int); - method public void setStatusBarContrastEnforced(boolean); + method @Deprecated public abstract void setStatusBarColor(@ColorInt int); + method @Deprecated public void setStatusBarContrastEnforced(boolean); method public void setSustainedPerformanceMode(boolean); method public void setSystemGestureExclusionRects(@NonNull java.util.List); method public abstract void setTitle(CharSequence); @@ -53339,8 +54306,11 @@ package android.view { method @Deprecated @NonNull public android.view.WindowInsets consumeDisplayCutout(); method @Deprecated @NonNull public android.view.WindowInsets consumeStableInsets(); method @Deprecated @NonNull public android.view.WindowInsets consumeSystemWindowInsets(); + method @FlaggedApi("android.view.flags.customizable_window_headers") @NonNull public java.util.List getBoundingRects(int); + method @FlaggedApi("android.view.flags.customizable_window_headers") @NonNull public java.util.List getBoundingRectsIgnoringVisibility(int); method @Nullable public android.view.DisplayCutout getDisplayCutout(); method @Nullable public android.view.DisplayShape getDisplayShape(); + method @FlaggedApi("android.view.flags.customizable_window_headers") @NonNull public android.util.Size getFrame(); method @NonNull public android.graphics.Insets getInsets(int); method @NonNull public android.graphics.Insets getInsetsIgnoringVisibility(int); method @Deprecated @NonNull public android.graphics.Insets getMandatorySystemGestureInsets(); @@ -53375,8 +54345,11 @@ package android.view { ctor public WindowInsets.Builder(); ctor public WindowInsets.Builder(@NonNull android.view.WindowInsets); method @NonNull public android.view.WindowInsets build(); + method @FlaggedApi("android.view.flags.customizable_window_headers") @NonNull public android.view.WindowInsets.Builder setBoundingRects(int, @NonNull java.util.List); + method @FlaggedApi("android.view.flags.customizable_window_headers") @NonNull public android.view.WindowInsets.Builder setBoundingRectsIgnoringVisibility(int, @NonNull java.util.List); method @NonNull public android.view.WindowInsets.Builder setDisplayCutout(@Nullable android.view.DisplayCutout); method @NonNull public android.view.WindowInsets.Builder setDisplayShape(@NonNull android.view.DisplayShape); + method @FlaggedApi("android.view.flags.customizable_window_headers") @NonNull public android.view.WindowInsets.Builder setFrame(int, int); method @NonNull public android.view.WindowInsets.Builder setInsets(int, @NonNull android.graphics.Insets); method @NonNull public android.view.WindowInsets.Builder setInsetsIgnoringVisibility(int, @NonNull android.graphics.Insets) throws java.lang.IllegalArgumentException; method @Deprecated @NonNull public android.view.WindowInsets.Builder setMandatorySystemGestureInsets(@NonNull android.graphics.Insets); @@ -53470,8 +54443,10 @@ package android.view { method public void setSystemBarsAppearance(int, int); method public void setSystemBarsBehavior(int); method public void show(int); + field @FlaggedApi("android.view.flags.customizable_window_headers") public static final int APPEARANCE_LIGHT_CAPTION_BARS = 256; // 0x100 field public static final int APPEARANCE_LIGHT_NAVIGATION_BARS = 16; // 0x10 field public static final int APPEARANCE_LIGHT_STATUS_BARS = 8; // 0x8 + field @FlaggedApi("android.view.flags.customizable_window_headers") public static final int APPEARANCE_TRANSPARENT_CAPTION_BAR_BACKGROUND = 128; // 0x80 field public static final int BEHAVIOR_DEFAULT = 1; // 0x1 field @Deprecated public static final int BEHAVIOR_SHOW_BARS_BY_SWIPE = 1; // 0x1 field @Deprecated public static final int BEHAVIOR_SHOW_BARS_BY_TOUCH = 0; // 0x0 @@ -53486,25 +54461,42 @@ package android.view { method public default void addCrossWindowBlurEnabledListener(@NonNull java.util.function.Consumer); method public default void addCrossWindowBlurEnabledListener(@NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer); method public default void addProposedRotationListener(@NonNull java.util.concurrent.Executor, @NonNull java.util.function.IntConsumer); + method @FlaggedApi("com.android.window.flags.screen_recording_callbacks") @RequiresPermission(android.Manifest.permission.DETECT_SCREEN_RECORDING) public default int addScreenRecordingCallback(@NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer); method @NonNull public default android.view.WindowMetrics getCurrentWindowMetrics(); method @Deprecated public android.view.Display getDefaultDisplay(); method @NonNull public default android.view.WindowMetrics getMaximumWindowMetrics(); method public default boolean isCrossWindowBlurEnabled(); + method @FlaggedApi("com.android.window.flags.surface_control_input_receiver") @NonNull public default android.window.InputTransferToken registerBatchedSurfaceControlInputReceiver(int, @NonNull android.window.InputTransferToken, @NonNull android.view.SurfaceControl, @NonNull android.view.Choreographer, @NonNull android.view.SurfaceControlInputReceiver); method @FlaggedApi("com.android.window.flags.trusted_presentation_listener_for_window") public default void registerTrustedPresentationListener(@NonNull android.os.IBinder, @NonNull android.window.TrustedPresentationThresholds, @NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer); + method @FlaggedApi("com.android.window.flags.surface_control_input_receiver") @NonNull public default android.window.InputTransferToken registerUnbatchedSurfaceControlInputReceiver(int, @NonNull android.window.InputTransferToken, @NonNull android.view.SurfaceControl, @NonNull android.os.Looper, @NonNull android.view.SurfaceControlInputReceiver); method public default void removeCrossWindowBlurEnabledListener(@NonNull java.util.function.Consumer); method public default void removeProposedRotationListener(@NonNull java.util.function.IntConsumer); + method @FlaggedApi("com.android.window.flags.screen_recording_callbacks") @RequiresPermission(android.Manifest.permission.DETECT_SCREEN_RECORDING) public default void removeScreenRecordingCallback(@NonNull java.util.function.Consumer); method public void removeViewImmediate(android.view.View); + method @FlaggedApi("com.android.window.flags.surface_control_input_receiver") public default boolean transferTouchGesture(@NonNull android.window.InputTransferToken, @NonNull android.window.InputTransferToken); + method @FlaggedApi("com.android.window.flags.surface_control_input_receiver") public default void unregisterSurfaceControlInputReceiver(@NonNull android.view.SurfaceControl); method @FlaggedApi("com.android.window.flags.trusted_presentation_listener_for_window") public default void unregisterTrustedPresentationListener(@NonNull java.util.function.Consumer); + field @FlaggedApi("com.android.window.flags.cover_display_opt_in") public static final int COMPAT_SMALL_COVER_SCREEN_OPT_IN = 1; // 0x1 field public static final String PROPERTY_ACTIVITY_EMBEDDING_ALLOW_SYSTEM_OVERRIDE = "android.window.PROPERTY_ACTIVITY_EMBEDDING_ALLOW_SYSTEM_OVERRIDE"; field public static final String PROPERTY_ACTIVITY_EMBEDDING_SPLITS_ENABLED = "android.window.PROPERTY_ACTIVITY_EMBEDDING_SPLITS_ENABLED"; + field @FlaggedApi("com.android.window.flags.untrusted_embedding_state_sharing") public static final String PROPERTY_ALLOW_UNTRUSTED_ACTIVITY_EMBEDDING_STATE_SHARING = "android.window.PROPERTY_ALLOW_UNTRUSTED_ACTIVITY_EMBEDDING_STATE_SHARING"; field public static final String PROPERTY_CAMERA_COMPAT_ALLOW_FORCE_ROTATION = "android.window.PROPERTY_CAMERA_COMPAT_ALLOW_FORCE_ROTATION"; field public static final String PROPERTY_CAMERA_COMPAT_ALLOW_REFRESH = "android.window.PROPERTY_CAMERA_COMPAT_ALLOW_REFRESH"; field public static final String PROPERTY_CAMERA_COMPAT_ENABLE_REFRESH_VIA_PAUSE = "android.window.PROPERTY_CAMERA_COMPAT_ENABLE_REFRESH_VIA_PAUSE"; field public static final String PROPERTY_COMPAT_ALLOW_DISPLAY_ORIENTATION_OVERRIDE = "android.window.PROPERTY_COMPAT_ALLOW_DISPLAY_ORIENTATION_OVERRIDE"; + field @FlaggedApi("com.android.window.flags.app_compat_properties_api") public static final String PROPERTY_COMPAT_ALLOW_IGNORING_ORIENTATION_REQUEST_WHEN_LOOP_DETECTED = "android.window.PROPERTY_COMPAT_ALLOW_IGNORING_ORIENTATION_REQUEST_WHEN_LOOP_DETECTED"; + field @FlaggedApi("com.android.window.flags.app_compat_properties_api") public static final String PROPERTY_COMPAT_ALLOW_MIN_ASPECT_RATIO_OVERRIDE = "android.window.PROPERTY_COMPAT_ALLOW_MIN_ASPECT_RATIO_OVERRIDE"; field public static final String PROPERTY_COMPAT_ALLOW_ORIENTATION_OVERRIDE = "android.window.PROPERTY_COMPAT_ALLOW_ORIENTATION_OVERRIDE"; + field @FlaggedApi("com.android.window.flags.app_compat_properties_api") public static final String PROPERTY_COMPAT_ALLOW_RESIZEABLE_ACTIVITY_OVERRIDES = "android.window.PROPERTY_COMPAT_ALLOW_RESIZEABLE_ACTIVITY_OVERRIDES"; field public static final String PROPERTY_COMPAT_ALLOW_SANDBOXING_VIEW_BOUNDS_APIS = "android.window.PROPERTY_COMPAT_ALLOW_SANDBOXING_VIEW_BOUNDS_APIS"; + field @FlaggedApi("com.android.window.flags.cover_display_opt_in") public static final String PROPERTY_COMPAT_ALLOW_SMALL_COVER_SCREEN = "android.window.PROPERTY_COMPAT_ALLOW_SMALL_COVER_SCREEN"; + field @FlaggedApi("com.android.window.flags.app_compat_properties_api") public static final String PROPERTY_COMPAT_ALLOW_USER_ASPECT_RATIO_FULLSCREEN_OVERRIDE = "android.window.PROPERTY_COMPAT_ALLOW_USER_ASPECT_RATIO_FULLSCREEN_OVERRIDE"; + field @FlaggedApi("com.android.window.flags.app_compat_properties_api") public static final String PROPERTY_COMPAT_ALLOW_USER_ASPECT_RATIO_OVERRIDE = "android.window.PROPERTY_COMPAT_ALLOW_USER_ASPECT_RATIO_OVERRIDE"; field public static final String PROPERTY_COMPAT_ENABLE_FAKE_FOCUS = "android.window.PROPERTY_COMPAT_ENABLE_FAKE_FOCUS"; field public static final String PROPERTY_COMPAT_IGNORE_REQUESTED_ORIENTATION = "android.window.PROPERTY_COMPAT_IGNORE_REQUESTED_ORIENTATION"; + field @FlaggedApi("com.android.window.flags.supports_multi_instance_system_ui") public static final String PROPERTY_SUPPORTS_MULTI_INSTANCE_SYSTEM_UI = "android.window.PROPERTY_SUPPORTS_MULTI_INSTANCE_SYSTEM_UI"; + field @FlaggedApi("com.android.window.flags.screen_recording_callbacks") public static final int SCREEN_RECORDING_STATE_NOT_VISIBLE = 0; // 0x0 + field @FlaggedApi("com.android.window.flags.screen_recording_callbacks") public static final int SCREEN_RECORDING_STATE_VISIBLE = 1; // 0x1 } public static class WindowManager.BadTokenException extends java.lang.RuntimeException { @@ -53535,8 +54527,10 @@ package android.view { method @FlaggedApi("com.android.graphics.hwui.flags.limited_hdr") public float getDesiredHdrHeadroom(); method public int getFitInsetsSides(); method public int getFitInsetsTypes(); + method @FlaggedApi("android.view.flags.toolkit_set_frame_rate_read_only") public boolean getFrameRateBoostOnTouchEnabled(); method public final CharSequence getTitle(); method public boolean isFitInsetsIgnoringVisibility(); + method @FlaggedApi("android.view.flags.toolkit_set_frame_rate_read_only") public boolean isFrameRatePowerSavingsBalanced(); method public boolean isHdrConversionEnabled(); method public static boolean mayUseInputMethod(int); method public void setBlurBehindRadius(@IntRange(from=0) int); @@ -53546,6 +54540,8 @@ package android.view { method public void setFitInsetsIgnoringVisibility(boolean); method public void setFitInsetsSides(int); method public void setFitInsetsTypes(int); + method @FlaggedApi("android.view.flags.toolkit_set_frame_rate_read_only") public void setFrameRateBoostOnTouchEnabled(boolean); + method @FlaggedApi("android.view.flags.toolkit_set_frame_rate_read_only") public void setFrameRatePowerSavingsBalanced(boolean); method public void setHdrConversionEnabled(boolean); method public final void setTitle(CharSequence); method public void setWallpaperTouchEventsEnabled(boolean); @@ -54308,6 +55304,7 @@ package android.view.accessibility { field public static final int TYPE_MAGNIFICATION_OVERLAY = 6; // 0x6 field public static final int TYPE_SPLIT_SCREEN_DIVIDER = 5; // 0x5 field public static final int TYPE_SYSTEM = 3; // 0x3 + field @FlaggedApi("android.view.accessibility.add_type_window_control") public static final int TYPE_WINDOW_CONTROL = 7; // 0x7 } public class CaptioningManager { @@ -54922,6 +55919,14 @@ package android.view.inputmethod { field @NonNull public static final android.os.Parcelable.Creator CREATOR; } + @FlaggedApi("android.view.inputmethod.connectionless_handwriting") public interface ConnectionlessHandwritingCallback { + method public void onError(int); + method public void onResult(@NonNull CharSequence); + field public static final int CONNECTIONLESS_HANDWRITING_ERROR_NO_TEXT_RECOGNIZED = 0; // 0x0 + field public static final int CONNECTIONLESS_HANDWRITING_ERROR_OTHER = 2; // 0x2 + field public static final int CONNECTIONLESS_HANDWRITING_ERROR_UNSUPPORTED = 1; // 0x1 + } + public final class CorrectionInfo implements android.os.Parcelable { ctor public CorrectionInfo(int, CharSequence, CharSequence); method public int describeContents(); @@ -55316,6 +56321,7 @@ package android.view.inputmethod { public final class InputMethodInfo implements android.os.Parcelable { ctor public InputMethodInfo(android.content.Context, android.content.pm.ResolveInfo) throws java.io.IOException, org.xmlpull.v1.XmlPullParserException; ctor public InputMethodInfo(String, String, CharSequence, String); + method @FlaggedApi("android.view.inputmethod.ime_switcher_revamp") @Nullable public android.content.Intent createImeLanguageSettingsActivityIntent(); method @Nullable public android.content.Intent createStylusHandwritingSettingsActivityIntent(); method public int describeContents(); method public void dump(android.util.Printer, String); @@ -55332,9 +56338,11 @@ package android.view.inputmethod { method public android.graphics.drawable.Drawable loadIcon(android.content.pm.PackageManager); method public CharSequence loadLabel(android.content.pm.PackageManager); method public boolean shouldShowInInputMethodPicker(); + method @FlaggedApi("android.view.inputmethod.connectionless_handwriting") public boolean supportsConnectionlessStylusHandwriting(); method public boolean supportsStylusHandwriting(); method public boolean suppressesSpellChecker(); method public void writeToParcel(android.os.Parcel, int); + field @FlaggedApi("android.view.inputmethod.ime_switcher_revamp") public static final String ACTION_IME_LANGUAGE_SETTINGS = "android.view.inputmethod.action.IME_LANGUAGE_SETTINGS"; field public static final String ACTION_STYLUS_HANDWRITING_SETTINGS = "android.view.inputmethod.action.STYLUS_HANDWRITING_SETTINGS"; field @NonNull public static final android.os.Parcelable.Creator CREATOR; } @@ -55342,7 +56350,8 @@ package android.view.inputmethod { public final class InputMethodManager { method public boolean acceptStylusHandwritingDelegation(@NonNull android.view.View); method public boolean acceptStylusHandwritingDelegation(@NonNull android.view.View, @NonNull String); - method @FlaggedApi("android.view.inputmethod.home_screen_handwriting_delegator") public boolean acceptStylusHandwritingDelegation(@NonNull android.view.View, @NonNull String, int); + method @FlaggedApi("android.view.inputmethod.use_zero_jank_proxy") public void acceptStylusHandwritingDelegation(@NonNull android.view.View, @NonNull String, @NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer); + method @FlaggedApi("android.view.inputmethod.home_screen_handwriting_delegator") public void acceptStylusHandwritingDelegation(@NonNull android.view.View, @NonNull String, int, @NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer); method public void dispatchKeyEventFromInputMethod(@Nullable android.view.View, @NonNull android.view.KeyEvent); method public void displayCompletions(android.view.View, android.view.inputmethod.CompletionInfo[]); method @Nullable public android.view.inputmethod.InputMethodInfo getCurrentInputMethodInfo(); @@ -55360,6 +56369,7 @@ package android.view.inputmethod { method public boolean isAcceptingText(); method public boolean isActive(android.view.View); method public boolean isActive(); + method @FlaggedApi("android.view.inputmethod.connectionless_handwriting") public boolean isConnectionlessStylusHandwritingAvailable(); method public boolean isFullscreenMode(); method public boolean isInputMethodSuppressingSpellChecker(); method public boolean isStylusHandwritingAvailable(); @@ -55380,6 +56390,9 @@ package android.view.inputmethod { method public boolean showSoftInput(android.view.View, int, android.os.ResultReceiver); method @Deprecated public void showSoftInputFromInputMethod(android.os.IBinder, int); method @Deprecated public void showStatusIcon(android.os.IBinder, String, @DrawableRes int); + method @FlaggedApi("android.view.inputmethod.connectionless_handwriting") public void startConnectionlessStylusHandwriting(@NonNull android.view.View, @Nullable android.view.inputmethod.CursorAnchorInfo, @NonNull java.util.concurrent.Executor, @NonNull android.view.inputmethod.ConnectionlessHandwritingCallback); + method @FlaggedApi("android.view.inputmethod.connectionless_handwriting") public void startConnectionlessStylusHandwritingForDelegation(@NonNull android.view.View, @Nullable android.view.inputmethod.CursorAnchorInfo, @NonNull java.util.concurrent.Executor, @NonNull android.view.inputmethod.ConnectionlessHandwritingCallback); + method @FlaggedApi("android.view.inputmethod.connectionless_handwriting") public void startConnectionlessStylusHandwritingForDelegation(@NonNull android.view.View, @Nullable android.view.inputmethod.CursorAnchorInfo, @NonNull String, @NonNull java.util.concurrent.Executor, @NonNull android.view.inputmethod.ConnectionlessHandwritingCallback); method public void startStylusHandwriting(@NonNull android.view.View); method @Deprecated public boolean switchToLastInputMethod(android.os.IBinder); method @Deprecated public boolean switchToNextInputMethod(android.os.IBinder, boolean); @@ -56014,6 +57027,7 @@ package android.view.textclassifier { field public static final String TYPE_EMAIL = "email"; field public static final String TYPE_FLIGHT_NUMBER = "flight"; field public static final String TYPE_OTHER = "other"; + field @FlaggedApi("android.service.notification.redact_sensitive_notifications_from_untrusted_listeners") public static final String TYPE_OTP_CODE = "otp_code"; field public static final String TYPE_PHONE = "phone"; field public static final String TYPE_UNKNOWN = ""; field public static final String TYPE_URL = "url"; @@ -59150,6 +60164,7 @@ package android.widget { ctor public RemoteViews(@NonNull java.util.Map); ctor public RemoteViews(android.widget.RemoteViews); ctor public RemoteViews(android.os.Parcel); + ctor @FlaggedApi("android.appwidget.flags.draw_data_parcel") public RemoteViews(@NonNull android.widget.RemoteViews.DrawInstructions); method public void addStableView(@IdRes int, @NonNull android.widget.RemoteViews, int); method public void addView(@IdRes int, android.widget.RemoteViews); method public android.view.View apply(android.content.Context, android.view.ViewGroup); @@ -59214,7 +60229,7 @@ package android.widget { method public void setRadioGroupChecked(@IdRes int, @IdRes int); method public void setRelativeScrollPosition(@IdRes int, int); method @Deprecated public void setRemoteAdapter(int, @IdRes int, android.content.Intent); - method @Deprecated public void setRemoteAdapter(@IdRes int, android.content.Intent); + method public void setRemoteAdapter(@IdRes int, android.content.Intent); method public void setRemoteAdapter(@IdRes int, @NonNull android.widget.RemoteViews.RemoteCollectionItems); method public void setScrollPosition(@IdRes int, int); method public void setShort(@IdRes int, String, short); @@ -59258,6 +60273,15 @@ package android.widget { ctor public RemoteViews.ActionException(String); } + @FlaggedApi("android.appwidget.flags.draw_data_parcel") public static final class RemoteViews.DrawInstructions { + method @FlaggedApi("android.appwidget.flags.draw_data_parcel") public static long getSupportedVersion(); + } + + @FlaggedApi("android.appwidget.flags.draw_data_parcel") public static final class RemoteViews.DrawInstructions.Builder { + ctor @FlaggedApi("android.appwidget.flags.draw_data_parcel") public RemoteViews.DrawInstructions.Builder(@NonNull java.util.List); + method @FlaggedApi("android.appwidget.flags.draw_data_parcel") @NonNull public android.widget.RemoteViews.DrawInstructions build(); + } + public static final class RemoteViews.RemoteCollectionItems implements android.os.Parcelable { method public int describeContents(); method public int getItemCount(); @@ -59903,6 +60927,7 @@ package android.widget { method public float getShadowDx(); method public float getShadowDy(); method public float getShadowRadius(); + method @FlaggedApi("com.android.text.flags.use_bounds_for_width") public boolean getShiftDrawingOffsetForStartOverhang(); method public final boolean getShowSoftInputOnFocus(); method public CharSequence getText(); method @NonNull public android.view.textclassifier.TextClassifier getTextClassifier(); @@ -59935,6 +60960,7 @@ package android.widget { method public boolean isFallbackLineSpacing(); method public final boolean isHorizontallyScrollable(); method public boolean isInputMethodTarget(); + method @FlaggedApi("com.android.text.flags.fix_line_height_for_locale") public boolean isLocalePreferredLineHeightForMinimumUsed(); method public boolean isSingleLine(); method public boolean isSuggestionsEnabled(); method public boolean isTextSelectable(); @@ -60017,6 +61043,7 @@ package android.widget { method public final void setLinkTextColor(@ColorInt int); method public final void setLinkTextColor(android.content.res.ColorStateList); method public final void setLinksClickable(boolean); + method @FlaggedApi("com.android.text.flags.fix_line_height_for_locale") public void setLocalePreferredLineHeightForMinimumUsed(boolean); method public void setMarqueeRepeatLimit(int); method public void setMaxEms(int); method public void setMaxHeight(int); @@ -60037,6 +61064,7 @@ package android.widget { method public void setSearchResultHighlights(@Nullable int...); method public void setSelectAllOnFocus(boolean); method public void setShadowLayer(float, float, float, int); + method @FlaggedApi("com.android.text.flags.use_bounds_for_width") public void setShiftDrawingOffsetForStartOverhang(boolean); method public final void setShowSoftInputOnFocus(boolean); method public void setSingleLine(); method public void setSingleLine(boolean); @@ -60431,6 +61459,12 @@ package android.window { field public static final int EDGE_RIGHT = 1; // 0x1 } + @FlaggedApi("com.android.window.flags.surface_control_input_receiver") public final class InputTransferToken implements android.os.Parcelable { + method public int describeContents(); + method public void writeToParcel(@NonNull android.os.Parcel, int); + field @NonNull public static final android.os.Parcelable.Creator CREATOR; + } + public interface OnBackAnimationCallback extends android.window.OnBackInvokedCallback { method public default void onBackCancelled(); method public default void onBackProgressed(@NonNull android.window.BackEvent); @@ -60478,11 +61512,11 @@ package android.window { @FlaggedApi("com.android.window.flags.trusted_presentation_listener_for_window") public final class TrustedPresentationThresholds implements android.os.Parcelable { ctor @FlaggedApi("com.android.window.flags.trusted_presentation_listener_for_window") public TrustedPresentationThresholds(@FloatRange(from=0.0f, fromInclusive=false, to=1.0f) float, @FloatRange(from=0.0f, fromInclusive=false, to=1.0f) float, @IntRange(from=1) int); method @FlaggedApi("com.android.window.flags.trusted_presentation_listener_for_window") public int describeContents(); + method @FlaggedApi("com.android.window.flags.trusted_presentation_listener_for_window") @FloatRange(from=0.0f, fromInclusive=false, to=1.0f) public float getMinAlpha(); + method @FlaggedApi("com.android.window.flags.trusted_presentation_listener_for_window") @FloatRange(from=0.0f, fromInclusive=false, to=1.0f) public float getMinFractionRendered(); + method @FlaggedApi("com.android.window.flags.trusted_presentation_listener_for_window") @IntRange(from=1) public int getStabilityRequirementMillis(); method @FlaggedApi("com.android.window.flags.trusted_presentation_listener_for_window") public void writeToParcel(@NonNull android.os.Parcel, int); field @FlaggedApi("com.android.window.flags.trusted_presentation_listener_for_window") @NonNull public static final android.os.Parcelable.Creator CREATOR; - field @FlaggedApi("com.android.window.flags.trusted_presentation_listener_for_window") @FloatRange(from=0.0f, fromInclusive=false, to=1.0f) public final float minAlpha; - field @FlaggedApi("com.android.window.flags.trusted_presentation_listener_for_window") @FloatRange(from=0.0f, fromInclusive=false, to=1.0f) public final float minFractionRendered; - field @FlaggedApi("com.android.window.flags.trusted_presentation_listener_for_window") @IntRange(from=1) public final int stabilityRequirementMs; } } diff --git a/core/api/lint-baseline.txt b/core/api/lint-baseline.txt index f331e7f5fa84961516da4e9ad2d94cadc2679e28..1b0da055038d9b9f54eb8d2003a0a624755127d9 100644 --- a/core/api/lint-baseline.txt +++ b/core/api/lint-baseline.txt @@ -181,12 +181,6 @@ BroadcastBehavior: android.media.tv.TvContract#ACTION_WATCH_NEXT_PROGRAM_BROWSAB Field 'ACTION_WATCH_NEXT_PROGRAM_BROWSABLE_DISABLED' is missing @BroadcastBehavior BroadcastBehavior: android.net.Proxy#PROXY_CHANGE_ACTION: Field 'PROXY_CHANGE_ACTION' is missing @BroadcastBehavior -BroadcastBehavior: android.nfc.NfcAdapter#ACTION_ADAPTER_STATE_CHANGED: - Field 'ACTION_ADAPTER_STATE_CHANGED' is missing @BroadcastBehavior -BroadcastBehavior: android.nfc.NfcAdapter#ACTION_PREFERRED_PAYMENT_CHANGED: - Field 'ACTION_PREFERRED_PAYMENT_CHANGED' is missing @BroadcastBehavior -BroadcastBehavior: android.nfc.NfcAdapter#ACTION_TRANSACTION_DETECTED: - Field 'ACTION_TRANSACTION_DETECTED' is missing @BroadcastBehavior BroadcastBehavior: android.os.DropBoxManager#ACTION_DROPBOX_ENTRY_ADDED: Field 'ACTION_DROPBOX_ENTRY_ADDED' is missing @BroadcastBehavior BroadcastBehavior: android.provider.CalendarContract#ACTION_EVENT_REMINDER: @@ -251,6 +245,14 @@ BroadcastBehavior: android.telephony.euicc.EuiccManager#ACTION_NOTIFY_CARRIER_SE Field 'ACTION_NOTIFY_CARRIER_SETUP_INCOMPLETE' is missing @BroadcastBehavior +CompileTimeConstant: android.hardware.camera2.ExtensionCaptureRequest#EFV_STABILIZATION_MODE_GIMBAL: + All constants must be defined at compile time: android.hardware.camera2.ExtensionCaptureRequest#EFV_STABILIZATION_MODE_GIMBAL +CompileTimeConstant: android.hardware.camera2.ExtensionCaptureRequest#EFV_STABILIZATION_MODE_LOCKED: + All constants must be defined at compile time: android.hardware.camera2.ExtensionCaptureRequest#EFV_STABILIZATION_MODE_LOCKED +CompileTimeConstant: android.hardware.camera2.ExtensionCaptureRequest#EFV_STABILIZATION_MODE_OFF: + All constants must be defined at compile time: android.hardware.camera2.ExtensionCaptureRequest#EFV_STABILIZATION_MODE_OFF + + DeprecationMismatch: android.accounts.AccountManager#newChooseAccountIntent(android.accounts.Account, java.util.ArrayList, String[], boolean, String, String, String[], android.os.Bundle): Method android.accounts.AccountManager.newChooseAccountIntent(android.accounts.Account, java.util.ArrayList, String[], boolean, String, String, String[], android.os.Bundle): @Deprecated annotation (present) and @deprecated doc tag (not present) do not match DeprecationMismatch: android.app.Activity#enterPictureInPictureMode(): @@ -395,6 +397,12 @@ InvalidNullabilityOverride: android.media.midi.MidiUmpDeviceService#onBind(andro Invalid nullability on parameter `intent` in method `onBind`. Parameters of overrides cannot be NonNull if the super parameter is unannotated. +KotlinOperator: android.graphics.Matrix44#get(int, int): + Method can be invoked with an indexing operator from Kotlin: `get` (this is usually desirable; just make sure it makes sense for this type of object) +KotlinOperator: android.graphics.Matrix44#set(int, int, float): + Method can be invoked with an indexing operator from Kotlin: `set` (this is usually desirable; just make sure it makes sense for this type of object) + + RequiresPermission: android.accounts.AccountManager#getAccountsByTypeAndFeatures(String, String[], android.accounts.AccountManagerCallback, android.os.Handler): Method 'getAccountsByTypeAndFeatures' documentation mentions permissions without declaring @RequiresPermission RequiresPermission: android.accounts.AccountManager#hasFeatures(android.accounts.Account, String[], android.accounts.AccountManagerCallback, android.os.Handler): @@ -483,6 +491,8 @@ RequiresPermission: android.app.admin.DevicePolicyManager#clearResetPasswordToke Method 'clearResetPasswordToken' documentation mentions permissions already declared by @RequiresPermission RequiresPermission: android.app.admin.DevicePolicyManager#generateKeyPair(android.content.ComponentName, String, android.security.keystore.KeyGenParameterSpec, int): Method 'generateKeyPair' documentation mentions permissions already declared by @RequiresPermission +RequiresPermission: android.app.admin.DevicePolicyManager#getContentProtectionPolicy(android.content.ComponentName): + Method 'getContentProtectionPolicy' documentation mentions permissions already declared by @RequiresPermission RequiresPermission: android.app.admin.DevicePolicyManager#getCrossProfileWidgetProviders(android.content.ComponentName): Method 'getCrossProfileWidgetProviders' documentation mentions permissions already declared by @RequiresPermission RequiresPermission: android.app.admin.DevicePolicyManager#getLockTaskFeatures(android.content.ComponentName): @@ -519,6 +529,8 @@ RequiresPermission: android.app.admin.DevicePolicyManager#removeCrossProfileWidg Method 'removeCrossProfileWidgetProvider' documentation mentions permissions already declared by @RequiresPermission RequiresPermission: android.app.admin.DevicePolicyManager#setAlwaysOnVpnPackage(android.content.ComponentName, String, boolean): Method 'setAlwaysOnVpnPackage' documentation mentions permissions without declaring @RequiresPermission +RequiresPermission: android.app.admin.DevicePolicyManager#setContentProtectionPolicy(android.content.ComponentName, int): + Method 'setContentProtectionPolicy' documentation mentions permissions already declared by @RequiresPermission RequiresPermission: android.app.admin.DevicePolicyManager#setLockTaskFeatures(android.content.ComponentName, int): Method 'setLockTaskFeatures' documentation mentions permissions already declared by @RequiresPermission RequiresPermission: android.app.admin.DevicePolicyManager#setLockTaskPackages(android.content.ComponentName, String[]): @@ -715,86 +727,6 @@ RequiresPermission: android.net.sip.SipAudioCall#setSpeakerMode(boolean): Method 'setSpeakerMode' documentation mentions permissions without declaring @RequiresPermission RequiresPermission: android.net.sip.SipAudioCall#startAudio(): Method 'startAudio' documentation mentions permissions without declaring @RequiresPermission -RequiresPermission: android.nfc.NfcAdapter#disableForegroundDispatch(android.app.Activity): - Method 'disableForegroundDispatch' documentation mentions permissions without declaring @RequiresPermission -RequiresPermission: android.nfc.NfcAdapter#enableForegroundDispatch(android.app.Activity, android.app.PendingIntent, android.content.IntentFilter[], String[][]): - Method 'enableForegroundDispatch' documentation mentions permissions without declaring @RequiresPermission -RequiresPermission: android.nfc.cardemulation.CardEmulation#isDefaultServiceForAid(android.content.ComponentName, String): - Method 'isDefaultServiceForAid' documentation mentions permissions without declaring @RequiresPermission -RequiresPermission: android.nfc.cardemulation.CardEmulation#isDefaultServiceForCategory(android.content.ComponentName, String): - Method 'isDefaultServiceForCategory' documentation mentions permissions without declaring @RequiresPermission -RequiresPermission: android.nfc.cardemulation.CardEmulation#setOffHostForService(android.content.ComponentName, String): - Method 'setOffHostForService' documentation mentions permissions already declared by @RequiresPermission -RequiresPermission: android.nfc.tech.IsoDep#getTimeout(): - Method 'getTimeout' documentation mentions permissions without declaring @RequiresPermission -RequiresPermission: android.nfc.tech.IsoDep#setTimeout(int): - Method 'setTimeout' documentation mentions permissions without declaring @RequiresPermission -RequiresPermission: android.nfc.tech.IsoDep#transceive(byte[]): - Method 'transceive' documentation mentions permissions without declaring @RequiresPermission -RequiresPermission: android.nfc.tech.MifareClassic#authenticateSectorWithKeyA(int, byte[]): - Method 'authenticateSectorWithKeyA' documentation mentions permissions without declaring @RequiresPermission -RequiresPermission: android.nfc.tech.MifareClassic#authenticateSectorWithKeyB(int, byte[]): - Method 'authenticateSectorWithKeyB' documentation mentions permissions without declaring @RequiresPermission -RequiresPermission: android.nfc.tech.MifareClassic#decrement(int, int): - Method 'decrement' documentation mentions permissions without declaring @RequiresPermission -RequiresPermission: android.nfc.tech.MifareClassic#getTimeout(): - Method 'getTimeout' documentation mentions permissions without declaring @RequiresPermission -RequiresPermission: android.nfc.tech.MifareClassic#increment(int, int): - Method 'increment' documentation mentions permissions without declaring @RequiresPermission -RequiresPermission: android.nfc.tech.MifareClassic#readBlock(int): - Method 'readBlock' documentation mentions permissions without declaring @RequiresPermission -RequiresPermission: android.nfc.tech.MifareClassic#restore(int): - Method 'restore' documentation mentions permissions without declaring @RequiresPermission -RequiresPermission: android.nfc.tech.MifareClassic#setTimeout(int): - Method 'setTimeout' documentation mentions permissions without declaring @RequiresPermission -RequiresPermission: android.nfc.tech.MifareClassic#transceive(byte[]): - Method 'transceive' documentation mentions permissions without declaring @RequiresPermission -RequiresPermission: android.nfc.tech.MifareClassic#transfer(int): - Method 'transfer' documentation mentions permissions without declaring @RequiresPermission -RequiresPermission: android.nfc.tech.MifareClassic#writeBlock(int, byte[]): - Method 'writeBlock' documentation mentions permissions without declaring @RequiresPermission -RequiresPermission: android.nfc.tech.MifareUltralight#getTimeout(): - Method 'getTimeout' documentation mentions permissions without declaring @RequiresPermission -RequiresPermission: android.nfc.tech.MifareUltralight#readPages(int): - Method 'readPages' documentation mentions permissions without declaring @RequiresPermission -RequiresPermission: android.nfc.tech.MifareUltralight#setTimeout(int): - Method 'setTimeout' documentation mentions permissions without declaring @RequiresPermission -RequiresPermission: android.nfc.tech.MifareUltralight#transceive(byte[]): - Method 'transceive' documentation mentions permissions without declaring @RequiresPermission -RequiresPermission: android.nfc.tech.MifareUltralight#writePage(int, byte[]): - Method 'writePage' documentation mentions permissions without declaring @RequiresPermission -RequiresPermission: android.nfc.tech.Ndef#getNdefMessage(): - Method 'getNdefMessage' documentation mentions permissions without declaring @RequiresPermission -RequiresPermission: android.nfc.tech.Ndef#isWritable(): - Method 'isWritable' documentation mentions permissions without declaring @RequiresPermission -RequiresPermission: android.nfc.tech.Ndef#makeReadOnly(): - Method 'makeReadOnly' documentation mentions permissions without declaring @RequiresPermission -RequiresPermission: android.nfc.tech.Ndef#writeNdefMessage(android.nfc.NdefMessage): - Method 'writeNdefMessage' documentation mentions permissions without declaring @RequiresPermission -RequiresPermission: android.nfc.tech.NdefFormatable#format(android.nfc.NdefMessage): - Method 'format' documentation mentions permissions without declaring @RequiresPermission -RequiresPermission: android.nfc.tech.NdefFormatable#formatReadOnly(android.nfc.NdefMessage): - Method 'formatReadOnly' documentation mentions permissions without declaring @RequiresPermission -RequiresPermission: android.nfc.tech.NfcA#getTimeout(): - Method 'getTimeout' documentation mentions permissions without declaring @RequiresPermission -RequiresPermission: android.nfc.tech.NfcA#setTimeout(int): - Method 'setTimeout' documentation mentions permissions without declaring @RequiresPermission -RequiresPermission: android.nfc.tech.NfcA#transceive(byte[]): - Method 'transceive' documentation mentions permissions without declaring @RequiresPermission -RequiresPermission: android.nfc.tech.NfcB#transceive(byte[]): - Method 'transceive' documentation mentions permissions without declaring @RequiresPermission -RequiresPermission: android.nfc.tech.NfcF#getTimeout(): - Method 'getTimeout' documentation mentions permissions without declaring @RequiresPermission -RequiresPermission: android.nfc.tech.NfcF#setTimeout(int): - Method 'setTimeout' documentation mentions permissions without declaring @RequiresPermission -RequiresPermission: android.nfc.tech.NfcF#transceive(byte[]): - Method 'transceive' documentation mentions permissions without declaring @RequiresPermission -RequiresPermission: android.nfc.tech.NfcV#transceive(byte[]): - Method 'transceive' documentation mentions permissions without declaring @RequiresPermission -RequiresPermission: android.nfc.tech.TagTechnology#close(): - Method 'close' documentation mentions permissions without declaring @RequiresPermission -RequiresPermission: android.nfc.tech.TagTechnology#connect(): - Method 'connect' documentation mentions permissions without declaring @RequiresPermission RequiresPermission: android.os.BugreportManager#cancelBugreport(): Method 'cancelBugreport' documentation mentions permissions without declaring @RequiresPermission RequiresPermission: android.os.Build#getSerial(): @@ -1163,12 +1095,80 @@ RequiresPermission: android.webkit.WebSettings#setGeolocationEnabled(boolean): Method 'setGeolocationEnabled' documentation mentions permissions without declaring @RequiresPermission +StaticUtils: ExtensionCaptureRequest: + Fully-static utility classes must not have constructor +StaticUtils: android.hardware.camera2.ExtensionCaptureRequest: + Fully-static utility classes must not have constructor +StaticUtils: android.hardware.camera2.ExtensionCaptureResult: + Fully-static utility classes must not have constructor + + Todo: android.hardware.camera2.params.StreamConfigurationMap: Documentation mentions 'TODO' Todo: android.provider.ContactsContract.RawContacts#newEntityIterator(android.database.Cursor): Documentation mentions 'TODO' +UnflaggedApi: android.R.color#on_surface_disabled_material: + New API must be flagged with @FlaggedApi: field android.R.color.on_surface_disabled_material +UnflaggedApi: android.R.color#outline_disabled_material: + New API must be flagged with @FlaggedApi: field android.R.color.outline_disabled_material +UnflaggedApi: android.R.color#surface_disabled_material: + New API must be flagged with @FlaggedApi: field android.R.color.surface_disabled_material +UnflaggedApi: android.R.color#system_error_0: + New API must be flagged with @FlaggedApi: field android.R.color.system_error_0 +UnflaggedApi: android.R.color#system_error_10: + New API must be flagged with @FlaggedApi: field android.R.color.system_error_10 +UnflaggedApi: android.R.color#system_error_100: + New API must be flagged with @FlaggedApi: field android.R.color.system_error_100 +UnflaggedApi: android.R.color#system_error_1000: + New API must be flagged with @FlaggedApi: field android.R.color.system_error_1000 +UnflaggedApi: android.R.color#system_error_200: + New API must be flagged with @FlaggedApi: field android.R.color.system_error_200 +UnflaggedApi: android.R.color#system_error_300: + New API must be flagged with @FlaggedApi: field android.R.color.system_error_300 +UnflaggedApi: android.R.color#system_error_400: + New API must be flagged with @FlaggedApi: field android.R.color.system_error_400 +UnflaggedApi: android.R.color#system_error_50: + New API must be flagged with @FlaggedApi: field android.R.color.system_error_50 +UnflaggedApi: android.R.color#system_error_500: + New API must be flagged with @FlaggedApi: field android.R.color.system_error_500 +UnflaggedApi: android.R.color#system_error_600: + New API must be flagged with @FlaggedApi: field android.R.color.system_error_600 +UnflaggedApi: android.R.color#system_error_700: + New API must be flagged with @FlaggedApi: field android.R.color.system_error_700 +UnflaggedApi: android.R.color#system_error_800: + New API must be flagged with @FlaggedApi: field android.R.color.system_error_800 +UnflaggedApi: android.R.color#system_error_900: + New API must be flagged with @FlaggedApi: field android.R.color.system_error_900 +UnflaggedApi: android.R.color#system_on_surface_disabled: + New API must be flagged with @FlaggedApi: field android.R.color.system_on_surface_disabled +UnflaggedApi: android.R.color#system_on_surface_disabled_dark: + New API must be flagged with @FlaggedApi: field android.R.color.system_on_surface_disabled_dark +UnflaggedApi: android.R.color#system_on_surface_disabled_light: + New API must be flagged with @FlaggedApi: field android.R.color.system_on_surface_disabled_light +UnflaggedApi: android.R.color#system_outline_disabled: + New API must be flagged with @FlaggedApi: field android.R.color.system_outline_disabled +UnflaggedApi: android.R.color#system_outline_disabled_dark: + New API must be flagged with @FlaggedApi: field android.R.color.system_outline_disabled_dark +UnflaggedApi: android.R.color#system_outline_disabled_light: + New API must be flagged with @FlaggedApi: field android.R.color.system_outline_disabled_light +UnflaggedApi: android.R.color#system_surface_disabled: + New API must be flagged with @FlaggedApi: field android.R.color.system_surface_disabled +UnflaggedApi: android.R.color#system_surface_disabled_dark: + New API must be flagged with @FlaggedApi: field android.R.color.system_surface_disabled_dark +UnflaggedApi: android.R.color#system_surface_disabled_light: + New API must be flagged with @FlaggedApi: field android.R.color.system_surface_disabled_light +UnflaggedApi: android.R.dimen#system_corner_radius_large: + New API must be flagged with @FlaggedApi: field android.R.dimen.system_corner_radius_large +UnflaggedApi: android.R.dimen#system_corner_radius_medium: + New API must be flagged with @FlaggedApi: field android.R.dimen.system_corner_radius_medium +UnflaggedApi: android.R.dimen#system_corner_radius_small: + New API must be flagged with @FlaggedApi: field android.R.dimen.system_corner_radius_small +UnflaggedApi: android.R.dimen#system_corner_radius_xlarge: + New API must be flagged with @FlaggedApi: field android.R.dimen.system_corner_radius_xlarge +UnflaggedApi: android.R.dimen#system_corner_radius_xsmall: + New API must be flagged with @FlaggedApi: field android.R.dimen.system_corner_radius_xsmall UnflaggedApi: android.accessibilityservice.AccessibilityService#OVERLAY_RESULT_INTERNAL_ERROR: New API must be flagged with @FlaggedApi: field android.accessibilityservice.AccessibilityService.OVERLAY_RESULT_INTERNAL_ERROR UnflaggedApi: android.accessibilityservice.AccessibilityService#OVERLAY_RESULT_INVALID: @@ -1461,6 +1461,15 @@ UnflaggedApi: android.graphics.text.PositionedGlyphs#getItalicOverride(int): New API must be flagged with @FlaggedApi: method android.graphics.text.PositionedGlyphs.getItalicOverride(int) UnflaggedApi: android.graphics.text.PositionedGlyphs#getWeightOverride(int): New API must be flagged with @FlaggedApi: method android.graphics.text.PositionedGlyphs.getWeightOverride(int) + +UnflaggedApi: android.hardware.camera2.ExtensionCaptureRequest: + New API must be flagged with @FlaggedApi: class android.hardware.camera2.ExtensionCaptureRequest +UnflaggedApi: android.hardware.camera2.ExtensionCaptureRequest#ExtensionCaptureRequest(): + New API must be flagged with @FlaggedApi: constructor android.hardware.camera2.ExtensionCaptureRequest() +UnflaggedApi: android.hardware.camera2.ExtensionCaptureResult: + New API must be flagged with @FlaggedApi: class android.hardware.camera2.ExtensionCaptureResult +UnflaggedApi: android.hardware.camera2.ExtensionCaptureResult#ExtensionCaptureResult(): + New API must be flagged with @FlaggedApi: constructor android.hardware.camera2.ExtensionCaptureResult() UnflaggedApi: android.media.MediaRoute2Info#TYPE_REMOTE_CAR: New API must be flagged with @FlaggedApi: field android.media.MediaRoute2Info.TYPE_REMOTE_CAR UnflaggedApi: android.media.MediaRoute2Info#TYPE_REMOTE_COMPUTER: diff --git a/core/api/module-lib-current.txt b/core/api/module-lib-current.txt index 513e5bb9d0847bf6cb533264d83de3709acc8597..9c1a8e854e92ac7dd131cf6c6e3a56c5eba67ffb 100644 --- a/core/api/module-lib-current.txt +++ b/core/api/module-lib-current.txt @@ -6,7 +6,6 @@ package android { field public static final String CONTROL_AUTOMOTIVE_GNSS = "android.permission.CONTROL_AUTOMOTIVE_GNSS"; field public static final String GET_INTENT_SENDER_INTENT = "android.permission.GET_INTENT_SENDER_INTENT"; field public static final String MAKE_UID_VISIBLE = "android.permission.MAKE_UID_VISIBLE"; - field @FlaggedApi("android.companion.flags.companion_transport_apis") public static final String USE_COMPANION_TRANSPORTS = "android.permission.USE_COMPANION_TRANSPORTS"; } } @@ -67,6 +66,11 @@ package android.app { method @RequiresPermission(android.Manifest.permission.STATUS_BAR) public void setExpansionDisabledForSimNetworkLock(boolean); } + public final class SystemServiceRegistry { + method @FlaggedApi("android.webkit.update_service_ipc_wrapper") @Nullable public static Object getSystemServiceWithNoContext(@NonNull String); + method @FlaggedApi("android.webkit.update_service_ipc_wrapper") public static void registerForeverStaticService(@NonNull String, @NonNull Class, @NonNull android.app.SystemServiceRegistry.StaticServiceProducerWithBinder); + } + } package android.app.admin { @@ -82,29 +86,6 @@ package android.app.admin { } -package android.companion { - - public final class CompanionDeviceManager { - method @FlaggedApi("android.companion.companion_transport_apis") @RequiresPermission(android.Manifest.permission.USE_COMPANION_TRANSPORTS) public void addOnMessageReceivedListener(@NonNull java.util.concurrent.Executor, int, @NonNull android.companion.CompanionDeviceManager.OnMessageReceivedListener); - method @FlaggedApi("android.companion.companion_transport_apis") @RequiresPermission(android.Manifest.permission.USE_COMPANION_TRANSPORTS) public void addOnTransportsChangedListener(@NonNull java.util.concurrent.Executor, @NonNull android.companion.CompanionDeviceManager.OnTransportsChangedListener); - method @FlaggedApi("android.companion.companion_transport_apis") @RequiresPermission(android.Manifest.permission.USE_COMPANION_TRANSPORTS) public void removeOnMessageReceivedListener(int, @NonNull android.companion.CompanionDeviceManager.OnMessageReceivedListener); - method @FlaggedApi("android.companion.companion_transport_apis") @RequiresPermission(android.Manifest.permission.USE_COMPANION_TRANSPORTS) public void removeOnTransportsChangedListener(@NonNull android.companion.CompanionDeviceManager.OnTransportsChangedListener); - method @FlaggedApi("android.companion.companion_transport_apis") @RequiresPermission(android.Manifest.permission.USE_COMPANION_TRANSPORTS) public void sendMessage(int, @NonNull byte[], @NonNull int[]); - field @FlaggedApi("android.companion.companion_transport_apis") public static final int MESSAGE_REQUEST_CONTEXT_SYNC = 1667729539; // 0x63678883 - field @FlaggedApi("android.companion.companion_transport_apis") public static final int MESSAGE_REQUEST_PERMISSION_RESTORE = 1669491075; // 0x63826983 - field @FlaggedApi("android.companion.companion_transport_apis") public static final int MESSAGE_REQUEST_REMOTE_AUTHENTICATION = 1669494629; // 0x63827765 - } - - @FlaggedApi("android.companion.companion_transport_apis") public static interface CompanionDeviceManager.OnMessageReceivedListener { - method public void onMessageReceived(int, @NonNull byte[]); - } - - @FlaggedApi("android.companion.companion_transport_apis") public static interface CompanionDeviceManager.OnTransportsChangedListener { - method public void onTransportsChanged(@NonNull java.util.List); - } - -} - package android.content { public abstract class ContentProvider implements android.content.ComponentCallbacks2 { @@ -121,6 +102,7 @@ package android.content { method @NonNull public android.os.UserHandle getUser(); field public static final String PAC_PROXY_SERVICE = "pac_proxy"; field public static final String TEST_NETWORK_SERVICE = "test_network"; + field @FlaggedApi("android.webkit.update_service_ipc_wrapper") public static final String WEBVIEW_UPDATE_SERVICE = "webviewupdate"; } public class Intent implements java.lang.Cloneable android.os.Parcelable { @@ -151,6 +133,11 @@ package android.content.pm { field public static final int MATCH_STATIC_SHARED_AND_SDK_LIBRARIES = 67108864; // 0x4000000 } + @FlaggedApi("android.permission.flags.enhanced_confirmation_mode_apis_enabled") public class SignedPackage { + method @NonNull public byte[] getCertificateDigest(); + method @NonNull public String getPackageName(); + } + } package android.hardware.usb { @@ -331,17 +318,6 @@ package android.net.netstats { } -package android.net.wifi { - - public final class WifiKeystore { - method @NonNull public static byte[] get(@NonNull String); - method @NonNull public static String[] list(@NonNull String); - method public static boolean put(@NonNull String, @NonNull byte[]); - method public static boolean remove(@NonNull String); - } - -} - package android.nfc { public class NfcServiceManager { @@ -400,6 +376,10 @@ package android.os { field public static final int DEVICE_INITIAL_SDK_INT; } + public class Environment { + method @FlaggedApi("android.crashrecovery.flags.enable_crashrecovery") @NonNull public static java.io.File getDataSystemDeDirectory(); + } + public class IpcDataCache { ctor public IpcDataCache(int, @NonNull String, @NonNull String, @NonNull String, @NonNull android.os.IpcDataCache.QueryHandler); method public void disableForCurrentProcess(); @@ -417,13 +397,24 @@ package android.os { } public class Process { - method public static final int getAppUidForSdkSandboxUid(int); - method public static final boolean isSdkSandboxUid(int); method public static final int toSdkSandboxUid(int); field public static final int NFC_UID = 1027; // 0x403 field public static final int VPN_UID = 1016; // 0x3f8 } + @FlaggedApi("android.os.telemetry_apis_framework_initialization") public class ProfilingServiceManager { + method @NonNull public android.os.ProfilingServiceManager.ServiceRegisterer getProfilingServiceRegisterer(); + } + + public static class ProfilingServiceManager.ServiceNotFoundException extends java.lang.Exception { + ctor public ProfilingServiceManager.ServiceNotFoundException(@NonNull String); + } + + public static final class ProfilingServiceManager.ServiceRegisterer { + method @Nullable public android.os.IBinder get(); + method @Nullable public android.os.IBinder getOrThrow() throws android.os.ProfilingServiceManager.ServiceNotFoundException; + } + public final class ServiceManager { method @NonNull public static String[] getDeclaredInstances(@NonNull String); method public static boolean isDeclared(@NonNull String); @@ -451,6 +442,8 @@ package android.os { public class SystemConfigManager { method @NonNull public java.util.List getEnabledComponentOverrides(@NonNull String); + method @FlaggedApi("android.permission.flags.enhanced_confirmation_mode_apis_enabled") @NonNull @RequiresPermission(android.Manifest.permission.MANAGE_ENHANCED_CONFIRMATION_STATES) public java.util.Set getEnhancedConfirmationTrustedInstallers(); + method @FlaggedApi("android.permission.flags.enhanced_confirmation_mode_apis_enabled") @NonNull @RequiresPermission(android.Manifest.permission.MANAGE_ENHANCED_CONFIRMATION_STATES) public java.util.Set getEnhancedConfirmationTrustedPackages(); } public final class Trace { @@ -647,3 +640,34 @@ package android.view.accessibility { } +package android.webkit { + + @FlaggedApi("android.webkit.update_service_ipc_wrapper") public class WebViewBootstrapFrameworkInitializer { + method public static void registerServiceWrappers(); + } + + @FlaggedApi("android.webkit.update_service_ipc_wrapper") public final class WebViewProviderResponse implements android.os.Parcelable { + ctor public WebViewProviderResponse(@Nullable android.content.pm.PackageInfo, int); + method public int describeContents(); + method public void writeToParcel(@NonNull android.os.Parcel, int); + field @NonNull public static final android.os.Parcelable.Creator CREATOR; + field public static final int STATUS_FAILED_LISTING_WEBVIEW_PACKAGES = 4; // 0x4 + field public static final int STATUS_FAILED_WAITING_FOR_RELRO = 3; // 0x3 + field public static final int STATUS_SUCCESS = 0; // 0x0 + field @Nullable public final android.content.pm.PackageInfo packageInfo; + field public final int status; + } + + @FlaggedApi("android.webkit.update_service_ipc_wrapper") public final class WebViewUpdateManager { + method @Nullable @RequiresPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) public String changeProviderAndSetting(@NonNull String); + method @NonNull public android.webkit.WebViewProviderInfo[] getAllWebViewPackages(); + method @Nullable public android.content.pm.PackageInfo getCurrentWebViewPackage(); + method @Nullable public String getCurrentWebViewPackageName(); + method @FlaggedApi("android.webkit.update_service_v2") @NonNull public android.webkit.WebViewProviderInfo getDefaultWebViewPackage(); + method @Nullable public static android.webkit.WebViewUpdateManager getInstance(); + method @NonNull public android.webkit.WebViewProviderInfo[] getValidWebViewPackages(); + method @NonNull public android.webkit.WebViewProviderResponse waitForAndGetProvider(); + } + +} + diff --git a/core/api/module-lib-lint-baseline.txt b/core/api/module-lib-lint-baseline.txt index a6a948c7f64c741622c89ec10f642beca9d811d8..42c4efc139caa53b0ac4445aec151ee06c42a9ea 100644 --- a/core/api/module-lib-lint-baseline.txt +++ b/core/api/module-lib-lint-baseline.txt @@ -235,14 +235,6 @@ BroadcastBehavior: android.net.NetworkScoreManager#ACTION_SCORE_NETWORKS: Field 'ACTION_SCORE_NETWORKS' is missing @BroadcastBehavior BroadcastBehavior: android.net.Proxy#PROXY_CHANGE_ACTION: Field 'PROXY_CHANGE_ACTION' is missing @BroadcastBehavior -BroadcastBehavior: android.nfc.NfcAdapter#ACTION_ADAPTER_STATE_CHANGED: - Field 'ACTION_ADAPTER_STATE_CHANGED' is missing @BroadcastBehavior -BroadcastBehavior: android.nfc.NfcAdapter#ACTION_PREFERRED_PAYMENT_CHANGED: - Field 'ACTION_PREFERRED_PAYMENT_CHANGED' is missing @BroadcastBehavior -BroadcastBehavior: android.nfc.NfcAdapter#ACTION_REQUIRE_UNLOCK_FOR_NFC: - Field 'ACTION_REQUIRE_UNLOCK_FOR_NFC' is missing @BroadcastBehavior -BroadcastBehavior: android.nfc.NfcAdapter#ACTION_TRANSACTION_DETECTED: - Field 'ACTION_TRANSACTION_DETECTED' is missing @BroadcastBehavior BroadcastBehavior: android.os.DropBoxManager#ACTION_DROPBOX_ENTRY_ADDED: Field 'ACTION_DROPBOX_ENTRY_ADDED' is missing @BroadcastBehavior BroadcastBehavior: android.provider.CalendarContract#ACTION_EVENT_REMINDER: @@ -619,6 +611,8 @@ RequiresPermission: android.app.admin.DevicePolicyManager#generateKeyPair(androi Method 'generateKeyPair' documentation mentions permissions already declared by @RequiresPermission RequiresPermission: android.app.admin.DevicePolicyManager#getApplicationExemptions(String): Method 'getApplicationExemptions' documentation mentions permissions already declared by @RequiresPermission +RequiresPermission: android.app.admin.DevicePolicyManager#getContentProtectionPolicy(android.content.ComponentName): + Method 'getContentProtectionPolicy' documentation mentions permissions already declared by @RequiresPermission RequiresPermission: android.app.admin.DevicePolicyManager#getCrossProfileWidgetProviders(android.content.ComponentName): Method 'getCrossProfileWidgetProviders' documentation mentions permissions already declared by @RequiresPermission RequiresPermission: android.app.admin.DevicePolicyManager#getLockTaskFeatures(android.content.ComponentName): @@ -665,6 +659,8 @@ RequiresPermission: android.app.admin.DevicePolicyManager#setAlwaysOnVpnPackage( Method 'setAlwaysOnVpnPackage' documentation mentions permissions without declaring @RequiresPermission RequiresPermission: android.app.admin.DevicePolicyManager#setApplicationExemptions(String, java.util.Set): Method 'setApplicationExemptions' documentation mentions permissions already declared by @RequiresPermission +RequiresPermission: android.app.admin.DevicePolicyManager#setContentProtectionPolicy(android.content.ComponentName, int): + Method 'setContentProtectionPolicy' documentation mentions permissions already declared by @RequiresPermission RequiresPermission: android.app.admin.DevicePolicyManager#setDeviceProvisioningConfigApplied(): Method 'setDeviceProvisioningConfigApplied' documentation mentions permissions already declared by @RequiresPermission RequiresPermission: android.app.admin.DevicePolicyManager#setLockTaskFeatures(android.content.ComponentName, int): @@ -1009,86 +1005,6 @@ RequiresPermission: android.net.vcn.VcnManager#applyVcnNetworkPolicy(android.net Method 'applyVcnNetworkPolicy' documentation mentions permissions already declared by @RequiresPermission RequiresPermission: android.net.vcn.VcnManager#removeVcnNetworkPolicyChangeListener(android.net.vcn.VcnManager.VcnNetworkPolicyChangeListener): Method 'removeVcnNetworkPolicyChangeListener' documentation mentions permissions already declared by @RequiresPermission -RequiresPermission: android.nfc.NfcAdapter#disableForegroundDispatch(android.app.Activity): - Method 'disableForegroundDispatch' documentation mentions permissions without declaring @RequiresPermission -RequiresPermission: android.nfc.NfcAdapter#enableForegroundDispatch(android.app.Activity, android.app.PendingIntent, android.content.IntentFilter[], String[][]): - Method 'enableForegroundDispatch' documentation mentions permissions without declaring @RequiresPermission -RequiresPermission: android.nfc.cardemulation.CardEmulation#isDefaultServiceForAid(android.content.ComponentName, String): - Method 'isDefaultServiceForAid' documentation mentions permissions without declaring @RequiresPermission -RequiresPermission: android.nfc.cardemulation.CardEmulation#isDefaultServiceForCategory(android.content.ComponentName, String): - Method 'isDefaultServiceForCategory' documentation mentions permissions without declaring @RequiresPermission -RequiresPermission: android.nfc.cardemulation.CardEmulation#setOffHostForService(android.content.ComponentName, String): - Method 'setOffHostForService' documentation mentions permissions already declared by @RequiresPermission -RequiresPermission: android.nfc.tech.IsoDep#getTimeout(): - Method 'getTimeout' documentation mentions permissions without declaring @RequiresPermission -RequiresPermission: android.nfc.tech.IsoDep#setTimeout(int): - Method 'setTimeout' documentation mentions permissions without declaring @RequiresPermission -RequiresPermission: android.nfc.tech.IsoDep#transceive(byte[]): - Method 'transceive' documentation mentions permissions without declaring @RequiresPermission -RequiresPermission: android.nfc.tech.MifareClassic#authenticateSectorWithKeyA(int, byte[]): - Method 'authenticateSectorWithKeyA' documentation mentions permissions without declaring @RequiresPermission -RequiresPermission: android.nfc.tech.MifareClassic#authenticateSectorWithKeyB(int, byte[]): - Method 'authenticateSectorWithKeyB' documentation mentions permissions without declaring @RequiresPermission -RequiresPermission: android.nfc.tech.MifareClassic#decrement(int, int): - Method 'decrement' documentation mentions permissions without declaring @RequiresPermission -RequiresPermission: android.nfc.tech.MifareClassic#getTimeout(): - Method 'getTimeout' documentation mentions permissions without declaring @RequiresPermission -RequiresPermission: android.nfc.tech.MifareClassic#increment(int, int): - Method 'increment' documentation mentions permissions without declaring @RequiresPermission -RequiresPermission: android.nfc.tech.MifareClassic#readBlock(int): - Method 'readBlock' documentation mentions permissions without declaring @RequiresPermission -RequiresPermission: android.nfc.tech.MifareClassic#restore(int): - Method 'restore' documentation mentions permissions without declaring @RequiresPermission -RequiresPermission: android.nfc.tech.MifareClassic#setTimeout(int): - Method 'setTimeout' documentation mentions permissions without declaring @RequiresPermission -RequiresPermission: android.nfc.tech.MifareClassic#transceive(byte[]): - Method 'transceive' documentation mentions permissions without declaring @RequiresPermission -RequiresPermission: android.nfc.tech.MifareClassic#transfer(int): - Method 'transfer' documentation mentions permissions without declaring @RequiresPermission -RequiresPermission: android.nfc.tech.MifareClassic#writeBlock(int, byte[]): - Method 'writeBlock' documentation mentions permissions without declaring @RequiresPermission -RequiresPermission: android.nfc.tech.MifareUltralight#getTimeout(): - Method 'getTimeout' documentation mentions permissions without declaring @RequiresPermission -RequiresPermission: android.nfc.tech.MifareUltralight#readPages(int): - Method 'readPages' documentation mentions permissions without declaring @RequiresPermission -RequiresPermission: android.nfc.tech.MifareUltralight#setTimeout(int): - Method 'setTimeout' documentation mentions permissions without declaring @RequiresPermission -RequiresPermission: android.nfc.tech.MifareUltralight#transceive(byte[]): - Method 'transceive' documentation mentions permissions without declaring @RequiresPermission -RequiresPermission: android.nfc.tech.MifareUltralight#writePage(int, byte[]): - Method 'writePage' documentation mentions permissions without declaring @RequiresPermission -RequiresPermission: android.nfc.tech.Ndef#getNdefMessage(): - Method 'getNdefMessage' documentation mentions permissions without declaring @RequiresPermission -RequiresPermission: android.nfc.tech.Ndef#isWritable(): - Method 'isWritable' documentation mentions permissions without declaring @RequiresPermission -RequiresPermission: android.nfc.tech.Ndef#makeReadOnly(): - Method 'makeReadOnly' documentation mentions permissions without declaring @RequiresPermission -RequiresPermission: android.nfc.tech.Ndef#writeNdefMessage(android.nfc.NdefMessage): - Method 'writeNdefMessage' documentation mentions permissions without declaring @RequiresPermission -RequiresPermission: android.nfc.tech.NdefFormatable#format(android.nfc.NdefMessage): - Method 'format' documentation mentions permissions without declaring @RequiresPermission -RequiresPermission: android.nfc.tech.NdefFormatable#formatReadOnly(android.nfc.NdefMessage): - Method 'formatReadOnly' documentation mentions permissions without declaring @RequiresPermission -RequiresPermission: android.nfc.tech.NfcA#getTimeout(): - Method 'getTimeout' documentation mentions permissions without declaring @RequiresPermission -RequiresPermission: android.nfc.tech.NfcA#setTimeout(int): - Method 'setTimeout' documentation mentions permissions without declaring @RequiresPermission -RequiresPermission: android.nfc.tech.NfcA#transceive(byte[]): - Method 'transceive' documentation mentions permissions without declaring @RequiresPermission -RequiresPermission: android.nfc.tech.NfcB#transceive(byte[]): - Method 'transceive' documentation mentions permissions without declaring @RequiresPermission -RequiresPermission: android.nfc.tech.NfcF#getTimeout(): - Method 'getTimeout' documentation mentions permissions without declaring @RequiresPermission -RequiresPermission: android.nfc.tech.NfcF#setTimeout(int): - Method 'setTimeout' documentation mentions permissions without declaring @RequiresPermission -RequiresPermission: android.nfc.tech.NfcF#transceive(byte[]): - Method 'transceive' documentation mentions permissions without declaring @RequiresPermission -RequiresPermission: android.nfc.tech.NfcV#transceive(byte[]): - Method 'transceive' documentation mentions permissions without declaring @RequiresPermission -RequiresPermission: android.nfc.tech.TagTechnology#close(): - Method 'close' documentation mentions permissions without declaring @RequiresPermission -RequiresPermission: android.nfc.tech.TagTechnology#connect(): - Method 'connect' documentation mentions permissions without declaring @RequiresPermission RequiresPermission: android.os.BugreportManager#cancelBugreport(): Method 'cancelBugreport' documentation mentions permissions without declaring @RequiresPermission RequiresPermission: android.os.BugreportManager#preDumpUiData(): @@ -1769,8 +1685,6 @@ SdkConstant: android.hardware.usb.UsbManager#ACTION_USB_PORT_COMPLIANCE_CHANGED: Field 'ACTION_USB_PORT_COMPLIANCE_CHANGED' is missing @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) SdkConstant: android.hardware.usb.UsbManager#ACTION_USB_STATE: Field 'ACTION_USB_STATE' is missing @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) -SdkConstant: android.nfc.NfcAdapter#ACTION_REQUIRE_UNLOCK_FOR_NFC: - Field 'ACTION_REQUIRE_UNLOCK_FOR_NFC' is missing @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) SdkConstant: android.service.euicc.EuiccService#ACTION_DELETE_SUBSCRIPTION_PRIVILEGED: Field 'ACTION_DELETE_SUBSCRIPTION_PRIVILEGED' is missing @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) SdkConstant: android.service.euicc.EuiccService#ACTION_RENAME_SUBSCRIPTION_PRIVILEGED: diff --git a/core/api/system-current.txt b/core/api/system-current.txt index 14a49aeacf04763927e6c7ff5f78ab97dd479e00..5580d6a39fa3ade1b1fc33ba1adc0ab054878c57 100644 --- a/core/api/system-current.txt +++ b/core/api/system-current.txt @@ -11,7 +11,9 @@ package android { field public static final String ACCESS_DRM_CERTIFICATES = "android.permission.ACCESS_DRM_CERTIFICATES"; field @Deprecated public static final String ACCESS_FM_RADIO = "android.permission.ACCESS_FM_RADIO"; field public static final String ACCESS_FPS_COUNTER = "android.permission.ACCESS_FPS_COUNTER"; + field @FlaggedApi("android.multiuser.flags.enable_permission_to_access_hidden_profiles") public static final String ACCESS_HIDDEN_PROFILES_FULL = "android.permission.ACCESS_HIDDEN_PROFILES_FULL"; field public static final String ACCESS_INSTANT_APPS = "android.permission.ACCESS_INSTANT_APPS"; + field @FlaggedApi("com.android.server.telecom.flags.telecom_resolve_hidden_dependencies") public static final String ACCESS_LAST_KNOWN_CELL_ID = "android.permission.ACCESS_LAST_KNOWN_CELL_ID"; field public static final String ACCESS_LOCUS_ID_USAGE_STATS = "android.permission.ACCESS_LOCUS_ID_USAGE_STATS"; field public static final String ACCESS_MOCK_LOCATION = "android.permission.ACCESS_MOCK_LOCATION"; field public static final String ACCESS_MTP = "android.permission.ACCESS_MTP"; @@ -21,7 +23,7 @@ package android { field public static final String ACCESS_RCS_USER_CAPABILITY_EXCHANGE = "android.permission.ACCESS_RCS_USER_CAPABILITY_EXCHANGE"; field public static final String ACCESS_SHARED_LIBRARIES = "android.permission.ACCESS_SHARED_LIBRARIES"; field public static final String ACCESS_SHORTCUTS = "android.permission.ACCESS_SHORTCUTS"; - field public static final String ACCESS_SMARTSPACE = "android.permission.ACCESS_SMARTSPACE"; + field @FlaggedApi("android.app.smartspace.flags.access_smartspace") public static final String ACCESS_SMARTSPACE = "android.permission.ACCESS_SMARTSPACE"; field public static final String ACCESS_SURFACE_FLINGER = "android.permission.ACCESS_SURFACE_FLINGER"; field public static final String ACCESS_TUNED_INFO = "android.permission.ACCESS_TUNED_INFO"; field public static final String ACCESS_TV_DESCRAMBLER = "android.permission.ACCESS_TV_DESCRAMBLER"; @@ -55,6 +57,7 @@ package android { field public static final String BIND_CONTENT_SUGGESTIONS_SERVICE = "android.permission.BIND_CONTENT_SUGGESTIONS_SERVICE"; field public static final String BIND_DIRECTORY_SEARCH = "android.permission.BIND_DIRECTORY_SEARCH"; field public static final String BIND_DISPLAY_HASHING_SERVICE = "android.permission.BIND_DISPLAY_HASHING_SERVICE"; + field @FlaggedApi("com.android.internal.telephony.flags.use_oem_domain_selection_service") public static final String BIND_DOMAIN_SELECTION_SERVICE = "android.permission.BIND_DOMAIN_SELECTION_SERVICE"; field public static final String BIND_DOMAIN_VERIFICATION_AGENT = "android.permission.BIND_DOMAIN_VERIFICATION_AGENT"; field public static final String BIND_EUICC_SERVICE = "android.permission.BIND_EUICC_SERVICE"; field public static final String BIND_EXTERNAL_STORAGE_SERVICE = "android.permission.BIND_EXTERNAL_STORAGE_SERVICE"; @@ -66,6 +69,8 @@ package android { field public static final String BIND_MUSIC_RECOGNITION_SERVICE = "android.permission.BIND_MUSIC_RECOGNITION_SERVICE"; field public static final String BIND_NETWORK_RECOMMENDATION_SERVICE = "android.permission.BIND_NETWORK_RECOMMENDATION_SERVICE"; field public static final String BIND_NOTIFICATION_ASSISTANT_SERVICE = "android.permission.BIND_NOTIFICATION_ASSISTANT_SERVICE"; + field @FlaggedApi("android.app.ondeviceintelligence.flags.enable_on_device_intelligence") public static final String BIND_ON_DEVICE_INTELLIGENCE_SERVICE = "android.permission.BIND_ON_DEVICE_INTELLIGENCE_SERVICE"; + field @FlaggedApi("android.app.ondeviceintelligence.flags.enable_on_device_intelligence") public static final String BIND_ON_DEVICE_TRUSTED_SERVICE = "android.permission.BIND_ON_DEVICE_TRUSTED_SERVICE"; field public static final String BIND_PHONE_ACCOUNT_SUGGESTION_SERVICE = "android.permission.BIND_PHONE_ACCOUNT_SUGGESTION_SERVICE"; field public static final String BIND_PRINT_RECOMMENDATION_SERVICE = "android.permission.BIND_PRINT_RECOMMENDATION_SERVICE"; field public static final String BIND_REMOTE_LOCKSCREEN_VALIDATION_SERVICE = "android.permission.BIND_REMOTE_LOCKSCREEN_VALIDATION_SERVICE"; @@ -95,8 +100,9 @@ package android { field public static final String BYPASS_ROLE_QUALIFICATION = "android.permission.BYPASS_ROLE_QUALIFICATION"; field public static final String CALL_AUDIO_INTERCEPTION = "android.permission.CALL_AUDIO_INTERCEPTION"; field public static final String CAMERA_DISABLE_TRANSMIT_LED = "android.permission.CAMERA_DISABLE_TRANSMIT_LED"; - field public static final String CAMERA_HEADLESS_SYSTEM_USER = "android.permission.CAMERA_HEADLESS_SYSTEM_USER"; + field @FlaggedApi("com.android.internal.camera.flags.camera_hsum_permission") public static final String CAMERA_HEADLESS_SYSTEM_USER = "android.permission.CAMERA_HEADLESS_SYSTEM_USER"; field public static final String CAMERA_OPEN_CLOSE_LISTENER = "android.permission.CAMERA_OPEN_CLOSE_LISTENER"; + field @FlaggedApi("com.android.internal.camera.flags.camera_privacy_allowlist") public static final String CAMERA_PRIVACY_ALLOWLIST = "android.permission.CAMERA_PRIVACY_ALLOWLIST"; field public static final String CAPTURE_AUDIO_HOTWORD = "android.permission.CAPTURE_AUDIO_HOTWORD"; field public static final String CAPTURE_CONSENTLESS_BUGREPORT_ON_USERDEBUG_BUILD = "android.permission.CAPTURE_CONSENTLESS_BUGREPORT_ON_USERDEBUG_BUILD"; field public static final String CAPTURE_MEDIA_OUTPUT = "android.permission.CAPTURE_MEDIA_OUTPUT"; @@ -110,6 +116,7 @@ package android { field public static final String CLEAR_APP_USER_DATA = "android.permission.CLEAR_APP_USER_DATA"; field public static final String COMPANION_APPROVE_WIFI_CONNECTIONS = "android.permission.COMPANION_APPROVE_WIFI_CONNECTIONS"; field public static final String CONFIGURE_DISPLAY_BRIGHTNESS = "android.permission.CONFIGURE_DISPLAY_BRIGHTNESS"; + field @FlaggedApi("android.security.frp_enforcement") public static final String CONFIGURE_FACTORY_RESET_PROTECTION = "android.permission.CONFIGURE_FACTORY_RESET_PROTECTION"; field public static final String CONFIGURE_INTERACT_ACROSS_PROFILES = "android.permission.CONFIGURE_INTERACT_ACROSS_PROFILES"; field @Deprecated public static final String CONNECTIVITY_INTERNAL = "android.permission.CONNECTIVITY_INTERNAL"; field public static final String CONNECTIVITY_USE_RESTRICTED_NETWORKS = "android.permission.CONNECTIVITY_USE_RESTRICTED_NETWORKS"; @@ -127,12 +134,15 @@ package android { field public static final String DISABLE_SYSTEM_SOUND_EFFECTS = "android.permission.DISABLE_SYSTEM_SOUND_EFFECTS"; field public static final String DISPATCH_PROVISIONING_MESSAGE = "android.permission.DISPATCH_PROVISIONING_MESSAGE"; field public static final String DOMAIN_VERIFICATION_AGENT = "android.permission.DOMAIN_VERIFICATION_AGENT"; + field @FlaggedApi("com.android.window.flags.untrusted_embedding_any_app_permission") public static final String EMBED_ANY_APP_IN_UNTRUSTED_MODE = "android.permission.EMBED_ANY_APP_IN_UNTRUSTED_MODE"; + field @FlaggedApi("android.content.pm.emergency_install_permission") public static final String EMERGENCY_INSTALL_PACKAGES = "android.permission.EMERGENCY_INSTALL_PACKAGES"; field public static final String ENTER_CAR_MODE_PRIORITIZED = "android.permission.ENTER_CAR_MODE_PRIORITIZED"; field public static final String EXEMPT_FROM_AUDIO_RECORD_RESTRICTIONS = "android.permission.EXEMPT_FROM_AUDIO_RECORD_RESTRICTIONS"; field public static final String FORCE_BACK = "android.permission.FORCE_BACK"; field public static final String FORCE_STOP_PACKAGES = "android.permission.FORCE_STOP_PACKAGES"; field public static final String GET_APP_METADATA = "android.permission.GET_APP_METADATA"; field public static final String GET_APP_OPS_STATS = "android.permission.GET_APP_OPS_STATS"; + field @FlaggedApi("android.app.bic_client") public static final String GET_BACKGROUND_INSTALLED_PACKAGES = "android.permission.GET_BACKGROUND_INSTALLED_PACKAGES"; field @FlaggedApi("android.app.get_binding_uid_importance") public static final String GET_BINDING_UID_IMPORTANCE = "android.permission.GET_BINDING_UID_IMPORTANCE"; field public static final String GET_HISTORICAL_APP_OPS_STATS = "android.permission.GET_HISTORICAL_APP_OPS_STATS"; field public static final String GET_PROCESS_STATE_AND_OOM_SCORE = "android.permission.GET_PROCESS_STATE_AND_OOM_SCORE"; @@ -158,6 +168,7 @@ package android { field public static final String INTERACT_ACROSS_USERS_FULL = "android.permission.INTERACT_ACROSS_USERS_FULL"; field public static final String INTERNAL_SYSTEM_WINDOW = "android.permission.INTERNAL_SYSTEM_WINDOW"; field public static final String INVOKE_CARRIER_SETUP = "android.permission.INVOKE_CARRIER_SETUP"; + field public static final String KEYPHRASE_ENROLLMENT_APPLICATION = "android.permission.KEYPHRASE_ENROLLMENT_APPLICATION"; field public static final String KILL_ALL_BACKGROUND_PROCESSES = "android.permission.KILL_ALL_BACKGROUND_PROCESSES"; field public static final String KILL_UID = "android.permission.KILL_UID"; field public static final String LAUNCH_DEVICE_MANAGER_SETUP = "android.permission.LAUNCH_DEVICE_MANAGER_SETUP"; @@ -186,6 +197,9 @@ package android { field public static final String MANAGE_DEFAULT_APPLICATIONS = "android.permission.MANAGE_DEFAULT_APPLICATIONS"; field public static final String MANAGE_DEVICE_ADMINS = "android.permission.MANAGE_DEVICE_ADMINS"; field public static final String MANAGE_DEVICE_POLICY_APP_EXEMPTIONS = "android.permission.MANAGE_DEVICE_POLICY_APP_EXEMPTIONS"; + field @FlaggedApi("android.app.admin.flags.security_log_v2_enabled") public static final String MANAGE_DEVICE_POLICY_AUDIT_LOGGING = "android.permission.MANAGE_DEVICE_POLICY_AUDIT_LOGGING"; + field @FlaggedApi("android.app.admin.flags.device_theft_api_enabled") public static final String MANAGE_DEVICE_POLICY_THEFT_DETECTION = "android.permission.MANAGE_DEVICE_POLICY_THEFT_DETECTION"; + field @FlaggedApi("android.permission.flags.enhanced_confirmation_mode_apis_enabled") public static final String MANAGE_ENHANCED_CONFIRMATION_STATES = "android.permission.MANAGE_ENHANCED_CONFIRMATION_STATES"; field public static final String MANAGE_ETHERNET_NETWORKS = "android.permission.MANAGE_ETHERNET_NETWORKS"; field public static final String MANAGE_FACTORY_RESET_PROTECTION = "android.permission.MANAGE_FACTORY_RESET_PROTECTION"; field public static final String MANAGE_GAME_ACTIVITY = "android.permission.MANAGE_GAME_ACTIVITY"; @@ -214,6 +228,7 @@ package android { field public static final String MANAGE_USB = "android.permission.MANAGE_USB"; field public static final String MANAGE_USERS = "android.permission.MANAGE_USERS"; field public static final String MANAGE_USER_OEM_UNLOCK_STATE = "android.permission.MANAGE_USER_OEM_UNLOCK_STATE"; + field public static final String MANAGE_VOICE_KEYPHRASES = "android.permission.MANAGE_VOICE_KEYPHRASES"; field public static final String MANAGE_WALLPAPER_EFFECTS_GENERATION = "android.permission.MANAGE_WALLPAPER_EFFECTS_GENERATION"; field public static final String MANAGE_WEAK_ESCROW_TOKEN = "android.permission.MANAGE_WEAK_ESCROW_TOKEN"; field public static final String MANAGE_WEARABLE_SENSING_SERVICE = "android.permission.MANAGE_WEARABLE_SENSING_SERVICE"; @@ -272,6 +287,7 @@ package android { field public static final String RADIO_SCAN_WITHOUT_LOCATION = "android.permission.RADIO_SCAN_WITHOUT_LOCATION"; field public static final String READ_ACTIVE_EMERGENCY_SESSION = "android.permission.READ_ACTIVE_EMERGENCY_SESSION"; field public static final String READ_APP_SPECIFIC_LOCALES = "android.permission.READ_APP_SPECIFIC_LOCALES"; + field @FlaggedApi("com.android.server.telecom.flags.telecom_resolve_hidden_dependencies") public static final String READ_BLOCKED_NUMBERS = "android.permission.READ_BLOCKED_NUMBERS"; field public static final String READ_CARRIER_APP_INFO = "android.permission.READ_CARRIER_APP_INFO"; field public static final String READ_CELL_BROADCASTS = "android.permission.READ_CELL_BROADCASTS"; field public static final String READ_CLIPBOARD_IN_BACKGROUND = "android.permission.READ_CLIPBOARD_IN_BACKGROUND"; @@ -279,7 +295,7 @@ package android { field public static final String READ_DEVICE_CONFIG = "android.permission.READ_DEVICE_CONFIG"; field public static final String READ_DREAM_STATE = "android.permission.READ_DREAM_STATE"; field public static final String READ_GLOBAL_APP_SEARCH_DATA = "android.permission.READ_GLOBAL_APP_SEARCH_DATA"; - field public static final String READ_INSTALLED_SESSION_PATHS = "android.permission.READ_INSTALLED_SESSION_PATHS"; + field @FlaggedApi("android.content.pm.get_resolved_apk_path") public static final String READ_INSTALLED_SESSION_PATHS = "android.permission.READ_INSTALLED_SESSION_PATHS"; field public static final String READ_INSTALL_SESSIONS = "android.permission.READ_INSTALL_SESSIONS"; field public static final String READ_NETWORK_USAGE_HISTORY = "android.permission.READ_NETWORK_USAGE_HISTORY"; field public static final String READ_OEM_UNLOCK_STATE = "android.permission.READ_OEM_UNLOCK_STATE"; @@ -292,6 +308,7 @@ package android { field public static final String READ_RUNTIME_PROFILES = "android.permission.READ_RUNTIME_PROFILES"; field public static final String READ_SAFETY_CENTER_STATUS = "android.permission.READ_SAFETY_CENTER_STATUS"; field public static final String READ_SEARCH_INDEXABLES = "android.permission.READ_SEARCH_INDEXABLES"; + field @FlaggedApi("android.app.system_terms_of_address_enabled") public static final String READ_SYSTEM_GRAMMATICAL_GENDER = "android.permission.READ_SYSTEM_GRAMMATICAL_GENDER"; field public static final String READ_SYSTEM_UPDATE_INFO = "android.permission.READ_SYSTEM_UPDATE_INFO"; field public static final String READ_WALLPAPER_INTERNAL = "android.permission.READ_WALLPAPER_INTERNAL"; field public static final String READ_WIFI_CREDENTIAL = "android.permission.READ_WIFI_CREDENTIAL"; @@ -303,6 +320,7 @@ package android { field public static final String RECEIVE_EMERGENCY_BROADCAST = "android.permission.RECEIVE_EMERGENCY_BROADCAST"; field @FlaggedApi("android.permission.flags.voice_activation_permission_apis") public static final String RECEIVE_SANDBOXED_DETECTION_TRAINING_DATA = "android.permission.RECEIVE_SANDBOXED_DETECTION_TRAINING_DATA"; field @FlaggedApi("android.permission.flags.voice_activation_permission_apis") public static final String RECEIVE_SANDBOX_TRIGGER_AUDIO = "android.permission.RECEIVE_SANDBOX_TRIGGER_AUDIO"; + field @FlaggedApi("com.android.server.notification.flags.redact_otp_notifications_from_untrusted_listeners") public static final String RECEIVE_SENSITIVE_NOTIFICATIONS = "android.permission.RECEIVE_SENSITIVE_NOTIFICATIONS"; field public static final String RECEIVE_WIFI_CREDENTIAL_CHANGE = "android.permission.RECEIVE_WIFI_CREDENTIAL_CHANGE"; field public static final String RECORD_BACKGROUND_AUDIO = "android.permission.RECORD_BACKGROUND_AUDIO"; field public static final String RECOVERY = "android.permission.RECOVERY"; @@ -319,7 +337,6 @@ package android { field @FlaggedApi("android.app.usage.report_usage_stats_permission") public static final String REPORT_USAGE_STATS = "android.permission.REPORT_USAGE_STATS"; field @Deprecated public static final String REQUEST_NETWORK_SCORES = "android.permission.REQUEST_NETWORK_SCORES"; field public static final String REQUEST_NOTIFICATION_ASSISTANT_SERVICE = "android.permission.REQUEST_NOTIFICATION_ASSISTANT_SERVICE"; - field @FlaggedApi("android.service.voice.flags.allow_training_data_egress_from_hds") public static final String RESET_HOTWORD_TRAINING_DATA_EGRESS_COUNT = "android.permission.RESET_HOTWORD_TRAINING_DATA_EGRESS_COUNT"; field public static final String RESET_PASSWORD = "android.permission.RESET_PASSWORD"; field public static final String RESTART_WIFI_SUBSYSTEM = "android.permission.RESTART_WIFI_SUBSYSTEM"; field public static final String RESTORE_RUNTIME_PERMISSIONS = "android.permission.RESTORE_RUNTIME_PERMISSIONS"; @@ -352,7 +369,7 @@ package android { field public static final String SET_VOLUME_KEY_LONG_PRESS_LISTENER = "android.permission.SET_VOLUME_KEY_LONG_PRESS_LISTENER"; field public static final String SET_WALLPAPER_COMPONENT = "android.permission.SET_WALLPAPER_COMPONENT"; field public static final String SET_WALLPAPER_DIM_AMOUNT = "android.permission.SET_WALLPAPER_DIM_AMOUNT"; - field @FlaggedApi("android.service.chooser.support_nfc_resolver") public static final String SHOW_CUSTOMIZED_RESOLVER = "android.permission.SHOW_CUSTOMIZED_RESOLVER"; + field @FlaggedApi("android.nfc.enable_nfc_mainline") public static final String SHOW_CUSTOMIZED_RESOLVER = "android.permission.SHOW_CUSTOMIZED_RESOLVER"; field public static final String SHOW_KEYGUARD_MESSAGE = "android.permission.SHOW_KEYGUARD_MESSAGE"; field public static final String SHUTDOWN = "android.permission.SHUTDOWN"; field public static final String SIGNAL_REBOOT_READINESS = "android.permission.SIGNAL_REBOOT_READINESS"; @@ -386,7 +403,9 @@ package android { field @Deprecated public static final String UPDATE_TIME_ZONE_RULES = "android.permission.UPDATE_TIME_ZONE_RULES"; field public static final String UPGRADE_RUNTIME_PERMISSIONS = "android.permission.UPGRADE_RUNTIME_PERMISSIONS"; field public static final String USER_ACTIVITY = "android.permission.USER_ACTIVITY"; + field @FlaggedApi("android.hardware.biometrics.face_background_authentication") public static final String USE_BACKGROUND_FACE_AUTHENTICATION = "android.permission.USE_BACKGROUND_FACE_AUTHENTICATION"; field public static final String USE_COLORIZED_NOTIFICATIONS = "android.permission.USE_COLORIZED_NOTIFICATIONS"; + field @FlaggedApi("android.app.ondeviceintelligence.flags.enable_on_device_intelligence") public static final String USE_ON_DEVICE_INTELLIGENCE = "android.permission.USE_ON_DEVICE_INTELLIGENCE"; field public static final String USE_RESERVED_DISK = "android.permission.USE_RESERVED_DISK"; field public static final String UWB_PRIVILEGED = "android.permission.UWB_PRIVILEGED"; field public static final String WHITELIST_AUTO_REVOKE_PERMISSIONS = "android.permission.WHITELIST_AUTO_REVOKE_PERMISSIONS"; @@ -396,6 +415,7 @@ package android { field public static final String WIFI_UPDATE_COEX_UNSAFE_CHANNELS = "android.permission.WIFI_UPDATE_COEX_UNSAFE_CHANNELS"; field public static final String WIFI_UPDATE_USABILITY_STATS_SCORE = "android.permission.WIFI_UPDATE_USABILITY_STATS_SCORE"; field public static final String WRITE_ALLOWLISTED_DEVICE_CONFIG = "android.permission.WRITE_ALLOWLISTED_DEVICE_CONFIG"; + field @FlaggedApi("com.android.server.telecom.flags.telecom_resolve_hidden_dependencies") public static final String WRITE_BLOCKED_NUMBERS = "android.permission.WRITE_BLOCKED_NUMBERS"; field public static final String WRITE_DEVICE_CONFIG = "android.permission.WRITE_DEVICE_CONFIG"; field public static final String WRITE_DREAM_STATE = "android.permission.WRITE_DREAM_STATE"; field public static final String WRITE_EMBEDDED_SUBSCRIPTIONS = "android.permission.WRITE_EMBEDDED_SUBSCRIPTIONS"; @@ -403,6 +423,7 @@ package android { field public static final String WRITE_OBB = "android.permission.WRITE_OBB"; field public static final String WRITE_SECURITY_LOG = "android.permission.WRITE_SECURITY_LOG"; field public static final String WRITE_SMS = "android.permission.WRITE_SMS"; + field @FlaggedApi("android.provider.user_keys") public static final String WRITE_VERIFICATION_STATE_E2EE_CONTACT_KEYS = "android.permission.WRITE_VERIFICATION_STATE_E2EE_CONTACT_KEYS"; } public static final class Manifest.permission_group { @@ -416,6 +437,7 @@ package android { public static final class R.attr { field public static final int allowClearUserDataOnFailedRestore = 16844288; // 0x1010600 + field @FlaggedApi("android.content.res.manifest_flagging") public static final int featureFlag; field public static final int gameSessionService = 16844373; // 0x1010655 field public static final int hotwordDetectionService = 16844326; // 0x1010626 field @FlaggedApi("android.companion.virtual.flags.vdm_custom_ime") public static final int isVirtualDeviceOnly; @@ -470,8 +492,9 @@ package android { field public static final int config_defaultCallScreening = 17039398; // 0x1040026 field public static final int config_defaultDialer = 17039395; // 0x1040023 field public static final int config_defaultNotes = 17039429; // 0x1040045 - field public static final int config_defaultRetailDemo; + field @FlaggedApi("android.permission.flags.retail_demo_role_enabled") public static final int config_defaultRetailDemo; field public static final int config_defaultSms = 17039396; // 0x1040024 + field @FlaggedApi("android.permission.flags.wallet_role_enabled") public static final int config_defaultWallet; field public static final int config_devicePolicyManagement = 17039421; // 0x104003d field public static final int config_feedbackIntentExtraKey = 17039391; // 0x104001f field public static final int config_feedbackIntentNameKey = 17039392; // 0x1040020 @@ -548,6 +571,7 @@ package android.app { public class ActivityManager { method @RequiresPermission(android.Manifest.permission.PACKAGE_USAGE_STATS) public void addOnUidImportanceListener(android.app.ActivityManager.OnUidImportanceListener, int); + method @FlaggedApi("android.app.uid_importance_listener_for_uids") @RequiresPermission(android.Manifest.permission.PACKAGE_USAGE_STATS) public void addOnUidImportanceListener(@NonNull android.app.ActivityManager.OnUidImportanceListener, int, @NonNull int[]); method @RequiresPermission(android.Manifest.permission.FORCE_STOP_PACKAGES) public void forceStopPackage(String); method @FlaggedApi("android.app.get_binding_uid_importance") @RequiresPermission(android.Manifest.permission.GET_BINDING_UID_IMPORTANCE) public int getBindingUidImportance(int); method @RequiresPermission(anyOf={"android.permission.INTERACT_ACROSS_USERS", "android.permission.INTERACT_ACROSS_USERS_FULL"}) public static int getCurrentUser(); @@ -574,6 +598,7 @@ package android.app { field public static final int FOREGROUND_SERVICE_API_TYPE_MICROPHONE = 6; // 0x6 field public static final int FOREGROUND_SERVICE_API_TYPE_PHONE_CALL = 7; // 0x7 field public static final int FOREGROUND_SERVICE_API_TYPE_USB = 8; // 0x8 + field @FlaggedApi("android.media.audio.foreground_audio_control") public static final int PROCESS_CAPABILITY_FOREGROUND_AUDIO_CONTROL = 64; // 0x40 field public static final int PROCESS_CAPABILITY_FOREGROUND_CAMERA = 2; // 0x2 field public static final int PROCESS_CAPABILITY_FOREGROUND_LOCATION = 1; // 0x1 field public static final int PROCESS_CAPABILITY_FOREGROUND_MICROPHONE = 4; // 0x4 @@ -604,6 +629,8 @@ package android.app { method public static String[] getOpStrs(); method @NonNull @RequiresPermission(android.Manifest.permission.GET_APP_OPS_STATS) public java.util.List getOpsForPackage(int, @NonNull String, @Nullable java.lang.String...); method @NonNull @RequiresPermission(android.Manifest.permission.GET_APP_OPS_STATS) public java.util.List getPackagesForOps(@Nullable String[]); + method @FlaggedApi("android.permission.flags.device_aware_permission_apis_enabled") @NonNull @RequiresPermission(android.Manifest.permission.GET_APP_OPS_STATS) public java.util.List getPackagesForOps(@Nullable String[], @NonNull String); + method @FlaggedApi("android.permission.flags.device_aware_permission_apis_enabled") @NonNull @RequiresPermission(android.Manifest.permission.GET_APP_OPS_STATS) public java.util.List getPermissionGroupUsageForPrivacyIndicator(boolean); method public static int opToDefaultMode(@NonNull String); method @Nullable public static String opToPermission(@NonNull String); method @RequiresPermission("android.permission.MANAGE_APP_OPS_MODES") public void setMode(@NonNull String, int, @Nullable String, int); @@ -618,6 +645,7 @@ package android.app { field public static final String OPSTR_ACCEPT_HANDOVER = "android:accept_handover"; field public static final String OPSTR_ACCESS_ACCESSIBILITY = "android:access_accessibility"; field public static final String OPSTR_ACCESS_NOTIFICATIONS = "android:access_notifications"; + field @FlaggedApi("android.permission.flags.enhanced_confirmation_mode_apis_enabled") public static final String OPSTR_ACCESS_RESTRICTED_SETTINGS = "android:access_restricted_settings"; field public static final String OPSTR_ACTIVATE_PLATFORM_VPN = "android:activate_platform_vpn"; field public static final String OPSTR_ACTIVATE_VPN = "android:activate_vpn"; field public static final String OPSTR_ASSIST_SCREENSHOT = "android:assist_screenshot"; @@ -636,6 +664,7 @@ package android.app { field public static final String OPSTR_CAPTURE_CONSENTLESS_BUGREPORT_ON_USERDEBUG_BUILD = "android:capture_consentless_bugreport_on_userdebug_build"; field public static final String OPSTR_CHANGE_WIFI_STATE = "android:change_wifi_state"; field @FlaggedApi("android.view.contentprotection.flags.create_accessibility_overlay_app_op_enabled") public static final String OPSTR_CREATE_ACCESSIBILITY_OVERLAY = "android:create_accessibility_overlay"; + field @FlaggedApi("android.location.flags.location_bypass") public static final String OPSTR_EMERGENCY_LOCATION = "android:emergency_location"; field @FlaggedApi("android.permission.flags.op_enable_mobile_data_by_user") public static final String OPSTR_ENABLE_MOBILE_DATA_BY_USER = "android:enable_mobile_data_by_user"; field public static final String OPSTR_ESTABLISH_VPN_MANAGER = "android:establish_vpn_manager"; field public static final String OPSTR_ESTABLISH_VPN_SERVICE = "android:establish_vpn_service"; @@ -807,6 +836,7 @@ package android.app { public static interface AppOpsManager.OnOpNotedListener { method public void onOpNoted(@NonNull String, int, @NonNull String, @Nullable String, int, int); + method @FlaggedApi("android.permission.flags.device_aware_permission_apis_enabled") public default void onOpNoted(@NonNull String, int, @NonNull String, @Nullable String, int, int, int); } public static final class AppOpsManager.OpEntry implements android.os.Parcelable { @@ -858,6 +888,10 @@ package android.app { field @NonNull public static final android.os.Parcelable.Creator CREATOR; } + @FlaggedApi("android.app.bic_client") public final class BackgroundInstallControlManager { + method @FlaggedApi("android.app.bic_client") @NonNull @RequiresPermission(android.Manifest.permission.GET_BACKGROUND_INSTALLED_PACKAGES) public java.util.List getBackgroundInstalledPackages(long); + } + public class BroadcastOptions { method public void clearRequireCompatChange(); method public int getPendingIntentBackgroundActivityStartMode(); @@ -1015,13 +1049,20 @@ package android.app { method @Nullable public android.content.ComponentName getAllowedNotificationAssistant(); method @NonNull @RequiresPermission(android.Manifest.permission.MANAGE_NOTIFICATION_LISTENERS) public java.util.List getEnabledNotificationListeners(); method public boolean isNotificationAssistantAccessGranted(@NonNull android.content.ComponentName); + method @FlaggedApi("android.service.notification.callstyle_callback_api") @RequiresPermission(allOf={android.Manifest.permission.INTERACT_ACROSS_USERS, android.Manifest.permission.ACCESS_NOTIFICATIONS}) public void registerCallNotificationEventListener(@NonNull String, @NonNull android.os.UserHandle, @NonNull java.util.concurrent.Executor, @NonNull android.app.NotificationManager.CallNotificationEventListener); method public void setNotificationAssistantAccessGranted(@Nullable android.content.ComponentName, boolean); method @RequiresPermission(android.Manifest.permission.MANAGE_NOTIFICATION_LISTENERS) public void setNotificationListenerAccessGranted(@NonNull android.content.ComponentName, boolean, boolean); + method @FlaggedApi("android.service.notification.callstyle_callback_api") @RequiresPermission(allOf={android.Manifest.permission.INTERACT_ACROSS_USERS, android.Manifest.permission.ACCESS_NOTIFICATIONS}) public void unregisterCallNotificationEventListener(@NonNull android.app.NotificationManager.CallNotificationEventListener); field @RequiresPermission(android.Manifest.permission.STATUS_BAR_SERVICE) public static final String ACTION_CLOSE_NOTIFICATION_HANDLER_PANEL = "android.app.action.CLOSE_NOTIFICATION_HANDLER_PANEL"; field @RequiresPermission(android.Manifest.permission.STATUS_BAR_SERVICE) public static final String ACTION_OPEN_NOTIFICATION_HANDLER_PANEL = "android.app.action.OPEN_NOTIFICATION_HANDLER_PANEL"; field @RequiresPermission(android.Manifest.permission.STATUS_BAR_SERVICE) public static final String ACTION_TOGGLE_NOTIFICATION_HANDLER_PANEL = "android.app.action.TOGGLE_NOTIFICATION_HANDLER_PANEL"; } + @FlaggedApi("android.service.notification.callstyle_callback_api") public static interface NotificationManager.CallNotificationEventListener { + method @FlaggedApi("android.service.notification.callstyle_callback_api") public void onCallNotificationPosted(@NonNull String, @NonNull android.os.UserHandle); + method @FlaggedApi("android.service.notification.callstyle_callback_api") public void onCallNotificationRemoved(@NonNull String, @NonNull android.os.UserHandle); + } + public final class RemoteLockscreenValidationResult implements android.os.Parcelable { method public int describeContents(); method public int getResultCode(); @@ -1102,13 +1143,16 @@ package android.app { field public static final int NAV_BAR_MODE_KIDS = 1; // 0x1 } - public static final class StatusBarManager.DisableInfo { + public static final class StatusBarManager.DisableInfo implements android.os.Parcelable { method public boolean areAllComponentsEnabled(); + method public int describeContents(); method public boolean isNavigateToHomeDisabled(); method public boolean isNotificationPeekingDisabled(); method public boolean isRecentsDisabled(); method public boolean isSearchDisabled(); method public boolean isStatusBarExpansionDisabled(); + method public void writeToParcel(@NonNull android.os.Parcel, int); + field @NonNull public static final android.os.Parcelable.Creator CREATOR; } public final class SystemServiceRegistry { @@ -1250,6 +1294,10 @@ package android.app.admin { field @NonNull public static final android.os.Parcelable.Creator CREATOR; } + public final class DevicePolicyIdentifiers { + field @FlaggedApi("android.app.admin.flags.security_log_v2_enabled") public static final String AUDIT_LOGGING_POLICY = "auditLogging"; + } + public class DevicePolicyKeyguardService extends android.app.Service { ctor public DevicePolicyKeyguardService(); method @Nullable public void dismiss(); @@ -1271,18 +1319,21 @@ package android.app.admin { method @Nullable @RequiresPermission(android.Manifest.permission.MANAGE_USERS) public android.os.UserHandle getDeviceOwnerUser(); method @NonNull @RequiresPermission(android.Manifest.permission.MANAGE_PROFILE_AND_DEVICE_OWNERS) public android.app.admin.DevicePolicyState getDevicePolicyState(); method @Nullable @RequiresPermission(android.Manifest.permission.MANAGE_PROFILE_AND_DEVICE_OWNERS) public String getFinancedDeviceKioskRoleHolder(); + method @FlaggedApi("android.app.admin.flags.device_policy_size_tracking_enabled") @RequiresPermission(android.Manifest.permission.MANAGE_PROFILE_AND_DEVICE_OWNERS) public int getMaxPolicyStorageLimit(); method @Nullable @RequiresPermission(anyOf={android.Manifest.permission.MANAGE_USERS, android.Manifest.permission.QUERY_ADMIN_POLICY}) public java.util.List getPermittedAccessibilityServices(int); method @Nullable @RequiresPermission(anyOf={android.Manifest.permission.MANAGE_USERS, android.Manifest.permission.QUERY_ADMIN_POLICY}) public java.util.List getPermittedInputMethodsForCurrentUser(); method @NonNull @RequiresPermission(android.Manifest.permission.MANAGE_PROFILE_AND_DEVICE_OWNERS) public java.util.List getPolicyManagedProfiles(@NonNull android.os.UserHandle); method @Nullable public android.content.ComponentName getProfileOwner() throws java.lang.IllegalArgumentException; method @Nullable @RequiresPermission(anyOf={android.Manifest.permission.MANAGE_USERS, android.Manifest.permission.MANAGE_PROFILE_AND_DEVICE_OWNERS}) public String getProfileOwnerNameAsUser(int) throws java.lang.IllegalArgumentException; method @RequiresPermission(anyOf={android.Manifest.permission.MANAGE_USERS, android.Manifest.permission.MANAGE_PROFILE_AND_DEVICE_OWNERS}) public int getUserProvisioningState(); + method @FlaggedApi("android.app.admin.flags.security_log_v2_enabled") @RequiresPermission(android.Manifest.permission.MANAGE_DEVICE_POLICY_AUDIT_LOGGING) public boolean isAuditLogEnabled(); method public boolean isDeviceManaged(); method @RequiresPermission(android.Manifest.permission.MANAGE_USERS) public boolean isDeviceProvisioned(); method @RequiresPermission(android.Manifest.permission.MANAGE_USERS) public boolean isDeviceProvisioningConfigApplied(); method @RequiresPermission(android.Manifest.permission.MANAGE_PROFILE_AND_DEVICE_OWNERS) public boolean isDpcDownloaded(); method @RequiresPermission(anyOf={android.Manifest.permission.MANAGE_USERS, android.Manifest.permission.MANAGE_PROFILE_AND_DEVICE_OWNERS}) public boolean isManagedKiosk(); method public boolean isSecondaryLockscreenEnabled(@NonNull android.os.UserHandle); + method @FlaggedApi("android.app.admin.flags.device_theft_api_enabled") @RequiresPermission(android.Manifest.permission.MANAGE_DEVICE_POLICY_THEFT_DETECTION) public boolean isTheftDetectionTriggered(); method @RequiresPermission(anyOf={android.Manifest.permission.MANAGE_USERS, android.Manifest.permission.MANAGE_PROFILE_AND_DEVICE_OWNERS}) public boolean isUnattendedManagedKiosk(); method @RequiresPermission("android.permission.NOTIFY_PENDING_SYSTEM_UPDATE") public void notifyPendingSystemUpdate(long); method @RequiresPermission("android.permission.NOTIFY_PENDING_SYSTEM_UPDATE") public void notifyPendingSystemUpdate(long, boolean); @@ -1291,8 +1342,11 @@ package android.app.admin { method @RequiresPermission(android.Manifest.permission.TRIGGER_LOST_MODE) public void sendLostModeLocationUpdate(@NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer); method @Deprecated @RequiresPermission(android.Manifest.permission.MANAGE_DEVICE_ADMINS) public boolean setActiveProfileOwner(@NonNull android.content.ComponentName, String) throws java.lang.IllegalArgumentException; method @RequiresPermission(android.Manifest.permission.MANAGE_DEVICE_POLICY_APP_EXEMPTIONS) public void setApplicationExemptions(@NonNull String, @NonNull java.util.Set) throws android.content.pm.PackageManager.NameNotFoundException; + method @FlaggedApi("android.app.admin.flags.security_log_v2_enabled") @RequiresPermission(android.Manifest.permission.MANAGE_DEVICE_POLICY_AUDIT_LOGGING) public void setAuditLogEnabled(boolean); + method @FlaggedApi("android.app.admin.flags.security_log_v2_enabled") @RequiresPermission(android.Manifest.permission.MANAGE_DEVICE_POLICY_AUDIT_LOGGING) public void setAuditLogEventCallback(@NonNull java.util.concurrent.Executor, @Nullable java.util.function.Consumer>); method @RequiresPermission(android.Manifest.permission.MANAGE_USERS) public void setDeviceProvisioningConfigApplied(); method @RequiresPermission(android.Manifest.permission.MANAGE_PROFILE_AND_DEVICE_OWNERS) public void setDpcDownloaded(boolean); + method @FlaggedApi("android.app.admin.flags.device_policy_size_tracking_enabled") @RequiresPermission(android.Manifest.permission.MANAGE_PROFILE_AND_DEVICE_OWNERS) public void setMaxPolicyStorageLimit(int); method @Deprecated @RequiresPermission(value=android.Manifest.permission.GRANT_PROFILE_OWNER_DEVICE_IDS_ACCESS, conditional=true) public void setProfileOwnerCanAccessDeviceIds(@NonNull android.content.ComponentName); method public void setSecondaryLockscreenEnabled(@NonNull android.content.ComponentName, boolean); method @RequiresPermission(android.Manifest.permission.MANAGE_PROFILE_AND_DEVICE_OWNERS) public void setUserProvisioningState(int, @NonNull android.os.UserHandle); @@ -1366,6 +1420,7 @@ package android.app.admin { field public static final int STATUS_DEVICE_ADMIN_NOT_SUPPORTED = 13; // 0xd field public static final int STATUS_HAS_DEVICE_OWNER = 1; // 0x1 field public static final int STATUS_HAS_PAIRED = 8; // 0x8 + field @FlaggedApi("android.app.admin.flags.headless_device_owner_single_user_enabled") public static final int STATUS_HEADLESS_ONLY_SYSTEM_USER = 17; // 0x11 field public static final int STATUS_HEADLESS_SYSTEM_USER_MODE_NOT_SUPPORTED = 16; // 0x10 field public static final int STATUS_MANAGED_USERS_NOT_SUPPORTED = 9; // 0x9 field public static final int STATUS_NONSYSTEM_USER_EXISTS = 5; // 0x5 @@ -2133,6 +2188,139 @@ package android.app.job { } +package android.app.ondeviceintelligence { + + @FlaggedApi("android.app.ondeviceintelligence.flags.enable_on_device_intelligence") public final class Content implements android.os.Parcelable { + ctor public Content(@NonNull android.os.Bundle); + method public int describeContents(); + method @NonNull public android.os.Bundle getData(); + method public void writeToParcel(@NonNull android.os.Parcel, int); + field @NonNull public static final android.os.Parcelable.Creator CREATOR; + } + + @FlaggedApi("android.app.ondeviceintelligence.flags.enable_on_device_intelligence") public interface DownloadCallback { + method public void onDownloadCompleted(@NonNull android.os.PersistableBundle); + method public void onDownloadFailed(int, @Nullable String, @NonNull android.os.PersistableBundle); + method public default void onDownloadProgress(long); + method public default void onDownloadStarted(long); + field public static final int DOWNLOAD_FAILURE_STATUS_DOWNLOADING = 3; // 0x3 + field public static final int DOWNLOAD_FAILURE_STATUS_NETWORK_FAILURE = 2; // 0x2 + field public static final int DOWNLOAD_FAILURE_STATUS_NOT_ENOUGH_DISK_SPACE = 1; // 0x1 + field public static final int DOWNLOAD_FAILURE_STATUS_UNAVAILABLE = 4; // 0x4 + field public static final int DOWNLOAD_FAILURE_STATUS_UNKNOWN = 0; // 0x0 + } + + @FlaggedApi("android.app.ondeviceintelligence.flags.enable_on_device_intelligence") public final class Feature implements android.os.Parcelable { + method public int describeContents(); + method @NonNull public android.os.PersistableBundle getFeatureParams(); + method public int getId(); + method @Nullable public String getModelName(); + method @Nullable public String getName(); + method public int getType(); + method public int getVariant(); + method public void writeToParcel(@NonNull android.os.Parcel, int); + field @NonNull public static final android.os.Parcelable.Creator CREATOR; + } + + public static final class Feature.Builder { + ctor public Feature.Builder(int, int, int, @NonNull android.os.PersistableBundle); + method @NonNull public android.app.ondeviceintelligence.Feature build(); + method @NonNull public android.app.ondeviceintelligence.Feature.Builder setFeatureParams(@NonNull android.os.PersistableBundle); + method @NonNull public android.app.ondeviceintelligence.Feature.Builder setId(int); + method @NonNull public android.app.ondeviceintelligence.Feature.Builder setModelName(@NonNull String); + method @NonNull public android.app.ondeviceintelligence.Feature.Builder setName(@NonNull String); + method @NonNull public android.app.ondeviceintelligence.Feature.Builder setType(int); + method @NonNull public android.app.ondeviceintelligence.Feature.Builder setVariant(int); + } + + @FlaggedApi("android.app.ondeviceintelligence.flags.enable_on_device_intelligence") public final class FeatureDetails implements android.os.Parcelable { + ctor public FeatureDetails(@android.app.ondeviceintelligence.FeatureDetails.Status int, @NonNull android.os.PersistableBundle); + ctor public FeatureDetails(@android.app.ondeviceintelligence.FeatureDetails.Status int); + method public int describeContents(); + method @NonNull public android.os.PersistableBundle getFeatureDetailParams(); + method @android.app.ondeviceintelligence.FeatureDetails.Status public int getStatus(); + method public void writeToParcel(@NonNull android.os.Parcel, int); + field @NonNull public static final android.os.Parcelable.Creator CREATOR; + field public static final int FEATURE_STATUS_AVAILABLE = 3; // 0x3 + field public static final int FEATURE_STATUS_DOWNLOADABLE = 1; // 0x1 + field public static final int FEATURE_STATUS_DOWNLOADING = 2; // 0x2 + field public static final int FEATURE_STATUS_SERVICE_UNAVAILABLE = 4; // 0x4 + field public static final int FEATURE_STATUS_UNAVAILABLE = 0; // 0x0 + } + + @java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE) @java.lang.annotation.Target({java.lang.annotation.ElementType.TYPE_USE, java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.PARAMETER, java.lang.annotation.ElementType.FIELD}) public static @interface FeatureDetails.Status { + } + + @FlaggedApi("android.app.ondeviceintelligence.flags.enable_on_device_intelligence") public final class FilePart implements android.os.Parcelable { + ctor public FilePart(@NonNull String, @NonNull android.os.PersistableBundle, @NonNull String) throws java.io.FileNotFoundException; + ctor public FilePart(@NonNull String, @NonNull android.os.PersistableBundle, @NonNull java.io.FileInputStream) throws java.io.IOException; + method public int describeContents(); + method @NonNull public java.io.FileInputStream getFileInputStream(); + method @NonNull public String getFilePartKey(); + method @NonNull public android.os.PersistableBundle getFilePartParams(); + method public void writeToParcel(@NonNull android.os.Parcel, int); + field @NonNull public static final android.os.Parcelable.Creator CREATOR; + } + + @FlaggedApi("android.app.ondeviceintelligence.flags.enable_on_device_intelligence") public class OnDeviceIntelligenceManager { + method @RequiresPermission(android.Manifest.permission.USE_ON_DEVICE_INTELLIGENCE) public void getFeature(int, @NonNull java.util.concurrent.Executor, @NonNull android.os.OutcomeReceiver); + method @RequiresPermission(android.Manifest.permission.USE_ON_DEVICE_INTELLIGENCE) public void getFeatureDetails(@NonNull android.app.ondeviceintelligence.Feature, @NonNull java.util.concurrent.Executor, @NonNull android.os.OutcomeReceiver); + method @RequiresPermission(android.Manifest.permission.USE_ON_DEVICE_INTELLIGENCE) public void getVersion(@NonNull java.util.concurrent.Executor, @NonNull java.util.function.LongConsumer); + method @RequiresPermission(android.Manifest.permission.USE_ON_DEVICE_INTELLIGENCE) public void listFeatures(@NonNull java.util.concurrent.Executor, @NonNull android.os.OutcomeReceiver,android.app.ondeviceintelligence.OnDeviceIntelligenceManager.OnDeviceIntelligenceManagerException>); + method @RequiresPermission(android.Manifest.permission.USE_ON_DEVICE_INTELLIGENCE) public void processRequest(@NonNull android.app.ondeviceintelligence.Feature, @NonNull android.app.ondeviceintelligence.Content, int, @Nullable android.os.CancellationSignal, @Nullable android.app.ondeviceintelligence.ProcessingSignal, @NonNull java.util.concurrent.Executor, @NonNull android.os.OutcomeReceiver); + method @RequiresPermission(android.Manifest.permission.USE_ON_DEVICE_INTELLIGENCE) public void processRequestStreaming(@NonNull android.app.ondeviceintelligence.Feature, @NonNull android.app.ondeviceintelligence.Content, int, @Nullable android.os.CancellationSignal, @Nullable android.app.ondeviceintelligence.ProcessingSignal, @NonNull java.util.concurrent.Executor, @NonNull android.app.ondeviceintelligence.StreamingResponseReceiver); + method @RequiresPermission(android.Manifest.permission.USE_ON_DEVICE_INTELLIGENCE) public void requestFeatureDownload(@NonNull android.app.ondeviceintelligence.Feature, @Nullable android.os.CancellationSignal, @NonNull java.util.concurrent.Executor, @NonNull android.app.ondeviceintelligence.DownloadCallback); + method @RequiresPermission(android.Manifest.permission.USE_ON_DEVICE_INTELLIGENCE) public void requestTokenCount(@NonNull android.app.ondeviceintelligence.Feature, @NonNull android.app.ondeviceintelligence.Content, @Nullable android.os.CancellationSignal, @NonNull java.util.concurrent.Executor, @NonNull android.os.OutcomeReceiver); + field public static final String API_VERSION_BUNDLE_KEY = "ApiVersionBundleKey"; + field public static final int REQUEST_TYPE_EMBEDDINGS = 2; // 0x2 + field public static final int REQUEST_TYPE_INFERENCE = 0; // 0x0 + field public static final int REQUEST_TYPE_PREPARE = 1; // 0x1 + } + + public static class OnDeviceIntelligenceManager.OnDeviceIntelligenceManagerException extends java.lang.Exception { + ctor public OnDeviceIntelligenceManager.OnDeviceIntelligenceManagerException(int, @NonNull String, @NonNull android.os.PersistableBundle); + ctor public OnDeviceIntelligenceManager.OnDeviceIntelligenceManagerException(int, @NonNull android.os.PersistableBundle); + method public int getErrorCode(); + method @NonNull public android.os.PersistableBundle getErrorParams(); + field public static final int ON_DEVICE_INTELLIGENCE_SERVICE_UNAVAILABLE = 1000; // 0x3e8 + } + + public static class OnDeviceIntelligenceManager.OnDeviceIntelligenceManagerProcessingException extends android.app.ondeviceintelligence.OnDeviceIntelligenceManager.OnDeviceIntelligenceManagerException { + ctor public OnDeviceIntelligenceManager.OnDeviceIntelligenceManagerProcessingException(int, @NonNull String, @NonNull android.os.PersistableBundle); + ctor public OnDeviceIntelligenceManager.OnDeviceIntelligenceManagerProcessingException(int, @NonNull android.os.PersistableBundle); + field public static final int PROCESSING_ERROR_BAD_DATA = 2; // 0x2 + field public static final int PROCESSING_ERROR_BAD_REQUEST = 3; // 0x3 + field public static final int PROCESSING_ERROR_BUSY = 9; // 0x9 + field public static final int PROCESSING_ERROR_CANCELLED = 7; // 0x7 + field public static final int PROCESSING_ERROR_COMPUTE_ERROR = 5; // 0x5 + field public static final int PROCESSING_ERROR_INTERNAL = 14; // 0xe + field public static final int PROCESSING_ERROR_IPC_ERROR = 6; // 0x6 + field public static final int PROCESSING_ERROR_NOT_AVAILABLE = 8; // 0x8 + field public static final int PROCESSING_ERROR_REQUEST_NOT_SAFE = 4; // 0x4 + field public static final int PROCESSING_ERROR_REQUEST_TOO_LARGE = 12; // 0xc + field public static final int PROCESSING_ERROR_RESPONSE_NOT_SAFE = 11; // 0xb + field public static final int PROCESSING_ERROR_SAFETY_ERROR = 10; // 0xa + field public static final int PROCESSING_ERROR_SERVICE_UNAVAILABLE = 15; // 0xf + field public static final int PROCESSING_ERROR_SUSPENDED = 13; // 0xd + field public static final int PROCESSING_ERROR_UNKNOWN = 1; // 0x1 + } + + @FlaggedApi("android.app.ondeviceintelligence.flags.enable_on_device_intelligence") public final class ProcessingSignal { + ctor public ProcessingSignal(); + method public void sendSignal(@NonNull android.os.PersistableBundle); + method public void setOnProcessingSignalCallback(@NonNull java.util.concurrent.Executor, @Nullable android.app.ondeviceintelligence.ProcessingSignal.OnProcessingSignalCallback); + } + + public static interface ProcessingSignal.OnProcessingSignalCallback { + method public void onSignalReceived(@NonNull android.os.PersistableBundle); + } + + @FlaggedApi("android.app.ondeviceintelligence.flags.enable_on_device_intelligence") public interface StreamingResponseReceiver extends android.os.OutcomeReceiver { + method public void onNewContent(@NonNull T); + } + +} + package android.app.people { public final class PeopleManager { @@ -2177,6 +2365,7 @@ package android.app.prediction { method public void notifyLaunchLocationShown(@NonNull String, @NonNull java.util.List); method public void registerPredictionUpdates(@NonNull java.util.concurrent.Executor, @NonNull android.app.prediction.AppPredictor.Callback); method public void requestPredictionUpdate(); + method @FlaggedApi("android.service.appprediction.flags.service_features_api") public void requestServiceFeatures(@NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer); method @Nullable public void sortTargets(@NonNull java.util.List, @NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer>); method public void unregisterPredictionUpdates(@NonNull android.app.prediction.AppPredictor.Callback); } @@ -3125,14 +3314,41 @@ package android.app.wallpapereffectsgeneration { package android.app.wearable { + @FlaggedApi("android.app.wearable.enable_data_request_observer_api") public final class WearableSensingDataRequest implements android.os.Parcelable { + method public int describeContents(); + method public int getDataSize(); + method public int getDataType(); + method public static int getMaxRequestSize(); + method public static int getRateLimit(); + method @NonNull public static java.time.Duration getRateLimitWindowSize(); + method @NonNull public android.os.PersistableBundle getRequestDetails(); + method public void writeToParcel(@NonNull android.os.Parcel, int); + field @NonNull public static final android.os.Parcelable.Creator CREATOR; + } + + @FlaggedApi("android.app.wearable.enable_data_request_observer_api") public static final class WearableSensingDataRequest.Builder { + ctor public WearableSensingDataRequest.Builder(int); + method @NonNull public android.app.wearable.WearableSensingDataRequest build(); + method @NonNull public android.app.wearable.WearableSensingDataRequest.Builder setRequestDetails(@NonNull android.os.PersistableBundle); + } + public class WearableSensingManager { + method @FlaggedApi("android.app.wearable.enable_data_request_observer_api") @Nullable public static android.app.wearable.WearableSensingDataRequest getDataRequestFromIntent(@NonNull android.content.Intent); + method @FlaggedApi("android.app.wearable.enable_provide_wearable_connection_api") @RequiresPermission(android.Manifest.permission.MANAGE_WEARABLE_SENSING_SERVICE) public void provideConnection(@NonNull android.os.ParcelFileDescriptor, @NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer); method @RequiresPermission(android.Manifest.permission.MANAGE_WEARABLE_SENSING_SERVICE) public void provideData(@NonNull android.os.PersistableBundle, @Nullable android.os.SharedMemory, @NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer); method @RequiresPermission(android.Manifest.permission.MANAGE_WEARABLE_SENSING_SERVICE) public void provideDataStream(@NonNull android.os.ParcelFileDescriptor, @NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer); + method @FlaggedApi("android.app.wearable.enable_data_request_observer_api") @RequiresPermission(android.Manifest.permission.MANAGE_WEARABLE_SENSING_SERVICE) public void registerDataRequestObserver(int, @NonNull android.app.PendingIntent, @NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer); + method @FlaggedApi("android.app.wearable.enable_hotword_wearable_sensing_api") @RequiresPermission(android.Manifest.permission.MANAGE_WEARABLE_SENSING_SERVICE) public void startHotwordRecognition(@Nullable android.content.ComponentName, @NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer); + method @FlaggedApi("android.app.wearable.enable_hotword_wearable_sensing_api") @RequiresPermission(android.Manifest.permission.MANAGE_WEARABLE_SENSING_SERVICE) public void stopHotwordRecognition(@NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer); + method @FlaggedApi("android.app.wearable.enable_data_request_observer_api") @RequiresPermission(android.Manifest.permission.MANAGE_WEARABLE_SENSING_SERVICE) public void unregisterDataRequestObserver(int, @NonNull android.app.PendingIntent, @NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer); field public static final int STATUS_ACCESS_DENIED = 5; // 0x5 + field @FlaggedApi("android.app.wearable.enable_provide_wearable_connection_api") public static final int STATUS_CHANNEL_ERROR = 7; // 0x7 field public static final int STATUS_SERVICE_UNAVAILABLE = 3; // 0x3 field public static final int STATUS_SUCCESS = 1; // 0x1 field public static final int STATUS_UNKNOWN = 0; // 0x0 field public static final int STATUS_UNSUPPORTED = 2; // 0x2 + field @FlaggedApi("android.app.wearable.enable_data_request_observer_api") public static final int STATUS_UNSUPPORTED_DATA_TYPE = 8; // 0x8 + field @FlaggedApi("android.app.wearable.enable_unsupported_operation_status_code") public static final int STATUS_UNSUPPORTED_OPERATION = 6; // 0x6 field public static final int STATUS_WEARABLE_UNAVAILABLE = 4; // 0x4 } @@ -3185,8 +3401,15 @@ package android.companion { package android.companion.virtual { + public final class VirtualDevice implements android.os.Parcelable { + method @FlaggedApi("android.companion.virtual.flags.vdm_public_apis") public boolean hasCustomAudioInputSupport(); + method @FlaggedApi("android.companion.virtual.flags.vdm_public_apis") public boolean hasCustomCameraSupport(); + } + public final class VirtualDeviceManager { method @NonNull @RequiresPermission(android.Manifest.permission.CREATE_VIRTUAL_DEVICE) public android.companion.virtual.VirtualDeviceManager.VirtualDevice createVirtualDevice(int, @NonNull android.companion.virtual.VirtualDeviceParams); + method @FlaggedApi("android.companion.virtual.flags.persistent_device_id_api") @NonNull public java.util.Set getAllPersistentDeviceIds(); + method @FlaggedApi("android.companion.virtual.flags.persistent_device_id_api") @Nullable public CharSequence getDisplayNameForPersistentDeviceId(@NonNull String); field public static final int LAUNCH_FAILURE_NO_ACTIVITY = 2; // 0x2 field public static final int LAUNCH_FAILURE_PENDING_INTENT_CANCELED = 1; // 0x1 field public static final int LAUNCH_SUCCESS = 0; // 0x0 @@ -3214,6 +3437,7 @@ package android.companion.virtual { method @RequiresPermission(android.Manifest.permission.CREATE_VIRTUAL_DEVICE) public void close(); method @NonNull public android.content.Context createContext(); method @NonNull @RequiresPermission(android.Manifest.permission.CREATE_VIRTUAL_DEVICE) public android.companion.virtual.audio.VirtualAudioDevice createVirtualAudioDevice(@NonNull android.hardware.display.VirtualDisplay, @Nullable java.util.concurrent.Executor, @Nullable android.companion.virtual.audio.VirtualAudioDevice.AudioConfigurationChangeCallback); + method @FlaggedApi("android.companion.virtual.flags.virtual_camera") @NonNull @RequiresPermission(android.Manifest.permission.CREATE_VIRTUAL_DEVICE) public android.companion.virtual.camera.VirtualCamera createVirtualCamera(@NonNull android.companion.virtual.camera.VirtualCameraConfig); method @Deprecated @Nullable public android.hardware.display.VirtualDisplay createVirtualDisplay(@IntRange(from=1) int, @IntRange(from=1) int, @IntRange(from=1) int, @Nullable android.view.Surface, int, @Nullable java.util.concurrent.Executor, @Nullable android.hardware.display.VirtualDisplay.Callback); method @Nullable public android.hardware.display.VirtualDisplay createVirtualDisplay(@NonNull android.hardware.display.VirtualDisplayConfig, @Nullable java.util.concurrent.Executor, @Nullable android.hardware.display.VirtualDisplay.Callback); method @NonNull @RequiresPermission(android.Manifest.permission.CREATE_VIRTUAL_DEVICE) public android.hardware.input.VirtualDpad createVirtualDpad(@NonNull android.hardware.input.VirtualDpadConfig); @@ -3222,6 +3446,7 @@ package android.companion.virtual { method @NonNull @RequiresPermission(android.Manifest.permission.CREATE_VIRTUAL_DEVICE) public android.hardware.input.VirtualMouse createVirtualMouse(@NonNull android.hardware.input.VirtualMouseConfig); method @Deprecated @NonNull @RequiresPermission(android.Manifest.permission.CREATE_VIRTUAL_DEVICE) public android.hardware.input.VirtualMouse createVirtualMouse(@NonNull android.hardware.display.VirtualDisplay, @NonNull String, int, int); method @NonNull @RequiresPermission(android.Manifest.permission.CREATE_VIRTUAL_DEVICE) public android.hardware.input.VirtualNavigationTouchpad createVirtualNavigationTouchpad(@NonNull android.hardware.input.VirtualNavigationTouchpadConfig); + method @FlaggedApi("android.companion.virtual.flags.virtual_stylus") @NonNull @RequiresPermission(android.Manifest.permission.CREATE_VIRTUAL_DEVICE) public android.hardware.input.VirtualStylus createVirtualStylus(@NonNull android.hardware.input.VirtualStylusConfig); method @NonNull @RequiresPermission(android.Manifest.permission.CREATE_VIRTUAL_DEVICE) public android.hardware.input.VirtualTouchscreen createVirtualTouchscreen(@NonNull android.hardware.input.VirtualTouchscreenConfig); method @Deprecated @NonNull @RequiresPermission(android.Manifest.permission.CREATE_VIRTUAL_DEVICE) public android.hardware.input.VirtualTouchscreen createVirtualTouchscreen(@NonNull android.hardware.display.VirtualDisplay, @NonNull String, int, int); method public int getDeviceId(); @@ -3267,6 +3492,7 @@ package android.companion.virtual { field @Deprecated public static final int NAVIGATION_POLICY_DEFAULT_BLOCKED = 1; // 0x1 field @FlaggedApi("android.companion.virtual.flags.dynamic_policy") public static final int POLICY_TYPE_ACTIVITY = 3; // 0x3 field public static final int POLICY_TYPE_AUDIO = 1; // 0x1 + field @FlaggedApi("android.companion.virtual.flags.virtual_camera") public static final int POLICY_TYPE_CAMERA = 5; // 0x5 field @FlaggedApi("android.companion.virtual.flags.cross_device_clipboard") public static final int POLICY_TYPE_CLIPBOARD = 4; // 0x4 field public static final int POLICY_TYPE_RECENTS = 2; // 0x2 field public static final int POLICY_TYPE_SENSORS = 0; // 0x0 @@ -3347,38 +3573,39 @@ package android.companion.virtual.camera { } @FlaggedApi("android.companion.virtual.flags.virtual_camera") public interface VirtualCameraCallback { - method public void onProcessCaptureRequest(int, long, @Nullable android.companion.virtual.camera.VirtualCameraMetadata); + method public default void onProcessCaptureRequest(int, long); method public void onStreamClosed(int); - method public void onStreamConfigured(int, @NonNull android.view.Surface, @NonNull android.companion.virtual.camera.VirtualCameraStreamConfig); + method public void onStreamConfigured(int, @NonNull android.view.Surface, @IntRange(from=1) int, @IntRange(from=1) int, int); } @FlaggedApi("android.companion.virtual.flags.virtual_camera") public final class VirtualCameraConfig implements android.os.Parcelable { method public int describeContents(); - method @StringRes public int getDisplayNameStringRes(); + method public int getLensFacing(); + method @NonNull public String getName(); + method public int getSensorOrientation(); method @NonNull public java.util.Set getStreamConfigs(); method public void writeToParcel(@NonNull android.os.Parcel, int); field @NonNull public static final android.os.Parcelable.Creator CREATOR; + field public static final int SENSOR_ORIENTATION_0 = 0; // 0x0 + field public static final int SENSOR_ORIENTATION_180 = 180; // 0xb4 + field public static final int SENSOR_ORIENTATION_270 = 270; // 0x10e + field public static final int SENSOR_ORIENTATION_90 = 90; // 0x5a } @FlaggedApi("android.companion.virtual.flags.virtual_camera") public static final class VirtualCameraConfig.Builder { - ctor public VirtualCameraConfig.Builder(); - method @NonNull public android.companion.virtual.camera.VirtualCameraConfig.Builder addStreamConfig(int, int, int); + ctor public VirtualCameraConfig.Builder(@NonNull String); + method @NonNull public android.companion.virtual.camera.VirtualCameraConfig.Builder addStreamConfig(@IntRange(from=1) int, @IntRange(from=1) int, int, @IntRange(from=1) int); method @NonNull public android.companion.virtual.camera.VirtualCameraConfig build(); - method @NonNull public android.companion.virtual.camera.VirtualCameraConfig.Builder setDisplayNameStringRes(@StringRes int); + method @NonNull public android.companion.virtual.camera.VirtualCameraConfig.Builder setLensFacing(int); + method @NonNull public android.companion.virtual.camera.VirtualCameraConfig.Builder setSensorOrientation(int); method @NonNull public android.companion.virtual.camera.VirtualCameraConfig.Builder setVirtualCameraCallback(@NonNull java.util.concurrent.Executor, @NonNull android.companion.virtual.camera.VirtualCameraCallback); } - @FlaggedApi("android.companion.virtual.flags.virtual_camera") public final class VirtualCameraMetadata implements android.os.Parcelable { - method public int describeContents(); - method public void writeToParcel(@NonNull android.os.Parcel, int); - field @NonNull public static final android.os.Parcelable.Creator CREATOR; - } - @FlaggedApi("android.companion.virtual.flags.virtual_camera") public final class VirtualCameraStreamConfig implements android.os.Parcelable { - ctor public VirtualCameraStreamConfig(@IntRange(from=1) int, @IntRange(from=1) int, int); method public int describeContents(); method public int getFormat(); method @IntRange(from=1) public int getHeight(); + method @IntRange(from=1) public int getMaximumFramesPerSecond(); method @IntRange(from=1) public int getWidth(); method public void writeToParcel(@NonNull android.os.Parcel, int); field @NonNull public static final android.os.Parcelable.Creator CREATOR; @@ -3529,8 +3756,10 @@ package android.content { field public static final String CLOUDSEARCH_SERVICE = "cloudsearch"; field public static final String CONTENT_SUGGESTIONS_SERVICE = "content_suggestions"; field public static final String CONTEXTHUB_SERVICE = "contexthub"; + field @FlaggedApi("android.permission.flags.enhanced_confirmation_mode_apis_enabled") public static final String ECM_ENHANCED_CONFIRMATION_SERVICE = "ecm_enhanced_confirmation"; field public static final String ETHERNET_SERVICE = "ethernet"; field public static final String EUICC_CARD_SERVICE = "euicc_card"; + field @FlaggedApi("android.hardware.biometrics.face_background_authentication") public static final String FACE_SERVICE = "face"; field public static final String FONT_SERVICE = "font"; field public static final String HDMI_CONTROL_SERVICE = "hdmi_control"; field public static final String MEDIA_TRANSCODING_SERVICE = "media_transcoding"; @@ -3539,6 +3768,7 @@ package android.content { field public static final String NETD_SERVICE = "netd"; field @Deprecated public static final String NETWORK_SCORE_SERVICE = "network_score"; field public static final String OEM_LOCK_SERVICE = "oem_lock"; + field @FlaggedApi("android.app.ondeviceintelligence.flags.enable_on_device_intelligence") public static final String ON_DEVICE_INTELLIGENCE_SERVICE = "on_device_intelligence"; field public static final String PERMISSION_CONTROLLER_SERVICE = "permission_controller"; field public static final String PERMISSION_SERVICE = "permission"; field public static final String PERSISTENT_DATA_BLOCK_SERVICE = "persistent_data_block"; @@ -3597,6 +3827,7 @@ package android.content { field public static final String ACTION_INSTANT_APP_RESOLVER_SETTINGS = "android.intent.action.INSTANT_APP_RESOLVER_SETTINGS"; field @Deprecated public static final String ACTION_INTENT_FILTER_NEEDS_VERIFICATION = "android.intent.action.INTENT_FILTER_NEEDS_VERIFICATION"; field public static final String ACTION_LOAD_DATA = "android.intent.action.LOAD_DATA"; + field @FlaggedApi("android.security.frp_enforcement") public static final String ACTION_MAIN_USER_LOCKSCREEN_KNOWLEDGE_FACTOR_CHANGED = "android.intent.action.MAIN_USER_LOCKSCREEN_KNOWLEDGE_FACTOR_CHANGED"; field @RequiresPermission(android.Manifest.permission.GRANT_RUNTIME_PERMISSIONS) public static final String ACTION_MANAGE_APP_PERMISSION = "android.intent.action.MANAGE_APP_PERMISSION"; field @Deprecated public static final String ACTION_MANAGE_APP_PERMISSIONS = "android.intent.action.MANAGE_APP_PERMISSIONS"; field @RequiresPermission(android.Manifest.permission.MANAGE_ROLE_HOLDERS) public static final String ACTION_MANAGE_DEFAULT_APP = "android.intent.action.MANAGE_DEFAULT_APP"; @@ -3905,7 +4136,9 @@ package android.content.pm { method @RequiresPermission("com.android.permission.USE_INSTALLER_V2") public void addFile(int, @NonNull String, long, @NonNull byte[], @Nullable byte[]); method @RequiresPermission(android.Manifest.permission.INSTALL_PACKAGES) public void commitTransferred(@NonNull android.content.IntentSender); method @Nullable @RequiresPermission("com.android.permission.USE_INSTALLER_V2") public android.content.pm.DataLoaderParams getDataLoaderParams(); + method @FlaggedApi("android.content.pm.set_pre_verified_domains") @NonNull @RequiresPermission(android.Manifest.permission.ACCESS_INSTANT_APPS) public java.util.Set getPreVerifiedDomains(); method @RequiresPermission("com.android.permission.USE_INSTALLER_V2") public void removeFile(int, @NonNull String); + method @FlaggedApi("android.content.pm.set_pre_verified_domains") @RequiresPermission(android.Manifest.permission.ACCESS_INSTANT_APPS) public void setPreVerifiedDomains(@NonNull java.util.Set); } public static class PackageInstaller.SessionInfo implements android.os.Parcelable { @@ -3952,6 +4185,7 @@ package android.content.pm { method @NonNull public boolean canUserUninstall(@NonNull String, @NonNull android.os.UserHandle); method @NonNull public abstract java.util.List getAllIntentFilters(@NonNull String); method @NonNull @RequiresPermission(android.Manifest.permission.GET_APP_METADATA) public android.os.PersistableBundle getAppMetadata(@NonNull String) throws android.content.pm.PackageManager.NameNotFoundException; + method @FlaggedApi("android.content.pm.asl_in_apk_app_metadata_source") @RequiresPermission(android.Manifest.permission.GET_APP_METADATA) public int getAppMetadataSource(@NonNull String) throws android.content.pm.PackageManager.NameNotFoundException; method @NonNull @RequiresPermission(android.Manifest.permission.INTERACT_ACROSS_USERS) public android.content.pm.ApplicationInfo getApplicationInfoAsUser(@NonNull String, int, @NonNull android.os.UserHandle) throws android.content.pm.PackageManager.NameNotFoundException; method @NonNull @RequiresPermission(android.Manifest.permission.INTERACT_ACROSS_USERS) public android.content.pm.ApplicationInfo getApplicationInfoAsUser(@NonNull String, @NonNull android.content.pm.PackageManager.ApplicationInfoFlags, @NonNull android.os.UserHandle) throws android.content.pm.PackageManager.NameNotFoundException; method @NonNull public android.content.pm.dex.ArtManager getArtManager(); @@ -4004,6 +4238,10 @@ package android.content.pm { method @Deprecated @RequiresPermission(android.Manifest.permission.INTENT_FILTER_VERIFICATION_AGENT) public abstract void verifyIntentFilter(int, int, @NonNull java.util.List); field public static final String ACTION_REQUEST_PERMISSIONS = "android.content.pm.action.REQUEST_PERMISSIONS"; field public static final String ACTION_REQUEST_PERMISSIONS_FOR_OTHER = "android.content.pm.action.REQUEST_PERMISSIONS_FOR_OTHER"; + field @FlaggedApi("android.content.pm.asl_in_apk_app_metadata_source") public static final int APP_METADATA_SOURCE_APK = 1; // 0x1 + field @FlaggedApi("android.content.pm.asl_in_apk_app_metadata_source") public static final int APP_METADATA_SOURCE_INSTALLER = 2; // 0x2 + field @FlaggedApi("android.content.pm.asl_in_apk_app_metadata_source") public static final int APP_METADATA_SOURCE_SYSTEM_IMAGE = 3; // 0x3 + field @FlaggedApi("android.content.pm.asl_in_apk_app_metadata_source") public static final int APP_METADATA_SOURCE_UNKNOWN = 0; // 0x0 field public static final int DELETE_ALL_USERS = 2; // 0x2 field public static final int DELETE_FAILED_ABORTED = -5; // 0xfffffffb field public static final int DELETE_FAILED_DEVICE_POLICY_MANAGER = -2; // 0xfffffffe @@ -4148,7 +4386,7 @@ package android.content.pm { field public static final int PROTECTION_FLAG_MODULE = 4194304; // 0x400000 field public static final int PROTECTION_FLAG_OEM = 16384; // 0x4000 field public static final int PROTECTION_FLAG_RECENTS = 33554432; // 0x2000000 - field @Deprecated public static final int PROTECTION_FLAG_RETAIL_DEMO = 16777216; // 0x1000000 + field public static final int PROTECTION_FLAG_RETAIL_DEMO = 16777216; // 0x1000000 field public static final int PROTECTION_FLAG_ROLE = 67108864; // 0x4000000 field public static final int PROTECTION_FLAG_SYSTEM_TEXT_CLASSIFIER = 65536; // 0x10000 field public static final int PROTECTION_FLAG_VENDOR_PRIVILEGED = 32768; // 0x8000 @@ -4211,11 +4449,14 @@ package android.content.pm { field @NonNull public static final android.os.Parcelable.Creator CREATOR; field public static final int CROSS_PROFILE_CONTENT_SHARING_DELEGATE_FROM_PARENT = 1; // 0x1 field public static final int CROSS_PROFILE_CONTENT_SHARING_NO_DELEGATION = 0; // 0x0 + field public static final int CROSS_PROFILE_CONTENT_SHARING_UNKNOWN = -1; // 0xffffffff field public static final int SHOW_IN_QUIET_MODE_DEFAULT = 2; // 0x2 field public static final int SHOW_IN_QUIET_MODE_HIDDEN = 1; // 0x1 field public static final int SHOW_IN_QUIET_MODE_PAUSED = 0; // 0x0 + field public static final int SHOW_IN_QUIET_MODE_UNKNOWN = -1; // 0xffffffff field public static final int SHOW_IN_SHARING_SURFACES_NO = 2; // 0x2 field public static final int SHOW_IN_SHARING_SURFACES_SEPARATE = 1; // 0x1 + field public static final int SHOW_IN_SHARING_SURFACES_UNKNOWN = -1; // 0xffffffff field public static final int SHOW_IN_SHARING_SURFACES_WITH_PARENT = 0; // 0x0 } @@ -4284,10 +4525,12 @@ package android.content.pm.verify.domain { public final class DomainVerificationManager { method @Nullable @RequiresPermission(android.Manifest.permission.DOMAIN_VERIFICATION_AGENT) public android.content.pm.verify.domain.DomainVerificationInfo getDomainVerificationInfo(@NonNull String) throws android.content.pm.PackageManager.NameNotFoundException; method @NonNull @RequiresPermission(android.Manifest.permission.UPDATE_DOMAIN_VERIFICATION_USER_SELECTION) public java.util.SortedSet getOwnersForDomain(@NonNull String); + method @FlaggedApi("android.content.pm.relative_reference_intent_filters") @NonNull public java.util.Map> getUriRelativeFilterGroups(@NonNull String, @NonNull java.util.List); method @NonNull @RequiresPermission(android.Manifest.permission.DOMAIN_VERIFICATION_AGENT) public java.util.List queryValidVerificationPackageNames(); method @RequiresPermission(android.Manifest.permission.UPDATE_DOMAIN_VERIFICATION_USER_SELECTION) public void setDomainVerificationLinkHandlingAllowed(@NonNull String, boolean) throws android.content.pm.PackageManager.NameNotFoundException; method @CheckResult @RequiresPermission(android.Manifest.permission.DOMAIN_VERIFICATION_AGENT) public int setDomainVerificationStatus(@NonNull java.util.UUID, @NonNull java.util.Set, int) throws android.content.pm.PackageManager.NameNotFoundException; method @CheckResult @RequiresPermission(android.Manifest.permission.UPDATE_DOMAIN_VERIFICATION_USER_SELECTION) public int setDomainVerificationUserSelection(@NonNull java.util.UUID, @NonNull java.util.Set, boolean) throws android.content.pm.PackageManager.NameNotFoundException; + method @FlaggedApi("android.content.pm.relative_reference_intent_filters") @RequiresPermission(android.Manifest.permission.DOMAIN_VERIFICATION_AGENT) public void setUriRelativeFilterGroups(@NonNull String, @NonNull java.util.Map>); field public static final int ERROR_DOMAIN_SET_ID_INVALID = 1; // 0x1 field public static final int ERROR_UNABLE_TO_APPROVE = 3; // 0x3 field public static final int ERROR_UNKNOWN_DOMAIN = 2; // 0x2 @@ -4344,6 +4587,139 @@ package android.content.rollback { } +package android.credentials.selection { + + @FlaggedApi("android.credentials.flags.configurable_selector_ui_enabled") public final class AuthenticationEntry implements android.os.Parcelable { + ctor public AuthenticationEntry(@NonNull String, @NonNull String, @NonNull android.app.slice.Slice, int, @NonNull android.content.Intent); + method public int describeContents(); + method @Nullable public android.content.Intent getFrameworkExtrasIntent(); + method @NonNull public String getKey(); + method @NonNull public android.app.slice.Slice getSlice(); + method @NonNull public int getStatus(); + method @NonNull public String getSubkey(); + method public void writeToParcel(@NonNull android.os.Parcel, int); + field @NonNull public static final android.os.Parcelable.Creator CREATOR; + field public static final int STATUS_LOCKED = 0; // 0x0 + field public static final int STATUS_UNLOCKED_BUT_EMPTY_LESS_RECENT = 1; // 0x1 + field public static final int STATUS_UNLOCKED_BUT_EMPTY_MOST_RECENT = 2; // 0x2 + } + + @FlaggedApi("android.credentials.flags.configurable_selector_ui_enabled") public final class CancelSelectionRequest implements android.os.Parcelable { + ctor public CancelSelectionRequest(@NonNull android.credentials.selection.RequestToken, boolean, @NonNull String); + method public int describeContents(); + method @NonNull public String getPackageName(); + method @NonNull public android.credentials.selection.RequestToken getRequestToken(); + method public boolean shouldShowCancellationExplanation(); + method public void writeToParcel(@NonNull android.os.Parcel, int); + field @NonNull public static final android.os.Parcelable.Creator CREATOR; + } + + @FlaggedApi("android.credentials.flags.configurable_selector_ui_enabled") public final class CreateCredentialProviderInfo { + method @NonNull public String getProviderName(); + method @Nullable public android.credentials.selection.Entry getRemoteEntry(); + method @NonNull public java.util.List getSaveEntries(); + } + + @FlaggedApi("android.credentials.flags.configurable_selector_ui_enabled") public static final class CreateCredentialProviderInfo.Builder { + ctor public CreateCredentialProviderInfo.Builder(@NonNull String); + method @NonNull public android.credentials.selection.CreateCredentialProviderInfo build(); + method @NonNull public android.credentials.selection.CreateCredentialProviderInfo.Builder setRemoteEntry(@Nullable android.credentials.selection.Entry); + method @NonNull public android.credentials.selection.CreateCredentialProviderInfo.Builder setSaveEntries(@NonNull java.util.List); + } + + @FlaggedApi("android.credentials.flags.configurable_selector_ui_enabled") public final class DisabledProviderInfo { + ctor public DisabledProviderInfo(@NonNull String); + method @NonNull public String getProviderName(); + } + + @FlaggedApi("android.credentials.flags.configurable_selector_ui_enabled") public final class Entry implements android.os.Parcelable { + ctor public Entry(@NonNull String, @NonNull String, @NonNull android.app.slice.Slice, @NonNull android.content.Intent); + method public int describeContents(); + method @Nullable public android.content.Intent getFrameworkExtrasIntent(); + method @NonNull public String getKey(); + method @NonNull public android.app.slice.Slice getSlice(); + method @NonNull public String getSubkey(); + method public void writeToParcel(@NonNull android.os.Parcel, int); + field @NonNull public static final android.os.Parcelable.Creator CREATOR; + } + + @FlaggedApi("android.credentials.flags.configurable_selector_ui_enabled") public final class FailureResult { + ctor public FailureResult(int, @Nullable String); + method public int getErrorCode(); + method @Nullable public String getErrorMessage(); + method public static void sendFailureResult(@NonNull android.os.ResultReceiver, @NonNull android.credentials.selection.FailureResult); + field public static final int ERROR_CODE_CANCELED_AND_LAUNCHED_SETTINGS = 2; // 0x2 + field public static final int ERROR_CODE_DIALOG_CANCELED_BY_USER = 1; // 0x1 + field public static final int ERROR_CODE_UI_FAILURE = 0; // 0x0 + } + + @FlaggedApi("android.credentials.flags.configurable_selector_ui_enabled") public final class GetCredentialProviderInfo { + method @NonNull public java.util.List getActionChips(); + method @NonNull public java.util.List getAuthenticationEntries(); + method @NonNull public java.util.List getCredentialEntries(); + method @NonNull public String getProviderName(); + method @Nullable public android.credentials.selection.Entry getRemoteEntry(); + } + + @FlaggedApi("android.credentials.flags.configurable_selector_ui_enabled") public static final class GetCredentialProviderInfo.Builder { + ctor public GetCredentialProviderInfo.Builder(@NonNull String); + method @NonNull public android.credentials.selection.GetCredentialProviderInfo build(); + method @NonNull public android.credentials.selection.GetCredentialProviderInfo.Builder setActionChips(@NonNull java.util.List); + method @NonNull public android.credentials.selection.GetCredentialProviderInfo.Builder setAuthenticationEntries(@NonNull java.util.List); + method @NonNull public android.credentials.selection.GetCredentialProviderInfo.Builder setCredentialEntries(@NonNull java.util.List); + method @NonNull public android.credentials.selection.GetCredentialProviderInfo.Builder setRemoteEntry(@Nullable android.credentials.selection.Entry); + } + + @FlaggedApi("android.credentials.flags.configurable_selector_ui_enabled") public final class IntentHelper { + method @Nullable public static android.credentials.selection.CancelSelectionRequest extractCancelUiRequest(@NonNull android.content.Intent); + method @NonNull public static java.util.List extractCreateCredentialProviderInfoList(@NonNull android.content.Intent); + method @NonNull public static java.util.List extractDisabledProviderInfoList(@NonNull android.content.Intent); + method @NonNull public static java.util.List extractGetCredentialProviderInfoList(@NonNull android.content.Intent); + method @Nullable public static android.credentials.selection.RequestInfo extractRequestInfo(@NonNull android.content.Intent); + method @Nullable public static android.os.ResultReceiver extractResultReceiver(@NonNull android.content.Intent); + } + + @FlaggedApi("android.credentials.flags.configurable_selector_ui_enabled") public final class ProviderPendingIntentResponse implements android.os.Parcelable { + ctor public ProviderPendingIntentResponse(int, @Nullable android.content.Intent); + method public int describeContents(); + method public int getResultCode(); + method @Nullable public android.content.Intent getResultData(); + method public void writeToParcel(@NonNull android.os.Parcel, int); + field @NonNull public static final android.os.Parcelable.Creator CREATOR; + } + + @FlaggedApi("android.credentials.flags.configurable_selector_ui_enabled") public final class RequestInfo implements android.os.Parcelable { + method public int describeContents(); + method @Nullable public android.credentials.CreateCredentialRequest getCreateCredentialRequest(); + method @NonNull public java.util.List getDefaultProviderIds(); + method @Nullable public android.credentials.GetCredentialRequest getGetCredentialRequest(); + method @NonNull public String getPackageName(); + method @NonNull public java.util.List getRegistryProviderIds(); + method @NonNull public android.credentials.selection.RequestToken getRequestToken(); + method @NonNull public String getType(); + method public boolean hasPermissionToOverrideDefault(); + method public boolean isShowAllOptionsRequested(); + method public void writeToParcel(@NonNull android.os.Parcel, int); + field @NonNull public static final android.os.Parcelable.Creator CREATOR; + field @NonNull public static final String TYPE_CREATE = "android.credentials.selection.TYPE_CREATE"; + field @NonNull public static final String TYPE_GET = "android.credentials.selection.TYPE_GET"; + field @NonNull public static final String TYPE_UNDEFINED = "android.credentials.selection.TYPE_UNDEFINED"; + } + + @FlaggedApi("android.credentials.flags.configurable_selector_ui_enabled") public final class RequestToken { + } + + @FlaggedApi("android.credentials.flags.configurable_selector_ui_enabled") public final class UserSelectionResult { + ctor public UserSelectionResult(@NonNull String, @NonNull String, @NonNull String, @Nullable android.credentials.selection.ProviderPendingIntentResponse); + method @NonNull public String getEntryKey(); + method @NonNull public String getEntrySubkey(); + method @Nullable public android.credentials.selection.ProviderPendingIntentResponse getPendingIntentProviderResponse(); + method @NonNull public String getProviderId(); + method public static void sendUserSelectionResult(@NonNull android.os.ResultReceiver, @NonNull android.credentials.selection.UserSelectionResult); + } + +} + package android.database { public abstract class ContentObserver { @@ -4445,11 +4821,15 @@ package android.hardware { method @RequiresPermission(android.Manifest.permission.OBSERVE_SENSOR_PRIVACY) public void addSensorPrivacyListener(@NonNull android.hardware.SensorPrivacyManager.OnSensorPrivacyChangedListener); method @RequiresPermission(android.Manifest.permission.OBSERVE_SENSOR_PRIVACY) public void addSensorPrivacyListener(@NonNull java.util.concurrent.Executor, @NonNull android.hardware.SensorPrivacyManager.OnSensorPrivacyChangedListener); method @RequiresPermission(android.Manifest.permission.OBSERVE_SENSOR_PRIVACY) public boolean areAnySensorPrivacyTogglesEnabled(int); + method @FlaggedApi("com.android.internal.camera.flags.camera_privacy_allowlist") @NonNull @RequiresPermission(android.Manifest.permission.OBSERVE_SENSOR_PRIVACY) public java.util.Map getCameraPrivacyAllowlist(); + method @FlaggedApi("com.android.internal.camera.flags.camera_privacy_allowlist") @RequiresPermission(android.Manifest.permission.OBSERVE_SENSOR_PRIVACY) public int getSensorPrivacyState(int, int); + method @FlaggedApi("com.android.internal.camera.flags.camera_privacy_allowlist") @RequiresPermission(android.Manifest.permission.OBSERVE_SENSOR_PRIVACY) public boolean isCameraPrivacyEnabled(@NonNull String); method @Deprecated @RequiresPermission(android.Manifest.permission.OBSERVE_SENSOR_PRIVACY) public boolean isSensorPrivacyEnabled(int); method @RequiresPermission(android.Manifest.permission.OBSERVE_SENSOR_PRIVACY) public boolean isSensorPrivacyEnabled(int, int); method @RequiresPermission(android.Manifest.permission.OBSERVE_SENSOR_PRIVACY) public void removeSensorPrivacyListener(int, @NonNull android.hardware.SensorPrivacyManager.OnSensorPrivacyChangedListener); method @RequiresPermission(android.Manifest.permission.OBSERVE_SENSOR_PRIVACY) public void removeSensorPrivacyListener(@NonNull android.hardware.SensorPrivacyManager.OnSensorPrivacyChangedListener); method @RequiresPermission(android.Manifest.permission.MANAGE_SENSOR_PRIVACY) public void setSensorPrivacy(int, boolean); + method @FlaggedApi("com.android.internal.camera.flags.camera_privacy_allowlist") @RequiresPermission(android.Manifest.permission.MANAGE_SENSOR_PRIVACY) public void setSensorPrivacyState(int, int); } public static interface SensorPrivacyManager.OnSensorPrivacyChangedListener { @@ -4459,6 +4839,7 @@ package android.hardware { public static class SensorPrivacyManager.OnSensorPrivacyChangedListener.SensorPrivacyChangedParams { method public int getSensor(); + method @FlaggedApi("com.android.internal.camera.flags.camera_privacy_allowlist") public int getState(); method public int getToggleType(); method public boolean isEnabled(); } @@ -4497,30 +4878,35 @@ package android.hardware.camera2 { package android.hardware.camera2.extension { @FlaggedApi("com.android.internal.camera.flags.concert_mode") public abstract class AdvancedExtender { - ctor @FlaggedApi("com.android.internal.camera.flags.concert_mode") protected AdvancedExtender(@NonNull android.hardware.camera2.CameraManager); + ctor @FlaggedApi("com.android.internal.camera.flags.concert_mode") public AdvancedExtender(@NonNull android.hardware.camera2.CameraManager); method @FlaggedApi("com.android.internal.camera.flags.concert_mode") @NonNull public abstract java.util.List getAvailableCaptureRequestKeys(@NonNull String); method @FlaggedApi("com.android.internal.camera.flags.concert_mode") @NonNull public abstract java.util.List getAvailableCaptureResultKeys(@NonNull String); + method @FlaggedApi("com.android.internal.camera.flags.camera_extensions_characteristics_get") @NonNull public abstract java.util.List> getAvailableCharacteristicsKeyValues(); method @FlaggedApi("com.android.internal.camera.flags.concert_mode") public long getMetadataVendorId(@NonNull String); method @FlaggedApi("com.android.internal.camera.flags.concert_mode") @NonNull public abstract android.hardware.camera2.extension.SessionProcessor getSessionProcessor(); method @FlaggedApi("com.android.internal.camera.flags.concert_mode") @NonNull public abstract java.util.Map> getSupportedCaptureOutputResolutions(@NonNull String); method @FlaggedApi("com.android.internal.camera.flags.concert_mode") @NonNull public abstract java.util.Map> getSupportedPreviewOutputResolutions(@NonNull String); - method @FlaggedApi("com.android.internal.camera.flags.concert_mode") public abstract void init(@NonNull String, @NonNull android.hardware.camera2.extension.CharacteristicsMap); + method @FlaggedApi("com.android.internal.camera.flags.concert_mode") public abstract void initialize(@NonNull String, @NonNull android.hardware.camera2.extension.CharacteristicsMap); method @FlaggedApi("com.android.internal.camera.flags.concert_mode") public abstract boolean isExtensionAvailable(@NonNull String, @NonNull android.hardware.camera2.extension.CharacteristicsMap); } @FlaggedApi("com.android.internal.camera.flags.concert_mode") public abstract class CameraExtensionService extends android.app.Service { ctor @FlaggedApi("com.android.internal.camera.flags.concert_mode") protected CameraExtensionService(); - method @FlaggedApi("com.android.internal.camera.flags.concert_mode") @NonNull public android.os.IBinder onBind(@Nullable android.content.Intent); + method @FlaggedApi("com.android.internal.camera.flags.concert_mode") @NonNull public final android.os.IBinder onBind(@Nullable android.content.Intent); method @FlaggedApi("com.android.internal.camera.flags.concert_mode") @NonNull public abstract android.hardware.camera2.extension.AdvancedExtender onInitializeAdvancedExtension(int); method @FlaggedApi("com.android.internal.camera.flags.concert_mode") public abstract boolean onRegisterClient(@NonNull android.os.IBinder); method @FlaggedApi("com.android.internal.camera.flags.concert_mode") public abstract void onUnregisterClient(@NonNull android.os.IBinder); } @FlaggedApi("com.android.internal.camera.flags.concert_mode") public final class CameraOutputSurface { - ctor @FlaggedApi("com.android.internal.camera.flags.concert_mode") public CameraOutputSurface(@NonNull android.view.Surface, @Nullable android.util.Size); + ctor @FlaggedApi("com.android.internal.camera.flags.concert_mode") public CameraOutputSurface(@NonNull android.view.Surface, @NonNull android.util.Size); + method @FlaggedApi("com.android.internal.camera.flags.extension_10_bit") public int getColorSpace(); + method @FlaggedApi("com.android.internal.camera.flags.extension_10_bit") public long getDynamicRangeProfile(); method @FlaggedApi("com.android.internal.camera.flags.concert_mode") public int getImageFormat(); - method @FlaggedApi("com.android.internal.camera.flags.concert_mode") @Nullable public android.util.Size getSize(); - method @FlaggedApi("com.android.internal.camera.flags.concert_mode") @Nullable public android.view.Surface getSurface(); + method @FlaggedApi("com.android.internal.camera.flags.concert_mode") @NonNull public android.util.Size getSize(); + method @FlaggedApi("com.android.internal.camera.flags.concert_mode") @NonNull public android.view.Surface getSurface(); + method @FlaggedApi("com.android.internal.camera.flags.extension_10_bit") public void setColorSpace(int); + method @FlaggedApi("com.android.internal.camera.flags.extension_10_bit") public void setDynamicRangeProfile(long); } @FlaggedApi("com.android.internal.camera.flags.concert_mode") public class CharacteristicsMap { @@ -4538,10 +4924,10 @@ package android.hardware.camera2.extension { @FlaggedApi("com.android.internal.camera.flags.concert_mode") public final class RequestProcessor { method @FlaggedApi("com.android.internal.camera.flags.concert_mode") public void abortCaptures(); - method @FlaggedApi("com.android.internal.camera.flags.concert_mode") public int setRepeating(@NonNull android.hardware.camera2.extension.RequestProcessor.Request, @Nullable java.util.concurrent.Executor, @NonNull android.hardware.camera2.extension.RequestProcessor.RequestCallback); + method @FlaggedApi("com.android.internal.camera.flags.concert_mode") public int setRepeating(@NonNull android.hardware.camera2.extension.RequestProcessor.Request, @NonNull java.util.concurrent.Executor, @NonNull android.hardware.camera2.extension.RequestProcessor.RequestCallback) throws android.hardware.camera2.CameraAccessException; method @FlaggedApi("com.android.internal.camera.flags.concert_mode") public void stopRepeating(); - method @FlaggedApi("com.android.internal.camera.flags.concert_mode") public int submit(@NonNull android.hardware.camera2.extension.RequestProcessor.Request, @Nullable java.util.concurrent.Executor, @NonNull android.hardware.camera2.extension.RequestProcessor.RequestCallback); - method @FlaggedApi("com.android.internal.camera.flags.concert_mode") public int submitBurst(@NonNull java.util.List, @Nullable java.util.concurrent.Executor, @NonNull android.hardware.camera2.extension.RequestProcessor.RequestCallback); + method @FlaggedApi("com.android.internal.camera.flags.concert_mode") public int submit(@NonNull android.hardware.camera2.extension.RequestProcessor.Request, @NonNull java.util.concurrent.Executor, @NonNull android.hardware.camera2.extension.RequestProcessor.RequestCallback) throws android.hardware.camera2.CameraAccessException; + method @FlaggedApi("com.android.internal.camera.flags.concert_mode") public int submitBurst(@NonNull java.util.List, @NonNull java.util.concurrent.Executor, @NonNull android.hardware.camera2.extension.RequestProcessor.RequestCallback) throws android.hardware.camera2.CameraAccessException; } @FlaggedApi("com.android.internal.camera.flags.concert_mode") public static final class RequestProcessor.Request { @@ -4560,21 +4946,21 @@ package android.hardware.camera2.extension { } @FlaggedApi("com.android.internal.camera.flags.concert_mode") public abstract class SessionProcessor { - ctor @FlaggedApi("com.android.internal.camera.flags.concert_mode") protected SessionProcessor(); + ctor @FlaggedApi("com.android.internal.camera.flags.concert_mode") public SessionProcessor(); method @FlaggedApi("com.android.internal.camera.flags.concert_mode") public abstract void deInitSession(@NonNull android.os.IBinder); method @FlaggedApi("com.android.internal.camera.flags.concert_mode") @NonNull public abstract android.hardware.camera2.extension.ExtensionConfiguration initSession(@NonNull android.os.IBinder, @NonNull String, @NonNull android.hardware.camera2.extension.CharacteristicsMap, @NonNull android.hardware.camera2.extension.CameraOutputSurface, @NonNull android.hardware.camera2.extension.CameraOutputSurface); method @FlaggedApi("com.android.internal.camera.flags.concert_mode") public abstract void onCaptureSessionEnd(); method @FlaggedApi("com.android.internal.camera.flags.concert_mode") public abstract void onCaptureSessionStart(@NonNull android.hardware.camera2.extension.RequestProcessor, @NonNull String); method @FlaggedApi("com.android.internal.camera.flags.concert_mode") public abstract void setParameters(@NonNull android.hardware.camera2.CaptureRequest); - method @FlaggedApi("com.android.internal.camera.flags.concert_mode") public abstract int startCapture(@Nullable java.util.concurrent.Executor, @NonNull android.hardware.camera2.extension.SessionProcessor.CaptureCallback); - method @FlaggedApi("com.android.internal.camera.flags.concert_mode") public abstract int startRepeating(@Nullable java.util.concurrent.Executor, @NonNull android.hardware.camera2.extension.SessionProcessor.CaptureCallback); - method @FlaggedApi("com.android.internal.camera.flags.concert_mode") public abstract int startTrigger(@NonNull android.hardware.camera2.CaptureRequest, @Nullable java.util.concurrent.Executor, @NonNull android.hardware.camera2.extension.SessionProcessor.CaptureCallback); + method @FlaggedApi("com.android.internal.camera.flags.concert_mode") public abstract int startMultiFrameCapture(@NonNull java.util.concurrent.Executor, @NonNull android.hardware.camera2.extension.SessionProcessor.CaptureCallback); + method @FlaggedApi("com.android.internal.camera.flags.concert_mode") public abstract int startRepeating(@NonNull java.util.concurrent.Executor, @NonNull android.hardware.camera2.extension.SessionProcessor.CaptureCallback); + method @FlaggedApi("com.android.internal.camera.flags.concert_mode") public abstract int startTrigger(@NonNull android.hardware.camera2.CaptureRequest, @NonNull java.util.concurrent.Executor, @NonNull android.hardware.camera2.extension.SessionProcessor.CaptureCallback); method @FlaggedApi("com.android.internal.camera.flags.concert_mode") public abstract void stopRepeating(); } @FlaggedApi("com.android.internal.camera.flags.concert_mode") public static interface SessionProcessor.CaptureCallback { - method @FlaggedApi("com.android.internal.camera.flags.concert_mode") public void onCaptureCompleted(long, int, @NonNull android.hardware.camera2.CaptureResult); - method @FlaggedApi("com.android.internal.camera.flags.concert_mode") public void onCaptureFailed(int); + method @FlaggedApi("com.android.internal.camera.flags.concert_mode") public void onCaptureCompleted(long, int, @NonNull java.util.Map); + method @FlaggedApi("com.android.internal.camera.flags.concert_mode") public void onCaptureFailed(int, int); method @FlaggedApi("com.android.internal.camera.flags.concert_mode") public void onCaptureProcessStarted(int); method @FlaggedApi("com.android.internal.camera.flags.concert_mode") public void onCaptureSequenceAborted(int); method @FlaggedApi("com.android.internal.camera.flags.concert_mode") public void onCaptureSequenceCompleted(int); @@ -4597,6 +4983,39 @@ package android.hardware.camera2.params { } +package android.hardware.devicestate { + + @FlaggedApi("android.hardware.devicestate.feature.flags.device_state_property_api") public final class DeviceState { + method @IntRange(from=0x0) public int getIdentifier(); + method @NonNull public String getName(); + method public boolean hasProperties(@NonNull int...); + method public boolean hasProperty(int); + field public static final int PROPERTY_EMULATED_ONLY = 10; // 0xa + field public static final int PROPERTY_EXTENDED_DEVICE_STATE_EXTERNAL_DISPLAY = 15; // 0xf + field public static final int PROPERTY_FEATURE_DUAL_DISPLAY_INTERNAL_DEFAULT = 17; // 0x11 + field public static final int PROPERTY_FEATURE_REAR_DISPLAY = 16; // 0x10 + field public static final int PROPERTY_FOLDABLE_DISPLAY_CONFIGURATION_INNER_PRIMARY = 12; // 0xc + field public static final int PROPERTY_FOLDABLE_DISPLAY_CONFIGURATION_OUTER_PRIMARY = 11; // 0xb + field public static final int PROPERTY_FOLDABLE_HARDWARE_CONFIGURATION_FOLD_IN_CLOSED = 1; // 0x1 + field public static final int PROPERTY_FOLDABLE_HARDWARE_CONFIGURATION_FOLD_IN_HALF_OPEN = 2; // 0x2 + field public static final int PROPERTY_FOLDABLE_HARDWARE_CONFIGURATION_FOLD_IN_OPEN = 3; // 0x3 + field public static final int PROPERTY_POWER_CONFIGURATION_TRIGGER_SLEEP = 13; // 0xd + field public static final int PROPERTY_POWER_CONFIGURATION_TRIGGER_WAKE = 14; // 0xe + } + + @FlaggedApi("android.hardware.devicestate.feature.flags.device_state_property_api") public final class DeviceStateManager { + method @NonNull public java.util.List getSupportedDeviceStates(); + method public void registerCallback(@NonNull java.util.concurrent.Executor, @NonNull android.hardware.devicestate.DeviceStateManager.DeviceStateCallback); + method public void unregisterCallback(@NonNull android.hardware.devicestate.DeviceStateManager.DeviceStateCallback); + } + + public static interface DeviceStateManager.DeviceStateCallback { + method public default void onDeviceStateChanged(@NonNull android.hardware.devicestate.DeviceState); + method public default void onSupportedStatesChanged(@NonNull java.util.List); + } + +} + package android.hardware.display { public final class AmbientBrightnessDayStats implements android.os.Parcelable { @@ -4712,6 +5131,15 @@ package android.hardware.display { } +package android.hardware.face { + + @FlaggedApi("android.hardware.biometrics.face_background_authentication") public class FaceManager { + method @FlaggedApi("android.hardware.biometrics.face_background_authentication") @RequiresPermission(android.Manifest.permission.USE_BACKGROUND_FACE_AUTHENTICATION) public void authenticateInBackground(@Nullable java.util.concurrent.Executor, @Nullable android.hardware.biometrics.BiometricPrompt.CryptoObject, @Nullable android.os.CancellationSignal, @NonNull android.hardware.biometrics.BiometricPrompt.AuthenticationCallback); + method @FlaggedApi("android.hardware.biometrics.face_background_authentication") @RequiresPermission(anyOf={"android.permission.USE_BIOMETRIC_INTERNAL", android.Manifest.permission.USE_BACKGROUND_FACE_AUTHENTICATION}) public boolean hasEnrolledTemplates(); + } + +} + package android.hardware.hdmi { public abstract class HdmiClient { @@ -5307,6 +5735,78 @@ package android.hardware.input { method @NonNull public android.hardware.input.VirtualNavigationTouchpadConfig build(); } + @FlaggedApi("android.companion.virtual.flags.virtual_stylus") public class VirtualStylus implements java.io.Closeable { + method @RequiresPermission(android.Manifest.permission.CREATE_VIRTUAL_DEVICE) public void close(); + method @RequiresPermission(android.Manifest.permission.CREATE_VIRTUAL_DEVICE) public void sendButtonEvent(@NonNull android.hardware.input.VirtualStylusButtonEvent); + method @RequiresPermission(android.Manifest.permission.CREATE_VIRTUAL_DEVICE) public void sendMotionEvent(@NonNull android.hardware.input.VirtualStylusMotionEvent); + } + + @FlaggedApi("android.companion.virtual.flags.virtual_stylus") public final class VirtualStylusButtonEvent implements android.os.Parcelable { + method public int describeContents(); + method public int getAction(); + method public int getButtonCode(); + method public long getEventTimeNanos(); + method public void writeToParcel(@NonNull android.os.Parcel, int); + field public static final int ACTION_BUTTON_PRESS = 11; // 0xb + field public static final int ACTION_BUTTON_RELEASE = 12; // 0xc + field public static final int BUTTON_PRIMARY = 32; // 0x20 + field public static final int BUTTON_SECONDARY = 64; // 0x40 + field @NonNull public static final android.os.Parcelable.Creator CREATOR; + } + + @FlaggedApi("android.companion.virtual.flags.virtual_stylus") public static final class VirtualStylusButtonEvent.Builder { + ctor public VirtualStylusButtonEvent.Builder(); + method @NonNull public android.hardware.input.VirtualStylusButtonEvent build(); + method @NonNull public android.hardware.input.VirtualStylusButtonEvent.Builder setAction(int); + method @NonNull public android.hardware.input.VirtualStylusButtonEvent.Builder setButtonCode(int); + method @NonNull public android.hardware.input.VirtualStylusButtonEvent.Builder setEventTimeNanos(long); + } + + @FlaggedApi("android.companion.virtual.flags.virtual_stylus") public final class VirtualStylusConfig extends android.hardware.input.VirtualInputDeviceConfig implements android.os.Parcelable { + method public int describeContents(); + method public int getHeight(); + method public int getWidth(); + method public void writeToParcel(@NonNull android.os.Parcel, int); + field @NonNull public static final android.os.Parcelable.Creator CREATOR; + } + + @FlaggedApi("android.companion.virtual.flags.virtual_stylus") public static final class VirtualStylusConfig.Builder extends android.hardware.input.VirtualInputDeviceConfig.Builder { + ctor public VirtualStylusConfig.Builder(@IntRange(from=1) int, @IntRange(from=1) int); + method @NonNull public android.hardware.input.VirtualStylusConfig build(); + } + + @FlaggedApi("android.companion.virtual.flags.virtual_stylus") public final class VirtualStylusMotionEvent implements android.os.Parcelable { + method public int describeContents(); + method public int getAction(); + method public long getEventTimeNanos(); + method public int getPressure(); + method public int getTiltX(); + method public int getTiltY(); + method public int getToolType(); + method public int getX(); + method public int getY(); + method public void writeToParcel(@NonNull android.os.Parcel, int); + field public static final int ACTION_DOWN = 0; // 0x0 + field public static final int ACTION_MOVE = 2; // 0x2 + field public static final int ACTION_UP = 1; // 0x1 + field @NonNull public static final android.os.Parcelable.Creator CREATOR; + field public static final int TOOL_TYPE_ERASER = 4; // 0x4 + field public static final int TOOL_TYPE_STYLUS = 2; // 0x2 + } + + @FlaggedApi("android.companion.virtual.flags.virtual_stylus") public static final class VirtualStylusMotionEvent.Builder { + ctor public VirtualStylusMotionEvent.Builder(); + method @NonNull public android.hardware.input.VirtualStylusMotionEvent build(); + method @NonNull public android.hardware.input.VirtualStylusMotionEvent.Builder setAction(int); + method @NonNull public android.hardware.input.VirtualStylusMotionEvent.Builder setEventTimeNanos(long); + method @NonNull public android.hardware.input.VirtualStylusMotionEvent.Builder setPressure(@IntRange(from=0x0, to=0xff) int); + method @NonNull public android.hardware.input.VirtualStylusMotionEvent.Builder setTiltX(@IntRange(from=0xffffffa6, to=0x5a) int); + method @NonNull public android.hardware.input.VirtualStylusMotionEvent.Builder setTiltY(@IntRange(from=0xffffffa6, to=0x5a) int); + method @NonNull public android.hardware.input.VirtualStylusMotionEvent.Builder setToolType(int); + method @NonNull public android.hardware.input.VirtualStylusMotionEvent.Builder setX(int); + method @NonNull public android.hardware.input.VirtualStylusMotionEvent.Builder setY(int); + } + public final class VirtualTouchEvent implements android.os.Parcelable { method public int describeContents(); method public int getAction(); @@ -5383,6 +5883,7 @@ package android.hardware.location { method @NonNull public android.hardware.location.ContextHubInfo getAttachedHub(); method @IntRange(from=0, to=65535) public int getId(); method @RequiresPermission(android.Manifest.permission.ACCESS_CONTEXT_HUB) public int sendMessageToNanoApp(@NonNull android.hardware.location.NanoAppMessage); + method @FlaggedApi("android.chre.flags.reliable_message") @NonNull @RequiresPermission(android.Manifest.permission.ACCESS_CONTEXT_HUB) public android.hardware.location.ContextHubTransaction sendReliableMessageToNanoApp(@NonNull android.hardware.location.NanoAppMessage); } public class ContextHubClientCallback { @@ -5418,6 +5919,7 @@ package android.hardware.location { method public String getToolchain(); method public int getToolchainVersion(); method public String getVendor(); + method @FlaggedApi("android.chre.flags.reliable_message") public boolean supportsReliableMessages(); method public void writeToParcel(android.os.Parcel, int); field @NonNull public static final android.os.Parcelable.Creator CREATOR; } @@ -5501,6 +6003,7 @@ package android.hardware.location { field public static final int RESULT_FAILED_BAD_PARAMS = 2; // 0x2 field public static final int RESULT_FAILED_BUSY = 4; // 0x4 field public static final int RESULT_FAILED_HAL_UNAVAILABLE = 8; // 0x8 + field @FlaggedApi("android.chre.flags.reliable_message") public static final int RESULT_FAILED_NOT_SUPPORTED = 9; // 0x9 field public static final int RESULT_FAILED_SERVICE_INTERNAL_FAILURE = 7; // 0x7 field public static final int RESULT_FAILED_TIMEOUT = 6; // 0x6 field public static final int RESULT_FAILED_UNINITIALIZED = 3; // 0x3 @@ -5510,6 +6013,7 @@ package android.hardware.location { field public static final int TYPE_ENABLE_NANOAPP = 2; // 0x2 field public static final int TYPE_LOAD_NANOAPP = 0; // 0x0 field public static final int TYPE_QUERY_NANOAPPS = 4; // 0x4 + field @FlaggedApi("android.chre.flags.reliable_message") public static final int TYPE_RELIABLE_MESSAGE = 5; // 0x5 field public static final int TYPE_UNLOAD_NANOAPP = 1; // 0x1 } @@ -5692,12 +6196,17 @@ package android.hardware.location { public final class NanoAppMessage implements android.os.Parcelable { method public static android.hardware.location.NanoAppMessage createMessageFromNanoApp(long, int, byte[], boolean); + method @FlaggedApi("android.chre.flags.reliable_message") @NonNull public static android.hardware.location.NanoAppMessage createMessageFromNanoApp(long, int, @NonNull byte[], boolean, boolean, int); method public static android.hardware.location.NanoAppMessage createMessageToNanoApp(long, int, byte[]); method public int describeContents(); method public byte[] getMessageBody(); + method @FlaggedApi("android.chre.flags.reliable_message") public int getMessageSequenceNumber(); method public int getMessageType(); method public long getNanoAppId(); method public boolean isBroadcastMessage(); + method @FlaggedApi("android.chre.flags.reliable_message") public boolean isReliable(); + method @FlaggedApi("android.chre.flags.reliable_message") public void setIsReliable(boolean); + method @FlaggedApi("android.chre.flags.reliable_message") public void setMessageSequenceNumber(int); method public void writeToParcel(android.os.Parcel, int); field @NonNull public static final android.os.Parcelable.Creator CREATOR; } @@ -5754,7 +6263,7 @@ package android.hardware.radio { method public void addOnCompleteListener(@NonNull java.util.concurrent.Executor, @NonNull android.hardware.radio.ProgramList.OnCompleteListener); method public void addOnCompleteListener(@NonNull android.hardware.radio.ProgramList.OnCompleteListener); method public void close(); - method @Deprecated @Nullable public android.hardware.radio.RadioManager.ProgramInfo get(@NonNull android.hardware.radio.ProgramSelector.Identifier); + method @Nullable public android.hardware.radio.RadioManager.ProgramInfo get(@NonNull android.hardware.radio.ProgramSelector.Identifier); method @FlaggedApi("android.hardware.radio.hd_radio_improved") @NonNull public java.util.List getProgramInfos(@NonNull android.hardware.radio.ProgramSelector.Identifier); method public void registerListCallback(@NonNull java.util.concurrent.Executor, @NonNull android.hardware.radio.ProgramList.ListCallback); method public void registerListCallback(@NonNull android.hardware.radio.ProgramList.ListCallback); @@ -5806,7 +6315,7 @@ package android.hardware.radio { field @Deprecated public static final int IDENTIFIER_TYPE_DAB_SIDECC = 5; // 0x5 field @Deprecated public static final int IDENTIFIER_TYPE_DAB_SID_EXT = 5; // 0x5 field public static final int IDENTIFIER_TYPE_DRMO_FREQUENCY = 10; // 0xa - field @Deprecated public static final int IDENTIFIER_TYPE_DRMO_MODULATION = 11; // 0xb + field public static final int IDENTIFIER_TYPE_DRMO_MODULATION = 11; // 0xb field public static final int IDENTIFIER_TYPE_DRMO_SERVICE_ID = 9; // 0x9 field public static final int IDENTIFIER_TYPE_HD_STATION_ID_EXT = 3; // 0x3 field @FlaggedApi("android.hardware.radio.hd_radio_improved") public static final int IDENTIFIER_TYPE_HD_STATION_LOCATION = 15; // 0xf @@ -5814,8 +6323,8 @@ package android.hardware.radio { field @Deprecated public static final int IDENTIFIER_TYPE_HD_SUBCHANNEL = 4; // 0x4 field public static final int IDENTIFIER_TYPE_INVALID = 0; // 0x0 field public static final int IDENTIFIER_TYPE_RDS_PI = 2; // 0x2 - field @Deprecated public static final int IDENTIFIER_TYPE_SXM_CHANNEL = 13; // 0xd - field @Deprecated public static final int IDENTIFIER_TYPE_SXM_SERVICE_ID = 12; // 0xc + field public static final int IDENTIFIER_TYPE_SXM_CHANNEL = 13; // 0xd + field public static final int IDENTIFIER_TYPE_SXM_SERVICE_ID = 12; // 0xc field public static final int IDENTIFIER_TYPE_VENDOR_END = 1999; // 0x7cf field @Deprecated public static final int IDENTIFIER_TYPE_VENDOR_PRIMARY_END = 1999; // 0x7cf field @Deprecated public static final int IDENTIFIER_TYPE_VENDOR_PRIMARY_START = 1000; // 0x3e8 @@ -5868,7 +6377,7 @@ package android.hardware.radio { field public static final int CONFIG_DAB_DAB_SOFT_LINKING = 8; // 0x8 field public static final int CONFIG_DAB_FM_LINKING = 7; // 0x7 field public static final int CONFIG_DAB_FM_SOFT_LINKING = 9; // 0x9 - field @Deprecated public static final int CONFIG_FORCE_ANALOG = 2; // 0x2 + field public static final int CONFIG_FORCE_ANALOG = 2; // 0x2 field @FlaggedApi("android.hardware.radio.hd_radio_improved") public static final int CONFIG_FORCE_ANALOG_AM = 11; // 0xb field @FlaggedApi("android.hardware.radio.hd_radio_improved") public static final int CONFIG_FORCE_ANALOG_FM = 10; // 0xa field public static final int CONFIG_FORCE_DIGITAL = 3; // 0x3 @@ -6012,6 +6521,7 @@ package android.hardware.radio { method public boolean containsKey(String); method public int describeContents(); method @Deprecated public android.graphics.Bitmap getBitmap(String); + method @FlaggedApi("android.hardware.radio.hd_radio_improved") public int getBitmapId(@NonNull String); method public android.hardware.radio.RadioMetadata.Clock getClock(String); method public int getInt(String); method public String getString(String); @@ -6075,6 +6585,7 @@ package android.hardware.radio { method @RequiresPermission(android.Manifest.permission.ACCESS_BROADCAST_RADIO) public abstract void close(); method @Deprecated @RequiresPermission(android.Manifest.permission.ACCESS_BROADCAST_RADIO) public abstract int getConfiguration(android.hardware.radio.RadioManager.BandConfig[]); method @Nullable @RequiresPermission(android.Manifest.permission.ACCESS_BROADCAST_RADIO) public android.hardware.radio.ProgramList getDynamicProgramList(@Nullable android.hardware.radio.ProgramList.Filter); + method @FlaggedApi("android.hardware.radio.hd_radio_improved") @NonNull @RequiresPermission(android.Manifest.permission.ACCESS_BROADCAST_RADIO) public android.graphics.Bitmap getMetadataImage(int); method @RequiresPermission(android.Manifest.permission.ACCESS_BROADCAST_RADIO) public abstract boolean getMute(); method @NonNull @RequiresPermission(android.Manifest.permission.ACCESS_BROADCAST_RADIO) public java.util.Map getParameters(@NonNull java.util.List); method @Deprecated @RequiresPermission(android.Manifest.permission.ACCESS_BROADCAST_RADIO) public abstract int getProgramInformation(android.hardware.radio.RadioManager.ProgramInfo[]); @@ -6334,6 +6845,7 @@ package android.hardware.usb { method public int getSupportedRoleCombinations(); method public int getUsbDataStatus(); method public boolean isConnected(); + method @FlaggedApi("android.hardware.usb.flags.enable_is_pd_compliant_api") public boolean isPdCompliant(); method public boolean isPowerTransferLimited(); method public boolean isRoleCombinationSupported(int, int); method public void writeToParcel(android.os.Parcel, int); @@ -6479,6 +6991,7 @@ package android.media { method public void clearAudioServerStateCallback(); method @RequiresPermission(android.Manifest.permission.MODIFY_AUDIO_ROUTING) public boolean clearPreferredDevicesForCapturePreset(int); method @RequiresPermission(android.Manifest.permission.MODIFY_AUDIO_ROUTING) public int dispatchAudioFocusChange(@NonNull android.media.AudioFocusInfo, int, @NonNull android.media.audiopolicy.AudioPolicy); + method @FlaggedApi("android.media.audiopolicy.enable_fade_manager_configuration") @RequiresPermission(android.Manifest.permission.MODIFY_AUDIO_SETTINGS_PRIVILEGED) public int dispatchAudioFocusChangeWithFade(@NonNull android.media.AudioFocusInfo, int, @NonNull android.media.audiopolicy.AudioPolicy, @NonNull java.util.List, @Nullable android.media.FadeManagerConfiguration); method @NonNull @RequiresPermission(android.Manifest.permission.MODIFY_AUDIO_ROUTING) public int[] getActiveAssistantServicesUids(); method @IntRange(from=0) public long getAdditionalOutputDeviceDelay(@NonNull android.media.AudioDeviceInfo); method @NonNull @RequiresPermission(android.Manifest.permission.MODIFY_AUDIO_ROUTING) public int[] getAssistantServicesUids(); @@ -6678,6 +7191,70 @@ package android.media { field public static final int CONTENT_ID_NONE = 0; // 0x0 } + @FlaggedApi("android.media.audiopolicy.enable_fade_manager_configuration") public final class FadeManagerConfiguration implements android.os.Parcelable { + method public int describeContents(); + method @NonNull public java.util.List getAudioAttributesWithVolumeShaperConfigs(); + method @IntRange(from=1) public static long getDefaultFadeInDurationMillis(); + method @IntRange(from=1) public static long getDefaultFadeOutDurationMillis(); + method @IntRange(from=0) public long getFadeInDelayForOffenders(); + method @IntRange(from=0) public long getFadeInDurationForAudioAttributes(@NonNull android.media.AudioAttributes); + method @IntRange(from=0) public long getFadeInDurationForUsage(int); + method @Nullable public android.media.VolumeShaper.Configuration getFadeInVolumeShaperConfigForAudioAttributes(@NonNull android.media.AudioAttributes); + method @Nullable public android.media.VolumeShaper.Configuration getFadeInVolumeShaperConfigForUsage(int); + method @IntRange(from=0) public long getFadeOutDurationForAudioAttributes(@NonNull android.media.AudioAttributes); + method @IntRange(from=0) public long getFadeOutDurationForUsage(int); + method @Nullable public android.media.VolumeShaper.Configuration getFadeOutVolumeShaperConfigForAudioAttributes(@NonNull android.media.AudioAttributes); + method @Nullable public android.media.VolumeShaper.Configuration getFadeOutVolumeShaperConfigForUsage(int); + method public int getFadeState(); + method @NonNull public java.util.List getFadeableUsages(); + method @NonNull public java.util.List getUnfadeableAudioAttributes(); + method @NonNull public java.util.List getUnfadeableContentTypes(); + method @NonNull public java.util.List getUnfadeablePlayerTypes(); + method @NonNull public java.util.List getUnfadeableUids(); + method public boolean isAudioAttributesUnfadeable(@NonNull android.media.AudioAttributes); + method public boolean isContentTypeUnfadeable(int); + method public boolean isFadeEnabled(); + method public boolean isPlayerTypeUnfadeable(int); + method public boolean isUidUnfadeable(int); + method public boolean isUsageFadeable(int); + method public void writeToParcel(@NonNull android.os.Parcel, int); + field @NonNull public static final android.os.Parcelable.Creator CREATOR; + field public static final long DURATION_NOT_SET = 0L; // 0x0L + field public static final int FADE_STATE_DISABLED = 0; // 0x0 + field public static final int FADE_STATE_ENABLED_DEFAULT = 1; // 0x1 + field public static final String TAG = "FadeManagerConfiguration"; + field public static final int VOLUME_SHAPER_SYSTEM_FADE_ID = 2; // 0x2 + } + + public static final class FadeManagerConfiguration.Builder { + ctor public FadeManagerConfiguration.Builder(); + ctor public FadeManagerConfiguration.Builder(@IntRange(from=1) long, @IntRange(from=1) long); + ctor public FadeManagerConfiguration.Builder(@NonNull android.media.FadeManagerConfiguration); + method @NonNull public android.media.FadeManagerConfiguration.Builder addFadeableUsage(int); + method @NonNull public android.media.FadeManagerConfiguration.Builder addUnfadeableAudioAttributes(@NonNull android.media.AudioAttributes); + method @NonNull public android.media.FadeManagerConfiguration.Builder addUnfadeableContentType(int); + method @NonNull public android.media.FadeManagerConfiguration.Builder addUnfadeableUid(int); + method @NonNull public android.media.FadeManagerConfiguration build(); + method @NonNull public android.media.FadeManagerConfiguration.Builder clearFadeableUsages(); + method @NonNull public android.media.FadeManagerConfiguration.Builder clearUnfadeableAudioAttributes(); + method @NonNull public android.media.FadeManagerConfiguration.Builder clearUnfadeableContentTypes(); + method @NonNull public android.media.FadeManagerConfiguration.Builder clearUnfadeableUids(); + method @NonNull public android.media.FadeManagerConfiguration.Builder setFadeInDelayForOffenders(@IntRange(from=0) long); + method @NonNull public android.media.FadeManagerConfiguration.Builder setFadeInDurationForAudioAttributes(@NonNull android.media.AudioAttributes, @IntRange(from=0) long); + method @NonNull public android.media.FadeManagerConfiguration.Builder setFadeInDurationForUsage(int, @IntRange(from=0) long); + method @NonNull public android.media.FadeManagerConfiguration.Builder setFadeInVolumeShaperConfigForAudioAttributes(@NonNull android.media.AudioAttributes, @Nullable android.media.VolumeShaper.Configuration); + method @NonNull public android.media.FadeManagerConfiguration.Builder setFadeInVolumeShaperConfigForUsage(int, @Nullable android.media.VolumeShaper.Configuration); + method @NonNull public android.media.FadeManagerConfiguration.Builder setFadeOutDurationForAudioAttributes(@NonNull android.media.AudioAttributes, @IntRange(from=0) long); + method @NonNull public android.media.FadeManagerConfiguration.Builder setFadeOutDurationForUsage(int, @IntRange(from=0) long); + method @NonNull public android.media.FadeManagerConfiguration.Builder setFadeOutVolumeShaperConfigForAudioAttributes(@NonNull android.media.AudioAttributes, @Nullable android.media.VolumeShaper.Configuration); + method @NonNull public android.media.FadeManagerConfiguration.Builder setFadeOutVolumeShaperConfigForUsage(int, @Nullable android.media.VolumeShaper.Configuration); + method @NonNull public android.media.FadeManagerConfiguration.Builder setFadeState(int); + method @NonNull public android.media.FadeManagerConfiguration.Builder setFadeableUsages(@NonNull java.util.List); + method @NonNull public android.media.FadeManagerConfiguration.Builder setUnfadeableAudioAttributes(@NonNull java.util.List); + method @NonNull public android.media.FadeManagerConfiguration.Builder setUnfadeableContentTypes(@NonNull java.util.List); + method @NonNull public android.media.FadeManagerConfiguration.Builder setUnfadeableUids(@NonNull java.util.List); + } + public class HwAudioSource { method public boolean isPlaying(); method public void start(); @@ -6713,8 +7290,6 @@ package android.media { public final class MediaRouter2 { method @NonNull public java.util.List getAllRoutes(); method @Nullable public String getClientPackageName(); - method @Nullable @RequiresPermission(android.Manifest.permission.MEDIA_CONTENT_CONTROL) public static android.media.MediaRouter2 getInstance(@NonNull android.content.Context, @NonNull String); - method @RequiresPermission(android.Manifest.permission.MEDIA_CONTENT_CONTROL) public void setRouteVolume(@NonNull android.media.MediaRoute2Info, int); method @RequiresPermission(android.Manifest.permission.MEDIA_CONTENT_CONTROL) public void startScan(); method @RequiresPermission(android.Manifest.permission.MEDIA_CONTENT_CONTROL) public void stopScan(); method @RequiresPermission(android.Manifest.permission.MEDIA_CONTENT_CONTROL) public void transfer(@NonNull android.media.MediaRouter2.RoutingController, @NonNull android.media.MediaRoute2Info); @@ -6896,15 +7471,18 @@ package android.media.audiopolicy { public class AudioPolicy { method public int attachMixes(@NonNull java.util.List); + method @FlaggedApi("android.media.audiopolicy.enable_fade_manager_configuration") @RequiresPermission(android.Manifest.permission.MODIFY_AUDIO_SETTINGS_PRIVILEGED) public int clearFadeManagerConfigurationForFocusLoss(); method public android.media.AudioRecord createAudioRecordSink(android.media.audiopolicy.AudioMix) throws java.lang.IllegalArgumentException; method public android.media.AudioTrack createAudioTrackSource(android.media.audiopolicy.AudioMix) throws java.lang.IllegalArgumentException; method public int detachMixes(@NonNull java.util.List); + method @FlaggedApi("android.media.audiopolicy.enable_fade_manager_configuration") @NonNull @RequiresPermission(android.Manifest.permission.MODIFY_AUDIO_SETTINGS_PRIVILEGED) public android.media.FadeManagerConfiguration getFadeManagerConfigurationForFocusLoss(); method public int getFocusDuckingBehavior(); method @NonNull @RequiresPermission(android.Manifest.permission.MODIFY_AUDIO_ROUTING) public java.util.List getFocusStack(); method public int getStatus(); method public boolean removeUidDeviceAffinity(int); method public boolean removeUserIdDeviceAffinity(int); method @RequiresPermission(android.Manifest.permission.MODIFY_AUDIO_ROUTING) public boolean sendFocusLoss(@NonNull android.media.AudioFocusInfo) throws java.lang.IllegalStateException; + method @FlaggedApi("android.media.audiopolicy.enable_fade_manager_configuration") @RequiresPermission(android.Manifest.permission.MODIFY_AUDIO_SETTINGS_PRIVILEGED) public int setFadeManagerConfigurationForFocusLoss(@NonNull android.media.FadeManagerConfiguration); method public int setFocusDuckingBehavior(int) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException; method public void setRegistration(String); method public boolean setUidDeviceAffinity(int, @NonNull java.util.List); @@ -8990,9 +9568,9 @@ package android.media.tv.tuner.frontend { package android.media.voice { public final class KeyphraseModelManager { - method @RequiresPermission("android.permission.MANAGE_VOICE_KEYPHRASES") public void deleteKeyphraseSoundModel(int, @NonNull java.util.Locale); - method @Nullable @RequiresPermission("android.permission.MANAGE_VOICE_KEYPHRASES") public android.hardware.soundtrigger.SoundTrigger.KeyphraseSoundModel getKeyphraseSoundModel(int, @NonNull java.util.Locale); - method @RequiresPermission("android.permission.MANAGE_VOICE_KEYPHRASES") public void updateKeyphraseSoundModel(@NonNull android.hardware.soundtrigger.SoundTrigger.KeyphraseSoundModel); + method @RequiresPermission(android.Manifest.permission.MANAGE_VOICE_KEYPHRASES) public void deleteKeyphraseSoundModel(int, @NonNull java.util.Locale); + method @Nullable @RequiresPermission(android.Manifest.permission.MANAGE_VOICE_KEYPHRASES) public android.hardware.soundtrigger.SoundTrigger.KeyphraseSoundModel getKeyphraseSoundModel(int, @NonNull java.util.Locale); + method @RequiresPermission(android.Manifest.permission.MANAGE_VOICE_KEYPHRASES) public void updateKeyphraseSoundModel(@NonNull android.hardware.soundtrigger.SoundTrigger.KeyphraseSoundModel); } } @@ -9392,6 +9970,13 @@ package android.net.vcn { package android.net.wifi { + public final class WifiKeystore { + method @NonNull public static byte[] get(@NonNull String); + method @NonNull public static String[] list(@NonNull String); + method public static boolean put(@NonNull String, @NonNull byte[]); + method public static boolean remove(@NonNull String); + } + public final class WifiMigration { method @Nullable public static java.io.InputStream convertAndRetrieveSharedConfigStoreFile(int); method @Nullable public static java.io.InputStream convertAndRetrieveUserConfigStoreFile(int, @NonNull android.os.UserHandle); @@ -9436,6 +10021,7 @@ package android.net.wifi.nl80211 { public final class DeviceWiphyCapabilities implements android.os.Parcelable { ctor public DeviceWiphyCapabilities(); method public int describeContents(); + method @FlaggedApi("android.net.wifi.flags.get_device_cross_akm_roaming_support") public int getMaxNumberAkms(); method public int getMaxNumberRxSpatialStreams(); method public int getMaxNumberTxSpatialStreams(); method public boolean isChannelWidthSupported(int); @@ -9831,6 +10417,7 @@ package android.nfc.cardemulation { @FlaggedApi("android.nfc.enable_nfc_mainline") public final class ApduServiceInfo implements android.os.Parcelable { ctor @FlaggedApi("android.nfc.enable_nfc_mainline") public ApduServiceInfo(@NonNull android.content.pm.PackageManager, @NonNull android.content.pm.ResolveInfo, boolean) throws java.io.IOException, org.xmlpull.v1.XmlPullParserException; + method @FlaggedApi("android.nfc.nfc_read_polling_loop") public void addPollingLoopFilter(@NonNull String, boolean); method @FlaggedApi("android.nfc.enable_nfc_mainline") public int describeContents(); method @FlaggedApi("android.nfc.enable_nfc_mainline") public void dump(@NonNull android.os.ParcelFileDescriptor, @NonNull java.io.PrintWriter, @NonNull String[]); method @FlaggedApi("android.nfc.enable_nfc_mainline") public void dumpDebug(@NonNull android.util.proto.ProtoOutputStream); @@ -9841,8 +10428,10 @@ package android.nfc.cardemulation { method @FlaggedApi("android.nfc.enable_nfc_mainline") @NonNull public String getDescription(); method @FlaggedApi("android.nfc.enable_nfc_mainline") @NonNull public android.nfc.cardemulation.AidGroup getDynamicAidGroupForCategory(@NonNull String); method @FlaggedApi("android.nfc.enable_nfc_mainline") @Nullable public String getOffHostSecureElement(); + method @FlaggedApi("android.nfc.nfc_read_polling_loop") @NonNull public java.util.List getPollingLoopFilters(); method @FlaggedApi("android.nfc.enable_nfc_mainline") @NonNull public java.util.List getPrefixAids(); method @FlaggedApi("android.nfc.enable_nfc_mainline") @NonNull public String getSettingsActivityName(); + method @FlaggedApi("android.nfc.nfc_read_polling_loop") public boolean getShouldAutoTransact(@NonNull String); method @FlaggedApi("android.nfc.enable_nfc_mainline") @NonNull public java.util.List getSubsetAids(); method @FlaggedApi("android.nfc.enable_nfc_mainline") public int getUid(); method @FlaggedApi("android.nfc.enable_nfc_mainline") public boolean hasCategory(@NonNull String); @@ -9853,12 +10442,15 @@ package android.nfc.cardemulation { method @FlaggedApi("android.nfc.enable_nfc_mainline") @NonNull public android.graphics.drawable.Drawable loadIcon(@NonNull android.content.pm.PackageManager); method @FlaggedApi("android.nfc.enable_nfc_mainline") @NonNull public CharSequence loadLabel(@NonNull android.content.pm.PackageManager); method @FlaggedApi("android.nfc.enable_nfc_mainline") @NonNull public boolean removeDynamicAidGroupForCategory(@NonNull String); + method @FlaggedApi("android.nfc.nfc_read_polling_loop") public void removePollingLoopFilter(@NonNull String); method @FlaggedApi("android.nfc.enable_nfc_mainline") public boolean requiresScreenOn(); method @FlaggedApi("android.nfc.enable_nfc_mainline") public boolean requiresUnlock(); method @FlaggedApi("android.nfc.enable_nfc_mainline") public void resetOffHostSecureElement(); method @FlaggedApi("android.nfc.enable_nfc_mainline") public void setCategoryOtherServiceEnabled(boolean); method @FlaggedApi("android.nfc.enable_nfc_mainline") public void setDynamicAidGroup(@NonNull android.nfc.cardemulation.AidGroup); method @FlaggedApi("android.nfc.enable_nfc_mainline") public void setOffHostSecureElement(@NonNull String); + method @FlaggedApi("android.nfc.nfc_observe_mode") public void setShouldDefaultToObserveMode(boolean); + method @FlaggedApi("android.nfc.nfc_observe_mode") public boolean shouldDefaultToObserveMode(); method @FlaggedApi("android.nfc.enable_nfc_mainline") public void writeToParcel(@NonNull android.os.Parcel, int); field @FlaggedApi("android.nfc.enable_nfc_mainline") @NonNull public static final android.os.Parcelable.Creator CREATOR; } @@ -9891,12 +10483,17 @@ package android.os { field @RequiresPermission(android.Manifest.permission.BATTERY_STATS) public static final int BATTERY_PROPERTY_CHARGING_POLICY = 9; // 0x9 field @RequiresPermission(android.Manifest.permission.BATTERY_STATS) public static final int BATTERY_PROPERTY_FIRST_USAGE_DATE = 8; // 0x8 field @RequiresPermission(android.Manifest.permission.BATTERY_STATS) public static final int BATTERY_PROPERTY_MANUFACTURING_DATE = 7; // 0x7 + field @FlaggedApi("android.os.battery_part_status_api") @RequiresPermission(android.Manifest.permission.BATTERY_STATS) public static final int BATTERY_PROPERTY_PART_STATUS = 12; // 0xc + field @FlaggedApi("android.os.battery_part_status_api") @RequiresPermission(android.Manifest.permission.BATTERY_STATS) public static final int BATTERY_PROPERTY_SERIAL_NUMBER = 11; // 0xb field public static final int CHARGING_POLICY_ADAPTIVE_AC = 3; // 0x3 field public static final int CHARGING_POLICY_ADAPTIVE_AON = 2; // 0x2 field public static final int CHARGING_POLICY_ADAPTIVE_LONGLIFE = 4; // 0x4 field public static final int CHARGING_POLICY_DEFAULT = 1; // 0x1 field public static final String EXTRA_EVENTS = "android.os.extra.EVENTS"; field public static final String EXTRA_EVENT_TIMESTAMP = "android.os.extra.EVENT_TIMESTAMP"; + field @FlaggedApi("android.os.battery_part_status_api") public static final int PART_STATUS_ORIGINAL = 1; // 0x1 + field @FlaggedApi("android.os.battery_part_status_api") public static final int PART_STATUS_REPLACED = 2; // 0x2 + field @FlaggedApi("android.os.battery_part_status_api") public static final int PART_STATUS_UNSUPPORTED = 0; // 0x0 } public final class BatterySaverPolicyConfig implements android.os.Parcelable { @@ -10026,9 +10623,11 @@ package android.os { method public int getFlags(); method public int getMode(); field public static final int BUGREPORT_FLAG_DEFER_CONSENT = 2; // 0x2 + field @FlaggedApi("android.app.admin.flags.onboarding_bugreport_v2_enabled") public static final int BUGREPORT_FLAG_KEEP_BUGREPORT_ON_RETRIEVAL = 4; // 0x4 field public static final int BUGREPORT_FLAG_USE_PREDUMPED_UI_DATA = 1; // 0x1 field public static final int BUGREPORT_MODE_FULL = 0; // 0x0 field public static final int BUGREPORT_MODE_INTERACTIVE = 1; // 0x1 + field @FlaggedApi("android.app.admin.flags.onboarding_bugreport_v2_enabled") public static final int BUGREPORT_MODE_ONBOARDING = 7; // 0x7 field public static final int BUGREPORT_MODE_REMOTE = 2; // 0x2 field public static final int BUGREPORT_MODE_TELEPHONY = 4; // 0x4 field public static final int BUGREPORT_MODE_WEAR = 3; // 0x3 @@ -10043,6 +10642,7 @@ package android.os { public final class ConfigUpdate { field public static final String ACTION_UPDATE_CARRIER_ID_DB = "android.os.action.UPDATE_CARRIER_ID_DB"; field public static final String ACTION_UPDATE_CARRIER_PROVISIONING_URLS = "android.intent.action.UPDATE_CARRIER_PROVISIONING_URLS"; + field @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") public static final String ACTION_UPDATE_CONFIG = "android.os.action.UPDATE_CONFIG"; field public static final String ACTION_UPDATE_CONVERSATION_ACTIONS = "android.intent.action.UPDATE_CONVERSATION_ACTIONS"; field public static final String ACTION_UPDATE_CT_LOGS = "android.intent.action.UPDATE_CT_LOGS"; field public static final String ACTION_UPDATE_EMERGENCY_NUMBER_DB = "android.os.action.UPDATE_EMERGENCY_NUMBER_DB"; @@ -10052,6 +10652,7 @@ package android.os { field public static final String ACTION_UPDATE_PINS = "android.intent.action.UPDATE_PINS"; field public static final String ACTION_UPDATE_SMART_SELECTION = "android.intent.action.UPDATE_SMART_SELECTION"; field public static final String ACTION_UPDATE_SMS_SHORT_CODES = "android.intent.action.UPDATE_SMS_SHORT_CODES"; + field @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") public static final String EXTRA_DOMAIN = "android.os.extra.DOMAIN"; field public static final String EXTRA_REQUIRED_HASH = "android.os.extra.REQUIRED_HASH"; field public static final String EXTRA_VERSION = "android.os.extra.VERSION"; } @@ -10676,8 +11277,6 @@ package android.os { field public static final String USER_TYPE_FULL_GUEST = "android.os.usertype.full.GUEST"; field public static final String USER_TYPE_FULL_SECONDARY = "android.os.usertype.full.SECONDARY"; field public static final String USER_TYPE_FULL_SYSTEM = "android.os.usertype.full.SYSTEM"; - field public static final String USER_TYPE_PROFILE_CLONE = "android.os.usertype.profile.CLONE"; - field public static final String USER_TYPE_PROFILE_MANAGED = "android.os.usertype.profile.MANAGED"; field public static final String USER_TYPE_SYSTEM_HEADLESS = "android.os.usertype.system.HEADLESS"; } @@ -10822,6 +11421,7 @@ package android.os.storage { method @WorkerThread public void allocateBytes(java.io.FileDescriptor, long, @RequiresPermission int) throws java.io.IOException; method @WorkerThread public long getAllocatableBytes(@NonNull java.util.UUID, @RequiresPermission int) throws java.io.IOException; method @RequiresPermission(android.Manifest.permission.WRITE_MEDIA_STORAGE) public int getExternalStorageMountMode(int, @NonNull String); + method @FlaggedApi("android.os.storage_lifetime_api") @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public int getInternalStorageRemainingLifetime(); method public static boolean hasIsolatedStorage(); method public void updateExternalStorageFileQuotaType(@NonNull java.io.File, int) throws java.io.IOException; field @RequiresPermission(android.Manifest.permission.ALLOCATE_AGGRESSIVE) public static final int FLAG_ALLOCATE_AGGRESSIVE = 1; // 0x1 @@ -10914,6 +11514,7 @@ package android.permission { method public long getLastAccessTimeMillis(); method @NonNull public String getPackageName(); method @NonNull public String getPermissionGroupName(); + method @FlaggedApi("android.permission.flags.device_aware_permission_apis_enabled") @NonNull public String getPersistentDeviceId(); method @Nullable public CharSequence getProxyLabel(); method public int getUid(); method public boolean isActive(); @@ -10924,19 +11525,25 @@ package android.permission { public final class PermissionManager { method public int checkDeviceIdentifierAccess(@Nullable String, @Nullable String, @Nullable String, int, int); + method @FlaggedApi("android.permission.flags.device_aware_permission_apis_enabled") public int checkPermission(@NonNull String, @NonNull String, @NonNull String); method @RequiresPermission(value=android.Manifest.permission.UPDATE_APP_OPS_STATS, conditional=true) public int checkPermissionForDataDelivery(@NonNull String, @NonNull android.content.AttributionSource, @Nullable String); method @RequiresPermission(value=android.Manifest.permission.UPDATE_APP_OPS_STATS, conditional=true) public int checkPermissionForDataDeliveryFromDataSource(@NonNull String, @NonNull android.content.AttributionSource, @Nullable String); method public int checkPermissionForPreflight(@NonNull String, @NonNull android.content.AttributionSource); method @RequiresPermission(value=android.Manifest.permission.UPDATE_APP_OPS_STATS, conditional=true) public int checkPermissionForStartDataDelivery(@NonNull String, @NonNull android.content.AttributionSource, @Nullable String); method public void finishDataDelivery(@NonNull String, @NonNull android.content.AttributionSource); + method @FlaggedApi("android.permission.flags.device_aware_permission_apis_enabled") @NonNull @RequiresPermission(android.Manifest.permission.GET_RUNTIME_PERMISSIONS) public java.util.Map getAllPermissionStates(@NonNull String, @NonNull String); method @NonNull @RequiresPermission(android.Manifest.permission.ADJUST_RUNTIME_PERMISSIONS_POLICY) public java.util.Set getAutoRevokeExemptionGrantedPackages(); method @NonNull @RequiresPermission(android.Manifest.permission.ADJUST_RUNTIME_PERMISSIONS_POLICY) public java.util.Set getAutoRevokeExemptionRequestedPackages(); + method @FlaggedApi("android.permission.flags.device_aware_permission_apis_enabled") @RequiresPermission(anyOf={android.Manifest.permission.GRANT_RUNTIME_PERMISSIONS, android.Manifest.permission.REVOKE_RUNTIME_PERMISSIONS, android.Manifest.permission.GET_RUNTIME_PERMISSIONS}) public int getPermissionFlags(@NonNull String, @NonNull String, @NonNull String); method @IntRange(from=0) @RequiresPermission(anyOf={android.Manifest.permission.ADJUST_RUNTIME_PERMISSIONS_POLICY, android.Manifest.permission.UPGRADE_RUNTIME_PERMISSIONS}) public int getRuntimePermissionsVersion(); method @NonNull public java.util.List getSplitPermissions(); + method @FlaggedApi("android.permission.flags.device_aware_permission_apis_enabled") @RequiresPermission(android.Manifest.permission.GRANT_RUNTIME_PERMISSIONS) public void grantRuntimePermission(@NonNull String, @NonNull String, @NonNull String); + method @FlaggedApi("android.permission.flags.device_aware_permission_apis_enabled") @RequiresPermission(android.Manifest.permission.REVOKE_RUNTIME_PERMISSIONS) public void revokeRuntimePermission(@NonNull String, @NonNull String, @NonNull String, @Nullable String); method @RequiresPermission(anyOf={android.Manifest.permission.ADJUST_RUNTIME_PERMISSIONS_POLICY, android.Manifest.permission.UPGRADE_RUNTIME_PERMISSIONS}) public void setRuntimePermissionsVersion(@IntRange(from=0) int); method @Deprecated @RequiresPermission(android.Manifest.permission.MANAGE_ONE_TIME_PERMISSION_SESSIONS) public void startOneTimePermissionSession(@NonNull String, long, int, int); method @RequiresPermission(android.Manifest.permission.MANAGE_ONE_TIME_PERMISSION_SESSIONS) public void startOneTimePermissionSession(@NonNull String, long, long, int, int); method @RequiresPermission(android.Manifest.permission.MANAGE_ONE_TIME_PERMISSION_SESSIONS) public void stopOneTimePermissionSession(@NonNull String); + method @FlaggedApi("android.permission.flags.device_aware_permission_apis_enabled") @RequiresPermission(anyOf={android.Manifest.permission.GRANT_RUNTIME_PERMISSIONS, android.Manifest.permission.REVOKE_RUNTIME_PERMISSIONS}) public void updatePermissionFlags(@NonNull String, @NonNull String, @NonNull String, int, int); field @RequiresPermission(android.Manifest.permission.START_REVIEW_PERMISSION_DECISIONS) public static final String ACTION_REVIEW_PERMISSION_DECISIONS = "android.permission.action.REVIEW_PERMISSION_DECISIONS"; field public static final String EXTRA_PERMISSION_USAGES = "android.permission.extra.PERMISSION_USAGES"; field public static final int PERMISSION_GRANTED = 0; // 0x0 @@ -10944,6 +11551,14 @@ package android.permission { field public static final int PERMISSION_SOFT_DENIED = 1; // 0x1 } + @FlaggedApi("android.permission.flags.device_aware_permission_apis_enabled") public static final class PermissionManager.PermissionState implements android.os.Parcelable { + method @FlaggedApi("android.permission.flags.device_aware_permission_apis_enabled") public int describeContents(); + method @FlaggedApi("android.permission.flags.device_aware_permission_apis_enabled") public int getFlags(); + method @FlaggedApi("android.permission.flags.device_aware_permission_apis_enabled") public boolean isGranted(); + method @FlaggedApi("android.permission.flags.device_aware_permission_apis_enabled") public void writeToParcel(@NonNull android.os.Parcel, int); + field @FlaggedApi("android.permission.flags.device_aware_permission_apis_enabled") @NonNull public static final android.os.Parcelable.Creator CREATOR; + } + public static final class PermissionManager.SplitPermissionInfo { method @NonNull public java.util.List getNewPermissions(); method @NonNull public String getSplitPermission(); @@ -11053,6 +11668,29 @@ package android.printservice.recommendation { package android.provider { + public static class BlockedNumberContract.BlockedNumbers { + method @FlaggedApi("com.android.server.telecom.flags.telecom_resolve_hidden_dependencies") @RequiresPermission(allOf={android.Manifest.permission.READ_BLOCKED_NUMBERS, android.Manifest.permission.WRITE_BLOCKED_NUMBERS}) public static void endBlockSuppression(@NonNull android.content.Context); + method @FlaggedApi("com.android.server.telecom.flags.telecom_resolve_hidden_dependencies") @NonNull @RequiresPermission(allOf={android.Manifest.permission.READ_BLOCKED_NUMBERS, android.Manifest.permission.WRITE_BLOCKED_NUMBERS}) public static android.provider.BlockedNumberContract.BlockedNumbers.BlockSuppressionStatus getBlockSuppressionStatus(@NonNull android.content.Context); + method @FlaggedApi("com.android.server.telecom.flags.telecom_resolve_hidden_dependencies") @RequiresPermission(allOf={android.Manifest.permission.READ_BLOCKED_NUMBERS, android.Manifest.permission.WRITE_BLOCKED_NUMBERS}) public static boolean getBlockedNumberSetting(@NonNull android.content.Context, @NonNull String); + method @FlaggedApi("com.android.server.telecom.flags.telecom_resolve_hidden_dependencies") @RequiresPermission(allOf={android.Manifest.permission.READ_BLOCKED_NUMBERS, android.Manifest.permission.WRITE_BLOCKED_NUMBERS}) public static void notifyEmergencyContact(@NonNull android.content.Context); + method @FlaggedApi("com.android.server.telecom.flags.telecom_resolve_hidden_dependencies") @RequiresPermission(allOf={android.Manifest.permission.READ_BLOCKED_NUMBERS, android.Manifest.permission.WRITE_BLOCKED_NUMBERS}) public static void setBlockedNumberSetting(@NonNull android.content.Context, @NonNull String, boolean); + method @FlaggedApi("com.android.server.telecom.flags.telecom_resolve_hidden_dependencies") @RequiresPermission(allOf={android.Manifest.permission.READ_BLOCKED_NUMBERS, android.Manifest.permission.WRITE_BLOCKED_NUMBERS}) public static boolean shouldShowEmergencyCallNotification(@NonNull android.content.Context); + method @FlaggedApi("com.android.server.telecom.flags.telecom_resolve_hidden_dependencies") @RequiresPermission(allOf={android.Manifest.permission.READ_BLOCKED_NUMBERS, android.Manifest.permission.WRITE_BLOCKED_NUMBERS}) public static int shouldSystemBlockNumber(@NonNull android.content.Context, @NonNull String, int, boolean); + field @FlaggedApi("com.android.server.telecom.flags.telecom_resolve_hidden_dependencies") public static final String ACTION_BLOCK_SUPPRESSION_STATE_CHANGED = "android.provider.action.BLOCK_SUPPRESSION_STATE_CHANGED"; + field @FlaggedApi("com.android.server.telecom.flags.telecom_resolve_hidden_dependencies") public static final String ENHANCED_SETTING_KEY_BLOCK_PAYPHONE = "block_payphone_calls_setting"; + field @FlaggedApi("com.android.server.telecom.flags.telecom_resolve_hidden_dependencies") public static final String ENHANCED_SETTING_KEY_BLOCK_PRIVATE = "block_private_number_calls_setting"; + field @FlaggedApi("com.android.server.telecom.flags.telecom_resolve_hidden_dependencies") public static final String ENHANCED_SETTING_KEY_BLOCK_UNAVAILABLE = "block_unavailable_calls_setting"; + field @FlaggedApi("com.android.server.telecom.flags.telecom_resolve_hidden_dependencies") public static final String ENHANCED_SETTING_KEY_BLOCK_UNKNOWN = "block_unknown_calls_setting"; + field @FlaggedApi("com.android.server.telecom.flags.telecom_resolve_hidden_dependencies") public static final String ENHANCED_SETTING_KEY_BLOCK_UNREGISTERED = "block_numbers_not_in_contacts_setting"; + field @FlaggedApi("com.android.server.telecom.flags.telecom_resolve_hidden_dependencies") public static final String ENHANCED_SETTING_KEY_SHOW_EMERGENCY_CALL_NOTIFICATION = "show_emergency_call_notification"; + } + + @FlaggedApi("com.android.server.telecom.flags.telecom_resolve_hidden_dependencies") public static final class BlockedNumberContract.BlockedNumbers.BlockSuppressionStatus { + ctor public BlockedNumberContract.BlockedNumbers.BlockSuppressionStatus(boolean, long); + method public boolean getIsSuppressed(); + method public long getUntilTimestampMillis(); + } + public class CallLog { method @RequiresPermission(allOf={android.Manifest.permission.WRITE_CALL_LOG, android.Manifest.permission.INTERACT_ACROSS_USERS}) public static void storeCallComposerPicture(@NonNull android.content.Context, @NonNull java.io.InputStream, @NonNull java.util.concurrent.Executor, @NonNull android.os.OutcomeReceiver); } @@ -11123,6 +11761,12 @@ package android.provider { field public static final int FLAG_REMOVABLE_USB = 524288; // 0x80000 } + @FlaggedApi("android.provider.user_keys") public final class E2eeContactKeysManager { + method @RequiresPermission(allOf={android.Manifest.permission.WRITE_VERIFICATION_STATE_E2EE_CONTACT_KEYS, android.Manifest.permission.WRITE_CONTACTS}) public boolean updateE2eeContactKeyLocalVerificationState(@NonNull String, @NonNull String, @NonNull String, @NonNull String, int); + method @RequiresPermission(allOf={android.Manifest.permission.WRITE_VERIFICATION_STATE_E2EE_CONTACT_KEYS, android.Manifest.permission.WRITE_CONTACTS}) public boolean updateE2eeContactKeyRemoteVerificationState(@NonNull String, @NonNull String, @NonNull String, @NonNull String, int); + method @RequiresPermission(allOf={android.Manifest.permission.WRITE_VERIFICATION_STATE_E2EE_CONTACT_KEYS, android.Manifest.permission.WRITE_CONTACTS}) public boolean updateE2eeSelfKeyRemoteVerificationState(@NonNull String, @NonNull String, @NonNull String, int); + } + public abstract class SearchIndexableData { ctor public SearchIndexableData(); ctor public SearchIndexableData(android.content.Context); @@ -11650,6 +12294,7 @@ package android.service.appprediction { method @MainThread public void onDestroyPredictionSession(@NonNull android.app.prediction.AppPredictionSessionId); method @MainThread public abstract void onLaunchLocationShown(@NonNull android.app.prediction.AppPredictionSessionId, @NonNull String, @NonNull java.util.List); method @MainThread public abstract void onRequestPredictionUpdate(@NonNull android.app.prediction.AppPredictionSessionId); + method @FlaggedApi("android.service.appprediction.flags.service_features_api") @MainThread public void onRequestServiceFeatures(@NonNull android.app.prediction.AppPredictionSessionId, @NonNull java.util.function.Consumer); method @MainThread public abstract void onSortAppTargets(@NonNull android.app.prediction.AppPredictionSessionId, @NonNull java.util.List, @NonNull android.os.CancellationSignal, @NonNull java.util.function.Consumer>); method @MainThread public void onStartPredictionUpdates(); method @MainThread public void onStopPredictionUpdates(); @@ -11847,14 +12492,6 @@ package android.service.carrier { } -package android.service.chooser { - - @FlaggedApi("android.service.chooser.support_nfc_resolver") public class CustomChoosers { - method @FlaggedApi("android.service.chooser.support_nfc_resolver") @NonNull public static android.content.Intent createNfcResolverIntent(@NonNull android.content.Intent, @Nullable CharSequence, @NonNull java.util.List); - } - -} - package android.service.cloudsearch { public abstract class CloudSearchService extends android.app.Service { @@ -12046,6 +12683,7 @@ package android.service.euicc { method @Deprecated public int onDownloadSubscription(int, @NonNull android.telephony.euicc.DownloadableSubscription, boolean, boolean); method @Deprecated public abstract int onEraseSubscriptions(int); method public int onEraseSubscriptions(int, int); + method @FlaggedApi("com.android.internal.telephony.flags.esim_available_memory") public long onGetAvailableMemoryInBytes(int); method public abstract android.service.euicc.GetDefaultDownloadableSubscriptionListResult onGetDefaultDownloadableSubscriptionList(int, boolean); method public abstract android.service.euicc.GetDownloadableSubscriptionMetadataResult onGetDownloadableSubscriptionMetadata(int, android.telephony.euicc.DownloadableSubscription, boolean); method @NonNull public android.service.euicc.GetDownloadableSubscriptionMetadataResult onGetDownloadableSubscriptionMetadata(int, int, @NonNull android.telephony.euicc.DownloadableSubscription, boolean); @@ -12314,15 +12952,59 @@ package android.service.oemlock { } +package android.service.ondeviceintelligence { + + @FlaggedApi("android.app.ondeviceintelligence.flags.enable_on_device_intelligence") public abstract class OnDeviceIntelligenceService extends android.app.Service { + ctor public OnDeviceIntelligenceService(); + method @Nullable public final android.os.IBinder onBind(@NonNull android.content.Intent); + method public abstract void onDownloadFeature(@NonNull android.app.ondeviceintelligence.Feature, @Nullable android.os.CancellationSignal, @NonNull android.app.ondeviceintelligence.DownloadCallback); + method public abstract void onGetFeature(int, @NonNull android.os.OutcomeReceiver); + method public abstract void onGetFeatureDetails(@NonNull android.app.ondeviceintelligence.Feature, @NonNull android.os.OutcomeReceiver); + method public abstract void onGetReadOnlyFeatureFileDescriptorMap(@NonNull android.app.ondeviceintelligence.Feature, @NonNull java.util.function.Consumer>); + method public abstract void onGetVersion(@NonNull java.util.function.LongConsumer); + method public abstract void onListFeatures(@NonNull android.os.OutcomeReceiver,android.app.ondeviceintelligence.OnDeviceIntelligenceManager.OnDeviceIntelligenceManagerException>); + method public final void updateProcessingState(@NonNull android.os.Bundle, @NonNull java.util.concurrent.Executor, @NonNull android.os.OutcomeReceiver); + field public static final String SERVICE_INTERFACE = "android.service.ondeviceintelligence.OnDeviceIntelligenceService"; + } + + public abstract static class OnDeviceIntelligenceService.OnDeviceIntelligenceServiceException extends java.lang.Exception { + ctor public OnDeviceIntelligenceService.OnDeviceIntelligenceServiceException(int); + ctor public OnDeviceIntelligenceService.OnDeviceIntelligenceServiceException(int, @NonNull String); + method public int getErrorCode(); + } + + public static class OnDeviceIntelligenceService.OnDeviceUpdateProcessingException extends android.service.ondeviceintelligence.OnDeviceIntelligenceService.OnDeviceIntelligenceServiceException { + ctor public OnDeviceIntelligenceService.OnDeviceUpdateProcessingException(int); + ctor public OnDeviceIntelligenceService.OnDeviceUpdateProcessingException(int, @NonNull String); + field public static final int PROCESSING_UPDATE_STATUS_CONNECTION_FAILED = 1; // 0x1 + } + + @FlaggedApi("android.app.ondeviceintelligence.flags.enable_on_device_intelligence") public abstract class OnDeviceTrustedInferenceService extends android.app.Service { + ctor public OnDeviceTrustedInferenceService(); + method public final void fetchFeatureFileInputStreamMap(@NonNull android.app.ondeviceintelligence.Feature, @NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer>); + method @Nullable public final android.os.IBinder onBind(@NonNull android.content.Intent); + method @NonNull public abstract void onCountTokens(@NonNull android.app.ondeviceintelligence.Feature, @NonNull android.app.ondeviceintelligence.Content, @Nullable android.os.CancellationSignal, @NonNull android.os.OutcomeReceiver); + method @NonNull public abstract void onProcessRequest(@NonNull android.app.ondeviceintelligence.Feature, @NonNull android.app.ondeviceintelligence.Content, int, @Nullable android.os.CancellationSignal, @Nullable android.app.ondeviceintelligence.ProcessingSignal, @NonNull android.os.OutcomeReceiver); + method @NonNull public abstract void onProcessRequestStreaming(@NonNull android.app.ondeviceintelligence.Feature, @NonNull android.app.ondeviceintelligence.Content, int, @Nullable android.os.CancellationSignal, @Nullable android.app.ondeviceintelligence.ProcessingSignal, @NonNull android.app.ondeviceintelligence.StreamingResponseReceiver); + method public abstract void onUpdateProcessingState(@NonNull android.os.Bundle, @NonNull android.os.OutcomeReceiver); + method public final java.io.FileInputStream openFileInput(@NonNull String) throws java.io.FileNotFoundException; + method public final void openFileInputAsync(@NonNull String, @NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer) throws java.io.FileNotFoundException; + field public static final String SERVICE_INTERFACE = "android.service.ondeviceintelligence.OnDeviceTrustedInferenceService"; + } + +} + package android.service.persistentdata { - public class PersistentDataBlockManager { + @FlaggedApi("android.security.frp_enforcement") public class PersistentDataBlockManager { + method @FlaggedApi("android.security.frp_enforcement") @RequiresPermission(android.Manifest.permission.CONFIGURE_FACTORY_RESET_PROTECTION) public boolean deactivateFactoryResetProtection(@NonNull byte[]); method @RequiresPermission(android.Manifest.permission.ACCESS_PDB_STATE) public int getDataBlockSize(); method @RequiresPermission(anyOf={android.Manifest.permission.READ_OEM_UNLOCK_STATE, "android.permission.OEM_UNLOCK_STATE"}) public int getFlashLockState(); method public long getMaximumDataBlockSize(); method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.READ_OEM_UNLOCK_STATE, "android.permission.OEM_UNLOCK_STATE"}) public boolean getOemUnlockEnabled(); method @NonNull @RequiresPermission(android.Manifest.permission.ACCESS_PDB_STATE) public String getPersistentDataPackageName(); method public byte[] read(); + method @FlaggedApi("android.security.frp_enforcement") public boolean setFactoryResetProtectionSecret(@NonNull byte[]); method @Deprecated @RequiresPermission("android.permission.OEM_UNLOCK_STATE") public void setOemUnlockEnabled(boolean); method @RequiresPermission("android.permission.OEM_UNLOCK_STATE") public void wipe(); method public int write(byte[]); @@ -12733,6 +13415,7 @@ package android.service.voice { method @Nullable public android.service.voice.HotwordDetectedResult getHotwordDetectedResult(); method @NonNull public java.util.List getKeyphraseRecognitionExtras(); method @Deprecated @Nullable public byte[] getTriggerAudio(); + method @FlaggedApi("android.app.wearable.enable_hotword_wearable_sensing_api") public boolean isRecognitionStopped(); field public static final int DATA_FORMAT_RAW = 0; // 0x0 field public static final int DATA_FORMAT_TRIGGER_AUDIO = 1; // 0x1 } @@ -12786,10 +13469,12 @@ package android.service.voice { method public static int getMaxBundleSize(); method public static int getMaxHotwordPhraseId(); method public static int getMaxScore(); + method @FlaggedApi("android.service.voice.flags.allow_speaker_id_egress") public static int getMaxSpeakerId(); method @Nullable public android.media.MediaSyncEvent getMediaSyncEvent(); method public int getPersonalizedScore(); method public int getProximity(); method public int getScore(); + method @FlaggedApi("android.service.voice.flags.allow_speaker_id_egress") public int getSpeakerId(); method public boolean isHotwordDetectionPersonalized(); method public void writeToParcel(@NonNull android.os.Parcel, int); field public static final int AUDIO_CHANNEL_UNSET = -1; // 0xffffffff @@ -12823,6 +13508,7 @@ package android.service.voice { method @NonNull public android.service.voice.HotwordDetectedResult.Builder setMediaSyncEvent(@NonNull android.media.MediaSyncEvent); method @NonNull public android.service.voice.HotwordDetectedResult.Builder setPersonalizedScore(int); method @NonNull public android.service.voice.HotwordDetectedResult.Builder setScore(int); + method @FlaggedApi("android.service.voice.flags.allow_speaker_id_egress") @NonNull public android.service.voice.HotwordDetectedResult.Builder setSpeakerId(int); } public abstract class HotwordDetectionService extends android.app.Service implements android.service.voice.SandboxedDetectionInitializer { @@ -12836,13 +13522,13 @@ package android.service.voice { method public void onUpdateState(@Nullable android.os.PersistableBundle, @Nullable android.os.SharedMemory, long, @Nullable java.util.function.IntConsumer); field @Deprecated public static final int INITIALIZATION_STATUS_SUCCESS = 0; // 0x0 field @Deprecated public static final int INITIALIZATION_STATUS_UNKNOWN = 100; // 0x64 + field @FlaggedApi("android.app.wearable.enable_hotword_wearable_sensing_api") public static final String KEY_SYSTEM_WILL_CLOSE_AUDIO_STREAM_AFTER_CALLBACK = "android.service.voice.HotwordDetectionService.KEY_SYSTEM_WILL_CLOSE_AUDIO_STREAM_AFTER_CALLBACK"; field public static final String SERVICE_INTERFACE = "android.service.voice.HotwordDetectionService"; } public static final class HotwordDetectionService.Callback { method public void onDetected(@NonNull android.service.voice.HotwordDetectedResult); method public void onRejected(@NonNull android.service.voice.HotwordRejectedResult); - method @FlaggedApi("android.service.voice.flags.allow_training_data_egress_from_hds") public void onTrainingData(@NonNull android.service.voice.HotwordTrainingData); } public final class HotwordDetectionServiceFailure implements android.os.Parcelable { @@ -12858,8 +13544,6 @@ package android.service.voice { field public static final int ERROR_CODE_DETECT_TIMEOUT = 4; // 0x4 field public static final int ERROR_CODE_ON_DETECTED_SECURITY_EXCEPTION = 5; // 0x5 field public static final int ERROR_CODE_ON_DETECTED_STREAM_COPY_FAILURE = 6; // 0x6 - field @FlaggedApi("android.service.voice.flags.allow_training_data_egress_from_hds") public static final int ERROR_CODE_ON_TRAINING_DATA_EGRESS_LIMIT_EXCEEDED = 8; // 0x8 - field @FlaggedApi("android.service.voice.flags.allow_training_data_egress_from_hds") public static final int ERROR_CODE_ON_TRAINING_DATA_SECURITY_EXCEPTION = 9; // 0x9 field public static final int ERROR_CODE_REMOTE_EXCEPTION = 7; // 0x7 field @FlaggedApi("android.service.voice.flags.allow_training_data_egress_from_hds") public static final int ERROR_CODE_SHUTDOWN_HDS_ON_VOICE_ACTIVATION_OP_DISABLED = 10; // 0xa field public static final int ERROR_CODE_UNKNOWN = 0; // 0x0 @@ -12882,7 +13566,6 @@ package android.service.voice { method public void onRecognitionPaused(); method public void onRecognitionResumed(); method public void onRejected(@NonNull android.service.voice.HotwordRejectedResult); - method @FlaggedApi("android.service.voice.flags.allow_training_data_egress_from_hds") public default void onTrainingData(@NonNull android.service.voice.HotwordTrainingData); method public default void onUnknownFailure(@NonNull String); } @@ -12904,43 +13587,6 @@ package android.service.voice { method @NonNull public android.service.voice.HotwordRejectedResult.Builder setConfidenceLevel(int); } - @FlaggedApi("android.service.voice.flags.allow_training_data_egress_from_hds") public final class HotwordTrainingAudio implements android.os.Parcelable { - method public int describeContents(); - method @NonNull public android.media.AudioFormat getAudioFormat(); - method @NonNull public int getAudioType(); - method @NonNull public byte[] getHotwordAudio(); - method public int getHotwordOffsetMillis(); - method public void writeToParcel(@NonNull android.os.Parcel, int); - field @NonNull public static final android.os.Parcelable.Creator CREATOR; - field public static final int HOTWORD_OFFSET_UNSET = -1; // 0xffffffff - } - - @FlaggedApi("android.service.voice.flags.allow_training_data_egress_from_hds") public static final class HotwordTrainingAudio.Builder { - ctor public HotwordTrainingAudio.Builder(@NonNull byte[], @NonNull android.media.AudioFormat); - method @NonNull public android.service.voice.HotwordTrainingAudio build(); - method @NonNull public android.service.voice.HotwordTrainingAudio.Builder setAudioFormat(@NonNull android.media.AudioFormat); - method @NonNull public android.service.voice.HotwordTrainingAudio.Builder setAudioType(@NonNull int); - method @NonNull public android.service.voice.HotwordTrainingAudio.Builder setHotwordAudio(@NonNull byte[]); - method @NonNull public android.service.voice.HotwordTrainingAudio.Builder setHotwordOffsetMillis(int); - } - - @FlaggedApi("android.service.voice.flags.allow_training_data_egress_from_hds") public final class HotwordTrainingData implements android.os.Parcelable { - method public int describeContents(); - method public static int getMaxTrainingDataBytes(); - method public int getTimeoutStage(); - method @NonNull public java.util.List getTrainingAudioList(); - method public void writeToParcel(@NonNull android.os.Parcel, int); - field @NonNull public static final android.os.Parcelable.Creator CREATOR; - } - - @FlaggedApi("android.service.voice.flags.allow_training_data_egress_from_hds") public static final class HotwordTrainingData.Builder { - ctor public HotwordTrainingData.Builder(); - method @NonNull public android.service.voice.HotwordTrainingData.Builder addTrainingAudio(@NonNull android.service.voice.HotwordTrainingAudio); - method @NonNull public android.service.voice.HotwordTrainingData build(); - method @NonNull public android.service.voice.HotwordTrainingData.Builder setTimeoutStage(int); - method @NonNull public android.service.voice.HotwordTrainingData.Builder setTrainingAudioList(@NonNull java.util.List); - } - public interface SandboxedDetectionInitializer { method public static int getMaxCustomInitializationStatus(); method public void onUpdateState(@Nullable android.os.PersistableBundle, @Nullable android.os.SharedMemory, long, @Nullable java.util.function.IntConsumer); @@ -12961,17 +13607,55 @@ package android.service.voice { field public static final int ERROR_CODE_UNKNOWN = 0; // 0x0 } + @FlaggedApi("android.service.voice.flags.allow_various_attention_types") public final class VisualQueryAttentionResult implements android.os.Parcelable { + method public int describeContents(); + method @IntRange(from=1, to=100) public int getEngagementLevel(); + method public int getInteractionIntention(); + method public void writeToParcel(@NonNull android.os.Parcel, int); + field @NonNull public static final android.os.Parcelable.Creator CREATOR; + field public static final int INTERACTION_INTENTION_AUDIO_VISUAL = 0; // 0x0 + field public static final int INTERACTION_INTENTION_VISUAL_ACCESSIBILITY = 1; // 0x1 + } + + public static final class VisualQueryAttentionResult.Builder { + ctor public VisualQueryAttentionResult.Builder(); + method @NonNull public android.service.voice.VisualQueryAttentionResult build(); + method @NonNull public android.service.voice.VisualQueryAttentionResult.Builder setEngagementLevel(@IntRange(from=1, to=100) int); + method @NonNull public android.service.voice.VisualQueryAttentionResult.Builder setInteractionIntention(int); + } + + @FlaggedApi("android.service.voice.flags.allow_complex_results_egress_from_vqds") public final class VisualQueryDetectedResult implements android.os.Parcelable { + method public int describeContents(); + method @Nullable public byte[] getAccessibilityDetectionData(); + method public static int getMaxSpeakerId(); + method @NonNull public String getPartialQuery(); + method public int getSpeakerId(); + method public void writeToParcel(@NonNull android.os.Parcel, int); + field @NonNull public static final android.os.Parcelable.Creator CREATOR; + } + + public static final class VisualQueryDetectedResult.Builder { + ctor public VisualQueryDetectedResult.Builder(); + method @NonNull public android.service.voice.VisualQueryDetectedResult build(); + method @NonNull public android.service.voice.VisualQueryDetectedResult.Builder setAccessibilityDetectionData(@NonNull byte...); + method @NonNull public android.service.voice.VisualQueryDetectedResult.Builder setPartialQuery(@NonNull String); + method @NonNull public android.service.voice.VisualQueryDetectedResult.Builder setSpeakerId(int); + } + public abstract class VisualQueryDetectionService extends android.app.Service implements android.service.voice.SandboxedDetectionInitializer { ctor public VisualQueryDetectionService(); method public final void finishQuery() throws java.lang.IllegalStateException; method public final void gainedAttention(); + method @FlaggedApi("android.service.voice.flags.allow_various_attention_types") public final void gainedAttention(@NonNull android.service.voice.VisualQueryAttentionResult); method public final void lostAttention(); + method @FlaggedApi("android.service.voice.flags.allow_various_attention_types") public final void lostAttention(int); method @Nullable public android.os.IBinder onBind(@NonNull android.content.Intent); method public void onStartDetection(); method public void onStopDetection(); method public void onUpdateState(@Nullable android.os.PersistableBundle, @Nullable android.os.SharedMemory, long, @Nullable java.util.function.IntConsumer); method public final void rejectQuery() throws java.lang.IllegalStateException; method public final void streamQuery(@NonNull String) throws java.lang.IllegalStateException; + method @FlaggedApi("android.service.voice.flags.allow_complex_results_egress_from_vqds") public final void streamQuery(@NonNull android.service.voice.VisualQueryDetectedResult); field public static final String SERVICE_INTERFACE = "android.service.voice.VisualQueryDetectionService"; } @@ -12991,7 +13675,10 @@ package android.service.voice { } public class VisualQueryDetector { + method @FlaggedApi("android.service.voice.flags.allow_complex_results_egress_from_vqds") public void clearAccessibilityDetectionEnabledListener(); method public void destroy(); + method @FlaggedApi("android.service.voice.flags.allow_complex_results_egress_from_vqds") public boolean isAccessibilityDetectionEnabled(); + method @FlaggedApi("android.service.voice.flags.allow_complex_results_egress_from_vqds") public void setAccessibilityDetectionEnabledListener(@NonNull java.util.function.Consumer); method @RequiresPermission(allOf={android.Manifest.permission.CAMERA, android.Manifest.permission.RECORD_AUDIO}) public boolean startRecognition(); method @RequiresPermission(allOf={android.Manifest.permission.CAMERA, android.Manifest.permission.RECORD_AUDIO}) public boolean stopRecognition(); method public void updateState(@Nullable android.os.PersistableBundle, @Nullable android.os.SharedMemory); @@ -13000,6 +13687,7 @@ package android.service.voice { public static interface VisualQueryDetector.Callback { method public void onFailure(@NonNull android.service.voice.VisualQueryDetectionServiceFailure); method public void onQueryDetected(@NonNull String); + method @FlaggedApi("android.service.voice.flags.allow_complex_results_egress_from_vqds") public default void onQueryDetected(@NonNull android.service.voice.VisualQueryDetectedResult); method public void onQueryFinished(); method public void onQueryRejected(); method public void onUnknownFailure(@NonNull String); @@ -13014,9 +13702,8 @@ package android.service.voice { method @NonNull @RequiresPermission(android.Manifest.permission.MANAGE_HOTWORD_DETECTION) public final android.service.voice.AlwaysOnHotwordDetector createAlwaysOnHotwordDetector(@NonNull String, @NonNull java.util.Locale, @Nullable android.os.PersistableBundle, @Nullable android.os.SharedMemory, @NonNull java.util.concurrent.Executor, @NonNull android.service.voice.AlwaysOnHotwordDetector.Callback); method @Deprecated @NonNull @RequiresPermission(android.Manifest.permission.MANAGE_HOTWORD_DETECTION) public final android.service.voice.HotwordDetector createHotwordDetector(@Nullable android.os.PersistableBundle, @Nullable android.os.SharedMemory, @NonNull android.service.voice.HotwordDetector.Callback); method @NonNull @RequiresPermission(android.Manifest.permission.MANAGE_HOTWORD_DETECTION) public final android.service.voice.HotwordDetector createHotwordDetector(@Nullable android.os.PersistableBundle, @Nullable android.os.SharedMemory, @NonNull java.util.concurrent.Executor, @NonNull android.service.voice.HotwordDetector.Callback); - method @NonNull @RequiresPermission("android.permission.MANAGE_VOICE_KEYPHRASES") public final android.media.voice.KeyphraseModelManager createKeyphraseModelManager(); + method @NonNull @RequiresPermission(android.Manifest.permission.MANAGE_VOICE_KEYPHRASES) public final android.media.voice.KeyphraseModelManager createKeyphraseModelManager(); method @NonNull @RequiresPermission(android.Manifest.permission.MANAGE_HOTWORD_DETECTION) public final android.service.voice.VisualQueryDetector createVisualQueryDetector(@Nullable android.os.PersistableBundle, @Nullable android.os.SharedMemory, @NonNull java.util.concurrent.Executor, @NonNull android.service.voice.VisualQueryDetector.Callback); - method @FlaggedApi("android.service.voice.flags.allow_training_data_egress_from_hds") @RequiresPermission(android.Manifest.permission.MANAGE_HOTWORD_DETECTION) public void setShouldReceiveSandboxedTrainingData(boolean); } } @@ -13069,14 +13756,30 @@ package android.service.watchdog { package android.service.wearable { + @FlaggedApi("android.app.wearable.enable_data_request_observer_api") public interface WearableSensingDataRequester { + method public void requestData(@NonNull android.app.wearable.WearableSensingDataRequest, @NonNull java.util.function.Consumer); + field public static final int STATUS_OBSERVER_CANCELLED = 2; // 0x2 + field public static final int STATUS_SUCCESS = 1; // 0x1 + field public static final int STATUS_TOO_FREQUENT = 4; // 0x4 + field public static final int STATUS_TOO_LARGE = 3; // 0x3 + field public static final int STATUS_UNKNOWN = 0; // 0x0 + } + public abstract class WearableSensingService extends android.app.Service { ctor public WearableSensingService(); method @Nullable public final android.os.IBinder onBind(@NonNull android.content.Intent); method @BinderThread public abstract void onDataProvided(@NonNull android.os.PersistableBundle, @Nullable android.os.SharedMemory, @NonNull java.util.function.Consumer); + method @FlaggedApi("android.app.wearable.enable_data_request_observer_api") @BinderThread public void onDataRequestObserverRegistered(int, @NonNull String, @NonNull android.service.wearable.WearableSensingDataRequester, @NonNull java.util.function.Consumer); + method @FlaggedApi("android.app.wearable.enable_data_request_observer_api") @BinderThread public void onDataRequestObserverUnregistered(int, @NonNull String, @NonNull android.service.wearable.WearableSensingDataRequester, @NonNull java.util.function.Consumer); method @BinderThread public abstract void onDataStreamProvided(@NonNull android.os.ParcelFileDescriptor, @NonNull java.util.function.Consumer); method @BinderThread public abstract void onQueryServiceStatus(@NonNull java.util.Set, @NonNull String, @NonNull java.util.function.Consumer); + method @FlaggedApi("android.app.wearable.enable_provide_wearable_connection_api") @BinderThread public void onSecureConnectionProvided(@NonNull android.os.ParcelFileDescriptor, @NonNull java.util.function.Consumer); method @BinderThread public abstract void onStartDetection(@NonNull android.app.ambientcontext.AmbientContextEventRequest, @NonNull String, @NonNull java.util.function.Consumer, @NonNull java.util.function.Consumer); + method @FlaggedApi("android.app.wearable.enable_hotword_wearable_sensing_api") @BinderThread public void onStartHotwordRecognition(@NonNull java.util.function.Consumer, @NonNull java.util.function.Consumer); method public abstract void onStopDetection(@NonNull String); + method @FlaggedApi("android.app.wearable.enable_hotword_wearable_sensing_api") @BinderThread public void onStopHotwordAudioStream(); + method @FlaggedApi("android.app.wearable.enable_hotword_wearable_sensing_api") @BinderThread public void onStopHotwordRecognition(@NonNull java.util.function.Consumer); + method @FlaggedApi("android.app.wearable.enable_hotword_wearable_sensing_api") @BinderThread public void onValidatedByHotwordDetectionService(); field public static final String SERVICE_INTERFACE = "android.service.wearable.WearableSensingService"; } @@ -13204,6 +13907,7 @@ package android.telecom { public abstract class Connection extends android.telecom.Conferenceable { method @Deprecated public final android.telecom.AudioState getAudioState(); + method @FlaggedApi("com.android.server.telecom.flags.telecom_resolve_hidden_dependencies") public final int getCallDirection(); method @IntRange(from=0) public final long getConnectTimeMillis(); method public final long getConnectionStartElapsedRealtimeMillis(); method @Nullable public android.telecom.PhoneAccountHandle getPhoneAccountHandle(); @@ -13218,7 +13922,9 @@ package android.telecom { method public void setTelecomCallId(@NonNull String); field public static final int CAPABILITY_CONFERENCE_HAS_NO_CHILDREN = 2097152; // 0x200000 field public static final int CAPABILITY_SPEED_UP_MT_AUDIO = 262144; // 0x40000 + field @FlaggedApi("com.android.server.telecom.flags.telecom_resolve_hidden_dependencies") public static final String EVENT_CALL_QUALITY_REPORT = "android.telecom.event.CALL_QUALITY_REPORT"; field public static final String EVENT_DEVICE_TO_DEVICE_MESSAGE = "android.telecom.event.DEVICE_TO_DEVICE_MESSAGE"; + field @FlaggedApi("com.android.server.telecom.flags.telecom_resolve_hidden_dependencies") public static final String EXTRA_CALL_QUALITY_REPORT = "android.telecom.extra.CALL_QUALITY_REPORT"; field public static final String EXTRA_DEVICE_TO_DEVICE_MESSAGE_TYPE = "android.telecom.extra.DEVICE_TO_DEVICE_MESSAGE_TYPE"; field public static final String EXTRA_DEVICE_TO_DEVICE_MESSAGE_VALUE = "android.telecom.extra.DEVICE_TO_DEVICE_MESSAGE_VALUE"; field public static final String EXTRA_DISABLE_ADD_CALL = "android.telecom.extra.DISABLE_ADD_CALL"; @@ -13247,6 +13953,25 @@ package android.telecom { method public final void addExistingConnection(@NonNull android.telecom.PhoneAccountHandle, @NonNull android.telecom.Connection, @NonNull android.telecom.Conference); } + public final class DisconnectCause implements android.os.Parcelable { + method @FlaggedApi("com.android.server.telecom.flags.telecom_resolve_hidden_dependencies") @Nullable public android.telephony.ims.ImsReasonInfo getImsReasonInfo(); + method @FlaggedApi("com.android.server.telecom.flags.telecom_resolve_hidden_dependencies") public int getTelephonyDisconnectCause(); + method @FlaggedApi("com.android.server.telecom.flags.telecom_resolve_hidden_dependencies") public int getTelephonyPreciseDisconnectCause(); + } + + @FlaggedApi("com.android.server.telecom.flags.telecom_resolve_hidden_dependencies") public static final class DisconnectCause.Builder { + ctor public DisconnectCause.Builder(); + method @NonNull public android.telecom.DisconnectCause build(); + method @NonNull public android.telecom.DisconnectCause.Builder setCode(int); + method @NonNull public android.telecom.DisconnectCause.Builder setDescription(@Nullable CharSequence); + method @NonNull public android.telecom.DisconnectCause.Builder setImsReasonInfo(@Nullable android.telephony.ims.ImsReasonInfo); + method @NonNull public android.telecom.DisconnectCause.Builder setLabel(@Nullable CharSequence); + method @NonNull public android.telecom.DisconnectCause.Builder setReason(@NonNull String); + method @NonNull public android.telecom.DisconnectCause.Builder setTelephonyDisconnectCause(int); + method @NonNull public android.telecom.DisconnectCause.Builder setTelephonyPreciseDisconnectCause(int); + method @NonNull public android.telecom.DisconnectCause.Builder setTone(int); + } + public abstract class InCallService extends android.app.Service { method @Deprecated public android.telecom.Phone getPhone(); method @Deprecated public void onPhoneCreated(android.telecom.Phone); @@ -13383,6 +14108,7 @@ package android.telecom { field public static final int CAPABILITY_EMERGENCY_VIDEO_CALLING = 512; // 0x200 field public static final int CAPABILITY_MULTI_USER = 32; // 0x20 field public static final String EXTRA_PLAY_CALL_RECORDING_TONE = "android.telecom.extra.PLAY_CALL_RECORDING_TONE"; + field @FlaggedApi("com.android.server.telecom.flags.telecom_resolve_hidden_dependencies") public static final String EXTRA_SKIP_CALL_FILTERING = "android.telecom.extra.SKIP_CALL_FILTERING"; field public static final String EXTRA_SORT_ORDER = "android.telecom.extra.SORT_ORDER"; } @@ -13477,6 +14203,7 @@ package android.telecom { method public java.util.List getAllPhoneAccounts(); method public int getAllPhoneAccountsCount(); method @NonNull @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public java.util.List getCallCapablePhoneAccounts(boolean); + method @FlaggedApi("com.android.internal.telephony.flags.work_profile_api_split") @NonNull @RequiresPermission(allOf={android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE, android.Manifest.permission.INTERACT_ACROSS_PROFILES}) public java.util.List getCallCapablePhoneAccountsAcrossProfiles(boolean); method @RequiresPermission(anyOf={android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE, android.Manifest.permission.READ_PHONE_STATE}, conditional=true) public int getCallState(); method public android.telecom.PhoneAccountHandle getConnectionManager(); method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public int getCurrentTtyMode(); @@ -13485,6 +14212,8 @@ package android.telecom { method @Deprecated public java.util.List getPhoneAccountsForPackage(); method @RequiresPermission(anyOf={android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE, android.Manifest.permission.READ_PHONE_STATE}) public java.util.List getPhoneAccountsSupportingScheme(String); method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean isInEmergencyCall(); + method @FlaggedApi("com.android.server.telecom.flags.telecom_resolve_hidden_dependencies") @RequiresPermission(allOf={android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE, android.Manifest.permission.INTERACT_ACROSS_USERS}, conditional=true) public boolean isInSelfManagedCall(@NonNull String, @NonNull android.os.UserHandle); + method @FlaggedApi("com.android.server.telecom.flags.telecom_resolve_hidden_dependencies") @RequiresPermission(allOf={android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE, android.Manifest.permission.INTERACT_ACROSS_USERS}, conditional=true) public boolean isInSelfManagedCall(@NonNull String, boolean); method @RequiresPermission(anyOf={android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE, android.Manifest.permission.READ_PHONE_STATE}) public boolean isRinging(); method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setUserSelectedOutgoingPhoneAccount(@Nullable android.telecom.PhoneAccountHandle); field public static final String ACTION_CURRENT_TTY_MODE_CHANGED = "android.telecom.action.CURRENT_TTY_MODE_CHANGED"; @@ -13817,6 +14546,73 @@ package android.telephony { method @NonNull public android.telephony.DataThrottlingRequest.Builder setDataThrottlingAction(int); } + @FlaggedApi("com.android.internal.telephony.flags.use_oem_domain_selection_service") public abstract class DomainSelectionService extends android.app.Service { + ctor public DomainSelectionService(); + method @NonNull public java.util.concurrent.Executor getCreateExecutor(); + method public void onBarringInfoUpdated(int, int, @NonNull android.telephony.BarringInfo); + method @Nullable public final android.os.IBinder onBind(@Nullable android.content.Intent); + method public abstract void onDomainSelection(@NonNull android.telephony.DomainSelectionService.SelectionAttributes, @NonNull android.telephony.TransportSelectorCallback); + method public void onServiceStateUpdated(int, int, @NonNull android.telephony.ServiceState); + field public static final int SCAN_TYPE_FULL_SERVICE = 2; // 0x2 + field public static final int SCAN_TYPE_LIMITED_SERVICE = 1; // 0x1 + field public static final int SCAN_TYPE_NO_PREFERENCE = 0; // 0x0 + field public static final int SELECTOR_TYPE_CALLING = 1; // 0x1 + field public static final int SELECTOR_TYPE_SMS = 2; // 0x2 + } + + @FlaggedApi("com.android.internal.telephony.flags.use_oem_domain_selection_service") public static final class DomainSelectionService.SelectionAttributes implements android.os.Parcelable { + method public int describeContents(); + method @Nullable public android.net.Uri getAddress(); + method @Nullable public String getCallId(); + method public int getCsDisconnectCause(); + method @Nullable public android.telephony.EmergencyRegistrationResult getEmergencyRegistrationResult(); + method @Nullable public android.telephony.ims.ImsReasonInfo getPsDisconnectCause(); + method public int getSelectorType(); + method public int getSlotIndex(); + method public int getSubscriptionId(); + method public boolean isEmergency(); + method public boolean isExitedFromAirplaneMode(); + method public boolean isTestEmergencyNumber(); + method public boolean isVideoCall(); + method public void writeToParcel(@NonNull android.os.Parcel, int); + field @NonNull public static final android.os.Parcelable.Creator CREATOR; + } + + @FlaggedApi("com.android.internal.telephony.flags.use_oem_domain_selection_service") public static final class DomainSelectionService.SelectionAttributes.Builder { + ctor public DomainSelectionService.SelectionAttributes.Builder(int, int, int); + method @NonNull public android.telephony.DomainSelectionService.SelectionAttributes build(); + method @NonNull public android.telephony.DomainSelectionService.SelectionAttributes.Builder setAddress(@Nullable android.net.Uri); + method @NonNull public android.telephony.DomainSelectionService.SelectionAttributes.Builder setCallId(@Nullable String); + method @NonNull public android.telephony.DomainSelectionService.SelectionAttributes.Builder setCsDisconnectCause(int); + method @NonNull public android.telephony.DomainSelectionService.SelectionAttributes.Builder setEmergency(boolean); + method @NonNull public android.telephony.DomainSelectionService.SelectionAttributes.Builder setEmergencyRegistrationResult(@Nullable android.telephony.EmergencyRegistrationResult); + method @NonNull public android.telephony.DomainSelectionService.SelectionAttributes.Builder setExitedFromAirplaneMode(boolean); + method @NonNull public android.telephony.DomainSelectionService.SelectionAttributes.Builder setPsDisconnectCause(@Nullable android.telephony.ims.ImsReasonInfo); + method @NonNull public android.telephony.DomainSelectionService.SelectionAttributes.Builder setTestEmergencyNumber(boolean); + method @NonNull public android.telephony.DomainSelectionService.SelectionAttributes.Builder setVideoCall(boolean); + } + + @FlaggedApi("com.android.internal.telephony.flags.use_oem_domain_selection_service") public interface DomainSelector { + method public void finishSelection(); + method public void reselectDomain(@NonNull android.telephony.DomainSelectionService.SelectionAttributes); + } + + @FlaggedApi("com.android.internal.telephony.flags.use_oem_domain_selection_service") public final class EmergencyRegistrationResult implements android.os.Parcelable { + method public int describeContents(); + method public int getAccessNetwork(); + method @NonNull public String getCountryIso(); + method public int getDomain(); + method @NonNull public String getMcc(); + method @NonNull public String getMnc(); + method public int getNwProvidedEmc(); + method public int getNwProvidedEmf(); + method public int getRegState(); + method public boolean isEmcBearerSupported(); + method public boolean isVopsSupported(); + method public void writeToParcel(@NonNull android.os.Parcel, int); + field @NonNull public static final android.os.Parcelable.Creator CREATOR; + } + public final class ImsiEncryptionInfo implements android.os.Parcelable { method public int describeContents(); method @Nullable public String getKeyIdentifier(); @@ -13890,7 +14686,6 @@ package android.telephony { method @Nullable public android.telephony.DataSpecificRegistrationInfo getDataSpecificInfo(); method public int getNetworkRegistrationState(); method @Deprecated public int getRegistrationState(); - method public int getRejectCause(); method public int getRoamingType(); method public boolean isEmergencyEnabled(); method public void writeToParcel(android.os.Parcel, int); @@ -14088,6 +14883,8 @@ package android.telephony { field public static final int CHANNEL_UNACCEPTABLE = 6; // 0x6 field public static final int CONDITIONAL_IE_ERROR = 100; // 0x64 field public static final int DESTINATION_OUT_OF_ORDER = 27; // 0x1b + field @FlaggedApi("com.android.internal.telephony.flags.use_oem_domain_selection_service") public static final int EMERGENCY_PERM_FAILURE = 326; // 0x146 + field @FlaggedApi("com.android.internal.telephony.flags.use_oem_domain_selection_service") public static final int EMERGENCY_TEMP_FAILURE = 325; // 0x145 field public static final int ERROR_UNSPECIFIED = 65535; // 0xffff field public static final int FACILITY_REJECTED = 29; // 0x1d field public static final int FDN_BLOCKED = 241; // 0xf1 @@ -14326,6 +15123,7 @@ package android.telephony { method public boolean areUiccApplicationsEnabled(); method @Nullable public java.util.List getAccessRules(); method public int getProfileClass(); + method @FlaggedApi("com.android.internal.telephony.flags.support_psim_to_esim_conversion") public int getTransferStatus(); method public boolean isGroupDisabled(); } @@ -14335,7 +15133,7 @@ package android.telephony { method @NonNull @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public int[] getActiveSubscriptionIdList(); method @Nullable @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public android.telephony.SubscriptionInfo getActiveSubscriptionInfoForIcc(@NonNull String); method @NonNull @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public byte[] getAllSimSpecificSettingsForBackup(); - method public java.util.List getAvailableSubscriptionInfoList(); + method @Nullable public java.util.List getAvailableSubscriptionInfoList(); method @NonNull @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public int[] getCompleteActiveSubscriptionIdList(); method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public int getEnabledSubscriptionId(int); method @NonNull public static android.content.res.Resources getResourcesForSubId(@NonNull android.content.Context, int); @@ -14348,6 +15146,7 @@ package android.telephony { method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setDefaultVoiceSubscriptionId(int); method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setPreferredDataSubscriptionId(int, boolean, @Nullable java.util.concurrent.Executor, @Nullable java.util.function.Consumer); method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean setSubscriptionEnabled(int, boolean); + method @FlaggedApi("com.android.internal.telephony.flags.support_psim_to_esim_conversion") @RequiresPermission(android.Manifest.permission.WRITE_EMBEDDED_SUBSCRIPTIONS) public void setTransferStatus(int, int); method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setUiccApplicationsEnabled(int, boolean); field @RequiresPermission(android.Manifest.permission.MANAGE_SUBSCRIPTION_PLANS) public static final String ACTION_SUBSCRIPTION_PLANS_CHANGED = "android.telephony.action.SUBSCRIPTION_PLANS_CHANGED"; field @NonNull public static final android.net.Uri ADVANCED_CALLING_ENABLED_CONTENT_URI; @@ -14357,6 +15156,9 @@ package android.telephony { field public static final int PROFILE_CLASS_PROVISIONING = 1; // 0x1 field public static final int PROFILE_CLASS_TESTING = 0; // 0x0 field public static final int PROFILE_CLASS_UNSET = -1; // 0xffffffff + field @FlaggedApi("com.android.internal.telephony.flags.support_psim_to_esim_conversion") public static final int TRANSFER_STATUS_CONVERTED = 2; // 0x2 + field @FlaggedApi("com.android.internal.telephony.flags.support_psim_to_esim_conversion") public static final int TRANSFER_STATUS_NONE = 0; // 0x0 + field @FlaggedApi("com.android.internal.telephony.flags.support_psim_to_esim_conversion") public static final int TRANSFER_STATUS_TRANSFERRED_OUT = 1; // 0x1 field @NonNull public static final android.net.Uri VT_ENABLED_CONTENT_URI; field @NonNull public static final android.net.Uri WFC_ENABLED_CONTENT_URI; field @NonNull public static final android.net.Uri WFC_MODE_CONTENT_URI; @@ -14406,6 +15208,7 @@ package android.telephony { field public static final int EVENT_SERVICE_STATE_CHANGED = 1; // 0x1 field public static final int EVENT_SIGNAL_STRENGTHS_CHANGED = 9; // 0x9 field public static final int EVENT_SIGNAL_STRENGTH_CHANGED = 2; // 0x2 + field @FlaggedApi("com.android.internal.telephony.flags.simultaneous_calling_indications") @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public static final int EVENT_SIMULTANEOUS_CELLULAR_CALLING_SUBSCRIPTIONS_CHANGED = 41; // 0x29 field @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public static final int EVENT_SRVCC_STATE_CHANGED = 16; // 0x10 field public static final int EVENT_USER_MOBILE_DATA_STATE_CHANGED = 20; // 0x14 field @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public static final int EVENT_VOICE_ACTIVATION_STATE_CHANGED = 18; // 0x12 @@ -14452,6 +15255,10 @@ package android.telephony { method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public void onRadioPowerStateChanged(int); } + @FlaggedApi("com.android.internal.telephony.flags.simultaneous_calling_indications") public static interface TelephonyCallback.SimultaneousCellularCallingSupportListener { + method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public void onSimultaneousCellularCallingSubscriptionsChanged(@NonNull java.util.Set); + } + public static interface TelephonyCallback.SrvccStateListener { method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public void onSrvccStateChanged(int); } @@ -14489,7 +15296,6 @@ package android.telephony { method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void clearRadioPowerOffForReason(int); method public void dial(String); method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean disableDataConnectivity(); - method @FlaggedApi("com.android.internal.telephony.flags.enable_identifier_disclosure_transparency") @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void enableCellularIdentifierDisclosureNotifications(boolean); method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean enableDataConnectivity(); method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean enableModemForSlot(int, boolean); method @Deprecated @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void enableVideoCalling(boolean); @@ -14524,10 +15330,12 @@ package android.telephony { method @Deprecated public boolean getDataEnabled(int); method @Nullable @RequiresPermission(android.Manifest.permission.INTERACT_ACROSS_USERS) public android.content.ComponentName getDefaultRespondViaMessageApplication(); method @Nullable @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public String getDeviceSoftwareVersion(int); + method @FlaggedApi("android.permission.flags.get_emergency_role_holder_api_enabled") @NonNull @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public String getEmergencyAssistancePackageName(); method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean getEmergencyCallbackMode(); method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public int getEmergencyNumberDbVersion(); method @Nullable @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public String getIsimDomain(); method @Nullable @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public String getIsimIst(); + method @FlaggedApi("com.android.server.telecom.flags.get_last_known_cell_identity") @Nullable @RequiresPermission(allOf={android.Manifest.permission.ACCESS_FINE_LOCATION, android.Manifest.permission.ACCESS_LAST_KNOWN_CELL_ID}) public android.telephony.CellIdentity getLastKnownCellIdentity(); method @Deprecated @NonNull @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public java.util.Map getLogicalToPhysicalSlotMapping(); method public int getMaxNumberOfSimultaneouslyActiveSims(); method public static long getMaxNumberVerificationTimeoutMillis(); @@ -14562,9 +15370,10 @@ package android.telephony { method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isAnyRadioPoweredOn(); method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isApnMetered(int); method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isApplicationOnUicc(int); - method @FlaggedApi("com.android.internal.telephony.flags.enable_identifier_disclosure_transparency") @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isCellularIdentifierDisclosureNotificationEnabled(); + method @FlaggedApi("com.android.internal.telephony.flags.enable_identifier_disclosure_transparency") @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isCellularIdentifierDisclosureNotificationsEnabled(); method public boolean isDataConnectivityPossible(); method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isDataEnabledForApn(int); + method @FlaggedApi("com.android.internal.telephony.flags.use_oem_domain_selection_service") @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isDomainSelectionSupported(); method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isEmergencyAssistanceEnabled(); method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) @WorkerThread public boolean isIccLockEnabled(); method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE, android.Manifest.permission.READ_PHONE_STATE}) public boolean isIdle(); @@ -14572,6 +15381,7 @@ package android.telephony { method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isLteCdmaEvdoGsmWcdmaEnabled(); method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isMobileDataPolicyEnabled(int); method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isNrDualConnectivityEnabled(); + method @FlaggedApi("com.android.internal.telephony.flags.enable_modem_cipher_transparency") @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isNullCipherNotificationsEnabled(); method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE, android.Manifest.permission.READ_PHONE_STATE}) public boolean isOffhook(); method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isOpportunisticNetworkEnabled(); method @Deprecated @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isPotentialEmergencyNumber(@NonNull String); @@ -14583,6 +15393,7 @@ package android.telephony { method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean matchesCurrentSimOperator(@NonNull String, int, @Nullable String); method public boolean needsOtaServiceProvisioning(); method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void notifyOtaEmergencyNumberDbInstalled(); + method @FlaggedApi("com.android.server.telecom.flags.telecom_resolve_hidden_dependencies") @RequiresPermission(android.Manifest.permission.DUMP) public void persistEmergencyCallDiagnosticData(@NonNull String, @NonNull android.telephony.TelephonyManager.EmergencyCallDiagnosticData); method @RequiresPermission(android.Manifest.permission.REBOOT) public int prepareForUnattendedReboot(); method @Deprecated @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean rebootRadio(); method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public void registerCarrierPrivilegesCallback(int, @NonNull java.util.concurrent.Executor, @NonNull android.telephony.TelephonyManager.CarrierPrivilegesCallback); @@ -14610,10 +15421,12 @@ package android.telephony { method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setDataActivationState(int); method @Deprecated @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setDataEnabled(int, boolean); method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setDataRoamingEnabled(boolean); + method @FlaggedApi("com.android.internal.telephony.flags.enable_identifier_disclosure_transparency") @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setEnableCellularIdentifierDisclosureNotifications(boolean); method @NonNull @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public android.telephony.PinResult setIccLockEnabled(boolean, @NonNull String); method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setMobileDataPolicyEnabled(int, boolean); method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setMultiSimCarrierRestriction(boolean); method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public int setNrDualConnectivityState(int); + method @FlaggedApi("com.android.internal.telephony.flags.enable_modem_cipher_transparency") @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setNullCipherNotificationsEnabled(boolean); method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean setOpportunisticNetworkState(boolean); method @Deprecated @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean setPreferredNetworkTypeBitmask(long); method @Deprecated @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public boolean setRadio(boolean); @@ -14628,6 +15441,7 @@ package android.telephony { method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setSystemSelectionChannels(@NonNull java.util.List); method @Deprecated public void setVisualVoicemailEnabled(android.telecom.PhoneAccountHandle, boolean); method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setVoiceActivationState(int); + method @FlaggedApi("com.android.server.telecom.flags.telecom_resolve_hidden_dependencies") @RequiresPermission(android.Manifest.permission.BIND_TELECOM_CONNECTION_SERVICE) public void setVoiceServiceStateOverride(boolean); method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void shutdownAllRadios(); method @NonNull @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public android.telephony.PinResult supplyIccLockPin(@NonNull String); method @NonNull @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public android.telephony.PinResult supplyIccLockPuk(@NonNull String, @NonNull String); @@ -14758,6 +15572,21 @@ package android.telephony { method public default void onCarrierServiceChanged(@Nullable String, int); } + @FlaggedApi("com.android.server.telecom.flags.telecom_resolve_hidden_dependencies") public static final class TelephonyManager.EmergencyCallDiagnosticData { + method public long getLogcatCollectionStartTimeMillis(); + method public boolean isLogcatCollectionEnabled(); + method public boolean isTelecomDumpsysCollectionEnabled(); + method public boolean isTelephonyDumpsysCollectionEnabled(); + } + + public static final class TelephonyManager.EmergencyCallDiagnosticData.Builder { + ctor public TelephonyManager.EmergencyCallDiagnosticData.Builder(); + method @NonNull public android.telephony.TelephonyManager.EmergencyCallDiagnosticData build(); + method @NonNull public android.telephony.TelephonyManager.EmergencyCallDiagnosticData.Builder setLogcatCollectionStartTimeMillis(long); + method @NonNull public android.telephony.TelephonyManager.EmergencyCallDiagnosticData.Builder setTelecomDumpsysCollectionEnabled(boolean); + method @NonNull public android.telephony.TelephonyManager.EmergencyCallDiagnosticData.Builder setTelephonyDumpsysCollectionEnabled(boolean); + } + public static class TelephonyManager.ModemActivityInfoException extends java.lang.Exception { ctor public TelephonyManager.ModemActivityInfoException(int); method public int getErrorCode(); @@ -14767,6 +15596,11 @@ package android.telephony { field public static final int ERROR_UNKNOWN = 0; // 0x0 } + @FlaggedApi("com.android.server.telecom.flags.telecom_resolve_hidden_dependencies") public class TelephonyRegistryManager { + method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void notifyCallStateChangedForAllSubscriptions(int, @Nullable String); + method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void notifyOutgoingEmergencyCall(int, int, @NonNull android.telephony.emergency.EmergencyNumber); + } + public final class ThermalMitigationRequest implements android.os.Parcelable { method public int describeContents(); method @Nullable public android.telephony.DataThrottlingRequest getDataThrottlingRequest(); @@ -14785,6 +15619,13 @@ package android.telephony { method @NonNull public android.telephony.ThermalMitigationRequest.Builder setThermalMitigationAction(int); } + @FlaggedApi("com.android.internal.telephony.flags.use_oem_domain_selection_service") public interface TransportSelectorCallback { + method public void onCreated(@NonNull android.telephony.DomainSelector); + method public void onSelectionTerminated(int); + method public void onWlanSelected(boolean); + method public void onWwanSelected(@NonNull java.util.function.Consumer); + } + public final class UiccAccessRule implements android.os.Parcelable { ctor public UiccAccessRule(byte[], @Nullable String, long); method public int describeContents(); @@ -14840,6 +15681,11 @@ package android.telephony { field @NonNull public static final android.os.Parcelable.Creator CREATOR; } + @FlaggedApi("com.android.internal.telephony.flags.use_oem_domain_selection_service") public interface WwanSelectorCallback { + method public void onDomainSelected(int, boolean); + method public void onRequestEmergencyNetworkScan(@NonNull java.util.List, int, boolean, @NonNull android.os.CancellationSignal, @NonNull java.util.function.Consumer); + } + } package android.telephony.cdma { @@ -15017,7 +15863,7 @@ package android.telephony.data { method public final void notifyDataCallListChanged(java.util.List); method public final void notifyDataProfileUnthrottled(@NonNull android.telephony.data.DataProfile); method public void requestDataCallList(@NonNull android.telephony.data.DataServiceCallback); - method @FlaggedApi("com.android.internal.telephony.flags.network_validation") public void requestValidation(int, @NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer); + method @FlaggedApi("com.android.internal.telephony.flags.network_validation") public void requestNetworkValidation(int, @NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer); method public void setDataProfile(@NonNull java.util.List, boolean, @NonNull android.telephony.data.DataServiceCallback); method public void setInitialAttachApn(@NonNull android.telephony.data.DataProfile, boolean, @NonNull android.telephony.data.DataServiceCallback); method public void setupDataCall(int, @NonNull android.telephony.data.DataProfile, boolean, boolean, int, @Nullable android.net.LinkProperties, @NonNull android.telephony.data.DataServiceCallback); @@ -15179,7 +16025,9 @@ package android.telephony.euicc { method @RequiresPermission(android.Manifest.permission.WRITE_EMBEDDED_SUBSCRIPTIONS) public int getOtaStatus(); method @NonNull @RequiresPermission(android.Manifest.permission.WRITE_EMBEDDED_SUBSCRIPTIONS) public java.util.List getSupportedCountries(); method @NonNull @RequiresPermission(android.Manifest.permission.WRITE_EMBEDDED_SUBSCRIPTIONS) public java.util.List getUnsupportedCountries(); + method @FlaggedApi("com.android.internal.telephony.flags.support_psim_to_esim_conversion") @RequiresPermission(android.Manifest.permission.WRITE_EMBEDDED_SUBSCRIPTIONS) public boolean isPsimConversionSupported(int); method @RequiresPermission(android.Manifest.permission.WRITE_EMBEDDED_SUBSCRIPTIONS) public boolean isSupportedCountry(@NonNull String); + method @FlaggedApi("com.android.internal.telephony.flags.support_psim_to_esim_conversion") @RequiresPermission(android.Manifest.permission.WRITE_EMBEDDED_SUBSCRIPTIONS) public void setPsimConversionSupportedCarriers(@NonNull java.util.Set); method @RequiresPermission(android.Manifest.permission.WRITE_EMBEDDED_SUBSCRIPTIONS) public void setSupportedCountries(@NonNull java.util.List); method @RequiresPermission(android.Manifest.permission.WRITE_EMBEDDED_SUBSCRIPTIONS) public void setUnsupportedCountries(@NonNull java.util.List); field @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public static final String ACTION_CONVERT_TO_EMBEDDED_SUBSCRIPTION = "android.telephony.euicc.action.CONVERT_TO_EMBEDDED_SUBSCRIPTION"; @@ -15541,6 +16389,7 @@ package android.telephony.ims { field public static final int DIALSTRING_USSD = 2; // 0x2 field public static final String EXTRA_ADDITIONAL_CALL_INFO = "AdditionalCallInfo"; field public static final String EXTRA_ADDITIONAL_SIP_INVITE_FIELDS = "android.telephony.ims.extra.ADDITIONAL_SIP_INVITE_FIELDS"; + field @FlaggedApi("com.android.server.telecom.flags.business_call_composer") public static final String EXTRA_ASSERTED_DISPLAY_NAME = "android.telephony.ims.extra.ASSERTED_DISPLAY_NAME"; field public static final String EXTRA_CALL_DISCONNECT_CAUSE = "android.telephony.ims.extra.CALL_DISCONNECT_CAUSE"; field public static final String EXTRA_CALL_NETWORK_TYPE = "android.telephony.ims.extra.CALL_NETWORK_TYPE"; field @Deprecated public static final String EXTRA_CALL_RAT_TYPE = "CallRadioTech"; @@ -15686,6 +16535,7 @@ package android.telephony.ims { method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isAvailable(int, int); method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isCapable(int, int); method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public void isSupported(int, int, @NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer) throws android.telephony.ims.ImsException; + method @FlaggedApi("com.android.internal.telephony.flags.emergency_registration_state") public void registerImsEmergencyRegistrationCallback(@NonNull java.util.concurrent.Executor, @NonNull android.telephony.ims.RegistrationManager.RegistrationCallback) throws android.telephony.ims.ImsException; method @Deprecated @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public void registerImsRegistrationCallback(@NonNull java.util.concurrent.Executor, @NonNull android.telephony.ims.ImsMmTelManager.RegistrationCallback) throws android.telephony.ims.ImsException; method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setAdvancedCallingSettingEnabled(boolean); method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setCrossSimCallingEnabled(boolean) throws android.telephony.ims.ImsException; @@ -15696,6 +16546,7 @@ package android.telephony.ims { method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setVoWiFiRoamingSettingEnabled(boolean); method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setVoWiFiSettingEnabled(boolean); method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void setVtSettingEnabled(boolean); + method @FlaggedApi("com.android.internal.telephony.flags.emergency_registration_state") public void unregisterImsEmergencyRegistrationCallback(@NonNull android.telephony.ims.RegistrationManager.RegistrationCallback); method @Deprecated @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public void unregisterImsRegistrationCallback(@NonNull android.telephony.ims.ImsMmTelManager.RegistrationCallback); } @@ -15728,6 +16579,8 @@ package android.telephony.ims { ctor public ImsRegistrationAttributes.Builder(int); method @NonNull public android.telephony.ims.ImsRegistrationAttributes build(); method @NonNull public android.telephony.ims.ImsRegistrationAttributes.Builder setFeatureTags(@NonNull java.util.Set); + method @FlaggedApi("com.android.internal.telephony.flags.emergency_registration_state") @NonNull public android.telephony.ims.ImsRegistrationAttributes.Builder setFlagRegistrationTypeEmergency(); + method @FlaggedApi("com.android.internal.telephony.flags.emergency_registration_state") @NonNull public android.telephony.ims.ImsRegistrationAttributes.Builder setFlagVirtualRegistrationForEmergencyCall(); method @NonNull public android.telephony.ims.ImsRegistrationAttributes.Builder setSipDetails(@NonNull android.telephony.ims.SipDetails); } @@ -16220,7 +17073,7 @@ package android.telephony.ims { public interface RegistrationManager { field public static final int SUGGESTED_ACTION_NONE = 0; // 0x0 - field @FlaggedApi("com.android.internal.telephony.flags.add_rat_related_suggested_action_to_ims_registration") public static final int SUGGESTED_ACTION_TRIGGER_CLEAR_RAT_BLOCK = 4; // 0x4 + field @FlaggedApi("com.android.internal.telephony.flags.add_rat_related_suggested_action_to_ims_registration") public static final int SUGGESTED_ACTION_TRIGGER_CLEAR_RAT_BLOCKS = 4; // 0x4 field public static final int SUGGESTED_ACTION_TRIGGER_PLMN_BLOCK = 1; // 0x1 field public static final int SUGGESTED_ACTION_TRIGGER_PLMN_BLOCK_WITH_TIMEOUT = 2; // 0x2 field @FlaggedApi("com.android.internal.telephony.flags.add_rat_related_suggested_action_to_ims_registration") public static final int SUGGESTED_ACTION_TRIGGER_RAT_BLOCK = 3; // 0x3 @@ -16654,6 +17507,7 @@ package android.telephony.ims.stub { ctor public ImsRegistrationImplBase(@NonNull java.util.concurrent.Executor); method public final void onDeregistered(android.telephony.ims.ImsReasonInfo); method public final void onDeregistered(@Nullable android.telephony.ims.ImsReasonInfo, int, int); + method @FlaggedApi("com.android.internal.telephony.flags.emergency_registration_state") public final void onDeregistered(@Nullable android.telephony.ims.ImsReasonInfo, int, @NonNull android.telephony.ims.ImsRegistrationAttributes); method public final void onDeregistered(@Nullable android.telephony.ims.ImsReasonInfo, @NonNull android.telephony.ims.SipDetails); method public final void onDeregistered(@Nullable android.telephony.ims.ImsReasonInfo, int, int, @NonNull android.telephony.ims.SipDetails); method public final void onRegistered(int); @@ -16662,6 +17516,7 @@ package android.telephony.ims.stub { method public final void onRegistering(@NonNull android.telephony.ims.ImsRegistrationAttributes); method public final void onSubscriberAssociatedUriChanged(android.net.Uri[]); method public final void onTechnologyChangeFailed(int, android.telephony.ims.ImsReasonInfo); + method @FlaggedApi("com.android.internal.telephony.flags.emergency_registration_state") public final void onTechnologyChangeFailed(@Nullable android.telephony.ims.ImsReasonInfo, @NonNull android.telephony.ims.ImsRegistrationAttributes); method public void triggerFullNetworkRegistration(@IntRange(from=100, to=699) int, @Nullable String); method public void triggerSipDelegateDeregistration(); method public void updateSipDelegateRegistration(); @@ -16897,6 +17752,19 @@ package android.telephony.satellite { field @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") @NonNull public static final android.os.Parcelable.Creator CREATOR; } + @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") public class EnableRequestAttributes { + method @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") public boolean isDemoMode(); + method @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") public boolean isEmergencyMode(); + method @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") public boolean isEnabled(); + } + + @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") public static final class EnableRequestAttributes.Builder { + ctor @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") public EnableRequestAttributes.Builder(boolean); + method @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") @NonNull public android.telephony.satellite.EnableRequestAttributes build(); + method @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") @NonNull public android.telephony.satellite.EnableRequestAttributes.Builder setDemoMode(boolean); + method @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") @NonNull public android.telephony.satellite.EnableRequestAttributes.Builder setEmergencyMode(boolean); + } + @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") public final class NtnSignalStrength implements android.os.Parcelable { ctor @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") public NtnSignalStrength(@Nullable android.telephony.satellite.NtnSignalStrength); method @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") public int describeContents(); @@ -16916,8 +17784,8 @@ package android.telephony.satellite { @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") public final class PointingInfo implements android.os.Parcelable { method @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") public int describeContents(); - method @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") public float getSatelliteAzimuthDegrees(); - method @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") public float getSatelliteElevationDegrees(); + method @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") @FloatRange(from=0xffffff4c, to=180) public float getSatelliteAzimuthDegrees(); + method @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") @FloatRange(from=0xffffffa6, to=90) public float getSatelliteElevationDegrees(); method @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") public void writeToParcel(@NonNull android.os.Parcel, int); field @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") @NonNull public static final android.os.Parcelable.Creator CREATOR; } @@ -16948,37 +17816,39 @@ package android.telephony.satellite { } @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") public final class SatelliteManager { - method @FlaggedApi("com.android.internal.telephony.flags.carrier_enabled_satellite_flag") @RequiresPermission(android.Manifest.permission.SATELLITE_COMMUNICATION) public void addSatelliteAttachRestrictionForCarrier(int, int, @NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer); - method @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") @RequiresPermission(android.Manifest.permission.SATELLITE_COMMUNICATION) public void deprovisionSatelliteService(@NonNull String, @NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer); - method @FlaggedApi("com.android.internal.telephony.flags.carrier_enabled_satellite_flag") @NonNull @RequiresPermission(android.Manifest.permission.SATELLITE_COMMUNICATION) public java.util.Set getSatelliteAttachRestrictionReasonsForCarrier(int); - method @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") @RequiresPermission(android.Manifest.permission.SATELLITE_COMMUNICATION) public void pollPendingSatelliteDatagrams(@NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer); - method @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") @RequiresPermission(android.Manifest.permission.SATELLITE_COMMUNICATION) public void provisionSatelliteService(@NonNull String, @NonNull byte[], @Nullable android.os.CancellationSignal, @NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer); - method @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") @RequiresPermission(android.Manifest.permission.SATELLITE_COMMUNICATION) public void registerForNtnSignalStrengthChanged(@NonNull java.util.concurrent.Executor, @NonNull android.telephony.satellite.NtnSignalStrengthCallback) throws android.telephony.satellite.SatelliteManager.SatelliteException; - method @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") @RequiresPermission(android.Manifest.permission.SATELLITE_COMMUNICATION) public int registerForSatelliteCapabilitiesChanged(@NonNull java.util.concurrent.Executor, @NonNull android.telephony.satellite.SatelliteCapabilitiesCallback); - method @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") @RequiresPermission(android.Manifest.permission.SATELLITE_COMMUNICATION) public int registerForSatelliteDatagram(@NonNull java.util.concurrent.Executor, @NonNull android.telephony.satellite.SatelliteDatagramCallback); - method @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") @RequiresPermission(android.Manifest.permission.SATELLITE_COMMUNICATION) public int registerForSatelliteModemStateChanged(@NonNull java.util.concurrent.Executor, @NonNull android.telephony.satellite.SatelliteStateCallback); - method @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") @RequiresPermission(android.Manifest.permission.SATELLITE_COMMUNICATION) public int registerForSatelliteProvisionStateChanged(@NonNull java.util.concurrent.Executor, @NonNull android.telephony.satellite.SatelliteProvisionStateCallback); - method @FlaggedApi("com.android.internal.telephony.flags.carrier_enabled_satellite_flag") @RequiresPermission(android.Manifest.permission.SATELLITE_COMMUNICATION) public void removeSatelliteAttachRestrictionForCarrier(int, int, @NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer); + method @FlaggedApi("com.android.internal.telephony.flags.carrier_enabled_satellite_flag") @RequiresPermission(android.Manifest.permission.SATELLITE_COMMUNICATION) public void addAttachRestrictionForCarrier(int, int, @NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer); + method @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") @RequiresPermission(android.Manifest.permission.SATELLITE_COMMUNICATION) public void deprovisionService(@NonNull String, @NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer); + method @FlaggedApi("com.android.internal.telephony.flags.carrier_enabled_satellite_flag") @NonNull @RequiresPermission(android.Manifest.permission.SATELLITE_COMMUNICATION) public java.util.Set getAttachRestrictionReasonsForCarrier(int); + method @FlaggedApi("com.android.internal.telephony.flags.carrier_enabled_satellite_flag") @NonNull @RequiresPermission(android.Manifest.permission.SATELLITE_COMMUNICATION) public java.util.List getSatellitePlmnsForCarrier(int); + method @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") @RequiresPermission(android.Manifest.permission.SATELLITE_COMMUNICATION) public void pollPendingDatagrams(@NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer); + method @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") @RequiresPermission(android.Manifest.permission.SATELLITE_COMMUNICATION) public void provisionService(@NonNull String, @NonNull byte[], @Nullable android.os.CancellationSignal, @NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer); + method @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") @RequiresPermission(android.Manifest.permission.SATELLITE_COMMUNICATION) public int registerForCapabilitiesChanged(@NonNull java.util.concurrent.Executor, @NonNull android.telephony.satellite.SatelliteCapabilitiesCallback); + method @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") @RequiresPermission(android.Manifest.permission.SATELLITE_COMMUNICATION) public int registerForIncomingDatagram(@NonNull java.util.concurrent.Executor, @NonNull android.telephony.satellite.SatelliteDatagramCallback); + method @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") @RequiresPermission(android.Manifest.permission.SATELLITE_COMMUNICATION) public int registerForModemStateChanged(@NonNull java.util.concurrent.Executor, @NonNull android.telephony.satellite.SatelliteModemStateCallback); + method @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") @RequiresPermission(android.Manifest.permission.SATELLITE_COMMUNICATION) public void registerForNtnSignalStrengthChanged(@NonNull java.util.concurrent.Executor, @NonNull android.telephony.satellite.NtnSignalStrengthCallback); + method @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") @RequiresPermission(android.Manifest.permission.SATELLITE_COMMUNICATION) public int registerForProvisionStateChanged(@NonNull java.util.concurrent.Executor, @NonNull android.telephony.satellite.SatelliteProvisionStateCallback); + method @FlaggedApi("com.android.internal.telephony.flags.carrier_enabled_satellite_flag") @RequiresPermission(android.Manifest.permission.SATELLITE_COMMUNICATION) public void removeAttachRestrictionForCarrier(int, int, @NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer); + method @FlaggedApi("com.android.internal.telephony.flags.carrier_enabled_satellite_flag") @RequiresPermission(android.Manifest.permission.SATELLITE_COMMUNICATION) public void requestAttachEnabledForCarrier(int, boolean, @NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer); + method @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") @RequiresPermission(android.Manifest.permission.SATELLITE_COMMUNICATION) public void requestCapabilities(@NonNull java.util.concurrent.Executor, @NonNull android.os.OutcomeReceiver); + method @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") @RequiresPermission(android.Manifest.permission.SATELLITE_COMMUNICATION) public void requestEnabled(@NonNull android.telephony.satellite.EnableRequestAttributes, @NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer); + method @FlaggedApi("com.android.internal.telephony.flags.carrier_enabled_satellite_flag") @RequiresPermission(android.Manifest.permission.SATELLITE_COMMUNICATION) public void requestIsAttachEnabledForCarrier(int, @NonNull java.util.concurrent.Executor, @NonNull android.os.OutcomeReceiver); + method @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") @RequiresPermission(android.Manifest.permission.SATELLITE_COMMUNICATION) public void requestIsCommunicationAllowedForCurrentLocation(@NonNull java.util.concurrent.Executor, @NonNull android.os.OutcomeReceiver); method @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") @RequiresPermission(android.Manifest.permission.SATELLITE_COMMUNICATION) public void requestIsDemoModeEnabled(@NonNull java.util.concurrent.Executor, @NonNull android.os.OutcomeReceiver); - method @FlaggedApi("com.android.internal.telephony.flags.carrier_enabled_satellite_flag") @RequiresPermission(android.Manifest.permission.SATELLITE_COMMUNICATION) public void requestIsSatelliteAttachEnabledForCarrier(int, @NonNull java.util.concurrent.Executor, @NonNull android.os.OutcomeReceiver); - method @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") @RequiresPermission(android.Manifest.permission.SATELLITE_COMMUNICATION) public void requestIsSatelliteCommunicationAllowedForCurrentLocation(@NonNull java.util.concurrent.Executor, @NonNull android.os.OutcomeReceiver); - method @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") @RequiresPermission(android.Manifest.permission.SATELLITE_COMMUNICATION) public void requestIsSatelliteEnabled(@NonNull java.util.concurrent.Executor, @NonNull android.os.OutcomeReceiver); - method @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") @RequiresPermission(android.Manifest.permission.SATELLITE_COMMUNICATION) public void requestIsSatelliteProvisioned(@NonNull java.util.concurrent.Executor, @NonNull android.os.OutcomeReceiver); - method @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") public void requestIsSatelliteSupported(@NonNull java.util.concurrent.Executor, @NonNull android.os.OutcomeReceiver); + method @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") @RequiresPermission(android.Manifest.permission.SATELLITE_COMMUNICATION) public void requestIsEmergencyModeEnabled(@NonNull java.util.concurrent.Executor, @NonNull android.os.OutcomeReceiver); + method @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") @RequiresPermission(android.Manifest.permission.SATELLITE_COMMUNICATION) public void requestIsEnabled(@NonNull java.util.concurrent.Executor, @NonNull android.os.OutcomeReceiver); + method @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") @RequiresPermission(android.Manifest.permission.SATELLITE_COMMUNICATION) public void requestIsProvisioned(@NonNull java.util.concurrent.Executor, @NonNull android.os.OutcomeReceiver); + method @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") public void requestIsSupported(@NonNull java.util.concurrent.Executor, @NonNull android.os.OutcomeReceiver); method @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") @RequiresPermission(android.Manifest.permission.SATELLITE_COMMUNICATION) public void requestNtnSignalStrength(@NonNull java.util.concurrent.Executor, @NonNull android.os.OutcomeReceiver); - method @FlaggedApi("com.android.internal.telephony.flags.carrier_enabled_satellite_flag") @RequiresPermission(android.Manifest.permission.SATELLITE_COMMUNICATION) public void requestSatelliteAttachEnabledForCarrier(int, boolean, @NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer); - method @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") @RequiresPermission(android.Manifest.permission.SATELLITE_COMMUNICATION) public void requestSatelliteCapabilities(@NonNull java.util.concurrent.Executor, @NonNull android.os.OutcomeReceiver); - method @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") @RequiresPermission(android.Manifest.permission.SATELLITE_COMMUNICATION) public void requestSatelliteEnabled(boolean, boolean, @NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer); method @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") @RequiresPermission(android.Manifest.permission.SATELLITE_COMMUNICATION) public void requestTimeForNextSatelliteVisibility(@NonNull java.util.concurrent.Executor, @NonNull android.os.OutcomeReceiver); - method @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") @RequiresPermission(android.Manifest.permission.SATELLITE_COMMUNICATION) public void sendSatelliteDatagram(int, @NonNull android.telephony.satellite.SatelliteDatagram, boolean, @NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer); + method @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") @RequiresPermission(android.Manifest.permission.SATELLITE_COMMUNICATION) public void sendDatagram(int, @NonNull android.telephony.satellite.SatelliteDatagram, boolean, @NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer); method @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") @RequiresPermission(android.Manifest.permission.SATELLITE_COMMUNICATION) public void setDeviceAlignedWithSatellite(boolean); - method @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") @RequiresPermission(android.Manifest.permission.SATELLITE_COMMUNICATION) public void startSatelliteTransmissionUpdates(@NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer, @NonNull android.telephony.satellite.SatelliteTransmissionUpdateCallback); - method @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") @RequiresPermission(android.Manifest.permission.SATELLITE_COMMUNICATION) public void stopSatelliteTransmissionUpdates(@NonNull android.telephony.satellite.SatelliteTransmissionUpdateCallback, @NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer); + method @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") @RequiresPermission(android.Manifest.permission.SATELLITE_COMMUNICATION) public void startTransmissionUpdates(@NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer, @NonNull android.telephony.satellite.SatelliteTransmissionUpdateCallback); + method @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") @RequiresPermission(android.Manifest.permission.SATELLITE_COMMUNICATION) public void stopTransmissionUpdates(@NonNull android.telephony.satellite.SatelliteTransmissionUpdateCallback, @NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer); + method @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") @RequiresPermission(android.Manifest.permission.SATELLITE_COMMUNICATION) public void unregisterForCapabilitiesChanged(@NonNull android.telephony.satellite.SatelliteCapabilitiesCallback); + method @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") @RequiresPermission(android.Manifest.permission.SATELLITE_COMMUNICATION) public void unregisterForIncomingDatagram(@NonNull android.telephony.satellite.SatelliteDatagramCallback); + method @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") @RequiresPermission(android.Manifest.permission.SATELLITE_COMMUNICATION) public void unregisterForModemStateChanged(@NonNull android.telephony.satellite.SatelliteModemStateCallback); method @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") @RequiresPermission(android.Manifest.permission.SATELLITE_COMMUNICATION) public void unregisterForNtnSignalStrengthChanged(@NonNull android.telephony.satellite.NtnSignalStrengthCallback); - method @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") @RequiresPermission(android.Manifest.permission.SATELLITE_COMMUNICATION) public void unregisterForSatelliteCapabilitiesChanged(@NonNull android.telephony.satellite.SatelliteCapabilitiesCallback); - method @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") @RequiresPermission(android.Manifest.permission.SATELLITE_COMMUNICATION) public void unregisterForSatelliteDatagram(@NonNull android.telephony.satellite.SatelliteDatagramCallback); - method @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") @RequiresPermission(android.Manifest.permission.SATELLITE_COMMUNICATION) public void unregisterForSatelliteModemStateChanged(@NonNull android.telephony.satellite.SatelliteStateCallback); - method @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") @RequiresPermission(android.Manifest.permission.SATELLITE_COMMUNICATION) public void unregisterForSatelliteProvisionStateChanged(@NonNull android.telephony.satellite.SatelliteProvisionStateCallback); + method @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") @RequiresPermission(android.Manifest.permission.SATELLITE_COMMUNICATION) public void unregisterForProvisionStateChanged(@NonNull android.telephony.satellite.SatelliteProvisionStateCallback); field @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") public static final int DATAGRAM_TYPE_LOCATION_SHARING = 2; // 0x2 field @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") public static final int DATAGRAM_TYPE_SOS_MESSAGE = 1; // 0x1 field @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") public static final int DATAGRAM_TYPE_UNKNOWN = 0; // 0x0 @@ -16997,6 +17867,7 @@ package android.telephony.satellite { field @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") public static final int NT_RADIO_TECHNOLOGY_NR_NTN = 2; // 0x2 field @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") public static final int NT_RADIO_TECHNOLOGY_PROPRIETARY = 4; // 0x4 field @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") public static final int NT_RADIO_TECHNOLOGY_UNKNOWN = 0; // 0x0 + field @FlaggedApi("com.android.internal.telephony.flags.carrier_enabled_satellite_flag") public static final int SATELLITE_COMMUNICATION_RESTRICTION_REASON_ENTITLEMENT = 2; // 0x2 field @FlaggedApi("com.android.internal.telephony.flags.carrier_enabled_satellite_flag") public static final int SATELLITE_COMMUNICATION_RESTRICTION_REASON_GEOLOCATION = 1; // 0x1 field @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") public static final int SATELLITE_DATAGRAM_TRANSFER_STATE_IDLE = 0; // 0x0 field @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") public static final int SATELLITE_DATAGRAM_TRANSFER_STATE_RECEIVE_FAILED = 7; // 0x7 @@ -17019,11 +17890,13 @@ package android.telephony.satellite { field @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") public static final int SATELLITE_MODEM_STATE_UNKNOWN = -1; // 0xffffffff field @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") public static final int SATELLITE_RESULT_ACCESS_BARRED = 16; // 0x10 field @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") public static final int SATELLITE_RESULT_ERROR = 1; // 0x1 + field @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") public static final int SATELLITE_RESULT_ILLEGAL_STATE = 23; // 0x17 field @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") public static final int SATELLITE_RESULT_INVALID_ARGUMENTS = 8; // 0x8 field @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") public static final int SATELLITE_RESULT_INVALID_MODEM_STATE = 7; // 0x7 field @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") public static final int SATELLITE_RESULT_INVALID_TELEPHONY_STATE = 6; // 0x6 field @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") public static final int SATELLITE_RESULT_MODEM_BUSY = 22; // 0x16 field @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") public static final int SATELLITE_RESULT_MODEM_ERROR = 4; // 0x4 + field @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") public static final int SATELLITE_RESULT_MODEM_TIMEOUT = 24; // 0x18 field @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") public static final int SATELLITE_RESULT_NETWORK_ERROR = 5; // 0x5 field @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") public static final int SATELLITE_RESULT_NETWORK_TIMEOUT = 17; // 0x11 field @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") public static final int SATELLITE_RESULT_NOT_AUTHORIZED = 19; // 0x13 @@ -17047,12 +17920,12 @@ package android.telephony.satellite { method @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") public int getErrorCode(); } - @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") public interface SatelliteProvisionStateCallback { - method @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") public void onSatelliteProvisionStateChanged(boolean); + @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") public interface SatelliteModemStateCallback { + method @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") public void onSatelliteModemStateChanged(int); } - @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") public interface SatelliteStateCallback { - method @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") public void onSatelliteModemStateChanged(int); + @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") public interface SatelliteProvisionStateCallback { + method @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") public void onSatelliteProvisionStateChanged(boolean); } @FlaggedApi("com.android.internal.telephony.flags.oem_enabled_satellite_flag") public interface SatelliteTransmissionUpdateCallback { diff --git a/core/api/system-lint-baseline.txt b/core/api/system-lint-baseline.txt index e44d892bab16d426fc3dd407198128cfc741f6e6..1923641e2d4e5a89ad9f34a1d138791d11a7300c 100644 --- a/core/api/system-lint-baseline.txt +++ b/core/api/system-lint-baseline.txt @@ -239,14 +239,6 @@ BroadcastBehavior: android.net.NetworkScoreManager#ACTION_SCORE_NETWORKS: Field 'ACTION_SCORE_NETWORKS' is missing @BroadcastBehavior BroadcastBehavior: android.net.Proxy#PROXY_CHANGE_ACTION: Field 'PROXY_CHANGE_ACTION' is missing @BroadcastBehavior -BroadcastBehavior: android.nfc.NfcAdapter#ACTION_ADAPTER_STATE_CHANGED: - Field 'ACTION_ADAPTER_STATE_CHANGED' is missing @BroadcastBehavior -BroadcastBehavior: android.nfc.NfcAdapter#ACTION_PREFERRED_PAYMENT_CHANGED: - Field 'ACTION_PREFERRED_PAYMENT_CHANGED' is missing @BroadcastBehavior -BroadcastBehavior: android.nfc.NfcAdapter#ACTION_REQUIRE_UNLOCK_FOR_NFC: - Field 'ACTION_REQUIRE_UNLOCK_FOR_NFC' is missing @BroadcastBehavior -BroadcastBehavior: android.nfc.NfcAdapter#ACTION_TRANSACTION_DETECTED: - Field 'ACTION_TRANSACTION_DETECTED' is missing @BroadcastBehavior BroadcastBehavior: android.os.DropBoxManager#ACTION_DROPBOX_ENTRY_ADDED: Field 'ACTION_DROPBOX_ENTRY_ADDED' is missing @BroadcastBehavior BroadcastBehavior: android.provider.CalendarContract#ACTION_EVENT_REMINDER: @@ -517,6 +509,12 @@ GenericException: android.service.autofill.augmented.FillWindow#finalize(): Methods must not throw generic exceptions (`java.lang.Throwable`) +InvalidNullabilityOverride: android.service.ondeviceintelligence.OnDeviceIntelligenceService#onBind(android.content.Intent) parameter #0: + Invalid nullability on parameter `intent` in method `onBind`. Parameters of overrides cannot be NonNull if the super parameter is unannotated. +InvalidNullabilityOverride: android.service.ondeviceintelligence.OnDeviceTrustedInferenceService#onBind(android.content.Intent) parameter #0: + Invalid nullability on parameter `intent` in method `onBind`. Parameters of overrides cannot be NonNull if the super parameter is unannotated. +InvalidNullabilityOverride: android.service.ondeviceintelligence.OnDeviceTrustedInferenceService#openFileInput(String) parameter #0: + Invalid nullability on parameter `filename` in method `openFileInput`. Parameters of overrides cannot be NonNull if the super parameter is unannotated. InvalidNullabilityOverride: android.service.textclassifier.TextClassifierService#onUnbind(android.content.Intent) parameter #0: Invalid nullability on parameter `intent` in method `onUnbind`. Parameters of overrides cannot be NonNull if the super parameter is unannotated. InvalidNullabilityOverride: android.service.voice.HotwordDetectionService#getSystemService(String) parameter #0: @@ -533,12 +531,20 @@ KotlinKeyword: android.app.Notification#when: Avoid field names that are Kotlin hard keywords ("when"); see https://android.github.io/kotlin-guides/interop.html#no-hard-keywords +KotlinOperator: android.hardware.camera2.extension.CharacteristicsMap#get(String): + Method can be invoked with an indexing operator from Kotlin: `get` (this is usually desirable; just make sure it makes sense for this type of object) + + ListenerLast: android.telephony.satellite.SatelliteManager#stopSatelliteTransmissionUpdates(android.telephony.satellite.SatelliteTransmissionUpdateCallback, java.util.concurrent.Executor, java.util.function.Consumer) parameter #1: Listeners should always be at end of argument list (method `stopSatelliteTransmissionUpdates`) ListenerLast: android.telephony.satellite.SatelliteManager#stopSatelliteTransmissionUpdates(android.telephony.satellite.SatelliteTransmissionUpdateCallback, java.util.concurrent.Executor, java.util.function.Consumer) parameter #2: Listeners should always be at end of argument list (method `stopSatelliteTransmissionUpdates`) +MethodNameUnits: android.hardware.camera2.extension.CameraOutputSurface#getColorSpace(): + Expected method name units to be `Bytes`, was `Space` in `getColorSpace` + + MissingGetterMatchingBuilder: android.service.voice.HotwordTrainingData.Builder#addTrainingAudio(android.service.voice.HotwordTrainingAudio): android.service.voice.HotwordTrainingData does not declare a `getTrainingAudios()` method matching method android.service.voice.HotwordTrainingData.Builder.addTrainingAudio(android.service.voice.HotwordTrainingAudio) MissingGetterMatchingBuilder: android.telecom.CallScreeningService.CallResponse.Builder#setShouldScreenCallViaAudioProcessing(boolean): @@ -565,6 +571,8 @@ MissingNullability: android.service.contentcapture.ContentCaptureService#dump(ja Missing nullability on parameter `args` in method `dump` MissingNullability: android.service.notification.NotificationAssistantService#attachBaseContext(android.content.Context) parameter #0: Missing nullability on parameter `base` in method `attachBaseContext` +MissingNullability: android.service.ondeviceintelligence.OnDeviceTrustedInferenceService#openFileInput(String): + Missing nullability on method `openFileInput` return MissingNullability: android.telephony.NetworkService#onUnbind(android.content.Intent) parameter #0: Missing nullability on parameter `intent` in method `onUnbind` MissingNullability: android.telephony.data.DataService#onUnbind(android.content.Intent) parameter #0: @@ -693,6 +701,8 @@ RequiresPermission: android.app.admin.DevicePolicyManager#generateKeyPair(androi Method 'generateKeyPair' documentation mentions permissions already declared by @RequiresPermission RequiresPermission: android.app.admin.DevicePolicyManager#getApplicationExemptions(String): Method 'getApplicationExemptions' documentation mentions permissions already declared by @RequiresPermission +RequiresPermission: android.app.admin.DevicePolicyManager#getContentProtectionPolicy(android.content.ComponentName): + Method 'getContentProtectionPolicy' documentation mentions permissions already declared by @RequiresPermission RequiresPermission: android.app.admin.DevicePolicyManager#getCrossProfileWidgetProviders(android.content.ComponentName): Method 'getCrossProfileWidgetProviders' documentation mentions permissions already declared by @RequiresPermission RequiresPermission: android.app.admin.DevicePolicyManager#getLockTaskFeatures(android.content.ComponentName): @@ -739,6 +749,8 @@ RequiresPermission: android.app.admin.DevicePolicyManager#setAlwaysOnVpnPackage( Method 'setAlwaysOnVpnPackage' documentation mentions permissions without declaring @RequiresPermission RequiresPermission: android.app.admin.DevicePolicyManager#setApplicationExemptions(String, java.util.Set): Method 'setApplicationExemptions' documentation mentions permissions already declared by @RequiresPermission +RequiresPermission: android.app.admin.DevicePolicyManager#setContentProtectionPolicy(android.content.ComponentName, int): + Method 'setContentProtectionPolicy' documentation mentions permissions already declared by @RequiresPermission RequiresPermission: android.app.admin.DevicePolicyManager#setDeviceProvisioningConfigApplied(): Method 'setDeviceProvisioningConfigApplied' documentation mentions permissions already declared by @RequiresPermission RequiresPermission: android.app.admin.DevicePolicyManager#setLockTaskFeatures(android.content.ComponentName, int): @@ -1077,86 +1089,6 @@ RequiresPermission: android.net.vcn.VcnManager#applyVcnNetworkPolicy(android.net Method 'applyVcnNetworkPolicy' documentation mentions permissions already declared by @RequiresPermission RequiresPermission: android.net.vcn.VcnManager#removeVcnNetworkPolicyChangeListener(android.net.vcn.VcnManager.VcnNetworkPolicyChangeListener): Method 'removeVcnNetworkPolicyChangeListener' documentation mentions permissions already declared by @RequiresPermission -RequiresPermission: android.nfc.NfcAdapter#disableForegroundDispatch(android.app.Activity): - Method 'disableForegroundDispatch' documentation mentions permissions without declaring @RequiresPermission -RequiresPermission: android.nfc.NfcAdapter#enableForegroundDispatch(android.app.Activity, android.app.PendingIntent, android.content.IntentFilter[], String[][]): - Method 'enableForegroundDispatch' documentation mentions permissions without declaring @RequiresPermission -RequiresPermission: android.nfc.cardemulation.CardEmulation#isDefaultServiceForAid(android.content.ComponentName, String): - Method 'isDefaultServiceForAid' documentation mentions permissions without declaring @RequiresPermission -RequiresPermission: android.nfc.cardemulation.CardEmulation#isDefaultServiceForCategory(android.content.ComponentName, String): - Method 'isDefaultServiceForCategory' documentation mentions permissions without declaring @RequiresPermission -RequiresPermission: android.nfc.cardemulation.CardEmulation#setOffHostForService(android.content.ComponentName, String): - Method 'setOffHostForService' documentation mentions permissions already declared by @RequiresPermission -RequiresPermission: android.nfc.tech.IsoDep#getTimeout(): - Method 'getTimeout' documentation mentions permissions without declaring @RequiresPermission -RequiresPermission: android.nfc.tech.IsoDep#setTimeout(int): - Method 'setTimeout' documentation mentions permissions without declaring @RequiresPermission -RequiresPermission: android.nfc.tech.IsoDep#transceive(byte[]): - Method 'transceive' documentation mentions permissions without declaring @RequiresPermission -RequiresPermission: android.nfc.tech.MifareClassic#authenticateSectorWithKeyA(int, byte[]): - Method 'authenticateSectorWithKeyA' documentation mentions permissions without declaring @RequiresPermission -RequiresPermission: android.nfc.tech.MifareClassic#authenticateSectorWithKeyB(int, byte[]): - Method 'authenticateSectorWithKeyB' documentation mentions permissions without declaring @RequiresPermission -RequiresPermission: android.nfc.tech.MifareClassic#decrement(int, int): - Method 'decrement' documentation mentions permissions without declaring @RequiresPermission -RequiresPermission: android.nfc.tech.MifareClassic#getTimeout(): - Method 'getTimeout' documentation mentions permissions without declaring @RequiresPermission -RequiresPermission: android.nfc.tech.MifareClassic#increment(int, int): - Method 'increment' documentation mentions permissions without declaring @RequiresPermission -RequiresPermission: android.nfc.tech.MifareClassic#readBlock(int): - Method 'readBlock' documentation mentions permissions without declaring @RequiresPermission -RequiresPermission: android.nfc.tech.MifareClassic#restore(int): - Method 'restore' documentation mentions permissions without declaring @RequiresPermission -RequiresPermission: android.nfc.tech.MifareClassic#setTimeout(int): - Method 'setTimeout' documentation mentions permissions without declaring @RequiresPermission -RequiresPermission: android.nfc.tech.MifareClassic#transceive(byte[]): - Method 'transceive' documentation mentions permissions without declaring @RequiresPermission -RequiresPermission: android.nfc.tech.MifareClassic#transfer(int): - Method 'transfer' documentation mentions permissions without declaring @RequiresPermission -RequiresPermission: android.nfc.tech.MifareClassic#writeBlock(int, byte[]): - Method 'writeBlock' documentation mentions permissions without declaring @RequiresPermission -RequiresPermission: android.nfc.tech.MifareUltralight#getTimeout(): - Method 'getTimeout' documentation mentions permissions without declaring @RequiresPermission -RequiresPermission: android.nfc.tech.MifareUltralight#readPages(int): - Method 'readPages' documentation mentions permissions without declaring @RequiresPermission -RequiresPermission: android.nfc.tech.MifareUltralight#setTimeout(int): - Method 'setTimeout' documentation mentions permissions without declaring @RequiresPermission -RequiresPermission: android.nfc.tech.MifareUltralight#transceive(byte[]): - Method 'transceive' documentation mentions permissions without declaring @RequiresPermission -RequiresPermission: android.nfc.tech.MifareUltralight#writePage(int, byte[]): - Method 'writePage' documentation mentions permissions without declaring @RequiresPermission -RequiresPermission: android.nfc.tech.Ndef#getNdefMessage(): - Method 'getNdefMessage' documentation mentions permissions without declaring @RequiresPermission -RequiresPermission: android.nfc.tech.Ndef#isWritable(): - Method 'isWritable' documentation mentions permissions without declaring @RequiresPermission -RequiresPermission: android.nfc.tech.Ndef#makeReadOnly(): - Method 'makeReadOnly' documentation mentions permissions without declaring @RequiresPermission -RequiresPermission: android.nfc.tech.Ndef#writeNdefMessage(android.nfc.NdefMessage): - Method 'writeNdefMessage' documentation mentions permissions without declaring @RequiresPermission -RequiresPermission: android.nfc.tech.NdefFormatable#format(android.nfc.NdefMessage): - Method 'format' documentation mentions permissions without declaring @RequiresPermission -RequiresPermission: android.nfc.tech.NdefFormatable#formatReadOnly(android.nfc.NdefMessage): - Method 'formatReadOnly' documentation mentions permissions without declaring @RequiresPermission -RequiresPermission: android.nfc.tech.NfcA#getTimeout(): - Method 'getTimeout' documentation mentions permissions without declaring @RequiresPermission -RequiresPermission: android.nfc.tech.NfcA#setTimeout(int): - Method 'setTimeout' documentation mentions permissions without declaring @RequiresPermission -RequiresPermission: android.nfc.tech.NfcA#transceive(byte[]): - Method 'transceive' documentation mentions permissions without declaring @RequiresPermission -RequiresPermission: android.nfc.tech.NfcB#transceive(byte[]): - Method 'transceive' documentation mentions permissions without declaring @RequiresPermission -RequiresPermission: android.nfc.tech.NfcF#getTimeout(): - Method 'getTimeout' documentation mentions permissions without declaring @RequiresPermission -RequiresPermission: android.nfc.tech.NfcF#setTimeout(int): - Method 'setTimeout' documentation mentions permissions without declaring @RequiresPermission -RequiresPermission: android.nfc.tech.NfcF#transceive(byte[]): - Method 'transceive' documentation mentions permissions without declaring @RequiresPermission -RequiresPermission: android.nfc.tech.NfcV#transceive(byte[]): - Method 'transceive' documentation mentions permissions without declaring @RequiresPermission -RequiresPermission: android.nfc.tech.TagTechnology#close(): - Method 'close' documentation mentions permissions without declaring @RequiresPermission -RequiresPermission: android.nfc.tech.TagTechnology#connect(): - Method 'connect' documentation mentions permissions without declaring @RequiresPermission RequiresPermission: android.os.BugreportManager#cancelBugreport(): Method 'cancelBugreport' documentation mentions permissions without declaring @RequiresPermission RequiresPermission: android.os.BugreportManager#preDumpUiData(): @@ -1929,8 +1861,6 @@ SdkConstant: android.hardware.usb.UsbManager#ACTION_USB_PORT_COMPLIANCE_CHANGED: Field 'ACTION_USB_PORT_COMPLIANCE_CHANGED' is missing @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) SdkConstant: android.hardware.usb.UsbManager#ACTION_USB_STATE: Field 'ACTION_USB_STATE' is missing @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) -SdkConstant: android.nfc.NfcAdapter#ACTION_REQUIRE_UNLOCK_FOR_NFC: - Field 'ACTION_REQUIRE_UNLOCK_FOR_NFC' is missing @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) SdkConstant: android.service.euicc.EuiccService#ACTION_DELETE_SUBSCRIPTION_PRIVILEGED: Field 'ACTION_DELETE_SUBSCRIPTION_PRIVILEGED' is missing @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) SdkConstant: android.service.euicc.EuiccService#ACTION_RENAME_SUBSCRIPTION_PRIVILEGED: @@ -1955,6 +1885,8 @@ Todo: android.Manifest.permission#READ_PEOPLE_DATA: Documentation mentions 'TODO' Todo: android.app.NotificationManager#isNotificationAssistantAccessGranted(android.content.ComponentName): Documentation mentions 'TODO' +Todo: android.app.ondeviceintelligence.OnDeviceIntelligenceManager#requestFeatureDownload(android.app.ondeviceintelligence.Feature, android.app.ondeviceintelligence.CancellationSignal, java.util.concurrent.Executor, android.app.ondeviceintelligence.DownloadCallback): + Documentation mentions 'TODO' Todo: android.hardware.camera2.params.StreamConfigurationMap: Documentation mentions 'TODO' Todo: android.hardware.location.ContextHubManager#getNanoAppInstanceInfo(int): @@ -1991,8 +1923,12 @@ UnflaggedApi: android.Manifest.permission#ALWAYS_UPDATE_WALLPAPER: New API must be flagged with @FlaggedApi: field android.Manifest.permission.ALWAYS_UPDATE_WALLPAPER UnflaggedApi: android.Manifest.permission#CAMERA_HEADLESS_SYSTEM_USER: New API must be flagged with @FlaggedApi: field android.Manifest.permission.CAMERA_HEADLESS_SYSTEM_USER +UnflaggedApi: android.Manifest.permission#KEYPHRASE_ENROLLMENT_APPLICATION: + New API must be flagged with @FlaggedApi: field android.Manifest.permission.KEYPHRASE_ENROLLMENT_APPLICATION UnflaggedApi: android.Manifest.permission#LAUNCH_PERMISSION_SETTINGS: New API must be flagged with @FlaggedApi: field android.Manifest.permission.LAUNCH_PERMISSION_SETTINGS +UnflaggedApi: android.Manifest.permission#MANAGE_VOICE_KEYPHRASES: + New API must be flagged with @FlaggedApi: field android.Manifest.permission.MANAGE_VOICE_KEYPHRASES UnflaggedApi: android.Manifest.permission#READ_INSTALLED_SESSION_PATHS: New API must be flagged with @FlaggedApi: field android.Manifest.permission.READ_INSTALLED_SESSION_PATHS UnflaggedApi: android.Manifest.permission#REGISTER_NSD_OFFLOAD_ENGINE: @@ -2005,6 +1941,10 @@ UnflaggedApi: android.app.ActivityManager#getExternalHistoricalProcessStartReaso New API must be flagged with @FlaggedApi: method android.app.ActivityManager.getExternalHistoricalProcessStartReasons(String,int) UnflaggedApi: android.app.AppOpsManager#OPSTR_RECEIVE_SANDBOX_TRIGGER_AUDIO: New API must be flagged with @FlaggedApi: field android.app.AppOpsManager.OPSTR_RECEIVE_SANDBOX_TRIGGER_AUDIO +UnflaggedApi: android.app.StatusBarManager.DisableInfo#CREATOR: + New API must be flagged with @FlaggedApi: field android.app.StatusBarManager.DisableInfo.CREATOR +UnflaggedApi: android.app.StatusBarManager.DisableInfo#isBackDisabled(): + New API must be flagged with @FlaggedApi: method android.app.StatusBarManager.DisableInfo.isBackDisabled() UnflaggedApi: android.companion.virtual.VirtualDeviceManager.VirtualDevice#getPersistentDeviceId(): New API must be flagged with @FlaggedApi: method android.companion.virtual.VirtualDeviceManager.VirtualDevice.getPersistentDeviceId() UnflaggedApi: android.content.Context#THREAD_NETWORK_SERVICE: @@ -2351,8 +2291,8 @@ UnflaggedApi: android.telephony.satellite.SatelliteManager#provisionSatelliteSer New API must be flagged with @FlaggedApi: method android.telephony.satellite.SatelliteManager.provisionSatelliteService(String,byte[],android.os.CancellationSignal,java.util.concurrent.Executor,java.util.function.Consumer) UnflaggedApi: android.telephony.satellite.SatelliteManager#registerForSatelliteDatagram(java.util.concurrent.Executor, android.telephony.satellite.SatelliteDatagramCallback): New API must be flagged with @FlaggedApi: method android.telephony.satellite.SatelliteManager.registerForSatelliteDatagram(java.util.concurrent.Executor,android.telephony.satellite.SatelliteDatagramCallback) -UnflaggedApi: android.telephony.satellite.SatelliteManager#registerForSatelliteModemStateChanged(java.util.concurrent.Executor, android.telephony.satellite.SatelliteStateCallback): - New API must be flagged with @FlaggedApi: method android.telephony.satellite.SatelliteManager.registerForSatelliteModemStateChanged(java.util.concurrent.Executor,android.telephony.satellite.SatelliteStateCallback) +UnflaggedApi: android.telephony.satellite.SatelliteManager#registerForSatelliteModemStateChanged(java.util.concurrent.Executor, android.telephony.satellite.SatelliteModemStateCallback): + New API must be flagged with @FlaggedApi: method android.telephony.satellite.SatelliteManager.registerForSatelliteModemStateChanged(java.util.concurrent.Executor,android.telephony.satellite.SatelliteModemStateCallback) UnflaggedApi: android.telephony.satellite.SatelliteManager#registerForSatelliteProvisionStateChanged(java.util.concurrent.Executor, android.telephony.satellite.SatelliteProvisionStateCallback): New API must be flagged with @FlaggedApi: method android.telephony.satellite.SatelliteManager.registerForSatelliteProvisionStateChanged(java.util.concurrent.Executor,android.telephony.satellite.SatelliteProvisionStateCallback) UnflaggedApi: android.telephony.satellite.SatelliteManager#requestIsDemoModeEnabled(java.util.concurrent.Executor, android.os.OutcomeReceiver): @@ -2381,8 +2321,8 @@ UnflaggedApi: android.telephony.satellite.SatelliteManager#stopSatelliteTransmis New API must be flagged with @FlaggedApi: method android.telephony.satellite.SatelliteManager.stopSatelliteTransmissionUpdates(android.telephony.satellite.SatelliteTransmissionUpdateCallback,java.util.concurrent.Executor,java.util.function.Consumer) UnflaggedApi: android.telephony.satellite.SatelliteManager#unregisterForSatelliteDatagram(android.telephony.satellite.SatelliteDatagramCallback): New API must be flagged with @FlaggedApi: method android.telephony.satellite.SatelliteManager.unregisterForSatelliteDatagram(android.telephony.satellite.SatelliteDatagramCallback) -UnflaggedApi: android.telephony.satellite.SatelliteManager#unregisterForSatelliteModemStateChanged(android.telephony.satellite.SatelliteStateCallback): - New API must be flagged with @FlaggedApi: method android.telephony.satellite.SatelliteManager.unregisterForSatelliteModemStateChanged(android.telephony.satellite.SatelliteStateCallback) +UnflaggedApi: android.telephony.satellite.SatelliteManager#unregisterForSatelliteModemStateChanged(android.telephony.satellite.SatelliteModemStateCallback): + New API must be flagged with @FlaggedApi: method android.telephony.satellite.SatelliteManager.unregisterForSatelliteModemStateChanged(android.telephony.satellite.SatelliteModemStateCallback) UnflaggedApi: android.telephony.satellite.SatelliteManager#unregisterForSatelliteProvisionStateChanged(android.telephony.satellite.SatelliteProvisionStateCallback): New API must be flagged with @FlaggedApi: method android.telephony.satellite.SatelliteManager.unregisterForSatelliteProvisionStateChanged(android.telephony.satellite.SatelliteProvisionStateCallback) UnflaggedApi: android.telephony.satellite.SatelliteManager.SatelliteException: @@ -2391,14 +2331,14 @@ UnflaggedApi: android.telephony.satellite.SatelliteManager.SatelliteException#Sa New API must be flagged with @FlaggedApi: constructor android.telephony.satellite.SatelliteManager.SatelliteException(int) UnflaggedApi: android.telephony.satellite.SatelliteManager.SatelliteException#getErrorCode(): New API must be flagged with @FlaggedApi: method android.telephony.satellite.SatelliteManager.SatelliteException.getErrorCode() +UnflaggedApi: android.telephony.satellite.SatelliteModemStateCallback: + New API must be flagged with @FlaggedApi: class android.telephony.satellite.SatelliteModemStateCallback +UnflaggedApi: android.telephony.satellite.SatelliteModemStateCallback#onSatelliteModemStateChanged(int): + New API must be flagged with @FlaggedApi: method android.telephony.satellite.SatelliteModemStateCallback.onSatelliteModemStateChanged(int) UnflaggedApi: android.telephony.satellite.SatelliteProvisionStateCallback: New API must be flagged with @FlaggedApi: class android.telephony.satellite.SatelliteProvisionStateCallback UnflaggedApi: android.telephony.satellite.SatelliteProvisionStateCallback#onSatelliteProvisionStateChanged(boolean): New API must be flagged with @FlaggedApi: method android.telephony.satellite.SatelliteProvisionStateCallback.onSatelliteProvisionStateChanged(boolean) -UnflaggedApi: android.telephony.satellite.SatelliteStateCallback: - New API must be flagged with @FlaggedApi: class android.telephony.satellite.SatelliteStateCallback -UnflaggedApi: android.telephony.satellite.SatelliteStateCallback#onSatelliteModemStateChanged(int): - New API must be flagged with @FlaggedApi: method android.telephony.satellite.SatelliteStateCallback.onSatelliteModemStateChanged(int) UnflaggedApi: android.telephony.satellite.SatelliteTransmissionUpdateCallback: New API must be flagged with @FlaggedApi: class android.telephony.satellite.SatelliteTransmissionUpdateCallback UnflaggedApi: android.telephony.satellite.SatelliteTransmissionUpdateCallback#onReceiveDatagramStateChanged(int, int, int): diff --git a/core/api/test-current.txt b/core/api/test-current.txt index ef7ae86b04c1ded12c631523ac3bab58034d82f6..a28dc497c508f2d045a83d0392092ddc8c5ffec4 100644 --- a/core/api/test-current.txt +++ b/core/api/test-current.txt @@ -104,6 +104,14 @@ package android.accessibilityservice { method @FlaggedApi("android.view.accessibility.motion_event_observing") public void setObservedMotionEventSources(int); } + @FlaggedApi("android.view.accessibility.braille_display_hid") public interface BrailleDisplayController { + method @FlaggedApi("android.view.accessibility.braille_display_hid") @RequiresPermission(android.Manifest.permission.MANAGE_ACCESSIBILITY) public static void setTestBrailleDisplayData(@NonNull android.accessibilityservice.AccessibilityService, @NonNull java.util.List); + field @FlaggedApi("android.view.accessibility.braille_display_hid") public static final String TEST_BRAILLE_DISPLAY_BUS_BLUETOOTH = "BUS_BLUETOOTH"; + field @FlaggedApi("android.view.accessibility.braille_display_hid") public static final String TEST_BRAILLE_DISPLAY_DESCRIPTOR = "DESCRIPTOR"; + field @FlaggedApi("android.view.accessibility.braille_display_hid") public static final String TEST_BRAILLE_DISPLAY_HIDRAW_PATH = "HIDRAW_PATH"; + field @FlaggedApi("android.view.accessibility.braille_display_hid") public static final String TEST_BRAILLE_DISPLAY_UNIQUE_ID = "UNIQUE_ID"; + } + } package android.animation { @@ -187,6 +195,7 @@ package android.app { method public void setEligibleForLegacyPermissionPrompt(boolean); method public static void setExitTransitionTimeout(long); method public void setLaunchActivityType(int); + method public void setLaunchCookie(@NonNull android.app.ActivityOptions.LaunchCookie); method public void setLaunchTaskDisplayAreaFeatureId(int); method public void setLaunchWindowingMode(int); method public void setLaunchedFromBubble(boolean); @@ -194,6 +203,13 @@ package android.app { method public void setTaskOverlay(boolean, boolean); } + public static final class ActivityOptions.LaunchCookie implements android.os.Parcelable { + ctor public ActivityOptions.LaunchCookie(); + method public int describeContents(); + method public void writeToParcel(@NonNull android.os.Parcel, int); + field @NonNull public static final android.os.Parcelable.Creator CREATOR; + } + public static interface ActivityOptions.OnAnimationFinishedListener { method public void onAnimationFinished(long); } @@ -235,6 +251,7 @@ package android.app { method @RequiresPermission("android.permission.MANAGE_APPOPS") public void getHistoricalOpsFromDiskRaw(@NonNull android.app.AppOpsManager.HistoricalOpsRequest, @Nullable java.util.concurrent.Executor, @NonNull java.util.function.Consumer); method public static int getNumOps(); method public boolean isOperationActive(int, int, String); + method public int noteOpNoThrow(int, @NonNull android.content.AttributionSource, @Nullable String); method @RequiresPermission("android.permission.MANAGE_APPOPS") public void offsetHistory(long); method public static String opToPermission(int); method public static int permissionToOpCode(String); @@ -300,9 +317,6 @@ package android.app { } public class ComponentOptions { - field public static final int MODE_BACKGROUND_ACTIVITY_START_ALLOWED = 1; // 0x1 - field public static final int MODE_BACKGROUND_ACTIVITY_START_DENIED = 2; // 0x2 - field public static final int MODE_BACKGROUND_ACTIVITY_START_SYSTEM_DEFINED = 0; // 0x0 } public class DownloadManager { @@ -370,11 +384,15 @@ package android.app { } public class NotificationManager { + method @FlaggedApi("android.app.modes_api") @NonNull public String addAutomaticZenRule(@NonNull android.app.AutomaticZenRule, boolean); method public void cleanUpCallersAfter(long); + method @FlaggedApi("android.app.modes_api") @NonNull public android.service.notification.ZenPolicy getDefaultZenPolicy(); method public android.content.ComponentName getEffectsSuppressor(); method public boolean isNotificationPolicyAccessGrantedForPackage(@NonNull String); + method @FlaggedApi("android.app.modes_api") public boolean removeAutomaticZenRule(@NonNull String, boolean); method @RequiresPermission(android.Manifest.permission.MANAGE_NOTIFICATION_LISTENERS) public void setNotificationListenerAccessGranted(@NonNull android.content.ComponentName, boolean, boolean); method @RequiresPermission(android.Manifest.permission.MANAGE_TOAST_RATE_LIMITING) public void setToastRateLimitingEnabled(boolean); + method @FlaggedApi("android.app.modes_api") public boolean updateAutomaticZenRule(@NonNull String, @NonNull android.app.AutomaticZenRule, boolean); method public void updateNotificationChannel(@NonNull String, int, @NonNull android.app.NotificationChannel); } @@ -443,7 +461,7 @@ package android.app { method @RequiresPermission(android.Manifest.permission.STATUS_BAR) public void togglePanel(); } - public static final class StatusBarManager.DisableInfo { + public static final class StatusBarManager.DisableInfo implements android.os.Parcelable { method public boolean isRotationSuggestionDisabled(); } @@ -481,10 +499,15 @@ package android.app { } public class UiModeManager { + method @FlaggedApi("android.app.modes_api") @RequiresPermission(android.Manifest.permission.MODIFY_DAY_NIGHT_MODE) public int getAttentionModeThemeOverlay(); method public boolean isNightModeLocked(); method public boolean isUiModeLocked(); method @RequiresPermission(value=android.Manifest.permission.TOGGLE_AUTOMOTIVE_PROJECTION, conditional=true) public boolean releaseProjection(int); method @RequiresPermission(value=android.Manifest.permission.TOGGLE_AUTOMOTIVE_PROJECTION, conditional=true) public boolean requestProjection(int); + field @FlaggedApi("android.app.modes_api") public static final int MODE_ATTENTION_THEME_OVERLAY_DAY = 1002; // 0x3ea + field @FlaggedApi("android.app.modes_api") public static final int MODE_ATTENTION_THEME_OVERLAY_NIGHT = 1001; // 0x3e9 + field @FlaggedApi("android.app.modes_api") public static final int MODE_ATTENTION_THEME_OVERLAY_OFF = 1000; // 0x3e8 + field @FlaggedApi("android.app.modes_api") public static final int MODE_ATTENTION_THEME_OVERLAY_UNKNOWN = -1; // 0xffffffff field public static final int PROJECTION_TYPE_ALL = -1; // 0xffffffff field public static final int PROJECTION_TYPE_AUTOMOTIVE = 1; // 0x1 field public static final int PROJECTION_TYPE_NONE = 0; // 0x0 @@ -508,6 +531,7 @@ package android.app { method public int getActivityType(); method @Nullable public android.graphics.Rect getAppBounds(); method @NonNull public android.graphics.Rect getBounds(); + method public int getDisplayRotation(); method @NonNull public android.graphics.Rect getMaxBounds(); method public int getRotation(); method public int getWindowingMode(); @@ -606,6 +630,7 @@ package android.app.admin { field public static final int OPERATION_SET_APPLICATION_HIDDEN = 15; // 0xf field public static final int OPERATION_SET_APPLICATION_RESTRICTIONS = 16; // 0x10 field public static final int OPERATION_SET_CAMERA_DISABLED = 31; // 0x1f + field @FlaggedApi("android.view.contentprotection.flags.manage_device_policy_enabled") public static final int OPERATION_SET_CONTENT_PROTECTION_POLICY = 41; // 0x29 field public static final int OPERATION_SET_FACTORY_RESET_PROTECTION_POLICY = 32; // 0x20 field public static final int OPERATION_SET_GLOBAL_PRIVATE_DNS = 33; // 0x21 field public static final int OPERATION_SET_KEEP_UNINSTALLED_PACKAGES = 17; // 0x11 @@ -883,7 +908,6 @@ package android.companion { public final class CompanionDeviceManager { method @RequiresPermission("android.permission.MANAGE_COMPANION_DEVICES") public void enableSecureTransport(boolean); - field @FlaggedApi("android.companion.companion_transport_apis") public static final int MESSAGE_REQUEST_PING = 1669362552; // 0x63807378 } public abstract class CompanionDeviceService extends android.app.Service { @@ -895,7 +919,33 @@ package android.companion { package android.companion.virtual { public final class VirtualDeviceManager { + method public int getAudioPlaybackSessionId(int); + method public int getAudioRecordingSessionId(int); + method public int getDeviceIdForDisplayId(int); + method public int getDevicePolicy(int, int); method @FlaggedApi("android.companion.virtual.flags.interactive_screen_mirror") public boolean isVirtualDeviceOwnedMirrorDisplay(int); + method public void playSoundEffect(int, int); + } + +} + +package android.companion.virtual.camera { + + @FlaggedApi("android.companion.virtual.flags.virtual_camera") public final class VirtualCamera implements java.io.Closeable { + method @NonNull public String getId(); + } + +} + +package android.companion.virtual.sensor { + + public final class VirtualSensor implements android.os.Parcelable { + ctor public VirtualSensor(int, int, @NonNull String); + method public int getHandle(); + } + + public final class VirtualSensorConfig implements android.os.Parcelable { + method public int getFlags(); } } @@ -962,6 +1012,7 @@ package android.content { method public void setAutofillOptions(@Nullable android.content.AutofillOptions); method public void setContentCaptureOptions(@Nullable android.content.ContentCaptureOptions); method public void updateDeviceId(int); + method public abstract void updateDisplay(int); field public static final String ATTENTION_SERVICE = "attention"; field public static final String CONTENT_CAPTURE_MANAGER_SERVICE = "content_capture"; field public static final String DEVICE_IDLE_CONTROLLER = "deviceidle"; @@ -975,10 +1026,14 @@ package android.content { public class ContextWrapper extends android.content.Context { method public int getDisplayId(); + method public void updateDisplay(int); } public class Intent implements java.lang.Cloneable android.os.Parcelable { + method @NonNull public android.content.Intent addExtendedFlags(int); + method public int getExtendedFlags(); field public static final String ACTION_USER_STOPPED = "android.intent.action.USER_STOPPED"; + field public static final int EXTENDED_FLAG_FILTER_MISMATCH = 1; // 0x1 } public class SyncAdapterType implements android.os.Parcelable { @@ -1008,6 +1063,7 @@ package android.content.pm { field public static final long OVERRIDE_CAMERA_COMPAT_DISABLE_REFRESH = 264304459L; // 0xfc0f74bL field public static final long OVERRIDE_CAMERA_COMPAT_ENABLE_REFRESH_VIA_PAUSE = 264301586L; // 0xfc0ec12L field public static final long OVERRIDE_ENABLE_COMPAT_FAKE_FOCUS = 263259275L; // 0xfb1048bL + field @FlaggedApi("com.android.window.flags.app_compat_properties_api") public static final long OVERRIDE_ENABLE_COMPAT_IGNORE_ORIENTATION_REQUEST_WHEN_LOOP_DETECTED = 273509367L; // 0x104d6bf7L field public static final long OVERRIDE_ENABLE_COMPAT_IGNORE_REQUESTED_ORIENTATION = 254631730L; // 0xf2d5f32L field public static final long OVERRIDE_LANDSCAPE_ORIENTATION_TO_REVERSE_LANDSCAPE = 266124927L; // 0xfdcbe7fL field public static final long OVERRIDE_MIN_ASPECT_RATIO = 174042980L; // 0xa5faf64L @@ -1164,6 +1220,7 @@ package android.content.pm { method public int getShowInLauncher(); field public static final int SHOW_IN_LAUNCHER_NO = 2; // 0x2 field public static final int SHOW_IN_LAUNCHER_SEPARATE = 1; // 0x1 + field public static final int SHOW_IN_LAUNCHER_UNKNOWN = -1; // 0xffffffff field public static final int SHOW_IN_LAUNCHER_WITH_PARENT = 0; // 0x0 } @@ -1246,103 +1303,102 @@ package android.credentials { } -package android.credentials.ui { +package android.credentials.selection { - public final class AuthenticationEntry implements android.os.Parcelable { - ctor public AuthenticationEntry(@NonNull String, @NonNull String, @NonNull android.app.slice.Slice, int); - ctor public AuthenticationEntry(@NonNull String, @NonNull String, @NonNull android.app.slice.Slice, int, @NonNull android.content.Intent); + @FlaggedApi("android.credentials.flags.configurable_selector_ui_enabled") public class BaseDialogResult implements android.os.Parcelable { + ctor public BaseDialogResult(@Nullable android.os.IBinder); + ctor protected BaseDialogResult(@NonNull android.os.Parcel); + method public static void addToBundle(@NonNull android.credentials.selection.BaseDialogResult, @NonNull android.os.Bundle); method public int describeContents(); - method @Nullable public android.content.Intent getFrameworkExtrasIntent(); - method @NonNull public String getKey(); - method @NonNull public android.app.slice.Slice getSlice(); - method @NonNull public int getStatus(); - method @NonNull public String getSubkey(); + method @Nullable public static android.credentials.selection.BaseDialogResult fromResultData(@NonNull android.os.Bundle); + method @Deprecated @Nullable public android.os.IBinder getRequestToken(); method public void writeToParcel(@NonNull android.os.Parcel, int); - field @NonNull public static final android.os.Parcelable.Creator CREATOR; - field public static final int STATUS_LOCKED = 0; // 0x0 - field public static final int STATUS_UNLOCKED_BUT_EMPTY_LESS_RECENT = 1; // 0x1 - field public static final int STATUS_UNLOCKED_BUT_EMPTY_MOST_RECENT = 2; // 0x2 + field @NonNull public static final android.os.Parcelable.Creator CREATOR; + field public static final int RESULT_CODE_CANCELED_AND_LAUNCHED_SETTINGS = 1; // 0x1 + field public static final int RESULT_CODE_DATA_PARSING_FAILURE = 3; // 0x3 + field public static final int RESULT_CODE_DIALOG_COMPLETE_WITH_SELECTION = 2; // 0x2 + field public static final int RESULT_CODE_DIALOG_USER_CANCELED = 0; // 0x0 } - public final class CreateCredentialProviderData extends android.credentials.ui.ProviderData implements android.os.Parcelable { - ctor public CreateCredentialProviderData(@NonNull String, @NonNull java.util.List, @Nullable android.credentials.ui.Entry); - method @Nullable public android.credentials.ui.Entry getRemoteEntry(); - method @NonNull public java.util.List getSaveEntries(); - field @NonNull public static final android.os.Parcelable.Creator CREATOR; + @FlaggedApi("android.credentials.flags.configurable_selector_ui_enabled") public final class CreateCredentialProviderData extends android.credentials.selection.ProviderData implements android.os.Parcelable { + ctor public CreateCredentialProviderData(@NonNull String, @NonNull java.util.List, @Nullable android.credentials.selection.Entry); + method @Nullable public android.credentials.selection.Entry getRemoteEntry(); + method @NonNull public java.util.List getSaveEntries(); + field @NonNull public static final android.os.Parcelable.Creator CREATOR; } - public static final class CreateCredentialProviderData.Builder { + @FlaggedApi("android.credentials.flags.configurable_selector_ui_enabled") public static final class CreateCredentialProviderData.Builder { ctor public CreateCredentialProviderData.Builder(@NonNull String); - method @NonNull public android.credentials.ui.CreateCredentialProviderData build(); - method @NonNull public android.credentials.ui.CreateCredentialProviderData.Builder setRemoteEntry(@Nullable android.credentials.ui.Entry); - method @NonNull public android.credentials.ui.CreateCredentialProviderData.Builder setSaveEntries(@NonNull java.util.List); + method @NonNull public android.credentials.selection.CreateCredentialProviderData build(); + method @NonNull public android.credentials.selection.CreateCredentialProviderData.Builder setRemoteEntry(@Nullable android.credentials.selection.Entry); + method @NonNull public android.credentials.selection.CreateCredentialProviderData.Builder setSaveEntries(@NonNull java.util.List); } - public final class DisabledProviderData extends android.credentials.ui.ProviderData implements android.os.Parcelable { + @FlaggedApi("android.credentials.flags.configurable_selector_ui_enabled") public final class DisabledProviderData extends android.credentials.selection.ProviderData implements android.os.Parcelable { ctor public DisabledProviderData(@NonNull String); - field @NonNull public static final android.os.Parcelable.Creator CREATOR; + field @NonNull public static final android.os.Parcelable.Creator CREATOR; } - public final class Entry implements android.os.Parcelable { - ctor public Entry(@NonNull String, @NonNull String, @NonNull android.app.slice.Slice); - ctor public Entry(@NonNull String, @NonNull String, @NonNull android.app.slice.Slice, @NonNull android.content.Intent); - method public int describeContents(); - method @Nullable public android.content.Intent getFrameworkExtrasIntent(); - method @NonNull public String getKey(); - method @Nullable public android.app.PendingIntent getPendingIntent(); - method @NonNull public android.app.slice.Slice getSlice(); - method @NonNull public String getSubkey(); - method public void writeToParcel(@NonNull android.os.Parcel, int); - field @NonNull public static final android.os.Parcelable.Creator CREATOR; + @FlaggedApi("android.credentials.flags.configurable_selector_ui_enabled") public final class FailureDialogResult extends android.credentials.selection.BaseDialogResult implements android.os.Parcelable { + ctor public FailureDialogResult(@Nullable android.os.IBinder, @Nullable String); + method public static void addToBundle(@NonNull android.credentials.selection.FailureDialogResult, @NonNull android.os.Bundle); + method @Nullable public static android.credentials.selection.FailureDialogResult fromResultData(@NonNull android.os.Bundle); + method @Nullable public String getErrorMessage(); + field @NonNull public static final android.os.Parcelable.Creator CREATOR; } - public final class GetCredentialProviderData extends android.credentials.ui.ProviderData implements android.os.Parcelable { - ctor public GetCredentialProviderData(@NonNull String, @NonNull java.util.List, @NonNull java.util.List, @NonNull java.util.List, @Nullable android.credentials.ui.Entry); - method @NonNull public java.util.List getActionChips(); - method @NonNull public java.util.List getAuthenticationEntries(); - method @NonNull public java.util.List getCredentialEntries(); - method @Nullable public android.credentials.ui.Entry getRemoteEntry(); - field @NonNull public static final android.os.Parcelable.Creator CREATOR; + @FlaggedApi("android.credentials.flags.configurable_selector_ui_enabled") public final class GetCredentialProviderData extends android.credentials.selection.ProviderData implements android.os.Parcelable { + ctor public GetCredentialProviderData(@NonNull String, @NonNull java.util.List, @NonNull java.util.List, @NonNull java.util.List, @Nullable android.credentials.selection.Entry); + method @NonNull public java.util.List getActionChips(); + method @NonNull public java.util.List getAuthenticationEntries(); + method @NonNull public java.util.List getCredentialEntries(); + method @Nullable public android.credentials.selection.Entry getRemoteEntry(); + field @NonNull public static final android.os.Parcelable.Creator CREATOR; } - public static final class GetCredentialProviderData.Builder { + @FlaggedApi("android.credentials.flags.configurable_selector_ui_enabled") public static final class GetCredentialProviderData.Builder { ctor public GetCredentialProviderData.Builder(@NonNull String); - method @NonNull public android.credentials.ui.GetCredentialProviderData build(); - method @NonNull public android.credentials.ui.GetCredentialProviderData.Builder setActionChips(@NonNull java.util.List); - method @NonNull public android.credentials.ui.GetCredentialProviderData.Builder setAuthenticationEntries(@NonNull java.util.List); - method @NonNull public android.credentials.ui.GetCredentialProviderData.Builder setCredentialEntries(@NonNull java.util.List); - method @NonNull public android.credentials.ui.GetCredentialProviderData.Builder setRemoteEntry(@Nullable android.credentials.ui.Entry); + method @NonNull public android.credentials.selection.GetCredentialProviderData build(); + method @NonNull public android.credentials.selection.GetCredentialProviderData.Builder setActionChips(@NonNull java.util.List); + method @NonNull public android.credentials.selection.GetCredentialProviderData.Builder setAuthenticationEntries(@NonNull java.util.List); + method @NonNull public android.credentials.selection.GetCredentialProviderData.Builder setCredentialEntries(@NonNull java.util.List); + method @NonNull public android.credentials.selection.GetCredentialProviderData.Builder setRemoteEntry(@Nullable android.credentials.selection.Entry); } - public class IntentFactory { - method @NonNull public static android.content.Intent createCredentialSelectorIntent(@NonNull android.credentials.ui.RequestInfo, @NonNull java.util.ArrayList, @NonNull java.util.ArrayList, @NonNull android.os.ResultReceiver); + @FlaggedApi("android.credentials.flags.configurable_selector_ui_enabled") public class IntentFactory { + method @NonNull public static android.content.Intent createCancelUiIntent(@NonNull android.os.IBinder, boolean, @NonNull String); + method @NonNull public static android.content.Intent createCredentialSelectorIntent(@NonNull android.content.Context, @NonNull android.credentials.selection.RequestInfo, @NonNull java.util.ArrayList, @NonNull java.util.ArrayList, @NonNull android.os.ResultReceiver); } - public abstract class ProviderData implements android.os.Parcelable { + @FlaggedApi("android.credentials.flags.configurable_selector_ui_enabled") public abstract class ProviderData implements android.os.Parcelable { ctor public ProviderData(@NonNull String); ctor protected ProviderData(@NonNull android.os.Parcel); method public int describeContents(); method @NonNull public String getProviderFlattenedComponentName(); method public void writeToParcel(@NonNull android.os.Parcel, int); - field public static final String EXTRA_DISABLED_PROVIDER_DATA_LIST = "android.credentials.ui.extra.DISABLED_PROVIDER_DATA_LIST"; - field public static final String EXTRA_ENABLED_PROVIDER_DATA_LIST = "android.credentials.ui.extra.ENABLED_PROVIDER_DATA_LIST"; + field public static final String EXTRA_DISABLED_PROVIDER_DATA_LIST = "android.credentials.selection.extra.DISABLED_PROVIDER_DATA_LIST"; + field public static final String EXTRA_ENABLED_PROVIDER_DATA_LIST = "android.credentials.selection.extra.ENABLED_PROVIDER_DATA_LIST"; } - public final class RequestInfo implements android.os.Parcelable { - method public int describeContents(); - method @NonNull public String getAppPackageName(); - method @Nullable public android.credentials.CreateCredentialRequest getCreateCredentialRequest(); - method @Nullable public android.credentials.GetCredentialRequest getGetCredentialRequest(); - method @NonNull public android.os.IBinder getToken(); - method @NonNull public String getType(); - method @NonNull public static android.credentials.ui.RequestInfo newCreateRequestInfo(@NonNull android.os.IBinder, @NonNull android.credentials.CreateCredentialRequest, @NonNull String); - method @NonNull public static android.credentials.ui.RequestInfo newGetRequestInfo(@NonNull android.os.IBinder, @NonNull android.credentials.GetCredentialRequest, @NonNull String); - method public void writeToParcel(@NonNull android.os.Parcel, int); - field @NonNull public static final android.os.Parcelable.Creator CREATOR; - field @NonNull public static final String EXTRA_REQUEST_INFO = "android.credentials.ui.extra.REQUEST_INFO"; - field @NonNull public static final String TYPE_CREATE = "android.credentials.ui.TYPE_CREATE"; - field @NonNull public static final String TYPE_GET = "android.credentials.ui.TYPE_GET"; - field @NonNull public static final String TYPE_UNDEFINED = "android.credentials.ui.TYPE_UNDEFINED"; + @FlaggedApi("android.credentials.flags.configurable_selector_ui_enabled") public final class RequestInfo implements android.os.Parcelable { + method @FlaggedApi("android.credentials.flags.configurable_selector_ui_enabled") @NonNull public static android.credentials.selection.RequestInfo newCreateRequestInfo(@NonNull android.os.IBinder, @NonNull android.credentials.CreateCredentialRequest, @NonNull String, boolean, @NonNull java.util.List, boolean); + method @FlaggedApi("android.credentials.flags.configurable_selector_ui_enabled") @NonNull public static android.credentials.selection.RequestInfo newGetRequestInfo(@NonNull android.os.IBinder, @NonNull android.credentials.GetCredentialRequest, @NonNull String, boolean, boolean); + } + + @FlaggedApi("android.credentials.flags.configurable_selector_ui_enabled") public final class RequestToken { + ctor @FlaggedApi("android.credentials.flags.configurable_selector_ui_enabled") public RequestToken(@NonNull android.os.IBinder); + } + + @FlaggedApi("android.credentials.flags.configurable_selector_ui_enabled") public final class UserSelectionDialogResult extends android.credentials.selection.BaseDialogResult implements android.os.Parcelable { + ctor public UserSelectionDialogResult(@Nullable android.os.IBinder, @NonNull String, @NonNull String, @NonNull String); + ctor public UserSelectionDialogResult(@Nullable android.os.IBinder, @NonNull String, @NonNull String, @NonNull String, @Nullable android.credentials.selection.ProviderPendingIntentResponse); + method public static void addToBundle(@NonNull android.credentials.selection.UserSelectionDialogResult, @NonNull android.os.Bundle); + method @Nullable public static android.credentials.selection.UserSelectionDialogResult fromResultData(@NonNull android.os.Bundle); + method @NonNull public String getEntryKey(); + method @NonNull public String getEntrySubkey(); + method @Nullable public android.credentials.selection.ProviderPendingIntentResponse getPendingIntentProviderResponse(); + method @NonNull public String getProviderId(); + field @NonNull public static final android.os.Parcelable.Creator CREATOR; } } @@ -1464,6 +1520,7 @@ package android.hardware { public final class SensorPrivacyManager { method @RequiresPermission(android.Manifest.permission.MANAGE_SENSOR_PRIVACY) public void setSensorPrivacy(int, int, boolean); + method @FlaggedApi("com.android.internal.camera.flags.camera_privacy_allowlist") @RequiresPermission(android.Manifest.permission.MANAGE_SENSOR_PRIVACY) public void setSensorPrivacyState(int, int, int); } public static class SensorPrivacyManager.Sources { @@ -1490,8 +1547,13 @@ package android.hardware.biometrics { method public boolean isAllowBackgroundAuthentication(); } + public abstract static class BiometricPrompt.AuthenticationCallback { + method @FlaggedApi("android.hardware.biometrics.face_background_authentication") public void onAuthenticationAcquired(int); + } + public static class BiometricPrompt.Builder { method @NonNull @RequiresPermission(anyOf={android.Manifest.permission.TEST_BIOMETRIC, "android.permission.USE_BIOMETRIC_INTERNAL"}) public android.hardware.biometrics.BiometricPrompt.Builder setAllowBackgroundAuthentication(boolean); + method @FlaggedApi("android.multiuser.enable_biometrics_to_unlock_private_space") @NonNull @RequiresPermission(anyOf={android.Manifest.permission.TEST_BIOMETRIC, "android.permission.USE_BIOMETRIC_INTERNAL"}) public android.hardware.biometrics.BiometricPrompt.Builder setAllowBackgroundAuthentication(boolean, boolean); method @NonNull @RequiresPermission(anyOf={android.Manifest.permission.TEST_BIOMETRIC, "android.permission.USE_BIOMETRIC_INTERNAL"}) public android.hardware.biometrics.BiometricPrompt.Builder setAllowedSensorIds(@NonNull java.util.List); } @@ -1507,6 +1569,7 @@ package android.hardware.biometrics { } public class SensorProperties { + ctor @FlaggedApi("android.hardware.biometrics.face_background_authentication") public SensorProperties(int, int, @NonNull java.util.List); method @NonNull public java.util.List getComponentInfo(); method public int getSensorId(); method public int getSensorStrength(); @@ -1564,22 +1627,26 @@ package android.hardware.camera2.params { package android.hardware.devicestate { - public final class DeviceStateManager { + @FlaggedApi("android.hardware.devicestate.feature.flags.device_state_property_api") public final class DeviceState { + ctor @Deprecated public DeviceState(@IntRange(from=android.hardware.devicestate.DeviceStateManager.MINIMUM_DEVICE_STATE_IDENTIFIER, to=android.hardware.devicestate.DeviceStateManager.MAXIMUM_DEVICE_STATE_IDENTIFIER) int, @NonNull String, int); + ctor public DeviceState(@IntRange(from=android.hardware.devicestate.DeviceStateManager.MINIMUM_DEVICE_STATE_IDENTIFIER, to=android.hardware.devicestate.DeviceStateManager.MAXIMUM_DEVICE_STATE_IDENTIFIER) int, @NonNull String, @NonNull java.util.Set); + field public static final int PROPERTY_POLICY_AVAILABLE_FOR_APP_REQUEST = 8; // 0x8 + } + + @FlaggedApi("android.hardware.devicestate.feature.flags.device_state_property_api") public final class DeviceStateManager { method @RequiresPermission(android.Manifest.permission.CONTROL_DEVICE_STATE) public void cancelBaseStateOverride(); method @RequiresPermission(value=android.Manifest.permission.CONTROL_DEVICE_STATE, conditional=true) public void cancelStateRequest(); - method @NonNull public int[] getSupportedStates(); - method public void registerCallback(@NonNull java.util.concurrent.Executor, @NonNull android.hardware.devicestate.DeviceStateManager.DeviceStateCallback); + method @Deprecated @NonNull public int[] getSupportedStates(); method @RequiresPermission(android.Manifest.permission.CONTROL_DEVICE_STATE) public void requestBaseStateOverride(@NonNull android.hardware.devicestate.DeviceStateRequest, @Nullable java.util.concurrent.Executor, @Nullable android.hardware.devicestate.DeviceStateRequest.Callback); method @RequiresPermission(value=android.Manifest.permission.CONTROL_DEVICE_STATE, conditional=true) public void requestState(@NonNull android.hardware.devicestate.DeviceStateRequest, @Nullable java.util.concurrent.Executor, @Nullable android.hardware.devicestate.DeviceStateRequest.Callback); - method public void unregisterCallback(@NonNull android.hardware.devicestate.DeviceStateManager.DeviceStateCallback); - field public static final int MAXIMUM_DEVICE_STATE = 255; // 0xff - field public static final int MINIMUM_DEVICE_STATE = 0; // 0x0 + field public static final int MAXIMUM_DEVICE_STATE_IDENTIFIER = 10000; // 0x2710 + field public static final int MINIMUM_DEVICE_STATE_IDENTIFIER = 0; // 0x0 } public static interface DeviceStateManager.DeviceStateCallback { - method public default void onBaseStateChanged(int); - method public void onStateChanged(int); - method public default void onSupportedStatesChanged(@NonNull int[]); + method @Deprecated public default void onBaseStateChanged(int); + method @Deprecated public void onStateChanged(int); + method @Deprecated public default void onSupportedStatesChanged(@NonNull int[]); } public final class DeviceStateRequest { @@ -1642,6 +1709,19 @@ package android.hardware.display { field public static final int SWITCHING_TYPE_WITHIN_GROUPS = 1; // 0x1 field public static final int VIRTUAL_DISPLAY_FLAG_OWN_FOCUS = 16384; // 0x4000 field public static final int VIRTUAL_DISPLAY_FLAG_SHOULD_SHOW_SYSTEM_DECORATIONS = 512; // 0x200 + field public static final int VIRTUAL_DISPLAY_FLAG_SUPPORTS_TOUCH = 64; // 0x40 + } + +} + +package android.hardware.face { + + @FlaggedApi("android.hardware.biometrics.face_background_authentication") public class FaceManager { + method @FlaggedApi("android.hardware.biometrics.face_background_authentication") @NonNull @RequiresPermission(android.Manifest.permission.TEST_BIOMETRIC) public android.hardware.biometrics.BiometricTestSession createTestSession(int); + method @FlaggedApi("android.hardware.biometrics.face_background_authentication") @NonNull public java.util.List getSensorProperties(); + } + + @FlaggedApi("android.hardware.biometrics.face_background_authentication") public class FaceSensorProperties extends android.hardware.biometrics.SensorProperties { } } @@ -1699,6 +1779,10 @@ package android.hardware.input { field public static final int DEFAULT_POINTER_SPEED = 0; // 0x0 } + public class VirtualKeyboard implements java.io.Closeable { + method public int getInputDeviceId(); + } + } package android.hardware.lights { @@ -1785,6 +1869,14 @@ package android.hardware.soundtrigger { } +package android.hardware.usb { + + public final class UsbPort { + method @FlaggedApi("android.hardware.usb.flags.enable_is_mode_change_supported_api") @RequiresPermission(android.Manifest.permission.MANAGE_USB) public boolean isModeChangeSupported(); + } + +} + package android.inputmethodservice { public abstract class AbstractInputMethodService extends android.window.WindowProviderService implements android.view.KeyEvent.Callback { @@ -1860,6 +1952,7 @@ package android.media { method @FlaggedApi("android.media.audio.focus_freeze_test_api") @RequiresPermission("android.permission.QUERY_AUDIO_STATE") public long getFocusUnmuteDelayAfterFadeOutForTest(); method @Nullable public static android.media.AudioHalVersionInfo getHalVersion(); method public static final int[] getPublicStreamTypes(); + method @FlaggedApi("android.media.audiopolicy.audio_mix_test_api") @NonNull public java.util.List getRegisteredPolicyMixes(); method @NonNull public java.util.List getReportedSurroundFormats(); method @RequiresPermission(android.Manifest.permission.MODIFY_AUDIO_SETTINGS_PRIVILEGED) public float getRs2Value(); method public int getStreamMinVolumeInt(int); @@ -1875,6 +1968,7 @@ package android.media { method public void setRampingRingerEnabled(boolean); method @RequiresPermission(android.Manifest.permission.MODIFY_AUDIO_SETTINGS_PRIVILEGED) public void setRs2Value(float); method @RequiresPermission(android.Manifest.permission.MODIFY_AUDIO_ROUTING) public void setTestDeviceConnectionState(@NonNull android.media.AudioDeviceAttributes, boolean); + method @FlaggedApi("android.media.audio.focus_exclusive_with_recording") @RequiresPermission(android.Manifest.permission.QUERY_AUDIO_STATE) public boolean shouldNotificationSoundPlay(@NonNull android.media.AudioAttributes); } public static final class AudioRecord.MetricsConstants { @@ -1954,41 +2048,6 @@ package android.media { method public android.media.PlaybackParams setAudioStretchMode(int); } - @FlaggedApi("android.os.vibrator.haptics_customization_enabled") public final class RingtoneSelection { - method @NonNull public static android.media.RingtoneSelection fromUri(@Nullable android.net.Uri, int); - method public int getSoundSource(); - method @Nullable public android.net.Uri getSoundUri(); - method public int getVibrationSource(); - method @Nullable public android.net.Uri getVibrationUri(); - method public static boolean isRingtoneSelectionUri(@Nullable android.net.Uri); - method @NonNull public android.net.Uri toUri(); - field public static final String DEFAULT_SELECTION_URI_STRING = "content://media/ringtone"; - field public static final int FROM_URI_RINGTONE_SELECTION_ONLY = 3; // 0x3 - field public static final int FROM_URI_RINGTONE_SELECTION_OR_SOUND = 1; // 0x1 - field public static final int FROM_URI_RINGTONE_SELECTION_OR_VIBRATION = 2; // 0x2 - field public static final int SOUND_SOURCE_OFF = 1; // 0x1 - field public static final int SOUND_SOURCE_SYSTEM_DEFAULT = 3; // 0x3 - field public static final int SOUND_SOURCE_UNSPECIFIED = 0; // 0x0 - field public static final int SOUND_SOURCE_URI = 2; // 0x2 - field public static final int VIBRATION_SOURCE_APPLICATION_DEFAULT = 4; // 0x4 - field public static final int VIBRATION_SOURCE_AUDIO_CHANNEL = 10; // 0xa - field public static final int VIBRATION_SOURCE_HAPTIC_GENERATOR = 11; // 0xb - field public static final int VIBRATION_SOURCE_OFF = 1; // 0x1 - field public static final int VIBRATION_SOURCE_SYSTEM_DEFAULT = 3; // 0x3 - field public static final int VIBRATION_SOURCE_UNSPECIFIED = 0; // 0x0 - field public static final int VIBRATION_SOURCE_URI = 2; // 0x2 - } - - @FlaggedApi("android.os.vibrator.haptics_customization_enabled") public static final class RingtoneSelection.Builder { - ctor public RingtoneSelection.Builder(); - ctor public RingtoneSelection.Builder(@NonNull android.media.RingtoneSelection); - method @NonNull public android.media.RingtoneSelection build(); - method @NonNull public android.media.RingtoneSelection.Builder setSoundSource(int); - method @NonNull public android.media.RingtoneSelection.Builder setSoundSource(@NonNull android.net.Uri); - method @NonNull public android.media.RingtoneSelection.Builder setVibrationSource(int); - method @NonNull public android.media.RingtoneSelection.Builder setVibrationSource(@NonNull android.net.Uri); - } - public static final class VolumeShaper.Configuration.Builder { method @NonNull public android.media.VolumeShaper.Configuration.Builder setOptionFlags(int); } @@ -2032,6 +2091,10 @@ package android.media.audiofx { package android.media.audiopolicy { + public class AudioPolicy { + method @FlaggedApi("android.media.audiopolicy.audio_mix_test_api") @NonNull public java.util.List getMixes(); + } + public static class AudioPolicy.Builder { method @NonNull public android.media.audiopolicy.AudioPolicy.Builder setIsTestFocusPolicy(boolean); } @@ -2053,6 +2116,14 @@ package android.media.metrics { } +package android.media.projection { + + public final class MediaProjectionManager { + method @NonNull public android.content.Intent createScreenCaptureIntent(@NonNull android.app.ActivityOptions.LaunchCookie); + } + +} + package android.media.soundtrigger { public final class SoundTriggerInstrumentation { @@ -2140,7 +2211,7 @@ package android.media.tv.tuner { package android.media.voice { public final class KeyphraseModelManager { - method @RequiresPermission("android.permission.MANAGE_VOICE_KEYPHRASES") public void setModelDatabaseForTestEnabled(boolean); + method @RequiresPermission(android.Manifest.permission.MANAGE_VOICE_KEYPHRASES) public void setModelDatabaseForTestEnabled(boolean); } } @@ -2200,9 +2271,7 @@ package android.os { } public final class BugreportParams { - field @FlaggedApi("android.app.admin.flags.onboarding_bugreport_v2_enabled") public static final int BUGREPORT_FLAG_KEEP_BUGREPORT_ON_RETRIEVAL = 4; // 0x4 field @FlaggedApi("android.os.bugreport_mode_max_value") public static final int BUGREPORT_MODE_MAX_VALUE = 7; // 0x7 - field @FlaggedApi("android.app.admin.flags.onboarding_bugreport_v2_enabled") public static final int BUGREPORT_MODE_ONBOARDING = 7; // 0x7 } public class Build { @@ -2336,6 +2405,9 @@ package android.os { field public static final int CPU_LOAD_RESET = 2; // 0x2 field public static final int CPU_LOAD_RESUME = 3; // 0x3 field public static final int CPU_LOAD_UP = 0; // 0x0 + field @FlaggedApi("android.os.adpf_gpu_report_actual_work_duration") public static final int GPU_LOAD_DOWN = 6; // 0x6 + field @FlaggedApi("android.os.adpf_gpu_report_actual_work_duration") public static final int GPU_LOAD_RESET = 7; // 0x7 + field @FlaggedApi("android.os.adpf_gpu_report_actual_work_duration") public static final int GPU_LOAD_UP = 5; // 0x5 } public final class PowerManager { @@ -2347,9 +2419,7 @@ package android.os { } public class Process { - method public static final int getAppUidForSdkSandboxUid(int); method public static final int getThreadScheduler(int) throws java.lang.IllegalArgumentException; - method public static final boolean isSdkSandboxUid(int); method public static final int toSdkSandboxUid(int); field public static final int FIRST_APP_ZYGOTE_ISOLATED_UID = 90000; // 0x15f90 field public static final int FIRST_ISOLATED_UID = 99000; // 0x182b8 @@ -2420,7 +2490,6 @@ package android.os { method public boolean isVisibleBackgroundUsersOnDefaultDisplaySupported(); method public boolean isVisibleBackgroundUsersSupported(); method @Deprecated @NonNull @RequiresPermission(anyOf={android.Manifest.permission.MANAGE_USERS, android.Manifest.permission.CREATE_USERS}) public android.content.pm.UserInfo preCreateUser(@NonNull String) throws android.os.UserManager.UserOperationException; - field @FlaggedApi("android.os.allow_private_profile") public static final String USER_TYPE_PROFILE_PRIVATE = "android.os.usertype.profile.PRIVATE"; } public final class VibrationAttributes implements android.os.Parcelable { @@ -2666,17 +2735,17 @@ package android.os.vibrator { package android.os.vibrator.persistence { - @FlaggedApi("android.os.vibrator.enable_vibration_serialization_apis") public class ParsedVibration { + public class ParsedVibration { method @NonNull public java.util.List getVibrationEffects(); method @Nullable public android.os.VibrationEffect resolve(@NonNull android.os.Vibrator); } - @FlaggedApi("android.os.vibrator.enable_vibration_serialization_apis") public final class VibrationXmlParser { + public final class VibrationXmlParser { method @Nullable public static android.os.vibrator.persistence.ParsedVibration parseDocument(@NonNull java.io.Reader) throws java.io.IOException; method @Nullable public static android.os.VibrationEffect parseVibrationEffect(@NonNull java.io.Reader) throws java.io.IOException; } - @FlaggedApi("android.os.vibrator.enable_vibration_serialization_apis") public final class VibrationXmlSerializer { + public final class VibrationXmlSerializer { method public static void serialize(@NonNull android.os.VibrationEffect, @NonNull java.io.Writer) throws java.io.IOException, android.os.vibrator.persistence.VibrationXmlSerializer.SerializationFailedException; } @@ -2986,6 +3055,14 @@ package android.service.autofill.augmented { } +package android.service.chooser { + + @FlaggedApi("android.service.chooser.enable_chooser_result") public final class ChooserResult implements android.os.Parcelable { + ctor public ChooserResult(int, @Nullable android.content.ComponentName, boolean); + } + +} + package android.service.dreams { public abstract class DreamOverlayService extends android.app.Service { @@ -3015,6 +3092,22 @@ package android.service.notification { method @Deprecated public boolean isBound(); } + @FlaggedApi("android.app.modes_api") public final class ZenDeviceEffects implements android.os.Parcelable { + method @NonNull public java.util.Set getExtraEffects(); + } + + @FlaggedApi("android.app.modes_api") public static final class ZenDeviceEffects.Builder { + method @NonNull public android.service.notification.ZenDeviceEffects.Builder setExtraEffects(@NonNull java.util.Set); + } + + public final class ZenPolicy implements android.os.Parcelable { + method @FlaggedApi("android.app.modes_api") @NonNull public android.service.notification.ZenPolicy overwrittenWith(@Nullable android.service.notification.ZenPolicy); + } + + public static final class ZenPolicy.Builder { + ctor public ZenPolicy.Builder(@Nullable android.service.notification.ZenPolicy); + } + } package android.service.quickaccesswallet { @@ -3079,6 +3172,7 @@ package android.service.voice { method @NonNull public android.service.voice.AlwaysOnHotwordDetector.EventPayload.Builder setDataFormat(int); method @NonNull public android.service.voice.AlwaysOnHotwordDetector.EventPayload.Builder setHalEventReceivedMillis(long); method @NonNull public android.service.voice.AlwaysOnHotwordDetector.EventPayload.Builder setHotwordDetectedResult(@NonNull android.service.voice.HotwordDetectedResult); + method @FlaggedApi("android.app.wearable.enable_hotword_wearable_sensing_api") @NonNull public android.service.voice.AlwaysOnHotwordDetector.EventPayload.Builder setIsRecognitionStopped(boolean); method @NonNull public android.service.voice.AlwaysOnHotwordDetector.EventPayload.Builder setKeyphraseRecognitionExtras(@NonNull java.util.List); } @@ -3106,7 +3200,6 @@ package android.service.voice { method @NonNull @RequiresPermission(android.Manifest.permission.MANAGE_HOTWORD_DETECTION) public final android.service.voice.AlwaysOnHotwordDetector createAlwaysOnHotwordDetectorForTest(@NonNull String, @NonNull java.util.Locale, @NonNull android.hardware.soundtrigger.SoundTrigger.ModuleProperties, @NonNull java.util.concurrent.Executor, @NonNull android.service.voice.AlwaysOnHotwordDetector.Callback); method @NonNull @RequiresPermission(android.Manifest.permission.MANAGE_HOTWORD_DETECTION) public final android.service.voice.AlwaysOnHotwordDetector createAlwaysOnHotwordDetectorForTest(@NonNull String, @NonNull java.util.Locale, @Nullable android.os.PersistableBundle, @Nullable android.os.SharedMemory, @NonNull android.hardware.soundtrigger.SoundTrigger.ModuleProperties, @NonNull java.util.concurrent.Executor, @NonNull android.service.voice.AlwaysOnHotwordDetector.Callback); method @NonNull public final java.util.List listModuleProperties(); - method @FlaggedApi("android.service.voice.flags.allow_training_data_egress_from_hds") @RequiresPermission(android.Manifest.permission.RESET_HOTWORD_TRAINING_DATA_EGRESS_COUNT) public final void resetHotwordTrainingDataEgressCountForTest(); method public final void setTestModuleForAlwaysOnHotwordDetectorEnabled(boolean); } @@ -3238,12 +3331,11 @@ package android.telephony { method @NonNull public android.util.Pair getHalVersion(int); method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public String getLine1AlphaTag(); method @Deprecated public android.util.Pair getRadioHalVersion(); - method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isDomainSelectionSupported(); method public boolean modifyDevicePolicyOverrideApn(@NonNull android.content.Context, int, @NonNull android.telephony.data.ApnSetting); method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void refreshUiccProfile(); method @Deprecated public void setCarrierTestOverride(String, String, String, String, String, String, String); method public void setCarrierTestOverride(String, String, String, String, String, String, String, String, String); - method @RequiresPermission(android.Manifest.permission.BIND_TELECOM_CONNECTION_SERVICE) public void setVoiceServiceStateOverride(boolean); + method @FlaggedApi("com.android.server.telecom.flags.telecom_resolve_hidden_dependencies") @RequiresPermission(android.Manifest.permission.BIND_TELECOM_CONNECTION_SERVICE) public void setVoiceServiceStateOverride(boolean); field public static final int HAL_SERVICE_DATA = 1; // 0x1 field public static final int HAL_SERVICE_IMS = 7; // 0x7 field public static final int HAL_SERVICE_MESSAGING = 2; // 0x2 @@ -3489,6 +3581,7 @@ package android.view { public final class Display { method @RequiresPermission(android.Manifest.permission.MODIFY_USER_PREFERRED_DISPLAY_MODE) public void clearUserPreferredDisplayMode(); method @NonNull public android.view.Display.Mode getDefaultMode(); + method public int getRemoveMode(); method @NonNull public int[] getReportedHdrTypes(); method @NonNull public android.graphics.ColorSpace[] getSupportedWideColorGamut(); method @Nullable public android.view.Display.Mode getSystemPreferredDisplayMode(); @@ -3545,7 +3638,7 @@ package android.view { method public final int getDisplayId(); method public final void setDisplayId(int); field public static final int FLAG_IS_ACCESSIBILITY_EVENT = 2048; // 0x800 - field public static final int LAST_KEYCODE = 316; // 0x13c + field public static final int LAST_KEYCODE = 318; // 0x13e } public final class KeyboardShortcutGroup implements android.os.Parcelable { @@ -3619,8 +3712,13 @@ package android.view { method @Nullable public android.view.View getStatusBarBackgroundView(); } + public static final class WindowInsets.Type { + method @NonNull public static String toString(int); + } + public interface WindowManager extends android.view.ViewManager { method public default int getDisplayImePolicy(int); + method @FlaggedApi("com.android.window.flags.surface_control_input_receiver") @Nullable public default android.os.IBinder getSurfaceControlInputClientToken(@NonNull android.view.SurfaceControl); method public static boolean hasWindowExtensionsEnabled(); method public default void holdLock(android.os.IBinder, int); method public default boolean isGlobalKey(int); @@ -3682,6 +3780,7 @@ package android.view.animation { public class AnimationUtils { method @FlaggedApi("android.view.flags.expected_presentation_time_read_only") public static void lockAnimationClock(long, long); + method public static void lockAnimationClock(long); method public static void unlockAnimationClock(); } @@ -3847,7 +3946,8 @@ package android.view.inputmethod { } public final class InputMethodInfo implements android.os.Parcelable { - ctor public InputMethodInfo(@NonNull String, @NonNull String, @NonNull CharSequence, @NonNull String, boolean, @NonNull String); + ctor public InputMethodInfo(@NonNull String, @NonNull String, @NonNull CharSequence, @NonNull String, @NonNull String, boolean, @NonNull String); + ctor @FlaggedApi("android.view.inputmethod.connectionless_handwriting") public InputMethodInfo(@NonNull String, @NonNull String, @NonNull CharSequence, @NonNull String, @NonNull String, boolean, boolean, @NonNull String); ctor public InputMethodInfo(@NonNull String, @NonNull String, @NonNull CharSequence, @NonNull String, int); field public static final int COMPONENT_NAME_MAX_LENGTH = 1000; // 0x3e8 field public static final int MAX_IMES_PER_PACKAGE = 20; // 0x14 @@ -3861,6 +3961,7 @@ package android.view.inputmethod { method @NonNull @RequiresPermission(value=android.Manifest.permission.INTERACT_ACROSS_USERS_FULL, conditional=true) public java.util.List getInputMethodListAsUser(int); method public boolean hasActiveInputConnection(@Nullable android.view.View); method @RequiresPermission(android.Manifest.permission.TEST_INPUT_METHOD) public boolean hasPendingImeVisibilityRequests(); + method @RequiresPermission(android.Manifest.permission.TEST_INPUT_METHOD) public void hideSoftInputFromServerForTest(); method @RequiresPermission(android.Manifest.permission.TEST_INPUT_METHOD) public boolean isCurrentRootView(@NonNull android.view.View); method @RequiresPermission(android.Manifest.permission.TEST_INPUT_METHOD) public boolean isInputMethodPickerShown(); method @FlaggedApi("android.view.inputmethod.imm_userhandle_hostsidetests") @NonNull @RequiresPermission(value=android.Manifest.permission.INTERACT_ACROSS_USERS_FULL, conditional=true) public boolean isStylusHandwritingAvailableAsUser(@NonNull android.os.UserHandle); diff --git a/core/api/test-lint-baseline.txt b/core/api/test-lint-baseline.txt index bf26bd0a0ec62dab77636cb1b256aebf4a7df133..685ea63cb432707e58ebcc6ec1a33078088e485f 100644 --- a/core/api/test-lint-baseline.txt +++ b/core/api/test-lint-baseline.txt @@ -535,6 +535,10 @@ MissingNullability: android.widget.ImageView#isDefaultFocusHighlightNeeded(andro Missing nullability on parameter `foreground` in method `isDefaultFocusHighlightNeeded` +OptionalBuilderConstructorArgument: android.service.notification.ZenPolicy.Builder#Builder(android.service.notification.ZenPolicy) parameter #0: + Builder constructor arguments must be mandatory (i.e. not @Nullable): parameter policy in android.service.notification.ZenPolicy.Builder(android.service.notification.ZenPolicy policy) + + ProtectedMember: android.app.AppDetailsActivity#onCreate(android.os.Bundle): Protected methods not allowed; must be public: method android.app.AppDetailsActivity.onCreate(android.os.Bundle)} ProtectedMember: android.view.ViewGroup#resetResolvedDrawables(): @@ -669,6 +673,8 @@ RequiresPermission: android.app.admin.DevicePolicyManager#generateKeyPair(androi Method 'generateKeyPair' documentation mentions permissions already declared by @RequiresPermission RequiresPermission: android.app.admin.DevicePolicyManager#getApplicationExemptions(String): Method 'getApplicationExemptions' documentation mentions permissions already declared by @RequiresPermission +RequiresPermission: android.app.admin.DevicePolicyManager#getContentProtectionPolicy(android.content.ComponentName): + Method 'getContentProtectionPolicy' documentation mentions permissions already declared by @RequiresPermission RequiresPermission: android.app.admin.DevicePolicyManager#getCrossProfileWidgetProviders(android.content.ComponentName): Method 'getCrossProfileWidgetProviders' documentation mentions permissions already declared by @RequiresPermission RequiresPermission: android.app.admin.DevicePolicyManager#getLockTaskFeatures(android.content.ComponentName): @@ -717,6 +723,8 @@ RequiresPermission: android.app.admin.DevicePolicyManager#setAlwaysOnVpnPackage( Method 'setAlwaysOnVpnPackage' documentation mentions permissions without declaring @RequiresPermission RequiresPermission: android.app.admin.DevicePolicyManager#setApplicationExemptions(String, java.util.Set): Method 'setApplicationExemptions' documentation mentions permissions already declared by @RequiresPermission +RequiresPermission: android.app.admin.DevicePolicyManager#setContentProtectionPolicy(android.content.ComponentName, int): + Method 'setContentProtectionPolicy' documentation mentions permissions already declared by @RequiresPermission RequiresPermission: android.app.admin.DevicePolicyManager#setDeviceOwner(android.content.ComponentName, int): Method 'setDeviceOwner' documentation mentions permissions already declared by @RequiresPermission RequiresPermission: android.app.admin.DevicePolicyManager#setDeviceProvisioningConfigApplied(): @@ -1923,6 +1931,8 @@ Todo: android.Manifest.permission#READ_PEOPLE_DATA: Documentation mentions 'TODO' Todo: android.app.NotificationManager#isNotificationAssistantAccessGranted(android.content.ComponentName): Documentation mentions 'TODO' +Todo: android.app.ondeviceintelligence.OnDeviceIntelligenceManager#requestFeatureDownload(android.app.ondeviceintelligence.Feature, android.app.ondeviceintelligence.CancellationSignal, java.util.concurrent.Executor, android.app.ondeviceintelligence.DownloadCallback): + Documentation mentions 'TODO' Todo: android.hardware.camera2.params.StreamConfigurationMap: Documentation mentions 'TODO' Todo: android.hardware.location.ContextHubManager#getNanoAppInstanceInfo(int): @@ -2009,6 +2019,12 @@ UnflaggedApi: android.content.AttributionSource#AttributionSource(int, int, Stri New API must be flagged with @FlaggedApi: constructor android.content.AttributionSource(int,int,String,String,android.os.IBinder,String[],android.content.AttributionSource) UnflaggedApi: android.content.AttributionSource#AttributionSource(int, int, String, String, android.os.IBinder, String[], int, android.content.AttributionSource): New API must be flagged with @FlaggedApi: constructor android.content.AttributionSource(int,int,String,String,android.os.IBinder,String[],int,android.content.AttributionSource) +UnflaggedApi: android.content.Intent#EXTENDED_FLAG_FILTER_MISMATCH: + New API must be flagged with @FlaggedApi: field android.content.Intent.EXTENDED_FLAG_FILTER_MISMATCH +UnflaggedApi: android.content.Intent#addExtendedFlags(int): + New API must be flagged with @FlaggedApi: method android.content.Intent.addExtendedFlags(int) +UnflaggedApi: android.content.Intent#getExtendedFlags(): + New API must be flagged with @FlaggedApi: method android.content.Intent.getExtendedFlags() UnflaggedApi: android.content.pm.UserInfo#isCommunalProfile(): New API must be flagged with @FlaggedApi: method android.content.pm.UserInfo.isCommunalProfile() UnflaggedApi: android.content.pm.UserInfo#isPrivateProfile(): @@ -2039,14 +2055,8 @@ UnflaggedApi: android.media.RingtoneSelection#SOUND_SOURCE_DEFAULT: New API must be flagged with @FlaggedApi: field android.media.RingtoneSelection.SOUND_SOURCE_DEFAULT UnflaggedApi: android.media.RingtoneSelection#SOUND_SOURCE_OFF: New API must be flagged with @FlaggedApi: field android.media.RingtoneSelection.SOUND_SOURCE_OFF -UnflaggedApi: android.media.RingtoneSelection#SOUND_SOURCE_SYSTEM_DEFAULT: - New API must be flagged with @FlaggedApi: field android.media.RingtoneSelection.SOUND_SOURCE_SYSTEM_DEFAULT -UnflaggedApi: android.media.RingtoneSelection#SOUND_SOURCE_UNSPECIFIED: - New API must be flagged with @FlaggedApi: field android.media.RingtoneSelection.SOUND_SOURCE_UNSPECIFIED UnflaggedApi: android.media.RingtoneSelection#SOUND_SOURCE_URI: New API must be flagged with @FlaggedApi: field android.media.RingtoneSelection.SOUND_SOURCE_URI -UnflaggedApi: android.media.RingtoneSelection#VIBRATION_SOURCE_APPLICATION_DEFAULT: - New API must be flagged with @FlaggedApi: field android.media.RingtoneSelection.VIBRATION_SOURCE_APPLICATION_DEFAULT UnflaggedApi: android.media.RingtoneSelection#VIBRATION_SOURCE_APPLICATION_PROVIDED: New API must be flagged with @FlaggedApi: field android.media.RingtoneSelection.VIBRATION_SOURCE_APPLICATION_PROVIDED UnflaggedApi: android.media.RingtoneSelection#VIBRATION_SOURCE_AUDIO_CHANNEL: @@ -2057,10 +2067,6 @@ UnflaggedApi: android.media.RingtoneSelection#VIBRATION_SOURCE_HAPTIC_GENERATOR: New API must be flagged with @FlaggedApi: field android.media.RingtoneSelection.VIBRATION_SOURCE_HAPTIC_GENERATOR UnflaggedApi: android.media.RingtoneSelection#VIBRATION_SOURCE_OFF: New API must be flagged with @FlaggedApi: field android.media.RingtoneSelection.VIBRATION_SOURCE_OFF -UnflaggedApi: android.media.RingtoneSelection#VIBRATION_SOURCE_SYSTEM_DEFAULT: - New API must be flagged with @FlaggedApi: field android.media.RingtoneSelection.VIBRATION_SOURCE_SYSTEM_DEFAULT -UnflaggedApi: android.media.RingtoneSelection#VIBRATION_SOURCE_UNSPECIFIED: - New API must be flagged with @FlaggedApi: field android.media.RingtoneSelection.VIBRATION_SOURCE_UNSPECIFIED UnflaggedApi: android.media.RingtoneSelection#VIBRATION_SOURCE_URI: New API must be flagged with @FlaggedApi: field android.media.RingtoneSelection.VIBRATION_SOURCE_URI UnflaggedApi: android.media.RingtoneSelection#fromUri(android.net.Uri, int): @@ -2143,6 +2149,8 @@ UnflaggedApi: android.service.notification.NotificationRankingUpdate#PARCELABLE_ New API must be flagged with @FlaggedApi: field android.service.notification.NotificationRankingUpdate.PARCELABLE_WRITE_RETURN_VALUE UnflaggedApi: android.service.notification.NotificationRankingUpdate#isFdNotNullAndClosed(): New API must be flagged with @FlaggedApi: method android.service.notification.NotificationRankingUpdate.isFdNotNullAndClosed() +UnflaggedApi: android.service.notification.ZenPolicy.Builder#Builder(android.service.notification.ZenPolicy): + New API must be flagged with @FlaggedApi: constructor android.service.notification.ZenPolicy.Builder(android.service.notification.ZenPolicy) UnflaggedApi: android.telephony.TelephonyManager#HAL_SERVICE_SATELLITE: New API must be flagged with @FlaggedApi: field android.telephony.TelephonyManager.HAL_SERVICE_SATELLITE UnflaggedApi: android.telephony.ims.feature.MmTelFeature.MmTelCapabilities: @@ -2179,6 +2187,8 @@ UnflaggedApi: android.view.accessibility.AccessibilityWindowInfo#UNDEFINED_WINDO New API must be flagged with @FlaggedApi: field android.view.accessibility.AccessibilityWindowInfo.UNDEFINED_WINDOW_ID UnflaggedApi: android.view.animation.AnimationUtils#lockAnimationClock(long, long): New API must be flagged with @FlaggedApi: method android.view.animation.AnimationUtils.lockAnimationClock(long,long) +UnflaggedApi: android.view.inputmethod.InputMethodInfo#InputMethodInfo(String, String, CharSequence, String, String, boolean, String): + New API must be flagged with @FlaggedApi: constructor android.view.inputmethod.InputMethodInfo(String,String,CharSequence,String,String,boolean,String) UnflaggedApi: android.view.inputmethod.InputMethodManager#getEnabledInputMethodListAsUser(android.os.UserHandle): New API must be flagged with @FlaggedApi: method android.view.inputmethod.InputMethodManager.getEnabledInputMethodListAsUser(android.os.UserHandle) UnflaggedApi: android.view.inputmethod.InputMethodManager#getEnabledInputMethodSubtypeListAsUser(String, boolean, android.os.UserHandle): diff --git a/core/java/Android.bp b/core/java/Android.bp index 0147910595e17890879a717d69081e2fd9674bee..fcfb731598b1553f4ae6c44854c40ffc0e51f153 100644 --- a/core/java/Android.bp +++ b/core/java/Android.bp @@ -126,6 +126,7 @@ filegroup { srcs: [ "android/os/IExternalVibrationController.aidl", "android/os/IExternalVibratorService.aidl", + "android/os/ExternalVibrationScale.aidl", ], } @@ -530,14 +531,10 @@ filegroup { ], } -// common protolog sources without classes that rely on Android SDK -filegroup { - name: "protolog-common-no-android-src", +java_library { + name: "protolog-group", srcs: [ - ":protolog-common-src", - ], - exclude_srcs: [ - "com/android/internal/protolog/common/ProtoLog.java", + "com/android/internal/protolog/common/IProtoLogGroup.java", ], } @@ -550,13 +547,22 @@ filegroup { ], } +filegroup { + name: "protolog-impl", + srcs: [ + "com/android/internal/protolog/ProtoLogImpl.java", + ], +} + java_library { name: "protolog-lib", platform_apis: true, srcs: [ "com/android/internal/protolog/ProtoLogImpl.java", "com/android/internal/protolog/ProtoLogViewerConfigReader.java", - ":protolog-common-src", + ], + static_libs: [ + "perfetto_trace_javastream_protos_jarjar", ], } diff --git a/core/java/android/accessibilityservice/AccessibilityService.java b/core/java/android/accessibilityservice/AccessibilityService.java index e7e3a8563319ffdc5b693014c51ff7da1ac67aab..d70fa19a4468758dac654d03429897dccb0b143d 100644 --- a/core/java/android/accessibilityservice/AccessibilityService.java +++ b/core/java/android/accessibilityservice/AccessibilityService.java @@ -69,6 +69,7 @@ import android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction; import android.view.accessibility.AccessibilityWindowInfo; import android.view.inputmethod.EditorInfo; +import com.android.internal.annotations.VisibleForTesting; import com.android.internal.inputmethod.CancellationGroup; import com.android.internal.inputmethod.IAccessibilityInputMethodSession; import com.android.internal.inputmethod.IAccessibilityInputMethodSessionCallback; @@ -850,6 +851,7 @@ public abstract class AccessibilityService extends Service { private boolean mInputMethodInitialized = false; private final SparseArray mAccessibilityButtonControllers = new SparseArray<>(0); + private BrailleDisplayController mBrailleDisplayController; private int mGestureStatusCallbackSequence; @@ -1385,7 +1387,9 @@ public abstract class AccessibilityService extends Service { getFingerprintGestureController().onGesture(gesture); } - int getConnectionId() { + /** @hide */ + @VisibleForTesting(visibility = VisibleForTesting.Visibility.PACKAGE) + public int getConnectionId() { return mConnectionId; } @@ -3634,4 +3638,20 @@ public abstract class AccessibilityService extends Service { .attachAccessibilityOverlayToWindow( mConnectionId, accessibilityWindowId, sc, executor, callback); } + + /** + * Returns the {@link BrailleDisplayController} which may be used to communicate with + * refreshable Braille displays that provide USB or Bluetooth Braille display HID support. + */ + @FlaggedApi(android.view.accessibility.Flags.FLAG_BRAILLE_DISPLAY_HID) + @NonNull + public BrailleDisplayController getBrailleDisplayController() { + BrailleDisplayController.checkApiFlagIsEnabled(); + synchronized (mLock) { + if (mBrailleDisplayController == null) { + mBrailleDisplayController = new BrailleDisplayControllerImpl(this, mLock); + } + return mBrailleDisplayController; + } + } } diff --git a/core/java/android/accessibilityservice/AccessibilityServiceInfo.java b/core/java/android/accessibilityservice/AccessibilityServiceInfo.java index fc342fa3431a9121f96d9c1b6b940a57fbdb250f..8bb28576f1e8c78edae3e0fd927af986c1a1613f 100644 --- a/core/java/android/accessibilityservice/AccessibilityServiceInfo.java +++ b/core/java/android/accessibilityservice/AccessibilityServiceInfo.java @@ -647,11 +647,44 @@ public class AccessibilityServiceInfo implements Parcelable { private int mObservedMotionEventSources = 0; + // Default values for each dynamic property + // LINT.IfChange(dynamic_property_defaults) + private final DynamicPropertyDefaults mDynamicPropertyDefaults; + + private static class DynamicPropertyDefaults { + private final int mEventTypesDefault; + private final List mPackageNamesDefault; + private final int mFeedbackTypeDefault; + private final long mNotificationTimeoutDefault; + private final int mFlagsDefault; + private final int mNonInteractiveUiTimeoutDefault; + private final int mInteractiveUiTimeoutDefault; + private final int mMotionEventSourcesDefault; + private final int mObservedMotionEventSourcesDefault; + + DynamicPropertyDefaults(AccessibilityServiceInfo info) { + mEventTypesDefault = info.eventTypes; + if (info.packageNames != null) { + mPackageNamesDefault = List.of(info.packageNames); + } else { + mPackageNamesDefault = null; + } + mFeedbackTypeDefault = info.feedbackType; + mNotificationTimeoutDefault = info.notificationTimeout; + mNonInteractiveUiTimeoutDefault = info.mNonInteractiveUiTimeout; + mInteractiveUiTimeoutDefault = info.mInteractiveUiTimeout; + mFlagsDefault = info.flags; + mMotionEventSourcesDefault = info.mMotionEventSources; + mObservedMotionEventSourcesDefault = info.mObservedMotionEventSources; + } + } + // LINT.ThenChange(:dynamic_property_reset) + /** * Creates a new instance. */ public AccessibilityServiceInfo() { - /* do nothing */ + mDynamicPropertyDefaults = new DynamicPropertyDefaults(this); } /** @@ -758,7 +791,7 @@ public class AccessibilityServiceInfo implements Parcelable { } } peekedValue = asAttributes.peekValue( - com.android.internal.R.styleable.AccessibilityService_summary); + com.android.internal.R.styleable.AccessibilityService_summary); if (peekedValue != null) { mSummaryResId = peekedValue.resourceId; CharSequence nonLocalizedSummary = peekedValue.coerceToString(); @@ -793,8 +826,36 @@ public class AccessibilityServiceInfo implements Parcelable { if (parser != null) { parser.close(); } + + mDynamicPropertyDefaults = new DynamicPropertyDefaults(this); + } + } + + /** + * Resets all dynamically configurable properties to their default values. + * + * @hide + */ + // LINT.IfChange(dynamic_property_reset) + public void resetDynamicallyConfigurableProperties() { + eventTypes = mDynamicPropertyDefaults.mEventTypesDefault; + if (mDynamicPropertyDefaults.mPackageNamesDefault == null) { + packageNames = null; + } else { + packageNames = mDynamicPropertyDefaults.mPackageNamesDefault.toArray(new String[0]); + } + feedbackType = mDynamicPropertyDefaults.mFeedbackTypeDefault; + notificationTimeout = mDynamicPropertyDefaults.mNotificationTimeoutDefault; + mNonInteractiveUiTimeout = mDynamicPropertyDefaults.mNonInteractiveUiTimeoutDefault; + mInteractiveUiTimeout = mDynamicPropertyDefaults.mInteractiveUiTimeoutDefault; + flags = mDynamicPropertyDefaults.mFlagsDefault; + mMotionEventSources = mDynamicPropertyDefaults.mMotionEventSourcesDefault; + if (Flags.motionEventObserving()) { + mObservedMotionEventSources = mDynamicPropertyDefaults + .mObservedMotionEventSourcesDefault; } } + // LINT.ThenChange(:dynamic_property_update) /** * Updates the properties that an AccessibilityService can change dynamically. @@ -808,6 +869,7 @@ public class AccessibilityServiceInfo implements Parcelable { * * @hide */ + // LINT.IfChange(dynamic_property_update) public void updateDynamicallyConfigurableProperties(IPlatformCompat platformCompat, AccessibilityServiceInfo other) { if (isRequestAccessibilityButtonChangeEnabled(platformCompat)) { @@ -828,6 +890,7 @@ public class AccessibilityServiceInfo implements Parcelable { // NOTE: Ensure that only properties that are safe to be modified by the service itself // are included here (regardless of hidden setters, etc.). } + // LINT.ThenChange(:dynamic_property_defaults) private boolean isRequestAccessibilityButtonChangeEnabled(IPlatformCompat platformCompat) { if (mResolveInfo == null) { diff --git a/core/java/android/accessibilityservice/BrailleDisplayController.java b/core/java/android/accessibilityservice/BrailleDisplayController.java new file mode 100644 index 0000000000000000000000000000000000000000..5282aa3fccf77e3119df7a66436b5b86ae7919dd --- /dev/null +++ b/core/java/android/accessibilityservice/BrailleDisplayController.java @@ -0,0 +1,308 @@ +/* + * Copyright (C) 2024 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.accessibilityservice; + +import android.annotation.CallbackExecutor; +import android.annotation.FlaggedApi; +import android.annotation.IntDef; +import android.annotation.NonNull; +import android.annotation.RequiresPermission; +import android.annotation.SuppressLint; +import android.annotation.TestApi; +import android.bluetooth.BluetoothDevice; +import android.hardware.usb.UsbDevice; +import android.os.Bundle; +import android.os.IBinder; +import android.os.RemoteException; +import android.view.accessibility.AccessibilityInteractionClient; +import android.view.accessibility.Flags; + +import java.io.IOException; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.util.List; +import java.util.concurrent.Executor; + +/** + * Used to communicate with a Braille display that supports the Braille display HID standard + * (usage page 0x41). + * + *

Only one Braille display may be connected at a time. + */ +// This interface doesn't actually own resources. Its I/O connections are owned, monitored, +// and automatically closed by the system after the accessibility service is disconnected. +@SuppressLint("NotCloseable") +@FlaggedApi(Flags.FLAG_BRAILLE_DISPLAY_HID) +public interface BrailleDisplayController { + + /** + * Throw {@link IllegalStateException} if this feature's aconfig flag is disabled. + * + * @hide + */ + static void checkApiFlagIsEnabled() { + if (!Flags.brailleDisplayHid()) { + throw new IllegalStateException("Flag BRAILLE_DISPLAY_HID not enabled"); + } + } + + /** + * Interface provided to {@link BrailleDisplayController} connection methods to + * receive callbacks from the system. + */ + @FlaggedApi(Flags.FLAG_BRAILLE_DISPLAY_HID) + interface BrailleDisplayCallback { + /** + * The system cannot access connected HID devices. + */ + @FlaggedApi(Flags.FLAG_BRAILLE_DISPLAY_HID) + int FLAG_ERROR_CANNOT_ACCESS = 1 << 0; + /** + * A unique Braille display matching the requested properties could not be identified. + */ + @FlaggedApi(Flags.FLAG_BRAILLE_DISPLAY_HID) + int FLAG_ERROR_BRAILLE_DISPLAY_NOT_FOUND = 1 << 1; + + /** @hide */ + @Retention(RetentionPolicy.SOURCE) + @IntDef(flag = true, prefix = "FLAG_ERROR_", value = { + FLAG_ERROR_CANNOT_ACCESS, + FLAG_ERROR_BRAILLE_DISPLAY_NOT_FOUND, + }) + @interface ErrorCode { + } + + /** + * Callback to observe a successful Braille display connection. + * + *

The provided HID report descriptor should be used to understand the input bytes + * received from the Braille display via {@link #onInput} and to prepare + * the output sent to the Braille display via {@link #write}. + * + * @param hidDescriptor The HID report descriptor for this Braille display. + * @see #connect(BluetoothDevice, BrailleDisplayCallback) + * @see #connect(UsbDevice, BrailleDisplayCallback) + */ + @FlaggedApi(Flags.FLAG_BRAILLE_DISPLAY_HID) + void onConnected(@NonNull byte[] hidDescriptor); + + /** + * Callback to observe a failed Braille display connection. + * + * @param errorFlags A bitmask of error codes for the connection failure. + * @see #connect(BluetoothDevice, BrailleDisplayCallback) + * @see #connect(UsbDevice, BrailleDisplayCallback) + */ + @FlaggedApi(Flags.FLAG_BRAILLE_DISPLAY_HID) + void onConnectionFailed(@ErrorCode int errorFlags); + + /** + * Callback to observe input bytes from the currently connected Braille display. + * + * @param input The input bytes from the Braille display, formatted according to the HID + * report descriptor and the HIDRAW kernel driver. + */ + @FlaggedApi(Flags.FLAG_BRAILLE_DISPLAY_HID) + void onInput(@NonNull byte[] input); + + /** + * Callback to observe when the currently connected Braille display is disconnected by the + * system. + */ + @FlaggedApi(Flags.FLAG_BRAILLE_DISPLAY_HID) + void onDisconnected(); + } + + /** + * Connects to the requested bluetooth Braille display using the Braille + * display HID standard (usage page 0x41). + * + *

If successful then the HID report descriptor will be provided to + * {@link BrailleDisplayCallback#onConnected} + * and the Braille display will start sending incoming input bytes to + * {@link BrailleDisplayCallback#onInput}. If there is an error in reading input + * then the system will disconnect the Braille display. + * + *

Note that the callbacks will be executed on the main thread using + * {@link AccessibilityService#getMainExecutor()}. To specify the execution thread, use + * {@link #connect(BluetoothDevice, Executor, BrailleDisplayCallback)}. + * + * @param bluetoothDevice The Braille display device. + * @param callback Callbacks used to provide connection results. + * @see BrailleDisplayCallback#onConnected + * @see BrailleDisplayCallback#onConnectionFailed + * @throws IllegalStateException if a Braille display is already connected to this controller. + */ + @FlaggedApi(Flags.FLAG_BRAILLE_DISPLAY_HID) + @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) + void connect(@NonNull BluetoothDevice bluetoothDevice, + @NonNull BrailleDisplayCallback callback); + + /** + * Connects to the requested bluetooth Braille display using the Braille + * display HID standard (usage page 0x41). + * + *

If successful then the HID report descriptor will be provided to + * {@link BrailleDisplayCallback#onConnected} + * and the Braille display will start sending incoming input bytes to + * {@link BrailleDisplayCallback#onInput}. If there is an error in reading input + * then the system will disconnect the Braille display. + * + * @param bluetoothDevice The Braille display device. + * @param callbackExecutor Executor for executing the provided callbacks. + * @param callback Callbacks used to provide connection results. + * @see BrailleDisplayCallback#onConnected + * @see BrailleDisplayCallback#onConnectionFailed + * @throws IllegalStateException if a Braille display is already connected to this controller. + */ + @FlaggedApi(Flags.FLAG_BRAILLE_DISPLAY_HID) + @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) + void connect(@NonNull BluetoothDevice bluetoothDevice, + @NonNull @CallbackExecutor Executor callbackExecutor, + @NonNull BrailleDisplayCallback callback); + + /** + * Connects to the requested USB Braille display using the Braille + * display HID standard (usage page 0x41). + * + *

If successful then the HID report descriptor will be provided to + * {@link BrailleDisplayCallback#onConnected} + * and the Braille display will start sending incoming input bytes to + * {@link BrailleDisplayCallback#onInput}. If there is an error in reading input + * then the system will disconnect the Braille display. + * + *

The accessibility service app must already have approval to access the USB device + * from the standard {@link android.hardware.usb.UsbManager} access approval process. + * + *

Note that the callbacks will be executed on the main thread using + * {@link AccessibilityService#getMainExecutor()}. To specify the execution thread, use + * {@link #connect(UsbDevice, Executor, BrailleDisplayCallback)}. + * + * @param usbDevice The Braille display device. + * @param callback Callbacks used to provide connection results. + * @see BrailleDisplayCallback#onConnected + * @see BrailleDisplayCallback#onConnectionFailed + * @throws SecurityException if the caller does not have USB device approval. + * @throws IllegalStateException if a Braille display is already connected to this controller. + */ + @FlaggedApi(Flags.FLAG_BRAILLE_DISPLAY_HID) + void connect(@NonNull UsbDevice usbDevice, + @NonNull BrailleDisplayCallback callback); + + /** + * Connects to the requested USB Braille display using the Braille + * display HID standard (usage page 0x41). + * + *

If successful then the HID report descriptor will be provided to + * {@link BrailleDisplayCallback#onConnected} + * and the Braille display will start sending incoming input bytes to + * {@link BrailleDisplayCallback#onInput}. If there is an error in reading input + * then the system will disconnect the Braille display. + * + *

The accessibility service app must already have approval to access the USB device + * from the standard {@link android.hardware.usb.UsbManager} access approval process. + * + * @param usbDevice The Braille display device. + * @param callbackExecutor Executor for executing the provided callbacks. + * @param callback Callbacks used to provide connection results. + * @see BrailleDisplayCallback#onConnected + * @see BrailleDisplayCallback#onConnectionFailed + * @throws SecurityException if the caller does not have USB device approval. + * @throws IllegalStateException if a Braille display is already connected to this controller. + */ + @FlaggedApi(Flags.FLAG_BRAILLE_DISPLAY_HID) + void connect(@NonNull UsbDevice usbDevice, + @NonNull @CallbackExecutor Executor callbackExecutor, + @NonNull BrailleDisplayCallback callback); + + /** + * Returns true if a Braille display is currently connected, otherwise false. + * + * @see #connect + */ + @FlaggedApi(Flags.FLAG_BRAILLE_DISPLAY_HID) + boolean isConnected(); + + /** + * Writes a HID report to the currently connected Braille display. + * + *

This method returns immediately after dispatching the write request to the system. + * If the system experiences an error in writing output (e.g. the Braille display is unplugged + * after the system receives the write request but before writing the bytes to the Braille + * display) then the system will disconnect the Braille display, which calls + * {@link BrailleDisplayCallback#onDisconnected()}. + * + * @param buffer The bytes to write to the Braille display. These bytes should be formatted + * according to the HID report descriptor and the HIDRAW kernel driver. + * @throws IOException if there is no currently connected Braille display. + * @throws IllegalArgumentException if the buffer exceeds the maximum safe payload size for + * binder transactions of + * {@link IBinder#getSuggestedMaxIpcSizeBytes()} + */ + @FlaggedApi(Flags.FLAG_BRAILLE_DISPLAY_HID) + void write(@NonNull byte[] buffer) throws IOException; + + /** + * Disconnects from the currently connected Braille display. + * + * @see #isConnected() + */ + @FlaggedApi(Flags.FLAG_BRAILLE_DISPLAY_HID) + void disconnect(); + + /** + * Provides test Braille display data to be used for automated CTS tests. + * + *

See {@code TEST_BRAILLE_DISPLAY_*} bundle keys. + * + * @hide + */ + @FlaggedApi(Flags.FLAG_BRAILLE_DISPLAY_HID) + @RequiresPermission(android.Manifest.permission.MANAGE_ACCESSIBILITY) + @TestApi + static void setTestBrailleDisplayData( + @NonNull AccessibilityService service, + @NonNull List brailleDisplays) { + checkApiFlagIsEnabled(); + final IAccessibilityServiceConnection serviceConnection = + AccessibilityInteractionClient.getConnection(service.getConnectionId()); + if (serviceConnection != null) { + try { + serviceConnection.setTestBrailleDisplayData(brailleDisplays); + } catch (RemoteException e) { + throw e.rethrowFromSystemServer(); + } + } + } + + /** @hide */ + @FlaggedApi(Flags.FLAG_BRAILLE_DISPLAY_HID) + @TestApi + String TEST_BRAILLE_DISPLAY_HIDRAW_PATH = "HIDRAW_PATH"; + /** @hide */ + @FlaggedApi(Flags.FLAG_BRAILLE_DISPLAY_HID) + @TestApi + String TEST_BRAILLE_DISPLAY_DESCRIPTOR = "DESCRIPTOR"; + /** @hide */ + @FlaggedApi(Flags.FLAG_BRAILLE_DISPLAY_HID) + @TestApi + String TEST_BRAILLE_DISPLAY_BUS_BLUETOOTH = "BUS_BLUETOOTH"; + /** @hide */ + @FlaggedApi(Flags.FLAG_BRAILLE_DISPLAY_HID) + @TestApi + String TEST_BRAILLE_DISPLAY_UNIQUE_ID = "UNIQUE_ID"; +} diff --git a/core/java/android/accessibilityservice/BrailleDisplayControllerImpl.java b/core/java/android/accessibilityservice/BrailleDisplayControllerImpl.java new file mode 100644 index 0000000000000000000000000000000000000000..f1df33657279709b4bc17b7a1e0ad37a325e8bab --- /dev/null +++ b/core/java/android/accessibilityservice/BrailleDisplayControllerImpl.java @@ -0,0 +1,296 @@ +/* + * Copyright (C) 2024 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.accessibilityservice; + +import android.annotation.CallbackExecutor; +import android.annotation.FlaggedApi; +import android.annotation.NonNull; +import android.annotation.RequiresPermission; +import android.bluetooth.BluetoothDevice; +import android.hardware.usb.UsbDevice; +import android.os.Binder; +import android.os.IBinder; +import android.os.RemoteException; +import android.os.SystemProperties; +import android.view.accessibility.AccessibilityInteractionClient; +import android.view.accessibility.Flags; + +import com.android.internal.annotations.VisibleForTesting; +import com.android.internal.util.FunctionalUtils; + +import java.io.IOException; +import java.util.Objects; +import java.util.concurrent.Executor; + +/** + * Default implementation of {@link BrailleDisplayController}. + * + * @hide + */ +// BrailleDisplayControllerImpl is not an API, but it implements BrailleDisplayController APIs. +// This @FlaggedApi annotation tells the linter that this method delegates API checks to its +// callers. +@FlaggedApi(Flags.FLAG_BRAILLE_DISPLAY_HID) +@VisibleForTesting(visibility = VisibleForTesting.Visibility.PACKAGE) +public final class BrailleDisplayControllerImpl implements BrailleDisplayController { + + private final AccessibilityService mAccessibilityService; + private final Object mLock; + private final boolean mIsHidrawSupported; + + private IBrailleDisplayConnection mBrailleDisplayConnection; + private Executor mCallbackExecutor; + private BrailleDisplayCallback mCallback; + + /** + * Read-only property that returns whether HIDRAW access is supported on this device. + * + *

Defaults to true. + * + *

Device manufacturers without HIDRAW kernel support can set this to false in + * the device's product makefile. + */ + private static final boolean IS_HIDRAW_SUPPORTED = SystemProperties.getBoolean( + "ro.accessibility.support_hidraw", true); + + BrailleDisplayControllerImpl(AccessibilityService accessibilityService, + Object lock) { + this(accessibilityService, lock, IS_HIDRAW_SUPPORTED); + } + + @VisibleForTesting + public BrailleDisplayControllerImpl(AccessibilityService accessibilityService, + Object lock, boolean isHidrawSupported) { + mAccessibilityService = accessibilityService; + mLock = lock; + mIsHidrawSupported = isHidrawSupported; + } + + @Override + @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) + public void connect(@NonNull BluetoothDevice bluetoothDevice, + @NonNull BrailleDisplayCallback callback) { + connect(bluetoothDevice, mAccessibilityService.getMainExecutor(), callback); + } + + @Override + @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) + public void connect(@NonNull BluetoothDevice bluetoothDevice, + @NonNull @CallbackExecutor Executor callbackExecutor, + @NonNull BrailleDisplayCallback callback) { + Objects.requireNonNull(bluetoothDevice); + Objects.requireNonNull(callbackExecutor); + Objects.requireNonNull(callback); + connect(serviceConnection -> serviceConnection.connectBluetoothBrailleDisplay( + bluetoothDevice.getAddress(), new IBrailleDisplayControllerWrapper()), + callbackExecutor, callback); + } + + @Override + public void connect(@NonNull UsbDevice usbDevice, + @NonNull BrailleDisplayCallback callback) { + connect(usbDevice, mAccessibilityService.getMainExecutor(), callback); + } + + @Override + public void connect(@NonNull UsbDevice usbDevice, + @NonNull @CallbackExecutor Executor callbackExecutor, + @NonNull BrailleDisplayCallback callback) { + Objects.requireNonNull(usbDevice); + Objects.requireNonNull(callbackExecutor); + Objects.requireNonNull(callback); + connect(serviceConnection -> serviceConnection.connectUsbBrailleDisplay( + usbDevice, new IBrailleDisplayControllerWrapper()), + callbackExecutor, callback); + } + + /** + * Shared implementation for the {@code connect()} API methods. + * + *

Performs a blocking call to system_server to create the connection. Success is + * returned through {@link BrailleDisplayCallback#onConnected} while normal connection + * errors are returned through {@link BrailleDisplayCallback#onConnectionFailed}. This + * connection is implemented using cached data from the HIDRAW driver so it returns + * quickly without needing to perform any I/O with the Braille display. + * + *

The AIDL call to system_server is blocking (not posted to a handler thread) so + * that runtime exceptions signaling abnormal connection errors from API misuse + * (e.g. lacking permissions, providing an invalid BluetoothDevice, calling connect + * while already connected) are propagated to the API caller. + */ + private void connect( + FunctionalUtils.RemoteExceptionIgnoringConsumer + createConnection, + @NonNull Executor callbackExecutor, @NonNull BrailleDisplayCallback callback) { + BrailleDisplayController.checkApiFlagIsEnabled(); + if (!mIsHidrawSupported) { + callbackExecutor.execute(() -> callback.onConnectionFailed( + BrailleDisplayCallback.FLAG_ERROR_CANNOT_ACCESS)); + return; + } + if (isConnected()) { + throw new IllegalStateException( + "This service already has a connected Braille display"); + } + final IAccessibilityServiceConnection serviceConnection = + AccessibilityInteractionClient.getConnection( + mAccessibilityService.getConnectionId()); + if (serviceConnection == null) { + throw new IllegalStateException("Accessibility service is not connected"); + } + synchronized (mLock) { + mCallbackExecutor = callbackExecutor; + mCallback = callback; + } + try { + createConnection.acceptOrThrow(serviceConnection); + } catch (RemoteException e) { + throw e.rethrowFromSystemServer(); + } + } + + @Override + public boolean isConnected() { + BrailleDisplayController.checkApiFlagIsEnabled(); + return mBrailleDisplayConnection != null; + } + + @Override + public void write(@NonNull byte[] buffer) throws IOException { + BrailleDisplayController.checkApiFlagIsEnabled(); + Objects.requireNonNull(buffer); + if (buffer.length > IBinder.getSuggestedMaxIpcSizeBytes()) { + // This same check must be performed in the system to prevent reflection misuse, + // but perform it here too to prevent unnecessary IPCs from non-reflection callers. + throw new IllegalArgumentException("Invalid write buffer size " + buffer.length); + } + synchronized (mLock) { + if (mBrailleDisplayConnection == null) { + throw new IOException("Braille display is not connected"); + } + try { + mBrailleDisplayConnection.write(buffer); + } catch (RemoteException e) { + throw e.rethrowFromSystemServer(); + } + } + } + + @Override + public void disconnect() { + BrailleDisplayController.checkApiFlagIsEnabled(); + synchronized (mLock) { + try { + if (mBrailleDisplayConnection != null) { + mBrailleDisplayConnection.disconnect(); + } + } catch (RemoteException e) { + throw e.rethrowFromSystemServer(); + } finally { + clearConnectionLocked(); + } + } + } + + /** + * Implementation of the {@code IBrailleDisplayController} AIDL interface provided to + * system_server, which system_server uses to pass messages back to this + * {@code BrailleDisplayController}. + * + *

Messages from system_server are routed to the {@link BrailleDisplayCallback} callbacks + * implemented by the accessibility service. + * + *

Note: Per API Guidelines 7.5 the Binder identity must be cleared before invoking the + * callback executor so that Binder identity checks in the callbacks are performed using the + * app's identity. + */ + private final class IBrailleDisplayControllerWrapper extends IBrailleDisplayController.Stub { + /** + * Called when the system successfully connects to a Braille display. + */ + @Override + public void onConnected(IBrailleDisplayConnection connection, byte[] hidDescriptor) { + BrailleDisplayController.checkApiFlagIsEnabled(); + final long identity = Binder.clearCallingIdentity(); + try { + synchronized (mLock) { + mBrailleDisplayConnection = connection; + mCallbackExecutor.execute(() -> mCallback.onConnected(hidDescriptor)); + } + } finally { + Binder.restoreCallingIdentity(identity); + } + } + + /** + * Called when the system is unable to connect to a Braille display. + */ + @Override + public void onConnectionFailed(@BrailleDisplayCallback.ErrorCode int errorCode) { + BrailleDisplayController.checkApiFlagIsEnabled(); + final long identity = Binder.clearCallingIdentity(); + try { + synchronized (mLock) { + mCallbackExecutor.execute(() -> mCallback.onConnectionFailed(errorCode)); + } + } finally { + Binder.restoreCallingIdentity(identity); + } + } + + /** + * Called when input is received from the currently connected Braille display. + */ + @Override + public void onInput(byte[] input) { + BrailleDisplayController.checkApiFlagIsEnabled(); + final long identity = Binder.clearCallingIdentity(); + try { + synchronized (mLock) { + // Ignore input that arrives after disconnection. + if (mBrailleDisplayConnection != null) { + mCallbackExecutor.execute(() -> mCallback.onInput(input)); + } + } + } finally { + Binder.restoreCallingIdentity(identity); + } + } + + /** + * Called when the currently connected Braille display is disconnected. + */ + @Override + public void onDisconnected() { + BrailleDisplayController.checkApiFlagIsEnabled(); + final long identity = Binder.clearCallingIdentity(); + try { + synchronized (mLock) { + mCallbackExecutor.execute(mCallback::onDisconnected); + clearConnectionLocked(); + } + } finally { + Binder.restoreCallingIdentity(identity); + } + } + } + + private void clearConnectionLocked() { + mBrailleDisplayConnection = null; + } + +} diff --git a/core/java/android/accessibilityservice/IAccessibilityServiceConnection.aidl b/core/java/android/accessibilityservice/IAccessibilityServiceConnection.aidl index 96716dbbaca160e120305a6ccab2c5f08efe2da0..dc5c7f694c58422aed0d9cdde50423f6cb3e9f93 100644 --- a/core/java/android/accessibilityservice/IAccessibilityServiceConnection.aidl +++ b/core/java/android/accessibilityservice/IAccessibilityServiceConnection.aidl @@ -17,10 +17,12 @@ package android.accessibilityservice; import android.accessibilityservice.AccessibilityServiceInfo; +import android.accessibilityservice.IBrailleDisplayController; import android.accessibilityservice.MagnificationConfig; import android.content.pm.ParceledListSlice; import android.graphics.Bitmap; import android.graphics.Region; +import android.hardware.usb.UsbDevice; import android.os.Bundle; import android.os.RemoteCallback; import android.view.MagnificationSpec; @@ -160,4 +162,12 @@ interface IAccessibilityServiceConnection { void attachAccessibilityOverlayToDisplay(int interactionId, int displayId, in SurfaceControl sc, IAccessibilityInteractionConnectionCallback callback); void attachAccessibilityOverlayToWindow(int interactionId, int accessibilityWindowId, in SurfaceControl sc, IAccessibilityInteractionConnectionCallback callback); + + @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)") + void connectBluetoothBrailleDisplay(in String bluetoothAddress, in IBrailleDisplayController controller); + + void connectUsbBrailleDisplay(in UsbDevice usbDevice, in IBrailleDisplayController controller); + + @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.MANAGE_ACCESSIBILITY)") + void setTestBrailleDisplayData(in List brailleDisplays); } \ No newline at end of file diff --git a/core/java/android/accessibilityservice/IBrailleDisplayConnection.aidl b/core/java/android/accessibilityservice/IBrailleDisplayConnection.aidl new file mode 100644 index 0000000000000000000000000000000000000000..ec4d7b17ed01341d64cc1936d03437506810108e --- /dev/null +++ b/core/java/android/accessibilityservice/IBrailleDisplayConnection.aidl @@ -0,0 +1,12 @@ +package android.accessibilityservice; + +/** + * Interface given to a BrailleDisplayController to talk to a BrailleDisplayConnection + * in system_server. + * + * @hide + */ +interface IBrailleDisplayConnection { + oneway void disconnect(); + oneway void write(in byte[] output); +} \ No newline at end of file diff --git a/core/java/android/accessibilityservice/IBrailleDisplayController.aidl b/core/java/android/accessibilityservice/IBrailleDisplayController.aidl new file mode 100644 index 0000000000000000000000000000000000000000..7a5d83eeccb56ccb5b82d095f8f855efc5699e6b --- /dev/null +++ b/core/java/android/accessibilityservice/IBrailleDisplayController.aidl @@ -0,0 +1,17 @@ +package android.accessibilityservice; + +import android.accessibilityservice.IBrailleDisplayConnection; + +/** + * Interface given to a BrailleDisplayConnection to talk to a BrailleDisplayController + * in an accessibility service. + * + * IPCs from system_server to apps must be oneway, so designate this entire interface as oneway. + * @hide + */ +oneway interface IBrailleDisplayController { + void onConnected(in IBrailleDisplayConnection connection, in byte[] hidDescriptor); + void onConnectionFailed(int error); + void onInput(in byte[] input); + void onDisconnected(); +} \ No newline at end of file diff --git a/core/java/android/accounts/AbstractAccountAuthenticator.java b/core/java/android/accounts/AbstractAccountAuthenticator.java index 45515ddb219a35a076322475ce861d608d4967e3..c1c5c0e6e0192b4e8c65b75c021d555041140831 100644 --- a/core/java/android/accounts/AbstractAccountAuthenticator.java +++ b/core/java/android/accounts/AbstractAccountAuthenticator.java @@ -142,10 +142,7 @@ public abstract class AbstractAccountAuthenticator { private static final String KEY_ACCOUNT = "android.accounts.AbstractAccountAuthenticator.KEY_ACCOUNT"; - private final Context mContext; - public AbstractAccountAuthenticator(Context context) { - mContext = context; } private class Transport extends IAccountAuthenticator.Stub { diff --git a/core/java/android/adaptiveauth/OWNERS b/core/java/android/adaptiveauth/OWNERS new file mode 100644 index 0000000000000000000000000000000000000000..0218a7835586681a06590c0c02f6e9f4081067ee --- /dev/null +++ b/core/java/android/adaptiveauth/OWNERS @@ -0,0 +1 @@ +include /services/core/java/com/android/server/adaptiveauth/OWNERS \ No newline at end of file diff --git a/core/java/android/adaptiveauth/flags.aconfig b/core/java/android/adaptiveauth/flags.aconfig new file mode 100644 index 0000000000000000000000000000000000000000..b9cf29cc13dd30cee712337e7e2d29ba7ee156f3 --- /dev/null +++ b/core/java/android/adaptiveauth/flags.aconfig @@ -0,0 +1,16 @@ +package: "android.adaptiveauth" +container: "system" + +flag { + name: "enable_adaptive_auth" + namespace: "biometrics" + description: "Feature flag for enabling the new adaptive auth service" + bug: "285053096" +} + +flag { + name: "report_biometric_auth_attempts" + namespace: "biometrics" + description: "Control the usage of the biometric auth signal in adaptive auth" + bug: "285053096" +} \ No newline at end of file diff --git a/core/java/android/animation/Animator.java b/core/java/android/animation/Animator.java index 4cad58521c0933f0417a29dd2e5c9d7626f64b22..c58624e9dfab5045a6049286e9ddc5bed6b21e23 100644 --- a/core/java/android/animation/Animator.java +++ b/core/java/android/animation/Animator.java @@ -26,6 +26,7 @@ import android.os.Build; import android.util.LongArray; import java.util.ArrayList; +import java.util.concurrent.atomic.AtomicReference; /** * This is the superclass for classes which provide basic support for animations which can be @@ -76,7 +77,7 @@ public abstract class Animator implements Cloneable { * of it in case the list is modified while iterating. The array can be reused to avoid * allocation on every notification. */ - private Object[] mCachedList; + private AtomicReference mCachedList = new AtomicReference<>(); /** * Tracks whether we've notified listeners of the onAnimationStart() event. This can be @@ -452,7 +453,7 @@ public abstract class Animator implements Cloneable { if (mPauseListeners != null) { anim.mPauseListeners = new ArrayList(mPauseListeners); } - anim.mCachedList = null; + anim.mCachedList.set(null); anim.mStartListenersCalled = false; return anim; } catch (CloneNotSupportedException e) { @@ -654,13 +655,9 @@ public abstract class Animator implements Cloneable { int size = list == null ? 0 : list.size(); if (size > 0) { // Try to reuse mCacheList to store the items of list. - Object[] array; - if (mCachedList == null || mCachedList.length < size) { + Object[] array = mCachedList.getAndSet(null); + if (array == null || array.length < size) { array = new Object[size]; - } else { - array = mCachedList; - // Clear it in case there is some reentrancy - mCachedList = null; } list.toArray(array); for (int i = 0; i < size; i++) { @@ -670,7 +667,7 @@ public abstract class Animator implements Cloneable { array[i] = null; } // Store it for the next call so we can reuse this array, if needed. - mCachedList = array; + mCachedList.compareAndSet(null, array); } } diff --git a/core/java/android/animation/ObjectAnimator.java b/core/java/android/animation/ObjectAnimator.java index 1e1f1554d3a2862c915235c7af7c1d16df2657b9..5840f02a865019c46c634ac9daa89a1e01f444f7 100644 --- a/core/java/android/animation/ObjectAnimator.java +++ b/core/java/android/animation/ObjectAnimator.java @@ -25,8 +25,6 @@ import android.util.Log; import android.util.Property; import android.view.animation.AccelerateDecelerateInterpolator; -import java.lang.ref.WeakReference; - /** * This subclass of {@link ValueAnimator} provides support for animating properties on target objects. * The constructors of this class take parameters to define the target object that will be animated @@ -73,11 +71,7 @@ public final class ObjectAnimator extends ValueAnimator { private static final boolean DBG = false; - /** - * A weak reference to the target object on which the property exists, set - * in the constructor. We'll cancel the animation if this goes away. - */ - private WeakReference mTarget; + private Object mTarget; private String mPropertyName; @@ -919,7 +913,7 @@ public final class ObjectAnimator extends ValueAnimator { */ @Nullable public Object getTarget() { - return mTarget == null ? null : mTarget.get(); + return mTarget; } @Override @@ -929,7 +923,7 @@ public final class ObjectAnimator extends ValueAnimator { if (isStarted()) { cancel(); } - mTarget = target == null ? null : new WeakReference(target); + mTarget = target; // New target should cause re-initialization prior to starting mInitialized = false; } @@ -977,13 +971,6 @@ public final class ObjectAnimator extends ValueAnimator { @Override void animateValue(float fraction) { final Object target = getTarget(); - if (mTarget != null && target == null) { - // We lost the target reference, cancel and clean up. Note: we allow null target if the - /// target has never been set. - cancel(); - return; - } - super.animateValue(fraction); int numValues = mValues.length; for (int i = 0; i < numValues; ++i) { diff --git a/core/java/android/app/Activity.java b/core/java/android/app/Activity.java index 9182716a60cbf8a0c32cd4a0214b3fbd1ae6df8a..b44dd0b322ba56d22d5521f01c18d34ccfae196b 100644 --- a/core/java/android/app/Activity.java +++ b/core/java/android/app/Activity.java @@ -24,7 +24,9 @@ import static android.Manifest.permission.INTERNAL_SYSTEM_WINDOW; import static android.app.WindowConfiguration.WINDOWING_MODE_PINNED; import static android.app.WindowConfiguration.inMultiWindowMode; import static android.os.Process.myUid; + import static com.android.sdksandbox.flags.Flags.sandboxActivitySdkBasedContext; + import static java.lang.Character.MIN_VALUE; import android.annotation.AnimRes; @@ -45,6 +47,7 @@ import android.annotation.SuppressLint; import android.annotation.SystemApi; import android.annotation.TestApi; import android.annotation.UiContext; +import android.app.ActivityOptions.SceneTransitionInfo; import android.app.VoiceInteractor.Request; import android.app.admin.DevicePolicyManager; import android.app.assist.AssistContent; @@ -841,6 +844,32 @@ public class Activity extends ContextThemeWrapper private IBinder mToken; private IBinder mAssistToken; private IBinder mShareableActivityToken; + + /** Initial caller of the activity. Can be retrieved from {@link #getInitialCaller} */ + private ComponentCaller mInitialCaller; + /** + * Caller associated with the Intent from {@link #getIntent}. Can be retrieved from + * {@link #getCaller}. + * + *

The value of this field depends on how the activity set its intent: + * - If via {@link #setIntent(Intent)}, the caller will be {@code null}. + * - If via {@link #setIntent(Intent, ComponentCaller)}, the caller will be set to the passed + * caller. + */ + private ComponentCaller mCaller; + /** + * Caller associated with an Intent within {@link #onNewIntent} and {@link #onActivityResult}. + * Can be retrieved from either of these methods: + * - {@link #getCurrentCaller} + * - By overriding {@link #onNewIntent(Intent, ComponentCaller)} and getting the second argument + * - By overriding {@link #onActivityResult(int, int, Intent, ComponentCaller)} and getting the + * fourth argument + * + *

The value of this field will be {@code null} outside of {@link #onNewIntent} and + * {@link #onActivityResult}. + */ + private ComponentCaller mCurrentCaller; + @UnsupportedAppUsage private int mIdent; @UnsupportedAppUsage @@ -930,8 +959,8 @@ public class Activity extends ContextThemeWrapper @UnsupportedAppUsage final FragmentController mFragments = FragmentController.createController(new HostCallbacks()); - /** The options for scene transition. */ - ActivityOptions mPendingOptions; + /** The scene transition info. */ + SceneTransitionInfo mSceneTransitionInfo; /** Whether this activity was launched from a bubble. **/ boolean mLaunchedFromBubble; @@ -973,6 +1002,9 @@ public class Activity extends ContextThemeWrapper new ActivityManager.TaskDescription(); private int mLastTaskDescriptionHashCode; + @ActivityInfo.ScreenOrientation + private int mLastRequestedOrientation = ActivityInfo.SCREEN_ORIENTATION_UNSET; + protected static final int[] FOCUSED_STATE_SET = {com.android.internal.R.attr.state_focused}; @SuppressWarnings("unused") @@ -1113,23 +1145,71 @@ public class Activity extends ContextThemeWrapper private static native String getDlWarning(); - /** Return the intent that started this activity. */ + /** + * Returns the intent that started this activity. + * + *

To keep the Intent instance for future use, call {@link #setIntent(Intent)}, and use + * this method to retrieve it. + */ public Intent getIntent() { return mIntent; } /** - * Change the intent returned by {@link #getIntent}. This holds a - * reference to the given intent; it does not copy it. Often used in - * conjunction with {@link #onNewIntent}. + * Changes the intent returned by {@link #getIntent}. This holds a + * reference to the given intent; it does not copy it. Often used in + * conjunction with {@link #onNewIntent(Intent)}. * - * @param newIntent The new Intent object to return from getIntent + * @param newIntent The new Intent object to return from {@link #getIntent} * * @see #getIntent - * @see #onNewIntent + * @see #onNewIntent(Intent) */ public void setIntent(Intent newIntent) { + internalSetIntent(newIntent, /* newCaller */ null); + } + + /** + * Returns the ComponentCaller instance of the app that launched this activity with the intent + * from {@link #getIntent()}. To keep the value of the ComponentCaller instance for new intents, + * call {@link #setIntent(Intent, ComponentCaller)} instead of {@link #setIntent(Intent)}. + * + * @return {@link ComponentCaller} instance corresponding to the intent from + * {@link #getIntent()}, or {@code null} if the activity was not launched with that + * intent + * + * @see ComponentCaller + * @see #getIntent + * @see #setIntent(Intent, ComponentCaller) + */ + @FlaggedApi(android.security.Flags.FLAG_CONTENT_URI_PERMISSION_APIS) + public @Nullable ComponentCaller getCaller() { + return mCaller; + } + + /** + * Changes the intent returned by {@link #getIntent}, and ComponentCaller returned by + * {@link #getCaller}. This holds references to the given intent, and ComponentCaller; it does + * not copy them. Often used in conjunction with {@link #onNewIntent(Intent)}. To retrieve the + * caller from {@link #onNewIntent(Intent)}, use {@link #getCurrentCaller}, otherwise override + * {@link #onNewIntent(Intent, ComponentCaller)}. + * + * @param newIntent The new Intent object to return from {@link #getIntent} + * @param newCaller The new {@link ComponentCaller} object to return from + * {@link #getCaller} + * + * @see #getIntent + * @see #onNewIntent(Intent, ComponentCaller) + * @see #getCaller + */ + @FlaggedApi(android.security.Flags.FLAG_CONTENT_URI_PERMISSION_APIS) + public void setIntent(@Nullable Intent newIntent, @Nullable ComponentCaller newCaller) { + internalSetIntent(newIntent, newCaller); + } + + private void internalSetIntent(Intent newIntent, ComponentCaller newCaller) { mIntent = newIntent; + mCaller = newCaller; } /** @@ -2280,17 +2360,41 @@ public class Activity extends ContextThemeWrapper * sometime later when activity becomes active again. * *

Note that {@link #getIntent} still returns the original Intent. You - * can use {@link #setIntent} to update it to this new Intent. + * can use {@link #setIntent(Intent)} to update it to this new Intent. * - * @param intent The new intent that was started for the activity. + * @param intent The new intent that was used to start the activity * * @see #getIntent - * @see #setIntent + * @see #setIntent(Intent) * @see #onResume */ protected void onNewIntent(Intent intent) { } + /** + * Same as {@link #onNewIntent(Intent)}, but with an extra parameter for the ComponentCaller + * instance associated with the app that sent the intent. + * + *

If you want to retrieve the caller without overriding this method, call + * {@link #getCurrentCaller} inside your existing {@link #onNewIntent(Intent)}. + * + *

Note that you should only override one {@link #onNewIntent} method. + * + * @param intent The new intent that was used to start the activity + * @param caller The {@link ComponentCaller} instance associated with the app that sent the + * intent + * + * @see ComponentCaller + * @see #onNewIntent(Intent) + * @see #getCurrentCaller + * @see #setIntent(Intent, ComponentCaller) + * @see #getCaller + */ + @FlaggedApi(android.security.Flags.FLAG_CONTENT_URI_PERMISSION_APIS) + public void onNewIntent(@NonNull Intent intent, @NonNull ComponentCaller caller) { + onNewIntent(intent); + } + /** * The hook for {@link ActivityThread} to save the state of this activity. * @@ -3061,10 +3165,10 @@ public class Activity extends ContextThemeWrapper } /** - * Request to put the a freeform activity into fullscreen. This will only be allowed if the - * activity is on a freeform display, such as a desktop device. The requester has to be the - * top-most activity of the focused display, and the request should be a response to a user - * input. When getting fullscreen and receiving corresponding + * Request to put the activity into fullscreen. The requester must be pinned or the top-most + * activity of the focused display which can be verified using + * {@link #onTopResumedActivityChanged(boolean)}. The request should also be a response to a + * user input. When getting fullscreen and receiving corresponding * {@link #onConfigurationChanged(Configuration)} and * {@link #onMultiWindowModeChanged(boolean, Configuration)}, the activity should relayout * itself and the system bars' visibilities can be controlled as usual fullscreen apps. @@ -3072,11 +3176,6 @@ public class Activity extends ContextThemeWrapper * Calling it again with the exit request can restore the activity to the previous status. * This will only happen when it got into fullscreen through this API. * - * If an app wants to be in fullscreen always, it should claim as not being resizable - * by setting - * - * {@code android:resizableActivity="false"} instead of calling this API. - * * @param request Can be {@link #FULLSCREEN_MODE_REQUEST_ENTER} or * {@link #FULLSCREEN_MODE_REQUEST_EXIT} to indicate this request is to get * fullscreen or get restored. @@ -3928,6 +4027,7 @@ public class Activity extends ContextThemeWrapper if (keyCode == KeyEvent.KEYCODE_ESCAPE && mWindow.shouldCloseOnTouchOutside()) { event.startTracking(); + finish(); return true; } @@ -4028,10 +4128,7 @@ public class Activity extends ContextThemeWrapper } if (keyCode == KeyEvent.KEYCODE_ESCAPE - && mWindow.shouldCloseOnTouchOutside() - && event.isTracking() - && !event.isCanceled()) { - finish(); + && event.isTracking()) { return true; } @@ -5801,10 +5898,9 @@ public class Activity extends ContextThemeWrapper private Bundle transferSpringboardActivityOptions(@Nullable Bundle options) { if (options == null && (mWindow != null && !mWindow.isActive())) { - final ActivityOptions activityOptions = getActivityOptions(); - if (activityOptions != null && - activityOptions.getAnimationType() == ActivityOptions.ANIM_SCENE_TRANSITION) { - return activityOptions.toBundle(); + final SceneTransitionInfo info = getSceneTransitionInfo(); + if (info != null) { + return ActivityOptions.makeBasic().setSceneTransitionInfo(info).toBundle(); } } return options; @@ -7033,6 +7129,51 @@ public class Activity extends ContextThemeWrapper return ActivityClient.getInstance().getLaunchedFromPackage(getActivityToken()); } + /** + * Returns the ComponentCaller instance of the app that initially launched this activity. + * + *

Note that calls to {@link #onNewIntent} have no effect on the returned value of this + * method. + * + * @return {@link ComponentCaller} instance + * @see ComponentCaller + */ + @FlaggedApi(android.security.Flags.FLAG_CONTENT_URI_PERMISSION_APIS) + public @NonNull ComponentCaller getInitialCaller() { + return mInitialCaller; + } + + /** + * Returns the ComponentCaller instance of the app that re-launched this activity with a new + * intent via {@link #onNewIntent} or {@link #onActivityResult}. + * + *

Note that this method only works within the {@link #onNewIntent} and + * {@link #onActivityResult} methods. If you call this method outside {@link #onNewIntent} and + * {@link #onActivityResult}, it will throw an {@link IllegalStateException}. + * + *

You can also retrieve the caller if you override + * {@link #onNewIntent(Intent, ComponentCaller)} or + * {@link #onActivityResult(int, int, Intent, ComponentCaller)}. + * + *

To keep the ComponentCaller instance for future use, call + * {@link #setIntent(Intent, ComponentCaller)}, and use {@link #getCaller} to retrieve it. + * + * @return {@link ComponentCaller} instance + * @throws IllegalStateException if the caller is {@code null}, indicating the method was called + * outside {@link #onNewIntent} + * @see ComponentCaller + * @see #setIntent(Intent, ComponentCaller) + * @see #getCaller + */ + @FlaggedApi(android.security.Flags.FLAG_CONTENT_URI_PERMISSION_APIS) + public @NonNull ComponentCaller getCurrentCaller() { + if (mCurrentCaller == null) { + throw new IllegalStateException("The caller is null because #getCurrentCaller should be" + + " called within #onNewIntent method"); + } + return mCurrentCaller; + } + /** * Control whether this activity's main window is visible. This is intended * only for the special case of an activity that is not going to show a @@ -7292,6 +7433,31 @@ public class Activity extends ContextThemeWrapper protected void onActivityResult(int requestCode, int resultCode, Intent data) { } + /** + * Same as {@link #onActivityResult(int, int, Intent)}, but with an extra parameter for the + * ComponentCaller instance associated with the app that sent the result. + * + *

If you want to retrieve the caller without overriding this method, call + * {@link #getCurrentCaller} inside your existing {@link #onActivityResult(int, int, Intent)}. + * + *

Note that you should only override one {@link #onActivityResult} method. + * + * @param requestCode The integer request code originally supplied to + * startActivityForResult(), allowing you to identify who this + * result came from. + * @param resultCode The integer result code returned by the child activity + * through its setResult(). + * @param data An Intent, which can return result data to the caller + * (various data can be attached to Intent "extras"). + * @param caller The {@link ComponentCaller} instance associated with the app that sent the + * intent. + */ + @FlaggedApi(android.security.Flags.FLAG_CONTENT_URI_PERMISSION_APIS) + public void onActivityResult(int requestCode, int resultCode, @NonNull Intent data, + @NonNull ComponentCaller caller) { + onActivityResult(requestCode, resultCode, data); + } + /** * Called when an activity you launched with an activity transition exposes this * Activity through a returning activity transition, giving you the resultCode @@ -7367,11 +7533,15 @@ public class Activity extends ContextThemeWrapper * {@link ActivityInfo#screenOrientation ActivityInfo.screenOrientation}. */ public void setRequestedOrientation(@ActivityInfo.ScreenOrientation int requestedOrientation) { + if (requestedOrientation == mLastRequestedOrientation) { + return; + } if (mParent == null) { ActivityClient.getInstance().setRequestedOrientation(mToken, requestedOrientation); } else { mParent.setRequestedOrientation(requestedOrientation); } + mLastRequestedOrientation = requestedOrientation; } /** @@ -7385,6 +7555,9 @@ public class Activity extends ContextThemeWrapper */ @ActivityInfo.ScreenOrientation public int getRequestedOrientation() { + if (mLastRequestedOrientation != ActivityInfo.SCREEN_ORIENTATION_UNSET) { + return mLastRequestedOrientation; + } if (mParent == null) { return ActivityClient.getInstance().getRequestedOrientation(mToken); } else { @@ -8073,8 +8246,10 @@ public class Activity extends ContextThemeWrapper * * @param callback the method to call when all visible activities behind this one have been * drawn and it is safe to make this activity translucent again. - * @param options activity options delivered to the activity below this one. The options - * are retrieved using {@link #getActivityOptions}. + * @param options activity options that created from + * {@link ActivityOptions#makeSceneTransitionAnimation} which will be converted to + * {@link SceneTransitionInfo} and delivered to the activity below this one. The + * options are retrieved using {@link #getSceneTransitionInfo}. * @return true if Window was opaque and will become translucent or * false if window was translucent and no change needed to be made. * @@ -8110,27 +8285,27 @@ public class Activity extends ContextThemeWrapper } /** @hide */ - public void onNewActivityOptions(ActivityOptions options) { - mActivityTransitionState.setEnterActivityOptions(this, options); + public void onNewSceneTransitionInfo(ActivityOptions.SceneTransitionInfo info) { + mActivityTransitionState.setEnterSceneTransitionInfo(this, info); if (!mStopped) { mActivityTransitionState.enterReady(this); } } /** - * Takes the ActivityOptions passed in from the launching activity or passed back + * Takes the {@link SceneTransitionInfo} passed in from the launching activity or passed back * from an activity launched by this activity in its call to {@link * #convertToTranslucent(TranslucentConversionListener, ActivityOptions)} * - * @return The ActivityOptions passed to {@link #convertToTranslucent}. + * @return The {@link SceneTransitionInfo} which based on the ActivityOptions that originally + * passed to {@link #convertToTranslucent}. * @hide */ - @UnsupportedAppUsage - ActivityOptions getActivityOptions() { - final ActivityOptions options = mPendingOptions; - // The option only applies once. - mPendingOptions = null; - return options; + SceneTransitionInfo getSceneTransitionInfo() { + final SceneTransitionInfo sceneTransitionInfo = mSceneTransitionInfo; + // The info only applies once. + mSceneTransitionInfo = null; + return sceneTransitionInfo; } /** @@ -8648,6 +8823,19 @@ public class Activity extends ContextThemeWrapper Configuration config, String referrer, IVoiceInteractor voiceInteractor, Window window, ActivityConfigCallback activityConfigCallback, IBinder assistToken, IBinder shareableActivityToken) { + attach(context, aThread, instr, token, ident, application, intent, info, title, parent, id, + lastNonConfigurationInstances, config, referrer, voiceInteractor, window, + activityConfigCallback, assistToken, shareableActivityToken, null); + } + + final void attach(Context context, ActivityThread aThread, + Instrumentation instr, IBinder token, int ident, + Application application, Intent intent, ActivityInfo info, + CharSequence title, Activity parent, String id, + NonConfigurationInstances lastNonConfigurationInstances, + Configuration config, String referrer, IVoiceInteractor voiceInteractor, + Window window, ActivityConfigCallback activityConfigCallback, IBinder assistToken, + IBinder shareableActivityToken, IBinder initialCallerInfoAccessToken) { if (sandboxActivitySdkBasedContext()) { // Sandbox activities extract a token from the intent's extra to identify the related // SDK as part of overriding attachBaseContext, then it wraps the passed context in an @@ -8712,6 +8900,11 @@ public class Activity extends ContextThemeWrapper getAutofillClientController().onActivityAttached(application); setContentCaptureOptions(application.getContentCaptureOptions()); + + if (android.security.Flags.contentUriPermissionApis()) { + mInitialCaller = new ComponentCaller(getActivityToken(), initialCallerInfoAccessToken); + mCaller = mInitialCaller; + } } /** @hide */ @@ -8774,7 +8967,7 @@ public class Activity extends ContextThemeWrapper mVisibleFromClient = !mWindow.getWindowStyle().getBoolean( com.android.internal.R.styleable.Window_windowNoDisplay, false); mFragments.dispatchActivityCreated(); - mActivityTransitionState.setEnterActivityOptions(this, getActivityOptions()); + mActivityTransitionState.setEnterSceneTransitionInfo(this, getSceneTransitionInfo()); dispatchActivityPostCreated(icicle); Trace.traceEnd(Trace.TRACE_TAG_WINDOW_MANAGER); } @@ -8786,13 +8979,23 @@ public class Activity extends ContextThemeWrapper Trace.traceEnd(Trace.TRACE_TAG_WINDOW_MANAGER); } + @FlaggedApi(android.security.Flags.FLAG_CONTENT_URI_PERMISSION_APIS) + final void performNewIntent(@NonNull Intent intent, @NonNull ComponentCaller caller) { + Trace.traceBegin(Trace.TRACE_TAG_WINDOW_MANAGER, "performNewIntent"); + mCanEnterPictureInPicture = true; + mCurrentCaller = caller; + onNewIntent(intent, caller); + mCurrentCaller = null; + Trace.traceEnd(Trace.TRACE_TAG_WINDOW_MANAGER); + } + final void performStart(String reason) { if (Trace.isTagEnabled(Trace.TRACE_TAG_WINDOW_MANAGER)) { Trace.traceBegin(Trace.TRACE_TAG_WINDOW_MANAGER, "performStart:" + mComponent.getClassName()); } dispatchActivityPreStarted(); - mActivityTransitionState.setEnterActivityOptions(this, getActivityOptions()); + mActivityTransitionState.setEnterSceneTransitionInfo(this, getSceneTransitionInfo()); mFragments.noteStateNotSaved(); mCalled = false; mFragments.execPendingActions(); @@ -9106,15 +9309,36 @@ public class Activity extends ContextThemeWrapper } } + void dispatchActivityResult(String who, int requestCode, int resultCode, Intent data, + ComponentCaller caller, String reason) { + internalDispatchActivityResult(who, requestCode, resultCode, data, caller, reason); + } + @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) void dispatchActivityResult(String who, int requestCode, int resultCode, Intent data, String reason) { + if (android.security.Flags.contentUriPermissionApis()) { + internalDispatchActivityResult(who, requestCode, resultCode, data, + new ComponentCaller(getActivityToken(), /* callerToken */ null), reason); + } else { + internalDispatchActivityResult(who, requestCode, resultCode, data, null, reason); + } + } + + private void internalDispatchActivityResult(String who, int requestCode, int resultCode, + Intent data, ComponentCaller caller, String reason) { if (false) Log.v( TAG, "Dispatching result: who=" + who + ", reqCode=" + requestCode + ", resCode=" + resultCode + ", data=" + data); mFragments.noteStateNotSaved(); if (who == null) { - onActivityResult(requestCode, resultCode, data); + if (android.security.Flags.contentUriPermissionApis()) { + mCurrentCaller = caller; + onActivityResult(requestCode, resultCode, data, caller); + mCurrentCaller = null; + } else { + onActivityResult(requestCode, resultCode, data); + } } else if (who.startsWith(REQUEST_PERMISSIONS_WHO_PREFIX)) { who = who.substring(REQUEST_PERMISSIONS_WHO_PREFIX.length()); if (TextUtils.isEmpty(who)) { @@ -9377,9 +9601,9 @@ public class Activity extends ContextThemeWrapper * Specifies whether the activities below this one in the task can also start other activities * or finish the task. *

- * Starting from Target SDK Level {@link android.os.Build.VERSION_CODES#UPSIDE_DOWN_CAKE}, apps - * are blocked from starting new activities or finishing their task unless the top activity of - * such task belong to the same UID for security reasons. + * Starting from Target SDK Level {@link android.os.Build.VERSION_CODES#VANILLA_ICE_CREAM}, apps + * may be blocked from starting new activities or finishing their task unless the top activity + * of such task belong to the same UID for security reasons. *

* Setting this flag to {@code true} will allow the launching app to ignore the restriction if * this activity is on top. Apps matching the UID of this activity are always exempt. diff --git a/core/java/android/app/ActivityClient.java b/core/java/android/app/ActivityClient.java index b8bd030872c120703621e00b08c1b68d84c1cc7d..10dc3c6c1360610ee6ed545e0ed28bc94256a075 100644 --- a/core/java/android/app/ActivityClient.java +++ b/core/java/android/app/ActivityClient.java @@ -17,13 +17,16 @@ package android.app; import static android.Manifest.permission.INTERNAL_SYSTEM_WINDOW; +import static android.os.UserHandle.getCallingUserId; import android.annotation.Nullable; import android.annotation.RequiresPermission; import android.content.ComponentName; +import android.content.ContentProvider; import android.content.Intent; import android.content.res.Configuration; import android.content.res.Resources; +import android.net.Uri; import android.os.Bundle; import android.os.IBinder; import android.os.IRemoteCallback; @@ -296,6 +299,38 @@ public class ActivityClient { } } + /** Returns the uid of the app that launched the activity. */ + public int getActivityCallerUid(IBinder activityToken, IBinder callerToken) { + try { + return getActivityClientController().getActivityCallerUid(activityToken, + callerToken); + } catch (RemoteException e) { + throw e.rethrowFromSystemServer(); + } + } + + /** Returns the package of the app that launched the activity. */ + public String getActivityCallerPackage(IBinder activityToken, IBinder callerToken) { + try { + return getActivityClientController().getActivityCallerPackage(activityToken, + callerToken); + } catch (RemoteException e) { + throw e.rethrowFromSystemServer(); + } + } + + /** Checks if the app that launched the activity has access to the URI. */ + public int checkActivityCallerContentUriPermission(IBinder activityToken, IBinder callerToken, + Uri uri, int modeFlags) { + try { + return getActivityClientController().checkActivityCallerContentUriPermission( + activityToken, callerToken, ContentProvider.getUriWithoutUserId(uri), modeFlags, + ContentProvider.getUserIdFromUri(uri, getCallingUserId())); + } catch (RemoteException e) { + throw e.rethrowFromSystemServer(); + } + } + public void setRequestedOrientation(IBinder token, int requestedOrientation) { try { getActivityClientController().setRequestedOrientation(token, requestedOrientation); diff --git a/core/java/android/app/ActivityGroup.java b/core/java/android/app/ActivityGroup.java index cb06eea2059ec0793e739bad51ffd738335c1618..21c67edc607ebfb244e16e8efba97bac8b0b8e78 100644 --- a/core/java/android/app/ActivityGroup.java +++ b/core/java/android/app/ActivityGroup.java @@ -111,7 +111,7 @@ public class ActivityGroup extends Activity { @Override void dispatchActivityResult(String who, int requestCode, int resultCode, - Intent data, String reason) { + Intent data, ComponentCaller caller, String reason) { if (who != null) { Activity act = mLocalActivityManager.getActivity(who); /* @@ -125,7 +125,7 @@ public class ActivityGroup extends Activity { return; } } - super.dispatchActivityResult(who, requestCode, resultCode, data, reason); + super.dispatchActivityResult(who, requestCode, resultCode, data, caller, reason); } } diff --git a/core/java/android/app/ActivityManager.java b/core/java/android/app/ActivityManager.java index 82ad6bcf56b1f69d17989afa0ae89294d12ad2ba..f3585229d823b853dd823be61a4db526a81c0a6b 100644 --- a/core/java/android/app/ActivityManager.java +++ b/core/java/android/app/ActivityManager.java @@ -20,6 +20,7 @@ import static android.app.WindowConfiguration.activityTypeToString; import static android.app.WindowConfiguration.windowingModeToString; import static android.content.Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS; import static android.content.pm.ActivityInfo.RESIZE_MODE_RESIZEABLE; +import static android.media.audio.Flags.FLAG_FOREGROUND_AUDIO_CONTROL; import android.Manifest; import android.annotation.ColorInt; @@ -107,6 +108,7 @@ import java.util.Collection; import java.util.Collections; import java.util.List; import java.util.Locale; +import java.util.Objects; import java.util.concurrent.Executor; import java.util.function.Consumer; @@ -146,6 +148,7 @@ import java.util.function.Consumer; *

*/ @SystemService(Context.ACTIVITY_SERVICE) +@android.ravenwood.annotation.RavenwoodKeepPartialClass public class ActivityManager { private static String TAG = "ActivityManager"; @@ -792,6 +795,7 @@ public class ActivityManager { PROCESS_CAPABILITY_POWER_RESTRICTED_NETWORK, PROCESS_CAPABILITY_BFSL, PROCESS_CAPABILITY_USER_RESTRICTED_NETWORK, + PROCESS_CAPABILITY_FOREGROUND_AUDIO_CONTROL, }) @Retention(RetentionPolicy.SOURCE) public @interface ProcessCapability {} @@ -940,6 +944,14 @@ public class ActivityManager { @TestApi public static final int PROCESS_CAPABILITY_USER_RESTRICTED_NETWORK = 1 << 5; + /** + * @hide + * Process can access volume APIs and can request audio focus with GAIN. + */ + @FlaggedApi(FLAG_FOREGROUND_AUDIO_CONTROL) + @SystemApi + public static final int PROCESS_CAPABILITY_FOREGROUND_AUDIO_CONTROL = 1 << 6; + /** * @hide all capabilities, the ORing of all flags in {@link ProcessCapability}. * @@ -951,7 +963,8 @@ public class ActivityManager { | PROCESS_CAPABILITY_FOREGROUND_MICROPHONE | PROCESS_CAPABILITY_POWER_RESTRICTED_NETWORK | PROCESS_CAPABILITY_BFSL - | PROCESS_CAPABILITY_USER_RESTRICTED_NETWORK; + | PROCESS_CAPABILITY_USER_RESTRICTED_NETWORK + | PROCESS_CAPABILITY_FOREGROUND_AUDIO_CONTROL; /** * All implicit capabilities. There are capabilities that process automatically have. @@ -965,6 +978,7 @@ public class ActivityManager { * Print capability bits in human-readable form. * @hide */ + @android.ravenwood.annotation.RavenwoodKeep public static void printCapabilitiesSummary(PrintWriter pw, @ProcessCapability int caps) { pw.print((caps & PROCESS_CAPABILITY_FOREGROUND_LOCATION) != 0 ? 'L' : '-'); pw.print((caps & PROCESS_CAPABILITY_FOREGROUND_CAMERA) != 0 ? 'C' : '-'); @@ -972,9 +986,11 @@ public class ActivityManager { pw.print((caps & PROCESS_CAPABILITY_POWER_RESTRICTED_NETWORK) != 0 ? 'N' : '-'); pw.print((caps & PROCESS_CAPABILITY_BFSL) != 0 ? 'F' : '-'); pw.print((caps & PROCESS_CAPABILITY_USER_RESTRICTED_NETWORK) != 0 ? 'U' : '-'); + pw.print((caps & PROCESS_CAPABILITY_FOREGROUND_AUDIO_CONTROL) != 0 ? 'A' : '-'); } /** @hide */ + @android.ravenwood.annotation.RavenwoodKeep public static void printCapabilitiesSummary(StringBuilder sb, @ProcessCapability int caps) { sb.append((caps & PROCESS_CAPABILITY_FOREGROUND_LOCATION) != 0 ? 'L' : '-'); sb.append((caps & PROCESS_CAPABILITY_FOREGROUND_CAMERA) != 0 ? 'C' : '-'); @@ -982,12 +998,14 @@ public class ActivityManager { sb.append((caps & PROCESS_CAPABILITY_POWER_RESTRICTED_NETWORK) != 0 ? 'N' : '-'); sb.append((caps & PROCESS_CAPABILITY_BFSL) != 0 ? 'F' : '-'); sb.append((caps & PROCESS_CAPABILITY_USER_RESTRICTED_NETWORK) != 0 ? 'U' : '-'); + sb.append((caps & PROCESS_CAPABILITY_FOREGROUND_AUDIO_CONTROL) != 0 ? 'A' : '-'); } /** * Print capability bits in human-readable form. * @hide */ + @android.ravenwood.annotation.RavenwoodKeep public static void printCapabilitiesFull(PrintWriter pw, @ProcessCapability int caps) { printCapabilitiesSummary(pw, caps); final int remain = caps & ~PROCESS_CAPABILITY_ALL; @@ -998,6 +1016,7 @@ public class ActivityManager { } /** @hide */ + @android.ravenwood.annotation.RavenwoodKeep public static String getCapabilitiesSummary(@ProcessCapability int caps) { final StringBuilder sb = new StringBuilder(); printCapabilitiesSummary(sb, caps); @@ -1017,6 +1036,7 @@ public class ActivityManager { * @return the value of the corresponding enums.proto ProcessStateEnum value. * @hide */ + @android.ravenwood.annotation.RavenwoodKeep public static final int processStateAmToProto(int amInt) { switch (amInt) { case PROCESS_STATE_UNKNOWN: @@ -1077,16 +1097,19 @@ public class ActivityManager { public static final int MAX_PROCESS_STATE = PROCESS_STATE_NONEXISTENT; /** @hide Should this process state be considered a background state? */ + @android.ravenwood.annotation.RavenwoodKeep public static final boolean isProcStateBackground(int procState) { return procState >= PROCESS_STATE_TRANSIENT_BACKGROUND; } /** @hide Should this process state be considered in the cache? */ + @android.ravenwood.annotation.RavenwoodKeep public static final boolean isProcStateCached(int procState) { return procState >= PROCESS_STATE_CACHED_ACTIVITY; } /** @hide Is this a foreground service type? */ + @android.ravenwood.annotation.RavenwoodKeep public static boolean isForegroundService(int procState) { return procState == PROCESS_STATE_FOREGROUND_SERVICE; } @@ -1160,10 +1183,25 @@ public class ActivityManager { mContext = context; } + private static volatile int sCurrentUser$ravenwood = UserHandle.USER_NULL; + + /** @hide */ + @android.ravenwood.annotation.RavenwoodKeep + public static void init$ravenwood(int currentUser) { + sCurrentUser$ravenwood = currentUser; + } + + /** @hide */ + @android.ravenwood.annotation.RavenwoodKeep + public static void reset$ravenwood() { + sCurrentUser$ravenwood = UserHandle.USER_NULL; + } + /** * Returns whether the launch was successful. * @hide */ + @android.ravenwood.annotation.RavenwoodKeep public static final boolean isStartResultSuccessful(int result) { return FIRST_START_SUCCESS_CODE <= result && result <= LAST_START_SUCCESS_CODE; } @@ -1172,6 +1210,7 @@ public class ActivityManager { * Returns whether the launch result was a fatal error. * @hide */ + @android.ravenwood.annotation.RavenwoodKeep public static final boolean isStartResultFatalError(int result) { return FIRST_START_FATAL_ERROR_CODE <= result && result <= LAST_START_FATAL_ERROR_CODE; } @@ -1342,6 +1381,7 @@ public class ActivityManager { public @interface RestrictionLevel{} /** @hide */ + @android.ravenwood.annotation.RavenwoodKeep public static String restrictionLevelToName(@RestrictionLevel int level) { switch (level) { case RESTRICTION_LEVEL_UNKNOWN: @@ -4054,10 +4094,28 @@ public class ActivityManager { } } + private final ArrayList mAppStartInfoCallbacks = + new ArrayList<>(); + @Nullable + private IApplicationStartInfoCompleteListener mAppStartInfoCompleteListener = null; + + private static final class AppStartInfoCallbackWrapper { + @NonNull final Executor mExecutor; + @NonNull final Consumer mListener; + + AppStartInfoCallbackWrapper(@NonNull final Executor executor, + @NonNull final Consumer listener) { + mExecutor = executor; + mListener = listener; + } + } + /** - * Sets a callback to be notified when the {@link ApplicationStartInfo} records of this startup + * Adds a callback to be notified when the {@link ApplicationStartInfo} records of this startup * are complete. * + *

Note: callback will be removed automatically after being triggered.

+ * *

Note: callback will not wait for {@link Activity#reportFullyDrawn} to occur. * Timestamp for fully drawn may be added after callback occurs. Set callback after invoking * {@link Activity#reportFullyDrawn} if timestamp for fully drawn is required.

@@ -4075,33 +4133,77 @@ public class ActivityManager { * @throws IllegalArgumentException if executor or listener are null. */ @FlaggedApi(Flags.FLAG_APP_START_INFO) - public void setApplicationStartInfoCompletionListener(@NonNull final Executor executor, + public void addApplicationStartInfoCompletionListener(@NonNull final Executor executor, @NonNull final Consumer listener) { Preconditions.checkNotNull(executor, "executor cannot be null"); Preconditions.checkNotNull(listener, "listener cannot be null"); - IApplicationStartInfoCompleteListener callback = - new IApplicationStartInfoCompleteListener.Stub() { - @Override - public void onApplicationStartInfoComplete(ApplicationStartInfo applicationStartInfo) { - executor.execute(() -> listener.accept(applicationStartInfo)); + synchronized (mAppStartInfoCallbacks) { + for (int i = 0; i < mAppStartInfoCallbacks.size(); i++) { + if (listener.equals(mAppStartInfoCallbacks.get(i).mListener)) { + return; + } + } + if (mAppStartInfoCompleteListener == null) { + mAppStartInfoCompleteListener = new IApplicationStartInfoCompleteListener.Stub() { + @Override + public void onApplicationStartInfoComplete( + ApplicationStartInfo applicationStartInfo) { + synchronized (mAppStartInfoCallbacks) { + for (int i = 0; i < mAppStartInfoCallbacks.size(); i++) { + final AppStartInfoCallbackWrapper callback = + mAppStartInfoCallbacks.get(i); + callback.mExecutor.execute(() -> callback.mListener.accept( + applicationStartInfo)); + } + mAppStartInfoCallbacks.clear(); + mAppStartInfoCompleteListener = null; + } + } + }; + boolean succeeded = false; + try { + getService().addApplicationStartInfoCompleteListener( + mAppStartInfoCompleteListener, mContext.getUserId()); + succeeded = true; + } catch (RemoteException e) { + throw e.rethrowFromSystemServer(); + } + if (succeeded) { + mAppStartInfoCallbacks.add(new AppStartInfoCallbackWrapper(executor, listener)); + } else { + mAppStartInfoCompleteListener = null; + mAppStartInfoCallbacks.clear(); + } + } else { + mAppStartInfoCallbacks.add(new AppStartInfoCallbackWrapper(executor, listener)); } - }; - try { - getService().setApplicationStartInfoCompleteListener(callback, mContext.getUserId()); - } catch (RemoteException e) { - throw e.rethrowFromSystemServer(); } } /** - * Removes the callback set by {@link #setApplicationStartInfoCompletionListener} if there is one. + * Removes the provided callback set by {@link #addApplicationStartInfoCompletionListener}. */ @FlaggedApi(Flags.FLAG_APP_START_INFO) - public void clearApplicationStartInfoCompletionListener() { - try { - getService().clearApplicationStartInfoCompleteListener(mContext.getUserId()); - } catch (RemoteException e) { - throw e.rethrowFromSystemServer(); + public void removeApplicationStartInfoCompletionListener( + @NonNull final Consumer listener) { + Preconditions.checkNotNull(listener, "listener cannot be null"); + synchronized (mAppStartInfoCallbacks) { + for (int i = 0; i < mAppStartInfoCallbacks.size(); i++) { + final AppStartInfoCallbackWrapper callback = mAppStartInfoCallbacks.get(i); + if (listener.equals(callback.mListener)) { + mAppStartInfoCallbacks.remove(i); + break; + } + } + if (mAppStartInfoCompleteListener != null && mAppStartInfoCallbacks.isEmpty()) { + try { + getService().removeApplicationStartInfoCompleteListener( + mAppStartInfoCompleteListener, mContext.getUserId()); + } catch (RemoteException e) { + throw e.rethrowFromSystemServer(); + } + mAppStartInfoCompleteListener = null; + } } } @@ -4342,7 +4444,7 @@ public class ActivityManager { } /** - * Start monitoring changes to the importance of uids running in the system. + * Start monitoring changes to the importance of all uids running in the system. * @param listener The listener callback that will receive change reports. * @param importanceCutpoint The level of importance in which the caller is interested * in differences. For example, if {@link RunningAppProcessInfo#IMPORTANCE_PERCEPTIBLE} @@ -4353,6 +4455,10 @@ public class ActivityManager { *

The caller must hold the {@link android.Manifest.permission#PACKAGE_USAGE_STATS} * permission to use this feature.

* + *

Calling this API with the same instance of {@code listener} without + * unregistering with {@link #removeOnUidImportanceListener} before it will result in + * an {@link IllegalArgumentException}.

+ * * @throws IllegalArgumentException If the listener is already registered. * @throws SecurityException If the caller does not hold * {@link android.Manifest.permission#PACKAGE_USAGE_STATS}. @@ -4362,17 +4468,53 @@ public class ActivityManager { @RequiresPermission(Manifest.permission.PACKAGE_USAGE_STATS) public void addOnUidImportanceListener(OnUidImportanceListener listener, @RunningAppProcessInfo.Importance int importanceCutpoint) { - synchronized (this) { + addOnUidImportanceListenerInternal(listener, importanceCutpoint, null /* uids */); + } + + /** + * Start monitoring changes to the importance of given uids running in the system. + * + * @param listener The listener callback that will receive change reports. + * @param importanceCutpoint The level of importance in which the caller is interested + * in differences. For example, if {@link RunningAppProcessInfo#IMPORTANCE_PERCEPTIBLE} + * is used here, you will receive a call each time a uids importance transitions between + * being <= {@link RunningAppProcessInfo#IMPORTANCE_PERCEPTIBLE} and + * > {@link RunningAppProcessInfo#IMPORTANCE_PERCEPTIBLE}. + * @param uids The UIDs that this listener is interested with. + * {@link #addOnUidImportanceListener(OnUidImportanceListener, int)} in this case. + * + *

Calling this API with the same instance of {@code listener} without + * unregistering with {@link #removeOnUidImportanceListener} before it will result in + * an {@link IllegalArgumentException}.

+ * + * @throws IllegalArgumentException If the listener is already registered. + * @hide + */ + @FlaggedApi(Flags.FLAG_UID_IMPORTANCE_LISTENER_FOR_UIDS) + @SystemApi + @SuppressLint("SamShouldBeLast") + @RequiresPermission(Manifest.permission.PACKAGE_USAGE_STATS) + public void addOnUidImportanceListener(@NonNull OnUidImportanceListener listener, + @RunningAppProcessInfo.Importance int importanceCutpoint, @NonNull int[] uids) { + Objects.requireNonNull(listener); + Objects.requireNonNull(uids); + addOnUidImportanceListenerInternal(listener, importanceCutpoint, uids); + } + + @RequiresPermission(Manifest.permission.PACKAGE_USAGE_STATS) + private void addOnUidImportanceListenerInternal(@NonNull OnUidImportanceListener listener, + @RunningAppProcessInfo.Importance int importanceCutpoint, @Nullable int[] uids) { + synchronized (mImportanceListeners) { if (mImportanceListeners.containsKey(listener)) { throw new IllegalArgumentException("Listener already registered: " + listener); } // TODO: implement the cut point in the system process to avoid IPCs. MyUidObserver observer = new MyUidObserver(listener, mContext); try { - getService().registerUidObserver(observer, + getService().registerUidObserverForUids(observer, UID_OBSERVER_PROCSTATE | UID_OBSERVER_GONE, RunningAppProcessInfo.importanceToProcState(importanceCutpoint), - mContext.getOpPackageName()); + mContext.getOpPackageName(), uids); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } @@ -4390,7 +4532,7 @@ public class ActivityManager { @SystemApi @RequiresPermission(Manifest.permission.PACKAGE_USAGE_STATS) public void removeOnUidImportanceListener(OnUidImportanceListener listener) { - synchronized (this) { + synchronized (mImportanceListeners) { MyUidObserver observer = mImportanceListeners.remove(listener); if (observer == null) { throw new IllegalArgumentException("Listener not registered: " + listener); @@ -4676,6 +4818,7 @@ public class ActivityManager { * Returns "true" if the user interface is currently being messed with * by a monkey. */ + @android.ravenwood.annotation.RavenwoodReplace public static boolean isUserAMonkey() { try { return getService().isUserAMonkey(); @@ -4684,6 +4827,12 @@ public class ActivityManager { } } + /** @hide */ + public static boolean isUserAMonkey$ravenwood() { + // Ravenwood environment is never considered a "monkey" + return false; + } + /** * Returns "true" if device is running in a test harness. * @@ -4870,6 +5019,7 @@ public class ActivityManager { "android.permission.INTERACT_ACROSS_USERS", "android.permission.INTERACT_ACROSS_USERS_FULL" }) + @android.ravenwood.annotation.RavenwoodReplace public static int getCurrentUser() { try { return getService().getCurrentUserId(); @@ -4878,6 +5028,11 @@ public class ActivityManager { } } + /** @hide */ + public static int getCurrentUser$ravenwood() { + return sCurrentUser$ravenwood; + } + /** * @param userid the user's id. Zero indicates the default user. * @hide @@ -5217,6 +5372,7 @@ public class ActivityManager { /** * @hide */ + @android.ravenwood.annotation.RavenwoodReplace public static boolean isSystemReady() { if (!sSystemReady) { if (ActivityThread.isSystem()) { @@ -5231,6 +5387,12 @@ public class ActivityManager { return sSystemReady; } + /** @hide */ + public static boolean isSystemReady$ravenwood() { + // Ravenwood environment is always considered as booted and ready + return true; + } + /** * @hide */ @@ -5558,11 +5720,13 @@ public class ActivityManager { } /** @hide */ + @android.ravenwood.annotation.RavenwoodKeep public static boolean isProcStateConsideredInteraction(@ProcessState int procState) { return (procState <= PROCESS_STATE_TOP || procState == PROCESS_STATE_BOUND_TOP); } /** @hide */ + @android.ravenwood.annotation.RavenwoodKeep public static String procStateToString(int procState) { final String procStateStr; switch (procState) { @@ -5802,6 +5966,25 @@ public class ActivityManager { } } + /** + * Used by ThemeOverlayController to notify when color + * palette is ready. + * + * @param userId The ID of the user where ThemeOverlayController is ready. + * + * @throws RemoteException + * + * @hide + */ + @RequiresPermission(Manifest.permission.SET_THEME_OVERLAY_CONTROLLER_READY) + public void setThemeOverlayReady(@UserIdInt int userId) { + try { + getService().setThemeOverlayReady(userId); + } catch (RemoteException e) { + throw e.rethrowFromSystemServer(); + } + } + /** * Resets the state of the {@link com.android.server.am.AppErrors} instance. * This is intended for use with CTS only. diff --git a/core/java/android/app/ActivityManagerInternal.java b/core/java/android/app/ActivityManagerInternal.java index ea9bb396f83c9191477458aa54fe334577f228d5..062b89ed57ba9e23ba52e6c6224f68522daecf58 100644 --- a/core/java/android/app/ActivityManagerInternal.java +++ b/core/java/android/app/ActivityManagerInternal.java @@ -537,8 +537,8 @@ public abstract class ActivityManagerInternal { /** * Returns whether the given user requires credential entry at this time. This is used to - * intercept activity launches for locked work apps due to work challenge being triggered or - * when the profile user is yet to be unlocked. + * intercept activity launches for apps corresponding to locked profiles due to separate + * challenge being triggered or when the profile user is yet to be unlocked. */ public abstract boolean shouldConfirmCredentials(@UserIdInt int userId); @@ -1164,6 +1164,30 @@ public abstract class ActivityManagerInternal { */ public abstract void logFgsApiEnd(int apiType, int uid, int pid); + /** + * Checks whether an app will be able to start a foreground service or not. + * + * @param pid The process id belonging to the app to be checked. + * @param uid The UID of the app to be checked. + * @param packageName The package name of the app to be checked. + * @return whether the app will be able to start a foreground service or not. + */ + public abstract boolean canStartForegroundService( + int pid, int uid, @NonNull String packageName); + + /** + * Returns {@code true} if a foreground service started by an uid is allowed to have + * while-in-use permissions. + * + * @param pid The process id belonging to the app to be checked. + * @param uid The UID of the app to be checked. + * @param packageName The package name of the app to be checked. + * @return whether the foreground service is allowed to have while-in-use permissions. + * @hide + */ + public abstract boolean canAllowWhileInUsePermissionInFgs( + int pid, int uid, @NonNull String packageName); + /** * Temporarily allow foreground service started by an uid to have while-in-use permission * for durationMs. @@ -1234,4 +1258,11 @@ public abstract class ActivityManagerInternal { */ public abstract boolean clearApplicationUserData(String packageName, boolean keepState, boolean isRestore, IPackageDataObserver observer, int userId); + + /** + * Returns current state of {@link com.android.systemui.theme.ThemeOverlayController} color + * palette readiness. + * @hide + */ + public abstract boolean isThemeOverlayReady(int userId); } diff --git a/core/java/android/app/ActivityOptions.aidl b/core/java/android/app/ActivityOptions.aidl new file mode 100644 index 0000000000000000000000000000000000000000..2d4a85f4f6f41457f773c007b9dd8787578c6c88 --- /dev/null +++ b/core/java/android/app/ActivityOptions.aidl @@ -0,0 +1,23 @@ +/** + * Copyright (c) 2024, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.app; + +/** @hide */ +parcelable ActivityOptions.SceneTransitionInfo; + +/** @hide */ +parcelable ActivityOptions.LaunchCookie; \ No newline at end of file diff --git a/core/java/android/app/ActivityOptions.java b/core/java/android/app/ActivityOptions.java index 9c279c3b82544846fcd3e192cd23c3732347b0f0..e094ac61b500bc84468d0db1a275e59b845a43f1 100644 --- a/core/java/android/app/ActivityOptions.java +++ b/core/java/android/app/ActivityOptions.java @@ -20,6 +20,7 @@ import static android.Manifest.permission.CONTROL_REMOTE_APP_TRANSITION_ANIMATIO import static android.Manifest.permission.START_TASKS_FROM_RECENTS; import static android.app.WindowConfiguration.ACTIVITY_TYPE_UNDEFINED; import static android.app.WindowConfiguration.WINDOWING_MODE_UNDEFINED; +import static android.content.Intent.FLAG_ACTIVITY_MULTIPLE_TASK; import static android.content.Intent.FLAG_ACTIVITY_NEW_TASK; import static android.content.Intent.FLAG_RECEIVER_FOREGROUND; import static android.view.Display.INVALID_DISPLAY; @@ -29,6 +30,7 @@ import android.annotation.IntDef; import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.RequiresPermission; +import android.annotation.SuppressLint; import android.annotation.SystemApi; import android.annotation.TestApi; import android.app.ExitTransitionCoordinator.ActivityExitTransitionCallbacks; @@ -41,6 +43,7 @@ import android.graphics.Bitmap; import android.graphics.Bitmap.Config; import android.graphics.Rect; import android.hardware.HardwareBuffer; +import android.os.Binder; import android.os.Bundle; import android.os.Handler; import android.os.IBinder; @@ -73,6 +76,7 @@ import java.util.ArrayList; * {@link android.content.Context#startActivity(android.content.Intent, android.os.Bundle) * Context.startActivity(Intent, Bundle)} and related methods. */ +@android.ravenwood.annotation.RavenwoodKeepWholeClass public class ActivityOptions extends ComponentOptions { private static final String TAG = "ActivityOptions"; @@ -89,15 +93,30 @@ public class ActivityOptions extends ComponentOptions { */ public static final String EXTRA_USAGE_TIME_REPORT_PACKAGES = "android.usage_time_packages"; - /** No explicit value chosen. The system will decide whether to grant privileges. */ - public static final int MODE_BACKGROUND_ACTIVITY_START_SYSTEM_DEFINED = - ComponentOptions.MODE_BACKGROUND_ACTIVITY_START_SYSTEM_DEFINED; - /** Allow the {@link PendingIntent} to use the background activity start privileges. */ - public static final int MODE_BACKGROUND_ACTIVITY_START_ALLOWED = - ComponentOptions.MODE_BACKGROUND_ACTIVITY_START_ALLOWED; - /** Deny the {@link PendingIntent} to use the background activity start privileges. */ - public static final int MODE_BACKGROUND_ACTIVITY_START_DENIED = - ComponentOptions.MODE_BACKGROUND_ACTIVITY_START_DENIED; + /** Enumeration of background activity start modes. + * + * These define if an app wants to grant it's background activity start privileges to a + * {@link PendingIntent}. + * @hide + */ + @Retention(RetentionPolicy.SOURCE) + @IntDef(prefix = {"MODE_BACKGROUND_ACTIVITY_START_"}, value = { + MODE_BACKGROUND_ACTIVITY_START_SYSTEM_DEFINED, + MODE_BACKGROUND_ACTIVITY_START_ALLOWED, + MODE_BACKGROUND_ACTIVITY_START_DENIED}) + public @interface BackgroundActivityStartMode {} + /** + * No explicit value chosen. The system will decide whether to grant privileges. + */ + public static final int MODE_BACKGROUND_ACTIVITY_START_SYSTEM_DEFINED = 0; + /** + * Allow the {@link PendingIntent} to use the background activity start privileges. + */ + public static final int MODE_BACKGROUND_ACTIVITY_START_ALLOWED = 1; + /** + * Deny the {@link PendingIntent} to use the background activity start privileges. + */ + public static final int MODE_BACKGROUND_ACTIVITY_START_DENIED = 2; /** * The package name that created the options. @@ -181,6 +200,12 @@ public class ActivityOptions extends ComponentOptions { */ public static final String KEY_ANIM_START_LISTENER = "android:activity.animStartListener"; + /** + * Callback for when animation is aborted. + * @hide + */ + private static final String KEY_ANIM_ABORT_LISTENER = "android:activity.animAbortListener"; + /** * Specific a theme for a splash screen window. * @hide @@ -357,22 +382,7 @@ public class ActivityOptions extends ComponentOptions { private static final String KEY_APPLY_NO_USER_ACTION_FLAG_FOR_SHORTCUT = "android:activity.applyNoUserActionFlagForShortcut"; - /** - * For Activity transitions, the calling Activity's TransitionListener used to - * notify the called Activity when the shared element and the exit transitions - * complete. - */ - private static final String KEY_TRANSITION_COMPLETE_LISTENER - = "android:activity.transitionCompleteListener"; - - private static final String KEY_TRANSITION_IS_RETURNING - = "android:activity.transitionIsReturning"; - private static final String KEY_TRANSITION_SHARED_ELEMENTS - = "android:activity.sharedElementNames"; - private static final String KEY_RESULT_DATA = "android:activity.resultData"; - private static final String KEY_RESULT_CODE = "android:activity.resultCode"; - private static final String KEY_EXIT_COORDINATOR_INDEX - = "android:activity.exitCoordinatorIndex"; + private static final String KEY_SCENE_TRANSITION_INFO = "android:activity.sceneTransitionInfo"; /** See {@link SourceInfo}. */ private static final String KEY_SOURCE_INFO = "android.activity.sourceInfo"; @@ -472,12 +482,8 @@ public class ActivityOptions extends ComponentOptions { private int mHeight; private IRemoteCallback mAnimationStartedListener; private IRemoteCallback mAnimationFinishedListener; - private ResultReceiver mTransitionReceiver; - private boolean mIsReturning; - private ArrayList mSharedElementNames; - private Intent mResultData; - private int mResultCode; - private int mExitCoordinatorIndex; + private IRemoteCallback mAnimationAbortListener; + private SceneTransitionInfo mSceneTransitionInfo; private PendingIntent mUsageTimeReport; private int mLaunchDisplayId = INVALID_DISPLAY; private int mCallerDisplayId = INVALID_DISPLAY; @@ -538,6 +544,7 @@ public class ActivityOptions extends ComponentOptions { * @return Returns a new ActivityOptions object that you can use to * supply these options as the options Bundle when starting an activity. */ + @android.ravenwood.annotation.RavenwoodThrow(blockedBy = Context.class) public static ActivityOptions makeCustomAnimation(Context context, int enterResId, int exitResId) { return makeCustomAnimation(context, enterResId, exitResId, 0, null, null); @@ -558,6 +565,7 @@ public class ActivityOptions extends ComponentOptions { * @return Returns a new ActivityOptions object that you can use to * supply these options as the options Bundle when starting an activity. */ + @android.ravenwood.annotation.RavenwoodThrow(blockedBy = Context.class) public static @NonNull ActivityOptions makeCustomAnimation(@NonNull Context context, int enterResId, int exitResId, int backgroundColor) { return makeCustomAnimation(context, enterResId, exitResId, backgroundColor, null, null); @@ -583,6 +591,7 @@ public class ActivityOptions extends ComponentOptions { * @hide */ @UnsupportedAppUsage + @android.ravenwood.annotation.RavenwoodThrow(blockedBy = Context.class) public static ActivityOptions makeCustomAnimation(Context context, int enterResId, int exitResId, int backgroundColor, Handler handler, OnAnimationStartedListener listener) { @@ -618,6 +627,7 @@ public class ActivityOptions extends ComponentOptions { * @hide */ @TestApi + @android.ravenwood.annotation.RavenwoodThrow(blockedBy = Context.class) public static @NonNull ActivityOptions makeCustomAnimation(@NonNull Context context, int enterResId, int exitResId, int backgroundColor, @Nullable Handler handler, @Nullable OnAnimationStartedListener startedListener, @@ -652,6 +662,7 @@ public class ActivityOptions extends ComponentOptions { */ @RequiresPermission(START_TASKS_FROM_RECENTS) @TestApi + @android.ravenwood.annotation.RavenwoodThrow(blockedBy = Context.class) public static @NonNull ActivityOptions makeCustomTaskAnimation(@NonNull Context context, int enterResId, int exitResId, @Nullable Handler handler, @Nullable OnAnimationStartedListener startedListener, @@ -674,6 +685,7 @@ public class ActivityOptions extends ComponentOptions { * supply these options as the options Bundle when running an in-place animation. * @hide */ + @android.ravenwood.annotation.RavenwoodThrow(blockedBy = Context.class) public static ActivityOptions makeCustomInPlaceAnimation(Context context, int animId) { if (animId == 0) { throw new RuntimeException("You must specify a valid animation."); @@ -733,6 +745,14 @@ public class ActivityOptions extends ComponentOptions { } } + /** + * Callback for finding out when the given animation is finished + * @hide + */ + public void setOnAnimationFinishedListener(IRemoteCallback listener) { + mAnimationFinishedListener = listener; + } + /** * Callback for finding out when the given animation has drawn its last frame. * @hide @@ -745,6 +765,14 @@ public class ActivityOptions extends ComponentOptions { void onAnimationFinished(long elapsedRealTime); } + /** + * Callback for finding out when the given animation is aborted + * @hide + */ + public void setOnAnimationAbortListener(IRemoteCallback listener) { + mAnimationAbortListener = listener; + } + /** * Create an ActivityOptions specifying an animation where the new * activity is scaled from a small originating area of the screen to @@ -764,6 +792,7 @@ public class ActivityOptions extends ComponentOptions { * @return Returns a new ActivityOptions object that you can use to * supply these options as the options Bundle when starting an activity. */ + @android.ravenwood.annotation.RavenwoodThrow(blockedBy = View.class) public static ActivityOptions makeScaleUpAnimation(View source, int startX, int startY, int width, int height) { ActivityOptions opts = new ActivityOptions(); @@ -792,6 +821,7 @@ public class ActivityOptions extends ComponentOptions { * @return Returns a new ActivityOptions object that you can use to * supply these options as the options Bundle when starting an activity. */ + @android.ravenwood.annotation.RavenwoodThrow(blockedBy = View.class) public static ActivityOptions makeClipRevealAnimation(View source, int startX, int startY, int width, int height) { ActivityOptions opts = new ActivityOptions(); @@ -837,6 +867,7 @@ public class ActivityOptions extends ComponentOptions { * @return Returns a new ActivityOptions object that you can use to * supply these options as the options Bundle when starting an activity. */ + @android.ravenwood.annotation.RavenwoodThrow(blockedBy = View.class) public static ActivityOptions makeThumbnailScaleUpAnimation(View source, Bitmap thumbnail, int startX, int startY) { return makeThumbnailScaleUpAnimation(source, thumbnail, startX, startY, null); @@ -859,11 +890,13 @@ public class ActivityOptions extends ComponentOptions { * @return Returns a new ActivityOptions object that you can use to * supply these options as the options Bundle when starting an activity. */ + @android.ravenwood.annotation.RavenwoodThrow(blockedBy = View.class) private static ActivityOptions makeThumbnailScaleUpAnimation(View source, Bitmap thumbnail, int startX, int startY, OnAnimationStartedListener listener) { return makeThumbnailAnimation(source, thumbnail, startX, startY, listener, true); } + @android.ravenwood.annotation.RavenwoodThrow(blockedBy = View.class) private static ActivityOptions makeThumbnailAnimation(View source, Bitmap thumbnail, int startX, int startY, OnAnimationStartedListener listener, boolean scaleUp) { @@ -885,6 +918,7 @@ public class ActivityOptions extends ComponentOptions { * @hide */ @UnsupportedAppUsage + @android.ravenwood.annotation.RavenwoodThrow(blockedBy = Context.class) public static ActivityOptions makeMultiThumbFutureAspectScaleAnimation(Context context, Handler handler, IAppTransitionAnimationSpecsFuture specsFuture, OnAnimationStartedListener listener, boolean scaleUp) { @@ -917,6 +951,7 @@ public class ActivityOptions extends ComponentOptions { * supply these options as the options Bundle when starting an activity. * @hide */ + @android.ravenwood.annotation.RavenwoodThrow(blockedBy = View.class) public static ActivityOptions makeThumbnailAspectScaleDownAnimation(View source, Bitmap thumbnail, int startX, int startY, int targetWidth, int targetHeight, Handler handler, OnAnimationStartedListener listener) { @@ -924,6 +959,7 @@ public class ActivityOptions extends ComponentOptions { targetWidth, targetHeight, handler, listener, false); } + @android.ravenwood.annotation.RavenwoodThrow(blockedBy = View.class) private static ActivityOptions makeAspectScaledThumbnailAnimation(View source, Bitmap thumbnail, int startX, int startY, int targetWidth, int targetHeight, Handler handler, OnAnimationStartedListener listener, boolean scaleUp) { @@ -943,6 +979,7 @@ public class ActivityOptions extends ComponentOptions { } /** @hide */ + @android.ravenwood.annotation.RavenwoodThrow(blockedBy = View.class) public static ActivityOptions makeThumbnailAspectScaleDownAnimation(View source, AppTransitionAnimationSpec[] specs, Handler handler, OnAnimationStartedListener onAnimationStartedListener, @@ -975,6 +1012,7 @@ public class ActivityOptions extends ComponentOptions { * @see android.transition.Transition#setEpicenterCallback( * android.transition.Transition.EpicenterCallback) */ + @android.ravenwood.annotation.RavenwoodThrow(blockedBy = Activity.class) public static ActivityOptions makeSceneTransitionAnimation(Activity activity, View sharedElement, String sharedElementName) { return makeSceneTransitionAnimation(activity, Pair.create(sharedElement, sharedElementName)); @@ -1000,14 +1038,18 @@ public class ActivityOptions extends ComponentOptions { * android.transition.Transition.EpicenterCallback) */ @SafeVarargs + @android.ravenwood.annotation.RavenwoodThrow(blockedBy = Activity.class) public static ActivityOptions makeSceneTransitionAnimation(Activity activity, Pair... sharedElements) { ActivityOptions opts = new ActivityOptions(); ExitTransitionCoordinator exit = makeSceneTransitionAnimation( new ActivityExitTransitionCallbacks(activity), activity.mExitTransitionListener, activity.getWindow(), opts, sharedElements); - opts.mExitCoordinatorIndex = - activity.mActivityTransitionState.addExitTransitionCoordinator(exit); + final SceneTransitionInfo info = opts.getSceneTransitionInfo(); + if (info != null) { + info.setExitCoordinatorKey( + activity.mActivityTransitionState.addExitTransitionCoordinator(exit)); + } return opts; } @@ -1023,24 +1065,29 @@ public class ActivityOptions extends ComponentOptions { * @hide */ @SafeVarargs + @android.ravenwood.annotation.RavenwoodThrow(blockedBy = Window.class) public static Pair startSharedElementAnimation( Window window, ExitTransitionCallbacks exitCallbacks, SharedElementCallback callback, Pair... sharedElements) { ActivityOptions opts = new ActivityOptions(); ExitTransitionCoordinator exit = makeSceneTransitionAnimation( exitCallbacks, callback, window, opts, sharedElements); - opts.mExitCoordinatorIndex = -1; + final SceneTransitionInfo info = opts.getSceneTransitionInfo(); + if (info != null) { + info.setExitCoordinatorKey(-1); + } return Pair.create(opts, exit); } /** - * This method should be called when the - * {@link #startSharedElementAnimation(Window, ExitTransitionCallbacks, Pair[])} + * This method should be called when the {@link #startSharedElementAnimation(Window, + * ExitTransitionCallbacks, SharedElementCallback, Pair[])} * animation must be stopped and the Views reset. This can happen if there was an error * from startActivity or a springboard activity and the animation should stop and reset. * * @hide */ + @android.ravenwood.annotation.RavenwoodThrow(blockedBy = Window.class) public static void stopSharedElementAnimation(Window window) { final View decorView = window.getDecorView(); if (decorView == null) { @@ -1058,6 +1105,7 @@ public class ActivityOptions extends ComponentOptions { } } + @android.ravenwood.annotation.RavenwoodThrow(blockedBy = Window.class) static ExitTransitionCoordinator makeSceneTransitionAnimation( ExitTransitionCallbacks exitCallbacks, SharedElementCallback callback, Window window, ActivityOptions opts, Pair[] sharedElements) { @@ -1088,9 +1136,11 @@ public class ActivityOptions extends ComponentOptions { ExitTransitionCoordinator exit = new ExitTransitionCoordinator(exitCallbacks, window, callback, names, names, views, false); - opts.mTransitionReceiver = exit; - opts.mSharedElementNames = names; - opts.mIsReturning = false; + final SceneTransitionInfo info = new SceneTransitionInfo(); + info.setResultReceiver(exit); + info.setSharedElementNames(names); + info.setReturning(false); + opts.setSceneTransitionInfo(info); return exit; } @@ -1106,22 +1156,26 @@ public class ActivityOptions extends ComponentOptions { } /** @hide */ + @android.ravenwood.annotation.RavenwoodThrow(blockedBy = Activity.class) static ActivityOptions makeSceneTransitionAnimation(Activity activity, ExitTransitionCoordinator exitCoordinator, ArrayList sharedElementNames, int resultCode, Intent resultData) { ActivityOptions opts = new ActivityOptions(); opts.mAnimationType = ANIM_SCENE_TRANSITION; - opts.mSharedElementNames = sharedElementNames; - opts.mTransitionReceiver = exitCoordinator; - opts.mIsReturning = true; - opts.mResultCode = resultCode; - opts.mResultData = resultData; + final SceneTransitionInfo info = new SceneTransitionInfo(); + info.setSharedElementNames(sharedElementNames); + info.setResultReceiver(exitCoordinator); + info.setReturning(true); + info.setResultCode(resultCode); + info.setResultData(resultData); if (activity == null) { - opts.mExitCoordinatorIndex = -1; + info.setExitCoordinatorKey(-1); } else { - opts.mExitCoordinatorIndex = - activity.mActivityTransitionState.addExitTransitionCoordinator(exitCoordinator); + info.setExitCoordinatorKey( + activity.mActivityTransitionState.addExitTransitionCoordinator( + exitCoordinator)); } + opts.setSceneTransitionInfo(info); return opts; } @@ -1157,6 +1211,7 @@ public class ActivityOptions extends ComponentOptions { */ @RequiresPermission(CONTROL_REMOTE_APP_TRANSITION_ANIMATIONS) @UnsupportedAppUsage + @android.ravenwood.annotation.RavenwoodThrow(blockedBy = RemoteAnimationAdapter.class) public static ActivityOptions makeRemoteAnimation( RemoteAnimationAdapter remoteAnimationAdapter) { final ActivityOptions opts = new ActivityOptions(); @@ -1171,6 +1226,7 @@ public class ActivityOptions extends ComponentOptions { * @hide */ @RequiresPermission(CONTROL_REMOTE_APP_TRANSITION_ANIMATIONS) + @android.ravenwood.annotation.RavenwoodThrow(blockedBy = RemoteAnimationAdapter.class) public static ActivityOptions makeRemoteAnimation(RemoteAnimationAdapter remoteAnimationAdapter, RemoteTransition remoteTransition) { final ActivityOptions opts = new ActivityOptions(); @@ -1186,6 +1242,7 @@ public class ActivityOptions extends ComponentOptions { * @hide */ @RequiresPermission(CONTROL_REMOTE_APP_TRANSITION_ANIMATIONS) + @android.ravenwood.annotation.RavenwoodThrow(blockedBy = RemoteAnimationAdapter.class) public static ActivityOptions makeRemoteTransition(RemoteTransition remoteTransition) { final ActivityOptions opts = new ActivityOptions(); opts.mRemoteTransition = remoteTransition; @@ -1200,6 +1257,7 @@ public class ActivityOptions extends ComponentOptions { * picture-in-picture mode. */ @NonNull + @android.ravenwood.annotation.RavenwoodThrow(blockedBy = PictureInPictureParams.class) public static ActivityOptions makeLaunchIntoPip( @NonNull PictureInPictureParams pictureInPictureParams) { final ActivityOptions opts = new ActivityOptions(); @@ -1269,12 +1327,8 @@ public class ActivityOptions extends ComponentOptions { break; case ANIM_SCENE_TRANSITION: - mTransitionReceiver = opts.getParcelable(KEY_TRANSITION_COMPLETE_LISTENER, android.os.ResultReceiver.class); - mIsReturning = opts.getBoolean(KEY_TRANSITION_IS_RETURNING, false); - mSharedElementNames = opts.getStringArrayList(KEY_TRANSITION_SHARED_ELEMENTS); - mResultData = opts.getParcelable(KEY_RESULT_DATA, android.content.Intent.class); - mResultCode = opts.getInt(KEY_RESULT_CODE); - mExitCoordinatorIndex = opts.getInt(KEY_EXIT_COORDINATOR_INDEX); + mSceneTransitionInfo = opts.getParcelable(KEY_SCENE_TRANSITION_INFO, + SceneTransitionInfo.class); break; } mLockTaskMode = opts.getBoolean(KEY_LOCK_TASK_MODE, false); @@ -1338,6 +1392,8 @@ public class ActivityOptions extends ComponentOptions { KEY_PENDING_INTENT_CREATOR_BACKGROUND_ACTIVITY_START_MODE, MODE_BACKGROUND_ACTIVITY_START_SYSTEM_DEFINED); mDisableStartingWindow = opts.getBoolean(KEY_DISABLE_STARTING_WINDOW); + mAnimationAbortListener = IRemoteCallback.Stub.asInterface( + opts.getBinder(KEY_ANIM_ABORT_LISTENER)); } /** @@ -1436,48 +1492,31 @@ public class ActivityOptions extends ComponentOptions { return mAnimationFinishedListener; } - /** @hide */ - public int getExitCoordinatorKey() { return mExitCoordinatorIndex; } - /** @hide */ public void abort() { - if (mAnimationStartedListener != null) { + sendResultIgnoreErrors(mAnimationStartedListener, null); + sendResultIgnoreErrors(mAnimationAbortListener, null); + } + + private void sendResultIgnoreErrors(IRemoteCallback callback, Bundle data) { + if (callback != null) { try { - mAnimationStartedListener.sendResult(null); - } catch (RemoteException e) { - } + callback.sendResult(data); + } catch (RemoteException e) { } } } /** @hide */ - public boolean isReturning() { - return mIsReturning; - } - - /** - * Returns whether or not the ActivityOptions was created with - * {@link #startSharedElementAnimation(Window, Pair[])}. - * - * @hide - */ - boolean isCrossTask() { - return mExitCoordinatorIndex < 0; + public ActivityOptions setSceneTransitionInfo(SceneTransitionInfo info) { + mSceneTransitionInfo = info; + return this; } /** @hide */ - public ArrayList getSharedElementNames() { - return mSharedElementNames; + public SceneTransitionInfo getSceneTransitionInfo() { + return mSceneTransitionInfo; } - /** @hide */ - public ResultReceiver getResultReceiver() { return mTransitionReceiver; } - - /** @hide */ - public int getResultCode() { return mResultCode; } - - /** @hide */ - public Intent getResultData() { return mResultData; } - /** @hide */ public PendingIntent getUsageTimeReport() { return mUsageTimeReport; @@ -1826,7 +1865,7 @@ public class ActivityOptions extends ComponentOptions { public int getPendingIntentLaunchFlags() { // b/243794108: Ignore all flags except the new task flag, to be reconsidered in b/254490217 return mPendingIntentLaunchFlags & - (FLAG_ACTIVITY_NEW_TASK | FLAG_RECEIVER_FOREGROUND); + (FLAG_ACTIVITY_NEW_TASK | FLAG_ACTIVITY_MULTIPLE_TASK | FLAG_RECEIVER_FOREGROUND); } /** @@ -1954,6 +1993,115 @@ public class ActivityOptions extends ComponentOptions { return mApplyNoUserActionFlagForShortcut; } + /** + * An opaque token to use with {@link #setLaunchCookie(LaunchCookie)}. + * + * @hide + */ + @SuppressLint("UnflaggedApi") + @TestApi + public static final class LaunchCookie implements Parcelable { + /** @hide */ + public final IBinder binder; + + /** @hide */ + @SuppressLint("UnflaggedApi") + @TestApi + public LaunchCookie() { + binder = new Binder(); + } + + /** @hide */ + public LaunchCookie(@Nullable String descriptor) { + binder = new Binder(descriptor); + } + + private LaunchCookie(IBinder binder) { + this.binder = binder; + } + + /** @hide */ + @SuppressLint("UnflaggedApi") + @TestApi + @Override + public int describeContents() { + return 0; + } + + /** @hide */ + @SuppressLint("UnflaggedApi") + @TestApi + @Override + public void writeToParcel(@NonNull Parcel dest, int flags) { + dest.writeStrongBinder(binder); + } + + /** @hide */ + public static LaunchCookie readFromParcel(@NonNull Parcel in) { + IBinder binder = in.readStrongBinder(); + if (binder == null) { + return null; + } + return new LaunchCookie(binder); + } + + /** @hide */ + public static void writeToParcel(@Nullable LaunchCookie launchCookie, Parcel out) { + if (launchCookie != null) { + launchCookie.writeToParcel(out, 0); + } else { + out.writeStrongBinder(null); + } + } + + /** @hide */ + @SuppressLint("UnflaggedApi") + @TestApi + @NonNull + public static final Parcelable.Creator CREATOR = + new Parcelable.Creator() { + + @Override + public LaunchCookie createFromParcel(Parcel source) { + return LaunchCookie.readFromParcel(source); + } + + @Override + public LaunchCookie[] newArray(int size) { + return new LaunchCookie[size]; + } + }; + + @Override + public boolean equals(@Nullable Object obj) { + if (obj instanceof LaunchCookie) { + LaunchCookie other = (LaunchCookie) obj; + return binder == other.binder; + } + return false; + } + + @Override + public int hashCode() { + return binder.hashCode(); + } + } + + /** + * Sets a launch cookie that can be used to track the {@link Activity} and task that are + * launched as a result of this option. If the launched activity is a trampoline that starts + * another activity immediately, the cookie will be transferred to the next activity. + * + * @param launchCookie a developer specified identifier for a specific task. + * + * @hide + */ + @SuppressLint("UnflaggedApi") + @TestApi + public void setLaunchCookie(@NonNull LaunchCookie launchCookie) { + setLaunchCookie(launchCookie.binder); + } + /** * Sets a launch cookie that can be used to track the activity and task that are launch as a * result of this option. If the launched activity is a trampoline that starts another activity @@ -2102,12 +2250,7 @@ public class ActivityOptions extends ComponentOptions { mPackageName = otherOptions.mPackageName; } mUsageTimeReport = otherOptions.mUsageTimeReport; - mTransitionReceiver = null; - mSharedElementNames = null; - mIsReturning = false; - mResultData = null; - mResultCode = 0; - mExitCoordinatorIndex = 0; + mSceneTransitionInfo = null; mAnimationType = otherOptions.mAnimationType; switch (otherOptions.mAnimationType) { case ANIM_CUSTOM: @@ -2115,12 +2258,7 @@ public class ActivityOptions extends ComponentOptions { mCustomExitResId = otherOptions.mCustomExitResId; mCustomBackgroundColor = otherOptions.mCustomBackgroundColor; mThumbnail = null; - if (mAnimationStartedListener != null) { - try { - mAnimationStartedListener.sendResult(null); - } catch (RemoteException e) { - } - } + sendResultIgnoreErrors(mAnimationStartedListener, null); mAnimationStartedListener = otherOptions.mAnimationStartedListener; break; case ANIM_CUSTOM_IN_PLACE: @@ -2131,12 +2269,7 @@ public class ActivityOptions extends ComponentOptions { mStartY = otherOptions.mStartY; mWidth = otherOptions.mWidth; mHeight = otherOptions.mHeight; - if (mAnimationStartedListener != null) { - try { - mAnimationStartedListener.sendResult(null); - } catch (RemoteException e) { - } - } + sendResultIgnoreErrors(mAnimationStartedListener, null); mAnimationStartedListener = null; break; case ANIM_THUMBNAIL_SCALE_UP: @@ -2148,23 +2281,13 @@ public class ActivityOptions extends ComponentOptions { mStartY = otherOptions.mStartY; mWidth = otherOptions.mWidth; mHeight = otherOptions.mHeight; - if (mAnimationStartedListener != null) { - try { - mAnimationStartedListener.sendResult(null); - } catch (RemoteException e) { - } - } + sendResultIgnoreErrors(mAnimationStartedListener, null); mAnimationStartedListener = otherOptions.mAnimationStartedListener; break; case ANIM_SCENE_TRANSITION: - mTransitionReceiver = otherOptions.mTransitionReceiver; - mSharedElementNames = otherOptions.mSharedElementNames; - mIsReturning = otherOptions.mIsReturning; + mSceneTransitionInfo = otherOptions.mSceneTransitionInfo; mThumbnail = null; mAnimationStartedListener = null; - mResultData = otherOptions.mResultData; - mResultCode = otherOptions.mResultCode; - mExitCoordinatorIndex = otherOptions.mExitCoordinatorIndex; break; } mLockTaskMode = otherOptions.mLockTaskMode; @@ -2175,6 +2298,9 @@ public class ActivityOptions extends ComponentOptions { mRemoteAnimationAdapter = otherOptions.mRemoteAnimationAdapter; mLaunchIntoPipParams = otherOptions.mLaunchIntoPipParams; mIsEligibleForLegacyPermissionPrompt = otherOptions.mIsEligibleForLegacyPermissionPrompt; + + sendResultIgnoreErrors(mAnimationAbortListener, null); + mAnimationAbortListener = otherOptions.mAnimationAbortListener; } /** @@ -2240,14 +2366,9 @@ public class ActivityOptions extends ComponentOptions { != null ? mAnimationStartedListener.asBinder() : null); break; case ANIM_SCENE_TRANSITION: - if (mTransitionReceiver != null) { - b.putParcelable(KEY_TRANSITION_COMPLETE_LISTENER, mTransitionReceiver); + if (mSceneTransitionInfo != null) { + b.putParcelable(KEY_SCENE_TRANSITION_INFO, mSceneTransitionInfo); } - b.putBoolean(KEY_TRANSITION_IS_RETURNING, mIsReturning); - b.putStringArrayList(KEY_TRANSITION_SHARED_ELEMENTS, mSharedElementNames); - b.putParcelable(KEY_RESULT_DATA, mResultData); - b.putInt(KEY_RESULT_CODE, mResultCode); - b.putInt(KEY_EXIT_COORDINATOR_INDEX, mExitCoordinatorIndex); break; } if (mLockTaskMode) { @@ -2378,6 +2499,8 @@ public class ActivityOptions extends ComponentOptions { if (mDisableStartingWindow) { b.putBoolean(KEY_DISABLE_STARTING_WINDOW, mDisableStartingWindow); } + b.putBinder(KEY_ANIM_ABORT_LISTENER, + mAnimationAbortListener != null ? mAnimationAbortListener.asBinder() : null); return b; } @@ -2607,4 +2730,124 @@ public class ActivityOptions extends ComponentOptions { } }; } + + /** + * This class contains necessary information for Activity Scene Transition. + * + * @hide + */ + public static class SceneTransitionInfo implements Parcelable { + private boolean mIsReturning; + private int mResultCode; + @Nullable + private Intent mResultData; + @Nullable + private ArrayList mSharedElementNames; + @Nullable + private ResultReceiver mResultReceiver; + private int mExitCoordinatorIndex; + + public SceneTransitionInfo() { + } + + SceneTransitionInfo(Parcel in) { + mIsReturning = in.readBoolean(); + mResultCode = in.readInt(); + mResultData = in.readTypedObject(Intent.CREATOR); + mSharedElementNames = in.createStringArrayList(); + mResultReceiver = in.readTypedObject(ResultReceiver.CREATOR); + mExitCoordinatorIndex = in.readInt(); + } + + public static final Creator CREATOR = new Creator<>() { + @Override + public SceneTransitionInfo createFromParcel(Parcel in) { + return new SceneTransitionInfo(in); + } + + @Override + public SceneTransitionInfo[] newArray(int size) { + return new SceneTransitionInfo[size]; + } + }; + + @Override + public int describeContents() { + return 0; + } + + @Override + public void writeToParcel(Parcel dest, int flags) { + dest.writeBoolean(mIsReturning); + dest.writeInt(mResultCode); + dest.writeTypedObject(mResultData, flags); + dest.writeStringList(mSharedElementNames); + dest.writeTypedObject(mResultReceiver, flags); + dest.writeInt(mExitCoordinatorIndex); + } + + public void setReturning(boolean isReturning) { + mIsReturning = isReturning; + } + + public boolean isReturning() { + return mIsReturning; + } + + public void setResultCode(int resultCode) { + mResultCode = resultCode; + } + + public int getResultCode() { + return mResultCode; + } + + public void setResultData(Intent resultData) { + mResultData = resultData; + } + + @Nullable + public Intent getResultData() { + return mResultData; + } + + public void setSharedElementNames(ArrayList sharedElementNames) { + mSharedElementNames = sharedElementNames; + } + + @Nullable + public ArrayList getSharedElementNames() { + return mSharedElementNames; + } + + public void setResultReceiver(ResultReceiver resultReceiver) { + mResultReceiver = resultReceiver; + } + + @Nullable + public ResultReceiver getResultReceiver() { + return mResultReceiver; + } + + public void setExitCoordinatorKey(int exitCoordinatorKey) { + mExitCoordinatorIndex = exitCoordinatorKey; + } + + public int getExitCoordinatorKey() { + return mExitCoordinatorIndex; + } + + boolean isCrossTask() { + return mExitCoordinatorIndex < 0; + } + + @Override + public String toString() { + return "SceneTransitionInfo, mIsReturning=" + mIsReturning + + ", mResultCode=" + mResultCode + ", mResultData=" + mResultData + + ", mSharedElementNames=" + mSharedElementNames + + ", mTransitionReceiver=" + mResultReceiver + + ", mExitCoordinatorIndex=" + mExitCoordinatorIndex; + } + } } diff --git a/core/java/android/app/ActivityThread.java b/core/java/android/app/ActivityThread.java index 5330feffe8c014dde289d9ead6e5f844fc484242..b5e05f904bd128f6096bb18f2eab186e998aaedf 100644 --- a/core/java/android/app/ActivityThread.java +++ b/core/java/android/app/ActivityThread.java @@ -43,6 +43,7 @@ import static com.android.sdksandbox.flags.Flags.sandboxActivitySdkBasedContext; import android.annotation.NonNull; import android.annotation.Nullable; +import android.app.ActivityOptions.SceneTransitionInfo; import android.app.RemoteServiceException.BadForegroundServiceNotificationException; import android.app.RemoteServiceException.BadUserInitiatedJobNotificationException; import android.app.RemoteServiceException.CannotPostForegroundServiceNotificationException; @@ -145,6 +146,8 @@ import android.os.Parcel; import android.os.ParcelFileDescriptor; import android.os.PersistableBundle; import android.os.Process; +import android.os.ProfilingFrameworkInitializer; +import android.os.ProfilingServiceManager; import android.os.RemoteCallback; import android.os.RemoteException; import android.os.ServiceManager; @@ -208,9 +211,12 @@ import android.view.contentcapture.IContentCaptureOptionsCallback; import android.view.translation.TranslationSpec; import android.view.translation.UiTranslationSpec; import android.webkit.WebView; +import android.window.ActivityWindowInfo; +import android.window.ITaskFragmentOrganizer; import android.window.SizeConfigurationBuckets; import android.window.SplashScreen; import android.window.SplashScreenView; +import android.window.TaskFragmentTransaction; import android.window.WindowContextInfo; import android.window.WindowProviderService; import android.window.WindowTokenClientController; @@ -232,7 +238,6 @@ import com.android.internal.util.Preconditions; import com.android.internal.util.function.pooled.PooledLambda; import com.android.org.conscrypt.TrustedCertificateStore; import com.android.server.am.MemInfoDumpProto; -import com.android.window.flags.Flags; import dalvik.annotation.optimization.NeverCompile; import dalvik.system.AppSpecializationHooks; @@ -300,7 +305,7 @@ public final class ActivityThread extends ClientTransactionHandler public static final boolean DEBUG_MEMORY_TRIM = false; private static final boolean DEBUG_PROVIDER = false; public static final boolean DEBUG_ORDER = false; - private static final boolean DEBUG_APP_INFO = true; + private static final boolean DEBUG_APP_INFO = false; private static final long MIN_TIME_BETWEEN_GCS = 5*1000; /** * The delay to release the provider when it has no more references. It reduces the number of @@ -316,6 +321,10 @@ public final class ActivityThread extends ClientTransactionHandler public static final int SERVICE_DONE_EXECUTING_START = 1; /** Type for IActivityManager.serviceDoneExecuting: done stopping (destroying) service */ public static final int SERVICE_DONE_EXECUTING_STOP = 2; + /** Type for IActivityManager.serviceDoneExecuting: done with an onRebind call */ + public static final int SERVICE_DONE_EXECUTING_REBIND = 3; + /** Type for IActivityManager.serviceDoneExecuting: done with an onUnbind call */ + public static final int SERVICE_DONE_EXECUTING_UNBIND = 4; /** Use foreground GC policy (less pause time) and higher JIT weight. */ private static final int VM_PROCESS_STATE_JANK_PERCEPTIBLE = 0; @@ -407,7 +416,7 @@ public final class ActivityThread extends ClientTransactionHandler private int mLastSessionId; // Holds the value of the last reported device ID value from the server for the top activity. - int mLastReportedDeviceId; + int mLastReportedDeviceId = Context.DEVICE_ID_DEFAULT; final ArrayMap mServicesData = new ArrayMap<>(); @UnsupportedAppUsage final ArrayMap mServices = new ArrayMap<>(); @@ -573,6 +582,7 @@ public final class ActivityThread extends ClientTransactionHandler public IBinder shareableActivityToken; // The token of the TaskFragment that embedded this activity. @Nullable public IBinder mTaskFragmentToken; + public IBinder initialCallerInfoAccessToken; int ident; @UnsupportedAppUsage Intent intent; @@ -594,6 +604,9 @@ public final class ActivityThread extends ClientTransactionHandler boolean hideForNow; Configuration createdConfig; Configuration overrideConfig; + @NonNull + private ActivityWindowInfo mActivityWindowInfo; + // Used for consolidating configs before sending on to Activity. private final Configuration tmpConfig = new Configuration(); // Callback used for updating activity override config and camera compat control state. @@ -630,8 +643,8 @@ public final class ActivityThread extends ClientTransactionHandler @UnsupportedAppUsage boolean mPreserveWindow; - /** The options for scene transition. */ - ActivityOptions mActivityOptions; + /** The scene transition info. */ + SceneTransitionInfo mSceneTransitionInfo; /** Whether this activiy was launched from a bubble. */ boolean mLaunchedFromBubble; @@ -658,10 +671,11 @@ public final class ActivityThread extends ClientTransactionHandler ActivityInfo info, Configuration overrideConfig, String referrer, IVoiceInteractor voiceInteractor, Bundle state, PersistableBundle persistentState, List pendingResults, - List pendingNewIntents, ActivityOptions activityOptions, + List pendingNewIntents, SceneTransitionInfo sceneTransitionInfo, boolean isForward, ProfilerInfo profilerInfo, ClientTransactionHandler client, IBinder assistToken, IBinder shareableActivityToken, boolean launchedFromBubble, - IBinder taskFragmentToken) { + IBinder taskFragmentToken, IBinder initialCallerInfoAccessToken, + ActivityWindowInfo activityWindowInfo) { this.token = token; this.assistToken = assistToken; this.shareableActivityToken = shareableActivityToken; @@ -678,9 +692,11 @@ public final class ActivityThread extends ClientTransactionHandler this.profilerInfo = profilerInfo; this.overrideConfig = overrideConfig; this.packageInfo = client.getPackageInfoNoCheck(activityInfo.applicationInfo); - mActivityOptions = activityOptions; + this.initialCallerInfoAccessToken = initialCallerInfoAccessToken; + mSceneTransitionInfo = sceneTransitionInfo; mLaunchedFromBubble = launchedFromBubble; mTaskFragmentToken = taskFragmentToken; + mActivityWindowInfo = activityWindowInfo; init(); } @@ -701,7 +717,7 @@ public final class ActivityThread extends ClientTransactionHandler } activity.mMainThread.handleActivityConfigurationChanged( ActivityClientRecord.this, overrideConfig, newDisplayId, - false /* alwaysReportChange */); + mActivityWindowInfo, false /* alwaysReportChange */); } @Override @@ -769,6 +785,11 @@ public final class ActivityThread extends ClientTransactionHandler return activity != null && activity.mVisibleFromServer; } + @NonNull + public ActivityWindowInfo getActivityWindowInfo() { + return mActivityWindowInfo; + } + public String toString() { ComponentName componentName = intent != null ? intent.getComponent() : null; return "ActivityRecord{" @@ -1228,6 +1249,16 @@ public final class ActivityThread extends ClientTransactionHandler sendMessage(H.PING, pong); } + @Override + public final void scheduleTimeoutServiceForType(IBinder token, int startId, + @ServiceInfo.ForegroundServiceType int fgsType) { + if (Trace.isTagEnabled(Trace.TRACE_TAG_ACTIVITY_MANAGER)) { + Trace.instant(Trace.TRACE_TAG_ACTIVITY_MANAGER, + "scheduleTimeoutServiceForType. token=" + token); + } + sendMessage(H.TIMEOUT_SERVICE_FOR_TYPE, token, startId, fgsType); + } + @Override public final void bindApplication( String processName, @@ -1965,9 +1996,9 @@ public final class ActivityThread extends ClientTransactionHandler sendMessage(H.TRANSLUCENT_CONVERSION_COMPLETE, token, drawComplete ? 1 : 0); } - public void scheduleOnNewActivityOptions(IBinder token, Bundle options) { - sendMessage(H.ON_NEW_ACTIVITY_OPTIONS, - new Pair(token, ActivityOptions.fromBundle(options))); + public void scheduleOnNewSceneTransitionInfo(IBinder token, SceneTransitionInfo info) { + sendMessage(H.ON_NEW_SCENE_TRANSITION_INFO, + new Pair(token, info)); } public void setProcessState(int state) { @@ -2053,6 +2084,14 @@ public final class ActivityThread extends ClientTransactionHandler ActivityThread.this.scheduleTransaction(transaction); } + @Override + public void scheduleTaskFragmentTransaction(@NonNull ITaskFragmentOrganizer organizer, + @NonNull TaskFragmentTransaction transaction) throws RemoteException { + // TODO(b/260873529): ITaskFragmentOrganizer can be cleanup to be a IBinder token + // after flag removal. + organizer.onTransactionReady(transaction); + } + @Override public void requestDirectActions(@NonNull IBinder activityToken, @NonNull IVoiceInteractor interactor, @Nullable RemoteCallback cancellationCallback, @@ -2255,7 +2294,7 @@ public final class ActivityThread extends ClientTransactionHandler public static final int TRANSLUCENT_CONVERSION_COMPLETE = 144; @UnsupportedAppUsage public static final int INSTALL_PROVIDER = 145; - public static final int ON_NEW_ACTIVITY_OPTIONS = 146; + public static final int ON_NEW_SCENE_TRANSITION_INFO = 146; @UnsupportedAppUsage public static final int ENTER_ANIMATION_COMPLETE = 149; public static final int START_BINDER_TRACKING = 150; @@ -2278,6 +2317,8 @@ public final class ActivityThread extends ClientTransactionHandler public static final int INSTRUMENT_WITHOUT_RESTART = 170; public static final int FINISH_INSTRUMENTATION_WITHOUT_RESTART = 171; + public static final int TIMEOUT_SERVICE_FOR_TYPE = 172; + String codeToString(int code) { if (DEBUG_MESSAGES) { switch (code) { @@ -2311,7 +2352,7 @@ public final class ActivityThread extends ClientTransactionHandler case REQUEST_ASSIST_CONTEXT_EXTRAS: return "REQUEST_ASSIST_CONTEXT_EXTRAS"; case TRANSLUCENT_CONVERSION_COMPLETE: return "TRANSLUCENT_CONVERSION_COMPLETE"; case INSTALL_PROVIDER: return "INSTALL_PROVIDER"; - case ON_NEW_ACTIVITY_OPTIONS: return "ON_NEW_ACTIVITY_OPTIONS"; + case ON_NEW_SCENE_TRANSITION_INFO: return "ON_NEW_SCENE_TRANSITION_INFO"; case ENTER_ANIMATION_COMPLETE: return "ENTER_ANIMATION_COMPLETE"; case LOCAL_VOICE_INTERACTION_STARTED: return "LOCAL_VOICE_INTERACTION_STARTED"; case ATTACH_AGENT: return "ATTACH_AGENT"; @@ -2331,6 +2372,7 @@ public final class ActivityThread extends ClientTransactionHandler case DUMP_RESOURCES: return "DUMP_RESOURCES"; case TIMEOUT_SERVICE: return "TIMEOUT_SERVICE"; case PING: return "PING"; + case TIMEOUT_SERVICE_FOR_TYPE: return "TIMEOUT_SERVICE_FOR_TYPE"; } } return Integer.toString(code); @@ -2417,6 +2459,14 @@ public final class ActivityThread extends ClientTransactionHandler case PING: ((RemoteCallback) msg.obj).sendResult(null); break; + case TIMEOUT_SERVICE_FOR_TYPE: + if (Trace.isTagEnabled(Trace.TRACE_TAG_ACTIVITY_MANAGER)) { + Trace.traceBegin(Trace.TRACE_TAG_ACTIVITY_MANAGER, + "serviceTimeoutForType: " + msg.obj); + } + handleTimeoutServiceForType((IBinder) msg.obj, msg.arg1, msg.arg2); + Trace.traceEnd(Trace.TRACE_TAG_ACTIVITY_MANAGER); + break; case CONFIGURATION_CHANGED: mConfigurationController.handleConfigurationChanged((Configuration) msg.obj); break; @@ -2517,9 +2567,10 @@ public final class ActivityThread extends ClientTransactionHandler Trace.traceEnd(Trace.TRACE_TAG_ACTIVITY_MANAGER); } break; - case ON_NEW_ACTIVITY_OPTIONS: - Pair pair = (Pair) msg.obj; - onNewActivityOptions(pair.first, pair.second); + case ON_NEW_SCENE_TRANSITION_INFO: + Pair pair = + (Pair) msg.obj; + onNewSceneTransitionInfo(pair.first, pair.second); break; case ENTER_ANIMATION_COMPLETE: handleEnterAnimationComplete((IBinder) msg.obj); @@ -3725,15 +3776,11 @@ public final class ActivityThread extends ClientTransactionHandler if (DEBUG_RESULTS) Slog.v(TAG, "sendActivityResult: id=" + id + " req=" + requestCode + " res=" + resultCode + " data=" + data); final ArrayList list = new ArrayList<>(); - list.add(new ResultInfo(id, requestCode, resultCode, data)); + list.add(new ResultInfo(id, requestCode, resultCode, data, activityToken)); final ClientTransaction clientTransaction = ClientTransaction.obtain(mAppThread); final ActivityResultItem activityResultItem = ActivityResultItem.obtain( activityToken, list); - if (Flags.bundleClientTransactionFlag()) { - clientTransaction.addTransactionItem(activityResultItem); - } else { - clientTransaction.addCallback(activityResultItem); - } + clientTransaction.addTransactionItem(activityResultItem); try { mAppThread.scheduleTransaction(clientTransaction); } catch (RemoteException e) { @@ -3905,7 +3952,7 @@ public final class ActivityThread extends ClientTransactionHandler r.ident, app, r.intent, r.activityInfo, title, r.parent, r.embeddedID, r.lastNonConfigurationInstances, config, r.referrer, r.voiceInteractor, window, r.activityConfigCallback, - r.assistToken, r.shareableActivityToken); + r.assistToken, r.shareableActivityToken, r.initialCallerInfoAccessToken); if (customIntent != null) { activity.mIntent = customIntent; @@ -3918,9 +3965,9 @@ public final class ActivityThread extends ClientTransactionHandler activity.setTheme(theme); } - if (r.mActivityOptions != null) { - activity.mPendingOptions = r.mActivityOptions; - r.mActivityOptions = null; + if (r.mSceneTransitionInfo != null) { + activity.mSceneTransitionInfo = r.mSceneTransitionInfo; + r.mSceneTransitionInfo = null; } activity.mLaunchedFromBubble = r.mLaunchedFromBubble; activity.mCalled = false; @@ -3959,7 +4006,7 @@ public final class ActivityThread extends ClientTransactionHandler @Override public void handleStartActivity(ActivityClientRecord r, - PendingTransactionActions pendingActions, ActivityOptions activityOptions) { + PendingTransactionActions pendingActions, SceneTransitionInfo sceneTransitionInfo) { final Activity activity = r.activity; if (!r.stopped) { throw new IllegalStateException("Can't start activity that is not stopped."); @@ -3970,8 +4017,8 @@ public final class ActivityThread extends ClientTransactionHandler } unscheduleGcIdler(); - if (activityOptions != null) { - activity.mPendingOptions = activityOptions; + if (sceneTransitionInfo != null) { + activity.mSceneTransitionInfo = sceneTransitionInfo; } // Start @@ -4177,7 +4224,12 @@ public final class ActivityThread extends ClientTransactionHandler intent.prepareToEnterProcess(isProtectedComponent(r.activityInfo), r.activity.getAttributionSource()); r.activity.mFragments.noteStateNotSaved(); - mInstrumentation.callActivityOnNewIntent(r.activity, intent); + if (android.security.Flags.contentUriPermissionApis()) { + ComponentCaller caller = new ComponentCaller(r.token, intent.mCallerToken); + mInstrumentation.callActivityOnNewIntent(r.activity, intent, caller); + } else { + mInstrumentation.callActivityOnNewIntent(r.activity, intent); + } } } @@ -4353,10 +4405,10 @@ public final class ActivityThread extends ClientTransactionHandler } } - public void onNewActivityOptions(IBinder token, ActivityOptions options) { + public void onNewSceneTransitionInfo(IBinder token, SceneTransitionInfo info) { ActivityClientRecord r = mActivities.get(token); if (r != null) { - r.activity.onNewActivityOptions(options); + r.activity.onNewSceneTransitionInfo(info); } } @@ -4522,11 +4574,7 @@ public final class ActivityThread extends ClientTransactionHandler final PauseActivityItem pauseActivityItem = PauseActivityItem.obtain(r.token, r.activity.isFinishing(), /* userLeaving */ true, r.activity.mConfigChangeFlags, /* dontReport */ false, /* autoEnteringPip */ false); - if (Flags.bundleClientTransactionFlag()) { - transaction.addTransactionItem(pauseActivityItem); - } else { - transaction.setLifecycleStateRequest(pauseActivityItem); - } + transaction.addTransactionItem(pauseActivityItem); executeTransaction(transaction); } @@ -4534,11 +4582,7 @@ public final class ActivityThread extends ClientTransactionHandler final ClientTransaction transaction = ClientTransaction.obtain(mAppThread); final ResumeActivityItem resumeActivityItem = ResumeActivityItem.obtain(r.token, /* isForward */ false, /* shouldSendCompatFakeFocus */ false); - if (Flags.bundleClientTransactionFlag()) { - transaction.addTransactionItem(resumeActivityItem); - } else { - transaction.setLifecycleStateRequest(resumeActivityItem); - } + transaction.addTransactionItem(resumeActivityItem); executeTransaction(transaction); } @@ -4870,10 +4914,13 @@ public final class ActivityThread extends ClientTransactionHandler service.attach(context, this, data.info.name, data.token, app, ActivityManager.getService()); if (!service.isUiContext()) { // WindowProviderService is a UI Context. - VirtualDeviceManager vdm = context.getSystemService(VirtualDeviceManager.class); - if (mLastReportedDeviceId == Context.DEVICE_ID_DEFAULT - || vdm.isValidVirtualDeviceId(mLastReportedDeviceId)) { + if (mLastReportedDeviceId == Context.DEVICE_ID_DEFAULT) { service.updateDeviceId(mLastReportedDeviceId); + } else { + VirtualDeviceManager vdm = context.getSystemService(VirtualDeviceManager.class); + if (vdm != null && vdm.isValidVirtualDeviceId(mLastReportedDeviceId)) { + service.updateDeviceId(mLastReportedDeviceId); + } } } service.onCreate(); @@ -4881,7 +4928,7 @@ public final class ActivityThread extends ClientTransactionHandler mServices.put(data.token, service); try { ActivityManager.getService().serviceDoneExecuting( - data.token, SERVICE_DONE_EXECUTING_ANON, 0, 0); + data.token, SERVICE_DONE_EXECUTING_ANON, 0, 0, null); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } @@ -4912,7 +4959,7 @@ public final class ActivityThread extends ClientTransactionHandler } else { s.onRebind(data.intent); ActivityManager.getService().serviceDoneExecuting( - data.token, SERVICE_DONE_EXECUTING_ANON, 0, 0); + data.token, SERVICE_DONE_EXECUTING_REBIND, 0, 0, data.intent); } } catch (RemoteException ex) { throw ex.rethrowFromSystemServer(); @@ -4942,7 +4989,7 @@ public final class ActivityThread extends ClientTransactionHandler data.token, data.intent, doRebind); } else { ActivityManager.getService().serviceDoneExecuting( - data.token, SERVICE_DONE_EXECUTING_ANON, 0, 0); + data.token, SERVICE_DONE_EXECUTING_UNBIND, 0, 0, data.intent); } } catch (RemoteException ex) { throw ex.rethrowFromSystemServer(); @@ -5056,7 +5103,7 @@ public final class ActivityThread extends ClientTransactionHandler try { ActivityManager.getService().serviceDoneExecuting( - data.token, SERVICE_DONE_EXECUTING_START, data.startId, res); + data.token, SERVICE_DONE_EXECUTING_START, data.startId, res, null); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } @@ -5088,7 +5135,7 @@ public final class ActivityThread extends ClientTransactionHandler try { ActivityManager.getService().serviceDoneExecuting( - token, SERVICE_DONE_EXECUTING_STOP, 0, 0); + token, SERVICE_DONE_EXECUTING_STOP, 0, 0, null); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } @@ -5129,6 +5176,27 @@ public final class ActivityThread extends ClientTransactionHandler Slog.wtf(TAG, "handleTimeoutService: token=" + token + " not found."); } } + + private void handleTimeoutServiceForType(IBinder token, int startId, + @ServiceInfo.ForegroundServiceType int fgsType) { + Service s = mServices.get(token); + if (s != null) { + try { + if (localLOGV) Slog.v(TAG, "Timeout service " + s); + + s.callOnTimeLimitExceeded(startId, fgsType); + } catch (Exception e) { + if (!mInstrumentation.onException(s, e)) { + throw new RuntimeException( + "Unable to call onTimeLimitExceeded on service " + s + ": " + e, e); + } + Slog.i(TAG, "handleTimeoutServiceForType: exception for " + token, e); + } + } else { + Slog.wtf(TAG, "handleTimeoutServiceForType: token=" + token + " not found."); + } + } + /** * Resume the activity. * @param r Target activity record. @@ -5745,8 +5813,14 @@ public final class ActivityThread extends ClientTransactionHandler } if (DEBUG_RESULTS) Slog.v(TAG, "Delivering result to activity " + r + " : " + ri); - r.activity.dispatchActivityResult(ri.mResultWho, - ri.mRequestCode, ri.mResultCode, ri.mData, reason); + if (android.security.Flags.contentUriPermissionApis()) { + ComponentCaller caller = new ComponentCaller(r.token, ri.mCallerToken); + r.activity.dispatchActivityResult(ri.mResultWho, + ri.mRequestCode, ri.mResultCode, ri.mData, caller, reason); + } else { + r.activity.dispatchActivityResult(ri.mResultWho, + ri.mRequestCode, ri.mResultCode, ri.mData, reason); + } } catch (Exception e) { if (!mInstrumentation.onException(r.activity, e)) { throw new RuntimeException( @@ -5938,9 +6012,11 @@ public final class ActivityThread extends ClientTransactionHandler } @Override - public ActivityClientRecord prepareRelaunchActivity(IBinder token, - List pendingResults, List pendingNewIntents, - int configChanges, MergedConfiguration config, boolean preserveWindow) { + public ActivityClientRecord prepareRelaunchActivity(@NonNull IBinder token, + @Nullable List pendingResults, + @Nullable List pendingNewIntents, int configChanges, + @NonNull MergedConfiguration config, boolean preserveWindow, + @NonNull ActivityWindowInfo activityWindowInfo) { ActivityClientRecord target = null; boolean scheduleRelaunch = false; @@ -5981,14 +6057,15 @@ public final class ActivityThread extends ClientTransactionHandler target.createdConfig = config.getGlobalConfiguration(); target.overrideConfig = config.getOverrideConfiguration(); target.pendingConfigChanges |= configChanges; + target.mActivityWindowInfo = activityWindowInfo; } return scheduleRelaunch ? target : null; } @Override - public void handleRelaunchActivity(ActivityClientRecord tmp, - PendingTransactionActions pendingActions) { + public void handleRelaunchActivity(@NonNull ActivityClientRecord tmp, + @NonNull PendingTransactionActions pendingActions) { // If we are getting ready to gc after going to the background, well // we are back active so skip it. unscheduleGcIdler(); @@ -6068,7 +6145,8 @@ public final class ActivityThread extends ClientTransactionHandler r.activity.mChangingConfigurations = true; handleRelaunchActivityInner(r, configChanges, tmp.pendingResults, tmp.pendingIntents, - pendingActions, tmp.startsNotResumed, tmp.overrideConfig, "handleRelaunchActivity"); + pendingActions, tmp.startsNotResumed, tmp.overrideConfig, tmp.mActivityWindowInfo, + "handleRelaunchActivity"); } void scheduleRelaunchActivity(IBinder token) { @@ -6123,26 +6201,24 @@ public final class ActivityThread extends ClientTransactionHandler r.overrideConfig); final ActivityRelaunchItem activityRelaunchItem = ActivityRelaunchItem.obtain( r.token, null /* pendingResults */, null /* pendingIntents */, - 0 /* configChanges */, mergedConfiguration, r.mPreserveWindow); + 0 /* configChanges */, mergedConfiguration, r.mPreserveWindow, + r.getActivityWindowInfo()); // Make sure to match the existing lifecycle state in the end of the transaction. final ActivityLifecycleItem lifecycleRequest = TransactionExecutorHelper.getLifecycleRequestForCurrentState(r); // Schedule the transaction. final ClientTransaction transaction = ClientTransaction.obtain(mAppThread); - if (Flags.bundleClientTransactionFlag()) { - transaction.addTransactionItem(activityRelaunchItem); - transaction.addTransactionItem(lifecycleRequest); - } else { - transaction.addCallback(activityRelaunchItem); - transaction.setLifecycleStateRequest(lifecycleRequest); - } + transaction.addTransactionItem(activityRelaunchItem); + transaction.addTransactionItem(lifecycleRequest); executeTransaction(transaction); } - private void handleRelaunchActivityInner(ActivityClientRecord r, int configChanges, - List pendingResults, List pendingIntents, - PendingTransactionActions pendingActions, boolean startsNotResumed, - Configuration overrideConfig, String reason) { + private void handleRelaunchActivityInner(@NonNull ActivityClientRecord r, int configChanges, + @Nullable List pendingResults, + @Nullable List pendingIntents, + @NonNull PendingTransactionActions pendingActions, boolean startsNotResumed, + @NonNull Configuration overrideConfig, @NonNull ActivityWindowInfo activityWindowInfo, + @NonNull String reason) { // Preserve last used intent, it may be set from Activity#setIntent(). final Intent customIntent = r.activity.mIntent; // Need to ensure state is saved. @@ -6175,6 +6251,7 @@ public final class ActivityThread extends ClientTransactionHandler } r.startsNotResumed = startsNotResumed; r.overrideConfig = overrideConfig; + r.mActivityWindowInfo = activityWindowInfo; handleLaunchActivity(r, pendingActions, mLastReportedDeviceId, customIntent); } @@ -6596,11 +6673,12 @@ public final class ActivityThread extends ClientTransactionHandler /** * Sets the supplied {@code overrideConfig} as pending for the {@code token}. Calling * this method prevents any calls to - * {@link #handleActivityConfigurationChanged(ActivityClientRecord, Configuration, int)} from - * processing any configurations older than {@code overrideConfig}. + * {@link #handleActivityConfigurationChanged(ActivityClientRecord, Configuration, int, + * ActivityWindowInfo)} from processing any configurations older than {@code overrideConfig}. */ @Override - public void updatePendingActivityConfiguration(IBinder token, Configuration overrideConfig) { + public void updatePendingActivityConfiguration(@NonNull IBinder token, + @NonNull Configuration overrideConfig) { synchronized (mPendingOverrideConfigs) { final Configuration pendingOverrideConfig = mPendingOverrideConfigs.get(token); if (pendingOverrideConfig != null @@ -6617,9 +6695,10 @@ public final class ActivityThread extends ClientTransactionHandler } @Override - public void handleActivityConfigurationChanged(ActivityClientRecord r, - @NonNull Configuration overrideConfig, int displayId) { - handleActivityConfigurationChanged(r, overrideConfig, displayId, + public void handleActivityConfigurationChanged(@NonNull ActivityClientRecord r, + @NonNull Configuration overrideConfig, int displayId, + @NonNull ActivityWindowInfo activityWindowInfo) { + handleActivityConfigurationChanged(r, overrideConfig, displayId, activityWindowInfo, // This is the only place that uses alwaysReportChange=true. The entry point should // be from ActivityConfigurationChangeItem or MoveToDisplayItem, so the server side // has confirmed the activity should handle the configuration instead of relaunch. @@ -6637,9 +6716,11 @@ public final class ActivityThread extends ClientTransactionHandler * @param overrideConfig Activity override config. * @param displayId Id of the display where activity was moved to, -1 if there was no move and * value didn't change. + * @param activityWindowInfo the window info of the given activity. */ - void handleActivityConfigurationChanged(ActivityClientRecord r, - @NonNull Configuration overrideConfig, int displayId, boolean alwaysReportChange) { + void handleActivityConfigurationChanged(@NonNull ActivityClientRecord r, + @NonNull Configuration overrideConfig, int displayId, + @NonNull ActivityWindowInfo activityWindowInfo, boolean alwaysReportChange) { synchronized (mPendingOverrideConfigs) { final Configuration pendingOverrideConfig = mPendingOverrideConfigs.get(r.token); if (overrideConfig.isOtherSeqNewer(pendingOverrideConfig)) { @@ -6672,6 +6753,8 @@ public final class ActivityThread extends ClientTransactionHandler // Perform updates. r.overrideConfig = overrideConfig; + r.mActivityWindowInfo = activityWindowInfo; + // TODO(b/287582673): notify on ActivityWindowInfo change final ViewRootImpl viewRoot = r.activity.mDecor != null ? r.activity.mDecor.getViewRootImpl() : null; @@ -6797,6 +6880,7 @@ public final class ActivityThread extends ClientTransactionHandler } } if (killApp) { + // Keep in sync with "perhaps it was removed" case below. mPackages.remove(packages[i]); mResourcePackages.remove(packages[i]); } @@ -6839,23 +6923,24 @@ public final class ActivityThread extends ClientTransactionHandler PackageManager.GET_SHARED_LIBRARY_FILES, UserHandle.myUserId()); - if (mActivities.size() > 0) { - for (ActivityClientRecord ar : mActivities.values()) { - if (ar.activityInfo.applicationInfo.packageName - .equals(packageName)) { - ar.activityInfo.applicationInfo = aInfo; - ar.packageInfo = pkgInfo; + if (aInfo != null) { + if (mActivities.size() > 0) { + for (ActivityClientRecord ar : mActivities.values()) { + if (ar.activityInfo.applicationInfo.packageName + .equals(packageName)) { + ar.activityInfo.applicationInfo = aInfo; + ar.packageInfo = pkgInfo; + } } } - } - final String[] oldResDirs = { pkgInfo.getResDir() }; + final String[] oldResDirs = {pkgInfo.getResDir()}; - final ArrayList oldPaths = new ArrayList<>(); - LoadedApk.makePaths(this, pkgInfo.getApplicationInfo(), oldPaths); - pkgInfo.updateApplicationInfo(aInfo, oldPaths); + final ArrayList oldPaths = new ArrayList<>(); + LoadedApk.makePaths( + this, pkgInfo.getApplicationInfo(), oldPaths); + pkgInfo.updateApplicationInfo(aInfo, oldPaths); - synchronized (mResourcesManager) { // Update affected Resources objects to use new ResourcesImpl mResourcesManager.appendPendingAppInfoUpdate(oldResDirs, aInfo); @@ -6863,6 +6948,12 @@ public final class ActivityThread extends ClientTransactionHandler } } catch (RemoteException e) { } + } else { + // No package, perhaps it was removed? + Slog.e(TAG, "Package [" + packages[i] + "] reported as REPLACED," + + " but missing application info. Assuming REMOVED."); + mPackages.remove(packages[i]); + mResourcePackages.remove(packages[i]); } } } @@ -8540,6 +8631,9 @@ public final class ActivityThread extends ClientTransactionHandler NfcFrameworkInitializer.setNfcServiceManager(new NfcServiceManager()); DeviceConfigInitializer.setDeviceConfigServiceManager(new DeviceConfigServiceManager()); SeFrameworkInitializer.setSeServiceManager(new SeServiceManager()); + if (android.server.Flags.telemetryApisService()) { + ProfilingFrameworkInitializer.setProfilingServiceManager(new ProfilingServiceManager()); + } } private void purgePendingResources() { diff --git a/core/java/android/app/ActivityTransitionState.java b/core/java/android/app/ActivityTransitionState.java index 6f4bb456c4783daf18257126a7849126d0f6e013..d947a9b8eaa70d1a659629c1beff1a556717bfd5 100644 --- a/core/java/android/app/ActivityTransitionState.java +++ b/core/java/android/app/ActivityTransitionState.java @@ -15,6 +15,7 @@ */ package android.app; +import android.app.ActivityOptions.SceneTransitionInfo; import android.content.Intent; import android.os.Bundle; import android.os.ResultReceiver; @@ -81,9 +82,9 @@ class ActivityTransitionState { private EnterTransitionCoordinator mEnterTransitionCoordinator; /** - * ActivityOptions used on entering this Activity. + * {@link SceneTransitionInfo} used on entering this Activity. */ - private ActivityOptions mEnterActivityOptions; + private SceneTransitionInfo mEnterSceneTransitionInfo; /** * Has an exit transition been started? If so, we don't want to double-exit. @@ -165,7 +166,7 @@ class ActivityTransitionState { } } - public void setEnterActivityOptions(Activity activity, ActivityOptions options) { + public void setEnterSceneTransitionInfo(Activity activity, SceneTransitionInfo info) { final Window window = activity.getWindow(); if (window == null) { return; @@ -173,16 +174,15 @@ class ActivityTransitionState { // ensure Decor View has been created so that the window features are activated window.getDecorView(); if (window.hasFeature(Window.FEATURE_ACTIVITY_TRANSITIONS) - && options != null && mEnterActivityOptions == null - && mEnterTransitionCoordinator == null - && options.getAnimationType() == ActivityOptions.ANIM_SCENE_TRANSITION) { - mEnterActivityOptions = options; + && info != null && mEnterSceneTransitionInfo == null + && mEnterTransitionCoordinator == null) { + mEnterSceneTransitionInfo = info; mIsEnterTriggered = false; - if (mEnterActivityOptions.isReturning()) { + if (mEnterSceneTransitionInfo.isReturning()) { restoreExitedViews(); - int result = mEnterActivityOptions.getResultCode(); + int result = mEnterSceneTransitionInfo.getResultCode(); if (result != 0) { - Intent intent = mEnterActivityOptions.getResultData(); + Intent intent = mEnterSceneTransitionInfo.getResultData(); if (intent != null) { intent.setExtrasClassLoader(activity.getClassLoader()); } @@ -193,25 +193,26 @@ class ActivityTransitionState { } public void enterReady(Activity activity) { - if (mEnterActivityOptions == null || mIsEnterTriggered) { + if (mEnterSceneTransitionInfo == null || mIsEnterTriggered) { return; } mIsEnterTriggered = true; mHasExited = false; - ArrayList sharedElementNames = mEnterActivityOptions.getSharedElementNames(); - ResultReceiver resultReceiver = mEnterActivityOptions.getResultReceiver(); - final boolean isReturning = mEnterActivityOptions.isReturning(); + final ArrayList sharedElementNames = + mEnterSceneTransitionInfo.getSharedElementNames(); + ResultReceiver resultReceiver = mEnterSceneTransitionInfo.getResultReceiver(); + final boolean isReturning = mEnterSceneTransitionInfo.isReturning(); if (isReturning) { restoreExitedViews(); activity.getWindow().getDecorView().setVisibility(View.VISIBLE); } getPendingExitNames(); // Set mPendingExitNames before resetting mEnterTransitionCoordinator mEnterTransitionCoordinator = new EnterTransitionCoordinator(activity, - resultReceiver, sharedElementNames, mEnterActivityOptions.isReturning(), - mEnterActivityOptions.isCrossTask()); - if (mEnterActivityOptions.isCrossTask()) { - mExitingFrom = new ArrayList<>(mEnterActivityOptions.getSharedElementNames()); - mExitingTo = new ArrayList<>(mEnterActivityOptions.getSharedElementNames()); + resultReceiver, sharedElementNames, mEnterSceneTransitionInfo.isReturning(), + mEnterSceneTransitionInfo.isCrossTask()); + if (mEnterSceneTransitionInfo.isCrossTask() && sharedElementNames != null) { + mExitingFrom = new ArrayList<>(sharedElementNames); + mExitingTo = new ArrayList<>(sharedElementNames); } if (!mIsEnterPostponed) { @@ -248,7 +249,7 @@ class ActivityTransitionState { mExitingFrom = null; mExitingTo = null; mExitingToView = null; - mEnterActivityOptions = null; + mEnterSceneTransitionInfo = null; } public void onStop(Activity activity) { @@ -296,7 +297,7 @@ class ActivityTransitionState { mExitingToView = null; mCalledExitCoordinator = null; mEnterTransitionCoordinator = null; - mEnterActivityOptions = null; + mEnterSceneTransitionInfo = null; mExitTransitionCoordinators = null; } @@ -386,9 +387,10 @@ class ActivityTransitionState { mExitTransitionCoordinators == null) { return; } - ActivityOptions activityOptions = new ActivityOptions(options); - if (activityOptions.getAnimationType() == ActivityOptions.ANIM_SCENE_TRANSITION) { - int key = activityOptions.getExitCoordinatorKey(); + final ActivityOptions activityOptions = new ActivityOptions(options); + final SceneTransitionInfo info = activityOptions.getSceneTransitionInfo(); + if (info != null) { + int key = info.getExitCoordinatorKey(); int index = mExitTransitionCoordinators.indexOfKey(key); if (index >= 0) { mCalledExitCoordinator = mExitTransitionCoordinators.valueAt(index).get(); diff --git a/core/java/android/app/AppCompatTaskInfo.java b/core/java/android/app/AppCompatTaskInfo.java index a998ff215304be93ece55fc9358706e6c466f586..0bae5e67b87bd5fd2f853f4b183a7bde01098c0f 100644 --- a/core/java/android/app/AppCompatTaskInfo.java +++ b/core/java/android/app/AppCompatTaskInfo.java @@ -96,6 +96,11 @@ public class AppCompatTaskInfo implements Parcelable { */ public boolean isUserFullscreenOverrideEnabled; + /** + * Whether the system has forced the activity to be fullscreen + */ + public boolean isSystemFullscreenOverrideEnabled; + /** * Hint about the letterbox state of the top activity. */ @@ -202,7 +207,8 @@ public class AppCompatTaskInfo implements Parcelable { && topActivityLetterboxHeight == that.topActivityLetterboxHeight && topActivityLetterboxHorizontalPosition == that.topActivityLetterboxHorizontalPosition - && isUserFullscreenOverrideEnabled == that.isUserFullscreenOverrideEnabled; + && isUserFullscreenOverrideEnabled == that.isUserFullscreenOverrideEnabled + && isSystemFullscreenOverrideEnabled == that.isSystemFullscreenOverrideEnabled; } /** @@ -224,7 +230,8 @@ public class AppCompatTaskInfo implements Parcelable { && topActivityLetterboxWidth == that.topActivityLetterboxWidth && topActivityLetterboxHeight == that.topActivityLetterboxHeight && cameraCompatControlState == that.cameraCompatControlState - && isUserFullscreenOverrideEnabled == that.isUserFullscreenOverrideEnabled; + && isUserFullscreenOverrideEnabled == that.isUserFullscreenOverrideEnabled + && isSystemFullscreenOverrideEnabled == that.isSystemFullscreenOverrideEnabled; } /** @@ -243,6 +250,7 @@ public class AppCompatTaskInfo implements Parcelable { topActivityLetterboxWidth = source.readInt(); topActivityLetterboxHeight = source.readInt(); isUserFullscreenOverrideEnabled = source.readBoolean(); + isSystemFullscreenOverrideEnabled = source.readBoolean(); } /** @@ -262,6 +270,7 @@ public class AppCompatTaskInfo implements Parcelable { dest.writeInt(topActivityLetterboxWidth); dest.writeInt(topActivityLetterboxHeight); dest.writeBoolean(isUserFullscreenOverrideEnabled); + dest.writeBoolean(isSystemFullscreenOverrideEnabled); } @Override @@ -280,6 +289,7 @@ public class AppCompatTaskInfo implements Parcelable { + " topActivityLetterboxWidth=" + topActivityLetterboxWidth + " topActivityLetterboxHeight=" + topActivityLetterboxHeight + " isUserFullscreenOverrideEnabled=" + isUserFullscreenOverrideEnabled + + " isSystemFullscreenOverrideEnabled=" + isSystemFullscreenOverrideEnabled + " cameraCompatControlState=" + cameraCompatControlStateToString(cameraCompatControlState) + "}"; diff --git a/core/java/android/app/AppOpsManager.java b/core/java/android/app/AppOpsManager.java index f78072d35220464384500ac906a6431224577556..2afc78cb90e61c92b7f702fb21127b60a1dd6bcd 100644 --- a/core/java/android/app/AppOpsManager.java +++ b/core/java/android/app/AppOpsManager.java @@ -16,6 +16,9 @@ package android.app; + +import static android.location.flags.Flags.FLAG_LOCATION_BYPASS; +import static android.media.audio.Flags.foregroundAudioControl; import static android.permission.flags.Flags.FLAG_OP_ENABLE_MOBILE_DATA_BY_USER; import static android.view.contentprotection.flags.Flags.FLAG_CREATE_ACCESSIBILITY_OVERLAY_APP_OP_ENABLED; import static android.view.contentprotection.flags.Flags.FLAG_RAPID_CLEAR_NOTIFICATIONS_BY_LISTENER_APP_OP_ENABLED; @@ -36,6 +39,7 @@ import android.annotation.SystemApi; import android.annotation.SystemService; import android.annotation.TestApi; import android.app.usage.UsageStatsManager; +import android.companion.virtual.VirtualDeviceManager; import android.compat.Compatibility; import android.compat.annotation.ChangeId; import android.compat.annotation.EnabledAfter; @@ -68,9 +72,13 @@ import android.os.ServiceManager; import android.os.SystemClock; import android.os.UserHandle; import android.os.UserManager; +import android.permission.PermissionGroupUsage; +import android.permission.PermissionUsageHelper; +import android.permission.flags.Flags; import android.provider.DeviceConfig; import android.util.ArrayMap; import android.util.ArraySet; +import android.util.Log; import android.util.LongSparseArray; import android.util.LongSparseLongArray; import android.util.Pools; @@ -92,7 +100,6 @@ import com.android.internal.util.DataClass; import com.android.internal.util.FrameworkStatsLog; import com.android.internal.util.Parcelling; import com.android.internal.util.Preconditions; -import com.android.media.flags.Flags; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; @@ -221,6 +228,7 @@ public class AppOpsManager { private static Boolean sFullLog = null; final Context mContext; + private PermissionUsageHelper mUsageHelper; @UnsupportedAppUsage final IAppOpsService mService; @@ -1532,16 +1540,54 @@ public class AppOpsManager { public static final int OP_RESERVED_FOR_TESTING = AppProtoEnums.APP_OP_RESERVED_FOR_TESTING; /** - * Rapid clearing of notifications by a notification listener, see b/289080543 for details + * Rapid clearing of notifications by a notification listener * * @hide */ + // See b/289080543 for more details public static final int OP_RAPID_CLEAR_NOTIFICATIONS_BY_LISTENER = AppProtoEnums.APP_OP_RAPID_CLEAR_NOTIFICATIONS_BY_LISTENER; + /** + * See {@link #OPSTR_READ_SYSTEM_GRAMMATICAL_GENDER}. + * @hide + */ + public static final int OP_READ_SYSTEM_GRAMMATICAL_GENDER = + AppProtoEnums.APP_OP_READ_SYSTEM_GRAMMATICAL_GENDER; + + /** + * Allows an app with a major use case of backing-up or syncing content to run longer jobs. + * + * @hide + */ + public static final int OP_RUN_BACKUP_JOBS = AppProtoEnums.APP_OP_RUN_BACKUP_JOBS; + + /** + * Whether the app has enabled to receive the icon overlay for fetching archived apps. + * + * @hide + */ + public static final int OP_ARCHIVE_ICON_OVERLAY = AppProtoEnums.APP_OP_ARCHIVE_ICON_OVERLAY; + + /** + * Whether the app has enabled compatibility support for unarchival. + * + * @hide + */ + public static final int OP_UNARCHIVAL_CONFIRMATION = + AppProtoEnums.APP_OP_UNARCHIVAL_CONFIRMATION; + + /** + * Allows an app to access location without the traditional location permissions and while the + * user location setting is off, but only during pre-defined emergency sessions. + * + * @hide + */ + public static final int OP_EMERGENCY_LOCATION = AppProtoEnums.APP_OP_EMERGENCY_LOCATION; + /** @hide */ @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) - public static final int _NUM_OP = 143; + public static final int _NUM_OP = 148; /** * All app ops represented as strings. @@ -1691,6 +1737,10 @@ public class AppOpsManager { OPSTR_ENABLE_MOBILE_DATA_BY_USER, OPSTR_RESERVED_FOR_TESTING, OPSTR_RAPID_CLEAR_NOTIFICATIONS_BY_LISTENER, + OPSTR_RUN_BACKUP_JOBS, + OPSTR_ARCHIVE_ICON_OVERLAY, + OPSTR_UNARCHIVAL_CONFIRMATION, + OPSTR_EMERGENCY_LOCATION, }) public @interface AppOpString {} @@ -2027,9 +2077,24 @@ public class AppOpsManager { * @hide */ @SystemApi - @FlaggedApi(Flags.FLAG_ENABLE_PRIVILEGED_ROUTING_FOR_MEDIA_ROUTING_CONTROL) + @FlaggedApi(com.android.media.flags.Flags + .FLAG_ENABLE_PRIVILEGED_ROUTING_FOR_MEDIA_ROUTING_CONTROL) public static final String OPSTR_MEDIA_ROUTING_CONTROL = "android:media_routing_control"; + /** + * Whether the app has enabled to receive the icon overlay for fetching archived apps. + * + * @hide + */ + public static final String OPSTR_ARCHIVE_ICON_OVERLAY = "android:archive_icon_overlay"; + + /** + * Whether the app has enabled compatibility support for unarchival. + * + * @hide + */ + public static final String OPSTR_UNARCHIVAL_CONFIRMATION = "android:unarchival_support"; + /** * AppOp granted to apps that we are started via {@code am instrument -e --no-isolated-storage} * @@ -2179,6 +2244,8 @@ public class AppOpsManager { * * @hide */ + @FlaggedApi(Flags.FLAG_ENHANCED_CONFIRMATION_MODE_APIS_ENABLED) + @SystemApi public static final String OPSTR_ACCESS_RESTRICTED_SETTINGS = "android:access_restricted_settings"; @@ -2363,15 +2430,41 @@ public class AppOpsManager { "android:reserved_for_testing"; /** - * Rapid clearing of notifications by a notification listener, see b/289080543 for details + * Rapid clearing of notifications by a notification listener * * @hide */ + // See b/289080543 for more details @SystemApi @FlaggedApi(FLAG_RAPID_CLEAR_NOTIFICATIONS_BY_LISTENER_APP_OP_ENABLED) public static final String OPSTR_RAPID_CLEAR_NOTIFICATIONS_BY_LISTENER = "android:rapid_clear_notifications_by_listener"; + /** + * Allows an application to read the system grammatical gender. + * + * @hide + */ + public static final String OPSTR_READ_SYSTEM_GRAMMATICAL_GENDER = + "android:read_system_grammatical_gender"; + + /** + * Allows an app whose primary use case is to backup or sync content to run longer jobs. + * + * @hide + */ + public static final String OPSTR_RUN_BACKUP_JOBS = "android:run_backup_jobs"; + + /** + * Allows an app to access location without the traditional location permissions and while the + * user location setting is off, but only during pre-defined emergency sessions. + * + * @hide + */ + @SystemApi + @FlaggedApi(FLAG_LOCATION_BYPASS) + public static final String OPSTR_EMERGENCY_LOCATION = "android:emergency_location"; + /** {@link #sAppOpsToNote} not initialized yet for this op */ private static final byte SHOULD_COLLECT_NOTE_OP_NOT_INITIALIZED = 0; /** Should not collect noting of this app-op in {@link #sAppOpsToNote} */ @@ -2483,6 +2576,10 @@ public class AppOpsManager { OP_RECEIVE_SANDBOX_TRIGGER_AUDIO, OP_RECEIVE_SANDBOXED_DETECTION_TRAINING_DATA, OP_MEDIA_ROUTING_CONTROL, + OP_READ_SYSTEM_GRAMMATICAL_GENDER, + OP_RUN_BACKUP_JOBS, + OP_ARCHIVE_ICON_OVERLAY, + OP_UNARCHIVAL_CONFIRMATION, }; static final AppOpInfo[] sAppOpInfos = new AppOpInfo[]{ @@ -2935,6 +3032,22 @@ public class AppOpsManager { OPSTR_RAPID_CLEAR_NOTIFICATIONS_BY_LISTENER, "RAPID_CLEAR_NOTIFICATIONS_BY_LISTENER") .setDefaultMode(AppOpsManager.MODE_ALLOWED).build(), + new AppOpInfo.Builder(OP_READ_SYSTEM_GRAMMATICAL_GENDER, + OPSTR_READ_SYSTEM_GRAMMATICAL_GENDER, "READ_SYSTEM_GRAMMATICAL_GENDER") + // will make it an app-op permission in the future. + // .setPermission(Manifest.permission.READ_SYSTEM_GRAMMATICAL_GENDER) + .build(), + new AppOpInfo.Builder(OP_RUN_BACKUP_JOBS, OPSTR_RUN_BACKUP_JOBS, "RUN_BACKUP_JOBS") + .setPermission(Manifest.permission.RUN_BACKUP_JOBS).build(), + new AppOpInfo.Builder(OP_ARCHIVE_ICON_OVERLAY, OPSTR_ARCHIVE_ICON_OVERLAY, + "ARCHIVE_ICON_OVERLAY") + .setDefaultMode(MODE_ALLOWED).build(), + new AppOpInfo.Builder(OP_UNARCHIVAL_CONFIRMATION, OPSTR_UNARCHIVAL_CONFIRMATION, + "UNARCHIVAL_CONFIRMATION") + .setDefaultMode(MODE_ALLOWED).build(), + // TODO(b/301150056): STOPSHIP determine how this appop should work with the permission + new AppOpInfo.Builder(OP_EMERGENCY_LOCATION, OPSTR_EMERGENCY_LOCATION, "EMERGENCY_LOCATION") + .setPermission(Manifest.permission.LOCATION_BYPASS).build(), }; // The number of longs needed to form a full bitmask of app ops @@ -3069,7 +3182,7 @@ public class AppOpsManager { /** * Retrieve the permission associated with an operation, or null if there is not one. - * + * @param op The operation name. * * @hide @@ -3122,6 +3235,10 @@ public class AppOpsManager { * @hide */ public static @Mode int opToDefaultMode(int op) { + if (op == OP_TAKE_AUDIO_FOCUS && foregroundAudioControl()) { + // when removing the flag, change the entry in sAppOpInfos for OP_TAKE_AUDIO_FOCUS + return AppOpsManager.MODE_FOREGROUND; + } return sAppOpInfos[op].defaultMode; } @@ -3316,7 +3433,8 @@ public class AppOpsManager { } } - public static final @android.annotation.NonNull Creator CREATOR = new Creator() { + public static final @android.annotation.NonNull Creator CREATOR = + new Creator() { @Override public PackageOps createFromParcel(Parcel source) { return new PackageOps(source); } @@ -7263,6 +7381,12 @@ public class AppOpsManager { * The default impl is to fallback onto {@link #onOpChanged(String, String) * + *

Implement this method and not + * {@link #onOpChanged(String, String, int, String)} if + * callbacks are + * required only on op state changes for the default device + * {@link VirtualDeviceManager#PERSISTENT_DEVICE_ID_DEFAULT}. + * * @param op The Op that changed. * @param packageName Package of the app whose Op changed. * @param userId User Space of the app whose Op changed. @@ -7271,6 +7395,31 @@ public class AppOpsManager { default void onOpChanged(@NonNull String op, @NonNull String packageName, int userId) { onOpChanged(op, packageName); } + + /** + * Similar to {@link #onOpChanged(String, String, int)} but includes the device for which + * the op mode has changed. + * + *

Implement this method if callbacks are required on all devices. + * If not implemented explicitly, the default implementation will notify for op changes + * on the default device {@link VirtualDeviceManager#PERSISTENT_DEVICE_ID_DEFAULT} only. + * + *

If implemented, {@link #onOpChanged(String, String, int)} + * will not be called automatically. + * + * @param op The Op that changed. + * @param packageName Package of the app whose Op changed. + * @param userId User id of the app whose Op changed. + * @param persistentDeviceId persistent device id whose Op changed. + */ + @FlaggedApi(Flags.FLAG_DEVICE_AWARE_PERMISSION_APIS_ENABLED) + default void onOpChanged(@NonNull String op, @NonNull String packageName, int userId, + @NonNull String persistentDeviceId) { + if (Objects.equals(persistentDeviceId, + VirtualDeviceManager.PERSISTENT_DEVICE_ID_DEFAULT)) { + onOpChanged(op, packageName, userId); + } + } } /** @@ -7290,6 +7439,12 @@ public class AppOpsManager { /** * Called when the active state of an app-op changes. * + *

Implement this method and not + * {@link #onOpActiveChanged(String, int, String, String, int, boolean, int, int)} if + * callbacks are + * required only on op state changes for the default device + * {@link Context#DEVICE_ID_DEFAULT}. + * * @param op The operation that changed. * @param uid The UID performing the operation. * @param packageName The package performing the operation. @@ -7305,6 +7460,37 @@ public class AppOpsManager { int attributionFlags, int attributionChainId) { onOpActiveChanged(op, uid, packageName, active); } + + /** + * Similar to {@link #onOpActiveChanged(String, int, String, String, boolean, int, int)}, + * but also includes the virtual device id of the op is now active or inactive. + * + *

Implement this method if callbacks are required on all devices. + * If not implemented explicitly, the default implementation will notify for op state + * changes on the default device {@link Context#DEVICE_ID_DEFAULT} only. + * + *

If implemented, + * {@link #onOpActiveChanged(String, int, String, String, boolean, int, int)} + * will not be called automatically. + * + * @param op The operation that changed. + * @param uid The UID performing the operation. + * @param packageName The package performing the operation. + * @param attributionTag The operation's attribution tag. + * @param virtualDeviceId the virtual device id whose operation has changed + * @param active Whether the operation became active or inactive. + * @param attributionFlags the attribution flags for this operation. + * @param attributionChainId the unique id of the attribution chain this op is a part of. + */ + @FlaggedApi(Flags.FLAG_DEVICE_AWARE_PERMISSION_APIS_ENABLED) + default void onOpActiveChanged(@NonNull String op, int uid, @NonNull String packageName, + @Nullable String attributionTag, int virtualDeviceId, boolean active, + @AttributionFlags int attributionFlags, int attributionChainId) { + if (virtualDeviceId == Context.DEVICE_ID_DEFAULT) { + onOpActiveChanged(op, uid, packageName, attributionTag, active, attributionFlags, + attributionChainId); + } + } } /** @@ -7317,6 +7503,10 @@ public class AppOpsManager { /** * Called when an app-op is noted. * + *

Implement this method and not + * {@link #onOpNoted(String, int, String, String, int, int, int)} if callbacks are + * required only on op notes for the default device {@link Context#DEVICE_ID_DEFAULT}. + * * @param op The operation that was noted. * @param uid The UID performing the operation. * @param packageName The package performing the operation. @@ -7326,6 +7516,34 @@ public class AppOpsManager { */ void onOpNoted(@NonNull String op, int uid, @NonNull String packageName, @Nullable String attributionTag, @OpFlags int flags, @Mode int result); + + /** + * Similar to {@link #onOpNoted(String, int, String, String, int, int, int)}, + * but also includes the virtual device id of the op is now active or inactive. + * + *

Implement this method if callbacks are required for op notes on all devices. + * If not implemented explicitly, the default implementation will notify for the + * default device {@link Context#DEVICE_ID_DEFAULT} only. + * + *

If implemented, {@link #onOpNoted(String, int, String, String, int, int)} + * will not be called automatically. + * + * @param op The operation that was noted. + * @param uid The UID performing the operation. + * @param packageName The package performing the operation. + * @param attributionTag The attribution tag performing the operation. + * @param virtualDeviceId the device that noted the operation + * @param flags The flags of this op + * @param result The result of the note. + */ + @FlaggedApi(Flags.FLAG_DEVICE_AWARE_PERMISSION_APIS_ENABLED) + default void onOpNoted(@NonNull String op, int uid, @NonNull String packageName, + @Nullable String attributionTag, int virtualDeviceId, @OpFlags int flags, + @Mode int result) { + if (virtualDeviceId == Context.DEVICE_ID_DEFAULT) { + onOpNoted(op, uid, packageName, attributionTag, flags, result); + } + } } /** @@ -7364,6 +7582,9 @@ public class AppOpsManager { public static class OnOpChangedInternalListener implements OnOpChangedListener { public void onOpChanged(String op, String packageName) { } public void onOpChanged(int op, String packageName) { } + public void onOpChanged(int op, String packageName, String persistentDeviceId) { + onOpChanged(op, packageName); + } } /** @@ -7374,6 +7595,8 @@ public class AppOpsManager { public interface OnOpActiveChangedInternalListener extends OnOpActiveChangedListener { default void onOpActiveChanged(String op, int uid, String packageName, boolean active) { } default void onOpActiveChanged(int op, int uid, String packageName, boolean active) { } + default void onOpActiveChanged(int op, int uid, String packageName, int virtualDeviceId, + boolean active) { } } /** @@ -7427,6 +7650,12 @@ public class AppOpsManager { /** * Called when an op was started. * + *

Implement this method and not + * {@link #onOpStarted(int, int, String, String, int, int, int, int, int, int)} if + * callbacks are + * required only on op starts for the default device + * {@link Context#DEVICE_ID_DEFAULT}. + * * Note: This is only for op starts. It is not called when an op is noted or stopped. * By default, unless this method is overridden, no code will be executed for resume * events. @@ -7447,6 +7676,37 @@ public class AppOpsManager { onOpStarted(op, uid, packageName, attributionTag, flags, result); } } + + /** + * Similar to {@link #onOpStarted(int, int, String, String, int, int)}, + * but also includes the virtual device id that started the op. + * + *

Implement this method if callbacks are required on all devices. + * If not implemented explicitly, the default implementation will notify for op starts on + * the default device {@link Context#DEVICE_ID_DEFAULT} only. + * + *

If implemented, {@link #onOpStarted(int, int, String, String, int, int)} + * will not be called automatically. + * + * @param op The op code. + * @param uid The UID performing the operation. + * @param packageName The package performing the operation. + * @param attributionTag The attribution tag performing the operation. + * @param virtualDeviceId the device that started the operation + * @param flags The flags of this op. + * @param result The result of the start. + * @param startType The start type of this start event. Either failed, resumed, or started. + * @param attributionFlags The location of this started op in an attribution chain. + */ + default void onOpStarted(int op, int uid, @NonNull String packageName, + @Nullable String attributionTag, int virtualDeviceId, @OpFlags int flags, + @Mode int result, @StartedType int startType, + @AttributionFlags int attributionFlags, int attributionChainId) { + if (virtualDeviceId == Context.DEVICE_ID_DEFAULT) { + onOpStarted(op, uid, packageName, attributionTag, flags, result, startType, + attributionFlags, attributionChainId); + } + } } AppOpsManager(Context context, IAppOpsService service) { @@ -7509,6 +7769,44 @@ public class AppOpsManager { return (result != null) ? result : Collections.emptyList(); } + /** + * Retrieve current operation state for all applications for a device. + * + * The mode of the ops returned are set for the package but may not reflect their effective + * state due to UID policy or because it's controlled by a different global op. + * + * Use {@link #unsafeCheckOp(String, int, String)}} or + * {@link #noteOp(String, int, String, String, String)} if the effective mode is needed. + * + * @param ops The set of operations you are interested in, or null if you want all of them. + * @param persistentDeviceId The device that the ops are attributed to. + * + * @hide + */ + @SystemApi + @FlaggedApi(android.permission.flags.Flags.FLAG_DEVICE_AWARE_PERMISSION_APIS_ENABLED) + @RequiresPermission(android.Manifest.permission.GET_APP_OPS_STATS) + public @NonNull List getPackagesForOps(@Nullable String[] ops, + @NonNull String persistentDeviceId) { + final int[] opCodes; + if (ops != null) { + final int opCount = ops.length; + opCodes = new int[opCount]; + for (int i = 0; i < opCount; i++) { + opCodes[i] = sOpStrToOp.get(ops[i]); + } + } else { + opCodes = null; + } + final List result; + try { + result = mService.getPackagesForOpsForDevice(opCodes, persistentDeviceId); + } catch (RemoteException e) { + throw e.rethrowFromSystemServer(); + } + return (result != null) ? result : Collections.emptyList(); + } + /** * Retrieve current operation state for all applications. * @@ -7525,7 +7823,8 @@ public class AppOpsManager { @UnsupportedAppUsage public List getPackagesForOps(int[] ops) { try { - return mService.getPackagesForOps(ops); + return mService.getPackagesForOpsForDevice(ops, + VirtualDeviceManager.PERSISTENT_DEVICE_ID_DEFAULT); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } @@ -7705,6 +8004,14 @@ public class AppOpsManager { @RequiresPermission(android.Manifest.permission.MANAGE_APP_OPS_MODES) public void setUidMode(int code, int uid, @Mode int mode) { try { + // TODO(b/302609140): Remove extra logging after this issue is diagnosed. + if (code == OP_BLUETOOTH_CONNECT) { + Log.i(DEBUG_LOGGING_TAG, + "setUidMode called for OP_BLUETOOTH_CONNECT with mode: " + mode + + " for uid: " + uid + " calling uid: " + Binder.getCallingUid() + + " trace: " + + Arrays.toString(Thread.currentThread().getStackTrace())); + } mService.setUidMode(code, uid, mode); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); @@ -7725,6 +8032,15 @@ public class AppOpsManager { @RequiresPermission(android.Manifest.permission.MANAGE_APP_OPS_MODES) public void setUidMode(@NonNull String appOp, int uid, @Mode int mode) { try { + // TODO(b/302609140): Remove extra logging after this issue is diagnosed. + if (appOp.equals(OPSTR_BLUETOOTH_CONNECT)) { + Log.i(DEBUG_LOGGING_TAG, + "setUidMode called for OPSTR_BLUETOOTH_CONNECT with mode: " + mode + + " for uid: " + uid + " calling uid: " + Binder.getCallingUid() + + " trace: " + + Arrays.toString(Thread.currentThread().getStackTrace())); + } + mService.setUidMode(AppOpsManager.strOpToOp(appOp), uid, mode); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); @@ -7765,6 +8081,14 @@ public class AppOpsManager { @RequiresPermission(android.Manifest.permission.MANAGE_APP_OPS_MODES) public void setMode(int code, int uid, String packageName, @Mode int mode) { try { + // TODO(b/302609140): Remove extra logging after this issue is diagnosed. + if (code == OP_BLUETOOTH_CONNECT) { + Log.i(DEBUG_LOGGING_TAG, + "setMode called for OPSTR_BLUETOOTH_CONNECT with mode: " + mode + + " for uid: " + uid + " calling uid: " + Binder.getCallingUid() + + " trace: " + + Arrays.toString(Thread.currentThread().getStackTrace())); + } mService.setMode(code, uid, packageName, mode); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); @@ -7787,6 +8111,14 @@ public class AppOpsManager { public void setMode(@NonNull String op, int uid, @Nullable String packageName, @Mode int mode) { try { + // TODO(b/302609140): Remove extra logging after this issue is diagnosed. + if (op.equals(OPSTR_BLUETOOTH_CONNECT)) { + Log.i(DEBUG_LOGGING_TAG, + "setMode called for OPSTR_BLUETOOTH_CONNECT with mode: " + mode + + " for uid: " + uid + " calling uid: " + Binder.getCallingUid() + + " trace: " + + Arrays.toString(Thread.currentThread().getStackTrace())); + } mService.setMode(strOpToOp(op), uid, packageName, mode); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); @@ -7938,14 +8270,26 @@ public class AppOpsManager { IAppOpsCallback cb = mModeWatchers.get(callback); if (cb == null) { cb = new IAppOpsCallback.Stub() { - public void opChanged(int op, int uid, String packageName) { - if (callback instanceof OnOpChangedInternalListener) { - ((OnOpChangedInternalListener)callback).onOpChanged(op, packageName); - } - if (sAppOpInfos[op].name != null) { - - callback.onOpChanged(sAppOpInfos[op].name, packageName, - UserHandle.getUserId(uid)); + public void opChanged(int op, int uid, String packageName, + String persistentDeviceId) { + if (Flags.deviceAwarePermissionApisEnabled()) { + if (callback instanceof OnOpChangedInternalListener) { + ((OnOpChangedInternalListener)callback).onOpChanged(op, packageName, + persistentDeviceId); + } + if (sAppOpInfos[op].name != null) { + callback.onOpChanged(sAppOpInfos[op].name, packageName, + UserHandle.getUserId(uid), persistentDeviceId); + } + } else { + if (callback instanceof OnOpChangedInternalListener) { + ((OnOpChangedInternalListener) callback).onOpChanged(op, + packageName); + } + if (sAppOpInfos[op].name != null) { + callback.onOpChanged(sAppOpInfos[op].name, packageName, + UserHandle.getUserId(uid)); + } } } }; @@ -8026,16 +8370,29 @@ public class AppOpsManager { cb = new IAppOpsActiveCallback.Stub() { @Override public void opActiveChanged(int op, int uid, String packageName, - String attributionTag, boolean active, @AttributionFlags - int attributionFlags, int attributionChainId) { + String attributionTag, int virtualDeviceId, boolean active, + @AttributionFlags int attributionFlags, int attributionChainId) { executor.execute(() -> { - if (callback instanceof OnOpActiveChangedInternalListener) { - ((OnOpActiveChangedInternalListener) callback).onOpActiveChanged(op, - uid, packageName, active); - } - if (sAppOpInfos[op].name != null) { - callback.onOpActiveChanged(sAppOpInfos[op].name, uid, packageName, - attributionTag, active, attributionFlags, attributionChainId); + if (Flags.deviceAwarePermissionApisEnabled()) { + if (callback instanceof OnOpActiveChangedInternalListener) { + ((OnOpActiveChangedInternalListener) callback).onOpActiveChanged(op, + uid, packageName, virtualDeviceId, active); + } + if (sAppOpInfos[op].name != null) { + callback.onOpActiveChanged(sAppOpInfos[op].name, uid, packageName, + attributionTag, virtualDeviceId, active, attributionFlags, + attributionChainId); + } + } else { + if (callback instanceof OnOpActiveChangedInternalListener) { + ((OnOpActiveChangedInternalListener) callback).onOpActiveChanged(op, + uid, packageName, active); + } + if (sAppOpInfos[op].name != null) { + callback.onOpActiveChanged(sAppOpInfos[op].name, uid, packageName, + attributionTag, active, attributionFlags, + attributionChainId); + } } }); } @@ -8104,10 +8461,10 @@ public class AppOpsManager { cb = new IAppOpsStartedCallback.Stub() { @Override public void opStarted(int op, int uid, String packageName, String attributionTag, - int flags, int mode, int startType, int attributionFlags, - int attributionChainId) { - callback.onOpStarted(op, uid, packageName, attributionTag, flags, mode, - startType, attributionFlags, attributionChainId); + int virtualDeviceId, int flags, int mode, int startType, + int attributionFlags, int attributionChainId) { + callback.onOpStarted(op, uid, packageName, attributionTag, virtualDeviceId, + flags, mode, startType, attributionFlags, attributionChainId); } }; mStartedWatchers.put(callback, cb); @@ -8275,14 +8632,18 @@ public class AppOpsManager { cb = new IAppOpsNotedCallback.Stub() { @Override public void opNoted(int op, int uid, String packageName, String attributionTag, - int flags, int mode) { + int virtualDeviceId, int flags, int mode) { final long identity = Binder.clearCallingIdentity(); try { executor.execute(() -> { if (sAppOpInfos[op].name != null) { - listener.onOpNoted(sAppOpInfos[op].name, uid, packageName, - attributionTag, - flags, mode); + if (Flags.deviceAwarePermissionApisEnabled()) { + listener.onOpNoted(sAppOpInfos[op].name, uid, packageName, + attributionTag, virtualDeviceId, flags, mode); + } else { + listener.onOpNoted(sAppOpInfos[op].name, uid, packageName, + attributionTag, flags, mode); + } } }); } finally { @@ -8589,6 +8950,8 @@ public class AppOpsManager { * * @hide */ + @TestApi + @SuppressLint("UnflaggedApi") public int noteOpNoThrow(int op, @NonNull AttributionSource attributionSource, @Nullable String message) { return noteOpNoThrow(op, attributionSource.getUid(), attributionSource.getPackageName(), @@ -9655,6 +10018,30 @@ public class AppOpsManager { appOpsNotedForAttribution.set(op); } + /** + * Get recent op usage data for CAMERA, MICROPHONE and LOCATION from all connected devices + * to power privacy indicator. + * + * @param includeMicrophoneUsage whether to retrieve microphone usage + * @return A list of permission groups currently or recently used by all apps by all users in + * the current profile group. + * + * @hide + */ + @SystemApi + @NonNull + @FlaggedApi(android.permission.flags.Flags.FLAG_DEVICE_AWARE_PERMISSION_APIS_ENABLED) + @RequiresPermission(Manifest.permission.GET_APP_OPS_STATS) + public List getPermissionGroupUsageForPrivacyIndicator( + boolean includeMicrophoneUsage) { + // Lazily initialize the usage helper + if (mUsageHelper == null) { + mUsageHelper = new PermissionUsageHelper(mContext); + } + + return mUsageHelper.getOpUsageDataForAllDevices(includeMicrophoneUsage); + } + /** @hide */ @Retention(RetentionPolicy.SOURCE) @IntDef(value = { diff --git a/core/java/android/app/ApplicationPackageManager.java b/core/java/android/app/ApplicationPackageManager.java index 287d2bd9e6a7353e5c77b0f0fe75d25173951f58..dd6bc55421efe79dbdd2703159c6fc0285797ab1 100644 --- a/core/java/android/app/ApplicationPackageManager.java +++ b/core/java/android/app/ApplicationPackageManager.java @@ -120,6 +120,7 @@ import android.util.ArrayMap; import android.util.ArraySet; import android.util.LauncherIcons; import android.util.Log; +import android.util.Slog; import com.android.internal.annotations.GuardedBy; import com.android.internal.annotations.Immutable; @@ -131,6 +132,7 @@ import dalvik.system.VMRuntime; import libcore.util.EmptyArray; +import java.io.File; import java.io.IOException; import java.io.InputStream; import java.lang.ref.WeakReference; @@ -835,7 +837,7 @@ public class ApplicationPackageManager extends PackageManager { @Override public int checkPermission(String permName, String pkgName) { - return PermissionManager.checkPackageNamePermission(permName, pkgName, + return getPermissionManager().checkPackageNamePermission(permName, pkgName, mContext.getDeviceId(), getUserId()); } @@ -1268,6 +1270,22 @@ public class ApplicationPackageManager extends PackageManager { return appMetadata != null ? appMetadata : new PersistableBundle(); } + @Override + public @AppMetadataSource int getAppMetadataSource(@NonNull String packageName) + throws NameNotFoundException { + Objects.requireNonNull(packageName, "packageName cannot be null"); + int source = PackageManager.APP_METADATA_SOURCE_UNKNOWN; + try { + source = mPM.getAppMetadataSource(packageName, getUserId()); + } catch (ParcelableException e) { + e.maybeRethrow(NameNotFoundException.class); + throw new RuntimeException(e); + } catch (RemoteException e) { + throw e.rethrowFromSystemServer(); + } + return source; + } + @SuppressWarnings("unchecked") @Override public List getPackagesHoldingPermissions(String[] permissions, int flags) { @@ -4030,19 +4048,25 @@ public class ApplicationPackageManager extends PackageManager { @Nullable private Drawable getArchivedAppIcon(String packageName) { try { - return new BitmapDrawable(null, - mPM.getArchivedAppIcon(packageName, new UserHandle(getUserId()))); + Bitmap archivedAppIcon = mPM.getArchivedAppIcon(packageName, + new UserHandle(getUserId()), + mContext.getPackageName()); + if (archivedAppIcon == null) { + return null; + } + return new BitmapDrawable(null, archivedAppIcon); } catch (RemoteException e) { - throw e.rethrowFromSystemServer(); + Slog.e(TAG, "Failed to retrieve archived app icon: " + e.getMessage()); + return null; } } @Override - public T parseAndroidManifest(@NonNull String apkFilePath, + public T parseAndroidManifest(@NonNull File apkFile, @NonNull Function parserFunction) throws IOException { - Objects.requireNonNull(apkFilePath, "apkFilePath cannot be null"); + Objects.requireNonNull(apkFile, "apkFile cannot be null"); Objects.requireNonNull(parserFunction, "parserFunction cannot be null"); - try (XmlResourceParser xmlResourceParser = getAndroidManifestParser(apkFilePath)) { + try (XmlResourceParser xmlResourceParser = getAndroidManifestParser(apkFile)) { return parserFunction.apply(xmlResourceParser); } catch (IOException e) { Log.w(TAG, "Failed to get the android manifest parser", e); @@ -4050,11 +4074,11 @@ public class ApplicationPackageManager extends PackageManager { } } - private static XmlResourceParser getAndroidManifestParser(@NonNull String apkFilePath) + private static XmlResourceParser getAndroidManifestParser(@NonNull File apkFile) throws IOException { ApkAssets apkAssets = null; try { - apkAssets = ApkAssets.loadFromPath(apkFilePath); + apkAssets = ApkAssets.loadFromPath(apkFile.getAbsolutePath()); return apkAssets.openXml(ApkLiteParseUtils.ANDROID_MANIFEST_FILENAME); } finally { if (apkAssets != null) { diff --git a/core/java/android/app/ApplicationStartInfo.java b/core/java/android/app/ApplicationStartInfo.java index 656feb0401d6eebdce917a3c065aec236ab97c1d..3715c6e633dcf3bd17723b885563f74856b11136 100644 --- a/core/java/android/app/ApplicationStartInfo.java +++ b/core/java/android/app/ApplicationStartInfo.java @@ -22,15 +22,24 @@ import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.SuppressLint; import android.content.Intent; +import android.content.pm.ApplicationInfo; import android.icu.text.SimpleDateFormat; import android.os.Parcel; import android.os.Parcelable; import android.os.UserHandle; +import android.text.TextUtils; import android.util.ArrayMap; +import android.util.Xml; import android.util.proto.ProtoInputStream; import android.util.proto.ProtoOutputStream; import android.util.proto.WireTypeMismatchException; +import com.android.internal.util.XmlUtils; +import com.android.modules.utils.TypedXmlPullParser; +import com.android.modules.utils.TypedXmlSerializer; + +import org.xmlpull.v1.XmlPullParserException; + import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; @@ -39,12 +48,18 @@ import java.io.ObjectOutputStream; import java.io.PrintWriter; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; -import java.util.Iterator; import java.util.Map; -import java.util.Set; +import java.util.Objects; /** - * Provide information related to a processes startup. + * Describes information related to an application process's startup. + * + *

+ * Many aspects concerning why and how an applications process was started are valuable for apps + * both for logging and for potential behavior changes. Reason for process start, start type, + * start times, throttling, and other useful diagnostic data can be obtained from + * {@link ApplicationStartInfo} records. + *

*/ @FlaggedApi(Flags.FLAG_APP_START_INFO) public final class ApplicationStartInfo implements Parcelable { @@ -209,6 +224,11 @@ public final class ApplicationStartInfo implements Parcelable { */ private int mDefiningUid; + /** + * @see #getPackageName + */ + private String mPackageName; + /** * @see #getProcessName */ @@ -230,7 +250,7 @@ public final class ApplicationStartInfo implements Parcelable { private @StartType int mStartType; /** - * @see #getStartIntent + * @see #getIntent */ private Intent mStartIntent; @@ -239,6 +259,11 @@ public final class ApplicationStartInfo implements Parcelable { */ private @LaunchMode int mLaunchMode; + /** + * @see #wasForceStopped() + */ + private boolean mWasForceStopped; + /** * @hide * */ @@ -343,6 +368,14 @@ public final class ApplicationStartInfo implements Parcelable { mDefiningUid = uid; } + /** + * @see #getPackageName + * @hide + */ + public void setPackageName(final String packageName) { + mPackageName = intern(packageName); + } + /** * @see #getProcessName * @hide @@ -386,7 +419,9 @@ public final class ApplicationStartInfo implements Parcelable { * @hide */ public void setIntent(Intent startIntent) { - mStartIntent = startIntent; + if (startIntent != null) { + mStartIntent = startIntent.maybeStripForHistory(); + } } /** @@ -397,6 +432,15 @@ public final class ApplicationStartInfo implements Parcelable { mLaunchMode = launchMode; } + /** + * @see #wasForceStopped() + * @param wasForceStopped whether the app had been force-stopped in the past + * @hide + */ + public void setForceStopped(boolean wasForceStopped) { + mWasForceStopped = wasForceStopped; + } + /** * Current state of startup. * @@ -455,6 +499,15 @@ public final class ApplicationStartInfo implements Parcelable { return mDefiningUid; } + /** + * Name of first package running in this process; + * + * @hide + */ + public String getPackageName() { + return mPackageName; + } + /** * The actual process name it was running with. * @@ -512,6 +565,8 @@ public final class ApplicationStartInfo implements Parcelable { /** * The intent used to launch the application. * + *

Note: Intent is stripped and does not include extras.

+ * *

Note: field will be set for any {@link #getStartupState} value.

*/ @SuppressLint("IntentBuilderName") @@ -538,6 +593,20 @@ public final class ApplicationStartInfo implements Parcelable { return mLaunchMode; } + /** + * Informs whether this is the first process launch for an app since it was + * {@link ApplicationInfo#FLAG_STOPPED force-stopped} for some reason. + * This allows the app to know if it should re-register for any alarms, jobs and other callbacks + * that were cleared when the app was force-stopped. + * + * @return {@code true} if this is the first process launch of the app after having been + * stopped, {@code false} otherwise. + */ + @FlaggedApi(android.content.pm.Flags.FLAG_STAY_STOPPED) + public boolean wasForceStopped() { + return mWasForceStopped; + } + @Override public int describeContents() { return 0; @@ -550,19 +619,20 @@ public final class ApplicationStartInfo implements Parcelable { dest.writeInt(mRealUid); dest.writeInt(mPackageUid); dest.writeInt(mDefiningUid); + dest.writeString(mPackageName); dest.writeString(mProcessName); dest.writeInt(mReason); - dest.writeInt(mStartupTimestampsNs.size()); - Set> timestampEntrySet = mStartupTimestampsNs.entrySet(); - Iterator> iter = timestampEntrySet.iterator(); - while (iter.hasNext()) { - Map.Entry entry = iter.next(); - dest.writeInt(entry.getKey()); - dest.writeLong(entry.getValue()); + dest.writeInt(mStartupTimestampsNs == null ? 0 : mStartupTimestampsNs.size()); + if (mStartupTimestampsNs != null) { + for (int i = 0; i < mStartupTimestampsNs.size(); i++) { + dest.writeInt(mStartupTimestampsNs.keyAt(i)); + dest.writeLong(mStartupTimestampsNs.valueAt(i)); + } } dest.writeInt(mStartType); dest.writeParcelable(mStartIntent, flags); dest.writeInt(mLaunchMode); + dest.writeBoolean(mWasForceStopped); } /** @hide */ @@ -575,12 +645,14 @@ public final class ApplicationStartInfo implements Parcelable { mRealUid = other.mRealUid; mPackageUid = other.mPackageUid; mDefiningUid = other.mDefiningUid; + mPackageName = other.mPackageName; mProcessName = other.mProcessName; mReason = other.mReason; mStartupTimestampsNs = other.mStartupTimestampsNs; mStartType = other.mStartType; mStartIntent = other.mStartIntent; mLaunchMode = other.mLaunchMode; + mWasForceStopped = other.mWasForceStopped; } private ApplicationStartInfo(@NonNull Parcel in) { @@ -589,6 +661,7 @@ public final class ApplicationStartInfo implements Parcelable { mRealUid = in.readInt(); mPackageUid = in.readInt(); mDefiningUid = in.readInt(); + mPackageName = intern(in.readString()); mProcessName = intern(in.readString()); mReason = in.readInt(); int starupTimestampCount = in.readInt(); @@ -601,6 +674,7 @@ public final class ApplicationStartInfo implements Parcelable { mStartIntent = in.readParcelable(Intent.class.getClassLoader(), android.content.Intent.class); mLaunchMode = in.readInt(); + mWasForceStopped = in.readBoolean(); } private static String intern(@Nullable String source) { @@ -620,6 +694,12 @@ public final class ApplicationStartInfo implements Parcelable { } }; + private static final String PROTO_SERIALIZER_ATTRIBUTE_TIMESTAMPS = "timestamps"; + private static final String PROTO_SERIALIZER_ATTRIBUTE_TIMESTAMP = "timestamp"; + private static final String PROTO_SERIALIZER_ATTRIBUTE_KEY = "key"; + private static final String PROTO_SERIALIZER_ATTRIBUTE_TS = "ts"; + private static final String PROTO_SERIALIZER_ATTRIBUTE_INTENT = "intent"; + /** * Write to a protocol buffer output stream. Protocol buffer message definition at {@link * android.app.ApplicationStartInfoProto} @@ -640,18 +720,39 @@ public final class ApplicationStartInfo implements Parcelable { if (mStartupTimestampsNs != null && mStartupTimestampsNs.size() > 0) { ByteArrayOutputStream timestampsBytes = new ByteArrayOutputStream(); ObjectOutputStream timestampsOut = new ObjectOutputStream(timestampsBytes); - timestampsOut.writeObject(mStartupTimestampsNs); + TypedXmlSerializer serializer = Xml.resolveSerializer(timestampsOut); + serializer.startDocument(null, true); + serializer.startTag(null, PROTO_SERIALIZER_ATTRIBUTE_TIMESTAMPS); + for (int i = 0; i < mStartupTimestampsNs.size(); i++) { + serializer.startTag(null, PROTO_SERIALIZER_ATTRIBUTE_TIMESTAMP); + serializer.attributeInt(null, PROTO_SERIALIZER_ATTRIBUTE_KEY, + mStartupTimestampsNs.keyAt(i)); + serializer.attributeLong(null, PROTO_SERIALIZER_ATTRIBUTE_TS, + mStartupTimestampsNs.valueAt(i)); + serializer.endTag(null, PROTO_SERIALIZER_ATTRIBUTE_TIMESTAMP); + } + serializer.endTag(null, PROTO_SERIALIZER_ATTRIBUTE_TIMESTAMPS); + serializer.endDocument(); proto.write(ApplicationStartInfoProto.STARTUP_TIMESTAMPS, timestampsBytes.toByteArray()); + timestampsOut.close(); } proto.write(ApplicationStartInfoProto.START_TYPE, mStartType); if (mStartIntent != null) { - Parcel parcel = Parcel.obtain(); - mStartIntent.writeToParcel(parcel, 0); - proto.write(ApplicationStartInfoProto.START_INTENT, parcel.marshall()); - parcel.recycle(); + ByteArrayOutputStream intentBytes = new ByteArrayOutputStream(); + ObjectOutputStream intentOut = new ObjectOutputStream(intentBytes); + TypedXmlSerializer serializer = Xml.resolveSerializer(intentOut); + serializer.startDocument(null, true); + serializer.startTag(null, PROTO_SERIALIZER_ATTRIBUTE_INTENT); + mStartIntent.saveToXml(serializer); + serializer.endTag(null, PROTO_SERIALIZER_ATTRIBUTE_INTENT); + serializer.endDocument(); + proto.write(ApplicationStartInfoProto.START_INTENT, + intentBytes.toByteArray()); + intentOut.close(); } proto.write(ApplicationStartInfoProto.LAUNCH_MODE, mLaunchMode); + proto.write(ApplicationStartInfoProto.WAS_FORCE_STOPPED, mWasForceStopped); proto.end(token); } @@ -693,25 +794,48 @@ public final class ApplicationStartInfo implements Parcelable { ByteArrayInputStream timestampsBytes = new ByteArrayInputStream(proto.readBytes( ApplicationStartInfoProto.STARTUP_TIMESTAMPS)); ObjectInputStream timestampsIn = new ObjectInputStream(timestampsBytes); - mStartupTimestampsNs = (ArrayMap) timestampsIn.readObject(); + mStartupTimestampsNs = new ArrayMap(); + try { + TypedXmlPullParser parser = Xml.resolvePullParser(timestampsIn); + XmlUtils.beginDocument(parser, PROTO_SERIALIZER_ATTRIBUTE_TIMESTAMPS); + int depth = parser.getDepth(); + while (XmlUtils.nextElementWithin(parser, depth)) { + if (PROTO_SERIALIZER_ATTRIBUTE_TIMESTAMP.equals(parser.getName())) { + int key = parser.getAttributeInt(null, + PROTO_SERIALIZER_ATTRIBUTE_KEY); + long ts = parser.getAttributeLong(null, + PROTO_SERIALIZER_ATTRIBUTE_TS); + mStartupTimestampsNs.put(key, ts); + } + } + } catch (XmlPullParserException e) { + // Timestamps lost + } + timestampsIn.close(); break; case (int) ApplicationStartInfoProto.START_TYPE: mStartType = proto.readInt(ApplicationStartInfoProto.START_TYPE); break; case (int) ApplicationStartInfoProto.START_INTENT: - byte[] startIntentBytes = proto.readBytes( - ApplicationStartInfoProto.START_INTENT); - if (startIntentBytes.length > 0) { - Parcel parcel = Parcel.obtain(); - parcel.unmarshall(startIntentBytes, 0, startIntentBytes.length); - parcel.setDataPosition(0); - mStartIntent = Intent.CREATOR.createFromParcel(parcel); - parcel.recycle(); + ByteArrayInputStream intentBytes = new ByteArrayInputStream(proto.readBytes( + ApplicationStartInfoProto.START_INTENT)); + ObjectInputStream intentIn = new ObjectInputStream(intentBytes); + try { + TypedXmlPullParser parser = Xml.resolvePullParser(intentIn); + XmlUtils.beginDocument(parser, PROTO_SERIALIZER_ATTRIBUTE_INTENT); + mStartIntent = Intent.restoreFromXml(parser); + } catch (XmlPullParserException e) { + // Intent lost } + intentIn.close(); break; case (int) ApplicationStartInfoProto.LAUNCH_MODE: mLaunchMode = proto.readInt(ApplicationStartInfoProto.LAUNCH_MODE); break; + case (int) ApplicationStartInfoProto.WAS_FORCE_STOPPED: + mWasForceStopped = proto.readBoolean( + ApplicationStartInfoProto.WAS_FORCE_STOPPED); + break; } } proto.end(token); @@ -730,23 +854,23 @@ public final class ApplicationStartInfo implements Parcelable { .append(" definingUid=").append(mDefiningUid) .append(" user=").append(UserHandle.getUserId(mPackageUid)) .append('\n') + .append(" package=").append(mPackageName) .append(" process=").append(mProcessName) .append(" startupState=").append(mStartupState) .append(" reason=").append(reasonToString(mReason)) .append(" startType=").append(startTypeToString(mStartType)) .append(" launchMode=").append(mLaunchMode) + .append(" wasForceStopped=").append(mWasForceStopped) .append('\n'); if (mStartIntent != null) { sb.append(" intent=").append(mStartIntent.toString()) .append('\n'); } - if (mStartupTimestampsNs.size() > 0) { + if (mStartupTimestampsNs != null && mStartupTimestampsNs.size() > 0) { sb.append(" timestamps: "); - Set> timestampEntrySet = mStartupTimestampsNs.entrySet(); - Iterator> iter = timestampEntrySet.iterator(); - while (iter.hasNext()) { - Map.Entry entry = iter.next(); - sb.append(entry.getKey()).append("=").append(entry.getValue()).append(" "); + for (int i = 0; i < mStartupTimestampsNs.size(); i++) { + sb.append(mStartupTimestampsNs.keyAt(i)).append("=").append(mStartupTimestampsNs + .valueAt(i)).append(" "); } sb.append('\n'); } @@ -780,4 +904,35 @@ public final class ApplicationStartInfo implements Parcelable { default -> ""; }; } + + /** @hide */ + @Override + public boolean equals(@Nullable Object other) { + if (other == null || !(other instanceof ApplicationStartInfo)) { + return false; + } + final ApplicationStartInfo o = (ApplicationStartInfo) other; + return mPid == o.mPid && mRealUid == o.mRealUid && mPackageUid == o.mPackageUid + && mDefiningUid == o.mDefiningUid && mReason == o.mReason + && mStartupState == o.mStartupState && mStartType == o.mStartType + && mLaunchMode == o.mLaunchMode && TextUtils.equals(mProcessName, o.mProcessName) + && timestampsEquals(o) && mWasForceStopped == o.mWasForceStopped; + } + + @Override + public int hashCode() { + return Objects.hash(mPid, mRealUid, mPackageUid, mDefiningUid, mReason, mStartupState, + mStartType, mLaunchMode, mProcessName, + mStartupTimestampsNs); + } + + private boolean timestampsEquals(@NonNull ApplicationStartInfo other) { + if (mStartupTimestampsNs == null && other.mStartupTimestampsNs == null) { + return true; + } + if (mStartupTimestampsNs == null || other.mStartupTimestampsNs == null) { + return false; + } + return mStartupTimestampsNs.equals(other.mStartupTimestampsNs); + } } diff --git a/core/java/android/app/AutomaticZenRule.java b/core/java/android/app/AutomaticZenRule.java index 53a21cdd78c91c6067870d36fd69887bdd10ddf8..f6ec370478a9fd589d5507915d66d7c56f27ed5a 100644 --- a/core/java/android/app/AutomaticZenRule.java +++ b/core/java/android/app/AutomaticZenRule.java @@ -35,6 +35,7 @@ import android.view.WindowInsetsController; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; +import java.util.ArrayList; import java.util.Objects; /** @@ -70,6 +71,8 @@ public final class AutomaticZenRule implements Parcelable { public static final int TYPE_SCHEDULE_CALENDAR = 2; /** * The type for rules triggered by bedtime/sleeping, like time of day, or snore detection. + * + *

Only the 'Wellbeing' app may own rules of this type. */ @FlaggedApi(Flags.FLAG_MODES_API) public static final int TYPE_BEDTIME = 3; @@ -95,6 +98,8 @@ public final class AutomaticZenRule implements Parcelable { /** * The type for rules created and managed by a device owner. These rules may not be fully * editable by the device user. + * + *

Only a 'Device Owner' app may own rules of this type. */ @FlaggedApi(Flags.FLAG_MODES_API) public static final int TYPE_MANAGED = 7; @@ -107,6 +112,28 @@ public final class AutomaticZenRule implements Parcelable { @Retention(RetentionPolicy.SOURCE) public @interface Type {} + /** + * Enum for the user-modifiable fields in this object. + * @hide + */ + @IntDef(flag = true, prefix = { "FIELD_" }, value = { + FIELD_NAME, + FIELD_INTERRUPTION_FILTER, + }) + @Retention(RetentionPolicy.SOURCE) + public @interface ModifiableField {} + + /** + * @hide + */ + @FlaggedApi(Flags.FLAG_MODES_API) + public static final int FIELD_NAME = 1 << 0; + /** + * @hide + */ + @FlaggedApi(Flags.FLAG_MODES_API) + public static final int FIELD_INTERRUPTION_FILTER = 1 << 1; + private boolean enabled; private String name; private @InterruptionFilter int interruptionFilter; @@ -116,9 +143,10 @@ public final class AutomaticZenRule implements Parcelable { private long creationTime; private ZenPolicy mZenPolicy; private ZenDeviceEffects mDeviceEffects; + // TODO: b/310620812 - Remove this once FLAG_MODES_API is inlined. private boolean mModified = false; private String mPkg; - private int mType = TYPE_UNKNOWN; + private int mType = Flags.modesApi() ? TYPE_UNKNOWN : 0; private int mIconResId; private String mTriggerDescription; private boolean mAllowManualInvocation; @@ -274,6 +302,7 @@ public final class AutomaticZenRule implements Parcelable { * Returns whether this rule's name has been modified by the user. * @hide */ + // TODO: b/310620812 - Consider removing completely. Seems not be used anywhere except tests. public boolean isModified() { return mModified; } @@ -348,6 +377,9 @@ public final class AutomaticZenRule implements Parcelable { * Sets the {@link ZenDeviceEffects} associated to this rule. Device effects specify changes to * the device behavior that should apply while the rule is active, but are not directly related * to suppressing notifications (for example: disabling always-on display). + * + *

When updating an existing rule via {@link NotificationManager#updateAutomaticZenRule}, + * a {@code null} value here means the previous set of effects is retained. */ @FlaggedApi(Flags.FLAG_MODES_API) public void setDeviceEffects(@Nullable ZenDeviceEffects deviceEffects) { @@ -458,6 +490,9 @@ public final class AutomaticZenRule implements Parcelable { public void validate() { if (Flags.modesApi()) { checkValidType(mType); + if (mDeviceEffects != null) { + mDeviceEffects.validate(); + } } } @@ -526,6 +561,18 @@ public final class AutomaticZenRule implements Parcelable { return sb.append(']').toString(); } + /** @hide */ + public static String fieldsToString(@ModifiableField int bitmask) { + ArrayList modified = new ArrayList<>(); + if ((bitmask & FIELD_NAME) != 0) { + modified.add("FIELD_NAME"); + } + if ((bitmask & FIELD_INTERRUPTION_FILTER) != 0) { + modified.add("FIELD_INTERRUPTION_FILTER"); + } + return "{" + String.join(",", modified) + "}"; + } + @Override public boolean equals(@Nullable Object o) { if (!(o instanceof AutomaticZenRule)) return false; @@ -645,8 +692,8 @@ public final class AutomaticZenRule implements Parcelable { } public Builder(@NonNull String name, @NonNull Uri conditionId) { - mName = name; - mConditionId = conditionId; + mName = Objects.requireNonNull(name); + mConditionId = Objects.requireNonNull(conditionId); } /** @@ -658,7 +705,15 @@ public final class AutomaticZenRule implements Parcelable { } /** - * Sets the component (service or activity) that owns this rule. + * Sets the component name of the + * {@link android.service.notification.ConditionProviderService} that manages this rule + * (but note that {@link android.service.notification.ConditionProviderService} is + * deprecated in favor of using {@link NotificationManager#setAutomaticZenRuleState} to + * notify the system about the state of your rule). + * + *

This is exclusive with {@link #setConfigurationActivity}; rules where a configuration + * activity is set will not use the component set here to determine whether the rule + * should be active. */ public @NonNull Builder setOwner(@Nullable ComponentName owner) { mOwner = owner; @@ -696,6 +751,11 @@ public final class AutomaticZenRule implements Parcelable { * information about this rule and/or allows them to configure it. This is required to be * non-null for rules that are not backed by a * {@link android.service.notification.ConditionProviderService}. + * + *

This is exclusive with {@link #setOwner}; rules where a configuration + * activity is set will not use the + * {@link android.service.notification.ConditionProviderService} supplied there to determine + * whether the rule should be active. */ public @NonNull Builder setConfigurationActivity( @Nullable ComponentName configurationActivity) { @@ -705,6 +765,9 @@ public final class AutomaticZenRule implements Parcelable { /** * Sets the zen policy. + * + *

When updating an existing rule via {@link NotificationManager#updateAutomaticZenRule}, + * a {@code null} value here means the previous policy is retained. */ public @NonNull Builder setZenPolicy(@Nullable ZenPolicy policy) { mPolicy = policy; @@ -715,6 +778,9 @@ public final class AutomaticZenRule implements Parcelable { * Sets the {@link ZenDeviceEffects} associated to this rule. Device effects specify changes * to the device behavior that should apply while the rule is active, but are not directly * related to suppressing notifications (for example: disabling always-on display). + * + *

When updating an existing rule via {@link NotificationManager#updateAutomaticZenRule}, + * a {@code null} value here means the previous set of effects is retained. */ @NonNull public Builder setDeviceEffects(@Nullable ZenDeviceEffects deviceEffects) { diff --git a/core/java/android/app/BackgroundInstallControlManager.java b/core/java/android/app/BackgroundInstallControlManager.java new file mode 100644 index 0000000000000000000000000000000000000000..664fcebcfc05921f017eb8641b559ff725abc16d --- /dev/null +++ b/core/java/android/app/BackgroundInstallControlManager.java @@ -0,0 +1,102 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.app; + +import static android.Manifest.permission.GET_BACKGROUND_INSTALLED_PACKAGES; +import static android.annotation.SystemApi.Client.PRIVILEGED_APPS; + +import android.annotation.FlaggedApi; +import android.annotation.NonNull; +import android.annotation.RequiresPermission; +import android.annotation.SystemApi; +import android.annotation.SystemService; +import android.content.Context; +import android.content.pm.IBackgroundInstallControlService; +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.os.RemoteException; +import android.os.ServiceManager; + +import java.util.List; + +/** + * BackgroundInstallControlManager client allows apps to query apps installed in background. + * + *

Any applications that was installed without an accompanying installer UI activity paired + * with recorded user interaction event is considered background installed. This is determined by + * analysis of user-activity logs. + * + *

Warning: BackgroundInstallControl should not be considered a definitive + * authority of identifying background installed applications. Consumers can use this as a + * supplementary signal, but must perform additional due diligence to confirm the install nature + * of the package. + * + * @hide + */ +@FlaggedApi(Flags.FLAG_BIC_CLIENT) +@SystemApi(client = PRIVILEGED_APPS) +@SystemService(Context.BACKGROUND_INSTALL_CONTROL_SERVICE) +public final class BackgroundInstallControlManager { + + private static final String TAG = "BackgroundInstallControlManager"; + private static IBackgroundInstallControlService sService; + private final Context mContext; + + BackgroundInstallControlManager(Context context) { + mContext = context; + } + + private static IBackgroundInstallControlService getService() { + if (sService == null) { + sService = + IBackgroundInstallControlService.Stub.asInterface( + ServiceManager.getService(Context.BACKGROUND_INSTALL_CONTROL_SERVICE)); + } + return sService; + } + + /** + * Returns a full list of {@link PackageInfo} of apps currently installed for the current user + * that are considered installed in the background. + * + *

Refer to top level doc {@link BackgroundInstallControlManager} for more details on + * background-installed applications. + *

+ * + * @param flags - Flags will be used to call + * {@link PackageManager#getInstalledPackages(PackageInfoFlags)} to retrieve installed packages. + * @return A list of packages retrieved from {@link PackageManager} with non-background + * installed app filter applied. + * + * @hide + */ + @FlaggedApi(Flags.FLAG_BIC_CLIENT) + @SystemApi + @RequiresPermission(GET_BACKGROUND_INSTALLED_PACKAGES) + public @NonNull List getBackgroundInstalledPackages( + @PackageManager.PackageInfoFlagsBits long flags) { + List backgroundInstalledPackages; + try { + return getService() + .getBackgroundInstalledPackages(flags, mContext.getUserId()) + .getList(); + } catch (RemoteException e) { + throw e.rethrowFromSystemServer(); + } + } + +} diff --git a/core/java/android/app/BroadcastOptions.java b/core/java/android/app/BroadcastOptions.java index 41b400459526c043badc93085c7997022f71059d..60d622dd78c67cd8376196c81d89710c100cc9a3 100644 --- a/core/java/android/app/BroadcastOptions.java +++ b/core/java/android/app/BroadcastOptions.java @@ -16,6 +16,10 @@ package android.app; +import static android.app.ActivityOptions.BackgroundActivityStartMode; + +import android.annotation.CurrentTimeMillisLong; +import android.annotation.FlaggedApi; import android.annotation.IntDef; import android.annotation.IntRange; import android.annotation.NonNull; @@ -46,6 +50,7 @@ import java.util.Objects; * {@link android.content.Context#sendBroadcast(android.content.Intent) * Context.sendBroadcast(Intent)} and related methods. */ +@android.ravenwood.annotation.RavenwoodKeepWholeClass public class BroadcastOptions extends ComponentOptions { private @Flags int mFlags; private long mTemporaryAppAllowlistDuration; @@ -64,6 +69,8 @@ public class BroadcastOptions extends ComponentOptions { private @Nullable BundleMerger mDeliveryGroupExtrasMerger; private @Nullable IntentFilter mDeliveryGroupMatchingFilter; private @DeferralPolicy int mDeferralPolicy; + private @CurrentTimeMillisLong long mEventTriggerTimestampMillis; + private @CurrentTimeMillisLong long mRemoteEventTriggerTimestampMillis; /** @hide */ @IntDef(flag = true, prefix = { "FLAG_" }, value = { @@ -188,6 +195,18 @@ public class BroadcastOptions extends ComponentOptions { private static final String KEY_ID_FOR_RESPONSE_EVENT = "android:broadcast.idForResponseEvent"; + /** + * Corresponds to {@link #setEventTriggerTimestampMillis(long)}. + */ + private static final String KEY_EVENT_TRIGGER_TIMESTAMP = + "android:broadcast.eventTriggerTimestamp"; + + /** + * Corresponds to {@link #setRemoteEventTriggerTimestampMillis(long)}. + */ + private static final String KEY_REMOTE_EVENT_TRIGGER_TIMESTAMP = + "android:broadcast.remoteEventTriggerTimestamp"; + /** * Corresponds to {@link #setDeliveryGroupPolicy(int)}. */ @@ -340,6 +359,8 @@ public class BroadcastOptions extends ComponentOptions { mRequireNoneOfPermissions = opts.getStringArray(KEY_REQUIRE_NONE_OF_PERMISSIONS); mRequireCompatChangeId = opts.getLong(KEY_REQUIRE_COMPAT_CHANGE_ID, CHANGE_INVALID); mIdForResponseEvent = opts.getLong(KEY_ID_FOR_RESPONSE_EVENT); + mEventTriggerTimestampMillis = opts.getLong(KEY_EVENT_TRIGGER_TIMESTAMP); + mRemoteEventTriggerTimestampMillis = opts.getLong(KEY_REMOTE_EVENT_TRIGGER_TIMESTAMP); mDeliveryGroupPolicy = opts.getInt(KEY_DELIVERY_GROUP_POLICY, DELIVERY_GROUP_POLICY_ALL); mDeliveryGroupMatchingNamespaceFragment = opts.getString(KEY_DELIVERY_GROUP_NAMESPACE); @@ -751,6 +772,7 @@ public class BroadcastOptions extends ComponentOptions { * @hide */ @TestApi + @android.ravenwood.annotation.RavenwoodThrow public boolean testRequireCompatChange(int uid) { if (mRequireCompatChangeId != CHANGE_INVALID) { final boolean requireEnabled = (mFlags & FLAG_REQUIRE_COMPAT_CHANGE_ENABLED) != 0; @@ -784,6 +806,60 @@ public class BroadcastOptions extends ComponentOptions { return mIdForResponseEvent; } + /** + * Set the timestamp for the event that triggered this broadcast, in + * {@link System#currentTimeMillis()} timebase. + * + *

For instance, if this broadcast is for a push message, then this timestamp + * could correspond to when the device received the message. + * + * @param timestampMillis the timestamp in {@link System#currentTimeMillis()} timebase that + * correspond to the event that triggered this broadcast. + */ + @FlaggedApi(android.app.Flags.FLAG_BCAST_EVENT_TIMESTAMPS) + public void setEventTriggerTimestampMillis(@CurrentTimeMillisLong long timestampMillis) { + mEventTriggerTimestampMillis = timestampMillis; + } + + /** + * Return the timestamp for the event that triggered this broadcast, in + * {@link System#currentTimeMillis()} timebase. + * + * @return the timestamp in {@link System#currentTimeMillis()} timebase that was previously + * set using {@link #setEventTriggerTimestampMillis(long)}. + */ + @FlaggedApi(android.app.Flags.FLAG_BCAST_EVENT_TIMESTAMPS) + public @CurrentTimeMillisLong long getEventTriggerTimestampMillis() { + return mEventTriggerTimestampMillis; + } + + /** + * Set the timestamp for the remote event, if any, that triggered this broadcast, in + * {@link System#currentTimeMillis()} timebase. + * + *

For instance, if this broadcast is for a push message, then this timestamp + * could correspond to when the message originated remotely. + * + * @param timestampMillis the timestamp in {@link System#currentTimeMillis()} timebase that + * correspond to the remote event that triggered this broadcast. + */ + @FlaggedApi(android.app.Flags.FLAG_BCAST_EVENT_TIMESTAMPS) + public void setRemoteEventTriggerTimestampMillis(@CurrentTimeMillisLong long timestampMillis) { + mRemoteEventTriggerTimestampMillis = timestampMillis; + } + + /** + * Return the timestamp for the remote event that triggered this broadcast, in + * {@link System#currentTimeMillis()} timebase. + * + * @return the timestamp in {@link System#currentTimeMillis()} timebase that was previously + * set using {@link #setRemoteEventTriggerTimestampMillis(long)}}. + */ + @FlaggedApi(android.app.Flags.FLAG_BCAST_EVENT_TIMESTAMPS) + public @CurrentTimeMillisLong long getRemoteEventTriggerTimestampMillis() { + return mRemoteEventTriggerTimestampMillis; + } + /** * Sets deferral policy for this broadcast that specifies how this broadcast * can be deferred for delivery at some future point. @@ -1058,7 +1134,8 @@ public class BroadcastOptions extends ComponentOptions { @SystemApi @NonNull @Override // to narrow down the return type - public BroadcastOptions setPendingIntentBackgroundActivityStartMode(int state) { + public BroadcastOptions setPendingIntentBackgroundActivityStartMode( + @BackgroundActivityStartMode int state) { super.setPendingIntentBackgroundActivityStartMode(state); return this; } @@ -1118,6 +1195,12 @@ public class BroadcastOptions extends ComponentOptions { if (mIdForResponseEvent != 0) { b.putLong(KEY_ID_FOR_RESPONSE_EVENT, mIdForResponseEvent); } + if (mEventTriggerTimestampMillis > 0) { + b.putLong(KEY_EVENT_TRIGGER_TIMESTAMP, mEventTriggerTimestampMillis); + } + if (mRemoteEventTriggerTimestampMillis > 0) { + b.putLong(KEY_REMOTE_EVENT_TRIGGER_TIMESTAMP, mRemoteEventTriggerTimestampMillis); + } if (mDeliveryGroupPolicy != DELIVERY_GROUP_POLICY_ALL) { b.putInt(KEY_DELIVERY_GROUP_POLICY, mDeliveryGroupPolicy); } diff --git a/core/java/android/app/ClientTransactionHandler.java b/core/java/android/app/ClientTransactionHandler.java index 25075e91088fe1abd8ac28fa74b86ac639b36d41..b5b3669c1d807034195dad86713b29d7addec96b 100644 --- a/core/java/android/app/ClientTransactionHandler.java +++ b/core/java/android/app/ClientTransactionHandler.java @@ -17,6 +17,7 @@ package android.app; import android.annotation.NonNull; import android.annotation.Nullable; +import android.app.ActivityOptions.SceneTransitionInfo; import android.app.ActivityThread.ActivityClientRecord; import android.app.servertransaction.ClientTransaction; import android.app.servertransaction.DestroyActivityItem; @@ -29,6 +30,7 @@ import android.content.res.Configuration; import android.os.IBinder; import android.util.MergedConfiguration; import android.view.SurfaceControl; +import android.window.ActivityWindowInfo; import android.window.SplashScreenView.SplashScreenViewParcelable; import android.window.WindowContext; import android.window.WindowContextInfo; @@ -165,11 +167,12 @@ public abstract class ClientTransactionHandler { /** Set pending activity configuration in case it will be updated by other transaction item. */ public abstract void updatePendingActivityConfiguration(@NonNull IBinder token, - Configuration overrideConfig); + @NonNull Configuration overrideConfig); /** Deliver activity (override) configuration change. */ public abstract void handleActivityConfigurationChanged(@NonNull ActivityClientRecord r, - Configuration overrideConfig, int displayId); + @NonNull Configuration overrideConfig, int displayId, + @NonNull ActivityWindowInfo activityWindowInfo); /** Deliver {@link android.window.WindowContextInfo} change. */ public abstract void handleWindowContextInfoChanged(@NonNull IBinder clientToken, @@ -207,7 +210,7 @@ public abstract class ClientTransactionHandler { /** Perform activity start. */ public abstract void handleStartActivity(@NonNull ActivityClientRecord r, - PendingTransactionActions pendingActions, ActivityOptions activityOptions); + PendingTransactionActions pendingActions, SceneTransitionInfo sceneTransitionInfo); /** Get package info. */ public abstract LoadedApk getPackageInfoNoCheck(ApplicationInfo ai); @@ -231,12 +234,15 @@ public abstract class ClientTransactionHandler { * @param config New configuration applied to the activity. * @param preserveWindow Whether the activity should try to reuse the window it created, * including the decor view after the relaunch. + * @param activityWindowInfo Window information about the relaunched Activity. * @return An initialized instance of {@link ActivityThread.ActivityClientRecord} to use during * relaunch, or {@code null} if relaunch cancelled. */ - public abstract ActivityClientRecord prepareRelaunchActivity(IBinder token, - List pendingResults, List pendingNewIntents, - int configChanges, MergedConfiguration config, boolean preserveWindow); + public abstract ActivityClientRecord prepareRelaunchActivity(@NonNull IBinder token, + @Nullable List pendingResults, + @Nullable List pendingNewIntents, int configChanges, + @NonNull MergedConfiguration config, boolean preserveWindow, + @NonNull ActivityWindowInfo activityWindowInfo); /** * Perform activity relaunch. @@ -244,7 +250,7 @@ public abstract class ClientTransactionHandler { * @param pendingActions Pending actions to be used on later stages of activity transaction. * */ public abstract void handleRelaunchActivity(@NonNull ActivityClientRecord r, - PendingTransactionActions pendingActions); + @NonNull PendingTransactionActions pendingActions); /** * Report that relaunch request was handled. diff --git a/core/java/android/app/ComponentCaller.java b/core/java/android/app/ComponentCaller.java new file mode 100644 index 0000000000000000000000000000000000000000..7e6a9ac9ff8e45f093065170e12c0fefcc8c08cf --- /dev/null +++ b/core/java/android/app/ComponentCaller.java @@ -0,0 +1,178 @@ +/* + * Copyright (C) 2024 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.app; + +import android.annotation.FlaggedApi; +import android.annotation.NonNull; +import android.annotation.Nullable; +import android.content.Intent; +import android.content.pm.PackageManager; +import android.net.Uri; +import android.os.IBinder; +import android.os.Process; + +import java.util.Objects; + +/** + * Represents the app that launched the component. See below for the APIs available on the component + * caller. + * + *

Note, that in {@link android.os.Build.VERSION_CODES#VANILLA_ICE_CREAM} only + * {@link Activity} has access to {@link ComponentCaller} instances. + * + * @see Activity#getInitialCaller() + */ +@FlaggedApi(android.security.Flags.FLAG_CONTENT_URI_PERMISSION_APIS) +public final class ComponentCaller { + private final IBinder mActivityToken; + private final IBinder mCallerToken; + + /** + * @hide + */ + public ComponentCaller(@Nullable IBinder activityToken, @Nullable IBinder callerToken) { + mActivityToken = activityToken; + mCallerToken = callerToken; + } + + /** + * Returns the uid of this component caller. + * + *

Note, in {@link android.os.Build.VERSION_CODES#VANILLA_ICE_CREAM} only + * {@link Activity} has access to {@link ComponentCaller} instances. + *

+ *

Requirements for {@link Activity} callers

+ * + *

In order to receive the calling app's uid, at least one of the following has to be met: + *

    + *
  • The calling app must call {@link ActivityOptions#setShareIdentityEnabled(boolean)} + * with a value of {@code true} and launch this activity with the resulting + * {@code ActivityOptions}. + *
  • The launched activity has the same uid as the calling app. + *
  • The launched activity is running in a package that is signed with the same key used + * to sign the platform (typically only system packages such as Settings will meet this + * requirement). + *
+ * These are the same requirements for {@link #getPackage()}; if any of these are met, then + * these methods can be used to obtain the uid and package name of the calling app. If none are + * met, then {@link Process#INVALID_UID} is returned. + * + *

Note, even if the above conditions are not met, the calling app's identity may still be + * available from {@link Activity#getCallingPackage()} if this activity was started with + * {@code Activity#startActivityForResult} to allow validation of the result's recipient. + * + * @return the uid of the calling app or {@link Process#INVALID_UID} if the current component + * cannot access the identity of the calling app or the caller is invalid + * + * @see ActivityOptions#setShareIdentityEnabled(boolean) + * @see Activity#getLaunchedFromUid() + */ + public int getUid() { + return ActivityClient.getInstance().getActivityCallerUid(mActivityToken, mCallerToken); + } + + /** + * Returns the package name of this component caller. + * + *

Note, in {@link android.os.Build.VERSION_CODES#VANILLA_ICE_CREAM} only + * {@link Activity} has access to {@link ComponentCaller} instances. + *

+ *

Requirements for {@link Activity} callers

+ * + *

In order to receive the calling app's package name, at least one of the following has to + * be met: + *

    + *
  • The calling app must call {@link ActivityOptions#setShareIdentityEnabled(boolean)} + * with a value of {@code true} and launch this activity with the resulting + * {@code ActivityOptions}. + *
  • The launched activity has the same uid as the calling app. + *
  • The launched activity is running in a package that is signed with the same key used + * to sign the platform (typically only system packages such as Settings will meet this + * meet this requirement). + *
+ * These are the same requirements for {@link #getUid()}; if any of these are met, then these + * methods can be used to obtain the uid and package name of the calling app. If none are met, + * then {@code null} is returned. + * + *

Note, even if the above conditions are not met, the calling app's identity may still be + * available from {@link Activity#getCallingPackage()} if this activity was started with + * {@code Activity#startActivityForResult} to allow validation of the result's recipient. + * + * @return the package name of the calling app or null if the current component cannot access + * the identity of the calling app or the caller is invalid + * + * @see ActivityOptions#setShareIdentityEnabled(boolean) + * @see Activity#getLaunchedFromPackage() + */ + @Nullable + public String getPackage() { + return ActivityClient.getInstance().getActivityCallerPackage(mActivityToken, mCallerToken); + } + + /** + * Determines whether this component caller had access to a specific content URI at launch time. + * Apps can use this API to validate content URIs coming from other apps. + * + *

Note, in {@link android.os.Build.VERSION_CODES#VANILLA_ICE_CREAM} only + * {@link Activity} has access to {@link ComponentCaller} instances. + * + *

Before using this method, note the following: + *

    + *
  • You must have access to the supplied URI, otherwise it will throw a + * {@link SecurityException}. + *
  • This is not a real time check, i.e. the permissions have been computed at launch + * time. + *
  • This method will return the correct result for content URIs passed at launch time, + * specifically the ones from {@link Intent#getData()}, {@link Intent#EXTRA_STREAM}, and + * {@link Intent#getClipData()} in the intent of {@code startActivity(intent)}. For others, + * it will throw an {@link IllegalArgumentException}. + *
+ * + * @param uri The content uri that is being checked + * @param modeFlags The access modes to check + * @return {@link PackageManager#PERMISSION_GRANTED} if this activity caller is allowed to + * access that uri, or {@link PackageManager#PERMISSION_DENIED} if it is not + * @throws IllegalArgumentException if uri is a non-content URI or it wasn't passed at launch in + * {@link Intent#getData()}, {@link Intent#EXTRA_STREAM}, and + * {@link Intent#getClipData()} + * @throws SecurityException if you don't have access to uri + * + * @see android.content.Context#checkContentUriPermissionFull(Uri, int, int, int) + */ + @PackageManager.PermissionResult + public int checkContentUriPermission(@NonNull Uri uri, @Intent.AccessUriMode int modeFlags) { + return ActivityClient.getInstance().checkActivityCallerContentUriPermission(mActivityToken, + mCallerToken, uri, modeFlags); + } + + @Override + public boolean equals(@Nullable Object obj) { + if (obj == null || !(obj instanceof ComponentCaller other)) { + return false; + } + return this.mActivityToken == other.mActivityToken + && this.mCallerToken == other.mCallerToken; + } + + @Override + public int hashCode() { + int result = 17; + result = 31 * result + Objects.hashCode(mActivityToken); + result = 31 * result + Objects.hashCode(mCallerToken); + return result; + } +} diff --git a/core/java/android/app/ComponentOptions.java b/core/java/android/app/ComponentOptions.java index e0e2855252081189d3dab9ce293c98b3d4b204d7..397477d72a9a5b6b59bff22f8699ce8a7d172d7b 100644 --- a/core/java/android/app/ComponentOptions.java +++ b/core/java/android/app/ComponentOptions.java @@ -16,16 +16,17 @@ package android.app; -import android.annotation.IntDef; +import static android.app.ActivityOptions.BackgroundActivityStartMode; +import static android.app.ActivityOptions.MODE_BACKGROUND_ACTIVITY_START_ALLOWED; +import static android.app.ActivityOptions.MODE_BACKGROUND_ACTIVITY_START_DENIED; +import static android.app.ActivityOptions.MODE_BACKGROUND_ACTIVITY_START_SYSTEM_DEFINED; + import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.SuppressLint; import android.annotation.TestApi; import android.os.Bundle; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; - /** * Base class for {@link ActivityOptions} and {@link BroadcastOptions}. * @hide @@ -34,6 +35,7 @@ import java.lang.annotation.RetentionPolicy; @TestApi // Suppressed since lint is recommending class have a suffix of Params. @SuppressLint("UserHandleName") +@android.ravenwood.annotation.RavenwoodKeepWholeClass public class ComponentOptions { /** @@ -55,32 +57,6 @@ public class ComponentOptions { private @Nullable Boolean mPendingIntentBalAllowed = null; private boolean mPendingIntentBalAllowedByPermission = false; - /** @hide */ - @Retention(RetentionPolicy.SOURCE) - @IntDef(prefix = {"MODE_BACKGROUND_ACTIVITY_START_"}, value = { - MODE_BACKGROUND_ACTIVITY_START_SYSTEM_DEFINED, - MODE_BACKGROUND_ACTIVITY_START_ALLOWED, - MODE_BACKGROUND_ACTIVITY_START_DENIED}) - public @interface BackgroundActivityStartMode {} - /** - * No explicit value chosen. The system will decide whether to grant privileges. - * @hide - */ - @TestApi - public static final int MODE_BACKGROUND_ACTIVITY_START_SYSTEM_DEFINED = 0; - /** - * Allow the {@link PendingIntent} to use the background activity start privileges. - * @hide - */ - @TestApi - public static final int MODE_BACKGROUND_ACTIVITY_START_ALLOWED = 1; - /** - * Deny the {@link PendingIntent} to use the background activity start privileges. - * @hide - */ - @TestApi - public static final int MODE_BACKGROUND_ACTIVITY_START_DENIED = 2; - ComponentOptions() { } diff --git a/core/java/android/app/ContextImpl.java b/core/java/android/app/ContextImpl.java index 014ddd41f8d452d28a3058710b012679462b80db..af56cb4d55b23772c1e95177a15d890223644939 100644 --- a/core/java/android/app/ContextImpl.java +++ b/core/java/android/app/ContextImpl.java @@ -240,7 +240,7 @@ class ContextImpl extends Context { @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023) private final String mOpPackageName; private final @NonNull ContextParams mParams; - private final @NonNull AttributionSource mAttributionSource; + private @NonNull AttributionSource mAttributionSource; private final @NonNull ResourcesManager mResourcesManager; @UnsupportedAppUsage @@ -2409,6 +2409,17 @@ class ContextImpl extends Context { } } + @Override + public int checkContentUriPermissionFull(Uri uri, int pid, int uid, int modeFlags) { + try { + return ActivityManager.getService().checkContentUriPermissionFull( + ContentProvider.getUriWithoutUserId(uri), pid, uid, modeFlags, + resolveUserId(uri)); + } catch (RemoteException e) { + throw e.rethrowFromSystemServer(); + } + } + @NonNull @Override public int[] checkUriPermissions(@NonNull List uris, int pid, int uid, @@ -2615,14 +2626,19 @@ class ContextImpl extends Context { @Override public Context createApplicationContext(ApplicationInfo application, int flags) throws NameNotFoundException { + final UserHandle user = new UserHandle(UserHandle.getUserId(application.uid)); + return createApplicationContextAsUser(application, flags, user); + } + + private Context createApplicationContextAsUser(ApplicationInfo application, int flags, + UserHandle user) throws NameNotFoundException { LoadedApk pi = mMainThread.getPackageInfo(application, mResources.getCompatibilityInfo(), flags | CONTEXT_REGISTER_PACKAGE); if (pi != null) { ContextImpl c = new ContextImpl(this, mMainThread, pi, ContextParams.EMPTY, - mAttributionSource.getAttributionTag(), - mAttributionSource.getNext(), - null, mToken, new UserHandle(UserHandle.getUserId(application.uid)), - flags, null, null); + mAttributionSource.getAttributionTag(), mAttributionSource.getNext(), null, + mToken, user, flags, null, + null, mDeviceId, mIsExplicitDeviceId); final int displayId = getDisplayId(); final Integer overrideDisplayId = mForceDisplayOverrideInResources @@ -2646,7 +2662,9 @@ class ContextImpl extends Context { throw new SecurityException("API can only be called from SdkSandbox process"); } - ContextImpl ctx = (ContextImpl) createApplicationContext(sdkInfo, flags); + final UserHandle user = sdkInfo.uid >= 0 + ? new UserHandle(UserHandle.getUserId(sdkInfo.uid)) : Process.myUserHandle(); + ContextImpl ctx = (ContextImpl) createApplicationContextAsUser(sdkInfo, flags, user); // Set sandbox app's context as the application context for sdk context ctx.mPackageInfo.makeApplicationInner(/*forceDefaultAppClass=*/false, @@ -2668,18 +2686,16 @@ class ContextImpl extends Context { // The system resources are loaded in every application, so we can safely copy // the context without reloading Resources. return new ContextImpl(this, mMainThread, mPackageInfo, mParams, - mAttributionSource.getAttributionTag(), - mAttributionSource.getNext(), - null, mToken, user, flags, null, null); + mAttributionSource.getAttributionTag(), mAttributionSource.getNext(), null, + mToken, user, flags, null, null, mDeviceId, mIsExplicitDeviceId); } LoadedApk pi = mMainThread.getPackageInfo(packageName, mResources.getCompatibilityInfo(), flags | CONTEXT_REGISTER_PACKAGE, user.getIdentifier()); if (pi != null) { ContextImpl c = new ContextImpl(this, mMainThread, pi, mParams, - mAttributionSource.getAttributionTag(), - mAttributionSource.getNext(), - null, mToken, user, flags, null, null); + mAttributionSource.getAttributionTag(), mAttributionSource.getNext(), null, + mToken, user, flags, null, null, mDeviceId, mIsExplicitDeviceId); final int displayId = getDisplayId(); final Integer overrideDisplayId = mForceDisplayOverrideInResources @@ -2718,9 +2734,8 @@ class ContextImpl extends Context { final String[] paths = mPackageInfo.getSplitPaths(splitName); final ContextImpl context = new ContextImpl(this, mMainThread, mPackageInfo, mParams, - mAttributionSource.getAttributionTag(), - mAttributionSource.getNext(), - splitName, mToken, mUser, mFlags, classLoader, null); + mAttributionSource.getAttributionTag(), mAttributionSource.getNext(), splitName, + mToken, mUser, mFlags, classLoader, null, mDeviceId, mIsExplicitDeviceId); context.setResources(ResourcesManager.getInstance().getResources( mToken, @@ -2754,9 +2769,9 @@ class ContextImpl extends Context { } ContextImpl context = new ContextImpl(this, mMainThread, mPackageInfo, mParams, - mAttributionSource.getAttributionTag(), - mAttributionSource.getNext(), - mSplitName, mToken, mUser, mFlags, mClassLoader, null); + mAttributionSource.getAttributionTag(), mAttributionSource.getNext(), mSplitName, + mToken, mUser, mFlags, mClassLoader, null, mDeviceId, + mIsExplicitDeviceId); context.mIsConfigurationBasedContext = true; final int displayId = getDisplayId(); @@ -2775,9 +2790,8 @@ class ContextImpl extends Context { } ContextImpl context = new ContextImpl(this, mMainThread, mPackageInfo, mParams, - mAttributionSource.getAttributionTag(), - mAttributionSource.getNext(), - mSplitName, mToken, mUser, mFlags, mClassLoader, null); + mAttributionSource.getAttributionTag(), mAttributionSource.getNext(), mSplitName, + mToken, mUser, mFlags, mClassLoader, null, mDeviceId, mIsExplicitDeviceId); final int displayId = display.getDisplayId(); @@ -2822,14 +2836,9 @@ class ContextImpl extends Context { } } - ContextImpl context = new ContextImpl(this, mMainThread, mPackageInfo, mParams, - mAttributionSource.getAttributionTag(), - mAttributionSource.getNext(), - mSplitName, mToken, mUser, mFlags, mClassLoader, null); - - context.mDeviceId = deviceId; - context.mIsExplicitDeviceId = true; - return context; + return new ContextImpl(this, mMainThread, mPackageInfo, mParams, + mAttributionSource.getAttributionTag(), mAttributionSource.getNext(), mSplitName, + mToken, mUser, mFlags, mClassLoader, null, deviceId, true); } @NonNull @@ -2915,9 +2924,8 @@ class ContextImpl extends Context { @UiContext ContextImpl createWindowContextBase(@NonNull IBinder token, int displayId) { ContextImpl baseContext = new ContextImpl(this, mMainThread, mPackageInfo, mParams, - mAttributionSource.getAttributionTag(), - mAttributionSource.getNext(), - mSplitName, token, mUser, mFlags, mClassLoader, null); + mAttributionSource.getAttributionTag(), mAttributionSource.getNext(), mSplitName, + token, mUser, mFlags, mClassLoader, null, mDeviceId, mIsExplicitDeviceId); // Window contexts receive configurations directly from the server and as such do not // need to override their display in ResourcesManager. baseContext.mForceDisplayOverrideInResources = false; @@ -2968,7 +2976,8 @@ class ContextImpl extends Context { public Context createContext(@NonNull ContextParams contextParams) { return new ContextImpl(this, mMainThread, mPackageInfo, contextParams, contextParams.getAttributionTag(), contextParams.getNextAttributionSource(), - mSplitName, mToken, mUser, mFlags, mClassLoader, null); + mSplitName, mToken, mUser, mFlags, mClassLoader, null, mDeviceId, + mIsExplicitDeviceId); } @Override @@ -2982,9 +2991,8 @@ class ContextImpl extends Context { final int flags = (mFlags & ~Context.CONTEXT_CREDENTIAL_PROTECTED_STORAGE) | Context.CONTEXT_DEVICE_PROTECTED_STORAGE; return new ContextImpl(this, mMainThread, mPackageInfo, mParams, - mAttributionSource.getAttributionTag(), - mAttributionSource.getNext(), - mSplitName, mToken, mUser, flags, mClassLoader, null); + mAttributionSource.getAttributionTag(), mAttributionSource.getNext(), mSplitName, + mToken, mUser, flags, mClassLoader, null, mDeviceId, mIsExplicitDeviceId); } @Override @@ -2992,9 +3000,8 @@ class ContextImpl extends Context { final int flags = (mFlags & ~Context.CONTEXT_DEVICE_PROTECTED_STORAGE) | Context.CONTEXT_CREDENTIAL_PROTECTED_STORAGE; return new ContextImpl(this, mMainThread, mPackageInfo, mParams, - mAttributionSource.getAttributionTag(), - mAttributionSource.getNext(), - mSplitName, mToken, mUser, flags, mClassLoader, null); + mAttributionSource.getAttributionTag(), mAttributionSource.getNext(), mSplitName, + mToken, mUser, flags, mClassLoader, null, mDeviceId, mIsExplicitDeviceId); } @Override @@ -3087,6 +3094,7 @@ class ContextImpl extends Context { int deviceId = vdm.getDeviceIdForDisplayId(displayId); if (deviceId != mDeviceId) { mDeviceId = deviceId; + mAttributionSource = mAttributionSource.withDeviceId(mDeviceId); notifyOnDeviceChangedListeners(mDeviceId); } } @@ -3287,7 +3295,8 @@ class ContextImpl extends Context { static ContextImpl createSystemContext(ActivityThread mainThread) { LoadedApk packageInfo = new LoadedApk(mainThread); ContextImpl context = new ContextImpl(null, mainThread, packageInfo, - ContextParams.EMPTY, null, null, null, null, null, 0, null, null); + ContextParams.EMPTY, null, null, null, null, null, 0, null, null, + DEVICE_ID_DEFAULT, false); context.setResources(packageInfo.getResources()); context.mResources.updateConfiguration(context.mResourcesManager.getConfiguration(), context.mResourcesManager.getDisplayMetrics()); @@ -3322,7 +3331,8 @@ class ContextImpl extends Context { String opPackageName) { if (packageInfo == null) throw new IllegalArgumentException("packageInfo"); ContextImpl context = new ContextImpl(null, mainThread, packageInfo, - ContextParams.EMPTY, null, null, null, null, null, 0, null, opPackageName); + ContextParams.EMPTY, null, null, null, null, null, 0, null, opPackageName, + DEVICE_ID_DEFAULT, false); context.setResources(packageInfo.getResources()); context.mContextType = isSystemOrSystemUI(context) ? CONTEXT_TYPE_SYSTEM_OR_SYSTEM_UI : CONTEXT_TYPE_NON_UI; @@ -3360,7 +3370,7 @@ class ContextImpl extends Context { ContextImpl context = new ContextImpl(null, mainThread, packageInfo, ContextParams.EMPTY, attributionTag, null, activityInfo.splitName, activityToken, null, 0, classLoader, - null); + null, DEVICE_ID_DEFAULT, false); context.mContextType = CONTEXT_TYPE_ACTIVITY; context.mIsConfigurationBasedContext = true; @@ -3396,7 +3406,8 @@ class ContextImpl extends Context { @NonNull LoadedApk packageInfo, @NonNull ContextParams params, @Nullable String attributionTag, @Nullable AttributionSource nextAttributionSource, @Nullable String splitName, @Nullable IBinder token, @Nullable UserHandle user, - int flags, @Nullable ClassLoader classLoader, @Nullable String overrideOpPackageName) { + int flags, @Nullable ClassLoader classLoader, @Nullable String overrideOpPackageName, + int deviceId, boolean isExplicitDeviceId) { mOuterContext = this; // If creator didn't specify which storage to use, use the default // location for application. @@ -3426,13 +3437,18 @@ class ContextImpl extends Context { String opPackageName; + mDeviceId = deviceId; + mIsExplicitDeviceId = isExplicitDeviceId; + if (container != null) { mBasePackageName = container.mBasePackageName; opPackageName = container.mOpPackageName; setResources(container.mResources); mDisplay = container.mDisplay; - mDeviceId = container.mDeviceId; - mIsExplicitDeviceId = container.mIsExplicitDeviceId; + if (!isExplicitDeviceId) { + mIsExplicitDeviceId = container.mIsExplicitDeviceId; + mDeviceId = container.mDeviceId; + } mForceDisplayOverrideInResources = container.mForceDisplayOverrideInResources; mIsConfigurationBasedContext = container.mIsConfigurationBasedContext; mContextType = container.mContextType; @@ -3455,17 +3471,18 @@ class ContextImpl extends Context { mOpPackageName = overrideOpPackageName != null ? overrideOpPackageName : opPackageName; mParams = Objects.requireNonNull(params); mAttributionSource = createAttributionSource(attributionTag, nextAttributionSource, - params.getRenouncedPermissions(), params.shouldRegisterAttributionSource()); + params.getRenouncedPermissions(), params.shouldRegisterAttributionSource(), mDeviceId); mContentResolver = new ApplicationContentResolver(this, mainThread); } private @NonNull AttributionSource createAttributionSource(@Nullable String attributionTag, @Nullable AttributionSource nextAttributionSource, - @Nullable Set renouncedPermissions, boolean shouldRegister) { + @Nullable Set renouncedPermissions, boolean shouldRegister, + int deviceId) { AttributionSource attributionSource = new AttributionSource(Process.myUid(), Process.myPid(), mOpPackageName, attributionTag, (renouncedPermissions != null) ? renouncedPermissions.toArray(new String[0]) : null, - getDeviceId(), nextAttributionSource); + deviceId, nextAttributionSource); // If we want to access protected data on behalf of another app we need to // tell the OS that we opt in to participate in the attribution chain. if (nextAttributionSource != null || shouldRegister) { @@ -3481,24 +3498,13 @@ class ContextImpl extends Context { } mResources = r; - // only do this if the user already has more than one preferred locale - if (android.content.res.Flags.defaultLocale() - && r.getConfiguration().getLocales().size() > 1) { - LocaleConfig lc; - if (getUserId() < 0) { - lc = LocaleConfig.fromContextIgnoringOverride(this); - } else { - // This is needed because the app might have locale config overrides that need to - // be read from disk in order for resources to correctly choose which values to - // load. - StrictMode.ThreadPolicy policy = StrictMode.allowThreadDiskReads(); - try { - lc = new LocaleConfig(this); - } finally { - StrictMode.setThreadPolicy(policy); - } + if (r != null) { + // only do this if the user already has more than one preferred locale + if (android.content.res.Flags.defaultLocale() + && r.getConfiguration().getLocales().size() > 1) { + LocaleConfig lc = LocaleConfig.fromContextIgnoringOverride(this); + mResourcesManager.setLocaleConfig(lc); } - mResourcesManager.setLocaleConfig(lc); } } diff --git a/core/java/android/app/Dialog.java b/core/java/android/app/Dialog.java index d0d76a4c828505cb4033a1662b9c4fa963b194ba..0e201384812de7123853104395245fe39e36b9fb 100644 --- a/core/java/android/app/Dialog.java +++ b/core/java/android/app/Dialog.java @@ -672,7 +672,16 @@ public class Dialog implements DialogInterface, Window.Callback, */ @Override public boolean onKeyDown(int keyCode, @NonNull KeyEvent event) { - if (keyCode == KeyEvent.KEYCODE_BACK || keyCode == KeyEvent.KEYCODE_ESCAPE) { + if (keyCode == KeyEvent.KEYCODE_BACK) { + event.startTracking(); + return true; + } + if (keyCode == KeyEvent.KEYCODE_ESCAPE) { + if (mCancelable) { + cancel(); + } else { + dismiss(); + } event.startTracking(); return true; } @@ -712,11 +721,6 @@ public class Dialog implements DialogInterface, Window.Callback, } break; case KeyEvent.KEYCODE_ESCAPE: - if (mCancelable) { - cancel(); - } else { - dismiss(); - } return true; } } diff --git a/core/java/android/app/ForegroundServiceTypePolicy.java b/core/java/android/app/ForegroundServiceTypePolicy.java index ac9c497f2a365da4c5aa88d16f7f765759443913..d1e517bbd03c5690d0887621aeeb7d2768c59a6e 100644 --- a/core/java/android/app/ForegroundServiceTypePolicy.java +++ b/core/java/android/app/ForegroundServiceTypePolicy.java @@ -30,6 +30,7 @@ import static android.content.pm.ServiceInfo.FOREGROUND_SERVICE_TYPE_HEALTH; import static android.content.pm.ServiceInfo.FOREGROUND_SERVICE_TYPE_LOCATION; import static android.content.pm.ServiceInfo.FOREGROUND_SERVICE_TYPE_MANIFEST; import static android.content.pm.ServiceInfo.FOREGROUND_SERVICE_TYPE_MEDIA_PLAYBACK; +import static android.content.pm.ServiceInfo.FOREGROUND_SERVICE_TYPE_MEDIA_PROCESSING; import static android.content.pm.ServiceInfo.FOREGROUND_SERVICE_TYPE_MEDIA_PROJECTION; import static android.content.pm.ServiceInfo.FOREGROUND_SERVICE_TYPE_MICROPHONE; import static android.content.pm.ServiceInfo.FOREGROUND_SERVICE_TYPE_NONE; @@ -576,6 +577,26 @@ public abstract class ForegroundServiceTypePolicy { false /* foregroundOnlyPermission */ ); + /** + * The policy for the {@link ServiceInfo#FOREGROUND_SERVICE_TYPE_MEDIA_PROCESSING}. + * + * @hide + */ + public static final @NonNull ForegroundServiceTypePolicyInfo FGS_TYPE_POLICY_MEDIA_PROCESSING = + new ForegroundServiceTypePolicyInfo( + FOREGROUND_SERVICE_TYPE_MEDIA_PROCESSING, + ForegroundServiceTypePolicyInfo.INVALID_CHANGE_ID, + ForegroundServiceTypePolicyInfo.INVALID_CHANGE_ID, + new ForegroundServiceTypePermissions(new ForegroundServiceTypePermission[] { + new RegularPermission( + Manifest.permission.FOREGROUND_SERVICE_MEDIA_PROCESSING) + }, true), + null /* anyOfPermissions */, + null /* permissionEnforcementFlag */, + true /* permissionEnforcementFlagDefaultValue */, + false /* foregroundOnlyPermission */ + ); + /** * The policy for the {@link ServiceInfo#FOREGROUND_SERVICE_TYPE_SPECIAL_USE}. * @@ -1331,6 +1352,8 @@ public abstract class ForegroundServiceTypePolicy { FGS_TYPE_POLICY_SYSTEM_EXEMPTED); mForegroundServiceTypePolicies.put(FOREGROUND_SERVICE_TYPE_SHORT_SERVICE, FGS_TYPE_POLICY_SHORT_SERVICE); + mForegroundServiceTypePolicies.put(FOREGROUND_SERVICE_TYPE_MEDIA_PROCESSING, + FGS_TYPE_POLICY_MEDIA_PROCESSING); // TODO (b/271950506): revisit it in the next release. // Hide the file management type for now. If anyone uses it, will default to "none". mForegroundServiceTypePolicies.put(FOREGROUND_SERVICE_TYPE_SPECIAL_USE, diff --git a/core/java/android/app/FullscreenRequestHandler.java b/core/java/android/app/FullscreenRequestHandler.java index 52f461daf233f72f96c481f2a757498e6db977a0..c78c66aa62c038be3f8ac0de73b6da745b5ccb0f 100644 --- a/core/java/android/app/FullscreenRequestHandler.java +++ b/core/java/android/app/FullscreenRequestHandler.java @@ -16,8 +16,7 @@ package android.app; -import static android.app.Activity.FULLSCREEN_MODE_REQUEST_ENTER; -import static android.app.WindowConfiguration.WINDOWING_MODE_FREEFORM; +import static android.app.Activity.FULLSCREEN_MODE_REQUEST_EXIT; import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN; import android.annotation.IntDef; @@ -35,18 +34,14 @@ import android.os.OutcomeReceiver; public class FullscreenRequestHandler { @IntDef(prefix = { "RESULT_" }, value = { RESULT_APPROVED, - RESULT_FAILED_NOT_IN_FREEFORM, RESULT_FAILED_NOT_IN_FULLSCREEN_WITH_HISTORY, - RESULT_FAILED_NOT_DEFAULT_FREEFORM, RESULT_FAILED_NOT_TOP_FOCUSED }) public @interface RequestResult {} public static final int RESULT_APPROVED = 0; - public static final int RESULT_FAILED_NOT_IN_FREEFORM = 1; - public static final int RESULT_FAILED_NOT_IN_FULLSCREEN_WITH_HISTORY = 2; - public static final int RESULT_FAILED_NOT_DEFAULT_FREEFORM = 3; - public static final int RESULT_FAILED_NOT_TOP_FOCUSED = 4; + public static final int RESULT_FAILED_NOT_IN_FULLSCREEN_WITH_HISTORY = 1; + public static final int RESULT_FAILED_NOT_TOP_FOCUSED = 2; public static final String REMOTE_CALLBACK_RESULT_KEY = "result"; @@ -85,17 +80,10 @@ public class FullscreenRequestHandler { OutcomeReceiver callback, int result) { Throwable e = null; switch (result) { - case RESULT_FAILED_NOT_IN_FREEFORM: - e = new IllegalStateException("The window is not a freeform window, the request " - + "to get into fullscreen cannot be approved."); - break; case RESULT_FAILED_NOT_IN_FULLSCREEN_WITH_HISTORY: e = new IllegalStateException("The window is not in fullscreen by calling the " + "requestFullscreenMode API before, such that cannot be restored."); break; - case RESULT_FAILED_NOT_DEFAULT_FREEFORM: - e = new IllegalStateException("The window is not launched in freeform by default."); - break; case RESULT_FAILED_NOT_TOP_FOCUSED: e = new IllegalStateException("The window is not the top focused window."); break; @@ -109,11 +97,7 @@ public class FullscreenRequestHandler { } private static int earlyCheckRequestMatchesWindowingMode(int request, int windowingMode) { - if (request == FULLSCREEN_MODE_REQUEST_ENTER) { - if (windowingMode != WINDOWING_MODE_FREEFORM) { - return RESULT_FAILED_NOT_IN_FREEFORM; - } - } else { + if (request == FULLSCREEN_MODE_REQUEST_EXIT) { if (windowingMode != WINDOWING_MODE_FULLSCREEN) { return RESULT_FAILED_NOT_IN_FULLSCREEN_WITH_HISTORY; } diff --git a/core/java/android/app/GrammaticalInflectionManager.java b/core/java/android/app/GrammaticalInflectionManager.java index a55121aaa12c1465e544a7844c90c3ac28f0caa9..483a6e11a42a057494eaf8f8ecbdf696ba62a910 100644 --- a/core/java/android/app/GrammaticalInflectionManager.java +++ b/core/java/android/app/GrammaticalInflectionManager.java @@ -114,7 +114,7 @@ public class GrammaticalInflectionManager { } try { - mService.setSystemWideGrammaticalGender(mContext.getUserId(), grammaticalGender); + mService.setSystemWideGrammaticalGender(grammaticalGender, mContext.getUserId()); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } @@ -131,7 +131,8 @@ public class GrammaticalInflectionManager { @Configuration.GrammaticalGender public int getSystemGrammaticalGender() { try { - return mService.getSystemGrammaticalGender(mContext.getUserId()); + return mService.getSystemGrammaticalGender(mContext.getAttributionSource(), + mContext.getUserId()); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } diff --git a/core/java/android/app/HomeVisibilityListener.java b/core/java/android/app/HomeVisibilityListener.java index 1f5f2e4c8237df311fe7fdbf518eae75d0d9ac47..5dd7ab0f99fa11b90a71c02ba3ad63a9ae676803 100644 --- a/core/java/android/app/HomeVisibilityListener.java +++ b/core/java/android/app/HomeVisibilityListener.java @@ -68,6 +68,11 @@ public abstract class HomeVisibilityListener { public HomeVisibilityListener() { mObserver = new android.app.IProcessObserver.Stub() { + @Override + public void onProcessStarted(int pid, int processUid, int packageUid, + String packageName, String processName) { + } + @Override public void onForegroundActivitiesChanged(int pid, int uid, boolean fg) { refreshHomeVisibility(); diff --git a/core/java/android/app/IActivityClientController.aidl b/core/java/android/app/IActivityClientController.aidl index 7370fc36c23ee93d6c37b09de43a9bd9348e3f1e..9c8fea15c712012e19c4343a2f75415197d9873e 100644 --- a/core/java/android/app/IActivityClientController.aidl +++ b/core/java/android/app/IActivityClientController.aidl @@ -23,6 +23,7 @@ import android.app.PictureInPictureParams; import android.content.ComponentName; import android.content.Intent; import android.content.res.Configuration; +import android.net.Uri; import android.os.Bundle; import android.os.IRemoteCallback; import android.os.PersistableBundle; @@ -89,7 +90,12 @@ interface IActivityClientController { ComponentName getCallingActivity(in IBinder token); String getCallingPackage(in IBinder token); int getLaunchedFromUid(in IBinder token); + int getActivityCallerUid(in IBinder activityToken, in IBinder callerToken); String getLaunchedFromPackage(in IBinder token); + String getActivityCallerPackage(in IBinder activityToken, in IBinder callerToken); + + int checkActivityCallerContentUriPermission(in IBinder activityToken, in IBinder callerToken, + in Uri uri, int modeFlags, int userId); void setRequestedOrientation(in IBinder token, int requestedOrientation); int getRequestedOrientation(in IBinder token); @@ -119,7 +125,7 @@ interface IActivityClientController { oneway void setShowWhenLocked(in IBinder token, boolean showWhenLocked); oneway void setInheritShowWhenLocked(in IBinder token, boolean setInheritShownWhenLocked); - oneway void setTurnScreenOn(in IBinder token, boolean turnScreenOn); + void setTurnScreenOn(in IBinder token, boolean turnScreenOn); oneway void setAllowCrossUidActivitySwitchFromBelow(in IBinder token, boolean allowed); oneway void reportActivityFullyDrawn(in IBinder token, boolean restoredFromBundle); oneway void overrideActivityTransition(IBinder token, boolean open, int enterAnim, int exitAnim, diff --git a/core/java/android/app/IActivityManager.aidl b/core/java/android/app/IActivityManager.aidl index b84475e6014fad8e3a259df65fd5d2cf78d80250..55fbb2bad82fcfc4351faaf59bfa70e251188345 100644 --- a/core/java/android/app/IActivityManager.aidl +++ b/core/java/android/app/IActivityManager.aidl @@ -17,7 +17,6 @@ package android.app; import android.app.ActivityManager; -import android.app.ActivityManager.PendingIntentInfo; import android.app.ActivityTaskManager; import android.app.ApplicationStartInfo; import android.app.ApplicationErrorReport; @@ -116,6 +115,7 @@ interface IActivityManager { * @throws RemoteException * @return Returns A binder token identifying the UidObserver registration. */ + @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.PACKAGE_USAGE_STATS)") IBinder registerUidObserverForUids(in IUidObserver observer, int which, int cutpoint, String callingPackage, in int[] uids); @@ -274,6 +274,7 @@ interface IActivityManager { int getProcessLimit(); int checkUriPermission(in Uri uri, int pid, int uid, int mode, int userId, in IBinder callerToken); + int checkContentUriPermissionFull(in Uri uri, int pid, int uid, int mode, int userId); int[] checkUriPermissions(in List uris, int pid, int uid, int mode, int userId, in IBinder callerToken); void grantUriPermission(in IApplicationThread caller, in String targetPkg, in Uri uri, @@ -292,7 +293,8 @@ interface IActivityManager { @UnsupportedAppUsage ParceledListSlice getRecentTasks(int maxNum, int flags, int userId); @UnsupportedAppUsage - oneway void serviceDoneExecuting(in IBinder token, int type, int startId, int res); + oneway void serviceDoneExecuting(in IBinder token, int type, int startId, int res, + in Intent intent); /** @deprecated Use {@link #getIntentSenderWithFeature} instead */ @UnsupportedAppUsage(maxTargetSdk=29, publicAlternatives="Use {@link PendingIntent#getIntentSender()} instead") IIntentSender getIntentSender(int type, in String packageName, in IBinder token, @@ -550,6 +552,17 @@ interface IActivityManager { @UnsupportedAppUsage(maxTargetSdk = 30, trackingBug = 170729553) boolean isTopOfTask(in IBinder token); void bootAnimationComplete(); + + /** + * Used by {@link com.android.systemui.theme.ThemeOverlayController} to notify when color + * palette is ready. + * + * @param userId The ID of the user where ThemeOverlayController is ready. + * + * @throws RemoteException + */ + void setThemeOverlayReady(int userId); + @UnsupportedAppUsage void registerTaskStackListener(in ITaskStackListener listener); void unregisterTaskStackListener(in ITaskStackListener listener); @@ -715,7 +728,7 @@ interface IActivityManager { * @param listener A listener to for the callback upon completion of startup data collection. * @param userId The userId in the multi-user environment. */ - void setApplicationStartInfoCompleteListener(IApplicationStartInfoCompleteListener listener, + void addApplicationStartInfoCompleteListener(IApplicationStartInfoCompleteListener listener, int userId); @@ -724,7 +737,8 @@ interface IActivityManager { * * @param userId The userId in the multi-user environment. */ - void clearApplicationStartInfoCompleteListener(int userId); + void removeApplicationStartInfoCompleteListener(IApplicationStartInfoCompleteListener listener, + int userId); /** @@ -931,6 +945,8 @@ interface IActivityManager { /** Returns if the service is a short-service is still "alive" and past the timeout. */ boolean shouldServiceTimeOut(in ComponentName className, in IBinder token); + /** Returns if the service has a time-limit restricted type and is past the time limit. */ + boolean hasServiceTimeLimitExceeded(in ComponentName className, in IBinder token); void registerUidFrozenStateChangedCallback(in IUidFrozenStateChangedCallback callback); @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.PACKAGE_USAGE_STATS)") diff --git a/core/java/android/app/IActivityTaskManager.aidl b/core/java/android/app/IActivityTaskManager.aidl index d54074818b41bd5eb22e2a9cb92d26000ac91053..08636aec00cf9121e03212556a577995be54e69c 100644 --- a/core/java/android/app/IActivityTaskManager.aidl +++ b/core/java/android/app/IActivityTaskManager.aidl @@ -225,7 +225,7 @@ interface IActivityTaskManager { boolean focused, boolean newSessionId); boolean requestAutofillData(in IAssistDataReceiver receiver, in Bundle receiverExtras, in IBinder activityToken, int flags); - boolean isAssistDataAllowedOnCurrentActivity(); + boolean isAssistDataAllowed(); boolean requestAssistDataForTask(in IAssistDataReceiver receiver, int taskId, in String callingPackageName, String callingAttributionTag); @@ -332,8 +332,10 @@ interface IActivityTaskManager { /** * When the Picture-in-picture state has changed. + * @param pipState the {@link PictureInPictureUiState} is sent to current pip task if there is + * any -or- the top most task (state like entering PiP does not require a pinned task). */ - void onPictureInPictureStateChanged(in PictureInPictureUiState pipState); + void onPictureInPictureUiStateChanged(in PictureInPictureUiState pipState); /** * Re-attach navbar to the display during a recents transition. diff --git a/core/java/android/app/IApplicationThread.aidl b/core/java/android/app/IApplicationThread.aidl index 40f3c1a661047ae9dd8b846dd0d618520612ecf5..8b0a27f0609e142570ad2fae3a04e11442f1202b 100644 --- a/core/java/android/app/IApplicationThread.aidl +++ b/core/java/android/app/IApplicationThread.aidl @@ -16,6 +16,7 @@ package android.app; +import android.app.ActivityOptions.SceneTransitionInfo; import android.app.ContentProviderHolder; import android.app.IInstrumentationWatcher; import android.app.IUiAutomationConnection; @@ -48,6 +49,8 @@ import android.os.SharedMemory; import android.view.autofill.AutofillId; import android.view.translation.TranslationSpec; import android.view.translation.UiTranslationSpec; +import android.window.ITaskFragmentOrganizer; +import android.window.TaskFragmentTransaction; import com.android.internal.app.IVoiceInteractor; import com.android.internal.content.ReferrerIntent; @@ -112,7 +115,7 @@ oneway interface IApplicationThread { void scheduleCreateBackupAgent(in ApplicationInfo app, int backupMode, int userId, int operationType); void scheduleDestroyBackupAgent(in ApplicationInfo app, int userId); - void scheduleOnNewActivityOptions(IBinder token, in Bundle options); + void scheduleOnNewSceneTransitionInfo(IBinder token, in SceneTransitionInfo info); void scheduleSuicide(); void dispatchPackageBroadcast(int cmd, in String[] packages); void scheduleCrash(in String msg, int typeId, in Bundle extras); @@ -158,6 +161,8 @@ oneway interface IApplicationThread { void scheduleApplicationInfoChanged(in ApplicationInfo ai); void setNetworkBlockSeq(long procStateSeq); void scheduleTransaction(in ClientTransaction transaction); + void scheduleTaskFragmentTransaction(in ITaskFragmentOrganizer organizer, + in TaskFragmentTransaction transaction); void requestDirectActions(IBinder activityToken, IVoiceInteractor intractor, in RemoteCallback cancellationCallback, in RemoteCallback callback); void performDirectAction(IBinder activityToken, String actionId, @@ -174,5 +179,6 @@ oneway interface IApplicationThread { in TranslationSpec targetSpec, in List viewIds, in UiTranslationSpec uiTranslationSpec); void scheduleTimeoutService(IBinder token, int startId); + void scheduleTimeoutServiceForType(IBinder token, int startId, int fgsType); void schedulePing(in RemoteCallback pong); } diff --git a/core/java/android/app/ICallNotificationEventCallback.aidl b/core/java/android/app/ICallNotificationEventCallback.aidl new file mode 100644 index 0000000000000000000000000000000000000000..ba348294b4626f3f5cbaa033a776f49f99bfc068 --- /dev/null +++ b/core/java/android/app/ICallNotificationEventCallback.aidl @@ -0,0 +1,29 @@ +/* + * Copyright 2024, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.app; + +import android.os.UserHandle; + +/** + * Callback to be called when a call notification is posted or removed + * + * @hide + */ +oneway interface ICallNotificationEventCallback { + void onCallNotificationPosted(String packageName, in UserHandle userHandle); + void onCallNotificationRemoved(String packageName, in UserHandle userHandle); +} diff --git a/core/java/android/app/IGrammaticalInflectionManager.aidl b/core/java/android/app/IGrammaticalInflectionManager.aidl index 48a48416d59217c0aa47f427981d0f5af22a23a5..86f2e9110889217ef12bb33bce7d0793d8bd366c 100644 --- a/core/java/android/app/IGrammaticalInflectionManager.aidl +++ b/core/java/android/app/IGrammaticalInflectionManager.aidl @@ -1,5 +1,22 @@ +/** + * Copyright (C) 2024 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package android.app; +import android.content.AttributionSource; /** * Internal interface used to control app-specific gender. @@ -20,10 +37,10 @@ package android.app; /** * Sets the grammatical gender to system. */ - void setSystemWideGrammaticalGender(int userId, int gender); + void setSystemWideGrammaticalGender(int gender, int userId); /** * Gets the grammatical gender from system. */ - int getSystemGrammaticalGender(int userId); + int getSystemGrammaticalGender(in AttributionSource attributionSource, int userId); } diff --git a/core/java/android/app/INotificationManager.aidl b/core/java/android/app/INotificationManager.aidl index 94385717d34964c55b5d7087aa243464e27aafb0..8f81ae2ae7d6834fb7186b4830cd3f1acf7c92a1 100644 --- a/core/java/android/app/INotificationManager.aidl +++ b/core/java/android/app/INotificationManager.aidl @@ -24,6 +24,7 @@ import android.app.NotificationChannel; import android.app.NotificationChannelGroup; import android.app.NotificationHistory; import android.app.NotificationManager; +import android.app.ICallNotificationEventCallback; import android.content.AttributionSource; import android.content.ComponentName; import android.content.Intent; @@ -38,6 +39,7 @@ import android.service.notification.IConditionProvider; import android.service.notification.INotificationListener; import android.service.notification.NotificationListenerFilter; import android.service.notification.StatusBarNotification; +import android.service.notification.ZenPolicy; import android.app.AutomaticZenRule; import android.service.notification.ZenModeConfig; @@ -167,7 +169,7 @@ interface INotificationManager void requestInterruptionFilterFromListener(in INotificationListener token, int interruptionFilter); int getInterruptionFilterFromListener(in INotificationListener token); void setOnNotificationPostedTrimFromListener(in INotificationListener token, int trim); - void setInterruptionFilter(String pkg, int interruptionFilter); + void setInterruptionFilter(String pkg, int interruptionFilter, boolean fromUser); void updateNotificationChannelGroupFromPrivilegedListener(in INotificationListener token, String pkg, in UserHandle user, in NotificationChannelGroup group); void updateNotificationChannelFromPrivilegedListener(in INotificationListener token, String pkg, in UserHandle user, in NotificationChannel channel); @@ -205,23 +207,25 @@ interface INotificationManager @UnsupportedAppUsage ZenModeConfig getZenModeConfig(); NotificationManager.Policy getConsolidatedNotificationPolicy(); - oneway void setZenMode(int mode, in Uri conditionId, String reason); + oneway void setZenMode(int mode, in Uri conditionId, String reason, boolean fromUser); oneway void notifyConditions(String pkg, in IConditionProvider provider, in Condition[] conditions); boolean isNotificationPolicyAccessGranted(String pkg); NotificationManager.Policy getNotificationPolicy(String pkg); - void setNotificationPolicy(String pkg, in NotificationManager.Policy policy); + void setNotificationPolicy(String pkg, in NotificationManager.Policy policy, boolean fromUser); boolean isNotificationPolicyAccessGrantedForPackage(String pkg); void setNotificationPolicyAccessGranted(String pkg, boolean granted); void setNotificationPolicyAccessGrantedForUser(String pkg, int userId, boolean granted); + ZenPolicy getDefaultZenPolicy(); AutomaticZenRule getAutomaticZenRule(String id); Map getAutomaticZenRules(); // TODO: b/310620812 - Remove getZenRules() when MODES_API is inlined. List getZenRules(); - String addAutomaticZenRule(in AutomaticZenRule automaticZenRule, String pkg); - boolean updateAutomaticZenRule(String id, in AutomaticZenRule automaticZenRule); - boolean removeAutomaticZenRule(String id); - boolean removeAutomaticZenRules(String packageName); + String addAutomaticZenRule(in AutomaticZenRule automaticZenRule, String pkg, boolean fromUser); + boolean updateAutomaticZenRule(String id, in AutomaticZenRule automaticZenRule, boolean fromUser); + boolean removeAutomaticZenRule(String id, boolean fromUser); + boolean removeAutomaticZenRules(String packageName, boolean fromUser); int getRuleInstanceCount(in ComponentName owner); + int getAutomaticZenRuleState(String id); void setAutomaticZenRuleState(String id, in Condition condition); byte[] getBackupPayload(int user); @@ -245,4 +249,10 @@ interface INotificationManager @EnforcePermission("MANAGE_TOAST_RATE_LIMITING") void setToastRateLimitingEnabled(boolean enable); + + @EnforcePermission(allOf={"INTERACT_ACROSS_USERS", "ACCESS_NOTIFICATIONS"}) + void registerCallNotificationEventListener(String packageName, in UserHandle userHandle, in ICallNotificationEventCallback listener); + @EnforcePermission(allOf={"INTERACT_ACROSS_USERS", "ACCESS_NOTIFICATIONS"}) + void unregisterCallNotificationEventListener(String packageName, in UserHandle userHandle, in ICallNotificationEventCallback listener); + } diff --git a/core/java/android/app/IProcessObserver.aidl b/core/java/android/app/IProcessObserver.aidl index 7be3620f317b285ba833d0b2fddcb026d0ace374..5c5e72cf9d6f569733b8cf1fb758379b47f8922b 100644 --- a/core/java/android/app/IProcessObserver.aidl +++ b/core/java/android/app/IProcessObserver.aidl @@ -18,6 +18,17 @@ package android.app; /** {@hide} */ oneway interface IProcessObserver { + /** + * Invoked when an app process starts up. + * + * @param pid The pid of the process. + * @param processUid The UID associated with the process. + * @param packageUid The UID associated with the package. + * @param packageName The name of the package. + * @param processName The name of the process. + */ + void onProcessStarted(int pid, int processUid, int packageUid, + @utf8InCpp String packageName, @utf8InCpp String processName); void onForegroundActivitiesChanged(int pid, int uid, boolean foregroundActivities); void onForegroundServicesChanged(int pid, int uid, int serviceTypes); void onProcessDied(int pid, int uid); diff --git a/core/java/android/app/IUiModeManager.aidl b/core/java/android/app/IUiModeManager.aidl index 60b34cdc1b8a4875c0c3dbe98a274e0c41a13853..3b83024d536b65550435cd49bb496a6c758cf672 100644 --- a/core/java/android/app/IUiModeManager.aidl +++ b/core/java/android/app/IUiModeManager.aidl @@ -94,6 +94,34 @@ interface IUiModeManager { @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.MODIFY_DAY_NIGHT_MODE)") int getNightModeCustomType(); + /** + * Overlays current Night Mode value. + * {@code attentionModeThemeOverlayType}. + * + * @param attentionModeThemeOverlayType + * @hide + */ + @EnforcePermission("MODIFY_DAY_NIGHT_MODE") + @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.MODIFY_DAY_NIGHT_MODE)") + void setAttentionModeThemeOverlay(int attentionModeThemeOverlayType); + + + /** + * Returns current Attention Mode overlay type. + *

+ * returns + *

    + *
  • {@link #MODE_ATTENTION_OFF}
  • + *
  • {@link #MODE_ATTENTION_NIGHT}
  • + *
  • {@link #MODE_ATTENTION_DAY}
  • + *
+ *

+ * @hide + */ + @EnforcePermission("MODIFY_DAY_NIGHT_MODE") + @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.MODIFY_DAY_NIGHT_MODE)") + int getAttentionModeThemeOverlay(); + /** * Sets the dark mode for the given application. This setting is persisted and will override the * system configuration for this application. diff --git a/core/java/android/app/IWallpaperManager.aidl b/core/java/android/app/IWallpaperManager.aidl index d7d654672abc2ec9d2af285f4970860512930d69..5acb9b5cf9ae9a39de06bf9334404b731b1fa6ed 100644 --- a/core/java/android/app/IWallpaperManager.aidl +++ b/core/java/android/app/IWallpaperManager.aidl @@ -16,6 +16,7 @@ package android.app; +import android.graphics.Point; import android.graphics.Rect; import android.graphics.RectF; import android.os.Bundle; @@ -26,6 +27,8 @@ import android.app.WallpaperInfo; import android.content.ComponentName; import android.app.WallpaperColors; +import java.util.List; + /** @hide */ interface IWallpaperManager { @@ -39,15 +42,21 @@ interface IWallpaperManager { * FLAG_SET_SYSTEM * FLAG_SET_LOCK * - * A 'null' cropHint rectangle is explicitly permitted as a sentinel for "whatever - * the source image's bounding rect is." + * 'screenOrientations' and 'crops' define how the wallpaper will be positioned for + * different screen orientations. If some screen orientations are missing, crops for these + * orientations will be added by the system. + * + * If 'screenOrientations' is null, 'crops' can be null or a singleton list. The system will + * fit the provided crop (or the whole image, if 'crops' is 'null') for the current device + * orientation, and add crops for the missing orientations. * * The completion callback's "onWallpaperChanged()" method is invoked when the * new wallpaper content is ready to display. */ + @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.SET_WALLPAPER)") ParcelFileDescriptor setWallpaper(String name, in String callingPackage, - in Rect cropHint, boolean allowBackup, out Bundle extras, int which, - IWallpaperManagerCallback completion, int userId); + in int[] screenOrientations, in List crops, boolean allowBackup, + out Bundle extras, int which, IWallpaperManagerCallback completion, int userId); /** * Set the live wallpaper. @@ -77,6 +86,30 @@ interface IWallpaperManager { IWallpaperManagerCallback cb, int which, out Bundle outParams, int userId, boolean getCropped); + /** + * For a given user and a list of display sizes, get a list of Rect representing the + * area of the current wallpaper that is displayed for each display size. + */ + @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.READ_WALLPAPER_INTERNAL)") + @SuppressWarnings(value={"untyped-collection"}) + List getBitmapCrops(in List displaySizes, int which, boolean originalBitmap, int userId); + + /** + * Return how a bitmap of a given size would be cropped for a given list of display sizes when + * set with the given suggested crops. + * @hide + */ + @SuppressWarnings(value={"untyped-collection"}) + List getFutureBitmapCrops(in Point bitmapSize, in List displaySizes, + in int[] screenOrientations, in List crops); + + /** + * Return how a bitmap of a given size would be cropped when set with the given suggested crops. + * @hide + */ + @SuppressWarnings(value={"untyped-collection"}) + Rect getBitmapCrop(in Point bitmapSize, in int[] screenOrientations, in List crops); + /** * Retrieve the given user's current wallpaper ID of the given kind. */ @@ -245,11 +278,4 @@ interface IWallpaperManager { * @hide */ boolean isStaticWallpaper(int which); - - /** - * Temporary method for project b/270726737. - * Return true if the wallpaper supports different crops for different display dimensions. - * @hide - */ - boolean isMultiCropEnabled(); } diff --git a/core/java/android/app/Instrumentation.java b/core/java/android/app/Instrumentation.java index 2162e3a77f1554fc814337f7712a2af220e3efe7..db216b1af974c9eae425efe407d9d30b7770512f 100644 --- a/core/java/android/app/Instrumentation.java +++ b/core/java/android/app/Instrumentation.java @@ -16,6 +16,7 @@ package android.app; +import android.annotation.FlaggedApi; import android.annotation.IntDef; import android.annotation.NonNull; import android.annotation.Nullable; @@ -79,6 +80,7 @@ import java.util.concurrent.TimeoutException; * implementation is described to the system through an AndroidManifest.xml's * <instrumentation> tag. */ +@android.ravenwood.annotation.RavenwoodKeepPartialClass public class Instrumentation { /** @@ -132,6 +134,7 @@ public class Instrumentation { private UiAutomation mUiAutomation; private final Object mAnimationCompleteLock = new Object(); + @android.ravenwood.annotation.RavenwoodKeep public Instrumentation() { } @@ -142,6 +145,7 @@ public class Instrumentation { * reflection, but it will serve as noticeable discouragement from * doing such a thing. */ + @android.ravenwood.annotation.RavenwoodKeep private void checkInstrumenting(String method) { // Check if we have an instrumentation context, as init should only get called by // the system in startup processes that are being instrumented. @@ -156,6 +160,7 @@ public class Instrumentation { * * @hide */ + @android.ravenwood.annotation.RavenwoodKeep public boolean isInstrumenting() { // Check if we have an instrumentation context, as init should only get called by // the system in startup processes that are being instrumented. @@ -319,6 +324,7 @@ public class Instrumentation { * * @see #getTargetContext */ + @android.ravenwood.annotation.RavenwoodKeep public Context getContext() { return mInstrContext; } @@ -343,6 +349,7 @@ public class Instrumentation { * * @see #getContext */ + @android.ravenwood.annotation.RavenwoodKeep public Context getTargetContext() { return mAppContext; } @@ -1415,8 +1422,8 @@ public class Instrumentation { info, title, parent, id, (Activity.NonConfigurationInstances)lastNonConfigurationInstance, new Configuration(), null /* referrer */, null /* voiceInteractor */, - null /* window */, null /* activityCallback */, null /*assistToken*/, - null /*shareableActivityToken*/); + null /* window */, null /* activityCallback */, null /* assistToken */, + null /* shareableActivityToken */, null /* initialCallerInfoAccessToken */); return activity; } @@ -1616,25 +1623,74 @@ public class Instrumentation { * @param intent The new intent being received. */ public void callActivityOnNewIntent(Activity activity, Intent intent) { - activity.performNewIntent(intent); + if (android.security.Flags.contentUriPermissionApis()) { + activity.performNewIntent(intent, new ComponentCaller(activity.getActivityToken(), + /* callerToken */ null)); + } else { + activity.performNewIntent(intent); + } + } + + /** + * Same as {@link #callActivityOnNewIntent(Activity, Intent)}, but with an extra parameter for + * the {@link ComponentCaller} instance associated with the app that sent the intent. + * + * @param activity The activity receiving a new Intent. + * @param intent The new intent being received. + * @param caller The {@link ComponentCaller} instance that launched the activity with the new + * intent. + */ + @FlaggedApi(android.security.Flags.FLAG_CONTENT_URI_PERMISSION_APIS) + public void callActivityOnNewIntent(@NonNull Activity activity, @NonNull Intent intent, + @NonNull ComponentCaller caller) { + activity.performNewIntent(intent, caller); } /** * @hide */ - @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) - public void callActivityOnNewIntent(Activity activity, ReferrerIntent intent) { + @FlaggedApi(android.security.Flags.FLAG_CONTENT_URI_PERMISSION_APIS) + public void callActivityOnNewIntent(Activity activity, ReferrerIntent intent, + @NonNull ComponentCaller caller) { + internalCallActivityOnNewIntent(activity, intent, caller); + } + + @FlaggedApi(android.security.Flags.FLAG_CONTENT_URI_PERMISSION_APIS) + private void internalCallActivityOnNewIntent(Activity activity, ReferrerIntent intent, + @NonNull ComponentCaller caller) { final String oldReferrer = activity.mReferrer; try { if (intent != null) { activity.mReferrer = intent.mReferrer; } - callActivityOnNewIntent(activity, intent != null ? new Intent(intent) : null); + Intent newIntent = intent != null ? new Intent(intent) : null; + callActivityOnNewIntent(activity, newIntent, caller); } finally { activity.mReferrer = oldReferrer; } } + /** + * @hide + */ + @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) + public void callActivityOnNewIntent(Activity activity, ReferrerIntent intent) { + if (android.security.Flags.contentUriPermissionApis()) { + internalCallActivityOnNewIntent(activity, intent, new ComponentCaller( + activity.getActivityToken(), /* callerToken */ null)); + } else { + final String oldReferrer = activity.mReferrer; + try { + if (intent != null) { + activity.mReferrer = intent.mReferrer; + } + callActivityOnNewIntent(activity, intent != null ? new Intent(intent) : null); + } finally { + activity.mReferrer = oldReferrer; + } + } + } + /** * Perform calling of an activity's {@link Activity#onStart} * method. The default implementation simply calls through to that method. @@ -2344,6 +2400,17 @@ public class Instrumentation { mThread = thread; } + /** + * Only sets the Context up, keeps everything else null. + * + * @hide + */ + @android.ravenwood.annotation.RavenwoodKeep + public final void basicInit(Context context) { + mInstrContext = context; + mAppContext = context; + } + /** @hide */ @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023) public static void checkStartActivityResult(int res, Object intent) { @@ -2504,6 +2571,7 @@ public class Instrumentation { * Takes control of the execution of messages on the specified looper until * {@link TestLooperManager#release} is called. */ + @android.ravenwood.annotation.RavenwoodKeep public TestLooperManager acquireLooperManager(Looper looper) { checkInstrumenting("acquireLooperManager"); return new TestLooperManager(looper); diff --git a/core/java/android/app/LocalActivityManager.java b/core/java/android/app/LocalActivityManager.java index 6b5f19a52e339484d28a9e8518665d19d9893c47..1b19ecdd59316f7b8ae458ecb2639adc67b4859e 100644 --- a/core/java/android/app/LocalActivityManager.java +++ b/core/java/android/app/LocalActivityManager.java @@ -179,7 +179,7 @@ public class LocalActivityManager { } mActivityThread.handleStartActivity(clientRecord, pendingActions, - null /* activityOptions */); + null /* sceneTransitionInfo */); r.curState = STARTED; if (desiredState == RESUMED) { diff --git a/core/java/android/app/Notification.java b/core/java/android/app/Notification.java index a1ea7fb72c5b33fd4ec41c4356e5e635784a64e3..1129f9dbdfeb659c2c55925aa99bd044ef7f61f1 100644 --- a/core/java/android/app/Notification.java +++ b/core/java/android/app/Notification.java @@ -23,6 +23,7 @@ import static android.app.admin.DevicePolicyResources.Drawables.WORK_PROFILE_ICO import static android.app.admin.DevicePolicyResources.UNDEFINED; import static android.graphics.drawable.Icon.TYPE_URI; import static android.graphics.drawable.Icon.TYPE_URI_ADAPTIVE_BITMAP; +import static android.app.Flags.evenlyDividedCallStyleActionLayout; import static java.util.Objects.requireNonNull; @@ -79,6 +80,7 @@ import android.os.Parcel; import android.os.Parcelable; import android.os.SystemClock; import android.os.SystemProperties; +import android.os.Trace; import android.os.UserHandle; import android.os.UserManager; import android.provider.Settings; @@ -1060,6 +1062,12 @@ public class Notification implements Parcelable */ public static final String CATEGORY_MISSED_CALL = "missed_call"; + /** + * Notification category: voicemail. + */ + @FlaggedApi(Flags.FLAG_CATEGORY_VOICEMAIL) + public static final String CATEGORY_VOICEMAIL = "voicemail"; + /** * One of the predefined notification categories (see the CATEGORY_* constants) * that best describes this Notification. May be used by the system for ranking and filtering. @@ -2205,6 +2213,9 @@ public class Notification implements Parcelable private void visitUris(@NonNull Consumer visitor) { visitIconUri(visitor, getIcon()); + if (actionIntent != null) { + actionIntent.visitUris(visitor); + } } @Override @@ -2898,6 +2909,21 @@ public class Notification implements Parcelable } } + // allPendingIntents should contain all associated intents after parcelling, but it may also + // contain intents added by the app to extras for their own purposes. We only care about + // checking the intents known and used by system_server, to avoid the confused deputy issue. + List pendingIntents = Arrays.asList(contentIntent, deleteIntent, + fullScreenIntent); + for (PendingIntent intent : pendingIntents) { + if (intent != null) { + intent.visitUris(visitor); + } + } + + if (mBubbleMetadata != null) { + mBubbleMetadata.visitUris(visitor); + } + if (extras != null) { visitIconUri(visitor, extras.getParcelable(EXTRA_LARGE_ICON_BIG, Icon.class)); visitIconUri(visitor, extras.getParcelable(EXTRA_PICTURE_ICON, Icon.class)); @@ -2969,15 +2995,72 @@ public class Notification implements Parcelable callPerson.visitUris(visitor); } visitIconUri(visitor, extras.getParcelable(EXTRA_VERIFICATION_ICON, Icon.class)); - } - if (mBubbleMetadata != null) { - visitIconUri(visitor, mBubbleMetadata.getIcon()); + // Extras for MediaStyle. + PendingIntent deviceIntent = extras.getParcelable(EXTRA_MEDIA_REMOTE_INTENT, + PendingIntent.class); + if (deviceIntent != null) { + deviceIntent.visitUris(visitor); + } + + if (extras.containsKey(WearableExtender.EXTRA_WEARABLE_EXTENSIONS)) { + WearableExtender extender = new WearableExtender(this); + extender.visitUris(visitor); + } + + if (extras.containsKey(TvExtender.EXTRA_TV_EXTENDER)) { + TvExtender extender = new TvExtender(this); + extender.visitUris(visitor); + } + + if (extras.containsKey(CarExtender.EXTRA_CAR_EXTENDER)) { + CarExtender extender = new CarExtender(this); + extender.visitUris(visitor); + } } + } - if (extras != null && extras.containsKey(WearableExtender.EXTRA_WEARABLE_EXTENSIONS)) { - WearableExtender extender = new WearableExtender(this); - extender.visitUris(visitor); + /** + * @hide + */ + public String loadHeaderAppName(Context context) { + Trace.beginSection("Notification#loadHeaderAppName"); + + try { + CharSequence name = null; + // Check if there is a non-empty substitute app name and return that. + if (extras.containsKey(EXTRA_SUBSTITUTE_APP_NAME)) { + name = extras.getString(EXTRA_SUBSTITUTE_APP_NAME); + if (!TextUtils.isEmpty(name)) { + return name.toString(); + } + } + // If not, try getting the app info from extras. + if (context == null) { + return null; + } + final PackageManager pm = context.getPackageManager(); + if (TextUtils.isEmpty(name)) { + if (extras.containsKey(EXTRA_BUILDER_APPLICATION_INFO)) { + final ApplicationInfo info = extras.getParcelable( + EXTRA_BUILDER_APPLICATION_INFO, + ApplicationInfo.class); + if (info != null) { + name = pm.getApplicationLabel(info); + } + } + } + // If that's still empty, use the one from the context directly. + if (TextUtils.isEmpty(name)) { + name = pm.getApplicationLabel(context.getApplicationInfo()); + } + // If there's still nothing, ¯\_(ツ)_/¯ + if (TextUtils.isEmpty(name)) { + return null; + } + return name.toString(); + } finally { + Trace.endSection(); } } @@ -3503,15 +3586,12 @@ public class Notification implements Parcelable * Sets the token used for background operations for the pending intents associated with this * notification. * - * This token is automatically set during deserialization for you, you usually won't need to - * call this unless you want to change the existing token, if any. - * * @hide */ - public void clearAllowlistToken() { - mAllowlistToken = null; + public void overrideAllowlistToken(IBinder token) { + mAllowlistToken = token; if (publicVersion != null) { - publicVersion.clearAllowlistToken(); + publicVersion.overrideAllowlistToken(token); } } @@ -4612,13 +4692,24 @@ public class Notification implements Parcelable * to turn it off and use a normal notification, as this can be extremely * disruptive. * - *

- * The system UI may choose to display a heads-up notification, instead of - * launching this intent, while the user is using the device. - *

*

Apps targeting {@link Build.VERSION_CODES#Q} and above will have to request * a permission ({@link android.Manifest.permission#USE_FULL_SCREEN_INTENT}) in order to - * use full screen intents.

+ * use full screen intents.

+ *

+ * Prior to {@link Build.VERSION_CODES#TIRAMISU}, the system may display a + * heads up notification (which may display on screen longer than other heads up + * notifications), instead of launching the intent, while the user is using the device. + * From {@link Build.VERSION_CODES#TIRAMISU}, + * the system UI will display a heads up notification, instead of launching this intent, + * while the user is using the device. This notification will display with emphasized + * action buttons. If the posting app holds + * {@link android.Manifest.permission#USE_FULL_SCREEN_INTENT}, then the heads + * up notification will appear persistently until the user dismisses or snoozes it, or + * the app cancels it. If the posting app does not hold + * {@link android.Manifest.permission#USE_FULL_SCREEN_INTENT}, then the notification will + * appear as heads up notification even when the screen is locked or turned off, and this + * notification will only be persistent for 60 seconds. + *

*

* To be launched as a full screen intent, the notification must also be posted to a * channel with importance level set to IMPORTANCE_HIGH or higher. @@ -5456,6 +5547,15 @@ public class Notification implements Parcelable return mColors; } + /** + * @param isHeader If the notification is a notification header + * @return An instance of mColors after resolving the palette + */ + private Colors getColors(boolean isHeader) { + mColors.resolvePalette(mContext, mN.color, !isHeader && mN.isColorized(), mInNightMode); + return mColors; + } + private void updateBackgroundColor(RemoteViews contentView, StandardTemplateParams p) { if (isBackgroundColorized(p)) { @@ -5621,7 +5721,7 @@ public class Notification implements Parcelable pillColor = Colors.flattenAlpha( getColors(p).getTertiaryFixedDimAccentColor(), bgColor); textColor = Colors.flattenAlpha( - getColors(p).getOnTertiaryAccentTextColor(), pillColor); + getColors(p).getOnTertiaryFixedAccentTextColor(), pillColor); } contentView.setInt(R.id.expand_button, "setHighlightTextColor", textColor); contentView.setInt(R.id.expand_button, "setHighlightPillColor", pillColor); @@ -5714,34 +5814,7 @@ public class Notification implements Parcelable */ @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) public String loadHeaderAppName() { - CharSequence name = null; - final PackageManager pm = mContext.getPackageManager(); - if (mN.extras.containsKey(EXTRA_SUBSTITUTE_APP_NAME)) { - // only system packages which lump together a bunch of unrelated stuff - // may substitute a different name to make the purpose of the - // notification more clear. the correct package label should always - // be accessible via SystemUI. - final String pkg = mContext.getPackageName(); - final String subName = mN.extras.getString(EXTRA_SUBSTITUTE_APP_NAME); - if (PackageManager.PERMISSION_GRANTED == pm.checkPermission( - android.Manifest.permission.SUBSTITUTE_NOTIFICATION_APP_NAME, pkg)) { - name = subName; - } else { - Log.w(TAG, "warning: pkg " - + pkg + " attempting to substitute app name '" + subName - + "' without holding perm " - + android.Manifest.permission.SUBSTITUTE_NOTIFICATION_APP_NAME); - } - } - if (TextUtils.isEmpty(name)) { - name = pm.getApplicationLabel(mContext.getApplicationInfo()); - } - if (TextUtils.isEmpty(name)) { - // still nothing? - return null; - } - - return String.valueOf(name); + return mN.loadHeaderAppName(mContext); } /** @@ -5900,6 +5973,12 @@ public class Notification implements Parcelable // there is enough space to do so (and fall back to the left edge if not). big.setInt(R.id.actions, "setCollapsibleIndentDimen", R.dimen.call_notification_collapsible_indent); + if (evenlyDividedCallStyleActionLayout()) { + if (CallStyle.DEBUG_NEW_ACTION_LAYOUT) { + Log.d(TAG, "setting evenly divided mode on action list"); + } + big.setBoolean(R.id.actions, "setEvenlyDividedMode", true); + } } big.setBoolean(R.id.actions, "setEmphasizedMode", emphasizedMode); if (numActions > 0 && !p.mHideActions) { @@ -6375,7 +6454,15 @@ public class Notification implements Parcelable // Remove full-length color spans and ensure text contrast with the button fill. title = ContrastColorUtil.ensureColorSpanContrast(title, buttonFillColor); } - button.setTextViewText(R.id.action0, ensureColorSpanContrast(title, p)); + final CharSequence label = ensureColorSpanContrast(title, p); + if (p.mCallStyleActions && evenlyDividedCallStyleActionLayout()) { + if (CallStyle.DEBUG_NEW_ACTION_LAYOUT) { + Log.d(TAG, "new action layout enabled, gluing instead of setting text"); + } + button.setCharSequence(R.id.action0, "glueLabel", label); + } else { + button.setTextViewText(R.id.action0, label); + } int textColor = ContrastColorUtil.resolvePrimaryColor(mContext, buttonFillColor, mInNightMode); if (tombstone) { @@ -6392,7 +6479,14 @@ public class Notification implements Parcelable button.setColorStateList(R.id.action0, "setButtonBackground", ColorStateList.valueOf(buttonFillColor)); if (p.mCallStyleActions) { - button.setImageViewIcon(R.id.action0, action.getIcon()); + if (evenlyDividedCallStyleActionLayout()) { + if (CallStyle.DEBUG_NEW_ACTION_LAYOUT) { + Log.d(TAG, "new action layout enabled, gluing instead of setting icon"); + } + button.setIcon(R.id.action0, "glueIcon", action.getIcon()); + } else { + button.setImageViewIcon(R.id.action0, action.getIcon()); + } boolean priority = action.getExtras().getBoolean(CallStyle.KEY_ACTION_PRIORITY); button.setBoolean(R.id.action0, "setIsPriority", priority); int minWidthDimen = @@ -6587,6 +6681,23 @@ public class Notification implements Parcelable return getColors(p).getContrastColor(); } + /** + * Gets the foreground color of the small icon. If the notification is colorized, this + * is the primary text color, otherwise it's the contrast-adjusted app-provided color. + * @hide + */ + public @ColorInt int getSmallIconColor(boolean isHeader) { + return getColors(/* isHeader = */ isHeader).getContrastColor(); + } + + /** + * Gets the background color of the notification. + * @hide + */ + public @ColorInt int getBackgroundColor(boolean isHeader) { + return getColors(/* isHeader = */ isHeader).getBackgroundColor(); + } + /** @return the theme's accent color for colored UI elements. */ private @ColorInt int getPrimaryAccentColor(StandardTemplateParams p) { return getColors(p).getPrimaryAccentColor(); @@ -6619,23 +6730,29 @@ public class Notification implements Parcelable */ @NonNull public static Notification.Builder recoverBuilder(Context context, Notification n) { - // Re-create notification context so we can access app resources. - ApplicationInfo applicationInfo = n.extras.getParcelable( - EXTRA_BUILDER_APPLICATION_INFO, ApplicationInfo.class); - Context builderContext; - if (applicationInfo != null) { - try { - builderContext = context.createApplicationContext(applicationInfo, - Context.CONTEXT_RESTRICTED); - } catch (NameNotFoundException e) { - Log.e(TAG, "ApplicationInfo " + applicationInfo + " not found"); - builderContext = context; // try with our context + Trace.beginSection("Notification.Builder#recoverBuilder"); + + try { + // Re-create notification context so we can access app resources. + ApplicationInfo applicationInfo = n.extras.getParcelable( + EXTRA_BUILDER_APPLICATION_INFO, ApplicationInfo.class); + Context builderContext; + if (applicationInfo != null) { + try { + builderContext = context.createApplicationContext(applicationInfo, + Context.CONTEXT_RESTRICTED); + } catch (NameNotFoundException e) { + Log.e(TAG, "ApplicationInfo " + applicationInfo + " not found"); + builderContext = context; // try with our context + } + } else { + builderContext = context; // try with given context } - } else { - builderContext = context; // try with given context - } - return new Builder(builderContext, n); + return new Builder(builderContext, n); + } finally { + Trace.endSection(); + } } /** @@ -7703,11 +7820,12 @@ public class Notification implements Parcelable } else if (mPictureIcon.getType() == Icon.TYPE_BITMAP) { // If the icon contains a bitmap, use the old extra so that listeners which look // for that extra can still find the picture. Don't include the new extra in - // that case, to avoid duplicating data. + // that case, to avoid duplicating data. Leave the unused extra set to null to avoid + // crashing apps that came to expect it to be present but null. extras.putParcelable(EXTRA_PICTURE, mPictureIcon.getBitmap()); - extras.remove(EXTRA_PICTURE_ICON); + extras.putParcelable(EXTRA_PICTURE_ICON, null); } else { - extras.remove(EXTRA_PICTURE); + extras.putParcelable(EXTRA_PICTURE, null); extras.putParcelable(EXTRA_PICTURE_ICON, mPictureIcon); } } @@ -8501,6 +8619,8 @@ public class Notification implements Parcelable boolean isImportantConversation = mConversationType == CONVERSATION_TYPE_IMPORTANT; boolean isHeaderless = !isConversationLayout && isCollapsed; + //TODO (b/217799515): ensure mConversationTitle always returns the correct + // conversationTitle, probably set mConversationTitle = conversationTitle after this CharSequence conversationTitle = !TextUtils.isEmpty(super.mBigContentTitle) ? super.mBigContentTitle : mConversationTitle; @@ -9500,6 +9620,10 @@ public class Notification implements Parcelable * */ public static class CallStyle extends Style { + /** + * @hide + */ + public static final boolean DEBUG_NEW_ACTION_LAYOUT = true; /** * @hide @@ -10559,6 +10683,16 @@ public class Notification implements Parcelable } } + private void visitUris(@NonNull Consumer visitor) { + visitIconUri(visitor, getIcon()); + if (mPendingIntent != null) { + mPendingIntent.visitUris(visitor); + } + if (mDeleteIntent != null) { + mDeleteIntent.visitUris(visitor); + } + } + /** * Builder to construct a {@link BubbleMetadata} object. */ @@ -11757,6 +11891,9 @@ public class Notification implements Parcelable } private void visitUris(@NonNull Consumer visitor) { + if (mDisplayIntent != null) { + mDisplayIntent.visitUris(visitor); + } for (Action action : mActions) { action.visitUris(visitor); } @@ -11909,12 +12046,19 @@ public class Notification implements Parcelable /** * Returns the unread conversation conveyed by this notification. + * * @see #setUnreadConversation(UnreadConversation) */ public UnreadConversation getUnreadConversation() { return mUnreadConversation; } + private void visitUris(@NonNull Consumer visitor) { + if (mUnreadConversation != null) { + mUnreadConversation.visitUris(visitor); + } + } + /** * A class which holds the unread messages from a conversation. */ @@ -12066,7 +12210,16 @@ public class Notification implements Parcelable onRead, participants, b.getLong(KEY_TIMESTAMP)); } - }; + + private void visitUris(@NonNull Consumer visitor) { + if (mReadPendingIntent != null) { + mReadPendingIntent.visitUris(visitor); + } + if (mReplyPendingIntent != null) { + mReplyPendingIntent.visitUris(visitor); + } + } + } /** * Builder class for {@link CarExtender.UnreadConversation} objects. @@ -12389,6 +12542,15 @@ public class Notification implements Parcelable public boolean isSuppressShowOverApps() { return mSuppressShowOverApps; } + + private void visitUris(@NonNull Consumer visitor) { + if (mContentIntent != null) { + mContentIntent.visitUris(visitor); + } + if (mDeleteIntent != null) { + mDeleteIntent.visitUris(visitor); + } + } } /** diff --git a/core/java/android/app/NotificationChannel.java b/core/java/android/app/NotificationChannel.java index 15d692ab16739ccde3a8af724807eef10885eca0..ab5395e81aa328330d585108dd0b40096b681e2e 100644 --- a/core/java/android/app/NotificationChannel.java +++ b/core/java/android/app/NotificationChannel.java @@ -15,6 +15,7 @@ */ package android.app; +import android.annotation.FlaggedApi; import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.SystemApi; @@ -30,6 +31,9 @@ import android.media.RingtoneManager; import android.net.Uri; import android.os.Parcel; import android.os.Parcelable; +import android.os.VibrationEffect; +import android.os.vibrator.persistence.VibrationXmlParser; +import android.os.vibrator.persistence.VibrationXmlSerializer; import android.provider.Settings; import android.service.notification.NotificationListenerService; import android.text.TextUtils; @@ -49,6 +53,8 @@ import org.xmlpull.v1.XmlSerializer; import java.io.FileNotFoundException; import java.io.IOException; import java.io.PrintWriter; +import java.io.StringReader; +import java.io.StringWriter; import java.util.Arrays; import java.util.Objects; @@ -146,6 +152,7 @@ public final class NotificationChannel implements Parcelable { private static final String ATT_LIGHTS = "lights"; private static final String ATT_LIGHT_COLOR = "light_color"; private static final String ATT_VIBRATION = "vibration"; + private static final String ATT_VIBRATION_EFFECT = "vibration_effect"; private static final String ATT_VIBRATION_ENABLED = "vibration_enabled"; private static final String ATT_SOUND = "sound"; private static final String ATT_USAGE = "usage"; @@ -253,7 +260,8 @@ public final class NotificationChannel implements Parcelable { private boolean mSoundRestored = false; private boolean mLights; private int mLightColor = DEFAULT_LIGHT_COLOR; - private long[] mVibration; + private long[] mVibrationPattern; + private VibrationEffect mVibrationEffect; // Bitwise representation of fields that have been changed by the user, preventing the app from // making changes to these fields. private int mUserLockedFields; @@ -324,9 +332,13 @@ public final class NotificationChannel implements Parcelable { mSound = null; } mLights = in.readByte() != 0; - mVibration = in.createLongArray(); - if (mVibration != null && mVibration.length > MAX_VIBRATION_LENGTH) { - mVibration = Arrays.copyOf(mVibration, MAX_VIBRATION_LENGTH); + mVibrationPattern = in.createLongArray(); + if (mVibrationPattern != null && mVibrationPattern.length > MAX_VIBRATION_LENGTH) { + mVibrationPattern = Arrays.copyOf(mVibrationPattern, MAX_VIBRATION_LENGTH); + } + if (Flags.notificationChannelVibrationEffectApi()) { + mVibrationEffect = + in.readInt() != 0 ? VibrationEffect.CREATOR.createFromParcel(in) : null; } mUserLockedFields = in.readInt(); mUserVisibleTaskShown = in.readByte() != 0; @@ -381,7 +393,15 @@ public final class NotificationChannel implements Parcelable { dest.writeByte((byte) 0); } dest.writeByte(mLights ? (byte) 1 : (byte) 0); - dest.writeLongArray(mVibration); + dest.writeLongArray(mVibrationPattern); + if (Flags.notificationChannelVibrationEffectApi()) { + if (mVibrationEffect != null) { + dest.writeInt(1); + mVibrationEffect.writeToParcel(dest, /* flags= */ 0); + } else { + dest.writeInt(0); + } + } dest.writeInt(mUserLockedFields); dest.writeByte(mUserVisibleTaskShown ? (byte) 1 : (byte) 0); dest.writeByte(mVibrationEnabled ? (byte) 1 : (byte) 0); @@ -585,8 +605,8 @@ public final class NotificationChannel implements Parcelable { /** * Sets the vibration pattern for notifications posted to this channel. If the provided - * pattern is valid (non-null, non-empty), will enable vibration on this channel - * (equivalent to calling {@link #enableVibration(boolean)} with {@code true}). + * pattern is valid (non-null, non-empty with at least 1 non-zero value), will enable vibration + * on this channel (equivalent to calling {@link #enableVibration(boolean)} with {@code true}). * Otherwise, vibration will be disabled unless {@link #enableVibration(boolean)} is * used with {@code true}, in which case the default vibration will be used. * @@ -595,7 +615,56 @@ public final class NotificationChannel implements Parcelable { */ public void setVibrationPattern(long[] vibrationPattern) { this.mVibrationEnabled = vibrationPattern != null && vibrationPattern.length > 0; - this.mVibration = vibrationPattern; + this.mVibrationPattern = vibrationPattern; + if (Flags.notificationChannelVibrationEffectApi()) { + try { + this.mVibrationEffect = + VibrationEffect.createWaveform(vibrationPattern, /* repeat= */ -1); + } catch (IllegalArgumentException | NullPointerException e) { + this.mVibrationEffect = null; + } + } + } + + /** + * Sets a {@link VibrationEffect} for notifications posted to this channel. If the + * provided effect is non-null, will enable vibration on this channel (equivalent + * to calling {@link #enableVibration(boolean)} with {@code true}). Otherwise + * vibration will be disabled unless {@link #enableVibration(boolean)} is used with + * {@code true}, in which case the default vibration will be used. + * + *

The effect passed here will be returned from {@link #getVibrationEffect()}. + * If the provided {@link VibrationEffect} is an equivalent to a wave-form + * vibration pattern, the equivalent wave-form pattern will be returned from + * {@link #getVibrationPattern()}. + * + *

Note that some {@link VibrationEffect}s may not be playable on some devices. + * In cases where such an effect is passed here, vibration will still be enabled + * for the channel, but the default vibration will be used. Nonetheless, the + * provided effect will be stored and be returned from {@link #getVibrationEffect} + * calls, and could be used by the same channel on a different device, for example, + * in cases the user backs up and restores to a device that does have the ability + * to play the effect, where that effect will be used instead of the default. To + * avoid such issues that could make the vibration behavior of your notification + * channel differ among different devices, it's recommended that you avoid + * vibration effect primitives, as the support for them differs widely among + * devices (read {@link VibrationEffect.Composition} for more on vibration + * primitives). + * + *

Only modifiable before the channel is submitted to + * {@link NotificationManager#createNotificationChannel(NotificationChannel)}. + * + * @see #getVibrationEffect() + * @see Vibrator#areEffectsSupported(int...) + * @see Vibrator#arePrimitivesSupported(int...) + */ + @FlaggedApi(Flags.FLAG_NOTIFICATION_CHANNEL_VIBRATION_EFFECT_API) + public void setVibrationEffect(@Nullable VibrationEffect effect) { + this.mVibrationEnabled = effect != null; + this.mVibrationEffect = effect; + this.mVibrationPattern = + effect == null + ? null : effect.computeCreateWaveformOffOnTimingsOrNull(); } /** @@ -768,7 +837,35 @@ public final class NotificationChannel implements Parcelable { * vibration is not enabled ({@link #shouldVibrate()}). */ public long[] getVibrationPattern() { - return mVibration; + return mVibrationPattern; + } + + /** + * Returns the {@link VibrationEffect} for notifications posted to this channel. + * The returned effect is derived from either the effect provided in the + * {@link #setVibrationEffect(VibrationEffect)} method, or the equivalent vibration effect + * of the pattern set via the {@link #setVibrationPattern(long[])} method, based on setter + * method that was called last. + * + * The returned effect will be ignored in one of the following cases: + *

    + *
  • vibration is not enabled for the channel (i.e. {@link #shouldVibrate()} + * returns {@code false}). + *
  • the effect is not supported/playable by the device. In this case, if + * vibration is enabled for the channel, the default channel vibration will + * be used instead. + *
+ * + * @return the {@link VibrationEffect} set via {@link + * #setVibrationEffect(VibrationEffect)}, or the equivalent of the + * vibration set via {@link #setVibrationPattern(long[])}. + * + * @see VibrationEffect#createWaveform(long[], int) + */ + @FlaggedApi(Flags.FLAG_NOTIFICATION_CHANNEL_VIBRATION_EFFECT_API) + @Nullable + public VibrationEffect getVibrationEffect() { + return mVibrationEffect; } /** @@ -991,7 +1088,19 @@ public final class NotificationChannel implements Parcelable { enableLights(safeBool(parser, ATT_LIGHTS, false)); setLightColor(safeInt(parser, ATT_LIGHT_COLOR, DEFAULT_LIGHT_COLOR)); + // Set the pattern before the effect, so that we can properly handle cases where the pattern + // is null, but the effect is not null (i.e. for non-waveform VibrationEffects - the ones + // which cannot be represented as a vibration pattern). setVibrationPattern(safeLongArray(parser, ATT_VIBRATION, null)); + if (Flags.notificationChannelVibrationEffectApi()) { + VibrationEffect vibrationEffect = safeVibrationEffect(parser, ATT_VIBRATION_EFFECT); + if (vibrationEffect != null) { + // Restore the effect only if it is not null. This allows to avoid undoing a + // `setVibrationPattern` call above, if that was done with a non-null pattern + // (e.g. back up from a version that did not support `setVibrationEffect`). + setVibrationEffect(vibrationEffect); + } + } enableVibration(safeBool(parser, ATT_VIBRATION_ENABLED, false)); setShowBadge(safeBool(parser, ATT_SHOW_BADGE, false)); setDeleted(safeBool(parser, ATT_DELETED, false)); @@ -1180,6 +1289,9 @@ public final class NotificationChannel implements Parcelable { if (getVibrationPattern() != null) { out.attribute(null, ATT_VIBRATION, longArrayToString(getVibrationPattern())); } + if (getVibrationEffect() != null) { + out.attribute(null, ATT_VIBRATION_EFFECT, vibrationToString(getVibrationEffect())); + } if (getUserLockedFields() != 0) { out.attributeInt(null, ATT_USER_LOCKED, getUserLockedFields()); } @@ -1260,6 +1372,9 @@ public final class NotificationChannel implements Parcelable { record.put(ATT_USER_LOCKED, Integer.toString(getUserLockedFields())); record.put(ATT_FG_SERVICE_SHOWN, Boolean.toString(isUserVisibleTaskShown())); record.put(ATT_VIBRATION, longArrayToString(getVibrationPattern())); + if (getVibrationEffect() != null) { + record.put(ATT_VIBRATION_EFFECT, vibrationToString(getVibrationEffect())); + } record.put(ATT_SHOW_BADGE, Boolean.toString(canShowBadge())); record.put(ATT_DELETED, Boolean.toString(isDeleted())); record.put(ATT_DELETED_TIME_MS, Long.toString(getDeletedTimeMs())); @@ -1287,6 +1402,30 @@ public final class NotificationChannel implements Parcelable { return val == null ? null : Uri.parse(val); } + private static String vibrationToString(VibrationEffect effect) { + StringWriter writer = new StringWriter(); + try { + VibrationXmlSerializer.serialize( + effect, writer, VibrationXmlSerializer.FLAG_ALLOW_HIDDEN_APIS); + } catch (IOException e) { + Log.e(TAG, "Unable to serialize vibration: " + effect, e); + } + return writer.toString(); + } + + private static VibrationEffect safeVibrationEffect(TypedXmlPullParser parser, String att) { + final String val = parser.getAttributeValue(null, att); + if (val != null) { + try { + return VibrationXmlParser.parseVibrationEffect( + new StringReader(val), VibrationXmlParser.FLAG_ALLOW_HIDDEN_APIS); + } catch (IOException e) { + Log.e(TAG, "Unable to read serialized vibration effect", e); + } + } + return null; + } + private static int safeInt(TypedXmlPullParser parser, String att, int defValue) { return parser.getAttributeInt(null, att, defValue); } @@ -1361,7 +1500,8 @@ public final class NotificationChannel implements Parcelable { && Objects.equals(getName(), that.getName()) && Objects.equals(mDesc, that.mDesc) && Objects.equals(getSound(), that.getSound()) - && Arrays.equals(mVibration, that.mVibration) + && Arrays.equals(mVibrationPattern, that.mVibrationPattern) + && Objects.equals(getVibrationEffect(), that.getVibrationEffect()) && Objects.equals(getGroup(), that.getGroup()) && Objects.equals(getAudioAttributes(), that.getAudioAttributes()) && mImportanceLockedDefaultApp == that.mImportanceLockedDefaultApp @@ -1379,9 +1519,9 @@ public final class NotificationChannel implements Parcelable { getUserLockedFields(), isUserVisibleTaskShown(), mVibrationEnabled, mShowBadge, isDeleted(), getDeletedTimeMs(), getGroup(), getAudioAttributes(), isBlockable(), mAllowBubbles, - mImportanceLockedDefaultApp, mOriginalImportance, + mImportanceLockedDefaultApp, mOriginalImportance, getVibrationEffect(), mParentId, mConversationId, mDemoted, mImportantConvo); - result = 31 * result + Arrays.hashCode(mVibration); + result = 31 * result + Arrays.hashCode(mVibrationPattern); return result; } @@ -1413,7 +1553,9 @@ public final class NotificationChannel implements Parcelable { + ", mSound=" + mSound + ", mLights=" + mLights + ", mLightColor=" + mLightColor - + ", mVibration=" + Arrays.toString(mVibration) + + ", mVibrationPattern=" + Arrays.toString(mVibrationPattern) + + ", mVibrationEffect=" + + (mVibrationEffect == null ? "null" : mVibrationEffect.toString()) + ", mUserLockedFields=" + Integer.toHexString(mUserLockedFields) + ", mUserVisibleTaskShown=" + mUserVisibleTaskShown + ", mVibrationEnabled=" + mVibrationEnabled @@ -1448,8 +1590,8 @@ public final class NotificationChannel implements Parcelable { } proto.write(NotificationChannelProto.USE_LIGHTS, mLights); proto.write(NotificationChannelProto.LIGHT_COLOR, mLightColor); - if (mVibration != null) { - for (long v : mVibration) { + if (mVibrationPattern != null) { + for (long v : mVibrationPattern) { proto.write(NotificationChannelProto.VIBRATION, v); } } diff --git a/core/java/android/app/NotificationManager.java b/core/java/android/app/NotificationManager.java index d23b16d636a761fe15748418983e9259049fd6e9..d49a2542eed8bf3e296b9e81caffee7e23a5eed5 100644 --- a/core/java/android/app/NotificationManager.java +++ b/core/java/android/app/NotificationManager.java @@ -16,6 +16,7 @@ package android.app; +import android.annotation.CallbackExecutor; import android.annotation.FlaggedApi; import android.annotation.IntDef; import android.annotation.NonNull; @@ -69,6 +70,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; +import java.util.concurrent.Executor; /** * Class to notify the user of events that happen. This is how you tell @@ -378,6 +380,27 @@ public class NotificationManager { public static final String ACTION_NOTIFICATION_POLICY_CHANGED = "android.app.action.NOTIFICATION_POLICY_CHANGED"; + /** + * Intent that is broadcast when the state of {@link #getConsolidatedNotificationPolicy()} + * changes. + * + *

This broadcast is only sent to registered receivers and receivers in packages that have + * been granted Do Not Disturb access (see {@link #isNotificationPolicyAccessGranted()}). + */ + @FlaggedApi(Flags.FLAG_MODES_API) + @SdkConstant(SdkConstant.SdkConstantType.BROADCAST_INTENT_ACTION) + public static final String ACTION_CONSOLIDATED_NOTIFICATION_POLICY_CHANGED = + "android.app.action.CONSOLIDATED_NOTIFICATION_POLICY_CHANGED"; + + /** + * Extra for {@link #ACTION_NOTIFICATION_POLICY_CHANGED} and + * {@link #ACTION_CONSOLIDATED_NOTIFICATION_POLICY_CHANGED} containing the new + * {@link Policy} value. + */ + @FlaggedApi(Flags.FLAG_MODES_API) + public static final String EXTRA_NOTIFICATION_POLICY = + "android.app.extra.NOTIFICATION_POLICY"; + /** * Intent that is broadcast when the state of getCurrentInterruptionFilter() changes. * @@ -606,6 +629,9 @@ public class NotificationManager { */ public static int MAX_SERVICE_COMPONENT_NAME_LENGTH = 500; + private final Map + mCallNotificationEventCallbacks = new HashMap<>(); + @UnsupportedAppUsage private static INotificationManager sService; @@ -1184,14 +1210,20 @@ public class NotificationManager { */ @UnsupportedAppUsage public void setZenMode(int mode, Uri conditionId, String reason) { + setZenMode(mode, conditionId, reason, /* fromUser= */ false); + } + + /** @hide */ + public void setZenMode(int mode, Uri conditionId, String reason, boolean fromUser) { INotificationManager service = getService(); try { - service.setZenMode(mode, conditionId, reason); + service.setZenMode(mode, conditionId, reason, fromUser); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } + /** * @hide */ @@ -1325,9 +1357,19 @@ public class NotificationManager { * @return The id of the newly created rule; null if the rule could not be created. */ public String addAutomaticZenRule(AutomaticZenRule automaticZenRule) { + return addAutomaticZenRule(automaticZenRule, /* fromUser= */ false); + } + + /** @hide */ + @TestApi + @FlaggedApi(Flags.FLAG_MODES_API) + @NonNull + public String addAutomaticZenRule(@NonNull AutomaticZenRule automaticZenRule, + boolean fromUser) { INotificationManager service = getService(); try { - return service.addAutomaticZenRule(automaticZenRule, mContext.getPackageName()); + return service.addAutomaticZenRule(automaticZenRule, + mContext.getPackageName(), fromUser); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } @@ -1347,9 +1389,37 @@ public class NotificationManager { * @return Whether the rule was successfully updated. */ public boolean updateAutomaticZenRule(String id, AutomaticZenRule automaticZenRule) { + return updateAutomaticZenRule(id, automaticZenRule, /* fromUser= */ false); + } + + /** @hide */ + @TestApi + @FlaggedApi(Flags.FLAG_MODES_API) + public boolean updateAutomaticZenRule(@NonNull String id, + @NonNull AutomaticZenRule automaticZenRule, boolean fromUser) { + INotificationManager service = getService(); + try { + return service.updateAutomaticZenRule(id, automaticZenRule, fromUser); + } catch (RemoteException e) { + throw e.rethrowFromSystemServer(); + } + } + + /** + * Returns the current activation state of an {@link AutomaticZenRule}. + * + *

Returns {@link Condition#STATE_UNKNOWN} if the rule does not exist or the calling + * package doesn't have access to it. + * + * @param id The id of the rule + * @return the state of the rule. + */ + @FlaggedApi(Flags.FLAG_MODES_API) + @Condition.State + public int getAutomaticZenRuleState(@NonNull String id) { INotificationManager service = getService(); try { - return service.updateAutomaticZenRule(id, automaticZenRule); + return service.getAutomaticZenRuleState(id); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } @@ -1388,9 +1458,16 @@ public class NotificationManager { * @return Whether the rule was successfully deleted. */ public boolean removeAutomaticZenRule(String id) { + return removeAutomaticZenRule(id, /* fromUser= */ false); + } + + /** @hide */ + @TestApi + @FlaggedApi(Flags.FLAG_MODES_API) + public boolean removeAutomaticZenRule(@NonNull String id, boolean fromUser) { INotificationManager service = getService(); try { - return service.removeAutomaticZenRule(id); + return service.removeAutomaticZenRule(id, fromUser); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } @@ -1402,9 +1479,14 @@ public class NotificationManager { * @hide */ public boolean removeAutomaticZenRules(String packageName) { + return removeAutomaticZenRules(packageName, /* fromUser= */ false); + } + + /** @hide */ + public boolean removeAutomaticZenRules(String packageName, boolean fromUser) { INotificationManager service = getService(); try { - return service.removeAutomaticZenRules(packageName); + return service.removeAutomaticZenRules(packageName, fromUser); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } @@ -1685,10 +1767,15 @@ public class NotificationManager { */ // TODO(b/309457271): Update documentation with VANILLA_ICE_CREAM behavior. public void setNotificationPolicy(@NonNull Policy policy) { + setNotificationPolicy(policy, /* fromUser= */ false); + } + + /** @hide */ + public void setNotificationPolicy(@NonNull Policy policy, boolean fromUser) { checkRequired("policy", policy); INotificationManager service = getService(); try { - service.setNotificationPolicy(mContext.getOpPackageName(), policy); + service.setNotificationPolicy(mContext.getOpPackageName(), policy, fromUser); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } @@ -1709,6 +1796,20 @@ public class NotificationManager { @NonNull ComponentName listener, boolean granted) { setNotificationListenerAccessGranted(listener, granted, true); } + /** + * Gets the device-default notification policy as a ZenPolicy. + * @hide + */ + @TestApi + @FlaggedApi(Flags.FLAG_MODES_API) + public @NonNull ZenPolicy getDefaultZenPolicy() { + INotificationManager service = getService(); + try { + return service.getDefaultZenPolicy(); + } catch (RemoteException e) { + throw e.rethrowFromSystemServer(); + } + } /** * For apps targeting {@link Build.VERSION_CODES#VANILLA_ICE_CREAM} and above, the @@ -2685,9 +2786,16 @@ public class NotificationManager { */ // TODO(b/309457271): Update documentation with VANILLA_ICE_CREAM behavior. public final void setInterruptionFilter(@InterruptionFilter int interruptionFilter) { + setInterruptionFilter(interruptionFilter, /* fromUser= */ false); + } + + /** @hide */ + public final void setInterruptionFilter(@InterruptionFilter int interruptionFilter, + boolean fromUser) { final INotificationManager service = getService(); try { - service.setInterruptionFilter(mContext.getOpPackageName(), interruptionFilter); + service.setInterruptionFilter(mContext.getOpPackageName(), interruptionFilter, + fromUser); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } @@ -2765,4 +2873,126 @@ public class NotificationManager { default: return defValue; } } + + /** + * Callback to receive updates when a call notification has been posted or removed + * @hide + */ + @SystemApi + @FlaggedApi(android.service.notification.Flags.FLAG_CALLSTYLE_CALLBACK_API) + public interface CallNotificationEventListener { + /** + * Called when a call notification was posted by a package this listener + * has registered for. + * @param packageName package name of the app that posted the removed notification + */ + @FlaggedApi(android.service.notification.Flags.FLAG_CALLSTYLE_CALLBACK_API) + void onCallNotificationPosted(@NonNull String packageName, @NonNull UserHandle userHandle); + + /** + * Called when a call notification was removed by a package this listener + * has registered for. + * @param packageName package name of the app that removed notification + */ + @FlaggedApi(android.service.notification.Flags.FLAG_CALLSTYLE_CALLBACK_API) + void onCallNotificationRemoved(@NonNull String packageName, @NonNull UserHandle userHandle); + } + + private static class CallNotificationEventCallbackStub extends + ICallNotificationEventCallback.Stub { + final String mPackageName; + final UserHandle mUserHandle; + final Executor mExecutor; + final CallNotificationEventListener mListener; + + CallNotificationEventCallbackStub(@NonNull String packageName, + @NonNull UserHandle userHandle, @NonNull @CallbackExecutor Executor executor, + @NonNull CallNotificationEventListener listener) { + mPackageName = packageName; + mUserHandle = userHandle; + mExecutor = executor; + mListener = listener; + } + + @FlaggedApi(android.service.notification.Flags.FLAG_CALLSTYLE_CALLBACK_API) + @Override + public void onCallNotificationPosted(String packageName, UserHandle userHandle) { + mExecutor.execute(() -> mListener.onCallNotificationPosted(packageName, userHandle)); + } + + @FlaggedApi(android.service.notification.Flags.FLAG_CALLSTYLE_CALLBACK_API) + @Override + public void onCallNotificationRemoved(String packageName, UserHandle userHandle) { + mExecutor.execute(() -> mListener.onCallNotificationRemoved(packageName, userHandle)); + } + } + + /** + * Register a listener to be notified when a call notification is posted or removed + * for a specific package and user. + * + * @param packageName Which package to monitor + * @param userHandle Which user to monitor + * @param executor Callback will run on this executor + * @param listener Listener to register + * @hide + */ + @SystemApi + @RequiresPermission(allOf = { + android.Manifest.permission.INTERACT_ACROSS_USERS, + android.Manifest.permission.ACCESS_NOTIFICATIONS}) + @FlaggedApi(android.service.notification.Flags.FLAG_CALLSTYLE_CALLBACK_API) + public void registerCallNotificationEventListener(@NonNull String packageName, + @NonNull UserHandle userHandle, @NonNull @CallbackExecutor Executor executor, + @NonNull CallNotificationEventListener listener) { + checkRequired("packageName", packageName); + checkRequired("userHandle", userHandle); + checkRequired("executor", executor); + checkRequired("listener", listener); + INotificationManager service = getService(); + try { + synchronized (mCallNotificationEventCallbacks) { + CallNotificationEventCallbackStub callbackStub = + new CallNotificationEventCallbackStub(packageName, userHandle, + executor, listener); + mCallNotificationEventCallbacks.put(listener, callbackStub); + + service.registerCallNotificationEventListener(packageName, userHandle, + callbackStub); + } + } catch (RemoteException e) { + throw e.rethrowFromSystemServer(); + } + } + + /** + * Unregister a listener that was previously + * registered with {@link #registerCallNotificationEventListener} + * + * @param listener Listener to unregister + * @hide + */ + @SystemApi + @FlaggedApi(android.service.notification.Flags.FLAG_CALLSTYLE_CALLBACK_API) + @RequiresPermission(allOf = { + android.Manifest.permission.INTERACT_ACROSS_USERS, + android.Manifest.permission.ACCESS_NOTIFICATIONS}) + public void unregisterCallNotificationEventListener( + @NonNull CallNotificationEventListener listener) { + checkRequired("listener", listener); + INotificationManager service = getService(); + try { + synchronized (mCallNotificationEventCallbacks) { + CallNotificationEventCallbackStub callbackStub = + mCallNotificationEventCallbacks.remove(listener); + if (callbackStub != null) { + service.unregisterCallNotificationEventListener(callbackStub.mPackageName, + callbackStub.mUserHandle, callbackStub); + } + } + } catch (RemoteException e) { + throw e.rethrowFromSystemServer(); + } + } + } diff --git a/core/java/android/app/OWNERS b/core/java/android/app/OWNERS index 02f00ba006d88ab08ec42031f153883f7b0ec5e5..2e38c06a7479551eb97cea85a4a63aa92b86fb86 100644 --- a/core/java/android/app/OWNERS +++ b/core/java/android/app/OWNERS @@ -65,6 +65,7 @@ per-file DreamManager.java = file:/DREAM_MANAGER_OWNERS # GrammaticalInflectionManager per-file *GrammaticalInflection* = file:/services/core/java/com/android/server/grammaticalinflection/OWNERS +per-file grammatical_inflection_manager.aconfig = file:/services/core/java/com/android/server/grammaticalinflection/OWNERS # KeyguardManager per-file KeyguardManager.java = file:/services/core/java/com/android/server/locksettings/OWNERS @@ -118,5 +119,11 @@ per-file Window* = file:/services/core/java/com/android/server/wm/OWNERS per-file ConfigurationController.java = file:/services/core/java/com/android/server/wm/OWNERS per-file *ScreenCapture* = file:/services/core/java/com/android/server/wm/OWNERS +# Multitasking +per-file multitasking.aconfig = file:/services/core/java/com/android/server/wm/OWNERS +per-file multitasking.aconfig = file:/libs/WindowManager/Shell/OWNERS +per-file PictureInPicture* = file:/services/core/java/com/android/server/wm/OWNERS +per-file PictureInPicture* = file:/libs/WindowManager/Shell/OWNERS + # Zygote per-file *Zygote* = file:/ZYGOTE_OWNERS diff --git a/core/java/android/app/PendingIntent.java b/core/java/android/app/PendingIntent.java index 62209b0fd27db838b7f4ef2f6e706a6707dade9c..1ac08ac4cd24cdb8dda6e76668bcb8c6a5f5b92c 100644 --- a/core/java/android/app/PendingIntent.java +++ b/core/java/android/app/PendingIntent.java @@ -44,6 +44,8 @@ import android.content.IntentSender; import android.content.pm.PackageManager.ResolveInfoFlagsBits; import android.content.pm.ParceledListSlice; import android.content.pm.ResolveInfo; +import android.net.Uri; +import android.os.Binder; import android.os.Build; import android.os.Bundle; import android.os.Handler; @@ -69,6 +71,7 @@ import java.util.Collections; import java.util.List; import java.util.Objects; import java.util.concurrent.Executor; +import java.util.function.Consumer; /** * A description of an Intent and target action to perform with it. Instances @@ -176,6 +179,14 @@ public final class PendingIntent implements Parcelable { @Overridable public static final long BLOCK_MUTABLE_IMPLICIT_PENDING_INTENT = 236704164L; + /** + * Validate options passed in as bundle. + * @hide + */ + @ChangeId + @EnabledAfter(targetSdkVersion = Build.VERSION_CODES.UPSIDE_DOWN_CAKE) + public static final long PENDING_INTENT_OPTIONS_CHECK = 320664730L; + /** @hide */ @IntDef(flag = true, value = { @@ -1460,6 +1471,21 @@ public final class PendingIntent implements Parcelable { return sb.toString(); } + /** + * See {@link Intent#visitUris(Consumer)}. + * + * @hide + */ + public void visitUris(@NonNull Consumer visitor) { + if (android.app.Flags.visitRiskyUris()) { + Intent intent = Binder.withCleanCallingIdentity(this::getIntent); + + if (intent != null) { + intent.visitUris(visitor); + } + } + } + /** @hide */ public void dumpDebug(ProtoOutputStream proto, long fieldId) { final long token = proto.start(fieldId); diff --git a/core/java/android/app/PictureInPictureUiState.java b/core/java/android/app/PictureInPictureUiState.java index 32ce89ae98cf9f3ecf400c4f1b8bff9b231b4d4b..162953662d3921e07e8e333bf76428c578a4c60c 100644 --- a/core/java/android/app/PictureInPictureUiState.java +++ b/core/java/android/app/PictureInPictureUiState.java @@ -16,8 +16,10 @@ package android.app; +import android.annotation.FlaggedApi; import android.annotation.NonNull; import android.annotation.TestApi; +import android.content.res.Configuration; import android.os.Parcel; import android.os.Parcelable; @@ -28,23 +30,30 @@ import java.util.Objects; */ public final class PictureInPictureUiState implements Parcelable { - private boolean mIsStashed; + private final boolean mIsStashed; + private final boolean mIsTransitioningToPip; /** {@hide} */ PictureInPictureUiState(Parcel in) { mIsStashed = in.readBoolean(); + mIsTransitioningToPip = in.readBoolean(); } /** {@hide} */ @TestApi public PictureInPictureUiState(boolean isStashed) { + this(isStashed, false /* isEnteringPip */); + } + + private PictureInPictureUiState(boolean isStashed, boolean isTransitioningToPip) { mIsStashed = isStashed; + mIsTransitioningToPip = isTransitioningToPip; } /** * Returns whether Picture-in-Picture is stashed or not. A stashed PiP means it is only - * partially visible to the user, with some parts of it being off-screen. This is usually - * an UI state that is triggered by the user, such as flinging the PiP to the edge or letting go + * partially visible to the user, with some parts of it being off-screen. This is usually a + * UI state that is triggered by the user, such as flinging the PiP to the edge or letting go * of PiP while dragging partially off-screen. * * Developers can use this in conjunction with @@ -52,7 +61,7 @@ public final class PictureInPictureUiState implements Parcelable { * when the PiP stash state has changed. For example, if the state changed from {@code false} to * {@code true}, developers can choose to temporarily pause video playback if PiP is of video * content. Vice versa, if changing from {@code true} to {@code false} and video content is - * paused, developers can resumevideo playback. + * paused, developers can resume video playback. * * @see * Picture in Picture (PiP) improvements @@ -61,17 +70,44 @@ public final class PictureInPictureUiState implements Parcelable { return mIsStashed; } + /** + * Returns {@code true} if the app is going to enter Picture-in-Picture (PiP) mode. + * + * This state is associated with the entering PiP animation. When that animation starts, + * whether via auto enter PiP or calling + * {@link Activity#enterPictureInPictureMode(PictureInPictureParams)} explicitly, app can expect + * {@link Activity#onPictureInPictureUiStateChanged(PictureInPictureUiState)} callback with + * {@link #isTransitioningToPip()} to be {@code true} first, + * followed by {@link Activity#onPictureInPictureModeChanged(boolean, Configuration)} when it + * fully settles in PiP mode. + * + * When app receives the + * {@link Activity#onPictureInPictureUiStateChanged(PictureInPictureUiState)} callback with + * {@link #isTransitioningToPip()} being {@code true}, it's recommended to hide certain UI + * elements, such as video controls, to archive a clean entering PiP animation. + * + * In case an application wants to restore the previously hidden UI elements when exiting + * PiP, it is recommended to do that in + * {@code onPictureInPictureModeChanged(isInPictureInPictureMode=false)} callback rather + * than the beginning of exit PiP animation. + */ + @FlaggedApi(Flags.FLAG_ENABLE_PIP_UI_STATE_CALLBACK_ON_ENTERING) + public boolean isTransitioningToPip() { + return mIsTransitioningToPip; + } + @Override public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof PictureInPictureUiState)) return false; PictureInPictureUiState that = (PictureInPictureUiState) o; - return Objects.equals(mIsStashed, that.mIsStashed); + return mIsStashed == that.mIsStashed + && mIsTransitioningToPip == that.mIsTransitioningToPip; } @Override public int hashCode() { - return Objects.hash(mIsStashed); + return Objects.hash(mIsStashed, mIsTransitioningToPip); } @Override @@ -82,6 +118,7 @@ public final class PictureInPictureUiState implements Parcelable { @Override public void writeToParcel(@NonNull Parcel out, int flags) { out.writeBoolean(mIsStashed); + out.writeBoolean(mIsTransitioningToPip); } public static final @android.annotation.NonNull Creator CREATOR = @@ -93,4 +130,43 @@ public final class PictureInPictureUiState implements Parcelable { return new PictureInPictureUiState[size]; } }; + + /** + * Builder class for {@link PictureInPictureUiState}. + * @hide + */ + @FlaggedApi(Flags.FLAG_ENABLE_PIP_UI_STATE_CALLBACK_ON_ENTERING) + public static final class Builder { + private boolean mIsStashed; + private boolean mIsTransitioningToPip; + + /** Empty constructor. */ + public Builder() { + } + + /** + * Sets the {@link #mIsStashed} state. + * @return The same {@link Builder} instance. + */ + public Builder setStashed(boolean isStashed) { + mIsStashed = isStashed; + return this; + } + + /** + * Sets the {@link #mIsTransitioningToPip} state. + * @return The same {@link Builder} instance. + */ + public Builder setTransitioningToPip(boolean isEnteringPip) { + mIsTransitioningToPip = isEnteringPip; + return this; + } + + /** + * @return The constructed {@link PictureInPictureUiState} instance. + */ + public PictureInPictureUiState build() { + return new PictureInPictureUiState(mIsStashed, mIsTransitioningToPip); + } + } } diff --git a/core/java/android/app/QueuedWork.java b/core/java/android/app/QueuedWork.java index edf0a46b14339bf8de8bb4f1cb4657db27a37d81..60b61f35e591c442cb405f8972c4f5913f3b3c1a 100644 --- a/core/java/android/app/QueuedWork.java +++ b/core/java/android/app/QueuedWork.java @@ -27,6 +27,7 @@ import android.os.StrictMode; import android.util.Log; import com.android.internal.annotations.GuardedBy; +import com.android.internal.annotations.VisibleForTesting; import com.android.internal.util.ExponentiallyBucketedHistogram; import java.util.LinkedList; @@ -113,6 +114,36 @@ public class QueuedWork { } } + /** + * Tear down the handler. + */ + @VisibleForTesting + public static void resetHandler() { + synchronized (sLock) { + if (sHandler == null) { + return; + } + sHandler.getLooper().quitSafely(); + sHandler = null; + } + } + + /** + * Remove all Messages from the Handler with the given code. + * + * This method intentionally avoids creating the Handler if it doesn't + * already exist. + */ + private static void handlerRemoveMessages(int what) { + synchronized (sLock) { + if (sHandler == null) { + // Nothing to remove + return; + } + getHandler().removeMessages(what); + } + } + /** * Add a finisher-runnable to wait for {@link #queue asynchronously processed work}. * @@ -156,17 +187,13 @@ public class QueuedWork { long startTime = System.currentTimeMillis(); boolean hadMessages = false; - Handler handler = getHandler(); - synchronized (sLock) { - if (handler.hasMessages(QueuedWorkHandler.MSG_RUN)) { - // Delayed work will be processed at processPendingWork() below - handler.removeMessages(QueuedWorkHandler.MSG_RUN); - - if (DEBUG) { - hadMessages = true; - Log.d(LOG_TAG, "waiting"); - } + if (DEBUG) { + hadMessages = getHandler().hasMessages(QueuedWorkHandler.MSG_RUN); + } + handlerRemoveMessages(QueuedWorkHandler.MSG_RUN); + if (DEBUG && hadMessages) { + Log.d(LOG_TAG, "waiting"); } // We should not delay any work as this might delay the finishers @@ -257,7 +284,7 @@ public class QueuedWork { sWork = new LinkedList<>(); // Remove all msg-s as all work will be processed now - getHandler().removeMessages(QueuedWorkHandler.MSG_RUN); + handlerRemoveMessages(QueuedWorkHandler.MSG_RUN); } if (work.size() > 0) { diff --git a/core/java/android/app/ResourcesManager.java b/core/java/android/app/ResourcesManager.java index 24a51573b48a5f52fa68e10b252c1cc19bca22f7..6255260472120a6b624ed8f1a552af08f1b48793 100644 --- a/core/java/android/app/ResourcesManager.java +++ b/core/java/android/app/ResourcesManager.java @@ -550,7 +550,7 @@ public class ResourcesManager { @UnsupportedAppUsage protected @Nullable AssetManager createAssetManager(@NonNull final ResourcesKey key, @Nullable ApkAssetsSupplier apkSupplier) { - final AssetManager.Builder builder = new AssetManager.Builder(); + final AssetManager.Builder builder = new AssetManager.Builder().setNoInit(); final ArrayList apkKeys = extractApkKeys(key); for (int i = 0, n = apkKeys.size(); i < n; i++) { @@ -1555,7 +1555,7 @@ public class ResourcesManager { } else if(overlayPaths == null) { return ArrayUtils.cloneOrNull(resourceDirs); } else { - final ArrayList paths = new ArrayList<>(); + final var paths = new ArrayList(overlayPaths.length + resourceDirs.length); for (final String path : overlayPaths) { paths.add(path); } diff --git a/core/java/android/app/ResultInfo.java b/core/java/android/app/ResultInfo.java index 535f69f0e264fb371c88ad008ee963feb5820064..213c38c715431a6fadf1f2c808d18e904e790cdb 100644 --- a/core/java/android/app/ResultInfo.java +++ b/core/java/android/app/ResultInfo.java @@ -20,6 +20,7 @@ import android.annotation.Nullable; import android.compat.annotation.UnsupportedAppUsage; import android.content.Intent; import android.os.Build; +import android.os.IBinder; import android.os.Parcel; import android.os.Parcelable; @@ -36,14 +37,21 @@ public class ResultInfo implements Parcelable { public final int mResultCode; @UnsupportedAppUsage public final Intent mData; + public final IBinder mCallerToken; @UnsupportedAppUsage public ResultInfo(String resultWho, int requestCode, int resultCode, Intent data) { + this(resultWho, requestCode, resultCode, data, /* callerToken */ null); + } + + public ResultInfo(String resultWho, int requestCode, int resultCode, + Intent data, IBinder callerToken) { mResultWho = resultWho; mRequestCode = requestCode; mResultCode = resultCode; mData = data; + mCallerToken = callerToken; } public String toString() { @@ -65,6 +73,7 @@ public class ResultInfo implements Parcelable { } else { out.writeInt(0); } + out.writeStrongBinder(mCallerToken); } @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P, trackingBug = 115609023) @@ -88,6 +97,7 @@ public class ResultInfo implements Parcelable { } else { mData = null; } + mCallerToken = in.readStrongBinder(); } @Override @@ -100,7 +110,8 @@ public class ResultInfo implements Parcelable { : mData.filterEquals(other.mData); return intentsEqual && Objects.equals(mResultWho, other.mResultWho) && mResultCode == other.mResultCode - && mRequestCode == other.mRequestCode; + && mRequestCode == other.mRequestCode + && mCallerToken == other.mCallerToken; } @Override @@ -112,6 +123,7 @@ public class ResultInfo implements Parcelable { if (mData != null) { result = 31 * result + mData.filterHashCode(); } + result = 31 * result + Objects.hashCode(mCallerToken); return result; } } diff --git a/core/java/android/app/Service.java b/core/java/android/app/Service.java index a1554572c7df4f0c65c6a3dc8eba828bd87333e3..fe8655c13562896209c01198117a085de6f85513 100644 --- a/core/java/android/app/Service.java +++ b/core/java/android/app/Service.java @@ -20,6 +20,7 @@ import static android.content.pm.ServiceInfo.FOREGROUND_SERVICE_TYPE_MANIFEST; import static android.os.Trace.TRACE_TAG_ACTIVITY_MANAGER; import static android.text.TextUtils.formatSimple; +import android.annotation.FlaggedApi; import android.annotation.IntDef; import android.annotation.NonNull; import android.annotation.Nullable; @@ -1161,4 +1162,38 @@ public abstract class Service extends ContextWrapper implements ComponentCallbac */ public void onTimeout(int startId) { } + + /** @hide */ + public final void callOnTimeLimitExceeded(int startId, @ForegroundServiceType int fgsType) { + // Note, because all the service callbacks (and other similar callbacks, e.g. activity + // callbacks) are delivered using the main handler, it's possible the service is already + // stopped when before this method is called, so we do a double check here. + if (mToken == null) { + Log.w(TAG, "Service already destroyed, skipping onTimeLimitExceeded()"); + return; + } + try { + if (!mActivityManager.hasServiceTimeLimitExceeded( + new ComponentName(this, mClassName), mToken)) { + Log.w(TAG, "Service no longer relevant, skipping onTimeLimitExceeded()"); + return; + } + } catch (RemoteException ex) { + } + if (Flags.introduceNewServiceOntimeoutCallback()) { + onTimeout(startId, fgsType); + } + } + + /** + * Callback called when a particular foreground service type has timed out. + * + * @param startId the startId passed to {@link #onStartCommand(Intent, int, int)} when + * the service started. + * @param fgsType the {@link ServiceInfo.ForegroundServiceType foreground service type} which + * caused the timeout. + */ + @FlaggedApi(Flags.FLAG_INTRODUCE_NEW_SERVICE_ONTIMEOUT_CALLBACK) + public void onTimeout(int startId, @ForegroundServiceType int fgsType) { + } } diff --git a/core/java/android/app/StatusBarManager.aidl b/core/java/android/app/StatusBarManager.aidl new file mode 100644 index 0000000000000000000000000000000000000000..687678c4ea8ddddf5a49dab08f184748d126e11d --- /dev/null +++ b/core/java/android/app/StatusBarManager.aidl @@ -0,0 +1,19 @@ +/** + * Copyright (c) 2024, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.app; + +parcelable StatusBarManager.DisableInfo; \ No newline at end of file diff --git a/core/java/android/app/StatusBarManager.java b/core/java/android/app/StatusBarManager.java index 385fd509757baedfc0c0b00c286bb992ed3f1ea6..301fef877d6c5cd5b9e6672ce66cb7aab80c8f44 100644 --- a/core/java/android/app/StatusBarManager.java +++ b/core/java/android/app/StatusBarManager.java @@ -21,6 +21,7 @@ import android.annotation.IntDef; import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.RequiresPermission; +import android.annotation.SuppressLint; import android.annotation.SystemApi; import android.annotation.SystemService; import android.annotation.TestApi; @@ -43,6 +44,7 @@ import android.os.Binder; import android.os.Build; import android.os.Bundle; import android.os.IBinder; +import android.os.Parcelable; import android.os.RemoteException; import android.os.ServiceManager; import android.os.UserHandle; @@ -57,6 +59,7 @@ import com.android.internal.statusbar.IAddTileResultCallback; import com.android.internal.statusbar.IStatusBarService; import com.android.internal.statusbar.IUndoMediaTransferCallback; import com.android.internal.statusbar.NotificationVisibility; +import com.android.internal.util.DataClass; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; @@ -240,6 +243,23 @@ public class StatusBarManager { /** @hide */ public static final int CAMERA_LAUNCH_SOURCE_QUICK_AFFORDANCE = 3; + /** + * Broadcast action: sent to apps that hold the status bar permission when + * KeyguardManager#setPrivateNotificationsAllowed() is changed. + * + * Extras: #EXTRA_KM_PRIVATE_NOTIFS_ALLOWED + * @hide + */ + public static final String ACTION_KEYGUARD_PRIVATE_NOTIFICATIONS_CHANGED + = "android.app.action.KEYGUARD_PRIVATE_NOTIFICATIONS_CHANGED"; + + /** + * Boolean, the latest value of KeyguardManager#getPrivateNotificationsAllowed() + * @hide + */ + public static final String EXTRA_KM_PRIVATE_NOTIFS_ALLOWED + = "android.app.extra.KM_PRIVATE_NOTIFS_ALLOWED"; + /** * Session flag for {@link #registerSessionListener} indicating the listener * is interested in sessions on the keygaurd. @@ -612,38 +632,49 @@ public class StatusBarManager { } /** - * Disable some features in the status bar. Pass the bitwise-or of the DISABLE_* flags. - * To re-enable everything, pass {@link #DISABLE_NONE}. + * @deprecated + * Disable some features in the status bar. Pass the bitwise-or of the DISABLE_* + * flags. To re-enable everything, pass {@link #DISABLE_NONE}. + * + * This method is deprecated and callers should use + * {@link #requestDisabledComponent(DisableInfo, String)} * * @hide */ + @Deprecated @UnsupportedAppUsage public void disable(int what) { - try { - final int userId = Binder.getCallingUserHandle().getIdentifier(); - final IStatusBarService svc = getService(); - if (svc != null) { - svc.disableForUser(what, mToken, mContext.getPackageName(), userId); - } - } catch (RemoteException ex) { - throw ex.rethrowFromSystemServer(); - } + requestDisabledComponent(new DisableInfo(what & DISABLE_MASK, what & DISABLE2_MASK), null); } /** - * Disable additional status bar features. Pass the bitwise-or of the DISABLE2_* flags. - * To re-enable everything, pass {@link #DISABLE_NONE}. + * @deprecated + * Disable some features in the status bar. Pass the bitwise-or of the DISABLE_2* + * flags. To re-enable everything, pass {@link #DISABLE2_NONE}. + * + * This method is deprecated and callers should use + * {@link #requestDisabledComponent(DisableInfo, String)} * - * Warning: Only pass DISABLE2_* flags into this function, do not use DISABLE_* flags. + * @hide + */ + @Deprecated + @UnsupportedAppUsage + public void disable2(int what) { + requestDisabledComponent(new DisableInfo(what & DISABLE_MASK, what & DISABLE2_MASK), null); + } + + /** + * Disable some features in the status bar. Pass a DisableInfo object with the required flags. * * @hide */ - public void disable2(@Disable2Flags int what) { + @UnsupportedAppUsage + public void requestDisabledComponent(DisableInfo disableInfo, String reason) { try { final int userId = Binder.getCallingUserHandle().getIdentifier(); final IStatusBarService svc = getService(); if (svc != null) { - svc.disable2ForUser(what, mToken, mContext.getPackageName(), userId); + svc.disableForUser(disableInfo, mToken, mContext.getPackageName(), userId, reason); } } catch (RemoteException ex) { throw ex.rethrowFromSystemServer(); @@ -871,18 +902,9 @@ public class StatusBarManager { @SystemApi @RequiresPermission(android.Manifest.permission.STATUS_BAR) public void setDisabledForSetup(boolean disabled) { - try { - final int userId = Binder.getCallingUserHandle().getIdentifier(); - final IStatusBarService svc = getService(); - if (svc != null) { - svc.disableForUser(disabled ? DEFAULT_SETUP_DISABLE_FLAGS : DISABLE_NONE, - mToken, mContext.getPackageName(), userId); - svc.disable2ForUser(disabled ? DEFAULT_SETUP_DISABLE2_FLAGS : DISABLE2_NONE, - mToken, mContext.getPackageName(), userId); - } - } catch (RemoteException ex) { - throw ex.rethrowFromSystemServer(); - } + int flags1 = disabled ? DEFAULT_SETUP_DISABLE_FLAGS : DISABLE_NONE; + DisableInfo info = new DisableInfo(flags1, DISABLE2_NONE); + requestDisabledComponent(info, "setDisabledForSetup"); } /** @@ -897,16 +919,9 @@ public class StatusBarManager { @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES) @RequiresPermission(android.Manifest.permission.STATUS_BAR) public void setExpansionDisabledForSimNetworkLock(boolean disabled) { - try { - final int userId = Binder.getCallingUserHandle().getIdentifier(); - final IStatusBarService svc = getService(); - if (svc != null) { - svc.disableForUser(disabled ? DEFAULT_SIM_LOCKED_DISABLED_FLAGS : DISABLE_NONE, - mToken, mContext.getPackageName(), userId); - } - } catch (RemoteException ex) { - throw ex.rethrowFromSystemServer(); - } + int flags1 = disabled ? DEFAULT_SIM_LOCKED_DISABLED_FLAGS : DISABLE_NONE; + DisableInfo info = new DisableInfo(flags1, DISABLE2_NONE); + requestDisabledComponent(info, "setExpansionDisabledForSimNetworkLock"); } /** @@ -1298,33 +1313,75 @@ public class StatusBarManager { * @hide */ @SystemApi - public static final class DisableInfo { + @DataClass + public static final class DisableInfo implements Parcelable { + /** + * @hide + */ private boolean mStatusBarExpansion; + /** + * @hide + */ private boolean mNavigateHome; + /** + * @hide + */ private boolean mNotificationPeeking; + /** + * @hide + */ private boolean mRecents; + /** + * @hide + */ + private boolean mBack; + /** + * @hide + */ private boolean mSearch; + /** + * @hide + */ private boolean mSystemIcons; + /** + * @hide + */ private boolean mClock; + /** + * @hide + */ private boolean mNotificationIcons; + /** + * @hide + */ private boolean mRotationSuggestion; + /** + * @hide + */ + private boolean mNotificationTicker; /** @hide */ + @SuppressLint("UnflaggedApi") public DisableInfo(int flags1, int flags2) { mStatusBarExpansion = (flags1 & DISABLE_EXPAND) != 0; mNavigateHome = (flags1 & DISABLE_HOME) != 0; mNotificationPeeking = (flags1 & DISABLE_NOTIFICATION_ALERTS) != 0; mRecents = (flags1 & DISABLE_RECENT) != 0; + mBack = (flags1 & DISABLE_BACK) != 0; mSearch = (flags1 & DISABLE_SEARCH) != 0; mSystemIcons = (flags1 & DISABLE_SYSTEM_INFO) != 0; mClock = (flags1 & DISABLE_CLOCK) != 0; mNotificationIcons = (flags1 & DISABLE_NOTIFICATION_ICONS) != 0; + mNotificationTicker = (flags1 & DISABLE_NOTIFICATION_TICKER) != 0; mRotationSuggestion = (flags2 & DISABLE2_ROTATE_SUGGESTIONS) != 0; } /** @hide */ - public DisableInfo() {} + @SuppressLint("UnflaggedApi") + public DisableInfo() { + setEnableAll(); + } /** * @return {@code true} if expanding the notification shade is disabled @@ -1352,7 +1409,7 @@ public class StatusBarManager { } /** * @hide */ - public void setNagivationHomeDisabled(boolean disabled) { + public void setNavigationHomeDisabled(boolean disabled) { mNavigateHome = disabled; } @@ -1386,6 +1443,20 @@ public class StatusBarManager { mRecents = disabled; } + /** + * @return {@code true} if mBack is disabled + * + * @hide + */ + public boolean isBackDisabled() { + return mBack; + } + + /** @hide */ + public void setBackDisabled(boolean disabled) { + mBack = disabled; + } + /** * @return {@code true} if mSearch is disabled * @@ -1443,6 +1514,20 @@ public class StatusBarManager { mNotificationIcons = disabled; } + /** + * @return {@code true} if notification ticker is disabled + * + * @hide + */ + public boolean isNotificationTickerDisabled() { + return mNotificationTicker; + } + + /** * @hide */ + public void setNotificationTickerDisabled(boolean disabled) { + mNotificationTicker = disabled; + } + /** * Returns whether the rotation suggestion is disabled. * @@ -1453,6 +1538,11 @@ public class StatusBarManager { return mRotationSuggestion; } + /** * @hide */ + public void setRotationSuggestionDisabled(boolean disabled) { + mNotificationIcons = disabled; + } + /** * @return {@code true} if no components are disabled (default state) * @hide @@ -1460,8 +1550,8 @@ public class StatusBarManager { @SystemApi public boolean areAllComponentsEnabled() { return !mStatusBarExpansion && !mNavigateHome && !mNotificationPeeking && !mRecents - && !mSearch && !mSystemIcons && !mClock && !mNotificationIcons - && !mRotationSuggestion; + && !mBack && !mSearch && !mSystemIcons && !mClock && !mNotificationIcons + && !mNotificationTicker && !mRotationSuggestion; } /** @hide */ @@ -1470,10 +1560,12 @@ public class StatusBarManager { mNavigateHome = false; mNotificationPeeking = false; mRecents = false; + mBack = false; mSearch = false; mSystemIcons = false; mClock = false; mNotificationIcons = false; + mNotificationTicker = false; mRotationSuggestion = false; } @@ -1483,9 +1575,9 @@ public class StatusBarManager { * @hide */ public boolean areAllComponentsDisabled() { - return mStatusBarExpansion && mNavigateHome && mNotificationPeeking - && mRecents && mSearch && mSystemIcons && mClock && mNotificationIcons - && mRotationSuggestion; + return mStatusBarExpansion && mNavigateHome && mNotificationPeeking && mRecents && mBack + && mSearch && mSystemIcons && mClock && mNotificationIcons + && mNotificationTicker && mRotationSuggestion; } /** @hide */ @@ -1494,10 +1586,12 @@ public class StatusBarManager { mNavigateHome = true; mNotificationPeeking = true; mRecents = true; + mBack = true; mSearch = true; mSystemIcons = true; mClock = true; mNotificationIcons = true; + mNotificationTicker = true; mRotationSuggestion = true; } @@ -1505,16 +1599,19 @@ public class StatusBarManager { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("DisableInfo: "); + + sb.append("Disable Info: "); sb.append(" mStatusBarExpansion=").append(mStatusBarExpansion ? "disabled" : "enabled"); sb.append(" mNavigateHome=").append(mNavigateHome ? "disabled" : "enabled"); sb.append(" mNotificationPeeking=") .append(mNotificationPeeking ? "disabled" : "enabled"); sb.append(" mRecents=").append(mRecents ? "disabled" : "enabled"); + sb.append(" mBack=").append(mBack ? "disabled" : "enabled"); sb.append(" mSearch=").append(mSearch ? "disabled" : "enabled"); sb.append(" mSystemIcons=").append(mSystemIcons ? "disabled" : "enabled"); sb.append(" mClock=").append(mClock ? "disabled" : "enabled"); sb.append(" mNotificationIcons=").append(mNotificationIcons ? "disabled" : "enabled"); + sb.append(" mNotificationTicker=").append(mNotificationTicker ? "disabled" : "enabled"); sb.append(" mRotationSuggestion=").append(mRotationSuggestion ? "disabled" : "enabled"); return sb.toString(); @@ -1522,7 +1619,7 @@ public class StatusBarManager { } /** - * Convert a DisableInfo to equivalent flags + * Convert a DisableInfo to equivalent flags. * @return a pair of equivalent disable flags * * @hide @@ -1535,14 +1632,278 @@ public class StatusBarManager { if (mNavigateHome) disable1 |= DISABLE_HOME; if (mNotificationPeeking) disable1 |= DISABLE_NOTIFICATION_ALERTS; if (mRecents) disable1 |= DISABLE_RECENT; + if (mBack) disable1 |= DISABLE_BACK; if (mSearch) disable1 |= DISABLE_SEARCH; if (mSystemIcons) disable1 |= DISABLE_SYSTEM_INFO; if (mClock) disable1 |= DISABLE_CLOCK; if (mNotificationIcons) disable1 |= DISABLE_NOTIFICATION_ICONS; + if (mNotificationTicker) disable1 |= DISABLE_NOTIFICATION_TICKER; if (mRotationSuggestion) disable2 |= DISABLE2_ROTATE_SUGGESTIONS; return new Pair(disable1, disable2); } + + + + // Code below generated by codegen v1.0.23. + // + // DO NOT MODIFY! + // CHECKSTYLE:OFF Generated code + // + // To regenerate run: + // $ codegen $ANDROID_BUILD_TOP/frameworks/base/core/java/android/app/StatusBarManager.java + // + // To exclude the generated code from IntelliJ auto-formatting enable (one-time): + // Settings > Editor > Code Style > Formatter Control + //@formatter:off + + + /** + * Creates a new DisableInfo. + * @hide + */ + @DataClass.Generated.Member + public DisableInfo( + boolean statusBarExpansion, + boolean navigateHome, + boolean notificationPeeking, + boolean recents, + boolean back, + boolean search, + boolean systemIcons, + boolean clock, + boolean notificationIcons, + boolean rotationSuggestion, + boolean notificationTicker) { + this.mStatusBarExpansion = statusBarExpansion; + this.mNavigateHome = navigateHome; + this.mNotificationPeeking = notificationPeeking; + this.mRecents = recents; + this.mBack = back; + this.mSearch = search; + this.mSystemIcons = systemIcons; + this.mClock = clock; + this.mNotificationIcons = notificationIcons; + this.mRotationSuggestion = rotationSuggestion; + this.mNotificationTicker = notificationTicker; + + // onConstructed(); // You can define this method to get a callback + } + + /** + * @hide + */ + @DataClass.Generated.Member + public boolean isStatusBarExpansion() { + return mStatusBarExpansion; + } + + /** + * @hide + */ + @DataClass.Generated.Member + public boolean isNavigateHome() { + return mNavigateHome; + } + + /** + * @hide + */ + @DataClass.Generated.Member + public boolean isNotificationPeeking() { + return mNotificationPeeking; + } + + /** + * @hide + */ + @DataClass.Generated.Member + public boolean isRecents() { + return mRecents; + } + + /** + * @hide + */ + @DataClass.Generated.Member + public boolean isBack() { + return mBack; + } + + /** + * @hide + */ + @DataClass.Generated.Member + public boolean isSearch() { + return mSearch; + } + + /** + * @hide + */ + @DataClass.Generated.Member + public boolean isSystemIcons() { + return mSystemIcons; + } + + /** + * @hide + */ + @DataClass.Generated.Member + public boolean isClock() { + return mClock; + } + + /** + * @hide + */ + @DataClass.Generated.Member + public boolean isNotificationIcons() { + return mNotificationIcons; + } + + /** + * @hide + */ + @DataClass.Generated.Member + public boolean isRotationSuggestion() { + return mRotationSuggestion; + } + + /** + * @hide + */ + @DataClass.Generated.Member + public boolean isNotificationTicker() { + return mNotificationTicker; + } + + /** + * @hide + */ + @SuppressLint("UnflaggedApi") + @Override + @DataClass.Generated.Member + public void writeToParcel(@NonNull android.os.Parcel dest, int flags) { + // You can override field parcelling by defining methods like: + // void parcelFieldName(Parcel dest, int flags) { ... } + + int flg = 0; + if (mStatusBarExpansion) flg |= 0x1; + if (mNavigateHome) flg |= 0x2; + if (mNotificationPeeking) flg |= 0x4; + if (mRecents) flg |= 0x8; + if (mBack) flg |= 0x10; + if (mSearch) flg |= 0x20; + if (mSystemIcons) flg |= 0x40; + if (mClock) flg |= 0x80; + if (mNotificationIcons) flg |= 0x100; + if (mRotationSuggestion) flg |= 0x200; + if (mNotificationTicker) flg |= 0x400; + dest.writeInt(flg); + } + + /** + * @hide + */ + @SuppressLint("UnflaggedApi") + @Override + @DataClass.Generated.Member + public int describeContents() { return 0; } + + /** @hide */ + @SuppressWarnings({"unchecked", "RedundantCast"}) + @DataClass.Generated.Member + /* package-private */ DisableInfo(@NonNull android.os.Parcel in) { + // You can override field unparcelling by defining methods like: + // static FieldType unparcelFieldName(Parcel in) { ... } + + int flg = in.readInt(); + boolean statusBarExpansion = (flg & 0x1) != 0; + boolean navigateHome = (flg & 0x2) != 0; + boolean notificationPeeking = (flg & 0x4) != 0; + boolean recents = (flg & 0x8) != 0; + boolean back = (flg & 0x10) != 0; + boolean search = (flg & 0x20) != 0; + boolean systemIcons = (flg & 0x40) != 0; + boolean clock = (flg & 0x80) != 0; + boolean notificationIcons = (flg & 0x100) != 0; + boolean rotationSuggestion = (flg & 0x200) != 0; + boolean notificationTicker = (flg & 0x400) != 0; + + this.mStatusBarExpansion = statusBarExpansion; + this.mNavigateHome = navigateHome; + this.mNotificationPeeking = notificationPeeking; + this.mRecents = recents; + this.mBack = back; + this.mSearch = search; + this.mSystemIcons = systemIcons; + this.mClock = clock; + this.mNotificationIcons = notificationIcons; + this.mRotationSuggestion = rotationSuggestion; + this.mNotificationTicker = notificationTicker; + + // onConstructed(); // You can define this method to get a callback + } + + @DataClass.Generated.Member + public static final @NonNull Parcelable.Creator CREATOR + = new Parcelable.Creator() { + @Override + public DisableInfo[] newArray(int size) { + return new DisableInfo[size]; + } + + @Override + public DisableInfo createFromParcel(@NonNull android.os.Parcel in) { + return new DisableInfo(in); + } + }; + + @DataClass.Generated( + time = 1708625947132L, + codegenVersion = "1.0.23", + sourceFile = "frameworks/base/core/java/android/app/StatusBarManager.java", + inputSignatures = "private boolean mStatusBarExpansion\nprivate boolean " + + "mNavigateHome\nprivate boolean mNotificationPeeking\nprivate " + + "boolean mRecents\nprivate boolean mBack\nprivate boolean mSearch\n" + + "private boolean mSystemIcons\nprivate boolean mClock\nprivate " + + "boolean mNotificationIcons\nprivate boolean mRotationSuggestion\n" + + "private boolean mNotificationTicker\npublic " + + "@android.annotation.SystemApi boolean isStatusBarExpansionDisabled()\n" + + "public void setStatusBarExpansionDisabled(boolean)\npublic " + + "@android.annotation.SystemApi boolean isNavigateToHomeDisabled()\npublic" + + " void setNavigationHomeDisabled(boolean)\npublic " + + "@android.annotation.SystemApi boolean isNotificationPeekingDisabled()" + + "\npublic void setNotificationPeekingDisabled(boolean)\npublic " + + "@android.annotation.SystemApi boolean isRecentsDisabled()\npublic " + + "void setRecentsDisabled(boolean)\npublic boolean isBackDisabled()" + + "\npublic void setBackDisabled(boolean)\npublic " + + "@android.annotation.SystemApi boolean isSearchDisabled()\npublic " + + "void setSearchDisabled(boolean)\npublic boolean " + + "areSystemIconsDisabled()\npublic void setSystemIconsDisabled(boolean)\n" + + "public boolean isClockDisabled()\npublic " + + "void setClockDisabled(boolean)\npublic boolean " + + "areNotificationIconsDisabled()\npublic void " + + "setNotificationIconsDisabled(boolean)\npublic boolean " + + "isNotificationTickerDisabled()\npublic void " + + "setNotificationTickerDisabled(boolean)\npublic " + + "@android.annotation.TestApi boolean isRotationSuggestionDisabled()\n" + + "public void setRotationSuggestionDisabled(boolean)\npublic " + + "@android.annotation.SystemApi boolean areAllComponentsEnabled()\npublic" + + " void setEnableAll()\npublic boolean areAllComponentsDisabled()\n" + + "public void setDisableAll()\npublic @android.annotation.NonNull " + + "@java.lang.Override java.lang.String toString()\npublic " + + "android.util.Pair toFlags()\n" + + "class DisableInfo extends java.lang.Object implements " + + "[android.os.Parcelable]\n@com.android.internal.util.DataClass") + @Deprecated + private void __metadata() {} + + + //@formatter:on + // End of generated code + } /** diff --git a/core/java/android/app/SystemServiceRegistry.java b/core/java/android/app/SystemServiceRegistry.java index 9cf732abb86a3bf1189af0cfc5635784818778ac..d01626e17f2d4f32a2bfe01e27db71432d1a2a2a 100644 --- a/core/java/android/app/SystemServiceRegistry.java +++ b/core/java/android/app/SystemServiceRegistry.java @@ -19,6 +19,7 @@ package android.app; import android.accounts.AccountManager; import android.accounts.IAccountManager; import android.adservices.AdServicesFrameworkInitializer; +import android.annotation.FlaggedApi; import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.SystemApi; @@ -31,6 +32,7 @@ import android.app.appsearch.AppSearchManagerFrameworkInitializer; import android.app.blob.BlobStoreManagerFrameworkInitializer; import android.app.contentsuggestions.ContentSuggestionsManager; import android.app.contentsuggestions.IContentSuggestionsManager; +import android.app.ecm.EnhancedConfirmationFrameworkInitializer; import android.app.job.JobSchedulerFrameworkInitializer; import android.app.people.PeopleManager; import android.app.prediction.AppPredictionManager; @@ -184,6 +186,7 @@ import android.os.IncidentManager; import android.os.PerformanceHintManager; import android.os.PermissionEnforcer; import android.os.PowerManager; +import android.os.ProfilingFrameworkInitializer; import android.os.RecoverySystem; import android.os.SecurityStateManager; import android.os.ServiceManager; @@ -209,6 +212,7 @@ import android.permission.PermissionControllerManager; import android.permission.PermissionManager; import android.print.IPrintManager; import android.print.PrintManager; +import android.provider.E2eeContactKeysManager; import android.safetycenter.SafetyCenterFrameworkInitializer; import android.scheduling.SchedulingFrameworkInitializer; import android.security.FileIntegrityManager; @@ -247,6 +251,7 @@ import android.view.textservice.TextServicesManager; import android.view.translation.ITranslationManager; import android.view.translation.TranslationManager; import android.view.translation.UiTranslationManager; +import android.webkit.WebViewBootstrapFrameworkInitializer; import com.android.internal.R; import com.android.internal.app.IAppOpsService; @@ -1603,6 +1608,31 @@ public final class SystemServiceRegistry { } }); + registerService(Context.CONTACT_KEYS_SERVICE, E2eeContactKeysManager.class, + new CachedServiceFetcher() { + @Override + public E2eeContactKeysManager createService(ContextImpl ctx) + throws ServiceNotFoundException { + if (!android.provider.Flags.userKeys()) { + throw new ServiceNotFoundException( + "ContactKeysManager is not supported"); + } + return new E2eeContactKeysManager(ctx); + }}); + + // DO NOT do a flag check like this unless the flag is read-only. + // (because this code is executed during preload in zygote.) + // If the flag is mutable, the check should be inside CachedServiceFetcher. + if (Flags.bicClient()) { + registerService(Context.BACKGROUND_INSTALL_CONTROL_SERVICE, + BackgroundInstallControlManager.class, + new CachedServiceFetcher() { + @Override + public BackgroundInstallControlManager createService(ContextImpl ctx) { + return new BackgroundInstallControlManager(ctx); + } + }); + } sInitializing = true; try { // Note: the following functions need to be @SystemApis, once they become mainline @@ -1631,6 +1661,17 @@ public final class SystemServiceRegistry { OnDevicePersonalizationFrameworkInitializer.registerServiceWrappers(); DeviceLockFrameworkInitializer.registerServiceWrappers(); VirtualizationFrameworkInitializer.registerServiceWrappers(); + // This code is executed on zygote during preload, where only read-only + // flags can be used. Do not use mutable flags. + if (android.permission.flags.Flags.enhancedConfirmationModeApisEnabled()) { + EnhancedConfirmationFrameworkInitializer.registerServiceWrappers(); + } + if (android.server.Flags.telemetryApisService()) { + ProfilingFrameworkInitializer.registerServiceWrappers(); + } + if (android.webkit.Flags.updateServiceIpcWrapper()) { + WebViewBootstrapFrameworkInitializer.registerServiceWrappers(); + } } finally { // If any of the above code throws, we're in a pretty bad shape and the process // will likely crash, but we'll reset it just in case there's an exception handler... @@ -1651,11 +1692,7 @@ public final class SystemServiceRegistry { return new Object[sServiceCacheSize]; } - /** - * Gets a system service from a given context. - * @hide - */ - public static Object getSystemService(ContextImpl ctx, String name) { + private static ServiceFetcher getSystemServiceFetcher(String name) { if (name == null) { return null; } @@ -1666,6 +1703,18 @@ public final class SystemServiceRegistry { } return null; } + return fetcher; + } + + /** + * Gets a system service from a given context. + * @hide + */ + public static Object getSystemService(@NonNull ContextImpl ctx, String name) { + final ServiceFetcher fetcher = getSystemServiceFetcher(name); + if (fetcher == null) { + return null; + } final Object ret = fetcher.getService(ctx); if (sEnableServiceNotFoundWtf && ret == null) { @@ -1692,6 +1741,26 @@ public final class SystemServiceRegistry { return ret; } + /** + * Gets a system service which has opted-in to being fetched without a context. + * @hide + */ + @FlaggedApi(android.webkit.Flags.FLAG_UPDATE_SERVICE_IPC_WRAPPER) + @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES) + public static @Nullable Object getSystemServiceWithNoContext(@NonNull String name) { + final ServiceFetcher fetcher = getSystemServiceFetcher(name); + if (fetcher == null) { + return null; + } + + if (!fetcher.supportsFetchWithoutContext()) { + throw new IllegalArgumentException( + "Manager cannot be fetched without a context: " + name); + } + + return fetcher.getService(null); + } + /** * Gets the name of the system-level service that is represented by the specified class. * @hide @@ -1845,6 +1914,50 @@ public final class SystemServiceRegistry { }}); } + /** + * Used by apex modules to register a "service wrapper" that is not tied to any {@link Context} + * and will never require a context in the future. + * + * Services registered in this way can be fetched via + * {@link #getSystemServiceWithNoContext(String)}, so cannot require a context in future without + * a breaking change. + * + *

This can only be called from the methods called by the static initializer of + * {@link SystemServiceRegistry}. (Otherwise it throws a {@link IllegalStateException}.) + * + * @param serviceName the name of the binder object, such as + * {@link Context#JOB_SCHEDULER_SERVICE}. + * @param serviceWrapperClass the wrapper class, such as the class of + * {@link android.app.job.JobScheduler}. + * @param serviceProducer Callback that takes the service binder object with the name + * {@code serviceName} and returns an actual service wrapper instance. + * + * @hide + */ + @FlaggedApi(android.webkit.Flags.FLAG_UPDATE_SERVICE_IPC_WRAPPER) + @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES) + public static void registerForeverStaticService( + @NonNull String serviceName, @NonNull Class serviceWrapperClass, + @NonNull StaticServiceProducerWithBinder serviceProducer) { + ensureInitializing("registerStaticService"); + Preconditions.checkStringNotEmpty(serviceName); + Objects.requireNonNull(serviceWrapperClass); + Objects.requireNonNull(serviceProducer); + + registerService(serviceName, serviceWrapperClass, + new StaticServiceFetcher() { + @Override + public TServiceClass createService() throws ServiceNotFoundException { + return serviceProducer.createService( + ServiceManager.getServiceOrThrow(serviceName)); + } + + @Override + public boolean supportsFetchWithoutContext() { + return true; + }}); + } + /** * Similar to {@link #registerStaticService(String, Class, StaticServiceProducerWithBinder)}, * but used for a "service wrapper" that doesn't take a service binder in its constructor. @@ -1935,6 +2048,18 @@ public final class SystemServiceRegistry { */ static abstract interface ServiceFetcher { T getService(ContextImpl ctx); + + /** + * Should this service fetcher support being fetched via {@link #getSystemService(String)}, + * without a Context? + * + * This means that the service cannot depend on a Context in future! + * + * @return true if this is supported for this service. + */ + default boolean supportsFetchWithoutContext() { + return false; + } } /** @@ -2042,6 +2167,11 @@ public final class SystemServiceRegistry { } public abstract T createService(ContextImpl ctx) throws ServiceNotFoundException; + + // Services that explicitly use a Context can never be fetched without one. + public final boolean supportsFetchWithoutContext() { + return false; + } } /** @@ -2066,6 +2196,13 @@ public final class SystemServiceRegistry { } public abstract T createService() throws ServiceNotFoundException; + + // Services that do not need a Context can potentially be fetched without one, but the + // default is false, so that the service can require one in future without this being a + // breaking change. + public boolean supportsFetchWithoutContext() { + return false; + } } /** @hide */ diff --git a/core/java/android/app/UiAutomationConnection.java b/core/java/android/app/UiAutomationConnection.java index ce1d43d10c343e2251347f417bedaf51366ea3d7..33e260f352aa64d02aaeaa9bc36968f231b905f0 100644 --- a/core/java/android/app/UiAutomationConnection.java +++ b/core/java/android/app/UiAutomationConnection.java @@ -23,6 +23,7 @@ import android.accessibilityservice.IAccessibilityServiceClient; import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.UserIdInt; +import android.companion.virtual.VirtualDeviceManager; import android.compat.annotation.UnsupportedAppUsage; import android.content.Context; import android.graphics.Rect; @@ -363,7 +364,7 @@ public final class UiAutomationConnection extends IUiAutomationConnection.Stub { final long identity = Binder.clearCallingIdentity(); try { mPermissionManager.grantRuntimePermission(packageName, permission, - Context.DEVICE_ID_DEFAULT, userId); + VirtualDeviceManager.PERSISTENT_DEVICE_ID_DEFAULT, userId); } finally { Binder.restoreCallingIdentity(identity); } @@ -383,7 +384,7 @@ public final class UiAutomationConnection extends IUiAutomationConnection.Stub { final long identity = Binder.clearCallingIdentity(); try { mPermissionManager.revokeRuntimePermission(packageName, permission, - Context.DEVICE_ID_DEFAULT, userId, null); + VirtualDeviceManager.PERSISTENT_DEVICE_ID_DEFAULT, userId, null); } finally { Binder.restoreCallingIdentity(identity); } diff --git a/core/java/android/app/UiModeManager.java b/core/java/android/app/UiModeManager.java index 0ccb9cddf58de5facf08eb14bab5266fa07729e9..7903f1c0c5c3fbd9297638d7ad106ad2d0a011c0 100644 --- a/core/java/android/app/UiModeManager.java +++ b/core/java/android/app/UiModeManager.java @@ -16,7 +16,10 @@ package android.app; +import static android.app.Flags.enableNightModeBinderCache; + import android.annotation.CallbackExecutor; +import android.annotation.FlaggedApi; import android.annotation.FloatRange; import android.annotation.IntDef; import android.annotation.IntRange; @@ -30,6 +33,7 @@ import android.compat.annotation.UnsupportedAppUsage; import android.content.Context; import android.content.res.Configuration; import android.os.Binder; +import android.os.IpcDataCache; import android.os.RemoteException; import android.os.ServiceManager; import android.os.ServiceManager.ServiceNotFoundException; @@ -265,6 +269,60 @@ public class UiModeManager { */ public static final int MODE_NIGHT_YES = 2; + /** @hide */ + @IntDef(prefix = { "MODE_ATTENTION_THEME_OVERLAY_" }, value = { + MODE_ATTENTION_THEME_OVERLAY_OFF, + MODE_ATTENTION_THEME_OVERLAY_NIGHT, + MODE_ATTENTION_THEME_OVERLAY_DAY + }) + @Retention(RetentionPolicy.SOURCE) + public @interface AttentionModeThemeOverlayType {} + + /** @hide */ + @IntDef(prefix = { "MODE_ATTENTION_THEME_OVERLAY_" }, value = { + MODE_ATTENTION_THEME_OVERLAY_OFF, + MODE_ATTENTION_THEME_OVERLAY_NIGHT, + MODE_ATTENTION_THEME_OVERLAY_DAY, + MODE_ATTENTION_THEME_OVERLAY_UNKNOWN + }) + @Retention(RetentionPolicy.SOURCE) + public @interface AttentionModeThemeOverlayReturnType {} + + /** + * Constant for {@link #setAttentionModeThemeOverlay(int)} (int)} and {@link + * #getAttentionModeThemeOverlay()}: Keeps night mode as set by {@link #setNightMode(int)}. + * @hide + */ + @FlaggedApi(Flags.FLAG_MODES_API) + @TestApi + public static final int MODE_ATTENTION_THEME_OVERLAY_OFF = 1000; + + /** + * Constant for {@link #setAttentionModeThemeOverlay(int)} (int)} and {@link + * #getAttentionModeThemeOverlay()}: Maintains night mode always on. + * @hide + */ + @FlaggedApi(Flags.FLAG_MODES_API) + @TestApi + public static final int MODE_ATTENTION_THEME_OVERLAY_NIGHT = 1001; + + /** + * Constant for {@link #setAttentionModeThemeOverlay(int)} (int)} and {@link + * #getAttentionModeThemeOverlay()}: Maintains night mode always off (Light). + * @hide + */ + @FlaggedApi(Flags.FLAG_MODES_API) + @TestApi + public static final int MODE_ATTENTION_THEME_OVERLAY_DAY = 1002; + + /** + * Constant for {@link #getAttentionModeThemeOverlay()}: Error communication with server. + * @hide + */ + @FlaggedApi(Flags.FLAG_MODES_API) + @TestApi + public static final int MODE_ATTENTION_THEME_OVERLAY_UNKNOWN = -1; + /** * Granular types for {@link #setNightModeCustomType(int)} * @hide @@ -732,6 +790,55 @@ public class UiModeManager { return MODE_NIGHT_CUSTOM_TYPE_UNKNOWN; } + /** + * Overlays current Attention mode Night Mode overlay. + * {@code attentionModeThemeOverlayType}. + * + * @throws IllegalArgumentException if passed an unsupported type to + * {@code AttentionModeThemeOverlayType}. + * @hide + */ + @FlaggedApi(Flags.FLAG_MODES_API) + @RequiresPermission(android.Manifest.permission.MODIFY_DAY_NIGHT_MODE) + public void setAttentionModeThemeOverlay( + @AttentionModeThemeOverlayType int attentionModeThemeOverlayType) { + if (sGlobals != null) { + try { + sGlobals.mService.setAttentionModeThemeOverlay(attentionModeThemeOverlayType); + } catch (RemoteException e) { + throw e.rethrowFromSystemServer(); + } + } + } + + /** + * Returns the currently configured Attention Mode theme overlay. + *

+ * May be one of: + *

    + *
  • {@link #MODE_ATTENTION_THEME_OVERLAY_OFF}
  • + *
  • {@link #MODE_ATTENTION_THEME_OVERLAY_NIGHT}
  • + *
  • {@link #MODE_ATTENTION_THEME_OVERLAY_DAY}
  • + *
  • {@link #MODE_ATTENTION_THEME_OVERLAY_UNKNOWN}
  • + *
+ *

+ * + * @hide + */ + @FlaggedApi(Flags.FLAG_MODES_API) + @TestApi + @RequiresPermission(android.Manifest.permission.MODIFY_DAY_NIGHT_MODE) + public @AttentionModeThemeOverlayReturnType int getAttentionModeThemeOverlay() { + if (sGlobals != null) { + try { + return sGlobals.mService.getAttentionModeThemeOverlay(); + } catch (RemoteException e) { + throw e.rethrowFromSystemServer(); + } + } + return MODE_ATTENTION_THEME_OVERLAY_UNKNOWN; + } + /** * Sets and persist the night mode for this application. *

@@ -770,6 +877,51 @@ public class UiModeManager { } } + private Integer getNightModeFromServer() { + try { + if (sGlobals != null) { + return sGlobals.mService.getNightMode(); + } + return -1; + } catch (RemoteException e) { + throw e.rethrowFromSystemServer(); + } + } + + + /** + * Retrieve the night mode for the user. + */ + private final IpcDataCache.QueryHandler mNightModeQuery = + new IpcDataCache.QueryHandler<>() { + + @Override + @NonNull + public Integer apply(Void query) { + return getNightModeFromServer(); + } + }; + + private static final String NIGHT_MODE_API = "getNightMode"; + + /** + * Cache the night mode for a user. + */ + private final IpcDataCache mNightModeCache = + new IpcDataCache<>(1, IpcDataCache.MODULE_SYSTEM, + NIGHT_MODE_API, /* cacheName= */ "NightModeCache", mNightModeQuery); + + /** + * Invalidate the night mode cache. + * + * @hide + */ + @FlaggedApi(Flags.FLAG_ENABLE_NIGHT_MODE_BINDER_CACHE) + public static void invalidateNightModeCache() { + IpcDataCache.invalidateCache(IpcDataCache.MODULE_SYSTEM, + NIGHT_MODE_API); + } + /** * Returns the currently configured night mode. *

@@ -786,14 +938,11 @@ public class UiModeManager { * @see #setNightMode(int) */ public @NightMode int getNightMode() { - if (sGlobals != null) { - try { - return sGlobals.mService.getNightMode(); - } catch (RemoteException e) { - throw e.rethrowFromSystemServer(); - } + if (enableNightModeBinderCache()) { + return mNightModeCache.query(null); + } else { + return getNightModeFromServer(); } - return -1; } /** diff --git a/core/java/android/app/WallpaperManager.java b/core/java/android/app/WallpaperManager.java index 820ff3e308e48ea625afbcbb3dd2612b4d67d7e6..02d694436bfebf6ecd7b03458d306b1d9341b6d7 100644 --- a/core/java/android/app/WallpaperManager.java +++ b/core/java/android/app/WallpaperManager.java @@ -18,11 +18,14 @@ package android.app; import static android.Manifest.permission.MANAGE_EXTERNAL_STORAGE; import static android.Manifest.permission.READ_WALLPAPER_INTERNAL; +import static android.Manifest.permission.SET_WALLPAPER_DIM_AMOUNT; import static android.content.pm.PackageManager.PERMISSION_GRANTED; import static android.os.ParcelFileDescriptor.MODE_READ_ONLY; +import static com.android.window.flags.Flags.FLAG_MULTI_CROP; import static com.android.window.flags.Flags.multiCrop; +import android.annotation.FlaggedApi; import android.annotation.FloatRange; import android.annotation.IntDef; import android.annotation.NonNull; @@ -58,6 +61,7 @@ import android.graphics.ImageDecoder; import android.graphics.Matrix; import android.graphics.Paint; import android.graphics.PixelFormat; +import android.graphics.Point; import android.graphics.PorterDuff; import android.graphics.PorterDuffXfermode; import android.graphics.Rect; @@ -77,21 +81,23 @@ import android.os.ParcelFileDescriptor; import android.os.RemoteException; import android.os.StrictMode; import android.os.SystemProperties; +import android.os.Trace; import android.text.TextUtils; import android.util.ArrayMap; import android.util.ArraySet; import android.util.Log; import android.util.MathUtils; import android.util.Pair; +import android.util.SparseArray; import android.view.Display; import android.view.WindowManagerGlobal; import com.android.internal.R; +import com.android.internal.annotations.Keep; import libcore.io.IoUtils; import java.io.BufferedInputStream; -import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; @@ -104,6 +110,7 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.HashSet; import java.util.List; +import java.util.Map; import java.util.Set; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; @@ -254,6 +261,13 @@ public class WallpaperManager { */ public static final String COMMAND_GOING_TO_SLEEP = "android.wallpaper.goingtosleep"; + /** + * Command for {@link #sendWallpaperCommand}: reported when a physical display switch event + * happens, e.g. fold and unfold. + * @hide + */ + public static final String COMMAND_DISPLAY_SWITCH = "android.wallpaper.displayswitch"; + /** * Command for {@link #sendWallpaperCommand}: reported when the wallpaper that was already * set is re-applied by the user. @@ -289,6 +303,79 @@ public class WallpaperManager { public static final String EXTRA_FROM_FOREGROUND_APP = "android.service.wallpaper.extra.FROM_FOREGROUND_APP"; + /** + * The different screen orientations. {@link #getOrientation} provides their exact definition. + * This is only used internally by the framework and the WallpaperBackupAgent. + * @hide + */ + @IntDef(value = { + ORIENTATION_UNKNOWN, + PORTRAIT, + LANDSCAPE, + SQUARE_PORTRAIT, + SQUARE_LANDSCAPE, + }) + @Retention(RetentionPolicy.SOURCE) + public @interface ScreenOrientation {} + + /** + * @hide + */ + public static final int ORIENTATION_UNKNOWN = -1; + + /** + * Portrait orientation of most screens + * @hide + */ + public static final int PORTRAIT = 0; + + /** + * Landscape orientation of most screens + * @hide + */ + public static final int LANDSCAPE = 1; + + /** + * Portrait orientation with similar width and height (e.g. the inner screen of a foldable) + * @hide + */ + public static final int SQUARE_PORTRAIT = 2; + + /** + * Landscape orientation with similar width and height (e.g. the inner screen of a foldable) + * @hide + */ + public static final int SQUARE_LANDSCAPE = 3; + + /** + * Converts a (width, height) screen size to a {@link ScreenOrientation}. + * @param screenSize the dimensions of a screen + * @return the corresponding {@link ScreenOrientation}. + * @hide + */ + public static @ScreenOrientation int getOrientation(Point screenSize) { + float ratio = ((float) screenSize.x) / screenSize.y; + // ratios between 3/4 and 4/3 are considered square + return ratio >= 4 / 3f ? LANDSCAPE + : ratio > 1f ? SQUARE_LANDSCAPE + : ratio > 3 / 4f ? SQUARE_PORTRAIT + : PORTRAIT; + } + + /** + * Get the 90° rotation of a given orientation + * @hide + */ + public static @ScreenOrientation int getRotatedOrientation(@ScreenOrientation int orientation) { + switch (orientation) { + case PORTRAIT: return LANDSCAPE; + case LANDSCAPE: return PORTRAIT; + case SQUARE_PORTRAIT: return SQUARE_LANDSCAPE; + case SQUARE_LANDSCAPE: return SQUARE_PORTRAIT; + default: return ORIENTATION_UNKNOWN; + } + } + // flags for which kind of wallpaper to act on /** @hide */ @@ -614,11 +701,14 @@ public class WallpaperManager { ColorManagementProxy cmProxy) { if (mService != null) { try { + Trace.beginSection("WPMS.isWallpaperSupported"); if (!mService.isWallpaperSupported(context.getOpPackageName())) { return null; } } catch (RemoteException e) { throw e.rethrowFromSystemServer(); + } finally { + Trace.endSection(); } } synchronized (this) { @@ -629,6 +719,7 @@ public class WallpaperManager { mCachedWallpaper = null; Bitmap currentWallpaper = null; try { + Trace.beginSection("WPMS.getCurrentWallpaperLocked"); currentWallpaper = getCurrentWallpaperLocked( context, which, userId, hardware, cmProxy); } catch (OutOfMemoryError e) { @@ -654,6 +745,8 @@ public class WallpaperManager { // Post-O apps really most sincerely need the permission. throw e; } + } finally { + Trace.endSection(); } if (currentWallpaper != null) { mCachedWallpaper = new CachedWallpaper(currentWallpaper, userId, which); @@ -732,30 +825,27 @@ public class WallpaperManager { try { Bundle params = new Bundle(); + Trace.beginSection("WPMS.getWallpaperWithFeature_" + which); ParcelFileDescriptor pfd = mService.getWallpaperWithFeature( context.getOpPackageName(), context.getAttributionTag(), this, which, params, userId, /* getCropped = */ true); + Trace.endSection(); - if (pfd != null) { - try (BufferedInputStream bis = new BufferedInputStream( - new ParcelFileDescriptor.AutoCloseInputStream(pfd))) { - final ByteArrayOutputStream baos = new ByteArrayOutputStream(); - int data; - while ((data = bis.read()) != -1) { - baos.write(data); + if (pfd == null) { + return null; + } + try (InputStream is = new ParcelFileDescriptor.AutoCloseInputStream(pfd)) { + ImageDecoder.Source src = ImageDecoder.createSource(context.getResources(), is); + return ImageDecoder.decodeBitmap(src, ((decoder, info, source) -> { + // Mutable and hardware config can't be set at the same time. + decoder.setMutableRequired(!hardware); + // Let's do color management + if (cmProxy != null) { + cmProxy.doColorManagement(decoder, info); } - ImageDecoder.Source src = ImageDecoder.createSource(baos.toByteArray()); - return ImageDecoder.decodeBitmap(src, ((decoder, info, source) -> { - // Mutable and hardware config can't be set at the same time. - decoder.setMutableRequired(!hardware); - // Let's do color management - if (cmProxy != null) { - cmProxy.doColorManagement(decoder, info); - } - })); - } catch (OutOfMemoryError | IOException e) { - Log.w(TAG, "Can't decode file", e); - } + })); + } catch (OutOfMemoryError | IOException e) { + Log.w(TAG, "Can't decode file", e); } } catch (RemoteException e) { throw e.rethrowFromSystemServer(); @@ -764,13 +854,18 @@ public class WallpaperManager { } private Bitmap getDefaultWallpaper(Context context, @SetWallpaperFlags int which) { + Trace.beginSection("WPMS.getDefaultWallpaper_" + which); Bitmap defaultWallpaper = mDefaultWallpaper; if (defaultWallpaper == null || defaultWallpaper.isRecycled()) { defaultWallpaper = null; + Trace.beginSection("WPMS.openDefaultWallpaper"); try (InputStream is = openDefaultWallpaper(context, which)) { + Trace.endSection(); if (is != null) { BitmapFactory.Options options = new BitmapFactory.Options(); + Trace.beginSection("WPMS.decodeStream"); defaultWallpaper = BitmapFactory.decodeStream(is, null, options); + Trace.endSection(); } } catch (OutOfMemoryError | IOException e) { Log.w(TAG, "Can't decode stream", e); @@ -779,6 +874,7 @@ public class WallpaperManager { synchronized (this) { mDefaultWallpaper = defaultWallpaper; } + Trace.endSection(); return defaultWallpaper; } @@ -858,15 +954,8 @@ public class WallpaperManager { * @hide */ public static boolean isMultiCropEnabled() { - if (sGlobals == null) { - sIsMultiCropEnabled = multiCrop(); - } if (sIsMultiCropEnabled == null) { - try { - sIsMultiCropEnabled = sGlobals.mService.isMultiCropEnabled(); - } catch (RemoteException e) { - e.rethrowFromSystemServer(); - } + sIsMultiCropEnabled = multiCrop(); } return sIsMultiCropEnabled; } @@ -892,12 +981,12 @@ public class WallpaperManager { /** * Important note: *